From 31e604a677cfad820f1d77f585800c772bb5461a Mon Sep 17 00:00:00 2001 From: Max Patiiuk Date: Sun, 3 Dec 2023 22:16:51 +0000 Subject: [PATCH] deploy: dd17107b8668626d92bd9e0fd8108f14b225e645 --- .nojekyll | 0 assets/APIKeyMixin-878a7aa7.js | 1 + assets/Analysis-932d2cd8.js | 1 + assets/ArcGISCachedService-344b6262.js | 1 + assets/ArcGISService-83287338.js | 1 + .../AreaMeasurementAnalysisView3D-26f7cb40.js | 20 + assets/AtmosphereCompositing.glsl-69a14b5e.js | 1 + assets/AttachmentInfo-cb670dd0.js | 1 + assets/AttachmentQuery-972bbd60.js | 1 + assets/BaseDynamicLayerView3D-83fabc6e.js | 1 + assets/BidiEngine-9a40f2f4.js | 1 + assets/BingMapsLayer-358d6de4.js | 1 + assets/BlendLayers.glsl-79ff1735.js | 1 + assets/BlendWeights.glsl-79c88ca2.js | 1 + assets/Blur.glsl-2561d33a.js | 1 + assets/BoundsStore-b6bd3c14.js | 1 + assets/BuildingComponentSublayer-5d49e5f9.js | 1 + assets/BuildingGroupSublayer-d6113346.js | 1 + assets/BuildingSceneLayer-f39f2837.js | 1 + assets/BuildingSceneLayerView3D-15511316.js | 3 + assets/Button-5999eab8.js | 1 + assets/CIMSymbolRasterizer-1692cd3f.js | 1 + assets/CSVLayer-5ae17e31.js | 1 + assets/CSVLayerView3D-f68a6513.js | 1 + assets/CSVSourceWorker-51c044a2.js | 4 + assets/ChapmanAtmosphere.glsl-badaea29.js | 1 + assets/CheckerBoard.glsl-7d1da857.js | 1 + assets/Clouds.glsl-918fa9c8.js | 1 + assets/CloudsComposition.glsl-e9072d6f.js | 1 + assets/ColorMaterial.glsl-c349707a.js | 1 + assets/ColorSet-bb3b0c3c.js | 1 + assets/ComponentShader.glsl-ec5515fa.js | 1 + assets/Compositing.glsl-2c5c8d4d.js | 1 + assets/CustomParametersMixin-231c4be8.js | 1 + assets/DefaultMaterial.glsl-ab417bbf.js | 1 + ...nitionExpressionSceneLayerView-66b62d34.js | 1 + assets/DictionaryLoader-c0729336.js | 1 + assets/DimensionAnalysisView3D-4f55aca1.js | 1 + assets/DimensionLayer-56b346fa.js | 1 + assets/DimensionLayerView3D-9f833e6e.js | 1 + ...tLineMeasurementAnalysisView3D-f383b6d8.js | 33 + assets/DynamicLayerView3D-b48678f2.js | 1 + assets/EdgeDetect.glsl-43794585.js | 1 + assets/EdgeProcessingWorker-615066a5.js | 1 + assets/EdgeShader.glsl-e2d5d7be.js | 1 + assets/EditBusLayer-d71787e9.js | 1 + assets/EditGeometryOperations-0ec3f5b5.js | 1 + assets/ElevationLayer-61bc2d81.js | 1 + assets/ElevationLayerView3D-eeaaa8c4.js | 1 + assets/ElevationQuery-6f358c3e.js | 1 + assets/ElevationSamplerWorker-d53250c9.js | 1 + assets/EventedSet-d13fada5.js | 1 + assets/ExportImageParameters-649a2637.js | 1 + assets/ExportWMSImageParameters-d63354ac.js | 1 + assets/Factory-8e329f4b.js | 5 + ...eatureCollectionSnappingSource-3f1024ad.js | 1 + assets/FeatureEffect-86735d98.js | 1 + assets/FeatureEffectLayer-4160946c.js | 1 + assets/FeatureFilter-00f4be05.js | 1 + assets/FeatureFilter-2d6ab0aa.js | 1 + assets/FeatureLayer-5c6d2c3b.js | 1 + assets/FeatureLayerBase-7c7dfccb.js | 1 + assets/FeatureLayerSource-b0c6b618.js | 1 + assets/FeatureLayerView3D-7e7e2653.js | 1 + assets/FeatureLayerViewBase3D-8474587e.js | 1 + assets/FeatureLikeLayerView3D-2e3185ce.js | 32 + assets/FeatureReductionLayer-4262cf54.js | 1 + .../FeatureServiceSnappingSource-14e28ceb.js | 3 + ...ureServiceSnappingSourceWorker-19fe862a.js | 1 + assets/FeatureSet-111cb247.js | 1 + assets/FeatureStore-f0e312fc.js | 1 + assets/FeatureTemplate-2a7e96c1.js | 1 + assets/FeatureTileTree3DDebugger-3e47616a.js | 1 + assets/FeatureType-db96032c.js | 1 + .../FetchAssociatedFeatureLayer-15c90b75.js | 1 + assets/FieldsIndex-f79a8f26.js | 1 + assets/FloatingArrow-54d0aa06.js | 13 + assets/Fog.glsl-332cff80.js | 1 + assets/GeoJSONLayer-71b9768b.js | 1 + assets/GeoJSONLayerView3D-be497a18.js | 1 + assets/GeoJSONSourceWorker-555763c3.js | 1 + assets/GeoRSSLayer-f82698fe.js | 1 + assets/GeometryUtils-0258f920.js | 1 + assets/Graphics3DObjectStates-bb2a6162.js | 1 + assets/GraphicsLayerView3D-f93de954.js | 1 + assets/GraphicsProcessor-750d4e2b.js | 1 + assets/GraphicsSnappingSource-c09f0afd.js | 1 + assets/GraphicsView3D-1336db36.js | 1 + assets/GroupLayer-d83741dd.js | 1 + assets/GroupLayerView-c93dbf5e.js | 1 + assets/HUDCompositing.glsl-67260826.js | 1 + assets/HUDMaterial.glsl-6c800f3a.js | 1 + assets/Heatmap.glsl-30acef82.js | 1 + assets/HeatmapDensity.glsl-403624d9.js | 1 + assets/HeatmapProcessor-db17730e.js | 1 + assets/HighlightApply.glsl-d2c44603.js | 1 + assets/HighlightBlur.glsl-8389b4e8.js | 1 + assets/HighlightDownsample.glsl-b1b35495.js | 1 + assets/I3SBinaryReader-2b8e30f7.js | 2 + assets/I3SIndexInfo-445e6968.js | 1 + assets/I3SLayerDefinitions-ffdb3821.js | 1 + assets/I3SMeshView3D-86f2c945.js | 1 + assets/I3SNode-2025159f.js | 1 + assets/I3SOverrides-96f73e2b.js | 1 + assets/I3SQueryFeatureStore-0cfa6ebc.js | 1 + assets/I3STreeDebugger-794166fd.js | 1 + assets/I3SUtil-2c288808.js | 1 + assets/IdentityManager-47bd1e1a.js | 7 + assets/ImageHistogramParameters-84349e1d.js | 1 + assets/ImageMaterial-5c48df66.js | 33 + assets/ImageMaterial.glsl-42017fca.js | 1 + assets/ImageryLayer-4aa91771.js | 1 + assets/ImageryLayerView3D-b65487bb.js | 1 + assets/ImageryTileLayer-19c32ddc.js | 2 + assets/ImageryTileLayerView3D-7bc4c9c1.js | 1 + assets/IntegratedMeshLayer-cad83962.js | 1 + assets/IntegratedMeshLayerView3D-9c474b52.js | 1 + assets/KMLLayer-1c6bcbfe.js | 1 + assets/LabelClass-2d53c485.js | 1 + assets/LaserlinePath.glsl-f6fdf1ff.js | 1 + assets/Laserlines.glsl-fc6ed0d2.js | 1 + assets/LayerView-448bc5ea.js | 1 + assets/LayerView3D-ffd35809.js | 1 + assets/LengthDimension-92faee98.js | 1 + assets/LercWorker-aac3e5c8.js | 1 + assets/LineCallout.glsl-cb1ab83b.js | 1 + assets/LineMarker.glsl-c22f9f73.js | 1 + assets/LineOfSightAnalysisTarget-7f5e80d1.js | 1 + assets/LineOfSightAnalysisView3D-ccdd2ae5.js | 1 + assets/LineOfSightLayer-e674c03f.js | 1 + assets/LineOfSightLayerView3D-75d7761d.js | 1 + assets/LineVisualElement-b605d10c.js | 1 + assets/LinkChartLayer-fed775d8.js | 1 + assets/MapImageLayer-1956b83f.js | 1 + assets/MapImageLayerView3D-5536e520.js | 1 + assets/MapNotesLayer-637d9bd1.js | 1 + assets/MapServiceLayerViewHelper-fdadc63a.js | 1 + assets/MeasurementArrow.glsl-3a559294.js | 1 + assets/MediaElementView-dc36bc9f.js | 1 + assets/MediaLayer-be2aa899.js | 1 + assets/MediaLayerView3D-69d89f9a.js | 1 + assets/MemorySourceWorker-31156e3d.js | 1 + assets/MultiOriginJSONSupport-e4912ffd.js | 1 + assets/NativeLine.glsl-1fd72627.js | 1 + assets/NoiseTextureAtlas.glsl-655df1b4.js | 1 + assets/OGCFeatureLayer-257da298.js | 1 + assets/OGCFeatureLayerView3D-dbd9812b.js | 1 + assets/OITCompositing.glsl-858510ff.js | 1 + assets/OpenStreetMapLayer-3ecd3975.js | 1 + assets/OperationalLayer-0e8f8b28.js | 1 + assets/OrderedLayer-68067459.js | 1 + assets/OrientedImageryLayer-2b6cc12d.js | 1 + assets/OverlayCompositing.glsl-cf0d34dd.js | 1 + assets/PBFDecoderWorker-113e9c75.js | 1 + assets/Path.glsl-bb1cac2d.js | 1 + assets/Pattern.glsl-2fa8b945.js | 1 + assets/Pipeline-98b9d349.js | 16 + assets/PointCloudLayer-b4103b13.js | 11 + assets/PointCloudLayerView3D-35572558.js | 56 + .../PointCloudUniqueValueRenderer-df78a172.js | 1 + assets/PointCloudWorker-68a2e657.js | 1 + assets/PointCloudWorkerUtil-ec4f2005.js | 1 + assets/PointRenderer.glsl-e83bfa82.js | 1 + assets/PointVisualElement-2a56e55d.js | 149 + assets/PooledRBush-3cae7682.js | 1 + assets/Popup-db207f4c.js | 2 + assets/PopupSceneLayerView-c49dd096.js | 1 + assets/PortalLayer-310c2800.js | 2 + assets/Precipitation.glsl-5b05b6be.js | 1 + assets/Query-1c961d4c.js | 1 + assets/QueryEngine-19eda5ff.js | 1 + assets/QueryEngineCapabilities-42e44ded.js | 1 + assets/QueryTask-6f808a9e.js | 1 + assets/RasterColorizer.glsl-724b79fe.js | 1 + assets/RasterWorker-cd959d79.js | 1 + assets/RealisticTree.glsl-2623185f.js | 1 + assets/Rect-98da58d6.js | 1 + assets/RefreshableLayerView-915e7f53.js | 1 + assets/RelationshipQuery-39c07195.js | 1 + assets/RibbonLine.glsl-0c86e4e2.js | 1 + .../RightAngleQuadVisualElement-8daf0594.js | 1 + assets/RouteLayer-fdf5da4e.js | 2 + assets/RouteLayerView3D-0557987b.js | 1 + assets/SSAO.glsl-8e275b51.js | 1 + assets/SSAOBlur.glsl-1cf88496.js | 1 + assets/SceneLayer-fdf1363f.js | 1 + assets/SceneLayerGraphicsView3D-8d7d0182.js | 1 + assets/SceneLayerSnappingSource-176431c8.js | 1 + ...SceneLayerSnappingSourceWorker-3df2f794.js | 1 + assets/SceneLayerView-b7d3fe23.js | 1 + assets/SceneLayerView3D-ef96402b.js | 1 + assets/SceneLayerWorker-e92c2264.js | 1 + assets/SceneModification-2715f58a.js | 1 + assets/SceneService-6fea113d.js | 3 + assets/Segment-50129b50.js | 1 + assets/ShadedColorMaterial.glsl-2686362a.js | 1 + assets/ShadowCastAccumulate.glsl-15b89038.js | 1 + assets/ShadowCastVisualize.glsl-2c61efe0.js | 1 + assets/ShadowHighlight.glsl-56ab9734.js | 1 + assets/SimpleAtmosphere.glsl-137a19b0.js | 1 + assets/SliceAnalysisView3D-63c25320.js | 16 + assets/SlicePlaneMaterial.glsl-99e82c24.js | 1 + assets/SmaaRenderPassData-660b7d34.js | 1 + assets/SpatialFilter-d44507d6.js | 1 + assets/Stars.glsl-0c573990.js | 1 + assets/Stop-9d81fe58.js | 1 + assets/StreamFeatureManager-4b8ac3ac.js | 1 + assets/StreamLayer-bacc7345.js | 1 + assets/StreamLayerView3D-9f3bc35d.js | 1 + assets/StyleRepository-2362164f.js | 9 + assets/SublayersOwner-ee341b5e.js | 1 + assets/SubtypeGroupLayer-181166ae.js | 1 + assets/SymbolProcessor-f81deaae.js | 1 + assets/TemporalLayer-f17c9161.js | 1 + assets/Terrain.glsl-84e9c4a7.js | 1 + assets/TerrainTileTree3DDebugger-33a28731.js | 1 + assets/TextureOnly.glsl-41ddb8a9.js | 1 + assets/Tick-c7ca49b9.js | 1 + assets/TileClipper-ae6eca9e.js | 1 + assets/TileInfoTilemapCache-b3f5dda7.js | 1 + assets/TileInfoView-346e56d0.js | 1 + assets/TileLayer-30014b67.js | 1 + assets/TileLayerView3D-844ae299.js | 1 + assets/TileTreeDebugger-142b9f39.js | 1 + assets/TiledLayerView3D-a11f8026.js | 1 + assets/TilemapCache-67ada3c3.js | 1 + assets/TopFeaturesQuery-e44d05be.js | 1 + assets/TurboLine-aac2edf4.js | 1 + assets/UniqueValueRenderer-fef4204d.js | 1 + assets/UnitNormalizer-818a6664.js | 1 + assets/UnknownLayer-c61e7207.js | 1 + assets/UnsupportedLayer-7b99a9d5.js | 1 + assets/VectorTileLayer-43018d94.js | 1 + assets/VectorTileLayerView3D-617343b6.js | 555 ++ assets/VertexSnappingCandidate-0a987e12.js | 1 + assets/VisualElementResources-e52972a5.js | 1 + assets/VoxelLayer-b454e868.js | 1 + assets/VoxelLayerView3D-a9ee300f.js | 1 + assets/VoxelWasmPerSceneView-0fc2c231.js | 1 + assets/WFSLayer-c70988b2.js | 1 + assets/WFSLayerView3D-37f84843.js | 1 + assets/WFSSourceWorker-1db6d954.js | 1 + assets/WMSLayer-a3157ab4.js | 2 + assets/WMSLayerView3D-4330be5d.js | 1 + assets/WMTSLayer-d2e84f3b.js | 1 + assets/WMTSLayerView3D-b2043cf0.js | 1 + assets/WaterSurface.glsl-a424eae6.js | 1 + assets/WebTileLayer-df8c0816.js | 1 + assets/WhereClause-c86b9974.js | 7 + assets/WorkerTileHandler-fcaca023.js | 2 + assets/action-0a339dee.js | 15 + assets/analysisViewUtils-68ab721d.js | 31 + assets/ar2-dfb29e9e.js | 1 + assets/arcadeAsyncRuntime-8b244fcf.js | 2 + assets/arcadeTimeUtils-e1438cc8.js | 1 + assets/arcadeUtils-b902d678.js | 163 + .../arcgis-knowledge-client-core-59a3e261.js | 3 + ...gis-knowledge-client-core-simd-37b35211.js | 3 + assets/arcgisLayers-23a0b701.js | 1 + assets/basis_transcoder-bff818ce.js | 2 + assets/bg_BG2-08c99e6c.js | 1 + assets/bs_BA2-f2917445.js | 1 + assets/ca_ES2-f5f347b0.js | 1 + assets/calcite-action-0d34f2ad.js | 5 + assets/calcite-flow-4396f57a.js | 5 + assets/calcite-flow-item-55ff42f9.js | 42 + assets/calcite-icon-2c0948c4.js | 5 + assets/calcite-list-9839fae2.js | 73 + assets/calcite-list-item-d9ff27a1.js | 29 + assets/calcite-notice-1e5c2a0f.js | 23 + assets/calcite-tooltip-1b461e59.js | 5 + assets/capabilities-5d185925.js | 1 + assets/centroid-8e8cfa47.js | 1 + assets/chartCommon-98b0365b.js | 1 + assets/cimAnalyzer-01879161.js | 1 + assets/clientSideDefaults-ab04bd90.js | 7 + assets/colorUtils-c0f43caf.js | 1 + assets/commonProperties-30089b06.js | 1 + assets/createConnection-4b117798.js | 1 + assets/createSymbolSchema-16296a2b.js | 1 + assets/crsUtils-3bab3d8c.js | 1 + assets/cs_CZ2-1e33a1ce.js | 1 + assets/da_DK2-4e72198c.js | 1 + assets/dataUtils-69946c3c.js | 1 + assets/de_CH2-b9a3a608.js | 1 + assets/de_DE2-15e279b1.js | 1 + assets/debounce-14ebcd9e.js | 5 + assets/defaults-34554cbf.js | 1 + assets/defaultsJSON-59981e75.js | 1 + assets/definitions-0bc08d4c.js | 1 + .../dehydratedFeatureComparison-a3375a3e.js | 1 + assets/diffUtils-590c9088.js | 1 + assets/drapedUtils-909caa2b.js | 1 + assets/editingSupport-b5feb7b5.js | 1 + assets/editsZScale-1b5a53a6.js | 1 + assets/el_GR2-2b9c8a60.js | 1 + assets/elevationInfoUtils-4fd79d95.js | 1 + assets/en_CA2-40dcf3cc.js | 1 + assets/en_US2-40dcf3cc.js | 1 + assets/es_ES2-c856435b.js | 1 + assets/et_EE2-193ac1c8.js | 1 + assets/executeForIds-5eaf002d.js | 1 + assets/executeForTopCount-6d9058c4.js | 1 + assets/executeForTopExtents-9cf44843.js | 1 + assets/executeForTopIds-53feffc9.js | 1 + assets/executeQueryJSON-7c41ada5.js | 1 + assets/executeQueryPBF-0f188593.js | 1 + assets/executeRelationshipQuery-39c5c9fd.js | 1 + assets/executeTopFeaturesQuery-6e0504e9.js | 1 + assets/executionError-c92d3b85.js | 1 + assets/featureLayerUtils-6cf06f83.js | 1 + assets/featureLayerUtils-d15eb75b.js | 1 + assets/featureSetUtils-86900014.js | 1 + assets/featuresetbase-deb31b6d.js | 1 + assets/featuresetgeom-f8824c82.js | 1 + assets/featuresetstats-f8717896.js | 1 + assets/featuresetstring-f0b4377e.js | 1 + assets/fetchService-82a8c4d0.js | 1 + assets/fi_FI2-53484f9e.js | 1 + assets/fieldProperties-62c55499.js | 1 + assets/floorFilterUtils-080a7cd2.js | 1 + assets/fr_FR2-8b6dd3fc.js | 1 + assets/generateRendererUtils-1e52a587.js | 1 + assets/geohashUtils-77d8429b.js | 1 + assets/geojson-077f67ec.js | 1 + assets/geomasync-463bba62.js | 1 + assets/geometryEngine-5a631b21.js | 1 + assets/geometryEngineAsync-e8b91fe5.js | 1 + assets/geometryEngineBase-324c1c81.js | 1 + assets/geometryEngineJSON-b173802a.js | 1 + assets/geometryEngineJSON-c939b27e.js | 1 + assets/geometryEngineWorker-f6bc8d39.js | 1 + assets/gltfexport-6ef31b0f.js | 1 + assets/guid-114f0fc6.js | 5 + assets/hash-6f442295.js | 1 + assets/he_IL2-ecc10351.js | 1 + assets/heatmapUtils-327ef4c5.js | 1 + assets/hr_HR2-6c8e87b3.js | 1 + assets/hu_HU2-fbe5572b.js | 1 + assets/hydrated-c10ab4a5.js | 1 + assets/i3s-dc0aca0d.js | 2 + assets/icon-25aef281.js | 5 + assets/id_ID2-56ecb0c6.js | 1 + assets/imageBitmapUtils-391f7b8f.js | 1 + assets/imageutils-51a204ba.js | 1 + assets/index-080e108a.js | 5617 +++++++++++++++++ assets/index-a8e73b5e.css | 1 + assets/it_IT2-20a2fdf5.js | 1 + assets/ja_JP2-2f441bec.js | 1 + assets/json-48e3ea08.js | 1 + assets/jsonContext-5f3816dc.js | 1 + assets/jsonUtils-f73b3833.js | 1 + assets/ko_KR2-5290e5f8.js | 1 + assets/labelingInfo-144f3d9f.js | 1 + assets/layersCreator-738b2d23.js | 1 + assets/layersLoader-0106cc6e.js | 1 + assets/lazyLayerLoader-8b31b2e1.js | 1 + assets/lclayout-caec6e62.js | 3 + assets/lerc-wasm-acc570d7.js | 1 + assets/libtess-61f6382d.js | 1 + assets/libtess-asm-990bba69.js | 1 + assets/loadGLTFMesh-932e7ee5.js | 8 + assets/loadable-759e1c0c.js | 5 + assets/loader-2996ba2a.js | 9 + assets/lt_LT2-e057464e.js | 1 + assets/lv_LV2-7a761c7a.js | 1 + assets/mask-svg-023bbc42.js | 1 + assets/meshFeatureSet-8442b8e6.js | 1 + .../multiOriginJSONSupportUtils-c978f4c3.js | 1 + assets/nb_NO2-853c98f6.js | 1 + assets/nl_NL2-e2c04ba1.js | 1 + assets/normalizeUtils-cf8b8053.js | 1 + assets/normalizeUtilsCommon-500064b3.js | 1 + assets/normalizeUtilsSync-6be8435f.js | 1 + assets/number-e491b09e.js | 1 + assets/number-e5825aa4.js | 1 + assets/objectIdUtils-789e911a.js | 1 + assets/observers-4ce6e1b4.js | 5 + assets/ogcFeatureUtils-1ccf1f8d.js | 1 + ...mizedFeatureQueryEngineAdapter-58185a60.js | 1 + assets/originUtils-1469eeaf.js | 1 + assets/overlay-svg-d62383f3.js | 1 + assets/pbf-d9aa3914.js | 1 + assets/pbfQueryUtils-26a87215.js | 1 + assets/pe-wasm-5a7d91fb.js | 1 + assets/persistable-ca976a2c.js | 1 + assets/pieChart-bf6791d4.js | 1 + assets/pl_PL2-8693870b.js | 1 + assets/popupUtils-82ea8abb.js | 1 + assets/popupUtils-f04ec9a9.js | 1 + assets/portalItemUtils-792a27e1.js | 1 + assets/portalLayers-54553513.js | 1 + assets/portalUtils-2eff95c6.js | 1 + assets/projectExtentUtils-efa4cddd.js | 1 + assets/pt_BR2-a1cac873.js | 1 + assets/pt_PT2-e5eb7b28.js | 1 + assets/query-93c6e211.js | 1 + assets/queryAttachments-1706bb4d.js | 1 + assets/queryEngineUtils-342680f6.js | 1 + assets/queryForSymbologySnapping-0264f2b5.js | 1 + assets/queryTopFeatures-70149ca3.js | 1 + assets/queryZScale-8f9616ff.js | 1 + assets/quickselect-e80674f5.js | 1 + assets/rasterProjectionHelper-072edec4.js | 1 + assets/rasterizingUtils-4df93c6e.js | 1 + assets/request-14491776.js | 1 + assets/resourceExtension-91e7c3ce.js | 1 + assets/resourceUtils-b667b05b.js | 1 + assets/ro_RO2-554c8802.js | 1 + assets/ru_RU2-5b0bfec9.js | 1 + assets/scrim-ffa718f9.js | 5 + assets/serviceCapabilitiesUtils-959e798a.js | 1 + assets/sk_SK2-feee92a1.js | 1 + assets/sl_SL2-56e581d6.js | 1 + assets/sourceUtils-e3b344c8.js | 1 + assets/sql-734ecbc5.js | 1 + assets/sr_RS2-dba2ad75.js | 1 + assets/statsWorker-99ee7c16.js | 1 + assets/styleUtils-25825fd6.js | 1 + assets/sublayerUtils-1269bca6.js | 1 + assets/sv_SE2-e6ae4e09.js | 1 + assets/symbolLayerUtils-16974b32.js | 1 + .../symbologySnappingCandidates-816beafe.js | 1 + assets/t9n-537805d4.js | 13 + assets/th_TH2-def73602.js | 1 + assets/tileUtils-48cbbab9.js | 1 + assets/tr_TR2-d87d745f.js | 1 + assets/uk_UA2-ae6136c6.js | 1 + assets/unitFormatUtils-b70a7bff.js | 1 + assets/uploadAssets-f5746464.js | 1 + assets/utils-12672bd4.js | 1 + assets/utils-2fe9d339.js | 1 + assets/utils3-4f0533d1.js | 5 + assets/versionUtils-f17daa93.js | 1 + assets/vi_VN2-8bff547b.js | 1 + assets/vxlLayer-78040c8d.js | 5 + assets/wfsUtils-372b3e59.js | 1 + assets/widget-78e8b6fe.js | 1 + assets/xmlUtils-444cb4c0.js | 1 + assets/xyChart-881759ac.js | 1 + assets/zh_Hans2-41156b15.js | 1 + assets/zh_Hant2-8bca75bb.js | 1 + index.html | 15 + 443 files changed, 7494 insertions(+) create mode 100644 .nojekyll create mode 100644 assets/APIKeyMixin-878a7aa7.js create mode 100644 assets/Analysis-932d2cd8.js create mode 100644 assets/ArcGISCachedService-344b6262.js create mode 100644 assets/ArcGISService-83287338.js create mode 100644 assets/AreaMeasurementAnalysisView3D-26f7cb40.js create mode 100644 assets/AtmosphereCompositing.glsl-69a14b5e.js create mode 100644 assets/AttachmentInfo-cb670dd0.js create mode 100644 assets/AttachmentQuery-972bbd60.js create mode 100644 assets/BaseDynamicLayerView3D-83fabc6e.js create mode 100644 assets/BidiEngine-9a40f2f4.js create mode 100644 assets/BingMapsLayer-358d6de4.js create mode 100644 assets/BlendLayers.glsl-79ff1735.js create mode 100644 assets/BlendWeights.glsl-79c88ca2.js create mode 100644 assets/Blur.glsl-2561d33a.js create mode 100644 assets/BoundsStore-b6bd3c14.js create mode 100644 assets/BuildingComponentSublayer-5d49e5f9.js create mode 100644 assets/BuildingGroupSublayer-d6113346.js create mode 100644 assets/BuildingSceneLayer-f39f2837.js create mode 100644 assets/BuildingSceneLayerView3D-15511316.js create mode 100644 assets/Button-5999eab8.js create mode 100644 assets/CIMSymbolRasterizer-1692cd3f.js create mode 100644 assets/CSVLayer-5ae17e31.js create mode 100644 assets/CSVLayerView3D-f68a6513.js create mode 100644 assets/CSVSourceWorker-51c044a2.js create mode 100644 assets/ChapmanAtmosphere.glsl-badaea29.js create mode 100644 assets/CheckerBoard.glsl-7d1da857.js create mode 100644 assets/Clouds.glsl-918fa9c8.js create mode 100644 assets/CloudsComposition.glsl-e9072d6f.js create mode 100644 assets/ColorMaterial.glsl-c349707a.js create mode 100644 assets/ColorSet-bb3b0c3c.js create mode 100644 assets/ComponentShader.glsl-ec5515fa.js create mode 100644 assets/Compositing.glsl-2c5c8d4d.js create mode 100644 assets/CustomParametersMixin-231c4be8.js create mode 100644 assets/DefaultMaterial.glsl-ab417bbf.js create mode 100644 assets/DefinitionExpressionSceneLayerView-66b62d34.js create mode 100644 assets/DictionaryLoader-c0729336.js create mode 100644 assets/DimensionAnalysisView3D-4f55aca1.js create mode 100644 assets/DimensionLayer-56b346fa.js create mode 100644 assets/DimensionLayerView3D-9f833e6e.js create mode 100644 assets/DirectLineMeasurementAnalysisView3D-f383b6d8.js create mode 100644 assets/DynamicLayerView3D-b48678f2.js create mode 100644 assets/EdgeDetect.glsl-43794585.js create mode 100644 assets/EdgeProcessingWorker-615066a5.js create mode 100644 assets/EdgeShader.glsl-e2d5d7be.js create mode 100644 assets/EditBusLayer-d71787e9.js create mode 100644 assets/EditGeometryOperations-0ec3f5b5.js create mode 100644 assets/ElevationLayer-61bc2d81.js create mode 100644 assets/ElevationLayerView3D-eeaaa8c4.js create mode 100644 assets/ElevationQuery-6f358c3e.js create mode 100644 assets/ElevationSamplerWorker-d53250c9.js create mode 100644 assets/EventedSet-d13fada5.js create mode 100644 assets/ExportImageParameters-649a2637.js create mode 100644 assets/ExportWMSImageParameters-d63354ac.js create mode 100644 assets/Factory-8e329f4b.js create mode 100644 assets/FeatureCollectionSnappingSource-3f1024ad.js create mode 100644 assets/FeatureEffect-86735d98.js create mode 100644 assets/FeatureEffectLayer-4160946c.js create mode 100644 assets/FeatureFilter-00f4be05.js create mode 100644 assets/FeatureFilter-2d6ab0aa.js create mode 100644 assets/FeatureLayer-5c6d2c3b.js create mode 100644 assets/FeatureLayerBase-7c7dfccb.js create mode 100644 assets/FeatureLayerSource-b0c6b618.js create mode 100644 assets/FeatureLayerView3D-7e7e2653.js create mode 100644 assets/FeatureLayerViewBase3D-8474587e.js create mode 100644 assets/FeatureLikeLayerView3D-2e3185ce.js create mode 100644 assets/FeatureReductionLayer-4262cf54.js create mode 100644 assets/FeatureServiceSnappingSource-14e28ceb.js create mode 100644 assets/FeatureServiceSnappingSourceWorker-19fe862a.js create mode 100644 assets/FeatureSet-111cb247.js create mode 100644 assets/FeatureStore-f0e312fc.js create mode 100644 assets/FeatureTemplate-2a7e96c1.js create mode 100644 assets/FeatureTileTree3DDebugger-3e47616a.js create mode 100644 assets/FeatureType-db96032c.js create mode 100644 assets/FetchAssociatedFeatureLayer-15c90b75.js create mode 100644 assets/FieldsIndex-f79a8f26.js create mode 100644 assets/FloatingArrow-54d0aa06.js create mode 100644 assets/Fog.glsl-332cff80.js create mode 100644 assets/GeoJSONLayer-71b9768b.js create mode 100644 assets/GeoJSONLayerView3D-be497a18.js create mode 100644 assets/GeoJSONSourceWorker-555763c3.js create mode 100644 assets/GeoRSSLayer-f82698fe.js create mode 100644 assets/GeometryUtils-0258f920.js create mode 100644 assets/Graphics3DObjectStates-bb2a6162.js create mode 100644 assets/GraphicsLayerView3D-f93de954.js create mode 100644 assets/GraphicsProcessor-750d4e2b.js create mode 100644 assets/GraphicsSnappingSource-c09f0afd.js create mode 100644 assets/GraphicsView3D-1336db36.js create mode 100644 assets/GroupLayer-d83741dd.js create mode 100644 assets/GroupLayerView-c93dbf5e.js create mode 100644 assets/HUDCompositing.glsl-67260826.js create mode 100644 assets/HUDMaterial.glsl-6c800f3a.js create mode 100644 assets/Heatmap.glsl-30acef82.js create mode 100644 assets/HeatmapDensity.glsl-403624d9.js create mode 100644 assets/HeatmapProcessor-db17730e.js create mode 100644 assets/HighlightApply.glsl-d2c44603.js create mode 100644 assets/HighlightBlur.glsl-8389b4e8.js create mode 100644 assets/HighlightDownsample.glsl-b1b35495.js create mode 100644 assets/I3SBinaryReader-2b8e30f7.js create mode 100644 assets/I3SIndexInfo-445e6968.js create mode 100644 assets/I3SLayerDefinitions-ffdb3821.js create mode 100644 assets/I3SMeshView3D-86f2c945.js create mode 100644 assets/I3SNode-2025159f.js create mode 100644 assets/I3SOverrides-96f73e2b.js create mode 100644 assets/I3SQueryFeatureStore-0cfa6ebc.js create mode 100644 assets/I3STreeDebugger-794166fd.js create mode 100644 assets/I3SUtil-2c288808.js create mode 100644 assets/IdentityManager-47bd1e1a.js create mode 100644 assets/ImageHistogramParameters-84349e1d.js create mode 100644 assets/ImageMaterial-5c48df66.js create mode 100644 assets/ImageMaterial.glsl-42017fca.js create mode 100644 assets/ImageryLayer-4aa91771.js create mode 100644 assets/ImageryLayerView3D-b65487bb.js create mode 100644 assets/ImageryTileLayer-19c32ddc.js create mode 100644 assets/ImageryTileLayerView3D-7bc4c9c1.js create mode 100644 assets/IntegratedMeshLayer-cad83962.js create mode 100644 assets/IntegratedMeshLayerView3D-9c474b52.js create mode 100644 assets/KMLLayer-1c6bcbfe.js create mode 100644 assets/LabelClass-2d53c485.js create mode 100644 assets/LaserlinePath.glsl-f6fdf1ff.js create mode 100644 assets/Laserlines.glsl-fc6ed0d2.js create mode 100644 assets/LayerView-448bc5ea.js create mode 100644 assets/LayerView3D-ffd35809.js create mode 100644 assets/LengthDimension-92faee98.js create mode 100644 assets/LercWorker-aac3e5c8.js create mode 100644 assets/LineCallout.glsl-cb1ab83b.js create mode 100644 assets/LineMarker.glsl-c22f9f73.js create mode 100644 assets/LineOfSightAnalysisTarget-7f5e80d1.js create mode 100644 assets/LineOfSightAnalysisView3D-ccdd2ae5.js create mode 100644 assets/LineOfSightLayer-e674c03f.js create mode 100644 assets/LineOfSightLayerView3D-75d7761d.js create mode 100644 assets/LineVisualElement-b605d10c.js create mode 100644 assets/LinkChartLayer-fed775d8.js create mode 100644 assets/MapImageLayer-1956b83f.js create mode 100644 assets/MapImageLayerView3D-5536e520.js create mode 100644 assets/MapNotesLayer-637d9bd1.js create mode 100644 assets/MapServiceLayerViewHelper-fdadc63a.js create mode 100644 assets/MeasurementArrow.glsl-3a559294.js create mode 100644 assets/MediaElementView-dc36bc9f.js create mode 100644 assets/MediaLayer-be2aa899.js create mode 100644 assets/MediaLayerView3D-69d89f9a.js create mode 100644 assets/MemorySourceWorker-31156e3d.js create mode 100644 assets/MultiOriginJSONSupport-e4912ffd.js create mode 100644 assets/NativeLine.glsl-1fd72627.js create mode 100644 assets/NoiseTextureAtlas.glsl-655df1b4.js create mode 100644 assets/OGCFeatureLayer-257da298.js create mode 100644 assets/OGCFeatureLayerView3D-dbd9812b.js create mode 100644 assets/OITCompositing.glsl-858510ff.js create mode 100644 assets/OpenStreetMapLayer-3ecd3975.js create mode 100644 assets/OperationalLayer-0e8f8b28.js create mode 100644 assets/OrderedLayer-68067459.js create mode 100644 assets/OrientedImageryLayer-2b6cc12d.js create mode 100644 assets/OverlayCompositing.glsl-cf0d34dd.js create mode 100644 assets/PBFDecoderWorker-113e9c75.js create mode 100644 assets/Path.glsl-bb1cac2d.js create mode 100644 assets/Pattern.glsl-2fa8b945.js create mode 100644 assets/Pipeline-98b9d349.js create mode 100644 assets/PointCloudLayer-b4103b13.js create mode 100644 assets/PointCloudLayerView3D-35572558.js create mode 100644 assets/PointCloudUniqueValueRenderer-df78a172.js create mode 100644 assets/PointCloudWorker-68a2e657.js create mode 100644 assets/PointCloudWorkerUtil-ec4f2005.js create mode 100644 assets/PointRenderer.glsl-e83bfa82.js create mode 100644 assets/PointVisualElement-2a56e55d.js create mode 100644 assets/PooledRBush-3cae7682.js create mode 100644 assets/Popup-db207f4c.js create mode 100644 assets/PopupSceneLayerView-c49dd096.js create mode 100644 assets/PortalLayer-310c2800.js create mode 100644 assets/Precipitation.glsl-5b05b6be.js create mode 100644 assets/Query-1c961d4c.js create mode 100644 assets/QueryEngine-19eda5ff.js create mode 100644 assets/QueryEngineCapabilities-42e44ded.js create mode 100644 assets/QueryTask-6f808a9e.js create mode 100644 assets/RasterColorizer.glsl-724b79fe.js create mode 100644 assets/RasterWorker-cd959d79.js create mode 100644 assets/RealisticTree.glsl-2623185f.js create mode 100644 assets/Rect-98da58d6.js create mode 100644 assets/RefreshableLayerView-915e7f53.js create mode 100644 assets/RelationshipQuery-39c07195.js create mode 100644 assets/RibbonLine.glsl-0c86e4e2.js create mode 100644 assets/RightAngleQuadVisualElement-8daf0594.js create mode 100644 assets/RouteLayer-fdf5da4e.js create mode 100644 assets/RouteLayerView3D-0557987b.js create mode 100644 assets/SSAO.glsl-8e275b51.js create mode 100644 assets/SSAOBlur.glsl-1cf88496.js create mode 100644 assets/SceneLayer-fdf1363f.js create mode 100644 assets/SceneLayerGraphicsView3D-8d7d0182.js create mode 100644 assets/SceneLayerSnappingSource-176431c8.js create mode 100644 assets/SceneLayerSnappingSourceWorker-3df2f794.js create mode 100644 assets/SceneLayerView-b7d3fe23.js create mode 100644 assets/SceneLayerView3D-ef96402b.js create mode 100644 assets/SceneLayerWorker-e92c2264.js create mode 100644 assets/SceneModification-2715f58a.js create mode 100644 assets/SceneService-6fea113d.js create mode 100644 assets/Segment-50129b50.js create mode 100644 assets/ShadedColorMaterial.glsl-2686362a.js create mode 100644 assets/ShadowCastAccumulate.glsl-15b89038.js create mode 100644 assets/ShadowCastVisualize.glsl-2c61efe0.js create mode 100644 assets/ShadowHighlight.glsl-56ab9734.js create mode 100644 assets/SimpleAtmosphere.glsl-137a19b0.js create mode 100644 assets/SliceAnalysisView3D-63c25320.js create mode 100644 assets/SlicePlaneMaterial.glsl-99e82c24.js create mode 100644 assets/SmaaRenderPassData-660b7d34.js create mode 100644 assets/SpatialFilter-d44507d6.js create mode 100644 assets/Stars.glsl-0c573990.js create mode 100644 assets/Stop-9d81fe58.js create mode 100644 assets/StreamFeatureManager-4b8ac3ac.js create mode 100644 assets/StreamLayer-bacc7345.js create mode 100644 assets/StreamLayerView3D-9f3bc35d.js create mode 100644 assets/StyleRepository-2362164f.js create mode 100644 assets/SublayersOwner-ee341b5e.js create mode 100644 assets/SubtypeGroupLayer-181166ae.js create mode 100644 assets/SymbolProcessor-f81deaae.js create mode 100644 assets/TemporalLayer-f17c9161.js create mode 100644 assets/Terrain.glsl-84e9c4a7.js create mode 100644 assets/TerrainTileTree3DDebugger-33a28731.js create mode 100644 assets/TextureOnly.glsl-41ddb8a9.js create mode 100644 assets/Tick-c7ca49b9.js create mode 100644 assets/TileClipper-ae6eca9e.js create mode 100644 assets/TileInfoTilemapCache-b3f5dda7.js create mode 100644 assets/TileInfoView-346e56d0.js create mode 100644 assets/TileLayer-30014b67.js create mode 100644 assets/TileLayerView3D-844ae299.js create mode 100644 assets/TileTreeDebugger-142b9f39.js create mode 100644 assets/TiledLayerView3D-a11f8026.js create mode 100644 assets/TilemapCache-67ada3c3.js create mode 100644 assets/TopFeaturesQuery-e44d05be.js create mode 100644 assets/TurboLine-aac2edf4.js create mode 100644 assets/UniqueValueRenderer-fef4204d.js create mode 100644 assets/UnitNormalizer-818a6664.js create mode 100644 assets/UnknownLayer-c61e7207.js create mode 100644 assets/UnsupportedLayer-7b99a9d5.js create mode 100644 assets/VectorTileLayer-43018d94.js create mode 100644 assets/VectorTileLayerView3D-617343b6.js create mode 100644 assets/VertexSnappingCandidate-0a987e12.js create mode 100644 assets/VisualElementResources-e52972a5.js create mode 100644 assets/VoxelLayer-b454e868.js create mode 100644 assets/VoxelLayerView3D-a9ee300f.js create mode 100644 assets/VoxelWasmPerSceneView-0fc2c231.js create mode 100644 assets/WFSLayer-c70988b2.js create mode 100644 assets/WFSLayerView3D-37f84843.js create mode 100644 assets/WFSSourceWorker-1db6d954.js create mode 100644 assets/WMSLayer-a3157ab4.js create mode 100644 assets/WMSLayerView3D-4330be5d.js create mode 100644 assets/WMTSLayer-d2e84f3b.js create mode 100644 assets/WMTSLayerView3D-b2043cf0.js create mode 100644 assets/WaterSurface.glsl-a424eae6.js create mode 100644 assets/WebTileLayer-df8c0816.js create mode 100644 assets/WhereClause-c86b9974.js create mode 100644 assets/WorkerTileHandler-fcaca023.js create mode 100644 assets/action-0a339dee.js create mode 100644 assets/analysisViewUtils-68ab721d.js create mode 100644 assets/ar2-dfb29e9e.js create mode 100644 assets/arcadeAsyncRuntime-8b244fcf.js create mode 100644 assets/arcadeTimeUtils-e1438cc8.js create mode 100644 assets/arcadeUtils-b902d678.js create mode 100644 assets/arcgis-knowledge-client-core-59a3e261.js create mode 100644 assets/arcgis-knowledge-client-core-simd-37b35211.js create mode 100644 assets/arcgisLayers-23a0b701.js create mode 100644 assets/basis_transcoder-bff818ce.js create mode 100644 assets/bg_BG2-08c99e6c.js create mode 100644 assets/bs_BA2-f2917445.js create mode 100644 assets/ca_ES2-f5f347b0.js create mode 100644 assets/calcite-action-0d34f2ad.js create mode 100644 assets/calcite-flow-4396f57a.js create mode 100644 assets/calcite-flow-item-55ff42f9.js create mode 100644 assets/calcite-icon-2c0948c4.js create mode 100644 assets/calcite-list-9839fae2.js create mode 100644 assets/calcite-list-item-d9ff27a1.js create mode 100644 assets/calcite-notice-1e5c2a0f.js create mode 100644 assets/calcite-tooltip-1b461e59.js create mode 100644 assets/capabilities-5d185925.js create mode 100644 assets/centroid-8e8cfa47.js create mode 100644 assets/chartCommon-98b0365b.js create mode 100644 assets/cimAnalyzer-01879161.js create mode 100644 assets/clientSideDefaults-ab04bd90.js create mode 100644 assets/colorUtils-c0f43caf.js create mode 100644 assets/commonProperties-30089b06.js create mode 100644 assets/createConnection-4b117798.js create mode 100644 assets/createSymbolSchema-16296a2b.js create mode 100644 assets/crsUtils-3bab3d8c.js create mode 100644 assets/cs_CZ2-1e33a1ce.js create mode 100644 assets/da_DK2-4e72198c.js create mode 100644 assets/dataUtils-69946c3c.js create mode 100644 assets/de_CH2-b9a3a608.js create mode 100644 assets/de_DE2-15e279b1.js create mode 100644 assets/debounce-14ebcd9e.js create mode 100644 assets/defaults-34554cbf.js create mode 100644 assets/defaultsJSON-59981e75.js create mode 100644 assets/definitions-0bc08d4c.js create mode 100644 assets/dehydratedFeatureComparison-a3375a3e.js create mode 100644 assets/diffUtils-590c9088.js create mode 100644 assets/drapedUtils-909caa2b.js create mode 100644 assets/editingSupport-b5feb7b5.js create mode 100644 assets/editsZScale-1b5a53a6.js create mode 100644 assets/el_GR2-2b9c8a60.js create mode 100644 assets/elevationInfoUtils-4fd79d95.js create mode 100644 assets/en_CA2-40dcf3cc.js create mode 100644 assets/en_US2-40dcf3cc.js create mode 100644 assets/es_ES2-c856435b.js create mode 100644 assets/et_EE2-193ac1c8.js create mode 100644 assets/executeForIds-5eaf002d.js create mode 100644 assets/executeForTopCount-6d9058c4.js create mode 100644 assets/executeForTopExtents-9cf44843.js create mode 100644 assets/executeForTopIds-53feffc9.js create mode 100644 assets/executeQueryJSON-7c41ada5.js create mode 100644 assets/executeQueryPBF-0f188593.js create mode 100644 assets/executeRelationshipQuery-39c5c9fd.js create mode 100644 assets/executeTopFeaturesQuery-6e0504e9.js create mode 100644 assets/executionError-c92d3b85.js create mode 100644 assets/featureLayerUtils-6cf06f83.js create mode 100644 assets/featureLayerUtils-d15eb75b.js create mode 100644 assets/featureSetUtils-86900014.js create mode 100644 assets/featuresetbase-deb31b6d.js create mode 100644 assets/featuresetgeom-f8824c82.js create mode 100644 assets/featuresetstats-f8717896.js create mode 100644 assets/featuresetstring-f0b4377e.js create mode 100644 assets/fetchService-82a8c4d0.js create mode 100644 assets/fi_FI2-53484f9e.js create mode 100644 assets/fieldProperties-62c55499.js create mode 100644 assets/floorFilterUtils-080a7cd2.js create mode 100644 assets/fr_FR2-8b6dd3fc.js create mode 100644 assets/generateRendererUtils-1e52a587.js create mode 100644 assets/geohashUtils-77d8429b.js create mode 100644 assets/geojson-077f67ec.js create mode 100644 assets/geomasync-463bba62.js create mode 100644 assets/geometryEngine-5a631b21.js create mode 100644 assets/geometryEngineAsync-e8b91fe5.js create mode 100644 assets/geometryEngineBase-324c1c81.js create mode 100644 assets/geometryEngineJSON-b173802a.js create mode 100644 assets/geometryEngineJSON-c939b27e.js create mode 100644 assets/geometryEngineWorker-f6bc8d39.js create mode 100644 assets/gltfexport-6ef31b0f.js create mode 100644 assets/guid-114f0fc6.js create mode 100644 assets/hash-6f442295.js create mode 100644 assets/he_IL2-ecc10351.js create mode 100644 assets/heatmapUtils-327ef4c5.js create mode 100644 assets/hr_HR2-6c8e87b3.js create mode 100644 assets/hu_HU2-fbe5572b.js create mode 100644 assets/hydrated-c10ab4a5.js create mode 100644 assets/i3s-dc0aca0d.js create mode 100644 assets/icon-25aef281.js create mode 100644 assets/id_ID2-56ecb0c6.js create mode 100644 assets/imageBitmapUtils-391f7b8f.js create mode 100644 assets/imageutils-51a204ba.js create mode 100644 assets/index-080e108a.js create mode 100644 assets/index-a8e73b5e.css create mode 100644 assets/it_IT2-20a2fdf5.js create mode 100644 assets/ja_JP2-2f441bec.js create mode 100644 assets/json-48e3ea08.js create mode 100644 assets/jsonContext-5f3816dc.js create mode 100644 assets/jsonUtils-f73b3833.js create mode 100644 assets/ko_KR2-5290e5f8.js create mode 100644 assets/labelingInfo-144f3d9f.js create mode 100644 assets/layersCreator-738b2d23.js create mode 100644 assets/layersLoader-0106cc6e.js create mode 100644 assets/lazyLayerLoader-8b31b2e1.js create mode 100644 assets/lclayout-caec6e62.js create mode 100644 assets/lerc-wasm-acc570d7.js create mode 100644 assets/libtess-61f6382d.js create mode 100644 assets/libtess-asm-990bba69.js create mode 100644 assets/loadGLTFMesh-932e7ee5.js create mode 100644 assets/loadable-759e1c0c.js create mode 100644 assets/loader-2996ba2a.js create mode 100644 assets/lt_LT2-e057464e.js create mode 100644 assets/lv_LV2-7a761c7a.js create mode 100644 assets/mask-svg-023bbc42.js create mode 100644 assets/meshFeatureSet-8442b8e6.js create mode 100644 assets/multiOriginJSONSupportUtils-c978f4c3.js create mode 100644 assets/nb_NO2-853c98f6.js create mode 100644 assets/nl_NL2-e2c04ba1.js create mode 100644 assets/normalizeUtils-cf8b8053.js create mode 100644 assets/normalizeUtilsCommon-500064b3.js create mode 100644 assets/normalizeUtilsSync-6be8435f.js create mode 100644 assets/number-e491b09e.js create mode 100644 assets/number-e5825aa4.js create mode 100644 assets/objectIdUtils-789e911a.js create mode 100644 assets/observers-4ce6e1b4.js create mode 100644 assets/ogcFeatureUtils-1ccf1f8d.js create mode 100644 assets/optimizedFeatureQueryEngineAdapter-58185a60.js create mode 100644 assets/originUtils-1469eeaf.js create mode 100644 assets/overlay-svg-d62383f3.js create mode 100644 assets/pbf-d9aa3914.js create mode 100644 assets/pbfQueryUtils-26a87215.js create mode 100644 assets/pe-wasm-5a7d91fb.js create mode 100644 assets/persistable-ca976a2c.js create mode 100644 assets/pieChart-bf6791d4.js create mode 100644 assets/pl_PL2-8693870b.js create mode 100644 assets/popupUtils-82ea8abb.js create mode 100644 assets/popupUtils-f04ec9a9.js create mode 100644 assets/portalItemUtils-792a27e1.js create mode 100644 assets/portalLayers-54553513.js create mode 100644 assets/portalUtils-2eff95c6.js create mode 100644 assets/projectExtentUtils-efa4cddd.js create mode 100644 assets/pt_BR2-a1cac873.js create mode 100644 assets/pt_PT2-e5eb7b28.js create mode 100644 assets/query-93c6e211.js create mode 100644 assets/queryAttachments-1706bb4d.js create mode 100644 assets/queryEngineUtils-342680f6.js create mode 100644 assets/queryForSymbologySnapping-0264f2b5.js create mode 100644 assets/queryTopFeatures-70149ca3.js create mode 100644 assets/queryZScale-8f9616ff.js create mode 100644 assets/quickselect-e80674f5.js create mode 100644 assets/rasterProjectionHelper-072edec4.js create mode 100644 assets/rasterizingUtils-4df93c6e.js create mode 100644 assets/request-14491776.js create mode 100644 assets/resourceExtension-91e7c3ce.js create mode 100644 assets/resourceUtils-b667b05b.js create mode 100644 assets/ro_RO2-554c8802.js create mode 100644 assets/ru_RU2-5b0bfec9.js create mode 100644 assets/scrim-ffa718f9.js create mode 100644 assets/serviceCapabilitiesUtils-959e798a.js create mode 100644 assets/sk_SK2-feee92a1.js create mode 100644 assets/sl_SL2-56e581d6.js create mode 100644 assets/sourceUtils-e3b344c8.js create mode 100644 assets/sql-734ecbc5.js create mode 100644 assets/sr_RS2-dba2ad75.js create mode 100644 assets/statsWorker-99ee7c16.js create mode 100644 assets/styleUtils-25825fd6.js create mode 100644 assets/sublayerUtils-1269bca6.js create mode 100644 assets/sv_SE2-e6ae4e09.js create mode 100644 assets/symbolLayerUtils-16974b32.js create mode 100644 assets/symbologySnappingCandidates-816beafe.js create mode 100644 assets/t9n-537805d4.js create mode 100644 assets/th_TH2-def73602.js create mode 100644 assets/tileUtils-48cbbab9.js create mode 100644 assets/tr_TR2-d87d745f.js create mode 100644 assets/uk_UA2-ae6136c6.js create mode 100644 assets/unitFormatUtils-b70a7bff.js create mode 100644 assets/uploadAssets-f5746464.js create mode 100644 assets/utils-12672bd4.js create mode 100644 assets/utils-2fe9d339.js create mode 100644 assets/utils3-4f0533d1.js create mode 100644 assets/versionUtils-f17daa93.js create mode 100644 assets/vi_VN2-8bff547b.js create mode 100644 assets/vxlLayer-78040c8d.js create mode 100644 assets/wfsUtils-372b3e59.js create mode 100644 assets/widget-78e8b6fe.js create mode 100644 assets/xmlUtils-444cb4c0.js create mode 100644 assets/xyChart-881759ac.js create mode 100644 assets/zh_Hans2-41156b15.js create mode 100644 assets/zh_Hant2-8bca75bb.js create mode 100644 index.html diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/assets/APIKeyMixin-878a7aa7.js b/assets/APIKeyMixin-878a7aa7.js new file mode 100644 index 0000000..473114c --- /dev/null +++ b/assets/APIKeyMixin-878a7aa7.js @@ -0,0 +1 @@ +import{ai as r,aj as a,al as s}from"./index-080e108a.js";function p(t){return"portalItem"in t}const l=t=>{let i=class extends t{get apiKey(){var e;return this._isOverridden("apiKey")?this._get("apiKey"):p(this)?(e=this.portalItem)==null?void 0:e.apiKey:null}set apiKey(e){e!=null?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return r([a({type:String})],i.prototype,"apiKey",null),i=r([s("esri.layers.mixins.APIKeyMixin")],i),i};export{l as i}; diff --git a/assets/Analysis-932d2cd8.js b/assets/Analysis-932d2cd8.js new file mode 100644 index 0000000..c235cc9 --- /dev/null +++ b/assets/Analysis-932d2cd8.js @@ -0,0 +1 @@ +import{eP as r,cz as n,am as o,dZ as l,ai as e,aj as s,al as p,ao as y}from"./index-080e108a.js";let d=0,t=class extends r(n(o(y))){constructor(a){super(a),this.id=`${Date.now().toString(16)}-analysis-${d++}`,this.title=null}get parent(){return this._get("parent")}set parent(a){const i=this.parent;if(i!=null)switch(i.type){case"line-of-sight":case"dimension":i.releaseAnalysis(this);break;case"2d":case"3d":i.analyses.includes(this)&&i.analyses.remove(this)}this._set("parent",a)}get isEditable(){return this.requiredPropertiesForEditing.every(l)}};e([s({type:String,constructOnly:!0,clonable:!1})],t.prototype,"id",void 0),e([s({type:String})],t.prototype,"title",void 0),e([s({constructOnly:!0})],t.prototype,"type",void 0),e([s({clonable:!1,value:null})],t.prototype,"parent",null),e([s({readOnly:!0})],t.prototype,"isEditable",null),e([s({readOnly:!0})],t.prototype,"requiredPropertiesForEditing",void 0),t=e([p("esri.analysis.Analysis")],t);const u=t;export{u as c}; diff --git a/assets/ArcGISCachedService-344b6262.js b/assets/ArcGISCachedService-344b6262.js new file mode 100644 index 0000000..d26cff2 --- /dev/null +++ b/assets/ArcGISCachedService-344b6262.js @@ -0,0 +1 @@ +import{ai as t,aj as i,ay as m,bc as x,bV as y,al as S}from"./index-080e108a.js";import{e as I}from"./TileInfoTilemapCache-b3f5dda7.js";import{T as O}from"./TilemapCache-67ada3c3.js";const T=h=>{let l=class extends h{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}destroy(){var a,e;(e=(a=this.tilemapCache)==null?void 0:a.destroy)==null||e.call(a)}readMinScale(a,e){return e.minLOD!=null&&e.maxLOD!=null?a:0}readMaxScale(a,e){return e.minLOD!=null&&e.maxLOD!=null?a:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(a,e,f){var u;const v=(u=e.capabilities)==null?void 0:u.includes("Tilemap");let{minLOD:n,maxLOD:o,minScale:p,maxScale:c}=e;if(n==null&&o==null&&p!==0&&c!==0){const r=s=>Math.round(1e4*s)/1e4;p=r(p||e.tileInfo.lods[0].scale),c=r(c||e.tileInfo.lods[e.tileInfo.lods.length-1].scale);for(const s of e.tileInfo.lods){const d=r(s.scale);n=d>=p?s.level:n,o=d>=c?s.level:o}}if(v)return new O({layer:this,minLOD:n,maxLOD:o});if(e.tileInfo){const r=new y;return r.read(e.tileInfo,f),new I(r,n,o)}return null}};return t([i({json:{read:{source:"copyrightText"}}})],l.prototype,"copyright",void 0),t([i()],l.prototype,"minScale",void 0),t([m("service","minScale")],l.prototype,"readMinScale",null),t([i()],l.prototype,"maxScale",void 0),t([m("service","maxScale")],l.prototype,"readMaxScale",null),t([i({type:x})],l.prototype,"spatialReference",void 0),t([i({readOnly:!0})],l.prototype,"supportsBlankTile",null),t([i({type:y})],l.prototype,"tileInfo",void 0),t([i()],l.prototype,"tilemapCache",void 0),t([m("service","tilemapCache",["capabilities","tileInfo"])],l.prototype,"readTilemapCache",null),t([i()],l.prototype,"version",void 0),l=t([S("esri.layers.mixins.ArcGISCachedService")],l),l};export{T as p}; diff --git a/assets/ArcGISService-83287338.js b/assets/ArcGISService-83287338.js new file mode 100644 index 0000000..afc4193 --- /dev/null +++ b/assets/ArcGISService-83287338.js @@ -0,0 +1 @@ +import{ai as i,aj as s,al as r,bW as a,bX as n,bz as u}from"./index-080e108a.js";const g=l=>{let e=class extends l{get title(){if(this._get("title")&&this.originOf("title")!=="defaults")return this._get("title");if(this.url){const t=a(this.url);if(t!=null&&t.title)return t.title}return this._get("title")||""}set title(t){this._set("title",t)}set url(t){this._set("url",n(t,u.getLogger(this)))}};return i([s()],e.prototype,"title",null),i([s({type:String})],e.prototype,"url",null),e=i([r("esri.layers.mixins.ArcGISService")],e),e};export{g as l}; diff --git a/assets/AreaMeasurementAnalysisView3D-26f7cb40.js b/assets/AreaMeasurementAnalysisView3D-26f7cb40.js new file mode 100644 index 0000000..4434f23 --- /dev/null +++ b/assets/AreaMeasurementAnalysisView3D-26f7cb40.js @@ -0,0 +1,20 @@ +import{ak as Be,bc as Te,dT as c,dS as Ie,gv as Z,gu as Q,ox as He,oy as Je,mF as A,lF as j,h1 as Ee,lG as re,oz as ie,fs as X,dR as ne,dQ as Ue,oA as Ke,bH as Qe,gm as ae,aB as je,oB as Xe,mz as ge,oC as Ze,oD as me,oE as _e,n3 as Ye,j1 as Y,m1 as fe,dO as Le,oF as et,gf as tt,oG as st,oH as ye,oI as ve,oJ as it,lV as rt,la as nt,ai as o,aj as l,al as te,ao as ue,aG as W,aH as Se,lH as at,lI as ot,bz as ht,cu as lt,af as We,dA as we,ah as y,gB as dt,aM as oe,l9 as ct,c7 as ut,ia as pt,ib as gt,a_ as O,id as Ce,ig as mt,mU as _t,lJ as be,ik as ft,il as F,im as Lt,aw as yt,oK as vt,ip as B,is as St,it as wt,iu as Ct,iv as bt,iw as Pt,iy as Mt,iz as At,iA as $t,iB as Vt,iq as z,iG as Rt,iH as Gt,hH as Pe,hI as H,iJ as Dt,iK as zt,lO as xt,iM as Ot,mA as Fe,i$ as ee,i_ as G,oL as Tt,of as Me,j0 as Ae,oM as It,aZ as Et,a$ as $e,bh as I,fu as Ut,lQ as jt,lR as Wt,lS as Ft,cf as kt,hw as qt,oN as Nt,oO as Bt,ch as Ht,ce as Jt,lT as Kt}from"./index-080e108a.js";import{b as ke,R as qe,c as he,e as le,t as Qt,a as Xt}from"./UnitNormalizer-818a6664.js";import{a as Zt,b as Yt,i as J,u as es,c as E,s as Ve,d as ts,e as ss}from"./LineVisualElement-b605d10c.js";import{r as U,l as Re,g as K,m as Ge,a as is,h as De,f as de}from"./Segment-50129b50.js";import{geodesicArea as rs}from"./geometryEngine-5a631b21.js";import{_ as ze,p as ns,w as as,l as os}from"./EditGeometryOperations-0ec3f5b5.js";function hs(t,e){const s=e.center;Ie(s,0,0,0);for(let r=0;r{if(a[0]===0&&a[1]===0&&a[2]===0)return!1;for(let h=0;h{ys(i.elevationProvider,f),j(f,k[w],u),j(f,P[w],p),C&&(re(f,b[w]),j(f,D[w],L),ne(D[w],D[w]))});const q=this._updatePathLengths(r);if(this.pathLength=this._length>1?U(d.normalizeDistance(q),"meters"):null,C){const f=this._updateGeodesicPathLengths(r,u);this.geodesicPathLength=this._length>1?U(f,"meters"):null}else this.geodesicPathLength=null;return this._updateCursorSegmentLength(e,s),this._updateMode(e,a),r?(this._updateArea(i,d,p,u,n),C&&this._updateGeodesicArea(i),!0):(this.area=null,this.geodesicArea=null,this.perimeterLength=null,this.triangleIndices=null,this.geodesicTriangleIndices=null,this.intersectingSegments.clear(),this.geodesicIntersectingSegments.clear(),!0)}getData(){return{positionsWorldCoords:this.positionsWorldCoords,positionsRenderCoords:this.positionsRenderCoords,positionsProjectedWorldCoords:this.positionsProjectedWorldCoords,positionsFittedRenderCoords:this.positionsFittedRenderCoords,positionsGeographic:this.positionsGeographic,positionsSpherical:this.positionsSpherical,positionsStereographic:this.positionsStereographic,pathSegmentLengths:this.pathSegmentLengths,geodesicPathSegmentLengths:this.geodesicPathSegmentLengths,perimeterSegmentLengths:this.perimeterSegmentLengths,intersectingSegments:this.intersectingSegments,geodesicIntersectingSegments:this.geodesicIntersectingSegments,triangleIndices:this.triangleIndices,geodesicTriangleIndices:this.geodesicTriangleIndices,areaCentroidWorldCoords:this.areaCentroidWorldCoords,areaCentroidRenderCoords:this.areaCentroidRenderCoords,geodesicAreaCentroidRenderCoords:this.geodesicAreaCentroidRenderCoords,fittingMode:this.fittingMode,area:this.area,geodesicArea:this.geodesicArea,pathLength:this.pathLength,geodesicPathLength:this.geodesicPathLength,perimeterLength:this.perimeterLength,cursorSegmentLength:this.cursorSegmentLength,geodesicCursorSegmentLength:this.geodesicCursorSegmentLength,unitNormalizer:this.unitNormalizer,actualMeasurementMode:this.actualMeasurementMode}}_resize(e){for(e2&&ls(h,m),this.fittingMode=this._selectFittingMode(m,h,this._worldUp,n);let L=0;if(this.fittingMode==="horizontal"){let f=-1/0;d.forEach((w,N)=>{const pe=a.getAltitude(d[N]);pe>f&&(f=pe,L=N)})}const C=h[L];let b=m,k=this._worldTangent;this.fittingMode==="horizontal"?b=this._worldUp:this.fittingMode==="vertical"&&(b=this._tempVec3,k=this._worldUp,_e(m,this._worldUp,b)),X(this._frame[2],b),_e(k,b,this._frame[0]),Ue(this._frame[1],this._frame[0],this._frame[2]),Ye(this._frame[1],this._frame[1]);const P=this._tempVec3,D=this._tempU,q=this._tempV;for(let f=0;f0?U(s.normalizeDistance(this._updatePerimeterLengths()),"meters"):null,he(u,this.areaCentroidRenderCoords),Le(this.areaCentroidRenderCoords,i,this.areaCentroidWorldCoords,r),this._updateIntersectingSegments(),this.area=this.intersectingSegments.size===0?Re(s.normalizeArea(this._computeArea()),"square-meters"):null}_updateGeodesicArea(e){const{renderCoordsHelper:s,spatialReference:i}=e,{positionsSpherical:r,positionsStereographic:n}=this,a=this._tempVec3,h=ms(r,a);if(!h)return void(this.geodesicArea=null);const d=this._tempU,p=this._tempV;et(a,d,p);for(let u=0;uMath.abs(ds(e,u))).reduce((u,m)=>Math.max(u,m),0);hs(s,this._tempSphere);const a=n/(2*this._tempSphere.radius),h=aMath.cos(rt(r.verticalAngleThreshold))?"horizontal":"vertical"),p}_updateCursorSegmentLength(e,s){const i=e.lastPoint;e.isValidPolygon||i==null||s==null?(this.geodesicCursorSegmentLength=null,this.cursorSegmentLength=null):(this.geodesicCursorSegmentLength=U(us(i,s),"meters"),this.cursorSegmentLength=U(this.unitNormalizer.normalizeDistance(cs(i,s,this.unitNormalizer.spatialReference)),"meters"))}_updateMode(e,s){if(s===le.Auto){this.actualMeasurementMode="euclidean";let i=0;this.geodesicPathLength!=null&&(i+=this.geodesicPathLength.value),e.isValidPolygon||this.geodesicCursorSegmentLength==null||(i+=this.geodesicCursorSegmentLength.value),i>vs&&(this.actualMeasurementMode="geodesic")}else this.actualMeasurementMode=s===le.Euclidean?"euclidean":"geodesic";this.geodesicPathLength==null&&(this.actualMeasurementMode="euclidean"),this._mode=s}}function ys(t,e){e.hasZ||(e.z=nt(t,e,"ground")??0)}const vs=1e5;let x=class extends ue{constructor(t){super(t)}initialize(){const t=this.view.spatialReference,e=ae(t),s=e===at?ot:e,i=!t||je(t,s)?s:t,r=new Qt(i);this._measurementDataManager=new Ls(this.view,r),this.addHandles([this.analysisViewData.path.on("change",()=>this._update()),W(()=>this.analysisViewData.cursorPoint,()=>this._update(),Se),W(()=>this.analysisViewData.mode,()=>this._update(),Se)]),this._update()}_update(t=!1){const{analysisViewData:e,view:s}=this,i={maxRelativeErrorCoplanar:.005,maxRelativeErrorAlmostCoplanar:.01,verticalAngleThreshold:80};this._measurementDataManager.update(e.path,e.cursorPoint,s,e.validMeasurement,i,e.mode,t)&&(e.measurementData=this._measurementDataManager.getData())}};o([l({constructOnly:!0})],x.prototype,"view",void 0),o([l({constructOnly:!0})],x.prototype,"analysis",void 0),o([l({constructOnly:!0})],x.prototype,"analysisViewData",void 0),x=o([te("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementController")],x);const Ne="esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurement3DPathHelper",Ss=ht.getLogger(Ne);let M=class extends lt.EventedAccessor{constructor(t={}){super(t),this._handles=new We,this._version=0,this._internalGeometryChange=!1,this._extent=we()}destroy(){this._handles=y(this._handles)}set areaMeasurement(t){this._set("areaMeasurement",t),t!=null&&this.view!=null&&this._initialize(t,this.view)}set view(t){this._set("view",t),t!=null&&this.areaMeasurement!=null&&this._initialize(this.areaMeasurement,t)}get constructed(){return this.areaMeasurement!=null&&this.view!=null}get version(){return this._version}get isValidPolygon(){return this.constructed&&this._editGeometry.components.length>0&&this._editGeometry.components[0].isClosed()}get extent(){if(this.constructed&&this._editGeometry.components.length>0&&this._editGeometry.components[0].vertices.length>0){const t=we(this._extent);return this.forEachVertex(e=>{dt(t,e.pos)}),t}return null}get spatialReference(){return this.constructed?this._editGeometry.coordinateHelper.spatialReference:null}_initialize(t,e){this._handles.removeAll(),this._handles.add(W(()=>t.geometry,()=>{this._updateEditGeometryFromModelGeometry(t,e)},oe)),this._makeDirty(!0)}_makeDirty(t=!1){this.notifyChange("isValidPolygon"),this.notifyChange("initialized"),this.notifyChange("extent"),t&&this.notifyChange("numVertices")}_updateEditGeometryFromModelGeometry(t,e){if(this._version++,this._internalGeometryChange)return;this._handles.remove("EditGeometry");let s=t.geometry;if(s!=null){const i=ct(s,e.spatialReference);i==null&&Zt(t,s.spatialReference,Ss),s=i}this._editGeometryOperations=s!=null?ze.fromGeometry(s,e.state.viewingMode):new ze(new ns("polygon",as(!0,!1,e.spatialReference))),this._makeDirty(!0),this.emit("change"),this._handles.add(this._editGeometry.on("change",i=>{this._makeDirty(i.addedVertices!=null||i.removedVertices!=null),this._internalGeometryChange=!0,t.geometry=this.numVertices>0?this._editGeometry.geometry:null,this._internalGeometryChange=!1}),"EditGeometry")}get _editGeometry(){return this._editGeometryOperations.data}get vertices(){const t=[];return this.forEachVertex(e=>{t.push(e)}),t}get numVertices(){return this.constructed&&this._editGeometry.components.length>0?this._editGeometry.components[0].vertices.length:0}get lastPoint(){if(this.constructed&&this._editGeometry.components.length>0){const t=this._editGeometry.components[0].getLastVertex();if(t!=null)return this._editGeometry.coordinateHelper.vectorToPoint(t.pos)}return null}getVertex(t){if(!this.constructed||this._editGeometry.components.length===0||this._editGeometry.components[0].vertices.length===0)return null;const e=this._editGeometry.components[0].vertices[0];let s=e;do{if(s.index===t)return s;s=s.rightEdge.rightVertex}while(s!==e&&s!=null);return null}getVertexPositionAsPoint(t){return this._editGeometry.coordinateHelper.vectorToPoint(t.pos)}getVertexPositionAsPointFromIndex(t){return this._editGeometry.coordinateHelper.vectorToPoint(this.getVertex(t).pos)}forEachVertex(t){this.constructed&&this._editGeometry.components.length>0&&this._editGeometry.components[0].iterateVertices(t)}forEachVertexPosition(t){const e=this._editGeometry.coordinateHelper;this.forEachVertex((s,i)=>{e.vectorToPoint(s.pos,Oe),t(Oe,i)})}clear(){this.areaMeasurement!=null&&(this.areaMeasurement.geometry=null)}add(t){if(!this.constructed)return null;if(this._editGeometry.components.length===0){const s=this.view;this._editGeometry.components.push(new os(s.spatialReference,s.state.viewingMode))}const e=this._editGeometryOperations.appendVertex(this._editGeometry.coordinateHelper.pointToVector(t));return this.emit("change"),e}close(){if(!this.constructed||this._editGeometry.components.length===0)return null;const t=this._editGeometryOperations.closeComponent(this._editGeometry.components[0]);return this.emit("change"),t}ensureContains(t,e=""){let s=!1;if(this._editGeometry.components.forEach(i=>{i.iterateVertices(r=>{r===t&&(s=!0)})}),!s)throw new Error(`vertex doesnt exist ${e}`);return s}setVertexPosition(t,e){if(!this.constructed)return null;const s=this._editGeometryOperations.setVertexPosition(t,this._editGeometry.coordinateHelper.pointToVector(e));return this.emit("change"),s}equals(t){if(this.numVertices!==t.numVertices)return!1;let e=!0;return this.forEachVertexPosition((s,i)=>{const r=t.getVertexPositionAsPointFromIndex(i);s.equals(r)||(e=!1)}),!!e}};o([l({value:null})],M.prototype,"areaMeasurement",null),o([l({value:null})],M.prototype,"view",null),o([l()],M.prototype,"isValidPolygon",null),o([l()],M.prototype,"extent",null),o([l()],M.prototype,"spatialReference",null),o([l()],M.prototype,"numVertices",null),M=o([te(Ne)],M);const Oe=new ut;function ws(t){const e=new pt,{vertex:s,fragment:i}=e;return gt(s,t),e.attributes.add(O.POSITION,"vec3"),e.attributes.add(O.UV0,"vec2"),e.varyings.add("vUV","vec2"),t.hasMultipassTerrain&&e.varyings.add("depth","float"),s.code.add(Ce` + void main(void) { + vUV = uv0; + ${t.hasMultipassTerrain?"depth = (view * vec4(position, 1.0)).z;":""} + gl_Position = proj * view * vec4(position, 1.0); + } + `),e.include(mt,t),i.uniforms.add(new _t("size",r=>r.size)),i.uniforms.add(new be("color1",r=>r.color1)),i.uniforms.add(new be("color2",r=>r.color2)),i.include(ft),i.code.add(Ce` + void main() { + ${t.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""} + vec2 uvScaled = vUV / (2.0 * size); + + vec2 uv = fract(uvScaled - 0.25); + vec2 ab = clamp((abs(uv - 0.5) - 0.25) / fwidth(uvScaled), -0.5, 0.5); + float fade = smoothstep(0.25, 0.5, max(fwidth(uvScaled.x), fwidth(uvScaled.y))); + float t = mix(abs(ab.x + ab.y), 0.5, fade); + + fragColor = mix(color2, color1, t); + ${t.transparencyPassType===F.Color?"fragColor = premultiplyAlpha(fragColor);":""} + } + `),e}const Cs=Object.freeze(Object.defineProperty({__proto__:null,build:ws},Symbol.toStringTag,{value:"Module"}));class se extends St{initializeProgram(e){return new wt(e.rctx,se.shader.get().build(this.configuration),Ct)}_setPipelineState(e){const s=this.configuration,i=e===F.NONE,r=e===F.FrontFace;return bt({blending:s.transparent?i?Ps:Pt(e):null,depthTest:{func:Mt(e)},depthWrite:i?s.writeDepth?At:null:$t(e),colorWrite:Vt,polygonOffset:i||r?s.polygonOffset?bs:null:{factor:-1,units:-25}})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}}se.shader=new Lt(Cs,()=>yt(()=>import("./CheckerBoard.glsl-7d1da857.js"),["assets/CheckerBoard.glsl-7d1da857.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/UnitNormalizer-818a6664.js","assets/Segment-50129b50.js","assets/unitFormatUtils-b70a7bff.js","assets/LineVisualElement-b605d10c.js","assets/elevationInfoUtils-4fd79d95.js","assets/geometryEngine-5a631b21.js","assets/geometryEngineBase-324c1c81.js","assets/hydrated-c10ab4a5.js","assets/EditGeometryOperations-0ec3f5b5.js"]));const bs={factor:0,units:-25},Ps=vt(B.SRC_ALPHA,B.ONE,B.ONE_MINUS_SRC_ALPHA,B.ONE_MINUS_SRC_ALPHA);class R extends Rt{constructor(){super(...arguments),this.transparencyPassType=F.NONE,this.transparent=!1,this.writeDepth=!0,this.polygonOffset=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1}}o([z({count:F.COUNT})],R.prototype,"transparencyPassType",void 0),o([z()],R.prototype,"transparent",void 0),o([z()],R.prototype,"writeDepth",void 0),o([z()],R.prototype,"polygonOffset",void 0),o([z()],R.prototype,"hasMultipassTerrain",void 0),o([z()],R.prototype,"cullAboveGround",void 0);class Ms extends Gt{constructor(e){super(e,new $s),this._configuration=new R}dispose(){}getConfiguration(e,s){return this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.transparencyPassType=s.transparencyPassType,this._configuration.hasMultipassTerrain=s.multipassTerrain.enabled,this._configuration.cullAboveGround=s.multipassTerrain.cullAboveGround,this._configuration}requiresSlot(e,s){return s===Pe.Color||s===Pe.Alpha?e===(this.parameters.transparent?this.parameters.writeDepth?H.TRANSPARENT_MATERIAL:H.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:H.OPAQUE_MATERIAL)||e===H.DRAPED_MATERIAL:!1}createGLMaterial(e){return new As(e)}createBufferWriter(){return new Dt(zt)}}class As extends xt{beginSlot(e){return this.ensureTechnique(se,e)}}class $s extends Ot{constructor(){super(...arguments),this.size=Fe(1,1),this.color1=ee(.75,.75,.75,1),this.color2=ee(.5,.5,.5,1),this.transparent=!1,this.writeDepth=!0,this.polygonOffset=!1}}class Vs extends Yt{constructor(e){super(e),this._checkerBoardMaterial=null,this._renderOccluded=G.OccludeAndTransparent,this._geometry=null,this._size=Fe(1,1),this._color1=ee(1,.5,0,.5),this._color2=ee(1,1,1,.5),this.applyProps(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this._geometryChanged()}get size(){return this._size}set size(e){Tt(this._size,e),this._updateMaterial()}get color1(){return this._color1}set color1(e){Me(e,this._color1)||(Ae(this._color1,e),this._updateMaterial())}get color2(){return this._color2}set color2(e){Me(e,this._color2)||(Ae(this._color2,e),this._updateMaterial())}_updateMaterial(){this._checkerBoardMaterial!=null&&this._checkerBoardMaterial.setParameters({size:this._size,color1:this._color1,color2:this._color2,renderOccluded:this._renderOccluded})}createExternalResources(){this._checkerBoardMaterial=new Ms({size:this._size,color1:this._color1,color2:this._color2,transparent:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:G.OccludeAndTransparent})}destroyExternalResources(){this._checkerBoardMaterial=null}forEachExternalMaterial(e){this._checkerBoardMaterial!=null&&e(this._checkerBoardMaterial)}createGeometries(e){if(this._geometry==null||this._checkerBoardMaterial==null)return;const s=Rs;It(s,this.transform);const i=this._geometry,r=[],n=c();i.position.forEach(d=>{Y(n,d,s),r.push(n[0],n[1],n[2])});const a=[];i.uv.forEach(d=>{a.push(d[0],d[1])});const h=new Et(this._checkerBoardMaterial,[[O.POSITION,new $e(r,3,!0)],[O.UV0,new $e(a,2,!0)]],[[O.POSITION,i.triangleIndices],[O.UV0,i.triangleIndices]]);e.addGeometry(h)}_geometryChanged(){this.recreateGeometry()}}const Rs=c();let S=class extends ue{get visible(){return this.analysisViewData.visible}get testData(){return{labels:{area:this._areaLabel,pathLength:this._pathLengthLabel,cursorSegmentLength:this._cursorSegmentLengthLabel,perimeterLength:this._perimeterLengthLabel}}}constructor(t){super(t),this._handles=new We,this._params={pathLineColor:I.toUnitRGBA(J()),pathLineWidth:3,intersectingLineColor:[1,.2,0,1],perimeterLineColor:I.toUnitRGBA(J()),perimeterLineWidth:2,projectionLineColor:I.toUnitRGBA(J()),projectionLineWidth:2,projectionLineStippleSize:5,areaColor1:I.toUnitRGBA(J(.5)),areaColor2:I.toUnitRGBA(es(.5)),labelDistance:25},this._path=null,this._intersectedPath=null,this._perimeter=null,this._intersectedPerimeter=null,this._projectionLines=null,this._measurementArea=null,this._areaLabel=null,this._pathLengthLabel=null,this._cursorSegmentLengthLabel=null,this._perimeterLengthLabel=null,this._pathSegments=[],this._perimeterSegments=[],this._cursorSegment=null,this._origin=c(),this._originTransform=Ut(),this._cursorPositionRenderSpace=c(),this.messages=null,this.viewData=Gs,this.areaLabel=null,this.perimeterLengthLabel=null,this.loadingMessages=!0}initialize(){const{analysisViewData:t,_params:e,view:s}=this;this._path=new E({view:s,attached:!0,width:e.pathLineWidth,color:e.pathLineColor,polygonOffset:!0,renderOccluded:G.OccludeAndTransparent}),this._intersectedPath=new E({view:s,attached:!0,width:e.pathLineWidth,color:e.intersectingLineColor,polygonOffset:!0,renderOccluded:G.OccludeAndTransparent}),this._perimeter=new E({view:s,attached:!0,width:e.perimeterLineWidth,color:e.perimeterLineColor,polygonOffset:!0,renderOccluded:G.OccludeAndTransparent}),this._intersectedPerimeter=new E({view:s,attached:!0,width:e.perimeterLineWidth,color:e.intersectingLineColor,polygonOffset:!0,renderOccluded:G.OccludeAndTransparent}),this._projectionLines=new E({view:s,attached:!0,width:e.projectionLineWidth,color:e.projectionLineColor,stipplePattern:jt(e.projectionLineStippleSize),polygonOffset:!0,renderOccluded:G.OccludeAndTransparent}),this._measurementArea=new Vs({view:s,attached:!0,color1:e.areaColor1,color2:e.areaColor2});const i={attached:!0,backgroundColor:Ve(.6),calloutColor:Ve(.5),textColor:ts(),view:s};this._areaLabel=new K({...i,fontSize:T.Large}),this._pathLengthLabel=new K({...i,fontSize:T.Small}),this._cursorSegmentLengthLabel=new K({...i,fontSize:T.Small}),this._perimeterLengthLabel=new K({...i,fontSize:T.Small}),this._handles.add([W(()=>[t.mode,this.visible,t.unit,t.measurementData,t.cursorPoint],()=>this._update(),oe),W(()=>{var r;return(r=s.state)==null?void 0:r.camera},()=>this._updateLabels(),oe),Wt(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._measurementArea=y(this._measurementArea),this._path=y(this._path),this._intersectedPath=y(this._intersectedPath),this._perimeter=y(this._perimeter),this._intersectedPerimeter=y(this._intersectedPerimeter),this._areaLabel=y(this._areaLabel),this._pathLengthLabel=y(this._pathLengthLabel),this._cursorSegmentLengthLabel=y(this._cursorSegmentLengthLabel),this._perimeterLengthLabel=y(this._perimeterLengthLabel),this._projectionLines=y(this._projectionLines),this._handles=y(this._handles),this.set("view",null)}_update(){if(this.destroyed||!this.view.ready||!this.view.renderCoordsHelper)return;const{analysisViewData:{measurementData:t},analysisViewData:e}=this;t!=null&&(this._updateViewData(t,e.path,e.cursorPoint),this._updateOrigin(),this._updatePathSegments(),this._updatePerimeterSegments(),this._updateArea(),this._updateProjectionLines(),this._updateLabels())}_updateViewData(t,e,s){const i=e.isValidPolygon,r=t.actualMeasurementMode==="geodesic",n=r?t.geodesicArea:t.area;let a=1;if(n){const d=this._toPreferredAreaUnit(n,this.analysisViewData.unit);a=Ft(Math.sqrt(d.value)/Math.sqrt(300)),a*=Math.sqrt(kt(1,d.unit,"square-meters")),a/=t.unitNormalizer.normalizeDistance(1)}const h={validMeasurement:i,path:e,pathVersion:e.version,cursorPoint:s,measurementData:t,mode:t.actualMeasurementMode,positionsGeographic:t.positionsGeographic,positionsRenderCoords:t.positionsRenderCoords,positionsProjected:t.positionsProjectedWorldCoords,positionsFittedRenderCoords:t.positionsFittedRenderCoords,intersectingSegments:r?t.geodesicIntersectingSegments:t.intersectingSegments,triangleIndices:r?t.geodesicTriangleIndices:t.triangleIndices,fittingMode:t.fittingMode,areaCentroid:r?t.geodesicAreaCentroidRenderCoords:t.areaCentroidRenderCoords,pathLengthLabelSegmentIndex:i?0:e.numVertices-2,perimeterLengthLabelSegmentIndex:0,checkerSize:a};this._set("viewData",h)}_updateOrigin(){const t=this.viewData;he(t.positionsRenderCoords,this._origin),qt(this._originTransform,this._origin),this._measurementArea.transform=this._originTransform,this._projectionLines.transform=this._originTransform}_createSegments(t){const e=this.viewData,s=e.path,i=this.view.renderCoordsHelper.spatialReference,r=e.mode,n=[],a=[],h=[],d=e.validMeasurement?s.numVertices:s.numVertices-1;for(let p=0;p0&&h&&r!=null&&t.toRenderCoords(r,this._cursorPositionRenderSpace)){const p=e.positionsRenderCoords[a.numVertices-1],u=this._cursorPositionRenderSpace;let m=null;switch(n){case"euclidean":m=new de(p,u);break;case"geodesic":m=new Ge(p,u,d)}i.nonIntersecting.push(m),this._cursorSegment=m}this._path.setGeometryFromSegments(i.nonIntersecting,this._origin),this._path.visible=s,this._intersectedPath.setGeometryFromSegments(i.intersecting,this._origin),this._intersectedPath.visible=s,this._pathSegments=i.all}_updatePerimeterSegments(){const t=this.visible&&this.viewData.mode==="euclidean",e=this._createSegments("positionsFittedRenderCoords");this._perimeter.setGeometryFromSegments(e.nonIntersecting,this._origin),this._perimeter.visible=t,this._intersectedPerimeter.setGeometryFromSegments(e.intersecting,this._origin),this._intersectedPerimeter.visible=t,this._perimeterSegments=e.all}_updateArea(){const t=this.viewData;switch(t.mode){case"euclidean":this._updateAreaEuclidean(t);break;case"geodesic":this._updateAreaGeodesic()}}_updateAreaEuclidean(t){const e=this.visible;t.validMeasurement&&t.intersectingSegments.size===0&&t.triangleIndices?(this._measurementArea.geometry={uv:t.positionsProjected,position:t.positionsFittedRenderCoords,triangleIndices:t.triangleIndices},this._measurementArea.size=[t.checkerSize,t.checkerSize],this._measurementArea.visible=e):this._measurementArea.visible=!1}_updateAreaGeodesic(){this._measurementArea.visible=!1}_updateProjectionLines(){const t=this.viewData,e=this.visible,s=t.path,i=t.mode;if(s.numVertices>0&&t.validMeasurement&&i==="euclidean"){const r=[];for(let n=0;n=0&&t.pathLengthLabelSegmentIndex0&&n}else this._pathLengthLabel.visible=!1;const d=s==="geodesic"?t.measurementData.geodesicCursorSegmentLength:t.measurementData.cursorSegmentLength;if(d!=null){const g=this._formatLengthLabel(this.messages,d,this.analysisViewData.unit);this._cursorSegmentLengthLabel.distance=this._params.labelDistance,this._cursorSegmentLengthLabel.geometry=this._cursorSegment!=null?{type:"segment",segment:this._cursorSegment,sampleLocation:"end"}:null,this._cursorSegmentLengthLabel.anchor="bottom",this._cursorSegmentLengthLabel.text=g,this._cursorSegmentLengthLabel.visible=r&&d.value!==0&&n}else this._cursorSegmentLengthLabel.visible=!1;this._cursorSegmentLengthLabel.overlaps(this._pathLengthLabel)&&(this._cursorSegmentLengthLabel.visible=!1),this._pathLengthLabel.overlaps(this._areaLabel)&&(this._pathLengthLabel.visible=!1);const p=t.mode==="geodesic",u=p?e.geodesicPathLength:e.perimeterLength,m=this._formatLengthLabel(this.messages,u,this.analysisViewData.unit);if(this._set("perimeterLengthLabel",m),t.validMeasurement&&t.intersectingSegments.size===0){this._perimeterLengthLabel.distance=this._params.labelDistance,this._perimeterLengthLabel.anchor="top",this._perimeterLengthLabel.text=m,this._perimeterLengthLabel.visible=!0;let g=!0;for(let L=0;L{this.messages=t,this.view&&this._update()}).finally(()=>{this.loadingMessages=!1})}};var T;o([l()],S.prototype,"view",void 0),o([l()],S.prototype,"messages",void 0),o([l()],S.prototype,"analysis",void 0),o([l()],S.prototype,"viewData",void 0),o([l()],S.prototype,"analysisViewData",void 0),o([l({readOnly:!0})],S.prototype,"areaLabel",void 0),o([l({readOnly:!0})],S.prototype,"perimeterLengthLabel",void 0),o([l()],S.prototype,"loadingMessages",void 0),o([l()],S.prototype,"visible",null),S=o([te("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementVisualization")],S),function(t){t[t.Small=12]="Small",t[t.Large=16]="Large"}(T||(T={}));const Gs={validMeasurement:!1,path:null,pathVersion:-1,cursorPoint:null,measurementData:null,mode:null,positionsGeographic:null,positionsRenderCoords:null,positionsProjected:null,positionsFittedRenderCoords:null,intersectingSegments:null,triangleIndices:null,fittingMode:null,areaCentroid:null,pathLengthLabelSegmentIndex:null,perimeterLengthLabelSegmentIndex:null,checkerSize:null},Ds=new de(c(),c());let _=class extends ss(ue){constructor(t){super(t),this.type="area-measurement-view-3d",this.analysis=null,this.measurementData=null,this.lastDraggedVertex=null,this.cursorPoint=null,this.mode=le.Auto}initialize(){const{analysis:t,view:e}=this;this.path=new M({view:e,areaMeasurement:t}),this.analysisVisualization=new S({view:e,analysis:t,analysisViewData:this}),this.analysisController=new x({view:e,analysis:t,analysisViewData:this})}destroy(){this.analysisController=y(this.analysisController),this.analysisVisualization=y(this.analysisVisualization),this.path.destroy()}get updating(){var t;return!!((t=this.analysisVisualization)!=null&&t.loadingMessages)}get result(){const{measurementData:t}=this;return t==null?{area:null,mode:null,perimeter:null}:t.actualMeasurementMode==="euclidean"?{area:t.area,perimeter:t.perimeterLength,mode:"euclidean"}:{area:t.geodesicArea,perimeter:t.pathLength,mode:"geodesic"}}get viewData(){return this.analysisVisualization.viewData}get validMeasurement(){return this.path.isValidPolygon}get unit(){return this.analysis.unit??this._defaultUnit}get testData(){return{visualization:this.analysisVisualization,controller:this.analysisController}}};o([l({readOnly:!0})],_.prototype,"type",void 0),o([l({constructOnly:!0,nonNullable:!0})],_.prototype,"analysis",void 0),o([l()],_.prototype,"updating",null),o([l()],_.prototype,"analysisVisualization",void 0),o([l()],_.prototype,"analysisController",void 0),o([l()],_.prototype,"result",null),o([l()],_.prototype,"measurementData",void 0),o([l()],_.prototype,"viewData",null),o([l()],_.prototype,"validMeasurement",null),o([l()],_.prototype,"path",void 0),o([l()],_.prototype,"lastDraggedVertex",void 0),o([l()],_.prototype,"cursorPoint",void 0),o([l()],_.prototype,"mode",void 0),o([l()],_.prototype,"unit",null),o([l(Xt)],_.prototype,"_defaultUnit",void 0),_=o([te("esri.views.3d.analysis.AreaMeasurementAnalysisView3D")],_);const zs=_,js=Object.freeze(Object.defineProperty({__proto__:null,default:zs},Symbol.toStringTag,{value:"Module"}));export{js as A,ws as n}; diff --git a/assets/AtmosphereCompositing.glsl-69a14b5e.js b/assets/AtmosphereCompositing.glsl-69a14b5e.js new file mode 100644 index 0000000..304cde7 --- /dev/null +++ b/assets/AtmosphereCompositing.glsl-69a14b5e.js @@ -0,0 +1 @@ +import{n as a,o as e}from"./index-080e108a.js";export{a as AtmosphereCompositingPassParameters,e as build}; diff --git a/assets/AttachmentInfo-cb670dd0.js b/assets/AttachmentInfo-cb670dd0.js new file mode 100644 index 0000000..668d4ed --- /dev/null +++ b/assets/AttachmentInfo-cb670dd0.js @@ -0,0 +1 @@ +import{ai as o,aj as e,eZ as d,al as u,ck as f}from"./index-080e108a.js";function y(n){const{exifInfo:i,exifName:r,tagName:a}=n;if(!i||!r||!a)return null;const l=i.find(p=>p.name===r);return l?c({tagName:a,tags:l.tags}):null}function c(n){const{tagName:i,tags:r}=n;if(!r||!i)return null;const a=r.find(l=>l.name===i);return a&&a.value||null}var s;const m={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let t=s=class extends f{constructor(n){super(n),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:n}=this,i=y({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:n});return m[i]||null}clone(){return new s({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};o([e({type:String})],t.prototype,"contentType",void 0),o([e()],t.prototype,"exifInfo",void 0),o([e({readOnly:!0})],t.prototype,"orientationInfo",null),o([e({type:d})],t.prototype,"id",void 0),o([e({type:String})],t.prototype,"globalId",void 0),o([e({type:String})],t.prototype,"keywords",void 0),o([e({type:String})],t.prototype,"name",void 0),o([e({json:{read:!1}})],t.prototype,"parentGlobalId",void 0),o([e({json:{read:!1}})],t.prototype,"parentObjectId",void 0),o([e({type:d})],t.prototype,"size",void 0),o([e({json:{read:!1}})],t.prototype,"url",void 0),t=s=o([u("esri.layers.support.AttachmentInfo")],t);const h=t;export{h as l}; diff --git a/assets/AttachmentQuery-972bbd60.js b/assets/AttachmentQuery-972bbd60.js new file mode 100644 index 0000000..5c21110 --- /dev/null +++ b/assets/AttachmentQuery-972bbd60.js @@ -0,0 +1 @@ +import{ai as e,aj as s,bY as n,al as a,cj as p,ck as h,cl as l}from"./index-080e108a.js";var r;let t=r=class extends h{constructor(o){super(o),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(o,i){i.resultOffset=this.start,i.resultRecordCount=this.num||10}clone(){return new r(l({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};e([s({type:[String],json:{write:!0}})],t.prototype,"attachmentTypes",void 0),e([s({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],t.prototype,"attachmentsWhere",void 0),e([s({type:Boolean,json:{write:!0}})],t.prototype,"cacheHint",void 0),e([s({type:[String],json:{write:!0}})],t.prototype,"keywords",void 0),e([s({type:[Number],json:{write:!0}})],t.prototype,"globalIds",void 0),e([s({json:{write:!0}})],t.prototype,"name",void 0),e([s({type:Number,json:{read:{source:"resultRecordCount"}}})],t.prototype,"num",void 0),e([s({type:[Number],json:{write:!0}})],t.prototype,"objectIds",void 0),e([s({type:Boolean,json:{default:!1,write:!0}})],t.prototype,"returnMetadata",void 0),e([s({type:[Number],json:{write:!0}})],t.prototype,"size",void 0),e([s({type:Number,json:{read:{source:"resultOffset"}}})],t.prototype,"start",void 0),e([n("start"),n("num")],t.prototype,"writeStart",null),e([s({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],t.prototype,"where",void 0),t=r=e([a("esri.rest.support.AttachmentQuery")],t),t.from=p(t);const d=t;export{d as c}; diff --git a/assets/BaseDynamicLayerView3D-83fabc6e.js b/assets/BaseDynamicLayerView3D-83fabc6e.js new file mode 100644 index 0000000..f42be04 --- /dev/null +++ b/assets/BaseDynamicLayerView3D-83fabc6e.js @@ -0,0 +1 @@ +import{ai as r,al as e}from"./index-080e108a.js";import{z as s}from"./DynamicLayerView3D-b48678f2.js";import"./LayerView3D-ffd35809.js";import"./projectExtentUtils-efa4cddd.js";import"./ImageMaterial-5c48df66.js";import"./LayerView-448bc5ea.js";import"./RefreshableLayerView-915e7f53.js";let t=class extends s{constructor(){super(...arguments),this.type="base-dynamic-3d"}};t=r([e("esri.views.3d.layers.BaseDynamicLayerView3D")],t);const d=t;export{d as default}; diff --git a/assets/BidiEngine-9a40f2f4.js b/assets/BidiEngine-9a40f2f4.js new file mode 100644 index 0000000..e40841e --- /dev/null +++ b/assets/BidiEngine-9a40f2f4.js @@ -0,0 +1 @@ +const I=[["(",")"],[")","("],["<",">"],[">","<"],["[","]"],["]","["],["{","}"],["}","{"],["«","»"],["»","«"],["‹","›"],["›","‹"],["⁽","⁾"],["⁾","⁽"],["₍","₎"],["₎","₍"],["≤","≥"],["≥","≤"],["〈","〉"],["〉","〈"],["﹙","﹚"],["﹚","﹙"],["﹛","﹜"],["﹜","﹛"],["﹝","﹞"],["﹞","﹝"],["﹤","﹥"],["﹥","﹤"]],V=["آ","أ","إ","ا"],$=["ﻵ","ﻷ","ﻹ","ﻻ"],tt=["ﻶ","ﻸ","ﻺ","ﻼ"],k=["ا","ب","ت","ث","ج","ح","خ","د","ذ","ر","ز","س","ش","ص","ض","ط","ظ","ع","غ","ف","ق","ك","ل","م","ن","ه","و","ي","إ","أ","آ","ة","ى","ل","م","ن","ه","و","ي","إ","أ","آ","ة","ى","ی","ئ","ؤ"],rt=["ﺍ","ﺏ","ﺕ","ﺙ","ﺝ","ﺡ","ﺥ","ﺩ","ﺫ","ﺭ","ﺯ","ﺱ","ﺵ","ﺹ","ﺽ","ﻁ","ﻅ","ﻉ","ﻍ","ﻑ","ﻕ","ﻙ","ﻝ","ﻡ","ﻥ","ﻩ","ﻭ","ﻱ","ﺇ","ﺃ","ﺁ","ﺓ","ﻯ","ﯼ","ﺉ","ﺅ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺉ","ﺅ"],et=["ﺎ","ﺐ","ﺖ","ﺚ","ﺞ","ﺢ","ﺦ","ﺪ","ﺬ","ﺮ","ﺰ","ﺲ","ﺶ","ﺺ","ﺾ","ﻂ","ﻆ","ﻊ","ﻎ","ﻒ","ﻖ","ﻚ","ﻞ","ﻢ","ﻦ","ﻪ","ﻮ","ﻲ","ﺈ","ﺄ","ﺂ","ﺔ","ﻰ","ﯽ","ﺊ","ﺆ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺊ","ﺆ"],nt=["ﺎ","ﺒ","ﺘ","ﺜ","ﺠ","ﺤ","ﺨ","ﺪ","ﺬ","ﺮ","ﺰ","ﺴ","ﺸ","ﺼ","ﻀ","ﻄ","ﻈ","ﻌ","ﻐ","ﻔ","ﻘ","ﻜ","ﻠ","ﻤ","ﻨ","ﻬ","ﻮ","ﻴ","ﺈ","ﺄ","ﺂ","ﺔ","ﻰ","ﯿ","ﺌ","ﺆ","ﹱ","ﹲ","ﹴ","ﹷ","ﹹ","ﹻ","ﹽ","ﹿ","ﺀ","ﺌ","ﺆ"],ot=["ﺍ","ﺑ","ﺗ","ﺛ","ﺟ","ﺣ","ﺧ","ﺩ","ﺫ","ﺭ","ﺯ","ﺳ","ﺷ","ﺻ","ﺿ","ﻃ","ﻇ","ﻋ","ﻏ","ﻓ","ﻗ","ﻛ","ﻟ","ﻣ","ﻧ","ﻫ","ﻭ","ﻳ","ﺇ","ﺃ","ﺁ","ﺓ","ﻯ","ﯾ","ﺋ","ﺅ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺋ","ﺅ"],z=["ء","آ","أ","ؤ","إ","ا","ة","د","ذ","ر","ز","و","ى"],it=["ً","ً","ٌ","؟","ٍ","؟","َ","َ","ُ","ُ","ِ","ِ","ّ","ّ","ْ","ْ","ء","آ","آ","أ","أ","ؤ","ؤ","إ","إ","ئ","ئ","ئ","ئ","ا","ا","ب","ب","ب","ب","ة","ة","ت","ت","ت","ت","ث","ث","ث","ث","ج","ج","ج","ج","ح","ح","ح","ح","خ","خ","خ","خ","د","د","ذ","ذ","ر","ر","ز","ز","س","س","س","س","ش","ش","ش","ش","ص","ص","ص","ص","ض","ض","ض","ض","ط","ط","ط","ط","ظ","ظ","ظ","ظ","ع","ع","ع","ع","غ","غ","غ","غ","ف","ف","ف","ف","ق","ق","ق","ق","ك","ك","ك","ك","ل","ل","ل","ل","م","م","م","م","ن","ن","ن","ن","ه","ه","ه","ه","و","و","ى","ى","ي","ي","ي","ي","ﻵ","ﻶ","ﻷ","ﻸ","ﻹ","ﻺ","ﻻ","ﻼ","؟","؟","؟"],q=["ء","ف"],ut=["غ","ي"],st=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],at=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],e=0,s=1,h=2,B=3,t=4,_=5,j=6,r=7,m=8,R=9,b=10,T=11,n=12,ft=13,ct=14,lt=15,ht=16,Tt=17,l=18,At=["UBAT_L","UBAT_R","UBAT_EN","UBAT_AN","UBAT_ON","UBAT_B","UBAT_S","UBAT_AL","UBAT_WS","UBAT_CS","UBAT_ES","UBAT_ET","UBAT_NSM","UBAT_LRE","UBAT_RLE","UBAT_PDF","UBAT_LRO","UBAT_RLO","UBAT_BN"],p=100,Lt=[p+0,e,e,e,e,p+1,p+2,p+3,s,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,p+4,t,t,t,e,t,e,t,e,t,t,t,e,e,t,t,e,e,e,e,e,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,e,e,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,e,e,t,t,e,e,t,t,e,e,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,e,e,e,p+5,r,r,p+6,p+7],gt=[[l,l,l,l,l,l,l,l,l,j,_,j,m,_,l,l,l,l,l,l,l,l,l,l,l,l,l,l,_,_,_,j,m,t,t,T,T,T,t,t,t,t,t,b,R,b,R,R,h,h,h,h,h,h,h,h,h,h,R,t,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,t,t,l,l,l,l,l,l,_,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,R,t,T,T,T,T,t,t,t,t,e,t,t,l,t,t,T,T,h,h,t,e,t,t,t,h,e,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,e,e,e,e,e,e,e,e],[e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,t,t,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,e,e,e,e,e,e,e,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,e,t,t,t,t,t,t,t,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,s,n,s,n,n,s,n,n,s,n,t,t,t,t,t,t,t,t,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,t,t,t,t,t,s,s,s,s,s,t,t,t,t,t,t,t,t,t,t,t],[B,B,B,B,t,t,t,t,r,T,T,r,R,r,t,t,n,n,n,n,n,n,n,n,n,n,n,r,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,B,B,B,B,B,B,B,B,B,B,T,B,B,r,r,r,n,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,n,n,n,n,n,n,n,B,t,n,n,n,n,n,n,r,r,n,n,t,n,n,n,n,r,r,h,h,h,h,h,h,h,h,h,h,r,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,r,r,n,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,n,n,n,n,n,n,n,n,n,n,n,r,t,t,t,t,t,t,t,t,t,t,t,t,t,t,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,n,n,n,n,n,n,n,n,n,s,s,t,t,t,t,s,t,t,t,t,t],[m,m,m,m,m,m,m,m,m,m,m,l,l,l,e,s,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,m,_,ft,ct,lt,ht,Tt,R,T,T,T,T,T,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,R,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,m,l,l,l,l,l,t,t,t,t,t,l,l,l,l,l,l,h,e,t,t,h,h,h,h,h,h,b,b,t,t,t,e,h,h,h,h,h,h,h,h,h,h,b,b,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,t,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t],[e,e,e,e,e,e,e,t,t,t,t,t,t,t,t,t,t,t,t,e,e,e,e,e,t,t,t,t,t,s,n,s,s,s,s,s,s,s,s,s,s,b,s,s,s,s,s,s,s,s,s,s,s,s,s,t,s,s,s,s,s,t,s,t,s,s,t,s,s,t,s,s,s,s,s,s,s,s,s,s,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,n,n,n,n,n,n,n,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,R,t,R,t,t,R,t,t,t,t,t,t,t,t,t,T,t,t,b,b,t,t,t,t,t,T,T,t,t,t,t,t,r,r,r,r,r,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,l],[t,t,t,T,T,T,t,t,t,t,t,b,R,b,R,R,h,h,h,h,h,h,h,h,h,h,R,t,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,t,t,t,t,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,t,e,e,e,e,e,e,t,t,e,e,e,e,e,e,t,t,e,e,e,e,e,e,t,t,e,e,e,t,t,t,T,T,t,t,t,T,T,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]];class Pt{constructor(){this.inputFormat="ILYNN",this.outputFormat="VLNNN",this.sourceToTarget=[],this.targetToSource=[],this.levels=[]}bidiTransform(o,u,a){if(this.sourceToTarget=[],this.targetToSource=[],!o)return"";if(Ot(this.sourceToTarget,this.targetToSource,o.length),!this.checkParameters(u,a))return o;u=this.inputFormat,a=this.outputFormat;let f=o;const c=It,L=H(u.charAt(1)),A=H(a.charAt(1)),g=(u.charAt(0)==="I"?"L":u.charAt(0))+L,d=(a.charAt(0)==="I"?"L":a.charAt(0))+A,U=u.charAt(2)+a.charAt(2);c.defInFormat=g,c.defOutFormat=d,c.defSwap=U;const w=E(o,g,d,U,c);let N=!1;return a.charAt(1)==="R"?N=!0:a.charAt(1)!=="C"&&a.charAt(1)!=="D"||(N=this.checkContextual(w)==="rtl"),this.sourceToTarget=F,this.targetToSource=xt(this.sourceToTarget),P=this.targetToSource,f=u.charAt(3)===a.charAt(3)?w:a.charAt(3)==="S"?Bt(N,w,!0):Rt(w,N,!0),this.sourceToTarget=F,this.targetToSource=P,this.levels=y,f}_inputFormatSetter(o){if(!J.test(o))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.inputFormat=o}_outputFormatSetter(o){if(!J.test(o))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.outputFormat=o}checkParameters(o,u){return o?this._inputFormatSetter(o):o=this.inputFormat,u?this._outputFormatSetter(u):u=this.outputFormat,o!==u}checkContextual(o){let u=D(o);if(u!=="ltr"&&u!=="rtl"){try{u=document.dir.toLowerCase()}catch{}u!=="ltr"&&u!=="rtl"&&(u="ltr")}return u}hasBidiChar(o){return Dt.test(o)}}function E(i,o,u,a,f){const c=dt(i,{inFormat:o,outFormat:u,swap:a},f);if(c.inFormat===c.outFormat)return i;o=c.inFormat,u=c.outFormat,a=c.swap;const L=o.substring(0,1),A=o.substring(1,4),g=u.substring(0,1),d=u.substring(1,4);if(f.inFormat=o,f.outFormat=u,f.swap=a,L==="L"&&u==="VLTR"){if(A==="LTR")return f.dir=C,S(i,f);if(A==="RTL")return f.dir=O,S(i,f)}if(L==="V"&&g==="V")return f.dir=A==="RTL"?O:C,Y(i,f);if(L==="L"&&u==="VRTL")return A==="LTR"?(f.dir=C,i=S(i,f)):(f.dir=O,i=S(i,f)),Y(i);if(o==="VLTR"&&u==="LLTR")return f.dir=C,S(i,f);if(L==="V"&&g==="L"&&A!==d)return i=Y(i),A==="RTL"?E(i,"LLTR","VLTR",a,f):E(i,"LRTL","VRTL",a,f);if(o==="VRTL"&&u==="LRTL")return E(i,"LRTL","VRTL",a,f);if(L==="L"&&g==="L"){const U=f.swap;return f.swap=U.substr(0,1)+"N",A==="RTL"?(f.dir=O,i=S(i,f),f.swap="N"+U.substr(1,2),f.dir=C,i=S(i,f)):(f.dir=C,i=S(i,f),f.swap="N"+U.substr(1,2),i=E(i,"VLTR","LRTL",f.swap,f)),i}return i}function dt(i,o,u){if(o.inFormat===void 0&&(o.inFormat=u.defInFormat),o.outFormat===void 0&&(o.outFormat=u.defOutFormat),o.swap===void 0&&(o.swap=u.defSwap),o.inFormat===o.outFormat)return o;const a=o.inFormat.substring(0,1),f=o.outFormat.substring(0,1);let c,L=o.inFormat.substring(1,4),A=o.outFormat.substring(1,4);return L.charAt(0)==="C"&&(c=D(i),L=c==="ltr"||c==="rtl"?c.toUpperCase():o.inFormat.charAt(2)==="L"?"LTR":"RTL",o.inFormat=a+L),A.charAt(0)==="C"&&(c=D(i),c==="rtl"?A="RTL":c==="ltr"?(c=mt(i),A=c.toUpperCase()):A=o.outFormat.charAt(2)==="L"?"LTR":"RTL",o.outFormat=f+A),o}function Bt(i,o,u){if(o.length===0)return"";i===void 0&&(i=!0),u===void 0&&(u=!0);const a=(o=String(o)).split("");let f=0,c=1,L=a.length;i||(f=a.length-1,c=-1,L=1);const A=Ut(a,f,c,L,u);let g="";for(let d=0;d-1?(X(P,d,!i,-1),F.splice(d,1)):g+=a[d];return g}function Ut(i,o,u,a,f){let c=0;const L=[];let A=0;for(let g=o;g*u="ﹰ"&&f[c]<"\uFEFF"){const A=i.charCodeAt(c);f[c]>="ﻵ"&&f[c]<="ﻼ"?(o?(c>0&&u&&f[c-1]===" "?a=a.substring(0,a.length-1)+"ل":(a+="ل",L=!0),a+=V[(A-65269)/2]):(a+=V[(A-65269)/2],a+="ل",c+10)if(N===16){for(let v=L;v-1){for(let v=L;v=0&&i[c]===m;c--)o[c]=a.dir}}function bt(i,o,u){if(u.hiLevel!==0&&u.swap.substr(0,1)!==u.swap.substr(1,2))for(let a=0;a>8];return u=q[o]&&i<=ut[o])return!0;return!1}function Z(i,o,u,a){for(;o*u=i){for(c=U+1;c=i;)c++;for(L=U,A=c-1;L(f.lastArabic=!1,e),UBAT_R:()=>(f.lastArabic=!1,s),UBAT_ON:()=>t,UBAT_AN:()=>B,UBAT_EN:()=>f.lastArabic?B:h,UBAT_AL:()=>(f.lastArabic=!0,f.hasUbatAl=!0,s),UBAT_WS:()=>t,UBAT_CS:()=>{let L,A;return a<1||a+1>=o.length||(L=u[a-1])!==h&&L!==B||(A=o[a+1])!==h&&A!==B?t:(f.lastArabic&&(A=B),A===L?A:t)},UBAT_ES:()=>(a>0?u[a-1]:_)===h&&a+1{if(a>0&&u[a-1]===h)return h;if(f.lastArabic)return t;let L=a+1;const A=o.length;for(;L{if(f.inFormat==="VLTR"){const L=o.length;let A=a+1;for(;A=1425&&g<=2303||g===64286,U=o[A];if(d&&(U===s||U===r))return s}}return a<1||o[a-1]===_?t:u[a-1]},UBAT_B:()=>(f.lastArabic=!0,f.hasUbatB=!0,f.dir),UBAT_S:()=>(f.hasUbatS=!0,t),UBAT_LRE:()=>(f.lastArabic=!1,t),UBAT_RLE:()=>(f.lastArabic=!1,t),UBAT_LRO:()=>(f.lastArabic=!1,t),UBAT_RLO:()=>(f.lastArabic=!1,t),UBAT_PDF:()=>(f.lastArabic=!1,t),UBAT_BN:()=>t}[At[c]]()}function Nt(i){let o,u=0,a=I.length-1;for(;u<=a;)if(o=Math.floor((u+a)/2),iI[o][0]))return I[o][1];u=o+1}return i}function vt(i){for(let o=0;o="ً"&&i<="ٕ"}function H(i){return i==="L"?"LTR":i==="R"?"RTL":i==="C"?"CLR":i==="D"?"CRL":""}function Vt(i,o,u,a){for(;o*uo||!u&&i[f]===o)&&(i[f]+=a)}let F=[],P=[],y=[];const It={dir:0,defInFormat:"LLTR",defoutFormat:"VLTR",defSwap:"YN",inFormat:"LLTR",outFormat:"VLTR",swap:"YN",hiLevel:0,lastArabic:!1,hasUbatAl:!1,hasBlockSep:!1,hasSegSep:!1,defOutFormat:""},jt=5,kt=6,C=0,O=1,J=/^[(I|V)][(L|R|C|D)][(Y|N)][(S|N)][N]$/,Dt=/[\u0591-\u06ff\ufb1d-\ufefc]/;export{Pt as C}; diff --git a/assets/BingMapsLayer-358d6de4.js b/assets/BingMapsLayer-358d6de4.js new file mode 100644 index 0000000..d400f09 --- /dev/null +++ b/assets/BingMapsLayer-358d6de4.js @@ -0,0 +1 @@ +import{eQ as M,eS as j,eR as x,bV as b,bc as c,ca as B,dz as U,at as h,ar as u,ai as r,aj as s,al as T,fJ as R,aA as P,cp as k,c7 as $,f2 as a}from"./index-080e108a.js";import{O as I}from"./MultiOriginJSONSupport-e4912ffd.js";import{o as f}from"./imageBitmapUtils-391f7b8f.js";import{c as _}from"./OperationalLayer-0e8f8b28.js";import"./commonProperties-30089b06.js";var v;const y=new R("0/0/0",0,0,0,void 0);let g=v=class extends M(j(x(P))){constructor(){super(...arguments),this.tileInfo=b.create({spatialReference:c.WebMercator,size:256}),this.type="base-tile",this.fullExtent=new B(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,c.WebMercator),this.spatialReference=c.WebMercator}getTileBounds(e,t,i,l){const n=l||U();return y.level=e,y.row=t,y.col=i,y.extent=n,this.tileInfo.updateTileInfo(y),y.extent=void 0,n}fetchTile(e,t,i,l={}){const{signal:n}=l,p=this.getTileUrl(e,t,i),d={responseType:"image",signal:n,query:{...this.refreshParameters}};return h(p??"",d).then(m=>m.data)}async fetchImageBitmapTile(e,t,i,l={}){const{signal:n}=l;if(this.fetchTile!==v.prototype.fetchTile){const S=await this.fetchTile(e,t,i,l);return f(S,e,t,i,n)}const p=this.getTileUrl(e,t,i)??"",d={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:m}=await h(p,d);return f(m,e,t,i,n)}getTileUrl(){throw new u("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented")}};r([s({type:b})],g.prototype,"tileInfo",void 0),r([s({type:["show","hide"]})],g.prototype,"listMode",void 0),r([s({readOnly:!0,value:"base-tile"})],g.prototype,"type",void 0),r([s({nonNullable:!0})],g.prototype,"fullExtent",void 0),r([s()],g.prototype,"spatialReference",void 0),g=v=r([T("esri.layers.BaseTileLayer")],g);const A=g,w=new k({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"}),L="https://dev.virtualearth.net";let o=class extends M(_(I(A))){constructor(e){super(e),this.type="bing-maps",this.tileInfo=new b({size:[256,256],dpi:96,origin:new $({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:c.WebMercator}),spatialReference:c.WebMercator,lods:[new a({level:1,resolution:78271.5169639999,scale:295828763795777e-6}),new a({level:2,resolution:39135.7584820001,scale:147914381897889e-6}),new a({level:3,resolution:19567.8792409999,scale:73957190948944e-6}),new a({level:4,resolution:9783.93962049996,scale:36978595474472e-6}),new a({level:5,resolution:4891.96981024998,scale:18489297737236e-6}),new a({level:6,resolution:2445.98490512499,scale:9244648868618e-6}),new a({level:7,resolution:1222.99245256249,scale:4622324434309e-6}),new a({level:8,resolution:611.49622628138,scale:2311162217155e-6}),new a({level:9,resolution:305.748113140558,scale:1155581108577e-6}),new a({level:10,resolution:152.874056570411,scale:577790.554289}),new a({level:11,resolution:76.4370282850732,scale:288895.277144}),new a({level:12,resolution:38.2185141425366,scale:144447.638572}),new a({level:13,resolution:19.1092570712683,scale:72223.819286}),new a({level:14,resolution:9.55462853563415,scale:36111.909643}),new a({level:15,resolution:4.77731426794937,scale:18055.954822}),new a({level:16,resolution:2.38865713397468,scale:9027.977411}),new a({level:17,resolution:1.19432856685505,scale:4513.988705}),new a({level:18,resolution:.597164283559817,scale:2256.994353}),new a({level:19,resolution:.298582141647617,scale:1128.497176}),new a({level:20,resolution:.1492910708238085,scale:564.248588})]}),this.key=null,this.style="road",this.culture="en-US",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get("bingMetadata")}set bingMetadata(e){this._set("bingMetadata",e)}get copyright(){return this.bingMetadata!=null?this.bingMetadata.copyright:null}get operationalLayerType(){return w.toJSON(this.style)}get bingLogo(){return this.bingMetadata!=null?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then(()=>this._getMetadata())):this.addResolvingPromise(Promise.reject(new u("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(e,t,i){if(!this.loaded||this.bingMetadata==null)return null;const l=this.bingMetadata.resourceSets[0].resources[0],n=l.imageUrlSubdomains[t%l.imageUrlSubdomains.length],p=this._getQuadKey(e,t,i);return l.imageUrl.replace("{subdomain}",n).replace("{quadkey}",p)}async fetchAttributionData(){return this.load().then(()=>this.bingMetadata==null?null:{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map(e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map(t=>({zoomMin:t.zoomMin,zoomMax:t.zoomMax,score:1,bbox:[t.bbox[0],t.bbox[1],t.bbox[2],t.bbox[3]]}))}))})}_getMetadata(){const e={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return h(`${L}/REST/v1/Imagery/Metadata/${e}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then(t=>{const i=t.data;if(i.statusCode!==200)throw new u("bingmapslayer:getmetadata",i.statusDescription);if(this.bingMetadata=i,this.bingMetadata.resourceSets.length===0)throw new u("bingmapslayer:getmetadata","no bing resourcesets");if(this.bingMetadata.resourceSets[0].resources.length===0)throw new u("bingmapslayer:getmetadata","no bing resources")}).catch(t=>{throw new u("bingmapslayer:getmetadata",t.message)})}_getPortalBingKey(){return h(this.portalUrl??"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then(e=>{if(!e.data.bingKey)throw new u("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey}).catch(e=>{throw new u("bingmapslayer:getportalbingkey",e.message)})}_getQuadKey(e,t,i){let l="";for(let n=e;n>0;n--){let p=0;const d=1<({minX:s[0],minY:s[1],maxX:s[2],maxY:s[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const s=new Array(this._idByBounds.size);let d=0;this._idByBounds.forEach((n,e)=>{s[d++]=e}),this._indexInvalid=!1,this._index.clear(),this._index.load(s)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(s=>this._idByBounds.has(s))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const s=h();for(const d of this._boundsById.values())d&&(s[0]=Math.min(d[0],s[0]),s[1]=Math.min(d[1],s[1]),s[2]=Math.max(d[2],s[2]),s[3]=Math.max(d[3],s[3]));return s}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(s){const d=this._boundsById.get(s);this._boundsById.delete(s),d&&(this._idByBounds.delete(d),this._indexInvalid||this._index.remove(d))}forEachInBounds(s,d){this._loadIndex(),l(this._index,s,n=>d(this._idByBounds.get(n)))}get(s){return this._boundsById.get(s)}has(s){return this._boundsById.has(s)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(s,d){if(!this._indexInvalid){const n=this._boundsById.get(s);n&&(this._index.remove(n),this._idByBounds.delete(n))}this._boundsById.set(s,d),d&&(this._idByBounds.set(d,s),this._indexInvalid||(this._boundsToLoad.push(d),this._boundsToLoad.length>_&&this._loadIndex()))}}export{B as o}; diff --git a/assets/BuildingComponentSublayer-5d49e5f9.js b/assets/BuildingComponentSublayer-5d49e5f9.js new file mode 100644 index 0000000..f8c45c6 --- /dev/null +++ b/assets/BuildingComponentSublayer-5d49e5f9.js @@ -0,0 +1 @@ +import{am as g,ai as t,aj as r,ay as y,eZ as v,al as h,bz as b,gC as L,cY as w,at as F,dL as I,ar as p,aK as S,ca as O,bc as j,fR as x,cC as T,d2 as $,cp as q}from"./index-080e108a.js";import"./UniqueValueRenderer-fef4204d.js";import{n as E}from"./jsonUtils-f73b3833.js";import m from"./FeatureLayer-5c6d2c3b.js";import{S as Q}from"./MultiOriginJSONSupport-e4912ffd.js";import{y as u,p as P}from"./commonProperties-30089b06.js";import{t as A}from"./capabilities-5d185925.js";import{s as D}from"./fieldProperties-62c55499.js";import{r as R}from"./FieldsIndex-f79a8f26.js";import{r as N}from"./I3SIndexInfo-445e6968.js";import{s as U,l as _,u as C,m as B}from"./I3SLayerDefinitions-ffdb3821.js";import{b as K}from"./Query-1c961d4c.js";import{p as M}from"./popupUtils-82ea8abb.js";import{l as Z}from"./I3SUtil-2c288808.js";import{n as k,p as V}from"./popupUtils-f04ec9a9.js";let n=class extends g(Q){constructor(e){super(e),this.title="",this.id=-1,this.modelName=null,this.isEmpty=null,this.legendEnabled=!0,this.visible=!0,this.opacity=1}readTitle(e,a){return typeof a.alias=="string"?a.alias:typeof a.name=="string"?a.name:""}readIdOnlyOnce(e){return this.id!==-1?this.id:typeof e=="number"?e:-1}};t([r({type:String,json:{origins:{"web-scene":{write:!0},"portal-item":{write:!0}}}})],n.prototype,"title",void 0),t([y("service","title",["alias","name"])],n.prototype,"readTitle",null),t([r()],n.prototype,"layer",void 0),t([r({type:v,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],n.prototype,"id",void 0),t([y("service","id")],n.prototype,"readIdOnlyOnce",null),t([r(u(String))],n.prototype,"modelName",void 0),t([r(u(Boolean))],n.prototype,"isEmpty",void 0),t([r({type:Boolean,nonNullable:!0})],n.prototype,"legendEnabled",void 0),t([r({type:Boolean,json:{name:"visibility",write:!0}})],n.prototype,"visible",void 0),t([r({type:Number,json:{write:!0}})],n.prototype,"opacity",void 0),n=t([h("esri.layers.buildingSublayers.BuildingSublayer")],n);const z=n,f="esri.layers.buildingSublayers.BuildingComponentSublayer",G=b.getLogger(f),c=D();let i=class extends L.LoadableMixin(w(z)){constructor(e){super(e),this.type="building-component",this.nodePages=null,this.materialDefinitions=[],this.textureSetDefinitions=[],this.geometryDefinitions=[],this.indexInfo=null,this.serviceUpdateTimeStamp=null,this.store=null,this.attributeStorageInfo=[],this.fields=[],this.associatedLayer=null,this.outFields=null,this.listMode="show",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType="3d-object"}get parsedUrl(){var e,a;return this.layer?{path:`${(e=this.layer.parsedUrl)==null?void 0:e.path}/sublayers/${this.id}`,query:(a=this.layer.parsedUrl)==null?void 0:a.query}:{path:""}}get fieldsIndex(){return new R(this.fields)}readAssociatedLayer(e,a){const s=this.layer.associatedFeatureServiceItem,o=a.associatedLayerID;return s!=null&&typeof o=="number"?new m({portalItem:s,layerId:o}):null}get objectIdField(){if(this.fields!=null){for(const e of this.fields)if(e.type==="oid")return e.name}return null}get displayField(){return this.associatedLayer!=null?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get fullExtent(){return this.layer.fullExtent}get spatialReference(){return this.layer.spatialReference}get version(){return this.layer.version}get elevationInfo(){return this.layer.elevationInfo}get minScale(){return this.layer.minScale}get maxScale(){return this.layer.maxScale}get effectiveScaleRange(){return this.layer.effectiveScaleRange}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const a=e!=null?e.signal:null,s=this._fetchService(a).then(()=>{this.indexInfo=N(this.parsedUrl.path,this.rootNode,this.nodePages,this.apiKey,G,a)});return this.addResolvingPromise(s),Promise.resolve(this)}createPopupTemplate(e){return M(this,e)}async _fetchService(e){const a=(await F(this.parsedUrl.path,{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(a,{origin:"service",url:this.parsedUrl})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,a){var o,l,d;const s=(l=(o=this.getFeatureType(a==null?void 0:a.feature))==null?void 0:o.domains)==null?void 0:l[e];return s&&s.type!=="inherited"?s:((d=this.getField(e))==null?void 0:d.domain)??null}getFeatureType(e){return e&&this.associatedLayer!=null?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer!=null?this.associatedLayer.types??[]:[]}get typeIdField(){return this.associatedLayer!=null?this.associatedLayer.typeIdField:null}get geometryType(){return this.layerType==="3d-object"?"mesh":"point"}get profile(){return this.layerType==="3d-object"?"mesh-pyramids":"points"}get capabilities(){const e=this.associatedLayer!=null&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:A,{query:a,data:{supportsZ:s,supportsM:o,isVersioned:l}}=e;return{query:a,data:{supportsZ:s,supportsM:o,isVersioned:l}}}createQuery(){const e=new K;return this.geometryType!=="mesh"&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,a){return this._getAssociatedLayerForQuery().then(s=>s.queryExtent(e||this.createQuery(),a))}queryFeatureCount(e,a){return this._getAssociatedLayerForQuery().then(s=>s.queryFeatureCount(e||this.createQuery(),a))}queryFeatures(e,a){return this._getAssociatedLayerForQuery().then(s=>s.queryFeatures(e||this.createQuery(),a)).then(s=>{if(s!=null&&s.features)for(const o of s.features)o.layer=this.layer,o.sourceLayer=this;return s})}queryObjectIds(e,a){return this._getAssociatedLayerForQuery().then(s=>s.queryObjectIds(e||this.createQuery(),a))}async queryCachedAttributes(e,a){const s=I(this.fieldsIndex,await k(this,V(this)));return Z(this.parsedUrl.path,this.attributeStorageInfo,e,a,s)}async queryCachedFeature(e,a){const s=await this.queryCachedAttributes(e,[a]);if(!s||s.length===0)throw new p("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const o=new S;return o.attributes=s[0],o.layer=this,o.sourceLayer=this,o}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:this.associatedLayer!=null}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e!=null&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),this.associatedLayer==null)throw new p("buildingscenelayer:query-not-available","BuildingSceneLayer component layer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new p("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};t([r({readOnly:!0})],i.prototype,"parsedUrl",null),t([r({type:U,readOnly:!0})],i.prototype,"nodePages",void 0),t([r({type:[_],readOnly:!0})],i.prototype,"materialDefinitions",void 0),t([r({type:[C],readOnly:!0})],i.prototype,"textureSetDefinitions",void 0),t([r({type:[B],readOnly:!0})],i.prototype,"geometryDefinitions",void 0),t([r({readOnly:!0})],i.prototype,"serviceUpdateTimeStamp",void 0),t([r({readOnly:!0})],i.prototype,"store",void 0),t([r({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],i.prototype,"rootNode",void 0),t([r({readOnly:!0})],i.prototype,"attributeStorageInfo",void 0),t([r(c.fields)],i.prototype,"fields",void 0),t([r({readOnly:!0})],i.prototype,"fieldsIndex",null),t([r({readOnly:!0,type:m})],i.prototype,"associatedLayer",void 0),t([y("service","associatedLayer",["associatedLayerID"])],i.prototype,"readAssociatedLayer",null),t([r(c.outFields)],i.prototype,"outFields",void 0),t([r({type:String,readOnly:!0})],i.prototype,"objectIdField",null),t([r({readOnly:!0,type:String,json:{read:!1}})],i.prototype,"displayField",null),t([r({readOnly:!0,type:String})],i.prototype,"apiKey",null),t([r({readOnly:!0,type:O})],i.prototype,"fullExtent",null),t([r({readOnly:!0,type:j})],i.prototype,"spatialReference",null),t([r({readOnly:!0})],i.prototype,"version",null),t([r({readOnly:!0,type:x})],i.prototype,"elevationInfo",null),t([r({readOnly:!0,type:Number})],i.prototype,"minScale",null),t([r({readOnly:!0,type:Number})],i.prototype,"maxScale",null),t([r({readOnly:!0,type:Number})],i.prototype,"effectiveScaleRange",null),t([r({type:["hide","show"],json:{write:!0}})],i.prototype,"listMode",void 0),t([r({types:E,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],i.prototype,"renderer",void 0),t([r({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r(P)],i.prototype,"popupEnabled",void 0),t([r({type:T,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],i.prototype,"popupTemplate",void 0),t([r({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],i.prototype,"normalReferenceFrame",void 0),t([r({readOnly:!0,json:{read:!1}})],i.prototype,"defaultPopupTemplate",null),t([r()],i.prototype,"types",null),t([r()],i.prototype,"typeIdField",null),t([r({json:{write:!1}}),$(new q({"3DObject":"3d-object",Point:"point"}))],i.prototype,"layerType",void 0),t([r()],i.prototype,"geometryType",null),t([r()],i.prototype,"profile",null),t([r({readOnly:!0,json:{read:!1}})],i.prototype,"capabilities",null),i=t([h(f)],i);const ye=i;export{ye as C,z as n}; diff --git a/assets/BuildingGroupSublayer-d6113346.js b/assets/BuildingGroupSublayer-d6113346.js new file mode 100644 index 0000000..bb97a7b --- /dev/null +++ b/assets/BuildingGroupSublayer-d6113346.js @@ -0,0 +1 @@ +import{ai as i,aj as l,al as c,aF as p,b8 as b,d1 as g}from"./index-080e108a.js";import{n as h,C as f}from"./BuildingComponentSublayer-5d49e5f9.js";var u;const y={type:p,readOnly:!0,json:{origins:{service:{read:{source:"sublayers",reader:d}}},read:!1}};function d(e,n,a){if(e&&Array.isArray(e))return new p(e.map(s=>{const o=m(s);if(o){const t=new o;return t.read(s,a),t}return a&&a.messages&&s&&a.messages.push(new b("building-scene-layer:unsupported-sublayer-type","Building scene sublayer of type '"+(s.type||"unknown")+"' are not supported",{definition:s,context:a})),null}))}let r=u=class extends h{constructor(e){super(e),this.type="building-group",this.listMode="show",this.sublayers=null}loadAll(){return g(this,e=>u.forEachSublayer(this.sublayers,n=>{n.type!=="building-group"&&e(n)}))}};function m(e){return e.layerType==="group"?r:f}i([l({type:["hide","show","hide-children"],json:{write:!0}})],r.prototype,"listMode",void 0),i([l(y)],r.prototype,"sublayers",void 0),r=u=i([c("esri.layers.buildingSublayers.BuildingGroupSublayer")],r),function(e){function n(a,s){a.forEach(o=>{s(o),o.type==="building-group"&&n(o.sublayers,s)})}e.sublayersProperty=y,e.readSublayers=d,e.forEachSublayer=n}(r||(r={}));const v=r;export{v as d}; diff --git a/assets/BuildingSceneLayer-f39f2837.js b/assets/BuildingSceneLayer-f39f2837.js new file mode 100644 index 0000000..2fac22a --- /dev/null +++ b/assets/BuildingSceneLayer-f39f2837.js @@ -0,0 +1 @@ +import{ai as t,aj as s,al as n,ck as d,cl as y,aF as j,d2 as D,pi as G,df as Q,gC as Z,cY as ee,bz as b,at as te,eS as re,dU as se,ar as P,c5 as ie,as as oe,eX as le,ay as V,bc as ne,aA as ae}from"./index-080e108a.js";import{O as pe}from"./MultiOriginJSONSupport-e4912ffd.js";import{C as q}from"./BuildingComponentSublayer-5d49e5f9.js";import{d as c}from"./BuildingGroupSublayer-d6113346.js";import{i as ye}from"./APIKeyMixin-878a7aa7.js";import{l as ue}from"./ArcGISService-83287338.js";import{c as de}from"./OperationalLayer-0e8f8b28.js";import{j as ce}from"./PortalLayer-310c2800.js";import{N as me,K}from"./SceneService-6fea113d.js";import{j as he,c as fe,y as ge,d as ve}from"./commonProperties-30089b06.js";import{i as be}from"./FetchAssociatedFeatureLayer-15c90b75.js";import"./UniqueValueRenderer-fef4204d.js";import"./diffUtils-590c9088.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./FeatureLayer-5c6d2c3b.js";import"./sql-734ecbc5.js";import"./FeatureLayerBase-7c7dfccb.js";import"./featureLayerUtils-6cf06f83.js";import"./AttachmentQuery-972bbd60.js";import"./Query-1c961d4c.js";import"./RelationshipQuery-39c07195.js";import"./serviceCapabilitiesUtils-959e798a.js";import"./editsZScale-1b5a53a6.js";import"./queryZScale-8f9616ff.js";import"./FeatureSet-111cb247.js";import"./CustomParametersMixin-231c4be8.js";import"./EditBusLayer-d71787e9.js";import"./FeatureEffectLayer-4160946c.js";import"./FeatureEffect-86735d98.js";import"./FeatureFilter-00f4be05.js";import"./FeatureReductionLayer-4262cf54.js";import"./LabelClass-2d53c485.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./OrderedLayer-68067459.js";import"./TemporalLayer-f17c9161.js";import"./FeatureTemplate-2a7e96c1.js";import"./FeatureType-db96032c.js";import"./fieldProperties-62c55499.js";import"./labelingInfo-144f3d9f.js";import"./versionUtils-f17daa93.js";import"./styleUtils-25825fd6.js";import"./TopFeaturesQuery-e44d05be.js";import"./popupUtils-82ea8abb.js";import"./portalItemUtils-792a27e1.js";import"./capabilities-5d185925.js";import"./I3SIndexInfo-445e6968.js";import"./I3SLayerDefinitions-ffdb3821.js";import"./I3SUtil-2c288808.js";import"./I3SBinaryReader-2b8e30f7.js";import"./popupUtils-f04ec9a9.js";import"./originUtils-1469eeaf.js";import"./multiOriginJSONSupportUtils-c978f4c3.js";import"./resourceUtils-b667b05b.js";let S=class extends d{constructor(){super(...arguments),this.type=null}};t([s({type:String,readOnly:!0,json:{write:!0}})],S.prototype,"type",void 0),S=t([n("esri.layers.support.BuildingFilterAuthoringInfo")],S);const z=S;var F;let h=F=class extends d{constructor(){super(...arguments),this.filterType=null,this.filterValues=null}clone(){return new F({filterType:this.filterType,filterValues:y(this.filterValues)})}};t([s({type:String,json:{write:!0}})],h.prototype,"filterType",void 0),t([s({type:[String],json:{write:!0}})],h.prototype,"filterValues",void 0),h=F=t([n("esri.layers.support.BuildingFilterAuthoringInfoType")],h);const Se=h;var T;const we=j.ofType(Se);let w=T=class extends d{clone(){return new T({filterTypes:y(this.filterTypes)})}};t([s({type:we,json:{write:!0}})],w.prototype,"filterTypes",void 0),w=T=t([n("esri.layers.support.BuildingFilterAuthoringInfoBlock")],w);const $e=w;var _;const xe=j.ofType($e);let f=_=class extends z{constructor(){super(...arguments),this.type="checkbox"}clone(){return new _({filterBlocks:y(this.filterBlocks)})}};t([s({type:["checkbox"]})],f.prototype,"type",void 0),t([s({type:xe,json:{write:!0}})],f.prototype,"filterBlocks",void 0),f=_=t([n("esri.layers.support.BuildingFilterAuthoringInfoCheckbox")],f);const C=f;let $=class extends d{};t([s({readOnly:!0,json:{read:!1}})],$.prototype,"type",void 0),$=t([n("esri.layers.support.BuildingFilterMode")],$);const B=$;var A;let x=A=class extends B{constructor(){super(...arguments),this.type="solid"}clone(){return new A}};t([s({type:["solid"],readOnly:!0,json:{write:!0}})],x.prototype,"type",void 0),x=A=t([n("esri.layers.support.BuildingFilterModeSolid")],x);const E=x;var k;let g=k=class extends B{constructor(){super(...arguments),this.type="wire-frame",this.edges=null}clone(){return new k({edges:y(this.edges)})}};t([D({wireFrame:"wire-frame"})],g.prototype,"type",void 0),t([s(G)],g.prototype,"edges",void 0),g=k=t([n("esri.layers.support.BuildingFilterModeWireFrame")],g);const U=g;var L;let O=L=class extends B{constructor(){super(...arguments),this.type="x-ray"}clone(){return new L}};t([s({type:["x-ray"],readOnly:!0,json:{write:!0}})],O.prototype,"type",void 0),O=L=t([n("esri.layers.support.BuildingFilterModeXRay")],O);const J=O;var N;const Oe={nonNullable:!0,types:{key:"type",base:B,typeMap:{solid:E,"wire-frame":U,"x-ray":J}},json:{read:e=>{switch(e&&e.type){case"solid":return E.fromJSON(e);case"wireFrame":return U.fromJSON(e);case"x-ray":return J.fromJSON(e);default:return}},write:{enabled:!0,isRequired:!0}}};let m=N=class extends d{constructor(){super(...arguments),this.filterExpression=null,this.filterMode=new E,this.title=""}clone(){return new N({filterExpression:this.filterExpression,filterMode:y(this.filterMode),title:this.title})}};t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],m.prototype,"filterExpression",void 0),t([s(Oe)],m.prototype,"filterMode",void 0),t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],m.prototype,"title",void 0),m=N=t([n("esri.layers.support.BuildingFilterBlock")],m);const je=m;var R;const Be=j.ofType(je);let u=R=class extends d{constructor(){super(...arguments),this.description=null,this.filterBlocks=null,this.id=Q(),this.name=null}clone(){return new R({description:this.description,filterBlocks:y(this.filterBlocks),id:this.id,name:this.name,filterAuthoringInfo:y(this.filterAuthoringInfo)})}};t([s({type:String,json:{write:!0}})],u.prototype,"description",void 0),t([s({type:Be,json:{write:{enabled:!0,isRequired:!0}}})],u.prototype,"filterBlocks",void 0),t([s({types:{key:"type",base:z,typeMap:{checkbox:C}},json:{read:e=>(e&&e.type)==="checkbox"?C.fromJSON(e):null,write:!0}})],u.prototype,"filterAuthoringInfo",void 0),t([s({type:String,constructOnly:!0,json:{write:{enabled:!0,isRequired:!0}}})],u.prototype,"id",void 0),t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],u.prototype,"name",void 0),u=R=t([n("esri.layers.support.BuildingFilter")],u);const Ie=u;let p=class extends d{constructor(){super(...arguments),this.fieldName=null,this.modelName=null,this.label=null,this.min=null,this.max=null,this.mostFrequentValues=null,this.subLayerIds=null}};t([s({type:String})],p.prototype,"fieldName",void 0),t([s({type:String})],p.prototype,"modelName",void 0),t([s({type:String})],p.prototype,"label",void 0),t([s({type:Number})],p.prototype,"min",void 0),t([s({type:Number})],p.prototype,"max",void 0),t([s({json:{read:e=>Array.isArray(e)&&(e.every(r=>typeof r=="string")||e.every(r=>typeof r=="number"))?e.slice():null}})],p.prototype,"mostFrequentValues",void 0),t([s({type:[Number]})],p.prototype,"subLayerIds",void 0),p=t([n("esri.layers.support.BuildingFieldStatistics")],p);let v=class extends Z.LoadableMixin(ee(d)){constructor(){super(...arguments),this.url=null}get fields(){return this.loaded||this.loadStatus==="loading"?this._get("fields"):(b.getLogger(this).error("building summary statistics are not loaded"),null)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this._fetchService(r)),Promise.resolve(this)}async _fetchService(e){const r=(await te(this.url,{query:{f:"json"},responseType:"json",signal:e})).data;this.read(r,{origin:"service"})}};t([s({constructOnly:!0,type:String})],v.prototype,"url",void 0),t([s({readOnly:!0,type:[p],json:{read:{source:"summary"}}})],v.prototype,"fields",null),v=t([n("esri.layers.support.BuildingSummaryStatistics")],v);const X=v,W=j.ofType(Ie),Y=y(c.sublayersProperty);var H;const I=(H=Y.json)==null?void 0:H.origins;I&&(I["web-scene"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},I["portal-item"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}});let o=class extends me(ue(de(ce(re(pe(ye(ae))))))){constructor(e){super(e),this.operationalLayerType="BuildingSceneLayer",this.allSublayers=new se({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.type==="building-group"?r.sublayers:null}),this.sublayers=null,this._sublayerOverrides=null,this.filters=new W,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.legendEnabled=!0,this.type="building-scene"}normalizeCtorArgs(e){return typeof e=="string"?{url:e}:e??{}}destroy(){this.allSublayers.destroy()}readSublayers(e,r,i){const l=c.readSublayers(e,r,i);return c.forEachSublayer(l,a=>a.layer=this),this._sublayerOverrides&&(this.applySublayerOverrides(l,this._sublayerOverrides),this._sublayerOverrides=null),l}applySublayerOverrides(e,{overrides:r,context:i}){c.forEachSublayer(e,l=>l.read(r.get(l.id),i))}readSublayerOverrides(e,r){var l;const i=new Map;for(const a of e)a!=null&&typeof a=="object"&&typeof a.id=="number"?i.set(a.id,a):(l=r.messages)==null||l.push(new P("building-scene-layer:invalid-sublayer-override","Invalid value for sublayer override. Not an object or no id specified.",{value:a}));return{overrides:i,context:r}}writeSublayerOverrides(e,r,i){const l=[];c.forEachSublayer(this.sublayers,a=>{const M=a.write({},i);Object.keys(M).length>1&&l.push(M)}),l.length>0&&(r.sublayers=l)}writeUnappliedOverrides(e,r){r.sublayers=[],e.overrides.forEach(i=>{r.sublayers.push(y(i))})}write(e,r){return e=super.write(e,r),!r||r.origin!=="web-scene"&&r.origin!=="portal-item"||(this.sublayers?this.writeSublayerOverrides(this.sublayers,e,r):this._sublayerOverrides&&this.writeUnappliedOverrides(this._sublayerOverrides,e)),e}read(e,r){if(super.read(e,r),r&&(r.origin==="web-scene"||r.origin==="portal-item")&&e!=null&&Array.isArray(e.sublayers)){const i=this.readSublayerOverrides(e.sublayers,r);this.sublayers?this.applySublayerOverrides(this.sublayers,i):this._sublayerOverrides=i}}readSummaryStatistics(e,r){var i;if(typeof r.statisticsHRef=="string"){const l=ie((i=this.parsedUrl)==null?void 0:i.path,r.statisticsHRef);return new X({url:l})}return null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}load(e){const r=e!=null?e.signal:null,i=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(oe).then(()=>this._fetchService(r)).then(()=>this._fetchAssociatedFeatureService(r));return this.addResolvingPromise(i),Promise.resolve(this)}loadAll(){return le(this,e=>{c.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}),this.summaryStatistics&&e(this.summaryStatistics)})}async saveAs(e,r){return this._debouncedSaveOperations(K.SAVE_AS,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"};return this._debouncedSaveOperations(K.SAVE,e)}validateLayer(e){if(!e.layerType||e.layerType!=="Building")throw new P("buildingscenelayer:layer-type-not-supported","BuildingSceneLayer does not support this layer type",{layerType:e.layerType})}_getTypeKeywords(){return["Building"]}_validateElevationInfo(){const e=this.elevationInfo;e&&(e.mode!=="absolute-height"&&b.getLogger(this).warn(".elevationInfo=","Building scene layers only support absolute-height elevation mode"),e.featureExpressionInfo&&e.featureExpressionInfo.expression!=="0"&&b.getLogger(this).warn(".elevationInfo=","Building scene layers do not support featureExpressionInfo"))}async _fetchAssociatedFeatureService(e){const r=new be(this.parsedUrl,this.portalItem,this.apiKey,e);try{this.associatedFeatureServiceItem=await r.fetchPortalItem()}catch(i){b.getLogger(this).warn("Associated feature service item could not be loaded",i)}}};t([s({type:["BuildingSceneLayer"]})],o.prototype,"operationalLayerType",void 0),t([s({readOnly:!0})],o.prototype,"allSublayers",void 0),t([s(Y)],o.prototype,"sublayers",void 0),t([V("service","sublayers")],o.prototype,"readSublayers",null),t([s({type:W,nonNullable:!0,json:{write:!0}})],o.prototype,"filters",void 0),t([s({type:String,json:{write:!0}})],o.prototype,"activeFilterId",void 0),t([s({readOnly:!0,type:X})],o.prototype,"summaryStatistics",void 0),t([V("summaryStatistics",["statisticsHRef"])],o.prototype,"readSummaryStatistics",null),t([s({type:[String],json:{read:!1}})],o.prototype,"outFields",void 0),t([s(he)],o.prototype,"fullExtent",void 0),t([s(fe)],o.prototype,"legendEnabled",void 0),t([s({type:["show","hide","hide-children"]})],o.prototype,"listMode",void 0),t([s(ge(ne))],o.prototype,"spatialReference",void 0),t([s(ve)],o.prototype,"elevationInfo",null),t([s({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),t([s()],o.prototype,"associatedFeatureServiceItem",void 0),o=t([n("esri.layers.BuildingSceneLayer")],o);const Et=o;export{Et as default}; diff --git a/assets/BuildingSceneLayerView3D-15511316.js b/assets/BuildingSceneLayerView3D-15511316.js new file mode 100644 index 0000000..6fc9c0f --- /dev/null +++ b/assets/BuildingSceneLayerView3D-15511316.js @@ -0,0 +1,3 @@ +import{cY as O,cX as Q,am as A,cu as P,ai as n,aj as o,al as F,gy as G,gx as N,kO as B,ao as C,ag as _,bz as y,bw as f,dL as v,aK as b,dM as U,ar as E,dW as W,aF as x,aO as k,aG as V,aM as S,bn as j,kP as T,fw as z,cv as H,aW as D,aL as X}from"./index-080e108a.js";import"./BuildingGroupSublayer-d6113346.js";import{f as Y}from"./WhereClause-c86b9974.js";import"./BuildingComponentSublayer-5d49e5f9.js";import{d as K}from"./FeatureFilter-00f4be05.js";import{b as $}from"./Query-1c961d4c.js";import{x as J,c as Z,E as ee}from"./I3SMeshView3D-86f2c945.js";import{L as M,d as te,l as re,o as ie}from"./I3SQueryFeatureStore-0cfa6ebc.js";import{r as se,p as le,d as ne}from"./I3SUtil-2c288808.js";import{t as oe}from"./DefinitionExpressionSceneLayerView-66b62d34.js";import{t as ae,n as ue,p as I}from"./popupUtils-f04ec9a9.js";import{n as pe}from"./LayerView3D-ffd35809.js";import{d as de}from"./LayerView-448bc5ea.js";import"./executionError-c92d3b85.js";import"./UniqueValueRenderer-fef4204d.js";import"./diffUtils-590c9088.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./FeatureLayer-5c6d2c3b.js";import"./MultiOriginJSONSupport-e4912ffd.js";import"./sql-734ecbc5.js";import"./FeatureLayerBase-7c7dfccb.js";import"./commonProperties-30089b06.js";import"./featureLayerUtils-6cf06f83.js";import"./AttachmentQuery-972bbd60.js";import"./RelationshipQuery-39c07195.js";import"./serviceCapabilitiesUtils-959e798a.js";import"./editsZScale-1b5a53a6.js";import"./queryZScale-8f9616ff.js";import"./FeatureSet-111cb247.js";import"./APIKeyMixin-878a7aa7.js";import"./ArcGISService-83287338.js";import"./CustomParametersMixin-231c4be8.js";import"./EditBusLayer-d71787e9.js";import"./FeatureEffectLayer-4160946c.js";import"./FeatureEffect-86735d98.js";import"./FeatureReductionLayer-4262cf54.js";import"./LabelClass-2d53c485.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./OperationalLayer-0e8f8b28.js";import"./OrderedLayer-68067459.js";import"./PortalLayer-310c2800.js";import"./portalItemUtils-792a27e1.js";import"./TemporalLayer-f17c9161.js";import"./FeatureTemplate-2a7e96c1.js";import"./FeatureType-db96032c.js";import"./fieldProperties-62c55499.js";import"./labelingInfo-144f3d9f.js";import"./versionUtils-f17daa93.js";import"./styleUtils-25825fd6.js";import"./TopFeaturesQuery-e44d05be.js";import"./popupUtils-82ea8abb.js";import"./capabilities-5d185925.js";import"./I3SIndexInfo-445e6968.js";import"./I3SLayerDefinitions-ffdb3821.js";import"./I3SOverrides-96f73e2b.js";import"./I3SNode-2025159f.js";import"./I3SBinaryReader-2b8e30f7.js";import"./meshFeatureSet-8442b8e6.js";import"./FeatureLayerView3D-7e7e2653.js";import"./FeatureLayerViewBase3D-8474587e.js";import"./FeatureLikeLayerView3D-2e3185ce.js";import"./dehydratedFeatureComparison-a3375a3e.js";import"./queryForSymbologySnapping-0264f2b5.js";import"./elevationInfoUtils-4fd79d95.js";import"./hash-6f442295.js";import"./Graphics3DObjectStates-bb2a6162.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./floorFilterUtils-080a7cd2.js";import"./QueryEngine-19eda5ff.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./FeatureStore-f0e312fc.js";import"./BoundsStore-b6bd3c14.js";import"./projectExtentUtils-efa4cddd.js";import"./query-93c6e211.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./EventedSet-d13fada5.js";import"./RefreshableLayerView-915e7f53.js";import"./SceneModification-2715f58a.js";import"./persistable-ca976a2c.js";import"./multiOriginJSONSupportUtils-c978f4c3.js";import"./resourceExtension-91e7c3ce.js";import"./SceneLayerWorker-e92c2264.js";const R=(e,t)=>{let r=class extends O(Q(A(P.EventedMixin(e)))){constructor(i){super(i),this.sublayer=null,this.parent=null,this.view=null}initialize(){}get suspended(){return!this.canResume()}get updating(){return!this.suspended&&this.isUpdating()}get visible(){var i;return!!((i=this.sublayer)!=null&&i.visible)}set visible(i){this._overrideIfSome("visible",i)}get fullOpacity(){const i=s=>s??1;return i(this.get("sublayer.opacity"))*i(this.get("parent.fullOpacity"))}canResume(){var i,s;return!((i=this.parent)!=null&&i.suspended)&&((s=this.view)==null?void 0:s.ready)&&this.visible||!1}isUpdating(){return!1}};return n([o()],r.prototype,"sublayer",void 0),n([o()],r.prototype,"parent",void 0),n([o({readOnly:!0})],r.prototype,"suspended",null),n([o({type:Boolean,readOnly:!0})],r.prototype,"updating",null),n([o()],r.prototype,"view",void 0),n([o()],r.prototype,"visible",null),n([o()],r.prototype,"fullOpacity",null),r=n([F("esri.views.3d.layers.BuildingSublayerView3D")],r),r};var p;(function(e){e[e.Solid=0]="Solid",e[e.WireFrame=1]="WireFrame",e[e.XRay=2]="XRay"})(p||(p={}));const q=.15,he=.5*q;function ye(e){switch(e.filterMode.type){case"solid":return{mode:p.Solid};case"wire-frame":return{mode:p.WireFrame,edgeMaterial:G(e.filterMode.edges,{})};case"x-ray":return{mode:p.XRay}}}function L(e,t){if(t==null)return e.color[3]=0,e.edgeMaterial=null,void(e.pickable=!1);switch(t.mode){case p.Solid:return;case p.WireFrame:return e.color[3]=0,e.edgeMaterial=t.edgeMaterial,void(e.pickable=!1);case p.XRay:return e.color[0]=1,e.color[1]=1,e.color[2]=1,e.color[3]*=q,e.colorMixMode=N.Replace,e.castShadows=!1,e.pickable=!1,void(e.edgeMaterial=ce(e.edgeMaterial))}}function ce(e){return e==null?null:(m.lastMaterial!==e&&(m.cachedMaterial=me(e),m.lastMaterial=e),m.cachedMaterial)}function me(e){const t=B(e.color);return t[3]*=he,{...e,color:t}}const m={cachedMaterial:null,lastMaterial:null};class g extends C{constructor(){super(...arguments),this.sublayer=null}get updating(){return!1}get suspended(){return!1}get availableFields(){return[]}get filter(){return null}set filter(t){throw new Error("Not implemented")}queryFeatures(t,r){throw new Error("Not implemented")}queryObjectIds(t,r){throw new Error("Not implemented")}queryFeatureCount(t,r){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(t,r){throw new Error("Not implemented")}highlight(t){throw new Error("Not implemented")}}n([o()],g.prototype,"sublayer",void 0),n([o()],g.prototype,"availableFields",null),n([o()],g.prototype,"filter",null);let a=class extends oe(J(R(g))){constructor(){super(...arguments),this.type="building-component-sublayer-3d",this.layerView=null,this._elevationContext="scene",this._isIntegratedMesh=!1,this._supportsLabeling=!1,this.requiredFields=[],this.progressiveLoadFactor=1,this._queryEngine=null}get i3slayer(){return this.sublayer}get layerUid(){return this.sublayer.layer.uid}get sublayerUid(){return this.sublayer.uid}get layerId(){return this.sublayer.layer.id}get sublayerId(){return this.sublayer.id}get layerPopupEnabledAndHasTemplate(){var e,t;return this.sublayer.popupEnabled&&ae(this.sublayer,(t=(e=this.layerView)==null?void 0:e.view.popup)==null?void 0:t.defaultPopupTemplateEnabled)}initialize(){this.updatingHandles.add(()=>[this.sublayer.renderer,this.definitionExpressionFields,this.filterExpressionFields],()=>this._updateRequiredFields()),this.updatingHandles.add(()=>this.sublayer.renderer,t=>this._rendererChange(t),_);const e=()=>this._filterChange();this.updatingHandles.add(()=>this.parsedDefinitionExpression,e),this.updatingHandles.add(()=>this._filter!=null?this._filter.sortedObjectIds:null,e),this.updatingHandles.add(()=>this._filter!=null?this._filter.parsedWhereClause:null,e),this.updatingHandles.add(()=>[this._filter!=null?this._filter.parsedGeometry:null,this.filter!=null?this.filter.spatialRelationship:null],()=>this._geometryFilterChange()),this.updatingHandles.add(()=>this.parsedFilterExpressions,()=>this._updateSymbologyOverride(),_),this.addResolvingPromise(this._updateRequiredFields())}get lodFactor(){return this.view.qualitySettings.sceneService.object.lodFactor}get parsedFilterExpressions(){return this.sublayer.modelName!=="Overview"&&this.layerView?this.layerView.filterExpressions.map(([e,t])=>{let r;try{r=Y.create(e,this.sublayer.fieldsIndex)}catch(l){return y.getLogger(this).error("Failed to parse filterExpression: "+l),null}if(!r.isStandardized)return y.getLogger(this).error("filterExpression is using non standard function"),null;const i=[],s=r.fieldNames;return se(s,this.sublayer.fields,{missingFields:i}),i.length>0?(y.getLogger(this).error(`filterExpression references unknown fields: ${i.join(", ")}`),null):[r,t]}).filter(e=>e!=null):[]}get filter(){return this._filter!=null?this._filter.viewFilter:null}set filter(e){e!=null&&M.checkSupport(e)?this._filter!=null?this._filter.viewFilter=e:this._filter=new M({viewFilter:e,layerFieldsIndex:this.sublayer.fieldsIndex,loadAsyncModule:t=>this._loadAsyncModule(t),addSqlFilter:(t,r)=>this.addSqlFilter(t,r,this.logError)}):this._filter=null}isUpdating(){return super.isUpdating()||this._filter!=null&&this._filter.updating}_updateSymbologyOverride(){const e=this.parsedFilterExpressions;e.length>0?this._setSymbologyOverride((t,r)=>{for(const[i,s]of e)try{if(i.testFeature(t))return L(r,s)}catch(l){this.logError(l)}return L(r,null)},this.filterExpressionFields):this._setSymbologyOverride(null,null)}get filterExpressionFields(){return f(this.sublayer.fieldsIndex,this.parsedFilterExpressions.reduce((e,[t])=>e.concat(t.fieldNames),new Array))}get availableFields(){const e=this.sublayer,t=e.fieldsIndex;let r=this.requiredFields;if(e.outFields||e.layer.outFields){const i=[...e.outFields||[],...e.layer.outFields||[]];r=[...v(t,i),...r]}return f(t,r)}_createLayerGraphic(e){const t=new b(null,null,e);return t.layer=this.sublayer.layer,t.sourceLayer=this.sublayer,t}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}async fetchPopupFeatures(e,t){const r=this._validateFetchPopupFeatures(t);if(r)throw r;if(t==null||!t.clientGraphics||t.clientGraphics.length===0)return[];const i=[],s=[],l=this.sublayer.associatedLayer!=null?await this.sublayer.associatedLayer.load():this.sublayer,d=v(this.sublayer.fieldsIndex,await ue(l,I(this.sublayer,t))),c=new Set;for(const h of t.clientGraphics)U(d,h,c)?s.push(h):i.push(h);return s.length===0?i:(this.sublayer.associatedLayer!=null&&await this.sublayer.associatedLayer.load().catch(()=>y.getLogger(this).warn("Failed to load associated feature layer. Displaying popup attributes from cached attributes.")),this.whenGraphicAttributes(s,Array.from(c)).catch(()=>s).then(h=>i.concat(h)))}async _updateRequiredFields(){const e=f(this.sublayer.fieldsIndex,[...this.sublayer.renderer?await this.sublayer.renderer.getRequiredFields(this.sublayer.fieldsIndex):[],...this.definitionExpressionFields||[],...this.filterExpressionFields||[]]);this._set("requiredFields",e)}_validateFetchPopupFeatures(e){const{sublayer:t}=this,{popupEnabled:r}=t;return r?I(t,e)?void 0:new E("buildingscenelayerview3d:fetchPopupFeatures","Layer does not define a popup template",{sublayer:t}):new E("buildingscenelayerview3d:fetchPopupFeatures","Popups are disabled",{sublayer:t})}getFilters(){const e=super.getFilters();return this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),this._filter!=null&&this._filter.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}createQuery(){const e={outFields:["*"],returnGeometry:!1,outSpatialReference:this.view.spatialReference};return this.filter!=null?this.filter.createQuery(e):new $(e)}queryExtent(e,t){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),t==null?void 0:t.signal)}queryFeatureCount(e,t){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),t==null?void 0:t.signal)}queryFeatures(e,t){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),t==null?void 0:t.signal).then(r=>{if(!(r!=null&&r.features))return r;const i=this.sublayer,s=i.layer;for(const l of r.features)l.layer=s,l.sourceLayer=i;return r})}queryObjectIds(e,t){return this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),t==null?void 0:t.signal)}_ensureQueryEngine(){return this._queryEngine==null&&(this._queryEngine=this._createQueryEngine()),this._queryEngine}_createQueryEngine(){const e=Z(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new te({layerView:this,priority:W.FEATURE_QUERY_ENGINE,spatialIndex:new re({featureAdapter:new ie({objectIdField:this.sublayer.objectIdField,attributeStorageInfo:this.sublayer.attributeStorageInfo,getFeatureExtent:e}),forAllFeatures:(t,r)=>this._forAllFeatures((i,s,l)=>t({id:i,index:s,meta:l}),r,ee.QUERYABLE),getFeatureExtent:e,sourceSpatialReference:le(this.sublayer),viewSpatialReference:this.view.spatialReference})})}_ensureQuery(e){return this._addDefinitionExpressionToQuery(e==null?this.createQuery():$.from(e))}};n([o()],a.prototype,"i3slayer",null),n([o()],a.prototype,"layerView",void 0),n([o()],a.prototype,"lodFactor",null),n([o({readOnly:!0})],a.prototype,"parsedFilterExpressions",null),n([o({type:K})],a.prototype,"filter",null),n([o()],a.prototype,"_filter",void 0),n([o({type:[String],readOnly:!0})],a.prototype,"filterExpressionFields",null),n([o({type:[String],readOnly:!0})],a.prototype,"requiredFields",void 0),n([o({type:[String],readOnly:!0})],a.prototype,"availableFields",null),a=n([F("esri.views.3d.layers.BuildingComponentSublayerView3D")],a);const ge=a;class w extends de{constructor(t){super(t),this.layer=null,this.sublayerViews=null}highlight(t){throw new Error("Not implemented")}}n([o()],w.prototype,"layer",void 0),n([o()],w.prototype,"sublayerViews",void 0);const fe=R(C);let u=class extends pe(w){constructor(e){super(e),this.type="building-scene-3d",this.sublayerViews=new x,this._abortController=new AbortController,this._loadingComponents=0,this._pendingWhenSublayerViews=new Map,this.ignoresMemoryFactor=!1}get filterExpression(){var i;const e=this.layer.activeFilterId,t=e!=null?this.layer.filters.find(s=>s.id===e):null,r=t!=null?(i=t.filterBlocks)==null?void 0:i.find(s=>s.filterMode.type==="solid"):null;return r?r.filterExpression:null}get filterExpressions(){const e=this.layer.activeFilterId,t=e!=null?this.layer.filters.find(r=>r.id===e):null;return t&&t.filterBlocks?t.filterBlocks.toArray().map(r=>[r.filterExpression??"",ye(r)]):[]}get updatingProgressValue(){const e=this.sublayerViews,t=this._loadingComponents+(e?e.length:0);return e.reduce((r,i)=>r+i.updatingProgress,0)/t}isUpdating(){return this._loadingComponents>0||this.sublayerViews&&this.sublayerViews.some(e=>e.updating)}initialize(){ne(this.layer.spatialReference,this.view.spatialReference,this.view.viewingMode),this._initializeSubLayerViews(this.layer.sublayers,this)}destroy(){this.sublayerViews&&(this.sublayerViews.forEach(e=>e.destroy()),this.sublayerViews=null),this._abortController=k(this._abortController)}_initializeSubLayerViews(e,t){const r=this,i=this.view;e.forEach(s=>{if(!s.isEmpty)if(s.type==="building-group"){const l=new fe({sublayer:s,view:i,parent:t});this._initializeSubLayerViews(s.sublayers,l)}else s.geometryType==="mesh"&&(this._loadingComponents++,s.load({signal:this._abortController.signal}).then(()=>{const l=new ge({sublayer:s,layerView:r,view:i,parent:t});this.sublayerViews.push(l);const d=this._pendingWhenSublayerViews.get(s);if(d){for(const c of d)c.resolve(l);this._pendingWhenSublayerViews.delete(s)}this.handles.add([V(()=>l.updating,()=>this.notifyChange("updating"),S),V(()=>l.updatingProgress,()=>this.notifyChange("updatingProgressValue"),S)])}).catch(l=>{j(l)||y.getLogger(this).error(`Error while creating view for sublayer ${s.id} +Layer: ${this.layer.url} +`,l)}).then(()=>{this._loadingComponents--,this.notifyChange("updating"),this.notifyChange("updatingProgressValue")}))})}getGraphicFromIntersectorTarget(e){for(const t of this.sublayerViews.items)if(t.sublayer.uid===e.sublayerUid)return t.getGraphicFromIntersectorTarget(e);return null}async fetchPopupFeatures(e,t){if(t==null||!t.clientGraphics||t.clientGraphics.length===0)return[];const r=T(t.clientGraphics,s=>s.sourceLayer),i=[];for(const[s,l]of r){const d=this._findComponent(s);d!=null&&i.push(d.fetchPopupFeatures(e,{...t,clientGraphics:l}))}return z(i).then(s=>s.flat())}whenGraphicBounds(e){const t=this._findComponent(e.sourceLayer);return t==null?Promise.reject():t.whenGraphicBounds(e)}getAABBFromIntersectorTarget(e){for(const t of this.sublayerViews.items)if(t.sublayer.uid===e.sublayerUid)return t.getAABBFromIntersectorTarget(e);return null}async whenSublayerView(e){const t=this._findComponent(e);if(t!=null)return t;const r=this._pendingWhenSublayerViews.get(e),i=H();return r?r.push(i):this._pendingWhenSublayerViews.set(e,[i]),i.promise}_findComponent(e){return this.sublayerViews.find(t=>e===t.sublayer)}highlight(e){e instanceof b?e=[e]:e instanceof x&&(e=e.toArray());const t=[];if(Array.isArray(e)&&e.length>0&&e[0]instanceof b){const r=e,i=new Map;for(const s of r){let l=i.get(s.sourceLayer);l==null&&(l=[],i.set(s.sourceLayer,l)),l.push(s)}this.sublayerViews.forEach(s=>{const l=i.get(s.sublayer);l&&t.push(s.highlight(l))})}return D(t)}get usedMemory(){return this.sublayerViews.reduce((e,t)=>e+t.usedMemory,0)}get unloadedMemory(){return this.sublayerViews.reduce((e,t)=>e+t.unloadedMemory,0)}};n([o()],u.prototype,"sublayerViews",void 0),n([o({readOnly:!0})],u.prototype,"filterExpression",null),n([o({readOnly:!0})],u.prototype,"filterExpressions",null),n([o(X)],u.prototype,"updatingProgress",void 0),n([o({readOnly:!0,dependsOn:[]})],u.prototype,"updatingProgressValue",null),u=n([F("esri.views.3d.layers.BuildingSceneLayerView3D")],u);const lr=u;export{lr as default}; diff --git a/assets/Button-5999eab8.js b/assets/Button-5999eab8.js new file mode 100644 index 0000000..9811a8d --- /dev/null +++ b/assets/Button-5999eab8.js @@ -0,0 +1 @@ +import{F as f,J as R,l as _,m as u,K as T,n as g}from"./Popup-db207f4c.js";class p extends f{_beforeChanged(){super._beforeChanged(),(this.isDirty("cornerRadiusTL")||this.isDirty("cornerRadiusTR")||this.isDirty("cornerRadiusBR")||this.isDirty("cornerRadiusBL"))&&(this._clear=!0)}_draw(){let s=this.width(),e=this.height(),t=s,i=e,l=t/Math.abs(s),c=i/Math.abs(e);if(_(t)&&_(i)){let d=Math.min(t,i)/2,r=u(this.get("cornerRadiusTL",8),d),n=u(this.get("cornerRadiusTR",8),d),o=u(this.get("cornerRadiusBR",8),d),h=u(this.get("cornerRadiusBL",8),d),b=Math.min(Math.abs(t/2),Math.abs(i/2));r=g(r,0,b),n=g(n,0,b),o=g(o,0,b),h=g(h,0,b);const a=this._display;a.moveTo(r*l,0),a.lineTo(t-n*l,0),n>0&&a.arcTo(t,0,t,n*c,n),a.lineTo(t,i-o*c),o>0&&a.arcTo(t,i,t-o*l,i,o),a.lineTo(h*l,i),h>0&&a.arcTo(0,i,0,i-h*c,h),a.lineTo(0,r*c),r>0&&a.arcTo(0,0,r*l,0,r),a.closePath()}}}Object.defineProperty(p,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RoundedRectangle"}),Object.defineProperty(p,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:f.classNames.concat([p.className])});class m extends R{_afterNew(){this._settings.themeTags=T(this._settings.themeTags,["button"]),super._afterNew(),this._settings.background||this.set("background",p.new(this._root,{themeTags:T(this._settings.themeTags,["background"])}))}_prepareChildren(){if(super._prepareChildren(),this.isDirty("icon")){const s=this._prevSettings.icon,e=this.get("icon");e!==s&&(this._disposeProperty("icon"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.icon=e)}if(this.isDirty("label")){const s=this._prevSettings.label,e=this.get("label");e!==s&&(this._disposeProperty("label"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.label=e)}}}Object.defineProperty(m,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Button"}),Object.defineProperty(m,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:R.classNames.concat([m.className])});export{p as n,m as o}; diff --git a/assets/CIMSymbolRasterizer-1692cd3f.js b/assets/CIMSymbolRasterizer-1692cd3f.js new file mode 100644 index 0000000..f31c164 --- /dev/null +++ b/assets/CIMSymbolRasterizer-1692cd3f.js @@ -0,0 +1 @@ +import{bU as de,ax as ne,ld as ae,le as fe,lf as me,at as W,bn as ie,ar as se,e4 as pe,lg as ge,lh as ye,li as ve,lj as U,hr as j,bF as O,lk as we,bh as _e,ll as be,lm as X}from"./index-080e108a.js";import{M as xe,i as B,l as K,t as Z,a as Ce,r as ke,n as Me,e as Ie,G as ze,V as Pe,Q as Re}from"./cimAnalyzer-01879161.js";import{o as Ae}from"./imageutils-51a204ba.js";import{r as Fe,e as Ue}from"./rasterizingUtils-4df93c6e.js";import"./TileClipper-ae6eca9e.js";import"./definitions-0bc08d4c.js";import"./number-e491b09e.js";import"./BidiEngine-9a40f2f4.js";var ee,te,Y={exports:{}};Y.exports,ee=Y,Y.exports,te=function(){return function(u){var t={};function e(n){if(t[n])return t[n].exports;var i=t[n]={exports:{},id:n,loaded:!1};return u[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}return e.m=u,e.c=t,e.p="",e(0)}([function(u,t,e){Object.defineProperty(t,"__esModule",{value:!0}),t.isNotPNG=s,t.isNotAPNG=l,t.default=c;var n=o(e(1)),i=e(2);function o(m){return m&&m.__esModule?m:{default:m}}var h=new Error("Not a PNG"),a=new Error("Not an animated PNG");function s(m){return m===h}function l(m){return m===a}var r=new Uint8Array([137,80,78,71,13,10,26,10]);function c(m){var v=new Uint8Array(m);if(Array.prototype.some.call(r,function(I,M){return I!==v[M]}))return h;var _=!1;if(d(v,function(I){return!(_=I==="acTL")}),!_)return a;var b=[],x=[],C=null,w=null,z=0,P=new i.APNG;if(d(v,function(I,M,R,L){var D=new DataView(M.buffer);switch(I){case"IHDR":C=M.subarray(R+8,R+8+L),P.width=D.getUint32(R+8),P.height=D.getUint32(R+12);break;case"acTL":P.numPlays=D.getUint32(R+8+4);break;case"fcTL":w&&(P.frames.push(w),z++),(w=new i.Frame).width=D.getUint32(R+8+4),w.height=D.getUint32(R+8+8),w.left=D.getUint32(R+8+12),w.top=D.getUint32(R+8+16);var N=D.getUint16(R+8+20),T=D.getUint16(R+8+22);T===0&&(T=100),w.delay=1e3*N/T,w.delay<=10&&(w.delay=100),P.playTime+=w.delay,w.disposeOp=D.getUint8(R+8+24),w.blendOp=D.getUint8(R+8+25),w.dataParts=[],z===0&&w.disposeOp===2&&(w.disposeOp=1);break;case"fdAT":w&&w.dataParts.push(M.subarray(R+8+4,R+8+L));break;case"IDAT":w&&w.dataParts.push(M.subarray(R+8,R+8+L));break;case"IEND":x.push(g(M,R,12+L));break;default:b.push(g(M,R,12+L))}}),w&&P.frames.push(w),P.frames.length==0)return a;var S=new Blob(b),F=new Blob(x);return P.frames.forEach(function(I){var M=[];M.push(r),C.set(k(I.width),0),C.set(k(I.height),4),M.push(y("IHDR",C)),M.push(S),I.dataParts.forEach(function(R){return M.push(y("IDAT",R))}),M.push(F),I.imageData=new Blob(M,{type:"image/png"}),delete I.dataParts,M=null}),P}function d(m,v){var _=new DataView(m.buffer),b=8,x=void 0,C=void 0,w=void 0;do C=_.getUint32(b),w=v(x=f(m,b+4,4),m,b,C),b+=12+C;while(w!==!1&&x!="IEND"&&b>>24&255,m>>>16&255,m>>>8&255,255&m])}},function(u,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(h){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=-1,l=a,r=a+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:h.length-a);l>>8^e[255&(s^h[l])];return-1^s};for(var e=new Uint32Array(256),n=0;n<256;n++){for(var i=n,o=0;o<8;o++)i=1&i?3988292384^i>>>1:i>>>1;e[n]=i}},function(u,t,e){Object.defineProperty(t,"__esModule",{value:!0}),t.Frame=t.APNG=void 0;var n=function(){function a(s,l){for(var r=0;r1&&arguments[1]!==void 0&&arguments[1];return this.createImages().then(function(){return new i.default(l,s,r)})}}]),a}(),t.Frame=function(){function a(){h(this,a),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}return n(a,[{key:"createImage",value:function(){var s=this;return this.imageElement?Promise.resolve():new Promise(function(l,r){var c=URL.createObjectURL(s.imageData);s.imageElement=document.createElement("img"),s.imageElement.onload=function(){URL.revokeObjectURL(c),l()},s.imageElement.onerror=function(){URL.revokeObjectURL(c),s.imageElement=null,r(new Error("Image creation error"))},s.imageElement.src=c})}}]),a}()},function(u,t,e){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function l(r,c){for(var d=0;d=this._apng.numPlays&&(this._ended=!0,this._paused=!0)),this._prevFrame&&this._prevFrame.disposeOp==1?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&this._prevFrame.disposeOp==2&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var c=this.currentFrame;this._prevFrame=c,this._prevFrameData=null,c.disposeOp==2&&(this._prevFrameData=this.context.getImageData(c.left,c.top,c.width,c.height)),c.blendOp==0&&this.context.clearRect(c.left,c.top,c.width,c.height),this.context.drawImage(c.imageElement,c.left,c.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var c=this;this.emit("play"),this._ended&&this.stop(),this._paused=!1;var d=performance.now()+this.currentFrame.delay/this.playbackRate,f=function p(g){if(!c._ended&&!c._paused){if(g>=d){for(;g-d>=c._apng.playTime/c.playbackRate;)d+=c._apng.playTime/c.playbackRate,c._numPlays++;do c.renderNextFrame(),d+=c.currentFrame.delay/c.playbackRate;while(!c._ended&&g>d)}requestAnimationFrame(p)}};requestAnimationFrame(f)}},{key:"pause",value:function(){this._paused||(this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),r}(i(e(4)).default);t.default=s},function(u,t){function e(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(a){return typeof a=="function"}function i(a){return typeof a=="number"}function o(a){return typeof a=="object"&&a!==null}function h(a){return a===void 0}u.exports=e,e.EventEmitter=e,e.prototype._events=void 0,e.prototype._maxListeners=void 0,e.defaultMaxListeners=10,e.prototype.setMaxListeners=function(a){if(!i(a)||a<0||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},e.prototype.emit=function(a){var s,l,r,c,d,f;if(this._events||(this._events={}),a==="error"&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((s=arguments[1])instanceof Error)throw s;var p=new Error('Uncaught, unspecified "error" event. ('+s+")");throw p.context=s,p}if(h(l=this._events[a]))return!1;if(n(l))switch(arguments.length){case 1:l.call(this);break;case 2:l.call(this,arguments[1]);break;case 3:l.call(this,arguments[1],arguments[2]);break;default:c=Array.prototype.slice.call(arguments,1),l.apply(this,c)}else if(o(l))for(c=Array.prototype.slice.call(arguments,1),r=(f=l.slice()).length,d=0;d0&&this._events[a].length>l&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),typeof console.trace=="function"&&console.trace()),this},e.prototype.on=e.prototype.addListener,e.prototype.once=function(a,s){if(!n(s))throw TypeError("listener must be a function");var l=!1;function r(){this.removeListener(a,r),l||(l=!0,s.apply(this,arguments))}return r.listener=s,this.on(a,r),this},e.prototype.removeListener=function(a,s){var l,r,c,d;if(!n(s))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(c=(l=this._events[a]).length,r=-1,l===s||n(l.listener)&&l.listener===s)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,s);else if(o(l)){for(d=c;d-- >0;)if(l[d]===s||l[d].listener&&l[d].listener===s){r=d;break}if(r<0)return this;l.length===1?(l.length=0,delete this._events[a]):l.splice(r,1),this._events.removeListener&&this.emit("removeListener",a,s)}return this},e.prototype.removeAllListeners=function(a){var s,l;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[a]&&delete this._events[a],this;if(arguments.length===0){for(s in this._events)s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events={},this}if(n(l=this._events[a]))this.removeListener(a,l);else if(l)for(;l.length;)this.removeListener(a,l[l.length-1]);return delete this._events[a],this},e.prototype.listeners=function(a){return this._events&&this._events[a]?n(this._events[a])?[this._events[a]]:this._events[a].slice():[]},e.prototype.listenerCount=function(a){if(this._events){var s=this._events[a];if(n(s))return 1;if(s)return s.length}return 0},e.listenerCount=function(a,s){return a.listenerCount(s)}}])},ee.exports=te();const Se=de(Y.exports);async function De(u,t){const e=Se(u);if(e instanceof Error)throw e;await e.createImages(),ne(t);const{frames:n,width:i,height:o}=e,h=document.createElement("canvas");h.width=i,h.height=o;const a=h.getContext("2d",{willReadFrequently:!0}),s=[],l=[];for(const r of n){l.push(ae(r.delay||100));const c=r.imageElement;r.blendOp===0?a.globalCompositeOperation="copy":a.globalCompositeOperation="source-over";const d=r.disposeOp===2?a.getImageData(r.left,r.top,r.width,r.height):void 0;a.drawImage(c,r.left,r.top);const f=a.getImageData(0,0,i,o);s.push(f),r.disposeOp===0||(r.disposeOp===1?a.clearRect(r.left,r.top,r.width,r.height):r.disposeOp===2&&a.putImageData(d,r.left,r.top))}return{frameDurations:l,getFrame:r=>s[r],width:i,height:o}}const Oe=[137,80,78,71,13,10,26,10];function $e(u){const t=new Uint8Array(u);return!Oe.some((e,n)=>e!==t[n])}function Le(u){if(!$e(u))return!1;const t=new DataView(u),e=new Uint8Array(u);let n,i=8;do{const o=t.getUint32(i);if(n=String.fromCharCode.apply(String,Array.prototype.slice.call(e.subarray(i+4,i+8))),n==="acTL")return!0;i+=12+o}while(n!=="IEND"&&i2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n;if(Array.isArray(e))e.forEach(function(h){return u(t,h,n,i)});else if(typeof e=="function")e(t,n,i,u);else{var o=Object.keys(e)[0];Array.isArray(e[o])?(i[o]={},u(t,e[o],n,i[o])):i[o]=e[o](t,n,i,u)}return n};$.parse=Be;var Ee=function(u,t){return function(e,n,i,o){t(e,n,i)&&o(e,u,n,i)}};$.conditional=Ee;var Te=function(u,t){return function(e,n,i,o){for(var h=[],a=e.pos;t(e,n,i);){var s={};if(o(e,u,n,s),e.pos===a)break;a=e.pos,h.push(s)}return h}};$.loop=Te;var A={};Object.defineProperty(A,"__esModule",{value:!0}),A.readBits=A.readArray=A.readUnsigned=A.readString=A.peekBytes=A.readBytes=A.peekByte=A.readByte=A.buildStream=void 0;var Ne=function(u){return{data:u,pos:0}};A.buildStream=Ne;var ce=function(){return function(u){return u.data[u.pos++]}};A.readByte=ce;var je=function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(t){return t.data[t.pos+u]}};A.peekByte=je;var q=function(u){return function(t){return t.data.subarray(t.pos,t.pos+=u)}};A.readBytes=q;var Xe=function(u){return function(t){return t.data.subarray(t.pos,t.pos+u)}};A.peekBytes=Xe;var Ye=function(u){return function(t){return Array.from(q(u)(t)).map(function(e){return String.fromCharCode(e)}).join("")}};A.readString=Ye;var Ge=function(u){return function(t){var e=q(2)(t);return u?(e[1]<<8)+e[0]:(e[0]<<8)+e[1]}};A.readUnsigned=Ge;var He=function(u,t){return function(e,n,i){for(var o=typeof t=="function"?t(e,n,i):t,h=q(u),a=new Array(o),s=0;s=f){var y=f-r.pos;d.push((0,e.readBytes)(y)(r)),p+=y;break}d.push((0,e.readBytes)(g)(r)),p+=g}for(var k=new Uint8Array(p),m=0,v=0;v>=h,p-=h,r>n||r==a)break;if(r==i){o=(1<<(h=d+1))-1,n=i+2,l=_;continue}if(l==_){z[y++]=w[r],l=r,g=r;continue}for(s=r,r==n&&(z[y++]=g,r=l);r>i;)z[y++]=w[r],r=C[r];g=255&w[r],z[y++]=g,ns[r],width:i,height:o}}const ot=[71,73,70];function ct(u){const t=new Uint8Array(u);return!ot.some((e,n)=>e!==t[n])}function lt(u){if(!ct(u))return!1;const t=new DataView(u),e=t.getUint8(10);let n=13+(128&e?3*2**(1+(7&e)):0),i=0,o=!1;for(;!o;){switch(t.getUint8(n++)){case 33:if(!h())return!1;break;case 44:a();break;case 59:o=!0;break;default:return!1}if(i>1)return!0}function h(){switch(t.getUint8(n++)){case 249:s();break;case 1:l();break;case 254:r();break;case 255:c();break;default:return!1}return!0}function a(){i++,n+=8;const f=t.getUint8(n++);n+=128&f?3*2**(1+(7&f)):0,n++,d()}function s(){n++,n+=4,d()}function l(){i++,n++,n+=12,d()}function r(){d()}function c(){n++,n+=8,n+=3,d()}function d(){let f;for(;f=t.getUint8(n++);)n+=f}return!1}class ut{constructor(){this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null,this.geometryEnginePromise=null}destroy(){this._inFlightResourceMap.clear(),this._resourceMap.clear()}getResource(t){return this._resourceMap.get(t)??null}async fetchResource(t,e){const n=this._resourceMap.get(t);if(n)return{width:n.width,height:n.height};let i=this._inFlightResourceMap.get(t);return i?i.then(o=>({width:o.width,height:o.height})):(i=dt(t,e),this._inFlightResourceMap.set(t,i),i.then(o=>(this._inFlightResourceMap.delete(t),this._resourceMap.set(t,o),{width:o.width,height:o.height}),()=>({width:0,height:0})))}deleteResource(t){this._inFlightResourceMap.delete(t),this._resourceMap.delete(t)}loadFont(t){return fe(t)}}async function ht(u,t){const e=window.URL.createObjectURL(u);try{const{data:n}=await W(e,{...t,responseType:"image"});return n}catch(n){throw ie(n)?n:new se("mapview-invalid-resource",`Could not fetch requested resource at ${e}`)}finally{window.URL.revokeObjectURL(e)}}async function dt(u,t){const{arrayBuffer:e,mediaType:n}=await ft(u,t),i=n==="image/png";return n==="image/gif"&<(e)?st(e):i&&Le(e)?De(e,t):ht(new Blob([e],{type:n}),t)}async function ft(u,t){let e;const n=";base64,";if(u.includes(n)){const i=u.indexOf(n),o=u.indexOf(n)+n.length,h=u.substring(o);e={arrayBuffer:me(h),mediaType:u.substring(0,i).replace("data:","")}}else try{const i=await W(u,{responseType:"array-buffer",...t});e={arrayBuffer:i.data,mediaType:i.getHeader("Content-Type")}}catch(i){if(!ie(i))throw new se("mapview-invalid-resource",`Could not fetch requested resource at ${u}`)}return e}const mt=512;class pt{constructor(t){this._resourceManager=t,this._rasterizationCanvas=null}dispose(){this._rasterizationCanvas=null}rasterizeJSONResource(t,e,n){if(this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas")),t.type==="simple-fill"||t.type==="esriSFS"){const[f,p,g]=Fe(this._rasterizationCanvas,t.style,e);return{size:[p,g],image:new Uint32Array(f.buffer),sdf:!1,simplePattern:!0,anchorX:0,anchorY:0,rasterizationScale:pe(Math.ceil(e))}}if(t.type==="simple-line"||t.type==="esriSLS"||t.type==="line"&&t.dashTemplate){let f,p;if(t.type==="simple-line"||t.type==="esriSLS")switch(f=xe(t.style,t.cap),t.cap){case"butt":p="Butt";break;case"square":p="Square";break;default:p="Round"}else f=t.dashTemplate,p=t.cim.capStyle;const[g,y,k]=Ue(f,p);return{size:[y,k],image:new Uint32Array(g.buffer),sdf:!0,simplePattern:!0,anchorX:0,anchorY:0}}let i,o=null,h=null,a=1;if(t.type==="simple-marker"||t.type==="esriSMS"||t.type==="line-marker"?(i=B.fromSimpleMarker(t),h=K(i)):t.cim&&t.cim.type==="CIMHatchFill"?(i=B.fromCIMHatchFill(t.cim,e),o=new Z(i.frame.xmin,-i.frame.ymax,i.frame.xmax-i.frame.xmin,i.frame.ymax-i.frame.ymin),a=e):t.cim.markerPlacement&&t.cim.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"?(i=B.fromCIMInsidePolygon(t.cim),o=new Z(i.frame.xmin,-i.frame.ymax,i.frame.xmax-i.frame.xmin,i.frame.ymax-i.frame.ymin)):(i=t.cim,t.avoidSDFRasterization||(h=K(i))),h&&!n){const[f,p,g]=Ce(h);return f?{size:[p,g],image:new Uint32Array(f.buffer),sdf:!0,simplePattern:!0,anchorX:0,anchorY:0,rasterizationScale:a}:null}const[s,l,r,c,d]=B.rasterize(this._rasterizationCanvas,i,o,this._resourceManager,!n);return s?{size:[l,r],image:new Uint32Array(s.buffer),sdf:!1,simplePattern:!1,anchorX:c,anchorY:d}:null}rasterizeImageResource(t,e,n,i){this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas")),this._rasterizationCanvas.width=t,this._rasterizationCanvas.height=e;const o=this._rasterizationCanvas.getContext("2d");n instanceof ImageData?o.putImageData(n,0,0):(n.setAttribute("width",`${t}px`),n.setAttribute("height",`${e}px`),o.drawImage(n,0,0,t,e));const h=o.getImageData(0,0,t,e),a=new Uint8Array(h.data);if(i){for(const f of i)if(f&&f.oldColor&&f.oldColor.length===4&&f.newColor&&f.newColor.length===4){const[p,g,y,k]=f.oldColor,[m,v,_,b]=f.newColor;if(p===m&&g===v&&y===_&&k===b)continue;for(let x=0;x=d||c>=d){const f=r/c;f>1?(r=d,c=Math.round(d/f)):(c=d,r=Math.round(d*f)),l=new Uint8Array(4*r*c);const p=new Uint8ClampedArray(l.buffer);ge(a,t,e,p,r,c,!1)}return{size:[r,c],image:new Uint32Array(l.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}}var re;(function(u){u.Legend="legend",u.Preview="preview"})(re||(re={}));const V=u=>u&&u.scaleFactor?u.scaleFactor:1,gt=96/72;class zt{constructor(t,e){this._spatialReference=t,this._avoidSDF=e,this._resourceCache=new Map,this._imageDataCanvas=null,this._pictureMarkerCache=new Map,this._textRasterizer=new ke,this._cimResourceManager=new ut,this._rasterizer=new pt(this._cimResourceManager)}get resourceManager(){return this._cimResourceManager}async rasterizeCIMSymbolAsync(t,e,n,i,o,h,a,s){if(!t)return null;const{data:l}=t;if(!l||l.type!=="CIMSymbolReference"||!l.symbol)return null;const{symbol:r}=l;h||(h=ye(r));const c=await Me.resolveSymbolOverrides(l,e,this._spatialReference,o,h,a,s);this._imageDataCanvas||(this._imageDataCanvas=document.createElement("canvas"));const d=this._imageDataCanvas,f=this._cimResourceManager,p=[];B.fetchResources(c,f,p),B.fetchFonts(c,f,p),p.length>0&&await Promise.all(p);const{width:g,height:y}=n,k=yt(h,g,y,i),m=B.getEnvelope(c,k,f);if(!m)return null;const v=(window.devicePixelRatio||1)*gt;let _=1,b=0,x=0;switch(r.type){case"CIMPointSymbol":case"CIMTextSymbol":{let P=1;m.width>g&&(P=g/m.width);let S=1;m.height>y&&(S=y/m.height),i==="preview"&&(m.widthy&&(P=y/m.height),_=P,x=m.y+m.height/2;const S=m.x*_+g/2,F=(m.x+m.width)*_+g/2;if(S<0){const{paths:I}=k;I[0][0][0]-=S}if(F>g){const{paths:I}=k;I[0][2][0]-=F-g}}break;case"CIMPolygonSymbol":{b=m.x+m.width/2,x=m.y+m.height/2;const P=m.x*_+g/2,S=(m.x+m.width)*_+g/2,F=m.y*_+y/2,I=(m.y+m.height)*_+y/2,{rings:M}=k;P<0&&(M[0][0][0]-=P,M[0][3][0]-=P,M[0][4][0]-=P),F<0&&(M[0][0][1]+=F,M[0][1][1]+=F,M[0][4][1]+=F),S>g&&(M[0][1][0]-=S-g,M[0][2][0]-=S-g),I>y&&(M[0][2][1]+=I-y,M[0][3][1]+=I-y)}}d.width=g*v,d.height=y*v;const C=1;d.width+=2*C,d.height+=2*C;const w=d.getContext("2d"),z=Re.createIdentity();return z.translate(-b,-x),z.scale(_*v,-_*v),z.translate(g*v/2+C,y*v/2+C),w.clearRect(0,0,d.width,d.height),new Ie(w,f,z,!0).drawSymbol(c,k),w.getImageData(0,0,d.width,d.height)}async analyzeCIMSymbol3D(t,e,n,i,o){const h=[],a=e?{geometryType:i,spatialReference:this._spatialReference,fields:e}:null,s=[];B.fetchFonts(t.data.symbol,this._cimResourceManager,s),await Promise.all(s);const l=new ze(this._cimResourceManager,a);let r;await l.analyzeSymbolReference(t.data,this._avoidSDF,h),ne(o);for(const c of h)c.cim.type!=="CIMPictureMarker"&&c.cim.type!=="CIMPictureFill"&&c.cim.type!=="CIMPictureStroke"||(r||(r=[]),r.push(this._fetchPictureMarkerResource(c,o))),n&&c.type==="text"&&typeof c.text=="string"&&c.text.includes("[")&&(c.text=ve(n,c.text,c.cim.textCase));return r&&await Promise.all(r),h}rasterizeCIMSymbol3D(t,e,n,i,o,h){const a=[];for(const s of t){i&&typeof i.scaleFactor=="function"&&(i.scaleFactor=i.scaleFactor(e,o,h));const l=this._getRasterizedResource(s,e,n,i,o,h);if(!l)continue;let r=0,c=l.anchorX||0,d=l.anchorY||0,f=!1,p=0,g=0;if(n==="esriGeometryPoint"){const y=V(i);if(p=U(s.offsetX,e,o,h)*y||0,g=U(s.offsetY,e,o,h)*y||0,s.type==="marker")r=U(s.rotation,e,o,h)||0,f=s.rotateClockwise??!1;else if(s.type==="text"){if(r=U(s.angle,e,o,h)||0,s.horizontalAlignment!==void 0)switch(s.horizontalAlignment){case"left":c=-.5;break;case"right":c=.5;break;default:c=0}if(s.verticalAlignment!==void 0)switch(s.verticalAlignment){case"top":d=.5;break;case"bottom":d=-.5;break;case"baseline":d=-.25;break;default:d=0}}}l!=null&&a.push({angle:r,rotateClockWise:f,anchorX:c,anchorY:d,offsetX:p,offsetY:g,rasterizedResource:l})}return this.getSymbolImage(a)}getSymbolImage(t){const e=document.createElement("canvas"),n=j(e.getContext("2d"));let i=0,o=0,h=0,a=0;const s=[];for(let d=0;dh?w:h,a=z>a?z:a;const P=n.createImageData(p.size[0],p.size[1]);P.data.set(new Uint8ClampedArray(p.image.buffer));const S={offsetX:y,offsetY:k,rotateClockwise:_,angle:b,rasterizedImage:P,anchorX:m,anchorY:v};s.push(S)}e.width=h-i,e.height=a-o;const l=-i,r=a;for(let d=0;d1?O(e):O(e)/o:i.width,a=e?o>1?O(e)*o:O(e):i.height;return{image:this._imageTo32Array(i,h,a,n),width:h,height:a}}}function yt(u,t,e,n){const o=-t/2+1,h=t/2-1,a=e/2-1,s=-e/2+1;switch(u){case"esriGeometryPoint":return{x:0,y:0};case"esriGeometryPolyline":return{paths:[[[o,0],[0,0],[h,0]]]};default:return n==="legend"?{rings:[[[o,a],[h,0],[h,s],[o,s],[o,a]]]}:{rings:[[[o,a],[h,a],[h,s],[o,s],[o,a]]]}}}function vt(u,t,e,n){let i,o;return typeof u.materialHash=="function"?(i=(0,u.materialHash)(t,e,n),o=Pe(u.cim,u.materialOverrides)):(i=u.materialHash,o=u.cim),{analyzedCIM:o,hash:i}}export{zt as CIMSymbolRasterizer,re as GeometryStyle}; diff --git a/assets/CSVLayer-5ae17e31.js b/assets/CSVLayer-5ae17e31.js new file mode 100644 index 0000000..a3e24eb --- /dev/null +++ b/assets/CSVLayer-5ae17e31.js @@ -0,0 +1 @@ +import{ai as i,aj as r,al as h,gC as v,aR as w,ca as S,fD as O,cn as F,ay as b,d7 as I,fQ as q,bc as N,as as _,bf as C,ar as y}from"./index-080e108a.js";import J from"./FeatureLayer-5c6d2c3b.js";import{d as j}from"./FeatureSet-111cb247.js";import{c as P}from"./clientSideDefaults-ab04bd90.js";import{b as l}from"./Query-1c961d4c.js";import"./UniqueValueRenderer-fef4204d.js";import"./diffUtils-590c9088.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./MultiOriginJSONSupport-e4912ffd.js";import"./sql-734ecbc5.js";import"./FeatureLayerBase-7c7dfccb.js";import"./commonProperties-30089b06.js";import"./featureLayerUtils-6cf06f83.js";import"./AttachmentQuery-972bbd60.js";import"./RelationshipQuery-39c07195.js";import"./serviceCapabilitiesUtils-959e798a.js";import"./editsZScale-1b5a53a6.js";import"./queryZScale-8f9616ff.js";import"./APIKeyMixin-878a7aa7.js";import"./ArcGISService-83287338.js";import"./CustomParametersMixin-231c4be8.js";import"./EditBusLayer-d71787e9.js";import"./FeatureEffectLayer-4160946c.js";import"./FeatureEffect-86735d98.js";import"./FeatureFilter-00f4be05.js";import"./FeatureReductionLayer-4262cf54.js";import"./LabelClass-2d53c485.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./OperationalLayer-0e8f8b28.js";import"./OrderedLayer-68067459.js";import"./PortalLayer-310c2800.js";import"./portalItemUtils-792a27e1.js";import"./TemporalLayer-f17c9161.js";import"./FeatureTemplate-2a7e96c1.js";import"./FeatureType-db96032c.js";import"./fieldProperties-62c55499.js";import"./labelingInfo-144f3d9f.js";import"./versionUtils-f17daa93.js";import"./styleUtils-25825fd6.js";import"./TopFeaturesQuery-e44d05be.js";import"./popupUtils-82ea8abb.js";import"./QueryEngineCapabilities-42e44ded.js";let n=class extends v{constructor(e){super(e),this.type="csv",this.refresh=w(async t=>{await this.load();const{extent:s,timeExtent:a}=await this._connection.invoke("refresh",t);return s&&(this.sourceJSON.extent=s),a&&(this.sourceJSON.timeInfo.timeExtent=[a.start,a.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);const s=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return j.fromJSON(s)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._connection.invoke("queryFeatures",e?e.toJSON():null,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t)}async queryObjectIds(e,t={}){return await this.load(t),this._connection.invoke("queryObjectIds",e?e.toJSON():null,t)}async queryExtent(e,t={}){await this.load(t);const s=await this._connection.invoke("queryExtent",e?e.toJSON():null,t);return{count:s.count,extent:S.fromJSON(s.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke("querySnapping",e,t)}async _startWorker(e){this._connection=await O("CSVSourceWorker",{strategy:F("feature-layers-workers")?"dedicated":"local",signal:e});const{url:t,delimiter:s,fields:a,latitudeField:m,longitudeField:f,spatialReference:u,timeInfo:d}=this.loadOptions,c=await this._connection.invoke("load",{url:t,customParameters:this.customParameters,parsingOptions:{delimiter:s,fields:a==null?void 0:a.map(g=>g.toJSON()),latitudeField:m,longitudeField:f,spatialReference:u==null?void 0:u.toJSON(),timeInfo:d==null?void 0:d.toJSON()}},{signal:e});this.locationInfo=c.locationInfo,this.sourceJSON=c.layerDefinition,this.delimiter=c.delimiter}};i([r()],n.prototype,"type",void 0),i([r()],n.prototype,"loadOptions",void 0),i([r()],n.prototype,"customParameters",void 0),i([r()],n.prototype,"locationInfo",void 0),i([r()],n.prototype,"sourceJSON",void 0),i([r()],n.prototype,"delimiter",void 0),n=i([h("esri.layers.graphics.sources.CSVSource")],n);function p(e,t){throw new y(t,`CSVLayer (title: ${e.title}, id: ${e.id}) cannot be saved to a portal item`)}let o=class extends J{constructor(...e){super(...e),this.geometryType="point",this.capabilities=P(!1,!1),this.delimiter=null,this.editingEnabled=!1,this.fields=null,this.latitudeField=null,this.locationType="coordinates",this.longitudeField=null,this.operationalLayerType="CSV",this.outFields=["*"],this.path=null,this.spatialReference=N.WGS84,this.source=null,this.type="csv"}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null,s=this.loadFromPortal({supportedTypes:["CSV"],supportsData:!1},e).catch(_).then(async()=>this.initLayerProperties(await this.createGraphicsSource(t)));return this.addResolvingPromise(s),Promise.resolve(this)}get isTable(){return this.loaded&&this.geometryType==null}readWebMapLabelsVisible(e,t){return t.showLabels!=null?t.showLabels:!!(t.layerDefinition&&t.layerDefinition.drawingInfo&&t.layerDefinition.drawingInfo.labelingInfo)}set url(e){if(!e)return void this._set("url",e);const t=C(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async createGraphicsSource(e){const t=new n({loadOptions:{delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField??void 0,longitudeField:this.longitudeField??void 0,spatialReference:this.spatialReference??void 0,timeInfo:this.timeInfo??void 0,url:this.url},customParameters:this.customParameters??void 0});return this._set("source",t),await t.load({signal:e}),this.read({locationInfo:t.locationInfo,columnDelimiter:t.delimiter},{origin:"service",url:this.parsedUrl}),t}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(l.from(e)||this.createQuery())).then(s=>{if(s!=null&&s.features)for(const a of s.features)a.layer=a.sourceLayer=this;return s})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(l.from(e)||this.createQuery()))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(l.from(e)||this.createQuery()))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(l.from(e)||this.createQuery()))}read(e,t){super.read(e,t),t&&t.origin==="service"&&this.revert(["latitudeField","longitudeField"],"service")}write(e,t){return super.write(e,{...t,writeLayerSchema:!0})}clone(){throw new y("csv-layer:clone",`CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`)}async save(e){return p(this,"csv-layer:save")}async saveAs(e,t){return p(this,"csv-layer:save-as")}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return t!=null&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}_verifyFields(){}_verifySource(){}_hasMemorySource(){return!1}};i([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",void 0),i([r({type:[","," ",";","|"," "],json:{read:{source:"columnDelimiter"},write:{target:"columnDelimiter",ignoreOrigin:!0}}})],o.prototype,"delimiter",void 0),i([r({readOnly:!0,type:Boolean,json:{origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"editingEnabled",void 0),i([r({json:{read:{source:"layerDefinition.fields"},write:{target:"layerDefinition.fields"}}})],o.prototype,"fields",void 0),i([r({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),i([b("web-map","labelsVisible",["layerDefinition.drawingInfo.labelingInfo","showLabels"])],o.prototype,"readWebMapLabelsVisible",null),i([r({type:String,json:{read:{source:"locationInfo.latitudeFieldName"},write:{target:"locationInfo.latitudeFieldName",ignoreOrigin:!0}}})],o.prototype,"latitudeField",void 0),i([r({type:["show","hide"]})],o.prototype,"listMode",void 0),i([r({type:["coordinates"],json:{read:{source:"locationInfo.locationType"},write:{target:"locationInfo.locationType",ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"locationType",void 0),i([r({type:String,json:{read:{source:"locationInfo.longitudeFieldName"},write:{target:"locationInfo.longitudeFieldName",ignoreOrigin:!0}}})],o.prototype,"longitudeField",void 0),i([r({type:["CSV"]})],o.prototype,"operationalLayerType",void 0),i([r()],o.prototype,"outFields",void 0),i([r({type:String,json:{origins:{"web-scene":{read:!1,write:!1}},read:!1,write:!1}})],o.prototype,"path",void 0),i([r({json:{read:!1},cast:null,type:n,readOnly:!0})],o.prototype,"source",void 0),i([r({json:{read:!1},value:"csv",readOnly:!0})],o.prototype,"type",void 0),i([r({json:{read:I,write:{isRequired:!0,ignoreOrigin:!0,writer:q}}})],o.prototype,"url",null),o=i([h("esri.layers.CSVLayer")],o);const Ie=o;export{Ie as default}; diff --git a/assets/CSVLayerView3D-f68a6513.js b/assets/CSVLayerView3D-f68a6513.js new file mode 100644 index 0000000..3cda7bc --- /dev/null +++ b/assets/CSVLayerView3D-f68a6513.js @@ -0,0 +1 @@ +import{ai as r,aj as o,al as i}from"./index-080e108a.js";import{_ as p}from"./FeatureLayerViewBase3D-8474587e.js";import"./FeatureLikeLayerView3D-2e3185ce.js";import"./Query-1c961d4c.js";import"./dehydratedFeatureComparison-a3375a3e.js";import"./queryForSymbologySnapping-0264f2b5.js";import"./elevationInfoUtils-4fd79d95.js";import"./hash-6f442295.js";import"./diffUtils-590c9088.js";import"./Graphics3DObjectStates-bb2a6162.js";import"./UniqueValueRenderer-fef4204d.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./popupUtils-f04ec9a9.js";import"./FeatureFilter-00f4be05.js";import"./floorFilterUtils-080a7cd2.js";import"./QueryEngine-19eda5ff.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./FeatureSet-111cb247.js";import"./FeatureStore-f0e312fc.js";import"./BoundsStore-b6bd3c14.js";import"./projectExtentUtils-efa4cddd.js";import"./LayerView3D-ffd35809.js";import"./query-93c6e211.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./EventedSet-d13fada5.js";import"./commonProperties-30089b06.js";import"./FeatureEffect-86735d98.js";import"./LayerView-448bc5ea.js";import"./RefreshableLayerView-915e7f53.js";let t=class extends p{constructor(){super(...arguments),this.type="csv-3d"}};r([o()],t.prototype,"layer",void 0),t=r([i("esri.views.3d.layers.CSVLayerView3D")],t);const Z=t;export{Z as default}; diff --git a/assets/CSVSourceWorker-51c044a2.js b/assets/CSVSourceWorker-51c044a2.js new file mode 100644 index 0000000..acd675e --- /dev/null +++ b/assets/CSVSourceWorker-51c044a2.js @@ -0,0 +1,4 @@ +import{bT as w,ar as _,aN as k,bn as P,bz as L,bf as V,at as R,bS as M,cM as Q,dE as A,gQ as G,gR as Y,bc as B,bL as Z,bM as z,eo as J,eb as U}from"./index-080e108a.js";import{t as W}from"./json-48e3ea08.js";import{m as H}from"./FeatureStore-f0e312fc.js";import{e as K,f as X}from"./QueryEngine-19eda5ff.js";import{a as ee}from"./number-e5825aa4.js";import{i as te,o as ie}from"./clientSideDefaults-ab04bd90.js";import{r as x}from"./FieldsIndex-f79a8f26.js";import"./BoundsStore-b6bd3c14.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./defaultsJSON-59981e75.js";const T=/^\s*"([\S\s]*)"\s*$/,E=/""/g,S=` +`,ne=[","," ",";","|"," "];function*$(r,t,e){let i=0;for(;i<=r.length;){const n=r.indexOf(t,i),s=r.substring(i,n>-1?n:void 0);i+=s.length+t.length,e&&!s.trim()||(yield s)}}function O(r){const t=r.includes(`\r +`)?`\r +`:S;return $(r,t,!0)}function C(r,t){return $(r,t,!1)}function re(r,t,e){r=r.trim(),t=t==null?void 0:t.trim();const i=[],n=Array.from(new Set([e==null?void 0:e.delimiter,...ne])).filter(o=>o!=null);for(const o of n){const a=I(r,o).length,u=I(t,o).length??a;a>1&&i.push({weight:Math.min(a,u),delimiter:o})}const s=i.sort(({weight:o},{weight:a})=>a-o).map(({delimiter:o})=>o);for(const o of s){const a=se(v(r,o).names,e==null?void 0:e.longitudeField,e==null?void 0:e.latitudeField);if(a.longitudeFieldName&&a.latitudeFieldName)return{delimiter:o,locationInfo:a}}return{delimiter:s[0],locationInfo:null}}function*q(r,t,e,i=()=>Object.create(null)){const n=O(r);n.next();let s="",o="",a=0,u=i(),d=0;e:for(const g of n){const h=C(g,e);for(const m of h)if(s+=o+m,o="",a+=D(m),a%2==0){if(a>0){const p=T.exec(s);if(!p){u=i(),d=0,s="",a=0;continue e}u[t[d]]=p[1].replaceAll(E,'"'),d++}else u[t[d]]=s,d++;s="",a=0}else o=e;a===0?(yield u,u=i(),d=0):o=S}}function v(r,t){const e=I(r,t).filter(n=>n!=null),i=e.map(n=>w(n));for(let n=i.length-1;n>=0;n--)i[n]||(i.splice(n,1),e.splice(n,1));return{names:i,aliases:e}}function I(r,t){if(!(r!=null&&r.length))return[];const e=[];let i="",n="",s=0;const o=C(r,t);for(const a of o)if(i+=n+a,n="",s+=D(a),s%2==0){if(s>0){const u=T.exec(i);u&&e.push(u[1].replaceAll(E,'"'))}else e.push(i);i="",s=0}else n=t;return e}function D(r){let t=0,e=0;for(e=r.indexOf('"',e);e>=0;)t++,e=r.indexOf('"',e+1);return t}function se(r,t,e){var o,a;t=(o=w(t))==null?void 0:o.toLowerCase(),e=(a=w(e))==null?void 0:a.toLowerCase();const i=r.map(u=>u.toLowerCase()),n=t?r[i.indexOf(t)]:null,s=e?r[i.indexOf(e)]:null;return{longitudeFieldName:n||r[i.indexOf(de.find(u=>i.includes(u)))],latitudeFieldName:s||r[i.indexOf(ue.find(u=>i.includes(u)))]}}function oe(r,t,e,i,n){const s=[],o=q(r,e,t),a=[];for(const u of o){if(a.length===10)break;a.push(u)}for(let u=0;up[d]))){case"integer":h="esriFieldTypeInteger";break;case"double":h="esriFieldTypeDouble";break;case"date":h="esriFieldTypeDate",m=36;break;default:h="esriFieldTypeString",m=255}s.push({name:d,type:h,alias:g,length:m})}}return s}function ae(r){if(!r.length)return"string";const t=/[^+-.,0-9]/;return r.map(e=>{let i=!1;if(e!==""){if(t.test(e))i=!0;else{let n=N(e);if(!isNaN(n))return/[.,]/.test(e)||!Number.isInteger(n)||n>214783647||n<-214783648?"double":"integer";if(e.includes("E")){if(n=Number(e),!isNaN(n))return"double";if(e.includes(",")){if(e=e.replace(",","."),n=Number(e),!isNaN(n))return"double";i=!0}else i=!0}else i=!0}return i?/^[-]?\d*[.,]?\d*$/.test(e)?"string":j(new Date(e),e)?"date":"string":"string"}}).reduce((e,i)=>e===void 0?i:i===void 0?e:e===i?i:e==="string"||i==="string"?"string":e==="double"||i==="double"?"double":void 0)}function j(r,t){if(!r||Object.prototype.toString.call(r)!=="[object Date]"||isNaN(r.getTime()))return!1;let e=!0;if(!ce&&/\d+\W*$/.test(t)){const i=t.match(/[a-zA-Z]{2,}/);if(i){let n=!1,s=0;for(;!n&&s<=i.length;)n=!le.test(i[s]),s++;e=!n}}return e}const N=function(){const r=ee(),t=new RegExp("^"+r.regexp+"$"),e=new RegExp("["+r.group+"\\s\\xa0]","g"),i=r.factor;return n=>{const s=t.exec(n);if(r.factor=i,!s)return NaN;let o=s[1];if(!s[1]){if(!s[2])return NaN;o=s[2],r.factor*=-1}return o=o.replace(e,"").replace(r.decimal,"."),+o*r.factor}}(),le=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,ce=Number.isNaN(new Date("technology 10").getTime()),ue=["lat","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],de=["lon","lng","long","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"],fe=ie("esriGeometryPoint"),me=["csv"],pe=[0,0];class he{constructor(t,e){this.x=t,this.y=e}}class Le{constructor(){this._queryEngine=null,this._snapshotFeatures=async t=>{const e=await this._fetch(t);return this._createFeatures(e)}}destroy(){var t;(t=this._queryEngine)==null||t.destroy(),this._queryEngine=null}async load(t,e={}){var u;this._loadOptions=t;const[i]=await Promise.all([this._fetch(e.signal),this._checkProjection((u=t==null?void 0:t.parsingOptions)==null?void 0:u.spatialReference)]),n=ye(i,t);this._locationInfo=n.locationInfo,this._delimiter=n.delimiter,this._queryEngine=this._createQueryEngine(n);const s=await this._createFeatures(i);this._queryEngine.featureStore.addMany(s);const{fullExtent:o,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();if(n.layerDefinition.extent=o,a){const{start:d,end:g}=a;n.layerDefinition.timeInfo.timeExtent=[d,g]}return n}async applyEdits(){throw new _("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(t,e.signal)}async queryFeatureCount(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(t,e.signal)}async queryObjectIds(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(t,e.signal)}async queryExtent(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(t,e.signal)}async querySnapping(t,e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(t,e.signal)}async refresh(t){var n;this._loadOptions.customParameters=t,(n=this._snapshotTask)==null||n.abort(),this._snapshotTask=k(this._snapshotFeatures),this._snapshotTask.promise.then(s=>{this._queryEngine.featureStore.clear(),s&&this._queryEngine.featureStore.addMany(s)},s=>{this._queryEngine.featureStore.clear(),P(s)||L.getLogger("esri.layers.CSVLayer").error(new _("csv-layer:refresh","An error occurred during refresh",{error:s}))}),await this._waitSnapshotComplete();const{fullExtent:e,timeExtent:i}=await this._queryEngine.fetchRecomputedExtents();return{extent:e,timeExtent:i}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:e,customParameters:i}=this._loadOptions;if(!e)throw new _("csv-layer:invalid-source","url not defined");const n=V(e);return(await R(n.path,{query:{...n.query,...i},responseType:"text",signal:t})).data}_createQueryEngine(t){const{objectIdField:e,fields:i,extent:n,timeInfo:s}=t.layerDefinition,o=new H({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new K({fields:i,geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:s,objectIdField:e,spatialReference:n.spatialReference||{wkid:4326},cacheSpatialQueries:!0,featureStore:o})}async _createFeatures(t){const{latitudeFieldName:e,longitudeFieldName:i}=this._locationInfo,{objectIdField:n,fieldsIndex:s,spatialReference:o}=this._queryEngine;let a=[];const u=[],d=s.fields.filter(l=>l.name!==n).map(l=>l.name);let g=0;const h={};for(const l of s.fields)if(l.type!=="esriFieldTypeOID"&&l.type!=="esriFieldTypeGlobalID"){const y=M(l);y!==void 0&&(h[l.name]=y)}const m=q(t,d,this._delimiter,te(h,n));for(const l of m){const y=this._parseCoordinateValue(l[e]),F=this._parseCoordinateValue(l[i]);if(F!=null&&y!=null&&!isNaN(y)&&!isNaN(F)){l[e]=y,l[i]=F;for(const c in l)if(c!==e&&c!==i){if(s.isDateField(c)){const f=new Date(l[c]);l[c]=j(f,l[c])?f.getTime():null}else if(s.isNumericField(c)){const f=N(l[c]);isNaN(f)?l[c]=null:l[c]=f}}l[n]=g,g++,a.push(new he(F,y)),u.push(l)}}if(!Q({wkid:4326},o))if(A(o))for(const l of a)[l.x,l.y]=G(l.x,l.y,pe);else a=Y(W,a,B.WGS84,o,null,null);const p=[];for(let l=0;l181)&&(e=parseFloat(t)),e}async _checkProjection(t){try{await X(J,t)}catch{throw new _("csv-layer:projection-not-supported","Projection not supported")}}}function ye(r,t){var l,y,F;const e=t.parsingOptions||{},i={delimiter:e.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:e.latitudeField,longitudeFieldName:e.longitudeField}},n=i.layerDefinition={name:U(t.url,me)||"csv",drawingInfo:fe,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:e.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:e.spatialReference||{wkid:4326}}},s=O(r),o=(l=s.next().value)==null?void 0:l.trim(),a=(y=s.next().value)==null?void 0:y.trim();if(!o)throw new _("csv-layer:empty-csv","CSV is empty",{csv:r});const{delimiter:u,locationInfo:d}=re(o,a,e);if(!u)throw new _("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:o,secondLine:a,parsingOptions:e});if(!d)throw new _("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file",{firstLine:o,secondLine:a,parsingOptions:e});i.locationInfo=d,i.delimiter=u;const{names:g,aliases:h}=v(o,u),m=oe(r,i.delimiter,g,h,i.locationInfo);if((F=e.fields)!=null&&F.length){const c=new x(e.fields);for(const f of m){const b=c.get(f.name);b&&Object.assign(f,b)}}if(!m.some(c=>c.type==="esriFieldTypeOID"&&(n.objectIdField=c.name,!0))){const c={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};n.objectIdField=c.name,m.unshift(c)}n.fields=m;const p=new x(n.fields);if(i.locationInfo&&(i.locationInfo.latitudeFieldName=p.get(i.locationInfo.latitudeFieldName).name,i.locationInfo.longitudeFieldName=p.get(i.locationInfo.longitudeFieldName).name),n.timeInfo){const c=n.timeInfo;if(c.startTimeField){const f=p.get(c.startTimeField);f?(c.startTimeField=f.name,f.type="esriFieldTypeDate"):c.startTimeField=null}if(c.endTimeField){const f=p.get(c.endTimeField);f?(c.endTimeField=f.name,f.type="esriFieldTypeDate"):c.endTimeField=null}if(c.trackIdField){const f=p.get(c.trackIdField);c.trackIdField=f?f.name:null}c.startTimeField||c.endTimeField||(n.timeInfo=null)}return i}export{Le as default}; diff --git a/assets/ChapmanAtmosphere.glsl-badaea29.js b/assets/ChapmanAtmosphere.glsl-badaea29.js new file mode 100644 index 0000000..31822c0 --- /dev/null +++ b/assets/ChapmanAtmosphere.glsl-badaea29.js @@ -0,0 +1 @@ +import{y as b,S as i}from"./index-080e108a.js";export{b as betaRayleigh,i as build}; diff --git a/assets/CheckerBoard.glsl-7d1da857.js b/assets/CheckerBoard.glsl-7d1da857.js new file mode 100644 index 0000000..2dcadcd --- /dev/null +++ b/assets/CheckerBoard.glsl-7d1da857.js @@ -0,0 +1 @@ +import"./index-080e108a.js";import{n}from"./AreaMeasurementAnalysisView3D-26f7cb40.js";import"./UnitNormalizer-818a6664.js";import"./Segment-50129b50.js";import"./unitFormatUtils-b70a7bff.js";import"./LineVisualElement-b605d10c.js";import"./elevationInfoUtils-4fd79d95.js";import"./geometryEngine-5a631b21.js";import"./geometryEngineBase-324c1c81.js";import"./hydrated-c10ab4a5.js";import"./EditGeometryOperations-0ec3f5b5.js";export{n as build}; diff --git a/assets/Clouds.glsl-918fa9c8.js b/assets/Clouds.glsl-918fa9c8.js new file mode 100644 index 0000000..f174b46 --- /dev/null +++ b/assets/Clouds.glsl-918fa9c8.js @@ -0,0 +1 @@ +import{a as r,w as e,x as o}from"./index-080e108a.js";export{r as CloudsDrawParameters,e as CloudsPassParameters,o as build}; diff --git a/assets/CloudsComposition.glsl-e9072d6f.js b/assets/CloudsComposition.glsl-e9072d6f.js new file mode 100644 index 0000000..6487bd1 --- /dev/null +++ b/assets/CloudsComposition.glsl-e9072d6f.js @@ -0,0 +1 @@ +import{v as a}from"./index-080e108a.js";export{a as build}; diff --git a/assets/ColorMaterial.glsl-c349707a.js b/assets/ColorMaterial.glsl-c349707a.js new file mode 100644 index 0000000..01f0c66 --- /dev/null +++ b/assets/ColorMaterial.glsl-c349707a.js @@ -0,0 +1 @@ +import{ad as o}from"./index-080e108a.js";export{o as build}; diff --git a/assets/ColorSet-bb3b0c3c.js b/assets/ColorSet-bb3b0c3c.js new file mode 100644 index 0000000..7ec1e6f --- /dev/null +++ b/assets/ColorSet-bb3b0c3c.js @@ -0,0 +1 @@ +import{j as c,X as h}from"./Popup-db207f4c.js";class u extends c{_afterNew(){super._afterNewApplyThemes(),this._dirty.colors=!1}_beforeChanged(){this.isDirty("colors")&&this.reset()}generateColors(){this.setPrivate("currentPass",this.getPrivate("currentPass",0)+1);const e=this.getPrivate("currentPass"),t=this.get("colors",[this.get("baseColor",h.fromHex(16711680))]);this.getPrivate("numColors")||this.setPrivate("numColors",t.length);const r=this.getPrivate("numColors"),g=0,i=this.get("passOptions"),P=this.get("reuse");for(let a=g;a1;)n-=1;let s=o.s+(i.saturation||0)*e;s>1&&(s=1),s<0&&(s=0);let l=o.l+(i.lightness||0)*e;for(;l>1;)l-=1;t.push(h.fromHSL(n,s,l))}}getIndex(e){const t=this.get("colors",[]),r=this.get("saturation");return e>=t.length?(this.generateColors(),this.getIndex(e)):r!=null?h.saturate(t[e],r):t[e]}next(){let e=this.getPrivate("currentStep",this.get("startIndex",0));return this.setPrivate("currentStep",e+this.get("step",1)),this.getIndex(e)}reset(){this.setPrivate("currentStep",this.get("startIndex",0)),this.setPrivate("currentPass",0)}}Object.defineProperty(u,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColorSet"}),Object.defineProperty(u,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:c.classNames.concat([u.className])});export{u as s}; diff --git a/assets/ComponentShader.glsl-ec5515fa.js b/assets/ComponentShader.glsl-ec5515fa.js new file mode 100644 index 0000000..47b1c4c --- /dev/null +++ b/assets/ComponentShader.glsl-ec5515fa.js @@ -0,0 +1 @@ +import{V as a,I as l}from"./index-080e108a.js";export{a as build,l as getOverlayNormalTexture}; diff --git a/assets/Compositing.glsl-2c5c8d4d.js b/assets/Compositing.glsl-2c5c8d4d.js new file mode 100644 index 0000000..befe58f --- /dev/null +++ b/assets/Compositing.glsl-2c5c8d4d.js @@ -0,0 +1 @@ +import{p as o,q as r}from"./index-080e108a.js";export{o as CompositingPassParameters,r as build}; diff --git a/assets/CustomParametersMixin-231c4be8.js b/assets/CustomParametersMixin-231c4be8.js new file mode 100644 index 0000000..0ff9b60 --- /dev/null +++ b/assets/CustomParametersMixin-231c4be8.js @@ -0,0 +1 @@ +import{ai as s,aj as a,al as o}from"./index-080e108a.js";const n=r=>{let e=class extends r{constructor(){super(...arguments),this.customParameters=null}};return s([a({type:Object,json:{write:{overridePolicy:t=>({enabled:!!(t&&Object.keys(t).length>0)})}}})],e.prototype,"customParameters",void 0),e=s([o("esri.layers.mixins.CustomParametersMixin")],e),e};export{n as o}; diff --git a/assets/DefaultMaterial.glsl-ab417bbf.js b/assets/DefaultMaterial.glsl-ab417bbf.js new file mode 100644 index 0000000..af355f7 --- /dev/null +++ b/assets/DefaultMaterial.glsl-ab417bbf.js @@ -0,0 +1 @@ +import{Y as a}from"./index-080e108a.js";export{a as build}; diff --git a/assets/DefinitionExpressionSceneLayerView-66b62d34.js b/assets/DefinitionExpressionSceneLayerView-66b62d34.js new file mode 100644 index 0000000..dec1c09 --- /dev/null +++ b/assets/DefinitionExpressionSceneLayerView-66b62d34.js @@ -0,0 +1 @@ +import{ai as o,aj as a,al as p,bz as t}from"./index-080e108a.js";import{f as d}from"./WhereClause-c86b9974.js";import{r as l}from"./I3SUtil-2c288808.js";const h="updating";function x(s){return s==="updating"?null:s}function g(s){return s==="updating"}const c=s=>{let n=class extends s{constructor(){super(...arguments),this._definitionExpressionErrors=0,this._maxDefinitionExpressionErrors=20,this.logError=i=>{this._definitionExpressionErrors0?(t.getLogger(this).error(`definitionExpression references unknown fields: ${e.join(", ")}`),null):(this._definitionExpressionErrors=0,i)}catch(i){return t.getLogger(this).error("Failed to parse definitionExpression: "+i),null}}get definitionExpressionFields(){return this.parsedDefinitionExpression?this.parsedDefinitionExpression.fieldNames:[]}_evaluateClause(i,e){try{return i.testFeature(e)}catch(r){return this.logError(r),!1}}_addDefinitionExpressionToQuery(i){if(!this.parsedDefinitionExpression)return i;const e=this.i3slayer.definitionExpression,r=i.clone();return r.where?r.where=`(${e}) AND (${r.where})`:r.where=e,r}};return o([a()],n.prototype,"i3slayer",void 0),o([a({readOnly:!0})],n.prototype,"parsedDefinitionExpression",null),o([a({readOnly:!0})],n.prototype,"definitionExpressionFields",null),n=o([p("esri.views.3d.layers.support.DefinitionExpressionSceneLayerView")],n),n};export{x as a,h as n,c as t,g as u}; diff --git a/assets/DictionaryLoader-c0729336.js b/assets/DictionaryLoader-c0729336.js new file mode 100644 index 0000000..53ddefc --- /dev/null +++ b/assets/DictionaryLoader-c0729336.js @@ -0,0 +1 @@ +import{bx as P,bn as I,by as L,bh as v,bz as S,at as C,bA as R,ar as N,bB as $,bC as T,bD as x}from"./index-080e108a.js";import{r as F}from"./FieldsIndex-f79a8f26.js";const M="esri.renderers.support.DictionaryLoader",q={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};class D{constructor(t,i,o){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new P(100),this._dictionaryVersion=null,this._fieldIndex=null,this._dictionaryPromise=null,this.url=t,this.config=i,this.fieldMap=o}getSymbolFields(){return this._symbolFields}async getSymbolAsync(t,i){let o;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(i));try{o=await this._dictionaryPromise}catch(s){if(I(s))return this._dictionaryPromise=null,null}const e=this._dictionaryVersion&&this._dictionaryVersion.since(4,0),l={};if(this.fieldMap)for(const s of this._symbolFields){const n=this._getFieldName(this.fieldMap[s]);l[s]=n?e?t.attributes[n]:""+t.attributes[n]:""}let a=null;try{a=o==null?void 0:o(l,i)}catch{return null}if(!a||typeof a!="string")return null;const h=L(a).toString(),c=this._symbolCache.get(h);if(c)return c.catch(()=>{this._symbolCache.pop(h)}),c;const g=a.split(";"),y=[],u=[];for(const s of g)if(s)if(s.includes("po:")){const n=s.substr(3).split("|");if(n.length===3){const m=n[0],b=n[1];let f=n[2];if(b==="DashTemplate")f=f.split(" ").map(d=>Number(d));else if(b==="Color"){const d=new v(f).toRgba();f=[d[0],d[1],d[2],255*d[3]]}else f=Number(f);u.push({primitiveName:m,propertyName:b,value:f})}}else if(s.includes("|")){for(const n of s.split("|"))if(this._itemNames.has(n)){y.push(n);break}}else this._itemNames.has(s)&&y.push(s);const _=t.geometry==null||!t.geometry.hasZ&&t.geometry.type==="point",r=this._cimPartsToCIMSymbol(y,u,_,i);return this._symbolCache.put(h,r,1),r}async fetchResources(t){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void S.getLogger(M).error("no valid URL!");const i=C(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:t!=null?t.signal:null}),[{data:o}]=await Promise.all([i,R()]);if(!o)throw this._dictionaryPromise=null,new N("esri.renderers.DictionaryRenderer","Bad dictionary data!");const{authoringInfo:e,dictionary_version:l,expression:a,itemsNames:h}=o,c=a;let g=!1;l&&(this._dictionaryVersion=$.parse(l),g=this._dictionaryVersion.since(4,0)),this._refSymbolUrlTemplate=this.url+"/"+o.cimRefTemplateUrl,this._itemNames=new Set(h),this._symbolFields=e.symbol;const y={};if(this.config){const r=this.config;for(const s in r)y[s]=r[s]}if(e.configuration)for(const r of e.configuration)y.hasOwnProperty(r.name)||(y[r.name]=r.value);const u=[];if(t!=null&&t.fields&&this.fieldMap)for(const r of this._symbolFields){const s=this.fieldMap[r],n=t.fields.filter(m=>m.name.toLowerCase()===(s==null?void 0:s.toLowerCase()));n.length>0&&u.push({...n[0],type:g?n[0].type:"esriFieldTypeString"})}u.length>0&&(this._fieldIndex=new F(u));const _=T(c,t!=null?t.spatialReference:null,u,y).then(r=>{const s={scale:0};return(n,m)=>{if(r==null)return null;const b=r.repurposeFeature({geometry:null,attributes:n});return s.scale=m!=null?m.scale??void 0:void 0,r.evaluate({$feature:b,$view:s},r.services)}}).catch(r=>(S.getLogger(M).error("Creating dictinoary expression failed:",r),null));return this._dictionaryPromise=_,_}async _cimPartsToCIMSymbol(t,i,o,e){const l=new Array(t.length);for(let c=0;cl.data);const o=this._refSymbolUrlTemplate.replaceAll(/\{itemName\}/gi,t),e=C(o,{responseType:"json",query:{f:"json"},...i});this._ongoingRequests.set(t,e);try{return(await e).data}catch(l){throw this._ongoingRequests.delete(t),l}}_combineSymbolParts(t,i,o){if(!t||t.length===0)return null;const e={...t[0]};if(t.length>1){e.symbolLayers=[];for(const l of t){const a=l;e.symbolLayers.unshift(...a.symbolLayers)}}return o&&(e.callout=q),{type:"CIMSymbolReference",symbol:e,primitiveOverrides:i}}_getFieldName(t){if(this._fieldIndex!==null){const i=this._fieldIndex.get(t);return i?i.name:t}return t}}function w(p,t){if(!p)return;const i=p.symbolLayers;if(!i)return;let o=i.length;for(;o--;){const e=i[o];e&&e.enable!==!1&&e.type==="CIMVectorMarker"&&j(e,t)}}function j(p,t){const i=p.markerGraphics;if(i)for(const o of i){if(!o)continue;const e=o.symbol;if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":w(e,t);break;case"CIMTextSymbol":e.fieldMap=t}}}export{D as DictionaryLoader}; diff --git a/assets/DimensionAnalysisView3D-4f55aca1.js b/assets/DimensionAnalysisView3D-4f55aca1.js new file mode 100644 index 0000000..2c865d3 --- /dev/null +++ b/assets/DimensionAnalysisView3D-4f55aca1.js @@ -0,0 +1 @@ +import{gm as js,aB as qs,lH as Us,lI as Ws,cM as Zs,uv as Bs,dO as Dt,h1 as At,dS as ce,dT as g,uw as Ys,ux as Xs,fs as L,j7 as w,oC as Qs,pS as Wi,lV as Zi,ft as Bi,gt as R,dQ as ne,mF as D,pj as Mn,j5 as qe,dR as En,fu as xi,h0 as J,oS as Fe,uy as Yi,gD as ge,na as oi,ai as u,aj as p,al as H,ao as ue,af as Ut,ah as dt,aG as S,aM as G,cf as Ks,bz as $n,bh as W,oQ as Js,j6 as Ue,gu as ft,o$ as rt,gL as li,j4 as M,p3 as er,n2 as Cn,j8 as On,bF as se,dk as N,uz as tr,c7 as ke,o3 as di,n1 as ci,j1 as Ye,pQ as Xi,pR as ir,kf as nr,o4 as sr,h5 as rr,kC as ar,sv as zt,i_ as x,nb as Kt,of as Ne,j0 as ct,uA as Tn,j3 as le,b0 as Rn,h6 as Qi,o9 as or,n3 as lr,ob as dr,oc as cr,od as ur,a_ as Ht,b2 as ui,o2 as Ae,gv as Dn,kA as hr,kz as re,kE as Ki,m2 as Jt,m1 as pr,m0 as vt,mz as ee,kK as An,ck as Ln,h9 as _e,ox as hi,uB as mr,aW as fr,aX as ze,m5 as zn,iZ as ei,g5 as Ji,uC as gr,ru as en,gH as _r,ir as tn,pg as yr,aF as Xe,ag as Vt,rx as ut,lU as gt,rw as at,uD as vr,uE as Sr,uF as pi,uG as mi,oY as Ce,m4 as wr,bm as bi,iS as Pr,aH as We,fw as xr,ax as br,aw as St,uH as Mr,oG as Hn,my as Er,cu as $r,be as nn,bd as Cr,aP as Or,aS as Mi,uI as Tr,dW as Vn,pq as Gn,aO as ht,hV as Ei,lC as fi,aR as In,lQ as Gt,fA as Rr,aC as $i,uJ as gi,kI as Dr,hW as Ar,uK as Lr,pO as zr,hw as Hr,uL as Fn,lb as Vr,lc as Gr,uM as Ir,pV as et,lR as Fr,lT as kr,aT as sn}from"./index-080e108a.js";import{i as Ze,u as Nr,b as kn,c as we,e as jr,r as qr,a as Ur}from"./LineVisualElement-b605d10c.js";import{t as E,r as Wr,u as Zr}from"./LengthDimension-92faee98.js";import{r as Br,a as Nn,f as Oe,e as Yr,b as Xr,u as z,g as Qr,h as Kr}from"./Segment-50129b50.js";import{T as Jr,$ as jn,e as ot,U as qn,R as ea,L as ta,d as _t,N as Ci,c as Oi,D as ia,f as Un,g as rn,a as na,b as sa,v as ra,l as aa}from"./analysisViewUtils-68ab721d.js";import{F as oa,H as Wn,A as Ti,n as la}from"./Factory-8e329f4b.js";import{c as da,v as ca,b as C,p as Zn}from"./elevationInfoUtils-4fd79d95.js";import{t as Bn,P as ua}from"./RightAngleQuadVisualElement-8daf0594.js";import{c as ha,y as an}from"./PointVisualElement-2a56e55d.js";import{c as pa}from"./ImageMaterial-5c48df66.js";import{v as I,L as ti,m as ma,_ as fa,p as ga,w as _a}from"./EditGeometryOperations-0ec3f5b5.js";import{r as ya}from"./dehydratedFeatureComparison-a3375a3e.js";function va(i){const e=js(i),t=e===Us?Ws:e;return qs(i,t)?t:i}var je;function Sa(i,e){const{spatialReference:t}=i;return Zs(t,e.spatialReference)?(wt[0]=i.x,wt[1]=i.y,wt[2]=i.hasZ?i.z:0,Pt[0]=e.x,Pt[1]=e.y,Pt[2]=e.hasZ?e.z:0,Yn(wt,Pt,t)):null}function Yn(i,e,t){const n=wa(i,e,t,je.Direct);return n!=null?Br(n.direct,n.unit):null}function wa(i,e,t,n){const s=va(t),r=Bs(s);if(r==null)return null;const a=e[2]-i[2];if(n===je.Vertical)return{verticalSigned:a,unit:r};if(!Dt(i,t,ii,s)||!Dt(e,t,xt,s))return null;if(n===je.Direct)return{direct:At(xt,ii),unit:r};if(ce(bt,i[0],i[1],e[2]),!Dt(bt,t,bt,s))return null;const l=At(bt,xt);return n===je.Horizontal?{horizontal:l,unit:r}:{direct:At(xt,ii),horizontal:l,vertical:Math.abs(a),unit:r}}(function(i){i[i.Direct=0]="Direct",i[i.Horizontal=1]="Horizontal",i[i.Vertical=2]="Vertical"})(je||(je={}));const wt=g(),Pt=g(),ii=g(),xt=g(),bt=g();function Pa(i,e,t){if(i==null)return null;const n=i.dimensionSegment.startRenderSpace,s=i.dimensionSegment.endRenderSpace,r=Yn(n,s,i.spatialReference);if(r==null)return null;const a=e===E.Vertical?Ys(r.value,r.unit,t):Xs(r.value,r.unit,t);return Nn(r,a)}function It(i){const{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,dimension:{offset:n,measureType:s,orientation:r}}=i;return{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,offset:n,measureType:s,orientation:r}}function Ft({elevationAlignedStartPoint:i,elevationAlignedEndPoint:e,offset:t,measureType:n,orientation:s},r,a=null){if(i==null||e==null)return null;const l=Qn(a!=null?a.directSegment:new Oe,{elevationAlignedStartPoint:i,elevationAlignedEndPoint:e},r),o=a!=null?a.primaryOffsetAxis:g();Wt(o,{measureType:n,elevationAlignedStartPoint:i,elevationAlignedEndPoint:e,directSegment:l,orientation:s,renderCoordsHelper:r});const d=a!=null?a.dimensionSegment:new Oe;return Ri({elevationAlignedStartPoint:i,elevationAlignedEndPoint:e})&&n===E.Vertical?(L(d.startRenderSpace,l.startRenderSpace),L(d.endRenderSpace,l.endRenderSpace)):Kn(d,{offsetAxis:o,offset:t,relativeToSegment:l,renderCoordsHelper:r}),{directSegment:l,dimensionSegment:d,primaryOffsetAxis:o,spatialReference:r.spatialReference}}function on(i,e,t,n){return e===pt.Start?(L(i.startRenderSpace,t.startRenderSpace),L(i.endRenderSpace,n.startRenderSpace)):(L(i.startRenderSpace,t.endRenderSpace),L(i.endRenderSpace,n.endRenderSpace)),i}var pt;function xa(i,e,t,n){J(i.startRenderSpace,e.startRenderSpace,t,n),J(i.endRenderSpace,e.endRenderSpace,t,n)}function Xn(i,e,t,n){switch(e){case E.Direct:return Qn(i,t,n);case E.Horizontal:case E.Vertical:{const{elevationAlignedStartPoint:s,elevationAlignedEndPoint:r,dimension:a,geometry:l}=t;let o;a.measureType===E.Direct?(o=ba(l,n)===s.z>r.z,e===E.Horizontal&&(o=!o)):o=!Ma(l);const[d,c]=o?[s,r]:[r,s],h=Fe(c,Ea);return e===E.Horizontal?h.z=d.z:(h.x=d.x,h.y=d.y),n.toRenderCoords(d,i.startRenderSpace),n.toRenderCoords(h,i.endRenderSpace),i}}}function Qn(i,e,t){return t.toRenderCoords(e.elevationAlignedStartPoint,i.startRenderSpace),t.toRenderCoords(e.elevationAlignedEndPoint,i.endRenderSpace),i}function ba(i,e){const t=i.directSegment.eval(.5,w.get()),n=e.worldUpAtPosition(t,w.get()),s=i.dimensionSegment.eval(.5,w.get()),r=R(w.get(),s,t);return!Mn(r,qe)&&D(r,n)>0}function Ma(i){const{startRenderSpace:e,endRenderSpace:t}=i.dimensionSegment,{startRenderSpace:n,endRenderSpace:s}=i.directSegment;return Yi(n,e)r?[a,n]:[n,a]}function Zt(i,e,t){const n=e.directSegment.eval(.5,w.get());return t.worldUpAtPosition(n,i)}function Di(i,e){const{startRenderSpace:t,endRenderSpace:n}=e.directSegment;return R(i,n,t)}function Ai(i,e,t={invert:!1}){const{startRenderSpace:n,endRenderSpace:s}=e.dimensionSegment;return t.invert?R(i,n,s):R(i,s,n)}function _i(i,e){const t=i.directSegment.eval(.5,w.get());return e.headingAtPosition(t,i.primaryOffsetAxis)}function Ta(i,e){return oi(Ai(Ra,i))/e**2}const Ra=g();function Jn(i){const{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t}=i;if(e==null||t==null)return!1;const n=Sa(e,t);return n!=null&&Nn(n,"meters").value>es}const es=1e5;function mt(i){return i.geometry!=null}let Pe=class extends ue{constructor(e){super(e),this._handles=new Ut}initialize(){const{computations:e}=this.analysisViewData;for(const t of e)this._addComputation(t);this.addHandles(e.on("change",({added:t,removed:n})=>{for(const s of n)this._removeComputation(s);for(const s of t)this._addComputation(s)}))}destroy(){this._handles=dt(this._handles)}get analysis(){return this.analysisViewData.analysis}get _defaultUnit(){return Yr(this.view)}_addComputation(e){this._handles.has(e)||this._handles.add(S(()=>It(e),t=>{const{measureType:n}=t;if(Jn(t)&&n!==E.Direct){const r=Math.round(Ks(es,"meters","kilometers"));return $n.getLogger(this).warnOnce(`A ${n} dimension in the analysis (id: '${this.analysis.id}') will not display, because only direct dimensions can measure lengths greater than ${r} km. Update the measureType of the affected dimension to "direct" to display it.`),void(e.geometry=null)}const s=Ft(t,this.view.renderCoordsHelper,e.geometry);e.geometry=s,e.result.length=Pa(s,n,this._defaultUnit)},G),e)}_removeComputation(e){this._handles.remove(e)}};u([p({constructOnly:!0})],Pe.prototype,"analysisViewData",void 0),u([p({constructOnly:!0})],Pe.prototype,"view",void 0),u([p()],Pe.prototype,"analysis",null),u([p()],Pe.prototype,"_defaultUnit",null),Pe=u([H("esri.views.3d.analysis.Dimension.support.DimensionController")],Pe);let Da=class{constructor(){this.color=Ze(.5),this.radius=5}},Aa=class{constructor(){this.color=new W([127,127,127,.5]),this.radius=5}},La=class{constructor(){this.lineSizeFraction=.8}},za=class{constructor(){this.color=Ze(.5),this.linePaddingPx=4,this.focusedLinePaddingPx=6,this.lengthFraction=.5,this.minLengthMeters=.1}},Ha=class{constructor(){this.calloutOffsetPx=18,this.calloutWidth=2,this.discScale=.3,this.focusMultiplier=2,this.color=Ze(.5),this.contrastColor=Nr()}},Va=class{constructor(){this.lineSizeFraction=.25}},Ga=class{constructor(){this.marginPx=20,this.minScreenLengthFontSizeFactor=5}},Ia=class{constructor(){this.color=Ze(.5)}},Fa=class{constructor(){this.pointManipulators=new Da,this.offsetManipulator=new za,this.orientationManipulator=new Ha,this.markers=new La,this.labels=new Ga,this.offsetLine=new Va,this.constraint=new Ia,this.constraintThresholdPx=10,this.initialOffsetPx=50,this.orientationSnapThresholdDegrees=5,this.disabledPointIndicator=new Aa,this.smallScreenLengthLineSizeFactor=2,this.pointerMoveTimeoutMs=2500}},$=new Fa;class ka{constructor(e){this.start=e.start,this.end=e.end,this.offset=e.offset,this.heading=e.heading,this.rotation=e.rotation,this.direct=e.direct,this.horizontal=e.horizontal,this.vertical=e.vertical}manipulatorName(e){return Object.keys(this).find(t=>this.hasOwnProperty(t)&&e===this[t])}values(){return[this.start,this.end,this.offset,this.heading,this.rotation,this.direct,this.horizontal,this.vertical]}forEachMeasureTypeManipulator(e){for(const t of Wr)e(this.manipulatorForMeasureType(t),t)}manipulatorForMeasureType(e){switch(e){case E.Direct:return this.direct;case E.Horizontal:return this.horizontal;case E.Vertical:return this.vertical}}}function Na(i,e){const t=Jr(i,W.toUnitRGBA($.pointManipulators.color),de);return t.available=!1,t.grabCursor="crosshair",t.radius=$.pointManipulators.radius,t.metadata=e.metadata,t.collisionPriority=1,t}function ja(i,e){const t=[N(-.5,0,0),N(.5,0,0)],{lengthFraction:n}=$.offsetManipulator,s=Ue(e.unfocusedMaterial,t.map(a=>ft(g(),a,n))),r=s.instantiate({material:e.focusedMaterial});return new jn({view:i,renderObjects:[new ot(s,rt.Unfocused|rt.Selected|de),new ot(r,rt.Focused|de)],collisionType:{type:"line",paths:[t]},radius:Li(e.lineSizePt)/2,metadata:e.metadata,available:!1,...qn})}function ts(i,{lineSizePt:e,material:t}){const{calloutOffsetPx:n,calloutWidth:s,discScale:r,focusMultiplier:a,color:l}=$.orientationManipulator;return{calloutLength:.25*tr*$.markers.lineSizeFraction*se(e)+n,calloutColor:W.toUnitRGBA(l),calloutWidth:s,customStateMask:de,discScale:r,focusMultiplier:a,material:t,metadata:i}}function ln(i,e){return ea(i,ts(e.metadata,e))}function dn(i,e){ta(i,ts(i.metadata,e))}function qa(i,e){const t=[N(-.5,0,0),N(.5,0,0)],{lengthFraction:n}=$.offsetManipulator,s=Ue(e.thinOffsetManipulatorMaterial,t),r=Ue(e.unfocusedMaterial,t.map(l=>ft(g(),l,n))),a=r.instantiate({material:e.focusedMaterial});return new jn({view:i,renderObjects:[new ot(r,rt.Unfocused|de),new ot(a,rt.Focused|de),new ot(s,de)],collisionType:{type:"line",paths:[t]},radius:Li(e.lineSizePt)/2,available:!1,metadata:e.metadata,...qn})}function Ua(i,{isStart:e,createSnappingPipelineStep:t,dimension:n,onUpdate:s,view:r}){const a=e?"startPoint":"endPoint";return[_t(i,(o,d,c,h)=>{const m=Ti(o),{snappingStep:f,cancelSnapping:_}=t(h);c=c.next(m).next(Oi(n,[a,"measureType","orientation"])).next(_),d.next(m).next(oa(r)).next(...f).next(v=>{const y=Fe(v.mapEnd,new ke);s(a==="startPoint"?{startPoint:y}:{endPoint:y})})})]}function Wa(i,{computation:e,view:t}){return[_t(i,(n,s,r)=>{if(!mt(e)||!n.selected)return;const{geometry:a,dimension:l}=e,o=Ti(n);s.next(o).next(ns(t,l,a.dimensionSegment,a.primaryOffsetAxis)),r.next(o).next(Oi(l,["offset"]))})]}function Za(i,{computation:e,view:t}){return[_t(i,(n,s,r)=>{is({cancel:r,computation:e,settingHeading:!0,steps:s,view:t})})]}function Ba(i,{computation:e,view:t}){return[_t(i,(n,s,r)=>{is({cancel:r,computation:e,settingHeading:!1,steps:s,view:t})}),i.events.on("immediate-click",n=>{Ya(n,e,t)})]}function Ya(i,e,t){const{dimension:n,geometry:s}=e;if(n.orientation===90||n.orientation===270)return n.orientation=0,void i.stopPropagation();if(s==null)return;const{renderCoordsHelper:r}=t,a=Ft({...It(e),orientation:90},r),l=Ft({...It(e),orientation:270},r);if(a==null||l==null)return;const o=_i(a,r),d=_i(l,r),c=ss(s,t),h=li.shortestSignedDiff(c,o),m=li.shortestSignedDiff(c,d);n.orientation=Math.abs(h){_.action==="start"&&L(d,_.renderStart);const v=ir(m),y=ia(d,_.renderEnd,c,v);let T=f-nr(y);n||(T=Xa(T)),l.orientation=T}),e.next(Oi(l,["orientation"]))}function Xa(i){const e=li.normalize(i)%90;return e<$.orientationSnapThresholdDegrees?i-e:90-e<$.orientationSnapThresholdDegrees?i+(90-e):i}function Qa(i,{computation:e,manipulatorMeasureType:t,view:n}){let s=E.Direct,r=0,a=0;return[i.events.on("grab-changed",l=>{if(l.action!=="start"||!mt(e))return;const{dimension:o,geometry:d}=e;s=o.measureType,r=o.offset,a=o.orientation;const c=L(w.get(),i.renderLocation);o.measureType=t,o.offset=$a(c,t,d,n.renderCoordsHelper),o.orientation=0}),_t(i,(l,o,d)=>{if(!mt(e))return;const{geometry:c,dimension:h}=e,{renderCoordsHelper:m}=n,f=Xn(ls,t,e,m),_=Wt(w.get(),{measureType:t,directSegment:c.directSegment,renderCoordsHelper:m}),v=Ti(l);o.next(v).next(ns(n,h,f,_)),d.next(v).next(y=>(h.measureType=s,h.offset=r,h.orientation=a,y))})]}function ns(i,e,t,n){const s=Ye(w.get(),t.endRenderSpace,t.startRenderSpace);ne(s,s,n);const r=di(t.startRenderSpace,s,ci()),a=di(t.startRenderSpace,n,ci()),l=e.offset;let o,d=0;const c=new Un;return c.next(Wn(i,r)).next(h=>{h.action==="start"&&(d=Xi(a,h.renderStart));const m=(Xi(a,h.renderEnd)-d)*i.renderCoordsHelper.unitInMeters;e.offset=l+m,o=h}),h=>(c.execute(h),o)}function ss(i,e){const{directSegment:t}=i,{renderCoordsHelper:n}=e,s=Zt(w.get(),i,n),r=Di(w.get(),i),a=ne(w.get(),r,s),{viewForward:l}=e.state.camera;D(a,l)>0&&ft(a,a,-1);const o=t.eval(.5,w.get());return n.headingAtPosition(o,a)}function Ka(i,e,t){const{dimensionSegment:n,primaryOffsetAxis:s}=e,r=Ai(lt,e),a=M(r,qe)?er(kt):Ci(r,s,qe,kt),l=Math.max(Cn(r),$.offsetManipulator.minLengthMeters/t.unitInMeters);On(a,a,ce(lt,l,l,l)),i.modelTransform=a,i.renderLocation=n.eval(.5,lt)}function Ja(i,e,t){rs(i,e,t,{forHeading:!0})}function eo(i,e,t){rs(i,e,t,{forHeading:!1})}function rs(i,e,t,{forHeading:n}){const{dimension:s,geometry:r}=e,{primaryOffsetAxis:a}=r,l=ft(to,a,s.offset>=0?1:-1),o=os(io,{forHeading:n,geometry:r,renderCoordsHelper:t});ne(o,o,l);const d=Ci(l,o,qe,kt);i.modelTransform=d,i.renderLocation=as(lt,r,r.dimensionSegment,t)}const to=g(),io=g();function no(i,e,t,n){const{geometry:s}=e,r=Xn(ls,t,e,n),a=Wt(lt,{measureType:t,directSegment:s.directSegment,renderCoordsHelper:n}),l=R(ni,r.endRenderSpace,r.startRenderSpace),o=Ci(l,a,qe,kt),d=Cn(l);On(o,o,ce(ni,d,d,d)),i.modelTransform=o,i.renderLocation=r.eval(.5,ni)}function as(i,e,t,n){const{startRenderSpace:s,endRenderSpace:r}=t,a=so(e,n)?s:r;return L(i,a)}function os(i,{forHeading:e,geometry:t,renderCoordsHelper:n}){return e?Zt(i,t,n):Ai(i,t,{invert:!0})}function so(i,e){const t=Di(ro,i),n=Zt(ao,i,e);return D(t,n)>0}const ro=g(),ao=g();function oo(i){return se(i)+$.offsetManipulator.linePaddingPx}function Li(i){return se(i)+$.offsetManipulator.focusedLinePaddingPx}const de=Js.Custom1,lt=g(),ni=g(),kt=xi(),ls=new Oe;function lo(i){let e,t,n=[],s=!1;function r(...a){return s&&e===this&&co(a,n)||(t=i.apply(this,a),e=this,n=a,s=!0),t}return r}function co(i,e){if(i.length!==e.length)return!1;for(let t=0;t{"startPoint"in e?o.startPoint=e.startPoint:"endPoint"in e&&(o.endPoint=e.endPoint)};if(n==null)h(),d!=null&&c!=null&&(o.measureType=c.measureType,o.orientation=c.orientation);else switch(o.measureType=E.Direct,n){case B.Horizontal:if(n!==d&&(o.orientation=0),"startPoint"in e){const m=e.startPoint;m!=null&&(m.z=r.z),o.startPoint=m}else if("endPoint"in e){const m=e.endPoint;m!=null&&(m.z=s.z),o.endPoint=m}break;case B.Vertical:if(n!==d&&(o.orientation=ss(a,l)),"startPoint"in e){const m=e.startPoint;m!=null&&(m.x=r.x,m.y=r.y),o.startPoint=m}else if("endPoint"in e){const m=e.endPoint;m!=null&&(m.x=s.x,m.y=s.y),o.endPoint=m}break;case B.Direct:n!==d&&c!=null&&(o.orientation=c.orientation),h()}i.previousConstraint=n,i.unconstrainedGeometry=a}(function(i){i[i.Horizontal=0]="Horizontal",i[i.Vertical=1]="Vertical",i[i.Direct=2]="Direct"})(B||(B={}));let mo=class extends Bn{constructor(e){super(e),this._ray=ar(),this._isWorldDown=!1,this._start=g(),this._end=N(1,0,0),this._width=1,this._color=zt(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=zt(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=X.LINE,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=x.OccludeAndTransparent,this._fadedExtensions=hn,this._laserline=new ha({view:this.view}),this.applyProps(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:t=>this._createObject3DResources(t),destroyResources:t=>this._destroyExternalResources(t),recreateGeometry:(t,n)=>this._recreateObject3DGeometry(t,n),cameraChanged:()=>this._updateGeometry()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:t=>this._destroyExternalResources(t),recreateGeometry:t=>this._recreateDrapedGeometry(t)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(e){this._isWorldDown=!0,L(this._start,e),this.view.renderCoordsHelper.worldUpAtPosition(e,this._end),Ye(this._end,e,this._end),Kt(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(e){this._isWorldDown=!1,M(this._start,e)||(L(this._start,e),Kt(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(e){this._isWorldDown=!1,M(this._end,e)||(L(this._end,e),Kt(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){Ne(e,this._color)||(ct(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){Ne(e,this._innerColor)||(ct(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=e!=null!=(this._stipplePattern!=null);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e!=null&&this._stippleOffColor!=null&&Ne(e,this._stippleOffColor)||(this._stippleOffColor=e!=null?Tn(e):null,this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this.recreateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&this._laserlineStyle!=null&&this.attached&&!this.isDraped}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,e!=null&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===x.OccludeAndTransparentStencil?x.OccludeAndTransparent:this._renderOccluded}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=e??hn,this.recreateGeometry()}_updateMaterial(){var t,n;const{materialParameters:e}=this;(t=this.object3dResources.resources)==null||t.material.setParameters(e),(n=this.drapedResources.resources)==null||n.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,hasPolygonOffset:this._polygonOffset,renderOccluded:this._normalizedRenderOccluded,writeDepth:this._writeDepthEnabled}}_createObject3DResources(e){const t=new le(this.materialParameters),n=new Array;return this._createObject3DGeometry(t,e,n),{material:t,geometries:n,forEach:s=>{s(t),n.forEach(s)}}}_destroyExternalResources(e){e.geometries=[],e.material.dispose()}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,n){const s=this._createGeometry(e);n.push(s),t.addGeometry(s),this._updateVerticesObject3D(t)}_createDrapedResources(){const e=new le(this.materialParameters);return{material:e,geometries:[this._createDrapedGeometry(e)]}}_recreateDrapedGeometry(e){e.geometries=[this._createDrapedGeometry(e.material)]}_createDrapedGeometry(e){const t=this._createGeometry(e);return this._updateVerticesDraped(t),new Rn(t)}_createGeometry(e){const t=this.extensionType===X.FADED,n=t?[g(),g(),g(),g()]:[g(),g()];return Ue(e,n,null,t?[1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]:null)}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{const e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){const t=this._lineSegment;this._updateVertexAttributesObject3D(e,t),this._laserline.intersectsLine=t}_updateVerticesDraped(e){this._updateVertexAttributesDraped(e,this._lineSegment)}get _lineSegment(){return this._extensionType===X.FADED?this._updateLineSegmentFinite(cn):this._updateLineSegmentInfinite(this._extensionType,cn)}_updateLineSegmentFinite(e){return Qi(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){const n=this.view.state.camera;switch(or(this._ray,pe),e){case X.LINE:pe.c0=-Number.MAX_VALUE;break;case X.RAY:case X.GROUND_RAY:{const a=this._ray.origin,l=this.view.elevationProvider.getElevation(a[0],a[1],a[2],this.view.renderCoordsHelper.spatialReference,"ground")??0,o=this.view.renderCoordsHelper.getAltitude(a);this._isWorldDown&&othis._createObject3DResources(t),destroyResources:t=>this._destroyObject3DResources(t),recreateGeometry:(t,n)=>this._recreateObject3DGeometry(t,n),cameraChanged:()=>this._updateGeometry()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:t=>this._destroyDrapedResources(t),recreateGeometry:t=>this._recreateDrapedGeometry(t)}}get location(){return this._location}set location(e){M(this._location,e)||(L(this._location,e),this._updateGeometry())}get direction(){return this._direction}set direction(e){M(this._direction,e)||(L(this._direction,e),this._updateGeometry())}setDirectionFromPoints(e,t){En(this._direction,Ye(this._direction,t,e)),this._updateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get offset(){return this._offset}set offset(e){e!==this._offset&&(this._offset=e,this._updateGeometry())}get length(){return this._length}set length(e){e!==this._length&&(this._length=e,this._updateGeometry())}get color(){return this._color}set color(e){Ne(e,this._color)||(ct(this._color,e),this._updateMaterial())}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}_createObject3DResources(e){const t=new le(this.materialParameters),n=new Array;return this._createObject3DGeometry(t,e,n),{material:t,geometries:n,forEach:s=>{s(t),n.forEach(s)}}}_destroyObject3DResources(e){e.geometries.length=0,e.material.dispose()}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,n){const[s,r]=this._createGeometries(e);t.addGeometry(s),t.addGeometry(r),n.push(s),n.push(r),this._updateVerticesObject3D(t)}_createDrapedResources(){const e=new le(this.materialParameters),t=S(()=>this.view.state.contentPixelRatio,()=>{this.drapedResources.recreateGeometry()});return{material:e,geometries:this._createDrapedGeometry(e),pixelRatioHandle:t}}_destroyDrapedResources(e){e.pixelRatioHandle.remove(),e.geometries=[],e.material.dispose()}_recreateDrapedGeometry(e){e.geometries=this._createDrapedGeometry(e.material)}_createDrapedGeometry(e){const t=this._createGeometries(e);return this._updateVerticesDraped(t),t.map(n=>new Rn(n))}_createGeometries(e){return[Ue(e,[g(),g()]),Ue(e,[g(),g()])]}_updateMaterial(){var t,n;const{materialParameters:e}=this;(t=this.object3dResources.resources)==null||t.material.setParameters(e),(n=this.drapedResources.resources)==null||n.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,renderOccluded:this._renderOccluded}}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{const e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){const t=this.view.state.camera;t.projectToScreen(this.location,$t),Dn(ie,this.location,this.direction),t.projectToScreen(ie,Le),hr(Le,re(Le,Le,$t)),this._updateVertexAttributesObject3D(t,e,0,$t,Le,1),this._updateVertexAttributesObject3D(t,e,1,$t,Le,-1)}_updateVertexAttributesObject3D(e,t,n,s,r,a){var h;const l=t.geometries[n],o=(h=l.getMutableAttribute(Ht.POSITION))==null?void 0:h.data;if(!o)return;const{start:d,end:c}=this._computeStartEnd(r,s,a,this.offset,this.width,this.length);e.unprojectFromScreen(Ki(d),ie),o[0]=ie[0],o[1]=ie[1],o[2]=ie[2],e.unprojectFromScreen(Ki(c),ie),o[3]=ie[0],o[4]=ie[1],o[5]=ie[2],t.geometryVertexAttrsUpdated(l)}_updateVerticesDraped(e){const{view:{basemapTerrain:{overlayManager:t},state:{contentPixelRatio:n}}}=this,{location:s,width:r,length:a,offset:l}=this,o=_o;o.spatialReference=t.renderer.spatialReference,o.x=s[0],o.y=s[1];const d=t.overlayPixelSizeInMapUnits(o)*n,c=r*d,h=a*d,m=l*d;this._updateVertexAttributesDraped(e[0],c,h,m,-1),this._updateVertexAttributesDraped(e[1],c,h,m,1)}_updateVertexAttributesDraped(e,t,n,s,r){var h;const a=(h=e.getMutableAttribute(Ht.POSITION))==null?void 0:h.data;if(!a)return;const{location:l,direction:o}=this,{start:d,end:c}=this._computeStartEnd(o,l,r,s,t,n);a[0]=d[0],a[1]=d[1],a[2]=ui,a[3]=c[0],a[4]=c[1],a[5]=ui,e.invalidateBoundingInfo()}_computeStartEnd(e,t,n,s,r,a){const l=Jt(pn,pr(pn,e[1]*n,e[0]*-n),s+r/2),o=vt(Et,vt(Et,vt(Et,t,Jt(Et,e,a/2)),l),l);return{start:o,end:vt(mn,o,Jt(mn,e,-a))}}};const ie=g(),pn=ee(),Et=ee(),mn=ee(),$t=An(),Le=An(),_o=ge(0,0,void 0,null);let Q=class extends Ln{constructor(){super(...arguments),this.enabled=!0}};u([p({type:Boolean})],Q.prototype,"enabled",void 0),Q=u([H("esri.views.interactive.snapping.Settings.DefaultSnappingAlgorithm")],Q);let P=class extends Ln{constructor(e){super(e),this.lineSnapper=new Q,this.parallelLineSnapper=new Q,this.rightAngleSnapper=new Q,this.rightAngleTriangleSnapper=new Q,this.shortLineThreshold=15,this.distance=5,this.pointThreshold=1e-6,this.intersectionParallelLineThreshold=1e-6,this.parallelLineThreshold=1e-6,this.verticalLineThreshold=.1,this.touchSensitivityMultiplier=1.5,this.pointOnLineThreshold=1e-6,this.orange=new W([255,127,0]),this.orangeTransparent=new W([255,127,0,.5]),this.lineHintWidthReference=3,this.lineHintWidthTarget=3,this.lineHintFadedExtensions=.3,this.parallelLineHintWidth=2,this.parallelLineHintLength=24,this.parallelLineHintOffset=1.5,this.rightAngleHintSize=24,this.rightAngleHintOutlineSize=1.5,this.satisfiesConstraintScreenThreshold=1}};u([p({type:Q,constructOnly:!0,nonNullable:!0,json:{write:!0}})],P.prototype,"lineSnapper",void 0),u([p({type:Q,constructOnly:!0,nonNullable:!0,json:{write:!0}})],P.prototype,"parallelLineSnapper",void 0),u([p({type:Q,constructOnly:!0,nonNullable:!0,json:{write:!0}})],P.prototype,"rightAngleSnapper",void 0),u([p({type:Q,constructOnly:!0,nonNullable:!0,json:{write:!0}})],P.prototype,"rightAngleTriangleSnapper",void 0),u([p({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],P.prototype,"shortLineThreshold",void 0),u([p({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],P.prototype,"distance",void 0),u([p({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],P.prototype,"pointThreshold",void 0),u([p({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],P.prototype,"intersectionParallelLineThreshold",void 0),u([p({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],P.prototype,"parallelLineThreshold",void 0),u([p({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],P.prototype,"verticalLineThreshold",void 0),u([p({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],P.prototype,"touchSensitivityMultiplier",void 0),u([p({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],P.prototype,"pointOnLineThreshold",void 0),u([p({type:W,nonNullable:!0})],P.prototype,"orange",void 0),u([p({type:W,nonNullable:!0})],P.prototype,"orangeTransparent",void 0),u([p({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],P.prototype,"lineHintWidthReference",void 0),u([p({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],P.prototype,"lineHintWidthTarget",void 0),u([p({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],P.prototype,"lineHintFadedExtensions",void 0),u([p({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],P.prototype,"parallelLineHintWidth",void 0),u([p({type:Number,nonNullable:!0,range:{min:0,max:50},json:{write:!0}})],P.prototype,"parallelLineHintLength",void 0),u([p({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],P.prototype,"parallelLineHintOffset",void 0),u([p({type:Number,nonNullable:!0,range:{min:0,max:46},json:{write:!0}})],P.prototype,"rightAngleHintSize",void 0),u([p({type:Number,nonNullable:!0,range:{min:0,max:6},json:{write:!0}})],P.prototype,"rightAngleHintOutlineSize",void 0),u([p({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],P.prototype,"satisfiesConstraintScreenThreshold",void 0),P=u([H("esri.views.interactive.snapping.Settings.Defaults")],P);const O=new P;var A;(function(i){i[i.FEATURE=1]="FEATURE",i[i.SELF=2]="SELF",i[i.ALL=3]="ALL"})(A||(A={}));function Ql(i){return i}function cs(i){return _e(i)}function yo(i,e,t){return N(i,e,t)}function b(i,e,t){return i==null?null:nt(t.coordinateHelper.vectorToDehydratedPoint(i,vo),e,t)}function nt(i,e,t){if(i==null)return null;if(e==null)return N(i.x,i.y,i.z??0);if(e.type==="2d")return N(i.x,i.y,0);const{elevationInfo:n}=t,s=da(e,i,n,C)??0;return N(i.x,i.y,s)}function fn(i,e,{z:t,m:n,spatialReference:s,elevationInfo:r}){if(t==null&&n==null){const o=ge(i[0],i[1],void 0,s);return n!=null&&(o.m=n,o.hasM=!0),o}if(e==null||e.type==="2d"){const o=ge(i[0],i[1],t,s);return n!=null&&(o.m=n,o.hasM=!0),o}const a=ca(e,i,s,C,r)??0,l=ge(i[0],i[1],a,s);return n!=null&&(l.m=n,l.hasM=!0),l}function gn(i,e){return ge(i[0],i[1],i[2],e)}const vo=ge(0,0,0,null),_n={redo:"r",undo:"z",center:"Alt",constraint:"Shift",cancel:"Escape",delete:["Backspace","Delete"],complete:"Enter",vertexAdd:"f",pan:" "},yn={toggle:"Control"};function Te(i,e){const t=i.x-e.x,n=i.y-e.y;return t*t+n*n}function So(i,e){return Math.sqrt(Te(i,e))}function zi(i,e){e.sort((t,n)=>hi(t.targetPoint,i)-hi(n.targetPoint,i))}var F;function Kl({point:i,distance:e,returnEdge:t,returnVertex:n,coordinateHelper:{spatialReference:s}},r,a){return{point:ge(i[0],i[1],i[2],s.toJSON()),mode:r,distance:e,returnEdge:t,returnVertex:n,query:a!=null?a.toJSON():{where:"1=1"}}}function Nt(i,e,t){return{left:b(i.leftVertex.pos,e,t),right:b(i.rightVertex.pos,e,t)}}function Jl(i){return i.createQuery()}function wo(i,e=()=>{}){const t=S(()=>({view:i.view,snappingOptions:i.snappingOptions}),({view:n,snappingOptions:s})=>{const r="snapping-toggle",a=mr.TOOL;if(i.removeHandles(r),n&&s!=null){const l=[n.on("key-down",o=>{o.key!==yn.toggle||o.repeat||(s.enabledToggled=!0,e())},a),n.on("key-up",o=>{o.key===yn.toggle&&(s.enabledToggled=!1,e())},a),n.on("pointer-move",o=>{const d=o.native.ctrlKey;s.enabledToggled!==d&&(s.enabledToggled=d,e())},a)];i.addHandles(l,r)}},G);i.addHandles(t)}(function(i){i[i.TARGET=0]="TARGET",i[i.REFERENCE=1]="REFERENCE",i[i.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"})(F||(F={}));let yt=class{constructor(e,t){this.isDraped=e,this.domain=t}},us=class hs extends yt{constructor(e,t,n=A.ALL){super(t,n),this.intersectionPoint=e}equals(e){return e instanceof hs&&M(this.intersectionPoint,e.intersectionPoint)}},Z=class ps extends yt{constructor(e,t,n,s,r=A.ALL,a=!0,l=!0){super(s,r),this.type=e,this.lineStart=t,this.lineEnd=n,this.fadeLeft=a,this.fadeRight=l}equals(e){return e instanceof ps&&this.type===e.type&&M(this.lineStart,e.lineStart)&&M(this.lineEnd,e.lineEnd)&&this.fadeLeft===e.fadeLeft&&this.fadeRight===e.fadeRight}get length(){return At(this.lineStart,this.lineEnd)}},ms=class fs extends yt{constructor(e,t,n,s=A.ALL){super(n,s),this.lineStart=e,this.lineEnd=t}equals(e){return e instanceof fs&&M(this.lineStart,e.lineStart)&&M(this.lineEnd,e.lineEnd)}},Po=class gs extends yt{constructor(e,t,n){super(t,n),this.point=e}equals(e){return e instanceof gs&&M(this.point,e.point)}},Hi=class _s extends yt{constructor(e,t,n,s,r=A.ALL){super(s,r),this.previousVertex=e,this.centerVertex=t,this.nextVertex=n}equals(e){return e instanceof _s&&M(this.previousVertex,e.previousVertex)&&M(this.centerVertex,e.centerVertex)&&M(this.nextVertex,e.nextVertex)}},xo=class{draw(e,t){const n=this._getUniqueHints(e),s=this.sortUniqueHints(n),r=[];for(const a of s)a instanceof us&&r.push(this.visualizeIntersectionPoint(a,t)),a instanceof Z&&r.push(this.visualizeLine(a,t)),a instanceof ms&&r.push(this.visualizeParallelSign(a,t)),a instanceof Hi&&r.push(this.visualizeRightAngleQuad(a,t)),a instanceof Po&&r.push(this.visualizePoint(a,t));return fr(r)}sortUniqueHints(e){return e}_getUniqueHints(e){const t=[];for(const n of e){let s=!0;for(const r of t)if(n.equals(r)){s=!1;break}s&&t.push(n)}return t}},bo=class extends xo{sortUniqueHints(e){return e.sort((t,n)=>(n instanceof Z?n.length:0)-(t instanceof Z?t.length:0))}visualizeIntersectionPoint(e,t){const{spatialReference:n,view:s}=t,r=tt();return ze(new an({view:s,primitive:"circle",geometry:gn(e.intersectionPoint,n),elevationInfo:e.isDraped?Zn:C,size:20,outlineSize:2,color:r.intersectionPointColor,outlineColor:r.intersectionPointOutlineColor,pixelSnappingEnabled:!1}))}visualizePoint(e,t){const{view:n,spatialReference:s}=t,r=tt(),a=me(e.point,e.domain,t);return ze(new an({view:n,primitive:"circle",geometry:gn(a,s),elevationInfo:Ct(e,t),size:20,outlineSize:2,color:r.pointColor,outlineColor:r.pointOutlineColor,pixelSnappingEnabled:!1}))}visualizeLine(e,t){const{view:n,spatialReference:s}=t,r=tt(),a=me(e.lineStart,e.domain,t),l=me(e.lineEnd,e.domain,t);return ze(this._createLineSegmentHint(e.type,a,l,s,Ct(e,t),n,r,e.isDraped,e.fadeLeft,e.fadeRight))}visualizeParallelSign(e,t){const{view:n,spatialReference:s}=t,r=tt(),{isDraped:a}=e,l=Ct(e,t),o=me(e.lineStart,e.domain,t),d=me(e.lineEnd,e.domain,t),c=ve(o,s,l,n,a),h=ve(d,s,l,n,a),m=zn(h,c,h,.5),f=new go({view:n,attached:!1,offset:O.parallelLineHintOffset,length:O.parallelLineHintLength,width:O.parallelLineHintWidth,color:r.parallelSignColor,location:m,renderOccluded:a?x.OccludeAndTransparent:x.Opaque,isDraped:a,renderGroup:ei.SnappingHint});return f.setDirectionFromPoints(c,m),f.attached=!0,ze(f)}visualizeRightAngleQuad(e,t){const{view:n,spatialReference:s}=t,r=tt(),a=Ct(e,t),{isDraped:l}=e,o=me(e.previousVertex,e.domain,t),d=me(e.centerVertex,e.domain,t),c=me(e.nextVertex,e.domain,t),h=ve(o,s,a,n,l),m=ve(d,s,a,n,l),f=ve(c,s,a,n,l);return ze(new ua({view:n,attached:!0,color:l?r.rightAngleColorDraped:r.rightAngleColor,renderOccluded:l?x.OccludeAndTransparent:x.Transparent,outlineRenderOccluded:l?x.OccludeAndTransparent:x.Opaque,outlineColor:r.rightAngleOutlineColor,outlineSize:O.rightAngleHintOutlineSize,size:O.rightAngleHintSize,isDraped:l,geometry:{previous:h,center:m,next:f},renderGroup:ei.SnappingHint}))}_createLineSegmentHint(e,t,n,s,r,a,l,o=!1,d=!0,c=!0){const h=ve(t,s,r,a,o),m=ve(n,s,r,a,o),f=new mo({view:a,extensionType:X.FADED,start:h,end:m,isDraped:o,color:l.lineColor,renderOccluded:o?x.OccludeAndTransparent:x.Opaque,renderGroup:ei.SnappingHint});switch(e){case F.TARGET:f.width=O.lineHintWidthTarget,f.fadedExtensions={start:0,end:O.lineHintFadedExtensions};break;case F.REFERENCE_EXTENSION:f.width=O.lineHintWidthReference,f.fadedExtensions={start:0,end:0};break;case F.REFERENCE:f.width=O.lineHintWidthReference,f.fadedExtensions={start:d?O.lineHintFadedExtensions:0,end:c?O.lineHintFadedExtensions:0}}return f.attached=!0,f}};function tt(i){const e=W.toUnitRGBA(Ze()),t=[0,0,0,0];return{intersectionPointColor:t,intersectionPointOutlineColor:e,pointColor:t,pointOutlineColor:e,lineColor:e,lineOutlineColor:void 0,parallelSignColor:e,rightAngleColor:e,rightAngleColorDraped:W.toUnitRGBA(Ze(.5)),rightAngleOutlineColor:e}}function me(i,e,t){const n=ys(e,t);return n==null?i:yo(i[0],i[1],n)}function Ct(i,e){return ys(i.domain,e)!=null?e.selfSnappingZ.elevationInfo:i.isDraped?Zn:C}function ys(i,{selfSnappingZ:e}){return i===A.SELF&&e!=null?e.value:null}function ve(i,e,t,n,s,r=g()){if(s){const a=n.basemapTerrain.overlayManager.renderer.spatialReference;Dt(i,e,r,a)}else Xr(i,e,t,n,r);return r}function Mo(i,e,t,n,s){const r=Ji(3*i.length),a=Ji(r.length);i.forEach((d,c)=>{r[3*c]=d[0],r[3*c+1]=d[1],r[3*c+2]=d.length>2?d[2]:0});const l=gr(r,e,0,a,0,r,0,r.length/3,t,n,s),o=l!=null;return{numVertices:i.length,position:r,mapPositions:a,projectionSuccess:o,sampledElevation:l}}let Eo=class extends kn{constructor(e){super(e),this.view=null,this._renderOccluded=x.OccludeAndTransparent,this._vertices=null,this._spatialReference=null,this._color=en([1,127/255,0,1]),this._size=11,this._outlineColor=en([0,0,0,.5]),this._outlineSize=1,this._elevationInfo=null,this.applyProps(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial(),this._updateOutlineMaterial())}get vertices(){return this._vertices}set vertices(e){this._vertices=e,this.recreateGeometry()}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.recreateGeometry()}get color(){return this._color}set color(e){Ne(e,this._color)||(ct(this._color,e),this._updateMaterial())}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateMaterial())}get outlineColor(){return this._outlineColor}set outlineColor(e){Ne(e,this._outlineColor)||(ct(this._outlineColor,e),this._updateOutlineMaterial())}get outlineSize(){return this._outlineSize}set outlineSize(e){e!==this._outlineSize&&(this._outlineSize=e,this._updateOutlineMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}get _vertexMaterialParameters(){return{color:this._color,transparent:this._color[3]<1,screenSizeScale:this.size,renderOccluded:this._renderOccluded}}get _vertexOutlineMaterialParameters(){return{color:this._outlineColor,transparent:this._outlineColor[3]<1,screenSizeScale:this.size+2*this.outlineSize,renderOccluded:this._renderOccluded}}_updateMaterial(){this.attached&&this._vertexMaterial.setParameters(this._vertexMaterialParameters)}_updateOutlineMaterial(){this.attached&&this._vertexOutlineMaterial.setParameters(this._vertexOutlineMaterialParameters)}_createRenderGeometries(){const e=this.vertices;if(e==null||e.length===0)return[];const t=.5,n=.5,s=Mo(e,this.spatialReference,this.view.elevationProvider,this.view.renderCoordsHelper,_r.fromElevationInfo(this.elevationInfo)),r=[],a=s.numVertices,l=s.position;for(let o=0;o{var n,s;return((s=(n=i.map)==null?void 0:n.allLayers)==null?void 0:s.toArray())??[]},n=>{t.featureSources=new Xe(n.map(s=>new vs({layer:s,enabled:!0})))},Vt),options:t}}function yi({start:i,end:e,type:t},n,s){const r=[],a=re(Re,e,i),l=re(Qe,i,n),o=ut(a),d=2*gt(a,l),c=d*d-4*o*(ut(l)-s*s);if(c===0){const h=-d/(2*o);(t===te.PLANE||h>=0)&&r.push(at(ee(),i,a,h))}else if(c>0){const h=Math.sqrt(c),m=(-d+h)/(2*o);(t===te.PLANE||m>=0)&&r.push(at(ee(),i,a,m));const f=(-d-h)/(2*o);(t===te.PLANE||f>=0)&&r.push(at(ee(),i,a,f))}return r}function vi(i,e){const t=i.start,n=i.end,s=re(Re,n,t),r=ce(Qe,-s[1],s[0],0),a=e.start,l=e.end,o=R(Gi,l,a),d=D(o,r),c=ce(bs,t[0],t[1],0),h=R(Ms,c,a),m=D(h,r);if(Math.abs(d)=0)&&r.push(J(g(),i,a,h))}else if(c>0){const h=Math.sqrt(c),m=(-d+h)/(2*o);(t===I.LINE||m>=0)&&r.push(J(g(),i,a,m));const f=(-d-h)/(2*o);(t===I.LINE||f>=0)&&r.push(J(g(),i,a,f))}return r}function xs(i,e){const t=i.start,n=i.end,s=e.start,r=e.end,a=R(Re,n,t),l=R(Qe,r,s),o=R(Gi,s,t),d=ne(bs,a,l),c=D(o,d);if(!pi(c,0,K))return[];const h=mi(d);if(pi(h,0,K))return[];const m=ne(Ms,o,l),f=D(m,d)/h,_=J(Es,t,a,f);if(i.type===I.RAY){const v=R(qt,_,t);if(D(a,v)<-K)return[]}if(e.type===I.RAY){const v=R(qt,_,s);if(D(l,v)<-K)return[]}return[_e(_)]}function wi({start:i,end:e,type:t},n){const s=R(Re,n,i),r=R(Qe,e,i),a=ne(Gi,r,s);if(mi(a)/mi(r)0?n:t}};class Ts extends Fi{constructor(e,t){super(e,t,te.HALF_PLANE)}}let Rs=class extends Fi{constructor(e,t){super(e,t,te.PLANE)}};class Ds extends De{constructor(e,t,n){super(),this.start=e,this.end=t,this.getZ=n,this.planeLike={start:e,end:t,type:te.PLANE}}equals(e){return $e(e)&&M(this.start,e.start)&&M(this.end,e.end)&&this.getZ===e.getZ}closestTo(e){return Lo(this,e)}addIfOnTheGround(e,t){for(const n of t){const s=this.getZ(n[0],n[1],n[2])??0;Math.abs(n[2]-s)new si(r,i,e));$e(e)&&(t=it(e,i))}}else if(Ee(i)){const{planeLike:n}=i;if(Ee(e))return ws(n,e.planeLike).map(s=>new si(s,i,e));if(Ve(e))t=Si(n,e.point);else if(Me(e))t=vi(n,e.lineLike);else{if(Ge(e))return yi(n,e.center,e.radius).map(s=>new si(s,i,e));$e(e)&&(t=it(e,i))}}else $e(i)&&(t=it(i,e));return Ho(t,i,e)}function it(i,e){const{planeLike:t,getZ:n}=i,s=[];if(Ve(e))i.addIfOnTheGround(s,Si(t,e.point));else if(Me(e))i.addIfOnTheGround(s,vi(t,e.lineLike));else if(Ge(e))for(const[r,a]of yi(t,e.center,e.radius)){const l=n(r,a,0);l!=null&&s.push(N(r,a,l))}else if(Ee(e)||$e(e))for(const[r,a]of ws(t,e.planeLike)){const l=n(r,a,0)??As;s.push(N(r,a,l))}return s}function Ho(i,e,t){return i.map(n=>new Bt(n,e,t))}function Ve(i){return i instanceof Do}function Me(i){return i instanceof $s}function Ge(i){return i instanceof Os}function Ee(i){return i instanceof Fi}function $e(i){return i instanceof Ds}const Vo=ee(),Go=ee(),As=0;let Ke=class{constructor(e,t,n,s){this.targetPoint=e,this.constraint=t,this.isDraped=n,this.domain=s}},ki=class extends Ke{constructor({targetPoint:e,objectId:t,constraint:n,isDraped:s}){super(e,n,s,A.FEATURE),this.objectId=t}},Io=class extends ki{constructor(e){super({...e,isDraped:!0,constraint:new Ds(e.edgeStart,e.edgeEnd,e.getGroundElevation)})}get hints(){return[new Z(F.REFERENCE,this.constraint.start,this.constraint.end,this.isDraped,this.domain)]}},Fo=class extends ki{constructor(e){super({...e,constraint:new Ao(e.edgeStart,e.edgeEnd)})}get hints(){return[new Z(F.REFERENCE,this.constraint.start,this.constraint.end,this.isDraped,this.domain)]}},Ls=class extends Ke{constructor({targetPoint:e,constraint:t,previousVertex:n,otherVertex:s,otherVertexType:r,objectId:a,isDraped:l}){super(e,t,l,A.SELF),this.previousVertex=n,this.otherVertex=s,this.otherVertexType=r,this.objectId=a}get hints(){const e=this.previousVertex,t=this.otherVertexType===Be.CENTER?this.otherVertex:this.targetPoint,n=this.otherVertexType===Be.CENTER?this.targetPoint:this.otherVertex;return[new Z(F.TARGET,t,n,this.isDraped,this.domain),new Z(F.REFERENCE,e,t,this.isDraped,this.domain),new Hi(this.previousVertex,t,n,this.isDraped,this.domain)]}};var Be;(function(i){i[i.NEXT=0]="NEXT",i[i.CENTER=1]="CENTER"})(Be||(Be={}));let ae=class extends bi{get updating(){return Pr(this.snappingSources,({snappingSource:i})=>i.updating)||this.updatingHandles.updating}get snappingSources(){const i=this._get("snappingSources")||new Map,e=new Map;if(this.options!=null&&this.options.featureSources!=null)for(const t of this.options.featureSources.items){const n=t.layer.uid,s=i.get(n);if(s){i.delete(n),e.set(n,s);continue}if(!t.layer.loaded){this.updatingHandles.addPromise(t.layer.load());continue}const r=this._createSourceInfo(t);r!=null&&e.set(n,r)}for(const[,t]of i)t.destroy();return e}constructor(i){super(i),this.options=null,this._domain=A.FEATURE,this._sourceModules={featureService:{module:null,loader:null},featureCollection:{module:null,loader:null},graphics:{module:null,loader:null},notes:{module:null,loader:null},scene:{module:null,loader:null}}}initialize(){this.updatingHandles.add(()=>this.snappingSources,()=>this.notifyChange("updating"),We),this.view!=null&&this.handles.add([this.view.on("layerview-create",i=>this._updateLayerView(i.layer,i.layerView)),this.view.on("layerview-destroy",i=>this._updateLayerView(i.layer,null))])}_updateLayerView(i,e){for(const[,t]of this.snappingSources)t.snappingSource.layerSource.layer===i&&(t.layerView=e)}destroy(){this._set("options",null);for(const[,i]of this.snappingSources)i.destroy()}async fetchCandidates(i,e,t,n){var o;if(!(e&this._domain&&this.options!=null&&this.options.effectiveFeatureEnabled))return[];const s=[],r=this._computeScreenSizeDistanceParameters(i,t),a={distance:r,mode:((o=this.view)==null?void 0:o.type)??"2d",point:i,coordinateHelper:t.coordinateHelper,...this._types};for(const[,{snappingSource:d,layerView:c}]of this.snappingSources)!d.layerSource.enabled||c!=null&&c.suspended||s.push(d.fetchCandidates(a,n).then(h=>h.filter(m=>!this._candidateIsExcluded(d,m,t.excludeFeature))));const l=(await xr(s)).flat();return this._addRightAngleCandidates(l,i,r,t),br(n),zi(i,l),l}_addRightAngleCandidates(i,e,t,n){var c,h,m,f,_,v,y,T;const s=n.vertexHandle!=null?(h=(c=n.vertexHandle.rightEdge)==null?void 0:c.rightVertex)==null?void 0:h.pos:n.editGeometryOperations!=null&&n.editGeometryOperations.data.type==="polygon"?(f=(m=n.editGeometryOperations.data.components[0])==null?void 0:m.getFirstVertex())==null?void 0:f.pos:null,r=n.vertexHandle!=null?(v=(_=n.vertexHandle.leftEdge)==null?void 0:_.leftVertex)==null?void 0:v.pos:n.editGeometryOperations!=null?(T=(y=n.editGeometryOperations.data.components[0])==null?void 0:y.getLastVertex())==null?void 0:T.pos:null,{view:a}=this,l=b(s,a,n),o=b(r,a,n),d=i.length;for(let he=0;heCe(r,d)?o:d,constraint:new Ts(e,r),objectId:i.objectId,isDraped:i.isDraped});s.push(c)}}_computeScreenSizeDistanceParameters(i,e){let t=this.options!=null?this.options.distance*(e.pointer==="touch"?this.options.touchSensitivityMultiplier:1):0;return this.view==null?{x:t,y:t,z:t,distance:t}:this.view.type==="2d"?(t*=this.view.resolution,{x:t,y:t,z:t,distance:t}):this._computeScreenSizeDistanceParameters3D(i,t,this.view,e)}_computeScreenSizeDistanceParameters3D(i,e,t,n){const{spatialReference:s}=n;t.renderCoordsHelper.toRenderCoords(i,s,Pn);const r=t.state.camera.computeScreenPixelSizeAt(Pn),a=r*t.renderCoordsHelper.unitInMeters/t.mapCoordsHelper.unitInMeters,l=e*a,o=z(i,s,C,t),d=o?ri(o,i,a,0,0,t,n):0,c=o?ri(o,i,0,a,0,t,n):0,h=o?ri(o,i,0,0,a,t,n):0;return{x:d===0?0:l/d,y:c===0?0:l/c,z:h===0?0:l/h,distance:r*e}}get _types(){return{returnEdge:!0,returnVertex:!0}}_candidateIsExcluded(i,e,t){if(t==null)return!1;const n=this._getCandidateObjectId(e);if(n==null)return!1;const s=i.layerSource.layer;return s.type==="graphics"?t.uid===n:t.sourceLayer===s&&!(!t.attributes||!("objectIdField"in s))&&t.attributes[s.objectIdField]===n}_getCandidateObjectId(i){return i instanceof ki?i.objectId:null}_createSourceInfo(i){const e=this._createFeatureSnappingSourceType(i);if(e==null)return null;if("loading"in e)return this.updatingHandles.addPromise(e.loading.then(()=>{this.destroyed||this.notifyChange("snappingSources")})),null;const t=this.view!=null?this.view.allLayerViews.find(n=>n.layer===i.layer):null;return new ko(e.source,t)}_createFeatureSnappingSourceType(i){switch(i.layer.type){case"feature":case"geojson":case"csv":case"oriented-imagery":case"subtype-group":case"wfs":return this._createFeatureSnappingSourceFeatureLayer(i);case"graphics":return this._createFeatureSnappingSourceGraphicsLayer(i);case"map-notes":return this._createFeatureSnappingSourceMapNotesLayer(i);case"scene":case"building-scene":return this._createFeatureSnappingSourceSceneLayer(i)}return null}_createFeatureSnappingSourceSceneLayer(i){const{view:e}=this;if(e==null||e.type!=="3d")return null;const t=this._getSourceModule("scene");return t.module!=null?{source:new t.module.SceneLayerSnappingSource({layerSource:i,view:e})}:{loading:t.loader}}_createFeatureSnappingSourceFeatureLayer(i){var e;switch((e=i.layer.source)==null?void 0:e.type){case"feature-layer":case"oriented-imagery":{const t=this._getSourceModule("featureService");return t.module!=null?{source:new t.module.FeatureServiceSnappingSource({spatialReference:this.spatialReference,view:this.view,layerSource:i})}:{loading:t.loader}}case"memory":case"csv":case"geojson":case"wfs":{if(i.layer.geometryType==="mesh")return null;const t=this._getSourceModule("featureCollection");return t.module!=null?{source:new t.module.FeatureCollectionSnappingSource({layerSource:i,view:this.view})}:{loading:t.loader}}}return null}_createFeatureSnappingSourceGraphicsLayer(i){const e=this._getSourceModule("graphics");return e.module!=null?{source:new e.module.GraphicsSnappingSource({getGraphicsLayers:()=>[i.layer],spatialReference:this.spatialReference,view:this.view,layerSource:i})}:{loading:e.loader}}_createFeatureSnappingSourceMapNotesLayer(i){const e=this._getSourceModule("notes");return e.module!=null?{source:new e.module.GraphicsSnappingSource({getGraphicsLayers:()=>i.layer.sublayers!=null?i.layer.sublayers.toArray():[],spatialReference:this.spatialReference,view:this.view,layerSource:i})}:{loading:e.loader}}_getSourceModule(i){const e=this._sourceModules[i];if(e.loader==null){const t=this._loadSourceModule(i).then(n=>{e.module=n});return e.loader=t,{module:e.module,loader:t}}return{module:e.module,loader:e.loader}}_loadSourceModule(i){const e=this.updatingHandles;switch(i){case"featureService":return e.addPromise(St(()=>import("./FeatureServiceSnappingSource-14e28ceb.js"),["assets/FeatureServiceSnappingSource-14e28ceb.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/elevationInfoUtils-4fd79d95.js","assets/queryEngineUtils-342680f6.js","assets/VertexSnappingCandidate-0a987e12.js","assets/TileTreeDebugger-142b9f39.js","assets/LineVisualElement-b605d10c.js","assets/LengthDimension-92faee98.js","assets/Segment-50129b50.js","assets/unitFormatUtils-b70a7bff.js","assets/analysisViewUtils-68ab721d.js","assets/ImageMaterial-5c48df66.js","assets/Factory-8e329f4b.js","assets/RightAngleQuadVisualElement-8daf0594.js","assets/VisualElementResources-e52972a5.js","assets/PointVisualElement-2a56e55d.js","assets/EditGeometryOperations-0ec3f5b5.js","assets/dehydratedFeatureComparison-a3375a3e.js"]));case"featureCollection":return e.addPromise(St(()=>import("./FeatureCollectionSnappingSource-3f1024ad.js"),["assets/FeatureCollectionSnappingSource-3f1024ad.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/elevationInfoUtils-4fd79d95.js","assets/queryEngineUtils-342680f6.js","assets/VertexSnappingCandidate-0a987e12.js","assets/symbologySnappingCandidates-816beafe.js","assets/LineVisualElement-b605d10c.js","assets/LengthDimension-92faee98.js","assets/Segment-50129b50.js","assets/unitFormatUtils-b70a7bff.js","assets/analysisViewUtils-68ab721d.js","assets/ImageMaterial-5c48df66.js","assets/Factory-8e329f4b.js","assets/RightAngleQuadVisualElement-8daf0594.js","assets/VisualElementResources-e52972a5.js","assets/PointVisualElement-2a56e55d.js","assets/EditGeometryOperations-0ec3f5b5.js","assets/dehydratedFeatureComparison-a3375a3e.js"]));case"graphics":case"notes":return e.addPromise(St(()=>import("./GraphicsSnappingSource-c09f0afd.js"),["assets/GraphicsSnappingSource-c09f0afd.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/normalizeUtilsSync-6be8435f.js","assets/normalizeUtilsCommon-500064b3.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FieldsIndex-f79a8f26.js","assets/elevationInfoUtils-4fd79d95.js","assets/queryEngineUtils-342680f6.js","assets/VertexSnappingCandidate-0a987e12.js","assets/symbologySnappingCandidates-816beafe.js","assets/LineVisualElement-b605d10c.js","assets/LengthDimension-92faee98.js","assets/Segment-50129b50.js","assets/unitFormatUtils-b70a7bff.js","assets/analysisViewUtils-68ab721d.js","assets/ImageMaterial-5c48df66.js","assets/Factory-8e329f4b.js","assets/RightAngleQuadVisualElement-8daf0594.js","assets/VisualElementResources-e52972a5.js","assets/PointVisualElement-2a56e55d.js","assets/EditGeometryOperations-0ec3f5b5.js","assets/dehydratedFeatureComparison-a3375a3e.js"]));case"scene":return e.addPromise(St(()=>import("./SceneLayerSnappingSource-176431c8.js"),["assets/SceneLayerSnappingSource-176431c8.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/VertexSnappingCandidate-0a987e12.js","assets/LineVisualElement-b605d10c.js","assets/LengthDimension-92faee98.js","assets/Segment-50129b50.js","assets/unitFormatUtils-b70a7bff.js","assets/elevationInfoUtils-4fd79d95.js","assets/analysisViewUtils-68ab721d.js","assets/ImageMaterial-5c48df66.js","assets/Factory-8e329f4b.js","assets/RightAngleQuadVisualElement-8daf0594.js","assets/VisualElementResources-e52972a5.js","assets/PointVisualElement-2a56e55d.js","assets/EditGeometryOperations-0ec3f5b5.js","assets/dehydratedFeatureComparison-a3375a3e.js"]))}}};u([p({constructOnly:!0})],ae.prototype,"spatialReference",void 0),u([p({constructOnly:!0})],ae.prototype,"view",void 0),u([p()],ae.prototype,"options",void 0),u([p({readOnly:!0})],ae.prototype,"updating",null),u([p({readOnly:!0})],ae.prototype,"snappingSources",null),ae=u([H("esri.views.interactive.snapping.FeatureSnappingEngine")],ae);class ko{constructor(e,t){this.snappingSource=e,this.layerView=t,this.handles=new Ut;const n=this.snappingSource.layerSource.layer;if("refresh"in n){const s=n;this.handles.add(s.on("refresh",()=>e.refresh()))}this.handles.add([S(()=>e.updating,s=>e.layerSource.updating=s,G),S(()=>e.availability,s=>e.layerSource.availability=s,G)])}destroy(){this.snappingSource.destroy(),this.handles.destroy()}}function No(i){return(i instanceof Fo||i instanceof Io)&&!jo(i)}function jo({constraint:{start:i,end:e}}){const t=hi(i,e),n=Ce(i,e);return tthis.squaredShortLineThreshold}isVertical(e,t){return Ce(e,t)new Z(F.REFERENCE,e.edge.left,e.edge.right,this.isDraped,this.domain,e.fadeLeft,e.fadeRight))]}addReferenceLine(e){const t={edge:e,fadeLeft:!0,fadeRight:!0};this._referenceLines.forEach(n=>{M(e.right,n.edge.left)&&(n.fadeLeft=!1,t.fadeRight=!1),M(e.right,n.edge.right)&&(n.fadeRight=!1,t.fadeRight=!1),M(e.left,n.edge.right)&&(n.fadeRight=!1,t.fadeLeft=!1),M(e.left,n.edge.left)&&(n.fadeLeft=!1,t.fadeLeft=!1)}),this._referenceLines.push(t)}},Yo=class extends Yt{snapNewVertex(e,t){const n=t.editGeometryOperations.data.components[0],s=n.edges.length,r=n.vertices.length,a=[];if(s<2)return a;const{view:l}=this,o=z(e,t.spatialReference,C,l),d=b(n.vertices[r-1].pos,l,t),c=b(n.vertices[0].pos,l,t),h=n.edges[s-1];let m=h;do{if(this.edgeExceedsShortLineThreshold(m,t)){const f=Nt(m,l,t);this._checkEdgeForParallelLines(f,d,e,o,t,a),this._checkEdgeForParallelLines(f,c,e,o,t,a)}m=m.leftVertex.leftEdge}while(m&&m!==h);return a}snapExistingVertex(e,t){const n=[],s=t.vertexHandle,r=s.component;if(r.edges.length<3)return n;const{view:a}=this,l=z(e,t.spatialReference,C,a),o=s.leftEdge,d=s.rightEdge,c=r.vertices[0],h=b(c.pos,a,t),m=r.vertices.length,f=r.vertices[m-1],_=b(f.pos,a,t),v=r.edges[0];let y=v;do{if(y!==o&&y!==d&&this.edgeExceedsShortLineThreshold(y,t)){const T=Nt(y,a,t);o&&this._checkEdgeForParallelLines(T,b(o.leftVertex.pos,a,t),e,l,t,n),d&&this._checkEdgeForParallelLines(T,b(d.rightVertex.pos,a,t),e,l,t,n),s===c?this._checkEdgeForParallelLines(T,_,e,l,t,n):s===f&&this._checkEdgeForParallelLines(T,h,e,l,t,n)}y=y.rightVertex.rightEdge}while(y&&y!==v);return n}_checkEdgeForParallelLines(e,t,n,s,r,a){var m;const l=e.left,o=e.right;if(ti(Se,t,l,o),Ce(Se,t){const{effectiveFeatureEnabled:e,effectiveSelfEnabled:t,touchSensitivityMultiplier:n,distance:s}=this.options;return{effectiveFeatureEnabled:e,effectiveSelfEnabled:t,touchSensitivityMultiplier:n,distance:s}},()=>{this.doneSnapping(),this.emit("changed")},We),S(()=>this.options,e=>{for(const t of this._engines)t.options=e},We),S(()=>({viewReady:this.view.ready,viewSpatialReference:this.view.spatialReference,snappingEnginesFactory:this.snappingEnginesFactory}),({viewReady:e,snappingEnginesFactory:t})=>this._recreateEngines(e,t),G)])}destroy(){this._destroyEngines()}get updating(){return this._engines.some(e=>e.updating)}_recreateEngines(e,t){if(this._destroyEngines(),!e)return;const{view:n,options:s}=this;this._engines=t(n,s)}_destroyEngines(){for(const e of this._engines)e.destroy();this._engines=[]}get _squaredMouseProximityTreshold(){return this.options.distance*this.options.distance}get _squaredTouchProximityThreshold(){const{distance:e,touchSensitivityMultiplier:t}=this.options,n=e*t;return n*n}get _squaredSatisfiesConstraintThreshold(){return O.satisfiesConstraintScreenThreshold*O.satisfiesConstraintScreenThreshold}async snap(e){return il(e)?this._snapMultiPoint(e):this._snapSinglePoint(e)}update(e){const{point:t,context:n}=e;this._removeVisualization();const s=this._currentMainCandidate;if(s==null)return t;const r=this._selectUpdateInput(e);if(r==null)return t;const{spatialReference:a}=n,l=nn(r,a);if(l==null)return t;const{view:o}=this,{elevationInfo:d,visualizer:c}=n,h=[],m=nt(l,o,n),f=s.constraint.closestTo(m);if(!this._arePointsWithinScreenThreshold(m,f,n))return this._resetSnappingState(),t;s.targetPoint=f,h.push(...s.hints);for(const _ of this._currentOtherActiveCandidates)_.targetPoint=f,h.push(..._.hints);return c!=null&&this.handles.add(c.draw(h,{spatialReference:a,elevationInfo:nl(n),view:o,selfSnappingZ:n.selfSnappingZ}),Rt),fn(f,o,{z:t.z,m:t.m,spatialReference:t.spatialReference,elevationInfo:d})}doneSnapping(){this._removeVisualization(),this._resetSnappingState()}_selectUpdateInput({point:e,scenePoint:t}){switch(this._currentSnappedType){case oe.MAIN:return e;case oe.SCENE:return t}}_resetSnappingState(){this._currentMainCandidate=null,this._currentOtherActiveCandidates=[],this._currentSnappedType=oe.MAIN}_removeVisualization(){this.handles.remove(Rt)}async _snapSinglePoint({point:e,context:t,signal:n}){const{view:s}=this,r=nt(e,s,t),a=await this._fetchCandidates(r,A.ALL,t,n);return this._createSnapResult(r,oe.MAIN,a,s,t,{z:e.z,m:e.m,spatialReference:e.spatialReference,elevationInfo:t.elevationInfo},n)}async _snapMultiPoint({point:e,scenePoint:t,context:n,signal:s}){const{view:r}=this,{coordinateHelper:a,spatialReference:l}=n;await Cr(t.spatialReference,l);const o=nn(t,l),d=nt(o,r,n),c=await this._fetchCandidates(d,A.FEATURE,n,s);if(c.length>0){const f=await this._fetchCandidates(d,A.SELF,n,s);return this._createSnapResult(d,oe.SCENE,[...c,...f],r,n,{z:o.z,m:o.m,spatialReference:o.spatialReference,elevationInfo:n.elevationInfo},s)}const h=nt(e,r,n),m=await this._fetchCandidates(h,A.SELF,n,s);return this._createSnapResult(h,oe.MAIN,m,r,n,{z:a.hasZ()&&e.hasZ?e.z??0:void 0,m:a.hasM()&&e.hasM?e.m??0:void 0,spatialReference:e.spatialReference,elevationInfo:n.elevationInfo},s)}async _fetchCandidates(e,t,n,s){return(await Promise.all(this._engines.map(r=>r.fetchCandidates(e,t,n,s)))).flat()}_createSnapResult(e,t,n,s,r,a,l){return{get valid(){return!Or(l)},apply:()=>{const{spatialReference:o}=r,{snappedPoint:d,hints:c}=this._processCandidates(e,t,n,r);return this._removeVisualization(),r.visualizer!=null&&this.handles.add(r.visualizer.draw(c,{spatialReference:o,elevationInfo:C,view:s,selfSnappingZ:r.selfSnappingZ}),Rt),fn(d,s,a)}}}_processCandidates(e,t,n,s){if(n.length<1)return this.doneSnapping(),{snappedPoint:e,hints:[]};this._currentSnappedType!==t&&this._resetSnappingState(),zi(e,n);const r=this._currentMainCandidate;if(r!=null){const a=this._findOldConstraintInNewCandidates(r,n);if(a>=0){if(!(n[a]instanceof Tt))return this._intersectWithOtherCandidates(a,n,e,t,s);if(this._arePointsWithinScreenThreshold(e,r.targetPoint,s))return this._updateSnappingCandidate(r,t,n,s)}}return this._intersectWithOtherCandidates(0,n,e,t,s)}_findOldConstraintInNewCandidates(e,t){return e instanceof Tt?this._findOldCandidateIndex(t,e.first)>=0&&this._findOldCandidateIndex(t,e.second)>=0?0:-1:this._findOldCandidateIndex(t,e)}_intersectWithOtherCandidates(e,t,n,s,r){const{coordinateHelper:a}=r,l=t[e],o=[];for(let d=0;d0&&(o.sort((d,c)=>d[1]-c[1]),o[0][1]{n.remove(),s.destroy()}})}const e=Lt.get(i);e.referenceCount++;const t=Mi(()=>rl(i,e));return{snappingManager:e.snappingManager,...t}}function rl(i,e){e.referenceCount--,e.referenceCount>0||Tr(()=>{e.referenceCount===0&&(e.remove(),Lt.delete(i))})}function al(i,e){return new Y({view:i,options:e,snappingEnginesFactory:(t,n)=>[new ae({view:i,spatialReference:i.spatialReference,options:n})]})}class zs{constructor(e){this.vertexHandle=null,this.excludeFeature=null,this.visualizer=null,this.selfSnappingZ=null,this.editGeometryOperations=e.editGeometryOperations,this.elevationInfo=e.elevationInfo,this.pointer=e.pointer,this.vertexHandle=e.vertexHandle,this.excludeFeature=e.excludeFeature,this.visualizer=e.visualizer,this.selfSnappingZ=e.selfSnappingZ}get coordinateHelper(){return this.editGeometryOperations.data.coordinateHelper}get spatialReference(){return this.coordinateHelper.spatialReference}}function ol({predicate:i=()=>!0,snappingManager:e,snappingContext:t,updatingHandles:n,useZ:s=!0}){const r=new Un;if(e==null)return{snappingStep:[xn,r],cancelSnapping:xn};let a,l=null,o=null,d=null;const c=()=>{l=ht(l),e.doneSnapping(),o!=null&&o.frameTask.remove(),o=null,a=Ei(a),d=null},h=ll(e,s,r);let m=null,f=null,_=null;return{snappingStep:[v=>{if(!i(v))return v;const{action:y}=v;if(y==="start"){const{info:T}=v,he=dl(e.view);if(o=cl(t,v,he),o.context.selfSnappingZ=null,!s&&T!=null){const Je=hl(t.coordinateHelper,T.handle.component);Je!=null&&(o.context.selfSnappingZ={value:Je,elevationInfo:t.elevationInfo??C})}}if(o!=null){const{context:T,originalScenePos:he,originalPos:Je}=o,{mapEnd:Ni,mapStart:ji,scenePoints:Gs}=v,Xt=Hs(Je,Pi(Ni,ji)),qi=Pi(ji,Je),Is={...v,action:"update"},Fs=o.context,Qt=ul(he,Gs),Ui=e.update({point:Xt,scenePoint:Qt,context:T});if(_=Ui,Vs(Ni,Ui,qi,s),m=Xt,f=Qt,y!=="end"){const{frameTask:ks}=o;l==null&&(l=new AbortController),d=Ns=>{n.addPromise(fi(h({frameTask:ks,event:Is,context:Fs,point:Xt,scenePoint:Qt,delta:qi,getLastState:()=>({point:m,scenePoint:f,updatePoint:Ns.forceUpdate?null:_})},l.signal)))},d({forceUpdate:!1}),a==null&&(a=S(()=>e.options.effectiveEnabled,()=>d==null?void 0:d({forceUpdate:!0})))}}return y==="end"&&c(),v},r],cancelSnapping:v=>(c(),v)}}function ll(i,e,t){return In(async({frameTask:n,point:s,scenePoint:r,context:a,event:l,delta:o,getLastState:d},c)=>{const h=await n.schedule(()=>i.snap({point:s,scenePoint:r,context:a,signal:c}),c);if(h.valid){let m=await n.schedule(()=>h.apply(),c);const f=d();f.point!=null&&s!==f.point&&(m=i.update({point:f.point,scenePoint:f.scenePoint,context:a})),f.updatePoint!=null&&ya(m,f.updatePoint)||(Vs(l.mapEnd,m,o,e),t.execute(l))}})}function dl(i){return i.type==="3d"?i.resourceController.scheduler.registerTask(Vn.SNAPPING):Gn}function cl(i,e,t){return{context:new zs({editGeometryOperations:i.editGeometryOperations,elevationInfo:i.elevationInfo,pointer:i.pointer,vertexHandle:e.info!=null?e.info.handle:null,excludeFeature:i.excludeFeature,visualizer:i.visualizer}),originalPos:e.snapOrigin!=null?i.coordinateHelper.vectorToDehydratedPoint(e.snapOrigin):e.mapStart,originalScenePos:e.scenePoints!=null?e.scenePoints.sceneStart:null,frameTask:t}}function Hs(i,[e,t,n]){const s=Fe(i);return s.x+=e,s.y+=t,s.hasZ&&(s.z+=n),s}function ul(i,e){return i==null||e==null?null:Hs(i,Pi(e.sceneEnd,e.sceneStart))}function Pi(i,e){const t=i.hasZ&&e.hasZ?i.z-e.z:0;return[i.x-e.x,i.y-e.y,t]}function Vs(i,e,[t,n,s],r){i.x=e.x+t,i.y=e.y+n,r&&i.hasZ&&e.hasZ&&(i.z=e.z+s)}function hl(i,e){if(!i.hasZ())return null;const t=e.vertices;let n=null;for(const s of t){const r=i.getZ(s.pos);if(n!=null&&r!=null&&Math.abs(r-n)>1e-6)return null;n==null&&(n=r)}return n}function xn(i){return i}let be=class extends ue{constructor(e){super(e),this.constrainResult=t=>t,this._snapPoints=null,this._frameTask=null,this._abortController=null,this._stagedPoint=null,this._snap=In(async(t,n,s,r)=>{const a=this._frameTask;if(a==null)return;const l=await a.schedule(()=>n.snap({...t,context:s,signal:r}),r);l.valid&&await a.schedule(()=>{this.stagedPoint=l.apply(),t!==this._snapPoints&&this._snapPoints!=null&&(this.stagedPoint=n.update({...this._snapPoints,context:s}))},r)})}get stagedPoint(){return this._stagedPoint}set stagedPoint(e){this._stagedPoint=this.constrainResult(e)}initialize(){var t,n;const e=this.view.type==="3d"?(n=(t=this.view)==null?void 0:t.resourceController)==null?void 0:n.scheduler:null;this._frameTask=e!=null?e.registerTask(Vn.SNAPPING):Gn}destroy(){this._abortController=ht(this._abortController),this._frameTask=Ei(this._frameTask)}update(e,t,n){this._snapPoints=e;const{point:s,scenePoint:r}=e,a=t.update({point:s,scenePoint:r,context:n});return this.stagedPoint=a,a}async snap(e,t,n){const{point:s,scenePoint:r}=e;return this.stagedPoint=t.update({point:s,scenePoint:r,context:n}),this._snapPoints=e,this._abortController==null&&(this._abortController=new AbortController),this._snap(e,t,n,this._abortController.signal)}async resnap(e,t){this._snapPoints!=null&&await this.snap(this._snapPoints,e,t)}abort(){this._abortController=ht(this._abortController),this._snapPoints=null}};u([p({constructOnly:!0})],be.prototype,"view",void 0),u([p()],be.prototype,"stagedPoint",null),u([p()],be.prototype,"constrainResult",void 0),u([p()],be.prototype,"_stagedPoint",void 0),be=u([H("esri.views.interactive.snapping.SnappingOperation")],be);let V=class extends bi{constructor(i){super(i),this._stagedDimension=null,this._computationManipulators=new Map,this._computationHandles=new Ut,this._getSnappingContext=lo(n=>new zs({elevationInfo:{mode:"absolute-height",offset:0},pointer:n,editGeometryOperations:new fa(new ga("point",_a(!0,!1,this.view.spatialReference))),visualizer:new bo}));const{view:e}=i;this._snappingManagerResult=sl(e),this.addHandles(this._snappingManagerResult),this._unfocusedOffsetManipulatorMaterial=ai(),this._focusedOffsetManipulatorMaterial=ai(),this._thinOffsetManipulatorMaterial=ai(),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:Gt(2)}),this._constraintSnappingIndicator=new we({view:e,attached:!0,width:1,color:W.toUnitRGBA($.constraint.color),renderOccluded:x.OccludeAndTransparent,stipplePattern:Gt(5)});const t=W.toUnitRGBA($.disabledPointIndicator.color);this._stagedStartIndicator=new Eo({view:e,attached:!1,elevationInfo:{mode:"absolute-height",offset:0},spatialReference:i.view.renderCoordsHelper.spatialReference,color:t,size:2*$.disabledPointIndicator.radius,outlineSize:0,renderOccluded:x.OccludeAndTransparent})}initialize(){var s;this._snappingOperation=new be({view:this.view});const{color:i,contrastColor:e}=$.orientationManipulator,t=!((s=this.view._stage)!=null&&s.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result);this._orientationManipulatorTexture=la(this.view.toolViewManager.textures,{accentColor:i,contrastColor:e,preMultiplyAlpha:t}),this._orientationManipulatorMaterial=new pa({transparent:!0,writeDepth:!1,textureId:this._orientationManipulatorTexture.texture.id,renderOccluded:x.Opaque});const{computations:n}=this.analysisViewData;for(const r of n)this._addComputation(r);this.addHandles([n.on("after-add",r=>this._addComputation(r.item)),n.on("after-remove",r=>this._removeComputation(r.item))]),this.addHandles([S(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:r,stagedComputation:a})=>{if(a==null||r==null)return;const l=Fe(r,new ke);this._applyPointUpdate(a,{endPoint:l})},We),S(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(r,a)=>{const{stagedDimension:l,selectedComputation:o,firstGrabbedManipulator:d}=r;if(l===(a==null?void 0:a.stagedDimension)&&d===(a==null?void 0:a.firstGrabbedManipulator)){for(const c of[o,a==null?void 0:a.selectedComputation])if(c!=null){const h=this._computationManipulators.get(c);this._updateManipulators(c,h,r)}}else for(const[c,h]of this._computationManipulators)this._updateManipulators(c,h,r)},G),S(()=>this.analysis.style.lineSize,r=>{this._updateManipulatorStyle(r)},Vt),S(()=>this.view.state.camera,()=>{this._stagedComputation!=null&&this._updateStagedDimensionOffset(this._stagedComputation)}),S(()=>Rr(this._stagedComputation,r=>{const a=r.elevationAlignedStartPoint,l=g();return a!=null&&this.view.renderCoordsHelper.toRenderCoords(a,l)?l:null}),r=>{r!=null?(this._stagedStartIndicator.vertices=[r],this._stagedStartIndicator.attached=!0):this._stagedStartIndicator.attached=!1})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),wo(this,()=>{const r=this._activeComputation,a=this._stagedComputation;if(r==null||a!=null){const l=this.view.inputManager.latestPointerType??"mouse",o=this._getSnappingContext(l);this.updatingHandles.addPromise(fi(this._snappingOperation.resnap(this._snappingManager,o)))}if(r!=null){const{start:l,end:o}=this._computationManipulators.get(r);if(l.grabbing||o.grabbing){const d=l.grabbing?"start":"end",c=this._computeConstraint(r);po(r,d,{constraint:c,view:this.view})}}})}destroy(){this._snappingOperation=dt(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy(),this._orientationManipulatorMaterial.dispose(),this._orientationManipulatorTexture.release()}get updating(){return this.updatingHandles.updating||this._snappingManager.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager.options}get _snappingManager(){return this._snappingManagerResult.snappingManager}get _activeComputation(){if(this._stagedComputation!=null)return this._stagedComputation;const{selectedComputation:i}=this.analysisViewData;return this.hasGrabbedManipulators&&i!=null?i:null}get _stagedComputation(){const i=this._stagedDimension,e=this.analysisViewData.computations.at(-1);return i==null||e==null||e.dimension!==i?null:e}get _constraintHandles(){return[$i(()=>this.analysisViewData.selectedComputation,i=>{i.previousConstraint=this._computeConstraint(i)},{...G,equals:gi}),S(()=>{const i=this._activeComputation;if(i==null)return null;const{measureType:e,orientation:t}=i.dimension;return{measureType:e,orientation:t,computation:i}},(i,e)=>{if(i!=null&&e==null){const{measureType:t,orientation:n,computation:s}=i;switch(s.previousConstraint){case B.Horizontal:s.preConstraintProperties={measureType:E.Horizontal,orientation:0};break;case B.Vertical:s.preConstraintProperties={measureType:E.Vertical,orientation:0};break;case B.Direct:s.preConstraintProperties={measureType:E.Direct,orientation:n};break;default:s.preConstraintProperties={measureType:t,orientation:n}}}i==null&&e!=null&&(e.computation.preConstraintProperties=null)},We)]}get _snappingIndicatorHandles(){const i="snapping-indicator-event-handles";return[S(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:e,activeComputation:t})=>{const n=this._constraintSnappingIndicator;if(this.removeHandles(i),t!=null)if(t===e)n.attached=!0;else{const{start:s,end:r}=this._computationManipulators.get(t),a=()=>{n.attached=s.grabbing||r.grabbing};a(),this.addHandles([s.events.on("grab-changed",a),r.events.on("grab-changed",a)],i)}else n.attached=!1}),S(()=>{const e=this._activeComputation;return e!=null?{geometry:e.geometry,constraint:e.previousConstraint}:{}},({geometry:e,constraint:t})=>{const n=this._constraintSnappingIndicator;e!=null&&t!=null&&t!==B.Direct?(n.visible=!0,n.setGeometryFromSegment(e.directSegment)):n.visible=!1})]}removeStaged(){return this._stagedDimension!=null&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(i){const{_stagedDimension:e}=this;if(e==null){const t=this._onUnstagedClick(i);return this.analysis.dimensions.add(t),null}return this._onStagedClick(i),e}onPointerMove({mapPoint:i,pointerType:e}){if(e==="touch")return;const t=this._getSnappingContext(e);this.updatingHandles.addPromise(fi(this._snappingOperation.snap({point:i},this._snappingManager,t)))}onManipulatorSelectionChanged(){this.analysisViewData.selectedComputation!=null&&(this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null))}_onUnstagedClick({mapPoint:i,pointerType:e}){let t=i;if(e==="mouse"){const s=this._getSnappingContext(e);t=this._snappingManager.update({point:i,context:s})}const n=new Zr({startPoint:Fe(t,new ke),endPoint:null,measureType:E.Horizontal});return this._stagedDimension=n,this._resetSnappingState(),n}_onStagedClick({mapPoint:i,pointerType:e}){const t=this._stagedComputation;if(t==null)return;let n=i;if(e==="mouse"){const r=this._getSnappingContext(e);n=this._snappingManager.update({point:i,context:r})}const s=Fe(n,new ke);this._applyPointUpdate(t,{endPoint:s}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._snappingManager.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_addComputation(i){if(this._computationManipulators.has(i))return;const e=this._setupPointManipulator(i,{isStart:!0}),t=this._setupPointManipulator(i,{isStart:!1}),n=this._setupOffsetManipulator(i),s=this._setupHeadingManipulator(i),r=this._setupRotationManipulator(i),a=this._setupMeasureTypeManipulator(i,E.Direct),l=this._setupMeasureTypeManipulator(i,E.Horizontal),o=this._setupMeasureTypeManipulator(i,E.Vertical),d=new ka({start:e,end:t,offset:n,heading:s,rotation:r,direct:a,horizontal:l,vertical:o});this._setupComputationToManipulatorsSync(i,d),this._computationManipulators.set(i,d),this.manipulators.addMany(d.values())}_removeComputation(i){const e=this._computationManipulators.get(i);if(e!=null){this._computationHandles.remove(i),this._computationManipulators.delete(i);for(const t of e.values())this.manipulators.remove(t)}}_setupComputationToManipulatorsSync(i,e){this._computationHandles.add([S(()=>i.geometry,()=>this._updateManipulators(i,e),{...G,equals:gi})],i)}_setupPointManipulator(i,e){const{view:t}=this,{dimension:n}=i,s=Na(t,{metadata:n}),r=Ua(s,{isStart:e.isStart,createSnappingPipelineStep:a=>ol({snappingContext:this._getSnappingContext(a),snappingManager:this._snappingManager,updatingHandles:this.updatingHandles}),dimension:n,onUpdate:a=>this._applyPointUpdate(i,a),view:t});return this._computationHandles.add(r,i),s}_setupOffsetManipulator(i){const{view:e}=this,t=ja(e,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:i.dimension}),n=Wa(t,{computation:i,view:e});return this._computationHandles.add(n,i),t}_setupHeadingManipulator(i){const{view:e}=this,t=ln(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:i.dimension}),n=Za(t,{computation:i,view:e});return this._computationHandles.add(n,i),t}_setupRotationManipulator(i){const{view:e}=this,t=ln(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:i.dimension}),n=Ba(t,{computation:i,view:e});return this._computationHandles.add(n,i),t}_setupMeasureTypeManipulator(i,e){const{view:t}=this,n=qa(t,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:i.dimension}),s=Qa(n,{computation:i,manipulatorMeasureType:e,view:t});return this._computationHandles.add(s,i),n}_updateManipulators(i,e,t={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){const{stagedDimension:n,selectedComputation:s,firstGrabbedManipulator:r}=t,{start:a,end:l,offset:o,heading:d,rotation:c}=e,h=s===i,m=mt(i),{dimension:f}=i;for(const y of e.values()){const T=m&&n==null&&(r==null||y===r);y===o?(y.available=T,y.selected=h):y.available=T&&h}if(!m)return;this._computeConstraint(i)!=null?e.forEachMeasureTypeManipulator(y=>y.available=!1):e.manipulatorForMeasureType(f.measureType).available=!1;for(const y of[d,c])f.measureType===E.Direct&&f.offset!==0||(y.available=!1);Ri(i)?c.available=!1:d.available=!1;const{geometry:_}=i;a.renderLocation=_.directSegment.startRenderSpace,l.renderLocation=_.directSegment.endRenderSpace;const{renderCoordsHelper:v}=this.view;Ka(o,_,v),d.available&&Ja(d,i,v),c.available&&eo(c,i,v),e.forEachMeasureTypeManipulator((y,T)=>{y.available&&no(y,i,T,v)})}_updateManipulatorStyle(i){const e=oo(i),t=Li(i),n={lineSizePt:i,material:this._orientationManipulatorMaterial};for(const{offset:s,heading:r,rotation:a}of this._computationManipulators.values())s.radius=t/2,dn(r,n),dn(a,n);this._unfocusedOffsetManipulatorMaterial.setParameters({width:e}),this._focusedOffsetManipulatorMaterial.setParameters({width:t})}_applyPointUpdate(i,e){const{view:t}=this,n=It(i);"startPoint"in e&&(n.elevationAlignedStartPoint=e.startPoint),"endPoint"in e&&(n.elevationAlignedEndPoint=e.endPoint);const s=Ft(n,t.renderCoordsHelper);if(s==null)return;const r=this._computeConstraint({...n,geometry:s});ds(i,e,{...n,constraint:r,unconstrainedGeometry:s,view:t}),i===this._stagedComputation&&this._updateStagedDimensionOffset(i)}_updateStagedDimensionOffset(i){if(i.geometry==null)return;i.geometry.directSegment.eval(.5,bn);const e=this.view.state.camera.computeRenderPixelSizeAt(bn);i.dimension.offset=$.initialOffsetPx*e}_computeConstraint(i){return ho(uo(i,this._snappingManager.options),this.view)}get testInfo(){const i=e=>this.analysisViewData.computations.find(t=>t.dimension===e);return{disableManipulatorPartialOcclusion:()=>{this._stagedStartIndicator.renderOccluded=x.Occlude,this.manipulators.forEach(({manipulator:e})=>{for(const{geometry:t}of e.renderObjects)t.material.setParameters({renderOccluded:x.Occlude})})},getManipulatorsForDimension:e=>this._computationManipulators.get(i(e)),getComputationForDimension:e=>i(e),getConstraintForDimension:e=>{const t=i(e);return t!=null?this._computeConstraint(t):null},stagedDimension:this._stagedDimension,stagedStartIndicator:this._stagedStartIndicator,constraintSnappingIndicator:this._constraintSnappingIndicator,snappingManager:this._snappingManager}}};function ai(){const{color:i}=$.offsetManipulator;return new le({color:W.toUnitRGBA(i),width:1,renderOccluded:x.OccludeAndTransparent,writeDepth:!1,hasPolygonOffset:!0})}u([p({constructOnly:!0})],V.prototype,"analysis",void 0),u([p({constructOnly:!0})],V.prototype,"analysisViewData",void 0),u([p({constructOnly:!0})],V.prototype,"manipulators",void 0),u([p({constructOnly:!0})],V.prototype,"parentTool",void 0),u([p({constructOnly:!0,nonNullable:!0})],V.prototype,"view",void 0),u([p({readOnly:!0})],V.prototype,"updating",null),u([p()],V.prototype,"firstGrabbedManipulator",null),u([p()],V.prototype,"hasGrabbedManipulators",null),u([p()],V.prototype,"snappingOptions",null),u([p()],V.prototype,"_stagedDimension",void 0),u([p()],V.prototype,"_activeComputation",null),u([p()],V.prototype,"_stagedComputation",null),V=u([H("esri.views.3d.analysis.Dimension.LengthDimensionSubTool")],V);const bn=g();var Ie;(function(i){i.Ready="ready",i.Creating="creating",i.Created="created"})(Ie||(Ie={}));let q=class extends na{constructor(i){super(i),this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this._pointerMoveTimerMs=$.pointerMoveTimeoutMs,this._prevPointerMoveTimeout=null}initialize(){this._intersector=Dr(this.view.state.viewingMode),this._intersector.options.store=Ar.MIN,this._lengthDimensionSubTool=new V({analysis:this.analysis,analysisViewData:this.analysisViewData,manipulators:this.manipulators,parentTool:this,view:this.view}),this.addHandles([ze(this._lengthDimensionSubTool),Mi(()=>this._clearPointerMoveTimeout()),S(()=>this.state,i=>{i===Ie.Created&&this.finishToolCreation()},G),$i(()=>this.firstGrabbedManipulator,i=>{this.selectedDimension=i.metadata},G),S(()=>this.selectedDimension,()=>this._resetPointerMoveTimeout(),G)])}get state(){return this.analysis.dimensions.some(i=>i.type==="length")?this._activeSubTool!=null?Ie.Creating:Ie.Created:Ie.Ready}get updating(){return this._lengthDimensionSubTool.updating}get cursor(){return this.active?"crosshair":null}get selectedDimension(){return this.analysisViewData.selectedDimension}set selectedDimension(i){this.analysisViewData.selectedDimension=i}onInputEvent(i){switch(i.type){case"immediate-click":this._clickHandler(i);break;case"immediate-double-click":this._doubleClickHandler(i);break;case"pointer-move":this._pointerMoveHandler(i);break;case"key-down":if(_n.cancel===i.key){if(this._activeSubTool!=null&&this._activeSubTool.removeStaged())return void i.stopPropagation();this.active||(this.selectedDimension=null)}else _n.delete.includes(i.key)&&this._deleteKeyHandler()}}onActivate(){this._activeSubTool=this._lengthDimensionSubTool}onDeactivate(){this._activeSubTool!=null&&(this._activeSubTool.onDeactivate(),this._activeSubTool=null)}onShow(){this._resetPointerMoveTimeout()}onManipulatorSelectionChanged(){this._lengthDimensionSubTool.onManipulatorSelectionChanged()}onHide(){this.selectedDimension=null}_clickHandler(i){if(this.hasFocusedManipulators)return void i.stopPropagation();if(this._activeSubTool==null)return;const e=this._intersectScreen(i);e!=null&&(this.selectedDimension=this._activeSubTool.onClick({mapPoint:e,pointerType:i.pointerType}),i.stopPropagation())}_doubleClickHandler(i){this.active&&(this.view.activeTool=null,i.stopPropagation())}_pointerMoveHandler(i){if(this._resetPointerMoveTimeout(),this._activeSubTool==null||this.hasFocusedManipulators)return;const e=this._intersectScreen(i);e!=null&&this._activeSubTool.onPointerMove({mapPoint:e,pointerType:i.pointerType})}_deleteKeyHandler(){this._activeSubTool!=null&&this._activeSubTool.removeStaged(),this._removeSelected()}_intersectScreen(i){const e=Lr(i);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector);const t=this._intersector.results.min,n=w.get();return t.getIntersectionPoint(n)?this.view.renderCoordsHelper.fromRenderCoords(n,this.view.spatialReference):null}_removeSelected(){this.selectedDimension!=null&&(this.analysis.dimensions.remove(this.selectedDimension),this.selectedDimension=null)}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=Ei(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.manipulators.forEach(i=>{i.manipulator.state|=de}),this._prevPointerMoveTimeout=zr.setTimeout(()=>{this.manipulators.forEach(i=>{i.manipulator.state&=~de})},this._pointerMoveTimerMs)}get testInfo(){return{...this._lengthDimensionSubTool.testInfo,setManipulatorAutoHideDelay:i=>{this._pointerMoveTimerMs=i,this._resetPointerMoveTimeout()}}}};u([p({constructOnly:!0})],q.prototype,"view",void 0),u([p({constructOnly:!0})],q.prototype,"analysis",void 0),u([p({readOnly:!0})],q.prototype,"state",null),u([p({readOnly:!0})],q.prototype,"updating",null),u([p({readOnly:!0})],q.prototype,"cursor",null),u([p({constructOnly:!0})],q.prototype,"analysisViewData",void 0),u([p()],q.prototype,"selectedDimension",null),u([p()],q.prototype,"automaticManipulatorSelection",void 0),u([p()],q.prototype,"_activeSubTool",void 0),u([p()],q.prototype,"_lengthDimensionSubTool",void 0),q=u([H("esri.views.3d.analysis.Dimension.DimensionTool")],q);class pl extends kn{constructor(e,t){super(e),this._hasExternalMaterial=!1,this._renderOccluded=x.OccludeAndTransparent,this._width=1,this._color=zt(1,0,1,1),this._placement="end",this._markerPrimitive="arrow",this._material=t,this._hasExternalMaterial=t!=null,this.applyProps(e)}setGeometryFromSegment(e,t){const n=e.endRenderSpace;this.transform=Hr(ml,n),this._normal=t;const{points:s}=e.createRenderGeometry(n,this.view.renderCoordsHelper);this.geometry=[s]}get renderOccluded(){return this._material!=null?this._material.parameters.renderOccluded:this._renderOccluded}set renderOccluded(e){this._renderOccluded=e,this._material!=null&&this._material.setParameters({renderOccluded:e})}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get normal(){return this._normal}set normal(e){this._normal=e,this.recreateGeometry()}get width(){return this._material!=null?this._material.parameters.width:this._width}set width(e){this._width=e,this._material!=null&&this._material.setParameters({width:e})}get color(){return this._material!=null?this._material.parameters.color:this._color}set color(e){this._color=Tn(e),this._material!=null&&this._material.setParameters({color:this._color})}get placement(){return this._material!=null?this._material.parameters.placement:this._placement}set placement(e){this._placement=e,this._material!=null&&this._material.setParameters({placement:this._placement})}get markerPrimitive(){var e;return((e=this._material)==null?void 0:e.parameters.markerPrimitive)??this._markerPrimitive}set markerPrimitive(e){this._markerPrimitive=e,this._material!=null&&this._material.setParameters({markerPrimitive:e})}createExternalResources(){this._hasExternalMaterial||(this._material=new Fn({width:this._width,color:this._color,placement:this._placement,renderOccluded:this._renderOccluded,markerPrimitive:this._markerPrimitive}))}destroyExternalResources(){this._hasExternalMaterial||(this._material=null)}createGeometries(e){for(const t of Vr(this.geometry,this.normal)){const n=Gr(this._material,t);e.addGeometry(n)}}forEachExternalMaterial(e){this._hasExternalMaterial||e(this._material)}}const ml=xi();let fl=class{set visible(e){for(const t of this._visualElements.values())t.attached=e}constructor(e){this.destroyed=!1,this._handles=new Ut,this._messages=null,this._labelSegment=new Oe;const{analysis:t,computation:n,view:s,messages:r}=e;this.analysis=t,this.computation=n,this.view=s,this._messages=r;const a=e.visible,l={view:s,attached:a},{fontSize:o,textColor:d,textBackgroundColor:c}=t.style;this._visualElements=new Sl({marker:new pl(l,e.markerMaterial),dimension:new we(l,e.dimensionLineMaterial),startOffset:new we(l,e.offsetLineMaterial),endOffset:new we(l,e.offsetLineMaterial),dimensionSmall:new we(l,e.smallDimensionLineMaterial),startOffsetSmall:new we(l,e.smallOffsetLineMaterial),endOffsetSmall:new we(l,e.smallOffsetLineMaterial),label:new Qr({view:s,attached:a,distance:0,geometry:{type:"segment",sampleLocation:"center",segment:this._labelSegment,callout:!1},fontSize:se(o),textColor:d.clone(),backgroundColor:c.clone()})}),this._handles.add([S(()=>n.geometry,h=>{this.updateCameraDependentElements(s.state.camera,h,t.style),n.geometry!=null&&this._updateLines(n.geometry)},{...Vt,equals:gi}),S(()=>n.length,h=>this._updateLabelContent(h),Vt)])}destroy(){this.destroyed=!0,this._handles=dt(this._handles);for(const e of this._visualElements.values())e.destroy()}get testInfo(){return{dimensionVisualElement:this._visualElements.dimension,label:this._visualElements.label}}_updateLines(e){const t=on(_l,pt.Start,e.directSegment,e.dimensionSegment),n=on(yl,pt.End,e.directSegment,e.dimensionSegment),s=this._visualElements;s.marker.setGeometryFromSegment(e.dimensionSegment,e.primaryOffsetAxis),s.dimension.setGeometryFromSegment(e.dimensionSegment),s.startOffset.setGeometryFromSegment(t),s.endOffset.setGeometryFromSegment(n),s.dimensionSmall.setGeometryFromSegment(e.dimensionSegment),s.startOffsetSmall.setGeometryFromSegment(t),s.endOffsetSmall.setGeometryFromSegment(n)}updateCameraDependentElements(e,t,n){const s=this._visualElements;if(t==null){for(const v of s.values())v.visible=!1;return}const r=e.computeScreenPixelSizeAt(t.dimensionSegment.eval(.5,vl)),a=Ta(t,r),l=a<(se(n.lineSize)*$.smallScreenLengthLineSizeFactor)**2,o=!l;s.marker.visible=o,s.dimension.visible=o,s.startOffset.visible=o,s.endOffset.visible=o,s.dimensionSmall.visible=l,s.startOffsetSmall.visible=l,s.endOffsetSmall.visible=l;const d=se(n.fontSize)*$.labels.minScreenLengthFontSizeFactor,{label:c}=s;if(c.visible=a>=d**2,!c.visible)return;const{dimensionSegment:h,primaryOffsetAxis:m}=t,{offset:f}=this.computation.dimension,_=(Math.sign(f)>=0?1:-1)*gl(n)*r;xa(this._labelSegment,h,m,_),c.updateLabelPosition()}updateLabelStyle(e){const{label:t}=this._visualElements;t.fontSize=se(e.fontSize),t.textColor=e.textColor,t.backgroundColor=e.textBackgroundColor}updateUnitsMessages(e){this._messages=e;const{length:t}=this.computation;this._updateLabelContent(t)}_updateLabelContent(e){const{label:t}=this._visualElements;e!=null&&this._messages!=null?t.text=Kr(this._messages,e,e.unit):t.text=""}};function gl(i){return 1.5*se(i.fontSize)+$.labels.marginPx+se(i.lineSize/2)}const _l=new Oe,yl=new Oe,vl=g();class Sl{constructor(e){this.marker=e.marker,this.dimension=e.dimension,this.startOffset=e.startOffset,this.endOffset=e.endOffset,this.dimensionSmall=e.dimensionSmall,this.startOffsetSmall=e.startOffsetSmall,this.endOffsetSmall=e.endOffsetSmall,this.label=e.label}values(){return[this.marker,this.dimension,this.startOffset,this.endOffset,this.dimensionSmall,this.startOffsetSmall,this.endOffsetSmall,this.label]}}let fe=class extends ue{get analysis(){return this.analysisViewData.analysis}get visible(){return this.analysisViewData.visible}constructor(e){super(e),this.loadingMessages=!1,this._messages=null,this._dimensionVisualizations=new Map,this._markerMaterial=new Fn({width:1,anchor:Ir.Tip,color:et,placement:"begin-end",worldSpace:!0,hideOnShortSegments:!0,hasTip:!0,renderOccluded:x.OccludeAndTransparent,markerPrimitive:"triangle"}),this._dimensionLineMaterial=new le({width:1,color:et,renderOccluded:x.OccludeAndTransparent,markerParameters:this._markerMaterial.parameters}),this._offsetLineMaterial=new le({width:1,color:et,renderOccluded:x.OccludeAndTransparent,stipplePattern:Gt(5),stippleScaleWithLineWidth:!0}),this._smallDimensionLineMaterial=new le({width:1,color:et,renderOccluded:x.OccludeAndTransparent}),this._smallOffsetLineMaterial=new le({width:1,color:et,renderOccluded:x.OccludeAndTransparent,stipplePattern:Gt(5),stippleScaleWithLineWidth:!0})}initialize(){for(const t of this._lineMaterials())this.view._stage.add(t),this.addHandles(Mi(()=>{var n;(n=this.view._stage)==null||n.remove(t),t.dispose()}));const{computations:e}=this.analysisViewData;for(const t of e)this._addComputation(t);this.addHandles([e.on("change",({added:t,removed:n})=>{for(const s of n)this._removeComputation(s);for(const s of t)this._addComputation(s)}),S(()=>W.toUnitRGBA(this.analysis.style.color),t=>{for(const n of this._lineMaterials())n.setParameters({color:t})},G),S(()=>this.analysis.style.lineSize,t=>{const n=se(t);this._markerMaterial.setParameters({width:n*$.markers.lineSizeFraction}),this._dimensionLineMaterial.setParameters({width:n,markerParameters:this._markerMaterial.parameters});const s=Math.max(n*$.offsetLine.lineSizeFraction,1);this._offsetLineMaterial.setParameters({width:s})},G),S(()=>({camera:this.view.state.camera,style:wl(this.analysis)}),({camera:t,style:n})=>{for(const[s,r]of this._dimensionVisualizations)r.updateCameraDependentElements(t,s.geometry,n),r.updateLabelStyle(n)}),S(()=>this.visible,t=>{for(const n of this._dimensionVisualizations.values())n.visible=t})]),this.addHandles([Fr(()=>this._updateMessageBundle()),$i(()=>!this.loadingMessages,()=>{for(const t of this._dimensionVisualizations.values())t.updateUnitsMessages(this._messages)},We)]),this._updateMessageBundle()}destroy(){this._dimensionVisualizations.forEach(e=>{e.destroy()}),this._dimensionVisualizations.clear()}get testInfo(){return{visualizations:Array.from(this._dimensionVisualizations.values()),disablePartialOcclusion:()=>{for(const e of this._lineMaterials())e.setParameters({renderOccluded:x.Occlude})}}}_addComputation(e){this._dimensionVisualizations.has(e)||this._dimensionVisualizations.set(e,new fl({analysis:this.analysis,computation:e,view:this.view,visible:this.visible,markerMaterial:this._markerMaterial,dimensionLineMaterial:this._dimensionLineMaterial,offsetLineMaterial:this._offsetLineMaterial,smallDimensionLineMaterial:this._smallDimensionLineMaterial,smallOffsetLineMaterial:this._smallOffsetLineMaterial,messages:this._messages}))}_removeComputation(e){const t=this._dimensionVisualizations.get(e);t!=null&&(t.destroy(),this._dimensionVisualizations.delete(e))}_lineMaterials(){return[this._markerMaterial,this._dimensionLineMaterial,this._offsetLineMaterial,this._smallDimensionLineMaterial,this._smallOffsetLineMaterial]}async _updateMessageBundle(){this.loadingMessages=!0;try{this._messages=await kr("esri/core/t9n/Units")}finally{this.loadingMessages=!1}}};function wl(i){const{fontSize:e,lineSize:t,textColor:n,textBackgroundColor:s}=i.style;return{fontSize:e,lineSize:t,textBackgroundColor:s.clone(),textColor:n.clone()}}u([p({constructOnly:!0})],fe.prototype,"analysisViewData",void 0),u([p({constructOnly:!0,nonNullable:!0})],fe.prototype,"view",void 0),u([p()],fe.prototype,"analysis",null),u([p()],fe.prototype,"visible",null),u([p()],fe.prototype,"loadingMessages",void 0),fe=u([H("esri.views.3d.analysis.Dimension.DimensionVisualization")],fe);let st=class extends ue{constructor(i){super(i),this.dimension=null,this.length=null}};u([p({constructOnly:!0,nonNullable:!0})],st.prototype,"dimension",void 0),u([p()],st.prototype,"length",void 0),st=u([H("esri.views.3d.analysis.LengthDimensionResult")],st);const Pl=st;let U=class extends ue{constructor(i){super(i),this.geometry=null,this.unconstrainedGeometry=null,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null}normalizeCtorArgs(i){const{dimension:e,...t}=i;return{result:new Pl({dimension:e}),...t}}initialize(){this.addHandles([S(()=>this.dimension.startPoint,i=>this.elevationAlignedStartPoint=this.projectAndAlignPoint(i),G),S(()=>this.dimension.endPoint,i=>this.elevationAlignedEndPoint=this.projectAndAlignPoint(i),G)])}get dimension(){return this.result.dimension}get length(){return this.result.length}};u([p({constructOnly:!0,nonNullable:!0})],U.prototype,"result",void 0),u([p({constructOnly:!0,nonNullable:!0})],U.prototype,"projectAndAlignPoint",void 0),u([p()],U.prototype,"dimension",null),u([p()],U.prototype,"length",null),u([p()],U.prototype,"geometry",void 0),u([p()],U.prototype,"unconstrainedGeometry",void 0),u([p()],U.prototype,"elevationAlignedStartPoint",void 0),u([p()],U.prototype,"elevationAlignedEndPoint",void 0),u([p()],U.prototype,"preConstraintProperties",void 0),u([p()],U.prototype,"previousConstraint",void 0),U=u([H("esri.views.3d.analysis.LengthDimensionComputation")],U);const xl=i=>{let e=class extends i{constructor(...t){super(...t),this.analysis=null,this.tool=null,this.selectedDimension=null,this.interactive=!1,this.visible=null}get results(){return new Xe}createLengthDimensions(t){throw new Error("Method not implemented.")}};return u([p({constructOnly:!0})],e.prototype,"view",void 0),u([p({constructOnly:!0,nonNullable:!0})],e.prototype,"analysis",void 0),u([p()],e.prototype,"tool",void 0),u([p({readOnly:!0})],e.prototype,"results",null),u([p()],e.prototype,"selectedDimension",void 0),u([p()],e.prototype,"interactive",void 0),u([p()],e.prototype,"visible",void 0),e=u([H("esri.views.analysis.DimensionAnalysisView")],e),e};let k=class extends xl(jr(ue)){constructor(i){super(i),this.type="dimension-view-3d",this.tool=null,this.computations=new Xe,this.selectedDimension=null,this._dimensionsToComputations=new Map,this._placementTask=null,this._projectAndAlignPoint=null}initialize(){this._projectAndAlignPoint=i=>{if(i==null)return null;const{spatialReference:e,elevationProvider:t}=this.view,n=qr(i,e,t);return n==null&&Ur(this.analysis,i.spatialReference,$n.getLogger(this)),n},this.addHandles([sa(this,q),sn(()=>this.analysis.dimensions,"after-add",i=>this._onDimensionAdd(i.item),{onListenerAdd:i=>{for(const e of i)this._onDimensionAdd(e)},onListenerRemove:()=>{this._onDimensionsClear()}}),sn(()=>this.analysis.dimensions,"after-remove",i=>this._onDimensionRemove(i.item))]),this._analysisVisualization=new fe({analysisViewData:this,view:this.view}),this._analysisController=new Pe({analysisViewData:this,view:this.view})}destroy(){this._placementTask=ht(this._placementTask),this._analysisVisualization=dt(this._analysisVisualization),ra(this)}get updating(){var i;return((i=this._analysisVisualization)==null?void 0:i.loadingMessages)??!1}get results(){return this.analysis.dimensions.map(i=>this._dimensionsToComputations.get(i).result)}get selectedComputation(){const{selectedDimension:i}=this;return i==null?null:this._dimensionsToComputations.get(i)}get testInfo(){return{visualization:this._analysisVisualization,controller:this._analysisController}}async createLengthDimensions(i){return this.selectedDimension=null,this._placementTask=ht(this._placementTask),this._placementTask=aa(this,i),this._placementTask.promise}_onDimensionAdd(i){const{computations:e,_dimensionsToComputations:t}=this;if(t.has(i))return;const n=new U({dimension:i,projectAndAlignPoint:this._projectAndAlignPoint});e.add(n),t.set(i,n)}_onDimensionRemove(i){const{computations:e,_dimensionsToComputations:t}=this,n=e.findIndex(r=>r.dimension===i),s=e.at(n);s.dimension===this.selectedDimension&&(this.selectedDimension=null),e.removeAt(n),t.delete(i),dt(s)}_onDimensionsClear(){this.computations.drain(i=>i.destroy()),this._dimensionsToComputations.clear()}};u([p({readOnly:!0})],k.prototype,"type",void 0),u([p()],k.prototype,"tool",void 0),u([p()],k.prototype,"updating",null),u([p({readOnly:!0})],k.prototype,"results",null),u([p({readOnly:!0})],k.prototype,"computations",void 0),u([p()],k.prototype,"selectedDimension",void 0),u([p()],k.prototype,"selectedComputation",null),u([p()],k.prototype,"_analysisVisualization",void 0),u([p()],k.prototype,"_analysisController",void 0),u([p()],k.prototype,"_dimensionsToComputations",void 0),u([p()],k.prototype,"_placementTask",void 0),k=u([H("esri.views.3d.analysis.DimensionAnalysisView3D")],k);const bl=k,Td=Object.freeze(Object.defineProperty({__proto__:null,default:bl},Symbol.toStringTag,{value:"Module"}));export{Td as D,Jl as E,Do as T,Po as a,Kl as b,Ql as l,ki as n,Fo as r,Io as s,zi as u}; diff --git a/assets/DimensionLayer-56b346fa.js b/assets/DimensionLayer-56b346fa.js new file mode 100644 index 0000000..f36ebc8 --- /dev/null +++ b/assets/DimensionLayer-56b346fa.js @@ -0,0 +1 @@ +import{eP as R,bh as u,ai as t,aj as n,eZ as y,fT as f,bE as $,al as m,gN as O,aF as x,aE as N,aG as b,aM as v,aI as j,jf as E,ca as g,bY as S,aA as q}from"./index-080e108a.js";import{c as D}from"./Analysis-932d2cd8.js";import{u as P}from"./LengthDimension-92faee98.js";import{O as k}from"./MultiOriginJSONSupport-e4912ffd.js";import{c as z}from"./OperationalLayer-0e8f8b28.js";import"./commonProperties-30089b06.js";let r=class extends R(O){constructor(e){super(e),this.type="simple",this.color=new u("black"),this.lineSize=2,this.fontSize=10,this.textColor=new u("black"),this.textBackgroundColor=new u([255,255,255,.6])}};t([n({type:["simple"],readOnly:!0,json:{write:{isRequired:!0}}})],r.prototype,"type",void 0),t([n({type:u,nonNullable:!0,json:{type:[y],write:{isRequired:!0}}})],r.prototype,"color",void 0),t([n({type:Number,cast:f,nonNullable:!0,range:{min:$(1)},json:{write:{isRequired:!0}}})],r.prototype,"lineSize",void 0),t([n({type:Number,cast:f,nonNullable:!0,json:{write:{isRequired:!0}}})],r.prototype,"fontSize",void 0),t([n({type:u,nonNullable:!0,json:{type:[y],write:{isRequired:!0}}})],r.prototype,"textColor",void 0),t([n({type:u,nonNullable:!0,json:{type:[y],write:{isRequired:!0}}})],r.prototype,"textBackgroundColor",void 0),r=t([m("esri.analysis.DimensionSimpleStyle")],r);const h=r,c=x.ofType(P);let l=class extends D{constructor(e){super(e),this.type="dimension",this.style=new h,this.extent=null}initialize(){this.addHandles(b(()=>this._computeExtent(),e=>{e!=null&&e.pending!=null||this._set("extent",e!=null?e.extent:null)},v))}get dimensions(){return this._get("dimensions")||new c}set dimensions(e){this._set("dimensions",j(e,this.dimensions,c))}get spatialReference(){for(const e of this.dimensions){if(e.startPoint!=null)return e.startPoint.spatialReference;if(e.endPoint!=null)return e.endPoint.spatialReference}return null}get requiredPropertiesForEditing(){return this.dimensions.reduce((e,s)=>(e.push(s.startPoint,s.endPoint),e),[])}async waitComputeExtent(){const e=this._computeExtent();return e!=null?e.pending:Promise.resolve()}_computeExtent(){const e=this.spatialReference;if(e==null)return{pending:null,extent:null};const s=[];for(const o of this.dimensions)o.startPoint!=null&&s.push(o.startPoint),o.endPoint!=null&&s.push(o.endPoint);const a=E(s,e);if(a.pending!=null)return{pending:a.pending,extent:null};let d=null;return a.geometries!=null&&(d=a.geometries.reduce((o,p)=>o==null?p!=null?g.fromPoint(p):null:p!=null?o.union(g.fromPoint(p)):o,null)),{pending:null,extent:d}}clear(){this.dimensions.removeAll()}};t([n({type:["dimension"]})],l.prototype,"type",void 0),t([n({cast:N,type:c,nonNullable:!0})],l.prototype,"dimensions",null),t([n({readOnly:!0})],l.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:h}},nonNullable:!0})],l.prototype,"style",void 0),t([n({value:null,readOnly:!0})],l.prototype,"extent",void 0),t([n({readOnly:!0})],l.prototype,"requiredPropertiesForEditing",null),l=t([m("esri.analysis.DimensionAnalysis")],l);const w=l;let i=class extends z(k(q)){constructor(e){if(super(e),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new w,this.opacity=1,e){const{source:s,style:a}=e;s&&a&&(s.style=a)}}initialize(){this.addHandles([b(()=>this.source,(e,s)=>{s!=null&&s.parent===this&&(s.parent=null),e!=null&&(e.parent=this)},v)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get style(){return this.source.style}set style(e){this.source.style=e}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new w)}get analysis(){return this.source}set analysis(e){this.source=e}get dimensions(){return this.source.dimensions}set dimensions(e){this.source.dimensions=e}writeDimensions(e,s,a,d){s.dimensions=e.filter(({startPoint:o,endPoint:p})=>o!=null&&p!=null).map(o=>o.toJSON(d)).toJSON()}};t([n({json:{read:!1},readOnly:!0})],i.prototype,"type",void 0),t([n({type:["ArcGISDimensionLayer"]})],i.prototype,"operationalLayerType",void 0),t([n({nonNullable:!0})],i.prototype,"source",void 0),t([n({readOnly:!0})],i.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:h}},json:{write:{ignoreOrigin:!0}}})],i.prototype,"style",null),t([n({readOnly:!0})],i.prototype,"fullExtent",null),t([n({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],i.prototype,"opacity",void 0),t([n({type:["show","hide"]})],i.prototype,"listMode",void 0),t([n({type:x.ofType(P),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],i.prototype,"dimensions",null),t([S("web-scene","dimensions")],i.prototype,"writeDimensions",null),i=t([m("esri.layers.DimensionLayer")],i);const F=i;export{F as default}; diff --git a/assets/DimensionLayerView3D-9f833e6e.js b/assets/DimensionLayerView3D-9f833e6e.js new file mode 100644 index 0000000..6e77846 --- /dev/null +++ b/assets/DimensionLayerView3D-9f833e6e.js @@ -0,0 +1 @@ +import{ai as a,aj as t,al as y,aF as h,fL as w,aG as d,aM as u,ar as V,aN as c,ah as p,aO as _,aP as m,aw as v}from"./index-080e108a.js";import{n as A}from"./LayerView3D-ffd35809.js";import{d as f}from"./LayerView-448bc5ea.js";const D=i=>{let s=class extends i{constructor(...e){super(...e),this.layer=null}get interactive(){return this.analysisView!=null&&this.analysisView.interactive}set interactive(e){this.analysisView!=null&&(this.analysisView.interactive=e)}get results(){return this.analysisView!=null?this.analysisView.results:new h}get selectedDimension(){return this.analysisView!=null?this.analysisView.selectedDimension:null}set selectedDimension(e){this.analysisView!=null&&(this.analysisView.selectedDimension=e)}async createLengthDimensions(e){if(this.analysisView==null)throw w();await this.analysisView.createLengthDimensions(e)}};return a([t()],s.prototype,"layer",void 0),a([t()],s.prototype,"interactive",null),a([t({readOnly:!0})],s.prototype,"results",null),a([t()],s.prototype,"selectedDimension",null),a([t()],s.prototype,"analysisView",void 0),s=a([y("esri.views.layers.DimensionLayerView")],s),s},o="analysis-view-handles";let n=class extends A(D(f)){constructor(i){super(i),this.type="dimension-3d",this._analysisModule=null}initialize(){this.handles.add(d(()=>this.layer.source,i=>{this._destroyAnalysisView(),i!=null&&this._createAnalysisView(i)},u),o)}destroy(){this.handles.remove(o),this._destroyAnalysisView()}isUpdating(){return this._createAnalysisViewTask!=null||this.analysisView!=null&&this.analysisView.updating}async whenAnalysisView(){if(this.analysisView!=null)return this.analysisView;if(this._createAnalysisViewTask!=null)return this._createAnalysisViewTask.promise;throw new V("layerview:no-analysisview-for-analysis","The analysis has not been set on the DimensionLayer of this layer view")}_createAnalysisView(i){const s=c(async e=>(this.analysisView=await this._createAnalysisViewPromise(i,e),this._createAnalysisViewTask===s&&(this._createAnalysisViewTask=null),this.analysisView));this.addResolvingPromise(s.promise),this._createAnalysisViewTask=s}_destroyAnalysisView(){this.analysisView=p(this.analysisView),this._createAnalysisViewTask=_(this._createAnalysisViewTask)}async _createAnalysisViewPromise(i,s){let e=this._analysisModule;if(e==null){const r=await this._loadAnalysisModule();this._analysisModule=r,e=r}const l=new e.default({analysis:i,view:this.view,parent:this});if(await l.when(),m(s))throw l.destroy(),w();return l}_loadAnalysisModule(){return v(()=>import("./DimensionAnalysisView3D-4f55aca1.js").then(i=>i.D),["assets/DimensionAnalysisView3D-4f55aca1.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/LineVisualElement-b605d10c.js","assets/LengthDimension-92faee98.js","assets/Segment-50129b50.js","assets/unitFormatUtils-b70a7bff.js","assets/elevationInfoUtils-4fd79d95.js","assets/analysisViewUtils-68ab721d.js","assets/ImageMaterial-5c48df66.js","assets/Factory-8e329f4b.js","assets/RightAngleQuadVisualElement-8daf0594.js","assets/VisualElementResources-e52972a5.js","assets/PointVisualElement-2a56e55d.js","assets/EditGeometryOperations-0ec3f5b5.js","assets/dehydratedFeatureComparison-a3375a3e.js"])}};a([t()],n.prototype,"type",void 0),a([t()],n.prototype,"analysisView",void 0),a([t()],n.prototype,"_createAnalysisViewTask",void 0),n=a([y("esri.views.3d.layers.DimensionLayerView3D")],n);const g=n;export{g as default}; diff --git a/assets/DirectLineMeasurementAnalysisView3D-f383b6d8.js b/assets/DirectLineMeasurementAnalysisView3D-f383b6d8.js new file mode 100644 index 0000000..a654684 --- /dev/null +++ b/assets/DirectLineMeasurementAnalysisView3D-f383b6d8.js @@ -0,0 +1,33 @@ +import{bz as Te,ai as r,aj as l,al as de,ao as ce,af as he,dT as v,gm as xe,aB as _e,aG as S,aM as O,ah as b,lF as F,h1 as le,c8 as Re,lG as me,lH as Ge,lI as je,ia as Ne,ib as Ie,ii as q,a_ as L,id as X,lJ as J,im as He,aw as Ue,iq as K,il as ue,is as Be,it as We,iu as ke,iv as Qe,lK as Fe,iw as qe,hL as Xe,iz as Je,iB as Ke,lL as Ye,iG as Ze,lM as et,lN as tt,hH as ve,hI as ye,lO as it,iM as st,i$ as Y,dS as Z,dR as ee,j1 as Ee,dQ as nt,ft as te,bh as C,fu as at,i_ as D,lP as I,j7 as H,j6 as rt,bH as ge,lQ as ie,lR as ot,gu as lt,gv as dt,ch as ct,lS as ht,cf as ut,lT as gt,lU as we,lV as pt,kB as ze,lW as pe}from"./index-080e108a.js";import{t as _t,e as V,M as mt,y as vt,b as yt,R as wt,f as se,a as bt}from"./UnitNormalizer-818a6664.js";import{r as Lt,a as ft,b as Pt,i as T,u as St,c as U,s as be,d as Ot,e as At}from"./LineVisualElement-b605d10c.js";import{i as B,g as ne,m as Le,f as M,h as W,R as ae,y as Et,L as re,d as zt,a as oe,C as fe}from"./Segment-50129b50.js";import{geodesicLength as Ct}from"./geometryEngine-5a631b21.js";import{P as Vt}from"./RightAngleQuadVisualElement-8daf0594.js";const Ce="esri.views.3d.analysis.DirectLineMeasurement.DirectLineMeasurementController",$t=Te.getLogger(Ce),Mt=1e5;let A=class extends ce{constructor(e){super(e),this._unitNormalizer=new _t,this._handles=new he,this._tempStartPosition=v(),this._tempEndPosition=v(),this._tempCornerPosition=v()}initialize(){const e=this.view.spatialReference,t=xe(e),i=t===Ge?je:t;this._sphericalPCPF=i;const n=_e(e,i);this._unitNormalizer.spatialReference=n?i:e,this._handles.add([S(()=>({viewData:this.viewData,startPoint:this.analysis.startPoint}),({viewData:s,startPoint:a})=>{s.elevationAlignedStartPoint=this._applyProjectionAndElevationAlignment(a)},O),S(()=>({viewData:this.viewData,endPoint:this.analysis.endPoint}),({viewData:s,endPoint:a})=>{s.elevationAlignedEndPoint=this._applyProjectionAndElevationAlignment(a)},O),S(()=>({result:this._computedResult,viewData:this.viewData}),({result:s,viewData:a})=>{a.result=s},O)])}destroy(){this._handles=b(this._handles)}_applyProjectionAndElevationAlignment(e){if(e==null)return e;const{spatialReference:t,elevationProvider:i}=this.view;return Lt(e,t,i)??(ft(this.analysis,e.spatialReference,$t),null)}get _computedResult(){const{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,measurementMode:i}=this.viewData;if(e==null||t==null)return null;const n=this._euclideanDistances(e,t),s=this._geodesicDistance(e,t,n.horizontal.value),a=i===V.Geodesic||i===V.Auto&&n.horizontal.value>Mt?"geodesic":"euclidean";return{mode:a,distance:a==="euclidean"?n.direct:s,directDistance:n.direct,horizontalDistance:n.horizontal,verticalDistance:n.vertical,geodesicDistance:s}}_euclideanDistances(e,t){const i=e.clone();i.z=t.z;const n=this._tempStartPosition,s=this._tempEndPosition,a=this._tempCornerPosition,d=this.view.spatialReference,c=this._sphericalPCPF,o=_e(d,c)?c:d;F(e,n,o),F(t,s,o),F(i,a,o);const h=le(n,s),u=le(a,s),p=Math.abs(t.z-e.z),w=R=>this._unitNormalizer.normalizeDistance(R),y=w(h),E=w(u),x=w(p);return{direct:B(y,"meters"),horizontal:B(E,"meters"),vertical:B(x,"meters")}}_geodesicDistance(e,t,i){const n=e.spatialReference,s=new Re({spatialReference:n});s.addPath([e,t]);const a=n.isGeographic&&mt(n)?vt([s],"meters")[0]:n.isWebMercator?Ct(s,"meters"):null,d=a??this._fallbackGeodesicDistance(e,t,i);return B(d,"meters")}_fallbackGeodesicDistance(e,t,i){if(me(e,Pe)&&me(t,Se)){const n=new wt;return yt(n,Pe,Se),n.distance}return i}};r([l()],A.prototype,"view",void 0),r([l()],A.prototype,"analysis",void 0),r([l()],A.prototype,"viewData",void 0),r([l()],A.prototype,"_computedResult",null),A=r([de(Ce)],A);const Pe=v(),Se=v();var m,P;(function(e){e[e.None=0]="None",e[e.Direct=1]="Direct",e[e.Triangle=2]="Triangle",e[e.ProjectedGeodesic=3]="ProjectedGeodesic"})(m||(m={})),function(e){e[e.Auto=0]="Auto",e[e.AboveSegment=1]="AboveSegment",e[e.BelowSegment=2]="BelowSegment"}(P||(P={}));function Dt(e){const t=new Ne,{vertex:i,fragment:n}=t;Ie(i,e),i.uniforms.add(new q("width",a=>a.width)),t.attributes.add(L.POSITION,"vec3"),t.attributes.add(L.NORMAL,"vec3"),t.attributes.add(L.UV0,"vec2"),t.attributes.add(L.AUXPOS1,"float"),t.varyings.add("vtc","vec2"),t.varyings.add("vlength","float"),t.varyings.add("vradius","float"),i.code.add(X`void main(void) { +vec3 bitangent = normal; +vtc = uv0; +vlength = auxpos1; +vradius = 0.5 * width; +vec4 pos = view * vec4(position + vradius * bitangent * uv0.y, 1.0); +gl_Position = proj * pos; +}`),n.uniforms.add(new q("outlineSize",a=>a.outlineSize),new J("outlineColor",a=>a.outlineColor),new q("stripeLength",a=>a.stripeLength),new J("stripeEvenColor",a=>a.stripeEvenColor),new J("stripeOddColor",a=>a.stripeOddColor));const s=1/Math.sqrt(2);return n.code.add(X` + const float INV_SQRT2 = ${X.float(s)}; + + vec4 arrowColor(vec2 tc, float len) { + float d = INV_SQRT2 * (tc.x - abs(tc.y)); + d = min(d, INV_SQRT2 * (len - tc.x - abs(tc.y))); + d = min(d, 1.0 - abs(tc.y)); + + if (d < 0.0) { + return vec4(0.0); + } else if (d < outlineSize) { + return outlineColor; + } else { + return fract(0.5 / stripeLength * tc.x * vradius) >= 0.5 ? stripeOddColor : stripeEvenColor; + } + } + + void main(void) { + vec2 ntc = vec2(vtc.x / vradius, vtc.y); + vec4 color = arrowColor(ntc, vlength / vradius); + if (color.a == 0.0) { + discard; + } + fragColor = color; + } + `),t}const Tt=Object.freeze(Object.defineProperty({__proto__:null,build:Dt},Symbol.toStringTag,{value:"Module"}));let Ve=class $e extends Be{constructor(t,i,n){super(t,i,n)}initializeProgram(t){return new We(t.rctx,$e.shader.get().build(this.configuration),ke)}_setPipelineState(t){const i=t===ue.NONE,n=this.configuration;return Qe({blending:n.transparent?i?Fe:qe(t):null,polygonOffset:this.configuration.polygonOffsetEnabled?{factor:0,units:-4}:null,depthTest:{func:Xe.LESS},depthWrite:Je,colorWrite:Ke})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}get primitiveType(){return Ye.TRIANGLE_STRIP}};Ve.shader=new He(Tt,()=>Ue(()=>import("./MeasurementArrow.glsl-3a559294.js"),["assets/MeasurementArrow.glsl-3a559294.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/UnitNormalizer-818a6664.js","assets/Segment-50129b50.js","assets/unitFormatUtils-b70a7bff.js","assets/LineVisualElement-b605d10c.js","assets/elevationInfoUtils-4fd79d95.js","assets/geometryEngine-5a631b21.js","assets/geometryEngineBase-324c1c81.js","assets/hydrated-c10ab4a5.js","assets/RightAngleQuadVisualElement-8daf0594.js","assets/VisualElementResources-e52972a5.js"]));let k=class extends Ze{constructor(){super(...arguments),this.polygonOffsetEnabled=!1,this.transparent=!1,this.transparencyPassType=ue.NONE}};r([K()],k.prototype,"polygonOffsetEnabled",void 0),r([K()],k.prototype,"transparent",void 0),r([K({count:ue.COUNT})],k.prototype,"transparencyPassType",void 0);class xt extends tt{constructor(t){super(t,new Gt),this._configuration=new k}getConfiguration(t,i){return this._configuration.polygonOffsetEnabled=this.parameters.polygonOffset,this._configuration.transparent=this._transparent,this._configuration.transparencyPassType=i.transparencyPassType,this._configuration}dispose(){}intersect(){}requiresSlot(t,i){return i===ve.Color||i===ve.Alpha?t===(this._transparent?ye.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:ye.OPAQUE_MATERIAL):!1}createGLMaterial(t){return new Rt(t)}createBufferWriter(){return new Wt}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class Rt extends it{beginSlot(t){return this.ensureTechnique(Ve,t)}}class Gt extends st{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=Y(1,.5,0,1),this.stripeEvenColor=Y(1,1,1,1),this.stripeOddColor=Y(1,.5,0,1),this.stripeLength=1,this.polygonOffset=!1}}const jt=et().vec3f(L.POSITION).vec3f(L.NORMAL).vec2f(L.UV0).f32(L.AUXPOS1),Nt=v(),It=v(),Ht=v(),Ut=v(),Bt=v();class Wt{constructor(){this.vertexBufferLayout=jt}elementCount(t){return 2*(t.indices.get(L.POSITION).length/2+1)}write(t,i,n,s,a){const d=n.vertexAttributes.get(L.POSITION).data,c=n.vertexAttributes.get(L.NORMAL).data,o=d.length/3,h=n&&n.indices&&n.indices.get(L.POSITION);h&&h.length!==2*(o-1)&&console.warn("MeasurementArrowMaterial does not support indices");const u=Nt,p=It,w=Ht,y=Ut,E=Bt,x=s.position,R=s.normal,G=s.uv0;let j=0;for(let f=0;fthis.view.state.camera,()=>{this._viewChanged()}))}destroyExternalResources(){this._arrowMaterial=null,this._handles=b(this._handles)}forEachExternalMaterial(t){t(this._arrowMaterial)}createGeometries(t){if(this._geometry==null||this._geometry.startRenderSpace==null||this._geometry.endRenderSpace==null)return;const i=this._createArrowGeometry(this._geometry.startRenderSpace,this._geometry.endRenderSpace,this._origin,this._geometry);i.transformation=this._originTransform,t.addGeometry(i),this._viewChanged()}_createArrowGeometry(t,i,n,s){const a=this.view.renderCoordsHelper,d=[],c=[],o=(h,u)=>{const p=H.get();Ee(p,h,n),d.push(p),c.push(u)};if(s.type==="euclidean"){s.eval(.5,this._arrowCenter);const h=H.get();a.worldUpAtPosition(this._arrowCenter,h),o(t,h),o(i,h)}else{s.eval(.5,this._arrowCenter);const h=this._parameters.arrowSubdivisions+1&-2;for(let u=0;u{const{elevationAlignedStartPoint:s,elevationAlignedEndPoint:a}=this.analysisView,d=this.view;return{view:d,camera:d.state.camera,viewMode:this.viewMode,elevationAlignedStartPoint:s,elevationAlignedEndPoint:a,orientation:this._actualVisualElementsOrientation,visualizedMeasurement:this.actualVisualizedMeasurement,stripeLength:this._measurementArrowStripeLength}},s=>this._updateGeometryAndViewMode(s),O),S(()=>({visible:this.visible,viewMode:this.viewMode}),s=>this._updateVisualElementVisibility(s),O),S(()=>({text:this._labelsText,visualizedMeasurement:this.actualVisualizedMeasurement}),s=>this._updateLabelText(s),O),S(()=>({visible:this.visible,viewMode:this.viewMode}),s=>this._updateLabelVisibility(s),O),S(()=>this._measurementArrowStripeLength,s=>this._updateSegmentStripeLength(s),O),ot(async()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._handles=b(this._handles),this._segmentVisualElement=b(this._segmentVisualElement),this._triangleVisualElement=b(this._triangleVisualElement),this._rightAngleQuad=b(this._rightAngleQuad),this._projectedGeodesicLine=b(this._projectedGeodesicLine),this._geodesicStartHint=b(this._geodesicStartHint),this._geodesicEndHint=b(this._geodesicEndHint),this._segmentLabel=b(this._segmentLabel),this._verticalLabel=b(this._verticalLabel),this._horizontalLabel=b(this._horizontalLabel),this.set("view",null)}_updateVisualElementVisibility({visible:e,viewMode:t}){if(this._segmentVisualElement.visible=!1,this._triangleVisualElement.visible=!1,this._rightAngleQuad.visible=!1,this._projectedGeodesicLine.visible=!1,this._geodesicStartHint.visible=!1,this._geodesicEndHint.visible=!1,e)switch(t){case m.None:break;case m.Direct:this._segmentVisualElement.visible=!0;break;case m.Triangle:this._segmentVisualElement.visible=!0,this._triangleVisualElement.visible=!0,this._rightAngleQuad.visible=!0;break;case m.ProjectedGeodesic:this._segmentVisualElement.visible=!0,this._projectedGeodesicLine.visible=!0,this._geodesicStartHint.visible=!0,this._geodesicEndHint.visible=!0}}_updateGeometryAndViewMode({view:e,camera:t,viewMode:i,elevationAlignedStartPoint:n,elevationAlignedEndPoint:s,orientation:a,visualizedMeasurement:d,stripeLength:c}){const o=e.renderCoordsHelper;if(o==null||n==null||s==null||n.equals(s))return;let h=this._startPosition,u=this._endPosition;o.toRenderCoords(n,h),o.toRenderCoords(s,u);const p=a===P.AboveSegment?1:-1,w=p*(o.getAltitude(u)-o.getAltitude(h));w<0&&(h=this._endPosition,u=this._startPosition);const y=d==="geodesic"?new Le(this._startPosition,this._endPosition,o.spatialReference):new M(this._startPosition,this._endPosition);switch(this._segmentVisualElement.geometry=y,this._updateSegmentStripeLength(c),i){case m.Direct:this._updateSegment(y,a);break;case m.Triangle:this._updateSegmentAndTriangle({view:e,camera:t,segment:y,orientation:a,startPosition:h,endPosition:u,deltaSign:p,altitudeDelta:w});break;case m.ProjectedGeodesic:this._updateSegmentAndProjection({view:e,orientation:a,startPosition:h,endPosition:u})}}_updateSegment(e,t){this._segmentLabel.anchor=t===P.AboveSegment?"top":"bottom",this._segmentLabel.geometry={type:"segment",segment:e,sampleLocation:"center"}}_updateSegmentAndTriangle({view:{renderCoordsHelper:e},camera:t,segment:i,orientation:n,startPosition:s,endPosition:a,deltaSign:d,altitudeDelta:c}){const o=this._cornerPosition;e.worldUpAtPosition(s,o),lt(o,o,d*Math.abs(c)),dt(o,o,s),this._triangleVisualElement.geometry=[[[s[0],s[1],s[2]],[o[0],o[1],o[2]],[a[0],a[1],a[2]]]],this._rightAngleQuad.geometry={previous:s,center:o,next:a};const h=new M(s,o),u=new M(o,a),p=qt(s,a,o,n,t);this._segmentLabel.anchor=p.segment,this._segmentLabel.geometry={type:"segment",segment:i,sampleLocation:"center"},this._verticalLabel.geometry={type:"segment",segment:h,sampleLocation:"center"},this._verticalLabel.anchor=p.vertical,this._horizontalLabel.geometry={type:"segment",segment:u,sampleLocation:"center"},this._horizontalLabel.anchor=p.horizontal}_updateSegmentAndProjection({view:{renderCoordsHelper:e},orientation:t,startPosition:i,endPosition:n}){e.setAltitude(this._startPositionAtSeaLevel,0,i),e.setAltitude(this._endPositionAtSeaLevel,0,n);const s=new Le(this._startPositionAtSeaLevel,this._endPositionAtSeaLevel,e.spatialReference);this._projectedGeodesicLine.setGeometryFromSegment(s),this._geodesicStartHint.setGeometryFromSegment(new M(this._startPositionAtSeaLevel,i)),this._geodesicEndHint.setGeometryFromSegment(new M(this._endPositionAtSeaLevel,n)),this._segmentLabel.geometry={type:"segment",segment:s,sampleLocation:"center"},this._segmentLabel.anchor=t===P.AboveSegment?"top":"bottom"}_updateLabelText({text:e,visualizedMeasurement:t}){e!=null?(this._segmentLabel.text=t==="euclidean"?e.euclideanDistance:e.geodesicDistance,this._horizontalLabel.text=e.horizontalDistance,this._verticalLabel.text=e.verticalDistance):(this._segmentLabel.text=null,this._horizontalLabel.text=null,this._verticalLabel.text=null),this.notifyChange("labels")}_updateLabelVisibility({visible:e,viewMode:t}){const i=this._segmentLabel,n=this._horizontalLabel,s=this._verticalLabel;if(i.visible=!1,n.visible=!1,s.visible=!1,e)switch(t){case m.Direct:i.visible=!0;break;case m.Triangle:i.visible=!0,n.visible=!0,s.visible=!0;break;case m.ProjectedGeodesic:i.visible=!0;case m.None:}}get _labelsText(){if(this.destroyed)return null;const e=this.messages,t=this.analysisView.result;if(t==null||e==null)return null;const{directDistance:i,horizontalDistance:n,verticalDistance:s,geodesicDistance:a}=t,d=this.analysisView.unit,c=o=>({euclideanDistance:"",geodesicDistance:"",horizontalDistance:"",verticalDistance:"",...o});switch(d){case"metric":return c({euclideanDistance:i&&re(e,i),geodesicDistance:a&&re(e,a),horizontalDistance:n&&re(e,n),verticalDistance:s&&zt(e,s)});case"imperial":return c({euclideanDistance:i&&ae(e,i),geodesicDistance:a&&ae(e,a),horizontalDistance:n&&ae(e,n),verticalDistance:s&&Et(e,s)});default:return c({euclideanDistance:i&&W(e,i,d),geodesicDistance:a&&W(e,a,d),horizontalDistance:n&&W(e,n,d),verticalDistance:s&&W(e,s,d)})}}_updateSegmentStripeLength(e){const t=this._segmentVisualElement;e!=null?(t.stripeLength=e,t.stripesEnabled=!0):t.stripesEnabled=!1}get _actualVisualElementsOrientation(){if(this._triangleOrientationOverride!=null)return this._triangleOrientationOverride;const e=this.visualElementOrientation;return e===P.Auto?this.view.state.camera.aboveGround?P.AboveSegment:P.BelowSegment:e}_requiresGeodesicGuideAt(e){const t=this.view;if(!(t!=null&&t.state))return!1;const i=t.state.camera,n=t.renderCoordsHelper;if(!n)return!1;const s=i.computeScreenPixelSizeAt(e);return n.getAltitude(e)/s>=10}get _measurementArrowStripeLength(){const{result:e,unit:t}=this.analysisView;if(e==null)return null;let i=null;const n=e.directDistance;switch(t){case"metric":i=n&&oe(n,"meters");break;case"imperial":i=n&&oe(n,ct(n.value,n.unit));break;default:i=n&&oe(n,t)}return i==null?null:ht(i.value/30)*ut(1,i.unit,"meters")}_updateMessageBundle(){this.loadingMessages=!0,gt("esri/core/t9n/Units").then(e=>{this.messages=e}).finally(()=>{this.loadingMessages=!1})}get testData(){var e;return{labels:this.labels,stripeLength:(e=this._segmentVisualElement)==null?void 0:e.stripeLength}}};function qt(e,t,i,n,s){const a=Xt,d=Jt;s.projectToRenderScreen(i,a),s.projectToRenderScreen(t,d);const c={segment:"bottom",horizontal:"top",vertical:a[0]=Ae){const u=Math.sign(o[1])===Math.sign(h[1]);c.segment=u?fe(c.vertical):c.vertical}else{const u=Zt;se(i,t,u,s),we(u,h)>=Ae&&(c.segment=Math.sign(u[0])===Math.sign(h[0])?fe(c.horizontal):c.horizontal)}}if(n===P.BelowSegment){const o=h=>h==="top"?"bottom":"top";c.segment=o(c.segment),c.horizontal=o(c.horizontal),c.vertical=o(c.vertical)}return c}r([l()],_.prototype,"_triangleOrientationOverride",void 0),r([l()],_.prototype,"messages",void 0),r([l()],_.prototype,"view",void 0),r([l()],_.prototype,"analysis",void 0),r([l()],_.prototype,"analysisView",void 0),r([l()],_.prototype,"loadingMessages",void 0),r([l()],_.prototype,"visible",null),r([l()],_.prototype,"viewMode",null),r([l()],_.prototype,"actualVisualizedMeasurement",null),r([l()],_.prototype,"visualElementOrientation",void 0),r([l()],_.prototype,"triangleCollapseRatioThreshold",void 0),r([l()],_.prototype,"allowVisualElementsOrientationChange",null),r([l()],_.prototype,"labels",null),r([l()],_.prototype,"_labelsText",null),r([l()],_.prototype,"_actualVisualElementsOrientation",null),r([l()],_.prototype,"_measurementArrowStripeLength",null),_=r([de("esri.views.3d.analysis.DirectLineMeasurement.DirectLineMeasurementVisualization")],_);const Ae=Math.cos(pt(12)),Xt=ze(),Jt=ze(),Kt=pe(),Yt=pe(),Zt=pe();let g=class extends At(ce){constructor(e){super(e),this.type="direct-line-measurement-view-3d",this.analysis=null,this.result=null,this.measurementMode=V.Auto,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null}initialize(){const e=this.view,t=this.analysis;this._analysisVisualization=new _({view:e,analysis:t,analysisView:this}),this._analysisController=new A({view:e,analysis:t,viewData:this})}destroy(){this._analysisController=b(this._analysisController),this._analysisVisualization=b(this._analysisVisualization)}get updating(){var e;return!!((e=this._analysisVisualization)!=null&&e.loadingMessages)}get viewMode(){return this._analysisVisualization.viewMode}get actualVisualizedMeasurement(){return this._analysisVisualization.actualVisualizedMeasurement}get visualElementOrientation(){return this._analysisVisualization.visualElementOrientation}set visualElementOrientation(e){this._analysisVisualization.visualElementOrientation=e}get allowVisualElementsOrientationChange(){return this._analysisVisualization.allowVisualElementsOrientationChange}set allowVisualElementsOrientationChange(e){this._analysisVisualization.allowVisualElementsOrientationChange=e}get triangleCollapseRatioThreshold(){return this._analysisVisualization.triangleCollapseRatioThreshold}set triangleCollapseRatioThreshold(e){this._analysisVisualization.triangleCollapseRatioThreshold=e}get directLabelText(){var e;return((e=this._analysisVisualization.labels.direct)==null?void 0:e.text)??""}get horizontalLabelText(){var e;return((e=this._analysisVisualization.labels.horizontal)==null?void 0:e.text)??""}get verticalLabelText(){var e;return((e=this._analysisVisualization.labels.vertical)==null?void 0:e.text)??""}get unit(){return this.analysis.unit??this._defaultUnit}get testData(){var e;return this.destroyed?{labels:null,stripeLength:null,visualization:null,controller:null}:{...(e=this._analysisVisualization)==null?void 0:e.testData,visualization:this._analysisVisualization,controller:this._analysisController}}};r([l()],g.prototype,"updating",null),r([l({readOnly:!0})],g.prototype,"type",void 0),r([l({constructOnly:!0,nonNullable:!0})],g.prototype,"analysis",void 0),r([l()],g.prototype,"result",void 0),r([l()],g.prototype,"measurementMode",void 0),r([l()],g.prototype,"elevationAlignedStartPoint",void 0),r([l()],g.prototype,"elevationAlignedEndPoint",void 0),r([l({readOnly:!0})],g.prototype,"viewMode",null),r([l({readOnly:!0})],g.prototype,"actualVisualizedMeasurement",null),r([l()],g.prototype,"visualElementOrientation",null),r([l()],g.prototype,"allowVisualElementsOrientationChange",null),r([l()],g.prototype,"triangleCollapseRatioThreshold",null),r([l({readOnly:!0})],g.prototype,"directLabelText",null),r([l({readOnly:!0})],g.prototype,"horizontalLabelText",null),r([l({readOnly:!0})],g.prototype,"verticalLabelText",null),r([l()],g.prototype,"_analysisVisualization",void 0),r([l()],g.prototype,"_analysisController",void 0),r([l()],g.prototype,"unit",null),r([l(bt)],g.prototype,"_defaultUnit",void 0),g=r([de("esri.views.3d.analysis.DirectLineMeasurementAnalysisView3D")],g);const ei=g,li=Object.freeze(Object.defineProperty({__proto__:null,default:ei},Symbol.toStringTag,{value:"Module"}));export{li as D,Dt as n}; diff --git a/assets/DynamicLayerView3D-b48678f2.js b/assets/DynamicLayerView3D-b48678f2.js new file mode 100644 index 0000000..48d344a --- /dev/null +++ b/assets/DynamicLayerView3D-b48678f2.js @@ -0,0 +1 @@ +import{g1 as v,g2 as E,g3 as q,g4 as F,g5 as W,g6 as k,aZ as Z,a_ as p,a$ as A,aQ as B,aD as Q,aR as Y,bn as M,bz as x,aS as J,e$ as K,dz as D,fp as X,ca as G,g7 as ee,g8 as te,aO as N,g9 as ae,aP as ie,fL as H,ga as O,aV as C,b3 as se,b4 as z,b7 as re,gb as R,ax as V,b0 as ne,gc as oe,gd as le,cT as he,ai as w,aj as S,al as de}from"./index-080e108a.js";import{n as ce}from"./LayerView3D-ffd35809.js";import{l as ge}from"./projectExtentUtils-efa4cddd.js";import{c as ue}from"./ImageMaterial-5c48df66.js";import{d as me}from"./LayerView-448bc5ea.js";import{a as fe}from"./RefreshableLayerView-915e7f53.js";function pe(a,e,t){const s=v(a)/E(a),i={width:t,height:t};return s>1.0001?i.height=t/s:s<.9999&&(i.width=t*s),i.width=Math.round(i.width/(v(a)/v(e))),i.height=Math.round(i.height/(E(a)/E(e))),i}function j(a,e){return q(a,[[e[0],e[1],-1],[e[2],e[1],-1],[e[2],e[3],-1],[e[0],e[3],-1]])}function ye(a,e,t){if(!F(e,t))return j(a,t);const s=[e[1]-t[1],Math.min(e[3],t[3])-Math.max(e[1],t[1]),t[3]-e[3],123456],i=[e[0]-t[0],Math.min(e[2],t[2])-Math.max(e[0],t[0]),t[2]-e[2],123456],l=t[2]-t[0],n=t[3]-t[1],r=i[0]>0&&i[2]>0?3:2,o=s[0]>0&&s[2]>0?3:2,h=(o+1)*(r+1),c=W(3*h),g=k(2*h),d=new Array(6*(o*r-1));let $=0,b=0,L=0,u=0,f=0;for(let y=0;y<4;y++){const P=s[y];if(P<=0)continue;let I=0;for(let _=0;_<4;_++){const T=i[_];T<=0||(c[b++]=t[0]+I,c[b++]=t[1]+$,c[b++]=-1,g[L++]=I/l,g[L++]=$/n,_<3&&y<3&&(_!==1||y!==1)&&(d[f++]=u,d[f++]=u+1,d[f++]=u+r+1,d[f++]=u+1,d[f++]=u+r+2,d[f++]=u+r+1),u++,I+=T)}$+=P}const U=new Array(d.length);return new Z(a,[[p.POSITION,new A(c,3,!0)],[p.NORMAL,new A(_e,3,!0)],[p.UV0,new A(g,2,!0)]],[[p.POSITION,d],[p.NORMAL,U],[p.UV0,d]])}const _e=[0,0,1];let m=class extends fe(ce(me)){constructor(){super(...arguments),this.drapeSourceType=B.RasterImage,this.updatePolicy=Q.SYNC,this.fullExtentInLocalViewSpatialReference=null,this.maximumDataResolution=null,this._images=new Array,this._extents=new Array,this._overlays=new Array,this.updateWhenStationary=!0,this._drapeSourceRenderer=null,this.refreshDebounced=Y(async a=>{this.destroyed||await this._doRefresh(a).catch(e=>{M(e)||x.getLogger(this).error(e)})},2e3)}initialize(){this._drapeSourceRenderer=this.view.basemapTerrain.overlayManager.registerGeometryDrapeSource(this),this.handles.add(J(()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this))),this.addResolvingPromise(ge(this).then(a=>this._set("fullExtentInLocalViewSpatialReference",a))),this.updatingHandles.add(()=>this.suspended,()=>this._suspendedChangeHandler()),this.handles.add(this.view.resourceController.scheduler.registerIdleStateCallbacks(()=>{this._isScaleRangeActive()&&this.notifyChange("suspended")},()=>{})),this._isScaleRangeLayer()&&this.updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this.notifyChange("suspended"))}destroy(){this.clear()}setDrapingExtent(a,e){this._spatialReference=e,a.forEach(t=>{this._overlays[t.index]=t,this._updateImageExtent(t)})}_updateImageExtent(a){const e=this._clippedExtent(a.extent,we);if(e==null)return;const t=pe(a.extent,e,a.resolution);let s=a.pixelRatio*this.view.state.pixelRatio;const{layer:i}=this;if("imageMaxWidth"in i&&i.imageMaxWidth!=null||"imageMaxHeight"in i&&i.imageMaxHeight!=null){const n=i.imageMaxWidth,r=i.imageMaxHeight;if(t.width>n){const o=n/t.width;t.height=Math.floor(t.height*o),t.width=n,s*=o}if(t.height>r){const o=r/t.height;t.width=Math.floor(t.width*o),t.height=r,s*=o}}const l=this._extents[a.index];l&&K(l.extent,e)&&this._imageSizeEquals(e,l.imageSize,t)||(this._extents[a.index]={extent:D(e),imageSize:t,pixelRatio:s},this.suspended||this._fetch(a.index).catch(n=>{M(n)||x.getLogger(this).error(n)}))}clear(){for(let a=0;a0&&s>e)return!1}return!0}isUpdating(){return this._images.some(a=>!!a.loadingPromise)}async processResult(a,e,t){(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement)&&(a.image=e)}findExtentInfoAt(a){for(const e of this._extents){const t=e.extent;if(new G(t[0],t[1],t[2],t[3],this._spatialReference).contains(a))return e}return null}getFetchOptions(){}async redraw(a,e){await ee(this._images,async(t,s)=>{t&&(await a(t,e),await this._createStageObjects(s,t.image,e))})}_imageSizeEquals(a,e,t){if(!this.maximumDataResolution)return!1;const s=v(a)/this.maximumDataResolution.x,i=E(a)/this.maximumDataResolution.y,l=s/e.width,n=i/e.height,r=s/t.width,o=i/t.height,h=Math.abs(l-r),c=Math.abs(n-o),g=te.TESTS_DISABLE_OPTIMIZATIONS?0:1.5;return h<=g&&c<=g}async _fetch(a,e){if(this.suspended)return;const t=this._extents[a],s=t.extent;this._images[a]||(this._images[a]={texture:null,material:null,renderGeometry:null,loadingPromise:null,loadingAbortController:null,image:null,pixelData:null,renderExtent:D(s)});const i=this._images[a];i.loadingAbortController=N(i.loadingAbortController);const l=new G(s[0],s[1],s[2],s[3],this._spatialReference);if(l.width===0||l.height===0)return void this._clearImage(a);const n=new AbortController;i.loadingAbortController=n,ae(e,()=>n.abort());const r=n.signal,o=this._waitFetchReady(r).then(async()=>{const h={requestAsImageElement:!0,pixelRatio:this._overlays[a].pixelRatio,...this.getFetchOptions(),signal:r},{height:c,width:g}=t.imageSize;return this.layer.fetchImage(l,g,c,h)}).then(h=>{if(ie(r))throw x.getLogger(this).warnOnce("A call to fetchImage resolved even though the request was aborted. fetchImage should not resolve if options.signal.aborted is true."),H();return this.processResult(i,h)}).then(()=>{O(i.renderExtent,s)}).finally(()=>{o===i.loadingPromise&&(i.loadingPromise=null,i.loadingAbortController=null)});i.loadingPromise=o,this.notifyChange("updating"),await o.then(async()=>{if(r.aborted)throw H();await this._createStageObjects(a,i.image,r),this.notifyChange("updating")}).catch(h=>{throw h&&!M(h)&&x.getLogger(this).error(h),this.notifyChange("updating"),h})}_clearImage(a){const e=this._images[a];if(e){e.renderGeometry!=null&&(this._drapeSourceRenderer.removeGeometries([e.renderGeometry],C.UPDATE),e.renderGeometry=null);const t=this.view._stage;t.remove(e.texture),e.texture=null,t.remove(e.material),e.material=null,e.loadingAbortController=N(e.loadingAbortController),e.loadingPromise=null,e.image=null,e.pixelData=null}}async _createStageObjects(a,e,t){const s=this.view._stage,i=this._images[a],l=()=>{s.remove(i.texture),i.texture=null,i.renderGeometry!=null&&(this._drapeSourceRenderer.removeGeometries([i.renderGeometry],C.UPDATE),i.renderGeometry=null)};if(e){const n=new se(e,{width:e.width,height:e.height,preMultiplyAlpha:!0,wrap:{s:z.CLAMP_TO_EDGE,t:z.CLAMP_TO_EDGE}});let r;if(await re(this._images[a===R.INNER?R.OUTER:R.INNER].loadingPromise),V(t),l(),s.add(n),await s.loadImmediate(n),i.texture=n,i.material==null?(i.material=new ue({transparent:!0,textureId:n.id}),s.add(i.material)):i.material.setParameters({textureId:n.id}),a===R.INNER)r=j(i.material,i.renderExtent);else{const o=this._images[0].renderExtent;if(!o)return void l();r=ye(i.material,o,i.renderExtent)}i.renderGeometry=new ne(r),i.renderGeometry.localOrigin=this._overlays[a].renderLocalOrigin,this._drapeSourceRenderer.addGeometries([i.renderGeometry],C.UPDATE)}else l(),s.remove(i.material),i.material=null}_isScaleRangeLayer(){return"effectiveScaleRange"in this.layer}_isScaleRangeActive(){const a=this.layer;if(!this._isScaleRangeLayer())return!1;const{minScale:e,maxScale:t}=a.effectiveScaleRange;return oe(e,t)}_clippedExtent(a,e){if(this.view.viewingMode!=="local")return O(e,a);const t=this.view.basemapTerrain;return t.ready?le(a,t.extent,e):O(e,a)}_suspendedChangeHandler(){this.suspended?this.clear():this.refreshDebounced()}async _waitFetchReady(a){await he(()=>this.view.stationary,a),V(a)}};w([S()],m.prototype,"layer",void 0),w([S()],m.prototype,"suspended",void 0),w([S({readOnly:!0})],m.prototype,"fullExtentInLocalViewSpatialReference",void 0),w([S()],m.prototype,"updating",void 0),m=w([de("esri.views.3d.layers.DynamicLayerView3D")],m);const be=m,we=D();export{be as z}; diff --git a/assets/EdgeDetect.glsl-43794585.js b/assets/EdgeDetect.glsl-43794585.js new file mode 100644 index 0000000..8fabc75 --- /dev/null +++ b/assets/EdgeDetect.glsl-43794585.js @@ -0,0 +1 @@ +import{a4 as r}from"./index-080e108a.js";export{r as build}; diff --git a/assets/EdgeProcessingWorker-615066a5.js b/assets/EdgeProcessingWorker-615066a5.js new file mode 100644 index 0000000..a80b2ae --- /dev/null +++ b/assets/EdgeProcessingWorker-615066a5.js @@ -0,0 +1 @@ +import{eg as d,eh as c,ei as l,ej as r,ek as f,el as g,em as p}from"./index-080e108a.js";class I{async extract(e){const t=o(e),n=d(t),i=[t.data.buffer];return{result:h(n,i),transferList:i}}async extractComponentsEdgeLocations(e){const t=o(e),n=c(t.data,t.skipDeduplicate,t.indices,t.indicesLength),i=l(n,D,u),a=[];return{result:r(i.regular.instancesData,a),transferList:a}}async extractEdgeLocations(e){const t=o(e),n=c(t.data,t.skipDeduplicate,t.indices,t.indicesLength),i=l(n,w,u),a=[];return{result:r(i.regular.instancesData,a),transferList:a}}}function o(s){return{data:f.createView(s.dataBuffer),indices:s.indicesType==="Uint32Array"?new Uint32Array(s.indices):s.indicesType==="Uint16Array"?new Uint16Array(s.indices):s.indices,indicesLength:s.indicesLength,writerSettings:s.writerSettings,skipDeduplicate:s.skipDeduplicate}}function h(s,e){return e.push(s.regular.lodInfo.lengths.buffer),e.push(s.silhouette.lodInfo.lengths.buffer),{regular:{instancesData:r(s.regular.instancesData,e),lodInfo:{lengths:s.regular.lodInfo.lengths.buffer}},silhouette:{instancesData:r(s.silhouette.instancesData,e),lodInfo:{lengths:s.silhouette.lodInfo.lengths.buffer}},averageEdgeLength:s.averageEdgeLength}}class L{allocate(e){return g.createBuffer(e)}trim(e,t){return e.slice(0,t)}write(e,t,n){e.position0.setVec(t,n.position0),e.position1.setVec(t,n.position1)}}class m{allocate(e){return p.createBuffer(e)}trim(e,t){return e.slice(0,t)}write(e,t,n){e.position0.setVec(t,n.position0),e.position1.setVec(t,n.position1),e.componentIndex.set(t,n.componentIndex)}}const w=new L,D=new m,u={allocate:()=>null,write:()=>{},trim:()=>null};export{I as default}; diff --git a/assets/EdgeShader.glsl-e2d5d7be.js b/assets/EdgeShader.glsl-e2d5d7be.js new file mode 100644 index 0000000..3afa717 --- /dev/null +++ b/assets/EdgeShader.glsl-e2d5d7be.js @@ -0,0 +1 @@ +import{a8 as r}from"./index-080e108a.js";export{r as build}; diff --git a/assets/EditBusLayer-d71787e9.js b/assets/EditBusLayer-d71787e9.js new file mode 100644 index 0000000..25d0c4b --- /dev/null +++ b/assets/EditBusLayer-d71787e9.js @@ -0,0 +1 @@ +import{cu as x,cv as E,ai as $,al as w,cl as r}from"./index-080e108a.js";const I=new x.EventEmitter;function S(d,i,s=!1){const a=E();return s=i==null||s,I.emit("apply-edits",{serviceUrl:d,layerId:i,mayReceiveServiceEdits:s,result:a.promise}),a}const b="esri.layers.mixins.EditBusLayer",p=Symbol(b);function R(d){return d!=null&&typeof d=="object"&&p in d}const T=d=>{var i;let s=class extends d{constructor(...a){super(...a),this[i]=!0,this.when().then(()=>{this.own([I.on("apply-edits",g=>{const{serviceUrl:y,layerId:n,mayReceiveServiceEdits:f,result:j}=g,v=y===this.url,u=n!=null&&this.layerId!=null&&n===this.layerId;if(!v||!u&&!f)return;const A=j.then(e=>{var o;if(u&&(e.addedFeatures.length||e.updatedFeatures.length||e.deletedFeatures.length||e.addedAttachments.length||e.updatedAttachments.length||e.deletedAttachments.length))return this.emit("edits",r(e)),e;const c=(o=e.editedFeatures)==null?void 0:o.find(({layerId:l})=>l===this.layerId);if(c){const{adds:l,updates:h,deletes:F}=c.editedFeatures,m={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:l?l.map(({attributes:t})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],deletedFeatures:F?F.map(({attributes:t})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],updatedFeatures:h?h.map(({current:{attributes:t}})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],editedFeatures:r(e.editedFeatures),exceededTransferLimit:!1};return this.emit("edits",m),m}return{edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:r(e.editedFeatures),exceededTransferLimit:!1}});this.emit("apply-edits",{result:A})})])},()=>{})}};return i=p,s=$([w(b)],s),s};export{T as c,S as l,R as n}; diff --git a/assets/EditGeometryOperations-0ec3f5b5.js b/assets/EditGeometryOperations-0ec3f5b5.js new file mode 100644 index 0000000..3838e33 --- /dev/null +++ b/assets/EditGeometryOperations-0ec3f5b5.js @@ -0,0 +1 @@ +import{mz as f,mA as z,c7 as w,my as ge,oG as oe,rs as fe,oL as me,dS as P,dT as c,rt as xe,dk as I,m5 as ye,h1 as he,px as ve,fs as A,pj as B,bH as Ve,i$ as b,bG as Ee,ru as Te,j0 as De,rv as we,dD as Pe,hR as Me,cu as ae,c8 as Ae,ak as $e,kU as S,os as Re,kz as E,m0 as Ce,m4 as Ze,rw as H,lU as ce,rx as ze,m2 as Ie,n1 as J,ry as K,rz as Se,mF as G,n3 as ee,dQ as U,dR as C,gv as M,o3 as Le,pQ as Z,kA as Xe,gu as be,rA as te,rB as k,rC as Ge,pR as N,lV as Ue,rD as ke,mx as Ne,rE as ie}from"./index-080e108a.js";var l;(function(n){n[n.Z=0]="Z",n[n.M=1]="M"})(l||(l={}));let Ye=class{constructor(e){this.spatialReference=e}createVector(){return this._tag(f())}pointToVector(e){return this._tag(z(e.x,e.y))}arrayToVector(e){return this._tag(z(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,t=new w){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new w){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.hasZ=!1,t.hasM=!1,t.spatialReference=this.spatialReference,t}lerp(e,t,i,s){return ge(s,e,t,i)}addDelta(e,t,i){e[0]+=t,e[1]+=i}distance(e,t){return oe(e,t)}getZ(e,t=void 0){return t}hasZ(){return!1}getM(e,t=void 0){return t}hasM(){return!1}clone(e){return this._tag(fe(e))}copy(e,t){return me(t,e)}fromXYZ(e){return this._tag(z(e[0],e[1]))}toXYZ(e,t=c()){return P(t,e[0],e[1],0)}pointToXYZ(e,t=c()){return P(t,e.x,e.y,0)}equals(e,t){return xe(e,t)}_tag(e){return e}},se=class{constructor(e,t){this._valueType=e,this.spatialReference=t}createVector(){return this._tag(c())}pointToVector(e){return this._tag(I(e.x,e.y,this._valueType===l.Z?e.z:e.m))}arrayToVector(e){return this._tag(I(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return this._valueType===l.Z?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,t=new w){return t.x=e[0],t.y=e[1],t.z=this._valueType===l.Z?e[2]:void 0,t.m=this._valueType===l.M?e[2]:void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new w){return t.x=e[0],t.y=e[1],t.z=this._valueType===l.Z?e[2]:void 0,t.m=this._valueType===l.M?e[2]:void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){const i=this._valueType===l.Z,s=this._valueType===l.M;return t.x=e[0],t.y=e[1],t.z=i?e[2]:void 0,t.m=s?e[2]:void 0,t.hasZ=i,t.hasM=s,t.spatialReference=this.spatialReference,t}lerp(e,t,i,s){return ye(s,e,t,i)}addDelta(e,t,i,s){e[0]+=t,e[1]+=i,this._valueType===l.Z&&(e[2]+=s)}distance(e,t){return this._valueType===l.Z?he(e,t):oe(e,t)}getZ(e,t=void 0){return this._valueType===l.Z?e[2]:t}hasZ(){return this._valueType===l.Z}getM(e,t=void 0){return this._valueType===l.M?e[2]:t}hasM(){return this._valueType===l.M}clone(e){return this._tag(ve(e))}copy(e,t){return A(t,e)}fromXYZ(e,t=0,i=0){return this._tag(I(e[0],e[1],this._valueType===l.Z?e.length>2?e[2]:t:i))}toXYZ(e,t=c()){return P(t,e[0],e[1],this._valueType===l.Z?e[2]:0)}pointToXYZ(e,t=c()){return P(t,e.x,e.y,this._valueType===l.Z?e.z??0:0)}equals(e,t){return B(e,t)}_tag(e){return e}};class Oe{constructor(e){this.spatialReference=e}createVector(){return this._tag(Ve())}pointToVector(e){return this._tag(b(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(b(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,t=new w){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new w){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.hasZ=!0,t.hasM=!0,t.spatialReference=this.spatialReference,t}lerp(e,t,i,s){return Ee(s,e,t,i)}addDelta(e,t,i,s){e[0]+=t,e[1]+=i,e[2]+=s}distance(e,t){return he(e,t)}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(Te(e))}copy(e,t){return De(t,e)}fromXYZ(e,t=0,i=0){return this._tag(b(e[0],e[1],e.length>2?e[2]:t,i))}toXYZ(e,t=c()){return P(t,e[0],e[1],e[2])}pointToXYZ(e,t=c()){return P(t,e.x,e.y,e.z??0)}equals(e,t){return we(e,t)}_tag(e){return e}}function Be(n,e,t){return n&&e?new Oe(t):e?new se(l.M,t):n?new se(l.Z,t):new Ye(t)}function He(n,e){if(!e.supported)return;let t=1/0,i=-1/0;const s=e.upperBoundX-e.lowerBoundX;n.forEach(o=>{let h=o.pos[0];for(;he.upperBoundX;)h-=s;t=Math.min(t,h),i=Math.max(i,h),o.pos[0]=h});const r=i-t;s-r{o.pos[0]<0&&(o.pos[0]+=s)})}function qe(n,e){const t=Pe(n);return e===Me.Global&&t?{supported:!0,lowerBoundX:t.valid[0],upperBoundX:t.valid[1]}:{supported:!1,lowerBoundX:null,upperBoundX:null}}let $=class{constructor(e){this.component=e,this.leftEdge=null,this.rightEdge=null,this.type="vertex",this.index=null}get pos(){return this._pos}set pos(e){this._pos=e,this.component.unnormalizeVertexPositions()}},V=class{constructor(e,t,i){this.component=e,this.leftVertex=t,this.rightVertex=i,this.type="edge",t.rightEdge=this,i.leftEdge=this}};class Y{constructor(e,t){this._spatialReference=e,this._viewingMode=t,this.vertices=[],this.edges=[],this.index=null}unnormalizeVertexPositions(){this.vertices.length<=1||He(this.vertices,qe(this._spatialReference,this._viewingMode))}updateVertexIndex(e,t){if(this.vertices.length===0)return;const i=this.vertices[0];let s=null,r=e,o=t;do s=r,s.index=o++,r=s.rightEdge?s.rightEdge.rightVertex:null;while(r!=null&&r!==i);s.leftEdge&&s!==this.vertices[this.vertices.length-1]&&this.swapVertices(this.vertices.indexOf(s),this.vertices.length-1)}getFirstVertex(){return this.vertices.length===0?null:this.vertices[0]}getLastVertex(){return this.vertices.length===0?null:this.vertices[this.vertices.length-1]}isClosed(){return this.vertices.length>2&&this.vertices[0].leftEdge!==null}swapVertices(e,t){const i=this.vertices[e];this.vertices[e]=this.vertices[t],this.vertices[t]=i}iterateVertices(e){if(this.vertices.length===0)return;const t=this.vertices[0];let i=t;do e(i,i.index),i=i.rightEdge!=null?i.rightEdge.rightVertex:null;while(i!==t&&i!=null)}}class j extends ae{constructor(e,t){super(),this.type=e,this.coordinateHelper=t,this._geometry=null,this._dirty=!0,this.components=[]}get geometry(){if(this._dirty){switch(this.type){case"point":this._geometry=this._toPoint();break;case"polyline":this._geometry=this._toPolyline();break;case"polygon":this._geometry=this._toPolygon()}this._dirty=!1}return this._geometry}get spatialReference(){return this.coordinateHelper.spatialReference}notifyChanges(e){this._dirty=!0,this.emit("change",e)}_toPoint(){return this.components.length===0||this.components[0].vertices.length===0?null:this.coordinateHelper.vectorToPoint(this.components[0].vertices[0].pos)}_toPolyline(){const e=[],t=this.coordinateHelper.vectorToArray;for(const i of this.components){if(i.vertices.length<1)continue;const s=[];let r=i.vertices.find(h=>h.leftEdge==null);const o=r;do s.push(t(r.pos)),r=r.rightEdge?r.rightEdge.rightVertex:null;while(r&&r!==o);e.push(s)}return new Ae({paths:e,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}_toPolygon(){const e=[],t=this.coordinateHelper.vectorToArray;for(const i of this.components){if(i.vertices.length<1)continue;const s=[],r=i.vertices[0];let o=r;const h=o;do s.push(t(o.pos)),o=o.rightEdge!=null?o.rightEdge.rightVertex:null;while(o&&o!==h);i.isClosed()&&s.push(t(r.pos)),e.push(s)}return new $e({rings:e,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}static fromGeometry(e,t){const i=e.spatialReference,s=Be(e.hasZ,e.hasM,i),r=new j(e.type,s);switch(e.type){case"polygon":{const o=e.rings;for(let h=0;h2&&S(d[0],d[d.length-1]),m=_?d.length-1:d.length;for(let u=0;uthis.operation.apply(e)),this._editGeometry.components.forEach(e=>e.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:this._undone?"redo":"apply",updatedVertices:this._vertices})}undo(){this._vertices.forEach(e=>this.operation.undo(e)),this._editGeometry.notifyChanges({operation:"undo",updatedVertices:this._vertices}),this._undone=!0}canAccumulate(e){if(this._undone||e._vertices.length!==this._vertices.length)return!1;for(let t=0;tthis.operation.accumulate(t,e.operation)),this.operation.accumulateParams(e.operation),this._editGeometry.components.forEach(t=>t.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:"apply",updatedVertices:this._vertices}),!0)}};var x;(function(n){n[n.CUMULATIVE=0]="CUMULATIVE",n[n.REPLACE=1]="REPLACE"})(x||(x={}));let We=class{constructor(e,t,i=0){this._editGeometry=e,this._vertices=t,this._minNumberOfVertices=i,this.removedVertices=null}apply(){let e="redo";if(this.removedVertices==null){const t=this.removedVertices=[];this._vertices.forEach(i=>{const s=this._removeVertex(i);s!=null&&t.push(s)}),e="apply"}else this.removedVertices.forEach(t=>{this._removeVertex(t.removedVertex)});this._editGeometry.notifyChanges({operation:e,removedVertices:this._vertices})}undo(){var e;(e=this.removedVertices)==null||e.forEach(t=>{this._undoRemoveVertex(t)}),this._editGeometry.notifyChanges({operation:"undo",addedVertices:this._vertices})}accumulate(){return!1}_removeVertex(e){const t=e.component;if(t.vertices.length<=this._minNumberOfVertices)return null;const i={removedVertex:e,createdEdge:null},s=e.leftEdge,r=e.rightEdge;return t.vertices.splice(t.vertices.indexOf(e),1),s&&(t.edges.splice(t.edges.indexOf(s),1),s.leftVertex.rightEdge=null),r&&(t.edges.splice(t.edges.indexOf(r),1),r.rightVertex.leftEdge=null),e.index===0&&r&&this._vertices.length>0&&t.swapVertices(t.vertices.indexOf(r.rightVertex),0),s&&r&&(i.createdEdge=new V(t,s.leftVertex,r.rightVertex),t.edges.push(i.createdEdge)),r&&t.updateVertexIndex(r.rightVertex,r.rightVertex.index-1),i}_undoRemoveVertex(e){const t=e.removedVertex,i=e.removedVertex.component,s=t.leftEdge,r=t.rightEdge;e.createdEdge&&i.edges.splice(i.edges.indexOf(e.createdEdge),1),i.vertices.push(t),s&&(i.edges.push(s),s.leftVertex.rightEdge=s),r&&(i.edges.push(r),r.rightVertex.leftEdge=r),i.updateVertexIndex(t,t.index)}};class Qe{constructor(e,t,i){this._editGeometry=e,this._edge=t,this._t=i,this.createdVertex=null,this._left=null,this._right=null}apply(){let e="redo";const t=this._edge,i=t.component,s=t.leftVertex,r=t.rightVertex;i.edges.splice(i.edges.indexOf(t),1),this.createdVertex==null&&(e="apply",this.createdVertex=new $(t.component)),i.vertices.push(this.createdVertex),this.createdVertex.pos=this._editGeometry.coordinateHelper.lerp(t.leftVertex.pos,t.rightVertex.pos,this._t,this._editGeometry.coordinateHelper.createVector()),this._left==null&&(this._left=new V(i,s,this.createdVertex)),this._left.leftVertex.leftEdge?i.edges.push(this._left):i.edges.unshift(this._left),s.rightEdge=this._left,this._right==null&&(this._right=new V(i,this.createdVertex,r)),i.edges.push(this._right),r.leftEdge=this._right,i.updateVertexIndex(this.createdVertex,s.index+1),this._editGeometry.notifyChanges({operation:e,addedVertices:[this.createdVertex]})}undo(){if(this.createdVertex==null||this._left==null||this._right==null)return null;const e=this._edge,t=e.component,i=this.createdVertex.leftEdge,s=this.createdVertex.rightEdge,r=i==null?void 0:i.leftVertex,o=s==null?void 0:s.rightVertex;t.vertices.splice(t.vertices.indexOf(this.createdVertex),1),t.edges.splice(t.edges.indexOf(this._left),1),t.edges.splice(t.edges.indexOf(this._right),1),this._edge.leftVertex.leftEdge?t.edges.push(this._edge):t.edges.unshift(this._edge),r&&(r.rightEdge=e),o&&(o.leftEdge=e),r&&t.updateVertexIndex(r,r.index),this._editGeometry.notifyChanges({operation:"undo",removedVertices:[this.createdVertex]})}accumulate(){return!1}}let Je=class de{constructor(e,t,i){this._editGeometry=e,this._vertex=t,this._pos=i}apply(){const e=this._originalPosition==null;e&&(this._originalPosition=this._vertex.pos),this._apply(e?"apply":"redo")}undo(){this._vertex.pos=this._originalPosition,this._editGeometry.notifyChanges({operation:"undo",updatedVertices:[this._vertex]})}accumulate(e){return e instanceof de&&e._vertex===this._vertex&&(this._pos=e._pos,this._apply("apply"),!0)}_apply(e){this._vertex.pos=this._pos,this._editGeometry.components.forEach(t=>t.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:e,updatedVertices:[this._vertex]})}};class Ke{constructor(e,t){this._editGeometry=e,this._component=t,this._createdEdge=null}apply(){let e="redo";if(this._createdEdge==null){e="apply";const t=this._component.getFirstVertex(),i=this._component.getLastVertex();if(this._component.isClosed()||this._component.vertices.length<3||t==null||i==null)return;this._createdEdge=new V(this._component,i,t)}this._createdEdge.leftVertex.rightEdge=this._createdEdge,this._createdEdge.rightVertex.leftEdge=this._createdEdge,this._component.edges.push(this._createdEdge),this._editGeometry.notifyChanges({operation:e})}undo(){this._createdEdge!=null&&(Re(this._component.edges,this._createdEdge),this._createdEdge.leftVertex.rightEdge=null,this._createdEdge.rightVertex.leftEdge=null,this._editGeometry.notifyChanges({operation:"undo"}))}accumulate(){return!1}}let et=class ue{constructor(e,t,i,s){this._helper=e,this.dx=t,this.dy=i,this.dz=s}_move(e,t,i,s){this._helper.addDelta(e.pos,t,i,s)}apply(e){this._move(e,this.dx,this.dy,this.dz)}undo(e){this._move(e,-this.dx,-this.dy,-this.dz)}canAccumulate(e){return e instanceof ue}accumulate(e,t){this._move(e,t.dx,t.dy,t.dz)}accumulateParams(e){this.dx+=e.dx,this.dy+=e.dy,this.dz+=e.dz}};function O(n,e){return n[0]*e[1]-n[1]*e[0]}function tt(n,e,t){const i=ce(t,e)/ze(t);return Ie(n,t,i)}function pt(n,e,t,i,s=t){return E(D,i,t),E(q,e,s),tt(L,q,D),Ce(n,s,L)}function _t(n,e,t,i){E(D,e,t);const s=i/Ze(D);return H(n,t,D,s)}function it(n,e){const t=n.start,i=n.end,s=e.start,r=e.end,o=E(D,i,t),h=E(rt,r,s),d=O(o,h);if(Math.abs(d)<=st)return[];const a=E(q,t,s),_=O(h,a)/d,m=O(o,a)/d;if(_>=0){if(m>=0||e.type===T.LINE)return[H(L,t,o,_)]}else if(n.type===T.LINE&&(m>=0||e.type===T.LINE))return[H(L,t,o,_)];return[]}var T;(function(n){n[n.RAY=0]="RAY",n[n.LINE=1]="LINE"})(T||(T={}));const st=1e-6,D=f(),rt=f(),q=f(),L=f();class X{get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}constructor(e,t,i,s=0,r=R.IMMEDIATE){this._helper=e,this._planeType=t,this._edge=i,this.distance=s,this._plane=J(),this._offsetPlane=J(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,r===R.IMMEDIATE&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){var r,o,h,d;const e=this._toXYZ(this._edge.leftVertex.pos),t=this._toXYZ((o=(r=this._edge.leftVertex.leftEdge)==null?void 0:r.leftVertex)==null?void 0:o.pos),i=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ((d=(h=this._edge.rightVertex.rightEdge)==null?void 0:h.rightVertex)==null?void 0:d.pos);this._edgeDirection=K(c(),e,i),this._left=this._computeNeighbor(e,t,this._edgeDirection),this._right=this._computeNeighbor(i,s,this._edgeDirection)}_toXYZ(e){return e!=null?this._helper.toXYZ(e):null}_pointToXYZ(e){return this._toXYZ(this._helper.pointToVector(e))}_computeNeighbor(e,t,i){if(t==null)return{start:e,end:t,direction:I(-i[1],i[0],0),isOriginalDirection:!0};const s=K(c(),e,t),r=!this._passesBisectingAngleThreshold(s,i);return{start:e,end:t,direction:r?this._bisectVectorsPerpendicular(i,s):s,isOriginalDirection:!r}}_passesBisectingAngleThreshold(e,t){const i=Math.abs(Se(t,e));return i>=re&&i<=Math.PI-re}_bisectVectorsPerpendicular(e,t){const i=G(e,t)<0?e:ee(c(),e),s=Math.abs(G(i,t));if(!(s1-ne))return this._bisectDirection(i,t);const r=U(c(),i,[0,0,1]);return C(r,r)}_bisectDirection(e,t){const i=M(c(),e,t);return C(i,i)}_initializePlane(){const e=this._computeNormalDirection(this._left),t=this._computeNormalDirection(this._right);G(e,t)<0&&ee(t,t),Le(this._left.start,this._bisectDirection(e,t),this._plane)}_computeNormalDirection(e){const t=U(c(),e.direction,this._edgeDirection);C(t,t);const i=U(c(),this._edgeDirection,t);return this._planeType===F.XY&&(i[2]=0),C(i,i)}_initializeDistanceConstraints(){this._left.end==null||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(Z(this._plane,this._left.end)),this._right.end==null||this.requiresSplitEdgeRight||this._updateDistanceConstraint(Z(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(e){e<=0&&(this._minDistance=Math.max(this._minDistance,e)),e>=0&&(this._maxDistance=Math.min(this._maxDistance,e))}_updateIntersectDistanceConstraint(e){const t=N(e),i=this._edgeDirection,s=M(c(),this._left.start,this._left.direction),r=M(c(),this._right.start,this._right.direction),o=this._pointInBasis2D(f(),t,i,this._left.start),h=this._pointInBasis2D(f(),t,i,s),d=this._pointInBasis2D(f(),t,i,this._right.start),a=this._pointInBasis2D(f(),t,i,r),[_]=it({start:h,end:o,type:T.LINE},{start:a,end:d,type:T.LINE});if(!_)return;const m=E(f(),o,h);Xe(m,m);const p=E(f(),_,h),u=ce(m,p),g=M(c(),s,be(c(),this._left.direction,-u)),y=Z(e,g);this._updateDistanceConstraint(y)}_pointInBasis2D(e,t,i,s){return e[0]=te(t,s),e[1]=te(i,s),e}_offset(e,t){Number.isFinite(this._minDistance)&&(t=Math.max(this._minDistance,t)),Number.isFinite(this._maxDistance)&&(t=Math.min(this._maxDistance,t)),k(this._offsetPlane,this._plane),this._offsetPlane[3]-=t;const i=(r,o,h)=>o!=null&&ke(this._offsetPlane,r,M(c(),r,o),h),s=c();(e===this._edge.leftVertex?i(this._left.start,this._left.direction,s):i(this._right.start,this._right.direction,s))&&this._helper.copy(this._helper.fromXYZ(s,void 0,this._helper.getM(e.pos)),e.pos)}selectArrowFromStartPoint(e){this._selectedArrow=Ge(this.plane,this._pointToXYZ(e))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(e){return Z(this.plane,this._pointToXYZ(e))}apply(e){this._offset(e,this.distance)}undo(e){this._offset(e,0)}canAccumulate(e){return e instanceof X&&this._edge.leftVertex.index===e._edge.leftVertex.index&&this._edge.rightVertex.index===e._edge.rightVertex.index&&this._edge.component===e._edge.component&&this._maybeEqualsVec3(this._left.direction,e._left.direction)&&this._maybeEqualsVec3(this._right.direction,e._right.direction)&&B(N(this._plane),N(e._plane))}accumulate(e,t){const i=this._plane[3]-t._plane[3]+t.distance;this._offset(e,i)}accumulateParams(e){const t=e.distance-e._plane[3];this.distance=t+this._plane[3]}clone(){const e=new X(this._helper,this._planeType,this._edge,this.distance,R.DEFERRED);return k(e._plane,this._plane),k(e._offsetPlane,this._offsetPlane),e._maxDistance=this._maxDistance,e._minDistance=this._minDistance,e._left=this._cloneNeighbor(this._left),e._right=this._cloneNeighbor(this._right),e._edgeDirection=A(c(),this._edgeDirection),e}_maybeEqualsVec3(e,t){return e==null&&t==null||e!=null&&t!=null&&B(e,t)}_cloneNeighbor({start:e,end:t,direction:i,isOriginalDirection:s}){return{start:A(c(),e),end:t!=null?A(c(),t):null,direction:A(c(),i),isOriginalDirection:s}}}const re=Ue(15),ne=.001;var F,R;(function(n){n[n.XYZ=0]="XYZ",n[n.XY=1]="XY"})(F||(F={})),function(n){n[n.IMMEDIATE=0]="IMMEDIATE",n[n.DEFERRED=1]="DEFERRED"}(R||(R={}));class W{constructor(e,t,i=x.CUMULATIVE){this.origin=e,this.angle=t,this._accumulationType=i}_rotate(e,t){Ne(e.pos,e.pos,this.origin,t)}apply(e){this._rotate(e,this.angle)}undo(e){this._rotate(e,-this.angle)}canAccumulate(e){return e instanceof W&&S(this.origin,e.origin)}accumulate(e,t){const i=t._accumulationType===x.REPLACE;this._rotate(e,i?t.angle-this.angle:t.angle)}accumulateParams(e){const t=e._accumulationType===x.REPLACE;this.angle=t?e.angle:this.angle+e.angle}}class Q{constructor(e,t,i,s,r=x.CUMULATIVE){this.origin=e,this.axis1=t,this.factor1=i,this.factor2=s,this._accumulationType=r,this.axis2=z(t[1],-t[0])}_scale(e,t,i){ie(e.pos,e.pos,this.origin,this.axis1,t),ie(e.pos,e.pos,this.origin,this.axis2,i)}apply(e){this._scale(e,this.factor1,this.factor2)}undo(e){this._scale(e,1/this.factor1,1/this.factor2)}canAccumulate(e){return e instanceof Q&&S(this.origin,e.origin)&&S(this.axis1,e.axis1)}accumulate(e,t){t._accumulationType===x.REPLACE?this._scale(e,t.factor1/this.factor1,t.factor2/this.factor2):this._scale(e,t.factor1,t.factor2)}accumulateParams(e){const t=e._accumulationType===x.REPLACE;this.factor1=t?e.factor1:this.factor1*e.factor1,this.factor2=t?e.factor2:this.factor2*e.factor2}}class nt{constructor(){this._operations=[],this._closed=!1}close(){this._closed=!0}apply(){for(const e of this._operations)e.apply()}undo(){for(let e=this._operations.length-1;e>=0;e--)this._operations[e].undo()}accumulate(e){if(this._closed)return!1;const t=this._operations.length?this._operations[this._operations.length-1]:null;return t&&t.accumulate(e)||(this._operations.push(e),e.apply()),!0}}class pe extends ae{constructor(e){super(),this.data=e,this._undoStack=[],this._redoStack=[],this._listener=this.data.on("change",t=>{t.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:t.addedVertices,operation:t.operation}),t.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:t.removedVertices,operation:t.operation}),t.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:t.updatedVertices,operation:t.operation})})}destroy(){this._listener.remove()}splitEdge(e,t){return this._apply(new Qe(this.data,e,t))}updateVertices(e,t,i=v.ACCUMULATE_STEPS){return this._apply(new je(this.data,e,t),i)}moveVertices(e,t,i,s,r=v.ACCUMULATE_STEPS){return this.updateVertices(e,new et(this.data.coordinateHelper,t,i,s),r)}scaleVertices(e,t,i,s,r,o=v.ACCUMULATE_STEPS,h=x.CUMULATIVE){return this.updateVertices(e,new Q(t,i,s,r,h),o)}rotateVertices(e,t,i,s=v.ACCUMULATE_STEPS,r=x.CUMULATIVE){return this.updateVertices(e,new W(t,i,r),s)}removeVertices(e){return this._apply(new We(this.data,e,this._minNumVerticesPerType))}appendVertex(e){return this.data.components.length===0?null:this._apply(new Fe(this.data,this.data.components[0],e))}setVertexPosition(e,t){return this._apply(new Je(this.data,e,t))}offsetEdge(e,t,i,s=v.ACCUMULATE_STEPS){return this.updateVertices([t.leftVertex,t.rightVertex],new X(this.data.coordinateHelper,e,t,i),s)}closeComponent(e){return this.data.components.includes(e)?this._apply(new Ke(this.data,e)):null}canRemoveVertex(){return this.data.components[0].vertices.length>this._minNumVerticesPerType}createUndoGroup(){const e=new nt;return this._apply(e),{remove:()=>e.close()}}undo(){if(this._undoStack.length>0){const e=this._undoStack.pop();return e.undo(),this._redoStack.push(e),e}return null}redo(){if(this._redoStack.length>0){const e=this._redoStack.pop();return e.apply(),this._undoStack.push(e),e}return null}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack[this._undoStack.length-1]:null}get _minNumVerticesPerType(){switch(this.data.type){case"point":return 1;case"polyline":return 2;case"polygon":return 3;default:return 0}}_apply(e,t=v.ACCUMULATE_STEPS){return t!==v.NEW_STEP&&this.lastOperation!=null&&this.lastOperation.accumulate(e)||(e.apply(),this._undoStack.push(e),this._redoStack=[]),e}static fromGeometry(e,t){return new pe(j.fromGeometry(e,t))}}export{pt as L,pe as _,Y as l,_t as m,j as p,T as v,Be as w}; diff --git a/assets/ElevationLayer-61bc2d81.js b/assets/ElevationLayer-61bc2d81.js new file mode 100644 index 0000000..daf2d40 --- /dev/null +++ b/assets/ElevationLayer-61bc2d81.js @@ -0,0 +1 @@ +import{ap as m,aq as f,ar as w,as as g,at as n,au as T,av as S,aw as c,ax as d,ai as o,aj as s,ay as h,az as b,al as _,aA as $}from"./index-080e108a.js";import{O as I}from"./MultiOriginJSONSupport-e4912ffd.js";import{p as O}from"./ArcGISCachedService-344b6262.js";import{l as E}from"./ArcGISService-83287338.js";import{c as j}from"./OperationalLayer-0e8f8b28.js";import{j as A}from"./PortalLayer-310c2800.js";import{f as D}from"./commonProperties-30089b06.js";import"./TileInfoTilemapCache-b3f5dda7.js";import"./TilemapCache-67ada3c3.js";import"./portalItemUtils-792a27e1.js";let a=class extends O(E(j(A(I($))))){constructor(...e){super(...e),this.capabilities={operations:{supportsTileMap:!1}},this.copyright=null,this.heightModelInfo=null,this.path=null,this.minScale=void 0,this.maxScale=void 0,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=m()}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}destroy(){this._lercDecoder=f(this._lercDecoder)}readCapabilities(e,r){const t=r.capabilities&&r.capabilities.split(",").map(i=>i.toLowerCase().trim());return t?{operations:{supportsTileMap:t.includes("tilemap")}}:{operations:{supportsTileMap:!1}}}readVersion(e,r){let t=r.currentVersion;return t||(t=9.3),t}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:t=>{for(let i=0;ithis._fetchImageService(r))),Promise.resolve(this)}fetchTile(e,r,t,i){const l=(i=i||{signal:null}).signal!=null?i.signal:i.signal=new AbortController().signal,u={responseType:"array-buffer",signal:l},v={noDataValue:i.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(e,r,t,i)).then(()=>n(this.getTileUrl(e,r,t),u)).then(p=>this._lercDecoder.decode(p.data,v,l)).then(p=>new T(p))}getTileUrl(e,r,t){const i=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,l=S({...this.parsedUrl.query,blankTile:!i&&null});return`${this.parsedUrl.path}/tile/${e}/${r}/${t}${l?"?"+l:""}`}async queryElevation(e,r){const{ElevationQuery:t}=await c(()=>import("./ElevationQuery-6f358c3e.js"),["assets/ElevationQuery-6f358c3e.js","assets/index-080e108a.js","assets/index-a8e73b5e.css"]);return d(r),new t().query(this,e,r)}async createElevationSampler(e,r){const{ElevationQuery:t}=await c(()=>import("./ElevationQuery-6f358c3e.js"),["assets/ElevationQuery-6f358c3e.js","assets/index-080e108a.js","assets/index-a8e73b5e.css"]);return d(r),new t().createSampler(this,e,r)}_fetchTileAvailability(e,r,t,i){return this.tilemapCache?this.tilemapCache.fetchAvailability(e,r,t,i):Promise.resolve("unknown")}async _fetchImageService(e){var i;if(this.sourceJSON)return this.sourceJSON;const r={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:e},t=await n(this.parsedUrl.path,r);t.ssl&&(this.url=(i=this.url)==null?void 0:i.replace(/^http:/i,"https:")),this.sourceJSON=t.data,this.read(t.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile[y]}};o([s({readOnly:!0})],a.prototype,"capabilities",void 0),o([h("service","capabilities",["capabilities"])],a.prototype,"readCapabilities",null),o([s({json:{read:{source:"copyrightText"}}})],a.prototype,"copyright",void 0),o([s({readOnly:!0,type:b})],a.prototype,"heightModelInfo",void 0),o([s({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],a.prototype,"path",void 0),o([s({type:["show","hide"]})],a.prototype,"listMode",void 0),o([s({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],a.prototype,"minScale",void 0),o([s({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],a.prototype,"maxScale",void 0),o([s({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],a.prototype,"opacity",void 0),o([s({type:["ArcGISTiledElevationServiceLayer"]})],a.prototype,"operationalLayerType",void 0),o([s()],a.prototype,"sourceJSON",void 0),o([s({json:{read:!1},value:"elevation",readOnly:!0})],a.prototype,"type",void 0),o([s(D)],a.prototype,"url",void 0),o([s()],a.prototype,"version",void 0),o([h("version",["currentVersion"])],a.prototype,"readVersion",null),a=o([_("esri.layers.ElevationLayer")],a);const y=Symbol("default-fetch-tile");a.prototype.fetchTile[y]=!0;const k=a;export{k as default}; diff --git a/assets/ElevationLayerView3D-eeaaa8c4.js b/assets/ElevationLayerView3D-eeaaa8c4.js new file mode 100644 index 0000000..96fa3fa --- /dev/null +++ b/assets/ElevationLayerView3D-eeaaa8c4.js @@ -0,0 +1 @@ +import{ar as c,ai as i,aj as d,al as h}from"./index-080e108a.js";import{n as u}from"./LayerView3D-ffd35809.js";import{o as v}from"./TiledLayerView3D-a11f8026.js";import{d as f}from"./LayerView-448bc5ea.js";let e=class extends v(u(f)){constructor(){super(...arguments),this.type="elevation-3d"}get tileInfo(){return this.layer.tileInfo}initialize(){var r,s,o,l,n;const a=(s=(r=this.view)==null?void 0:r.map)==null?void 0:s.allLayers,y=a&&a.includes(this.layer),t=(n=(l=(o=this.view)==null?void 0:o.map)==null?void 0:l.ground)==null?void 0:n.layers,m=t&&t.includes(this.layer);if(y&&!m){const p=new c("layerview:elevation-layer-only","3D elevation layer '"+this.layer.id+"' can only be added to layers in map.ground");this.addResolvingPromise(Promise.reject(p))}this._addTilingSchemeMatchPromise()}};i([d()],e.prototype,"layer",void 0),i([d()],e.prototype,"tileInfo",null),e=i([h("esri.views.3d.layers.ElevationLayerView3D")],e);const j=e;export{j as default}; diff --git a/assets/ElevationQuery-6f358c3e.js b/assets/ElevationQuery-6f358c3e.js new file mode 100644 index 0000000..9a93794 --- /dev/null +++ b/assets/ElevationQuery-6f358c3e.js @@ -0,0 +1 @@ +import{fG as U,ar as d,bd as q,be as I,fH as L,dB as Q,fI as O,cZ as D,fv as E,as as V,fp as W,fJ as P,dz as H,b7 as B,c9 as R,c8 as J,c7 as $,fK as k}from"./index-080e108a.js";class G{constructor(e,t=null){if(this.tile=e,t!=null&&e!=null){const i=e.extent;this._samplerData=new U(t,i)}}get zmin(){return this._samplerData!=null?this._samplerData.data.minValue:0}get zmax(){return this._samplerData!=null?this._samplerData.data.maxValue:0}sample(e,t){if(this._samplerData==null)return;const{safeWidth:i,data:n,dx:s,dy:l,y1:o,x0:a}=this._samplerData,{width:r,values:c,noDataValue:f}=n,p=Z(l*(o-t),0,i),u=Z(s*(e-a),0,i),T=Math.floor(p),C=Math.floor(u),w=T*r+C,F=w+r,_=c[w],g=c[F],M=c[w+1],z=c[F+1];if(_!==f&&g!==f&&M!==f&&z!==f){const S=u-C,b=_+(M-_)*S;return b+(g+(z-g)*S-b)*(p-T)}}}function Z(h,e,t){return ht?t:h}class ee{async queryAll(e,t,i){if(!(e=i&&i.ignoreInvisibleLayers?e.filter(r=>r.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");const n=y.fromGeometry(t);let s=!1;i&&i.returnSampleInfo||(s=!0);const l={...x,...i,returnSampleInfo:!0},o=await this.query(e[e.length-1],n,l),a=await this._queryAllContinue(e,o,l);return a.geometry=a.geometry.export(),s&&delete a.sampleInfo,a}async query(e,t,i){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||!(t instanceof y)&&t.type!=="point"&&t.type!=="multipoint"&&t.type!=="polyline")throw new d("elevation-query:invalid-geometry","Only point, polyline and multipoint geometries can be used to query elevation");const n={...x,...i},s=new K(e,t.spatialReference,n),l=n.signal;return await e.load({signal:l}),await this._createGeometryDescriptor(s,t,l),await this._selectTiles(s,l),await this._populateElevationTiles(s,l),this._sampleGeometryWithElevation(s),this._createQueryResult(s,l)}async createSampler(e,t,i){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const n={...x,...i};return this._createSampler(e,t,n)}async createSamplerAll(e,t,i){if(!(e=i&&i.ignoreInvisibleLayers?e.filter(l=>l.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const n={...x,...i,returnSampleInfo:!0},s=await this._createSampler(e[e.length-1],t,n);return this._createSamplerAllContinue(e,t,s,n)}async _createSampler(e,t,i,n){const s=i.signal;await e.load({signal:s});const l=t.spatialReference,o=e.tileInfo.spatialReference;l.equals(o)||(await q([{source:l,dest:o}],{signal:s}),t=I(t,o));const a=new X(e,t,i,n);return await this._selectTiles(a,s),await this._populateElevationTiles(a,s),new L(a.elevationTiles,a.layer.tileInfo,a.options.noDataValue)}async _createSamplerAllContinue(e,t,i,n){if(e.pop(),!e.length)return i;const s=i.samplers.map(r=>Q(r.extent)),l=await this._createSampler(e[e.length-1],t,n,s);if(l.samplers.length===0)return i;const o=i.samplers.concat(l.samplers),a=new L(o,n.noDataValue);return this._createSamplerAllContinue(e,t,a,n)}async _queryAllContinue(e,t,i){const n=e.pop(),s=t.geometry.coordinates,l=t.sampleInfo;O(l);const o=[],a=[];for(let p=0;p=0?u.source||(u.source=n):e.length&&(o.push(s[p]),a.push(p))}if(!e.length||o.length===0)return t;const r=t.geometry.clone(o),c=await this.query(e[e.length-1],r,i),f=c.sampleInfo;if(!f)throw new Error("no sampleInfo");return a.forEach((p,u)=>{s[p].z=c.geometry.coordinates[u].z,l[p].demResolution=f[u].demResolution}),this._queryAllContinue(e,t,i)}async _createQueryResult(e,t){const i=await e.geometry.project(e.outSpatialReference,t);O(i);const n={geometry:i.export(),noDataValue:e.options.noDataValue};return e.options.returnSampleInfo&&(n.sampleInfo=this._extractSampleInfo(e)),e.geometry.coordinates.forEach(s=>{s.tile=null,s.elevationTile=null}),n}async _createGeometryDescriptor(e,t,i){let n;const s=e.layer.tileInfo.spatialReference;if(t instanceof y?n=await t.project(s,i):(await q([{source:t.spatialReference,dest:s}],{signal:i}),n=I(t,s)),!n)throw new d("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${t.spatialReference.wkid}' on an elevation service in '${s.wkid}'`);e.geometry=y.fromGeometry(n)}async _selectTiles(e,t){e.type==="geometry"&&this._preselectOutsideLayerExtent(e);const i=e.options.demResolution;if(typeof i=="number")this._selectTilesClosestResolution(e,i);else if(i==="finest-contiguous")await this._selectTilesFinestContiguous(e,t);else{if(i!=="auto")throw new d("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${i}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,t)}}_preselectOutsideLayerExtent(e){if(e.layer.fullExtent==null)return;const t=new G(null);t.sample=()=>e.options.noDataValue,e.outsideExtentTile=t;const i=e.layer.fullExtent;e.geometry.coordinates.forEach(n=>{const s=n.x,l=n.y;(si.xmax||li.ymax)&&(n.elevationTile=t)})}_selectTilesClosestResolution(e,t){const i=this._findNearestDemResolutionLODIndex(e,t);e.selectTilesAtLOD(i)}_findNearestDemResolutionLODIndex(e,t){const{tileInfo:i,tilemapCache:n}=e.layer,s=t/D(i.spatialReference),l=v(i,n);let o=l[0],a=0;for(let r=1;rs.fetchAvailability(o.level,o.row,o.col,{signal:i}))),i);else if(await this._populateElevationTiles(e,i),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new d("elevation-query:has-unavailable-tiles")}catch(o){V(o),await this._selectTilesFinestContiguousAt(e,t-1,i)}}async _populateElevationTiles(e,t){const i=e.getTilesToFetch(),n={},s=e.options.cache,l=e.options.noDataValue,o=i.map(async a=>{if(a.id==null)return;const r=`${e.layer.uid}:${a.id}:${l}`,c=s!=null?s.get(r):null,f=c??await e.layer.fetchTile(a.level,a.row,a.col,{noDataValue:l,signal:t});s!=null&&s.put(r,f),n[a.id]=new G(a,f)});await E(W(o),t),e.populateElevationTiles(n)}async _selectTilesAuto(e,t){this._selectTilesAutoFinest(e),this._reduceTilesForMaximumRequests(e);const i=e.layer.tilemapCache;if(!i||A(i))return this._selectTilesAutoPrefetchUpsample(e,t);const n=e.getTilesToFetch(),s={},l=n.map(async o=>{const a=new P(null,0,0,0,H()),r=await B(i.fetchAvailabilityUpsample(o.level,o.row,o.col,a,{signal:t}));r.ok!==!1?o.id!=null&&(s[o.id]=a):V(r.error)});await E(Promise.all(l),t),e.remapTiles(s)}_reduceTilesForMaximumRequests(e){const t=e.layer.tileInfo;let i=0;const n={},s=a=>{a.id!=null&&(a.id in n?n[a.id]++:(n[a.id]=1,i++))},l=a=>{if(a.id==null)return;const r=n[a.id];r===1?(delete n[a.id],i--):n[a.id]=r-1};e.forEachTileToFetch(s,l);let o=!0;for(;o&&(o=!1,e.forEachTileToFetch(a=>{i<=e.options.maximumAutoTileRequests||(l(a),t.upsampleTile(a)&&(o=!0),s(a))},l),o););}_selectTilesAutoFinest(e){const{tileInfo:t,tilemapCache:i}=e.layer,n=N(t,i,e.options.minDemResolution);e.selectTilesAtLOD(n,e.options.maximumAutoTileRequests)}async _selectTilesAutoPrefetchUpsample(e,t){const i=e.layer.tileInfo;await this._populateElevationTiles(e,t);let n=!1;e.forEachTileToFetch((s,l)=>{i.upsampleTile(s)?n=!0:l()}),n&&await this._selectTilesAutoPrefetchUpsample(e,t)}_sampleGeometryWithElevation(e){e.geometry.coordinates.forEach(t=>{const i=t.elevationTile;let n=e.options.noDataValue;if(i){const s=i.sample(t.x,t.y);s!=null?n=s:t.elevationTile=null}t.z=n})}_extractSampleInfo(e){const t=e.layer.tileInfo,i=D(t.spatialReference);return e.geometry.coordinates.map(n=>{let s=-1;return n.elevationTile&&n.elevationTile!==e.outsideExtentTile&&(s=t.lodAt(n.elevationTile.tile.level).resolution*i),{demResolution:s}})}}class y{export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const t=new y;return t.geometry=this.geometry,t.spatialReference=this.spatialReference,t.coordinates=e||this.coordinates.map(i=>i.clone()),t._exporter=this._exporter,t}async project(e,t){if(this.spatialReference.equals(e))return this.clone();await q([{source:this.spatialReference,dest:e}],{signal:t});const i=new R({spatialReference:this.spatialReference,points:this.coordinates.map(o=>[o.x,o.y])}),n=I(i,e);if(!n)return null;const s=this.coordinates.map((o,a)=>{const r=o.clone(),c=n.points[a];return r.x=c[0],r.y=c[1],r}),l=this.clone(s);return l.spatialReference=e,l}static fromGeometry(e){const t=new y;if(t.geometry=e,t.spatialReference=e.spatialReference,e instanceof y)t.coordinates=e.coordinates.map(i=>i.clone()),t._exporter=(i,n)=>{const s=e.clone(i);return s.spatialReference=n,s};else switch(e.type){case"point":{const i=e,{hasZ:n,hasM:s}=i;t.coordinates=n&&s?[new m(i.x,i.y,i.z,i.m)]:n?[new m(i.x,i.y,i.z)]:s?[new m(i.x,i.y,null,i.m)]:[new m(i.x,i.y)],t._exporter=(l,o)=>e.hasM?new $(l[0].x,l[0].y,l[0].z,l[0].m,o):new $(l[0].x,l[0].y,l[0].z,o);break}case"multipoint":{const i=e,{hasZ:n,hasM:s}=i;t.coordinates=n&&s?i.points.map(l=>new m(l[0],l[1],l[2],l[3])):n?i.points.map(l=>new m(l[0],l[1],l[2])):s?i.points.map(l=>new m(l[0],l[1],null,l[2])):i.points.map(l=>new m(l[0],l[1])),t._exporter=(l,o)=>e.hasM?new R({points:l.map(a=>[a.x,a.y,a.z,a.m]),hasZ:!0,hasM:!0,spatiaReference:o}):new R(l.map(a=>[a.x,a.y,a.z]),o);break}case"polyline":{const i=e,n=[],s=[],{hasZ:l,hasM:o}=e;let a=0;for(const r of i.paths)if(s.push([a,a+r.length]),a+=r.length,l&&o)for(const c of r)n.push(new m(c[0],c[1],c[2],c[3]));else if(l)for(const c of r)n.push(new m(c[0],c[1],c[2]));else if(o)for(const c of r)n.push(new m(c[0],c[1],null,c[2]));else for(const c of r)n.push(new m(c[0],c[1]));t.coordinates=n,t._exporter=(r,c)=>{const f=e.hasM?r.map(u=>[u.x,u.y,u.z,u.m]):r.map(u=>[u.x,u.y,u.z]),p=s.map(u=>f.slice(u[0],u[1]));return new J({paths:p,hasM:e.hasM,hasZ:!0,spatialReference:c})};break}}return t}}class m{constructor(e,t,i=null,n=null,s=null,l=null){this.x=e,this.y=t,this.z=i,this.m=n,this.tile=s,this.elevationTile=l}clone(){return new m(this.x,this.y,this.z,this.m)}}class j{constructor(e,t){this.layer=e,this.options=t}}class K extends j{constructor(e,t,i){super(e,i),this.outSpatialReference=t,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(t=>t.tile=null);else{const{tileInfo:t,tilemapCache:i}=this.layer,n=v(t,i)[e].level;this.geometry.coordinates.forEach(s=>s.tile=t.tileAt(n,s.x,s.y))}}allElevationTilesFetched(){return!this.geometry.coordinates.some(e=>!e.elevationTile)}clearElevationTiles(){for(const e of this.geometry.coordinates)e.elevationTile!==this.outsideExtentTile&&(e.elevationTile=null)}populateElevationTiles(e){var t;for(const i of this.geometry.coordinates)!i.elevationTile&&((t=i.tile)!=null&&t.id)&&(i.elevationTile=e[i.tile.id])}remapTiles(e){var t;for(const i of this.geometry.coordinates){const n=(t=i.tile)==null?void 0:t.id;i.tile=n?e[n]:null}}getTilesToFetch(){var i;const e={},t=[];for(const n of this.geometry.coordinates){const s=n.tile;if(!s)continue;const l=(i=n.tile)==null?void 0:i.id;n.elevationTile||!l||e[l]||(e[l]=s,t.push(s))}return t}forEachTileToFetch(e){for(const t of this.geometry.coordinates)t.tile&&!t.elevationTile&&e(t.tile,()=>{t.tile=null})}}class X extends j{constructor(e,t,i,n){super(e,i),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=t.intersection(e.fullExtent),this.maskExtents=n}selectTilesAtLOD(e,t){const i=this._maximumLodForRequests(t),n=Math.min(i,e);n<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(n)}_maximumLodForRequests(e){const{tileInfo:t,tilemapCache:i}=this.layer,n=v(t,i);if(!e)return n.length-1;const s=this.extent;if(s==null)return-1;for(let l=n.length-1;l>=0;l--){const o=n[l],a=o.resolution*t.size[0],r=o.resolution*t.size[1];if(Math.ceil(s.width/a)*Math.ceil(s.height/r)<=e)return l}return-1}allElevationTilesFetched(){return this._candidateTiles.length===this.elevationTiles.length}clearElevationTiles(){this.elevationTiles.length=0,this._fetchedCandidates.clear()}populateElevationTiles(e){for(const t of this._candidateTiles){const i=t.id&&e[t.id];i&&(this._fetchedCandidates.add(t),this.elevationTiles.push(i))}}remapTiles(e){this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles.map(t=>e[t.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,t){const i=this._candidateTiles;this._candidateTiles=[],i.forEach(n=>{if(this._fetchedCandidates.has(n))return void(t&&t(n));let s=!1;e(n,()=>s=!0),s?t&&t(n):this._candidateTiles.push(n)}),this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles,t)}_uniqueNonOverlappingTiles(e,t){const i={},n=[];for(const l of e){const o=l.id;o&&!i[o]?(i[o]=l,n.push(l)):t&&t(l)}const s=n.sort((l,o)=>l.level-o.level);return s.filter((l,o)=>{for(let a=0;ae.extent&&k(t,e.extent))}}function N(h,e,t=0){const i=v(h,e);let n=i.length-1;if(t>0){const s=t/D(h.spatialReference),l=i.findIndex(o=>o.resolution0&&(n=l-1)}return n}const x={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0};function v(h,e){const t=h.lods;if(A(e)){const{effectiveMinLOD:i,effectiveMaxLOD:n}=e;return t.filter(s=>s.level>=i&&s.level<=n)}return t}function A(h){return(h==null?void 0:h.tileInfo)!=null}export{ee as ElevationQuery,y as GeometryDescriptor,N as getFinestLodIndex}; diff --git a/assets/ElevationSamplerWorker-d53250c9.js b/assets/ElevationSamplerWorker-d53250c9.js new file mode 100644 index 0000000..7a63474 --- /dev/null +++ b/assets/ElevationSamplerWorker-d53250c9.js @@ -0,0 +1 @@ +import{en as p,cn as h}from"./index-080e108a.js";import{h as c}from"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";class f{async createIndex(t,n){const r=new Array;if(!t.vertexAttributes||!t.vertexAttributes.position)return new c;const a=this._createMeshData(t),o=n!=null?await n.invoke("createIndexThread",a,{transferList:r}):this.createIndexThread(a).result;return this._createPooledRBush().fromJSON(o)}createIndexThread(t){const n=new Float64Array(t.position),r=this._createPooledRBush();return t.components?this._createIndexComponentsThread(r,n,t.components.map(a=>new Uint32Array(a))):this._createIndexAllThread(r,n)}_createIndexAllThread(t,n){const r=new Array(n.length/9);let a=0;for(let o=0;o!r.faces)?{position:n}:{position:n,components:t.components.map(r=>r.faces)}}_createPooledRBush(){return new c(9,h("esri-csp-restrictions")?t=>t:[".minX",".minY",".maxX",".maxY"])}}function l(e,t,n,r){return{minX:Math.min(e[t],e[n],e[r]),maxX:Math.max(e[t],e[n],e[r]),minY:Math.min(e[t+1],e[n+1],e[r+1]),maxY:Math.max(e[t+1],e[n+1],e[r+1]),p0:[e[t],e[t+1],e[t+2]],p1:[e[n],e[n+1],e[n+2]],p2:[e[r],e[r+1],e[r+2]]}}export{f as default}; diff --git a/assets/EventedSet-d13fada5.js b/assets/EventedSet-d13fada5.js new file mode 100644 index 0000000..dfe47cd --- /dev/null +++ b/assets/EventedSet-d13fada5.js @@ -0,0 +1 @@ +import{cu as h,dt as r,du as i}from"./index-080e108a.js";class d extends h{constructor(){super(...arguments),this._set=new Set}clear(){if(this._set.size>0){const e=this.toArray();this._set.clear(),this.emit("after-changes",{type:r.REMOVE}),this.emit("change",{added:[],removed:e})}}get length(){return this._set.size}addMany(e){if(e.length!==0){for(const t of e)this._set.add(t);this.emit("after-changes",{type:r.ADD}),this.emit("change",{added:e,removed:[]})}}remove(e){this._set.delete(e)&&(this.emit("after-changes",{type:r.REMOVE}),this.emit("change",{added:[],removed:[e]}))}removeMany(e){const t=[];for(const s of e)this._set.delete(s)&&t.push(s);t.length>0&&(this.emit("after-changes",{type:r.REMOVE}),this.emit("change",{added:[],removed:t}))}toArray(){return[...this._set]}find(e){let t;return i(this._set,s=>!!e(s)&&(t=s,!0)),t}forEach(e){this._set.forEach(t=>e(t))}}export{d as r}; diff --git a/assets/ExportImageParameters-649a2637.js b/assets/ExportImageParameters-649a2637.js new file mode 100644 index 0000000..e181a2e --- /dev/null +++ b/assets/ExportImageParameters-649a2637.js @@ -0,0 +1 @@ +import{cX as p,ai as a,aj as l,al as u,ao as b}from"./index-080e108a.js";import{n as d}from"./sql-734ecbc5.js";import{b as f}from"./commonProperties-30089b06.js";import{n as m}from"./floorFilterUtils-080a7cd2.js";import{n as g}from"./sublayerUtils-1269bca6.js";const S={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let t=class extends p(b){constructor(e){super(e),this.floors=null,this.scale=0}destroy(){this.layer=null}get dynamicLayers(){if(!this.hasDynamicLayers)return null;const e=this.visibleSublayers.map(s=>{const n=m(this.floors,s);return s.toExportImageJSON(n)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&g(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.handles.remove("layer"),e&&this.handles.add([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",s=>this.notifyChange(S[s.propertyName]))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map(s=>s.id).join(","):"show:-1":null}get layerDefs(){var n;const e=!!((n=this.floors)!=null&&n.length),s=this.visibleSublayers.filter(i=>i.definitionExpression!=null||e&&i.floorInfo!=null);return s.length?JSON.stringify(s.reduce((i,r)=>{const o=m(this.floors,r),y=d(o,r.definitionExpression);return y!=null&&(i[r.id]=y),i},{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers"),this.commitProperty("timeExtent");const e=this.layer;return e&&(e.commitProperty("dpi"),e.commitProperty("imageFormat"),e.commitProperty("imageTransparency"),e.commitProperty("gdbVersion")),(this._get("version")||0)+1}get visibleSublayers(){const e=[];if(!this.layer)return e;const s=this.layer.sublayers,n=r=>{const o=this.scale,y=o===0,h=r.minScale===0||o<=r.minScale,c=r.maxScale===0||o>=r.maxScale;r.visible&&(y||h&&c)&&(r.sublayers?r.sublayers.forEach(n):e.unshift(r))};s&&s.forEach(n);const i=this._get("visibleSublayers");return!i||i.length!==e.length||i.some((r,o)=>e[o]!==r)?e:i}toJSON(){const e=this.layer;let s={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?s.dynamicLayers=this.dynamicLayers:s={...s,layers:this.layers,layerDefs:this.layerDefs},s}};a([l({readOnly:!0})],t.prototype,"dynamicLayers",null),a([l()],t.prototype,"floors",void 0),a([l({readOnly:!0})],t.prototype,"hasDynamicLayers",null),a([l()],t.prototype,"layer",null),a([l({readOnly:!0})],t.prototype,"layers",null),a([l({readOnly:!0})],t.prototype,"layerDefs",null),a([l({type:Number})],t.prototype,"scale",void 0),a([l(f)],t.prototype,"timeExtent",void 0),a([l({readOnly:!0})],t.prototype,"version",null),a([l({readOnly:!0})],t.prototype,"visibleSublayers",null),t=a([u("esri.layers.mixins.ExportImageParameters")],t);export{t as m}; diff --git a/assets/ExportWMSImageParameters-d63354ac.js b/assets/ExportWMSImageParameters-d63354ac.js new file mode 100644 index 0000000..715f8d0 --- /dev/null +++ b/assets/ExportWMSImageParameters-d63354ac.js @@ -0,0 +1 @@ +import{cX as c,ai as a,aj as l,al as h,ao as b}from"./index-080e108a.js";const v={visible:"visibleSublayers"};let s=class extends c(b){constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.handles.remove("layer"),e&&this.handles.add([e.sublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("wms-sublayer-update",r=>this.notifyChange(v[r.propertyName]))],"layer"))}get layers(){return this.visibleSublayers.filter(({name:e})=>e).map(({name:e})=>e).join()}get version(){this.commitProperty("layers");const e=this.layer;return e&&e.commitProperty("imageTransparency"),(this._get("version")||0)+1}get visibleSublayers(){const{layer:e,scale:r}=this,t=e==null?void 0:e.sublayers,i=[],o=n=>{const{minScale:y,maxScale:p,sublayers:u,visible:m}=n;m&&(r===0||(y===0||r<=y)&&(p===0||r>=p))&&(u?u.forEach(o):i.push(n))};return t==null||t.forEach(o),i}toJSON(){const{layer:e,layers:r}=this,{imageFormat:t,imageTransparency:i,version:o}=e;return{format:t,request:"GetMap",service:"WMS",styles:"",transparent:i?"TRUE":"FALSE",version:o,layers:r}}};a([l()],s.prototype,"layer",null),a([l({readOnly:!0})],s.prototype,"layers",null),a([l({type:Number})],s.prototype,"scale",void 0),a([l({readOnly:!0})],s.prototype,"version",null),a([l({readOnly:!0})],s.prototype,"visibleSublayers",null),s=a([h("esri.layers.support.ExportWMSImageParameters")],s);export{s as l}; diff --git a/assets/Factory-8e329f4b.js b/assets/Factory-8e329f4b.js new file mode 100644 index 0000000..a3a654e --- /dev/null +++ b/assets/Factory-8e329f4b.js @@ -0,0 +1,5 @@ +import{kC as A,kD as N,kE as M,kF as p,kG as j,kH as D,kI as T,hW as w,dT as d,kJ as L,hJ as z,kK as S,b3 as Z}from"./index-080e108a.js";function h(t,e){return C(t,()=>e)}function C(t,e){const n=d(),c=d();let o=!1;return a=>{const l=e(a);if(a.action==="start"){const i=N(a.screenStart,M(p.get())),r=j(t.state.camera,i,y);r!=null&&(o=D(l,r,n))}if(!o)return null;const s=N(a.screenEnd,M(p.get())),u=j(t.state.camera,s,y);return u==null?null:D(l,u,c)?{...a,renderStart:n,renderEnd:c,plane:l,ray:u}:null}}var m;function E(t){let e=null;return n=>{switch(n.action){case"start":e=t.disableDisplay();break;case"end":case"cancel":e!=null&&(e.remove(),e=null)}return n}}function P(t,e=null){const n=T(t.state.viewingMode);n.options.selectionMode=!0,n.options.store=w.MIN,n.options.hud=!1;const c=S(),o={requiresGroundFeedback:!0,enableDraped:!0,exclude:new Set},a=d(),l=e??t.spatialReference,s=i=>{t.map.ground&&t.map.ground.opacity<1?o.exclude.add(L):o.exclude.delete(L),t.sceneIntersectionHelper.intersectIntersectorScreen(N(i,c),n,o);const r=n.results.min;let I;if(r.getIntersectionPoint(a))I=r.intersector===z.TERRAIN?m.GROUND:m.OTHER;else{if(!n.results.ground.getIntersectionPoint(a))return null;I=m.GROUND}return{location:t.renderCoordsHelper.fromRenderCoords(a,l),surfaceType:I}};let u;return i=>{if(i.action==="start"){const I=s(i.screenStart);u=I!=null?I.location:null}if(u==null)return null;const r=s(i.screenEnd);return r!=null&&r.location!=null?{...i,mapStart:u,mapEnd:r.location,surfaceType:r.surfaceType}:null}}(function(t){t[t.GROUND=0]="GROUND",t[t.OTHER=1]="OTHER"})(m||(m={}));const y=A(),x="theme-style";function b(t,e){return R(Y(H(f(t),e)),e.size)}function H(t,{accentColor:e,contrastColor:n}){const c=e.toHex(),o=e.a,a=n.toHex(),l=n.a,s=t.getElementsByTagNameNS("http://www.w3.org/2000/svg","style").namedItem(x);return s&&(s.innerHTML=` + .contrast-fill { fill: ${a}; fill-opacity: ${l}; } + .contrast-stroke { stroke: ${a}; stroke-opacity: ${l}; } + .accent-fill { fill: ${c}; fill-opacity: ${o}; } + .accent-stroke { stroke: ${c}; stroke-opacity: ${o}; }`),t}function f(t){const e=t.split(",")[1],n=atob(e);return new DOMParser().parseFromString(n,"image/svg+xml")}function Y(t){const e=new XMLSerializer().serializeToString(t);return`data:image/svg+xml;base64,${btoa(e)}`}function R(t,e){const n=new Image(e,e);return n.src=t,n}const G="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1NiIgaGVpZ2h0PSI1NiIgZmlsbD0ibm9uZSIgdmVyc2lvbj0iMi4wIj48c3R5bGUgaWQ9InRoZW1lLXN0eWxlIj4uY29udHJhc3QtZmlsbHtmaWxsOiNmZmZ9LmNvbnRyYXN0LXN0cm9rZXtzdHJva2U6I2ZmZn0uYWNjZW50LWZpbGx7ZmlsbDojZmY3ZjAwO2ZpbGwtb3BhY2l0eTouNX08L3N0eWxlPjxwYXRoIGQ9Ik0yOCAwYTI4IDI4IDAgMSAxIDAgNTYgMjggMjggMCAwIDEgMC01NnoiIGNsYXNzPSJhY2NlbnQtZmlsbCIvPjxwYXRoIHN0cm9rZS13aWR0aD0iNC45OSIgZD0iTTIwLjA1IDQwLjg2YTE1LjA1IDE1LjA1IDAgMCAwIDE3LjE0LTEuNSAxNS4wNSAxNS4wNSAwIDAgMCA0LjQ3LTE2LjY1IDE1LjA1IDE1LjA1IDAgMCAwLTIyLjcyLTcuMTUgMTUuMDUgMTUuMDUgMCAwIDAtNS41IDcuMTUiIGNsYXNzPSJjb250cmFzdC1zdHJva2UiLz48cGF0aCBkPSJtMTAuOTcgMzUuNTcgNS4zOCAxMi4wNyA3Ljc5LTEzLjQ3LTEzLjE3IDEuNHoiIGNsYXNzPSJjb250cmFzdC1maWxsIi8+PC9zdmc+",v="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1NiIgaGVpZ2h0PSI1NiIgZmlsbD0ibm9uZSIgdmVyc2lvbj0iMi4wIj48c3R5bGUgaWQ9InRoZW1lLXN0eWxlIj4uY29udHJhc3QtZmlsbHtmaWxsOiNmZmZ9LmNvbnRyYXN0LXN0cm9rZXtzdHJva2U6I2ZmZn0uYWNjZW50LWZpbGx7ZmlsbDojZmY3ZjAwO2ZpbGwtb3BhY2l0eTouNX08L3N0eWxlPjxjaXJjbGUgY3g9IjM5LjQ3OCIgY3k9IjMuMDc4IiByPSIyOCIgY2xhc3M9ImFjY2VudC1maWxsIiB0cmFuc2Zvcm09InJvdGF0ZSg0MC41NDIpIi8+PHBhdGggc3Ryb2tlLXdpZHRoPSI1IiBkPSJtNy4wNzQgMzAuMDUzIDI5LjM5NyAxMS45ODUtMy42NzMtMzMuNDkzIiBjbGFzcz0iY29udHJhc3Qtc3Ryb2tlIi8+PHBhdGggc3Ryb2tlLXdpZHRoPSIyLjk5NiIgZD0iTTI0LjUwNCAyMy4yMDdhMTEuOTgyIDExLjk4MiAwIDAgMC05LjggNy41MDciIGNsYXNzPSJjb250cmFzdC1zdHJva2UgY29udHJhc3QtZmlsbCIvPjxwYXRoIGQ9Im0yOS44MTggMjIuODA4LTYuMTg0IDQuNi0uNTQxLTguMzY0eiIgY2xhc3M9ImNvbnRyYXN0LWZpbGwiLz48L3N2Zz4=",g=64;function k(t,e){const{accentColor:n,contrastColor:c,preMultiplyAlpha:o}=e;return t.fromData(`heading-rotate:[accent:${n},contrast:${c},size:${g}]`,()=>new Z(b(G,{accentColor:n,contrastColor:c,size:g}),{mipmap:!0,preMultiplyAlpha:o}))}function O(t,e){const{accentColor:n,contrastColor:c,preMultiplyAlpha:o}=e;return t.fromData(`tilt-rotate:[accent:${n},contrast:${c},size:${g}]`,()=>new Z(b(v,{accentColor:n,contrastColor:c,size:g}),{mipmap:!0,preMultiplyAlpha:o}))}export{E as A,P as F,h as H,O as l,k as n}; diff --git a/assets/FeatureCollectionSnappingSource-3f1024ad.js b/assets/FeatureCollectionSnappingSource-3f1024ad.js new file mode 100644 index 0000000..105584a --- /dev/null +++ b/assets/FeatureCollectionSnappingSource-3f1024ad.js @@ -0,0 +1 @@ +import{ao as b,aG as c,ag as h,aT as E,ax as s,ai as a,aj as r,al as F,fv as V}from"./index-080e108a.js";import{m as C}from"./elevationInfoUtils-4fd79d95.js";import{E as D,b as $}from"./DimensionAnalysisView3D-4f55aca1.js";import{i as A,o as I}from"./queryEngineUtils-342680f6.js";import{i as m,r as x,n as v}from"./symbologySnappingCandidates-816beafe.js";import"./LineVisualElement-b605d10c.js";import"./LengthDimension-92faee98.js";import"./Segment-50129b50.js";import"./unitFormatUtils-b70a7bff.js";import"./analysisViewUtils-68ab721d.js";import"./ImageMaterial-5c48df66.js";import"./Factory-8e329f4b.js";import"./RightAngleQuadVisualElement-8daf0594.js";import"./VisualElementResources-e52972a5.js";import"./PointVisualElement-2a56e55d.js";import"./EditGeometryOperations-0ec3f5b5.js";import"./dehydratedFeatureComparison-a3375a3e.js";import"./VertexSnappingCandidate-0a987e12.js";let o=class extends b{get availability(){return 1}get updating(){return this.layerSource.updating}get _snappingElevationAligner(){const{view:e}=this,{layer:t}=this.layerSource,i=e!=null&&e.type==="3d";if(!i||t.type==="subtype-group")return m();const n=async(p,l)=>(await V(e.whenLayerView(t),l)).elevationAlignPointsInFeatures(p,l);return m(i,{elevationInfo:t.elevationInfo,alignPointsInFeatures:n,spatialReference:e.spatialReference})}get _snappingElevationFilter(){const{view:e}=this,t=e!=null&&e.type==="3d"&&this.layerSource.layer.type!=="subtype-group";return x(t)}get _symbologySnappingFetcher(){const{view:e}=this,{layer:t}=this.layerSource;return e!=null&&e.type==="3d"&&t.type!=="subtype-group"?v(this._symbologySnappingSupported,async(i,n)=>{const p=await e.whenLayerView(t);return s(n),p.queryForSymbologySnapping({candidates:i,spatialReference:e.spatialReference},n)}):v()}get _symbologySnappingSupported(){return this._layerView3D!=null&&this._layerView3D.symbologySnappingSupported}initialize(){const{view:e}=this,{layer:t}=this.layerSource;e!=null&&e.type==="3d"&&t.type!=="subtype-group"&&(e.whenLayerView(t).then(i=>this._layerView3D=i),this.addHandles([e.elevationProvider.on("elevation-change",({context:i})=>{const{elevationInfo:n}=t;C(i,n)&&this._snappingElevationAligner.notifyElevationSourceChange()}),c(()=>t.elevationInfo,()=>this._snappingElevationAligner.notifyElevationSourceChange(),h),c(()=>{var i;return this._layerView3D!=null?(i=this._layerView3D.processor)==null?void 0:i.renderer:null},()=>this._symbologySnappingFetcher.notifySymbologyChange(),h),E(()=>{var i;return(i=this._layerView3D)==null?void 0:i.layer},["edits","apply-edits","graphic-update"],()=>this._symbologySnappingFetcher.notifySymbologyChange())]))}constructor(e){super(e),this.view=null,this._layerView3D=null}refresh(){}async fetchCandidates(e,t){var u;const{layer:i}=this.layerSource,n=i.source;if(!(n!=null&&n.querySnapping))return[];const p=D(i),l=$(e,((u=this.view)==null?void 0:u.type)??"2d",p),d=await n.querySnapping(l,{signal:t});s(t);const y=await this._snappingElevationAligner.alignCandidates(d.candidates,t);s(t);const g=await this._symbologySnappingFetcher.fetch(y,t);s(t);const S=g.length===0?y:[...y,...g],w=this._snappingElevationFilter.filter(l,S),_=this._getGroundElevation;return w.map(f=>A(f,_))}get _getGroundElevation(){return I(this.view)}};a([r({constructOnly:!0})],o.prototype,"layerSource",void 0),a([r({constructOnly:!0})],o.prototype,"view",void 0),a([r()],o.prototype,"_snappingElevationAligner",null),a([r()],o.prototype,"_snappingElevationFilter",null),a([r()],o.prototype,"_symbologySnappingFetcher",null),a([r()],o.prototype,"_layerView3D",void 0),a([r()],o.prototype,"_symbologySnappingSupported",null),a([r()],o.prototype,"_getGroundElevation",null),o=a([F("esri.views.interactive.snapping.featureSources.FeatureCollectionSnappingSource")],o);export{o as FeatureCollectionSnappingSource}; diff --git a/assets/FeatureEffect-86735d98.js b/assets/FeatureEffect-86735d98.js new file mode 100644 index 0000000..ba6ca87 --- /dev/null +++ b/assets/FeatureEffect-86735d98.js @@ -0,0 +1 @@ +import{ai as s,aj as u,cO as c,al as y,cP as h,cQ as b,ck as m,ar as o}from"./index-080e108a.js";import{d as x}from"./FeatureFilter-00f4be05.js";var a;const f={read:{reader:h},write:{writer:b,overridePolicy(){return{allowNull:this.excludedEffect!=null,isRequired:this.excludedEffect==null}}}},p={read:{reader:h},write:{writer:b,overridePolicy(){return{allowNull:this.includedEffect!=null,isRequired:this.includedEffect==null}}}},w={name:"showExcludedLabels",default:!0};let r=a=class extends m{constructor(l){super(l),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(l,e){var d,i;const t=super.write(l,e);if(e!=null&&e.origin){if(t.filter){const n=Object.keys(t.filter);if(n.length>1||n[0]!=="where")return(d=e.messages)==null||d.push(new o("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:e.layer,effect:this})),null}if("showExcludedLabels"in t)return(i=e.messages)==null||i.push(new o("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:e.layer,effect:this})),null}return t}clone(){return new a({filter:this.filter!=null?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};s([u({type:x,json:{write:{allowNull:!0,writer(l,e,t,d){const i=l==null?void 0:l.write({},d);i&&Object.keys(i).length!==0?c(t,i,e):c(t,null,e)}}}})],r.prototype,"filter",void 0),s([u({json:{write:!0,origins:{"web-map":f,"portal-item":f}}})],r.prototype,"includedEffect",void 0),s([u({json:{write:!0,origins:{"web-map":p,"portal-item":p}}})],r.prototype,"excludedEffect",void 0),s([u({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":w,"portal-item":w}}})],r.prototype,"excludedLabelsVisible",void 0),r=a=s([y("esri.layers.support.FeatureEffect")],r);const g=r;export{g as w}; diff --git a/assets/FeatureEffectLayer-4160946c.js b/assets/FeatureEffectLayer-4160946c.js new file mode 100644 index 0000000..993640f --- /dev/null +++ b/assets/FeatureEffectLayer-4160946c.js @@ -0,0 +1 @@ +import{ai as t,aj as s,al as o}from"./index-080e108a.js";import{w as i}from"./FeatureEffect-86735d98.js";const r={write:{allowNull:!0}},p=a=>{let e=class extends a{constructor(){super(...arguments),this.featureEffect=null}};return t([s({type:i,json:{origins:{"web-map":r,"portal-item":r}}})],e.prototype,"featureEffect",void 0),e=t([o("esri.layers.mixins.FeatureEffectLayer")],e),e};export{p}; diff --git a/assets/FeatureFilter-00f4be05.js b/assets/FeatureFilter-00f4be05.js new file mode 100644 index 0000000..b05733e --- /dev/null +++ b/assets/FeatureFilter-00f4be05.js @@ -0,0 +1 @@ +import{cp as y,ai as i,aj as s,cr as R,cR as w,al as S,ck as j,cl as r}from"./index-080e108a.js";import{b as v}from"./Query-1c961d4c.js";var m;const u=new y({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new y({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let e=m=class extends j{constructor(t){super(t),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(t={}){const{where:l,geometry:n,spatialRelationship:a,timeExtent:o,objectIds:p,units:c,distance:h}=this;return new v({geometry:r(n),objectIds:r(p),spatialRelationship:a,timeExtent:r(o),where:l,units:c,distance:h,...t})}clone(){const{where:t,geometry:l,spatialRelationship:n,timeExtent:a,objectIds:o,units:p,distance:c}=this;return new m({geometry:r(l),objectIds:r(o),spatialRelationship:n,timeExtent:r(a),where:t,units:p,distance:c})}};i([s({type:String,json:{write:!0}})],e.prototype,"where",void 0),i([s({types:R,json:{write:!0}})],e.prototype,"geometry",void 0),i([s({type:u.apiValues,json:{name:"spatialRel",read:{reader:u.read},write:{allowNull:!1,writer:u.write,overridePolicy(){return{enabled:this.geometry!=null}}}}})],e.prototype,"spatialRelationship",void 0),i([s({type:Number,json:{write:{overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],e.prototype,"distance",void 0),i([s({type:[Number],json:{write:!0}})],e.prototype,"objectIds",void 0),i([s({type:d.apiValues,json:{read:d.read,write:{writer:d.write,overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],e.prototype,"units",void 0),i([s({type:w,json:{write:!0}})],e.prototype,"timeExtent",void 0),e=m=i([S("esri.layers.support.FeatureFilter")],e);const x=e;export{x as d}; diff --git a/assets/FeatureFilter-2d6ab0aa.js b/assets/FeatureFilter-2d6ab0aa.js new file mode 100644 index 0000000..2ae58e8 --- /dev/null +++ b/assets/FeatureFilter-2d6ab0aa.js @@ -0,0 +1 @@ +import{bz as m,aw as _,ar as p,dz as u,dJ as c}from"./index-080e108a.js";import{z as y,v as f,n as w}from"./QueryEngine-19eda5ff.js";import{b as I}from"./Query-1c961d4c.js";import{I as b}from"./Pipeline-98b9d349.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./FieldsIndex-f79a8f26.js";import"./StreamFeatureManager-4b8ac3ac.js";import"./quickselect-e80674f5.js";import"./diffUtils-590c9088.js";import"./arcadeTimeUtils-e1438cc8.js";import"./centroid-8e8cfa47.js";import"./ogcFeatureUtils-1ccf1f8d.js";import"./geojson-077f67ec.js";import"./clientSideDefaults-ab04bd90.js";import"./defaultsJSON-59981e75.js";import"./query-93c6e211.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./createConnection-4b117798.js";import"./definitions-0bc08d4c.js";import"./TileInfoView-346e56d0.js";import"./number-e491b09e.js";import"./geohashUtils-77d8429b.js";const d=m.getLogger("esri.views.2d.layers.features.support.whereUtils"),T={getAttribute:(r,e)=>r.field(e)};async function g(r,e){const t=await _(()=>import("./WhereClause-c86b9974.js").then(i=>i.W),["assets/WhereClause-c86b9974.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/executionError-c92d3b85.js"]);try{const i=t.WhereClause.create(r,e);if(!i.isStandardized){const s=new p("mapview - bad input","Unable to apply filter's definition expression, as expression is not standardized.",i);d.error(s)}return s=>{const n=s.readArcadeFeature();return i.testFeature(n,T)}}catch{return d.warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",r),s=>!0}}const a=1,v=2;class te{constructor(e){this._geometryBounds=u(),this._idToVisibility=new Map,this._serviceInfo=e}get hash(){return this._hash}check(e){return this._applyFilter(e)}clear(){const e=this._resetAllHiddenIds();return this.update(),{show:e,hide:[]}}invalidate(){this._idToVisibility.forEach((e,t)=>{this._idToVisibility.set(t,0)})}setKnownIds(e){for(const t of e)this._idToVisibility.set(t,a)}setTrue(e){const t=[],i=[],s=new Set(e);return this._idToVisibility.forEach((n,o)=>{const l=!!(this._idToVisibility.get(o)&a),h=s.has(o);!l&&h?t.push(o):l&&!h&&i.push(o),this._idToVisibility.set(o,h?a|v:0)}),{show:t,hide:i}}createQuery(){const{geometry:e,spatialRel:t,where:i,timeExtent:s,objectIds:n}=this;return I.fromJSON({geometry:e,spatialRel:t,where:i,timeExtent:s,objectIds:n})}async update(e,t){this._hash=JSON.stringify(e);const i=await y(e,null,t);await Promise.all([this._setGeometryFilter(i),this._setIdFilter(i),this._setAttributeFilter(i),this._setTimeFilter(i)])}async _setAttributeFilter(e){if(!e||!e.where)return this._clause=null,void(this.where=null);this._clause=await g(e.where,this._serviceInfo.fieldsIndex),this.where=e.where}_setIdFilter(e){this._idsToShow=e&&e.objectIds&&new Set(e.objectIds),this._idsToHide=e&&e.hiddenIds&&new Set(e.hiddenIds),this.objectIds=e&&e.objectIds}async _setGeometryFilter(e){if(!e||!e.geometry)return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const t=e.geometry,i=e.spatialRel||"esriSpatialRelIntersects",s=await f(i,t,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);c(this._geometryBounds,t),this._spatialQueryOperator=s,this.geometry=t,this.spatialRel=i}_setTimeFilter(e){if(this.timeExtent=this._timeOperator=null,e&&e.timeExtent)if(this._serviceInfo.timeInfo)this.timeExtent=e.timeExtent,this._timeOperator=w(this._serviceInfo.timeInfo,e.timeExtent,b);else{const t=new p("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",e.timeExtent);m.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(t)}}_applyFilter(e){return this._filterByGeometry(e)&&this._filterById(e)&&this._filterByTime(e)&&this._filterByExpression(e)}_filterByExpression(e){return!this.where||this._clause(e)}_filterById(e){return(!this._idsToHide||!this._idsToHide.size||!this._idsToHide.has(e.getObjectId()))&&(!this._idsToShow||!this._idsToShow.size||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;const t=e.readHydratedGeometry();return!!t&&this._spatialQueryOperator(t)}_filterByTime(e){return this._timeOperator==null||this._timeOperator(e)}_resetAllHiddenIds(){const e=[];return this._idToVisibility.forEach((t,i)=>{t&a||(this._idToVisibility.set(i,a),e.push(i))}),e}}export{te as default}; diff --git a/assets/FeatureLayer-5c6d2c3b.js b/assets/FeatureLayer-5c6d2c3b.js new file mode 100644 index 0000000..d38d66e --- /dev/null +++ b/assets/FeatureLayer-5c6d2c3b.js @@ -0,0 +1 @@ +import{bz as A,gC as Z,cY as U,cX as B,ar as f,ca as K,ak as Y,fD as H,cn as X,hs as M,ai as s,jx as ee,aK as q,cj as te,aj as n,al as S,aF as C,ao as re,eQ as ie,eS as se,eR as oe,cz as ae,af as ne,bc as le,ah as ue,as as pe,cO as F,bf as de,c5 as R,hi as P,jb as ye,bW as ce,jc as he,fv as me,aw as I,at as fe,hj as ge,ay as d,jy as be,bY as E,cl as $,cC as we,f4 as ve,aA as _e,jz as Fe}from"./index-080e108a.js";import"./UniqueValueRenderer-fef4204d.js";import{o as Se,p as Te,n as Ie}from"./jsonUtils-f73b3833.js";import{O as Ee}from"./MultiOriginJSONSupport-e4912ffd.js";import{n as $e}from"./sql-734ecbc5.js";import{w as je,y as De}from"./FeatureLayerBase-7c7dfccb.js";import{i as Oe}from"./editsZScale-1b5a53a6.js";import{t as L}from"./queryZScale-8f9616ff.js";import{d as J}from"./FeatureSet-111cb247.js";import{i as Ce}from"./APIKeyMixin-878a7aa7.js";import{l as Me}from"./ArcGISService-83287338.js";import{o as qe}from"./CustomParametersMixin-231c4be8.js";import{c as Re}from"./EditBusLayer-d71787e9.js";import{p as Pe}from"./FeatureEffectLayer-4160946c.js";import{n as Le}from"./FeatureReductionLayer-4262cf54.js";import{c as xe}from"./OperationalLayer-0e8f8b28.js";import{c as Ge}from"./OrderedLayer-68067459.js";import{j as Ne}from"./PortalLayer-310c2800.js";import{a as Ae,d as Je}from"./TemporalLayer-f17c9161.js";import{v as ke,m as Ve,g as Qe,c as We,S as ze,p as Ze,l as Ue}from"./commonProperties-30089b06.js";import{M as Be,Q as Ke,S as Ye,R as He,v as Xe,y as et,m as tt,h as rt,w as it,E as st,b as ot,g as at,j as nt,q as lt,F as ut,I as pt,P as dt,A as yt,O as ct,d as x}from"./featureLayerUtils-6cf06f83.js";import{p as k}from"./FeatureTemplate-2a7e96c1.js";import{n as V}from"./FeatureType-db96032c.js";import{s as ht}from"./fieldProperties-62c55499.js";import{C as mt}from"./LabelClass-2d53c485.js";import{i as G}from"./labelingInfo-144f3d9f.js";import{n as ft}from"./serviceCapabilitiesUtils-959e798a.js";import{e as gt}from"./versionUtils-f17daa93.js";import{b as bt,K as wt}from"./Query-1c961d4c.js";import{t as vt}from"./styleUtils-25825fd6.js";import{S as v}from"./TopFeaturesQuery-e44d05be.js";import{p as _t}from"./popupUtils-82ea8abb.js";import"./diffUtils-590c9088.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./FeatureEffect-86735d98.js";import"./FeatureFilter-00f4be05.js";import"./portalItemUtils-792a27e1.js";import"./AttachmentQuery-972bbd60.js";import"./RelationshipQuery-39c07195.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";let Ft=0;const Q="esri.layers.graphics.sources.MemorySource",j=A.getLogger(Q);let g=class extends Z.LoadableMixin(U(B(C))){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}get _workerGeometryType(){var t;const e=(t=this.layer)==null?void 0:t.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);L(e,this.layer.spatialReference,r);const i=J.fromJSON(r);if(!this._requiresClientGraphicMapping())return i;const o=this.layer.objectIdField;for(const l of i.features){const u=l.attributes[o],y=this._idToClientGraphic.get(u);y&&(l.geometry=y.geometry)}return i.geometryType=this.layer.geometryType,i}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new f("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return L(e,this.layer.spatialReference,r),r}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(r=>({count:r.count,extent:K.fromJSON(r.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async _applyEdits(e){if(!this._connection)throw new f("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let r=null;const i=[],o=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const l=p=>"objectId"in p&&p.objectId!=null?p.objectId:"attributes"in p&&p.attributes[t]!=null?p.attributes[t]:null;if(e.addFeatures&&(r=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const p of e.deleteFeatures){const c=l(p);c!=null&&i.push(c)}const u=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures){for(const p of e.updateFeatures)if(o.push(this._serializeFeature(p)),u){const c=l(p);c!=null&&u.set(c,p)}}Oe(r?r.features:null,o,this.layer.spatialReference);const{fullExtent:y,featureEditResults:h}=await this._connection.invoke("applyEdits",{adds:r?r.features:[],updates:o,deletes:i});return this.fullExtent=y,r&&r.finish(h.uidToObjectId),this._updateClientGraphicIds(u,h),this._createEditsResult(h)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!=="mesh"||e==null)return;const r=[];for(const{geometry:i}of e)i==null||i.type!=="mesh"||i.hasExtent||i.loaded||r.push(i.load({signal:t}));r.length&&await Promise.all(r)}_updateClientGraphicIds(e,t){if(this._idToClientGraphic){if(e)for(const r of t.updateResults){if(!r.success)continue;const i=e.get(r.objectId);i!=null&&this._addIdToClientGraphic(i)}for(const r of t.deleteResults)r.success&&this._idToClientGraphic.delete(r.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new f("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,r=new Array(e.length);let i=null;for(let l=0;l{j.error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),b.preventDefault()}));const p={features:h.features,fields:t&&t.map(b=>b.toJSON()),geometryType:M.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!=="mesh"&&o,hasZ:this._layerOrSourceGeometryType==="mesh"||l,objectIdField:i,spatialReference:y?null:r&&r.toJSON(),timeInfo:u?u.toJSON():null},c=await this._connection.invoke("load",p,{signal:e});for(const b of c.warnings)j.warn(b.message,{layer:this.layer,warning:b});c.featureErrors.length&&j.warn(`Encountered ${c.featureErrors.length} validation errors while loading features`,c.featureErrors);const T=c.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(h.inferredGeometryType)&&(T.geometryType=M.toJSON(h.inferredGeometryType)),this.sourceJSON=T,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),h.finish(c.assignedObjectIds)}};s([ee({Type:q,ensureType:te(q)})],g.prototype,"itemType",void 0),s([n()],g.prototype,"type",void 0),s([n({constructOnly:!0})],g.prototype,"layer",void 0),s([n({readOnly:!0})],g.prototype,"_workerGeometryType",null),s([n()],g.prototype,"sourceJSON",void 0),g=s([S(Q)],g);let w=class extends re{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};s([n()],w.prototype,"updating",void 0),s([n()],w.prototype,"status",void 0),w=s([S("esri.layers.support.PublishingInfo")],w);const St=w,W="esri.layers.mixins.PublishableLayer",Tt=Symbol(W),It=e=>{var t;let r=class extends e{constructor(){super(...arguments),this[t]=!0}get publishingInfo(){if(this.destroyed)return null;const i=this._get("publishingInfo");if(i)return i;const o=new St;return this._checkPublishingStatus(o),o}_checkPublishingStatus(i){let u=0;const y=async p=>{let c;i.updating=!0;try{c=await this.fetchPublishingStatus()}catch{c="unavailable"}c!=="published"&&c!=="unavailable"||(i.status==="publishing"&&this.refresh(),h.remove()),i.status=c,i.updating=!1,h.removed||(u=setTimeout(y,p,p+125))},h={removed:!1,remove(){this.removed=!0,clearTimeout(u)}};this.when().catch(()=>h.remove()),y(250),this.own(h)}};return t=Tt,s([n({readOnly:!0,clonable:!1})],r.prototype,"publishingInfo",null),r=s([S(W)],r),r},m="FeatureLayer",z="esri.layers.FeatureLayer",Et=A.getLogger(z);function _(e,t){return new f("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function N(e){return e&&e instanceof C}const D=ht();function O(e,t,r){const i=!!(r!=null&&r.writeLayerSchema);return{enabled:i,ignoreOrigin:i}}let a=class extends je(Le(Pe(It(Re(ie(Ge(Ae(se(oe(Me(xe(Ne(Ee(qe(Ce(ae(_e))))))))))))))))){constructor(...e){super(...e),this._handles=new ne,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=le.WGS84,this.subtypeCode=null,this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0}destroy(){var e;(e=this.source)==null||e.destroy(),this._handles=ue(this._handles)}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){var i;const t=e!=null?e.signal:null;if((i=this.portalItem)!=null&&i.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(o=>this.initLayerProperties(o))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection"]},e).catch(pe).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){const o=await this._fetchFirstLayerId(t);o!=null&&(this.layerId=o)}if(!this.url&&!this._hasMemorySource())throw new f("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>this._setUserPrivileges(this.serviceItemId,e)).then(()=>Be(this,e));return this.addResolvingPromise(r),Promise.resolve(this)}readCapabilities(e,t){return t=t.layerDefinition||t,ft(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){var e;return!(this.loaded&&!((e=this.capabilities)!=null&&e.operations.supportsEditing))&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}get effectiveEditingEnabled(){return Ke(this)}readIsTable(e,t){return(t=(t==null?void 0:t.layerDefinition)??t).type==="Table"||!t.geometryType}writeIsTable(e,t,r,i){i!=null&&i.writeLayerSchema&&F(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return Ye(t.layerDefinition||t)}readObjectIdField(e,t){return He(t.layerDefinition||t)}get parsedUrl(){const e=de(this.url);return e!=null&&(this.dynamicDataSource!=null?e.path=R(e.path,"dynamicLayer"):this.layerId!=null&&(e.path=R(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){P(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){var o;t=t.layerDefinition||t;const i=(o=t.drawingInfo)==null?void 0:o.renderer;if(i){const l=Se(i,t,r)??void 0;return l||Et.error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),l}return Xe(t,r)}set source(e){const t=this._get("source");t!==e&&(N(t)&&this._resetMemorySource(t),N(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof C?new g({layer:this,items:e}):e:null}readSource(e,t){const r=J.fromJSON(t.featureSet);return new g({layer:this,items:(r==null?void 0:r.features)??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r&&r.creatorField,o=r&&r.editorField;return e=e&&e.map(l=>k.fromJSON(l)),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){var o;const r=((o=t.layerDefinition)==null?void 0:o.name)??t.name,i=t.title||t.layerDefinition&&t.layerDefinition.title;if(r){const l=this.portalItem&&this.portalItem.title;if(this.sublayerTitleMode==="item-title")return this.url?ye(this.url,r):r;let u=r;if(!u&&this.url){const y=ce(this.url);y!=null&&(u=y.title)}return u?(this.sublayerTitleMode==="item-title-and-service-name"&&l&&l!==u&&(u=l+" - "+u),he(u)):void 0}if(this.sublayerTitleMode==="item-title"&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition&&t.layerDefinition.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const i=t.fields.find(o=>o.name.toLowerCase()===r);i&&(r=i.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r&&r.creatorField,o=r&&r.editorField;return e&&e.map(l=>(l=V.fromJSON(l),this._fixTemplates(l.templates,i),this._fixTemplates(l.templates,o),l))}readVisible(e,t){return t.layerDefinition&&t.layerDefinition.defaultVisibility!=null?!!t.layerDefinition.defaultVisibility:t.visibility!=null?!!t.visibility:void 0}async addAttachment(e,t){return et(this,e,t,m)}async updateAttachment(e,t,r){return tt(this,e,t,r,m)}async applyEdits(e,t){return rt(this,e,t)}async uploadAssets(e,t){return it(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return _t(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await me(I(()=>import("./FeatureLayerSource-b0c6b618.js"),["assets/FeatureLayerSource-b0c6b618.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/editingSupport-b5feb7b5.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/EditBusLayer-d71787e9.js","assets/clientSideDefaults-ab04bd90.js","assets/QueryEngineCapabilities-42e44ded.js","assets/defaultsJSON-59981e75.js","assets/QueryTask-6f808a9e.js","assets/Query-1c961d4c.js","assets/executeForIds-5eaf002d.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/executeQueryJSON-7c41ada5.js","assets/FeatureSet-111cb247.js","assets/executeQueryPBF-0f188593.js","assets/editsZScale-1b5a53a6.js"]),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=st(this);e.dynamicDataSource=this.dynamicDataSource;const t=this.subtypeCode!=null?`${this.subtypeField} = ${this.subtypeCode}`:null,r=$e(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){return ot(this,e,t,m)}async fetchRecomputedExtents(e){return at(this,e,m)}getFeatureType(e){const{typeIdField:t,types:r}=this;if(!t||!e)return null;const i=e.attributes?e.attributes[t]:void 0;if(i==null)return null;let o=null;return r==null||r.some(l=>{const{id:u}=l;return u!=null&&(u.toString()===i.toString()&&(o=l),!!o)}),o}getFieldDomain(e,t){const r=t==null?void 0:t.feature,i=this.getFeatureType(r);if(i){const o=i.domains&&i.domains[e];if(o&&o.type!=="inherited")return o}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return nt(this,e,t,m)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(bt.from(e)??r.createQuery(),t);if(i!=null&&i.features)for(const o of i.features)o.layer=o.sourceLayer=r;return i}async queryObjectIds(e,t){return lt(this,e,t,m)}async queryFeatureCount(e,t){return ut(this,e,t,m)}async queryExtent(e,t){return pt(this,e,t,m)}async queryRelatedFeatures(e,t){return dt(this,e,t,m)}async queryRelatedFeaturesCount(e,t){return yt(this,e,t,m)}async queryTopFeatures(e,t){var l;const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!((l=i==null?void 0:i.query)!=null&&l.supportsTopFeaturesQuery))throw new f(m,"Layer source does not support queryTopFeatures capability");const o=await r.queryTopFeatures(v.from(e),t);if(o!=null&&o.features)for(const u of o.features)u.layer=u.sourceLayer=this;return o}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!(i!=null&&i.query.supportsTopFeaturesQuery))throw new f(m,"Layer source does not support queryTopObjectIds capability");return r.queryTopObjectIds(v.from(e),t)}async queryTopFeaturesExtent(e,t){var o;const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!((o=i==null?void 0:i.query)!=null&&o.supportsTopFeaturesQuery))throw new f(m,"Layer source does not support queryTopExtents capability");return r.queryTopExtents(v.from(e),t)}async queryTopFeatureCount(e,t){var o;const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!((o=i==null?void 0:i.query)!=null&&o.supportsTopFeaturesQuery))throw new f(m,"Layer source does not support queryFeatureCount capability");return r.queryTopCount(v.from(e),t)}read(e,t){const r=e.featureCollection;if(r){const i=r.layers;i&&i.length===1&&(super.read(i[0],t),r.showLegend!=null&&super.read({showLegend:r.showLegend},t))}super.read(e,t),t&&t.origin==="service"&&(this.revert(["objectIdField","fields","timeInfo"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:(t==null?void 0:t.origin)??void 0,writeLayerSchema:(t==null?void 0:t.writeLayerSchema)??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:o}=t;if(this.dynamicDataSource)return o==null||o.push(_(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if(r==="web-scene"||r==="web-map"&&i!=="tables")return o==null||o.push(_(this,"using a table source cannot be written to web scenes and web maps")),null;if(this._hasMemorySource())return o==null||o.push(_(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&r==="web-map"&&i==="tables")return o==null||o.push(_(this,"using a non-table source cannot be written to tables in web maps")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new f(m,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){var t;return!!this.loaded&&(((t=this.source)==null?void 0:t.type)==="memory"||gt(this,e))}async save(e){const{save:t}=await I(()=>import("./featureLayerUtils-d15eb75b.js"),["assets/featureLayerUtils-d15eb75b.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/originUtils-1469eeaf.js","assets/multiOriginJSONSupportUtils-c978f4c3.js","assets/fetchService-82a8c4d0.js","assets/jsonContext-5f3816dc.js","assets/portalItemUtils-792a27e1.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/AttachmentQuery-972bbd60.js","assets/Query-1c961d4c.js","assets/RelationshipQuery-39c07195.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/TopFeaturesQuery-e44d05be.js","assets/popupUtils-82ea8abb.js"]);return t(this,e)}async saveAs(e,t){const{saveAs:r}=await I(()=>import("./featureLayerUtils-d15eb75b.js"),["assets/featureLayerUtils-d15eb75b.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/originUtils-1469eeaf.js","assets/multiOriginJSONSupportUtils-c978f4c3.js","assets/fetchService-82a8c4d0.js","assets/jsonContext-5f3816dc.js","assets/portalItemUtils-792a27e1.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/AttachmentQuery-972bbd60.js","assets/Query-1c961d4c.js","assets/RelationshipQuery-39c07195.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/TopFeaturesQuery-e44d05be.js","assets/popupUtils-82ea8abb.js"]);return r(this,e,t)}_readEditingEnabled(e,t,r){var o;let i=(o=e.layerDefinition)==null?void 0:o.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&(r==null?void 0:r.origin)==="web-map"&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(t=>t.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){var o,l;if(!e){const u=(l=(o=this.capabilities)==null?void 0:o.operations)!=null&&l.supportsSync?"Query,Sync":"Query";F("layerDefinition.capabilities",u,t),r&&!(i!=null&&i.writeLayerSchema)&&(t.capabilities=u)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstLayerId(e){return fe(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{const r=t.data;if(r)return Array.isArray(r.layers)&&r.layers.length>0?r.layers[0].id:Array.isArray(r.tables)&&r.tables.length>0?r.tables[0].id:void 0})}async initLayerProperties(e){var t;return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:(t=this.portalItem)==null?void 0:t.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),P(this.renderer,this.fieldsIndex),ge(this.timeInfo,this.fieldsIndex),vt(this,{origin:"service"})}async hasDataChanged(){return ct(this)}async fetchPublishingStatus(){const e=this.source;return e!=null&&e.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){var t,r;const e=((t=this.parsedUrl)==null?void 0:t.path)??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||e.search(/\/FeatureServer\//i)!==-1||(r=this.fields)!=null&&r.some(i=>i.type==="geometry")||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(r=>{const i=r.prototype&&r.prototype.attributes;i&&t&&delete i[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new f("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new f("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(t=>{t.layer=this,t.sourceLayer=this}),this._handles.add([e.on("after-add",t=>{t.item.layer=this,t.item.sourceLayer=this}),e.on("after-remove",t=>{t.item.layer=null,t.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(t=>{t.layer=null,t.sourceLayer=null}),this._handles.remove("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}};s([d("service","capabilities")],a.prototype,"readCapabilities",null),s([n({json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],a.prototype,"charts",void 0),s([n({readOnly:!0})],a.prototype,"createQueryVersion",null),s([n({json:{read:{source:"layerDefinition.copyrightText"}}})],a.prototype,"copyright",void 0),s([n({json:{read:{source:"layerDefinition.displayField"}}})],a.prototype,"displayField",void 0),s([n({types:be,readOnly:!0})],a.prototype,"defaultSymbol",void 0),s([n({type:wt})],a.prototype,"dynamicDataSource",void 0),s([n({type:Boolean})],a.prototype,"editingEnabled",null),s([d(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],a.prototype,"readEditingEnabled",null),s([d("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],a.prototype,"readEditingEnabledFromWebMap",null),s([E(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],a.prototype,"writeEditingEnabled",null),s([E("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],a.prototype,"writeEditingEnabledToWebMap",null),s([n({readOnly:!0})],a.prototype,"effectiveEditingEnabled",null),s([n({...D.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:O}}}}})],a.prototype,"fields",void 0),s([n(D.fieldsIndex)],a.prototype,"fieldsIndex",void 0),s([n({type:De,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],a.prototype,"formTemplate",void 0),s([n({json:{read:{source:"layerDefinition.extent"}}})],a.prototype,"fullExtent",void 0),s([n({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:O,writer(e,t,r){const i=e?x.toJSON(e):null;i&&F(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:x.read}}})],a.prototype,"geometryType",void 0),s([n({json:{read:{source:"layerDefinition.hasM"}}})],a.prototype,"hasM",void 0),s([n({json:{read:{source:"layerDefinition.hasZ"}}})],a.prototype,"hasZ",void 0),s([n(ke)],a.prototype,"id",void 0),s([n({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],a.prototype,"infoFor3D",void 0),s([n({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],a.prototype,"isTable",void 0),s([d("service","isTable",["type","geometryType"]),d("isTable",["layerDefinition.type","layerDefinition.geometryType"])],a.prototype,"readIsTable",null),s([E("web-map","isTable")],a.prototype,"writeIsTable",null),s([n(Ve)],a.prototype,"labelsVisible",void 0),s([n({type:[mt],json:{origins:{service:{read:{source:"drawingInfo.labelingInfo",reader:G},write:{target:"drawingInfo.labelingInfo",enabled:!1}}},read:{source:"layerDefinition.drawingInfo.labelingInfo",reader:G},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],a.prototype,"labelingInfo",void 0),s([n((()=>{const e=$(Qe);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(t,r,i){F(i,Fe(t),r)}}},e})())],a.prototype,"opacity",void 0),s([n(We)],a.prototype,"legendEnabled",void 0),s([n({type:["show","hide"],json:(()=>{const e=$(ze.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],a.prototype,"listMode",void 0),s([d("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],a.prototype,"readGlobalIdField",null),s([n({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:O}}}}})],a.prototype,"objectIdField",void 0),s([d("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],a.prototype,"readObjectIdField",null),s([n({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],a.prototype,"operationalLayerType",void 0),s([n(D.outFields)],a.prototype,"outFields",void 0),s([n({readOnly:!0})],a.prototype,"parsedUrl",null),s([n({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],a.prototype,"path",void 0),s([n(Ze)],a.prototype,"popupEnabled",void 0),s([n({type:we,json:{name:"popupInfo",write:!0}})],a.prototype,"popupTemplate",void 0),s([n({readOnly:!0})],a.prototype,"defaultPopupTemplate",null),s([n({types:Te,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Ie,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:(e,t,r)=>({ignoreOrigin:r==null?void 0:r.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r==null?void 0:r.writeLayerSchema})}}})],a.prototype,"renderer",null),s([d("service","renderer",["drawingInfo.renderer","defaultSymbol"]),d("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],a.prototype,"readRenderer",null),s([n((()=>{const e=$(Ue);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],a.prototype,"screenSizePerspectiveEnabled",void 0),s([n({clonable:!1})],a.prototype,"source",null),s([ve("source")],a.prototype,"castSource",null),s([d("portal-item","source",["featureSet"]),d("web-map","source",["featureSet"])],a.prototype,"readSource",null),s([n({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],a.prototype,"spatialReference",void 0),s([n({type:Number})],a.prototype,"subtypeCode",void 0),s([n({type:[k]})],a.prototype,"templates",void 0),s([d("templates",["editFieldsInfo","creatorField","editorField","templates"])],a.prototype,"readTemplates",null),s([n({type:Je})],a.prototype,"timeInfo",void 0),s([n()],a.prototype,"title",void 0),s([d("service","title",["name"]),d("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],a.prototype,"readTitle",null),s([d("web-map","title",["layerDefinition.name","title"])],a.prototype,"readTitleFromWebMap",null),s([n({type:String})],a.prototype,"sublayerTitleMode",void 0),s([n({json:{read:!1}})],a.prototype,"type",void 0),s([n({type:String})],a.prototype,"typeIdField",void 0),s([d("service","typeIdField"),d("typeIdField",["layerDefinition.typeIdField"])],a.prototype,"readTypeIdField",null),s([n({type:[V]})],a.prototype,"types",void 0),s([d("service","types",["types"]),d("types",["layerDefinition.types"])],a.prototype,"readTypes",null),s([n({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],a.prototype,"visible",void 0),s([d("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],a.prototype,"readVisible",null),a=s([S(z)],a);const fr=a;export{fr as default}; diff --git a/assets/FeatureLayerBase-7c7dfccb.js b/assets/FeatureLayerBase-7c7dfccb.js new file mode 100644 index 0000000..6a43b51 --- /dev/null +++ b/assets/FeatureLayerBase-7c7dfccb.js @@ -0,0 +1 @@ +import{ai as e,aj as t,al as p,ck as w,ay as l,bY as M,bz as ce,se as be,cA as je,ow as ie,sf as Ie,cl as F,lY as Se,f4 as he,cz as B,eY as C,sg as Ee,sh as Fe,cp as me,ca as $e,az as Oe,bc as oe,aF as re,jd as Te,je as Me}from"./index-080e108a.js";import{d as Ve,I as Re,D as Le,f as Ne}from"./commonProperties-30089b06.js";import{d as De,S as Be,R as Ue,x as Ae}from"./featureLayerUtils-6cf06f83.js";import{p as Ce,n as Ge}from"./serviceCapabilitiesUtils-959e798a.js";var G;let g=G=class extends w{constructor(o){super(o),this.expression=null,this.name=null,this.returnType="boolean",this.title=null}clone(){return new G({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};e([t({type:String,json:{write:!0}})],g.prototype,"expression",void 0),e([t({type:String,json:{write:!0}})],g.prototype,"name",void 0),e([t({type:["boolean","date","number","string"],json:{write:!0}})],g.prototype,"returnType",void 0),e([t({type:String,json:{write:!0}})],g.prototype,"title",void 0),g=G=e([p("esri.form.ExpressionInfo")],g);const ke=g;let x=class extends w{constructor(i){super(i),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};e([t({type:String,json:{write:!0}})],x.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],x.prototype,"label",void 0),e([t()],x.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],x.prototype,"visibilityExpression",void 0),x=e([p("esri.form.elements.Element")],x);const $=x;var k;let V=k=class extends w{constructor(o){super(o),this.type=null}clone(){return new k({type:this.type})}};e([t({type:["attachment","audio","document","image","signature","video"],json:{write:!0}})],V.prototype,"type",void 0),V=k=e([p("esri.form.elements.inputs.AttachmentInput")],V);const We=V;var W;let b=W=class extends ${constructor(o){super(o),this.attachmentKeyword=null,this.editable=!0,this.input=null,this.type="attachment"}clone(){return new W({attachmentKeyword:this.attachmentKeyword,description:this.description,editable:this.editable,input:this.input,label:this.label,visibilityExpression:this.visibilityExpression})}};e([t({type:String,json:{write:!0}})],b.prototype,"attachmentKeyword",void 0),e([t({type:Boolean,json:{write:!0}})],b.prototype,"editable",void 0),e([t({type:We,json:{read:{source:"inputType"},write:{target:"inputType"}}})],b.prototype,"input",void 0),e([t({type:["attachment"],json:{read:!1,write:!0}})],b.prototype,"type",void 0),b=W=e([p("esri.form.elements.AttachmentElement")],b);const se=b;let R=class extends w{constructor(i){super(i),this.type=null}};e([t()],R.prototype,"type",void 0),R=e([p("esri.form.elements.inputs.Input")],R);const O=R;let T=class extends O{constructor(o){super(o),this.maxLength=null,this.minLength=0}};e([t({type:Number,json:{write:!0}})],T.prototype,"maxLength",void 0),e([t({type:Number,json:{write:!0}})],T.prototype,"minLength",void 0),T=e([p("esri.form.elements.inputs.TextInput")],T);const ee=T;var Q;let L=Q=class extends ee{constructor(o){super(o),this.type="barcode-scanner"}clone(){return new Q({maxLength:this.maxLength,minLength:this.minLength})}};e([t({type:["barcode-scanner"],json:{read:!1,write:!0}})],L.prototype,"type",void 0),L=Q=e([p("esri.form.elements.inputs.BarcodeScannerInput")],L);const Qe=L;var z;let j=z=class extends O{constructor(o){super(o),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="combo-box"}clone(){return new z({showNoValueOption:this.showNoValueOption,noValueOptionLabel:this.noValueOptionLabel})}};e([t({type:String,json:{write:!0}})],j.prototype,"noValueOptionLabel",void 0),e([t({type:Boolean,json:{write:!0}})],j.prototype,"showNoValueOption",void 0),e([t({type:["combo-box"],json:{read:!1,write:!0}})],j.prototype,"type",void 0),j=z=e([p("esri.form.elements.inputs.ComboBoxInput")],j);const ze=j;var P;function ne(o){return o!=null?new Date(o):null}function pe(o){return o?o.getTime():null}let y=P=class extends O{constructor(o){super(o),this.includeTime=!1,this.max=null,this.min=null,this.type="datetime-picker"}readMax(o,i){return ne(i.max)}writeMax(o,i){i.max=pe(o)}readMin(o,i){return ne(i.min)}writeMin(o,i){i.min=pe(o)}clone(){return new P({includeTime:this.includeTime,max:this.max,min:this.min})}};e([t({type:Boolean,json:{write:!0}})],y.prototype,"includeTime",void 0),e([t({type:Date,json:{type:Number,write:!0}})],y.prototype,"max",void 0),e([l("max")],y.prototype,"readMax",null),e([M("max")],y.prototype,"writeMax",null),e([t({type:Date,json:{type:Number,write:!0}})],y.prototype,"min",void 0),e([l("min")],y.prototype,"readMin",null),e([M("min")],y.prototype,"writeMin",null),e([t({type:["datetime-picker"],json:{read:!1,write:!0}})],y.prototype,"type",void 0),y=P=e([p("esri.form.elements.inputs.DateTimePickerInput")],y);const Pe=y;var H;let I=H=class extends O{constructor(o){super(o),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="radio-buttons"}clone(){return new H({noValueOptionLabel:this.noValueOptionLabel,showNoValueOption:this.showNoValueOption})}};e([t({type:String,json:{write:!0}})],I.prototype,"noValueOptionLabel",void 0),e([t({type:Boolean,json:{write:!0}})],I.prototype,"showNoValueOption",void 0),e([t({type:["radio-buttons"],json:{read:!1,write:!0}})],I.prototype,"type",void 0),I=H=e([p("esri.form.elements.inputs.RadioButtonsInput")],I);const He=I;var J;let S=J=class extends O{constructor(o){super(o),this.offValue=null,this.onValue=null,this.type="switch"}clone(){return new J({offValue:this.offValue,onValue:this.onValue})}};e([t({type:[String,Number],json:{write:!0}})],S.prototype,"offValue",void 0),e([t({type:[String,Number],json:{write:!0}})],S.prototype,"onValue",void 0),e([t({type:["switch"],json:{read:!1,write:!0}})],S.prototype,"type",void 0),S=J=e([p("esri.form.elements.inputs.SwitchInput")],S);const Je=S;var q;let N=q=class extends ee{constructor(o){super(o),this.type="text-area"}clone(){return new q({maxLength:this.maxLength,minLength:this.minLength})}};e([t({type:["text-area"],json:{read:!1,write:!0}})],N.prototype,"type",void 0),N=q=e([p("esri.form.elements.inputs.TextAreaInput")],N);const qe=N;var Z;let D=Z=class extends ee{constructor(o){super(o),this.type="text-box"}clone(){return new Z({maxLength:this.maxLength,minLength:this.minLength})}};e([t({type:["text-box"],json:{read:!1,write:!0}})],D.prototype,"type",void 0),D=Z=e([p("esri.form.elements.inputs.TextBoxInput")],D);const Ze=D,Ke={base:O,key:"type",typeMap:{"barcode-scanner":Qe,"combo-box":ze,"datetime-picker":Pe,"radio-buttons":He,switch:Je,"text-area":qe,"text-box":Ze}};var K;const ve="esri.form.elements.FieldElement",le=ce.getLogger(ve);let d=K=class extends ${constructor(o){super(o),this.domain=null,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type="field",this.valueExpression=null}get editable(){return ie(le,"editable",{replacement:"editableExpression",version:"4.26",warnOnce:!0}),this._get("editable")??!0}set editable(o){ie(le,"editable",{replacement:"editableExpression",version:"4.26",warnOnce:!0}),this._set("editable",o)}clone(){return new K({description:this.description,domain:this.domain,editable:this.editable,editableExpression:this.editableExpression,fieldName:this.fieldName,hint:this.hint,input:this.input,label:this.label,requiredExpression:this.requiredExpression,valueExpression:this.valueExpression,visibilityExpression:this.visibilityExpression})}};e([t({types:be,json:{read:{reader:je},write:!0}})],d.prototype,"domain",void 0),e([t({type:Boolean,json:{write:!0}})],d.prototype,"editable",null),e([t({type:String,json:{write:!0}})],d.prototype,"editableExpression",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"fieldName",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"hint",void 0),e([t({types:Ke,json:{read:{source:"inputType"},write:{target:"inputType"}}})],d.prototype,"input",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"requiredExpression",void 0),e([t({type:String,json:{read:!1,write:!0}})],d.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"valueExpression",void 0),d=K=e([p(ve)],d);const ae=d;var _;let v=_=class extends ${constructor(o){super(o),this.displayCount=null,this.displayType="list",this.editableExpression=null,this.orderByFields=null,this.relationshipId=null,this.type="relationship"}clone(){return new _({description:this.description,displayCount:this.displayCount,displayType:this.displayType,editableExpression:this.editableExpression,label:this.label,orderByFields:F(this.orderByFields),relationshipId:this.relationshipId,visibilityExpression:this.visibilityExpression})}};e([t({type:Number,json:{write:!0}})],v.prototype,"displayCount",void 0),e([t({type:["list"],json:{write:!0}})],v.prototype,"displayType",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"editableExpression",void 0),e([t({type:[Ie],json:{write:!0}})],v.prototype,"orderByFields",void 0),e([t({type:Number,json:{write:!0}})],v.prototype,"relationshipId",void 0),e([t({type:["relationship"],json:{read:!1,write:!0}})],v.prototype,"type",void 0),v=_=e([p("esri.form.elements.RelationshipElement")],v);const de=v;function fe(o){return{typesWithGroup:{base:$,key:"type",typeMap:{attachment:se,field:ae,group:o,relationship:de}},typesWithoutGroup:{base:$,key:"type",typeMap:{attachment:se,field:ae,relationship:de}}}}function we(o,i,s=!0){if(!o)return null;const r=s?i.typesWithGroup.typeMap:i.typesWithoutGroup.typeMap;return o.filter(n=>r[n.type]).map(n=>r[n.type].fromJSON(n))}function ge(o,i,s=!0){if(!o)return null;const r=s?i.typesWithGroup.typeMap:i.typesWithoutGroup.typeMap;return o.filter(n=>r[n.type]).map(n=>n.toJSON())}function xe(o,i,s=!0){return o?o.map(r=>Se(s?i.typesWithGroup:i.typesWithoutGroup,r)):null}var Y;let h=Y=class extends ${constructor(o){super(o),this.elements=null,this.initialState="expanded",this.type="group"}castElements(o){return xe(o,U,!1)}readElements(o,i){return we(i.formElements,U,!1)}writeElements(o,i){i.formElements=ge(o,U,!1)}clone(){return new Y({description:this.description,elements:F(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};e([t({json:{write:!0}})],h.prototype,"elements",void 0),e([he("elements")],h.prototype,"castElements",null),e([l("elements",["formElements"])],h.prototype,"readElements",null),e([M("elements")],h.prototype,"writeElements",null),e([t({type:["collapsed","expanded"],json:{write:!0}})],h.prototype,"initialState",void 0),e([t({type:String,json:{read:!1,write:!0}})],h.prototype,"type",void 0),h=Y=e([p("esri.form.elements.GroupElement")],h);const U=fe(h),_e=h;var X;const A=fe(_e);let c=X=class extends w{constructor(o){super(o),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(o){return xe(o,A)}readElements(o,i){return we(i.formElements,A)}writeElements(o,i){i.formElements=ge(o,A)}clone(){return new X({description:this.description,expressionInfos:F(this.expressionInfos),elements:F(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}};e([t({type:String,json:{write:!0}})],c.prototype,"description",void 0),e([t({json:{write:!0}})],c.prototype,"elements",void 0),e([he("elements")],c.prototype,"castElements",null),e([l("elements",["formElements"])],c.prototype,"readElements",null),e([M("elements")],c.prototype,"writeElements",null),e([t({type:[ke],json:{write:!0}})],c.prototype,"expressionInfos",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],c.prototype,"preserveFieldValuesWhenHidden",void 0),e([t({type:String,json:{write:!0}})],c.prototype,"title",void 0),c=X=e([p("esri.form.FormTemplate")],c);const pt=c;let f=class extends B(w){constructor(i){super(i),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.dateFieldsTimeReference=null}};e([t()],f.prototype,"creatorField",void 0),e([t()],f.prototype,"creationDateField",void 0),e([t()],f.prototype,"editorField",void 0),e([t()],f.prototype,"editDateField",void 0),e([t()],f.prototype,"realm",void 0),e([t({type:C})],f.prototype,"dateFieldsTimeReference",void 0),f=e([p("esri.layers.support.EditFieldsInfo")],f);const Ye=f;let m=class extends B(w){constructor(i){super(i)}};e([t({constructOnly:!0,json:{write:!0}})],m.prototype,"name",void 0),e([t({constructOnly:!0,json:{write:!0}})],m.prototype,"fields",void 0),e([t({constructOnly:!0,json:{write:!0}})],m.prototype,"isAscending",void 0),e([t({constructOnly:!0,json:{write:!0}})],m.prototype,"indexType",void 0),e([t({constructOnly:!0,json:{write:!0}})],m.prototype,"isUnique",void 0),e([t({constructOnly:!0,json:{write:!0}})],m.prototype,"description",void 0),m=e([p("esri.layers.support.FeatureIndex")],m);let E=class extends B(w){constructor(i){super(i),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};e([t({type:String,json:{read:{source:"shapeAreaFieldName"}}})],E.prototype,"shapeAreaField",void 0),e([t({type:String,json:{read:{source:"shapeLengthFieldName"}}})],E.prototype,"shapeLengthField",void 0),e([t({type:String,json:{read:o=>Ee.read(o)||Fe.read(o)}})],E.prototype,"units",void 0),E=e([p("esri.layers.support.GeometryFieldsInfo")],E);const Xe=E,ue=new me({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),ye=new me({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let u=class extends B(w){constructor(o){super(o),this.cardinality=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};e([t({json:{read:ue.read,write:ue.write}})],u.prototype,"cardinality",void 0),e([t({json:{read:!0,write:!0}})],u.prototype,"composite",void 0),e([t({json:{read:!0,write:!0}})],u.prototype,"id",void 0),e([t({json:{read:!0,write:!0}})],u.prototype,"keyField",void 0),e([t({json:{read:!0,write:!0}})],u.prototype,"keyFieldInRelationshipTable",void 0),e([t({json:{read:!0,write:!0}})],u.prototype,"name",void 0),e([t({json:{read:!0,write:!0}})],u.prototype,"relatedTableId",void 0),e([t({json:{read:!0,write:!0}})],u.prototype,"relationshipTableId",void 0),e([t({json:{read:ye.read,write:ye.write}})],u.prototype,"role",void 0),u=e([p("esri.layers.support.Relationship")],u);const et=u,ut=o=>{let i=class extends o{constructor(){super(...arguments),this.capabilities=null,this.copyright=null,this.dateFieldsTimeReference=null,this.datesInUnknownTimezone=!1,this.displayField=null,this.definitionExpression=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.isTable=!1,this.layerId=void 0,this.minScale=0,this.maxScale=0,this.globalIdField=null,this.objectIdField=null,this.preferredTimeReference=null,this.relationships=null,this.sourceJSON=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.spatialReference=oe.WGS84,this.subtypeField=null,this.trackIdField=null,this.indexes=new(re.ofType(m)),this.version=void 0}readCapabilitiesFromService(s,r){return Ge(r,this.url)}get effectiveCapabilities(){var te;const s=this.capabilities;if(!s)return null;const r=F(s),{operations:n,editing:a}=r;return(te=this.sourceJSON)!=null&&te.isMultiServicesView?(this.userHasUpdateItemPrivileges&&(n.supportsQuery=!0),r):this.userHasUpdateItemPrivileges?(n.supportsAdd=n.supportsDelete=n.supportsEditing=n.supportsQuery=n.supportsUpdate=a.supportsDeleteByOthers=a.supportsGeometryUpdate=a.supportsUpdateByOthers=!0,r):(this.userHasFullEditingPrivileges&&n.supportsEditing&&(n.supportsAdd=n.supportsDelete=n.supportsUpdate=a.supportsGeometryUpdate=!0),r)}get hasFullEditingRestrictions(){var a;const s=this.capabilities;if(!s||(a=this.sourceJSON)!=null&&a.isMultiServicesView)return!1;const{operations:r,editing:n}=s;return r.supportsEditing&&!(r.supportsAdd&&r.supportsDelete&&r.supportsUpdate&&n.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){var a;const s=this.capabilities;if(!s)return!1;const{operations:r,editing:n}=s;return(a=this.sourceJSON)!=null&&a.isMultiServicesView?!r.supportsQuery:!(r.supportsAdd&&r.supportsDelete&&r.supportsEditing&&r.supportsQuery&&r.supportsUpdate&&n.supportsDeleteByOthers&&n.supportsGeometryUpdate&&n.supportsUpdateByOthers)}readEditingInfo(s,r){const{editingInfo:n}=r;return n?{lastEditDate:n.lastEditDate!=null?new Date(n.lastEditDate):null}:null}readIsTableFromService(s,r){return r.type==="Table"}readMinScale(s,r){return r.effectiveMinScale||s||0}readMaxScale(s,r){return r.effectiveMaxScale||s||0}readGlobalIdFieldFromService(s,r){return Be(r)}readObjectIdFieldFromService(s,r){return Ue(r)}readServiceDefinitionExpression(s,r){return r.definitionQuery||r.definitionExpression}set url(s){const r=Te({layer:this,url:s,nonStandardUrlAllowed:!0,logger:ce.getLogger(this)});this._set("url",r.url),r.layerId!=null&&this._set("layerId",r.layerId)}writeUrl(s,r,n,a){Me(this,s,null,r,a)}readVersion(s,r){return Ae(r)}};return e([t({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],i.prototype,"capabilities",void 0),e([l("service","capabilities")],i.prototype,"readCapabilitiesFromService",null),e([t({readOnly:!0})],i.prototype,"effectiveCapabilities",null),e([t({readOnly:!0})],i.prototype,"hasFullEditingRestrictions",null),e([t({readOnly:!0})],i.prototype,"hasUpdateItemRestrictions",null),e([t({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],i.prototype,"copyright",void 0),e([t({type:C})],i.prototype,"dateFieldsTimeReference",void 0),e([t({type:Boolean})],i.prototype,"datesInUnknownTimezone",void 0),e([t({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],i.prototype,"displayField",void 0),e([t({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),e([t({readOnly:!0,type:Ye})],i.prototype,"editFieldsInfo",void 0),e([t({readOnly:!0})],i.prototype,"editingInfo",void 0),e([l("editingInfo")],i.prototype,"readEditingInfo",null),e([t((()=>{const s=F(Ve),r=s.json.origins;return r["web-map"]={read:!1,write:!1},r["portal-item"]={read:!1,write:!1},s})())],i.prototype,"elevationInfo",void 0),e([t({type:Ce,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],i.prototype,"floorInfo",void 0),e([t({type:$e,json:{origins:{service:{read:{source:"extent"}}}}})],i.prototype,"fullExtent",void 0),e([t()],i.prototype,"gdbVersion",void 0),e([t({readOnly:!0,type:Xe,json:{read:{source:"geometryProperties"}}})],i.prototype,"geometryFieldsInfo",void 0),e([t({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:De.read}}}})],i.prototype,"geometryType",void 0),e([t({type:Boolean,json:{origins:{service:{read:!0}}}})],i.prototype,"hasM",void 0),e([t({type:Boolean,json:{origins:{service:{read:!0}}}})],i.prototype,"hasZ",void 0),e([t({readOnly:!0,type:Oe})],i.prototype,"heightModelInfo",void 0),e([t({type:Date})],i.prototype,"historicMoment",void 0),e([t({readOnly:!0})],i.prototype,"isTable",void 0),e([l("service","isTable",["type"])],i.prototype,"readIsTableFromService",null),e([t({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],i.prototype,"layerId",void 0),e([t(Re)],i.prototype,"minScale",void 0),e([l("service","minScale",["minScale","effectiveMinScale"])],i.prototype,"readMinScale",null),e([t(Le)],i.prototype,"maxScale",void 0),e([l("service","maxScale",["maxScale","effectiveMaxScale"])],i.prototype,"readMaxScale",null),e([t({type:String})],i.prototype,"globalIdField",void 0),e([l("service","globalIdField",["globalIdField","fields"])],i.prototype,"readGlobalIdFieldFromService",null),e([t({type:String})],i.prototype,"objectIdField",void 0),e([l("service","objectIdField",["objectIdField","fields"])],i.prototype,"readObjectIdFieldFromService",null),e([t({type:C})],i.prototype,"preferredTimeReference",void 0),e([t({type:[et],readOnly:!0})],i.prototype,"relationships",void 0),e([t()],i.prototype,"sourceJSON",void 0),e([t({type:Boolean})],i.prototype,"returnM",void 0),e([t({type:Boolean})],i.prototype,"returnZ",void 0),e([t({readOnly:!0})],i.prototype,"serviceDefinitionExpression",void 0),e([l("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],i.prototype,"readServiceDefinitionExpression",null),e([t({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],i.prototype,"serviceItemId",void 0),e([t({type:oe,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],i.prototype,"spatialReference",void 0),e([t({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],i.prototype,"subtypeField",void 0),e([t({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],i.prototype,"trackIdField",void 0),e([t({readOnly:!0,json:{write:!1}})],i.prototype,"serverGens",void 0),e([t({type:re.ofType(m),readOnly:!0})],i.prototype,"indexes",void 0),e([t(Ne)],i.prototype,"url",null),e([M("url")],i.prototype,"writeUrl",null),e([t({json:{origins:{service:{read:!0}},read:!1}})],i.prototype,"version",void 0),e([l("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],i.prototype,"readVersion",null),i=e([p("esri.layers.mixins.FeatureLayerBase")],i),i};export{ut as w,pt as y}; diff --git a/assets/FeatureLayerSource-b0c6b618.js b/assets/FeatureLayerSource-b0c6b618.js new file mode 100644 index 0000000..fb6e655 --- /dev/null +++ b/assets/FeatureLayerSource-b0c6b618.js @@ -0,0 +1 @@ +import{hw as k,dh as C,hx as j,fu as D,cp as M,ai as O,aj as x,al as U,gC as P,aR as Q,cn as N,at as g,dZ as v,c0 as L,ca as G,cR as V,cB as z,c5 as J,aw as W,ar as E,hy as Z,cO as H,as as X,bd as Y,be as B,hz as $,hA as K,bz as I,hB as ee,hC as te,bc as se,aK as ae,cs as re,hD as ie}from"./index-080e108a.js";import{isFeatureIdentifierArrayWithGlobalId as ne,isFeatureIdentifierArrayWithObjectId as oe}from"./editingSupport-b5feb7b5.js";import{o as ue}from"./clientSideDefaults-ab04bd90.js";import{x as le}from"./QueryTask-6f808a9e.js";import{s as de}from"./executeQueryJSON-7c41ada5.js";import{i as ce}from"./editsZScale-1b5a53a6.js";import{b as pe}from"./Query-1c961d4c.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./EditBusLayer-d71787e9.js";import"./QueryEngineCapabilities-42e44ded.js";import"./defaultsJSON-59981e75.js";import"./executeForIds-5eaf002d.js";import"./query-93c6e211.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./executeQueryPBF-0f188593.js";import"./FeatureSet-111cb247.js";function he(t){const{vertexSpace:e}=t;if(e.isRelative)return t.clone();const{anchor:a}=t,s=a.clone(),r=k(ye,[-s.x,-s.y,-s.z]),u=new C({origin:[s.x,s.y,s.z]}),i=t.cloneWithVertexSpace(u),{position:l}=i.vertexAttributes;return i.vertexAttributes.position=j(new Float64Array(l.length),l,r),i.vertexAttributesChanged(),i}const ye=D(),me=new M({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),ge=new Set(["Feature Layer","Oriented Imagery Layer","Table"]),fe=new M({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let S=class extends P{constructor(){super(...arguments),this.type="feature-layer",this.refresh=Q(async()=>{var a,s;await this.load();const t=(a=this.sourceJSON.editingInfo)==null?void 0:a.lastEditDate;if(t==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const e=t!==((s=this.sourceJSON.editingInfo)==null?void 0:s.lastEditDate);return{dataChanged:e,updates:e?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(t){const e=t!=null?t.signal:null,a=this.layer.sourceJSON;return this.addResolvingPromise(this._fetchService(a,e)),Promise.resolve(this)}get queryTask(){var c;const{capabilities:t,parsedUrl:e,dynamicDataSource:a,infoFor3D:s,gdbVersion:r,spatialReference:u,fieldsIndex:i}=this.layer,l=N("featurelayer-pbf")&&(t==null?void 0:t.query.supportsFormatPBF)&&s==null,n=((c=t==null?void 0:t.operations)==null?void 0:c.supportsQueryAttachments)??!1;return new le({url:e.path,pbfSupported:l,fieldsIndex:i,infoFor3D:s,dynamicDataSource:a,gdbVersion:r,sourceSpatialReference:u,queryAttachmentsSupported:n})}async addAttachment(t,e){await this.load();const a=t.attributes[this.layer.objectIdField],s=this.layer.parsedUrl.path+"/"+a+"/addAttachment",r=this._getLayerRequestOptions(),u=this._getFormDataForAttachment(e,r.query);try{const i=await g(s,{body:u});return this._createFeatureEditResult(i.data.addAttachmentResult)}catch(i){throw this._createAttachmentErrorResult(a,i)}}async updateAttachment(t,e,a){await this.load();const s=t.attributes[this.layer.objectIdField],r=this.layer.parsedUrl.path+"/"+s+"/updateAttachment",u=this._getLayerRequestOptions({query:{attachmentId:e}}),i=this._getFormDataForAttachment(a,u.query);try{const l=await g(r,{body:i});return this._createFeatureEditResult(l.data.updateAttachmentResult)}catch(l){throw this._createAttachmentErrorResult(s,l)}}async applyEdits(t,e){var _,q,R,w,A,T;await this.load();const{layer:a}=this,s=a.infoFor3D,r=s!=null,u=r||((e==null?void 0:e.globalIdUsed)??!1),i=r?await this._uploadMeshesAndGetAssetMapEditsJSON(t):null,l=((_=t.addFeatures)==null?void 0:_.map(F=>this._getFeatureJSON(F,s)))??[],n=(await Promise.all(l)).filter(v),c=((q=t.updateFeatures)==null?void 0:q.map(F=>this._getFeatureJSON(F,s)))??[],h=(await Promise.all(c)).filter(v),y=this._getFeatureIds(t.deleteFeatures,u);ce(n,h,a.spatialReference);const p=await this._getAttachmentEditsJSON(t),b=a.capabilities.editing.supportsAsyncApplyEdits&&r,o={gdbVersion:(e==null?void 0:e.gdbVersion)||a.gdbVersion,rollbackOnFailure:e==null?void 0:e.rollbackOnFailureEnabled,useGlobalIds:u,returnEditMoment:e==null?void 0:e.returnEditMoment,usePreviousEditMoment:e==null?void 0:e.usePreviousEditMoment,sessionId:e==null?void 0:e.sessionId,async:b};e!=null&&e.returnServiceEditsOption?(o.edits=JSON.stringify([{id:a.layerId,adds:n,updates:h,deletes:y,attachments:p,assetMaps:i}]),o.returnServiceEditsOption=me.toJSON(e==null?void 0:e.returnServiceEditsOption),o.returnServiceEditsInSourceSR=e==null?void 0:e.returnServiceEditsInSourceSR):(o.adds=n.length?JSON.stringify(n):null,o.updates=h.length?JSON.stringify(h):null,o.deletes=y.length?u?JSON.stringify(y):y.join(","):null,o.attachments=p&&JSON.stringify(p),o.assetMaps=i!=null?JSON.stringify(i):void 0);const d=this._getLayerRequestOptions({method:"post",query:o}),m=e!=null&&e.returnServiceEditsOption?a.url:a.parsedUrl.path,f=b?await this._asyncApplyEdits(m+"/applyEdits",d):await g(m+"/applyEdits",d);if(!((R=a.capabilities.operations)!=null&&R.supportsEditing)&&((A=(w=a.effectiveCapabilities)==null?void 0:w.operations)!=null&&A.supportsEditing)){const F=(T=L)==null?void 0:T.findCredential(a.url);await(F==null?void 0:F.refreshToken())}return this._createEditsResult(f)}async deleteAttachments(t,e){await this.load();const a=t.attributes[this.layer.objectIdField],s=this.layer.parsedUrl.path+"/"+a+"/deleteAttachments";try{return(await g(s,this._getLayerRequestOptions({query:{attachmentIds:e.join(",")},method:"post"}))).data.deleteAttachmentResults.map(this._createFeatureEditResult)}catch(r){throw this._createAttachmentErrorResult(a,r)}}fetchRecomputedExtents(t={}){const e=t.signal;return this.load({signal:e}).then(async()=>{const a=this._getLayerRequestOptions({...t,query:{returnUpdates:!0}}),{layerId:s,url:r}=this.layer,{data:u}=await g(`${r}/${s}`,a),{id:i,extent:l,fullExtent:n,timeExtent:c}=u,h=l||n;return{id:i,fullExtent:h&&G.fromJSON(h),timeExtent:c&&V.fromJSON({start:c[0],end:c[1]})}})}async queryAttachments(t,e={}){await this.load();const a=this._getLayerRequestOptions(e);return this.queryTask.executeAttachmentQuery(t,a)}async queryFeatures(t,e){return await this.load(),this.queryTask.execute(t,{...e,query:this._createRequestQueryOptions(e)})}async queryFeaturesJSON(t,e){return await this.load(),this.queryTask.executeJSON(t,{...e,query:this._createRequestQueryOptions(e)})}async queryObjectIds(t,e){return await this.load(),this.queryTask.executeForIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryFeatureCount(t,e){return await this.load(),this.queryTask.executeForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryExtent(t,e){return await this.load(),this.queryTask.executeForExtent(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeatures(t,e){return await this.load(),this.queryTask.executeRelationshipQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeaturesCount(t,e){return await this.load(),this.queryTask.executeRelationshipQueryForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopFeatures(t,e){return await this.load(),this.queryTask.executeTopFeaturesQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopObjectIds(t,e){return await this.load(),this.queryTask.executeForTopIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopExtents(t,e){return await this.load(),this.queryTask.executeForTopExtents(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopCount(t,e){return await this.load(),this.queryTask.executeForTopCount(t,{...e,query:this._createRequestQueryOptions(e)})}async fetchPublishingStatus(){if(!z(this.layer.url))return"unavailable";const t=J(this.layer.url,"status"),e=await g(t,{query:{f:"json"}});return fe.fromJSON(e.data.status)}async uploadAssets(t,e){const{uploadAssets:a}=await W(()=>import("./uploadAssets-f5746464.js"),["assets/uploadAssets-f5746464.js","assets/index-080e108a.js","assets/index-a8e73b5e.css"]);return a(t,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},e)}async _asyncApplyEdits(t,e){const a=(await g(t,e)).data.statusUrl;for(;;){const s=(await g(a,{query:{f:"json"},responseType:"json"})).data;switch(s.status){case"Completed":return g(s.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new E("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new E("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await Z(Re)}}_createRequestQueryOptions(t){const e={...this.layer.customParameters,token:this.layer.apiKey,...t==null?void 0:t.query};return this.layer.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),e}async _fetchService(t,e){if(!t){const{data:s}=await g(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:N("featurelayer-advanced-symbols")?{returnAdvancedSymbols:!0}:{},signal:e}));t=s}this.sourceJSON=await this._patchServiceJSON(t,e);const a=t.type;if(!ge.has(a))throw new E("feature-layer-source:unsupported-type",`Source type "${a}" is not supported`)}async _patchServiceJSON(t,e){var a;if(t.type!=="Table"&&t.geometryType&&!((a=t==null?void 0:t.drawingInfo)!=null&&a.renderer)&&!t.defaultSymbol){const s=ue(t.geometryType).renderer;H("drawingInfo.renderer",s,t)}if(t.geometryType==="esriGeometryMultiPatch"&&t.infoFor3D&&(t.geometryType="mesh"),t.extent==null)try{const{data:s}=await g(this.layer.url,this._getLayerRequestOptions({signal:e}));s.spatialReference&&(t.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:s.spatialReference})}catch(s){X(s)}return t}async _getFeatureJSON(t,e){const{geometry:a}=t,s={...t.attributes};if(e!=null&&(a==null?void 0:a.type)==="mesh"){const{transformFieldRoles:r}=e,{origin:u,spatialReference:i,transform:l}=a,n=this.layer.spatialReference;await Y(i,n);const c=B(u,n);if(s[r.originX]=c.x,s[r.originY]=c.y,s[r.originZ]=c.z??0,l!=null){const{translation:h,scale:y,rotation:p}=l,{vertexSpace:b}=a,o=b.isGeoreferenced?1:$(i)/$(n);s[r.translationX]=h[0]*o,s[r.translationY]=-h[2]*o,s[r.translationZ]=h[1]*o,s[r.scaleX]=y[0],s[r.scaleY]=y[2],s[r.scaleZ]=y[1],s[r.rotationX]=p[0],s[r.rotationY]=p[2],s[r.rotationZ]=p[1],s[r.rotationDeg]=p[3]}return{geometry:null,attributes:s}}return a==null?{attributes:s}:a.type==="mesh"||a.type==="extent"?null:{geometry:a.toJSON(),attributes:s}}async _getAttachmentEditsJSON(t){const e=await Promise.all((t.addAttachments??[]).map(r=>this._getAttachmentEditJSON(r))),a=await Promise.all((t.updateAttachments??[]).map(r=>this._getAttachmentEditJSON(r))),s=t.deleteAttachments??[];return e.length||a.length||s.length?{adds:e,updates:a,deletes:[...s]}:null}async _getAttachmentEditJSON(t){const{feature:e,attachment:a}=t,{globalId:s,name:r,contentType:u,data:i,uploadId:l}=a,n={globalId:s,parentGlobalId:null,contentType:null,name:null,uploadId:null,data:null};if(e&&(n.parentGlobalId="attributes"in e?e.attributes&&e.attributes[this.layer.globalIdField]:e.globalId),l)n.uploadId=l;else if(i){const c=await K(i);c&&(n.contentType=c.mediaType,n.data=c.data),i instanceof File&&(n.name=i.name)}return r&&(n.name=r),u&&(n.contentType=u),n}async _uploadMeshesAndGetAssetMapEditsJSON(t){const{addAssetFeatures:e}=t;if(!(e!=null&&e.length))return null;const a=await this._filterRedundantAssetMaps(e);if(!(e!=null&&e.length))return null;const s=new Array,r=new Map;for(const u of a){const{geometry:i}=u,{vertexSpace:l}=i;if(l.isRelative)s.push(i);else{const n=he(i);r.set(n,i),u.geometry=n,s.push(n)}}await this.uploadAssets(s);for(const[u,i]of r)i.addExternalSources(u.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(a),updates:[],deletes:[]}}_getAssetMapEditsJSON(t){const e=new Array,a=this.layer.globalIdField,s=this.layer.parsedUrl;for(const r of t){const u=r.geometry,{metadata:i}=u,l=i.getExternalSourcesOnService(s),n=r.getAttribute(a);if(l.length===0){I.getLogger(this).error(`Skipping feature ${n}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:c}=l.find(ee)??l[0],{vertexSpace:h}=u,y=h.isGeoreferenced?["PROJECT_VERTICES"]:[];for(const p of c)p.parts.length===1?e.push({globalId:te(),parentGlobalId:n,assetName:p.assetName,assetHash:p.parts[0].partHash,flags:y}):I.getLogger(this).error(`Skipping asset ${p.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return e}_getFeatureIds(t,e){if(!t||t.length===0)return[];if(e&&ne(t))return t.map(r=>r.globalId);if(oe(t))return t.map(r=>r.objectId);const{layer:a}=this,s=e?a.globalIdField:a.objectIdField;return s?t.map(r=>r.getAttribute(s)):[]}_createEditsResult(t){var n,c,h,y,p,b;const e=t.data,{layerId:a}=this.layer,s=[];let r=null;if(Array.isArray(e))for(const o of e)s.push({id:o.id,editedFeatures:o.editedFeatures}),o.id===a&&(r={addResults:o.addResults??[],updateResults:o.updateResults??[],deleteResults:o.deleteResults??[],attachments:o.attachments,editMoment:o.editMoment});else r=e;const u=r==null?void 0:r.assetMaps;if(u){for(const o of u.addResults)o.success||I.getLogger(this).error(`Failed to map asset to feature with globalId ${o.globalId}.`);for(const o of u.updateResults)o.success||I.getLogger(this).error(`Failed to map asset to feature with globalId ${o.globalId}.`)}const i=r==null?void 0:r.attachments,l={addFeatureResults:((n=r==null?void 0:r.addResults)==null?void 0:n.map(this._createFeatureEditResult,this))??[],updateFeatureResults:((c=r==null?void 0:r.updateResults)==null?void 0:c.map(this._createFeatureEditResult,this))??[],deleteFeatureResults:((h=r==null?void 0:r.deleteResults)==null?void 0:h.map(this._createFeatureEditResult,this))??[],addAttachmentResults:i&&i.addResults?i.addResults.map(this._createFeatureEditResult,this):[],updateAttachmentResults:i&&i.updateResults?i.updateResults.map(this._createFeatureEditResult,this):[],deleteAttachmentResults:i&&i.deleteResults?i.deleteResults.map(this._createFeatureEditResult,this):[]};if(r!=null&&r.editMoment&&(l.editMoment=r.editMoment),s.length>0){l.editedFeatureResults=[];for(const o of s){const{editedFeatures:d}=o,m=d!=null&&d.spatialReference?new se(d.spatialReference):null;l.editedFeatureResults.push({layerId:o.id,editedFeatures:{adds:((y=d==null?void 0:d.adds)==null?void 0:y.map(f=>this._createEditedFeature(f,m)))||[],updates:((p=d==null?void 0:d.updates)==null?void 0:p.map(f=>({original:this._createEditedFeature(f[0],m),current:this._createEditedFeature(f[1],m)})))||[],deletes:((b=d==null?void 0:d.deletes)==null?void 0:b.map(f=>this._createEditedFeature(f,m)))||[],spatialReference:m}})}}return l}_createEditedFeature(t,e){return new ae({attributes:t.attributes,geometry:re({...t.geometry,spatialReference:e})})}_createFeatureEditResult(t){const e=t.success===!0?null:t.error||{code:void 0,description:void 0};return{objectId:t.objectId,globalId:t.globalId,error:e?new E("feature-layer-source:edit-failure",e.description,{code:e.code}):null}}_createAttachmentErrorResult(t,e){const a=e.details.messages&&e.details.messages[0]||e.message,s=e.details.httpStatus||e.details.messageCode;return{objectId:t,globalId:null,error:new E("feature-layer-source:attachment-failure",a,{code:s})}}_getFormDataForAttachment(t,e){const a=t instanceof FormData?t:t&&t.elements?new FormData(t):null;if(a)for(const s in e){const r=e[s];r!=null&&(a.set?a.set(s,r):a.append(s,r))}return a}_getLayerRequestOptions(t={}){const{parsedUrl:e,gdbVersion:a,dynamicDataSource:s}=this.layer;return{...t,query:{gdbVersion:a,layer:s?JSON.stringify({source:s}):void 0,...e.query,f:"json",...this._createRequestQueryOptions(t)},responseType:"json"}}async _filterRedundantAssetMaps(t){const{layer:e}=this,{globalIdField:a,infoFor3D:s,parsedUrl:r}=e;if(s==null||a==null)return t;const u=ie(s);if(u==null)return t;const i=J(r.path,`../${u.id}`),l=new Array,n=new Array;for(const d of t)d.geometry.metadata.getExternalSourcesOnService(r).length>0?n.push(d):l.push(d);const c=n.map(d=>d.getAttribute(a)).filter(v);if(c.length===0)return t;const{assetMapFieldRoles:{parentGlobalId:h,assetHash:y}}=s,p=new pe;p.where=`${h} IN (${c.map(d=>`'${d}'`)})`,p.outFields=[y,h],p.returnGeometry=!1;const b=await de(i,p),{features:o}=b;return o.length===0?t:[...l,...n.filter(d=>{const m=d.getAttribute(a);if(!m)return!0;const{metadata:f}=d.geometry,_=o.filter(R=>R.getAttribute(h)===m);if(_.length===0)return!0;const q=_.map(R=>R.getAttribute(y));return f.getExternalSourcesOnService(r).flatMap(({source:R})=>R.flatMap(w=>w.parts.map(A=>A.partHash))).some(R=>q.every(w=>R!==w))})]}};O([x()],S.prototype,"type",void 0),O([x({constructOnly:!0})],S.prototype,"layer",void 0),O([x({readOnly:!0})],S.prototype,"queryTask",null),S=O([U("esri.layers.graphics.sources.FeatureLayerSource")],S);const Re=1e3,je=S;export{je as default}; diff --git a/assets/FeatureLayerView3D-7e7e2653.js b/assets/FeatureLayerView3D-7e7e2653.js new file mode 100644 index 0000000..8816402 --- /dev/null +++ b/assets/FeatureLayerView3D-7e7e2653.js @@ -0,0 +1 @@ +import{ai as i,aj as a,al as m,dr as s,ds as l,ar as o,aB as n}from"./index-080e108a.js";import{_ as y}from"./FeatureLayerViewBase3D-8474587e.js";import"./FeatureLikeLayerView3D-2e3185ce.js";import"./Query-1c961d4c.js";import"./dehydratedFeatureComparison-a3375a3e.js";import"./queryForSymbologySnapping-0264f2b5.js";import"./elevationInfoUtils-4fd79d95.js";import"./hash-6f442295.js";import"./diffUtils-590c9088.js";import"./Graphics3DObjectStates-bb2a6162.js";import"./UniqueValueRenderer-fef4204d.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./popupUtils-f04ec9a9.js";import"./FeatureFilter-00f4be05.js";import"./floorFilterUtils-080a7cd2.js";import"./QueryEngine-19eda5ff.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./FeatureSet-111cb247.js";import"./FeatureStore-f0e312fc.js";import"./BoundsStore-b6bd3c14.js";import"./projectExtentUtils-efa4cddd.js";import"./LayerView3D-ffd35809.js";import"./query-93c6e211.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./EventedSet-d13fada5.js";import"./commonProperties-30089b06.js";import"./FeatureEffect-86735d98.js";import"./LayerView-448bc5ea.js";import"./RefreshableLayerView-915e7f53.js";let t=class extends y{constructor(){super(...arguments),this.type="feature-3d",this.direct3DObjectFeatureLayerDisplayEnabled=s()}initialize(){var p;const{layer:e,view:r}=this;(p=l(e))!=null&&p.operations.supportsQuery||this.addResolvingPromise(Promise.reject(new o("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e}))),e.infoFor3D!=null&&(this.direct3DObjectFeatureLayerDisplayEnabled?this._set("suspendResumeExtentMode","computed"):this.addResolvingPromise(Promise.reject(new o("featurelayerview3d:unsupported-geometry-type",`Unsupported geometry type ${e.geometryType}`)))),e.geometryType!=="mesh"||n(e.spatialReference,r.spatialReference)||this.addResolvingPromise(Promise.reject(new o("layerview:spatial-reference-incompatible","The spatial references of the feature layer is incompatible with the spatial reference of the view")))}get featureSpatialReference(){var e,r;return(r=(e=this.view.featureTiles)==null?void 0:e.tilingScheme)==null?void 0:r.spatialReference}};i([a({constructOnly:!0})],t.prototype,"direct3DObjectFeatureLayerDisplayEnabled",void 0),i([a()],t.prototype,"layer",void 0),t=i([m("esri.views.3d.layers.FeatureLayerView3D")],t);const pe=t;export{pe as default}; diff --git a/assets/FeatureLayerViewBase3D-8474587e.js b/assets/FeatureLayerViewBase3D-8474587e.js new file mode 100644 index 0000000..0cac9a9 --- /dev/null +++ b/assets/FeatureLayerViewBase3D-8474587e.js @@ -0,0 +1 @@ +import{bc as S,iR as z,cq as J,aK as U,i2 as D,ai as n,aj as u,al as g,ao as v,ax as H,fL as Y,kh as G,ah as I,bz as K,aG as C,aM as M,aT as N,bw as T,dL as A,bA as W,fp as V,ki as Q,kj as X,kk as j,kl as ee,km as te,kn as q,ko as R,ar as _,kp as re,aD as b,ag as k,aC as se,kq as ie,aL as ae}from"./index-080e108a.js";import{A as oe,E as ne,I as le}from"./FeatureLikeLayerView3D-2e3185ce.js";import{n as ue}from"./LayerView3D-ffd35809.js";import{x as ce,m as pe}from"./query-93c6e211.js";import{r as de}from"./EventedSet-d13fada5.js";import{b as he}from"./commonProperties-30089b06.js";import{w as ye}from"./FeatureEffect-86735d98.js";import{d as me}from"./FeatureFilter-00f4be05.js";import{o as Z}from"./floorFilterUtils-080a7cd2.js";import{b as L}from"./Query-1c961d4c.js";import{p as E,n as fe}from"./popupUtils-f04ec9a9.js";import{d as ge}from"./LayerView-448bc5ea.js";import{a as Fe}from"./RefreshableLayerView-915e7f53.js";class we{constructor(r){this._controller=r,this._handle=new _e(t=>r.schedule(t))}destroy(){this._handle.destroy()}invoke(r,t){return r.buffer&&r.buffer.byteLength!==0?(r.options.sourceSpatialReference&&r.options.sourceSpatialReference instanceof S&&(r.options={...r.options,sourceSpatialReference:r.options.sourceSpatialReference.toJSON()}),this._handle.invoke(r,t).then(s=>{let i=0,a=0;const c=async o=>{if(s.spatialReference=S.fromJSON(s.spatialReference),s.fields){for(;ic(l))}const p=s.spatialReference;for(;ac(h))}return s};return this._controller.schedule(o=>c(o))})):Promise.resolve(null)}}function be(e){switch(e.type){case"polyline":e.paths.reduce((r,t)=>r+t.length,0)r.map(t=>[t[0],t[1],t[2]])):e.paths.map(r=>r.map(t=>[t[0],t[1]])));break;case"polygon":e.rings.reduce((r,t)=>r+t.length,0)r.map(t=>[t[0],t[1],t[2]])):e.rings.map(r=>r.map(t=>[t[0],t[1]])))}}let _e=class extends z{constructor(r){super("PBFDecoderWorker","_parseFeatureQuery",{_parseFeatureQuery:t=>[t.buffer]},r)}},f=class extends v{constructor(e){super(e)}get queryFeaturesDehydrated(){var i;const e=this.layer.capabilities,r=e&&e.query,t=r&&r.supportsFormatPBF,s=this.layer.parsedUrl;if(t){this._decoder==null&&(this._decoder=new we(this.controller));const a={sourceSpatialReference:((i=this.layer.spatialReference)==null?void 0:i.toJSON())??null,applyTransform:!0,maxStringAttributeLength:1024};return(c,o)=>ce(s,c,"pbf",this._createRequestOptions(o)).then(p=>(H(o),this._decoder!=null?this._decoder.invoke({buffer:p.data,options:a},o.signal):Promise.reject(Y())))}return(a,c)=>pe(s,a,this.layer.spatialReference,this._createRequestOptions(c)).then(o=>G(o.data))}queryFeatureCount(e,r){return this.layer.queryFeatureCount(e,r)}destroy(){this._decoder=I(this._decoder)}_createRequestOptions(e){return{...e,query:{...this.layer.customParameters,token:this.layer.apiKey,...e==null?void 0:e.query}}}};n([u({constructOnly:!0})],f.prototype,"layer",void 0),n([u({constructOnly:!0})],f.prototype,"controller",void 0),n([u({readOnly:!0})],f.prototype,"queryFeaturesDehydrated",null),f=n([g("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileServiceQuery3D")],f);let F=class extends v{constructor(e){super(e)}queryFeaturesDehydrated(e,r){return this.layer.queryFeatures(e,r)}queryFeatureCount(e,r){return this.layer.queryFeatureCount(e,r)}};n([u({constructOnly:!0})],F.prototype,"layer",void 0),n([u({readOnly:!0})],F.prototype,"queryFeaturesDehydrated",null),F=n([g("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileServiceMeshQuery3D")],F);let x=class extends v{constructor(e){super(e)}queryFeaturesDehydrated(e,r){return this.layer.queryFeatures(e,r)}};n([u({constructOnly:!0})],x.prototype,"layer",void 0),x=n([g("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileServiceQuery3D")],x);let w=class extends v{constructor(e){super(e)}queryFeaturesDehydrated(e,r){return this.source.queryFeaturesJSON(e,r).then(G,t=>{if(t&&t.name==="query-features-json:unsupported")return this.layer.queryFeatures(e,r);throw t})}queryFeatureCount(e,r){return this.layer.queryFeatureCount(e,r)}};function xe(e,r){return e.type==="feature"&&e.source.type==="feature-layer"?e.infoFor3D!=null?new F({layer:e}):new f({layer:e,controller:r}):e.type==="feature"&&e.source.type==="memory"||e.type==="csv"||e.type==="geojson"||e.type==="oriented-imagery"||e.type==="wfs"?new w({layer:e,source:e.source}):e.type==="ogc-feature"?new x({layer:e}):null}n([u({constructOnly:!0})],w.prototype,"layer",void 0),n([u({constructOnly:!0})],w.prototype,"source",void 0),w=n([g("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileClientQuery3D")],w);class ve{constructor(r){this._memoryCache=null,this._capabilities=null;const t=r.layerView.layer;this._layerView=r.layerView,this.objectIdField=t.objectIdField,this.globalIdField="globalIdField"in t?t.globalIdField:null,this._returnZ=r.returnZ,this._returnM=r.returnM;const s=this._layerView.view.resourceController;this.query=xe(t,s.normal),s&&this._memoryCacheEnabled&&(this._memoryCache=s.memoryController.newCache(`fl-${t.uid}`))}get _memoryCacheEnabled(){switch(this._layerView.layer.source.type){case"feature-layer":case"ogc-feature":case"oriented-imagery":return!0;case"csv":case"geojson":case"memory":case"wfs":return!1}}destroy(){this._memoryCache=I(this._memoryCache),this.query.destroy()}createQuery(){const r=this._layerView.layer.createQuery();return r.outFields=this._layerView.availableFields,r.returnZ=this._returnZ,r.returnM=this._returnM,r.outSpatialReference=this.tilingScheme.spatialReference,r}get memoryCache(){return this._memoryCache}get viewingMode(){return this._layerView.view.state.viewingMode}get tilingScheme(){return this._layerView.view.featureTiles.tilingScheme}get scheduler(){const r=this._layerView.view.resourceController;return r?r.scheduler:null}get geometryType(){return this._layerView.layer.geometryType}get fullExtent(){return this._layerView.layer.fullExtent}get tileMaxRecordCount(){return this._layerView.layer.capabilities.query.tileMaxRecordCount}get maxRecordCount(){return this._layerView.layer.capabilities.query.maxRecordCount}get capabilities(){return this._capabilities!=null||(this._capabilities=oe(this._layerView.layer)),this._capabilities}logFetchError(r,t){r.error("#fetchTile()",this._layerView.layer,t&&t.message?t.message:t)}}const B="esri.views.layers.FeatureLayerView",O=K.getLogger(B),qe=e=>{let r=class extends e{constructor(...t){super(...t),this._updatingRequiredFieldsPromise=null,this.filter=null,this.timeExtent=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.handles.add([C(()=>{var s;const t=this.layer;return[(s=t==null?void 0:t.elevationInfo)==null?void 0:s.featureExpressionInfo,t&&"displayField"in t?t.displayField:null,t&&"timeInfo"in t&&t.timeInfo,t&&"renderer"in t&&t.renderer,t&&"labelingInfo"in t&&t.labelingInfo,t&&"floorInfo"in t&&t.floorInfo,this.filter,this.featureEffect,this.timeExtent]},()=>this._handleRequiredFieldsChange(),M),N(()=>{var t;return(t=this.view)==null?void 0:t.floors},"change",()=>this._handleRequiredFieldsChange()),N(()=>{const t=this.layer;return t&&"sublayers"in t?t.sublayers:null},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){const{layer:t,layer:{fieldsIndex:s},requiredFields:i}=this;return"outFields"in t&&t.outFields?T(s,[...A(s,t.outFields),...i]):T(s,i)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(t){this._override("featureEffect",t)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(t){O.error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(t){throw new Error("missing implementation")}createQuery(){const t={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},s=this.filter!=null?this.filter.createQuery(t):new L(t);if(this.layer.type==="feature"){const i=Z(this);i!=null&&(s.where=s.where?`(${s.where}) AND (${i})`:i)}return this.timeExtent!=null&&(s.timeExtent=s.timeExtent!=null?s.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),s}createAggregateQuery(){const t={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new L(t)}queryFeatures(t,s){throw new Error("missing implementation")}queryObjectIds(t,s){throw new Error("missing implementation")}queryFeatureCount(t,s){throw new Error("missing implementation")}queryExtent(t,s){throw new Error("missing implementation")}async fetchPopupFeatures(t,s){const i=this.validateFetchPopupFeatures(s);if(i)throw i;return this.fetchClientPopupFeatures(s)}_loadArcadeModules(t){return t.get("expressionInfos.length")||Array.isArray(t.content)&&t.content.some(s=>s.type==="expression")?W():Promise.resolve()}_handleRequiredFieldsChange(){const t=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",t),t.then(()=>{this._updatingRequiredFieldsPromise===t&&this._set("_updatingRequiredFieldsPromise",null)})}async _updateRequiredFields(){if(!this.layer||!this.view)return;const t=this.view.type==="3d",{layer:s,layer:{fieldsIndex:i,objectIdField:a}}=this,c="renderer"in s&&s.renderer,o="orderBy"in s&&s.orderBy,p="featureReduction"in s?s.featureReduction:null,l=new Set,h=await V([c?c.collectRequiredFields(l,i):null,Q(l,s),t?X(l,s):null,this.filter!=null?j(l,s,this.filter):null,this.featureEffect!=null?j(l,s,this.featureEffect.filter):null,p?ee(l,s,p):null,o?te(l,s,o):null]);if("timeInfo"in s&&s.timeInfo&&this.timeExtent&&q(l,s.fieldsIndex,[s.timeInfo.startField,s.timeInfo.endField]),s.type==="feature"&&(s.floorInfo&&q(l,s.fieldsIndex,[s.floorInfo.floorField]),t&&s.infoFor3D!=null&&(s.globalIdField==null&&O.error("globalIdField missing on 3DObjectFeatureLayer"),q(l,s.fieldsIndex,[s.globalIdField]))),s.type==="subtype-group"){R(l,i,s.subtypeField);const y=s.sublayers.map(P=>{var $;return Promise.all([($=P.renderer)==null?void 0:$.collectRequiredFields(l,i),Q(l,P)])});await V(y)}for(const y of h)y.error&&O.error(y.error);R(l,i,a),t&&"displayField"in s&&s.displayField&&R(l,i,s.displayField);const m=Array.from(l).sort();this._set("requiredFields",m)}validateFetchPopupFeatures(t){if(t==null)return null;for(const s of t.clientGraphics??[]){const i=s.layer;if("popupEnabled"in i&&!i.popupEnabled)return new _("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:i});if(s.isAggregate){const a="featureReduction"in i?i.featureReduction:null;if(!(a&&"popupTemplate"in a&&a.popupEnabled&&a.popupTemplate))return new _("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:i})}else if("popupTemplate"in i&&!E(i,t))return new _("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:i})}}async fetchClientPopupFeatures(t){const s=t!=null?t.clientGraphics:null;if(!s||s.length===0)return[];const i=new Array(s.length),a=new Map,c=await this.createPopupQuery(t);for(let o=0;oo.layer):[this.layer];for(const o of c){if(!("popupEnabled"in o))continue;const p=E(o,t);if(p==null)continue;const l=await this._loadArcadeModules(p),h=l&&l.arcadeUtils.hasGeometryOperations(p);a=!(this.layer.geometryType!=="point"&&!h);const m=await fe(this.layer,p);for(const y of m)i.add(y)}if(s.returnGeometry=a,s.returnZ=a,s.returnM=a,s.outFields=Array.from(i),s.outSpatialReference=this.view.spatialReference,this.layer.type==="feature"){const o=Z(this);o!=null&&(s.where=s.where?`(${s.where}) AND (${o})`:o)}return s}canResume(){return!!super.canResume()&&(this.timeExtent==null||!this.timeExtent.isEmpty)}};return n([u()],r.prototype,"_updatingRequiredFieldsPromise",void 0),n([u({readOnly:!0})],r.prototype,"availableFields",null),n([u({type:ye})],r.prototype,"featureEffect",null),n([u({type:me})],r.prototype,"filter",void 0),n([u(he)],r.prototype,"timeExtent",void 0),n([u()],r.prototype,"layer",void 0),n([u({type:Number})],r.prototype,"maximumNumberOfFeatures",null),n([u({readOnly:!0,type:Boolean})],r.prototype,"maximumNumberOfFeaturesExceeded",null),n([u({readOnly:!0})],r.prototype,"requiredFields",void 0),n([u()],r.prototype,"suspended",void 0),n([u()],r.prototype,"view",void 0),r=n([g(B)],r),r};let d=class extends Fe(ne(qe(ue(ge)))){constructor(e){super(e),this._controllerTotal=0,this._processorTotal=0,this.suspendResumeExtentMode="data"}initialize(){this.handles.add(C(()=>this._updatingRequiredFieldsPromise,e=>this.updatingHandles.addPromise(e),M))}destroy(){this.updatingHandles.removeAll(),this.handles.removeAll(),this._fetcherContext=I(this._fetcherContext)}get maximumNumberOfFeatures(){var e;return((e=this.controller)==null?void 0:e.maximumNumberOfFeatures)??this._get("maximumNumberOfFeatures")}set maximumNumberOfFeatures(e){this._set("maximumNumberOfFeatures",e),this.controller&&(this.controller.maximumNumberOfFeatures=e)}get maximumNumberOfFeaturesExceeded(){return!!this.controller&&!(this.suspended||!this.controller.maximumNumberOfFeaturesExceeded)}get updatingProgressValue(){var t,s;let e=0;if((t=this.controller)!=null&&t.updating){const i=this.controller.updatingRemaining,a=Math.max(this.controller.updatingTotal,this._controllerTotal);a>0&&(e=(a-i)/a,this._controllerTotal=a)}let r=0;if((s=this.processor)!=null&&s.updating){const i=this.processor.updatingRemaining,a=Math.max(i,this._processorTotal);a>0&&(r=(a-i)/a,this._processorTotal=a)}return .5*(e+r)}get updatePolicy(){if(!this.controller)return b.ASYNC;switch(this.controller.mode){case"snapshot":{const e=Re.get(this.layer.geometryType);return e==null||this.controller.serviceDataCount>e?b.ASYNC:b.SYNC}case"tiles":return b.ASYNC}}get hasZ(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in e&&e.returnZ!=null?e.returnZ:r.supportsZ)}get hasM(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsM)&&"returnM"in e&&e.returnM!=null&&e.returnM}setVisibility(e,r){var t;(t=this.processor)==null||t.setObjectIdVisibility(e,r)}createQuery(){return super.createQuery()}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return this.layer.geometryType==="mesh"?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}beforeSetController(e){e.maximumNumberOfFeatures=this.maximumNumberOfFeatures}createController(){this._fetcherContext=new ve({layerView:this,returnZ:this.hasZ,returnM:this.hasM});const e=new le({layerView:this,context:this._fetcherContext,graphics:new de,extent:this.clippingExtent});return this.updatingHandles.add(()=>e.serviceDataExtent,r=>{this.processor&&(this.processor.dataExtent=r)},k),this.handles.add(C(()=>this.suspended,r=>{r?e.suspend():e.resume()},M)),this.updatingHandles.add(()=>{var r;return(r=this.processor)==null?void 0:r.displayFeatureLimit},r=>e.displayFeatureLimit=r,k),this.handles.add(se(()=>!this.updating,()=>{this._controllerTotal=0,this._processorTotal=0})),e}async doRefresh(e){e&&!this.suspended&&this.controller&&this.controller.refetch(),this.processor.refreshFilter()}get usedMemory(){var e,r;return(((e=this.processor)==null?void 0:e.usedMemory)??0)+(((r=this.controller)==null?void 0:r.memoryForUnusedFeatures)??0)}get unloadedMemory(){var i,a,c,o;const e=((i=this.processor)==null?void 0:i.unprocessedMemoryEstimate)??0,r=((a=this.controller)==null?void 0:a.expectedFeatureDiff)??0,t=((c=this.processor)==null?void 0:c.loadedFeatures)??0,s=t/(t+r);return e+r*(((o=this.processor)==null?void 0:o.usedMemoryPerFeature)??0)*s}get ignoresMemoryFactor(){var e;return(e=this.controller)==null?void 0:e.hasMaximumNumberOfFeaturesOverride}async _queryFeaturesMesh(e,r){await this._validateQueryFeaturesMesh(e);const t=await r();if(e&&e.outStatistics||this.graphics3DProcessor==null)return t;const s=this.layer.objectIdField,i=this.graphics3DProcessor.graphics3DGraphicsByObjectID,a=[];for(const c of t.features)if(c.geometry){const o=i.get(c.attributes[s]);o&&(c.geometry=ie(o.graphic.geometry),a.push(c))}else a.push(c);return t.features=a,t}async _validateQueryFeaturesMesh(e){if(!e)return;const r=s=>{throw new _("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${s}'`)},t=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const s of t)e[s]!=null&&r(s);"returnM"in e&&e.returnM&&r("returnM"),"returnCentroid"in e&&e.returnCentroid&&r("returnCentroid"),e.outSpatialReference==null||e.outSpatialReference.equals(this.view.spatialReference)||r("outSpatialReference")}get performanceInfo(){var s,i,a,c;const e=(s=this.controller)==null?void 0:s.displayFeatureLimit,r=e!=null?e.averageSymbolComplexity:void 0,t=r!=null?`f:${r.primitivesPerFeature},v:${r.primitivesPerCoordinate}`:"n/a";return{...this._getResourceInfo(),partial:this.maximumNumberOfFeaturesExceeded,mode:((i=this.controller)==null?void 0:i.mode)??"n/a",symbolComplexity:t,nodes:((a=this.controller)==null?void 0:a.tileDescriptors.length)??0,...((c=this.controller)==null?void 0:c.debug)??{storedFeatures:0,totalVertices:0}}}get test(){var e;return{updatePolicy:this.updatePolicy,controller:this.controller,loadedGraphics:(e=this.controller)==null?void 0:e.graphics}}};n([u()],d.prototype,"layer",void 0),n([u()],d.prototype,"controller",void 0),n([u()],d.prototype,"_controllerTotal",void 0),n([u()],d.prototype,"_processorTotal",void 0),n([u()],d.prototype,"maximumNumberOfFeatures",null),n([u()],d.prototype,"maximumNumberOfFeaturesExceeded",null),n([u(ae)],d.prototype,"updatingProgress",void 0),n([u({readOnly:!0})],d.prototype,"updatingProgressValue",null),n([u({readOnly:!0})],d.prototype,"updatePolicy",null),n([u({readOnly:!0})],d.prototype,"hasZ",null),n([u({readOnly:!0})],d.prototype,"hasM",null),n([u()],d.prototype,"suspendResumeExtentMode",void 0),d=n([g("esri.views.3d.layers.FeatureLayerViewBase3D")],d);const Re=new Map([["point",5e3],["polygon",500],["polyline",1e3]]),je=d;export{je as _}; diff --git a/assets/FeatureLikeLayerView3D-2e3185ce.js b/assets/FeatureLikeLayerView3D-2e3185ce.js new file mode 100644 index 0000000..79579ed --- /dev/null +++ b/assets/FeatureLikeLayerView3D-2e3185ce.js @@ -0,0 +1,32 @@ +import{dz as ue,rF as ft,iX as _e,dB as fe,g4 as gt,gd as Ft,ga as ge,rG as xt,pp as C,rH as Et,bz as U,ai as n,aj as l,al as P,ao as he,af as Be,pq as bt,aT as vt,dW as de,ah as O,bn as M,fp as We,e$ as Tt,iS as Rt,rI as wt,rJ as Ct,e_ as St,ax as Fe,aU as Ot,hR as Je,rK as Dt,f5 as It,rL as Vt,ql as k,qn as j,ak as Pt,aK as q,bi as $t,bj as Mt,cY as At,aF as xe,ae as Nt,ag as D,ds as Lt,ar as V,hV as Xe,aO as ae,cT as Ze,aG as R,aM as B,aH as ne,g8 as Ut,fL as Gt,cB as qt,cl as Ee,d0 as Ht,cn as be,b7 as ve,ca as zt,fy as Qt,bm as ce,as as kt,aN as jt,aQ as Ye,aD as pe,rM as Te,rN as Bt,br as W,bo as Wt,bp as Jt,gU as Xt,aC as Zt,ny as Yt,c$ as Kt,bs as ei,bt as ti,ia as Ke,o0 as ii,rO as si,ih as Re,ii as Z,id as A,im as et,aw as tt,iq as oe,is as it,it as st,iu as rt,iv as at,lK as ri,iB as nt,lL as ai,iG as ot,mN as ni,rP as oi,rQ as we,b4 as Ce,rR as li,o8 as ui,rS as H,rT as hi,aq as di,nd as z,rU as ci,rV as pi,ib as mi,a_ as E,rW as yi,io as _i,rX as fi,ip as Se,iM as gi,lM as Fi,lN as xi,hI as Ei,hH as bi,m1 as vi,oY as Ti,lO as Ri,pb as wi,rY as Ci,mz as Si,hr as Oi,rZ as J,r_ as I,r$ as Oe,aS as lt,lA as Di,kX as Ii,kY as De,fA as L,bF as Vi,kS as Pi,bR as $i,gc as Mi,bL as Ai,s0 as Ie,bM as Ve,dZ as Ni,aV as Pe,lF as Li,b2 as Ui,a$ as $e,b0 as Gi,aZ as qi,e7 as Hi,b1 as Me,rd as zi,dT as Qi,fx as ki,bq as ji}from"./index-080e108a.js";import{b as Q,a as Bi,m as Wi}from"./Query-1c961d4c.js";import{c as ut}from"./dehydratedFeatureComparison-a3375a3e.js";import{f as Ji,r as Xi}from"./queryForSymbologySnapping-0264f2b5.js";import{i as Zi}from"./hash-6f442295.js";import{a as Ae}from"./diffUtils-590c9088.js";import{F as Yi,l as Ki,m as es,s as ts,a as is}from"./Graphics3DObjectStates-bb2a6162.js";import{d as ss}from"./FeatureFilter-00f4be05.js";import{o as rs}from"./floorFilterUtils-080a7cd2.js";import{e as as}from"./QueryEngine-19eda5ff.js";import{d as Ne}from"./FeatureSet-111cb247.js";import{m as ns}from"./FeatureStore-f0e312fc.js";import{u as os}from"./heatmapUtils-327ef4c5.js";import{l as ls}from"./projectExtentUtils-efa4cddd.js";let us=class{get isReferenced(){return this.versions.length!==0}get isSingle(){return this.versions.length===1&&this.versions[0].refCount===1}constructor(e,t){this._highestResolutionVersion=null,this.versions=[],this.ref(e,t)}ref(e,t){const i=this.feature;x.oldVersion=i,this.feature&&Object.defineProperty(e,"uid",{value:this.feature.uid,configurable:!0});for(const a of this.versions)if(a.resolution===t){a.refCount++;const o=this._highestResolutionVersion===a&&!ut(e,a.feature);return(o||this._highestResolutionVersion!==a)&&(a.feature=e),x.newVersion=o?e:i,x}const s={feature:e,resolution:t,refCount:1};return this.versions.push(s),!this._highestResolutionVersion||t0&&(this._refCount--,!this.isReferenced)?(x.newVersion=null,x):(x.newVersion=this._feature,x)}get feature(){return this._feature}};const x={oldVersion:null,newVersion:null},ds=16438,Le=new Set;let cs=class{get displayingFeatures(){return this._displayingFeatures}set displayingFeatures(e){this._displayingFeatures=e,this.extentIncludingBorrowedFeatures=null}get perTileMaximumNumberOfFeaturesExceeded(){return!this.filtered&&(this.featuresMissing||this.features&&this.featureLimit!==this.features.length)}get features(){return this._features}get featureLimit(){return this._featureLimit}set featureLimit(e){this._featureLimit!==e&&(this._featureLimit=e,this._estimatedUnusedSizeDirty=!0)}get availableFields(){return this._availableFields}setFeatures(e,t,i){this._availableFields=i??Le,this._features=e,this._shuffled=!1,this._estimatedSize=-1,this._estimatedUnusedSizeDirty=!0,e&&e.length>0?(this._emptyFeatureRatio=t/(e.length+t),this._numVertices=e.reduce((s,a)=>s+ft(a.geometry),0)):(this._emptyFeatureRatio=0,this._numVertices=0)}get emptyFeatureRatio(){return this._emptyFeatureRatio}get numFeatures(){return this.hasPreciseFeatureCount?this._numFeatures:this._features?this._features.length:0}set numFeatures(e){this._numFeatures=e}get hasPreciseFeatureCount(){return this._numFeatures>K}get needsFeatureCount(){return this._numFeatures===K}get numVertices(){return this._numVertices}constructor(e){this.descriptor=e,this.fetchStatus=_.FETCH_NEEDED,this._features=null,this._numVertices=0,this._featureLimit=0,this.featuresMissing=!0,this._shuffled=!1,this._numFeatures=K,this._emptyFeatureRatio=0,this._estimatedSize=-1,this._estimatedUnusedSize=0,this._estimatedUnusedSizeDirty=!1,this._availableFields=Le,this._displayingFeatures=null,this.alive=!0,this.filtered=!1}get id(){return this.descriptor.id}get estimatedSize(){return this.updateMemoryEstimates(),this._estimatedSize}get estimatedUnusedSize(){return this._estimatedUnusedSize}updateMemoryEstimates(){if(this._estimatedSize<0){if(this._estimatedSize=0,this._estimatedUnusedSize=0,this._features)for(let e=0;e=this.featureLimit&&(this._estimatedUnusedSize+=t)}return!0}if(this._estimatedUnusedSizeDirty){if(this._estimatedUnusedSize=0,this._estimatedUnusedSizeDirty=!1,this._features)for(let e=this.featureLimit;eC(t,e)-C(i,e)),Et(this._features,ds),this._shuffled=!0,this._estimatedUnusedSizeDirty=!0}reduceFeatures(e,t,i){if(e<=0)return!1;if(!this._features)return this.featureLimit=0,!1;let s=!1;this.featureLimit=Math.ceil(this.numFeatures*e),this.featureLimit>this._features.length&&(this.featureLimit=this._features.length,this.fetchStatus===_.DONE&&this._features.length>0&&(this.fetchStatus=_.REFETCH_NEEDED,s=!0)),!this._shuffled&&e<1&&this._shuffle(i);const a=Math.max(this.featureLimit,Math.ceil(t*this.numFeatures));return this._features.length>a&&(this._features.length=a,this.featuresMissing=!0,this.fetchStatus===_.FULL&&(this.fetchStatus=_.DONE)),s}get cache(){return{availableFields:this._availableFields,features:this._features,numFeatures:this._numFeatures,emptyFeatureRatio:this._emptyFeatureRatio,fetchStatus:this.fetchStatus,featuresMissing:this.featuresMissing}}set cache(e){this.requestController=null,this._availableFields=e.availableFields,this._features=e.features,this._numFeatures=e.numFeatures,this._emptyFeatureRatio=e.emptyFeatureRatio,this.fetchStatus=e.fetchStatus,this.featuresMissing=e.featuresMissing,this._estimatedSize=-1,this._estimatedUnusedSizeDirty=!0}};const K=-1,ps=-2;var _;function ms(r,e,t){if(e==null||r==null||t!==e.length||t>r.length)return!1;for(let i=0;ie+=t.estimatedUnusedSize),e}get totalVertices(){let e=0;return this._featureTiles.forEach(t=>e+=t.numVertices),e}get totalFeatures(){let e=0;return this._featureTiles.forEach(t=>e+=t.numFeatures),e}set filterExtent(e){if(e!=null&&this.context.tilingScheme&&!e.spatialReference.equals(this.context.tilingScheme.spatialReference))return void ee.error("#filterExtent=","extent needs to be in the same spatial reference as the tiling scheme");const t=this._get("filterExtent");if(t===e||t!=null&&e&&t.equals(e))return;const i=e!=null?e.clone():null;this._set("filterExtent",i),this._reclip(i,t)}constructor(e){super(e),this._useTileCount=!1,this.updating=!1,this.running=!1,this.updatingTotal=0,this.updatingRemaining=0,this.expectedFeatureDiff=0,this.maximumNumberOfFeaturesExceeded=!1,this.maximumNumberOfFeaturesExceededThrottle=1e3,this._fullRatio=1,this._farRatio=1,this._changes={updates:{adds:new Array,removes:new Array},adds:new Array,removes:new Array},this._handles=new Be,this._frameTask=bt,this._dirty=!1,this._featureTiles=new Map,this._displayingFeatureReferences=new Map,this._numDisplayingFeatureReferences=0,this._suspended=!0,this._pendingEdits=null}initialize(){this._handles.add(vt(()=>this.tileDescriptors,"change",()=>this._setDirty(),{onListenerAdd:()=>this._setDirty()})),this._objectIdField=this.context.objectIdField,this.FeatureReferenceClass=this.context.capabilities.supportsMultipleResolutions?us:hs;const e=this.context.scheduler;e!=null&&(this._frameTask=e.registerTask(de.FEATURE_TILE_FETCHER,this)),this._setDirty()}destroy(){var e;this._frameTask.remove(),this._handles=O(this._handles),this._featureTiles.forEach(t=>{this._cancelFetchTile(t),this._removeTile(t)}),this._featureTiles.clear(),this._displayingFeatureReferences.clear(),(e=this._pendingEdits)==null||e.controller.abort(),this._pendingEdits=null}get _paused(){return this._suspended||!!this._pendingEdits}restart(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._clearTile(e),this._resetFetchTile(e)}),this.context.memoryCache!=null&&this.context.memoryCache.clear(),this._setDirty()}refetch(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._resetFetchTile(e)}),this.context.memoryCache!=null&&this.context.memoryCache.clear(),this._setDirty()}suspend(){this._suspended||(this._suspended=!0,this._pause(),this._setDirty())}resume(){this._suspended&&(this._suspended=!1,this._unpause())}_pause(){this._paused&&(this._featureTiles.forEach(e=>this._cancelFetchTile(e)),this._updated())}_unpause(){this._paused||(this._setDirty(),this._updated())}get availableFields(){let e=null;return this._featureTiles.forEach(t=>{t.displayingFeatures!=null&&t.displayingFeatures.length!==0&&(e==null?e=new Set(t.availableFields):e.forEach(i=>{t.availableFields.has(i)||e.delete(i)}))}),e??new Set}applyEdits(e){this._pendingEdits||(this._pendingEdits={edits:Promise.resolve(),count:0,controller:new AbortController},this._pause());const t=this._pendingEdits;t.count++;const i=t.edits.then(()=>e.result.catch(s=>{if(M(s))throw s;return null}).then(s=>s&&(this._applyEditsDeleteFeatures(s.deletedFeatures),this._applyEditsAddUpdateFeatures(s.addedFeatures,s.updatedFeatures,t.controller.signal).then(()=>s))).then(s=>(--t.count==0&&(this._pendingEdits===t&&(this._pendingEdits=null),this.context.memoryCache!=null&&this.context.memoryCache.clear(),this._unpause(),this._updated()),s)));return t.edits=i,this._updated(),i}_applyEditsDeleteFeatures(e){if(e.length===0)return;const t=this.context.globalIdField,i=t&&this.availableFields.has(t),s=new Set,a=this._objectIdField;e.forEach(({objectId:o,globalId:u})=>{if((!o||o<0)&&t){i||ee.errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected in the view`);const h=this.features.find(c=>c.attributes&&c.attributes[t]===u);h&&s.add(C(h,a))}else s.add(o)}),this._featureTiles.forEach(o=>{if(!o.features)return;const u=o.features.filter(h=>!s.has(C(h,this._objectIdField)));u.length!==o.features.length&&(o.setFeatures(u,0,o.availableFields),this._invalidateCounts())})}async _applyEditsAddUpdateFeatures(e,t,i){const s=[],a=new Set;if(e.forEach(u=>s.push(u.objectId)),t.forEach(u=>{s.push(u.objectId),a.add(u.objectId)}),s.length===0)return;const o=[];this._featureTiles.forEach(u=>{const h=this._applyEditsAddUpdateTile(u,s,a,i);h&&o.push(h)}),await We(o)}async _applyEditsAddUpdateTile(e,t,i,s){if(!e.features)return;const a=this._createQuery(e);a.resultType=void 0,a.cacheHint=!1,a.objectIds=t;const o=await this._queryFeatures(a,s);let u=null;if(i.size>0){const h=e.features.filter(c=>!i.has(C(c,this._objectIdField)));h.length!==e.features.length&&(u=h)}if(o.features.length>0){u||(u=e.features.slice());for(const h of o.features)u.push(h)}u&&(e.hasPreciseFeatureCount&&(e.numFeatures=Math.max(e.numFeatures,u.length)),e.setFeatures(u,0,Ge(e.availableFields,o.fields)),this._invalidateCounts())}_queryFeatures(e,t){return this.context.query.queryFeaturesDehydrated(e,{signal:t,timeout:Fs})}_setDirty(){this._dirty=!0,this._updated()}runTask(e){if(this._frameTask.processQueue(e),!this._dirty||!this.initialized)return;this._dirty=!1;const t=this._getListOfTiles();if(this._markTilesNotAlive(t),!e.run(()=>this._addTiles(t,e))||!e.run(()=>this._filterExtentTiles(t,e))||!e.run(()=>this._removeTiles(t,e))||e.done)return void this._setDirty();const i=this._sortTiles(t);e.run(()=>this._showTiles(i,e))&&e.run(()=>this._fetchTiles(i,e))&&e.run(()=>this._updateMemoryEstimates(i,e))||this._setDirty(),this._updated(),this.updating||this._updateMaximumNumberOfFeaturesExceeded()}_markTilesNotAlive(e){for(const t of e)t.alive=!1}_addTiles(e,t){return!this._suspended&&(this.tileDescriptors.forEach(i=>{const s=this._featureTiles.get(i.id);s?s.alive=!0:t.done||(e.push(this._addTile(i)),t.madeProgress())}),t.hasProgressed)}_filterExtentTiles(e,t){for(const i of e){if(t.done)break;i.alive&&(i.filtered=!i.intersects(this.filterExtent),i.filtered&&(this._clearTile(i),t.madeProgress()))}return t.hasProgressed}_removeTiles(e,t){for(let i=e.length-1;i>=0&&!t.done;i--){const s=e[i];s.alive||(this._removeTile(s),i!==e.length-1&&(e[i]=e[e.length-1]),e.pop(),t.madeProgress())}return t.hasProgressed}_sortTiles(e){return e.sort((t,i)=>(t.descriptor.loadPriority??0)-(i.descriptor.loadPriority??0)),e}_showTiles(e,t){const i=this._updateRatio(e),s=a=>{const o=this._fullRatio<1?i(a)*this._farRatio:1;return a.reduceFeatures(o,this.memoryFactor,this._objectIdField)&&this._setDirty(),this._showTile(a)};for(const a of e)if(!t.run(()=>s(a))){this._setDirty();break}return t.hasProgressed}_fetchTiles(e,t){if(this._paused)return!1;let i=!1;for(const s of e){if(!s.needsFetching)continue;const a=this.context.memoryCache!=null?this.context.memoryCache.pop(s.id):null;if(a==null){if(this._needsNumFeatures(s)){const o=new AbortController,u=this._fetchTileCount(s,o.signal);this._handleRequest(s,u,o,()=>s.numFeatures=ps),i=!0,t.madeProgress()}if(t.done)return!0}else s.cache=a,this._setDirty(),this._scheduleUpdated(),t.madeProgress()}if(i)return t.hasProgressed;for(const s of e)if(s.needsFetching){const a=new AbortController,o=this._fetchTile(s,a.signal);if(this._handleRequest(s,o,a,u=>{s.setFeatures([],0,null),this._invalidateCounts(),s.featuresMissing=!1,this.context.logFetchError(ee,u)}),t.madeProgress())return!0}return t.hasProgressed}_updateMemoryEstimates(e,t){return e.some(i=>!t.run(()=>i.updateMemoryEstimates())&&(this._setDirty(),!0)),t.hasProgressed}_reclip(e,t){if(!this.initialized)return;const i=new Array;this._featureTiles.forEach(s=>{s.displayingFeatures!=null&&s.displayingFeatures.length!==0&&(s.intersectionIncludingBorrowed(t,qe),s.intersectionIncludingBorrowed(e,He),Tt(qe,He)||i.push(s))}),this._refreshDisplayingFeatures(i),this._updated()}_refreshDisplayingFeatures(e){const t=new Set,i=this._changes.updates;for(const s of e)if(s.displayingFeatures!=null)for(const a of s.displayingFeatures){const o=C(a,this._objectIdField);if(t.has(o))continue;t.add(o);const u=this._displayingFeatureReferences.get(o).feature;i.removes.push(u),i.adds.push(u)}this._applyChanges()}_updated(){let e=0;this._paused||this._featureTiles.forEach(i=>i.isFetching?++e:0);const t=this._dirty||!!this._pendingEdits||e>0;if(this._set("running",this._dirty),this._set("updating",t),t){let i=0,s=0,a=0,o=0,u=0;const h=this._displayingFeatureReferences.size/this._numDisplayingFeatureReferences;this._featureTiles.forEach(d=>{if(++s,d.isFetching&&d.hasPreciseFeatureCount){const g=this._maximumFeaturesForTile(d)*(1-d.emptyFeatureRatio),b=d.displayingFeatures!=null?d.displayingFeatures.length*h:0;u+=g-b}d.needsFetching?++o:d.numFeatures>0&&(++a,i+=d.numFeatures)}),o+=e;let c=0,y=0;i?(y=i,c=Math.min(o*i/a,i)):(y=s,c=o),u=Math.min(this.maximumNumberOfFeatures-this.features.length,u),this._set("updatingTotal",y),this._set("updatingRemaining",c),this._set("expectedFeatureDiff",u)}else this._set("updatingTotal",0),this._set("updatingRemaining",0),this._set("expectedFeatureDiff",0);this.debugger&&this.debugger.update()}_updateMaximumNumberOfFeaturesExceeded(){const e=Rt(this._featureTiles,t=>t.perTileMaximumNumberOfFeaturesExceeded);this._set("maximumNumberOfFeaturesExceeded",e)}_updateRatio(e){const t=ys(e),i=o=>1/(1<e&&this._featureTiles.forEach(i=>{if(!i.featuresMissing)return;const s=this._maximumFeaturesForTile(i);i.features&&(i.features.length>=s||i.fetchStatus===_.FULL)||(this._cancelFetchTile(i),this._resetFetchTile(i))}),this._setDirty())}_addTile(e){const t=new cs(e);return this._featureTiles.set(t.id,t),this._resetFetchTile(t),this._referenceDisplayingFeaturesFromRelatedTiles(t),t}_referenceDisplayingFeaturesFromRelatedTiles(e){const t=e.descriptor.resolution;this._featureTiles.forEach(i=>{if(!(i.displayingFeatures==null||e===i||e.descriptor.lij&&i.descriptor.lij&&!wt(e.descriptor.lij,i.descriptor.lij))){e.displayingFeatures==null&&(e.displayingFeatures=[]),e.descriptor.extent&&i.descriptor.extent&&(e.extentIncludingBorrowedFeatures==null&&(e.extentIncludingBorrowedFeatures=Ct(e.descriptor.extent)),St(e.extentIncludingBorrowedFeatures,i.descriptor.extent,e.extentIncludingBorrowedFeatures));for(const s of i.displayingFeatures){e.displayingFeatures.push(s);const a=this._displayingFeatureReferences.get(C(s,this._objectIdField));a.ref(a.feature,t),this._numDisplayingFeatureReferences++}}}),e.featureLimit=e.displayingFeatures!=null?e.displayingFeatures.length:0}_removeTile(e){this._clearTile(e),this._featureTiles.delete(e.id)}_resetFetchTile(e){e.filtered=!e.intersects(this.filterExtent),e.filtered?e.needsFetching&&(e.fetchStatus=_.DONE):e.fetchStatus=_.FETCH_NEEDED}_cancelFetchTile(e){const t=e.requestController;t!=null&&(e.requestController=null,e.resetFetching(),t.abort())}async _fetchTileCount(e,t){return e.numFeatures=await this._fetchCount(e,t),this._updateRatio(this._getListOfTiles()),e.fetchStatus===_.REFETCHING?_.REFETCH_NEEDED:_.FETCH_NEEDED}async _fetchTile(e,t){const i=this._maximumFeaturesForTile(e);if(i<=0)return fs(e);const s=this._getMaxRecordCount(e),a=Math.ceil(i/s);if(te(e)||!this.context.capabilities.supportsMaxRecordCountFactor||e.numFeatures<=i&&a>Q.MAX_MAX_RECORD_COUNT_FACTOR)return this._fetchPagedTile(e,t);const o=this._createQuery(e);if(o.maxRecordCountFactor=Math.ceil(i/s),e.isRefetching&&e.features&&e.features.length>0){const d=Math.ceil(e.features.length/(1-e.emptyFeatureRatio)/s);o.maxRecordCountFactor=Math.max(d+1,o.maxRecordCountFactor)}const{features:u,exceededTransferLimit:h,fields:c}=await this._queryFeatures(o,t),y=h?o.maxRecordCountFactor>=Q.MAX_MAX_RECORD_COUNT_FACTOR?_.FULL:_.DONE:_.FULL;return await this._frameTask.schedule(()=>{e.featuresMissing=u.length{d&&(s+=y.num),o+=g.length,a+=this._removeEmptyFeatures(g),e.featuresMissing=s0&&this.context.capabilities.supportsMaxRecordCountFactor?(e.maxRecordCountFactor=Math.ceil(i/s),e.num=Math.min(e.maxRecordCountFactor*s,i)):e.num=Math.min(s),!0)}_getEffectiveTileResolution(e){if(e.descriptor.resolution==null)return null;const t=this.context.viewingMode===Je.Global?this.context.tilingScheme.resolutionAtLevel(3):1/0;return Math.min(e.descriptor.resolution,t)/this.lodFactor}get _supportsResolution(){return this.context.capabilities.supportsMultipleResolutions&&this.context.geometryType!=="point"}_setResolutionParams(e,t){if(!this._supportsResolution)return;const i=this._getEffectiveTileResolution(t);i!=null&&(this.context.capabilities.supportsQuantization?e.quantizationParameters=new Bi({mode:"view",originPosition:"upper-left",tolerance:i,extent:this.context.fullExtent}):this.context.geometryType==="polyline"&&(e.maxAllowableOffset=i))}_removeEmptyFeatures(e){const t=e.length;for(let i=0;i0&&this.context.capabilities.supportsResultType?t:i!=null&&i>0?i:gs}_useTileQuery(e){return(!te(e)||!this.context.capabilities.supportsCacheHint)&&this.context.capabilities.supportsResultType}_handleRequest(e,t,i,s){e.fetchStatus=e.needsRefetching?_.REFETCHING:_.FETCHING,e.requestController=i;let a=!1;t.then(o=>{e.requestController=null,e.fetchStatus=o}).catch(o=>{e.requestController===i&&(e.requestController=null,e.fetchStatus=_.DONE),M(o)?a=!0:s(o)}).then(()=>{a||this._setDirty(),this._scheduleUpdated()})}_scheduleUpdated(){this._handles&&!this._handles.has("scheduleUpdated")&&this._handles.add(It(()=>{this._handles.remove("scheduleUpdated"),this._updated()}),"scheduleUpdated")}_showTile(e){if(e.displayingFeatures!=null&&!e.needsDisplayUpdate)return!1;const t=e.features;if(e.featureLimit===0||!t){const u=e.displayingFeatures!=null&&e.displayingFeatures.length>0;return this._hideTileFeatures(e),e.displayingFeatures=[],u}const i=e.descriptor.resolution,s=this._changes.updates,a=this._changes.adds,o=Math.min(e.featureLimit,t.length);e.featureLimit=o;for(let u=0;u0&&(this.features.removeMany(e.removes),e.removes.length=0),e.adds.length>0&&(this.features.addMany(e.adds),e.adds.length=0);const t=this._changes.adds,i=this._changes.removes,s=Math.min(t.length,i.length);let a=0;for(;as&&this.features.addMany(a===0?t:t.slice(a)),i.length>s&&this.features.removeMany(a===0?i:i.slice(a)),t.length=0,i.length=0}_clearTile(e){if(this._hideTile(e),e.features&&this.context.memoryCache!=null){const t=16+e.estimatedSize;this.context.memoryCache.put(e.id,e.cache,t)}e.setFeatures(null,0,null),this._invalidateCounts()}_invalidateCounts(){this.notifyChange("totalVertices"),this.notifyChange("totalFeatures"),this.notifyChange("memoryForUnusedFeatures")}_getListOfTiles(){return Array.from(this._featureTiles.values())}get storedFeatures(){return this._getListOfTiles().reduce((e,t)=>e+(t.features?t.features.length:0),0)}get missingTiles(){return Array.from(this._featureTiles.values()).reduce((e,t)=>e+(t.needsFetching||t.isFetching?1:0),0)}_maximumFeaturesForTile(e){const t=e.hasPreciseFeatureCount?e.numFeatures:1/0,i=e.hasPreciseFeatureCount?t:this.maximumNumberOfFeatures,s=this._fullRatio<1?this._farRatio:1;return Math.min(Math.ceil(i*s/(1-e.emptyFeatureRatio)),t)}get test(){return{process:e=>this.runTask(e),getFeatureTileById:e=>this._featureTiles.get(e),forEachFeatureTile:e=>this._featureTiles.forEach(e)}}};function te(r){return r.id==="dummy-tile-full-extent"}function ys(r){let e=0;for(const t of r)t.features&&t.features.length>0&&t.alive&&(e=Math.max(e,t.descriptor.lij[0]));return e}function lr(r){const e=r.capabilities.query;return{supportsMultipleResolutions:_s(r),supportsPagination:!(!e||!e.supportsPagination),supportsResultType:!(!e||!e.supportsResultType),supportsCacheHint:!(!e||!e.supportsCacheHint),supportsQuantization:!(!e||!e.supportsQuantization),supportsQuantizationEditMode:!(!e||!e.supportsQuantizationEditMode),supportsMaxRecordCountFactor:!(!e||!e.supportsMaxRecordCountFactor),supportsFormatPBF:!(!e||!e.supportsFormatPBF)}}function _s(r){switch(r.geometryType){case"polyline":return!0;case"polygon":return r.capabilities&&r.capabilities.query&&r.capabilities.query.supportsQuantization;default:return!1}}function fs(r){return r.setFeatures([],0,null),r.featuresMissing=!1,_.DONE}function dt(r){return r==null?new Set:new Set(r.map(e=>e.name))}function Ge(r,e){if(r==null||e==null)return dt(e);const t=new Set;for(const{name:i}of e)r.has(i)&&t.add(i);return t}n([l({constructOnly:!0})],F.prototype,"features",void 0),n([l()],F.prototype,"tileDescriptors",void 0),n([l({value:1/0})],F.prototype,"maximumNumberOfFeatures",null),n([l({value:1})],F.prototype,"memoryFactor",null),n([l({value:1})],F.prototype,"lodFactor",null),n([l()],F.prototype,"useTileCount",null),n([l({readOnly:!0})],F.prototype,"updating",void 0),n([l({readOnly:!0})],F.prototype,"running",void 0),n([l({readOnly:!0})],F.prototype,"updatingTotal",void 0),n([l({readOnly:!0})],F.prototype,"updatingRemaining",void 0),n([l({readOnly:!0})],F.prototype,"expectedFeatureDiff",void 0),n([l({readOnly:!0})],F.prototype,"memoryForUnusedFeatures",null),n([l({readOnly:!0})],F.prototype,"maximumNumberOfFeaturesExceeded",void 0),n([l({constructOnly:!0})],F.prototype,"maximumNumberOfFeaturesExceededThrottle",void 0),n([l({readOnly:!0})],F.prototype,"totalVertices",null),n([l({readOnly:!0})],F.prototype,"totalFeatures",null),n([l()],F.prototype,"filterExtent",null),n([l({constructOnly:!0})],F.prototype,"context",void 0),F=n([P(ht)],F);const gs=2e3,qe=ue(),He=ue(),Fs=6e5,xs=200,Es=[[0,179,255],[117,62,128],[0,104,255],[215,189,166],[32,0,193],[98,162,206],[102,112,129],[52,125,0],[142,118,246],[138,83,0],[92,122,255],[122,55,83],[0,142,255],[81,40,179],[0,200,244],[13,24,127],[0,170,147],[19,58,241],[22,44,35]];class bs{constructor(e,t,i){this._loadingGraphics=new Map,this._loadedGraphics=new Map,this._pendingGraphics=new Map,this._dataExtentGraphic=null,this._enabled=!0,this._tileFetcher=e,this._view=i,this._tilingScheme=new Vt(t),this._loadedSymbols=Es.map(s=>new k(new j({material:{color:[s[0],s[1],s[2],.6]},outline:{color:"black",size:1}}))),this._loadingSymbols=[new k(new j({material:{color:[200,200,200,.4]},outline:{color:[30,30,30],size:1}}))],this._pendingSymbols=[new k(new j({material:{color:[100,100,100,.4]},outline:{color:[30,30,30],size:1}}))],this._dataExtentSymbol=new k(new j({material:{color:[0,0,0,0]},outline:{color:"green",size:4}}))}destroy(){this.enabled=!1}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}update(){this._enabled?(this._synchronizeMaps(this._loadingGraphics,{filter:e=>e.isFetching,symbols:this._loadingSymbols}),this._synchronizeMaps(this._loadedGraphics,{filter:e=>!e.isFetching,symbols:this._loadedSymbols}),this._synchronizeMaps(this._pendingGraphics,{filter:e=>!e.isFetching,symbols:this._pendingSymbols}),this.showDataExtent(this._tileFetcher.filterExtent)):(this._loadingGraphics.forEach(e=>{this._view.graphics.removeMany(e)}),this._loadingGraphics.clear(),this._loadedGraphics.forEach(e=>{this._view.graphics.removeMany(e)}),this._loadedGraphics.clear(),this._pendingGraphics.forEach(e=>{this._view.graphics.removeMany(e)}),this._pendingGraphics.clear(),this._dataExtentGraphic&&(this._view.graphics.remove(this._dataExtentGraphic),this._dataExtentGraphic=null))}showDataExtent(e){if(this._dataExtentGraphic&&(this._view.graphics.remove(this._dataExtentGraphic),this._dataExtentGraphic=null),e==null)return;const t=Pt.fromExtent(e);this._dataExtentGraphic=new q({geometry:t,symbol:this._dataExtentSymbol}),this._view.graphics.add(this._dataExtentGraphic)}_synchronizeMaps(e,t){const i=[];e.forEach((s,a)=>{const o=this._tileFetcher.test.getFeatureTileById(a);o&&t.filter(o)||(this._view.graphics.removeMany(s),i.push(a))}),i.forEach(s=>e.delete(s)),this._tileFetcher.test.forEachFeatureTile(s=>{if(t.filter(s)&&!e.has(s.id)){const[a,o,u]=s.descriptor.lij;this._tilingScheme.ensureMaxLod(a);const h=this._tilingScheme.getExtentGeometry(a,o,u),c=[new q({geometry:h,symbol:t.symbols[a%t.symbols.length]}),new q({geometry:h.center,symbol:new $t({verticalOffset:{screenLength:40/.75},callout:{type:"line",color:"white",border:{color:"black"}},symbolLayers:[new Mt({text:`${a}/${o}/${u}`,halo:{color:"white",size:1/.75},material:{color:"black"},size:16})]})})];e.set(s.id,c),this._view.graphics.addMany(c)}})}}let f=class extends At(he){set extent(e){if(e!=null&&!e.spatialReference.equals(this.layerView.view.spatialReference))return void U.getLogger(this).error("#extent=","extent needs to be in the same spatial reference as the view");const t=this._get("extent");if(t===e||t!=null&&e&&t.equals(e))return;const i=e!=null?e.clone():null;this._set("extent",i)}get updating(){return!!(this._tileFetcher!=null&&this._tileFetcher.updating||this._fetchDataInfoPromise!=null||this.mode==="tiles"&&this.layerView.view.featureTiles&&this.layerView.view.featureTiles.updating||this._watchUpdatingTracking&&this._watchUpdatingTracking.updating)}get updatingTotal(){return this.updating&&this._tileFetcher!=null?this._tileFetcher.updatingTotal:0}get updatingRemaining(){return this.updating&&this._tileFetcher!=null?this._tileFetcher.updatingRemaining:0}get expectedFeatureDiff(){return this.updating&&this._tileFetcher!=null?this._tileFetcher.expectedFeatureDiff:0}get memoryForUnusedFeatures(){return this._tileFetcher!=null?this._tileFetcher.memoryForUnusedFeatures:0}get maximumNumberOfFeaturesExceeded(){return!(this._tileFetcher==null||!this._tileFetcher.maximumNumberOfFeaturesExceeded)}get maximumNumberOfFeatures(){return this.displayFeatureLimit!=null?this.displayFeatureLimit.maximumNumberOfFeatures:0}set maximumNumberOfFeatures(e){e!==this.maximumNumberOfFeatures&&this._overrideIfSome("maximumNumberOfFeatures",e)}get hasMaximumNumberOfFeaturesOverride(){return this._isOverridden("maximumNumberOfFeatures")}get mode(){var a,o;const e=this.layerView.layer;if(e.type==="feature"&&e.infoFor3D!=null)return"snapshot";if(((o=(a=this.layerView.view.qualitySettings)==null?void 0:a.graphics3D)==null?void 0:o.snapshotAvailable)===!1||this.serviceDataCount===w.NO_SERVICE_DATA_COUNT||this.vertexLimitExceeded)return"tiles";const t=this.layerView.view,i=t&&t.featureTiles,s=i&&i.tilingScheme;if(e&&e.minScale&&this.serviceDataExtent&&s){const u=this._approximateExtentSizeAtScale(e.minScale,s);if((this.serviceDataExtent.width/u+this.serviceDataExtent.height/u)/2>w.MAX_SNAPSHOT_MIN_SCALE_FACTOR)return"tiles"}return!this.maximumNumberOfFeatures||this.serviceDataCount<=this.maximumNumberOfFeatures?"snapshot":"tiles"}get maxTotalSnapshotVertices(){const e=this._get("maxTotalSnapshotVertices")||0,t=this.mode==="snapshot"&&this._tileFetcher!=null&&this._tileFetcher.totalVertices||0;return Math.max(e,t)}_approximateExtentSizeAtScale(e,t){const i=this.layerView.view,s=Math.ceil((i.width/t.pixelSize+i.height/t.pixelSize)/2),a=t.levels[0];return s*((a.tileSize[0]/(a.scale/e)+a.tileSize[1]/(a.scale/e))/2)}get tileDescriptors(){return this.mode==="snapshot"?new xe([{id:"dummy-tile-full-extent",lij:[0,0,0]}]):this.layerView.view.featureTiles?this.layerView.view.featureTiles.tiles:new xe}get test(){return{fetchDataInfoPromise:this._fetchDataInfoPromise,tileFetcher:this._tileFetcher}}constructor(e){super(e),this.type="feature-tile-3d",this._watchUpdatingTracking=new Nt,this.serviceDataExtent=null,this.serviceDataCount=w.NO_SERVICE_DATA_COUNT,this.vertexLimitExceeded=!1,this.displayFeatureLimit=null,this._suspended=!1,this._tileFetcher=null,this._handles=new Be,this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null,this._lifeCycleAbortController=new AbortController}initialize(){this._watchUpdatingTracking.add(()=>this.vertexLimitInfo,()=>this._watchUpdatingTracking.addPromise(this._updateVertexLimitExceeded(null,this._lifeCycleAbortController.signal))),this._watchUpdatingTracking.add(()=>this.mode,()=>this._modeChanged(),D),this.addResolvingPromise(Promise.resolve().then(()=>this._verifyCapabilities()).then(()=>this._watchUpdatingTracking.addPromise(this._fetchServiceDataInfo())).then(()=>this._initializeTileFetcher()))}_verifyCapabilities(){var t;const e=this.layerView.layer;if(e.type!=="ogc-feature"&&!((t=Lt(e))!=null&&t.operations.supportsQuery))throw new V("graphicscontroller:query-capability-required","Service requires query capabilities to be used as a feature layer",{layer:e})}destroy(){this._cancelFetchServiceDataInfo(),this._tileFetcher=O(this._tileFetcher),this._handles=O(this._handles),this._tilesHandle=Xe(this._tilesHandle),this._lifeCycleAbortController=ae(this._lifeCycleAbortController),this._watchUpdatingTracking.destroy(),this._set("_watchUpdatingTracking",null)}suspend(){this._suspended||(this._suspended=!0,this._tileFetcher!=null&&this._tileFetcher.suspend())}resume(){this._suspended&&(this._suspended=!1,this._tileFetcher!=null&&this._tileFetcher.resume())}restart(){const e=()=>{this._tileFetcher!=null&&this._tileFetcher.restart()};this._watchUpdatingTracking.addPromise(this._fetchServiceDataInfo().then(e,e))}refetch(){const e=()=>{this._tileFetcher!=null&&this._tileFetcher.refetch()};this._watchUpdatingTracking.addPromise(this._fetchServiceDataInfo().then(e,e))}_initializeTileFetcher(){const e=this.layerView.view;if(!e)return;const t=Ze(()=>{var i;return(i=e.featureTiles)==null?void 0:i.tilingScheme},this._lifeCycleAbortController.signal);this._watchUpdatingTracking.addPromise(t),t.then(()=>{const{layerView:i,tileDescriptors:s}=this,a=i.layer,o=new F({context:this.context,filterExtent:this.extent,tileDescriptors:s,features:this.graphics});this._tileFetcher=o,this._suspended?this._tileFetcher.suspend():this._tileFetcher.resume();const u=this.layerView.view.resourceController;u&&this._handles.add(R(()=>{var d;return(d=u.memoryController)==null?void 0:d.memoryFactor},d=>o.memoryFactor=d,B));const h=this.context.geometryType==="polygon"?"polygonLodFactor":this.context.geometryType==="polyline"?"polylineLodFactor":null;h&&this._handles.add(R(()=>{var d,g,b;return(b=(g=(d=this.layerView.view)==null?void 0:d.qualitySettings)==null?void 0:g.graphics3D)==null?void 0:b[h]},d=>o.lodFactor=d||1,D));const c=d=>{o.maximumNumberOfFeatures=d,o.useTileCount=this.serviceDataCount>d},y=d=>o.useTileCount=d>this.maximumNumberOfFeatures;a.type!=="ogc-feature"&&this._watchUpdatingTracking.add(()=>a.createQueryVersion,()=>this._dataFilterChanged()),this._watchUpdatingTracking.add(()=>i.availableFields,(d,g)=>this._availableFieldsChanged(g,d)),this._watchUpdatingTracking.add(()=>i.requiredFields,(d,g)=>this._requiredFieldsChanged(g,d)),this._handles.add([a.on("apply-edits",d=>this._applyEdits(d)),R(()=>this.extent,d=>o.filterExtent=d,ne),R(()=>this.tileDescriptors,d=>o.tileDescriptors=d,ne),R(()=>this.maximumNumberOfFeatures,c,B),R(()=>this.serviceDataCount,y,B),R(()=>Ut.FEATURE_TILE_FETCH_SHOW_TILES,d=>{d&&o&&!o.debugger?(o.debugger=new bs(o,e.featureTiles.tilingScheme.toTileInfo(),e),o.debugger.update()):!d&&this._tileFetcher&&o.debugger&&(o.debugger.destroy(),o.debugger=null)},B)]),this._supportsExceedsLimitQuery||this._watchUpdatingTracking.add(()=>this.maxTotalSnapshotVertices,()=>this._watchUpdatingTracking.addPromise(this._updateVertexLimitExceeded(null,this._lifeCycleAbortController.signal)))}).catch(()=>{})}_modeChanged(){switch(this.mode){case"tiles":this._tilesHandle||(this._tilesHandle=this.layerView.view.featureTiles.addClient());break;default:U.getLogger(this).warn("Unhandled feature layer mode "+this.mode);case"snapshot":this._tilesHandle!=null&&(this._tilesHandle.remove(),this._tilesHandle=null)}}_dataFilterChanged(){this._set("maxTotalSnapshotVertices",0),this.notifyChange("maxTotalSnapshotVertices"),this.refetch()}_applyEdits(e){this._tileFetcher!=null&&this._tileFetcher.applyEdits(e).then(t=>{if(t){if(!this._lifeCycleAbortController)throw Gt();t.exceededTransferLimit?this.layerView.layer.refresh():(t.deletedFeatures.length||t.updatedFeatures.length||t.addedFeatures.length)&&this._watchUpdatingTracking.addPromise(this._updateServiceDataExtent(this._lifeCycleAbortController.signal))}}).catch(t=>{if(!M(t))throw t})}_availableFieldsChanged(e,t){this._tileFetcher!=null&&ze(this._tileFetcher.availableFields,t)&&this.refetch()}_requiredFieldsChanged(e,t){this._tileFetcher!=null&&ze(this._tileFetcher.availableFields,t)&&this.restart()}_createVertexLimitExceededQuery(e){var s;const t=this.layerView.layer,i=t.createQuery();return i.returnGeometry=!1,i.outStatistics=[new Wi({statisticType:"exceedslimit",maxVertexCount:e,outStatisticFieldName:"exceedslimit",maxPointCount:1e8,maxRecordCount:1e8})],(s=t.capabilities)!=null&&s.query.supportsCacheHint&&(i.cacheHint=!0),i}_createDataInfoQuery(){var i;const e=this.layerView.layer,t=e.createQuery();return t.returnGeometry=!1,t.outSpatialReference=this.layerView.view.spatialReference,(i=e.capabilities)!=null&&i.query.supportsCacheHint&&(t.cacheHint=!0),t}_fullExtentIsAccurate(){const e=this.layerView.layer;if(e.definitionExpression)return!1;switch(e.type){case"feature":case"oriented-imagery":return qt(e.url);case"csv":case"geojson":case"ogc-feature":case"wfs":return!0;default:return}}async _updateServiceDataExtent(e){try{await this._tryUpdateServiceDataExtent(e)}catch(t){M(t)||this._set("serviceDataExtent",Ee(this.layerView.fullExtentInLocalViewSpatialReference))}}async _tryUpdateServiceDataExtent(e){var c;const t=this.layerView,i=t.layer,s=((c=i.capabilities)==null?void 0:c.query.supportsExtent)??!1,a=Ee(t.fullExtentInLocalViewSpatialReference),o=i.fullExtent,u=this._fullExtentIsAccurate(),h=this.serviceDataCount;if(s&&h<=w.MAX_FEATURE_COUNT_FOR_EXTENT&&(!a||!u)&&"queryExtent"in i){const y=this._createDataInfoQuery(),d=await i.queryExtent(y,{timeout:w.QUERY_EXTENT_TIMEOUT,signal:e});this._set("serviceDataExtent",d.extent)}else if(a)this._set("serviceDataExtent",a);else if(o!=null){const y="portalItem"in i?i.portalItem:null,d=await Ht(o,t.view.spatialReference,y,e);this._set("serviceDataExtent",d)}else this._set("serviceDataExtent",null)}async _updateServiceDataCount(e){const t=this.layerView.layer;if(!("queryFeatureCount"in t)||!be("featurelayer-snapshot-enabled"))return void this._set("serviceDataCount",w.NO_SERVICE_DATA_COUNT);const i=await ve(t.queryFeatureCount(this._createDataInfoQuery(),{timeout:w.QUERY_STATISTICS_TIMEOUT,signal:e}));if(i.ok===!0)this._set("serviceDataCount",i.value);else{if(M(i.error))throw i.error;this._set("serviceDataCount",w.NO_SERVICE_DATA_COUNT)}}get vertexLimitInfo(){if(this.displayFeatureLimit==null||this.displayFeatureLimit.averageSymbolComplexity==null)return null;const{averageSymbolComplexity:e,maximumTotalNumberOfPrimitives:t}=this.displayFeatureLimit,{primitivesPerCoordinate:i,primitivesPerFeature:s}=e,a=this._get("vertexLimitInfo");return a==null||a.maximumTotalNumberOfPrimitives!==t||a.primitivesPerCoordinate!==i||a.primitivesPerFeature!==s?{primitivesPerCoordinate:i,primitivesPerFeature:s,maximumTotalNumberOfPrimitives:t}:a}get _supportsExceedsLimitQuery(){const e=this.layerView.layer;return e.capabilities!=null&&e.capabilities.operations&&e.capabilities.operations.supportsExceedsLimitStatistics}get _minimumNumberOfVerticesForGeometry(){switch(this.layerView.layer.geometryType){case"point":case"multipoint":return 1;case"polygon":return 4;case"polyline":return 2;case"multipatch":case"mesh":return 3;default:return 0}}async _updateVertexLimitExceeded(e,t){const i=this.vertexLimitInfo;if(i==null)return void this._set("vertexLimitExceeded",!1);const s=i.primitivesPerFeature<=0,a=this._minimumNumberOfVerticesForGeometry>1;if(!s&&!a)return void this._set("vertexLimitExceeded",!1);const{primitivesPerFeature:o,primitivesPerCoordinate:u,maximumTotalNumberOfPrimitives:h}=i;let c;o!==0&&e!=null&&await e;const y=this.serviceDataCount,d=y!==w.NO_SERVICE_DATA_COUNT;if(c=Math.ceil(d?(h-y*o)/(u||1):h/(u||1)),a&&(c=Math.min(c,ws)),d&&this._minimumNumberOfVerticesForGeometry*y>c)return void this._set("vertexLimitExceeded",!0);if(!this._supportsExceedsLimitQuery||!be("featurelayer-snapshot-enabled"))return void this._set("vertexLimitExceeded",this.maxTotalSnapshotVertices>c);const g=await ve(this.layerView.layer.queryFeatures(this._createVertexLimitExceededQuery(c),{timeout:w.QUERY_STATISTICS_TIMEOUT,signal:t}));if(g.ok===!1){if(M(g.error))throw g.error;return void this._set("vertexLimitExceeded",!1)}const b=g.value.features[0];b&&b.attributes?this._set("vertexLimitExceeded",!!b.attributes.exceedslimit):this._set("vertexLimitExceeded",!1)}async _fetchServiceDataInfo(){this._cancelFetchServiceDataInfo();let e=new AbortController;const t=e.signal,i=this._updateServiceDataCount(t),s=We([i,this._updateVertexLimitExceeded(i,t)]),a=s.then(()=>this._updateServiceDataExtent(t)).catch(o=>{M(o)||U.getLogger(this).error("#fetchServiceDataInfo()",o)}).then(()=>{a===this._fetchDataInfoPromise&&(this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null),e=null});return e&&(this._fetchDataInfoPromise=a),this._fetchDataInfoAbortController=e,s.then(()=>{},()=>{})}_cancelFetchServiceDataInfo(){const e=this._fetchDataInfoAbortController;e&&(this._fetchDataInfoAbortController=null,this._fetchDataInfoPromise=null,e.abort())}get debug(){return{storedFeatures:this._tileFetcher!=null?this._tileFetcher.storedFeatures:0,totalFeatures:this._tileFetcher!=null?this._tileFetcher.totalFeatures:0,totalVertices:this._tileFetcher!=null?this._tileFetcher.totalVertices:0,missingTiles:this._tileFetcher!=null?this._tileFetcher.missingTiles:0}}};n([l({readOnly:!0})],f.prototype,"type",void 0),n([l({constructOnly:!0})],f.prototype,"graphics",void 0),n([l({constructOnly:!0})],f.prototype,"layerView",void 0),n([l({constructOnly:!0})],f.prototype,"context",void 0),n([l()],f.prototype,"extent",null),n([l()],f.prototype,"updating",null),n([l({readOnly:!0})],f.prototype,"_watchUpdatingTracking",void 0),n([l()],f.prototype,"updatingTotal",null),n([l()],f.prototype,"updatingRemaining",null),n([l()],f.prototype,"expectedFeatureDiff",null),n([l()],f.prototype,"memoryForUnusedFeatures",null),n([l()],f.prototype,"maximumNumberOfFeaturesExceeded",null),n([l({readOnly:!0})],f.prototype,"serviceDataExtent",void 0),n([l({readOnly:!0})],f.prototype,"serviceDataCount",void 0),n([l({readOnly:!0})],f.prototype,"vertexLimitExceeded",void 0),n([l()],f.prototype,"displayFeatureLimit",void 0),n([l({type:Number})],f.prototype,"maximumNumberOfFeatures",null),n([l({readOnly:!0})],f.prototype,"mode",null),n([l({readOnly:!0})],f.prototype,"maxTotalSnapshotVertices",null),n([l({readOnly:!0,dependsOn:["mode"]})],f.prototype,"tileDescriptors",null),n([l()],f.prototype,"_tileFetcher",void 0),n([l()],f.prototype,"_fetchDataInfoPromise",void 0),n([l({readOnly:!0})],f.prototype,"vertexLimitInfo",null),f=n([P("esri.layers.graphics.controllers.FeatureTileController3D")],f);const vs=1e4,Ts=12e3,Rs=1e4,ws=5e6;function ze(r,e){if(!e)return!1;for(const t of e)if(!r.has(t))return!0;return!1}var w;(function(r){function e(){r.MAX_FEATURE_COUNT_FOR_EXTENT=vs,r.QUERY_STATISTICS_TIMEOUT=Ts,r.QUERY_EXTENT_TIMEOUT=Rs}r.NO_SERVICE_DATA_COUNT=1/0,r.MAX_SNAPSHOT_MIN_SCALE_FACTOR=5,r.reset=e})(w||(w={})),w.reset();function Qe(r,e,t){if(!t||e==null)return null;if(!r)return Cs(e,t);const i=r.get(t);return i?e[i.name]:null}function Cs(r,e){const t=e.toLowerCase();for(const i in r)if(i.toLowerCase()===t)return r[i];return null}const Ss=as;let S=class extends he{get layer(){return this.context.layer}get spatialReference(){return this.context.spatialReference}get _queryGeometryType(){switch(this.layer.geometryType){case"multipoint":case"point":case"polygon":case"polyline":return this.layer.geometryType;case"mesh":return"polygon";default:return}}get defaultQueryJSON(){return new Q({outSpatialReference:this.spatialReference}).toJSON()}get _dataQueryEngine(){return this._ensureDataQueryEngine()}constructor(r){super(r),this._dataQueryEngineInstance=null}destroy(){this.clear()}clear(){return!!this._dataQueryEngineInstance&&(this._dataQueryEngineInstance.destroy(),this._dataQueryEngineInstance=null,!0)}async executeQueryForIdSet(r,e,t){return this._dataQueryEngine.executeQueryForIdSet(this._ensureQueryJSON(r,e),t)}async executeQueryForCount(r,e){return this._dataQueryEngine.executeQueryForCount(this._ensureQueryJSON(r),e)}async executeQueryForExtent(r,e){const{count:t,extent:i}=await this._dataQueryEngine.executeQueryForExtent(this._ensureQueryJSON(r),e);return{count:t,extent:zt.fromJSON(i)}}async executeQueryForIds(r,e){return this._dataQueryEngine.executeQueryForIds(this._ensureQueryJSON(r),e)}async executeQueryForLatestObservations(r,e){const t=await this._dataQueryEngine.executeQueryForLatestObservations(this._ensureQueryJSON(r),e),i=Ne.fromJSON(t);return i.features.forEach(s=>{s.layer=this.layer,s.sourceLayer=this.layer}),i}async executeQuery(r,e){const t=await this._dataQueryEngine.executeQuery(this._ensureQueryJSON(r),e),i=Ne.fromJSON(t);return i.features.forEach(s=>{s.layer=this.layer,s.sourceLayer=this.layer}),i}_ensureQueryJSON(r,e){let t=this.defaultQueryJSON;if(r!=null&&("outSpatialReference"in r&&!r.outSpatialReference&&(r.outSpatialReference=this.spatialReference),t=r.toJSON()),e!=null){const i=e.geometries.map(s=>s.toJSON()).reduce((s,a)=>(s.rings=s.rings.concat(a.rings),s));t={...t,sceneFilter:{...e,geometry:i}}}return t}_ensureDataQueryEngine(){var y;if(this._dataQueryEngineInstance)return this._dataQueryEngineInstance;const r="timeInfo"in this.layer&&this.layer.timeInfo&&this.layer.timeInfo.toJSON()||null,e=this.layer.objectIdField,t=Qt.toJSON(this._queryGeometryType),i=((y=this.layer.fields)==null?void 0:y.map(d=>d.toJSON()))??[],s=this.priority,a=this.spatialReference.toJSON(),{hasZ:o,hasM:u,featureStore:h,scheduler:c}=this.context;return this._dataQueryEngineInstance=new Ss({hasZ:o,hasM:u,geometryType:t,fields:i,timeInfo:r,spatialReference:a,objectIdField:e,featureStore:h,scheduler:c,priority:s}),this._dataQueryEngineInstance}};n([l({constructOnly:!0})],S.prototype,"context",void 0),n([l({constructOnly:!0})],S.prototype,"priority",void 0),n([l()],S.prototype,"layer",null),n([l()],S.prototype,"spatialReference",null),n([l()],S.prototype,"_queryGeometryType",null),n([l()],S.prototype,"defaultQueryJSON",null),S=n([P("esri.views.3d.layers.graphics.QueryEngine")],S);let v=class extends ce{constructor(r){super(r),this._updateTask=null,this._frameTask=null,this._queryEngine=null,this._updateRequested=!0,this._updateVisibility=async e=>{if(this._compositedFeatureFilter==null&&this._sceneFilter==null||this.context.getFeatureCount()===0)return this._frameTask.schedule(()=>this.clear(),e);try{const t=await this._queryEngine.executeQueryForIdSet(this._compositedFeatureFilter,this._sceneFilter,e);return this._frameTask.schedule(()=>{this.context.updateFeatureVisibilities(i=>t.has(i))},e)}catch(t){return kt(t),U.getLogger(this).warn(`FeatureFilter query failed: ${t}`,{error:t}),this._frameTask.schedule(()=>{this.context.setAllFeaturesVisibility(!0)},e)}}}initialize(){const r=de.FILTER_VISIBILITY,{layer:e,view:t}=this._layerView,{featureStore:i}=this.context,s="hasZ"in this._layerView&&this._layerView.hasZ,a="hasM"in this._layerView&&this._layerView.hasM;this._queryEngine=new S({context:{spatialReference:t.spatialReference,layer:e,scheduler:t.resourceController.scheduler,featureStore:i,hasM:a,hasZ:s},priority:r}),this._frameTask=this._layerView.view.resourceController.scheduler.registerTask(r,this),this.updatingHandles.add(()=>[this._compositedFeatureFilter,this._sceneFilter],()=>this.reapply(),D)}destroy(){this._updateRequested=!1,this.handles.removeAll(),this.updatingHandles.removeAll(),this.clear(),this._updateTask=ae(this._updateTask),this._frameTask=Xe(this._frameTask),this._queryEngine=O(this._queryEngine),this._set("context",null)}get updating(){return this.running||this.updatingHandles.updating||this._updateTask!=null&&!this._updateTask.finished}get running(){return this._updateRequested||this._frameTask.updating}get defaultVisibility(){return this._compositedFeatureFilter==null&&this._sceneFilter==null}get _featureFilter(){return"filter"in this._layerView?this._layerView.filter:null}get _sceneFilter(){return"layerFilter"in this._layerView?this._layerView.layerFilter:null}get _floorFilter(){return rs(this._layerView)}get _timeExtent(){return"timeExtent"in this._layerView?this._layerView.timeExtent:null}get _compositedFeatureFilter(){const{_featureFilter:r,_timeExtent:e,_floorFilter:t}=this;if(e==null&&t==null)return r;const i=r!=null?r.clone():new ss;if(e!=null&&(i.timeExtent=i.timeExtent!=null?i.timeExtent.intersection(e):e),t!=null){const s=i.where==null||i.where==="";i.where=s?t:`(${i.where}) AND (${t})`}return i}get _layerView(){return this.context.layerView}reapply(){this._updateRequested=!0}clear(){this._queryEngine.clear(),this.context.clearFeaturesVisibility()}runTask(r){this._updateRequested&&(this._updateTask=ae(this._updateTask),this._updateTask=jt(this._updateVisibility),this._updateRequested=!1,r.madeProgress()),this._frameTask.processQueue(r)}};n([l({constructOnly:!0})],v.prototype,"context",void 0),n([l()],v.prototype,"updating",null),n([l()],v.prototype,"running",null),n([l()],v.prototype,"defaultVisibility",null),n([l()],v.prototype,"_featureFilter",null),n([l()],v.prototype,"_sceneFilter",null),n([l()],v.prototype,"_floorFilter",null),n([l()],v.prototype,"_timeExtent",null),n([l()],v.prototype,"_compositedFeatureFilter",null),n([l()],v.prototype,"_layerView",null),n([l()],v.prototype,"_updateTask",void 0),n([l()],v.prototype,"_updateRequested",void 0),v=n([P("esri.views.3d.layers.support.FeatureVisibilityFilter")],v);let m=class extends ce{constructor(e){super(e),this.type="graphics-3d",this._randomRotationRenderers=null,this.elevationFeatureExpressionEnabled=!1,this.scaleVisibilityEnabled=!1,this.filterVisibilityEnabled=!1,this.frustumVisibilityEnabled=!1,this.elevationAlignmentEnabled=!1,this.timeExtentEnabled=!1,this.setUidToIdOnAdd=!0,this.dataExtent=null,this.drapeSourceType=Ye.Features,this.preferredUpdatePolicy=pe.ASYNC,this._suspendResumeExtent=null}initialize(){const e=this.owner,t=(this.filterVisibilityEnabled||this.timeExtentEnabled)&&e.layer.geometryType!=="multipatch",i=new Yi({owner:this,layer:this.layer,preferredUpdatePolicy:this.preferredUpdatePolicy,elevationFeatureExpressionEnabled:this.elevationFeatureExpressionEnabled,graphicSymbolSupported:!1,hasZ:e.hasZ,hasM:e.hasM,setUidToIdOnAdd:this.setUidToIdOnAdd,componentFactories:{deconflictor:s=>e.view.deconflictor.addGraphicsOwner(s),labeler:(s,a)=>e.view.labeler.addGraphicsOwner(s,a),elevationAlignment:this.elevationAlignmentEnabled?(s,a)=>new Ki({graphicsCoreOwner:this,graphicsCore:s,queryGraphicUIDsInExtent:a,elevationProvider:e.view.elevationProvider}):null,scaleVisibility:this.scaleVisibilityEnabled?(s,a)=>new es({graphicsCoreOwner:this,layer:this.layer,queryGraphicUIDsInExtent:a,graphicsCore:s,basemapTerrain:e.view.basemapTerrain}):null,filterVisibility:t?s=>new v({context:{layerView:e,...s}}):null,objectStates:s=>new ts(s)}});this._set("graphicsCore",i),this.frustumVisibilityEnabled&&this._set("frustumVisibility",new is({graphicsCoreOwner:this})),this.elevationAlignment&&this.updatingHandles.add(()=>this.layer.elevationInfo,(s,a)=>{Ae(s,a)&&this.updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())}),this.updatingHandles.add(()=>this.layer.labelsVisible,()=>this.graphicsCore.updateVisibilityInfo()),this.updatingHandles.add(()=>this.layer.labelingInfo,(s,a)=>{Ae(s,a)&&this.graphicsCore.updateLabelingInfo()}),this.updatingHandles.add(()=>this.preferredUpdatePolicy,s=>this.graphicsCore.preferredUpdatePolicy=s),this._set("initializePromise",this._initializeAsync()),this.updatingHandles.addPromise(this.initializePromise)}async _initializeAsync(){await Te(this.graphicsCore.initializePromise);const e=this.owner;this.updatingHandles.add(()=>this.renderer,t=>this.updatingHandles.addPromise(this.graphicsCore.rendererChange(t))),this.updatingHandles.add(()=>e.fullOpacity,()=>this.graphicsCore.opacityChange()),this._setupSuspendResumeExtent(),this.updateClippingExtent&&(this.updatingHandles.add(()=>e.view.clippingArea,()=>this._updateClippingExtent()),this._updateClippingExtent()),this.graphicsCore.startCreateGraphics(),this.graphicsCore.labelsEnabled&&await Te(this.graphicsCore.updateLabelingInfo())}destroy(){this.handles.removeAll(),this.updatingHandles.removeAll(),this._set("frustumVisibility",O(this.frustumVisibility)),this._set("graphicsCore",O(this.graphicsCore)),this._set("owner",null)}get layer(){return this.owner.layer}get renderer(){const{renderer:e,objectIdField:t}=this.layer;if(!e||!t||e.type==="heatmap"||!e.visualVariables)return e;const i=e.visualVariables.findIndex(a=>a.type==="rotation"&&a.valueExpression!=null&&Bt(a.valueExpression)===t&&(a.axis==null||a.axis==="heading")&&a.rotationType==="geographic");if(i<0)return e;const s=e.clone();return s.visualVariables.splice(i,1),this._randomRotationRenderers||(this._randomRotationRenderers=new WeakMap),this._randomRotationRenderers.set(s,t),s}get scaleVisibility(){var e;return(e=this.graphicsCore)==null?void 0:e.scaleVisibility}get filterVisibility(){var e;return(e=this.graphicsCore)==null?void 0:e.filterVisibility}get elevationAlignment(){var e;return(e=this.graphicsCore)==null?void 0:e.elevationAlignment}get objectStates(){var e;return(e=this.graphicsCore)==null?void 0:e.objectStates}get suspendResumeExtentMode(){return"suspendResumeExtentMode"in this.owner?this.owner.suspendResumeExtentMode:"computed"}get scaleVisibilitySuspended(){return this.scaleVisibility!=null&&this.scaleVisibility.suspended}get suspended(){return this.owner.suspended}get legendEnabled(){return this.frustumVisibility==null||!this.frustumVisibility.suspended}get suspendInfo(){const e={};return this.scaleVisibilitySuspended&&(e.outsideScaleRange=!0),this.frustumVisibility!=null&&this.frustumVisibility.suspended&&(e.outsideOfView=!0),e}get updating(){var e,t;return!!((e=this.graphicsCore)!=null&&e.updating||this.frustumVisibility!=null&&this.frustumVisibility.updating||(t=this.updatingHandles)!=null&&t.updating)}get updatingRemaining(){var e;return((e=this.graphicsCore)==null?void 0:e.updatingRemaining)??0}get featureStore(){var e;return(e=this.graphicsCore)==null?void 0:e.featureStore}get view(){return this.owner.view}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){var e;return(e=this.owner)==null?void 0:e.fullOpacity}get filter(){return"filter"in this.owner?this.owner.filter:null}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get updatePolicy(){return this.owner.updatePolicy}get featureSpatialReference(){return"featureSpatialReference"in this.owner?this.owner.featureSpatialReference:this.owner.view.spatialReference}get graphics3DGraphics(){var e;return(e=this.graphicsCore)==null?void 0:e.graphics3DGraphics}get graphics3DGraphicsByObjectID(){var e;return(e=this.graphicsCore)==null?void 0:e.graphics3DGraphicsByObjectID}get symbolUpdateType(){var e;return(e=this.graphicsCore)==null?void 0:e.symbolUpdateType}get displayFeatureLimit(){var o,u,h;const e=(u=(o=this.view.resourceController)==null?void 0:o.memoryController)==null?void 0:u.memoryFactor,t=(h=this.graphicsCore)==null?void 0:h.displayFeatureLimit;if(e==null||e===1)return t;const i=Math.ceil(t.maximumNumberOfFeatures*e),s=Math.ceil(t.maximumTotalNumberOfFeatures*e),a=Math.ceil(t.minimumTotalNumberOfFeatures*e);return{...t,maximumNumberOfFeatures:i,maximumTotalNumberOfFeatures:s,minimumTotalNumberOfFeatures:a}}get usedMemory(){var e;return((e=this.graphicsCore)==null?void 0:e.usedMemory)??0}get loadedFeatures(){var e;return((e=this.graphicsCore)==null?void 0:e.numberOfGraphics)??0}get usedMemoryPerFeature(){var e;return((e=this.graphicsCore)==null?void 0:e.usedMemoryPerGraphic)??0}get unprocessedMemoryEstimate(){var e;return((e=this.graphicsCore)==null?void 0:e.unprocessedMemoryEstimate)??0}get performanceInfo(){return{core:this.graphicsCore.performanceInfo,elevationUpdating:this.elevationAlignment.updating,visibilityFrustum:this.frustumVisibility==null||!this.frustumVisibility.suspended,visibilityScale:!this.scaleVisibilitySuspended}}maskOccludee(e){const{set:t,handle:i}=this.objectStates.acquireSet(W.MaskOccludee,null);return this.objectStates.setUid(t,e.uid),i}highlight(e,t){if(e instanceof Q){const{set:i,handle:s}=this.objectStates.acquireSet(W.Highlight,t);return this.owner.queryObjectIds(e).then(a=>this.objectStates.setObjectIds(i,a)),s}if(typeof e=="number"||typeof e=="string")return this.highlight([e],t);if(e instanceof q)return this.highlight([e],t);if("toArray"in e&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof q){const i=e;if(Qe(this.layer.fieldsIndex,i[0].attributes,t)==null){const s=i.map(u=>u.uid),{set:a,handle:o}=this.objectStates.acquireSet(W.Highlight,null);return this.objectStates.setUids(a,s),o}e=i.map(s=>Qe(this.layer.fieldsIndex,s.attributes,t))}if(Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string")){const i=e,{set:s,handle:a}=this.objectStates.acquireSet(W.Highlight,t);return this.objectStates.setObjectIds(s,i),a}}return Ds}resetObjectStates(){this.objectStates.reset()}whenGraphicBounds(e,t){var i;return(i=this.graphicsCore)==null?void 0:i.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){var i;return(i=this.graphicsCore)==null?void 0:i.computeAttachmentOrigin(e,t)}notifyGraphicGeometryChanged(e){this.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.graphicsCore.notifyGraphicVisibilityChanged(e)}getRenderingInfo(e,t,i){var a;const s=Wt(e,{renderer:t,arcade:i});if(s!=null&&s.color){const o=s.color;o[0]=o[0]/255,o[1]=o[1]/255,o[2]=o[2]/255}if(s!=null&&t!=null&&((a=this._randomRotationRenderers)!=null&&a.has(t))){const o=this._randomRotationRenderers.get(t),u=e.attributes[o],h=new Zi(0);h.updateFloatArray([u]),h.updateUint8Array([173]),s.heading=8381e-11*h.digest()}return s}getRenderingInfoAsync(e,t,i,s){return Jt(e,{renderer:t,arcade:i,...s})}getSymbolLayerSize(e,t){var i;return(i=this.graphicsCore)==null?void 0:i.getSymbolLayerSize(e,t)}setObjectIdVisibility(e,t){var i;(i=this.graphicsCore)==null||i.setObjectIdVisibility(e,t)}refreshFilter(){this.filterVisibility!=null&&this.filterVisibility.reapply()}getGraphics3DGraphicByObjectId(e){var t;return(t=this.graphicsCore)==null?void 0:t.getGraphics3DGraphicByObjectId(e)}_updateClippingExtent(){const e=this.owner.view.clippingArea;this.graphicsCore.setClippingExtent(e,this.owner.view.spatialReference)&&(this.updateClippingExtent(e)||this.graphicsCore.recreateAllGraphics())}_setupSuspendResumeExtent(){(this.frustumVisibility||this.scaleVisibility)&&this.handles.add(R(()=>this.suspendResumeExtentMode,()=>{switch(this.handles.remove(ie),this.suspendResumeExtentMode){case"computed":this.handles.add([R(()=>this.graphicsCore.computedExtent,e=>this._updateSuspendResumeExtent(e),D),R(()=>this.graphicsCore.extentPadding,()=>this._updateSuspendResumeExtent(this.graphicsCore.computedExtent))],ie);break;case"data":this.handles.add([Zt(()=>this.dataExtent,e=>this._updateSuspendResumeExtent(e),D),R(()=>this.graphicsCore.extentPadding,()=>this._updateSuspendResumeExtent(this.dataExtent))],ie);break;default:Xt(this.suspendResumeExtentMode)}},D))}_updateSuspendResumeExtent(e){e?this._suspendResumeExtentChanged(this._extentToSuspendResumeRect(e,this._suspendResumeExtent)):this._suspendResumeExtentChanged(null)}_extentToSuspendResumeRect(e,t){const i=this.owner.view.spatialReference;if(!e.spatialReference.equals(i)){if(!Yt(e,i))return;e=Kt(e,i)}return ei(e,t,ti,this.graphicsCore.extentPadding)}_suspendResumeExtentChanged(e){this.frustumVisibility!=null&&this.frustumVisibility.setExtent(e),this.scaleVisibility!=null&&this.scaleVisibility.setExtent(e)}};n([l()],m.prototype,"type",void 0),n([l({constructOnly:!0})],m.prototype,"owner",void 0),n([l()],m.prototype,"layer",null),n([l()],m.prototype,"renderer",null),n([l({constructOnly:!0})],m.prototype,"updateClippingExtent",void 0),n([l({constructOnly:!0})],m.prototype,"elevationFeatureExpressionEnabled",void 0),n([l({constructOnly:!0})],m.prototype,"graphicsCore",void 0),n([l({constructOnly:!0})],m.prototype,"scaleVisibilityEnabled",void 0),n([l({constructOnly:!0})],m.prototype,"filterVisibilityEnabled",void 0),n([l({constructOnly:!0})],m.prototype,"frustumVisibilityEnabled",void 0),n([l({constructOnly:!0})],m.prototype,"elevationAlignmentEnabled",void 0),n([l({constructOnly:!0})],m.prototype,"timeExtentEnabled",void 0),n([l({constructOnly:!0})],m.prototype,"setUidToIdOnAdd",void 0),n([l()],m.prototype,"scaleVisibility",null),n([l()],m.prototype,"filterVisibility",null),n([l()],m.prototype,"elevationAlignment",null),n([l({constructOnly:!0})],m.prototype,"frustumVisibility",void 0),n([l()],m.prototype,"objectStates",null),n([l()],m.prototype,"initializePromise",void 0),n([l()],m.prototype,"suspendResumeExtentMode",null),n([l()],m.prototype,"dataExtent",void 0),n([l()],m.prototype,"scaleVisibilitySuspended",null),n([l()],m.prototype,"suspended",null),n([l()],m.prototype,"legendEnabled",null),n([l()],m.prototype,"suspendInfo",null),n([l()],m.prototype,"updating",null),n([l()],m.prototype,"updatingRemaining",null),n([l()],m.prototype,"featureStore",null),n([l()],m.prototype,"view",null),n([l()],m.prototype,"loadedGraphics",null),n([l()],m.prototype,"fullOpacity",null),n([l()],m.prototype,"filter",null),n([l()],m.prototype,"slicePlaneEnabled",null),n([l()],m.prototype,"drapeSourceType",void 0),n([l()],m.prototype,"updatePolicy",null),n([l()],m.prototype,"preferredUpdatePolicy",void 0),n([l()],m.prototype,"displayFeatureLimit",null),m=n([P("esri.views.3d.layers.graphics.Graphics3DFeatureProcessor")],m);const Os=m,ie="suspendResumeExtentMode",Ds={remove(){},pause(){},resume(){}};function Is(r){const e=new Ke;e.include(ii),e.include(si);const{usesHalfFloat:t}=r;return e.fragment.uniforms.add(new Re("densityMap",i=>i.densityMap),new Re("tex",i=>i.colorRamp),new Z("densityNormalizer",i=>1/(i.maxDensity-i.minDensity)),new Z("minDensity",i=>i.minDensity),new Z("densityMultiplier",i=>3/(i.searchRadius*i.searchRadius*Math.PI))),t&&e.constants.add("compressionFactor","float",4),e.fragment.code.add(A` + void main() { + float density = texture(densityMap, uv).r * densityMultiplier${t?A` * compressionFactor`:""}; + float densityRatio = (density - minDensity) * densityNormalizer; + + vec4 color = texture(tex, vec2(clamp(densityRatio, 0.0, 1.0), 0.5)); + + discardOrAdjustAlpha(color); + fragColor = color; + } + `),e}const Vs=Object.freeze(Object.defineProperty({__proto__:null,build:Is},Symbol.toStringTag,{value:"Module"}));let Ps=class extends ni{constructor(){super(...arguments),this.colorRamp=null,this.densityMap=null,this.searchRadius=1,this.fieldTotal=0,this.minDensity=0,this.maxDensity=100}},ct=class pt extends it{constructor(e,t){super(e,t,()=>this.destroy())}initializeProgram(e){return new st(e.rctx,pt.shader.get().build(this.configuration),rt)}initializePipeline(){return at({blending:ri,colorWrite:nt,depthTest:null,depthWrite:null})}get primitiveType(){return ai.TRIANGLE_STRIP}};ct.shader=new et(Vs,()=>tt(()=>import("./Heatmap.glsl-30acef82.js"),["assets/Heatmap.glsl-30acef82.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/Query-1c961d4c.js","assets/dehydratedFeatureComparison-a3375a3e.js","assets/queryForSymbologySnapping-0264f2b5.js","assets/elevationInfoUtils-4fd79d95.js","assets/hash-6f442295.js","assets/diffUtils-590c9088.js","assets/Graphics3DObjectStates-bb2a6162.js","assets/UniqueValueRenderer-fef4204d.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/popupUtils-f04ec9a9.js","assets/FeatureFilter-00f4be05.js","assets/floorFilterUtils-080a7cd2.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FeatureSet-111cb247.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/projectExtentUtils-efa4cddd.js"]));let mt=class extends ot{constructor(){super(...arguments),this.usesHalfFloat=!1}};n([oe()],mt.prototype,"usesHalfFloat",void 0);let T=class extends oi{constructor(r){super(r),this.pixelRatio=1,this._colorRampData=new Uint8ClampedArray(4),this.type="draped-heatmap",this._heatmapParameters=new Ps;const e=new we;e.pixelFormat=r.pixelFormat,e.internalFormat=r.internalFormat,e.dataType=r.dataType,e.samplingMode=r.samplingMode,e.wrapMode=Ce.CLAMP_TO_EDGE;const t=r.rendererContext.rctx;this._densityMap=new li(t,e),this._quad=ui(t);const i=new mt;i.usesHalfFloat=r.dataType!==H.FLOAT,this._technique=new ct({rctx:t,viewingMode:Je.Local},i)}initialize(){const r=this._colorRampData,e=new we(r.length/4,1);e.wrapMode=Ce.CLAMP_TO_EDGE,this._colorRamp=new hi(this.rctx,e,r),this._heatmapParameters.densityMap=this._densityMap.colorTexture,this.addHandles(R(()=>[this.colorRampData,this.minDensity,this.maxDensity,this.fieldTotal,this.pixelRatio,this.searchRadius],()=>this.rendererContext.notifyContentChanged()))}destroy(){this._technique=di(this._technique),this._densityMap=z(this._densityMap),this._quad=z(this._quad),this._colorRamp=z(this._colorRamp)}get searchRadius(){return this._heatmapParameters.searchRadius}set searchRadius(r){r!==this._heatmapParameters.searchRadius&&(this._heatmapParameters.searchRadius=r,this.notifyChange("searchRadius"))}get minDensity(){return this._heatmapParameters.minDensity}set minDensity(r){r!==this._heatmapParameters.minDensity&&(this._heatmapParameters.minDensity=r,this.notifyChange("minDensity"))}get maxDensity(){return this._heatmapParameters.maxDensity}set maxDensity(r){r!==this._heatmapParameters.maxDensity&&(this._heatmapParameters.maxDensity=r,this.notifyChange("maxDensity"))}get fieldTotal(){return this._heatmapParameters.fieldTotal}set fieldTotal(r){this._heatmapParameters.fieldTotal=r,this.notifyChange("fieldTotal")}get colorRampData(){return this._colorRampData}set colorRampData(r){const{colorRamp:e}=this._heatmapParameters;if(e!=null&&r!==this._colorRampData){const t=e.descriptor.width,i=r.length/4;i!==t&&e.resize(i,1),e.setData(r)}this._colorRampData=r}get _colorRamp(){return this._heatmapParameters.colorRamp}set _colorRamp(r){this._heatmapParameters.colorRamp=r}get hasHighlights(){return!1}get hasWater(){return!1}get rendersOccluded(){return!1}render(r){const e=this._sortedMaterialRenderers;if(e.length===0)return;const t=this.rctx.getBoundFramebufferObject(),i=this.rctx.getViewport(),{pixelRatio:s}=this,a=Math.ceil(i.width*s),o=Math.ceil(i.height*s);this._densityMap.resize(a,o),this.rctx.bindFramebuffer(this._densityMap),this.rctx.setViewport(0,0,a,o),this.rctx.clear(ci.COLOR_BUFFER_BIT);let u=!1;e.forAll(h=>{if(h.material.shouldRender(r)){const c=h.prepareTechnique(r);c!=null&&(h.render(r,c),u=!0)}}),this.rctx.bindFramebuffer(t),this.rctx.setViewport(i.x,i.y,i.width,i.height),u&&(this.rctx.bindVAO(this._quad),this.rctx.bindTechnique(this._technique,this._heatmapParameters,r.bindParameters),this.rctx.drawArrays(this._technique.primitiveType,0,pi(this._quad,"geometry")))}};n([l()],T.prototype,"searchRadius",null),n([l()],T.prototype,"minDensity",null),n([l()],T.prototype,"maxDensity",null),n([l()],T.prototype,"fieldTotal",null),n([l()],T.prototype,"pixelRatio",void 0),n([l()],T.prototype,"colorRampData",null),n([l({constructOnly:!0})],T.prototype,"dataType",void 0),n([l({constructOnly:!0})],T.prototype,"samplingMode",void 0),n([l({constructOnly:!0})],T.prototype,"pixelFormat",void 0),n([l({constructOnly:!0})],T.prototype,"internalFormat",void 0),n([l()],T.prototype,"_colorRampData",void 0),T=n([P("esri.views.3d.webgl-engine.lib.DrapedHeatmapRenderer")],T);function $s(r){const e=new Ke,{vertex:t,fragment:i,attributes:s,varyings:a}=e;mi(t,r);const{isAttributeDriven:o,usesHalfFloat:u}=r;return s.add(E.POSITION,"vec3"),s.add(E.UV0,"vec2"),o&&(s.add(E.FEATUREATTRIBUTE,"float"),a.add("attributeValue","float")),u&&e.constants.add("compressionFactor","float",.25),a.add("unitCirclePos","vec2"),t.uniforms.add(new Z("radius",({resolutionForScale:h,searchRadius:c},{camera:y,screenToWorldRatio:d})=>2*c*(h===0?1:h/d)*y.pixelRatio/y.fullViewport[2]/yi)),t.code.add(A` + void main() { + unitCirclePos = uv0; + + vec4 posProj = proj * (view * vec4(${E.POSITION}, 1.0)); + vec4 quadOffset = vec4(unitCirclePos * radius, 0.0, 0.0); + + ${o?A`attributeValue = ${E.FEATUREATTRIBUTE};`:""} + gl_Position = posProj + quadOffset; + } + `),i.code.add(A` + void main() { + float radiusRatioSquared = dot(unitCirclePos, unitCirclePos); + if (radiusRatioSquared > 1.0) { + discard; + } + + float oneMinusRadiusRatioSquared = 1.0 - radiusRatioSquared; + float density = oneMinusRadiusRatioSquared * oneMinusRadiusRatioSquared ${o?A` * attributeValue`:""} ${u?A` * compressionFactor`:""}; + fragColor = vec4(density); + } + `),e}const Ms=Object.freeze(Object.defineProperty({__proto__:null,build:$s},Symbol.toStringTag,{value:"Module"}));let As=class extends gi{constructor(){super(...arguments),this.searchRadius=128,this.resolutionForScale=0}};class Y extends it{initializeProgram(e){return new st(e.rctx,Y.shader.get().build(this.configuration),rt)}initializePipeline(){return at({blending:_i(Se.ONE,Se.ONE,fi.ADD),colorWrite:nt,depthTest:null,depthWrite:null})}destroy(){super.destroy()}}Y.shader=new et(Ms,()=>tt(()=>import("./HeatmapDensity.glsl-403624d9.js"),["assets/HeatmapDensity.glsl-403624d9.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/Query-1c961d4c.js","assets/dehydratedFeatureComparison-a3375a3e.js","assets/queryForSymbologySnapping-0264f2b5.js","assets/elevationInfoUtils-4fd79d95.js","assets/hash-6f442295.js","assets/diffUtils-590c9088.js","assets/Graphics3DObjectStates-bb2a6162.js","assets/UniqueValueRenderer-fef4204d.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/popupUtils-f04ec9a9.js","assets/FeatureFilter-00f4be05.js","assets/floorFilterUtils-080a7cd2.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FeatureSet-111cb247.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/projectExtentUtils-efa4cddd.js"]));let le=class extends ot{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloat=!1}};n([oe()],le.prototype,"isAttributeDriven",void 0),n([oe()],le.prototype,"usesHalfFloat",void 0);const Ns=2;class Ls extends As{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class ke extends xi{constructor(e){super(e,new Ls),this._configuration=new le}requiresSlot(e,t){return e===Ei.DRAPED_MATERIAL&&t===bi.Color}getConfiguration(){return this._configuration.isAttributeDriven=this.parameters.isAttributeDriven,this._configuration.usesHalfFloat=this.parameters.usesHalfFloats,this._configuration}createGLMaterial(e){return new Us(e)}intersect(){}intersectDraped(e,t,i,s,a,o){const u=e.vertexAttributes.get(E.POSITION),{parameters:h}=this,{searchRadius:c}=h,{screenToWorldRatio:y}=e,d=c*y+Ns*y,g=d*d,b=u.data.length/u.size;for(let $=0;$this._loadedPointGraphics.length,setAllFeaturesVisibility:a=>this._setAllFeaturesVisibility(a),clearFeaturesVisibility:()=>this._setAllFeaturesVisibility(!0),updateFeatureVisibilities:a=>this._updateFeatureVisibilities(a)}}),this.updatingHandles.addOnCollectionChange(()=>this._loadedPointGraphics,a=>this._onLoadedFeaturesChange(a),D),this.updatingHandles.addWhen(()=>this._materialParameters,a=>this._forEachMaterial(o=>o.setParameters(a)),D),this.updatingHandles.add(()=>this._rendererParameters,a=>this._drapeSourceRenderer.set(a)),this.updatingHandles.add(()=>this._heatmapRendererField,()=>{this._recreate()},ne),this.updatingHandles.add(()=>({fieldName:this._heatmapRendererFieldName,numeric:this._heatmapRendererFieldIsNumeric}),({fieldName:a,numeric:o})=>{if(a!=null&&o){let u=0;this._featureStore.forEach(h=>u+=h.attributes[a]??0),this._fieldTotal=u}else this._fieldTotal=this._featureStore.numFeatures},D),this.handles.add([R(()=>({fieldName:this._heatmapRendererFieldName,field:this._heatmapRendererField}),({fieldName:a,field:o})=>{a&&!o&&X.warn(`Heatmap renderer field '${a}' for layer '${this.layer.title??this.layer.id}' not found`)}),R(()=>({field:this._heatmapRendererField,numeric:this._heatmapRendererFieldIsNumeric}),({field:a,numeric:o})=>{a==null||o||X.warn(`Heatmap renderer field '${a.name}' for layer '${this.layer.title??this.layer.id}' does not contain numeric values and cannot be used to drive the heatmap density`)}),lt(()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this))])}destroy(){this._renderGeometries.clear(),this._material=z(this._material),this._materialWithField=z(this._materialWithField),this._featureStore.clear(),this._featureStore=null}get layer(){return this.owner.layer}get featureStore(){return this._featureStore}get updating(){return this.updatingHandles.updating||this.filterVisibility.updating}get updatingRemaining(){return 0}get suspendInfo(){return{}}get legendEnabled(){return!0}get filterVisibility(){return this._filterVisibility}get displayFeatureLimit(){var i,s,a,o,u,h;const r=((o=(a=(s=(i=this.owner)==null?void 0:i.view)==null?void 0:s.resourceController)==null?void 0:a.memoryController)==null?void 0:o.memoryFactor)??1,e=(h=(u=this.owner)==null?void 0:u.view)==null?void 0:h.qualitySettings,t=e?Math.ceil(e.heatmap.maxTotalNumberOfFeatures*r):0;return{minimumTotalNumberOfFeatures:0,maximumTotalNumberOfFeatures:t,maximumTotalNumberOfPrimitives:t*2,maximumNumberOfFeatures:t}}get hasZ(){return"hasZ"in this.layer&&this.layer.hasZ}get hasM(){return"hasM"in this.layer&&this.layer.hasM}get view(){return this.owner.view}get fullOpacity(){return this.owner.fullOpacity}get updatePolicy(){return this.owner.updatePolicy}get scaleVisibilitySuspended(){if(!this._isScaleRangeActive)return!1;const{minScale:r,maxScale:e}=this.layer.effectiveScaleRange,{scale:t}=this.view;return!Di(t,r??0,e??0)}get usedMemory(){var s,a;const r=this.usedMemoryPerFeature*this._featureStore.numFeatures,e=this._pixelFormat===I.RED?1:4,t=this._dataType===H.FLOAT?4:2,i=Math.ceil((((a=(s=this._overlayRenderer)==null?void 0:s.overlays[0])==null?void 0:a.resolution)??0)*this._densityMapPixelRatio)??0;return i*i*e*t+r}get usedMemoryPerFeature(){const r=this._loadedPointGraphics.find(()=>!0);if(r==null)return 0;const e=Ii(r),t=zi(),i=6;return i*De([0,0,0],t)+i*De([0,0],t)+(this._heatmapRendererFieldIsNumeric?i*t:0)+e}get loadedFeatures(){return this._featureStore.numFeatures}get unprocessedMemoryEstimate(){return 0}get performanceInfo(){return{core:{visible:this._visibleFeatures,missing:0,pending:0},elevationUpdating:!1,visibilityFrustum:!0,visibilityScale:!0}}get renderer(){return this._heatmapRenderer}get _overlayRenderer(){return this.view.basemapTerrain.overlayManager.renderer}get _overlaySpatialReference(){return this._overlayRenderer.spatialReference}get _rendererParameters(){return{...this._radiusParameter,...this._densityParameters,...this._colorRampParameter,...this._pixelRatioParameter}}get _materialParameters(){return{...this._radiusParameter,...this._resolutionForScaleParameter}}get _densityParameters(){const r=this._heatmapRenderer;if(r==null)return null;const{minDensity:e,maxDensity:t}=r;return{minDensity:e,maxDensity:t,fieldTotal:this._fieldTotal}}get _radiusParameter(){return L(this._heatmapRenderer,({radius:r})=>({searchRadius:Vi(this._clampSearchRadius(r))}))}get _resolutionForScaleParameter(){return L(this._heatmapRenderer,({referenceScale:r})=>({resolutionForScale:r===0?0:Pi(r,this.view.spatialReference)}))}get _colorRampParameter(){return L(this._heatmapRenderer,r=>({colorRampData:os(r.colorStops)}))}get _pixelRatioParameter(){return{pixelRatio:this._densityMapPixelRatio}}get _densityMapPixelRatio(){var e,t,i,s,a,o;const r=((s=(i=(t=(e=this.owner)==null?void 0:e.view)==null?void 0:t.resourceController)==null?void 0:i.memoryController)==null?void 0:s.memoryFactor)??1;return(((o=(a=this.owner)==null?void 0:a.view)==null?void 0:o.qualitySettings.heatmap.pixelRatio)??1)*Math.sqrt(r)}get _renderView(){return this.view._stage.renderView}get _featuresArePoints(){return this.layer.geometryType==="point"}get _loadedPointGraphics(){return this.owner.loadedGraphics}get _heatmapRenderer(){const r=this.layer.renderer;return(r==null?void 0:r.type)==="heatmap"?r:null}get _heatmapRendererFieldName(){return L(this._heatmapRenderer,r=>r.field)}get _heatmapRendererField(){return L(this._heatmapRendererFieldName,r=>this.layer.fieldsIndex.get(r))}get _heatmapRendererFieldIsNumeric(){const r=this._heatmapRendererField;return r!=null&&$i(r)}get _isScaleRangeActive(){const{layer:r}=this;if(!("effectiveScaleRange"in r))return!1;const{minScale:e,maxScale:t}=r.effectiveScaleRange;return Mi(e,t)}get _visibleFeatures(){let r=0;return this._renderGeometries.forEach(e=>{e.visible&&++r}),r}async whenGraphicBounds(){return null}computeAttachmentOrigin(){return null}highlight(){return je}maskOccludee(){return je}setObjectIdVisibility(){}refreshFilter(){this.filterVisibility.reapply()}_onLoadedFeaturesChange(r){if(!this._featuresArePoints)return;const{objectIdField:e}=this.layer;this._featureStore.removeManyById(r.removed.map(o=>C(o,e))),this._featureStore.addMany(r.added.map(o=>{const u=new Ai(Ie(new Ve,o.geometry),o.attributes,L(o.centroid,h=>Ie(new Ve,h)),C(o,e));return u.displayId=o.uid,u}));const t=r.added,i=r.removed;this._fieldTotal+=this._computeFieldTotalChange(t,i);const s=i.map(({uid:o})=>{const u=this._renderGeometries.get(o);return this._renderGeometries.delete(o),u}).filter(Ni),a=t.map(o=>{const u=this._pointGraphicToRenderGeometry(o);return this._renderGeometries.set(o.uid,u),u});s.length>0&&this._drapeSourceRenderer.removeGeometries(s,Pe.REMOVE),a.length>0&&this._drapeSourceRenderer.addGeometries(a,Pe.ADD),(a.length>0||s.length>0)&&(this.filterVisibility.reapply(),this._renderView.requestRender())}_recreate(){if(!this._loadedPointGraphics)return;const r=this._loadedPointGraphics.toArray();this._onLoadedFeaturesChange({added:r,removed:r})}_pointGraphicToRenderGeometry(r){const e=this._heatmapRendererFieldName,t=e!=null?this._materialWithField:this._material,i=Qi();Li(r.geometry,i,this._overlaySpatialReference),i[2]=Ui;const s=[[E.POSITION,new $e(i,i.length)]],a=this._heatmapRendererFieldIsNumeric;e!=null&&s.push([E.FEATUREATTRIBUTE,new $e([a?r.attributes[e]??0:0],1)]);const o=new Gi(new qi(t,s,null,null,Hi.Point),{layerUid:this.layer.uid,graphicUid:r.uid});return o.visible=this.filterVisibility.defaultVisibility,o}_forEachMaterial(r){r(this._material),r(this._materialWithField)}_computeFieldTotalChange(r,e){if(this._heatmapRendererFieldName==null||!this._heatmapRendererFieldIsNumeric)return r.length-e.length;const t=this._heatmapRendererFieldName,i=(s,a)=>s+(a.attributes[t]??0);return r.reduce(i,0)-e.reduce(i,0)}_clampSearchRadius(r){return r>re&&X.warnOnce(`SceneView supports a maximum radius of ${re} pt for HeatmapRenderer.`),Math.min(r,re)}_updateFeatureVisibilities(r){const e=[];this._featureStore.forEach(({objectId:t,displayId:i})=>{const s=r(t),a=this._renderGeometries.get(i);a&&a.visible!==s&&(e.push(a),a.visible=s)}),this._drapeSourceRenderer.modifyGeometries(e,Me.VISIBILITY)}_setAllFeaturesVisibility(r){const e=[];for(const t of this._renderGeometries.values())t.visible!==r&&(e.push(t),t.visible=r);this._drapeSourceRenderer.modifyGeometries(e,Me.VISIBILITY)}get test(){return{visibleFeatureCount:this._visibleFeatures}}};n([l()],p.prototype,"type",void 0),n([l({constructOnly:!0})],p.prototype,"owner",void 0),n([l()],p.prototype,"layer",null),n([l()],p.prototype,"featureStore",null),n([l()],p.prototype,"updating",null),n([l()],p.prototype,"updatingRemaining",null),n([l()],p.prototype,"suspendInfo",null),n([l()],p.prototype,"legendEnabled",null),n([l()],p.prototype,"filterVisibility",null),n([l()],p.prototype,"displayFeatureLimit",null),n([l()],p.prototype,"preferredUpdatePolicy",void 0),n([l()],p.prototype,"hasZ",null),n([l()],p.prototype,"hasM",null),n([l()],p.prototype,"dataExtent",void 0),n([l()],p.prototype,"view",null),n([l()],p.prototype,"fullOpacity",null),n([l()],p.prototype,"updatePolicy",null),n([l()],p.prototype,"drapeSourceType",void 0),n([l()],p.prototype,"scaleVisibilitySuspended",null),n([l()],p.prototype,"renderer",null),n([l()],p.prototype,"_featureStore",void 0),n([l()],p.prototype,"_filterVisibility",void 0),n([l()],p.prototype,"_overlayRenderer",null),n([l()],p.prototype,"_overlaySpatialReference",null),n([l()],p.prototype,"_rendererParameters",null),n([l()],p.prototype,"_materialParameters",null),n([l()],p.prototype,"_densityParameters",null),n([l()],p.prototype,"_radiusParameter",null),n([l()],p.prototype,"_resolutionForScaleParameter",null),n([l()],p.prototype,"_colorRampParameter",null),n([l()],p.prototype,"_pixelRatioParameter",null),n([l()],p.prototype,"_densityMapPixelRatio",null),n([l()],p.prototype,"_renderGeometries",void 0),n([l()],p.prototype,"_material",void 0),n([l()],p.prototype,"_materialWithField",void 0),n([l()],p.prototype,"_renderView",null),n([l()],p.prototype,"_featuresArePoints",null),n([l()],p.prototype,"_loadedPointGraphics",null),n([l()],p.prototype,"_heatmapRenderer",null),n([l()],p.prototype,"_heatmapRendererFieldName",null),n([l()],p.prototype,"_heatmapRendererField",null),n([l()],p.prototype,"_heatmapRendererFieldIsNumeric",null),n([l()],p.prototype,"_fieldTotal",void 0),n([l()],p.prototype,"_drapeSourceRenderer",void 0),n([l()],p.prototype,"_isScaleRangeActive",null),p=n([P(_t)],p);const je=lt(),yr=r=>{let e=class extends r{constructor(){super(...arguments),this.controller=null,this.updatePolicy=pe.SYNC,this.suspendResumeExtentMode="computed",this.slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.suspendResumeExtent=null,this._controllerCreated=!1,this.supportsHeightUnitConversion=!0,this._pendingController=null,this.queryEngine=null}initialize(){const t=this.layer;if("isTable"in t&&t.isTable)return void this.addResolvingPromise(Promise.reject(new V("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:t})));this.addResolvingPromise(this._validateGeometryType()),this.updatingHandles.add(()=>this.layer.renderer,s=>this._recreateProcessor(s),D),this.addResolvingPromise((async()=>{const s=await ls(this);this.fullExtentInLocalViewSpatialReference=s,await this._initializeController()})()),this.updatingHandles.add(()=>this.updatePolicy,s=>this.processor.preferredUpdatePolicy=s);const i=()=>this.processor.featureStore;this.queryEngine=new S({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return i()},hasZ:this.hasZ,hasM:this.hasM},priority:de.FEATURE_QUERY_ENGINE}),this.notifyChange("updating")}destroy(){this._destroyPendingController(),this.controller=O(this.controller),this._set("processor",O(this.processor)),this.queryEngine=O(this.queryEngine),this.loadedGraphics=null}_destroyPendingController(){this._pendingController=O(this._pendingController)}get legendEnabled(){var t;return this.canResume()&&((t=this.processor)==null?void 0:t.legendEnabled)}get graphics3DProcessor(){var t;return((t=this.processor)==null?void 0:t.type)==="graphics-3d"?this.processor:null}get heatmapProcessor(){var t;return((t=this.processor)==null?void 0:t.type)==="heatmap"?this.processor:null}get symbologySnappingSupported(){var i,s;const t=(s=(i=this.layer)==null?void 0:i.renderer)==null?void 0:s.getSymbols();return(t==null?void 0:t.some(ki))??!1}getHit(t){var s;let i;return(s=this.loadedGraphics)==null||s.forEach(a=>{a.uid===t&&(i=ji(a,this.layer))}),i?{type:"graphic",graphic:i,layer:i.layer}:null}whenGraphicBounds(t,i){var s;return(s=this.processor)==null?void 0:s.whenGraphicBounds(t,i)}computeAttachmentOrigin(t,i){var s;return(s=this.processor)==null?void 0:s.computeAttachmentOrigin(t,i)}async elevationAlignPointsInFeatures(t,i){const s=this.graphics3DProcessor;if(s==null)throw new V("featurelayerview3d:missing-processor","A Graphics3D processor is needed to resolve graphics elevation.");return Ji(this.view,this.layer,a=>s.getGraphics3DGraphicByObjectId(a),t,i)}async queryForSymbologySnapping(t,i){return this.symbologySnappingSupported?Xi(this.graphics3DProcessor,t,i):{candidates:[],sourceCandidateIndices:[]}}queryFeatures(t,i){return this.queryEngine.executeQuery(this._ensureQuery(t),i==null?void 0:i.signal)}queryObjectIds(t,i){return this.queryEngine.executeQueryForIds(this._ensureQuery(t),i==null?void 0:i.signal)}queryFeatureCount(t,i){return this.queryEngine.executeQueryForCount(this._ensureQuery(t),i==null?void 0:i.signal)}queryExtent(t,i){return this.queryEngine.executeQueryForExtent(this._ensureQuery(t),i==null?void 0:i.signal)}_ensureQuery(t){return t==null?this.createQuery():Q.from(t)}highlight(t){return this.processor.highlight(t,this.layer.objectIdField)}maskOccludee(t){return this.processor.maskOccludee(t)}canResume(){var t;return super.canResume()&&!((t=this.processor)!=null&&t.scaleVisibilitySuspended)}getSuspendInfo(){const t=super.getSuspendInfo();return this.processor?{...t,...this.processor.suspendInfo}:t}isUpdating(){var t,i,s;return!(!this.processor||this.processor.destroyed)&&!(this._controllerCreated&&!((t=this.controller)!=null&&t.updating)&&((s=(i=this.view)==null?void 0:i.basemapTerrain)!=null&&s.ready)&&!this.processor.updating)}async _initializeController(){const t=this.createController();this._pendingController=t,await t.when(),this._setControllerWhenInitialized(t)}async _setControllerWhenInitialized(t){try{await this.when()}catch{}this._controllerCreated=!0,this.notifyChange("updating"),this.isResolved()&&!this.destroyed?(await Ze(()=>{var i,s;return(s=(i=this.view)==null?void 0:i.basemapTerrain)==null?void 0:s.ready}),this.beforeSetController(t),this._pendingController=null,this.controller=t,this.loadedGraphics=t.graphics,this.notifyChange("updating")):this._destroyPendingController()}_updateClippingExtent(t){if(this.clippingExtent=t,!this.controller)return!1;switch(this.controller.type){case"stream":return!1;case"feature-tile-3d":return this.controller.extent=t,!0}}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":throw new V("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}_recreateProcessor(t){var u,h;const i=(t==null?void 0:t.type)==="heatmap",s=((u=this.processor)==null?void 0:u.type)==="heatmap",a=this.processor;if(a&&i===s)return;const o=i?new p({owner:this}):new Os({owner:this,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,updateClippingExtent:c=>this._updateClippingExtent(c)});this._set("processor",o),a==null||a.destroy(),(h=this.queryEngine)==null||h.clear(),this.addResolvingPromise(o.initializePromise)}_getResourceInfo(){var i;const t=this.controller instanceof f?this.controller:null;return{displayedNumberOfFeatures:(i=this.loadedGraphics)==null?void 0:i.length,maximumNumberOfFeatures:(t==null?void 0:t.maximumNumberOfFeatures)??-1,totalNumberOfFeatures:(t==null?void 0:t.serviceDataCount)??-1,nodes:0,...this.processor.performanceInfo}}get performanceInfo(){return this._getResourceInfo()}};return n([l()],e.prototype,"loadedGraphics",void 0),n([l()],e.prototype,"suspended",void 0),n([l({readOnly:!0})],e.prototype,"legendEnabled",null),n([l()],e.prototype,"updating",void 0),n([l()],e.prototype,"controller",void 0),n([l()],e.prototype,"processor",void 0),n([l({readOnly:!0})],e.prototype,"updatePolicy",void 0),n([l({readOnly:!0})],e.prototype,"suspendResumeExtentMode",void 0),n([l({type:Boolean})],e.prototype,"slicePlaneEnabled",void 0),n([l({readOnly:!0})],e.prototype,"suspendInfo",void 0),n([l()],e.prototype,"graphics3DProcessor",null),n([l()],e.prototype,"heatmapProcessor",null),n([l()],e.prototype,"symbologySnappingSupported",null),e=n([P("esri.views.3d.layers.FeatureLikeLayerView3D")],e),e};export{lr as A,yr as E,f as I,Os as _,S as c,Qe as n,$s as s,Is as t}; diff --git a/assets/FeatureReductionLayer-4262cf54.js b/assets/FeatureReductionLayer-4262cf54.js new file mode 100644 index 0000000..2b55458 --- /dev/null +++ b/assets/FeatureReductionLayer-4262cf54.js @@ -0,0 +1 @@ +import{cz as ue,ai as l,aj as a,al as x,ck as G,cl as v,d2 as U,cC as K,bY as A,ay as T,cO as P,fT as I,ns as pe,cy as de,nt as Q,nu as q,bz as ce,cn as W,nv as fe,nw as R,ar as ye}from"./index-080e108a.js";import"./UniqueValueRenderer-fef4204d.js";import{p as X,o as k}from"./jsonUtils-f73b3833.js";import{m as Z,p as ee}from"./commonProperties-30089b06.js";import{v as te}from"./featureLayerUtils-6cf06f83.js";import{C as ie}from"./LabelClass-2d53c485.js";let z=class extends ue(G){constructor(o){super(o),this.expression=null,this.title=null,this.returnType=null}};l([a({type:String,json:{write:!0}})],z.prototype,"expression",void 0),l([a({type:String,json:{write:!0}})],z.prototype,"title",void 0),l([a({type:String,json:{write:!0}})],z.prototype,"returnType",void 0),z=l([x("esri.layers.support.ExpressionInfo")],z);const D=z;var C;let b=C=class extends G{constructor(e){super(e),this.isAutoGenerated=!1,this.name=null,this.alias=null,this.onStatisticField=null,this.onStatisticExpression=null,this.statisticType=null}clone(){return new C({name:this.name,alias:this.alias,isAutoGenerated:this.isAutoGenerated,onStatisticExpression:v(this.onStatisticExpression),onStatisticField:this.onStatisticField,statisticType:this.statisticType})}};l([a({type:Boolean,json:{write:!0}})],b.prototype,"isAutoGenerated",void 0),l([a({type:String,json:{write:!0}})],b.prototype,"name",void 0),l([a({type:String,json:{write:!0}})],b.prototype,"alias",void 0),l([a({type:String,json:{write:!0}})],b.prototype,"onStatisticField",void 0),l([a({type:D,json:{write:!0}})],b.prototype,"onStatisticExpression",void 0),l([a({type:String,json:{write:!0}})],b.prototype,"statisticType",void 0),b=C=l([x("esri.layers.support.AggregateField")],b);const $=b;let w=class extends G{constructor(){super(...arguments),this.type=null}};l([a({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],w.prototype,"type",void 0),w=l([x("esri.layers.support.FeatureReduction")],w);var L;const me="esri.layers.support.FeatureReductionBinning";let m=L=class extends w{constructor(e){super(e),this.type="binning",this.binType="geohash",this.fixedBinLevel=3,this.labelingInfo=null,this.labelsVisible=!0,this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.fields=[],this.renderer=null}writeFields(e,o,t){const i=e.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());P(t,i,o)}readRenderer(e,o,t){var r;const i=(r=o.drawingInfo)==null?void 0:r.renderer;return i?k(i,o,t)??void 0:te(o,t)}clone(){return new L({fields:v(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:v(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:v(this.popupTemplate),renderer:v(this.renderer)})}};l([U({binning:"binning"})],m.prototype,"type",void 0),l([U({geohash:"geohash"})],m.prototype,"binType",void 0),l([a({type:Number,range:{min:1,max:9},json:{write:!0}})],m.prototype,"fixedBinLevel",void 0),l([a({type:[ie],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],m.prototype,"labelingInfo",void 0),l([a(Z)],m.prototype,"labelsVisible",void 0),l([a({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],m.prototype,"maxScale",void 0),l([a(ee)],m.prototype,"popupEnabled",void 0),l([a({type:K,json:{name:"popupInfo",write:!0}})],m.prototype,"popupTemplate",void 0),l([a({type:[$],json:{write:!0}})],m.prototype,"fields",void 0),l([A("fields")],m.prototype,"writeFields",null),l([a({types:X,json:{write:{target:"drawingInfo.renderer"}}})],m.prototype,"renderer",void 0),l([T("renderer",["drawingInfo.renderer"])],m.prototype,"readRenderer",null),m=L=l([x(me)],m);const se=m;var N;const he="esri.layers.support.FeatureReductionCluster";function H(e){var o;return e.type==="simple"&&!((o=e.visualVariables)!=null&&o.length)}let p=N=class extends G{constructor(e){super(e),this.type="cluster",this.clusterRadius=I("80px"),this.clusterMinSize=I("12px"),this.clusterMaxSize=I("50px"),this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=null}readRenderer(e,o,t){var r,s;const i=(r=o.drawingInfo)==null?void 0:r.renderer;return(s=i==null?void 0:i.authoringInfo)!=null&&s.isAutoGenerated?null:i?H(i)?null:k(i,o,t)??void 0:te(o,t)}readSymbol(e,o,t){var r,s;const i=(r=o.drawingInfo)==null?void 0:r.renderer;if((s=i==null?void 0:i.authoringInfo)!=null&&s.isAutoGenerated)return null;if(i&&H(i)){const n=k(i,o,t);return n==null?void 0:n.symbol}return null}writeSymbol(e,o,t,i){var s,n;const r=(n=(s=this.renderer)==null?void 0:s.authoringInfo)==null?void 0:n.isAutoGenerated;if(!this.renderer||r){const h=new de({symbol:e});o.drawingInfo={renderer:h.write({},i)}}}writeFields(e,o,t){const i=e.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());P(t,i,o)}readFields(e,o,t){return e.filter(i=>!i.isAutoGenerated).map(i=>$.fromJSON(i))}clone(){return new N({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:v(this.labelingInfo),labelsVisible:this.labelsVisible,fields:v(this.fields),maxScale:this.maxScale,renderer:v(this.renderer),symbol:v(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:v(this.popupTemplate)})}};l([a({type:["cluster"],readOnly:!0,json:{write:!0}})],p.prototype,"type",void 0),l([a({type:Number,cast:e=>e==="auto"?e:I(e),json:{write:!0}})],p.prototype,"clusterRadius",void 0),l([a({type:Number,cast:I,json:{write:!0}})],p.prototype,"clusterMinSize",void 0),l([a({type:Number,cast:I,json:{write:!0}})],p.prototype,"clusterMaxSize",void 0),l([a({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],p.prototype,"maxScale",void 0),l([a(ee)],p.prototype,"popupEnabled",void 0),l([a({type:K,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],p.prototype,"popupTemplate",void 0),l([a({types:X,json:{write:{target:"drawingInfo.renderer"}}})],p.prototype,"renderer",void 0),l([T("renderer",["drawingInfo.renderer"])],p.prototype,"readRenderer",null),l([a({types:pe})],p.prototype,"symbol",void 0),l([T("symbol",["drawingInfo.renderer"])],p.prototype,"readSymbol",null),l([A("symbol")],p.prototype,"writeSymbol",null),l([a({type:[ie],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],p.prototype,"labelingInfo",void 0),l([a(Z)],p.prototype,"labelsVisible",void 0),l([a({type:[$],json:{write:!0}})],p.prototype,"fields",void 0),l([A("fields")],p.prototype,"writeFields",null),l([T("fields")],p.prototype,"readFields",null),p=N=l([x(he)],p);const re=p;var O;let V=O=class extends w{constructor(e){super(e),this.type="selection"}clone(){return new O}};l([a({type:["selection"]})],V.prototype,"type",void 0),V=O=l([x("esri.layers.support.FeatureReductionSelection")],V);const J=V,Y={key:"type",base:w,typeMap:{cluster:re,binning:se}},ve={types:{key:"type",base:w,typeMap:{selection:J,cluster:re,binning:se}},json:{name:"layerDefinition.featureReduction",write:{allowNull:!0},origins:{"web-map":{types:Y},"portal-item":{types:Y},"web-scene":{types:{key:"type",base:w,typeMap:{selection:J}}}}}},E={Base64:0,Hex:1,String:2,Raw:3},F=8,ne=(1<>16)+(o>>16)+(t>>16)<<16|65535&t}function be(e){const o=[];for(let t=0,i=e.length*F;t>5]|=(e.charCodeAt(t/F)&ne)<>5]>>>t%32&ne));return o.join("")}function we(e){const o="0123456789abcdef",t=[];for(let i=0,r=4*e.length;i>2]>>i%4*8+4&15)+o.charAt(e[i>>2]>>i%4*8&15));return t.join("")}function xe(e){const o="=",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=[];for(let r=0,s=4*e.length;r>2]>>r%4*8&255)<<16|(e[r+1>>2]>>(r+1)%4*8&255)<<8|e[r+2>>2]>>(r+2)%4*8&255;for(let h=0;h<4;h++)8*r+6*h>32*e.length?i.push(o):i.push(t.charAt(n>>6*(3-h)&63))}return i.join("")}function Se(e,o){return e<>>32-o}function M(e,o,t,i,r,s){return g(Se(g(g(o,e),g(i,s)),r),t)}function d(e,o,t,i,r,s,n){return M(o&t|~o&i,e,o,r,s,n)}function c(e,o,t,i,r,s,n){return M(o&i|t&~i,e,o,r,s,n)}function f(e,o,t,i,r,s,n){return M(o^t^i,e,o,r,s,n)}function y(e,o,t,i,r,s,n){return M(t^(o|~i),e,o,r,s,n)}function $e(e,o){e[o>>5]|=128<>>9<<4)]=o;let t=1732584193,i=-271733879,r=-1732584194,s=271733878;for(let n=0;ne.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions&&this.legendOptions.clone(),levels:v(this.levels)})}};l([a()],_.prototype,"levels",void 0),l([A("levels")],_.prototype,"writeLevels",null),_=B=l([x("esri.views.2d.engine.LevelDependentSizeVariable")],_);const Ee=ce.getLogger("esri.views.2d.layers.support.clusterUtils");W.add("esri-cluster-arcade-enabled",!0);const ze=W("esri-cluster-arcade-enabled"),Ie=(e,o,t,i,r)=>{const s=o.clone();if(!_e(s))return s;if(s.authoringInfo||(s.authoringInfo=new fe),s.authoringInfo.isAutoGenerated=!0,"visualVariables"in s){const n=(s.visualVariables||[]).filter(u=>u.valueExpression!=="$view.scale"),h=Fe(n);n.forEach(u=>{u.type==="rotation"?u.field?u.field=S(e,u.field,"avg_angle","number"):u.valueExpression&&(u.field=j(e,u.valueExpression,"avg_angle","number"),u.valueExpression=null):u.normalizationField?(u.field=S(e,u.field,"avg_norm","number",u.normalizationField),u.normalizationField=null):u.field?u.field=S(e,u.field,"avg","number"):u.valueExpression&&(u.field=j(e,u.valueExpression,"avg","number"),u.valueExpression=null)}),h==null&&!Re(n)&&r&&(n.push(je(t,i)),s.dynamicClusterSize=!0),s.visualVariables=n}switch(s.type){case"simple":break;case"pie-chart":for(const n of s.attributes)n.field?n.field=S(e,n.field,"sum","number"):n.valueExpression&&(n.field=j(e,n.valueExpression,"sum","number"),n.valueExpression=null);break;case"unique-value":s.field?s.field=S(e,s.field,"mode","string"):s.valueExpression&&(s.field=j(e,s.valueExpression,"mode","string"),s.valueExpression=null);break;case"class-breaks":s.normalizationField?(s.field=S(e,s.field,"avg_norm","number",s.normalizationField),s.normalizationField=null):s.field?s.field=S(e,s.field,"avg","number"):s.valueExpression&&(s.field=j(e,s.valueExpression,"avg","number"),s.valueExpression=null)}return s},Fe=e=>{for(const o of e)if(o.type==="size")return o;return null},Re=e=>{for(const o of e)if(o.field==="cluster_count")return!0;return!1},je=(e,o)=>{const t=[new R({value:0,size:0}),new R({value:1})];if(o==null)return new Q({field:"cluster_count",stops:[...t,new R({value:2,size:0})]});const i=Object.keys(o).reduce((r,s)=>({...r,[s]:[...t,new R({value:Math.max(2,o[s].minValue),size:e.clusterMinSize}),new R({value:Math.max(3,o[s].maxValue),size:e.clusterMaxSize})]}),{});return new _({field:"cluster_count",levels:i})},_e=e=>{const o=t=>Ee.error(new ye("Unsupported-renderer",t,{renderer:e}));if(!e)return!1;switch(e.type){case"unique-value":if(e.field2||e.field3)return o("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1;break;case"class-breaks":if(e.normalizationField){const t=e.normalizationType;if(t!=="field")return o(`FeatureReductionCluster does not support a normalizationType of ${t}`),!1}break;case"simple":case"pie-chart":break;default:return o(`FeatureReductionCluster does not support renderers of type ${e.type}`),!1}if(!ze){if("valueExpression"in e&&e.valueExpression)return o("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in e&&e.visualVariables||[]).some(t=>!(!("valueExpression"in t)||!t.valueExpression)))return o("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function Te(e,o,t){switch(e){case"sum":return`cluster_sum_${o}`;case"avg":case"avg_angle":return`cluster_avg_${o}`;case"mode":return`cluster_type_${o}`;case"avg_norm":{const i=t,r="field",s=o.toLowerCase()+",norm:"+r+","+i.toLowerCase();return"cluster_avg_"+oe(s)}}}function j(e,o,t,i){const r=oe(o),s=t==="mode"?`cluster_type_${r}`:t==="sum"?`cluster_sum_${r}`:`cluster_avg_${r}`;return e.some(n=>n.name===s)||e.push(new $({name:s,isAutoGenerated:!0,onStatisticExpression:new D({expression:o,returnType:i}),statisticType:t})),s}function S(e,o,t,i,r){if(o==="cluster_count"||e.some(n=>n.name===o))return o;const s=Te(t,o,r);return e.some(n=>n.name===s)||(t==="avg_norm"?e.push(new $({name:s,isAutoGenerated:!0,onStatisticExpression:new D({expression:`$feature.${o} / $feature.${r}`,returnType:i}),statisticType:"avg"})):e.push(new $({name:s,isAutoGenerated:!0,onStatisticField:o,statisticType:t}))),s}const Oe=e=>{let o=class extends e{constructor(...t){super(...t),this.own(this.watch("renderer",()=>{if(this.featureReduction){const i=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",i)}},!0))}set featureReduction(t){const i=this._normalizeFeatureReduction(t);this._set("featureReduction",i)}set renderer(t){}_normalizeFeatureReduction(t){var h;if((t==null?void 0:t.type)!=="cluster")return t;const i=t.clone(),r=[new $({name:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],s=(i.fields??[]).filter(u=>!u.isAutoGenerated);if(t.renderer&&!((h=t.renderer.authoringInfo)!=null&&h.isAutoGenerated))return i.fields=[...r,...s],i;if(t.symbol)return i.fields=[...r,...s],i.renderer=null,i;if(!this.renderer)return t;const n=Ie(r,this.renderer,t,null,!1);return i.fields=[...r,...s],i.renderer=n,i}};return l([a(ve)],o.prototype,"featureReduction",null),o=l([x("esri.layers.mixins.FeatureReductionLayer")],o),o};export{E as a,Oe as n,J as p,w as t,oe as x}; diff --git a/assets/FeatureServiceSnappingSource-14e28ceb.js b/assets/FeatureServiceSnappingSource-14e28ceb.js new file mode 100644 index 0000000..b9715e9 --- /dev/null +++ b/assets/FeatureServiceSnappingSource-14e28ceb.js @@ -0,0 +1,3 @@ +import{lx as z,ly as R,lz as x,dS as M,bH as N,ai as a,aj as r,al as S,ao as O,lA as U,aG as w,aH as F,fJ as H,bm as P,ag as m,lB as j,af as A,aS as V,ak as D,aU as J,gD as Z,fv as L,dZ as k,fy as q,iR as G,jE as W,bV as B,c7 as X,f2 as Q,cX as K,ax as T,lC as f,aT as Y,aX as $,lD as ee,lE as te}from"./index-080e108a.js";import{m as ie}from"./elevationInfoUtils-4fd79d95.js";import{i as ne,o as ae}from"./queryEngineUtils-342680f6.js";import{y as re}from"./TileTreeDebugger-142b9f39.js";import"./DimensionAnalysisView3D-4f55aca1.js";import"./LineVisualElement-b605d10c.js";import"./LengthDimension-92faee98.js";import"./Segment-50129b50.js";import"./unitFormatUtils-b70a7bff.js";import"./analysisViewUtils-68ab721d.js";import"./ImageMaterial-5c48df66.js";import"./Factory-8e329f4b.js";import"./RightAngleQuadVisualElement-8daf0594.js";import"./VisualElementResources-e52972a5.js";import"./PointVisualElement-2a56e55d.js";import"./EditGeometryOperations-0ec3f5b5.js";import"./dehydratedFeatureComparison-a3375a3e.js";import"./VertexSnappingCandidate-0a987e12.js";function _(e,t){return R(t.extent,C),x(C,M(se,e.x,e.y,0))}const C=z(),se=N();let c=class extends O{get tiles(){const t=this.tilesCoveringView,i=this.pointOfInterest!=null?this.pointOfInterest:this.view.center;return t.sort((o,n)=>_(i,o)-_(i,n)),t}_scaleEnabled(){return U(this.view.scale,this.layer.minScale||0,this.layer.maxScale||0)}get tilesCoveringView(){if(!this.view.ready||!this.view.featuresTilingScheme||!this.view.state||this.tileInfo==null)return[];if(!this._scaleEnabled)return[];const{spans:t,lodInfo:i}=this.view.featuresTilingScheme.getTileCoverage(this.view.state,0),{level:o}=i,n=[];for(const{row:l,colFrom:s,colTo:d}of t)for(let h=s;h<=d;h++){const v=i.normalizeCol(h),I=new H(null,o,l,v);this.tileInfo.updateTileInfo(I),n.push(I)}return n}get tileInfo(){var t;return((t=this.view.featuresTilingScheme)==null?void 0:t.tileInfo)??null}get tileSize(){return this.tileInfo!=null?this.tileInfo.size[0]:256}constructor(t){super(t),this.pointOfInterest=null}initialize(){this.addHandles(w(()=>{var t,i;return(i=(t=this.view)==null?void 0:t.state)==null?void 0:i.viewpoint},()=>this.notifyChange("tilesCoveringView"),F))}};a([r({readOnly:!0})],c.prototype,"tiles",null),a([r({readOnly:!0})],c.prototype,"_scaleEnabled",null),a([r({readOnly:!0})],c.prototype,"tilesCoveringView",null),a([r({readOnly:!0})],c.prototype,"tileInfo",null),a([r({readOnly:!0})],c.prototype,"tileSize",null),a([r({constructOnly:!0})],c.prototype,"view",void 0),a([r({constructOnly:!0})],c.prototype,"layer",void 0),a([r()],c.prototype,"pointOfInterest",void 0),c=a([S("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiles2D")],c);let y=class extends P{get tiles(){const t=this.tilesCoveringView,i=this._effectivePointOfInterest;if(i!=null){const o=t.map(n=>_(i,n));for(let n=1;no[n])return t.sort((l,s)=>_(i,l)-_(i,s)),t.slice()}return t}get tilesCoveringView(){var t,i;return this._filterTiles((i=(t=this.view.featureTiles)==null?void 0:t.tiles)==null?void 0:i.toArray()).map(oe)}get tileInfo(){var t;return((t=this.view.featureTiles)==null?void 0:t.tilingScheme.toTileInfo())??null}get tileSize(){var t;return((t=this.view.featureTiles)==null?void 0:t.tileSize)??256}get _effectivePointOfInterest(){var i;const t=this.pointOfInterest;return t??((i=this.view.pointsOfInterest)==null?void 0:i.focus.location)}constructor(t){super(t),this.pointOfInterest=null}initialize(){this.handles.add(w(()=>this.view.featureTiles,t=>{this.handles.remove(E),t&&this.handles.add(t.addClient(),E)},m))}_filterTiles(t){return t==null?[]:t.filter(i=>Math.abs(i.measures.screenRect[3]-i.measures.screenRect[1])>le&&i.measures.visibility===j.VISIBLE_ON_SURFACE)}};function oe({lij:[e,t,i],extent:o}){return new H(`${e}/${t}/${i}`,e,t,i,o)}a([r({readOnly:!0})],y.prototype,"tiles",null),a([r({readOnly:!0})],y.prototype,"tilesCoveringView",null),a([r({readOnly:!0})],y.prototype,"tileInfo",null),a([r({readOnly:!0})],y.prototype,"tileSize",null),a([r({constructOnly:!0})],y.prototype,"view",void 0),a([r()],y.prototype,"pointOfInterest",void 0),a([r()],y.prototype,"_effectivePointOfInterest",null),y=a([S("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiles3D")],y);const le=50,E="feature-tiles";let b=class extends re{constructor(e){super(e),this._handles=new A}initialize(){const e=setInterval(()=>this._fetchDebugInfo(),2e3);this._handles.add(V(()=>clearInterval(e)))}destroy(){this._handles.destroy()}getTiles(){if(!this._debugInfo)return[];const e=new Map,t=new Map;this._debugInfo.storedTiles.forEach(n=>{e.set(n.data.id,n.featureCount)}),this._debugInfo.pendingTiles.forEach(n=>{e.set(n.data.id,n.featureCount),t.set(n.data.id,n.state)});const i=n=>{const l=t.get(n),s=e.get(n)??"?";return l?`${l}:${s} +${n}`:`store:${s} +${n}`},o=new Map;return this._debugInfo.storedTiles.forEach(n=>{o.set(n.data.id,n.data)}),this._debugInfo.pendingTiles.forEach(n=>{o.set(n.data.id,n.data)}),Array.from(o.values()).map(n=>({lij:[n.level,n.row,n.col],geometry:D.fromExtent(J(n.extent,this.view.spatialReference)),label:i(n.id)}))}_fetchDebugInfo(){this.handle.getDebugInfo(null).then(e=>{this._debugInfo=e,this.update()})}};a([r({constructOnly:!0})],b.prototype,"handle",void 0),b=a([S("esri.views.interactive.snapping.featureSources.WorkerTileTreeDebugger")],b);let u=class extends P{get updating(){return this.updatingHandles.updating||this._workerHandleUpdating}constructor(e){super(e),this.schedule=null,this.hasZ=!1,this.elevationAlignPointsInFeatures=async t=>{const i=[];for(const{points:o}of t)for(const{z:n}of o)i.push(n);return{elevations:i,drapedObjectIds:new Set,failedObjectIds:new Set}},this.queryForSymbologySnapping=async()=>({candidates:[],sourceCandidateIndices:[]}),this.availability=0,this._workerHandleUpdating=!0,this._editId=0}destroy(){this._workerHandle.destroy()}initialize(){this._workerHandle=new de(this.schedule,{alignElevation:async(e,{signal:t})=>({result:await this.elevationAlignPointsInFeatures(e.points,t)}),getSymbologyCandidates:async(e,{signal:t})=>({result:await this.queryForSymbologySnapping(e,t)})}),this.handles.add([this._workerHandle.on("notify-updating",({updating:e})=>this._workerHandleUpdating=e),this._workerHandle.on("notify-availability",({availability:e})=>this._set("availability",e))])}async setup(e,t){var n;const i=this._serviceInfoFromLayer(e.layer);if(i==null)return;const o={configuration:this._convertConfiguration(e.configuration),serviceInfo:i,spatialReference:e.spatialReference.toJSON(),hasZ:this.hasZ,elevationInfo:(n=e.layer.elevationInfo)==null?void 0:n.toJSON()};await this.updatingHandles.addPromise(this._workerHandle.invokeMethod("setup",o,t)),this.updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async configure(e,t){const i=this._convertConfiguration(e);await this.updatingHandles.addPromise(this._workerHandle.invokeMethod("configure",i,t)),this.updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async refresh(e){await this.updatingHandles.addPromise(this._workerHandle.invokeMethod("refresh",{},e)),this.updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},e))}async fetchCandidates(e,t){const i=e.point,o={distance:e.distance,mode:e.mode,point:Z(i[0],i[1],i[2],e.coordinateHelper.spatialReference.toJSON()),returnEdge:e.returnEdge,returnVertex:e.returnVertex,filter:e.filter!=null?e.filter.toJSON():null};return this._workerHandle.invoke(o,t)}async updateTiles(e,t){const i={tiles:e.tiles,tileInfo:e.tileInfo!=null?e.tileInfo.toJSON():null,tileSize:e.tileSize};await this.updatingHandles.addPromise(this._workerHandle.invokeMethod("updateTiles",i,t)),this.updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async applyEdits(e,t){var s,d,h;const i=this._editId++,o={id:i};await this.updatingHandles.addPromise(this._workerHandle.invokeMethod("beginApplyEdits",o,t));const n=await this.updatingHandles.addPromise(L(e.result,t)),l={id:i,edits:{addedFeatures:((s=n.addedFeatures)==null?void 0:s.map(({objectId:v})=>v).filter(k))??[],deletedFeatures:((d=n.deletedFeatures)==null?void 0:d.map(({objectId:v,globalId:I})=>({objectId:v,globalId:I})))??[],updatedFeatures:((h=n.updatedFeatures)==null?void 0:h.map(({objectId:v})=>v).filter(k))??[]}};await this.updatingHandles.addPromise(this._workerHandle.invokeMethod("endApplyEdits",l,t)),this.updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}getDebugInfo(e){return this._workerHandle.invokeMethod("getDebugInfo",{},e)}async notifyElevationSourceChange(){await this._workerHandle.invokeMethod("notifyElevationSourceChange",{})}async notifySymbologyChange(){await this._workerHandle.invokeMethod("notifySymbologyChange",{})}async setSymbologySnappingSupported(e){await this._workerHandle.invokeMethod("setSymbologySnappingSupported",e)}_convertConfiguration(e){return{filter:e.filter!=null?e.filter.toJSON():null,customParameters:e.customParameters,viewType:e.viewType}}_serviceInfoFromLayer(e){var t,i;return e.geometryType==="multipatch"||e.geometryType==="mesh"?null:{url:((t=e.parsedUrl)==null?void 0:t.path)??"",fields:e.fields.map(o=>o.toJSON()),geometryType:q.toJSON(e.geometryType),capabilities:e.capabilities,objectIdField:e.objectIdField,globalIdField:e.globalIdField,spatialReference:e.spatialReference.toJSON(),timeInfo:(i=e.timeInfo)==null?void 0:i.toJSON()}}};a([r({constructOnly:!0})],u.prototype,"schedule",void 0),a([r({constructOnly:!0})],u.prototype,"hasZ",void 0),a([r({constructOnly:!0})],u.prototype,"elevationAlignPointsInFeatures",void 0),a([r({constructOnly:!0})],u.prototype,"queryForSymbologySnapping",void 0),a([r({readOnly:!0})],u.prototype,"updating",null),a([r({readOnly:!0})],u.prototype,"availability",void 0),a([r()],u.prototype,"_workerHandleUpdating",void 0),u=a([S("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorkerHandle")],u);class de extends G{constructor(t,i){super("FeatureServiceSnappingSourceWorker","fetchCandidates",{},t,{strategy:"dedicated",client:i})}}let g=class extends O{get tiles(){return[new H("0/0/0",0,0,0,W(-1e8,-1e8,1e8,1e8))]}get tileInfo(){return new B({origin:new X({x:-1e8,y:1e8,spatialReference:this.layer.spatialReference}),size:[512,512],lods:[new Q({level:0,scale:1,resolution:390625})],spatialReference:this.layer.spatialReference})}get tileSize(){return this.tileInfo.size[0]}constructor(e){super(e),this.pointOfInterest=null}};a([r({readOnly:!0})],g.prototype,"tiles",null),a([r({readOnly:!0})],g.prototype,"tileInfo",null),a([r({readOnly:!0})],g.prototype,"tileSize",null),a([r({constructOnly:!0})],g.prototype,"layer",void 0),a([r()],g.prototype,"pointOfInterest",void 0),g=a([S("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTilesSimple")],g);let p=class extends K(O){get _updateTilesParameters(){return{tiles:this._tilesOfInterest.tiles,tileInfo:this._tilesOfInterest.tileInfo,tileSize:this._tilesOfInterest.tileSize}}get updating(){var e;return((e=this._workerHandle)==null?void 0:e.updating)||this.updatingHandles.updating}get configuration(){const{view:e}=this,t=e!=null?e.type:"2d";return{filter:this._layer.createQuery(),customParameters:this._layer.customParameters,viewType:t}}get availability(){var e;return((e=this._workerHandle)==null?void 0:e.availability)??0}get _layer(){return this.layerSource.layer}constructor(e){super(e),this._workerHandle=null,this._debug=null}initialize(){let e;const t=this.view;if(t!=null)switch(t.type){case"2d":this._tilesOfInterest=new c({view:t,layer:this._layer}),e=this._workerHandle=new u;break;case"3d":{const{resourceController:i}=t,o=this._layer,n=t.whenLayerView(o);this._tilesOfInterest=new y({view:t}),e=this._workerHandle=new u({schedule:s=>i.immediate.schedule(s),hasZ:this._layer.hasZ&&(this._layer.returnZ??!0),elevationAlignPointsInFeatures:async(s,d)=>{const h=await n;return T(d),h.elevationAlignPointsInFeatures(s,d)},queryForSymbologySnapping:async(s,d)=>{const h=await n;return T(d),h.queryForSymbologySnapping(s,d)}});const l=te(null);n.then(s=>l.value=s),this.addHandles([t.elevationProvider.on("elevation-change",({context:s})=>{const{elevationInfo:d}=o;ie(s,d)&&f(e.notifyElevationSourceChange())}),w(()=>o.elevationInfo,()=>f(e.notifyElevationSourceChange()),m),w(()=>{var s,d;return(d=(s=l.value)==null?void 0:s.processor)==null?void 0:d.renderer},()=>f(e.notifySymbologyChange()),m),w(()=>{var s;return((s=l.value)==null?void 0:s.symbologySnappingSupported)??!1},s=>f(e.setSymbologySnappingSupported(s)),m),Y(()=>{var s;return(s=l.value)==null?void 0:s.layer},["edits","apply-edits","graphic-update"],()=>e.notifySymbologyChange())]);break}}else this._tilesOfInterest=new g({layer:this._layer}),e=this._workerHandle=new u;this.handles.add([$(e)]),f(e.setup({layer:this._layer,spatialReference:this.spatialReference,configuration:this.configuration},null)),this.updatingHandles.add(()=>this._updateTilesParameters,()=>f(e.updateTiles(this._updateTilesParameters,null)),m),this.handles.add([w(()=>this.configuration,i=>f(e.configure(i,null)),F)]),t!=null&&this.handles.add(w(()=>ee.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES,i=>{i&&!this._debug?(this._debug=new b({view:t,handle:e}),this.handles.add($(this._debug),"debug")):!i&&this._debug&&this.handles.remove("debug")},m)),this.handles.add(this.layerSource.layer.on("apply-edits",i=>{f(e.applyEdits(i,null))}))}refresh(){var e;(e=this._workerHandle)==null||e.refresh(null)}async fetchCandidates(e,t){const{coordinateHelper:i,point:o}=e;this._tilesOfInterest.pointOfInterest=i.arrayToPoint(o);const n=this._getGroundElevation;return(await this._workerHandle.fetchCandidates({...e},t)).candidates.map(l=>ne(l,n))}getDebugInfo(e){return this._workerHandle.getDebugInfo(e)}get _getGroundElevation(){return ae(this.view)}};a([r({constructOnly:!0})],p.prototype,"spatialReference",void 0),a([r({constructOnly:!0})],p.prototype,"layerSource",void 0),a([r({constructOnly:!0})],p.prototype,"view",void 0),a([r()],p.prototype,"_tilesOfInterest",void 0),a([r({readOnly:!0})],p.prototype,"_updateTilesParameters",null),a([r({readOnly:!0})],p.prototype,"updating",null),a([r({readOnly:!0})],p.prototype,"configuration",null),a([r({readOnly:!0})],p.prototype,"availability",null),a([r()],p.prototype,"_getGroundElevation",null),p=a([S("esri.views.interactive.snapping.featureSources.FeatureServiceSnappingSource")],p);export{p as FeatureServiceSnappingSource}; diff --git a/assets/FeatureServiceSnappingSourceWorker-19fe862a.js b/assets/FeatureServiceSnappingSourceWorker-19fe862a.js new file mode 100644 index 0000000..262f1c6 --- /dev/null +++ b/assets/FeatureServiceSnappingSourceWorker-19fe862a.js @@ -0,0 +1 @@ +import{ai as o,aj as l,al as v,ao as B,dz as j,aN as b,kT as A,dB as w,g4 as O,bm as L,kU as G,aH as k,cB as Z,ca as Q,as as W,bz as X,aS as Y,kV as K,kW as ee,aU as te,cb as ie,dy as se,bV as C,kX as re,kY as R,kZ as q,fJ as ne,cu as ae,cv as x,af as oe,ae as H,ax as _,bc as P,fR as le,aG as D,cT as ue}from"./index-080e108a.js";import{m as he}from"./FeatureStore-f0e312fc.js";import{e as ce}from"./QueryEngine-19eda5ff.js";import{b as F}from"./Query-1c961d4c.js";import{i as N,r as U,n as $}from"./symbologySnappingCandidates-816beafe.js";import{a as de}from"./pbfQueryUtils-26a87215.js";import{S as pe,c as fe,m as _e,p as ge}from"./query-93c6e211.js";import{o as ye}from"./BoundsStore-b6bd3c14.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./FieldsIndex-f79a8f26.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";let T=class extends B{constructor(){super(...arguments),this.updating=!1,this._pending=[]}push(e,i){this._pending.push({promise:e,callback:i}),this._pending.length===1&&this._process()}_process(){if(!this._pending.length)return void(this.updating=!1);this.updating=!0;const e=this._pending[0];e.promise.then(i=>e.callback(i)).catch(()=>{}).then(()=>{this._pending.shift(),this._process()})}};o([l()],T.prototype,"updating",void 0),T=o([v("esri.core.AsyncSequence")],T);class me{constructor(e,i){this.data=e,this.resolution=i,this.state={type:a.CREATED},this.alive=!0}process(e){switch(this.state.type){case a.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case a.FETCH_COUNT:break;case a.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case a.FETCH_FEATURES:break;case a.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case a.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case a.CREATED:case a.FETCH_COUNT:return 0;case a.FETCHED_COUNT:return this.state.featureCount;case a.FETCH_FEATURES:return this.state.previous.featureCount;case a.FETCHED_FEATURES:return this.state.features.length;case a.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case a.CREATED:return"created";case a.FETCH_COUNT:return"fetch-count";case a.FETCHED_COUNT:return"fetched-count";case a.FETCH_FEATURES:return"fetch-features";case a.FETCHED_FEATURES:return"fetched-features";case a.DONE:return"done"}}_gotoFetchCount(e,i){return{type:a.FETCH_COUNT,previous:e,task:b(async s=>{const r=await A(i.fetchCount(this,s));this.state.type===a.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,r.ok?r.value:1/0))})}}_gotoFetchedCount(e,i){return{type:a.FETCHED_COUNT,featureCount:i,previous:e}}_gotoFetchFeatures(e,i){return{type:a.FETCH_FEATURES,previous:e,task:b(async s=>{const r=await A(i.fetchFeatures(this,e.featureCount,s));this.state.type===a.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,r.ok?r.value:[]))})}}_gotoFetchedFeatures(e,i){return{type:a.FETCHED_FEATURES,previous:e,features:i}}_goToDone(e,i){return i.finish(this,e.features),{type:a.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:a.CREATED},e.type){case a.CREATED:case a.FETCHED_COUNT:case a.FETCHED_FEATURES:case a.DONE:break;case a.FETCH_COUNT:case a.FETCH_FEATURES:e.task.abort()}}intersects(e){return e==null||!this.data.extent||(w(e,M),O(this.data.extent,M))}}var a;(function(t){t[t.CREATED=0]="CREATED",t[t.FETCH_COUNT=1]="FETCH_COUNT",t[t.FETCHED_COUNT=2]="FETCHED_COUNT",t[t.FETCH_FEATURES=3]="FETCH_FEATURES",t[t.FETCHED_FEATURES=4]="FETCHED_FEATURES",t[t.DONE=5]="DONE"})(a||(a={}));const M=j();let h=class extends L{get _minimumVerticesPerFeature(){var e;switch((e=this.store)==null?void 0:e.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}set filter(e){const i=this._get("filter"),s=this._filterProperties(e);JSON.stringify(i)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const i=this._get("customParameters");JSON.stringify(i)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const i=this._get("tileInfo");i!==e&&(e!=null&&i!=null&&JSON.stringify(e)===JSON.stringify(i)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this.updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._pendingEdits=new T,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this.updatingHandles.add(()=>this._configuration,()=>this.refresh()),this.updatingHandles.add(()=>this.tilesOfInterest,(e,i)=>{G(e,i,({id:s},{id:r})=>s===r)||this._process()},k)}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}applyEdits(e){this._pendingEdits.push(e,async i=>{if(i.addedFeatures.length===0&&i.updatedFeatures.length===0&&i.deletedFeatures.length===0)return;for(const[,r]of this._pendingTiles)r.reset();const s={...i,deletedFeatures:i.deletedFeatures.map(({objectId:r,globalId:n})=>r&&r!==-1?r:this._lookupObjectIdByGlobalId(n))};await this.updatingHandles.addPromise(this.store.processEdits(s,(r,n)=>this._queryFeaturesById(r,n),this._pendingEditsAbortController.signal)),this._processPendingTiles()})}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!Z(this.url))return;const e=b(async i=>{var s;try{const r=await pe(this.url,new F({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:i});this.store.extent=Q.fromJSON((s=r.data)==null?void 0:s.extent)}catch(r){W(r),X.getLogger(this).warn("Failed to fetch data extent",r)}});this.updatingHandles.addPromise(e.promise.then(()=>this._process())),this.handles.add(Y(()=>e.abort()))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this._pendingTiles)e.alive=!1}_createPendingTiles(){const e=this._collectMissingTilesInfo();if(this._setAvailability(e==null?1:e.coveredArea/e.fullArea),e!=null)for(const{data:i,resolution:s}of e.missingTiles){const r=this._pendingTiles.get(i.id);r?(r.resolution=s,r.alive=!0):this._createPendingTile(i,s)}}_collectMissingTilesInfo(){let e=null;for(let i=this.tilesOfInterest.length-1;i>=0;i--){const s=this.tilesOfInterest[i],r=this.store.process(s,(n,u)=>this._verifyTileComplexity(n,u));e==null?e=r:e.prepend(r)}return e}_deletePendingTiles(){for(const[,e]of this._pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(i,s)=>this._fetchCount(i,s),fetchFeatures:(i,s,r)=>this._fetchFeatures(i,s,r),finish:(i,s)=>this._finishPendingTile(i,s),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,i]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(i.data),i.resolution)&&this.updatingHandles.addPromise(i.process(e))}_verifyTileComplexity(e,i){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,i)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature{e===n.attributes[i]&&(r=n.objectId??n.attributes[s])}),r==null)throw new Error(`Expected to find a feature with globalId ${e}`);return r}_queryFeaturesById(e,i){const s=this._createFeaturesQuery();return s.objectIds=e,this._queryFeatures(s,i)}_queryFeatures(e,i){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,i):this._queryFeaturesJSON(e,i)}async _queryFeaturesPBF(e,i){const{sourceSpatialReference:s}=this,{data:r}=await fe(this.url,e,new de({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:S,signal:i});return K(r)}async _queryFeaturesJSON(e,i){const{sourceSpatialReference:s}=this,{data:r}=await _e(this.url,e,s,{query:this._configuration.customParameters,timeout:S,signal:i});return ee(r,this.objectIdField)}_createCountQuery(e){const i=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(i.cacheHint=!0),i}_createFeaturesQuery(e=null){const i=this._createBaseQuery(e);return i.outFields=this.globalIdField?[this.globalIdField,this.objectIdField]:[this.objectIdField],i.returnGeometry=!0,e!=null&&(this.capabilities.query.supportsResultType?i.resultType="tile":this.capabilities.query.supportsCacheHint&&(i.cacheHint=!0)),i}_createBaseQuery(e){const i=new F({returnZ:this.hasZ,returnM:!1,geometry:this.tileInfo!=null&&e!=null?te(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return s!=null&&(i.where=s.where,i.gdbVersion=s.gdbVersion,i.timeExtent=s.timeExtent),i.outSpatialReference=this.spatialReference,i}_setPagingParameters(e,i,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:r,supportsCacheHint:n,tileMaxRecordCount:u,maxRecordCount:p,supportsResultType:c}=this.capabilities.query,d=r?F.MAX_MAX_RECORD_COUNT_FACTOR:1,f=d*((c||n)&&u?u:p||Ee);return e.start=i,r?(e.maxRecordCountFactor=Math.min(d,Math.ceil(s/f)),e.num=Math.min(s,e.maxRecordCountFactor*f)):e.num=Math.min(s,f),!0}};o([l({constructOnly:!0})],h.prototype,"url",void 0),o([l({constructOnly:!0})],h.prototype,"objectIdField",void 0),o([l({constructOnly:!0})],h.prototype,"globalIdField",void 0),o([l({constructOnly:!0})],h.prototype,"capabilities",void 0),o([l({constructOnly:!0})],h.prototype,"sourceSpatialReference",void 0),o([l({constructOnly:!0})],h.prototype,"spatialReference",void 0),o([l({constructOnly:!0})],h.prototype,"store",void 0),o([l({readOnly:!0})],h.prototype,"_minimumVerticesPerFeature",null),o([l()],h.prototype,"filter",null),o([l()],h.prototype,"customParameters",null),o([l({readOnly:!0})],h.prototype,"_configuration",null),o([l()],h.prototype,"tileInfo",null),o([l()],h.prototype,"tileSize",null),o([l()],h.prototype,"tilesOfInterest",void 0),o([l({readOnly:!0})],h.prototype,"updating",null),o([l({readOnly:!0})],h.prototype,"updatingExcludingEdits",null),o([l({readOnly:!0})],h.prototype,"availability",void 0),o([l()],h.prototype,"hasZ",null),h=o([v("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],h);const Ee=2e3,S=6e5,Fe=1e6,Te=25,Ce=1;class ve{constructor(){this._store=new Map,this._byteSize=0}set(e,i){this.delete(e),this._store.set(e,i),this._byteSize+=i.byteSize}delete(e){const i=this._store.get(e);return!!this._store.delete(e)&&(i!=null&&(this._byteSize-=i.byteSize),!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,i){for(const[s,r]of this._store){if(this._byteSize<=e)break;this.delete(s),i(r)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const i=this._store.get(e);i&&(this._store.delete(e),this._store.set(e,i))}}let m=class extends B{constructor(t){super(t),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*ie.MEGABYTES,this._tileBounds=new ye,this._tiles=new ve,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=j()}add(t,e){const i=[];for(const s of e)this._referenceFeature(s.objectId)===y.ADDED&&i.push(s);this._addTileStorage(t,new Set(e.map(s=>s.objectId)),Se(e)),this.featureStore.addMany(i),this._tiles.applyByteSizeLimit(this.maximumByteSize,s=>this._removeTileStorage(s))}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(t,e,i){return this._processEditsDelete(t.deletedFeatures.concat(t.updatedFeatures)),this._processEditsRefetch(t.addedFeatures.concat(t.updatedFeatures),e,i)}_addTileStorage(t,e,i){const s=t.id;this._tiles.set(s,new we(t,e,i)),this._tileBounds.set(s,t.extent),this._tileFeatureCounts.set(s,e.size)}_remove({id:t}){const e=this._tiles.get(t);e&&this._removeTileStorage(e)}_removeTileStorage(t){const e=[];for(const s of t.objectIds)this._unreferenceFeature(s)===y.REMOVED&&e.push(s);this.featureStore.removeManyById(e);const i=t.data.id;this._tiles.delete(i),this._tileBounds.delete(i)}_processEditsDelete(t){this.featureStore.removeManyById(t);for(const[,e]of this._tiles){for(const i of t)e.objectIds.delete(i);this._tileFeatureCounts.set(e.data.id,e.objectIds.size)}for(const e of t)this._refCounts.delete(e)}async _processEditsRefetch(t,e,i){const s=(await e(t,i)).features,{hasZ:r,hasM:n}=this.featureStore;for(const u of s){const p=se(this._tmpBoundingRect,u.geometry,r,n);p!=null&&this._tileBounds.forEachInBounds(p,c=>{const d=this._tiles.get(c);this.featureStore.add(u);const f=u.objectId;d.objectIds.has(f)||(d.objectIds.add(f),this._referenceFeature(f),this._tileFeatureCounts.set(d.data.id,d.objectIds.size))})}}process(t,e=()=>!0){if(this.tileInfo==null||!t.extent||this.extent!=null&&!O(w(this.extent,this._tmpBoundingRect),t.extent))return new I(t);if(this._tiles.has(t.id))return new I(t);const i=this._createTileTree(t,this.tileInfo);return this._simplify(i,e,null,0,1),this._collectMissingTiles(t,i,this.tileInfo)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:t})=>({data:t,featureCount:this._tileFeatureCounts.get(t.id)||0}))}getFeatureCount(t){return this._tileFeatureCounts.get(t.id)??0}async fetchCount(t,e,i,s){const r=this._tileFeatureCounts.get(t.id);if(r!=null)return r;const n=await ge(e,i,s);return this._tileFeatureCounts.set(t.id,n.data.count),n.data.count}_createTileTree(t,e){const i=new z(t.level,t.row,t.col);return e.updateTileInfo(i,C.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(t.extent,s=>{var n;const r=(n=this._tiles.get(s))==null?void 0:n.data;r&&this._tilesAreRelated(t,r)&&this._populateChildren(i,r,e,this._tileFeatureCounts.get(r.id)||0)}),i}_tilesAreRelated(t,e){if(!t||!e)return!1;if(t.level===e.level)return t.row===e.row&&t.col===e.col;const i=t.level>r,u=e.col>>r,p=t.row<<1,c=u-(t.col<<1)+(n-p<<1),d=t.children[c];if(d!=null)this._populateChildren(d,e,i,s);else{const f=new z(t.level+1,n,u);i.updateTileInfo(f,C.ExtrapolateOptions.POWER_OF_TWO),t.children[c]=f,this._populateChildren(f,e,i,s)}}_simplify(t,e,i,s,r){const n=r*r;if(t.isLeaf)return e(this.getFeatureCount(t),r)?0:(this._remove(t),i!=null&&(i.children[s]=null),n);const u=r/2,p=u*u;let c=0;for(let d=0;d{const r=this._tiles.get(s.id);if(r){i+=r.byteSize;for(const n of r.objectIds)e.has(n)||(e.add(n),this._referenceFeature(n));this._remove(s)}}),this._addTileStorage(t,e,i),t.isLeaf=!0,t.children[0]=t.children[1]=t.children[2]=t.children[3]=null,this._tileFeatureCounts.set(t.id,e.size)}_forEachLeaf(t,e){for(const i of t.children)i!=null&&(i.isLeaf?e(i):this._forEachLeaf(i,e))}_purge(t){if(t!=null)if(t.isLeaf)this._remove(t);else for(let e=0;e>1),(t.col<<1)+(1&r),s):this._collectMissingTilesRecurse(n,e,s)}}_referenceFeature(t){const e=(this._refCounts.get(t)||0)+1;return this._refCounts.set(t,e),e===1?y.ADDED:y.UNCHANGED}_unreferenceFeature(t){const e=(this._refCounts.get(t)||0)-1;return e===0?(this._refCounts.delete(t),y.REMOVED):(e>0&&this._refCounts.set(t,e),y.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map(t=>`${t.data.id}:[${Array.from(t.objectIds)}]`),featureReferences:Array.from(this._refCounts.keys()).map(t=>`${t}:${this._refCounts.get(t)}`)}}};function Se(t){return t.reduce((e,i)=>e+be(i),0)}function be(t){return 32+Ie(t.geometry)+re(t.attributes)}function Ie(t){if(t==null)return 0;const e=R(t.lengths,4);return 32+R(t.coords,8)+e}o([l({constructOnly:!0})],m.prototype,"featureStore",void 0),o([l()],m.prototype,"tileInfo",void 0),o([l()],m.prototype,"extent",void 0),o([l()],m.prototype,"maximumByteSize",void 0),m=o([v("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],m);let we=class{constructor(e,i,s){this.data=e,this.objectIds=i,this.byteSize=s}};class z{constructor(e,i,s){this.level=e,this.row=i,this.col=s,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(this.children[0]!=null||this.children[1]!=null||this.children[2]!=null||this.children[3]!=null)}}class I{constructor(e,i=[]){this.missingTiles=i,this.fullArea=0,this.coveredArea=0,this.fullArea=q(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class Oe{constructor(e,i,s){this._tileInfo=e,this._extent=null,this.info=new I(i),s!=null&&(this._extent=w(s))}addMissing(e,i,s,r){const n=new ne(null,e,i,s);this._tileInfo.updateTileInfo(n,C.ExtrapolateOptions.POWER_OF_TWO),n.extent==null||this._extent!=null&&!O(this._extent,n.extent)||(this.info.missingTiles.push({data:n,resolution:r}),this.info.coveredArea-=q(n.extent))}}const Ae=.18751;var y;(function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.UNCHANGED=2]="UNCHANGED"})(y||(y={}));let E=class extends ae.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=x(),this._elevationAligner=N(),this._elevationFilter=U(),this._symbologyCandidatesFetcher=$(),this._handles=new oe,this._updatingHandles=new H,this._editsUpdatingHandles=new H,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(t,e)=>{const i={points:t},s=await this.remoteClient.invoke("alignElevation",i,{signal:e});return _(e),s},this._getSymbologyCandidates=async(t,e)=>{const i={candidates:t,spatialReference:this._spatialReference.toJSON()},s=await this.remoteClient.invoke("getSymbologyCandidates",i,{signal:e});return _(e),s}}get updating(){return this.updatingExcludingEdits||this._editsUpdatingHandles.updating||this._featureFetcher.updating}get updatingExcludingEdits(){return this._featureFetcher.updatingExcludingEdits||this._isInitializing||this._updatingHandles.updating}destroy(){var t,e,i,s;(t=this._featureFetcher)==null||t.destroy(),(e=this._queryEngine)==null||e.destroy(),(i=this._featureStore)==null||i.clear(),(s=this._handles)==null||s.destroy()}async setup(t){if(this.destroyed)return{result:{}};const{geometryType:e,objectIdField:i,timeInfo:s,fields:r}=t.serviceInfo,{hasZ:n}=t,u=P.fromJSON(t.spatialReference);this._spatialReference=u,this._featureStore=new he({...t.serviceInfo,hasZ:n,hasM:!1}),this._queryEngine=new ce({spatialReference:t.spatialReference,featureStore:this._featureStore,geometryType:e,fields:r,hasZ:n,hasM:!1,objectIdField:i,timeInfo:s}),this._featureFetcher=new h({store:new m({featureStore:this._featureStore}),url:t.serviceInfo.url,objectIdField:t.serviceInfo.objectIdField,globalIdField:t.serviceInfo.globalIdField,capabilities:t.serviceInfo.capabilities,spatialReference:u,sourceSpatialReference:P.fromJSON(t.serviceInfo.spatialReference)});const p=t.configuration.viewType==="3d";return this._elevationAligner=N(p,{elevationInfo:t.elevationInfo!=null?le.fromJSON(t.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures,spatialReference:u}),this._elevationFilter=U(p),this._handles.add([D(()=>this._featureFetcher.availability,c=>this.emit("notify-availability",{availability:c}),k),D(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(t.configuration)}async configure(t){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(t),{result:{}}}async fetchCandidates(t,e){await this._whenSetup.promise,_(e);const i=Re(t),s=e!=null?e.signal:null,r=await this._queryEngine.executeQueryForSnapping(i,s);_(s);const n=await this._elevationAligner.alignCandidates(r.candidates,s);_(s);const u=await this._symbologyCandidatesFetcher.fetch(n,s);_(s);const p=u.length===0?n:n.concat(u);return{result:{candidates:this._elevationFilter.filter(i,p)}}}async updateTiles(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),_(e),this._featureFetcher.tileSize=t.tileSize,this._featureFetcher.tilesOfInterest=t.tiles,this._featureFetcher.tileInfo=t.tileInfo!=null?C.fromJSON(t.tileInfo):null,g}async refresh(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),_(e),this._featureFetcher.refresh(),g}async whenNotUpdating(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),_(e),await ue(()=>!this.updatingExcludingEdits,e),_(e),g}async getDebugInfo(t,e){return _(e),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(t,e){this._updatingHandles.addPromise(this._whenSetup.promise),_(e);const i=x();return this._pendingApplyEdits.set(t.id,i),this._featureFetcher.applyEdits(i.promise),this._editsUpdatingHandles.addPromise(i.promise),g}async endApplyEdits(t,e){const i=this._pendingApplyEdits.get(t.id);return i&&i.resolve(t.edits),_(e),g}async notifyElevationSourceChange(t,e){return this._elevationAligner.notifyElevationSourceChange(),g}async notifySymbologyChange(t,e){return this._symbologyCandidatesFetcher.notifySymbologyChange(),g}async setSymbologySnappingSupported(t){return this._symbologyCandidatesFetcher=$(t,this._getSymbologyCandidates),g}_updateFeatureFetcherConfiguration(t){this._featureFetcher.filter=t.filter!=null?F.fromJSON(t.filter):null,this._featureFetcher.customParameters=t.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};o([l({readOnly:!0})],E.prototype,"updating",null),o([l({readOnly:!0})],E.prototype,"updatingExcludingEdits",null),o([l()],E.prototype,"_isInitializing",void 0),E=o([v("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],E);const st=E;function Re(t){return{point:t.point,mode:t.mode,distance:t.distance,returnEdge:t.returnEdge,returnVertex:t.returnVertex,query:t.filter!=null?t.filter:{where:"1=1"}}}const g={result:{}};export{st as default}; diff --git a/assets/FeatureSet-111cb247.js b/assets/FeatureSet-111cb247.js new file mode 100644 index 0000000..755075e --- /dev/null +++ b/assets/FeatureSet-111cb247.js @@ -0,0 +1 @@ +import{cp as j,ai as h,aj as d,aK as S,ay as T,cq as q,bY as N,cr as F,bc as w,al as P,ck as J,cs as O,cl as M,ct as v}from"./index-080e108a.js";var G;const z=new j({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let m=G=class extends J{constructor(r){super(r),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(r,a){const o=w.fromJSON(a.spatialReference),e=[];for(let s=0;s0)for(let o=0;oMath.round((n-e)/a),i=n=>Math.round((s-n)/o),c=this.features,u=this._getQuantizationFunction(this.geometryType,t,i);for(let n=0,p=c.length;ny*t+e,u=y=>s-y*i;let n=null,p=null;if(this.hasZ&&((f=o==null?void 0:o.scale)==null?void 0:f[2])!=null){const{translate:[,,y],scale:[,,R]}=o;n=x=>x*R+y}if(this.hasM&&((g=o==null?void 0:o.scale)==null?void 0:g[3])!=null){const{translate:[,,,y],scale:[,,,R]}=o;p=x=>x==null?x:x*R+y}const l=this._getHydrationFunction(r,c,u,n,p);for(const{geometry:y}of a)y!=null&&l&&l(y);return this.transform=null,this}_quantizePoints(r,a,o){let e,s;const t=[];for(let i=0,c=r.length;i0){const n=a(u[0]),p=o(u[1]);n===e&&p===s||(t.push([n-e,p-s]),e=n,s=p)}else e=a(u[0]),s=o(u[1]),t.push([e,s])}return t.length>0?t:null}_getQuantizationFunction(r,a,o){return r==="point"?e=>(e.x=a(e.x),e.y=o(e.y),e):r==="polyline"||r==="polygon"?e=>{const s=v(e)?e.rings:e.paths,t=[];for(let i=0,c=s.length;i0?(v(e)?e.rings=t:e.paths=t,e):null}:r==="multipoint"?e=>{const s=this._quantizePoints(e.points,a,o);return s&&s.length>0?(e.points=s,e):null}:r==="extent"?e=>e:null}_getHydrationFunction(r,a,o,e,s){return r==="point"?t=>{t.x=a(t.x),t.y=o(t.y),e&&(t.z=e(t.z))}:r==="polyline"||r==="polygon"?t=>{const i=v(t)?t.rings:t.paths;let c,u;for(let n=0,p=i.length;n0?(c+=y[0],u+=y[1]):(c=y[0],u=y[1]),y[0]=a(c),y[1]=o(u)}}if(e&&s)for(let n=0,p=i.length;n{t.xmin=a(t.xmin),t.ymin=o(t.ymin),t.xmax=a(t.xmax),t.ymax=o(t.ymax),e&&t.zmax!=null&&t.zmin!=null&&(t.zmax=e(t.zmax),t.zmin=e(t.zmin)),s&&t.mmax!=null&&t.mmin!=null&&(t.mmax=s(t.mmax),t.mmin=s(t.mmin))}:r==="multipoint"?t=>{const i=t.points;let c,u;for(let n=0,p=i.length;n0?(c+=l[0],u+=l[1]):(c=l[0],u=l[1]),l[0]=a(c),l[1]=o(u)}if(e&&s)for(let n=0,p=i.length;n({enabled:r})}}})],m.prototype,"exceededTransferLimit",void 0),h([d({type:[S],json:{write:!0}})],m.prototype,"features",void 0),h([T("features")],m.prototype,"readFeatures",null),h([d({type:[q],json:{write:!0}})],m.prototype,"fields",void 0),h([d({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:z.read}}})],m.prototype,"geometryType",void 0),h([N("geometryType")],m.prototype,"writeGeometryType",null),h([d({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],m.prototype,"hasM",void 0),h([d({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],m.prototype,"hasZ",void 0),h([d({types:F,json:{write:!0}})],m.prototype,"queryGeometry",void 0),h([T("queryGeometry")],m.prototype,"readQueryGeometry",null),h([d({type:w,json:{write:!0}})],m.prototype,"spatialReference",void 0),h([N("spatialReference")],m.prototype,"writeSpatialReference",null),h([d({json:{write:!0}})],m.prototype,"transform",void 0),m=G=h([P("esri.rest.support.FeatureSet")],m),m.prototype.toJSON.isDefaultToJSON=!0;const $=m;export{$ as d}; diff --git a/assets/FeatureStore-f0e312fc.js b/assets/FeatureStore-f0e312fc.js new file mode 100644 index 0000000..c51ca6c --- /dev/null +++ b/assets/FeatureStore-f0e312fc.js @@ -0,0 +1 @@ +import{dw as a,cu as i,dx as d,bz as n,ar as h,dy as u,dz as f}from"./index-080e108a.js";import{o as l}from"./BoundsStore-b6bd3c14.js";import{o as m}from"./optimizedFeatureQueryEngineAdapter-58185a60.js";import{Z as _}from"./QueryEngine-19eda5ff.js";const g=a();class b{constructor(e){this.geometryInfo=e,this._boundsStore=new l,this._featuresById=new Map,this._markedIds=new Set,this.events=new i,this.featureAdapter=m}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach(t=>{t.geometry!=null&&t.geometry.coords&&(e+=t.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(this.fullBounds==null)return null;const[t,s,r,o]=this.fullBounds;return{xmin:t,ymin:s,xmax:r,ymax:o,spatialReference:_(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const s=this._featuresById.get(t);s&&this._remove(s)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const r=this._boundsStore.get(s.objectId);r&&t(d(g,r))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,s=>{t(this._featuresById.get(s))})}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))}),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(t==null)return void n.getLogger("esri.layers.graphics.data.FeatureStore").error(new h("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let r;if(this._markedIds.add(t),s?(e.displayId=s.displayId,r=this._boundsStore.get(t),this._boundsStore.delete(t)):this.onFeatureAdd!=null&&this.onFeatureAdd(e),e.geometry==null||!e.geometry.coords||!e.geometry.coords.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);r=u(r??f(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),r!=null&&this._boundsStore.set(t,r),this._featuresById.set(t,e)}_remove(e){this.onFeatureRemove!=null&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}export{b as m}; diff --git a/assets/FeatureTemplate-2a7e96c1.js b/assets/FeatureTemplate-2a7e96c1.js new file mode 100644 index 0000000..1c43720 --- /dev/null +++ b/assets/FeatureTemplate-2a7e96c1.js @@ -0,0 +1 @@ +import{cp as l,cz as a,ai as o,aj as r,al as s,ck as n}from"./index-080e108a.js";const t=new l({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let e=class extends a(n){constructor(i){super(i),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};o([r({json:{write:!0}})],e.prototype,"name",void 0),o([r({json:{write:!0}})],e.prototype,"description",void 0),o([r({json:{read:t.read,write:t.write}})],e.prototype,"drawingTool",void 0),o([r({json:{write:!0}})],e.prototype,"prototype",void 0),o([r({json:{write:!0}})],e.prototype,"thumbnail",void 0),e=o([s("esri.layers.support.FeatureTemplate")],e);const d=e;export{d as p}; diff --git a/assets/FeatureTileTree3DDebugger-3e47616a.js b/assets/FeatureTileTree3DDebugger-3e47616a.js new file mode 100644 index 0000000..9a6fdcd --- /dev/null +++ b/assets/FeatureTileTree3DDebugger-3e47616a.js @@ -0,0 +1 @@ +import{ae as d,af as l,ag as h,ah as g,ai as i,aj as s,ak as p,al as c}from"./index-080e108a.js";import{y as u}from"./TileTreeDebugger-142b9f39.js";let a=class extends u{get updating(){var t;return((t=this._watchUpdatingTracking)==null?void 0:t.updating)??!1}constructor(t){super(t),this._watchUpdatingTracking=new d,this._handles=new l}initialize(){const{featureTiles:t}=this.view;this._handles.add(t.addClient()),this._watchUpdatingTracking.addOnCollectionChange(()=>t==null?void 0:t.tiles,()=>this.update(),h)}destroy(){this._handles=g(this._handles),this._watchUpdatingTracking.destroy()}getTiles(){const t=e=>{const[r,n,o]=e.lij;return p.fromExtent(this.view.featureTiles.tilingScheme.getExtentGeometry(r,n,o))};return this.view.featureTiles.tiles.toArray().sort((e,r)=>e.loadPriority-r.loadPriority).map(e=>({...e,geometry:t(e)}))}};i([s()],a.prototype,"_watchUpdatingTracking",void 0),i([s()],a.prototype,"updating",null),i([s()],a.prototype,"view",void 0),a=i([c("esri.views.3d.layers.support.FeatureTileTree3DDebugger")],a);export{a as FeatureTileTree3DDebugger}; diff --git a/assets/FeatureType-db96032c.js b/assets/FeatureType-db96032c.js new file mode 100644 index 0000000..8352e39 --- /dev/null +++ b/assets/FeatureType-db96032c.js @@ -0,0 +1 @@ +import{cz as p,cA as l,ai as s,aj as a,ay as m,bY as c,al as d,ck as y}from"./index-080e108a.js";import{p as u}from"./FeatureTemplate-2a7e96c1.js";let t=class extends p(y){constructor(o){super(o),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(o){const r={};for(const e of Object.keys(o))r[e]=l(o[e]);return r}writeDomains(o,r){var n;const e={};for(const i of Object.keys(o))o[i]&&(e[i]=(n=o[i])==null?void 0:n.toJSON());r.domains=e}};s([a({json:{write:!0}})],t.prototype,"id",void 0),s([a({json:{write:!0}})],t.prototype,"name",void 0),s([a({json:{write:!0}})],t.prototype,"domains",void 0),s([m("domains")],t.prototype,"readDomains",null),s([c("domains")],t.prototype,"writeDomains",null),s([a({type:[u],json:{write:!0}})],t.prototype,"templates",void 0),t=s([d("esri.layers.support.FeatureType")],t);const w=t;export{w as n}; diff --git a/assets/FetchAssociatedFeatureLayer-15c90b75.js b/assets/FetchAssociatedFeatureLayer-15c90b75.js new file mode 100644 index 0000000..f07606a --- /dev/null +++ b/assets/FetchAssociatedFeatureLayer-15c90b75.js @@ -0,0 +1 @@ +import{at as c,c0 as f,as as u,b5 as p,b9 as g}from"./index-080e108a.js";import y from"./FeatureLayer-5c6d2c3b.js";class P{constructor(t,r,e,s){var n;this._parsedUrl=t,this._portalItem=r,this._apiKey=e,this.signal=s,this._rootDocument=null;const a=(n=this._parsedUrl)==null?void 0:n.path.match(/^(.*)\/SceneServer\/layers\/([\d]*)\/?$/i);a&&(this._urlParts={root:a[1],layerId:parseInt(a[2],10)})}async fetch(){if(!this._urlParts)return null;const t=this._portalItem??await this._portalItemFromServiceItemId();if(t==null)return this._loadFromUrl();const r=await this._findAndLoadRelatedPortalItem(t);return r==null?null:this._loadFeatureLayerFromPortalItem(r)}async fetchPortalItem(){if(!this._urlParts)return null;const t=this._portalItem??await this._portalItemFromServiceItemId();return t==null?null:this._findAndLoadRelatedPortalItem(t)}async _fetchRootDocument(){if(this._rootDocument!=null)return this._rootDocument;if(this._urlParts==null)return this._rootDocument={},{};const t={query:{f:"json",token:this._apiKey},responseType:"json",signal:this.signal},r=`${this._urlParts.root}/SceneServer`;try{const e=await c(r,t);this._rootDocument=e.data}catch{this._rootDocument={}}return this._rootDocument}async _fetchServiceOwningPortalUrl(){var s,a;const t=(s=this._parsedUrl)==null?void 0:s.path,r=t?(a=f)==null?void 0:a.findServerInfo(t):null;if(r!=null&&r.owningSystemUrl)return r.owningSystemUrl;const e=t?t.replace(/(.*\/rest)\/.*/i,"$1")+"/info":null;try{const n=(await c(e,{query:{f:"json"},responseType:"json",signal:this.signal})).data.owningSystemUrl;if(n)return n}catch(n){u(n)}return null}async _findAndLoadRelatedPortalItem(t){try{return(await t.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:this.signal})).find(r=>r.type==="Feature Service")||null}catch(r){return u(r),null}}async _loadFeatureLayerFromPortalItem(t){await t.load({signal:this.signal});const r=await this._findMatchingAssociatedSublayerUrl(t.url??"");return new y({url:r,portalItem:t}).load({signal:this.signal})}async _loadFromUrl(){var r;const t=await this._findMatchingAssociatedSublayerUrl(`${(r=this._urlParts)==null?void 0:r.root}/FeatureServer`);return new y({url:t}).load({signal:this.signal})}async _findMatchingAssociatedSublayerUrl(t){var m;const r=t.replace(/^(.*FeatureServer)(\/[\d]*\/?)?$/i,"$1"),e=(m=this._urlParts)==null?void 0:m.layerId,s=this._fetchRootDocument(),a=i=>{const _={query:{f:"json"},responseType:"json",authMode:i,signal:this.signal};return c(r,_)},n=a("anonymous").catch(()=>a("no-prompt")),[h,d]=await Promise.all([n,s]),o=d&&d.layers,l=h.data&&h.data.layers;if(!Array.isArray(l))throw new Error("expected layers array");if(Array.isArray(o)){for(let i=0;it.concat(e,e+"-"+pt[0],e+"-"+pt[1]),[]),X=Math.min,_=Math.max,Q=Math.round,K=Math.floor,W=t=>({x:t,y:t}),Xt={left:"right",right:"left",bottom:"top",top:"bottom"},Yt={start:"end",end:"start"};function lt(t,e,n){return _(t,X(e,n))}function z(t,e){return typeof t=="function"?t(e):t}function M(t){return t.split("-")[0]}function D(t){return t.split("-")[1]}function Dt(t){return t==="x"?"y":"x"}function ut(t){return t==="y"?"height":"width"}function it(t){return["top","bottom"].includes(M(t))?"y":"x"}function dt(t){return Dt(it(t))}function Ft(t,e,n){n===void 0&&(n=!1);const i=D(t),o=dt(t),s=ut(o);let r=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=J(r)),[r,J(r)]}function qt(t){const e=J(t);return[Z(t),e,Z(e)]}function Z(t){return t.replace(/start|end/g,e=>Yt[e])}function Gt(t,e,n){const i=["left","right"],o=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:i:e?i:o;case"left":case"right":return e?s:r;default:return[]}}function Kt(t,e,n,i){const o=D(t);let s=Gt(M(t),n==="start",i);return o&&(s=s.map(r=>r+"-"+o),e&&(s=s.concat(s.map(Z)))),s}function J(t){return t.replace(/left|right|bottom|top/g,e=>Xt[e])}function Qt(t){return{top:0,right:0,bottom:0,left:0,...t}}function kt(t){return typeof t!="number"?Qt(t):{top:t,right:t,bottom:t,left:t}}function tt(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function yt(t,e,n){let{reference:i,floating:o}=t;const s=it(e),r=dt(e),c=ut(r),l=M(e),a=s==="y",d=i.x+i.width/2-o.width/2,u=i.y+i.height/2-o.height/2,g=i[c]/2-o[c]/2;let f;switch(l){case"top":f={x:d,y:i.y-o.height};break;case"bottom":f={x:d,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:u};break;case"left":f={x:i.x-o.width,y:u};break;default:f={x:i.x,y:i.y}}switch(D(e)){case"start":f[r]-=g*(n&&a?-1:1);break;case"end":f[r]+=g*(n&&a?-1:1);break}return f}const Zt=async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:r}=n,c=s.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(e));let a=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:u}=yt(a,i,l),g=i,f={},m=0;for(let p=0;p({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:o,rects:s,platform:r,elements:c}=e,{element:l,padding:a=0}=z(t,e)||{};if(l==null)return{};const d=kt(a),u={x:n,y:i},g=dt(o),f=ut(g),m=await r.getDimensions(l),p=g==="y",x=p?"top":"left",h=p?"bottom":"right",w=p?"clientHeight":"clientWidth",v=s.reference[f]+s.reference[g]-u[g]-s.floating[f],A=u[g]-s.reference[g],y=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l));let b=y?y[w]:0;(!b||!await(r.isElement==null?void 0:r.isElement(y)))&&(b=c.floating[w]||s.floating[f]);const E=v/2-A/2,k=b/2-m[f]/2-1,C=X(d[x],k),O=X(d[h],k),P=C,V=b-m[f]-O,R=b/2-m[f]/2+E,L=lt(P,R,V),$=D(o)!=null&&R!=L&&s.reference[f]/2-(RD(o)===t),...n.filter(o=>D(o)!==t)]:n.filter(o=>M(o)===o)).filter(o=>t?D(o)===t||(e?Z(o)!==o:!1):!0)}const ee=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,i,o;const{rects:s,middlewareData:r,placement:c,platform:l,elements:a}=e,{crossAxis:d=!1,alignment:u,allowedPlacements:g=wt,autoAlignment:f=!0,...m}=z(t,e),p=u!==void 0||g===wt?te(u||null,f,g):g,x=await q(e,m),h=((n=r.autoPlacement)==null?void 0:n.index)||0,w=p[h];if(w==null)return{};const v=Ft(w,s,await(l.isRTL==null?void 0:l.isRTL(a.floating)));if(c!==w)return{reset:{placement:p[0]}};const A=[x[M(w)],x[v[0]],x[v[1]]],y=[...((i=r.autoPlacement)==null?void 0:i.overflows)||[],{placement:w,overflows:A}],b=p[h+1];if(b)return{data:{index:h+1,overflows:y},reset:{placement:b}};const E=y.map(O=>{const P=D(O.placement);return[O.placement,P&&d?O.overflows.slice(0,2).reduce((V,R)=>V+R,0):O.overflows[0],O.overflows]}).sort((O,P)=>O[1]-P[1]),C=((o=E.filter(O=>O[2].slice(0,D(O[0])?2:3).every(P=>P<=0))[0])==null?void 0:o[0])||E[0][0];return C!==c?{data:{index:h+1,overflows:y},reset:{placement:C}}:{}}}},xt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:i,middlewareData:o,rects:s,initialPlacement:r,platform:c,elements:l}=e,{mainAxis:a=!0,crossAxis:d=!0,fallbackPlacements:u,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...p}=z(t,e),x=M(i),h=M(r)===r,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),v=u||(h||!m?[J(r)]:qt(r));!u&&f!=="none"&&v.push(...Kt(r,m,f,w));const A=[r,...v],y=await q(e,p),b=[];let E=((n=o.flip)==null?void 0:n.overflows)||[];if(a&&b.push(y[x]),d){const P=Ft(i,s,w);b.push(y[P[0]],y[P[1]])}if(E=[...E,{placement:i,overflows:b}],!b.every(P=>P<=0)){var k,C;const P=(((k=o.flip)==null?void 0:k.index)||0)+1,V=A[P];if(V)return{data:{index:P,overflows:E},reset:{placement:V}};let R=(C=E.filter(L=>L.overflows[0]<=0).sort((L,I)=>L.overflows[1]-I.overflows[1])[0])==null?void 0:C.placement;if(!R)switch(g){case"bestFit":{var O;const L=(O=E.map(I=>[I.placement,I.overflows.filter($=>$>0).reduce(($,_t)=>$+_t,0)]).sort((I,$)=>I[1]-$[1])[0])==null?void 0:O[0];L&&(R=L);break}case"initialPlacement":R=r;break}if(i!==R)return{reset:{placement:R}}}return{}}}};function vt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function bt(t){return Lt.some(e=>t[e]>=0)}const ne=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:i="referenceHidden",...o}=z(t,e);switch(i){case"referenceHidden":{const s=await q(e,{...o,elementContext:"reference"}),r=vt(s,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:bt(r)}}}case"escaped":{const s=await q(e,{...o,altBoundary:!0}),r=vt(s,n.floating);return{data:{escapedOffsets:r,escaped:bt(r)}}}default:return{}}}}};async function ie(t,e){const{placement:n,platform:i,elements:o}=t,s=await(i.isRTL==null?void 0:i.isRTL(o.floating)),r=M(n),c=D(n),l=it(n)==="y",a=["left","top"].includes(r)?-1:1,d=s&&l?-1:1,u=z(e,t);let{mainAxis:g,crossAxis:f,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return c&&typeof m=="number"&&(f=c==="end"?m*-1:m),l?{x:f*d,y:g*a}:{x:g*a,y:f*d}}const oe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:i}=e,o=await ie(e,t);return{x:n+o.x,y:i+o.y,data:o}}}},re=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o}=e,{mainAxis:s=!0,crossAxis:r=!1,limiter:c={fn:x=>{let{x:h,y:w}=x;return{x:h,y:w}}},...l}=z(t,e),a={x:n,y:i},d=await q(e,l),u=it(M(o)),g=Dt(u);let f=a[g],m=a[u];if(s){const x=g==="y"?"top":"left",h=g==="y"?"bottom":"right",w=f+d[x],v=f-d[h];f=lt(w,f,v)}if(r){const x=u==="y"?"top":"left",h=u==="y"?"bottom":"right",w=m+d[x],v=m-d[h];m=lt(w,m,v)}const p=c.fn({...e,[g]:f,[u]:m});return{...p,data:{x:p.x-n,y:p.y-i}}}}};function H(t){return Mt(t)?(t.nodeName||"").toLowerCase():"#document"}function T(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function N(t){var e;return(e=(Mt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Mt(t){return t instanceof Node||t instanceof T(t).Node}function B(t){return t instanceof Element||t instanceof T(t).Element}function F(t){return t instanceof HTMLElement||t instanceof T(t).HTMLElement}function At(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof T(t).ShadowRoot}function G(t){const{overflow:e,overflowX:n,overflowY:i,display:o}=S(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(o)}function se(t){return["table","td","th"].includes(H(t))}function gt(t){const e=mt(),n=S(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function ce(t){let e=Y(t);for(;F(e)&&!ot(e);){if(gt(e))return e;e=Y(e)}return null}function mt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ot(t){return["html","body","#document"].includes(H(t))}function S(t){return T(t).getComputedStyle(t)}function rt(t){return B(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Y(t){if(H(t)==="html")return t;const e=t.assignedSlot||t.parentNode||At(t)&&t.host||N(t);return At(e)?e.host:e}function Bt(t){const e=Y(t);return ot(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&G(e)?e:Bt(e)}function et(t,e){var n;e===void 0&&(e=[]);const i=Bt(t),o=i===((n=t.ownerDocument)==null?void 0:n.body),s=T(i);return o?e.concat(s,s.visualViewport||[],G(i)?i:[]):e.concat(i,et(i))}function Nt(t){const e=S(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const o=F(t),s=o?t.offsetWidth:n,r=o?t.offsetHeight:i,c=Q(n)!==s||Q(i)!==r;return c&&(n=s,i=r),{width:n,height:i,$:c}}function ht(t){return B(t)?t:t.contextElement}function U(t){const e=ht(t);if(!F(e))return W(1);const n=e.getBoundingClientRect(),{width:i,height:o,$:s}=Nt(e);let r=(s?Q(n.width):n.width)/i,c=(s?Q(n.height):n.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const le=W(0);function $t(t){const e=T(t);return!mt()||!e.visualViewport?le:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ae(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==T(t)?!1:e}function j(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=ht(t);let r=W(1);e&&(i?B(i)&&(r=U(i)):r=U(t));const c=ae(s,n,i)?$t(s):W(0);let l=(o.left+c.x)/r.x,a=(o.top+c.y)/r.y,d=o.width/r.x,u=o.height/r.y;if(s){const g=T(s),f=i&&B(i)?T(i):i;let m=g.frameElement;for(;m&&i&&f!==g;){const p=U(m),x=m.getBoundingClientRect(),h=S(m),w=x.left+(m.clientLeft+parseFloat(h.paddingLeft))*p.x,v=x.top+(m.clientTop+parseFloat(h.paddingTop))*p.y;l*=p.x,a*=p.y,d*=p.x,u*=p.y,l+=w,a+=v,m=T(m).frameElement}}return tt({width:d,height:u,x:l,y:a})}function fe(t){let{rect:e,offsetParent:n,strategy:i}=t;const o=F(n),s=N(n);if(n===s)return e;let r={scrollLeft:0,scrollTop:0},c=W(1);const l=W(0);if((o||!o&&i!=="fixed")&&((H(n)!=="body"||G(s))&&(r=rt(n)),F(n))){const a=j(n);c=U(n),l.x=a.x+n.clientLeft,l.y=a.y+n.clientTop}return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-r.scrollLeft*c.x+l.x,y:e.y*c.y-r.scrollTop*c.y+l.y}}function ue(t){return Array.from(t.getClientRects())}function Wt(t){return j(N(t)).left+rt(t).scrollLeft}function de(t){const e=N(t),n=rt(t),i=t.ownerDocument.body,o=_(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=_(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let r=-n.scrollLeft+Wt(t);const c=-n.scrollTop;return S(i).direction==="rtl"&&(r+=_(e.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:c}}function ge(t,e){const n=T(t),i=N(t),o=n.visualViewport;let s=i.clientWidth,r=i.clientHeight,c=0,l=0;if(o){s=o.width,r=o.height;const a=mt();(!a||a&&e==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}return{width:s,height:r,x:c,y:l}}function me(t,e){const n=j(t,!0,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft,s=F(t)?U(t):W(1),r=t.clientWidth*s.x,c=t.clientHeight*s.y,l=o*s.x,a=i*s.y;return{width:r,height:c,x:l,y:a}}function Ot(t,e,n){let i;if(e==="viewport")i=ge(t,n);else if(e==="document")i=de(N(t));else if(B(e))i=me(e,n);else{const o=$t(t);i={...e,x:e.x-o.x,y:e.y-o.y}}return tt(i)}function Ht(t,e){const n=Y(t);return n===e||!B(n)||ot(n)?!1:S(n).position==="fixed"||Ht(n,e)}function he(t,e){const n=e.get(t);if(n)return n;let i=et(t).filter(c=>B(c)&&H(c)!=="body"),o=null;const s=S(t).position==="fixed";let r=s?Y(t):t;for(;B(r)&&!ot(r);){const c=S(r),l=gt(r);!l&&c.position==="fixed"&&(o=null),(s?!l&&!o:!l&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||G(r)&&!l&&Ht(t,r))?i=i.filter(d=>d!==r):o=c,r=Y(r)}return e.set(t,i),i}function pe(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const r=[...n==="clippingAncestors"?he(e,this._c):[].concat(n),i],c=r[0],l=r.reduce((a,d)=>{const u=Ot(e,d,o);return a.top=_(u.top,a.top),a.right=X(u.right,a.right),a.bottom=X(u.bottom,a.bottom),a.left=_(u.left,a.left),a},Ot(e,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function we(t){return Nt(t)}function ye(t,e,n){const i=F(e),o=N(e),s=n==="fixed",r=j(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const l=W(0);if(i||!i&&!s)if((H(e)!=="body"||G(o))&&(c=rt(e)),i){const a=j(e,!0,s,e);l.x=a.x+e.clientLeft,l.y=a.y+e.clientTop}else o&&(l.x=Wt(o));return{x:r.left+c.scrollLeft-l.x,y:r.top+c.scrollTop-l.y,width:r.width,height:r.height}}function Pt(t,e){return!F(t)||S(t).position==="fixed"?null:e?e(t):t.offsetParent}function Vt(t,e){const n=T(t);if(!F(t))return n;let i=Pt(t,e);for(;i&&se(i)&&S(i).position==="static";)i=Pt(i,e);return i&&(H(i)==="html"||H(i)==="body"&&S(i).position==="static"&&!gt(i))?n:i||ce(t)||n}const xe=async function(t){let{reference:e,floating:n,strategy:i}=t;const o=this.getOffsetParent||Vt,s=this.getDimensions;return{reference:ye(e,await o(n),i),floating:{x:0,y:0,...await s(n)}}};function ve(t){return S(t).direction==="rtl"}const at={convertOffsetParentRelativeRectToViewportRelativeRect:fe,getDocumentElement:N,getClippingRect:pe,getOffsetParent:Vt,getElementRects:xe,getClientRects:ue,getDimensions:we,getScale:U,isElement:B,isRTL:ve};function be(t,e){let n=null,i;const o=N(t);function s(){clearTimeout(i),n&&n.disconnect(),n=null}function r(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const{left:a,top:d,width:u,height:g}=t.getBoundingClientRect();if(c||e(),!u||!g)return;const f=K(d),m=K(o.clientWidth-(a+u)),p=K(o.clientHeight-(d+g)),x=K(a),w={rootMargin:-f+"px "+-m+"px "+-p+"px "+-x+"px",threshold:_(0,X(1,l))||1};let v=!0;function A(y){const b=y[0].intersectionRatio;if(b!==l){if(!v)return r();b?r(!1,b):i=setTimeout(()=>{r(!1,1e-7)},100)}v=!1}try{n=new IntersectionObserver(A,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(A,w)}n.observe(t)}return r(!0),s}function Ae(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,a=ht(t),d=o||s?[...a?et(a):[],...et(e)]:[];d.forEach(h=>{o&&h.addEventListener("scroll",n,{passive:!0}),s&&h.addEventListener("resize",n)});const u=a&&c?be(a,n):null;let g=-1,f=null;r&&(f=new ResizeObserver(h=>{let[w]=h;w&&w.target===a&&f&&(f.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{f&&f.observe(e)})),n()}),a&&!l&&f.observe(a),f.observe(e));let m,p=l?j(t):null;l&&x();function x(){const h=j(t);p&&(h.x!==p.x||h.y!==p.y||h.width!==p.width||h.height!==p.height)&&n(),p=h,m=requestAnimationFrame(x)}return n(),()=>{d.forEach(h=>{o&&h.removeEventListener("scroll",n),s&&h.removeEventListener("resize",n)}),u&&u(),f&&f.disconnect(),f=null,l&&cancelAnimationFrame(m)}}const Oe=(t,e,n)=>{const i=new Map,o={platform:at,...n},s={...o.platform,_c:i};return Zt(t,e,{...o,platform:s})};function Pe(t){return Ee(t)}function ct(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function Ee(t){for(let e=t;e;e=ct(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=ct(t);e;e=ct(e)){if(!(e instanceof Element))continue;const n=getComputedStyle(e);if(n.display!=="contents"&&(n.position!=="static"||n.filter!=="none"||e.tagName==="BODY"))return e}return null}(function(){{const e=at.getOffsetParent;at.getOffsetParent=n=>e(n,Pe)}})();const It=async(t,{referenceEl:e,floatingEl:n,overlayPositioning:i="absolute",placement:o,flipDisabled:s,flipPlacements:r,offsetDistance:c,offsetSkidding:l,arrowEl:a,type:d})=>{var A;if(!e||!n)return null;const{x:u,y:g,placement:f,strategy:m,middlewareData:p}=await Oe(e,n,{strategy:i,placement:o==="auto"||o==="auto-start"||o==="auto-end"?void 0:Se(n,o),middleware:Te({placement:o,flipDisabled:s,flipPlacements:r,offsetDistance:c,offsetSkidding:l,arrowEl:a,type:d})});if(a&&p.arrow){const{x:y,y:b}=p.arrow,E=f.split("-")[0],k=y!=null?"left":"top",C=Le[E],O={left:"",top:"",bottom:"",right:""};"floatingLayout"in t&&(t.floatingLayout=E==="left"||E==="right"?"horizontal":"vertical"),Object.assign(a.style,{...O,[k]:`${k=="left"?y:b}px`,[E]:"100%",transform:C})}const h=((A=p.hide)==null?void 0:A.referenceHidden)?"hidden":null,w=h?"none":null;n.setAttribute(Re,f);const v=`translate(${Math.round(u)}px,${Math.round(g)}px)`;Object.assign(n.style,{visibility:h,pointerEvents:w,position:m,top:"0",left:"0",transform:v})},Re="data-placement",Et=100,Rt=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end"],Be={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active"};function Te({placement:t,flipDisabled:e,flipPlacements:n,offsetDistance:i,offsetSkidding:o,arrowEl:s,type:r}){const c=[re(),ne()];if(r==="menu")return[...c,xt({fallbackPlacements:n||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})];if(r==="popover"||r==="tooltip"){const l=[...c,oe({mainAxis:typeof i=="number"?i:0,crossAxis:typeof o=="number"?o:0})];return t==="auto"||t==="auto-start"||t==="auto-end"?l.push(ee({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||l.push(xt(n?{fallbackPlacements:n}:{})),s&&l.push(Jt({element:s})),l}return[]}function Ne(t,e){const n=t.filter(i=>Rt.includes(i));return n.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${Rt.map(i=>`"${i}"`).join(", ").trim()}`,{el:e}),n}function Se(t,e){const n=["left","right"];return jt(t)==="rtl"&&n.reverse(),e.replace(/leading/gi,n[0]).replace(/trailing/gi,n[1])}async function $e(t,e,n=!1){return t.open?(n?Ce(t):It)(t,e):void 0}function Ce(t){let e=nt.get(t);return e||(e=Ut(It,Et,{leading:!0,maxWait:Et}),nt.set(t,e),e)}const Le={top:"",left:"rotate(-90deg)",bottom:"rotate(180deg)",right:"rotate(90deg)"},ft=new WeakMap,nt=new WeakMap;function We(t,e,n){if(!n||!e)return;De(t,e,n),Object.assign(n.style,{visibility:"hidden",pointerEvents:"none",position:t.overlayPositioning,top:"0",left:"0"});const i=Ae;ft.set(t,i(e,n,()=>t.reposition()))}function De(t,e,n){var i,o;!n||!e||((i=ft.get(t))==null||i(),ft.delete(t),(o=nt.get(t))==null||o.cancel(),nt.delete(t))}const Tt=4,He=Math.ceil(Math.hypot(Tt,Tt));/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */function St(t,e=!1){(e?t[t.transitionProp]:t.open)?t.onBeforeOpen():t.onBeforeClose(),(e?t[t.transitionProp]:t.open)?t.onOpen():t.onClose()}function Ve(t,e=!1){zt(()=>{if(t.transitionEl){let a=function(u){u.propertyName===t.openTransitionProp&&u.target===t.transitionEl&&(clearTimeout(l),t.transitionEl.removeEventListener("transitionstart",a),(e?t[t.transitionProp]:t.open)?t.onBeforeOpen():t.onBeforeClose())},d=function(u){u.propertyName===t.openTransitionProp&&u.target===t.transitionEl&&((e?t[t.transitionProp]:t.open)?t.onOpen():t.onClose(),t.transitionEl.removeEventListener("transitionend",d),t.transitionEl.removeEventListener("transitioncancel",d))};const{transitionDuration:n,transitionProperty:i}=getComputedStyle(t.transitionEl),o=n.split(","),r=i.split(",").indexOf(t.openTransitionProp),c=o[r]??o[0];if(c==="0s"){St(t,e);return}const l=setTimeout(()=>{t.transitionEl.removeEventListener("transitionstart",a),t.transitionEl.removeEventListener("transitionend",d),t.transitionEl.removeEventListener("transitioncancel",d),St(t,e)},parseFloat(c)*1e3);t.transitionEl.addEventListener("transitionstart",a),t.transitionEl.addEventListener("transitionend",d),t.transitionEl.addEventListener("transitioncancel",d)}})}/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const Ct={arrow:"calcite-floating-ui-arrow",arrowStroke:"calcite-floating-ui-arrow__stroke"},Fe={width:12,height:6,strokeWidth:1},Ie=({floatingLayout:t,key:e,ref:n})=>{const{width:i,height:o,strokeWidth:s}=Fe,r=i/2,c=t==="vertical",l=`M0,0 H${i} L${i-r},${o} Q${r},${o} ${r},${o} Z`;return st("svg",{"aria-hidden":"true",class:Ct.arrow,height:i,key:e,ref:n,viewBox:`0 0 ${i} ${i+(c?0:s)}`,width:i+(c?s:0)},s>0&&st("path",{class:Ct.arrowStroke,d:l,fill:"none","stroke-width":s+1}),st("path",{d:l,stroke:"none"}))};export{Be as F,De as a,Ie as b,We as c,He as d,Ne as f,Ve as o,$e as r}; diff --git a/assets/Fog.glsl-332cff80.js b/assets/Fog.glsl-332cff80.js new file mode 100644 index 0000000..9084e86 --- /dev/null +++ b/assets/Fog.glsl-332cff80.js @@ -0,0 +1 @@ +import{u as r,h as e}from"./index-080e108a.js";export{r as FogPassParameters,e as build}; diff --git a/assets/GeoJSONLayer-71b9768b.js b/assets/GeoJSONLayer-71b9768b.js new file mode 100644 index 0000000..c00b61b --- /dev/null +++ b/assets/GeoJSONLayer-71b9768b.js @@ -0,0 +1 @@ +import{bz as j,ai as r,aj as o,al as b,gC as w,aR as J,ca as O,ar as m,ak as N,fD as $,cn as R,fy as I,eQ as q,eS as P,eR as T,bc as E,as as k,hi as f,hj as D,bf as g,aw as C,cq as L,cC as G,aA as Q}from"./index-080e108a.js";import"./UniqueValueRenderer-fef4204d.js";import{p as z,n as Z}from"./jsonUtils-f73b3833.js";import{O as V}from"./MultiOriginJSONSupport-e4912ffd.js";import{c as A}from"./clientSideDefaults-ab04bd90.js";import{d as B}from"./FeatureSet-111cb247.js";import{o as M}from"./CustomParametersMixin-231c4be8.js";import{p as U}from"./FeatureEffectLayer-4160946c.js";import{n as W}from"./FeatureReductionLayer-4262cf54.js";import{c as H}from"./OperationalLayer-0e8f8b28.js";import{c as K}from"./OrderedLayer-68067459.js";import{j as X}from"./PortalLayer-310c2800.js";import{a as Y}from"./TemporalLayer-f17c9161.js";import{d as ee,v as te,m as re,c as ie,u as oe,p as se,l as ne,f as ae}from"./commonProperties-30089b06.js";import{p as le}from"./FeatureTemplate-2a7e96c1.js";import{n as pe}from"./FeatureType-db96032c.js";import{s as ue}from"./fieldProperties-62c55499.js";import{C as de}from"./LabelClass-2d53c485.js";import{i as he}from"./labelingInfo-144f3d9f.js";import{b as c}from"./Query-1c961d4c.js";import{p as ce}from"./popupUtils-82ea8abb.js";import"./diffUtils-590c9088.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./QueryEngineCapabilities-42e44ded.js";import"./defaultsJSON-59981e75.js";import"./FeatureEffect-86735d98.js";import"./FeatureFilter-00f4be05.js";import"./featureLayerUtils-6cf06f83.js";import"./sql-734ecbc5.js";import"./AttachmentQuery-972bbd60.js";import"./RelationshipQuery-39c07195.js";import"./portalItemUtils-792a27e1.js";import"./defaults-34554cbf.js";const F="esri.layers.graphics.sources.GeoJSONSource",v=j.getLogger(F);let d=class extends w{constructor(){super(...arguments),this.type="geojson",this.refresh=J(async e=>{await this.load();const{extent:t,timeExtent:i}=await this._connection.invoke("refresh",e);return this.sourceJSON.extent=t,i&&(this.sourceJSON.timeInfo.timeExtent=[i.start,i.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}queryFeatures(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t)).then(i=>B.fromJSON(i))}queryFeaturesJSON(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t))}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(i=>({count:i.count,extent:O.fromJSON(i.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}_applyEdits(e){if(!this._connection)throw new m("geojson-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField,i=[],n=[],u=[];if(e.addFeatures)for(const a of e.addFeatures)i.push(this._serializeFeature(a));if(e.deleteFeatures)for(const a of e.deleteFeatures)"objectId"in a&&a.objectId!=null?n.push(a.objectId):"attributes"in a&&a.attributes[t]!=null&&n.push(a.attributes[t]);if(e.updateFeatures)for(const a of e.updateFeatures)u.push(this._serializeFeature(a));return this._connection.invoke("applyEdits",{adds:i,updates:u,deletes:n}).then(({extent:a,timeExtent:l,featureEditResults:p})=>(this.sourceJSON.extent=a,l&&(this.sourceJSON.timeInfo.timeExtent=[l.start,l.end]),this._createEditsResult(p)))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new m("geojson-layer-source:edit-failure",t.description,{code:t.code}):null}}_serializeFeature(e){const{attributes:t}=e,i=this._geometryForSerialization(e);return i?{geometry:i.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;return t==null?null:t.type==="mesh"||t.type==="extent"?N.fromExtent(t.extent):t}async _startWorker(e){this._connection=await $("GeoJSONSourceWorker",{strategy:R("feature-layers-workers")?"dedicated":"local",signal:e});const{fields:t,spatialReference:i,hasZ:n,geometryType:u,objectIdField:a,url:l,timeInfo:p,customParameters:S}=this.layer,_=this.layer.originOf("spatialReference")==="defaults",x={url:l,customParameters:S,fields:t&&t.map(y=>y.toJSON()),geometryType:I.toJSON(u),hasZ:n,objectIdField:a,timeInfo:p?p.toJSON():null,spatialReference:_?null:i&&i.toJSON()},h=await this._connection.invoke("load",x,{signal:e});for(const y of h.warnings)v.warn(y.message,{layer:this.layer,warning:y});h.featureErrors.length&&v.warn(`Encountered ${h.featureErrors.length} validation errors while loading features`,h.featureErrors),this.sourceJSON=h.layerDefinition,this.capabilities=A(this.sourceJSON.hasZ,!0)}};r([o()],d.prototype,"capabilities",void 0),r([o()],d.prototype,"type",void 0),r([o({constructOnly:!0})],d.prototype,"layer",void 0),r([o()],d.prototype,"sourceJSON",void 0),d=r([b(F)],d);const ye=ue();let s=class extends K(M(W(U(q(Y(P(T(H(X(V(Q))))))))))){constructor(e){super(e),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.editingEnabled=!1,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="GeoJSON",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=E.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson",this.typeIdField=null,this.types=null}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:["GeoJson"],supportsData:!1},e).catch(k).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),f(this.renderer,this.fieldsIndex),D(this.timeInfo,this.fieldsIndex)});return this.addResolvingPromise(t),Promise.resolve(this)}get capabilities(){return this.source?this.source.capabilities:null}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&this.geometryType==null}get parsedUrl(){return this.url?g(this.url):null}set renderer(e){f(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=g(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const{applyEdits:i}=await C(()=>import("./editingSupport-b5feb7b5.js"),["assets/editingSupport-b5feb7b5.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/EditBusLayer-d71787e9.js"]);await this.load();const n=await i(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:"service",ignoreDefaults:!0}),n}on(e,t){return super.on(e,t)}createPopupTemplate(e){return ce(this,e)}createQuery(){const e=new c,t=this.get("capabilities.data");e.returnGeometry=!0,t&&t.supportsZ&&(e.returnZ=!0),e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:i,timeExtent:n}=this;return e.timeExtent=i!=null&&n!=null?n.offset(-i.value,i.unit):n||null,e}getFieldDomain(e,t){let i,n=!1;const u=t&&t.feature,a=u&&u.attributes,l=this.typeIdField&&a&&a[this.typeIdField];return l!=null&&this.types&&(n=this.types.some(p=>p.id==l&&(i=p.domains&&p.domains[e],i&&i.type==="inherited"&&(i=this._getLayerDomain(e)),!0))),n||i||(i=this._getLayerDomain(e)),i}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(c.from(e)||this.createQuery(),t)).then(i=>{if(i!=null&&i.features)for(const n of i.features)n.layer=n.sourceLayer=this;return i})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(c.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(c.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(c.from(e)||this.createQuery(),t))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return t!=null&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}_getLayerDomain(e){if(!this.fields)return null;let t=null;return this.fields.some(i=>(i.name===e&&(t=i.domain),!!t)),t}};r([o({readOnly:!0,json:{read:!1,write:!1}})],s.prototype,"capabilities",null),r([o({type:String})],s.prototype,"copyright",void 0),r([o({readOnly:!0})],s.prototype,"createQueryVersion",null),r([o({readOnly:!0})],s.prototype,"defaultPopupTemplate",null),r([o({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],s.prototype,"definitionExpression",void 0),r([o({type:String})],s.prototype,"displayField",void 0),r([o({type:Boolean})],s.prototype,"editingEnabled",void 0),r([o(ee)],s.prototype,"elevationInfo",void 0),r([o({type:[L],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],s.prototype,"fields",void 0),r([o(ye.fieldsIndex)],s.prototype,"fieldsIndex",void 0),r([o({type:O,json:{name:"extent"}})],s.prototype,"fullExtent",void 0),r([o({type:["point","polygon","polyline","multipoint"],json:{read:{reader:I.read}}})],s.prototype,"geometryType",void 0),r([o({type:Boolean})],s.prototype,"hasZ",void 0),r([o(te)],s.prototype,"id",void 0),r([o({type:Boolean,readOnly:!0})],s.prototype,"isTable",null),r([o(re)],s.prototype,"labelsVisible",void 0),r([o({type:[de],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:he},write:!0}})],s.prototype,"labelingInfo",void 0),r([o(ie)],s.prototype,"legendEnabled",void 0),r([o({type:["show","hide"]})],s.prototype,"listMode",void 0),r([o({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],s.prototype,"objectIdField",void 0),r([o(oe)],s.prototype,"opacity",void 0),r([o({type:["GeoJSON"]})],s.prototype,"operationalLayerType",void 0),r([o({readOnly:!0})],s.prototype,"parsedUrl",null),r([o(se)],s.prototype,"popupEnabled",void 0),r([o({type:G,json:{name:"popupInfo",write:!0}})],s.prototype,"popupTemplate",void 0),r([o({types:z,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:Z}}}})],s.prototype,"renderer",null),r([o(ne)],s.prototype,"screenSizePerspectiveEnabled",void 0),r([o({readOnly:!0})],s.prototype,"source",void 0),r([o({type:E})],s.prototype,"spatialReference",void 0),r([o({type:[le]})],s.prototype,"templates",void 0),r([o()],s.prototype,"title",void 0),r([o({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),r([o({type:String,readOnly:!0})],s.prototype,"typeIdField",void 0),r([o({type:[pe]})],s.prototype,"types",void 0),r([o(ae)],s.prototype,"url",null),s=r([b("esri.layers.GeoJSONLayer")],s);const He=s;export{He as default}; diff --git a/assets/GeoJSONLayerView3D-be497a18.js b/assets/GeoJSONLayerView3D-be497a18.js new file mode 100644 index 0000000..cbfdd8b --- /dev/null +++ b/assets/GeoJSONLayerView3D-be497a18.js @@ -0,0 +1 @@ +import{ai as o,aj as r,al as i}from"./index-080e108a.js";import{_ as p}from"./FeatureLayerViewBase3D-8474587e.js";import"./FeatureLikeLayerView3D-2e3185ce.js";import"./Query-1c961d4c.js";import"./dehydratedFeatureComparison-a3375a3e.js";import"./queryForSymbologySnapping-0264f2b5.js";import"./elevationInfoUtils-4fd79d95.js";import"./hash-6f442295.js";import"./diffUtils-590c9088.js";import"./Graphics3DObjectStates-bb2a6162.js";import"./UniqueValueRenderer-fef4204d.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./popupUtils-f04ec9a9.js";import"./FeatureFilter-00f4be05.js";import"./floorFilterUtils-080a7cd2.js";import"./QueryEngine-19eda5ff.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./FeatureSet-111cb247.js";import"./FeatureStore-f0e312fc.js";import"./BoundsStore-b6bd3c14.js";import"./projectExtentUtils-efa4cddd.js";import"./LayerView3D-ffd35809.js";import"./query-93c6e211.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./EventedSet-d13fada5.js";import"./commonProperties-30089b06.js";import"./FeatureEffect-86735d98.js";import"./LayerView-448bc5ea.js";import"./RefreshableLayerView-915e7f53.js";let t=class extends p{constructor(){super(...arguments),this.type="geojson-3d"}};o([r()],t.prototype,"layer",void 0),t=o([i("esri.views.3d.layers.GeoJSONLayerView3D")],t);const Z=t;export{Z as default}; diff --git a/assets/GeoJSONSourceWorker-555763c3.js b/assets/GeoJSONSourceWorker-555763c3.js new file mode 100644 index 0000000..9be9d08 --- /dev/null +++ b/assets/GeoJSONSourceWorker-555763c3.js @@ -0,0 +1 @@ +import{eo as g,ar as _,ep as k,bS as C,aN as D,bn as v,bz as Q,cM as G,eq as M,er as P,at as Z,es as q,et as A,eu as N,ev as z}from"./index-080e108a.js";import{m as B}from"./FeatureStore-f0e312fc.js";import{e as L,f as F,g as E}from"./QueryEngine-19eda5ff.js";import{L as J,I as U,T as V}from"./geojson-077f67ec.js";import{o as W,a as H,i as Y}from"./clientSideDefaults-ab04bd90.js";import{y as K,d as b,c as w,u as I,h as x}from"./sourceUtils-e3b344c8.js";import{r as S}from"./FieldsIndex-f79a8f26.js";import"./BoundsStore-b6bd3c14.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./defaultsJSON-59981e75.js";const X={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class be{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){var e;(e=this._queryEngine)==null||e.destroy(),this._queryEngine=this._fieldsIndex=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const n=[];await this._checkProjection(e.spatialReference);let i=null;e.url&&(i=await this._fetch(t==null?void 0:t.signal));const r=J(i,{geometryType:e.geometryType}),a=e.fields||r.fields||[],u=e.hasZ!=null?e.hasZ:r.hasZ,d=r.geometryType;let c=e.objectIdField||r.objectIdFieldName||"__OBJECTID";const y=e.spatialReference||g;let s=e.timeInfo;a===r.fields&&r.unknownFields.length>0&&n.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:r.unknownFields}});let l=new S(a).get(c);l?(l.type!=="esriFieldTypeString"&&(l.type="esriFieldTypeOID"),l.editable=!1,l.nullable=!1,c=l.name):(l={alias:c,name:c,type:r.objectIdFieldType==="string"?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},a.unshift(l));const h={};for(const o of a){if(o.name==null&&(o.name=o.alias),o.alias==null&&(o.alias=o.name),!o.name)throw new _("geojson-layer:invalid-field-name","field name is missing",{field:o});if(!k.jsonValues.includes(o.type))throw new _("geojson-layer:invalid-field-type",`invalid type for field "${o.name}"`,{field:o});if(o.name!==l.name){const f=C(o);f!==void 0&&(h[o.name]=f)}}this._fieldsIndex=new S(a);const p=this._fieldsIndex.requiredFields.indexOf(l);if(p>-1&&this._fieldsIndex.requiredFields.splice(p,1),s){if(s.startTimeField){const o=this._fieldsIndex.get(s.startTimeField);o?(s.startTimeField=o.name,o.type="esriFieldTypeDate"):s.startTimeField=null}if(s.endTimeField){const o=this._fieldsIndex.get(s.endTimeField);o?(s.endTimeField=o.name,o.type="esriFieldTypeDate"):s.endTimeField=null}if(s.trackIdField){const o=this._fieldsIndex.get(s.trackIdField);o?s.trackIdField=o.name:(s.trackIdField=null,n.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:s}}))}s.startTimeField||s.endTimeField||(n.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:s}}),s=null)}const R=d?W(d):void 0,m={warnings:n,featureErrors:[],layerDefinition:{...X,drawingInfo:R??void 0,templates:H(h),extent:void 0,geometryType:d,objectIdField:c,fields:a,hasZ:!!u,timeInfo:s}};this._queryEngine=new L({fields:a,geometryType:d,hasM:!1,hasZ:u,objectIdField:c,spatialReference:y,timeInfo:s,featureStore:new B({geometryType:d,hasM:!1,hasZ:u}),cacheSpatialQueries:!0}),this._createDefaultAttributes=Y(h,c);const T=await this._createFeatures(i);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,T);const O=this._normalizeFeatures(T,m.warnings,m.featureErrors);this._queryEngine.featureStore.addMany(O);const{fullExtent:$,timeExtent:j}=await this._queryEngine.fetchRecomputedExtents();if(m.layerDefinition.extent=$,j){const{start:o,end:f}=j;m.layerDefinition.timeInfo.timeExtent=[o,f]}return m}async applyEdits(e){const{spatialReference:t,geometryType:n}=this._queryEngine;return await Promise.all([K(t,n),F(e.adds,t),F(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){var i;this._loadOptions.customParameters=e,(i=this._snapshotTask)==null||i.abort(),this._snapshotTask=D(this._snapshotFeatures),this._snapshotTask.promise.then(r=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,r);const a=this._normalizeFeatures(r);a&&this._queryEngine.featureStore.addMany(a)},r=>{this._queryEngine.featureStore.clear(),v(r)||Q.getLogger("esri.layers.GeoJSONLayer").error(new _("geojson-layer:refresh","An error occurred during refresh",{error:r}))}),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:n}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:n}}async _createFeatures(e){if(e==null)return[];const{geometryType:t,hasZ:n,objectIdField:i}=this._queryEngine,r=U(e,{geometryType:t,hasZ:n,objectIdField:i});if(!G(this._queryEngine.spatialReference,g))for(const a of r)a.geometry!=null&&(a.geometry=M(E(P(a.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),g,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:n}=this._loadOptions,i=(await Z(t,{responseType:"json",query:{...n},signal:e})).data;return await V(i),i}_normalizeFeatures(e,t,n){const{objectIdField:i}=this._queryEngine,r=[];for(const a of e){const u=this._createDefaultAttributes(),d=b(this._fieldsIndex,u,a.attributes,!0,t);d?n==null||n.push(d):(this._assignObjectId(u,a.attributes,!0),a.attributes=u,a.objectId=u[i],r.push(a))}return r}async _applyEdits(e){const{adds:t,updates:n,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t&&t.length&&this._applyAddEdits(r,t),n&&n.length&&this._applyUpdateEdits(r,n),i&&i.length){for(const d of i)r.deleteResults.push(w(d));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:a,timeExtent:u}=await this._queryEngine.fetchRecomputedExtents();return{extent:a,timeExtent:u,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:n}=e,{geometryType:i,hasM:r,hasZ:a,objectIdField:u,spatialReference:d,featureStore:c}=this._queryEngine,y=[];for(const s of t){if(s.geometry&&i!==q(s.geometry)){n.push(I("Incorrect geometry type."));continue}const l=this._createDefaultAttributes(),h=b(this._fieldsIndex,l,s.attributes);if(h)n.push(h);else{if(this._assignObjectId(l,s.attributes),s.attributes=l,s.uid!=null){const p=s.attributes[u];e.uidToObjectId[s.uid]=p}if(s.geometry!=null){const p=s.geometry.spatialReference??d;s.geometry=E(x(s.geometry,p),p,d)}y.push(s),n.push(w(s.attributes[u]))}}c.addMany(A([],y,i,a,r,u))}_applyUpdateEdits({updateResults:e},t){const{geometryType:n,hasM:i,hasZ:r,objectIdField:a,spatialReference:u,featureStore:d}=this._queryEngine;for(const c of t){const{attributes:y,geometry:s}=c,l=y&&y[a];if(l==null){e.push(I(`Identifier field ${a} missing`));continue}if(!d.has(l)){e.push(I(`Feature with object id ${l} missing`));continue}const h=N(d.getFeature(l),n,r,i);if(s!=null){if(n!==q(s)){e.push(I("Incorrect geometry type."));continue}const p=s.spatialReference??u;h.geometry=E(x(s,p),p,u)}if(y){const p=b(this._fieldsIndex,h.attributes,y);if(p){e.push(p);continue}}d.add(z(h,n,r,i,a)),e.push(w(l))}}_createObjectIdGenerator(e,t){const n=e.fieldsIndex.get(e.objectIdField);if(n.type==="esriFieldTypeString")return()=>n.name+"-"+Date.now().toString(16);let i=Number.NEGATIVE_INFINITY;for(const r of t)r.objectId&&(i=Math.max(i,r.objectId));return i=Math.max(0,i)+1,()=>i++}_assignObjectId(e,t,n=!1){const i=this._queryEngine.objectIdField;e[i]=n&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await F(g,e)}catch{throw new _("geojson-layer","Projection not supported")}}}export{be as default}; diff --git a/assets/GeoRSSLayer-f82698fe.js b/assets/GeoRSSLayer-f82698fe.js new file mode 100644 index 0000000..f255f8f --- /dev/null +++ b/assets/GeoRSSLayer-f82698fe.js @@ -0,0 +1 @@ +import{eQ as y,eR as p,eS as u,eb as c,as as d,at as h,eT as m,bZ as S,ai as o,aj as s,ay as f,ca as g,al as v,eU as n,bK as b,eV as C,bJ as G,bg as R,aA as _}from"./index-080e108a.js";import{O as j}from"./MultiOriginJSONSupport-e4912ffd.js";import{c as w}from"./OperationalLayer-0e8f8b28.js";import{j as x}from"./PortalLayer-310c2800.js";import{v as P,c as k,f as $}from"./commonProperties-30089b06.js";import"./portalItemUtils-792a27e1.js";const F=["atom","xml"],E={base:n,key:"type",typeMap:{"simple-line":b},errorContext:"symbol"},M={base:n,key:"type",typeMap:{"picture-marker":C,"simple-marker":G},errorContext:"symbol"},L={base:n,key:"type",typeMap:{"simple-fill":R},errorContext:"symbol"};let t=class extends y(p(w(x(u(j(_)))))){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,r){return typeof e=="string"?{url:e,...r}:e}readFeatureCollections(e,r){return r.featureCollection.layers.forEach(i=>{var a;const l=i.layerDefinition.drawingInfo.renderer.symbol;l&&l.type==="esriSFS"&&((a=l.outline)!=null&&a.style.includes("esriSFS"))&&(l.outline.style="esriSLSSolid")}),r.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&&this.originOf("title")!=="defaults"?e:this.url?c(this.url,F)||"GeoRSS":e||""}set title(e){this._set("title",e)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service","Feature Service","Feature Collection","Scene Service"]},e).catch(d).then(()=>this._fetchService(r)).then(i=>{this.read(i,{origin:"service"})})),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:"service",ignoreDefaults:!0}),!0}async _fetchService(e){const r=this.spatialReference,{data:i}=await h(S.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:m(r)?void 0:r.wkid??JSON.stringify(r)},signal:e});return i}_hasGeometry(e){var r;return((r=this.featureCollections)==null?void 0:r.some(i=>{var l,a;return((l=i.featureSet)==null?void 0:l.geometryType)===e&&((a=i.featureSet.features)==null?void 0:a.length)>0}))??!1}};o([s()],t.prototype,"description",void 0),o([s()],t.prototype,"featureCollections",void 0),o([f("service","featureCollections",["featureCollection.layers"])],t.prototype,"readFeatureCollections",null),o([s({type:g,json:{name:"lookAtExtent"}})],t.prototype,"fullExtent",void 0),o([s(P)],t.prototype,"id",void 0),o([s(k)],t.prototype,"legendEnabled",void 0),o([s({types:E,json:{write:!0}})],t.prototype,"lineSymbol",void 0),o([s({type:["show","hide"]})],t.prototype,"listMode",void 0),o([s({types:M,json:{write:!0}})],t.prototype,"pointSymbol",void 0),o([s({types:L,json:{write:!0}})],t.prototype,"polygonSymbol",void 0),o([s({type:["GeoRSS"]})],t.prototype,"operationalLayerType",void 0),o([s($)],t.prototype,"url",void 0),o([s({json:{origins:{service:{read:{source:"name",reader:e=>e||void 0}}}}})],t.prototype,"title",null),o([s({readOnly:!0,json:{read:!1},value:"geo-rss"})],t.prototype,"type",void 0),t=o([v("esri.layers.GeoRSSLayer")],t);const q=t;export{q as default}; diff --git a/assets/GeometryUtils-0258f920.js b/assets/GeometryUtils-0258f920.js new file mode 100644 index 0000000..e8677f8 --- /dev/null +++ b/assets/GeometryUtils-0258f920.js @@ -0,0 +1 @@ +const r=.7111111111111111;function u(t,n){return(t%=n)>=0?t:t+n}function c(t){return u(t*r,256)}export{c}; diff --git a/assets/Graphics3DObjectStates-bb2a6162.js b/assets/Graphics3DObjectStates-bb2a6162.js new file mode 100644 index 0000000..ba20aba --- /dev/null +++ b/assets/Graphics3DObjectStates-bb2a6162.js @@ -0,0 +1 @@ +import{ar as L,qi as V,qj as Me,dZ as H,bi as Be,qk as qe,ql as He,qm as Ne,qn as We,qo as Ye,dw as re,ai as n,aj as l,al as U,ao as k,cu as ae,pp as z,oZ as Ze,bM as Xe,bL as Je,qp as $e,qq as Qe,b7 as Ke,ax as B,ah as _,qr as et,os as tt,aS as ne,cn as it,dx as Fe,af as N,kI as st,hW as rt,cL as at,dv as nt,bz as oe,dN as ee,jI as ot,fs as de,dP as lt,dA as ht,dT as j,aD as v,qs as dt,qt as ct,qu as pt,ca as ut,pq as ce,bN as te,qv as yt,qw as E,qx as R,qy as gt,qz as mt,gE as pe,gF as ue,aG as C,aC as _t,aT as bt,aM as ft,nU as Te,dW as W,hV as ye,e8 as vt,fp as St,iS as Ct,qA as le,qB as wt,cv as Gt,pc as xt,cT as It,dS as ge,dO as me,gv as _e,gu as Et,c7 as Rt,qC as Dt,qD as Ot,cM as Pt,qE as be,nd as fe,bn as Y,qF as At,iT as Lt,qG as Vt,qH as ve,bk as Ut,aB as jt,bq as Z,l7 as $t,qI as Ft,qJ as Tt,bA as zt,aA as kt,qK as X,f5 as Mt,dz as q,qc as Bt,jk as qt,eG as Se,bm as Ht,nl as Ce,lA as we,ga as Ge,kZ as J,e_ as Nt,fK as xe,nm as Wt,qL as Yt,aH as Zt,ag as Xt,gf as Ie,br as Ee}from"./index-080e108a.js";import{A as Re}from"./UniqueValueRenderer-fef4204d.js";import"./jsonUtils-f73b3833.js";import{a as De,y as Jt}from"./diffUtils-590c9088.js";import{S as Qt,u as Kt,c as ei}from"./defaults-34554cbf.js";import{e as ti,i as ii}from"./defaultsJSON-59981e75.js";import{o as $}from"./optimizedFeatureQueryEngineAdapter-58185a60.js";import{h as si}from"./PooledRBush-3cae7682.js";import{t as ri}from"./popupUtils-f04ec9a9.js";function ze(t){return t==null||t.type==="simple"||t.type==="unique-value"||t.type==="class-breaks"||t.type==="dictionary"||t.type==="heatmap"}function ai(t,e){if(t==null)return null;if(!ze(t))return new L("renderer-conversion-3d:unsupported-renderer",`Unsupported renderer of type '${t.type||t.declaredClass}'`,{renderer:t});switch(t.type){case"simple":return ni(t);case"unique-value":return oi(t,e);case"class-breaks":return li(t);case"dictionary":case"heatmap":return null}return null}function he(t,e){if(!e)return null;let i;if(i=Array.isArray(e)?e:[e],i.length>0){const s=i.map(a=>a.details.symbol.type||a.details.symbol.declaredClass).filter(a=>!!a);s.sort();const r=[];return s.forEach((a,o)=>{o!==0&&a===s[o-1]||r.push(a)}),new L("renderer-conversion-3d:unsupported-symbols",`Renderer contains symbols (${r.join(", ")}) which are not supported in 3D`,{renderer:t,symbolErrors:i})}return null}function ni(t){return he(t,V(t.symbol).error)}function oi(t,e){var a;const i={...Me,...e},s=(a=t.uniqueValueInfos)==null?void 0:a.map(o=>V(o.symbol,i).error).filter(H),r=V(t.defaultSymbol,i);return r.error&&(s==null||s.unshift(r.error)),he(t,s)}function li(t){const e=t.classBreakInfos.map(s=>V(s.symbol).error).filter(H),i=V(t.defaultSymbol);return i.error&&e.unshift(i.error),he(t,e)}const hi=Be.fromSimpleMarkerSymbol(Qt),di=qe.fromSimpleLineSymbol(Kt),ci=He.fromSimpleFillSymbol(ei),pi=new Ne({symbolLayers:[new We({material:{color:ti},edges:new Ye({size:"1px",color:ii})})]});function ui(t){if(t==null)return null;switch(t.type){case"mesh":return pi;case"point":case"multipoint":return hi;case"polyline":return di;case"polygon":case"extent":return ci}return null}const Oe=re();let x=class extends k{constructor(e){super(e),this.events=new ae,this.hasZ=null,this.hasM=null,this.objectIdField=null,this.featureAdapter={getAttribute:(i,s)=>"graphic"in i?i.graphic.attributes[s]:$.getAttribute(i,s),getAttributes:i=>"graphic"in i?i.graphic.attributes:$.getAttributes(i),getObjectId:i=>"graphic"in i?z(i.graphic,this.objectIdField)??void 0:$.getObjectId(i),getGeometry:i=>"graphic"in i?i.getAsOptimizedGeometry(this.hasZ,this.hasM):$.getGeometry(i),getCentroid:(i,s)=>{if("graphic"in i){let r=null;i.centroid!=null?r=i.centroid:i.graphic.geometry.type==="point"&&Ze(i.graphic.geometry,Pe,this.viewSpatialReference)&&(r=Pe);const a=new Array(2+(s.hasZ?1:0)+(s.hasM?1:0));return r==null?(a[0]=0,a[1]=0,a[2]=0,a[3]=0):(a[0]=r.x,a[1]=r.y,s.hasZ&&(a[2]=r.hasZ?r.z:0),s.hasM&&(a[s.hasZ?3:2]=r.hasM?r.m:0)),new Xe([],a)}return $.getCentroid(i,s)},cloneWithGeometry:(i,s)=>"graphic"in i?new Je(s,this.featureAdapter.getAttributes(i),null,this.featureAdapter.getObjectId(i)):$.cloneWithGeometry(i,s)}}forEachInBounds(e,i){this.getSpatialIndex().forEachInBounds(e,i)}forEachBounds(e,i){const s=this.getSpatialIndex();for(const r of e){const a=this.featureAdapter.getObjectId(r);s.getBounds(a,Oe)!=null&&i(Oe)}}};n([l({constructOnly:!0})],x.prototype,"getSpatialIndex",void 0),n([l({constructOnly:!0})],x.prototype,"forEach",void 0),n([l({constructOnly:!0})],x.prototype,"hasZ",void 0),n([l({constructOnly:!0})],x.prototype,"hasM",void 0),n([l({constructOnly:!0})],x.prototype,"objectIdField",void 0),n([l({constructOnly:!0})],x.prototype,"viewSpatialReference",void 0),n([l({constructOnly:!0})],x.prototype,"featureSpatialReference",void 0),x=n([U("esri.views.3d.layers.graphics.Graphics3DFeatureStore")],x);const Pe={type:"point",x:0,y:0,hasZ:!1,hasM:!1,spatialReference:null};let yi=class extends $e{constructor(e,i,s){super(e,i,s),this._calloutSymbolLayer=null,this.symbol.hasVisibleCallout()&&(this._calloutSymbolLayer=Qe(this.symbol,i))}async doLoad(e){var s;const i=this._calloutSymbolLayer?Ke(this._calloutSymbolLayer.load()):null;try{await super.doLoad(e),B(e)}catch(r){throw(s=this._calloutSymbolLayer)==null||s.abortLoad(),r}i&&await i}destroy(){super.destroy(),this._calloutSymbolLayer=_(this._calloutSymbolLayer)}createGraphics3DGraphic(e,i){const s=super.createGraphics3DGraphic(e,i);if(this._calloutSymbolLayer!=null&&s!=null){const r=this._createCalloutGraphic(e);r&&s.setCalloutGraphic(r)}return s}globalPropertyChanged(e,i){return!!super.globalPropertyChanged(e,i)&&(!this._calloutSymbolLayer||this._calloutSymbolLayer.globalPropertyChanged(e,i,s=>s.calloutLayer))}updateGeometry(e,i){const s=super.updateGeometry(e,i);if(s&&this._calloutSymbolLayer){const r=e.calloutLayer;if(r)return this._calloutSymbolLayer.updateGeometry(r,i)}return s}_createCalloutGraphic(e){const i=e.renderingInfo;return e.renderingInfo=new et(i.renderer,i.symbol),this._calloutSymbolLayer.createGraphics3DGraphic(e)}};function gi(t,e,i){return t.type==="point-3d"?new yi(t,e,i):new $e(t,e,i)}let mi=class{constructor(e){this._graphicsCore=e,this._idToState=new Map,this._states=new Set;const i=e.owner.layer&&e.owner.layer.objectIdField;i?(this._getGraphicId=s=>z(s,i),this._getGraphics3DGraphicById=s=>this._graphicsCore.getGraphics3DGraphicByObjectId(s)):(this._getGraphicId=s=>s.uid,this._getGraphics3DGraphicById=s=>this._graphicsCore.getGraphics3DGraphicById(s))}destroy(){this._idToState.clear(),this._states.forEach((e,i)=>this.remove(i))}add(e){const i=ne(()=>this.remove(e));if(this._states.has(e))return i;const s=this._getGraphicId(e.graphic),r=this._getGraphics3DGraphicById(s);return this._states.has(e)||this._states.add(e),this._ensureStateList(s).push(e),e.displaying=r!=null&&r.isVisible(),e.isDraped=r!=null&&r.isDraped,e.tracking=!0,r!=null&&e.emit("changed"),i}remove(e){if(this._states.has(e)){if(this._idToState.size){const i=this._getGraphicId(e.graphic),s=this._idToState.get(i);s&&(tt(s,e),s.length===0&&this._idToState.delete(i))}this._states.delete(e),e.tracking=!1,e.displaying=!1}}addGraphic(e){this._forEachState(e,i=>{i.displaying=e.isVisible(),i.isDraped=e.isDraped,i.emit("changed")})}removeGraphic(e){this._forEachState(e,i=>{i.displaying=!1,i.isDraped=!1})}updateGraphicGeometry(e){this._forEachState(e,i=>i.emit("changed"))}updateGraphicVisibility(e){this._forEachState(e,i=>i.displaying=e.isVisible())}allGraphicsDeleted(){this._states.forEach(e=>{e.displaying=!1})}_ensureStateList(e){const i=this._idToState.get(e);if(i)return i;const s=new Array;return this._idToState.set(e,s),s}_forEachState(e,i){if(this._states.size===0||this._idToState.size===0)return;const s=this._getGraphicId(e.graphic),r=this._idToState.get(s);r!=null&&r.forEach(i)}},O=class extends k{constructor(e){super(e),this._index=new si(9,it("esri-csp-restrictions")?i=>({minX:i.extent[0],minY:i.extent[1],maxX:i.extent[2],maxY:i.extent[3]}):[".extent[0]",".extent[1]",".extent[2]",".extent[3]"]),this._missing=new Set,this._boundsByFeature=new Map,this.spatialReference=null,this.hasZ=null,this.hasM=null,this.objectIdField=null,this.updating=!1}setup(e){this._addMany(e)}destroy(){this._missing.clear(),this._index=_(this._index),this._boundsByFeature.clear(),this._boundsByFeature=null}update(){this._missing.size>0&&(this._addMany(Array.from(this._missing.values())),this.updating=!1,this._missing.clear())}get updatingRemaining(){return this._missing.size}queryGraphicUIDsInExtent(e,i,s){i!=null&&i.equals(this.spatialReference)&&(w.minX=e[0],w.minY=e[1],w.maxX=e[2],w.maxY=e[3],this.update(),this._index.search(w,r=>s(r.graphic.uid)))}add(e){this._missing.add(e),this.updating=!0}remove(e){if(this._missing.delete(e))return void(this.updating=this._missing.size>0);this._index.remove(e);const i=z(e.graphic,this._get("objectIdField"));i!=null&&this._boundsByFeature.delete(i)}_addMany(e){if(e.length===0)return;const i=this._get("objectIdField");for(const s of e){s.computeExtent(this.spatialReference);const r=z(s.graphic,i);r!=null&&this._boundsByFeature.set(r,s.extent)}this._index.load(e)}clear(){this._index.clear(),this._missing.clear(),this._boundsByFeature.clear(),this.updating=!1}forEachInBounds(e,i){w.minX=e[0],w.minY=e[1],w.maxX=e[2],w.maxY=e[3],this.update(),this._index.search(w,s=>{i(s)})}getBounds(e,i){this.update();const s=this._boundsByFeature.get(e);return s?Fe(i,s):null}};n([l({constructOnly:!0})],O.prototype,"spatialReference",void 0),n([l({constructOnly:!0})],O.prototype,"hasZ",void 0),n([l({constructOnly:!0})],O.prototype,"hasM",void 0),n([l({constructOnly:!0})],O.prototype,"objectIdField",void 0),n([l()],O.prototype,"updating",void 0),n([l({readOnly:!0})],O.prototype,"updatingRemaining",null),O=n([U("esri.views.3d.layers.graphics.SpatialIndex2D")],O);const w={minX:0,minY:0,maxX:0,maxY:0},_i=1;let A=class extends ae.EventedMixin(k){get spatialReference(){var e;return(e=this.view)==null?void 0:e.spatialReference}constructor(e){super(e),this._elevationOffset=0,this._layerHandes=new N}initialize(){this._renderCoordsHelper=this.view.renderCoordsHelper,this._intersectLayers=[this.stageLayer],this._intersector=st(this.view.state.viewingMode),this._intersector.options.store=rt.MIN;const e=this._computeLayerExtent(this.spatialReference,this.stageLayer);this._zmin=e[2],this._zmax=e[5];const i=this.stageLayer.events;this._layerHandes.add([i.on("layerObjectAdded",s=>this._objectChanged(s.object)),i.on("layerObjectRemoved",s=>this._objectChanged(s.object)),i.on("objectGeometryAdded",s=>this._objectChanged(s.object)),i.on("objectGeometryRemoved",s=>this._objectChanged(s.object)),i.on("objectGeometryUpdated",s=>this._objectChanged(s.object)),i.on("objectTransformation",s=>this._objectChanged(s))])}dispose(){this._layerHandes.destroy()}elevationInfoChanged(){const e=this.layer!=null?this.layer.elevationInfo:null;if(e!=null&&e.mode!=="on-the-ground"){const i=at(this.layer.spatialReference),s=nt(e.unit??"meters");this._elevationOffset=(e.offset??0)*s/i}else this._elevationOffset=0}getElevation(e,i,s,r){if(b[0]=e,b[1]=i,b[2]=s,!this._renderCoordsHelper.toRenderCoords(b,r,b))return oe.getLogger(this).error("could not project point for elevation alignment"),null;const a=this._elevationOffset,o=this._zmin+a,d=this._zmax+a;this._renderCoordsHelper.setAltitude(Ae,d,b),this._renderCoordsHelper.setAltitude(Le,o,b);const h=c=>!!c.lastValidElevationBB;return this._intersector.reset(Ae,Le,null),this._intersector.intersect(this._intersectLayers,null,_i,null,h),this._intersector.results.min.getIntersectionPoint(b)?this._renderCoordsHelper.getAltitude(b):null}_objectChanged(e){const i=this.spatialReference;if(!e.lastValidElevationBB||!i)return;ee(D);const s=e.lastValidElevationBB;s.isEmpty()||this._expandExtent(i,s.min,s.max,D);const{min:r,max:a}=e.boundingVolumeWorldSpace;this._expandExtent(i,r,a,D),ot(D,ie),this._zmin=Math.min(this._zmin,D[2]),this._zmax=Math.max(this._zmax,D[5]),Q.extent=ie,Q.spatialReference=i,this.emit("elevation-change",Q),de(s.min,r),de(s.max,a)}_computeLayerExtent(e,i){return ee(D),e!=null&&i.objects.forAll(s=>this._expandExtent(e,s.boundingVolumeWorldSpace.min,s.boundingVolumeWorldSpace.max,D)),D}_expandExtent(e,i,s,r){for(let a=0;a<8;++a)b[0]=1&a?i[0]:s[0],b[1]=2&a?i[1]:s[1],b[2]=4&a?i[2]:s[2],this._renderCoordsHelper.fromRenderCoords(b,b,e),lt(r,b);return r}};n([l({constructOnly:!0})],A.prototype,"layer",void 0),n([l({constructOnly:!0})],A.prototype,"stageLayer",void 0),n([l({constructOnly:!0})],A.prototype,"view",void 0),n([l()],A.prototype,"spatialReference",null),A=n([U("esri.views.3d.layers.support.StageLayerElevationProvider")],A);const D=ee(),ie=ht(),Q={spatialReference:null,extent:ie,context:"scene"},b=j(),Ae=j(),Le=j();var se;const K=j(),bi=re(),ke="esri.views.3d.layers.graphics.Graphics3DCore",f=oe.getLogger(ke);let p=se=class extends k{get _viewSpatialReference(){return this.owner.view.spatialReference}get spatialIndex(){var t;return this._spatialIndex||(this._spatialIndex=new O({objectIdField:(t=this.owner.layer)==null?void 0:t.objectIdField,spatialReference:this._viewSpatialReference,hasZ:!!this.hasZ,hasM:!!this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values()))),this._spatialIndex.update(),this._spatialIndex}get numberOfGraphics(){return this._numberOfGraphics}get effectiveUpdatePolicy(){return this.currentRenderer!=null&&this.currentRenderer.type==="dictionary"?v.ASYNC:this._forcedUpdatePolicy??this.preferredUpdatePolicy}get featureStore(){return this._featureStore}get initializePromise(){return this._initializePromise}get scaleVisibility(){return this._scaleVisibility}get elevationAlignment(){return this._elevationAlignment}get objectStates(){return this._objectStates}get filterVisibility(){return this._filterVisibility}get updating(){var t;return!!(this._graphicsWaitingForSymbol.size>0||this.running||(t=this._elevationAlignment)!=null&&t.updating||this._scaleVisibility!=null&&this._scaleVisibility.updating||this._filterVisibility!=null&&this._filterVisibility.updating||this._rendererChangeAbortController||this._elevationInfoChangeAbortController||this._updatingPendingLoadedGraphicsChange||this._frameTask.updating||this._loadingSymbols>0)}get running(){var t;return this._pendingUpdates.size>0||!!((t=this._spatialIndex)!=null&&t.updating)}get suspendedOrOutsideOfView(){var t;return this.owner.suspended||!!((t=this.owner.suspendInfo)!=null&&t.outsideOfView)}get updatingRemaining(){var t,e;return this.updating?this._pendingUpdates.size+.1*(((t=this._spatialIndex)==null?void 0:t.updatingRemaining)||0)+.1*(((e=this._elevationAlignment)==null?void 0:e.updatingRemaining)||0):0}get displayFeatureLimit(){const t=this.owner&&this.owner.view&&this.owner.view.qualitySettings,e=t?t.graphics3D.minTotalNumberOfFeatures:0,i=t?t.graphics3D.maxTotalNumberOfFeatures:0,s=t?t.graphics3D.maxTotalNumberOfPrimitives:0,r=this.averageSymbolComplexity,a=Math.max(1,r!=null?r.primitivesPerFeature:1),o=r!=null&&r.drawCallsPerFeature>0?i/r.drawCallsPerFeature*.3:i,d=Math.ceil(s/a),h=Math.max(e,Math.min(i,d,o)),c=this._get("displayFeatureLimit");return c&&c.minimumTotalNumberOfFeatures===e&&c.maximumTotalNumberOfFeatures===i&&c.maximumTotalNumberOfPrimitives===s&&c.averageSymbolComplexity===r&&c.maximumNumberOfFeatures===h?c:{minimumTotalNumberOfFeatures:e,maximumTotalNumberOfFeatures:i,maximumTotalNumberOfPrimitives:s,averageSymbolComplexity:r,maximumNumberOfFeatures:h}}get averageSymbolComplexity(){const t=dt(this._symbolComplexities),e=this._get("averageSymbolComplexity");return t.numComplexities===0||e!=null&&(t.estimated&&(e.primitivesPerFeature>=t.primitivesPerFeature||e.primitivesPerCoordinate>=t.primitivesPerCoordinate||e.drawCallsPerFeature>=t.drawCallsPerFeature)||e.primitivesPerFeature===t.primitivesPerFeature&&e.primitivesPerCoordinate===t.primitivesPerCoordinate&&e.drawCallsPerFeature===t.drawCallsPerFeature)?e:t}get usedMemory(){const t=this.averageSymbolComplexity!=null&&this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel*this._numberOfGraphics:0,e=this._getSymbolComplexitiesUsed().reduce((i,s)=>i+s.memory.resourceBytes,0);return this._usedMemory+t+e}get usedMemoryPerGraphic(){if(this._usedMemory&&this._numberOfGraphics){const t=this._numberOfGraphics/(this._numberOfGraphics+Math.max(this._pendingAdds,this._pendingRemoves));return this._usedMemory/this._numberOfGraphics*t}if(this.averageSymbolComplexity!=null){const t=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+t}return 0}get unprocessedMemoryEstimate(){return(this._pendingAdds-this._pendingRemoves)*this.usedMemoryPerGraphic}get _symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}get visible(){return this._visible}_getConvertedSymbol(t){var r;if(t.type==="web-style")return t.clone();const e=this._symbolConversionCache.get(t.id);if(e!=null)return e;const i=V(t,{geometryType:((r=this.layer)==null?void 0:r.geometryType)??void 0,retainId:!0,hasLabelingContext:this._hasLabelingContext(t)}),s=i.symbol||null;return s==null&&i.error&&f.error(i.error.message),this._symbolConversionCache.set(t.id,s),s}_getSymbolComplexitiesUsedOrRenderer(t){if(t==null)return[];const e=t.getSymbols(),i="backgroundFillSymbol"in t?t.backgroundFillSymbol:null;if(!(i||e&&e.length))return[];const s=[],r=this._getSymbolComplexityUsedOrRenderer(i);r!=null&&s.push(r);for(const a of e){const o=this._getSymbolComplexityUsedOrRenderer(a);o!=null&&s.push(o)}return s}_getSymbolComplexityUsedOrRenderer(t){if(t==null)return null;const e=this._symbols.get(t.id);if(e!=null)return e.complexity;const i=this._getConvertedSymbol(t);return i!=null?ct(i):null}_getSymbolComplexitiesUsed(){const t=[];return this._symbols.forEach(e=>{e!=null&&t.push(e.complexity)}),t}get _objectIdField(){return this.layer.objectIdField}constructor(t){super(t),this._propertiesPool=new pt({computedExtent:ut},this),this.computedExtent=null,this.currentRenderer=null,this.rendererHasGeometryOperations=!1,this._graphicStateTracking=null,this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this._graphicsDrapedUids=new Set,this._graphicsBySymbol=new Map,this._symbolConversionCache=new Map,this._symbols=new Map,this._graphicsWithoutSymbol=new Map,this._graphicsWaitingForSymbol=new Map,this._graphicsUpdateId=0,this._handles=new N,this._frameTask=ce,this._suspendSymbolCleanup=!1,this._arcadeOnDemand=null,this._rendererChangeAbortController=null,this._elevationInfoChangeAbortController=null,this._initializeAbortController=null,this._scaleVisibility=null,this._filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this._featureStore=null,this._deconflictor=null,this._labeler=null,this._objectStates=null,this._viewElevationProvider=null,this._stageLayerElevationProvider=null,this._sharedSymbolResourcesOwnerHandle=null,this._whenGraphics3DGraphicRequests={},this._pendingUpdates=new Map,this._numberOfGraphics=0,this._numberOfGraphicsProvidingElevation=0,this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this._loadingSymbols=0,this._pendingUpdatesPool=new te({allocator:e=>e||new fi,deallocator:e=>(e.clear(),e)}),this._symbolWarningLogged=!1,this._geometryWarningLogged=!1,this._objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new te,this.preferredUpdatePolicy=v.SYNC,this._forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.setUidToIdOnAdd=!0,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=!1,this._startCreateGraphics=!1,this.symbolCreationContext=new yt(t.owner.view.resourceController.scheduler,(e,i)=>this._frameTask.schedule(e,i))}initialize(){this._featureStore=new x({objectIdField:this.owner.layer&&this.owner.layer.objectIdField,hasZ:!!this.hasZ,hasM:!!this.hasM,viewSpatialReference:this._viewSpatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forEach:i=>this.graphics3DGraphics.forEach(i)});const t=(i,s,r)=>this.spatialIndex.queryGraphicUIDsInExtent(i,s,r),{componentFactories:e}=this;if(e.elevationAlignment!=null){const i=e.elevationAlignment(this,t);this._elevationAlignment=i}if(e.scaleVisibility!=null){const i=e.scaleVisibility(this,t);this._scaleVisibility=i}if(e.filterVisibility!=null){const i=e.filterVisibility({featureStore:this._featureStore,getFeatureCount:()=>this.graphics3DGraphics.size,updateFeatureVisibilities:s=>this.modifyGraphics3DGraphicVisibilities(r=>r.setVisibilityFlag(E.GRAPHIC,R.FILTER,s(z(r.graphic,this._objectIdField)))),setAllFeaturesVisibility:s=>this.modifyGraphics3DGraphicVisibilities(r=>r.setVisibilityFlag(E.GRAPHIC,R.FILTER,s)),clearFeaturesVisibility:()=>this.modifyGraphics3DGraphicVisibilities(s=>s.setVisibilityFlag(E.GRAPHIC,R.FILTER,!0))});this._filterVisibility=i}if(e.deconflictor!=null){const i=e.deconflictor(this);this._deconflictor=i}if(e.labeler!=null&&this._scaleVisibility!=null){const i=e.labeler(this,this._scaleVisibility);this._labeler=i}if(e.objectStates!=null){const i=e.objectStates(this);this._objectStates=i}this._initializeAbortController=new AbortController,this._initializePromise=this._initializeAsync()}async _initializeAsync(){var r,a,o,d;const t=(r=this._initializeAbortController)==null?void 0:r.signal,e=this.owner.view;this._viewElevationProvider=new gt(this._viewSpatialReference,e),this._initializeStage(e,this.layer.uid);const i=e.sharedSymbolResources;this.symbolCreationContext.sharedResources=i,this._sharedSymbolResourcesOwnerHandle=i.addGraphicsOwner(this.owner),this.currentRenderer!=null&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.streamDataRequester=i.streamDataRequester,this.symbolCreationContext.renderCoordsHelper=e.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new mt(e.renderSpatialReference),this.symbolCreationContext.elevationProvider=e.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=h=>this.notifyGraphicGeometryChanged(h),this.symbolCreationContext.notifyGraphicVisibilityChanged=h=>this.notifyGraphicVisibilityChanged(h);const s=pe(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);if(this.symbolCreationContext.featureExpressionInfoContext=await ue(s,this._viewSpatialReference,t,f),B(t),this.symbolCreationContext.screenSizePerspectiveEnabled=e.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!((a=this.owner.view.qualitySettings)!=null&&a.physicallyBasedRenderingEnabled),this.symbolCreationContext.skipHighSymbolLods=!!((d=(o=this.owner.view.qualitySettings)==null?void 0:o.graphics3D)!=null&&d.skipHighSymbolLods),"drapeSourceType"in this.owner){const{owner:h}=this;this.symbolCreationContext.drapeSourceRenderer=e.basemapTerrain.overlayManager.registerGeometryDrapeSource(h),this._handles.add(ne(()=>e.basemapTerrain.overlayManager.unregisterDrapeSource(h)))}this._handles.add([C(()=>this.suspendedOrOutsideOfView,()=>this._frameTask.reschedule(()=>this._updateLayerVisibility())),C(()=>{var h,c;return[(h=this.layer)==null?void 0:h.screenSizePerspectiveEnabled,(c=this.owner.view)==null?void 0:c.screenSizePerspectiveEnabled]},()=>{var c;const h=e.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled;h!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=h,(c=this._labeler)==null||c.reset(),this.recreateAllGraphicsAndSymbols())}),C(()=>this.owner.slicePlaneEnabled,h=>this._slicePlaneEnabledChange(!!h)),C(()=>{var h;return(h=this.owner.view.state)==null?void 0:h.rasterPixelRatio},()=>this._pixelRatioChange()),C(()=>{var h;return!!((h=this.owner.view.qualitySettings)!=null&&h.physicallyBasedRenderingEnabled)},h=>this._physicalBasedRenderingChange(h)),C(()=>{var h,c;return!!((c=(h=this.owner.view.qualitySettings)==null?void 0:h.graphics3D)!=null&&c.skipHighSymbolLods)},h=>this._skipHighSymbolLoDsChange(h)),_t(()=>{var h;return(h=e.basemapTerrain)==null?void 0:h.tilingScheme},h=>{if(h.spatialReference.equals(this.symbolCreationContext.overlaySR)||e.basemapTerrain.spatialReference==null||(this.symbolCreationContext.overlaySR=e.basemapTerrain.spatialReference),this._handles.has("loaded-graphics"))this.recreateAllGraphics();else{const c=()=>{var u;return(u=this.owner)==null?void 0:u.loadedGraphics};this._handles.add([bt(c,"change",u=>{this._graphicsCollectionChanged(u),this._signalUpdatingDuringAsyncLoadedGraphicsChange()},{onListenerAdd:()=>{this.recreateAllGraphics(),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],"loaded-graphics")}},{initial:!0}),C(()=>this.effectiveUpdatePolicy,h=>{this.stageLayer!=null&&(this.stageLayer.updatePolicy=h),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===v.ASYNC,h===v.SYNC&&this.runTask(Te)},ft)]),this._frameTask=e.resourceController.scheduler.registerTask(W.GRAPHICS_CORE,this),this.layer&&"featureReduction"in this.layer&&this._handles.add(C(()=>this.layer.featureReduction,()=>this._deconflictor.featureReductionChange())),this.notifyChange("averageSymbolComplexity"),this.rendererChange(this.owner.renderer).catch(()=>{}),this._initializeAbortController=null}_abortInitialize(){this._initializeAbortController&&(this._initializeAbortController.abort(),this._initializeAbortController=null)}destroy(){var t,e,i,s;this._abortInitialize(),this._abortRendererChange(),this._abortElevationInfoChange(),this._frameTask.remove(),this._frameTask=ce,(e=(t=this.owner.view)==null?void 0:t.deconflictor)==null||e.removeGraphicsOwner(this),(s=(i=this.owner.view)==null?void 0:i.labeler)==null||s.removeGraphicsOwner(this),this._elevationAlignment=_(this._elevationAlignment),this._scaleVisibility=_(this._scaleVisibility),this._filterVisibility=_(this._filterVisibility),this._deconflictor=null,this._labeler=null,this._objectStates=_(this._objectStates),this.clear(),this._featureStore=_(this._featureStore),this._updatingPendingLoadedGraphicsChange=ye(this._updatingPendingLoadedGraphicsChange),this._graphicStateTracking=_(this._graphicStateTracking),this.stage&&(this.stageLayer=_(this.stageLayer),this.stage=null),this._handles=_(this._handles),this._set("owner",null);for(const r in this._whenGraphics3DGraphicRequests)this._whenGraphics3DGraphicRequests[r].reject(new L("graphic:layer-destroyed","Layer has been destroyed"));this._whenGraphics3DGraphicRequests=null,this._sharedSymbolResourcesOwnerHandle=ye(this._sharedSymbolResourcesOwnerHandle),this._propertiesPool=_(this._propertiesPool),this._pendingUpdatesPool=null,this._symbolConversionCache.clear(),this._objectIdInvisibleSet.clear(),this._spatialIndex=_(this._spatialIndex)}clear(){var t,e;(t=this._objectStates)==null||t.allGraphicsDeleted(),this._graphicStateTracking!=null&&this._graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach(i=>i.destroy()),(e=this._spatialIndex)==null||e.clear(),this.graphics3DGraphics.clear(),this._numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this._symbols.forEach(_),this._symbols.clear(),this._graphicsBySymbol.clear(),this._graphicsWithoutSymbol.clear(),this._graphicsWaitingForSymbol.clear(),this._pendingUpdates.clear(),this._pendingUpdatesPool.clear(),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this.notifyChange("updating"),this.notifyChange("running"),this.notifyChange("updatingRemaining"),this._featureStore.events.emit("changed")}_initializeStage(t,e){this.stage=t._stage,this.stageLayer=new vt(this.stage,{pickable:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},e);const i=this.stageLayer.events;i.on("objectTransformation",s=>this.notifyGraphicGeometryChanged(s.graphicUid)),i.on("objectShaderTransformation",s=>this.notifyGraphicGeometryChanged(s.graphicUid)),i.on("visibilityChanged",s=>this.notifyGraphicVisibilityChanged(s.graphicUid)),i.on("objectGeometryAdded",s=>this.notifyGraphicGeometryChanged(s.object.graphicUid)),i.on("objectGeometryRemoved",s=>this.notifyGraphicGeometryChanged(s.object.graphicUid)),i.on("objectGeometryUpdated",s=>this.notifyGraphicGeometryChanged(s.object.graphicUid))}notifyGraphicGeometryChanged(t){if(this._graphicStateTracking==null||t==null)return;const e=this.graphics3DGraphics.get(t);e&&this._graphicStateTracking.updateGraphicGeometry(e)}notifyGraphicVisibilityChanged(t){if(this._graphicStateTracking==null||t==null)return;const e=this.graphics3DGraphics.get(t);e&&this._graphicStateTracking.updateGraphicVisibility(e)}_updateLayerVisibility(){const t=this.displayFeatureLimit.maximumNumberOfFeatures,e=this._numberOfGraphics>t*vi,i=!this.suspendedOrOutsideOfView&&!e;i!==this._visible&&(this._visible=i,i?(this.stageLayer.pickable=!0,this.updateAllGraphicsVisibility()):(this.stageLayer.pickable=!1,this._hideAllGraphics()),this._updateStageLayerVisibility())}_updateStageLayerVisibility(){this.stageLayer.visible=this._visible&&(this.layer.opacity==null||this.layer.opacity>0)}getGraphics3DGraphicById(t){return t!=null?this.graphics3DGraphics.get(t):void 0}getGraphics3DGraphicByObjectId(t){var e;return(e=this.owner.layer)!=null&&e.objectIdField?this._findGraphics3DGraphicByObjectId(t):null}_getGraphicObjectID(t,e=this.owner.layer&&this.owner.layer.objectIdField){return z(t,e)}get graphics3DGraphicsByObjectID(){const t=this.owner.layer&&this.owner.layer.objectIdField;if(!t)return;const e=new Map;return this.graphics3DGraphics.forEach(i=>{if(!i)return;const s=i.graphic,r=this._getGraphicObjectID(s,t);r!=null&&e.set(r,i)}),e}get labelsEnabled(){return!(!this._labeler||!this._labeler.layerLabelsEnabled())}async updateLabelingInfo(t){const e=this._deconflictor&&this._deconflictor.labelingInfoChange(t),i=this._labeler&&this._labeler.labelingInfoChange(t);await St([e,i])}updateVisibilityInfo(){this._deconflictor&&this._deconflictor.labelingInfoChange(),this._labeler&&this._labeler.visibilityInfoChange()}get symbolUpdateType(){if(this._pendingUpdates.size>0)return"unknown";let t=0,e=0;return Ct(this._symbols,(i,s)=>{if(i!=null){const r=i.getFastUpdateStatus();if(r.loading>0)return!0;this._graphicsBySymbol.has(s)&&(e+=r.fast,t+=r.slow)}return!1})?"unknown":e>=0&&t===0?"fast":t>=0&&e===0?"slow":"mixed"}runTask(t){if(this._frameTask.processQueue(t),this._applyPendingUpdates(t),this.notifyChange("running"),this.running||this.notifyChange("updating"),this.notifyChange("updatingRemaining"),!t.hasProgressed)return le.YIELD}setObjectIdVisibility(t,e){e?this._objectIdInvisibleSet.delete(t):this._objectIdInvisibleSet.add(t);const i=this._findGraphics3DGraphicByObjectId(t);i!=null&&this._updateUserVisibility(i)}_findGraphics3DGraphicByObjectId(t){return wt(this.graphics3DGraphics,e=>this._getGraphicObjectID(e.graphic)===t)}_updateUserVisibility(t){if(t==null)return!1;const e=t.graphic,i=this._getGraphicObjectID(e),s=e.visible&&!this.owner.suspended&&(i==null||!this._objectIdInvisibleSet.has(i));return t.setVisibilityFlag(E.GRAPHIC,R.USER,s)}_whenGraphics3DGraphic(t){const e=this.graphics3DGraphics.get(t.uid);if(e)return Promise.resolve(e);const i=this._whenGraphics3DGraphicRequests[t.uid];if(i)return i.promise;const s=Gt();return this._whenGraphics3DGraphicRequests[t.uid]=s,s.promise}async _boundsForGraphics3DGraphic(t,e){const i=this._viewSpatialReference,s=this.owner.view.renderSpatialReference,r=this.owner.view.basemapTerrain.spatialReference,a=(u,y,g)=>Se(u,s,y,u,i,y,g),o=(u,y,g)=>Se(u,r,y,u,i,y,g),d=this._viewElevationProvider?{service:this._viewElevationProvider,useViewElevation:e!=null&&!!e.useViewElevation,minDemResolution:e!=null?e.minDemResolution:null,minDemResolutionForPoints:this.owner.view.resolution}:null,h=await t.getProjectedBoundingBox(a,o,d,e==null?void 0:e.signal);if(!h)return null;const c=h.boundingBox;if(h.requiresDrapedElevation){const u=this.symbolCreationContext.elevationProvider;if(u){xt(c,K);const y=u.getElevation(K[0],K[1],0,i,"ground")??0;c[2]=Math.min(c[2],y),c[5]=Math.max(c[5],y)}}return{boundingBox:c,screenSpaceObjects:h.screenSpaceObjects}}async whenGraphicBounds(t,e){await It(()=>{var a;return(a=this.owner)==null?void 0:a.loadedGraphics});const i=this.owner.layer&&this.owner.layer.objectIdField,s=this.owner.loadedGraphics.find(a=>a===t||i!=null&&a.attributes!=null&&t.attributes&&a.attributes[i]===t.attributes[i]);if(!s)throw new L("internal:graphic-not-part-of-view","Graphic is not part of this view");const r=await this._whenGraphics3DGraphic(s);return this._boundsForGraphics3DGraphic(r,e)}computeAttachmentOrigin(t,e){const i=this.graphics3DGraphics.get(t.uid);if(!i)return null;const s=i.computeAttachmentOrigin();if(s.render.num===0&&s.draped.num===0)return null;ge(G,0,0,0);let r=0;if(s.render.num>0){if(!me(s.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,F,e))return null;_e(G,G,F),r++}if(s.draped.num>0){const[a,o]=s.draped.origin,d=this._viewElevationProvider.getElevation(a,o,"ground")??0;if(ge(F,a,o,d),!me(F,this._viewElevationProvider.spatialReference,F,e))return null;_e(G,G,F),r++}return r>1&&Et(G,G,1/r),new Rt({x:G[0],y:G[1],z:G[2],spatialReference:e})}getSymbolLayerSize(t,e){const i=this._symbols.get(t.id);if(i==null)throw new L("internal:symbol-not-part-of-view","Symbol is not part of this view");const s=t.symbolLayers.indexOf(e);if(s===-1)throw new L("internal:missing-symbol-layer","Symbol layer is not in symbol");const r=i.getSymbolLayerSize(s);if(r==null)throw new L("internal:missing-size","Symbol layer has no valid size");return r}_graphicsCollectionChanged(t){this._startCreateGraphics&&(this.add(t.added),this.remove(t.removed))}graphicUpdateHandler(t){const e=t.graphic.uid,i=this.graphics3DGraphics.get(e);if(i!=null||this._graphicsWithoutSymbol.get(e)!=null)switch(t.property){case"visible":this._graphicUpdateVisibleHandler(i);break;case"geometry":this._graphicUpdateGeometryHandler(i,t);break;case"symbol":this._graphicUpdateSymbolHandler(i,t);break;case"attributes":break;case"origin-transform":this._graphicUpdateTransformHandler(i,t)}}_graphicUpdateGeometryHandler(t,e){this._graphicUpdateGeometryOrTransformHandler(t,e,()=>e.newValue!=null&&t!=null&&t.graphics3DSymbol.updateGeometry(t,e.newValue));const i=e.graphic.geometry;i!=null&&this._expandComputedExtent(i)}_graphicUpdateTransformHandler(t,e){const i=e.graphic.geometry;this._graphicUpdateGeometryOrTransformHandler(t,e,()=>e.newValue!=null&&t!=null&&i!=null&&t.graphics3DSymbol.updateTransform(t,i.spatialReference,e.newValue,e.action))}_graphicUpdateGeometryOrTransformHandler(t,e,i){if(e.graphic.geometry!=null)if(t!=null)i()||this._recreateGraphic(t.graphic);else{const s=e.graphic.symbol&&e.graphic.symbol.id;if(s){const r=this._symbols.get(s);if(r!=null&&r.loadStatus===Dt.LOADING)return}this._recreateGraphic(e.graphic)}else this._recreateGraphic(e.graphic)}_graphicUpdateSymbolHandler(t,e){const i=e.graphic,s=t!=null?t.graphics3DSymbol:e.oldValue!=null?this._symbols.get(e.oldValue.id):null;if(s==null||e.newValue==null)return void this._recreateGraphic(i);const r=s.symbol,a=this._getConvertedSymbol(e.newValue);if(a!=null&&(a.type!==r.type||a.type==="web-style")||r.type==="web-style")return void this._recreateGraphic(i);const o=this._graphicsBySymbol.get(r.id);if(o&&o.size!==1)return void this._recreateGraphic(i);const d=De(r,a);if(d==null)return void this._updateSymbolMapping(r.id,a);const h={diff:d,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(s.prepareSymbolPatch(h),!Jt(h.diff))return void this._recreateGraphic(i);const c=this._getRenderingInfo(i);if(c==null)return void this._recreateGraphic(i);const u=s.extentPadding;for(const y of h.symbolStatePatches)y();if(u!==s.extentPadding&&this._recomputeExtentPadding(),t!=null)for(const y of h.graphics3DGraphicPatches)y(t,c);this._updateSymbolMapping(r.id,a)}_graphicUpdateVisibleHandler(t){this._updateUserVisibility(t)&&(this._labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}recreateGraphics(t){this._suspendSymbolCleanup=!0,this.remove(t),this.add(t),this._suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===v.SYNC&&this._cleanupSymbols()}_recreateGraphic(t){this.recreateGraphics([t])}_beginGraphicUpdate(t){const e=this._graphicsUpdateId;return this._graphicsUpdateId++,this._graphicsWaitingForSymbol.set(t.uid,e),this._graphicsWaitingForSymbol.size===1&&this.notifyChange("updating"),e}_endGraphicUpdate(t){t&&(this._graphicsWaitingForSymbol.delete(t.uid),this._graphicsWaitingForSymbol.size===0&&(this._cleanupSymbols(),this.notifyChange("updating")))}_recomputeExtentPadding(){let t=0;this._symbols.forEach(e=>{e!=null&&(t=Math.max(t,e.extentPadding))}),this._set("extentPadding",t)}_expandComputedExtent(t){const e=bi,i=t.spatialReference;Ot(t,e);const s=this._viewSpatialReference,r=se.tmpVec;if(Pt(i,s)||be(e[0],e[1],0,i,r,s)&&(e[0]=r[0],e[1]=r[1],be(e[3],e[4],0,i,r,s),e[3]=r[0],e[4]=r[1]),!(isFinite(e[0])&&isFinite(e[3])&&isFinite(e[1])&&isFinite(e[4])))return;const a=this.computedExtent;let o=null;const d=isFinite(e[2])&&isFinite(e[5]),h=d&&(!a||a.zmin==null||e[2]a.zmax);a?(e[0]a.xmax||e[4]>a.ymax||h||c)&&(o=this._propertiesPool.get("computedExtent"),o.xmin=Math.min(e[0],a.xmin),o.ymin=Math.min(e[1],a.ymin),o.xmax=Math.max(e[3],a.xmax),o.ymax=Math.max(e[4],a.ymax),o.spatialReference=s):(o=this._propertiesPool.get("computedExtent"),o.xmin=e[0],o.ymin=e[1],o.xmax=e[3],o.ymax=e[4],o.spatialReference=s),o&&(h&&(o.zmin=e[2]),c&&(o.zmax=e[5]),this._set("computedExtent",o))}_abortElevationInfoChange(){this._elevationInfoChangeAbortController&&(this._elevationInfoChangeAbortController.abort(),this._elevationInfoChangeAbortController=null)}async elevationInfoChange(){var i,s;this._abortElevationInfoChange();const t=new AbortController;this._elevationInfoChangeAbortController=t;const e=pe(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await ue(e,this._viewSpatialReference,t.signal,f),B(t.signal),this._elevationInfoChangeAbortController=null,(i=this._labeler)==null||i.elevationInfoChange(),this.forEachGraphics3DSymbol((r,a,o)=>{r.globalPropertyChanged("elevationInfo",a)?a.forEach(d=>{const h=d.graphic,c=d.labelLayers;for(const u of c)u.graphics3DSymbolLayer.updateGraphicElevationContext(h,u)}):this._recreateSymbol(o)}),this.updateStageLayerElevationProvider(),(s=this._elevationAlignment)==null||s.elevationInfoChange()}updateStageLayerElevationProvider(){this._stageLayerElevationProvider?(this.layer.elevationInfo&&this.layer.elevationInfo.mode==="relative-to-scene"||this._numberOfGraphicsProvidingElevation===0)&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=fe(this._stageLayerElevationProvider)):(!this.layer.elevationInfo||this.layer.elevationInfo&&this.layer.elevationInfo.mode!=="relative-to-scene")&&this._numberOfGraphicsProvidingElevation>0&&(this._stageLayerElevationProvider=new A({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register("scene",this._stageLayerElevationProvider))}_clearSymbolsAndGraphics(){var t,e,i,s;this.clear(),this._filterVisibility!=null&&this._filterVisibility.clear(),(t=this._labeler)==null||t.reset(),(e=this._deconflictor)==null||e.clear(),(i=this._elevationAlignment)==null||i.clear(),(s=this.stageLayer)==null||s.invalidateSpatialQueryAccelerator(),this._stageLayerElevationProvider&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=fe(this._stageLayerElevationProvider))}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(t=!1){if(!this._startCreateGraphics)return;const{loadedGraphics:e,view:i}=this.owner,s=i.basemapTerrain.tilingScheme&&e&&e.length?e.toArray():null;!t&&s||this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=this.owner.view.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set("computedExtent",null),s&&(t?this.add(s):this.recreateGraphics(s))}_recreateSymbol(t){const e=this._graphicsBySymbol.get(t),i=[];e&&(e.forEach((r,a)=>{var d;const o=r.usedMemory;this._conditionalRemove(r,a),(d=this._spatialIndex)==null||d.remove(r),i.push(r.graphic),r.destroy(),this._removeGraphics3DGraphic(a,o),this._updateLayerVisibility(),this._featureStore.events.emit("changed")}),this._graphicsBySymbol.set(t,new Map));const s=this._symbols.get(t);_(s),this._symbols.delete(t),this.add(i)}_recreateGraphicsForSymbol(t){const e=this._graphicsBySymbol.get(t);if(e){const i=[];e.forEach(s=>i.push(s.graphic)),this.recreateGraphics(i)}}_conditionalRemove(t,e){var i,s,r;this._graphicsDrapedUids.delete(e),(i=this._objectStates)==null||i.removeGraphic(t),(s=this._labeler)==null||s.removeGraphic(t),(r=this._deconflictor)==null||r.removeGraphic(t),this._graphicStateTracking!=null&&this._graphicStateTracking.removeGraphic(t)}add(t){t&&t.length!==0&&(this.owner.view.basemapTerrain&&this.owner.view.basemapTerrain.tilingScheme?(this._updatePolicyForGraphics(t)===v.ASYNC?this._addDelayed(t):this._addImmediate(t),this.notifyChange("updating")):f.error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(t){if(this.effectiveUpdatePolicy===v.SYNC&&(this.layer.geometryType==="mesh"||this.layer.geometryType==null)){for(const e of t)if(e.geometry!=null&&e.geometry.type==="mesh"&&!e.geometry.loaded)return v.ASYNC}return this.effectiveUpdatePolicy}_addImmediate(t){this._geometryWarningLogged=!1,this._symbolWarningLogged=!1;for(const e of t)this._addGraphic(e,this._getRenderingInfo(e,f),v.SYNC);this._cleanupSymbols(),this._labeler&&(this.owner.view.labeler.setDirty(),this._cleanupSymbols()),this.owner.view.deconflictor.setDirty()}_addDelayed(t){var e;for(const i of t){const s=i.uid;let r=this._pendingUpdates.get(s);r?r.add?r.state!==m.NEW&&((e=r.abortController)==null||e.abort()):this._pendingAdds++:(r=this._pendingUpdatesPool.pushNew(),this._pendingAdds++,this._pendingUpdates.set(s,r)),r.add=i}this.notifyChange("running"),this.notifyChange("updatingRemaining")}remove(t){this.effectiveUpdatePolicy===v.ASYNC?this._removeDelayed(t):this._removeImmediate(t),this.notifyChange("updating")}_removeImmediate(t){for(const e of t)this._removeGraphic(e);this._cleanupSymbols(),this._labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_removeDelayed(t){var e;for(const i of t){const s=i.uid,r=this._pendingUpdates.get(s);if(r)r.add&&(r.remove?r.add=null:this._pendingUpdates.delete(s),r.state===m.LOADING&&((e=r.abortController)==null||e.abort()),this._pendingAdds--);else{const a=this._pendingUpdatesPool.pushNew();a.remove=i,this._pendingUpdates.set(s,a),this._pendingRemoves++,this._applyPendingRemovesFirst=!0}}this._pendingUpdates.size===0&&this._finishPendingUpdates(),this.notifyChange("running"),this.notifyChange("updatingRemaining")}_finishPendingUpdates(){this._pendingUpdatesPool.clear(),this._cleanupSymbols(),(this._pendingAdds||this._pendingRemoves)&&f.warn("pendingAdds/Removes in inconsistent state!"),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1}_applyPendingUpdates(t){var e;if(this._geometryWarningLogged=!1,this._symbolWarningLogged=!1,this._pendingUpdates.size===0&&((e=this._spatialIndex)==null?void 0:e.updating))return this._spatialIndex.update(),void t.madeProgress();if(this._applyPendingRemovesFirst){this._applyPendingRemovesFirst=!1;for(const[i,s]of this._pendingUpdates){if(t.done){this._applyPendingRemovesFirst=!0;break}if(s.remove&&!s.add&&(this._pendingRemoves--,t.madeProgress(),this._removeGraphic(s.remove),s.remove=null,this._pendingUpdates.delete(i),this._pendingRemoves===0))break}}for(const[i,s]of this._pendingUpdates){if(t.done)break;s.add&&s.state===m.NEW&&this._processPendingUpdateNew(s);let r=this.effectiveUpdatePolicy;if(!s.remove||s.add&&s.state!==m.READY||(this._pendingRemoves--,t.madeProgress(),this._removeGraphic(s.remove),s.remove=null,r=v.SYNC),s.add)switch(s.state){case m.READY:this._addGraphic(s.add,s.renderingInfo,r),s.add=null,this._pendingAdds--,t.madeProgress();break;case m.REJECTED:s.add=null,this._pendingAdds--;case m.LOADING:}s.remove==null&&s.add==null&&this._pendingUpdates.delete(i)}this._pendingUpdates.size===0&&(this._finishPendingUpdates(),this.notifyChange("running"))}_processPendingUpdateNew(t){if(!t.add)return void(t.state=m.READY);const e=t.add.geometry;e==null||e.type!=="mesh"||e.loaded?this._processPendingUpdateNewRenderingInfo(t):this._processPendingUpdateNewMesh(t,e)}async _processPendingUpdateNewMesh(t,e){t.state=m.LOADING,t.abortController=new AbortController;const i=t.abortController.signal;try{await e.load({signal:i})}catch(s){return this._processPendingUpdateNewError(t,s)}t.abortController=null,this._processPendingUpdateNewRenderingInfo(t)}_processPendingUpdateNewError(t,e){t.abortController=null,Y(e)?t.state=m.NEW:t.state=m.REJECTED}async _processPendingUpdateNewRenderingInfo(t){if(this.layer.renderer==null||this.layer.renderer.type!=="dictionary")return t.renderingInfo=this._getRenderingInfo(t.add,f),void(t.state=m.READY);t.state=m.LOADING,t.abortController=new AbortController;let e=null;try{e=await this._getRenderingInfoAsync(t.add,{signal:t.abortController.signal})}catch(i){return t.abortController=null,void(Y(i)?t.state=m.NEW:t.state=m.REJECTED)}e==null||e.symbol==null?(f&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,f.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),t.renderingInfo=null):t.renderingInfo=e,t.state=m.READY}_addGraphic(t,e,i){var y;if(this._graphicsWithoutSymbol.set(t.uid,t),e==null||e.symbol==null||!At(t))return;if(this.stage.renderView.objectAndLayerIdRenderHelper!=null&&this.setUidToIdOnAdd){const g=Lt(this.owner.view.map,this.layer.uid);this.stage.renderView.objectAndLayerIdRenderHelper.setUidToObjectAndLayerId(t.objectId,t.uid,this.layer.id,this.layer.uid,!!this.layer.popupEnabled&&!g&&ri(this.layer,(y=this.owner.view.popup)==null?void 0:y.defaultPopupTemplateEnabled))}const s=e.symbol,r=this.getOrCreateGraphics3DSymbol(s,e.renderer);if(r==null)return;this._expandComputedExtent(t.geometry);const a=this._beginGraphicUpdate(t),o=new Vt(t,e,this.layer);let d=!1;const h=g=>{g===r.symbol.id&&(d=!0)};this._whenSymbolRemoved.push(h);const c=()=>{if(--this._loadingSymbols,!this.destroyed){if(this._whenSymbolRemoved.removeUnordered(h),this._graphicsWaitingForSymbol.get(t.uid)!==a||d||r.destroyed||this.graphicSymbolSupported&&t.symbol&&t.symbol.id!==r.symbol.id)--r.referenced,this._cleanupSymbols();else{const g=this._createGraphics3DGraphic(r,o);this._spatialIndex&&g!=null&&this._spatialIndex.add(g),--r.referenced,this._endGraphicUpdate(t)}this._featureStore.events.emit("changed"),this._labeler&&this.owner.view.labeler.setDirty()}},u=g=>{--this._loadingSymbols,this.destroyed||(this._whenSymbolRemoved.removeUnordered(h),d||(Y(g)?this.add([t]):r.destroyed||this._endGraphicUpdate(t)))};++this._loadingSymbols,i===v.ASYNC?r.load(()=>this._frameTask.schedule(c),g=>this._frameTask.schedule(()=>u(g))):r.load(c,u)}_removeGraphic(t){var s,r;const e=t.uid,i=this.graphics3DGraphics.get(e);if(i){i.graphics3DSymbol.onRemoveGraphic(i);const a=i.usedMemory,o=i.isElevationSource;this._conditionalRemove(i,e),(s=this._spatialIndex)==null||s.remove(i);const d=i.graphics3DSymbol.symbol.id;(r=this._graphicsBySymbol.get(d))==null||r.delete(e),this._graphicsWithoutSymbol.delete(e),this._removeGraphics3DGraphic(e,a,o),i.destroy(),this._featureStore.events.emit("changed")}else this._graphicsWithoutSymbol.delete(e),this._graphicsWaitingForSymbol.delete(e),this._graphicsWaitingForSymbol.size===0&&(this._cleanupSymbols(),this.notifyChange("updating"))}_hasLabelingContext(t){if(t instanceof ve||t instanceof Ut){const e=this.symbolCreationContext.layer;return!!e.labelingInfo&&e.labelingInfo.some(i=>i.symbol===t)}return!1}_hasValidSymbolCreationContext(t){return!(t instanceof ve&&!this._hasLabelingContext(t))||(f.error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1)}_getRenderingInfo(t,e){const i=t.geometry;if(i==null)return e&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,e.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!jt(i.spatialReference,this._viewSpatialReference))return e&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,e.warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&t.symbol!=null)return e&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,e.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const s=this.rendererHasGeometryOperations?Z(t,this.layer):t;let r;return this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||this.currentRenderer!=null)?r=this.owner.getRenderingInfo(s,this.currentRenderer,this._arcadeOnDemand):r={symbol:s.symbol||ui(s.geometry)},r==null||r.symbol==null?(e&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,e.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):r}_getRenderingInfoAsync(t,e){if(t.geometry==null)return f&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,f.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&t.symbol!=null)return f&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,f.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const i=this.rendererHasGeometryOperations?Z(t,this.layer):t;return this.owner.getRenderingInfoAsync(i,this.currentRenderer,this._arcadeOnDemand,e)}_createGraphics3DSymbol(t,e){if(!this._hasValidSymbolCreationContext(t))return null;const i=this._getConvertedSymbol(t);if(!i)return null;let s;if(e!=null&&"backgroundFillSymbol"in e&&e.backgroundFillSymbol){const a=V(e.backgroundFillSymbol,{ignoreDrivers:!0});a.symbol!=null&&a.symbol.type!=="web-style"&&a.symbol.type!=="cim"&&(s=a.symbol.symbolLayers)}const r=gi(i,this.symbolCreationContext,s);return r.load(()=>{const a=r.extentPadding;a>this.extentPadding&&this._set("extentPadding",a),this.notifyChange("averageSymbolComplexity")},()=>{}),r}getOrCreateGraphics3DSymbol(t,e){let i=this._symbols.get(t.id);return i===void 0&&(i=t instanceof $t?new Ft(t,s=>this._frameTask.schedule(s),s=>this._createGraphics3DSymbol(s,e)):this._createGraphics3DSymbol(t,e),this._symbols.set(t.id,i)),i!=null&&++i.referenced,i}trackGraphicState(t){return this._graphicStateTracking==null&&(this._graphicStateTracking=new mi(this)),this._graphicStateTracking.add(t)}_addGraphics3DGraphic(t){this._usedMemory+=t.usedMemory,this.graphics3DGraphics.set(t.graphic.uid,t),this._numberOfGraphics++,t.isElevationSource&&(this._numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(t,e,i=!1){this._usedMemory-=e,this.graphics3DGraphics.delete(t),this._numberOfGraphics--,i&&(this._numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(t,e){var o,d,h;const i=e.graphic;if(this._graphicsWithoutSymbol.delete(i.uid),!this._symbols.has(t.symbol.id))return this.add([i]),null;if(this.graphics3DGraphics.has(i.uid))return null;const s=t.createGraphics3DGraphic(e);if(s==null)return null;this._addGraphics3DGraphic(s);const r=t.symbol.id;if(this._graphicsBySymbol.has(r)||this._graphicsBySymbol.set(r,new Map),this._graphicsBySymbol.get(r).set(i.uid,s),s.isDraped&&this._graphicsDrapedUids.add(i.uid),s.centroid=null,i.geometry!=null&&i.geometry.type!=="point"&&(s.centroid=Tt(i.geometry,this._viewSpatialReference)),this._updateUserVisibility(s),this._scaleVisibility!=null&&this._scaleVisibility.updateVisibility(s),this._filterVisibility!=null){const{defaultVisibility:c}=this._filterVisibility;s.setVisibilityFlag(E.GRAPHIC,R.FILTER,c),c||this._filterVisibility.reapply()}(o=this._deconflictor)==null||o.addGraphic(s),(d=this._labeler)==null||d.addGraphic(s),(h=this._objectStates)==null||h.addGraphic(s),this._deconflictor&&this.owner.view.deconflictor.setInitialIconVisibilityFlag(this,s),s.initialize(this.stageLayer,this.owner),this._graphicStateTracking!=null&&this._graphicStateTracking.addGraphic(s);const a=this._whenGraphics3DGraphicRequests[i.uid];return a&&(delete this._whenGraphics3DGraphicRequests[i.uid],a.resolve(s)),s}_abortRendererChange(){this._rendererChangeAbortController&&(this._rendererChangeAbortController.abort(),this._rendererChangeAbortController=null)}async rendererChange(t){if(this._abortRendererChange(),t!==this.currentRenderer)if(this._validateRenderer(t),t==null&&this._currentRendererChange(null,!1),ze(t))if(t!=null&&t.arcadeRequired){const e=new AbortController;this._rendererChangeAbortController=e;const{arcadeUtils:i}=await this._ensureArcade();B(e);const s=i.hasGeometryOperations(t);s&&(await i.enableGeometryOperations(),B(e)),this.effectiveUpdatePolicy===v.ASYNC?await this._frameTask.schedule(()=>this._currentRendererChange(t,s),e.signal):this._currentRendererChange(t,s),this._rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===v.ASYNC){const e=new AbortController;this._rendererChangeAbortController=e,await this._frameTask.schedule(()=>this._currentRendererChange(t,!1),e.signal),this._rendererChangeAbortController=null}else this._currentRendererChange(t,!1);else this._currentRendererChange(t,!1)}async _ensureArcade(){return this._arcadeOnDemand==null?(this._arcadeOnDemand=await zt(),this._arcadeOnDemand):this._arcadeOnDemand}_currentRendererChange(t,e){this.currentRenderer=t,this.rendererHasGeometryOperations=e,this.symbolCreationContext.arcade=this._arcadeOnDemand;const i=this.symbolCreationContext.renderer;if(t===i)return;if(this._symbolConversionCache.clear(),t==null)return this.symbolCreationContext.renderer=null,void this.recreateAllGraphicsAndSymbols();const s=De(i,t);this._updateUnchangedSymbolMappings(s,t,i),this.symbolCreationContext.renderer=t,s!=null&&(s.type==="complete"?this.recreateAllGraphicsAndSymbols():s.type==="partial"&&(this._applyRendererDiff(s,t,i)?this._volatileGraphicsUpdated():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}_diffHasSymbolChange(t){for(const e in t.diff)switch(e){case"visualVariables":case"defaultSymbol":case"uniqueValueInfos":break;case"uniqueValueGroups":case"authoringInfo":case"fieldDelimiter":delete t.diff[e];break;default:return!0}return!1}_applySymbolSetDiff(t,e,i){t=t||[],e=e||[];const s=[];for(const r of e){const a=this._graphicsBySymbol.get(r.id);a&&a.forEach((o,d)=>{const h=o.graphic,c=this.layer instanceof kt?this.layer:null,u=this._arcadeOnDemand;if(r===i.defaultSymbol&&i.getSymbol(Z(h,c),{arcade:u})===i.defaultSymbol)return;const y=o.usedMemory;t.length||i.defaultSymbol?s.push(h):this._graphicsWithoutSymbol.set(d,h);const g=this.graphics3DGraphics.get(d);this._conditionalRemove(g,d),o.destroy(),a.delete(d),this._removeGraphics3DGraphic(d,y),this._updateLayerVisibility()}),this._whenSymbolRemoved.forAll(o=>o(r.id))}(t.length||s.length)&&(this._graphicsWithoutSymbol.forEach(r=>s.push(r)),this._graphicsWithoutSymbol.clear(),this.add(s)),this._cleanupSymbols(),this._labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_applyUniqueValueRendererDiff(t,e,i){const s=t.diff.defaultSymbol,r=t.diff.uniqueValueInfos;if(s||r){const a=r?r.added.map(d=>d.symbol).filter(H):[],o=r?r.removed.map(d=>d.symbol).filter(H):[];if(r)for(let d=0;dc!=null?c.id:null,r=t&&t.diff,a=r&&r.defaultSymbol,o=r&&r.uniqueValueInfos;let d;if(o)d=o.unchanged.map(c=>({oldId:s(c.oldValue.symbol),newId:s(c.newValue.symbol)}));else{d=[];for(const c of i.uniqueValueInfos??[]){const u=s(c.symbol),y=(h=e.uniqueValueInfos)==null?void 0:h.find(g=>g.value===c.value);y&&u!==s(y.symbol)&&d.push({oldId:u,newId:s(y.symbol)})}}return!a&&i.defaultSymbol&&d.push({oldId:s(i.defaultSymbol),newId:s(e.defaultSymbol)}),d}_updateSymbolMapping(t,e){const i=e!=null&&e?typeof e=="string"?e:e.id:null;if(t==null||t===i)return;const s=this._graphicsBySymbol.get(t);this._graphicsBySymbol.delete(t),s!==void 0&&this._graphicsBySymbol.set(i,s);const r=this._symbols.get(t);if(r!==void 0&&(this._symbols.delete(t),this._symbols.set(i,r),r!=null)){const a=typeof e=="string"?null:e;a!=null?r.symbol=a:r.symbol.id=i}}_updateUnchangedSymbolMappings(t,e,i){const s=this._calculateUnchangedSymbolMapping(t,e,i);for(const{oldId:r,newId:a}of s)this._updateSymbolMapping(r,a)}_applyRendererDiff(t,e,i){if(this._diffHasSymbolChange(t))return!1;if(e instanceof Re&&i instanceof Re&&this._applyUniqueValueRendererDiff(t,e,i)&&Object.keys(t.diff).length===0)return!0;for(const[s]of this._graphicsBySymbol){const r=this._symbols.get(s);if(r!=null)switch(r.applyRendererDiff(t,e)){case X.RecreateSymbol:this._recreateSymbol(s);break;case X.RecreateGraphics:this._recreateGraphicsForSymbol(s);case X.FastUpdate:}}return!0}opacityChange(){this.forEachGraphics3DSymbol((t,e)=>t.globalPropertyChanged("opacity",e)),this._updateStageLayerVisibility()}_slicePlaneEnabledChange(t){t!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=t,this.stageLayer.sliceable=t,this.forEachGraphics3DSymbol((e,i)=>e.globalPropertyChanged("slicePlaneEnabled",i)),this._deconflictor&&this._deconflictor.slicePlaneEnabledChange(),this._labeler&&this._labeler.slicePlaneEnabledChange())}_physicalBasedRenderingChange(t){this.symbolCreationContext.physicalBasedRenderingEnabled=t,this.forEachGraphics3DSymbol((e,i,s)=>{e.globalPropertyChanged("physicalBasedRenderingEnabled",i)||this._recreateSymbol(s)})}_skipHighSymbolLoDsChange(t){this.symbolCreationContext.skipHighSymbolLods=t,this.forEachGraphics3DSymbol((e,i,s)=>{e.globalPropertyChanged("skipHighSymbolLods",i)||this._recreateSymbol(s)})}_pixelRatioChange(){this.forEachGraphics3DSymbol((t,e,i)=>{t.globalPropertyChanged("pixelRatio",e)||this._recreateSymbol(i)})}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=Mt(()=>{this._updatingPendingLoadedGraphicsChange=null})}setClippingExtent(t,e){const i=this.symbolCreationContext.clippingExtent,s=q();return Bt(t,s,e)?this.symbolCreationContext.clippingExtent=Fe(re(),s):this.symbolCreationContext.clippingExtent=null,!qt(this.symbolCreationContext.clippingExtent,i)}modifyGraphics3DGraphicVisibilities(t){var i,s;if(this.destroyed)return;let e=!1;this.graphics3DGraphics.forEach(r=>{t(r)&&(e=!0)}),e&&((i=this.owner.view.labeler)==null||i.setDirty(),(s=this.owner.view.deconflictor)==null||s.setDirty())}forEachGraphics3DSymbol(t){for(const[e,i]of this._symbols){if(i==null)return;t(i,this._graphicsBySymbol.get(e)||Si,e)}}updateAllGraphicsVisibility(){this._filterVisibility!=null&&this._filterVisibility.reapply(),this.modifyGraphics3DGraphicVisibilities(t=>{const e=this._updateUserVisibility(t),i=this._scaleVisibility!=null&&this._scaleVisibility.updateVisibility(t);return e||i})}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(E.GRAPHIC,R.USER,!1))}_validateRenderer(t){var i;const e=ai(t,{geometryType:(i=this.layer)==null?void 0:i.geometryType});if(e){const s=`Renderer for layer '${this.layer.title?`${this.layer.title}, `:""}, id:${this.layer.id}' is not supported in a SceneView`;f.warn(s,e.message)}}_volatileGraphicsUpdated(){var t;(t=this._labeler)==null||t.reset(),this.stageLayer.shaderTransformationChanged(),this.notifyChange("updating")}_cleanupSymbols(){if(this._graphicsWaitingForSymbol.size>0||this._suspendSymbolCleanup)return;let t=!1;this._symbols.forEach((e,i)=>{if(e==null||e.referenced>0)return;const s=this._graphicsBySymbol.get(i);s&&s.size!==0||(this._graphicsBySymbol.delete(i),this._symbols.delete(i),_(e),t=!0)}),t&&(this._recomputeExtentPadding(),this.notifyChange("averageSymbolComplexity"))}get test(){return{snapshotInternals:()=>({graphics:[...this.graphics3DGraphics.keys()].sort(),symbols:[...this._symbols.keys()].sort(),graphicsBySymbol:[...this._graphicsBySymbol.keys()].sort().map(t=>({symbolId:t,graphics:[...this._graphicsBySymbol.get(t).keys()].sort()})),graphicsWithoutSymbol:[...this._graphicsWithoutSymbol.keys()].sort(),graphicsDrapedUids:[...this._graphicsDrapedUids].sort(),pendingUpdates:this._pendingUpdates}),symbols:this._symbols,filterVisibility:this._filterVisibility,numPending:this._pendingUpdates.size,forceUpdatePolicy:t=>{this._forcedUpdatePolicy=t}}}get performanceInfo(){return{visible:this.graphics3DGraphics.size,missing:this._graphicsWithoutSymbol.size,pending:this._pendingUpdates.size}}};var m;p.tmpVec=j(),n([l({readOnly:!0})],p.prototype,"computedExtent",void 0),n([l()],p.prototype,"currentRenderer",void 0),n([l()],p.prototype,"rendererHasGeometryOperations",void 0),n([l()],p.prototype,"_frameTask",void 0),n([l({readOnly:!0})],p.prototype,"_viewSpatialReference",null),n([l()],p.prototype,"_rendererChangeAbortController",void 0),n([l()],p.prototype,"_elevationInfoChangeAbortController",void 0),n([l()],p.prototype,"_initializeAbortController",void 0),n([l()],p.prototype,"_elevationAlignment",void 0),n([l()],p.prototype,"_scaleVisibility",void 0),n([l()],p.prototype,"_filterVisibility",void 0),n([l()],p.prototype,"_initializePromise",void 0),n([l()],p.prototype,"_spatialIndex",void 0),n([l({readOnly:!0})],p.prototype,"extentPadding",void 0),n([l()],p.prototype,"_updatingPendingLoadedGraphicsChange",void 0),n([l()],p.prototype,"_featureStore",void 0),n([l()],p.prototype,"_deconflictor",void 0),n([l()],p.prototype,"_labeler",void 0),n([l()],p.prototype,"_objectStates",void 0),n([l()],p.prototype,"_loadingSymbols",void 0),n([l()],p.prototype,"preferredUpdatePolicy",void 0),n([l()],p.prototype,"_forcedUpdatePolicy",void 0),n([l({readOnly:!0})],p.prototype,"effectiveUpdatePolicy",null),n([l({constructOnly:!0})],p.prototype,"elevationFeatureExpressionEnabled",void 0),n([l({constructOnly:!0})],p.prototype,"owner",void 0),n([l({constructOnly:!0})],p.prototype,"layer",void 0),n([l({constructOnly:!0})],p.prototype,"graphicSymbolSupported",void 0),n([l({constructOnly:!0})],p.prototype,"getRenderingInfoWithoutRenderer",void 0),n([l({constructOnly:!0})],p.prototype,"componentFactories",void 0),n([l({constructOnly:!0})],p.prototype,"setUidToIdOnAdd",void 0),n([l()],p.prototype,"featureStore",null),n([l()],p.prototype,"initializePromise",null),n([l()],p.prototype,"scaleVisibility",null),n([l()],p.prototype,"elevationAlignment",null),n([l()],p.prototype,"objectStates",null),n([l()],p.prototype,"filterVisibility",null),n([l({readOnly:!0})],p.prototype,"updating",null),n([l({readOnly:!0})],p.prototype,"running",null),n([l({readOnly:!0})],p.prototype,"suspendedOrOutsideOfView",null),n([l({readOnly:!0,dependsOn:[]})],p.prototype,"updatingRemaining",null),n([l({readOnly:!0,dependsOn:["owner.view.qualitySettings.graphics3D.maxTotalNumberOfPrimitives","owner.view.qualitySettings.graphics3D.maxTotalNumberOfFeatures","averageSymbolComplexity"]})],p.prototype,"displayFeatureLimit",null),n([l({readOnly:!0,dependsOn:[]})],p.prototype,"averageSymbolComplexity",null),n([l({constructOnly:!0})],p.prototype,"hasZ",void 0),n([l({constructOnly:!0})],p.prototype,"hasM",void 0),n([l()],p.prototype,"_objectIdField",null),p=se=n([U(ke)],p),function(t){t[t.NEW=0]="NEW",t[t.LOADING=1]="LOADING",t[t.READY=2]="READY",t[t.REJECTED=3]="REJECTED"}(m||(m={}));class fi{constructor(){this.add=null,this.renderingInfo=null,this.state=m.NEW,this.abortController=null,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=m.NEW,this.abortController=null,this.remove=null}}const vi=10,G=j(),F=j(),Si=new Map,Ve=oe.getLogger("esri.views.3d.layers.graphics.Graphics3DScaleVisibility");let S=class extends Ht{constructor(e){super(e),this._scaleRangeActive=!1,this._layerScaleRangeVisibilityQuery=!1,this._extent=null,this.graphicsCoreOwner=null,this.layer=null,this.queryGraphicUIDsInExtent=null,this.graphicsCore=null,this.basemapTerrain=null,this.layerScaleEnabled=!0,this.suspended=!1,this._dirty=!0}initialize(){this.updateScaleRangeActive();const e=this.graphicsCoreOwner.view.resourceController.scheduler;this.handles.add(e.registerTask(W.SCALE_VISIBILITY,this)),this.updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this.layerMinMaxScaleChangeHandler())}destroy(){this.updatingHandles.removeAll(),this.handles.removeAll(),this._dirty=!1,this._extent=null,this.graphicsCoreOwner=null,this.layer=null,this.queryGraphicUIDsInExtent=null,this.graphicsCore=null,this.basemapTerrain=null}get updating(){return this._dirty||this.updatingHandles.updating}_setDirty(){this._dirty=!0}setExtent(e){const i=this.graphicsCoreOwner.view.spatialReference,s=this.graphicsCoreOwner.view.basemapTerrain.spatialReference;if(i===s)this._extent=e??null;else{const r=q();Ce(e,i,r,s)?this._extent=r:this._extent=null}this._setDirty()}scaleRangeActive(){return this._scaleRangeActive}updateScaleRangeActive(){const e=this.layer,i=e.effectiveScaleRange;let s=this.layerScaleEnabled&&i!=null&&Ue(i.minScale,i.maxScale);e.labelingInfo&&!s&&(s=e.labelingInfo.some(a=>a&&Ue(a.minScale??0,a.maxScale??0)));const r=this._scaleRangeActive!==s;return this._scaleRangeActive=s,s&&!this.handles.has(M)&&this.basemapTerrain?(this.handles.add(this.basemapTerrain.on("scale-change",a=>this._scaleUpdateHandler(a)),M),this.layerScaleEnabled&&this.handles.add(this.basemapTerrain.on("tiles-visibility-changed",()=>this._setDirty()),M)):!s&&this.handles.has(M)&&this.handles.remove(M),r}get running(){return!(!this.graphicsCoreOwner.view.basemapTerrain||!this.updating)}runTask(e){const i=this.graphicsCoreOwner.view.basemapTerrain;if(this._extent&&i&&i.ready&&this._scaleRangeActive&&this.layerScaleEnabled){if(this._layerScaleRangeVisibilityQuery)return le.YIELD;{this._layerScaleRangeVisibilityQuery=!0;const{minScale:s,maxScale:r}=this.layer.effectiveScaleRange;i.queryVisibleScaleRange(this._extent,s,r,a=>this._finishUpdate(a))}}else this._finishUpdate(!0);e.madeProgress()}_finishUpdate(e){this._layerScaleRangeVisibilityQuery=!1,this._set("suspended",!e),this._dirty=!1}_visibleAtLayerScale(e){const i=this.layer.effectiveScaleRange;return!this.layerScaleEnabled||we(e,i.minScale||0,i.maxScale||0)}_visibleAtLabelScale(e,i){return we(e,i.minScale||0,i.maxScale||0)}_graphicScale(e){let i;return e.centroid!=null?i=e.centroid:e.graphic.geometry!=null&&e.graphic.geometry.type==="point"&&(i=e.graphic.geometry),i?this.graphicsCoreOwner.view.basemapTerrain?this.graphicsCoreOwner.view.basemapTerrain.getScale(i):1:null}_graphicVisible(e){if(!this.layerScaleEnabled)return!0;const i=this._graphicScale(e);return this._visibleAtLayerScale(i)}updateVisibility(e){if(this._scaleRangeActive){const i=this._graphicVisible(e);return e.setVisibilityFlag(E.GRAPHIC,R.SCALE_RANGE,i)}return!1}updateGraphicLabelScaleVisibility(e){if(!this._scaleRangeActive||!e.labelLayers||e.labelLayers.length===0)return!1;const i=this._graphicScale(e),s=this._updateLabelScaleVisibility(e,i);return s&&(this.graphicsCoreOwner.view.deconflictor.setDirty(),this.graphicsCoreOwner.view.labeler.setDirty()),s}_updateLabelScaleVisibility(e,i){if(!e.labelLayers||e.labelLayers.length===0)return!1;const s=e.labelLayers[0]._labelClass;if(s&&s.minScale!=null&&s.maxScale!=null){const r=this._visibleAtLabelScale(i,s);if(e.setVisibilityFlag(E.LABEL,R.SCALE_RANGE,r))return!0}return!1}_scaleUpdateHandler(e){if(this._setDirty(),!this.graphicsCore.visible)return;const i=e.extent,s=e.scale,r=this._visibleAtLayerScale(s);let a=!1;const o=this.graphicsCoreOwner.view.spatialReference,d=e.spatialReference;if(d==null)return void Ve.error("scaleUpdate: Internal error, no SpatialReference given for tiles");const h=!d.equals(o);if(h&&!Ce(i,d,je,o))return void Ve.error("scaleUpdate: Internal error, cannot project AABR from "+d+" to wkid "+o);const c=h?je:i;this.queryGraphicUIDsInExtent(c,o,u=>{const y=this.graphicsCore.getGraphics3DGraphicById(u);if(y==null)return;const g=y.centroid;g!=null&&(i[0]>g.x||i[1]>g.y||i[2]e.setVisibilityFlag(E.GRAPHIC,R.SCALE_RANGE,!0)):this._scaleRangeActive&&this.graphicsCore.updateAllGraphicsVisibility(),this._setDirty()}};function Ue(t,e){return t>0||e>0}n([l()],S.prototype,"graphicsCoreOwner",void 0),n([l()],S.prototype,"layer",void 0),n([l()],S.prototype,"queryGraphicUIDsInExtent",void 0),n([l()],S.prototype,"graphicsCore",void 0),n([l()],S.prototype,"basemapTerrain",void 0),n([l({constructOnly:!0})],S.prototype,"layerScaleEnabled",void 0),n([l({readOnly:!0})],S.prototype,"suspended",void 0),n([l({readOnly:!0})],S.prototype,"updating",null),n([l()],S.prototype,"_dirty",void 0),S=n([U("esri.views.3d.layers.graphics.Graphics3DScaleVisibility")],S);const M="terrain-events",je=q(),Mi=S,Ci=.05;let wi=class{constructor(){this._extents=new te({allocator:e=>e||q()}),this._tmpExtent=q(),this._dirty=!1}get empty(){return this._extents.length===0}get size(){return this._extents.length}clear(){this._extents.clear()}add(e){this._contains(e)||(this._removeContained(e),Ge(this._extents.pushNew(),e),this._dirty=!0)}pop(){return this._dirty&&this._mergeTight(),this._extents.pop()}merge(e){return this._mergeTight(e),e.hasProgressed}_mergeTight(e=Te){const i=this._extents,s=new Set;let r=0;for(;r!==i.length;){i.sort((a,o)=>a[0]-o[0]),r=i.length,s.clear();for(let a=0;a=o[2])break;s.add(h)}s.forEach(d=>{if(o===d)return;if(d[2]<=o[0])return void s.delete(d);const h=J(o),c=J(d),u=this._tmpExtent;Nt(o,d,u);const y=h+c;(J(u)-y)/yxe(i,e))}_removeContained(e){this._extents.filterInPlace(i=>!xe(e,i))}get test(){const e=this;return{containsPoint:i=>e._extents.some(s=>Wt(s,i))}}},P=class extends k{constructor(t){super(t),this._dirtyExtents=new wi,this._globalDirty=!1,this._averageExtentUpdateSize=0,this._dirtyGraphicsSet=new Set,this._handles=new N,this._updateElevation=!1,this.graphicsCoreOwner=null,this.graphicsCore=null,this.events=new ae}initialize(){const t=this.elevationProvider,e=this.graphicsCoreOwner.view.resourceController.scheduler;this._handles.add([t.on("elevation-change",i=>this._elevationChanged(i)),C(()=>this.graphicsCoreOwner.suspended,()=>this._suspendedChange()),e.registerTask(W.ELEVATION_ALIGNMENT,this)])}destroy(){this._dirtyGraphicsSet.clear(),this._handles=_(this._handles),this.graphicsCoreOwner=null,this.graphicsCore=null,this.queryGraphicUIDsInExtent=null,this.elevationProvider=null}clear(){this._dirtyGraphicsSet.clear(),this.notifyChange("updating")}_suspendedChange(){this.graphicsCoreOwner.suspended===!0?this._updateElevation=!1:this.graphicsCoreOwner.suspended===!1&&this._updateElevation&&(this._globalDirty=!0,this.notifyChange("updating"))}elevationInfoChange(){this._globalDirty=!0,this.notifyChange("updating")}get updating(){return this.running}get running(){return this._dirtyGraphicsSet.size>0||this._dirtyExtents&&!this._dirtyExtents.empty||this._globalDirty}get updatingRemaining(){return this._dirtyGraphicsSet.size+this._dirtyExtents.size*this._averageExtentUpdateSize}runTask(t){for(this._globalDirty&&(this._markAllGraphicsElevationDirty(),this._globalDirty=!1,t.madeProgress()),t.run(()=>this._dirtyExtents.merge(t));this.running&&!t.done;)this._updateDirtyGraphics(t),this._updateDirtyExtents(t);this.notifyChange("updating")}_updateDirtyGraphics(t){const e=this.graphicsCoreOwner.view.renderCoordsHelper,i=this.graphicsCore.effectiveUpdatePolicy===v.ASYNC;for(const s of this._dirtyGraphicsSet.keys()){const r=this.graphicsCore.getGraphics3DGraphicById(s);if(this._dirtyGraphicsSet.delete(s),r!=null&&(r.alignWithElevation(this.elevationProvider,e,i),this.graphicsCoreOwner.view.deconflictor.setDirty(),t.madeProgress()),t.done)return}}_updateDirtyExtents(t){for(;!this._dirtyExtents.empty&&!t.done;){const e=this._dirtyExtents.pop(),i=this.elevationProvider.spatialReference;this.events.emit("invalidate-elevation",{extent:e,spatialReference:i});const s=this._dirtyGraphicsSet.size;this.queryGraphicUIDsInExtent(e,i,r=>{const a=this.graphicsCore.getGraphics3DGraphicById(r);a!=null&&a.needsElevationUpdates()&&this._dirtyGraphicsSet.add(r)}),this._averageExtentUpdateSize=.1*(this._dirtyGraphicsSet.size-s)+.9*this._averageExtentUpdateSize,t.madeProgress()}}_markAllGraphicsElevationDirty(){this._dirtyExtents.clear(),this._dirtyGraphicsSet.clear(),this.graphicsCore.graphics3DGraphics.forEach((t,e)=>this._dirtyGraphicsSet.add(e))}_elevationChanged(t){if(t.context==="scene"&&(!this.graphicsCore.layer.elevationInfo||this.graphicsCore.layer.elevationInfo.mode!=="relative-to-scene"))return;const{extent:e,spatialReference:i}=t;if(this.graphicsCoreOwner.suspended){if(!this._updateElevation){const s=this.graphicsCore.computedExtent;s&&e[2]>s.xmin&&e[0]s.ymin&&e[1]this._viewChange()),C(()=>e.state.camera,()=>this._viewChange(),Zt),s.registerTask(W.FRUSTUM_VISIBILITY,this),C(()=>i.visibleElevationBounds,()=>this._elevationBoundsChange())]),e.viewingMode==="local"?this._isVisibleBelowSurface=!0:this._handles.add([C(()=>{var r,a,o;return[i.baseOpacity,i.wireframe,(o=(a=(r=e.map)==null?void 0:r.ground)==null?void 0:a.navigationConstraint)==null?void 0:o.type]},()=>this._updateIsVisibleBelowSurface(),Xt)])}destroy(){this._set("graphicsCoreOwner",null),this._extent=null,this._extentIntersection=null,this._handles=_(this._handles)}_setDirty(){this.updating||this._set("updating",!0)}setExtent(t){this._extent=t,this._extentIntersectionDirty=!0,this._setDirty()}_viewChange(){this._setDirty()}_elevationBoundsChange(){this._setDirty(),this._extentIntersectionDirty=!0}set _isVisibleBelowSurface(t){this._isVisibleBelowSurfaceInternal=t,this._setDirty(),this._extentIntersectionDirty=!0}_updateIsVisibleBelowSurface(){var r,a;const t=this.graphicsCoreOwner.view,e=t.basemapTerrain,i=t.viewingMode==="local",s=((a=(r=t.map.ground)==null?void 0:r.navigationConstraint)==null?void 0:a.type)==="none";this._isVisibleBelowSurface=i||!e.opaque||s}_updateExtentIntersection(){if(!this._extentIntersectionDirty)return;this._extentIntersectionDirty=!1;const t=this.graphicsCoreOwner.view;let e;if(this._isVisibleBelowSurfaceInternal)e=-.3*Ie(t.spatialReference).radius;else{const{min:i,max:s}=t.basemapTerrain.visibleElevationBounds;e=i-Math.max(1,(s-i)*(Gi-1))}this._extentIntersection.update(this._extent,t.spatialReference,e)}get running(){return this.updating}runTask(t){if(this._set("updating",!1),!this._extent)return this._set("suspended",!1),le.YIELD;this._updateExtentIntersection();const e=this.graphicsCoreOwner.view.frustum,i=Ie(this.graphicsCoreOwner.view.spatialReference).radius;this._set("suspended",!this._extentIntersection.isVisibleInFrustum(e,i)),t.madeProgress()}};n([l({readOnly:!0})],T.prototype,"suspended",void 0),n([l({constructOnly:!0})],T.prototype,"graphicsCoreOwner",void 0),n([l({readOnly:!0})],T.prototype,"updating",void 0),T=n([U("esri.views.3d.layers.graphics.Graphics3DFrustumVisibility")],T);const Hi=T;var I;(function(t){t[t.Object=0]="Object",t[t.RenderGeometry=1]="RenderGeometry",t[t.External=2]="External",t[t.COUNT=3]="COUNT"})(I||(I={}));class xi{constructor(){this._items=[]}addObject(e,i){this._items.push({type:I.Object,objectStateId:i,object:e})}addRenderGeometry(e,i,s){this._items.push({type:I.RenderGeometry,objectStateId:i,renderGeometry:e,owner:s})}addExternal(e,i){this._items.push({type:I.External,objectStateId:i,remove:e})}remove(e){for(let i=this._items.length-1;i>=0;--i){const s=this._items[i];s.objectStateId===e&&(this._removeObjectStateItem(s),this._items.splice(i,1))}}removeObject(e){for(let i=this._items.length-1;i>=0;--i){const s=this._items[i];s.type===I.Object&&s.object===e&&(this._removeObjectStateItem(s),this._items.splice(i,1))}}removeRenderGeometry(e){for(let i=this._items.length-1;i>=0;--i){const s=this._items[i];s.type===I.RenderGeometry&&s.renderGeometry===e&&(this._removeObjectStateItem(s),this._items.splice(i,1))}}removeAll(){this._items.forEach(e=>{this._removeObjectStateItem(e)}),this._items=[]}_removeObjectStateItem(e){switch(e.type){case I.Object:e.objectStateId.channel===Ee.Highlight?e.object.removeHighlight(e.objectStateId):e.objectStateId.channel===Ee.MaskOccludee&&e.object.removeOcclude(e.objectStateId);break;case I.RenderGeometry:e.owner.removeRenderGeometryObjectState(e.renderGeometry,e.objectStateId);break;case I.External:e.remove(e.objectStateId)}}}class Ii{constructor(e,i){this.stateType=e,this.objectIdField=i,this.objectStateSet=new xi,this.ids=new Set,this.paused=!1}hasGraphic(e){if(this.objectIdField){const i=e.graphic.attributes[this.objectIdField];return this.ids.has(i)}return this.ids.has(e.graphic.uid)}}class Ni{constructor(e){this._graphicsCore=e,this._stateSets=new Array}destroy(){this.reset(),this._stateSets=null}reset(){this._stateSets&&(this._stateSets.forEach(e=>e.objectStateSet.removeAll()),this._stateSets.length=0)}acquireSet(e,i){const s=new Ii(e,i);this._stateSets.push(s);const r=ne(()=>this.releaseSet(s));return{set:s,handle:r}}releaseSet(e){e.objectStateSet.removeAll();const i=this._stateSets?this._stateSets.indexOf(e):-1;i!==-1&&this._stateSets.splice(i,1)}_addObjectStateSet(e,i){e.addObjectStateSet(i.stateType,i.objectStateSet)}_removeObjectStateSet(e,i){e.removeObjectState(i.objectStateSet)}setUid(e,i){e.ids.add(i);const s=this._graphicsCore.graphics3DGraphics.get(i);s&&this._addObjectStateSet(s,e)}setUids(e,i){i.forEach(s=>this.setUid(e,s))}setObjectIds(e,i){i.forEach(s=>e.ids.add(s)),this._initializeSet(e)}addGraphic(e){this._stateSets.forEach(i=>{!i.paused&&i.hasGraphic(e)&&this._addObjectStateSet(e,i)})}removeGraphic(e){this._stateSets.forEach(i=>{i.hasGraphic(e)&&this._removeObjectStateSet(e,i)})}allGraphicsDeleted(){this._stateSets&&this._stateSets.forEach(e=>e.objectStateSet.removeAll())}_initializeSet(e){const i=this._graphicsCore.graphics3DGraphics;e.objectIdField?i.forEach(s=>{s&&e.hasGraphic(s)&&this._addObjectStateSet(s,e)}):e.ids.forEach(s=>{const r=i.get(s);r&&this._addObjectStateSet(r,e)})}get test(){return{states:this._stateSets}}}export{p as F,Hi as a,wi as b,qi as l,Mi as m,Ni as s}; diff --git a/assets/GraphicsLayerView3D-f93de954.js b/assets/GraphicsLayerView3D-f93de954.js new file mode 100644 index 0000000..b9f82dc --- /dev/null +++ b/assets/GraphicsLayerView3D-f93de954.js @@ -0,0 +1 @@ +import{aC as l,ah as h,ar as c,aD as d,ai as t,aj as o,al as u}from"./index-080e108a.js";import{n as m}from"./LayerView3D-ffd35809.js";import{f as g,r as y}from"./queryForSymbologySnapping-0264f2b5.js";import{x as f}from"./GraphicsProcessor-750d4e2b.js";import{l as b}from"./projectExtentUtils-efa4cddd.js";import{d as v}from"./LayerView-448bc5ea.js";import"./elevationInfoUtils-4fd79d95.js";import"./diffUtils-590c9088.js";import"./Query-1c961d4c.js";import"./Graphics3DObjectStates-bb2a6162.js";import"./UniqueValueRenderer-fef4204d.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./popupUtils-f04ec9a9.js";let i=class extends m(v){constructor(){super(...arguments),this.type="graphics-3d",this.symbologySnappingSupported=!0,this._slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.ignoresMemoryFactor=!0}initialize(){this._set("processor",new f({owner:this,scaleVisibilityEnabled:!0,frustumVisibilityEnabled:!0})),this.addResolvingPromise(this.processor.initializePromise),this.handles.add(this.layer.on("graphic-update",e=>this.processor.graphicsCore.graphicUpdateHandler(e))),this.addResolvingPromise(b(this).then(e=>this.fullExtentInLocalViewSpatialReference=e)),this.layer.internal?this.notifyChange("updating"):this.handles.add(l(()=>{var e,s;return(s=(e=this.view)==null?void 0:e.basemapTerrain)==null?void 0:s.ready},()=>()=>this.notifyChange("updating"),{once:!0}))}destroy(){this.handles.removeAll(),this.updatingHandles.removeAll(),this._set("processor",h(this.processor))}get loadedGraphics(){return this.layer.graphics}get legendEnabled(){var e;return this.canResume()&&!((e=this.processor)!=null&&e.frustumVisibilitySuspended)}get slicePlaneEnabled(){const e=this.layer.internal;return this._slicePlaneEnabled&&!e}set slicePlaneEnabled(e){this._slicePlaneEnabled=e}getSuspendInfo(){var s,r;const e=super.getSuspendInfo();return e.outsideScaleRange=((s=this.processor)==null?void 0:s.scaleVisibilitySuspended)??!1,e.outsideOfView=((r=this.processor)==null?void 0:r.frustumVisibilitySuspended)??!1,e}async fetchPopupFeatures(e,s){return(s==null?void 0:s.clientGraphics)??[]}getHit(e){return this.processor.getHit(e)}whenGraphicBounds(e,s){return this.processor.whenGraphicBounds(e,s)}computeAttachmentOrigin(e,s){var r;return(r=this.processor)==null?void 0:r.computeAttachmentOrigin(e,s)}getSymbolLayerSize(e,s){return this.processor.getSymbolLayerSize(e,s)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(e){return this.processor.maskOccludee(e)}highlight(e){return this.processor.highlight(e)}async elevationAlignPointsInFeatures(e,s){const{processor:r}=this;if(r==null||r.graphics3DGraphics==null)throw new c("graphicslayerview3d:missing-processor","A Graphics3D processor is needed to resolve graphics elevation.");const{graphics3DGraphics:n}=r,p=a=>typeof a=="number"?n.get(a):void 0;return g(this.view,this.layer,p,e,s)}async queryForSymbologySnapping(e,s){return y(this.processor,e,s)}get updatePolicy(){var e;return((e=this.processor)==null?void 0:e.graphicsCore.effectiveUpdatePolicy)||d.SYNC}canResume(){var e;return super.canResume()&&!((e=this.processor)!=null&&e.scaleVisibilitySuspended)}isUpdating(){var e,s;return this.view&&this.layer&&!(!((e=this.processor)!=null&&e.updating)&&(this.layer.internal||(s=this.view.basemapTerrain)!=null&&s.ready))}get performanceInfo(){var e,s;return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:-1,totalNumberOfFeatures:-1,nodes:0,core:null,updating:this.updating,elevationUpdating:((e=this.processor)==null?void 0:e.elevationAlignment.updating)??!1,visibilityFrustum:!((s=this.processor)!=null&&s.frustumVisibilitySuspended)}}get usedMemory(){var e,s;return((s=(e=this.processor)==null?void 0:e.graphicsCore)==null?void 0:s.usedMemory)??0}get unloadedMemory(){var e,s;return(s=(e=this.processor)==null?void 0:e.graphicsCore)==null?void 0:s.unprocessedMemoryEstimate}};t([o()],i.prototype,"loadedGraphics",null),t([o({readOnly:!0})],i.prototype,"legendEnabled",null),t([o()],i.prototype,"layer",void 0),t([o({readOnly:!0})],i.prototype,"processor",void 0),t([o()],i.prototype,"_slicePlaneEnabled",void 0),t([o({type:Boolean})],i.prototype,"slicePlaneEnabled",null),i=t([u("esri.views.3d.layers.GraphicsLayerView3D")],i);const B=i;export{B as default}; diff --git a/assets/GraphicsProcessor-750d4e2b.js b/assets/GraphicsProcessor-750d4e2b.js new file mode 100644 index 0000000..96cda45 --- /dev/null +++ b/assets/GraphicsProcessor-750d4e2b.js @@ -0,0 +1 @@ +import{ai as n,bm as g,aQ as b,aD as m,bn as f,aG as p,aH as C,ah as u,bo as w,bp as v,aA as V,bq as S,br as h,aK as c,aF as E,aM as x,aj as a,al as G,aS as O,bs as P,bt as A}from"./index-080e108a.js";import{a as _}from"./diffUtils-590c9088.js";import{b as j}from"./Query-1c961d4c.js";import{F as I,l as R,m as H,s as z,a as D}from"./Graphics3DObjectStates-bb2a6162.js";let s=class extends g{constructor(e){super(e),this.type="graphics-3d",this.graphicsCore=null,this.drapeSourceType=b.Features,this.scaleVisibilityEnabled=!1,this.frustumVisibilityEnabled=!1,this._suspendResumeExtent=null}initialize(){const{layer:e}=this,i="effectiveScaleRange"in e?e:null,l=this.scaleVisibilityEnabled&&i!=null,r=new I({owner:this,layer:this.owner.layer,preferredUpdatePolicy:m.SYNC,graphicSymbolSupported:!0,componentFactories:{elevationAlignment:(t,o)=>new R({graphicsCoreOwner:this,graphicsCore:t,queryGraphicUIDsInExtent:o,elevationProvider:this.view.elevationProvider}),scaleVisibility:l?(t,o)=>new H({graphicsCoreOwner:this,layer:i,queryGraphicUIDsInExtent:o,graphicsCore:t,basemapTerrain:this.owner.view.basemapTerrain}):null,objectStates:t=>new z(t)}});if(this._set("graphicsCore",r),this.frustumVisibilityEnabled&&this._set("frustumVisibility",new D({graphicsCoreOwner:this})),"fullOpacity"in this.owner){const t=this.owner;this.updatingHandles.add(()=>t.fullOpacity,()=>this.graphicsCore.opacityChange())}if("elevationInfo"in e){const t=e;this.updatingHandles.add(()=>t.elevationInfo,(o,y)=>{_(o,y)&&this.updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())})}this._set("initializePromise",this._initializeAsync()),this.updatingHandles.addPromise(this.initializePromise)}async _initializeAsync(){try{await this.graphicsCore.initializePromise}catch(e){if(f(e))return;throw e}this.destroyed||(this.handles.add(p(()=>this.view.clippingArea,()=>this._updateClippingExtent(),C)),this._updateClippingExtent(),this._setupSuspendResumeExtent(),this.graphicsCore.startCreateGraphics())}destroy(){this.handles.removeAll(),this.updatingHandles.removeAll(),this._set("frustumVisibility",u(this.frustumVisibility)),this._set("graphicsCore",u(this.graphicsCore))}get layer(){return this.owner.layer}get view(){return this.owner.view}get scaleVisibility(){var e;return(e=this.graphicsCore)==null?void 0:e.scaleVisibility}get elevationAlignment(){var e;return(e=this.graphicsCore)==null?void 0:e.elevationAlignment}get objectStates(){var e;return(e=this.graphicsCore)==null?void 0:e.objectStates}get scaleVisibilitySuspended(){return!(this.scaleVisibility==null||!this.scaleVisibility.suspended)}get frustumVisibilitySuspended(){return this.frustumVisibility!=null&&this.frustumVisibility.suspended}get suspended(){return this.owner.suspended??!1}get updating(){var e;return!!((e=this.graphicsCore)!=null&&e.updating||this.scaleVisibility!=null&&this.scaleVisibility.updating||this.frustumVisibility!=null&&this.frustumVisibility.updating||this.updatingHandles.updating)}get graphics3DGraphics(){var e;return(e=this.graphicsCore)==null?void 0:e.graphics3DGraphics}get graphics3DGraphicsByObjectID(){var e;return(e=this.graphicsCore)==null?void 0:e.graphics3DGraphicsByObjectID}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){return this.owner.fullOpacity??1}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get updatePolicy(){return this.owner.updatePolicy}notifyGraphicGeometryChanged(e){this.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.graphicsCore.notifyGraphicVisibilityChanged(e)}getRenderingInfo(e,i,l){const r=w(e,{renderer:i,arcade:l});if(r!=null&&r.color){const t=r.color;t[0]=t[0]/255,t[1]=t[1]/255,t[2]=t[2]/255}return r}getRenderingInfoAsync(e,i,l,r){return v(e,{renderer:i,arcade:l,...r})}getHit(e){if(this.owner.loadedGraphics){const i=this.owner.loadedGraphics.find(l=>l.uid===e);if(i){const l=this.layer instanceof V?this.layer:null,r=S(i,l);return{type:"graphic",graphic:r,layer:r.layer}}}return null}whenGraphicBounds(e,i){return this.graphicsCore?this.graphicsCore.whenGraphicBounds(e,i):Promise.reject()}computeAttachmentOrigin(e,i){return this.graphicsCore?this.graphicsCore.computeAttachmentOrigin(e,i):null}getSymbolLayerSize(e,i){return this.graphicsCore?this.graphicsCore.getSymbolLayerSize(e,i):null}maskOccludee(e){const{set:i,handle:l}=this.objectStates.acquireSet(h.MaskOccludee,null);return this.objectStates.setUid(i,e.uid),l}highlight(e){if(e instanceof j)return d;if(typeof e=="number")return this.highlight([e]);if(e instanceof c)return this.highlight([e]);if(e instanceof E&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof c){const i=e.map(t=>t.uid),{set:l,handle:r}=this.objectStates.acquireSet(h.Highlight,null);return this.objectStates.setUids(l,i),r}if(typeof e[0]=="number"){const i=e,{set:l,handle:r}=this.objectStates.acquireSet(h.Highlight,null);return this.objectStates.setObjectIds(l,i),r}}return d}_setupSuspendResumeExtent(){const{scaleVisibility:e,frustumVisibility:i}=this;if(e==null&&i==null)return;const l=({computedExtent:r,extentPadding:t})=>{this._suspendResumeExtent=P(r,this._suspendResumeExtent,A,t),e!=null&&e.setExtent(this._suspendResumeExtent),i!=null&&i.setExtent(this._suspendResumeExtent)};this.handles.add(p(()=>{var r,t;return{computedExtent:(r=this.graphicsCore)==null?void 0:r.computedExtent,extentPadding:(t=this.graphicsCore)==null?void 0:t.extentPadding}},r=>l(r),x))}_updateClippingExtent(){const e=this.view.clippingArea;this.graphicsCore.setClippingExtent(e,this.view.spatialReference)&&this.graphicsCore.recreateAllGraphics()}};n([a()],s.prototype,"type",void 0),n([a({constructOnly:!0})],s.prototype,"owner",void 0),n([a()],s.prototype,"layer",null),n([a()],s.prototype,"view",null),n([a({constructOnly:!0})],s.prototype,"graphicsCore",void 0),n([a()],s.prototype,"scaleVisibility",null),n([a({constructOnly:!0})],s.prototype,"frustumVisibility",void 0),n([a()],s.prototype,"elevationAlignment",null),n([a()],s.prototype,"objectStates",null),n([a()],s.prototype,"scaleVisibilitySuspended",null),n([a({readOnly:!0})],s.prototype,"frustumVisibilitySuspended",null),n([a()],s.prototype,"suspended",null),n([a({readOnly:!0})],s.prototype,"updating",null),n([a()],s.prototype,"loadedGraphics",null),n([a()],s.prototype,"fullOpacity",null),n([a()],s.prototype,"slicePlaneEnabled",null),n([a()],s.prototype,"drapeSourceType",void 0),n([a()],s.prototype,"updatePolicy",null),n([a({constructOnly:!0})],s.prototype,"scaleVisibilityEnabled",void 0),n([a({constructOnly:!0})],s.prototype,"frustumVisibilityEnabled",void 0),n([a()],s.prototype,"initializePromise",void 0),s=n([G("esri.views.3d.layers.graphics.GraphicsProcessor")],s);const d=O();export{s as x}; diff --git a/assets/GraphicsSnappingSource-c09f0afd.js b/assets/GraphicsSnappingSource-c09f0afd.js new file mode 100644 index 0000000..588cd65 --- /dev/null +++ b/assets/GraphicsSnappingSource-c09f0afd.js @@ -0,0 +1 @@ +import{cX as v,ao as S,ag as u,aG as w,aT as b,fw as k,ax as d,aN as E,bd as C,ak as F,fx as y,aB as A,be as G,eq as R,bL as P,fy as x,ai as a,aj as l,al as I,fv as O,fz as $}from"./index-080e108a.js";import{a as z}from"./normalizeUtilsSync-6be8435f.js";import{m as Z}from"./FeatureStore-f0e312fc.js";import{e as H}from"./QueryEngine-19eda5ff.js";import{m as L}from"./elevationInfoUtils-4fd79d95.js";import{u as M,b as W}from"./DimensionAnalysisView3D-4f55aca1.js";import{i as j,o as q}from"./queryEngineUtils-342680f6.js";import{i as m,r as T,n as g}from"./symbologySnappingCandidates-816beafe.js";import"./normalizeUtilsCommon-500064b3.js";import"./BoundsStore-b6bd3c14.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./normalizeUtils-cf8b8053.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./FieldsIndex-f79a8f26.js";import"./LineVisualElement-b605d10c.js";import"./LengthDimension-92faee98.js";import"./Segment-50129b50.js";import"./unitFormatUtils-b70a7bff.js";import"./analysisViewUtils-68ab721d.js";import"./ImageMaterial-5c48df66.js";import"./Factory-8e329f4b.js";import"./RightAngleQuadVisualElement-8daf0594.js";import"./VisualElementResources-e52972a5.js";import"./PointVisualElement-2a56e55d.js";import"./EditGeometryOperations-0ec3f5b5.js";import"./dehydratedFeatureComparison-a3375a3e.js";import"./VertexSnappingCandidate-0a987e12.js";const _="graphics-collections";let r=class extends v(S){get updating(){return this.updatingHandles.updating}get _hasZ(){const e=this.view;return e!=null&&e.type==="3d"&&this.layerSource.layer.type!=="map-notes"}get _snappingElevationAligner(){const{view:e}=this,{layer:t}=this.layerSource,i=e!=null&&e.type==="3d";if(!i||t.type==="map-notes")return m();const s=async(n,o)=>(await O(e.whenLayerView(t),o)).elevationAlignPointsInFeatures(n,o);return m(i,{elevationInfo:t.elevationInfo,alignPointsInFeatures:s,spatialReference:e.spatialReference})}get _snappingElevationFilter(){const{view:e}=this,t=e!=null&&e.type==="3d"&&this.layerSource.layer.type!=="map-notes";return T(t)}get _symbologySnappingFetcher(){const{view:e}=this,{layer:t}=this.layerSource,i=e!=null&&e.type==="3d",s=this._extrudedPolygonSymbolsCount>0;return i&&t.type!=="map-notes"&&s?g(s,async(n,o)=>{const p=await e.whenLayerView(t);return d(o),p.queryForSymbologySnapping({candidates:n,spatialReference:e.spatialReference},o)}):g()}constructor(e){super(e),this.availability=1,this._sources={multipoint:null,point:null,polygon:null,polyline:null},this._loadedWkids=new Set,this._loadedWkts=new Set,this._pendingAdds=[],this._extrudedPolygonSymbolsCount=0}destroy(){for(const e of this._pendingAdds)e.task.abort();this._pendingAdds.length=0,this._mapSources(e=>this._destroySource(e))}initialize(){this.updatingHandles.add(()=>this.getGraphicsLayers(),i=>{this.updatingHandles.removeHandles(_);for(const s of i)this._addMany(s.graphics.toArray()),this.handles.add([s.on("graphic-update",n=>this._onGraphicUpdate(n)),this.updatingHandles.addOnCollectionChange(()=>s.graphics,n=>this._onGraphicsChanged(n))],_)},u);const{view:e}=this,{layer:t}=this.layerSource;e!=null&&e.type==="3d"&&t.type!=="map-notes"&&this.addHandles([e.elevationProvider.on("elevation-change",({context:i})=>{L(i,t.elevationInfo)&&this._snappingElevationAligner.notifyElevationSourceChange()}),w(()=>t.elevationInfo,()=>this._snappingElevationAligner.notifyElevationSourceChange(),u),b(()=>t,["edits","apply-edits","graphic-update"],()=>this._symbologySnappingFetcher.notifySymbologyChange())])}async fetchCandidates(e,t){const{point:i}=e,s=await k(this._mapSources(p=>this._fetchCandidatesForSource(p,e,t)));d(t);const n=this._getGroundElevation,o=s.flat().map(p=>j(p,n));return M(i,o),o}get _getGroundElevation(){return q(this.view)}async _fetchCandidatesForSource(e,t,i){var h;const s=W(t,((h=this.view)==null?void 0:h.type)??"2d"),n=await e.queryEngine.executeQueryForSnapping(s,i);d(i);const o=await this._snappingElevationAligner.alignCandidates(n.candidates,i);d(i);const p=await this._symbologySnappingFetcher.fetch(o,i);d(i);const f=p.length===0?o:[...o,...p];return this._snappingElevationFilter.filter(s,f)}refresh(){}_onGraphicUpdate(e){if(this.getGraphicsLayers().some(t=>t.graphics.includes(e.graphic)))switch(e.property){case"geometry":case"visible":this._remove(e.graphic),this._addMany([e.graphic])}}_onGraphicsChanged(e){for(const t of e.removed)this._remove(t);this._addMany(e.added)}_addMany(e){const t=[],i=new Map;for(const s of e)s.geometry!=null&&(this._needsInitializeProjection(s.geometry.spatialReference)?(t.push(s.geometry.spatialReference),i.set(s.uid,s)):this._add(s));this._createPendingAdd(t,i)}_createPendingAdd(e,t){if(!e.length)return;const i=E(async o=>{await C(e.map(p=>({source:p,dest:this.spatialReference})),{signal:o}),this._markLoadedSpatialReferences(e);for(const[,p]of t)this._add(p)});this.updatingHandles.addPromise(i.promise);const s={task:i,graphics:t},n=()=>$(this._pendingAdds,s);i.promise.then(n,n),this._pendingAdds.push(s)}_markLoadedSpatialReferences(e){for(const t of e)t.wkid!=null&&this._loadedWkids.add(t.wkid),t.wkt!=null&&this._loadedWkts.add(t.wkt)}_add(e){if(e.geometry==null||!e.visible)return;let t=e.geometry;if(t.type==="mesh")return;t.type==="extent"&&(t=F.fromExtent(t));const i=this._ensureSource(t.type);if(i==null)return;const s=this._createOptimizedFeature(e.uid,t);s!=null&&(i.featureStore.add(s),y(e.symbol)&&this._extrudedPolygonSymbolsCount++)}_needsInitializeProjection(e){return(e.wkid==null||!this._loadedWkids.has(e.wkid))&&(e.wkt==null||!this._loadedWkts.has(e.wkt))&&!A(e,this.spatialReference)}_createOptimizedFeature(e,t){const i=G(z(t),this.spatialReference);if(!i)return null;const s=this._ensureGeometryHasZ(i),n=R(s,this._hasZ,!1);return new P(n,{[c]:e},null,e)}_ensureGeometryHasZ(e){if(!this._hasZ)return e;const t=s=>{for(;s.length<3;)s.push(0)},i=e.clone();switch(i.hasZ=!0,i.type){case"point":i.z=i.z??0;break;case"multipoint":i.points.forEach(t);break;case"polyline":i.paths.forEach(s=>s.forEach(t));break;case"polygon":i.rings.forEach(s=>s.forEach(t))}return i}_ensureSource(e){const t=this._sources[e];if(t!=null)return t;const i=this._createSource(e);return this._sources[e]=i,i}_createSource(e){const t=x.toJSON(e),i=this._hasZ,s=new Z({geometryType:t,hasZ:i,hasM:!1});return{featureStore:s,queryEngine:new H({featureStore:s,fields:[{name:c,type:"esriFieldTypeOID",alias:c}],geometryType:t,hasM:!1,hasZ:i,objectIdField:c,spatialReference:this.spatialReference,scheduler:this.view!=null&&this.view.type==="3d"?this.view.resourceController.scheduler:null}),type:e}}_remove(e){this._mapSources(t=>this._removeFromSource(t,e));for(const t of this._pendingAdds)t.graphics.delete(e.uid),t.graphics.size===0&&t.task.abort()}_removeFromSource(e,t){const i=t.uid;e.featureStore.has(i)&&(e.featureStore.removeById(t.uid),y(t.symbol)&&this._extrudedPolygonSymbolsCount--)}_destroySource(e){e.queryEngine.destroy(),this._sources[e.type]=null}_mapSources(e){const{point:t,polygon:i,polyline:s,multipoint:n}=this._sources,o=[];return t!=null&&o.push(e(t)),i!=null&&o.push(e(i)),s!=null&&o.push(e(s)),n!=null&&o.push(e(n)),o}};a([l()],r.prototype,"getGraphicsLayers",void 0),a([l({constructOnly:!0})],r.prototype,"layerSource",void 0),a([l({constructOnly:!0})],r.prototype,"spatialReference",void 0),a([l({constructOnly:!0})],r.prototype,"view",void 0),a([l({readOnly:!0})],r.prototype,"updating",null),a([l({readOnly:!0})],r.prototype,"availability",void 0),a([l()],r.prototype,"_hasZ",null),a([l()],r.prototype,"_snappingElevationAligner",null),a([l()],r.prototype,"_snappingElevationFilter",null),a([l()],r.prototype,"_symbologySnappingFetcher",null),a([l()],r.prototype,"_extrudedPolygonSymbolsCount",void 0),a([l()],r.prototype,"_getGroundElevation",null),r=a([I("esri.views.interactive.snapping.featureSources.GraphicsSnappingSource")],r);const c="OBJECTID";export{r as GraphicsSnappingSource}; diff --git a/assets/GraphicsView3D-1336db36.js b/assets/GraphicsView3D-1336db36.js new file mode 100644 index 0000000..38197ee --- /dev/null +++ b/assets/GraphicsView3D-1336db36.js @@ -0,0 +1 @@ +import{am as i,ah as p,ai as e,aj as s,an as a,al as c,ao as h}from"./index-080e108a.js";import{x as n}from"./GraphicsProcessor-750d4e2b.js";import"./diffUtils-590c9088.js";import"./Query-1c961d4c.js";import"./Graphics3DObjectStates-bb2a6162.js";import"./UniqueValueRenderer-fef4204d.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./popupUtils-f04ec9a9.js";let t=class extends i(h){constructor(r){super(r),this.processor=null,this.slicePlaneEnabled=!1,this.layer=new l}initialize(){this._set("processor",new n({owner:this}))}destroy(){this._set("processor",p(this.processor))}get graphics(){var r;return(r=this.view)==null?void 0:r.graphics}get loadedGraphics(){return this.graphics}get updating(){var r;return!!((r=this.processor)!=null&&r.updating)}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}getHit(r){return this.processor.getHit(r)}whenGraphicBounds(r,o){return this.processor.whenGraphicBounds(r,o)}graphicChanged(r){this.processor.graphicsCore.graphicUpdateHandler(r)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}async queryGraphics(){return this.loadedGraphics}async fetchPopupFeatures(r,o){return(o==null?void 0:o.clientGraphics)??[]}highlight(r){return this.processor.highlight(r)}maskOccludee(r){return this.processor.maskOccludee(r)}};e([s({readOnly:!0})],t.prototype,"graphics",null),e([s()],t.prototype,"loadedGraphics",null),e([s({readOnly:!0})],t.prototype,"updating",null),e([s({constructOnly:!0})],t.prototype,"view",void 0),e([s()],t.prototype,"processor",void 0),e([s({type:Boolean})],t.prototype,"slicePlaneEnabled",void 0),e([s()],t.prototype,"layer",void 0),t=e([c("esri.views.3d.layers.GraphicsView3D")],t);class l extends a{constructor(){super(),this.type="graphics-view-3d-dummy",this.id=this.uid}}const $=t;export{$ as default}; diff --git a/assets/GroupLayer-d83741dd.js b/assets/GroupLayer-d83741dd.js new file mode 100644 index 0000000..bf359b8 --- /dev/null +++ b/assets/GroupLayer-d83741dd.js @@ -0,0 +1 @@ +import{eQ as p,eS as b,hk as v,hl as u,dU as c,hm as f,aG as d,hn as m,eX as g,bu as L,ai as s,aj as r,bY as _,aM as w,aT as O,aH as y,al as M,aA as $,bz as T}from"./index-080e108a.js";import{O as V}from"./MultiOriginJSONSupport-e4912ffd.js";import{c as x}from"./OperationalLayer-0e8f8b28.js";import{j as C}from"./PortalLayer-310c2800.js";import{a as S}from"./lazyLayerLoader-8b31b2e1.js";import"./commonProperties-30089b06.js";import"./portalItemUtils-792a27e1.js";const j=Symbol("WebScene");let t=class extends p(b(x(C(v(u(V($))))))){constructor(e){super(e),this.allLayers=new c({getCollections:()=>[this.layers],getChildrenFunction:i=>"layers"in i?i.layers:null}),this.allTables=f(this),this.fullExtent=void 0,this.operationalLayerType="GroupLayer",this.spatialReference=void 0,this.type="group"}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles([d(()=>{let e=this.parent;for(;e&&"parent"in e&&e.parent;)e=e.parent;return e&&j in e},e=>{const i="prevent-adding-tables";this.removeHandles(i),e&&(this.tables.removeAll(),this.addHandles(O(()=>this.tables,"before-add",a=>{a.preventDefault(),T.getLogger(this).errorOnce("tables","Tables are not yet supported in a WebScene so they can't be added.")}),i))},w),d(()=>this.visible,this._onVisibilityChange.bind(this),y)])}destroy(){this.allLayers.destroy(),this.allTables.destroy()}_writeLayers(e,i,a,l){const o=[];if(!e)return o;e.forEach(h=>{const n=m(h,l.webmap?l.webmap.getLayerJSONFromResourceInfo(h):null,l);n!=null&&n.layerType&&o.push(n)}),i.layers=o}set portalItem(e){this._set("portalItem",e)}set visibilityMode(e){const i=this._get("visibilityMode")!==e;this._set("visibilityMode",e),i&&this._enforceVisibility(e,this.visible)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"],layerModuleTypeMap:S},e)),Promise.resolve(this)}async loadAll(){return g(this,e=>{e(this.layers,this.tables)})}layerAdded(e){e.visible&&this.visibilityMode==="exclusive"?this._turnOffOtherLayers(e):this.visibilityMode==="inherited"&&(e.visible=this.visible),this.hasHandles(e.uid)?console.error(`Layer readded to Grouplayer: uid=${e.uid}`):this.addHandles(d(()=>e.visible,i=>this._onChildVisibilityChange(e,i),y),e.uid)}layerRemoved(e){this.removeHandles(e.uid),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(e){this.layers.forEach(i=>{i!==e&&(i.visible=!1)})}_enforceVisibility(e,i){if(!L(this).initialized)return;const a=this.layers;let l=a.find(o=>o.visible);switch(e){case"exclusive":a.length&&!l&&(l=a.at(0),l.visible=!0),this._turnOffOtherLayers(l);break;case"inherited":a.forEach(o=>{o.visible=i})}}_onVisibilityChange(e){this.visibilityMode==="inherited"&&this.layers.forEach(i=>{i.visible=e})}_onChildVisibilityChange(e,i){switch(this.visibilityMode){case"exclusive":i?this._turnOffOtherLayers(e):this._isAnyLayerVisible()||(e.visible=!0);break;case"inherited":e.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some(e=>e.visible)}};s([r({readOnly:!0,dependsOn:[]})],t.prototype,"allLayers",void 0),s([r({readOnly:!0})],t.prototype,"allTables",void 0),s([r()],t.prototype,"fullExtent",void 0),s([r({json:{read:!0,write:!0}})],t.prototype,"blendMode",void 0),s([r({json:{read:!1,write:{ignoreOrigin:!0}}})],t.prototype,"layers",void 0),s([_("layers")],t.prototype,"_writeLayers",null),s([r({type:["GroupLayer"]})],t.prototype,"operationalLayerType",void 0),s([r({json:{origins:{"web-document":{read:!1,write:!1}}}})],t.prototype,"portalItem",null),s([r()],t.prototype,"spatialReference",void 0),s([r({json:{read:!1},readOnly:!0,value:"group"})],t.prototype,"type",void 0),s([r({type:["independent","inherited","exclusive"],value:"independent",json:{write:!0,origins:{"web-map":{type:["independent","exclusive"],write:(e,i,a)=>{e!=="inherited"&&(i[a]=e)}}}}})],t.prototype,"visibilityMode",null),t=s([M("esri.layers.GroupLayer")],t);const k=t;export{k as default}; diff --git a/assets/GroupLayerView-c93dbf5e.js b/assets/GroupLayerView-c93dbf5e.js new file mode 100644 index 0000000..6f6e17b --- /dev/null +++ b/assets/GroupLayerView-c93dbf5e.js @@ -0,0 +1 @@ +import{ai as a,aj as t,aE as n,al as d,aF as V,aG as y,aH as h,aI as o}from"./index-080e108a.js";import{d as p}from"./LayerView-448bc5ea.js";let l=class extends p{constructor(i){super(i),this.type="group",this.layerViews=new V}destroy(){this.handles.removeAll(),this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach(e=>{e.visible=i})}initialize(){this.handles.add([this.layerViews.on("change",i=>this._layerViewsChangeHandler(i)),y(()=>{var i;return(i=this.layer)==null?void 0:i.visibilityMode},()=>{this.layer&&this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(null))},h),y(()=>this.visible,i=>{this._applyVisibility(()=>this._allLayerViewVisibility(i),()=>{})},h)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(i){this._set("layerViews",o(i,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((i,e)=>i+e.updatingProgress,0)/this.layerViews.length}isUpdating(){return this.layerViews.some(i=>i.updating)}_hasLayerViewVisibleOverrides(){return this.layerViews.some(i=>i._isOverridden("visible"))}_findLayerViewForLayer(i){return i&&this.layerViews.find(e=>e.layer===i)}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find(e=>{const s=this._findLayerViewForLayer(e);return!!(s!=null&&s.visible)});return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){i==null&&(i=this._firstVisibleOnLayerOrder())==null&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach(e=>{e.visible=e===i})}_layerViewsChangeHandler(i){this.handles.remove("grouplayerview:visible"),this.handles.add(this.layerViews.map(s=>y(()=>s.visible,r=>this._applyVisibility(()=>{r!==this.visible&&(s.visible=this.visible)},()=>this._applyExclusiveVisibility(r?s:null)),h)).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(e!=null&&e.visible?e:null))}_applyVisibility(i,e){var s,r;this._hasLayerViewVisibleOverrides()&&(((s=this.layer)==null?void 0:s.visibilityMode)==="inherited"?i():((r=this.layer)==null?void 0:r.visibilityMode)==="exclusive"&&e())}};a([t({cast:n})],l.prototype,"layerViews",null),a([t({readOnly:!0})],l.prototype,"updatingProgress",null),a([t()],l.prototype,"view",void 0),l=a([d("esri.views.layers.GroupLayerView")],l);const b=l;export{b as default}; diff --git a/assets/HUDCompositing.glsl-67260826.js b/assets/HUDCompositing.glsl-67260826.js new file mode 100644 index 0000000..1e817b0 --- /dev/null +++ b/assets/HUDCompositing.glsl-67260826.js @@ -0,0 +1 @@ +import{t as r,r as o}from"./index-080e108a.js";export{r as HUDCompositingPassParameters,o as build}; diff --git a/assets/HUDMaterial.glsl-6c800f3a.js b/assets/HUDMaterial.glsl-6c800f3a.js new file mode 100644 index 0000000..276e455 --- /dev/null +++ b/assets/HUDMaterial.glsl-6c800f3a.js @@ -0,0 +1 @@ +import{$ as a,D as e}from"./index-080e108a.js";export{a as build,e as calculateAnchorPosForRendering}; diff --git a/assets/Heatmap.glsl-30acef82.js b/assets/Heatmap.glsl-30acef82.js new file mode 100644 index 0000000..cbf72f0 --- /dev/null +++ b/assets/Heatmap.glsl-30acef82.js @@ -0,0 +1 @@ +import"./index-080e108a.js";import{t as L}from"./FeatureLikeLayerView3D-2e3185ce.js";import"./Query-1c961d4c.js";import"./dehydratedFeatureComparison-a3375a3e.js";import"./queryForSymbologySnapping-0264f2b5.js";import"./elevationInfoUtils-4fd79d95.js";import"./hash-6f442295.js";import"./diffUtils-590c9088.js";import"./Graphics3DObjectStates-bb2a6162.js";import"./UniqueValueRenderer-fef4204d.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./popupUtils-f04ec9a9.js";import"./FeatureFilter-00f4be05.js";import"./floorFilterUtils-080a7cd2.js";import"./QueryEngine-19eda5ff.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./FeatureSet-111cb247.js";import"./FeatureStore-f0e312fc.js";import"./BoundsStore-b6bd3c14.js";import"./projectExtentUtils-efa4cddd.js";export{L as build}; diff --git a/assets/HeatmapDensity.glsl-403624d9.js b/assets/HeatmapDensity.glsl-403624d9.js new file mode 100644 index 0000000..09ee9f5 --- /dev/null +++ b/assets/HeatmapDensity.glsl-403624d9.js @@ -0,0 +1 @@ +import"./index-080e108a.js";import{s as L}from"./FeatureLikeLayerView3D-2e3185ce.js";import"./Query-1c961d4c.js";import"./dehydratedFeatureComparison-a3375a3e.js";import"./queryForSymbologySnapping-0264f2b5.js";import"./elevationInfoUtils-4fd79d95.js";import"./hash-6f442295.js";import"./diffUtils-590c9088.js";import"./Graphics3DObjectStates-bb2a6162.js";import"./UniqueValueRenderer-fef4204d.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./popupUtils-f04ec9a9.js";import"./FeatureFilter-00f4be05.js";import"./floorFilterUtils-080a7cd2.js";import"./QueryEngine-19eda5ff.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./FeatureSet-111cb247.js";import"./FeatureStore-f0e312fc.js";import"./BoundsStore-b6bd3c14.js";import"./projectExtentUtils-efa4cddd.js";export{L as build}; diff --git a/assets/HeatmapProcessor-db17730e.js b/assets/HeatmapProcessor-db17730e.js new file mode 100644 index 0000000..15b9a33 --- /dev/null +++ b/assets/HeatmapProcessor-db17730e.js @@ -0,0 +1 @@ +import{ai as _,al as F,fA as m}from"./index-080e108a.js";import{a as S}from"./diffUtils-590c9088.js";import{s as U}from"./heatmapUtils-327ef4c5.js";import{c as v}from"./definitions-0bc08d4c.js";import{p as E,o}from"./tileUtils-48cbbab9.js";class n{constructor(t,i){this.offset=t,this.extent=i}}function O(s){const t=s.key,i=new Map,a=256,e=v,r=s.tileInfoView.tileInfo.isWrappable;return i.set(o(t,-1,-1,r).id,new n([-e,-e],[e-a,e-a,e,e])),i.set(o(t,0,-1,r).id,new n([0,-e],[0,e-a,e,e])),i.set(o(t,1,-1,r).id,new n([e,-e],[0,e-a,a,e])),i.set(o(t,-1,0,r).id,new n([-e,0],[e-a,0,e,e])),i.set(o(t,1,0,r).id,new n([e,0],[0,0,a,e])),i.set(o(t,-1,1,r).id,new n([-e,e],[e-a,0,e,a])),i.set(o(t,0,1,r).id,new n([0,e],[0,0,e,a])),i.set(o(t,1,1,r).id,new n([e,e],[0,0,a,a])),i}let c=class extends E{constructor(){super(...arguments),this.type="heatmap",this._tileKeyToFeatureSets=new Map}initialize(){this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this))])}async update(s,t){const i=t.schema.processors[0];i.type==="heatmap"&&S(this._schema,i)&&(s.mesh=!0,this._schema=i)}onTileUpdate(s){for(const t of s.removed)this._tileKeyToFeatureSets.delete(t.key.id)}onTileClear(s){const t={clear:!0};return this._tileKeyToFeatureSets.delete(s.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:s.id,data:t})}async onTileMessage(s,t,i){this._tileKeyToFeatureSets.has(s.key.id)||this._tileKeyToFeatureSets.set(s.key.id,new Map);const a=this._tileKeyToFeatureSets.get(s.key.id);if(a&&t.addOrUpdate!=null&&t.addOrUpdate.hasFeatures&&a.set(t.addOrUpdate.instance,t),t.end){const e=[],r=O(s);this._tileKeyToFeatureSets.forEach((f,d)=>{if(d===s.key.id)f.forEach(l=>m(l.addOrUpdate,h=>e.push(h)));else if(r.has(d)){const l=r.get(d),[h,T]=l.offset;f.forEach(w=>m(w.addOrUpdate,k=>{const K=k.transform(h,T,1,1);e.push(K)}))}});const p=U(e,this._schema.mesh,512,512),u={tileKey:s.key.id,intensityInfo:p},y=[p.matrix];return this.remoteClient.invoke("tileRenderer.onTileData",u,{...i,transferList:y})}}onTileError(s,t,i){return this.remoteClient.invoke("tileRenderer.onTileError",{tileKey:s.id,error:t},i)}};c=_([F("esri.views.2d.layers.features.processors.HeatmapProcessor")],c);const R=c;export{R as default}; diff --git a/assets/HighlightApply.glsl-d2c44603.js b/assets/HighlightApply.glsl-d2c44603.js new file mode 100644 index 0000000..6dec27c --- /dev/null +++ b/assets/HighlightApply.glsl-d2c44603.js @@ -0,0 +1 @@ +import{Q as a}from"./index-080e108a.js";export{a as build}; diff --git a/assets/HighlightBlur.glsl-8389b4e8.js b/assets/HighlightBlur.glsl-8389b4e8.js new file mode 100644 index 0000000..286cf86 --- /dev/null +++ b/assets/HighlightBlur.glsl-8389b4e8.js @@ -0,0 +1 @@ +import{R as e,T as i}from"./index-080e108a.js";export{e as HighlightBlurDrawParameters,i as build}; diff --git a/assets/HighlightDownsample.glsl-b1b35495.js b/assets/HighlightDownsample.glsl-b1b35495.js new file mode 100644 index 0000000..940e5fc --- /dev/null +++ b/assets/HighlightDownsample.glsl-b1b35495.js @@ -0,0 +1 @@ +import{U as e,W as s}from"./index-080e108a.js";export{e as HighlightDownsampleDrawParameters,s as build}; diff --git a/assets/I3SBinaryReader-2b8e30f7.js b/assets/I3SBinaryReader-2b8e30f7.js new file mode 100644 index 0000000..630bddd --- /dev/null +++ b/assets/I3SBinaryReader-2b8e30f7.js @@ -0,0 +1,2 @@ +import{ar as l,bz as D,a_ as U,cl as P}from"./index-080e108a.js";const d=!0,m={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function M(e,t,r){return{identifier:String.fromCharCode.apply(null,new Uint8Array(e,r+m.identifierOffset,m.identifierLength)),version:t.getUint16(r+m.versionOffset,d),checksum:t.getUint32(r+m.checksumOffset,d)}}const g={sizeLo:0,sizeHi:4,minX:8,minY:16,minZ:24,maxX:32,maxY:40,maxZ:48,errorX:56,errorY:64,errorZ:72,count:80,reserved:84,byteCount:88};function S(e,t){return{sizeLo:e.getUint32(t+g.sizeLo,d),sizeHi:e.getUint32(t+g.sizeHi,d),minX:e.getFloat64(t+g.minX,d),minY:e.getFloat64(t+g.minY,d),minZ:e.getFloat64(t+g.minZ,d),maxX:e.getFloat64(t+g.maxX,d),maxY:e.getFloat64(t+g.maxY,d),maxZ:e.getFloat64(t+g.maxZ,d),errorX:e.getFloat64(t+g.errorX,d),errorY:e.getFloat64(t+g.errorY,d),errorZ:e.getFloat64(t+g.errorZ,d),count:e.getUint32(t+g.count,d),reserved:e.getUint32(t+g.reserved,d)}}function K(e){const t=new DataView(e,0);let r=0;const{identifier:c,version:o}=M(e,t,r);if(r+=m.byteCount,c!=="LEPCC ")throw new l("lepcc-decode-error","Bad identifier");if(o>1)throw new l("lepcc-decode-error","Unknown version");const n=S(t,r);if(r+=g.byteCount,n.sizeHi*2**32+n.sizeLo!==e.byteLength)throw new l("lepcc-decode-error","Bad size");const a=new Float64Array(3*n.count),u=[],i=[],s=[],f=[];if(r=I(e,r,u),r=I(e,r,i),r=I(e,r,s),r=I(e,r,f),r!==e.byteLength)throw new l("lepcc-decode-error","Bad length");let w=0,b=0;for(let y=0;y>6;let i=0;if(u===0)i=c.getUint32(1,d),t+=5;else if(u===1)i=c.getUint16(1,d),t+=3;else{if(u!==2)throw new l("lepcc-decode-error","Bad count type");i=c.getUint8(1),t+=2}if(a)throw new l("lepcc-decode-error","LUT not implemented");const s=Math.ceil(i*n/8),f=new Uint8Array(e,t,s);let w=0,b=0,y=0;const v=-1>>>32-n;for(let C=0;C>>=n,b-=n,b+n>32&&(w|=f[y-1]>>8-b)}return t+y}const p={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function Y(e,t){return{sizeLo:e.getUint32(t+p.sizeLo,d),sizeHi:e.getUint32(t+p.sizeHi,d),count:e.getUint32(t+p.count,d),colorMapCount:e.getUint16(t+p.colorMapCount,d),lookupMethod:e.getUint8(t+p.lookupMethod),compressionMethod:e.getUint8(t+p.compressionMethod)}}function $(e){const t=new DataView(e,0);let r=0;const{identifier:c,version:o}=M(e,t,r);if(r+=m.byteCount,c!=="ClusterRGB")throw new l("lepcc-decode-error","Bad identifier");if(o>1)throw new l("lepcc-decode-error","Unknown version");const n=Y(t,r);if(r+=p.byteCount,n.sizeHi*2**32+n.sizeLo!==e.byteLength)throw new l("lepcc-decode-error","Bad size");if((n.lookupMethod===2||n.lookupMethod===1)&&n.compressionMethod===0){if(3*n.colorMapCount+n.count+r!==e.byteLength||n.colorMapCount>256)throw new l("lepcc-decode-error","Bad count");const a=new Uint8Array(e,r,3*n.colorMapCount),u=new Uint8Array(e,r+3*n.colorMapCount,n.count),i=new Uint8Array(3*n.count);for(let s=0;s1)throw new l("lepcc-decode-error","Unknown version");const n=V(t,r);if(r+=h.byteCount,n.sizeHi*2**32+n.sizeLo!==e.byteLength)throw new l("lepcc-decode-error","Bad size");const a=new Uint16Array(n.count);if(n.bitsPerPoint===8){if(n.count+r!==e.byteLength)throw new l("lepcc-decode-error","Bad size");const u=new Uint8Array(e,r,n.count);for(let i=0;i=192&&n<224){if(o+1>=r)throw new l("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const a=(31&n)<<6|63&e[t+o+1];c+=String.fromCharCode(a),o+=2}else if(n>=224&&n<240){if(o+2>=r)throw new l("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const a=(15&n)<<12|(63&e[t+o+1])<<6|63&e[t+o+2];c+=String.fromCharCode(a),o+=3}else{if(!(n>=240&&n<248))throw new l("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(o+3>=r)throw new l("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const a=(7&n)<<18|(63&e[t+o+1])<<12|(63&e[t+o+2])<<6|63&e[t+o+3];if(a>=65536){const u=55296+(a-65536>>10),i=56320+(1023&a);c+=String.fromCharCode(u,i)}else c+=String.fromCharCode(a);o+=4}}}return c}function x(e,t){const r={byteOffset:0,byteCount:0,fields:Object.create(null)};let c=0;for(let o=0;o{const o=c?Date.parse(c):null;return o&&!Number.isNaN(o)?o:null})}function B(e,t,r){const c=[];let o,n,a=0;for(n=0;n0){if(c.push(X(r,a,o-1)),r[a+o-1]!==0)throw new l("string-array-error","Invalid string array: missing null termination.")}else c.push(null);a+=o}return c}function F(e,t){return new O[t.valueType](e,t.byteOffset,t.count*t.valuesPerElement)}function H(e,t){return new Uint8Array(e,t.byteOffset,t.byteCount)}function N(e,t,r){const c=t.header!=null?x(e,t.header):{byteOffset:0,byteCount:0,fields:{count:r}},o={header:c,byteOffset:c.byteCount,byteCount:0,entries:Object.create(null)};let n=c.byteCount;for(let a=0;anew DataView(e,0).getFloat32(t,!0),Float64:(e,t)=>new DataView(e,0).getFloat64(t,!0),UInt8:(e,t)=>new DataView(e,0).getUint8(t),Int8:(e,t)=>new DataView(e,0).getInt8(t),UInt16:(e,t)=>new DataView(e,0).getUint16(t,!0),Int16:(e,t)=>new DataView(e,0).getInt16(t,!0),UInt32:(e,t)=>new DataView(e,0).getUint32(t,!0),Int32:(e,t)=>new DataView(e,0).getInt32(t,!0)};function k(e){return O.hasOwnProperty(e)}function A(e){return k(e)?O[e].BYTES_PER_ELEMENT:0}export{te as I,K as c,F as l,ee as p,Q as w}; diff --git a/assets/I3SIndexInfo-445e6968.js b/assets/I3SIndexInfo-445e6968.js new file mode 100644 index 0000000..ecb771e --- /dev/null +++ b/assets/I3SIndexInfo-445e6968.js @@ -0,0 +1 @@ +import{at as u,ar as g}from"./index-080e108a.js";async function y(r,n,e,t,a,s){let l=null;if(e!=null){const o=`${r}/nodepages/`,c=o+Math.floor(e.rootIndex/e.nodesPerPage);try{return{type:"page",rootPage:(await u(c,{query:{f:"json",token:t},responseType:"json",signal:s})).data,rootIndex:e.rootIndex,pageSize:e.nodesPerPage,lodMetric:e.lodSelectionMetricType,urlPrefix:o}}catch(p){a!=null&&a.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",c,p),l=p}}if(!n)return null;const d=`${r}/nodes/`,i=d+(n&&n.split("/").pop());try{return{type:"node",rootNode:(await u(i,{query:{f:"json",token:t},responseType:"json",signal:s})).data,urlPrefix:d}}catch(o){throw new g("sceneservice:root-node-missing","Root node missing.",{pageError:l,nodeError:o,url:i})}}export{y as r}; diff --git a/assets/I3SLayerDefinitions-ffdb3821.js b/assets/I3SLayerDefinitions-ffdb3821.js new file mode 100644 index 0000000..268eafd --- /dev/null +++ b/assets/I3SLayerDefinitions-ffdb3821.js @@ -0,0 +1 @@ +import{ai as e,aj as t,al as s,d2 as n,ck as i}from"./index-080e108a.js";let u=class extends i{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};e([t({type:Number})],u.prototype,"nodesPerPage",void 0),e([t({type:Number})],u.prototype,"rootIndex",void 0),e([t({type:String})],u.prototype,"lodSelectionMetricType",void 0),u=e([s("esri.layer.support.I3SNodePageDefinition")],u);let a=class extends i{constructor(){super(...arguments),this.factor=1}};e([t({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],a.prototype,"id",void 0),e([t({type:Number})],a.prototype,"factor",void 0),a=e([s("esri.layer.support.I3SMaterialTexture")],a);let l=class extends i{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};e([t({type:[Number]})],l.prototype,"baseColorFactor",void 0),e([t({type:a})],l.prototype,"baseColorTexture",void 0),e([t({type:a})],l.prototype,"metallicRoughnessTexture",void 0),e([t({type:Number})],l.prototype,"metallicFactor",void 0),e([t({type:Number})],l.prototype,"roughnessFactor",void 0),l=e([s("esri.layer.support.I3SMaterialPBRMetallicRoughness")],l);let o=class extends i{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};e([n({opaque:"opaque",mask:"mask",blend:"blend"})],o.prototype,"alphaMode",void 0),e([t({type:Number})],o.prototype,"alphaCutoff",void 0),e([t({type:Boolean})],o.prototype,"doubleSided",void 0),e([n({none:"none",back:"back",front:"front"})],o.prototype,"cullFace",void 0),e([t({type:a})],o.prototype,"normalTexture",void 0),e([t({type:a})],o.prototype,"occlusionTexture",void 0),e([t({type:a})],o.prototype,"emissiveTexture",void 0),e([t({type:[Number]})],o.prototype,"emissiveFactor",void 0),e([t({type:l})],o.prototype,"pbrMetallicRoughness",void 0),o=e([s("esri.layer.support.I3SMaterialDefinition")],o);let y=class extends i{};e([t({type:String,json:{read:{source:["name","index"],reader:(v,x)=>v??`${x.index}`}}})],y.prototype,"name",void 0),e([n({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],y.prototype,"format",void 0),y=e([s("esri.layer.support.I3STextureFormat")],y);let c=class extends i{constructor(){super(...arguments),this.atlas=!1}};e([t({type:[y]})],c.prototype,"formats",void 0),e([t({type:Boolean})],c.prototype,"atlas",void 0),c=e([s("esri.layer.support.I3STextureSetDefinition")],c);let p=class extends i{};e([n({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],p.prototype,"type",void 0),e([t({type:Number})],p.prototype,"component",void 0),p=e([s("esri.layer.support.I3SGeometryAttribute")],p);let d=class extends i{};e([n({draco:"draco"})],d.prototype,"encoding",void 0),e([t({type:[String]})],d.prototype,"attributes",void 0),d=e([s("esri.layer.support.I3SGeometryCompressedAttributes")],d);let r=class extends i{constructor(){super(...arguments),this.offset=0}};e([t({type:Number})],r.prototype,"offset",void 0),e([t({type:p})],r.prototype,"position",void 0),e([t({type:p})],r.prototype,"normal",void 0),e([t({type:p})],r.prototype,"uv0",void 0),e([t({type:p})],r.prototype,"color",void 0),e([t({type:p})],r.prototype,"uvRegion",void 0),e([t({type:p})],r.prototype,"featureId",void 0),e([t({type:p})],r.prototype,"faceRange",void 0),e([t({type:d})],r.prototype,"compressedAttributes",void 0),r=e([s("esri.layer.support.I3SGeometryBuffer")],r);let m=class extends i{};e([n({triangle:"triangle"})],m.prototype,"topology",void 0),e([t()],m.prototype,"geometryBuffers",void 0),m=e([s("esri.layer.support.I3SGeometryDefinition")],m);export{o as l,m,u as s,c as u}; diff --git a/assets/I3SMeshView3D-86f2c945.js b/assets/I3SMeshView3D-86f2c945.js new file mode 100644 index 0000000..5eee761 --- /dev/null +++ b/assets/I3SMeshView3D-86f2c945.js @@ -0,0 +1 @@ +import{i2 as zt,dw as ve,g5 as me,eG as $e,nc as Pe,jh as yt,oj as Le,pW as qt,jH as bt,gv as re,dT as $,cu as Ge,iS as fe,ai as g,aj as p,al as Ie,ao as Ue,bi as Kt,af as Wt,aD as Yt,aG as je,ah as F,gW as Xt,pX as Qt,pY as Zt,pZ as Oe,gD as Jt,bN as vt,iR as es,hr as ts,aB as ss,bz as ye,dO as _e,fz as It,dW as is,hV as rs,pT as as,dA as Ve,kI as ns,hW as Ct,jC as Mt,fr as os,ft as Et,e_ as ls,fu as xt,d4 as Ot,hJ as ds,hR as hs,p_ as cs,n8 as We,hX as us,p$ as _s,cb as wt,ar as gs,g9 as ps,ax as He,dz as be,gh as St,bh as ms,aL as fs,cn as we,aK as oe,cL as Ye,dv as Xe,ag as V,aw as ys,g8 as Q,q0 as bs,bn as Nt,fA as vs,q1 as Qe,n_ as Is,q2 as Cs,iY as Ms,dN as Es,dZ as xs,q3 as Os,gf as ws,q4 as Ss,q5 as Ze,q6 as Ns,q7 as Se,q8 as As,oI as Rs,q9 as Fs,mR as Ts,oM as Ds,oU as Ps,gz as js,qa as Vs,i$ as Hs,qb as le,dS as Je,cv as $s,qc as et,jI as Ls,g4 as Gs,bA as Us,n4 as ks,iT as Bs,qd as zs,bw as qs,gx as Ne,qe as de,qf as Ks,qg as Ws,qh as tt,aF as Ys,f5 as Xs,eF as At,fs as Qs,gu as Zs,j1 as Js}from"./index-080e108a.js";import{a as ge,b as Z,M as ei,c as he,D as ti,e as si,d as ii,f as ri,F as ai,S as ni}from"./I3SOverrides-96f73e2b.js";import{f as oi}from"./SceneModification-2715f58a.js";import{a as li}from"./diffUtils-590c9088.js";import{F as di,m as hi,b as ci}from"./Graphics3DObjectStates-bb2a6162.js";import{e as G,j as ui,w as _i,S as gi,L as pi}from"./SceneLayerWorker-e92c2264.js";import{B as mi,P as fi,x as yi,w as bi,T as vi,h as Ii,n as Ci,a as st,K as Mi,b as Ei,J as it,f as Ae,t as xi,e as ce,k as Re,U as Oi,j as J,Y as wi}from"./I3SUtil-2c288808.js";import{o as rt,c as Si}from"./I3SNode-2025159f.js";import{n as Fe}from"./FeatureLikeLayerView3D-2e3185ce.js";function Ni(n,r=!1){return n<=zt?r?new Array(n).fill(0):new Array(n):new Uint8Array(n)}function pr(n,r,e){const t=me(24);return s=>{let i=s.meta.featureExtents;if(i==null){i=new Float64Array(6*s.meta.featureIds.length),s.meta.featureExtents=i;for(let o=0;o0){const r=this.toArray();this._map.clear(),this.emit("change",{added:[],removed:r})}}get length(){return this._map.size}get(r){return this._map.get(r)}addMany(r){if(r.length===0)return;const e=new Set;for(let s=0;s0?r.filter(s=>!e.has(s.objectId)):r;t.length>0&&this.emit("change",{added:t,removed:[]})}removeMany(r){const e=[];for(const t of r){const s=t.objectId,i=this._map.get(s);i!=null&&(!i.refCount||--i.refCount<=0)&&(this._map.delete(s),e.push(t))}e.length>0&&this.emit("change",{added:[],removed:e})}removeManyByObjectId(r){const e=[];for(const t of r){const s=this._map.get(t);s!=null&&(!s.refCount||--s.refCount<=0)&&(this._map.delete(t),e.push(s))}e.length>0&&this.emit("change",{added:[],removed:e})}toArray(){return[...this._map.values()]}find(r){let e;return fe(this._map,t=>!!r(t)&&(e=t,!0)),e}forEach(r){this._map.forEach(e=>r(e))}}let Fi=class extends Ge{constructor(r){super(),this._limit=r,this._all=new Ri,this._active=new Di(this),this._pending=new Map,this._handle=this._all.on("change",e=>this._handleChanges(e))}destroy(){this._handle.remove()}get length(){return this._active.length}toArray(){return this._active.toArray()}find(r){return this._active.find(r)}forEach(r){this._active.forEach(r)}addMany(r){this._all.addMany(r)}removeManyByObjectId(r){this._all.removeManyByObjectId(r)}_handleChanges(r){let e=r.removed;if(this._pending.size>0){e=new Array;for(const a of r.removed)this._pending.delete(a.objectId)||e.push(a)}let t=this._limit-this._active.length+e.length;t{K.sample()&&(e.push(a),this._pending.set(a.objectId,a))}),t=this._limit-this._active.length+e.length);let s=r.added;if(t0&&this._pending.size>0&&(K.reset(i/this._pending.size),this._pending.forEach(a=>{K.sample()&&(s.push(a),this._pending.delete(a.objectId))})),this._active.addAndRemove(s,e)}},Ti=class{constructor(){this._percentage=1,this._last=-1,this._index=0}reset(r){this._percentage=r,this._last=-1}sample(){const r=Math.floor(this._index*this._percentage);return++this._index,r!==this._last&&(this._last=r,!0)}};const K=new Ti;let Di=class{constructor(r){this._parent=r,this._map=new Map}get length(){return this._map.size}forEach(r){this._map.forEach(e=>r(e))}find(r){let e;return fe(this._map,t=>!!r(t)&&(e=t,!0)),e}toArray(){return[...this._map.values()]}addAndRemove(r,e){for(const t of r)this._map.set(t.objectId,t);for(const t of e)this._map.delete(t.objectId);(r.length>0||e.length>0)&&this._parent.emit("change",{added:r,removed:e})}removeMany(r){for(const e of r)this._map.delete(e.objectId);r.length>0&&this._parent.emit("change",{added:[],removed:r})}},nt=class{constructor(r,e){this.meta=r,this.index=e}};class Pi{constructor(r,e){this.graphic=r,this.geometry=e,this.components=[],this.overridesDirty=!1}}let T=class extends Ue{get updating(){var n;return((n=this._graphicsCore)==null?void 0:n.updating)??!1}constructor(n){super(n),this.loadedGraphics=new Fi(5e4),this.slicePlaneEnabled=!1,this._renderingInfo={symbol:new Kt},this._handles=new Wt,this._featuresMap=new Map}initialize(){const n=this.view.basemapTerrain;this._graphicsCore=new di({owner:this,layer:this.layer,preferredUpdatePolicy:Yt.ASYNC,elevationFeatureExpressionEnabled:!1,graphicSymbolSupported:!1,getRenderingInfoWithoutRenderer:!0,hasZ:!0,hasM:!1,componentFactories:{deconflictor:r=>this.view.deconflictor.addGraphicsOwner(r),labeler:(r,e)=>this.view.labeler.addGraphicsOwner(r,e,{emptySymbolLabelSupported:!0,elevationInfoOverride:{mode:"absolute-height",offset:0},disablePlacement:{logEntityDescription:"3D Object Scene Layer features"}}),scaleVisibility:(r,e)=>new hi({graphicsCoreOwner:this,layer:this.layer,queryGraphicUIDsInExtent:e,graphicsCore:r,basemapTerrain:n,layerScaleEnabled:!1})}}),this._graphicsCore.initializePromise.then(()=>this._graphicsCore.startCreateGraphics()).catch(()=>{}),this._handles.add(je(()=>this.layer.labelingInfo,(r,e)=>{li(r,e)&&this._graphicsCore.updateLabelingInfo()}))}destroy(){this._handles=F(this._handles),this._graphicsCore=F(this._graphicsCore),this.loadedGraphics=F(this.loadedGraphics),this.view=null}addNodeMeta(n,r){let e=0;const t=n.filteredIds,s=this.view.spatialReference,i=[];for(let a=0;a{const i=this._graphicsCore.getGraphics3DGraphicById(t.uid);i!=null&&this._updateLabelGeometry(n.featureIds[e])&&i.alignWithAbsoluteElevation(s.z??0,r,!1)})}setNodeMetaAttributes(n,r){const e=new Array;this._forEachGraphic(n,(t,s)=>{const i=r(t,n);Qt(s.attributes,i)||(s.attributes=i,e.push(s.uid))}),this._graphicsCore.updateLabelingInfo(e)}applyFilterChange(n){this._forEachFeature(n,(r,e,t)=>{if(!this._enabledForFeatureInNode(n,r)){const a=n.featureIds[r];switch(this._removeFeature(e,n,r)){case H.REMOVED:this.loadedGraphics.removeManyByObjectId([a]);break;case H.MODIFIED:this._updateLabelPosition(a)}return}const s=e.graphic,i=s.visible;i!==t&&(s.visible=t,ee.graphic=s,ee.property="visible",ee.oldValue=i,ee.newValue=t,this._graphicsCore.graphicUpdateHandler(ee))})}removeNodeMeta(n){const r=[];this._forEachGraphic(n,e=>{const t=n.featureIds[e],s=this._featuresMap.get(t);if(s)switch(this._removeFeature(s,n,e)){case H.MODIFIED:this._updateLabelPosition(t);break;case H.REMOVED:r.push(t)}}),this.loadedGraphics.removeManyByObjectId(r)}_removeFeature(n,r,e){const t=n.components.length;return Zt(n.components,s=>!(s.meta===r&&s.index===e)),n.components.length===0?(this._featuresMap.delete(r.featureIds[e]),H.REMOVED):t!==n.components.length?H.MODIFIED:H.UNMODIFIED}getRenderingInfo(){return this._renderingInfo}notifyGraphicGeometryChanged(){}notifyGraphicVisibilityChanged(){}_updateLabelPosition(n){const r=this._featuresMap.get(n);r&&this._updateLabelGeometry(n)&&(this.loadedGraphics.removeManyByObjectId([n]),this.loadedGraphics.addMany([r.graphic]))}_updateLabelGeometry(n){const r=this._featuresMap.get(n);if(!r)return!1;const e=r.geometry,t=this.view.spatialReference,s=this.view.renderCoordsHelper,i=e.x,a=e.y,o=e.z??0,d=r.components.length,l=me(d*at);let h=0;for(const{meta:c,index:_}of r.components)ke(_,this.collection,c.objectHandle,l,h),h+=at;return $e(l,s.spatialReference,0,l,t,0,l.length/3),Pe(U,yt),Le(U,l),e.x=(U[0]+U[3])/2,e.y=(U[1]+U[4])/2,e.z=U[5],!Oe(e.x,i)||!Oe(e.y,a)||!Oe(e.z,o)}_forEachGraphic(n,r){this._forEachFeature(n,(e,{graphic:t,geometry:s},i)=>{this._enabledForFeatureInNode(n,e)&&r(e,t,s,i)})}_forEachFeature(n,r){let e=0;for(let t=0;t[e.geometryBuffer],project:e=>[e.positions.buffer],transformNormals:e=>[e.normals.buffer]},r,{hasInitialize:!0})}setModifications(r,e,t,s){const i={context:r,modifications:Rt(e,t,s),isGeodetic:s.isGeographic};this.broadcast(i,"setModifications")}setLegacySchema(r,e){const t=JSON.stringify(e);this.broadcast({context:r,jsonSchema:t},"setLegacySchema")}destroyContext(r){return this.broadcast(r,"destroyContext")}project(r,e){return this.invokeMethod("project",r,e)}transformNormals(r,e){return this.invokeMethod("transformNormals",r,e)}};const u=new vt({deallocator:null}),W=[0,0,0];function Rt(n,r,e){u.clear();let t=1/0,s=1/0,i=-1/0,a=-1/0,o=!1;for(const l of r){const h=l.type==="clip"?G.Inside:l.type==="mask"?G.Outside:G.Replace,c=ts(l.geometry,"modification.geometry");let _=m=>m;if(c.spatialReference){if(!ss(c.spatialReference,e)){ye.getLogger("esri.views.3d.layers.I3SMeshWorkerHandle").warn("Can't project modification polygon into layer spatial reference, ignoring modification");continue}_=m=>(_e(m,c.spatialReference,W,e),W)}else c.hasZ||(W[2]=0,_=m=>(W[0]=m[0],W[1]=m[1],W));o=o||h===G.Outside,u.push(h),u.push(c.rings.length);for(const m of c.rings){u.push(m.length);for(const C of m){const v=_(C);u.push(v[0]),u.push(v[1]),u.push(v[2]),t=Math.min(t,v[0]),s=Math.min(s,v[1]),i=Math.max(i,v[0]),a=Math.max(a,v[1])}}}n!=null&&(o?(u.push(G.Inside),u.push(2),u.push(4),u.push(t-1e-4),u.push(s-1e-4),u.push(0),u.push(i+1e-4),u.push(s-1e-4),u.push(0),u.push(i+1e-4),u.push(a+1e-4),u.push(0),u.push(t-1e-4),u.push(a+1e-4),u.push(0),u.push(4),u.push(n[0]),u.push(n[1]),u.push(0),u.push(n[2]),u.push(n[1]),u.push(0),u.push(n[2]),u.push(n[3]),u.push(0),u.push(n[0]),u.push(n[3]),u.push(0)):(u.push(G.Outside),u.push(1),u.push(4),u.push(n[0]),u.push(n[1]),u.push(0),u.push(n[2]),u.push(n[1]),u.push(0),u.push(n[2]),u.push(n[3]),u.push(0),u.push(n[0]),u.push(n[3]),u.push(0))),u.push(G.Finished);const d=new Float64Array(u.length);for(let l=0;lthis._releaseSet(r)),this._highlights=null}acquireSet(){const r=new Hi;return this._highlights.push(r),{set:r,handle:{remove:()=>{this._highlights&&(this._releaseSet(r),It(this._highlights,r))},pause:()=>{this._releaseSet(r),r.paused=!0},resume:()=>{r.paused=!1,this._initializeSet(r)}}}}setFeatureIds(r,e){e.forEach(t=>r.ids.add(t)),this._initializeSet(r)}_initializeSet(r){this._forAllFeatures((e,t,s)=>(r.ids.has(e)&&this._collection.addComponentHighlight(s.objectHandle,t),w.CONTINUE))}_releaseSet(r){this._forAllFeatures((e,t,s)=>(r.ids.has(e)&&this._collection.removeComponentHighlight(s.objectHandle,t),w.CONTINUE))}objectCreated(r){this._highlights.forEach(e=>{e.paused||this._forAllFeaturesOfNode(r,(t,s)=>(e.ids.has(t)&&this._collection.addComponentHighlight(r.objectHandle,s),w.CONTINUE))})}objectDeleted(r){this._collection.clearHighlights(r.objectHandle)}},pe=class extends Ue{constructor(r,e,t){super({}),this._updateExtent=e,this._updateNode=t,this.running=!1,this._extentSet=new ci,this._nodeSet=new Set,this.addHandles(r.registerTask(is.ELEVATION_ALIGNMENT,this))}normalizeCtorArgs(){return{}}addExtent(r){this._extentSet.add(r),this.running=!0}schedule(r){this._nodeSet.add(r),this.running=!0}remove(r){this._nodeSet.delete(r),this._updateRunning()}runTask(r){const e=this._extentSet;for(r.run(()=>e.merge(r));!e.empty&&!r.done;){const s=this._updateExtent(e.pop());s!=null&&s.forAll(i=>this.schedule(i)),r.madeProgress()}if(r.done)return;const t=this._nodeSet;for(const s of t)if(t.delete(s),this._updateNode(s),r.madeProgress(),r.done)break;this._updateRunning()}_updateRunning(){this.running=this._nodeSet.size>0||this._extentSet.size>0}};g([p()],pe.prototype,"running",void 0),pe=g([Ie("esri.views.3d.layers.i3s.I3SAsyncElevationUpdater.ts")],pe);let Li=class{constructor(){this.lodCrossfadeSignedDuration=0}},Gi=class{constructor(r){this._view=r,this._preRenderFrameTaskHandle=null,this._currentFrameStartTime=null,this._numFadingNodes=0}destroy(){var r;(r=this._preRenderFrameTaskHandle)==null||r.remove(),this._preRenderFrameTaskHandle=null,this._view=null}get updating(){return this._numFadingNodes>0}stopNodeFading(r){r.lodCrossfadeProgress!=null&&(this._numFadingNodes--,r.lodCrossfadeProgress=null,this._numFadingNodes===0&&(this._preRenderFrameTaskHandle!=null&&(this._preRenderFrameTaskHandle=rs(this._preRenderFrameTaskHandle)),this._view.notifyLODUpdate(),this._view.notifyUpdate()))}_startNodeFading(r,e,t){this._numFadingNodes===0&&(this._preRenderFrameTaskHandle=as({preRender:s=>this._updateAllNodeFading(s)}),this._view.notifyLODUpdate()),r.lodCrossfadeProgress==null&&(this._numFadingNodes++,this._view.notifyUpdate()),r.lodCrossfadeSignedDuration=t,r.lodCrossfadeProgress=e}_updateAllNodeFading(r){const e=this._view.nodeCrossfadingEnabled;this._view.foreachCrossfadeNode((t,s)=>{if(s!=null&&s.lodCrossfadeProgress!=null){const i=s.lodCrossfadeSignedDuration,a=i>0?this._view.fullOpacity:0,o=r.deltaTime/i,d=s.lodCrossfadeProgress+Math.abs(o),l=!e||d>=1||i===0,h=a-(l?0:i>0?1:-1)*(1-d);l?(this.stopNodeFading(s),i<0&&this._view.markNodeToRemove(t)):s.lodCrossfadeProgress=d,this._view.setNodeOpacityByIndex(t,h)}}),this._view.removeMarkedNodes()}stopAllNodeFading(){this._view.foreachCrossfadeNode((r,e)=>{if(e!=null&&e.lodCrossfadeProgress!=null){this.stopNodeFading(e);const t=e.lodCrossfadeSignedDuration;t<0&&this._view.markNodeToRemove(r);const s=t>0?this._view.fullOpacity:0;this._view.setNodeOpacityByIndex(r,s)}}),this._view.removeMarkedNodes()}fadeNode(r,e,t,s){this._currentFrameStartTime==null&&(this._currentFrameStartTime=Date.now());const i=this._view,a=i.nodeCrossfadingEnabled,o=t===ge.FadeIn?i.fullOpacity:0,d=a?s?t===ge.FadeIn?i.lodCrossfadeinDuration:i.lodCrossfadeoutDuration:i.lodCrossfadeUncoveredDuration:0,l=this._view.getNodeOpacityByIndex(r);if(a&&l!==o&&d>0){const h=1-Math.abs(o-l);this._startNodeFading(e,h,Ui(t)*d)}else this.stopNodeFading(e),this._view.setNodeOpacityByIndex(r,o),t===ge.FadeOut&&this._view.removeNode(r)}isNodeFullyFadedIn(r){const e=this._view.getNodeCrossfadeMetaData(r);return e==null||e.lodCrossfadeProgress==null&&this._view.getNodeOpacityByIndex(r)===this._view.fullOpacity}};function Ui(n){return n===ge.FadeIn?1:-1}const k=Ve(),te=xt(),ot=Ot(0,0,0,0),N=$(),Te=$(),De=$();let B=class extends Ge.EventedMixin(Ue){get spatialReference(){var n,r;return(r=(n=this.view)==null?void 0:n.elevationProvider)==null?void 0:r.spatialReference}constructor(n){super(n),this._tmpEvent={spatialReference:null,extent:k,context:"scene"}}initialize(){this.view=this.layerView.view,this._renderCoordsHelper=this.view.renderCoordsHelper,this._intersector=ns(this.view.state.viewingMode),this._intersector.options.store=Ct.MIN;const n=this.layerView.i3slayer.fullExtent;n==null?ye.getLogger(this).error("I3SElevationProvider expected fullExtent on I3SLayer."):(this._zmin=n.zmin,this._zmax=n.zmax),this._tmpEvent.context=this.intersectionHandler.isGround?"ground":"scene"}getElevation(n,r,e,t){if(N[0]=n,N[1]=r,N[2]=e,!this._renderCoordsHelper.toRenderCoords(N,t,N))return ye.getLogger(this).error("could not project point to compute elevation"),null;const s=this.layerView.elevationOffset,i=this._zmin+s,a=this._zmax+s;return this._renderCoordsHelper.setAltitude(Te,a,N),this._renderCoordsHelper.setAltitude(De,i,N),this._intersector.reset(Te,De,null),this.intersectionHandler.intersect(this._intersector,null,Te,De),this._intersector.results.min.getIntersectionPoint(N)?this._renderCoordsHelper.getAltitude(N):null}getSphereElevationBounds(n,r){return Mt(n,r,ot,this._renderCoordsHelper.spatialReference),this.layerView.getElevationRange(ot)}layerChanged(){this.spatialReference&&(this._tmpEvent.extent=this._computeLayerExtent(),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}objectChanged(n){this.spatialReference&&(this._tmpEvent.extent=this._computeObjectExtent(n),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}_computeObjectExtent(n){return Ve(k),this._expandExtent(n,k),k}_computeLayerExtent(){Ve(k);for(const n of this.layerView.getVisibleNodes())this._expandExtent(n,k);return k}_expandExtent(n,r){const e=this.spatialReference;if(e==null)return;const t=this.layerView.getNodeComponentObb(n);if(t!=null){os(te,t.quaternion),te[12]=t.center[0],te[13]=t.center[1],te[14]=t.center[2];for(let s=0;s<8;++s)N[0]=1&s?t.halfSize[0]:-t.halfSize[0],N[1]=2&s?t.halfSize[1]:-t.halfSize[1],N[2]=4&s?t.halfSize[2]:-t.halfSize[2],Et(N,N,te),this._renderCoordsHelper.fromRenderCoords(N,N,e),ls(r,N,r)}}};g([p({constructOnly:!0})],B.prototype,"layerView",void 0),g([p({constructOnly:!0})],B.prototype,"intersectionHandler",void 0),g([p()],B.prototype,"view",void 0),g([p()],B.prototype,"spatialReference",null),B=g([Ie("esri.views.3d.layers.i3s.I3SElevationProvider")],B);const ki=B;class Bi{constructor(r){this.type=ds.I3S,this._needVerticalOffset=!1,this.layerUid=r.layerUid,this.sublayerUid=r.sublayerUid,this._collection=r.collection,this._traverseNodeHierarchy=r.traverseNodeHierarchy,this.slicePlaneEnabled=r.slicePlaneEnabled,this.isGround=r.isGround}updateElevationAlignState(r,e){this._needVerticalOffset=r&&e===hs.Global}intersect(r,e,t,s){const i=r.results,a=r.options.store===Ct.ALL,o=r.ray.direction,d=r.tolerance;let l=_=>_,h=_=>_;const c=cs(r.verticalOffset!=null?r.verticalOffset:this._needVerticalOffset?0:null);r.verticalOffset!=null&&c!=null&&(l=_=>c.applyToMbs(_),h=_=>c.applyToObb(_)),this._traverseNodeHierarchy((_,m)=>{if(_.childrenLoaded===0)return!1;const C=_.serviceObbInRenderSR!=null&&mi(_.serviceObbInRenderSR)?_.serviceObbInRenderSR:null;return!(C!=null&&!We(h(C),t,o,d))&&(!m||C==null&&fi(_.renderMbs)&&!zi(l(_.renderMbs),t,o,d)||_.geometryObb!=null&&!We(h(_.geometryObb),t,o,d)||this._collection.intersect(m,t,s,d,c,(v,M,E,R)=>{if(M>=0){if(e!=null&&!e(t,s,M))return;const y=b=>{const f=new _s(this.layerUid,this.sublayerUid,_.index,v,R);b.set(this.type,f,M,E)};if(this.isGround&&(i.ground.dist==null||Mi.max.dist)&&y(i.max),a){const b=us(r.ray);y(b),r.results.all.push(b)}}}),!0)})}}function zi(n,r,e,t=0){const s=n[3]+t,i=r[0]-n[0],a=r[1]-n[1],o=r[2]-n[2],d=e[0],l=e[1],h=e[2],c=d*i+l*a+h*o;return c*c-(d*d+l*l+h*h)*(i*i+a*a+o*o-s*s)>=0}const qi=14;class Ki{constructor(r,e,t=qi){this._version=t,this._db=null,this._quotaReductionPromise=null,this._gcCounter=0,this._hit=0,this._miss=0,this._destroyed=!1,this.gcFrequency=50,this.maxByteSize=wt.GIGABYTES,this.quotaReductionFactor=.2,this._dbName=r,this._storeName=e}init(){return Promise.resolve().then(()=>{const r=indexedDB.open(this._dbName,this._version);return r.onupgradeneeded=e=>{const t=r.result,s=r.transaction,i=t.objectStoreNames.contains(this._storeName)?s.objectStore(this._storeName):t.createObjectStore(this._storeName),a=t.objectStoreNames.contains("last_access")?s.objectStore("last_access"):t.createObjectStore("last_access");a.indexNames.contains("date")||a.createIndex("date","date",{unique:!1}),a.indexNames.contains("byteSize")||a.createIndex("byteSize","byteSize",{unique:!1}),e.oldVersion{this._destroyed?r.close():this._db=r})}destroy(){this._db&&(this._db.close(),this._db=null),this._destroyed=!0}get initialized(){return this._db!=null}getHitRate(){return this._hit/(this._hit+this._miss)}put(r,e){return this._db==null?Promise.reject(new gs("indexedb:not-initialized","IndexedDB Cache is not initialized")):(this._quotaReductionPromise!=null?this._quotaReductionPromise:Promise.resolve()).then(()=>this._put(r,e)).catch(t=>{if(t&&t.name==="QuotaExceededError")return this._quotaReductionPromise==null&&(this._quotaReductionPromise=this._getCacheSize().then(s=>this._removeLeastRecentlyAccessed(e.byteSize+Math.ceil(s*this.quotaReductionFactor))),this._quotaReductionPromise.then(()=>this._quotaReductionPromise=null,()=>this._quotaReductionPromise=null)),this._quotaReductionPromise.then(()=>this._put(r,e));throw t}).then(()=>{this._gcCounter--,this._gcCounter<0&&this._db!=null&&(this._gcCounter=this.gcFrequency,this._getCacheSize().then(t=>this._removeLeastRecentlyAccessed(t-this.maxByteSize)))})}get(r,e){const t=this._db;if(t==null)return Promise.resolve(void 0);let s=null;return Promise.resolve().then(()=>{const i=t.transaction(this._storeName,"readonly");return s=ps(e,()=>{i.abort()}),Y(i.objectStore(this._storeName).get(r))}).then(i=>(i==null?++this._miss:this._db&&(++this._hit,this._db.transaction("last_access","readwrite").objectStore("last_access").put({date:Date.now(),byteSize:i.byteSize},r)),s!=null&&s.remove(),i)).catch(()=>{++this._miss,He(e),s!=null&&s.remove()})}remove(r){const e=this._db;return e==null?Promise.resolve():Promise.resolve().then(async()=>{const t=e.transaction([this._storeName,"last_access"],"readwrite"),s=t.objectStore(this._storeName),i=t.objectStore("last_access"),a=s.delete(r),o=i.delete(r);await Promise.all([Y(a),Y(o),ue(t)])})}_put(r,e){const t=this._db;if(t==null)return Promise.resolve();const s=t.transaction([this._storeName,"last_access"],"readwrite"),i=s.objectStore(this._storeName),a=s.objectStore("last_access"),o=i.put(e,r),d=a.put({date:Date.now(),byteSize:e.byteSize},r);return Promise.all([Y(o),Y(d),ue(s)])}_removeLeastRecentlyAccessed(r){if(r<=0||!this._db)return Promise.resolve();const e=this._db.transaction([this._storeName,"last_access"],"readwrite"),t=e.objectStore(this._storeName),s=e.objectStore("last_access");let i=0;const a=s.index("date").openCursor(null,"next");return a.onsuccess=()=>{const o=a.result;o!=null&&(o.value.byteSize!=null&&(i+=o.value.byteSize),t.delete(o.primaryKey),s.delete(o.primaryKey),i{const a=i.result;if(!a)return;const o=a.key;o!=null&&(s+=o),a.continue()},ue(e).then(()=>s)}}function ue(n){return new Promise((r,e)=>{n.oncomplete=()=>r(),n.onerror=()=>e(n.error),n.onabort=()=>e(n.error)})}function Y(n){return new Promise((r,e)=>{n.readyState==="done"?n.error!=null?e(n.error):r(n.result):(n.onsuccess=()=>r(n.result),n.onerror=()=>e(n.error))})}class Wi{constructor(){this._data=new Map,this._miss=0,this._hit=0,this.initialized=!0}init(){return Promise.resolve()}async get(r,e){if(this._data.has(r))return this._hit++,this._data.get(r)??void 0;this._miss++}destroy(){}put(r,e){return this._data.set(r,e),Promise.resolve()}remove(r){return this._data.delete(r),Promise.resolve()}getHitRate(){return this._hit/(this._hit+this._miss)}}const Ft="esri.views.3d.layers.I3SMeshView3D",j=ye.getLogger(Ft),lt=[1,1,1,1];class Yi extends Li{constructor(r,e,t,s,i,a,o,d,l){super(),this.node=r,this.featureIds=e,this.objectHandle=t,this.cachedRendererVersion=s,this.attributeInfo=i,this.material=a,this.textures=o,this.anchorIds=d,this.anchors=l,this.cachedElevationAnchors=null,this.cachedEdgeMaterials=new Array,this.edgeMemoryUsage=0}}var q;(function(n){n[n.CastShadows=4]="CastShadows",n[n.Pickable=5]="Pickable"})(q||(q={}));const Xi=23,Qi=100*wt.MEGABYTES,xr=n=>{let r=class extends n{constructor(...e){super(e),this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._snappingSourcesTrackers=[],this._hasLoadedPBRTextures=!1,this._asyncModuleLoading=0,this._addTasks=new Map,this._currentRenderer=null,this._rendererVersion=0,this._colorVariable=null,this._opacityVariable=null,this._rendererFields=null,this._symbologyFields=null,this._symbologyOverride=null,this._symbologyOverrideFields=null,this._symbolInfos=new Map,this._visibleGeometryChangedSchedulerHandle=null,this._idbCache=we("enable-feature:idb-mock-cache")?new Wi:new Ki("esri-scenelayer-cache","geometries"),this._hasComponentData=!1,this._hasVertexColors=!1,this.updating=!0,this.holeFilling="auto",this._hasColors=!1,this._hasTextures=!1,this._hasData=!1,this.slicePlaneEnabled=!1,this._modifications=new Array,this.ignoresMemoryFactor=!1,this._layerUrl="",this._cacheKeySuffix=null,this._elevationTask=null,this._filters=[],this._arcade=null,this._tmpAttributeOnlyGraphic=new oe(null,null,{}),this._crossfadeHelper=new Gi(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get layerUid(){return this.i3slayer&&this.i3slayer.uid}get sublayerUid(){return null}get layerId(){return this.i3slayer&&this.i3slayer.id}get sublayerId(){return null}get contentVisible(){var e;return!this.suspended&&((e=this._controller)==null?void 0:e.rootNodeVisible)}get legendEnabled(){var e;return this.contentVisible&&((e=this.i3slayer)==null?void 0:e.legendEnabled)===!0}get updatingProgressValue(){var e;return((e=this._controller)==null?void 0:e.updatingProgress)??0}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return yi(this._currentRenderer)?this._usePBR||this._hasLoadedPBRTextures?Z.AllTexturesPBR:Z.AllTextures:this._usePBR||this._hasLoadedPBRTextures?Z.GeometryTexturesPBR:Z.GeometryTextures}get elevationOffset(){const e=this.i3slayer!=null?this.i3slayer.elevationInfo:null;if(e!=null&&e.mode==="absolute-height"){const t=Ye(this.i3slayer.spatialReference),s=Xe(e.unit);return(e.offset??0)*s/t}return 0}get elevationInfo(){const e=this.i3slayer!=null?this.i3slayer.elevationInfo:null;if(e==null)return{mode:A.Absolute,offset:0};const t=Ye(this.i3slayer.spatialReference),s=Xe(e.unit),i=(e.offset??0)*s/t;switch(e.mode){case"absolute-height":return{mode:A.Absolute,offset:i};case"relative-to-ground":return{mode:A.RelativeToGround,offset:i};case"on-the-ground":return{mode:A.OnTheGround,offset:0};default:return{mode:A.Absolute,offset:0}}}get supportedTextureEncodings(){return ei(this.view._stage.renderView.capabilities)}get uncompressedTextureDownsamplingEnabled(){var s;const e=(s=this.view)==null?void 0:s.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled,t=(this.supportedTextureEncodings&he.DDS_S3TC)==0;return e&&t}get clientGeometry(){return this.i3sOverrides.geometryOverrides}initialize(){this._preLoadBasis(),this.addResolvingPromise(this.i3slayer.indexInfo);const e=this.view.resourceController,t=e.memoryController;this.i3sOverrides=new ti({view:this.view,layer:this.i3slayer,memoryController:t}),this._worker=new Vi(ar(e)),this.addResolvingPromise(this._worker.promise);const s=this.i3slayer.store;this._worker.setLegacySchema(this.uid,s.defaultGeometrySchema),bi(this.i3slayer),vi(this.i3slayer,this.view),this._layerUrl=this.i3slayer.parsedUrl.path,this._controller=new si({layerView:this,worker:this._worker}),this._gpuMemoryEstimate=0,this._texMemoryEstimate=0,this._geoMemoryEstimate=0,this._stage=this.view._stage,this._collection=this._stage.renderView.componentObjectCollection,this.resetHighlights();const i=s.defaultGeometrySchema;if(this._isIntegratedMesh||!i)this._hasComponentData=!1;else{const l=i.featureAttributes;this._hasComponentData=!!(l&&l.faceRange&&l.id)}this._hasVertexColors=((i==null?void 0:i.vertexAttributes.color)??null)!=null&&(this.i3slayer.cachedDrawingInfo==null||!this.i3slayer.cachedDrawingInfo.color),this._isIntegratedMesh||(this._edgeView=this._stage.renderer.ensureEdgeView());const a=this.view.resourceController.memoryController.newCache(`sl-${this.uid}`,l=>this._deleteComponentObject(l));this._memCache=a;const o=l=>this._controller.index!=null&&this._controller.index.rootNode!=null?this._controller.index.traverse(this._controller.index.rootNode,h=>{const c=h.index,_=this._nodeId2Meta.get(c)||this._nodeId2MetaReloading.get(c);return l(h,_!=null?_.objectHandle:null)}):()=>{};this._intersectionHandler=new Bi({layerUid:this.layerUid,sublayerUid:this.sublayerUid,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:o}),this.updatingHandles.add(()=>this.layerUid,l=>this._intersectionHandler.layerUid=l),this.updatingHandles.add(()=>this.sublayerUid,l=>this._intersectionHandler.sublayerUid=l),this._elevationProvider=new ki({layerView:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR,this.updatingHandles.add(()=>this.view.clippingArea,()=>this._clippingAreaChanged(),V),this.updatingHandles.add(()=>this.fullOpacity,l=>this._opacityChange(l)),this.updatingHandles.add(()=>this.slicePlaneEnabled,l=>this._slicePlaneEnabledChange(l)),this.updatingHandles.add(()=>this.elevationOffset,(l,h)=>{this._reloadAll(h),this._controller.invalidateVisibilityObbs()}),this.updatingHandles.add(()=>this.elevationInfo,(l,h)=>this._elevationInfoChanged(l,h),V),this.updatingHandles.add(()=>this.contentVisible&&this.elevationInfo.mode!==A.Absolute,(l,h)=>{l?this.handles.add(this.view.basemapTerrain.on("elevation-change",({extent:c})=>this._ensureElevationTask().addExtent(c)),ft):h&&this.handles.remove(ft)},V),this.updatingHandles.add(()=>this._usePBR,l=>this._updatePBR(l));const d=()=>{this._reloadAll(),this.clearMemCache()};this.updatingHandles.add(()=>this.rendererTextureUsage,d),this.updatingHandles.add(()=>this.uncompressedTextureDownsamplingEnabled,d),this.updatingHandles.add(()=>this.contentVisible,l=>this._contentVisibleChanged(l),V),this.updatingHandles.add(()=>this.i3slayer.labelsVisible,()=>this._labelingChanged(),V),this.updatingHandles.add(()=>this.i3slayer.labelingInfo,()=>this._labelingChanged(),V),this.updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged(),V),this.handles.add([je(()=>Q.I3S_TREE_SHOW_TILES,l=>{if(l&&!this._treeDebugger){const h=this._controller.crsIndex;ys(()=>import("./I3STreeDebugger-794166fd.js"),["assets/I3STreeDebugger-794166fd.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/TileTreeDebugger-142b9f39.js"]).then(({I3STreeDebugger:c})=>{!this._treeDebugger&&Q.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new c({lv:this,view:this.view,nodeSR:h}))})}else l||Q.I3S_TREE_SHOW_TILES||(this._treeDebugger=F(this._treeDebugger))},V),je(()=>Q.I3S_SHOW_MODIFICATIONS,()=>this._showModifications(),V)]),this._cacheKeySuffix=Ii(this.i3slayer.spatialReference,this.view.renderSpatialReference),this._idbCache.init().catch(l=>j.warn(`Failed to initialize IndexedDB cache: ${l}`))}destroy(){this._clearAddTasks(),this._elevationTask=F(this._elevationTask),this.i3sOverrides=F(this.i3sOverrides),this._elevationProvider&&(this._elevationProvider.layerChanged(),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._intersectionHandler&&(this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null);const e=this._worker;e&&(e.destroyContext(this.uid).then(()=>e.destroy()),this._worker=null),this._removeAllNodeDataFromStage(),this._memCache=F(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=F(this._labeler),this._treeDebugger=F(this._treeDebugger),this._controller=F(this._controller),this._highlights.destroy(),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this._crossfadeHelper=F(this._crossfadeHelper),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)}_memEstimateTextureAdded(e){const t=e.memoryEstimate;return this._gpuMemoryEstimate+=t,this._texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(e!=null){const t=e.memoryEstimate;this._gpuMemoryEstimate-=t,this._texMemoryEstimate-=t}}_memEstimateGeometryAdded(e){const t=this._collection.getObjectGPUMemoryUsage(e);return this._gpuMemoryEstimate+=t,this._geoMemoryEstimate+=t,t}_memEstimateGeometryRemoved(e){const t=this._collection.getObjectGPUMemoryUsage(e);this._gpuMemoryEstimate-=t,this._geoMemoryEstimate-=t}isNodeLoaded(e){return this._nodeId2Meta.has(e)}isNodeReloading(e){return this._nodeId2MetaReloading.has(e)}get usedMemory(){let e=this._labeler!=null?this._labeler.usedMemory:0;return this._nodeId2Meta.forEach(t=>e+=t!=null?t.node.memory:0),this._nodeId2MetaReloading.forEach(t=>e+=t!=null?t.node.memory:0),e}get unloadedMemory(){return(this._controller!=null?this._controller.unloadedMemoryEstimate:0)+(this._labeler!=null?this._labeler.unloadedMemoryEstimate:0)}_labelingChanged(){if(!(bs(this.i3slayer)&&this._supportsLabeling))return void(this._labeler!=null&&(this._labeler.destroy(),this._labeler=null));if(this._labeler!=null)return;const e=new ji({view:this.view,layer:this.i3slayer,collection:this._collection,overrides:this.i3sOverrides});this._nodeId2Meta.forEach(t=>t!=null&&this._addMetaToLabeler(e,t)),this._labeler=e}_loadAsyncModule(e){return++this._asyncModuleLoading,e.then(t=>(--this._asyncModuleLoading,t),t=>{throw--this._asyncModuleLoading,t})}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications)return this._i3sWasmLoaded=ui().then(()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()}),void this.notifyUpdate();if(this._i3sWasmLoaded!==!0)return;const e=this.uid,t=this.i3slayer.spatialReference;this._worker.setModifications(e,this._layerClippingArea,this._modifications,t);const s=Rt(this._layerClippingArea,this._modifications,t);_i({context:e,modifications:s,isGeodetic:t.isGeographic}),this._controller.modificationsChanged();const i=this.hasModifications?new vt:null;this._nodeId2Meta.forEach((a,o)=>{a==null?(this._nodeId2Meta.delete(o),this._controller.updateLoadStatus(o,!1)):a.node.hasModifications?(this._nodeId2Meta.delete(o),this._nodeId2MetaReloading.set(o,a)):i!=null&&i.push(a.node)}),i!=null&&this._nodeId2MetaReloading.forEach(a=>i.push(a.node)),i!=null&&i.length>0&&(this.updateNodeModificationStatus(i),i.forAll(a=>{if(a.imModificationImpact!==rt.Culled){const o=this._nodeId2Meta.get(a.index);this._controller.invalidateGeometryVisibility(a.index),o!=null?(this._nodeId2Meta.delete(a.index),this._nodeId2MetaReloading.set(a.index,o)):this._nodeId2Meta.has(a.index)&&(this._nodeId2Meta.delete(a.index),this._controller.updateLoadStatus(a.index,!1))}})),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(this._modificationGraphics!=null&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!Q.I3S_SHOW_MODIFICATIONS||this._modifications.length===0)return;const e={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},t={type:"simple-fill",outline:{color:[255,255,255],width:1}};this._modificationGraphics=new Array;for(const s of this._modifications){const i=s.geometry;i.spatialReference=this.i3slayer.spatialReference;const a={...t,color:e[s.type]};this._modificationGraphics.push(new oe({geometry:i,symbol:a}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,(s,i)=>this._createAttributes(s,i))}_contentVisibleChanged(e){e?(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler)):(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(e){const t=this._nodeId2Meta.get(e);if(t!=null&&t.attributeInfo!=null)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodeId2Meta.get(e);if(t!=null&&t.attributeInfo!=null)return t.attributeInfo.attributeData}setAttributeData(e,t){const s=this._nodeId2Meta.get(e);s!=null&&s.attributeInfo!=null&&(s.attributeInfo.attributeData=t,this._attributeValuesChanged(s))}async updateAttributes(e,t,s){const i=this._nodeId2Meta.get(e);i!=null&&(await this.i3sOverrides.applyAttributeOverrides(i.featureIds,t,s),i.attributeInfo=t,this._controller.reschedule(()=>this._attributeValuesChanged(i),s).catch(a=>{Nt(a)||j.warn("Error while updating attribute values. Layer might not display correctly.",a)}))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.filteredIds=null,this._labeler!=null&&this._labeler.setNodeMetaAttributes(e,(t,s)=>this._createAttributes(t,s)),this._updateEngineObject(e)}clearMemCache(){this._memCache!=null&&this._memCache.clear()}getVisibleNodes(){const e=new Array;return this._nodeId2Meta.forEach(t=>t!=null&&e.push(t.node)),e}getNodeComponentObb(e){const t=this._nodeId2Meta.get(e.index)??this._nodeId2MetaReloading.get(e.index);return t!=null?this._collection.getComponentObb(t.objectHandle):null}getLoadedNodeIndices(e){this._nodeId2Meta.forEach((t,s)=>e.push(s)),this._nodeId2MetaReloading.forEach((t,s)=>e.push(s))}_preLoadBasis(){!we("disable-feature:i3s-basis")&&this.supportedTextureEncodings&he.Basis&&vs(this.i3slayer.textureSetDefinitions,e=>e.some(t=>t.formats.some(s=>s.format==="basis"||s.format==="ktx2")))&&Qe()}_getVertexBufferLayout(e,t){const s={hasTexture:ut(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion};return Is(Cs(this._getGeometryParameters(s)))}_getObjectIdField(){return this.i3slayer.objectIdField||Ms}_getGlobalIdField(){var e;return(e=this.i3slayer.associatedLayer)==null?void 0:e.globalIdField}_findGraphicNodeAndIndex(e){const t=Fe(this.i3slayer.fieldsIndex,e.attributes,this._getObjectIdField());let s=null;return fe(this._nodeId2Meta,i=>{if(i==null)return!1;const a=i.featureIds.indexOf(t);return a!==-1&&(s={node:i.node,index:a},!0)}),s}_getGraphicIndices(e,t){const s=this._nodeId2Meta.get(e.index);if(s==null)return[];const i=[],a=this._getObjectIdField(),o=this.i3slayer.fieldsIndex;for(const d of t){const l=Fe(o,d.attributes,a),h=s.featureIds.indexOf(l);h!==-1&&i.push(h)}return i}whenGraphicBounds(e){const t=this._findGraphicNodeAndIndex(e);if(!t)return Promise.reject();const s=this._getAABB(t.node.index,t.index);return s==null?Promise.reject():Promise.resolve({boundingBox:s,screenSpaceObjects:[]})}getAABBFromIntersectorTarget(e){return e.nodeIndex==null||e.componentIndex==null?null:this._getAABB(e.nodeIndex,e.componentIndex)}_getAABB(e,t){const s=this._nodeId2Meta.get(e);if(s==null||s.featureIds==null||t>=s.featureIds.length)return null;const i=s.objectHandle,a=ke(t,this._collection,i,me(24),0),o=this.view.renderSpatialReference,d=this.view.spatialReference;if(!$e(a,o,0,a,d,0,8))return null;const l=Es();return Le(l,a,0,8),l}whenGraphicAttributes(e,t){return Ci(this.i3slayer,e,this._getObjectIdField(),t,()=>[...this._nodeId2Meta.values()].filter(xs))}getGraphicFromIntersectorTarget(e){if(e.nodeIndex==null||e.componentIndex==null)return null;const t=this._nodeId2Meta.get(e.nodeIndex);return t==null||t.featureIds==null||e.componentIndex>=t.featureIds.length?null:this._createGraphic(e.componentIndex,t)}_getCacheKey(e){return`${this._layerUrl}/v${Xi}/${e}${this._cacheKeySuffix}`}_getMemCacheKey(e,t=this.elevationOffset){return e+"#"+t}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&this.elevationOffset===0&&this._cacheKeySuffix!=null}loadCachedGPUData(e){return this._memCache!=null?this._memCache.pop(this._getMemCacheKey(e)):null}deleteCachedGPUData(e){e!=null&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(this._memCache==null)return void this._deleteComponentObject(e);const s=this._controller.indexDepth-e.node.level;this._memCache.put(this._getMemCacheKey(e.node.index,t),e,e.node.memory,s)}loadMissingTextures(e,t,s,i){const a=(e==null?void 0:e.filter((o,d)=>{if(!(o.usage&this.rendererTextureUsage))return!1;if(t==null)return!0;const l=ii(o.encodings,this.supportedTextureEncodings),h=t[d];return!!(h==null||h.data==null||l&&h.encoding!==l.encoding)}))??[];return a.length===0?Promise.resolve(!1):s(a,i).then(o=>{let d=0;for(let l=0;li==null?null:i.nodeVersion!==e.version?(this._idbCache.remove(this._getCacheKey(e.id)),null):(this.elevationInfo.mode===A.Absolute&&(e.geometryObb=i.geometryObb),this.loadMissingTextures(i.requiredTextures,i.textureData,s,t).then(a=>(a&&this._idbCache.initialized&&i.textureData!=null&&(i.byteSize=gt(i.transformedGeometry,i.textureData),i.textureData.every(_t)&&pt(e,i)&&this._idbCache.put(this._getCacheKey(e.id),i).catch(o=>j.warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${o}`))),He(t),i)))):Promise.resolve(null)}addNode(e,t,s){return tr(t)?t.geometryBuffer==null?(this._addNodeMeta(e.index,null),Promise.resolve()):this._addData(e,t.attributeDataInfo,()=>this._transformNode(e,t,s).then(i=>this._safeReschedule(()=>{if(i==null)return e.hasModifications=!1,this._addCachedNodeData(e,null,s);e.hasModifications=i.transformedGeometry.hasModifications;const{obb:a,componentOffsets:o,featureIds:d,anchorIds:l,anchors:h,transformedGeometry:c}=i,_=this._controller.crsIndex,m=this.view.renderSpatialReference,C=st(e.mbs,this.elevationOffset,_,m),v=St([a.center.x,a.center.y,a.center.z],[a.extents.x,a.extents.y,a.extents.z],Os(a.orientation.x,a.orientation.y,a.orientation.z,a.orientation.w));Et(v.center,v.center,C),this.elevationInfo.mode===A.Absolute&&(e.geometryObb=v),t.geometryData.componentOffsets=o,d&&(t.geometryData.featureIds=Array.from(d)),t.geometryData.anchorIds=l,t.geometryData.anchors=h;const M={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:c,globalTrafo:C,geometryObb:v,byteSize:gt(c,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&pt(e,M)){const E=M.textureData!=null?M.textureData.map(R=>_t(R)?R:null):null;this._idbCache.put(this._getCacheKey(e.id),{...M,textureData:E}).catch(R=>j.warn(`Failed to store node in IndexedDB cache: ${e.id}: ${R}`))}return this._addCachedNodeData(e,M,s)},s))):Promise.reject()}getElevationRange(e){let t=1/0,s=-1/0;const i=ws(this.view.renderCoordsHelper.spatialReference);return this._nodeId2Meta.forEach(a=>{if(a!=null&&a.node.geometryObb!=null){const o=a.node.geometryObb;if(Ss(o,e)){const d=this._collection.getObjectTransform(a.objectHandle),l=this.view.renderCoordsHelper.getAltitude(d.position);for(let h=0;h0||this.lodCrossfadeoutDuration>0||this.lodCrossfadeUncoveredDuration>0)}get nodeFadeoutEnabled(){return this._supportsNodeCrossFading&&this.lodCrossfadeoutDuration>0}_setNewNodeOpacity(e){const t=this.nodeCrossfadingEnabled?0:this.fullOpacity;this._setNodeOpacity(e,t)}addCachedGPUData(e,t,s){if(this.elevationInfo.mode===A.Absolute&&(e.geometryObb=Ns(this._collection.getComponentObb(t.objectHandle))),!this._controller.isGeometryVisible(e))return void this._cacheGPUData(t);this._labeler!=null&&this._addMetaToLabeler(this._labeler,t);const i=e.index;this._addNodeMeta(i,t),this.updateNodeState(i,s),this._collection.setObjectVisibility(t.objectHandle,Se.Visible),this._updateMaterial(t),this._setNewNodeOpacity(t),this.elevationInfo.mode!==A.Absolute&&this._ensureElevationTask().schedule(i),this._updateEngineObject(t),this._highlights.objectCreated(t),this._treeDebugger!=null&&this._treeDebugger.update()}addCachedNodeData(e,t,s,i){return this._addData(e,s,()=>this._addCachedNodeData(e,t,i))}async deleteCachedNodeData(e){if(this._idbCacheEnabled)return this._idbCache.remove(this._getCacheKey(e))}async _addCachedNodeData(e,t,s){var Ke;if(!this.contentVisible||!this._controller.isGeometryVisible(e))return void this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);if(t==null)return void this._addNodeMeta(e.index,null);const i=this._addTasks.get(e.index),{geometryData:a,transformedGeometry:o,globalTrafo:d}=t;await this.i3sOverrides.applyAttributeOverrides(a.featureIds,i.attributeInfo,s);const l=t.textureData!=null?t.textureData.filter(O=>O!=null&&(O.usage&this.rendererTextureUsage)!=0):[];!we("disable-feature:i3s-basis")&&l.some(O=>O!=null&&(O.encoding===he.Basis||O.encoding===he.KTX2))&&await Qe(),e.memory=0;const{componentOffsets:h,geometries:c,featureIds:_,anchorIds:m,anchors:C}=a,v=this._collection,M=c[0],{layout:E,indices:R,interleavedVertexData:y,positionData:b,hasColors:f}=o,x=this._materialParameters(M,E),I=h||new Uint32Array([0,R?R.length:y.byteLength/E[0].stride]),Tt={vertices:{data:y,count:y.byteLength/E[0].stride,layoutParameters:x.geometryParams},positionData:{positions:As(b.data),indices:Rs(b.indices)},indices:R,componentOffsets:I},ae=M.transformation?Fs(M.transformation):xt();Ts(ae,d,ae);const Ce=Ds($(),ae),Dt=Ps(js(),ae),Be=this.view.renderSpatialReference,ze=this.view.basemapTerrain.spatialReference,Me=$(),Ee=[1,1,1];Vs(Ce,Be,Ee,ze)||j.errorOnce("Unsupported coordinate system for IM overlay"),_e(Ce,Be,Me,ze);const ne=v.createObject({toMapSpace:Hs(Me[0],Me[1],Ee[0],Ee[1]),geometry:Tt,obb:t.geometryObb,transform:{position:Ce,rotationScale:Dt}}),Pt=x.geometryParams.textureCoordinates===le.Atlas,{textures:qe,texturePromise:jt}=this._initMaterialAndTextures(ne,x.material,l,Pt);e.memory+=this._memEstimateGeometryAdded(ne),e.memory+=qe.reduce((O,xe)=>O+(xe!=null?this._memEstimateTextureAdded(xe):0),0);const Vt=!!x.material.hasParametersFromSource,Ht=x.material.alphaMode!=="blend"&&x.material.metallicRoughness.baseColorFactor[3]>=1,S=new Yi(e,_,ne,this._getInvalidRendererVersion(),i.attributeInfo,{hasParametersFromSource:Vt,isOpaque:Ht},qe,m,C);i.meta=S,!this._hasTextures&&((Ke=t.requiredTextures)!=null&&Ke.some(({usage:O})=>(O&Z.ColorTextures)!=0))&&(this._hasTextures=!0),this._hasData=!0,this._hasColors=this._hasColors||f,this._hasTextures=this._hasTextures||!!e.resources.texture,this.notifyChange("hasTexturesOrVertexColors");const $t=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(S),jt]).then(([O,xe])=>(O!=null&&O.updateObjectVisibility(S.objectHandle,!1).catch(X=>L(X,this.i3slayer.title)),this._safeReschedule(()=>{const X=this._addTasks.get(e.index);if(!X)return;if(this._addNodeMeta(e.index,S),X.meta=null,!this.contentVisible)return void this._removeNodeStageData(e.index,this.elevationOffset);v.setObjectVisibility(ne,Se.Visible),O!=null&&O.updateObjectVisibility(S.objectHandle,!0).catch(Bt=>L(Bt,this.i3slayer.title)),S.attributeInfo=X.attributeInfo;const Lt=S.cachedRendererVersion!==this._rendererVersion,Gt=$t!==this.slicePlaneEnabled;this._updateElevationOffsets(S);const Ut=S.elevationOffsets;this._updateComponentData(S);const kt=this._applyFiltersToNode(S);(Lt||O!=null&&(Gt||kt||Ut))&&this._addOrUpdateEdgeRendering(S),this._labeler!=null&&this._addMetaToLabeler(this._labeler,S),this._visibleGeometryChanged(S,D.ADD),this._highlights.objectCreated(S),this._updateMaterial(S),this._setNewNodeOpacity(S),this._treeDebugger!=null&&this._treeDebugger.update()},s))).catch(O=>{throw i.meta!=null&&(this._cacheGPUData(i.meta),i.meta=null),O})}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){j.error("Removing duplicated node");const s=this._nodeId2Meta.get(e);s!=null&&this._deleteComponentObject(s)}else this._controller.updateLoadStatus(e,!0);t!=null&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&ie(t.cachedEdgeMaterials,0)),this._nodeId2Meta.set(e,t)}_updateElevationOffsets(e){const t=this.view.renderSpatialReference,s=this._controller.crsIndex,i=this.elevationInfo,a=this.view.basemapTerrain,o=a.spatialReference,d=i.mode;if(t==null||o==null||d===A.Absolute)return void(e.elevationOffsets=null);const l=this._collection.getObjectTransform(e.objectHandle);e.elevationOffsets=e.elevationOffsets??[];const h=rr,c=mt,_=d===A.OnTheGround,m=this.view.renderCoordsHelper,C=e.featureIds.length,v=(()=>{var b;if(e.cachedElevationAnchors)return e.cachedElevationAnchors;const y=me(3*C);e.cachedElevationAnchors=y;for(let f=0;f=0?(Je(h,e.anchors[3*I],e.anchors[3*I+1],e.anchors[3*I+2]),re(h,h,e.node.mbs),_e(h,s,h,o),y[x]=h[0],y[x+1]=h[1],y[x+2]=m.getAltitude(h)):(this._collection.getComponentAabb(e.objectHandle,f,c,!0),Je(h,(c[0]+c[3])/2,(c[1]+c[4])/2,c[2]),bt(h,h,l.rotationScale),re(h,h,l.position),y[x+2]=m.getAltitude(h),_e(h,t,h,o),y[x]=h[0],y[x+1]=h[1])}return y})(),M=i.offset,E=e.elevationOffsets,R=(y,b)=>{const f=_?v[3*y+2]:0;E[y]=M+(b!=null?b-f:0)};a.getElevations(v,C,R)}_ensureElevationTask(){return this._elevationTask!=null||(this._elevationTask=new pe(this.view.resourceController.scheduler,e=>{const t=this._controller.updateElevationChanged(e,this.view.basemapTerrain.spatialReference);return t!=null?t.filterInPlace(s=>this._nodeId2Meta.get(s)!=null):null},e=>{const t=this._nodeId2Meta.get(e);this._nodeElevationAlignmentChanged(t)})),this._elevationTask}_elevationInfoChanged(e,t){const s=e.mode!==A.Absolute,i=!!t&&t!==e&&t.mode!==A.Absolute;this._intersectionHandler.updateElevationAlignState(s,this.view.state.viewingMode),s&&!i&&this._controller.removeAllGeometryObbs(),this._nodeId2Meta.forEach(a=>this._nodeElevationAlignmentChanged(a))}_nodeElevationAlignmentChanged(e){e!=null&&(this._updateElevationOffsets(e),this._updateComponentData(e),this._updateEdgeRendering(e),this._labeler!=null&&this._labeler.updateLabelPositions(e),this._updateSnappingSources(e,D.UPDATE))}_safeReschedule(e,t){return He(t),this._controller.reschedule(e,t)}_materialParameters(e,t){const s=e.params.material!=null?e.params.material:ri(),i=t.some(d=>d.name==="uvRegion"),a=t.some(d=>d.name==="normalCompressed"),o=ut(s);return{geometryParams:this._getGeometryParameters({hasTexture:o,hasNormals:a,hasRegions:i}),material:s}}_initMaterialAndTextures(e,t,s,i){const a=this._stage.renderView,o=s.map(l=>ai(l,t,i,a));this._stage.addMany(o);let d=null;return this._collection.updateMaterial(e,l=>{d=ni(l,t,o,s,this.view._stage.renderView.textureRepository,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR,isIntegratedMesh:this._isIntegratedMesh,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference}),this._updateMaterialOverlay(l)}),{textures:o,texturePromise:d}}_getGeometryParameters(e){return{textureCoordinates:e.hasTexture?e.hasRegions?le.Atlas:le.Default:le.None,colors:this._hasVertexColors,normals:e.hasNormals&&!this._isIntegratedMesh}}_addData(e,t,s){let i=this._addTasks.get(e.index);return i?i.attributeInfo=t:(i={...$s(),attributeInfo:t,meta:null},this._addTasks.set(e.index,i),s().then(i.resolve,i.reject).then(()=>this._addTasks.delete(e.index)).catch(a=>{throw this._addTasks.delete(e.index),a})),i.promise}_clearAddTasks(){this._addTasks.forEach(e=>{e.meta!=null&&(this._cacheGPUData(e.meta),e.meta=null)}),this._addTasks.clear()}_clippingAreaChanged(){const e=this.view.renderSpatialReference,t=this.i3slayer.spatialReference,s=be();this._renderClippingArea=et(this.view.clippingArea,s,e)?s:null;const i=be();this._layerClippingArea=et(this.view.clippingArea,i,t)?i:null,this._filterChange(),this._controller&&this._controller.updateClippingArea(this.view.clippingArea),this._isIntegratedMesh&&this._modificationsChanged()}get hasGeometryFilter(){return!1}_geometryFilterChange(){const e=this.hasGeometryFilter;this._controller.geometryFilterChanged(e),this._applyFilters(e)}_filterChange(){this._applyFilters(this.hasGeometryFilter)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach(t=>{t!=null&&this._applyFiltersToNode(t)&&(this._addOrUpdateEdgeRendering(t),this._visibleGeometryChanged(t,D.UPDATE))})}getFilters(){const e=[],t=this._renderClippingArea;return t!=null&&e.push((s,i)=>this._boundingRectFilter(s,i,t)),e}addSqlFilter(e,t,s){if(t!=null){const i=t.fieldNames;e.push((a,o)=>this._sqlFilter(a,o,t,i,s))}}_sqlFilter(e,t,s,i,a){const o={},d=this._createLayerGraphic(o),l=this.i3slayer.objectIdField,h=t.featureIds,c=t.attributeInfo!=null&&t.attributeInfo.attributeData;i.every(_=>_===l||c&&c[_]!=null)&&it(e,h,_=>{o[l]=h[_];for(const m of i)m!==l&&(o[m]=c?Ae(c[m],_):null);try{return s.testFeature(d)}catch(m){return a(m),!1}})}_boundingRectNodeTest(e,t){return Mt(e.node.mbs,this._controller.crsIndex,ct,this.view.renderSpatialReference),xi(t,ct)}_boundingRectFeatureTest(e,t,s){return this._collection.getComponentAabb(e.objectHandle,t,dt),Ls(dt,ht),Gs(s,ht)}_boundingRectFilter(e,t,s){const i=this._collection,a=this._boundingRectNodeTest(t,s);if(a===ce.INSIDE)return;if(a===ce.OUTSIDE)return void(e.length=0);const o=i.getComponentCount(t.objectHandle);if(o.invisible+o.visible!==t.featureIds.length)return;const d=this._transformClippingArea(Zi,s,t.objectHandle);it(e,t.featureIds,l=>this._boundingRectFeatureTest(t,l,d))}_transformClippingArea(e,t,s){const i=this._collection.getObjectTransform(s),a=i.position,o=i.rotationScale;return e[0]=(t[0]-a[0])/o[0],e[1]=(t[1]-a[1])/o[4],e[2]=(t[2]-a[0])/o[0],e[3]=(t[3]-a[1])/o[4],e}_addOrUpdateEdgeRendering(e,t=!0){const s=this._edgeView;if(s==null)return Promise.resolve(null);const i=e.objectHandle,a=s.hasObject(i),{hasEdges:o,perFeatureEdgeMaterials:d}=this._getFilteredEdgeMaterials(e),l={hasSlicePlane:this.slicePlaneEnabled};return o&&a?(this.nodeCrossfadingEnabled&&ie(d,this.getNodeOpacity(e)),s.updateAllComponentMaterials(i,d,l,t).catch(h=>L(h,this.i3slayer.title)),s.updateObjectVisibility(i,!0).catch(h=>L(h,this.i3slayer.title)),s.updateAllVerticalOffsets(i,e.elevationOffsets).catch(h=>L(h,this.i3slayer.title)),Promise.resolve(s)):o&&!a?this._collection.addEdges(i,s,d,l).then(h=>(e.edgeMemoryUsage=h,e.node.memory+=h,s.updateAllVerticalOffsets(i,e.elevationOffsets).catch(c=>L(c,this.i3slayer.title)),s)):(!o&&a&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,s.removeObject(i)),Promise.resolve(null))}_applyFiltersToNode(e){return!!this._applyFiltersToNodeComponents(e)&&(this._labeler!=null&&this._labeler.applyFilterChange(e),!0)}_applyFiltersToNodeComponents(e){const t=this._collection,s=t.getComponentCount(e.objectHandle).invisible===0;if(t.setAllComponentVisibilities(e.objectHandle,"all"),this._filters.length===0)return e.filteredIds=null,!s;if(this._updateCachedFilteredIds(e),e.filteredIds===e.featureIds)return!s;const i=this._computeFilteredComponentIndices(e);return t.setAllComponentVisibilities(e.objectHandle,i),!0}_updateCachedFilteredIds(e){e.filteredIds!=null&&e.appliedFilters===this._filters||(e.filteredIds=this._computeFilteredIds(e),e.appliedFilters=this._filters)}_computeFilteredIds(e){const t=e.featureIds.slice();for(const s of this._filters)if(s(t,e),t.length===0)break;return t.length===e.featureIds.length?e.featureIds:t}_computeFilteredComponentIndices(e){const t=new Array,s=e.filteredIds;return s!=null&&e.featureIds.forEach((i,a)=>{s[t.length]===i&&t.push(a)}),t}_removeAllNodeDataFromStage(e=this.elevationOffset){this._nodeId2Meta.forEach((t,s)=>this._removeNodeStageData(s,e)),this._nodeId2MetaReloading.forEach((t,s)=>this._removeNodeStageData(s,e,this._nodeId2MetaReloading)),this._elevationTask=F(this._elevationTask)}removeNode(e){const t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading),this._elevationTask!=null&&this._elevationTask.remove(e)}_removeNodeStageData(e,t,s=this._nodeId2Meta){s.has(e)&&this._controller.updateLoadStatus(e,!1);const i=s.get(e);i!=null?(this._collection.setObjectVisibility(i.objectHandle,Se.Hidden),this._edgeView!=null&&this._edgeView.hasObject(i.objectHandle)&&this._edgeView.updateObjectVisibility(i.objectHandle,!1).catch(a=>L(a,this.i3slayer.title)),this._visibleGeometryChanged(i,D.REMOVE),this._labeler!=null&&this._labeler.removeNodeMeta(i),s.delete(e),this._highlights.objectDeleted(i),s===this._nodeId2Meta?(this._cacheGPUData(i,t),this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopNodeFading(i)):this._deleteComponentObject(i),this._treeDebugger!=null&&this._treeDebugger.update()):s.delete(e)}_deleteComponentObject(e){if(this._edgeView!=null&&this._edgeView.removeObject(e.objectHandle),this._memEstimateGeometryRemoved(e.objectHandle),this._collection.destroyObject(e.objectHandle),e.textures)for(const t of e.textures)this._memEstimateTextureRemoved(t),this._stage.remove(t)}updateNodeState(e,t){const s=this._nodeId2Meta.get(e);s!=null&&this._collection.updateMaterial(s.objectHandle,i=>i.polygonOffsetEnabled=t===Si.Hole)}updateNodeIndex(e,t){if(this._nodeId2Meta.has(e)){const i=this._nodeId2Meta.get(e);this._nodeId2Meta.delete(e),this._nodeId2Meta.set(t,i)}const s=this._nodeId2MetaReloading.get(e);s&&(this._nodeId2MetaReloading.delete(e),this._nodeId2MetaReloading.set(t,s))}_invalidateAllSymbols(){this._rendererVersion=Re(this._rendererVersion,1),this._controller&&this._controller.requestUpdate()}_getInvalidRendererVersion(){return Re(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange("rendererTextureUsage"),this._rendererVersion=Re(this._rendererVersion,1),this._rendererFields=null,this._colorVariable=null,this._opacityVariable=null,this._invalidateAllSymbols(),e&&(this._rendererFields=await e.getRequiredFields(this.i3slayer.fieldsIndex)),this._updateSymbologyFields(),!this._arcade&&e&&"arcadeRequired"in e&&e.arcadeRequired&&(this._arcade=await Us()),e&&"visualVariables"in e&&e.visualVariables)for(const t of e.visualVariables)t.type==="color"?this._colorVariable=t:t.type==="opacity"?this._opacityVariable=t:j.warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(const t of e.getSymbols())t.type!=="mesh-3d"&&j.error(`Symbols of type '${t.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(e){return this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e),e.cachedEdgeMaterials}_getComponentParameters(e){this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e);const t=e.cachedSymbology;return(s,i)=>{var o;const a=5*s;if(ks(i.externalColor,t[a]/255,t[a+1]/255,t[a+2]/255,t[a+3]/255),this._stage.renderView.objectAndLayerIdRenderHelper!=null){const d=e.featureIds[s],l=Bs(this.view.map,this.layerUid);this._stage.renderView.objectAndLayerIdRenderHelper.setUidToObjectAndLayerId(d,d,this.layerId,this.layerUid+"_"+this.sublayerId,this.layerPopupEnabledAndHasTemplate&&!l,e.node.resources.attributes,s,this.sublayerId),i.objectAndLayerIdColor=this._stage.renderView.getObjectAndLayerIdColor({graphicUid:d,layerUid:this.layerUid+"_"+this.sublayerId})}i.externalColorMixMode=t[a+4]&(1<0?this._rendererFields!=null&&this._rendererFields.length>0?qs(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){var R;if(e.cachedRendererVersion=this._rendererVersion,!this._hasComponentData)return;const t=this._tmpAttributeOnlyGraphic,s={};t.attributes=s;const i=this._currentRenderer,a=(R=e.attributeInfo)==null?void 0:R.attributeData,o=e.featureIds!=null?this.i3slayer.objectIdField:null,d=a!=null&&this._symbologyFields!=null&&this._symbologyFields.length>0;let l=null,h=null;if(d&&this._symbologyFields!=null){l=[],h=[];for(const y of this._symbologyFields){const b=a[y];b&&(l.push(y),h.push(b))}}e.cachedSymbology||(e.cachedSymbology=Ni(5*e.featureIds.length));const c={color:se,castShadows:!0,pickable:!0,colorMixMode:Ne.Multiply,edgeMaterial:null},_=this.fullOpacity,m=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):_;let C=null,v=de.OPAQUE,M=J,E=0;for(let y=0;y=1&&(e.material.isOpaque||c.colorMixMode===Ne.Replace)?de.OPAQUE:de.TRANSPARENT;c.edgeMaterial===C&&I===v||(M={...c.edgeMaterial,opacity:m,objectTransparency:I},C=c.edgeMaterial,v=I),e.cachedEdgeMaterials[y]=M}else e.cachedEdgeMaterials[y]=J;e.cachedSymbology[E++]=Math.round(255*f[0]),e.cachedSymbology[E++]=Math.round(255*f[1]),e.cachedSymbology[E++]=Math.round(255*f[2]),e.cachedSymbology[E++]=Math.round(255*f[3]),e.cachedSymbology[E++]=c.colorMixMode|+c.castShadows<d!==J),perFeatureEdgeMaterials:t};let i=0,a=!1;const o=t.map((d,l)=>e.featureIds[l]!==s[i]?J:(a=a||d!==J,i++,d));return{hasEdges:a,perFeatureEdgeMaterials:o}}_updateComponentData(e){if(!this._hasComponentData)return;const t=e.objectHandle,s=this._getComponentParameters(e);this._collection.setComponentData(t,s),this._stage.renderView.requestRender()}_reloadAll(e=this.elevationOffset){this._removeAllNodeDataFromStage(e),this._controller!=null&&this._controller.restartNodeLoading()}_opacityChange(e){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading(),this._nodeId2Meta.forEach(t=>{t!=null&&(this._collection.updateMaterial(t.objectHandle,s=>s.objectOpacity=e),ie(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))})}_updateMaterial(e){this._collection.updateMaterial(e.objectHandle,t=>{t.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,t.usePBR=this._usePBR,this._updateMaterialOverlay(t)})}_updateMaterialOverlay(e){}_updateEngineObject(e){this._updateComponentData(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,D.UPDATE)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),this._labeler!=null&&(this._labeler.slicePlaneEnabled=e),this._nodeId2Meta.forEach(t=>{t!=null&&(this._collection.updateMaterial(t.objectHandle,s=>s.commonMaterialParameters.hasSlicePlane=e),this._updateEdgeRendering(t,!1))})}_updatePBR(e){this._nodeId2Meta.forEach(t=>{t!=null&&this._collection.updateMaterial(t.objectHandle,s=>s.usePBR=e)}),this._hasLoadedPBRTextures=!0}get _usePBR(){return!this._isIntegratedMesh&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){this._edgeView!=null&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t)}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_ignoreClientNodeOverriddenFeatures(e){return this.i3sOverrides.hasGeometryChanges?e:(t,s,i)=>i.node.index>=0&&this.i3sOverrides.featureHasGeometryChanges(t)?w.CONTINUE:e(t,s,i)}_forAllFeatures(e,t,s){fe(this._nodeId2Meta,i=>{if(i==null)return!1;if(t!=null)switch(t(i)){case w.EXIT:return!0;case w.SKIP:return!1}let a=w.CONTINUE;switch(s){case z.ALL:a=this._forAllFeaturesOfNode(i,e);break;case z.VISIBLE_ONLY:a=this._forAllVisibleFeaturesOfNode(i,e);break;case z.QUERYABLE:a=this._forAllQueryableFeaturesOfNode(i,e)}return a===w.EXIT})}_forAllFeaturesOfNode(e,t){let s=w.CONTINUE;const i=e.featureIds;for(let a=0;a(s=t(i[a],a,e),s===w.CONTINUE)),s}_forAllQueryableFeaturesOfNode(e,t){const s=this._ignoreClientNodeOverriddenFeatures(t);if(this._renderClippingArea==null)return this._forAllFeaturesOfNode(e,s);const i=this._boundingRectNodeTest(e,this._renderClippingArea);if(i===ce.OUTSIDE)return w.CONTINUE;if(i===ce.INSIDE)return this._forAllFeaturesOfNode(e,s);const a=w.CONTINUE,o=e.featureIds,d=e.objectHandle,l=wi(this._renderClippingArea,this._collection.getObjectTransform(d));for(let h=0;h0){if(e[0]instanceof oe){const s=e,i=this.i3slayer.fieldsIndex,a=this._getObjectIdField(),o=s.map(h=>Fe(i,h.attributes,a)),{set:d,handle:l}=t.acquireSet();return t.setFeatureIds(d,o),l}if(typeof e[0]=="number"){const s=e,{set:i,handle:a}=t.acquireSet();return t.setFeatureIds(i,s),a}}return ir}resetHighlights(){F(this._highlights),this._highlights=new $i({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,z.ALL),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)})}_visibleGeometryChanged(e,t){this._elevationProvider&&(this._elevationProvider.objectChanged(e.node),this._visibleGeometryChangedSchedulerHandle==null&&(this._visibleGeometryChangedSchedulerHandle=Xs(()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null})),this._updateSnappingSources(e,t))}get performanceInfo(){const e={displayedNumberOfFeatures:0,maximumNumberOfFeatures:0,totalNumberOfFeatures:0,core:null,index:0,nodes:this._nodeId2Meta.size,"Total GPU Memory Estimate":(this._gpuMemoryEstimate/1048576).toFixed(1)+"MB","Geometry Memory Estimate":(this._geoMemoryEstimate/1048576).toFixed(1)+"MB","Texture Memory Estimate":(this._texMemoryEstimate/1048576).toFixed(1)+"MB","Unloaded Memory Estimate":(this.unloadedMemory/1048576).toFixed(1)+"MB"};return this._memCache!=null&&(e.MemCache=Math.round(100*this._memCache.hitRate)+"% hit"),this._controller&&(this._idbCacheEnabled&&(e.IDBCache=Math.round(100*this._idbCache.getHitRate())+"% hit"),this._controller.updateStats(e)),e}get test(){const e=this;return{controller:this._controller,labeler:this._labeler,get visibleObjectIds(){const t=[];return e._forAllFeatures(s=>(t.push(s),w.CONTINUE),null,z.VISIBLE_ONLY),t.sort((s,i)=>s-i),t},get numNodes(){return e._nodeId2Meta.size},get loadedNodes(){return Array.from(e._nodeId2Meta.keys()).sort((t,s)=>t-s)}}}getNodeOpacityByIndex(e){const t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return e!=null?this._collection.getMaterial(e.objectHandle).objectOpacity:0}isNodeFullyFadedIn(e){return this._crossfadeHelper.isNodeFullyFadedIn(e)}getNodeCrossfadeMetaData(e){return this._nodeId2Meta.get(e)}markNodeToRemove(e){this._controller&&this._controller.markNodeToRemove(e)}removeMarkedNodes(){this._controller&&this._controller.removeMarkedNodes()}foreachCrossfadeNode(e){this._nodeId2Meta.forEach((t,s)=>e(s,t))}fadeNode(e,t,s){if(!this.nodeCrossfadingEnabled)return;const i=this._nodeId2Meta.get(e);i!=null&&this._crossfadeHelper.fadeNode(e,i,t,s)}setNodeOpacityByIndex(e,t){const s=this._nodeId2Meta.get(e);s!=null&&this._setNodeOpacity(s,t)}_setNodeOpacity(e,t){this._collection.updateMaterial(e.objectHandle,s=>s.objectOpacity=t),this._setNodeEdgeOpacity(e,t)}_setNodeEdgeOpacity(e,t){if(this._edgeView==null||!e.cachedEdgeMaterials)return;ie(e.cachedEdgeMaterials,t);const s=e.objectHandle;this._edgeView.hasObject(s)&&this._edgeView.updateAllComponentOpacities(s,t).catch(i=>L(i,this.i3slayer.title))}get hasModifications(){return this._isIntegratedMesh&&this._layerClippingArea!=null||this._modifications&&this._modifications.length>0}updateNodeModificationStatus(e){const t=e.length;if(!this.hasModifications||t<=0||this._i3sWasmLoaded!==!0)return;const s=this.uid,i=sr(e);if(i!=null){const a={context:s,buffer:i.buffer};gi(a);const o=new Float64Array(i.buffer);e.forAll((d,l)=>{const h=o[l],c=pi(h);d.imModificationImpact=c,c!==rt.Unmodified&&this._controller.invalidateGeometryVisibility(d.index)})}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){var e;return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||this._labeler!=null&&this._labeler.updating||((e=this._crossfadeHelper)==null?void 0:e.updating)||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0||this._elevationTask!=null&&this._elevationTask.running}trackSnappingSources(e){const t={events:e,fetchEdgeLocations:async(s,i,a)=>{const o=this._nodeId2Meta.get(s);if(o==null)throw new Error("invalid-node");const{origin:d,buffer:l}=await this._collection.extractEdgeInformation(o.objectHandle,i,a);return this._snappingLocationsApplyElevation(o,l,d),{type:"components",objectIds:o.featureIds,locations:l,origin:d}},remove:()=>{It(this._snappingSourcesTrackers,t)}};return this._snappingSourcesTrackers.push(t),this._nodeId2Meta.forEach((s,i)=>{if(s==null)return;const a=this._controller.getRenderMbs(s.node);a!=null&&e.add(i,a)}),t}_snappingLocationsApplyElevation(e,t,s){if(!e.elevationOffsets||this.elevationInfo.mode===A.Absolute)return;const i=t.position0,a=t.position1,o=t.componentIndex,d=$(),l=$(),h=(c,_)=>{re(c,c,s),this.view.renderCoordsHelper.worldUpAtPosition(c,l),re(c,c,Zs(l,l,_)),Js(c,c,s)};for(let c=0;c=0||r&&r.metallicRoughnessTextureId>=0||n.normalTextureId>=0||n.emissiveTextureId>=0||n.occlusionTextureId>=0}function tr(n){return"geometryData"in n}function _t(n){return n!=null&&At(n.data)}function gt(n,r){let e=1024+n.interleavedVertexData.byteLength+(n.indices?n.indices.byteLength:0)+n.positionData.data.byteLength+n.positionData.indices.byteLength;if(r!=null)for(const t of r)t!=null&&At(t.data)&&(e+=t.data.byteLength);return e}function pt(n,r){return r.byteSize>Qi?(j.warn(`Node is too big to store in IndexedDB cache: ${n.id} (${r.byteSize} bytes)`),!1):r.byteSize>0}function sr(n){if(n.length===0)return null;const r=10*n.length,e=new Float64Array(r);return n.forAll((t,s)=>{let i=t.serviceObb;i==null&&(i=Ji,Qs(i.center,t.mbs),i.halfSize[0]=i.halfSize[1]=i.halfSize[2]=t.mbs[3]);const a=10*s;e[a]=i.center[0],e[a+1]=i.center[1],e[a+2]=i.center[2],e[a+3]=i.halfSize[0],e[a+4]=i.halfSize[1],e[a+5]=i.halfSize[2],e[a+6]=i.quaternion[0],e[a+7]=i.quaternion[1],e[a+8]=i.quaternion[2],e[a+9]=i.quaternion[3]}),e}const ir={remove(){},pause(){},resume(){}};function ie(n,r){n.forEach(e=>e.opacity=r)}var A;(function(n){n[n.Absolute=0]="Absolute",n[n.RelativeToGround=1]="RelativeToGround",n[n.OnTheGround=2]="OnTheGround"})(A||(A={}));const rr=$(),mt=ve(),ft="elevation-change";function ar(n){return r=>{if(n.immediate)return n.immediate.schedule(r);throw console.error("Error no immediate schudler"),new Error("cant find immediate scheduler")}}export{z as E,w as I,pr as c,xr as x}; diff --git a/assets/I3SNode-2025159f.js b/assets/I3SNode-2025159f.js new file mode 100644 index 0000000..62db1b1 --- /dev/null +++ b/assets/I3SNode-2025159f.js @@ -0,0 +1 @@ +import{d4 as v}from"./index-080e108a.js";class U{constructor(i,e){this.id=i,this.mbs=e,this.renderMbs=v(0,0,0,-1),this.elevationRange=null}}class x{constructor(){this.min=1/0,this.max=-1/0,this.valid=!1}}var c,s,a,d,h;(function(t){t[t.Unmodified=0]="Unmodified",t[t.Culled=1]="Culled",t[t.NotChecked=2]="NotChecked"})(c||(c={})),function(t){t[t.Unmodified=0]="Unmodified",t[t.PotentiallyModified=1]="PotentiallyModified",t[t.Culled=2]="Culled",t[t.Unknown=3]="Unknown",t[t.NotChecked=4]="NotChecked"}(s||(s={}));class M extends U{constructor(i,e,n,o,r,l,u,m,f,C){super(i,n),this.index=e,this.childCount=o,this.level=r,this.resources=l,this.version=u,this.lodMetric=m,this.maxError=f,this.numFeatures=C,this.failed=!1,this.cacheState=a.Unknown,this.vertexCount=0,this.memory=0,this.childrenLoaded=0,this.hasModifications=!1,this.imModificationImpact=s.NotChecked}}(function(t){t[t.Unknown=0]="Unknown",t[t.Uncached=1]="Uncached",t[t.Cached=2]="Cached"})(a||(a={})),function(t){t[t.None=0]="None",t[t.MaxScreenThreshold=1]="MaxScreenThreshold",t[t.ScreenSpaceRelative=2]="ScreenSpaceRelative",t[t.RemovedFeatureDiameter=3]="RemovedFeatureDiameter",t[t.DistanceRangeFromDefaultCamera=4]="DistanceRangeFromDefaultCamera"}(d||(d={})),function(t){t[t.Hole=0]="Hole",t[t.Leaf=1]="Leaf"}(h||(h={}));class D{constructor(i,e,n,o){this.nodeHasLOD=i,this.isChosen=e,this.lodLevel=n,this.version=o}}export{d as a,h as c,D as d,M as h,x as i,c as n,s as o,a as s,U as t}; diff --git a/assets/I3SOverrides-96f73e2b.js b/assets/I3SOverrides-96f73e2b.js new file mode 100644 index 0000000..7b62d31 --- /dev/null +++ b/assets/I3SOverrides-96f73e2b.js @@ -0,0 +1 @@ +import{ir as T,bh as Oe,qM as It,ar as B,qN as $t,qO as Vt,jC as ge,fI as Dt,hR as Gt,ax as Pt,qP as kt,j4 as qt,oq as Ut,jU as jt,df as Bt,qQ as Ht,gz as Qt,ai as y,aj as x,al as Xe,ao as We,fz as zt,dW as Jt,bN as E,qR as k,bn as Q,q6 as Ye,d4 as Kt,n2 as ee,qS as et,qT as Xt,h2 as pe,aY as Wt,aq as tt,qU as re,b4 as Pe,qV as Be,qW as He,bI as St,ij as Mt,b3 as Zt,qX as Le,qY as Yt,cn as Ze,fp as ei,b7 as Ie,qZ as Fe,f3 as it,cl as ti,q_ as ii,q$ as si,r0 as ni,dT as oe,gh as st,gD as Ot,gn as ri,gf as ai,gH as oi,r1 as li,gE as di,r2 as hi,j0 as ui,ok as nt,r3 as ci,r4 as rt,r5 as _i,r6 as mi,ox as at,h1 as le,gu as de,mF as Ae,na as gi,j1 as Te,gv as fi,gm as pi,bz as Qe,cY as bi,nk as ot,af as yi,ni as xi,aG as A,ag as ze,aH as vi,r7 as Ci,dz as Lt,qc as Ni,nl as lt,r8 as wi,nq as dt,r9 as Ii,nU as Di,lA as Pi,ra as Si,rb as j,aF as ht,dr as Re,ah as Mi,aO as Oi,dV as ut,fv as Li,cv as Fi,lC as Ai,cc as Ti,gl as Ri,kT as Ei,rc as $i,rd as Vi,at as Gi,re as ki}from"./index-080e108a.js";import{a as L,t as be,h as ct,n as me,o as he,d as qi,i as Ui,c as te,s as ue}from"./I3SNode-2025159f.js";import{Q as H,$ as ie,k as Ft,P as ji,B as _t,C as mt,t as Bi,e as Hi,m as Qi,p as zi,H as Ji}from"./I3SUtil-2c288808.js";import{I as Ki,p as Xi}from"./I3SBinaryReader-2b8e30f7.js";import{b as Wi}from"./Query-1c961d4c.js";import{assetMapFromAssetMapsJSON as Zi,extractMesh as Yi}from"./meshFeatureSet-8442b8e6.js";import es from"./FeatureLayerView3D-7e7e2653.js";var C,w;(function(i){i[i.KTX2=1]="KTX2",i[i.Basis=2]="Basis",i[i.DDS_S3TC=4]="DDS_S3TC",i[i.PNG=8]="PNG",i[i.JPG=16]="JPG",i[i.KTX_ETC2=32]="KTX_ETC2"})(C||(C={})),function(i){i[i.None=0]="None",i[i.Color=1]="Color",i[i.MetallicRoughness=2]="MetallicRoughness",i[i.Normal=4]="Normal",i[i.Occlusion=8]="Occlusion",i[i.Emissive=16]="Emissive",i[i.AlphaMask=32]="AlphaMask",i[i.ColorTextures=19]="ColorTextures",i[i.GeometryTextures=36]="GeometryTextures",i[i.GeometryTexturesPBR=44]="GeometryTexturesPBR",i[i.AllTextures=37]="AllTextures",i[i.AllTexturesPBR=63]="AllTexturesPBR"}(w||(w={}));async function ts(i){const e=[],t=[];if(i==null)return{material:{alphaMode:"opaque",alphaCutoff:.1,doubleSided:!0,cullFace:0,normalTextureId:-1,emissiveTextureId:-1,occlusionTextureId:-1,emissiveFactor:[0,0,0],metallicRoughness:{baseColorFactor:[1,1,1,1],baseColorTextureId:-1,metallicRoughnessTextureId:-1,metallicFactor:0,roughnessFactor:.6000000238418579},wrapTextures:!1,hasParametersFromSource:!0},requiredTextures:e,textureData:t};const s=is(i);return i.alphaMode==="auto"&&console.warn('alphaMode "auto" not supported by I3S PBRMaterial - defaulting to "blend".'),{material:{alphaMode:i.alphaMode==="auto"?"blend":i.alphaMode,alphaCutoff:i.alphaCutoff,doubleSided:i.doubleSided,cullFace:i.doubleSided?T.None:T.Back,normalTextureId:await ce(i.normalTexture,e,t,w.Normal),emissiveTextureId:s?await ce(i.emissiveTexture,e,t,w.Emissive):-1,occlusionTextureId:s?await ce(i.occlusionTexture,e,t,w.Occlusion):-1,emissiveFactor:s&&i.emissiveColor!=null?Oe.toUnitRGB(i.emissiveColor):[0,0,0],metallicRoughness:{baseColorFactor:i.color!=null?Oe.toUnitRGBA(i.color):[1,1,1,1],baseColorTextureId:await ce(i.colorTexture,e,t,w.Color),metallicRoughnessTextureId:s?await ce(i.metallicRoughnessTexture,e,t,w.MetallicRoughness):-1,metallicFactor:s?i.metallic:0,roughnessFactor:s?i.roughness:0},wrapTextures:!0,hasParametersFromSource:It({normalTexture:i.normalTexture,emissiveTexture:s?i.emissiveTexture:null,emissiveFactor:s?Oe.toUnitRGB(i.emissiveColor):null,occlusionTexture:s?i.occlusionTexture:null,metallicRoughnessTexture:s?i.metallicRoughnessTexture:null,metallicFactor:s?i.metallic:null,roughnessFactor:s?i.roughness:null})},requiredTextures:e,textureData:t}}async function ce(i,e,t,s){if(i==null)return-1;const n=t.length,r=i.data,a=i.url;if(r!=null){if(r instanceof HTMLImageElement||r instanceof HTMLCanvasElement){const o=gt(r);return t.push({id:n,usage:s,data:o,encoding:C.PNG,downsampled:!1}),e.push({id:n,usage:s,encodings:[{name:void 0,encoding:C.PNG}]}),n}if(r instanceof HTMLVideoElement)return-1;if(r instanceof ImageData)throw new B("ImageData textures not supported yet for client side I3S nodes");if(r instanceof $t)throw new B("EncodedMeshTexture textures not supported yet for client side I3S nodes")}else if(a!=null){const o=new Image;o.src=a;const l=gt(await Vt(o,o.src,!1,void 0));return t.push({id:n,usage:s,data:l,encoding:C.PNG,downsampled:!1}),e.push({id:n,usage:s,encodings:[{name:void 0,encoding:C.PNG}]}),n}return-1}function gt(i){let n=i.width*i.height;if(n>=4096){let r=i.width,a=i.height;do r=Math.ceil(r/2),a=Math.ceil(a/2),n=r*a;while(n>1048576);const o=document.createElement("canvas");return o.width=r,o.height=a,o.getContext("2d").drawImage(i,0,0,r,a),o}return i}function is(i){return i.hasOwnProperty("metallicRoughnessTexture")}let ss=class{constructor(e,t,s,n,r,a){this._uid=e,this._indexSR=t,this._renderSR=s,this._viewingMode=n,this._worker=a,this._id2Meta=new Map,this._oid2Meta=new Map,this._memCache=r.newCache(`sl-client-mesh-data-${this._uid}`)}get indexSR(){return this._indexSR}get renderSR(){return this._renderSR}createMeshNodeInfo(e,t){const s=`mesh${t}`,n=e.extent,r=n.spatialReference,a=this._indexSR,o=ns(n,e.origin);return ge(o,r,o,a),{type:"mesh",id:s,version:os(e),oid:t,mbs:o,componentNodeIds:[],unloadedMesh:e,nodeIndex:null,loadMeshPromise:null}}addMeshNode(e,t){if(this.getMeshNodeIndex(t.oid)!=null)throw new B(`I3SClientNodeLoader: client side mesh for feature oid=${t.oid} already exists`);t.nodeIndex=e,this._id2Meta.set(t.id,t),this._oid2Meta.set(t.oid,t)}getMeshNodeIndex(e){const t=this._oid2Meta.get(e);return t==null||t.type!=="mesh"?null:t.nodeIndex}removeNode(e){if(e==null)return;const t=this._id2Meta.get(e);t!=null&&(this._id2Meta.delete(e),t.type==="mesh"&&this._oid2Meta.delete(t.oid))}async loadNodeJSON(e){const t=this._id2Meta.get(e);if(t==null)throw new B(`I3SClientNodeLoader::loadNodeJSON unable to find node ${e}`);switch(t.type){case"mesh":return this._loadMeshNodeJSON(t);case"mesh-component":return this._loadMeshComponentNodeJSON(t);default:throw new B(`I3SClientNodeLoader::loadNodeJSON unable to handle node ${e}`)}}async _loadMeshNodeJSON(e){const t=e.id,s=(await this._getMeshData(e)).loadedMesh;if(s.components==null||s.components.length===0)return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null};const n=[],r=s.components;for(let a=0;a{const o=e.unloadedMesh.clone();try{await o.load()}catch(_){a(_)}const l=o.memoryUsage,d={loadedMesh:o,projectionPromise:null,normalsTransformPromise:null,usedMemoryInBytes:l};this._memCache.put(t,d,l,Ht),e.loadMeshPromise=null,r(d)};return e.loadMeshPromise=new Promise((r,a)=>n(r,a)),e.loadMeshPromise}return s}};function ns(i,e){const{spatialReference:t}=i,s=[1,-1],n=[.5*i.width,.5*i.height,i.hasZ?.5*(i.zmax-i.zmin):0],r=t.isGeographic?t.metersPerUnit:1,a=i.center;let o=0;if(i.hasZ)for(let l=0;l<2;++l)for(let d=0;d<2;++d)for(let _=0;_<2;++_){const h=(a.x+s[l]*n[0]-e.x)*r,u=(a.y+s[d]*n[1]-e.y)*r,m=a.z+s[_]*n[2]-e.z;o=Math.max(h*h+u*u+m*m,o)}else for(let l=0;l<2;++l)for(let d=0;d<2;++d){const _=(a.x+s[l]*n[0]-e.x)*r,h=(a.y+s[d]*n[1]-e.y)*r;o=Math.max(_*_+h*h,o)}return kt([e.x,e.y,e.z],Math.sqrt(o))}async function rs(i,e,t,s){const{transform:n,vertexAttributes:r}=e.loadedMesh,a=i.shading==="source"?r.normal:null;if(!(a!=null&&n!=null&&(n.rotationAngle!==0||!qt(n.scale,Ut))))return{transformed:a,original:r.normal};if(!e.normalsTransformPromise){Dt(t,"SceneLayerWorker is needed to transform mesh normals");const o=Qt();jt(o,n.localMatrix),e.normalsTransformPromise=t.transformNormals({normalMatrix:o,normals:a},s)}return e.normalsTransformPromise}function as(i,e,t,s,n,r){const o=e.length/3,l=3*o;let d=0,_=0,h=!1,u=0,m=!1,c=0,g=!1,p=0,f=0,b=0;d+=W,d+=W,_=d,d+=3*l*Ee,t!=null&&(h=!0,u=d,d+=3*l*Ee),s!=null&&(m=!0,c=d,d+=2*l*Ee),n!=null&&(g=!0,p=d,d+=4*l*ls),f=d,d+=1*ds,b=d,d+=2*1*W;const v=new ArrayBuffer(d),N=new Uint8Array(v);X(N,0,l),X(N,W,1);const O=new Float32Array(v,_),I=t!=null?new Float32Array(v,u):null,S=s!=null?new Float32Array(v,c):null,F=n!=null?new Uint8Array(v,p):null;for(let G=0;G>8,i[e+2]=255&t>>16,i[e+3]=255&t>>24}function os(i){var n;const e=(n=i.metadata.displaySource)==null?void 0:n.source;if(e==null||!Array.isArray(e)||!e.length||e[0]instanceof File)return Bt();const t=e;let s="";for(const r of t)s+=r.makeHash();return s+JSON.stringify(i.transform!=null?i.transform.toJSON():"")+(i.vertexSpace.isRelative?JSON.stringify(i.vertexSpace.origin):"")}const W=4,Ee=4,ls=1,ds=8;let De=class extends We{constructor(){super(),this.referenceCount=0,this.callbacks=new Array,this.runIndex=0}get running(){return this.callbacks.some(i=>i.running)}runTask(i){this._sort();const e=this.callbacks,t={numIndexLoading:0,numNodesLoading:0};for(let s=0;s0;t--){const s=i[t-1];let n=t;for(;n{t!=null&&(t.task.remove(e),t.task.callbacks.length>0||($e.delete(i),t.handle.remove(),t.task.destroy()),t=null)}}}let Ve=class{constructor(e,t,s,n,r){this.childOffset=e,this.childCount=t,this.visibilityCache=s,this.ref=n,this.node=r,this.useAsHole=0,this.filterImpact=me.NotChecked}};class cs{constructor(e,t,s,n,r,a,o,l,d,_,h,u,m,c,g){this._layer=e,this._streamDataController=s,this._clientNodeLoader=n,this._viewportQueries=r,this._logger=a,this.holeFilling=o,this._isLoaded=l,this._isReloading=d,this._isSelected=_,this._enable=h,this._needsUpdate=u,this._canRequest=m,this._computeVisibilityObb=c,this._computeNodeFiltering=g,this._dirty=!0,this._nodePages=new Array,this._clientNodePage=null,this._nodeCount=0,this._nodesPerPage=0,this._rootIndex=0,this._lodMetric=L.None,this._lodConversion=p=>p,this._isEditable=!1,this._urlPrefix="",this._loading=new Set,this._failedNodes=new Set,this._failedPages=new Set,this._indexMissing=1,this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.POSITIVE_INFINITY,this._nodeTraversalState=new Map,this._version=Z(0),this._visibilityCacheVersion=Z(0),this._maxLevel=1,this._featureEstimate={estimate:0,leavesReached:!1},this._unloadedMemoryEstimate=0,this._missing=new E({deallocator:null}),this._prefetch=new E({deallocator:null}),this._updates=new _s(this._missing),this._imModificationUncategorized=new E({deallocator:null}),this.ignoreServiceObb=!1,this.progressiveLoadPenalty=0,this._pageQueue=[],this.needNodeElevationRange=!1,this.layerHasModifications=!1,this._layerHasFilter=!1,this._isEditable=k()&&e.associatedLayer!=null&&e.associatedLayer.infoFor3D!=null,e.serviceUpdateTimeStamp&&e.serviceUpdateTimeStamp.lastUpdate&&(this._lastUpdate=`${e.serviceUpdateTimeStamp.lastUpdate}`),this._maxLodLevel=this._viewportQueries?this._viewportQueries.maxLodLevel:1,this._init(t)}_init(e){if(e.type==="page"){const t=e.rootPage;switch(this._urlPrefix=e.urlPrefix,this._nodesPerPage=e.pageSize,e.lodMetric){case"maxScreenThreshold":this._lodMetric=L.MaxScreenThreshold;break;case"maxScreenThresholdSQ":this._lodMetric=L.MaxScreenThreshold,this._lodConversion=fs}if(this._isEditable){this._rootIndex=-1;const s=R(e.rootIndex,e.pageSize),n=t.nodes[s],r={nodes:[{index:this._rootIndex,children:[e.rootIndex],mesh:void 0,obb:n.obb,lodThreshold:n.lodThreshold}]};this._addPage(ve(this._rootIndex,this._nodesPerPage),r),this.getNode(-1).serviceObb=void 0}else this._rootIndex=e.rootIndex;this._addPage(ve(e.rootIndex,this._nodesPerPage),t),this._updateParentsAndLevel()}else if(e.type==="node"){if(this._urlPrefix=e.urlPrefix,this._nodePages.push(Ce()),this._isEditable){this._clientNodePage=Ce();const s={id:"-1",version:null,mbs:e.rootNode.mbs,obb:e.rootNode.obb,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:[{id:"root",href:"../root",mbs:e.rootNode.mbs,obb:e.rootNode.obb}]};this._rootIndex=this._makeClientRefNode(new be(s.id,null),-1);const n=this._validateNode(s.id,s);n&&this._addNode(n,this._rootIndex)}else this._rootIndex=this._makeRefNode(new be(e.rootNode.id,null),-1);const t=this._validateNode(e.rootNode.id,e.rootNode);t&&this._addNode(t,0)}}addClientNodeToIndex(e,t){const n=new be(e,t),r=this._makeClientRefNode(n,-1);return this._linkChildToParentNode(-1,r),this.requestUpdate(),r}removeClientNodeFromIndex(e,t,s){this._destroyClientRefNode(e,t,s),this.requestUpdate()}_loadPage(e){this._loading.add(e);const t=this._urlPrefix+e;this._streamDataController.request(t,"json").then(s=>{this._pageQueue.push({pageIndex:e,page:s})}).catch(s=>{this._loading.delete(e),Q(s)||(this._failedPages.add(e),this._logger.error("#loadPage()",this._layer,`Error when loading page ${e}`,s))})}_addQueuedPages(e){for(;this._pageQueue.length>0&&!e.done;){const{pageIndex:t,page:s}=this._pageQueue.shift();this._addPage(t,s),this._loading.delete(t),e.madeProgress()}this._updateParentsAndLevel()}_addPage(e,t){const s=[],n=[],r=t.nodes.map((a,o)=>{const l=s.length,d=a.children?a.children.length:0;n.push(this._rootIndex);for(let b=0;b{const a=this._getPage(s);if(a!=null){const o=R(s,this._nodesPerPage);a.parents[o]=n??-1;const l=a.nodes[o].node;l!=null&&(l.level=r,e.push(s))}};for(t(this._rootIndex,null,0);e.length;){const s=e.pop(),n=this.getNode(s);if(n!=null)for(let r=0;r=0)throw new Error("I3SIndex::client side nodes can not be made children of service side nodes.");const n=-(s.nodes.length+1);return s.nodes.push(new Ve(0,0,ye(this._visibilityCacheVersion),e,null)),this._nodeCount++,s.parents.push(t),H(e.renderMbs),ie(e.serviceObbInRenderSR),n}_linkChildToParentNode(e,t){const s=this._clientNodePage;if(s==null||e>=0)return;const n=R(e,this._nodesPerPage),r=R(t,this._nodesPerPage),a=s.nodes[n],o=a.childOffset;s.children.splice(a.childOffset+a.childCount,0,t);const l=1;a.childCount+=l,a.node!=null&&(a.node.childCount+=l);for(const d of s.nodes)d.childOffset>o&&(d.childOffset+=l);s.parents[r]=e,this._updateParentBoundingInformation(e)}_destroyClientRefNode(e,t,s){var g;const n=this._clientNodePage;if(n==null)return;const r=this.getParentIndex(e);if(r==null)return;const a=new Set,o=new Map,l=p=>{var v;const f=R(p,this._nodesPerPage),b=n.nodes[f];if(b.childCount>0)for(let N=b.childOffset;N-1),u=[],m=[];for(let p=0;p-1);for(let p=0;p=0)m.push(O);else{const I=R(O,this._nodesPerPage),S=d[I];if(a.has(S))continue;const F=h[I];m.push(F),c[R(F,this._nodesPerPage)]=f}}b.childOffset=v,b.childCount=m.length-v,b.node&&(b.node.childCount=b.childCount)}n.nodes=u,n.children=m,n.parents=c,this._updateParentBoundingInformation(h[R(r,this._nodesPerPage)])}_updateParentBoundingInformation(e){let t=e;do{let s=null;const n=this._clientNodeLoader.indexSR,r=this._clientNodeLoader.renderSR,a=this._getNodeInternal(t);if(a==null)return;for(let l=0;l0)if(s==null)s=et(h.mbs,ps);else{const u=bs,m=ys,c=xs;ge(h.mbs,n,u,r),ge(s,n,m,r),Xt(u,m,c),ge(c,r,s,n)}}const o=a.ref||a.node;o!=null&&(s!=null?o.mbs=et(s,o.mbs!=null?o.mbs:pe()):H(o.mbs),H(o.renderMbs),ie(o.serviceObbInRenderSR),o.geometryObb=null),this.invalidateNodeVisibilityCacheInternal(a),t=this.getParentIndex(t)}while(t!=null)}populateChildren(e,t){const s=this._getNodeInternal(e),n=this._getPage(e);s.childOffset=n.children.length,s.childCount=t.length;for(let r=0;r{(s.node!=null&&s.node.id===e||s.ref!=null&&s.ref.id===e)&&(t=n)}),t}getNodeById(e){const t=this.getIndexById(e);return t!=null&&t>=0?this.getNode(t):null}getChildIndex(e,t){const s=this._getPage(e);if(s==null)return-1;const n=s.nodes[R(e,this._nodesPerPage)];return s.children[n.childOffset+t]}getParentIndex(e){const t=this._getPage(e);return t!=null&&e!==this._rootIndex?t.parents[R(e,this._nodesPerPage)]:null}getParent(e){const t=this.getParentIndex(e);return t!=null?this.getNode(t):null}isLeaf(e){const t=this._getNodeInternal(e);return t!=null&&t.childCount===0}get rootNode(){return this.getNode(this._rootIndex)}get size(){return this._nodeCount}get isEditable(){return this._isEditable}removeAllGeometryObbs(){this._forAllNodes(e=>{e.node!=null&&(e.node.geometryObb=null)})}invalidateVisibilityCache(){this._visibilityCacheVersion=Z(this._visibilityCacheVersion)}invalidateNodeVisibilityCache(e){const t=this._getNodeInternal(e);t!=null&&this.invalidateNodeVisibilityCacheInternal(t)}invalidateNodeVisibilityCacheInternal(e){e.visibilityCache=ye(this._visibilityCacheVersion)}invalidateBoundingVolumeCache(e){const t=this._getNodeInternal(e);t!=null&&(ft(t),this.invalidateNodeVisibilityCacheInternal(t))}updateElevationChanged(e){const t=this._getNodeInternal(e);if(t==null)return;if(!this.needNodeElevationRange)return void this.invalidateBoundingVolumeCache(e);const s=t.node!=null?t.node:t.ref;if(s==null)return;const n=s.elevationRange;n!=null&&(n.valid=!1)}invalidateGeometryVisibility(e){const t=this._getNodeInternal(e);t!=null&&t.node!=null&&(t.node.geometryObb=null,H(t.node.renderMbs),ie(t.node.serviceObbInRenderSR))}invalidateVisibilityObbs(){this.rootNode!=null&&this.traverse(this.rootNode,e=>(e.visibilityObb=this._computeVisibilityObb(e),e.geometryObb=null,!0))}_updateElevationRange(e){const t=this._getNodeInternal(e);if(t==null)return null;const s=t.node!=null?t.node:t.ref;if(s==null)return null;const n=s.elevationRange;if(n!=null&&n.valid)return n;const r=new Ui;let a=!1;for(let o=0;o{t!=null&&(t.imModificationImpact=he.NotChecked,t.visibilityObb=this._computeVisibilityObb(t),t.hasModifications&&this.invalidateGeometryVisibility(t.index))}),this.invalidateVisibilityCache()}layerFilterChanged(e){this._layerHasFilter=e,this._forAllNodes(t=>{if(t!=null){t.filterImpact=me.NotChecked;const s=t.node;s!=null&&this.invalidateNodeVisibilityCache(s.index)}}),this.invalidateVisibilityCache()}update(e,t,s){if(!this._dirty)return;this._pageQueue.length>0&&this._addQueuedPages(t),this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.NEGATIVE_INFINITY,this._missing.clear(),this._prefetch.clear(),this._updates.reset(e),M.clear();let n=!0;const r=new ke,a=new ke,o=this._imModificationUncategorized;o.clear();const l=new Set,d=(h,u,m)=>{if(u==null){let f=this._entryPriority(h);f===1/0&&(f=this._entryPriority(m));const b=ve(h,this._nodesPerPage);return M.set(b,Math.max(f,M.get(b)||0)),this._loading.has(b)||this._failedPages.has(b)||this._missing.push(b),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,f))}const c=u.node;if(this._updateNodeFeatureEstimate(c,a),c==null){const f=this._entryPriority(h);return this._loading.has(h)||this._failedNodes.has(h)||(this._missing.push(h),M.set(h,f)),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,f))}const g=this._getPage(h);if(this._missing.length===0&&this._nodesPerPage===0)for(let f=0;f0&&this._isSelected(c)&&(n=!1));if(l.add(c.id),this._isLoaded(h)){if(r.known+=c.memory,++r.knownNodes,this._isSelected(c)?u.childCount>0&&(n=!1):(r.unremoved+=c.memory,n=!1),this._needsUpdate(c)){const f=this._entryPriority(h);M.set(h,f),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,f),this._updates.update.push(h)}return}if(c.memory&&(r.known+=c.memory,++r.knownNodes),!this._isSelected(c))return void(this._isReloading(h)&&this._updates.remove.push(h));if(u.childCount>0&&(n=!1),c.memory?(r.missing+=c.memory,r.known+=c.memory,++r.knownNodes):++r.missingNodes,e.includes(c.index))return this._maxProcessingPrio=Math.max(this._maxProcessingPrio,this._entryPriority(h)),void(this._updates.cancel=this._updates.cancel.filter(f=>f!==c.index));if(!t.done&&this._enable(c))return void t.madeProgress();const p=this._entryPriority(h);M.set(h,p),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,p),this._updates.add.push(h),this.layerHasModifications&&s&&c!=null&&c.imModificationImpact===he.NotChecked&&o.push(h)};this.traverseVisible(d);const _=this._updates.add;_.length>0&&this.layerHasModifications&&(o.length>0&&(s==null||s(o)),_.filterInPlace(h=>{const u=this._getNodeInternal(h),m=u==null||u.node==null||u.node.imModificationImpact!==he.Culled;return m||this.invalidateNodeVisibilityCache(h),m})),this._unloadedMemoryEstimate=r.missing-r.unremoved,r.knownNodes>3&&r.missingNodes>0&&(this._unloadedMemoryEstimate+=r.known/r.knownNodes*r.missingNodes),this._unloadedMemoryEstimate=.8*Math.max(0,this._unloadedMemoryEstimate),this._featureEstimate.estimate=this._computeFeatureEstimate(a),this._featureEstimate.leavesReached=n,this._missing.sort((h,u)=>h-u),this._missing.filterInPlace((h,u)=>u<1||this._missing.data[u-1]!==h),this._missing.sort((h,u)=>M.get(h)-M.get(u)),this._missing.length>0&&(this._maxUnloadedPrio=M.get(this._missing.back()),this._prefetch.clear()),this._updates.add.filterInPlace(h=>M.get(h)>=this._maxUnloadedPrio).sort((h,u)=>M.get(h)-M.get(u)),this._updates.update.sort((h,u)=>M.get(h)-M.get(u)),this._indexMissing=this._loading.size+this._missing.length,this._dirty=this._indexMissing>0,M.clear()}checkFeatureTarget(e,t){const s=this._viewportQueries.updateScreenSpaceErrorBias(t);let n=t,r=t,a=s,o=10;for(;o--;){const l=new ke;if(this._updateFeatureEstimate(n,l),this._computeFeatureEstimate(l)<=e){if(n>=t||l.missingNodes>0||o===0)break;a=n,n=.5*(n+r)}else r=n,n=.5*(n+a)}return this._version=Z(this._version),this._viewportQueries.updateScreenSpaceErrorBias(s),Math.min(t,n)}_updateFeatureEstimate(e,t){this._version=Z(this._version),this._viewportQueries.updateScreenSpaceErrorBias(e),this.traverseVisible((s,n)=>this._updateNodeFeatureEstimate(n!=null?n.node:void 0,t))}_updateNodeFeatureEstimate(e,t){if(e!=null&&!e.failed&&e.numFeatures!=null)return this._isLoaded(e.index)?(t.known+=e.numFeatures,++t.knownNodes,void(this._isSelected(e)||(t.unremoved+=e.numFeatures))):void(this._isSelected(e)&&(e.numFeatures!=null?(t.missing+=e.numFeatures,t.known+=e.numFeatures,++t.knownNodes):++t.missingNodes))}_computeFeatureEstimate(e){let t=e.known-e.unremoved;return e.knownNodes>3&&e.missingNodes>0&&(t+=e.known/e.knownNodes*e.missingNodes),Math.max(0,t)}load(){return this._load(this._missing)}prefetch(){return this._prefetch.sort((e,t)=>M.get(e)-M.get(t)),this._load(this._prefetch)}_load(e){if(e.length===0||!this._canRequest())return!1;for(;e.length>0&&this._canRequest();)if(this._nodesPerPage===0)this._loadNode(e.pop());else{const t=e.pop();t>=0?this._loadPage(t):this._loadNode(t)}return!0}get isLoading(){return this._indexMissing>0}get isPrefetching(){return this._prefetch.length>0}get indexLoading(){return this._loading.size}get indexMissing(){return this._indexMissing}get unloadedMemoryEstimate(){return this._unloadedMemoryEstimate}get updates(){return this._updates}get featureEstimate(){return this._featureEstimate}get maxPriority(){return Math.max(this._maxProcessingPrio,this._maxUnloadedPrio)}nodeTraversalState(e){if(e==null)return null;let t=this._nodeTraversalState.get(e.index);if(t&&Ge(t.version,this._version))return t;const s=this._viewportQueries.getLodLevel(e),n=this._viewportQueries.hasLOD(e);let r=!0;if(n){const a=this.getParentIndex(e.index);if(a!=null){const o=this._nodeTraversalState.get(a);r=!!o&&s>o.lodLevel}else r=s>0}else r=e.childCount===0;return t?(t.lodLevel=s,t.isChosen=r,t.version=xe(!0,this._version),t):(t=new qi(n,r,s,xe(!0,this._version)),this._nodeTraversalState.set(e.index,t),t)}async _loadNode(e){this._loading.add(e);const t=this._getNodeInternal(e).ref;if(t==null)return void this._failedNodes.add(e);const s=t.id,n=this._urlPrefix+s,r=()=>{this._loading.delete(e),this._missing.length===0&&this._loading.size===0&&this.requestUpdate()};let a=null;try{a=e>=0?await this._streamDataController.request(n,"json"):await this._clientNodeLoader.loadNodeJSON(s)}catch(d){return r(),void(Q(d)||(this._logger.error("#loadNode()",this._layer,"Error loading node: "+n),this._failedNodes.add(e)))}r();const o=this._validateNode(s,a);if(o==null)return;o.obb&&this.invalidateNodeVisibilityCache(e);const l=this._addNode(o,e);this.nodeTraversalState(l)}_validateNode(e,t){if(t==null||typeof t!="object"||t.id!==e)return this._logger.error("#validateNode()",this._layer,`Invalid node. Wrong type or wrong id "${e}"`),null;if(!Array.isArray(t.mbs))return this._logger.error("#validateNode()",this._layer,`Invalid bounding volume on node ${e}.`),null;t.sharedResource&&t.sharedResource.href!=="./shared"&&t.sharedResource.href!=="./shared/"&&this._logger.warn("#validateNode()",this._layer,`Invalid shared resource href on node "${e}"`);const s=t.geometryData;s==null||Array.isArray(s)&&s.length===0||Array.isArray(s)&&s.length===1&&s[0].href==="./geometries/0"||this._logger.warn("#validateNode()",this._layer,`Invalid geometry data on node "${e}"`);const n=t.attributeData,r=this._layer.attributeStorageInfo;n==null||Array.isArray(n)&&!n.some((u,m)=>{var c;return u.href!==`./attributes/${((c=r==null?void 0:r[m])==null?void 0:c.key)??`f_${m}`}/0`})||this._logger.warn("#validateNode()",this._layer,`Invalid attribute data on node "${e}"`),t.featureData&&t.featureData.length>1&&this._logger.warn("#validateNode()",this._layer,`Node ${e} has ${t.featureData.length} bundles. Only the first bundle will be loaded.`);const a=t.hasOwnProperty("obb")&&!this.ignoreServiceObb?t.obb:null,o=t.featureData&&t.featureData.length===1&&t.featureData[0].featureRange?t.featureData[0].featureRange[1]-t.featureData[0].featureRange[0]+1:void 0,l=u=>{if(u==null)return null;const m=p=>this._logger.error("#validateNode()",this._layer,`Invalid node reference on node ${e}: ${p}`);if(typeof u.id=="number")m(`id ${u.id} is a number instead of a string.`);else if(typeof u.id!="string"||!Array.isArray(u.mbs))return m("Missing or invalid id."),null;if(!Array.isArray(u.mbs))return m(`Invalid bounding volume on reference ${u.id}.`),null;u.href&&u.href!=="../"+u.id&&this._logger.error("#validateNode()",this._layer,`Invalid node href on node "${e}"`);const c=u.hasOwnProperty("obb")&&!this.ignoreServiceObb?u.obb:null,g=new be(`${u.id}`,u.mbs);return g.serviceObb=c,g.visibilityObb=this._computeVisibilityObb(g),g},d=Array.isArray(t.children)?t.children.map(l).filter(u=>u!=null):null,_=t.featureData&&t.featureData.length>1,h=t.isEmpty&&t.isEmpty===!0;return{id:e,mbs:t.mbs,obb:a,children:d,resources:{isEmpty:!_&&h,hasSharedResource:t.sharedResource!=null,attributes:t.attributeData?e:void 0,texture:t.textureData&&t.textureData.length>0?e:void 0,geometry:t.geometryData!=null?e:void 0},version:typeof t.version=="string"?t.version:null,lodSelection:Array.isArray(t.lodSelection)?t.lodSelection:null,numFeatures:o}}resetFailedNodes(){this._failedNodes.clear(),this._failedPages.clear(),this._forAllNodes(e=>{e.node!=null&&(e.node.failed=!1)})}_entryPriority(e){const t=this._getNodeInternal(e),s=this.getParentIndex(e);if(t==null||s==null&&t.node==null)return s==null?1/0:this._entryPriority(s);let n=0;if(t.node&&s!=null){const o=this._nodeTraversalState.get(s);o!=null&&(n=o.lodLevel)}let r=this.progressiveLoadPenalty;for(let o=e;o!=null;o=this.getParentIndex(o))if(this._isLoaded(o)){r=0;break}const a=t.ref!=null?this._viewportQueries.distToPOI(t.ref):t.node!=null?this._viewportQueries.distToPOI(t.node):0;return-a-n*(a+this.progressiveLoadPenalty)+r}traverseVisible(e){const t=this._getNodeInternal(this._rootIndex);t!=null?this._traverseVisible(this._rootIndex,null,t,e):e(this._rootIndex,null,null)}_traverseVisible(e,t,s,n){if(s.node&&s.childCount===0)return void(this.isGeometryVisible(e)&&n(e,s,t));if(!this.isNodeVisible(e)||(n(e,s,t),s.node==null))return;const r=this.nodeTraversalState(s.node);if(r!=null&&r.nodeHasLOD&&r.lodLevel===this._maxLodLevel)return;const a=this._getPage(e);for(let o=0;o{let n=this._isLoaded(s.index)||this._isReloading(s.index)?1:0;return this.traverseChildren(s,r=>(n+=t(r),!1)),s.childrenLoaded!==n&&e.push(s.index),n};return t(this.rootNode),e.length&&this._logger.error("childrenLoaded invariant broken at following nodes: "+e.join(",")),e.length>0}updateStats(e){if(this._updates.add.length>0&&(e.nodes+=" + "+this._updates.add.length),(this._indexMissing||this._prefetch.length>0)&&(e.index+=" + "+this._indexMissing||this._prefetch.length),e.prio=this._maxProcessingPrio,this._featureEstimate.estimate){const t=this._featureEstimate.estimate-e.features;t>0?e.features+=" + "+t:t<0&&(e.features+=" - "+-t)}}updateElevationInfo(e,t){this.needNodeElevationRange=t&&!!e&&(e.mode==="relative-to-ground"||e.mode==="on-the-ground"),this._viewportQueries.updateElevationInfo(e),this.invalidateAllElevationRanges()}invalidateAllElevationRanges(){this._forAllNodes(e=>{ft(e),e.node!=null&&(e.node.elevationRange=null),e.ref!=null&&(e.ref.elevationRange=null)})}_forAllNodes(e){if(this._clientNodePage!=null){const t=this._clientNodePage;for(let s=0;sthis._addNode(e,t)}}}const M=new Map;let _s=class{constructor(e){this.missing=e,this.update=new E({deallocator:null}),this.add=new E({deallocator:null}),this.remove=new E({deallocator:null}),this.cancel=[]}reset(e){this.add.clear(),this.update.clear(),this.cancel=e}};function ft(i){i.node!=null&&(H(i.node.renderMbs),ie(i.node.serviceObbInRenderSR)),i.ref!=null&&(H(i.ref.renderMbs),ie(i.ref.serviceObbInRenderSR))}function ye(i){return Ft(i,-2)}function Z(i){return Ft(i,2)}function xe(i,e){return e+(i?1:0)}function Ge(i,e){return(-2&i)===e}function pt(i){return(1&i)==1}function ve(i,e){return i<0?-1:e===0?0:i/e|0}function Ce(i=[],e=[],t=[]){return{nodes:i,children:e,parents:t}}function R(i,e){return i<0?-i-1:e===0?i:i%e}function Ne(i,e,t){return e===-1?-(i+1):t===0?i:e*t+i}const ms=[["maxScreenThreshold",L.MaxScreenThreshold],["screenSpaceRelative",L.ScreenSpaceRelative],["removedFeatureDiameter",L.RemovedFeatureDiameter],["distanceRangeFromDefaultCamera",L.DistanceRangeFromDefaultCamera]];function gs(i){if(i){for(let e=0;e0&&this._removeChildrenRecursive(e),!0;const h=o.isNodeLoaded(r);if(n&&h&&d){const f=!s&&this.hasNoVisibleChildren(e);o.fadeNode(r,fe.FadeIn,!f)}const u=h&&(!o.isNodeFullyFadedIn||o.isNodeFullyFadedIn(r));if(h&&(o.updateNodeState(r,d?te.Leaf:te.Hole),d))return u&&this._removeChildrenRecursive(e),u;const m=e.childCount>0;let c=m;if(m)for(let f=0;f((this._layerView.isNodeLoaded(t.index)||this._layerView.isNodeReloading(t.index))&&V.push(t.index),t.childrenLoaded>0))}hasNoVisibleChildren(e){let t=!0;return this._index.traverseChildren(e,s=>!(!t||!this._index.isNodeVisible(s.index))&&(this._layerView.isNodeLoaded(s.index)?(t=!1,!1):s.childrenLoaded>0)),t}_childrenRequireLoading(e){let t=!1,s=!0;return this._index.traverseChildren(e,n=>{if(!s||!this._index.isNodeVisible(n.index))return!1;const r=this._index.nodeTraversalState(n);return this._isChosenMaxLOD(r)&&this._index.isGeometryVisible(n.index)&&(t=!0),this._layerView.isNodeLoaded(n.index)?(s=!1,!1):n.childrenLoaded>0}),s&&t}_isChosenMaxLOD(e){return e.isChosen&&(!e.nodeHasLOD||e.lodLevel===this._maxLodLevel)}};const V=new E({deallocator:null});let _e=class{constructor(e,t){this._textureRep=e,this.loadPromise=null,this._disposed=!1;const s=this._textureRep.acquire(t);Wt(s)?(s.then(n=>{this._disposed?tt(n):this._textureRef=n}),this.loadPromise=s):this._textureRef=s}dispose(){this._textureRef=tt(this._textureRef),this._disposed=!0}get glTexture(){return this._textureRef!=null?this._textureRef.glTexture:null}};function Cs(i,e){const t=new Map,s=(c,g)=>{if(c==null)return-1;const p=t.get(c.id);if(p)return p.usage|=g,p.id;const f=t.size;return t.set(c.id,{id:f,usage:g}),f},n=e.pbrMetallicRoughness,r=n==null?void 0:n.baseColorFactor,a=e.emissiveFactor,o=It({normalTexture:e.normalTexture,emissiveTexture:e.emissiveTexture,emissiveFactor:e.emissiveFactor,occlusionTexture:e.occlusionTexture,metallicRoughnessTexture:n==null?void 0:n.metallicRoughnessTexture,metallicFactor:n==null?void 0:n.metallicFactor,roughnessFactor:n==null?void 0:n.roughnessFactor}),l=o?Be[0]:(n==null?void 0:n.metallicFactor)??He[0],d=o?Be[1]:(n==null?void 0:n.roughnessFactor)??He[1],_=e.alphaMode==="mask"?w.Color|w.AlphaMask:w.Color,h={baseColorFactor:r?[r[0],r[1],r[2],r[3]]:[1,1,1,1],baseColorTextureId:s(n&&n.baseColorTexture,_),metallicRoughnessTextureId:s(n&&n.metallicRoughnessTexture,w.MetallicRoughness),metallicFactor:l,roughnessFactor:d},u={alphaMode:e.alphaMode,alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,cullFace:e.cullFace==="none"?T.None:e.cullFace==="back"?T.Back:e.cullFace==="front"?T.Front:T.None,normalTextureId:s(e.normalTexture,w.Normal),emissiveTextureId:s(e.emissiveTexture,w.Emissive),occlusionTextureId:s(e.occlusionTexture,w.Occlusion),emissiveFactor:a?[a[0],a[1],a[2]]:[0,0,0],metallicRoughness:h,wrapTextures:!1,hasParametersFromSource:o},m=[];return t.forEach(({usage:c},g)=>{const p=i!=null&&i[g]&&i[g].formats,f=p?At(p.map(({name:b,format:v})=>({name:b,encoding:Ns[v]}))):[];m.push({id:g,usage:c,encodings:f})}),{material:u,textures:m}}function At(i){return i.sort((e,t)=>e.encoding-t.encoding)}const Ns={ktx2:C.KTX2,basis:C.Basis,dds:C.DDS_S3TC,png:C.PNG,jpg:C.JPG,"ktx-etc2":C.KTX_ETC2},bt={[re.KTX2_ENCODING]:C.Basis,[re.BASIS_ENCODING]:C.Basis,[re.DDS_ENCODING]:C.DDS_S3TC,"image/png":C.PNG,"image/jpg":C.JPG,"image/jpeg":C.JPG,"image/ktx":C.KTX_ETC2};function ws(i){var o,l;const e=i&&i.materialDefinitions?Object.keys(i.materialDefinitions)[0]:null,t=i&&i.textureDefinitions?Object.keys(i.textureDefinitions)[0]:null,s=e?(o=i.materialDefinitions)==null?void 0:o[e]:null,n=t?(l=i.textureDefinitions)==null?void 0:l[t]:null,r=Is();if(s!=null){const d=s.params;d.diffuse&&(r.metallicRoughness.baseColorFactor=[d.diffuse[0],d.diffuse[1],d.diffuse[2],1]),d.doubleSided!=null&&(r.doubleSided=d.doubleSided,r.cullFace=d.doubleSided?T.None:T.Back),d.cullFace!=="none"&&d.cullFace!=="front"&&d.cullFace!=="back"||(r.cullFace=d.cullFace==="none"?T.None:d.cullFace==="back"?T.Back:T.Front),d.transparency&&(r.metallicRoughness.baseColorFactor[3]=St(1-d.transparency,0,1)),(d.useVertexColorAlpha||r.metallicRoughness.baseColorFactor[3]<1)&&(r.alphaMode="blend")}const a=[];if(n!=null){!n.wrap||n.wrap[0]!=="repeat"&&n.wrap[1]!=="repeat"||(r.wrapTextures=!0);let _=w.Color;n.channels==="rgba"&&(r.alphaMode="blend",_|=w.AlphaMask);const h=n.images.length-1,u=n.images[h],m=g=>g&&g.split("/").pop(),c=Array.isArray(n.encoding)?At(n.encoding.map((g,p)=>({name:m(u.href[p]),encoding:bt[g]||0}))):[{name:m(u.href),encoding:bt[n.encoding]||0}];a.push({id:0,usage:_,encodings:c}),r.metallicRoughness.baseColorTextureId=0}return{material:r,textures:a}}const Is=()=>({alphaMode:"opaque",alphaCutoff:Mt,doubleSided:!0,cullFace:T.None,normalTextureId:-1,emissiveTextureId:-1,occlusionTextureId:-1,emissiveFactor:[0,0,0],metallicRoughness:{baseColorFactor:[.8,.8,.8,1],baseColorTextureId:-1,metallicRoughnessTextureId:-1,metallicFactor:0,roughnessFactor:.6},wrapTextures:!1,hasParametersFromSource:!0});function on(i,e,t,s){if(i==null||i.data==null)return null;const n=i.data,r=s.renderingContext.parameters.maxMaxAnisotropy,a=!i.downsampled&&r>1,o=t||!e.wrapTextures?Ds:Ps,l=Os(i.encoding),d=i.usage&w.Color?e.alphaMode==="opaque"?3:4:3;return new Zt(n,{mipmap:a,maxAnisotropy:r,encoding:l,wrap:o,components:d,noUnpackFlip:!0})}const Ds={s:Pe.CLAMP_TO_EDGE,t:Pe.CLAMP_TO_EDGE},Ps={s:Pe.REPEAT,t:Pe.REPEAT};function ln(i,e,t,s,n,r){const a=r.rendererTextureUsage,o=p=>Ms(s,t,p&a),l=e.metallicRoughness.baseColorFactor,d=St(e.metallicRoughness.baseColorFactor[3],0,1);i.baseColor=[l[0],l[1],l[2],d],i.hasParametersFromSource=!!e.hasParametersFromSource,i.usePBR=r.usePBR,i.mrrFactors=[e.metallicRoughness.metallicFactor,e.metallicRoughness.roughnessFactor,e.hasParametersFromSource?Be[2]:He[2]],i.emissiveFactor=e.emissiveFactor,i.isIntegratedMesh=r.isIntegratedMesh,i.textureAlphaCutoff=e.alphaMode==="mask"?e.alphaCutoff:Mt,i.alphaDiscardMode=e.alphaMode==="opaque"?Le.Opaque:e.alphaMode==="mask"?Le.Mask:Le.MaskBlend;const _=[],h=o(w.Color|w.AlphaMask);h!=null&&(i.baseColorTexture=new _e(n,h),_.push(i.baseColorTexture.loadPromise));const u=o(w.MetallicRoughness);u!=null&&(i.metallicRoughnessTexture=new _e(n,u),_.push(i.metallicRoughnessTexture.loadPromise));const m=o(w.Emissive);m!=null&&(i.emissionTexture=new _e(n,m),_.push(i.emissionTexture.loadPromise));const c=o(w.Occlusion);c!=null&&(i.occlusionTexture=new _e(n,c),_.push(i.occlusionTexture.loadPromise));const g=o(w.Normal);return g!=null&&(i.normalTexture=new _e(n,g),_.push(i.normalTexture.loadPromise)),i.commonMaterialParameters.hasSlicePlane=r.slicePlaneEnabled,i.commonMaterialParameters.doubleSided=e.doubleSided,i.commonMaterialParameters.cullFace=e.cullFace,i.ellipsoidMode=Yt(r.viewSpatialReference),Promise.all(_)}function dn(i){const e=!!i.compressedTextureS3TC,t=!!i.compressedTextureETC,s=Ze("disable-feature:i3s-basis")?0:C.Basis|C.KTX2,n=C.JPG|C.PNG,r=s|C.DDS_S3TC;return n|(e?r:0)|(t?s:0)}function Ss(i,e){if(e!=null)return i.find(t=>(t.encoding&e)!=0)}function Ms(i,e,t){if(i==null||t===w.None)return null;for(let s=0;sCs(o,l))}}_load(e,t,s){return this._streamDataController.request(e,t,s)}_loadAttribute(e,t,s){const n=`${this._layerUrl}/nodes/${e.resources.attributes}/attributes/${t.key}/0`;return this._load(n,"binary",s).then(r=>Ki(t,r))}loadAttributes(e,t,s){return ei(t.map(n=>this._loadAttribute(e,n.attributeStorageInfo,s))).then(n=>{const r={};for(let a=0;a=0?this._materialAndTextures[d]:l!=null?ws(l):null,h=_==null?void 0:_.material,u=(_==null?void 0:_.textures)??[],m=`${e.id}`,c=!a&&this._options.loadFeatureData,g=c?await this._loadFeatureData(m,t):null,p=c?Fs(g):Ls(h),f=p==null?As(g):null,b=u.length>0?Ie(this.loadTextures(e,u,t)):null;let v=null,N=null;if(o){v=Fe(await o);const F=Ts(this._defaultGeometrySchema,l);N=Xi(n,F)}const O=b?Fe(await b):null,I=s?Fe(await s):{},S=I?{attributeData:I,loadedAttributes:this._requiredAttributes}:null;if(p!=null)return{geometryData:p,attributeDataInfo:S,geometryBuffer:v,geometryDescriptor:N,requiredTextures:u,textureData:O};if(f!=null)return{pointData:f,attributeDataInfo:S,geometryBuffer:v,geometryDescriptor:N,requiredTextures:u,textureData:O};throw new Error}static _addAbsoluteHrefTexture(e,t){const s=e.textureDefinitions;if(s!=null)for(const n of Object.keys(s))for(const r of s[n].images)Array.isArray(r.href)?r.hrefConcat=r.href.map(a=>it(a,t)):r.hrefConcat=it(r.href,t)}static _fixTextureEncodings(e){const t=e.textureDefinitions;if(t!=null)for(const s in t){const n=t[s];if(Array.isArray(n.encoding))for(let r=0;r(Se._fixTextureEncodings(n),Se._addAbsoluteHrefTexture(n,s),n))}_loadTexture(e,t,s,n,r,a){let o=!1;return r===C.DDS_S3TC||r===C.KTX2||r===C.Basis?this._load(e,"binary",a).then(l=>({id:t,usage:s,data:l,encoding:r,downsampled:o})):this._load(e,"image",a).then(l=>{let d=l;const _=4096,h=2;if(n&&l.width*l.height>=_){const u=Math.ceil(l.width/h),m=Math.ceil(l.height/h),c=document.createElement("canvas");c.width=u,c.height=m,c.getContext("2d").drawImage(l,0,0,u,m),d=c,o=!0}return{id:t,usage:s,data:d,encoding:r,downsampled:o}})}loadTextures(e,t,s){const n=!!this._options.uncompressedTextureDownsamplingEnabled,r=this._options.textureUsageMask;return Promise.all(t.map(a=>{if(!(a.usage&r))return null;const o=Ss(a.encodings,this._options.textureEncodings);if(o==null)return this._logger.error("#loadTextures",this._logLayer,`No known encoding for texture found on node ${e.id}`),Promise.reject();const l=e.resources.texture||e.id,d=`${this._layerUrl}/nodes/${l}/textures/${o.name}`;return this._loadTexture(d,a.id,a.usage,n,o.encoding,s)}))}_loadFeatureData(e,t){const s=`${this._layerUrl}/nodes/${e}/features/0`;return this._load(s,"json",t)}_loadGeometry(e,t,s){const n=`${this._layerUrl}/nodes/${e}/geometries/${t}`;return this._load(n,"binary",s)}}function Ls(i){return{featureIds:[],geometries:[{type:"ArrayBufferView",params:{material:i}}],featureDataPosition:[0,0,0]}}function Fs(i){if(!i)return null;for(const e of i.featureData){const t=e.geometries;if(t!=null)for(const s of t)return{featureIds:[e.id],featureDataPosition:e.position,geometries:[s]}}return null}function As(i){if(!i)return null;const e=new Array;for(const t of i.featureData)t.position!=null&&e.push({featureIds:[t.id],featureDataPosition:t.position,geometries:[]});return e}function Ts(i,e){if(!i||!e||!e.materialDefinitions)return i;const t=Object.keys(e.materialDefinitions)[0];return!e.materialDefinitions[t].params.vertexRegions&&i.vertexAttributes.region&&delete(i=ti(i)).vertexAttributes.region,i}function Rs(i,e){const t={bufferDefinition:null,bufferIndex:0},s=e.resources.geometryDefinition;if(i==null||s==null||s<0)return t;const n=s>=0?i[s].geometryBuffers:null;if(n==null)return t;for(let r=0;rn.abort()),a={signal:n.signal,query:{token:this._apiKey}},o=this._requester.request(e,t,a),l={response:o,abortController:n,abortHandle:r};return this._activeRequests.add(l),si(o,()=>{var d;l.abortController=null,(d=l.abortHandle)==null||d.remove(),l.abortHandle=null,this._activeRequests.delete(l)}),o}cancelAll(){this._activeRequests.forEach(e=>{var t,s;(t=e.abortController)==null||t.abort(),e.abortController=null,(s=e.abortHandle)==null||s.remove()}),this._activeRequests.clear()}};const xt=1e5;let Es=class{constructor(e,t,s,n,r,a,o,l,d={}){this._indexSR=e,this._renderCoordsHelper=t,this._clippingArea=r,this._elevationProvider=a,this._viewingMode=o,this._options=d,this._frustum=ni(),this._useFrustumCulling=!1,this._poi=oe(),this._elevationContext=null,this.minDistance=1/0,this.maxDistance=0,this.maxLodLevel=2,this._tmpObb=st(),this._tmp1=oe(),this._tmp2=oe(),this._tmp3=oe(),this._tmp0=oe(),this._screenspaceErrorBias=d.screenspaceErrorBias||1,this._progressiveLoadFactor=d.progressiveLoadFactor||1,this.updateCamera(s,n),this.engineSR=this._renderCoordsHelper.spatialReference,this.updateElevationInfo(l),this._tmpPoint=Ot(0,0,0,e),this._isECEFOBBInLocalMode=this._indexSR.isWGS84&&(this.engineSR.isWebMercator||ri(this.engineSR)),this._indexSREllipsoidRadius=ai(this._indexSR).radius}updateElevationInfo(e){e!=null?(this._elevationContext=oi.fromElevationInfo(e),this._elevationContext.updateFeatureExpressionInfoContext(li(di(e,!1)))):this._elevationContext=null}updateCamera(e,t){this._useFrustumCulling=t,t&&hi(e.viewMatrix,e.projectionMatrix,this._frustum),this._screenSizeFactor=1/(e.perScreenPixelRatio/2),this._camPos=e.eye,this.minDistance=1/0,this.maxDistance=0}setPointOfInterest(e){this._poi=e}updateScreenSpaceErrorBias(e){const t=this._screenspaceErrorBias;return this._screenspaceErrorBias=e,t}updateClippingArea(e){this._clippingArea=e}getElevationRange(e){if(this._elevationContext==null)return null;const t=e.mbs;if(!t)return null;const s=this._elevationContext.mode==="relative-to-scene"?"scene":"ground";if(this._elevationProvider.getSphereElevationBounds)return this._elevationProvider.getSphereElevationBounds(t,this._indexSR);const n=t[0],r=t[1],a=t[2],o=this._elevationProvider.getElevation(n,r,a,this._indexSR,s);return o!=null?{min:o,max:o}:null}getRenderMbs(e){const t=e.renderMbs;if(ji(t))return t;if(e.mbs&&ui(t,e.mbs),this._elevationContext&&e.elevationRange&&Number.isFinite(e.elevationRange.min)){let s=0,n=0;switch(this._elevationContext.mode){case"relative-to-ground":s=this._elevationContext.geometryZWithOffset(t[2],this._renderCoordsHelper)+e.elevationRange.min-t[2],n=e.elevationRange.max-e.elevationRange.min;break;case"on-the-ground":s=e.elevationRange.min-t[2],n=e.elevationRange.max-e.elevationRange.min}t[2]+=s+.5*n,t[3]+=.5*n}else this._elevationContext&&t[3]n>s)?null:(e.serviceObbInRenderSR=this._computeRenderObb(t,e.serviceObbInRenderSR,e.mbs[3],e.elevationRange),e.serviceObbInRenderSR)}_computeRenderObb(e,t,s,n){if(t==null)t=st();else if(_t(t))return t;let r=0,a=0;if(this._elevationContext&&n!=null&&Number.isFinite(n.min))switch(this._elevationContext.mode){case"relative-to-ground":r=this._elevationContext.geometryZWithOffset(e.center[2],this._renderCoordsHelper)+n.min-e.center[2],a=n.max-n.min;break;case"on-the-ground":r=n.min-e.center[2],a=n.max-n.min}else this._elevationContext&&s0?(mt(e,this._indexSR,this._tmpObb,this.engineSR,r),ci(this._tmpObb,0,a,this._viewingMode,t)):mt(e,this._indexSR,t,this.engineSR,r),t}isNodeVisible(e){const t=this.getRenderMbs(e);if(!this._isMBSinClippingArea(t))return!1;if(!this._useFrustumCulling)return!0;const s=this.getVisibilityObb(e);return s!=null?rt(s,this._frustum):_i(this._frustum,mi(t))}isGeometryVisible(e){if(!this._useFrustumCulling)return!0;const t=e.geometryObb;return t!=null?rt(t,this._frustum):this.isNodeVisible(e)}_isMBSinClippingArea(e){return this._clippingArea==null||Bi(this._clippingArea,e)!==Hi.OUTSIDE}_screenSpaceDiameterMbs(e,t){const s=this.getRenderMbs(e),n=Math.sqrt(at(s,this._camPos)),r=n-s[3];return this._updateMinMaxDistance(n),r<0?.5*Number.MAX_VALUE:t/r*this._screenSizeFactor}calcCameraDistance(e){return this.calcCameraDistanceToCenter(e)-this.getRenderMbs(e)[3]}calcCameraDistanceToCenter(e){const t=this.getRenderMbs(e),s=le(t,this._camPos);return this._updateMinMaxDistance(s),s}calcAngleDependentLoD(e){const t=this.getRenderMbs(e),s=t[3],n=(Math.abs(t[0]*(t[0]-this._camPos[0])+t[1]*(t[1]-this._camPos[1])+t[2]*(t[2]-this._camPos[2]))/ee(t)+s)/le(t,this._camPos);return Math.min(1,n)}hasLOD(e){return e.lodMetric!==L.None}_getDistancePlanarMode(e,t){const s=e[0]-t[0],n=e[1]-t[1],r=e[2]-t[2],a=s*s+n*n,o=t[3];if(a<=o*o)return Math.abs(r);const l=Math.sqrt(a)-o;return Math.sqrt(r*r+l*l)}_getDistanceGlobeMode(e,t){const s=ee(t),n=ee(e)-s;de(this._tmp0,e,Ae(e,t)/gi(e));const r=at(t,this._tmp0),a=t[3];if(r<=a*a)return Math.abs(n);{const o=de(this._tmp0,t,1/s),l=s,d=a*a/2/l,_=de(this._tmp1,o,l-d),h=e,u=Te(this._tmp2,h,_),m=Te(this._tmp2,u,de(this._tmp3,o,Ae(o,u))),c=fi(this._tmp2,_,de(this._tmp2,m,a/ee(m)));let g=le(h,c);if(n>=2e5){const p=Te(this._tmp1,h,c);let f=Ae(p,o)/ee(p);f<.08&&(f=1e-4),g/=f}return g}}_getDistance(e,t){return this.engineSR===pi(this.engineSR)?this._getDistanceGlobeMode(e,t):this._getDistancePlanarMode(e,t)}_updateMinMaxDistance(e){e>0?(this.minDistance=Math.min(this.minDistance,e),this.maxDistance=Math.max(this.maxDistance,e)):(this.minDistance=0,this.maxDistance=Math.max(this.maxDistance,-e))}getLodLevel(e){if(e.lodMetric===L.None)return 0;if(e.childCount===0)return this.maxLodLevel;if(this._useFrustumCulling&&this._progressiveLoadFactor<1){const t=this._progressiveLoadFactor*this._screenspaceErrorBias,s=this._screenspaceErrorBias;return this.evaluateLODmetric(e,t)?this.evaluateLODmetric(e,s)?2:1:0}return this.evaluateLODmetric(e,this._screenspaceErrorBias)?this.maxLodLevel:0}evaluateLODmetric(e,t){switch(e.lodMetric){case L.ScreenSpaceRelative:{const s=this.getRenderMbs(e),n=this._getDistance(this._camPos,s),r=2*n/this._screenSizeFactor,a=n+s[3];return this._updateMinMaxDistance(a),e.maxError*t<=r}case L.MaxScreenThreshold:{let s=this._screenSpaceDiameterMbs(e,e.mbs[3]*t);return this._options.angleDependentLoD&&(s*=this.calcAngleDependentLoD(e)),se.maxError*t}return!1}distToPOI(e){const t=this.getRenderMbs(e);return le(t,this._poi)-t[3]}distCameraToPOI(){return le(this._camPos,this._poi)}};const Tt="esri.layers.graphics.controllers.I3SOnDemandController",Y=Qe.getLogger(Tt),$s=100,vt=2,Ct=1e4,qe=1e-4,Vs=1.2,Gs=500,ks=1.5;let D=class extends bi(We){get isMeshPyramid(){var i;return this.layer.profile==="mesh-pyramids"||((i=this.layer.store)==null?void 0:i.lodType)==="MeshPyramid"}get isGraphics3D(){return this.layer.profile==="points"}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&(this.layer.priority==null||this.layer.priority==="High")}get indexStreamController(){const i=this.layerView.view.resourceController.createStreamDataRequester(ot.I3S_INDEX);return new yt(i,this.layer.apiKey)}get dataStreamController(){const i=this.layerView.view.resourceController.createStreamDataRequester(ot.I3S_DATA);return new yt(i,this.layer.apiKey)}get crsVertex(){return Qi(this.layer)}get crsIndex(){return zi(this.layer)}get layer(){return this.layerView.i3slayer}get running(){return this.updating}get rootNodeVisible(){if(this._index!=null){const i=this._index.rootNode;if(i!=null)return this._updateViewData(),this._index.isNodeVisible(i.index)}return!0}get index(){return this._index}constructor(i){super(i),this.screenSizeFactor=0,this.featureTarget=5e4,this.fixedFeatureTarget=!1,this.updating=!0,this.updatingProgress=1,this.leavesReached=!1,this.scaleVisibilityEnabled=!0,this.worker=null,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._idleStateCallbacks=null,this._newLoadingNodes=new E({deallocator:null}),this._loadedNodeScales=new Map,this._modificationsNodeFilteringArray=new E,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._handles=new yi,this._idleQueue=new xi,this._elevationUpdateNodes=new E({deallocator:null}),this._errorCount=0}initialize(){const{layerView:i,layer:e}=this;this._disableMemCache=!i.loadCachedGPUData||!i.addCachedGPUData,this._lodHandling=new vs(i),this._defaultGeometrySchema=e.store.defaultGeometrySchema,this.disableIDBCache=Ze("disable-feature:idb-cache"),"fields"in e&&(this._fields=e.fields,this._attributeStorageInfo=e.attributeStorageInfo),this.addResolvingPromise(Promise.all([e.indexInfo,e.when(),i.when()]).then(([t])=>{if(this.destroyed||!i||i.destroyed||!t)return;const{view:s,clientGeometry:n}=i,{resourceController:r}=s;if(this._setClippingArea(s.clippingArea),this.addHandles([A(()=>{var a,o;return(o=(a=s==null?void 0:s.pointsOfInterest)==null?void 0:a.focus)==null?void 0:o.renderLocation},a=>this._pointOfInterestChanged(a),ze),A(()=>r.memoryController.memoryFactor,()=>this._setCameraDirty(),vi),A(()=>i.contentVisible,a=>{const o=a?()=>this._updateIdleState(!0):()=>this._updateViewData(),l=a?()=>this._updateIdleState(!1):()=>{};a&&this._index!=null&&this._index.invalidateAllElevationRanges(),this._idleStateCallbacks?(a||this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=o,this._idleStateCallbacks.idleEnd=l):this._idleStateCallbacks=r.scheduler.registerIdleStateCallbacks(o,l)},ze),us(i.view.resourceController.scheduler,this),A(()=>i.uncompressedTextureDownsamplingEnabled,()=>this.restartNodeLoading()),A(()=>[this.featureTarget,this.fixedFeatureTarget],()=>{this._setCameraDirty(),this._stableFeatureLOD=!1}),A(()=>{var a;return(a=s.state)==null?void 0:a.contentCamera},()=>this._setCameraDirty()),A(()=>e.elevationInfo,a=>this._elevationInfoChanged(a)),A(()=>e.effectiveScaleRange,()=>this._scaleBoundsChanged()),A(()=>i.lodFactor,()=>this._setCameraDirty()),A(()=>i.availableFields,()=>this._requiredFieldsChange()),A(()=>i.holeFilling,a=>this._index!=null&&(this._index.holeFilling=a))]),this._updateScaleHandles(),this._viewportQueries=new Es(this.crsIndex,s.renderCoordsHelper,s.state.contentCamera,!s.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?s.basemapTerrain:s.elevationProvider,Ci(s.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new ss(this.layer.uid,this.crsIndex,s.renderCoordsHelper.spatialReference,s.state.viewingMode,s.resourceController.memoryController,this.worker),this._index=new cs(e,t,this.indexStreamController,this._clientNodeLoader,this._viewportQueries,Y,i.holeFilling,a=>i.isNodeLoaded(a),a=>i.isNodeReloading(a),a=>this._shouldLoadNode(a),a=>this._enableFromGPUCache(a,te.Leaf),a=>this._needsUpdate(a),()=>!this.indexStreamController.busy,a=>i.computeVisibilityObb?i.computeVisibilityObb(a):null,i!=null&&i.computeNodeFiltering?a=>i.computeNodeFiltering(a):void 0),this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D),this._index.imModificationsChanged(!!i.hasModifications),this._index.layerFilterChanged(!!i.hasGeometryFilter),n!=null){for(const a of n)this._addMesh(a.mesh,a.oid);this.addHandles(n.on("change",a=>{for(const o of a.removed)this._removeMesh(o.oid);for(const o of a.added)this._addMesh(o.mesh,o.oid)}))}this._startNodeLoading()})),this._tmpPoint=Ot(0,0,0,this.crsIndex)}updateNodeModificationStatus(i){const e=this._index,t=this.layerView;e!=null&&(t!=null&&t.updateNodeModificationStatus)&&(this._modificationsNodeFilteringArray.clear(),i.forAll(s=>{const n=e.getNode(s);n!=null&&this._modificationsNodeFilteringArray.push(n)}),t.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._handles.destroy(),this._nodeLoader=null,$.prune(),Ue!=null&&(Ue.hide(),Ue=null)}_getRequiredAttributes(){if(this._attributeStorageInfo==null||!this._fields||!this.layerView.availableFields)return[];const i=this._attributeStorageInfo,e=this._fields,t=this.layer.objectIdField;return this.layerView.availableFields.map(s=>{const n=Je(i,s),r=Je(e,s);return n>=0&&r>=0?{index:n,name:e[r].name,field:e[r],attributeStorageInfo:i[n]}:null}).filter(s=>s!=null&&s.name!==t)}_requiredFieldsChange(){const i=this._getRequiredAttributes();je(this._requiredAttributes,i)||(this._requiredAttributes=i,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(i){const e=Lt();Ni(i,e,this.layerView.view.renderSpatialReference)?this._clippingArea=e:this._clippingArea=null}_pointOfInterestChanged(i){this._viewportQueries!=null&&(this._viewportQueries.setPointOfInterest(i),this._index!=null&&(this._index.progressiveLoadPenalty=Nt.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(i){this._setClippingArea(i),this._viewportQueries!=null&&this._index!=null&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}_addMesh(i,e){if(this._index==null)return;const t=this._clientNodeLoader.createMeshNodeInfo(i,e),s=this._index.addClientNodeToIndex(t.id,t.mbs);this._clientNodeLoader.addMeshNode(s,t),this._evaluateUpdating(),this.notifyChange("rootNodeVisible")}_removeMesh(i){const e=this._clientNodeLoader.getMeshNodeIndex(i);if(e!=null){if(this._index==null)throw new Error("delayed removal of client side i3s node geometry not supported yet.");{const t=(n,r)=>{var a,o,l,d;this.layerView.removeNode(r),this._loadedNodeScales.delete(r),this._clientNodeLoader.removeNode(n),this.layerView.deleteCachedNodeData&&n!=null&&this.layerView.deleteCachedNodeData(n),(d=(l=this.layerView).deleteCachedGPUData)==null||d.call(l,(o=(a=this.layerView).loadCachedGPUData)==null?void 0:o.call(a,r))},s=(n,r,a)=>{this._clientNodeLoader.updateNodeIndex(n,r,a),this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(r,a)};this._index.removeClientNodeFromIndex(e,t,s),this.notifyChange("rootNodeVisible")}}}updateElevationChanged(i,e){const t=this._index;if(t==null||t.rootNode==null||e==null)return null;this.crsIndex.equals(e)||(lt(i,e,we,this.crsIndex),i=we);const s=this._elevationUpdateNodes;return s.clear(),Ji(i,t.rootNode,t,n=>s.push(n.index)),s.length&&(s.forAll(n=>t.updateElevationChanged(n)),this._setCameraDirty()),s}removeAllGeometryObbs(){this._index!=null&&this._index.removeAllGeometryObbs()}getRenderMbs(i){return this._viewportQueries!=null?this._viewportQueries.getRenderMbs(i):null}_elevationInfoChanged(i){this._index!=null&&(this._index.updateElevationInfo(i,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}_updateScaleHandles(){const i="scale-bounds";this._handles.remove(i),this._areScaleBoundsActive&&this._handles.add(this.layerView.view.basemapTerrain.on("scale-change",e=>this._scaleUpdateHandler(e)),i)}_scaleBoundsChanged(){this._areScaleBoundsActive||this._loadedNodeScales.clear(),this._updateScaleHandles(),this._setCameraDirty()}_scaleUpdateHandler(i){this._updateScaleInBoundingRect(i.extent,i.spatialReference),this._setCameraDirty()}_updateScaleInBoundingRect(i,e){const t=this._index;t!=null&&t.rootNode!=null&<(i,e,we,this.crsIndex)&&this._loadedNodeScales.forEach((s,n)=>{const r=t.getNode(n);r!=null&&wi(we,r.mbs)&&this._loadedNodeScales.set(n,this._computeScale(r))})}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateUpdating()}schedule(i,e){return this._idleQueue.push(i,e)}reschedule(i,e){return this._idleQueue.unshift(i,e)}get _isIntegratedMesh(){return this.layer.type==="integrated-mesh"}get _areScaleBoundsActive(){const{minScale:i,maxScale:e}=dt(this.layer);return this.scaleVisibilityEnabled&&(i>0||e>0)}get unloadedMemoryEstimate(){return this._index!=null&&this.layerView.contentVisible?this._index.unloadedMemoryEstimate*this._lodDropFactor:0}async _loadNodeData(i,e){return(i.index<0?this._clientNodeLoader:this._nodeLoader).loadNodeData(i,e)}async _loadAttributes(i,e,t){return(i.index<0?this._clientNodeLoader:this._nodeLoader).loadAttributes(i,e,t)}get indexDepth(){return this._index!=null?this._index.maxLevel:0}set disableMemCache(i){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData||(this._disableMemCache=!0),this._disableMemCache=i}runTask(i,e){return this.layerView.contentVisible?this.layerView.visible&&this._index!=null?(this._processWithErrorLogging(i,e),this._index.maxPriority):-1/0:(this._updateViewData(),this._evaluateUpdating(),-1/0)}_processWithErrorLogging(i,e){try{this._process(i,e)}catch(t){this._errorCount<50?Y.error("Error during processing: "+t):this._errorCount===50&&Y.error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(i,e){this._restartNodeLoading&&this._startNodeLoading(),this._nodeLoader!=null&&this._index!=null&&(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(i)&&(this._invisibleDirty=!1),this._isIntegratedMesh&&(i.enabled=!1),i.run(()=>this._processIndex(i)),this._updateFeatureLOD(),i.run(()=>this._processCache(i)),this._isIntegratedMesh&&(i.enabled=!0),i.run(()=>this._processNodes(i,e)),this._idleQueue.runTask(i),i.run(()=>this._prefetchIndex()),e.numIndexLoading+=this._index.indexLoading,e.numNodesLoading+=this._downloadingCount,i.run(()=>this._lodHandling.lodGlobalHandling(i)),this._evaluateUpdating())}_processIndex(i){if(this._index==null)return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update(Array.from(this._loadingNodes.keys()),i,t=>this.updateNodeModificationStatus(t)),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const e=this._index.featureEstimate.leavesReached;this._index.isLoading||e===this._get("leavesReached")||this._set("leavesReached",e)}return this._index.load()}_prefetchIndex(){return!(this._index==null||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.useMaximumNumberOfFeatures||this._index==null||this._viewportQueries==null)return;const i=!this._index.isLoading,e=this.featureTarget*this._baseLOD,t=this._index.featureEstimate;if(t.estimate=t.estimate||e/2,this._index.indexMissing>Gs){if(this._featureLOD<=qe)return;this._featureLOD/=ks,this._stableFeatureLOD=!1}else if(i&&t.estimate=Ct||this._stableFeatureLOD)return;const s=Math.min(10,Math.max(e/t.estimate,1.001));this._featureLOD*=s;const n=this._lod,r=this._index.checkFeatureTarget(e,n);r!==n&&(this._featureLOD=r/this._baseLOD,this._stableFeatureLOD=!0)}else{if(!(t.estimate>e*Vs||i&&t.estimate>e)||this._featureLOD<=qe)return;this._featureLOD/=1+.25*(t.estimate/e-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(Ct,Math.max(qe,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.requestUpdate()}_processCache(i){const e=this._index;if(e==null)return!1;for(;this._newLoadingNodes.length>0&&!i.done;){const t=this._newLoadingNodes.pop();for(let s=e.getParent(t);s!=null&&!this.layerView.isNodeLoaded(s.index)&&this._isNodeInScaleBounds(s);s=e.getParent(s.index))if(this._enableFromGPUCache(s,te.Hole)){i.madeProgress();break}}return i.hasProgressed}_processNodes(i,e){if(this._index==null)return!1;let t=(this._isIdle?$s:vt)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!i.done;)this.layerView.removeNode(s.remove.pop()),i.madeProgress();for(;s.update.length>0&&!i.done;){const n=this._index.getNode(s.update.pop());n!=null&&(this._updateLoadedNode(n),i.madeProgress())}for(;s.add.length>0&&!i.done&&t>0;){--t;const n=this._index.getNode(s.add.back());if(n==null||n.cacheState!==ue.Cached&&!this._hasNodeLoadToken(e))break;s.add.pop(),this._loadNode(n),i.madeProgress()}return i.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach(i=>i.abort()),this._loadingNodes.clear(),this._updatingNodes.forEach(i=>i.abort()),this._updatingNodes.clear()}_cancelNode(i){const e=this._loadingNodes.get(i);e&&(e.abort(),this._loadingNodes.delete(i))}_hasNodeLoadToken(i){return!(!this._isIdle&&i.numNodesLoading+this._loadingNodes.size>=vt)&&this._downloadingCount0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.running||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||this._index!=null&&this._index.isPrefetching),t===0&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(t,this._progressMaxNumNodes),e=1-t/this._progressMaxNumNodes}else i=this._cameraDirty,e=i?0:1;this.updating=i,this.updatingProgress=e}}_updateViewData(){if(!this._cameraDirty||this._index==null||this._viewportQueries==null)return;const i=this.layerView.view,{contentCamera:e,fixedContentCamera:t}=i.state;this.screenSizeFactor=1/(e.perScreenPixelRatio/2),this._viewportQueries.updateCamera(e,!t||this.isGraphics3D),this._viewportQueries.setPointOfInterest(i.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=Nt.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.resourceController.memoryController.memoryFactor<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){const i=this.layerView.lodFactor,e=this.layerView.view.resourceController.memoryController.memoryFactor;return this.fixedFeatureTarget?1:(i>0?i:1)*e}get _lodDropFactor(){if(this.fixedFeatureTarget)return 1;const i=this.layerView.view.resourceController.memoryController;return(Math.min(i.memoryFactor,.5)-i.minQuality)/(.5-i.minQuality)}isGeometryVisible(i){return this._index!=null&&this._index.isGeometryVisible(i.index)}updateVisibility(i){this._index!=null&&this._index.invalidateNodeVisibilityCache(i)}invalidateGeometryVisibility(i){this._index!=null&&this._index.invalidateGeometryVisibility(i)}invalidateVisibilityObbs(){this._index!=null&&this._index.invalidateVisibilityObbs()}modificationsChanged(){this._index!=null&&this._index.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(i){return!(!this._lodHandling.shouldLoadNode(i)||this._shouldDropNode(i))&&!(this._index==null||!this._index.isGeometryVisible(i.index))&&this._isNodeInScaleBounds(i)}_shouldDropNode(i){if(this._viewportQueries==null)return!1;const e=this._lodDropFactor;return e>=1||!this._lodHandling.hasNoVisibleChildren(i)?!1:Math.abs(this._viewportQueries.calcCameraDistanceToCenter(i))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*e}_startNodeLoading(){this._restartNodeLoading=!1;const i=this._index;if(this._updatesDisabled||i==null||this._viewportQueries==null)return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const e={textureEncodings:this.layerView.supportedTextureEncodings,uncompressedTextureDownsamplingEnabled:this.layerView.uncompressedTextureDownsamplingEnabled,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new Se(this.layer,this.dataStreamController,Y,this._defaultGeometrySchema,this._requiredAttributes,e),i.requestUpdate(),this._lodHandling.startNodeLoading(t=>this._isNodeInScaleBounds(t),(t,s)=>this._removeNodes(t,s,se.fadeout),i,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateUpdating()}isNodeLoading(){return this._nodeLoader!=null&&this._index!=null}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateUpdating())}_removeInvisibleNodes(i){const e=this._index;if(e==null||this._viewportQueries==null)return!1;$.clear(),this.layerView.getLoadedNodeIndices($);const t=this._viewportQueries.maxDistance===0,s=t?()=>!1:n=>this._shouldDropNode(n);return $.filterInPlace(n=>{const r=e.getNode(n);return r==null||!e.isGeometryVisible(n)||s(r)||!this._isNodeInScaleBounds(r)}),$.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes($,i,se.pop),!(t&&this._lodDropFactor<1)&&($.length===0||($.clear(),!1))}markNodeToRemove(i){$.push(i)}removeMarkedNodes(){this._removeNodes($,Di,se.pop)}_removeNodes(i,e,t){const s=i.length;if(s!==0&&!e.done){for(this._index!=null&&this._index.requestUpdate();i.length>0&&!e.done;){const n=i.pop(),r=this._index;t===se.fadeout&&this.layerView.nodeFadeoutEnabled&&r!=null&&r.isGeometryVisible(n)?this.layerView.fadeNode(n,fe.FadeOut,!0):this.layerView.removeNode(n),e.madeProgress()}if(this._loadedNodeScales.size>0)for(let n=i.length;nthis.layerView.updateAttributes(i.index,{loadedAttributes:this._requiredAttributes,attributeData:s},e.signal),e.signal)}catch(t){if(!Q(t))return this.layerView.updateAttributes(i.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},e.signal)}this._updatingNodes.delete(i.index),this._evaluateUpdating()}_loadNode(i){if(this._loadingNodes.has(i.index))return void Y.error("already loading node "+i.index);const e=new AbortController;this._loadingNodes.set(i.index,e),this._evaluateUpdating(),this._loadAndAddNode(i,e.signal).then(t=>{t&&this._index!=null&&this._loadingNodes.get(i.index)===e&&(this._loadingNodes.delete(i.index),this._index.requestUpdate())}).catch(t=>{if(!Q(t))throw t}).finally(()=>{this._loadingNodes.get(i.index)===e&&this._loadingNodes.delete(i.index),this._evaluateUpdating()})}_loadAndAddNode(i,e){return i.cacheState===ue.Uncached?this._loadUncached(i,e).then(()=>!1):this._loadCached(i,e).then(t=>!t&&(i.cacheState=ue.Uncached,!0)).catch(t=>!Q(t)&&(i.cacheState=ue.Uncached,!0))}_enableFromGPUCache(i,e){if(this._disableMemCache||this._index==null)return!1;if(e===te.Hole&&!this._index.useNodeAsHole(i.index))return!0;const t=this._loadCachedGPUData(i);return!!t&&(this.layerView.addCachedGPUData(i,t,e),this._nodeAdded(),!0)}_loadCachedGPUData(i){const e=this.layerView.loadCachedGPUData(i.index);return e!=null&&e.attributeInfo!=null&&je(e.attributeInfo.loadedAttributes,this._requiredAttributes)?e:(this.layerView.deleteCachedGPUData(e),null)}_nodeAdded(){this._index!=null&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}updateLoadStatus(i,e){const t=this._index;t!=null&&t.updateChildrenLoaded(i,e?1:-1)}async _loadCached(i,e){if(this._enableFromGPUCache(i,te.Leaf))return!0;const t=this.layerView;if(this.disableIDBCache||!t.loadCachedNodeData||!t.addCachedNodeData)return!1;const s=(d,_)=>this._nodeLoader.loadTextures(i,d,_),n=(d,_)=>this._clientNodeLoader.loadTextures(i,d,_),r=i.index>=0?s:n,a=await this.schedule(()=>t.loadCachedNodeData(i,e,r),e);if(a==null)return!1;const o=this._requiredAttributes,l=await this.reschedule(()=>this._loadAttributes(i,o,e),e);return await this.reschedule(()=>t.addCachedNodeData(i,a,{loadedAttributes:o,attributeData:l},e),e),this._nodeAdded(),!0}_loadUncached(i,e){return this._downloadingCount++,this._loadNodeData(i,e).catch(t=>{throw this._downloadingCount--,t}).then(t=>(this._downloadingCount--,this.schedule(()=>this.layerView.addNode(i,t,e),e))).then(()=>{this._nodeAdded(),i.cacheState=ue.Cached}).catch(t=>{if(!Q(t))throw Y.error("#loadNodeData()",this.layer,`Failed to load node '${i.id}'`,t),i.failed=!0,this._index!=null&&this._index.requestUpdate(),t})}_updateIdleState(i){i!==this._isIdle&&(this._isIdle=i,this._evaluateUpdating(),i&&this._index&&this._index!=null&&this._index.resetFailedNodes())}_getScale(i){if(this._loadedNodeScales.has(i.index))return this._loadedNodeScales.get(i.index);const e=this._computeScale(i);return this.layerView.isNodeLoaded(i.index)&&this._loadedNodeScales.set(i.index,e),e}_computeScale(i){this._tmpPoint.x=i.mbs[0],this._tmpPoint.y=i.mbs[1],this._tmpPoint.z=i.mbs[2];const e=i.mbs[3];return this.layerView.view.basemapTerrain.getSphereScale(this._tmpPoint,e)}_isNodeInScaleBounds(i){if(!this._areScaleBoundsActive)return!0;const e=this._getScale(i),{minScale:t,maxScale:s}=dt(this.layer);return Pi(e,t,s)}updateStats(i){i.index=this._index!=null?this._index.size:0,this.isGraphics3D&&(i.detail=this._featureLOD,i.target=this.featureTarget*this._baseLOD),this._index!=null&&this._index.updateStats(i)}get test(){const i=this;return{index:this._index,set disableUpdates(e){i._updatesDisabled=e,e?i.cancelNodeLoading():i.requestUpdate()},set disableIDBCache(e){i.disableIDBCache=e},set ignoreServiceObb(e){i._index!=null&&(i._index.ignoreServiceObb=e)},shouldLoadNode:e=>i._shouldLoadNode(e)}}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating(),this._index!=null&&this._index.requestUpdate()}geometryFilterChanged(i){const e=this._index;e!=null&&e.layerFilterChanged(i),this._setCameraDirty()}};y([x({readOnly:!0})],D.prototype,"isMeshPyramid",null),y([x({readOnly:!0})],D.prototype,"isGraphics3D",null),y([x({readOnly:!0})],D.prototype,"useMaximumNumberOfFeatures",null),y([x({readOnly:!0})],D.prototype,"indexStreamController",null),y([x({readOnly:!0})],D.prototype,"dataStreamController",null),y([x({readOnly:!0})],D.prototype,"crsVertex",null),y([x({readOnly:!0})],D.prototype,"crsIndex",null),y([x()],D.prototype,"screenSizeFactor",void 0),y([x()],D.prototype,"featureTarget",void 0),y([x()],D.prototype,"fixedFeatureTarget",void 0),y([x()],D.prototype,"layerView",void 0),y([x()],D.prototype,"layer",null),y([x()],D.prototype,"updating",void 0),y([x({readOnly:!0})],D.prototype,"running",null),y([x()],D.prototype,"updatingProgress",void 0),y([x({readOnly:!0})],D.prototype,"leavesReached",void 0),y([x({constructOnly:!0})],D.prototype,"scaleVisibilityEnabled",void 0),y([x({constructOnly:!0})],D.prototype,"worker",void 0),y([x({readOnly:!0,dependsOn:[]})],D.prototype,"rootNodeVisible",null),D=y([Xe(Tt)],D);const $=new E({deallocator:null});let Ue;function je(i,e){return i!=null&&i.length===e.length&&i.every(t=>Je(e,t.name)>=0)}function Je(i,e){const t=e.toLowerCase();for(let s=0;s0&&(this._set.clear(),this._observable.notify())}delete(e){const t=this._set.delete(e);return t&&this._observable.notify(),t}entries(){return j(this._observable),this._set.entries()}forEach(e,t){j(this._observable),this._set.forEach((s,n)=>e.call(t,s,n,this),t)}has(e){return j(this._observable),this._set.has(e)}keys(){return j(this._observable),this._set.keys()}values(){return j(this._observable),this._set.values()}[Symbol.iterator](){return j(this._observable),this._set[Symbol.iterator]()}get[Symbol.toStringTag](){return this._set[Symbol.toStringTag]}}async function qs(i,e,t){e=e.clone(),i.capabilities.query.supportsMaxRecordCountFactor&&(e.maxRecordCountFactor=Et(i));const s=Rt(i),n=i.capabilities.query.supportsPagination;e.start=0,e.num=s;let r=null;for(;;){const a=await i.source.queryFeaturesJSON(e,t);if(r==null?r=a:r.features=r.features.concat(a.features),r.exceededTransferLimit=a.exceededTransferLimit,!n||!a.exceededTransferLimit)break;e.start+=s}return r}function Rt(i){return Et(i)*Us(i)}function Us(i){return i.capabilities.query.maxRecordCount||2e3}function Et(i){return i.capabilities.query.supportsMaxRecordCountFactor?Wi.MAX_MAX_RECORD_COUNT_FACTOR:1}const Ke="esri.views.3d.layers.i3s.I3SOverrides";let P=class extends We{constructor(i){super(i),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=Hs,this._original3DOFLDefinitionExpression=null,this._interactiveEditingSessions=new ht,this.geometryOverrides=new ht,this._clientGeometryCache=new Map,this._associatedLayerView=null,this._attributeChangedObjectIds=new wt,this._geometryChangedObjectIds=new wt,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController,this._pendingAttributeQueriesCache=new Map}initialize(){var i;this._memCache=this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds((i=this._pendingFetchAbortController)==null?void 0:i.signal),this._pendingFetchChangedObjectIds.finally(()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null}),this.is3DOFL&&this._associatedLayer!=null&&(Re()?this._associatedLayer.load().then(e=>{this.destroyed||(this._original3DOFLDefinitionExpression=e.definitionExpression,this.addHandles(A(()=>this._definitionExpression,t=>e.definitionExpression=t,ze)),this._associatedLayerView=new es({layer:this._associatedLayer,view:this.view}))}):k())}destroy(){this.is3DOFL&&this._associatedLayer!=null&&(Re()?this._associatedLayerView!=null&&(this._associatedLayer.definitionExpression=this._original3DOFLDefinitionExpression):k()),this._set("layer",null),this._memCache=Mi(this._memCache),this._pendingFetchAbortController=Oi(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null,this._pendingAttributeQueriesCache.clear()}get is3DOFL(){return ut()&&this._associatedLayer!=null&&this._associatedLayer.infoFor3D!=null}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort((i,e)=>i-e):[]}get _associatedLayer(){return this.layer==null?null:this.layer.associatedLayer}get hasGeometryChanges(){return this._geometryChangedObjectIds.size>0}get _definitionExpression(){const i=this.sortedGeometryChangedObjectIds;return i.length===0?"1 = 0":`OBJECTID IN (${i.join(",")})`}get updating(){return this.is3DOFL?Re()?this._associatedLayerView==null||this._associatedLayerView!=null&&this._associatedLayerView.updating:(k(),!1):!1}get isEmpty(){return this._pendingFetchChangedObjectIds==null&&this._attributeChangedObjectIds.size===0&&this._geometryChangedObjectIds.size===0}featureHasGeometryChanges(i){return this._geometryChangedObjectIds.has(i)}featureHasAttributeChanges(i){return this._attributeChangedObjectIds.has(i)}createInteractiveEditSession(i){this._attributeChangedObjectIds.add(i);const e=ut()&&k()&&this.is3DOFL!=null,t=this._interactiveEditingSessions,s=new js(i,{rollback:()=>{t.remove(s)},commit:(n,r)=>{for(const[a,o]of n)this.updateAttributeValue(i,a,o);e&&r!=null&&this.updateGeometry(i,r)}});return t.unshift(s),s}async applyAttributeOverrides(i,e,t){if(e==null)return;const{loadedAttributes:s,attributeData:n}=e;if(s==null||s.length===0||n==null||(this._pendingFetchChangedObjectIds&&await Li(this._pendingFetchChangedObjectIds,t),this._attributeChangedObjectIds.size===0))return;const r={loadedAttributes:s,attributeData:n},a=this._getOverridesFromCache(i,r,this._attributeChangedObjectIds),{objectIds:o,fieldNames:l}=a;if(o.length===0||l.length===0)return;const d=await this._queryAttributeOverridesFromAssociatedLayer(o,l,t);d!=null&&this._processOverridesFromAssociatedLayer(i,d,l,r)}updateGeometry(i,e){this._geometryChangedObjectIds.add(i);const t=this._clientGeometryCache.get(i);if(t!=null&&(this.geometryOverrides.remove(t),this._clientGeometryCache.delete(i)),e!=null){const s={oid:i,mesh:e};this.geometryOverrides.add(s),this._clientGeometryCache.set(i,s)}}updateAttributeValue(i,e,t){this._attributeChangedObjectIds.add(i),this._cacheAttributeValue(i,e,t)}featureAdded(i){this.is3DOFL&&k()&&this._geometryChangedObjectIds.add(i),this._attributeChangedObjectIds.add(i)}_cacheAttributeValue(i,e,t){this._memCache.put(this._getAttributeCacheKey(i,e),t,this._memCacheAttributeValueSize(t))}_getOverridesFromCache(i,{loadedAttributes:e,attributeData:t},s){const n=new Set,r=new Array;for(const o of e)r[o.index]=t[o.name];const a=new Set;for(let o=0;o(Pt(t),g)).catch(g=>{for(const[p,f]of a)n.delete(p),f.reject(g);throw g}),m=[];for(const g of h)if(g.ok)for(const p of g.value.features){const f=p,b=f.attributes[d];(c=a.get(b))==null||c.resolve(f),n.delete(b),a.delete(b),m.push(f)}for(const g of u)g&&m.push(g);for(const[g,p]of a)n.delete(g),p.resolve(null);return m}async _queryGeometryOverridesFromAssociatedLayer(i,e){if(i.length===0||!this.is3DOFL||!k())return null;this._logWarningIfMaximumObjectsExceeded();const t=this.layer.associatedLayer,{objectIdField:s,globalIdField:n}=t,r=[s,...n!=null?[n]:[]],a=t.createQuery();a.where="1=1",a.returnGeometry=!0,a.outFields=r,a.cacheHint=!0,a.objectIds=i,a.returnZ=t.hasZ,a.returnM=t.hasM;const o=await this._executeBatchQuery(t,i,a,e),l=t.infoFor3D,{spatialReference:d}=t,_=[];for(const h of o){if(!h.ok)continue;const u=h.value,{assetMaps:m,features:c,globalIdFieldName:g}=u;if(m==null)continue;const p=Zi(l,m);for(const f of c){const b=Yi(f,g,d,l,p),v=f;b!=null?(v.geometry=b,_.push(v)):v.geometry=null}}return _}_logWarningIfMaximumObjectsExceeded(){if(!this._warnMaximumChangedObjectsExceeded)return;this._warnMaximumChangedObjectsExceeded=!1;let i=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${Ti(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`;const e=this.layer.portalItem;e&&e.loaded?i+=` (${e.portal.url}/home/item.html?id=${e.id}#settings)`:i+=` (${this.layer.parsedUrl.path})`,Qe.getLogger(Ke).warn("#queryOverrides()",this.layer.title,`${i}.`)}async _executeBatchQuery(i,e,t,s){if(e.length===0)return[];const n=Rt(i);e=[...e].sort((a,o)=>a-o);const r=Ri(e,n).map(a=>{const o=t.clone();return o.objectIds=a,Ei(qs(i,o,{signal:s}))});return Promise.all(r)}_processOverridesFromAssociatedLayer(i,e,t,{loadedAttributes:s,attributeData:n}){const r=this._associatedLayer;if(r==null)return;const a=r.objectIdField,o=t.map(h=>(h in n||(n[h]=new Array(i.length)),n[h])),l=new Map(s.map(h=>[h.name,h.index])),d=t.map(h=>l.get(h)),_=new Map(Array.from(i,(h,u)=>[h,u]));for(const h of e){const u=h.attributes[a];for(let m=0;mI-S);for(let I=0;I0){const I=await this._queryGeometryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),i);if(I!=null)for(const S of I)S.geometry!=null&&this.updateGeometry(S.attributes[t.objectIdField],S.geometry)}}}_getFetchChangedObjectIdsServerGen(){const i=this.layer;if(i.serviceUpdateTimeStamp!=null&&i.serviceUpdateTimeStamp.lastUpdate!=null)return i.serviceUpdateTimeStamp.lastUpdate;const e=i.associatedLayer;return e!=null&&e.serverGens!=null&&e.serverGens.minServerGen!=null?e.serverGens.minServerGen:null}get test(){const i=Array.from(this._attributeChangedObjectIds),e=this._pendingFetchChangedObjectIds,t=this;return{changedObjectIds:i,pendingFetchChangedObjectIds:e,get maximumNumberOfEditOVerrides(){return t._maximumNumberOfEditOVerrides},set maximumNumberOfEditOVerrides(s){t._maximumNumberOfEditOVerrides=s}}}};y([x({constructOnly:!0})],P.prototype,"view",void 0),y([x({constructOnly:!0})],P.prototype,"layer",void 0),y([x({readOnly:!0})],P.prototype,"is3DOFL",null),y([x()],P.prototype,"_interactiveEditingSessions",void 0),y([x({readOnly:!0})],P.prototype,"sortedGeometryChangedObjectIds",null),y([x({readOnly:!0})],P.prototype,"geometryOverrides",void 0),y([x()],P.prototype,"_clientGeometryCache",void 0),y([x()],P.prototype,"_associatedLayer",null),y([x()],P.prototype,"_associatedLayerView",void 0),y([x({constructOnly:!0})],P.prototype,"memoryController",void 0),y([x()],P.prototype,"_attributeChangedObjectIds",void 0),y([x()],P.prototype,"_geometryChangedObjectIds",void 0),y([x()],P.prototype,"hasGeometryChanges",null),y([x()],P.prototype,"_pendingFetchChangedObjectIds",void 0),y([x()],P.prototype,"_pendingFetchAbortController",void 0),y([x()],P.prototype,"_definitionExpression",null),y([x()],P.prototype,"updating",null),y([x()],P.prototype,"isEmpty",null),P=y([Xe(Ke)],P);class js{constructor(e,t){this.objectId=e,this._options=t,this._updates=new Map,this._updatedGeometry=void 0,this._state=ne.ACTIVE}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}getGeometry(){return this._updatedGeometry}setGeometry(e){this.isActive&&(this._updatedGeometry=e)}rollback(){this.isActive&&(this._state=ne.ROLLED_BACK,this._options.rollback(),this._updatedGeometry=void 0)}commit(){this.isActive&&(this._state=ne.COMMITTED,this._options.commit(this._updates,this._updatedGeometry),this._updates.clear(),this._updatedGeometry=void 0)}get isActive(){return this._state===ne.ACTIVE}}var ne;(function(i){i[i.ACTIVE=0]="ACTIVE",i[i.COMMITTED=1]="COMMITTED",i[i.ROLLED_BACK=2]="ROLLED_BACK"})(ne||(ne={}));const Bs=1e4,Hs=5e4;export{P as D,on as F,dn as M,ln as S,fe as a,w as b,C as c,Ss as d,cn as e,Is as f,wt as s}; diff --git a/assets/I3SQueryFeatureStore-0cfa6ebc.js b/assets/I3SQueryFeatureStore-0cfa6ebc.js new file mode 100644 index 0000000..5cf5e99 --- /dev/null +++ b/assets/I3SQueryFeatureStore-0cfa6ebc.js @@ -0,0 +1 @@ +import{bz as ye,ai as c,aj as d,al as W,dw as A,ao as q,cT as he,aw as fe,iU as ge,jC as k,jD as me,c$ as U,bc as z,dY as Ee,be as H,jE as we,jF as Se,e_ as _e,bP as be,gf as Fe,d4 as ie,eT as ve,dE as Ie,bI as Re,jG as Oe,bQ as xe,jH as T,gv as D,dO as N,dS as L,af as je,ah as Z,ca as $e,ar as Y,iY as Qe,bM as B,dz as Me,cu as Ce,g4 as Te,jI as De}from"./index-080e108a.js";import{a as Q,n as X,u as ee}from"./DefinitionExpressionSceneLayerView-66b62d34.js";import{f as Ne}from"./WhereClause-c86b9974.js";import{d as Ge}from"./FeatureFilter-00f4be05.js";import{V as ke,J as Ae,f as te}from"./I3SUtil-2c288808.js";import{e as Je}from"./QueryEngine-19eda5ff.js";import{d as Pe}from"./FeatureSet-111cb247.js";import{b as Ve}from"./Query-1c961d4c.js";import{t as Le}from"./centroid-8e8cfa47.js";import{I as C}from"./I3SMeshView3D-86f2c945.js";const oe="esri.views.3d.layers.i3s.I3SMeshViewFilter",j=ye.getLogger(oe);let f=class extends q{constructor(t){super(t),this._projectionEngineLoaded=!1}initialize(){he(()=>{var t;return((t=this.viewFilter)==null?void 0:t.geometry)||this.layerFilter!=null}).then(()=>this.loadAsyncModule(fe(()=>import("./geometryEngine-5a631b21.js"),["assets/geometryEngine-5a631b21.js","assets/geometryEngineBase-324c1c81.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/hydrated-c10ab4a5.js"]).then(t=>{this.destroyed||(this._geometryEngine=t)})))}get sortedObjectIds(){if(this.viewFilter==null||this.viewFilter.objectIds==null)return null;const t=ge(this.viewFilter.objectIds);return t.sort(),t}get parsedWhereClause(){const t=this.viewFilter!=null?this.viewFilter.where:null;if(t==null||!t)return null;try{return Ne.create(t,this.layerFieldsIndex)}catch(e){j.error(`Failed to parse filter where clause: ${e}`)}return null}addFilters(t,e,r,s){const n=this.sortedObjectIds;n!=null&&t.push(l=>ke(n,!0,l)),this.addSqlFilter(t,this.parsedWhereClause);const i=Q(this._layerMaskGeometries),o=this._geometryEngine;if(i!=null&&this.layerFilter!=null&&o!=null){const l=this.layerFilter.spatialRelationship;t.push((u,h)=>ne(o,u,h,s,e,r,i,l))}const a=Q(this._viewMaskGeometries);if(a!=null&&this.viewFilter!=null&&o!=null){const l=this.viewFilter.spatialRelationship;t.push((u,h)=>ne(o,u,h,s,e,r,a,l))}}isMBSGeometryVisible(t,e,r){const s=Q(this._layerMaskGeometries),n=this._geometryEngine;if(s!=null&&this.layerFilter!=null&&n!=null){const o=this.layerFilter.spatialRelationship,a=s[0].spatialReference||e;return k(t,r,M,a)?re(n,M,s,a,o):(j.warnOnce("SceneLayer.mask geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0)}const i=Q(this._viewMaskGeometries);if(i!=null&&this.viewFilter!=null&&n!=null){const o=this.viewFilter.spatialRelationship,a=i[0].spatialReference||e;return k(t,r,M,a)?re(n,M,i,a,o):(j.warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0)}return!0}get parsedGeometry(){const t=Q(this._viewMaskGeometries),e=Q(this._layerMaskGeometries);return t==null||e==null?t||e:e.concat(t)}get _layerMaskGeometries(){const t=this.layerFilter;return t==null?null:this._geometryEngine==null?X:t.spatialRelationship==="disjoint"?t.geometries.map(e=>({type:"polygon",rings:e.rings,spatialReference:e.spatialReference,cache:{}})):[t.geometries.reduce((e,r)=>(e.rings=[...e.rings,...r.rings],e),{type:"polygon",rings:[],spatialReference:t.geometries[0].spatialReference,cache:{}})]}get _viewMaskGeometries(){if(this.viewFilter==null)return null;const{geometry:t}=this.viewFilter;if(t==null)return null;if(this.viewFilter==null||this._geometryEngine==null)return X;const{distance:e,units:r}=this.viewFilter,s=this.viewFilter.spatialRelationship,n=t.type==="mesh"?t.extent:t;if(e==null||e===0)return G(this._geometryEngine,n,s);const i=r||me(n.spatialReference);if(n.spatialReference.isWGS84){const l=this._geometryEngine.geodesicBuffer(n,e,i);return G(this._geometryEngine,l,s)}const o=U(n,z.WGS84);if(o!=null){const l=U(this._geometryEngine.geodesicBuffer(o,e,i),n.spatialReference);return G(this._geometryEngine,l,s)}if(!this._projectionEngineLoaded&&(this.loadAsyncModule(Ee().then(()=>this._projectionEngineLoaded=!0)),!this._projectionEngineLoaded))return null;let a=null;try{a=H(n,z.WGS84)}catch{}if(a)try{a=H(this._geometryEngine.geodesicBuffer(a,e,i),n.spatialReference)}catch{a=null}return a||j.error(`Filter by geodesic buffer (distance) unsupported, failed to project input geometry (${n.spatialReference.wkid}) to WGS84.`),G(this._geometryEngine,a,s)}get updating(){return ee(this._layerMaskGeometries)||ee(this._viewMaskGeometries)}static checkSupport(t){return t!=null&&(t.timeExtent?(j.warn("Filters with a timeExtent are not supported for mesh scene layers"),!1):!!Be(t.spatialRelationship)||(j.warn(`Filters with spatialRelationship other than ${ae.join(", ")} are not supported for mesh scene layers`),!1))}};c([d()],f.prototype,"layerFilter",void 0),c([d({type:Ge})],f.prototype,"viewFilter",void 0),c([d()],f.prototype,"layerFieldsIndex",void 0),c([d()],f.prototype,"loadAsyncModule",void 0),c([d()],f.prototype,"addSqlFilter",void 0),c([d({readOnly:!0})],f.prototype,"sortedObjectIds",null),c([d({readOnly:!0})],f.prototype,"parsedWhereClause",null),c([d({readOnly:!0})],f.prototype,"parsedGeometry",null),c([d({readOnly:!0})],f.prototype,"_layerMaskGeometries",null),c([d({readOnly:!0})],f.prototype,"_viewMaskGeometries",null),c([d()],f.prototype,"updating",null),c([d()],f.prototype,"_projectionEngineLoaded",void 0),c([d()],f.prototype,"_geometryEngine",void 0),f=c([W(oe)],f);const ae=(t=>t)(["contains","intersects","disjoint"]);function Be(t){return t!=null&&ae.includes(t)}var y;function G(t,e,r){if(e==null)return null;if(r==="disjoint"&&e.type==="polygon"){const s=e.rings.length,n=e.spatialReference,i=new Array(s);for(let l=0;ll.aabr[0]-u.aabr[0]);const o=new Set,a=new xe;for(let l=0;l{if(h>=p.aabr[2])return void o.delete(p);if(u.aabr[1]>p.aabr[3]||u.aabr[3]=.5*(e[2]+Fe(s).radius))return!0;const i=le(t,e,s);return r.every(o=>ue(t,o,i,n)!==y.DISCARD)}function ne(t,e,r,s,n,i,o,a){const l=o[0].spatialReference||n.spatialReference;if(!k(r.node.mbs,i,M,l))return void j.warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter");const u=le(t,M,l),h=Ke(a,n,l,s,r.objectHandle);for(const p of o){if(e.length===0)return;switch(ue(t,p,u,a)){case y.DISCARD:return void(e.length=0);case y.KEEP:continue}Ae(e,r.featureIds,m=>We(t,p,m,h))}}(function(t){t[t.KEEP=0]="KEEP",t[t.DISCARD=1]="DISCARD",t[t.TEST=2]="TEST"})(y||(y={}));const M=ie(0,0,0,0);function Ke(t,e,r,s,n){const i=e.renderSpatialReference,o=new Map,a={type:"polygon",rings:[[[0,0,0],[0,0,0],[0,0,0],[0,0,0]]],spatialReference:r};a.rings[0][3]=a.rings[0][0];const l={indices:null,data:null,stride:0,startIndex:0,endIndex:0};let u,h;switch(t){case"intersects":u=(p,m,b)=>p.intersects(m,b)?y.KEEP:y.TEST,h=K;break;case"contains":u=(p,m,b)=>p.contains(m,b)?y.TEST:y.DISCARD,h=K;break;default:u=(p,m,b)=>p.disjoint(m,b)?y.TEST:y.DISCARD,h=ce}return{collection:s,object:n,type:t,maskSR:r,renderSR:i,aabbCache:o,triangle:a,positions:l,triangleTest:u,geometryTest:h}}function le(t,e,r){const s={type:"point",x:e[0],y:e[1],hasZ:!1,hasM:!1,spatialReference:r},n=!ve(r)&&!Ie(r),i=Number.isNaN(e[3])?0:Re(e[3],0,2*Oe.radius),o=n?t.buffer(s,i,1):t.geodesicBuffer(s,i,1);return o.type="polygon",o}function ue(t,e,r,s){switch(s){case"intersects":case"contains":return K(t,e,r);case"disjoint":return ce(t,e,r)}}function K(t,e,r){return t.intersects(e,r)?t.contains(e,r)?y.KEEP:y.TEST:y.DISCARD}function ce(t,e,r){return t.intersects(e,r)?t.contains(e,r)?y.DISCARD:y.TEST:y.KEEP}function We(t,e,r,s){const{collection:n,object:i,renderSR:o,maskSR:a,geometryTest:l,aabbCache:u}=s;let h=u.get(r);if(!h){const F=n.getObjectTransform(i);n.getComponentAabb(i,r,_);const E=[[_[0],_[1],0],[_[0],_[4],0],[_[3],_[4],0],[_[3],_[1],0]];for(let g=0;g<4;++g)T(E[g],E[g],F.rotationScale),D(E[g],E[g],F.position),N(E[g],o,E[g],a);h={type:"polygon",rings:[E],spatialReference:a,cache:{}},h.rings[0][4]=h.rings[0][0],u.set(r,h)}switch(l(t,e,h)){case y.DISCARD:return!1;case y.KEEP:return!0}const{triangle:p,triangleTest:m,positions:b}=s,I=p.rings[0][0],R=p.rings[0][1],O=p.rings[0][2],$=n.getObjectTransform(i);n.getComponentPositions(i,r,b);const{indices:J,data:S,stride:P,startIndex:de,endIndex:pe}=b;for(let F=de;Fthis.spatialIndex.events.emit("changed")))}destroy(){this._dataQueryEngineInstance=Z(this._dataQueryEngineInstance),this._handles=Z(this._handles),this._set("layerView",null)}async executeQueryForCount(e,r){return this._dataQueryEngine.executeQueryForCount(this._ensureQueryJSON(e),r)}async executeQueryForExtent(e,r){const{count:s,extent:n}=await this._dataQueryEngine.executeQueryForExtent(this._ensureQueryJSON(e),r);return{count:s,extent:$e.fromJSON(n)}}async executeQueryForIds(e,r){return this._dataQueryEngine.executeQueryForIds(this._ensureQueryJSON(e),r)}async executeQuery(e,r){const s=this._ensureQueryJSON(e);if(s.returnGeometry)throw new Y("feature-store:unsupported-query","returnGeometry is not yet supported for mesh scene layer queries");if(s.returnCentroid)throw new Y("feature-store:unsupported-query","returnCentroid is not yet supported for mesh scene layer queries");const n=await this._dataQueryEngine.executeQuery(s,r),i=Pe.fromJSON(n);return i.features.forEach(o=>{o.geometry=null}),i}_ensureQueryJSON(e){return e==null?this.defaultQueryJSON:e.toJSON()}_ensureDataQueryEngine(){var l;if(this._dataQueryEngineInstance)return this._dataQueryEngineInstance;const e=this.layer.objectIdField||Qe,r="esriGeometryPolygon",s=((l=this.layer.fields)==null?void 0:l.map(u=>u.toJSON()))??[],n=this.layerView.view.resourceController.scheduler,i=this.spatialReference.toJSON(),o=this.priority,a=this.spatialIndex;return this._dataQueryEngineInstance=new qe({hasZ:!0,hasM:!1,geometryType:r,fields:s,timeInfo:null,spatialReference:i,objectIdField:e,featureStore:a,scheduler:n,priority:o}),this._dataQueryEngineInstance}};c([d({constructOnly:!0})],v.prototype,"layerView",void 0),c([d({constructOnly:!0})],v.prototype,"priority",void 0),c([d({constructOnly:!0})],v.prototype,"spatialIndex",void 0),c([d()],v.prototype,"spatialReference",null),c([d()],v.prototype,"layer",null),c([d()],v.prototype,"defaultQueryJSON",null),v=c([W("esri.views.3d.layers.i3s.I3SQueryEngine")],v);class lt{constructor(e){this._objectIdField=e.objectIdField,this._getFeatureExtent=e.getFeatureExtent}getObjectId(e){return e.id}getAttributes(e){var o;const{meta:r,index:s}=e,n={};this._objectIdField&&(n[this._objectIdField]=e.id);const i=(o=r.attributeInfo)==null?void 0:o.attributeData;if(i!=null)for(const a of Object.keys(i))n[a]=te(i[a],s);return n}getAttribute(e,r){var o;if(r===this._objectIdField)return e.id;const{meta:s,index:n}=e,i=(o=s.attributeInfo)==null?void 0:o.attributeData;return i!=null?te(i[r],n):null}getGeometry(e){if(e.geometry)return e.geometry;const[r,s,n,i,o]=this._getFeatureExtent(e,se);return new B([5],[r,s,n,i,s,n,i,o,n,r,o,n,r,s,n])}getCentroid(e,r){if(e.geometry)return Le(new B,e.geometry,r.hasZ,r.hasM);const[s,n,i,o,a,l]=this._getFeatureExtent(e,se);return new B([0],[(s+o)/2,(n+a)/2,(i+l)/2])}cloneWithGeometry(e,r){const{id:s,index:n,meta:i}=e;return{id:s,index:n,meta:i,geometry:r}}}const se=A(),Ue=A();let x=class extends q{constructor(t){super(t),this.events=new Ce}forEach(t){this.forAllFeatures(e=>(t(e),C.CONTINUE))}forEachBounds(t,e){const r=this.getFeatureExtent;for(const s of t)e(r(s,Ue))}forEachInBounds(t,e){this.forAllFeatures(r=>{const s=this.getFeatureExtent(r,ze);return Te(t,De(s,He))&&e(r),C.CONTINUE},r=>{if(k(r.node.mbs,this.sourceSpatialReference,w,this.viewSpatialReference),w[0]>=t[0]&&w[2]<=t[2]&&w[1]>=t[1]&&w[3]<=t[3])return C.CONTINUE;const s=Math.max(t[0],Math.min(w[0],t[2])),n=Math.max(t[1],Math.min(w[1],t[3])),i=w[0]-s,o=w[1]-n;return i*i+o*o<=w[3]*w[3]?C.CONTINUE:C.SKIP})}};c([d({constructOnly:!0})],x.prototype,"featureAdapter",void 0),c([d({constructOnly:!0})],x.prototype,"forAllFeatures",void 0),c([d({constructOnly:!0})],x.prototype,"getFeatureExtent",void 0),c([d({constructOnly:!0})],x.prototype,"sourceSpatialReference",void 0),c([d({constructOnly:!0})],x.prototype,"viewSpatialReference",void 0),x=c([W("esri.views.3d.layers.i3s.I3SQueryFeatureStore")],x);const w=ie(0,0,0,0),ze=A(),He=Me();export{f as L,v as d,x as l,lt as o}; diff --git a/assets/I3STreeDebugger-794166fd.js b/assets/I3STreeDebugger-794166fd.js new file mode 100644 index 0000000..7c9fa7f --- /dev/null +++ b/assets/I3STreeDebugger-794166fd.js @@ -0,0 +1 @@ +import{dZ as d,fr as S,fs as o,eG as u,ft as r,ak as y,ai as h,aj as c,al as b,fu as g,dT as j}from"./index-080e108a.js";import{y as v}from"./TileTreeDebugger-142b9f39.js";let p=class extends v{constructor(n){super(n)}getTiles(){const n=this.lv.getVisibleNodes(),t=this.view.renderSpatialReference,i=this.nodeSR;return n.map(l=>m(l,t,i)).filter(d).sort((l,s)=>l.lij[0]===s.lij[0]?l.label>s.label?-1:1:l.lij[0]-s.lij[0])}};function m(n,t,i){const l=n.serviceObb;if(l==null||t==null)return null;S(a,l.quaternion),o(e,l.center),u(e,i,0,e,t,0,1),a[12]=e[0],a[13]=e[1],a[14]=e[2];const s=[[],[],[]];o(e,l.halfSize),r(e,e,a),u(e,t,0,e,i,0,1),s[0].push([e[0],e[1]]),o(e,l.halfSize),e[0]=-e[0],r(e,e,a),u(e,t,0,e,i,0,1),s[0].push([e[0],e[1]]),o(e,l.halfSize),e[0]=-e[0],e[1]=-e[1],r(e,e,a),u(e,t,0,e,i,0,1),s[0].push([e[0],e[1]]),o(e,l.halfSize),e[1]=-e[1],r(e,e,a),u(e,t,0,e,i,0,1),s[0].push([e[0],e[1]]),s[1].push(s[0][0]),s[1].push(s[0][1]),o(e,l.halfSize),e[0]=-e[0],e[2]=-e[2],r(e,e,a),u(e,t,0,e,i,0,1),s[1].push([e[0],e[1]]),o(e,l.halfSize),e[2]=-e[2],r(e,e,a),u(e,t,0,e,i,0,1),s[1].push([e[0],e[1]]),s[2].push(s[0][0]),s[2].push(s[0][3]),o(e,l.halfSize),e[1]=-e[1],e[2]=-e[2],r(e,e,a),u(e,t,0,e,i,0,1),s[2].push([e[0],e[1]]),s[2].push(s[1][3]);const f=new y({rings:s,spatialReference:i});return{lij:[n.level,n.childCount,0],label:n.id,geometry:f}}h([c({constructOnly:!0})],p.prototype,"lv",void 0),h([c({constructOnly:!0})],p.prototype,"nodeSR",void 0),p=h([b("esri.views.3d.layers.support.I3STreeDebugger")],p);const a=g(),e=j();export{p as I3STreeDebugger}; diff --git a/assets/I3SUtil-2c288808.js b/assets/I3SUtil-2c288808.js new file mode 100644 index 0000000..2553a64 --- /dev/null +++ b/assets/I3SUtil-2c288808.js @@ -0,0 +1 @@ +import{ge as X,gf as Y,fu as _,dT as k,dz as $,gg as fe,eE as he,gh as pe,fp as de,at as ye,gi as ge,gj as me,cn as be,gk as Se,ar as b,gl as we,bc as ee,aB as Me,fA as L,gm as v,gn as K,eG as I,dS as T,go as te,fs as A,gp as Te,gq as ne,gr as ae,gs as Ee,eI as re,gt as ve,eJ as oe,gu as j,gv as Ie,gw as xe,gx as P,gy as Re,a$ as Ce,gz as qe,gA as ze,dA as B,dO as J,ft as E,gB as U,g4 as Ne}from"./index-080e108a.js";import{b as ke}from"./Query-1c961d4c.js";import{I as Ae}from"./I3SBinaryReader-2b8e30f7.js";function Oe(e,t,n,a){const r=We(e,t,n),o=_();return X(n,r,o,a),o}const se=1,H=5-se;function We(e,t,n){const a=k(),r=e[3],o=2**(Math.ceil(Math.log(r)*Math.LOG2E/H)*H+se);if(n.isGeographic){const l=o/Y(n).radius*180/Math.PI,u=Math.round(e[1]/l),p=Math.max(-90,Math.min(90,u*l)),h=l/Math.cos((Math.abs(p)-l/2)/180*Math.PI),y=Math.round(e[0]/h)*h;a[0]=y,a[1]=p}else{const l=Math.round(e[0]/o),u=Math.round(e[1]/o);a[0]=l*o,a[1]=u*o}const s=e[2]+t,i=Math.round(s/o);return a[2]=i*o,a}function ie(e){return e?parseInt(e.substring(e.lastIndexOf("/")+1,e.length),10):void 0}function ut(e){var t;if(be("disable-feature:i3s-draco")||!e)return!1;for(const n of e)for(const a of n.geometryBuffers)if(((t=a.compressedAttributes)==null?void 0:t.encoding)==="draco")return!0;return!1}function ft(e,t,n,a){n.traverse(t,r=>{const o=r.mbs;return(o!=null&&Ue(e,o))!==M.OUTSIDE&&(a(r),!0)})}function ht(e,t,n){let a=0,r=0;for(let o=0;o=0===t&&(n[r]=n[a],r++),a++;n.length=r}const x=$();function dt(e,t){if(t.rotationScale[1]===0&&t.rotationScale[2]===0&&t.rotationScale[3]===0&&t.rotationScale[5]===0&&t.rotationScale[6]===0&&t.rotationScale[7]===0)return x[0]=(e[0]-t.position[0])/t.rotationScale[0],x[1]=(e[1]-t.position[1])/t.rotationScale[4],x[2]=(e[2]-t.position[0])/t.rotationScale[0],x[3]=(e[3]-t.position[1])/t.rotationScale[4],x}var M;function Ue(e,t){const n=t[0],a=t[1],r=t[3],o=e[0]-n,s=n-e[2],i=e[1]-a,l=a-e[3],u=Math.max(o,s,0),p=Math.max(i,l,0),h=u*u+p*p;return h>r*r?M.OUTSIDE:h>0?M.INTERSECTS_CENTER_OUTSIDE:-Math.max(o,s,i,l)>r?M.INSIDE:M.INTERSECTS_CENTER_INSIDE}function De(e,t,n){const a=[],r=n&&n.missingFields,o=n&&n.originalFields;for(const s of e){const i=s.toLowerCase();let l=!1;for(const u of t)if(i===u.name.toLowerCase()){a.push(u.name),l=!0,o&&o.push(s);break}!l&&r&&r.push(s)}return a}async function yt(e,t,n,a,r){if(t.length===0)return[];const o=e.attributeStorageInfo;if(e.associatedLayer!=null)try{return await Ge(e.associatedLayer,t,n,a)}catch(s){if(e.associatedLayer.loaded)throw s}if(o){const s=Fe(t,n,r);if(s==null)throw new b("scenelayer:features-not-loaded","Tried to query attributes for unloaded features");const i=e.parsedUrl.path;return(await Promise.all(s.map(l=>_e(i,o,l.node,l.indices,a).then(u=>{for(let p=0;p=0){let h=a.get(u.node);h||(h={node:u.node,indices:[],graphics:[]},r.push(h),a.set(u.node,h)),h.indices.push(p),h.graphics.push(s);for(let y=l;y>0;y--)o[y]=o[y-1];o[0]=u;break}}}return r}async function Ge(e,t,n,a){t.sort((l,u)=>l.attributes[n]-u.attributes[n]);const r=t.map(l=>l.attributes[n]),o=[],s=De(a,e.fields,{originalFields:o}),i=await le(e,r,s);for(let l=0;la){const o=we(t,a);return Promise.all(o.map(s=>le(e,s,n))).then(s=>s.flat())}const r=new ke({objectIds:t,outFields:n,orderByFields:[e.objectIdField]});return e.queryFeatures(r).then(o=>{if(o&&o.features&&o.features.length===t.length)return o.features.map(s=>s.attributes);throw new b("scenelayer:feature-not-in-associated-layer","Feature not found in associated feature layer")})}function _e(e,t,n,a,r){return $e(e,t,n.resources.attributes,a,r)}function $e(e,t,n,a,r){const o=[];for(const s of t)if(s&&r.includes(s.name)){const i=`${e}/nodes/${n}/attributes/${s.key}/0`;o.push({url:i,storageInfo:s})}return de(o.map(s=>ye(s.url,{responseType:"array-buffer"}).then(i=>Ae(s.storageInfo,i.data)))).then(s=>{const i=[];for(const l of a){const u={};for(let p=0;po.url)!==L(t.associatedLayer,o=>o.url))throw new b("layerview:recycle-failed")}function Je(e,t){return e.equals(t)||e.isWGS84&&t.isWebMercator||e.isWebMercator&&t.isWGS84}function He(e,t,n){const a=Pe(e),r=Be(e);F(a,t,n),F(r,t,n)}function Qe(e){return(e.geometryType==null||e.geometryType==="triangles")&&(e.topology==null||e.topology==="PerAttributeArray")&&e.vertexAttributes!=null&&e.vertexAttributes.position!=null}function bt(e){if(e.store==null||e.store.defaultGeometrySchema==null||!Qe(e.store.defaultGeometrySchema))throw new b("scenelayer:unsupported-geometry-schema","The geometry schema of this scene layer is not supported.",{url:e.parsedUrl.path})}function St(e,t){He(e,t.spatialReference,t.viewingMode)}function Ze(e){return e.geometryType!=null&&e.geometryType==="points"&&(e.topology==null||e.topology==="PerAttributeArray")&&(e.encoding==null||e.encoding===""||e.encoding==="lepcc-xyz")&&e.vertexAttributes!=null&&e.vertexAttributes.position!=null}function wt(e){if(e.store==null||e.store.defaultGeometrySchema==null||!Ze(e.store.defaultGeometrySchema))throw new b("pointcloud:unsupported-geometry-schema","The geometry schema of this point cloud scene layer is not supported.",{})}function Mt(e,t){F(e.spatialReference,t.spatialReference,t.viewingMode)}function Ve(e){return e.type==="simple"||e.type==="class-breaks"||e.type==="unique-value"}function Xe(e){return e.type==="mesh-3d"}function Tt(e){if(e==null||!Ve(e)||(e.type==="unique-value"||e.type==="class-breaks")&&e.defaultSymbol==null)return!0;const t=e.getSymbols();if(t.length===0)return!0;for(const n of t){if(!Xe(n)||n.symbolLayers.length===0)return!0;for(const a of n.symbolLayers.items)if(a.type!=="fill"||a.material==null||a.material.color==null||a.material.colorMixMode!=="replace")return!0}return!1}const Et=fe({color:[0,0,0,0],opacity:0});class Ye{constructor(){this.edgeMaterial=null,this.material=null,this.castShadows=!0}}function vt(e){const t=new Ye;let n=!1,a=!1;for(const r of e.symbolLayers.items)if(r.type==="fill"&&r.enabled){const o=r.material,s=r.edges;if(o!=null&&!n){const i=o.color,l=xe(o.colorMixMode);t.material=i!=null?{color:[i.r/255,i.g/255,i.b/255],alpha:i.a,colorMixMode:l}:{color:[1,1,1],alpha:1,colorMixMode:P.Multiply},t.castShadows=r.castShadows,n=!0}s==null||a||(t.edgeMaterial=Re(s,{}),a=!0)}return t.material||(t.material={color:[1,1,1],alpha:1,colorMixMode:P.Multiply}),t}function It(e,t){return(0|e)+(0|t)|0}function et(e,t,n,a,r=0){a===v(a)?t.isGeographic?st(e,n,t,r):ot(e,n,t,r):t.isWGS84&&(a.isWebMercator||K(a))?tt(t,e,a,n,r):t.isWebMercator&&K(a)?rt(t,e,a,n,r):e===n?(n.center[2]+=r,I(n.center,t,0,n.center,a,0,1)):(T(n.center,e.center[0],e.center[1],e.center[2]+r),I(n.center,t,0,n.center,a,0,1),te(n.quaternion,e.quaternion),A(n.halfSize,e.halfSize))}function tt(e,t,n,a,r){A(w,t.center),w[2]+=r;const o=v(n);I(w,e,0,w,o,0,1),ce(o,t,w,n,a)}const N=new Array(24),nt=new Ce(N,3,!0),Q=k(),w=k(),at=qe();function rt(e,t,n,a,r){A(w,t.center),w[2]+=r,ce(e,t,w,n,a)}function ce(e,t,n,a,r){const o=Te(at,t.quaternion);for(let s=0;s<8;++s){for(let i=0;i<3;++i)Q[i]=t.halfSize[i]*(s&1<{if(!i)if(i=G,B(q),e.serviceObb!=null){et(e.serviceObb,n,Z,t,r),ae(Z,i);for(const f of i)E(f,f,z),U(q,f)}else{const f=e.mbs;if(!f)return;const d=f[3];J(f,n,c,t),E(c,c,z),c[2]+=r;for(let g=0;g<8;++g){const R=1&g?d:-d,O=2&g?d:-d,W=4&g?d:-d,C=i[g];A(C,[c[0]+R,c[1]+O,c[2]+W]),U(q,C)}}};let u=1/0,p=-1/0;const h=f=>{if(f.type!=="replace")return;const d=f.geometry;if(!(d!=null&&d.hasZ))return;B(D);const g=d.spatialReference||a,R=d.rings.reduce((O,W)=>W.reduce((C,ue)=>(J(ue,g,c,t),E(c,c,z),U(D,c),Math.min(c[2],C)),O),1/0);l(),Ne(q,D)&&(u=Math.min(u,R),p=Math.max(p,R))};if(o.forEach(f=>h(f)),u===1/0)return null;const y=(f,d,g)=>{E(c,g,s),f[d]=c[0],f[d+1]=c[1],f[d+2]=c[2],d+=24,g[2]=u,E(c,g,s),f[d]=c[0],f[d+1]=c[1],f[d+2]=c[2],d+=24,g[2]=p,E(c,g,s),f[d]=c[0],f[d+1]=c[1],f[d+2]=c[2]};for(let f=0;f<8;++f)y(V.data,3*f,i[f]);return ne(V)}function Rt(e){return e!=null&&e.halfSize[0]>=0}function Ct(e){return e[3]>=0}function qt(e){e!=null&&(e.halfSize[0]=-1)}function zt(e){e!=null&&(e[3]=-1)}const m=_(),S=he(),G=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],D=$(),q=$(),Z=pe(),c=k(),V={data:new Array(72),size:3,exclusive:!0,stride:3},z=_();export{qt as $,Rt as B,et as C,ft as H,ht as J,xt as K,Mt as M,Ct as P,zt as Q,St as T,vt as U,pt as V,dt as Y,ut as Z,Oe as a,We as b,F as d,M as e,je as f,He as g,gt as h,Et as j,It as k,$e as l,Be as m,yt as n,Pe as p,De as r,Ue as t,wt as v,bt as w,Tt as x,mt as y}; diff --git a/assets/IdentityManager-47bd1e1a.js b/assets/IdentityManager-47bd1e1a.js new file mode 100644 index 0000000..332d849 --- /dev/null +++ b/assets/IdentityManager-47bd1e1a.js @@ -0,0 +1,7 @@ +import{ai as m,aj as _,m8 as Be,al as te,m9 as Ve,ma as R,mb as it,mc as Oe,aG as ke,aS as nt,ck as Me,cu as ze,c0 as P,md as Ge,bf as me,cv as re,g9 as Q,ar as C,aP as ot,hc as z,ht as K,at as B,me as se,mf as _e,mg as be,av as Pe,mh as at,bZ as ye,c1 as lt,mi as ct,kN as ie,f3 as Ce,jg as ut,mj as ht}from"./index-080e108a.js";import{e as dt}from"./widget-78e8b6fe.js";const ne="esri-identity-form",F={base:ne,group:`${ne}__group`,label:`${ne}__label`,footer:`${ne}__footer`,esriInput:"esri-input",esriButton:"esri-button",esriButtonSecondary:"esri-button--secondary"},pt="ArcGIS Online";let V=class extends Ve{constructor(e,t){super(e,t),this._usernameInputNode=null,this._passwordInputNode=null,this.signingIn=!1,this.server=null,this.resource=null,this.error=null,this.oAuthPrompt=!1}render(){const{error:e,server:t,resource:r,signingIn:i,oAuthPrompt:s,messages:n}=this,l=R("div",{class:F.group},it(s?n.oAuthInfo:n.info,{server:t&&/\.arcgis\.com/i.test(t)?pt:t,resource:`(${r||n.lblItem})`})),c=s?null:R("div",{class:F.group,key:"username"},R("label",{class:F.label},n.lblUser,R("input",{value:"",required:!0,autocomplete:"off",spellcheck:!1,type:"text",bind:this,afterCreate:Oe,"data-node-ref":"_usernameInputNode",class:F.esriInput}))),a=s?null:R("div",{class:F.group,key:"password"},R("label",{class:F.label},n.lblPwd,R("input",{value:"",required:!0,type:"password",bind:this,afterCreate:Oe,"data-node-ref":"_passwordInputNode",class:F.esriInput}))),u=R("div",{class:this.classes(F.group,F.footer)},R("input",{type:"submit",disabled:!!i,value:i?n.lblSigning:n.lblOk,class:F.esriButton}),R("input",{type:"button",value:n.lblCancel,bind:this,onclick:this._cancel,class:this.classes(F.esriButton,F.esriButtonSecondary)})),p=e?R("div",null,e.details&&e.details.httpStatus?n.invalidUser:n.noAuthService):null;return R("form",{class:F.base,bind:this,onsubmit:this._submit},l,p,c,a,u)}_cancel(){this._set("signingIn",!1),this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(e){e.preventDefault(),this._set("signingIn",!0);const t=this.oAuthPrompt?{}:{username:this._usernameInputNode&&this._usernameInputNode.value,password:this._passwordInputNode&&this._passwordInputNode.value};this.emit("submit",t)}};m([_(),Be("esri/identity/t9n/identity")],V.prototype,"messages",void 0),m([_()],V.prototype,"signingIn",void 0),m([_()],V.prototype,"server",void 0),m([_()],V.prototype,"resource",void 0),m([_()],V.prototype,"error",void 0),m([_()],V.prototype,"oAuthPrompt",void 0),V=m([te("esri.identity.IdentityForm")],V);const ft=V;/*! +* tabbable 6.2.0 +* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE +*/var He=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],he=He.join(","),Je=typeof Element>"u",W=Je?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,de=!Je&&Element.prototype.getRootNode?function(o){var e;return o==null||(e=o.getRootNode)===null||e===void 0?void 0:e.call(o)}:function(o){return o==null?void 0:o.ownerDocument},pe=function o(e,t){var r;t===void 0&&(t=!0);var i=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=i===""||i==="true",n=s||t&&e&&o(e.parentNode);return n},vt=function(e){var t,r=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return r===""||r==="true"},Ke=function(e,t,r){if(pe(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(he));return t&&W.call(e,he)&&i.unshift(e),i=i.filter(r),i},We=function o(e,t,r){for(var i=[],s=Array.from(e);s.length;){var n=s.shift();if(!pe(n,!1))if(n.tagName==="SLOT"){var l=n.assignedElements(),c=l.length?l:n.children,a=o(c,!0,r);r.flatten?i.push.apply(i,a):i.push({scopeParent:n,candidates:a})}else{var u=W.call(n,he);u&&r.filter(n)&&(t||!e.includes(n))&&i.push(n);var p=n.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(n),d=!pe(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(n));if(p&&d){var v=o(p===!0?n.children:p.children,!0,r);r.flatten?i.push.apply(i,v):i.push({scopeParent:n,candidates:v})}else s.unshift.apply(s,n.children)}}return i},Ye=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Xe=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||vt(e))&&!Ye(e)?0:e.tabIndex},gt=function(e,t){var r=Xe(e);return r<0&&t&&!Ye(e)?0:r},mt=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ze=function(e){return e.tagName==="INPUT"},_t=function(e){return Ze(e)&&e.type==="hidden"},bt=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return t},yt=function(e,t){for(var r=0;rsummary:first-of-type"),n=s?e.parentElement:e;if(W.call(n,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var l=e;e;){var c=e.parentElement,a=de(e);if(c&&!c.shadowRoot&&i(c)===!0)return Re(e);e.assignedSlot?e=e.assignedSlot:!c&&a!==e.ownerDocument?e=a.host:e=c}e=l}if(kt(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Re(e);return!1},Tt=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var r=0;r=0)},xt=function o(e){var t=[],r=[];return e.forEach(function(i,s){var n=!!i.scopeParent,l=n?i.scopeParent:i,c=gt(l,n),a=n?o(i.candidates):l;c===0?n?t.push.apply(t,a):t.push(l):r.push({documentOrder:s,tabIndex:c,item:i,isScope:n,content:a})}),r.sort(mt).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(t)},Ot=function(e,t){t=t||{};var r;return t.getShadowRoot?r=We([e],t.includeContainer,{filter:Ae.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ut}):r=Ke(e,t.includeContainer,Ae.bind(null,t)),xt(r)},Pt=function(e,t){t=t||{};var r;return t.getShadowRoot?r=We([e],t.includeContainer,{filter:fe.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):r=Ke(e,t.includeContainer,fe.bind(null,t)),r},oe=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return W.call(e,he)===!1?!1:Ae(t,e)},Ct=He.concat("iframe").join(","),we=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return W.call(e,Ct)===!1?!1:fe(t,e)};/*! +* focus-trap 7.4.3 +* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE +*/function De(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable})),t.push.apply(t,r)}return t}function Ne(o){for(var e=1;e0){var r=e[e.length-1];r!==t&&r.pause()}var i=e.indexOf(t);i===-1||e.splice(i,1),e.push(t)},deactivateTrap:function(e,t){var r=e.indexOf(t);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()}},Et=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},Ft=function(e){return e.key==="Escape"||e.key==="Esc"||e.keyCode===27},ee=function(e){return e.key==="Tab"||e.keyCode===9},jt=function(e){return ee(e)&&!e.shiftKey},Lt=function(e){return ee(e)&&e.shiftKey},Fe=function(e){return setTimeout(e,0)},je=function(e,t){var r=-1;return e.every(function(i,s){return t(i)?(r=s,!1):!0}),r},$=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i1?g-1:0),x=1;x=0)h=r.activeElement;else{var f=n.tabbableGroups[0],g=f&&f.firstTabbableNode;h=g||u("fallbackFocus")}if(!h)throw new Error("Your focus-trap needs to have at least one focusable element");return h},d=function(){if(n.containerGroups=n.containers.map(function(h){var f=Ot(h,s.tabbableOptions),g=Pt(h,s.tabbableOptions);return{container:h,tabbableNodes:f,focusableNodes:g,firstTabbableNode:f.length>0?f[0]:null,lastTabbableNode:f.length>0?f[f.length-1]:null,nextTabbableNode:function(x){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,E=g.findIndex(function(M){return M===x});if(!(E<0))return D?g.slice(E+1).find(function(M){return oe(M,s.tabbableOptions)}):g.slice(0,E).reverse().find(function(M){return oe(M,s.tabbableOptions)})}}}),n.tabbableGroups=n.containerGroups.filter(function(h){return h.tabbableNodes.length>0}),n.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},v=function O(h){if(h!==!1&&h!==r.activeElement){if(!h||!h.focus){O(p());return}h.focus({preventScroll:!!s.preventScroll}),n.mostRecentlyFocusedNode=h,Et(h)&&h.select()}},y=function(h){var f=u("setReturnFocus",h);return f||(f===!1?!1:h)},b=function(h){var f=ae(h);if(!(a(f,h)>=0)){if($(s.clickOutsideDeactivates,h)){l.deactivate({returnFocus:s.returnFocusOnDeactivate});return}$(s.allowOutsideClick,h)||h.preventDefault()}},S=function(h){var f=ae(h),g=a(f,h)>=0;g||f instanceof Document?g&&(n.mostRecentlyFocusedNode=f):(h.stopImmediatePropagation(),v(n.mostRecentlyFocusedNode||p()))},U=function(h){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=ae(h);d();var k=null;if(n.tabbableGroups.length>0){var x=a(g,h),D=x>=0?n.containerGroups[x]:void 0;if(x<0)f?k=n.tabbableGroups[n.tabbableGroups.length-1].lastTabbableNode:k=n.tabbableGroups[0].firstTabbableNode;else if(f){var E=je(n.tabbableGroups,function(ve){var ge=ve.firstTabbableNode;return g===ge});if(E<0&&(D.container===g||we(g,s.tabbableOptions)&&!oe(g,s.tabbableOptions)&&!D.nextTabbableNode(g,!1))&&(E=x),E>=0){var M=E===0?n.tabbableGroups.length-1:E-1,tt=n.tabbableGroups[M];k=tt.lastTabbableNode}else ee(h)||(k=D.nextTabbableNode(g,!1))}else{var Z=je(n.tabbableGroups,function(ve){var ge=ve.lastTabbableNode;return g===ge});if(Z<0&&(D.container===g||we(g,s.tabbableOptions)&&!oe(g,s.tabbableOptions)&&!D.nextTabbableNode(g))&&(Z=x),Z>=0){var rt=Z===n.tabbableGroups.length-1?0:Z+1,st=n.tabbableGroups[rt];k=st.firstTabbableNode}else ee(h)||(k=D.nextTabbableNode(g))}}else k=u("fallbackFocus");k&&(ee(h)&&h.preventDefault(),v(k))},q=function(h){if(Ft(h)&&$(s.escapeDeactivates,h)!==!1){h.preventDefault(),l.deactivate();return}(s.isKeyForward(h)||s.isKeyBackward(h))&&U(h,s.isKeyBackward(h))},Y=function(h){var f=ae(h);a(f,h)>=0||$(s.clickOutsideDeactivates,h)||$(s.allowOutsideClick,h)||(h.preventDefault(),h.stopImmediatePropagation())},X=function(){if(n.active)return Ee.activateTrap(i,l),n.delayInitialFocusTimer=s.delayInitialFocus?Fe(function(){v(p())}):v(p()),r.addEventListener("focusin",S,!0),r.addEventListener("mousedown",b,{capture:!0,passive:!1}),r.addEventListener("touchstart",b,{capture:!0,passive:!1}),r.addEventListener("click",Y,{capture:!0,passive:!1}),r.addEventListener("keydown",q,{capture:!0,passive:!1}),l},w=function(){if(n.active)return r.removeEventListener("focusin",S,!0),r.removeEventListener("mousedown",b,!0),r.removeEventListener("touchstart",b,!0),r.removeEventListener("click",Y,!0),r.removeEventListener("keydown",q,!0),l},A=function(h){var f=h.some(function(g){var k=Array.from(g.removedNodes);return k.some(function(x){return x===n.mostRecentlyFocusedNode})});f&&v(p())},I=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(A):void 0,H=function(){I&&(I.disconnect(),n.active&&!n.paused&&n.containers.map(function(h){I.observe(h,{subtree:!0,childList:!0})}))};return l={get active(){return n.active},get paused(){return n.paused},activate:function(h){if(n.active)return this;var f=c(h,"onActivate"),g=c(h,"onPostActivate"),k=c(h,"checkCanFocusTrap");k||d(),n.active=!0,n.paused=!1,n.nodeFocusedBeforeActivation=r.activeElement,f==null||f();var x=function(){k&&d(),X(),H(),g==null||g()};return k?(k(n.containers.concat()).then(x,x),this):(x(),this)},deactivate:function(h){if(!n.active)return this;var f=Ne({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},h);clearTimeout(n.delayInitialFocusTimer),n.delayInitialFocusTimer=void 0,w(),n.active=!1,n.paused=!1,H(),Ee.deactivateTrap(i,l);var g=c(f,"onDeactivate"),k=c(f,"onPostDeactivate"),x=c(f,"checkCanReturnFocus"),D=c(f,"returnFocus","returnFocusOnDeactivate");g==null||g();var E=function(){Fe(function(){D&&v(y(n.nodeFocusedBeforeActivation)),k==null||k()})};return D&&x?(x(y(n.nodeFocusedBeforeActivation)).then(E,E),this):(E(),this)},pause:function(h){if(n.paused||!n.active)return this;var f=c(h,"onPause"),g=c(h,"onPostPause");return n.paused=!0,f==null||f(),w(),H(),g==null||g(),this},unpause:function(h){if(!n.paused||!n.active)return this;var f=c(h,"onUnpause"),g=c(h,"onPostUnpause");return n.paused=!1,f==null||f(),d(),X(),H(),g==null||g(),this},updateContainerElements:function(h){var f=[].concat(h).filter(Boolean);return n.containers=f.map(function(g){return typeof g=="string"?r.querySelector(g):g}),n.active&&d(),H(),this}},l.updateContainerElements(e),l};const J="esri-identity-modal",L={base:J,open:`${J}--open`,closed:`${J}--closed`,title:`${J}__title`,dialog:`${J}__dialog`,content:`${J}__content`,closeButton:`${J}__close-button`,iconClose:"esri-icon-close"};let G=class extends Ve{constructor(o,e){super(o,e),this.container=document.createElement("div"),this.content=null,this.open=!1,this._focusTrap=null,this._close=()=>{this.open=!1},document.body.appendChild(this.container),this.addHandles(ke(()=>this.open,()=>this._toggleFocusTrap()))}destroy(){this._destroyFocusTrap()}get title(){var o;return(o=this.messages)==null?void 0:o.auth.signIn}render(){const o=this.id,{open:e,content:t,title:r,messages:i}=this,s=e&&!!t,n={[L.open]:s,[L.closed]:!s},l=R("button",{class:L.closeButton,"aria-label":i.close,title:i.close,bind:this,onclick:this._close,type:"button"},R("span",{"aria-hidden":"true",class:L.iconClose})),c=`${o}_title`,a=`${o}_content`,u=r?R("h1",{id:c,class:L.title},r):null,p=s?R("div",{bind:this,class:L.dialog,role:"dialog","aria-labelledby":c,"aria-describedby":a,afterCreate:this._createFocusTrap},l,u,this._renderContent(a)):null;return R("div",{tabIndex:-1,class:this.classes(L.base,n)},p)}_destroyFocusTrap(){var o;(o=this._focusTrap)==null||o.deactivate({onDeactivate:()=>{}}),this._focusTrap=null}_toggleFocusTrap(){const{_focusTrap:o,open:e}=this;o&&(e?o.activate():o.deactivate())}_createFocusTrap(o){this._destroyFocusTrap();const e=requestAnimationFrame(()=>{this._focusTrap=Bt(o,{initialFocus:"input",onDeactivate:this._close}),this._toggleFocusTrap()});this.addHandles(nt(()=>cancelAnimationFrame(e)))}_renderContent(o){const e=this.content;return typeof e=="string"?R("div",{class:L.content,id:o,innerHTML:e}):dt(e)?R("div",{class:L.content,id:o},e.render()):e instanceof HTMLElement?R("div",{class:L.content,id:o,bind:e,afterCreate:this._attachToNode}):null}_attachToNode(o){const e=this;o.appendChild(e)}};m([_({readOnly:!0})],G.prototype,"container",void 0),m([_()],G.prototype,"content",void 0),m([_()],G.prototype,"open",void 0),m([_(),Be("esri/t9n/common")],G.prototype,"messages",void 0),m([_()],G.prototype,"title",null),G=m([te("esri.identity.IdentityModal")],G);const Le=G,Se="esriJSAPIOAuth";class Te{constructor(e,t){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=t,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token)){if(this.expires==null&&this.refreshToken)e=!0;else if(this.expires){const t=Date.now();this.expires>t&&(this.expires-t)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}}return e}save(){if(!this.storage)return!1;const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r||(r=e[t.authNamespace]={}),this.appId||(this.appId=t.appId),r[t.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(Se,JSON.stringify(e))}catch(i){return console.warn(i),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(t&&t.appId&&t.portalUrl&&(this.expires==null||this.expires>Date.now())&&(this.refreshToken||this.token)){const r=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",i=new FormData;if(i.append("f","json"),i.append("auth_token",this.refreshToken||this.token),i.append("client_id",t.appId),i.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),typeof navigator.sendBeacon=="function")navigator.sendBeacon(r,i);else{const s=new XMLHttpRequest;s.open("POST",r),s.send(i)}}if(t&&t.authNamespace&&t.portalUrl&&this.storage){const r=e[t.authNamespace];if(r){delete r[t.portalUrl];try{this.storage.setItem(Se,JSON.stringify(e))}catch(i){console.log(i)}}}t&&(t._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r&&(r=r[t.portalUrl],r&&(this.appId=r.appId,this.codeVerifier=r.codeVerifier,this.expires=r.expires,this.refreshToken=r.refreshToken,this.ssl=r.ssl,this.stateUID=r.stateUID,this.token=r.token,this.userId=r.userId))}}_load(){let e={};if(this.storage){const t=this.storage.getItem(Se);if(t)try{e=JSON.parse(t)}catch(r){console.warn(r)}}return e}}Te.prototype.declaredClass="esri.identity.OAuthCredential";var Ue;let N=Ue=class extends Me{constructor(o){super(o),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return Ue.fromJSON(this.toJSON())}};m([_({json:{write:!0}})],N.prototype,"appId",void 0),m([_({json:{write:!0}})],N.prototype,"authNamespace",void 0),m([_({json:{write:!0}})],N.prototype,"expiration",void 0),m([_({json:{write:!0}})],N.prototype,"flowType",void 0),m([_({json:{write:!0}})],N.prototype,"forceLogin",void 0),m([_({json:{write:!0}})],N.prototype,"forceUserId",void 0),m([_({json:{write:!0}})],N.prototype,"locale",void 0),m([_({json:{write:!0}})],N.prototype,"minTimeUntilExpiration",void 0),m([_({json:{write:!0}})],N.prototype,"popup",void 0),m([_({json:{write:!0}})],N.prototype,"popupCallbackUrl",void 0),m([_({json:{write:!0}})],N.prototype,"popupWindowFeatures",void 0),m([_({json:{write:!0}})],N.prototype,"portalUrl",void 0),m([_({json:{write:!0}})],N.prototype,"preserveUrlHash",void 0),m([_({json:{write:!0}})],N.prototype,"userId",void 0),N=Ue=m([te("esri.identity.OAuthInfo")],N);const qe=N;let j=class extends Me{constructor(e){super(e),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};m([_({json:{write:!0}})],j.prototype,"adminTokenServiceUrl",void 0),m([_({json:{write:!0}})],j.prototype,"currentVersion",void 0),m([_({json:{write:!0}})],j.prototype,"hasPortal",void 0),m([_({json:{write:!0}})],j.prototype,"hasServer",void 0),m([_({json:{write:!0}})],j.prototype,"owningSystemUrl",void 0),m([_({json:{write:!0}})],j.prototype,"owningTenant",void 0),m([_({json:{write:!0}})],j.prototype,"server",void 0),m([_({json:{write:!0}})],j.prototype,"shortLivedTokenValidity",void 0),m([_({json:{write:!0}})],j.prototype,"tokenServiceUrl",void 0),m([_({json:{write:!0}})],j.prototype,"webTierAuth",void 0),j=m([te("esri.identity.ServerInfo")],j);const Ie=j,le={},Qe=o=>{const e=new K(o.owningSystemUrl).host,t=new K(o.server).host,r=/.+\.arcgis\.com$/i;return r.test(e)&&r.test(t)},xe=(o,e)=>!!(Qe(o)&&e&&e.some(t=>t.test(o.server)));let ce=null,ue=null;try{ce=window.localStorage,ue=window.sessionStorage}catch{}class $e extends ze{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.formConstructor=ft,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin=window.origin!=="null"?window.origin:window.location.origin,this._appUrlObj=me(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^\/]+\/[^\/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^\/]+)\/?.*/i,this._gwItem=/http.+\/items\/([^\/]+)\/?.*/i,this._gwGroup=/http.+\/groups\/([^\/]+)\/?.*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const t=this.serverInfos;t?(e=e.filter(r=>!this.findServerInfo(r.server)),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach(r=>{r.owningSystemUrl&&this._portals.push(r.owningSystemUrl),r.hasPortal&&this._portals.push(r.server)})}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const r of e){const i=this.findOAuthInfo(r.portalUrl);i&&t.splice(t.indexOf(i),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),r=this._isServerRsrc(t);let i,s=this.findServerInfo(t),n=!0;s||(s=new Ie,s.server=this._getServerInstanceRoot(t),r?s.hasServer=!0:(s.tokenServiceUrl=this._getTokenSvcUrl(t),s.hasPortal=!0),this.registerServers([s])),i=this._findCredential(t),i?(delete e.server,Object.assign(i,e),n=!1):(i=new T({userId:e.userId,server:s.server,token:e.token,expires:e.expires,ssl:e.ssl,scope:r?"server":"portal"}),i.resources=[t],this.credentials.push(i)),i.emitTokenChange(!1),n||i.refreshServerTokens()}toJSON(){return Ge({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;typeof e=="string"&&(e=JSON.parse(e));const t=e.serverInfos,r=e.oAuthInfos,i=e.credentials;if(t){const s=[];t.forEach(n=>{n.server&&n.tokenServiceUrl&&s.push(n.declaredClass?n:new Ie(n))}),s.length&&this.registerServers(s)}if(r){const s=[];r.forEach(n=>{n.appId&&s.push(n.declaredClass?n:new qe(n))}),s.length&&this.registerOAuthInfos(s)}i&&i.forEach(s=>{s.server&&s.token&&s.expires&&s.expires>Date.now()&&((s=s.declaredClass?s:new T(s)).emitTokenChange(),this.credentials.push(s))})}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.serverInfos)if(this._hasSameServerInstance(r.server,e)){t=r;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.oAuthInfos)if(this._hasSameServerInstance(r.portalUrl,e)){t=r;break}return t}findCredential(e,t){if(!e)return;let r;e=this._sanitizeUrl(e);const i=this._isServerRsrc(e)?"server":"portal";if(t){for(const s of this.credentials)if(this._hasSameServerInstance(s.server,e)&&t===s.userId&&s.scope===i){r=s;break}}else for(const s of this.credentials)if(this._hasSameServerInstance(s.server,e)&&this._getIdenticalSvcIdx(e,s)!==-1&&s.scope===i){r=s;break}return r}getCredential(e,t){let r,i,s=!0;t&&(r=!!t.token,i=t.error,s=t.prompt!==!1),t={...t},e=this._sanitizeUrl(e);const n=new AbortController,l=re();if(t.signal&&Q(t.signal,()=>{n.abort()}),Q(n,()=>{l.reject(new C("identity-manager:user-aborted","ABORTED"))}),ot(n))return l.promise;t.signal=n.signal;const c=this._isAdminResource(e),a=r?this.findCredential(e):null;let u;if(a&&i&&i.details&&i.details.httpStatus===498)a.destroy();else if(a)return u=new C("identity-manager:not-authorized","You are currently signed in as: '"+a.userId+"'. You do not have access to this resource: "+e,{error:i}),l.reject(u),l.promise;const p=this._findCredential(e,t);if(p)return l.resolve(p),l.promise;let d=this.findServerInfo(e);if(d)!d.hasServer&&this._isServerRsrc(e)&&(d._restInfoPms=this._getTokenSvcUrl(e),d.hasServer=!0);else{const v=this._getTokenSvcUrl(e);if(!v)return u=new C("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),l.reject(u),l.promise;d=new Ie,d.server=this._getServerInstanceRoot(e),typeof v=="string"?(d.tokenServiceUrl=v,d.hasPortal=!0):(d._restInfoPms=v,d.hasServer=!0),this.registerServers([d])}return d.hasPortal&&d._selfReq===void 0&&(s||z(d.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(v=>v.tokenServiceUrl===d.tokenServiceUrl))&&(d._selfReq={owningTenant:t&&t.owningTenant,selfDfd:this._getPortalSelf(d.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,d,t,l,c)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,r){const i=this._rePortalTokenSvc.test(e.tokenServiceUrl),s=new K(this._appOrigin),n=e.shortLivedTokenValidity;let l,c,a,u,p,d,v,y;t&&(y=this.tokenValidity||n||this._defaultTokenValidity,y>n&&n>0&&(y=n)),r&&(l=r.isAdmin,c=r.serverUrl,a=r.token,d=r.signal,v=r.ssl,e.customParameters=r.customParameters),l?u=e.adminTokenServiceUrl:(u=e.tokenServiceUrl,p=new K(u.toLowerCase()),e.webTierAuth&&(r!=null&&r.serverUrl)&&!v&&s.scheme==="http"&&(z(s.uri,u,!0)||p.scheme==="https"&&s.host===p.host&&s.port==="7080"&&p.port==="7443")&&(u=u.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const b={query:{request:"getToken",username:t==null?void 0:t.username,password:t==null?void 0:t.password,serverUrl:c,token:a,expiration:y,referer:l||i?this._appOrigin:null,client:l?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:d,...r==null?void 0:r.ioArgs};return i||(b.withCredentials=!1),B(u,b).then(S=>{const U=S.data;if(!U||!U.token)return new C("identity-manager:authentication-failed","Unable to generate token");const q=e.server;return le[q]||(le[q]={}),t&&(le[q][t.username]=t.password),U.validity=y,U})}isBusy(){return!!this._busy}checkSignInStatus(e){return this.checkAppAccess(e,"").then(t=>t.credential)}checkAppAccess(e,t,r){let i=!1;return this.getCredential(e,{prompt:!1}).then(s=>{let n;const l={f:"json"};if(s.scope==="portal")if(t&&(this._doPortalSignIn(e)||r&&r.force))n=s.server+"/sharing/rest/oauth2/validateAppAccess",l.client_id=t;else{if(!s.token)return{credential:s};n=s.server+"/sharing/rest"}else{if(!s.token)return{credential:s};n=s.server+"/rest/services"}return s.token&&(l.token=s.token),B(n,{query:l,authMode:"anonymous"}).then(c=>{if(c.data.valid===!1)throw new C("identity-manager:not-authorized",`You are currently signed in as: '${s.userId}'.`,c.data);return i=!!c.data.viewOnlyUserTypeApp,{credential:s}}).catch(c=>{if(c.name==="identity-manager:not-authorized")throw c;const a=c.details&&c.details.httpStatus;if(a===498)throw s.destroy(),new C("identity-manager:not-authenticated","User is not signed in.");if(a===400)throw new C("identity-manager:invalid-request");return{credential:s}})}).then(s=>({credential:s.credential,viewOnly:i}))}setOAuthResponseHash(e){e&&(e.charAt(0)==="#"&&(e=e.substring(1)),this._processOAuthPopupParams(se(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,r={}){const i=re(),s=()=>{var p;c==null||c.remove(),a==null||a.remove(),u==null||u.remove(),l==null||l.destroy(),(p=this.dialog)==null||p.destroy(),this.dialog=l=c=a=u=null},n=()=>{s(),this._oAuthDfd=null,i.reject(new C("identity-manager:user-aborted","ABORTED"))};r.signal&&Q(r.signal,()=>{n()});let l=new this.formConstructor;l.resource=this.getResourceName(e),l.server=t.server,this.dialog=new Le,this.dialog.content=l,this.dialog.open=!0,this.emit("dialog-create");let c=l.on("cancel",n),a=ke(()=>this.dialog.open,n),u=l.on("submit",p=>{this.generateToken(t,p,{isAdmin:r.isAdmin,signal:r.signal}).then(d=>{s();const v=new T({userId:p.username,server:t.server,token:d.token,expires:d.expires!=null?Number(d.expires):null,ssl:!!d.ssl,isAdmin:r.isAdmin,validity:d.validity});i.resolve(v)}).catch(d=>{l.error=d,l.signingIn=!1})});return i.promise}oAuthSignIn(e,t,r,i){this._oAuthDfd=re();const s=this._oAuthDfd;let n;i!=null&&i.signal&&Q(i.signal,()=>{const y=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;y&&!y.closed?y.close():this.dialog&&d()}),s.resUrl_=e,s.sinfo_=t,s.oinfo_=r;const l=r._oAuthCred;if(l.storage&&(r.flowType==="authorization-code"||r.flowType==="auto"&&!r.popup&&t.currentVersion>=8.4)){let y=crypto.getRandomValues(new Uint8Array(32));n=_e(y),l.codeVerifier=n,y=crypto.getRandomValues(new Uint8Array(32)),l.stateUID=_e(y),l.save()||(l.codeVerifier=n=null)}else l.codeVerifier=null;let c,a,u,p;this._getCodeChallenge(n).then(y=>{const b=!i||i.oAuthPopupConfirmation!==!1;r.popup&&b?(c=new this.formConstructor,c.oAuthPrompt=!0,c.server=t.server,this.dialog=new Le,this.dialog.content=c,this.dialog.open=!0,this.emit("dialog-create"),a=c.on("cancel",d),u=ke(()=>this.dialog.open,d),p=c.on("submit",()=>{v(),this._doOAuthSignIn(e,t,r,y)})):this._doOAuthSignIn(e,t,r,y)});const d=()=>{v(),this._oAuthDfd=null,s.reject(new C("identity-manager:user-aborted","ABORTED"))},v=()=>{var y;a==null||a.remove(),u==null||u.remove(),p==null||p.remove(),c==null||c.destroy(),(y=this.dialog)==null||y.destroy(),this.dialog=null};return s.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach(e=>{e.destroy()}),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=be(window,"message",t=>{var r;if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&((r=t.data)==null?void 0:r.type)==="arcgis:auth:requestCredential"){const i=t.source;this.getCredential(e).then(s=>{i.postMessage({type:"arcgis:auth:credential",credential:{expires:s.expires,server:s.server,ssl:s.ssl,token:s.token,userId:s.userId}},t.origin)}).catch(s=>{i.postMessage({type:"arcgis:auth:error",error:{name:s.name,message:s.message}},t.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){var r,i;let e=window.location.hash;if(e){e.charAt(0)==="#"&&(e=e.substring(1));const s=se(e);let n=!1;if(s.access_token&&s.expires_in&&s.state&&s.hasOwnProperty("username"))try{s.state=JSON.parse(s.state),s.state.portalUrl&&(this._oAuthLocationParams=s,n=!0)}catch{}else if(s.error&&s.error_description&&(console.log("IdentityManager OAuth Error: ",s.error," - ",s.error_description),s.error==="access_denied"&&(n=!0,s.state)))try{s.state=JSON.parse(s.state)}catch{}n&&(window.location.hash=((r=s.state)==null?void 0:r.hash)||"")}let t=window.location.search;if(t){t.charAt(0)==="?"&&(t=t.substring(1));const s=se(t);let n=!1;if(s.code&&s.state)try{s.state=JSON.parse(s.state),s.state.portalUrl&&s.state.uid&&(this._oAuthLocationParams=s,n=!0)}catch{}else if(s.error&&s.error_description&&(console.log("IdentityManager OAuth Error: ",s.error," - ",s.error_description),s.error==="access_denied"&&(n=!0,s.state)))try{s.state=JSON.parse(s.state)}catch{}if(n){const l={...s};["code","error","error_description","message_code","persist","state"].forEach(u=>{delete l[u]});const c=Pe(l),a=window.location.pathname+(c?`?${c}`:"")+(((i=s.state)==null?void 0:i.hash)||"");window.history.replaceState(window.history.state,"",a)}}}_getOAuthToken(e,t,r,i,s){return e=e.replace(/^http:/i,"https:"),B(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:i&&s?{grant_type:"authorization_code",code:t,redirect_uri:i,client_id:r,code_verifier:s}:{grant_type:"refresh_token",refresh_token:t,client_id:r}}).then(n=>n.data)}_getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=new TextEncoder().encode(e);return crypto.subtle.digest("SHA-256",t).then(r=>_e(new Uint8Array(r)))}return Promise.resolve(null)}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const t=new C("identity-manager:user-aborted","ABORTED");this._errbackFunc(t)}}_findCredential(e,t){let r,i,s,n,l=-1;const c=t&&t.token,a=t&&t.resource,u=this._isServerRsrc(e)?"server":"portal",p=this.credentials.filter(d=>this._hasSameServerInstance(d.server,e)&&d.scope===u);if(e=a||e,p.length)if(p.length===1){if(r=p[0],s=this.findServerInfo(r.server),i=s&&s.owningSystemUrl,n=i?this.findCredential(i,r.userId):void 0,l=this._getIdenticalSvcIdx(e,r),!c)return l===-1&&r.resources.push(e),this._addResource(e,n),r;l!==-1&&(r.resources.splice(l,1),this._removeResource(e,n))}else{let d,v;if(p.some(y=>(v=this._getIdenticalSvcIdx(e,y),v!==-1&&(d=y,s=this.findServerInfo(d.server),i=s&&s.owningSystemUrl,n=i?this.findCredential(i,d.userId):void 0,l=v,!0))),c)d&&(d.resources.splice(l,1),this._removeResource(e,n));else if(d)return this._addResource(e,n),d}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t){for(const r of this.oAuthInfos)if(this._isIdProvider(r.portalUrl,e)){t=r;break}}return t}_addResource(e,t){t&&this._getIdenticalSvcIdx(e,t)===-1&&t.resources.push(e)}_removeResource(e,t){let r=-1;t&&(r=this._getIdenticalSvcIdx(e,t),r>-1&&t.resources.splice(r,1))}_useProxy(e,t){return t&&t.isAdmin&&!z(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&String(e.currentVersion)==="10.1"&&!z(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new K(e);return t.scheme+"://"+t.host+(t.port!=null?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let r=t.indexOf(this._agsRest);return r===-1&&this._isAdminResource(e)&&(r=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),r!==-1||at(t)||(r=t.indexOf("/sharing")),r===-1&&t.substr(-1)==="/"&&(r=t.length-1),r>-1?e.substring(0,r):e}_hasSameServerInstance(e,t){return e.substr(-1)==="/"&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=this._normalizeAGOLorgDomain(e),t=this._normalizeAGOLorgDomain(t),(e=e.substr(e.indexOf(":")))===(t=t.substr(t.indexOf(":")))}_normalizeAGOLorgDomain(e){const t=/^https?:\/\/(?:cdn|[a-z\d-]+\.maps)\.arcgis\.com/i,r=/^https?:\/\/(?:cdndev|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,i=/^https?:\/\/(?:cdnqa|[a-z\d-]+\.mapsqa)\.arcgis\.com/i;return t.test(e)?e=e.replace(t,"https://www.arcgis.com"):r.test(e)?e=e.replace(r,"https://devext.arcgis.com"):i.test(e)&&(e=e.replace(i,"https://qaext.arcgis.com")),e}_sanitizeUrl(e){const t=(ye.request.proxyUrl||"").toLowerCase(),r=t?e.toLowerCase().indexOf(t+"?"):-1;return r!==-1&&(e=e.substring(r+t.length+1)),e=lt(e),me(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let r=!1;if(this._isRESTService(e)&&this._isRESTService(t)){const i=this._getSuffix(e).toLowerCase(),s=this._getSuffix(t).toLowerCase();if(r=i===s,!r){const n=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;r=i.replaceAll(n,"$1")===s.replaceAll(n,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?r=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(r=!0);return r}_isPortalDomain(e){const t=new K(e.toLowerCase()),r=this._portalConfig;let i=this._gwDomains.some(s=>s.regex.test(t.uri));return!i&&r&&(i=this._hasSameServerInstance(this._getServerInstanceRoot(r.restBaseUrl),t.uri)),i||ye.portalUrl&&(i=z(t,ye.portalUrl,!0)),i||(i=this._portals.some(s=>this._hasSameServerInstance(s,t.uri))),i=i||this._agsPortal.test(t.path),i}_isIdProvider(e,t){let r=-1,i=-1;this._gwDomains.forEach((n,l)=>{r===-1&&n.regex.test(e)&&(r=l),i===-1&&n.regex.test(t)&&(i=l)});let s=!1;if(r>-1&&i>-1&&(r===0||r===4?i!==0&&i!==4||(s=!0):r===1?i!==1&&i!==2||(s=!0):r===2?i===2&&(s=!0):r===3&&i===3&&(s=!0)),!s){const n=this.findServerInfo(t),l=n&&n.owningSystemUrl;l&&Qe(n)&&this._isPortalDomain(l)&&this._isIdProvider(e,l)&&(s=!0)}return s}_getIdenticalSvcIdx(e,t){let r=-1;for(let i=0;in.data),{adminUrl:t,promise:r}}if(this._isPortalDomain(e)){let s="";if(this._gwDomains.some(n=>(n.regex.test(e)&&(s=n.tokenServiceUrl),!!s)),s||this._portals.some(n=>(this._hasSameServerInstance(n,e)&&(s=n+this._gwTokenUrl),!!s)),s||(i=e.toLowerCase().indexOf("/sharing"),i!==-1&&(s=e.substring(0,i)+this._gwTokenUrl)),s||(s=this._getOrigin(e)+this._gwTokenUrl),s){const n=new K(e).port;/^http:\/\//i.test(e)&&n==="7080"&&(s=s.replace(/:7080/i,":7443")),s=s.replace(/http:/i,"https:")}return s}if(e.toLowerCase().includes("premium.arcgisonline.com"))return"https://premium.arcgisonline.com/server/tokens"}_processOAuthResponseParams(e,t,r){const i=t._oAuthCred;if(e.code){const n=i.codeVerifier;return i.codeVerifier=null,i.stateUID=null,i.save(),this._getOAuthToken(r.server,e.code,t.appId,this._getRedirectURI(t,!0),n).then(l=>{const c=new T({userId:l.username,server:r.server,token:l.access_token,expires:Date.now()+1e3*l.expires_in,ssl:l.ssl,oAuthState:e.state,_oAuthCred:i});return t.userId=c.userId,i.storage=l.persist?ce:ue,i.refreshToken=l.refresh_token,i.token=null,i.expires=l.refresh_token_expires_in?Date.now()+1e3*l.refresh_token_expires_in:null,i.userId=c.userId,i.ssl=c.ssl,i.save(),c})}const s=new T({userId:e.username,server:r.server,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:e.ssl==="true",oAuthState:e.state,_oAuthCred:i});return t.userId=s.userId,i.storage=e.persist?ce:ue,i.refreshToken=null,i.token=s.token,i.expires=s.expires,i.userId=s.userId,i.ssl=s.ssl,i.save(),Promise.resolve(s)}_processOAuthPopupParams(e){var r;const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),(r=this._oAuthOnPopupHandle)==null||r.remove(),e.error){const i=e.error==="access_denied",s=new C(i?"identity-manager:user-aborted":"identity-manager:authentication-failed",i?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(s)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then(i=>{t.resolve(i)}).catch(i=>{t.reject(i)})}_setOAuthResponseQueryString(e){e&&(e.charAt(0)==="?"&&(e=e.substring(1)),this._processOAuthPopupParams(se(e)))}_exchangeToken(e,t,r){return B(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:r}}).then(i=>i.data.token)}_getPlatformSelf(e,t){return e=e.replace(/^http:/i,"https:"),B(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0}).then(r=>r.data)}_getPortalSelf(e,t){let r;return this._gwDomains.some(i=>(i.regex.test(e)&&(r=i.customBaseUrl),!!r)),r?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:r,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),B(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(i=>i.data))}_doPortalSignIn(e){const t=this._portalConfig,r=window.location.href,i=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(r)||!(i?i.hasPortal||i.owningSystemUrl&&this._isPortalDomain(i.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(r,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||z(r,e,!0)))}_checkProtocol(e,t,r,i){let s=!0;const n=i?t.adminTokenServiceUrl:t.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&ct(n)&&(s=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!s)&&r(new C("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),s}_enqueue(e,t,r,i,s,n){return i||(i=re()),i.resUrl_=e,i.sinfo_=t,i.options_=r,i.admin_=s,i.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(i)):this._xoReqs.push(i):this._doSignIn(i),i.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=a=>{const u=e.options_&&e.options_.resource,p=e.resUrl_,d=e.refresh_;let v=!1;this.credentials.includes(a)||(d&&this.credentials.includes(d)?(d.userId=a.userId,d.token=a.token,d.expires=a.expires,d.validity=a.validity,d.ssl=a.ssl,d.creationTime=a.creationTime,v=!0,a=d):this.credentials.push(a)),a.resources||(a.resources=[]),a.resources.includes(u||p)||a.resources.push(u||p),a.scope=this._isServerRsrc(p)?"server":"portal",a.emitTokenChange();const y=this._soReqs,b={};this._soReqs=[],y.forEach(S=>{if(!this._isIdenticalService(p,S.resUrl_)){const U=this._getSuffix(S.resUrl_);b[U]||(b[U]=!0,a.resources.push(S.resUrl_))}}),e.resolve(a),y.forEach(S=>{this._hasSameServerInstance(this._getServerInstanceRoot(p),S.resUrl_)?S.resolve(a):this._soReqs.push(S)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,v||this.emit("credential-create",{credential:a}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=a=>{e.reject(a),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},i=(a,u,p,d)=>{var q,Y,X;const v=e.sinfo_,y=!e.options_||e.options_.prompt!==!1,b=v.hasPortal&&this._findOAuthInfo(e.resUrl_);let S,U;if(a)t(new T({userId:a,server:v.server,token:p||null,expires:d!=null?Number(d):null,ssl:!!u}));else if(window!==window.parent&&((q=this._appUrlObj.query)!=null&&q["arcgis-auth-origin"])&&((Y=this._appUrlObj.query)!=null&&Y["arcgis-auth-portal"])&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const w=be(window,"message",A=>{A.source===window.parent&&A.data&&(A.data.type==="arcgis:auth:credential"?(w.remove(),A.data.credential.expires{w.remove()})}else if(b){let w=b._oAuthCred;if(!w){const A=new Te(b,ce),I=new Te(b,ue);A.isValid()&&I.isValid()?A.expires>I.expires?(w=A,I.destroy()):(w=I,A.destroy()):w=A.isValid()?A:I,b._oAuthCred=w}if(w.isValid()){S=new T({userId:w.userId,server:v.server,token:w.token,expires:w.expires,ssl:w.ssl,_oAuthCred:w});const A=b.appId!==w.appId&&this._doPortalSignIn(e.resUrl_);A||w.refreshToken?(e._pendingDfd=w.refreshToken?this._getOAuthToken(v.server,w.refreshToken,w.appId).then(I=>(S.expires=Date.now()+1e3*I.expires_in,S.token=I.access_token,S)):Promise.resolve(S),e._pendingDfd.then(I=>A?this._exchangeToken(I.server,b.appId,I.token).then(H=>(I.token=H,I)).catch(()=>I):I).then(I=>{t(I)}).catch(()=>{w==null||w.destroy(),i()})):t(S)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(b.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===w.stateUID&&w.codeVerifier)){const A=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(A,b,v).then(I=>{t(I)}).catch(r)}else{const A=()=>{y?e._pendingDfd=this.oAuthSignIn(e.resUrl_,v,b,e.options_).then(t,r):(U=new C("identity-manager:not-authenticated","User is not signed in."),r(U))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(v.server,b.appId).then(I=>{z(I.portalUrl,this._appOrigin,!0)?(S=new T({userId:I.username,server:v.server,expires:Date.now()+1e3*I.expires_in,token:I.token}),t(S)):A()}).catch(A):A()}}else if(y){if(this._checkProtocol(e.resUrl_,v,r,e.admin_)){let w=e.options_;e.admin_&&(w=w||{},w.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,v,w).then(t,r)}}else U=new C("identity-manager:not-authenticated","User is not signed in."),r(U)},s=()=>{const a=e.sinfo_,u=a.owningSystemUrl,p=e.options_;let d,v,y,b;if(p&&(d=p.token,v=p.error,y=p.prompt),b=this._findCredential(u,{token:d,resource:e.resUrl_}),!b){for(const S of this.credentials)if(this._isIdProvider(u,S.server)){b=S;break}}if(b){const S=this.findCredential(e.resUrl_,b.userId);if(S)t(S);else if(xe(a,this._legacyFed)){const U=b.toJSON();U.server=a.server,U.resources=null,t(new T(U))}else(e._pendingDfd=this.generateToken(this.findServerInfo(b.server),null,{serverUrl:e.resUrl_,token:b.token,signal:e.options_.signal,ssl:b.ssl})).then(U=>{t(new T({userId:b==null?void 0:b.userId,server:a.server,token:U.token,expires:U.expires!=null?Number(U.expires):null,ssl:!!U.ssl,isAdmin:e.admin_,validity:U.validity}))},r)}else this._busy=null,d&&(e.options_.token=null),(e._pendingDfd=this.getCredential(u.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:a.owningTenant,signal:e.options_.signal,token:d,error:v,prompt:y})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},S=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(S)})};this._errbackFunc=r;const n=e.sinfo_.owningSystemUrl,l=this._isServerRsrc(e.resUrl_),c=e.sinfo_._restInfoPms;c?c.promise.then(a=>{const u=e.sinfo_;if(u._restInfoPms){u.adminTokenServiceUrl=u._restInfoPms.adminUrl,u._restInfoPms=null,u.tokenServiceUrl=(ie("authInfo.tokenServicesUrl",a)||ie("authInfo.tokenServiceUrl",a)||ie("tokenServiceUrl",a))??null,u.shortLivedTokenValidity=ie("authInfo.shortLivedTokenValidity",a)??null,u.currentVersion=a.currentVersion,u.owningTenant=a.owningTenant;const p=u.owningSystemUrl=a.owningSystemUrl;p&&this._portals.push(p)}l&&u.owningSystemUrl?s():i()},()=>{e.sinfo_._restInfoPms=null;const a=new C("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(a)}):l&&n?s():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(a=>{const u={};let p,d,v,y;return a&&(p=a.user&&a.user.username,u.username=p,u.allSSL=a.allSSL,d=a.supportsOAuth,y=parseFloat(a.currentVersion),a.portalMode==="multitenant"&&(v=a.customBaseUrl),e.sinfo_.currentVersion=y),e.sinfo_.webTierAuth=!!p,p&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:u.allSSL}).catch(()=>null).then(b=>(u.portalToken=b&&b.token,u.tokenExpiration=b&&b.expires,u)):!p&&d&&y>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:v,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>u):u}).catch(()=>null).then(a=>{e.sinfo_._selfReq=null,a?i(a.username,a.allSSL,a.portalToken,a.tokenExpiration):i()}):i()}_generateOAuthInfo(e){let t,r=null,i=e.portalUrl;const s=e.customBaseUrl,n=e.owningTenant,l=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(l){r=window.location.href;let c=r.indexOf("?");c>-1&&(r=r.slice(0,c)),c=r.search(/\/(apps|home)\//),r=c>-1?r.slice(0,c):null}return l&&r?(this._hasTestedIfAppIsOnPortal=!0,t=B(r+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new qe({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})})):t=Promise.resolve(),t.then(()=>{if(this._defaultOAuthInfo)return i=i.replace(/^http:/i,"https:"),B(i+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:Ce(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(c=>{if(c.data.valid){const a=this._defaultOAuthInfo.clone();c.data.urlKey&&s?a.portalUrl="https://"+c.data.urlKey.toLowerCase()+"."+s:a.portalUrl=i,a.popup=window!==window.top||!(z(i,this._appOrigin)||this._gwDomains.some(u=>u.regex.test(i)&&u.regex.test(this._appOrigin))),this.oAuthInfos.push(a)}})})}_doOAuthSignIn(e,t,r,i){const s=r._oAuthCred,n={portalUrl:r.portalUrl};!r.popup&&r.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),s.stateUID&&(n.uid=s.stateUID);const l={client_id:r.appId,response_type:s.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:r.expiration,locale:r.locale,redirect_uri:this._getRedirectURI(r,!!s.codeVerifier)};r.forceLogin&&(l.force_login=!0),r.forceUserId&&r.userId&&(l.prepopulatedusername=r.userId),!r.popup&&this._doPortalSignIn(e)&&(l.redirectToUserOrgUrl=!0),s.codeVerifier&&(l.code_challenge=i||s.codeVerifier,l.code_challenge_method=i?"S256":"plain");const c=r.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",a=c+"?"+Pe(l);if(r.popup){const u=window.open(a,"esriJSAPIOAuth",r.popupWindowFeatures);if(u)u.focus(),this._oAuthDfd.oAuthWin_=u,this._oAuthIntervalId=setInterval(()=>{if(u.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const p=this._oAuthDfd;if(p){const d=new C("identity-manager:user-aborted","ABORTED");p.reject(d)}}},500),this._oAuthOnPopupHandle=be(window,["arcgis:auth:hash","arcgis:auth:location:search"],p=>{p.type==="arcgis:auth:hash"?this.setOAuthResponseHash(p.detail):this._setOAuthResponseQueryString(p.detail)});else{const p=new C("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(p)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:l,authorizeUrl:c,resourceUrl:e,serverInfo:t,oAuthInfo:r}):window.location.href=a}_getRedirectURI(e,t){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return Ce(e.popupCallbackUrl);if(t){const i=me(r);return i.query&&["code","error","error_description","message_code","persist","state"].forEach(s=>{delete i.query[s]}),ut(i.path,i.query)}return r}}$e.prototype.declaredClass="esri.identity.IdentityManagerBase";let T=class extends ze.EventedAccessor{constructor(o){super(o),this._oAuthCred=null,this.tokenRefreshBuffer=2,o&&o._oAuthCred&&(this._oAuthCred=o._oAuthCred)}initialize(){this.resources=this.resources||[],this.creationTime==null&&(this.creationTime=Date.now())}refreshToken(){const o=P.findServerInfo(this.server),e=o&&o.owningSystemUrl,t=!!e&&this.scope==="server",r=t&&xe(o,P._legacyFed),i=o.webTierAuth,s=i&&P.normalizeWebTierAuth,n=le[this.server],l=n&&n[this.userId];let c,a=this.resources&&this.resources[0],u=t?P.findServerInfo(e):null,p={username:this.userId,password:l};if(i&&!s)return;t&&!u&&P.serverInfos.some(v=>(P._isIdProvider(e,v.server)&&(u=v),!!u));const d=u?P.findCredential(u.server,this.userId):null;if(!t||d){if(!r){if(t)c={serverUrl:a,token:d&&d.token,ssl:d&&d.ssl};else if(s)p=null,c={ssl:this.ssl};else{if(!l){let v;return a&&(a=P._sanitizeUrl(a),this._enqueued=1,v=P._enqueue(a,o,null,null,this.isAdmin,this),v.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),v}this.isAdmin&&(c={isAdmin:!0})}return P.generateToken(t?u:o,t?null:p,c).then(v=>{this.token=v.token,this.expires=v.expires!=null?Number(v.expires):null,this.creationTime=Date.now(),this.validity=v.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}d==null||d.refreshToken()}}refreshServerTokens(){this.scope==="portal"&&P.credentials.forEach(o=>{const e=P.findServerInfo(o.server),t=e&&e.owningSystemUrl;o!==this&&o.userId===this.userId&&t&&o.scope==="server"&&(P._hasSameServerInstance(this.server,t)||P._isIdProvider(t,this.server))&&(xe(e,P._legacyFed)?(o.token=this.token,o.expires=this.expires,o.creationTime=this.creationTime,o.validity=this.validity,o.emitTokenChange()):o.refreshToken())})}emitTokenChange(o){clearTimeout(this._refreshTimer);const e=this.server&&P.findServerInfo(this.server),t=e&&e.owningSystemUrl,r=t&&P.findServerInfo(t);o===!1||t&&this.scope!=="portal"&&(!r||!r.webTierAuth||P.normalizeWebTierAuth)||this.expires==null&&this.validity==null||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const o=P.credentials.indexOf(this);o>-1&&P.credentials.splice(o,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const o=Ge({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),e=this.resources;return e&&e.length>0&&(o.resources=e.slice()),o}_startRefreshTimer(){clearTimeout(this._refreshTimer);const o=6e4*this.tokenRefreshBuffer,e=2**31-1;let t=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();t<0?t=0:t>e&&(t=e),this._refreshTimer=setTimeout(this.refreshToken.bind(this),t>o?t-o:t)}};m([_()],T.prototype,"creationTime",void 0),m([_()],T.prototype,"expires",void 0),m([_()],T.prototype,"isAdmin",void 0),m([_()],T.prototype,"oAuthState",void 0),m([_()],T.prototype,"resources",void 0),m([_()],T.prototype,"scope",void 0),m([_()],T.prototype,"server",void 0),m([_()],T.prototype,"ssl",void 0),m([_()],T.prototype,"token",void 0),m([_()],T.prototype,"tokenRefreshBuffer",void 0),m([_()],T.prototype,"userId",void 0),m([_()],T.prototype,"validity",void 0),T=m([te("esri.identity.Credential")],T);class et extends $e{}et.prototype.declaredClass="esri.identity.IdentityManager";const Vt=new et;ht(Vt);export{Vt as default}; diff --git a/assets/ImageHistogramParameters-84349e1d.js b/assets/ImageHistogramParameters-84349e1d.js new file mode 100644 index 0000000..0260165 --- /dev/null +++ b/assets/ImageHistogramParameters-84349e1d.js @@ -0,0 +1 @@ +import{cp as Me,k$ as st,bh as f,ai as s,aj as l,fT as fe,d2 as W,nv as lt,l4 as Ut,al as N,ck as j,eZ as E,s1 as ct,ay as U,s2 as ut,cl as A,bY as ge,nt as dt,s3 as pt,c7 as ye,aK as kt,bJ as Rt,bK as Ht,s4 as Zt,s5 as Et,s6 as Pt,s7 as Vt,eV as Ae,b8 as Gt,s8 as K,jA as te,f4 as Ot,ow as de,bz as pe,cs as mt,fB as Jt,ca as Se,ak as Ft,fD as Wt,ar as C,dZ as $t,s9 as Mt,cq as _t,cm as Kt,kQ as Qt,kR as Xt,at as J,bc as Yt,cr as qt,cR as ei,es as ti}from"./index-080e108a.js";import{w as Ne,p as le,q as ii,t as H,x as ni,f as ai,y as ri,u as P,C as oi,z as Ze,A as gt,E as yt,F as si,G as li,H as ci,c as ht}from"./dataUtils-69946c3c.js";import{w as he,a as Xe,A as Ee,n as Ye}from"./UniqueValueRenderer-fef4204d.js";import{b as ui}from"./normalizeUtils-cf8b8053.js";import"./generateRendererUtils-1e52a587.js";import{d as di}from"./FeatureSet-111cb247.js";var je;const ae=new Me({flow_from:"flow-from",flow_to:"flow-to"});let b=je=class extends st(j){constructor(e){super(e),this.density=.8,this.color=new f([255,255,255,1]),this.maxPathLength=200,this.trailWidth=1.5,this.flowSpeed=10,this.trailLength=100,this.smoothing=0,this.flowRepresentation="flow-from",this.type="flow",this.authoringInfo=null,this.legendOptions=null,this.trailCap="butt",this.background="none"}clone(){var D,M;const{density:e,maxPathLength:t,trailWidth:i,flowSpeed:n,trailLength:a,smoothing:r,flowRepresentation:o,trailCap:c,background:d}=this,u=this.color.clone(),p=(this.visualVariables||[]).map(g=>g.clone()),m=(D=this.authoringInfo)==null?void 0:D.clone(),w=(M=this.legendOptions)==null?void 0:M.clone();return new je({density:e,color:u,maxPathLength:t,trailWidth:i,flowSpeed:n,trailLength:a,trailCap:c,background:d,smoothing:r,flowRepresentation:o,visualVariables:p,authoringInfo:m,legendOptions:w})}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}};s([l({type:Number,json:{write:!0}})],b.prototype,"density",void 0),s([l({type:f,json:{write:{allowNull:!0}}})],b.prototype,"color",void 0),s([l({type:Number,cast:fe,json:{write:!0}})],b.prototype,"maxPathLength",void 0),s([l({type:Number,cast:fe,json:{write:!0}})],b.prototype,"trailWidth",void 0),s([l({type:Number,json:{write:!0}})],b.prototype,"flowSpeed",void 0),s([l({type:Number,json:{write:!0}})],b.prototype,"trailLength",void 0),s([l({type:Number,cast:fe,json:{write:!1}})],b.prototype,"smoothing",void 0),s([l({type:ae.apiValues,json:{type:ae.jsonValues,read:{reader:ae.read},write:{writer:ae.write}}})],b.prototype,"flowRepresentation",void 0),s([W({flowRenderer:"flow"})],b.prototype,"type",void 0),s([l({type:lt,json:{write:!0}})],b.prototype,"authoringInfo",void 0),s([l({type:Ut,json:{write:!0}})],b.prototype,"legendOptions",void 0),s([l({type:String,json:{write:!0}})],b.prototype,"trailCap",void 0),s([l({type:String,json:{write:!0}})],b.prototype,"background",void 0),b=je=s([N("esri.renderers.FlowRenderer")],b);const It=b;let F=class extends j{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};s([l({type:Number,json:{write:!0}})],F.prototype,"value",void 0),s([l({type:String,json:{write:!0}})],F.prototype,"label",void 0),s([l({type:f,json:{type:[E],write:!0}})],F.prototype,"color",void 0),F=s([N("esri.renderers.support.ColormapInfo")],F);const wt=F;var Q;let X=Q=class extends j{constructor(e){super(e),this.colormapInfos=null,this.type="raster-colormap"}static createFromColormap(e,t){if(!e)return null;const i=e[0].length===5,n=[...e].sort((a,r)=>a[0]-r[0]).map(a=>wt.fromJSON({value:a[0],color:i?a.slice(1,5):a.slice(1,4).concat([255]),label:t?t[a[0]]??"":a[0]}));return new Q({colormapInfos:n})}static createFromColorramp(e){const t=Ne(e);return Q.createFromColormap(t)}clone(){return new Q({colormapInfos:this.colormapInfos.map(e=>e.toJSON())})}extractColormap(){return this.colormapInfos.map(({value:e,color:t})=>[e,t.r,t.g,t.b,t.a>1?t.a:255*t.a&255]).sort((e,t)=>e[0]-t[0])}};s([l({type:[wt],json:{write:!0}})],X.prototype,"colormapInfos",void 0),s([W({rasterColormap:"raster-colormap"})],X.prototype,"type",void 0),X=Q=s([N("esri.renderers.RasterColormapRenderer")],X);const Pe=X;var Te;let L=Te=class extends j{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.colorRamp=null,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.scalingType="none",this.type="raster-shaded-relief",this.zFactor=1}readColorRamp(e){return ut(e)}clone(){return new Te({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:A(this.colorRamp)})}};s([l({type:Number,json:{write:!0}})],L.prototype,"altitude",void 0),s([l({type:Number,json:{write:!0}})],L.prototype,"azimuth",void 0),s([l({types:ct,json:{write:!0}})],L.prototype,"colorRamp",void 0),s([U("colorRamp")],L.prototype,"readColorRamp",null),s([l({type:["traditional","multi-directional"],json:{write:!0}})],L.prototype,"hillshadeType",void 0),s([l({type:Number,json:{write:!0}})],L.prototype,"pixelSizePower",void 0),s([l({type:Number,json:{write:!0}})],L.prototype,"pixelSizeFactor",void 0),s([l({type:["none","adjusted"],json:{write:!0}})],L.prototype,"scalingType",void 0),s([W({rasterShadedRelief:"raster-shaded-relief"})],L.prototype,"type",void 0),s([l({type:Number,json:{write:!0}})],L.prototype,"zFactor",void 0),L=Te=s([N("esri.renderers.RasterShadedReliefRenderer")],L);const ft=L;var Ce;let y=Ce=class extends j{constructor(e){super(e),this.colorRamp=null,this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.maxPercent=null,this.minPercent=null,this.numberOfStandardDeviations=null,this.outputMax=null,this.outputMin=null,this.sigmoidStrengthLevel=null,this.statistics=[],this.histograms=null,this.useGamma=!1,this.stretchType="none",this.type="raster-stretch"}readColorRamp(e){if(e)return ut(e)}writeStatistics(e,t,i){e!=null&&e.length&&(Array.isArray(e[0])||(e=e.map(n=>[n.min,n.max,n.avg,n.stddev])),t[i]=e)}readStretchType(e,t){let i=t.stretchType;return typeof i=="number"&&(i=ii[i]),le.read(i)}clone(){return new Ce({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:A(this.statistics),gamma:A(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:A(this.colorRamp),histograms:A(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};s([l({types:ct,json:{write:!0}})],y.prototype,"colorRamp",void 0),s([U("colorRamp")],y.prototype,"readColorRamp",null),s([l({type:Boolean,json:{write:!0}})],y.prototype,"computeGamma",void 0),s([l({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],y.prototype,"dynamicRangeAdjustment",void 0),s([l({type:[Number],json:{write:!0}})],y.prototype,"gamma",void 0),s([l({type:Number,json:{write:!0}})],y.prototype,"maxPercent",void 0),s([l({type:Number,json:{write:!0}})],y.prototype,"minPercent",void 0),s([l({type:Number,json:{write:!0}})],y.prototype,"numberOfStandardDeviations",void 0),s([l({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],y.prototype,"outputMax",void 0),s([l({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],y.prototype,"outputMin",void 0),s([l({type:Number,json:{write:!0}})],y.prototype,"sigmoidStrengthLevel",void 0),s([l({json:{type:[[Number]],write:!0}})],y.prototype,"statistics",void 0),s([l()],y.prototype,"histograms",void 0),s([ge("statistics")],y.prototype,"writeStatistics",null),s([l({type:Boolean,json:{write:!0}})],y.prototype,"useGamma",void 0),s([l({type:le.apiValues,json:{type:le.jsonValues,write:le.write}})],y.prototype,"stretchType",void 0),s([U("stretchType",["stretchType"])],y.prototype,"readStretchType",null),s([W({rasterStretch:"raster-stretch"})],y.prototype,"type",void 0),y=Ce=s([N("esri.renderers.RasterStretchRenderer")],y);const Ve=y;var Le;const qe=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),re=new Me({beaufort_ft:"beaufort-ft",beaufort_km:"beaufort-km",beaufort_kn:"beaufort-kn",beaufort_m:"beaufort-m",beaufort_mi:"beaufort-mi",classified_arrow:"classified-arrow",ocean_current_kn:"ocean-current-kn",ocean_current_m:"ocean-current-m",simple_scalar:"simple-scalar",single_arrow:"single-arrow",wind_speed:"wind-barb"}),oe=new Me({flow_from:"flow-from",flow_to:"flow-to"});let v=Le=class extends st(j){constructor(e){super(e),this.attributeField="Magnitude",this.flowRepresentation="flow-from",this.rotationType="arithmetic",this.style="single-arrow",this.symbolTileSize=50,this.type="vector-field"}readInputUnit(e,t){return qe.has(e)?H.fromJSON(e):null}readOutputUnit(e,t){return qe.has(e)?H.fromJSON(e):null}get styleRenderer(){const e=this.style,t=this.attributeField,i=this._createStyleRenderer(e);return i.field=t,i}get sizeVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="size"&&e.push(t);if(e.length===0){const t=new dt({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}get rotationVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="rotation"&&e.push(t);if(e.length===0){const t=new pt({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}clone(){return new Le({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:A(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(e,t=!1,i=[]){var w;const n=new Array,a=ni(this.inputUnit,this.outputUnit),r=((w=this.rotationVariables[0])==null?void 0:w.rotationType)||this.rotationType,o=t?ai(e.pixelBlock,"vector-uv",r,a):ri(e.pixelBlock,"vector-magdir",a);if(o==null)return n;const c=e.extent,d=o.mask!=null&&o.mask.length>0;let u=0;const p=(c.xmax-c.xmin)/o.width,m=(c.ymax-c.ymin)/o.height;for(let D=0;Dz.intersects(g));if((!d||o.mask[u])&&!x){const z={Magnitude:o.pixels[0][u],Direction:o.pixels[1][u]},k=new kt({geometry:{type:"point",x:g.x,y:g.y,spatialReference:c.spatialReference},attributes:z});k.symbol=this._getVisualVariablesAppliedSymbol(k),n.push(k)}}return n}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getClassBreakInfos(){var e;return(e=this.styleRenderer)==null?void 0:e.classBreakInfos}getDefaultSymbol(){var e;return(e=this.styleRenderer)==null?void 0:e.defaultSymbol}_getDefaultSymbol(e){return new Rt({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new Ht({width:0}),size:20,color:e||new f([0,92,230])})}_getVisualVariablesAppliedSymbol(e){var a,r;if(!e)return;const t=(r=(a=this.styleRenderer)==null?void 0:a.getSymbol(e))==null?void 0:r.clone(),i=this.sizeVariables,n=this.rotationVariables;if(i&&i.length&&this.sizeVariables.forEach(o=>Zt(t,Et([o],e))),n&&n.length){const o=this.flowRepresentation==="flow-to"==(this.style==="ocean-current-kn"||this.style==="ocean-current-m")?0:180;e.attributes.Direction=e.attributes.Direction+o,this.rotationVariables.forEach(c=>Pt(t,Vt(c,e),c.axis))}return t}_createStyleRenderer(e){let t={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(e){case"single-arrow":t=this._createSingleArrowRenderer();break;case"beaufort-kn":t=this._createBeaufortKnotsRenderer();break;case"beaufort-m":t=this._createBeaufortMeterRenderer();break;case"beaufort-ft":t=this._createBeaufortFeetRenderer();break;case"beaufort-mi":t=this._createBeaufortMilesRenderer();break;case"beaufort-km":t=this._createBeaufortKilometersRenderer();break;case"ocean-current-m":t=this._createCurrentMeterRenderer();break;case"ocean-current-kn":t=this._createCurrentKnotsRenderer();break;case"simple-scalar":t=this._createSimpleScalarRenderer();break;case"wind-barb":t=this._createWindBarbsRenderer();break;case"classified-arrow":t=this._createClassifiedArrowRenderer()}return new he(t)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const e=[0,1,3,6,10,16,21,27,33,40,47,55,63],t=[[40,146,199],[89,162,186],[129,179,171],[160,194,155],[191,212,138],[218,230,119],[250,250,100],[252,213,83],[252,179,102],[250,141,52],[247,110,42],[240,71,29]];return{defaultSymbol:this._getDefaultSymbol(new f([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortMeterRenderer(){const e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7],t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]];return{defaultSymbol:this._getDefaultSymbol(new f([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortFeetRenderer(){const e=this._getDefaultSymbol(new f([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],n=3.28084;return t=t.map(a=>a*n),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortMilesRenderer(){const e=this._getDefaultSymbol(new f([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],n=2.23694;return t=t.map(a=>a*n),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortKilometersRenderer(){const e=this._getDefaultSymbol(new f([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],n=3.6;return t=t.map(a=>a*n),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createCurrentMeterRenderer(){const e=[0,.5,1,1.5,2],t=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new f([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createCurrentKnotsRenderer(){const e=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],t=[[0,0,0],[0,37,100],[78,26,153],[151,0,100],[179,27,26],[177,78,26],[202,128,26],[177,179,52],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new f([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createClassifiedArrowRenderer(){var n;const e=this._getDefaultSymbol(new f([56,168,0]));let t=[0,1e-6,3.5,7,10.5,14];if((n=this.sizeVariables)!=null&&n.length){const a=this.sizeVariables[0].minDataValue,r=this.sizeVariables[0].maxDataValue;if(a&&r){const o=(r-a)/5;t=Array.from(Array(6).keys()).map(c=>a+o*c)}}const i=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createSimpleScalarRenderer(){return{defaultSymbol:Ae.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAQAAABLVLlLAAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAABIAAAASABGyWs+AAAC3ElEQVRIx9XXvW4cVRQH8N982btpsIREJECyiCXsxX4DKh6AliqGKCBBE2SlwlHgAbBD/AKmyEYUeQ1KahPZSZQvBCkQLTHZ7KGY8Xodz4w3a1NwbzVzz/znfJ//zbStVC5q3icKak9GAs2QIdDx3PtW/S011NW3p+M5Eomh11ipTIKe6+4LQzHaQ+G+63pIZNJJQXMpljwTwj1brpgx5w1zZlyx5Z4QnllEIm2xeeSUHBf0hV0bejo1Uh09G3aFvgXk7cCJFBc9EdaRVuHJJaOdKyTV2TVhYLMduNR0Q9gxL5GaaTDw8GzejrDRBpxWoGsySRW0dttKuattwNkIlFw2YXgzOdYq4Ox49PlM+JrKd5OusjTWhBuVxUfMX/KXXZ3WEmkuqa67wspR4BTbwtKr/5u4fFgStse/T7EifFPnnYl9zPq4vmUOPrRndgoHjDti1gOPqlyXoifcRNGQzUd31lDyfHmob1Gp35vSr+P6vilcQ5Egtyd8YF/ySg9NhPM+9M/IOaHwp5+PSZayXTvCogEUwlatC3J8LLwYtcWB8EuDXQVuCkV5/B4eNHb7wGBs87LBDS+xjdVSn09wq1G8dFM+9tSUhIGneLvUdniKxKpTYljCpu3j7rVWlHj/P23v4NPGUEyeCQnexe9lJjzEQqMjJs+EzNAX6B98dBZVRmroJx95x/A/6gln18EyfCUsl+qdXb/tjvfbw+mwforpUOBz4XLVoBwAn3aWnfeH246NyBXhrq7TTN5lNSP9RkU+puUJm3W2Tsdq0nZWM07srk7MwQrZSRysjjGWBLRJNsNbfj2JMR4AbxpU1XLAb9Mxfpsq5EjMuuiR8L0JiHOOBX3hiUvOmavN0nMueSzcceFk0BK4pMqLo7vDD1Z0qrtDx7Itt4Xwm9UqbMmk8S0Dtuzb2pvOU99Z1nLTOfleNmvfZfP2pYZmPfajwosKdDBNpacNpVGGsWX9CyDI8Xq/Sj6QAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTExLTEwVDAzOjE3OjU4LTA1OjAwF+tHyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMS0xMFQwMzoxNzo1OC0wNTowMGa2/3UAAAAASUVORK5CYII=",height:20,width:20,type:"esriPMS",angle:0})}}_createWindBarbsRenderer(){const e=Array.from(Array(31).keys()).map(a=>5*a),t=[{range:"0-5",path:"M20 20 M5 20 A15 15 0 1 0 35 20 A15 15 0 1 0 5 20 M20 20 M10 20 A10 10 0 1 0 30 20 A10 10 0 1 0 10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTIwIDIwIE01IDIwIEExNSAxNSAwIDEgMCAzNSAyMCBBMTUgMTUgMCAxIDAgNSAyMCBNMjAgMjAgTTEwIDIwIEExMCAxMCAwIDEgMCAzMCAyMCBBMTAgMTAgMCAxIDAgMTAgMjAiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"5-10",path:"M25 0 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"10-15",path:"M25 0 L25 40 L10 45 L25 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"15-20",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjEyIDAgMTUgNDUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"20-25",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"25-30",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIEwyNSAzNSBNMjUgMzAgTDE3LjUgMzIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"30-35",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"35-40",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"40-45",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"45-50",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"50-55",path:"M25 0 L25 40 L10 40 L25 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"55-60",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxNy41IDMyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"60-65",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"65-70",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"70-75",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"75-80",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"80-85",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"85-90",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxNy41IDE3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"90-95",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"95-100",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20 L25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCBMMjUgMTUgTTI1IDEwIEwxNy41IDEyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"100-105",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"105-110",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDE3LjUgMjcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"110-115",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"115-120",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDE3LjUgMjIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"120-125",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"125-130",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDE3LjUgMTcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"130-135",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"135-140",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDE3LjUgMTIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"140-145",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"145-150",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IE0yNSAxMCBNMjUgNSBMMTcuNSA3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="}],i=Ae.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAQAAADtq6NDAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEY0lEQVRIx5XXWWxWRRQH8N+d+31tUdGAVjGglYJABFEBY91jfDAg7piYaFTccA++uMQEFRcSXlATtxiXqMQt4G4iisYl0ai4sIQYtVFZ1KIFKdTS0l4f7vRCS5fPebozc+bM/2z/Mzcx0AgSiUxXnKfIdMn875FIhX53U2n/B/s+kKM4UINTjTBZImixxnrv+9a2iL6zEoUBXcoudrWj/OtHm3wt02lfU9Qao9OnHvIhgmww84MEl1qnxfNmGrqHxAizLdPpC6chGcAxKGGcL+30gOERf1BSpUqVslQSV8d5ReZFe8VQ9avufJn31cWwlJV7iafKStGOE/1qvfH9qUxxu8ydUdmuSKbGO8YUdT2inKLG69pM70tliktl5qIkCAJGmusDG7Vqsc0WjZa4UBlBiA5YZIcjYzB7qDtH5kaUJFLs7RGZTZ42W4PRRmtwvbdt1+wGiaS4drEtDttdZYIDNVuAclR3vA3+dI3qHqmVSy7U6Tv1MScCPvPR7nIpFlsdCy3FdTLPGhK92e2CUITjMJ9ocwKxnsZqc3O3JwMma3d6UVLnyVxB4aXemZqvPqLdpJhW3KVVbY4yYImPo6M5Urv50fj+0z/FG9YaEiENs8UtMfXUaTeTePNHlhXfA1UU+2lyD1Il3Gtt9+adfpNG7dNlpg2U/T3KYLZ2dUWFdTgp3/rQ4sK973qnInV5TIf40x3dhvrJPBiqyWUo4wAtLqhQYS71qK+QKOFRywmGK/kpikzV6WMKhh58vGWs4TIJNjiEYLIuP8Tt4/zmLyqk+AyrJSbF+Qq1DgqRUPMxyl+9q3IQhX/rMCJ6tEunriDs1oSyQZKlr9AkhT2ZIARbJfaJS1vtVbHB+Rgi0RK/y1q1BWsEEyLoz40xtGKcARPVWB1BTPO7f4LNtpkUl1aoMbViLyZo0GRjPD3BxnxjqXeLYlvhqYrzMMG3HoyJXa3JjfnGlbYYFlP7Jh3qKsKY4hQ7TY0nG+xwRL61n63mxHtqNHosigyMLmClNwvuecFnOZB88nNBDzNkzhxEZaKMBVoKapggMzvHHXBEpNSSFAvtcFRsVn0bW8LlMmcXs+c0Kne3gRR32+zg4uXwjC6zit6Wt4a8LXVfcp/MtQXHn2ynGbuCmb8GvvFeJLEE82ReU9/n6+dkq2x3buG9Wn94smcgAw631RPR7BTH+kbmHReZoEpOdEe7zWqZl40s0JWs9Hmv7hjBHqPDwsjGKVJnWWqjbdZp1KhJi0aPmxYZsIRhlttgeF+Jlke41QcOQKoqilSb6HJzSvNG3G/UoWnxwsmt+sVaYwd63dRbqdnMyCPVeyRPvpYgdavM22oGKoMUVRbJfOWMwidJ8Zzb1UvmWK/VVUXzHaTjjrVYh1897HT7xxYEVUaa5SWb/WO+YUWa9SrwvigzM8YlzlYv2GSdVCYxxlBtVnnFq5olwp5/BEk/OLsf5LUmG2+inRJdVvjZ97ZH9/zP34ug1O91pf4p+D+JYBpvrKxfbwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0xMS0xMFQwMzoxMjowOS0wNTowMB9ViV0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTQtMTEtMTBUMDM6MTI6MDktMDU6MDBuCDHhAAAAAElFTkSuQmCC",height:20,width:20,type:"esriPMS",angle:0}),n=e.map((a,r)=>{let o;if(r!==e.length-1)if(r===0)o={minValue:a,maxValue:e[r+1],symbol:i};else{const c=Ae.fromJSON({type:"esriPMS",imageData:t[r].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});o={minValue:a,maxValue:e[r+1],symbol:c}}return new Xe(o)});return{defaultSymbol:i,classBreakInfos:n}}_getClassBreaks(e,t){return t.map((i,n)=>new Xe({minValue:e[n],maxValue:e[n+1],symbol:this._getDefaultSymbol(new f(i))}))}};s([l({type:String,json:{write:!0}})],v.prototype,"attributeField",void 0),s([l({type:oe.apiValues,json:{type:oe.jsonValues,read:{reader:oe.read},write:{writer:oe.write}}})],v.prototype,"flowRepresentation",void 0),s([l({type:["geographic","arithmetic"],json:{write:!0}})],v.prototype,"rotationType",void 0),s([l({type:re.apiValues,json:{type:re.jsonValues,read:{reader:re.read},write:{writer:re.write}}})],v.prototype,"style",void 0),s([l({json:{write:!0}})],v.prototype,"symbolTileSize",void 0),s([l({type:H.apiValues,json:{type:H.jsonValues,write:{writer:H.write}}})],v.prototype,"inputUnit",void 0),s([U("inputUnit")],v.prototype,"readInputUnit",null),s([l({type:H.apiValues,json:{type:H.jsonValues,read:{reader:H.read},write:{writer:H.write}}})],v.prototype,"outputUnit",void 0),s([U("outputUnit")],v.prototype,"readOutputUnit",null),s([W({vectorField:"vector-field"})],v.prototype,"type",void 0),s([l({type:he})],v.prototype,"styleRenderer",null),s([l({type:dt})],v.prototype,"sizeVariables",null),s([l({type:pt})],v.prototype,"rotationVariables",null),v=Le=s([N("esri.renderers.VectorFieldRenderer")],v);const Ge=v,et={key:"type",base:null,typeMap:{"unique-value":Ee,"class-breaks":he,"raster-colormap":Pe,"raster-stretch":Ve,"vector-field":Ge,"raster-shaded-relief":ft,flow:It}},tt={...et,typeMap:{...et.typeMap}};delete tt.typeMap["vector-field"],delete tt.typeMap.flow;const pi={uniqueValue:Ee,classBreaks:he,rasterStretch:Ve,rasterColormap:Pe,vectorField:Ge,rasterShadedRelief:ft,flowRenderer:It};function mi(e){return e&&pi[e.type]||null}function Wi(e,t){if(!e)return null;if(e.type==="classBreaks"&&e.classificationMethod){const n=e.authoringInfo||{classificationMethod:""};n.classificationMethod=e.classificationMethod,e.authoringInfo=n}e.type==="vectorField"&&e.visualVariables&&!Array.isArray(e.visualVariables)&&(e.visualVariables=[e.visualVariables]);const i=mi(e);if(i){const n=new i;return n.read(e,t),n}return t&&t.messages&&e&&t.messages.push(new Gt("renderer:unsupported","Renderers of type '"+(e.type||"unknown")+"' are not supported",{definition:e,context:t})),null}var xe;let V=xe=class extends j{constructor(e){super(e),this.variableName=null,this.dimensionName=null,this.values=[],this.isSlice=!1}clone(){return new xe({variableName:this.variableName,dimensionName:this.dimensionName,values:A(this.values),isSlice:this.isSlice})}};s([l({type:String,json:{write:!0}})],V.prototype,"variableName",void 0),s([l({type:String,json:{write:!0}})],V.prototype,"dimensionName",void 0),s([l({type:K.array(K.oneOf([K.native(Number),K.array(K.native(Number))])),json:{write:!0}})],V.prototype,"values",void 0),s([l({type:Boolean,json:{write:!0}})],V.prototype,"isSlice",void 0),V=xe=s([N("esri.layers.support.DimensionalDefinition")],V);const ee=V,$i=te()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),_i=te()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"}),De=te()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"});let Z=class extends j{constructor(){super(...arguments),this.pixelType="unknown"}};s([l({type:String,json:{write:!0}})],Z.prototype,"name",void 0),s([l({type:String,json:{write:!0}})],Z.prototype,"description",void 0),s([l({type:E,json:{type:E,write:!0,name:"_object_id"}})],Z.prototype,"id",void 0),s([l({type:String,json:{type:De.jsonValues,read:De.read,write:De.write}})],Z.prototype,"pixelType",void 0),s([l({type:String,json:{write:!0}})],Z.prototype,"type",void 0),Z=s([N("esri.layers.support.RasterFunctionInfo")],Z);const Mi=Z;let R=class extends j{constructor(){super(...arguments),this.isDataset=!1,this.isPublic=!1,this.type="RasterFunctionVariable"}};s([l({type:String,json:{write:!0}})],R.prototype,"name",void 0),s([l({type:Number,json:{type:E,write:!0,name:"_object_id"}})],R.prototype,"id",void 0),s([l({type:Boolean,json:{write:!0}})],R.prototype,"isDataset",void 0),s([l({type:Boolean,json:{write:!0}})],R.prototype,"isPublic",void 0),s([l({json:{write:!0}})],R.prototype,"value",void 0),s([l({type:String,json:{write:!0}})],R.prototype,"type",void 0),R=s([N("esri.layers.support.RasterFunctionVariable")],R);const gi=R,se={key:"type",base:null,typeMap:{RasterFunctionVariable:gi}};let G=class extends j{};s([l({types:se,json:{types:se,name:"MatchVariable"}})],G.prototype,"matchVariable",void 0),s([l({types:se,json:{types:se,name:"UnionDimension"}})],G.prototype,"unionDimension",void 0),s([l({type:Number,json:{type:E,write:!0,name:"_object_id"}})],G.prototype,"id",void 0),s([l({type:String,json:{write:!0}})],G.prototype,"type",void 0),G=s([N("esri.layers.support.RasterFunctionProperties")],G);const yi=G,be=new Me({0:"mosaic",1:"item",2:"item-group"},{useNumericKeys:!0});let I=class extends j{constructor(){super(...arguments),this.functionType="mosaic",this.type="RasterFunctionTemplate"}};s([l({type:[String],json:{write:!0}})],I.prototype,"aliases",void 0),s([l({type:Object,json:{write:!0}})],I.prototype,"arguments",void 0),s([l({type:String,json:{write:!0}})],I.prototype,"description",void 0),s([l({type:Mi,json:{write:!0,name:"function"}})],I.prototype,"functionInfo",void 0),s([l({type:be.apiValues,json:{type:[0,1,2],read:be.read,write:be.write}})],I.prototype,"functionType",void 0),s([l({type:String,json:{write:!0}})],I.prototype,"group",void 0),s([l({type:String,json:{write:!0}})],I.prototype,"help",void 0),s([l({type:Number,json:{type:E,write:!0,name:"_object_id"}})],I.prototype,"id",void 0),s([l({type:String,json:{write:!0}})],I.prototype,"name",void 0),s([l({type:String,json:{write:!0,name:"definition"}})],I.prototype,"queryDefinition",void 0),s([l({type:String,json:{write:!0}})],I.prototype,"tag",void 0),s([l({type:yi,json:{write:!0}})],I.prototype,"properties",void 0),s([l({type:String,json:{write:!0}})],I.prototype,"thumbnail",void 0),s([l({type:String,json:{write:!0}})],I.prototype,"thumbnailEx",void 0),s([l({json:{type:["RasterFunctionTemplate"],write:!0}})],I.prototype,"type",void 0),I=s([N("esri.layers.support.RasterFunctionTemplate")],I);const At=I;var Be;const ce=new Set(["raster","raster2","dem","fillraster"]),ue=new Set(["rasters"]),it=e=>e&&e.rasterFunction?S.fromJSON(e):e,ve=e=>e&&e instanceof S?e.toJSON():e,ze=e=>(e==null?void 0:e.functionName)&&!e.declaredClass,nt=e=>ze(e)?new S(e):e,hi=e=>{if(e==null)return null;e=A(e);const t={};for(const i of Object.keys(e))ce.has(i.toLowerCase())?t[i]=it(e[i]):ue.has(i.toLowerCase())&&Array.isArray(e[i])?t[i]=e[i].map(it):t[i]=e[i];return t},Ii={types:{key:"type",base:null,typeMap:{RasterFunctionTemplate:At}},json:{write:!0,name:"rasterFunctionDefinition"}};let S=Be=class extends j{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.functionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some(i=>ce.has(i.toLowerCase())&&ze(e[i]))||t.some(i=>ue.has(i.toLowerCase())&&Array.isArray(e[i])&&e[i].some(n=>ze(n)))){e=A(e);for(const i of t)ce.has(i.toLowerCase())?e[i]=nt(e[i]):ue.has(i.toLowerCase())&&Array.isArray(e[i])&&(e[i]=e[i].map(n=>nt(n)))}}this._set("functionArguments",e)}readFunctionArguments(e){return hi(e)}writeFunctionArguments(e,t,i){const n={};for(const a of Object.keys(e))ce.has(a.toLowerCase())?n[a]=ve(e[a]):ue.has(a.toLowerCase())&&Array.isArray(e[a])?n[a]=e[a].map(ve):n[a]=ve(e[a]);t[i]=n}readFunctionName(e,t){const i=t.rasterFunctionInfos;return t.name||(i&&i.length&&i[0].name!=="None"?i[0].name:t.rasterFunctionDefinition?t.rasterFunctionDefinition.name:t.rasterFunction)}get rasterFunctionDefinition(){var e;return(e=this.functionDefinition)==null?void 0:e.toJSON()}set rasterFunctionDefinition(e){this.functionDefinition=e?At.fromJSON(e):null}clone(){return new Be({functionName:this.functionName,functionArguments:A(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:A(this.rasterFunctionDefinition)})}};s([l({json:{type:Object,name:"rasterFunctionArguments"}})],S.prototype,"functionArguments",null),s([U("functionArguments")],S.prototype,"readFunctionArguments",null),s([ge("functionArguments")],S.prototype,"writeFunctionArguments",null),s([l({json:{type:String,write:{target:"rasterFunction"}}})],S.prototype,"functionName",void 0),s([U("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],S.prototype,"readFunctionName",null),s([W({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1}),l({json:{default:"unknown"}})],S.prototype,"outputPixelType",void 0),s([l({type:String,json:{read:!0,write:!0}})],S.prototype,"variableName",void 0),s([l()],S.prototype,"rasterFunctionDefinition",null),s([l(Ii)],S.prototype,"functionDefinition",void 0),S=Be=s([N("esri.layers.support.RasterFunction")],S);const me=S;var Ue;const Y=te()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),ke=te()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function wi(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return ke.fromJSON(t)}let h=Ue=class extends j{constructor(e){super(e),this.ascending=!0,this.itemRasterFunction=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(e,t){return t.ascending!=null?t.ascending:t.sortAscending==null||t.sortAscending}get itemRenderingRule(){return de(pe.getLogger(this),"itemRenderingRule",{replacement:"itemRasterFunction",version:"4.27",warnOnce:!0}),this._get("itemRasterFunction")}set itemRenderingRule(e){de(pe.getLogger(this),"itemRenderingRule",{replacement:"itemRasterFunction",version:"4.27",warnOnce:!0}),this._set("itemRasterFunction",e)}readMethod(e,t){return wi(t.mosaicMethod||t.defaultMosaicMethod)}writeMultidimensionalDefinition(e,t,i){e!=null&&(e=e.filter(({variableName:n,dimensionName:a})=>n&&n!=="*"||a)).length&&(t[i]=e.map(n=>n.toJSON()))}readOperation(e,t){const i=t.mosaicOperation,n=t.mosaicOperator&&t.mosaicOperator.toLowerCase(),a=i||(n?Y.toJSON(n):null);return Y.fromJSON(a)||"first"}castSortValue(e){return e==null||typeof e=="string"||typeof e=="number"?e:`${e}`}clone(){return new Ue({ascending:this.ascending,itemRasterFunction:A(this.itemRasterFunction),lockRasterIds:A(this.lockRasterIds),method:this.method,multidimensionalDefinition:A(this.multidimensionalDefinition),objectIds:A(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:A(this.viewpoint),where:this.where})}};s([l({type:Boolean,json:{write:!0}})],h.prototype,"ascending",void 0),s([U("ascending",["ascending","sortAscending"])],h.prototype,"readAscending",null),s([l({type:me,json:{name:"itemRenderingRule",write:!0}})],h.prototype,"itemRasterFunction",void 0),s([l({type:me})],h.prototype,"itemRenderingRule",null),s([l({type:[E],json:{write:{overridePolicy(){return{enabled:this.method==="lock-raster"}}}}})],h.prototype,"lockRasterIds",void 0),s([l({type:String,json:{type:ke.jsonValues,write:{target:"mosaicMethod",writer:ke.write}}})],h.prototype,"method",void 0),s([U("method",["mosaicMethod","defaultMosaicMethod"])],h.prototype,"readMethod",null),s([l({type:[ee],json:{write:!0}})],h.prototype,"multidimensionalDefinition",void 0),s([ge("multidimensionalDefinition")],h.prototype,"writeMultidimensionalDefinition",null),s([l({type:[E],json:{name:"fids",write:!0}})],h.prototype,"objectIds",void 0),s([l({json:{type:Y.jsonValues,read:{reader:Y.read},write:{target:"mosaicOperation",writer:Y.write}}})],h.prototype,"operation",void 0),s([U("operation",["mosaicOperation","mosaicOperator"])],h.prototype,"readOperation",null),s([l({type:String,json:{write:{overridePolicy(){return{enabled:this.method==="attribute"}}}}})],h.prototype,"sortField",void 0),s([l({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:this.method==="attribute",allowNull:!0}}}}})],h.prototype,"sortValue",void 0),s([Ot("sortValue")],h.prototype,"castSortValue",null),s([l({type:ye,json:{write:!0}})],h.prototype,"viewpoint",void 0),s([l({type:String,json:{write:!0}})],h.prototype,"where",void 0),h=Ue=s([N("esri.layers.support.MosaicRule")],h);const fi=h;var Re;const Ai={base:Jt,key:"type",typeMap:{extent:Se,polygon:Ft}};let O=Re=class extends j{constructor(e){super(e),this.areaOfInterest=null,this.subsetDefinitions=null}get dimensions(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Map;e.forEach(n=>{if(!n.dimensionName)return;let a,r;if(Array.isArray(n.values[0])){const o=n.values;a=o[0][0],r=o[n.values.length-1][1]}else{const o=n.values;a=o[0],r=o[n.values.length-1]}if(t.has(n.dimensionName)){const o=t.get(n.dimensionName);o[0]=Math.min(a,o[0]),o[1]=Math.max(r,o[1])}else t.set(n.dimensionName,[a,r])});const i=[];for(const n of t)i.push({name:n[0],extent:n[1]});return i}get variables(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Set;return e.forEach(i=>{i.variableName&&t.add(i.variableName)}),[...t]}clone(){var i;const e=(i=this.subsetDefinitions)==null?void 0:i.map(n=>n.clone()),t=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new Re({areaOfInterest:t,subsetDefinitions:e})}};s([l({types:Ai,json:{read:mt,write:!0}})],O.prototype,"areaOfInterest",void 0),s([l({readOnly:!0})],O.prototype,"dimensions",null),s([l({readOnly:!0})],O.prototype,"variables",null),s([l({type:[ee],json:{write:!0}})],O.prototype,"subsetDefinitions",void 0),O=Re=s([N("esri.layers.support.MultidimensionalSubset")],O);const qi=O;let en=class{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const t=await Wt("RasterWorker");this._destroyed?t.close():this._workerThread=t}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");const n=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:t.pixelBlock.toJSON(),type:t.dataType},i);return n?new P(n):null}computeStatisticsHistograms(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");return this._workerThread.invoke("computeStatisticsHistograms",{pixelBlock:t.pixelBlock.toJSON()},i)}async decode(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");const n=await this._workerThread.invoke("decode",t,i);return n?new P(n):null}async symbolize(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");const n={extent:t.extent&&t.extent.toJSON(),pixelBlock:t.pixelBlock!=null&&t.pixelBlock.toJSON(),simpleStretchParams:t.simpleStretchParams,bandIds:t.bandIds},a=await this._workerThread.invoke("symbolize",n,i);return a?new P(a):null}async updateSymbolizer(t,i){var a;if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");const n=(a=t==null?void 0:t.rendererJSON)==null?void 0:a.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:t.toJSON(),histograms:n},i))}async updateRasterFunction(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:t.toJSON()},i))}async process(t,i){var a,r;if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");const n=await this._workerThread.invoke("process",{extent:(a=t.extent)==null?void 0:a.toJSON(),primaryPixelSizes:(r=t.primaryPixelSizes)==null?void 0:r.map(o=>o!=null?o.toJSON():null),primaryPixelBlocks:t.primaryPixelBlocks.map(o=>o!=null?o.toJSON():null),primaryRasterIds:t.primaryRasterIds},i);return n?new P(n):null}async stretch(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const n={srcPixelBlock:t.pixelBlock.toJSON(),stretchParams:t.stretchParams},a=await this._workerThread.invoke("stretch",n,i);return a?new P(a):null}async split(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const n={srcPixelBlock:t.pixelBlock.toJSON(),tileSize:t.tileSize,maximumPyramidLevel:t.maximumPyramidLevel},a=await this._workerThread.invoke("split",n,i);return a&&a.forEach((r,o)=>{a.set(o,r?P.fromJSON(r):null)}),a}async estimateStatisticsHistograms(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const n={srcPixelBlock:t.pixelBlock.toJSON()};return await this._workerThread.invoke("estimateStatisticsHistograms",n,i)}async mosaicAndTransform(t,i){var r;if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");if(!((r=t==null?void 0:t.srcPixelBlocks)!=null&&r.length))return{pixelBlock:null};const n={...t,srcPixelBlocks:t.srcPixelBlocks.map(o=>o!=null?o.toJSON():null)},a=await this._workerThread.invoke("mosaicAndTransform",n,i);return{pixelBlock:a.pixelBlock?new P(a.pixelBlock):null,localNorthDirections:a.localNorthDirections}}async createFlowMesh(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");const n={buffer:t.flowData.data.buffer,maskBuffer:t.flowData.mask.buffer,width:t.flowData.width,height:t.flowData.height},{meshType:a,simulationSettings:r}=t,o=await this._workerThread.invoke("createFlowMesh",{meshType:a,flowData:n,simulationSettings:r},{...i,transferList:[n.buffer,n.maskBuffer]});return{vertexData:new Float32Array(o.vertexBuffer),indexData:new Uint32Array(o.indexBuffer)}}getProjectionOffsetGrid(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");const n=t.datumTransformation!=null?t.datumTransformation.steps.map(o=>({wkid:o.wkid,wkt:o.wkt,isInverse:o.isInverse})):null,a=t.rasterTransform!=null?t.rasterTransform.toJSON():null,r={projectedExtent:t.projectedExtent.toJSON(),srcBufferExtent:t.srcBufferExtent.toJSON(),pixelSize:t.pixelSize,hasWrapAround:t.hasWrapAround,spacing:t.spacing,datumTransformationSteps:n,rasterTransform:a,isAdaptive:t.isAdaptive,includeGCSGrid:t.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",r,i)}};function Dt(e,t,i){var r;const n=t.shift();if(i.length===0){const o=[];i.push({sliceId:-1,multidimensionalDefinition:o})}const a=i.length;for(let o=0;o{i.push({sliceId:-1,multidimensionalDefinition:[...c,{variableName:e,dimensionName:n.name,values:[d]}]})})}t.length&&Dt(e,t,i)}function nn(e,t){const i=[];let n=0;return(t?e.variables.filter(a=>a.name.toLowerCase()===t.toLowerCase()):[...e.variables].sort((a,r)=>a.name>r.name?1:-1)).forEach(a=>{const r=[],o=[...a.dimensions].sort((c,d)=>c.name>d.name?-1:1);Dt(a.name,o,r),r.forEach(c=>{i.push({...c,sliceId:n++})})}),i}function an(e,t,i){let n=e;if(t&&(t=[...t].sort((a,r)=>a.dimensionName{r.length&&(n=n.filter(c=>{const d=c.multidimensionalDefinition.find(p=>p.dimensionName===a);if(d==null)return!1;const u=d.values[0];return typeof u=="number"?typeof r[0]=="number"?r.includes(u):r.some(p=>p[0]<=u&&p[1]>=u):typeof r[0]=="number"?r.some(p=>u[0]<=p&&u[1]>=p):o?r.some(p=>p[0]===u[0]&&p[0]===u[1]):r.some(p=>p[0]>=u[0]&&p[0]<=u[1]||p[1]>=u[0]&&p[1]<=u[1]||p[0]u[1])}))}),n.length&&i&&i.start!=null&&i.end!=null){const a=i.start.getTime(),r=i.end.getTime(),o=n[0].multidimensionalDefinition.findIndex(c=>c.dimensionName==="StdTime");o>-1&&(n=n.filter(c=>{const d=c.multidimensionalDefinition[o].values[0];return a<=d&&r>=d}))}return n.map(a=>a.sliceId)}function bt(e,t){return Array.isArray(e)?t[0]===t[1]?e[0]===t[0]||e[1]===t[0]:e[0]>=t[0]&&e[0]<=t[1]&&e[1]>=t[0]&&e[1]<=t[1]:e>=t[0]&&e<=t[1]}function Di(e,t){return e[0]<=t[0]&&e[1]>=t[0]||e[0]<=t[1]&&e[1]>=t[1]||e[0]>=t[0]&&e[1]<=t[1]}function vt(e){return e.length===1?[e[0],e[0]]:[e[0],e[e.length-1]]}function St(e,t,i){var o,c;if(!((o=t==null?void 0:t.subsetDefinitions)!=null&&o.length))return e;let n;if(i){const{variables:d}=t;if(d.length&&!d.includes(i))return null;const u=t.subsetDefinitions.find(p=>p.dimensionName===e.name&&p.variableName===i);if(!((c=u==null?void 0:u.values)!=null&&c.length))return e;n=vt(u.values)}else{const d=t.dimensions.find(({name:u})=>u===e.name);n=d==null?void 0:d.extent}const a=n;if(!a||!(a!=null&&a.length))return e;const r=e.values.filter(d=>bt(d,a));return{...e,extent:[...a],values:r}}function Nt(e,t,i){var a;if(!((a=t==null?void 0:t.subsetDefinitions)!=null&&a.length))return!1;const{variables:n}=t;if(n.length&&e.some(({variableName:r})=>r&&!n.includes(r)))return!0;for(let r=0;r(o.variableName===""||d.variableName===o.variableName)&&d.dimensionName===o.dimensionName);if(c!=null&&c.values.length){const d=vt(c.values);if(!o.isSlice&&o.values.length===2&&!Array.isArray(o.values[0])&&o.values[0]!==o.values[1]&&i){if(!Di(o.values,d))return!0}else if(o.values.some(u=>!bt(u,d)))return!0}}return!1}function rn(e,t){if(e==null)return{isOutside:!1};const{geometry:i,timeExtent:n,multidimensionalDefinition:a}=t;let r=null;if(n!=null&&(r=bi(e,n),r==null))return{isOutside:!0};const{areaOfInterest:o}=e;if(o&&i){const c=i.type==="point"?i:i.type==="extent"?i.center:i.type==="polygon"?i.centroid:null;if(c&&!o.contains(c))return{isOutside:!0}}return a!=null&&a.length&&Nt(a,e,!0)?{isOutside:!0}:{isOutside:!1,intersection:{geometry:i,timeExtent:r,multidimensionalDefinition:a}}}function bi(e,t){const i=e.dimensions.find(({name:o})=>o==="StdTime");if(i==null||t.start==null&&t.end==null)return t;t=t.clone();const{start:n,end:a}=t.toJSON(),r=n===a?[n]:n!=null&&a!=null?[n,a]:[n??a];return r.length===2&&(i!=null&&i.extent.length)&&(r[0]=Math.max(r[0],i.extent[0]),r[1]=Math.min(r[1],i.extent[1]??i.extent[0]),r[1]r.variables.includes(w))),d?u.find(({name:w})=>w===d)??u[0]:u[0]}function on(e,t={}){const i=vi(e,t);if(!i)return null;const n=[],{dimensions:a,name:r}=i;if(a.length===0)return[new ee({variableName:r,dimensionName:"",values:[],isSlice:!0})];for(let o=0;o{if(t.values==null)return!0;const i=t.values.length;return i===0||i>1||!t.isSlice&&Array.isArray(t.values[0])})}function ln(e,t){var n;if(t==null||e==null)return null;let i=t.variables.map(a=>({...a}));return(n=e==null?void 0:e.variables)!=null&&n.length&&(i=i.filter(({name:a})=>e.variables.includes(a)),i.forEach(a=>{a.dimensions=a.dimensions.map(r=>St(r,e,a.name)).filter($t)})),i}function Si(e,t){var c;const{values:i}=t;if(i!=null&&i.length){const d=Array.isArray(i[0]),u=Array.isArray(e);return d!==u?-1:d&&u?i.findIndex(p=>p[0]===e[0]&&p[1]===e[1]):i.indexOf(e)}const{extent:n}=t;if(Array.isArray(e)||en[1])return-1;const a=t.interval||1;if(t.unit!=="ISO8601")return Math.round((e-n[0])/a);const r=n[0];let o=-1;switch(((c=t.intervalUnit)==null?void 0:c.toLowerCase())||"seconds"){case"seconds":o=Math.round((e-r)/1e3/a);break;case"minutes":o=Math.round((e-r)/6e4/a);break;case"hours":o=Math.round((e-r)/36e5/a);break;case"days":o=Math.round((e-r)/864e5/a);break;case"months":{const d=new Date(e).getUTCFullYear()-new Date(r).getUTCFullYear(),u=new Date(r).getUTCMonth(),p=new Date(e).getUTCMonth();o=d===0?p-u:p+11-u+12*(d-1)}break;case"years":o=Math.round((new Date(e).getUTCFullYear()-new Date(r).getUTCFullYear())/a);break;case"decades":o=Math.round((new Date(e).getUTCFullYear()-new Date(r).getUTCFullYear())/10/a)}return o}function at(e){var o,c;let t=(o=e.values)==null?void 0:o.length;if(t)return t;const{extent:i,unit:n}=e,a=e.interval||1,r=i?i[1]-i[0]:0;if(n!=="ISO8601")return Math.round(r/a);switch(((c=e.intervalUnit)==null?void 0:c.toLowerCase())??"seconds"){case"seconds":t=Math.round(r/1e3/a);break;case"minutes":t=Math.round(r/6e4/a);break;case"hours":t=Math.round(r/36e5/a);break;case"days":t=Math.round(r/864e5/a);break;case"months":{const d=new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear(),u=new Date(i[0]).getUTCMonth(),p=new Date(i[1]).getUTCMonth();t=d===0?p-u+1:p+11-u+12*(d-1)+1}break;case"years":t=Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/a);break;case"decades":t=Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/10/a);break;default:t=0}return t}function cn(e,t){let i=0;const n=e[0].variableName,a=[...t.variables].sort((r,o)=>r.name>o.name?1:-1);for(let r=0;rp.name>m.name?-1:1);if(o.name!==n){i+=c.map(p=>at(p)).reduce((p,m)=>p*m);continue}const d=c.map(p=>at(p)),u=c.length;for(let p=0;pD.dimensionName===c[p].name);if(m==null)return null;const w=Si(m.values[0],c[p]);if(w===-1)return null;d.shift(),i+=p===u-1?w:w*d.reduce((D,M)=>D*M)}break}return i}const Ni=.25,ji=Mt.fromJSON({type:"multipart",colorRamps:[{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]}),rt=Mt.fromJSON(oi[0]),jt=new Set(["scientific","standard-time","vector-uv","vector-magdir","vector-u","vector-v","vector-magnitude","vector-direction"]);function un(e,t){const{attributeTable:i,colormap:n}=e;if(Ze(e)){const a=Hi(e);if(a!=null)return a}if(n!=null){const a=ki(e);if(a!=null)return a}if(i!=null){const a=zi(e);if(a!=null)return a}return Ti(e,t)}function dn(e,t=!1){const i=["raster-stretch"];return gt(e,t)&&i.push("raster-colormap"),yt(e)&&i.push("unique-value"),si(e,t)&&i.push("class-breaks"),li(e)&&i.push("raster-shaded-relief"),Ze(e)&&i.push("vector-field"),ci(e)&&i.push("flow"),i}function pn(e,t,i){const n=["nearest","bilinear","cubic","majority"].find(a=>a===(i==null?void 0:i.toLowerCase()));return t==="Map"?n??"bilinear":e.dataType==="standard-time"?n??"nearest":e.dataType==="thematic"||e.attributeTable||e.colormap?n==="nearest"||n==="majority"?n:"nearest":n??"bilinear"}function Ti(e,t){e=Ci(e,t==null?void 0:t.variableName);const{bandCount:i}=e;let{bandIds:n,stretchType:a}=t||{};n!=null&&n.some(m=>m>=i)&&(n=null);let r=e.statistics,o=e.histograms;i>1?(n=n!=null&&n.length?n:Li(e),r=r==null?null:n==null?void 0:n.map(m=>r[m]),o=o==null?null:n==null?void 0:n.map(m=>o[m])):n=[0],a==null&&(a=Bi(e));let c=!1;switch(a){case"none":c=!1;break;case"percent-clip":c=!(o!=null&&o.length);break;default:c=!(r!=null&&r.length)}const{dataType:d}=e,u=(n==null?void 0:n.length)===1&&jt.has(d)?ji:null,p=new Ve({stretchType:a,dynamicRangeAdjustment:c,colorRamp:u,outputMin:0,outputMax:255,gamma:(n==null?void 0:n.length)===1?[1]:[1,1,1],useGamma:!1});return a==="percent-clip"?p.maxPercent=p.minPercent=Ni:a==="standard-deviation"&&(p.numberOfStandardDeviations=2),c||e.multidimensionalInfo==null&&!(t!=null&&t.includeStatisticsInStretch)||(a==="percent-clip"?p.histograms=o:a!=="min-max"&&a!=="standard-deviation"||(p.statistics=r)),p}function Ci(e,t){if(!t)return e;let i=e.statistics,n=e.histograms;const{multidimensionalInfo:a}=e;if(t&&a!=null){const r=a.variables.find(o=>o.name===t);if(r){const{statistics:o,histograms:c}=r;o!=null&&o.length&&(i=o),c!=null&&c.length&&(n=c)}}return ht.fromJSON({...e.toJSON(),statistics:i,histograms:n})}function Li(e){const t=e.bandCount;if(t===1)return null;if(t===2)return[0];const{bandInfos:i}=e;let n;if(i.length===t){const{red:a,green:r,blue:o,nir:c}=xi(i);a!=null&&r!=null&&o!=null?n=[a,r,o]:c!=null&&a!=null&&r!=null&&(n=[c,a,r])}return!n&&t>=3&&(n=[0,1,2]),n}function xi(e){const t={};for(let i=0;i=410&&r<=480&&o>=480&&o<=540?t.blue=i:t.green==null&&r>=490&&r<=560&&o>=560&&o<=610?t.green=i:t.red==null&&r>=595&&r<=670&&o>=660&&o<=730?t.red=i:t.nir==null&&r>=700&&r<=860&&o>=800&&o<=950&&(t.nir=i)}}return t}function Bi(e){let t="percent-clip";const{pixelType:i,dataType:n,histograms:a,statistics:r,multidimensionalInfo:o}=e,c=jt.has(n)||n==="generic"&&o!=null;return i!=="u8"||n!=="processed"&&a!=null&&r!=null?i==="u8"||n==="elevation"||c?t="min-max":a!=null?t="percent-clip":r!=null&&(t="min-max"):t="none",t}function zi(e,t,i,n){if(!yt(e,t))return null;const{attributeTable:a,statistics:r}=e,o=Tt(a,t),c=q(a,"red"),d=q(a,"green"),u=q(a,"blue"),p=new lt,m=[],w=new Set,D=!!(c&&d&&u);if(a!=null)a.features.forEach(M=>{const g=M.attributes[o.name];if(!w.has(M.attributes[o.name])&&g!=null){w.add(g);const x=D&&(c.type==="single"||c.type==="double")&&(d.type==="single"||d.type==="double")&&(u.type==="single"||u.type==="double")&&!a.features.some(k=>k.attributes[c.name]>1||k.attributes[d.name]>1||k.attributes[u.name]>1),z=x?255:1;m.push(new Ye({value:M.attributes[o.name],label:M.attributes[o.name]+"",symbol:{type:"simple-fill",style:"solid",outline:null,color:new f(D?[M.attributes[c.name]*z,M.attributes[d.name]*z,M.attributes[u.name]*z,1]:[0,0,0,0])}}))}});else if(r!=null&&r[0])for(let M=r[0].min;M<=r[0].max;M++)m.push(new Ye({value:M,label:M.toString(),symbol:{type:"simple-fill",style:"solid",outline:null,color:new f([0,0,0,0])}}));if(m.sort((M,g)=>M.value&&typeof M.value.valueOf()=="string"?0:M.value>g.value?1:-1),!D){const M=Ne(rt,{numColors:m.length});m.forEach((g,x)=>g.symbol.color=new f(M[x].slice(1,4))),p.colorRamp=rt}if(i||n){const M=i||Ne(n,{numColors:m.length}).map(g=>g.slice(1));m.forEach((g,x)=>g.symbol.color=new f(M[x])),p.colorRamp=n}return new Ee({field:o.name,uniqueValueInfos:m,authoringInfo:p})}function Tt(e,t,i){let n;return e!=null?(n=t?e.fields.find(a=>t.toLowerCase()===a.name.toLowerCase()):Ui(e.fields),n||(i||(n=e.fields.find(a=>a.type==="string")),n||(n=q(e,"value")))):n=new _t({name:"value"}),n}function Ui(e){let t;for(let i=0;ii.name.toLowerCase()===t)}function ki(e){if(!gt(e))return null;let t;const{attributeTable:i,colormap:n}=e;if(i!=null){const a=q(i,"value"),r=Tt(i,null,!0);r.type==="string"&&(t={},i.features.forEach(o=>{const c=o.attributes;t[c[a.name]]=r?c[r.name]:c[a.name]}))}return Pe.createFromColormap(n,t)}const Ri=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);function Hi(e){if(!Ze(e))return null;let t;if(e.statistics!=null&&e.statistics.length&&(e.dataType==="vector-magdir"||e.dataType==="vector-uv")){const{minMagnitude:a,maxMagnitude:r}=Zi(e.dataType,e.statistics);t=[{type:"size",field:"Magnitude",minSize:10,maxSize:40,minDataValue:a,maxDataValue:r}]}const i=e.multidimensionalInfo!=null?Ri.get(e.multidimensionalInfo.variables[0].unit):null,n=new Ge({visualVariables:t,inputUnit:i,rotationType:"geographic"});return n.visualVariables=[...n.sizeVariables,...n.rotationVariables],n}function ot(e){var t;return{color:(t=e.symbolLayers[0].material)==null?void 0:t.color,type:"esriSFS",style:"esriSFSSolid"}}function mn(e){var t,i;if(e.type==="uniqueValue"){const n=e.uniqueValueInfos,a=n==null?void 0:n[0].symbol;return(t=a==null?void 0:a.symbolLayers)!=null&&t.length&&(e.uniqueValueInfos=n==null?void 0:n.map(r=>({value:r.value,label:r.label,symbol:r.symbol?ot(r.symbol):null}))),e}if(e.type==="classBreaks"){const n=e.classBreakInfos,a=n[0].symbol;return(i=a==null?void 0:a.symbolLayers)!=null&&i.length&&(e.classBreakInfos=n.map(r=>({classMinValue:r.classMinValue,classMaxValue:r.classMaxValue,label:r.label,symbol:r.symbol?ot(r.symbol):null}))),e}return e}function Zi(e,t){let i,n;if(e==="vector-magdir")i=t[0].min,n=t[0].max;else{const a=t[0].min,r=t[0].max,o=t[1].min,c=t[1].max;i=0,n=Math.max(Math.abs(a),Math.abs(o),Math.abs(r),Math.abs(c))}return{minMagnitude:i,maxMagnitude:n}}async function Ct(e,t,i){var Je,Fe,We,$e,_e,Ke;const n=Kt(e),{rasterFunction:a,sourceJSON:r}=t||{},o=a?JSON.stringify(a.rasterFunctionDefinition||a):null,c=Qt({...n.query,renderingRule:o,f:"json"}),d=Xt(c,i);e=n.path;const u=r||await J(e,d).then(T=>T.data),p=u.hasRasterAttributeTable?J(`${e}/rasterAttributeTable`,d):null,m=u.hasColormap?J(`${e}/colormap`,d):null,w=u.hasHistograms?J(`${e}/histograms`,d):null,D=u.currentVersion>=10.3?J(`${e}/keyProperties`,d):null,M=u.hasMultidimensions?J(`${e}/multidimensionalInfo`,d):null,g=await Promise.allSettled([p,m,w,D,M]);let x=null;if(u.minValues&&u.minValues.length===u.bandCount){x=[];for(let T=0;T{var Qe;(Qe=T.statistics)!=null&&Qe.length&&T.statistics.forEach(ne=>{ne.avg=ne.mean,ne.stddev=ne.standardDeviation})});const{defaultVariable:Ie,serviceDataType:ie}=u;Ie&&Ie!==$.DefaultVariable&&($.DefaultVariable=Ie),ie&&ie.includes("esriImageServiceDataTypeVector")&&!ie.includes($.DataType)&&($.DataType=ie.replace("esriImageServiceDataType",""));let we=u.noDataValue;return(Ke=u.noDataValues)!=null&&Ke.length&&u.noDataValues.some(T=>T!==we)&&(we=u.noDataValues),new ht({width:k,height:Lt,bandCount:u.bandCount,extent:Se.fromJSON(u.extent),spatialReference:Oe,pixelSize:new ye({x:u.pixelSizeX,y:u.pixelSizeY,spatialReference:Oe}),pixelType:u.pixelType.toLowerCase(),statistics:x,attributeTable:xt,colormap:Bt,histograms:zt,keyProperties:$,noDataValue:we,multidimensionalInfo:_})}function Mn(e,t,i){return Ct(e,{sourceJSON:t},i)}function gn(e,t,i){return Ct(e,{rasterFunction:t},i)}var He;let B=He=class extends j{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.rasterFunction=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(e,t,i){e!=null&&(t.geometryType=ti(e),t[i]=e.toJSON())}get renderingRule(){return de(pe.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._get("rasterFunction")}set renderingRule(e){de(pe.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",e)}clone(){return new He(A({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};s([l({types:qt,json:{read:mt}})],B.prototype,"geometry",void 0),s([ge("geometry")],B.prototype,"writeGeometry",null),s([l({type:fi,json:{write:!0}})],B.prototype,"mosaicRule",void 0),s([l({type:me})],B.prototype,"renderingRule",null),s([l({type:me,json:{write:!0,name:"renderingRule"}})],B.prototype,"rasterFunction",void 0),s([l({type:ye,json:{write:!0}})],B.prototype,"pixelSize",void 0),s([l({json:{write:!0}})],B.prototype,"raster",void 0),s([l({type:ei,json:{read:{source:"time"},write:{target:"time"}}})],B.prototype,"timeExtent",void 0),B=He=s([N("esri.rest.support.ImageHistogramParameters")],B);const yn=B;export{cn as D,Ci as E,pn as L,me as N,mn as Q,dn as S,an as a,Wi as b,qi as c,tt as d,yn as e,on as f,vi as g,sn as h,nn as i,ln as j,un as k,et as l,Mn as m,$i as n,Nt as o,ee as p,Li as q,_i as r,fi as s,en as t,De as u,gn as v,rn as w}; diff --git a/assets/ImageMaterial-5c48df66.js b/assets/ImageMaterial-5c48df66.js new file mode 100644 index 0000000..c3c208b --- /dev/null +++ b/assets/ImageMaterial-5c48df66.js @@ -0,0 +1,33 @@ +import{ia as m,ib as P,ic as v,a_ as f,id as u,ie as y,ig as O,ih as A,ii as $,hH as r,ij as g,ik as S,il as c,im as C,aw as E,io as x,ip as _,ai as o,iq as n,ir as d,is as w,it as b,iu as N,iv as D,iw as M,ix as I,iy as R,iz as F,iA as L,iB as U,iC as B,iD as G,iE as H,iF as W,iG as z,iH as j,iI as q,hI as p,iJ as Q,iK as V,iL as k,iM as J}from"./index-080e108a.js";function K(a){const e=new m,{vertex:t,fragment:i}=e;return P(t,a),e.include(v,a),e.attributes.add(f.POSITION,"vec3"),e.attributes.add(f.UV0,"vec2"),e.varyings.add("vpos","vec3"),a.hasMultipassTerrain&&e.varyings.add("depth","float"),t.code.add(u` + void main(void) { + vpos = position; + ${a.hasMultipassTerrain?"depth = (view * vec4(vpos, 1.0)).z;":""} + vTexCoord = uv0; + gl_Position = transformPosition(proj, view, vpos); + } + `),e.include(y,a),e.include(O,a),i.uniforms.add(new A("tex",l=>l.texture),new $("opacity",l=>l.opacity)),e.varyings.add("vTexCoord","vec2"),a.output===r.Alpha?i.code.add(u` + void main() { + discardBySlice(vpos); + ${a.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""} + + float alpha = texture(tex, vTexCoord).a * opacity; + if (alpha < ${u.float(g)}) { + discard; + } + + fragColor = vec4(alpha); + } + `):(i.include(S),i.code.add(u` + void main() { + discardBySlice(vpos); + ${a.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""} + fragColor = texture(tex, vTexCoord) * opacity; + + if (fragColor.a < ${u.float(g)}) { + discard; + } + + fragColor = highlightSlice(fragColor, vpos); + ${a.transparencyPassType===c.Color?"fragColor = premultiplyAlpha(fragColor);":""} + } + `)),e}const X=Object.freeze(Object.defineProperty({__proto__:null,build:K},Symbol.toStringTag,{value:"Module"}));class h extends w{initializeProgram(e){return new b(e.rctx,h.shader.get().build(this.configuration),N)}_setPipelineState(e,t){const i=this.configuration,l=e===c.NONE,T=e===c.FrontFace;return D({blending:i.output!==r.Color&&i.output!==r.Alpha||!i.transparent?null:l?Y:M(e),culling:I(i.cullFace),depthTest:{func:R(e)},depthWrite:l?i.writeDepth?F:null:L(e),colorWrite:U,stencilWrite:i.hasOccludees?B:null,stencilTest:i.hasOccludees?t?G:H:null,polygonOffset:l||T?null:W(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._setPipelineState(this.configuration.transparencyPassType,!0),this._setPipelineState(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}h.shader=new C(X,()=>E(()=>import("./ImageMaterial.glsl-42017fca.js"),["assets/ImageMaterial.glsl-42017fca.js","assets/index-080e108a.js","assets/index-a8e73b5e.css"]));const Y=x(_.ONE,_.ONE_MINUS_SRC_ALPHA);class s extends z{constructor(){super(...arguments),this.output=r.Color,this.cullFace=d.None,this.hasSlicePlane=!1,this.transparent=!1,this.enableOffset=!0,this.writeDepth=!0,this.hasOccludees=!1,this.transparencyPassType=c.NONE,this.hasMultipassTerrain=!1,this.cullAboveGround=!1}}o([n({count:r.COUNT})],s.prototype,"output",void 0),o([n({count:d.COUNT})],s.prototype,"cullFace",void 0),o([n()],s.prototype,"hasSlicePlane",void 0),o([n()],s.prototype,"transparent",void 0),o([n()],s.prototype,"enableOffset",void 0),o([n()],s.prototype,"writeDepth",void 0),o([n()],s.prototype,"hasOccludees",void 0),o([n({count:c.COUNT})],s.prototype,"transparencyPassType",void 0),o([n()],s.prototype,"hasMultipassTerrain",void 0),o([n()],s.prototype,"cullAboveGround",void 0);class ae extends j{constructor(e){super(e,new ee),this.supportsEdges=!0,this._configuration=new s}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevationf.toLowerCase());a=R.indexOf("magnitude"),u=R.indexOf("direction")}a!==-1&&a!==null||(a=0,u=1);const p=s.rotationType==="arithmetic"?1:2,m=s.flowRepresentation==="flow-from"?0:1,c=s.visualVariables?s.visualVariables.find(R=>R.field==="Magnitude"):new bt,d={magnitudeBandID:a,directionBandID:u,isUVComponents:r,referenceSystem:p,massFlowAngleRepresentation:m,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:xi[s.style.toLowerCase().replace("-","_")],minimumMagnitude:c.minDataValue,maximumMagnitude:c.maxDataValue,minimumSymbolSize:c.minSize,maximumSymbolSize:c.maxSize};o.functionArguments=d;const y=Z(o);return i.convertToRFT?b.fromJSON({rasterFunctionDefinition:y}):o}function Ti(s,i){const o=i.convertToRFT;if(i.dataType!=="elevation"&&(i.dataType!=="generic"||i.bandCount!==1||i.pixelType!=="s16"&&i.pixelType!=="s32"&&i.pixelType!=="f32"&&i.pixelType!=="f64"))return new b;const e=new b;e.functionName="Hillshade";const t=s.hillshadeType==="traditional"?0:1,r=s.scalingType==="none"?1:3,a={HillshadeType:t,SlopeType:r,ZFactor:s.zFactor};return t===0&&(a.Azimuth=s.azimuth,a.Altitude=s.altitude),r===3&&(a.PSPower=s.pixelSizePower,a.PSZFactor=s.pixelSizeFactor),e.functionArguments=a,e.variableName="Raster",s.colorRamp&&(e.functionName="ShadedRelief",o?a.ColorRamp=pt(s.colorRamp):a.Colormap=ct(s.colorRamp)),o?new b({rasterFunctionDefinition:Z(e)}):e}function Pi(s,i){var u;const o=i.convertToRFT,e=new b;e.functionName="Stretch";const t=xe[ti.toJSON(s.stretchType)],r="u8",a={StretchType:t,Statistics:Ci(s.statistics??[]),DRA:s.dynamicRangeAdjustment,UseGamma:s.useGamma,Gamma:s.gamma,ComputeGamma:s.computeGamma};if(s.outputMin!=null&&(a.Min=s.outputMin),s.outputMax!=null&&(a.Max=s.outputMax),t===xe.standardDeviation?(a.NumberOfStandardDeviations=s.numberOfStandardDeviations,e.outputPixelType=r):t===xe.percentClip?(a.MinPercent=s.minPercent,a.MaxPercent=s.maxPercent,e.outputPixelType=r):t===xe.minMax?e.outputPixelType=r:t===xe.sigmoid&&(a.SigmoidStrengthLevel=s.sigmoidStrengthLevel),e.functionArguments=a,e.variableName="Raster",s.colorRamp){const p=s.colorRamp,m=new b;if(o)m.functionArguments={ColorRamp:pt(p)};else{const c=ii(p,!0);if(c)m.functionArguments={colorRamp:c};else if(!i.convertColorRampToColormap||p.type!=="algorithmic"&&p.type!=="multipart"){const d=s.colorRamp.toJSON();d.type==="algorithmic"?d.algorithm=d.algorithm||"esriCIELabAlgorithm":d.type==="multipart"&&((u=d.colorRamps)!=null&&u.length)&&d.colorRamps.forEach(y=>y.algorithm=y.algorithm||"esriCIELabAlgorithm"),m.functionArguments={colorRamp:d}}else m.functionArguments={Colormap:ct(p)}}return m.variableName="Raster",m.functionName="Colormap",m.functionArguments.Raster=e,o?new b({rasterFunctionDefinition:Z(m)}):m}return o?new b({rasterFunctionDefinition:Z(e)}):e}function Ni(s,i){const o=[],e=[],t=[],r=[],{pixelType:u,rasterAttributeTable:p}=i,m=p==null?null:p.features,c=ft(p);if(c&&m&&Array.isArray(m)&&s.classBreakInfos){s.classBreakInfos.forEach((h,g)=>{var O;const w=(O=h.symbol)==null?void 0:O.color;let S;w!=null&&w.a&&h.minValue!=null&&h.maxValue!=null&&m.forEach(V=>{h.minValue!=null&&h.maxValue!=null&&(S=V.attributes[s.field],(S>=h.minValue&&S=h.minValue)&&r.push([V.attributes[c],w.r,w.g,w.b]))})});const f=u?Me(r,u):r,v=new b;return v.functionName="Colormap",v.functionArguments={},v.functionArguments.Colormap=f,v.variableName="Raster",i.convertToRFT?new b({rasterFunctionDefinition:Z(v)}):v}s.classBreakInfos.forEach((f,v)=>{if(f.minValue==null||f.maxValue==null)return;const h=f.symbol&&f.symbol.color;h!=null&&h.a?(v===0?o.push(f.minValue,f.maxValue+1e-6):o.push(f.minValue+1e-6,f.maxValue+1e-6),e.push(v),r.push([v,h.r,h.g,h.b])):t.push(f.minValue,f.maxValue)});const d=u?Me(r,u):r,y=new b;y.functionName="Remap",y.functionArguments={InputRanges:o,OutputValues:e,NoDataRanges:t},y.variableName="Raster";const R=new b;return R.functionName="Colormap",R.functionArguments={Colormap:d,Raster:y},i.convertToRFT?new b({rasterFunctionDefinition:Z(R)}):R}function Me(s,i){const o=Si.has(i)?ri(i):null;return o&&s.push([Math.floor(o[0]-1),0,0,0],[Math.ceil(o[1]+1),0,0,0]),s}function ft(s){if(s==null)return;const{fields:i}=s,o=i&&i.find(e=>e&&e.name&&e.name.toLowerCase()==="value");return o&&o.name}function _i(s,i){var d,y,R;const o=[],{pixelType:e,rasterAttributeTable:t}=i,r=t==null?null:t.features,a=ft(t),u=(y=(d=s.defaultSymbol)==null?void 0:d.color)==null?void 0:y.toRgb(),p=s.uniqueValueInfos;if(p)if(r){if(a){const f=new Map;p.forEach(h=>{var S;const g=h.value,w=(S=h.symbol)==null?void 0:S.color;g!=null&&w&&w.a&&f.set(String(g),w.toRgb())});const v=s.field;r.forEach(({attributes:h})=>{const g=String(h[v]),w=h[a],S=f.get(g);S?o.push([w,...S]):u&&o.push([w,...u])})}}else for(let f=0;f0?Me(o,e):o,c=new b;return c.functionName="Colormap",c.functionArguments={},c.functionArguments.Colormap=m,c.variableName="Raster",i.convertToRFT?new b({rasterFunctionDefinition:Z(c)}):c}function Oi(s,i){const o=s.extractColormap();if(!o||o.length===0)return null;const{pixelType:e}=i,t=e?Me(o,e):o,r=new b;return r.functionName="Colormap",r.functionArguments={},r.functionArguments.Colormap=t,i.convertToRFT?new b({rasterFunctionDefinition:Z(r)}):r}function Ci(s){const i=[];return s==null||s.forEach(o=>{const e=o;if(Array.isArray(e))i.push(e);else{if(e.min==null||e.max==null)return;const t=[e.min,e.max,e.avg||0,e.stddev||0];i.push(t)}}),i}function ji(s){const i=[],o=[];return s.forEach(e=>{i.push(e[0]),o.push(si([...e.slice(1),255]))}),{type:"RasterColormap",values:i,colors:o}}let P=class extends E{constructor(){super(...arguments),this.layer=null,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}get adjustAspectRatio(){return this.layer.adjustAspectRatio}writeAdjustAspectRatio(i,o,e){this.layer.version<10.3||(o[e]=i)}get bandIds(){return this.layer.bandIds}get compressionQuality(){return this.layer.compressionQuality}writeCompressionQuality(i,o,e){this.format&&this.format.toLowerCase().includes("jpg")&&i!=null&&(o[e]=i)}get compressionTolerance(){return this.layer.compressionTolerance}writeCompressionTolerance(i,o,e){this.format==="lerc"&&i!=null&&(o[e]=i)}get format(){var i;return((i=this.layer.renderer)==null?void 0:i.type)==="vector-field"?"lerc":this.layer.format}get interpolation(){return this.layer.interpolation}get noData(){return this.layer.noData}get noDataInterpretation(){return this.layer.noDataInterpretation}writeLercVersion(i,o,e){this.format==="lerc"&&this.layer.version>=10.5&&(o[e]=i)}get version(){const i=this.layer;return i.commitProperty("bandIds"),i.commitProperty("format"),i.commitProperty("compressionQuality"),i.commitProperty("compressionTolerance"),i.commitProperty("interpolation"),i.commitProperty("noData"),i.commitProperty("noDataInterpretation"),i.commitProperty("mosaicRule"),i.commitProperty("rasterFunction"),i.commitProperty("adjustAspectRatio"),i.commitProperty("pixelFilter"),i.commitProperty("definitionExpression"),i.commitProperty("multidimensionalSubset"),(this._get("version")||0)+1}set version(i){this._set("version",i)}get mosaicRule(){const i=this.layer;let o=i.mosaicRule;const e=i.definitionExpression;return o?e&&e!==o.where&&(o=o.clone(),o.where=e):e&&(o=new L({where:e})),o}get rasterFunction(){var a,u;const i=this.layer;let{rasterFunction:o}=i;const e=i.pixelFilter,t=!i.format||i.format.includes("jpg")||i.format.includes("png");o=this._addResampleRasterFunction(o);const r=(a=i.multidimensionalSubset)==null?void 0:a.areaOfInterest;return r&&(o=this._addClipFunction(o,r)),t&&!e&&((u=i.renderer)==null?void 0:u.type)!=="vector-field"&&(o=this.combineRendererWithRenderingRule(o)),o}combineRendererWithRenderingRule(i){const o=this.layer,{rasterInfo:e,renderer:t}=o;return i=i||o.rasterFunction,!t||!ht(t)?i:Qe(Ii(t,{rasterAttributeTable:e.attributeTable,pixelType:e.pixelType,dataType:e.dataType,bandNames:e.bandInfos.map(({name:r})=>r),convertColorRampToColormap:o.version<10.6,convertToRFT:!!(i!=null&&i.rasterFunctionDefinition),bandCount:e.bandCount}),i)}_addResampleRasterFunction(i){var r;if(((r=this.layer.renderer)==null?void 0:r.type)!=="vector-field"||(i==null?void 0:i.functionName)==="Resample")return i;const o=this.layer.serviceDataType==="esriImageServiceDataTypeVector-UV"?7:10,e=this.layer.serviceRasterInfo.pixelSize;let t=new b({functionName:"Resample",functionArguments:{ResamplingType:o,InputCellSize:e}});return t=i!=null&&i.rasterFunctionDefinition?new b({rasterFunctionDefinition:Z(t)}):t,Qe(t,i)}_addClipFunction(i,o){const e=new b({functionName:"Clip",functionArguments:{ClippingGeometry:o.toJSON(),ClippingType:1}});return Qe(e,i)}};n([l()],P.prototype,"layer",void 0),n([l({json:{write:!0}})],P.prototype,"adjustAspectRatio",null),n([D("adjustAspectRatio")],P.prototype,"writeAdjustAspectRatio",null),n([l({json:{write:!0}})],P.prototype,"bandIds",null),n([l({json:{write:!0}})],P.prototype,"compression",void 0),n([l({json:{write:!0}})],P.prototype,"compressionQuality",null),n([D("compressionQuality")],P.prototype,"writeCompressionQuality",null),n([l({json:{write:!0}})],P.prototype,"compressionTolerance",null),n([D("compressionTolerance")],P.prototype,"writeCompressionTolerance",null),n([l({json:{write:!0}})],P.prototype,"format",null),n([l({type:String,json:{read:{reader:ae.read},write:{writer:ae.write}}})],P.prototype,"interpolation",null),n([l({json:{write:!0}})],P.prototype,"noData",null),n([l({type:String,json:{read:{reader:Ie.read},write:{writer:Ie.write}}})],P.prototype,"noDataInterpretation",null),n([l({json:{write:!0}})],P.prototype,"pixelType",void 0),n([l({json:{write:!0}})],P.prototype,"lercVersion",void 0),n([D("lercVersion")],P.prototype,"writeLercVersion",null),n([l({type:Number})],P.prototype,"version",null),n([l({json:{write:!0}})],P.prototype,"mosaicRule",null),n([l({json:{write:!0,name:"renderingRule"}})],P.prototype,"rasterFunction",null),P=n([F("esri.layers.mixins.ExportImageServiceParameters")],P);let fe=class extends E{constructor(i){super(i),this.north=null,this.up=null,this.spatialReference=null}};n([l({type:Number,json:{write:!0}})],fe.prototype,"north",void 0),n([l({type:Number,json:{write:!0}})],fe.prototype,"up",void 0),n([l({type:he,json:{write:!0}})],fe.prototype,"spatialReference",void 0),fe=n([F("esri.rest.support.ImageAngleResult")],fe);const Vi=fe;let re=class extends E{constructor(){super(...arguments),this.value=null,this.displayValue=null,this.uncertainty=null}};n([l({type:Number,json:{read:!0,write:!0}})],re.prototype,"value",void 0),n([l({type:String,json:{read:!0,write:!0}})],re.prototype,"displayValue",void 0),n([l({type:Number,json:{read:!0,write:!0}})],re.prototype,"uncertainty",void 0),re=n([F("esri.rest.support.ImageMeasureResultValue")],re);let be=class extends re{constructor(){super(...arguments),this.unit=null}};n([l({type:String,json:{read:oe.read,write:oe.write}})],be.prototype,"unit",void 0),be=n([F("esri.rest.support.ImageMeasureResultLengthValue")],be);let Ne=class extends re{constructor(){super(...arguments),this.unit=null}};n([l({type:String,json:{read:Ve.read,write:Ve.write}})],Ne.prototype,"unit",void 0),Ne=n([F("esri.rest.support.ImageMeasureResultAreaValue")],Ne);let De=class extends re{constructor(){super(...arguments),this.unit=null}};n([l({type:String,json:{read:Ae.read,write:Ae.write}})],De.prototype,"unit",void 0),De=n([F("esri.rest.support.ImageMeasureResultAngleValue")],De);let ne=class extends E{constructor(){super(...arguments),this.name=null,this.sensorName=null}};n([l({type:String,json:{read:!0,write:!0}})],ne.prototype,"name",void 0),n([l({type:String,json:{read:!0,write:!0}})],ne.prototype,"sensorName",void 0),ne=n([F("esri.rest.support.BaseImageMeasureResult")],ne);let Fe=class extends ne{constructor(){super(...arguments),this.area=null,this.perimeter=null}};n([l({type:Ne,json:{read:!0,write:!0}})],Fe.prototype,"area",void 0),n([l({type:be,json:{read:!0,write:!0}})],Fe.prototype,"perimeter",void 0),Fe=n([F("esri.rest.support.ImageAreaResult")],Fe);const Ai=Fe;let Re=class extends ne{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};n([l({type:be,json:{read:!0,write:!0}})],Re.prototype,"distance",void 0),n([l({type:De,json:{read:!0,write:!0}})],Re.prototype,"azimuthAngle",void 0),n([l({type:De,json:{read:!0,write:!0}})],Re.prototype,"elevationAngle",void 0),Re=n([F("esri.rest.support.ImageDistanceResult")],Re);const $i=Re;let _e=class extends ne{constructor(){super(...arguments),this.height=null}};n([l({type:be,json:{read:!0,write:!0}})],_e.prototype,"height",void 0),_e=n([F("esri.rest.support.ImageHeightResult")],_e);const Mi=_e;let Q=class extends E{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};n([l({json:{write:!0}})],Q.prototype,"catalogItemVisibilities",void 0),n([l({type:dt,json:{write:!0}})],Q.prototype,"catalogItems",void 0),n([l({type:J,json:{write:!0}})],Q.prototype,"location",void 0),n([l({json:{write:!0}})],Q.prototype,"name",void 0),n([l({json:{write:!0}})],Q.prototype,"objectId",void 0),n([l({json:{write:!0}})],Q.prototype,"processedValues",void 0),n([l({json:{write:!0}})],Q.prototype,"properties",void 0),n([l({json:{write:!0}})],Q.prototype,"value",void 0),Q=n([F("esri.rest.support.ImageIdentifyResult")],Q);const Ji=Q;let Oe=class extends E{constructor(){super(...arguments),this.geometries=null}};n([l({json:{write:!0}})],Oe.prototype,"geometries",void 0),Oe=n([F("esri.rest.support.ImagePixelLocationResult")],Oe);const Ei=Oe;let Ce=class extends ne{constructor(){super(...arguments),this.point=null}};n([l({type:J,json:{name:"point.value",read:!0,write:!0}})],Ce.prototype,"point",void 0),Ce=n([F("esri.rest.support.ImagePointResult")],Ce);const qi=Ce;let Y=class extends E{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};n([l({json:{write:!0}})],Y.prototype,"attributes",void 0),n([l({type:J,json:{write:!0}})],Y.prototype,"location",void 0),n([l({json:{write:!0}})],Y.prototype,"locationId",void 0),n([l({json:{write:!0}})],Y.prototype,"rasterId",void 0),n([l({json:{write:!0}})],Y.prototype,"resolution",void 0),n([l({json:{write:!0}})],Y.prototype,"pixelValue",void 0),Y=n([F("esri.rest.support.ImageSample")],Y);const zi=Y;let je=class extends E{constructor(){super(...arguments),this.samples=null}};n([l({type:[zi],json:{write:!0}})],je.prototype,"samples",void 0),je=n([F("esri.rest.support.ImageSampleResult")],je);const Li=je;function Rt(s){const i=s==null?void 0:s.time;if(i&&(i.start!=null||i.end!=null)){const o=[];i.start!=null&&o.push(i.start),i.end==null||o.includes(i.end)||o.push(i.end),s.time=o.join(",")}}async function vt(s,i,o){const e=ie(s),t=i.geometry?[i.geometry]:[],r=await Je(t),a=i.toJSON();Rt(a);const u=r&&r[0];u!=null&&(a.geometry=u.toJSON());const p=ye({...e.query,f:"json",...a});return ge(p,o)}async function Gi(s,i,o){var p;const e=i.toJSON();e.angleName!=null&&(e.angleName=e.angleName.join(",")),i.point!=null&&((p=i.point.spatialReference)!=null&&p.imageCoordinateSystem)&&(e.point.spatialReference=qe(i.point.spatialReference)),i.spatialReference!=null&&i.spatialReference.imageCoordinateSystem&&(e.spatialReference=wt(i.spatialReference));const t=ie(s),r=ye({...t.query,f:"json",...e}),a=ge(r,o),{data:u}=await N(`${t.path}/computeAngles`,a);return u.spatialReference=u.spatialReference?u.spatialReference.geodataXform!=null?new he({wkid:0,imageCoordinateSystem:u.spatialReference}):he.fromJSON(u.spatialReference):null,u.north==="NaN"&&(u.north=null),u.up==="NaN"&&(u.up=null),new Vi(u)}async function Hi(s,i,o){var m;const e=i.toJSON(),{geometries:t}=i;if(t)for(let c=0;c{u.avg=u.mean,u.stddev=u.standardDeviation}),{statistics:a,histograms:r.histograms}}async function Qi(s,i,o){const e=await vt(s,i,o),t=ie(s),{data:r}=await N(`${t.path}/computeHistograms`,e);return{histograms:r.histograms}}async function Bi(s,i,o){var d,y;const e=i.toJSON();Rt(e),(d=e.outFields)!=null&&d.length&&(e.outFields=e.outFields.join(","));const t=await Je(i.geometry),r=t==null?void 0:t[0];r!=null&&(e.geometry=r.toJSON());const a=ie(s),u=ye({...a.query,f:"json",...e}),p=ge(u,o),{data:m}=await N(`${a.path}/getSamples`,p),c=(y=m==null?void 0:m.samples)==null?void 0:y.map(R=>{const f=R.value==="NaN"||R.value===""?null:R.value.split(" ").map(v=>Number(v));return{...R,pixelValue:f}});return Li.fromJSON({samples:c})}async function nt(s,i,o){const e=ie(s),t=i.geometry?[i.geometry]:[];return Je(t).then(r=>{const a=i.toJSON(),u=r&&r[0];u!=null&&(a.geometry=JSON.stringify(u.toJSON()));const p=ye({...e.query,f:"json",...a}),m=ge(p,o);return N(e.path+"/identify",m)}).then(r=>Ji.fromJSON(r.data))}async function ki(s,i,o){const e=await Ee(s,i,[i.fromGeometry,i.toGeometry],o);return Mi.fromJSON(e)}async function Wi(s,i,o){const e=await Ee(s,i,[i.geometry],o);return Ai.fromJSON(e)}async function Ki(s,i,o){const e=await Ee(s,i,[i.geometry],o);return qi.fromJSON(e)}async function Zi(s,i,o){const e=await Ee(s,i,[i.fromGeometry,i.toGeometry],o);return $i.fromJSON(e)}async function Ee(s,i,o,e){const t=ie(s),r=await Je(o),a=i.toJSON();r[0]!=null&&(a.fromGeometry=JSON.stringify(at(r[0]))),r[1]!=null&&(a.toGeometry=JSON.stringify(at(r[1])));const u=ye({...t.query,f:"json",...a}),p=ge(u,e),{data:m}=await N(t.path+"/measure",p);return m}function at(s){var o;const i=s.toJSON();return(o=s.spatialReference)!=null&&o.imageCoordinateSystem&&(i.spatialReference=qe(s.spatialReference)),i}function qe(s){const{imageCoordinateSystem:i}=s;if(i){const{id:o,referenceServiceName:e}=i;return o!=null?e?{icsid:o,icsns:e}:{icsid:o}:{ics:i}}return s.toJSON()}function wt(s,i){const o=qe(s),{icsid:e,icsns:t,wkid:r}=o;return e!=null?t==null||i!=null&&i.toLowerCase().includes("/"+t.toLowerCase()+"/")?`0:${e}`:JSON.stringify(o):r?r.toString():JSON.stringify(o)}async function Xi(s,i,o){var O,V;const e=ie(s),t=ye({...e==null?void 0:e.query,f:"json"}),r=ge(t,o),a=`${e==null?void 0:e.path}/${i}/info`,u=N(`${a}`,r),p=N(`${a}/keyProperties`,r),m=await Promise.allSettled([u,p]),c=m[0].status==="fulfilled"?m[0].value.data:null,d=m[1].status==="fulfilled"?m[1].value.data:null;let y=null;(O=c.statistics)!=null&&O.length&&(y=c.statistics.map(T=>({min:T[0],max:T[1],avg:T[2],stddev:T[3]})));const R=Pe.fromJSON(c.extent),f=Math.ceil(R.width/c.pixelSizeX-.1),v=Math.ceil(R.height/c.pixelSizeY-.1),h=R.spatialReference,g=new J({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:h}),w=(V=c.histograms)!=null&&V.length?c.histograms:null,S=new ni({origin:c.origin,blockWidth:c.blockWidth,blockHeight:c.blockHeight,firstPyramidLevel:c.firstPyramidLevel,maximumPyramidLevel:c.maxPyramidLevel});return new mt({width:f,height:v,bandCount:c.bandCount,extent:R,spatialReference:h,pixelSize:g,pixelType:c.pixelType.toLowerCase(),statistics:y,histograms:w,keyProperties:d,storageInfo:S})}var Be;let me=Be=class extends E{constructor(s){super(s),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new Be(H({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};n([l({type:[String],json:{name:"angleName",write:!0}})],me.prototype,"angleNames",void 0),n([l({type:J,json:{write:!0}})],me.prototype,"point",void 0),n([l({type:he,json:{write:!0}})],me.prototype,"spatialReference",void 0),n([l({type:$e,json:{write:!0}})],me.prototype,"rasterId",void 0),me=Be=n([F("esri.rest.support.ImageAngleParameters")],me);const Yi=me,G=new St({esriMensurationPoint:"point",esriMensurationCentroid:"centroid",esriMensurationDistanceAndAngle:"distance-and-angle",esriMensurationAreaAndPerimeter:"area-and-perimeter",esriMensurationHeightFromBaseAndTop:"base-and-top",esriMensurationHeightFromBaseAndTopShadow:"base-and-top-shadow",esriMensurationHeightFromTopAndTopShadow:"top-and-top-shadow",esriMensurationPoint3D:"point-3D",esriMensurationCentroid3D:"centroid-3D",esriMensurationDistanceAndAngle3D:"distance-and-angle-3D",esriMensurationAreaAndPerimeter3D:"area-and-perimeter-3D"});let B=class extends E{constructor(){super(...arguments),this.type=null,this.measureOperation=null,this.mosaicRule=null,this.pixelSize=null,this.raster=void 0}};n([l()],B.prototype,"type",void 0),n([l({type:G.apiValues,json:{read:G.read,write:G.write}})],B.prototype,"measureOperation",void 0),n([l({type:L,json:{write:!0}})],B.prototype,"mosaicRule",void 0),n([l({type:J,json:{write:!0}})],B.prototype,"pixelSize",void 0),n([l({json:{write:!0}})],B.prototype,"raster",void 0),B=n([F("esri.rest.support.BaseImageMeasureParameters")],B);var ke;let ee=ke=class extends B{constructor(){super(...arguments),this.type="area-perimeter",this.geometry=null,this.is3D=!1,this.linearUnit="meters",this.areaUnit="square-meters"}writeGeometry(s,i,o){s!=null&&(i.geometryType=Se(s),i[o]=s.toJSON())}get measureOperation(){return this.is3D?"area-and-perimeter-3D":"area-and-perimeter"}clone(){return new ke(H({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};n([l({types:tt,json:{name:"fromGeometry",read:!0,write:!0}})],ee.prototype,"geometry",void 0),n([D("geometry")],ee.prototype,"writeGeometry",null),n([l({type:G.apiValues,json:{write:G.write}})],ee.prototype,"measureOperation",null),n([l({json:{read:!0}})],ee.prototype,"is3D",void 0),n([l({type:String,json:{read:oe.read,write:oe.write}})],ee.prototype,"linearUnit",void 0),n([l({type:String,json:{read:Ve.read,write:Ve.write}})],ee.prototype,"areaUnit",void 0),ee=ke=n([F("esri.rest.support.ImageAreaParameters")],ee);const er=ee;var We;let K=We=class extends B{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(s,i,o){s!=null&&(i.geometryType=Se(s),i[o]=s.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new We(H({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};n([l({type:J,json:{read:!0,write:!0}})],K.prototype,"fromGeometry",void 0),n([D("fromGeometry")],K.prototype,"writeFromGeometry",null),n([l({type:J,json:{read:!0,write:!0}})],K.prototype,"toGeometry",void 0),n([l({type:G.apiValues,json:{write:G.write}})],K.prototype,"measureOperation",null),n([l({json:{read:!0}})],K.prototype,"is3D",void 0),n([l({type:String,json:{read:oe.read,write:oe.write}})],K.prototype,"linearUnit",void 0),n([l({type:String,json:{read:Ae.read,write:Ae.write}})],K.prototype,"angularUnit",void 0),K=We=n([F("esri.rest.support.ImageDistanceParameters")],K);const tr=K;var Ke;let te=Ke=class extends B{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(s,i,o){s!=null&&(i.geometryType=Se(s),i[o]=s.toJSON())}get measureOperation(){return this.operationType}clone(){return new Ke(H({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};n([l({type:J,json:{read:!0}})],te.prototype,"fromGeometry",void 0),n([D("fromGeometry")],te.prototype,"writeFromGeometry",null),n([l({type:J,json:{read:!0,write:!0}})],te.prototype,"toGeometry",void 0),n([l({type:G.apiValues,json:{write:G.write}})],te.prototype,"measureOperation",null),n([l({json:{read:!0}})],te.prototype,"operationType",void 0),n([l({type:String,json:{read:oe.read,write:oe.write}})],te.prototype,"linearUnit",void 0),te=Ke=n([F("esri.rest.support.ImageHeightParameters")],te);const ir=te;var Ze;let I=Ze=class extends E{constructor(){super(...arguments),this.geometry=null,this.rasterFunctions=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(s,i,o){s!=null&&(i.geometryType=Se(s),i[o]=JSON.stringify(s.toJSON()))}set mosaicRule(s){let i=s;i&&i.mosaicMethod&&(i=L.fromJSON({...i.toJSON(),mosaicMethod:i.mosaicMethod,mosaicOperation:i.mosaicOperation})),this._set("mosaicRule",i)}writeMosaicRule(s,i,o){s!=null&&(i[o]=JSON.stringify(s.toJSON()))}get renderingRule(){return we(se.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._get("rasterFunction")}set renderingRule(s){we(se.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",s)}get renderingRules(){return we(se.getLogger(this),"renderingRules",{replacement:"rasterFunctions",version:"4.27",warnOnce:!0}),this._get("rasterFunctions")}set renderingRules(s){we(se.getLogger(this),"renderingRules",{replacement:"rasterFunctions",version:"4.27",warnOnce:!0}),this._set("rasterFunctions",s)}set rasterFunction(s){let i=s;i&&i.rasterFunction&&(i=b.fromJSON({...i.toJSON(),rasterFunction:i.rasterFunction,rasterFunctionArguments:i.rasterFunctionArguments})),this._set("rasterFunction",i)}writeRasterFunction(s,i,o){s!=null&&(i[o]=JSON.stringify(s.toJSON())),s.rasterFunctionDefinition&&(i[o]=JSON.stringify(s.rasterFunctionDefinition))}writeRasterFunctions(s,i,o){s!=null&&(i[o]=JSON.stringify(s.map(e=>e.rasterFunctionDefinition||e.toJSON())))}writePixelSize(s,i,o){s!=null&&(i[o]=JSON.stringify(s))}writeTimeExtent(s,i,o){if(s!=null){const e=s.start!=null?s.start.getTime():null,t=s.end!=null?s.end.getTime():null;i[o]=e!=null?t!=null?`${e},${t}`:`${e}`:null}}clone(){return new Ze(H({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,rasterFunctions:this.rasterFunctions,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};n([l({json:{write:!0}})],I.prototype,"geometry",void 0),n([D("geometry")],I.prototype,"writeGeometry",null),n([l({type:L,json:{write:!0}})],I.prototype,"mosaicRule",null),n([D("mosaicRule")],I.prototype,"writeMosaicRule",null),n([l({type:b})],I.prototype,"renderingRule",null),n([l({type:[b]})],I.prototype,"renderingRules",null),n([l({type:b,json:{write:!0,name:"renderingRule"}})],I.prototype,"rasterFunction",null),n([D("rasterFunction")],I.prototype,"writeRasterFunction",null),n([l({type:[b],json:{write:!0,name:"renderingRules"}})],I.prototype,"rasterFunctions",void 0),n([D("rasterFunctions")],I.prototype,"writeRasterFunctions",null),n([l({type:J,json:{write:!0}})],I.prototype,"pixelSize",void 0),n([D("pixelSize")],I.prototype,"writePixelSize",null),n([l({type:Boolean,json:{write:!0}})],I.prototype,"returnGeometry",void 0),n([l({type:Boolean,json:{write:!0}})],I.prototype,"returnCatalogItems",void 0),n([l({type:Boolean,json:{write:!0}})],I.prototype,"returnPixelValues",void 0),n([l({type:Number,json:{write:!0}})],I.prototype,"maxItemCount",void 0),n([l({type:lt,json:{write:{target:"time"}}})],I.prototype,"timeExtent",void 0),n([D("timeExtent")],I.prototype,"writeTimeExtent",null),n([l({json:{write:!0}})],I.prototype,"raster",void 0),n([l({json:{write:!0}})],I.prototype,"viewId",void 0),n([l({type:Boolean,json:{write:!0}})],I.prototype,"processAsMultidimensional",void 0),I=Ze=n([F("esri.rest.support.ImageIdentifyParameters")],I);const ot=I;var Xe;let ve=Xe=class extends E{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(s,i,o){i.geometries={geometryType:"esriGeometryPoint",geometries:s.map(e=>e.toJSON())}}clone(){var s;return new Xe({geometries:((s=this.geometries)==null?void 0:s.map(i=>i.clone()))??[],rasterId:this.rasterId})}};n([l({type:[J],json:{write:!0}})],ve.prototype,"geometries",void 0),n([D("geometries")],ve.prototype,"writeGeometry",null),n([l({type:$e,json:{write:!0}})],ve.prototype,"rasterId",void 0),ve=Xe=n([F("esri.rest.support.ImagePixelLocationParameters")],ve);const rr=ve;var Ye;let de=Ye=class extends B{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(s,i,o){s!=null&&(i.geometryType=Se(s),i[o]=s.toJSON())}get measureOperation(){const{is3D:s,geometry:i}=this;return i.type==="point"?s?"point-3D":"point":s?"centroid-3D":"centroid"}clone(){return new Ye(H({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};n([l({types:tt,json:{name:"fromGeometry",read:ut}})],de.prototype,"geometry",void 0),n([D("geometry")],de.prototype,"writeGeometry",null),n([l({type:G.apiValues,json:{read:G.read,write:G.write}})],de.prototype,"measureOperation",null),n([l({json:{read:!0}})],de.prototype,"is3D",void 0),de=Ye=n([F("esri.rest.support.ImagePointParameters")],de);const sr=de;var et;let A=et=class extends E{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(s,i,o){s!=null&&(i.geometryType=Se(s),i[o]=s.toJSON())}set locations(s){if(s!=null&&s.length){const i=new xt({spatialReference:s[0].spatialReference});i.points=s.map(o=>[o.x,o.y]),this._set("locations",s),this.geometry=i}}clone(){return new et(H({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};n([l({types:tt,json:{read:ut}})],A.prototype,"geometry",void 0),n([D("geometry")],A.prototype,"writeGeometry",null),n([l()],A.prototype,"locations",null),n([l({type:String,json:{type:ae.jsonValues,read:ae.read,write:ae.write}})],A.prototype,"interpolation",void 0),n([l({type:L,json:{write:!0}})],A.prototype,"mosaicRule",void 0),n([l({type:[String],json:{write:!0}})],A.prototype,"outFields",void 0),n([l({type:J,json:{write:!0}})],A.prototype,"pixelSize",void 0),n([l({type:String,json:{write:!0}})],A.prototype,"raster",void 0),n([l({type:Boolean,json:{write:!0}})],A.prototype,"returnFirstValueOnly",void 0),n([l({type:Number,json:{write:!0}})],A.prototype,"sampleDistance",void 0),n([l({type:Number,json:{write:!0}})],A.prototype,"sampleCount",void 0),n([l({type:Number,json:{write:!0}})],A.prototype,"sliceId",void 0),n([l({type:lt,json:{read:{source:"time"},write:{target:"time"}}})],A.prototype,"timeExtent",void 0),A=et=n([F("esri.rest.support.ImageSampleParameters")],A);const nr=A,ar=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),or=Pt(Nt,{min:0,max:255});function lr(s){if(!s)return null;const i=JSON.stringify(s).match(/"rasterFunction":"(.*?")/gi),o=i==null?void 0:i.map(e=>e.replace('"rasterFunction":"',"").replace('"',""));return o?o.join("/"):null}const ur=s=>{let i=class extends s{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._cachedRendererJson=null,this._serviceSupportsMosaicRule=null,this._rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new P({layer:this}))}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.length<1||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.forEach(t=>{e.set(t.name.toLowerCase().replaceAll(/ /gi,"_"),t.name)}),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every(r=>typeof r=="number"))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,r){e!=null&&this.format!=="lerc"&&(t[r]=e)}writeCompressionTolerance(e,t,r){this.format==="lerc"&&e!=null&&(t[r]=e)}readDefaultMosaicRule(e,t){return this._serviceSupportsMosaicRule?L.fromJSON(t):null}get fieldsIndex(){return this.fields?new pi(this.fields):null}set format(e){e&&ar.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return t.serviceDataType==="esriImageServiceDataTypeVector-UV"||t.serviceDataType==="esriImageServiceDataTypeVector-MagDir"||this.pixelFilter!=null?"lerc":"jpgpng"}readMinScale(e,t){return t.minLOD!=null&&t.maxLOD!=null?e:0}readMaxScale(e,t){return t.minLOD!=null&&t.maxLOD!=null?e:0}set mosaicRule(e){let t=e;t&&t.mosaicMethod&&(t=L.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const r=e||t.mosaicRule;return r?L.fromJSON(r):this._isMosaicRuleSupported(t)?L.fromJSON(t):null}writeMosaicRule(e,t,r){let a=this.mosaicRule;const u=this.definitionExpression;a?u&&u!==a.where&&(a=a.clone(),a.where=u):u&&(a=new L({where:u})),this._isValidCustomizedMosaicRule(a)&&(t[r]=a.toJSON())}writeNoData(e,t,r){e!=null&&typeof e=="number"&&(t[r]=or(e))}readObjectIdField(e,t){if(!e){const r=t.fields.filter(a=>a.type==="esriFieldTypeOID"||a.type==="oid");e=r&&r[0]&&r[0].name}return e}get parsedUrl(){return Ft(this.url)}readSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}set renderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("renderer",e)}readRenderer(e,t,r){var p,m;const a=(m=(p=t==null?void 0:t.layerDefinition)==null?void 0:p.drawingInfo)==null?void 0:m.renderer,u=qt(a,r);return u==null?null:(u.type==="vector-field"&&t.symbolTileSize&&!a.symbolTileSize&&(u.symbolTileSize=t.symbolTileSize),ht(u)||se.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),u)}writeRenderer(e,t,r){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),e.type==="vector-field"&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){var m;const e=this._rasterAttributeTableFieldPrefix||"Raster.",t=new ce({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),r=new ce({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),a=new ce({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let u=this.fields?H(this.fields):[];u.push(r),(m=this.capabilities)!=null&&m.operations.supportsQuery&&this.fields&&this.fields.length>0&&u.push(t),this.version>=10.4&&this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.some(c=>c.name.toLowerCase()==="none")&&u.push(a),this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.filter(c=>c.name.toLowerCase()!=="none").forEach(c=>{u.push(new ce({name:"Raster.ServicePixelValue."+c.name,alias:c.name,domain:null,editable:!1,length:50,type:"string"}))}),this._isVectorDataSet()&&(u.push(new ce({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),u.push(new ce({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:p}=this.rasterInfo??{};if(p!=null){const c=p.fields.filter(d=>d.type!=="esriFieldTypeOID"&&d.name.toLowerCase()!=="value").map(d=>{const y=H(d);return y.name=e+d.name,y});u=u.concat(c)}return u}get renderingRule(){return we(se.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._get("rasterFunction")}set renderingRule(e){we(se.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",e)}set rasterFunction(e){let t=e;t&&t.rasterFunction&&(t=b.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("rasterFunction",t)}readRasterFunction(e,t){const r=t.rasterFunctionInfos;return t.renderingRule||r&&r.length&&r[0].name!=="None"?this._isRFTJson(t.renderingRule)?b.fromJSON({rasterFunctionDefinition:t.renderingRule}):b.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}readSpatialReference(e,t){const r=e||t.extent.spatialReference;return r?he.fromJSON(r):null}readPixelType(e){return ze.fromJSON(e)||e}writePixelType(e,t,r){this.serviceRasterInfo!=null&&this.pixelType===this.serviceRasterInfo.pixelType||(t[r]=ze.toJSON(e))}readVersion(e,t){let r=t.currentVersion;return r||(r=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),r}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let r=e;const{renderer:a,symbolizer:u,pixelFilter:p,bandIds:m}=this;if(!this._isPicture()&&a&&u&&!p){const c=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(a.toJSON()),d=this._rasterJobHandler.instance;if(d){c&&(u.bind(),await d.updateSymbolizer(u,t),this._cachedRendererJson=a.toJSON());const y=await d.symbolize({bandIds:m,...e},t);r={extent:e.extent,pixelBlock:y}}else r={extent:e.extent,pixelBlock:u.symbolize({bandIds:m,...e})}}return r}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeAngles)throw new j("imagery-layer:compute-angles","this operation is not supported on the input image service");return e=q(Yi,e).clone(),Gi(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputePixelLocation)throw new j("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=q(rr,e).clone(),Hi(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeHistograms)throw new j("imagery-layer:compute-histograms","this operation is not supported on the input image service");return e=q(Le,e).clone(),this._applyMosaicAndRenderingRules(e),Qi(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeStatisticsHistograms)throw new j("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return e=q(Le,e).clone(),this._applyMosaicAndRenderingRules(e),Ui(this.url,e,this._getRequestOptions(t))}async measureHeight(e,t){const r=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(e.operationType==="base-and-top"?r.mensuration.supportsHeightFromBaseAndTop:e.operationType==="base-and-top-shadow"?r.mensuration.supportsHeightFromBaseAndTopShadow:r.mensuration.supportsHeightFromTopAndTopShadow))throw new j("imagery-layer:measure-height","this operation is not supported on the input image service");return e=q(ir,e).clone(),this._applyMosaicAndRenderingRules(e),ki(this.url,e,this._getRequestOptions(t))}async measureAreaAndPerimeter(e,t){const r=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(r.mensuration.supportsAreaAndPerimeter&&(!e.is3D||r.mensuration.supports3D)))throw new j("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return e=q(er,e).clone(),this._applyMosaicAndRenderingRules(e),Wi(this.url,e,this._getRequestOptions(t))}async measureDistanceAndAngle(e,t){const r=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(r.mensuration.supportsDistanceAndAngle&&(!e.is3D||r.mensuration.supports3D)))throw new j("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return e=q(tr,e).clone(),this._applyMosaicAndRenderingRules(e),Zi(this.url,e,this._getRequestOptions(t))}async measurePointOrCentroid(e,t){const r=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(r.mensuration.supportsPointOrCentroid&&(!e.is3D||r.mensuration.supports3D)))throw new j("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return e=q(sr,e).clone(),this._applyMosaicAndRenderingRules(e),Ki(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return t!=null?t.get(e):void 0}getFieldDomain(e,t){const r=this.getField(e);return r?r.domain:null}async fetchImage(e,t,r,a={}){if(e==null||t==null||r==null)throw new j("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required.");if(this.renderer||this.symbolizer){const d=await this._generateRasterInfo(this.rasterFunction,{signal:a.signal});d&&(this.rasterInfo=d)}const u=this.getExportImageServiceParameters(e,t,r,a.timeExtent);if(u==null){if(a.requestAsImageElement&&this._canRequestImageElement(this.format)){const g=document.createElement("canvas");return g.width=t,g.height=r,a.returnImageBitmap?{imageBitmap:await st(g,`${o(this.parsedUrl)}/exportImage`,a.signal)}:{imageOrCanvasElement:g}}const{bandIds:d,rasterInfo:y}=this,R=((d==null?void 0:d.length)||y.bandCount)??0,f=t*r,v=y.pixelType,h=[];for(let g=0;g=10.3?e==null?void 0:e.rasterFunction:null})}).then(t=>t.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new j("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):N(o(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e==null?void 0:e.rasterFunction:null})}).then(t=>dt.fromJSON(t.data))}getCatalogItemRasterInfo(e,t){const r={...t,query:this._getQueryParams()};return Xi(o(this.parsedUrl),e,r)}async getCatalogItemICSInfo(e,t){var pe,X,it;const{data:r}=await N(o(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),a=r&&r.ics;if(!a)return;let u=null;try{u=(await N(o(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!u||!u.spatialReference)return{ics:a,icsToPixelTransform:null,icsExtent:null,northDirection:null};const p=this.version>=10.7?N(o(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then(x=>x.data).catch(()=>({})):{},m=u.spatialReference,c={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[u]}),inSR:m.wkid||JSON.stringify(m),outSR:"0:"+e},d=N(o(this.parsedUrl)+"/project",{query:this._getQueryParams(c),...t}).then(x=>x.data).catch(()=>({})),y=5,R=(u.xmin+u.xmax)/2,f=(u.ymax-u.ymin)/(y+1),v=u.ymin+f,h=[];for(let x=0;xx.data).catch(()=>({})),S=await Promise.all([p,d,w]);let O=S[0].ipxf;if(O==null){const x=(pe=a.geodataXform)==null?void 0:pe.xf_0;((X=x==null?void 0:x.name)==null?void 0:X.toLowerCase())==="topup"&&((it=x==null?void 0:x.coefficients)==null?void 0:it.length)===6&&(O={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:x.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const V=Pe.fromJSON(S[1]&&S[1].geometries&&S[1].geometries[0]);V&&(V.spatialReference=new he({wkid:0,imageCoordinateSystem:a}));const T=S[2].geometries?S[2].geometries.filter(x=>x!=null&&x.x!=null&&x.y!=null&&x.x!=="NaN"&&x.y!=="NaN"):[],k=T.length;if(k<3)return{ics:a,icsToPixelTransform:O,icsExtent:V,northDirection:null};let C=0,_=0,$=0,W=0;for(let x=0;xT[0].x,ue=T[y-1].y>T[0].y;return U===1/0?le=ue?90:270:U===0?le=Te?0:180:U>0?le=Te?180*Math.atan(U)/Math.PI:180*Math.atan(U)/Math.PI+180:U<0&&(le=ue?180+180*Math.atan(U)/Math.PI:360+180*Math.atan(U)/Math.PI),{ics:a,icsToPixelTransform:O,icsExtent:V,northDirection:le}}async generateRasterInfo(e,t){var p;if(e=q(b,e),this.serviceRasterInfo&&(!e||((p=e.functionName)==null?void 0:p.toLowerCase())==="none"||this._isVectorFieldResampleFunction(e)))return this.serviceRasterInfo;const r=lr(e);if(!r)throw new j("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[r])return this._functionRasterInfos[r];const a={...t,query:this._getQueryParams()},u=zt(o(this.parsedUrl),e,a);this._functionRasterInfos[r]=u;try{return await u}catch(m){throw this._functionRasterInfos[r]=null,m}}getExportImageServiceParameters(e,t,r,a){var h;e=e.clone().shiftCentralMeridian();const u=wt(e.spatialReference,o(this.parsedUrl));this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const p=this.exportImageServiceParameters.toJSON(),{bandIds:m,noData:c}=p;let{renderingRule:d}=p;const y=(h=this.rasterFunction)==null?void 0:h.rasterFunctionDefinition,R=!this.renderer||this.renderer.type==="raster-stretch";if(m!=null&&m.length&&this._hasRasterFunction(this.rasterFunction)&&!y&&R){const g={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:m}};if(d.rasterFunction==="Stretch")g.rasterFunctionArguments.Raster=d.rasterFunctionArguments.Raster,d.rasterFunctionArguments.Raster=g;else if(d.rasterFunction==="Colormap"){const w=d.rasterFunctionArguments.Raster;(w==null?void 0:w.rasterFunction)==="Stretch"?(g.rasterFunctionArguments.Raster=w.rasterFunctionArguments.Raster,w.rasterFunctionArguments.Raster=g):(g.rasterFunctionArguments.Raster=w,d.rasterFunctionArguments.Raster=g)}else g.rasterFunctionArguments.Raster=d,d=g;p.bandIds=void 0}else p.bandIds=m==null?void 0:m.join(",");c instanceof Array&&c.length>0&&(p.noData=c.join(","));const f=this._processMultidimensionalIntersection(null,a,this.exportImageServiceParameters.mosaicRule);if(f.isOutSide)return null;p.mosaicRule=f.mosaicRule!=null?JSON.stringify(f.mosaicRule):null,a=f.timeExtent,p.renderingRule=this._getRenderingRuleString(b.fromJSON(d));const v={};if(a!=null){const{start:g,end:w}=a.toJSON();g&&w&&g===w?v.time=""+g:g==null&&w==null||(v.time=`${g??"null"},${w??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:u,imageSR:u,size:t+","+r,...p,...v}}async getSamples(e,t){const r=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(r!=null&&r.operations.supportsGetSamples))throw new j("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=q(nr,e).clone();const{raster:a}=this;return a&&e.raster==null&&(e.raster=a),Bi(this.url,e,this._getRequestOptions(t))}async identify(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsIdentify)throw new j("imagery-layer:identify","identify operation is not supported on the input image service");e=q(ot,e).clone();const r=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(r.isOutSide)throw new j("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");e.timeExtent=r.timeExtent,e.mosaicRule=r.mosaicRule;const{raster:a,rasterFunction:u}=this;return u&&e.rasterFunction==null&&(e.rasterFunction=u),a&&e.raster==null&&(e.raster=a),nt(this.url,e,this._getRequestOptions(t))}createQuery(){const e=new Ue;return e.outFields=["*"],e.returnGeometry=!0,e.where=this.definitionExpression||"1=1",e}async queryRasters(e,t){return{query:e,requestOptions:t}=await this._prepareForQuery(e,t),ci(this.url,e,t)}async queryObjectIds(e,t){return{query:e,requestOptions:t}=await this._prepareForQuery(e,t),mi(this.url,e,t)}async queryRasterCount(e,t){return{query:e,requestOptions:t}=await this._prepareForQuery(e,t),di(this.url,e,t)}async queryVisibleRasters(e,t){var O,V,T,k;if(!e)throw new j("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:r,returnDomainValues:a,returnTopmostRaster:u,showNoDataRecords:p}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let m=!1,c=null,d=null;const y="raster.servicepixelvalue",R=this._rasterFunctionNamesIndex;if(e.outFields!=null&&(m=e.outFields.some(C=>!C.toLowerCase().includes(y)),this.version>=10.4)){const C=e.outFields.filter($=>$.toLowerCase().includes(y)&&$.length>y.length).map($=>{const W=$.slice(y.length+1);return[this._updateRenderingRulesFunctionName(W,R),W]});c=C.map($=>new b({functionName:$[0]})),d=C.map($=>$[1]);const{rasterFunction:_}=this;c.length===0?_!=null&&_.functionName?(c.push(_),d.push(_.functionName)):c=null:_!=null&&_.functionName&&!c.some($=>$.functionName===_.functionName)&&(c.push(_),d.push(_.functionName))}const f=e.outSpatialReference==null||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:v}=this;let h=e.timeExtent||this.timeExtent;if(v){const{isOutside:C,intersection:_}=Ge(v,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:(O=this.exportImageServiceParameters.mosaicRule)==null?void 0:O.multidimensionalDefinition});if(C)throw new j("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");_&&_.timeExtent!=null&&(h=_.timeExtent)}const g=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,h),w=this._getQueryParams({geometry:e.geometry,timeExtent:h,mosaicRule:g,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:c,pixelSize:r,returnCatalogItems:m,returnGeometry:f,raster:this.raster,maxItemCount:u?1:null});delete w.f;const S=new ot(w);try{await this._generateRasterInfo(this.rasterFunction);const C=await nt(this.url,S,{signal:t==null?void 0:t.signal,query:{...this.customParameters}}),_=e.outFields,$=C.value!=null&&C.value.toLowerCase().includes("nodata");if(!(m&&!f&&((V=C==null?void 0:C.catalogItems)!=null&&V.features.length)&&(p||!$)))return this._processVisibleRastersResponse(C,{returnDomainValues:a,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:_});const W=this.objectIdField||"ObjectId",U=((T=C.catalogItems)==null?void 0:T.features)??[],le=U.map(pe=>{var X;return(X=pe.attributes)==null?void 0:X[W]}),Te=new Ue({objectIds:le,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[W]}),ue=await this.queryRasters(Te);return(k=ue==null?void 0:ue.features)!=null&&k.length&&ue.features.forEach(pe=>{U.forEach(X=>{X.attributes[W]===pe.attributes[W]&&(X.geometry=new It(pe.geometry),e.outSpatialReference!=null&&(X.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(C,{returnDomainValues:a,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:_})}catch{throw new j("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,t){const r=N(o(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then(p=>{var m;return(m=p.data)==null?void 0:m.statistics}),a=N(o(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then(p=>{var m;return(m=p.data)==null?void 0:m.histograms}),u=await Promise.all([r,a]);return u[0]&&u[0].forEach(p=>{p.avg=p.mean,p.stddev=p.standardDeviation}),{statistics:u[0]||null,histograms:u[1]||null}}async createFlowMesh(e,t){const r=this._rasterJobHandler.instance;return r?r.createFlowMesh(e,t):ai(e.meshType,e.simulationSettings,e.flowData,t.signal!=null?t.signal:new AbortController().signal)}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo.multidimensionalInfo;return Lt(this.multidimensionalSubset,t)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,r=this.serviceRasterInfo!=null?Promise.resolve(this.serviceRasterInfo):Gt(o(this.parsedUrl),t,{signal:e,query:this._getQueryParams()}).then(p=>(this._set("serviceRasterInfo",p),this._set("multidimensionalInfo",p.multidimensionalInfo),p)),a=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):null,u=this._getRasterFunctionInfos();return Promise.all([r,a,u]).then(p=>{p[1]?this._set("rasterInfo",p[1]):this._set("rasterInfo",p[0]),p[2]&&this._set("rasterFunctionInfos",p[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this._set("renderer",null),se.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("renderer",this._configRenderer(this.renderer)),this.addHandles([Dt(()=>this.rasterFunction,c=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(c).then(d=>{d&&(this.rasterInfo=d)})})]);const{serviceRasterInfo:m}=this;m.multidimensionalInfo!=null&&this._updateMultidimensionalDefinition(m)})}_combineMosaicRuleWithTimeExtent(e,t){var v;const r=this.timeInfo,{multidimensionalInfo:a}=this.serviceRasterInfo;if(e==null||a==null||t==null||(r==null?void 0:r.startField)==null)return e;const{startField:u}=r,p=a.variables.some(h=>h.dimensions.some(g=>g.name===u))?u:"StdTime";if(e=e.clone(),this.sourceType==="mosaic-dataset")return e.multidimensionalDefinition=(v=e.multidimensionalDefinition)==null?void 0:v.filter(h=>h.dimensionName!==p),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const m=e.multidimensionalDefinition.filter(h=>h.dimensionName===p),c=t.start!=null?t.start.getTime():null,d=t.end!=null?t.end.getTime():null,y=c==null||d==null||c===d,R=y?[c||d]:[[c,d]],f=this.version>=10.8;if(m.length)m.forEach(h=>{h.dimensionName===p&&(f?(h.dimensionName=null,h.isSlice=!1,h.values=[]):(h.isSlice=y,h.values=R))});else if(!f){const h=e.multidimensionalDefinition.filter(g=>g.variableName!=null&&g.dimensionName==null);h.length?h.forEach(g=>{g.dimensionName=p,g.isSlice=y,g.values=R}):e.multidimensionalDefinition.push(new Ht({variableName:"",dimensionName:p,isSlice:y,values:R}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return e==null?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(t=>!(!t.variableName&&!t.dimensionName)),e.multidimensionalDefinition.length===0&&(e.multidimensionalDefinition=null)),this.sourceType!=="mosaic-dataset"&&e.multidimensionalDefinition==null?null:e)}async _prepareForQuery(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsQuery)throw new j("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=e!=null?q(Ue,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}async _initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const e=new Kt;this._rasterJobHandler.connectionPromise=e.initialize().then(()=>{this._rasterJobHandler.instance=e},()=>{}),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null}_isSupportedRenderer(e){const{rasterInfo:t,rasterFunction:r}=this;return e.type==="unique-value"&&this._hasRasterFunction(r)&&(t==null?void 0:t.bandCount)===1&&["u8","s8"].includes(t.pixelType)||t!=null&&e!=null&&Ut(t).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){var r;let t=this.sourceJSON;if(!t){const{data:a,ssl:u}=await N(o(this.parsedUrl),{query:this._getQueryParams(),signal:e});t=a,this.sourceJSON=t,u&&(this.url=this.url.replace(/^http:/i,"https:"))}if(((r=t.capabilities)==null?void 0:r.toLowerCase().split(",").map(a=>a.trim()).indexOf("tilesonly"))>-1)throw new j("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(t,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){var t;return e.serviceSourceType?e.serviceSourceType==="esriImageServiceSourceTypeMosaicDataset":((t=e.fields)==null?void 0:t.length)>0}_isMosaicRuleSupported(e){var a;if(!e)return!1;const t=this._isMosaicDataset(e),r=e.currentVersion>=10.71&&e.hasMultidimensions&&!(((a=e.fields)==null?void 0:a.length)>1);return t||r}_isVectorFieldResampleFunction(e){if(e==null)return!1;const{functionName:t,functionArguments:r}=e,a=(t==null?void 0:t.toLowerCase())==="resample",u=(r==null?void 0:r.ResampleType)||(r==null?void 0:r.resampleType);return a&&(u===7||u===10)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){var a,u;const t=this._isPicture(),{rasterInfo:r}=this;if(!t&&!this.pixelFilter||this._isVectorDataSet()){if(!this.bandIds&&r.bandCount>=3){const m=Qt(r);!m||r.bandCount===3&&m[0]===0&&m[1]===1&&m[2]===2||(this.bandIds=m)}e||(e=Bt(r,{bandIds:this.bandIds,variableName:this.rasterFunction?null:(u=(a=this.mosaicRule)==null?void 0:a.multidimensionalDefinition)==null?void 0:u[0].variableName}));const p=kt(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=p,this.symbolizer.rasterInfo=r):this.symbolizer=new oi({rendererJSON:p,rasterInfo:r}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return e==null?e:{extent:e.extent&&e.extent.clone(),pixelBlock:e.pixelBlock!=null?e.pixelBlock.clone():null}}_getQueryParams(e){e&&e.renderingRule!=null&&typeof e.renderingRule!="string"&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:r}=this;return{raster:t,viewId:r,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e==null?void 0:e.query,...this.customParameters}}}_decodePixelBlock(e,t,r){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:t}):rt(e,t,r)}async _getRasterFunctionInfos(e){var r;const t=this.sourceJSON.rasterFunctionInfos;return this.loaded?t:t&&this.version>=10.3?t.length===1&&t[0].name.toLowerCase()==="none"?t:(r=(await N(o(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data)==null?void 0:r.rasterFunctionInfos:null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:r,returnImageBitmap:a,signal:u}=e;if(r&&this._canRequestImageElement(t.format)){const v=`${o(this.parsedUrl)}/exportImage`,{data:h}=await N(v,{responseType:a?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:u});return h instanceof Blob?{imageBitmap:await st(h,v,u),params:t}:{imageOrCanvasElement:h,params:t}}const p=this._initJobHandler(),m=N(o(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:u}),c=(await Promise.all([m,p]))[0].data,d=t.format||"jpgpng";let y=d;if(y!=="bsq"&&y!=="bip"&&(y=li(c)),!y)throw new j("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(c)));const R={signal:u};return{pixelData:{pixelBlock:await(d==="gif"||d==="bmp"||d.includes("png")&&(y==="png"||y==="jpg")?rt(c,{useCanvas:!0,...t},R):this._decodePixelBlock(c,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:d},R)),extent:t.extent},params:t}}_generateRasterInfo(e,t){return this.generateRasterInfo(e,t).catch(()=>null)}_isValidCustomizedMosaicRule(e){var t;return e&&JSON.stringify(e.toJSON())!==JSON.stringify((t=this.defaultMosaicRule)==null?void 0:t.toJSON())}_updateMultidimensionalDefinition(e){var r;if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let t=Wt(e,{multidimensionalSubset:this.multidimensionalSubset});if(t!=null&&t.length>0){this.mosaicRule=this.mosaicRule||new L;const a=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&((r=this.rasterFunction.functionName)==null?void 0:r.toLowerCase())!=="none"&&t.forEach(u=>u.variableName=""),t=t.filter(({variableName:u,dimensionName:p})=>u&&u!=="*"||p),!(a!=null&&a.length)&&t.length&&(this.mosaicRule.multidimensionalDefinition=t)}}_processVisibleRastersResponse(e,t){t=t||{};const r=e.value,{templateRRFunctionNames:a,showNoDataRecords:u,returnDomainValues:p,templateFields:m}=t,c=e.processedValues;let d=e.catalogItems&&e.catalogItems.features,y=e.properties&&e.properties.Values&&e.properties.Values.map(S=>S.replaceAll(/ /gi,", "))||[];const R=this.objectIdField||"ObjectId",f=typeof r=="string"&&r.toLowerCase().includes("nodata"),v=[];if(r&&!d&&!f){const S={};S[R]=0,y=[r],d=[new Tt(this.fullExtent,null,S)]}if(!d)return[];let h,g,w;this._updateResponseFieldNames(d,m),f&&!u&&(d=[]);for(let S=0;S0&&a&&a.length>0&&a.includes(this.rasterFunction.functionName)?c[a.indexOf(this.rasterFunction.functionName)]:r,g.toLowerCase()==="nodata"&&!u)continue;const O="Raster.ItemPixelValue",V="Raster.ServicePixelValue";h.attributes[O]=g,h.attributes[V]=w,this._updateFeatureWithMagDirValues(h,g);const T=this.fields&&this.fields.length>0;let k=this.rasterFunction&&this.serviceRasterInfo.attributeTable!=null?T?g:r:w;this.rasterFunction||(k=T?g:r),this._updateFeatureWithRasterAttributeTableValues(h,k)}if(h.sourceLayer=h.layer=this,p&&this._updateFeatureWithDomainValues(h),a&&c&&a.length===c.length)for(let O=0;Od.name).filter(d=>d.toLowerCase()==="value"),m=p&&p[0];if(!m)return;const c=a.filter(d=>d.attributes[m]===(t!=null?parseInt(t,10):null));c&&c[0]&&u.forEach(d=>{const y=this._rasterAttributeTableFieldPrefix+d.name;e.attributes[y]=c[0].attributes[d.name]})}_updateFeatureWithMagDirValues(e,t){if(!this._isVectorDataSet())return;const r=t.split(/,\s*/).map(c=>parseFloat(c)),a=r.map(c=>[c]),u=r.map(c=>({minValue:c,maxValue:c,noDataValue:null})),p=new He({height:1,width:1,pixelType:"f32",pixels:a,statistics:u});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:p,extent:new Pe(0,0,0,0,this.spatialReference)});const m=this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"?[p.pixels[0][0],p.pixels[1][0]]:ui([p.pixels[0][0],p.pixels[1][0]]);e.attributes["Raster.Magnitude"]=m[0],e.attributes["Raster.Direction"]=m[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter(r=>r.domain&&r.domain.type==="coded-value");t!=null&&t.forEach(r=>{const a=e.attributes[r.name];if(a!=null){const u=r.domain.codedValues.find(p=>p.code===a);u&&(e.attributes[r.name]=u.name)}})}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const r=this.fieldsIndex;r!=null&&e.forEach(a=>{var u;if(a&&a.attributes)for(const p of t){const m=(u=r.get(p))==null?void 0:u.name;m&&m!==p&&(a.attributes[p]=a.attributes[m],delete a.attributes[m])}})}_getRenderingRuleString(e){if(e){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRasterFunction(e){return e!=null&&e.functionName!=null&&e.functionName.toLowerCase()!=="none"}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if(e==="Raw")return e.replace("Raw","None");const r=e.toLowerCase().replaceAll(/ /gi,"_");return t.has(r)?t.get(r):e}_isRFTJson(e){return e&&e.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"}_applyMosaicAndRenderingRules(e){const{raster:t,mosaicRule:r,rasterFunction:a}=this;a&&e instanceof Le&&e.rasterFunction==null&&(e.rasterFunction=a),r&&e.mosaicRule==null&&(e.mosaicRule=r),t&&e.raster==null&&(e.raster=t)}_readCapabilities(e){const t=e.capabilities?e.capabilities.toLowerCase().split(",").map(v=>v.trim()):["image","catalog"],{currentVersion:r,advancedQueryCapabilities:a,maxRecordCount:u}=e,p=t.includes("image"),m=e.serviceDataType==="esriImageServiceDataTypeElevation",c=!!(e.spatialReference||e.extent&&e.extent.spatialReference),d=t.includes("edit"),y=t.includes("mensuration")&&c,R=e.mensurationCapabilities==null?[]:e.mensurationCapabilities.toLowerCase().split(",").map(v=>v.trim()),f=y&&R.includes("basic");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:p,supportsExportImage:p,supportsIdentify:p,supportsMeasure:y,supportsDownload:t.includes("download"),supportsQuery:t.includes("catalog")&&e.fields&&e.fields.length>0,supportsGetSamples:r>=10.2&&p,supportsProject:r>=10.3&&p,supportsComputeStatisticsHistograms:r>=10.4&&p,supportsQueryBoundary:r>=10.6&&p,supportsCalculateVolume:r>=10.7&&m,supportsComputePixelLocation:r>=10.7&&t.includes("catalog"),supportsComputeAngles:r>=10.91,supportsAdd:d,supportsDelete:d,supportsEditing:d,supportsUpdate:d,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:u,maxRecordCountFactor:void 0,supportsStatistics:!!(a!=null&&a.supportsStatistics),supportsOrderBy:!!(a!=null&&a.supportsOrderBy),supportsDistinct:!!(a!=null&&a.supportsDistinct),supportsPagination:!!(a!=null&&a.supportsPagination),supportsStandardizedQueriesOnly:!!(a!=null&&a.useStandardizedQueries),supportsPercentileStatistics:!!(a!=null&&a.supportsPercentileStatistics),supportsCentroid:!!(a!=null&&a.supportsReturningGeometryCentroid),supportsDistance:!!(a!=null&&a.supportsQueryWithDistance),supportsExtent:!!(a!=null&&a.supportsReturningQueryExtent),supportsGeometryProperties:!!(a!=null&&a.supportsReturningGeometryProperties),supportsHavingClause:!!(a!=null&&a.supportsHavingClause),supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!(a!=null&&a.supportsDefaultSR),supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0},mensuration:{supportsDistanceAndAngle:f,supportsAreaAndPerimeter:f,supportsPointOrCentroid:f,supportsHeightFromBaseAndTop:y&&R.includes("base-top height"),supportsHeightFromBaseAndTopShadow:y&&R.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:y&&R.includes("top-top shadow height"),supports3D:y&&R.includes("3d")}}}};function o(e){return(e==null?void 0:e.path)??""}return n([l()],i.prototype,"_functionRasterInfos",void 0),n([l()],i.prototype,"_rasterJobHandler",void 0),n([l()],i.prototype,"_cachedRendererJson",void 0),n([l({readOnly:!0})],i.prototype,"_serviceSupportsMosaicRule",void 0),n([M("_serviceSupportsMosaicRule",["currentVersion","fields"])],i.prototype,"readServiceSupportsMosaicRule",null),n([l()],i.prototype,"_rasterAttributeTableFieldPrefix",void 0),n([l({readOnly:!0})],i.prototype,"_rasterFunctionNamesIndex",null),n([l()],i.prototype,"adjustAspectRatio",void 0),n([l({type:[$e],json:{write:!0}})],i.prototype,"bandIds",void 0),n([M("bandIds")],i.prototype,"readBandIds",null),n([l({readOnly:!0,json:{read:!1}})],i.prototype,"capabilities",void 0),n([M("service","capabilities",["capabilities","currentVersion","serviceDataType"])],i.prototype,"readCapabilities",null),n([l({type:Number})],i.prototype,"compressionQuality",void 0),n([D("compressionQuality")],i.prototype,"writeCompressionQuality",null),n([l({type:Number})],i.prototype,"compressionTolerance",void 0),n([D("compressionTolerance")],i.prototype,"writeCompressionTolerance",null),n([l({json:{read:{source:"copyrightText"}}})],i.prototype,"copyright",void 0),n([l({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],i.prototype,"defaultMosaicRule",void 0),n([M("defaultMosaicRule",["defaultMosaicMethod"])],i.prototype,"readDefaultMosaicRule",null),n([l({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),n([l({readOnly:!0,constructOnly:!0})],i.prototype,"exportImageServiceParameters",void 0),n([l()],i.prototype,"rasterInfo",void 0),n([l({readOnly:!0,type:[ce]})],i.prototype,"fields",void 0),n([l({readOnly:!0})],i.prototype,"fieldsIndex",null),n([l({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],i.prototype,"format",null),n([M("service","format",["serviceDataType"])],i.prototype,"readFormat",null),n([l({type:Pe})],i.prototype,"fullExtent",void 0),n([l({readOnly:!0})],i.prototype,"hasMultidimensions",void 0),n([l({json:{read:{source:"maxImageHeight"}}})],i.prototype,"imageMaxHeight",void 0),n([l({json:{read:{source:"maxImageWidth"}}})],i.prototype,"imageMaxWidth",void 0),n([l({type:String,json:{type:ae.jsonValues,read:ae.read,write:ae.write}})],i.prototype,"interpolation",void 0),n([l()],i.prototype,"minScale",void 0),n([M("service","minScale")],i.prototype,"readMinScale",null),n([l()],i.prototype,"maxScale",void 0),n([M("service","maxScale")],i.prototype,"readMaxScale",null),n([l({type:L})],i.prototype,"mosaicRule",null),n([M("mosaicRule",["mosaicRule","defaultMosaicMethod"])],i.prototype,"readMosaicRule",null),n([D("mosaicRule")],i.prototype,"writeMosaicRule",null),n([l()],i.prototype,"multidimensionalInfo",void 0),n([l({type:Mt,json:{write:!0}})],i.prototype,"multidimensionalSubset",void 0),n([l({json:{type:$e}})],i.prototype,"noData",void 0),n([D("noData")],i.prototype,"writeNoData",null),n([l({type:String,json:{type:Ie.jsonValues,read:Ie.read,write:Ie.write}})],i.prototype,"noDataInterpretation",void 0),n([l({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],i.prototype,"objectIdField",void 0),n([M("objectIdField")],i.prototype,"readObjectIdField",null),n([l({})],i.prototype,"geometryType",void 0),n([l({})],i.prototype,"typeIdField",void 0),n([l({})],i.prototype,"types",void 0),n([l({readOnly:!0})],i.prototype,"parsedUrl",null),n([l({type:Function})],i.prototype,"pixelFilter",void 0),n([l()],i.prototype,"raster",void 0),n([l({readOnly:!0})],i.prototype,"sourceType",void 0),n([M("sourceType",["serviceSourceType","fields"])],i.prototype,"readSourceType",null),n([l()],i.prototype,"viewId",void 0),n([l({types:Jt,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:Et,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],i.prototype,"renderer",null),n([M("renderer")],i.prototype,"readRenderer",null),n([D("renderer")],i.prototype,"writeRenderer",null),n([l()],i.prototype,"symbolizer",void 0),n([l(Zt)],i.prototype,"opacity",void 0),n([l({readOnly:!0})],i.prototype,"rasterFields",null),n([l({constructOnly:!0})],i.prototype,"rasterFunctionInfos",void 0),n([l({type:b})],i.prototype,"renderingRule",null),n([l({type:b,json:{name:"renderingRule"}})],i.prototype,"rasterFunction",null),n([M("rasterFunction",["renderingRule","rasterFunctionInfos"])],i.prototype,"readRasterFunction",null),n([l()],i.prototype,"serviceDataType",void 0),n([l({readOnly:!0,type:he})],i.prototype,"spatialReference",void 0),n([M("spatialReference",["spatialReference","extent"])],i.prototype,"readSpatialReference",null),n([l({json:{type:ze.jsonValues}})],i.prototype,"pixelType",void 0),n([M("pixelType")],i.prototype,"readPixelType",null),n([D("pixelType")],i.prototype,"writePixelType",null),n([l({constructOnly:!0,type:mt})],i.prototype,"serviceRasterInfo",void 0),n([l()],i.prototype,"sourceJSON",void 0),n([l(Xt)],i.prototype,"url",void 0),n([l({readOnly:!0})],i.prototype,"version",void 0),n([M("version",["currentVersion","fields","timeInfo"])],i.prototype,"readVersion",null),i=n([F("esri.layers.mixins.ArcGISImageService")],i),i};let z=class extends _t(Ri(Ot(gi(fi(ur(Ct(yi(hi($t(At)))))))))){constructor(...s){super(...s),this.legendEnabled=!0,this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery"}normalizeCtorArgs(s,i){return typeof s=="string"?{url:s,...i}:s}load(s){const i=s!=null?s.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},s).catch(jt).then(()=>this._fetchService(i))),Promise.resolve(this)}writeOperationalLayerType(s,i,o){var t;const e=((t=this.renderer)==null?void 0:t.type)==="vector-field";i[o]=e?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(s){const i=this.rasterFields,o=this.title,e=new Set;let t=!1,r=!1;this.capabilities&&(t=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,r=this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir");const a=new Set;t&&a.add("raster.itempixelvalue");for(const u of i){const p=u.name.toLowerCase();a.has(p)||p.includes("raster.servicepixelvalue.")||e.add(u.name)}return r&&e.add("raster.magnitude").add("raster.direction"),wi({fields:i,title:o},{...s,visibleFieldNames:e})}queryFeatures(s,i){return this.queryRasters(s,i).then(o=>{if(o!=null&&o.features)for(const e of o.features)e.layer=e.sourceLayer=this;return o})}queryFeatureCount(s,i){return this.queryRasterCount(s,i)}redraw(){this.emit("redraw")}serviceSupportsSpatialReference(s){return vi(this,s)}};n([l(Yt)],z.prototype,"legendEnabled",void 0),n([l({type:["show","hide"]})],z.prototype,"listMode",void 0),n([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],z.prototype,"isReference",void 0),n([l({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],z.prototype,"operationalLayerType",void 0),n([D("web-map","operationalLayerType")],z.prototype,"writeOperationalLayerType",null),n([l(ei)],z.prototype,"popupEnabled",void 0),n([l({type:Vt,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],z.prototype,"popupTemplate",void 0),n([l({readOnly:!0})],z.prototype,"defaultPopupTemplate",null),n([l({readOnly:!0,json:{read:!1}})],z.prototype,"type",void 0),z=n([F("esri.layers.ImageryLayer")],z);const is=z;export{is as default}; diff --git a/assets/ImageryLayerView3D-b65487bb.js b/assets/ImageryLayerView3D-b65487bb.js new file mode 100644 index 0000000..aa36bc5 --- /dev/null +++ b/assets/ImageryLayerView3D-b65487bb.js @@ -0,0 +1 @@ +import{ai as o,aj as d,al as w,ar as h,c7 as c,aR as D,aC as E}from"./index-080e108a.js";import{z as b}from"./DynamicLayerView3D-b48678f2.js";import{b as I}from"./commonProperties-30089b06.js";import{b as H}from"./Query-1c961d4c.js";import{p as P}from"./popupUtils-f04ec9a9.js";import"./LayerView3D-ffd35809.js";import"./projectExtentUtils-efa4cddd.js";import"./ImageMaterial-5c48df66.js";import"./LayerView-448bc5ea.js";import"./RefreshableLayerView-915e7f53.js";const F=e=>{let t=class extends e{constructor(){super(...arguments),this.view=null}async fetchPopupFeatures(a,s){const{layer:n}=this;if(!a)throw new h("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:n});const{popupEnabled:i}=n,r=P(n,s);if(!i||r==null)throw new h("imagerylayerview:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:i,popupTemplate:r});const y=await r.getRequiredFields(),l=new H;l.timeExtent=this.timeExtent,l.geometry=a,l.outFields=y,l.outSpatialReference=a.spatialReference;const{resolution:p,spatialReference:u}=this.view,g=this.view.type==="2d"?new c(p,p,u):new c(.5*p,.5*p,u),{returnTopmostRaster:f,showNoDataRecords:x}=r.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},R={returnDomainValues:!0,returnTopmostRaster:f,pixelSize:g,showNoDataRecords:x,signal:s!=null?s.signal:null};return n.queryVisibleRasters(l,R).then(v=>v)}canResume(){var a;return!!super.canResume()&&!((a=this.timeExtent)!=null&&a.isEmpty)}};return o([d()],t.prototype,"layer",void 0),o([d()],t.prototype,"suspended",void 0),o([d(I)],t.prototype,"timeExtent",void 0),o([d()],t.prototype,"view",void 0),t=o([w("esri.views.layers.ImageryLayerView")],t),t};let m=class extends F(b){constructor(){super(...arguments),this.type="imagery-3d",this.redrawDebounced=D(async e=>{this.redraw((t,a)=>this._redrawImage(t,a),e)},2e3)}initialize(){this.handles.add([E(()=>this.view.basemapTerrain.ready,()=>this._initializeMaximumDataResolution(),{once:!0,initial:!0}),this.layer.on("redraw",()=>this.updatingHandles.addPromise(this.redrawDebounced()))]),this.updatingHandles.add(()=>{var e,t;return(t=(e=this.layer)==null?void 0:e.exportImageServiceParameters)==null?void 0:t.version},()=>{this.updatingHandles.addPromise(this.refreshDebounced())}),this.updatingHandles.add(()=>{var e;return(e=this.layer)==null?void 0:e.renderer},()=>{this.updatingHandles.addPromise(this.refreshDebounced())}),this.updatingHandles.add(()=>this.timeExtent,()=>this.updatingHandles.addPromise(this.refreshDebounced()))}_initializeMaximumDataResolution(){this.maximumDataResolution=this.layer.loaded?this.layer.serviceRasterInfo.pixelSize:null}getFetchOptions(){return{timeExtent:this.timeExtent}}async processResult(e,t,a){t.imageOrCanvasElement?e.image=t.imageOrCanvasElement:(e.image=document.createElement("canvas"),e.pixelData=t.pixelData,await this._redrawImage(e,a))}async _redrawImage(e,t){if(!(e.image instanceof HTMLCanvasElement)||e.pixelData==null)throw new Error;const a=e.image,s=a.getContext("2d"),n=await this.layer.applyRenderer(e.pixelData,{signal:t}),i=this.layer.applyFilter(n).pixelBlock;if(i==null)throw new Error;a.width=i.width,a.height=i.height;const r=s.createImageData(i.width,i.height);r.data.set(i.getAsRGBA()),s.putImageData(r,0,0)}};m=o([w("esri.views.3d.layers.ImageryLayerView3D")],m);const q=m;export{q as default}; diff --git a/assets/ImageryTileLayer-19c32ddc.js b/assets/ImageryTileLayer-19c32ddc.js new file mode 100644 index 0000000..555e9b0 --- /dev/null +++ b/assets/ImageryTileLayer-19c32ddc.js @@ -0,0 +1,2 @@ +import{cY as pt,bV as Z,bX as nt,bz as ze,ar as $,jo as Ne,c7 as A,ca as H,at,hr as yt,f2 as ot,g9 as gt,ai as I,aj as v,al as Q,ck as xt,aw as wt,cZ as We,bc as q,ay as It,dD as bt,fp as lt,dZ as Pe,cn as St,fL as Rt,fI as vt,bf as Tt,eQ as _t,eS as kt,eR as Ft,as as Mt,cq as ue,aG as Ct,eZ as Pt,d2 as $t,cC as Ot,aA as Dt}from"./index-080e108a.js";import{O as Bt}from"./MultiOriginJSONSupport-e4912ffd.js";import{l as zt}from"./ArcGISService-83287338.js";import{o as Nt}from"./CustomParametersMixin-231c4be8.js";import{h as ct,D as Jt,i as Et,a as At,p as ut,c as Ht,N as $e,l as Lt,d as Wt,b as qt,e as jt,f as qe,o as Gt,g as je,Q as Ge,E as Ue,j as Ut,L as Vt,q as Xt,k as Ve,t as Yt,m as Kt,n as Qt}from"./ImageHistogramParameters-84349e1d.js";import{f as ht,c as Zt}from"./commonProperties-30089b06.js";import{U as _e,j as ei,n as ye,R as ft,I as ti,a as ii,l as si,b as ri,u as ee,f as ni,m as ai,s as oi,L as li,r as Xe,c as ge,W as ci,h as ui,g as Je,P as hi,T as fi,d as di,v as mi,e as pi,N as yi,i as gi,k as xe,B as xi,o as wi,D as Ii}from"./dataUtils-69946c3c.js";import{k as Oe,K as we,_ as Ye,i as Ke,n as bi,Q as ke,q as Se,$ as Si,V as Ri,C as vi,J as Ti}from"./rasterProjectionHelper-072edec4.js";import{d as Ee}from"./FeatureSet-111cb247.js";import{_ as De,f as _i,i as ki,y as Ae,n as Fi,h as Mi}from"./utils-12672bd4.js";import{c as Ci}from"./OperationalLayer-0e8f8b28.js";import{j as Pi}from"./PortalLayer-310c2800.js";import{a as $i}from"./TemporalLayer-f17c9161.js";import{T as Oi}from"./TilemapCache-67ada3c3.js";import{p as Di}from"./popupUtils-82ea8abb.js";import"./UniqueValueRenderer-fef4204d.js";import"./diffUtils-590c9088.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./generateRendererUtils-1e52a587.js";import"./colorUtils-c0f43caf.js";import"./portalItemUtils-792a27e1.js";let Bi=class{constructor(e=15e3,r=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,r)}decreaseRefCount(e,r){const t=e+"/"+r,i=this._cachedBlocks;if(i.has(t)){const n=i.get(t);return n.refCount--,n.refCount<=0&&(i.delete(t),n.controller&&n.controller.abort()),n.refCount}return 0}getBlock(e,r){const t=e+"/"+r,i=this._cachedBlocks;if(i.has(t)){const n=i.get(t);return n.ts=Date.now(),n.refCount++,i.delete(t),i.set(t,n),n.block}return null}putBlock(e,r,t,i){const n=this._cachedBlocks,a=e+"/"+r;if(n.has(a)){const o=n.get(a);o.ts=Date.now(),o.refCount++}else n.set(a,{block:t,ts:Date.now(),refCount:1,controller:i});this._trim(),this._updateTimer()}deleteBlock(e,r){const t=this._cachedBlocks,i=e+"/"+r;t.has(i)&&t.delete(i)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(this._timer!=null)return;const e=this._cachedBlocks;this._timer=setInterval(()=>{const r=Array.from(e),t=Date.now();for(let i=0;i=e.size)return;const r=Array.from(e);for(let t=0;ta.isResolved=!0).catch(()=>a.isRejected=!0),(o=n[e])==null||o.cache.set(r,a)}function Ni(s,e,r){var i;const t=ve.get(s);t?e!=null&&t[e]!=null?(i=t[e])==null||i.cache.delete(r):ie.deleteBlock(s,r):e==null&&ie.deleteBlock(s,r)}const tt=8,Ji=256;let L=class extends pt(xt){constructor(){super(...arguments),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const s=Oe();this.addResolvingPromise(s),await this.when()}normalizeCtorArgs(s){return s&&s.ioConfig&&(s={...s,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:Z.create(),...s.ioConfig}}),s}get _isGlobalWrappableSource(){const{rasterInfo:s}=this,e=we(s.spatialReference);return e!=null&&s.extent.width>=e/2}get _hasNoneOrGCSShiftTransform(){const{transform:s}=this.rasterInfo;return s==null||s.type==="gcs-shift"}set rasterJobHandler(s){var e,r;this._set("rasterJobHandler",s),this.datasetFormat==="Function"&&((r=(e=this.primaryRasters)==null?void 0:e.rasters)==null||r.forEach(t=>t.rasterJobHandler=s))}set url(s){this._set("url",nt(s,ze.getLogger(this)))}async open(s){throw new $("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(s,e,r,t={}){const i=t.tileInfo||this.rasterInfo.storageInfo.tileInfo,n=this.getTileExtentFromTileInfo(s,e,r,i);return this.fetchPixels(n,i.size[0],i.size[1],t)}async identify(s,e={}){var M;s=Ne(A,s).clone().normalize();const{multidimensionalDefinition:r,timeExtent:t}=e,{rasterInfo:i}=this,{hasMultidimensionalTranspose:n,multidimensionalInfo:a}=i;let{transposedVariableName:o}=e;const l=a!=null&&n&&(t!=null||ct(r));l&&!o&&(o=r!=null&&r.length>0?r[0].variableName??void 0:a.variables[0].name,e={...e,transposedVariableName:o}),e=this._getRequestOptionsWithSliceId(e);const{spatialReference:c,extent:h}=i,{datumTransformation:u}=e;let m=Ye(s,c,u);if(!h.intersects(m))return{location:m,value:null};if(i.transform!=null){const C=i.transform.inverseTransform(m);if(!i.nativeExtent.intersects(C))return{location:C,value:null};m=C}let d=0;const p=o!=null&&a!=null&&i.hasMultidimensionalTranspose;if(this.datasetFormat==="Function"){const C=this.primaryRasters.rasters[0];if(p)return C.identify(m,e);const{pixelSize:J}=i,O=3,P=J.x*O/2,D=J.y*O/2,z=new H({xmin:m.x-P,xmax:m.x+P,ymin:m.y-D,ymax:m.y+D,spatialReference:c}),V={interpolation:"nearest"},{pixelBlock:E}=await C.fetchPixels(z,O,O,V),{pixelBlock:B}=await this.fetchPixels(z,O,O,V);if(E==null)return{location:m,value:null};const G=Math.floor(O*O*.5),le=!E.mask||E.mask[G]?E.pixels.map(j=>j[G]):null;let X;return B!=null&&(X=!B.mask||B.mask[G]?B.pixels.map(j=>j[G]):void 0),{location:m,value:le,processedValue:X,pyramidLevel:0}}if(!p){if(e.srcResolution)d=Ke(e.srcResolution,i,this.ioConfig.sampling).pyramidLevel;else if(d=await this.computeBestPyramidLevelForLocation(s,e),d==null)return{location:m,value:null}}const y=this.identifyPixelLocation(m,d,null,p);if(y===null)return{location:m,value:null};const{row:f,col:g,rowOffset:x,colOffset:w,blockWidth:b}=y,T=o??e.sliceId,R=Qe(this.url,T),k=`${d}/${f}/${g}`;let _=Ze(R,null,k);_==null&&(_=this.fetchRawTile(d,f,g,e),et(R,null,k,_));const F=await _;if(F==null||!((M=F.pixels)!=null&&M.length))return{location:m,value:null};const S=x*b+w;return this._processIdentifyResult(F,{srcLocation:m,position:S,pyramidLevel:d,useTransposedTile:!!p,requestSomeSlices:l,identifyOptions:e})}async fetchPixels(s,e,r,t={}){s=bi(s),t=this._getRequestOptionsWithSliceId(t);const{_hasNoneOrGCSShiftTransform:i}=this;if(t.requestRawData&&i)return this._fetchPixels(s,e,r,t);const n=we(s.spatialReference),a=ke(s);if(n==null||a===0||a===1&&this._isGlobalWrappableSource&&i)return this._fetchPixels(s,e,r,t);if(a>=3)return{extent:s,pixelBlock:null};const o=[],{xmin:l,xmax:c}=s,h=Math.round(n/(c-l)*e),u=h-Math.round((n/2-l)/(c-l)*e);let m=0;const d=[];for(let g=0;g<=a;g++){const x=new H({xmin:g===0?l:-n/2,xmax:g===a?c-n*g:n/2,ymin:s.ymin,ymax:s.ymax,spatialReference:s.spatialReference}),w=g===0?h-u:g===a?e-m:h;m+=w,d.push(w);const b=t.disableWrapAround&&g>0?null:this._fetchPixels(x,w,r,t);o.push(b)}const p=(await Promise.all(o)).map(g=>g==null?void 0:g.pixelBlock);let y=null;const f={width:e,height:r};return this.rasterJobHandler?y=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:f,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:d},t)).pixelBlock:y=_e(p,f,{blockWidths:d}),{extent:s,srcExtent:Se(s,this.rasterInfo.spatialReference,t.datumTransformation),pixelBlock:y}}async fetchRawPixels(s,e,r,t={}){e={x:Math.floor(e.x),y:Math.floor(e.y)};const i=await this._fetchRawTiles(s,e,r,t),{nativeExtent:n,nativePixelSize:a,storageInfo:o}=this.rasterInfo,l=2**s,c=a.x*l,h=a.y*l,u=new H({xmin:n.xmin+c*e.x,xmax:n.xmin+c*(e.x+r.width-1),ymin:n.ymax-h*(e.y+r.height-1),ymax:n.ymax-h*e.y,spatialReference:n.spatialReference});if(!i)return{extent:u,srcExtent:u,pixelBlock:null};const{pixelBlocks:m,mosaicSize:d}=i;if(m.length===1&&m[0]!=null&&m[0].width===r.width&&m[0].height===r.height)return{extent:u,srcExtent:u,pixelBlock:i.pixelBlocks[0]};const p=s>0?o.pyramidBlockWidth:o.blockWidth,y=s>0?o.pyramidBlockHeight:o.blockHeight,f={x:e.x%p,y:e.y%y};let g;return this.rasterJobHandler?g=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:d,destDimension:r,clipOffset:f,clipSize:r,coefs:null,sampleSpacing:null,interpolation:t.interpolation,alignmentInfo:null,blockWidths:null},t)).pixelBlock:g=_e(m,d,{clipOffset:f,clipSize:r}),{extent:u,srcExtent:u,pixelBlock:g}}fetchRawTile(s,e,r,t){throw new $("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(s){return Se(this.rasterInfo.extent,s)}decodePixelBlock(s,e){return!this.rasterJobHandler||e.useCanvas?ei(s,e):this.rasterJobHandler.decode({data:s,options:e})}async request(s,e,r=0){const{customFetchParameters:t}=this.ioConfig,{range:i,query:n,headers:a}=e;r=r??e.retryCount??this.ioConfig.retryCount;const o=i?{Range:`bytes=${i.from}-${i.to}`}:null;try{return await at(s,{...e,query:{...n,...t},headers:{...a,...o}})}catch(l){if(r>0)return r--,this.request(s,e,r);throw l}}getSliceIndex(s){const{multidimensionalInfo:e}=this.rasterInfo;return e==null||s==null||s.length===0?null:Jt(s,e)}getTileExtentFromTileInfo(s,e,r,t){const i=yt(t.lodAt(s));return this.getTileExtent({x:i.resolution,y:i.resolution},e,r,t.origin,t.spatialReference,t.size)}updateTileInfo(){const{storageInfo:s,spatialReference:e,extent:r,pixelSize:t}=this.rasterInfo;if(!s.tileInfo){const i=[],n=s.maximumPyramidLevel||0;let a=Math.max(t.x,t.y),o=1/.0254*96*a;for(let c=0;c<=n;c++)i.push(new ot({level:n-c,resolution:a,scale:o})),a*=2,o*=2;const l=new A({x:r.xmin,y:r.ymax,spatialReference:e});s.tileInfo=new Z({origin:l,size:[s.blockWidth,s.blockHeight],spatialReference:e,lods:i}),s.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(s,e=512,r=512,t){const{width:i,height:n,nativeExtent:a,pixelSize:o,spatialReference:l}=s,c=new A({x:a.xmin,y:a.ymax,spatialReference:l});t==null&&(t=Math.max(0,Math.round(Math.log(Math.max(i,n))/Math.LN2-8)));const h=this.computeBlockBoundary(a,512,512,{x:a.xmin,y:a.ymax},[o],t);s.storageInfo=new ye({blockWidth:e,blockHeight:r,pyramidBlockWidth:e,pyramidBlockHeight:r,origin:c,firstPyramidLevel:1,maximumPyramidLevel:t,blockBoundary:h})}async computeBestPyramidLevelForLocation(s,e={}){return 0}computeBlockBoundary(s,e,r,t,i,n=0,a=2){if(i.length===1&&n>0){i=[...i];let{x:h,y:u}=i[0];for(let m=0;mo)return null;const d=this.getPyramidPixelSize(e),{x:p,y}=d,f=(l.y-m.y)/y/u,g=(m.x-l.x)/p/h,x=Math.min(u-1,Math.floor((f-Math.floor(f))*u)),w=Math.min(h-1,Math.floor((g-Math.floor(g))*h));return{pyramidLevel:e,row:Math.floor(f),col:Math.floor(g),rowOffset:x,colOffset:w,blockWidth:h,srcLocation:m}}getTileExtent(s,e,r,t,i,n){const[a,o]=n,l=t.x+r*a*s.x,c=l+a*s.x,h=t.y-e*o*s.y,u=h-o*s.y;return new H({xmin:l,xmax:c,ymin:u,ymax:h,spatialReference:i})}getBlockWidthHeight(s){return{blockWidth:s>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:s>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(s,e,r){const t=this.rasterInfo.storageInfo.blockBoundary[s];return!t||t.maxRowe||t.minCol>r}async _fetchPixels(s,e,r,t={}){let i=ke(s);if(i>=2)return{extent:s,pixelBlock:null};const n=this._getSourceDataInfo(s,e,r,t),{pyramidLevel:a,srcResolution:o,srcExtent:l,srcWidth:c,srcHeight:h,ul:u}=n;if(c===0||h===0)return{extent:s,srcExtent:l,pixelBlock:null};const{rasterInfo:m}=this,d=m.transform,p=(d==null?void 0:d.type)==="gcs-shift",y=we(s.spatialReference)!=null;!p&&y||(i=ke(n.srcExtent,p));const f=await this._fetchRawTiles(a,u,{width:c,height:h,wrapCount:i},t);if(!f)return{extent:s,srcExtent:l,pixelBlock:null};const g=m.storageInfo,x=a>0?g.pyramidBlockWidth:g.blockWidth,w=a>0?g.pyramidBlockHeight:g.blockHeight;let{x:b,y:T}=m.pixelSize;if(a>0){const{pyramidResolutions:j,pyramidScalingFactor:mt}=g;if(j!=null&&j[a-1])({x:b,y:T}=j[a-1]);else{const Le=mt**a;b*=Le,T*=Le}}const R=m.spatialReference,k=new A({x:b,y:T,spatialReference:R}),_=x===c&&w===h&&u.x%x==0&&u.y%w==0,F=new A({x:(s.xmax-s.xmin)/e,y:(s.ymax-s.ymin)/r,spatialReference:s.spatialReference}),S=!s.spatialReference.equals(R),M=R.isGeographic?1e-9:1e-4,{datumTransformation:C}=t;if(!S&&_&&f.pixelBlocks.length===1&&x===e&&w===r&&this._isSameResolution(o,F,M))return{extent:s,srcExtent:l,srcTilePixelSize:k,pixelBlock:f.pixelBlocks[0]};const J=y&&we(l.spatialReference)!=null&&this._hasNoneOrGCSShiftTransform,O=t.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");O&&!this.rasterJobHandler&&await Oe();const P=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:s,srcBufferExtent:f.extent,pixelSize:F.toJSON(),datumTransformation:C,rasterTransform:d,hasWrapAround:i>0||J,isAdaptive:this.ioConfig.optimizeProjectionAccuracy!==!1,includeGCSGrid:O},t):Si({projectedExtent:s,srcBufferExtent:f.extent,pixelSize:F,datumTransformation:C,rasterTransform:d,hasWrapAround:i>0||J,isAdaptive:!1,includeGCSGrid:O});let D;const z=!t.requestRawData,V={rows:P.spacing[0],cols:P.spacing[1]},E=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(a,f.extent.xmin):void 0,{pixelBlocks:B,mosaicSize:G,isPartiallyFilled:le}=f;let X=null;if(this.rasterJobHandler)({pixelBlock:D,localNorthDirections:X}=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:B,srcMosaicSize:G,destDimension:z?{width:e,height:r}:null,coefs:z?P.coefficients:null,sampleSpacing:z?V:null,projectDirections:O,gcsGrid:O?P.gcsGrid:null,isUV:this.rasterInfo.dataType==="vector-uv",interpolation:t.interpolation,alignmentInfo:E,blockWidths:null},t));else{const j=_e(B,G,{alignmentInfo:E});D=z?ft(j,{width:e,height:r},P.coefficients,V,t.interpolation):j,O&&P.gcsGrid&&(X=ti({width:e,height:r},P.gcsGrid),D=ii(D,this.rasterInfo.dataType,X))}return t.requestRawData||O?{extent:s,srcExtent:l,srcTilePixelSize:k,pixelBlock:D,transformGrid:P,localNorthDirections:X,isPartiallyFilled:le}:{extent:s,srcExtent:l,srcTilePixelSize:k,pixelBlock:D}}async _fetchRawTiles(s,e,r,t){const{origin:i,blockBoundary:n}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:o}=this.getBlockWidthHeight(s);let{x:l,y:c}=e,{width:h,height:u,wrapCount:m}=r;const d=this._getRasterTileAlignmentInfo(s,0);t.buffer&&(l-=t.buffer.cols,c-=t.buffer.rows,h+=2*t.buffer.cols,u+=2*t.buffer.rows);let p=0,y=0,f=0;m&&d!=null&&({worldColumnCountFromOrigin:y,originColumnOffset:f,rightPadding:p}=d,y*d.blockWidth-p>=l+h&&(p=0));const g=Math.floor(l/a),x=Math.floor(c/o),w=Math.floor((l+h+p-1)/a),b=Math.floor((c+u+p-1)/o),T=n[s];if(!T)return null;const{minRow:R,minCol:k,maxCol:_,maxRow:F}=T;if(m===0&&(bF||g>_))return null;const S=new Array;let M=!1;const C=this.ioConfig.allowPartialFill==null?t.allowPartialFill:this.ioConfig.allowPartialFill;for(let E=x;E<=b;E++)for(let B=g;B<=w;B++){let G=B;if(!t.disableWrapAround&&m&&d!=null&&y<=B&&(G=B-y-f),E>=R&&G>=k&&F>=E&&_>=G){const le=this._fetchRawTile(s,E,G,t);C?S.push(new Promise(X=>{le.then(j=>X(j)).catch(()=>{M=!0,X(null)})})):S.push(le)}else S.push(Promise.resolve(null))}if(S.length===0)return null;const J=await Promise.all(S),O={height:(b-x+1)*o,width:(w-g+1)*a},{spatialReference:P}=this.rasterInfo,D=this.getPyramidPixelSize(s),{x:z,y:V}=D;return{extent:new H({xmin:i.x+g*a*z,xmax:i.x+(w+1)*a*z,ymin:i.y-(b+1)*o*V,ymax:i.y-x*o*V,spatialReference:P}),pixelBlocks:J,mosaicSize:O,isPartiallyFilled:M}}_isSameResolution(s,e,r){return Math.abs(s.x-e.x)l||r>o)return Promise.resolve(null);const c=Qe(this.url,t.sliceId),h=`${s}/${e}/${r}`;let u=Ze(c,t.registryId,h);if(u==null){const m=new AbortController;u=this.fetchRawTile(s,e,r,{...t,signal:m.signal}),et(c,t.registryId,h,u,m),u.catch(()=>Ni(c,t.registryId,h))}return t.signal&>(t,()=>{zi(c,t.registryId,h)}),u}_computeMagDirValues(s){var l;const{bandCount:e,dataType:r}=this.rasterInfo;if(!(e===2&&r==="vector-magdir"||r==="vector-uv")||(s==null?void 0:s.length)!==2||!((l=s[0])!=null&&l.length))return null;const t=s[0].length;if(r==="vector-magdir"){const c=s[1].map(h=>(h+360)%360);return[s[0],c]}const[i,n]=s,a=[],o=[];for(let c=0;c=16,m=l===n&&this._requireTooManySrcTiles(a,o,e,r);if(u||m||a===0||o===0){const d=new A({x:(s.xmax-s.xmin)/e,y:(s.ymax-s.ymin)/r,spatialReference:s.spatialReference});let p=vi(d,this.rasterInfo.spatialReference,s,i.datumTransformation);const y=!p||t.srcResolution&&p.x+p.y=f){const g=2**f;p={x:t.srcResolution.x*g,y:t.srcResolution.y*g}}}p&&(i.srcResolution=p,this._updateSourceDataInfo(s,i))}return this._requireTooManySrcTiles(i.srcWidth,i.srcHeight,e,r)&&(i.srcWidth=0,i.srcHeight=0),i}_requireTooManySrcTiles(s,e,r,t){const{tileInfo:i}=this.rasterInfo.storageInfo;return Math.ceil(s/i.size[0])*Math.ceil(e/i.size[1])>=Ji||s/r>tt||e/t>tt}_updateSourceDataInfo(s,e){e.srcWidth=0,e.srcHeight=0;const{rasterInfo:r}=this,t=r.spatialReference,{srcResolution:i,datumTransformation:n}=e,{pyramidLevel:a,pyramidResolution:o,excessiveReading:l}=Ke(i,r,this.ioConfig.sampling);if(l)return;let c=e.srcExtent||Se(s,t,n);if(c==null)return;const h=r.transform;h&&(c=h.inverseTransform(c)),e.srcExtent=c;const{x:u,y:m}=r.storageInfo.origin,d=Math.floor((c.xmin-u)/o.x+.1),p=Math.floor((m-c.ymax)/o.y+.1),y=Math.floor((c.xmax-u)/o.x-.1),f=Math.floor((m-c.ymin)/o.y-.1),g=c.width<.1*o.x?0:y-d+1,x=c.height<.1*o.y?0:f-p+1;e.pyramidLevel=a,e.pyramidResolution=o,e.srcWidth=g,e.srcHeight=x,e.ul={x:d,y:p}}_getRequestOptionsWithSliceId(s){return this.rasterInfo.multidimensionalInfo!=null&&s.sliceId==null&&(s={...s,sliceId:this.getSliceIndex(s.multidimensionalDefinition)}),s}_processIdentifyResult(s,e){const{srcLocation:r,position:t,pyramidLevel:i,useTransposedTile:n}=e,a=s.pixels[0].length/s.width/s.height;if(!(!s.mask||s.mask[t]))return{location:r,value:null};const{multidimensionalInfo:o}=this.rasterInfo;if(o==null||!n){const f=s.pixels.map(w=>w[t]),g={location:r,value:f,pyramidLevel:i},x=this._computeMagDirValues(f.map(w=>[w]));return x!=null&&x.length&&(g.magdirValue=x.map(w=>w[0])),g}let l=s.pixels.map(f=>f.slice(t*a,t*a+a)),c=this._computeMagDirValues(l);const{requestSomeSlices:h,identifyOptions:u}=e;let m=Et(o,u.transposedVariableName);if(h){const f=At(m,u.multidimensionalDefinition,u.timeExtent);l=l.map(g=>f.map(x=>g[x])),c=c==null?void 0:c.map(g=>f.map(x=>g[x])),m=f.map(g=>m[g])}const d=s.noDataValues||this.rasterInfo.noDataValue,p={pixels:l,pixelType:s.pixelType};let y;return d!=null&&(ri(p,d),y=p.mask),{location:r,value:null,dataSeries:m.map((f,g)=>{const x={value:(y==null?void 0:y[g])===0?null:l.map(w=>w[g]),multidimensionalDefinition:f.multidimensionalDefinition.map(w=>new ut({...w,isSlice:!0}))};return c!=null&&c.length&&(x.magdirValue=[c[0][g],c[1][g]]),x}),pyramidLevel:i}}};I([v()],L.prototype,"_rasterTileAlighmentInfo",void 0),I([v({readOnly:!0})],L.prototype,"_isGlobalWrappableSource",null),I([v({readOnly:!0})],L.prototype,"_hasNoneOrGCSShiftTransform",null),I([v()],L.prototype,"rasterJobHandler",null),I([v(ht)],L.prototype,"url",null),I([v({type:String,json:{write:!0}})],L.prototype,"datasetName",void 0),I([v({type:String,json:{write:!0}})],L.prototype,"datasetFormat",void 0),I([v()],L.prototype,"hasUniqueSourceStorageInfo",void 0),I([v()],L.prototype,"rasterInfo",void 0),I([v()],L.prototype,"ioConfig",void 0),I([v()],L.prototype,"sourceJSON",void 0),L=I([Q("esri.layers.support.rasterDatasets.BaseRaster")],L);const oe=L;let se=class extends oe{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null}async open(e){var h,u,m,d;await this.init();const{rasterFunction:r}=this;(u=(h=this.primaryRasters)==null?void 0:h.rasters)!=null&&u.length?r.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=r.getPrimaryRasters(),this.rasterJobHandler&&((m=this.primaryRasters.rasters)==null||m.forEach(p=>p.rasterJobHandler=this.rasterJobHandler)));const{rasters:t,rasterIds:i}=this.primaryRasters,n=t.map(p=>p.rasterInfo?void 0:p.open(e));await Promise.all(n);const a=t.map(({rasterInfo:p})=>p),o=r.bind({rasterInfos:a,rasterIds:i});if(!o.success||a.length===0)throw new $("raster-function:open",`cannot bind the function: ${o.error??""}`);const l=r.functionName==="Table"?r:(d=r.functionArguments)==null?void 0:d.raster;(l==null?void 0:l.functionName)==="Table"&&(r.rasterInfo.attributeTable=Ee.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=a[0];this.hasUniqueSourceStorageInfo=a.length===1||a.slice(1).every(p=>this._hasSameStorageInfo(p,c)),this.set("sourceJSON",t[0].sourceJSON),this.set("rasterInfo",r.rasterInfo)}async syncJobHandler(){var e;return(e=this.rasterJobHandler)==null?void 0:e.updateRasterFunction(this.rasterFunction)}async fetchPixels(e,r,t,i={}){var w,b;const{rasters:n,rasterIds:a}=this.primaryRasters;let o=!1;const{interpolation:l}=i,c=(w=this.rasterFunction.flatWebGLFunctionChain)==null?void 0:w.hasSurfaceFunction;!i.requestRawData&&l!=="bilinear"&&c&&(o=n.length===1&&!i.skipRasterFunction,i={...i,interpolation:"bilinear",requestRawData:o});const h=n.map(T=>T.fetchPixels(e,r,t,i)),u=await Promise.all(h),m=u.map(T=>T.pixelBlock),d=o||i.requestRawData?u.map(T=>T.srcTilePixelSize):null;if(i.skipRasterFunction||m.every(T=>T==null))return u[0];const p=((b=u.find(T=>T.pixelBlock!=null))==null?void 0:b.extent)??e,y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:p,primaryPixelBlocks:m,primaryPixelSizes:d,primaryRasterIds:a}):this.rasterFunction.process({extent:p,primaryPixelBlocks:m,primaryPixelSizes:d,primaryRasterIds:a}),{transformGrid:f}=u[0];if(!o||y==null||f==null)return{...u[0],pixelBlock:y};const g={rows:f.spacing[0],cols:f.spacing[1]};let x;return this.rasterJobHandler?x=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:r,height:t},coefs:f.coefficients,sampleSpacing:g,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},i)).pixelBlock:x=ft(y,{width:r,height:t},f.coefficients,g,l),{extent:e,srcExtent:u[0].srcExtent,pixelBlock:x}}_hasSameStorageInfo(e,r){const{storageInfo:t,pixelSize:i,spatialReference:n,extent:a}=e,{storageInfo:o,pixelSize:l,spatialReference:c,extent:h}=r;return i.x===l.x&&i.y===l.y&&n.equals(c)&&a.equals(h)&&t.blockHeight===o.blockHeight&&t.blockWidth===o.blockWidth&&t.maximumPyramidLevel===o.maximumPyramidLevel}};I([v({type:String,json:{write:!0}})],se.prototype,"datasetFormat",void 0),I([v()],se.prototype,"tileType",void 0),I([v()],se.prototype,"rasterFunction",void 0),I([v()],se.prototype,"primaryRasters",void 0),se=I([Q("esri.layers.support.rasterDatasets.FunctionRaster")],se);const Be=se;function Ei(s,e){if(s.spatialReference.equals(e))return s;const r=We(s.spatialReference),t=We(e);if(r===t)return s;const i=r/t;return{x:s.x*i,y:s.y*i}}async function Ai(s,e,r){if(r.type==="extent")return Li(s,e,r);const{width:t,height:i}=s,n=new Uint8Array(t*i),{contains:a,intersects:o}=await wt(()=>import("./geometryEngine-5a631b21.js"),["assets/geometryEngine-5a631b21.js","assets/geometryEngineBase-324c1c81.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/hydrated-c10ab4a5.js"]);return o(e,r)?r.type==="polyline"?Wi(s,e,r):a(r,e)?s:Hi(s,e,r):new ee({pixelType:s.pixelType,width:t,height:i,mask:n,maskIsAlpha:!1,pixels:[...s.pixels]})}function Hi(s,e,r){if(!s)return s;const{width:t,height:i}=s,n=e.width/t,a=e.height/i,{xmin:o,ymax:l}=e;let c;if(r.type==="extent"){const f=(r.xmin-o)/n,g=(r.xmax-o)/n,x=(l-r.ymax)/a,w=(l-r.ymin)/a;c=[[[f,x],[f,w],[g,w],[g,x],[f,x]]]}else c=r.rings.map(f=>f.map(([g,x])=>[(g-o)/n,(l-x)/a]));const h=document.createElement("canvas");h.width=t,h.height=i;const u=h.getContext("2d");u.fillStyle="#f00",c.forEach(f=>{u.beginPath(),u.moveTo(f[0][0],f[0][1]);for(let g=0;g127?255:0);return new ee({pixelType:s.pixelType,width:t,height:i,mask:y,maskIsAlpha:!1,pixels:[...s.pixels]})}function Li(s,e,r){const{width:t,height:i}=s,n=new Uint8Array(t*i),a=e.width/t,o=e.height/i;if(r.width/a<.5||r.height/o<.5)return new ee({pixelType:s.pixelType,width:t,height:i,mask:n,pixels:[...s.pixels]});const{xmin:l,xmax:c,ymin:h,ymax:u}=e,{xmin:m,xmax:d,ymin:p,ymax:y}=r,f=Math.max(l,m),g=Math.min(c,d),x=Math.max(h,p),w=Math.min(u,y),b=.5*a,T=.5*o;if(g-fc-b||x>u-T||w.5&&k%1<.5||C===J&&_%1>.5&&F%1<.5)return new ee({pixelType:s.pixelType,width:t,height:i,mask:n,pixels:[...s.pixels]});if(S===0&&C===0&&M===t&&J===i)return s;const O=s.mask;for(let P=C;P<=J;P++)for(let D=S;D<=M;D++){const z=P*t+D;n[z]=O?O[z]:255}return new ee({pixelType:s.pixelType,width:t,height:i,mask:n,pixels:[...s.pixels]})}function Wi(s,e,r){const{width:t,height:i}=s,n=new Uint8Array(t*i),a=e.width/t,o=e.height/i,{xmin:l,ymax:c}=e,{paths:h}=r,u=s.mask;for(let m=0;my?n*Math.round((u-y)/n):0),d=f-(dy?n*Math.round((m-y)/n):0),p=f-(py?n*Math.floor((u-y)/n+.1):0),d=f-(d{let e=class extends s{constructor(...t){var i,n;super(...t),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation="nearest",this.multidimensionalSubset=null,this.raster=null,this.rasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=((n=(i=t[0])==null?void 0:i.raster)==null?void 0:n.datasetFormat)==="Function"}get fullExtent(){var t;return(t=this.rasterInfo)==null?void 0:t.extent}set multidimensionalDefinition(t){this._set("multidimensionalDefinition",t),this.updateRenderer()}set rasterFunction(t){var i;((i=t==null?void 0:t.functionName)==null?void 0:i.toLowerCase())==="none"&&(t=void 0),this._set("rasterFunction",t),this.updateRasterFunction()}set url(t){this._set("url",nt(t,it))}set renderer(t){t==null&&this.rasterFunction==null?this._configDefaultRenderer("override"):(this._set("renderer",t),this.updateRenderer())}readRenderer(t,i,n){var o,l;const a=(l=(o=i==null?void 0:i.layerDefinition)==null?void 0:o.drawingInfo)==null?void 0:l.renderer;return qt(a,n)||void 0}async convertVectorFieldData(t,i){if(t==null||!this.rasterInfo)return null;const n=this._rasterJobHandler.instance,a=this.rasterInfo.dataType;return n?n.convertVectorFieldData({pixelBlock:t,dataType:a},i):ni(t,a)}async computeStatisticsHistograms(t,i){t=Ne(jt,t).clone();const{rasterInfo:n}=this,{geometry:a}=t;if(a==null)throw new $("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let o=a;const{spatialReference:l}=n;a.spatialReference.equals(l)||(await Oe(),o=a.type==="extent"?Se(a,l):Ti(a,l));const c=t.pixelSize??new A({x:n.pixelSize.x,y:n.pixelSize.y,spatialReference:l}),{extent:h,width:u,height:m}=qi(n,o,c),d=await this.fetchPixels(h,u,m,{...i,interpolation:"nearest"});if(d.pixelBlock==null)throw new $("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const p=await Ai(d.pixelBlock,h,o),y=this._rasterJobHandler.instance;return y?y.computeStatisticsHistograms({pixelBlock:p},i):ai(p)}async createFlowMesh(t,i){const n=this._rasterJobHandler.instance;return n?n.createFlowMesh(t,i):oi(t.meshType,t.simulationSettings,t.flowData,i.signal!=null?i.signal:new AbortController().signal)}normalizeRasterFetchOptions(t){var o,l;const{multidimensionalInfo:i}=this.rasterInfo??{};if(i==null)return t;let n=t.multidimensionalDefinition||this.multidimensionalDefinition;n!=null&&n.length||(n=qe(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const a=t.timeExtent||this.timeExtent;if(n!=null&&a!=null&&(a.start!=null||a.end!=null)){n=n.map(g=>g.clone());const c=(l=(o=i.variables.find(({name:g})=>g===n[0].variableName))==null?void 0:o.dimensions)==null?void 0:l.find(({name:g})=>g==="StdTime"),h=n.find(({dimensionName:g})=>g==="StdTime");if(!c||!h)return{...t,multidimensionalDefinition:null};const{start:u,end:m}=a,d=u==null?null:u.getTime(),p=m==null?null:m.getTime(),y=d??p,f=p??d;if(c.values!=null){const g=c.values.filter(x=>{if(Array.isArray(x)){if(y===f)return x[0]<=y&&x[1]>=y;const w=x[0]<=y&&x[1]>y||x[0]=f,b=x[0]>=y&&x[1]<=f||x[0]f;return w||b}return y===f?x===y:x>=y&&x<=f});if(g.length){const x=g.sort((w,b)=>{const T=Array.isArray(w)?w[0]:w,R=Array.isArray(w)?w[1]:w,k=Array.isArray(b)?b[0]:b,_=Array.isArray(b)?b[1]:b;return y===f?T-k:Math.abs(R-f)-Math.abs(_-f)})[0];h.values=[x]}else n=null}else if(c.hasRegularIntervals&&c.extent){const[g,x]=c.extent;y>x||f1&&t.forEach(f=>d[f.url]=f);const p=De(((u=a.functionDefinition)==null?void 0:u.toJSON())??a.toJSON(),d),y=new Be({rasterFunction:p});y.rasterJobHandler=this._rasterJobHandler.instance,await y.open(),this._cachedRasterFunctionJson=(m=this.rasterFunction)==null?void 0:m.toJSON(),this.raster=y}else this.raster=i,this._cachedRasterFunctionJson=null,await i.when();if(this._cachedRendererJson=null,!n&&!a)return;const{bandIds:o}=this,{bandCount:l}=this.raster.rasterInfo,c=o!=null&&o.length?o.some(d=>d>=l):l>=3;o&&(c||this.renderer&&this.renderer.type!=="raster-stretch")&&this._set("bandIds",null),this._configDefaultRenderer("auto")}async updateRenderer(){const{loaded:t,symbolizer:i}=this;if(!t||!i||!this.renderer)return;const{rasterInfo:n}=this.raster,a=je(n,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),o=a==null?void 0:a.name,l=Ge({...this.renderer.toJSON(),variableName:o});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(l))return;const c=this._rasterJobHandler.instance;c&&(i.rasterInfo=Ue(n,o),i.rendererJSON=l,i.bind(),await c.updateSymbolizer(i),this._cachedRendererJson=l)}async applyRenderer(t,i){const n=t&&t.pixelBlock;if(!(n!=null&&n.pixels&&n.pixels.length>0))return null;let a;await this.updateRenderer();const o=this._rasterJobHandler.instance,l=this.bandIds??[];return a=o?await o.symbolize({...t,simpleStretchParams:i,bandIds:l}):this.symbolizer.symbolize({...t,simpleStretchParams:i,bandIds:l}),a}getTileUrl(t,i,n){return this.raster.datasetFormat==="RasterTileServer"?`${this.url}/tile/${t}/${i}/${n}`:""}getCompatibleTileInfo(t,i,n=!1){if(!this.loaded||i==null)return null;if(n&&t.equals(this.spatialReference))return this.tileInfo;const a=bt(t);return Z.create({size:256,spatialReference:t,origin:a?{x:a.origin[0],y:a.origin[1]}:{x:i.xmin,y:i.ymax}})}getCompatibleFullExtent(t){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(t)||(this._compatibleFullExtent=this.raster.computeExtent(t)),this._compatibleFullExtent):null}async fetchTile(t,i,n,a={}){var l;if(r(this),a.requestAsImageElement){const c=this.getTileUrl(t,i,n);return at(c,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:a.signal}).then(h=>h.data)}const{rasterInfo:o}=this;if(o.multidimensionalInfo!=null&&(a=this.normalizeRasterFetchOptions(a)).multidimensionalDefinition==null){const c=a.tileInfo||o.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(t,i,n,c),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),((l=this.renderer)==null?void 0:l.type)==="raster-shaded-relief"&&(a={...a,buffer:{cols:1,rows:1}}),this.raster.fetchTile(t,i,n,a)}async fetchPixels(t,i,n,a={}){return this.rasterInfo.multidimensionalInfo!=null&&(a=this.normalizeRasterFetchOptions(a)).multidimensionalDefinition==null?{extent:t,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),i=Math.round(i),n=Math.round(n),this.raster.fetchPixels(t,i,n,a))}async identify(t,i={}){var l;const{raster:n,rasterInfo:a}=this;if(a.multidimensionalInfo!=null&&!(a.hasMultidimensionalTranspose&&(ct(i.multidimensionalDefinition)||i.transposedVariableName||i.timeExtent))&&(i=this.normalizeRasterFetchOptions(i)).multidimensionalDefinition==null)return{location:t,value:null};const o=(l=this.multidimensionalSubset)==null?void 0:l.areaOfInterest;if(o&&!o.contains(t))throw new $("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return n.identify(t,i)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){var a,o,l;const t=(a=this.rasterInfo)==null?void 0:a.multidimensionalInfo;if(t==null||((o=this.rasterInfo)==null?void 0:o.dataType)!=="standard-time")return!1;const i=this.multidimensionalDefinition,n=(l=i==null?void 0:i[0])==null?void 0:l.variableName;return t.variables.some(c=>c.name===n&&(!(i!=null&&i[0].dimensionName)||c.dimensions.some(h=>h.name==="StdTime")))}getStandardTimeValue(t){return new Date(24*(t-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(t){var n;const i=t??((n=this.rasterInfo)==null?void 0:n.multidimensionalInfo);return Ut(this.multidimensionalSubset,i)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=qe(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&this.raster.datasetFormat==="Function"&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const t=new Yt;return this._rasterJobHandler.connectionPromise=t.initialize().then(async()=>{r(this),this._rasterJobHandler.instance=t,this.raster.rasterJobHandler=t,this.raster.datasetFormat==="Function"&&this.raster.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{}),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){var t;if(this.interpolation==null){r(this);const{raster:i}=this,n=Vt(i.rasterInfo,i.tileType,(t=this.sourceJSON)==null?void 0:t.defaultResamplingMethod);this._set("interpolation",n)}}_configDefaultRenderer(t="no"){var h,u;r(this);const{rasterInfo:i}=this.raster;!this.bandIds&&i.bandCount>1&&(this.bandIds=Xt(i));const n=je(i,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),a=n==null?void 0:n.name;if(!this.renderer||t==="override"){const m=Ve(i,{bandIds:this.bandIds,variableName:a}),d=i.statistics,p=d&&d.length>0?d[0]:null,y=(p==null?void 0:p.max)??0,f=(p==null?void 0:p.min)??0;this.raster.datasetFormat==="WCSServer"&&m.type==="raster-stretch"&&(y>1e24||f<-1e24)&&(m.dynamicRangeAdjustment=!0,m.statistics=null,m.stretchType==="none"&&(m.stretchType="min-max")),this.renderer=m}const o=Ge({...this.renderer.toJSON(),variableName:a}),l=Ue(i,a);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=l):this.symbolizer=new li({rendererJSON:o,rasterInfo:l});const c=this.symbolizer.bind();if(c.success){if(t==="auto"){const{colormap:m}=this.raster.rasterInfo,d=this.renderer;if(m!=null&&d.type==="raster-colormap"){const p=Ve(this.raster.rasterInfo);JSON.stringify(p)!==JSON.stringify(d)&&this._configDefaultRenderer("override")}else if(d.type==="raster-stretch"){const p=(h=this.bandIds)==null?void 0:h.length,y=(u=d.statistics)==null?void 0:u.length;!d.dynamicRangeAdjustment&&y&&p&&y!==p&&this._configDefaultRenderer("override")}}}else it.warn("imagery-tile-mixin",c.error||"The given renderer is not supported by the layer."),t==="auto"&&this._configDefaultRenderer("override")}};function r(t){if(!t.raster||!t.rasterInfo)throw new $("imagery-tile","no raster")}return I([v()],e.prototype,"_cachedRendererJson",void 0),I([v()],e.prototype,"_cachedRasterFunctionJson",void 0),I([v()],e.prototype,"_compatibleFullExtent",void 0),I([v()],e.prototype,"_isConstructedFromFunctionRaster",void 0),I([v()],e.prototype,"_rasterJobHandler",void 0),I([v()],e.prototype,"bandIds",void 0),I([v({json:{origins:{service:{read:{source:"copyrightText"}}}}})],e.prototype,"copyright",void 0),I([v({json:{read:!1}})],e.prototype,"fullExtent",null),I([v()],e.prototype,"interpolation",void 0),I([v()],e.prototype,"ioConfig",void 0),I([v({type:[ut],json:{write:!0}})],e.prototype,"multidimensionalDefinition",null),I([v({type:Ht,json:{write:!0}})],e.prototype,"multidimensionalSubset",void 0),I([v()],e.prototype,"raster",void 0),I([v({type:$e,json:{name:"renderingRule",write:!0}})],e.prototype,"rasterFunction",null),I([v()],e.prototype,"rasterInfo",void 0),I([v()],e.prototype,"sourceJSON",void 0),I([v({readOnly:!0,type:q,json:{read:!1}})],e.prototype,"spatialReference",void 0),I([v({type:Z})],e.prototype,"tileInfo",void 0),I([v(ht)],e.prototype,"url",null),I([v({types:Lt,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){var i;const t=((i=this.renderer)==null?void 0:i.type)==="raster-stretch"&&this.renderer.stretchType==="none"&&!this.renderer.useGamma;return{enabled:!this.loaded||this.raster.tileType==="Raster"||!t}}},origins:{"web-scene":{types:Wt,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:t=>({enabled:t&&t.type!=="vector-field"&&t.type!=="flow"})}}}}})],e.prototype,"renderer",null),I([It("renderer")],e.prototype,"readRenderer",null),I([v()],e.prototype,"symbolizer",void 0),e=I([Q("esri.layers.ImageryTileMixin")],e),e};function Gi(s){const e=s.fields,r=s.records,t=e.some(c=>c.name.toLowerCase()==="oid")?"OBJECTID":"OID",i=[{name:t,type:"esriFieldTypeOID",alias:"OID"}].concat(e.map(c=>({name:c.name,type:"esriFieldType"+c.typeName,alias:c.name}))),n=i.map(c=>c.name),a=[];let o=0,l=0;return r.forEach(c=>{const h={};for(h[t]=o++,l=1;l0)for(;h.lengtha;){const m=[];r.getUint8(l)===32?(l+=1,c.forEach(d=>{if(d.type==="C")m.push(Xe(new Uint8Array(e,l,d.length)).trim());else if(d.type==="N")m.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,l,d.length)).trim(),10));else if(d.type==="F")m.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,l,d.length)).trim()));else if(d.type==="D"){const p=String.fromCharCode.apply(null,new Uint8Array(e,l,d.length)).trim();m.push(new Date(parseInt(p.substring(0,4),10),parseInt(p.substring(4,6),10)-1,parseInt(p.substring(6,8),10)))}l+=d.length}),h.push(m)):l+=a}}return{header:o,fields:c,records:h,recordSet:Gi({fields:c,records:h})}}}const re=new Map;re.set("int16","esriFieldTypeSmallInteger"),re.set("int32","esriFieldTypeInteger"),re.set("int64","esriFieldTypeInteger"),re.set("float32","esriFieldTypeSingle"),re.set("float64","esriFieldTypeDouble"),re.set("text","esriFieldTypeString");const st=8;let de=class extends oe{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:r}=await this.request(this.url+"/conf.json",{signal:e==null?void 0:e.signal});if(!this._validateHeader(r))throw new $("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:t,rasterInfo:i}=this._parseHeader(r);if(i.dataType==="thematic"){const n=await this._fetchAuxiliaryInformation();i.attributeTable=n}this._set("storageInfo",t),this._set("rasterInfo",i),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,r,t,i={}){const{transposeInfo:n}=this.rasterInfo.storageInfo,{transposedVariableName:a}=i,o=!(!n||!a),l=o?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(l<0)return null;const c=this._buildCacheFilePath(l,r,t,i.multidimensionalDefinition,a),h=this._getIndexRecordFromBundle(r,t,o),u=await this.request(c,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:i.signal});if(!u)return null;const m=new Uint8Array(u.data),d=this._getTileEndAndContentType(m,h);if(d.recordSize===0)return null;const p=await this.request(c,{range:{from:d.position,to:d.position+d.recordSize},responseType:"array-buffer",signal:i.signal});if(!p)return null;const[y,f]=this._getTileSize(o);return this.decodePixelBlock(p.data,{width:y,height:f,planes:null,pixelType:null,returnInterleaved:o})}_validateHeader(e){const r=["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"];return e&&e.type==="RasterInfo"&&!r.some(t=>!e[t])}_parseHeader(e){var E;const r=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:t,histograms:i,colormap:n,blockWidth:a,blockHeight:o,firstPyramidLevel:l,maximumPyramidLevel:c}=e,h=e.statistics&&e.statistics.map(B=>({min:B.min,max:B.max,avg:B.mean,stddev:B.standardDeviation,median:B.median,mode:B.mode})),u=e.extent.spatialReference,m=(E=e.geodataXform)==null?void 0:E.spatialReference,d=new q(u!=null&&u.wkid||u!=null&&u.wkt?u:m);let p=new H({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:d});const y=new A({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:d}),f=Math.round((p.xmax-p.xmin)/y.x),g=Math.round((p.ymax-p.ymin)/y.y),x=this._parseTransform(e.geodataXform),w=x?p:null;x&&(p=x.forwardTransform(p),y.x=(p.xmax-p.xmin)/f,y.y=(p.ymax-p.ymin)/g);const b=e.properties??{},T=e.format.toLowerCase().replace("cache/",""),R=new A(e.origin.x,e.origin.y,d);let k,_,F,S;if(n&&n.colors)for(k=[],_=0;_>>24,F<<8>>>24,F>>>24]);const M=e.LODInfos,C=[];for(_=0;_0)for(_=0;_a.data).catch(()=>null),t=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then(a=>a.data).catch(()=>null),i=await Promise.all([r,t]);let n;if(i[0]){let a=i[0].fields;const o=i[0].values;if(a&&o){a=a.map(c=>({type:c.name==="OID"?"esriFieldTypeOID":re.get(c.type),name:c.name,alias:c.alias||c.name}));const l=o.map(c=>({attributes:c}));a&&o&&(n={fields:a,features:l})}}return!n&&i[1]&&(n=dt.parse(i[1]).recordSet),Ee.fromJSON(n)}_buildCacheFilePath(e,r,t,i,n){const a=this._getPackageSize(!!n),o=Math.floor(r/a)*a,l=Math.floor(t/a)*a,c="R"+this._toHexString4(o)+"C"+this._toHexString4(l);let h="L";h+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:u}=this.rasterInfo,m=i==null?void 0:i[0];if(u==null||!m)return`${this.url}/_alllayers/${h}/${c}.bundle`;let d="_yxs";if(!n){d=u.variables.find(f=>f.name===m.variableName).dimensions[0].values.indexOf(m.values[0]).toString(16);const y=4-d.length;for(let f=0;f0;)r="0"+r}return r}};I([v({readOnly:!0})],de.prototype,"storageInfo",void 0),I([v({type:String,json:{write:!0}})],de.prototype,"datasetFormat",void 0),de=I([Q("esri.layers.support.rasterDatasets.CloudRaster")],de);const Ui=de;let me=class extends oe{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.data=null}async open(e){await this.init();const r=this.data,{pixelBlock:t,statistics:i,histograms:n,name:a,keyProperties:o,nativeExtent:l,transform:c}=this.data,{width:h,height:u,pixelType:m}=t,d=r.extent??new H({xmin:-.5,ymin:.5,xmax:h-.5,ymax:u-.5,spatialReference:new q({wkid:3857})}),p=r.isPseudoSpatialReference??!r.extent,y={x:d.width/h,y:d.height/u},f=new ge({width:h,height:u,pixelType:m,extent:d,nativeExtent:l,transform:c,pixelSize:y,spatialReference:d.spatialReference,bandCount:t.pixels.length,keyProperties:o||{},statistics:i,isPseudoSpatialReference:p,histograms:n});this.createRemoteDatasetStorageInfo(f,512,512),this._set("rasterInfo",f),this.updateTileInfo(),await this._buildInMemoryRaster(t,{width:512,height:512},e),this.datasetName=a,this.url="/InMemory/"+a}fetchRawTile(e,r,t,i={}){const n=this._pixelBlockTiles.get(`${e}/${r}/${t}`);return Promise.resolve(n)}async _buildInMemoryRaster(e,r,t){var h,u;const i=this.rasterInfo.storageInfo.maximumPyramidLevel,n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:r,maximumPyramidLevel:i},t):Promise.resolve(ci(e,r,i)),a=this.rasterInfo.statistics!=null,o=this.rasterInfo.histograms!=null,l=a?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},t):Promise.resolve(ui(e)),c=await lt([n,l]);if(!c[0].value&&c[1].value)throw new $("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=c[0].value,a||(this.rasterInfo.statistics=(h=c[1].value)==null?void 0:h.statistics),o||(this.rasterInfo.histograms=(u=c[1].value)==null?void 0:u.histograms)}};I([v({type:String,json:{write:!0}})],me.prototype,"datasetFormat",void 0),I([v()],me.prototype,"data",void 0),me=I([Q("esri.layers.support.rasterDatasets.InMemoryRaster")],me);const Vi=me;function he(s,e){if(!s||!e)return[];let r=e;e.includes("/")?(r=e.slice(0,e.indexOf("/")),e=e.slice(e.indexOf("/")+1)):e="";const t=[];if(e){const n=he(s,r);for(let a=0;at.push(o));return t}const i=s.getElementsByTagNameNS("*",r);if(!i||i.length===0)return[];for(let n=0;n0?e?U(t[0],e):t[0]:null}function K(s,e=null){const r=e?U(s,e):s;let t;return r?(t=r.textContent||r.nodeValue,t?t.trim():null):null}function Xi(s,e){const r=he(s,e),t=[];let i;for(let n=0;nNumber(r))}function ae(s,e){const r=K(s,e);return Number(r)}function Fe(s,e){var i;const r=(i=s==null?void 0:s.nodeName)==null?void 0:i.toLowerCase(),t=e.toLowerCase();return r.slice(r.lastIndexOf(":")+1)===t}function rt(s,e){if(!s||!e)return null;const r=[];for(let t=0;tNumber(d));let o,l,c,h;he(s,"Metadata/MDI").forEach(d=>{const p=Number(d.textContent??d.nodeValue);switch(d.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=p;break;case"STATISTICS_MAXIMUM":l=p;break;case"STATISTICS_MEAN":c=p;break;case"STATISTICS_STDDEV":h=p}});const u=ae(s,"Metadata/SourceBandIndex");return{noDataValue:e,histogram:a!=null&&a.length&&t!=null&&i!=null?{min:t,max:i,size:n||a.length,counts:a}:null,sourceBandIndex:u,statistics:o!=null&&l!=null?{min:o,max:l,avg:c,stddev:h}:null}}function Te(s){if(!s)return null;let e=Number(s);if(!isNaN(e)&&e!==0)return new q({wkid:e});if((s=String(s)).startsWith("COMPD_CS")){if(!s.includes("VERTCS")||!s.includes("GEOGCS")&&!s.startsWith("PROJCS"))return null;const r=s.indexOf("VERTCS"),t=s.indexOf("PROJCS"),i=t>-1?t:s.indexOf("GEOGCS");if(i===-1)return null;const n=s.slice(i,s.lastIndexOf("]",r)+1).trim(),a=s.slice(r,s.lastIndexOf("]")).trim();e=Me(n);const o=new q(e?{wkid:e}:{wkt:n}),l=Me(a);return l&&(o.vcsWkid=l),o}return s.startsWith("GEOGCS")||s.startsWith("PROJCS")?(e=Me(s),new q(e!==0?{wkid:e}:{wkt:s})):null}function Me(s){var i;const e=s.replaceAll("]","[").replaceAll('"',"").split("[").map(n=>n.trim()).filter(n=>n!==""),r=e[e.length-1].split(","),t=(i=r[0])==null?void 0:i.toLowerCase();if((t==="epsg"||t==="esri")&&s.endsWith('"]]')){const n=Number(r[1]);if(!isNaN(n)&&n!==0)return n}return 0}function He(s){var t;if(((t=s==null?void 0:s.documentElement.tagName)==null?void 0:t.toLowerCase())!=="pamdataset")return{};const e={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};s.documentElement.childNodes.forEach(i=>{if(i.nodeType===1){if(Fe(i,"SRS")){if(!e.spatialReference){const n=K(i);e.spatialReference=Te(n)}}else if(Fe(i,"Metadata"))if(i.getAttribute("domain")==="xml:ESRI"){const{spatialReference:n,transform:a}=Yi(i);e.transform=a,e.spatialReference||(e.spatialReference=n)}else he(i,"MDI").forEach(n=>e.metadata[n.getAttribute("key")]=K(n));else if(Fe(i,"PAMRasterBand")){const n=Ki(i);n.sourceBandIndex!=null&&e.rasterBands[n.sourceBandIndex]==null?e.rasterBands[n.sourceBandIndex]=n:e.rasterBands.push(n)}}});const r=e.rasterBands;if(r.length){const i=!!r[0].statistics;e.statistics=i?r.map(a=>a.statistics).filter(Pe):null;const n=!!r[0].histogram;e.histograms=n?r.map(a=>a.histogram).filter(Pe):null}return e}let Re=class extends oe{async open(s){await this.init();const e=await this._fetchData(s);let{spatialReference:r,statistics:t,histograms:i,transform:n}=await this._fetchAuxiliaryData(s);const a=!r;a&&(r=new q({wkid:3857})),i!=null&&i.length&&t==null&&(t=Je(i));const{width:o,height:l}=e;let c=new H({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:r});const h=n?n.forwardTransform(c):c;let u=!0;if(n){const d=n.forwardCoefficients;u=d&&d[1]===0&&d[2]===0,u&&(n=null,c=h)}const m=new Vi({data:{extent:h,nativeExtent:c,transform:n,pixelBlock:e,statistics:t,histograms:i,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a}});await m.open(),m.data=null,this._set("rasterInfo",m.rasterInfo),this._inMemoryRaster=m}fetchRawTile(s,e,r,t={}){return this._inMemoryRaster.fetchRawTile(s,e,r,t)}async _fetchData(s){const{data:e}=await this.request(this.url,{responseType:"array-buffer",signal:s==null?void 0:s.signal}),r=hi(e).toUpperCase();if(r!=="JPG"&&r!=="PNG"&&r!=="GIF"&&r!=="BMP")throw new $("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",r);const t=r.toLowerCase(),i=t==="gif"||t==="bmp"||!St("ios"),n=await this.decodePixelBlock(e,{format:t,useCanvas:i,hasNoZlibMask:!0});if(n==null)throw new $("image-aux-raster:open","the data cannot be decoded");return n}async _fetchAuxiliaryData(s){var c;const e=s==null?void 0:s.signal,r=this.ioConfig.skipExtensions??[],t=r.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:e}),i=this.datasetFormat,n=i==="JPG"?"jgw":i==="PNG"?"pgw":i==="BMP"?"bpw":null,a=n&&r.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:e}),o=await lt([t,a]);if(e!=null&&e.aborted)throw Rt();const l=He((c=o[0].value)==null?void 0:c.data);if(!l.transform){const h=o[1].value?o[1].value.data.split(` +`).slice(0,6).map(u=>Number(u)):null;l.transform=(h==null?void 0:h.length)===6?new Ae({forwardCoefficients:[h[4],h[5],h[0],-h[1],h[2],-h[3]]}):null}return l}};I([v({type:String,json:{write:!0}})],Re.prototype,"datasetFormat",void 0),Re=I([Q("esri.layers.support.rasterDatasets.ImageAuxRaster")],Re);const be=Re;let pe=class extends oe{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async open(e){var _,F;await this.init();const r=e&&e.signal,t=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:r});t.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const i=t.data;if(this.sourceJSON=i,!i)throw new $("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!i.tileInfo)throw new $("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();const n=["jpg","jpeg","png","png8","png24","png32","mixed"];this.tileType=i.cacheType,this.tileType==null&&(n.includes(i.tileInfo.format.toLowerCase())?this.tileType="Map":i.tileInfo.format.toLowerCase()==="lerc"?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=((_=i.name)==null?void 0:_.slice(i.name.indexOf("/")+1))??"";const a=await this._fetchRasterInfo({signal:r});if(a==null)throw new $("image-server-raster:open","cannot initialize image service");const o=this.tileType==="Map"?Qi(i.tileInfo,i):Z.fromJSON(i.tileInfo);vt(o);const[l,c]=this._computeMinMaxLOD(a,o),{extent:h,pixelSize:u}=a,m=.5/a.width*u.x,d=Math.max(u.x,u.y),{lods:p}=o;(this.tileType!=="Map"&&i.maxScale!==0||Math.abs(u.x-u.y)>m||!p.some(S=>Math.abs(S.resolution-d){S.level>=c.level&&S.level<=l.level&&x.push({x:S.resolution,y:S.resolution}),MS.x-M.x);const b=this.computeBlockBoundary(h,f,g,o.origin,x,y),T=x.length>1?x.slice(1):null;let R;i.transposeInfo&&(R={tileSize:[i.transposeInfo.rows,i.transposeInfo.cols],packetSize:((F=a.keyProperties)==null?void 0:F._yxs.PacketSize)??0});const k=w.length<=1||w.length>=3&&w.slice(0,w.length-1).every(S=>S===w[0])?w[0]??2:Math.round(10/(c.resolution/l.resolution)**(-1/y))/10;if(a.storageInfo=new ye({blockWidth:o.size[0],blockHeight:o.size[1],pyramidBlockWidth:o.size[0],pyramidBlockHeight:o.size[1],pyramidResolutions:T,pyramidScalingFactor:k,compression:o.format,origin:o.origin,firstPyramidLevel:1,maximumPyramidLevel:y,tileInfo:o,transposeInfo:R,blockBoundary:b}),this._fixGCSShift(a),this._set("rasterInfo",a),i.capabilities.toLowerCase().includes("tilemap")){const S={tileInfo:a.storageInfo.tileInfo,parsedUrl:Tt(this.url),url:this.url,tileServers:[]};this._tilemapCache=new Oi({layer:S})}}async fetchRawTile(e,r,t,i={}){const{storageInfo:n,extent:a}=this.rasterInfo,{transposeInfo:o}=n,l=o!=null&&!!i.transposedVariableName;if(this._slices&&!l&&i.sliceId==null)return null;const c=l?0:n.maximumPyramidLevel-e+this._levelOffset,h=`${this.url}/tile/${c}/${r}/${t}`,u=this._slices?l?{variable:i.transposedVariableName}:{sliceId:i.sliceId||0}:null,{data:m}=await this.request(h,{query:u,responseType:"array-buffer",signal:i.signal});if(!m)return null;const d=l?o.tileSize:n.tileInfo.size,p=await this.decodePixelBlock(m,{width:d[0],height:d[1],planes:null,pixelType:null,isPoint:this.tileType==="Elevation",returnInterleaved:l,noDataValue:this.rasterInfo.noDataValue});if(p==null)return null;const y=n.blockBoundary[e];if(n.compression!=="jpg"||t>y.minCol&&ty.minRow&&r{const a=r.find(o=>n.variableName===o.variableName&&o.dimensionName===n.dimensionName);return a?(Array.isArray(n.values[0])?`${n.values[0][0]}-${n.values[0][1]}`:n.values[0])!==(Array.isArray(a.values[0])?`${a.values[0][0]}-${a.values[0][1]}`:a.values[0]):!0}))return t}return null}async fetchVariableStatisticsHistograms(e,r){const t=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:r}).then(a=>{var o;return(o=a.data)==null?void 0:o.statistics}),i=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:r}).then(a=>{var o;return(o=a.data)==null?void 0:o.histograms}),n=await Promise.all([t,i]);return n[0]&&n[0].forEach(a=>{a.avg=a.mean,a.stddev=a.standardDeviation}),{statistics:n[0]||null,histograms:n[1]||null}}async computeBestPyramidLevelForLocation(e,r={}){if(!this._tilemapCache)return 0;let t=this.identifyPixelLocation(e,0,r.datumTransformation);if(t===null)return null;let i=0;const{maximumPyramidLevel:n}=this.rasterInfo.storageInfo;let a=n-i+this._levelOffset;const o=t.srcLocation;for(;a>=0;){try{if(await this._tilemapCache.fetchAvailability(a,t.row,t.col,r)==="available")break}catch{}if(a--,i++,t=this.identifyPixelLocation(o,i,r.datumTransformation),t===null)return null}return a===-1||t==null?null:i}async _fetchRasterInfo(e){const r=this.sourceJSON;if(this.tileType==="Map"){const o=r.fullExtent||r.extent,l=Math.ceil((o.xmax-o.xmin)/r.pixelSizeX-.1),c=Math.ceil((o.ymax-o.ymin)/r.pixelSizeY-.1),h=q.fromJSON(r.spatialReference||o.spatialReference),u=new A({x:r.pixelSizeX,y:r.pixelSizeY,spatialReference:h});return new ge({width:l,height:c,bandCount:3,extent:H.fromJSON(o),spatialReference:h,pixelSize:u,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:t}=e,i=Kt(this.url,this.sourceJSON,{signal:t,query:this.ioConfig.customFetchParameters}),n=r.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:t}).then(o=>o.data&&o.data.slices).catch(()=>null):null,a=await Promise.all([i,n]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:r,spatialReference:t}=e;r.xmin>-1&&r.xmax>181&&(t!=null&&t.wkid)&&t.isGeographic&&(e.nativeExtent=e.extent,e.transform=new Fi,e.extent=e.transform.forwardTransform(r))}_computeMinMaxLOD(e,r){const{pixelSize:t}=e,i=.5/e.width*t.x,{lods:n}=r,a=r.lodAt(Math.max.apply(null,n.map(d=>d.level))),o=r.lodAt(Math.min.apply(null,n.map(d=>d.level))),{tileType:l}=this;if(l==="Map")return this._levelOffset=n[0].level,[a,o];if(l==="Raster")return[n.find(d=>d.resolution===t.x)??a,o];const{minScale:c,maxScale:h}=this.sourceJSON;let u=a;h>0&&(u=n.find(d=>Math.abs(d.scale-h)d.scale>h).sort((d,p)=>d.scale>p.scale?1:-1)[0]??a));let m=o;return c>0&&(m=n.find(d=>Math.abs(d.scale-c)a!=null&&a>=i&&a<=n)});if(r!==0&&t!==0){const a=c=>Math.round(1e4*c)/1e4,o=r?a(r):1/0,l=t?a(t):-1/0;return Z.fromJSON({...s,lods:s.lods.filter(c=>{const h=a(c.scale);return h<=o&&h>=l})})}return Z.fromJSON(s)}I([v({type:String,json:{write:!0}})],pe.prototype,"datasetFormat",void 0),I([v()],pe.prototype,"tileType",void 0),pe=I([Q("esri.layers.support.rasterDatasets.ImageServerRaster")],pe);const Zi=pe,Y=new Map;Y.set("Int8","s8"),Y.set("UInt8","u8"),Y.set("Int16","s16"),Y.set("UInt16","u16"),Y.set("Int32","s32"),Y.set("UInt32","u32"),Y.set("Float32","f32"),Y.set("Float64","f32"),Y.set("Double64","f32");const te=new Map;te.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),te.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),te.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),te.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let ce=class extends oe{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(s){var y;await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const e=s?s.signal:null,r=await this.request(this.url,{responseType:"xml",signal:e}),{rasterInfo:t,files:i}=this._parseHeader(r.data);if(((y=this.ioConfig.skipExtensions)==null?void 0:y.indexOf("aux.xml"))===-1){const f=await this._fetchAuxiliaryData(s);f!=null&&(t.statistics=f.statistics??t.statistics,t.histograms=f.histograms,f.histograms&&t.statistics==null&&(t.statistics=Je(f.histograms)))}this._set("rasterInfo",t),this._files=i;const n=await this.request(i.index,{responseType:"array-buffer",signal:e});this._storageIndex=this._parseIndex(n.data);const{blockWidth:a,blockHeight:o}=this.rasterInfo.storageInfo,l=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:c,height:h}=this.rasterInfo,u=[],m=this._getBandSegmentCount();let d=0,p=-1;for(;d0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=p),this.updateTileInfo()}async fetchRawTile(s,e,r,t={}){const{blockWidth:i,blockHeight:n,blockBoundary:a}=this.rasterInfo.storageInfo,o=a[s];if(!o||o.maxRowe||o.minCol>r)return null;const{bandCount:l,pixelType:c}=this.rasterInfo,{ranges:h,actualTileWidth:u,actualTileHeight:m}=this._getTileLocation(s,e,r);if(!h||h.length===0)return null;if(h[0].from===0&&h[0].to===0){const S=new Uint8Array(i*n);return new ee({width:i,height:n,pixels:null,mask:S,validPixelCount:0})}const{bandIds:d}=this.ioConfig,p=this._getBandSegmentCount(),y=[];let f=0;for(f=0;fS.data.byteLength).reduce((S,M)=>S+M),w=new Uint8Array(x);let b=0;for(f=0;f1e24)for(f=0;f1e-6&&(M[f]=1);else for(f=0;f0)throw new Error("invalid array buffer must be multiples of 16");let e,r,t,i,n,a;if(di){for(r=new Uint8Array(s),i=new ArrayBuffer(s.byteLength),t=new Uint8Array(i),n=0;nparseFloat(M)))),U(s,"MRF_META/CachedSource"))throw new $("mrf:open","currently does not support MRF referencing other data files");const y=U(s,"MRF_META/GeoTags"),f=U(y,"BoundingBox");let g,x=!1;if(f!=null){const M=parseFloat(f.getAttribute("minx")),C=parseFloat(f.getAttribute("miny")),J=parseFloat(f.getAttribute("maxx")),O=parseFloat(f.getAttribute("maxy")),P=K(y,"Projection")||"";let D=q.WGS84;if(P!=="LOCAL_CS[]")if(P.toLowerCase().startsWith("epsg:")){const z=Number(P.slice(5));isNaN(z)||z===0||(D=new q({wkid:z}))}else D=Te(P)??q.WGS84;else x=!0,D=new q({wkid:3857});g=new H(M,C,J,O),g.spatialReference=D}else x=!0,g=new H({xmin:-.5,ymin:.5-i,xmax:t-.5,ymax:.5,spatialReference:new q({wkid:3857})});const w=U(s,"MRF_META/Rsets"),b=parseInt(w&&w.getAttribute("scale")||"2",10),T=g.spatialReference,R=new ye({origin:new A({x:g.xmin,y:g.ymax,spatialReference:T}),blockWidth:h,blockHeight:u,pyramidBlockWidth:h,pyramidBlockHeight:u,compression:a,pyramidScalingFactor:b}),k=new A({x:g.width/t,y:g.height/i,spatialReference:T}),_=new ge({width:t,height:i,extent:g,isPseudoSpatialReference:x,spatialReference:T,bandCount:n,pixelType:l,pixelSize:k,noDataValue:d,storageInfo:R}),F=K(s,"datafile"),S=K(s,"IndexFile");return{rasterInfo:_,files:{mrf:this.url,index:S||this.url.replace(".mrf",".idx"),data:F||this.url.replace(".mrf",te.get(a).blobExtension)}}}async _fetchAuxiliaryData(s){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:s==null?void 0:s.signal});return He(e)}catch{return null}}};I([v()],ce.prototype,"_files",void 0),I([v()],ce.prototype,"_storageIndex",void 0),I([v({type:String,json:{write:!0}})],ce.prototype,"datasetFormat",void 0),ce=I([Q("esri.layers.support.rasterIO.MRFRaster")],ce);const es=ce,Ce=(s,e)=>{var r;return(r=s.get(e))==null?void 0:r.values},fe=(s,e)=>{var r,t;return(t=(r=s.get(e))==null?void 0:r.values)==null?void 0:t[0]};let ne=class extends oe{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(s){var p,y,f,g;await this.init();const e=s?s.signal:null,{data:r}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:e});if(!r)throw new $("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:t,firstIFDPos:i,isBigTiff:n}=mi(r),a=[];await this._readIFDs(a,r,t,i,0,n?8:4,e);const{imageInfo:o,rasterInfo:l}=this._parseIFDs(a),c=pi(a),h=yi(a);if(this._headerInfo={littleEndian:t,isBigTiff:n,ifds:a,pyramidIFDs:c,maskIFDs:h,...o},this._set("rasterInfo",l),!o.isSupported)throw new $("tiffraster:open","this tiff is not supported: "+o.message);if(!o.tileWidth)throw new $("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");const u=(y=(p=a[0].get("PREDICTOR"))==null?void 0:p.values)==null?void 0:y[0];if(((g=(f=a[0].get("SAMPLEFORMAT"))==null?void 0:f.values)==null?void 0:g[0])===3&&u===2)throw new $("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floatting point data");const{skipExtensions:d=[]}=this.ioConfig;if(!d.includes("aux.xml")){const x=await this._fetchAuxiliaryMetaData(s);x!=null&&this._processPAMInfo(x,l)}d.includes("vat.dbf")||l.bandCount!==1||l.pixelType!=="u8"||(l.attributeTable=await this._fetchAuxiliaryTable(s),l.attributeTable!=null&&(l.keyProperties.DataType="thematic")),this.updateTileInfo()}async fetchRawTile(s,e,r,t={}){var n;if(!((n=this._headerInfo)!=null&&n.isSupported)||this.isBlockOutside(s,e,r))return null;const i=await this._fetchRawTiffTile(s,e,r,!1,t);if(i!=null&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(s,e,r,!0,t);a!=null&&a.pixels[0]instanceof Uint8Array&&(i.mask=a.pixels[0])}return i}_parseIFDs(s){var C,J;const e=gi(s),{width:r,height:t,tileWidth:i,tileHeight:n,planes:a,pixelType:o,compression:l,firstPyramidLevel:c,maximumPyramidLevel:h,pyramidBlockWidth:u,pyramidBlockHeight:m,tileBoundary:d,affine:p,metadata:y}=e,f=((C=e.extent.spatialReference)==null?void 0:C.wkt)||((J=e.extent.spatialReference)==null?void 0:J.wkid);let g=Te(f),x=!!e.isPseudoGeographic;g==null&&(x=!0,g=new q({wkid:3857}));const w=new H({...e.extent,spatialReference:g}),b=new A(w?{x:w.xmin,y:w.ymax,spatialReference:g}:{x:0,y:0}),T=new ye({blockWidth:i,blockHeight:n,pyramidBlockWidth:u,pyramidBlockHeight:m,compression:l,origin:b,firstPyramidLevel:c,maximumPyramidLevel:h,blockBoundary:d}),R=new A({x:(w.xmax-w.xmin)/r,y:(w.ymax-w.ymin)/t,spatialReference:g}),k=y?{BandProperties:y.bandProperties,DataType:y.dataType}:{};let _=null;const F=fe(s[0],"PHOTOMETRICINTERPRETATION"),S=Ce(s[0],"COLORMAP");if(F<=3&&(S==null?void 0:S.length)>3&&S.length%3==0){_=[];const O=S.length/3;for(let P=0;P>>8,S[P+O]>>>8,S[P+2*O]>>>8])}const M=new ge({width:r,height:t,bandCount:a,pixelType:o,pixelSize:R,storageInfo:T,spatialReference:g,isPseudoSpatialReference:x,keyProperties:k,extent:w,colormap:_,statistics:y?y.statistics:null});return p!=null&&p.length&&(M.nativeExtent=new H({xmin:-.5,ymin:.5-t,xmax:r-.5,ymax:.5,spatialReference:g}),M.transform=new Ae({polynomialOrder:1,forwardCoefficients:[p[2]+p[0]/2,p[5]-p[3]/2,p[0],p[3],-p[1],-p[4]]}),M.extent=M.transform.forwardTransform(M.nativeExtent),M.pixelSize=new A({x:(w.xmax-w.xmin)/r,y:(w.ymax-w.ymin)/t,spatialReference:g}),T.origin.x=-.5,T.origin.y=.5),{imageInfo:e,rasterInfo:M}}_processPAMInfo(s,e){if(e.statistics=s.statistics??e.statistics,e.histograms=s.histograms,s.histograms&&e.statistics==null&&(e.statistics=Je(s.histograms)),s.transform&&e.transform==null){e.transform=s.transform,e.nativeExtent=e.extent;const r=e.transform.forwardTransform(e.nativeExtent);e.pixelSize=new A({x:(r.xmax-r.xmin)/e.width,y:(r.ymax-r.ymin)/e.height,spatialReference:e.spatialReference}),e.extent=r}e.isPseudoSpatialReference&&s.spatialReference&&(e.spatialReference=s.spatialReference,e.extent.spatialReference=e.nativeExtent.spatialReference=e.storageInfo.origin.spatialReference=e.spatialReference)}async _readIFDs(s,e,r,t,i,n=4,a){if(!t)return null;(t>=e.byteLength||t<0)&&(e=(await this.request(this.url,{range:{from:t+i,to:t+i+this._bufferSize},responseType:"array-buffer",signal:a})).data,i=t+i,t=0);const o=await this._readIFD(e,r,t,i,xe.TIFF_TAGS,n,a);if(s.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(s,e,r,o.nextIFD-i,i,n,a)}async _readIFD(s,e,r,t,i=xe.TIFF_TAGS,n=4,a){var l,c;if(!s)return null;const o=xi(s,e,r,t,i,n);if(o.success){const h=[];if((l=o.ifd)==null||l.forEach(u=>{u.values||h.push(u)}),h.length>0){const u=h.map(d=>d.offlineOffsetSize).filter(Pe),m=Math.min.apply(null,u.map(d=>d[0]));if(Math.min.apply(null,u.map(d=>d[0]+d[1]))-m<=this._bufferSize){const{data:d}=await this.request(this.url,{range:{from:m,to:m+this._bufferSize},responseType:"array-buffer",signal:a});s=d,t=m,h.forEach(p=>wi(s,e,p,t))}}if((c=o.ifd)!=null&&c.has("GEOKEYDIRECTORY")){const u=o.ifd.get("GEOKEYDIRECTORY"),m=u==null?void 0:u.values;if(m&&m.length>4){const d=m[0]+"."+m[1]+"."+m[2],p=await this._readIFD(s,e,u.valueOffset+6-t,t,xe.GEO_KEYS,2,a);u.data=p.ifd,u.data&&u.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[d]})}}return o}if(o.requiredBufferSize&&o.requiredBufferSize!==s.byteLength)return(s=(await this.request(this.url,{range:{from:t,to:t+o.requiredBufferSize+4},responseType:"array-buffer",signal:a})).data).byteLengththis.request(this.url,{range:R,responseType:"array-buffer",signal:i.signal})),u=await Promise.all(h),m=u.map(R=>R.data.byteLength).reduce((R,k)=>R+k),d=u.length===1?u[0].data:new ArrayBuffer(m),p=[0],y=[0];if(u.length>1){const R=new Uint8Array(d);for(let k=0,_=0;kp||r>y||ee.add(t)),e}static async open(e){const{url:r,ioConfig:t,sourceJSON:i}=e;let n=e.datasetFormat;n==null&&r.lastIndexOf(".")&&(n=r.slice(r.lastIndexOf(".")+1).toUpperCase()),n==="OVR"||n==="TIF"?n="TIFF":n!=="JPG"&&n!=="JPEG"&&n!=="JFIF"||(n="JPG"),r.toLowerCase().includes("/imageserver")&&!r.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");const a={url:r,sourceJSON:i,datasetFormat:n,ioConfig:t??{bandIds:null,sampling:null}};let o,l;if(n&&this.supportedFormats.has(n)){if(n==="CRF"&&!(t!=null&&t.enableCRF))throw new $("rasterfactory:open",`cannot open raster: ${r}`);return o=W.get(n).constructor,l=new o(a),await l.open({signal:e.signal}),l}if(n)throw new $("rasterfactory:open","not a supported format "+n);const c=Array.from(W.keys());let h=0;const u=()=>(n=c[h++],n&&(n!=="CRF"||t!=null&&t.enableCRF)?(o=W.get(n).constructor,l=new o(a),l.open({signal:e.signal}).then(()=>l).catch(()=>u())):null);return u()}static register(e,r,t){W.has(e.toUpperCase())||W.set(e.toUpperCase(),{desc:r,constructor:t})}}let N=class extends _t(kt(Ci(Pi(Nt(ji($i(zt(Ft(Bt(Dt)))))))))){constructor(...s){super(...s),this._primaryRasters=[],this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null}normalizeCtorArgs(s,e){return typeof s=="string"?{url:s,...e}:s}load(s){const e=s!=null?s.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},s).catch(Mt).then(()=>this._openRaster(e))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){var o;const s=[new ue({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"}),new ue({name:"Raster.ServicePixelValue.Raw",alias:"Raw Pixel Value",domain:null,editable:!1,length:50,type:"string"})],{rasterInfo:e}=this,r=e==null?void 0:e.attributeTable,t=r!=null?r.fields:null,i="Raster.";if(t){const l=t.filter(c=>c.type!=="oid"&&c.name.toLowerCase()!=="value").map(c=>{const h=c.clone();return h.name=i+c.name,h});s.push(...l)}const n=e==null?void 0:e.dataType,a=e==null?void 0:e.multidimensionalInfo;if((n==="vector-magdir"||n==="vector-uv")&&a!=null){const l=(o=a.variables[0].unit)==null?void 0:o.trim(),c="Magnitude"+(l?` (${l})`:"");s.push(new ue({name:"Raster.Magnitude",alias:c,domain:null,editable:!1,type:"double"})),s.push(new ue({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return s}createPopupTemplate(s){const{rasterFields:e}=this,r=new Set(e.map(({name:t})=>t).filter(t=>t.toLowerCase()!=="raster.servicepixelvalue.raw"));return Di({fields:e,title:this.title},{...s,visibleFieldNames:r})}async generateRasterInfo(s,e){var r;if(!(s=Ne($e,s)))return this.rasterInfo;try{const t={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(a=>t[a.url]=a);const i=De(((r=s.functionDefinition)==null?void 0:r.toJSON())??s.toJSON(),t),n=new Be({rasterFunction:i});return await n.open(e),n.rasterInfo}catch(t){throw t instanceof $?t:new $("imagery-tile-layer","the given raster function is not supported")}}write(s,e){const r=this._primaryRasters[0]??this.raster;if(this.loaded?r.datasetFormat==="RasterTileServer"&&(r.tileType==="Raster"||r.tileType==="Map"):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(s,e);if(e&&e.messages){const t=`${e.origin}/${e.layerContainerType||"operational-layers"}`;e.messages.push(new $("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${t}'`,{layer:this}))}return null}async _openRaster(s){var t;let e=!1;if(this.raster)this.raster.rasterInfo||await this.raster.open(),this.raster.datasetFormat==="Function"?(e=!0,this._primaryRasters=this.raster.primaryRasters.rasters):this._primaryRasters=[this.raster],this.url=this.raster.url;else{const{rasterFunction:i}=this,n=[this.url];i&&Mi(i.toJSON(),n);const a=await Promise.all(n.map(l=>is.open({url:l,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:s}))),o=a.findIndex(l=>l==null);if(o>-1)throw new $("imagery-tile-layer:open",`cannot open raster: ${n[o]}`);if(this._primaryRasters=a,i){const l={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(u=>l[u.url]=u);const c=De(((t=i.functionDefinition)==null?void 0:t.toJSON())??i.toJSON(),l),h=new Be({rasterFunction:c});try{await h.open(),this.raster=h}catch(u){const m=ze.getLogger(this);u instanceof $&&m.error("imagery-tile-layer:open",u.message),m.warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=a[0]}}else this.raster=a[0]}const r=this.raster.rasterInfo;if(!r)throw new $("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("rasterInfo",e?r:this._primaryRasters[0].rasterInfo),this._set("spatialReference",r.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,this.sourceJSON!=null){const i=this.raster.tileType==="Map"&&this.sourceJSON.minLOD!=null&&this.sourceJSON.maxLOD!=null?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(i,{origin:"service"})}else this.read({tileInfo:this.rasterInfo.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),this.raster.tileType==="Map"&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(Ct(()=>this.customParameters,i=>{this.raster&&(this.raster.ioConfig.customFetchParameters=i)}))}};I([v()],N.prototype,"_primaryRasters",void 0),I([v({type:[Pt],json:{write:{overridePolicy(){var s;return{enabled:!this.loaded||this.raster.tileType==="Raster"||((s=this.bandIds)==null?void 0:s.join(","))!=="0,1,2"}}}}})],N.prototype,"bandIds",void 0),I([v({json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.interpolation!=="bilinear"}}}}}),$t(Qt)],N.prototype,"interpolation",void 0),I([v(Zt)],N.prototype,"legendEnabled",void 0),I([v({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],N.prototype,"isReference",void 0),I([v({type:["show","hide"]})],N.prototype,"listMode",void 0),I([v({json:{read:!0,write:!0}})],N.prototype,"blendMode",void 0),I([v()],N.prototype,"sourceJSON",void 0),I([v({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],N.prototype,"version",void 0),I([v({readOnly:!0,json:{read:!1}})],N.prototype,"type",void 0),I([v({type:["ArcGISTiledImageServiceLayer"]})],N.prototype,"operationalLayerType",void 0),I([v({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(s,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}},writer(s,e,r){e[r]=!s}}}})],N.prototype,"popupEnabled",void 0),I([v({type:Ot,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}}}}})],N.prototype,"popupTemplate",void 0),I([v({readOnly:!0})],N.prototype,"defaultPopupTemplate",null),I([v({readOnly:!0,type:[ue]})],N.prototype,"fields",void 0),I([v({readOnly:!0,type:[ue]})],N.prototype,"rasterFields",null),N=I([Q("esri.layers.ImageryTileLayer")],N);const Cs=N;export{Cs as default}; diff --git a/assets/ImageryTileLayerView3D-7bc4c9c1.js b/assets/ImageryTileLayerView3D-7bc4c9c1.js new file mode 100644 index 0000000..c7984a9 --- /dev/null +++ b/assets/ImageryTileLayerView3D-7bc4c9c1.js @@ -0,0 +1 @@ +import{ai as n,aj as l,al as S,ar as T,aK as F,cT as j,gJ as L,gK as O}from"./index-080e108a.js";import{n as P}from"./LayerView3D-ffd35809.js";import{o as _}from"./TiledLayerView3D-a11f8026.js";import{b as G}from"./commonProperties-30089b06.js";import{T as E,q as M}from"./rasterProjectionHelper-072edec4.js";import{p as V}from"./popupUtils-f04ec9a9.js";import{d as k}from"./LayerView-448bc5ea.js";import{a as A}from"./RefreshableLayerView-915e7f53.js";import{r as J}from"./drapedUtils-909caa2b.js";const W=i=>{let e=class extends i{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}_getfullExtent(){return this.projectFullExtent(this.view.spatialReference)}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){return E(this.layer.fullExtent,this.view.spatialReference,!0)}supportsSpatialReference(t){return!!this.projectFullExtent(t)}projectFullExtent(t){const a=this.layer.fullExtent,r=E(a,t,!1);return M(a,t,r)}async fetchPopupFeatures(t,a){const{layer:r}=this;if(!t)throw new T("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:r});const{popupEnabled:u}=r,y=V(r,a);if(!u||y==null)throw new T("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:u,popupTemplate:y});const p=[],{value:o,magdirValue:s,processedValue:b}=await r.identify(t,{timeExtent:this.timeExtent});let c="";if(o&&o.length){c=r.type==="imagery-tile"&&r.hasStandardTime()&&o[0]!=null?o.map(w=>r.getStandardTimeValue(w)).join(", "):o.join(", ");const d={ObjectId:0},v="Raster.ServicePixelValue";d[v]=(b==null?void 0:b.join(", "))??c,d[v+".Raw"]=c;const x=r.rasterInfo.attributeTable;if(x!=null){const{fields:w,features:z}=x,R=w.find(({name:h})=>h.toLowerCase()==="value"),g=R?z.find(h=>String(h.attributes[R.name])===c):null;if(g)for(const h in g.attributes)g.attributes.hasOwnProperty(h)&&(d[this._rasterFieldPrefix+h]=g.attributes[h])}const I=r.rasterInfo.dataType;I!=="vector-magdir"&&I!=="vector-uv"||(d["Raster.Magnitude"]=s==null?void 0:s[0],d["Raster.Direction"]=s==null?void 0:s[1]);const f=new F(this.fullExtent.clone(),null,d);f.layer=r,f.sourceLayer=f.layer,p.push(f)}return p}};return n([l()],e.prototype,"layer",void 0),n([l(G)],e.prototype,"timeExtent",void 0),n([l()],e.prototype,"view",void 0),n([l()],e.prototype,"fullExtent",null),n([l()],e.prototype,"tileInfo",void 0),n([l({readOnly:!0})],e.prototype,"hasTilingEffects",null),n([l()],e.prototype,"datumTransformation",null),e=n([S("esri.views.layers.ImageryTileLayerView")],e),e};let m=class extends W(A(_(P(k)))){constructor(){super(...arguments),this.type="imagery-tile-3d",this.isAlignedMapTile=!0}initialize(){this.layer.increaseRasterJobHandlerUsage(),this.fullExtent==null&&this.addResolvingPromise(Promise.reject(new T("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const i=j(()=>{var e,t;return(t=(e=this.view)==null?void 0:e.basemapTerrain)==null?void 0:t.tilingSchemeLocked}).then(()=>{const e=this.view.basemapTerrain.tilingScheme,t=this.layer.tileInfo,a=["png","png24","png32","jpg","mixed"].includes(t.format)&&e.compatibleWith(t);this.isAlignedMapTile=a;const r=a?t:e.toTileInfo();this.tileInfo=r,this.updatingHandles.add(()=>[this.layer.renderer,this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent],()=>this.refresh())});this.addResolvingPromise(i)}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this.view=null}get _blankTile(){const i=document.createElement("canvas"),e=i.getContext("2d"),[t,a]=this.tileInfo.size;return i.width=t,i.height=a,e.clearRect(0,0,t,a),e.getImageData(0,0,t,a)}get imageFormatIsOpaque(){return this.layer.tileInfo.format==="jpg"}get hasMixedImageFormats(){return this.layer.tileInfo.format==="mixed"}get dataLevelRange(){const i=this.tileInfo.lods,e=this.layer.tileInfo.lods,t=i[0].scale,a=e[e.length-1].scale;return this.levelRangeFromScaleRange(t,a)}_getfullExtent(){return this.projectFullExtent(this.view.basemapTerrain&&this.view.basemapTerrain.spatialReference!=null?this.view.basemapTerrain.spatialReference:this.view.spatialReference)}async fetchTile(i,e,t,a){const r=this.tileInfo,u=this._canSymbolizeInWebGL(),y={tileInfo:r,requestRawData:u,signal:a.signal,timeExtent:this.timeExtent,requestAsImageElement:this.isAlignedMapTile},p=await this.layer.fetchTile(i,e,t,y);if(p instanceof HTMLImageElement)return p;let o=p&&p.pixelBlock;if(o==null)return this._blankTile;if(!u&&(o=await this.layer.applyRenderer(p),o==null))return this._blankTile;const s=new L([i,e,t],o,r.size[0],r.size[1]);return u?(s.symbolizerRenderer=this.layer.symbolizer.rendererJSON,s.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(i)),s.transformGrid=p.transformGrid):s.isRendereredSource=!0,s.interpolation=this.layer.interpolation,s.bandIds=this.layer.bandIds,s}_getSymbolizerOptions(i){const e=this.tileInfo.lodAt(i).resolution;return{pixelBlock:null,isGCS:this.view.basemapTerrain&&this.view.basemapTerrain.spatialReference!=null?this.view.basemapTerrain.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:e,y:e},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(i){this._canSymbolizeInWebGL()&&JSON.stringify(i.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(i.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(i.lij[0])))}createFetchPopupFeaturesQueryGeometry(i,e){return J(i,e,this.view)}refresh(){this.emit("data-changed")}async doRefresh(){this.suspended||this.emit("data-changed")}_canSymbolizeInWebGL(){return O("3d").supportsTextureFloat&&this.layer.symbolizer.canRenderInWebGL}};n([l({readOnly:!0})],m.prototype,"_blankTile",null),n([l({readOnly:!0})],m.prototype,"imageFormatIsOpaque",null),n([l({readOnly:!0})],m.prototype,"hasMixedImageFormats",null),n([l({readOnly:!0})],m.prototype,"dataLevelRange",null),m=n([S("esri.views.3d.layers.ImageryTileLayerView3D")],m);const Q=m;export{Q as default}; diff --git a/assets/IntegratedMeshLayer-cad83962.js b/assets/IntegratedMeshLayer-cad83962.js new file mode 100644 index 0000000..2e5e4ac --- /dev/null +++ b/assets/IntegratedMeshLayer-cad83962.js @@ -0,0 +1 @@ +import{eP as g,aF as S,bf as w,at as T,ai as i,aj as s,al as h,eS as _,af as O,aT as L,aH as $,ho as x,as as I,ar as d,ay as N,aA as M}from"./index-080e108a.js";import{O as A}from"./MultiOriginJSONSupport-e4912ffd.js";import{g as b}from"./persistable-ca976a2c.js";import{i as j}from"./APIKeyMixin-878a7aa7.js";import{l as K}from"./ArcGISService-83287338.js";import{c as V}from"./OperationalLayer-0e8f8b28.js";import{j as D}from"./PortalLayer-310c2800.js";import{N as J,K as c}from"./SceneService-6fea113d.js";import{d as P}from"./commonProperties-30089b06.js";import{s as U,l as E,u as R,m as z}from"./I3SLayerDefinitions-ffdb3821.js";import{f as y}from"./SceneModification-2715f58a.js";import"./multiOriginJSONSupportUtils-c978f4c3.js";import"./resourceExtension-91e7c3ce.js";import"./portalItemUtils-792a27e1.js";import"./originUtils-1469eeaf.js";import"./I3SIndexInfo-445e6968.js";import"./resourceUtils-b667b05b.js";var a;let n=a=class extends g(S.ofType(y)){constructor(e){super(e),this.url=null}clone(){return new a({url:this.url,items:this.items.map(e=>e.clone())})}toJSON(e){return this.toArray().map(o=>o.toJSON(e)).filter(o=>!!o.geometry)}static fromJSON(e,o){const r=new a;for(const p of e)r.add(y.fromJSON(p,o));return r}static async fromUrl(e,o,r){const p={url:w(e),origin:"service"},u=await T(e,{responseType:"json",signal:r==null?void 0:r.signal}),v=o.toJSON(),l=[];for(const m of u.data)l.push(y.fromJSON({...m,geometry:{...m.geometry,spatialReference:v}},p));return new a({url:e,items:l})}};i([s({type:String})],n.prototype,"url",void 0),n=a=i([h("esri.layers.support.SceneModifications")],n);const f=n;let t=class extends J(K(V(D(_(A(j(M))))))){constructor(...e){super(...e),this._handles=new O,this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this._modificationsSource=null,this.elevationInfo=null,this.path=null}destroy(){this._handles.destroy()}initialize(){this._handles.add(L(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,$))}normalizeCtorArgs(e,o){return typeof e=="string"?{url:e,...o}:e}readModifications(e,o,r){this._modificationsSource={url:x(e,r),context:r}}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const o=e==null?void 0:e.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(r){I(r)}if(await this._fetchService(o),this._modificationsSource!=null){const r=await f.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",r,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,o)}beforeSave(){if(this._modificationsSource!=null)return this.load().then(()=>{},()=>{})}async saveAs(e,o){return this._debouncedSaveOperations(c.SAVE_AS,{...o,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(c.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="IntegratedMesh")throw new d("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new d("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}};i([s({type:String,readOnly:!0})],t.prototype,"geometryType",void 0),i([s({type:["show","hide"]})],t.prototype,"listMode",void 0),i([s({type:["IntegratedMeshLayer"]})],t.prototype,"operationalLayerType",void 0),i([s({json:{read:!1},readOnly:!0})],t.prototype,"type",void 0),i([s({type:U,readOnly:!0})],t.prototype,"nodePages",void 0),i([s({type:[E],readOnly:!0})],t.prototype,"materialDefinitions",void 0),i([s({type:[R],readOnly:!0})],t.prototype,"textureSetDefinitions",void 0),i([s({type:[z],readOnly:!0})],t.prototype,"geometryDefinitions",void 0),i([s({readOnly:!0})],t.prototype,"serviceUpdateTimeStamp",void 0),i([s({type:f}),b({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],t.prototype,"modifications",void 0),i([N(["web-scene","portal-item"],"modifications")],t.prototype,"readModifications",null),i([s(P)],t.prototype,"elevationInfo",void 0),i([s({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],t.prototype,"path",void 0),t=i([h("esri.layers.IntegratedMeshLayer")],t);const se=t;export{se as default}; diff --git a/assets/IntegratedMeshLayerView3D-9c474b52.js b/assets/IntegratedMeshLayerView3D-9c474b52.js new file mode 100644 index 0000000..7e56b39 --- /dev/null +++ b/assets/IntegratedMeshLayerView3D-9c474b52.js @@ -0,0 +1 @@ +import{aJ as m,ag as p,aK as n,ai as i,aj as o,aL as l,al as d}from"./index-080e108a.js";import{x as h}from"./I3SMeshView3D-86f2c945.js";import{n as c}from"./LayerView3D-ffd35809.js";import{d as u}from"./LayerView-448bc5ea.js";import"./I3SOverrides-96f73e2b.js";import"./I3SNode-2025159f.js";import"./I3SUtil-2c288808.js";import"./Query-1c961d4c.js";import"./I3SBinaryReader-2b8e30f7.js";import"./meshFeatureSet-8442b8e6.js";import"./FeatureSet-111cb247.js";import"./FeatureLayerView3D-7e7e2653.js";import"./FeatureLayerViewBase3D-8474587e.js";import"./FeatureLikeLayerView3D-2e3185ce.js";import"./dehydratedFeatureComparison-a3375a3e.js";import"./queryForSymbologySnapping-0264f2b5.js";import"./elevationInfoUtils-4fd79d95.js";import"./hash-6f442295.js";import"./diffUtils-590c9088.js";import"./Graphics3DObjectStates-bb2a6162.js";import"./UniqueValueRenderer-fef4204d.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./popupUtils-f04ec9a9.js";import"./FeatureFilter-00f4be05.js";import"./floorFilterUtils-080a7cd2.js";import"./QueryEngine-19eda5ff.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./FeatureStore-f0e312fc.js";import"./BoundsStore-b6bd3c14.js";import"./projectExtentUtils-efa4cddd.js";import"./query-93c6e211.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./EventedSet-d13fada5.js";import"./commonProperties-30089b06.js";import"./FeatureEffect-86735d98.js";import"./RefreshableLayerView-915e7f53.js";import"./SceneModification-2715f58a.js";import"./persistable-ca976a2c.js";import"./multiOriginJSONSupportUtils-c978f4c3.js";import"./resourceExtension-91e7c3ce.js";import"./SceneLayerWorker-e92c2264.js";const g=.2;let r=class extends h(c(u)){constructor(){super(...arguments),this.type="integrated-mesh-3d",this._elevationContext="im",this._isIntegratedMesh=!0,this._supportsLabeling=!1,this.drapeTargetType=m.WithoutRasterImage}get i3slayer(){return this.layer}get updatingProgressValue(){var t;return((t=this._controller)==null?void 0:t.updatingProgress)??0}get lodFactor(){var t,e,a,s;return((s=(a=(e=(t=this.view)==null?void 0:t.qualitySettings)==null?void 0:e.sceneService)==null?void 0:a.integratedMesh)==null?void 0:s.lodFactor)??1}get progressiveLoadFactor(){return this.lodFactor>=1?g:1}get layerPopupEnabledAndHasTemplate(){return!1}initialize(){this.updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),p),this.view.basemapTerrain.overlayManager.registerDrapeTarget(this)}destroy(){this.view.basemapTerrain.overlayManager.unregisterDrapeTarget(this)}_createLayerGraphic(){const t=new n;return t.layer=this.layer,t.sourceLayer=this.layer,t}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}_loadModifications(){if(this.handles.remove("modifications"),this.layer.modifications==null)return void(this._modifications=[]);const t=this.layer.modifications;this.handles.add(this.updatingHandles.addOnCollectionChange(()=>t,()=>this._modifications=t.toArray(),p),"modifications")}};i([o()],r.prototype,"layer",void 0),i([o()],r.prototype,"i3slayer",null),i([o(l)],r.prototype,"updatingProgress",void 0),i([o()],r.prototype,"updatingProgressValue",null),i([o()],r.prototype,"lodFactor",null),i([o({readOnly:!0})],r.prototype,"progressiveLoadFactor",null),r=i([d("esri.views.3d.layers.SceneLayerView3D")],r);const Tt=r;export{Tt as default}; diff --git a/assets/KMLLayer-1c6bcbfe.js b/assets/KMLLayer-1c6bcbfe.js new file mode 100644 index 0000000..919dfd3 --- /dev/null +++ b/assets/KMLLayer-1c6bcbfe.js @@ -0,0 +1 @@ +import{cl as S,c0 as I,jg as z,bZ as J,at as A,dw as L,jh as x,ji as w,jj as k,jk as W,bc as O,cu as H,eP as U,aT as M,aH as v,aG as $,cT as _,ca as F,cj as V,aF as G,ai as i,aj as a,jl as D,ay as j,al as C,gC as q,eQ as B,eR as Q,eS as Y,dU as Z,eb as X,as as ee,bY as te,aA as se}from"./index-080e108a.js";import{O as re}from"./MultiOriginJSONSupport-e4912ffd.js";import{c as ie}from"./OperationalLayer-0e8f8b28.js";import{j as oe}from"./PortalLayer-310c2800.js";import{f as le}from"./commonProperties-30089b06.js";import"./jsonUtils-f73b3833.js";import"./FeatureSet-111cb247.js";import"./portalItemUtils-792a27e1.js";import"./UniqueValueRenderer-fef4204d.js";import"./diffUtils-590c9088.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";const ae={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function T(e){const t=e.folders||[],r=t.slice(),s=new Map,o=new Map,d=new Map,b=new Map,m=new Map,f={esriGeometryPoint:o,esriGeometryPolyline:d,esriGeometryPolygon:b};(e.featureCollection&&e.featureCollection.layers||[]).forEach(l=>{const p=S(l);p.featureSet.features=[];const y=l.featureSet.geometryType;s.set(y,p);const c=l.layerDefinition.objectIdField;y==="esriGeometryPoint"?E(o,c,l.featureSet.features):y==="esriGeometryPolyline"?E(d,c,l.featureSet.features):y==="esriGeometryPolygon"&&E(b,c,l.featureSet.features)}),e.groundOverlays&&e.groundOverlays.forEach(l=>{m.set(l.id,l)}),t.forEach(l=>{l.networkLinkIds.forEach(p=>{const y=ue(p,l.id,e.networkLinks);y&&r.push(y)})}),r.forEach(l=>{var p;if(l.featureInfos){l.points=S(s.get("esriGeometryPoint")),l.polylines=S(s.get("esriGeometryPolyline")),l.polygons=S(s.get("esriGeometryPolygon")),l.mapImages=[];for(const y of l.featureInfos)switch(y.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const c=f[y.type].get(y.id);c&&((p=l[ae[y.type]])==null||p.featureSet.features.push(c));break}case"GroundOverlay":{const c=m.get(y.id);c&&l.mapImages.push(c);break}}l.fullExtent=P([l])}});const h=P(r);return{folders:t,sublayers:r,extent:h}}function R(e,t,r,s){const o=I&&I.findCredential(e);e=z(e,{token:o&&o.token});const d=J.kmlServiceUrl;return A(d,{query:{url:e,model:"simple",folders:"",refresh:r!==0||void 0,outSR:JSON.stringify(t)},responseType:"json",signal:s})}function N(e,t,r=null,s=[]){const o=[],d={},b=t.sublayers,m=t.folders.map(f=>f.id);return b.forEach(f=>{var l;const h=new e;if(r?h.read(f,r):h.read(f),s.length&&m.includes(h.id)&&(h.visible=s.includes(h.id)),d[f.id]=h,f.parentFolderId!=null&&f.parentFolderId!==-1){const p=d[f.parentFolderId];p.sublayers||(p.sublayers=[]),(l=p.sublayers)==null||l.unshift(h)}else o.unshift(h)}),o}function E(e,t,r){r.forEach(s=>{e.set(s.attributes[t],s)})}function ne(e,t){let r;return t.some(s=>s.id===e&&(r=s,!0)),r}function ue(e,t,r){const s=ne(e,r);return s&&(s.parentFolderId=t,s.networkLink=s),s}function P(e){const t=L(x),r=L(x);for(const s of e){if(s.polygons&&s.polygons.featureSet&&s.polygons.featureSet.features)for(const o of s.polygons.featureSet.features)w(t,o.geometry),k(r,t);if(s.polylines&&s.polylines.featureSet&&s.polylines.featureSet.features)for(const o of s.polylines.featureSet.features)w(t,o.geometry),k(r,t);if(s.points&&s.points.featureSet&&s.points.featureSet.features)for(const o of s.points.featureSet.features)w(t,o.geometry),k(r,t);if(s.mapImages)for(const o of s.mapImages)w(t,o.extent),k(r,t)}return W(r,x)?void 0:{xmin:r[0],ymin:r[1],zmin:r[2],xmax:r[3],ymax:r[4],zmax:r[5],spatialReference:O.WGS84}}var g;let u=g=class extends H.EventedMixin(U(q)){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.id=null,this.networkLink=null,this.parent=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.layer=null,this.addHandles([M(()=>this.sublayers,"after-add",({item:t})=>{t.parent=this,t.layer=this.layer},v),M(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},v),$(()=>this.sublayers,(t,r)=>{if(r)for(const s of r)s.layer=s.parent=null;if(t)for(const s of t)s.parent=this,s.layer=this.layer},v),$(()=>this.layer,t=>{if(this.sublayers)for(const r of this.sublayers)r.layer=t},v)])}initialize(){_(()=>this.networkLink).then(()=>_(()=>this.visible===!0)).then(()=>this.load())}load(e){var s;if(!this.networkLink||this.networkLink.viewFormat)return;const t=e!=null?e.signal:null,r=this._fetchService(((s=this._get("networkLink"))==null?void 0:s.href)??"",t).then(o=>{var m;const d=P(o.sublayers);this.fullExtent=F.fromJSON(d),this.sourceJSON=o;const b=V(G.ofType(g),N(g,o));this.sublayers?this.sublayers.addMany(b):this.sublayers=b,(m=this.layer)==null||m.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")});return this.addResolvingPromise(r),Promise.resolve(this)}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}_fetchService(e,t){return R(e,this.layer.outSpatialReference,this.layer.refreshInterval,t).then(r=>T(r.data))}};i([a()],u.prototype,"description",void 0),i([a({type:F})],u.prototype,"fullExtent",void 0),i([a()],u.prototype,"id",void 0),i([a({readOnly:!0,value:null})],u.prototype,"networkLink",void 0),i([a({json:{write:{allowNull:!0}}})],u.prototype,"parent",void 0),i([a({type:G.ofType(g),json:{write:{allowNull:!0}}})],u.prototype,"sublayers",void 0),i([a({value:null,json:{read:{source:"name",reader:e=>D(e)}}})],u.prototype,"title",void 0),i([a({value:!0})],u.prototype,"visible",null),i([j("visible",["visibility"])],u.prototype,"readVisible",null),i([a()],u.prototype,"sourceJSON",void 0),i([a()],u.prototype,"layer",void 0),u=g=i([C("esri.layers.support.KMLSublayer")],u);const K=u,ye=["kml","xml"];let n=class extends B(Q(Y(ie(oe(re(se)))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new Z({getCollections:()=>[this.sublayers],getChildrenFunction:t=>t.sublayers}),this.outSpatialReference=O.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([$(()=>this.sublayers,(e,t)=>{t&&t.forEach(r=>{r.parent=null,r.layer=null}),e&&e.forEach(r=>{r.parent=this,r.layer=this})},v),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}readSublayersFromItemOrWebMap(e,t){this._visibleFolders=t.visibleFolders}readSublayers(e,t,r){return N(K,t,r,this._visibleFolders)}writeSublayers(e,t){const r=[],s=e.toArray();for(;s.length;){const o=s[0];o.networkLink||(o.visible&&r.push(o.id),o.sublayers&&s.push(...o.sublayers.toArray())),s.shift()}t.visibleFolders=r}get title(){const e=this._get("title");return e&&this.originOf("title")!=="defaults"?e:this.url?X(this.url,ye)||"KML":e||""}set title(e){this._set("title",e)}get visibleSublayers(){const e=this.sublayers,t=[],r=s=>{s.visible&&(t.push(s),s.sublayers&&s.sublayers.forEach(r))};return e&&e.forEach(r),t}get fullExtent(){return this._recomputeFullExtent()}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},e).catch(ee).then(()=>this._fetchService(t))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const t=await Promise.resolve().then(()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:R(this.url??"",this.outSpatialReference,this.refreshInterval,e)),r=T(t.data);r&&this.read(r,{origin:"service"})}_recomputeFullExtent(){let e=null;this.extent!=null&&(e=this.extent.clone());const t=r=>{if(r.sublayers)for(const s of r.sublayers.items)t(s),s.visible&&s.fullExtent&&(e!=null?e.union(s.fullExtent):e=s.fullExtent.clone())};return t(this),e}};i([a({readOnly:!0})],n.prototype,"allSublayers",void 0),i([a({type:O})],n.prototype,"outSpatialReference",void 0),i([a({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],n.prototype,"path",void 0),i([a({readOnly:!0,json:{read:!1,write:!1}})],n.prototype,"legendEnabled",void 0),i([a({type:["show","hide","hide-children"]})],n.prototype,"listMode",void 0),i([a({type:["KML"]})],n.prototype,"operationalLayerType",void 0),i([a({})],n.prototype,"resourceInfo",void 0),i([a({type:G.ofType(K),json:{write:{ignoreOrigin:!0}}})],n.prototype,"sublayers",void 0),i([j(["web-map","portal-item"],"sublayers",["visibleFolders"])],n.prototype,"readSublayersFromItemOrWebMap",null),i([j("service","sublayers",["sublayers"])],n.prototype,"readSublayers",null),i([te("sublayers")],n.prototype,"writeSublayers",null),i([a({readOnly:!0,json:{read:!1}})],n.prototype,"type",void 0),i([a({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],n.prototype,"title",null),i([a(le)],n.prototype,"url",void 0),i([a({readOnly:!0})],n.prototype,"visibleSublayers",null),i([a({type:F})],n.prototype,"extent",void 0),i([a()],n.prototype,"fullExtent",null),n=i([C("esri.layers.KMLLayer")],n);const Ee=n;export{Ee as default}; diff --git a/assets/LabelClass-2d53c485.js b/assets/LabelClass-2d53c485.js new file mode 100644 index 0000000..2e3ad56 --- /dev/null +++ b/assets/LabelClass-2d53c485.js @@ -0,0 +1 @@ +import{ai as n,aj as o,ay as d,bY as c,al as x,ck as S,fS as f,cp as E,fT as A,fU as j,fV as C,fW as h,fX as I,fY as B,fZ as $,f_ as N,f$ as O,g0 as V,cl as m}from"./index-080e108a.js";import{a as D}from"./defaults-34554cbf.js";var v;let a=v=class extends S{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(e,r){return r.value?f(r.value):e}writeExpression(e,r,t){this.value!=null&&(e=f(this.value)),e!=null&&(r[t]=e)}clone(){return new v({expression:this.expression,title:this.title,value:this.value})}};n([o({type:String,json:{write:{writerEnsuresNonNull:!0}}})],a.prototype,"expression",void 0),n([d("expression",["expression","value"])],a.prototype,"readExpression",null),n([c("expression")],a.prototype,"writeExpression",null),n([o({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],a.prototype,"title",void 0),n([o({json:{read:!1,write:!1}})],a.prototype,"value",void 0),a=v=n([x("esri.layers.support.LabelExpressionInfo")],a);const P=a;var w;const u=new E({esriServerPointLabelPlacementAboveCenter:"above-center",esriServerPointLabelPlacementAboveLeft:"above-left",esriServerPointLabelPlacementAboveRight:"above-right",esriServerPointLabelPlacementBelowCenter:"below-center",esriServerPointLabelPlacementBelowLeft:"below-left",esriServerPointLabelPlacementBelowRight:"below-right",esriServerPointLabelPlacementCenterCenter:"center-center",esriServerPointLabelPlacementCenterLeft:"center-left",esriServerPointLabelPlacementCenterRight:"center-right",esriServerLinePlacementAboveAfter:"above-after",esriServerLinePlacementAboveAlong:"above-along",esriServerLinePlacementAboveBefore:"above-before",esriServerLinePlacementAboveStart:"above-start",esriServerLinePlacementAboveEnd:"above-end",esriServerLinePlacementBelowAfter:"below-after",esriServerLinePlacementBelowAlong:"below-along",esriServerLinePlacementBelowBefore:"below-before",esriServerLinePlacementBelowStart:"below-start",esriServerLinePlacementBelowEnd:"below-end",esriServerLinePlacementCenterAfter:"center-after",esriServerLinePlacementCenterAlong:"center-along",esriServerLinePlacementCenterBefore:"center-before",esriServerLinePlacementCenterStart:"center-start",esriServerLinePlacementCenterEnd:"center-end",esriServerPolygonPlacementAlwaysHorizontal:"always-horizontal"},{ignoreUnknown:!0});function b(e,r,t){return{enabled:!I(t==null?void 0:t.layer)}}function g(e){var r;return!e||e.origin!=="service"&&((r=e.layer)==null?void 0:r.type)!=="map-image"}function M(e){return(e==null?void 0:e.type)==="map-image"}function L(e){var r,t;return!!M(e)&&!!((t=(r=e.capabilities)==null?void 0:r.exportMap)!=null&&t.supportsArcadeExpressionForLabeling)}function R(e){return g(e)||L(e==null?void 0:e.layer)}let l=w=class extends S{static evaluateWhere(e,r){const t=(i,p,s)=>{switch(p){case"=":return i==s;case"<>":return i!=s;case">":return i>s;case">=":return i>=s;case"<":return iR(t)?{allowNull:!0}:{enabled:!1}}}})],l.prototype,"labelExpressionInfo",void 0),n([c("labelExpressionInfo")],l.prototype,"writeLabelExpressionInfo",null),n([o({type:u.apiValues,json:{type:u.jsonValues,read:u.read,write:u.write}})],l.prototype,"labelPlacement",void 0),n([o({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],l.prototype,"labelPosition",void 0),n([o({type:Number})],l.prototype,"maxScale",void 0),n([c("maxScale")],l.prototype,"writeMaxScale",null),n([o({type:Number})],l.prototype,"minScale",void 0),n([c("minScale")],l.prototype,"writeMinScale",null),n([o({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:b}}}}})],l.prototype,"repeatLabel",void 0),n([o({type:Number,cast:A,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:b}}}}})],l.prototype,"repeatLabelDistance",void 0),n([o({types:j,json:{origins:{"web-scene":{types:C,write:h,default:null}},write:h,default:null}})],l.prototype,"symbol",void 0),n([o({type:Boolean,json:{write:!0}})],l.prototype,"useCodedValues",void 0),n([o({type:String,json:{write:!0}})],l.prototype,"where",void 0),l=w=n([x("esri.layers.support.LabelClass")],l);const F=l;export{F as C}; diff --git a/assets/LaserlinePath.glsl-f6fdf1ff.js b/assets/LaserlinePath.glsl-f6fdf1ff.js new file mode 100644 index 0000000..9042ead --- /dev/null +++ b/assets/LaserlinePath.glsl-f6fdf1ff.js @@ -0,0 +1 @@ +import"./index-080e108a.js";import{v as t}from"./PointVisualElement-2a56e55d.js";import"./LineVisualElement-b605d10c.js";import"./VisualElementResources-e52972a5.js";export{t as build}; diff --git a/assets/Laserlines.glsl-fc6ed0d2.js b/assets/Laserlines.glsl-fc6ed0d2.js new file mode 100644 index 0000000..94cf4d8 --- /dev/null +++ b/assets/Laserlines.glsl-fc6ed0d2.js @@ -0,0 +1 @@ +import"./index-080e108a.js";import{A as m,C as p}from"./PointVisualElement-2a56e55d.js";import"./LineVisualElement-b605d10c.js";import"./VisualElementResources-e52972a5.js";export{m as build,p as defaultAngleCutoff}; diff --git a/assets/LayerView-448bc5ea.js b/assets/LayerView-448bc5ea.js new file mode 100644 index 0000000..773f486 --- /dev/null +++ b/assets/LayerView-448bc5ea.js @@ -0,0 +1 @@ +import{cX as n,am as l,cY as d,cu as o,ao as p,bz as u,ai as i,aj as r,al as y}from"./index-080e108a.js";let t=class extends n(l(d(o.EventedMixin(p)))){constructor(e){super(e),this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{if(e.name!=="layerview:create-error"){const s=this.layer&&this.layer.id||"no id",a=this.layer&&this.layer.title||"no title";u.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${a}', id: '${s}')`,e)}})}get fullOpacity(){var e,s;return(((e=this.layer)==null?void 0:e.opacity)??1)*(((s=this.parent)==null?void 0:s.fullOpacity)??1)}get suspended(){return!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){var e;return!this.suspended&&((e=this.layer)==null?void 0:e.legendEnabled)===!0}get updating(){var e;return!(!((e=this.updatingHandles)!=null&&e.updating)&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get visible(){var e;return((e=this.layer)==null?void 0:e.visible)===!0}set visible(e){this._overrideIfSome("visible",e)}canResume(){var e,s,a;return this.visible&&((e=this.layer)==null?void 0:e.loaded)&&!((s=this.parent)!=null&&s.suspended)&&((a=this.view)==null?void 0:a.ready)||!1}getSuspendInfo(){const e=this.parent&&this.parent.suspended?this.parent.suspendInfo:{},s=this;return s.view&&s.view.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}};i([r()],t.prototype,"fullOpacity",null),i([r()],t.prototype,"layer",void 0),i([r()],t.prototype,"parent",void 0),i([r({readOnly:!0})],t.prototype,"suspended",null),i([r({readOnly:!0})],t.prototype,"suspendInfo",null),i([r({readOnly:!0})],t.prototype,"legendEnabled",null),i([r({type:Boolean,readOnly:!0})],t.prototype,"updating",null),i([r({readOnly:!0})],t.prototype,"updatingProgress",null),i([r()],t.prototype,"visible",null),i([r()],t.prototype,"view",void 0),t=i([y("esri.views.layers.LayerView")],t);const g=t;export{g as d}; diff --git a/assets/LayerView3D-ffd35809.js b/assets/LayerView3D-ffd35809.js new file mode 100644 index 0000000..7db246e --- /dev/null +++ b/assets/LayerView3D-ffd35809.js @@ -0,0 +1 @@ +import{ai as t,aj as l,al as r,cS as c,aS as h,cT as d,ax as p,cU as u}from"./index-080e108a.js";const g=o=>{let s=class extends o{constructor(){super(...arguments),this.slicePlaneEnabled=!1,this.supportsHeightUnitConversion=!1}postscript(e){super.postscript(e),c(this.layer)&&this.addResolvingPromise(this._validateHeightModelInfo())}async _validateHeightModelInfo(){const e=new AbortController,a=e.signal;this.handles.add(h(()=>e.abort())),await d(()=>{var n;return(n=this.view.defaultsFromMap)==null?void 0:n.heightModelInfoReady},a),p(a);const i=u(this.layer,this.view.heightModelInfo,this.supportsHeightUnitConversion);if(i)throw i}canResume(){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return super.canResume()&&(!e||!e.minScale||!e.maxScale||e.minScale>=e.maxScale)}getSuspendInfo(){const e=super.getSuspendInfo(),a=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return a&&a.minScale&&a.maxScale&&a.minScalel.normalize(p(e),0,!0))],t.prototype,"orientation",void 0),t=o([u("esri.analysis.LengthDimension")],t);const h=t;export{c as r,r as t,h as u}; diff --git a/assets/LercWorker-aac3e5c8.js b/assets/LercWorker-aac3e5c8.js new file mode 100644 index 0000000..c5927ce --- /dev/null +++ b/assets/LercWorker-aac3e5c8.js @@ -0,0 +1 @@ +import{eB as Y}from"./index-080e108a.js";var A={};A.defaultNoDataValue=Y(-1/0),A.decode=function(i,t){var r=(t=t||{}).encodedMaskData||t.encodedMaskData===null,e=E(i,t.inputOffset||0,r),c=t.noDataValue!=null?Y(t.noDataValue):A.defaultNoDataValue,n=F(e,t.pixelType||Float32Array,t.encodedMaskData,c,t.returnMask),s={width:e.width,height:e.height,pixelData:n.resultPixels,minValue:e.pixels.minValue,maxValue:e.pixels.maxValue,noDataValue:c};return n.resultMask&&(s.maskData=n.resultMask),t.returnEncodedMask&&e.mask&&(s.encodedMaskData=e.mask.bitset?e.mask.bitset:null),t.returnFileInfo&&(s.fileInfo=b(e,c),t.computeUsedBitDepths&&(s.fileInfo.bitDepths=D(e))),s};var F=function(i,t,r,e,c){var n,s,d=0,m=i.pixels.numBlocksX,x=i.pixels.numBlocksY,y=Math.floor(i.width/m),v=Math.floor(i.height/x),p=2*i.maxZError;r=r||(i.mask?i.mask.bitset:null),n=new t(i.width*i.height),c&&r&&(s=new Uint8Array(i.width*i.height));for(var g,k,h=new Float32Array(y*v),M=0;M<=x;M++){var U=M!==x?v:i.height%x;if(U!==0)for(var I=0;I<=m;I++){var o=I!==m?y:i.width%m;if(o!==0){var P,a,f,w,l=M*i.width*v+I*y,B=i.width-o,u=i.pixels.blocks[d];if(u.encoding<2?(u.encoding===0?P=u.rawData:(S(u.stuffedData,u.bitsPerPixel,u.numValidPixels,u.offset,p,h,i.pixels.maxValue),P=h),a=0):f=u.encoding===2?0:u.offset,r)for(k=0;k>3],w<<=7&l),g=0;g>3]),128&w?(s&&(s[l]=1),n[l++]=u.encoding<2?P[a++]:f):(s&&(s[l]=0),n[l++]=e),w<<=1;l+=B}else if(u.encoding<2)for(k=0;k0){var s=new Uint8Array(Math.ceil(e.width*e.height/8)),d=(n=new DataView(i,t,e.mask.numBytes)).getInt16(0,!0),m=2,x=0;do{if(d>0)for(;d--;)s[x++]=n.getUint8(m++);else{var y=n.getUint8(m++);for(d=-d;d--;)s[x++]=y}d=n.getInt16(m,!0),m+=2}while(m0?1:0),k=p+(e.height%p>0?1:0);e.pixels.blocks=new Array(g*k);for(var h=1e9,M=0,U=0;U3)throw"Invalid block encoding ("+a.encoding+")";if(a.encoding!==2){if(f!==0&&f!==2){if(f>>=6,a.offsetType=f,f===2)a.offset=n.getInt8(1),o++;else if(f===1)a.offset=n.getInt16(1,!0),o+=2;else{if(f!==0)throw"Invalid block offset type";a.offset=n.getFloat32(1,!0),o+=4}if(h=Math.min(a.offset,h),a.encoding===1)if(f=n.getUint8(o),o++,a.bitsPerPixel=63&f,f>>=6,a.numValidPixelsType=f,f===2)a.numValidPixels=n.getUint8(o),o++;else if(f===1)a.numValidPixels=n.getUint16(o,!0),o+=2;else{if(f!==0)throw"Invalid valid pixel count type";a.numValidPixels=n.getUint32(o,!0),o+=4}}var w;if(t+=o,a.encoding!=3){if(a.encoding===0){var l=(e.pixels.numBytes-1)/4;if(l!==Math.floor(l))throw"uncompressed block has invalid length";w=new ArrayBuffer(4*l),new Uint8Array(w).set(new Uint8Array(i,t,4*l));for(var B=new Float32Array(w),u=0;u=t)m=x>>>p-t&y,p-=t;else{var h=t-p;m=(x&y)<>>(p=32-h)}n[d]=m=0?1:-1;U(a,l,c*(p+Math.abs(t))),W(s,r,a),ye(s,r,he);const d=this._getRayIntersection(he,{include:this._terrainIntersectionOptionsLayerUids});return d!=null?(U(a,l,c*t),W(i,d.renderPoint,a),ge(d.normal)):(T(i,e),null)}};n([o()],B.prototype,"view",void 0),n([o()],B.prototype,"intersector",void 0),B=n([I("esri.views.3d.analysis.LineOfSight.LineOfSightRayIntersector")],B);const Lt=y(),St=y(),Rt=y(),Et=y(),he=Me(),Fe="esri.views.3d.analysis.LineOfSight.LineOfSightController",Ae=_e.getLogger(Fe);let m=class extends De.EventedMixin(P){constructor(e){super(e),this.updateOnCameraChange=!0,this._observerGroundOffsetRenderSpace=0,this._effectiveObserverElevationMode="absolute-height",this._observerFeatureId=null,this._updatingHandles=new be,this._frameTask=fe,this._handles=new Z,this._computationHandles=new Z,this._externalObserverUpdate=!0}initialize(){var t;const e=(t=this.view.resourceController)==null?void 0:t.scheduler;this._frameTask=e?e.registerTask(ee.LINE_OF_SIGHT_TOOL):fe,this._intersector=new B({view:this.view}),this._handles.add([this._connectObserver(),this._connectComputations(),this._connectTargets()])}destroy(){this._handles.destroy(),this._computationHandles.destroy(),this._computations.removeAll(),this._updatingHandles.destroy()}get updating(){return this._frameTask.updating||this._updatingHandles.updating}get priority(){return this._frameTask.priority}set priority(e){this._frameTask.priority=e}get _computations(){return this.analysisViewData.computations}get _elevationAlignedObserverPositionRenderSpace(){return this.analysisViewData.observerEngineLocation}set _elevationAlignedObserverPositionRenderSpace(e){this.analysisViewData.observerEngineLocation=e}get _screenPixelSize(){return this.view.state.camera.computeScreenPixelSizeAt(this._elevationAlignedObserverPositionRenderSpace)}_computeResult(e){const t=e.computation,{inputPoints:i,computationResult:s}=t,{observerAdjusted:r,targetAdjusted:l}=i,{start:a,end:h}=s;T(a,r),T(h,l),this._canCompute(t)?this._computeIntersection(e):this._interpolateIntersection(e),t.notifyResultChanged(),this.emit("result-changed",{target:e.computation.target,result:t.result})}_updateAdjustedPointsFromFeatures(e){const t=this.view,{sceneIntersectionHelper:i}=t,{inputPoints:s}=e,{observerAdjusted:r,observerFeatureId:l,targetFeatureId:a,targetAdjusted:h}=s;if(l==null&&a==null)return;const p=et(r,h),c=this._intersector.intersector,d=ye(s.observer,s.target,$e);c.options.store=ae.ALL,i.intersectToolIntersectorRay(d,c);let v=null,g=null,f=null,O=null;for(const w of c.results.all){const _=re(w,this.view);if(_==null||w.distanceInRenderSpace==null)continue;const S=pe(_);S!=null&&(l!=null&&S===l&&(v==null&&(v=this._getFeatureDistanceThreshold(w,t,p)),w.distanceInRenderSpace=V*j(p,c)}const S=new nt(w,i.spatialReference);{const{result:V,target:D}=e;V!=null?(V.target=D,V.intersectedGraphic=_?null:re(f,i),V.intersectedLocation=_?null:S,V.visible=_):e.result=new z({target:D,elevationAlignedTargetLocation:e.elevationAlignedTargetLocation,intersectedGraphic:_?null:re(f,i),intersectedLocation:_?null:S,visible:_})}a.isValid=h.isValid=!0,a.isTargetVisible=_}_interpolateIntersection({computation:e,interpolationInfo:t}){const{computationResult:i,inputPoints:s}=e,{start:r,end:l,intersection:a}=i,{originalIntersection:h,originalObserver:p,originalTarget:c}=t;if(T(a,h),s.isValid){const d=ne,v=j(p,h)/j(p,c);Ce(d,r,p),U(d,d,1-v),W(a,a,d),Ce(d,l,c),U(d,d,v),W(a,a,d),i.isValid=!0}else e.result=null,i.isValid=!1,i.isTargetVisible=!1}_canCompute(e){const t=this.analysisViewData.elevationAlignedObserver,i=this.view.frustum;if(t==null||e.elevationAlignedTargetLocation==null||i==null)return!1;const{observerAdjusted:s,targetAdjusted:r}=e.inputPoints,l=i.intersectsPoint(s),a=i.intersectsPoint(r);return l&&a}_onObserverPositionChange(e,t,i,s,r){if(this._externalObserverUpdate=r,e==null)return this.analysisViewData.elevationAlignedObserver=null,void(this._observerFeatureId=null);if(t==null)return Pe(this.analysis,e.spatialReference,Ae),void(this.analysisViewData.elevationAlignedObserver=null);const l=this._getEffectiveElevationInfo(t,i),{absoluteZ:a,elevation:h}=Se(t.x,t.y,t.z,this.view.spatialReference,this.view,l),p=t.clone();p.z=a,this._effectiveObserverElevationMode=l.mode,this.analysisViewData.elevationAlignedObserver=p;const c=y();this.view.renderCoordsHelper.toRenderCoords(p,c),this._elevationAlignedObserverPositionRenderSpace=c,this._observerGroundOffsetRenderSpace=a-h,this._observerFeatureId=pe(s),this.priority=ee.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onObserverRenderSpacePositionChangeForComputation(e,t,i,s,r){const{inputPoints:l}=e;switch(T(l.observer,t),l.observerFeatureId=r,l.observerSurfaceNormal=null,s){case"on-the-ground":case"relative-to-ground":{const a=this._intersector.updateFromGroundIntersection(l.observer,i,l.observer);l.observerFeatureId==null&&(l.observerSurfaceNormal=a)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=ee.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onTargetPositionChange(e,t,i,s,r,l=!0){const a=e.inputPoints;if(l&&(a.isValid=!1),i==null)return t!=null&&Pe(this.analysis,t.spatialReference,Ae),e.elevationAlignedTargetLocation=null,void e.notifyInputPointsChanged();const h=this._getEffectiveElevationInfo(i,s),{absoluteZ:p,elevation:c}=Se(i.x,i.y,i.z,this.view.spatialReference,this.view,h),d=i.clone();switch(d.z=p,e.elevationAlignedTargetLocation=d,this.view.renderCoordsHelper.toRenderCoords(e.elevationAlignedTargetLocation,a.target),a.targetFeatureId=pe(r),a.targetSurfaceNormal=null,h.mode){case"on-the-ground":case"relative-to-ground":{const v=this._intersector.updateFromGroundIntersection(a.target,p-c,a.target);a.targetFeatureId==null&&(a.targetSurfaceNormal=v)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=ee.LINE_OF_SIGHT_TOOL_INTERACTIVE}_connectComputationToTarget(e){return te([this._updatingHandles.add(()=>({computation:e,targetPosition:e.target.position,targetElevationInfo:e.target.elevationInfo,targetFeatureInfo:e.target.feature,projectedTargetPosition:ie(e.target.position,this.view.spatialReference)}),({computation:t,targetPosition:i,targetElevationInfo:s,targetFeatureInfo:r,projectedTargetPosition:l})=>{l.pending==null?this._onTargetPositionChange(t,i,l.geometry,s,r):this._updatingHandles.addPromise(l.pending)},H)])}_connectComputationToObserver(e){return this._updatingHandles.add(()=>({computation:e,observer:this.analysisViewData.elevationAlignedObserver}),({computation:t})=>{this._externalObserverUpdate&&(t.inputPoints.isValid=!1,t.notifyInputPointsChanged())},H)}_connectComputationToRenderSpaceObserver(e){return this._updatingHandles.add(()=>({computation:e,observer:this._elevationAlignedObserverPositionRenderSpace,observerGroundOffset:this._observerGroundOffsetRenderSpace,observerElevationMode:this._effectiveObserverElevationMode,observerFeatureId:this._observerFeatureId}),({computation:t,observer:i,observerGroundOffset:s,observerElevationMode:r,observerFeatureId:l})=>{this._onObserverRenderSpacePositionChangeForComputation(t,i,s,r,l)},H)}_connectComputationToCamera(e){return this._updatingHandles.add(()=>({camera:this.view.state.camera,isDirty:this._isCameraDirty}),({isDirty:t})=>{!this.updateOnCameraChange||e.inputPoints.isValid&&!t||e.notifyInputPointsChanged()})}_connectComputationToSlicePlane(e){return this._updatingHandles.add(()=>this.view.slicePlane,()=>{e.inputPoints.isValid=!1,e.notifyInputPointsChanged()})}_connectComputationToElevation(e){const t=(i,s)=>{const r=this.analysis.observer,l=e.target;let a=null,h=null,p=null,c=null,d=null,v=null;if(r!=null&&r.position!=null){const g=ie(r.position,this.view.spatialReference);if(g.pending!=null)return this._updatingHandles.addPromise(g.pending),void g.pending.finally(()=>t(i,s));a=g.geometry,h=r.elevationInfo,p=r.feature}if(l.position!=null){const g=ie(l.position,this.view.spatialReference);if(g.pending!=null)return this._updatingHandles.addPromise(g.pending),void g.pending.finally(()=>t(i,s));c=g.geometry,d=l.elevationInfo,v=l.feature}a==null&&c==null||(at(i,s,oe,this.view.spatialReference),a!=null&&Oe(oe,a)&&this._onObserverPositionChange(r!=null?r.position:null,a,h,p,!1),c!=null&&Oe(oe,c)&&this._onTargetPositionChange(e,l.position,c,d,v,!1),a!=null&&c!=null&<(oe,a,c)&&e.notifyInputPointsChanged())};return this.view.elevationProvider.on("elevation-change",i=>t(i.extent,i.spatialReference))}_connectComputationToTask(e){let t=null;const i={computation:e,interpolationInfo:{originalIntersection:y(),originalObserver:y(),originalTarget:y()}};return te([this._updatingHandles.add(()=>e.inputPoints,()=>{t=we(t),t=ot(async s=>{await st(this._frameTask.schedule(()=>this._computeResult(i),s))})},{initial:!0,equals:()=>!1}),ke(()=>t=we(t))])}_connectComputation(e){const t=this._computationHandles;t.has(e)||t.add([this._connectComputationToTarget(e),this._connectComputationToObserver(e),this._connectComputationToRenderSpaceObserver(e),this._connectComputationToCamera(e),this._connectComputationToSlicePlane(e),this._connectComputationToElevation(e),this._connectComputationToTask(e)],e)}_disconnectComputation(e){this._computationHandles.remove(e)}_onComputationCollectionChange({added:e,removed:t}){for(const i of t)this._disconnectComputation(i);for(const i of e)this._connectComputation(i)}_onTargetCollectionChange({added:e,removed:t}){for(const i of t)this._removeTarget(i);for(const i of e)this._addTarget(i)}_onCursorTargetChange(e,t){t!=null&&this._removeTarget(t),e!=null&&this._addTarget(e)}_addTarget(e){this._computations.some(t=>t.target===e)||this._computations.add(new x({target:e}))}_removeTarget(e){const t=this._computations.findIndex(i=>i.target===e);this._computations.removeAt(t)}_connectObserver(){return te([this._updatingHandles.add(()=>({observerPosition:this.analysis.observer!=null?this.analysis.observer.position:null,projectedObserverPosition:ie(this.analysis.observer!=null?this.analysis.observer.position:null,this.view.spatialReference),observerElevationInfo:this.analysis.observer!=null?this.analysis.observer.elevationInfo:null,observerFeatureInfo:this.analysis.observer!=null?this.analysis.observer.feature:null}),({observerPosition:e,projectedObserverPosition:t,observerElevationInfo:i,observerFeatureInfo:s})=>{t.pending==null?this._onObserverPositionChange(e,t.geometry,i,s,!0):this._updatingHandles.addPromise(t.pending)},H)])}_connectComputations(){return this._updatingHandles.addOnCollectionChange(()=>this._computations,e=>this._onComputationCollectionChange(e),{initial:!0,final:!0})}_connectTargets(){return te([this._updatingHandles.addOnCollectionChange(()=>this.analysis.targets,e=>this._onTargetCollectionChange(e),{initial:!0,final:!0}),this._updatingHandles.add(()=>this.analysisViewData.cursorTarget,(e,t)=>{this._onCursorTargetChange(e,t)})])}get _isCameraDirty(){const e=this.analysisViewData.elevationAlignedObserver,{view:t}=this,{renderCoordsHelper:i}=t;if(e==null||i==null)return!1;const s=ne;i.toRenderCoords(e,s);const r=t.state.camera.computeScreenPixelSizeAt(s);return Math.abs((r-this._screenPixelSize)/this._screenPixelSize)>At}_getEffectiveElevationInfo(e,t){return e.hasZ?t??{mode:"absolute-height",offset:0}:{mode:"on-the-ground",offset:0}}};n([o({constructOnly:!0})],m.prototype,"analysis",void 0),n([o({constructOnly:!0})],m.prototype,"analysisViewData",void 0),n([o({constructOnly:!0})],m.prototype,"view",void 0),n([o()],m.prototype,"updating",null),n([o()],m.prototype,"priority",null),n([o()],m.prototype,"updateOnCameraChange",void 0),n([o()],m.prototype,"_computations",null),n([o()],m.prototype,"_elevationAlignedObserverPositionRenderSpace",null),n([o()],m.prototype,"_observerGroundOffsetRenderSpace",void 0),n([o()],m.prototype,"_effectiveObserverElevationMode",void 0),n([o()],m.prototype,"_observerFeatureId",void 0),n([o()],m.prototype,"_screenPixelSize",null),n([o({readOnly:!0})],m.prototype,"_updatingHandles",void 0),n([o()],m.prototype,"_frameTask",void 0),n([o()],m.prototype,"_isCameraDirty",null),m=n([I(Fe)],m);const At=.1,ne=y(),$e=Me(),oe=rt(),$t=.05;let A=class extends P{constructor(e){super(e),this.enabled=!0,this.glowColor=xe(),this.glowWidth=8,this.innerColor=yt(),this.innerWidth=.75,this.globalAlpha=_t(.75)}};n([o({type:Boolean})],A.prototype,"enabled",void 0),n([o({type:u})],A.prototype,"glowColor",void 0),n([o({type:Number})],A.prototype,"glowWidth",void 0),n([o({type:u})],A.prototype,"innerColor",void 0),n([o({type:Number})],A.prototype,"innerWidth",void 0),n([o({type:Number})],A.prototype,"globalAlpha",void 0),A=n([I("esri.views.3d.interactive.analysisTools.lineOfSight.LineOfSightLaserLineConfiguration")],A);let J=class extends P{constructor(e){super(e),this.size=.5,this.color=xe(.75)}};n([o({type:Number})],J.prototype,"size",void 0),n([o({type:u})],J.prototype,"color",void 0),J=n([I("esri.views.3d.interactive.analysisTools.lineOfSight.LineOfSightObserverConfiguration")],J);let F=class extends P{constructor(t){super(t),this.size=.5,this.visibleColor=new u([3,252,111,.75]),this.occludedColor=new u([252,3,69,.75]),this.undefinedColor=new u([127,127,127,.75])}};n([o({type:Number})],F.prototype,"size",void 0),n([o({type:u})],F.prototype,"visibleColor",void 0),n([o({type:u})],F.prototype,"occludedColor",void 0),n([o({type:u})],F.prototype,"undefinedColor",void 0),F=n([I("esri.views.3d.interactive.analysisTools.lineOfSight.LineOfSightTargetConfiguration")],F);let $=class extends P{constructor(t){super(t),this.innerWidth=2,this.outerWidth=8,this.visibleInnerColor=new u([3,252,111,1]),this.visibleOuterColor=new u([3,252,111,.15]),this.occludedInnerColor=new u([252,3,69,1]),this.occludedOuterColor=new u([252,3,69,.1]),this.undefinedInnerColor=new u([255,255,255,1]),this.undefinedOuterColor=new u([127,127,127,.2])}};n([o({type:Number})],$.prototype,"innerWidth",void 0),n([o({type:Number})],$.prototype,"outerWidth",void 0),n([o({type:u})],$.prototype,"visibleInnerColor",void 0),n([o({type:u})],$.prototype,"visibleOuterColor",void 0),n([o({type:u})],$.prototype,"occludedInnerColor",void 0),n([o({type:u})],$.prototype,"occludedOuterColor",void 0),n([o({type:u})],$.prototype,"undefinedInnerColor",void 0),n([o({type:u})],$.prototype,"undefinedOuterColor",void 0);let G=class extends P{constructor(e){super(e),this.laserLine=new A,this.observer=new J,this.target=new F,this.lineOfSight=new $}};n([o({type:A})],G.prototype,"laserLine",void 0),n([o({type:J})],G.prototype,"observer",void 0),n([o({type:F})],G.prototype,"target",void 0),n([o({type:$})],G.prototype,"lineOfSight",void 0),G=n([I("esri.views.3d.interactive.analysisTools.lineOfSight.LineOfSightToolConfiguration")],G);function Ht(e,t){let i=null;const s=e.events.on("grab-changed",r=>{i!=null&&(i.remove(),i=null),r.action==="start"&&(i=e.disableDisplay()),t&&t(r)});return{remove(){i!=null&&i.remove(),s.remove()}}}function se(e,t,i){return new wt(ut(Ot(u.toUnitRGBA(t)),e,32,32),i)}function Ge(e){const t=[];return e.customColor1&&t.push(se(e.size,e.customColor1,Q.Custom1)),e.customColor2&&t.push(se(e.size,e.customColor2,Q.Custom2)),e.customColor3&&t.push(se(e.size,e.customColor3,Q.Custom3)),e.color&&t.push(se(e.size,e.color)),t}function Mt(e,t){const i=Ge(t),s=new Ct({view:e,renderObjects:i,elevationInfo:{mode:"absolute-height",offset:0}});return Ht(s),s}var N;(function(e){e.Ready="ready",e.Creating="creating",e.Created="created"})(N||(N={}));let C=class extends Tt{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.configuration=new G,this.analysisViewData=null,this._latestPointerMovePointerType=null,this._laserlineVisualElement=null,this._grabbedManipulator=null,this._analysisHandles=new Z,this._handles=new Z,this._updatingHandles=new be,this._manipulatorHandles=new Z,this._targetTrackerManipulator=null}initialize(){this._intersector=new B({view:this.view}),this._handles.add(ct(()=>this.state,e=>{e===N.Created&&this.finishToolCreation()},pt)),this._observerManipulator=this._createObserverManipulator(),this._handles.add([this._updatingHandles.add(()=>({...this.configuration.observer}),()=>this._updateObserverManipulatorStyle()),this._updatingHandles.add(()=>{var e;return(e=this.analysisViewData)==null?void 0:e.elevationAlignedObserver},e=>this._onObserverLocationChange(e),H),this._updatingHandles.add(()=>({...this.configuration.laserLine}),()=>this._createVisualElements(),H),this._updatingHandles.add(()=>this._laserLineRendererDependencies(),e=>this._updateLaserLineRenderer(e)),this._connectComputations(),this._updatingHandles.addWhen(()=>!this._shouldRenderTracker,()=>this._clearCursorTracker(),H)])}destroy(){this._updatingHandles=M(this._updatingHandles),this._handles=M(this._handles),this._manipulatorHandles=M(this._manipulatorHandles),this._analysisHandles=M(this._analysisHandles),this._observerManipulator=null,this._clearCursorTracker(),this._removeVisualElements(),this._intersector=null,this._set("analysis",null)}get state(){return this.active?this.hasGrabbedManipulators?N.Created:N.Creating:this.analysis.observer!=null&&this.analysis.observer.position!=null?N.Created:N.Ready}get cursor(){return this.active&&this._showTracker?"crosshair":null}get updating(){return this.analysisViewData!=null&&this.analysisViewData.updating||this._updatingHandles.updating}get _showTracker(){return this.active&&this._latestPointerMovePointerType==="mouse"}get _shouldRenderTracker(){return this._showTracker&&this.analysis.observer!=null&&this.analysis.observer.position!=null&&!this.hasGrabbedManipulators}continue(){this.view.activeTool=this}stop(){this.view.activeTool=null}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"key-down":this._keyDownHandler(e);break;case"pointer-move":this._pointerMoveHandler(e)}}onInputEventAfter(e){e.type==="immediate-click"&&this._clickHandler(e)}onShow(){}onHide(){}onDeactivate(){this._clearCursorTracker()}_connectComputations(){return this._updatingHandles.addOnCollectionChange(()=>this.analysisViewData.computations,e=>this._onComputationsCollectionChange(e),{initial:!0,final:!0})}_onComputationsCollectionChange({added:e,removed:t}){for(const i of t)this._disconnectComputation(i);for(const i of e)this._connectComputation(i)}_connectComputation(e){if(this.destroyed)return void _e.getLogger(this).warn("Attempting to connect an analysis to a destroyed LineOfSight tool. Ignoring.");const t=this._analysisHandles;if(t.has(e))return;const i=this._createTargetManipulator(e.target);this._targetTrackerManipulator==null&&i.metadata.target===this.analysisViewData.cursorTarget&&(this._targetTrackerManipulator=i,this._targetTrackerManipulator.available=!1,this._targetTrackerManipulator.interactive=!1,this._updateLaserLineRenderer()),t.add([this._updatingHandles.add(()=>this._getLineOfSightManipulatorStateDependencies(e),()=>this._updateManipulatorState(i,e),H),this._updatingHandles.add(()=>e.elevationAlignedTargetLocation,s=>this._onTargetLocationChange(s,i),H)],e)}_disconnectComputation(e){if(this.destroyed)return void _e.getLogger(this).warn("Attempting to disconnect an analysis from a destroyed LineOfSight tool. Ignoring.");this._analysisHandles.remove(e);const t=this._getTargetManipulator(e.target);t!=null&&(this.manipulators.remove(t),this._manipulatorHandles.remove(t),this._targetTrackerManipulator!=null&&this._targetTrackerManipulator===t&&(this._targetTrackerManipulator=null))}_clearCursorTracker(){this.analysisViewData.cursorTarget=M(this.analysisViewData.cursorTarget)}_createManipulator(e,t,i){const s=Mt(this.view,e);return s.metadata=i,this._manipulatorHandles.add([t(s),s.events.on("grab-changed",r=>this._manipulatorGrabChanged(s,r)),s.events.on("immediate-click",r=>this._manipulatorClick(s,r))],s),this.manipulators.add(s),s}_createTargetManipulator(e){const t=this.configuration,i={size:t.target.size,customColor1:t.target.visibleColor,customColor2:t.target.occludedColor,customColor3:t.target.undefinedColor,visible:!0},s={target:e,type:"target"},r=this._createManipulator(i,l=>this._createTargetManipulatorDragPipeline(l),s);return e.position!=null?r.elevationAlignedLocation=e.position:r.available=!1,r}_getTargetManipulator(e){let t=null;return this.manipulators.forEach(i=>{const s=i.manipulator;t==null&&s.metadata.type==="target"&&s.metadata.target===e&&(t=s)}),t}_createObserverManipulator(){const e=this.configuration,t={size:e.observer.size,color:e.observer.color,visible:!0};return this._createManipulator(t,i=>this._createObserverManipulatorDragPipeline(i),{type:"observer",intersection:null})}_updateObserverManipulatorStyle(){const e=this._observerManipulator,t=this.configuration.observer,i={size:t.size,color:t.color,visible:e.available};e.renderObjects=Ge(i)}_screenToIntersection(){return e=>{const t=this._intersector.getScreenPointIntersection(e.screenEnd);return t==null?null:{...e,intersection:t}}}_createTargetManipulatorDragPipeline(e){return Re(e,(t,i,s)=>{i.next(this._screenToIntersection()).next(this._updateTargetDragStep(e)).next(()=>this._updateLaserLineRenderer()),s.next(this._cancelTargetDragStep(e.metadata.target)).next(()=>this._updateLaserLineRenderer())})}_createObserverManipulatorDragPipeline(e){return Re(e,(t,i,s)=>{i.next(this._screenToIntersection()).next(this._updateObserverDragStep()).next(()=>this._updateLaserLineRenderer()),s.next(this._cancelObserverDragStep()).next(()=>this._updateLaserLineRenderer())})}_updateObserverDragStep(){return e=>(e.intersection.mapPoint!=null?(this.analysis.observer==null&&(this.analysis.observer=new Ve),this._updateFromIntersection(this.analysis.observer,e.intersection)):this.analysis.observer=null,e)}_cancelObserverDragStep(){const e=this.analysis.observer!=null&&this.analysis.observer.position!=null?this.analysis.observer.clone():null;return t=>(this.analysis.observer=e,t)}_updateTargetDragStep(e){return t=>{this._updateFromIntersection(e.metadata.target,t.intersection);const i=t.intersection.mapPoint;return i!=null&&(e.elevationAlignedLocation=i),t}}_cancelTargetDragStep(e){const t=ze(e.position,i=>i.clone());return i=>(e.position=t,i)}_manipulatorGrabChanged(e,t){switch(t.action){case"start":this._grabbedManipulator=e;break;case"end":this._grabbedManipulator===e&&(this._grabbedManipulator=null)}}_updateManipulatorState(e,t){const{isValid:i,isTargetVisible:s}=t.computationResult;e.state=i?s?Q.Custom1:Q.Custom2:Q.Custom3}_getLineOfSightManipulatorStateDependencies(e){const{isValid:t,isTargetVisible:i}=e.computationResult;return{isValid:t,isTargetVisible:i}}_laserLineRendererDependencies(){return{laserlineVisualElement:this._laserlineVisualElement,grabbedManipulator:this._grabbedManipulator,shouldRenderTracker:this._shouldRenderTracker,observerPosition:this.analysis.observer!=null?this.analysis.observer.position:null,visible:this.visible}}_updateLaserLineRenderer(e=this._laserLineRendererDependencies()){const{laserlineVisualElement:t,grabbedManipulator:i,shouldRenderTracker:s,observerPosition:r,visible:l}=e;if(t==null)return;const a=i??(s&&r!=null?this._targetTrackerManipulator:null);this.configuration.laserLine.enabled&&a!=null&&l?(t.visible=!0,t.heightManifoldTarget=a.renderLocation,a!==this._observerManipulator?t.lineVerticalPlaneSegment=ht(this._observerManipulator.renderLocation,a.renderLocation,Dt):t.lineVerticalPlaneSegment=null):(t.visible=!1,t.heightManifoldTarget=null,t.lineVerticalPlaneSegment=null)}_createVisualElements(){const e=this.configuration.laserLine;this._removeVisualElements(),this._laserlineVisualElement=new Vt({view:this.view,attached:!0,visible:this.visible,style:{glowColor:u.toUnitRGB(e.glowColor),glowWidth:e.glowWidth,innerColor:u.toUnitRGB(e.innerColor),innerWidth:e.innerWidth,globalAlpha:e.globalAlpha}})}_removeVisualElements(){this._laserlineVisualElement!=null&&(this._laserlineVisualElement.destroy(),this._laserlineVisualElement=null)}_onObserverLocationChange(e){e!=null?(this._observerManipulator.metadata.intersection=null,this._observerManipulator.available=!0,this._observerManipulator.elevationAlignedLocation=e):this._observerManipulator.available=!1}_onTargetLocationChange(e,t){e!=null?(t.elevationAlignedLocation=e,t!==this._targetTrackerManipulator&&(t.available=!0)):t.available=!1}_addPointFromClickEvent(e){const t=this._intersector.getScreenPointIntersection(e);if(t!=null&&t.mapPoint!=null)if(this.analysis.observer!=null&&this.analysis.observer.position!=null){this._clearCursorTracker();const i=new Le;this._updateFromIntersection(i,t),this.analysis.targets.add(i)}else{const i=new Ve;this._updateFromIntersection(i,t),this.analysis.observer=i}}_clickHandler(e){this.active&&e.button!==ue.Right&&(this._addPointFromClickEvent(Te(e)),e.stopPropagation())}_doubleClickHandler(e){this.active&&e.button!==ue.Right&&(this.stop(),e.stopPropagation())}_keyDownHandler(e){this.active&&e.key==="Escape"&&(this.stop(),e.stopPropagation())}_pointerMoveHandler(e){if(this.hasGrabbedManipulators||(this._latestPointerMovePointerType=e.pointerType,this._updateLaserLineRenderer(),!this._showTracker||this.analysis.observer==null||this.analysis.observer.position==null))return;const t=Te(e),i=this._intersector.getScreenPointIntersection(t);i!=null&&i.mapPoint!=null&&(this.analysisViewData.cursorTarget==null&&(this.analysisViewData.cursorTarget=new Le),this._updateFromIntersection(this.analysisViewData.cursorTarget,i),this._updateLaserLineRenderer())}_updateFromIntersection(e,t){if(t.mapPoint==null)return e.position=null,e.elevationInfo=null,void(e.feature=null);switch(t.type){case q.OBJECT:if(t.graphic!=null){const s=t.graphic,r=bt(s);r.mode==="on-the-ground"&&(r.mode="relative-to-ground",r.offset=0),e.elevationInfo=new Ie(r),e.feature=s}else e.elevationInfo=null,e.feature=null;break;case q.TERRAIN:case q.I3S:e.elevationInfo=new Ie({mode:"on-the-ground"}),e.feature=null;break;default:e.elevationInfo=null,e.feature=null}const i=t.mapPoint.clone();i.z=ft(this.view,i,{mode:"absolute-height",offset:0},e.elevationInfo),e.position=i}_manipulatorClick(e,t){if(e.metadata.type==="observer"||e.grabbing||e.dragging||t.button!==ue.Right||this.analysis.targets.length<=1)return;const{target:i}=e.metadata;this.analysis.targets.remove(i),t.stopPropagation()}get testInfo(){return{laserLineVisualElement:this._laserlineVisualElement,getTargetManipulator:e=>this._getTargetManipulator(e)}}};n([o({constructOnly:!0})],C.prototype,"view",void 0),n([o({constructOnly:!0})],C.prototype,"analysis",void 0),n([o({readOnly:!0})],C.prototype,"state",null),n([o({readOnly:!0})],C.prototype,"cursor",null),n([o()],C.prototype,"removeIncompleteOnCancel",void 0),n([o({readOnly:!0})],C.prototype,"updating",null),n([o({type:G})],C.prototype,"configuration",void 0),n([o({constructOnly:!0})],C.prototype,"analysisViewData",void 0),n([o({readOnly:!0})],C.prototype,"_showTracker",null),n([o()],C.prototype,"_latestPointerMovePointerType",void 0),n([o()],C.prototype,"_shouldRenderTracker",null),n([o()],C.prototype,"_laserlineVisualElement",void 0),n([o()],C.prototype,"_grabbedManipulator",void 0),C=n([I("esri.views.3d.interactive.analysisTools.lineOfSight.LineOfSightTool")],C);const Dt=dt();class kt{constructor(t,i,s,r){this.visibleLineVisualElement=t,this.occludedLineVisualElement=i,this.undefinedLineVisualElement=s,this.targetVisualElement=r}destroy(){this.visibleLineVisualElement.destroy(),this.occludedLineVisualElement.destroy(),this.undefinedLineVisualElement.destroy(),this.targetVisualElement.destroy()}}let E=class extends P{constructor(e){super(e),this._lineOfSightVisualElements=new Array,this._computationHandles=new Z,this._updatingHandles=new be}initialize(){this.addHandles(this._connectComputations()),this._createObserverVisualization()}destroy(){this._updatingHandles=M(this._updatingHandles),this._computationHandles=M(this._computationHandles),this._observerVisualElement=M(this._observerVisualElement)}get visible(){return this.analysisViewData.visible}get updating(){return this._updatingHandles.updating}get interactiveAndEditable(){return this.analysisViewData.interactive&&this.analysisViewData.editable}get test(){return{disablePartialOcclusion:()=>{for(const e of this._lineOfSightVisualElements)e.visibleLineVisualElement.renderOccluded=de.Occlude,e.occludedLineVisualElement.renderOccluded=de.Occlude,e.undefinedLineVisualElement.renderOccluded=de.Occlude},visualizations:this._lineOfSightVisualElements}}get _configuration(){return this.analysisViewData.configuration}_createLineOfSightVisualization(){const e=this._configuration,t=this.view,i={view:t,attached:!0,width:e.outerWidth,innerWidth:e.innerWidth},s=u.toUnitRGBA(e.visibleOuterColor),r=u.toUnitRGBA(e.visibleInnerColor),l=u.toUnitRGBA(e.occludedOuterColor),a=u.toUnitRGBA(e.occludedInnerColor),h=u.toUnitRGBA(e.undefinedOuterColor),p=u.toUnitRGBA(e.undefinedInnerColor),c=new ce({...i,color:s,innerColor:r}),d=new ce({...i,color:l,innerColor:a}),v=new ce({...i,color:h,innerColor:p}),g=new Ee({view:t,attached:!0,...He,size:8}),f=new kt(c,d,v,g);return this._lineOfSightVisualElements.push(f),f}_destroyLineOfSightVisualization(e){e.destroy(),this._lineOfSightVisualElements.splice(this._lineOfSightVisualElements.indexOf(e),1)}_updateLineOfSightVisualization(e,t,i){const s=this._configuration,{computationResult:r,inputPoints:l}=e,{start:a,end:h,intersection:p,isValid:c,isTargetVisible:d}=r,{observer:v}=l,g=Gt;g[12]=v[0],g[13]=v[1],g[14]=v[2];const f=X(zt,a,v),O=X(xt,h,v),w=X(Ft,p,v),{visibleLineVisualElement:_,occludedLineVisualElement:S,undefinedLineVisualElement:V,targetVisualElement:D}=t,Ne=this.analysisViewData.elevationAlignedObserver==null||e.elevationAlignedTargetLocation==null,K=this.visible&&!Ne;_.visible=K,S.visible=K,V.visible=K,D.visible=K,D.attached=!i.interactiveAndEditable,K&&(_.geometry=null,S.geometry=null,V.geometry=null,D.geometry=e.elevationAlignedTargetLocation,c?d?(_.geometry=[[k(f),k(O)]],_.transform=g,_.color=u.toUnitRGBA(s.visibleOuterColor),D.color=u.toUnitRGBA(s.visibleInnerColor)):(_.geometry=[[k(f),k(w)]],_.transform=g,_.color=u.toUnitRGBA(s.occludedOuterColor),S.geometry=[[k(w),k(O)]],S.transform=g,D.color=u.toUnitRGBA(s.occludedInnerColor)):(V.geometry=[[k(f),k(O)]],V.transform=g,D.color=u.toUnitRGBA(s.undefinedInnerColor)))}_getLineOfSightVisualizationDependencies(e){const{computationResult:t}=e,{occludedOuterColor:i,visibleOuterColor:s}=this._configuration;return{computationResult:t,occludedOuterColor:i,visibleOuterColor:s,visible:this.visible,interactiveAndEditable:this.interactiveAndEditable}}_connectComputation(e){const t=this._computationHandles;if(t.has(e))return;const i=this._createLineOfSightVisualization();t.add([this._updatingHandles.add(()=>this._getLineOfSightVisualizationDependencies(e),s=>this._updateLineOfSightVisualization(e,i,s),{initial:!0,equals:()=>!1}),ke(()=>this._destroyLineOfSightVisualization(i))],e)}_disconnectComputation(e){this._computationHandles.remove(e)}_connectComputations(){return this._updatingHandles.addOnCollectionChange(()=>this.analysisViewData.computations,e=>this._onComputationsCollectionChange(e),{initial:!0,final:!0})}_onComputationsCollectionChange({added:e,removed:t}){for(const i of t)this._disconnectComputation(i);for(const i of e)this._connectComputation(i)}_createObserverVisualization(){const e=u.toUnitRGBA(this._configuration.visibleInnerColor),t=new Ee({view:this.view,attached:!1,color:e,...He});this._observerVisualElement=t,this.addHandles(this._updatingHandles.add(()=>({observer:this.analysisViewData.elevationAlignedObserver,interactiveAndEditable:this.interactiveAndEditable,visible:this.visible}),({observer:i,interactiveAndEditable:s,visible:r})=>{i!=null&&!s&&r?(t.geometry=i,this._observerVisualElement.attached=!0):t.attached=!1},H))}};n([o({constructOnly:!0})],E.prototype,"analysis",void 0),n([o({constructOnly:!0})],E.prototype,"analysisViewData",void 0),n([o({constructOnly:!0})],E.prototype,"view",void 0),n([o({readOnly:!0})],E.prototype,"visible",null),n([o()],E.prototype,"updating",null),n([o()],E.prototype,"interactiveAndEditable",null),n([o()],E.prototype,"test",null),n([o()],E.prototype,"_configuration",null),E=n([I("esri.views.3d.analysis.LineOfSight.LineOfSightVisualization")],E);const He={size:6,pixelSnappingEnabled:!1,primitive:"circle",elevationInfo:{mode:"absolute-height",offset:0},outlineSize:0},zt=y(),xt=y(),Ft=y(),Gt=gt();let b=class extends mt(De.EventedMixin(P)){constructor(e){super(e),this.type="line-of-sight-view-3d",this.analysis=null,this.tool=null,this.computations=new vt,this.elevationAlignedObserver=null,this.configuration=new R,this.observerEngineLocation=y(),this.cursorTarget=null,this.editable=!0}initialize(){const e=this.view,t=this.analysis;this._analysisController=new m({analysis:t,analysisViewData:this,view:e}),this._analysisVisualization=new E({analysis:t,analysisViewData:this,view:e}),this.addHandles([this._analysisController.on("result-changed",i=>{i.target!==this.cursorTarget&&this.emit("result-changed",i)}),It(this,C)])}destroy(){Pt(this),this._analysisController=M(this._analysisController),this._analysisVisualization=M(this._analysisVisualization)}get results(){return this.computations.map(e=>e.result)}get priority(){return this._analysisController.priority}set priority(e){this._analysisController.priority=e}get updating(){return this._analysisController!=null&&this._analysisController.updating||this._analysisVisualization!=null&&this._analysisVisualization.updating}getResultForTarget(e){const t=this.computations.find(i=>i.target===e);return ze(t,i=>i.result)}get testInfo(){return{visualization:this._analysisVisualization,controller:this._analysisController}}};n([o({readOnly:!0})],b.prototype,"type",void 0),n([o({constructOnly:!0,nonNullable:!0})],b.prototype,"analysis",void 0),n([o()],b.prototype,"tool",void 0),n([o({readOnly:!0})],b.prototype,"results",null),n([o()],b.prototype,"priority",null),n([o()],b.prototype,"computations",void 0),n([o()],b.prototype,"elevationAlignedObserver",void 0),n([o()],b.prototype,"configuration",void 0),n([o()],b.prototype,"observerEngineLocation",void 0),n([o()],b.prototype,"cursorTarget",void 0),n([o()],b.prototype,"updating",null),n([o()],b.prototype,"editable",void 0),n([o()],b.prototype,"_analysisController",void 0),n([o()],b.prototype,"_analysisVisualization",void 0),b=n([I("esri.views.3d.analysis.LineOfSightAnalysisView3D")],b);const ii=b;export{ii as default}; diff --git a/assets/LineOfSightLayer-e674c03f.js b/assets/LineOfSightLayer-e674c03f.js new file mode 100644 index 0000000..d073275 --- /dev/null +++ b/assets/LineOfSightLayer-e674c03f.js @@ -0,0 +1 @@ +import{aF as h,ai as t,aj as s,aE as E,al as c,aG as f,aM as v,aI as m,fA as y,hp as j,dC as L,dP as R,hq as z,aA as _}from"./index-080e108a.js";import{c as A}from"./Analysis-932d2cd8.js";import{f as b,u as x}from"./LineOfSightAnalysisTarget-7f5e80d1.js";import{r as P}from"./elevationInfoUtils-4fd79d95.js";import{O as q}from"./MultiOriginJSONSupport-e4912ffd.js";import{c as S}from"./OperationalLayer-0e8f8b28.js";import"./persistable-ca976a2c.js";import"./multiOriginJSONSupportUtils-c978f4c3.js";import"./resourceExtension-91e7c3ce.js";import"./commonProperties-30089b06.js";const u=h.ofType(b);let n=class extends A{constructor(e){super(e),this.type="line-of-sight",this.observer=null,this.extent=null}initialize(){this.addHandles(f(()=>this._computeExtent(),e=>{e!=null&&e.pending!=null||this._set("extent",e!=null?e.extent:null)},v))}get targets(){return this._get("targets")||new u}set targets(e){this._set("targets",m(e,this.targets,u))}get spatialReference(){return this.observer!=null&&this.observer.position!=null?this.observer.position.spatialReference:null}get requiredPropertiesForEditing(){return[y(this.observer,e=>e.position)]}async waitComputeExtent(){const e=this._computeExtent();return e!=null?e.pending:Promise.resolve()}_computeExtent(){const e=this.spatialReference;if(this.observer==null||this.observer.position==null||e==null)return null;const r=a=>P(a.position,a.elevationInfo)==="absolute-height",o=this.observer.position,d=j(o.x,o.y,o.z,o.x,o.y,o.z);for(const a of this.targets)if(a.position!=null){const l=L(a.position,e);if(l.pending!=null)return{pending:l.pending,extent:null};if(l.geometry!=null){const{x:w,y:O,z:$}=l.geometry;R(d,[w,O,$])}}const p=z(d,e);return r(this.observer)&&this.targets.every(r)||(p.zmin=void 0,p.zmax=void 0),{pending:null,extent:p}}clear(){this.observer=null,this.targets.removeAll()}};t([s({type:["line-of-sight"]})],n.prototype,"type",void 0),t([s({type:x,json:{read:!0,write:!0}})],n.prototype,"observer",void 0),t([s({cast:E,type:u,nonNullable:!0,json:{read:!0,write:!0}})],n.prototype,"targets",null),t([s({value:null,readOnly:!0})],n.prototype,"extent",void 0),t([s({readOnly:!0})],n.prototype,"spatialReference",null),t([s({readOnly:!0})],n.prototype,"requiredPropertiesForEditing",null),n=t([c("esri.analysis.LineOfSightAnalysis")],n);const g=n,T=h.ofType(b);let i=class extends S(q(_)){constructor(e){super(e),this.type="line-of-sight",this.operationalLayerType="LineOfSightLayer",this.analysis=new g,this.opacity=1}initialize(){this.addHandles(f(()=>this.analysis,(e,r)=>{r!=null&&r.parent===this&&(r.parent=null),e!=null&&(e.parent=this)},v))}async load(){return this.analysis!=null&&this.addResolvingPromise(this.analysis.waitComputeExtent()),this}get observer(){return y(this.analysis,e=>e.observer)}set observer(e){y(this.analysis,r=>r.observer=e)}get targets(){return this.analysis!=null?this.analysis.targets:new h}set targets(e){var r;m(e,(r=this.analysis)==null?void 0:r.targets)}get fullExtent(){return this.analysis!=null?this.analysis.extent:null}get spatialReference(){return this.analysis!=null?this.analysis.spatialReference:null}releaseAnalysis(e){this.analysis===e&&(this.analysis=new g)}};t([s({json:{read:!1},readOnly:!0})],i.prototype,"type",void 0),t([s({type:["LineOfSightLayer"]})],i.prototype,"operationalLayerType",void 0),t([s({type:x,json:{read:!0,write:{isRequired:!0,ignoreOrigin:!0}}})],i.prototype,"observer",null),t([s({type:T,json:{read:!0,write:{ignoreOrigin:!0}}})],i.prototype,"targets",null),t([s({nonNullable:!0,json:{read:!1,write:!1}})],i.prototype,"analysis",void 0),t([s({readOnly:!0})],i.prototype,"fullExtent",null),t([s({readOnly:!0})],i.prototype,"spatialReference",null),t([s({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],i.prototype,"opacity",void 0),t([s({type:["show","hide"]})],i.prototype,"listMode",void 0),i=t([c("esri.layers.LineOfSightLayer")],i);const D=i;export{D as default}; diff --git a/assets/LineOfSightLayerView3D-75d7761d.js b/assets/LineOfSightLayerView3D-75d7761d.js new file mode 100644 index 0000000..c867756 --- /dev/null +++ b/assets/LineOfSightLayerView3D-75d7761d.js @@ -0,0 +1 @@ +import{aG as h,aM as w,ar as y,aN as d,ah as V,aO as _,aP as c,aw as u,ai as e,aj as n,al as p}from"./index-080e108a.js";import{n as A}from"./LayerView3D-ffd35809.js";import{d as f}from"./LayerView-448bc5ea.js";const o="analysis-view-handles";let a=class extends A(f){constructor(s){super(s),this.type="line-of-sight-3d",this._analysisModule=null}initialize(){this.handles.add(h(()=>this.layer.analysis,s=>{this._destroyAnalysisView(),s!=null&&this._createAnalysisView(s)},w),o)}destroy(){this.handles.remove(o),this._destroyAnalysisView()}async whenAnalysisView(){if(this.analysisView!=null)return this.analysisView;if(this._createAnalysisViewTask!=null)return this._createAnalysisViewTask.promise;throw new y("layerview:no-analysisview-for-analysis","The analysis has not been set on the LineOfSightLayer of this layer view")}isUpdating(){return this._createAnalysisViewTask!=null||this.analysisView!=null&&this.analysisView.updating}_createAnalysisView(s){const t=d(async i=>(this.analysisView=await this._createAnalysisViewPromise(s,i),this._createAnalysisViewTask===t&&(this._createAnalysisViewTask=null),this.analysisView));this._createAnalysisViewTask=t}_destroyAnalysisView(){this.analysisView=V(this.analysisView),this._createAnalysisViewTask=_(this._createAnalysisViewTask)}async _createAnalysisViewPromise(s,t){let i=this._analysisModule;if(i==null){const r=await this._loadAnalysisModule();this._analysisModule=r,i=r}const l=new i.default({analysis:s,view:this.view,parent:this});if(await l.when(),c(t))throw l.destroy(),new y("layerview:no-analysisview-for-analysis","The analysis has not been added to the LineOfSightLayer of this layer view",{analysis:s});return l}_loadAnalysisModule(){return u(()=>import("./LineOfSightAnalysisView3D-ccdd2ae5.js"),["assets/LineOfSightAnalysisView3D-ccdd2ae5.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/LineVisualElement-b605d10c.js","assets/LineOfSightAnalysisTarget-7f5e80d1.js","assets/persistable-ca976a2c.js","assets/multiOriginJSONSupportUtils-c978f4c3.js","assets/resourceExtension-91e7c3ce.js","assets/elevationInfoUtils-4fd79d95.js","assets/analysisViewUtils-68ab721d.js","assets/ImageMaterial-5c48df66.js","assets/PointVisualElement-2a56e55d.js","assets/VisualElementResources-e52972a5.js"])}};e([n()],a.prototype,"type",void 0),e([n()],a.prototype,"layer",void 0),e([n()],a.prototype,"analysisView",void 0),e([n()],a.prototype,"_createAnalysisViewTask",void 0),a=e([p("esri.views.3d.layers.LineOfSightLayerView3D")],a);const k=a;export{k as default}; diff --git a/assets/LineVisualElement-b605d10c.js b/assets/LineVisualElement-b605d10c.js new file mode 100644 index 0000000..90d7aa8 --- /dev/null +++ b/assets/LineVisualElement-b605d10c.js @@ -0,0 +1 @@ +import{cY as P,aS as $,ai as n,aj as h,al as R,l9 as O,la as M,bh as _,bZ as y,aG as j,fu as w,j9 as G,e8 as x,aD as E,e9 as V,j3 as F,i$ as S,i_ as H,dS as m,hw as v,j5 as A,ft as I,dT as c,kO as f,lb as T,lc as k}from"./index-080e108a.js";const N=a=>{let e=class extends P(a){constructor(){super(...arguments),this.parent=null,this._userInteractive=!1,this._interactiveViewModelCount=0}get interactive(){return this._interactiveViewModelCount>0||this._userInteractive}set interactive(t){this._userInteractive=t}get updating(){return!1}get visible(){return this.parent==null||this.parent.visible&&!this.parent.suspended}set visible(t){this._overrideIfSome("visible",t)}forceInteractiveForViewModel(){return this._interactiveViewModelCount++,$(()=>this._interactiveViewModelCount--)}};return n([h({readOnly:!0})],e.prototype,"type",void 0),n([h({constructOnly:!0})],e.prototype,"analysis",void 0),n([h({constructOnly:!0})],e.prototype,"parent",void 0),n([h({constructOnly:!0})],e.prototype,"view",void 0),n([h({type:Boolean})],e.prototype,"interactive",null),n([h()],e.prototype,"_userInteractive",void 0),n([h({readOnly:!0})],e.prototype,"updating",null),n([h()],e.prototype,"visible",null),n([h()],e.prototype,"_interactiveViewModelCount",void 0),e=n([R("esri.views.3d.analysis.AnalysisView3D")],e),e};function J(a,e,t,r=!1){const s=O(a,e);return s==null?null:(s.hasZ&&!r||t==null||(s.z=M(t,s)??0),s)}function K(a,e,t){t.warnOnce(`Failed to project analysis geometry (id: '${a.id}'), projection from spatial reference (wkid: '${e.wkid}') to view spatial reference is not supported. Projection may be possible after calling projection.load().`)}function W(a){let{r:e,g:t,b:r,a:s}=a;return s<1&&(e=Math.round(s*e+255*(1-s)),t=Math.round(s*t+255*(1-s)),r=Math.round(s*r+255*(1-s))),new _({r:e,g:t,b:r})}function D(a,e){const{r:t,g:r,b:s}=e!=null&&e.ignoreAlpha?a:W(a);return .2126*t+.7152*r+.0722*s}function b(a){return D(a,{ignoreAlpha:!0})>225?new _([0,0,0,a.a]):new _([255,255,255,a.a])}function g(a,e){const t=new _(a);return t.a*=e,t}function B(a=1){return g(y.analysisTheme.accentColor,a)}function L(a=1){return b(B(a))}function Q(a=1){return g(y.analysisTheme.accentColor,a).a}function Y(a=1){return g(y.analysisTheme.textColor,a)}function U(a=1){return b(Y(a))}let Z=class{constructor(e){this._attached=!1,this._resourcesCreated=!1,this._visible=!0,this.view=e,this._handle=j(()=>this.view.ready,t=>{this._resourcesCreated&&(t?this._createResources():this._destroyResources())})}applyProps(e){let t=!1;for(const r in e)r in this?r==="attached"?t=e[r]:this[r]=e[r]:console.error("Cannot set unknown property",r);this.attached=t}destroy(){this.attached=!1,this._handle.remove()}get attached(){return this._attached}set attached(e){e!==this._attached&&this.view._stage&&(this._attached=e,this._attached&&!this._resourcesCreated?this._createResources():!this._attached&&this._resourcesCreated&&this._destroyResources(),this.onAttachedChange(e))}onAttachedChange(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.attached&&this.updateVisibility(e))}_createResources(){this.createResources(),this._resourcesCreated=!0,this.updateVisibility(this.visible)}_destroyResources(){this.destroyResources(),this._resourcesCreated=!1}};class q extends Z{constructor(e){super(e.view),this._resources=null,this._transform=w()}get object(){return this._resources!=null?this._resources.object:null}get transform(){return this._transform}set transform(e){G(this._transform,e),this._resources!=null&&(this._resources.object.transformation=this._transform)}recreate(){this.attached&&this.createResources()}recreateGeometry(){if(this._resources==null)return;const e=this._resources.object,t=this.view._stage;t.removeMany(e.geometries),e.removeAllGeometries(),this.createGeometries(e),e.visible=this.visible,t.addMany(e.geometries)}createResources(){this.destroyResources();const e=this.view._stage;if(!e)return;const t=new x(e,{pickable:!1,updatePolicy:E.SYNC}),r=new V({castShadow:!1});r.transformation=this._transform,this.createExternalResources(),this.createGeometries(r),e.addMany(r.geometries),this.forEachExternalMaterial(s=>e.add(s)),e.add(r),t.add(r),r.visible=this.visible,this._resources={layer:t,object:r}}destroyResources(){const e=this.view._stage;this._resources!=null&&e&&(e.remove(this._resources.object),this._resources.layer.destroy(),this.forEachExternalMaterial(t=>{e.remove(t),t.dispose()}),e.removeMany(this._resources.object.geometries),this._resources.object.dispose(),this.destroyExternalResources(),this._resources=null)}updateVisibility(e){this._resources!=null&&(this._resources.object.visible=e)}}class ee extends q{constructor(e,t){super(e),this._hasExternalMaterial=!1,this._hasExternalMaterial=t!=null,this._material=t??new F({width:1,color:S(1,0,1,1),stippleOffColor:null,stipplePattern:null,stipplePreferContinuous:!0,isClosed:!1,falloff:0,innerColor:null,innerWidth:1,hasPolygonOffset:!1,renderOccluded:H.OccludeAndTransparent,writeDepth:!0}),this.applyProps(e)}setGeometryFromRenderSpacePoint(e,t=1e3){this.geometry=[[[e[0]-t,e[1],e[2]],[e[0]+t,e[1],e[2]]],[[e[0],e[1]-t,e[2]],[e[0],e[1]+t,e[2]]],[[e[0],e[1],e[2]-t],[e[0],e[1],e[2]+t]]]}setGeometryFromExtent(e){const t=this.view.spatialReference,r=c(),s=c(),o=100,i=[];m(r,e[0],e[1],o),this.view.renderCoordsHelper.toRenderCoords(r,t,s),i.push([s[0],s[1],s[2]]),m(r,e[2],e[1],o),this.view.renderCoordsHelper.toRenderCoords(r,t,s),i.push([s[0],s[1],s[2]]),m(r,e[2],e[3],o),this.view.renderCoordsHelper.toRenderCoords(r,t,s),i.push([s[0],s[1],s[2]]),m(r,e[0],e[3],o),this.view.renderCoordsHelper.toRenderCoords(r,t,s),i.push([s[0],s[1],s[2]]),m(r,e[0],e[1],o),this.view.renderCoordsHelper.toRenderCoords(r,t,s),i.push([s[0],s[1],s[2]]),m(r,e[0],e[1],o),this.view.renderCoordsHelper.toRenderCoords(r,t,s),i.push([s[0],s[1],s[2]]),this.geometry=[i]}setGeometryFromFrustum(e){const t=[];e.lines.forEach(r=>{t.push([r.origin[0],r.origin[1],r.origin[2]]),t.push([r.endpoint[0],r.endpoint[1],r.endpoint[2]])}),this.geometry=[t]}setGeometryFromBoundedPlane(e){const t=[],r=e.origin,s=e.basis1,o=e.basis2,i=.5,l=c(),u=c(),d=c(),p=c();l[0]=r[0]-s[0]*i-o[0]*i,l[1]=r[1]-s[1]*i-o[1]*i,l[2]=r[2]-s[2]*i-o[2]*i,u[0]=r[0]-s[0]*i+o[0]*i,u[1]=r[1]-s[1]*i+o[1]*i,u[2]=r[2]-s[2]*i+o[2]*i,d[0]=r[0]+s[0]*i+o[0]*i,d[1]=r[1]+s[1]*i+o[1]*i,d[2]=r[2]+s[2]*i+o[2]*i,p[0]=r[0]+s[0]*i-o[0]*i,p[1]=r[1]+s[1]*i-o[1]*i,p[2]=r[2]+s[2]*i-o[2]*i,t.push([l[0],l[1],l[2]]),t.push([u[0],u[1],u[2]]),t.push([d[0],d[1],d[2]]),t.push([p[0],p[1],p[2]]),t.push([l[0],l[1],l[2]]),this.geometry=[t]}setGeometryFromSegment(e){const t=e.endRenderSpace;this.transform=v(C,t);const{points:r}=e.createRenderGeometry(t,this.view.renderCoordsHelper);this.geometry=[r]}setGeometryFromSegments(e,t=A){this.transform=v(C,t),this.geometry=e.map(r=>r.createRenderGeometry(t,this.view.renderCoordsHelper).points)}getTransformedGeometry(){return this._geometry==null?null:this._geometry.map(e=>e.map(t=>I(c(),t,this.transform)))}get renderOccluded(){return this._material.parameters.renderOccluded}set renderOccluded(e){this._material.setParameters({renderOccluded:e})}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get width(){return this._material.parameters.width}set width(e){this._material.setParameters({width:e})}get color(){return this._material.parameters.color}set color(e){const t=e[3]===1;this._material.setParameters({color:f(e),writeDepth:t})}get innerWidth(){return this._material.parameters.innerWidth}set innerWidth(e){this._material.setParameters({innerWidth:e})}get innerColor(){return this._material.parameters.innerColor}set innerColor(e){this._material.setParameters({innerColor:e!=null?f(e):null})}get stipplePattern(){return this._material.parameters.stipplePattern}set stipplePattern(e){this._material!=null&&this._material.setParameters({stipplePattern:e})}get stippleOffColor(){return this._material.parameters.stippleOffColor}set stippleOffColor(e){this._material.setParameters({stippleOffColor:e!=null?f(e):null})}get stipplePreferContinuous(){return this._material.parameters.stipplePreferContinuous}set stipplePreferContinuous(e){this._material.setParameters({stipplePreferContinuous:e})}get falloff(){return this._material.parameters.falloff}set falloff(e){this._material.setParameters({falloff:e})}get polygonOffset(){return this._material.parameters.hasPolygonOffset}set polygonOffset(e){this._material.setParameters({hasPolygonOffset:e})}createExternalResources(){}destroyExternalResources(){}createGeometries(e){for(const t of T(this.geometry)){const r=k(this._material,t);e.addGeometry(r)}}forEachExternalMaterial(e){this._hasExternalMaterial||e(this._material)}}const C=w();export{K as a,q as b,ee as c,Y as d,N as e,Q as f,B as i,J as r,U as s,Z as t,L as u}; diff --git a/assets/LinkChartLayer-fed775d8.js b/assets/LinkChartLayer-fed775d8.js new file mode 100644 index 0000000..2201c5f --- /dev/null +++ b/assets/LinkChartLayer-fed775d8.js @@ -0,0 +1 @@ +import{eq as se,bL as xt,ai as s,aj as p,al as G,ao as Ee,ck as oe,bc as Ht,cn as mr,aw as at,hf as ot,ar as _,fB as bt,c9 as Jt,c7 as ve,c8 as ce,ak as xe,bz as Te,at as Le,c0 as fr,bd as Vt,eo as Qe,be as Wt,eQ as Kt,eS as Zt,eR as gr,sO as wr,fy as ye,cq as Dt,hi as _r,ca as Ue,cC as br,aA as Xt,aF as Gt,bM as Rt,ax as Tr}from"./index-080e108a.js";import{p as de}from"./geohashUtils-77d8429b.js";import{e as St}from"./sql-734ecbc5.js";import{b as fe}from"./Query-1c961d4c.js";import"./UniqueValueRenderer-fef4204d.js";import{t as Je,p as Er}from"./jsonUtils-f73b3833.js";import{m as kr}from"./FeatureStore-f0e312fc.js";import{e as Mr}from"./QueryEngine-19eda5ff.js";import{c as Ir,o as Ve}from"./clientSideDefaults-ab04bd90.js";import{s as Cr}from"./fieldProperties-62c55499.js";import{n as Lr}from"./FeatureReductionLayer-4262cf54.js";import{d as vr}from"./FeatureSet-111cb247.js";import{p as xr}from"./popupUtils-82ea8abb.js";import"./diffUtils-590c9088.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./BoundsStore-b6bd3c14.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./defaultsJSON-59981e75.js";import"./commonProperties-30089b06.js";import"./featureLayerUtils-6cf06f83.js";import"./AttachmentQuery-972bbd60.js";import"./RelationshipQuery-39c07195.js";import"./LabelClass-2d53c485.js";import"./defaults-34554cbf.js";const Dr="ESRI__DESTINATION_ID",Gr="ESRI__ORIGIN_ID";let We=class le{constructor(){this._featureLookup=new Map}static getInstance(){return le.instance||(le.instance=new le),le.instance}static resetInstance(){le.instance&&(le.instance=null)}deleteFromStore(t){t.forEach(r=>{this._featureLookup.delete(r)})}readFromStoreByList(t){const r=[];return t.forEach(n=>{const i=this.readFromStoreById(n);i&&r.push(i)}),r}readFromStoreById(t){return this._featureLookup.get(t)??null}writeToStore(t,r,n){const i=[];return t.forEach(o=>{if(!o||!o.id)return;o.properties||(o.properties=[]);let a,l=null;if(n&&(l=o.properties[n]?se(o.properties[n]):null),"originId"in o&&"destinationId"in o&&(o.properties[Gr]=o.originId,o.properties[Dr]=o.destinationId),o.properties[r]=o.id,o.id&&this._featureLookup.has(o.id)&&this._featureLookup.get(o.id).attributes){const d=this._featureLookup.get(o.id);a=new xt(l?JSON.parse(JSON.stringify(l)):d!=null&&d.geometry?JSON.parse(JSON.stringify(d.geometry)):null,JSON.parse(JSON.stringify(Object.assign(d.attributes,o.properties))),null,o.properties[r])}else a=new xt(l?JSON.parse(JSON.stringify(l)):null,o.properties,null,o.properties[r]);this._featureLookup.set(o.id,a),i.push(a)}),i}},Ne=class extends Ee{constructor(t){super(t),this.resultRows=[]}};s([p()],Ne.prototype,"resultRows",void 0),Ne=s([G("esri.rest.knowledgeGraph.GraphQueryResult")],Ne);const $t=Ne;let Pe=class extends Ee{constructor(t){super(t),this.resultRowsStream=new ReadableStream}};s([p()],Pe.prototype,"resultRowsStream",void 0),Pe=s([G("esri.rest.knowledgeGraph.GraphQueryResult")],Pe);const Nt=Pe;let ie=class extends oe{constructor(t){super(t),this.name=null,this.unique=null,this.ascending=null,this.description=null,this.fieldNames=null}};s([p({type:String,json:{write:!0}})],ie.prototype,"name",void 0),s([p({type:Boolean,json:{write:!0}})],ie.prototype,"unique",void 0),s([p({type:Boolean,json:{write:!0}})],ie.prototype,"ascending",void 0),s([p({type:String,json:{write:!0}})],ie.prototype,"description",void 0),s([p({type:[String],json:{write:!0}})],ie.prototype,"fieldNames",void 0),ie=s([G("esri.rest.knowledgeGraph.FieldIndex")],ie);const er=ie;let F=class extends oe{constructor(t){super(t),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=null,this.required=null,this.defaultVisibility=null,this.systemMaintained=null,this.role=null,this.defaultValue=null}};s([p({type:String,json:{write:!0}})],F.prototype,"name",void 0),s([p({type:String,json:{write:!0}})],F.prototype,"alias",void 0),s([p({type:String,json:{write:!0}})],F.prototype,"fieldType",void 0),s([p({type:String,json:{write:!0}})],F.prototype,"geometryType",void 0),s([p({type:Boolean,json:{write:!0}})],F.prototype,"hasM",void 0),s([p({type:Boolean,json:{write:!0}})],F.prototype,"hasZ",void 0),s([p({type:Boolean,json:{write:!0}})],F.prototype,"nullable",void 0),s([p({type:Boolean,json:{write:!0}})],F.prototype,"editable",void 0),s([p({type:Boolean,json:{write:!0}})],F.prototype,"required",void 0),s([p({type:Boolean,json:{write:!0}})],F.prototype,"defaultVisibility",void 0),s([p({type:Boolean,json:{write:!0}})],F.prototype,"systemMaintained",void 0),s([p()],F.prototype,"role",void 0),s([p({type:Object,json:{type:String,write:{writer:(e,t)=>{t.defaultValue=e!=null?e.toString():null}}}})],F.prototype,"defaultValue",void 0),F=s([G("esri.rest.knowledgeGraph.GraphProperty")],F);const tr=F;let re=class extends oe{constructor(t){super(t),this.name=null,this.alias=null,this.role=null,this.strict=null,this.properties=null,this.fieldIndexes=null}};s([p({type:String,json:{write:!0}})],re.prototype,"name",void 0),s([p({type:String,json:{write:!0}})],re.prototype,"alias",void 0),s([p({type:String,json:{write:!0}})],re.prototype,"role",void 0),s([p({type:Boolean,json:{write:!0}})],re.prototype,"strict",void 0),s([p({type:[tr],json:{write:!0}})],re.prototype,"properties",void 0),s([p({type:[er],json:{write:!0}})],re.prototype,"fieldIndexes",void 0),re=s([G("esri.rest.knowledgeGraph.GraphObjectType")],re);const rr=re;let st=class extends rr{constructor(t){super(t)}};st=s([G("esri.rest.knowledgeGraph.EntityType")],st);const Tt=st;let je=class extends rr{constructor(t){super(t),this.endPoints=[]}};s([p()],je.prototype,"endPoints",void 0),je=s([G("esri.rest.knowledgeGraph.RelationshipType")],je);const Et=je;let J=class extends oe{constructor(t){super(t),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=null,this.entityTypes=null,this.relationshipTypes=null}};s([p({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.timestamp=e==null?void 0:e.getTime()}}}})],J.prototype,"timestamp",void 0),s([p({type:Ht,json:{write:!0}})],J.prototype,"spatialReference",void 0),s([p({type:Boolean,json:{write:!0}})],J.prototype,"strict",void 0),s([p({type:String,json:{write:!0}})],J.prototype,"objectIdField",void 0),s([p({type:String,json:{write:!0}})],J.prototype,"globalIdField",void 0),s([p()],J.prototype,"arcgisManaged",void 0),s([p()],J.prototype,"identifierInfo",void 0),s([p()],J.prototype,"searchIndexes",void 0),s([p({type:[Tt],json:{write:!0}})],J.prototype,"entityTypes",void 0),s([p({type:[Et],json:{write:!0}})],J.prototype,"relationshipTypes",void 0),J=s([G("esri.rest.knowledgeGraph.DataModel")],J);const nr=J;let P=class extends oe{constructor(t){super(t),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1}};s([p({type:[String],json:{write:!0}})],P.prototype,"capabilities",void 0),s([p({type:Boolean,json:{write:!0}})],P.prototype,"supportsSearch",void 0),s([p({type:[String],json:{write:!0}})],P.prototype,"supportedQueryFormats",void 0),s([p({type:Boolean,json:{write:!0}})],P.prototype,"allowGeometryUpdates",void 0),s([p({type:Number,json:{write:!0}})],P.prototype,"searchMaxRecordCount",void 0),s([p({type:Object,json:{write:!0}})],P.prototype,"serviceCapabilities",void 0),s([p({type:Number,json:{write:!0}})],P.prototype,"maxRecordCount",void 0),s([p({type:String,json:{write:!0}})],P.prototype,"description",void 0),s([p({type:String,json:{write:!0}})],P.prototype,"copyrightText",void 0),s([p({type:String,json:{write:!0}})],P.prototype,"units",void 0),s([p({type:Object,json:{write:!0}})],P.prototype,"spatialReference",void 0),s([p({type:Number,json:{write:!0}})],P.prototype,"currentVersion",void 0),s([p({type:Object,json:{write:!0}})],P.prototype,"dateFieldsTimeReference",void 0),s([p({type:String,json:{write:!0}})],P.prototype,"serviceItemId",void 0),s([p({type:Boolean,json:{write:!0}})],P.prototype,"supportsDocuments",void 0),s([p({type:Boolean,json:{write:!0}})],P.prototype,"dataEditingNotSupported",void 0),s([p({type:Boolean,json:{write:!0}})],P.prototype,"schemaEditingNotSupported",void 0),P=s([G("esri.rest.knowledgeGraph.ServiceDefinition")],P);const ir=P;let ge=class extends oe{constructor(t){super(t),this.dataModel=null,this.serviceDefinition=null}};s([p({type:String,json:{write:!0}})],ge.prototype,"url",void 0),s([p({type:nr,json:{write:!0}})],ge.prototype,"dataModel",void 0),s([p({type:ir,json:{write:!0}})],ge.prototype,"serviceDefinition",void 0),ge=s([G("esri.rest.knowledgeGraph.KnowledgeGraph")],ge);const Rr=ge,Pt="esri/rest/knowledgeGraph/wasmInterface/";let Ke;async function ae(){const e=Ke;if(e)return e;const t=mr("wasm-simd");return Ke=Sr(t),Ke}async function Sr(e){if(e){const{default:r}=await at(()=>import("./arcgis-knowledge-client-core-simd-37b35211.js"),["assets/arcgis-knowledge-client-core-simd-37b35211.js","assets/index-080e108a.js","assets/index-a8e73b5e.css"]).then(n=>n.a);return r({locateFile:n=>ot(Pt+n)})}const{default:t}=await at(()=>import("./arcgis-knowledge-client-core-59a3e261.js"),["assets/arcgis-knowledge-client-core-59a3e261.js","assets/index-080e108a.js","assets/index-a8e73b5e.css"]).then(r=>r.a);return t({locateFile:r=>ot(Pt+r)})}function ar(e,t){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(n=>{r.add_value(Mt(n,t))}),r}function or(e,t){const r=new t.ObjectValue;r.deleteLater();for(const[n,i]of Object.entries(e))r.set_key_value(n,Mt(i,t));return r}function kt(e,t){if(e instanceof Jt)return jr(e,t);if(e instanceof ve)return Or(e,t);if(e instanceof ce||e instanceof xe)return Pr(e,t);throw new _("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function $r(e,t){t.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function Nr(e,t,r){if(!e.extent)throw new _("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new _("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new _("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);t.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:r.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}function Mt(e,t){if(e==null)return"";if(typeof e!="object"||e instanceof Date)return e;if(e instanceof bt)return kt(e,t);if(Array.isArray(e)){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(n=>{r.add_value(Mt(n,t))}),r}return or(e,t)}function Pr(e,t){const r=new t.GeometryValue;r.deleteLater(),r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],i=[];let o=[];e instanceof ce?(r.geometry_type=t.esriGeometryType.esriGeometryPolyline,o=e.paths):e instanceof xe&&(r.geometry_type=t.esriGeometryType.esriGeometryPolygon,o=e.rings);let a=0,l=0;return o.forEach(d=>{let u=0;d.forEach(y=>{u++,y.forEach(m=>{n[l]=m,l++})}),i[a]=u,a++}),r.coords=new Float64Array(n),r.lengths=new Uint32Array(i),r}function jr(e,t){const r=new t.GeometryValue;r.deleteLater(),r.geometry_type=r.geometry_type=t.esriGeometryType.esriGeometryMultipoint,r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],i=[];i[0]=e.points.length;let o=0;return e.points.forEach(a=>{a.forEach(l=>{n[o]=l,o++})}),r.coords=new Float64Array(n),r.lengths=new Uint32Array(i),r}function Or(e,t){const r=new t.GeometryValue;r.deleteLater(),r.geometry_type=t.esriGeometryType.esriGeometryPoint,r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],i=[];i[0]=1,n[0]=e.x,n[1]=e.y;let o=2;return e.hasZ&&(n[o]=e.z,o++),e.hasM&&(n[o]=e.m,o++),r.coords=new Float64Array(n),r.lengths=new Uint32Array(i),r}let Oe=class extends oe{constructor(t){super(t),this.properties=null}};s([p({json:{write:!0}})],Oe.prototype,"properties",void 0),Oe=s([G("esri.rest.knowledgeGraph.GraphObject")],Oe);const It=Oe;let Ce=class extends It{constructor(t){super(t),this.typeName=null,this.id=null}};s([p({type:String,json:{write:!0}})],Ce.prototype,"typeName",void 0),s([p({type:String,json:{write:!0}})],Ce.prototype,"id",void 0),Ce=s([G("esri.rest.knowledgeGraph.GraphNamedObject")],Ce);const sr=Ce;let Fe=class extends sr{constructor(t){super(t),this.layoutGeometry=null}};s([p({type:ve,json:{write:!0}})],Fe.prototype,"layoutGeometry",void 0),Fe=s([G("esri.rest.knowledgeGraph.Entity")],Fe);const lr=Fe;let we=class extends sr{constructor(t){super(t),this.originId=null,this.destinationId=null,this.layoutGeometry=null}};s([p({type:String,json:{write:!0}})],we.prototype,"originId",void 0),s([p({type:String,json:{write:!0}})],we.prototype,"destinationId",void 0),s([p({type:ce,json:{write:!0}})],we.prototype,"layoutGeometry",void 0),we=s([G("esri.rest.Relationship.Relationship")],we);const pr=we;function Re(e,t){if(!e.typeName)throw new _("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(e instanceof lr){const r=new t.EntityValue;r.deleteLater(),r.type_name=e.typeName;for(const[n,i]of Object.entries(e.properties))r.set_key_value(n,jt(i,t));return e.id&&r.set_id(e.id),r}if(e instanceof pr){const r=new t.RelationshipValue;r.deleteLater(),r.type_name=e.typeName;for(const[n,i]of Object.entries(e.properties))r.set_key_value(n,jt(i,t));return e.id&&r.set_id(e.id),e.originId&&e.destinationId&&r.set_related_entity_ids(e.originId,e.destinationId),r}throw new _("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function Fr(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function jt(e,t){return e==null?"":typeof e!="object"||e instanceof Date?e:e instanceof bt?kt(e,t):""}let pe=class extends Ee{constructor(t){super(t),this.name=null,this.supportedCategory=null,this.analyzers=[],this.searchProperties=new Map}};s([p()],pe.prototype,"name",void 0),s([p()],pe.prototype,"supportedCategory",void 0),s([p()],pe.prototype,"analyzers",void 0),s([p()],pe.prototype,"searchProperties",void 0),pe=s([G("esri.rest.knowledgeGraph.SearchIndex")],pe);const Ar=pe;var qe,Ye,Be,lt,pt,dt,ut;(function(e){e[e.Regular=0]="Regular",e[e.Provenance=1]="Provenance",e[e.Document=2]="Document"})(qe||(qe={})),function(e){e[e.esriFieldTypeSmallInteger=0]="esriFieldTypeSmallInteger",e[e.esriFieldTypeInteger=1]="esriFieldTypeInteger",e[e.esriFieldTypeSingle=2]="esriFieldTypeSingle",e[e.esriFieldTypeDouble=3]="esriFieldTypeDouble",e[e.esriFieldTypeString=4]="esriFieldTypeString",e[e.esriFieldTypeDate=5]="esriFieldTypeDate",e[e.esriFieldTypeOID=6]="esriFieldTypeOID",e[e.esriFieldTypeGeometry=7]="esriFieldTypeGeometry",e[e.esriFieldTypeBlob=8]="esriFieldTypeBlob",e[e.esriFieldTypeRaster=9]="esriFieldTypeRaster",e[e.esriFieldTypeGUID=10]="esriFieldTypeGUID",e[e.esriFieldTypeGlobalID=11]="esriFieldTypeGlobalID",e[e.esriFieldTypeXML=12]="esriFieldTypeXML",e[e.esriFieldTypeBigInteger=13]="esriFieldTypeBigInteger"}(Ye||(Ye={})),function(e){e[e.esriGeometryNull=0]="esriGeometryNull",e[e.esriGeometryPoint=1]="esriGeometryPoint",e[e.esriGeometryMultipoint=2]="esriGeometryMultipoint",e[e.esriGeometryPolyline=3]="esriGeometryPolyline",e[e.esriGeometryPolygon=4]="esriGeometryPolygon",e[e.esriGeometryEnvelope=5]="esriGeometryEnvelope",e[e.esriGeometryAny=6]="esriGeometryAny",e[e.esriGeometryMultiPatch=7]="esriGeometryMultiPatch"}(Be||(Be={})),function(e){e[e.esriMethodHintUNSPECIFIED=0]="esriMethodHintUNSPECIFIED",e[e.esriUUIDESRI=1]="esriUUIDESRI",e[e.esriUUIDRFC4122=2]="esriUUIDRFC4122"}(lt||(lt={})),function(e){e[e.esriTypeUNSPECIFIED=0]="esriTypeUNSPECIFIED",e[e.esriTypeEntity=1]="esriTypeEntity",e[e.esriTypeRelationship=2]="esriTypeRelationship",e[e.esriTypeBoth=4]="esriTypeBoth"}(pt||(pt={})),function(e){e[e.esriGraphPropertyUNSPECIFIED=0]="esriGraphPropertyUNSPECIFIED",e[e.esriGraphPropertyRegular=1]="esriGraphPropertyRegular",e[e.esriGraphPropertyDocumentName=2]="esriGraphPropertyDocumentName",e[e.esriGraphPropertyDocumentTitle=3]="esriGraphPropertyDocumentTitle",e[e.esriGraphPropertyDocumentUrl=4]="esriGraphPropertyDocumentUrl",e[e.esriGraphPropertyDocumentText=5]="esriGraphPropertyDocumentText",e[e.esriGraphPropertyDocumentKeywords=6]="esriGraphPropertyDocumentKeywords",e[e.esriGraphPropertyDocumentContentType=7]="esriGraphPropertyDocumentContentType",e[e.esriGraphPropertyDocumentMetadata=8]="esriGraphPropertyDocumentMetadata",e[e.esriGraphPropertyDocumentFileExtension=9]="esriGraphPropertyDocumentFileExtension"}(dt||(dt={})),function(e){e[e.esriIdentifierInfoTypeUNSPECIFIED=0]="esriIdentifierInfoTypeUNSPECIFIED",e[e.esriIdentifierInfoTypeDatabaseNative=1]="esriIdentifierInfoTypeDatabaseNative",e[e.esriIdentifierInfoTypeUniformProperty=2]="esriIdentifierInfoTypeUniformProperty"}(ut||(ut={}));function zr(e){var t,r,n,i,o,a,l,d,u,y,m;return e.deleteLater(),new nr({timestamp:e.timestamp,spatialReference:new Ht(e.spatial_reference),strict:e.strict,objectIdField:e.objectid_property,globalIdField:e.globalid_property,arcgisManaged:e.arcgis_managed,identifierInfo:{identifierMappingInfo:{identifierInfoType:ut[(n=(r=(t=e.identifier_info)==null?void 0:t.identifier_mapping_info)==null?void 0:r.identifier_info_type)==null?void 0:n.value],databaseNativeIdentifier:(o=(i=e.identifier_info)==null?void 0:i.identifier_mapping_info)==null?void 0:o.database_native_identifier,uniformPropertyIdentifier:{identifierPropertyName:(d=(l=(a=e.identifier_info)==null?void 0:a.identifier_mapping_info)==null?void 0:l.uniform_property_identifier)==null?void 0:d.identifier_property_name}},identifierGenerationInfo:{uuidMethodHint:lt[(m=(y=(u=e.identifier_info)==null?void 0:u.identifier_generation_info)==null?void 0:y.uuid_method_hint)==null?void 0:m.value]}},searchIndexes:Kr(e.search_indexes),entityTypes:Br(e.entity_types),relationshipTypes:Wr(e.relationship_types)})}function Qr(e){return e.deleteLater(),new Tt(dr(e))}function Ur(e){return e.deleteLater(),new er({name:e.name,unique:e.unique,ascending:e.ascending,description:e.description,fieldNames:Hr(e.fields)})}function dr(e){return{name:e.name,alias:e.alias,role:qe[e.role.value]?qe[e.role.value]:null,strict:e.strict,properties:Jr(e.properties),fieldIndexes:Vr(e.field_indexes)}}function qr(e){return e.deleteLater(),new tr({alias:e.alias,name:e.name,fieldType:Ye[e.field_type.value]?Ye[e.field_type.value]:null,geometryType:Be[e.geometry_type.value]?Be[e.geometry_type.value]:null,hasM:e.has_m,hasZ:e.has_z,nullable:e.nullable,editable:e.editable,required:e.required,defaultVisibility:e.default_visibility,systemMaintained:e.system_maintained,role:dt[e.role.value],defaultValue:e.default_value})}function Yr(e){e.deleteLater();const t=dr(e),r=[];for(let n=0;n{const d=[];for(let u=0;u{if(e==null)return null;if(typeof e!="object"||"getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case W.ESRI_GEOMETRY_POINT:return tn(e);case W.ESRI_GEOMETRY_MULTIPOINT:return en(e);case W.ESRI_GEOMETRY_POLYLINE:return rn(e);case W.ESRI_GEOMETRY_POLYGON:return nn(e);case W.ESRI_GEOMETRY_ENVELOPE:case W.ESRI_GEOMETRY_MULTI_PATCH:return Se.warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;case W.ESRI_GEOMETRY_NULL:case W.ESRI_GEOMETRY_ANY:default:return Se.warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return Se.warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case ue.OBJECT:return sn(e,t);case ue.ENTITY:return hr(e,t);case ue.RELATIONSHIP:return cr(e,t);case ue.PATH:return ln(e,t);case ue.ARRAY:return on(e,t);default:return Se.warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}}};function on(e,t){const r=[],n=e.count();for(let i=0;i{const t=new Rr({url:e}),r=[];return r.push(He(t)),r.push(hn(t)),await Promise.all(r),t},refreshDataModel:async e=>{e.dataModel=await yr(e)},refreshServiceDefinition:async e=>{var r,n;const t=(await Le(e.url,{query:{f:"json"}})).data;return t.capabilities=(r=t==null?void 0:t.capabilities)==null?void 0:r.split(","),t.supportedQueryFormats=(n=t==null?void 0:t.supportedQueryFormats)==null?void 0:n.split(","),e.serviceDefinition=new ir(t),e.serviceDefinition},executeQueryStreaming:async(e,t,r)=>{const n=`${e.url}/graph/query`;await et(e);const i=await tt(n,r);i.data.body=await mn(t,e);const o=await Xe(i.data.url,i.data);if(e.dataModel)return new Nt({resultRowsStream:await Ft(o,e.dataModel)});throw new _("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,t,r)=>{var o;if((o=e.serviceDefinition)!=null&&o.dataEditingNotSupported)throw new _("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await et(e);const i=await tt(n,r);return i.data.body=await yn(t,e),gn(await Xe(i.data.url,i.data))},executeQuery:async(e,t,r)=>{var l;const n=`${e.url}/graph/query`,i=await Le(n,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:t.openCypherQuery,...r==null?void 0:r.query},signal:r==null?void 0:r.signal,timeout:r==null?void 0:r.timeout}),o=(l=i.getHeader)==null?void 0:l.call(i,"content-type"),a=i.data;if(o!=null&&o.includes("application/x-protobuf")){const d=new(await ae()).GraphQueryDecoder;if(d.deleteLater(),e.dataModel)return new $t({resultRows:ct(d,a,e.dataModel)});throw new _("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new _("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:i.data})},executeSearch:async(e,t,r)=>{var d;const n=t.typeCategoryFilter,i=`${e.url}/graph/search`,o=await Le(i,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${t.searchQuery}"`,typeCategoryFilter:n,...r==null?void 0:r.query},signal:r==null?void 0:r.signal,timeout:r==null?void 0:r.timeout}),a=(d=o.getHeader)==null?void 0:d.call(o,"content-type"),l=o.data;if(a!=null&&a.includes("application/x-protobuf")){const u=new(await ae()).GraphQueryDecoder;if(u.deleteLater(),e.dataModel)return new $t({resultRows:ct(u,l,e.dataModel)});throw new _("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new _("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:a,data:o.data})},executeSearchStreaming:async(e,t,r)=>{const n=`${e.url}/graph/search`;await et(e);const i=await tt(n,r);i.data.body=await fn(t);const o=await Xe(i.data.url,i.data);if(e.dataModel)return new Nt({resultRowsStream:await Ft(o,e.dataModel)});throw new _("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},_fetchWrapper:async(e,t)=>fetch(e,t)};async function Ze(e,t,r){return De.executeQueryStreaming(e,t,r)}async function un(e){return De.fetchKnowledgeGraph(e)}async function He(e){return De.refreshDataModel(e)}async function hn(e){return De.refreshServiceDefinition(e)}async function Xe(e,t){return De._fetchWrapper(e,t)}async function et(e){var r;((r=fr)==null?void 0:r.findCredential(e.url))||(e.dataModel?await yr(e):await He(e))}function Me(e,t,r){if(e.error_code!==0)throw new _(t,r,{errorCode:e.error_code,errorMessage:e.error_message})}function cn(e,t,r,n){t==null?r.set_param_key_value(e,""):typeof t!="object"||t instanceof Date?r.set_param_key_value(e,t):t instanceof bt?r.set_param_key_value(e,kt(t,n)):t instanceof Array?r.set_param_key_value(e,ar(t,n)):r.set_param_key_value(e,or(t,n))}async function yn(e,t){var a,l,d,u,y,m,g,f,I;if(t.dataModel||await He(t),!t.dataModel)throw new _("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const r=await ae(),n=!!((a=e.options)!=null&&a.cascadeDelete),i=new r.GraphApplyEditsEncoder(r.SpatialReferenceUtil.WGS84(),(l=e.options)!=null&&l.inputQuantizationParameters?Fr((d=e.options)==null?void 0:d.inputQuantizationParameters):r.InputQuantizationUtil.WGS84_lossless());i.deleteLater(),i.cascade_delete=n;try{let b;(u=e.entityAdds)==null||u.forEach(h=>{b=i.add_entity(Re(h,r)),Me(b,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),(y=e.relationshipAdds)==null||y.forEach(h=>{if(!h.originId||!h.destinationId)throw new _("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");b=i.add_relationship(Re(h,r)),Me(b,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),(m=e.entityUpdates)==null||m.forEach(h=>{if(!h.id)throw new _("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");b=i.update_entity(Re(h,r)),Me(b,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),(g=e.relationshipUpdates)==null||g.forEach(h=>{if(!h.id)throw new _("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");b=i.update_relationship(Re(h,r)),Me(b,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),(f=e.entityDeletes)==null||f.forEach(h=>{var L;if(!h.typeName)throw new _("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const w=i.make_delete_helper(h.typeName,!0);w.deleteLater(),(L=h.ids)==null||L.forEach(O=>{w.delete_by_id(O)})}),(I=e.relationshipDeletes)==null||I.forEach(h=>{var L;if(!h.typeName)throw new _("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const w=i.make_delete_helper(h.typeName,!1);(L=h.ids)==null||L.forEach(O=>{w.delete_by_id(O)})}),i.encode()}catch(b){throw new _("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:b})}const o=i.get_encoding_result();return Me(o.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),o.get_byte_buffer()}async function mn(e,t){var o,a;const r=await ae(),n=new r.GraphQueryRequestEncoder;if(n.deleteLater(),n.output_spatial_reference=r.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[l,d]of Object.entries(e.bindParameters))cn(l,d,n,r);if(e.bindGeometryQuantizationParameters)$r(e.bindGeometryQuantizationParameters,n);else{if(t.dataModel||await He(t),((a=(o=t.dataModel)==null?void 0:o.spatialReference)==null?void 0:a.wkid)!==4326)throw new _("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=r.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&Nr(e.outputQuantizationParameters,n,r);try{n.encode()}catch(l){throw new _("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:l})}const i=n.get_encoding_result();if(i.error.error_code!==0)throw new _("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:i.error.error_code,errorMessage:i.error.error_message});return i.get_byte_buffer()}async function fn(e){var i;const t=await ae(),r=new t.GraphSearchRequestEncoder;if(r.deleteLater(),r.search_query=e.searchQuery,r.type_category_filter=t.esriNamedTypeCategory[e.typeCategoryFilter],e.returnSearchContext===!0&&(r.return_search_context=e.returnSearchContext),e.start!=null&&e.start>0&&(r.start_index=e.start),e.num!=null&&(r.max_num_results=e.num),e.idsFilter!=null&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{r.set_ids_filter(ar(e.idsFilter,t))}catch(o){throw new _("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:o})}(i=e.namedTypesFilter)==null||i.forEach(o=>{r.add_named_type_filter(o)});try{r.encode()}catch(o){throw new _("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:o})}const n=r.get_encoding_result();if(n.error.error_code!==0)throw new _("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return n.get_byte_buffer()}async function tt(e,t){return Le(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...t==null?void 0:t.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:t==null?void 0:t.signal,timeout:t==null?void 0:t.timeout})}async function gn(e){const t=e.headers.get("content-type");if(t!=null&&t.includes("application/x-protobuf")){const r=await e.arrayBuffer(),n=new(await ae()).GraphApplyEditsDecoder;return n.deleteLater(),n.decode(new Uint8Array(r)),dn(n)}throw new _("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:t,data:e.text()})}function ct(e,t,r){e.push_buffer(new Uint8Array(t));const n=[];let i=0;for(;e.next_row();){i||(i=e.get_header_keys().size());const o=new Array(i);for(let a=0;a{if(d){let m;if(o.has_error()&&(m=new _("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded",{errorCode:o.error.error_code,errorMessage:o.error.error_message})),i.releaseLock(),m)throw a.error(m),m;return void a.close()}const y=ct(o,u,t);return y.length>0&&a.enqueue(y),l()})}}})}throw new _("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:r,data:e.text()})}async function yr(e){var o;const t=`${e.url}/dataModel/queryDataModel`,r=await Le(t,{responseType:"array-buffer",query:{f:"pbf"}}),n=(o=r.getHeader)==null?void 0:o.call(r,"content-type"),i=r.data;if(n!=null&&n.includes("application/x-protobuf")){const a=(await ae()).decode_data_model_from_protocol_buffer(new Uint8Array(i));if(!a)throw new _("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return zr(a)}throw new _("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:r.data})}let ze=class extends Ee{constructor(t){super(t),this.openCypherQuery=""}};s([p()],ze.prototype,"openCypherQuery",void 0),ze=s([G("esri.rest.knowledgeGraph.GraphQuery")],ze);const wn=ze;let be=class extends wn{constructor(t){super(t),this.bindParameters=null,this.bindGeometryQuantizationParameters=null,this.outputQuantizationParameters=null}};s([p()],be.prototype,"bindParameters",void 0),s([p()],be.prototype,"bindGeometryQuantizationParameters",void 0),s([p()],be.prototype,"outputQuantizationParameters",void 0),be=s([G("esri.rest.knowledgeGraph.GraphQueryStreaming")],be);const $e=be,x="ESRI__ID",Ie="ESRI__ORIGIN_ID",rt="ESRI__DESTINATION_ID",j="ESRI__LAYOUT_GEOMETRY",he=12,At=Te.getLogger("esri.rest.knowledgeGraph.knowledgeGraphLayer.KnowledgeGraphLayerDataManager");let ne=class extends Ee{constructor(t){var n,i,o;super(t),this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this._processingCacheUpdatesLookup=new Map,this._memberIdTypeLookup=new Map;const r=new Map;(n=t.knowledgeGraph.dataModel.entityTypes)==null||n.forEach(a=>{var l,d;a.name&&(r.set(a.name,"entity"),this._processingCacheUpdatesLookup.set(a.name,[]),t.inclusionModeDefinition&&!((l=t.inclusionModeDefinition)!=null&&l.generateAllSublayers)||this.entityTypeNames.add(a.name),(d=a.properties)==null||d.forEach(u=>{u.geometryType&&u.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(a.name,{name:u.name??"",geometryType:u.geometryType})}))}),(i=t.knowledgeGraph.dataModel.relationshipTypes)==null||i.forEach(a=>{var l,d;a.name&&(r.set(a.name,"relationship"),this._processingCacheUpdatesLookup.set(a.name,[]),t.inclusionModeDefinition&&!((l=t.inclusionModeDefinition)!=null&&l.generateAllSublayers)||this.relationshipTypeNames.add(a.name),(d=a.properties)==null||d.forEach(u=>{u.geometryType&&u.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(a.name,{name:u.name??"",geometryType:u.geometryType})}))}),(o=t.inclusionModeDefinition)==null||o.namedTypeDefinitions.forEach((a,l)=>{var u,y;if(r.get(l)==="entity")this.entityTypeNames.add(l);else{if(r.get(l)!=="relationship")return At.warn(`A named type, ${l}, was in the inclusion list that wasn't in the data model and will be removed`),void((u=t.inclusionModeDefinition)==null?void 0:u.namedTypeDefinitions.delete(l));this.relationshipTypeNames.add(l)}const d=new Map;(y=a.members)==null||y.forEach(m=>{this._memberIdTypeLookup.set(m.id,l);const g=this.getById(m.id);g&&d.set(m.id,g)}),this.sublayerCaches.set(l,d)})}addToLayerInclusionSet(t){t.forEach(({typeName:r,id:n})=>{if(!this.inclusionModeDefinition)throw new _("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(r)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(r)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(r);if(i.useAllData)throw new _("knowledge-graph:layer-data-manager","You cannot add members to an exclusion list for a sublayer where the sublayer is set to always retrieve its entire data set");i.members||(i.members=new Map),i.members.set(n,{id:n}),this._memberIdTypeLookup.set(n,r)}}else{const i=new Map;i.set(n,{id:n}),this.inclusionModeDefinition.namedTypeDefinitions.set(r,{useAllData:!1,members:i}),this._memberIdTypeLookup.set(n,r)}})}getById(t){return We.getInstance().readFromStoreById(t)}async getData(t,r,n){var o,a;if(r.objectType.name&&((o=this.inclusionModeDefinition)!=null&&o.namedTypeDefinitions)&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(r.objectType.name))return[];let i;if(i=t||new fe({where:"1=1",outFields:["*"]}),r.parentCompositeLayer.type==="link-chart"){const l=r.parentCompositeLayer,d=this._processingCacheUpdatesLookup.get(r.objectType.name??""),u=i.outFields,y=i.geometry;let m="",g="";y&&y.extent&&(m=de(y.extent.ymin,y.extent.xmin,he),g=de(y.extent.ymax,y.extent.xmax,he)),u&&u.length===1&&u[0]===x&&i.where==="1=1"||await Promise.all(d??[]);const f=this.sublayerCaches.has(r.objectType.name??"")?Array.from((a=this.sublayerCaches.get(r.objectType.name))==null?void 0:a.values()):[],I=[];return f.forEach(b=>{if(b.geometry=l.linkChartDiagramLookup.get(b.attributes[r.objectIdField]),b.attributes[j]=b.geometry,m&&g){const h=l.linkChartGeohashLookup.get(b.attributes[r.objectIdField]);h?h>=m&&h<=g&&I.push(b):I.push(b)}else I.push(b)}),I}return this.retrieveDataFromService(i,r,n)}async getConnectedRecordIds(t){const r=[],n=[],i=new Map;return t.forEach(o=>{var a;if(this._memberIdTypeLookup.has(o)){const l=this._memberIdTypeLookup.get(o);if(!this.entityTypeNames.has(l))return;i.has(l)?(a=i.get(l))==null||a.push(o):i.set(l,[o])}}),i.forEach((o,a)=>{const l=`MATCH (n:${a})-[r]-(m) WHERE id(n) IN $ids RETURN id(r), type(r), id(m), labels(m)[0]`,d=new Promise(u=>{(async()=>{const y=(await Ze(this.knowledgeGraph,new $e({openCypherQuery:l,bindParameters:{ids:o}}))).resultRowsStream.getReader();try{for(;;){const{done:m,value:g}=await y.read();if(m)break;for(let f=0;f{u()})});n.push(d)}),await Promise.all(n),r}async refreshCacheContent(t,r,n,i=!0){var u,y,m,g,f,I,b;const o=We.getInstance(),a=[],l=new Map,d=new Map;(u=this.knowledgeGraph.dataModel.entityTypes)==null||u.forEach(h=>{h.name&&d.set(h.name,h)}),(y=this.knowledgeGraph.dataModel.relationshipTypes)==null||y.forEach(h=>{h.name&&d.set(h.name,h)}),t||this.inclusionModeDefinition?t?t.forEach(h=>{var w;if(this._memberIdTypeLookup.has(h)){const L=this._memberIdTypeLookup.get(h);l.has(L)?(w=l.get(L))==null||w.push(h):l.set(L,[h])}}):(g=(m=this.inclusionModeDefinition)==null?void 0:m.namedTypeDefinitions)==null||g.forEach((h,w)=>{h.useAllData?l.set(w,null):h.members&&h.members.forEach(L=>{var O;l.has(w)&&l.get(w)!==null?(O=l.get(w))==null||O.push(L.id):l.set(w,[L.id])})}):((f=this.knowledgeGraph.dataModel.entityTypes)==null||f.forEach(h=>{h.name&&l.set(h.name,null)}),(I=this.knowledgeGraph.dataModel.entityTypes)==null||I.forEach(h=>{h.name&&l.set(h.name,null)}));for(const[h,w]of l){const L=new Promise(O=>{(async()=>{var V,M,R,z,S,T,B;const Y=new Set,K=[];let c,C="",v=!1;if(r||((M=(V=d.get(h))==null?void 0:V.properties)==null||M.forEach(D=>{D.name&&Y.add(D.name)})),n&&this.geographicLookup.has(h)){const D=(R=this.geographicLookup.get(h))==null?void 0:R.name;D&&Y.add(D)}if(this.entityTypeNames.has(h))C=`MATCH (n:${h}) ${w?"WHERE id(n) IN $ids ":""}return ID(n)`,Y.forEach(D=>{C+=`, n.${D}`,K.push(D)});else{if(!this.relationshipTypeNames.has(h))throw new _("knowledge-graph:layer-data-manager",`The graph type of ${h} could not be determined. Was this type set in the KG data model and inclusion definition?`);v=!0,C=`MATCH ()-[n:${h}]->() ${w?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,Y.forEach(D=>{C+=`, n.${D}`,K.push(D)})}c=new $e(w?{openCypherQuery:C,bindParameters:{ids:w}}:{openCypherQuery:C});const Z=(await Ze(this.knowledgeGraph,c)).resultRowsStream.getReader();for(;;){const{done:D,value:X}=await Z.read();if(D)break;const Q=[];for(let E=0;E{var q,$;H==null||H.set(E.attributes[x],E),i&&!((q=this.inclusionModeDefinition)!=null&&q.namedTypeDefinitions.get(h).members.has(E.attributes[x]))&&(($=this.inclusionModeDefinition)==null||$.namedTypeDefinitions.get(h).members.set(E.attributes[x],{id:E.attributes[x]}),this._memberIdTypeLookup.set(E.attributes[x],h))})}})().then(()=>{O(null)})});a.push(L),(b=this._processingCacheUpdatesLookup.get(h))==null||b.push(L)}await Promise.all(a)}removeFromLayer(t){const r=new Set;t.forEach(n=>{var i;this._memberIdTypeLookup.get(n)&&r.add(this._memberIdTypeLookup.get(n)),this._memberIdTypeLookup.delete(n),(i=this.inclusionModeDefinition)==null||i.namedTypeDefinitions.forEach(o=>{var a;(a=o.members)!=null&&a.has(n)&&o.members.delete(n)})}),r.forEach(n=>{var i;(i=this.sublayerCaches.get(n))==null||i.forEach((o,a)=>{var l;t.includes(a)&&((l=this.sublayerCaches.get(n))==null||l.delete(a))})})}async retrieveDataFromService(t,r,n){var b,h,w,L,O,k,Y,K,c,C,v,Z,V,M,R,z;const i=We.getInstance(),o=new Set,a=[];let l,d="",u=[];const y=r.graphType==="relationship",m=(w=(h=(b=this.inclusionModeDefinition)==null?void 0:b.namedTypeDefinitions)==null?void 0:h.get(r.objectType.name))==null?void 0:w.useAllData,g=r.parentCompositeLayer.sublayerIdsCache.get(r.objectType.name);let f=!m&&g?Array.from(g).sort():null;if((k=(O=(L=this.inclusionModeDefinition)==null?void 0:L.namedTypeDefinitions)==null?void 0:O.get(r.objectType.name))!=null&&k.useAllData)(c=(K=(Y=this.inclusionModeDefinition)==null?void 0:Y.namedTypeDefinitions)==null?void 0:K.get(r.objectType.name))!=null&&c.useAllData&&t.objectIds!=null&&(f=t.objectIds);else if(t.objectIds!=null&&f&&f.length>0){const S=t.objectIds;t.objectIds=f.filter(T=>S.includes(T))}else if(t.objectIds!=null)f=t.objectIds;else{if((C=this.inclusionModeDefinition)!=null&&C.namedTypeDefinitions.has(r.objectType.name)&&(!((v=this.inclusionModeDefinition.namedTypeDefinitions.get(r.objectType.name))!=null&&v.members)||((V=(Z=this.inclusionModeDefinition.namedTypeDefinitions.get(r.objectType.name))==null?void 0:Z.members)==null?void 0:V.size)<1))return t.objectIds=[],[];t.objectIds=f}if(t.outFields!=null){const S=t.outFields;S.includes("*")?r.fields.forEach(T=>{o.add(T.name)}):S.forEach(T=>{T!==x&&T!==r.geometryFieldName&&o.add(T)})}if(t.geometry!=null){const S=t.geometry;let T;if((M=S==null?void 0:S.extent)!=null&&M.spatialReference&&!((R=S.spatialReference)!=null&&R.isWGS84)?(await Vt(S.extent.spatialReference,Qe),T=Wt(S.extent,Qe)):T=S.extent,t.where!=null&&t.where!=="1=1"){const B=await St(t.where.toUpperCase(),r.fieldsIndex);r.fields.forEach(D=>{B.fieldNames.includes(D.name)&&o.add(D.name)})}d=y?`Match ()-[n:${r.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${r.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${r.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${r.geometryFieldName}) return ID(n)`,r.geometryFieldName&&o.add(r.geometryFieldName),o.forEach(B=>{d+=`, n.${B}`,a.push(B)}),l=new $e({openCypherQuery:d,bindParameters:{param_filter_geom:new xe({rings:[[[T.xmin,T.ymin],[T.xmin,T.ymax],[T.xmax,T.ymax],[T.xmax,T.ymin],[T.xmin,T.ymin]]]})}})}else{let S="";if(t.where!=null&&t.where!=="1=1"){const D=await St(t.where,r.fieldsIndex);r.fields.forEach(E=>{D.fieldNames.includes(E.name)&&o.add(E.name)});const X=["column-reference","string","number","binary-expression"],Q=["=","<","<=","<>",">",">=","AND","OR","LIKE"];let ee=!1;const H=E=>{if(E.type==="column-reference")return`n.${E.column}`;if(E.type==="string")return`'${E.value}'`;if(E.type==="number")return`${E.value}`;if(E.type==="binary-expression"&&X.includes(E.left.type)&&X.includes(E.right.type)&&Q.includes(E.operator))return`${H(E.left)} ${E.operator} ${H(E.right)}`;if(E.type==="binary-expression"&&E.operator==="LIKE"){let q="";if(E.left.type==="function"&&E.left.args.value[0].type==="column-reference")q+=`lower(n.${E.left.args.value[0].column})`;else{if(E.left.type!=="column-reference")return ee=!0,"";q+=`lower(n.${E.left.column})`}if(q+=" CONTAINS (",E.right.type!=="string")return ee=!0,"";{let $=E.right.value;$.charAt(0)==="%"&&($=$.slice(1)),$.charAt($.length-1)==="%"&&($=$.slice(0,-1)),q+=`'${$.toLowerCase()}')`}return q}return ee=!0,""};S=H(D.parseTree),ee&&(S="")}let T="";T=y?`Match ()-[n:${r.objectType.name}]->()`:`Match (n:${r.objectType.name})`;let B=!1;f&&(B=!0,T+=" WHERE ID(n) IN $ids"),S&&(T+=B?" AND":" WHERE",T+=` ${S}`),T+=" return ID(n)",y&&(T+=", id(startNode(n)), id(endNode(n))"),t.returnGeometry&&r.geometryFieldName&&o.add(r.geometryFieldName),o.forEach(D=>{T+=`, n.${D}`,a.push(D)}),l=new $e(f?{openCypherQuery:T,bindParameters:{ids:f}}:{openCypherQuery:T})}const I=(await Ze(r.parentCompositeLayer.dataManager.knowledgeGraph,l,n)).resultRowsStream.getReader();for(;;){const{done:S,value:T}=await I.read();if(S)break;const B=[];for(let D=0;D{let t=class extends e{constructor(){super(...arguments),this.fields=[],this.fieldsIndex=null}};return s([p(zt.fields)],t.prototype,"fields",void 0),s([p(zt.fieldsIndex)],t.prototype,"fieldsIndex",void 0),t=s([G("esri.layers.knowledgeGraphLayer.KnowledgeGraphSublayerBase")],t),t};let N=class extends Lr(_n(Kt(Zt(gr(Xt))))){constructor(e){var t,r,n,i,o;if(super(e),this.capabilities=Ir(!1,!1),this.definitionExpression="",this.displayField="",this.elevationInfo=null,this.geometryType=null,this.geometryFieldName=null,this.graphType=null,this.hasM=!1,this.hasZ=!1,this.labelsVisible=null,this.labelingInfo=null,this.objectIdField=x,this.objectType=null,this.parentCompositeLayer=null,this.popupTemplate=null,this.source={openPorts:()=>this.load().then(()=>{const a=new MessageChannel;return new wr(a.port1,{channel:a,client:{queryFeatures:(l,d={})=>{const u=fe.fromJSON(l);return this.queryFeaturesJSON(u,d)}}},()=>null),[a.port2]})},this.type="knowledge-graph-sublayer",e.parentCompositeLayer.type==="link-chart")e.graphType==="relationship"?this.geometryType="polyline":this.geometryType="point",this.geometryFieldName=j;else if((t=e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name))!=null&&t.geometryType&&((r=e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name))==null?void 0:r.geometryType)!=="esriGeometryNull"){const a=e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name);this.geometryFieldName=(a==null?void 0:a.name)??null,this.geometryType=a!=null&&a.geometryType?ye.fromJSON(a.geometryType):null;const l=a==null?void 0:a.name,d=l?(n=e.objectType.properties)==null?void 0:n[l]:null;d?(this.hasM=d.hasM??!1,this.hasZ=d.hasZ??!1):(this.hasM=!1,this.hasZ=!1)}else this.geometryType=null;(i=e.objectType.properties)==null||i.forEach(a=>{let l=null,d=a.fieldType;d==="esriFieldTypeOID"&&(d="esriFieldTypeInteger"),this.fields.push(Dt.fromJSON({name:a.name,type:d,alias:a.alias,defaultValue:l,editable:a.editable,nullable:a.nullable}))}),this.fields.push(Dt.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1})),this._set("fields",[...this.fields]),(o=e.parentCompositeLayer.dataManager.knowledgeGraph.dataModel)!=null&&o.spatialReference&&(this.spatialReference=e.parentCompositeLayer.dataManager.knowledgeGraph.dataModel.spatialReference),e.parentCompositeLayer.type==="link-chart"?e.graphType==="relationship"?this.renderer=Je(Ve(ye.toJSON("polyline")).renderer):this.renderer=Je(Ve(ye.toJSON("point")).renderer):this.renderer=Je(Ve(ye.toJSON(this.geometryType)).renderer)}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){_r(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return xr(this,e)}createQuery(){return new fe({where:"1=1",outFields:["*"]})}getField(e){for(let t=0;t{o.sourceLayer=this}),i}async queryFeaturesJSON(e,t){const{resolvedQuery:r,queryEngine:n}=await this._setupQueryObjects(e);return await n.executeQuery(r.toJSON(),t==null?void 0:t.signal)}async queryFeatureCount(e,t){const{resolvedQuery:r,queryEngine:n}=await this._setupQueryObjects(e);return n.executeQueryForCount(r.toJSON(),t==null?void 0:t.signal)}async queryExtent(e={},t){var l,d,u,y;const r={...e,returnGeometry:!0},{resolvedQuery:n,queryEngine:i}=await this._setupQueryObjects(r),o=await i.executeQueryForExtent(n.toJSON(),t==null?void 0:t.signal);let a;return a=((l=o.extent)==null?void 0:l.xmin)!=null&&((d=o.extent)==null?void 0:d.xmax)!=null&&((u=o.extent)==null?void 0:u.ymin)!=null&&((y=o.extent)==null?void 0:y.ymax)!=null?new Ue(o.extent):new Ue,{count:o.count,extent:a}}async queryObjectIds(e,t){const r=fe.from(e);let n;if(this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)n=this._cachedQueryEngine;else{const i=await this.parentCompositeLayer.dataManager.getData(r,this,t);n=this.loadQueryEngine(i)}return n.executeQueryForIds(r.toJSON(),t==null?void 0:t.signal)}loadQueryEngine(e){const t=new kr({geometryType:ye.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new Mr({fields:this.fields.map(n=>n.toJSON()),geometryType:ye.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:null,featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new fe({where:"1=1",outFields:[x]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}async _setupQueryObjects(e,t){var o;const r=fe.from(e),n=r.geometry;let i;if(n&&!((o=n.spatialReference)!=null&&o.isWGS84)&&(await Vt(n.spatialReference,Qe),r.geometry=Wt(n instanceof xe||n instanceof ce?n:n.extent,Qe)),this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const a=await this.parentCompositeLayer.dataManager.getData(r,this,t);i=this.loadQueryEngine(a)}return{resolvedQuery:r,queryEngine:i}}};s([p()],N.prototype,"capabilities",void 0),s([p({readOnly:!0})],N.prototype,"defaultPopupTemplate",null),s([p()],N.prototype,"definitionExpression",void 0),s([p()],N.prototype,"displayField",void 0),s([p()],N.prototype,"elevationInfo",void 0),s([p()],N.prototype,"geometryType",void 0),s([p()],N.prototype,"geometryFieldName",void 0),s([p()],N.prototype,"graphType",void 0),s([p()],N.prototype,"hasM",void 0),s([p()],N.prototype,"hasZ",void 0),s([p()],N.prototype,"labelsVisible",void 0),s([p()],N.prototype,"labelingInfo",void 0),s([p()],N.prototype,"objectIdField",void 0),s([p()],N.prototype,"objectType",void 0),s([p()],N.prototype,"parentCompositeLayer",void 0),s([p({type:br,json:{name:"popupInfo",write:!0}})],N.prototype,"popupTemplate",void 0),s([p({types:Er,json:{write:{target:"layerDefinition.drawingInfo.renderer"}}})],N.prototype,"renderer",null),s([p()],N.prototype,"source",void 0),s([p({json:{read:!1}})],N.prototype,"type",void 0),N=s([G("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],N);const nt=N;let it,U=null;function bn(){return it||(it=at(()=>import("./lclayout-caec6e62.js"),["assets/lclayout-caec6e62.js","assets/index-080e108a.js","assets/index-a8e73b5e.css"]).then(e=>e.l).then(({default:e})=>e({locateFile:t=>ot(`esri/libs/linkchartlayout/${t}`)})).then(e=>{Tn(e)}),it)}function Tn(e){U=e}var te;function me(e,t,r,n,i,o){const a=r.length,l=i.length,d=Float64Array.BYTES_PER_ELEMENT,u=Uint32Array.BYTES_PER_ELEMENT,y=Uint8Array.BYTES_PER_ELEMENT,m=16,g=m-1+a*(y+2*d)+l*(2*u),f=U._malloc(g);try{const I=f+m-f%m,b=I+a*d,h=b+a*d,w=h+l*u,L=w+l*u,O=()=>[U.HEAPF64.subarray(I>>3,(I>>3)+a),U.HEAPF64.subarray(b>>3,(b>>3)+a),U.HEAPU32.subarray(h>>2,(h>>2)+l),U.HEAPU32.subarray(w>>2,(w>>2)+l),U.HEAPU8.subarray(L,L+a)],[k,Y,K,c,C]=O();k.set(r),Y.set(n),K.set(i),c.set(o),C.set(t);const v=e(a,L,I,b,l,h,w),[Z,V,M,R,z]=O();return r.set(Z),n.set(V),i.set(M),o.set(R),t.set(z),v}finally{U._free(f)}}(function(e){e[e.None=0]="None",e[e.IsMovable=1]="IsMovable",e[e.IsGeographic=2]="IsGeographic",e[e.IsRoot=4]="IsRoot"})(te||(te={}));const Qt=2,Ut=1,qt=-1;var yt,mt,ft,gt,wt,_t,Yt,Bt;(function(e){function t(){return U.getMinIdealEdgeLength()}function r(n,i,o,a,l,d=Qt,u=Ut,y=qt){return me((m,g,f,I,b,h,w)=>U.applyForceDirectedLayout(m,g,f,I,b,h,w,d,u,y),n,i,o,a,l)}e.getMinIdealEdgeLength=t,e.apply=r})(yt||(yt={})),function(e){function t(r,n,i,o,a,l=Qt,d=Ut,u=qt){return me((y,m,g,f,I,b,h)=>U.applyCommunityLayout(y,m,g,f,I,b,h,l,d,u),r,n,i,o,a)}e.apply=t}(mt||(mt={})),function(e){function t(r,n,i,o,a){return me(U.applySimpleLayout,r,n,i,o,a)}e.apply=t}(ft||(ft={})),function(e){function t(r,n,i,o,a){return me(U.applyHierarchicalLayout,r,n,i,o,a)}e.apply=t}(gt||(gt={})),function(e){function t(r,n,i,o,a){return me(U.applyRadialTreeLayout,r,n,i,o,a)}e.apply=t}(wt||(wt={})),function(e){function t(r,n,i,o,a){return me(U.applySmartTreeLayout,r,n,i,o,a)}e.apply=t}(_t||(_t={})),function(e){e[e.Undirected=0]="Undirected",e[e.Directed=1]="Directed",e[e.Reversed=2]="Reversed"}(Yt||(Yt={})),function(e){e[e.ByCC_Raw=0]="ByCC_Raw",e[e.ByCC_NormalizeGlobally=1]="ByCC_NormalizeGlobally",e[e.ByCC_NormalizeByCC=2]="ByCC_NormalizeByCC"}(Bt||(Bt={}));const En=(e,t,r)=>(e.has(t)||e.set(t,r()),e.get(t));let A=class extends Kt(Zt(Xt)){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE",xScaleFactor:1,yScaleFactor:1},this._graphTypeLookup=new Map,this.layers=new Gt,this.linkChartDiagramLookup=new Map,this.linkChartExtent=new Ue({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.linkChartGeohashLookup=new Map,this.sublayerIdsCache=new Map,this.tables=new Gt,this.type="link-chart",this._originalInclusionList=e.inclusionModeDefinition,e.dataPreloadedInLocalCache&&!e.inclusionModeDefinition)throw new _("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it")}normalizeCtorArgs(e){return{url:e.url,title:e.title,dataPreloadedInLocalCache:e.dataPreloadedInLocalCache,defaultLinkChartConfig:e.defaultLinkChartConfig}}_initializeLayerProperties(e){var o,a,l,d,u,y;if(!this.title&&this.url){const m=this.url.split("/");this.title=m[m.length-2]}const t=new Set;let r=[],n=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new _("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");(o=e.knowledgeGraph.dataModel.entityTypes)==null||o.forEach(m=>{m.name&&this._graphTypeLookup.set(m.name,m)}),(a=e.knowledgeGraph.dataModel.relationshipTypes)==null||a.forEach(m=>{m.name&&this._graphTypeLookup.set(m.name,m)}),(l=e.inclusionModeDefinition)!=null&&l.generateAllSublayers?(r=e.knowledgeGraph.dataModel.entityTypes??[],n=e.knowledgeGraph.dataModel.relationshipTypes??[]):(d=e.inclusionModeDefinition)!=null&&d.namedTypeDefinitions&&((u=e.inclusionModeDefinition)==null?void 0:u.namedTypeDefinitions.size)>0?(y=e.inclusionModeDefinition)==null||y.namedTypeDefinitions.forEach((m,g)=>{var f,I;if(!this._graphTypeLookup.get(g))return Te.getLogger(this).warn(`A named type, ${g}, was in the inclusion list that wasn't in the data model and will be removed`),void((f=e.inclusionModeDefinition)==null?void 0:f.namedTypeDefinitions.delete(g));this._graphTypeLookup.get(g)instanceof Et||"strictOrigin"in this._graphTypeLookup.get(g)?t.has(g)||(t.add(g),n.push(this._graphTypeLookup.get(g))):this._graphTypeLookup.get(g)instanceof Tt||"properties"in this._graphTypeLookup.get(g)?t.has(g)||(t.add(g),r.push(this._graphTypeLookup.get(g))):(Te.getLogger(this).warn(`A named type, ${g}, was in the inclusion list that wasn't properly modeled and will be removed`),(I=e.inclusionModeDefinition)==null||I.namedTypeDefinitions.delete(g))}):(r=e.knowledgeGraph.dataModel.entityTypes??[],n=e.knowledgeGraph.dataModel.relationshipTypes??[]);const i=new ne({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=r,this.memberRelationshipTypes=n,this.dataManager=i}load(e){return this.addResolvingPromise(new Promise(t=>{un(this.url).then(r=>{var n,i,o,a,l,d;if(this._initializeLayerProperties({knowledgeGraph:r,inclusionModeDefinition:this._originalInclusionList}),(i=(n=this.dataManager.inclusionModeDefinition)==null?void 0:n.namedTypeDefinitions)!=null&&i.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},(o=this.dataManager.knowledgeGraph.dataModel.entityTypes)==null||o.forEach(u=>{var y;u.name&&((y=this.dataManager.inclusionModeDefinition)==null||y.namedTypeDefinitions.set(u.name,{useAllData:!0}))}),(a=this.dataManager.knowledgeGraph.dataModel.relationshipTypes)==null||a.forEach(u=>{var y;u.name&&((y=this.dataManager.inclusionModeDefinition)==null||y.namedTypeDefinitions.set(u.name,{useAllData:!0}))})),this.dataPreloadedInLocalCache)this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),(l=this.dataManager.inclusionModeDefinition)==null||l.namedTypeDefinitions.forEach(u=>{var y;u.useAllData=!1,(y=u.members)==null||y.forEach(m=>{let g;g=m.linkChartLocation instanceof Rt?m.linkChartLocation:m.linkChartLocation?se(m.linkChartLocation):null,this.linkChartDiagramLookup.set(m.id,g),g&&g.coords.length===2&&g.lengths.length===0?this.linkChartGeohashLookup.set(m.id,de(g.coords[1],g.coords[0],he)):this.linkChartGeohashLookup.set(m.id,"")}),this.addResolvingPromise(this._initializeDiagram().then(async()=>{this.layers.forEach(async m=>{await m.refreshCachedQueryEngine()}),this.tables.forEach(async m=>{await m.refreshCachedQueryEngine()})}))});else{const u=((d=this.defaultLinkChartConfig)==null?void 0:d.layoutMode)==="GEOGRAPHIC";this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,u,!0).then(async()=>{Tr(e);const y=[],m=[];this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1,this.dataManager.inclusionModeDefinition.namedTypeDefinitions.forEach(g=>{g.useAllData=!1})),await this._initializeDiagram(),this.layers.forEach(g=>{m.push(g.refreshCachedQueryEngine()),y.push(new Promise(f=>{g.on("layerview-create",()=>{f(null)})}))}),this.tables.forEach(g=>{m.push(g.refreshCachedQueryEngine())}),await Promise.all(m)}))}t(null)})})),Promise.resolve(this)}async addRecords(e){await this._handleNewRecords(e)}async expand(e){const t=await this.dataManager.getConnectedRecordIds(e),r=t.filter(n=>{var i;return!((i=this.sublayerIdsCache.get(n.typeName))!=null&&i.has(n.id))});return await this._handleNewRecords(t),{records:r}}loadLayerAssumingLocalCache(){var e,t;this.memberRelationshipTypes.forEach(r=>{const n=new nt({objectType:r,parentCompositeLayer:this,graphType:"relationship",title:r.name});n.geometryType?this.layers.push(n):this.tables.push(n),this.dataManager.sublayerCaches.has(r.name)||this.dataManager.sublayerCaches.set(r.name,new Map)}),this.memberEntityTypes.forEach(r=>{const n=new nt({objectType:r,parentCompositeLayer:this,graphType:"entity",title:r.name});n.geometryType?this.layers.push(n):this.tables.push(n),this.dataManager.sublayerCaches.has(r.name)||this.dataManager.sublayerCaches.set(r.name,new Map)}),(e=this.dataManager.inclusionModeDefinition)!=null&&e.namedTypeDefinitions&&((t=this.dataManager.inclusionModeDefinition)==null||t.namedTypeDefinitions.forEach((r,n)=>{var o;const i=En(this.sublayerIdsCache,n,()=>new Set);(o=r.members)==null||o.forEach(a=>{if(i.add(a.id),a.linkChartLocation)if(a.linkChartLocation instanceof Rt)this.linkChartDiagramLookup.set(a.id,a.linkChartLocation),a.linkChartLocation.coords.length===2&&a.linkChartLocation.lengths.length===0?this.linkChartGeohashLookup.set(a.id,de(a.linkChartLocation.coords[1],a.linkChartLocation.coords[0],he)):this.linkChartGeohashLookup.set(a.id,"");else{const l=se(a.linkChartLocation);this.linkChartDiagramLookup.set(a.id,a.linkChartLocation?l:null),"x"in a.linkChartLocation&&"y"in a.linkChartLocation?this.linkChartGeohashLookup.set(a.id,de(a.linkChartLocation.x,a.linkChartLocation.y,he)):this.linkChartGeohashLookup.set(a.id,"")}})}))}async calculateLinkChartLayout(e="RADIAL_TREE",t){const r=[],n=[];this.dataManager.sublayerCaches.forEach((c,C)=>{this.dataManager.entityTypeNames.has(C)?c.forEach(v=>{r.push({typeName:C,feature:v})}):this.dataManager.relationshipTypeNames.has(C)&&c.forEach(v=>{n.push({typeName:C,feature:v})})}),this.linkChartDiagramLookup=new Map;const i=new Map,o=new Map,a=new Map,l=new Map,d=new Uint8Array(r.length),u=new Float64Array(r.length),y=new Float64Array(r.length),m=new Uint32Array(n.length),g=new Uint32Array(n.length),f=[],I="FORCE_DIRECTED",b=(t==null?void 0:t.xScaleFactor)??1,h=(t==null?void 0:t.yScaleFactor)??1,w=new Ue({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let L,O="FORCE_DIRECTED",k=0,Y=0;switch(O=e==="GEOGRAPHIC"?I:e,O){case"FORCE_DIRECTED":L=yt.apply;break;case"COMMUNITY":L=mt.apply;break;case"HIERARCHICAL":L=gt.apply;break;case"RADIAL_TREE":L=wt.apply;break;case"SMART_TREE":L=_t.apply;break;default:L=ft.apply}r.forEach(({typeName:c,feature:C})=>{var v,Z,V;if((v=t==null?void 0:t.lockedNodeLocations)!=null&&v.has(C.attributes[x])){e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(c)?d[k]=te.IsGeographic:d[k]=te.None;const M=t.lockedNodeLocations.get(C.attributes[x]);u[k]=M.x,y[k]=M.y}else if(e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(c)){d[k]=te.IsGeographic;let M=null;const R=C.attributes[this.dataManager.geographicLookup.get(c).name];switch((Z=this.dataManager.geographicLookup.get(c))==null?void 0:Z.geometryType){case"esriGeometryPoint":u[k]=R==null?void 0:R.x,y[k]=R==null?void 0:R.y;break;case"esriGeometryPolygon":M=R==null?void 0:R.centroid,(M==null?void 0:M.x)!=null&&(M==null?void 0:M.y)!=null?(u[k]=M.x,y[k]=M.y):d[k]=te.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":M=(V=R==null?void 0:R.extent)==null?void 0:V.center,(M==null?void 0:M.x)!=null&&(M==null?void 0:M.y)!=null?(u[k]=M.x,y[k]=M.y):d[k]=te.IsMovable;break;default:d[k]=te.IsMovable}(u[k]==null||y[k]==null||Number.isNaN(u[k])||Number.isNaN(y[k]))&&(d[k]=te.IsMovable,u[k]=0,y[k]=0)}else d[k]=te.IsMovable,u[k]=0,y[k]=0;l.set(C.attributes[x],k),f[k]={feature:C,typeName:c},k++});let K=!1;if(n.forEach(c=>{const C=l.get(c.feature.attributes[Ie]),v=l.get(c.feature.attributes[rt]);C!==void 0&&v!==void 0?(m[Y]=C,g[Y]=v,Y++):(K=!0,this.linkChartDiagramLookup.set(c.feature.attributes[Ie],null),this.linkChartGeohashLookup.set(c.feature.attributes[Ie],null))}),K&&Te.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null"),await bn(),!L(d,u,y,m,g))throw new _("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let c=0;c84.9999&&(y[c]=84.9999),y[c]<-84.9999&&(y[c]=-84.9999),u[c]>179.9999&&(u[c]=179.9999),u[c]<-179.9999&&(u[c]=-179.9999),f[c].feature.attributes[j]=new ve(u[c],y[c]),i.has(f[c].typeName)){const v=i.get(f[c].typeName);v==null||v.set(f[c].feature.attributes[x],f[c].feature)}else{const v=new Map;v.set(f[c].feature.attributes[x],f[c].feature),i.set(f[c].typeName,v)}a.set(f[c].feature.attributes[x],f[c].feature);const C=se(f[c].feature.attributes[j]);this.linkChartDiagramLookup.set(f[c].feature.attributes[x],f[c].feature.attributes[j]?C:null),this.linkChartGeohashLookup.set(f[c].feature.attributes[x],de(f[c].feature.attributes[j].y,f[c].feature.attributes[j].x,he)),f[c].feature.attributes[j].xw.xmax&&(w.xmax=f[c].feature.attributes[j].x),f[c].feature.attributes[j].yw.ymax&&(w.ymax=f[c].feature.attributes[j].y)}return this.linkChartExtent.xmin=w.xmin,this.linkChartExtent.xmax=w.xmax,this.linkChartExtent.ymin=w.ymin,this.linkChartExtent.ymax=w.ymax,n.forEach(c=>{var M,R;const C=(M=f[l.get(c.feature.attributes[Ie])])==null?void 0:M.feature.attributes[j],v=(R=f[l.get(c.feature.attributes[rt])])==null?void 0:R.feature.attributes[j];if(!C||!v)return;const Z=new ce({paths:[[C.x,C.y],[v.x,v.y]]});if(c.feature.attributes[j]=Z,o.has(c.typeName)){const z=o.get(c.typeName);z==null||z.set(c.feature.attributes[x],c.feature)}else{const z=new Map;z.set(c.feature.attributes[x],c.feature),o.set(c.typeName,z)}a.set(c.feature.attributes[x],c.feature);const V=se(c.feature.attributes[j]);this.linkChartDiagramLookup.set(c.feature.attributes[x],c.feature.attributes[j]?V:null),this.linkChartGeohashLookup.set(c.feature.attributes[x],"")}),this._currentLinkChartConfig={layoutMode:e,xScaleFactor:b,yScaleFactor:h},{nodes:i,links:o,idMap:a}}async applyNewLinkChartLayout(e="RADIAL_TREE",t){const r=[];await this.calculateLinkChartLayout(e,t),this.layers.forEach(n=>{r.push(n.refreshCachedQueryEngine())}),await Promise.all(r),this.layers.forEach(n=>{n.emit("refresh",{dataChanged:!0})})}getCurrentNodeLocations(){var t,r;const e=new Map;return(r=(t=this.dataManager.inclusionModeDefinition)==null?void 0:t.namedTypeDefinitions)==null||r.forEach(n=>{var i;(i=n==null?void 0:n.members)==null||i.forEach(o=>{const a=o.linkChartLocation;let l;const d=o.id;a&&(l="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(d,new ve({x:l.x,y:l.y})))})}),e}async synchronizeInclusionListWithCache(){return new Promise(e=>{var t;(t=this.dataManager.inclusionModeDefinition)==null||t.namedTypeDefinitions.forEach((r,n)=>{if(r.useAllData=!1,r.members&&r.members.size>0){if(!this.dataManager.sublayerCaches.get(n))return;const i=Array.from(this.dataManager.sublayerCaches.get(n).keys());Array.from(r.members.keys()).filter(o=>!i.includes(o)).forEach(o=>{var a;(a=r.members)==null||a.delete(o)})}}),e()})}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(r=>{t.push(r.refreshCachedQueryEngine())}),await Promise.all(t),this.layers.forEach(r=>{r.emit("refresh",{dataChanged:!0})})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayerInclusionSet(e);for(const r of e)this.sublayerIdsCache.has(r.typeName)||(this.sublayerIdsCache.set(r.typeName,new Set),t.push(r.typeName)),this.sublayerIdsCache.get(r.typeName).add(r.id);for(const r of t)if(this._graphTypeLookup.has(r)){const n=this._graphTypeLookup.get(r),i="endPoints"in n?"relationship":"entity",o=new nt({objectType:n,parentCompositeLayer:this,graphType:i,title:r});i==="entity"?this.dataManager.entityTypeNames.add(r):this.dataManager.relationshipTypeNames.add(r),o.geometryType?this.layers.push(o):this.tables.push(o),this.dataManager.sublayerCaches.set(r,new Map)}await this.dataManager.refreshCacheContent(e.map(r=>r.id)),await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,{xScaleFactor:this._currentLinkChartConfig.xScaleFactor,yScaleFactor:this._currentLinkChartConfig.xScaleFactor})}async _initializeDiagram(){var e,t;this.defaultLinkChartConfig?this.defaultLinkChartConfig.doNotRecalculateLayout?((t=(e=this.dataManager.inclusionModeDefinition)==null?void 0:e.namedTypeDefinitions)==null||t.forEach(r=>{var n;(n=r==null?void 0:r.members)==null||n.forEach(i=>{const o=i.linkChartLocation;let a;const l=i.id;if(!o)return;a="x"in o?{x:o.x,y:o.y}:{x:o.coords[0],y:o.coords[1]};const d=se(a);this.linkChartDiagramLookup.set(l,d),this.linkChartGeohashLookup.set(l,de(a.x,a.y,he)),this.linkChartExtent.xmin>a.x&&(this.linkChartExtent.xmin=a.x),this.linkChartExtent.xmaxa.y&&(this.linkChartExtent.ymin=a.y),this.linkChartExtent.ymax{var n;r.name&&((n=this.dataManager.sublayerCaches.get(r.name))==null||n.forEach(i=>{const o=this.linkChartDiagramLookup.get(i.attributes[Ie]),a=this.linkChartDiagramLookup.get(i.attributes[rt]);if(o&&a){const l=se(new ce({paths:[[o.coords[0],o.coords[1]],[a.coords[0],a.coords[1]]]}));this.linkChartDiagramLookup.set(i.attributes[x],l)}else this.linkChartDiagramLookup.set(i.attributes[x],null);this.linkChartGeohashLookup.set(i.attributes[x],"")}))})):await this.calculateLinkChartLayout(this.defaultLinkChartConfig.layoutMode,{xScaleFactor:this.defaultLinkChartConfig.xScaleFactor,yScaleFactor:this.defaultLinkChartConfig.yScaleFactor,lockedNodeLocations:this.getCurrentNodeLocations()}):await this.calculateLinkChartLayout("RADIAL_TREE",{lockedNodeLocations:this.getCurrentNodeLocations()})}};s([p()],A.prototype,"dataPreloadedInLocalCache",void 0),s([p()],A.prototype,"defaultLinkChartConfig",void 0),s([p()],A.prototype,"dataManager",void 0),s([p()],A.prototype,"knowledgeGraph",void 0),s([p()],A.prototype,"layers",void 0),s([p()],A.prototype,"linkChartDiagramLookup",void 0),s([p()],A.prototype,"linkChartExtent",void 0),s([p()],A.prototype,"linkChartGeohashLookup",void 0),s([p()],A.prototype,"memberEntityTypes",void 0),s([p()],A.prototype,"memberRelationshipTypes",void 0),s([p()],A.prototype,"sublayerIdsCache",void 0),s([p()],A.prototype,"tables",void 0),s([p({json:{read:!1}})],A.prototype,"type",void 0),A=s([G("esri.layers.LinkChartLayer")],A);const Li=A;export{Li as default}; diff --git a/assets/MapImageLayer-1956b83f.js b/assets/MapImageLayer-1956b83f.js new file mode 100644 index 0000000..75d22a9 --- /dev/null +++ b/assets/MapImageLayer-1956b83f.js @@ -0,0 +1 @@ +import{eQ as w,eS as $,eR as I,cX as O,as as T,da as b,c_ as f,eW as R,at as g,ca as E,cR as M,eX as j,ar as v,bn as L,ai as s,aj as p,eY as S,ay as P,bY as F,al as N,aA as J,eZ as q}from"./index-080e108a.js";import{O as U}from"./MultiOriginJSONSupport-e4912ffd.js";import{i as A}from"./APIKeyMixin-878a7aa7.js";import{E as k,f as _,Y as V}from"./SublayersOwner-ee341b5e.js";import{l as z}from"./ArcGISService-83287338.js";import{o as W}from"./CustomParametersMixin-231c4be8.js";import{c as B}from"./OperationalLayer-0e8f8b28.js";import{j as C}from"./PortalLayer-310c2800.js";import{a as D}from"./TemporalLayer-f17c9161.js";import{f as G}from"./commonProperties-30089b06.js";import{m as H}from"./ExportImageParameters-649a2637.js";import{t as K}from"./imageBitmapUtils-391f7b8f.js";import{e as x}from"./sublayerUtils-1269bca6.js";import{e as Y}from"./versionUtils-f17daa93.js";import"./portalItemUtils-792a27e1.js";import"./UniqueValueRenderer-fef4204d.js";import"./diffUtils-590c9088.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./sql-734ecbc5.js";import"./QueryTask-6f808a9e.js";import"./Query-1c961d4c.js";import"./executeForIds-5eaf002d.js";import"./query-93c6e211.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./executeQueryJSON-7c41ada5.js";import"./FeatureSet-111cb247.js";import"./executeQueryPBF-0f188593.js";import"./FeatureType-db96032c.js";import"./FeatureTemplate-2a7e96c1.js";import"./LabelClass-2d53c485.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./labelingInfo-144f3d9f.js";import"./serviceCapabilitiesUtils-959e798a.js";import"./AttachmentQuery-972bbd60.js";import"./popupUtils-82ea8abb.js";import"./floorFilterUtils-080a7cd2.js";let i=class extends w(D($(k(_(z(B(C(U(I(A(W(O(J))))))))))))){constructor(...e){super(...e),this.dateFieldsTimeReference=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeReference=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(e,o){return typeof e=="string"?{url:e,...o}:e}load(e){const o=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(T).then(()=>this._fetchService(o))),Promise.resolve(this)}readImageFormat(e,o){const l=o.supportedImageFormatTypes;return l&&l.includes("PNG32")?"png32":"png24"}writeSublayers(e,o,l,t){var h;if(!this.loaded||!e)return;const a=e.slice().reverse().flatten(({sublayers:r})=>r&&r.toArray().reverse()).toArray();let n=!1;if(this.capabilities&&this.capabilities.operations.supportsExportMap&&((h=this.capabilities.exportMap)!=null&&h.supportsDynamicLayers)){const r=b(t.origin);if(r===f.PORTAL_ITEM){const c=this.createSublayersForOrigin("service").sublayers;n=x(a,c,f.SERVICE)}else if(r>f.PORTAL_ITEM){const c=this.createSublayersForOrigin("portal-item");n=x(a,c.sublayers,b(c.origin))}}const m=[],d={writeSublayerStructure:n,...t};let y=n;a.forEach(r=>{const c=r.write({},d);m.push(c),y=y||r.originOf("visible")==="user"}),m.some(r=>Object.keys(r).length>1)&&(o.layers=m),y&&(o.visibleLayers=a.filter(r=>r.visible).map(r=>r.id))}createExportImageParameters(e,o,l,t){const a=t&&t.pixelRatio||1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian());const n=new H({layer:this,floors:t==null?void 0:t.floors,scale:R({extent:e,width:o})*a}),m=n.toJSON();n.destroy();const d=!t||!t.rotation||this.version<10.3?{}:{rotation:-t.rotation},y=e&&e.spatialReference,h=y.wkid||JSON.stringify(y.toJSON());m.dpi*=a;const r={};if(t!=null&&t.timeExtent){const{start:c,end:u}=t.timeExtent.toJSON();r.time=c&&u&&c===u?""+c:`${c??"null"},${u??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(r.time="null,null");return{bbox:e&&e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:h,imageSR:h,size:o+","+l,...m,...d,...r}}async fetchImage(e,o,l,t){const{data:a}=await this._fetchImage("image",e,o,l,t);return a}async fetchImageBitmap(e,o,l,t){const{data:a,url:n}=await this._fetchImage("blob",e,o,l,t);return K(a,n,t==null?void 0:t.signal)}async fetchRecomputedExtents(e={}){const o={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:l}=await g(this.url,o),{extent:t,fullExtent:a,timeExtent:n}=l,m=t||a;return{fullExtent:m&&E.fromJSON(m),timeExtent:n&&M.fromJSON({start:n[0],end:n[1]})}}loadAll(){return j(this,e=>{e(this.allSublayers)})}serviceSupportsSpatialReference(e){return Y(this,e)}async _fetchImage(e,o,l,t,a){var d,y,h;const n={responseType:e,signal:(a==null?void 0:a.signal)??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(o,l,t,a),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},m=this.parsedUrl.path+"/export";if(((d=n.query)==null?void 0:d.dynamicLayers)!=null&&!((h=(y=this.capabilities)==null?void 0:y.exportMap)!=null&&h.supportsDynamicLayers))throw new v("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:n.query});try{const{data:r}=await g(m,n);return{data:r,url:m}}catch(r){throw L(r)?r:new v("mapimagelayer:image-fetch-error",`Unable to load image: ${m}`,{error:r})}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:o,ssl:l}=await g(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:e});l&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=o,this.read(o,{origin:"service",url:this.parsedUrl})}};s([p({type:S})],i.prototype,"dateFieldsTimeReference",void 0),s([p({type:Boolean})],i.prototype,"datesInUnknownTimezone",void 0),s([p()],i.prototype,"dpi",void 0),s([p()],i.prototype,"gdbVersion",void 0),s([p()],i.prototype,"imageFormat",void 0),s([P("imageFormat",["supportedImageFormatTypes"])],i.prototype,"readImageFormat",null),s([p({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],i.prototype,"imageMaxHeight",void 0),s([p({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],i.prototype,"imageMaxWidth",void 0),s([p()],i.prototype,"imageTransparency",void 0),s([p({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],i.prototype,"isReference",void 0),s([p({json:{read:!1,write:!1}})],i.prototype,"labelsVisible",void 0),s([p({type:["ArcGISMapServiceLayer"]})],i.prototype,"operationalLayerType",void 0),s([p({json:{read:!1,write:!1}})],i.prototype,"popupEnabled",void 0),s([p({type:S})],i.prototype,"preferredTimeReference",void 0),s([p()],i.prototype,"sourceJSON",void 0),s([p({json:{write:{ignoreOrigin:!0}}})],i.prototype,"sublayers",void 0),s([F("sublayers",{layers:{type:[V]},visibleLayers:{type:[q]}})],i.prototype,"writeSublayers",null),s([p({type:["show","hide","hide-children"]})],i.prototype,"listMode",void 0),s([p({json:{read:!1},readOnly:!0,value:"map-image"})],i.prototype,"type",void 0),s([p(G)],i.prototype,"url",void 0),i=s([N("esri.layers.MapImageLayer")],i);const Ve=i;export{Ve as default}; diff --git a/assets/MapImageLayerView3D-5536e520.js b/assets/MapImageLayerView3D-5536e520.js new file mode 100644 index 0000000..485d22c --- /dev/null +++ b/assets/MapImageLayerView3D-5536e520.js @@ -0,0 +1 @@ +import{ai as i,aj as o,al as p}from"./index-080e108a.js";import{z as a}from"./DynamicLayerView3D-b48678f2.js";import{b as m}from"./commonProperties-30089b06.js";import{m as n}from"./ExportImageParameters-649a2637.js";import{U as l}from"./MapServiceLayerViewHelper-fdadc63a.js";import{r as h}from"./drapedUtils-909caa2b.js";import"./LayerView3D-ffd35809.js";import"./projectExtentUtils-efa4cddd.js";import"./ImageMaterial-5c48df66.js";import"./LayerView-448bc5ea.js";import"./RefreshableLayerView-915e7f53.js";import"./sql-734ecbc5.js";import"./floorFilterUtils-080a7cd2.js";import"./sublayerUtils-1269bca6.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./popupUtils-f04ec9a9.js";const u=t=>{let e=class extends t{initialize(){this.exportImageParameters=new n({layer:this.layer})}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get floors(){var r;return((r=this.view)==null?void 0:r.floors)??null}get exportImageVersion(){var r;return(r=this.exportImageParameters)==null||r.commitProperty("version"),this.commitProperty("timeExtent"),this.commitProperty("floors"),(this._get("exportImageVersion")||0)+1}canResume(){var r;return!!super.canResume()&&!((r=this.timeExtent)!=null&&r.isEmpty)}};return i([o()],e.prototype,"exportImageParameters",void 0),i([o({readOnly:!0})],e.prototype,"floors",null),i([o({readOnly:!0})],e.prototype,"exportImageVersion",null),i([o()],e.prototype,"layer",void 0),i([o()],e.prototype,"suspended",void 0),i([o(m)],e.prototype,"timeExtent",void 0),e=i([p("esri.views.layers.MapImageLayerView")],e),e};let s=class extends u(a){constructor(){super(...arguments),this.type="map-image-3d"}initialize(){this.updatingHandles.add(()=>this.exportImageVersion,()=>this.updatingHandles.addPromise(this.refreshDebounced())),this._popupHighlightHelper=new l({createFetchPopupFeaturesQueryGeometry:(t,e)=>h(t,e,this.view),layerView:this,updatingHandles:this.updatingHandles})}destroy(){var t;(t=this._popupHighlightHelper)==null||t.destroy()}fetchPopupFeatures(t,e){return this._popupHighlightHelper.fetchPopupFeatures(t,e)}getFetchOptions(){return{timeExtent:this.timeExtent}}};s=i([p("esri.views.3d.layers.MapImageLayerView3D")],s);const b=s;export{b as default}; diff --git a/assets/MapNotesLayer-637d9bd1.js b/assets/MapNotesLayer-637d9bd1.js new file mode 100644 index 0000000..d3f362c --- /dev/null +++ b/assets/MapNotesLayer-637d9bd1.js @@ -0,0 +1 @@ +import{cq as x,ai as i,aj as s,al as M,bg as B,bK as G,bJ as v,bk as F,eQ as k,eS as A,bc as h,aF as w,cl as N,dA as $,e_ as J,dC as S,e$ as I,f0 as E,aU as R,aK as z,ar as W,cO as Y,cM as q,aB as H,dX as K,dY as U,be as Q,b8 as L,ay as f,bY as V,ca as X,f1 as Z,aA as ee}from"./index-080e108a.js";import{O as te}from"./MultiOriginJSONSupport-e4912ffd.js";import{b as re}from"./normalizeUtils-cf8b8053.js";import oe from"./FeatureLayer-5c6d2c3b.js";import{n as ie}from"./objectIdUtils-789e911a.js";import{c as le}from"./OperationalLayer-0e8f8b28.js";import{j as ae}from"./PortalLayer-310c2800.js";import"./normalizeUtilsCommon-500064b3.js";import"./UniqueValueRenderer-fef4204d.js";import"./diffUtils-590c9088.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./sql-734ecbc5.js";import"./FeatureLayerBase-7c7dfccb.js";import"./commonProperties-30089b06.js";import"./featureLayerUtils-6cf06f83.js";import"./AttachmentQuery-972bbd60.js";import"./Query-1c961d4c.js";import"./RelationshipQuery-39c07195.js";import"./serviceCapabilitiesUtils-959e798a.js";import"./editsZScale-1b5a53a6.js";import"./queryZScale-8f9616ff.js";import"./FeatureSet-111cb247.js";import"./APIKeyMixin-878a7aa7.js";import"./ArcGISService-83287338.js";import"./CustomParametersMixin-231c4be8.js";import"./EditBusLayer-d71787e9.js";import"./FeatureEffectLayer-4160946c.js";import"./FeatureEffect-86735d98.js";import"./FeatureFilter-00f4be05.js";import"./FeatureReductionLayer-4262cf54.js";import"./LabelClass-2d53c485.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./OrderedLayer-68067459.js";import"./TemporalLayer-f17c9161.js";import"./FeatureTemplate-2a7e96c1.js";import"./FeatureType-db96032c.js";import"./fieldProperties-62c55499.js";import"./labelingInfo-144f3d9f.js";import"./versionUtils-f17daa93.js";import"./styleUtils-25825fd6.js";import"./TopFeaturesQuery-e44d05be.js";import"./popupUtils-82ea8abb.js";import"./portalItemUtils-792a27e1.js";function b(t){return t.featureCollectionType==="markup"||t.layers.some(e=>e.layerDefinition.visibilityField!=null||!D(e))}function D({layerDefinition:t,featureSet:e}){const r=t.geometryType??e.geometryType;return C.find(o=>{var l,n,p;return r===o.geometryTypeJSON&&((p=(n=(l=t.drawingInfo)==null?void 0:l.renderer)==null?void 0:n.symbol)==null?void 0:p.type)===o.identifyingSymbol.type})}function j(){return new X({xmin:-180,ymin:-90,xmax:180,ymax:90})}const T=new x({name:"OBJECTID",alias:"OBJECTID",type:"oid",nullable:!1,editable:!1}),ne=new x({name:"title",alias:"Title",type:"string",nullable:!0,editable:!0});let u=class extends Z{constructor(t){super(t),this.visibilityMode="inherited"}initialize(){for(const t of this.graphics)t.sourceLayer=this.layer;this.graphics.on("after-add",t=>{t.item.sourceLayer=this.layer}),this.graphics.on("after-remove",t=>{t.item.sourceLayer=null})}get fullExtent(){var r;const t=(r=this.layer)==null?void 0:r.spatialReference,e=this.fullBounds;return t?e==null?S(j(),t).geometry:R(e,t):null}get fullBounds(){var r;const t=(r=this.layer)==null?void 0:r.spatialReference;if(!t)return null;const e=$();return this.graphics.forEach(o=>{const l=o.geometry!=null?S(o.geometry,t).geometry:null;l!=null&&J(e,l.type==="point"?l:l.extent,e)}),I(e,E)?null:e}get sublayers(){return this.graphics}};i([s({readOnly:!0})],u.prototype,"fullExtent",null),i([s({readOnly:!0})],u.prototype,"fullBounds",null),i([s({readOnly:!0})],u.prototype,"sublayers",null),i([s()],u.prototype,"layer",void 0),i([s()],u.prototype,"layerId",void 0),i([s({readOnly:!0})],u.prototype,"visibilityMode",void 0),u=i([M("esri.layers.MapNotesLayer.MapNotesSublayer")],u);const C=[{geometryType:"polygon",geometryTypeJSON:"esriGeometryPolygon",id:"polygonLayer",layerId:0,title:"Polygons",identifyingSymbol:new B().toJSON()},{geometryType:"polyline",geometryTypeJSON:"esriGeometryPolyline",id:"polylineLayer",layerId:1,title:"Polylines",identifyingSymbol:new G().toJSON()},{geometryType:"multipoint",geometryTypeJSON:"esriGeometryMultipoint",id:"multipointLayer",layerId:2,title:"Multipoints",identifyingSymbol:new v().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"pointLayer",layerId:3,title:"Points",identifyingSymbol:new v().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"textLayer",layerId:4,title:"Text",identifyingSymbol:new F().toJSON()}];let a=class extends k(A(le(ae(te(ee))))){constructor(t){super(t),this.capabilities={operations:{supportsMapNotesEditing:!0}},this.featureCollections=null,this.featureCollectionJSON=null,this.featureCollectionType="notes",this.legendEnabled=!1,this.listMode="hide-children",this.minScale=0,this.maxScale=0,this.spatialReference=h.WGS84,this.sublayers=new w(C.map(e=>new u({id:e.id,layerId:e.layerId,title:e.title,layer:this}))),this.title="Map Notes",this.type="map-notes",this.visibilityMode="inherited"}readCapabilities(t,e,r){return{operations:{supportsMapNotesEditing:!b(e)&&(r==null?void 0:r.origin)!=="portal-item"}}}readFeatureCollections(t,e,r){if(!b(e))return null;const o=e.layers.map(l=>{const n=new oe;return n.read(l,r),n});return new w({items:o})}readLegacyfeatureCollectionJSON(t,e){return b(e)?N(e.featureCollection):null}get fullExtent(){var r;const t=this.spatialReference,e=$();return this.sublayers!=null?this.sublayers.forEach(({fullBounds:o})=>o!=null?J(e,o,e):e,e):(r=this.featureCollectionJSON)!=null&&r.layers.some(o=>o.layerDefinition.extent)&&this.featureCollectionJSON.layers.forEach(o=>{const l=S(o.layerDefinition.extent,t).geometry;l!=null&&J(e,l,e)}),I(e,E)?S(j(),t).geometry:R(e,t)}readMinScale(t,e){for(const r of e.layers)if(r.layerDefinition.minScale!=null)return r.layerDefinition.minScale;return 0}readMaxScale(t,e){for(const r of e.layers)if(r.layerDefinition.maxScale!=null)return r.layerDefinition.maxScale;return 0}get multipointLayer(){return this._findSublayer("multipointLayer")}get pointLayer(){return this._findSublayer("pointLayer")}get polygonLayer(){return this._findSublayer("polygonLayer")}get polylineLayer(){return this._findSublayer("polylineLayer")}readSpatialReference(t,e){return e.layers.length?h.fromJSON(e.layers[0].layerDefinition.spatialReference):h.WGS84}readSublayers(t,e,r){if(b(e))return null;const o=[];let l=e.layers.reduce((n,p)=>Math.max(n,p.layerDefinition.id??-1),-1)+1;for(const n of e.layers){const{layerDefinition:p,featureSet:y}=n,m=p.id??l++,d=D(n);if(d!=null){const c=new u({id:d.id,title:p.name,layerId:m,layer:this,graphics:y.features.map(({geometry:g,symbol:O,attributes:_,popupInfo:P})=>z.fromJSON({attributes:_,geometry:g,symbol:O,popupTemplate:P}))});o.push(c)}}return new w(o)}writeSublayers(t,e,r,o){var d;const{minScale:l,maxScale:n}=this;if(t==null)return;const p=t.some(c=>c.graphics.length>0);if(!this.capabilities.operations.supportsMapNotesEditing)return void(p&&((d=o==null?void 0:o.messages)==null?void 0:d.push(new W("map-notes-layer:editing-not-supported","New map notes cannot be added to this layer"))));const y=[];let m=this.spatialReference.toJSON();e:for(const c of t)for(const g of c.graphics)if(g.geometry!=null){m=g.geometry.spatialReference.toJSON();break e}for(const c of C){const g=t.find(O=>c.id===O.id);this._writeMapNoteSublayer(y,g,c,l,n,m,o)}Y("featureCollection.layers",y,e)}get textLayer(){return this._findSublayer("textLayer")}load(t){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},t)),Promise.resolve(this)}read(t,e){"featureCollection"in t&&(t=N(t),Object.assign(t,t.featureCollection)),super.read(t,e)}async beforeSave(){if(this.sublayers==null)return;let t=null;const e=[];for(const o of this.sublayers)for(const l of o.graphics)if(l.geometry!=null){const n=l.geometry;t?q(n.spatialReference,t)||(H(n.spatialReference,t)||K()||await U(),l.geometry=Q(n,t)):t=n.spatialReference,e.push(l)}const r=await re(e.map(o=>o.geometry));e.forEach((o,l)=>o.geometry=r[l])}_findSublayer(t){var e;return this.sublayers==null?null:((e=this.sublayers)==null?void 0:e.find(r=>r.id===t))??null}_writeMapNoteSublayer(t,e,r,o,l,n,p){const y=[];if(e!=null){for(const m of e.graphics)this._writeMapNote(y,m,r.geometryType,p);this._normalizeObjectIds(y,T),t.push({layerDefinition:{name:e.title,drawingInfo:{renderer:{type:"simple",symbol:N(r.identifyingSymbol)}},id:e.layerId,geometryType:r.geometryTypeJSON,minScale:o,maxScale:l,objectIdField:"OBJECTID",fields:[T.toJSON(),ne.toJSON()],spatialReference:n},featureSet:{features:y,geometryType:r.geometryTypeJSON}})}}_writeMapNote(t,e,r,o){var m,d;if(e==null)return;const{geometry:l,symbol:n,popupTemplate:p}=e;if(l==null)return;if(l.type!==r)return void((m=o==null?void 0:o.messages)==null?void 0:m.push(new L("map-notes-layer:invalid-geometry-type",`Geometry "${l.type}" cannot be saved in "${r}" layer`,{graphic:e})));if(n==null)return void((d=o==null?void 0:o.messages)==null?void 0:d.push(new L("map-notes-layer:no-symbol","Skipping map notes with no symbol",{graphic:e})));const y={attributes:{...e.attributes},geometry:l.toJSON(),symbol:n.toJSON()};p!=null&&(y.popupInfo=p.toJSON()),t.push(y)}_normalizeObjectIds(t,e){const r=e.name;let o=ie(r,t)+1;const l=new Set;for(const n of t){n.attributes||(n.attributes={});const{attributes:p}=n;(p[r]==null||l.has(p[r]))&&(p[r]=o++),l.add(p[r])}}};i([s({readOnly:!0})],a.prototype,"capabilities",void 0),i([f(["portal-item","web-map"],"capabilities",["layers"])],a.prototype,"readCapabilities",null),i([s({readOnly:!0})],a.prototype,"featureCollections",void 0),i([f(["web-map","portal-item"],"featureCollections",["layers"])],a.prototype,"readFeatureCollections",null),i([s({readOnly:!0,json:{origins:{"web-map":{write:{enabled:!0,target:"featureCollection"}}}}})],a.prototype,"featureCollectionJSON",void 0),i([f(["web-map","portal-item"],"featureCollectionJSON",["featureCollection"])],a.prototype,"readLegacyfeatureCollectionJSON",null),i([s({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],a.prototype,"featureCollectionType",void 0),i([s({readOnly:!0})],a.prototype,"fullExtent",null),i([s({readOnly:!0,json:{origins:{"web-map":{write:{target:"featureCollection.showLegend",overridePolicy(){return{enabled:this.featureCollectionJSON!=null}}}}}}})],a.prototype,"legendEnabled",void 0),i([s({type:["show","hide","hide-children"]})],a.prototype,"listMode",void 0),i([s({type:Number,nonNullable:!0,json:{write:!1}})],a.prototype,"minScale",void 0),i([f(["web-map","portal-item"],"minScale",["layers"])],a.prototype,"readMinScale",null),i([s({type:Number,nonNullable:!0,json:{write:!1}})],a.prototype,"maxScale",void 0),i([f(["web-map","portal-item"],"maxScale",["layers"])],a.prototype,"readMaxScale",null),i([s({readOnly:!0})],a.prototype,"multipointLayer",null),i([s({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],a.prototype,"operationalLayerType",void 0),i([s({readOnly:!0})],a.prototype,"pointLayer",null),i([s({readOnly:!0})],a.prototype,"polygonLayer",null),i([s({readOnly:!0})],a.prototype,"polylineLayer",null),i([s({type:h})],a.prototype,"spatialReference",void 0),i([f(["web-map","portal-item"],"spatialReference",["layers"])],a.prototype,"readSpatialReference",null),i([s({readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],a.prototype,"sublayers",void 0),i([f("web-map","sublayers",["layers"])],a.prototype,"readSublayers",null),i([V("web-map","sublayers")],a.prototype,"writeSublayers",null),i([s({readOnly:!0})],a.prototype,"textLayer",null),i([s()],a.prototype,"title",void 0),i([s({readOnly:!0,json:{read:!1}})],a.prototype,"type",void 0),a=i([M("esri.layers.MapNotesLayer")],a);const tt=a;export{tt as default}; diff --git a/assets/MapServiceLayerViewHelper-fdadc63a.js b/assets/MapServiceLayerViewHelper-fdadc63a.js new file mode 100644 index 0000000..e5a9baa --- /dev/null +++ b/assets/MapServiceLayerViewHelper-fdadc63a.js @@ -0,0 +1 @@ +import{es as Z,eW as W,ai as l,aj as y,cr as C,cs as K,ca as J,bc as Y,cR as X,al as V,ck as Q,jo as ee,aK as _,ay as te,bY as re,hs as se,cm as ie,kQ as ne,kR as oe,at as ae,ao as le,aR as ue,aT as pe,ar as A,aF as ye,dZ as M,aS as ce,bJ as T,aw as he,dn as fe,cZ as de,cn as me,kS as ge,kn as be,fp as we,bA as ve}from"./index-080e108a.js";import{n as G}from"./floorFilterUtils-080a7cd2.js";import{b as xe}from"./normalizeUtils-cf8b8053.js";import{n as $e}from"./sql-734ecbc5.js";import{n as Se}from"./sublayerUtils-1269bca6.js";import{n as Fe,p as Re}from"./popupUtils-f04ec9a9.js";function N(t,e){return e?"xoffset"in e&&e.xoffset?Math.max(t,Math.abs(e.xoffset)):"yoffset"in e&&e.yoffset?Math.max(t,Math.abs(e.yoffset||0)):t:t}function je(t){let e=0,s=0;for(let i=0;io.type==="size").map(o=>{const{maxSize:a,minSize:c}=o;return(L(a,t)+L(c,t))/2});let i=0;const r=s.length;if(r===0)return t;for(let o=0;o{n=N(n,o.symbol)}),n}if(e.type==="class-breaks"){let n=i;return e.classBreakInfos.forEach(o=>{n=N(n,o.symbol)}),n}return e.type==="dot-density"||e.type,i}const k=t=>t.spatialReference.wkid||JSON.stringify(t.spatialReference);function Ee(t,e){const{dpi:s,gdbVersion:i,geometry:r,geometryPrecision:n,height:o,layerOption:a,mapExtent:c,maxAllowableOffset:u,returnFieldName:p,returnGeometry:f,returnUnformattedValues:h,returnZ:F,spatialReference:x,timeExtent:$,tolerance:m,width:R}=t.toJSON(),{dynamicLayers:b,layerDefs:w,layerIds:v}=Ne(t),E=e&&e.geometry!=null?e.geometry:null,g={geometryPrecision:n,maxAllowableOffset:u,returnFieldName:p,returnGeometry:f,returnUnformattedValues:h,returnZ:F,tolerance:m},j=E&&E.toJSON()||r;if(g.imageDisplay=`${R},${o},${s}`,i&&(g.gdbVersion=i),j&&(delete j.spatialReference,g.geometry=JSON.stringify(j),g.geometryType=Z(j)),x?g.sr=x.wkid||JSON.stringify(x):j&&j.spatialReference?g.sr=k(j):c&&c.spatialReference&&(g.sr=k(c)),g.time=$?[$.start,$.end].join(","):null,c){const{xmin:z,ymin:q,xmax:B,ymax:D}=c;g.mapExtent=`${z},${q},${B},${D}`}return w&&(g.layerDefs=w),b&&!w&&(g.dynamicLayers=b),g.layers=a==="popup"?"visible":a,v&&!b&&(g.layers+=`:${v.join(",")}`),g}function Ne(t){var x,$;const{mapExtent:e,floors:s,width:i,sublayers:r,layerIds:n,layerOption:o,gdbVersion:a}=t,c=($=(x=r==null?void 0:r.find(m=>m.layer!=null))==null?void 0:x.layer)==null?void 0:$.serviceSublayers,u=o==="popup",p={},f=W({extent:e,width:i,spatialReference:e==null?void 0:e.spatialReference}),h=[],F=m=>{const R=f===0,b=m.minScale===0||f<=m.minScale,w=m.maxScale===0||f>=m.maxScale;if(m.visible&&(R||b&&w))if(m.sublayers)m.sublayers.forEach(F);else{if((n==null?void 0:n.includes(m.id))===!1||u&&(!m.popupTemplate||!m.popupEnabled))return;h.unshift(m)}};if(r==null||r.forEach(F),r&&!h.length)p.layerIds=[];else{const m=Se(h,c,a),R=h.map(b=>{const w=G(s,b);return b.toExportImageJSON(w)});if(m)p.dynamicLayers=JSON.stringify(R);else{if(r){let w=h.map(({id:v})=>v);n&&(w=w.filter(v=>n.includes(v))),p.layerIds=w}else n!=null&&n.length&&(p.layerIds=n);const b=Ie(s,h);if(b!=null&&b.length){const w={};for(const v of b)v.definitionExpression&&(w[v.id]=v.definitionExpression);Object.keys(w).length&&(p.layerDefs=JSON.stringify(w))}}}return p}function Ie(t,e){const s=!!(t!=null&&t.length),i=e.filter(r=>r.definitionExpression!=null||s&&r.floorInfo!=null);return i.length?i.map(r=>{const n=G(t,r),o=$e(n,r.definitionExpression);return{id:r.id,definitionExpression:o??void 0}}):null}var P;let d=P=class extends Q{static from(t){return ee(P,t)}constructor(t){super(t),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,this.layerIds=null,this.layerOption="top",this.mapExtent=null,this.maxAllowableOffset=null,this.returnFieldName=!0,this.returnGeometry=!1,this.returnM=!1,this.returnUnformattedValues=!0,this.returnZ=!1,this.spatialReference=null,this.sublayers=null,this.timeExtent=null,this.tolerance=null,this.width=400}};l([y({type:Number,json:{write:!0}})],d.prototype,"dpi",void 0),l([y()],d.prototype,"floors",void 0),l([y({type:String,json:{write:!0}})],d.prototype,"gdbVersion",void 0),l([y({types:C,json:{read:K,write:!0}})],d.prototype,"geometry",void 0),l([y({type:Number,json:{write:!0}})],d.prototype,"geometryPrecision",void 0),l([y({type:Number,json:{write:!0}})],d.prototype,"height",void 0),l([y({type:[Number],json:{write:!0}})],d.prototype,"layerIds",void 0),l([y({type:["top","visible","all","popup"],json:{write:!0}})],d.prototype,"layerOption",void 0),l([y({type:J,json:{write:!0}})],d.prototype,"mapExtent",void 0),l([y({type:Number,json:{write:!0}})],d.prototype,"maxAllowableOffset",void 0),l([y({type:Boolean,json:{write:!0}})],d.prototype,"returnFieldName",void 0),l([y({type:Boolean,json:{write:!0}})],d.prototype,"returnGeometry",void 0),l([y({type:Boolean,json:{write:!0}})],d.prototype,"returnM",void 0),l([y({type:Boolean,json:{write:!0}})],d.prototype,"returnUnformattedValues",void 0),l([y({type:Boolean,json:{write:!0}})],d.prototype,"returnZ",void 0),l([y({type:Y,json:{write:!0}})],d.prototype,"spatialReference",void 0),l([y()],d.prototype,"sublayers",void 0),l([y({type:X,json:{write:!0}})],d.prototype,"timeExtent",void 0),l([y({type:Number,json:{write:!0}})],d.prototype,"tolerance",void 0),l([y({type:Number,json:{write:!0}})],d.prototype,"width",void 0),d=P=l([V("esri.rest.support.IdentifyParameters")],d);const H=d;let S=class extends Q{constructor(t){super(t),this.displayFieldName=null,this.feature=null,this.layerId=null,this.layerName=null}readFeature(t,e){return _.fromJSON({attributes:{...e.attributes},geometry:{...e.geometry}})}writeFeature(t,e){if(!t)return;const{attributes:s,geometry:i}=t;s&&(e.attributes={...s}),i!=null&&(e.geometry=i.toJSON(),e.geometryType=se.toJSON(i.type))}};l([y({type:String,json:{write:!0}})],S.prototype,"displayFieldName",void 0),l([y({type:_})],S.prototype,"feature",void 0),l([te("feature",["attributes","geometry"])],S.prototype,"readFeature",null),l([re("feature")],S.prototype,"writeFeature",null),l([y({type:Number,json:{write:!0}})],S.prototype,"layerId",void 0),l([y({type:String,json:{write:!0}})],S.prototype,"layerName",void 0),S=l([V("esri.rest.support.IdentifyResult")],S);const Pe=S;async function Ve(t,e,s){const i=(e=Ge(e)).geometry?[e.geometry]:[],r=ie(t);return r.path+="/identify",xe(i).then(n=>{const o=Ee(e,{geometry:n&&n[0]}),a=ne({...r.query,f:"json",...o}),c=oe(a,s);return ae(r.path,c).then(_e).then(u=>Ae(u,e.sublayers))})}function _e(t){const e=t.data;return e.results=e.results||[],e.exceededTransferLimit=!!e.exceededTransferLimit,e.results=e.results.map(s=>Pe.fromJSON(s)),e}function Ge(t){return t=H.from(t)}function Ae(t,e){if(!(e!=null&&e.length))return t;const s=new Map;function i(r){s.set(r.id,r),r.sublayers&&r.sublayers.forEach(i)}e.forEach(i);for(const r of t.results)r.feature.sourceLayer=s.get(r.layerId);return t}let I=null;function Be(t,e){return e.type==="tile"||e.type==="map-image"}let O=class extends le{constructor(t){super(t),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=ue(async e=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(e).catch(()=>{}))})}initialize(){const t=e=>{this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(e).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([pe(()=>this.highlightGraphics,"change",e=>t(e.added),{onListenerAdd:e=>t(e)})])}async fetchPopupFeatures(t,e){var o,a;const{layerView:{layer:s,view:{scale:i}}}=this;if(!t)throw new A("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:s});const r=Me(s.sublayers,i,e);if(!r.length)return[];const n=await Le(s,r);if(!((((a=(o=s.capabilities)==null?void 0:o.operations)==null?void 0:a.supportsIdentify)??!0)&&s.version>=10.5)&&!n)throw new A("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:s});return n?this._fetchPopupFeaturesUsingQueries(t,r,e):this._fetchPopupFeaturesUsingIdentify(t,r,e)}clearHighlights(){var t;(t=this.highlightGraphics)==null||t.removeAll()}highlight(t){const e=this.highlightGraphics;if(!e)return{remove(){}};let s=null;if(t instanceof _?s=[t]:ye.isCollection(t)&&t.length>0?s=t.toArray():Array.isArray(t)&&t.length>0&&(s=t),s=s==null?void 0:s.filter(M),!s||!s.length)return ce();for(const i of s){const r=i.sourceLayer;r!=null&&"geometryType"in r&&r.geometryType==="point"&&(i.visible=!1)}return e.addMany(s),{remove:()=>{e.removeMany(s??[])}}}async _updateHighlightedFeaturesSymbols(t){const{layerView:{view:e},highlightGraphics:s,highlightGraphicUpdated:i}=this;if(s&&i)for(const r of t){const n=r.sourceLayer&&"renderer"in r.sourceLayer&&r.sourceLayer.renderer;r.sourceLayer&&"geometryType"in r.sourceLayer&&r.sourceLayer.geometryType==="point"&&n&&"getSymbolAsync"in n&&n.getSymbolAsync(r).then(async o=>{var u;o||(o=new T);let a=null;const c="visualVariables"in n?(u=n.visualVariables)==null?void 0:u.find(p=>p.type==="size"):void 0;c&&(I||(I=(await he(()=>import("./index-080e108a.js").then(p=>p.uQ),["assets/index-080e108a.js","assets/index-a8e73b5e.css"])).getSize),a=I(c,r,{view:e.type,scale:e.scale,shape:o.type==="simple-marker"?o.style:null})),a||(a="width"in o&&"height"in o&&o.width!=null&&o.height!=null?Math.max(o.width,o.height):"size"in o?o.size:16),s.includes(r)&&(r.symbol=new T({style:"square",size:a,xoffset:"xoffset"in o?o.xoffset:0,yoffset:"yoffset"in o?o.yoffset:0}),i(r,"symbol"),r.visible=!0)})}}async _updateHighlightedFeaturesGeometries(t){const{layerView:{layer:e,view:s},highlightGraphics:i,highlightGraphicUpdated:r}=this;if(this._highlightGeometriesResolution=t,!r||!(i!=null&&i.length)||!e.capabilities.operations.supportsQuery)return;const n=this._getTargetResolution(t),o=new Map;for(const u of i)if(!this._featuresResolutions.has(u)||this._featuresResolutions.get(u)>n){const p=u.sourceLayer;fe(o,p,()=>new Map).set(u.getObjectId(),u)}const a=Array.from(o,([u,p])=>{const f=u.createQuery();return f.objectIds=[...p.keys()],f.outFields=[u.objectIdField],f.returnGeometry=!0,f.maxAllowableOffset=n,f.outSpatialReference=s.spatialReference,u.queryFeatures(f)}),c=await Promise.all(a);if(!this.destroyed)for(const{features:u}of c)for(const p of u){const f=p.sourceLayer,h=o.get(f).get(p.getObjectId());h&&i.includes(h)&&(h.geometry=p.geometry,r(h,"geometry"),this._featuresResolutions.set(h,n))}}_getTargetResolution(t){const e=t*de(this.layerView.view.spatialReference),s=e/16;return s<=10?0:t/e*s}async _fetchPopupFeaturesUsingIdentify(t,e,s){const i=await this._createIdentifyParameters(t,e,s);if(i==null)return[];const{results:r}=await Ve(this.layerView.layer.parsedUrl,i);return r.map(n=>n.feature)}async _createIdentifyParameters(t,e,s){const{floors:i,layer:r,timeExtent:n,view:{spatialReference:o,scale:a}}=this.layerView,c=s!=null?s.event:null;if(!e.length)return null;await Promise.all(e.map(({sublayer:x})=>x.load().catch(()=>{})));const u=Math.min(me("mapservice-popup-identify-max-tolerance"),r.allSublayers.reduce((x,$)=>$.renderer?U({renderer:$.renderer,event:c}):x,2)),p=this.createFetchPopupFeaturesQueryGeometry(t,u),f=ge(a,o),h=Math.round(p.width/f),F=new J({xmin:p.center.x-f*h,ymin:p.center.y-f*h,xmax:p.center.x+f*h,ymax:p.center.y+f*h,spatialReference:p.spatialReference});return new H({floors:i,gdbVersion:"gdbVersion"in r?r.gdbVersion:void 0,geometry:t,height:h,layerOption:"popup",mapExtent:F,returnGeometry:!0,spatialReference:o,sublayers:r.sublayers,timeExtent:n,tolerance:u,width:h})}async _fetchPopupFeaturesUsingQueries(t,e,s){const{layerView:{floors:i,timeExtent:r}}=this,n=s!=null?s.event:null,o=e.map(async({sublayer:a,popupTemplate:c})=>{var v;if(await a.load().catch(()=>{}),a.capabilities&&!a.capabilities.operations.supportsQuery)return[];const u=a.createQuery(),p=U({renderer:a.renderer,event:n}),f=this.createFetchPopupFeaturesQueryGeometry(t,p),h=new Set,[F]=await Promise.all([Fe(a,c),(v=a.renderer)==null?void 0:v.collectRequiredFields(h,a.fieldsIndex)]);be(h,a.fieldsIndex,F);const x=Array.from(h).sort();if(u.geometry=f,u.outFields=x,u.timeExtent=r,i){const E=i.clone(),g=G(E,a);g!=null&&(u.where=u.where?`(${u.where}) AND (${g})`:g)}const $=this._getTargetResolution(f.width/p),m=await Te(c),R=a.geometryType==="point"||m&&m.arcadeUtils.hasGeometryOperations(c);R||(u.maxAllowableOffset=$);let{features:b}=await a.queryFeatures(u);const w=R?0:$;b=await Ue(a,b);for(const E of b)this._featuresResolutions.set(E,w);return b});return(await we(o)).reverse().reduce((a,c)=>c.value?[...a,...c.value]:a,[]).filter(M)}};function Me(t,e,s){const i=[],r=n=>{const o=n.minScale===0||e<=n.minScale,a=n.maxScale===0||e>=n.maxScale;if(n.visible&&o&&a){if(n.sublayers)n.sublayers.forEach(r);else if(n.popupEnabled){const c=Re(n,{...s,defaultPopupTemplateEnabled:!1});c!=null&&i.unshift({sublayer:n,popupTemplate:c})}}};return((t==null?void 0:t.toArray())??[]).reverse().map(r),i}function Te(t){var e;return(e=t.expressionInfos)!=null&&e.length||Array.isArray(t.content)&&t.content.some(s=>s.type==="expression")?ve():Promise.resolve()}async function Le(t,e){var s,i;if((i=(s=t.capabilities)==null?void 0:s.operations)!=null&&i.supportsQuery)return!0;try{return await Promise.any(e.map(({sublayer:r})=>r.load().then(()=>r.capabilities.operations.supportsQuery)))}catch{return!1}}async function Ue(t,e){const s=t.renderer;return s&&"defaultSymbol"in s&&!s.defaultSymbol&&(e=s.valueExpression?await Promise.all(e.map(i=>s.getSymbolAsync(i).then(r=>r?i:null))).then(i=>i.filter(r=>r!=null)):e.filter(i=>s.getSymbol(i)!=null)),e}l([y({constructOnly:!0})],O.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),l([y({constructOnly:!0})],O.prototype,"layerView",void 0),l([y({constructOnly:!0})],O.prototype,"highlightGraphics",void 0),l([y({constructOnly:!0})],O.prototype,"highlightGraphicUpdated",void 0),l([y({constructOnly:!0})],O.prototype,"updatingHandles",void 0),O=l([V("esri.views.layers.support.MapService")],O);export{Be as S,O as U}; diff --git a/assets/MeasurementArrow.glsl-3a559294.js b/assets/MeasurementArrow.glsl-3a559294.js new file mode 100644 index 0000000..dbc0dd7 --- /dev/null +++ b/assets/MeasurementArrow.glsl-3a559294.js @@ -0,0 +1 @@ +import"./index-080e108a.js";import{n as s}from"./DirectLineMeasurementAnalysisView3D-f383b6d8.js";import"./UnitNormalizer-818a6664.js";import"./Segment-50129b50.js";import"./unitFormatUtils-b70a7bff.js";import"./LineVisualElement-b605d10c.js";import"./elevationInfoUtils-4fd79d95.js";import"./geometryEngine-5a631b21.js";import"./geometryEngineBase-324c1c81.js";import"./hydrated-c10ab4a5.js";import"./RightAngleQuadVisualElement-8daf0594.js";import"./VisualElementResources-e52972a5.js";export{s as build}; diff --git a/assets/MediaElementView-dc36bc9f.js b/assets/MediaElementView-dc36bc9f.js new file mode 100644 index 0000000..824103e --- /dev/null +++ b/assets/MediaElementView-dc36bc9f.js @@ -0,0 +1 @@ +import{ai as t,aj as r,al as l,ao as a,dB as s,dC as d,ak as i}from"./index-080e108a.js";import{c as u}from"./normalizeUtilsSync-6be8435f.js";let e=class extends a{constructor(o){super(o)}get bounds(){const o=this.coords;return o==null||o.extent==null?null:s(o.extent)}get coords(){var n;const o=(n=this.element.georeference)==null?void 0:n.coords;return d(o,this.spatialReference).geometry}get normalizedCoords(){return i.fromJSON(u(this.coords))}get normalizedBounds(){const o=this.normalizedCoords!=null?this.normalizedCoords.extent:null;return o!=null?s(o):null}};t([r()],e.prototype,"spatialReference",void 0),t([r()],e.prototype,"element",void 0),t([r()],e.prototype,"bounds",null),t([r()],e.prototype,"coords",null),t([r()],e.prototype,"normalizedCoords",null),t([r()],e.prototype,"normalizedBounds",null),e=t([l("esri.layers.support.MediaElementView")],e);export{e as i}; diff --git a/assets/MediaLayer-be2aa899.js b/assets/MediaLayer-be2aa899.js new file mode 100644 index 0000000..0ed7861 --- /dev/null +++ b/assets/MediaLayer-be2aa899.js @@ -0,0 +1 @@ +import{dS as xe,jH as ve,mr as we,m1 as E,ms as Re,mt as $e,mu as ce,dT as Ce,gz as G,ai as i,al as v,gN as Ve,dC as te,bz as z,aj as l,c7 as d,eP as _e,bc as Ie,mv as He,ar as D,l$ as F,mw as Ae,ay as Q,bY as se,mx as B,my as ue,ak as re,mz as b,ao as Ne,mA as J,ca as ie,kf as We,mB as Be,mC as Ge,gC as Me,at as ne,ho as ze,d8 as pe,ec as be,dd as Se,dc as Fe,d9 as Ue,db as ke,mD as De,df as Je,c5 as qe,aF as Y,cY as Ke,cX as Ye,cu as Qe,aG as Xe,ax as Ze,aI as et,bd as tt,cM as nt,be as ot,dB as st,mE as rt,eQ as it,eS as at,f4 as lt,aA as ct}from"./index-080e108a.js";import{O as ut}from"./MultiOriginJSONSupport-e4912ffd.js";import{c as pt}from"./OperationalLayer-0e8f8b28.js";import{t as dt}from"./resourceExtension-91e7c3ce.js";import{o as ht}from"./BoundsStore-b6bd3c14.js";import{i as mt}from"./MediaElementView-dc36bc9f.js";import"./commonProperties-30089b06.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./normalizeUtilsSync-6be8435f.js";import"./normalizeUtilsCommon-500064b3.js";const g=Ce(),H=G(),Z=G(),de=G();function L(e,t,n){return xe(g,t[0],t[1],1),ve(g,g,we(H,n)),g[2]===0?E(e,g[0],g[1]):E(e,g[0]/g[2],g[1]/g[2])}function ft(e,t,n){return he(Z,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]),he(de,n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),Re(e,$e(Z,Z),de),e[8]!==0&&(e[0]/=e[8],e[1]/=e[8],e[2]/=e[8],e[3]/=e[8],e[4]/=e[8],e[5]/=e[8],e[6]/=e[8],e[7]/=e[8],e[8]/=e[8]),e}function he(e,t,n,o,s,r,a,c,u){ce(e,t,o,r,n,s,a,1,1,1),xe(g,c,u,1),$e(H,e);const[h,f,x]=ve(g,g,we(H,H));return ce(H,h,0,0,0,f,0,0,0,x),Re(e,H,e)}let oe=class extends Ve{projectOrWarn(t,n){if(t==null)return t;const{geometry:o,pending:s}=te(t,n);return s?null:s||o?o:(z.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:t,sourceSpatialReference:t.spatialReference,targetSpatialReference:n}),null)}};oe=i([v("esri.layers.support.GeoreferenceBase")],oe);const X=oe,ee=G(),p=b();let U=class extends Ne{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};i([l()],U.prototype,"sourcePoint",void 0),i([l({type:d})],U.prototype,"mapPoint",void 0),U=i([v("esri.layers.support.ControlPoint")],U);let P=class extends _e(X){constructor(e){super(e),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(e,t){const n=Ie.fromJSON(t.spatialReference),o=He(...t.coefficients,1);return e.map(s=>(E(p,s.x,s.y),L(p,p,o),{sourcePoint:s,mapPoint:new d({x:p[0],y:p[1],spatialReference:n})}))}writeControlPoints(e,t,n,o){if(this.transform!=null)e!=null&&m(e[0])&&(t.controlPoints=e.map(s=>{const r=s.sourcePoint;return{x:r.x,y:r.y}}),t.spatialReference=e[0].mapPoint.spatialReference.toJSON(),t.coefficients=this.transform.slice(0,8));else{const s=new D("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration.",{layer:o==null?void 0:o.layer,georeference:this});o!=null&&o.messages?o.messages.push(s):z.getLogger(this).error(s.name,s.message)}}get coords(){if(this.controlPoints==null)return null;const e=this._updateTransform(ee);if(e==null||!m(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return vt(e,this.width,this.height,t)}set coords(e){if(this.controlPoints==null||!m(this.controlPoints[0]))return;const t=this.controlPoints[0].mapPoint.spatialReference;if((e=this.projectOrWarn(e,t))==null)return;const{width:n,height:o}=this,{rings:[[s,r,a,c]]}=e,u={sourcePoint:F(0,o),mapPoint:new d({x:s[0],y:s[1],spatialReference:t})},h={sourcePoint:F(0,0),mapPoint:new d({x:r[0],y:r[1],spatialReference:t})},f={sourcePoint:F(n,0),mapPoint:new d({x:a[0],y:a[1],spatialReference:t})},x={sourcePoint:F(n,o),mapPoint:new d({x:c[0],y:c[1],spatialReference:t})};m(u)&&m(h)&&m(f)&&m(x)&&(me(ee,u,h,f,x),this.controlPoints=this.controlPoints.map(({sourcePoint:w})=>(E(p,w.x,w.y),L(p,p,ee),{sourcePoint:w,mapPoint:new d({x:p[0],y:p[1],spatialReference:t})})))}get inverseTransform(){return this.transform==null?null:Ae(G(),this.transform)}get transform(){return this._updateTransform()}toMap(e){if(e==null||this.transform==null||this.controlPoints==null||!m(this.controlPoints[0]))return null;E(p,e.x,e.y);const t=this.controlPoints[0].mapPoint.spatialReference;return L(p,p,this.transform),new d({x:p[0],y:p[1],spatialReference:t})}toSource(e){if(e==null||this.inverseTransform==null||this.controlPoints==null||!m(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return e=e.normalize(),(e=te(e,t).geometry)==null?null:(E(p,e.x,e.y),L(p,p,this.inverseTransform),F(p[0],p[1]))}_updateTransform(e){const{controlPoints:t,width:n,height:o}=this;if(!(t!=null&&n>0&&o>0))return null;const[s,r,a,c]=t;if(!m(s))return null;const u=s.mapPoint.spatialReference,h=this._projectControlPoint(r,u),f=this._projectControlPoint(a,u),x=this._projectControlPoint(c,u);if(!h.valid||!f.valid||!x.valid||!m(h.controlPoint))return null;e==null&&(e=G());let w=null;return w=m(f.controlPoint)&&m(x.controlPoint)?me(e,s,h.controlPoint,f.controlPoint,x.controlPoint):m(f.controlPoint)?gt(e,s,h.controlPoint,f.controlPoint):yt(e,s,h.controlPoint),w.every(Te=>Te===0)?null:w}_projectControlPoint(e,t){if(!m(e))return{valid:!0,controlPoint:e};const{sourcePoint:n,mapPoint:o}=e,{geometry:s,pending:r}=te(o,t);return r?{valid:!1,controlPoint:null}:r||s?{valid:!0,controlPoint:{sourcePoint:n,mapPoint:s}}:(z.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:e,sourceSpatialReference:o.spatialReference,targetSpatialReference:t}),{valid:!1,controlPoint:null})}};function m(e){return e!=null&&e.sourcePoint!=null&&e.mapPoint!=null}i([l({type:[U],json:{write:{allowNull:!1,isRequired:!0}}})],P.prototype,"controlPoints",void 0),i([Q("controlPoints")],P.prototype,"readControlPoints",null),i([se("controlPoints")],P.prototype,"writeControlPoints",null),i([l()],P.prototype,"coords",null),i([l({json:{write:!0}})],P.prototype,"height",void 0),i([l({readOnly:!0})],P.prototype,"inverseTransform",null),i([l({readOnly:!0})],P.prototype,"transform",null),i([l({json:{write:!0}})],P.prototype,"width",void 0),P=i([v("esri.layers.support.ControlPointsGeoreference")],P);const R=b(),$=b(),C=b(),O=b(),_=b(),I=b(),V=b(),T=b(),q=Math.PI/2;function M(e,t,n){E(e,n.sourcePoint.x,n.sourcePoint.y),E(t,n.mapPoint.x,n.mapPoint.y)}function yt(e,t,n){return M(R,_,t),M($,I,n),B(C,$,R,q),B(O,R,$,q),B(V,I,_,-q),B(T,_,I,-q),ae(e,R,$,C,O,_,I,V,T)}function gt(e,t,n,o){return M(R,_,t),M($,I,n),M(C,V,o),ue(O,R,$,.5),B(O,C,O,Math.PI),ue(T,_,I,.5),B(T,V,T,Math.PI),ae(e,R,$,C,O,_,I,V,T)}function me(e,t,n,o,s){return M(R,_,t),M($,I,n),M(C,V,o),M(O,T,s),ae(e,R,$,C,O,_,I,V,T)}const Pt=new Array(8).fill(0),xt=new Array(8).fill(0);function fe(e,t,n,o,s){return e[0]=t[0],e[1]=t[1],e[2]=n[0],e[3]=n[1],e[4]=o[0],e[5]=o[1],e[6]=s[0],e[7]=s[1],e}function ae(e,t,n,o,s,r,a,c,u){return ft(e,fe(Pt,t,n,o,s),fe(xt,r,a,c,u))}function vt(e,t,n,o){const s=J(0,n),r=J(0,0),a=J(t,0),c=J(t,n);return L(s,s,e),L(r,r,e),L(a,a,e),L(c,c,e),new re({rings:[[s,r,a,c,s]],spatialReference:o})}const je=P;let S=class extends X{constructor(t){super(t),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:t,topRight:n,bottomLeft:o,bottomRight:s}=this;if(t==null||n==null||o==null||s==null)return null;const r=t.spatialReference;return n=this.projectOrWarn(n,r),o=this.projectOrWarn(o,r),s=this.projectOrWarn(s,r),n==null||o==null||s==null?null:new re({rings:[[[o.x,o.y],[t.x,t.y],[n.x,n.y],[s.x,s.y],[o.x,o.y]]],spatialReference:r})}set coords(t){const{topLeft:n}=this;if(n==null)return;const o=n.spatialReference;if((t=this.projectOrWarn(t,o))==null)return;const{rings:[[s,r,a,c]]}=t;this.bottomLeft=new d({x:s[0],y:s[1],spatialReference:o}),this.topLeft=new d({x:r[0],y:r[1],spatialReference:o}),this.topRight=new d({x:a[0],y:a[1],spatialReference:o}),this.bottomRight=new d({x:c[0],y:c[1],spatialReference:o})}};i([l()],S.prototype,"coords",null),i([l({type:d})],S.prototype,"bottomLeft",void 0),i([l({type:d})],S.prototype,"bottomRight",void 0),i([l({type:d})],S.prototype,"topLeft",void 0),i([l({type:d})],S.prototype,"topRight",void 0),S=i([v("esri.layers.support.CornersGeoreference")],S);const wt=S;let A=class extends X{constructor(e){super(e),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(this.extent==null)return null;const{xmin:e,ymin:t,xmax:n,ymax:o,spatialReference:s}=this.extent;let r;if(this.rotation){const{x:a,y:c}=this.extent.center,u=ye(a,c,this.rotation);r=[u(e,t),u(e,o),u(n,o),u(n,t)],r.push(r[0])}else r=[[e,t],[e,o],[n,o],[n,t],[e,t]];return new re({rings:[r],spatialReference:s})}set coords(e){if(e==null||this.extent==null)return;const t=this.extent.spatialReference;if((e=this.projectOrWarn(e,t))==null||e.extent==null)return;const{rings:[[n,o,s]],extent:{center:{x:r,y:a}}}=e,c=We(Math.PI/2-Math.atan2(o[1]-n[1],o[0]-n[0])),u=ye(r,a,-c),[h,f]=u(n[0],n[1]),[x,w]=u(s[0],s[1]);this.extent=new ie({xmin:h,ymin:f,xmax:x,ymax:w,spatialReference:t}),this.rotation=c}};function ye(e,t,n){const o=Be(n),s=Math.cos(o),r=Math.sin(o);return(a,c)=>[s*(a-e)+r*(c-t)+e,s*(c-t)-r*(a-e)+t]}i([l()],A.prototype,"coords",null),i([l({type:ie})],A.prototype,"extent",void 0),i([l({type:Number})],A.prototype,"rotation",void 0),A=i([v("esri.layers.support.ExtentAndRotationGeoreference")],A);const Rt=A,$t={key:"type",base:X,typeMap:{"control-points":je,corners:wt,"extent-and-rotation":Rt}};let N=class extends Ge(_e(Me)){constructor(e){super(e),this.georeference=null,this.opacity=1}readGeoreference(e){return je.fromJSON(e)}};i([l({types:$t,json:{write:!0}})],N.prototype,"georeference",void 0),i([Q("georeference")],N.prototype,"readGeoreference",null),i([l()],N.prototype,"opacity",void 0),N=i([v("esri.layers.support.MediaElementBase")],N);const le=N;let j=class extends le{constructor(t){super(t),this.content=null,this.image=null,this.type="image",this.image=null}load(){const t=this.image;if(typeof t=="string"){const n=ne(t,{responseType:"image"}).then(({data:o})=>{this._set("content",o)});this.addResolvingPromise(n)}else if(t instanceof HTMLImageElement){const n=t.decode().then(()=>{this._set("content",t)});this.addResolvingPromise(n)}else t?this._set("content",t):this.addResolvingPromise(Promise.reject(new D("image-element:invalid-image-type","Invalid image type",{image:t})));return Promise.resolve(this)}readImage(t,n,o){return ze(n.url,o)}writeImage(t,n,o,s){if(t==null)return;const r=s==null?void 0:s.portalItem,a=s==null?void 0:s.resources;if(!r||!a)return void(typeof t=="string"&&(n[o]=pe(t,s)));const c=typeof t!="string"||be(t)||Se(t)?null:t;if(c){if(Fe(c)==null)return void(n[o]=c);const u=pe(c,{...s,verifyItemRelativeUrls:s&&s.verifyItemRelativeUrls?{writtenUrls:s.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},Ue.NO);if(r&&u&&!ke(u))return a.toKeep.push({resource:r.resourceFromPath(u),compress:!1}),void(n[o]=u)}n[o]="",a.pendingOperations.push(Le(t).then(u=>{const h=It(u,r);n[o]=h.itemRelativeUrl,a.toAdd.push({resource:h,content:u,compress:!1,finish:f=>{this.image=f.url}})}))}};i([l({readOnly:!0})],j.prototype,"content",void 0),i([l({json:{name:"url",type:String}})],j.prototype,"image",void 0),i([Q("image",["url"])],j.prototype,"readImage",null),i([se("image")],j.prototype,"writeImage",null),i([l({readOnly:!0,json:{name:"mediaType"}})],j.prototype,"type",void 0),j=i([v("esri.layers.support.ImageElement")],j);const Ee=j;async function Le(e){if(typeof e=="string"){if(Se(e)){const{data:t}=await ne(e,{responseType:"blob"});return t}return be(e)?De(e):Le((await ne(e,{responseType:"image"})).data)}return new Promise(t=>_t(e).toBlob(t))}function _t(e){if(e instanceof HTMLCanvasElement)return e;const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,n=e instanceof HTMLImageElement?e.naturalHeight:e.height,o=document.createElement("canvas"),s=o.getContext("2d");return o.width=t,o.height=n,e instanceof HTMLImageElement?s.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&s.putImageData(e,0,0),o}function It(e,t){const n=Je(),o=`${qe("media",n)}.${dt(e)}`;return t.resourceFromPath(o)}let k=class extends le{constructor(e){super(e),this.content=null,this.type="video"}load(){const e=this.video;if(typeof e=="string"){const t=document.createElement("video");t.src=e,t.crossOrigin="anonymous",t.autoplay=!0,t.muted=!0,t.loop=!0,this.addResolvingPromise(this._loadVideo(t).then(()=>{this._set("content",t)}))}else e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then(()=>{this._set("content",e)})):this.addResolvingPromise(Promise.reject(new D("video-element:invalid-video-type","Invalid video type",{video:e})));return Promise.resolve(this)}set video(e){this.loadStatus==="not-loaded"?this._set("video",e):z.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}_loadVideo(e){return new Promise((t,n)=>{e.oncanplay=()=>{e.oncanplay=null,e.play().then(t,n)},e.crossOrigin!=="anonymous"&&(e.crossOrigin="anonymous",e.src=e.src)})}};i([l({readOnly:!0})],k.prototype,"content",void 0),i([l()],k.prototype,"video",null),k=i([v("esri.layers.support.VideoElement")],k);const Oe=k,Mt={key:"type",defaultKeyValue:"image",base:le,typeMap:{image:Ee,video:Oe}},ge=Y.ofType(Mt);let W=class extends Me.LoadableMixin(Ke(Ye(Qe.EventedAccessor))){constructor(t){super(t),this._index=new ht,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=n=>{for(const s of n.removed){const r=this._elementViewsMap.get(s);this._elementViewsMap.delete(s),this._index.delete(r),this.handles.remove(r),r.destroy(),this.notifyChange("fullExtent")}const{spatialReference:o}=this;for(const s of n.added){if(this._elementViewsMap.get(s))continue;const r=new mt({spatialReference:o,element:s});this._elementViewsMap.set(s,r);const a=Xe(()=>r.coords,()=>this._updateIndexForElement(r,!1));this._updateIndexForElement(r,!0),this.handles.add(a,r)}this._elementsIndexes.clear(),this.elements.forEach((s,r)=>this._elementsIndexes.set(s,r)),this.emit("refresh")},this.elements=new ge}async load(t){if(Ze(t),!this.spatialReference){const n=this.elements.find(o=>o.georeference!=null&&o.georeference.coords!=null);this._set("spatialReference",n?n.georeference.coords.spatialReference:Ie.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.handles.add(this.elements.on("change",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(t){this._set("elements",et(t,this._get("elements"),ge))}get fullExtent(){if(this.loadStatus==="not-loaded")return null;const t=this._index.fullBounds;return t==null?null:new ie({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3],spatialReference:this.spatialReference})}set spatialReference(t){this.loadStatus==="not-loaded"?this._set("spatialReference",t):z.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(t,n){await this.load(),await tt(t.spatialReference,this.spatialReference,null,n);const o=nt(t.spatialReference,this.spatialReference)?t:ot(t,this.spatialReference);if(!o)return[];const s=o.normalize(),r=[];for(const a of s)this._index.forEachInBounds(st(a),({normalizedCoords:c,element:u})=>{c!=null&&rt(a,c)&&r.push(u)});return r.sort((a,c)=>this._elementsIndexes.get(a)-this._elementsIndexes.get(c)),r}_updateIndexForElement(t,n){const o=t.normalizedBounds,s=this._index.has(t),r=o!=null;this._index.delete(t),r&&this._index.set(t,o),this.notifyChange("fullExtent"),n||(s!==r?this.emit("refresh"):this.emit("change",{element:t.element}))}};i([l()],W.prototype,"elements",null),i([l({readOnly:!0})],W.prototype,"fullExtent",null),i([l()],W.prototype,"spatialReference",null),W=i([v("esri.layers.support.LocalMediaElementSource")],W);const K=W;function Pe(e){return typeof e=="object"&&e!=null&&"type"in e}let y=class extends it(at(pt(ut(ct)))){constructor(e){super(e),this.effectiveSource=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this.source=new K}load(e){const t=this.source;if(!t)return this.addResolvingPromise(Promise.reject(new D("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer."))),Promise.resolve(this);const n=Pe(t)?new K({elements:new Y([t])}):t;this._set("effectiveSource",n),this.spatialReference&&(n.spatialReference=this.spatialReference);const o=n.load(e).then(()=>{this.spatialReference=n.spatialReference});return this.addResolvingPromise(o),Promise.resolve(this)}destroy(){var e,t;(e=this.effectiveSource)==null||e.destroy(),(t=this.source)==null||t.destroy()}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}set source(e){this.loadStatus==="not-loaded"?this._set("source",e):z.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(e){return e?Array.isArray(e)?new K({elements:new Y(e)}):e instanceof Y?new K({elements:e}):e:null}readSource(e,t,n){const o=t.mediaType==="image"?new Ee:t.mediaType==="video"?new Oe:null;return o==null||o.read(t,n),o}writeSource(e,t,n,o){var s;e&&Pe(e)&&e.type==="image"?e.write(t,o):o!=null&&o.messages&&((s=o==null?void 0:o.messages)==null||s.push(new D("media-layer:unsupported-source","source must be an 'ImageElement'")))}};i([l({readOnly:!0})],y.prototype,"effectiveSource",void 0),i([l({type:String})],y.prototype,"copyright",void 0),i([l({readOnly:!0})],y.prototype,"fullExtent",null),i([l({type:["MediaLayer"]})],y.prototype,"operationalLayerType",void 0),i([l({type:["show","hide"]})],y.prototype,"listMode",void 0),i([l({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1}}})],y.prototype,"source",null),i([lt("source")],y.prototype,"castSource",null),i([Q("source",["url"])],y.prototype,"readSource",null),i([se("source")],y.prototype,"writeSource",null),i([l()],y.prototype,"spatialReference",void 0),i([l({readOnly:!0})],y.prototype,"type",void 0),y=i([v("esri.layers.MediaLayer")],y);const zt=y;export{zt as default}; diff --git a/assets/MediaLayerView3D-69d89f9a.js b/assets/MediaLayerView3D-69d89f9a.js new file mode 100644 index 0000000..9e8c8c0 --- /dev/null +++ b/assets/MediaLayerView3D-69d89f9a.js @@ -0,0 +1 @@ +import{aQ as v,aD as w,aR as R,aS as T,aT as c,aU as x,aV as o,aW as M,aX as G,aY as S,aZ as O,a_ as s,a$ as _,b0 as z,b1 as b,b2 as d,b3 as I,b4 as y,ai as l,aj as E,al as H}from"./index-080e108a.js";import{i as P}from"./MediaElementView-dc36bc9f.js";import{n as $}from"./LayerView3D-ffd35809.js";import{c as V}from"./ImageMaterial-5c48df66.js";import{d as A}from"./LayerView-448bc5ea.js";import"./normalizeUtilsSync-6be8435f.js";import"./normalizeUtilsCommon-500064b3.js";let i=class extends $(A){constructor(){super(...arguments),this.type="media-3d",this.drapeSourceType=v.RasterImage,this.updatePolicy=w.ASYNC,this._uidToElement=new Map,this._renderedElements=new Map,this._lastDrapingExtent=null,this._update=R(async(e,t,r)=>{const a=await this._collectMediaElements(e,t,r);this._synchronizeRenderElements(a)},0)}initialize(){this._renderer=this.view.basemapTerrain.overlayManager.registerGeometryDrapeSource(this);const e=()=>this._updateWithLastDrapingExtent();this.handles.add([T(()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this)),c(()=>this.layer.effectiveSource,"change",e),c(()=>this.layer.effectiveSource,"refresh",e)]),this.updatingHandles.add(()=>this.suspended,e)}setDrapingExtent(e,t){this._lastDrapingExtent={overlays:e,spatialReference:t},this._updateWithLastDrapingExtent()}getHit(e){const t=this._uidToElement.get(e);return t?{type:"media",element:t,layer:this.layer}:null}_updateWithLastDrapingExtent(){if(this._lastDrapingExtent==null||this.suspended)return void(this._renderer&&this._synchronizeRenderElements(new Set));const{overlays:e,spatialReference:t}=this._lastDrapingExtent;this.updatingHandles.addPromise(this._update(e,t).catch(()=>{}))}async _collectMediaElements(e,t,r){const a=this.layer.effectiveSource;return a==null?new Set:new Set((await Promise.all(e.map(n=>a.queryElements(x(n.extent,t),{signal:r})))).flat())}_synchronizeRenderElements(e){this._synchronizeRenderElementsRemove(e),this._synchronizeRenderElementsAdd(e)}_synchronizeRenderElementsRemove(e){const t=new Set,r=[];this._renderedElements.forEach((a,n)=>{e.has(n)||(t.add(n),a.renderData!=null&&r.push(a.renderData.renderGeometry),this._removeElement(n,a))}),this._renderer.removeGeometries(r,o.REMOVE)}_synchronizeRenderElementsAdd(e){for(const t of e)this._renderedElements.has(t)||this._createRenderElement(t)}_removeElement(e,{renderData:t,handle:r}){this._destroyRenderData(t),this._renderedElements.delete(e),this._uidToElement.delete(e.uid),r.remove()}async _createRenderElement(e){const t=new P({spatialReference:this.view.spatialReference,element:e}),r={renderData:null,handle:M([this.updatingHandles.add(()=>e.opacity,a=>{r.renderData!=null&&r.renderData.material.setParameters({opacity:a})}),this.updatingHandles.add(()=>t.coords,a=>{r.renderData!=null?this._updateGeometry(r,r.renderData,a):this._initializeRenderData(t,r)}),this.updatingHandles.add(()=>e.content,()=>this._initializeRenderData(t,r)),G(t)])};this._renderedElements.set(e,r),this._uidToElement.set(e.uid,e),this.updatingHandles.addPromise(e.load().catch(()=>{})),this._initializeRenderData(t,r)}_initializeRenderData(e,t){const{coords:r,element:a}=e;if(r==null||a.content==null)return void(t.renderData=this._destroyRenderData(t.renderData));if(t.renderData!=null)return;const n=this._createTexture(a.content);this.view._stage.add(n);const h=this.view._stage.loadImmediate(n);S(h)&&this.updatingHandles.addPromise(h);const m=new V({initTextureTransparent:!0,textureId:n.id,opacity:a.opacity,transparent:!0}),D=this._positionVertexBufferFromCoordinates(r),g=[0,0,1,0,1,1,0,1],u=[0,1,2,0,2,3],f=new O(m,[[s.POSITION,new _(D,3,!0)],[s.UV0,new _(g,2,!0)]],[[s.POSITION,u],[s.UV0,u]]),p=new z(f,{layerUid:this.layer.uid,graphicUid:a.uid});this._renderer.addGeometries([p],o.ADD),t.renderData={renderGeometry:p,texture:n,material:m}}_updateGeometry(e,t,r){if(r==null)return void(e.renderData=this._destroyRenderData(e.renderData));const a=this._positionVertexBufferFromCoordinates(r);t.renderGeometry.geometry.setAttributeData(s.POSITION,a),this._renderer.modifyGeometries([t.renderGeometry],b.GEOMETRY)}_positionVertexBufferFromCoordinates(e){const[t,r,a,n]=e.rings[0];return[t[0],t[1],d,n[0],n[1],d,a[0],a[1],d,r[0],r[1],d]}_destroyRenderData(e){return e==null||(this.view._stage.remove(e.texture),this._renderer.removeGeometries([e.renderGeometry],o.REMOVE),e.material.dispose()),null}_createTexture(e){const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,r=e instanceof HTMLImageElement?e.naturalHeight:e.height;return new I(e,{wrap:{s:y.CLAMP_TO_EDGE,t:y.CLAMP_TO_EDGE},preMultiplyAlpha:!0,width:t,height:r,mipmap:!0,updateCallback:()=>this.view.basemapTerrain.overlayManager.setDrawTexturesDirty()})}get test(){const e=this;return{get numberOfElements(){return e._renderedElements.size}}}};l([E({readOnly:!0})],i.prototype,"type",void 0),l([E()],i.prototype,"layer",void 0),i=l([H("esri.views.3d.layers.MediaLayerView3D")],i);const Y=i;export{Y as default}; diff --git a/assets/MemorySourceWorker-31156e3d.js b/assets/MemorySourceWorker-31156e3d.js new file mode 100644 index 0000000..a73f58e --- /dev/null +++ b/assets/MemorySourceWorker-31156e3d.js @@ -0,0 +1 @@ +import{ar as I,ep as v,bS as S,es as b,et as R,eu as M,ev as Q,eo as w,dF as D}from"./index-080e108a.js";import{t as Z,n as A}from"./objectIdUtils-789e911a.js";import{m as k}from"./FeatureStore-f0e312fc.js";import{e as C,f as _,g as E}from"./QueryEngine-19eda5ff.js";import{i as P,o as G,a as $}from"./clientSideDefaults-ab04bd90.js";import{y as z,u as g,d as x,c as T,h as q}from"./sourceUtils-e3b344c8.js";import{r as B}from"./FieldsIndex-f79a8f26.js";import"./BoundsStore-b6bd3c14.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./defaultsJSON-59981e75.js";const L=w,W={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:w},U={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};function H(m){return D(m)?m.z!=null:!!m.hasZ}function V(m){return D(m)?m.m!=null:!!m.hasM}class he{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine&&this._queryEngine&&this._queryEngine.destroy(),this._queryEngine=this._fieldsIndex=this._createDefaultAttributes=null}async load(e){const t=[],{features:a}=e,i=this._inferLayerProperties(a,e.fields),d=e.fields||[],p=e.hasM!=null?e.hasM:!!i.hasM,c=e.hasZ!=null?e.hasZ:!!i.hasZ,f=!e.spatialReference&&!i.spatialReference,u=f?L:e.spatialReference||i.spatialReference,y=f?W:null,r=e.geometryType||i.geometryType,l=!r;let o=e.objectIdField||i.objectIdField,s=e.timeInfo;if(!l&&(f&&t.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!r))throw new I("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!o)throw new I("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(i.objectIdField&&o!==i.objectIdField&&(t.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${o}" doesn't match the field name "${i.objectIdField}", found in the provided fields`}),o=i.objectIdField),o&&!i.objectIdField){let n=null;d.some(h=>h.name===o&&(n=h,!0))?(n.type="esriFieldTypeOID",n.editable=!1,n.nullable=!1):d.unshift({alias:o,name:o,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const n of d){if(n.name==null&&(n.name=n.alias),n.alias==null&&(n.alias=n.name),!n.name)throw new I("feature-layer:invalid-field-name","field name is missing",{field:n});if(n.name===o&&(n.type="esriFieldTypeOID"),!v.jsonValues.includes(n.type))throw new I("feature-layer:invalid-field-type",`invalid type for field "${n.name}"`,{field:n})}const F={};for(const n of d)if(n.type!=="esriFieldTypeOID"&&n.type!=="esriFieldTypeGlobalID"){const h=S(n);h!==void 0&&(F[n.name]=h)}if(this._fieldsIndex=new B(d),this._createDefaultAttributes=P(F,o),s){if(s.startTimeField){const n=this._fieldsIndex.get(s.startTimeField);n?(s.startTimeField=n.name,n.type="esriFieldTypeDate"):s.startTimeField=null}if(s.endTimeField){const n=this._fieldsIndex.get(s.endTimeField);n?(s.endTimeField=n.name,n.type="esriFieldTypeDate"):s.endTimeField=null}if(s.trackIdField){const n=this._fieldsIndex.get(s.trackIdField);n?s.trackIdField=n.name:(s.trackIdField=null,t.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:s}}))}s.startTimeField||s.endTimeField||(t.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:s}}),s=null)}const j={warnings:t,featureErrors:[],layerDefinition:{...U,drawingInfo:G(r),templates:$(F),extent:y,geometryType:r,objectIdField:o,fields:d,hasZ:c,hasM:p,timeInfo:s},assignedObjectIds:{}};if(this._queryEngine=new C({fields:d,geometryType:r,hasM:p,hasZ:c,objectIdField:o,spatialReference:u,featureStore:new k({geometryType:r,hasM:p,hasZ:c}),timeInfo:s,cacheSpatialQueries:!0}),!a||!a.length)return this._nextObjectId=Z,j;const O=A(o,a);return this._nextObjectId=O+1,await _(a,u),this._loadInitialFeatures(j,a)}async applyEdits(e){const{spatialReference:t,geometryType:a}=this._queryEngine;return await Promise.all([z(t,a),_(e.adds,t),_(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return this._queryEngine.executeQueryForSnapping(e,t.signal)}_inferLayerProperties(e,t){let a,i,d=null,p=null,c=null;for(const f of e){const u=f.geometry;if(u!=null&&(d||(d=b(u)),p||(p=u.spatialReference),a==null&&(a=H(u)),i==null&&(i=V(u)),d&&p&&a!=null&&i!=null))break}if(t&&t.length){let f=null;t.some(u=>{const y=u.type==="esriFieldTypeOID",r=!u.type&&u.name&&u.name.toLowerCase()==="objectid";return f=u,y||r})&&(c=f.name)}return{geometryType:d,spatialReference:p,objectIdField:c,hasM:i,hasZ:a}}async _loadInitialFeatures(e,t){const{geometryType:a,hasM:i,hasZ:d,objectIdField:p,spatialReference:c,featureStore:f}=this._queryEngine,u=[];for(const l of t){if(l.uid!=null&&(e.assignedObjectIds[l.uid]=-1),l.geometry&&a!==b(l.geometry)){e.featureErrors.push(g("Incorrect geometry type."));continue}const o=this._createDefaultAttributes(),s=x(this._fieldsIndex,o,l.attributes,!0,e.warnings);s?e.featureErrors.push(s):(this._assignObjectId(o,l.attributes,!0),l.attributes=o,l.uid!=null&&(e.assignedObjectIds[l.uid]=l.attributes[p]),l.geometry!=null&&(l.geometry=E(l.geometry,l.geometry.spatialReference,c)),u.push(l))}f.addMany(R([],u,a,d,i,p));const{fullExtent:y,timeExtent:r}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=y,r){const{start:l,end:o}=r;e.layerDefinition.timeInfo.timeExtent=[l,o]}return e}async _applyEdits(e){const{adds:t,updates:a,deletes:i}=e,d={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t&&t.length&&this._applyAddEdits(d,t),a&&a.length&&this._applyUpdateEdits(d,a),i&&i.length){for(const f of i)d.deleteResults.push(T(f));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:p,timeExtent:c}=await this._queryEngine.fetchRecomputedExtents();return{extent:p,timeExtent:c,featureEditResults:d}}_applyAddEdits(e,t){const{addResults:a}=e,{geometryType:i,hasM:d,hasZ:p,objectIdField:c,spatialReference:f,featureStore:u}=this._queryEngine,y=[];for(const r of t){if(r.geometry&&i!==b(r.geometry)){a.push(g("Incorrect geometry type."));continue}const l=this._createDefaultAttributes(),o=x(this._fieldsIndex,l,r.attributes);if(o)a.push(o);else{if(this._assignObjectId(l,r.attributes),r.attributes=l,r.uid!=null){const s=r.attributes[c];e.uidToObjectId[r.uid]=s}if(r.geometry!=null){const s=r.geometry.spatialReference??f;r.geometry=E(q(r.geometry,s),s,f)}y.push(r),a.push(T(r.attributes[c]))}}u.addMany(R([],y,i,p,d,c))}_applyUpdateEdits({updateResults:e},t){const{geometryType:a,hasM:i,hasZ:d,objectIdField:p,spatialReference:c,featureStore:f}=this._queryEngine;for(const u of t){const{attributes:y,geometry:r}=u,l=y&&y[p];if(l==null){e.push(g(`Identifier field ${p} missing`));continue}if(!f.has(l)){e.push(g(`Feature with object id ${l} missing`));continue}const o=M(f.getFeature(l),a,d,i);if(r!=null){if(a!==b(r)){e.push(g("Incorrect geometry type."));continue}const s=r.spatialReference??c;o.geometry=E(q(r,s),s,c)}if(y){const s=x(this._fieldsIndex,o.attributes,y);if(s){e.push(s);continue}}f.add(Q(o,a,d,i,p)),e.push(T(l))}}_assignObjectId(e,t,a=!1){const i=this._queryEngine.objectIdField;a&&t&&isFinite(t[i])?e[i]=t[i]:e[i]=this._nextObjectId++}}export{he as default}; diff --git a/assets/MultiOriginJSONSupport-e4912ffd.js b/assets/MultiOriginJSONSupport-e4912ffd.js new file mode 100644 index 0000000..b16939a --- /dev/null +++ b/assets/MultiOriginJSONSupport-e4912ffd.js @@ -0,0 +1 @@ +import{hZ as _,c_ as h,cl as d,bO as E,ai as g,al as l,bu as c,h_ as m,h$ as w,da as u,i0 as J,ao as M,i1 as N}from"./index-080e108a.js";class f{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(_),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new f,s=this._originStores[h.DEFAULTS];s&&s.forEach((r,i)=>{t.set(i,d(r),h.DEFAULTS)});for(let r=h.SERVICE;r<_;r++){const i=this._originStores[r];i&&i.forEach((o,n)=>{e&&e.has(n)||t.set(n,d(o),r)})}return t}get(e,t){const s=t===void 0?this._values:this._originStores[t];return s?s.get(e):void 0}keys(e){const t=e==null?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,s=h.USER){let r=this._originStores[s];if(r||(r=new Map,this._originStores[s]=r),r.set(e,t),!this._values.has(e)||E(this._propertyOriginMap.get(e))<=s){const i=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,s),i!==t}return!1}delete(e,t=h.USER){const s=this._originStores[t];if(!s)return;const r=s.get(e);if(s.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let i=t-1;i>=0;i--){const o=this._originStores[i];if(o&&o.has(e)){this._values.set(e,o.get(e)),this._propertyOriginMap.set(e,i);break}}}return r}has(e,t){const s=t===void 0?this._values:this._originStores[t];return!!s&&s.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const s=this._originStores[t],r=s&&s.get(e),i=this._values.get(e);return this._values.set(e,r),this._propertyOriginMap.set(e,t),i!==r}originOf(e){return this._propertyOriginMap.get(e)||h.DEFAULTS}forEach(e){this._values.forEach(e)}}const $=a=>{let e=class extends a{constructor(...t){super(...t);const s=E(c(this)),r=s.store,i=new f;s.store=i,m(s,r,i)}read(t,s){w(this,t,s)}getAtOrigin(t,s){const r=O(this),i=u(s);if(typeof t=="string")return r.get(t,i);const o={};return t.forEach(n=>{o[n]=r.get(n,i)}),o}originOf(t){return J(this.originIdOf(t))}originIdOf(t){return O(this).originOf(t)}revert(t,s){const r=O(this),i=u(s),o=c(this);let n;n=typeof t=="string"?t==="*"?r.keys(i):[t]:t,n.forEach(p=>{o.invalidate(p),r.revert(p,i),o.commit(p)})}};return e=g([l("esri.core.ReadOnlyMultiOriginJSONSupport")],e),e};function O(a){return c(a).store}let v=class extends $(M){};v=g([l("esri.core.ReadOnlyMultiOriginJSONSupport")],v);const A=a=>{let e=class extends a{constructor(...t){super(...t)}clear(t,s="user"){return S(this).delete(t,u(s))}write(t,s){return N(this,t=t||{},s),t}setAtOrigin(t,s,r){c(this).setAtOrigin(t,s,u(r))}removeOrigin(t){const s=S(this),r=u(t),i=s.keys(r);for(const o of i)s.originOf(o)===r&&s.set(o,s.get(o,r),h.USER)}updateOrigin(t,s){const r=S(this),i=u(s),o=this.get(t);for(let n=i+1;n<_;++n)r.delete(t,n);r.set(t,o,i)}toJSON(t){return this.write({},t)}};return e=g([l("esri.core.WriteableMultiOriginJSONSupport")],e),e.prototype.toJSON.isDefaultToJSON=!0,e};function S(a){return c(a).store}const x=a=>{let e=class extends A($(a)){constructor(...s){super(...s)}};return e=g([l("esri.core.MultiOriginJSONSupport")],e),e};let y=class extends x(M){};y=g([l("esri.core.MultiOriginJSONSupport")],y);export{x as O,y as S}; diff --git a/assets/NativeLine.glsl-1fd72627.js b/assets/NativeLine.glsl-1fd72627.js new file mode 100644 index 0000000..cc1bc71 --- /dev/null +++ b/assets/NativeLine.glsl-1fd72627.js @@ -0,0 +1 @@ +import{aa as r}from"./index-080e108a.js";export{r as build}; diff --git a/assets/NoiseTextureAtlas.glsl-655df1b4.js b/assets/NoiseTextureAtlas.glsl-655df1b4.js new file mode 100644 index 0000000..9d15c69 --- /dev/null +++ b/assets/NoiseTextureAtlas.glsl-655df1b4.js @@ -0,0 +1 @@ +import{C as e,E as r}from"./index-080e108a.js";export{e as NoiseTextureAtlasPassParameters,r as build}; diff --git a/assets/OGCFeatureLayer-257da298.js b/assets/OGCFeatureLayer-257da298.js new file mode 100644 index 0000000..c3143cb --- /dev/null +++ b/assets/OGCFeatureLayer-257da298.js @@ -0,0 +1 @@ +import{ai as r,aj as i,al as D,gC as B,bc as C,hs as L,ar as R,eQ as N,eS as H,eR as J,hi as F,hj as Z,cq as k,ca as z,fy as I,cC as U,aA as V}from"./index-080e108a.js";import"./UniqueValueRenderer-fef4204d.js";import{p as W,n as K}from"./jsonUtils-f73b3833.js";import{O as X}from"./MultiOriginJSONSupport-e4912ffd.js";import{x as Y,b as O,k as $,I as ee,F as te,j as re,T as oe,h as ie,w as se}from"./ogcFeatureUtils-1ccf1f8d.js";import{d as pe}from"./FeatureSet-111cb247.js";import{i as ne}from"./APIKeyMixin-878a7aa7.js";import{o as ae}from"./CustomParametersMixin-231c4be8.js";import{p as le}from"./FeatureEffectLayer-4160946c.js";import{n as ue}from"./FeatureReductionLayer-4262cf54.js";import{c as de}from"./OperationalLayer-0e8f8b28.js";import{c as ce}from"./OrderedLayer-68067459.js";import{j as ye}from"./PortalLayer-310c2800.js";import{a as me}from"./TemporalLayer-f17c9161.js";import{d as fe,m as he,c as ge,p as ve,l as Se,f as Ce}from"./commonProperties-30089b06.js";import{n as be}from"./FeatureType-db96032c.js";import{s as we}from"./fieldProperties-62c55499.js";import{C as xe}from"./LabelClass-2d53c485.js";import{i as Re}from"./labelingInfo-144f3d9f.js";import{b as T}from"./Query-1c961d4c.js";import{p as Fe}from"./popupUtils-82ea8abb.js";import"./diffUtils-590c9088.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./geojson-077f67ec.js";import"./clientSideDefaults-ab04bd90.js";import"./QueryEngineCapabilities-42e44ded.js";import"./defaultsJSON-59981e75.js";import"./FeatureEffect-86735d98.js";import"./FeatureFilter-00f4be05.js";import"./featureLayerUtils-6cf06f83.js";import"./sql-734ecbc5.js";import"./AttachmentQuery-972bbd60.js";import"./RelationshipQuery-39c07195.js";import"./portalItemUtils-792a27e1.js";import"./FeatureTemplate-2a7e96c1.js";import"./defaults-34554cbf.js";let d=class extends B{constructor(){super(...arguments),this.featureDefinition=null,this.type="ogc-feature"}load(e){return this.addResolvingPromise(this._loadOGCServices(this.layer,e)),this.when()}getSource(){const{featureDefinition:{collection:e,layerDefinition:t,spatialReference:s,supportedCrs:p},layer:{apiKey:n,customParameters:l,effectiveMaxRecordCount:a}}=this;return{type:"ogc-source",collection:e,layerDefinition:t,maxRecordCount:a,queryParameters:{apiKey:n,customParameters:l},spatialReference:s,supportedCrs:p}}queryExtent(e,t={}){return null}queryFeatureCount(e,t={}){return null}queryFeatures(e,t={}){return this.queryFeaturesJSON(e,t).then(s=>pe.fromJSON(s))}queryFeaturesJSON(e,t={}){const s=this.getSource();return this.load(t).then(()=>Y(s,e,t))}queryObjectIds(e,t={}){return null}serviceSupportsSpatialReference(e){return!(!e.isWGS84&&!e.isWebMercator)||!!this.featureDefinition.supportedCrs[e.wkid]}_conformsToType(e,t){const s=new RegExp(`^${t}$`,"i");return e.conformsTo.some(p=>s.test(p))??!1}_getCapabilities(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:t,maxRecordCountFactor:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,tileMaxRecordCount:void 0},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1}}}_getMaxRecordCount(e){var s,p,n,l,a;const t=(s=e==null?void 0:e.components)==null?void 0:s.parameters;return((n=(p=t==null?void 0:t.limit)==null?void 0:p.schema)==null?void 0:n.maximum)??((a=(l=t==null?void 0:t.limitFeatures)==null?void 0:l.schema)==null?void 0:a.maximum)}_getStorageSpatialReference(e){const t=e.storageCrs??O,s=$(t);return s==null?C.WGS84:new C({wkid:s})}_getSupportedSpatialReferences(e,t){const s="#/crs",p=e.crs??[O],n=p.includes(s)?p.filter(a=>a!==s).concat(t.crs??[]):p,l=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return n.filter(a=>!l.test(a))}async _loadOGCServices(e,t){const s=t!=null?t.signal:null,{apiKey:p,collectionId:n,customParameters:l,fields:a,geometryType:m,hasZ:f,objectIdField:j,timeInfo:h,url:E}=e,P={fields:a==null?void 0:a.map(u=>u.toJSON()),geometryType:L.toJSON(m),hasZ:f??!1,objectIdField:j,timeInfo:h==null?void 0:h.toJSON()},c={apiKey:p,customParameters:l,signal:s},g=await ee(E,c),[b,w]=await Promise.all([te(g,c),re(g,c)]);if(!this._conformsToType(b,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new R("ogc-feature-layer:no-geojson-support","Server does not support geojson");const y=w.collections.find(u=>u.id===n);if(!y)throw new R("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const _=this._conformsToType(b,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await oe(g,c):null,x=await ie(y,P,c),q=this._getMaxRecordCount(_),A=this._getCapabilities(x.hasZ,q),M=this._getStorageSpatialReference(y).toJSON(),G=this._getSupportedSpatialReferences(y,w),Q=new RegExp(`^${se}`,"i"),v={};for(const u of G){const S=$(u);S!=null&&(v[S]||(v[S]=u.replace(Q,"")))}this.featureDefinition={capabilities:A,collection:y,layerDefinition:x,spatialReference:M,supportedCrs:v}}};r([i()],d.prototype,"featureDefinition",void 0),r([i({constructOnly:!0})],d.prototype,"layer",void 0),r([i()],d.prototype,"type",void 0),d=r([D("esri.layers.graphics.sources.OGCFeatureSource")],d);const Ie=we();let o=class extends ne(ae(ue(le(N(ce(me(H(de(ye(J(X(V)))))))))))){constructor(e){super(e),this.capabilities=null,this.collectionId=null,this.copyright=null,this.definitionExpression=null,this.description=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxRecordCount=null,this.objectIdField=null,this.operationalLayerType="OGCFeatureLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=null,this.title=null,this.type="ogc-feature",this.typeIdField=null,this.types=null,this.url=null}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["OGCFeatureServer"]},e).then(()=>this._fetchService(e))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get effectiveMaxRecordCount(){var e;return this.maxRecordCount??((e=this.capabilities)==null?void 0:e.query.maxRecordCount)??5e3}get isTable(){return this.loaded&&this.geometryType==null}set renderer(e){F(e,this.fieldsIndex),this._set("renderer",e)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return Fe(this,e)}createQuery(){return new T}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var a;let s,p=!1;const n=(a=t==null?void 0:t.feature)==null?void 0:a.attributes,l=this.typeIdField&&(n==null?void 0:n[this.typeIdField]);return l!=null&&this.types&&(p=this.types.some(m=>{var f;return m.id==l&&(s=(f=m.domains)==null?void 0:f[e],(s==null?void 0:s.type)==="inherited"&&(s=this._getLayerDomain(e)),!0)})),p||s||(s=this._getLayerDomain(e)),s}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(T.from(e)||this.createQuery(),t)).then(s=>{var p;return(p=s==null?void 0:s.features)==null||p.forEach(n=>{n.layer=n.sourceLayer=this}),s})}serviceSupportsSpatialReference(e){var t;return((t=this.source)==null?void 0:t.serviceSupportsSpatialReference(e))??!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:"service"}),F(this.renderer,this.fieldsIndex),Z(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const t of this.fields)if(t.name===e&&t.domain)return t.domain;return null}};r([i({readOnly:!0,json:{origins:{service:{read:!0}}}})],o.prototype,"capabilities",void 0),r([i({type:String,json:{write:!0}})],o.prototype,"collectionId",void 0),r([i({type:String})],o.prototype,"copyright",void 0),r([i({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),r([i({type:String})],o.prototype,"definitionExpression",void 0),r([i({readOnly:!0,type:String,json:{origins:{service:{name:"collection.description"}}}})],o.prototype,"description",void 0),r([i({type:String})],o.prototype,"displayField",void 0),r([i({type:Number})],o.prototype,"effectiveMaxRecordCount",null),r([i(fe)],o.prototype,"elevationInfo",void 0),r([i({type:[k],json:{origins:{service:{name:"layerDefinition.fields"}}}})],o.prototype,"fields",void 0),r([i(Ie.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([i({readOnly:!0,type:z,json:{origins:{service:{name:"layerDefinition.extent"}}}})],o.prototype,"fullExtent",void 0),r([i({type:I.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:I.read}}}}})],o.prototype,"geometryType",void 0),r([i({type:Boolean,json:{origins:{service:{name:"layerDefinition.hasZ"}}}})],o.prototype,"hasZ",void 0),r([i({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),r([i({type:[xe],json:{origins:{"web-document":{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Re},write:!0}}}})],o.prototype,"labelingInfo",void 0),r([i(he)],o.prototype,"labelsVisible",void 0),r([i(ge)],o.prototype,"legendEnabled",void 0),r([i({type:Number})],o.prototype,"maxRecordCount",void 0),r([i({type:String,json:{origins:{service:{name:"layerDefinition.objectIdField"}}}})],o.prototype,"objectIdField",void 0),r([i({type:["OGCFeatureLayer"]})],o.prototype,"operationalLayerType",void 0),r([i(ve)],o.prototype,"popupEnabled",void 0),r([i({type:U,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([i({types:W,json:{origins:{service:{name:"layerDefinition.drawingInfo.renderer",write:!1},"web-scene":{types:K,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:!0}})],o.prototype,"renderer",null),r([i(Se)],o.prototype,"screenSizePerspectiveEnabled",void 0),r([i({readOnly:!0})],o.prototype,"source",void 0),r([i({readOnly:!0,type:C,json:{origins:{service:{read:!0}}}})],o.prototype,"spatialReference",void 0),r([i({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"collection.title"}}}})],o.prototype,"title",void 0),r([i({readOnly:!0,json:{read:!1}})],o.prototype,"type",void 0),r([i({type:String,readOnly:!0})],o.prototype,"typeIdField",void 0),r([i({type:[be]})],o.prototype,"types",void 0),r([i(Ce)],o.prototype,"url",void 0),o=r([D("esri.layers.OGCFeatureLayer")],o);const dt=o;export{dt as default}; diff --git a/assets/OGCFeatureLayerView3D-dbd9812b.js b/assets/OGCFeatureLayerView3D-dbd9812b.js new file mode 100644 index 0000000..0cf40ef --- /dev/null +++ b/assets/OGCFeatureLayerView3D-dbd9812b.js @@ -0,0 +1 @@ +import{ai as t,aj as e,al as o,ar as a}from"./index-080e108a.js";import{_ as s}from"./FeatureLayerViewBase3D-8474587e.js";import"./FeatureLikeLayerView3D-2e3185ce.js";import"./Query-1c961d4c.js";import"./dehydratedFeatureComparison-a3375a3e.js";import"./queryForSymbologySnapping-0264f2b5.js";import"./elevationInfoUtils-4fd79d95.js";import"./hash-6f442295.js";import"./diffUtils-590c9088.js";import"./Graphics3DObjectStates-bb2a6162.js";import"./UniqueValueRenderer-fef4204d.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./popupUtils-f04ec9a9.js";import"./FeatureFilter-00f4be05.js";import"./floorFilterUtils-080a7cd2.js";import"./QueryEngine-19eda5ff.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./FeatureSet-111cb247.js";import"./FeatureStore-f0e312fc.js";import"./BoundsStore-b6bd3c14.js";import"./projectExtentUtils-efa4cddd.js";import"./LayerView3D-ffd35809.js";import"./query-93c6e211.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./EventedSet-d13fada5.js";import"./commonProperties-30089b06.js";import"./FeatureEffect-86735d98.js";import"./LayerView-448bc5ea.js";import"./RefreshableLayerView-915e7f53.js";const l=p=>{let r=class extends p{get availableFields(){return this.layer.fieldsIndex.fields.map(m=>m.name)}};return t([e()],r.prototype,"layer",void 0),t([e({readOnly:!0})],r.prototype,"availableFields",null),r=t([o("esri.views.layers.OGCFeatureLayerView")],r),r};let i=class extends l(s){constructor(){super(...arguments),this.type="ogc-feature-3d"}initialize(){this.layer.serviceSupportsSpatialReference(this.view.spatialReference)||this.addResolvingPromise(Promise.reject(new a("layerview:spatial-reference-incompatible","The spatial references supported by this OGC layer are incompatible with the spatial reference of the view",{layer:this.layer})))}};t([e()],i.prototype,"layer",void 0),i=t([o("esri.views.3d.layers.OGCFeatureLayerView3D")],i);const er=i;export{er as default}; diff --git a/assets/OITCompositing.glsl-858510ff.js b/assets/OITCompositing.glsl-858510ff.js new file mode 100644 index 0000000..7a84fd5 --- /dev/null +++ b/assets/OITCompositing.glsl-858510ff.js @@ -0,0 +1 @@ +import{s as o,z as r}from"./index-080e108a.js";export{o as OITCompositingPassParameters,r as build}; diff --git a/assets/OpenStreetMapLayer-3ecd3975.js b/assets/OpenStreetMapLayer-3ecd3975.js new file mode 100644 index 0000000..6b51c65 --- /dev/null +++ b/assets/OpenStreetMapLayer-3ecd3975.js @@ -0,0 +1 @@ +import{ai as t,aj as l,b5 as a,bV as s,al as i,c7 as p,bc as r,f2 as e,ca as c}from"./index-080e108a.js";import{L as u}from"./WebTileLayer-df8c0816.js";import"./MultiOriginJSONSupport-e4912ffd.js";import"./OperationalLayer-0e8f8b28.js";import"./commonProperties-30089b06.js";import"./PortalLayer-310c2800.js";import"./portalItemUtils-792a27e1.js";import"./imageBitmapUtils-391f7b8f.js";let o=class extends u{constructor(...n){super(...n),this.portalItem=null,this.isReference=null,this.tileInfo=new s({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new p({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:r.WebMercator}),spatialReference:r.WebMercator,lods:[new e({level:0,scale:591657527591555e-6,resolution:156543.033928}),new e({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new e({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new e({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new e({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new e({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new e({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new e({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new e({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new e({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new e({level:10,scale:577790.554289,resolution:152.874056570411}),new e({level:11,scale:288895.277144,resolution:76.4370282850732}),new e({level:12,scale:144447.638572,resolution:38.2185141425366}),new e({level:13,scale:72223.819286,resolution:19.1092570712683}),new e({level:14,scale:36111.909643,resolution:9.55462853563415}),new e({level:15,scale:18055.954822,resolution:4.77731426794937}),new e({level:16,scale:9027.977411,resolution:2.38865713397468}),new e({level:17,scale:4513.988705,resolution:1.19432856685505}),new e({level:18,scale:2256.994353,resolution:.597164283559817}),new e({level:19,scale:1128.497176,resolution:.298582141647617})]}),this.subDomains=["a","b","c"],this.fullExtent=new c(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,r.WebMercator),this.urlTemplate="https://{subDomain}.tile.openstreetmap.org/{level}/{col}/{row}.png",this.operationalLayerType="OpenStreetMap",this.type="open-street-map",this.copyright="Map data © OpenStreetMap contributors, CC-BY-SA"}get refreshInterval(){return 0}};t([l({type:a,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"portalItem",void 0),t([l({type:Boolean,json:{read:!1,write:!1}})],o.prototype,"isReference",void 0),t([l({type:Number,readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"refreshInterval",null),t([l({type:s,json:{write:!1}})],o.prototype,"tileInfo",void 0),t([l({type:["show","hide"]})],o.prototype,"listMode",void 0),t([l({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"subDomains",void 0),t([l({readOnly:!0,json:{read:!1,write:!1},nonNullable:!0})],o.prototype,"fullExtent",void 0),t([l({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"urlTemplate",void 0),t([l({type:["OpenStreetMap"]})],o.prototype,"operationalLayerType",void 0),t([l({json:{read:!1}})],o.prototype,"type",void 0),t([l({json:{read:!1,write:!1}})],o.prototype,"copyright",void 0),t([l({json:{read:!1,write:!1}})],o.prototype,"wmtsInfo",void 0),o=t([i("esri.layers.OpenStreetMapLayer")],o);const j=o;export{j as default}; diff --git a/assets/OperationalLayer-0e8f8b28.js b/assets/OperationalLayer-0e8f8b28.js new file mode 100644 index 0000000..4dca20e --- /dev/null +++ b/assets/OperationalLayer-0e8f8b28.js @@ -0,0 +1 @@ +import{ai as t,aj as l,bY as s,al as m,fM as G,fN as v,ar as c,dd as w}from"./index-080e108a.js";import{S as A,u as b}from"./commonProperties-30089b06.js";const d={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CSV:!0,GeoRSS:!0,GeoJSON:!0,GroupLayer:!0,KML:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},u={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0,BingMapsAerial:!0,BingMapsRoad:!0,BingMapsHybrid:!0},g={ArcGISFeatureLayer:!0},T={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,GroupLayer:!0,IntegratedMeshLayer:!0,OGCFeatureLayer:!0,PointCloudLayer:!0,WebTiledLayer:!0,CSV:!0,GeoJSON:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,KML:!0,RasterDataLayer:!0,Voxel:!0,LineOfSightLayer:!0},"web-scene/basemap":{ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,WebTiledLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,ArcGISImageServiceLayer:!0,WMS:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-map/operational-layers":d,"web-map/basemap":u,"web-map/tables":g,"link-chart/operational-layers":{...d,LinkChartLayer:!0},"link-chart/basemap":u,"link-chart/tables":g,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISSceneServiceLayer:!0,PointCloudLayer:!0,BuildingSceneLayer:!0,IntegratedMeshLayer:!0,OrientedImageryLayer:!0}},$=I=>{let r=class extends I{constructor(){super(...arguments),this.title=null}writeListMode(a,e,i,n){(n&&n.layerContainerType==="ground"||a&&G(this,i,{},n))&&(e[i]=a)}writeOperationalLayerType(a,e,i,n){!a||n&&n.layerContainerType==="tables"||(e.layerType=a)}writeTitle(a,e){e.title=a??"Layer"}read(a,e){e&&(e.layer=this),v(this,a,i=>super.read(a,i),e)}write(a,e){var S,L;if(e!=null&&e.origin){const y=`${e.origin}/${e.layerContainerType||"operational-layers"}`,o=T[y];let p=!!(o!=null&&o[this.operationalLayerType]);if(this.operationalLayerType==="ArcGISTiledElevationServiceLayer"&&y==="web-scene/operational-layers"&&(p=!1),this.operationalLayerType==="ArcGISDimensionLayer"&&y==="web-map/operational-layers"&&(p=!1),!p)return(S=e.messages)==null||S.push(new c("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${y}'`,{layer:this})),null}const i=super.write(a,{...e,layer:this}),n=!!e&&!!e.messages&&!!e.messages.filter(y=>y instanceof c&&y.name==="web-document-write:property-required").length;return w(i==null?void 0:i.url)?((L=e==null?void 0:e.messages)==null||L.push(new c("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&n?null:i}beforeSave(){}};return t([l({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],r.prototype,"id",void 0),t([l(A)],r.prototype,"listMode",void 0),t([s("listMode")],r.prototype,"writeListMode",null),t([l({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1}}}})],r.prototype,"operationalLayerType",void 0),t([s("operationalLayerType")],r.prototype,"writeOperationalLayerType",null),t([l(b)],r.prototype,"opacity",void 0),t([l({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],r.prototype,"title",void 0),t([s("title"),s(["web-scene"],"title")],r.prototype,"writeTitle",null),t([l({type:Boolean,json:{name:"visibility"}})],r.prototype,"visible",void 0),r=t([m("esri.layers.mixins.OperationalLayer")],r),r};export{$ as c}; diff --git a/assets/OrderedLayer-68067459.js b/assets/OrderedLayer-68067459.js new file mode 100644 index 0000000..e01bc05 --- /dev/null +++ b/assets/OrderedLayer-68067459.js @@ -0,0 +1 @@ +import{cp as y,ai as t,aj as n,al as p,ck as f,cO as w}from"./index-080e108a.js";var c;const l=new y({asc:"ascending",desc:"descending"});let s=c=class extends f{constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new c({field:this.field,valueExpression:this.valueExpression,order:this.order})}};t([n({type:String,json:{write:!0}})],s.prototype,"field",void 0),t([n({type:String,json:{write:!0}})],s.prototype,"valueExpression",void 0),t([n({type:l.apiValues,json:{read:l.read,write:l.write}})],s.prototype,"order",void 0),s=c=t([p("esri.layers.support.OrderByInfo")],s);const u=s;function v(e,r,o){if(!e)return null;const d=e.find(a=>!!a.field);if(!d)return null;const i=new u;return i.read(d,o),[i]}function g(e,r,o,d){const i=e.find(a=>!!a.field);i&&w(o,[i.toJSON()],r)}const h=e=>{let r=class extends e{constructor(){super(...arguments),this.orderBy=null}};return t([n({type:[u],json:{origins:{"web-scene":{write:!1,read:!1}},read:{source:"layerDefinition.orderBy",reader:v},write:{target:"layerDefinition.orderBy",writer:g}}})],r.prototype,"orderBy",void 0),r=t([p("esri.layers.mixins.OrderedLayer")],r),r};export{h as c}; diff --git a/assets/OrientedImageryLayer-2b6cc12d.js b/assets/OrientedImageryLayer-2b6cc12d.js new file mode 100644 index 0000000..28232cd --- /dev/null +++ b/assets/OrientedImageryLayer-2b6cc12d.js @@ -0,0 +1 @@ +import{ai as r,aj as t,al as s,ar as y}from"./index-080e108a.js";import n from"./FeatureLayer-5c6d2c3b.js";import"./UniqueValueRenderer-fef4204d.js";import"./diffUtils-590c9088.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./MultiOriginJSONSupport-e4912ffd.js";import"./sql-734ecbc5.js";import"./FeatureLayerBase-7c7dfccb.js";import"./commonProperties-30089b06.js";import"./featureLayerUtils-6cf06f83.js";import"./AttachmentQuery-972bbd60.js";import"./Query-1c961d4c.js";import"./RelationshipQuery-39c07195.js";import"./serviceCapabilitiesUtils-959e798a.js";import"./editsZScale-1b5a53a6.js";import"./queryZScale-8f9616ff.js";import"./FeatureSet-111cb247.js";import"./APIKeyMixin-878a7aa7.js";import"./ArcGISService-83287338.js";import"./CustomParametersMixin-231c4be8.js";import"./EditBusLayer-d71787e9.js";import"./FeatureEffectLayer-4160946c.js";import"./FeatureEffect-86735d98.js";import"./FeatureFilter-00f4be05.js";import"./FeatureReductionLayer-4262cf54.js";import"./LabelClass-2d53c485.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./OperationalLayer-0e8f8b28.js";import"./OrderedLayer-68067459.js";import"./PortalLayer-310c2800.js";import"./portalItemUtils-792a27e1.js";import"./TemporalLayer-f17c9161.js";import"./FeatureTemplate-2a7e96c1.js";import"./FeatureType-db96032c.js";import"./fieldProperties-62c55499.js";import"./labelingInfo-144f3d9f.js";import"./versionUtils-f17daa93.js";import"./styleUtils-25825fd6.js";import"./TopFeaturesQuery-e44d05be.js";import"./popupUtils-82ea8abb.js";function o(i){return(a,m,d)=>{if(!a)return null;const p=a[0].orientedImageryProperties;return(p==null?void 0:p[i])??null}}let e=class extends n{constructor(){super(...arguments),this.geometryType="point",this.operationalLayerType="OrientedImageryLayer",this.type="oriented-imagery"}get effectiveElevationSource(){var p;const{elevationSource:i,demPathPrefix:a,demPathSuffix:m}=this;if(!((p=i==null?void 0:i.url)!=null&&p.trim()))return i;let d=i.url.trim();return a!=null&&a.trim()&&(d=`${a.trim()}/${d}`),m!=null&&m.trim()&&(d+=`/${m.trim()}`),{...i,url:d}}_verifySource(){if(super._verifySource(),this.geometryType!=="point")throw new y("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};r([t({json:{type:Number,write:!0,read:{source:"layers",reader:o("cameraHeading")}}})],e.prototype,"cameraHeading",void 0),r([t({json:{type:Number,write:!0,read:{source:"layers",reader:o("cameraHeight")}}})],e.prototype,"cameraHeight",void 0),r([t({json:{type:Number,write:!0,read:{source:"layers",reader:o("cameraPitch")}}})],e.prototype,"cameraPitch",void 0),r([t({json:{type:Number,write:!0,read:{source:"layers",reader:o("cameraRoll")}}})],e.prototype,"cameraRoll",void 0),r([t({json:{type:Number,write:!0,read:{source:"layers",reader:o("coveragePercent")}}})],e.prototype,"coveragePercent",void 0),r([t({json:{write:!0,read:{source:"layers",reader:o("demPathPrefix")}}})],e.prototype,"demPathPrefix",void 0),r([t({json:{write:!0,read:{source:"layers",reader:o("demPathSuffix")}}})],e.prototype,"demPathSuffix",void 0),r([t({json:{write:!0,read:{source:"layers",reader:o("depthImagePathPrefix")}}})],e.prototype,"depthImagePathPrefix",void 0),r([t({json:{write:!0,read:{source:"layers",reader:o("depthImagePathSuffix")}}})],e.prototype,"depthImagePathSuffix",void 0),r([t({json:{type:Number,write:!0,read:{source:"layers",reader:o("farDistance")}}})],e.prototype,"farDistance",void 0),r([t({json:{write:!0}})],e.prototype,"geometryType",void 0),r([t({json:{type:Number,write:!0,read:{source:"layers",reader:o("horizontalFieldOfView")}}})],e.prototype,"horizontalFieldOfView",void 0),r([t({json:{write:!0,read:{source:"layers",reader:o("horizontalMeasurementUnit")}}})],e.prototype,"horizontalMeasurementUnit",void 0),r([t({json:{write:!0,read:{source:"layers",reader:o("imagePathPrefix")}}})],e.prototype,"imagePathPrefix",void 0),r([t({json:{write:!0,read:{source:"layers",reader:o("imagePathSuffix")}}})],e.prototype,"imagePathSuffix",void 0),r([t({json:{type:Number,write:!0,read:{source:"layers",reader:o("imageRotation")}}})],e.prototype,"imageRotation",void 0),r([t({type:Number,json:{write:!0,read:{source:"layers",reader:o("maximumDistance")}}})],e.prototype,"maximumDistance",void 0),r([t({json:{write:!0,read:{source:"layers",reader:o("nearDistance")}}})],e.prototype,"nearDistance",void 0),r([t({type:["OrientedImageryLayer"]})],e.prototype,"operationalLayerType",void 0),r([t({json:{write:!0,read:{source:"layers",reader:o("orientedImageryType")}}})],e.prototype,"orientedImageryType",void 0),r([t({json:{read:!1},value:"oriented-imagery",readOnly:!0})],e.prototype,"type",void 0),r([t({json:{write:!0,read:{source:"layers",reader:o("verticalFieldOfView")}}})],e.prototype,"verticalFieldOfView",void 0),r([t({json:{write:!0,read:{source:"layers",reader:o("verticalMeasurementUnit")}}})],e.prototype,"verticalMeasurementUnit",void 0),r([t({json:{write:!0,read:{source:"layers",reader:o("videoPathPrefix")}}})],e.prototype,"videoPathPrefix",void 0),r([t({json:{write:!0,read:{source:"layers",reader:o("videoPathSuffix")}}})],e.prototype,"videoPathSuffix",void 0),r([t({json:{write:!0,read:{source:"layers",reader:o("elevationSource")}}})],e.prototype,"elevationSource",void 0),r([t()],e.prototype,"effectiveElevationSource",null),e=r([s("esri.layers.OrientedImageryLayer")],e);const te=e;export{te as default}; diff --git a/assets/OverlayCompositing.glsl-cf0d34dd.js b/assets/OverlayCompositing.glsl-cf0d34dd.js new file mode 100644 index 0000000..fddfe25 --- /dev/null +++ b/assets/OverlayCompositing.glsl-cf0d34dd.js @@ -0,0 +1 @@ +import{A as r,B as e}from"./index-080e108a.js";export{r as OverlayCompositingPassParameters,e as build}; diff --git a/assets/PBFDecoderWorker-113e9c75.js b/assets/PBFDecoderWorker-113e9c75.js new file mode 100644 index 0000000..a02fbb2 --- /dev/null +++ b/assets/PBFDecoderWorker-113e9c75.js @@ -0,0 +1 @@ +import{gS as c,cN as d,bc as p,cq as f,gT as y,er as _,gU as m,gV as g,gW as P}from"./index-080e108a.js";import{t as C}from"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";function b(o,e){return e}function l(o,e,t,r){switch(t){case 0:return h(o,e+r,0);case 1:return o.originPosition==="lowerLeft"?h(o,e+r,1):M(o,e+r,1)}}function u(o,e,t,r){return t===2?h(o,e,2):l(o,e,t,r)}function G(o,e,t,r){return t===2?h(o,e,3):l(o,e,t,r)}function v(o,e,t,r){return t===3?h(o,e,3):u(o,e,t,r)}function h({translate:o,scale:e},t,r){return o[r]+t*e[r]}function M({translate:o,scale:e},t,r){return o[r]-t*e[r]}class T{constructor(e){this._options=e,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=b,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return new c}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const t=d(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(t!=null)for(const r of e.features)t(r.geometry)}createSpatialReference(){return new p}addField(e,t){e.fields.push(f.fromJSON(t));const r=e.fields.map(s=>s.name);this._attributesConstructor=function(){for(const s of r)this[s]=null}}addFeature(e,t){const r=this._options.maxStringAttributeLength??0;if(r>0)for(const s in t.attributes){const i=t.attributes[s];typeof i=="string"&&i.length>r&&(t.attributes[s]="")}e.features.push(t)}addQueryGeometry(e,t){const{queryGeometry:r,queryGeometryType:s}=t,i=y(r.clone(),r,!1,!1,this._transform),a=_(i,s,!1,!1);let n=null;switch(s){case"esriGeometryPoint":n="point";break;case"esriGeometryPolygon":n="polygon";break;case"esriGeometryPolyline":n="polyline";break;case"esriGeometryMultipoint":n="multipoint"}a.type=n,e.queryGeometryType=s,e.queryGeometry=a}prepareFeatures(e){switch(this._transform=e.transform??null,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"point":this.addCoordinate=(t,r,s)=>this.addCoordinatePoint(t,r,s),this.createGeometry=t=>this.createPointGeometry(t);break;case"polygon":this.addCoordinate=(t,r,s)=>this._addCoordinatePolygon(t,r,s),this.createGeometry=t=>this._createPolygonGeometry(t);break;case"polyline":this.addCoordinate=(t,r,s)=>this._addCoordinatePolyline(t,r,s),this.createGeometry=t=>this._createPolylineGeometry(t);break;case"multipoint":this.addCoordinate=(t,r,s)=>this._addCoordinateMultipoint(t,r,s),this.createGeometry=t=>this._createMultipointGeometry(t);break;case"mesh":case"extent":break;default:m(e.geometryType)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new g(P(),null,new this._attributesConstructor)}allocateCoordinates(){const e=this._lengths.reduce((t,r)=>t+r,0);this._coordinateBuffer=new Float64Array(e*this._vertexDimension),this._coordinateBufferPtr=0}addLength(e,t){this._lengths.length===0&&(this._toAddInCurrentPath=t),this._lengths.push(t)}createPointGeometry(e){const t={type:"point",x:0,y:0,spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM};return t.hasZ&&(t.z=0),t.hasM&&(t.m=0),t}addCoordinatePoint(e,t,r){const s=this._transform?this._applyTransform(this._transform,t,r,0):t;if(s!=null)switch(r){case 0:e.x=s;break;case 1:e.y=s;break;case 2:e.hasZ?e.z=s:e.m=s;break;case 3:e.m=s}}_transformPathLikeValue(e,t){let r=0;return t<=1&&(r=this._previousCoordinate[t],this._previousCoordinate[t]+=e),this._transform?this._applyTransform(this._transform,e,t,r):e}_addCoordinatePolyline(e,t,r){this._dehydratedAddPointsCoordinate(e.paths,t,r)}_addCoordinatePolygon(e,t,r){this._dehydratedAddPointsCoordinate(e.rings,t,r)}_addCoordinateMultipoint(e,t,r){r===0&&e.points.push([]);const s=this._transformPathLikeValue(t,r);e.points[e.points.length-1].push(s)}_createPolygonGeometry(e){return{type:"polygon",rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{type:"polyline",paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{type:"multipoint",points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,r){r===0&&this._toAddInCurrentPath--==0&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(t,r),i=e[e.length-1],a=this._coordinateBuffer;if(a){if(r===0){const n=this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT;i.push(new Float64Array(a.buffer,n,this._vertexDimension))}a[this._coordinateBufferPtr++]=s}}_deriveApplyTransform(e){const{hasZ:t,hasM:r}=e;return t&&r?v:t?u:r?G:l}}class R{_parseFeatureQuery(e){var s;const t=C(e.buffer,new T(e.options)),r={...t,spatialReference:(s=t.spatialReference)==null?void 0:s.toJSON(),fields:t.fields?t.fields.map(i=>i.toJSON()):void 0};return Promise.resolve(r)}}function A(){return new R}export{A as default}; diff --git a/assets/Path.glsl-bb1cac2d.js b/assets/Path.glsl-bb1cac2d.js new file mode 100644 index 0000000..22e143c --- /dev/null +++ b/assets/Path.glsl-bb1cac2d.js @@ -0,0 +1 @@ +import{ab as o}from"./index-080e108a.js";export{o as build}; diff --git a/assets/Pattern.glsl-2fa8b945.js b/assets/Pattern.glsl-2fa8b945.js new file mode 100644 index 0000000..4089958 --- /dev/null +++ b/assets/Pattern.glsl-2fa8b945.js @@ -0,0 +1 @@ +import{ac as r}from"./index-080e108a.js";export{r as build}; diff --git a/assets/Pipeline-98b9d349.js b/assets/Pipeline-98b9d349.js new file mode 100644 index 0000000..ec9aba0 --- /dev/null +++ b/assets/Pipeline-98b9d349.js @@ -0,0 +1,16 @@ +import{aw as Ye,bz as ae,cn as x,sD as Ss,bM as q,er as ke,cs as ws,hr as ut,dw as mt,cu as Re,sE as Ts,et as Fs,kW as ts,eu as Cs,i9 as oe,sF as As,gT as ss,ar as H,bL as yt,fI as Rt,nJ as rs,sG as is,sH as Ms,cv as He,dZ as as,ae as ns,lC as Ge,cR as Es,fw as $s,fp as ks,sI as Rs,hV as Ut,g9 as Us,q_ as Ds,f5 as qs,aY as Bs,fL as zs,ax as G,bn as ye,at as Os,kt as dt,ai as k,al as Ve,sC as Ls,hy as os,aj as O,ao as Ps,aW as Gs,ev as Ns,nA as lt,sJ as hs,sK as us,cB as js,ng as Qs,rS as X,hg as Ue,hh as De,sL as Ys,sM as Xs,fA as re,bI as Hs,bc as ie,nP as It,s0 as Vs,dy as ds,jG as se,ak as ls,ca as bt,dD as cs,sN as Zs,bm as gs,aC as Js,aG as ct,cT as qe,ku as ps,dz as Ws,rm as Ks,cM as er,bV as tr}from"./index-080e108a.js";import{g as Ie,f as _s,e as Dt}from"./QueryEngine-19eda5ff.js";import{r as Ee}from"./FieldsIndex-f79a8f26.js";import{t as xt,o as sr}from"./StreamFeatureManager-4b8ac3ac.js";import{f as rr}from"./quickselect-e80674f5.js";import{a as be,s as $e,p as ir}from"./diffUtils-590c9088.js";import{T as ar,c as qt}from"./arcadeTimeUtils-e1438cc8.js";import{t as nr}from"./centroid-8e8cfa47.js";import{S as Bt}from"./ogcFeatureUtils-1ccf1f8d.js";import{f as or,m as zt}from"./query-93c6e211.js";import{n as hr}from"./pbf-d9aa3914.js";import{b as ur,h as dr}from"./pbfQueryUtils-26a87215.js";import{b as lr,a as cr}from"./Query-1c961d4c.js";import{createConnection as gr}from"./createConnection-4b117798.js";import{V as pr,W as _r,S as fr,a as Ot,Q as mr,R as yr,c as N}from"./definitions-0bc08d4c.js";import{E as Se,S as Be,l as Ir,h as br}from"./TileInfoView-346e56d0.js";import"./number-e491b09e.js";import{X as xr,b as Xe,Y as Ne}from"./geohashUtils-77d8429b.js";function vr(i){return i==="heatmap"?Ye(()=>import("./HeatmapProcessor-db17730e.js"),["assets/HeatmapProcessor-db17730e.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/diffUtils-590c9088.js","assets/heatmapUtils-327ef4c5.js","assets/definitions-0bc08d4c.js","assets/tileUtils-48cbbab9.js"]):Ye(()=>import("./SymbolProcessor-f81deaae.js").then(e=>e.S),["assets/SymbolProcessor-f81deaae.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/cimAnalyzer-01879161.js","assets/TileClipper-ae6eca9e.js","assets/definitions-0bc08d4c.js","assets/number-e491b09e.js","assets/BidiEngine-9a40f2f4.js","assets/diffUtils-590c9088.js","assets/TileInfoView-346e56d0.js","assets/tileUtils-48cbbab9.js","assets/TurboLine-aac2edf4.js","assets/Rect-98da58d6.js","assets/defaultsJSON-59981e75.js","assets/GeometryUtils-0258f920.js"])}function xe(i,e){if(!(this instanceof xe))return new xe(i,e);this._maxEntries=Math.max(4,i||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&(typeof e=="function"?this.toBBox=e:this._initFormat(e)),this.clear()}function Sr(i,e,t){if(!t)return e.indexOf(i);for(var s=0;s=i.minX&&e.maxY>=i.minY}function ge(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Gt(i,e,t,s,r){for(var a,n=[e,t];n.length;)(t=n.pop())-(e=n.pop())<=s||(a=e+Math.ceil((t-e)/s/2)*s,rr(i,a,e,t,r),n.push(e,a,a,t))}xe.prototype={all:function(){return this._all(this.data,[])},search:function(i){var e=this.data,t=[],s=this.toBBox;if(!Oe(i,e))return t;for(var r,a,n,o,u=[];e;){for(r=0,a=e.children.length;r=0&&a[e].children.length>this._maxEntries;)this._split(a,e),e--;this._adjustParentBBoxes(r,a,e)},_split:function(i,e){var t=i[e],s=t.children.length,r=this._minEntries;this._chooseSplitAxis(t,r,s);var a=this._chooseSplitIndex(t,r,s),n=ge(t.children.splice(a,t.children.length-a));n.height=t.height,n.leaf=t.leaf,de(t,this.toBBox),de(n,this.toBBox),e?i[e-1].children.push(n):this._splitRoot(t,n)},_splitRoot:function(i,e){this.data=ge([i,e]),this.data.height=i.height+1,this.data.leaf=!1,de(this.data,this.toBBox)},_chooseSplitIndex:function(i,e,t){var s,r,a,n,o,u,h,d;for(u=h=1/0,s=e;s<=t-e;s++)n=Tr(r=Ce(i,0,s,this.toBBox),a=Ce(i,s,t,this.toBBox)),o=We(r)+We(a),n=e;r--)a=i.children[r],Ae(u,i.leaf?n(a):a),h+=ze(u);return h},_adjustParentBBoxes:function(i,e,t){for(var s=t;s>=0;s--)Ae(e[s],i)},_condense:function(i){for(var e,t=i.length-1;t>=0;t--)i[t].children.length===0?t>0?(e=i[t-1].children).splice(e.indexOf(i[t]),1):this.clear():de(i[t],this.toBBox)},_initFormat:function(i){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(i[0])),this.compareMinY=new Function("a","b",e.join(i[1])),this.toBBox=new Function("a","return {minX: a"+i[0]+", minY: a"+i[1]+", maxX: a"+i[2]+", maxY: a"+i[3]+"};")}};function Fr(i,e,t){if(i==null)return null;const s=e.readArcadeFeature();try{return i.evaluate({...t,$feature:s},i.services)}catch(r){return ae.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",r),null}}let vt=class{constructor(e,t){this._canCacheExpressionValue=!1,this._sourceInfo=e,this._storage=t,this._bitsets={computed:t.getBitset(t.createBitset())}}get storage(){return this._storage}invalidate(){this._bitsets.computed.clear()}async updateSchema(e,t){const s=be(this._schema,t);if(this._schema=t,!t||s==null||!$e(s,"attributes"))return;x("esri-2d-update-debug")&&console.debug("Applying Update - Store:",s),this._bitsets.computed.clear(),e.targets[t.name]=!0;const r=t.attributes,a=[],n=[];for(const o in r){const u=r[o];switch(u.type){case"field":break;case"expression":a.push(this._createArcadeComputedField(u));break;case"label-expression":a.push(this._createLabelArcadeComputedField(u));break;case"statistic":n.push(u)}}this._computedFields=await Promise.all(a),this._canCacheExpressionValue=!this._computedFields.some(o=>o.type==="expression"&&o.expression!=null&&o.expression.referencesScale()),this._statisticFields=n}setComputedAttributes(e,t,s,r){const a=this._bitsets.computed;if(!this._canCacheExpressionValue||!a.has(s)){a.set(s);for(const n of this._computedFields){const o=this._evaluateField(t,n,r);switch(n.resultType){case"numeric":e.setComputedNumericAtIndex(s,n.fieldIndex,o);break;case"string":e.setComputedStringAtIndex(s,n.fieldIndex,o)}}}}async _createArcadeComputedField(e){const t=this._sourceInfo.spatialReference,s=this._sourceInfo.fieldsIndex;return{...e,expression:await Ss(e.valueExpression,t,s)}}async _createLabelArcadeComputedField(e){const t=this._sourceInfo.spatialReference,s=this._sourceInfo.fieldsIndex,{createLabelFunction:r}=await Ye(()=>import("./index-080e108a.js").then(n=>n.uP),["assets/index-080e108a.js","assets/index-a8e73b5e.css"]),a=await r(e.label,s,t);return{...e,builder:a}}_evaluateField(e,t,s){switch(t.type){case"label-expression":{const r=e.readArcadeFeature();return t.builder.evaluate(r)||""}case"expression":{const{expression:r}=t;return Fr(r,e,{$view:{scale:s}})}}}},fs=class je{static fromBuffer(e,t){return new je(e,t)}static create(e,t=4294967295){const s=new Uint32Array(Math.ceil(e/32));return new je(s,t)}constructor(e,t){this._mask=0,this._buf=e,this._mask=t}_getIndex(e){return Math.floor(e/32)}has(e){const t=this._mask&e;return!!(this._buf[this._getIndex(t)]&1<>>=1,r++}}countSet(){let e=0;return this.forEachSet(t=>{e++}),e}},we=0;const Ze=x("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],Cr=Ze[0],Ar=Ze[1],Mr=Ze[2],Er=Ze[3],St=x("featurelayer-simplify-payload-size-factors")??[1,2,4],$r=St[0],kr=St[1],Rr=St[2],Ur=x("featurelayer-simplify-mobile-factor")??2,Dr=x("esri-mobile");let ve=class{constructor(e,t){this.type="FeatureSetReader",this.arcadeDeclaredClass="esri.arcade.Feature",this.seen=!1,this.instance=0,this._tx=0,this._ty=0,this._sx=1,this._sy=1,this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._level=0,this._datetimeMetadata=null,this.contextTimeReference=null,this.instance=e,this._layerSchema=t}static createInstance(){return we++,we=we>65535?0:we,we}get isEmpty(){return this._deleted!=null&&this._deleted.countSet()===this.getSize()}set level(e){this._level=e}getAreaSimplificationThreshold(e,t){let s=1;const r=Dr?Ur:1;t>4e6?s=Rr*r:t>1e6?s=kr*r:t>5e5?s=$r*r:t>1e5&&(s=r);let a=0;e>4e3?a=Er*s:e>2e3?a=Mr*s:e>100?a=Ar:e>15&&(a=Cr);let n=8;return this._level<4?n=1:this._level<5?n=2:this._level<6&&(n=4),a*n}createQuantizedExtrudedQuad(e,t){return new q([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}parseTimestampOffset(e){return e}setArcadeSpatialReference(e){this._arcadeSpatialReference=e}attachStorage(e){this._storage=e}getQuantizationTransform(){throw new Error("Unable to find transform for featureSet")}getStorage(){return this._storage}getComputedNumeric(e){return this.getComputedNumericAtIndex(0)}setComputedNumeric(e,t){return this.setComputedNumericAtIndex(t,0)}getComputedString(e){return this.getComputedStringAtIndex(0)}setComputedString(e,t){return this.setComputedStringAtIndex(0,t)}getComputedNumericAtIndex(e){return this._storage.getComputedNumericAtIndex(this.getDisplayId(),e)}setComputedNumericAtIndex(e,t){this._storage.setComputedNumericAtIndex(this.getDisplayId(),e,t)}getComputedStringAtIndex(e){return this._storage.getComputedStringAtIndex(this.getDisplayId(),e)}setComputedStringAtIndex(e,t){return this._storage.setComputedStringAtIndex(this.getDisplayId(),e,t)}transform(e,t,s,r){const a=this.copy();return a._tx+=e,a._ty+=t,a._sx*=s,a._sy*=r,a}readAttribute(e,t=!1){const s=this._readAttribute(e,t);if(s!==void 0)return s;for(const r of this._joined){r.setIndex(this.getIndex());const a=r._readAttribute(e,t);if(a!==void 0)return a}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const s=t._readAttributes();for(const r of Object.keys(s))e[r]=s[r]}return e}joinAttributes(e){this._joined.push(e)}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)}geometry(){const e=this.readHydratedGeometry(),t=ke(e,this.geometryType,this.hasZ,this.hasM),s=ws(t);return s&&(s.spatialReference=this._arcadeSpatialReference),s}get dateTimeReferenceFieldIndex(){return this._datetimeMetadata||(this._datetimeMetadata=ar.create(this._layerSchema.fields,this._layerSchema)),this._datetimeMetadata}autocastArcadeDate(e,t){var s;return t&&t instanceof Date?this.isUnknownDateTimeField(e)?qt.unknownDateJSToArcadeDate(t):qt.dateJSAndZoneToArcadeDate(t,((s=this.contextTimeReference)==null?void 0:s.timeZone)??"system"):t}isUnknownDateTimeField(e){var t;return((t=this.dateTimeReferenceFieldIndex)==null?void 0:t.fieldTimeZone(e))==="unknown"}fieldSourceTimeZone(e){var t;return((t=this.dateTimeReferenceFieldIndex)==null?void 0:t.fieldTimeZone(e))??""}get layerPreferredTimeZone(){var e;return((e=this.dateTimeReferenceFieldIndex)==null?void 0:e.layerPreferredTimeZone)??""}field(e){if(this.hasField(e))return this.autocastArcadeDate(e,this.readAttribute(e,!0));for(const t of this._joined)if(t.setIndex(this.getIndex()),t.hasField(e)){const s=t._readAttribute(e,!0);return this.autocastArcadeDate(e,s)}throw new Error(`Field ${e} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeature());const t=this.readLegacyFeature();if(!t)return JSON.stringify(null);const s={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const r in s.attributes){const a=s.attributes[r];a instanceof Date&&(s.attributes[r]=a.getTime())}return JSON.stringify(s)}gdbVersion(){return null}fullSchema(){return this._layerSchema}castAsJson(e=null){var t;return{attributes:this._readAttributes(),geometry:(e==null?void 0:e.keepGeometryType)===!0?this.geometry():((t=this.geometry())==null?void 0:t.toJSON())??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}removeIds(e){if(this._objectIdToIndex==null){const s=new Map,r=this.getCursor();for(;r.next();){const a=ut(r.getObjectId());s.set(a,r.getIndex())}this._objectIdToIndex=s}const t=this._objectIdToIndex;for(const s of e)t.has(s)&&this.removeAtIndex(t.get(s))}removeAtIndex(e){this._deleted==null&&(this._deleted=fs.create(this.getSize())),this._deleted.set(e)}readGeometryForDisplay(){return this.readUnquantizedGeometry(!0)}readLegacyGeometryForDisplay(){return this.readLegacyGeometry(!0)}*features(){const e=this.getCursor();for(;e.next();)yield e.readOptimizedFeature()}_getExists(){return this._deleted==null||!this._deleted.has(this.getIndex())}_computeCentroid(){if(this.geometryType!=="esriGeometryPolygon")return null;const e=this.readUnquantizedGeometry();if(!e||e.hasIndeterminateRingOrder)return null;const t=this.getQuantizationTransform()??null;return nr(new q,e,this.hasM,this.hasZ,t)}copyInto(e){e.seen=this.seen,e._storage=this._storage,e._arcadeSpatialReference=this._arcadeSpatialReference,e._joined=this._joined,e._tx=this._tx,e._ty=this._ty,e._sx=this._sx,e._sy=this._sy,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex}},ms=class gt extends ve{static from(e,t){return new gt(e.copy(),t)}constructor(e,t){super(ve.createInstance(),e.fullSchema()),this._currentIndex=-1,this._reader=e,this._indices=t}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1>>16}function Fe(i){return 65535&i}const wt={getObjectId:i=>i.getObjectId(),getAttributes:i=>i.readAttributes(),getAttribute:(i,e)=>i.readAttribute(e),cloneWithGeometry:(i,e)=>i,getGeometry:i=>i.readHydratedGeometry(),getCentroid:(i,e)=>i.readCentroid()};let qr=class extends vt{constructor(e,t,s){super(e,t),this.featureAdapter=wt,this.events=new Re,this._featureSetsByInstance=new Map,this._objectIdToDisplayId=new Map,this._spatialIndexInvalid=!0,this._indexSearchCache=new xt(50),this._index=xe(9,r=>({minX:this._storage.getXMin(r),minY:this._storage.getYMin(r),maxX:this._storage.getXMax(r),maxY:this._storage.getYMax(r)})),this.mode=s}get storeStatistics(){let e=0,t=0,s=0;return this.forEach(r=>{const a=r.readGeometry();a&&(t+=a.isPoint?1:a.lengths.reduce((n,o)=>n+o,0),s+=a.isPoint?1:a.lengths.length,e+=1)}),{featureCount:e,vertexCount:t,ringCount:s}}hasInstance(e){return this._featureSetsByInstance.has(e)}onTileData(e,t){if(t.addOrUpdate==null)return t;if(t.addOrUpdate.attachStorage(this._storage),this.mode==="snapshot"){const r=t.addOrUpdate.getCursor();for(;r.next();){const a=r.getDisplayId();this.setComputedAttributes(this._storage,r,a,e.scale)}return t}this._featureSetsByInstance.set(t.addOrUpdate.instance,t.addOrUpdate);const s=t.addOrUpdate.getCursor();for(;s.next();)this._insertFeature(s,e.scale);return this._spatialIndexInvalid=!0,this.events.emit("changed"),t}search(e){this._rebuildIndex();const t=e.id,s=this._indexSearchCache.find(o=>o.tileId===t);if(s!=null)return s.readers;const r=new Map,a=this._searchIndex(e.bounds),n=[];for(const o of a){const u=this._storage.getInstanceId(o),h=Te(u),d=Fe(u);r.has(h)||r.set(h,[]),r.get(h).push(d)}return r.forEach((o,u)=>{const h=this._featureSetsByInstance.get(u);n.push(ms.from(h,o))}),this._indexSearchCache.enqueue({tileId:t,readers:n}),n}insert(e){const t=e.getCursor(),s=this._storage;for(;t.next();){const r=jt(t.instance,t.getIndex()),a=t.getObjectId(),n=this._objectIdToDisplayId.get(a)??this._storage.createDisplayId();t.setDisplayId(n),s.setInstanceId(n,r),this._objectIdToDisplayId.set(a,n)}this._featureSetsByInstance.set(e.instance,e),this._spatialIndexInvalid=!0}remove(e){const t=this._objectIdToDisplayId.get(e);if(!t)return;const s=this._storage.getInstanceId(t),r=Fe(s),a=Te(s),n=this._featureSetsByInstance.get(a);this._objectIdToDisplayId.delete(e),this._storage.releaseDisplayId(t),n.removeAtIndex(r),n.isEmpty&&this._featureSetsByInstance.delete(a),this._spatialIndexInvalid=!0}forEach(e){this._objectIdToDisplayId.forEach(t=>{const s=this._storage.getInstanceId(t),r=this._lookupFeature(s);e(r)})}forEachUnsafe(e){this._objectIdToDisplayId.forEach(t=>{const s=this._storage.getInstanceId(t),r=Te(s),a=Fe(s),n=this._getFeatureSet(r);n.setIndex(a),e(n)})}forEachInBounds(e,t){const s=this._searchIndex(e);for(const r of s)t(this.lookupFeatureByDisplayId(r,this._storage))}forEachBounds(e,t){this._rebuildIndex();for(const s of e){if(!s.readGeometry())continue;const r=s.getDisplayId();Ts(Nt,this._storage.getXMin(r),this._storage.getYMin(r),this._storage.getXMax(r),this._storage.getYMax(r)),t(Nt)}}sweepFeatures(e,t,s){this._spatialIndexInvalid=!0,this._objectIdToDisplayId.forEach((r,a)=>{e.has(r)||(t.releaseDisplayId(r),s&&s.unsetAttributeData(r),this._objectIdToDisplayId.delete(a))}),this.events.emit("changed")}sweepFeatureSets(e){this._spatialIndexInvalid=!0,this._featureSetsByInstance.forEach((t,s)=>{e.has(s)||this._featureSetsByInstance.delete(s)})}lookupObjectId(e,t){const s=this.lookupFeatureByDisplayId(e,t);return s==null?null:s.getObjectId()}lookupDisplayId(e){return this._objectIdToDisplayId.get(e)}lookupFeatureByDisplayId(e,t){const s=t.getInstanceId(e);return this._lookupFeature(s)}lookupByDisplayIdUnsafe(e){const t=this._storage.getInstanceId(e),s=Te(t),r=Fe(t),a=this._getFeatureSet(s);return a?(a.setIndex(r),a):null}_insertFeature(e,t){const s=this._storage,r=e.getObjectId(),a=jt(e.instance,e.getIndex());s.getInstanceId(e.getDisplayId());let n=this._objectIdToDisplayId.get(r);n||(n=s.createDisplayId(),this._objectIdToDisplayId.set(r,n),this._spatialIndexInvalid=!0),e.setDisplayId(n),s.setInstanceId(n,a),this.setComputedAttributes(s,e,n,t)}_searchIndex(e){this._rebuildIndex();const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(t)}_rebuildIndex(){if(!this._spatialIndexInvalid)return;const e=[];this.mode==="snapshot"?this._featureSetsByInstance.forEach(t=>{const s=t.getCursor();for(;s.next();){const r=s.getDisplayId();this._storage.setBounds(r,s)&&e.push(r)}}):this._objectIdToDisplayId.forEach(t=>{const s=this._storage.getInstanceId(t);this._storage.setBounds(t,this._lookupFeature(s))&&e.push(t)}),this._index.clear(),this._index.load(e),this._indexSearchCache.clear(),this._spatialIndexInvalid=!1}_lookupFeature(e){const t=Te(e),s=this._getFeatureSet(t);if(!s)return;const r=s.getCursor(),a=Fe(e);return r.setIndex(a),r}_getFeatureSet(e){return this._featureSetsByInstance.get(e)}};function Br({coords:i,lengths:e}){let t=0;for(const s of e){for(let r=1;r!(s.objectId!=null&&t.has(s.objectId)))}append(e){for(const t of e)this._features.push(t)}getSize(){return this._features.length}getCursor(){return this.copy()}getQuantizationTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){var e;return(e=this._current)==null?void 0:e.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}getGroupId(){return this._current.groupId}setGroupId(e){this._current.groupId=e}copy(){const e=new pe(this.instance,this._features,this.fullSchema());return this.copyInto(e),e}next(){for(;++this._featureIndex0}let Qr=class pt extends ve{static fromBuffer(e,t,s=!1){const r=t.geometryType,a=Pr(e),n=Or(a,r==="esriGeometryPoint",s),o=ve.createInstance();return new pt(o,a,n,t)}constructor(e,t,s,r){super(e,r),this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0,centroid:void 0,legacyFeature:void 0,optFeature:void 0},this._geometryType=r.geometryType,this._reader=t,this._header=s,this._hasNext=s.hasFeatures,this._isPoints=r.geometryType==="esriGeometryPoint"}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get _size(){return this._header.featureCount}get hasZ(){return!1}get hasM(){return!1}get stride(){return 2+(this.hasZ?1:0)+(this.hasM?1:0)}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getQuantizationTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}getGroupId(){return this._header.groupIds[this._featureIndex]}setGroupId(e){this._header.groupIds[this._featureIndex]=e}readLegacyFeature(){if(this._cache.legacyFeature===void 0){const e=this.readCentroid(),t={attributes:this.readAttributes(),geometry:this._isPoints?this.readLegacyPointGeometry():this.readLegacyGeometry(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null};return this._cache.legacyFeature=t,t}return this._cache.legacyFeature}readOptimizedFeature(){if(this._cache.optFeature===void 0){const e=new yt(this.readGeometry(),this.readAttributes(),this.readCentroid());return e.objectId=this.getObjectId(),e.displayId=this.getDisplayId(),this._cache.optFeature=e,e}return this._cache.optFeature}getXHydrated(){const e=this._header.centroid[2*this._featureIndex],t=this.getQuantizationTransform();return t==null?e:e*t.scale[0]+t.translate[0]}getYHydrated(){const e=this._header.centroid[2*this._featureIndex+1],t=this.getQuantizationTransform();return t==null?e:t.translate[1]-e*t.scale[1]}getX(){return this._header.centroid[2*this._featureIndex]*this._sx+this._tx}getY(){return this._header.centroid[2*this._featureIndex+1]*this._sy+this._ty}readLegacyPointGeometry(){return{x:this.getX(),y:this.getY()}}readLegacyGeometry(e){const t=this.readUnquantizedGeometry(e);return ke(t,this.geometryType,!1,!1)}readLegacyCentroid(){const e=this.readCentroid();if(!e)return null;const[t,s]=e.coords;return{x:t,y:s}}readGeometryArea(){return this._cache.area||this.readGeometry(!0),this._cache.area}readUnquantizedGeometry(e=!1){if(this._cache.unquantGeometry===void 0){const t=this.readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;const s=Xt(t.coords.length).decoded,r=t.clone(s),a=r.coords;let n=0;for(const o of r.lengths){for(let u=1;ul.length)for(let _=0;_=_?(c+=-.5*(F-m)*(A+I),y>1&&st(l[d-2],l[d-1],v,w)?(l[d-2]+=v,l[d-1]+=w):(l[d++]=v,l[d++]=w,y++),m=F,I=A):(M+=v,C+=w),v=M,w=C,b++}y<3||S?d-=2*y:(c+=-.5*(m+v-m)*(I+w+I),st(l[d-2],l[d-1],v,w)?(l[d-2]+=v,l[d-1]+=w,u.push(y)):(l[d++]=v,l[d++]=w,u.push(++y)))}else{let _=0,b=r.getSInt32(),y=r.getSInt32();this.hasZ&&r.getSInt32(),this.hasM&&r.getSInt32(),l[d++]=b,l[d++]=y,_+=1;for(let S=1;S2&&st(l[d-2],l[d-1],m,I)?(l[d-2]+=m,l[d-1]+=I):(l[d++]=m,l[d++]=I,_+=1),b=v,y=w}u.push(_)}break}default:r.skip()}if(this._cache.area=c,!u.length)return null;if(this._tx||this._ty){let f=0;Rt(l);for(const p of u)l[2*f]+=this._tx,l[2*f+1]+=this._ty,f+=p}return new q(u,l)}},Je=class{constructor(e){this.service=e}destroy(){}};function Yr(i){return Array.isArray(i.source)}function Xr(i){return(i==null?void 0:i.type)==="ogc-source"}function Hr(i){const{capabilities:e}=i;return Xr(i.source)?new Kr(i):Yr(i)?new Zr(i):e.query.supportsFormatPBF&&x("featurelayer-pbf")?new Jr(i):new Wr(i)}async function Vr(i){const e=new Ms;return await e.open(i,{}),e}let Zr=class extends Je{constructor(e){super(e),this._portsOpen=Vr(e.source).then(t=>this.client=t)}destroy(){this.client.close(),this.client=null}async executeQuery(e,t){await this._portsOpen;const s=await this.client.invoke("queryFeatures",e.toJSON(),t);return P.fromFeatureSet(s,this.service)}},Jr=class extends Je{async executeQuery(e,t){const{data:s}=await or(this.service.source,e,t),r=!e.quantizationParameters;return Qr.fromBuffer(s,this.service,r)}},Wr=class extends Je{async executeQuery(e,t){var h;const{source:s,capabilities:r,spatialReference:a,objectIdField:n,geometryType:o}=this.service;if(e.quantizationParameters!=null&&!r.query.supportsQuantization){const d=e.clone(),l=rs(d.quantizationParameters);d.quantizationParameters=null;const{data:c}=await zt(s,d,a,t),g=ts(c,n);return is(l,g),P.fromOptimizedFeatureSet(g,this.service)}const{data:u}=await zt(s,e,this.service.spatialReference,t);return o==="esriGeometryPoint"&&(u.features=(h=u.features)==null?void 0:h.filter(d=>{if(d.geometry!=null){const l=d.geometry;return Number.isFinite(l.x)&&Number.isFinite(l.y)}return!0})),P.fromFeatureSet(u,this.service)}},Kr=class extends Je{async executeQuery(e,t){const{capabilities:s}=this.service;if(e.quantizationParameters&&!s.query.supportsQuantization){const a=e.clone(),n=rs(a.quantizationParameters);a.quantizationParameters=null;const o=await Bt(this.service.source,e,t);return is(n,o),P.fromOptimizedFeatureSet(o,this.service)}const r=await Bt(this.service.source,e,t);return P.fromOptimizedFeatureSet(r,this.service)}},L=class Qe{constructor(){this.version=0,this.source=!1,this.targets={feature:!1,aggregate:!1},this.storage={filters:!1,data:!1},this.mesh=!1,this.queryFilter=!1,this.why={mesh:[],source:[]}}static create(e){const t=new Qe;let s;for(s in e){const r=e[s];if(typeof r=="object")for(const a in r){const n=a,o=r[n];t[s][n]=o}t[s]=r}return t}static empty(){return Qe.create({})}static all(){return Qe.create({source:!0,targets:{feature:!0,aggregate:!0},storage:{filters:!0,data:!0},mesh:!0})}unset(e){this.version=e.version,e.source&&(this.source=!1),e.targets.feature&&(this.targets.feature=!1),e.targets.aggregate&&(this.targets.aggregate=!1),e.storage.filters&&(this.storage.filters=!1),e.storage.data&&(this.storage.data=!1),e.mesh&&(this.mesh=!1),e.queryFilter&&(this.queryFilter=!1)}any(){return this.source||this.mesh||this.storage.filters||this.storage.data||this.targets.feature||this.targets.aggregate||this.queryFilter}describe(){let e=0,t="";if(this.mesh){e+=20,t+=`-> (20) Mesh needs update +`;for(const r of this.why.mesh)t+=` + ${r} +`}if(this.source){e+=10,t+=`-> (10) The source needs update +`;for(const r of this.why.source)t+=` + ${r} +`}this.targets.feature&&(e+=5,t+=`-> (5) Feature target parameters changed +`),this.storage.filters&&(e+=5,t+=`-> (5) Feature filter parameters changed +`),this.targets.aggregate&&(e+=4,t+=`-> (4) Aggregate target parameters changed +`),this.storage.data&&(e+=1,t+="-> (1) Texture storage parameters changed");const s=e<5?"Fastest":e<10?"Fast":e<15?"Moderate":e<20?"Slow":"Very Slow";console.debug(`Applying ${s} update of cost ${e}/45 `),console.debug(t)}toJSON(){return{queryFilter:this.queryFilter,source:this.source,targets:this.targets,storage:this.storage,mesh:this.mesh}}},ei=class{constructor(e,t){this.requests={done:new Array,stream:new xt(10)},this._edits=null,this._abortController=new AbortController,this._version=0,this._resolver=He(),this._isDone=!1,this.didSend=!1,this.tile=e,this._version=t}get signal(){return this._abortController.signal}get options(){return{signal:this._abortController.signal}}get empty(){return!this.requests.done.length&&this.edits==null}get edits(){return this._edits}get done(){return this._resolver.promise}get isDone(){return this._isDone}resolve(){this._isDone=!0,this._resolver.resolve()}clear(){this.requests.done=[]}applyUpdate(e){this.requests.done.forEach(t=>t.message.status.unset(e)),this._version=e.version,this._edits!=null&&this._edits.status.unset(e)}add(e){e.message.status=e.message.status??L.empty(),e.message.status.version=this._version,x("esri-2d-update-debug")&&console.debug(this.tile.id,"DataTileSubscription:add",this._version),e.message.end&&(this.requests.done.forEach(t=>{t.message!=null&&t.message.end&&(t.message.end=!1)}),this._resolver.resolve(),this._isDone=!0),this.requests.done.push(e)}edit(e,t){const s=e.getQuantizationTransform(),r=e.fullSchema(),a=Array.from(e.features()).filter(as),n=[...t,...a.map(o=>o.objectId)];if(this.removeIds(n),this._invalidate(),this._edits==null)return void(this._edits={type:"append",addOrUpdate:P.fromOptimizedFeatures(a,r,s),id:this.tile.id,status:L.empty(),end:!0});this.requests.done.forEach(o=>o.message.end=!1),this._edits.addOrUpdate.append(e.features())}*readers(){for(const{message:e}of this.requests.done)e.addOrUpdate!=null&&(yield e.addOrUpdate);this._edits!=null&&this._edits.addOrUpdate!=null&&(yield this._edits.addOrUpdate)}_invalidate(){for(const e of this.requests.done)e.message.status=L.empty();this._edits!=null&&(this._edits.status=L.empty())}removeIds(e){this._invalidate();for(const{message:t}of this.requests.done){const s=t.addOrUpdate;s!=null&&(s.removeIds(e),s.isEmpty&&(x("esri-2d-update-debug")&&console.debug("Removing FeatureSetReader"),t.addOrUpdate=null))}this._edits!=null&&this._edits.addOrUpdate!=null&&this._edits.addOrUpdate.removeIds(e),this.requests.done=this.requests.done.filter(t=>t.message.addOrUpdate||t.message.end)}abort(){this._abortController.abort(),this._resolver.reject()}};function ti(i,e){const t=new Set;return i&&i.forEach(s=>t.add(s)),e&&e.forEach(s=>t.add(s)),t.has("*")?["*"]:Array.from(t)}let ys=class{constructor(e){this.updatingHandles=new ns,this.events=new Re,this._resolver=He(),this._didEdit=!1,this._subscriptions=new Map,this._outSR=e.outSR,this._serviceInfo=e.serviceInfo,this._onTileUpdateMessage=e.onMessage}destroy(){for(const e of this._subscriptions.values())e.abort();this.updatingHandles.destroy()}get subscriptions(){return this._subscriptions.values()}async _onMessage(e){const t=this._subscriptions.get(e.id);if(!t)return;const s={...e,remove:e.remove??[],status:e.status??L.empty()};return Ge(this._onTileUpdateMessage(s,t.options))}update(e,t){var u;const s=t.fields.length;t.outFields=ti((u=this._schema)==null?void 0:u.outFields,t.outFields),t.outFields=t.outFields.length>=.75*s?["*"]:t.outFields,t.outFields.sort();const r=be(this._schema,t);if(!r)return;x("esri-2d-update-debug")&&console.debug("Applying Update - Source:",r);const a="orderByFields"in this._serviceInfo&&this._serviceInfo.orderByFields?this._serviceInfo.orderByFields:this._serviceInfo.objectIdField+" ASC",n={returnCentroid:this._serviceInfo.geometryType==="esriGeometryPolygon",returnGeometry:!0,timeReferenceUnknownClient:this._serviceInfo.type!=="stream"&&this._serviceInfo.timeReferenceUnknownClient,outFields:t.outFields,outSpatialReference:this._outSR,orderByFields:[a],where:t.definitionExpression||"1=1",gdbVersion:t.gdbVersion,historicMoment:t.historicMoment,timeExtent:t.timeExtent?Es.fromJSON(t.timeExtent):null},o=this._schema&&$e(r,"outFields");this._schema&&ir(r,["timeExtent","definitionExpression","gdbVersion","historicMoment","customParameters"])&&(e.why.mesh.push("Layer filter and/or custom parameters changed"),e.why.source.push("Layer filter and/or custom parameters changed"),e.mesh=!0,e.source=!0,e.queryFilter=!0),o&&(e.why.source.push("Layer required fields changed"),e.source=!0),be(n,this._queryInfo)&&(this._queryInfo=n),this._schema=t,this._resolver.resolve()}whenInitialized(){return this._resolver.promise}async applyUpdate(e){if(e.queryFilter||e.source&&this._didEdit)return this.refresh(e.version),void(this._didEdit=!1);this._subscriptions.forEach(t=>t.applyUpdate(e)),await this.resend()}refresh(e,t){for(const s of this._tiles())this.unsubscribe(s),this.subscribe(s,e)}subscribe(e,t){const s=new ei(e,t);this._subscriptions.set(e.id,s),this.updatingHandles.addPromise(s.done)}unsubscribe(e){const t=this.getSubscription(e.id);t!=null&&t.abort(),this._subscriptions.delete(e.id)}createQuery(e={}){const t=this._queryInfo.historicMoment?new Date(this._queryInfo.historicMoment):null;return new lr({...this._queryInfo,historicMoment:t,...e})}getSubscription(e){return this._subscriptions.has(e)?this._subscriptions.get(e):null}async queryLastEditDate(){throw new Error("Service does not support query type")}async query(e,t){throw new Error("Service does not support query")}*_tiles(){const e=Array.from(this._subscriptions.values());for(const t of e)yield t.tile}async edit(e,t){const s=Array.from(this._subscriptions.values()),r=s.map(({tile:a})=>a);for(const a of s)a.removeIds(t);if(e.length){const a=r.map(o=>{const u=this.createTileQuery(o);return u.objectIds=e,{tile:o,query:u}}).map(async({tile:o,query:u})=>({tile:o,result:await this.query(u,{query:{tile:x("esri-tiles-debug")?o.id.replaceAll("/","."):void 0}}),query:u})),n=(await $s(a)).map(async({tile:o,result:u})=>{if(!u.hasFeatures&&!t.length&&!e.length)return;const h=this._subscriptions.get(o.key.id);h&&h.edit(u,e)});await ks(n)}this._didEdit=!0}},si=class{constructor(e,t){this.item=e,this.controller=t,this.promise=null}},_t=class{constructor(e){this._deferreds=new Map,this._controllers=new Map,this._processingItems=new Map,this._isPaused=!1,this._schedule=null,this._task=null,this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new Rs(e.peeker),this.process=e.process;const t=e.scheduler;e.priority&&t&&(this._task=t.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule=Ut(this._schedule),this._task=Ut(this._task)}get length(){return this._processingItems.size+this._queue.length}abort(e){const t=this._controllers.get(e);t&&t.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach(t=>e.push(t)),this._controllers.clear(),e.forEach(t=>t.abort()),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((t,s)=>e(s))}get(e){const t=this._deferreds.get(e);return t?t.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._isPaused||(this._isPaused=!0,this._cancelNext())}push(e,t){const s=this.get(e);if(s)return s;const r=new AbortController;let a=null;t&&(a=Us(t,()=>r.abort()));const n=()=>{const d=this._processingItems.get(e);d&&d.controller.abort(),o(),h.reject(zs())},o=()=>{u.remove(),a!=null&&a.remove(),this._deferreds.delete(e),this._controllers.delete(e),this._queue.remove(e),this._processingItems.delete(e),this._scheduleNext()},u=Ds(r.signal,n),h=He();return this._deferreds.set(e,h),this._controllers.set(e,r),h.promise.then(o,o),this._queue.push(e),this._scheduleNext(),h.promise}last(){return this._queue.last()}peek(){return this._queue.peek()}popLast(){return this._queue.popLast()}reset(){const e=[];this._processingItems.forEach(t=>e.push(t)),this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._isPaused&&(this._isPaused=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._isPaused&&this._queue.length>0&&this._processingItems.size0&&this._processingItems.size{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.sizethis._processResult(r,a),a=>this._processError(r,a))):this._processResult(r,t)}get test(){return{update:e=>this.runTask(e)}}};const ri=4;let Tt=class extends ys{constructor(e){super(e),this.type="feature",this.mode="on-demand",this._adapter=Hr(e.serviceInfo),this._queue=new _t({concurrency:8,process:async t=>{var s,r;if(G(t),t.tile!=null){const a=t.tile.key.id,{signal:n}=t,o=x("esri-tiles-debug")?{tile:a.replaceAll("/","."),depth:t.depth}:void 0,u=await this._adapter.executeQuery(t.query,{signal:n,query:{...o,...(s=this._schema)==null?void 0:s.customParameters}});return u.level=t.tile.key.level,u}return this._adapter.executeQuery(t.query,{...t,query:(r=this._schema)==null?void 0:r.customParameters})}}),this._patchQueue=new _t({concurrency:8,process:async t=>{var s,r;if(G(t),t.tile!=null){const a=t.tile.key.id,{signal:n}=t,o=x("esri-tiles-debug")?{tile:a.replaceAll("/","."),depth:t.depth}:void 0,u=await this._adapter.executeQuery(t.query,{signal:n,query:{...o,...(s=this._schema)==null?void 0:s.customParameters}});return u.level=t.tile.key.level,u}return this._adapter.executeQuery(t.query,{...t,query:(r=this._schema)==null?void 0:r.customParameters})}})}destroy(){super.destroy(),this._adapter.destroy(),this._queue.destroy(),this._patchQueue.destroy()}enqueueQuery(e,t){return this.updatingHandles.addPromise(this._queue.push(e,t))}enqueuePatchQuery(e,t){return this.updatingHandles.addPromise(this._patchQueue.push(e,t))}get maxRecordCountFactor(){const{query:e}=this._serviceInfo.capabilities;return e.supportsMaxRecordCountFactor?ri:null}get maxPageSize(){const{query:e}=this._serviceInfo.capabilities;return(e.maxRecordCount??8e3)*(this.maxRecordCountFactor??1)}get pageSize(){return Math.min(8e3,this.maxPageSize)}enableEvent(e,t){}subscribe(e,t){super.subscribe(e,t),this._fetchDataTile(e).catch(s=>{ye(s)||ae.getLogger("esri.views.2d.layers.features.sources.BaseFeatureSource").error(new H("mapview-query-error","Encountered error when fetching tile",{tile:e,error:s}))})}unsubscribe(e){super.unsubscribe(e)}readers(e){return this._subscriptions.get(e).readers()}async query(e,t={}){var r;const s=t.query??{};return this._adapter.executeQuery(e,{...t,query:{...s,...(r=this._schema)==null?void 0:r.customParameters}})}async queryLastEditDate(){const e=this._serviceInfo.source,t={...e.query,f:"json"};return(await Os(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate}createTileQuery(e,t={}){const s=this._serviceInfo.geometryType,r=this.createQuery(t);r.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),r.resultType="tile",r.geometry=e.extent,this._serviceInfo.capabilities.query.supportsQuantization?s==="esriGeometryPolyline"&&(r.maxAllowableOffset=e.resolution*x("feature-polyline-generalization-factor")):s!=="esriGeometryPolyline"&&s!=="esriGeometryPolygon"||(r.maxAllowableOffset=e.resolution,s==="esriGeometryPolyline"&&(r.maxAllowableOffset*=x("feature-polyline-generalization-factor")));const a=this._serviceInfo.capabilities.query;return r.defaultSpatialReferenceEnabled=a.supportsDefaultSpatialReference,r.compactGeometryEnabled=a.supportsCompactGeometry,r}async _executePatchQuery(e,t,s,r){const a=t.clone();a.outFields=[this._serviceInfo.objectIdField,...s],a.returnCentroid=!1,a.returnGeometry=!1;const n=a.start!=null?a.start/8e3:0,o=r.signal;return await this.enqueuePatchQuery({tile:e,query:a,signal:o,depth:n})}async _resend(e,t){const{query:s,message:r}=e,a=s.outFields!=null?s.outFields:[],n=this._queryInfo.outFields,o=n.filter(u=>!a.includes(u));if(r.addOrUpdate!=null)if(o.length)try{const u=this._subscriptions.get(r.id).tile,h=await this._executePatchQuery(u,s,o,t);G(t),s.outFields=n,r.addOrUpdate.joinAttributes(h),this._onMessage({...r,end:r.end,type:"append"})}catch{}else this._onMessage({...r,type:"append"});else this._onMessage({...r,type:"append"})}async _resendSubscription(e){if(x("esri-2d-update-debug")&&console.debug(e.tile.id,"Resend Subscription"),e.empty)return this._onMessage({id:e.tile.id,addOrUpdate:null,end:!1,type:"append"});const t=e.signal;for(const s of e.requests.done)await this._resend(s,{signal:t});return e.edits!=null?this._onMessage(e.edits):void 0}async resend(){const e=Array.from(this._subscriptions.values());await Promise.all(e.map(t=>this._resendSubscription(t)))}};const Ht=x("esri-mobile"),Vt={maxDrillLevel:Ht?1:4,maxRecordCountFactor:Ht?1:3};let ii=class extends Tt{constructor(e){super(e)}async _fetchDataTile(e){const t=this._serviceInfo.capabilities.query.supportsMaxRecordCountFactor,s=this._subscriptions.get(e.key.id),r=s.signal,a=e.getQuantizationParameters();let n=0;const o=async(u,h)=>{const d=this._queryInfo,l=this.createTileQuery(u,{maxRecordCountFactor:t?Vt.maxRecordCountFactor:void 0,returnExceededLimitFeatures:!1,quantizationParameters:a});n++;try{const c=await this.enqueueQuery({tile:e,query:l,signal:r,depth:h});if(n--,G(r),!c)return;if(d!==this._queryInfo)return void o(u,h);if(c.exceededTransferLimit&&h{o--,G(r);const g=e.id,f=l.reader,p=l.query;if(!f.exceededTransferLimit){if(a=!0,c!==0&&!f.hasFeatures){const y={id:g,addOrUpdate:f,end:o===0,type:"append"};return r.add({message:y,query:p}),void this._onMessage(y)}const b={id:g,addOrUpdate:f,end:o===0,type:"append"};return r.add({message:b,query:p}),void this._onMessage(b)}const _={id:g,addOrUpdate:f,end:a&&o===0,type:"append"};r.add({message:_,query:p}),this._onMessage(_)};let h=0,d=0;for(;!a&&d++<20;){let l;for(let c=0;cf&&u(f,g)).catch(f=>{if(a=!0,!ye(f)){ae.getLogger("esri.views.2d.layers.features.sources.PagedFeatureSource").error(new H("mapview-query-error","Encountered error when fetching tile",{tile:e,error:f}));const p={id:e.id,addOrUpdate:null,end:a,type:"append"},_={start:this.pageSize*n,num:this.pageSize,returnExceededLimitFeatures:!0,quantizationParameters:e.getQuantizationParameters()};this.maxRecordCountFactor!=null&&(_.maxRecordCountFactor=this.maxRecordCountFactor);const b=this.createTileQuery(e,_);r.add({message:p,query:b}),this._onMessage(p)}})}await l,G(r),h=Math.min(h+2,6)}}async _fetchDataTilePage(e,t,s){G(s);const r=this._queryInfo,a={start:this.pageSize*t,num:this.pageSize,returnExceededLimitFeatures:!0,quantizationParameters:e.getQuantizationParameters()};this.maxRecordCountFactor!=null&&(a.maxRecordCountFactor=this.maxRecordCountFactor);const n=this.createTileQuery(e,a);try{const o=s.signal,u=await this.enqueueQuery({tile:e,query:n,signal:o,depth:t});return G(s),u?r!==this._queryInfo?this._fetchDataTilePage(e,t,s):{reader:u,query:n}:null}catch(o){return dt(o),null}}};function ni(i,e,t){const s=i.getXHydrated(),r=i.getYHydrated(),a=e.getColumnForX(s),n=Math.floor(e.normalizeCol(a));return`${t}/${Math.floor(e.getRowForY(r))}/${n}`}function rt(i,e){if(i==null)return null;const t=e.transform,s=i.getQuantizationTransform();if(s==null){const[_,b]=t.scale,[y,S]=t.translate,m=-y/_,I=1/_,v=S/b,w=1/-b;return i.transform(m,v,I,w)}const[r,a]=s.scale,[n,o]=s.translate,[u,h]=t.scale,[d,l]=t.translate,c=r/u,g=(n-d)/u,f=a/h,p=(-o+l)/h;return i.transform(g,p,c,f)}let ft=class extends Tt{constructor(e){super(e),this.mode="snapshot",this._loading=!0,this._controller=new AbortController,this._downloadPromise=null,this._didSendEnd=!1,this._queries=new Array,this._invalidated=!1,this._hasAggregates=!1,this._random=new Ls(1e3),this._store=e.store,this._markedIdsBufId=this._store.storage.createBitset()}destroy(){super.destroy(),this._controller.abort()}get loading(){return this._loading}get _signal(){return this._controller.signal}update(e,t){var s;super.update(e,t),this._featureCount==null&&(this._featureCount=t.initialFeatureCount),t.changedFeatureCount!=null&&(this._featureCount=t.changedFeatureCount),this._hasAggregates=!!((s=e.targets)!=null&&s.aggregate)}async resend(e=!1){if(await this._downloadPromise,this._invalidated||e){const s=ut(this._featureCount,"Expected featureCount to be defined");return this._invalidated=!1,this._subscriptions.forEach(r=>r.clear()),this._downloadPromise=this._download(s),void await this._downloadPromise}const t=this._queries.map(({query:s,reader:r})=>this._sendPatchQuery(s,r));await Promise.all(t),this._subscriptions.forEach(s=>{s.requests.done.forEach(r=>this._onMessage(r.message))})}async refresh(e,t){t&&(this._featureCount=t.featureCount),await this.resend(!0)}async _sendPatchQuery(e,t){const s=e.outFields!=null?e.outFields:[],r=this._queryInfo.outFields,a=r.filter(h=>!s.includes(h));if(!a.length)return;const n=e.clone(),o=this._signal;n.returnGeometry=!1,n.returnCentroid=!1,n.outFields=a,e.outFields=r;const u=await this.enqueueQuery({query:n,depth:0,signal:o});G({signal:o}),t.joinAttributes(u)}async _fetchDataTile(e){if(!this._downloadPromise){const u=ut(this._featureCount,"Expected featureCount to be defined");this._downloadPromise=this._download(u)}const t=this._store.search(e),s=this._subscriptions.get(e.key.id),r=t.length-1;for(let u=0;u=0?t[r]:null,e),n=this._didSendEnd,o={type:"append",id:e.id,addOrUpdate:a,end:n,status:L.empty()};s.add({query:null,message:o}),this._onMessage(o)}async _download(e){try{await this.whenInitialized();const t=this._store.storage.getBitset(this._markedIdsBufId),s=new Set;t.clear();const r=Math.ceil(e/this.pageSize),a=Array.from({length:r},(n,o)=>o).sort((n,o)=>this._random.getInt()-this._random.getInt()).map(n=>this._downloadPage(n,t,s));await Promise.all(a),this._store.sweepFeatures(t,this._store.storage),this._store.sweepFeatureSets(s)}catch(t){ae.getLogger("esri.views.2d.layers.features.sources.SnapshotFeatureSource").error("mapview-snapshot-source","Encountered and error when downloading feature snapshot",t)}this._sendEnd(),this._loading=!1}async _downloadPage(e,t,s){const r=this.pageSize,a={start:e*r,num:r,cacheHint:!0};this.maxRecordCountFactor!=null&&(a.maxRecordCountFactor=this.maxRecordCountFactor);const n=this.createQuery(a),o=this._signal,u=await this.enqueueQuery({query:n,depth:e,signal:o});G({signal:o}),this._queries.push({query:n,reader:u}),this._store.insert(u),s.add(u.instance);const h=u.getCursor();for(;h.next();)t.set(h.getDisplayId());this._send(u)}_send(e){if(!this._subscriptions.size)return;let t=null;const s=new Map,r=new Set,a=new Map;this._subscriptions.forEach(n=>{const o=n.tile;s.set(o.key.id,null),t=o.tileInfoView,r.add(o.level);const{row:u,col:h}=o.key,d=`${o.level}/${u}/${h}`,l=a.get(d)??[];l.push(n),a.set(d,l)});for(const n of r){const o=t.getLODInfoAt(n),u=e.getCursor();for(;u.next();){const h=ni(u,o,n),d=u.getIndex();if(a.has(h))for(const l of a.get(h)){const c=l.tile.id;let g=s.get(c);g==null&&(g=[],s.set(c,g)),g.push(d)}}}s.forEach((n,o)=>{if(n!=null){const u=this._subscriptions.get(o),h={type:"append",id:o,addOrUpdate:rt(ms.from(e,n),u.tile),end:!1,status:L.empty()};u.add({query:null,message:h}),this._onMessage(h)}})}_sendEnd(){this._subscriptions.forEach(e=>{const t={type:"append",id:e.tile.id,addOrUpdate:null,end:!0,status:L.empty()};e.add({query:null,message:t}),this._onMessage(t)}),this._didSendEnd=!0}};ft=k([Ve("esri.view.2d.layers.features.sources.SnapshotFeatureSource")],ft);let _e=class extends Ps{constructor(e){super(e)}get connectionStatus(){var e;return(e=this.connection)==null?void 0:e.connectionStatus}get errorString(){var e;return(e=this.connection)==null?void 0:e.errorString}};k([O()],_e.prototype,"connection",void 0),k([O()],_e.prototype,"connectionStatus",null),k([O()],_e.prototype,"errorString",null),_e=k([Ve("esri.views.2d.layers.features.sources.StreamConnectionState")],_e);const oi=2500;function hi(i,e){const t=i.weakClone();if(i.geometry!=null){const s=hs(e,i.geometry.coords[0]),r=us(e,i.geometry.coords[1]);t.geometry=new q([],[s,r])}return t}function ui(i){return i==="esriGeometryPoint"?hi:(e,t)=>{const s=e.weakClone(),r=new q,a=!1,n=!1,o=lt(r,e.geometry,a,n,i,t,!1,!1);return s.geometry=o,s}}function di(i){return i==="esriGeometryPoint"?e=>e.geometry!=null?{minX:e.geometry.coords[0],minY:e.geometry.coords[1],maxX:e.geometry.coords[0],maxY:e.geometry.coords[1]}:{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}:e=>{let t=1/0,s=1/0,r=-1/0,a=-1/0;return e.geometry!=null&&e.geometry.forEachVertex((n,o)=>{t=Math.min(t,n),s=Math.min(s,o),r=Math.max(r,n),a=Math.max(a,o)}),{minX:t,minY:s,maxX:r,maxY:a}}}function li(i,e){const t=xe(9,di(e));return t.load(i),t}function ci(i,e){return i.search({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]})}class gi{constructor(e,t){this.onUpdate=e,this._geometryType=t,this._objectIdToFeature=new Map,this._index=null}get _features(){const e=[];return this._objectIdToFeature.forEach(t=>e.push(t)),e}add(e){this._objectIdToFeature.set(e.objectId,e),this._index=null}get(e){return this._objectIdToFeature.has(e)?this._objectIdToFeature.get(e):null}forEach(e){this._objectIdToFeature.forEach(e)}search(e){return this._index||(this._index=li(this._features,this._geometryType)),ci(this._index,e)}clear(){this._index=null,this._objectIdToFeature.clear()}removeById(e){const t=this._objectIdToFeature.get(e);return t?(this._objectIdToFeature.delete(e),this._index=null,t):null}update(e,t){this.onUpdate(e,t)}get size(){return this._objectIdToFeature.size}}let pi=class extends ys{constructor(e){super(e),this.type="stream",this._updateIntervalId=0,this._level=0,this._isPaused=!1,this._updateInfo={websocket:0,client:0},this._inUpdate=!1;const{outSR:t}=e,{geometryType:s,objectIdField:r,timeInfo:a,purgeOptions:n,source:o,spatialReference:u,serviceFilter:h,maxReconnectionAttempts:d,maxReconnectionInterval:l,updateInterval:c,customParameters:g,enabledEventTypes:f}=e.serviceInfo,p=new gi(this._onUpdate.bind(this),s),_=new sr(p,r,a,n),b=gr(o,u,t,s,h,d,l,g??{});this._connectionState=new _e({connection:b}),this._store=p,this._manager=_,this._connection=b,this._quantize=ui(s),this._enabledEventTypes=new Set(f),this._handlesGroup=Gs([this._connection.on("data-received",y=>this._onFeature(y)),this._connection.on("message-received",y=>this._onWebSocketMessage(y))]),this._initUpdateInterval=()=>{let y=performance.now();this._updateIntervalId=setInterval(()=>{const S=performance.now(),m=S-y;if(m>oi){y=S;const I=Math.round(this._updateInfo.client/(m/1e3)),v=Math.round(this._updateInfo.websocket/(m/1e3));this._updateInfo.client=0,this._updateInfo.websocket=0,this.events.emit("updateRate",{client:I,websocket:v})}e.canAcceptRequest()&&!this._inUpdate&&this._manager.checkForUpdates()},c)},this._isPaused=e.serviceInfo.isPaused,this._isPaused||this._initUpdateInterval()}destroy(){var e;super.destroy(),this._clearUpdateInterval(),this._connection.destroy(),(e=this._handlesGroup)==null||e.remove()}_fetchDataTile(){}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState.errorString}updateCustomParameters(e){this._connection.updateCustomParameters(e)}pauseStream(){this._isPaused||(this._isPaused=!0,this._clearUpdateInterval())}resumeStream(){this._isPaused&&(this._isPaused=!1,this._initUpdateInterval())}sendMessageToSocket(e){this._connection.sendMessageToSocket(e)}sendMessageToClient(e){this._isPaused&&"type"in e&&e.type==="clear"?(this._store.clear(),this._subscriptions.forEach((t,s)=>{t.didSend&&t.tile.level===this._level&&this._onMessage({type:"append",id:s,addOrUpdate:null,clear:!0,end:!0})})):this._connection.sendMessageToClient(e)}enableEvent(e,t){t?this._enabledEventTypes.add(e):this._enabledEventTypes.delete(e)}subscribe(e,t){super.subscribe(e,t);const s=this._subscriptions.get(e.id);s.resolve(),this._level=e.level;const r=this._getTileFeatures(e);this._onMessage({type:"append",id:e.key.id,addOrUpdate:r,end:!0}),s.didSend=!0}unsubscribe(e){super.unsubscribe(e)}*readers(e){const t=this._subscriptions.get(e),{tile:s}=t;yield this._getTileFeatures(s)}createTileQuery(e){throw new Error("Service does not support tile queries")}async resend(){this._subscriptions.forEach(e=>{const{tile:t}=e,s={type:"append",id:t.id,addOrUpdate:this._getTileFeatures(t),end:!0};this._onMessage(s)})}_getTileFeatures(e){const t=this._store.search(e).map(s=>this._quantize(s,e.transform));return P.fromOptimizedFeatures(t,this._serviceInfo,e.transform)}_onWebSocketMessage(e){if(this._enabledEventTypes.has("message-received")&&this.events.emit("message-received",e),"type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this._store.forEach(t=>this._manager.removeById(t.objectId))}}_onFeature(e){this._updateInfo.websocket++;try{this._enabledEventTypes.has("data-received")&&this.events.emit("data-received",e);const t=Ns(e,this._serviceInfo.geometryType,!1,!1,this._serviceInfo.objectIdField);this._manager.add(t)}catch{}}_clearUpdateInterval(){clearInterval(this._updateIntervalId),this._updateIntervalId=0}async _onUpdate(e,t){this._inUpdate=!0;try{e!=null&&(this._updateInfo.client+=e.length),this._subscriptions.forEach((r,a)=>{r.didSend&&r.tile.level===this._level&&this._onMessage({type:"append",id:a,addOrUpdate:null,clear:!0,end:!1})});const s=[];this._subscriptions.forEach((r,a)=>{if(!r.didSend||r.tile.level!==this._level)return;const n=r.tile,o={type:"append",id:a,addOrUpdate:this._getTileFeatures(n),remove:[],end:!1,status:L.empty()};r.requests.stream.enqueue(o),s.push(this._onMessage(o))}),await Promise.all(s),this._subscriptions.forEach((r,a)=>{r.didSend&&r.tile.level===this._level&&this._onMessage({type:"append",id:a,addOrUpdate:null,end:!0})})}catch{}this._inUpdate=!1}};function _i(i,e,t,s,r,a){const n=fi(i,e,t,s,r,a);switch(n.type){case"feature":switch(n.origin){case"hosted":case"local":return new ai(n);case"snapshot":return new ft(n);default:return new ii(n)}case"stream":return new pi(n)}}function fi(i,e,t,s,r,a){switch(i.type){case"snapshot":return{type:"feature",origin:"snapshot",featureCount:i.featureCount??0,serviceInfo:i,onMessage:s,outSR:e,tileInfoView:t,canAcceptRequest:r,store:a};case"stream":return{type:"stream",serviceInfo:i,onMessage:s,outSR:e,canAcceptRequest:r};case"memory":case"on-demand":return{type:"feature",serviceInfo:i,onMessage:s,outSR:e,origin:n(i.source),tileInfoView:t,canAcceptRequest:r}}function n(o){return Array.isArray(o)?"local":"path"in o&&js(o.path)?"hosted":"unknown"}}const $=8388607,Is=8388608,mi=254,yi=255,Ii=0,Ft=1,Ct=i=>(i&Is)>>>23,fe=i=>i&$,bi=i=>Ct(i)===Ft?mi:yi;function Na(i){return Ct(i)===Ft}function At(i,e){return((e?Is:0)|i)>>>0}const Mt=ae.getLogger("esri.views.2d.engine.webgl.Utils"),J="geometry",xi=[{name:J,strideInBytes:12}],vi=[{name:J,strideInBytes:36}],Si=[{name:J,strideInBytes:24}],wi=[{name:J,strideInBytes:12}],Ti=[{name:J,strideInBytes:40}],Fi=[{name:J,strideInBytes:36}],Ci=[{name:J,strideInBytes:36}];function ne(i){const e={};for(const t of i)e[t.name]=t.strideInBytes;return e}const Ai=ne([{name:J,strideInBytes:36}]),Mi=ne(xi),Ei=ne(vi),$i=ne(Si),ki=ne(wi),Ri=ne(Ti),Ui=ne(Fi),Di=ne(Ci);function ja(i,e){switch(i){case Se.MARKER:return e===Be.HEATMAP?Mi:Ai;case Se.FILL:switch(e){case Be.DOT_DENSITY:return ki;case Be.SIMPLE:case Be.OUTLINE_FILL_SIMPLE:return $i;default:return Ei}case Se.LINE:return Ri;case Se.TEXT:return Ui;case Se.LABEL:return Di}}function Qa(i){switch(i){case"butt":return Ue.BUTT;case"round":return Ue.ROUND;case"square":return Ue.SQUARE;default:return Mt.error(new H("mapview-invalid-type",`Cap type ${i} is not a valid option. Defaulting to round`)),Ue.ROUND}}function Ya(i){switch(i){case"miter":return De.MITER;case"bevel":return De.BEVEL;case"round":return De.ROUND;default:return Mt.error(new H("mapview-invalid-type",`Join type ${i} is not a valid option. Defaulting to round`)),De.ROUND}}J+"",Qs.STATIC_DRAW;function qi(i){switch(i){case X.UNSIGNED_BYTE:return Uint8Array;case X.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case X.FLOAT:return Float32Array;default:return void Mt.error(new H("webgl-utils",`Unable to handle type ${i}`))}}const Bi=(i,e)=>i&&((...t)=>e.warn("DEBUG:",...t))||(()=>null),zi=!1;function Oi(i,e){if(!i||!e)return i;switch(e){case"radius":case"distance":return 2*i;case"diameter":case"width":return i;case"area":return Math.sqrt(i)}return i}const me=ae.getLogger("esri.views.layers.2d.features.support.AttributeStore"),Le=Bi(zi,me),Me={sharedArrayBuffer:x("esri-shared-array-buffer"),atomics:x("esri-atomics")};function it(i,e){return t=>e(i(t))}class Li{constructor(e,t,s,r){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:a,layout:n,textureOnly:o}=r;this.textureOnly=o||!1,this.pixelType=a,this._ctype=t,this.layout=n,this._resetRange(),this._shared=e,this.size=s,o||(this.data=this._initData(a,s,e,t))}get buffer(){return re(this.data,e=>e.buffer)}unsetComponentAllTexels(e,t){const s=this.data;for(let r=0;rt)return null;this._resetRange();const r=!(this._shared||this._ctype==="local"),a=this.pixelType,n=this.layout,o=this.data;return{start:e,end:t,data:r&&o.slice(e*s,(t+1)*s)||null,pixelType:a,layout:n}}_initData(e,t,s,r){const a=s&&r!=="local"?SharedArrayBuffer:ArrayBuffer,n=qi(e),o=new n(new a(t*t*4*n.BYTES_PER_ELEMENT));for(let u=0;unull)}destroy(){this._abortController.abort(),this.updatingHandles.destroy()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}isUpdating(){const e=this.updatingHandles.updating||!!this._nextUpdate;return x("esri-2d-log-updating")&&console.log(`Updating AttributeStore: ${e} + -> updatingHandles ${this.updatingHandles.updating} (currUpdate: ${!!this._currUpdate}) + -> nextUpdate: ${!!this._nextUpdate} +`),e}update(e,t){this.config=t;const s=t.schema.processors[0].storage,r=be(this._schema,s);if((e.targets.feature||e.targets.aggregate)&&(e.storage.data=!0),r&&(x("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",r),e.storage.data=!0,this._schema=s,this._attributeComputeInfo=null,s!=null)){switch(s.target){case"feature":this._targetType=Ii;break;case"aggregate":this._targetType=Ft}if(s.type==="subtype"){this._attributeComputeInfo={isSubtype:!0,subtypeField:s.subtypeField,map:new Map};for(const a in s.mapping){const n=s.mapping[a];if(n!=null&&n.vvMapping!=null)for(const o of n.vvMapping)this._bindAttribute(o,parseInt(a,10))}}else{if(this._attributeComputeInfo={isSubtype:!1,map:new Map},s.vvMapping!=null)for(const a of s.vvMapping)this._bindAttribute(a);if(s.attributeMapping!=null)for(const a of s.attributeMapping)this._bindAttribute(a)}}}onTileData(e,t){if(t.addOrUpdate==null)return;const s=t.addOrUpdate.getCursor();for(;s.next();){const r=s.getDisplayId();this.setAttributeData(r,s)}}async setHighlight(e,t){const r=this._getBlock(0),a=t.map(n=>fe(n));r.lock(),r.unsetComponentAllTexels(0,1),r.setComponent(0,1,a),r.unlock(),this._idsToHighlight.clear();for(const n of e)this._idsToHighlight.add(n);await this.sendUpdates()}async updateFilters(e,t,s){x("esri-2d-update-debug")&&console.debug("AttributeStore::updateFilters");const{service:r,spatialReference:a}=s,{filters:n}=t,o=n.map((h,d)=>this._updateFilter(h,d,r,a)),u=(await Promise.all(o)).some(h=>h);x("esri-2d-update-debug")&&console.debug("AttributeStore::updateFilters - finsihed"),u&&(e.storage.filters=!0,x("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(e,t,s,r){const a=fe(e);this._ensureSizeForTexel(a),this._getBlock(t).setData(e,s,r)}getData(e,t,s){return this._getBlock(t).getData(e,s)}getHighlightFlag(e){return this._idsToHighlight.has(e)?_r:0}unsetAttributeData(e){const t=fe(e);this._getBlock(0).setData(t,0,0)}setAttributeData(e,t){const s=fe(e);if(this._ensureSizeForTexel(s),this._getBlock(0).setData(s,0,this.getFilterFlags(t)),this._targetType!==Ct(e))return;const r=this._attributeComputeInfo,a=this.config.supportsTextureFloat?1:2,n=4;let o=null;r&&(o=r.isSubtype?r.map.get(t.readAttribute(r.subtypeField)):r.map,o&&o.size&&o.forEach((u,h)=>{const d=h*a%n,l=Math.floor(h*a/n),c=this._getBlock(l+fr),g=u(t);if(this.config.supportsTextureFloat)c.setData(s,d,g);else if(g===Ot)c.setData(s,d,255),c.setData(s,d+1,255);else{const f=Hs(Math.round(g),-32767,32766)+32768,p=255&f,_=(65280&f)>>8;c.setData(s,d,p),c.setData(s,d+1,_)}}))}sendUpdates(){if(x("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate"),this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=He(),this.updatingHandles.addPromise(this._nextUpdate.promise),this._nextUpdate.promise;const e={blocks:this._blocks.map(t=>t!=null?t.toMessage():null)};return this._currUpdate=this._createResources().then(()=>{const t=()=>{if(this._currUpdate=null,this._nextUpdate){const r=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then(()=>r.resolve())}else x("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::No additional updates queued")};x("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::client.update");const s=this.updatingHandles.addPromise(this._client.update(e,this._signal).then(t).catch(t));return this._client.render(this._signal),s}).catch(t=>{if(ye(t))return this._createResourcesPromise=null,this._createResources();me.error(new H("mapview-attribute-store","Encountered an error during client update",t))}),this._currUpdate}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}_bindAttribute(e,t){function s(){const{normalizationField:h}=e;return h?d=>{const l=d.readAttribute(h);return l?d.readAttribute(e.field)/l:null}:d=>d.readAttribute(e.field)}function r(){return e.normalizationField&&me.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),h=>h.getComputedNumericAtIndex(e.fieldIndex)}let a;if(e.fieldIndex!=null)a=r();else{if(!e.field)return;a=s()}const{valueRepresentation:n}=e;n&&(a=it(a,h=>Oi(h,n)));const o=h=>h===null||isNaN(h)||h===1/0||h===-1/0?Ot:h,u=this._attributeComputeInfo;if(u.isSubtype){const h=u.map.get(t)??new Map;h.set(e.binding,it(a,o)),u.map.set(t,h)}else u.map.set(e.binding,it(a,o))}_createResources(){if(this._createResourcesPromise!=null)return this._createResourcesPromise;this._getBlock(mr),this._getBlock(yr),Le("Initializing AttributeStore");const e={shared:Me.sharedArrayBuffer&&this._client.type!=="local",size:this._size,blocks:Ys(this._blocks,s=>({textureOnly:s.textureOnly,buffer:s.buffer,pixelType:s.pixelType}))},t=this._client.initialize(e,this._signal).catch(s=>{ye(s)?this._createResourcesPromise=null:me.error(new H("mapview-attribute-store","Encountered an error during client initialization",s))});return this._createResourcesPromise=t,t.then(()=>this._createResourcesPromise==null?this._createResources():void 0),t}_getBlock(e){const t=this._blocks[e];if(t!=null)return t;Le(`Initializing AttributeBlock at index ${e}`);const s=Me.sharedArrayBuffer,r=this._client.type,a=new Li(s,r,this._size,this._blockDescriptors[e]);return this._blocks[e]=a,this._createResourcesPromise=null,a}_expand(){if(this._sizet.expand(e)),this._createResourcesPromise=null,this._size=e,0}return me.error(new H("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(e,t,s,r){const a=this._filters[t],n=a!=null&&a.hash;if(!a&&!e||n===JSON.stringify(e))return!1;if(e==null){if(!a)return!1;const u=1<import("./FeatureFilter-2d6ab0aa.js"),["assets/FeatureFilter-2d6ab0aa.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FieldsIndex-f79a8f26.js","assets/Query-1c961d4c.js","assets/StreamFeatureManager-4b8ac3ac.js","assets/quickselect-e80674f5.js","assets/diffUtils-590c9088.js","assets/arcadeTimeUtils-e1438cc8.js","assets/centroid-8e8cfa47.js","assets/ogcFeatureUtils-1ccf1f8d.js","assets/geojson-077f67ec.js","assets/clientSideDefaults-ab04bd90.js","assets/defaultsJSON-59981e75.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/createConnection-4b117798.js","assets/definitions-0bc08d4c.js","assets/TileInfoView-346e56d0.js","assets/number-e491b09e.js","assets/geohashUtils-77d8429b.js"]),a=new r({geometryType:t.geometryType,hasM:!1,hasZ:!1,timeInfo:t.timeInfo,fieldsIndex:new Ee(t.fields)});return this._filters[e]=a,a}isVisible(e){return!!(2&this._getBlock(0).getData(e,0))}getFilterFlags(e){let t=0;const s=bi(e.getDisplayId());for(let a=0;a{},this._nodes=0,this._root=new at(this,0,0,0),this._statisticFields=e,this._pool=s?new xt(8096):null,this._serviceInfo=t}destroy(){this.clear()}_acquire(e,t,s){this._nodes++;let r=null;return this._pool!=null&&(r=this._pool.dequeue()),r!=null?r.realloc(e,t,s):r=new at(this,e,t,s),r}_release(e){this.onRelease(e),this._nodes--,this._pool!=null&&this._pool.enqueue(e)}get count(){return this._root.count}get size(){return this._nodes}get poolSize(){var e;return((e=this._pool)==null?void 0:e.size)??0}get depth(){let e=0;return this.forEach(t=>e=Math.max(e,t.depth)),e}dropLevels(e){this.forEach(t=>{if(t.depth>=e)for(let s=0;s{if(t.depth>=e)for(let s=0;sthis._release(e)),this._root=new at(this,0,0,0)}insert(e,t,s=0){const r=P.fromOptimizedFeatures([e],this._serviceInfo).getCursor();r.next();const a=r.readGeometry();if(!a)return;const[n,o]=a.coords,u=e.geohashX,h=e.geohashY;this.insertCursor(r,e.displayId,n,o,u,h,t,s)}insertCursor(e,t,s,r,a,n,o,u=0){let h=this._root,d=0,l=0,c=0;for(;h!==null;){if(h.depth>=u&&(h.count+=1,h.xTotal+=s,h.yTotal+=r,h.xGeohashTotal+=a,h.yGeohashTotal+=n,h.referenceId=t,this._updateStatisticsCursor(e,h,1)),d>=o)return void h.add(t);const g=Math.ceil((d+1)/2),f=Math.floor((d+1)/2),p=1-d%2,_=30-(3*g+2*f),b=30-(2*g+3*f),y=(a&7*p+3*(1-p)<<_)>>_,S=(n&3*p+7*(1-p)<>b,m=y+S*(8*p+4*(1-p));l=l<<3*p+2*(1-p)|y,c=c<<2*p+3*(1-p)|S,h.children[m]==null&&(h.children[m]=this._acquire(l,c,d+1)),d+=1,h=h.children[m]}}remove(e,t){const s=P.fromOptimizedFeatures([e],this._serviceInfo).getCursor();s.next();const r=s.readGeometry();if(!r)return;const[a,n]=r.coords,o=e.geohashX,u=e.geohashY;this.removeCursor(s,a,n,o,u,t)}removeCursor(e,t,s,r,a,n){let o=this._root,u=0;for(;o!==null;){if(o.count-=1,o.xTotal-=t,o.yTotal-=s,o.xGeohashTotal-=r,o.yGeohashTotal-=a,this._updateStatisticsCursor(e,o,-1),u>=n)return void o.remove(e.getDisplayId());const h=Math.ceil((u+1)/2),d=Math.floor((u+1)/2),l=1-u%2,c=30-(3*h+2*d),g=30-(2*h+3*d),f=((r&7*l+3*(1-l)<>c)+((a&3*l+7*(1-l)<>g)*(8*l+4*(1-l)),p=o.children[f];(p==null?void 0:p.count)===1&&(this._release(p),o.children[f]=null),u+=1,o=p}}forEach(e){let t=this._root;for(;t!==null;){const s=this._linkChildren(t)||t.next;e(t),t=s}}find(e,t,s){return this._root.find(e,t,s,0,0,0)}findIf(e){let t=null;return this.forEach(s=>{e(s)&&(t=s)}),t}findAllIf(e){const t=[];return this.forEach(s=>{e(s)&&t.push(s)}),t}findSingleOccupancyNode(e,t,s,r,a){let n=this._root;for(;n!==null;){const o=n.depth,u=n.xNode,h=n.yNode,d=1-o%2,l=n.xGeohashTotal/n.count,c=n.yGeohashTotal/n.count;if(n.count===1&&e=a){n=n.next;continue}const g=Math.ceil((o+1)/2),f=Math.floor((o+1)/2),p=30-(3*g+2*f),_=30-(2*g+3*f),b=~((1<>p,m=(t&y)>>_,I=(s&b)>>p,v=(r&y)>>_,w=u<<3*d+2*(1-d),M=h<<2*d+3*(1-d),C=w+8*d+4*(1-d),F=M+4*d+8*(1-d),A=Math.max(w,S),T=Math.max(M,m),E=Math.min(C,I),R=Math.min(F,v);let D=null,V=null;for(let U=T;U<=R;U++)for(let Y=A;Y<=E;Y++){const j=Y-w+(U-M)*(8*d+4*(1-d)),B=n.children[j];B&&(D||(D=B,D.next=n.next),V&&(V.next=B),V=B,B.next=n.next)}n=D||n.next}return null}getRegionDisplayIds(e){let t=this._root;const{bounds:s,geohashBounds:r,level:a}=e,[n,o,u,h]=s,d=[];for(;t!==null;){const l=t.depth,c=t.xNode,g=t.yNode;if(l>=a){const j=t.xTotal/t.count,B=t.yTotal/t.count;j>=n&&j<=u&&B>=o&&B<=h&&t.displayIds.forEach(W=>d.push(W)),t=t.next;continue}const f=Math.ceil((l+1)/2),p=Math.floor((l+1)/2),_=1-l%2,b=30-(3*f+2*p),y=30-(2*f+3*p),S=~((1<>b,v=(r.yLL&m)>>y,w=(r.xTR&S)>>b,M=(r.yTR&m)>>y,C=c<<3*_+2*(1-_),F=g<<2*_+3*(1-_),A=C+8*_+4*(1-_),T=F+4*_+8*(1-_),E=Math.max(C,I),R=Math.max(F,v),D=Math.min(A,w),V=Math.min(T,M);let U=null,Y=null;for(let j=R;j<=V;j++)for(let B=E;B<=D;B++){const W=B-C+(j-F)*(8*_+4*(1-_)),Z=t.children[W];Z&&(U||(U=Z,U.next=t.next),Y&&(Y.next=Z),Y=Z,Z.next=t.next)}t=U||t.next}return d}getRegionStatistics(e){let t=this._root,s=0,r=0,a=0;const n={},{bounds:o,geohashBounds:u,level:h}=e,[d,l,c,g]=o;let f=0;for(;t!==null;){const p=t.depth,_=t.xNode,b=t.yNode;if(p>=h){const K=t.xTotal/t.count,ee=t.yTotal/t.count;K>d&&K<=c&&ee>l&&ee<=g&&(s+=t.count,r+=t.xTotal,a+=t.yTotal,t.count===1&&(f=t.referenceId),this._aggregateStatistics(n,t.statistics)),t=t.next;continue}const y=Math.ceil((p+1)/2),S=Math.floor((p+1)/2),m=1-p%2,I=30-(3*y+2*S),v=30-(2*y+3*S),w=~((1<>I,F=(u.yLL&M)>>v,A=(u.xTR&w)>>I,T=(u.yTR&M)>>v,E=_<<3*m+2*(1-m),R=b<<2*m+3*(1-m),D=E+8*m+4*(1-m),V=R+4*m+8*(1-m),U=Math.max(E,C),Y=Math.max(R,F),j=Math.min(D,A),B=Math.min(V,T);let W=null,Z=null;for(let K=Y;K<=B;K++)for(let ee=U;ee<=j;ee++){const vs=ee-E+(K-R)*(8*m+4*(1-m)),z=t.children[vs];if(z){if(K!==Y&&K!==B&&ee!==U&&ee!==j){const $t=z.xTotal/z.count,kt=z.yTotal/z.count;$t>d&&$t<=c&&kt>l&&kt<=g&&(s+=z.count,r+=z.xTotal,a+=z.yTotal,z.count===1&&(f=z.referenceId),this._aggregateStatistics(n,z.statistics));continue}W||(W=z,W.next=t.next),Z&&(Z.next=z),Z=z,z.next=t.next}}t=W||t.next}return{count:s,attributes:this.normalizeStatistics(n,s),xTotal:r,yTotal:a,referenceId:f}}getBins(e){const t=[],{geohashBounds:s,level:r}=e;let a=this._root;for(;a!==null;){const n=a.depth,o=a.xNode,u=a.yNode;if(n>=r){t.push(a),a=a.next;continue}const h=Math.ceil((n+1)/2),d=Math.floor((n+1)/2),l=1-n%2,c=30-(3*h+2*d),g=30-(2*h+3*d),f=~((1<>c,b=(s.yLL&p)>>g,y=(s.xTR&f)>>c,S=(s.yTR&p)>>g,m=o<<3*l+2*(1-l),I=u<<2*l+3*(1-l),v=m+8*l+4*(1-l),w=I+4*l+8*(1-l),M=Math.max(m,_),C=Math.max(I,b),F=Math.min(v,y),A=Math.min(w,S);let T=null,E=null;for(let R=C;R<=A;R++)for(let D=M;D<=F;D++){const V=D-m+(R-I)*(8*l+4*(1-l)),U=a.children[V];U&&(T||(T=U,T.next=a.next),E&&(E.next=U),E=U,U.next=a.next)}a=T||a.next}return t}_linkChildren(e){let t=null,s=null;for(let r=0;r<=e.children.length;r++){const a=e.children[r];a&&(t||(t=a,t.next=e.next),s&&(s.next=a),s=a,a.next=e.next)}return t}_updateStatisticsCursor(e,t,s){for(const r of this._statisticFields){const a=r.name,n=r.inField?e.readAttribute(r.inField):e.getComputedNumericAtIndex(r.inFieldIndex);switch(r.statisticType){case"min":{if(isNaN(n))break;if(!t.statistics[a]){t.statistics[a]={value:n};break}const o=t.statistics[a].value;t.statistics[a].value=Math.min(o,n);break}case"max":{if(isNaN(n))break;if(!t.statistics[a]){t.statistics[a]={value:n};break}const o=t.statistics[a].value;t.statistics[a].value=Math.max(o,n);break}case"count":break;case"sum":case"avg":{t.statistics[a]||(t.statistics[a]={value:0,nanCount:0});const o=t.statistics[a].value,u=t.statistics[a].nanCount??0;n==null||isNaN(n)?t.statistics[a].nanCount=u+s:t.statistics[a].value=o+s*n;break}case"avg_angle":{t.statistics[a]||(t.statistics[a]={x:0,y:0,nanCount:0});const o=t.statistics[a].x,u=t.statistics[a].y,h=t.statistics[a].nanCount??0,d=Math.PI/180;n==null||isNaN(n)?t.statistics[a].nanCount=h+s:(t.statistics[a].x=o+s*Math.cos(n*d),t.statistics[a].y=u+s*Math.sin(n*d));break}case"mode":{t.statistics[a]||(t.statistics[a]={});const o=t.statistics[a][n]||0;t.statistics[a][n]=o+s;break}}}}_aggregateStatistics(e,t){for(const s of this._statisticFields){const r=s.name;switch(s.statisticType){case"min":{if(!e[r]){e[r]={value:t[r].value};break}const a=e[r].value;e[r].value=Math.min(a,t[r].value);break}case"max":{if(!e[r]){e[r]={value:t[r].value};break}const a=e[r].value;e[r].value=Math.max(a,t[r].value);break}case"count":break;case"sum":case"avg":case"avg_angle":case"mode":e[r]||(e[r]={});for(const a in t[r]){const n=e[r][a]||0;e[r][a]=n+t[r][a]}}}}normalizeStatistics(e,t){const s={};for(const r of this._statisticFields){const a=r.name;switch(r.statisticType){case"min":case"max":{const n=e[a];if(!t||!n)break;s[a]=n.value;break}case"count":if(!t)break;s[a]=t;break;case"sum":{if(!t)break;const{value:n,nanCount:o}=e[a];if(!(t-o))break;s[a]=n;break}case"avg":{if(!t)break;const{value:n,nanCount:o}=e[a];if(!(t-o))break;s[a]=n/(t-o);break}case"avg_angle":{if(!t)break;const{x:n,y:o,nanCount:u}=e[a];if(!(t-u))break;const h=n/(t-u),d=o/(t-u),l=180/Math.PI,c=Math.atan2(d,h)*l;s[a]=c;break}case"mode":{const n=e[a];let o=0,u=0,h=null;for(const d in n){const l=n[d];l===o?u+=1:l>o&&(o=l,u=1,h=d)}s[a]=h==="null"||u>1?null:h;break}}}return s}};class at{constructor(e,t,s,r){this.count=0,this.xTotal=0,this.yTotal=0,this.statistics={},this.displayId=0,this.referenceId=0,this.displayIds=new Set,this.next=null,this.depth=0,this.xNode=0,this.yNode=0,this.xGeohashTotal=0,this.yGeohashTotal=0,this._tree=e,this.children=new Array(32);for(let a=0;a=s)return this;const o=1-r%2,u=3*o+2*(1-o),h=2*o+3*(1-o),d=30-a-u,l=30-n-h,c=((e&7*o+3*(1-o)<>d)+((t&3*o+7*(1-o)<>l)*(8*o+4*(1-o)),g=this.children[c];return g==null?null:g.find(e,t,s,r+1,a+u,n+h)}}const nt=ae.getLogger("esri.view.2d.layers.features.support.BinStore"),Zt=12,Gi=64,Ni=mt(),ji=5;function Jt(i){return 57.29577951308232*i}let Qi=class extends vt{constructor(e,t,s,r){super(e,s),this.type="bin",this.events=new Re,this.objectIdField="aggregateId",this.featureAdapter=wt,this._geohashLevel=ji,this._geohashBuf=[],this._serviceInfo=r,this.geometryInfo=e.geometryInfo,this._spatialReference=t,this._projectionSupportCheck=_s(t,ie.WGS84),this._bitsets.geohash=s.getBitset(s.createBitset()),this._bitsets.inserted=s.getBitset(s.createBitset())}destroy(){this._tree&&this._tree.destroy()}get featureSpatialReference(){return this._spatialReference}get fields(){return this._fields}async updateSchema(e,t){const s=this._schema;try{await super.updateSchema(e,t),await this._projectionSupportCheck}catch{}this._fields=this._schema.params.fields;const r=be(s,t);t&&(r!=null||e.source||e.storage.filters)?(($e(r,"params.fields")||$e(r,"params")||!this._tree||e.source)&&(this._tree&&this._tree.destroy(),this._tree=new bs(this._statisticFields,this._serviceInfo),this._tree.onRelease=a=>a.displayId&&this._storage.releaseDisplayId(a.displayId),this._geohashLevel=this._schema.params.fixedBinLevel,this._rebuildTree(),x("esri-2d-update-debug")&&nt.info("Aggregate mesh needs update due to tree changing")),x("esri-2d-update-debug")&&nt.info("Aggregate mesh needs update due to tree changing"),e.targets[t.name]=!0,e.mesh=!1):s&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,t){this._bitsets.inserted.forEachSet(s=>{if(!e.has(s)){const r=t.lookupByDisplayIdUnsafe(s);this._remove(r)}})}sweepAggregates(e,t,s){}onTileData(e,t,s,r,a=!0){if(!this._schema||t.addOrUpdate==null)return t;this.events.emit("changed");const n=this._getTransforms(e,this._spatialReference);{const u=t.addOrUpdate.getCursor();for(;u.next();)this._update(u,r)}if(t.status.mesh||!a)return t;const o=new Array;this._getBinsForTile(o,e,n,s),t.addOrUpdate=P.fromOptimizedFeatures(o,{fields:this.fields,geometryType:"esriGeometryPolygon",objectIdField:this.objectIdField}),t.addOrUpdate.attachStorage(s),t.end=!0,t.isRepush||(t.clear=!0);{const u=t.addOrUpdate.getCursor();for(;u.next();){const h=u.getDisplayId();this._bitsets.computed.unset(h),this.setComputedAttributes(s,u,h,e.scale)}}return t}forEachBin(e){this._tree.forEach(e)}forEach(e){this._tree.forEach(t=>{if(t.depth!==this._geohashLevel)return;const s=this._toFeatureJSON(t),r=P.fromFeatures([s],{objectIdField:this.objectIdField,globalIdField:null,geometryType:this.geometryInfo.geometryType,fields:this.fields}).getCursor();r.next(),e(r)})}forEachInBounds(e,t){}forEachBounds(e,t){const{hasM:s,hasZ:r}=this.geometryInfo;for(const a of e){const n=ds(Ni,a.readGeometry(),r,s);n!=null&&t(n)}}onTileUpdate(e){}getAggregate(e){const t=At(e,!0),s=this._tree.findIf(r=>r.displayId===t);return re(s,r=>this._toFeatureJSON(r))}getAggregates(){return this._tree.findAllIf(e=>e.depth===this._geohashLevel).map(this._toFeatureJSON.bind(this))}getDisplayId(e){const t=this._tree.findIf(s=>s.id===e);return re(t,s=>s.displayId)}getFeatureDisplayIdsForAggregate(e){const t=this._tree.findIf(s=>s.id===e);return t!=null?Array.from(t.displayIds):[]}getDisplayIdForReferenceId(e){const t=this._tree.findIf(s=>s.displayIds.size===1&&s.displayIds.has(e));return re(t,s=>s.displayId)}_toFeatureJSON(e){const t=this._spatialReference;return{displayId:e.displayId,attributes:e.getAttributes(),geometry:ke(e.getGeometry(t),"esriGeometryPolygon",!1,!1),centroid:null}}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const t=e.getDisplayId(),s=e.getXHydrated(),r=e.getYHydrated(),a=this._geohashBuf[2*t],n=this._geohashBuf[2*t+1];this._bitsets.inserted.has(t)&&(this._bitsets.inserted.unset(t),this._tree.removeCursor(e,s,r,a,n,this._geohashLevel))}_update(e,t){const s=e.getDisplayId(),r=this._bitsets.inserted,a=t.isVisible(s);if(a===r.has(s))return;if(!a)return void this._remove(e);const n=e.getXHydrated(),o=e.getYHydrated();if(!this._setGeohash(s,n,o))return;const u=this._geohashBuf[2*s],h=this._geohashBuf[2*s+1];this._tree.insertCursor(e,s,n,o,u,h,this._geohashLevel),r.set(s)}_setGeohash(e,t,s){if(this._bitsets.geohash.has(e))return!0;const r=this._geohashBuf;if(this._spatialReference.isWebMercator){const a=Jt(t/se.radius),n=a-360*Math.floor((a+180)/360),o=Jt(Math.PI/2-2*Math.atan(Math.exp(-s/se.radius)));Xe(r,e,o,n,Zt)}else{const a=Ie({x:t,y:s},this._spatialReference,ie.WGS84);if(!a)return!1;Xe(r,e,a.y,a.x,Zt)}return this._bitsets.geohash.set(e),!0}_getBinsForTile(e,t,s,r){try{const a=this._getGeohashBounds(t),n=this._tree.getBins(a);for(const o of n){o.displayId||(o.displayId=r.createDisplayId(!0));let u=null;const h=o.getGeometry(this._spatialReference,s.tile);h||(u=o.getGeometryCentroid(this._spatialReference,s.tile));const d=new yt(h,o.getAttributes(),u);d.objectId=o.id,d.displayId=o.displayId,e.push(d)}}catch{return void nt.error("Unable to get bins for tile",t.key.id)}}_getGeohash(e,t,s){const r={geohashX:0,geohashY:0};return Ne(r,t,e,s),r}_getGeohashBounds(e){const t=this._getGeohashLevel(e.key.level),s=[e.extent.xmin,e.extent.ymin,e.extent.xmax,e.extent.ymax],r=ls.fromExtent(bt.fromBounds(s,this._spatialReference)),a=Ie(r,this._spatialReference,ie.WGS84,{densificationStep:e.resolution*Gi}),n=It(new q,a,!1,!1),o=n.coords.filter((p,_)=>!(_%2)),u=n.coords.filter((p,_)=>_%2),h=Math.min(...o),d=Math.min(...u),l=Math.max(...o),c=Math.max(...u),g=this._getGeohash(h,d,t),f=this._getGeohash(l,c,t);return{bounds:s,geohashBounds:{xLL:g.geohashX,yLL:g.geohashY,xTR:f.geohashX,yTR:f.geohashY},level:t}}_getGeohashLevel(e){return this._schema.params.fixedBinLevel}_getTransforms(e,t){const s={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},r=cs(t);if(!r)return{tile:s,left:null,right:null};const[a,n]=r.valid;return{tile:s,left:{...s,translate:[n,e.bounds[3]]},right:{...s,translate:[a-n+e.bounds[0],e.bounds[3]]}}}};const ot=12,Yi=64,Wt=1,Xi=mt();class Et extends Zs{constructor(e,t,s,r,a){super(new q([],[t,s]),r,null,e),this.geohashBoundsInfo=a}get count(){return this.attributes.cluster_count}static create(e,t,s,r,a,n,o,u){const h=new Et(t,s,r,n,o);return h.displayId=e.createDisplayId(!0),h.referenceId=u,h.tileLevel=a,h}update(e,t,s,r,a,n){return this.geometry.coords[0]=e,this.geometry.coords[1]=t,this.tileLevel=s,this.attributes=r,this.geohashBoundsInfo=a,this.referenceId=null,this.referenceId=n,this}toJSON(){return{attributes:{...this.attributes,aggregateId:this.objectId,referenceId:this.attributes.cluster_count===1?this.referenceId:null},geometry:{x:this.geometry.coords[0],y:this.geometry.coords[1]}}}}function ce(i){return 57.29577951308232*i}class Hi extends vt{constructor(e,t,s,r){super(e,s),this.type="cluster",this.events=new Re,this.objectIdField="aggregateId",this.featureAdapter=wt,this._geohashLevel=0,this._tileLevel=0,this._aggregateValueRanges={},this._aggregateValueRangesChanged=!1,this._geohashBuf=[],this._clusters=new Map,this._tiles=new Map,this._serviceInfo=r,this.geometryInfo=e.geometryInfo,this._spatialReference=t,this._projectionSupportCheck=_s(t,ie.WGS84),this._bitsets.geohash=s.getBitset(s.createBitset()),this._bitsets.inserted=s.getBitset(s.createBitset())}destroy(){this._tree.destroy()}get featureSpatialReference(){return this._spatialReference}get fields(){return this._fields}async updateSchema(e,t){const s=this._schema;try{await super.updateSchema(e,t),await this._projectionSupportCheck}catch{}this._fields=[...this._schema.params.fields,{name:"referenceId",alias:"referenceId",type:"esriFieldTypeInteger"}],this._fields.some(a=>a.name==="cluster_count")||this._fields.push({name:"cluster_count",alias:"cluster_count",type:"esriFieldTypeInteger"});const r=be(s,t);t&&(r!=null||e.source||e.storage.filters)?(($e(r,"params.fields")||!this._tree||e.source)&&(this._tree&&this._tree.destroy(),this._tree=new bs(this._statisticFields,this._serviceInfo),this._rebuildTree(),x("esri-2d-update-debug")&&console.debug("Aggregate mesh needs update due to tree changing")),x("esri-2d-update-debug")&&console.debug("Applying Update - ClusterStore:",r),e.targets[t.name]=!0,e.mesh=!1,this._aggregateValueRanges={}):s&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,t){this._bitsets.inserted.forEachSet(s=>{if(!e.has(s)){const r=t.lookupByDisplayIdUnsafe(s);this._remove(r)}})}sweepAggregates(e,t,s){this._clusters.forEach((r,a)=>{r&&r.tileLevel!==s&&(e.releaseDisplayId(r.displayId),t.unsetAttributeData(r.displayId),this._clusters.delete(a))})}onTileData(e,t,s,r,a=!0){if(!this._schema||t.addOrUpdate==null)return t;this.events.emit("changed");const n=this._getTransforms(e,this._spatialReference);{const h=t.addOrUpdate.getCursor();for(;h.next();)this._update(h,r)}if(t.status.mesh||!a)return t;const o=new Array,u=this._schema.params.clusterRadius;this._getClustersForTile(o,e,u,s,n),t.addOrUpdate=P.fromOptimizedFeatures(o,{fields:this.fields,geometryType:"esriGeometryPoint",objectIdField:this.objectIdField}),t.addOrUpdate.attachStorage(s),t.clear=!0,t.end=!0;{const h=t.addOrUpdate.getCursor();for(;h.next();){const d=h.getDisplayId();this._bitsets.computed.unset(d),this.setComputedAttributes(s,h,d,e.scale)}}return this._aggregateValueRangesChanged&&t.end&&(this.events.emit("valueRangesChanged",{valueRanges:this._aggregateValueRanges}),this._aggregateValueRangesChanged=!1),t}onTileUpdate({added:e,removed:t}){if(e.length){const r=e[0].level;this._tileLevel=r,this._setGeohashLevel(r)}if(!this._schema)return;const s=this._schema.params.clusterRadius;t.forEach(r=>{this._tiles.delete(r.key.id),this._markTileClustersForDeletion(r,s)})}getAggregate(e){for(const t of this._clusters.values())if(((t==null?void 0:t.displayId)&$)==(e&$))return t.toJSON();return null}getAggregates(){const e=[];for(const t of this._clusters.values())(t==null?void 0:t.tileLevel)===this._tileLevel&&e.push(t.toJSON());return e}getDisplayId(e){const t=this._clusters.get(e);return t?t.displayId:null}getFeatureDisplayIdsForAggregate(e){const t=this._clusters.get(e);return t?this._tree.getRegionDisplayIds(t.geohashBoundsInfo):[]}getDisplayIdForReferenceId(e){for(const t of this._clusters.values())if((t==null?void 0:t.referenceId)===e)return t.displayId;return null}getAggregateValueRanges(){return this._aggregateValueRanges}forEach(e){this._clusters.forEach(t=>{if(!t)return;const s=t.toJSON(),r=P.fromFeatures([s],{objectIdField:this.objectIdField,globalIdField:null,geometryType:this.geometryInfo.geometryType,fields:this.fields}).getCursor();r.next(),e(r)})}forEachInBounds(e,t){}forEachBounds(e,t){const{hasM:s,hasZ:r}=this.geometryInfo;for(const a of e){const n=ds(Xi,a.readGeometry(),r,s);n!=null&&t(n)}}size(){let e=0;return this.forEach(t=>e++),e}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const t=e.getDisplayId(),s=e.getXHydrated(),r=e.getYHydrated(),a=this._geohashBuf[2*t],n=this._geohashBuf[2*t+1];this._bitsets.inserted.has(t)&&(this._bitsets.inserted.unset(t),this._tree.removeCursor(e,s,r,a,n,this._geohashLevel))}_update(e,t){const s=e.getDisplayId(),r=this._bitsets.inserted,a=t.isVisible(s);if(a===r.has(s))return;if(!a)return void this._remove(e);const n=e.getXHydrated(),o=e.getYHydrated();if(!this._setGeohash(s,n,o))return;const u=this._geohashBuf[2*s],h=this._geohashBuf[2*s+1];this._tree.insertCursor(e,s,n,o,u,h,this._geohashLevel),r.set(s)}_setGeohash(e,t,s){if(this._bitsets.geohash.has(e))return!0;const r=this._geohashBuf;if(this._spatialReference.isWebMercator){const a=ce(t/se.radius),n=a-360*Math.floor((a+180)/360),o=ce(Math.PI/2-2*Math.atan(Math.exp(-s/se.radius)));Xe(r,e,o,n,ot)}else{const a=Ie({x:t,y:s},this._spatialReference,ie.WGS84);if(!a)return!1;Xe(r,e,a.y,a.x,ot)}return this._bitsets.geohash.set(e),!0}_getClustersForTile(e,t,s,r,a,n=!0){const o=this._schema.params.clusterPixelBuffer,u=2*s,h=Math.ceil(2**t.key.level*N/u)+1,d=Math.ceil(o/u)+0,l=Math.ceil(N/u),{row:c,col:g}=t.key,f=g*N,p=c*N,_=Math.floor(f/u)-d,b=Math.floor(p/u)-d,y=_+l+2*d,S=b+l+2*d,m=t.tileInfoView.getLODInfoAt(t.key.level);for(let I=_;I<=y;I++)for(let v=b;v<=S;v++){let w=I;m.wrap&&(w=I<0?I+h:I%h);const M=m.wrap&&I<0,C=m.wrap&&I%h!==I,F=this._lookupCluster(r,m,t.key.level,w,v,t);if(F!=null){const A=re(a,T=>M?T.left:C?T.right:T.tile);if(n&&A==null||!F.count)continue;if(A!=null&&n){const T=F.geometry.clone();let E=F.attributes;T.coords[0]=hs(A,T.coords[0]),T.coords[1]=us(A,T.coords[1]),F.count===1&&F.referenceId!=null&&(E={...F.attributes,referenceId:F.referenceId});const R=new yt(T,E);R.displayId=F.displayId,e.push(R)}}}}_getGeohashLevel(e){return Math.min(Math.ceil(e/2+2),ot)}_setGeohashLevel(e){const t=this._getGeohashLevel(e),s=(Math.floor(t/Wt)+1)*Wt-1;if(this._geohashLevel!==s)return this._geohashLevel=s,this._rebuildTree(),void this._bitsets.geohash.clear()}_getTransforms(e,t){const s={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},r=cs(t);if(!r)return{tile:s,left:null,right:null};const[a,n]=r.valid;return{tile:s,left:{...s,translate:[n,e.bounds[3]]},right:{...s,translate:[a-n+e.bounds[0],e.bounds[3]]}}}_getClusterId(e,t,s){return(15&e)<<28|(16383&t)<<14|16383&s}_markForDeletion(e,t,s){const r=this._getClusterId(e,t,s);this._clusters.delete(r)}_getClusterBounds(e,t,s){const r=this._schema.params.clusterRadius,a=2*r;let n=s%2?t*a:t*a-r;const o=s*a;let u=n+a;const h=o-a,d=2**e.level*N;e.wrap&&n<0&&(n=0),e.wrap&&u>d&&(u=d);const l=n/N,c=o/N,g=u/N,f=h/N;return[e.getXForColumn(l),e.getYForRow(c),e.getXForColumn(g),e.getYForRow(f)]}_getGeohash(e,t,s){const r={geohashX:0,geohashY:0};return Ne(r,t,e,s),r}_getGeohashBounds(e,t){const s=this._getGeohashLevel(e.key.level);if(this._spatialReference.isWebMercator){const[p,_,b,y]=t,S={x:p,y:_},m={x:b,y};let I=0,v=0,w=0,M=0;{const A=ce(S.x/se.radius);I=A-360*Math.floor((A+180)/360),v=ce(Math.PI/2-2*Math.atan(Math.exp(-S.y/se.radius)))}{const A=ce(m.x/se.radius);w=A-360*Math.floor((A+180)/360),M=ce(Math.PI/2-2*Math.atan(Math.exp(-m.y/se.radius)))}const C={geohashX:0,geohashY:0},F={geohashX:0,geohashY:0};return Ne(C,v,I,s),Ne(F,M,w,s),{bounds:[p,_,b,y],geohashBounds:{xLL:C.geohashX,yLL:C.geohashY,xTR:F.geohashX,yTR:F.geohashY},level:s}}const r=ls.fromExtent(bt.fromBounds(t,this._spatialReference)),a=Ie(r,this._spatialReference,ie.WGS84,{densificationStep:e.resolution*Yi});if(!a)return null;const n=It(new q,a,!1,!1),o=n.coords.filter((p,_)=>!(_%2)),u=n.coords.filter((p,_)=>_%2),h=Math.min(...o),d=Math.min(...u),l=Math.max(...o),c=Math.max(...u),g=this._getGeohash(h,d,s),f=this._getGeohash(l,c,s);return{bounds:t,geohashBounds:{xLL:g.geohashX,yLL:g.geohashY,xTR:f.geohashX,yTR:f.geohashY},level:s}}_lookupCluster(e,t,s,r,a,n){const o=this._getClusterId(s,r,a),u=this._clusters.get(o),h=this._getClusterBounds(t,r,a),d=this._getGeohashBounds(n,h);if(d==null)return null;const l=this._tree.getRegionStatistics(d),{count:c,xTotal:g,yTotal:f,referenceId:p}=l,_=c?g/c:0,b=c?f/c:0;if(c===0)return this._clusters.set(o,null),null;const y={cluster_count:c,...l.attributes},S=u!=null?u.update(_,b,s,y,d,p):Et.create(e,o,_,b,s,y,d,p);if(c===0){const[m,I,v,w]=h;S.geometry.coords[0]=(m+v)/2,S.geometry.coords[1]=(I+w)/2}return this._clusters.set(o,S),this._updateAggregateValueRangeForCluster(S,S.tileLevel),S}_updateAggregateValueRangeForCluster(e,t){const s=this._aggregateValueRanges[t]||{minValue:1/0,maxValue:0},r=s.minValue,a=s.maxValue;s.minValue=Math.min(r,e.count),s.maxValue=Math.max(a,e.count),this._aggregateValueRanges[t]=s,r===s.minValue&&a===s.maxValue||(this._aggregateValueRangesChanged=!0)}_markTileClustersForDeletion(e,t){const s=2*t,r=Math.ceil(N/s),{row:a,col:n}=e.key,o=n*N,u=a*N,h=Math.floor(o/s),d=Math.floor(u/s);for(let l=h;le))for(;i.length<=e;)i.push(t)}let Zi=class{constructor(){this._numerics=[],this._strings=[],this._idGenerator=new Vi,this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[]}createBitset(){const e=this._bitsets.length;return this._bitsets.push(fs.create(this._allocatedSize,$)),e+1}getBitset(e){return this._bitsets[e-1]}_expand(){this._allocatedSize<<=1;for(const e of this._bitsets)e.resize(this._allocatedSize)}_ensureNumeric(e,t){this._numerics[e]||(this._numerics[e]=[]),Pe(this._numerics[e],t,0)}_ensureInstanceId(e){Pe(this._instanceIds,e,0)}_ensureString(e,t){this._strings[e]||(this._strings[e]=[]),Pe(this._strings[e],t,null)}createDisplayId(e=!1){const t=this._idGenerator.createId();return t>this._allocatedSize&&this._expand(),At(t,e)}releaseDisplayId(e){for(const t of this._bitsets)t.unset(e);return this._idGenerator.releaseId(e&$)}getComputedNumeric(e,t){return this.getComputedNumericAtIndex(e&$,0)}setComputedNumeric(e,t,s){return this.setComputedNumericAtIndex(e&$,s,0)}getComputedString(e,t){return this.getComputedStringAtIndex(e&$,0)}setComputedString(e,t,s){return this.setComputedStringAtIndex(e&$,0,s)}getComputedNumericAtIndex(e,t){const s=e&$;return this._ensureNumeric(t,s),this._numerics[t][s]}setComputedNumericAtIndex(e,t,s){const r=e&$;this._ensureNumeric(t,r),this._numerics[t][r]=s}getInstanceId(e){const t=e&$;return this._ensureInstanceId(t),this._instanceIds[t]}setInstanceId(e,t){const s=e&$;this._ensureInstanceId(s),this._instanceIds[s]=t}getComputedStringAtIndex(e,t){const s=e&$;return this._ensureString(t,s),this._strings[t][s]}setComputedStringAtIndex(e,t,s){const r=e&$;this._ensureString(t,r),this._strings[t][r]=s}getXMin(e){return this._bounds[4*(e&$)]}getYMin(e){return this._bounds[4*(e&$)+1]}getXMax(e){return this._bounds[4*(e&$)+2]}getYMax(e){return this._bounds[4*(e&$)+3]}setBounds(e,t){const s=t.readHydratedGeometry();if(!s||!s.coords.length)return!1;let r=1/0,a=1/0,n=-1/0,o=-1/0;s.forEachVertex((h,d)=>{r=Math.min(r,h),a=Math.min(a,d),n=Math.max(n,h),o=Math.max(o,d)});const u=e&$;return Pe(this._bounds,4*u+4,0),this._bounds[4*u]=r,this._bounds[4*u+1]=a,this._bounds[4*u+2]=n,this._bounds[4*u+3]=o,!0}};const Ji=5e3,Wi="tileRenderer.featuresView.attributeView.initialize",Ki="tileRenderer.featuresView.attributeView.requestUpdate",ea="tileRenderer.featuresView.requestRender";function ta(i){return i.name==="worker:port-closed"}function te(i){if(!ye(i)&&!ta(i))throw i}function Kt(i){return i.type==="feature"&&i.mode==="snapshot"}let Q=class extends gs{constructor(){super(...arguments),this._storage=new Zi,this._markedIdsBufId=this._storage.createBitset(),this._lastCleanup=performance.now(),this._cleanupNeeded=!1,this._invalidated=!1,this._tileToResolver=new Map,this._didEdit=!1,this._updateVersion=1,this.tileStore=null,this.config=null,this.processor=null,this.remoteClient=null,this.service=null}initialize(){this._initStores(),this._initSource(),this._updateQueue=new _t({concurrency:this._source.type==="stream"?1:4,process:(i,e)=>this._onTileMessage(i,{signal:e})}),this.addHandles([this.tileStore.on("update",this.onTileUpdate.bind(this)),Js(()=>!this.updating,()=>this.onIdle())])}_initSource(){const i=this.tileStore.tileScheme,e=()=>this._updateQueue&&this._updateQueue.length<50,t=(s,r)=>(this._invalidated=!0,this._patchTile(s,r));this._source=_i(this.service,this.spatialReference,i,t,e,this.featureStore),this._proxyEvents()}_setStreamClientProperty(i,e){this.remoteClient.invoke("setProperty",{propertyName:i,value:e}).catch(te)}_proxyEvents(){if(this._source.type==="stream"){const i=this._source.events,e=this._source;this.addHandles([ct(()=>e.connectionStatus,t=>this._setStreamClientProperty("pipelineConnectionStatus",t),{initial:!0}),ct(()=>e.errorString,t=>this._setStreamClientProperty("pipelineErrorString",t),{initial:!0}),i.on("data-received",t=>this.remoteClient.invoke("emitEvent",{name:"data-received",event:{attributes:t.attributes,centroid:t.centroid,geometry:t.geometry}}).catch(te)),i.on("message-received",t=>this.remoteClient.invoke("emitEvent",{name:"message-received",event:t}).catch(te)),i.on("updateRate",t=>this.remoteClient.invoke("emitEvent",{name:"update-rate",event:{...t}}).catch(te))])}}_initAttributeStore(i){this.attributeStore||(this.attributeStore=new Pi({type:"remote",initialize:(e,t)=>Ge(this.remoteClient.invoke(Wi,e,{signal:t}).catch(te)),update:(e,t)=>Ge(this.remoteClient.invoke(Ki,e,{signal:t}).catch(te)),render:e=>Ge(this.remoteClient.invoke(ea,void 0,{signal:e}).catch(te))},i))}_initStores(){const i=this.service.type==="snapshot"?"snapshot":"on-demand",e={geometryInfo:{geometryType:this.service.geometryType,hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.featureStore=new qr(e,this._storage,i)}_initQueryEngine(i){var t;const e=this;(t=this.featureQueryEngine)==null||t.destroy(),this.featureQueryEngine=new Dt({definitionExpression:i.schema.source.definitionExpression??void 0,fields:this.service.fields,geometryType:this.service.geometryType,objectIdField:this.service.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!0,featureStore:this.featureStore,aggregateAdapter:{getFeatureObjectIds(s){return e.aggregateStore==null?[]:e.aggregateStore.getFeatureDisplayIdsForAggregate(s).map(r=>e.getObjectId(r))}},timeInfo:this.service.timeInfo})}_initAggregateQueryEngine(i,e){var s;if((s=this.aggregateQueryEngine)==null||s.destroy(),i==null)return;const t=e.targets.aggregate.params.fields.slice();this.aggregateQueryEngine=new Dt({definitionExpression:void 0,fields:t,geometryType:i.geometryInfo.geometryType,objectIdField:i.objectIdField,hasM:i.geometryInfo.hasM,hasZ:i.geometryInfo.hasZ,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!1,featureStore:i,aggregateAdapter:{getFeatureObjectIds:r=>[]}})}destroy(){var i,e,t;this._updateQueue.destroy(),this._source.destroy(),(i=this.featureQueryEngine)==null||i.destroy(),(e=this.aggregateQueryEngine)==null||e.destroy(),(t=this.attributeStore)==null||t.destroy();for(const s of this.tileStore.tiles)this._source.unsubscribe(s);clearInterval(this._checkUpdating)}get fieldsIndex(){return new Ee(this.service.fields)}get spatialReference(){return this.tileStore.tileScheme.spatialReference}get updating(){return this.isUpdating()}isUpdating(){const i=this._source.updatingHandles.updating,e=!this.attributeStore||this.attributeStore.updatingHandles.updating,t=i||e||this.updatingHandles.updating;if(x("esri-2d-log-updating")){let s=`Updating FeatureController2D: ${t} +`;s+=` -> updatingSource ${i} +`;for(const r of this._source.subscriptions)s+=` ${r.tile.id} ${r.isDone} +`;s+=` -> updatingAttributeStore ${e} +`,s+=` -> updatingHandles ${this.updatingHandles.updating} (queue: ${this._updateQueue.length}) +`,console.log(s)}return t}updateCustomParameters(i){this._source.type==="stream"&&this._source.updateCustomParameters(i)}enableEvent(i){this._source.enableEvent(i.name,i.value)}pause(){this._updateQueue.pause(),this._updateQueue.clear()}resume(){this._updateQueue.resume()}pauseStream(){this._source.type==="stream"&&this._source.pauseStream()}resumeStream(){this._source.type==="stream"&&this._source.resumeStream()}sendMessageToSocket(i){this._source.type==="stream"&&this._source.sendMessageToSocket(i)}sendMessageToClient(i){this._source.type==="stream"&&this._source.sendMessageToClient(i)}_initAggregateStore(i){var s,r;const e=(r=(s=i.schema.targets)==null?void 0:s.aggregate)==null?void 0:r.type;if(re(this.config,a=>{var n,o;return(o=(n=a.schema.targets)==null?void 0:n.aggregate)==null?void 0:o.type})!==e&&(this.aggregateStore!=null&&(this.removeHandles("valueRangesChanged"),this.aggregateStore.destroy(),this.aggregateStore=null),e)){switch(e){case"cluster":{const a={geometryInfo:{geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.aggregateStore=new Hi(a,this.spatialReference,this._storage,this.service),this.addHandles(this.aggregateStore.events.on("valueRangesChanged",n=>{this.remoteClient.invoke("emitEvent",{name:"valueRangesChanged",event:{valueRanges:n.valueRanges}}).catch(te)}),"valueRangesChanged");break}case"bin":{const a={geometryInfo:{geometryType:"esriGeometryPolygon",hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.aggregateStore=new Qi(a,this.spatialReference,this._storage,this.service);break}}this.aggregateStore.onTileUpdate({added:this.tileStore.tiles,removed:[]})}}async update(i,e){this._updateVersion++,x("esri-2d-update-debug")&&console.debug(`FeatureController2D::update: Token version ${this._updateVersion}`),this._initQueryEngine(e),this._initAttributeStore(e),this.pause(),await Promise.all([this._source.update(i,e.schema.source),this.featureStore.updateSchema(i,e.schema.targets.feature),this.attributeStore.update(i,e),this.attributeStore.updateFilters(i,e,this)]),this._initAggregateStore(e),this.aggregateStore!=null&&await this.aggregateStore.updateSchema(i,e.schema.targets.aggregate),this._initAggregateQueryEngine(this.aggregateStore,e.schema),x("esri-2d-update-debug")&&i.describe(),this._set("config",e)}async applyUpdate(i){i.version=this._updateVersion,x("esri-2d-update-debug")&&console.debug(`FeatureController2D::applyUpdate: Token version ${i.version}`),i.mesh&&this.clearTiles(),this._updateQueue.resume(),await this._source.applyUpdate(i),x("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Waiting for source update to finish"),this.notifyChange("updating"),await qe(()=>!this.updating),x("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Source update finsihed"),this.aggregateStore!=null&&(await os(10),x("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Waiting for aggregate idle call"),await qe(()=>!this.updating),x("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Aggregate idle called")),x("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Update finished")}async onEdits({edits:i}){x("esri-2d-update-debug")&&console.debug("Applying Edit:",i),this._didEdit=!0;try{const e=i.removed.map(s=>s.objectId&&s.objectId!==-1?s.objectId:this._lookupObjectIdByGlobalId(s.globalId)),t=i.addOrModified.map(({objectId:s})=>s);this.featureStore.invalidate(),await this._source.edit(t,e),this.clearTiles(),this.notifyChange("updating"),this.aggregateStore!=null&&this.aggregateStore.clear(),await this._source.resend(),await qe(()=>!this.updating)}catch{}}async refresh(i){if(!i.dataChanged){const e=L.empty();return e.storage.filters=!0,this.applyUpdate(e)}this.featureStore.invalidate(),this.clearTiles(),this._source.refresh(this._updateVersion,i),this._cleanupNeeded=!0,this.notifyChange("updating"),await qe(()=>!this.updating)}clearTiles(){for(const i of this.tileStore.tiles)this.processor.onTileClear(i,!1)}onTileUpdate(i){this.aggregateStore!=null&&this.aggregateStore.onTileUpdate(i);for(const e of i.added)this._source.subscribe(e,this._updateVersion),this._level=e.level;for(const e of i.removed)this._source.unsubscribe(e),this._cleanupNeeded=!0,this._tileToResolver.has(e.id)&&(this._tileToResolver.get(e.id).resolve(),this._tileToResolver.delete(e.id));this.notifyChange("updating")}async onIdle(){this._invalidated&&(this._invalidated=!1,this.aggregateStore==null&&this.processor.type!=="heatmap"||await this._repushCurrentLevelTiles()),this._markAndSweep()}async querySummaryStatistics({query:i,params:e}){return this.featureQueryEngine.executeQueryForSummaryStatistics(i,e)}async queryAggregateSummaryStatistics({query:i,params:e}){return this.aggregateQueryEngine.executeQueryForSummaryStatistics(this._normalizeAggregateQuery(i),e)}async queryUniqueValues({query:i,params:e}){return this.featureQueryEngine.executeQueryForUniqueValues(i,e)}async queryAggregateUniqueValues({query:i,params:e}){return this.aggregateQueryEngine.executeQueryForUniqueValues(this._normalizeAggregateQuery(i),e)}async queryClassBreaks({query:i,params:e}){return this.featureQueryEngine.executeQueryForClassBreaks(i,e)}async queryAggregateClassBreaks({query:i,params:e}){return this.aggregateQueryEngine.executeQueryForClassBreaks(this._normalizeAggregateQuery(i),e)}async queryHistogram({query:i,params:e}){return this.featureQueryEngine.executeQueryForHistogram(i,e)}async queryAggregateHistogram({query:i,params:e}){return this.aggregateQueryEngine.executeQueryForHistogram(this._normalizeAggregateQuery(i),e)}queryExtent(i){return this.featureQueryEngine.executeQueryForExtent(i)}queryAggregates(i){return this.aggregateQueryEngine.executeQuery(this._normalizeAggregateQuery(i))}queryAggregateCount(i){return this.aggregateQueryEngine.executeQueryForCount(this._normalizeAggregateQuery(i))}queryAggregateIds(i){return this.aggregateQueryEngine.executeQueryForIds(this._normalizeAggregateQuery(i))}queryFeatures(i){return this.featureQueryEngine.executeQuery(i)}async queryVisibleFeatures(i){const e=await this.featureQueryEngine.executeQuery(i),t=e.objectIdFieldName;return e.features=e.features.filter(s=>{const r=s.attributes[t],a=this.getDisplayId(r);return re(a,n=>this.attributeStore.isVisible(n))}),e}queryFeatureCount(i){return this.featureQueryEngine.executeQueryForCount(i)}queryLatestObservations(i){return this.featureQueryEngine.executeQueryForLatestObservations(i)}queryObjectIds(i){return this.featureQueryEngine.executeQueryForIds(i)}async queryStatistics(){return this.featureStore.storeStatistics}getObjectId(i){return this.featureStore.lookupObjectId(i,this._storage)}getDisplayId(i){if(this.aggregateStore!=null){const e=this.aggregateStore.getDisplayId(i);if(e==null){const t=this.featureStore.lookupDisplayId(i);return this.aggregateStore.getDisplayIdForReferenceId(t)}return e}return this.featureStore.lookupDisplayId(i)}getFeatures(i){const e=[],t=[];for(const s of i){const r=this.aggregateStore!=null?this.getAggregate(s):null;if(r!=null)if(r.attributes.referenceId!=null){const a=this.getFeature(r.attributes.referenceId);a!=null&&e.push(a)}else t.push(r);else{const a=this.getFeature(s);a!=null&&e.push(a)}}return{features:e,aggregates:t}}getFeature(i){const e=this.featureStore.lookupFeatureByDisplayId(i,this._storage);if(e==null)return null;const t=e.readHydratedGeometry(),s=ke(t,e.geometryType,e.hasZ,e.hasM);return{attributes:e.readAttributes(),geometry:s}}getAggregate(i){return this.aggregateStore==null?null:this.aggregateStore.getAggregate(i)}getAggregates(){return this.aggregateStore==null?[]:this.aggregateStore.getAggregates()}async setHighlight(i){const e=i.map(t=>this.getDisplayId(t)).filter(as);return this.attributeStore.setHighlight(i,e)}_normalizeAggregateQuery(i){const e=i.objectIds??[];for(const t of i.aggregateIds??[])e.push(t);return i.objectIds=e,i.aggregateIds=[],i}_lookupObjectIdByGlobalId(i){const e=this.service.globalIdField;if(e==null)throw new Error("Expected globalIdField to be defined");let t=null;if(this.featureStore.forEach(s=>{i===s.readAttribute(e)&&(t=s.getObjectId())}),t==null)throw new Error(`Expected to find a feature with globalId ${i}`);return t}async _repushCurrentLevelTiles(){const i=this.tileStore.tiles.filter(t=>t.level===this._level);i.map(async t=>this._patchTile({type:"append",id:t.key.id,clear:!0,addOrUpdate:null,end:!1}));const e=i.map(async t=>this._patchTile({type:"append",id:t.key.id,addOrUpdate:P.fromOptimizedFeatures([],this.service),remove:[],end:!0,isRepush:!0,status:L.empty()}));await Promise.all(e)}_maybeForceCleanup(){performance.now()-this._lastCleanup>Ji&&this._markAndSweep()}_patchTile(i,e){const t=this._updateQueue.push(i,e).catch(s=>{});return this.updatingHandles.addPromise(t)}async _onTileMessage(i,e){if(G(e),x("esri-2d-update-debug")){const a=re(i.addOrUpdate,n=>n.hasFeatures);console.debug(i.id,`FeatureController:onTileMessage: [clear:${i.clear}, end:${i.end}, features: ${a}]`)}const t=this.tileStore.get(i.id);if(!t)return;if(i.clear)return this.processor.onTileClear(t,i.end);const s=i.status;this._cleanupNeeded=!0;const r=[];for(const a of i.remove??[]){const n=this.featureStore.lookupDisplayId(a);n&&r.push(n)}i.remove=r;try{if(i.addOrUpdate==null)return void this.processor.onTileMessage(t,{...i,addOrUpdate:null},this.aggregateStore!=null,e).catch(dt);if(i.addOrUpdate.setArcadeSpatialReference(this.spatialReference),this.featureStore.hasInstance(i.addOrUpdate.instance)&&s.targets.feature||(s.targets.feature=!0,this.featureStore.onTileData(t,i)),(!s.storage.data||!s.storage.filters)&&(s.storage.data=!0,s.storage.filters=!0,this.attributeStore.onTileData(t,i),this._source.type==="stream"||this._didEdit?(await this.attributeStore.sendUpdates(),G(e)):this.attributeStore.sendUpdates()),this.aggregateStore!=null&&!s.targets.aggregate){s.targets.aggregate=!0;const a=Kt(this._source)&&this._source.loading,n=!Kt(this._source)||a||i.end;if(this.aggregateStore.onTileData(t,i,this._storage,this.attributeStore,n),!n)return;s.mesh||(this.attributeStore.onTileData(t,i),await this.attributeStore.sendUpdates())}if(!s.mesh){s.mesh=!0;const a=this.aggregateStore!=null&&this.aggregateStore.type==="cluster";await this.processor.onTileMessage(t,i,a,e),G(e)}this._maybeForceCleanup()}catch(a){dt(a)}}_mark(i,e,t){const s=(4294901760&this._storage.getInstanceId(i))>>>16;i&&(e.add(s),t.set(i))}_markAndSweep(){if(this._lastCleanup=performance.now(),!(!(this._source.type==="feature"&&this._source.mode==="snapshot")&&(this._source.type==="stream"||this._cleanupNeeded)))return;this._cleanupNeeded=!1;const i=this._storage.getBitset(this._markedIdsBufId),e=new Set;i.clear();for(const t of this.tileStore.tiles)for(const s of this._source.readers(t.id)){const r=s.getCursor();for(;r.next();){let a=r.getDisplayId();if(!a){const n=r.getObjectId();a=this.featureStore.lookupDisplayId(n)}this._mark(a,e,i)}}this.processor.type==="symbol"&&this.processor.forEachBufferId(t=>{this._mark(t,e,i)}),this._updateQueue.forEach(t=>{for(const s of t.remove??[]){const r=this.featureStore.lookupDisplayId(s);this._mark(r,e,i)}}),this.aggregateStore!=null&&(this.aggregateStore.sweepFeatures(i,this.featureStore),"sweepAggregates"in this.aggregateStore&&this.aggregateStore.sweepAggregates(this._storage,this.attributeStore,this._level)),this.featureStore.sweepFeatures(i,this._storage,this.attributeStore),this.featureStore.sweepFeatureSets(e)}};k([O({constructOnly:!0})],Q.prototype,"tileStore",void 0),k([O()],Q.prototype,"config",void 0),k([O({readOnly:!0})],Q.prototype,"fieldsIndex",null),k([O()],Q.prototype,"processor",void 0),k([O({constructOnly:!0})],Q.prototype,"remoteClient",void 0),k([O({constructOnly:!0})],Q.prototype,"service",void 0),k([O()],Q.prototype,"spatialReference",null),k([O()],Q.prototype,"updating",null),Q=k([Ve("esri.views.2d.layers.features.controllers.FeatureController2D")],Q);const sa=Q;let es=class xs{constructor(e,t){this.key=new ps(0,0,0,0),this.bounds=Ws(),this.objectIds=new Set,this.key.set(t);const s=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.scale=s.scale,this.level=s.level}get id(){return this.key.id}get extent(){return bt.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createChildTiles(){const e=this.key.getChildKeys(),t=Ks.acquire();for(let s=0;s({minX:t.bounds[0],minY:t.bounds[1],maxX:t.bounds[2],maxY:t.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=e}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(e){return this._tiles.has(e)}get(e){return this._tiles.get(e)}boundsIntersections(e){return this._index.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]})}updateTiles(e){const t={added:[],removed:[]};for(const s of e.added)if(!this.has(s)){const r=new es(this.tileScheme,s);this._tiles.set(s,r),this._index.insert(r),t.added.push(r)}for(const s of e.removed)if(this.has(s)){const r=this.get(s);this._tiles.delete(s),this._index.remove(r),t.removed.push(r)}this.tiles.length=0,this._tiles.forEach(s=>this.tiles.push(s)),(t.added.length||t.removed.length)&&this.emit("update",t)}setViewState(e){const t=this.tileScheme.getTileCoverage(e,0);if(!t)return;const{spans:s,lodInfo:r}=t,{level:a}=r;if(s.length>0)for(const{row:n,colFrom:o,colTo:u}of s)for(let h=o;h<=u;h++){const d=ra.set(a,n,r.normalizeCol(h),r.getWorldForColumn(h)).id;if(ht.add(d),!this.has(d)){const l=new es(this.tileScheme,d);this._tiles.set(d,l),this._index.insert(l),this.tiles.push(l),he.added.push(l)}}for(let n=this.tiles.length-1;n>=0;n--){const o=this.tiles[n];ht.has(o.id)||(this._tiles.delete(o.id),this.tiles.splice(n,1),this._index.remove(o),he.removed.push(o))}(he.added.length||he.removed.length)&&this.emit("update",he),Ir.pool.release(t),ht.clear(),he.added.length=0,he.removed.length=0}},ue=class extends gs{constructor(){super(...arguments),this.controller=null,this.processor=null,this.remoteClient=null,this.tileStore=null,this.service=null,this.viewState=null,this._paused=!1,this._pendingTileUpdates=[]}initialize(){this.handles.add(ct(()=>this.updating,i=>{this.remoteClient.invoke("setUpdating",i).catch(e=>{})}))}destroy(){var i,e;this.stop(),(i=this.controller)==null||i.destroy(),(e=this.processor)==null||e.destroy(),this.controller=this.processor=this.tileStore=this.remoteClient=null}get updating(){return!this.controller||this.controller.updating}stop(){var i,e,t;this._paused=!0,Array.isArray((i=this.service)==null?void 0:i.source)&&(this.service.source.forEach(s=>s.close()),this.service.source.length=0),(e=this.tileStore)==null||e.updateTiles({added:[],removed:this.tileStore.tiles.map(s=>s.id)}),(t=this.tileStore)==null||t.destroy(),this.tileStore=null,this._pendingTileUpdates.length=0}async startup({service:i,config:e,tileInfo:t,tiles:s}){var r,a,n;if(this._paused=!0,Array.isArray((r=this.service)==null?void 0:r.source)&&(this.service.source.forEach(o=>o.close()),this.service.source.length=0),this.service=i,!this.tileStore||!er(this.tileStore.tileScheme.spatialReference,t.spatialReference)){const o=new br(tr.fromJSON(t));s.added.length=s.removed.length=0,(a=this.tileStore)==null||a.updateTiles({added:[],removed:this.tileStore.tiles.map(u=>u.id)}),(n=this.tileStore)==null||n.destroy(),this.tileStore=new ia(o),this._pendingTileUpdates.length=0}for(await this._createProcessorAndController(e),await this.update({config:e}),this.controller.resume(),this.tileStore.clear(),this.tileStore.updateTiles(s),this._paused=!1;this._pendingTileUpdates.length;)this.tileStore.updateTiles(this._pendingTileUpdates.pop())}async updateTiles(i){var e;this._paused?this._pendingTileUpdates.push(i):(e=this.tileStore)==null||e.updateTiles(i)}async update({config:i}){const e=L.empty();return await Promise.all([this.processor.update(e,i),this.controller.update(e,i)]),e.toJSON()}async applyUpdate(i){return this.controller.applyUpdate(L.create(i))}async _createProcessorAndController(i){await Promise.all([this._handleControllerConfig(i),this._handleProcessorConfig(i)]),this.controller.processor=this.processor}async _handleControllerConfig(i){return this._createController(this.service,i)}async _handleProcessorConfig(i){return this._createProcessor(this.service,i)}async _createController(i,e){this.controller&&this.controller.destroy();const{tileStore:t,remoteClient:s}=this,r=new sa({service:i,tileStore:t,remoteClient:s});return this.controller=r,r}async _createProcessor(i,e){const t=e.schema.processors[0].type,s=(await vr(t)).default,{remoteClient:r,tileStore:a}=this,n=new s({service:i,config:e,tileStore:a,remoteClient:r});return this.processor&&this.processor.destroy(),this.processor=n,n}};k([O()],ue.prototype,"controller",void 0),k([O()],ue.prototype,"processor",void 0),k([O()],ue.prototype,"updating",null),k([O()],ue.prototype,"viewState",void 0),ue=k([Ve("esri.views.2d.layers.features.Pipeline")],ue);const aa=ue,Ka=Object.freeze(Object.defineProperty({__proto__:null,default:aa},Symbol.toStringTag,{value:"Module"}));export{Ya as G,wt as I,Ka as P,ja as R,fe as f,Qa as k,Na as p,_t as u}; diff --git a/assets/PointCloudLayer-b4103b13.js b/assets/PointCloudLayer-b4103b13.js new file mode 100644 index 0000000..2a4a4b5 --- /dev/null +++ b/assets/PointCloudLayer-b4103b13.js @@ -0,0 +1,11 @@ +import{ai as r,aj as o,al as y,ck as q,eZ as S,d2 as v,cl as u,eS as B,cq as b,cO as N,as as E,lX as C,ar as l,c5 as _,at as V,bz as T,cC as A,ay as L,bY as O,aA as K}from"./index-080e108a.js";import{O as k}from"./MultiOriginJSONSupport-e4912ffd.js";import{i as D}from"./APIKeyMixin-878a7aa7.js";import{l as G}from"./ArcGISService-83287338.js";import{c as M}from"./OperationalLayer-0e8f8b28.js";import{j as z}from"./PortalLayer-310c2800.js";import{N as U,K as F}from"./SceneService-6fea113d.js";import{p as X,d as Y,c as Z}from"./commonProperties-30089b06.js";import{s as H}from"./fieldProperties-62c55499.js";import{c as j,d as J,b as Q,a as W}from"./PointCloudUniqueValueRenderer-df78a172.js";import{p as ee}from"./popupUtils-82ea8abb.js";import"./portalItemUtils-792a27e1.js";import"./originUtils-1469eeaf.js";import"./multiOriginJSONSupportUtils-c978f4c3.js";import"./I3SIndexInfo-445e6968.js";import"./resourceUtils-b667b05b.js";import"./FieldsIndex-f79a8f26.js";let f=class extends q{constructor(e){super(e),this.field=null,this.type=null}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}};r([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"field",void 0),r([o({readOnly:!0,nonNullable:!0,json:{read:!1}})],f.prototype,"type",void 0),f=r([y("esri.layers.pointCloudFilters.PointCloudFilter")],f);const g=f;var w;let d=w=class extends g{constructor(e){super(e),this.requiredClearBits=null,this.requiredSetBits=null,this.type="bitfield"}clone(){return new w({field:this.field,requiredClearBits:u(this.requiredClearBits),requiredSetBits:u(this.requiredSetBits)})}};r([o({type:[S],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredSetBits}}}}})],d.prototype,"requiredClearBits",void 0),r([o({type:[S],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredClearBits}}}}})],d.prototype,"requiredSetBits",void 0),r([v({pointCloudBitfieldFilter:"bitfield"})],d.prototype,"type",void 0),d=w=r([y("esri.layers.pointCloudFilters.PointCloudBitfieldFilter")],d);const te=d;var I;let h=I=class extends g{constructor(e){super(e),this.includedReturns=[],this.type="return"}clone(){return new I({field:this.field,includedReturns:u(this.includedReturns)})}};r([o({type:[["firstOfMany","last","lastOfMany","single"]],json:{write:{enabled:!0,isRequired:!0}}})],h.prototype,"includedReturns",void 0),r([v({pointCloudReturnFilter:"return"})],h.prototype,"type",void 0),h=I=r([y("esri.layers.pointCloudFilters.PointCloudReturnFilter")],h);const re=h;var $;let p=$=class extends g{constructor(e){super(e),this.mode="exclude",this.type="value",this.values=[]}clone(){return new $({field:this.field,mode:this.mode,values:u(this.values)})}};r([o({type:["exclude","include"],json:{write:{enabled:!0,isRequired:!0}}})],p.prototype,"mode",void 0),r([v({pointCloudValueFilter:"value"})],p.prototype,"type",void 0),r([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],p.prototype,"values",void 0),p=$=r([y("esri.layers.pointCloudFilters.PointCloudValueFilter")],p);const oe=p,ie={key:"type",base:g,typeMap:{value:oe,bitfield:te,return:re}};var x;let m=x=class extends j{constructor(e){super(e),this.type="point-cloud-rgb",this.field=null}clone(){return new x({...this.cloneProperties(),field:u(this.field)})}};r([v({pointCloudRGBRenderer:"point-cloud-rgb"})],m.prototype,"type",void 0),r([o({type:String,json:{write:!0}})],m.prototype,"field",void 0),m=x=r([y("esri.renderers.PointCloudRGBRenderer")],m);const se=m,P={key:"type",base:j,typeMap:{"point-cloud-class-breaks":J,"point-cloud-rgb":se,"point-cloud-stretch":Q,"point-cloud-unique-value":W},errorContext:"renderer"},R=H();let i=class extends U(G(M(z(B(k(D(K))))))){constructor(...e){super(...e),this.operationalLayerType="PointCloudLayer",this.popupEnabled=!0,this.popupTemplate=null,this.opacity=1,this.filters=[],this.fields=null,this.fieldsIndex=null,this.outFields=null,this.path=null,this.legendEnabled=!0,this.renderer=null,this.type="point-cloud"}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}get defaultPopupTemplate(){return this.attributeStorageInfo?this.createPopupTemplate():null}getFieldDomain(e){const t=this.fieldsIndex.get(e);return t&&t.domain?t.domain:null}readServiceFields(e,t,n){return Array.isArray(e)?e.map(s=>{const a=new b;return s.type==="FieldTypeInteger"&&((s=u(s)).type="esriFieldTypeInteger"),a.read(s,n),a}):Array.isArray(t.attributeStorageInfo)?t.attributeStorageInfo.map(s=>new b({name:s.name,type:s.name==="ELEVATION"?"double":"integer"})):null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}writeRenderer(e,t,n,s){N("layerDefinition.drawingInfo.renderer",e.write({},s),t)}load(e){const t=e!=null?e.signal:null,n=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(E).then(()=>this._fetchService(t));return this.addResolvingPromise(n),Promise.resolve(this)}createPopupTemplate(e){const t=ee(this,e);return t&&(this._formatPopupTemplateReturnsField(t),this._formatPopupTemplateRGBField(t)),t}_formatPopupTemplateReturnsField(e){var a;const t=this.fieldsIndex.get("RETURNS");if(!t)return;const n=(a=e.fieldInfos)==null?void 0:a.find(c=>c.fieldName===t.name);if(!n)return;const s=new C({name:"pcl-returns-decoded",title:t.alias||t.name,expression:` + var returnValue = $feature.${t.name}; + return (returnValue % 16) + " / " + Floor(returnValue / 16); + `});e.expressionInfos=[...e.expressionInfos||[],s],n.fieldName="expression/pcl-returns-decoded"}_formatPopupTemplateRGBField(e){var a;const t=this.fieldsIndex.get("RGB");if(!t)return;const n=(a=e.fieldInfos)==null?void 0:a.find(c=>c.fieldName===t.name);if(!n)return;const s=new C({name:"pcl-rgb-decoded",title:t.alias||t.name,expression:` + var rgb = $feature.${t.name}; + var red = Floor(rgb / 65536, 0); + var green = Floor((rgb - (red * 65536)) / 256,0); + var blue = rgb - (red * 65536) - (green * 256); + + return "rgb(" + red + "," + green + "," + blue + ")"; + `});e.expressionInfos=[...e.expressionInfos||[],s],n.fieldName="expression/pcl-rgb-decoded"}async queryCachedStatistics(e,t){if(await this.load(t),!this.attributeStorageInfo)throw new l("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const n=this.fieldsIndex.get(e);if(!n)throw new l("pointcloudlayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const s of this.attributeStorageInfo)if(s.name===n.name){const a=_(this.parsedUrl.path,`./statistics/${s.key}`);return V(a,{query:{f:"json",token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then(c=>c.data)}throw new l("pointcloudlayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(F.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"};return this._debouncedSaveOperations(F.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="PointCloud")throw new l("pointcloudlayer:layer-type-not-supported","PointCloudLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new l("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"});if(this.version.major>2)throw new l("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"})}hasCachedStatistics(e){return this.attributeStorageInfo!=null&&this.attributeStorageInfo.some(t=>t.name===e)}_getTypeKeywords(){return["PointCloud"]}_validateElevationInfo(){const e=this.elevationInfo;e&&(e.mode!=="absolute-height"&&T.getLogger(this).warn(".elevationInfo=","Point cloud layers only support absolute-height elevation mode"),e.featureExpressionInfo&&e.featureExpressionInfo.expression!=="0"&&T.getLogger(this).warn(".elevationInfo=","Point cloud layers do not support featureExpressionInfo"))}};r([o({type:["PointCloudLayer"]})],i.prototype,"operationalLayerType",void 0),r([o(X)],i.prototype,"popupEnabled",void 0),r([o({type:A,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),r([o({readOnly:!0,json:{read:!1}})],i.prototype,"defaultPopupTemplate",null),r([o({readOnly:!0,json:{write:!1,read:!1,origins:{"web-document":{write:!1,read:!1}}}})],i.prototype,"opacity",void 0),r([o({type:["show","hide"]})],i.prototype,"listMode",void 0),r([o({types:[ie],json:{origins:{service:{read:{source:"filters"}}},name:"layerDefinition.filters",write:!0}})],i.prototype,"filters",void 0),r([o({type:[b]})],i.prototype,"fields",void 0),r([o(R.fieldsIndex)],i.prototype,"fieldsIndex",void 0),r([L("service","fields",["fields","attributeStorageInfo"])],i.prototype,"readServiceFields",null),r([o(R.outFields)],i.prototype,"outFields",void 0),r([o({readOnly:!0})],i.prototype,"attributeStorageInfo",void 0),r([o(Y)],i.prototype,"elevationInfo",null),r([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],i.prototype,"path",void 0),r([o(Z)],i.prototype,"legendEnabled",void 0),r([o({types:P,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:{target:{"layerDefinition.drawingInfo.renderer":{types:P},"layerDefinition.drawingInfo.transparency":{type:Number}}}}})],i.prototype,"renderer",void 0),r([O("renderer")],i.prototype,"writeRenderer",null),r([o({json:{read:!1},readOnly:!0})],i.prototype,"type",void 0),i=r([y("esri.layers.PointCloudLayer")],i);const xe=i;export{xe as default}; diff --git a/assets/PointCloudLayerView3D-35572558.js b/assets/PointCloudLayerView3D-35572558.js new file mode 100644 index 0000000..0246d96 --- /dev/null +++ b/assets/PointCloudLayerView3D-35572558.js @@ -0,0 +1,56 @@ +import{iR as Xe,mF as R,mG as Ze,dw as Q,mH as De,mI as qe,mJ as et,mK as tt,mL as it,ai as g,aj as x,al as We,aK as st,aS as nt,mM as rt,br as ot,mN as at,mO as le,mP as lt,ia as dt,hH as P,ie as ht,a_ as B,mQ as ut,mR as ct,hw as pt,mS as _t,mT as pe,m1 as Z,mU as gt,mV as _e,dS as ge,mW as k,mX as ft,mY as mt,id as N,mZ as bt,m_ as St,fu as yt,dT as V,mz as xt,im as Pt,aw as vt,is as wt,it as zt,iu as He,iv as Nt,hL as $t,iz as Ct,iB as Rt,iC as At,iE as It,iq as M,iG as Ft,m$ as fe,n0 as me,hJ as Ot,bN as Mt,n1 as Qe,j1 as be,n2 as Lt,gu as Et,n3 as kt,n4 as Vt,n5 as Se,n6 as Te,n7 as Dt,n8 as qt,n9 as Wt,na as Ht,hW as U,nb as Qt,hX as Tt,lL as ee,nc as Ut,jk as Bt,nd as ye,ne as Gt,nf as xe,ng as Pe,nh as jt,ni as Jt,dL as ve,nj as Yt,cL as Kt,dv as Xt,gD as Zt,nk as we,ag as y,aG as ei,aH as ti,dW as ii,ah as ze,aO as si,hI as ni,gc as ri,nl as oi,nm as ai,b7 as li,nn as di,no as hi,dZ as Ne,fp as ui,aF as ci,np as pi,nq as _i,bn as gi,bz as te,fw as fi,ax as $e,fs as mi,nr as bi,i3 as Ce,eF as Si,aL as yi,dz as xi,bF as Pi,g7 as vi,lA as wi}from"./index-080e108a.js";import{n as zi}from"./LayerView3D-ffd35809.js";import{C as Ni,v as $i,M as Ci}from"./I3SUtil-2c288808.js";import{c as Ri,u as Ai,a as Ii}from"./PointCloudWorkerUtil-ec4f2005.js";import{i as Fi}from"./PopupSceneLayerView-c49dd096.js";import{d as Oi}from"./LayerView-448bc5ea.js";let Mi=class extends Xe{constructor(e){super("PointCloudWorker","transform",{transform:i=>this._getTransferList(i)},e)}_getTransferList(e){const i=[e.geometryBuffer];if(e.primaryAttributeData!=null&&e.primaryAttributeData.buffer&&i.push(e.primaryAttributeData.buffer),e.modulationAttributeData!=null&&e.modulationAttributeData.buffer&&i.push(e.modulationAttributeData.buffer),e.filterAttributesData!=null)for(const s of e.filterAttributesData)s!=null&&s.buffer&&i.push(s.buffer);for(const s of e.userAttributesData)s.buffer&&i.push(s.buffer);return i}};function Li(t,e,i){for(let n=0;n=0&&(se[n]=!0,$[r]!=null?$[r].push(e[n]):$[r]=[e[n]])}for(let n=0;n=0&&(ie[n]=!0,C[r]!=null?C[r].push(t[n]):C[r]=[t[n]])}const s=[];for(let n=0;n1||C[n][0]!==e[n])&&s.push({load:[e[n]],remove:C[n]});for(let n=0;n1||$[n][0]!==t[n])&&s.push({load:$[n],remove:[t[n]]});return s}const ie=[!1],$=[null],se=[!1],C=[null];function Re(t,e,i){let s=t;for(;s>0;){const n=e.indexOf(s);if(n>=0)return n;s=i.getParentId(s)}return e.indexOf(s)}function Ei(t,e,i){return t.sort((s,n)=>{if(s.load.length===0&&n.load.length===0)return 0;if(s.load.length===0)return-1;if(n.load.length===0)return 1;if(s.remove.length===0&&n.remove.length===0){const r=i.getRenderCenter(s.load[0]),o=i.getRenderCenter(n.load[0]);return R(r,e)-R(o,e)}if(s.remove.length===0)return-1;if(n.remove.length===0)return 1;if(s.load.length===1&&n.load.length===1){const r=i.getRenderCenter(s.load[0]),o=i.getRenderCenter(n.load[0]);return R(r,e)-R(o,e)}if(s.load.length===1)return-1;if(n.load.length===1)return 1;{const r=i.getRenderCenter(s.remove[0]),o=i.getRenderCenter(n.remove[0]);return R(r,e)-R(o,e)}})}function ki(t,e,i){for(let s=0;se&&n.remove.length===1&&Vi(t,n,i)}}function Vi(t,e,i){const s=[e.remove[0]],n=[];for(;s.length===1;){const r=s.pop();n.length=0;for(let o=0;o1?t.push({remove:[s[r]],load:n[r]}):s[r]=n[r][0]}let Di=class{constructor(e,i,s){this._pages=[],this.pageSize=0,this._nodeSR=null,this._renderSR=null,this._nodeSR=e,this._renderSR=i,this.pageSize=s}addPage(e,i,s=0){for(;this._pages.lengthqi(e,i,s)}};function qi(t,e,i){const s=t.index;if(!s.hasNodes(0,1))return;const n=t.queue;n.length=0,n.push(0);const r=t.masks;for(r.length=0,r.push(0);n.length>0;){const o=n.pop();let a=r.pop();const l=s.getNode(o),d=s.getRenderObb(o);let c=!0;if(e.clippingBox!=null){const p=1<0?c=!1:u<0&&(a|=_)}}if(i.predicate(o,l,c)){const p=l.firstChild,_=l.childCount;let u=!1;const f=v(p,s.pageSize),A=v(p+_-1,s.pageSize);for(let m=f;m<=A;m++)if(!s.hasPage(m)){i.pageMiss(o,m),u=!0;break}if(!u)for(let m=0;m<_;m++)n.push(p+m),r.push(a)}}}function Wi(t,e,i,s){const n=new it(t.length);for(let r=0;r({filterJSON:i.toJSON(),attributeInfo:T(t.attributeStorageInfo,i.field)})):[]}function Qi(t){const e=t==null?void 0:t.pointSizeAlgorithm;return e&&e.type==="splat"?e:null}function Fe(t){const e=t==null?void 0:t.pointSizeAlgorithm;return e&&e.type==="fixed-size"?e:null}function Ti(t){const e=t==null?void 0:t.pointSizeAlgorithm;return!(!e||!e.type)&&e.type==="fixed-size"}function Oe(t,e){for(const i of t??[])if(i.name===e&&i.attributeValues!=null&&i.attributeValues.valueType==="UInt8"&&i.attributeValues.valuesPerElement===3)return{name:e,storageInfo:i,useElevation:!1};return null}function T(t,e){for(const i of t??[])if(i.name===e){const s=i.encoding==="embedded-elevation";return s?{name:e,storageInfo:null,useElevation:s}:{name:e,storageInfo:i,useElevation:s}}return(e==null?void 0:e.toLowerCase())==="elevation"?{name:e,storageInfo:null,useElevation:!0}:null}let H=class extends st{constructor(t){super(t),this.pointCloudMetadata=null}};g([x({constructOnly:!0,clonable:"reference"})],H.prototype,"pointCloudMetadata",void 0),H=g([We("esri.views.3d.layers.i3s.PointGraphic")],H);class Ui{constructor(e){this._context=e,this._highlights=new Set}get hasHighlights(){return this._highlights.size>0}destroy(){this._highlights=null}add(e){const i=new Bi(e);return this._highlights.add(i),this._enableSet(i),nt(()=>this._removeSet(i))}_removeSet(e){this._disableSet(e),this._highlights.delete(e)}_enableSet(e){e.enabled||(e.enabled=!0,this._context.forEachNode(i=>this._enableSetForNode(e,i)))}_enableSetForNode(e,i){if(!e.enabled)return;const s=e.ids.get(i.id);s&&s.forEach(n=>this._context.addHighlight(i,n,e.id))}_disableSet(e){e.enabled&&(e.enabled=!1,this._context.forEachNode(i=>this._disableSetForNode(e,i)))}_disableSetForNode(e,i){e.enabled||this._context.removeHighlight(i,e.id)}nodeAdded(e){this._highlights.forEach(i=>this._enableSetForNode(i,e))}nodeRemoved(e){this._highlights.forEach(i=>this._disableSetForNode(i,e))}removeAll(){this._highlights.forEach(e=>this._disableSet(e))}}class Bi{constructor(e){this.id=new rt(ot.Highlight),this.ids=new Map,this.enabled=!1;for(const i of e)i!=null&&this._add(i.nodeId,i.pointId)}_add(e,i){const s=this.ids.get(e);s?s.add(i):this.ids.set(e,new Set([i]))}}class Ue extends at{constructor(){super(...arguments),this.clipBox=Q(le),this.useFixedSizes=!1,this.useRealWorldSymbolSizes=!1,this.scaleFactor=1,this.minSizePx=0,this.size=0,this.sizePx=0}get fixedSize(){return this.drawScreenSpace?this.sizePx:this.size}get screenMinSize(){return this.useFixedSizes?0:this.minSizePx}get drawScreenSpace(){return this.useFixedSizes&&!this.useRealWorldSymbolSizes}}class Be extends lt{constructor(e,i,s){super(e),this.origin=e,this.isLeaf=i,this.splatSize=s}}function Gi(t){const e=new dt,i=t.output===P.Color,s=t.output===P.Depth,n=t.output===P.Highlight,{vertex:r,fragment:o}=e;return e.include(ht,t),e.attributes.add(B.POSITION,"vec3"),e.attributes.add(B.COLOR,"vec3"),r.uniforms.add(new ut("modelView",(a,l)=>ct(Me,l.camera.viewMatrix,pt(Me,a.origin))),new _t("proj",(a,l)=>l.camera.projectionMatrix),new pe("screenMinMaxSize",(a,l,d)=>Z(ne,d.useFixedSizes?0:d.minSizePx*l.camera.pixelRatio,he(a.isLeaf)*l.camera.pixelRatio)),t.useFixedSizes?new gt("pointScale",(a,l)=>Z(ne,a.fixedSize*l.camera.pixelRatio,l.camera.fullHeight)):new pe("pointScale",(a,l,d)=>Z(ne,a.splatSize*d.scaleFactor*l.camera.pixelRatio,l.camera.fullHeight/l.camera.pixelRatio))),t.clippingEnabled?r.uniforms.add(new _e("clipMin",(a,l,d)=>ge(Le,d.clipBox[0]-a.origin[0],d.clipBox[1]-a.origin[1],d.clipBox[2]-a.origin[2])),new _e("clipMax",(a,l,d)=>ge(Le,d.clipBox[3]-a.origin[0],d.clipBox[4]-a.origin[1],d.clipBox[5]-a.origin[2]))):(r.constants.add("clipMin","vec3",[-k,-k,-k]),r.constants.add("clipMax","vec3",[k,k,k])),s?(ft(e),mt(e),e.varyings.add("depth","float")):t.output!==P.Highlight&&e.varyings.add("vColor","vec3"),r.code.add(N` + void main(void) { + // Move clipped points outside of clipspace + if (position.x < clipMin.x || position.y < clipMin.y || position.z < clipMin.z || + position.x > clipMax.x || position.y > clipMax.y || position.z > clipMax.z) { + gl_Position = vec4(0.0,0.0,0.0,2.0); + gl_PointSize = 0.0; + return; + } + + if (rejectBySlice(position)) { + gl_Position = vec4(0.0,0.0,0.0,2.0); + gl_PointSize = 0.0; + return; + } + + // Position in camera space + vec4 camera = modelView * vec4(position, 1.0); + + float pointSize = pointScale.x; + vec4 position = proj * camera; + ${t.drawScreenSize?N` + float clampedScreenSize = pointSize;`:N` + float pointRadius = 0.5 * pointSize; + vec4 cameraOffset = camera + vec4(0.0, pointRadius, 0.0, 0.0); + vec4 positionOffset = proj * cameraOffset; + float radius = abs(positionOffset.y - position.y); + float viewHeight = pointScale.y; + // screen diameter = (2 * r / w) * (h / 2) + float screenPointSize = (radius / position.w) * viewHeight; + float clampedScreenSize = clamp(screenPointSize, screenMinMaxSize.x, screenMinMaxSize.y); + // Shift towards camera, to move rendered point out of terrain i.e. to + // the camera-facing end of the virtual point when considering it as a + // 3D sphere. + camera.xyz -= normalize(camera.xyz) * pointRadius * clampedScreenSize / screenPointSize; + position = proj * camera;`} + + gl_PointSize = clampedScreenSize; + gl_Position = position; + + ${s?N`depth = calculateLinearDepth(nearFar, camera.z);`:""} + ${i?N`vColor = color;`:""} + } + `),o.include(bt,t),n&&e.include(St,t),o.code.add(N` + void main(void) { + vec2 vOffset = gl_PointCoord - vec2(0.5, 0.5); + float r2 = dot(vOffset, vOffset); + + if (r2 > 0.25) { + discard; + } + ${s?N`fragColor = float2rgba(depth);`:""} + ${n?N`outputHighlight();`:""} + ${i?N`fragColor = vec4(vColor, 1.0);`:""} + } + `),e}function he(t){return t?256:64}const Me=yt(),Le=V(),ne=xt(),ji=Object.freeze(Object.defineProperty({__proto__:null,PointRendererDrawParameters:Be,PointRendererPassParameters:Ue,build:Gi,getMaxPointSizeScreenspace:he},Symbol.toStringTag,{value:"Module"}));class G extends wt{constructor(e,i,s){super(e,i,s)}initializeProgram(e){return new zt(e.rctx,G.shader.get().build(this.configuration),He)}initializePipeline(){return Nt({depthTest:{func:$t.LESS},depthWrite:Ct,colorWrite:Rt,stencilWrite:this.configuration.hasOccludees?At:null,stencilTest:this.configuration.hasOccludees?It:null})}}G.shader=new Pt(ji,()=>vt(()=>import("./PointRenderer.glsl-e83bfa82.js"),["assets/PointRenderer.glsl-e83bfa82.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/LayerView3D-ffd35809.js","assets/I3SUtil-2c288808.js","assets/Query-1c961d4c.js","assets/I3SBinaryReader-2b8e30f7.js","assets/PointCloudWorkerUtil-ec4f2005.js","assets/PointCloudUniqueValueRenderer-df78a172.js","assets/PopupSceneLayerView-c49dd096.js","assets/popupUtils-f04ec9a9.js","assets/LayerView-448bc5ea.js"]));class F extends Ft{constructor(){super(...arguments),this.output=P.Color,this.hasSlicePlane=!1,this.drawScreenSize=!1,this.useFixedSizes=!1,this.hasOccludees=!1,this.clippingEnabled=!1}}g([M({count:P.COUNT})],F.prototype,"output",void 0),g([M()],F.prototype,"hasSlicePlane",void 0),g([M()],F.prototype,"drawScreenSize",void 0),g([M()],F.prototype,"useFixedSizes",void 0),g([M()],F.prototype,"hasOccludees",void 0),g([M()],F.prototype,"clippingEnabled",void 0),g([M({constValue:!0})],F.prototype,"hasSliceInVertexProgram",void 0);const Ji={positions:[new fe(B.POSITION,3,me.FLOAT,0,12)],colors:[new fe(B.COLOR,3,me.UNSIGNED_BYTE,0,3,!0)]};class Yi{get needsHighlight(){return this._highlights.hasHighlights}constructor(e){this._params=e,this.type=Ot.PCL,this.isGround=!1,this._passParameters=new Ue,this._highlights=new Ui({forEachNode:i=>this.forEachNode(i),addHighlight:(i,s,n)=>this._addHighlight(i,s,n),removeHighlight:(i,s)=>this._removeHighlight(i,s)}),this.canRender=!0,this.layerUid="",this._slicePlaneEnabled=!1,this._techniqueConfig=new F,this._nodes=new Mt}initializeRenderContext(e){this._context=e,this._techniqueRepository=this._context.techniqueRepository,e.requestRender()}uninitializeRenderContext(){}intersect(e,i,s,n){const r=V(),o=V(),a=V(),l=V(),d=Qe(),c=e.camera.perScreenPixelRatio/2,p=e.camera.near;be(o,n,s);const _=1/Lt(o);Et(o,o,_),kt(a,o),Vt(d,o[0],o[1],o[2],-R(o,s));const u=new oe,f=new oe,A=new Array,m=Q(),L=Q(this._passParameters.clipBox);Se(L,-s[0],-s[1],-s[2],L),this._nodes.forAll(h=>{const b=h.splatSize*this._passParameters.scaleFactor;let w=Te(h.obb,d),I=Dt(h.obb,d);w-=re(b,w+p,this._passParameters,c,h.isLeaf),I-=re(b,I+p,this._passParameters,c,h.isLeaf);const Ge=I<0,je=u.dist!=null&&f.dist!=null&&u.distI*_;if(Ge||je)return;const J=de(b,I+p,this._passParameters,c,h.isLeaf);if(!qt(h.obb,s,o,J))return;const Je=J*J;De(h.obb,m),Se(m,-s[0],-s[1],-s[2],m);const Ye=!qe(L,m);be(l,h.origin,s);const Ke=h.coordinates.length/3;for(let O=0;OJe)continue;let Y=W+p;const K=re(b,Y,this._passParameters,c,h.isLeaf);if(W-K<0)continue;Y-=K;const ce=de(b,Y,this._passParameters,c,h.isLeaf);if(ue>ce*ce)continue;const E=(W-K)*_,X=z=>(z.point=Zi(h,O,z.point),z.dist=E,z.normal=a,z.node=h,z.pointId=O,z.layerUid=this.layerUid,z);if((u.dist==null||Ef.dist)&&(i==null||i(s,n,E))&&X(f),e.options.store===U.ALL&&(i==null||i(s,n,E))){const z=new oe;A.push(X(z))}}});const j=h=>{const{layerUid:b,node:w,pointId:I}=h;return new jt(h.point,b,I,()=>this._params.createGraphic(w,I,h.point))},q=(h,b)=>{const w=j(b);h.set(this.type,w,b.dist,b.normal)};if(ke(u)){const h=e.results.min;(h.dist==null||u.disth.dist)&&q(h,f)}if(e.options.store===U.ALL){const h=Qt(s,n);for(const b of A){const w=Tt(h);q(w,b),e.results.all.push(w)}}}prepareTechnique(e){return this._nodes.length===0||e.output!==P.Color&&e.output!==P.Depth&&e.output!==P.Highlight?null:(this._nodes.forAll(i=>{i.vao==null&&this._initNode(e,i)}),this._techniqueConfig.drawScreenSize=this._passParameters.drawScreenSpace,this._techniqueConfig.useFixedSizes=this._passParameters.useFixedSizes,this._techniqueConfig.hasSlicePlane=this._slicePlaneEnabled,this._techniqueConfig.hasOccludees=e.bindParameters.hasOccludees,this._techniqueConfig.clippingEnabled=this._clippingEnabled,this._techniqueConfig.output=e.output===P.Depth?P.Depth:e.output===P.Highlight?P.Highlight:P.Color,this._techniqueRepository.releaseAndAcquire(G,this._techniqueConfig,this._technique))}render(e,i){const s=e.rctx,n=s.bindTechnique(i,this._passParameters,e.bindParameters),r=e.output===P.Highlight;this._nodes.forAll(o=>{o.coordinates.length===0||r&&!o.highlights||(n.bindDraw(o,e.bindParameters,this._passParameters),s.bindVAO(o.vao),r?this._renderHighlightFragments(s,o):s.drawArrays(ee.POINTS,0,o.coordinates.length/3))})}_renderHighlightFragments(e,i){const s=i.highlights;if(s==null)return;let n=s[0].component,r=n+1;for(let a=1;a0&&e.drawArrays(ee.POINTS,n,d),n=l}r=l+1}const o=r-n;o>0&&e.drawArrays(ee.POINTS,n,o)}set useFixedSizes(e){this._passParameters.useFixedSizes!==e&&(this._passParameters.useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._passParameters.useFixedSizes}set scaleFactor(e){this._passParameters.scaleFactor!==e&&(this._passParameters.scaleFactor=e,this._requestRender())}get scaleFactor(){return this._passParameters.scaleFactor}set minSizePx(e){this._passParameters.minSizePx!==e&&(this._passParameters.minSizePx=e,this._requestRender())}get minSizePx(){return this._passParameters.minSizePx}set useRealWorldSymbolSizes(e){this._passParameters.useRealWorldSymbolSizes!==e&&(this._passParameters.useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._passParameters.useRealWorldSymbolSizes}set size(e){this._passParameters.size!==e&&(this._passParameters.size=e,this._requestRender())}get size(){return this._passParameters.size}set sizePx(e){this._passParameters.sizePx!==e&&(this._passParameters.sizePx=e,this._requestRender())}get sizePx(){return this._passParameters.sizePx}set clippingBox(e){Ut(this._passParameters.clipBox,e||le)}get _clippingEnabled(){return!Bt(this._passParameters.clipBox,le,(e,i)=>e===i)}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this._nodes.push(e),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let i=null;return this._nodes.filterInPlace(s=>s.id!==e||(i=s,s.vao=ye(s.vao),this._highlights.nodeRemoved(s),!1)),this._requestRender(),i}forEachNode(e){this._nodes.forAll(e)}removeAll(){this._nodes.forAll(e=>e.vao=ye(e.vao)),this._highlights.removeAll(),this._nodes.clear(),this._requestRender()}highlight(e){return this._highlights.add(e)}_addHighlight(e,i,s){e.highlights=es(e.highlights,i,s),this._requestRender()}_removeHighlight(e,i){e.highlights=ts(e.highlights,i),this._requestRender()}_initNode(e,i){const s=e.rctx;i.vao=new Gt(s,He,Ji,{positions:xe.createVertex(s,Pe.STATIC_DRAW,i.coordinates),colors:xe.createVertex(s,Pe.STATIC_DRAW,i.rgb)})}_requestRender(){this._context&&this._context.requestRender()}}class Ki extends Be{constructor(e,i,s,n,r,o,a,l,d=null,c=null){super(s,r,i),this.id=e,this.obb=n,this.coordinates=o,this.rgb=a,this.attributes=l,this.pointIdFilterMap=d,this.highlights=c}}function Xi(t){return t.hasOwnProperty("splatSize")}function de(t,e,i,s,n){if(i.drawScreenSpace)return i.fixedSize*e*s;const r=he(n)*e*s;return i.useFixedSizes?Math.min(i.fixedSize/2,r):i.screenMinSize>0?Math.min(Math.max(i.screenMinSize*e*s,t/2),r):Math.min(t/2,r)}function re(t,e,i,s,n){return i.drawScreenSpace?0:de(t,e,i,s,n)}function Zi(t,e,i){return i==null&&(i=V()),i[0]=t.origin[0]+t.coordinates[3*e],i[1]=t.origin[1]+t.coordinates[3*e+1],i[2]=t.origin[2]+t.coordinates[3*e+2],i}function Ee(t){return t.component!=null?t.component:-1}function es(t,e,i){t==null&&(t=[]);const s={component:e,id:i};t.push(s);const n=Ee(s);let r=t.length-1;for(;r>0&&ns.id!==e);return i.length===0?null:i}class oe{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerUid=""}}function ke(t){return t.dist!=null&&t.point!=null&&t.pointId!=null&&t.node!=null}const is=8,ss=Qe();let S=class extends Fi(zi(Oi)){constructor(){super(...arguments),this.type="point-cloud-3d",this.maximumPointCount=4e6,this.slicePlaneEnabled=!1,this._renderer=null,this._rendererAdded=!1,this._renderedNodes=new Set,this._nodeScales=new Map,this._updateViewNeeded=!0,this._lodFactor=1,this._maxLoggedBoxWarnings=5,this._pageMultiplier=1,this._nodeLoadEpoch=0,this._indexQueue=[],this._workQueue=new Array,this._idleQueue=new Jt,this._indexPagesLoading=new Map,this._loadingNodes=new Map,this._recalcWork=!0,this._layerIsVisible=!1,this._codedDomainPopulationPromise=null,this._codedDomainPopulationAbortController=null,this._totalWork=0,this._index=null,this._loadingInitNodePage=!1,this._nodeIdArray=[],this.ignoresMemoryFactor=!1}get baseUrl(){return this.layer.parsedUrl.path}get pointScale(){const t=Qi(this.layer&&this.layer.renderer),e=1;return t&&t.scaleFactor!=null?t.scaleFactor:e}get useRealWorldSymbolSizes(){const t=Fe(this.layer&&this.layer.renderer),e=!1;return t&&t.useRealWorldSymbolSizes!=null?t.useRealWorldSymbolSizes:e}get pointSize(){const t=Fe(this.layer&&this.layer.renderer),e=0;return t&&t.size!=null?t.size:e}get inverseDensity(){return this.layer&&this.layer.renderer?1*96/this.layer.renderer.pointsPerInch:5}get availableFields(){const t=Ae(this.layer),e=new Set;t.primaryAttribute&&e.add(t.primaryAttribute.name),t.modulationAttribute&&e.add(t.modulationAttribute.name);const i=Ie(this.layer);if(i)for(const s of i)s.attributeInfo&&e.add(s.attributeInfo.name);if(this.layer.outFields)for(const s of ve(this.layer.fieldsIndex,this.layer.outFields))e.add(s);return Array.from(e)}get _clippingBox(){if(!this.view||!this.view.clippingArea)return null;const t=Q(),e=this.view.renderSpatialReference;return Yt(this.view.clippingArea,t,e)?t:null}get _elevationOffset(){const t=this.layer&&this.layer.elevationInfo;if(t&&t.mode==="absolute-height"){const e=Kt(this.layer.spatialReference),i=Xt(t.unit);return(t.offset??0)*i/e}return 0}initialize(){const t=this.view.resourceController,e=os(t);this._worker=new Mi(e),this.addResolvingPromise(this._worker.promise),this._tmpPoint=Zt(0,0,0,this.layer.spatialReference),$i(this.layer),Ci(this.layer,this.view),this._indexRequester=t.createStreamDataRequester(we.I3S_INDEX),this._dataRequester=t.createStreamDataRequester(we.I3S_DATA),this._initRenderer();const i=this._initNodePages(),s=this.view.resourceController.memoryController;this._memCache=s.newCache(`pcl-${this.layer.uid}`),this.updatingHandles.add(()=>this._clippingBox,()=>this._setUpdateViewNeeded(),y),this.updatingHandles.add(()=>this._elevationOffset,()=>this._elevationOffsetChanged(),y),this.updatingHandles.add(()=>this.layer.renderer,()=>this._rendererChanged(),y),this.updatingHandles.add(()=>this.layer.filters,()=>this._reload(),y),this.updatingHandles.add(()=>this.layer.outFields,()=>this._reload(),y),this.updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this._setUpdateViewNeeded()),this.updatingHandles.add(()=>this.view.state.contentCamera,()=>this._setUpdateViewNeeded()),this.handles.add([this.view.basemapTerrain.on("scale-change",n=>this._scaleUpdateHandler(n)),ei(()=>s.memoryFactor,()=>this._setUpdateViewNeeded(),ti)]),this.addResolvingPromise(i),this.when(()=>{this.handles.add([t.scheduler.registerTask(ii.POINT_CLOUD_LAYER,this),t.scheduler.registerIdleStateCallbacks(()=>this._idleBegin(),()=>this._idleEnd()),this.updatingHandles.add(()=>this.suspended,n=>{n?this._clearNodeState():this._setUpdateViewNeeded()},y)])},()=>{this.updatingHandles.removeAll(),this.handles.removeAll()})}_setUpdateViewNeeded(){this._updateViewNeeded=!0,this._updateLoading()}destroy(){this.cancelLoading(),this._worker=ze(this._worker),this._destroyRenderer(),this._memCache=ze(this._memCache),this._codedDomainPopulationAbortController=si(this._codedDomainPopulationAbortController),this._codedDomainPopulationPromise=null}_initRenderer(){this._renderer=new Yi({createGraphic:(t,e,i)=>this._createGraphic(t,e,i)}),this._renderer.layerUid=this.layer.uid,this.updatingHandles.add(()=>this._clippingBox,t=>this._renderer.clippingBox=t,y),this.updatingHandles.add(()=>this.suspended,t=>this._setPointsVisible(!t),y),this.updatingHandles.add(()=>this.pointScale,t=>this._renderer.scaleFactor=t,y),this._renderer.minSizePx=Math.sqrt(2),this.updatingHandles.add(()=>this.useRealWorldSymbolSizes,t=>this._renderer.useRealWorldSymbolSizes=t,y),this.updatingHandles.add(()=>this.pointSize,t=>{const e=Pi(t);this._renderer.size=t,this._renderer.sizePx=e},y),this.updatingHandles.add(()=>this.slicePlaneEnabled,t=>this._renderer.slicePlaneEnabled=t,y),this.updatingHandles.add(()=>this.inverseDensity,()=>this._setUpdateViewNeeded(),y),this.updatingHandles.add(()=>this.maximumPointCount,()=>this._setUpdateViewNeeded(),y),this.updatingHandles.add(()=>this.view.qualitySettings.sceneService.pointCloud.lodFactor,t=>{this._lodFactor=t,this._setUpdateViewNeeded()},y)}_destroyRenderer(){this._renderer.removeAll(),this._setPointsVisible(!1)}_createGraphic(t,e,i){const s=t.pointIdFilterMap!=null?t.pointIdFilterMap[e]:e,n=this.view.computeMapPointFromVec3d(i),r=this._createGraphicAttributes(t,s);return new H({pointCloudMetadata:{nodeId:t.id,pointIndexInNode:e,attributePointIndexInNode:s,epoch:this._nodeLoadEpoch},geometry:n,attributes:r,layer:this.layer,sourceLayer:this.layer})}_createGraphicAttributes(t,e){const i={};for(const s of t.attributes)this._encodeGraphicAttribute(s.attributeInfo,s.values,e,i);return i}_encodeGraphicAttribute(t,e,i,s){var o;const n=(o=t.storageInfo)==null?void 0:o.attributeValues,r=(n==null?void 0:n.valuesPerElement)??1;if(r===1)s[t.name]=e[i];else if((n==null?void 0:n.valueType)==="UInt8"&&r<=4){let a=0;const l=i*r;for(let d=l;d{if(!this._renderedNodes.has(s))return void this._nodeScales.delete(s);const n=this._index.getNode(s);ai(Ve,n.obb.center)&&this._nodeScales.set(s,t.scale)}),this._setUpdateViewNeeded()):this._nodeScales.clear()}_displayNodes(t){this._workQueue=Li([...this._renderedNodes],t,this._index),Ei(this._workQueue,this.view.state.contentCamera.viewForward,this._index),ki(this._workQueue,is,this._index),this._updateQueues(),this._totalWork=this._computeWork(),this._updateLoading(),this._layerIsVisible=t.length>0||this._loadingInitNodePage,this.notifyChange("suspended")}cancelLoading(){this._cancelNodeLoading(),this._cancelIndexLoading()}_cancelNodeLoading(){const t=new Array;this._loadingNodes.forEach(({abortController:e})=>t.push(e)),this._loadingNodes.clear();for(const e of t)e.abort();this._workQueue=[],this._idleQueue.cancelAll(),this._totalWork=this._computeWork(),this._updateLoading()}_updateQueues(){const t=new Set;this._workQueue.forEach(s=>s.load.forEach(n=>t.add(n)));const e=new Array,i=new Map;this._loadingNodes.forEach((s,n)=>{t.has(n)?i.set(n,s):e.push(s)}),this._loadingNodes=i;for(const{abortController:s}of e)s.abort();this._workQueue=this._workQueue.filter(s=>{for(const n of s.load)if(this._loadingNodes.has(n))return this._recalcWork=!0,!1;return!0}),this._totalWork=this._computeWork(),this._updateLoading()}_cancelIndexLoading(){this._indexQueue=[],this._indexPagesLoading.forEach(({abortController:t})=>t.abort()),this._indexPagesLoading.clear(),this._totalWork=this._computeWork(),this._updateLoading()}_clearNodeState(){this._nodeLoadEpoch++,this._renderedNodes.forEach(t=>this._removeFromRenderer(t)),this._cancelNodeLoading()}_idleBegin(){this._setUpdateViewNeeded()}_idleEnd(){this._setUpdateViewNeeded()}get running(){return this.suspended?this._updateViewNeeded:this._updateViewNeeded||this._indexQueue.length>0||this._workQueue.length>0||this._idleQueue.running}runTask(t){if(this.suspended){if(this._updateViewNeeded){this._updateViewNeeded=!1;const e=this._isRootNodeVisible();e!==this._layerIsVisible&&(this._layerIsVisible=e,this.notifyChange("suspended")),this._updateLoading()}}else{for(t.run(()=>this._updateWorkQueues());this._indexQueue.length>0&&t.run(()=>this._processIndexQueue()););this._processWorkQueue(t),this._idleQueue.runTask(t)}}_processIndexQueue(){const t=this._indexQueue.shift(),e=this._loadNodePage(t);return this._indexPagesLoading.set(t,e),e.promise.then(i=>{this._index.addPage(t,i,this._elevationOffset),this._setUpdateViewNeeded()}).then(()=>{this._indexPagesLoading.delete(t)},()=>{this._indexPagesLoading.delete(t)}),!0}_processWorkQueue(t){for(;!t.done;){const e=this._scheduleWorkEntry();if(e==null)return;this._processWorkEntry(e),t.madeProgress()}}_scheduleWorkEntry(){let t=this._workQueue.length;for(;t--;){const e=this._workQueue.shift();if(!e.remove.find(i=>!this._renderedNodes.has(i)))return e;this._workQueue.push(e)}return null}_processWorkEntry(t){if(t.load.length!==0)Promise.all(t.load.map(e=>{const i=new AbortController,s=this._memCache.pop(e.toString());return s!=null?this._loadingNodes.set(e,{abortController:i,promise:Promise.resolve(s)}):this._loadingNodes.has(e)||this._loadingNodes.set(e,{abortController:i,promise:this._loadNode(e,i.signal)}),this._loadingNodes.get(e).promise})).then(e=>{for(let i=0;i{}).then(()=>{for(const e of t.load)this._loadingNodes.delete(e);this._updateLoading(),this._recalcWork&&!this._idleQueue.running&&this._indexQueue.length===0&&this._loadingNodes.size===0&&(this._recalcWork=!1,this._setUpdateViewNeeded())}),this._updateLoading();else for(const e of t.remove)this._removeFromRenderer(e)}async _populateClassCodeCodedDomain(t,e){var o,a,l;const i="CLASS_CODE",s=this.layer.fieldsIndex.get(i);if(!s||s.domain||!t.includes(s.name))return;const n=await li(this.layer.queryCachedStatistics(i,{signal:e}));if(n.ok===!1)return;const r=(l=(a=(o=n.value)==null?void 0:o.stats)==null?void 0:a.labels)==null?void 0:l.labels;r&&Array.isArray(r)&&(s.domain=new di({name:"CLASS_CODE",codedValues:r.map(d=>new hi({code:d.value,name:d.label}))}))}async prepareFetchPopupFeatures(t){return this._codedDomainPopulationPromise||(this._codedDomainPopulationAbortController=new AbortController,this._codedDomainPopulationPromise=this._populateClassCodeCodedDomain(t,this._codedDomainPopulationAbortController.signal).then(()=>{this._codedDomainPopulationAbortController=null})),this._codedDomainPopulationPromise}async whenGraphicAttributes(t,e){const i=this._splitGraphicsPerNode(t),s=this.layer.attributeStorageInfo,n=e.map(a=>T(s,a)).filter(Ne),r=async(a,l)=>{const d=this._index.getNode(l);await vi(n,async c=>{const p=c.useElevation?await this._loadElevationAttributeFromGeometry(d.resourceId):await this._loadAndParseAttribute(d,c);if(p){for(const _ of a)if(this._isValidPointGraphic(_)){const u=_.pointCloudMetadata.attributePointIndexInNode;this._encodeGraphicAttribute(c,p,u,_.attributes)}}})},o=[];return i.forEach((a,l)=>{o.push(r(a,l))}),await ui(o),t}_isValidPointGraphic(t){var e;return t instanceof H&&((e=t.pointCloudMetadata)==null?void 0:e.epoch)===this._nodeLoadEpoch}_splitGraphicsPerNode(t){const e=new Map;for(const i of t){if(!this._isValidPointGraphic(i))continue;const s=i.pointCloudMetadata,n=e.get(s.nodeId);n?n.push(i):e.set(s.nodeId,[i])}return e}async _loadAndParseAttribute(t,e){const i=await this._loadAttribute(t.resourceId,e,null);return i!=null?Ri({attributeInfo:e,buffer:i},null,t.vertexCount):null}async _loadElevationAttributeFromGeometry(t){const e=this.layer.store.defaultGeometrySchema,i=Ai(e,await this._loadGeometry(t,null));return Ii(i,i.length/3)}highlight(t){if(!t)return{remove(){}};const e=ci.isCollection(t)?t.toArray():Array.isArray(t)?t:[t];return this._renderer.highlight(e.map(i=>this._graphicToPointDefinition(i)))}_graphicToPointDefinition(t){if(!this._isValidPointGraphic(t))return null;const{nodeId:e,pointIndexInNode:i}=t.pointCloudMetadata;return e!=null&&i!=null?{nodeId:e,pointId:i}:null}_computeWork(){let t=0;for(const e of this._workQueue)t+=e.load.length+e.remove.length;return t+=this._loadingNodes.size,t+=(this._indexQueue.length+this._indexPagesLoading.size)*this._index.pageSize,t+=this._loadingInitNodePage?100:0,t+=this._updateViewNeeded?100:0,t}get updatingProgressValue(){if(this.suspended)return this._updateViewNeeded?0:1;const t=this._computeWork();return 1-Math.min(this._totalWork,t)/this._totalWork}_updateLoading(){this.notifyChange("updating"),this.notifyChange("updatingProgressValue")}canResume(){return super.canResume()&&this._layerIsVisible}isUpdating(){return this.suspended?this._updateViewNeeded:this._computeWork()>0}_initNodePages(){const t=this.layer.store.index,e=t.nodesPerPage||t.nodePerIndexBlock;return this._index=new Di(this.layer.spatialReference,this.view.renderCoordsHelper.spatialReference,e),this._cancelIndexLoading(),this._traverseVisible=this._index.createVisibilityTraverse(),this._loadingInitNodePage=!0,this._layerIsVisible=!0,this.notifyChange("suspended"),this._updateLoading(),this._pageMultiplier=t.nodesPerPage!=null?1:t.nodePerIndexBlock,this._loadNodePage(0).promise.then(i=>{this._index.addPage(0,i,this._elevationOffset),this._loadingInitNodePage=!1,this._setUpdateViewNeeded()})}_loadNodePage(t){const e=new AbortController,i=`${this.baseUrl}/nodepages/${t*this._pageMultiplier}`;return{promise:this._requestNodePage(i,e.signal).then(s=>s.nodes.map((n,r)=>({resourceId:n.resourceId!=null?n.resourceId:t*this._index.pageSize+r,obb:n.obb,firstChild:n.firstChild,childCount:n.childCount,vertexCount:n.vertexCount??n.pointCount,lodThreshold:n.lodThreshold??n.effectiveArea}))),abortController:e}}_updateWorkQueues(){if(!this._updateViewNeeded)return!1;let t=this.inverseDensity/this._lodFactor*this._getLodMemoryFactor();const e=this.maximumPointCount*this._lodFactor*this._getLodMemoryFactor();let i=this._computeNodesForMinimumDensity(t),s=this._computePointCount(i),n=Math.sqrt(s/(.75*e));for(;s>e;)t*=n,i=this._computeNodesForMinimumDensity(t),s=this._computePointCount(i),n=Math.sqrt(2);return this._displayNodes(i),this._updateViewNeeded=!1,this._updateLoading(),!0}_computePointCount(t){let e=0;for(let i=0;i(t=s,!1),pageMiss:()=>{}}),t}_computeNodesForMinimumDensity(t){const e=this.view.state.contentCamera,i=e.frustum,s=this._clippingBox,n=e.viewForward,r=R(n,e.eye),o=pi(n,-r,ss),a=e.perScreenPixelRatio/2,l=t*t,d=this._nodeIdArray;d.length=0;const{minScale:c,maxScale:p}=_i(this.layer),_=c===0&&p===0?u=>d.push(u):u=>{const f=this._getScale(u);wi(f,c,p)&&d.push(u)};return this._traverseVisible({frustum:i,clippingBox:s},{predicate:(u,f,A)=>{if(!A)return!1;if(f.childCount===0)return _(u),!1;const m=this._index.getRenderObb(u);return!(this._computeAveragePixelArea(m,f.lodThreshold,f.vertexCount,o,a)<=l)||(_(u),!1)},pageMiss:(u,f)=>{_(u),this._indexQueue.includes(f)||this._indexQueue.push(f)}}),d}_getScale(t){let e=this._nodeScales.get(t);if(e==null){const i=this._index.getNode(t).obb.center;this._tmpPoint.x=i[0],this._tmpPoint.y=i[1],this._tmpPoint.z=i[2],e=this.view.basemapTerrain.getScale(this._tmpPoint),this._nodeScales.set(t,e)}return e}_computeAveragePixelArea(t,e,i,s,n){const o=Math.max(1e-7,Te(t,s));return e/(o*o)/(4*n*n)/i}_loadNode(t,e){try{return this._loadNodeAsync(t,e)}catch(i){throw gi(i)||te.getLogger(this).error(i),i}}async _loadAdditionalUserAttributes(t,e,i){const s=this.layer.outFields;if(!s)return[];const n=ve(this.layer.fieldsIndex,s),r=new Set(t.map(d=>d!=null?d.name:null)),o=this.layer.attributeStorageInfo,a=[];for(const d of n){if(r.has(d))continue;const c=T(o,d);c&&a.push(e(c))}const l=await fi(a);return $e(i),l.filter(Ne)}async _loadNodeAsync(t,e){const i=this._index.getNode(t),s=Ae(this.layer),n=Ie(this.layer),r=i.resourceId,o=async a=>{if(!a)return null;if(a.useElevation)return{attributeInfo:a,buffer:null};const l=await this._loadAttribute(r,a,e);return l!=null?{attributeInfo:a,buffer:l}:null};return this._idleQueue.push(async()=>{const a=this._loadGeometry(r,e),{primaryAttribute:l,modulationAttribute:d}=s,c=o(l),p=o(d),_=n.map(b=>b.attributeInfo),u=_.map(b=>o(b)),f=this._loadAdditionalUserAttributes([l,d,..._],o,e),[A,m,L,j,q]=await Promise.all([a,c,p,Promise.all(u),f]);$e(e);const h={geometryBuffer:A,primaryAttributeData:m,modulationAttributeData:L,filterAttributesData:j,userAttributesData:q,schema:this.layer.store.defaultGeometrySchema,rendererInfo:s,filterInfo:n,obb:this._index.getRenderObb(t),elevationOffset:this._elevationOffset,inSR:this.layer.spatialReference.toJSON(),outSR:this.view.renderCoordsHelper.spatialReference.toJSON()};return this._worker.invoke(h,e)},e)}async _loadGeometry(t,e){return this._requestData(`${this.baseUrl}/nodes/${t}/geometries/0`,e)}async _loadAttribute(t,e,i){if(e==null||!e.storageInfo)return null;const s=e.storageInfo.key;return this._requestData(`${this.baseUrl}/nodes/${t}/attributes/${s}`,i)}_requestNodePage(t,e){const i={f:"json",token:this.layer.apiKey};return this._indexRequester.request(t,"json",{query:i,signal:e})}_requestData(t,e){return this._dataRequester.request(t,"binary",{query:{token:this.layer.apiKey},signal:e})}_removeFromRenderer(t){if(this._renderedNodes.has(t)){const e=this._renderer.removeNode(t);this._renderedNodes.delete(t),this._nodeScales.delete(t),this._memCache.put(e.id.toString(),e,rs(e))}}_addToRenderer(t){this._renderedNodes.has(t.id)||(this._renderedNodes.add(t.id),this._renderer.addNode(t))}_setupRendererData(t,e){const i=this._index.getNode(t),s=Math.sqrt(i.lodThreshold/i.vertexCount),n=this._index.getRenderObb(t);if(Xi(e))return e.splatSize=s,e.obb=n,mi(e.origin,e.obb.center),e;const r=.01*Math.max(n.halfSize[0],n.halfSize[1],n.halfSize[2]);if(e.obb.halfSize[0]>n.halfSize[0]+r||e.obb.halfSize[1]>n.halfSize[1]+r||e.obb.halfSize[2]>n.halfSize[2]+r){if(this._maxLoggedBoxWarnings>0){const o=a=>`[${a.halfSize[0]}, ${a.halfSize[1]}, ${a.halfSize[2]}]`;te.getLogger(this).warn(`Node ${t} reported bounding box too small. got ${o(n)} but points cover ${o(e.obb)}`),--this._maxLoggedBoxWarnings==0&&te.getLogger(this).warn(" Too many bounding box errors, stopping reporting for this layer.")}this._index.setRenderObb(t,e.obb)}return new Ki(t,s,bi(n.center),n,i.childCount===0,e.points,e.rgb,e.attributes,e.pointIdFilterMap)}get usedMemory(){let t=0;return this._renderer.forEachNode(e=>{t+=ae,t+=Ce(e.coordinates);for(const i of e.attributes){const s=i.values;Si(s.buffer)&&(t+=Ce(s))}}),t}get unloadedMemory(){const t=this._renderedNodes.size;if(t<4)return 0;const e=[...this._renderedNodes].reduce((s,n)=>s+this._index.getNode(n).vertexCount);let i=this._loadingNodes.size;for(let s=0;st+this._index.getNode(e).vertexCount,0),maximumNumberOfFeatures:this.maximumPointCount,totalNumberOfFeatures:-1,core:null,"Loading Nodes":this._loadingNodes.size,"Index Queue":this._indexQueue.length,"Work Queue":this._workQueue.length,"Idle Queue":this._idleQueue.length}}get test(){return{index:this._index,visibleNodes:this._renderedNodes}}};g([x()],S.prototype,"layer",void 0),g([x()],S.prototype,"baseUrl",null),g([x()],S.prototype,"pointScale",null),g([x()],S.prototype,"useRealWorldSymbolSizes",null),g([x()],S.prototype,"pointSize",null),g([x()],S.prototype,"inverseDensity",null),g([x()],S.prototype,"maximumPointCount",void 0),g([x({readOnly:!0})],S.prototype,"availableFields",null),g([x({readOnly:!0})],S.prototype,"_clippingBox",null),g([x({readOnly:!0})],S.prototype,"_elevationOffset",null),g([x({type:Boolean})],S.prototype,"slicePlaneEnabled",void 0),g([x()],S.prototype,"updating",void 0),g([x(yi)],S.prototype,"updatingProgress",void 0),g([x({readOnly:!0})],S.prototype,"updatingProgressValue",null),S=g([We("esri.views.3d.layers.PointCloudLayerView3D")],S);const ns=S;function rs(t){return 5*t.coordinates.length+128}const Ve=xi(),ae=160;function os(t){return e=>t.immediate.schedule(e)}const gs=Object.freeze(Object.defineProperty({__proto__:null,default:ns},Symbol.toStringTag,{value:"Module"}));export{he as F,Be as O,gs as P,Gi as R,Ue as y}; diff --git a/assets/PointCloudUniqueValueRenderer-df78a172.js b/assets/PointCloudUniqueValueRenderer-df78a172.js new file mode 100644 index 0000000..f7a62fc --- /dev/null +++ b/assets/PointCloudUniqueValueRenderer-df78a172.js @@ -0,0 +1 @@ +import{ai as e,aj as t,al as r,ck as f,cp as P,d2 as m,jA as k,cl as o,bh as I,eZ as N,l4 as z,nV as D}from"./index-080e108a.js";var w;let c=w=class extends f{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new w({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};e([t({type:String,json:{write:!0}})],c.prototype,"field",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"minValue",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"maxValue",void 0),c=w=e([r("esri.renderers.support.pointCloud.ColorModulation")],c);const K=c,v=new P({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let b=class extends f{};e([t({type:v.apiValues,readOnly:!0,nonNullable:!0,json:{type:v.jsonValues,read:!1,write:v.write}})],b.prototype,"type",void 0),b=e([r("esri.renderers.support.pointCloud.PointSizeAlgorithm")],b);const R=b;var g;let y=g=class extends R{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new g({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};e([m({pointCloudFixedSizeAlgorithm:"fixed-size"})],y.prototype,"type",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],y.prototype,"size",void 0),e([t({type:Boolean,json:{write:!0}})],y.prototype,"useRealWorldSymbolSizes",void 0),y=g=e([r("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],y);const A=y;var V;let h=V=class extends R{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new V({scaleFactor:this.scaleFactor})}};e([m({pointCloudSplatAlgorithm:"splat"})],h.prototype,"type",void 0),e([t({type:Number,value:1,nonNullable:!0,json:{write:!0}})],h.prototype,"scaleFactor",void 0),h=V=e([r("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],h);const B=h,q={key:"type",base:R,typeMap:{"fixed-size":A,splat:B}},T=k()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let l=class extends f{constructor(O){super(O),this.type=void 0,this.pointSizeAlgorithm=null,this.colorModulation=null,this.pointsPerInch=10}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}cloneProperties(){return{pointSizeAlgorithm:o(this.pointSizeAlgorithm),colorModulation:o(this.colorModulation),pointsPerInch:o(this.pointsPerInch)}}};e([t({type:T.apiValues,readOnly:!0,nonNullable:!0,json:{type:T.jsonValues,read:!1,write:T.write}})],l.prototype,"type",void 0),e([t({types:q,json:{write:!0}})],l.prototype,"pointSizeAlgorithm",void 0),e([t({type:K,json:{write:!0}})],l.prototype,"colorModulation",void 0),e([t({json:{write:!0},nonNullable:!0,type:Number})],l.prototype,"pointsPerInch",void 0),l=e([r("esri.renderers.PointCloudRenderer")],l),function(s){s.fieldTransformTypeKebabDict=new P({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})}(l||(l={}));const i=l;var j;let n=j=class extends f{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new j({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:o(this.color)})}};e([t({type:String,json:{write:!0}})],n.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"label",void 0),e([t({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],n.prototype,"minValue",void 0),e([t({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],n.prototype,"maxValue",void 0),e([t({type:I,json:{type:[N],write:!0}})],n.prototype,"color",void 0),n=j=e([r("esri.renderers.support.pointCloud.ColorClassBreakInfo")],n);const M=n;var C;let p=C=class extends i{constructor(s){super(s),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new C({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:o(this.colorClassBreakInfos),legendOptions:o(this.legendOptions)})}};e([m({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],p.prototype,"type",void 0),e([t({json:{write:!0},type:String})],p.prototype,"field",void 0),e([t({type:z,json:{write:!0}})],p.prototype,"legendOptions",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],p.prototype,"fieldTransformType",void 0),e([t({type:[M],json:{write:!0}})],p.prototype,"colorClassBreakInfos",void 0),p=C=e([r("esri.renderers.PointCloudClassBreaksRenderer")],p);const Z=p;var S;let a=S=class extends i{constructor(s){super(s),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new S({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),stops:o(this.stops),legendOptions:o(this.legendOptions)})}};e([m({pointCloudStretchRenderer:"point-cloud-stretch"})],a.prototype,"type",void 0),e([t({json:{write:!0},type:String})],a.prototype,"field",void 0),e([t({type:z,json:{write:!0}})],a.prototype,"legendOptions",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],a.prototype,"fieldTransformType",void 0),e([t({type:[D],json:{write:!0}})],a.prototype,"stops",void 0),a=S=e([r("esri.renderers.PointCloudStretchRenderer")],a);const E=a;var $;let u=$=class extends f{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new $({description:this.description,label:this.label,values:o(this.values),color:o(this.color)})}};e([t({type:String,json:{write:!0}})],u.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],u.prototype,"label",void 0),e([t({type:[String],json:{write:!0}})],u.prototype,"values",void 0),e([t({type:I,json:{type:[N],write:!0}})],u.prototype,"color",void 0),u=$=e([r("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],u);const F=u;var x;let d=x=class extends i{constructor(s){super(s),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new x({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),colorUniqueValueInfos:o(this.colorUniqueValueInfos),legendOptions:o(this.legendOptions)})}};e([m({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],d.prototype,"type",void 0),e([t({json:{write:!0},type:String})],d.prototype,"field",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],d.prototype,"fieldTransformType",void 0),e([t({type:[F],json:{write:!0}})],d.prototype,"colorUniqueValueInfos",void 0),e([t({type:z,json:{write:!0}})],d.prototype,"legendOptions",void 0),d=x=e([r("esri.renderers.PointCloudUniqueValueRenderer")],d);const H=d;export{H as a,E as b,i as c,Z as d}; diff --git a/assets/PointCloudWorker-68a2e657.js b/assets/PointCloudWorker-68a2e657.js new file mode 100644 index 0000000..0206d96 --- /dev/null +++ b/assets/PointCloudWorker-68a2e657.js @@ -0,0 +1 @@ +import{eE as A,eF as v,dZ as d,bc as c,eG as y,eH as S,eI as D,eJ as M,eK as h}from"./index-080e108a.js";import{u as g,c as b,i as w,f as z}from"./PointCloudWorkerUtil-ec4f2005.js";import"./PointCloudUniqueValueRenderer-df78a172.js";import"./I3SBinaryReader-2b8e30f7.js";class _{transform(t){const a=this._transform(t),e=[a.points.buffer,a.rgb.buffer];a.pointIdFilterMap!=null&&e.push(a.pointIdFilterMap.buffer);for(const r of a.attributes)"buffer"in r.values&&v(r.values.buffer)&&r.values.buffer!==a.rgb.buffer&&e.push(r.values.buffer);return Promise.resolve({result:a,transferList:e})}_transform(t){const a=g(t.schema,t.geometryBuffer);let e=a.length/3,r=null;const i=new Array,s=b(t.primaryAttributeData,a,e);t.primaryAttributeData!=null&&s&&i.push({attributeInfo:t.primaryAttributeData.attributeInfo,values:s});const o=b(t.modulationAttributeData,a,e);t.modulationAttributeData!=null&&o&&i.push({attributeInfo:t.modulationAttributeData.attributeInfo,values:o});let f=w(t.rendererInfo,s,o,e);if(t.filterInfo&&t.filterInfo.length>0&&t.filterAttributesData!=null){const n=t.filterAttributesData.filter(d).map(l=>{const I=b(l,a,e),p={attributeInfo:l.attributeInfo,values:I};return i.push(p),p});r=new Uint32Array(e),e=z(a,f,r,t.filterInfo,n)}for(const n of t.userAttributesData){const l=b(n,a,e);i.push({attributeInfo:n.attributeInfo,values:l})}3*e=e[l].value)t[3*r]=e[l].color.r,t[3*r+1]=e[l].color.g,t[3*r+2]=e[l].color.b;else for(let f=1;f=e[l].minValue&&c<=e[l].maxValue){t[3*r]=e[l].color.r,t[3*r+1]=e[l].color.g,t[3*r+2]=e[l].color.b;break}}}else t=new Uint8Array(3*u).fill(255);if(d&&s&&s.colorModulation){const e=s.colorModulation.minValue,a=s.colorModulation.maxValue,r=.3;for(let c=0;c=a?1:l<=e?r:r+(1-r)*(l-e)/(a-e);t[3*c]=f*t[3*c],t[3*c+1]=f*t[3*c+1],t[3*c+2]=f*t[3*c+2]}}return t}function U(n,o){if(n.encoding==null||n.encoding===""){const d=I(o,n);if(d.vertexAttributes.position==null)return;const u=x(o,d.vertexAttributes.position),i=d.header.fields,p=[i.offsetX,i.offsetY,i.offsetZ],t=[i.scaleX,i.scaleY,i.scaleZ],s=u.length/3,e=new Float64Array(3*s);for(let a=0;a>>4&15,b=f>1,w=l===1,y=l===f;let h=!1;for(const g of r.includedReturns)if(g==="last"&&y||g==="firstOfMany"&&w&&b||g==="lastOfMany"&&y&&b||g==="single"&&!b){h=!0;break}h||(e=!1);break}}}e&&(d[t]=s,n[3*t]=n[3*s],n[3*t+1]=n[3*s+1],n[3*t+2]=n[3*s+2],o[3*t]=o[3*s],o[3*t+1]=o[3*s+1],o[3*t+2]=o[3*s+2],t++)}return t}function m(n){switch(n){default:case null:case"none":return o=>o;case"low-four-bit":return o=>15&o;case"high-four-bit":return o=>(240&o)>>4;case"absolute-value":return o=>Math.abs(o);case"modulo-ten":return o=>o%10}}function v(n){let o=0;for(const d of n||[])o|=1<t.globalAlpha),new f("glowColor",t=>t.glowColor),new _("glowWidth",(t,n)=>t.glowWidth*n.camera.pixelRatio),new _("glowFalloff",t=>t.glowFalloff),new f("innerColor",t=>t.innerColor),new _("innerWidth",(t,n)=>t.innerWidth*n.camera.pixelRatio),new U("depthMap",(t,n)=>n.linearDepthTexture),new E("nearFar",(t,n)=>n.camera.nearFar),new U("frameColor",(t,n)=>n.mainColorTexture)),i.code.add(a`vec4 blendPremultiplied(vec4 source, vec4 dest) { +float oneMinusSourceAlpha = 1.0 - source.a; +return vec4( +source.rgb + dest.rgb * oneMinusSourceAlpha, +source.a + dest.a * oneMinusSourceAlpha +); +}`),i.code.add(a`vec4 premultipliedColor(vec3 rgb, float alpha) { +return vec4(rgb * alpha, alpha); +}`),i.code.add(a`vec4 laserlineProfile(float dist) { +if (dist > glowWidth) { +return vec4(0.0); +} +float innerAlpha = (1.0 - smoothstep(0.0, innerWidth, dist)); +float glowAlpha = pow(max(0.0, 1.0 - dist / glowWidth), glowFalloff); +return blendPremultiplied( +premultipliedColor(innerColor, innerAlpha), +premultipliedColor(glowColor, glowAlpha) +); +}`),i.code.add(a`bool laserlineReconstructFromDepth(out vec3 pos, out vec3 normal, out float depthDiscontinuityAlpha) { +float depth = linearDepthFromTexture(depthMap, uv, nearFar); +if (-depth == nearFar[0]) { +return false; +} +pos = reconstructPosition(gl_FragCoord.xy, depth); +normal = normalize(cross(dFdx(pos), dFdy(pos))); +float ddepth = fwidth(depth); +depthDiscontinuityAlpha = 1.0 - smoothstep(0.0, 0.01, -ddepth / depth); +return true; +}`),e.contrastControlEnabled?(i.uniforms.add(new _("globalAlphaContrastBoost",t=>t.globalAlphaContrastBoost!=null?t.globalAlphaContrastBoost:1)),i.code.add(a`float rgbToLuminance(vec3 color) { +return dot(vec3(0.2126, 0.7152, 0.0722), color); +} +vec4 laserlineOutput(vec4 color) { +float backgroundLuminance = rgbToLuminance(texture(frameColor, uv).rgb); +float alpha = clamp(globalAlpha * max(backgroundLuminance * globalAlphaContrastBoost, 1.0), 0.0, 1.0); +return color * alpha; +}`)):i.code.add(a`vec4 laserlineOutput(vec4 color) { +return color * globalAlpha; +}`)}function pt(s){const e=new le;e.include(we,s);const{vertex:i,fragment:t}=e;return i.uniforms.add(new j("modelView",(n,r)=>Se(gt,r.camera.viewMatrix,n.origin)),new j("proj",(n,r)=>r.camera.projectionMatrix),new _("glowWidth",(n,r)=>n.glowWidth*r.camera.pixelRatio),new E("pixelToNDC",(n,r)=>oe(_t,2/r.camera.fullViewport[2],2/r.camera.fullViewport[3]))),e.attributes.add(d.START,"vec3"),e.attributes.add(d.END,"vec3"),e.attributes.add(d.UP,"vec3"),e.attributes.add(d.EXTRUDE,"vec2"),e.varyings.add("uv","vec2"),e.varyings.add("vViewStart","vec3"),e.varyings.add("vViewEnd","vec3"),e.varyings.add("vViewPlane","vec4"),i.code.add(a`void main() { +vec3 pos = mix(start, end, extrude.x); +vec4 viewPos = modelView * vec4(pos, 1); +vec4 projPos = proj * viewPos; +vec2 ndcPos = projPos.xy / projPos.w; +vec3 viewUp = (modelView * vec4(extrude.y * up, 0)).xyz; +vec4 projPosUp = proj * vec4(viewPos.xyz + viewUp, 1); +vec2 projExtrudeDir = normalize(projPosUp.xy / projPosUp.w - ndcPos); +vec2 lxy = abs(sign(projExtrudeDir) - ndcPos); +ndcPos += length(lxy) * projExtrudeDir; +vec3 worldPlaneNormal = normalize(cross(up, normalize(end - start))); +vec3 viewPlaneNormal = (modelView * vec4(worldPlaneNormal, 0)).xyz; +vViewStart = (modelView * vec4(start, 1)).xyz; +vViewEnd = (modelView * vec4(end, 1)).xyz; +vViewPlane = vec4(viewPlaneNormal, -dot(viewPlaneNormal, vViewStart)); +float xPaddingPixels = sign(dot(viewPlaneNormal, viewPos.xyz)) * (extrude.x * 2.0 - 1.0) * glowWidth; +ndcPos.x += xPaddingPixels * pixelToNDC.x; +uv = ndcPos * 0.5 + 0.5; +gl_Position = vec4(ndcPos, 0, 1); +}`),t.uniforms.add(new _("perScreenPixelRatio",(n,r)=>r.camera.perScreenPixelRatio)),t.code.add(a`float planeDistancePixels(vec4 plane, vec3 pos, vec3 start, vec3 end) { +vec3 origin = mix(start, end, 0.5); +vec3 basis = end - origin; +vec3 posAtOrigin = pos - origin; +float x = dot(normalize(basis), posAtOrigin); +float y = dot(plane.xyz, posAtOrigin); +float dx = max(abs(x) - length(basis), 0.0); +float dy = y; +float dist = length(vec2(dx, dy)); +float width = fwidth(y); +float maxPixelDistance = length(pos) * perScreenPixelRatio * 2.0; +float pixelDist = dist / min(width, maxPixelDistance); +return abs(pixelDist); +} +void main() { +vec3 pos; +vec3 normal; +float depthDiscontinuityAlpha; +if (!laserlineReconstructFromDepth(pos, normal, depthDiscontinuityAlpha)) { +discard; +} +float distance = planeDistancePixels(vViewPlane, pos, vViewStart, vViewEnd); +vec4 color = laserlineProfile(distance); +float alpha = 1.0 - smoothstep(0.995, 0.999, abs(dot(normal, vViewPlane.xyz))); +fragColor = laserlineOutput(color * alpha * depthDiscontinuityAlpha); +}`),e}const _t=he(),gt=Ce(),ft=Object.freeze(Object.defineProperty({__proto__:null,build:pt},Symbol.toStringTag,{value:"Module"}));class O extends ue{initializeProgram(e){return new pe(e.rctx,O.shader.get().build(this.configuration),ye)}initializePipeline(){return _e({blending:ge(A.ONE,A.ONE_MINUS_SRC_ALPHA),colorWrite:fe})}}O.shader=new ce(ft,()=>de(()=>import("./LaserlinePath.glsl-f6fdf1ff.js"),["assets/LaserlinePath.glsl-f6fdf1ff.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/LineVisualElement-b605d10c.js","assets/VisualElementResources-e52972a5.js"]));const ye=new Map([[d.START,0],[d.END,1],[d.UP,2],[d.EXTRUDE,3]]);let ie=class{constructor(e){this._renderCoordsHelper=e,this._buffers=null,this._origin=o(),this._dirty=!1,this._count=0,this._vao=null}set vertices(e){const i=Me(3*e.length);let t=0;for(const n of e)i[t++]=n[0],i[t++]=n[1],i[t++]=n[2];this.buffers=[i]}set buffers(e){if(this._buffers=e,this._buffers.length>0){const i=this._buffers[0],t=3*Math.floor(i.length/3/2);M(this._origin,i[t],i[t+1],i[t+2])}else M(this._origin,0,0,0);this._dirty=!0}get origin(){return this._origin}draw(e){const i=this._ensureVAO(e);i!=null&&(e.bindVAO(i),e.drawArrays(me.TRIANGLES,0,this._count))}dispose(){this._vao!=null&&this._vao.dispose()}_ensureVAO(e){return this._buffers==null?null:(this._vao==null&&(this._vao=this._createVAO(e,this._buffers)),this._ensureVertexData(this._vao,this._buffers),this._vao)}_createVAO(e,i){const t=this._createDataBuffer(i);return this._dirty=!1,new Ae(e,ye,{data:$e(se)},{data:Te.createVertex(e,Oe.STATIC_DRAW,t)})}_ensureVertexData(e,i){var n;if(!this._dirty)return;const t=this._createDataBuffer(i);(n=e.vertexBuffers.data)==null||n.setData(t),this._dirty=!1}_numberOfRenderVertices(e){return 3*(2*(e.length/3-1))}_createDataBuffer(e){const i=e.reduce((u,h)=>u+this._numberOfRenderVertices(h),0);this._count=i;const t=se.createBuffer(i),n=this._origin;let r=0,l=0;for(const u of e){for(let h=0;h0){t.up.setVec(c-2,v),t.up.setVec(c-4,v),t.up.setVec(c-5,v);for(let b=-6;b<0;b++)t.end.setVec(c+b,H)}}r+=this._numberOfRenderVertices(u)}return t.buffer}};const mt=o(),ne=o(),se=Re().vec3f(d.START).vec3f(d.END).vec3f(d.UP).vec2f(d.EXTRUDE);class N extends Ie{constructor(){super(...arguments),this.contrastControlEnabled=!1}}x([w()],N.prototype,"contrastControlEnabled",void 0);const Ve=W(6);function Pt(s){const e=new le;e.include(qe),e.include(we,s);const i=e.fragment;if(s.lineVerticalPlaneEnabled||s.heightManifoldEnabled)if(i.uniforms.add(new _("maxPixelDistance",(t,n)=>s.heightManifoldEnabled?2*n.camera.computeScreenPixelSizeAt(t.heightManifoldTarget):2*n.camera.computeScreenPixelSizeAt(t.lineVerticalPlaneSegment.origin))),i.code.add(a`float planeDistancePixels(vec4 plane, vec3 pos) { +float dist = dot(plane.xyz, pos) + plane.w; +float width = fwidth(dist); +dist /= min(width, maxPixelDistance); +return abs(dist); +}`),s.spherical){const t=(r,l,u)=>m(r,l.heightManifoldTarget,u.camera.viewMatrix),n=(r,l)=>m(r,[0,0,0],l.camera.viewMatrix);i.uniforms.add(new C("heightManifoldOrigin",(r,l)=>(t(g,r,l),n(y,l),Pe(y,y,g),$(p,y),p[3]=B(y),p)),new f("globalOrigin",(r,l)=>n(g,l)),new _("cosSphericalAngleThreshold",(r,l)=>1-Math.max(2,be(l.camera.eye,r.heightManifoldTarget)*l.camera.perRenderPixelRatio)/B(r.heightManifoldTarget))),i.code.add(a`float globeDistancePixels(float posInGlobalOriginLength) { +float dist = abs(posInGlobalOriginLength - heightManifoldOrigin.w); +float width = fwidth(dist); +dist /= min(width, maxPixelDistance); +return abs(dist); +} +float heightManifoldDistancePixels(vec4 heightPlane, vec3 pos) { +vec3 posInGlobalOriginNorm = normalize(globalOrigin - pos); +float cosAngle = dot(posInGlobalOriginNorm, heightManifoldOrigin.xyz); +vec3 posInGlobalOrigin = globalOrigin - pos; +float posInGlobalOriginLength = length(posInGlobalOrigin); +float sphericalDistance = globeDistancePixels(posInGlobalOriginLength); +float planarDistance = planeDistancePixels(heightPlane, pos); +return cosAngle < cosSphericalAngleThreshold ? sphericalDistance : planarDistance; +}`)}else i.code.add(a`float heightManifoldDistancePixels(vec4 heightPlane, vec3 pos) { +return planeDistancePixels(heightPlane, pos); +}`);if(s.pointDistanceEnabled&&(i.uniforms.add(new _("maxPixelDistance",(t,n)=>2*n.camera.computeScreenPixelSizeAt(t.pointDistanceTarget))),i.code.add(a`float sphereDistancePixels(vec4 sphere, vec3 pos) { +float dist = distance(sphere.xyz, pos) - sphere.w; +float width = fwidth(dist); +dist /= min(width, maxPixelDistance); +return abs(dist); +}`)),s.intersectsLineEnabled&&(i.uniforms.add(new _("perScreenPixelRatio",(t,n)=>n.camera.perScreenPixelRatio)),i.code.add(a`float lineDistancePixels(vec3 start, vec3 dir, float radius, vec3 pos) { +float dist = length(cross(dir, pos - start)) / (length(pos) * perScreenPixelRatio); +return abs(dist) - radius; +}`)),(s.lineVerticalPlaneEnabled||s.intersectsLineEnabled)&&i.code.add(a`bool pointIsWithinLine(vec3 pos, vec3 start, vec3 end) { +vec3 dir = end - start; +float t2 = dot(dir, pos - start); +float l2 = dot(dir, dir); +return t2 >= 0.0 && t2 <= l2; +}`),i.code.add(a`void main() { +vec3 pos; +vec3 normal; +float depthDiscontinuityAlpha; +if (!laserlineReconstructFromDepth(pos, normal, depthDiscontinuityAlpha)) { +discard; +} +vec4 color = vec4(0, 0, 0, 0);`),s.heightManifoldEnabled){i.uniforms.add(new E("angleCutoff",n=>R(n)),new C("heightPlane",(n,r)=>Ee(n.heightManifoldTarget,n.renderCoordsHelper.worldUpAtPosition(n.heightManifoldTarget,g),r.camera.viewMatrix)));const t=s.spherical?a`normalize(globalOrigin - pos)`:a`heightPlane.xyz`;i.code.add(a` + { + float heightManifoldAlpha = 1.0 - smoothstep(angleCutoff.x, angleCutoff.y, abs(dot(normal, ${t}))); + vec4 heightManifoldColor = laserlineProfile(heightManifoldDistancePixels(heightPlane, pos)); + color = max(color, heightManifoldColor * heightManifoldAlpha); + } + `)}return s.pointDistanceEnabled&&(i.uniforms.add(new E("angleCutoff",t=>R(t)),new C("pointDistanceSphere",(t,n)=>bt(t,n))),i.code.add(a`{ +float pointDistanceSphereDistance = sphereDistancePixels(pointDistanceSphere, pos); +vec4 pointDistanceSphereColor = laserlineProfile(pointDistanceSphereDistance); +float pointDistanceSphereAlpha = 1.0 - smoothstep(angleCutoff.x, angleCutoff.y, abs(dot(normal, normalize(pos - pointDistanceSphere.xyz)))); +color = max(color, pointDistanceSphereColor * pointDistanceSphereAlpha); +}`)),s.lineVerticalPlaneEnabled&&(i.uniforms.add(new E("angleCutoff",t=>R(t)),new C("lineVerticalPlane",(t,n)=>vt(t,n)),new f("lineVerticalStart",(t,n)=>xt(t,n)),new f("lineVerticalEnd",(t,n)=>wt(t,n))),i.code.add(a`{ +if (pointIsWithinLine(pos, lineVerticalStart, lineVerticalEnd)) { +float lineVerticalDistance = planeDistancePixels(lineVerticalPlane, pos); +vec4 lineVerticalColor = laserlineProfile(lineVerticalDistance); +float lineVerticalAlpha = 1.0 - smoothstep(angleCutoff.x, angleCutoff.y, abs(dot(normal, lineVerticalPlane.xyz))); +color = max(color, lineVerticalColor * lineVerticalAlpha); +} +}`)),s.intersectsLineEnabled&&(i.uniforms.add(new E("angleCutoff",t=>R(t)),new f("intersectsLineStart",(t,n)=>m(g,t.lineStartWorld,n.camera.viewMatrix)),new f("intersectsLineEnd",(t,n)=>m(g,t.lineEndWorld,n.camera.viewMatrix)),new f("intersectsLineDirection",(t,n)=>(P(p,t.intersectsLineSegment.vector),p[3]=0,$(g,ve(p,p,n.camera.viewMatrix)))),new _("intersectsLineRadius",t=>t.intersectsLineRadius)),i.code.add(a`{ +if (pointIsWithinLine(pos, intersectsLineStart, intersectsLineEnd)) { +float intersectsLineDistance = lineDistancePixels(intersectsLineStart, intersectsLineDirection, intersectsLineRadius, pos); +vec4 intersectsLineColor = laserlineProfile(intersectsLineDistance); +float intersectsLineAlpha = 1.0 - smoothstep(angleCutoff.x, angleCutoff.y, 1.0 - abs(dot(normal, intersectsLineDirection))); +color = max(color, intersectsLineColor * intersectsLineAlpha); +} +}`)),i.code.add(a`fragColor = laserlineOutput(color * depthDiscontinuityAlpha); +}`),e}function R(s){return oe(yt,Math.cos(s.angleCutoff),Math.cos(Math.max(0,s.angleCutoff-W(2))))}function bt(s,e){return m(z,s.pointDistanceOrigin,e.camera.viewMatrix),z[3]=be(s.pointDistanceOrigin,s.pointDistanceTarget),z}function vt(s,e){const i=We(s.lineVerticalPlaneSegment,.5,g),t=s.renderCoordsHelper.worldUpAtPosition(i,Vt),n=$(y,s.lineVerticalPlaneSegment.vector),r=Ne(p,t,n);return $(r,r),Ee(s.lineVerticalPlaneSegment.origin,r,e.camera.viewMatrix)}function xt(s,e){const i=P(g,s.lineVerticalPlaneSegment.origin);return s.renderCoordsHelper.setAltitude(i,0),m(i,i,e.camera.viewMatrix)}function wt(s,e){const i=xe(g,s.lineVerticalPlaneSegment.origin,s.lineVerticalPlaneSegment.vector);return s.renderCoordsHelper.setAltitude(i,0),m(i,i,e.camera.viewMatrix)}function Ee(s,e,i){return m(re,s,i),P(p,e),p[3]=0,ve(p,p,i),He(re,p,Et)}const yt=he(),g=o(),p=Ue(),Vt=o(),y=o(),re=o(),Et=ze(),z=je(),Dt=Object.freeze(Object.defineProperty({__proto__:null,build:Pt,defaultAngleCutoff:Ve},Symbol.toStringTag,{value:"Module"}));class Lt extends Ge{constructor(){super(...arguments),this.innerColor=G(1,1,1),this.innerWidth=1,this.glowColor=G(1,.5,0),this.glowWidth=8,this.glowFalloff=8,this.globalAlpha=.75,this.globalAlphaContrastBoost=2,this.angleCutoff=W(6),this.pointDistanceOrigin=o(),this.pointDistanceTarget=o(),this.lineVerticalPlaneSegment=q(),this.intersectsLineSegment=q(),this.intersectsLineRadius=3,this.heightManifoldTarget=o(),this.lineStartWorld=o(),this.lineEndWorld=o()}}class I extends ue{initializeProgram(e){return new pe(e.rctx,I.shader.get().build(this.configuration),Be)}initializePipeline(){return _e({blending:ge(A.ONE,A.ONE_MINUS_SRC_ALPHA),colorWrite:fe})}}I.shader=new ce(Dt,()=>de(()=>import("./Laserlines.glsl-fc6ed0d2.js"),["assets/Laserlines.glsl-fc6ed0d2.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/LineVisualElement-b605d10c.js","assets/VisualElementResources-e52972a5.js"]));class V extends N{constructor(){super(...arguments),this.heightManifoldEnabled=!1,this.pointDistanceEnabled=!1,this.lineVerticalPlaneEnabled=!1,this.intersectsLineEnabled=!1,this.spherical=!1}}x([w()],V.prototype,"heightManifoldEnabled",void 0),x([w()],V.prototype,"pointDistanceEnabled",void 0),x([w()],V.prototype,"lineVerticalPlaneEnabled",void 0),x([w()],V.prototype,"intersectsLineEnabled",void 0),x([w()],V.prototype,"spherical",void 0);class St{constructor(e,i={contrastControlEnabled:!1}){this._config=i,this._technique=null,this._heightManifoldEnabled=!1,this._pointDistanceEnabled=!1,this._lineVerticalPlaneEnabled=!1,this._intersectsLineEnabled=!1,this._intersectsLineInfinite=!1,this._viewingMode=F.Local,this._pathVerticalPlaneEnabled=!1,this._pathVerticalPlaneData=null,this._pathTechnique=null,this.canRender=!0,this._passParameters=ke(e,new Lt)}get renderSlots(){return[this._config.contrastControlEnabled?k.LASERLINES_CONTRAST_CONTROL:k.LASERLINES]}get needsLinearDepth(){return!0}get heightManifoldEnabled(){return this._heightManifoldEnabled}set heightManifoldEnabled(e){this._heightManifoldEnabled!==e&&(this._heightManifoldEnabled=e,this._requestRender())}get heightManifoldTarget(){return this._passParameters.heightManifoldTarget}set heightManifoldTarget(e){P(this._passParameters.heightManifoldTarget,e),this._requestRender()}get pointDistanceEnabled(){return this._pointDistanceEnabled}set pointDistanceEnabled(e){e!==this._pointDistanceEnabled&&(this._pointDistanceEnabled=e,this._requestRender())}get pointDistanceTarget(){return this._passParameters.pointDistanceTarget}set pointDistanceTarget(e){P(this._passParameters.pointDistanceTarget,e),this._requestRender()}get pointDistanceOrigin(){return this._passParameters.pointDistanceOrigin}set pointDistanceOrigin(e){P(this._passParameters.pointDistanceOrigin,e),this._requestRender()}get lineVerticalPlaneEnabled(){return this._lineVerticalPlaneEnabled}set lineVerticalPlaneEnabled(e){e!==this._lineVerticalPlaneEnabled&&(this._lineVerticalPlaneEnabled=e,this._requestRender())}get lineVerticalPlaneSegment(){return this._passParameters.lineVerticalPlaneSegment}set lineVerticalPlaneSegment(e){T(e,this._passParameters.lineVerticalPlaneSegment),this._requestRender()}get intersectsLineEnabled(){return this._intersectsLineEnabled}set intersectsLineEnabled(e){e!==this._intersectsLineEnabled&&(this._intersectsLineEnabled=e,this._requestRender())}get intersectsLineSegment(){return this._passParameters.intersectsLineSegment}set intersectsLineSegment(e){T(e,this._passParameters.intersectsLineSegment),this._requestRender()}get intersectsLineRadius(){return this._passParameters.intersectsLineRadius}set intersectsLineRadius(e){e!==this._passParameters.intersectsLineRadius&&(this._passParameters.intersectsLineRadius=e,this._requestRender())}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(e){e!==this._intersectsLineInfinite&&(this._intersectsLineInfinite=e,this._requestRender())}get viewingMode(){return this._viewingMode}set viewingMode(e){e!==this._viewingMode&&(this._viewingMode=e,this._requestRender())}get pathVerticalPlaneEnabled(){return this._pathVerticalPlaneEnabled}set pathVerticalPlaneEnabled(e){e!==this._pathVerticalPlaneEnabled&&(this._pathVerticalPlaneEnabled=e,this._pathVerticalPlaneData!=null&&this._requestRender())}set pathVerticalPlaneVertices(e){this._pathVerticalPlaneData==null&&(this._pathVerticalPlaneData=new ie(this._passParameters.renderCoordsHelper)),this._pathVerticalPlaneData.vertices=e,this.pathVerticalPlaneEnabled&&this._requestRender()}set pathVerticalPlaneBuffers(e){this._pathVerticalPlaneData==null&&(this._pathVerticalPlaneData=new ie(this._passParameters.renderCoordsHelper)),this._pathVerticalPlaneData.buffers=e,this.pathVerticalPlaneEnabled&&this._requestRender()}setParameters(e){Xe(this._passParameters,e)&&this._requestRender()}initializeRenderContext(e){this._context=e;const i=e.renderContext.rctx;this._quadVAO=Ze(i),this._techniqueRepository=e.techniqueRepository,this._techniqueConfig=new V;const t=new N;t.contrastControlEnabled=this._config.contrastControlEnabled,this._pathTechnique=this._techniqueRepository.acquire(O,t)}uninitializeRenderContext(){this._quadVAO=X(this._quadVAO),this._technique=Z(this._technique),this._pathVerticalPlaneData=X(this._pathVerticalPlaneData),this._pathTechnique=Z(this._pathTechnique)}prepareTechnique(){return this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled?(this._techniqueConfig.heightManifoldEnabled=this.heightManifoldEnabled,this._techniqueConfig.lineVerticalPlaneEnabled=this.lineVerticalPlaneEnabled,this._techniqueConfig.pointDistanceEnabled=this.pointDistanceEnabled,this._techniqueConfig.intersectsLineEnabled=this.intersectsLineEnabled,this._techniqueConfig.contrastControlEnabled=this._config.contrastControlEnabled,this._techniqueConfig.spherical=this._viewingMode===F.Global,this._technique=this._techniqueRepository.releaseAndAcquire(I,this._techniqueConfig,this._technique),this._technique):this._pathTechnique}render(e,i){(this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled)&&this._renderUnified(e,i),this.pathVerticalPlaneEnabled&&this._renderPath(e)}_renderUnified(e,i){const t=e.rctx;this._updatePassParameters(e),t.bindTechnique(i,this._passParameters,e.bindParameters),t.bindVAO(this._quadVAO),t.drawArrays(me.TRIANGLE_STRIP,0,4)}_renderPath(e){if(this._pathVerticalPlaneData==null||this._pathTechnique==null)return;const i=e.rctx,t=this._pathTechnique;i.bindTechnique(t,{...this._passParameters,origin:this._pathVerticalPlaneData.origin},e.bindParameters),this._pathVerticalPlaneData.draw(e.rctx)}_updatePassParameters(e){if(!this._intersectsLineEnabled)return;const i=e.bindParameters.camera;if(this._intersectsLineInfinite){if(Je(Ke(this._passParameters.intersectsLineSegment.origin,this._passParameters.intersectsLineSegment.vector),D),D.c0=-Number.MAX_VALUE,!Qe(i.frustum,D))return;Ye(D,this._passParameters.lineStartWorld),et(D,this._passParameters.lineEndWorld)}else P(this._passParameters.lineStartWorld,this._passParameters.intersectsLineSegment.origin),xe(this._passParameters.lineEndWorld,this._passParameters.intersectsLineSegment.origin,this._passParameters.intersectsLineSegment.vector)}_requestRender(){this._context&&this._context.requestRender()}}const D=Fe();class Ot extends dt{constructor(e){super(e.view),this._angleCutoff=Ve,this._style={},this._heightManifoldTarget=o(),this._heightManifoldEnabled=!1,this._intersectsLine=q(),this._intersectsLineEnabled=!1,this._intersectsLineInfinite=!1,this._lineVerticalPlaneSegment=null,this._pathVerticalPlaneBuffers=null,this._pointDistanceLine=null,this.applyProps(e)}get testData(){return this._renderer}createResources(){this._ensureRenderer()}destroyResources(){this._disposeRenderer()}updateVisibility(){this._syncRenderer(),this._syncHeightManifold(),this._syncIntersectsLine(),this._syncPathVerticalPlane(),this._syncLineVerticalPlane(),this._syncPointDistance()}get angleCutoff(){return this._angleCutoff}set angleCutoff(e){this._angleCutoff!==e&&(this._angleCutoff=e,this._syncAngleCutoff())}get style(){return this._style}set style(e){this._style=e,this._syncStyle()}get heightManifoldTarget(){return this._heightManifoldEnabled?this._heightManifoldTarget:null}set heightManifoldTarget(e){e!=null?(P(this._heightManifoldTarget,e),this._heightManifoldEnabled=!0):this._heightManifoldEnabled=!1,this._syncRenderer(),this._syncHeightManifold()}set intersectsWorldUpAtLocation(e){if(e==null)return void(this.intersectsLine=null);const i=this.view.renderCoordsHelper.worldUpAtPosition(e,Ct);this.intersectsLine=tt(e,i),this.intersectsLineInfinite=!0}get intersectsLine(){return this._intersectsLineEnabled?this._intersectsLine:null}set intersectsLine(e){e!=null?(T(e,this._intersectsLine),this._intersectsLineEnabled=!0):this._intersectsLineEnabled=!1,this._syncIntersectsLine(),this._syncRenderer()}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(e){this._intersectsLineInfinite=e,this._syncIntersectsLineInfinite()}get lineVerticalPlaneSegment(){return this._lineVerticalPlaneSegment}set lineVerticalPlaneSegment(e){this._lineVerticalPlaneSegment=e!=null?T(e):null,this._syncLineVerticalPlane(),this._syncRenderer()}get pathVerticalPlane(){return this._pathVerticalPlaneBuffers}set pathVerticalPlane(e){this._pathVerticalPlaneBuffers=e,this._syncPathVerticalPlane(),this._syncLineVerticalPlane(),this._syncPointDistance(),this._syncRenderer()}get pointDistanceLine(){return this._pointDistanceLine}set pointDistanceLine(e){this._pointDistanceLine=e!=null?{origin:J(e.origin),target:e.target?J(e.target):null}:null,this._syncPointDistance(),this._syncRenderer()}_syncRenderer(){this.attached&&this.visible&&(this._intersectsLineEnabled||this._heightManifoldEnabled||this._pointDistanceLine!=null||this._pathVerticalPlaneBuffers!=null)?this._ensureRenderer():this._disposeRenderer()}_ensureRenderer(){this._renderer==null&&(this._renderer=new St({renderCoordsHelper:this.view.renderCoordsHelper},{contrastControlEnabled:!0}),this._renderer.viewingMode=this.view.state.viewingMode,this._syncStyle(),this._syncHeightManifold(),this._syncIntersectsLine(),this._syncIntersectsLineInfinite(),this._syncPathVerticalPlane(),this._syncLineVerticalPlane(),this._syncPointDistance(),this._syncAngleCutoff(),this.view._stage&&this.view._stage.addRenderPlugin(this._renderer.renderSlots,this._renderer))}_syncStyle(){this._renderer!=null&&(this._renderer.setParameters(this._style),this._style.intersectsLineRadius!=null&&(this._renderer.intersectsLineRadius=this._style.intersectsLineRadius))}_syncAngleCutoff(){this._renderer!=null&&this._renderer.setParameters({angleCutoff:this._angleCutoff})}_syncHeightManifold(){this._renderer!=null&&(this._renderer.heightManifoldEnabled=this._heightManifoldEnabled&&this.visible,this._heightManifoldEnabled&&(this._renderer.heightManifoldTarget=this._heightManifoldTarget))}_syncIntersectsLine(){this._renderer!=null&&(this._renderer.intersectsLineEnabled=this._intersectsLineEnabled&&this.visible,this._intersectsLineEnabled&&(this._renderer.intersectsLineSegment=this._intersectsLine))}_syncIntersectsLineInfinite(){this._renderer!=null&&(this._renderer.intersectsLineInfinite=this._intersectsLineInfinite)}_syncPathVerticalPlane(){this._renderer!=null&&(this._renderer.pathVerticalPlaneEnabled=this._pathVerticalPlaneBuffers!=null&&this.visible,this._pathVerticalPlaneBuffers!=null&&(this._renderer.pathVerticalPlaneBuffers=this._pathVerticalPlaneBuffers))}_syncLineVerticalPlane(){this._renderer!=null&&(this._renderer.lineVerticalPlaneEnabled=this._lineVerticalPlaneSegment!=null&&this.visible,this._lineVerticalPlaneSegment!=null&&(this._renderer.lineVerticalPlaneSegment=this._lineVerticalPlaneSegment))}_syncPointDistance(){if(this._renderer==null)return;const e=this._pointDistanceLine,i=e!=null;this._renderer.pointDistanceEnabled=i&&e.target!=null&&this.visible,i&&(this._renderer.pointDistanceOrigin=e.origin,e.target!=null&&(this._renderer.pointDistanceTarget=e.target))}_disposeRenderer(){this._renderer!=null&&this.view._stage&&(this.view._stage.removeRenderPlugin(this._renderer),this._renderer=null)}}const Ct=o();class It{constructor(e){this.view=null,this._geometry=null,this._size=3,this._color=K(1,0,1,1),this._pixelSnappingEnabled=!0,this._primitive="square",this._outlineSize=1,this._outlineColor=K(1,1,1,1),this._elevationInfo=null,this._resources=new ut({view:e.view,createResources:t=>this._createResources(t),destroyResources:t=>this._destroyResources(t),recreateGeometry:(t,n)=>{t.geometry=this._recreateGeometry(n,t.material)}});let i=!0;for(const t in e)t in this?t==="attached"?i=e[t]??!1:this[t]=e[t]:console.error("Cannot set unknown property",t);this.attached=i}destroy(){this._resources.destroy()}get visible(){return this._resources.visible}set visible(e){this._resources.visible=e}get attached(){return this._resources.attached}set attached(e){this._resources.attached=e}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this._resources.recreateGeometry()}get size(){return this._size}set size(e){if(e!==this._size){const i=this._preferredTextureSize;this._size=e,ie,this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),n&&(typeof n=="function"?this._toBBox=n:this._initFormat(n)),this.clear()}destroy(){this.clear(),_.prune(),X.prune(),d.prune(),Y.prune()}all(t){this._all(this._data,t)}search(t,n){let e=this._data;const i=this._toBBox;if(M(t,e))for(_.clear();e;){for(let s=0,a=e.children.length;s0;){if(e||(e=j(d.pop()),i=d.data[d.length-1],s=Y.pop()??0,a=!0),e.leaf&&(n=v(e.children,t,e.children.length,e.indexHint),n!==-1))return e.children.splice(n,1),d.push(e),this._condense(d),this;a||e.leaf||!E(e,r)?i?(s++,e=i.children[s],a=!1):e=null:(d.push(e),Y.push(s),s=0,i=e,e=e.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_all(t,n){let e=t;for(X.clear();e;){if(e.leaf===!0)for(const i of e.children)n(i);else X.pushArray(e.children);e=X.pop()??null}}_build(t,n,e,i){const s=e-n+1;let a=this._maxEntries;if(s<=a){const l=new B(t.slice(n,e+1));return x(l,this._toBBox),l}i||(i=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/a**(i-1)));const r=new S([]);r.height=i;const o=Math.ceil(s/a),c=o*Math.ceil(Math.sqrt(a));R(t,n,e,c,this._compareMinX);for(let l=n;l<=e;l+=c){const m=Math.min(l+c-1,e);R(t,l,m,o,this._compareMinY);for(let u=l;u<=m;u+=o){const y=Math.min(u+o-1,m);r.children.push(this._build(t,u,y,i-1))}}return x(r,this._toBBox),r}_chooseSubtree(t,n,e,i){for(;i.push(n),n.leaf!==!0&&i.length-1!==e;){let s,a=1/0,r=1/0;for(let o=0,c=n.children.length;o=0&&d.data[n].children.length>this._maxEntries;)this._split(d,n),n--;this._adjustParentBBoxes(s,d,n)}_split(t,n){const e=t.data[n],i=e.children.length,s=this._minEntries;this._chooseSplitAxis(e,s,i);const a=this._chooseSplitIndex(e,s,i);if(!a)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const r=e.children.splice(a,e.children.length-a),o=e.leaf?new B(r):new S(r);o.height=e.height,x(e,this._toBBox),x(o,this._toBBox),n?t.data[n-1].children.push(o):this._splitRoot(e,o)}_splitRoot(t,n){this._data=new S([t,n]),this._data.height=t.height+1,x(this._data,this._toBBox)}_chooseSplitIndex(t,n,e){let i,s,a;i=s=1/0;for(let r=n;r<=e-n;r++){const o=f(t,0,r,this._toBBox),c=f(t,r,e,this._toBBox),l=N(o,c),m=b(o)+b(c);l=n;c--){const l=t.children[c];p(r,t.leaf?s(l):l),o+=g(r)}return o}_adjustParentBBoxes(t,n,e){for(let i=e;i>=0;i--)p(n.data[i],t)}_condense(t){for(let n=t.length-1;n>=0;n--){const e=t.data[n];if(e.children.length===0)if(n>0){const i=t.data[n-1],s=i.children;s.splice(v(s,e,s.length,i.indexHint),1)}else this.clear();else x(e,this._toBBox)}}_initFormat(t){const n=["return a"," - b",";"];this._compareMinX=new Function("a","b",n.join(t[0])),this._compareMinY=new Function("a","b",n.join(t[1])),this._toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}function x(h,t){f(h,0,h.children.length,t,h)}function f(h,t,n,e,i){i||(i=new B([])),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let s,a=t;a=h.minX&&t.maxY>=h.minY}function R(h,t,n,e,i){const s=[t,n];for(;s.length;){const a=j(s.pop()),r=j(s.pop());if(a-r<=e)continue;const o=r+Math.ceil((a-r)/e/2)*e;D(h,o,r,a,i),s.push(r,o,o,a)}}const _=new w,X=new w,d=new w,Y=new w({deallocator:void 0});class O{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class $ extends O{constructor(){super(...arguments),this.height=1,this.indexHint=new A}}class B extends ${constructor(t){super(),this.children=t,this.leaf=!0}}class S extends ${constructor(t){super(),this.children=t,this.leaf=!1}}export{q as h}; diff --git a/assets/Popup-db207f4c.js b/assets/Popup-db207f4c.js new file mode 100644 index 0000000..90dfa39 --- /dev/null +++ b/assets/Popup-db207f4c.js @@ -0,0 +1,2 @@ +import{bz as Ce,cd as ft,u0 as si,ds as Zn,kp as ea,u1 as Wr,u2 as Ur,u3 as Yr,u4 as qr,bA as Gr,cF as Ks,cG as ta,u5 as ia,cc as Kr,u6 as sa,aF as Ze,ai as g,aj as m,f4 as yt,aK as Lt,al as X,ao as vt,aG as F,ag as oe,ar as H,hf as ra,m8 as Te,m9 as Be,aT as et,u7 as ai,aw as C,ma as _,mc as Ci,u8 as Xs,u9 as mt,ua as na,bI as aa,cX as Os,lX as oa,cD as Xr,bh as Qr,ub as Mt,uc as la,dn as ha,fv as da,fp as _t,bR as ua,at as ca,dZ as Li,ud as pa,fj as _i,ee as ga,mb as Fe,ue as bs,uf as Pt,ug as fa,uh as Jr,cH as ma,ui as _a,uj as ys,uk as ba,cz as ya,am as Zr,lC as qi,aR as Gi,ah as en,hy as tn,af as Bi,bn as va,cu as wa,aC as Ti,fA as xa,ul as Ri,um as sn,kt as Ma,cn as rn,un as Pa,uo as ka,up as Ki,s4 as Aa,s6 as Ca,uq as Ta,ur as Ea,bg as Ia,aH as Oa,i8 as Da,iY as Fa,aA as Qs,us as Js,c7 as Sa,ow as Zs,ut as $a,cT as La,uu as Ye}from"./index-080e108a.js";import{v as Ba}from"./unitFormatUtils-b70a7bff.js";import{l as Ra}from"./AttachmentInfo-cb670dd0.js";import{c as er}from"./AttachmentQuery-972bbd60.js";import{e as nn,t as ja}from"./widget-78e8b6fe.js";import{a as Na}from"./jsonUtils-f73b3833.js";import{m as Va,b as Xi}from"./Query-1c961d4c.js";import{s as Qi}from"./executeQueryJSON-7c41ada5.js";import"./normalizeUtils-cf8b8053.js";import"./pbf-d9aa3914.js";import"./FeatureSet-111cb247.js";import vs from"./RelationshipQuery-39c07195.js";import"./TopFeaturesQuery-e44d05be.js";import Ha from"./FeatureLayer-5c6d2c3b.js";function za(s){return e=>{e.hasOwnProperty("_delegatedEventNames")||(e._delegatedEventNames=e._delegatedEventNames?e._delegatedEventNames.slice():[]);const t=e._delegatedEventNames,i=Array.isArray(s)?s:Wa(s);t.push(...i)}}function Wa(s){return s.split(",").map(e=>e.trim())}function Ds(s,e,t,i){let r=null,n=1e3;typeof e=="number"?(n=e,i=t):(r=e??null,n=t);let a,o=0;const l=()=>{o=0,s.apply(i,a)},h=(...f)=>{r&&r.apply(i,f),a=f,n?o||(o=setTimeout(l,n)):l()};return h.remove=()=>{o&&(clearTimeout(o),o=0)},h.forceUpdate=()=>{o&&(clearTimeout(o),l())},h.hasPendingUpdates=()=>!!o,h}const Ua="esri.widgets.Feature.support.featureUtils",tr=Ce.getLogger(Ua),Ya=/href=(""|'')/gi,qa=/(\{([^\{\r\n]+)\})/g,Ga=/\'/g,an=/^\s*expression\//i,Ka=/(\n)/gi,Xa=/[\u00A0-\u9999<>\&]/gim,Qa=/href\s*=\s*(?:\"([^\"]+)\"|\'([^\']+)\')/gi,Ja=/^(?:mailto:|tel:)/,on="relationships/",ir=Wr("short-date-short-time");function ln(s){if(s!=null)return s.get("sourceLayer")||s.get("layer")}async function Ei(s,e){return typeof s=="function"?s(e):s}function hn(s=""){if(s)return!Ja.test(s.trim().toLowerCase())}function Fs(s){return!!s&&an.test(s)}function Za(s,e){if(!Fs(e)||!s)return null;const t=e.replace(an,"").toLowerCase();let i=null;return s.some(r=>r.name.toLowerCase()===t&&(i=r,!0)),i}function dn(s,e){const t=Za(e,s==null?void 0:s.fieldName);return t?t.title||null:s?s.label||s.fieldName:null}function eo(s,e){const t=e.get(s.toLowerCase());return`{${t&&t.fieldName||s}}`}function to(s){return s.replaceAll(Ya,"")}function ri(s,e){const t=Ss(e,s);return t?t.name:s}function io(s,e){return s&&s.map(t=>ri(t,e))}function Ss(s,e){return s&&typeof s.getField=="function"&&e?s.getField(e)??null:null}function un(s){return`${s}`.trim()}function ht({attributes:s,globalAttributes:e,layer:t,text:i,expressionAttributes:r,fieldInfoMap:n}){return i?ws({formattedAttributes:e,template:ao(i,{...e,...r,...s},t),fieldInfoMap:n}):""}function ws({formattedAttributes:s,template:e,fieldInfoMap:t}){return un(to(ft(ft(e,i=>eo(i,t)),s)))}function so(s,e,t=!1){const i=e[s];if(typeof i=="string"){const r="%27",n=(t?encodeURIComponent(i):i).replaceAll(Ga,r);e[s]=n}}function ro(s,e=!1){const t={...s};return Object.keys(t).forEach(i=>so(i,t,e)),t}function no(s,e,t){const i=(e=un(e))&&e[0]!=="{";return ft(s,ro(t,i||!1))}function xs(s,e){return s.replaceAll(qa,(t,i,r)=>{const n=Ss(e,r);return n?`{${n.name}}`:i})}function ao(s,e,t){const i=xs(s,t);return i&&i.replaceAll(Qa,(r,n,a)=>no(r,n||a,e))}function oo(s,e){if(typeof s=="string"&&e&&e.dateFormat==null&&(e.places!=null||e.digitSeparator!=null)){const t=Number(s);if(!isNaN(t))return t}return s}function sr(s){return s!=null&&typeof s=="object"&&"layer"in s&&!!s.layer}function lo(s){return s!=null&&typeof s=="object"&&"type"in s&&s.type==="map-image"}function ho(s){return s!=null&&typeof s=="object"&&"fieldsIndex"in s&&"geometryType"in s&&"getField"in s&&"load"in s&&"loaded"in s&&"objectIdField"in s&&"spatialReference"in s&&"type"in s&&s.type==="feature"&&"when"in s}function uo(s){return s!=null&&typeof s=="object"&&"createQuery"in s&&"queryFeatureCount"in s&&"queryObjectIds"in s&&"queryRelatedFeatures"in s&&"queryRelatedFeaturesCount"in s&&"relationships"in s}function cn(s){return ho(s)&&uo(s)}function co(s,e){var f;const{fieldInfos:t,fieldName:i,preventPlacesFormatting:r,layer:n}=e,a=pn(t,i),o=a==null?void 0:a.clone(),l=Ss(n,i);if(o&&!Ks(i)){const u=l==null?void 0:l.type;if(u==="date"||u==="date-only"||u==="time-only"||u==="timestamp-offset"||(f=o.format)!=null&&f.dateFormat){const p=o.format??new ta;if(p.dateFormat??(p.dateFormat=u==="date-only"?"short-date":"short-date-short-time"),typeof s=="number"){const d=!sr(n)&&ia(n)&&n.datesInUnknownTimezone||sr(n)&&lo(n.layer)&&n.layer.datesInUnknownTimezone;return p.formatDate(s,d)}switch(u){case"date-only":return p.formatDateOnly(s);case"time-only":return p.formatTimeOnly(s);case"timestamp-offset":return p.formatTimestamp(s)}}}const h=o==null?void 0:o.format;return typeof s=="string"&&Ks(i)&&h?h.formatRasterPixelValue(s):typeof(s=oo(s,h))=="string"||s==null||h==null?oi(s):r?Kr(s,{...sa(h),minimumFractionDigits:0,maximumFractionDigits:20}):h.formatNumber(s)}function pn(s,e){if(s&&s.length&&e)return s.find(t=>{var i;return((i=t.fieldName)==null?void 0:i.toLowerCase())===e.toLowerCase()})}function po({fieldName:s,graphic:e,layer:t}){if(Ve(s)||!t||typeof t.getFeatureType!="function")return null;const{typeIdField:i}=t;if(!i||s!==i)return null;const r=t.getFeatureType(e);return r?r.name:null}function go({fieldName:s,value:e,graphic:t,layer:i}){if(Ve(s)||!i||typeof i.getFieldDomain!="function")return null;const r=t&&i.getFieldDomain(s,{feature:t});return r&&r.type==="coded-value"?r.getName(e):null}function fo(s,e){const{creatorField:t,creationDateField:i,editorField:r,editDateField:n}=s;if(!e)return;const a=e[n];if(typeof a=="number"){const l=e[r];return{type:"edit",date:si(a,ir),user:l}}const o=e[i];if(typeof o=="number"){const l=e[t];return{type:"create",date:si(o,ir),user:l}}return null}function mo(s,e){const t=new Map;return s&&s.forEach(i=>{const r=ri(i.fieldName,e);i.fieldName=r,t.set(r.toLowerCase(),i)}),t}function rr(s){const e=[];if(!s)return e;const{fieldInfos:t,content:i}=s;return t&&e.push(...t),i&&Array.isArray(i)&&i.forEach(r=>{if(r.type==="fields"){const n=r&&r.fieldInfos;n&&e.push(...n)}}),e}function $s(s){return s.replaceAll(Xa,e=>`&#${e.charCodeAt(0)};`)}function oi(s){return typeof s=="string"?s.replaceAll(Ka,'
'):s}function gn(s){var h,f;const{value:e,fieldName:t,fieldInfos:i,fieldInfoMap:r,layer:n,graphic:a}=s;if(e==null)return"";const o=go({fieldName:t,value:e,graphic:a,layer:n});if(o)return o;const l=po({fieldName:t,graphic:a,layer:n});if(l)return l;if(r.get(t.toLowerCase()))return co(e,{fieldInfos:i||Array.from(r.values()),fieldName:t,layer:n});switch((f=(h=n==null?void 0:n.fieldsIndex)==null?void 0:h.get(t))==null?void 0:f.type){case"date":return si(e);case"date-only":return qr(e);case"time-only":return Yr(e);case"timestamp-offset":return Ur(e)}return oi(e)}function Ji({fieldInfos:s,attributes:e,layer:t,graphic:i,fieldInfoMap:r,relatedInfos:n}){const a={};return n==null||n.forEach(o=>vo({attributes:a,relatedInfo:o,fieldInfoMap:r,fieldInfos:s,layer:t})),e&&Object.keys(e).forEach(o=>{const l=e[o];a[o]=gn({fieldName:o,fieldInfos:s,fieldInfoMap:r,layer:t,value:l,graphic:i})}),a}async function fn(s,e){var f,u;const{layer:t,graphic:i,outFields:r,objectIds:n,returnGeometry:a,spatialReference:o}=s,l=n[0];if(typeof l!="number"&&typeof l!="string"){const p="Could not query required fields for the specified feature. The feature's ID is invalid.",d={layer:t,graphic:i,objectId:l,requiredFields:r};return tr.warn(p,d),null}if(!((u=(f=Zn(t))==null?void 0:f.operations)!=null&&u.supportsQuery)){const p="The specified layer cannot be queried. The following fields will not be available.",d={layer:t,graphic:i,requiredFields:r,returnGeometry:a};return tr.warn(p,d),null}const h=t.createQuery();return h.objectIds=n,h.outFields=r!=null&&r.length?r:[t.objectIdField],h.returnGeometry=!!a,h.returnZ=!!a,h.returnM=!!a,h.outSpatialReference=o,(await t.queryFeatures(h,e)).features[0]}async function _o(s){var i;if(!((i=s.expressionInfos)!=null&&i.length))return!1;const e=await Gr(),{arcadeUtils:{hasGeometryFunctions:t}}=e;return t(s)}async function bo({graphic:s,popupTemplate:e,layer:t,spatialReference:i},r){if(!t||!e||(typeof t.load=="function"&&await t.load(r),!s.attributes))return;const n=s.attributes[t.objectIdField];if(n==null)return;const a=[n],o=await e.getRequiredFields(t.fieldsIndex),l=ea(o,s),h=l?[]:o,f=e.returnGeometry||await _o(e);if(l&&!f)return;const u=await fn({layer:t,graphic:s,outFields:h,objectIds:a,returnGeometry:f,spatialReference:i},r);u&&(u.geometry&&(s.geometry=u.geometry),u.attributes&&(s.attributes={...s.attributes,...u.attributes}))}function Ve(s=""){return!!s&&s.includes(on)}function yo(s){return s?`${on}${s.layerId}/${s.fieldName}`:""}function nr({attributes:s,graphic:e,relatedInfo:t,fieldInfos:i,fieldInfoMap:r,layer:n}){s&&e&&t&&Object.keys(e.attributes).forEach(a=>{const o=yo({layerId:t.relation.id.toString(),fieldName:a}),l=e.attributes[a];s[o]=gn({fieldName:o,fieldInfos:i,fieldInfoMap:r,layer:n,value:l,graphic:e})})}function vo({attributes:s,relatedInfo:e,fieldInfoMap:t,fieldInfos:i,layer:r}){s&&e&&(e.relatedFeatures&&e.relatedFeatures&&e.relatedFeatures.forEach(n=>nr({attributes:s,graphic:n,relatedInfo:e,fieldInfoMap:t,fieldInfos:i,layer:r})),e.relatedStatsFeatures&&e.relatedStatsFeatures&&e.relatedStatsFeatures.forEach(n=>nr({attributes:s,graphic:n,relatedInfo:e,fieldInfoMap:t,fieldInfos:i,layer:r})))}const ar=s=>{if(!s)return!1;const e=s.toUpperCase();return e.includes("CURRENT_TIMESTAMP")||e.includes("CURRENT_DATE")||e.includes("CURRENT_TIME")},mn=({layer:s,method:e,query:t,definitionExpression:i})=>{var a,o;if(!((o=(a=s.capabilities)==null?void 0:a.query)!=null&&o.supportsCacheHint)||e==="attachments")return;const r=t.where!=null?t.where:null,n=t.geometry!=null?t.geometry:null;ar(i)||ar(r)||(n==null?void 0:n.type)==="extent"||t.resultType==="tile"||(t.cacheHint=!0)},wo=({query:s,layer:e,method:t})=>{mn({layer:e,method:t,query:s,definitionExpression:`${e.definitionExpression} ${e.serviceDefinitionExpression}`})},xo=({queryPayload:s,layer:e,method:t})=>{mn({layer:e,method:t,query:s,definitionExpression:`${e.definitionExpression} ${e.serviceDefinitionExpression}`})};function Mo(s,e,t){return s&&e&&t?or(s.allLayers,e,t)||or(s.allTables,e,t):null}function or(s,e,t){return s.filter(cn).find(i=>i!==e&&i.url===e.url&&i.layerId===t.relatedTableId)}const lr={editing:!1,operations:{add:!0,update:!0,delete:!0}},_n=Ze.ofType(Ra);let me=class extends vt{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.capabilities={...lr},this.activeAttachmentInfo=null,this.activeFileInfo=null,this.attachmentInfos=new _n,this.fileInfos=new Ze,this.graphic=null,this.mode="view",this.filesEnabled=!1,this.addHandles(F(()=>this.graphic,()=>this._graphicChanged(),oe))}destroy(){this._attachmentLayer=null,this.graphic=null}castCapabilities(e){return{...lr,...e}}get state(){return this._getAttachmentsPromise?"loading":this.graphic?"ready":"disabled"}get supportsResizeAttachments(){const{graphic:e}=this;if(!e)return!1;const t=e.layer||e.sourceLayer;return(t==null?void 0:t.loaded)&&"capabilities"in t&&t.capabilities&&"operations"in t.capabilities&&"supportsResizeAttachments"in t.capabilities.operations&&t.capabilities.operations.supportsResizeAttachments||!1}async getAttachments(){const{_attachmentLayer:e,attachmentInfos:t}=this;if(!e||typeof e.queryAttachments!="function")throw new H("invalid-layer","getAttachments(): A valid layer is required.");const i=this._getObjectId(),r=new er({objectIds:[i],returnMetadata:!0}),n=[],a=e.queryAttachments(r).then(l=>l[i]||n).catch(()=>n);this._getAttachmentsPromise=a,this.notifyChange("state");const o=await a;return t.removeAll(),o.length&&t.addMany(o),this._getAttachmentsPromise=null,this.notifyChange("state"),o}async addAttachment(e,t=this.graphic){var l;const{_attachmentLayer:i,attachmentInfos:r,capabilities:n}=this;if(!t)throw new H("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:t});if(!e)throw new H("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!((l=n.operations)!=null&&l.add))throw new H("invalid-capabilities","addAttachment(): add capabilities are required.");if(!i||typeof i.addAttachment!="function")throw new H("invalid-layer","addAttachment(): A valid layer is required.");const a=i.addAttachment(t,e).then(h=>this._queryAttachment(h.objectId,t)),o=await a;return r.add(o),o}async deleteAttachment(e){var l;const{_attachmentLayer:t,attachmentInfos:i,graphic:r,capabilities:n}=this;if(!e)throw new H("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!((l=n.operations)!=null&&l.delete))throw new H("invalid-capabilities","deleteAttachment(): delete capabilities are required.");if(!t||typeof t.deleteAttachments!="function")throw new H("invalid-layer","deleteAttachment(): A valid layer is required.");if(!r)throw new H("invalid-graphic","deleteAttachment(): A graphic is required.");const a=t.deleteAttachments(r,[e.id]).then(()=>e),o=await a;return i.remove(o),o}async updateAttachment(e,t=this.activeAttachmentInfo){var f;const{_attachmentLayer:i,attachmentInfos:r,graphic:n,capabilities:a}=this;if(!e)throw new H("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!t)throw new H("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:t});if(!((f=a.operations)!=null&&f.update))throw new H("invalid-capabilities","updateAttachment(): Update capabilities are required.");const o=r.findIndex(u=>u===t);if(!i||typeof i.updateAttachment!="function")throw new H("invalid-layer","updateAttachment(): A valid layer is required.");if(!n)throw new H("invalid-graphic","updateAttachment(): A graphic is required.");const l=i.updateAttachment(n,t.id,e).then(u=>this._queryAttachment(u.objectId)),h=await l;return r.splice(o,1,h),h}async commitFiles(){return await Promise.all(this.fileInfos.items.map(e=>this.addAttachment(e.form))),this.fileInfos.removeAll(),this.getAttachments()}addFile(e,t){if(!e||!t)return null;const i={file:e,form:t};return this.fileInfos.add(i),i}updateFile(e,t,i=this.activeFileInfo){if(!e||!t||!i)return null;const r=this.fileInfos.findIndex(n=>i===n);return r>-1&&this.fileInfos.splice(r,1,{file:e,form:t}),this.fileInfos.items[r]}deleteFile(e){const t=this.fileInfos.find(i=>i.file===e);return t?(this.fileInfos.remove(t),t):null}async _queryAttachment(e,t){const{_attachmentLayer:i}=this;if(!e||!(i!=null&&i.queryAttachments))throw new H("invalid-attachment-id","Could not query attachment.");const r=this._getObjectId(t),n=new er({objectIds:[r],attachmentsWhere:`AttachmentId=${e}`,returnMetadata:!0});return i.queryAttachments(n).then(a=>a[r][0])}_getObjectId(e=this.graphic){return(e==null?void 0:e.getObjectId())??null}_graphicChanged(){this.graphic&&(this._setAttachmentLayer(),this.getAttachments().catch(()=>{}))}_setAttachmentLayer(){const{graphic:e}=this,t=ln(e);this._attachmentLayer=t?t.type==="scene"&&t.associatedLayer!=null?t.associatedLayer:t:null}};g([m()],me.prototype,"capabilities",void 0),g([yt("capabilities")],me.prototype,"castCapabilities",null),g([m()],me.prototype,"activeAttachmentInfo",void 0),g([m()],me.prototype,"activeFileInfo",void 0),g([m({readOnly:!0,type:_n})],me.prototype,"attachmentInfos",void 0),g([m()],me.prototype,"fileInfos",void 0),g([m({type:Lt})],me.prototype,"graphic",void 0),g([m()],me.prototype,"mode",void 0),g([m({readOnly:!0})],me.prototype,"state",null),g([m()],me.prototype,"filesEnabled",void 0),g([m({readOnly:!0})],me.prototype,"supportsResizeAttachments",null),me=g([X("esri.widgets.Attachments.AttachmentsViewModel")],me);const Ls=me;function hr(s){const e=s.toLowerCase();return e==="image/bmp"||e==="image/emf"||e==="image/exif"||e==="image/gif"||e==="image/x-icon"||e==="image/jpeg"||e==="image/png"||e==="image/tiff"||e==="image/x-wmf"}function Po(s){const e=ra("esri/themes/base/images/files/");return s?s==="text/plain"?`${e}text-32.svg`:s==="application/pdf"?`${e}pdf-32.svg`:s==="text/csv"?`${e}csv-32.svg`:s==="application/gpx+xml"?`${e}gpx-32.svg`:s==="application/x-dwf"?`${e}cad-32.svg`:s==="application/postscript"||s==="application/json"||s==="text/xml"||s==="model/vrml"?`${e}code-32.svg`:s==="application/x-zip-compressed"||s==="application/x-7z-compressed"||s==="application/x-gzip"||s==="application/x-tar"||s==="application/x-gtar"||s==="application/x-bzip2"||s==="application/gzip"||s==="application/x-compress"||s==="application/x-apple-diskimage"||s==="application/x-rar-compressed"||s==="application/zip"?`${e}zip-32.svg`:s.includes("image/")?`${e}image-32.svg`:s.includes("audio/")?`${e}sound-32.svg`:s.includes("video/")?`${e}video-32.svg`:s.includes("msexcel")||s.includes("ms-excel")||s.includes("spreadsheetml")?`${e}excel-32.svg`:s.includes("msword")||s.includes("ms-word")||s.includes("wordprocessingml")?`${e}word-32.svg`:s.includes("powerpoint")||s.includes("presentationml")?`${e}report-32.svg`:`${e}generic-32.svg`:`${e}generic-32.svg`}const dr={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},j="esri-attachments",st="esri-button",A={base:j,loaderContainer:`${j}__loader-container`,loader:`${j}__loader`,fadeIn:`${j}--fade-in`,container:`${j}__container`,containerList:`${j}__container--list`,containerPreview:`${j}__container--preview`,actions:`${j}__actions`,deleteButton:`${j}__delete-button`,addAttachmentButton:`${j}__add-attachment-button`,errorMessage:`${j}__error-message`,items:`${j}__items`,item:`${j}__item`,itemButton:`${j}__item-button`,itemMask:`${j}__item-mask`,itemMaskIcon:`${j}__item-mask--icon`,itemImage:`${j}__image`,itemImageResizable:`${j}__image--resizable`,itemLabel:`${j}__label`,itemFilename:`${j}__filename`,itemChevronIcon:`${j}__item-chevron-icon`,itemLink:`${j}__item-link`,itemLinkOverlay:`${j}__item-link-overlay`,itemLinkOverlayIcon:`${j}__item-link-overlay-icon`,itemEditIcon:`${j}__item-edit-icon`,itemAddIcon:`${j}__item-add-icon`,itemAddButton:`${j}__item-add-button`,formNode:`${j}__form-node`,fileFieldset:`${j}__file-fieldset`,fileLabel:`${j}__file-label`,fileName:`${j}__file-name`,fileInput:`${j}__file-input`,metadata:`${j}__metadata`,metadataFieldset:`${j}__metadata-fieldset`,progressBar:`${j}__progress-bar`,esriWidget:"esri-widget",esriButton:st,buttonDisabled:`${st}--disabled`,esriButtonSecondary:`${st}--secondary`,esriButtonTertiary:`${st}--tertiary`,esriButtonThird:`${st}--third`,esriButtonSmall:`${st}--small`,esriButtonHalf:`${st}--half`,empty:"esri-widget__content--empty",iconExternalLink:"esri-icon-link-external",iconEdit:"esri-icon-edit",iconRight:"esri-icon-right",iconLeft:"esri-icon-left",iconPlus:"esri-icon-plus"},Zi=window.CSS;let ue=class extends Be{constructor(e,t){super(e,t),this.displayType="auto",this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=null,this.visibleElements={...dr},this._supportsImageOrientation=Zi&&Zi.supports&&Zi.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}initialize(){this.viewModel||(this.viewModel=new Ls),this.addHandles([et(()=>{var e;return(e=this.viewModel)==null?void 0:e.attachmentInfos},"change",()=>this.scheduleRender()),et(()=>{var e;return(e=this.viewModel)==null?void 0:e.fileInfos},"change",()=>this.scheduleRender()),F(()=>{var e;return(e=this.viewModel)==null?void 0:e.mode},()=>this._modeChanged(),oe)])}loadDependencies(){return ai({icon:()=>C(()=>import("./calcite-icon-2c0948c4.js"),["assets/calcite-icon-2c0948c4.js","assets/icon-25aef281.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/observers-4ce6e1b4.js"])})}get capabilities(){return this.viewModel.capabilities}set capabilities(e){this.viewModel.capabilities=e}get effectiveDisplayType(){const{displayType:e}=this;return e&&e!=="auto"?e:this.viewModel.supportsResizeAttachments?"preview":"list"}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}castVisibleElements(e){return{...dr,...e}}addAttachment(){const{_addAttachmentForm:e,viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.addAttachment(e).then(i=>(this._set("submitting",!1),this._set("error",null),t.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new H("attachments:add-attachment",this.messages.addErrorMessage,i)),i})}deleteAttachment(e){const{viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.deleteAttachment(e).then(i=>(this._set("submitting",!1),this._set("error",null),t.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new H("attachments:delete-attachment",this.messages.deleteErrorMessage,i)),i})}updateAttachment(){const{viewModel:e}=this,{_updateAttachmentForm:t}=this;return this._set("submitting",!0),this._set("error",null),e.updateAttachment(t).then(i=>(this._set("submitting",!1),this._set("error",null),e.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new H("attachments:update-attachment",this.messages.updateErrorMessage,i)),i})}addFile(){const e=this.viewModel.addFile(this.selectedFile,this._addAttachmentForm);return this.viewModel.mode="view",e}updateFile(){const{viewModel:e}=this,t=e.updateFile(this.selectedFile,this._updateAttachmentForm,e.activeFileInfo);return e.mode="view",t}deleteFile(e){var i;const t=this.viewModel.deleteFile(e||((i=this.viewModel.activeFileInfo)==null?void 0:i.file));return this.viewModel.mode="view",t}render(){const{submitting:e,viewModel:t}=this,{state:i}=t;return _("div",{class:this.classes(A.base,A.esriWidget)},e?this.renderProgressBar():null,i==="loading"?this.renderLoading():this.renderAttachments(),this.renderErrorMessage())}renderErrorMessage(){const{error:e,visibleElements:t}=this;return e&&t.errorMessage?_("div",{key:"error-message",class:A.errorMessage},e.message):null}renderAttachments(){const{activeFileInfo:e,mode:t,activeAttachmentInfo:i}=this.viewModel;return t==="add"?this.renderAddForm():t==="edit"?this.renderDetailsForm(i||e):this.renderAttachmentContainer()}renderLoading(){return _("div",{class:A.loaderContainer,key:"loader"},_("div",{class:A.loader}))}renderProgressBar(){return this.visibleElements.progressBar?_("div",{class:A.progressBar,key:"progress-bar"}):null}renderAddForm(){const{submitting:e,selectedFile:t}=this,i=e||!t,r=this.visibleElements.cancelAddButton?_("button",{type:"button",bind:this,disabled:e,onclick:this._cancelForm,class:this.classes(A.esriButton,A.esriButtonTertiary,A.esriButtonSmall,A.esriButtonHalf,e&&A.buttonDisabled)},this.messages.cancel):null,n=this.visibleElements.addSubmitButton?_("button",{type:"submit",disabled:i,class:this.classes(A.esriButton,A.esriButtonSecondary,A.esriButtonSmall,A.esriButtonHalf,{[A.buttonDisabled]:i})},this.messages.add):null,a=t?_("span",{key:"file-name",class:A.fileName},t.name):null,o=_("form",{bind:this,afterCreate:Ci,afterRemoved:Xs,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},_("fieldset",{class:A.fileFieldset},a,_("label",{class:this.classes(A.fileLabel,A.esriButton,A.esriButtonSecondary)},t?this.messages.changeFile:this.messages.selectFile,_("input",{class:A.fileInput,type:"file",name:"attachment",bind:this,onchange:this._handleFileInputChange}))),n,r);return _("div",{key:"add-form-container",class:A.formNode},o)}renderDetailsForm(e){var P,O,R;const{visibleElements:t,viewModel:i,selectedFile:r,submitting:n}=this,{capabilities:a}=i,o=n||!r;let l,h,f,u;r?(l=r.type,h=r.name,f=r.size):e&&"file"in e?(l=e.file.type,h=e.file.name,f=e.file.size):e&&"contentType"in e&&(l=e.contentType,h=e.name,f=e.size,u=e.url);const p=a.editing&&((P=a.operations)!=null&&P.delete)&&t.deleteButton?_("button",{key:"delete-button",type:"button",disabled:n,bind:this,onclick:S=>this._submitDeleteAttachment(S,e),class:this.classes(A.esriButton,A.esriButtonSmall,A.esriButtonTertiary,A.deleteButton,{[A.buttonDisabled]:n})},this.messages.delete):void 0,d=a.editing&&((O=a.operations)!=null&&O.update)&&t.updateButton?_("button",{disabled:o,key:"update-button",type:"submit",class:this.classes(A.esriButton,A.esriButtonSmall,A.esriButtonThird,{[A.buttonDisabled]:o})},this.messages.update):void 0,b=this.visibleElements.cancelUpdateButton?_("button",{disabled:n,key:"cancel-button",type:"button",bind:this,onclick:this._cancelForm,class:this.classes(A.esriButton,A.esriButtonSmall,A.esriButtonTertiary,A.esriButtonThird,{[A.buttonDisabled]:n})},this.messages.cancel):void 0,c=a.editing&&((R=a.operations)!=null&&R.update)?_("fieldset",{key:"file",class:A.fileFieldset},_("span",{key:"file-name",class:A.fileName},h),_("label",{class:this.classes(A.fileLabel,A.esriButton,A.esriButtonSecondary)},this.messages.changeFile,_("input",{class:A.fileInput,type:"file",name:"attachment",bind:this,onchange:this._handleFileInputChange}))):void 0,y=_("fieldset",{key:"size",class:A.metadataFieldset},_("label",null,Ba(this.messagesUnits,f??0))),v=_("fieldset",{key:"content-type",class:A.metadataFieldset},_("label",null,l)),x=u!=null?_("a",{class:A.itemLink,href:u,rel:"noreferrer",target:"_blank"},this.renderImageMask(e,400),_("div",{class:A.itemLinkOverlay},_("span",{class:A.itemLinkOverlayIcon},_("calcite-icon",{icon:"launch"})))):this.renderImageMask(e,400),w=_("form",{bind:this,afterCreate:Ci,afterRemoved:Xs,"data-node-ref":"_updateAttachmentForm",onsubmit:S=>this._submitUpdateAttachment(S,e)},_("div",{class:A.metadata},y,v),c,_("div",{class:A.actions},p,b,d));return _("div",{key:"edit-form-container",class:A.formNode},x,w)}renderImageMask(e,t){return e?"file"in e?this.renderGenericImageMask(e.file.name,e.file.type):this.renderImageMaskForAttachment(e,t):null}renderGenericImageMask(e,t){const{supportsResizeAttachments:i}=this.viewModel,r=Po(t),n={[A.itemImageResizable]:i};return _("div",{key:r,class:this.classes(A.itemMaskIcon,A.itemMask)},_("img",{title:e,alt:e,src:r,class:this.classes(n,A.itemImage)}))}renderImageMaskForAttachment(e,t){const{supportsResizeAttachments:i}=this.viewModel;if(!e)return null;const{contentType:r,name:n,url:a}=e;if(!i||!hr(r))return this.renderGenericImageMask(n,r);const o=this._getCSSTransform(e),l=o?{transform:o,"image-orientation":"none"}:{},h=`${a}${a!=null&&a.includes("?")?"&":"?"}w=${t}`,f={[A.itemImageResizable]:i};return _("div",{key:h,class:this.classes(A.itemMask)},_("img",{styles:l,alt:n,title:n,src:h,class:this.classes(f,A.itemImage)}))}renderFile(e){const{file:t}=e;return _("li",{class:A.item,key:t},_("button",{key:"details-button",bind:this,class:A.itemButton,title:this.messages.attachmentDetails,"aria-label":this.messages.attachmentDetails,onclick:()=>this._startEditFile(e),type:"button"},this.renderImageMask(e),_("label",{class:A.itemLabel},_("span",{class:A.itemFilename},t.name||this.messages.noTitle),_("span",{"aria-hidden":"true",class:this.classes(A.itemChevronIcon,mt(this.container)?A.iconLeft:A.iconRight)}))))}renderAttachmentInfo({attachmentInfo:e,displayType:t}){const{viewModel:i,effectiveDisplayType:r}=this,{capabilities:n,supportsResizeAttachments:a}=i,{contentType:o,name:l,url:h}=e,f=this.renderImageMask(e,t==="list"?48:400),u=n.editing?_("span",{"aria-hidden":"true",class:this.classes(A.itemChevronIcon,mt(this.container)?A.iconLeft:A.iconRight)}):null,p=[f,r==="preview"&&a&&hr(o)?null:_("label",{class:A.itemLabel},_("span",{class:A.itemFilename},l||this.messages.noTitle),u)],d=n.editing?_("button",{key:"details-button",bind:this,class:A.itemButton,title:this.messages.attachmentDetails,"aria-label":this.messages.attachmentDetails,"data-attachment-info-id":e.id,onclick:()=>this._startEditAttachment(e),type:"button"},p):_("a",{key:"details-link",class:A.itemButton,href:h??void 0,target:"_blank"},p);return _("li",{class:A.item,key:e},d)}renderAttachmentContainer(){var b;const{effectiveDisplayType:e,viewModel:t,visibleElements:i}=this,{attachmentInfos:r,capabilities:n,fileInfos:a}=t,o=!!(r!=null&&r.length),l=!!(a!=null&&a.length),h={[A.containerList]:e!=="preview",[A.containerPreview]:e==="preview"},f=n.editing&&((b=n.operations)!=null&&b.add)&&i.addButton?_("button",{bind:this,onclick:()=>this._startAddAttachment(),class:this.classes(A.esriButton,A.esriButtonTertiary,A.addAttachmentButton),type:"button"},_("span",{"aria-hidden":"true",class:this.classes(A.itemAddIcon,A.iconPlus)}),this.messages.add):void 0,u=o?_("ul",{key:"attachments-list",class:A.items},r.toArray().map(c=>this.renderAttachmentInfo({attachmentInfo:c,displayType:e}))):void 0,p=l?_("ul",{key:"file-list",class:A.items},a.toArray().map(c=>this.renderFile(c))):void 0,d=l||o?void 0:_("div",{class:A.empty},this.messages.noAttachments);return _("div",{key:"attachments-container",class:this.classes(A.container,h)},u,p,d,f)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){const t=e.target,i=t&&t.files&&t.files.item(0);this._set("selectedFile",i)}_submitDeleteAttachment(e,t){e.preventDefault(),t&&("file"in t?this.deleteFile(t.file):t&&this.deleteAttachment(t))}_submitAddAttachment(e){e.preventDefault(),this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(e,t){e.preventDefault(),t&&"file"in t?this.updateFile():this.updateAttachment()}_startEditAttachment(e){const{viewModel:t}=this;t.activeFileInfo=null,t.activeAttachmentInfo=e,t.mode="edit"}_startEditFile(e){const{viewModel:t}=this;t.activeAttachmentInfo=null,t.activeFileInfo=e,t.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(e){e.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(e){const{orientationInfo:t}=e;return!this._supportsImageOrientation&&t?[t.rotation?`rotate(${t.rotation}deg)`:"",t.mirrored?"scaleX(-1)":""].join(" "):""}};g([m()],ue.prototype,"capabilities",null),g([m()],ue.prototype,"displayType",void 0),g([m({readOnly:!0})],ue.prototype,"effectiveDisplayType",null),g([m()],ue.prototype,"graphic",null),g([m()],ue.prototype,"label",null),g([m(),Te("esri/widgets/Attachments/t9n/Attachments")],ue.prototype,"messages",void 0),g([m(),Te("esri/core/t9n/Units")],ue.prototype,"messagesUnits",void 0),g([m({readOnly:!0})],ue.prototype,"selectedFile",void 0),g([m({readOnly:!0})],ue.prototype,"submitting",void 0),g([m({readOnly:!0})],ue.prototype,"error",void 0),g([m({type:Ls})],ue.prototype,"viewModel",void 0),g([m()],ue.prototype,"visibleElements",void 0),g([yt("visibleElements")],ue.prototype,"castVisibleElements",null),ue=g([X("esri.widgets.Attachments")],ue);const ko=ue;let zt=class extends Ls{constructor(e){super(e),this.description=null,this.title=null}};g([m()],zt.prototype,"description",void 0),g([m()],zt.prototype,"title",void 0),zt=g([X("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],zt);const Bs=zt,Ao={heading:"esri-widget__heading"};function Rs({level:s,class:e,...t},i){const r=Co(s);return _(`h${r}`,{...t,class:na(Ao.heading,e),role:"heading","aria-level":String(r)},i)}function Co(s){return aa(Math.ceil(s),1,6)}const es="esri-feature-element-info",ts={base:es,title:`${es}__title`,description:`${es}__description`};let kt=class extends Be{constructor(e,t){super(e,t),this.description=null,this.headingLevel=2,this.title=null}render(){return _("div",{class:ts.base},this.renderTitle(),this.renderDescription())}renderTitle(){const{title:e}=this;return e?_(Rs,{level:this.headingLevel,class:ts.title},e):null}renderDescription(){const{description:e}=this;return e?_("div",{key:"description",class:ts.description},e):null}};g([m()],kt.prototype,"description",void 0),g([m()],kt.prototype,"headingLevel",void 0),g([m()],kt.prototype,"title",void 0),kt=g([X("esri.widgets.Feature.support.FeatureElementInfo")],kt);const ji=kt,To={base:"esri-feature-attachments"};let Re=class extends Be{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new ko,this.headingLevel=2,this.viewModel=new Bs}initialize(){this._featureElementInfo=new ji,this.addHandles([F(()=>{var e,t;return[(e=this.viewModel)==null?void 0:e.description,(t=this.viewModel)==null?void 0:t.title,this.headingLevel]},()=>this._setupFeatureElementInfo(),oe),F(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,oe)])}destroy(){var e;this.attachmentsWidget.viewModel=null,this.attachmentsWidget.destroy(),(e=this._featureElementInfo)==null||e.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){var t;const{attachmentsWidget:e}=this;return _("div",{class:To.base},(t=this._featureElementInfo)==null?void 0:t.render(),e==null?void 0:e.render())}_setupFeatureElementInfo(){var r;const{description:e,title:t,headingLevel:i}=this;(r=this._featureElementInfo)==null||r.set({description:e,title:t,headingLevel:i})}};g([m({readOnly:!0})],Re.prototype,"attachmentsWidget",void 0),g([m()],Re.prototype,"description",null),g([m()],Re.prototype,"displayType",null),g([m()],Re.prototype,"graphic",null),g([m()],Re.prototype,"headingLevel",void 0),g([m()],Re.prototype,"title",null),g([m({type:Bs})],Re.prototype,"viewModel",void 0),Re=g([X("esri.widgets.Feature.FeatureAttachments")],Re);const Eo=Re;let Ke=class extends Os(vt){constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.handles.add(F(()=>this.creator,t=>{this._destroyContent(),this._createContent(t)},oe))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:t,destroyer:i}=this;e&&t&&(Ei(i,{graphic:t}).catch(()=>null),this._set("created",null))}async _createContent(e){const t=this.graphic;if(!t||!e)return;const i=Ei(e,{graphic:t}).catch(()=>null);this._loadingPromise=i,this.notifyChange("state");const r=await i;i===this._loadingPromise&&(this._loadingPromise=null,this.notifyChange("state"),this._set("created",r))}};g([m({readOnly:!0})],Ke.prototype,"created",void 0),g([m()],Ke.prototype,"creator",void 0),g([m()],Ke.prototype,"destroyer",void 0),g([m({type:Lt})],Ke.prototype,"graphic",void 0),g([m({readOnly:!0})],Ke.prototype,"state",null),Ke=g([X("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],Ke);const Ii=Ke,is="esri-feature-content",ss={base:is,loaderContainer:`${is}__loader-container`,loader:`${is}__loader`};let At=class extends Be{constructor(e,t){super(e,t),this.viewModel=null,this._addTargetToAnchors=i=>{Array.from(i.querySelectorAll("a")).forEach(r=>{hn(r.href)&&!r.hasAttribute("target")&&r.setAttribute("target","_blank")})}}get creator(){var e;return(e=this.viewModel)==null?void 0:e.creator}set creator(e){this.viewModel&&(this.viewModel.creator=e)}get graphic(){var e;return(e=this.viewModel)==null?void 0:e.graphic}set graphic(e){this.viewModel&&(this.viewModel.graphic=e)}renderLoading(){return _("div",{class:ss.loaderContainer,key:"loader"},_("div",{class:ss.loader}))}renderCreated(){var t;const e=(t=this.viewModel)==null?void 0:t.created;return e?e instanceof HTMLElement?_("div",{key:e,bind:e,afterCreate:this._attachToNode}):nn(e)?_("div",{key:e},!e.destroyed&&e.render()):_("div",{key:e,innerHTML:e,afterCreate:this._addTargetToAnchors}):null}render(){var t;const e=(t=this.viewModel)==null?void 0:t.state;return _("div",{class:ss.base},e==="loading"?this.renderLoading():this.renderCreated())}_attachToNode(e){const t=this;e.appendChild(t)}};g([m()],At.prototype,"creator",null),g([m()],At.prototype,"graphic",null),g([m({type:Ii})],At.prototype,"viewModel",void 0),At=g([X("esri.widgets.Feature.FeatureContent")],At);const bi=At;let Ne=class extends vt{constructor(e){super(e),this.attributes=null,this.expressionInfos=null,this.description=null,this.fieldInfos=null,this.title=null}get formattedFieldInfos(){const{expressionInfos:e,fieldInfos:t}=this,i=[];return t==null||t.forEach(r=>{if(!(!r.hasOwnProperty("visible")||r.visible))return;const n=r.clone();n.label=dn(n,e),i.push(n)}),i}};g([m()],Ne.prototype,"attributes",void 0),g([m({type:[oa]})],Ne.prototype,"expressionInfos",void 0),g([m()],Ne.prototype,"description",void 0),g([m({type:[Xr]})],Ne.prototype,"fieldInfos",void 0),g([m({readOnly:!0})],Ne.prototype,"formattedFieldInfos",null),g([m()],Ne.prototype,"title",void 0),Ne=g([X("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],Ne);const Ni=Ne,Io=[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,target:"_blank",label:"{messages.view}"},{pattern:/^\s*(tel:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"App Studio Player"},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Collector"},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Explorer"},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Navigator"},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Survey123"},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Trek2There"},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Workforce"},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"iForm"},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"FlowFinity"},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Laserfische"},{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Microsoft Power Bi"}];function Oo(s){let e=null;return Io.some(t=>(t.pattern.test(s)&&(e=t),!!e)),e}function Do(s,e){if(typeof e!="string"||!e)return e;const t=Oo(e);if(!t)return e;const i=e.match(t.pattern),r=i&&i[2],n=ft(ft(t.label,{messages:s,hierPart:r}),{appName:t.appName}),a=t.target?` target="${t.target}"`:"",o=t.target==="_blank"?' rel="noreferrer"':"";return e.replace(t.pattern,`${n}`)}const di="esri-feature-fields",Rt={base:di,fieldHeader:`${di}__field-header`,fieldData:`${di}__field-data`,fieldDataDate:`${di}__field-data--date`,esriTable:"esri-widget__table"};let De=class extends Be{constructor(e,t){super(e,t),this._featureElementInfo=null,this.viewModel=new Ni,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new ji,this.addHandles(F(()=>{var e,t;return[(e=this.viewModel)==null?void 0:e.description,(t=this.viewModel)==null?void 0:t.title]},()=>this._setupFeatureElementInfo(),oe))}destroy(){var e;(e=this._featureElementInfo)==null||e.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(e){this.viewModel.expressionInfos=e}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(e){this.viewModel.fieldInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}renderFieldInfo(e,t){const{attributes:i}=this.viewModel,r=e.fieldName,n=e.label||r,a=i?i[r]==null?"":i[r]:"",o=!(!e.format||!e.format.dateFormat),l=typeof a=="number"&&!o?this._forceLTR(a):Do(this.messagesURIUtils,a),h={[Rt.fieldDataDate]:o};return _("tr",{key:`fields-element-info-row-${r}-${t}`},_("th",{key:`fields-element-info-row-header-${r}-${t}`,class:Rt.fieldHeader,innerHTML:n}),_("td",{key:`fields-element-info-row-data-${r}-${t}`,class:this.classes(Rt.fieldData,h),innerHTML:l}))}renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e!=null&&e.length?_("table",{class:Rt.esriTable,summary:this.messages.fieldsSummary},_("tbody",null,e.map((t,i)=>this.renderFieldInfo(t,i)))):null}render(){var e;return _("div",{class:Rt.base},(e=this._featureElementInfo)==null?void 0:e.render(),this.renderFields())}_setupFeatureElementInfo(){var i;const{description:e,title:t}=this;(i=this._featureElementInfo)==null||i.set({description:e,title:t})}_forceLTR(e){return`‎${e}`}};g([m()],De.prototype,"attributes",null),g([m()],De.prototype,"description",null),g([m()],De.prototype,"expressionInfos",null),g([m()],De.prototype,"fieldInfos",null),g([m()],De.prototype,"title",null),g([m({type:Ni,nonNullable:!0})],De.prototype,"viewModel",void 0),g([m(),Te("esri/widgets/Feature/t9n/Feature")],De.prototype,"messages",void 0),g([m(),Te("esri/widgets/support/t9n/uriUtils")],De.prototype,"messagesURIUtils",void 0),De=g([X("esri.widgets.Feature.FeatureFields")],De);const bn=De,Fo=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,So={maximumFractionDigits:20};function $o(s){return Kr(s,So)}const Lo="<",Bo=">",Ro=Wr("short-date");function jo(s,e,t,i){let r="";e===0?r=`${Lo} `:e===t&&(r=`${Bo} `);let n=null;return n=i?si(s,Ro):$o(s),r+n}const No=new Qr([64,64,64]);function Vo(s,e){const t=[],i=s.length-1;return s.length===5?t.push(0,2,4):t.push(0,i),s.map((r,n)=>t.includes(n)?jo(r,n,i,e):null)}async function Ho(s,e,t){let i=!1,r=[],n=[];if(s.stops){const h=s.stops;r=h.map(f=>f.value),i=h.some(f=>!!f.label),i&&(n=h.map(f=>f.label))}const a=r[0],o=r[r.length-1];if(a==null&&o==null)return null;const l=i?null:Vo(r,t??!1);return(await Promise.all(r.map(async(h,f)=>({value:h,color:s.type==="opacity"?await zo(h,s,e):(await C(()=>import("./index-080e108a.js").then(u=>u.uQ),["assets/index-080e108a.js","assets/index-a8e73b5e.css"])).getColor(s,h),label:i?n[f]:(l==null?void 0:l[f])??""})))).reverse()}async function zo(s,e,t){const i=new Qr(t??No),r=(await C(()=>import("./index-080e108a.js").then(n=>n.uQ),["assets/index-080e108a.js","assets/index-a8e73b5e.css"])).getOpacity(e,s);return r!=null&&(i.a=r),i}function Wo(s){if(!s.colorStops)return[];const e=[...s.colorStops].filter(i=>{var r;return((r=i.color)==null?void 0:r.a)>0});let t=e.length-1;if(e&&e[0]){const i=e[t];i&&i.ratio!==1&&(e.push(new Na({ratio:1,color:i.color})),t++)}return e.map((i,r)=>{var a,o;let n="";return r===0?n=((a=s.legendOptions)==null?void 0:a.minLabel)||"low":r===t&&(n=((o=s.legendOptions)==null?void 0:o.maxLabel)||"high"),{color:i.color,label:n,ratio:i.ratio}}).reverse()}Ce.getLogger("esri.renderers.support.utils");async function be(s,e,t){ha(s,e,()=>[]).push(...t)}async function Uo(s){var t,i;const e=new Map;if(!s)return e;if("visualVariables"in s&&s.visualVariables){const r=s.visualVariables.filter(n=>n.type==="color");for(const n of r){const a=(await Ho(n)??[]).map(o=>o.color);await be(e,n.field||n.valueExpression,a)}}if(s.type==="heatmap"){const r=Wo(s).map(n=>n.color);await be(e,s.field||s.valueExpression,r)}else if(s.type==="pie-chart"){for(const r of s.attributes)await be(e,r.field||r.valueExpression,[r.color]);await be(e,"default",[(t=s==null?void 0:s.othersCategory)==null?void 0:t.color,Mt(s.backgroundFillSymbol,null)])}else if(s.type==="dot-density"){for(const r of s.attributes)await be(e,r.field||r.valueExpression,[r.color]);await be(e,"default",[s.backgroundColor])}else if(s.type==="unique-value")if(((i=s.authoringInfo)==null?void 0:i.type)==="predominance")for(const r of s.uniqueValueInfos??[])await be(e,r.value.toString(),[Mt(r.symbol,null)]);else{const r=(s.uniqueValueInfos??[]).map(h=>Mt(h.symbol,null)),{field:n,field2:a,field3:o,valueExpression:l}=s;(n||l)&&await be(e,n||l,r),a&&await be(e,a,r),o&&await be(e,o,r)}else if(s.type==="class-breaks"){const r=s.classBreakInfos.map(o=>Mt(o.symbol,null)),{field:n,valueExpression:a}=s;await be(e,n??a,r)}else s.type==="simple"&&await be(e,"default",[Mt(s.symbol,null)]);return"defaultSymbol"in s&&s.defaultSymbol&&await be(e,"default",[Mt(s.defaultSymbol,null)]),e.forEach((r,n)=>{const a=la(r.filter(Boolean),(o,l)=>JSON.stringify(o)===JSON.stringify(l));e.set(n,a)}),e}const Yo="esri.widgets.Feature.support.relatedFeatureUtils",ur=Ce.getLogger(Yo),cr=new Map;function yi(s){if(!Ve(s))return null;const[e,t]=s.split("/").slice(1);return{layerId:e,fieldName:t}}function qo(s,e){if(!e.relationships)return null;let t=null;const{relationships:i}=e;return i.some(r=>r.id===parseInt(s,10)&&(t=r,!0)),t}function Go({originRelationship:s,relationships:e,layerId:t}){let i=null;return e&&e.some(r=>(`${r.relatedTableId}`===t&&r.id===(s==null?void 0:s.id)&&(i=r),!!i)),i}function Ko(s,e){const t=e.toLowerCase();for(const i in s)if(i.toLowerCase()===t)return s[i];return null}function Xo(s,e){const t=qo(s,e);if(t)return{url:`${e.url}/${t.relatedTableId}`,sourceSpatialReference:e.spatialReference,relation:t,relatedFields:[],outStatistics:[]}}function Qo(s,e){if(!e||!s)return;const{features:t,statsFeatures:i}=s,r=t&&t.value;e.relatedFeatures=r?r.features:[];const n=i&&i.value;e.relatedStatsFeatures=n?n.features:[]}function Jo(s,e,t,i){var n;const r=new vs;return r.outFields=["*"],r.relationshipId=typeof e.id=="number"?e.id:parseInt(e.id,10),r.objectIds=[s.attributes[t.objectIdField]],((n=t.queryRelatedFeatures)==null?void 0:n.call(t,r,i))??Promise.resolve({})}function Zo(s,e,t){let i=0;const r=[];for(;ic.attributes[n.objectIdField]);if(l!=null&&l.length&&n.supportsStatistics){const c=new Xi;c.where=Zo(n.objectIdField,b,1e3),c.outFields=o,c.outStatistics=l,c.sourceSpatialReference=f;const y={features:Promise.resolve(d),statsFeatures:Qi(h,c)};return _t(y)}}const p=u==null?void 0:u.keyField;if(p){const d=ua(nl(n.fields,p)),b=Ko(s.attributes,a.keyField),c=d?`${p}=${b}`:`${p}='${b}'`,y=Qi(h,new Xi({where:c,outFields:e.relatedFields,sourceSpatialReference:f}),i),v=e.outStatistics&&e.outStatistics.length>0&&n.supportsStatistics?Qi(h,new Xi({where:c,outFields:e.relatedFields,outStatistics:e.outStatistics,sourceSpatialReference:f}),i):null,x={features:y};return v&&(x.statsFeatures=v),_t(x)}return null}function tl(s,e){return ca(s,{query:{f:"json"},signal:e&&e.signal})}function il({relatedInfos:s,layer:e},t){const i={};return s.forEach((r,n)=>{const{relation:a}=r;if(!a){const u=new H("relation-required","A relation is required on a layer to retrieve related records.");throw ur.error(u),u}const{relatedTableId:o}=a;if(typeof o!="number"){const u=new H("A related table ID is required on a layer to retrieve related records.");throw ur.error(u),u}const l=`${e.url}/${o}`,h=cr.get(l),f=h??tl(l);h||cr.set(l,f),i[n]=f}),da(_t(i),t)}function sl({graphic:s,relatedInfos:e,layer:t},i){const r={};return e.forEach((n,a)=>{n.layerInfo&&(r[a]=el(s,n,t,i))}),_t(r)}function rl({relatedInfo:s,fieldName:e,fieldInfo:t}){var i,r;if((i=s.relatedFields)==null||i.push(e),t.statisticType){const n=new Va({statisticType:t.statisticType,onStatisticField:e,outStatisticFieldName:e});(r=s.outStatistics)==null||r.push(n)}}function nl(s,e){if(s!=null){e=e.toLowerCase();for(const t of s)if(t&&t.name.toLowerCase()===e)return t}return null}const pr={chartAnimation:!0};let te=class extends vt{constructor(e){super(e),this.abilities={...pr},this.activeMediaInfoIndex=0,this.attributes=null,this.description=null,this.fieldInfoMap=null,this.formattedAttributes=null,this.expressionAttributes=null,this.isAggregate=!1,this.layer=null,this.mediaInfos=null,this.popupTemplate=null,this.relatedInfos=null,this.title=null}castAbilities(e){return{...pr,...e}}get activeMediaInfo(){return this.formattedMediaInfos[this.activeMediaInfoIndex]||null}get formattedMediaInfos(){return this._formatMediaInfos()||[]}get formattedMediaInfoCount(){return this.formattedMediaInfos.length}setActiveMedia(e){this._setContentElementMedia(e)}next(){this._pageContentElementMedia(1)}previous(){this._pageContentElementMedia(-1)}_setContentElementMedia(e){const{formattedMediaInfoCount:t}=this,i=(e+t)%t;this.activeMediaInfoIndex=i}_pageContentElementMedia(e){const{activeMediaInfoIndex:t}=this,i=t+e;this._setContentElementMedia(i)}_formatMediaInfos(){const{mediaInfos:e,layer:t}=this,i=this.attributes??{},r=this.formattedAttributes??{},n=this.expressionAttributes??{},a=this.fieldInfoMap??new Map;return(e==null?void 0:e.map(o=>{const l=o==null?void 0:o.clone();if(!l)return null;if(l.title=ht({attributes:i,fieldInfoMap:a,globalAttributes:r,expressionAttributes:n,layer:t,text:l.title}),l.caption=ht({attributes:i,fieldInfoMap:a,globalAttributes:r,expressionAttributes:n,layer:t,text:l.caption}),l.altText=ht({attributes:i,fieldInfoMap:a,globalAttributes:r,expressionAttributes:n,layer:t,text:l.altText}),l.type==="image"){const{value:h}=l;return this._setImageValue({value:h,formattedAttributes:r,layer:t}),l.value.sourceURL?l:void 0}if(l.type==="pie-chart"||l.type==="line-chart"||l.type==="column-chart"||l.type==="bar-chart"){const{value:h}=l;return this._setChartValue({value:h,chartType:l.type,attributes:i,formattedAttributes:r,layer:t,expressionAttributes:n}),l}return null}).filter(Li))??[]}_setImageValue(e){const t=this.fieldInfoMap??new Map,{value:i,formattedAttributes:r,layer:n}=e,{linkURL:a,sourceURL:o}=i;if(o){const l=xs(o,n);i.sourceURL=ws({formattedAttributes:r,template:l,fieldInfoMap:t})}if(a){const l=xs(a,n);i.linkURL=ws({formattedAttributes:r,template:l,fieldInfoMap:t})}}_setChartValue(e){const{value:t,attributes:i,formattedAttributes:r,chartType:n,layer:a,expressionAttributes:o}=e,{popupTemplate:l,relatedInfos:h}=this,{fields:f,normalizeField:u}=t,p=a;if(t.fields=io(f,p),u&&(t.normalizeField=ri(u,p)),!f.some(b=>!!(r[b]!=null||Ve(b)&&(h!=null&&h.size))))return;const d=(l==null?void 0:l.fieldInfos)??[];f.forEach(b=>{if(Ve(b))return void(t.series=[...t.series,...this._getRelatedChartInfos({fieldInfos:d,fieldName:b,formattedAttributes:r,chartType:n,value:t})]);const c=this._getChartOption({value:t,attributes:i,chartType:n,formattedAttributes:r,expressionAttributes:o,fieldName:b,fieldInfos:d});t.series.push(c)})}_getRelatedChartInfos(e){var d;const{fieldInfos:t,fieldName:i,formattedAttributes:r,chartType:n,value:a}=e,o=[],l=yi(i),h=l&&((d=this.relatedInfos)==null?void 0:d.get(l.layerId.toString()));if(!h)return o;const{relatedFeatures:f,relation:u}=h;if(!u||!f)return o;const{cardinality:p}=u;return f.forEach(b=>{const{attributes:c}=b;c&&Object.keys(c).forEach(y=>{y===l.fieldName&&o.push(this._getChartOption({value:a,attributes:c,formattedAttributes:r,fieldName:i,chartType:n,relatedFieldName:y,hasMultipleRelatedFeatures:(f==null?void 0:f.length)>1,fieldInfos:t}))})}),p==="one-to-many"||p==="many-to-many"?o:[o[0]]}_getTooltip({label:e,value:t,chartType:i}){return i==="pie-chart"?`${e}`:`${e}: ${t}`}_getChartOption(e){var R;const{value:t,attributes:i,formattedAttributes:r,expressionAttributes:n,fieldName:a,relatedFieldName:o,fieldInfos:l,chartType:h,hasMultipleRelatedFeatures:f}=e,u=this.layer,p=this.fieldInfoMap??new Map,{normalizeField:d,tooltipField:b}=t,c=d?Ve(d)?i[yi(d).fieldName]:i[d]:null,y=Fs(a)&&n&&n[a]!==void 0?n[a]:o&&i[o]!==void 0?i[o]:i[a]!==void 0?i[a]:r[a],v=new pa({fieldName:a,value:y===void 0?null:y&&c?y/c:y});if(Ve(a)){const S=p.get(a.toLowerCase()),L=b&&p.get(b.toLowerCase()),z=(S==null?void 0:S.fieldName)??a,V=f&&b?yi(b).fieldName:(L==null?void 0:L.fieldName)??b,Y=f&&V?i[V]:r[V]??(S==null?void 0:S.label)??(S==null?void 0:S.fieldName)??o,de=f&&o?i[o]:r[z];return v.tooltip=this._getTooltip({label:Y,value:de,chartType:h}),v}const x=pn(l,a),w=ri(a,u),P=b&&r[b]!==void 0?r[b]:dn(x||new Xr({fieldName:w}),(R=this.popupTemplate)==null?void 0:R.expressionInfos),O=r[w];return v.tooltip=this._getTooltip({label:P,value:O,chartType:h}),v}};g([m()],te.prototype,"abilities",void 0),g([yt("abilities")],te.prototype,"castAbilities",null),g([m()],te.prototype,"activeMediaInfoIndex",void 0),g([m({readOnly:!0})],te.prototype,"activeMediaInfo",null),g([m()],te.prototype,"attributes",void 0),g([m()],te.prototype,"description",void 0),g([m()],te.prototype,"fieldInfoMap",void 0),g([m()],te.prototype,"formattedAttributes",void 0),g([m()],te.prototype,"expressionAttributes",void 0),g([m({readOnly:!0})],te.prototype,"formattedMediaInfos",null),g([m()],te.prototype,"isAggregate",void 0),g([m()],te.prototype,"layer",void 0),g([m({readOnly:!0})],te.prototype,"formattedMediaInfoCount",null),g([m()],te.prototype,"mediaInfos",void 0),g([m()],te.prototype,"popupTemplate",void 0),g([m()],te.prototype,"relatedInfos",void 0),g([m()],te.prototype,"title",void 0),te=g([X("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],te);const dt=te;function js(s){return Number(s)!==s}function al(s){return{}.toString.call(s)}function xe(s){if(s!=null&&!D(s)){let e=Number(s);return js(e)&&$t(s)&&s!=""?xe(s.replace(/[^0-9.\-]+/g,"")):e}return s}function ol(s){if(Ms(s))return new Date(s);if(D(s))return new Date(s);{let e=Number(s);return D(e)?new Date(e):new Date(s)}}function ll(s){if(js(s))return"NaN";if(s===1/0)return"Infinity";if(s===-1/0)return"-Infinity";if(s===0&&1/s==-1/0)return"-0";let e=s<0;s=Math.abs(s);let t,i=/^([0-9]+)(?:\.([0-9]+))?(?:e[\+\-]([0-9]+))?$/.exec(""+s),r=i[1],n=i[2]||"";if(i[3]===void 0)t=n===""?r:r+"."+n;else{let a=+i[3];if(s<1)t="0."+gr("0",a-1)+r+n;else{let o=a-n.length;t=o===0?r+n:o<0?r+n.slice(0,o)+"."+n.slice(o):r+n+gr("0",o)}}return e?"-"+t:t}function gr(s,e){return new Array(e+1).join(s)}function Ms(s){return al(s)==="[object Date]"}function $t(s){return typeof s=="string"}function D(s){return typeof s=="number"&&Number(s)==s}function Vi(s){return typeof s=="object"&&s!==null}const tt="__§§§__",Et="__§§§§__";function Oi(s,e){const t=s.length;for(let i=0;i0;)--t,e(s[t],t)}function yn(s,e){const t=s.length;for(let i=0;i0;)if(--t,e(s[t],t))return t;return-1}function pl(s,e){const t=vn(s,e);if(t!==-1)return s[t]}function gl(s,e){const t=cl(s,e);if(t!==-1)return s[t]}function fl(s,e){let t=0,i=s.length,r=!1;for(;t>1,a=e(s[n]);a<0?t=n+1:a===0?(r=!0,t=n+1):i=n}return{found:r,index:r?t-1:t}}function ml(s,e){let t=0,i=s.length,r=!1;for(;t>1,a=e(s[n]);a<0?t=n+1:(a===0&&(r=!0),i=n)}return{found:r,index:t}}function Hi(s,e){let t=s.length;for(;t>0;)--t,e(s[t])||s.splice(t,1)}class Ns{constructor(){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}let ne=class{constructor(e){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dispose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1,this._dispose=e}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}},_l=class extends Ns{constructor(){super(...arguments),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_dispose(){k(this._disposers,e=>{e.dispose()})}},Me=class extends Ns{constructor(e){super(),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposers=e}_dispose(){k(this._disposers,e=>{e.dispose()})}},wn=class extends ne{constructor(){super(...arguments),Object.defineProperty(this,"_counter",{enumerable:!0,configurable:!0,writable:!0,value:0})}increment(){return++this._counter,new ne(()=>{--this._counter,this._counter===0&&this.dispose()})}},Bt=class{constructor(){Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_killed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_iterating",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._listeners=[],this._killed=[],this._disabled={},this._iterating=0,this._enabled=!0,this._disposed=!1}isDisposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;const e=this._listeners;this._iterating=1,this._listeners=null,this._disabled=null;try{k(e,t=>{t.disposer.dispose()})}finally{this._killed=null,this._iterating=null}}}hasListeners(){return this._listeners.length!==0}hasListenersByType(e){return hl(this._listeners,t=>(t.type===null||t.type===e)&&!t.killed)}enable(){this._enabled=!0}disable(){this._enabled=!1}enableType(e){delete this._disabled[e]}disableType(e,t=1/0){this._disabled[e]=t}_removeListener(e){if(this._iterating===0){const t=this._listeners.indexOf(e);if(t===-1)throw new Error("Invalid state: could not remove listener");this._listeners.splice(t,1)}else this._killed.push(e)}_removeExistingListener(e,t,i,r){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(n=>{n.once!==e||n.type!==t||i!==void 0&&n.callback!==i||n.context!==r||n.disposer.dispose()})}isEnabled(e){if(this._disposed)throw new Error("EventDispatcher is disposed");return this._enabled&&this._listeners.length>0&&this.hasListenersByType(e)&&this._disabled[e]===void 0}removeType(e){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(t=>{t.type===e&&t.disposer.dispose()})}has(e,t,i){return vn(this._listeners,r=>r.once!==!0&&r.type===e&&(t===void 0||r.callback===t)&&r.context===i)!==-1}_shouldDispatch(e){if(this._disposed)throw new Error("EventDispatcher is disposed");const t=this._disabled[e];return D(t)?(t<=1?delete this._disabled[e]:--this._disabled[e],!1):this._enabled}_eachListener(e){++this._iterating;try{k(this._listeners,e)}finally{--this._iterating,this._iterating===0&&this._killed.length!==0&&(k(this._killed,t=>{this._removeListener(t)}),this._killed.length=0)}}dispatch(e,t){this._shouldDispatch(e)&&this._eachListener(i=>{i.killed||i.type!==null&&i.type!==e||i.dispatch(e,t)})}_on(e,t,i,r,n,a){if(this._disposed)throw new Error("EventDispatcher is disposed");this._removeExistingListener(e,t,i,r);const o={type:t,callback:i,context:r,shouldClone:n,dispatch:a,killed:!1,once:e,disposer:new ne(()=>{o.killed=!0,this._removeListener(o)})};return this._listeners.push(o),o}onAll(e,t,i=!0){return this._on(!1,null,e,t,i,(r,n)=>e.call(t,n)).disposer}on(e,t,i,r=!0){return this._on(!1,e,t,i,r,(n,a)=>t.call(i,a)).disposer}once(e,t,i,r=!0){const n=this._on(!0,e,t,i,r,(a,o)=>{n.disposer.dispose(),t.call(i,o)});return n.disposer}off(e,t,i){this._removeExistingListener(!1,e,t,i)}copyFrom(e){if(this._disposed)throw new Error("EventDispatcher is disposed");if(e===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");const t=[];return k(e._listeners,i=>{!i.killed&&i.shouldClone&&(i.type===null?t.push(this.onAll(i.callback,i.context)):i.once?t.push(this.once(i.type,i.callback,i.context)):t.push(this.on(i.type,i.callback,i.context)))}),new Me(t)}};function jt(s,e){if(!(s>=0&&s=0&&e{this.push(t)})}copyFrom(e){this.pushAll(e._values)}pop(){return this._values.length-1<0?void 0:this.removeIndex(this._values.length-1)}shift(){return this._values.length?this.removeIndex(0):void 0}setAll(e){const t=this._values;this._values=[],this._onClear(t),k(e,i=>{this._values.push(i),this._onPush(i)})}clear(){this.setAll([])}*[Symbol.iterator](){const e=this._values.length;for(let t=0;t{t.dispose()}),super._onClear(e)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this.autoDispose&&k(this._values,e=>{e.dispose()}))}},bu=class extends bl{constructor(e,t){super(),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"make",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=e,this.make=t}},yl=class extends xn{constructor(e){super(),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._container=e,this._events=this.events.onAll(t=>{if(t.type==="clear")k(t.oldValues,i=>{this._onRemoved(i)});else if(t.type==="push")this._onInserted(t.newValue);else if(t.type==="setIndex")this._onRemoved(t.oldValue),this._onInserted(t.newValue,t.index);else if(t.type==="insertIndex")this._onInserted(t.newValue,t.index);else if(t.type==="removeIndex")this._onRemoved(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._onRemoved(t.value),this._onInserted(t.value,t.newIndex)}})}_onInserted(e,t){e._setParent(this._container,!0);const i=this._container._childrenDisplay;t===void 0?i.addChild(e._display):i.addChildAt(e._display,t)}_onRemoved(e){this._container._childrenDisplay.removeChild(e._display),this._container.markDirtyBounds(),this._container.markDirty()}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._events.dispose(),k(this.values,e=>{e.dispose()}))}},U=class Ps{constructor(e){Object.defineProperty(this,"_value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._value=e}get value(){return this._value/100}get percent(){return this._value}toString(){return this._value+"%"}interpolate(e,t){return e+this.value*(t-e)}static normalize(e,t,i){return e instanceof Ps?e:new Ps(t===i?0:100*Math.min(Math.max(1/(i-t)*(e-t),0),1))}};function li(s){return new U(s)}li(0);const Q=li(100),ie=li(50);function fe(s){return Object.keys(s)}function vl(s,e){return fe(s).sort(e)}function wl(s){return Object.assign({},s)}function G(s,e){fe(s).forEach(t=>{e(t,s[t])})}function xl(s,e){for(let t in s)if(Ml(s,t)&&!e(t,s[t]))break}function Ml(s,e){return{}.hasOwnProperty.call(s,e)}function Pl(s){s.parentNode&&s.parentNode.removeChild(s)}function se(s,e,t,i){return s.addEventListener(e,t,i||!1),new ne(()=>{s.removeEventListener(e,t,i||!1)})}function Mn(s){return se(window,"resize",e=>{s()})}function ct(s){switch(s){case"touchevents":return window.hasOwnProperty("TouchEvent");case"pointerevents":return window.hasOwnProperty("PointerEvent");case"mouseevents":return window.hasOwnProperty("MouseEvent");case"wheelevents":return window.hasOwnProperty("WheelEvent");case"keyboardevents":return window.hasOwnProperty("KeyboardEvent")}return!1}function ns(s){return s.pointerId||0}function kl(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();else{let s=document.createElement("button");s.style.position="fixed",s.style.top="0px",s.style.left="-10000px",document.body.appendChild(s),s.focus(),s.blur(),document.body.removeChild(s)}}function Al(s){s&&s.focus()}function ks(s){if(ct("pointerevents"))return s;if(ct("touchevents"))switch(s){case"pointerover":case"pointerdown":return"touchstart";case"pointerout":case"pointerup":return"touchend";case"pointermove":return"touchmove";case"click":return"click";case"dblclick":return"dblclick"}else if(ct("mouseevents"))switch(s){case"pointerover":return"mouseover";case"pointerout":return"mouseout";case"pointerdown":return"mousedown";case"pointermove":return"mousemove";case"pointerup":return"mouseup";case"click":return"click";case"dblclick":return"dblclick"}return s}function mr(s){if(typeof Touch<"u"&&s instanceof Touch)return!0;if(typeof PointerEvent<"u"&&s instanceof PointerEvent&&s.pointerType!=null)switch(s.pointerType){case"touch":case"pen":case 2:return!0;case"mouse":case 4:return!1;default:return!(s instanceof MouseEvent)}else if(s.type!=null&&s.type.match(/^mouse/))return!1;return!0}function as(s,e,t){s.style[e]=t}function Cl(s,e){return s.style[e]}function Pn(s){if(s.composedPath){const e=s.composedPath();return e.length===0?null:e[0]}return s.target}function Tl(s,e){let t=e;for(;;){if(s===t)return!0;if(t.parentNode===null){if(t.host==null)return!1;t=t.host}else t=t.parentNode}}function El(s,e){return s.target&&Tl(e.root.dom,s.target)}function Ct(s,e){s.style.pointerEvents=e?"auto":"none"}function Il(){return/apple/i.test(navigator.vendor)&&"ontouchend"in document}function Ol(){return Il()?1:void 0}function qe(s,e){return D(s)?s:s!=null&&D(s.value)&&D(e)?e*s.value:0}function wu(s){let e=(""+s).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0}function J(s,e=0,t="0"){return typeof s!="string"&&(s=s.toString()),e>s.length?Array(e-s.length+1).join(t)+s:s}function Dl(s){return s.replace(/^[\s]*/,"")}function Fl(s){return s.replace(/[\s]*$/,"")}function vi(s){return Dl(Fl(s))}function Sl(s){if(s===void 0)return"string";let e=(s=(s=(s=s.toLowerCase().replace(/^\[[^\]]*\]/,"")).replace(/\[[^\]]+\]/,"")).trim()).match(/\/(date|number|duration)$/);return e?e[1]:s==="number"?"number":s==="date"?"date":s==="duration"?"duration":s.match(/[#0]/)?"number":s.match(/[ymwdhnsqaxkzgtei]/)?"date":"string"}function Vs(s){return s.replace(/\/(date|number|duration)$/i,"")}function _r(s){return s&&s.replace(/<[^>]*>/g,"")}function br(s){return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function yr(s,e=!1){const t=new Date(s.getFullYear(),0,0),i=s.getTime()-t.getTime()+60*(t.getTimezoneOffset()-s.getTimezoneOffset())*1e3;return Math.floor(i/864e5)}function Di(s,e=!1){const t=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate())),i=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-i);const r=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-r.getTime())/864e5+1)/7)}function $l(s,e=!1){const t=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate())),i=t.getUTCDay()||7;return t.setUTCDate(t.getUTCDate()+4-i),new Date(Date.UTC(t.getUTCFullYear(),0,1)).getFullYear()}function Ll(s,e=!1){const t=Di(new Date(s.getFullYear(),s.getMonth(),1),e);let i=Di(s,e);return i==1&&(i=53),i-t+1}function Bl(s,e,t=1,i=!1){let r=new Date(e,0,4,0,0,0,0);return i&&r.setUTCFullYear(e),7*s+t-((r.getDay()||7)+3)}function ui(s,e){return s>12?s-=12:s===0&&(s=12),e!=null?s+(e-1):s}function ci(s,e=!1,t=!1,i=!1){if(i)return e?"Coordinated Universal Time":"UTC";let r=s.toLocaleString("UTC"),n=s.toLocaleString("UTC",{timeZoneName:e?"long":"short"}).substr(r.length);return t===!1&&(n=n.replace(/ (standard|daylight|summer|winter) /i," ")),n}function Rl(s){const e=new Date(Date.UTC(2012,0,1,0,0,0,0)),t=new Date(e.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(e.toLocaleString("en-US",{timeZone:s})).getTime()-t.getTime())/6e4*-1}function xu(s){return s.charAt(0).toUpperCase()+s.slice(1)}function kn(s){let e,t,i,r=s.h,n=s.s,a=s.l;if(n==0)e=t=i=a;else{let o=function(f,u,p){return p<0&&(p+=1),p>1&&(p-=1),p<.16666666666666666?f+6*(u-f)*p:p<.5?u:p<.6666666666666666?f+(u-f)*(.6666666666666666-p)*6:f},l=a<.5?a*(1+n):a+n-a*n,h=2*a-l;e=o(h,l,r+1/3),t=o(h,l,r),i=o(h,l,r-1/3)}return{r:Math.round(255*e),g:Math.round(255*t),b:Math.round(255*i)}}function An(s){let e=s.r/255,t=s.g/255,i=s.b/255,r=Math.max(e,t,i),n=Math.min(e,t,i),a=0,o=0,l=(r+n)/2;if(r===n)a=o=0;else{let h=r-n;switch(o=l>.5?h/(2-r-n):h/(r+n),r){case e:a=(t-i)/h+(t0?255-s:s;return Math.round(t*e)}function Nl(s,e){if(s){let t=wi(Math.min(Math.max(s.r,s.g,s.b),230),e);return{r:Math.max(0,Math.min(255,Math.round(s.r+t))),g:Math.max(0,Math.min(255,Math.round(s.g+t))),b:Math.max(0,Math.min(255,Math.round(s.b+t))),a:s.a}}return s}function vr(s){return(299*s.r+587*s.g+114*s.b)/1e3>=128}function Vl(s,e){if(s===void 0||e==1)return s;let t=An(s);return t.s=e,kn(t)}function Hl(s,e={r:255,g:255,b:255},t={r:255,g:255,b:255}){let i=e,r=t;return vr(t)&&(i=t,r=e),vr(s)?r:i}function zl(s,e){return s||(s=[]),[...s,...e].filter((t,i,r)=>r.indexOf(t)===i)}function Mu(s,e){return!!e&&s.left==e.left&&s.right==e.right&&s.top==e.top&&s.bottom==e.bottom}function Cn(s){return s[0]==="#"&&(s=s.substr(1)),s.length==3&&(s=s[0].repeat(2)+s[1].repeat(2)+s[2].repeat(2)),parseInt(s,16)}function Wl(s){let e=(s=s.replace(/[ ]/g,"")).match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i);if(e)e.push("1");else if(e=s.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i),!e)return 0;let t="";for(let i=1;i<=3;i++){let r=parseInt(e[i]).toString(16);r.length==1&&(r="0"+r),t+=r}return Cn(t)}function Tt(s){return I.fromAny(s)}class I{constructor(e){Object.defineProperty(this,"_hex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hex=0|e}get hex(){return this._hex}get r(){return this._hex>>>16}get g(){return this._hex>>8&255}get b(){return 255&this._hex}toCSS(e=1){return"rgba("+this.r+", "+this.g+", "+this.b+", "+e+")"}toCSSHex(){return"#"+J(this.r.toString(16),2)+J(this.g.toString(16),2)+J(this.b.toString(16),2)}toHSL(e=1){return An({r:this.r,g:this.g,b:this.b,a:e})}static fromHSL(e,t,i){const r=kn({h:e,s:t,l:i});return this.fromRGB(r.r,r.g,r.b)}toString(){return this.toCSSHex()}static fromHex(e){return new I(e)}static fromRGB(e,t,i){return new I((0|i)+(t<<8)+(e<<16))}static fromString(e){return new I(Cn(e))}static fromCSS(e){return new I(Wl(e))}static fromAny(e){if($t(e)){if(e[0]=="#")return I.fromString(e);if(e.substr(0,3)=="rgb")return I.fromCSS(e)}else{if(D(e))return I.fromHex(e);if(e instanceof I)return I.fromHex(e.hex)}throw new Error("Unknown color syntax: "+e)}static alternative(e,t,i){const r=Hl({r:e.r,g:e.g,b:e.b},t?{r:t.r,g:t.g,b:t.b}:void 0,i?{r:i.r,g:i.g,b:i.b}:void 0);return this.fromRGB(r.r,r.g,r.b)}static interpolate(e,t,i,r="rgb"){if(r=="hsl"){const n=t.toHSL(),a=i.toHSL();return I.fromHSL(Xe(e,n.h,a.h),Xe(e,n.s,a.s),Xe(e,n.l,a.l))}return I.fromRGB(Xe(e,t.r,i.r),Xe(e,t.g,i.g),Xe(e,t.b,i.b))}static lighten(e,t){const i=jl({r:e.r,g:e.g,b:e.b},t);return I.fromRGB(i.r,i.g,i.b)}static brighten(e,t){const i=Nl({r:e.r,g:e.g,b:e.b},t);return I.fromRGB(i.r,i.g,i.b)}static saturate(e,t){const i=Vl({r:e.r,g:e.g,b:e.b},t);return I.fromRGB(i.r,i.g,i.b)}}function wr(s){return _i(this,void 0,void 0,function*(){if(s!==void 0){const e=[];G(s,(t,i)=>{e.push(i.waitForStop())}),yield Promise.all(e)}})}function Xe(s,e,t){return e+s*(t-e)}function Ul(s,e,t){return s>=1?t:e}function Yl(s,e,t){return new U(Xe(s,e.percent,t.percent))}function ql(s,e,t){return I.interpolate(s,e,t)}function Gl(s,e){return typeof s=="number"&&typeof e=="number"?Xe:s instanceof U&&e instanceof U?Yl:s instanceof I&&e instanceof I?ql:Ul}const Tn=Math.PI,En=Tn/180,Xt=180/Tn;function Pu(s,e,t){if(!D(e)||e<=0){let i=Math.round(s);return t&&i-s==.5&&i--,i}{let i=Math.pow(10,e);return Math.round(s*i)/i}}function ku(s,e){if(!D(e)||e<=0)return Math.ceil(s);{let t=Math.pow(10,e);return Math.ceil(s*t)/t}}function we(s,e,t){return Math.min(Math.max(s,e),t)}function As(s){return Math.sin(En*s)}function Cs(s){return Math.cos(En*s)}function Kl(s){return(s%=360)<0&&(s+=360),s}function Xl(s,e,t,i,r){let n=Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,l=-Number.MAX_VALUE,h=[];h.push(os(r,t)),h.push(os(r,i));let f=Math.min(90*Math.floor(t/90),90*Math.floor(i/90)),u=Math.max(90*Math.ceil(t/90),90*Math.ceil(i/90));for(let p=f;p<=u;p+=90)p>=t&&p<=i&&h.push(os(r,p));for(let p=0;po&&(o=d.x),d.y>l&&(l=d.y)}return{left:s+n,top:e+a,right:s+o,bottom:e+l}}function os(s,e){return{x:s*Cs(e),y:s*As(e)}}function Au(s){const e=s.length;if(e>0){let t=s[0],i=t.left,r=t.top,n=t.right,a=t.bottom;if(e>1)for(let o=1;o{this._userSettings[i]=!0})}get(e,t){const i=this._settings[e];return i!==void 0?i:t}setRaw(e,t){this._settings[e]=t}set(e,t){this._userSettings[e]=!0,this.setRaw(e,t)}remove(e){delete this._userSettings[e],delete this._settings[e]}setAll(e){fe(e).forEach(t=>{this.set(t,e[t])})}_eachSetting(e){G(this._settings,e)}apply(){const e={stateAnimationEasing:!0,stateAnimationDuration:!0},t=this._entity.states.lookup("default");this._eachSetting((i,r)=>{e[i]||(e[i]=!0,this!==t&&(i in t._settings||(t._settings[i]=this._entity.get(i))),this._entity.set(i,r))})}applyAnimate(e){e==null&&(e=this._settings.stateAnimationDuration),e==null&&(e=this.get("stateAnimationDuration",this._entity.get("stateAnimationDuration",0)));let t=this._settings.stateAnimationEasing;t==null&&(t=this.get("stateAnimationEasing",this._entity.get("stateAnimationEasing",Wt)));const i=this._entity.states.lookup("default"),r={stateAnimationEasing:!0,stateAnimationDuration:!0},n={};return this._eachSetting((a,o)=>{if(!r[a]){r[a]=!0,this!=i&&(a in i._settings||(i._settings[a]=this._entity.get(a)));const l=this._entity.animate({key:a,to:o,duration:e,easing:t});l&&(n[a]=l)}}),n}}class Jl{constructor(e){Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._entity=e}lookup(e){return this._states[e]}create(e,t){const i=this._states[e];if(i)return i.setAll(t),i;{const r=new Ql(this._entity,t);return this._states[e]=r,r}}remove(e){delete this._states[e]}apply(e){const t=this._states[e];t&&t.apply(),this._entity._applyState(e)}applyAnimate(e,t){let i;const r=this._states[e];return r&&(i=r.applyAnimate(t)),this._entity._applyStateAnimated(e,t),i}}class Zl{constructor(){Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.3.12"}),Object.defineProperty(this,"licenses",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"entitiesById",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rootElements",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}const Se=new Zl;function eh(s){Se.licenses.push(s)}function pt(s,e){return s===e?0:s{ke(i,t)&&this._entity._markDirtyKey(e)})}remove(e){const t=this._callbacks[e];t!==void 0&&(delete this._callbacks[e],t.length!==0&&this._entity._markDirtyKey(e))}enable(e){this._disabled[e]&&(delete this._disabled[e],this._entity._markDirtyKey(e))}disable(e){this._disabled[e]||(this._disabled[e]=!0,this._entity._markDirtyKey(e))}fold(e,t){if(!this._disabled[e]){const i=this._callbacks[e];if(i!==void 0)for(let r=0,n=i.length;r{if(this._stopped)e();else{const i=()=>{r.dispose(),e()},r=this.events.on("stopped",i)}})}_checkEnded(){return!(this._loops>1)||(--this._loops,!1)}_run(e){this._oldTime!==null&&(this._time+=e-this._oldTime,this._time>this._duration&&(this._time=this._duration)),this._oldTime=e}_reset(e){this._oldTime=e,this._time=0}_value(e){return this._interpolate(this._easing(e),this._from,this._to)}},ih=0,sh=class{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:++ih}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_userProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._settings=e}_checkDirty(){fe(this._settings).forEach(e=>{this._userProperties[e]=!0,this._markDirtyKey(e)})}resetUserSettings(){this._userProperties={}}_runAnimation(e){if(this.isDisposed())return!1;{let t=!1;return G(this._animatingSettings,(i,r)=>{if(r._stopped)this._stopAnimation(i);else if(r._playing){r._run(e);const n=r.percentage;n>=1?r._checkEnded()?this.set(i,r._value(1)):(t=!0,r._reset(e),this._set(i,r._value(1))):(t=!0,this._set(i,r._value(n)))}}),G(this._animatingPrivateSettings,(i,r)=>{if(r._stopped)this._stopAnimationPrivate(i);else if(r._playing){r._run(e);const n=r.percentage;n>=1?r._checkEnded()?this.setPrivate(i,r._value(1)):(t=!0,r._reset(e),this._setPrivate(i,r._value(1))):(t=!0,this._setPrivate(i,r._value(n)))}}),t}}_markDirtyKey(e){this.markDirty()}_markDirtyPrivateKey(e){this.markDirty()}on(e,t){let i=this._settingEvents[e];return i===void 0&&(i=this._settingEvents[e]=[]),i.push(t),new ne(()=>{ke(i,t),i.length===0&&delete this._settingEvents[e]})}onPrivate(e,t){let i=this._privateSettingEvents[e];return i===void 0&&(i=this._privateSettingEvents[e]=[]),i.push(t),new ne(()=>{ke(i,t),i.length===0&&delete this._privateSettingEvents[e]})}getRaw(e,t){const i=this._settings[e];return i!==void 0?i:t}get(e,t){return this.getRaw(e,t)}_sendKeyEvent(e,t){const i=this._settingEvents[e];i!==void 0&&k(i,r=>{r(t,this,e)})}_sendPrivateKeyEvent(e,t){const i=this._privateSettingEvents[e];i!==void 0&&k(i,r=>{r(t,this,e)})}_setRaw(e,t,i){this._prevSettings[e]=t,this._sendKeyEvent(e,i)}setRaw(e,t){const i=this._settings[e];this._settings[e]=t,i!==t&&this._setRaw(e,i,t)}_set(e,t){const i=this._settings[e];this._settings[e]=t,i!==t&&(this._setRaw(e,i,t),this._markDirtyKey(e))}_stopAnimation(e){const t=this._animatingSettings[e];t&&(delete this._animatingSettings[e],t.stop())}set(e,t){return this._set(e,t),this._stopAnimation(e),t}remove(e){e in this._settings&&(this._prevSettings[e]=this._settings[e],delete this._settings[e],this._sendKeyEvent(e,void 0),this._markDirtyKey(e)),this._stopAnimation(e)}removeAll(){k(fe(this._settings),e=>{this.remove(e)})}getPrivate(e,t){const i=this._privateSettings[e];return i!==void 0?i:t}_setPrivateRaw(e,t,i){this._prevPrivateSettings[e]=t,this._sendPrivateKeyEvent(e,i)}setPrivateRaw(e,t){const i=this._privateSettings[e];this._privateSettings[e]=t,i!==t&&this._setPrivateRaw(e,i,t)}_setPrivate(e,t){const i=this._privateSettings[e];this._privateSettings[e]=t,i!==t&&(this._setPrivateRaw(e,i,t),this._markDirtyPrivateKey(e))}_stopAnimationPrivate(e){const t=this._animatingPrivateSettings[e];t&&(t.stop(),delete this._animatingPrivateSettings[e])}setPrivate(e,t){return this._setPrivate(e,t),this._stopAnimationPrivate(e),t}removePrivate(e){e in this._privateSettings&&(this._prevPrivateSettings[e]=this._privateSettings[e],delete this._privateSettings[e],this._markDirtyPrivateKey(e)),this._stopAnimationPrivate(e)}setAll(e){G(e,(t,i)=>{this.set(t,i)})}animate(e){const t=e.key,i=e.to,r=e.duration||0,n=e.loops||1,a=e.from===void 0?this.get(t):e.from,o=e.easing===void 0?xr:e.easing;if(r===0)this.set(t,i);else{if(a!==void 0&&a!==i){this.set(t,a);const h=this._animatingSettings[t]=new gi(this,a,i,r,o,n,this._animationTime());return this._startAnimation(),h}this.set(t,i)}const l=new gi(this,a,i,r,o,n,null);return l.stop(),l}animatePrivate(e){const t=e.key,i=e.to,r=e.duration||0,n=e.loops||1,a=e.from===void 0?this.getPrivate(t):e.from,o=e.easing===void 0?xr:e.easing;if(r===0)this.setPrivate(t,i);else{if(a!==void 0&&a!==i){this.setPrivate(t,a);const h=this._animatingPrivateSettings[t]=new gi(this,a,i,r,o,n,this._animationTime());return this._startAnimation(),h}this.setPrivate(t,i)}const l=new gi(this,a,i,r,o,n,null);return l.stop(),l}_dispose(){}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}},_e=class extends sh{constructor(e,t,i,r=[]){if(super(t),Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_user_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Jl(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new th(this)}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:this._createEvents()}),Object.defineProperty(this,"_userPrivateProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPrivate",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templates",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_internalTemplates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultThemes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_templateDisposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_runSetup",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_disposerProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._root=e,this._internalTemplates=r,t.id&&this._registerId(t.id)}static new(e,t,i){const r=new this(e,t,!0);return r._template=i,r._afterNew(),r}static _new(e,t,i=[]){const r=new this(e,t,!0,i);return r._afterNew(),r}_afterNew(){this._checkDirty();let e=!1;const t=this._template;t&&(e=!0,t._setObjectTemplate(this)),k(this._internalTemplates,i=>{e=!0,i._setObjectTemplate(this)}),e&&this._applyTemplates(!1),this.states.create("default",{}),this._setDefaults()}_afterNewApplyThemes(){this._checkDirty();const e=this._template;e&&e._setObjectTemplate(this),k(this._internalTemplates,t=>{t._setObjectTemplate(this)}),this.states.create("default",{}),this._setDefaults(),this._applyThemes()}_createEvents(){return new Bt}get classNames(){return this.constructor.classNames}get className(){return this.constructor.className}_setDefaults(){}_setDefault(e,t){e in this._settings||super.set(e,t)}_setRawDefault(e,t){e in this._settings||super.setRaw(e,t)}_clearDirty(){fe(this._dirty).forEach(e=>{this._dirty[e]=!1}),fe(this._dirtyPrivate).forEach(e=>{this._dirtyPrivate[e]=!1})}isDirty(e){return!!this._dirty[e]}isPrivateDirty(e){return!!this._dirtyPrivate[e]}_markDirtyKey(e){this._dirty[e]=!0,super._markDirtyKey(e)}_markDirtyPrivateKey(e){this._dirtyPrivate[e]=!0,super._markDirtyKey(e)}isType(e){return this.classNames.indexOf(e)!==-1}_pushPropertyDisposer(e,t){let i=this._disposerProperties[e];return i===void 0&&(i=this._disposerProperties[e]=[]),i.push(t),t}_disposeProperty(e){const t=this._disposerProperties[e];t!==void 0&&(k(t,i=>{i.dispose()}),delete this._disposerProperties[e])}set template(e){const t=this._template;t!==e&&(this._template=e,t&&t._removeObjectTemplate(this),e&&e._setObjectTemplate(this),this._applyTemplates())}get template(){return this._template}markDirty(){this._root._addDirtyEntity(this)}_startAnimation(){this._root._addAnimation(this)}_animationTime(){return this._root.animationTime}_applyState(e){}_applyStateAnimated(e,t){}get(e,t){const i=this.adapters.fold(e,this._settings[e]);return i!==void 0?i:t}isUserSetting(e){return this._userProperties[e]||!1}set(e,t){return this._userProperties[e]=!0,super.set(e,t)}setRaw(e,t){this._userProperties[e]=!0,super.setRaw(e,t)}_setSoft(e,t){return this._userProperties[e]?t:super.set(e,t)}remove(e){delete this._userProperties[e],this._removeTemplateProperty(e)}setPrivate(e,t){return this._userPrivateProperties[e]=!0,super.setPrivate(e,t)}setPrivateRaw(e,t){this._userPrivateProperties[e]=!0,super.setPrivateRaw(e,t)}removePrivate(e){delete this._userPrivateProperties[e],this._removeTemplatePrivateProperty(e)}_setTemplateProperty(e,t,i){this._userProperties[t]||e===this._findTemplateByKey(t)&&super.set(t,i)}_setTemplatePrivateProperty(e,t,i){this._userPrivateProperties[t]||e===this._findTemplateByPrivateKey(t)&&super.setPrivate(t,i)}_removeTemplateProperty(e){if(!this._userProperties[e]){const t=this._findTemplateByKey(e);t?super.set(e,t._settings[e]):super.remove(e)}}_removeTemplatePrivateProperty(e){if(!this._userPrivateProperties[e]){const t=this._findTemplateByPrivateKey(e);t?super.setPrivate(e,t._privateSettings[e]):super.removePrivate(e)}}_walkParents(e){e(this._root._rootContainer),e(this)}_applyStateByKey(e){const t=this.states.create(e,{}),i={};this._eachTemplate(r=>{const n=r.states.lookup(e);n&&n._apply(t,i)}),G(t._settings,r=>{i[r]||t._userSettings[r]||t.remove(r)})}_applyTemplate(e,t){this._templateDisposers.push(e._apply(this,t)),G(e._settings,(i,r)=>{t.settings[i]||this._userProperties[i]||(t.settings[i]=!0,super.set(i,r))}),G(e._privateSettings,(i,r)=>{t.privateSettings[i]||this._userPrivateProperties[i]||(t.privateSettings[i]=!0,super.setPrivate(i,r))}),this._runSetup&&e.setup&&(this._runSetup=!1,e.setup(this))}_findStaticTemplate(e){if(this._template&&e(this._template))return this._template}_eachTemplate(e){this._findStaticTemplate(t=>(e(t),!1)),Kt(this._internalTemplates,e),k(this._templates,e)}_applyTemplates(e=!0){e&&this._disposeTemplates();const t={settings:{},privateSettings:{},states:{}};this._eachTemplate(i=>{this._applyTemplate(i,t)}),e&&(G(this._settings,i=>{this._userProperties[i]||t.settings[i]||super.remove(i)}),G(this._privateSettings,i=>{this._userPrivateProperties[i]||t.privateSettings[i]||super.removePrivate(i)}))}_findTemplate(e){const t=this._findStaticTemplate(e);if(t===void 0){const i=gl(this._internalTemplates,e);return i===void 0?pl(this._templates,e):i}return t}_findTemplateByKey(e){return this._findTemplate(t=>e in t._settings)}_findTemplateByPrivateKey(e){return this._findTemplate(t=>e in t._privateSettings)}_disposeTemplates(){k(this._templateDisposers,e=>{e.dispose()}),this._templateDisposers.length=0}_removeTemplates(){k(this._templates,e=>{e._removeObjectTemplate(this)}),this._templates.length=0}_applyThemes(){let e=!1;const t=[];let i=[];const r=new Set,n=this.get("themeTagsSelf");return n&&k(n,a=>{r.add(a)}),this._walkParents(a=>{a===this._root._rootContainer&&(e=!0),a._defaultThemes.length>0&&t.push(a._defaultThemes);const o=a.get("themes");o&&i.push(o);const l=a.get("themeTags");l&&k(l,h=>{r.add(h)})}),i=t.concat(i),this._removeTemplates(),e&&Kt(this.classNames,a=>{const o=[];k(i,l=>{k(l,h=>{const f=h._lookupRules(a);f&&Kt(f,u=>{if(u.tags.every(p=>r.has(p))){const p=ml(o,d=>{const b=pt(u.tags.length,d.tags.length);return b===0?In(u.tags,d.tags,pt):b});o.splice(p.index,0,u)}})})}),k(o,l=>{this._templates.push(l.template),l.template._setObjectTemplate(this)})}),this._applyTemplates(),e&&(this._runSetup=!1),e}_changed(){}_beforeChanged(){if(this.isDirty("id")){const e=this.get("id");e&&this._registerId(e);const t=this._prevSettings.id;t&&delete Se.entitiesById[t]}}_registerId(e){if(Se.entitiesById[e]&&Se.entitiesById[e]!==this)throw new Error('An entity with id "'+e+'" already exists.');Se.entitiesById[e]=this}_afterChanged(){}addDisposer(e){return this._disposers.push(e),e}_dispose(){super._dispose();const e=this._template;e&&e._removeObjectTemplate(this),k(this._internalTemplates,i=>{i._removeObjectTemplate(this)}),this._removeTemplates(),this._disposeTemplates(),this.events.dispose(),this._disposers.forEach(i=>{i.dispose()}),G(this._disposerProperties,(i,r)=>{k(r,n=>{n.dispose()})});const t=this.get("id");t&&delete Se.entitiesById[t]}setTimeout(e,t){const i=setTimeout(()=>{this.removeDispose(r),e()},t),r=new ne(()=>{clearTimeout(i)});return this._disposers.push(r),r}removeDispose(e){if(!this.isDisposed()){let t=Oi(this._disposers,e);t>-1&&this._disposers.splice(t,1)}e.dispose()}hasTag(e){return Oi(this.get("themeTags",[]),e)!==-1}addTag(e){if(!this.hasTag(e)){const t=this.get("themeTags",[]);t.push(e),this.set("themeTags",t)}}removeTag(e){if(this.hasTag(e)){const t=this.get("themeTags",[]);Qe(t,e),this.set("themeTags",t)}}_t(e,t,...i){return this._root.language.translate(e,t,...i)}get root(){return this._root}};Object.defineProperty(_e,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Entity"}),Object.defineProperty(_e,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:["Entity"]});let rh=class{constructor(e,t,i){Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._name=e,this._template=t,this._settings=i}get(e,t){const i=this._settings[e];return i!==void 0?i:t}set(e,t){this._settings[e]=t,this._template._stateChanged(this._name)}remove(e){delete this._settings[e],this._template._stateChanged(this._name)}setAll(e){fe(e).forEach(t=>{this._settings[t]=e[t]}),this._template._stateChanged(this._name)}_apply(e,t){G(this._settings,(i,r)=>{t[i]||e._userSettings[i]||(t[i]=!0,e.setRaw(i,r))})}},nh=class{constructor(e){Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._template=e}lookup(e){return this._states[e]}create(e,t){const i=this._states[e];if(i)return i.setAll(t),i;{const r=new rh(e,this._template,t);return this._states[e]=r,this._template._stateChanged(e),r}}remove(e){delete this._states[e],this._template._stateChanged(e)}_apply(e,t){G(this._states,(i,r)=>{let n=t.states[i];n==null&&(n=t.states[i]={});const a=e.states.create(i,{});r._apply(a,n)})}},ah=class{constructor(){Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}})}add(e,t){let i=this._callbacks[e];return i===void 0&&(i=this._callbacks[e]=[]),i.push(t),new ne(()=>{ke(i,t),i.length===0&&delete this._callbacks[e]})}remove(e){this._callbacks[e]!==void 0&&delete this._callbacks[e]}_apply(e){const t=[];return G(this._callbacks,(i,r)=>{k(r,n=>{t.push(e.adapters.add(i,n))})}),new Me(t)}},Ts=class On{constructor(e,t){if(Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entities",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new nh(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new ah}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Bt}),Object.defineProperty(this,"setup",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._settings=e}static new(e){return new On(e,!0)}get entities(){return this._entities}get(e,t){const i=this._settings[e];return i!==void 0?i:t}setRaw(e,t){this._settings[e]=t}set(e,t){this._settings[e]!==t&&(this.setRaw(e,t),this._entities.forEach(i=>{i._setTemplateProperty(this,e,t)}))}remove(e){e in this._settings&&(delete this._settings[e],this._entities.forEach(t=>{t._removeTemplateProperty(e)}))}removeAll(){G(this._settings,(e,t)=>{this.remove(e)})}getPrivate(e,t){const i=this._privateSettings[e];return i!==void 0?i:t}setPrivateRaw(e,t){return this._privateSettings[e]=t,t}setPrivate(e,t){return this._privateSettings[e]!==t&&(this.setPrivateRaw(e,t),this._entities.forEach(i=>{i._setTemplatePrivateProperty(this,e,t)})),t}removePrivate(e){e in this._privateSettings&&(delete this._privateSettings[e],this._entities.forEach(t=>{t._removeTemplatePrivateProperty(e)}))}setAll(e){G(e,(t,i)=>{this.set(t,i)})}on(e,t){let i=this._settingEvents[e];return i===void 0&&(i=this._settingEvents[e]=[]),i.push(t),new ne(()=>{ke(i,t),i.length===0&&delete this._settingEvents[e]})}onPrivate(e,t){let i=this._privateSettingEvents[e];return i===void 0&&(i=this._privateSettingEvents[e]=[]),i.push(t),new ne(()=>{ke(i,t),i.length===0&&delete this._privateSettingEvents[e]})}_apply(e,t){const i=[];return G(this._settingEvents,(r,n)=>{k(n,a=>{i.push(e.on(r,a))})}),G(this._privateSettingEvents,(r,n)=>{k(n,a=>{i.push(e.onPrivate(r,a))})}),this.states._apply(e,t),i.push(this.adapters._apply(e)),i.push(e.events.copyFrom(this.events)),new Me(i)}_setObjectTemplate(e){this._entities.push(e)}_removeObjectTemplate(e){Qe(this._entities,e)}_stateChanged(e){this._entities.forEach(t=>{t._applyStateByKey(e)})}},Dn=class Fn extends Bt{constructor(e){super(),Object.defineProperty(this,"_sprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rendererDisposers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dispatchParents",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._sprite=e}_makePointerEvent(e,t){return{type:e,originalEvent:t.event,point:t.point,simulated:t.simulated,native:t.native,target:this._sprite}}_onRenderer(e,t){this._sprite.set("interactive",!0),this._sprite._display.interactive=!0;let i=this._rendererDisposers[e];if(i===void 0){const r=this._sprite._display.on(e,n=>{t.call(this,n)});i=this._rendererDisposers[e]=new wn(()=>{delete this._rendererDisposers[e],r.dispose()})}return i.increment()}_on(e,t,i,r,n,a){const o=super._on(e,t,i,r,n,a),l=Fn.RENDERER_EVENTS[t];return l!==void 0&&(o.disposer=new Me([o.disposer,this._onRenderer(t,l)])),o}stopParentDispatch(){this._dispatchParents=!1}dispatchParents(e,t){const i=this._dispatchParents;this._dispatchParents=!0;try{this.dispatch(e,t),this._dispatchParents&&this._sprite.parent&&this._sprite.parent.events.dispatchParents(e,t)}finally{this._dispatchParents=i}}};Object.defineProperty(Dn,"RENDERER_EVENTS",{enumerable:!0,configurable:!0,writable:!0,value:{click:function(s){this.isEnabled("click")&&!this._sprite.isDragging()&&this._sprite._hasDown()&&!this._sprite._hasMoved(this._makePointerEvent("click",s))&&this.dispatch("click",this._makePointerEvent("click",s))},rightclick:function(s){this.isEnabled("rightclick")&&this.dispatch("rightclick",this._makePointerEvent("rightclick",s))},middleclick:function(s){this.isEnabled("middleclick")&&this.dispatch("middleclick",this._makePointerEvent("middleclick",s))},dblclick:function(s){this.dispatchParents("dblclick",this._makePointerEvent("dblclick",s))},pointerover:function(s){this.isEnabled("pointerover")&&this.dispatch("pointerover",this._makePointerEvent("pointerover",s))},pointerout:function(s){this.isEnabled("pointerout")&&this.dispatch("pointerout",this._makePointerEvent("pointerout",s))},pointerdown:function(s){this.dispatchParents("pointerdown",this._makePointerEvent("pointerdown",s))},pointerup:function(s){this.isEnabled("pointerup")&&this.dispatch("pointerup",this._makePointerEvent("pointerup",s))},globalpointerup:function(s){this.isEnabled("globalpointerup")&&this.dispatch("globalpointerup",this._makePointerEvent("globalpointerup",s))},globalpointermove:function(s){this.isEnabled("globalpointermove")&&this.dispatch("globalpointermove",this._makePointerEvent("globalpointermove",s))},wheel:function(s){this.dispatchParents("wheel",{type:"wheel",target:this._sprite,originalEvent:s.event,point:s.point})}}});let $e=class extends _e{constructor(){super(...arguments),Object.defineProperty(this,"_adjustedLocalBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dataItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templateField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_sizeDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dragEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isHidden",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isShowing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isHiding",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_downPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downPoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_toggleDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_hoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipMoveDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipPointerDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_statesHandled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this.setPrivateRaw("visible",!0),super._afterNew()}_markDirtyKey(e){super._markDirtyKey(e),e!="x"&&e!="y"&&e!="dx"&&e!="dy"||(this.markDirtyBounds(),this._addPercentagePositionChildren(),this.markDirtyPosition())}_markDirtyPrivateKey(e){super._markDirtyPrivateKey(e),e!="x"&&e!="y"||this.markDirtyPosition()}_removeTemplateField(){this._templateField&&this._templateField._removeObjectTemplate(this)}_createEvents(){return new Dn(this)}_processTemplateField(){let e;const t=this.get("templateField");if(t){const i=this.dataItem;if(i){const r=i.dataContext;r&&(e=r[t],e instanceof Ts||!e||(e=Ts.new(e)))}}this._templateField!==e&&(this._removeTemplateField(),this._templateField=e,e&&e._setObjectTemplate(this),this._applyTemplates())}_setDataItem(e){const t=this._dataItem;this._dataItem=e,this._processTemplateField();const i="dataitemchanged";e!=t&&this.events.isEnabled(i)&&this.events.dispatch(i,{type:i,target:this,oldDataItem:t,newDataItem:e})}set dataItem(e){this._setDataItem(e)}get dataItem(){if(this._dataItem)return this._dataItem;{let e=this._parent;for(;e;){if(e._dataItem)return e._dataItem;e=e._parent}}}_addPercentageSizeChildren(){let e=this.parent;e&&(this.get("width")instanceof U||this.get("height")instanceof U?ni(e._percentageSizeChildren,this):ke(e._percentageSizeChildren,this))}_addPercentagePositionChildren(){let e=this.parent;e&&(this.get("x")instanceof U||this.get("y")instanceof U?ni(e._percentagePositionChildren,this):ke(e._percentagePositionChildren,this))}markDirtyPosition(){this._root._addDirtyPosition(this)}updatePivotPoint(){const e=this._localBounds;if(e){const t=this.get("centerX");t!=null&&(this._display.pivot.x=e.left+qe(t,e.right-e.left));const i=this.get("centerY");i!=null&&(this._display.pivot.y=e.top+qe(i,e.bottom-e.top))}}_beforeChanged(){if(super._beforeChanged(),this._handleStates(),this.isDirty("tooltip")){const e=this._prevSettings.tooltip;e&&e.dispose()}if((this.isDirty("layer")||this.isDirty("layerMargin"))&&(this._display.setLayer(this.get("layer"),this.get("layerMargin")),this.markDirtyLayer()),this.isDirty("tooltipPosition")){const e=this._tooltipMoveDp;e&&(e.dispose(),this._tooltipMoveDp=void 0);const t=this._tooltipPointerDp;t&&(t.dispose(),this._tooltipPointerDp=void 0),this.get("tooltipPosition")=="pointer"&&(this._tooltipPointerDp=new Me([this.events.on("pointerover",()=>{this._tooltipMoveDp=this.events.on("globalpointermove",i=>{this.showTooltip(i.point)})}),this.events.on("pointerout",()=>{const i=this._tooltipMoveDp;i&&(i.dispose(),this._tooltipMoveDp=void 0)})]))}}_handleStates(){this._statesHandled||(this.isDirty("active")&&(this.get("active")?(this.states.applyAnimate("active"),this.set("ariaChecked",!0)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!1)),this.markDirtyAccessibility()),this.isDirty("disabled")&&(this.get("disabled")?(this.states.applyAnimate("disabled"),this.set("ariaChecked",!1)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!0)),this.markDirtyAccessibility()),this._statesHandled=!0)}_changed(){super._changed();const e=this._display,t=this.events;if(this.isDirty("draggable")){const i=this.get("draggable");i?(this.set("interactive",!0),this._dragDp=new Me([t.on("pointerdown",r=>{this.dragStart(r)}),t.on("globalpointermove",r=>{this.dragMove(r)}),t.on("globalpointerup",r=>{this.dragStop(r)})])):this._dragDp&&(this._dragDp.dispose(),this._dragDp=void 0),e.cancelTouch=!!i}if(this.isDirty("tooltipText")||this.isDirty("tooltipHTML")||this.isDirty("showTooltipOn")){const i=this.get("tooltipText"),r=this.get("tooltipHTML"),n=this.get("showTooltipOn","hover");this._tooltipDp&&(this._tooltipDp.dispose(),this._tooltipDp=void 0),(i||r)&&(n=="click"?this._tooltipDp=new Me([t.on("click",()=>{this.setTimeout(()=>this.showTooltip(),10)}),se(document,"click",a=>{this.hideTooltip()})]):n=="always"||(this._tooltipDp=new Me([t.on("pointerover",()=>{this.showTooltip()}),t.on("pointerout",()=>{this.hideTooltip()})])))}if(this.isDirty("toggleKey")){let i=this.get("toggleKey");i&&i!="none"?this._toggleDp=t.on("click",()=>{this._isDragging||this.set(i,!this.get(i))}):this._toggleDp&&(this._toggleDp.dispose(),this._toggleDp=void 0)}if(this.isDirty("opacity")&&(e.alpha=Math.max(0,this.get("opacity",1))),this.isDirty("rotation")&&(this.markDirtyBounds(),e.angle=this.get("rotation",0)),this.isDirty("scale")&&(this.markDirtyBounds(),e.scale=this.get("scale",0)),(this.isDirty("centerX")||this.isDirty("centerY"))&&(this.markDirtyBounds(),this.updatePivotPoint()),(this.isDirty("visible")||this.isPrivateDirty("visible")||this.isDirty("forceHidden"))&&(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?e.visible=!0:(e.visible=!1,this.hideTooltip()),this.markDirtyBounds(),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("width")||this.isDirty("height")){this.markDirtyBounds(),this._addPercentageSizeChildren();const i=this.parent;i&&(this.isDirty("width")&&this.get("width")instanceof U||this.isDirty("height")&&this.get("height")instanceof U)&&(i.markDirty(),i._prevWidth=0),this._sizeDirty=!0}if((this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("minWidth")||this.isDirty("minHeight")||this.isPrivateDirty("maxWidth")||this.isPrivateDirty("maxHeight")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&(this.markDirtyBounds(),this._sizeDirty=!0),this._sizeDirty&&this._updateSize(),this.isDirty("wheelable")){const i=this.get("wheelable");i&&this.set("interactive",!0),e.wheelable=!!i}if((this.isDirty("tabindexOrder")||this.isDirty("focusableGroup"))&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this)),this.isDirty("filter")&&(e.filter=this.get("filter")),this.isDirty("cursorOverStyle")&&(e.cursorOverStyle=this.get("cursorOverStyle")),this.isDirty("hoverOnFocus")&&(this.get("hoverOnFocus")?this._focusDp=new Me([t.on("focus",()=>{this.showTooltip()}),t.on("blur",()=>{this.hideTooltip()})]):this._focusDp&&(this._focusDp.dispose(),this._focusDp=void 0)),this.isDirty("focusable")&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this),this.markDirtyAccessibility()),(this.isDirty("role")||this.isDirty("ariaLive")||this.isDirty("ariaChecked")||this.isDirty("ariaHidden")||this.isDirty("ariaOrientation")||this.isDirty("ariaValueNow")||this.isDirty("ariaValueMin")||this.isDirty("ariaValueMax")||this.isDirty("ariaValueText")||this.isDirty("ariaLabel")||this.isDirty("ariaControls"))&&this.markDirtyAccessibility(),this.isDirty("exportable")&&(e.exportable=this.get("exportable")),this.isDirty("interactive")){const i=this.events;this.get("interactive")?this._hoverDp=new Me([i.on("click",r=>{mr(r.originalEvent)&&(this.getPrivate("touchHovering")||this.setTimeout(()=>{this._handleOver(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.showTooltip(),this.setPrivateRaw("touchHovering",!0),this.events.dispatch("pointerover",{type:"pointerover",target:r.target,originalEvent:r.originalEvent,point:r.point,simulated:r.simulated})},10))}),i.on("globalpointerup",r=>{mr(r.originalEvent)&&this.getPrivate("touchHovering")&&(this._handleOut(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.hideTooltip(),this.setPrivateRaw("touchHovering",!1),this.events.dispatch("pointerout",{type:"pointerout",target:r.target,originalEvent:r.originalEvent,point:r.point,simulated:r.simulated})),this._isDown&&this._handleUp(r)}),i.on("pointerover",()=>{this._handleOver()}),i.on("pointerout",()=>{this._handleOut()}),i.on("pointerdown",r=>{this._handleDown(r)})]):(this._display.interactive=!1,this._hoverDp&&(this._hoverDp.dispose(),this._hoverDp=void 0))}this.isDirty("forceInactive")&&(this._display.inactive=this.get("forceInactive",!1)),this.get("showTooltipOn")=="always"&&this._display.visible&&this.showTooltip()}dragStart(e){this._dragEvent=e,this.events.stopParentDispatch()}dragStop(e){if(this._dragEvent=void 0,this._dragPoint=void 0,this.events.stopParentDispatch(),this._isDragging){this._isDragging=!1;const t="dragstop";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}}_handleOver(){this.isHidden()||(this.get("active")&&this.states.lookup("hoverActive")?this.states.applyAnimate("hoverActive"):this.get("disabled")&&this.states.lookup("hoverDisabled")?this.states.applyAnimate("hoverDisabled"):this.states.applyAnimate("hover"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleOut(){this.isHidden()||(this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):(this.states.lookup("hover")||this.states.lookup("hoverActive"))&&this.states.applyAnimate("default"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleUp(e){if(!this.isHidden()){this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):this.states.lookup("down")&&(this.isHover()?this.states.applyAnimate("hover"):this.states.applyAnimate("default")),this._downPoint=void 0;const t=ns(e.originalEvent);delete this._downPoints[t],fe(this._downPoints).length==0&&(this._isDown=!1)}}_hasMoved(e){const t=ns(e.originalEvent),i=this._downPoints[t];if(i){const r=Math.abs(i.x-e.point.x),n=Math.abs(i.y-e.point.y);return r>5||n>5}return!1}_hasDown(){return fe(this._downPoints).length>0}_handleDown(e){const t=this.parent;if(t&&!this.get("draggable")&&t._handleDown(e),this.get("interactive")&&!this.isHidden()){this.states.lookup("down")&&this.states.applyAnimate("down"),this._downPoint={x:e.point.x,y:e.point.y},this._isDown=!0;const i=ns(e.originalEvent);this._downPoints[i]={x:e.point.x,y:e.point.y}}}dragMove(e){let t=this._dragEvent;if(t){if(t.simulated&&!e.simulated)return!0;let i=0,r=this.parent;for(;r!=null;)i+=r.get("rotation",0),r=r.parent;let n=e.point.x-t.point.x,a=e.point.y-t.point.y;const o=this.events;if(t.simulated&&!this._isDragging){this._isDragging=!0,this._dragEvent=e,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";o.isEnabled(l)&&o.dispatch(l,{type:l,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}if(this._isDragging){let l=this._dragPoint;this.set("x",l.x+n*Cs(i)+a*As(i)),this.set("y",l.y+a*Cs(i)-n*As(i));const h="dragged";o.isEnabled(h)&&o.dispatch(h,{type:h,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}else if(Math.hypot(n,a)>5){this._isDragging=!0,this._dragEvent=e,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";o.isEnabled(l)&&o.dispatch(l,{type:l,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}}}_updateSize(){}_getBounds(){this._localBounds=this._display.getLocalBounds()}depth(){let e=this.parent,t=0;for(;;){if(!e)return t;++t,e=e.parent}}markDirtySize(){this._sizeDirty=!0,this.markDirty()}markDirtyBounds(){if(this.get("isMeasured")){const e=this._display;this._root._addDirtyBounds(this),e.isMeasured=!0,e.invalidateBounds();const t=this.parent;t&&this.get("position")!="absolute"&&(t.get("width")==null||t.get("height")==null||t.get("layout"))&&t.markDirtyBounds(),this.get("focusable")&&this.isFocus()&&this.markDirtyAccessibility()}}markDirtyAccessibility(){this._root._invalidateAccessibility(this)}markDirtyLayer(){this._display.markDirtyLayer(!0)}markDirty(){super.markDirty(),this.markDirtyLayer()}_updateBounds(){const e=this._adjustedLocalBounds;let t;if(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?(this._getBounds(),this._fixMinBounds(this._localBounds),this.updatePivotPoint(),this._adjustedLocalBounds=this._display.getAdjustedBounds(this._localBounds),t=this._adjustedLocalBounds):(t={left:0,right:0,top:0,bottom:0},this._localBounds=t,this._adjustedLocalBounds=t),!e||e.left!==t.left||e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom){const i="boundschanged";this.events.isEnabled(i)&&this.events.dispatch(i,{type:i,target:this}),this.parent&&(this.parent.markDirty(),this.parent.markDirtyBounds())}}_fixMinBounds(e){let t=this.get("minWidth",this.getPrivate("minWidth")),i=this.get("minHeight",this.getPrivate("minHeight"));D(t)&&e.right-e.left0?e.right=e.left+r:e.left=e.right+r),D(n)&&(n>0?e.bottom=e.top+n:e.top=e.bottom+n)}_removeParent(e){e&&(e.children.removeValue(this),ke(e._percentageSizeChildren,this),ke(e._percentagePositionChildren,this))}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._statesHandled=!1}hover(){this.showTooltip(),this._handleOver()}unhover(){this.hideTooltip(),this._handleOut()}showTooltip(e){const t=this.getTooltip(),i=this.get("tooltipText"),r=this.get("tooltipHTML");if((i||r)&&t){const n=this.get("tooltipPosition"),a=this.getPrivate("tooltipTarget",this);n!="fixed"&&e||(this._display._setMatrix(),e=this.toGlobal(a._getTooltipPoint())),t.set("pointTo",e),t.set("tooltipTarget",a),t.get("x")||t.set("x",e.x),t.get("y")||t.set("y",e.y),i&&t.label.set("text",i),r&&t.label.set("html",r);const o=this.dataItem;if(o&&t.label._setDataItem(o),this.get("showTooltipOn")=="always"&&(e.x<0||e.x>this._root.width()||e.y<0||e.y>this._root.height()))return void this.hideTooltip();t.label.text.markDirtyText();const l=t.show();return this.setPrivateRaw("showingTooltip",!0),l}}hideTooltip(){const e=this.getTooltip();if(e&&e.get("tooltipTarget")==this.getPrivate("tooltipTarget",this)){let t=e.get("keepTargetHover")&&e.get("stateAnimationDuration",0)==0?400:void 0;const i=e.hide(t);return this.setPrivateRaw("showingTooltip",!1),i}}_getTooltipPoint(){const e=this._localBounds;if(e){let t=0,i=0;return this.get("isMeasured")?(t=e.left+qe(this.get("tooltipX",0),e.right-e.left),i=e.top+qe(this.get("tooltipY",0),e.bottom-e.top)):(t=qe(this.get("tooltipX",0),this.width()),i=qe(this.get("tooltipY",0),this.height())),{x:t,y:i}}return{x:0,y:0}}getTooltip(){let e=this.get("tooltip");if(e)return e;{let t=this.parent;if(t)return t.getTooltip()}}_updatePosition(){const e=this.parent;let t=this.get("dx",0),i=this.get("dy",0),r=this.get("x"),n=this.getPrivate("x"),a=0,o=0;const l=this.get("position");r instanceof U&&(r=e?e.innerWidth()*r.value+e.get("paddingLeft",0):0),D(r)?a=r+t:n!=null?a=n:e&&l=="relative"&&(a=e.get("paddingLeft",0)+t);let h=this.get("y"),f=this.getPrivate("y");h instanceof U&&(h=e?e.innerHeight()*h.value+e.get("paddingTop",0):0),D(h)?o=h+i:f!=null?o=f:e&&l=="relative"&&(o=e.get("paddingTop",0)+i);const u=this._display;if(u.x!=a||u.y!=o){u.invalidateBounds(),u.x=a,u.y=o;const p="positionchanged";this.events.isEnabled(p)&&this.events.dispatch(p,{type:p,target:this})}this.getPrivate("showingTooltip")&&this.showTooltip()}x(){let e=this.get("x"),t=this.getPrivate("x");const i=this.parent;return i?e instanceof U?qe(e,i.innerWidth())+i.get("paddingLeft",0):D(e)?e:t??i.get("paddingLeft",this._display.x):this._display.x}y(){let e=this.getPrivate("y");if(e!=null)return e;let t=this.get("y");const i=this.parent;return i?t instanceof U?qe(t,i.innerHeight())+i.get("paddingTop",0):D(t)?t:e??i.get("paddingTop",this._display.y):this._display.y}_dispose(){super._dispose(),this._display.dispose(),this._removeTemplateField(),this._removeParent(this.parent),this._root._removeFocusElement(this);const e=this.get("tooltip");e&&e.dispose(),this.markDirty()}adjustedLocalBounds(){return this._fixMinBounds(this._adjustedLocalBounds),this._adjustedLocalBounds}localBounds(){return this._localBounds}bounds(){const e=this._adjustedLocalBounds,t=this.x(),i=this.y();return{left:e.left+t,right:e.right+t,top:e.top+i,bottom:e.bottom+i}}globalBounds(){const e=this.localBounds(),t=this.toGlobal({x:e.left,y:e.top}),i=this.toGlobal({x:e.right,y:e.top}),r=this.toGlobal({x:e.right,y:e.bottom}),n=this.toGlobal({x:e.left,y:e.bottom});return{left:Math.min(t.x,i.x,r.x,n.x),top:Math.min(t.y,i.y,r.y,n.y),right:Math.max(t.x,i.x,r.x,n.x),bottom:Math.max(t.y,i.y,r.y,n.y)}}_onShow(e){}_onHide(e){}appear(e,t){return _i(this,void 0,void 0,function*(){return yield this.hide(0),t?new Promise((i,r)=>{this.setTimeout(()=>{i(this.show(e))},t)}):this.show(e)})}show(e){return _i(this,void 0,void 0,function*(){if(!this._isShowing){this._isHidden=!1,this._isShowing=!0,this._isHiding=!1,this.states.lookup("default").get("visible")&&this.set("visible",!0),this._onShow(e);const t=this.states.applyAnimate("default",e);yield wr(t),this._isShowing=!1}})}hide(e){return _i(this,void 0,void 0,function*(){if(!this._isHiding&&!this._isHidden){this._isHiding=!0,this._isShowing=!1;let t=this.states.lookup("hidden");t||(t=this.states.create("hidden",{opacity:0,visible:!1})),this._isHidden=!0,this._onHide(e);const i=this.states.applyAnimate("hidden",e);yield wr(i),this._isHiding=!1}})}isHidden(){return this._isHidden}isShowing(){return this._isShowing}isHiding(){return this._isHiding}isHover(){return this._display.hovering()}isFocus(){return this._root.focused(this)}isDragging(){return this._isDragging}isVisible(){return!(!this.get("visible")||!this.getPrivate("visible")||this.get("forceHidden"))}isVisibleDeep(){return this._parent?this._parent.isVisibleDeep()&&this.isVisible():this.isVisible()}compositeOpacity(){const e=this.get("opacity",1);return this._parent?this._parent.compositeOpacity()*e:e}width(){let e=this.get("width"),t=this.get("maxWidth",this.getPrivate("maxWidth")),i=this.get("minWidth",this.getPrivate("minWidth")),r=this.getPrivate("width"),n=0;if(D(r))n=r;else if(e==null)this._adjustedLocalBounds&&(n=this._adjustedLocalBounds.right-this._adjustedLocalBounds.left);else if(e instanceof U){const a=this.parent;n=a?a.innerWidth()*e.value:this._root.width()*e.value}else D(e)&&(n=e);return D(i)&&(n=Math.max(i,n)),D(t)&&(n=Math.min(t,n)),n}maxWidth(){let e=this.get("maxWidth",this.getPrivate("maxWidth"));if(D(e))return e;{let i=this.get("width");if(D(i))return i}const t=this.parent;return t?t.innerWidth():this._root.width()}maxHeight(){let e=this.get("maxHeight",this.getPrivate("maxHeight"));if(D(e))return e;{let i=this.get("height");if(D(i))return i}const t=this.parent;return t?t.innerHeight():this._root.height()}height(){let e=this.get("height"),t=this.get("maxHeight",this.getPrivate("maxHeight")),i=this.get("minHeight",this.getPrivate("minHeight")),r=this.getPrivate("height"),n=0;if(D(r))n=r;else if(e==null)this._adjustedLocalBounds&&(n=this._adjustedLocalBounds.bottom-this._adjustedLocalBounds.top);else if(e instanceof U){const a=this.parent;n=a?a.innerHeight()*e.value:this._root.height()*e.value}else D(e)&&(n=e);return D(i)&&(n=Math.max(i,n)),D(t)&&(n=Math.min(t,n)),n}_findStaticTemplate(e){return this._templateField&&e(this._templateField)?this._templateField:super._findStaticTemplate(e)}_walkParents(e){this._parent&&this._walkParent(e)}_walkParent(e){this._parent&&this._parent._walkParent(e),e(this)}get parent(){return this._parent}_setParent(e,t=!1){const i=this._parent;e!==i&&(this.markDirtyBounds(),e.markDirty(),this._parent=e,t&&(this._removeParent(i),e&&(this._addPercentageSizeChildren(),this._addPercentagePositionChildren())),this.markDirtyPosition(),this._applyThemes())}getNumberFormatter(){return this.get("numberFormatter",this._root.numberFormatter)}getDateFormatter(){return this.get("dateFormatter",this._root.dateFormatter)}getDurationFormatter(){return this.get("durationFormatter",this._root.durationFormatter)}toGlobal(e){return this._display.toGlobal(e)}toLocal(e){return this._display.toLocal(e)}_getDownPoint(){const e=this._getDownPointId();if(e)return this._downPoints[e]}_getDownPointId(){if(this._downPoints)return vl(this._downPoints,(e,t)=>e>t?1:e0&&(this._backgroundDisplay.beginFill(r,n),this._backgroundDisplay.drawRect(0,0,t,i),this._backgroundDisplay.endFill()),this._display.angle=this.get("rotation",0),this._draw(),this._pattern=this._root._renderer.createPattern(this._display,this._backgroundDisplay,e,t,i)}}};Object.defineProperty(Qt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Pattern"}),Object.defineProperty(Qt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:_e.classNames.concat([Qt.className])});let Jt=class extends Qt{constructor(){super(...arguments),Object.defineProperty(this,"_image",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_beforeChanged(){super._beforeChanged(),this._clear=!0,this.isDirty("src")&&this._load()}_draw(){super._draw();const e=this._image;if(e){const t=this.get("width",100),i=this.get("height",100),r=this.get("fit","image");let n=0,a=0;r=="pattern"?(n=t,a=i):(n=e.width,a=e.height,r=="image"&&(this.set("width",n),this.set("height",a)));let o=0,l=0;this.get("centered",!0)&&(o=t/2-n/2,l=i/2-a/2),this._display.image(e,n,a,o,l)}}_load(){const e=this.get("src");if(e){const t=new Image;t.src=e,t.decode().then(()=>{this._image=t,this._draw(),this.events.isEnabled("loaded")&&this.events.dispatch("loaded",{type:"loaded",target:this})}).catch(i=>{})}}};var Fi;Object.defineProperty(Jt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PicturePattern"}),Object.defineProperty(Jt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Qt.classNames.concat([Jt.className])}),function(s){s.ADD="lighter",s.COLOR="color",s.COLOR_BURN="color-burn",s.COLOR_DODGE="color-dodge",s.DARKEN="darken",s.DIFFERENCE="difference",s.DST_OVER="destination-over",s.EXCLUSION="exclusion",s.HARD_LIGHT="hard-light",s.HUE="hue",s.LIGHTEN="lighten",s.LUMINOSITY="luminosity",s.MULTIPLY="multiply",s.NORMAL="source-over",s.OVERLAY="overlay",s.SATURATION="saturation",s.SCREEN="screen",s.SOFT_LIGHT="soft-light",s.SRC_ATOP="source-atop",s.XOR="xor"}(Fi||(Fi={}));const Ru=["fill","fillOpacity","stroke","strokeWidth","strokeOpacity","fillPattern","strokePattern","fillGradient","strokeGradient","strokeDasharray","strokeDashoffset"];let He=class extends $e{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_beforeChanged(){if(super._beforeChanged(),(this.isDirty("draw")||this.isDirty("svgPath"))&&this.markDirtyBounds(),(this.isDirty("fill")||this.isDirty("stroke")||this.isDirty("visible")||this.isDirty("forceHidden")||this.isDirty("scale")||this.isDirty("fillGradient")||this.isDirty("strokeGradient")||this.isDirty("fillPattern")||this.isDirty("strokePattern")||this.isDirty("fillOpacity")||this.isDirty("strokeOpacity")||this.isDirty("strokeWidth")||this.isDirty("draw")||this.isDirty("blendMode")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("svgPath")||this.isDirty("lineJoin")||this.isDirty("shadowColor")||this.isDirty("shadowBlur")||this.isDirty("shadowOffsetX")||this.isDirty("shadowOffsetY"))&&(this._clear=!0),this._display.crisp=this.get("crisp",!1),this.isDirty("fillGradient")){const e=this.get("fillGradient");if(e){this._display.isMeasured=!0;const t=e.get("target");t&&(this._disposers.push(t.events.on("boundschanged",()=>{this._markDirtyKey("fill")})),this._disposers.push(t.events.on("positionchanged",()=>{this._markDirtyKey("fill")})))}}if(this.isDirty("strokeGradient")){const e=this.get("strokeGradient");if(e){this._display.isMeasured=!0;const t=e.get("target");t&&(this._disposers.push(t.events.on("boundschanged",()=>{this._markDirtyKey("stroke")})),this._disposers.push(t.events.on("positionchanged",()=>{this._markDirtyKey("stroke")})))}}}_changed(){if(super._changed(),this._clear){this.markDirtyBounds(),this.markDirtyLayer(),this._display.clear();let e=this.get("strokeDasharray");D(e)&&(e=e<.5?[0]:[e]),this._display.setLineDash(e);const t=this.get("strokeDashoffset");t&&this._display.setLineDashOffset(t);const i=this.get("blendMode",Fi.NORMAL);this._display.blendMode=i;const r=this.get("draw");r&&r(this._display,this);const n=this.get("svgPath");n!=null&&this._display.svgPath(n)}}_afterChanged(){if(super._afterChanged(),this._clear){const e=this.get("fill"),t=this.get("fillGradient"),i=this.get("fillPattern"),r=this.get("fillOpacity"),n=this.get("stroke"),a=this.get("strokeGradient"),o=this.get("strokePattern"),l=this.get("shadowColor"),h=this.get("shadowBlur"),f=this.get("shadowOffsetX"),u=this.get("shadowOffsetY"),p=this.get("shadowOpacity");if(l&&(h||f||u)&&this._display.shadow(l,h,f,u,p),i){let d=!1;!e||i.get("fill")&&!i.get("fillInherited")||(i.set("fill",e),i.set("fillInherited",!0),d=!0),!n||i.get("color")&&!i.get("colorInherited")||(i.set("color",n),i.set("colorInherited",!0),d=!0),d&&i._changed();const b=i.pattern;b&&(this._display.beginFill(b,r),this._display.endFill(),i instanceof Jt&&i.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}else if(t){if(e){const b=t.get("stops",[]);b.length&&k(b,c=>{c.color&&!c.colorInherited||!e||(c.color=e,c.colorInherited=!0),(c.opacity==null||c.opacityInherited)&&(c.opacity=r,c.opacityInherited=!0)})}const d=t.getFill(this);d&&(this._display.beginFill(d,r),this._display.endFill())}else e&&(this._display.beginFill(e,r),this._display.endFill());if(n||a||o){const d=this.get("strokeOpacity");let b=this.get("strokeWidth",1);this.get("nonScalingStroke")&&(b/=this.get("scale",1)),this.get("crisp")&&(b/=this._root._renderer.resolution);const c=this.get("lineJoin");if(o){let y=!1;!n||o.get("color")&&!o.get("colorInherited")||(o.set("color",n),o.set("colorInherited",!0),y=!0),y&&o._changed();const v=o.pattern;v&&(this._display.lineStyle(b,v,d,c),this._display.endStroke(),o instanceof Jt&&o.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}else if(a){const y=a.get("stops",[]);y.length&&k(y,x=>{x.color&&!x.colorInherited||!n||(x.color=n,x.colorInherited=!0),(x.opacity==null||x.opacityInherited)&&(x.opacity=d,x.opacityInherited=!0)});const v=a.getFill(this);v&&(this._display.lineStyle(b,v,d,c),this._display.endStroke())}else n&&(this._display.lineStyle(b,n,d,c),this._display.endStroke())}this.getPrivate("showingTooltip")&&this.showTooltip()}this._clear=!1}};Object.defineProperty(He,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Graphics"}),Object.defineProperty(He,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:$e.classNames.concat([He.className])});let Ot=class extends He{_beforeChanged(){super._beforeChanged(),(this.isDirty("width")||this.isDirty("height")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}_changed(){super._changed(),this._clear&&!this.get("draw")&&this._draw()}_draw(){this._display.drawRect(0,0,this.width(),this.height())}_updateSize(){this.markDirty(),this._clear=!0}};function ze(s,e){s.get("reverseChildren",!1)?s.children.eachReverse(e):s.children.each(e)}Object.defineProperty(Ot,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Rectangle"}),Object.defineProperty(Ot,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:He.classNames.concat([Ot.className])});let We=class extends _e{};Object.defineProperty(We,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Layout"}),Object.defineProperty(We,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:_e.classNames.concat([We.className])});let Dt=class extends We{updateContainer(e){let t=e.get("paddingLeft",0),i=e.innerWidth(),r=0;ze(e,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("width");if(o instanceof U){r+=o.value;let l=i*o.value,h=a.get("minWidth",a.getPrivate("minWidth",-1/0));h>l&&(i-=h,r-=o.value);let f=a.get("maxWidth",a.getPrivate("maxWidth",1/0));l>f&&(i-=f,r-=o.value)}else D(o)||(o=a.width()),i-=o+a.get("marginLeft",0)+a.get("marginRight",0)}}),(i<=0||i==1/0)&&(i=.1),ze(e,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("width");if(o instanceof U){let l=i*o.value/r-a.get("marginLeft",0)-a.get("marginRight",0),h=a.get("minWidth",a.getPrivate("minWidth",-1/0)),f=a.get("maxWidth",a.getPrivate("maxWidth",1/0));l=Math.min(Math.max(h,l),f),a.setPrivate("width",l)}}});let n=t;ze(e,a=>{if(a.get("position")=="relative")if(a.isVisible()){let o=a.adjustedLocalBounds(),l=a.get("marginLeft",0),h=a.get("marginRight",0),f=a.get("maxWidth"),u=o.left,p=o.right;f&&p-u>f&&(p=u+f);let d=n+l-u;a.setPrivate("x",d),n=d+p+h}else a.setPrivate("x",void 0)})}};Object.defineProperty(Dt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"HorizontalLayout"}),Object.defineProperty(Dt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:We.classNames.concat([Dt.className])});let Ft=class extends We{updateContainer(e){let t=e.get("paddingTop",0),i=e.innerHeight(),r=0;ze(e,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("height");if(o instanceof U){r+=o.value;let l=i*o.value,h=a.get("minHeight",a.getPrivate("minHeight",-1/0));h>l&&(i-=h,r-=o.value);let f=a.get("maxHeight",a.getPrivate("maxHeight",1/0));l>f&&(i-=f,r-=o.value)}else D(o)||(o=a.height()),i-=o+a.get("marginTop",0)+a.get("marginBottom",0)}}),(i<=0||i==1/0)&&(i=.1),ze(e,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("height");if(o instanceof U){let l=i*o.value/r-a.get("marginTop",0)-a.get("marginBottom",0),h=a.get("minHeight",a.getPrivate("minHeight",-1/0)),f=a.get("maxHeight",a.getPrivate("maxHeight",1/0));l=Math.min(Math.max(h,l),f),a.setPrivate("height",l)}}});let n=t;ze(e,a=>{if(a.get("position")=="relative")if(a.isVisible()){let o=a.adjustedLocalBounds(),l=a.get("marginTop",0),h=o.top,f=o.bottom,u=a.get("maxHeight");u&&f-h>u&&(f=h+u);let p=a.get("marginBottom",0),d=n+l-h;a.setPrivate("y",d),n=d+f+p}else a.setPrivate("y",void 0)})}};Object.defineProperty(Ft,"className",{enumerable:!0,configurable:!0,writable:!0,value:"VerticalLayout"}),Object.defineProperty(Ft,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:We.classNames.concat([Ft.className])});let gt=class extends We{_afterNew(){this._setRawDefault("maxColumns",Number.MAX_VALUE),super._afterNew()}updateContainer(e){let t=e.get("paddingLeft",0),i=e.get("paddingRight",0),r=e.get("paddingTop",0),n=e.maxWidth()-t-i,a=n,o=1;ze(e,b=>{if(b.get("visible")&&b.getPrivate("visible")&&!b.get("forceHidden")&&b.get("position")!="absolute"){let c=b.width();co&&(o=c)}}),a=we(a,1,n),o=we(o,1,n);let l=1;l=this.get("fixedWidthGrid")?n/o:n/a,l=Math.max(1,Math.floor(l)),l=Math.min(this.get("maxColumns",Number.MAX_VALUE),l);let h=this.getColumnWidths(e,l,o,n),f=r,u=0,p=0;l=h.length;let d=t;ze(e,b=>{if(b.get("position")=="relative"&&b.isVisible()){const c=b.get("marginTop",0),y=b.get("marginBottom",0);let v=b.adjustedLocalBounds(),x=b.get("marginLeft",0),w=b.get("marginRight",0),P=d+x-v.left,O=f+c-v.top;b.setPrivate("x",P),b.setPrivate("y",O),d+=h[u]+w,p=Math.max(p,b.height()+c+y),u++,u>=l&&(u=0,d=t,f+=p)}})}getColumnWidths(e,t,i,r){let n=0,a=[],o=0;return ze(e,l=>{let h=l.adjustedLocalBounds();l.get("position")!="absolute"&&l.isVisible()&&(this.get("fixedWidthGrid")?a[o]=i:a[o]=Math.max(0|a[o],h.right-h.left+l.get("marginLeft",0)+l.get("marginRight",0)),o{n+=l}),n>r?t>2?(t-=1,this.getColumnWidths(e,t,i,r)):[r]:a}};Object.defineProperty(gt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"GridLayout"}),Object.defineProperty(gt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:We.classNames.concat([gt.className])});let Le=class{static escape(e){return e.replace(/\[\[/g,this.prefix+"1").replace(/([^\/\]]{1})\]\]/g,"$1"+this.prefix+"2").replace(/\]\]/g,this.prefix+"2").replace(/\{\{/g,this.prefix+"3").replace(/\}\}/g,this.prefix+"4").replace(/\'\'/g,this.prefix+"5")}static unescape(e){return e.replace(new RegExp(this.prefix+"1","g"),"[[").replace(new RegExp(this.prefix+"2","g"),"]]").replace(new RegExp(this.prefix+"3","g"),"{{").replace(new RegExp(this.prefix+"4","g"),"}}").replace(new RegExp(this.prefix+"5","g"),"''")}static cleanUp(e){return e.replace(/\[\[/g,"[").replace(/\]\]/g,"]").replace(/\{\{/g,"{").replace(/\}\}/g,"}").replace(/\'\'/g,"'")}static chunk(e,t=!1,i=!1){let r=[];e=this.escape(e);let n=t?e.split("'"):[e];for(let a=0;a{e.dispose()}),this.getPrivate("htmlElement")&&this._root._removeHTMLContent(this),super._dispose()}_changed(){if(super._changed(),this.isDirty("interactiveChildren")&&(this._display.interactiveChildren=this.get("interactiveChildren",!1)),this.isDirty("layout")&&(this._prevWidth=0,this._prevHeight=0,this.markDirtyBounds(),this._prevSettings.layout&&this.children.each(e=>{e.removePrivate("x"),e.removePrivate("y")})),(this.isDirty("paddingTop")||this.isDirty("paddingBottom")||this.isDirty("paddingLeft")||this.isDirty("paddingRight"))&&this.children.each(e=>{e.markDirtyPosition()}),this.isDirty("maskContent")){const e=this._childrenDisplay;let t=this._contentMask;this.get("maskContent")?t||(t=Ot.new(this._root,{x:-.5,y:-.5,width:this.width()+1,height:this.height()+1}),this._contentMask=t,e.addChildAt(t._display,0),e.mask=t._display):t&&(e.removeChild(t._display),e.mask=null,t.dispose(),this._contentMask=void 0)}}_updateSize(){super._updateSize(),k(this._percentageSizeChildren,e=>{e._updateSize()}),k(this._percentagePositionChildren,e=>{e.markDirtyPosition(),e._updateSize()}),this.updateBackground()}updateBackground(){const e=this.get("background");let t=this._localBounds;if(t&&!this.isHidden()){let i=t.left,r=t.top,n=t.right-i,a=t.bottom-r,o=this.get("maxWidth"),l=this.get("maxHeight");l&&a>l&&(a=l),o&&n>o&&(n=o);let h=this.width(),f=this.height();e&&(e.setAll({width:n,height:a,x:i,y:r}),this._display.interactive&&(e._display.interactive=!0));const u=this._contentMask;u&&u.setAll({width:h+1,height:f+1});const p=this.get("verticalScrollbar");if(p){p.set("height",f),p.set("x",h-p.width()-p.get("marginRight",0)),p.set("end",p.get("start",0)+f/this._contentHeight);const d=p.get("background");d&&d.setAll({width:p.width(),height:f});let b=!0;this._contentHeight<=f&&(b=!1),p.setPrivate("visible",b)}}}_applyThemes(){return!!super._applyThemes()&&(this.eachChildren(e=>{e._applyThemes()}),!0)}_applyState(e){super._applyState(e),this.get("setStateOnChildren")&&this.eachChildren(t=>{t.states.apply(e)})}_applyStateAnimated(e,t){super._applyStateAnimated(e,t),this.get("setStateOnChildren")&&this.eachChildren(i=>{i.states.applyAnimate(e,t)})}innerWidth(){return this.width()-this.get("paddingRight",0)-this.get("paddingLeft",0)}innerHeight(){return this.height()-this.get("paddingTop",0)-this.get("paddingBottom",0)}_getBounds(){let e=this.get("width"),t=this.get("height"),i=this.getPrivate("width"),r=this.getPrivate("height"),n={left:0,top:0,right:this.width(),bottom:this.height()},a=this.get("layout"),o=!1,l=!1;if((a instanceof Dt||a instanceof gt)&&(o=!0),a instanceof Ft&&(l=!0),e==null&&i==null||t==null&&r==null||this.get("verticalScrollbar")){let h=Number.MAX_VALUE,f=h,u=-h,p=h,d=-h;const b=this.get("paddingLeft",0),c=this.get("paddingTop",0),y=this.get("paddingRight",0),v=this.get("paddingBottom",0);this.children.each(x=>{if(x.get("position")!="absolute"&&x.get("isMeasured")){let w=x.adjustedLocalBounds(),P=x.x(),O=x.y(),R=P+w.left,S=P+w.right,L=O+w.top,z=O+w.bottom;o&&(R-=x.get("marginLeft",0),S+=x.get("marginRight",0)),l&&(L-=x.get("marginTop",0),z+=x.get("marginBottom",0)),Ru&&(u=S),Ld&&(d=z)}}),f==h&&(f=0),u==-h&&(u=0),p==h&&(p=0),d==-h&&(d=0),n.left=f-b,n.top=p-c,n.right=u+y,n.bottom=d+v}this._contentWidth=n.right-n.left,this._contentHeight=n.bottom-n.top,D(e)&&(n.left=0,n.right=e),D(i)&&(n.left=0,n.right=i),D(t)&&(n.top=0,n.bottom=t),D(r)&&(n.top=0,n.bottom=r),this._localBounds=n}_updateBounds(){const e=this.get("layout");e&&e.updateContainer(this),super._updateBounds(),this.updateBackground()}markDirty(){super.markDirty(),this._root._addDirtyParent(this)}_prepareChildren(){const e=this.innerWidth(),t=this.innerHeight();if(e!=this._prevWidth||t!=this._prevHeight){let i=this.get("layout"),r=!1,n=!1;i&&((i instanceof Dt||i instanceof gt)&&(r=!0),i instanceof Ft&&(n=!0)),k(this._percentageSizeChildren,a=>{if(!r){let o=a.get("width");o instanceof U&&a.setPrivate("width",o.value*e)}if(!n){let o=a.get("height");o instanceof U&&a.setPrivate("height",o.value*t)}}),k(this._percentagePositionChildren,a=>{a.markDirtyPosition(),a.markDirtyBounds()}),this._prevWidth=e,this._prevHeight=t,this._sizeDirty=!0,this.updateBackground()}this._handleStates()}_updateChildren(){if(this.isDirty("html")){const e=this.get("html");e&&e!==""?this._root._setHTMLContent(this,Si(this,this.get("html",""))):this._root._removeHTMLContent(this),this._root._positionHTMLElement(this)}if(this.isDirty("verticalScrollbar")){const e=this.get("verticalScrollbar");if(e){e._setParent(this),e.children.removeValue(e.startGrip),e.children.removeValue(e.endGrip),this.set("maskContent",!0),this.set("paddingRight",e.width()+e.get("marginRight",0)+e.get("marginLeft",0));let t=this.get("background");t||(t=this.set("background",Ot.new(this._root,{themeTags:["background"],fillOpacity:0,fill:this._root.interfaceColors.get("alternativeBackground")}))),this._vsbd0=this.events.on("wheel",i=>{const r=i.originalEvent;if(!El(r,this))return;r.preventDefault();let n=r.deltaY/5e3;const a=e.get("start",0),o=e.get("end",1);a+n<=0&&(n=-a),o+n>=1&&(n=1-o),a+n>=0&&o+n<=1&&(e.set("start",a+n),e.set("end",o+n))}),this._disposers.push(this._vsbd0),this._vsbd1=e.events.on("rangechanged",()=>{let i=this._contentHeight;const r=this._childrenDisplay,n=this._contentMask;r.y=-e.get("start")*i,r.markDirtyLayer(),n&&(n._display.y=-r.y,r.mask=n._display)}),this._disposers.push(this._vsbd1),this._display.addChild(e._display)}else{const t=this._prevSettings.verticalScrollbar;t&&(this._display.removeChild(t._display),this._vsbd0&&this._vsbd0.dispose(),this._vsbd1&&this._vsbd1.dispose(),this._childrenDisplay.y=0,this.setPrivate("height",void 0),this.set("maskContent",!1),this.set("paddingRight",void 0))}}if(this.isDirty("background")){const e=this._prevSettings.background;e&&this._display.removeChild(e._display);const t=this.get("background");t instanceof $e&&(t.set("isMeasured",!1),t._setParent(this),this._display.addChildAt(t._display,0))}if(this.isDirty("mask")){const e=this.get("mask"),t=this._prevSettings.mask;if(t&&(this._display.removeChild(t._display),t!=e&&t.dispose()),e){const i=e.parent;i&&i.children.removeValue(e),e._setParent(this),this._display.addChildAt(e._display,0),this._childrenDisplay.mask=e._display}}}_processTemplateField(){super._processTemplateField(),this.children.each(e=>{e._processTemplateField()})}walkChildren(e){this.children.each(t=>{t instanceof Sn&&t.walkChildren(e),e(t)})}eachChildren(e){const t=this.get("background");t&&e(t);const i=this.get("verticalScrollbar");i&&e(i);const r=this.get("mask");r&&e(r),this.children.values.forEach(n=>{e(n)})}allChildren(){const e=[];return this.eachChildren(t=>{e.push(t)}),e}_setDataItem(e){const t=e!==this._dataItem;super._setDataItem(e);const i=this.get("html","");i&&i!==""&&t&&this._root._setHTMLContent(this,Si(this,i))}};Object.defineProperty(Pe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Container"}),Object.defineProperty(Pe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:$e.classNames.concat([Pe.className])});let Zt=class extends $e{constructor(){super(...arguments),Object.defineProperty(this,"textStyle",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeTextStyle()}),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeText("",this.textStyle)}),Object.defineProperty(this,"_textStyles",{enumerable:!0,configurable:!0,writable:!0,value:["textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale"]}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_updateBounds(){if(this.get("text"))super._updateBounds();else{let e={left:0,right:0,top:0,bottom:0};this._adjustedLocalBounds=e}}_changed(){super._changed(),this._display.clear();let e=this.textStyle;if(this.isDirty("opacity")){let t=this.get("opacity",1);this._display.alpha=t}if((this.isDirty("text")||this.isDirty("populateText"))&&(this._display.text=this._getText(),this.markDirtyBounds(),this.get("role")=="tooltip"&&this._root.updateTooltip(this)),this.isPrivateDirty("tooltipElement")&&this.getPrivate("tooltipElement")&&this._disposers.push(new ne(()=>{this._root._removeTooltipElement(this)})),this.isDirty("width")&&(e.wordWrapWidth=this.width(),this.markDirtyBounds()),this.isDirty("oversizedBehavior")&&(e.oversizedBehavior=this.get("oversizedBehavior","none"),this.markDirtyBounds()),this.isDirty("breakWords")&&(e.breakWords=this.get("breakWords",!1),this.markDirtyBounds()),this.isDirty("ellipsis")&&(e.ellipsis=this.get("ellipsis"),this.markDirtyBounds()),this.isDirty("ignoreFormatting")&&(e.ignoreFormatting=this.get("ignoreFormatting",!1),this.markDirtyBounds()),this.isDirty("minScale")&&(e.minScale=this.get("minScale",0),this.markDirtyBounds()),this.isDirty("fill")){let t=this.get("fill");t&&(e.fill=t)}if(this.isDirty("fillOpacity")){let t=this.get("fillOpacity",1);t&&(e.fillOpacity=t)}(this.isDirty("maxWidth")||this.isPrivateDirty("maxWidth"))&&(e.maxWidth=this.get("maxWidth",this.getPrivate("maxWidth")),this.markDirtyBounds()),(this.isDirty("maxHeight")||this.isPrivateDirty("maxHeight"))&&(e.maxHeight=this.get("maxHeight",this.getPrivate("maxHeight")),this.markDirtyBounds()),k(this._textStyles,t=>{this._dirty[t]&&(e[t]=this.get(t),this.markDirtyBounds())}),e.fontSize=this.get("fontSize"),e.fontFamily=this.get("fontFamily"),this._display.style=e,this.isDirty("role")&&this.get("role")=="tooltip"&&this._root.updateTooltip(this)}_getText(){const e=this.get("text","");return this.get("populateText")?Si(this,e):e}markDirtyText(){this._display.text=this._getText(),this.get("role")=="tooltip"&&this._root.updateTooltip(this),this.markDirtyBounds(),this.markDirty()}_setDataItem(e){super._setDataItem(e),this.get("populateText")&&this.markDirtyText()}getNumberFormatter(){return this.parent?this.parent.getNumberFormatter():super.getNumberFormatter()}getDateFormatter(){return this.parent?this.parent.getDateFormatter():super.getDateFormatter()}getDurationFormatter(){return this.parent?this.parent.getDurationFormatter():super.getDurationFormatter()}};Object.defineProperty(Zt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Text"}),Object.defineProperty(Zt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:$e.classNames.concat([Zt.className])});let xi=class extends Pe{constructor(){super(...arguments),Object.defineProperty(this,"_text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_textKeys",{enumerable:!0,configurable:!0,writable:!0,value:["text","fill","fillOpacity","textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","populateText","role","ignoreFormatting"]})}get text(){return this._text}_afterNew(){super._afterNew(),this._makeText(),k(this._textKeys,e=>{const t=this.get(e);t!=null&&this._text.set(e,t)}),this.get("html","")!==""&&this._text.set("text",""),this.onPrivate("maxWidth",()=>{this._setMaxDimentions()}),this.onPrivate("maxHeight",()=>{this._setMaxDimentions()})}_makeText(){this._text=this.children.push(Zt.new(this._root,{}))}_updateChildren(){if(super._updateChildren(),k(this._textKeys,e=>{this._text.set(e,this.get(e))}),this.isDirty("maxWidth")&&this._setMaxDimentions(),this.isDirty("maxHeight")&&this._setMaxDimentions(),this.isDirty("rotation")&&this._setMaxDimentions(),this.get("html","")!==""?this._text.set("text",""):this._text.set("text",this.get("text")),this.isDirty("textAlign")||this.isDirty("width")){const e=this.get("textAlign");let t;this.get("width")!=null?t=e=="right"?Q:e=="center"?ie:0:e=="left"||e=="start"?t=this.get("paddingLeft"):e!="right"&&e!="end"||(t=-this.get("paddingRight")),this.text.set("x",t)}}_setMaxDimentions(){const e=this.get("rotation"),t=e==90||e==270||e==-90,i=this.get("maxWidth",this.getPrivate("maxWidth",1/0));D(i)?this.text.set(t?"maxHeight":"maxWidth",i-this.get("paddingLeft",0)-this.get("paddingRight",0)):this.text.set(t?"maxHeight":"maxWidth",void 0);const r=this.get("maxHeight",this.getPrivate("maxHeight",1/0));D(r)?this.text.set(t?"maxWidth":"maxHeight",r-this.get("paddingTop",0)-this.get("paddingBottom",0)):this.text.set(t?"maxWidth":"maxHeight",void 0)}_setDataItem(e){super._setDataItem(e),this._markDirtyKey("text"),this.text.get("populateText")&&this.text.markDirtyText()}getText(){return this._text._getText()}};Object.defineProperty(xi,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Label"}),Object.defineProperty(xi,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Pe.classNames.concat([xi.className])});class lh{constructor(e,t){if(Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rules",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._root=e,!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`")}static new(e){const t=new this(e,!0);return t.setupDefaultRules(),t}setupDefaultRules(){}_lookupRules(e){return this._rules[e]}ruleRaw(e,t=[]){let i=this._rules[e];i||(i=this._rules[e]=[]),t.sort(pt);const{index:r,found:n}=fl(i,a=>{const o=pt(a.tags.length,t.length);return o===0?In(a.tags,t,pt):o});if(n)return i[r].template;{const a=Ts.new({});return i.splice(r,0,{tags:t,template:a}),a}}rule(e,t=[]){return this.ruleRaw(e,t)}}let St=class extends He{_beforeChanged(){super._beforeChanged(),(this.isDirty("pointerBaseWidth")||this.isDirty("cornerRadius")||this.isDirty("pointerLength")||this.isDirty("pointerX")||this.isDirty("pointerY")||this.isDirty("width")||this.isDirty("height"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){this.markDirtyBounds();let e=this.width(),t=this.height();if(e>0&&t>0){let i=this.get("cornerRadius",8);i=we(i,0,Math.min(e/2,t/2));let r=this.get("pointerX",0),n=this.get("pointerY",0),a=this.get("pointerBaseWidth",15)/2,o=0,l=0,h=0,f=(r-o)*(t-l)-(n-l)*(e-o),u=(r-h)*(0-t)-(n-t)*(e-h);const p=this._display;if(p.moveTo(i,0),f>0&&u>0){let d=Math.round(we(r,i+a,e-a-i));n=we(n,-1/0,0),p.lineTo(d-a,0),p.lineTo(r,n),p.lineTo(d+a,0)}if(p.lineTo(e-i,0),p.arcTo(e,0,e,i,i),f>0&&u<0){let d=Math.round(we(n,i+a,t-a-i));r=we(r,e,1/0),p.lineTo(e,i),p.lineTo(e,Math.max(d-a,i)),p.lineTo(r,n),p.lineTo(e,d+a)}if(p.lineTo(e,t-i),p.arcTo(e,t,e-i,t,i),f<0&&u<0){let d=Math.round(we(r,i+a,e-a-i));n=we(n,t,1/0),p.lineTo(e-i,t),p.lineTo(d+a,t),p.lineTo(r,n),p.lineTo(d-a,t)}if(p.lineTo(i,t),p.arcTo(0,t,0,t-i,i),f<0&&u>0){let d=Math.round(we(n,i+a,t-i-a));r=we(r,-1/0,0),p.lineTo(0,t-i),p.lineTo(0,d+a),p.lineTo(r,n),p.lineTo(0,Math.max(d-a,i))}p.lineTo(0,i),p.arcTo(0,0,i,0,i),p.closePath()}}}};Object.defineProperty(St,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PointedRectangle"}),Object.defineProperty(St,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:He.classNames.concat([St.className])});let ei=class extends Pe{constructor(e,t,i,r=[]){super(e,t,i,r),Object.defineProperty(this,"_fx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_fy",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_label",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fillDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_labelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_w",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_h",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_keepHoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlContentHovered",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._settings.themeTags=zl(this._settings.themeTags,["tooltip"]),super._afterNew(),this.set("background",St.new(this._root,{themeTags:["tooltip","background"]})),this._label=this.children.push(xi.new(this._root,{})),this._disposers.push(this._label.events.on("boundschanged",()=>{this._updateBackground()})),this._disposers.push(this.on("bounds",()=>{this._updateBackground()})),this._updateTextColor(),this._root.tooltipContainer.children.push(this),this.hide(0),this._disposers.push(this.label.onPrivate("htmlElement",e=>{e&&(se(e,"pointerover",t=>{this._htmlContentHovered=!0}),se(e,"pointerout",t=>{this._htmlContentHovered=!1}))})),this._root._tooltips.push(this)}get label(){return this._label}dispose(){super.dispose(),Qe(this._root._tooltips,this)}_updateChildren(){super._updateChildren(),(this.isDirty("pointerOrientation")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&this.get("background")._markDirtyKey("width"),this.get("labelText")!=null&&this.label.set("text",this.get("labelText")),this.get("labelHTML")!=null&&this.label.set("html",this.get("labelHTML"))}_changed(){if(super._changed(),(this.isDirty("pointTo")||this.isDirty("pointerOrientation"))&&this._updateBackground(),this.isDirty("tooltipTarget")&&this.updateBackgroundColor(),this.isDirty("keepTargetHover"))if(this.get("keepTargetHover")){const e=this.get("background");this._keepHoverDp=new Me([e.events.on("pointerover",t=>{let i=this.get("tooltipTarget");i&&(i.parent&&i.parent.getPrivate("tooltipTarget")==i&&(i=i.parent),i.hover())}),e.events.on("pointerout",t=>{let i=this.get("tooltipTarget");i&&(i.parent&&i.parent.getPrivate("tooltipTarget")==i&&(i=i.parent),this._htmlContentHovered||i.unhover())})])}else this._keepHoverDp&&(this._keepHoverDp.dispose(),this._keepHoverDp=void 0)}_onShow(){super._onShow(),this.updateBackgroundColor()}updateBackgroundColor(){let e=this.get("tooltipTarget");const t=this.get("background");let i,r;e&&t&&(i=e.get("fill"),r=e.get("stroke"),i==null&&(i=r),this.get("getFillFromSprite")&&(this._fillDp&&this._fillDp.dispose(),i!=null&&t.set("fill",i),this._fillDp=e.on("fill",n=>{n!=null&&(t.set("fill",n),this._updateTextColor(n))}),this._disposers.push(this._fillDp)),this.get("getStrokeFromSprite")&&(this._strokeDp&&this._strokeDp.dispose(),i!=null&&t.set("stroke",i),this._strokeDp=e.on("fill",n=>{n!=null&&t.set("stroke",n)}),this._disposers.push(this._strokeDp)),this.get("getLabelFillFromSprite")&&(this._labelDp&&this._labelDp.dispose(),i!=null&&this.label.set("fill",i),this._labelDp=e.on("fill",n=>{n!=null&&this.label.set("fill",n)}),this._disposers.push(this._labelDp))),this._updateTextColor(i)}_updateTextColor(e){this.get("autoTextColor")&&(e==null&&(e=this.get("background").get("fill")),e==null&&(e=this._root.interfaceColors.get("background")),e instanceof I&&this.label.set("fill",I.alternative(e,this._root.interfaceColors.get("alternativeText"),this._root.interfaceColors.get("text"))))}_setDataItem(e){super._setDataItem(e),this.label._setDataItem(e)}_updateBackground(){super.updateBackground();const e=this._root.container;if(e){let t=.5,i=.5,r=this.get("centerX");r instanceof U&&(t=r.value);let n=this.get("centerY");n instanceof U&&(i=n.value);let a=e.width(),o=e.height(),l=this.parent,h=0,f=0;if(l){h=l.x(),f=l.y();const Y=l.get("layerMargin");Y&&(h+=Y.left||0,f+=Y.top||0,a+=(Y.left||0)+(Y.right||0),o+=(Y.top||0)+(Y.bottom||0))}const u=this.get("bounds",{left:-h,top:-f,right:a-h,bottom:o-f});this._updateBounds();let p=this.width(),d=this.height();p===0&&(p=this._w),d===0&&(d=this._h);let b=this.get("pointTo",{x:a/2,y:o/2}),c=b.x,y=b.y,v=this.get("pointerOrientation"),x=this.get("background"),w=0,P=0,O=0;x instanceof St&&(w=x.get("pointerLength",0),P=x.get("strokeWidth",0)/2,O=P,x.set("width",p),x.set("height",d));let R=0,S=0,L=u.right-u.left,z=u.bottom-u.top;v=="horizontal"||v=="left"||v=="right"?(P=0,v=="horizontal"?c>u.left+L/2?(c-=p*(1-t)+w,O*=-1):c+=p*t+w:v=="left"?c+=p*(1-t)+w:(c-=p*t+w,O*=-1)):(O=0,v=="vertical"?y>u.top+d/2+w?y-=d*(1-i)+w:(y+=d*i+w,P*=-1):v=="down"?y-=d*(1-i)+w:(y+=d*i+w,P*=-1)),c=we(c,u.left+p*t,u.left+L-p*(1-t))+O,y=we(y,u.top+d*i,u.top+z-d*(1-i))-P,R=b.x-c+p*t+O,S=b.y-y+d*i-P,this._fx=c,this._fy=y;const V=this.get("animationDuration",0);if(V>0&&this.get("visible")&&this.get("opacity")>.1){const Y=this.get("animationEasing");this.animate({key:"x",to:c,duration:V,easing:Y}),this.animate({key:"y",to:y,duration:V,easing:Y})}else this.set("x",c),this.set("y",y);x instanceof St&&(x.set("pointerX",R),x.set("pointerY",S)),p>0&&(this._w=p),d>0&&(this._h=d)}}};Object.defineProperty(ei,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tooltip"}),Object.defineProperty(ei,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Pe.classNames.concat([ei.className])});function B(s,e,t,i){s.set(e,t.get(i)),t.on(i,r=>{s.set(e,r)})}let hh=class extends lh{setupDefaultRules(){super.setupDefaultRules();const e=this._root.language,t=this._root.interfaceColors,i=this._root.horizontalLayout,r=this._root.verticalLayout,n=this.rule.bind(this);n("InterfaceColors").setAll({stroke:I.fromHex(15066597),fill:I.fromHex(15987699),primaryButton:I.fromHex(6788316),primaryButtonHover:I.fromHex(6779356),primaryButtonDown:I.fromHex(6872182),primaryButtonActive:I.fromHex(6872182),primaryButtonText:I.fromHex(16777215),primaryButtonStroke:I.fromHex(16777215),secondaryButton:I.fromHex(14277081),secondaryButtonHover:I.fromHex(10724259),secondaryButtonDown:I.fromHex(9276813),secondaryButtonActive:I.fromHex(15132390),secondaryButtonText:I.fromHex(0),secondaryButtonStroke:I.fromHex(16777215),grid:I.fromHex(0),background:I.fromHex(16777215),alternativeBackground:I.fromHex(0),text:I.fromHex(0),alternativeText:I.fromHex(16777215),disabled:I.fromHex(11382189),positive:I.fromHex(5288704),negative:I.fromHex(11730944)});{const a=n("ColorSet");a.setAll({passOptions:{hue:.05,saturation:0,lightness:0},colors:[I.fromHex(6797276)],step:1,reuse:!1,startIndex:0}),a.setPrivate("currentStep",0),a.setPrivate("currentPass",0)}n("Entity").setAll({stateAnimationDuration:0,stateAnimationEasing:pi(Wt)}),n("Component").setAll({interpolationDuration:0,interpolationEasing:pi(Wt)}),n("Sprite").setAll({visible:!0,scale:1,opacity:1,rotation:0,position:"relative",tooltipX:ie,tooltipY:ie,tooltipPosition:"fixed",isMeasured:!0}),n("Sprite").states.create("default",{visible:!0,opacity:1}),n("Container").setAll({interactiveChildren:!0,setStateOnChildren:!1}),n("Graphics").setAll({strokeWidth:1}),n("Chart").setAll({width:Q,height:Q,interactiveChildren:!1}),n("Sprite",["horizontal","center"]).setAll({centerX:ie,x:ie}),n("Sprite",["vertical","center"]).setAll({centerY:ie,y:ie}),n("Container",["horizontal","layout"]).setAll({layout:i}),n("Container",["vertical","layout"]).setAll({layout:r}),n("Pattern").setAll({repetition:"repeat",width:50,height:50,rotation:0,fillOpacity:1}),n("LinePattern").setAll({gap:6,colorOpacity:1,width:49,height:49}),n("RectanglePattern").setAll({gap:6,checkered:!1,centered:!0,maxWidth:5,maxHeight:5,width:48,height:48,strokeWidth:0}),n("CirclePattern").setAll({gap:5,checkered:!1,centered:!1,radius:3,strokeWidth:0,width:45,height:45}),n("LinearGradient").setAll({rotation:90}),n("Legend").setAll({fillField:"fill",strokeField:"stroke",nameField:"name",layout:gt.new(this._root,{}),layer:30,clickTarget:"itemContainer"}),n("Container",["legend","item","itemcontainer"]).setAll({paddingLeft:5,paddingRight:5,paddingBottom:5,paddingTop:5,layout:i,setStateOnChildren:!0,interactiveChildren:!1,ariaChecked:!0,focusable:!0,ariaLabel:e.translate("Press ENTER to toggle"),role:"checkbox"});{const a=n("Rectangle",["legend","item","background"]);a.setAll({fillOpacity:0}),B(a,"fill",t,"background")}n("Container",["legend","marker"]).setAll({setStateOnChildren:!0,centerY:ie,paddingLeft:0,paddingRight:0,paddingBottom:0,paddingTop:0,width:18,height:18}),n("RoundedRectangle",["legend","marker","rectangle"]).setAll({width:Q,height:Q,cornerRadiusBL:3,cornerRadiusTL:3,cornerRadiusBR:3,cornerRadiusTR:3});{const a=n("RoundedRectangle",["legend","marker","rectangle"]).states.create("disabled",{});B(a,"fill",t,"disabled"),B(a,"stroke",t,"disabled")}n("Label",["legend","label"]).setAll({centerY:ie,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,populateText:!0}),B(n("Label",["legend","label"]).states.create("disabled",{}),"fill",t,"disabled"),n("Label",["legend","value","label"]).setAll({centerY:ie,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,width:50,centerX:Q,populateText:!0}),B(n("Label",["legend","value","label"]).states.create("disabled",{}),"fill",t,"disabled"),n("HeatLegend").setAll({stepCount:1}),n("RoundedRectangle",["heatlegend","marker"]).setAll({cornerRadiusTR:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusBL:0}),n("RoundedRectangle",["vertical","heatlegend","marker"]).setAll({height:Q,width:15}),n("RoundedRectangle",["horizontal","heatlegend","marker"]).setAll({width:Q,height:15}),n("HeatLegend",["vertical"]).setAll({height:Q}),n("HeatLegend",["horizontal"]).setAll({width:Q}),n("Label",["heatlegend","start"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5}),n("Label",["heatlegend","end"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5});{const a=n("Label");a.setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"1em",populateText:!1}),B(a,"fill",t,"text")}n("RadialLabel").setAll({textType:"regular",centerY:ie,centerX:ie,inside:!1,radius:0,baseRadius:Q,orientation:"auto",textAlign:"center"}),n("RoundedRectangle").setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8}),n("PointedRectangle").setAll({pointerBaseWidth:15,pointerLength:10,cornerRadius:8}),n("Slice").setAll({shiftRadius:0,dRadius:0,dInnerRadius:0});{const a=n("Tick");a.setAll({strokeOpacity:.15,isMeasured:!1,length:4.5,position:"absolute",crisp:!0}),B(a,"stroke",t,"grid")}n("Bullet").setAll({locationX:.5,locationY:.5}),n("Tooltip").setAll({position:"absolute",getFillFromSprite:!0,getStrokeFromSprite:!1,autoTextColor:!0,paddingTop:9,paddingBottom:8,paddingLeft:10,paddingRight:10,marginBottom:5,pointerOrientation:"vertical",centerX:ie,centerY:ie,animationEasing:pi(Wt),exportable:!1}),n("PointedRectangle",["tooltip","background"]).setAll({strokeOpacity:.9,cornerRadius:4,pointerLength:4,pointerBaseWidth:8,fillOpacity:.9,stroke:I.fromHex(16777215)});{const a=n("Label",["tooltip"]);a.setAll({role:"tooltip",populateText:!0,paddingRight:0,paddingTop:0,paddingLeft:0,paddingBottom:0}),B(a,"fill",t,"alternativeText")}n("Button").setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,interactive:!0,layout:i,interactiveChildren:!1,setStateOnChildren:!0,focusable:!0}),n("Button").states.create("hover",{}),n("Button").states.create("down",{stateAnimationDuration:0}),n("Button").states.create("active",{});{const a=n("RoundedRectangle",["button","background"]);B(a,"fill",t,"primaryButton"),B(a,"stroke",t,"primaryButtonStroke")}B(n("RoundedRectangle",["button","background"]).states.create("hover",{}),"fill",t,"primaryButtonHover"),B(n("RoundedRectangle",["button","background"]).states.create("down",{stateAnimationDuration:0}),"fill",t,"primaryButtonDown"),B(n("RoundedRectangle",["button","background"]).states.create("active",{}),"fill",t,"primaryButtonActive"),B(n("Graphics",["button","icon"]),"stroke",t,"primaryButtonText"),B(n("Label",["button"]),"fill",t,"primaryButtonText"),n("Button",["zoom"]).setAll({paddingTop:18,paddingBottom:18,paddingLeft:12,paddingRight:12,centerX:46,centerY:-10,y:0,x:Q,role:"button",ariaLabel:e.translate("Zoom Out"),layer:30});{const a=n("RoundedRectangle",["background","button","zoom"]);a.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),B(a,"fill",t,"primaryButton")}B(n("RoundedRectangle",["background","button","zoom"]).states.create("hover",{}),"fill",t,"primaryButtonHover"),B(n("RoundedRectangle",["background","button","zoom"]).states.create("down",{stateAnimationDuration:0}),"fill",t,"primaryButtonDown");{const a=n("Graphics",["icon","button","zoom"]);a.setAll({crisp:!0,strokeOpacity:.7,draw:o=>{o.moveTo(0,0),o.lineTo(12,0)}}),B(a,"stroke",t,"primaryButtonText")}n("Button",["resize"]).setAll({paddingTop:9,paddingBottom:9,paddingLeft:13,paddingRight:13,draggable:!0,centerX:ie,centerY:ie,position:"absolute",role:"slider",ariaValueMin:"0",ariaValueMax:"100",ariaLabel:e.translate("Use up and down arrows to move selection")});{const a=n("RoundedRectangle",["background","resize","button"]);a.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),B(a,"fill",t,"secondaryButton"),B(a,"stroke",t,"secondaryButtonStroke")}B(n("RoundedRectangle",["background","resize","button"]).states.create("hover",{}),"fill",t,"secondaryButtonHover"),B(n("RoundedRectangle",["background","resize","button"]).states.create("down",{stateAnimationDuration:0}),"fill",t,"secondaryButtonDown");{const a=n("Graphics",["resize","button","icon"]);a.setAll({interactive:!1,crisp:!0,strokeOpacity:.5,draw:o=>{o.moveTo(0,.5),o.lineTo(0,12.5),o.moveTo(4,.5),o.lineTo(4,12.5)}}),B(a,"stroke",t,"secondaryButtonText")}n("Button",["resize","vertical"]).setAll({rotation:90,cursorOverStyle:"ns-resize"}),n("Button",["resize","horizontal"]).setAll({cursorOverStyle:"ew-resize"}),n("Button",["play"]).setAll({paddingTop:13,paddingBottom:13,paddingLeft:14,paddingRight:14,ariaLabel:e.translate("Play"),toggleKey:"active"});{const a=n("RoundedRectangle",["play","background"]);a.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),B(a,"fill",t,"primaryButton")}{const a=n("Graphics",["play","icon"]);a.setAll({stateAnimationDuration:0,dx:1,draw:o=>{o.moveTo(0,-5),o.lineTo(8,0),o.lineTo(0,5),o.lineTo(0,-5)}}),B(a,"fill",t,"primaryButtonText")}n("Graphics",["play","icon"]).states.create("default",{stateAnimationDuration:0}),n("Graphics",["play","icon"]).states.create("active",{stateAnimationDuration:0,draw:a=>{a.moveTo(-4,-5),a.lineTo(-1,-5),a.lineTo(-1,5),a.lineTo(-4,5),a.lineTo(-4,-5),a.moveTo(4,-5),a.lineTo(1,-5),a.lineTo(1,5),a.lineTo(4,5),a.lineTo(4,-5)}}),n("Button",["switch"]).setAll({paddingTop:4,paddingBottom:4,paddingLeft:4,paddingRight:4,ariaLabel:e.translate("Press ENTER to toggle"),toggleKey:"active",width:40,height:24,layout:null});{const a=n("RoundedRectangle",["switch","background"]);a.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),B(a,"fill",t,"primaryButton")}{const a=n("Circle",["switch","icon"]);a.setAll({radius:8,centerY:0,centerX:0,dx:0}),B(a,"fill",t,"primaryButtonText")}n("Graphics",["switch","icon"]).states.create("active",{dx:16}),n("Scrollbar").setAll({start:0,end:1,layer:30,animationEasing:pi(Wt)}),n("Scrollbar",["vertical"]).setAll({marginRight:13,marginLeft:13,minWidth:12,height:Q}),n("Scrollbar",["horizontal"]).setAll({marginTop:13,marginBottom:13,minHeight:12,width:Q}),this.rule("Button",["scrollbar"]).setAll({exportable:!1});{const a=n("RoundedRectangle",["scrollbar","main","background"]);a.setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8,fillOpacity:.8}),B(a,"fill",t,"fill")}{const a=n("RoundedRectangle",["scrollbar","thumb"]);a.setAll({role:"slider",ariaLive:"polite",position:"absolute",draggable:!0}),B(a,"fill",t,"secondaryButton")}B(n("RoundedRectangle",["scrollbar","thumb"]).states.create("hover",{}),"fill",t,"secondaryButtonHover"),B(n("RoundedRectangle",["scrollbar","thumb"]).states.create("down",{stateAnimationDuration:0}),"fill",t,"secondaryButtonDown"),n("RoundedRectangle",["scrollbar","thumb","vertical"]).setAll({x:ie,width:Q,centerX:ie,ariaLabel:e.translate("Use up and down arrows to move selection")}),n("RoundedRectangle",["scrollbar","thumb","horizontal"]).setAll({y:ie,centerY:ie,height:Q,ariaLabel:e.translate("Use left and right arrows to move selection")});{const a=n("PointedRectangle",["axis","tooltip","background"]);a.setAll({cornerRadius:0}),B(a,"fill",t,"alternativeBackground")}n("Label",["axis","tooltip"]).setAll({role:void 0}),n("Label",["axis","tooltip","y"]).setAll({textAlign:"right"}),n("Label",["axis","tooltip","y","opposite"]).setAll({textAlign:"left"}),n("Label",["axis","tooltip","x"]).setAll({textAlign:"center"}),n("Tooltip",["categoryaxis"]).setAll({labelText:"{category}"}),n("Star").setAll({spikes:5,innerRadius:5,radius:10}),n("Tooltip",["stock"]).setAll({paddingTop:6,paddingBottom:5,paddingLeft:7,paddingRight:7}),n("PointedRectangle",["tooltip","stock","axis"]).setAll({pointerLength:0,pointerBaseWidth:0,cornerRadius:3}),n("Label",["tooltip","stock"]).setAll({fontSize:"0.8em"}),n("SpriteResizer").setAll({rotationStep:10}),n("Container",["resizer","grip"]).states.create("hover",{});{const a=n("RoundedRectangle",["resizer","grip"]);a.setAll({strokeOpacity:.7,strokeWidth:1,fillOpacity:1,width:12,height:12}),B(a,"fill",t,"background"),B(a,"stroke",t,"alternativeBackground")}{const a=n("RoundedRectangle",["resizer","grip","outline"]);a.setAll({strokeOpacity:0,fillOpacity:0,width:20,height:20}),a.states.create("hover",{fillOpacity:.3}),B(a,"fill",t,"alternativeBackground")}n("RoundedRectangle",["resizer","grip","left"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0}),n("RoundedRectangle",["resizer","grip","right"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0});{const a=n("Rectangle",["resizer","rectangle"]);a.setAll({strokeDasharray:[2,2],strokeOpacity:.5,strokeWidth:1}),B(a,"stroke",t,"alternativeBackground")}}};class dh{constructor(){Object.defineProperty(this,"_observer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._observer=new ResizeObserver(e=>{k(e,t=>{k(this._targets,i=>{i.target===t.target&&i.callback()})})})}addTarget(e,t){this._observer.observe(e,{box:"border-box"}),this._targets.push({target:e,callback:t})}removeTarget(e){this._observer.unobserve(e),Hi(this._targets,t=>t.target!==e)}}class zi{constructor(){Object.defineProperty(this,"_timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]})}addTarget(e,t){if(this._timer===null){let r=null;const n=()=>{const a=Date.now();(r===null||a>r+zi.delay)&&(r=a,k(this._targets,o=>{let l=o.target.getBoundingClientRect();l.width===o.size.width&&l.height===o.size.height||(o.size=l,o.callback())})),this._targets.length===0?this._timer=null:this._timer=requestAnimationFrame(n)};this._timer=requestAnimationFrame(n)}let i={width:0,height:0,left:0,right:0,top:0,bottom:0,x:0,y:0};this._targets.push({target:e,callback:t,size:i})}removeTarget(e){Hi(this._targets,t=>t.target!==e),this._targets.length===0&&this._timer!==null&&(cancelAnimationFrame(this._timer),this._timer=null)}}Object.defineProperty(zi,"delay",{enumerable:!0,configurable:!0,writable:!0,value:200});let ls=null;function uh(){return ls===null&&(ls=typeof ResizeObserver<"u"?new dh:new zi),ls}class ch{constructor(e,t){Object.defineProperty(this,"_sensor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this._sensor=uh(),this._element=e,this._listener=Mn(t),this._sensor.addTarget(e,t)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._sensor.removeTarget(this._element),this._listener.dispose())}get sensor(){return this._sensor}}class Mi extends _e{}Object.defineProperty(Mi,"className",{enumerable:!0,configurable:!0,writable:!0,value:"InterfaceColors"}),Object.defineProperty(Mi,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:_e.classNames.concat([Mi.className])});class ph extends _e{_setDefaults(){this._setDefault("negativeBase",0),this._setDefault("numberFormat","#,###.#####"),this._setDefault("smallNumberThreshold",1);const e="_big_number_suffix_",t="_small_number_suffix_",i="_byte_suffix_";this._setDefault("bigNumberPrefixes",[{number:1e3,suffix:this._t(e+"3")},{number:1e6,suffix:this._t(e+"6")},{number:1e9,suffix:this._t(e+"9")},{number:1e12,suffix:this._t(e+"12")},{number:1e15,suffix:this._t(e+"15")},{number:1e18,suffix:this._t(e+"18")},{number:1e21,suffix:this._t(e+"21")},{number:1e24,suffix:this._t(e+"24")}]),this._setDefault("smallNumberPrefixes",[{number:1e-24,suffix:this._t(t+"24")},{number:1e-21,suffix:this._t(t+"21")},{number:1e-18,suffix:this._t(t+"18")},{number:1e-15,suffix:this._t(t+"15")},{number:1e-12,suffix:this._t(t+"12")},{number:1e-9,suffix:this._t(t+"9")},{number:1e-6,suffix:this._t(t+"6")},{number:.001,suffix:this._t(t+"3")}]),this._setDefault("bytePrefixes",[{number:1,suffix:this._t(i+"B")},{number:1024,suffix:this._t(i+"KB")},{number:1048576,suffix:this._t(i+"MB")},{number:1073741824,suffix:this._t(i+"GB")},{number:1099511627776,suffix:this._t(i+"TB")},{number:0x4000000000000,suffix:this._t(i+"PB")}]),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i){let r;(t==null||$t(t)&&t.toLowerCase()==="number")&&(t=this.get("numberFormat",""));let n=Number(e);if(Vi(t))try{return this.get("intlLocales")?new Intl.NumberFormat(this.get("intlLocales"),t).format(n):new Intl.NumberFormat(void 0,t).format(n)}catch{return"Invalid"}else{t=Vs(t);let a,o=this.parseFormat(t,this._root.language);a=n>this.get("negativeBase")?o.positive:n{if(l.parsed)return;let h=l.source;h.toLowerCase()==="number"&&(h=this.get("numberFormat","#,###.#####"));let f=Le.chunk(h,!0);for(let u=0;u=0?e.toExponential(t.decimals.passive).split("e"):e.toExponential().split("e"),e=Number(u[0]),n="e"+u[1],t.modSpacing&&(n=" "+n)}else if(t.decimals.passive===0)e=Math.round(e);else if(t.decimals.passive>0){let u=Math.pow(10,t.decimals.passive);e=Math.round(e*u)/u}let o="",l=ll(e).split("."),h=l[0];if(h.length0){let u=[],p=h.split("").reverse().join("");for(let d=0,b=h.length;d<=b;d+=t.thousands.interval){let c=p.substr(d,t.thousands.interval).split("").reverse().join("");c!==""&&u.unshift(c)}h=u.join(t.thousands.separator)}o+=h,l.length===1&&l.push("");let f=l[1];return f.length{switch(f.type){case"year":t=+f.value;break;case"month":i=+f.value-1;break;case"day":r=+f.value;break;case"hour":n=+f.value;break;case"minute":a=+f.value;break;case"second":o=+f.value;break;case"fractionalSecond":l=+f.value;break;case"weekday":switch(f.value){case"Sun":h=0;break;case"Mon":h=1;break;case"Tue":h=2;break;case"Wed":h=3;break;case"Thu":h=4;break;case"Fri":h=5;break;case"Sat":h=6}}}),n===24&&(n=0),{year:t,month:i,day:r,hour:n,minute:a,second:o,millisecond:l,weekday:h}}function Mr(s,e){const{year:t,month:i,day:r,hour:n,minute:a,second:o,millisecond:l}=$n(s,e);return Date.UTC(t,i,r,n,a,o,l)}class gh{constructor(e,t){if(Object.defineProperty(this,"_utc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dtf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this.name=e,this._utc=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3}),this._dtf=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3})}static new(e){return new this(e,!0)}convertLocal(e){const t=this.offsetUTC(e),i=e.getTimezoneOffset(),r=new Date(e);r.setUTCMinutes(r.getUTCMinutes()-(t-i));const n=r.getTimezoneOffset();return i!=n&&r.setUTCMinutes(r.getUTCMinutes()+n-i),r}offsetUTC(e){return(Mr(this._utc,e)-Mr(this._dtf,e))/6e4}parseDate(e){return $n(this._dtf,e)}}class fh extends _e{_setDefaults(){this._setDefault("capitalize",!0),this._setDefault("dateFormat","yyyy-MM-dd"),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t){let i;t!==void 0&&t!==""||(t=this.get("dateFormat","yyyy-MM-dd"));let r=e;if(Vi(t))try{const o=this.get("intlLocales");return o?new Intl.DateTimeFormat(o,t).format(r):new Intl.DateTimeFormat(void 0,t).format(r)}catch{return"Invalid"}let n=this.parseFormat(t);const a=this._root.timezone;return a&&!this._root.utc&&(r=a.convertLocal(r)),D(r.getTime())?(i=this.applyFormat(r,n),this.get("capitalize")&&(i=i.replace(/^.{1}/,i.substr(0,1).toUpperCase())),i):"Invalid date"}applyFormat(e,t){let i,r,n,a,o,l,h,f,u=t.template,p=e.getTime();this._root.utc?(i=e.getUTCFullYear(),r=e.getUTCMonth(),n=e.getUTCDay(),a=e.getUTCDate(),o=e.getUTCHours(),l=e.getUTCMinutes(),h=e.getUTCSeconds(),f=e.getUTCMilliseconds()):(i=e.getFullYear(),r=e.getMonth(),n=e.getDay(),a=e.getDate(),o=e.getHours(),l=e.getMinutes(),h=e.getSeconds(),f=e.getMilliseconds());for(let d=0,b=t.parts.length;d=12?this._t("PM"):this._t("AM");break;case"aa":c=o>=12?this._t("P.M."):this._t("A.M.");break;case"aaa":c=o>=12?this._t("P"):this._t("A");break;case"h":c=ui(o).toString();break;case"hh":c=J(ui(o),2,"0");break;case"H":c=o.toString();break;case"HH":c=J(o,2,"0");break;case"K":c=ui(o,0).toString();break;case"KK":c=J(ui(o,0),2,"0");break;case"k":c=(o+1).toString();break;case"kk":c=J(o+1,2,"0");break;case"m":c=l.toString();break;case"mm":c=J(l,2,"0");break;case"s":c=h.toString();break;case"ss":c=J(h,2,"0");break;case"S":case"SS":case"SSS":c=Math.round(f/1e3*Math.pow(10,t.parts[d].length)).toString();break;case"x":c=p.toString();break;case"n":case"nn":case"nnn":c=J(f,t.parts[d].length,"0");break;case"z":c=ci(e,!1,!1,this._root.utc);break;case"zz":c=ci(e,!0,!1,this._root.utc);break;case"zzz":c=ci(e,!1,!0,this._root.utc);break;case"zzzz":c=ci(e,!0,!0,this._root.utc);break;case"Z":case"ZZ":let v=this._root.utc?"UTC":this._root.timezone;v instanceof gh&&(v=v.name);const x=v?Rl(v):e.getTimezoneOffset();let w=Math.abs(x)/60,P=Math.floor(w),O=60*w-60*P;this._root.utc&&(P=0,O=0),t.parts[d]=="Z"?(c="GMT",c+=x>0?"-":"+",c+=J(P,2)+":"+J(O,2)):(c=x>0?"-":"+",c+=J(P,2)+J(O,2));break;case"i":c=e.toISOString();break;case"I":c=e.toUTCString()}u=u.replace(tt,c)}return u}parseFormat(e){let t={template:"",parts:[]},i=Le.chunk(e,!0);for(let r=0;r-1&&(o.year=parseInt(u[a.year])),a.year3>-1){let p=parseInt(u[a.year3]);p+=1e3,o.year=p}if(a.year2>-1){let p=parseInt(u[a.year2]);p+=p>50?1e3:2e3,o.year=p}if(a.year1>-1){let p=parseInt(u[a.year1]);p=10*Math.floor(new Date().getFullYear()/10)+p,o.year=p}if(a.monthLong>-1&&(o.month=this.resolveMonth(u[a.monthLong])),a.monthShort>-1&&(o.month=this.resolveShortMonth(u[a.monthShort])),a.month>-1&&(o.month=parseInt(u[a.month])-1),a.week>-1&&a.day===-1&&(o.month=0,o.day=Bl(parseInt(u[a.week]),o.year,1,this._root.utc)),a.day>-1&&(o.day=parseInt(u[a.day])),a.yearDay>-1&&(o.month=0,o.day=parseInt(u[a.yearDay])),a.hourBase0>-1&&(o.hour=parseInt(u[a.hourBase0])),a.hourBase1>-1&&(o.hour=parseInt(u[a.hourBase1])-1),a.hour12Base0>-1){let p=parseInt(u[a.hour12Base0]);p==11&&(p=0),a.am>-1&&!this.isAm(u[a.am])&&(p+=12),o.hour=p}if(a.hour12Base1>-1){let p=parseInt(u[a.hour12Base1]);p==12&&(p=0),a.am>-1&&!this.isAm(u[a.am])&&(p+=12),o.hour=p}if(a.minute>-1&&(o.minute=parseInt(u[a.minute])),a.second>-1&&(o.second=parseInt(u[a.second])),a.millisecond>-1){let p=parseInt(u[a.millisecond]);a.millisecondDigits==2?p*=10:a.millisecondDigits==1&&(p*=100),o.millisecond=p}if(a.timestamp>-1){o.timestamp=parseInt(u[a.timestamp]);const p=new Date(o.timestamp);o.year=p.getUTCFullYear(),o.month=p.getUTCMonth(),o.day=p.getUTCDate(),o.hour=p.getUTCHours(),o.minute=p.getUTCMinutes(),o.second=p.getUTCSeconds(),o.millisecond=p.getUTCMilliseconds()}a.zone>-1&&(o.offset=this.resolveTimezoneOffset(new Date(o.year,o.month,o.day),u[a.zone])),a.iso>-1&&(o.year=xe(u[a.iso+0]),o.month=xe(u[a.iso+1])-1,o.day=xe(u[a.iso+2]),o.hour=xe(u[a.iso+3]),o.minute=xe(u[a.iso+4]),o.second=xe(u[a.iso+5]),o.millisecond=xe(u[a.iso+6]),u[a.iso+7]=="Z"||u[a.iso+7]=="z"?o.utc=!0:u[a.iso+7]!=""&&(o.offset=this.resolveTimezoneOffset(new Date(o.year,o.month,o.day),u[a.iso+7]))),i=o.utc?new Date(Date.UTC(o.year,o.month,o.day,o.hour,o.minute,o.second,o.millisecond)):new Date(o.year,o.month,o.day,o.hour,o.minute+o.offset,o.second,o.millisecond)}else i=new Date(e);return i}resolveTimezoneOffset(e,t){if(t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)){let i=t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/),r=i[1],n=i[2],a=i[3],o=60*parseInt(n)+parseInt(a);return r=="+"&&(o*=-1),o-(e||new Date).getTimezoneOffset()}return 0}resolveMonth(e){let t=this._months().indexOf(e);return t>-1||!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._months()).indexOf(e),t>-1)?t:0}resolveShortMonth(e){let t=this._shortMonths().indexOf(e);return t>-1?t:(t=this._months().indexOf(e),t>-1||this._root.language&&!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._shortMonths()).indexOf(e),t>-1)?t:0)}isAm(e){return this.getStringList(["AM","A.M.","A"]).indexOf(e.toUpperCase())>-1}getStringList(e){let t=[];for(let i=0;ithis.get("negativeBase")?a.positive:o{if(o.parsed)return;let l=o.source,h=[];h=o.source.match(/^\[([^\]]*)\]/),h&&h.length&&h[0]!==""&&(l=o.source.substr(h[0].length),o.color=h[1]);let f=Le.chunk(l,!0);for(let u=0;u{if(n==t||i){if(r/a<=1)return i||(i=n),!1;i=n}return!0}),i}getMilliseconds(e,t){return t||(t=this.get("baseUnit")),e*this._getUnitValue(t)}_getUnitValue(e){return this._getUnitValues()[e]}_getUnitValues(){return{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}}}const Ln={firstDayOfWeek:1,_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(s){let e="th";if(s<11||s>13)switch(s%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"",Play:"",Stop:"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:""};class _h extends _e{_setDefaults(){this.setPrivate("defaultLocale",Ln),super._setDefaults()}translate(e,t,...i){t||(t=this._root.locale||this.getPrivate("defaultLocale"));let r=e,n=t[e];if(n===null)r="";else if(n!=null)n&&(r=n);else if(t!==this.getPrivate("defaultLocale"))return this.translate(e,this.getPrivate("defaultLocale"),...i);if(i.length)for(let a=i.length,o=0;o{this.setTranslationAny(i,r,t)})}translateEmpty(e,t,...i){let r=this.translate(e,t,...i);return r==e?"":r}translateFunc(e,t){return this._root.locale[e]?this._root.locale[e]:t!==this.getPrivate("defaultLocale")?this.translateFunc(e,this.getPrivate("defaultLocale")):()=>""}translateAll(e,t){return this.isDefault()?e:dl(e,i=>this.translate(i,t))}isDefault(){return this.getPrivate("defaultLocale")===this._root.locale}}class hs{constructor(e=1,t=0,i=0,r=1,n=0,a=0){Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"c",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"d",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.a=e,this.b=t,this.c=i,this.d=r,this.tx=n,this.ty=a}setTransform(e,t,i,r,n,a=1){this.a=Math.cos(n)*a,this.b=Math.sin(n)*a,this.c=-Math.sin(n)*a,this.d=Math.cos(n)*a,this.tx=e-(i*this.a+r*this.c),this.ty=t-(i*this.b+r*this.d)}apply(e){return{x:this.a*e.x+this.c*e.y+this.tx,y:this.b*e.x+this.d*e.y+this.ty}}applyInverse(e){const t=1/(this.a*this.d+this.c*-this.b);return{x:this.d*t*e.x+-this.c*t*e.y+(this.ty*this.c-this.tx*this.d)*t,y:this.a*t*e.y+-this.b*t*e.x+(-this.ty*this.a+this.tx*this.b)*t}}append(e){const t=this.a,i=this.b,r=this.c,n=this.d;this.a=e.a*t+e.b*r,this.b=e.a*i+e.b*n,this.c=e.c*t+e.d*r,this.d=e.c*i+e.d*n,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*i+e.ty*n+this.ty}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,r=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty}copyFrom(e){this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty}}var bh=function(){function s(e,t){var i=[],r=!0,n=!1,a=void 0;try{for(var o,l=e[Symbol.iterator]();!(r=(o=l.next()).done)&&(i.push(o.value),!t||i.length!==t);r=!0);}catch(h){n=!0,a=h}finally{try{!r&&l.return&&l.return()}finally{if(n)throw a}}return i}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return s(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),ti=2*Math.PI,ds=function(s,e,t,i,r,n,a){var o=s.x,l=s.y;return{x:i*(o*=e)-r*(l*=t)+n,y:r*o+i*l+a}},yh=function(s,e){var t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=Math.cos(s),r=Math.sin(s),n=Math.cos(s+e),a=Math.sin(s+e);return[{x:i-r*t,y:r+i*t},{x:n+a*t,y:a-n*t},{x:n,y:a}]},Pr=function(s,e,t,i){var r=s*t+e*i;return r>1&&(r=1),r<-1&&(r=-1),(s*i-e*t<0?-1:1)*Math.acos(r)},vh=function(s,e,t,i,r,n,a,o,l,h,f,u){var p=Math.pow(r,2),d=Math.pow(n,2),b=Math.pow(f,2),c=Math.pow(u,2),y=p*d-p*c-d*b;y<0&&(y=0),y/=p*c+d*b;var v=(y=Math.sqrt(y)*(a===o?-1:1))*r/n*u,x=y*-n/r*f,w=h*v-l*x+(s+t)/2,P=l*v+h*x+(e+i)/2,O=(f-v)/r,R=(u-x)/n,S=(-f-v)/r,L=(-u-x)/n,z=Pr(1,0,O,R),V=Pr(O,R,S,L);return o===0&&V>0&&(V-=ti),o===1&&V<0&&(V+=ti),[w,P,z,V]},wh=function(s){var e=s.px,t=s.py,i=s.cx,r=s.cy,n=s.rx,a=s.ry,o=s.xAxisRotation,l=o===void 0?0:o,h=s.largeArcFlag,f=h===void 0?0:h,u=s.sweepFlag,p=u===void 0?0:u,d=[];if(n===0||a===0)return[];var b=Math.sin(l*ti/360),c=Math.cos(l*ti/360),y=c*(e-i)/2+b*(t-r)/2,v=-b*(e-i)/2+c*(t-r)/2;if(y===0&&v===0)return[];n=Math.abs(n),a=Math.abs(a);var x=Math.pow(y,2)/Math.pow(n,2)+Math.pow(v,2)/Math.pow(a,2);x>1&&(n*=Math.sqrt(x),a*=Math.sqrt(x));var w=vh(e,t,i,r,n,a,f,p,b,c,y,v),P=bh(w,4),O=P[0],R=P[1],S=P[2],L=P[3],z=Math.abs(L)/(ti/4);Math.abs(1-z)<1e-7&&(z=1);var V=Math.max(Math.ceil(z),1);L/=V;for(var Y=0;Y1){const r=/^([01])([01])(.*)$/.exec(i);r!==null&&(s.splice(t,0,r[1]),++t,s.splice(t,0,r[2]),++t,r[3].length>0?s[t]=r[3]:s.splice(t,1))}if(++t,i=s[t],i.length>1){const r=/^([01])(.+)$/.exec(i);r!==null&&(s.splice(t,0,r[1]),++t,s[t]=r[2])}}}function kr(s){if(s===0||s===1)return s;throw new Error("Flag must be 0 or 1")}function Ph(s){const e=[0,0,0];for(let t=0;t<24;t++)e[t%3]<<=1,e[t%3]|=1&s,s>>=1;return(0|e[2])+(e[1]<<8)+(e[0]<<16)}function fi(s,e){for(;(!s.interactive||e(s))&&s._parent;)s=s._parent}function kh(s,e,t){return se(s,ks(e),i=>{const r=Pn(i);let n=i.touches;n?(n.length==0&&(n=i.changedTouches),t(ul(n),r)):t([i],r)})}function Ar(s){const e=document.createElement("canvas");e.width=1,e.height=1;const t=e.getContext("2d",{willReadFrequently:!0});t.drawImage(s,0,0,1,1);try{return t.getImageData(0,0,1,1),!1}catch{return console.warn('Image "'+s.src+'" is loaded from different host and is not covered by CORS policy. For more information about the implications read here: https://www.amcharts.com/docs/v5/concepts/cors'),!0}}function Yt(s){s.width=0,s.height=0,s.style.width="0px",s.style.height="0px"}class Ah{constructor(){Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0})}get x(){return this._x}get y(){return this._y}set x(e){this._x=e}set y(e){this._y=e}}class Wi extends Ns{constructor(e){super(),Object.defineProperty(this,"_layer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"interactive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inactive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"wheelable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cancelTouch",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isMeasured",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"buttonMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"alpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"compoundAlpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"angle",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"crisp",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"pivot",{enumerable:!0,configurable:!0,writable:!0,value:new Ah}),Object.defineProperty(this,"filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cursorOverStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_replacedCursorStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new hs}),Object.defineProperty(this,"_matrix",{enumerable:!0,configurable:!0,writable:!0,value:new hs}),Object.defineProperty(this,"_uMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new hs}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._renderer=e}_dispose(){this._renderer._removeObject(this),this.getLayer().dirty=!0}getCanvas(){return this.getLayer().view}getLayer(){let e=this;for(;;){if(e._layer)return e._layer;if(!e._parent)return this._renderer.defaultLayer;e=e._parent}}setLayer(e,t){e==null?this._layer=void 0:(this._layer=this._renderer.getLayer(e,!0),this._layer.visible=!0,this._layer.margin=t,t&&Ct(this._layer.view,!1),this._renderer._ghostLayer.setMargin(this._renderer.layers),this._parent&&this._parent.registerChildLayer(this._layer),this._layer.dirty=!0,this._renderer.resizeLayer(this._layer),this._renderer.resizeGhost())}markDirtyLayer(){this.getLayer().dirty=!0}clear(){this.invalidateBounds()}invalidateBounds(){this._localBounds=void 0}_addBounds(e){}_getColorId(){return this._colorId===void 0&&(this._colorId=this._renderer.paintId(this)),this._colorId}_isInteractive(){return this.inactive==0&&(this.interactive||this._renderer._forceInteractive>0)}_isInteractiveMask(){return this._isInteractive()}contains(e){for(;;){if(e===this)return!0;if(!e._parent)return!1;e=e._parent}}toGlobal(e){return this._matrix.apply(e)}toLocal(e){return this._matrix.applyInverse(e)}getLocalMatrix(){return this._uMatrix.setTransform(0,0,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._uMatrix}getLocalBounds(){return this._localBounds||(this._localBounds={left:1e7,top:1e7,right:-1e7,bottom:-1e7},this._addBounds(this._localBounds)),this._localBounds}getAdjustedBounds(e){this._setMatrix();const t=this.getLocalMatrix(),i=t.apply({x:e.left,y:e.top}),r=t.apply({x:e.right,y:e.top}),n=t.apply({x:e.right,y:e.bottom}),a=t.apply({x:e.left,y:e.bottom});return{left:Math.min(i.x,r.x,n.x,a.x),top:Math.min(i.y,r.y,n.y,a.y),right:Math.max(i.x,r.x,n.x,a.x),bottom:Math.max(i.y,r.y,n.y,a.y)}}on(e,t,i){return this.interactive?this._renderer._addEvent(this,e,t,i):new ne(()=>{})}_setMatrix(){this._localMatrix.setTransform(this.x,this.y,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._matrix.copyFrom(this._localMatrix),this._parent&&this._matrix.prepend(this._parent._matrix)}_transform(e,t){const i=this._matrix;let r=i.tx*t,n=i.ty*t;this.crisp&&(r=Math.floor(r)+.5,n=Math.floor(n)+.5),e.setTransform(i.a*t,i.b*t,i.c*t,i.d*t,r,n)}_transformMargin(e,t,i){const r=this._matrix;e.setTransform(r.a*t,r.b*t,r.c*t,r.d*t,(r.tx+i.left)*t,(r.ty+i.top)*t)}_transformLayer(e,t,i){i.margin?this._transformMargin(e,i.scale||t,i.margin):this._transform(e,i.scale||t)}render(e){if(this.visible&&(this.exportable!==!1||!this._renderer._omitTainted)){this._setMatrix();const t=this._renderer.resolution,i=this._renderer.layers,r=this._renderer._ghostLayer,n=r.context,a=this.mask;a&&a._setMatrix(),k(i,o=>{if(o){const l=o.context;l.save(),a&&(a._transformLayer(l,t,o),a._runPath(l),l.clip()),l.globalAlpha=this.compoundAlpha*this.alpha,this._transformLayer(l,t,o),this.filter&&(l.filter=this.filter)}}),n.save(),a&&this._isInteractiveMask()&&(a._transformMargin(n,t,r.margin),a._runPath(n),n.clip()),this._transformMargin(n,t,r.margin),this._render(e),n.restore(),k(i,o=>{o&&o.context.restore()})}}_render(e){this.exportable===!1&&((this._layer||e).tainted=!0)}hovering(){return this._renderer._hovering.has(this)}dragging(){return this._renderer._dragging.some(e=>e.value===this)}shouldCancelTouch(){const e=this._renderer;return!(e.tapToActivate&&!e._touchActive)&&(!!this.cancelTouch||!!this._parent&&this._parent.shouldCancelTouch())}}class Ch extends Wi{constructor(){super(...arguments),Object.defineProperty(this,"interactiveChildren",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_childLayers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_children",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_isInteractiveMask(){return this.interactiveChildren||super._isInteractiveMask()}addChild(e){e._parent=this,this._children.push(e),e._layer&&this.registerChildLayer(e._layer)}addChildAt(e,t){e._parent=this,this._children.splice(t,0,e),e._layer&&this.registerChildLayer(e._layer)}removeChild(e){e._parent=void 0,ke(this._children,e)}_render(e){super._render(e);const t=this._renderer;this.interactive&&this.interactiveChildren&&++t._forceInteractive;const i=this._layer||e;k(this._children,r=>{r.compoundAlpha=this.compoundAlpha*this.alpha,r.render(i)}),this.interactive&&this.interactiveChildren&&--t._forceInteractive}registerChildLayer(e){this._childLayers||(this._childLayers=[]),ni(this._childLayers,e),this._parent&&this._parent.registerChildLayer(e)}markDirtyLayer(e=!1){super.markDirtyLayer(),e&&this._childLayers&&k(this._childLayers,t=>t.dirty=!0)}_dispose(){super._dispose(),this._childLayers&&k(this._childLayers,e=>{e.dirty=!0})}}function Z(s,e){s.left=Math.min(s.left,e.x),s.top=Math.min(s.top,e.y),s.right=Math.max(s.right,e.x),s.bottom=Math.max(s.bottom,e.y)}class ae{colorize(e,t){}path(e){}addBounds(e){}}class Th extends ae{colorize(e,t){e.beginPath()}}class us extends ae{constructor(e){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fillStyle=t!==void 0?t:this.color}}class Eh extends ae{constructor(e){super(),Object.defineProperty(this,"clearShadow",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fill(),this.clearShadow&&(e.shadowColor="",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}class Ih extends ae{colorize(e,t){e.stroke()}}class cs extends ae{constructor(e,t,i){super(),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lineJoin",{enumerable:!0,configurable:!0,writable:!0,value:i})}colorize(e,t){e.strokeStyle=t!==void 0?t:this.color,e.lineWidth=this.width,this.lineJoin&&(e.lineJoin=this.lineJoin)}}class Oh extends ae{constructor(e){super(),Object.defineProperty(this,"dash",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.setLineDash(this.dash)}}class Dh extends ae{constructor(e){super(),Object.defineProperty(this,"dashOffset",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.lineDashOffset=this.dashOffset}}class Fh extends ae{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.rect(this.x,this.y,this.width,this.height)}addBounds(e){const t=this.x,i=this.y,r=t+this.width,n=i+this.height;Z(e,{x:t,y:i}),Z(e,{x:r,y:i}),Z(e,{x:t,y:n}),Z(e,{x:r,y:n})}}class Sh extends ae{constructor(e,t,i){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i})}path(e){e.moveTo(this.x+this.radius,this.y),e.arc(this.x,this.y,this.radius,0,2*Math.PI)}addBounds(e){Z(e,{x:this.x-this.radius,y:this.y-this.radius}),Z(e,{x:this.x+this.radius,y:this.y+this.radius})}}class $h extends ae{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radiusX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"radiusY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.ellipse(0,0,this.radiusX,this.radiusY,0,0,2*Math.PI)}addBounds(e){Z(e,{x:this.x-this.radiusX,y:this.y-this.radiusY}),Z(e,{x:this.x+this.radiusX,y:this.y+this.radiusY})}}class Lh extends ae{constructor(e,t,i,r,n,a){super(),Object.defineProperty(this,"cx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cy",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"endAngle",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"anticlockwise",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){this.radius>0&&e.arc(this.cx,this.cy,this.radius,this.startAngle,this.endAngle,this.anticlockwise)}addBounds(e){let t=Xl(this.cx,this.cy,this.startAngle*Xt,this.endAngle*Xt,this.radius);Z(e,{x:t.left,y:t.top}),Z(e,{x:t.right,y:t.bottom})}}class Bh extends ae{constructor(e,t,i,r,n){super(),Object.defineProperty(this,"x1",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y1",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"x2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"y2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:n})}path(e){this.radius>0&&e.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)}addBounds(e){}}class Rh extends ae{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.lineTo(this.x,this.y)}addBounds(e){Z(e,{x:this.x,y:this.y})}}class jh extends ae{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.moveTo(this.x,this.y)}addBounds(e){Z(e,{x:this.x,y:this.y})}}class Nh extends ae{path(e){e.closePath()}}class Vh extends ae{constructor(e,t,i,r,n,a){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"cpX2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"cpY2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){e.bezierCurveTo(this.cpX,this.cpY,this.cpX2,this.cpY2,this.toX,this.toY)}addBounds(e){Z(e,{x:this.cpX,y:this.cpY}),Z(e,{x:this.cpX2,y:this.cpY2}),Z(e,{x:this.toX,y:this.toY})}}class Hh extends ae{constructor(e,t,i,r){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.quadraticCurveTo(this.cpX,this.cpY,this.toX,this.toY)}addBounds(e){Z(e,{x:this.cpX,y:this.cpY}),Z(e,{x:this.toX,y:this.toY})}}class zh extends ae{constructor(e,t,i,r,n){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"blur",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"offsetX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"offsetY",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"opacity",{enumerable:!0,configurable:!0,writable:!0,value:n})}colorize(e,t){this.opacity&&(e.fillStyle=this.color),e.shadowColor=this.color,e.shadowBlur=this.blur,e.shadowOffsetX=this.offsetX,e.shadowOffsetY=this.offsetY}}class Wh extends ae{constructor(e,t,i,r,n){super(),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:n})}path(e){e.drawImage(this.image,this.x,this.y,this.width,this.height)}addBounds(e){Z(e,{x:this.x,y:this.y}),Z(e,{x:this.width,y:this.height})}}class Uh extends Wi{constructor(){super(...arguments),Object.defineProperty(this,"_operations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"blendMode",{enumerable:!0,configurable:!0,writable:!0,value:Fi.NORMAL}),Object.defineProperty(this,"_hasShadows",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_fillAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}clear(){super.clear(),this._operations.length=0}_pushOp(e){this._operations.push(e)}beginFill(e,t=1){this._fillAlpha=t,e?e instanceof I?this._pushOp(new us(e.toCSS(t))):(this.isMeasured=!0,this._pushOp(new us(e))):this._pushOp(new us("rgba(0, 0, 0, "+t+")"))}endFill(){this._pushOp(new Eh(this._hasShadows))}endStroke(){this._pushOp(new Ih)}beginPath(){this._pushOp(new Th)}lineStyle(e=0,t,i=1,r){this._strokeAlpha=i,t?t instanceof I?this._pushOp(new cs(e,t.toCSS(i),r)):this._pushOp(new cs(e,t,r)):this._pushOp(new cs(e,"rgba(0, 0, 0, "+i+")",r))}setLineDash(e){this._pushOp(new Oh(e||[]))}setLineDashOffset(e=0){this._pushOp(new Dh(e))}drawRect(e,t,i,r){this._pushOp(new Fh(e,t,i,r))}drawCircle(e,t,i){this._pushOp(new Sh(e,t,i))}drawEllipse(e,t,i,r){this._pushOp(new $h(e,t,i,r))}arc(e,t,i,r,n,a=!1){this._pushOp(new Lh(e,t,i,r,n,a))}arcTo(e,t,i,r,n){this._pushOp(new Bh(e,t,i,r,n))}lineTo(e,t){this._pushOp(new Rh(e,t))}moveTo(e,t){this._pushOp(new jh(e,t))}bezierCurveTo(e,t,i,r,n,a){this._pushOp(new Vh(e,t,i,r,n,a))}quadraticCurveTo(e,t,i,r){this._pushOp(new Hh(e,t,i,r))}closePath(){this._pushOp(new Nh)}shadow(e,t=0,i=0,r=0,n){this._hasShadows=!0,this._pushOp(new zh(n?e.toCSS(n):e.toCSS(this._fillAlpha||this._strokeAlpha),t,i,r))}image(e,t,i,r,n){this._pushOp(new Wh(e,t,i,r,n))}svgPath(e){let t=0,i=0,r=null,n=null,a=null,o=null;const l=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,h=/[\u0009\u0020\u000A\u000C\u000D]*([\+\-]?[0-9]*\.?[0-9]+(?:[eE][\+\-]?[0-9]+)?)[\u0009\u0020\u000A\u000C\u000D]*,?/g;let f;for(;(f=l.exec(e))!==null;){const u=f[1],p=f[2],d=[];for(;(f=h.exec(p))!==null;)d.push(f[1]);switch(u!=="S"&&u!=="s"&&u!=="C"&&u!=="c"&&(r=null,n=null),u!=="Q"&&u!=="q"&&u!=="T"&&u!=="t"&&(a=null,o=null),u){case"M":ye(u,d.length,2),t=+d[0],i=+d[1],this.moveTo(t,i);for(let c=2;c{this.bezierCurveTo(w.x1,w.y1,w.x2,w.y2,w.x,w.y),t=w.x,i=w.y})}break;case"Z":case"z":xh(u,d.length,0),this.closePath()}}}_runPath(e){e.beginPath(),k(this._operations,t=>{t.path(e)})}_render(e){super._render(e);const t=this._layer||e,i=t.dirty,r=this._isInteractive();if(i||r){const n=t.context,a=this._renderer._ghostLayer.context;let o;i&&(n.globalCompositeOperation=this.blendMode,n.beginPath()),r&&(a.beginPath(),o=this._getColorId()),k(this._operations,l=>{i&&(l.path(n),l.colorize(n,void 0)),r&&(l.path(a),l.colorize(a,o))})}}renderDetached(e){if(this.visible){this._setMatrix(),e.save();const t=this.mask;t&&(t._setMatrix(),t._transform(e,1),t._runPath(e),e.clip()),e.globalAlpha=this.compoundAlpha*this.alpha,this._transform(e,1),this.filter&&(e.filter=this.filter),e.globalCompositeOperation=this.blendMode,e.beginPath(),k(this._operations,i=>{i.path(e),i.colorize(e,void 0)}),e.restore()}}_addBounds(e){this.visible&&this.isMeasured&&k(this._operations,t=>{t.addBounds(e)})}}class Bn extends Wi{constructor(e,t,i){super(e),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"textVisible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_textInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:1}),this.text=t,this.style=i}invalidateBounds(){super.invalidateBounds(),this._textInfo=void 0}_shared(e){this.style.textAlign&&(e.textAlign=this.style.textAlign),this.style.direction&&(e.direction=this.style.direction),this.style.textBaseline&&(e.textBaseline=this.style.textBaseline)}_prerender(e,t=!1,i=!1){super._render(e);const r=e.context,n=this._renderer._ghostLayer.context,a=this.style;let o=this._getFontStyle(void 0,i);r.font=o,this._isInteractive()&&!t&&(n.font=o),a.fill&&(a.fill instanceof I?r.fillStyle=a.fill.toCSS(a.fillOpacity!=null?a.fillOpacity:1):r.fillStyle=a.fill),a.shadowColor&&(e.context.shadowColor=a.shadowColor.toCSS(a.shadowOpacity||1)),a.shadowBlur&&(e.context.shadowBlur=a.shadowBlur),a.shadowOffsetX&&(e.context.shadowOffsetX=a.shadowOffsetX),a.shadowOffsetY&&(e.context.shadowOffsetY=a.shadowOffsetY),this._shared(r),this._isInteractive()&&!t&&(n.fillStyle=this._getColorId(),this._shared(n))}_getFontStyle(e,t=!1){const i=this.style;let r=[];return e&&e.fontVariant?r.push(e.fontVariant):i.fontVariant&&r.push(i.fontVariant),t||(e&&e.fontWeight?r.push(e.fontWeight):i.fontWeight&&r.push(i.fontWeight)),e&&e.fontStyle?r.push(e.fontStyle):i.fontStyle&&r.push(i.fontStyle),e&&e.fontSize?(D(e.fontSize)&&(e.fontSize=e.fontSize+"px"),r.push(e.fontSize)):i.fontSize&&(D(i.fontSize)&&(i.fontSize=i.fontSize+"px"),r.push(i.fontSize)),e&&e.fontFamily?r.push(e.fontFamily):i.fontFamily?r.push(i.fontFamily):r.length&&r.push("Arial"),r.join(" ")}_render(e){const t=this._layer||e;if(this._textInfo||this._measure(t),this.textVisible){const i=this._isInteractive(),r=t.context,n=t.dirty,a=this._renderer._ghostLayer.context;r.save(),a.save(),this._prerender(t),k(this._textInfo,(o,l)=>{k(o.textChunks,(h,f)=>{if(h.style&&(r.save(),a.save(),r.font=h.style,this._isInteractive()&&(a.font=h.style)),h.fill&&(r.save(),r.fillStyle=h.fill.toCSS()),n&&r.fillText(h.text,h.offsetX,o.offsetY+h.offsetY),h.textDecoration=="underline"||h.textDecoration=="line-through"){let u,p=1,d=1,b=h.height,c=h.offsetX;switch(this.style.textAlign){case"right":case"end":c-=h.width;break;case"center":c-=h.width/2}if(h.style)switch(Le.getTextStyle(h.style).fontWeight){case"bolder":case"bold":case"700":case"800":case"900":p=2}b&&(d=b/20),u=h.textDecoration=="line-through"?p+o.offsetY+h.offsetY-h.height/2:p+1.5*d+o.offsetY+h.offsetY,r.save(),r.beginPath(),h.fill?r.strokeStyle=h.fill.toCSS():this.style.fill&&this.style.fill instanceof I&&(r.strokeStyle=this.style.fill.toCSS()),r.lineWidth=p*d,r.moveTo(c,u),r.lineTo(c+h.width,u),r.stroke(),r.restore()}i&&this.interactive&&a.fillText(h.text,h.offsetX,o.offsetY+h.offsetY),h.fill&&r.restore(),h.style&&(r.restore(),a.restore())})}),r.restore(),a.restore()}}_addBounds(e){if(this.visible&&this.isMeasured){const t=this._measure(this.getLayer());Z(e,{x:t.left,y:t.top}),Z(e,{x:t.right,y:t.bottom})}}_ignoreFontWeight(){return/apple/i.test(navigator.vendor)}_measure(e){const t=e.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl";this._textInfo=[];const n=this.style.oversizedBehavior,a=this.style.maxWidth,o=D(a)&&n=="truncate",l=D(a)&&(n=="wrap"||n=="wrap-no-break");t.save(),i.save(),this._prerender(e,!0,this._ignoreFontWeight());const h="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",f=this.text.toString().replace(/\r/g,"").split(/\n/);let u,p=!0,d=0,b=0,c=0;k(f,(v,x)=>{let w;for(w=v==""?[{type:"value",text:""}]:Le.chunk(v,!1,this.style.ignoreFormatting);w.length>0;){let P={offsetY:c,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};const O=this._measureText(h,t),R=O.actualBoundingBoxAscent+O.actualBoundingBoxDescent;let S;P.height=R,P.ascent=O.actualBoundingBoxAscent;let L,z,V,Y=this.style.textDecoration,de=!1,Ee=!0,wt=[];yn(w,(le,hi)=>{if(le.type=="format")if(le.text=="[/]")p||(t.restore(),i.restore(),p=!0),L=void 0,u=void 0,z=void 0,Y=this.style.textDecoration,V=void 0,S=le.text;else{p||(t.restore(),i.restore());let K=Le.getTextStyle(le.text);const Ae=this._getFontStyle(K);t.save(),i.save(),t.font=Ae,u=Ae,S=le.text,K.textDecoration&&(Y=K.textDecoration),K.fill&&(L=K.fill),K.width&&(z=xe(K.width)),K.verticalAlign&&(V=K.verticalAlign),p=!1;const Ie=this._measureText(h,t),xt=Ie.actualBoundingBoxAscent+Ie.actualBoundingBoxDescent;xt>P.height&&(P.height=xt),Ie.actualBoundingBoxAscent>P.ascent&&(P.ascent=Ie.actualBoundingBoxAscent)}else if(le.type=="value"&&!de){const K=this._measureText(le.text,t);let Ae=K.actualBoundingBoxLeft+K.actualBoundingBoxRight;if(o){let Ue=Ee||this.style.breakWords||!1;const it=this.style.ellipsis||"",Gs=this._measureText(it,t),Qn=Gs.actualBoundingBoxLeft+Gs.actualBoundingBoxRight;if(P.width+Ae>a){const Jn=a-P.width-Qn;le.text=this._truncateText(t,le.text,Jn,Ue),le.text+=it,de=!0}}else if(l&&P.width+Ae>a){const Ue=a-P.width,it=this._truncateText(t,le.text,Ue,!1,Ee&&this.style.oversizedBehavior!="wrap-no-break");if(it=="")return this.textVisible=!0,!1;wt=w.slice(hi+1),vi(it)!=vi(le.text)&&(wt.unshift({type:"value",text:le.text.substr(it.length)}),S&&wt.unshift({type:"format",text:S})),le.text=vi(it),w=[],de=!0}let Ie=1,xt=1;if(u&&z&&z>Ae){const Ue=Ae/z;switch(this.style.textAlign){case"right":case"end":Ie=Ue;break;case"center":Ie=Ue,xt=Ue;break;default:xt=Ue}Ae=z}const Yi=K.actualBoundingBoxAscent+K.actualBoundingBoxDescent;Yi>P.height&&(P.height=Yi),K.actualBoundingBoxAscent>P.ascent&&(P.ascent=K.actualBoundingBoxAscent),P.width+=Ae,P.left+=K.actualBoundingBoxLeft/Ie,P.right+=K.actualBoundingBoxRight/xt,P.textChunks.push({style:u,fill:L,text:le.text,width:Ae,height:Yi,left:K.actualBoundingBoxLeft,right:K.actualBoundingBoxRight,ascent:K.actualBoundingBoxAscent,offsetX:0,offsetY:0,textDecoration:Y,verticalAlign:V}),Ee=!1}return!0}),this.style.lineHeight instanceof U?(P.height*=this.style.lineHeight.value,P.ascent*=this.style.lineHeight.value):(P.height*=this.style.lineHeight||1.2,P.ascent*=this.style.lineHeight||1.2),d{let w=0;k(v.textChunks,P=>{if(P.offsetX=w+P.left-v.left,P.offsetY+=v.height-v.height*(this.style.baselineRatio||.19),w+=P.width,P.verticalAlign)switch(P.verticalAlign){case"super":P.offsetY-=v.height/2-P.height/2;break;case"sub":P.offsetY+=P.height/2}})});const y={left:r?-b:-d,top:0,right:r?d:b,bottom:c};if(n!=="none"){const v=this._fitRatio(y);if(v<1)if(n=="fit")D(this.style.minScale)&&vi&&t!="");return t}_measureText(e,t){let i=t.measureText(e),r={};if(i.actualBoundingBoxAscent==null){const a=document.createElement("div");a.innerText=e,a.style.visibility="hidden",a.style.position="absolute",a.style.top="-1000000px;",a.style.fontFamily=this.style.fontFamily||"",a.style.fontSize=this.style.fontSize+"",document.body.appendChild(a);const o=a.getBoundingClientRect();document.body.removeChild(a);const l=o.height,h=i.width;r={actualBoundingBoxAscent:l,actualBoundingBoxDescent:0,actualBoundingBoxLeft:0,actualBoundingBoxRight:h,fontBoundingBoxAscent:l,fontBoundingBoxDescent:0,width:h}}else r={actualBoundingBoxAscent:i.actualBoundingBoxAscent,actualBoundingBoxDescent:i.actualBoundingBoxDescent,actualBoundingBoxLeft:i.actualBoundingBoxLeft,actualBoundingBoxRight:i.actualBoundingBoxRight,fontBoundingBoxAscent:i.actualBoundingBoxAscent,fontBoundingBoxDescent:i.actualBoundingBoxDescent,width:i.width};const n=i.width;switch(this.style.textAlign){case"right":case"end":r.actualBoundingBoxLeft=n,r.actualBoundingBoxRight=0;break;case"center":r.actualBoundingBoxLeft=n/2,r.actualBoundingBoxRight=n/2;break;default:r.actualBoundingBoxLeft=0,r.actualBoundingBoxRight=n}return r}}class Yh{constructor(){Object.defineProperty(this,"fill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fillOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textAlign",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontFamily",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontWeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontVariant",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textDecoration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lineHeight",{enumerable:!0,configurable:!0,writable:!0,value:li(120)}),Object.defineProperty(this,"baselineRatio",{enumerable:!0,configurable:!0,writable:!0,value:.19}),Object.defineProperty(this,"direction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textBaseline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oversizedBehavior",{enumerable:!0,configurable:!0,writable:!0,value:"none"}),Object.defineProperty(this,"breakWords",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ellipsis",{enumerable:!0,configurable:!0,writable:!0,value:"…"}),Object.defineProperty(this,"maxWidth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxHeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"minScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ignoreFormatting",{enumerable:!0,configurable:!0,writable:!0,value:!1})}}class qh extends Bn{constructor(){super(...arguments),Object.defineProperty(this,"textType",{enumerable:!0,configurable:!0,writable:!0,value:"circular"}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inside",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"orientation",{enumerable:!0,configurable:!0,writable:!0,value:"auto"}),Object.defineProperty(this,"kerning",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_textReversed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_render(e){this.textType==="circular"?this._renderCircular(e):super._render(e)}_renderCircular(e){if(this.textVisible){const t=this._layer||e;this._prerender(t);const i=this._isInteractive(),r=t.context,n=t.dirty,a=this._renderer._ghostLayer.context;r.save(),i&&a.save(),this._textInfo||this._measure(t);let o=this.radius||0,l=this.startAngle||0,h=0,f=this.orientation,u=f=="auto"?"auto":f=="inward";const p=this.inside,d=this.style.textAlign||"left",b=this.kerning||0;let c=d=="left"?1:-1;const y=!this._textReversed;if(u=="auto"){let v=0,x=0;k(this._textInfo,(w,P)=>{const O=l+w.width/(o-w.height)/2*-c;O>v&&(v=O)}),x=d=="left"?(v+h/2)*Xt:d=="right"?(v-h/2)*Xt:l*Xt,x=Kl(x),u=x>=270||x<=90}u==1&&y&&(this._textInfo.reverse(),this._textReversed=!0),k(this._textInfo,(v,x)=>{const w=v.height;p||(o+=w),(c==-1&&u||c==1&&!u)&&y&&v.textChunks.reverse();let P=l;h=0,d=="center"&&(P+=v.width/(o-w)/2*-c,h=P-l),P+=Math.PI*(u?0:1),r.save(),i&&a.save(),r.rotate(P),i&&a.rotate(P);let O=0;k(v.textChunks,(R,S)=>{const L=R.text,z=R.width;O=z/2/(o-w)*c,r.rotate(O),i&&a.rotate(O),R.style&&(r.save(),a.save(),r.font=R.style,i&&(a.font=R.style)),R.fill&&(r.save(),r.fillStyle=R.fill.toCSS()),r.textBaseline="middle",r.textAlign="center",i&&(a.textBaseline="middle",a.textAlign="center"),n&&r.fillText(L,0,(u?1:-1)*(0-o+w/2)),i&&a.fillText(L,0,(u?1:-1)*(0-o+w/2)),R.fill&&r.restore(),R.style&&(r.restore(),a.restore()),O=(z/2+b)/(o-w)*c,r.rotate(O),i&&a.rotate(O)}),r.restore(),i&&a.restore(),p&&(o-=w)}),r.restore(),i&&a.restore()}}_measure(e){return this.textType==="circular"?this._measureCircular(e):super._measure(e)}_measureCircular(e){const t=e.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl",n=this.style.oversizedBehavior,a=this.style.maxWidth,o=D(a)&&n=="truncate",l=this.style.ellipsis||"";let h;this.textVisible=!0,this._textInfo=[],this._textReversed=!1,t.save(),i.save(),this._prerender(e,!0);const f=this.text.toString().replace(/\r/g,"").split(/\n/);let u=!0,p=0,d=0;return k(f,(b,c)=>{let y,v,x,w=Le.chunk(b,!1,this.style.ignoreFormatting),P={offsetY:d,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};k(w,(O,R)=>{if(O.type=="format"){if(O.text=="[/]")u||(t.restore(),i.restore(),u=!0),v=void 0,y=void 0,x=void 0;else{let S=Le.getTextStyle(O.text);const L=this._getFontStyle(S);t.save(),i.save(),t.font=L,y=L,S.fill&&(v=S.fill),S.width&&(x=xe(S.width)),u=!1}o&&(h=this._measureText(l,t))}else if(O.type=="value"){const S=O.text.match(/./gu)||[];r&&S.reverse();for(let L=0;LY&&(Y=x);const de=V.actualBoundingBoxAscent+V.actualBoundingBoxDescent;if(de>P.height&&(P.height=de),V.actualBoundingBoxAscent>P.ascent&&(P.ascent=V.actualBoundingBoxAscent),P.width+=Y,P.left+=V.actualBoundingBoxLeft,P.right+=V.actualBoundingBoxRight,P.textChunks.push({style:y,fill:v,text:z,width:Y,height:de+V.actualBoundingBoxDescent,left:V.actualBoundingBoxLeft,right:V.actualBoundingBoxRight,ascent:V.actualBoundingBoxAscent,offsetX:0,offsetY:de,textDecoration:void 0}),p+=Y,o){h||(h=this._measureText(l,t));const Ee=h.actualBoundingBoxLeft+h.actualBoundingBoxRight;if(p+=Ee,p+Ee>a){P.textChunks.length==1?this.textVisible=!1:(P.width+=Ee,P.left+=h.actualBoundingBoxLeft,P.right+=h.actualBoundingBoxRight,P.textChunks.push({style:y,fill:v,text:l,width:Ee,height:de+h.actualBoundingBoxDescent,left:h.actualBoundingBoxLeft,right:h.actualBoundingBoxRight,ascent:h.actualBoundingBoxAscent,offsetX:0,offsetY:de,textDecoration:void 0}));break}}if(r)break}}}),this.style.lineHeight instanceof U?P.height*=this.style.lineHeight.value:P.height*=this.style.lineHeight||1.2,this._textInfo.push(P),d+=P.height}),u||(t.restore(),i.restore()),n=="hide"&&p>a&&(this.textVisible=!1),k(this._textInfo,b=>{k(b.textChunks,c=>{c.offsetY+=Math.round((b.height-c.height+(b.ascent-c.ascent))/2)})}),t.restore(),i.restore(),{left:0,top:0,right:0,bottom:0}}}class Gh extends Wi{constructor(e,t){super(e),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_imageMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.image=t}_dispose(){super._dispose(),this._imageMask&&Yt(this._imageMask)}getLocalBounds(){if(!this._localBounds){let e=0,t=0;this.width&&(e=this.width),this.height&&(t=this.height),this._localBounds={left:0,top:0,right:e,bottom:t},this._addBounds(this._localBounds)}return this._localBounds}_render(e){if(super._render(e),this.image){const t=this._layer||e;if(this.tainted===void 0&&(this.tainted=Ar(this.image),t.tainted=!0),this.tainted&&this._renderer._omitTainted)return;if(t.dirty){this.shadowColor&&(t.context.shadowColor=this.shadowColor.toCSS(this.shadowOpacity||1)),this.shadowBlur&&(t.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(t.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(t.context.shadowOffsetY=this.shadowOffsetY);const i=this.width||this.image.naturalWidth,r=this.height||this.image.naturalHeight;t.context.drawImage(this.image,0,0,i,r)}if(this.interactive&&this._isInteractive()){const i=this._getMask(this.image);this._renderer._ghostLayer.context.drawImage(i,0,0)}}}clear(){super.clear(),this.image=void 0,this._imageMask=void 0}_getMask(e){if(this._imageMask===void 0){const t=this.width||e.naturalWidth,i=this.height||e.naturalHeight,r=document.createElement("canvas");r.width=t,r.height=i;const n=r.getContext("2d");n.imageSmoothingEnabled=!1,n.fillStyle=this._getColorId(),n.fillRect(0,0,t,i),Ar(e)||(n.globalCompositeOperation="destination-in",n.drawImage(e,0,0,t,i)),this._imageMask=r}return this._imageMask}}class Kh{constructor(e,t,i,r){Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"originalPoint",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"point",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"bbox",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"simulated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"native",{enumerable:!0,configurable:!0,writable:!0,value:!0}),ct("touchevents")&&e instanceof Touch?this.id=e.identifier:this.id=null}}class Xh extends _l{constructor(e){if(super(),Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"_layerDom",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"layers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_dirtyLayers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"defaultLayer",{enumerable:!0,configurable:!0,writable:!0,value:this.getLayer(0)}),Object.defineProperty(this,"_ghostLayer",{enumerable:!0,configurable:!0,writable:!0,value:new Qh}),Object.defineProperty(this,"_patternCanvas",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("canvas")}),Object.defineProperty(this,"_patternContext",{enumerable:!0,configurable:!0,writable:!0,value:this._patternCanvas.getContext("2d")}),Object.defineProperty(this,"_domWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_domHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_canvasWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_canvasHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interactionsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_colorMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_forceInteractive",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_omitTainted",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_hovering",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_dragging",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mousedown",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_lastPointerMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tapToActivate",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tapToActivateTimeout",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"_touchActive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_touchActiveTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.resolution=e??window.devicePixelRatio,this.view.style.position="absolute",this.view.appendChild(this._layerDom),this._disposers.push(new ne(()=>{G(this._events,(t,i)=>{i.disposer.dispose()}),k(this.layers,t=>{Yt(t.view),t.exportableView&&Yt(t.exportableView)}),Yt(this._ghostLayer.view),Yt(this._patternCanvas)})),this._disposers.push(Mn(()=>{e==null&&(this.resolution=window.devicePixelRatio)})),ct("touchevents")){const t=i=>{this._dragging.length!==0&&yn(this._dragging,r=>!r.value.shouldCancelTouch()||(i.preventDefault(),!1)),this._touchActiveTimeout&&this._delayTouchDeactivate()};this._disposers.push(se(window,"touchstart",t,{passive:!1})),this._disposers.push(se(this.view,"touchstart",t,{passive:!1})),this._disposers.push(se(this.view,"touchmove",()=>{this._touchActiveTimeout&&this._delayTouchDeactivate()},{passive:!0})),this._disposers.push(se(window,"click",i=>{this._touchActive=!1},{passive:!0})),this._disposers.push(se(this.view,"click",i=>{window.setTimeout(()=>{this._touchActive=!0,this._delayTouchDeactivate()},100)},{passive:!0}))}ct("wheelevents")&&this._disposers.push(se(this.view,"wheel",t=>{let i=!1;this._hovering.forEach(r=>{if(r.wheelable)return i=!0,!1}),i&&t.preventDefault()},{passive:!1}))}_delayTouchDeactivate(){this._touchActiveTimeout&&clearTimeout(this._touchActiveTimeout),this.tapToActivateTimeout>0&&(this._touchActiveTimeout=window.setTimeout(()=>{this._touchActive=!1},this.tapToActivateTimeout))}get debugGhostView(){return!!this._ghostLayer.view.parentNode}set debugGhostView(e){e?this._ghostLayer.view.parentNode||this.view.appendChild(this._ghostLayer.view):this._ghostLayer.view.parentNode&&this._ghostLayer.view.parentNode.removeChild(this._ghostLayer.view)}createLinearGradient(e,t,i,r){return this.defaultLayer.context.createLinearGradient(e,t,i,r)}createRadialGradient(e,t,i,r,n,a){return this.defaultLayer.context.createRadialGradient(e,t,i,r,n,a)}createPattern(e,t,i,r,n){return this._patternCanvas.width=r,this._patternCanvas.height=n,this._patternContext.clearRect(0,0,r,n),t.renderDetached(this._patternContext),e.renderDetached(this._patternContext),this._patternContext.createPattern(this._patternCanvas,i)}makeContainer(){return new Ch(this)}makeGraphics(){return new Uh(this)}makeText(e,t){return new Bn(this,e,t)}makeTextStyle(){return new Yh}makeRadialText(e,t){return new qh(this,e,t)}makePicture(e){return new Gh(this,e)}resizeLayer(e){e.resize(this._canvasWidth,this._canvasHeight,this._domWidth,this._domHeight,this.resolution)}resizeGhost(){this._ghostLayer.resize(this._canvasWidth,this._canvasHeight,this._domWidth,this._domHeight,this.resolution)}resize(e,t,i,r){this._canvasWidth=e,this._canvasHeight=t,this._domWidth=i,this._domHeight=r,k(this.layers,n=>{n&&(n.dirty=!0,this.resizeLayer(n))}),this.resizeGhost(),this.view.style.width=i+"px",this.view.style.height=r+"px"}createDetachedLayer(e=!1){const t=document.createElement("canvas"),i=t.getContext("2d",{willReadFrequently:e}),r=new Jh(t,i);return t.style.position="absolute",t.style.top="0px",t.style.left="0px",r}getLayerByOrder(e){const t=this.layers,i=t.length;for(let r=0;rl.order>h.order?1:l.order{t&&t.dirty&&t.visible&&(this._dirtyLayers.push(t),t.clear())}),this._ghostLayer.clear(),e.render(this.defaultLayer),this._ghostLayer.context.restore(),k(this.layers,t=>{if(t){const i=t.context;i.beginPath(),i.moveTo(0,0),i.stroke()}}),k(this._dirtyLayers,t=>{t.context.restore(),t.dirty=!1}),this._hovering.size&&this._lastPointerMoveEvent){const{events:t,target:i,native:r}=this._lastPointerMoveEvent;k(t,n=>{this._dispatchGlobalMousemove(n,i,r)})}}paintId(e){const t=Ph(++this._colorId),i=I.fromHex(t).toCSS();return this._colorMap[i]=e,i}_removeObject(e){e._colorId!==void 0&&delete this._colorMap[e._colorId]}_adjustBoundingBox(e){const t=this._ghostLayer.margin;return new DOMRect(e.left-t.left,e.top-t.top,e.width+t.left+t.right,e.height+t.top+t.bottom)}getEvent(e,t=!0){const i=this.view.getBoundingClientRect(),r={x:e.clientX||0,y:e.clientY||0},n={x:r.x-(t?i.left:0),y:r.y-(t?i.top:0)};return new Kh(e,r,n,this._adjustBoundingBox(i))}_getHitTarget(e,t,i){if(t.width===0||t.height===0||e.xt.right||e.yt.bottom||!i||!this._layerDom.contains(i))return;const r=this._ghostLayer.getImageData(e,t);if(r.data[0]===0&&r.data[1]===0&&r.data[2]===0)return!1;const n=I.fromRGB(r.data[0],r.data[1],r.data[2]).toCSS();return this._colorMap[n]}_withEvents(e,t){const i=this._events[e];if(i!==void 0){i.dispatching=!0;try{t(i)}finally{i.dispatching=!1,i.cleanup&&(i.cleanup=!1,Hi(i.callbacks,r=>!r.disposed),i.callbacks.length===0&&(i.disposer.dispose(),delete this._events[e]))}}}_dispatchEventAll(e,t){this.interactionsEnabled&&this._withEvents(e,i=>{k(i.callbacks,r=>{r.disposed||r.callback.call(r.context,t)})})}_dispatchEvent(e,t,i){if(!this.interactionsEnabled)return!1;let r=!1;return this._withEvents(e,n=>{k(n.callbacks,a=>{a.disposed||a.object!==t||(a.callback.call(a.context,i),r=!0)})}),r}_dispatchMousedown(e,t){const i=e.button;if(i!=0&&i!=2&&i!=1&&i!==void 0)return;const r=this.getEvent(e),n=this._getHitTarget(r.originalPoint,r.bbox,t);if(n){const a=r.id;let o=!1;fi(n,l=>{const h={id:a,value:l};return this._mousedown.push(h),!o&&this._dispatchEvent("pointerdown",l,r)&&(o=!0,this._dragging.some(f=>f.value===l&&f.id===a)||this._dragging.push(h)),!0})}}_dispatchGlobalMousemove(e,t,i){const r=this.getEvent(e),n=this._getHitTarget(r.originalPoint,r.bbox,t);r.native=i,n?(this._hovering.forEach(a=>{a.contains(n)||(this._hovering.delete(a),a.cursorOverStyle&&as(document.body,"cursor",a._replacedCursorStyle),this._dispatchEvent("pointerout",a,r))}),r.native&&fi(n,a=>(this._hovering.has(a)||(this._hovering.add(a),a.cursorOverStyle&&(a._replacedCursorStyle=Cl(document.body,"cursor"),as(document.body,"cursor",a.cursorOverStyle)),this._dispatchEvent("pointerover",a,r)),!0))):(this._hovering.forEach(a=>{a.cursorOverStyle&&as(document.body,"cursor",a._replacedCursorStyle),this._dispatchEvent("pointerout",a,r)}),this._hovering.clear()),this._dispatchEventAll("globalpointermove",r)}_dispatchGlobalMouseup(e,t){const i=this.getEvent(e);i.native=t,this._dispatchEventAll("globalpointerup",i)}_dispatchDragMove(e){if(this._dragging.length!==0){const t=this.getEvent(e),i=t.id;this._dragging.forEach(r=>{r.id===i&&this._dispatchEvent("pointermove",r.value,t)})}}_dispatchDragEnd(e,t){const i=e.button;let r;if(i==0||i===void 0)r="click";else if(i==2)r="rightclick";else{if(i!=1)return;r="middleclick"}const n=this.getEvent(e),a=n.id;if(this._mousedown.length!==0){const o=this._getHitTarget(n.originalPoint,n.bbox,t);o&&this._mousedown.forEach(l=>{l.id===a&&l.value.contains(o)&&this._dispatchEvent(r,l.value,n)}),this._mousedown.length=0}this._dragging.length!==0&&(this._dragging.forEach(o=>{o.id===a&&this._dispatchEvent("pointerup",o.value,n)}),this._dragging.length=0)}_dispatchDoubleClick(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&fi(r,n=>!this._dispatchEvent("dblclick",n,i))}_dispatchWheel(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&fi(r,n=>!this._dispatchEvent("wheel",n,i))}_makeSharedEvent(e,t){if(this._listeners[e]===void 0){const i=t();this._listeners[e]=new wn(()=>{delete this._listeners[e],i.dispose()})}return this._listeners[e].increment()}_onPointerEvent(e,t){let i=!1,r=null;function n(){r=null,i=!1}return new Me([new ne(()=>{r!==null&&clearTimeout(r),n()}),se(this.view,ks(e),a=>{i=!0,r!==null&&clearTimeout(r),r=window.setTimeout(n,0)}),kh(window,e,(a,o)=>{r!==null&&(clearTimeout(r),r=null),t(a,o,i),i=!1})])}_initEvent(e){switch(e){case"globalpointermove":case"pointerover":case"pointerout":return this._makeSharedEvent("pointermove",()=>{const t=(i,r,n)=>{this._lastPointerMoveEvent={events:i,target:r,native:n},k(i,a=>{this._dispatchGlobalMousemove(a,r,n)})};return new Me([this._onPointerEvent("pointerdown",t),this._onPointerEvent("pointermove",t)])});case"globalpointerup":return this._makeSharedEvent("pointerup",()=>{const t=this._onPointerEvent("pointerup",(r,n,a)=>{k(r,o=>{this._dispatchGlobalMouseup(o,a)}),this._lastPointerMoveEvent={events:r,target:n,native:a}}),i=this._onPointerEvent("pointercancel",(r,n,a)=>{k(r,o=>{this._dispatchGlobalMouseup(o,a)}),this._lastPointerMoveEvent={events:r,target:n,native:a}});return new ne(()=>{t.dispose(),i.dispose()})});case"click":case"rightclick":case"middleclick":case"pointerdown":case"pointermove":case"pointerup":return this._makeSharedEvent("pointerdown",()=>{const t=this._onPointerEvent("pointerdown",(a,o)=>{k(a,l=>{this._dispatchMousedown(l,o)})}),i=this._onPointerEvent("pointermove",a=>{k(a,o=>{this._dispatchDragMove(o)})}),r=this._onPointerEvent("pointerup",(a,o)=>{k(a,l=>{this._dispatchDragEnd(l,o)})}),n=this._onPointerEvent("pointercancel",(a,o)=>{k(a,l=>{this._dispatchDragEnd(l,o)})});return new ne(()=>{t.dispose(),i.dispose(),r.dispose(),n.dispose()})});case"dblclick":return this._makeSharedEvent("dblclick",()=>this._onPointerEvent("dblclick",(t,i)=>{k(t,r=>{this._dispatchDoubleClick(r,i)})}));case"wheel":return this._makeSharedEvent("wheel",()=>se(window,ks("wheel"),t=>{this._dispatchWheel(t,Pn(t))},{passive:!1}))}}_addEvent(e,t,i,r){let n=this._events[t];n===void 0&&(n=this._events[t]={disposer:this._initEvent(t),callbacks:[],dispatching:!1,cleanup:!1});const a={object:e,context:r,callback:i,disposed:!1};return n.callbacks.push(a),new ne(()=>{a.disposed=!0,n.dispatching?n.cleanup=!0:(ke(n.callbacks,a),n.callbacks.length===0&&(n.disposer.dispose(),delete this._events[t]))})}getCanvas(e,t){this.render(e),t||(t={});let i=this.resolution,r=Math.floor(this._canvasWidth*this.resolution),n=Math.floor(this._canvasHeight*this.resolution);if(t.minWidth&&t.minWidth>r){let d=t.minWidth/r;d>i&&(i=d*this.resolution)}if(t.minHeight&&t.minHeight>n){let d=t.minHeight/n;d>i&&(i=d*this.resolution)}if(t.maxWidth&&t.maxWidthn){let d=t.maxHeight/n;d{if(d&&d.visible&&(d.tainted||o)){p=!0,d.exportableView=d.view,d.exportableContext=d.context,d.view=document.createElement("canvas"),d.view.style.position="fixed",d.view.style.top="-10000px",this.view.appendChild(d.view),a.push(d.view);let b=0,c=0;d.margin&&(b+=d.margin.left||0+d.margin.right||0,c+=d.margin.top||0+d.margin.bottom||0),d.view.width=r+b,d.view.height=n+c,d.context=d.view.getContext("2d"),d.dirty=!0,d.scale=i}}),p&&(this._omitTainted=!0,this.render(e),this._omitTainted=!1),k(this.layers,d=>{if(d&&d.visible){let b=0,c=0;d.margin&&(b=-(d.margin.left||0)*this.resolution,c=-(d.margin.top||0)*this.resolution),h.drawImage(d.view,b,c),d.exportableView&&(d.view=d.exportableView,d.exportableView=void 0),d.exportableContext&&(d.context=d.exportableContext,d.exportableContext=void 0),f{d.style.position="",d.style.top="",this.view.removeChild(d)}),l}}class Qh{constructor(){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=document.createElement("canvas"),this.context=this.view.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.view.style.position="absolute",this.view.style.top="0px",this.view.style.left="0px"}resize(e,t,i,r,n){e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px",this._width=Math.floor(e*n),this._height=Math.floor(t*n),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}getImageData(e,t){return this.context.getImageData(Math.round((e.x-t.left)/t.width*this._width),Math.round((e.y-t.top)/t.height*this._height),1,1)}setMargin(e){this.margin.left=0,this.margin.right=0,this.margin.top=0,this.margin.bottom=0,k(e,t=>{t.margin&&(this.margin.left=Math.max(this.margin.left,t.margin.left),this.margin.right=Math.max(this.margin.right,t.margin.right),this.margin.top=Math.max(this.margin.top,t.margin.top),this.margin.bottom=Math.max(this.margin.bottom,t.margin.bottom))})}clear(){this.context.save(),this.context.fillStyle="#000",this.context.fillRect(0,0,this._width,this._height)}}class Jh{constructor(e,t){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"order",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dirty",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportableView",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exportableContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=e,this.context=t}resize(e,t,i,r,n){this.width!=null&&(e=this.width,i=this.width),this.height!=null&&(t=this.height,r=this.height),this.margin?(e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px"):(this.view.style.left="0px",this.view.style.top="0px"),this._width=Math.floor(e*n),this._height=Math.floor(t*n),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}clear(){this.context.save(),this.context.clearRect(0,0,this._width,this._height)}}function Cr(s,e){s==null?requestAnimationFrame(e):setTimeout(()=>{requestAnimationFrame(e)},1e3/s)}class Hs{constructor(e,t={},i){if(Object.defineProperty(this,"dom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_inner",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyBounds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPositions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_ticker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_tickers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_updateTick",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Bt}),Object.defineProperty(this,"animationTime",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_animations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tooltipContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipContainerSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltip",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"language",{enumerable:!0,configurable:!0,writable:!0,value:_h.new(this,{})}),Object.defineProperty(this,"locale",{enumerable:!0,configurable:!0,writable:!0,value:Ln}),Object.defineProperty(this,"utc",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timezone",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fps",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numberFormatter",{enumerable:!0,configurable:!0,writable:!0,value:ph.new(this,{})}),Object.defineProperty(this,"dateFormatter",{enumerable:!0,configurable:!0,writable:!0,value:fh.new(this,{})}),Object.defineProperty(this,"durationFormatter",{enumerable:!0,configurable:!0,writable:!0,value:mh.new(this,{})}),Object.defineProperty(this,"tabindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_tabindexes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_a11yD",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusedSprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isShift",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_keyboardDragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_readerAlertElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_logo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDiv",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nonce",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interfaceColors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"verticalLayout",{enumerable:!0,configurable:!0,writable:!0,value:Ft.new(this,{})}),Object.defineProperty(this,"horizontalLayout",{enumerable:!0,configurable:!0,writable:!0,value:Dt.new(this,{})}),Object.defineProperty(this,"gridLayout",{enumerable:!0,configurable:!0,writable:!0,value:gt.new(this,{})}),Object.defineProperty(this,"_paused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"autoResize",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_fontHash",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_isDisposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_resizeSensorDisposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltips",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_htmlElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlEnabledContainers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");let r,n;if(this._settings=t,t.accessible==0&&(this._a11yD=!0),t.useSafeResolution==null&&(t.useSafeResolution=!0),t.useSafeResolution&&(r=Ol()),this._renderer=new Xh(r),n=e instanceof HTMLElement?e:document.getElementById(e),k(Se.rootElements,l=>{if(l.dom===n)throw new Error("You cannot have multiple Roots on the same DOM node")}),this.interfaceColors=Mi.new(this,{}),n===null)throw new Error("Could not find HTML element with id `"+e+"`");this.dom=n;let a=document.createElement("div");a.style.position="relative",a.style.height="100%",n.appendChild(a);const o=t.tooltipContainerBounds;o&&(this._tooltipContainerSettings=o),this._inner=a,this._updateComputedStyles(),Se.rootElements.push(this)}static new(e,t){const i=new Hs(e,t,!0);return i._init(),i}moveDOM(e){let t;if(t=e instanceof HTMLElement?e:document.getElementById(e),t){for(;this.dom.childNodes.length>0;)t.appendChild(this.dom.childNodes[0]);this.dom=t,this._initResizeSensor(),this.resize()}}_handleLogo(){if(this._logo){const e=this.dom.offsetWidth,t=this.dom.offsetHeight;e<=150||t<=60?this._logo.hide():this._logo.show()}}_showBranding(){if(!this._logo){const e=this.tooltipContainer.children.push(Pe.new(this,{interactive:!0,interactiveChildren:!1,position:"absolute",setStateOnChildren:!0,paddingTop:9,paddingRight:9,paddingBottom:9,paddingLeft:9,scale:.6,y:li(100),centerY:Q,tooltipText:"Created using amCharts 5",tooltipX:Q,cursorOverStyle:"pointer",background:Ot.new(this,{fill:Tt(4671320),fillOpacity:0,tooltipY:5})})),t=ei.new(this,{pointerOrientation:"horizontal",paddingTop:4,paddingRight:7,paddingBottom:4,paddingLeft:7});t.label.setAll({fontSize:12}),t.get("background").setAll({fill:this.interfaceColors.get("background"),stroke:this.interfaceColors.get("grid"),strokeOpacity:.3}),e.set("tooltip",t),e.events.on("click",()=>{window.open("https://www.amcharts.com/","_blank")}),e.states.create("hover",{}),e.children.push(He.new(this,{stroke:Tt(13421772),strokeWidth:3,svgPath:"M5 25 L13 25h13.6c3.4 0 6 0 10.3-4.3s5.2-12 8.6-12c3.4 0 4.3 8.6 7.7 8.6M83.4 25H79.8c-3.4 0-6 0-10.3-4.3s-5.2-12-8.6-12-4.3 8.6-7.7 8.6"})).states.create("hover",{stroke:Tt(3976191)}),e.children.push(He.new(this,{stroke:Tt(8947848),strokeWidth:3,svgPath:"M83.4 25h-31C37 25 39.5 4.4 28.4 4.4S18.9 24.2 4.3 25H0"})).states.create("hover",{stroke:Tt(4671320)}),this._logo=e,this._handleLogo()}}_getRealSize(){return this.dom.getBoundingClientRect()}_getCalculatedSize(e){return this._settings.calculateSize?this._settings.calculateSize(e):{width:e.width,height:e.height}}_init(){const e=this._renderer,t=this._getRealSize(),i=this._getCalculatedSize(t),r=Math.floor(i.width),n=Math.floor(i.height),a=Math.floor(t.width),o=Math.floor(t.height),l=Pe.new(this,{visible:!0,width:a,height:o});this._rootContainer=l,this._rootContainer._defaultThemes.push(hh.new(this));const h=l.children.push(Pe.new(this,{visible:!0,width:Q,height:Q}));this.container=h,e.resize(a,o,r,n),this._inner.appendChild(e.view),this._initResizeSensor();const f=document.createElement("div");if(this._htmlElementContainer=f,f.className="am5-html-container",f.style.position="absolute",f.style.pointerEvents="none",this._tooltipContainerSettings||(f.style.overflow="hidden"),this._inner.appendChild(f),this._a11yD!==!0){const u=document.createElement("div");u.className="am5-reader-container",u.setAttribute("role","alert"),u.style.position="absolute",u.style.width="1px",u.style.height="1px",u.style.overflow="hidden",u.style.clip="rect(1px, 1px, 1px, 1px)",this._readerAlertElement=u,this._inner.appendChild(this._readerAlertElement);const p=document.createElement("div");p.className="am5-focus-container",p.style.position="absolute",p.style.pointerEvents="none",p.style.top="0px",p.style.left="0px",p.style.overflow="hidden",p.style.width=r+"px",p.style.height=n+"px",p.setAttribute("role","application"),Ct(p,!1),this._focusElementContainer=p,this._inner.appendChild(this._focusElementContainer);const d=document.createElement("div");this._tooltipElementContainer=d,d.className="am5-tooltip-container",this._inner.appendChild(d),ct("keyboardevents")&&(this._disposers.push(se(window,"keydown",b=>{b.keyCode==16?this._isShift=!0:b.keyCode==9&&(this._isShift=b.shiftKey)})),this._disposers.push(se(window,"keyup",b=>{b.keyCode==16&&(this._isShift=!1)})),this._disposers.push(se(p,"keydown",b=>{const c=this._focusedSprite;if(c){b.keyCode==27&&(kl(),this._focusedSprite=void 0);let y=0,v=0;switch(b.keyCode){case 13:b.preventDefault();const x=e.getEvent(new MouseEvent("click"));return void c.events.dispatch("click",{type:"click",originalEvent:x.event,point:x.point,simulated:!0,target:c});case 37:y=-6;break;case 39:y=6;break;case 38:v=-6;break;case 40:v=6;break;default:return}if(y!=0||v!=0){if(b.preventDefault(),!c.isDragging()){this._keyboardDragPoint={x:0,y:0};const P=e.getEvent(new MouseEvent("mousedown",{clientX:0,clientY:0}));c.events.isEnabled("pointerdown")&&c.events.dispatch("pointerdown",{type:"pointerdown",originalEvent:P.event,point:P.point,simulated:!0,target:c})}const x=this._keyboardDragPoint;x.x+=y,x.y+=v;const w=e.getEvent(new MouseEvent("mousemove",{clientX:x.x,clientY:x.y}),!1);c.events.isEnabled("globalpointermove")&&c.events.dispatch("globalpointermove",{type:"globalpointermove",originalEvent:w.event,point:w.point,simulated:!0,target:c})}}})),this._disposers.push(se(p,"keyup",b=>{if(this._focusedSprite){const c=this._focusedSprite,y=b.keyCode;switch(y){case 37:case 39:case 38:case 40:if(c.isDragging()){const v=this._keyboardDragPoint,x=e.getEvent(new MouseEvent("mouseup",{clientX:v.x,clientY:v.y}));return c.events.isEnabled("globalpointerup")&&c.events.dispatch("globalpointerup",{type:"globalpointerup",originalEvent:x.event,point:x.point,simulated:!0,target:c}),void(this._keyboardDragPoint=void 0)}if(c.get("focusableGroup")){const v=c.get("focusableGroup"),x=this._tabindexes.filter(O=>O.get("focusableGroup")==v);let w=x.indexOf(c);const P=x.length-1;w+=y==39||y==40?1:-1,w<0?w=P:w>P&&(w=0),Al(x[w].getPrivate("focusElement").dom)}}}})))}this._startTicker(),this.setThemes([]),this._addTooltip(),this._hasLicense()||this._showBranding()}_initResizeSensor(){this._resizeSensorDisposer&&this._resizeSensorDisposer.dispose(),this._resizeSensorDisposer=new ch(this.dom,()=>{this.autoResize&&this.resize()}),this._disposers.push(this._resizeSensorDisposer)}resize(){const e=this._getRealSize(),t=this._getCalculatedSize(e),i=Math.floor(t.width),r=Math.floor(t.height);if(i>0&&r>0){const n=Math.floor(e.width),a=Math.floor(e.height),o=this._htmlElementContainer;if(o.style.width=i+"px",o.style.height=r+"px",this._a11yD!==!0){const h=this._focusElementContainer;h.style.width=i+"px",h.style.height=r+"px"}this._renderer.resize(n,a,i,r);const l=this._rootContainer;l.setPrivate("width",n),l.setPrivate("height",a),this._render(),this._handleLogo()}}_render(){this._renderer.render(this._rootContainer._display),this._focusElementDirty&&(this._updateCurrentFocus(),this._focusElementDirty=!1)}_runTickers(e){k(this._tickers,t=>{t(e)})}_runAnimations(e){Hi(this._animations,t=>t._runAnimation(e))}_runDirties(){let e={};for(;this._isDirtyParents;)this._isDirtyParents=!1,fe(this._dirtyParents).forEach(a=>{const o=this._dirtyParents[a];delete this._dirtyParents[a],o.isDisposed()||(e[o.uid]=o,o._prepareChildren())});fe(e).forEach(a=>{e[a]._updateChildren()});const t=[];fe(this._dirty).forEach(a=>{const o=this._dirty[a];o.isDisposed()?delete this._dirty[o.uid]:(t.push(o),o._beforeChanged())}),t.forEach(a=>{a._changed(),delete this._dirty[a.uid],a._clearDirty()}),this._isDirty=!1;const i={},r=[];fe(this._dirtyBounds).forEach(a=>{const o=this._dirtyBounds[a];delete this._dirtyBounds[a],o.isDisposed()||(i[o.uid]=o.depth(),r.push(o))}),this._positionHTMLElements(),r.sort((a,o)=>pt(i[o.uid],i[a.uid])),r.forEach(a=>{a._updateBounds()});const n=this._dirtyPositions;fe(n).forEach(a=>{const o=n[a];delete n[a],o.isDisposed()||o._updatePosition()}),t.forEach(a=>{a._afterChanged()})}_renderFrame(e){return!this._updateTick||(this.events.isEnabled("framestarted")&&this.events.dispatch("framestarted",{type:"framestarted",target:this,timestamp:e}),this._checkComputedStyles(),this._runTickers(e),this._runAnimations(e),this._runDirties(),this._render(),this._positionHTMLElements(),this.events.isEnabled("frameended")&&this.events.dispatch("frameended",{type:"frameended",target:this,timestamp:e}),this._tickers.length===0&&this._animations.length===0&&!this._isDirty)}_runTicker(e,t){this.isDisposed()||(this.animationTime=e,this._renderFrame(e)?(this._ticker=null,this.animationTime=null):this._paused||(t?this._ticker:Cr(this.fps,this._ticker)))}_runTickerNow(e=1e4){if(!this.isDisposed()){const t=performance.now()+e;for(;;){const i=performance.now();if(i>=t){this.animationTime=null;break}if(this.animationTime=i,this._renderFrame(i)){this.animationTime=null;break}}}}_startTicker(){this._ticker===null&&(this.animationTime=null,this._ticker=e=>{this._runTicker(e)},Cr(this.fps,this._ticker))}get updateTick(){return this._updateTick}set updateTick(e){this._updateTick=e,e&&this._startTicker()}_addDirtyEntity(e){this._dirty[e.uid]===void 0&&(this._isDirty=!0,this._dirty[e.uid]=e,this._startTicker())}_addDirtyParent(e){this._dirtyParents[e.uid]===void 0&&(this._isDirty=!0,this._isDirtyParents=!0,this._dirtyParents[e.uid]=e,this._startTicker())}_addDirtyBounds(e){this._dirtyBounds[e.uid]===void 0&&(this._isDirty=!0,this._dirtyBounds[e.uid]=e,this._startTicker())}_addDirtyPosition(e){this._dirtyPositions[e.uid]===void 0&&(this._isDirty=!0,this._dirtyPositions[e.uid]=e,this._startTicker())}_addAnimation(e){this._animations.indexOf(e)===-1&&(this._animations.push(e),this._startTicker())}_markDirty(){this._isDirty=!0}_markDirtyRedraw(){this.events.once("frameended",()=>{this._isDirty=!0,this._startTicker()})}eachFrame(e){return this._tickers.push(e),this._startTicker(),new ne(()=>{ke(this._tickers,e)})}markDirtyGlobal(e){e||(e=this.container),e.walkChildren(t=>{t instanceof Pe&&this.markDirtyGlobal(t),t.markDirty(),t.markDirtyBounds()})}width(){return Math.floor(this._getCalculatedSize(this._getRealSize()).width)}height(){return Math.floor(this._getCalculatedSize(this._getRealSize()).height)}dispose(){this._isDisposed||(this._isDisposed=!0,this._rootContainer.dispose(),this._renderer.dispose(),this.horizontalLayout.dispose(),this.verticalLayout.dispose(),this.interfaceColors.dispose(),k(this._disposers,e=>{e.dispose()}),this._inner&&Pl(this._inner),Qe(Se.rootElements,this))}isDisposed(){return this._isDisposed}readerAlert(e){this._a11yD!==!0&&(this._readerAlertElement.innerHTML=_r(e))}setThemes(e){this._rootContainer.set("themes",e);const t=this.tooltipContainer;t&&t._applyThemes();const i=this.interfaceColors;i&&i._applyThemes()}_addTooltip(){if(!this.tooltipContainer){const e=this._tooltipContainerSettings,t=this._rootContainer.children.push(Pe.new(this,{position:"absolute",isMeasured:!1,width:Q,height:Q,layer:e?35:30,layerMargin:e||void 0}));this.tooltipContainer=t;const i=ei.new(this,{});this.container.set("tooltip",i),i.hide(0),this._tooltip=i}}_registerTabindexOrder(e){this._a11yD!=1&&(e.get("focusable")?ni(this._tabindexes,e):Qe(this._tabindexes,e),this._invalidateTabindexes())}_unregisterTabindexOrder(e){this._a11yD!=1&&(Qe(this._tabindexes,e),this._invalidateTabindexes())}_invalidateTabindexes(){if(this._a11yD==1)return;this._tabindexes.sort((t,i)=>{const r=t.get("tabindexOrder",0),n=i.get("tabindexOrder",0);return r==n?0:r>n?1:-1});const e=[];k(this._tabindexes,(t,i)=>{t.getPrivate("focusElement")?this._moveFocusElement(i,t):this._makeFocusElement(i,t);const r=t.get("focusableGroup");r&&(e.indexOf(r)!==-1?t.getPrivate("focusElement").dom.setAttribute("tabindex","-1"):e.push(r))})}_updateCurrentFocus(){this._a11yD!=1&&this._focusedSprite&&(this._decorateFocusElement(this._focusedSprite),this._positionFocusElement(this._focusedSprite))}_decorateFocusElement(e,t){if(this._a11yD==1||(t||(t=e.getPrivate("focusElement").dom),!t))return;e.get("visible")&&e.get("role")!="tooltip"&&!e.isHidden()?t.getAttribute("tabindex")!="-1"&&t.setAttribute("tabindex",""+this.tabindex):t.removeAttribute("tabindex");const i=e.get("role");i?t.setAttribute("role",i):t.removeAttribute("role");const r=e.get("ariaLabel");if(r){const d=Si(e,r);t.setAttribute("aria-label",d)}else t.removeAttribute("aria-label");const n=e.get("ariaLive");n?t.setAttribute("aria-live",n):t.removeAttribute("aria-live");const a=e.get("ariaChecked");a!=null?t.setAttribute("aria-checked",a?"true":"false"):t.removeAttribute("aria-checked"),e.get("ariaHidden")?t.setAttribute("aria-hidden","hidden"):t.removeAttribute("aria-hidden");const o=e.get("ariaOrientation");o?t.setAttribute("aria-orientation",o):t.removeAttribute("aria-orientation");const l=e.get("ariaValueNow");l?t.setAttribute("aria-valuenow",l):t.removeAttribute("aria-valuenow");const h=e.get("ariaValueMin");h?t.setAttribute("aria-valuemin",h):t.removeAttribute("aria-valuemin");const f=e.get("ariaValueMax");f?t.setAttribute("aria-valuemax",f):t.removeAttribute("aria-valuemax");const u=e.get("ariaValueText");u?t.setAttribute("aria-valuetext",u):t.removeAttribute("aria-valuetext");const p=e.get("ariaControls");p?t.setAttribute("aria-controls",p):t.removeAttribute("aria-controls")}_makeFocusElement(e,t){if(t.getPrivate("focusElement")||this._a11yD==1)return;const i=document.createElement("div");t.get("role")!="tooltip"&&(i.tabIndex=this.tabindex),i.style.position="absolute",Ct(i,!1);const r=[];t.setPrivate("focusElement",{dom:i,disposers:r}),this._decorateFocusElement(t),r.push(se(i,"focus",n=>{this._handleFocus(n,e)})),r.push(se(i,"blur",n=>{this._handleBlur(n,e)})),this._moveFocusElement(e,t)}_removeFocusElement(e){if(this._a11yD==1)return;Qe(this._tabindexes,e);const t=e.getPrivate("focusElement");t&&(this._focusElementContainer.removeChild(t.dom),k(t.disposers,i=>{i.dispose()}))}_hideFocusElement(e){this._a11yD!=1&&(e.getPrivate("focusElement").dom.style.display="none")}_moveFocusElement(e,t){if(this._a11yD==1)return;const i=this._focusElementContainer,r=t.getPrivate("focusElement").dom;if(r===this._focusElementContainer.children[e])return;const n=this._focusElementContainer.children[e+1];n?i.insertBefore(r,n):i.append(r)}_positionFocusElement(e){if(this._a11yD==1)return;const t=e.globalBounds();let i=t.right==t.left?e.width():t.right-t.left,r=t.top==t.bottom?e.height():t.bottom-t.top,n=t.left-2,a=t.top-2;i<0&&(n+=i,i=Math.abs(i)),r<0&&(a+=r,r=Math.abs(r));const o=e.getPrivate("focusElement").dom;o.style.top=a+"px",o.style.left=n+"px",o.style.width=i+4+"px",o.style.height=r+4+"px"}_handleFocus(e,t){if(this._a11yD==1)return;const i=this._tabindexes[t];i.isVisibleDeep()?(this._positionFocusElement(i),this._focusedSprite=i,i.events.isEnabled("focus")&&i.events.dispatch("focus",{type:"focus",originalEvent:e,target:i})):this._focusNext(e.target,this._isShift?-1:1)}_focusNext(e,t){if(this._a11yD==1)return;const i=Array.from(document.querySelectorAll(["a[href]","area[href]","button:not([disabled])","details","input:not([disabled])","iframe:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contentEditable=""]','[contentEditable="true"]','[contentEditable="TRUE"]','[tabindex]:not([tabindex^="-"])'].join(",")));let r=i.indexOf(e)+t;r<0?r=i.length-1:r>=i.length&&(r=0),i[r].focus()}_handleBlur(e,t){if(this._a11yD==1)return;const i=this._focusedSprite;i&&i.events.isEnabled("blur")&&i.events.dispatch("blur",{type:"blur",originalEvent:e,target:i}),this._focusedSprite=void 0}updateTooltip(e){if(this._a11yD==1)return;const t=_r(e._getText());let i=e.getPrivate("tooltipElement");e.get("role")=="tooltip"&&t!=""?(i||(i=this._makeTooltipElement(e)),i.innerHTML!=t&&(i.innerHTML=t)):i&&(i.remove(),e.removePrivate("tooltipElement"))}_makeTooltipElement(e){const t=this._tooltipElementContainer,i=document.createElement("div");return i.style.position="absolute",i.style.width="1px",i.style.height="1px",i.style.overflow="hidden",i.style.clip="rect(1px, 1px, 1px, 1px)",Ct(i,!1),this._decorateFocusElement(e,i),t.append(i),e.setPrivate("tooltipElement",i),i}_removeTooltipElement(e){if(this._a11yD==1)return;const t=e.getPrivate("tooltipElement");if(t){const i=t.parentElement;i&&i.removeChild(t)}}_invalidateAccessibility(e){if(this._a11yD==1)return;this._focusElementDirty=!0;const t=e.getPrivate("focusElement");e.get("focusable")?t&&(this._decorateFocusElement(e),this._positionFocusElement(e)):t&&this._removeFocusElement(e)}focused(e){return this._focusedSprite===e}documentPointToRoot(e){const t=this.dom.getBoundingClientRect();return{x:e.x-t.left,y:e.y-t.top}}rootPointToDocument(e){const t=this.dom.getBoundingClientRect();return{x:e.x+t.left,y:e.y+t.top}}addDisposer(e){return this._disposers.push(e),e}_updateComputedStyles(){const e=window.getComputedStyle(this.dom);let t="";G(e,(r,n)=>{$t(r)&&r.match(/^font/)&&(t+=n)});const i=t!=this._fontHash;return i&&(this._fontHash=t),i}_checkComputedStyles(){this._updateComputedStyles()&&this._invalidateLabelBounds(this.container)}_invalidateLabelBounds(e){e instanceof Pe?e.children.each(t=>{this._invalidateLabelBounds(t)}):e instanceof Zt&&e.markDirtyBounds()}_hasLicense(){for(let e=0;e{const n=this._renderer.getEvent(r);e.events.dispatch("click",{type:"click",originalEvent:n.event,point:n.point,simulated:!1,target:e})}))),this._positionHTMLElement(e),t.append(i),ni(this._htmlEnabledContainers,e),i}_positionHTMLElements(){k(this._htmlEnabledContainers,e=>{this._positionHTMLElement(e)})}_positionHTMLElement(e){const t=e.getPrivate("htmlElement");if(t){k(["paddingTop","paddingRight","paddingBottom","paddingLeft","minWidth","minHeight","maxWidth","maxHeight"],f=>{const u=e.get(f);t.style[f]=u?u+"px":""});const i=e.compositeOpacity();setTimeout(()=>{t.style.opacity=i+""},10);const r=e.isVisibleDeep();r&&(t.style.display="block");const n=e.globalBounds();t.style.top=n.top+"px",t.style.left=n.left+"px";const a=e.get("width"),o=e.get("height");let l=0,h=0;if(a&&(l=e.width()),o&&(h=e.height()),a&&o)e.removePrivate("minWidth"),e.removePrivate("minHeight");else{t.style.position="fixed",t.style.width="",t.style.height="";const f=t.getBoundingClientRect();t.style.position="absolute",l=f.width,h=f.height,e._adjustedLocalBounds={left:0,right:0,top:0,bottom:0},e.setPrivate("minWidth",l),e.setPrivate("minHeight",h)}l>0&&(t.style.minWidth=l+"px"),h>0&&(t.style.minHeight=h+"px"),r&&i!=0||(t.style.display="none")}}_setHTMLContent(e,t){let i=e.getPrivate("htmlElement");i||(i=this._makeHTMLElement(e)),i.innerHTML!=t&&(i.innerHTML=t)}_removeHTMLContent(e){let t=e.getPrivate("htmlElement");t&&this._htmlElementContainer.removeChild(t),Qe(this._htmlEnabledContainers,e)}}eh("AM5C241025748");const Tr="en-us",zs=new Map([["ar",()=>C(()=>import("./ar2-dfb29e9e.js"),[])],["bg-bg",()=>C(()=>import("./bg_BG2-08c99e6c.js"),[])],["bs-ba",()=>C(()=>import("./bs_BA2-f2917445.js"),[])],["ca-es",()=>C(()=>import("./ca_ES2-f5f347b0.js"),[])],["cs-cz",()=>C(()=>import("./cs_CZ2-1e33a1ce.js"),[])],["da-dk",()=>C(()=>import("./da_DK2-4e72198c.js"),[])],["de-de",()=>C(()=>import("./de_DE2-15e279b1.js"),[])],["de-ch",()=>C(()=>import("./de_CH2-b9a3a608.js"),[])],["el-gr",()=>C(()=>import("./el_GR2-2b9c8a60.js"),[])],["en-us",()=>C(()=>import("./en_US2-40dcf3cc.js"),[])],["en-ca",()=>C(()=>import("./en_CA2-40dcf3cc.js"),[])],["es-es",()=>C(()=>import("./es_ES2-c856435b.js"),[])],["et-ee",()=>C(()=>import("./et_EE2-193ac1c8.js"),[])],["fi-fi",()=>C(()=>import("./fi_FI2-53484f9e.js"),[])],["fr-fr",()=>C(()=>import("./fr_FR2-8b6dd3fc.js"),[])],["he-il",()=>C(()=>import("./he_IL2-ecc10351.js"),[])],["hr-hr",()=>C(()=>import("./hr_HR2-6c8e87b3.js"),[])],["hu-hu",()=>C(()=>import("./hu_HU2-fbe5572b.js"),[])],["id-id",()=>C(()=>import("./id_ID2-56ecb0c6.js"),[])],["it-it",()=>C(()=>import("./it_IT2-20a2fdf5.js"),[])],["ja-jp",()=>C(()=>import("./ja_JP2-2f441bec.js"),[])],["ko-kr",()=>C(()=>import("./ko_KR2-5290e5f8.js"),[])],["lt-lt",()=>C(()=>import("./lt_LT2-e057464e.js"),[])],["lv-lv",()=>C(()=>import("./lv_LV2-7a761c7a.js"),[])],["nb-no",()=>C(()=>import("./nb_NO2-853c98f6.js"),[])],["nl-nl",()=>C(()=>import("./nl_NL2-e2c04ba1.js"),[])],["pl-pl",()=>C(()=>import("./pl_PL2-8693870b.js"),[])],["pt-br",()=>C(()=>import("./pt_BR2-a1cac873.js"),[])],["pt-pt",()=>C(()=>import("./pt_PT2-e5eb7b28.js"),[])],["ro-ro",()=>C(()=>import("./ro_RO2-554c8802.js"),[])],["ru-ru",()=>C(()=>import("./ru_RU2-5b0bfec9.js"),[])],["sk-sk",()=>C(()=>import("./sk_SK2-feee92a1.js"),[])],["sl-sl",()=>C(()=>import("./sl_SL2-56e581d6.js"),[])],["sr-rs",()=>C(()=>import("./sr_RS2-dba2ad75.js"),[])],["sv-se",()=>C(()=>import("./sv_SE2-e6ae4e09.js"),[])],["th-th",()=>C(()=>import("./th_TH2-def73602.js"),[])],["tr-tr",()=>C(()=>import("./tr_TR2-d87d745f.js"),[])],["uk-ua",()=>C(()=>import("./uk_UA2-ae6136c6.js"),[])],["vi-vn",()=>C(()=>import("./vi_VN2-8bff547b.js"),[])],["zh-cn",()=>C(()=>import("./zh_Hans2-41156b15.js"),[])],["zh-hk",()=>C(()=>import("./zh_Hant2-8bca75bb.js"),[])],["zh-tw",()=>C(()=>import("./zh_Hant2-8bca75bb.js"),[])]]);function Zh(s){const e=s.split("-")[0].toLowerCase();let t=null;for(const i of zs.keys())if(i.startsWith(e)){t=i;break}return t}function ed(s){return s?zs.has(s.toLowerCase())?s.toLowerCase():Zh(s)||Tr:Tr}async function td(s,e=ga()){const t=Hs.new(s);return t.locale=(await zs.get(ed(e))()).default,t}const Rn=["#7ABEE5","#B39BD5","#F8AE83","#92E6E4","#FBC487","#EE967A","#CEA2D6","#89D594","#CEE68F","#F1A6D5"].map(s=>Tt(s)),id=Object.freeze(Object.defineProperty({__proto__:null,createRoot:td,esriChartColorSet:Rn},Symbol.toStringTag,{value:"Module"})),ee="esri-feature-media",ce={base:ee,mediaContainer:`${ee}__container`,mediaItemContainer:`${ee}__item-container`,mediaItem:`${ee}__item`,mediaItemText:`${ee}__item-text`,mediaItemTitle:`${ee}__item-title`,mediaItemCaption:`${ee}__item-caption`,mediaNavigation:`${ee}__item-navigation`,mediaPagination:`${ee}__pagination`,mediaPaginationText:`${ee}__pagination-text`,mediaPrevious:`${ee}__previous`,mediaPreviousIconLTR:`${ee}__previous-icon`,mediaPreviousIconRTL:`${ee}__previous-icon--rtl`,mediaNext:`${ee}__next`,mediaNextIconLTR:`${ee}__next-icon`,mediaNextIconRTL:`${ee}__next-icon--rtl`,mediaChart:`${ee}__chart`,mediaPaginationButton:`${ee}__pagination-button`,mediaPaginationIcon:`${ee}__pagination-icon`,mediaChartRendered:`${ee}__chart--rendered`},ps=15,Ge="category",Nt="value",sd="rgba(50, 50, 50, 1)",rd=250,nd=500,ad=200;let pe=class extends Be{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new dt,this.messages=null,this._disposeChart=i=>{var r;(r=this._chartRootMap.get(i))==null||r.dispose(),this._chartRootMap.delete(i)},this._createChart=async i=>{const{destroyed:r,viewModel:n}=this;if(r||!n||!i)return;const{createRoot:a}=await C(()=>Promise.resolve().then(()=>id),void 0),o=await a(i);this._chartRootMap.set(i,o),this._renderChart({mediaInfo:n.activeMediaInfo,root:o})}}initialize(){this._featureElementInfo=new ji,this.addHandles([F(()=>{var e,t;return[(e=this.viewModel)==null?void 0:e.activeMediaInfo,(t=this.viewModel)==null?void 0:t.activeMediaInfoIndex]},()=>this._setupMediaRefreshTimer(),oe),F(()=>{var e,t;return[(e=this.viewModel)==null?void 0:e.description,(t=this.viewModel)==null?void 0:t.title]},()=>this._setupFeatureElementInfo(),oe)])}loadDependencies(){return ai({icon:()=>C(()=>import("./calcite-icon-2c0948c4.js"),["assets/calcite-icon-2c0948c4.js","assets/icon-25aef281.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/observers-4ce6e1b4.js"])})}destroy(){var e;this._clearMediaRefreshTimer(),(e=this._featureElementInfo)==null||e.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){var e;return _("div",{bind:this,class:ce.base,onkeyup:this._handleMediaKeyup},(e=this._featureElementInfo)==null?void 0:e.render(),this.renderMedia())}renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this.renderMediaText();return e?_("div",{key:"media-element-container",class:ce.mediaContainer},this.renderMediaInfo(),_("div",{class:ce.mediaNavigation},i,_("div",{class:ce.mediaPagination},this.renderMediaPageButton("previous"),_("span",{class:ce.mediaPaginationText},Fe(this.messages.pageText,{index:t+1,total:e})),this.renderMediaPageButton("next")))):null}renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?_("div",{key:"media-title",class:ce.mediaItemTitle,innerHTML:e.title}):null,i=e&&e.caption?_("div",{key:"media-caption",class:ce.mediaItemCaption,innerHTML:e.caption}):null;return t||i?_("div",{key:"media-text",class:ce.mediaItemText},t,i):null}renderImageMediaInfo(e){const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:r}=this.viewModel,{value:n,refreshInterval:a,altText:o,title:l,type:h}=e,{sourceURL:f,linkURL:u}=n,p=hn(u??void 0)?"_blank":"_self",d=p==="_blank"?"noreferrer":"",b=a?t:null,c=b?b.timestamp:0,y=b?b.sourceURL:f,v=_("img",{alt:o||l,key:`media-${h}-${i}-${r}-${c}`,src:y??void 0});return(u?_("a",{title:l,href:u,rel:d,target:p},v):null)??v}renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return _("div",{key:`media-${e.type}-${t}-${i}`,bind:this,class:ce.mediaChart,afterCreate:this._createChart,afterRemoved:this._disposeChart})}renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?e.type==="image"?this.renderImageMediaInfo(e):e.type.includes("chart")?this.renderChartMediaInfo(e):null:null}renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?_("div",{key:"media-container",class:ce.mediaItemContainer},_("div",{key:"media-item-container",class:ce.mediaItem},this.renderMediaInfoType())):null}renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t=e==="previous",i=t?this.messages.previous:this.messages.next,r=t?"chevron-left":"chevron-right",n=t?"media-previous":"media-next",a=t?this._previous:this._next;return _("button",{type:"button",key:n,title:i,"aria-label":i,tabIndex:0,class:ce.mediaPaginationButton,bind:this,onclick:a},_("calcite-icon",{class:ce.mediaPaginationIcon,scale:"s",icon:r}))}_setupFeatureElementInfo(){var i;const{description:e,title:t}=this;(i=this._featureElementInfo)==null||i.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&(t!=null&&t.featureReduction)&&"renderer"in t.featureReduction?t.featureReduction.renderer:t==null?void 0:t.renderer}async _getRendererColors(){const{colorAm5:e}=await C(()=>import("./chartCommon-98b0365b.js"),["assets/chartCommon-98b0365b.js","assets/Button-5999eab8.js","assets/ColorSet-bb3b0c3c.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/unitFormatUtils-b70a7bff.js","assets/AttachmentInfo-cb670dd0.js","assets/AttachmentQuery-972bbd60.js","assets/widget-78e8b6fe.js","assets/jsonUtils-f73b3833.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/Query-1c961d4c.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/RelationshipQuery-39c07195.js","assets/TopFeaturesQuery-e44d05be.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/popupUtils-82ea8abb.js"]),t=new Map,i=this._getRenderer(),r="default";if(!i)return t;const n=await Uo(i);return n.delete(r),Array.from(n.values()).every(a=>(a==null?void 0:a.length)===1)&&Array.from(n.keys()).forEach(a=>{var l,h;const o=(h=(l=n.get(a))==null?void 0:l[0])==null?void 0:h.toCss(!0);o&&t.set(a,e(o))}),t}_handleMediaKeyup(e){const t=Pt(e);t==="ArrowLeft"&&(e.stopPropagation(),this.viewModel.previous()),t==="ArrowRight"&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&!!this.viewModel.abilities.chartAnimation&&!Fo()}_getChartAnimationMS(){return this._canAnimateChart()?rd:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?nd:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:r,type:n}=i,{ResponsiveThemeAm5:a,DarkThemeAm5:o,AnimatedThemeAm5:l,ColorSetAm5:h,ThemeAm5:f}=await C(()=>import("./chartCommon-98b0365b.js"),["assets/chartCommon-98b0365b.js","assets/Button-5999eab8.js","assets/ColorSet-bb3b0c3c.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/unitFormatUtils-b70a7bff.js","assets/AttachmentInfo-cb670dd0.js","assets/AttachmentQuery-972bbd60.js","assets/widget-78e8b6fe.js","assets/jsonUtils-f73b3833.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/Query-1c961d4c.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/RelationshipQuery-39c07195.js","assets/TopFeaturesQuery-e44d05be.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/popupUtils-82ea8abb.js"]),u=f.new(t);u.rule("ColorSet").set("colors",Rn);const p=[a.new(t),u];bs()&&p.push(o.new(t)),this._canAnimateChart()&&p.push(l.new(t)),t.setThemes(p);const d=await this._getRendererColors(),b=h.new(t,{}),c=r.series.map((y,v)=>{const x=d.get(y.fieldName)||b.getIndex(v);return{[Ge]:y.tooltip,[Nt]:y.value,columnSettings:{fill:x,stroke:x}}}).filter(y=>n!=="pie-chart"||y.value!=null&&y.value>0);n==="pie-chart"?this._createPieChart(e,c):this._createXYChart(e,c)}_getDirection(){return mt(this.container)?"rtl":"ltr"}_isInversed(){return!!mt(this.container)}async _customizeChartTooltip(e,t="horizontal"){var r;const{colorAm5:i}=await C(()=>import("./chartCommon-98b0365b.js"),["assets/chartCommon-98b0365b.js","assets/Button-5999eab8.js","assets/ColorSet-bb3b0c3c.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/unitFormatUtils-b70a7bff.js","assets/AttachmentInfo-cb670dd0.js","assets/AttachmentQuery-972bbd60.js","assets/widget-78e8b6fe.js","assets/jsonUtils-f73b3833.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/Query-1c961d4c.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/RelationshipQuery-39c07195.js","assets/TopFeaturesQuery-e44d05be.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/popupUtils-82ea8abb.js"]);e.setAll({pointerOrientation:t}),(r=e.get("background"))==null||r.setAll({stroke:i(sd)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:ad})}async _createPieChart(e,t){const{TooltipAm5:i}=await C(()=>import("./chartCommon-98b0365b.js"),["assets/chartCommon-98b0365b.js","assets/Button-5999eab8.js","assets/ColorSet-bb3b0c3c.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/unitFormatUtils-b70a7bff.js","assets/AttachmentInfo-cb670dd0.js","assets/AttachmentQuery-972bbd60.js","assets/widget-78e8b6fe.js","assets/jsonUtils-f73b3833.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/Query-1c961d4c.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/RelationshipQuery-39c07195.js","assets/TopFeaturesQuery-e44d05be.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/popupUtils-82ea8abb.js"]),{PieChartAm5:r,PieSeriesAm5:n}=await C(()=>import("./pieChart-bf6791d4.js"),["assets/pieChart-bf6791d4.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/Tick-c7ca49b9.js","assets/ColorSet-bb3b0c3c.js","assets/unitFormatUtils-b70a7bff.js","assets/AttachmentInfo-cb670dd0.js","assets/AttachmentQuery-972bbd60.js","assets/widget-78e8b6fe.js","assets/jsonUtils-f73b3833.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/Query-1c961d4c.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/RelationshipQuery-39c07195.js","assets/TopFeaturesQuery-e44d05be.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/popupUtils-82ea8abb.js"]),{mediaInfo:a,root:o}=e,{title:l}=a,h=5,f=(a==null?void 0:a.altText)||(a==null?void 0:a.title)||"",u=o.container.children.push(r.new(o,{ariaLabel:f,focusable:!0,paddingBottom:h,paddingTop:h,paddingLeft:h,paddingRight:h})),p=`{category}: {valuePercentTotal.formatNumber('0.00')}% + ({value})`,d=i.new(o,{labelText:p}),b=u.series.push(n.new(o,{name:l,valueField:Nt,categoryField:Ge,tooltip:d}));b.ticks.template.set("forceHidden",!0),b.labels.template.set("forceHidden",!0),b.slices.template.states.create("active",{shiftRadius:h}),this._customizeChartTooltip(d),b.slices.template.setAll({ariaLabel:p,focusable:!0,templateField:"columnSettings"}),b.data.setAll(t),b.appear(this._getChartSeriesAnimationMS()),u.appear(this._getChartAnimationMS()),u.root.dom.classList.toggle(ce.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(i=>t=Math.min(i.value,t)),t}async _createColumnChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:n}=await C(()=>import("./chartCommon-98b0365b.js"),["assets/chartCommon-98b0365b.js","assets/Button-5999eab8.js","assets/ColorSet-bb3b0c3c.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/unitFormatUtils-b70a7bff.js","assets/AttachmentInfo-cb670dd0.js","assets/AttachmentQuery-972bbd60.js","assets/widget-78e8b6fe.js","assets/jsonUtils-f73b3833.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/Query-1c961d4c.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/RelationshipQuery-39c07195.js","assets/TopFeaturesQuery-e44d05be.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/popupUtils-82ea8abb.js"]),{CategoryAxisAm5:a,AxisRendererXAm5:o,ValueAxisAm5:l,AxisRendererYAm5:h,ColumnSeriesAm5:f}=await C(()=>import("./xyChart-881759ac.js"),["assets/xyChart-881759ac.js","assets/ColorSet-bb3b0c3c.js","assets/Tick-c7ca49b9.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/Button-5999eab8.js","assets/unitFormatUtils-b70a7bff.js","assets/AttachmentInfo-cb670dd0.js","assets/AttachmentQuery-972bbd60.js","assets/widget-78e8b6fe.js","assets/jsonUtils-f73b3833.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/Query-1c961d4c.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/RelationshipQuery-39c07195.js","assets/TopFeaturesQuery-e44d05be.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/popupUtils-82ea8abb.js"]),{mediaInfo:u,root:p}=t,{value:d,title:b}=u;e.setAll({wheelX:"panX",wheelY:"zoomX"});const c=e.xAxes.push(a.new(p,{renderer:o.new(p,{inversed:this._isInversed()}),categoryField:Ge}));c.get("renderer").labels.template.setAll({forceHidden:!0});const y=e.yAxes.push(l.new(p,{renderer:h.new(p,{inside:!1}),min:this._getMinSeriesValue(d.series)}));y.get("renderer").labels.template.setAll({direction:this._getDirection()});const v="{categoryX}",x=r.new(p,{labelText:v}),w=e.series.push(f.new(p,{name:b,xAxis:c,yAxis:y,valueYField:Nt,categoryXField:Ge,tooltip:x}));this._customizeChartTooltip(x),w.columns.template.setAll({ariaLabel:v,focusable:!0,templateField:"columnSettings"}),d.series.length>ps&&e.set("scrollbarX",n.new(p,{orientation:"horizontal"})),c.data.setAll(i),w.data.setAll(i),w.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:n}=await C(()=>import("./chartCommon-98b0365b.js"),["assets/chartCommon-98b0365b.js","assets/Button-5999eab8.js","assets/ColorSet-bb3b0c3c.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/unitFormatUtils-b70a7bff.js","assets/AttachmentInfo-cb670dd0.js","assets/AttachmentQuery-972bbd60.js","assets/widget-78e8b6fe.js","assets/jsonUtils-f73b3833.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/Query-1c961d4c.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/RelationshipQuery-39c07195.js","assets/TopFeaturesQuery-e44d05be.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/popupUtils-82ea8abb.js"]),{CategoryAxisAm5:a,AxisRendererXAm5:o,ValueAxisAm5:l,AxisRendererYAm5:h,ColumnSeriesAm5:f}=await C(()=>import("./xyChart-881759ac.js"),["assets/xyChart-881759ac.js","assets/ColorSet-bb3b0c3c.js","assets/Tick-c7ca49b9.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/Button-5999eab8.js","assets/unitFormatUtils-b70a7bff.js","assets/AttachmentInfo-cb670dd0.js","assets/AttachmentQuery-972bbd60.js","assets/widget-78e8b6fe.js","assets/jsonUtils-f73b3833.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/Query-1c961d4c.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/RelationshipQuery-39c07195.js","assets/TopFeaturesQuery-e44d05be.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/popupUtils-82ea8abb.js"]),{mediaInfo:u,root:p}=t,{value:d,title:b}=u;e.setAll({wheelX:"panY",wheelY:"zoomY"});const c=e.yAxes.push(a.new(p,{renderer:h.new(p,{inversed:!0}),categoryField:Ge}));c.get("renderer").labels.template.setAll({forceHidden:!0});const y=e.xAxes.push(l.new(p,{renderer:o.new(p,{inside:!1,inversed:this._isInversed()}),min:this._getMinSeriesValue(d.series)}));y.get("renderer").labels.template.setAll({direction:this._getDirection()});const v="{categoryY}",x=r.new(p,{labelText:v}),w=e.series.push(f.new(p,{name:b,xAxis:y,yAxis:c,valueXField:Nt,categoryYField:Ge,tooltip:x}));this._customizeChartTooltip(x,"vertical"),w.columns.template.setAll({ariaLabel:v,focusable:!0,templateField:"columnSettings"}),d.series.length>ps&&e.set("scrollbarY",n.new(p,{orientation:"vertical"})),c.data.setAll(i),w.data.setAll(i),w.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:n}=await C(()=>import("./chartCommon-98b0365b.js"),["assets/chartCommon-98b0365b.js","assets/Button-5999eab8.js","assets/ColorSet-bb3b0c3c.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/unitFormatUtils-b70a7bff.js","assets/AttachmentInfo-cb670dd0.js","assets/AttachmentQuery-972bbd60.js","assets/widget-78e8b6fe.js","assets/jsonUtils-f73b3833.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/Query-1c961d4c.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/RelationshipQuery-39c07195.js","assets/TopFeaturesQuery-e44d05be.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/popupUtils-82ea8abb.js"]),{CategoryAxisAm5:a,AxisRendererXAm5:o,ValueAxisAm5:l,AxisRendererYAm5:h,LineSeriesAm5:f}=await C(()=>import("./xyChart-881759ac.js"),["assets/xyChart-881759ac.js","assets/ColorSet-bb3b0c3c.js","assets/Tick-c7ca49b9.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/Button-5999eab8.js","assets/unitFormatUtils-b70a7bff.js","assets/AttachmentInfo-cb670dd0.js","assets/AttachmentQuery-972bbd60.js","assets/widget-78e8b6fe.js","assets/jsonUtils-f73b3833.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/Query-1c961d4c.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/RelationshipQuery-39c07195.js","assets/TopFeaturesQuery-e44d05be.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/popupUtils-82ea8abb.js"]),{root:u,mediaInfo:p}=t,{value:d,title:b}=p;e.setAll({wheelX:"panX",wheelY:"zoomX"});const c=e.xAxes.push(a.new(u,{renderer:o.new(u,{inversed:this._isInversed()}),categoryField:Ge}));c.get("renderer").labels.template.setAll({forceHidden:!0});const y=e.yAxes.push(l.new(u,{renderer:h.new(u,{inside:!1}),min:this._getMinSeriesValue(d.series)}));y.get("renderer").labels.template.setAll({direction:this._getDirection()});const v="{categoryX}",x=r.new(u,{labelText:v}),w=e.series.push(f.new(u,{name:b,xAxis:c,yAxis:y,valueYField:Nt,categoryXField:Ge,tooltip:x}));this._customizeChartTooltip(x,"vertical"),d.series.length>ps&&e.set("scrollbarX",n.new(u,{orientation:"horizontal"})),c.data.setAll(i),w.data.setAll(i),w.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:r}=await C(()=>import("./xyChart-881759ac.js"),["assets/xyChart-881759ac.js","assets/ColorSet-bb3b0c3c.js","assets/Tick-c7ca49b9.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/Button-5999eab8.js","assets/unitFormatUtils-b70a7bff.js","assets/AttachmentInfo-cb670dd0.js","assets/AttachmentQuery-972bbd60.js","assets/widget-78e8b6fe.js","assets/jsonUtils-f73b3833.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/Query-1c961d4c.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/RelationshipQuery-39c07195.js","assets/TopFeaturesQuery-e44d05be.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/popupUtils-82ea8abb.js"]),{root:n,mediaInfo:a}=e,{type:o}=a,l=(a==null?void 0:a.altText)||(a==null?void 0:a.title)||"",h=n.container.children.push(i.new(n,{ariaLabel:l,focusable:!0,panX:!0,panY:!0}));h.set("cursor",r.new(n,{})),o==="column-chart"&&await this._createColumnChart(h,e,t),o==="bar-chart"&&await this._createBarChart(h,e,t),o==="line-chart"&&await this._createLineChart(h,e,t),h.root.dom.classList.toggle(ce.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e&&e.type==="image"&&e.refreshInterval&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e;if(!t)return;const r=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const n=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},r);this._refreshTimer=n}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[r,n=""]=e.split("#");return`${r}${i}timestamp=${t}${n?"#":""}${n}`}};g([m()],pe.prototype,"_refreshIntervalInfo",void 0),g([m()],pe.prototype,"attributes",null),g([m()],pe.prototype,"activeMediaInfoIndex",null),g([m()],pe.prototype,"description",null),g([m()],pe.prototype,"fieldInfoMap",null),g([m()],pe.prototype,"layer",null),g([m()],pe.prototype,"mediaInfos",null),g([m()],pe.prototype,"popupTemplate",null),g([m()],pe.prototype,"relatedInfos",null),g([m()],pe.prototype,"title",null),g([m({type:dt})],pe.prototype,"viewModel",void 0),g([m(),Te("esri/widgets/Feature/t9n/Feature")],pe.prototype,"messages",void 0),pe=g([X("esri.widgets.Feature.FeatureMedia")],pe);const jn=pe,od=["$datastore","$map","$layer","$aggregatedfeatures"],ld="esri.widgets.Feature.support.arcadeFeatureUtils",hd=Ce.getLogger(ld);function dd(s){return typeof s=="string"?oi($s(s)):Array.isArray(s)?ud(s):(s==null?void 0:s.declaredClass)==="esri.arcade.Dictionary"?cd(s):s}function ud(s){return`
    ${s.map(e=>`
  • ${typeof e=="string"?oi($s(e)):e}
  • `).join("")}
`}function cd(s){return`${s.keys().map(e=>{const t=s.field(e);return``}).join("")}
${e}${typeof t=="string"?oi($s(t)):t}
`}function pd({aggregatedFeatures:s,arcadeUtils:e,featureSetVars:t,context:i,viewInfo:r,map:n,graphic:a,interceptor:o}){t.forEach(l=>{const h=l.toLowerCase(),f=r.sr,u={map:n,spatialReference:f,interceptor:o};if(h==="$map"&&(i.vars[h]=e.convertMapToFeatureSetCollection(u)),h==="$layer"&&(i.vars[h]=e.convertFeatureLayerToFeatureSet({layer:a.sourceLayer,spatialReference:f,interceptor:o})),h==="$datastore"&&(i.vars[h]=e.convertServiceUrlToWorkspace({url:a.sourceLayer.url,spatialReference:f,interceptor:o})),h==="$aggregatedfeatures"){const p=a.layer,{fields:d,objectIdField:b,geometryType:c,spatialReference:y,displayField:v}=p,x=new Ha({fields:d,objectIdField:b,geometryType:c,spatialReference:y,displayField:v,...p.type==="feature"?{templates:p.templates,typeIdField:p.typeIdField,types:p.types}:null,source:s});i.vars[h]=e.convertFeatureLayerToFeatureSet({layer:x,spatialReference:y,interceptor:o})}})}function Nn(){return C(()=>import("./arcadeUtils-b902d678.js").then(s=>s.az),["assets/arcadeUtils-b902d678.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/arcadeTimeUtils-e1438cc8.js","assets/executionError-c92d3b85.js","assets/FieldsIndex-f79a8f26.js","assets/number-e5825aa4.js","assets/hash-6f442295.js"])}function gd(s){return"createQuery"in s&&"queryFeatures"in s}async function fd({graphic:s,view:e}){const{isAggregate:t,layer:i}=s;if(!t||!i||(e==null?void 0:e.type)!=="2d")return[];const r=await e.whenLayerView(i);if(!gd(r))return[];const n=r.createQuery(),a=s.getObjectId();n.aggregateIds=a!=null?[a]:[];const{features:o}=await r.queryFeatures(n);return o}async function Vn({expressionInfo:s,arcadeUtils:e,interceptor:t,spatialReference:i,map:r,graphic:n,view:a}){if(!s||!s.expression)return null;const o=e.createSyntaxTree(s.expression),l=od.filter(d=>e.hasVariable(o,d)),[h]=await Promise.all([fd({graphic:n,view:a}),e.loadScriptDependencies(o,!0,l)]),f=e.getViewInfo({spatialReference:i}),u=e.createExecContext(n,f);u.interceptor=t,u.useAsync=!0,pd({aggregatedFeatures:h,arcadeUtils:e,featureSetVars:l,context:u,viewInfo:f,map:r,graphic:n,interceptor:t});const p=e.createFunction(o,u);return e.executeAsyncFunction(p,u).catch(d=>hd.error("arcade-execution-error",{error:d,graphic:n,expressionInfo:s}))}async function md({expressionInfos:s,spatialReference:e,graphic:t,interceptor:i,map:r,view:n}){if(!s||!s.length)return{};const a=await Nn(),o={};for(const f of s)o[`expression/${f.name}`]=Vn({expressionInfo:f,arcadeUtils:a,interceptor:i,spatialReference:e,map:r,graphic:t,view:n});const l=await _t(o),h={};for(const f in l)h[f]=dd(l[f].value);return h}const _d=1;let ve=class extends Os(vt){constructor(e){super(e),this._abortController=null,this.expressionInfo=null,this.graphic=null,this.contentElement=null,this.contentElementViewModel=null,this.interceptor=null,this.view=null,this._cancelQuery=()=>{const{_abortController:t}=this;t&&t.abort(),this._abortController=null},this._createVM=()=>{var r,n;const t=(r=this.contentElement)==null?void 0:r.type;(n=this.contentElementViewModel)==null||n.destroy();const i=t==="fields"?new Ni:t==="media"?new dt:t==="text"?new Ii:null;this._set("contentElementViewModel",i)},this._compile=async()=>{this._cancelQuery();const t=new AbortController;this._abortController=t,await this._compileExpression(),this._abortController===t&&(this._abortController=null)},this._compileThrottled=Ds(this._compile,_d,this),this._compileExpression=async()=>{const{expressionInfo:t,graphic:i,interceptor:r,spatialReference:n,map:a,view:o,_abortController:l}=this;if(!(t&&i&&n&&a))return void this._set("contentElement",null);const h=await Nn();if(l!==this._abortController)return;const f=await Vn({arcadeUtils:h,expressionInfo:t,graphic:i,interceptor:r,map:a,spatialReference:n,view:o});if(!f||f.declaredClass!=="esri.arcade.Dictionary")return void this._set("contentElement",null);const u=await f.castAsJsonAsync(l==null?void 0:l.signal),p=u==null?void 0:u.type,d=p==="media"?fa.fromJSON(u):p==="text"?Jr.fromJSON(u):p==="fields"?ma.fromJSON(u):null;this._set("contentElement",d)},this.handles.add([F(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference,this.view],()=>this._compileThrottled(),oe),F(()=>[this.contentElement],()=>this._createVM(),oe)])}initialize(){this.addHandles(this._compileThrottled)}destroy(){var e;this._cancelQuery(),(e=this.contentElementViewModel)==null||e.destroy(),this._set("contentElementViewModel",null),this._set("contentElement",null)}get spatialReference(){var e;return((e=this.view)==null?void 0:e.spatialReference)??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{_abortController:e,contentElement:t,contentElementViewModel:i}=this;return e?"loading":t||i?"ready":"disabled"}get map(){var e;return((e=this.view)==null?void 0:e.map)??null}set map(e){this._override("map",e)}};g([m()],ve.prototype,"_abortController",void 0),g([m({type:_a})],ve.prototype,"expressionInfo",void 0),g([m({type:Lt})],ve.prototype,"graphic",void 0),g([m({readOnly:!0})],ve.prototype,"contentElement",void 0),g([m({readOnly:!0})],ve.prototype,"contentElementViewModel",void 0),g([m()],ve.prototype,"interceptor",void 0),g([m()],ve.prototype,"spatialReference",null),g([m({readOnly:!0})],ve.prototype,"state",null),g([m()],ve.prototype,"map",null),g([m()],ve.prototype,"view",void 0),ve=g([X("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],ve);const Ws=ve,mi={iconLoading:"esri-icon-loading-indicator esri-rotating",base:"esri-feature-expression",loadingSpinnerContainer:"esri-feature__loading-container",spinner:"esri-feature__loading-spinner"};let Pi=class extends Be{constructor(e,t){super(e,t),this._contentWidget=null,this.viewModel=new Ws}initialize(){this.addHandles(F(()=>{var e;return(e=this.viewModel)==null?void 0:e.contentElementViewModel},()=>this._setupExpressionWidget(),oe))}destroy(){this._destroyContentWidget()}renderLoading(){return _("div",{key:"loading-container",class:mi.loadingSpinnerContainer},_("span",{class:this.classes(mi.iconLoading,mi.spinner)}))}render(){var t;const{state:e}=this.viewModel;return _("div",{class:mi.base},e==="loading"?this.renderLoading():e==="disabled"?null:(t=this._contentWidget)==null?void 0:t.render())}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,i=t==null?void 0:t.type;this._destroyContentWidget();const r=e?i==="fields"?new bn({viewModel:e}):i==="media"?new jn({viewModel:e}):i==="text"?new bi({viewModel:e}):null:null;this._contentWidget=r,this.scheduleRender()}};g([m({type:Ws})],Pi.prototype,"viewModel",void 0),Pi=g([X("esri.widgets.Feature.FeatureExpression")],Pi);const bd=Pi;function yd(s,e,t){const i=Object.keys(e).filter(a=>ys(s,a)),r=i.map(a=>e[a]),n=i.map(a=>t.get(a)).filter(Li);return wd(s,Hn(r,n))}function Hn(s,e){const t=e.map((i,r)=>{let n=s[r];if(i.domain&&i.domain.type==="coded-value"){const a=i.domain.codedValues.find(o=>o.code===n);a!=null&&a.name&&(n=a.name)}return ba(i)&&(n=vd(i,n)),[i.name,n]});return Object.fromEntries(t)}function vd(s,e){if(!s||e==null)return null;switch(s.type){case"date":return si(e);case"date-only":return qr(e);case"time-only":return Yr(e);case"timestamp-offset":return Ur(e);default:return null}}function wd(s,e){return ft(ft(s,t=>`{${t.toLowerCase()}}`),Object.fromEntries(Object.entries(e).map(([t,i])=>[t.toLowerCase(),i])))}var Er;(function(s){s.TOO_SHORT="length-validation-error::too-short"})(Er||(Er={}));const xd=s=>{var t;const e=[];if(s.formTemplate){const{description:i,title:r}=s.formTemplate;(t=s.fields)==null||t.forEach(n=>{const a=r&&ys(r,n.name),o=i&&ys(i,n.name);(a||o)&&e.push(n.name)})}return e},gs=100;let N=class extends ya(Zr(Os(vt))){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:t}=this;t&&t.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const t=new AbortController;this._queryAbortController=t,await qi(this._query()),this._queryAbortController===t&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await qi(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{const t=new AbortController;this._queryPageAbortController=t,await qi(this._queryPage()),this._queryPageAbortController===t&&(this._queryPageAbortController=null)},this._queryDebounced=Gi(this._queryController,gs),this._queryFeatureCountDebounced=Gi(this._queryFeatureCountController,gs),this._queryPageDebounced=Gi(this._queryPageController,gs),this._query=async()=>{const{_queryAbortController:t,relatedFeatures:i}=this;this.featureCount&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,i.removeAll(),this.destroyed||i.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:t==null?void 0:t.signal}))))},this.handles.add([F(()=>{var t;return[this.displayCount,this.graphic,this.layer,(t=this.layer)==null?void 0:t.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount]},()=>this._queryDebounced(),oe),F(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),F(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery],()=>this._queryFeatureCountDebounced())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.removeAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:i}=this,r=1,n=Math.ceil(i/t)||1;this._set("featurePage",Math.min(Math.max(e,r),n))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&(t!=null&&t.loaded)?e.map(i=>{const r=i.clone();return r.field=ri(i.field,t),r}):e??[]}get supportsCacheHint(){var e,t,i;return!!((i=(t=(e=this.layer)==null?void 0:e.capabilities)==null?void 0:t.queryRelated)!=null&&i.supportsCacheHint)}get canLoad(){return!!this.map&&typeof this.relationshipId=="number"&&typeof this.objectId=="number"}get canQuery(){var t,i;const e=(i=(t=this.layer)==null?void 0:t.capabilities)==null?void 0:i.queryRelated;return!!(this.relatedLayer&&this.relationship&&typeof this.relationshipId=="number"&&typeof this.objectId=="number"&&(e!=null&&e.supportsCount)&&(e!=null&&e.supportsPagination))}get itemDescriptionFieldName(){var e;return((e=this.orderByFieldsFixedCasing[0])==null?void 0:e.field)||null}set displayCount(e){this._set("displayCount",Math.min(Math.max(e,0),10))}get displayCount(){return this._get("displayCount")}get objectId(){var e,t;return(this.objectIdField&&((t=(e=this.graphic)==null?void 0:e.attributes)==null?void 0:t[this.objectIdField]))??null}get objectIdField(){var e;return((e=this.layer)==null?void 0:e.objectIdField)||null}get relatedFeatures(){return this._get("relatedFeatures")||new Ze}get relatedFeatureInfos(){const{itemDescriptionFieldName:e,relatedFeatures:t,relatedLayer:i}=this;if(!t.length||!i)return[];const r=i&&"formTemplate"in i&&i.formTemplate,n=r&&(r==null?void 0:r.title)||void 0;return t.map(a=>{let o;if(e){const l=a.getAttribute(e),h=i.fieldsIndex.get(e);if(h){const f=Hn([l],[h])[e];f!=null&&(o=f.toString())}}return{feature:a,description:o,title:n?yd(n,a.attributes,i.fieldsIndex):void 0}}).toArray()}get relatedLayer(){const{layer:e,map:t,relationship:i}=this;return e!=null&&e.loaded&&t&&i?Mo(t,e,i)??null:null}get relationship(){var i;const{relationshipId:e,layer:t}=this;return typeof e=="number"?((i=t==null?void 0:t.relationships)==null?void 0:i.find(({id:r})=>r===e))??null:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new Ze}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:i,canQuery:r,_loaded:n,canLoad:a}=this;return t||a&&!n?"loading":e||i?"querying":r?"ready":"disabled"}getRelatedFeatureByObjectId(e){return this.relatedFeatures.find(t=>t.getObjectId()===e)}_destroyRelatedFeatureViewModels(){var e;(e=this.relatedFeatureViewModels)==null||e.forEach(t=>!t.destroyed&&t.destroy()),this.relatedFeatureViewModels.removeAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:t,relationshipId:i,objectId:r,_queryFeatureCountAbortController:n,canQuery:a,supportsCacheHint:o}=this;if(await(e==null?void 0:e.load()),await(t==null?void 0:t.load()),!a||!e||!t)return void this._set("featureCount",0);const l=t.createQuery(),h=new vs({cacheHint:o,relationshipId:i,returnGeometry:!1,objectIds:[r],where:l.where??void 0}),f=await e.queryRelatedFeaturesCount(h,{signal:n==null?void 0:n.signal});this._set("featureCount",f[r]||0)}_sliceFeatures(e){const{showAllEnabled:t,displayCount:i}=this;return t?e:i?e.slice(0,i):[]}async _queryPage(){const{relatedFeatures:e,featurePage:t,showAllEnabled:i,_queryPageAbortController:r,featureCount:n}=this;!i||t<2||!n||e.addMany(await this._queryRelatedFeatures({signal:r==null?void 0:r.signal}))}async _queryRelatedFeatures(e){var S;const{orderByFieldsFixedCasing:t,showAllEnabled:i,featuresPerPage:r,displayCount:n,layer:a,relationshipId:o,featurePage:l,featureCount:h,relatedLayer:f,supportsCacheHint:u}=this,{canQuery:p,objectId:d}=this;if(!p||!a||!f)return[];const b=i?((l-1)*r+h)%h:0,c=i?r:n,y=f.objectIdField,v=[...t.map(L=>L.field),...xd(f),y].filter(Li),x=t.map(L=>`${L.field} ${L.order}`),w=f.createQuery(),P=new vs({orderByFields:x,start:b,num:c,outFields:v,cacheHint:u,relationshipId:o,returnGeometry:!1,objectIds:[d],where:w.where??void 0}),O=await a.queryRelatedFeatures(P,{signal:e==null?void 0:e.signal}),R=((S=O[d])==null?void 0:S.features)||[];return R.forEach(L=>{L.sourceLayer=f,L.layer=f}),R}};g([m()],N.prototype,"_loaded",void 0),g([m()],N.prototype,"_queryAbortController",void 0),g([m()],N.prototype,"_queryPageAbortController",void 0),g([m()],N.prototype,"_queryFeatureCountAbortController",void 0),g([m({value:1})],N.prototype,"featurePage",null),g([m()],N.prototype,"featuresPerPage",void 0),g([m({readOnly:!0})],N.prototype,"orderByFieldsFixedCasing",null),g([m({readOnly:!0})],N.prototype,"supportsCacheHint",null),g([m({readOnly:!0})],N.prototype,"canLoad",null),g([m({readOnly:!0})],N.prototype,"canQuery",null),g([m()],N.prototype,"description",void 0),g([m({readOnly:!0})],N.prototype,"itemDescriptionFieldName",null),g([m({value:3})],N.prototype,"displayCount",null),g([m({type:Lt})],N.prototype,"graphic",void 0),g([m()],N.prototype,"layer",void 0),g([m()],N.prototype,"map",void 0),g([m({readOnly:!0})],N.prototype,"objectId",null),g([m({readOnly:!0})],N.prototype,"objectIdField",null),g([m()],N.prototype,"orderByFields",void 0),g([m({readOnly:!0})],N.prototype,"relatedFeatures",null),g([m({readOnly:!0})],N.prototype,"relatedFeatureInfos",null),g([m({readOnly:!0})],N.prototype,"relatedLayer",null),g([m({readOnly:!0})],N.prototype,"relationship",null),g([m()],N.prototype,"featureCount",void 0),g([m({readOnly:!0})],N.prototype,"relatedFeatureViewModels",null),g([m()],N.prototype,"relationshipId",void 0),g([m()],N.prototype,"showAllEnabled",void 0),g([m()],N.prototype,"state",null),g([m()],N.prototype,"title",void 0),g([m()],N.prototype,"getRelatedFeatureByObjectId",null),N=g([X("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],N);const Us=N,qt="esri-feature",Vt=`${qt}-relationship`,Oe={base:Vt,esriWidget:"esri-widget",listContainer:`${Vt}__list`,listItem:`${Vt}__list-item`,listItemHidden:`${Vt}__list-item--hidden`,listContainerQuerying:`${Vt}__list--querying`,featureObserver:`${qt}__feature-observer`,stickySpinnerContainer:`${qt}__sticky-loading-container`,loadingSpinnerContainer:`${qt}__loading-container`,spinner:`${qt}__loading-spinner`,iconLoading:"esri-icon-loading-indicator esri-rotating"},Ir={title:!0,description:!0};let ge=class extends Be{constructor(s,e){super(s,e),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([t])=>{t!=null&&t.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.headingLevel=2,this.viewModel=new Us,this.messages=null,this.messagesCommon=null,this.visibleElements={...Ir},this._increaseFeaturePage=()=>{const{state:t,showAllEnabled:i,relatedFeatures:r,featuresPerPage:n,featurePage:a}=this.viewModel;t==="ready"&&i&&r.length>=n*a&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new ji,this.addHandles([F(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),oe),F(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),et(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return ai({icon:()=>C(()=>import("./calcite-icon-2c0948c4.js"),["assets/calcite-icon-2c0948c4.js","assets/icon-25aef281.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/observers-4ce6e1b4.js"]),list:()=>C(()=>import("./calcite-list-9839fae2.js"),["assets/calcite-list-9839fae2.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/loader-2996ba2a.js","assets/guid-114f0fc6.js","assets/observers-4ce6e1b4.js","assets/utils3-4f0533d1.js","assets/loadable-759e1c0c.js","assets/debounce-14ebcd9e.js","assets/t9n-537805d4.js","assets/icon-25aef281.js","assets/scrim-ffa718f9.js"]),"list-item":()=>C(()=>import("./calcite-list-item-d9ff27a1.js"),["assets/calcite-list-item-d9ff27a1.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/loader-2996ba2a.js","assets/guid-114f0fc6.js","assets/utils3-4f0533d1.js","assets/t9n-537805d4.js","assets/observers-4ce6e1b4.js","assets/loadable-759e1c0c.js","assets/action-0a339dee.js","assets/icon-25aef281.js"]),notice:()=>C(()=>import("./calcite-notice-1e5c2a0f.js"),["assets/calcite-notice-1e5c2a0f.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/observers-4ce6e1b4.js","assets/loadable-759e1c0c.js","assets/t9n-537805d4.js","assets/icon-25aef281.js"])})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=en(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:s,featureCount:e,displayCount:t,state:i}=this.viewModel;return!s&&!!e&&i==="ready"&&(e>t||t===0)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(s){this.viewModel.description=s}get featureCountDescription(){const{messages:s}=this,{featureCount:e}=this.viewModel;return Fe(s==null?void 0:s.numberRecords,{number:e})}get title(){return this.viewModel.title}set title(s){this.viewModel.title=s}castVisibleElements(s){return{...Ir,...s}}renderStickyLoading(){return this.viewModel.state==="querying"?_("div",{key:"sticky-loader",class:Oe.stickySpinnerContainer},this.renderLoadingIcon()):null}renderLoadingIcon(){return _("span",{class:this.classes(Oe.iconLoading,Oe.spinner)})}renderLoading(){return _("div",{key:"loading-container",class:Oe.loadingSpinnerContainer},this.renderLoadingIcon())}renderShowAllIconNode(){return _("calcite-icon",{scale:"s",icon:"list",slot:"content-end"})}renderChevronIconNode(){const s=mt(this.container)?"chevron-left":"chevron-right";return _("calcite-icon",{scale:"s",icon:s,slot:"content-end"})}renderRelatedFeature(s){var r;const{itemDescriptionFieldName:e}=this.viewModel,t=s.title;s.description=e&&((r=s.formattedAttributes)==null?void 0:r.global[e]);const i=s.state==="loading";return _("calcite-list-item",{class:this.classes(Oe.listItem,{[Oe.listItemHidden]:i}),key:s.uid,label:t,description:s.description??"",onCalciteListItemSelect:()=>this.emit("select-record",{featureViewModel:s})},this.renderChevronIconNode())}renderShowAllListItem(){var s;return this.displayShowAllButton?_("calcite-list-item",{key:"show-all-item",label:(s=this.messages)==null?void 0:s.showAll,description:this.featureCountDescription,onCalciteListItemSelect:()=>this.emit("show-all-records")},this.renderShowAllIconNode()):null}renderNoRelatedFeaturesMessage(){var s;return _("calcite-notice",{key:"no-related-features-message",icon:"information",open:!0,kind:"brand",scale:"s",width:"full"},_("div",{slot:"message"},(s=this.messages)==null?void 0:s.noRelatedFeatures))}renderFeatureObserver(){return _("div",{key:"feature-observer",class:Oe.featureObserver,bind:this,afterCreate:this._relatedFeatureIntersectionObserverCreated})}renderList(){const{relatedFeatureViewModels:s}=this.viewModel;return _("calcite-list",null,s.toArray().map(e=>this.renderRelatedFeature(e)),this.renderShowAllListItem())}renderRelatedFeatures(){const{displayListItems:s}=this,{state:e}=this.viewModel;return _("div",{key:"list-container",class:this.classes(Oe.listContainer,{[Oe.listContainerQuerying]:e==="querying"})},s?this.renderList():e==="ready"?this.renderNoRelatedFeaturesMessage():null,this.renderStickyLoading(),this.renderFeatureObserver())}renderRelationshipNotFound(){var s;return _("calcite-notice",{key:"relationship-not-found",icon:"exclamation-mark-triangle",open:!0,kind:"danger",scale:"s",width:"full"},_("div",{slot:"message"},(s=this.messages)==null?void 0:s.relationshipNotFound))}render(){var e;const{state:s}=this.viewModel;return _("div",{class:this.classes(Oe.base,Oe.esriWidget)},(e=this._featureElementInfo)==null?void 0:e.render(),s==="loading"?this.renderLoading():s==="disabled"?this.renderRelationshipNotFound():this.renderRelatedFeatures())}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:s}=this.viewModel,e="related-feature-viewmodels";this.removeHandles(e),s==null||s.forEach(t=>{this.addHandles(F(()=>[t.title,t.state],()=>this.scheduleRender(),oe),e)}),this.scheduleRender()}_setupFeatureElementInfo(){var r;const{headingLevel:s,visibleElements:e}=this,t=e.description&&this.description,i=e.title&&this.title;(r=this._featureElementInfo)==null||r.set({description:t,title:i,headingLevel:s})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:s,showAllEnabled:e}=this.viewModel;await tn(0),this._relatedFeatureIntersectionObserverNode&&s==="ready"&&e&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(s){this._relatedFeatureIntersectionObserverNode=s}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};g([m()],ge.prototype,"_relatedFeatureIntersectionObserverNode",void 0),g([m({readOnly:!0})],ge.prototype,"displayShowAllButton",null),g([m({readOnly:!0})],ge.prototype,"displayListItems",null),g([m()],ge.prototype,"description",null),g([m({readOnly:!0})],ge.prototype,"featureCountDescription",null),g([m()],ge.prototype,"headingLevel",void 0),g([m()],ge.prototype,"title",null),g([m({type:Us})],ge.prototype,"viewModel",void 0),g([m(),Te("esri/widgets/Feature/t9n/Feature")],ge.prototype,"messages",void 0),g([m(),Te("esri/t9n/common")],ge.prototype,"messagesCommon",void 0),g([m()],ge.prototype,"visibleElements",void 0),g([yt("visibleElements")],ge.prototype,"castVisibleElements",null),ge=g([X("esri.widgets.Feature.FeatureRelationship")],ge);const Or=ge;let Md=class{constructor(e,t){this.preLayerQueryCallback=e,this.preRequestCallback=t,this.preLayerQueryCallback||(this.preLayerQueryCallback=i=>{}),this.preRequestCallback||(this.preLayerQueryCallback=i=>{})}};var Gt;const Pd=1,Dr="content-view-models",Fr="relationship-view-models",Sr={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0};let W=Gt=class extends Zr(vt){constructor(s){super(s),this._handles=new Bi,this._error=null,this._featureAbortController=null,this._graphicChangedThrottled=Ds(this._graphicChanged,Pd,this),this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...Sr},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.relatedInfos=new Map,this.title="",this.view=null,this._isAllowedContentType=e=>{const{abilities:t}=this;return e.type==="attachments"&&!!t.attachmentsContent||e.type==="custom"&&!!t.customContent||e.type==="fields"&&!!t.fieldsContent||e.type==="media"&&!!t.mediaContent||e.type==="text"&&!!t.textContent||e.type==="expression"&&!!t.expressionContent||e.type==="relationship"&&!!t.relationshipContent},this._handles.add(F(()=>[this.graphic,this._effectivePopupTemplate,this.abilities],()=>this._graphicChangedThrottled(),oe))}initialize(){this.addHandles(this._graphicChangedThrottled)}destroy(){this._clear(),this._cancelFeatureQuery(),this._error=null,this._handles.destroy(),this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return this.graphic!=null?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return mo(rr(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return ln(this.graphic)}castAbilities(s){return{...Sr,...s}}get isTable(){var s;return((s=this._sourceLayer)==null?void 0:s.isTable)||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(s){this._set("graphic",s?s.clone():null)}get spatialReference(){var s;return((s=this.view)==null?void 0:s.spatialReference)??null}set spatialReference(s){this._override("spatialReference",s)}get map(){var s;return((s=this.view)==null?void 0:s.map)||null}set map(s){this._override("map",s)}get waitingForContent(){return!!this._featureAbortController}setActiveMedia(s,e){const t=this.contentViewModels[s];t instanceof dt&&t.setActiveMedia(e)}nextMedia(s){const e=this.contentViewModels[s];e instanceof dt&&e.next()}previousMedia(s){const e=this.contentViewModels[s];e instanceof dt&&e.previous()}async updateGeometry(){var a;const{graphic:s,spatialReference:e,_sourceLayer:t}=this;await(t==null?void 0:t.load());const i=t==null?void 0:t.objectIdField;if(!i||!s||!t)return;const r=(a=s==null?void 0:s.attributes)==null?void 0:a[i];if(r==null)return;const n=[r];if(!s.geometry){const o=await fn({layer:t,graphic:s,outFields:[],objectIds:n,returnGeometry:!0,spatialReference:e}),l=o==null?void 0:o.geometry;l&&(s.geometry=l)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}async _graphicChanged(){this._cancelFeatureQuery(),this._error=null,this._clear();const{graphic:s}=this;if(!s)return;const e=new AbortController;this._featureAbortController=e;try{await this._queryFeature({signal:e.signal})}catch(t){va(t)||(this._error=t,Ce.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:t,graphic:s,popupTemplate:this._effectivePopupTemplate}))}this._featureAbortController===e&&(this._featureAbortController=null)}_cancelFeatureQuery(){const{_featureAbortController:s}=this;s&&s.abort(),this._featureAbortController=null}_compileContentElement(s,e){return s.type==="attachments"?this._compileAttachments(s,e):s.type==="custom"?this._compileCustom(s,e):s.type==="fields"?this._compileFields(s,e):s.type==="media"?this._compileMedia(s,e):s.type==="text"?this._compileText(s,e):s.type==="expression"?this._compileExpression(s,e):s.type==="relationship"?this._compileRelationship(s,e):void 0}_compileContent(s){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(s)?s.filter(this._isAllowedContentType).map((e,t)=>this._compileContentElement(e,t)).filter(Li):typeof s=="string"?this._compileText(new Jr({text:s}),0).text:s}_destroyContentViewModels(){var s,e;(s=this._handles)==null||s.remove(Fr),(e=this._handles)==null||e.remove(Dr),this.contentViewModels.forEach(t=>t&&!t.destroyed&&t.destroy()),this._set("contentViewModels",[])}_matchesFeature(s,e){var r;const t=(r=s==null?void 0:s.graphic)==null?void 0:r.getObjectId(),i=e==null?void 0:e.getObjectId();return t!=null&&i!=null&&t===i}_setRelatedFeaturesViewModels({relatedFeatureViewModels:s,relatedFeatures:e,map:t}){const{view:i,spatialReference:r}=this;e==null||e.filter(Boolean).forEach(n=>{s.find(a=>this._matchesFeature(a,n))||s.add(new Gt({abilities:{relationshipContent:!1},map:t,view:i,spatialReference:r,graphic:n}))}),s.forEach(n=>{(e==null?void 0:e.find(o=>this._matchesFeature(n,o)))||s.remove(n)})}_setExpressionContentVM(s,e){const t=this.formattedAttributes,{contentElement:i,contentElementViewModel:r}=s,n=i==null?void 0:i.type;r&&n&&(n==="fields"&&(this._createFieldsFormattedAttributes({contentElement:i,contentElementIndex:e,formattedAttributes:t}),r.set(this._createFieldsVMParams(i,e))),n==="media"&&(this._createMediaFormattedAttributes({contentElement:i,contentElementIndex:e,formattedAttributes:t}),r.set(this._createMediaVMParams(i,e))),n==="text"&&r.set(this._createTextVMParams(i)))}_compileRelationship(s,e){const{displayCount:t,orderByFields:i,relationshipId:r,title:n,description:a}=s,{_sourceLayer:o,graphic:l,map:h}=this;if(!cn(o))return;const f=new Us({displayCount:t,graphic:l,orderByFields:i,relationshipId:r,layer:o,map:h,...this._compileTitleAndDesc({title:n,description:a})});return this.contentViewModels[e]=f,this._handles.add(et(()=>f.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(f)),Fr),s}_compileExpression(s,e){const{expressionInfo:t}=s,{graphic:i,map:r,spatialReference:n,view:a}=this,o=new Ws({expressionInfo:t,graphic:i,interceptor:Gt.interceptor,map:r,spatialReference:n,view:a});return this.contentViewModels[e]=o,this._handles.add(F(()=>o.contentElementViewModel,()=>this._setExpressionContentVM(o,e),oe),Dr),s}_compileAttachments(s,e){const{graphic:t}=this,{description:i,title:r}=s;return this.contentViewModels[e]=new Bs({graphic:t,...this._compileTitleAndDesc({title:r,description:i})}),s}_compileCustom(s,e){const{graphic:t}=this,{creator:i,destroyer:r}=s;return this.contentViewModels[e]=new Ii({graphic:t,creator:i,destroyer:r}),s}_compileTitleAndDesc({title:s,description:e}){const{_fieldInfoMap:t,_sourceLayer:i,graphic:r,formattedAttributes:n}=this,a=r==null?void 0:r.attributes,o=this._expressionAttributes,l=n.global;return{title:ht({attributes:a,fieldInfoMap:t,globalAttributes:l,expressionAttributes:o,layer:i,text:s}),description:ht({attributes:a,fieldInfoMap:t,globalAttributes:l,expressionAttributes:o,layer:i,text:e})}}_createFieldsVMParams(s,e){const t=this._effectivePopupTemplate,i=this.formattedAttributes,r={...i==null?void 0:i.global,...i==null?void 0:i.content[e]},n=(s==null?void 0:s.fieldInfos)||(t==null?void 0:t.fieldInfos),a=n==null?void 0:n.filter(({fieldName:f})=>Fs(f)||Ve(f)||r.hasOwnProperty(f)),o=t==null?void 0:t.expressionInfos,{description:l,title:h}=s;return{attributes:r,expressionInfos:o,fieldInfos:a,...this._compileTitleAndDesc({title:h,description:l})}}_compileFields(s,e){const t=s.clone(),i=new Ni(this._createFieldsVMParams(s,e));return this.contentViewModels[e]=i,t.fieldInfos=i.formattedFieldInfos.slice(0),t}_createMediaVMParams(s,e){const{abilities:t,graphic:i,_fieldInfoMap:r,_effectivePopupTemplate:n,relatedInfos:a,_sourceLayer:o,_expressionAttributes:l}=this,h=this.formattedAttributes,f=(i==null?void 0:i.attributes)??{},{description:u,mediaInfos:p,title:d}=s;return{abilities:{chartAnimation:t.chartAnimation},activeMediaInfoIndex:s.activeMediaInfoIndex||0,attributes:f,isAggregate:i==null?void 0:i.isAggregate,layer:o,fieldInfoMap:r,formattedAttributes:{...h==null?void 0:h.global,...h==null?void 0:h.content[e]},expressionAttributes:l,mediaInfos:p,popupTemplate:n,relatedInfos:a,...this._compileTitleAndDesc({title:d,description:u})}}_compileMedia(s,e){const t=s.clone(),i=new dt(this._createMediaVMParams(s,e));return t.mediaInfos=i.formattedMediaInfos.slice(0),this.contentViewModels[e]=i,t}_createTextVMParams(s){var n;const{graphic:e,_fieldInfoMap:t,_sourceLayer:i,_expressionAttributes:r}=this;if(s&&s.text){const a=(e==null?void 0:e.attributes)??{},o=((n=this.formattedAttributes)==null?void 0:n.global)??{};s.text=ht({attributes:a,fieldInfoMap:t,globalAttributes:o,expressionAttributes:r,layer:i,text:s.text})}return{graphic:e,creator:s.text}}_compileText(s,e){const t=s.clone();return this.contentViewModels[e]=new Ii(this._createTextVMParams(t)),t}_compileLastEditInfo(){const{_effectivePopupTemplate:s,_sourceLayer:e,graphic:t}=this;if(!s)return;const{lastEditInfoEnabled:i}=s,r=e==null?void 0:e.editFieldsInfo;return i&&r?fo(r,t==null?void 0:t.attributes):void 0}_compileTitle(s){var o;const{_fieldInfoMap:e,_sourceLayer:t,graphic:i,_expressionAttributes:r}=this,n=(i==null?void 0:i.attributes)??{},a=((o=this.formattedAttributes)==null?void 0:o.global)??{};return ht({attributes:n,fieldInfoMap:e,globalAttributes:a,expressionAttributes:r,layer:t,text:s})}async _getTitle(){const{_effectivePopupTemplate:s,graphic:e}=this;if(!e)return null;const t=s==null?void 0:s.title;return Ei(t,{graphic:e})}async _getContent(){const{_effectivePopupTemplate:s,graphic:e}=this;if(!e)return null;const t=s==null?void 0:s.content;return Ei(t,{graphic:e})}async _queryFeature(s){const{_featureAbortController:e,_sourceLayer:t,graphic:i,_effectivePopupTemplate:r}=this,n=this.map,a=this.view,o=this.spatialReference;if(e!==this._featureAbortController||!i)return;await bo({graphic:i,popupTemplate:r,layer:t,spatialReference:o},s);const{content:{value:l},title:{value:h}}=await _t({content:this._getContent(),title:this._getTitle()}),{expressionAttributes:{value:f}}=await _t({checkForRelatedFeatures:this._checkForRelatedFeatures(s),expressionAttributes:md({expressionInfos:r==null?void 0:r.expressionInfos,spatialReference:o,graphic:i,map:n,interceptor:Gt.interceptor,view:a})});e===this._featureAbortController&&i&&(this._expressionAttributes=f,this._graphicExpressionAttributes={...i.attributes,...f},this._set("formattedAttributes",this._createFormattedAttributes(l)),this._set("title",this._compileTitle(h)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(l)||null))}_createMediaFormattedAttributes({contentElement:s,contentElementIndex:e,formattedAttributes:t}){const{_effectivePopupTemplate:i,graphic:r,relatedInfos:n,_sourceLayer:a,_fieldInfoMap:o,_graphicExpressionAttributes:l}=this;t.content[e]=Ji({fieldInfos:i==null?void 0:i.fieldInfos,graphic:r,attributes:{...l,...s.attributes},layer:a,fieldInfoMap:o,relatedInfos:n})}_createFieldsFormattedAttributes({contentElement:s,contentElementIndex:e,formattedAttributes:t}){if(s.fieldInfos){const{graphic:i,relatedInfos:r,_sourceLayer:n,_fieldInfoMap:a,_graphicExpressionAttributes:o}=this;t.content[e]=Ji({fieldInfos:s.fieldInfos,graphic:i,attributes:{...o,...s.attributes},layer:n,fieldInfoMap:a,relatedInfos:r})}}_createFormattedAttributes(s){const{_effectivePopupTemplate:e,graphic:t,relatedInfos:i,_sourceLayer:r,_fieldInfoMap:n,_graphicExpressionAttributes:a}=this,o=e==null?void 0:e.fieldInfos,l={global:Ji({fieldInfos:o,graphic:t,attributes:a,layer:r,fieldInfoMap:n,relatedInfos:i}),content:[]};return Array.isArray(s)&&s.forEach((h,f)=>{h.type==="fields"&&this._createFieldsFormattedAttributes({contentElement:h,contentElementIndex:f,formattedAttributes:l}),h.type==="media"&&this._createMediaFormattedAttributes({contentElement:h,contentElementIndex:f,formattedAttributes:l})}),l}_checkForRelatedFeatures(s){const{graphic:e,_effectivePopupTemplate:t}=this;return this._queryRelatedInfos(e,rr(t),s)}async _queryRelatedInfos(s,e,t){const{relatedInfos:i,_sourceLayer:r}=this;i.clear();const n=(r==null?void 0:r.associatedLayer)!=null?await(r==null?void 0:r.associatedLayer.load(t)):r;if(!n||!s)return;const a=e.filter(h=>h&&Ve(h.fieldName));if(!a||!a.length)return;e.forEach(h=>this._configureRelatedInfo(h,n));const o=await il({relatedInfos:i,layer:n},t);Object.keys(o).forEach(h=>{var p;const f=i.get(h.toString()),u=(p=o[h])==null?void 0:p.value;f&&u&&(f.layerInfo=u.data)});const l=await sl({graphic:s,relatedInfos:i,layer:n},t);Object.keys(l).forEach(h=>{var f;Qo((f=l[h])==null?void 0:f.value,i.get(h.toString()))})}_configureRelatedInfo(s,e){const{relatedInfos:t}=this,i=yi(s.fieldName);if(!i)return;const{layerId:r,fieldName:n}=i;if(!r)return;const a=t.get(r.toString())||Xo(r,e);a&&(rl({relatedInfo:a,fieldName:n,fieldInfo:s}),this.relatedInfos.set(r,a))}};W.interceptor=new Md(wo,xo),g([m()],W.prototype,"_error",void 0),g([m()],W.prototype,"_featureAbortController",void 0),g([m({readOnly:!0})],W.prototype,"_effectivePopupTemplate",null),g([m({readOnly:!0})],W.prototype,"_fieldInfoMap",null),g([m({readOnly:!0})],W.prototype,"_sourceLayer",null),g([m()],W.prototype,"abilities",void 0),g([yt("abilities")],W.prototype,"castAbilities",null),g([m({readOnly:!0})],W.prototype,"content",void 0),g([m({readOnly:!0})],W.prototype,"contentViewModels",void 0),g([m()],W.prototype,"description",void 0),g([m({type:Boolean})],W.prototype,"defaultPopupTemplateEnabled",void 0),g([m({readOnly:!0})],W.prototype,"isTable",null),g([m({readOnly:!0})],W.prototype,"state",null),g([m({readOnly:!0})],W.prototype,"formattedAttributes",void 0),g([m({type:Lt,value:null})],W.prototype,"graphic",null),g([m({readOnly:!0})],W.prototype,"lastEditInfo",void 0),g([m({readOnly:!0})],W.prototype,"relatedInfos",void 0),g([m()],W.prototype,"spatialReference",null),g([m({readOnly:!0})],W.prototype,"title",void 0),g([m()],W.prototype,"map",null),g([m({readOnly:!0})],W.prototype,"waitingForContent",null),g([m()],W.prototype,"view",void 0),W=Gt=g([X("esri.widgets.FeatureViewModel")],W);const Ys=W,he="esri-feature",q={iconText:"esri-icon-font-fallback-text",iconLoading:"esri-icon-loading-indicator esri-rotating",esriTable:"esri-widget__table",esriWidget:"esri-widget",base:he,container:`${he}__size-container`,title:`${he}__title`,main:`${he}__main-container`,btn:`${he}__button`,icon:`${he}__icon`,content:`${he}__content`,contentNode:`${he}__content-node`,contentElement:`${he}__content-element`,text:`${he}__text`,lastEditedInfo:`${he}__last-edited-info`,fields:`${he}__fields`,fieldHeader:`${he}__field-header`,fieldData:`${he}__field-data`,fieldDataDate:`${he}__field-data--date`,loadingSpinnerContainer:`${he}__loading-container`,spinner:`${he}__loading-spinner`},zn=s=>{let e=class extends s{constructor(){super(...arguments),this.renderNodeContent=t=>nn(t)&&!t.destroyed?_("div",{class:q.contentNode,key:t},t.render()):t instanceof HTMLElement?_("div",{class:q.contentNode,key:t,bind:t,afterCreate:this._attachToNode}):ja(t)?_("div",{class:q.contentNode,key:t,bind:t.domNode,afterCreate:this._attachToNode}):null}_attachToNode(t){const i=this;t.appendChild(i)}};return e=g([X("esri.widgets.Feature.ContentMixin")],e),e};var Is;const $r={title:!0,content:!0,lastEditedInfo:!0},Lr="relationship-handles";let re=Is=class extends zn(Be){constructor(s,e){super(s,e),this._contentWidgets=[],this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesURIUtils=null,this.visibleElements={...$r},this.viewModel=new Ys}initialize(){this.addHandles(F(()=>{var s;return(s=this.viewModel)==null?void 0:s.contentViewModels},()=>this._setupContentWidgets(),oe))}loadDependencies(){return ai({notice:()=>C(()=>import("./calcite-notice-1e5c2a0f.js"),["assets/calcite-notice-1e5c2a0f.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/observers-4ce6e1b4.js","assets/loadable-759e1c0c.js","assets/t9n-537805d4.js","assets/icon-25aef281.js"])})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(s){this.viewModel.graphic=s}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(s){this.viewModel.defaultPopupTemplateEnabled=s}get isTable(){return this.viewModel.isTable}get label(){var s;return((s=this.messages)==null?void 0:s.widgetLabel)??""}set label(s){this._overrideIfSome("label",s)}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(s){this.viewModel.spatialReference=s}get title(){return this.viewModel.title}castVisibleElements(s){return{...$r,...s}}get map(){return this.viewModel.map}set map(s){this.viewModel.map=s}get view(){return this.viewModel.view}set view(s){this.viewModel.view=s}render(){const{state:s}=this.viewModel,e=_("div",{class:q.container,key:"container"},this.renderTitle(),s==="error"?this.renderError():s==="loading"?this.renderLoading():this.renderContentContainer());return _("div",{class:this.classes(q.base,q.esriWidget)},e)}setActiveMedia(s,e){return this.viewModel.setActiveMedia(s,e)}nextMedia(s){return this.viewModel.nextMedia(s)}previousMedia(s){return this.viewModel.previousMedia(s)}renderError(){const{messagesCommon:s,messages:e,visibleElements:t}=this;return _("calcite-notice",{open:!0,kind:"danger",icon:"exclamation-mark-circle",scale:"s"},t.title?_("div",{key:"error-title",slot:"title"},s.errorMessage):null,_("div",{key:"error-message",slot:"message"},e.loadingError))}renderLoading(){return _("div",{key:"loading-container",class:q.loadingSpinnerContainer},_("span",{class:this.classes(q.iconLoading,q.spinner)}))}renderContentContainer(){const{visibleElements:s}=this;return s.content?_("div",{class:q.main},[this.renderContent(),this.renderLastEditInfo()]):null}renderTitle(){const{visibleElements:s,title:e}=this;return s.title?_(Rs,{level:this.headingLevel,class:q.title,innerHTML:e}):null}renderContent(){const s=this.viewModel.content,e="content";if(!s)return null;if(Array.isArray(s))return s.length?_("div",{class:q.contentNode,key:`${e}-content-elements`},s.map(this.renderContentElement,this)):null;if(typeof s=="string"){const t=this._contentWidgets[0];return!t||t.destroyed?null:_("div",{class:q.contentNode,key:`${e}-content`},t.render())}return this.renderNodeContent(s)}renderContentElement(s,e){var i;const{visibleElements:t}=this;if(typeof t.content!="boolean"&&!((i=t.content)!=null&&i[s.type]))return null;switch(s.type){case"attachments":return this.renderAttachments(e);case"custom":return this.renderCustom(s,e);case"fields":return this.renderFields(e);case"media":return this.renderMedia(e);case"text":return this.renderText(s,e);case"expression":return this.renderExpression(e);case"relationship":return this.renderRelationship(e);default:return null}}renderAttachments(s){const e=this._contentWidgets[s];if(!e||e.destroyed)return null;const{state:t,attachmentInfos:i}=e.viewModel;return t==="loading"||i.length>0?_("div",{key:this._buildKey("attachments-element",s),class:this.classes(q.contentElement)},e.render()):null}renderRelationship(s){const e=this._contentWidgets[s];return e&&!e.destroyed&&this.flowItems?_("div",{key:this._buildKey("relationship-element",s),class:q.contentElement},e.render()):null}renderExpression(s){const e=this._contentWidgets[s];return!e||e.destroyed?null:_("div",{key:this._buildKey("expression-element",s),class:q.contentElement},e.render())}renderCustom(s,e){const{creator:t}=s,i=this._contentWidgets[e];return!i||i.destroyed?null:t?_("div",{key:this._buildKey("custom-element",e),class:q.contentElement},i.render()):null}renderFields(s){const e=this._contentWidgets[s];return!e||e.destroyed?null:_("div",{key:this._buildKey("fields-element",s),class:q.contentElement},e.render())}renderMedia(s){const e=this._contentWidgets[s];return!e||e.destroyed?null:_("div",{key:this._buildKey("media-element",s),class:q.contentElement},e.render())}renderLastEditInfo(){const{visibleElements:s,messages:e}=this,{lastEditInfo:t}=this.viewModel;if(!t||!s.lastEditedInfo)return null;const{date:i,user:r}=t,n=t.type==="edit"?r?e.lastEditedByUser:e.lastEdited:r?e.lastCreatedByUser:e.lastCreated,a=Fe(n,{date:i,user:r});return _("div",{key:"edit-info-element",class:this.classes(q.lastEditedInfo,q.contentElement)},a)}renderText(s,e){const t=s.text,i=this._contentWidgets[e];return!i||i.destroyed?null:t?_("div",{key:this._buildKey("text-element",e),class:this.classes(q.contentElement,q.text)},i.render()):null}_buildKey(s,...e){return`${s}__${this.get("viewModel.graphic.uid")||"0"}-${e.join("-")}`}_destroyContentWidget(s){s&&(s.viewModel=null,!s.destroyed&&s.destroy())}_destroyContentWidgets(){this.removeHandles(Lr),this._contentWidgets.forEach(s=>this._destroyContentWidget(s)),this._contentWidgets=[]}_addFeatureRelationshipHandles(s){const{flowItems:e,visibleElements:t}=this;this.addHandles([et(()=>s,"select-record",({featureViewModel:i})=>{e&&(i.abilities={relationshipContent:!0},e.push(new Is({flowItems:e,viewModel:i,visibleElements:t})))}),et(()=>s,"show-all-records",()=>{if(!e)return;const{viewModel:i}=s;i.showAllEnabled=!0;const r=new Or({visibleElements:{title:!1,description:!1},viewModel:i});this._addFeatureRelationshipHandles(r),e.push(r)})],Lr)}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:s,visibleElements:e}=this,t=this.get("viewModel.content"),{contentViewModels:i}=this.viewModel;if(Array.isArray(t))t.forEach((r,n)=>{if(r.type==="attachments"&&(this._contentWidgets[n]=new Eo({displayType:r.displayType,headingLevel:e.title?s+1:s,viewModel:i[n]})),r.type==="fields"&&(this._contentWidgets[n]=new bn({viewModel:i[n]})),r.type==="media"&&(this._contentWidgets[n]=new jn({viewModel:i[n]})),r.type==="text"&&(this._contentWidgets[n]=new bi({viewModel:i[n]})),r.type==="custom"&&(this._contentWidgets[n]=new bi({viewModel:i[n]})),r.type==="expression"&&(this._contentWidgets[n]=new bd({viewModel:i[n]})),r.type==="relationship"){const a=new Or({viewModel:i[n]});this._addFeatureRelationshipHandles(a),this._contentWidgets[n]=a}},this);else{const r=i[0];r&&!r.destroyed&&(this._contentWidgets[0]=new bi({viewModel:r}))}this.scheduleRender()}};g([m()],re.prototype,"graphic",null),g([m()],re.prototype,"defaultPopupTemplateEnabled",null),g([m()],re.prototype,"flowItems",void 0),g([m()],re.prototype,"headingLevel",void 0),g([m({readOnly:!0})],re.prototype,"isTable",null),g([m()],re.prototype,"label",null),g([m(),Te("esri/widgets/Feature/t9n/Feature")],re.prototype,"messages",void 0),g([m(),Te("esri/t9n/common")],re.prototype,"messagesCommon",void 0),g([m(),Te("esri/widgets/support/t9n/uriUtils")],re.prototype,"messagesURIUtils",void 0),g([m()],re.prototype,"spatialReference",null),g([m({readOnly:!0})],re.prototype,"title",null),g([m()],re.prototype,"visibleElements",void 0),g([yt("visibleElements")],re.prototype,"castVisibleElements",null),g([m()],re.prototype,"map",null),g([m()],re.prototype,"view",null),g([m({type:Ys})],re.prototype,"viewModel",void 0),re=Is=g([X("esri.widgets.Feature")],re);const kd=re;var Wn;const ki=Symbol("anchorHandles");let at=class extends wa.EventedAccessor{constructor(e){super(e),this[Wn]=new Bi,this.location=null,this.screenLocationEnabled=!1,this.view=null,this[ki].add([Ti(()=>xa(this.screenLocationEnabled?this.view:null,t=>[t.size,t.type==="3d"?t.camera:t.viewpoint]),()=>this.notifyChange("screenLocation")),F(()=>this.screenLocation,(t,i)=>{t!=null&&i!=null&&this.emit("view-change")})])}destroy(){this.view=null,this[ki]=en(this[ki])}get screenLocation(){var r;const{location:e,view:t,screenLocationEnabled:i}=this;return i&&e!=null&&t!=null&&t.ready?(r=t.toScreen)==null?void 0:r.call(t,e):null}};Wn=ki,g([m()],at.prototype,"location",void 0),g([m()],at.prototype,"screenLocation",null),g([m()],at.prototype,"screenLocationEnabled",void 0),g([m()],at.prototype,"view",void 0),at=g([X("esri.widgets.support.AnchorElementViewModel")],at);const Un=at,Ad="esri.widgets.CompassViewModel";let Ai=class extends Un{constructor(e){super(e),this.visible=!1}};g([m()],Ai.prototype,"visible",void 0),Ai=g([X(Ad)],Ai);const Yn=Ai,fs="esri-spinner",ms={base:fs,spinnerStart:`${fs}--start`,spinnerFinish:`${fs}--finish`};let ot=class extends Be{constructor(e,t){super(e,t),this._animationDelay=500,this._animationPromise=null,this.viewModel=new Yn}initialize(){this.addHandles(F(()=>this.visible,e=>this._visibleChange(e)))}destroy(){this._animationPromise=null}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}show(e){const{location:t,promise:i}=e??{};t&&(this.viewModel.location=t),this.visible=!0;const r=()=>this.hide();i&&i.catch(()=>{}).then(r)}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:t}=this.viewModel,i=!!t,r=e&&i,n=!e&&i,a={[ms.spinnerStart]:r,[ms.spinnerFinish]:n},o=this._getPositionStyles();return _("div",{class:this.classes(ms.base,a),styles:o})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const t=tn(this._animationDelay);this._animationPromise=t,t.catch(()=>{}).then(()=>{this._animationPromise===t&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)})}_getPositionStyles(){const{screenLocation:e,view:t}=this.viewModel;if(t==null||e==null)return{};const{padding:i}=t;return{left:e.x-i.left+"px",top:e.y-i.top+"px"}}};g([m()],ot.prototype,"location",null),g([m()],ot.prototype,"view",null),g([m({type:Yn})],ot.prototype,"viewModel",void 0),g([m()],ot.prototype,"visible",null),ot=g([X("esri.widgets.Spinner")],ot);const Cd=ot,Ui={iconZoom:"esri-icon-zoom-in-magnifying-glass",iconTrash:"esri-icon-trash",iconBrowseClusteredFeatures:"esri-icon-table"},ut=new Ri({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}",className:Ui.iconZoom}),Br=new Ri({icon:"trash",id:"remove-selected-feature",title:"{messages.remove}",className:Ui.iconTrash}),It=new Ri({icon:"magnifying-glass-plus",id:"zoom-to-clustered-features",title:"{messages.zoom}",className:Ui.iconZoom}),Je=new sn({icon:"table",id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:Ui.iconBrowseClusteredFeatures,value:!1}),Td="esri.widgets.Popup.PopupViewModel",$i=Ce.getLogger(Td),Ed=s=>{const{event:e,view:t,viewModel:i}=s,{action:r}=e;if(!r)return Promise.reject(new H("trigger-action:missing-arguments","Event has no action"));const{disabled:n,id:a}=r;if(!a)return Promise.reject(new H("trigger-action:invalid-action","action.id is missing"));if(n)return Promise.reject(new H("trigger-action:invalid-action","Action is disabled"));if(a===ut.id)return Od(i).catch(Ma);if(a===It.id)return Dd(i);if(a===Je.id)return i.browseClusterEnabled=!i.browseClusterEnabled,i.featureMenuOpen=i.browseClusterEnabled,Promise.resolve();if(a===Br.id){i.visible=!1;const{selectedFeature:o}=i;if(!o)return Promise.reject(new H(`trigger-action:${Br.id}`,"selectedFeature is required",{selectedFeature:o}));const{sourceLayer:l}=o;return l?l.remove(o):t==null||t.graphics.remove(o),Promise.resolve()}return Promise.resolve()};function qn(s){const{selectedFeature:e,location:t,view:i}=s;return i?i.type==="3d"?e??t??null:s.get("selectedFeature.geometry")||t:null}function lt(s){var e,t;return!!s&&s.isAggregate&&((t=(e=s.sourceLayer)==null?void 0:e.featureReduction)==null?void 0:t.type)==="cluster"}async function Id(s,e){if((e==null?void 0:e.type)!=="3d"||!s||s.declaredClass!=="esri.Graphic")return!0;const t=e.getViewForGraphic(s);if(t&&"whenGraphicBounds"in t){let i;try{i=await t.whenGraphicBounds(s,{useViewElevation:!0})}catch{}return!i||!i.boundingBox||i.boundingBox[0]===i.boundingBox[3]&&i.boundingBox[1]===i.boundingBox[4]&&i.boundingBox[2]===i.boundingBox[5]}return!0}async function Od(s){var f;const{location:e,selectedFeature:t,view:i,zoomFactor:r}=s,n=qn(s);if(!i||!n){const u=new H("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:n,view:i});throw $i.error(u),u}const a=i.scale/r,o=(f=s.selectedFeature)==null?void 0:f.geometry,l=o??e,h=l!=null&&l.type==="point"&&await Id(t,i);ut.active=!0,ut.disabled=!0;try{await s.zoomTo({target:{target:n,scale:h?a:void 0}})}catch{const p=new H("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:t});$i.error(p)}finally{ut.active=!1,ut.disabled=!1,s.zoomToLocation=null,h&&(s.location=l)}}async function Dd(s){const{selectedFeature:e,view:t}=s;if((t==null?void 0:t.type)!=="2d"){const a=new H("zoomToCluster:invalid-view","View must be 2d MapView.",{view:t});throw $i.error(a),a}if(!e||!lt(e)){const a=new H("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:e});throw $i.error(a),a}const[i,r]=await qs(t,e);It.active=!0,It.disabled=!0;const{extent:n}=await i.queryExtent(r);await s.zoomTo({target:n}),It.active=!1,It.disabled=!1}async function Fd(s){const{view:e,selectedFeature:t}=s;if(!e||!t)return;const[i,r]=await qs(e,t),{extent:n}=await i.queryExtent(r);s.selectedClusterBoundaryFeature.geometry=n,e.graphics.add(s.selectedClusterBoundaryFeature)}async function Sd(s){const{selectedFeature:e,view:t}=s;if(!t||!e)return;const[i,r]=await qs(t,e);Je.active=!0,Je.disabled=!0;const{features:n}=await i.queryFeatures(r);Je.active=!1,Je.disabled=!1,Je.value=!0,s==null||s.open({features:[e].concat(n),featureMenuOpen:!0})}async function qs(s,e){const t=await s.whenLayerView(e.sourceLayer),i=t.createQuery(),r=e.getObjectId();return i.aggregateIds=r!=null?[r]:[],[t,i]}function $d(s){Je.value=!1;const e=s.features.filter(t=>lt(t));e.length&&(s.features=e)}function Gn(s){var e;if(s==null)return null;switch(s.type){case"point":return s;case"extent":return s.center;case"polygon":return s.centroid;case"multipoint":case"polyline":return(e=s.extent)==null?void 0:e.center;default:return null}}const E="esri-popup",Ht=`${E}__header`,rt=`${E}--is-docked`,M={calciteThemeLight:"calcite-mode-light",calciteThemeDark:"calcite-mode-dark",iconLeftTriangleArrow:"esri-icon-left-triangle-arrow",iconRightTriangleArrow:"esri-icon-right-triangle-arrow",iconDockToTop:"esri-icon-maximize",iconDockToBottom:"esri-icon-dock-bottom",iconDockToLeft:"esri-icon-dock-left",iconDockToRight:"esri-icon-dock-right",iconClose:"esri-icon-close",iconUndock:"esri-icon-minimize",iconCheckMark:"esri-icon-check-mark",iconLoading:"esri-icon-loading-indicator",iconDefaultAction:"esri-icon-default-action",iconActionsMenu:"esri-icon-handle-horizontal",rotating:"esri-rotating",base:E,widget:"esri-widget",main:`${E}__main-container`,loadingContainer:`${E}__loading-container`,isCollapsible:`${E}--is-collapsible`,isCollapsed:`${E}--is-collapsed`,shadow:`${E}--shadow`,isDocked:rt,isDockedTopLeft:`${rt}-top-left`,isDockedTopCenter:`${rt}-top-center`,isDockedTopRight:`${rt}-top-right`,isDockedBottomLeft:`${rt}-bottom-left`,isDockedBottomCenter:`${rt}-bottom-center`,isDockedBottomRight:`${rt}-bottom-right`,alignTopCenter:`${E}--aligned-top-center`,alignBottomCenter:`${E}--aligned-bottom-center`,alignTopLeft:`${E}--aligned-top-left`,alignBottomLeft:`${E}--aligned-bottom-left`,alignTopRight:`${E}--aligned-top-right`,alignBottomRight:`${E}--aligned-bottom-right`,isFeatureMenuOpen:`${E}--feature-menu-open`,isActionsMenuOpen:`${E}--actions-menu-open`,hasFeatureUpdated:`${E}--feature-updated`,header:Ht,headerButtons:`${Ht}-buttons`,headerContainer:`${Ht}-container`,headerContainerButton:`${Ht}-container--button`,headerTitle:`${Ht}-title`,content:`${E}__content`,contentHasFlows:"esri-content--has-flows",contentFlowItem:"esri-content__flow-item",footer:`${E}__footer`,footerHasPagination:`${E}__footer--has-pagination`,footerHasActions:`${E}__footer--has-actions`,footerHasActionsMenu:`${E}__footer--has-actions-menu`,button:`${E}__button`,buttonDisabled:`${E}__button--disabled`,buttonDock:`${E}__button--dock`,icon:`${E}__icon`,iconDock:`${E}__icon--dock-icon`,inlineActionsContainer:`${E}__inline-actions-container`,actionsMenuButton:`${E}__actions-menu-button`,actions:`${E}__actions`,action:`${E}__action`,actionImage:`${E}__action-image`,actionText:`${E}__action-text`,actionToggle:`${E}__action-toggle`,actionToggleOn:`${E}__action-toggle--on`,actionExit:`${E}__action--exit`,actionSelectFeature:`${E}__action--select-feature`,pointer:`${E}__pointer`,pointerDirection:`${E}__pointer-direction`,navigation:`${E}__navigation`,paginationIcon:`${E}__pagination-icon`,paginationPrevious:`${E}__pagination-previous`,paginationNext:`${E}__pagination-next`,featureMenu:`${E}__feature-menu`,featureMenuList:`${E}__feature-menu-list`,featureMenuItem:`${E}__feature-menu-item`,featureMenuViewport:`${E}__feature-menu-viewport`,featureMenuHeader:`${E}__feature-menu-header`,featureMenuNote:`${E}__feature-menu-note`,featureMenuSelected:`${E}__feature-menu-item--selected`,featureMenuButton:`${E}__feature-menu-button`,featureMenuButtonIcon:`${E}__feature-menu-button-icon`,featureMenuTitle:`${E}__feature-menu-title`,featureMenuObserver:`${E}__feature-menu-observer`,featureMenuLoader:`${E}__feature-menu-loader`,collapseButton:`${E}__collapse-button`,collapseIcon:`${E}__collapse-icon`};var bt;(function(s){s[s.size=22]="size",s[s.lineWidth=50]="lineWidth",s[s.maxSize=120]="maxSize",s[s.maxOutlineSize=80]="maxOutlineSize",s[s.tallSymbolWidth=20]="tallSymbolWidth"})(bt||(bt={}));const Rr=rn("android");rn("chrome")||Rr&&Rr>=4;Pa();bt.size;bt.maxSize;bt.maxOutlineSize;bt.lineWidth;bt.tallSymbolWidth;function Kn(s){return s&&"opacity"in s?s.opacity*Kn(s.parent):1}async function Ld(s,e){if(!s)return;const t=s.sourceLayer,i=(e!=null&&e.useSourceLayer?t:s.layer)??t,r=Kn(i);if(s.symbol!=null&&(e==null||e.ignoreGraphicSymbol!==!0)){const w=s.symbol.type==="web-style"?await ka(s.symbol,{...e,cache:e!=null?e.webStyleCache:null}):s.symbol.clone();return Ki(w,null,r),w}const n=(e!=null?e.renderer:null)??(i&&"renderer"in i?i.renderer:null);let a=n&&"getSymbolAsync"in n?await n.getSymbolAsync(s,e):null;if(!a)return;if(a=a.type==="web-style"?await a.fetchSymbol({...e,cache:e!=null?e.webStyleCache:null}):a.clone(),!(n&&"visualVariables"in n&&n.visualVariables&&n.visualVariables.length))return Ki(a,null,r),a;if("arcadeRequiredForVisualVariables"in n&&n.arcadeRequiredForVisualVariables&&(e==null||e.arcade==null)){const w={...e};w.arcade=await Gr(),e=w}const{getColor:o,getOpacity:l,getAllSizes:h,getRotationAngle:f}=await C(()=>import("./index-080e108a.js").then(w=>w.uQ),["assets/index-080e108a.js","assets/index-a8e73b5e.css"]),u=[],p=[],d=[],b=[];for(const w of n.visualVariables)switch(w.type){case"color":u.push(w);break;case"opacity":p.push(w);break;case"rotation":b.push(w);break;case"size":w.target||d.push(w)}const c=!!u.length&&u[u.length-1],y=c?o(c,s,e):null,v=!!p.length&&p[p.length-1];let x=v?l(v,s,e):null;if(r!=null&&(x=x!=null?x*r:r),Ki(a,y,x),d.length){const w=h(d,s,e);await Aa(a,w)}for(const w of b)Ca(a,f(w,s,e),w.axis);return a}const ii=Ze.ofType({key:"type",defaultKeyValue:"button",base:Ta,typeMap:{button:Ri,toggle:sn}}),Bd=()=>[ut.clone()],Rd=()=>[It.clone(),Je.clone()];let $=class extends Ea(Un){get isLoadingFeature(){return this.featureViewModels.some(e=>e.waitingForContent)}constructor(e){super(e),this._handles=new Bi,this._pendingPromises=new Set,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this.featurePage=null,this.actions=new ii,this.activeFeature=null,this.defaultPopupTemplateEnabled=!1,this.autoCloseEnabled=!1,this.autoOpenEnabled=!0,this.browseClusterEnabled=!1,this.content=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new Lt({symbol:new Ia({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null}initialize(){this._handles.add([this.on("view-change",()=>this._autoClose()),F(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),F(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),F(()=>{var e,t;return(t=(e=this.view)==null?void 0:e.animation)==null?void 0:t.state},e=>this._animationStateChange(e)),F(()=>this.location,e=>this._locationChange(e)),F(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),F(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),F(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),F(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",e=>Ed({event:e,viewModel:this,view:this.view})),Ti(()=>!this.waitingForResult,()=>this._waitingForResultChange(),Oa),F(()=>{var e,t;return[this.features,(e=this.view)==null?void 0:e.map,(t=this.view)==null?void 0:t.spatialReference]},()=>this._updateFeatureVMs()),F(()=>{var e;return(e=this.view)==null?void 0:e.scale},()=>this._viewScaleChange()),Ti(()=>!this.visible,()=>this.browseClusterEnabled=!1),F(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelFetchingFeatures(),this._handles.destroy(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new ii;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:r,includeDefaultActions:n,selectedFeature:a}=this,o=n?i.concat(t):t,l=a&&(typeof a.getEffectivePopupTemplate=="function"&&a.getEffectivePopupTemplate(r)||a.popupTemplate),h=l&&l.actions,f=l&&l.overwriteActions?h:h?h.concat(o):o;return f&&f.filter(Boolean).forEach(u=>e.add(u)),e}get defaultActions(){const e=this._get("defaultActions")||new ii;return e.removeAll(),e.addMany(lt(this.selectedFeature)?Rd():Bd()),e}get featureCount(){return this.features.length}get features(){return this._get("features")||[]}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:i,promiseCount:r,selectedFeatureIndex:n}=this,a=r&&t.length;a&&i&&n===-1?this.selectedFeatureIndex=0:a&&n!==-1||(this.selectedFeatureIndex=t.length?0:-1)}get location(){return this._get("location")||null}set location(e){var r,n,a;let t=e;const i=(n=(r=this.view)==null?void 0:r.spatialReference)==null?void 0:n.isWebMercator;e&&((a=e==null?void 0:e.spatialReference)!=null&&a.isWGS84)&&i&&(t=Da(e)),this._set("location",t)}get pendingPromisesCount(){return this._pendingPromises.size}get waitingForResult(){return!(!(this._fetchFeaturesController||this.pendingPromisesCount>0)||this.featureCount!==0)}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){if(this._pendingPromises.clear(),this.features=[],!Array.isArray(e)||!e.length)return this._set("promises",[]),void this.notifyChange("pendingPromisesCount");this._set("promises",e),(e=e.slice(0)).forEach(t=>{this._pendingPromises.add(t);const i=n=>{this._pendingPromises.has(t)&&this._updateFeatures(n),this._updatePendingPromises(t)},r=()=>this._updatePendingPromises(t);t.then(i,r)}),this.notifyChange("pendingPromisesCount")}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;return t===-1?null:e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return typeof e=="number"?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;e=isNaN(e)||e<-1||!t?-1:(e+t)%t,this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get state(){return this.get("view.ready")?"ready":"disabled"}centerAtLocation(){const{view:e}=this,t=qn(this);return t&&e?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new H("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new H("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeatures(e,{event:t&&t.event,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t&&t.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:i}=t;delete t.fetchFeatures,i&&this._setFetchFeaturesPromises(t.location);const r=["actionsMenuOpen","collapsed"];for(const n of r)delete t[n];this.set(t)}triggerAction(e){const t=this.allActions.at(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex=this.selectedFeatureIndex+1,this}previous(){return this.selectedFeatureIndex=this.selectedFeatureIndex-1,this}disableClusterBrowsing(){$d(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;(e==null?void 0:e.type)==="2d"?lt(t)?(await Fd(this),await Sd(this)):Ce.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):Ce.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}handleViewClick(e){this.autoOpenEnabled&&this._fetchFeaturesAndOpen(e)}_animationStateChange(e){this.zoomToLocation||(ut.disabled=e==="waiting-for-target")}_clearBrowsedClusterGraphics(){var t;const e=(t=this.view)==null?void 0:t.graphics;e&&(e.remove(this.selectedClusterBoundaryFeature),this._selectedClusterFeature&&e.remove(this._selectedClusterFeature)),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(lt(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i}=this;i&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:r,featureViewModels:n}=this;if(i===null)return;const a=((i-1)*r+t)%t,o=a+r;n.slice(a,o).forEach((l,h)=>{l&&!l.graphic&&(l.graphic=e[a+h])})}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:r}=this;if(e&&r){if(this.browseClusterEnabled)return this._selectedClusterFeature&&(r.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),lt(e)?void 0:(e.symbol=await Ld(e),this._selectedClusterFeature=e,void r.graphics.add(this._selectedClusterFeature));!i&&t||!e.geometry?i&&!e.geometry&&this.centerAtLocation().then(()=>{var a;const n=(a=r.center)==null?void 0:a.clone();n&&(this.location=n)}):this.location=Gn(e.geometry)}}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}_setFetchFeaturesPromises(e){return this._fetchFeaturesWithController(this._getScreenPoint(e||this.location)).then(t=>{const{clientOnlyGraphics:i,promisesPerLayerView:r}=t,n=Promise.resolve(i),a=r.map(o=>o.promise);this.promises=[n,...a]})}_destroyFeatureVMs(){this.featureViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i}=this;if(lt(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t||!t.length)return;const r=i.slice(0),n=[];t.forEach((a,o)=>{var h,f;if(!a)return;let l=null;if(r.some((u,p)=>(u&&u.graphic===a&&(l=u,r.splice(p,1)),!!l)),l)n[o]=l;else{const u=new Ys({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:(h=this.view)==null?void 0:h.spatialReference,graphic:a===e?a:null,map:(f=this.view)==null?void 0:f.map,view:this.view});n[o]=u}}),r.forEach(a=>a&&!a.destroyed&&a.destroy()),this._set("featureViewModels",n)}_getScreenPoint(e){const{view:t}=this;return t&&e&&typeof t.toScreen=="function"?t.toScreen(e):null}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null,this.notifyChange("waitingForResult")}_fetchFeaturesWithController(e,t){this._cancelFetchingFeatures();const i=new AbortController,{signal:r}=i;this._fetchFeaturesController=i,this.notifyChange("waitingForResult");const n=this.fetchFeatures(e,{signal:r,event:t});return n.catch(()=>{}).then(()=>{this._fetchFeaturesController=null,this.notifyChange("waitingForResult")}),n}_fetchFeaturesAndOpen(e){const{screenPoint:t,mapPoint:i}=e,{view:r}=this;this._fetchFeaturesWithController(t,e).then(n=>{const{clientOnlyGraphics:a,promisesPerLayerView:o,location:l}=n,h=[Promise.resolve(a),...o.map(f=>f.promise)];return r!=null&&r.popup&&"open"in r.popup&&r.popup.open({location:l||i,promises:h}),n})}_updatePendingPromises(e){e&&this._pendingPromises.has(e)&&(this._pendingPromises.delete(e),this.notifyChange("pendingPromisesCount"))}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:i}=e;return i&&"layer"in i&&i.layer?i.layer:(i==null?void 0:i.type)==="map-notes"||(i==null?void 0:i.type)==="subtype-group"?i:t}_getHighlightTarget(e,t){const i=t.type==="imagery"?void 0:"objectIdField"in t?t.objectIdField||Fa:null,r=e.attributes;return r&&i&&r[i]||e}async _highlightActiveFeature(){const e="highlight-active-feature";this._handles.remove(e);const{highlightEnabled:t,view:i,activeFeature:r,visible:n}=this;if(!(r&&i&&t&&n))return;const a=this._getHighlightLayer(r);if(!(a&&a instanceof Qs))return;const o=this._getLayerView(i,a);this._highlightActiveFeaturePromise=o;const l=await o;if(!(l&&Js(l)&&this._highlightActiveFeaturePromise===o&&this.activeFeature&&this.highlightEnabled))return;const h=l.highlight(this._getHighlightTarget(r,a));this._handles.add(h,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this._handles.remove(e);const{selectedFeature:t,highlightEnabled:i,view:r,visible:n}=this;if(!(t&&r&&i&&n))return;const a=this._getHighlightLayer(t);if(!(a&&a instanceof Qs))return;const o=this._getLayerView(r,a);this._highlightSelectedFeaturePromise=o;const l=await o;if(!(l&&Js(l)&&this._highlightSelectedFeaturePromise===o&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const h=l.highlight(this._getHighlightTarget(t,a));this._handles.add(h,e)}_updateFeatures(e){const{features:t}=this;if(!e||!e.length)return;if(!t.length)return void(this.features=e);const i=e.filter(r=>!t.includes(r));this.features=t.concat(i)}};g([m()],$.prototype,"featurePage",void 0),g([m()],$.prototype,"isLoadingFeature",null),g([m({type:ii})],$.prototype,"actions",void 0),g([m({readOnly:!0})],$.prototype,"active",null),g([m()],$.prototype,"activeFeature",void 0),g([m({readOnly:!0})],$.prototype,"allActions",null),g([m({type:Boolean})],$.prototype,"defaultPopupTemplateEnabled",void 0),g([m()],$.prototype,"autoCloseEnabled",void 0),g([m()],$.prototype,"autoOpenEnabled",void 0),g([m()],$.prototype,"browseClusterEnabled",void 0),g([m()],$.prototype,"content",void 0),g([m({type:ii,readOnly:!0})],$.prototype,"defaultActions",null),g([m({readOnly:!0})],$.prototype,"featureCount",null),g([m()],$.prototype,"features",null),g([m()],$.prototype,"featuresPerPage",void 0),g([m()],$.prototype,"featureMenuOpen",void 0),g([m()],$.prototype,"featureViewModelAbilities",void 0),g([m({readOnly:!0})],$.prototype,"featureViewModels",void 0),g([m()],$.prototype,"highlightEnabled",void 0),g([m()],$.prototype,"includeDefaultActions",void 0),g([m({type:Sa})],$.prototype,"location",null),g([m({readOnly:!0})],$.prototype,"pendingPromisesCount",null),g([m({readOnly:!0})],$.prototype,"selectedClusterBoundaryFeature",void 0),g([m({readOnly:!0})],$.prototype,"waitingForResult",null),g([m({readOnly:!0})],$.prototype,"promiseCount",null),g([m()],$.prototype,"promises",null),g([m({value:null,readOnly:!0})],$.prototype,"selectedFeature",null),g([m({value:-1})],$.prototype,"selectedFeatureIndex",null),g([m({readOnly:!0})],$.prototype,"selectedFeatureViewModel",null),g([m({readOnly:!0})],$.prototype,"state",null),g([m()],$.prototype,"title",void 0),g([m()],$.prototype,"updateLocationEnabled",void 0),g([m()],$.prototype,"view",void 0),g([m()],$.prototype,"visible",void 0),g([m()],$.prototype,"zoomFactor",void 0),g([m()],$.prototype,"zoomToLocation",void 0),g([m()],$.prototype,"centerAtLocation",null),$=g([X("esri.widgets.Popup.PopupViewModel")],$);const Xn=$,jr="selected-index",jd=0,Nr="popup-spinner",Vr={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},Hr="esri-popup";function je(s,e){return e===void 0?`${Hr}__${s}`:`${Hr}__${s}-${e}`}const zr={closeButton:!0,featureNavigation:!0};let T=class extends zn(Be){constructor(s,e){super(s,e),this._blurClose=!1,this._blurContainer=!1,this._containerNode=null,this._mainContainerNode=null,this._featureMenuNode=null,this._actionsMenuNode=null,this._focusClose=!1,this._focusContainer=!1,this._focusDockButton=!1,this._focusFeatureMenuButton=!1,this._focusActionsMenuButton=!1,this._focusFirstFeature=!1,this._focusFirstAction=!1,this._handles=new Bi,this._pointerOffsetInPx=16,this._spinner=null,this._feature=null,this._featureMenuIntersectionObserverNode=null,this._featureMenuViewportNode=null,this._rootFlowItemNode=null,this._featureMenuIntersectionObserverCallback=([t])=>{t!=null&&t.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._displaySpinnerThrottled=Ds(()=>this._displaySpinner(),jd),this._exitRelatedRecordsActions=new WeakMap,this._featureSelectionActions=new WeakMap,this._flowItems=new Ze,this.alignment="auto",this.collapsed=!1,this.collapseEnabled=!0,this.dockEnabled=!1,this.headingLevel=2,this.maxInlineActions=3,this.messages=null,this.messagesCommon=null,this.spinnerEnabled=!0,this.viewModel=new Xn,this.visibleElements={...zr},this._handleOpenRelatedFeature=t=>{this._openRelatedFeature(t)},this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,F(()=>{var t;return(t=this.viewModel)==null?void 0:t.screenLocation},()=>this._positionContainer()),F(()=>{var t;return[(t=this.viewModel)==null?void 0:t.active,this.dockEnabled]},()=>this._toggleScreenLocationEnabled()),F(()=>{var t;return(t=this.viewModel)==null?void 0:t.screenLocation},(t,i)=>{!!t!=!!i&&this.reposition()}),F(()=>{var t,i,r,n,a,o;return[(i=(t=this.viewModel)==null?void 0:t.view)==null?void 0:i.padding,(n=(r=this.viewModel)==null?void 0:r.view)==null?void 0:n.size,(a=this.viewModel)==null?void 0:a.active,(o=this.viewModel)==null?void 0:o.location,this.alignment]},()=>this.reposition()),F(()=>this.spinnerEnabled,t=>this._spinnerEnabledChange(t)),F(()=>{var t,i;return(i=(t=this.viewModel)==null?void 0:t.view)==null?void 0:i.size},(t,i)=>this._updateDockEnabledForViewSize(t,i)),F(()=>{var t;return(t=this.viewModel)==null?void 0:t.view},(t,i)=>this._viewChange(t,i)),F(()=>{var t,i;return(i=(t=this.viewModel)==null?void 0:t.view)==null?void 0:i.ready},(t,i)=>this._viewReadyChange(t??!1,i??!1)),F(()=>{var t,i;return[(t=this.viewModel)==null?void 0:t.waitingForResult,(i=this.viewModel)==null?void 0:i.location]},()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),F(()=>this.selectedFeatureWidget,()=>this._destroyFlowItemWidgets()),F(()=>{var t,i,r,n;return[(i=(t=this.selectedFeatureWidget)==null?void 0:t.viewModel)==null?void 0:i.title,(n=(r=this.selectedFeatureWidget)==null?void 0:r.viewModel)==null?void 0:n.state]},()=>this._setTitleFromFeatureWidget()),F(()=>{var t,i,r,n;return[(i=(t=this.selectedFeatureWidget)==null?void 0:t.viewModel)==null?void 0:i.content,(n=(r=this.selectedFeatureWidget)==null?void 0:r.viewModel)==null?void 0:n.state]},()=>this._setContentFromFeatureWidget()),Ti(()=>!this.collapsed,()=>{var t,i;((i=(t=this.viewModel)==null?void 0:t.view)==null?void 0:i.widthBreakpoint)==="xsmall"&&this.viewModel.active&&this.collapseEnabled&&this.viewModel.centerAtLocation()}),et(()=>{var t;return(t=this.viewModel)==null?void 0:t.allActions},"change",()=>this._watchActions()),F(()=>{var t;return(t=this.viewModel)==null?void 0:t.allActions},()=>this._watchActions(),oe),F(()=>{var t;return(t=this.viewModel)==null?void 0:t.featureViewModels},()=>this._featureMenuViewportScrollTop()),et(()=>this._flowItems,"change",()=>{this.notifyChange("_activeFlowItemWidget"),this.scheduleRender()}),F(()=>{var t,i,r,n;return[(i=(t=this._activeFlowItemWidget)==null?void 0:t.viewModel)==null?void 0:i.state,(n=(r=this._activeFlowItemWidget)==null?void 0:r.viewModel)==null?void 0:n.title]},()=>this.scheduleRender())])}loadDependencies(){return ai({action:()=>C(()=>import("./calcite-action-0d34f2ad.js"),["assets/calcite-action-0d34f2ad.js","assets/action-0a339dee.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/guid-114f0fc6.js","assets/loader-2996ba2a.js","assets/loadable-759e1c0c.js","assets/t9n-537805d4.js","assets/observers-4ce6e1b4.js","assets/icon-25aef281.js"]),flow:()=>C(()=>import("./calcite-flow-4396f57a.js"),["assets/calcite-flow-4396f57a.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/observers-4ce6e1b4.js","assets/loadable-759e1c0c.js"]),"flow-item":()=>C(()=>import("./calcite-flow-item-55ff42f9.js"),["assets/calcite-flow-item-55ff42f9.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/loader-2996ba2a.js","assets/guid-114f0fc6.js","assets/loadable-759e1c0c.js","assets/t9n-537805d4.js","assets/observers-4ce6e1b4.js","assets/action-0a339dee.js","assets/icon-25aef281.js","assets/FloatingArrow-54d0aa06.js","assets/debounce-14ebcd9e.js","assets/scrim-ffa718f9.js"]),icon:()=>C(()=>import("./calcite-icon-2c0948c4.js"),["assets/calcite-icon-2c0948c4.js","assets/icon-25aef281.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/observers-4ce6e1b4.js"]),tooltip:()=>C(()=>import("./calcite-tooltip-1b461e59.js"),["assets/calcite-tooltip-1b461e59.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/FloatingArrow-54d0aa06.js","assets/debounce-14ebcd9e.js","assets/guid-114f0fc6.js"])})}initialize(){this.addHandles(this._displaySpinnerThrottled)}destroy(){var s,e;this._destroyFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),(s=this._handles)==null||s.destroy(),this._unobserveFeatureMenuObserver(),(e=this._featureMenuIntersectionObserver)==null||e.disconnect()}get actionsMenuId(){return`${this.id}-actions-menu`}get actionsMenuButtonId(){return`${this.id}-actions-menu-button`}get featureMenuId(){return`${this.id}-feature-menu`}get titleId(){return`${this.id}-popup-title`}get contentId(){return`${this.id}-popup-content`}get hasContent(){const{selectedFeatureWidget:s,viewModel:e}=this;if(!s)return!!(e!=null&&e.content);const t=s.viewModel;if(t!=null&&t.waitingForContent||(t==null?void 0:t.state)==="error")return!0;const i=t==null?void 0:t.content;return Array.isArray(i)?!!i.length:!!i}get featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.visibleElements.featureNavigation}get collapsible(){return!!(this.collapseEnabled&&this.viewModel.title&&this.hasContent)}get featureMenuVisible(){return this.featureNavigationVisible&&this.featureMenuOpen}get contentCollapsed(){return this.collapsible&&!this.featureMenuVisible&&this.collapsed}get dividedActions(){return this._divideActions()}get _activeFlowItemWidget(){const{_flowItems:s}=this;return s.at(-1)??null}get actions(){return this.viewModel.actions}set actions(s){this.viewModel.actions=s}set actionsMenuOpen(s){this._set("actionsMenuOpen",!!s)}get actionsMenuOpen(){return!!this.viewModel.active&&this._get("actionsMenuOpen")}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(s){this.viewModel.autoCloseEnabled=s}get autoOpenEnabled(){return Zs(Ce.getLogger(this),"autoOpenEnabled",{replacement:"MapView/SceneView.popupEnabled",version:"4.27"}),this.viewModel.autoOpenEnabled}set autoOpenEnabled(s){Zs(Ce.getLogger(this),"autoOpenEnabled",{replacement:"MapView/SceneView.popupEnabled",version:"4.27"}),this.viewModel.autoOpenEnabled=s}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(s){this.viewModel.defaultPopupTemplateEnabled=s}get content(){return this.viewModel.content}set content(s){this.viewModel.content=s}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||Vr}set dockOptions(s){var o,l;const e={...Vr},t=(l=(o=this.viewModel)==null?void 0:o.view)==null?void 0:l.breakpoints,i={};t&&(i.width=t.xsmall,i.height=t.xsmall);const r={...e,...s},n={...e.breakpoint,...i},{breakpoint:a}=r;typeof a=="object"?r.breakpoint={...n,...a}:a&&(r.breakpoint=n),this._set("dockOptions",r),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(s){this.viewModel.featureMenuOpen=s}get features(){return this.viewModel.features}set features(s){this.viewModel.features=s}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(s){this.viewModel.goToOverride=s}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(s){this.viewModel.highlightEnabled=s}get location(){return this.viewModel.location}set location(s){this.viewModel.location=s}get label(){var s;return((s=this.messages)==null?void 0:s.widgetLabel)??""}set label(s){this._overrideIfSome("label",s)}get promises(){return this.viewModel.promises}set promises(s){this.viewModel.promises=s}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(s){this.viewModel.selectedFeatureIndex=s}get selectedFeatureWidget(){const{_feature:s,visibleElements:e,headingLevel:t,_flowItems:i}=this,{selectedFeatureViewModel:r}=this.viewModel,n={...e,title:!1};return r?(s?(s.viewModel=r,s.visibleElements=n):this._feature=new kd({flowItems:i,headingLevel:t+1,viewModel:r,visibleElements:n}),this._feature):null}get title(){return this.viewModel.title}set title(s){this.viewModel.title=s}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(s){this.viewModel.updateLocationEnabled=s}get view(){return this.viewModel.view}set view(s){this.viewModel.view=s}get visible(){return this.viewModel.visible}set visible(s){this.viewModel.visible=s}castVisibleElements(s){return{...zr,...s}}blur(){const{active:s}=this.viewModel;s||Ce.getLogger(this).warn("Popup can only be blurred when currently active."),this.visibleElements.closeButton?this._blurClose=!0:this._blurContainer=!0,this.scheduleRender()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(s,e){return this.viewModel.fetchFeatures(s,e)}focus(){const{active:s}=this.viewModel;s||Ce.getLogger(this).warn("Popup can only be focused when currently active."),this.visibleElements.closeButton?this._focusClose=!0:this._focusContainer=!0,this.scheduleRender()}next(){return this.viewModel.next()}open(s){var r,n;this._handles.remove(jr);const e=!!s&&!!s.featureMenuOpen,t=!!s&&!!s.actionsMenuOpen,i={collapsed:!!s&&!!s.collapsed,actionsMenuOpen:t,featureMenuOpen:e};((n=(r=this.viewModel)==null?void 0:r.view)==null?void 0:n.widthBreakpoint)==="xsmall"&&(i.collapsed=!0),this.set(i),this.viewModel.open(s),this._shouldFocus(s),this._addSelectedFeatureIndexHandle()}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(s){return this.viewModel.triggerAction(s)}render(){var b,c,y,v;const{actionsMenuOpen:s,dockEnabled:e,featureMenuVisible:t,dividedActions:i,currentAlignment:r,currentDockPosition:n}=this,{active:a}=this.viewModel,{menuActions:o}=i,l=a&&o.length>1&&s,h=a&&e,f=a&&!e,u=(c=(b=this.selectedFeature)==null?void 0:b.layer)==null?void 0:c.title,p=(v=(y=this.selectedFeature)==null?void 0:y.layer)==null?void 0:v.id,d={[M.alignTopCenter]:r==="top-center",[M.alignBottomCenter]:r==="bottom-center",[M.alignTopLeft]:r==="top-left",[M.alignBottomLeft]:r==="bottom-left",[M.alignTopRight]:r==="top-right",[M.alignBottomRight]:r==="bottom-right",[M.isDocked]:h,[M.shadow]:f,[M.isDockedTopLeft]:n==="top-left",[M.isDockedTopCenter]:n==="top-center",[M.isDockedTopRight]:n==="top-right",[M.isDockedBottomLeft]:n==="bottom-left",[M.isDockedBottomCenter]:n==="bottom-center",[M.isDockedBottomRight]:n==="bottom-right",[M.isFeatureMenuOpen]:t,[M.isActionsMenuOpen]:l};return _("div",{class:this.classes(M.base,d),role:"presentation","data-layer-title":u,"data-layer-id":p,bind:this,afterCreate:this._positionContainer,afterUpdate:this._positionContainer},a?[this.renderMainContainer(),this.renderPointer()]:null)}renderLoadingIcon(){return _("span",{"aria-hidden":"true",class:this.classes(M.icon,M.iconLoading,M.rotating)})}renderNavigationLoading(){const{messagesCommon:s}=this;return this.viewModel.pendingPromisesCount?_("div",{key:je("loading-container"),role:"presentation",class:M.loadingContainer,"aria-label":s.loading,title:s.loading},this.renderLoadingIcon()):null}renderPreviousButton(){const{messages:s}=this;return _("div",{role:"button",tabIndex:0,bind:this,onclick:this._previous,onkeydown:this._previous,class:this.classes(M.button,M.paginationPrevious),"aria-label":s.previous,title:s.previous},_("calcite-icon",{icon:"chevron-left",scale:"s",class:M.paginationIcon}))}renderNextButton(){const{messages:s}=this;return _("div",{role:"button",tabIndex:0,bind:this,onclick:this._next,onkeydown:this._next,class:this.classes(M.button,M.paginationNext),"aria-label":s.next,title:s.next},_("calcite-icon",{icon:"chevron-right",scale:"s",class:M.paginationIcon}))}renderFeatureMenuButton(){const{featureMenuOpen:s,featureMenuId:e,messagesCommon:t}=this,{featureCount:i,selectedFeatureIndex:r}=this.viewModel;return _("div",{role:"button",tabIndex:0,bind:this,onclick:this._toggleFeatureMenu,onkeydown:this._toggleFeatureMenu,afterCreate:this._focusFeatureMenuButtonNode,afterUpdate:this._focusFeatureMenuButtonNode,class:M.featureMenuButton,"aria-haspopup":"true","aria-controls":e,"aria-expanded":s.toString(),"aria-label":t.menu,title:t.menu},_("calcite-icon",{icon:"list-bullet",scale:"s",class:M.featureMenuButtonIcon}),this._getPageText(i,r))}renderNavigationButtons(){return this.featureNavigationVisible?[this.renderPreviousButton(),this.renderNextButton(),this.renderNavigationLoading()||this.renderFeatureMenuButton()]:[]}renderDockIcon(){const{dockEnabled:s}=this,e=this._wouldDockTo(),t={[M.iconUndock]:s,[M.iconDock]:!s,[M.iconDockToRight]:!s&&(e==="top-right"||e==="bottom-right"),[M.iconDockToLeft]:!s&&(e==="top-left"||e==="bottom-left"),[M.iconDockToTop]:!s&&e==="top-center",[M.iconDockToBottom]:!s&&e==="bottom-center"};return _("span",{"aria-hidden":"true",class:this.classes(t,M.icon)})}renderDockButton(){var r,n,a;const{dockEnabled:s,messages:e}=this,t=(n=(r=this.viewModel)==null?void 0:r.view)==null?void 0:n.widthBreakpoint,i=s?e.undock:e.dock;return t!=="xsmall"&&((a=this.dockOptions)!=null&&a.buttonEnabled)?_("div",{role:"button","aria-label":i,title:i,tabIndex:0,bind:this,onclick:this._toggleDockEnabled,onkeydown:this._toggleDockEnabled,afterCreate:this._focusDockButtonNode,afterUpdate:this._focusDockButtonNode,class:this.classes(M.button,M.buttonDock)},this.renderDockIcon()):null}renderTitle(){const{title:s}=this.viewModel,{titleId:e,collapsible:t,contentCollapsed:i,messagesCommon:r}=this,n={[M.headerContainerButton]:t},a=_(Rs,{level:this.headingLevel,class:M.headerTitle,innerHTML:s??""}),o=t?_("button",{key:`${s}--collapsible`,id:e,title:i?r.expand:r.collapse,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(M.headerContainer,n),"aria-expanded":i?"false":"true",onclick:this._toggleCollapsed,type:"button"},a,_("calcite-icon",{class:M.collapseIcon,key:"collapse-icon",icon:i?"chevron-down":"chevron-up",scale:"m"})):_("div",{key:s??"title",id:e,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(M.headerContainer,n)},a);return s?o:null}renderCloseIcon(){return _("span",{"aria-hidden":"true",class:this.classes(M.icon,M.iconClose)})}renderCloseButton(){const{visibleElements:s,messagesCommon:e}=this;return s.closeButton?_("div",{role:"button",tabIndex:0,bind:this,onclick:this._close,onkeydown:this._close,class:M.button,"aria-label":e.close,title:e.close,afterCreate:this._closeButtonNodeUpdated,afterUpdate:this._closeButtonNodeUpdated},this.renderCloseIcon()):null}renderHeader(){return _("header",{class:M.header},this.renderTitle(),_("div",{class:M.headerButtons},this.renderDockButton(),this.renderCloseButton()))}renderContentContainer(){const{contentId:s,hasContent:e,contentCollapsed:t,_flowItems:i}=this,{content:r}=this.viewModel,n=i.toArray(),a={[M.contentHasFlows]:!!n.length};return e&&!t?_("div",{key:r??"content",enterAnimation:this._createFeatureUpdatedAnimation(),id:s,class:this.classes(M.content,a)},_("calcite-flow",{bind:this},_("calcite-flow-item",{bind:this,"data-node-ref":"_rootFlowItemNode",afterCreate:Ci,key:"root-flow-item",onCalciteFlowItemBack:this._handleBackClick},this.renderContent()),n.map(o=>this.renderFlowItem(o))),n.map(o=>this.renderFlowItemTooltips(o))):null}renderFlowItem(s){const{messages:e}=this,t=bs(),i="graphic"in s&&!s.isTable;return _("calcite-flow-item",{bind:this,class:this.classes({[M.calciteThemeDark]:!t,[M.calciteThemeLight]:t}),heading:s.title??"",description:this._getFlowItemDescription(s),onCalciteFlowItemBack:this._handleBackClick,key:`flow-item-${s.viewModel.uid}`},_("calcite-action",{class:M.actionExit,icon:"move-up",label:e==null?void 0:e.exitRelatedRecords,text:e==null?void 0:e.exitRelatedRecords,slot:"header-actions-start",bind:this,afterCreate:r=>this._storeExitRelatedRecordsAction(s,r),onclick:this._destroyFlowItemWidgets}),i?_("calcite-action",{class:M.actionSelectFeature,icon:"zoom-to-object",label:e==null?void 0:e.selectFeature,text:e==null?void 0:e.selectFeature,slot:"header-actions-end",bind:this,afterCreate:r=>this._storeFeatureSelectionAction(s,r),onclick:()=>this._handleOpenRelatedFeature(s)}):null,_("div",{class:this.classes(M.contentFlowItem,{[M.calciteThemeDark]:t,[M.calciteThemeLight]:!t})},s.render()))}renderFlowItemTooltips(s){const{messages:e,_exitRelatedRecordsActions:t,_featureSelectionActions:i}=this,r=bs(),n=i.get(s);return[_("calcite-tooltip",{class:this.classes({[M.calciteThemeDark]:!r,[M.calciteThemeLight]:r}),key:`exit-related-records-tooltip-${s.viewModel.uid}`,label:e==null?void 0:e.exitRelatedRecords,overlayPositioning:"fixed",referenceElement:t.get(s),placement:"top"},e==null?void 0:e.exitRelatedRecords),n?_("calcite-tooltip",{class:this.classes({[M.calciteThemeDark]:!r,[M.calciteThemeLight]:r}),key:`select-related-record-tooltip-${s.viewModel.uid}`,label:e==null?void 0:e.selectFeature,overlayPositioning:"fixed",referenceElement:n,placement:"top"},e==null?void 0:e.selectFeature):null]}renderActionsMenuButton(){const{actionsMenuId:s,actionsMenuButtonId:e,actionsMenuOpen:t,dividedActions:i,messagesCommon:r}=this,n=t?r.close:r.open,{menuActions:a}=i;return a.length?_("div",{key:je("actions-menu-button"),class:this.classes(M.button,M.actionsMenuButton),role:"button",id:e,"aria-haspopup":"true","aria-controls":t?s:null,tabIndex:0,bind:this,onclick:this._toggleActionsMenu,onkeydown:this._toggleActionsMenu,afterCreate:this._focusActionsMenuButtonNode,afterUpdate:this._focusActionsMenuButtonNode,"aria-label":n,title:n},_("span",{"aria-hidden":"true",class:M.iconActionsMenu})):null}renderMenuActions(){const{actionsMenuId:s,actionsMenuButtonId:e,actionsMenuOpen:t,dividedActions:i}=this,{menuActions:r}=i;return r.length&&t?_("ul",{id:s,role:"menu","aria-labelledby":e,key:je("actions"),class:M.actions,bind:this,onkeyup:this._handleActionMenuKeyup,afterCreate:this._actionsMenuNodeUpdated,afterUpdate:this._actionsMenuNodeUpdated},r.toArray().map(n=>this.renderAction({action:n,type:"menu-item"}))):null}renderInlineActions(){const{inlineActions:s}=this.dividedActions;return s.length?s.toArray().map(e=>this.renderAction({action:e,type:"inline"})):[]}renderInlineActionsContainer(){const{inlineActions:s,menuActions:e}=this.dividedActions,t=!!s.length,i=!!e.length;return t||i?_("div",{key:"inline-actions-container","data-inline-actions":t.toString(),"data-menu-actions":i.toString(),class:M.inlineActionsContainer},this.renderInlineActions(),this.renderActionsMenuButton(),this.renderMenuActions()):null}renderNavigation(){return this.featureNavigationVisible?_("section",{key:je("navigation"),class:this.classes(M.navigation)},this.renderNavigationButtons()):null}renderFooter(){const{featureNavigationVisible:s,dividedActions:e}=this,{inlineActions:t,menuActions:i}=e,r=!!t.length,n=!!i.length,a={[M.footerHasPagination]:s,[M.footerHasActions]:r,[M.footerHasActionsMenu]:n};return s||r?_("div",{key:je("feature-buttons"),class:this.classes(M.footer,a)},this.renderInlineActionsContainer(),this.renderNavigation()):null}renderFeatureMenuContainer(){const{messages:s}=this,{featureViewModels:e,isLoadingFeature:t}=this.viewModel,i=Fe(s.selectedFeatures,{total:e.length});return _("section",{key:je("menu"),class:M.featureMenu},_("strong",{class:M.featureMenuHeader},i),_("nav",{bind:this,class:M.featureMenuViewport,"data-node-ref":"_featureMenuViewportNode",afterCreate:Ci},this.renderFeatureMenu(),_("div",{class:M.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),t?_("div",{class:M.featureMenuLoader},this.renderLoadingIcon()):null))}renderPointer(){return this.dockEnabled?null:_("div",{key:je("pointer"),class:M.pointer,role:"presentation"},_("div",{class:this.classes(M.pointerDirection,M.shadow)}))}renderMainContainer(){const{dockEnabled:s,currentAlignment:e,currentDockPosition:t,titleId:i,contentId:r,collapsible:n,hasContent:a,contentCollapsed:o,visibleElements:l}=this,{title:h}=this.viewModel,f=e==="bottom-left"||e==="bottom-center"||e==="bottom-right"||t==="top-left"||t==="top-center"||t==="top-right",u=e==="top-left"||e==="top-center"||e==="top-right"||t==="bottom-left"||t==="bottom-center"||t==="bottom-right",p={[M.shadow]:s,[M.isCollapsible]:n,[M.isCollapsed]:o};return _("div",{class:this.classes(M.main,M.widget,p),tabIndex:l.closeButton?void 0:-1,role:"dialog","aria-live":"polite","aria-labelledby":h?i:"","aria-describedby":a&&!o?r:"",bind:this,onkeyup:this._handleMainKeyup,afterCreate:this._mainContainerNodeUpdated,afterUpdate:this._mainContainerNodeUpdated},f?this.renderFooter():null,f?this.renderFeatureMenuContainer():null,this.renderHeader(),this.renderContentContainer(),u?this.renderFooter():null,u?this.renderFeatureMenuContainer():null)}renderContent(){var e;const s=(e=this.viewModel)==null?void 0:e.content;return s?typeof s=="string"?_("div",{class:q.contentNode,key:s,innerHTML:s}):this.renderNodeContent(s):null}renderActionText(s){return _("span",{key:"text",class:M.actionText},s)}renderActionCalciteIcon(s,e){return _("calcite-icon",{scale:"s",key:`calcite-icon-${e}`,icon:s,class:M.icon})}renderActionIcon(s){const e=this._getActionClass(s),t=this._getActionImage(s),i={[M.iconLoading]:s.active,[M.rotating]:s.active,[M.icon]:!!e,[M.actionImage]:!s.active&&!!t};return e&&(i[e]=!s.active),_("span",{key:"icon","aria-hidden":"true",class:this.classes(M.icon,i),styles:this._getIconStyles(t)})}renderAction(s){const{action:e,type:t}=s,i=this._getActionTitle(e),r={[M.action]:e.type!=="toggle",[M.actionToggle]:e.type==="toggle",[M.actionToggleOn]:e.type==="toggle"&&e.value,[M.buttonDisabled]:e.disabled},n=[e.icon&&!e.active?this.renderActionCalciteIcon(e.icon,e.uid):this.renderActionIcon(e),this.renderActionText(i)],a=t==="menu-item"?_("li",{key:e.uid,role:"menuitem",tabIndex:0,title:i,"aria-label":i,class:this.classes(M.button,r),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":e.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},n):_("div",{key:e.uid,role:"button",tabIndex:0,title:i,"aria-label":i,class:this.classes(M.button,r),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":e.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},n);return e.visible?a:null}renderFeatureMenuItem(s,e){const{messages:t,messagesCommon:i}=this,{selectedFeatureIndex:r,selectedFeatureViewModel:n}=this.viewModel,a=s===n,o={[M.featureMenuSelected]:a},l=a?_("span",{key:je(`feature-menu-selected-feature-${r}`),title:t.selectedFeature,"aria-label":t.selectedFeature,class:M.iconCheckMark}):null,h=_("span",{innerHTML:s.title||i.untitled});return _("li",{role:"menuitem",tabIndex:-1,key:je(`feature-menu-feature-${r}`),class:this.classes(o,M.featureMenuItem),bind:this,"data-feature-index":e,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onkeyup:this._handleFeatureMenuItemKeyup,onclick:this._selectFeature,onkeydown:this._selectFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature},_("span",{class:M.featureMenuTitle},h,l))}renderFeatureMenu(){const{featureMenuId:s}=this,{featureViewModels:e}=this.viewModel;return e.length>1?_("ol",{class:M.featureMenuList,id:s,bind:this,afterCreate:this._featureMenuNodeUpdated,afterUpdate:this._featureMenuNodeUpdated,onkeyup:this._handleFeatureMenuKeyup,role:"menu"},e.filter(t=>!!t.graphic).map((t,i)=>this.renderFeatureMenuItem(t,i))):null}_storeFeatureSelectionAction(s,e){this._featureSelectionActions.set(s,e),this.scheduleRender()}_storeExitRelatedRecordsAction(s,e){this._exitRelatedRecordsActions.set(s,e),this.scheduleRender()}_getFlowItemDescription(s){return"featureCountDescription"in s?s.featureCountDescription:s.viewModel.description??""}async _openRelatedFeature(s){await s.viewModel.updateGeometry();const e=s.graphic,t=e==null?void 0:e.geometry;if(t==null||e==null)return;this._destroyFlowItemWidgets(),await this.viewModel.zoomTo({target:t});const i=Gn(t);this.open({features:[e],location:i??void 0})}_destroyFlowItemWidgets(){this._flowItems.removeAll().forEach(s=>{"showAllEnabled"in s.viewModel&&(s.viewModel.showAllEnabled=!1),s.viewModel=null,s.destroy()})}_handleBackClick(){const s=this._flowItems.pop();s&&(this._exitRelatedRecordsActions.delete(s),this._featureSelectionActions.delete(s),"showAllEnabled"in s.viewModel&&(s.viewModel.showAllEnabled=!1),s&&(s.viewModel=null,s.destroy()))}_getActionTitle(s){const{messages:e,selectedFeature:t,messagesCommon:i}=this,{id:r}=s,n=t==null?void 0:t.attributes,a=s.title??"",o=r==="zoom-to-feature"?Fe(a,{messages:e}):r==="remove-selected-feature"?Fe(a,{messages:i}):r==="zoom-to-clustered-features"||r==="browse-clustered-features"?Fe(a,{messages:e}):s.title;return o&&n?Fe(o,n):o??""}_getActionClass(s){const{selectedFeature:e}=this,t=e==null?void 0:e.attributes,{className:i,image:r}=s,n=r||i?i:M.iconDefaultAction;return n&&t?Fe(n,t):n??""}_getActionImage(s){if(s.active)return"";const{selectedFeature:e}=this,t=e==null?void 0:e.attributes,{image:i}=s;return i&&t?Fe(i,t):i??""}_createFeatureUpdatedAnimation(){return $a("enter",M.hasFeatureUpdated)}_getInlineActionCount(){const{maxInlineActions:s,featureNavigationVisible:e}=this;if(typeof s!="number")return null;const t=Math.round(s);return Math.max(e?t-1:t,0)}_watchActions(){const{allActions:s}=this.viewModel;this.notifyChange("dividedActions");const e="actions";this._handles.remove(e),s&&s.forEach(t=>{this._handles.add(F(()=>[t.uid,t.active,t.className,t.disabled,t.id,t.title,t.image,t.visible],()=>this.scheduleRender()),e)})}_divideActions(){const{allActions:s}=this.viewModel,e=s.filter(n=>n.visible),t=this._getInlineActionCount(),i=t===null,r=t===0;return{inlineActions:i?e.slice(0):r?new Ze:e.slice(0,t),menuActions:i?new Ze:r?e.slice(0):e.slice(t)}}_featureMenuOpenChanged(s){s?this._focusFirstFeature=!0:this._focusFeatureMenuButton=!0}_actionsMenuOpenChanged(s){s?this._focusFirstAction=!0:this._focusActionsMenuButton=!0}_setTitleFromFeatureWidget(){var t,i;const{selectedFeatureWidget:s,messagesCommon:e}=this;s&&(this.viewModel.title=((t=s.viewModel)==null?void 0:t.state)==="error"?e.errorMessage:((i=s.viewModel)==null?void 0:i.title)||"")}_setContentFromFeatureWidget(){const{selectedFeatureWidget:s}=this;s&&(this.viewModel.content=s)}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(s){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(s),this._featureMenuIntersectionObserverNode=s}_handleFeatureMenuKeyup(s){Pt(s)==="Escape"&&(s.stopPropagation(),this._focusFeatureMenuButton=!0,this.featureMenuOpen=!1,this.scheduleRender())}_handleActionMenuKeyup(s){Pt(s)==="Escape"&&(s.stopPropagation(),this._focusActionsMenuButton=!0,this.actionsMenuOpen=!1,this.scheduleRender())}_setActiveFeature(s){const{viewModel:e}=this,t=_s(s.currentTarget);e.activeFeature=e.features[t]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_handleFeatureMenuItemKeyup(s){const e=Pt(s),{_featureMenuNode:t}=this,i=_s(s.currentTarget);if(!t)return;const r=t.querySelectorAll("li"),n=r.length;e!=="ArrowUp"?e!=="ArrowDown"?e!=="Home"?e!=="End"||(s.stopPropagation(),r[r.length-1].focus()):(s.stopPropagation(),r[0].focus()):(s.stopPropagation(),r[(i+1+n)%n].focus()):(s.stopPropagation(),r[(i-1+n)%n].focus())}_handleActionMenuItemKeyup(s){const e=Pt(s),{_actionsMenuNode:t}=this,i=s.currentTarget.dataset.actionUid,{menuActions:r}=this.dividedActions,n=r.findIndex(l=>l.uid===i);if(!t)return;const a=t.querySelectorAll("li"),o=a.length;e!=="ArrowUp"?e!=="ArrowDown"?e!=="Home"?e!=="End"||(s.stopPropagation(),a[a.length-1].focus()):(s.stopPropagation(),a[0].focus()):(s.stopPropagation(),a[(n+1+o)%o].focus()):(s.stopPropagation(),a[(n-1+o)%o].focus())}_handleMainKeyup(s){const e=Pt(s);e==="ArrowLeft"&&(s.stopPropagation(),this.previous()),e==="ArrowRight"&&(s.stopPropagation(),this.next())}_spinnerEnabledChange(s){if(this._destroySpinner(),!s)return;const e=this.get("viewModel.view");this._createSpinner(e)}_hideSpinner(){const{_spinner:s}=this;s&&(s.location=null,s.hide())}_displaySpinner(){const{_spinner:s}=this;if(!s)return;const{location:e,waitingForResult:t}=this.viewModel;t&&e?s.show({location:e}):s.hide()}_getIconStyles(s){return{"background-image":s?`url(${s})`:""}}async _shouldFocus(s){s!=null&&s.shouldFocus&&(await La(()=>{var e;return((e=this.viewModel)==null?void 0:e.active)===!0}),this.focus())}_addSelectedFeatureIndexHandle(){const s=F(()=>{var e;return(e=this.viewModel)==null?void 0:e.selectedFeatureIndex},(e,t)=>this._selectedFeatureIndexUpdated(e,t));this._handles.add(s,jr)}_selectedFeatureIndexUpdated(s,e){const{featureCount:t}=this;t&&s!==e&&s!==-1&&(this._destroyFlowItemWidgets(),this.actionsMenuOpen=!1,this.featureMenuOpen=!1,this._mainContainerNode&&(this._mainContainerNode.scrollTop=0),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_destroySelectedFeatureWidget(){const{_feature:s}=this;s&&(s.viewModel=null,s&&!s.destroyed&&s.destroy()),this._feature=null}_isScreenLocationWithinView(s,e){return s.x>-1&&s.y>-1&&s.x<=e.width&&s.y<=e.height}_isOutsideView(s){const{popupHeight:e,popupWidth:t,screenLocation:i,side:r,view:n}=s;if(isNaN(t)||isNaN(e)||!n||!i)return!1;const a=n.padding;return r==="right"&&i.x+t/2>n.width-a.right||r==="left"&&i.x-t/2n.height-a.bottom}_calculateAutoAlignment(s){if(s!=="auto")return s;const{_pointerOffsetInPx:e,_containerNode:t,_mainContainerNode:i,viewModel:r}=this,{screenLocation:n,view:a}=r;if(n==null||!a||!t)return"top-center";if(!this._isScreenLocationWithinView(n,a))return this._get("currentAlignment")||"top-center";function o(w){return parseInt(w.replaceAll(/[^-\d\.]/g,""),10)}const l=i?window.getComputedStyle(i,null):null,h=l?o(l.getPropertyValue("max-height")):0,f=l?o(l.getPropertyValue("height")):0,{height:u,width:p}=t.getBoundingClientRect(),d=p+e,b=Math.max(u,h,f)+e,c=this._isOutsideView({popupHeight:b,popupWidth:d,screenLocation:n,side:"right",view:a}),y=this._isOutsideView({popupHeight:b,popupWidth:d,screenLocation:n,side:"left",view:a}),v=this._isOutsideView({popupHeight:b,popupWidth:d,screenLocation:n,side:"top",view:a}),x=this._isOutsideView({popupHeight:b,popupWidth:d,screenLocation:n,side:"bottom",view:a});return y?v?"bottom-right":"top-right":c?v?"bottom-left":"top-left":v?x?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(s){return typeof s=="function"?s.call(this):s}_getCurrentAlignment(){const{alignment:s,dockEnabled:e}=this;return e||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(s)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(s){const e=["left","right"];return mt(this.container)&&e.reverse(),s==null?void 0:s.replace(/leading/gi,e[0]).replaceAll(/trailing/gi,e[1])}_callDockPosition(s){return typeof s=="function"?s.call(this):s}_getDockPosition(){var s;return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition((s=this.dockOptions)==null?void 0:s.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_wouldDockTo(){return this.dockEnabled?null:this._getDockPosition()}_calculateAutoDockPosition(s){var a;if(s!=="auto")return s;const e=(a=this.viewModel)==null?void 0:a.view,t=mt(this.container)?"top-left":"top-right";if(!e)return t;const i=e.padding||{left:0,right:0,top:0,bottom:0},r=e.width-i.left-i.right,{breakpoints:n}=e;return n&&r<=n.xsmall?"bottom-center":t}_positionContainer(s=this._containerNode){if(s&&(this._containerNode=s),!this._containerNode)return;const{screenLocation:e}=this.viewModel,{width:t}=this._containerNode.getBoundingClientRect(),i=this._calculatePositionStyle(e,t);i&&Object.assign(this._containerNode.style,i)}_calculateFullWidth(s){const{currentAlignment:e,_pointerOffsetInPx:t}=this;return e==="top-left"||e==="bottom-left"||e==="top-right"||e==="bottom-right"?s+t:s}_calculateAlignmentPosition(s,e,t,i){const{currentAlignment:r,_pointerOffsetInPx:n}=this;if(!t)return;const{padding:a}=t,o=i/2,l=t.height-e,h=t.width-s;return r==="bottom-center"?{top:e+n-a.top,left:s-o-a.left}:r==="top-left"?{bottom:l+n-a.bottom,right:h+n-a.right}:r==="bottom-left"?{top:e+n-a.top,right:h+n-a.right}:r==="top-right"?{bottom:l+n-a.bottom,left:s+n-a.left}:r==="bottom-right"?{top:e+n-a.top,left:s+n-a.left}:r==="top-center"?{bottom:l+n-a.bottom,left:s-o-a.left}:void 0}_calculatePositionStyle(s,e){const{dockEnabled:t,view:i}=this;if(!i)return;if(t)return{left:"",top:"",right:"",bottom:""};if(s==null||!e)return;const r=this._calculateFullWidth(e),n=this._calculateAlignmentPosition(s.x,s.y,i,r);return n?{top:n.top!==void 0?`${n.top}px`:"auto",left:n.left!==void 0?`${n.left}px`:"auto",bottom:n.bottom!==void 0?`${n.bottom}px`:"auto",right:n.right!==void 0?`${n.right}px`:"auto"}:void 0}_viewChange(s,e){s&&e&&(this.close(),this.clear())}_viewReadyChange(s,e){if(s){const t=this.get("viewModel.view");this._wireUpView(t)}else e&&(this.close(),this.clear())}_wireUpView(s){if(this._destroySpinner(),!s)return;const{spinnerEnabled:e}=this;e&&this._createSpinner(s),this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(s,e,t){const[i,r]=s,[n,a]=e,{width:o=0,height:l=0}=t??{};return i<=o&&n>o||i>o&&n<=o||r<=l&&a>l||r>l&&a<=l}_updateDockEnabledForViewSize(s,e){if(!s||!e)return;const t=this.get("viewModel.view.padding")||{left:0,right:0,top:0,bottom:0},i=t.left+t.right,r=t.top+t.bottom,n=[],a=[];n[0]=s[0]-i,n[1]=s[1]-r,a[0]=e[0]-i,a[1]=e[1]-r;const{dockOptions:o}=this,l=o.breakpoint;this._dockingThresholdCrossed(n,a,l)&&this._setDockEnabledForViewSize(o),this._setCurrentDockPosition()}_focusDockButtonNode(s){this._focusDockButton&&(this._focusDockButton=!1,s.focus())}_closeButtonNodeUpdated(s){return this._focusClose?(this._focusClose=!1,void s.focus()):this._blurClose?(this._blurClose=!1,void s.blur()):void 0}_mainContainerNodeUpdated(s){return this._mainContainerNode=s,this._focusContainer?(this._focusContainer=!1,void s.focus()):this._blurContainer?(this._blurContainer=!1,void s.blur()):void 0}_featureMenuNodeUpdated(s){if(this._featureMenuNode=s,!s||!this._focusFirstFeature)return;this._focusFirstFeature=!1;const e=s.querySelectorAll("li");e.length&&e[0].focus()}_actionsMenuNodeUpdated(s){if(this._actionsMenuNode=s,!s||!this._focusFirstAction)return;this._focusFirstAction=!1;const e=s.querySelectorAll("li");e.length&&e[0].focus()}_focusFeatureMenuButtonNode(s){this._focusFeatureMenuButton&&(this._focusFeatureMenuButton=!1,s.focus())}_focusActionsMenuButtonNode(s){this._focusActionsMenuButton&&(this._focusActionsMenuButton=!1,s.focus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&(this._featureMenuViewportNode.scrollTop=0)}_toggleScreenLocationEnabled(){const{dockEnabled:s,viewModel:e}=this;if(!e)return;const t=e.active&&!s;e.screenLocationEnabled=t}_shouldDockAtCurrentViewSize(s){var o,l;const e=s.breakpoint,t=(l=(o=this.viewModel)==null?void 0:o.view)==null?void 0:l.ui;if(!t)return!1;const{width:i,height:r}=t;if(isNaN(i)||isNaN(r)||!e)return!1;const n=e.hasOwnProperty("width")&&i<=(e.width??0),a=e.hasOwnProperty("height")&&r<=(e.height??0);return n||a}_setDockEnabledForViewSize(s){s.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(s))}_getPageText(s,e){return this.featureNavigationVisible?Fe(this.messages.pageText,{index:e+1,total:s}):null}_destroySpinner(){var s,e;this._spinner&&((e=(s=this.view)==null?void 0:s.ui)==null||e.remove(this._spinner,Nr),this._spinner.destroy(),this._spinner=null)}_createSpinner(s){s&&(this._spinner=new Cd({view:s}),s.ui.add(this._spinner,{key:Nr,position:"manual",internal:!0}))}_toggleCollapsed(){this.collapsed=!this.collapsed}_close(){this.close(),this.view&&this.view.focus()}_toggleDockEnabled(){this.dockEnabled=!this.dockEnabled,this._focusDockButton=!0,this.scheduleRender()}_toggleFeatureMenu(){const s=!this.featureMenuOpen;this._featureMenuOpenChanged(s),this.actionsMenuOpen=!1,this.featureMenuOpen=s}_toggleActionsMenu(){const s=!this.actionsMenuOpen;this._actionsMenuOpenChanged(s),this.featureMenuOpen=!1,this.actionsMenuOpen=s}_triggerAction(s){const e=s.currentTarget.dataset.actionUid,{allActions:t}=this.viewModel,i=t.findIndex(n=>n.uid===e),r=t.at(i);r&&r.type==="toggle"&&(r.value=!r.value),this.actionsMenuOpen=!1,this.viewModel.triggerAction(i)}_selectFeature(s){const e=_s(s.currentTarget);e==null||isNaN(e)||(this.viewModel.selectedFeatureIndex=e),this.featureMenuOpen=!1,this._focusFeatureMenuButton=!0,this.scheduleRender()}_next(){this.next()}_previous(){this.previous()}};function _s(s){return s==null?void 0:s["data-feature-index"]}g([m({readOnly:!0})],T.prototype,"actionsMenuId",null),g([m({readOnly:!0})],T.prototype,"actionsMenuButtonId",null),g([m({readOnly:!0})],T.prototype,"featureMenuId",null),g([m({readOnly:!0})],T.prototype,"titleId",null),g([m({readOnly:!0})],T.prototype,"contentId",null),g([m({readOnly:!0})],T.prototype,"hasContent",null),g([m({readOnly:!0})],T.prototype,"featureNavigationVisible",null),g([m({readOnly:!0})],T.prototype,"collapsible",null),g([m({readOnly:!0})],T.prototype,"featureMenuVisible",null),g([m({readOnly:!0})],T.prototype,"contentCollapsed",null),g([m({readOnly:!0})],T.prototype,"dividedActions",null),g([m({readOnly:!0,dependsOn:["_flowItems.length"]})],T.prototype,"_activeFlowItemWidget",null),g([m()],T.prototype,"actions",null),g([m()],T.prototype,"actionsMenuOpen",null),g([m()],T.prototype,"alignment",void 0),g([m()],T.prototype,"autoCloseEnabled",null),g([m()],T.prototype,"autoOpenEnabled",null),g([m()],T.prototype,"defaultPopupTemplateEnabled",null),g([m()],T.prototype,"content",null),g([m()],T.prototype,"collapsed",void 0),g([m()],T.prototype,"collapseEnabled",void 0),g([m({readOnly:!0})],T.prototype,"currentAlignment",null),g([m({readOnly:!0})],T.prototype,"currentDockPosition",null),g([m()],T.prototype,"dockOptions",null),g([m()],T.prototype,"dockEnabled",void 0),g([m({readOnly:!0})],T.prototype,"featureCount",null),g([m()],T.prototype,"featureMenuOpen",null),g([m()],T.prototype,"features",null),g([m()],T.prototype,"goToOverride",null),g([m()],T.prototype,"headingLevel",void 0),g([m()],T.prototype,"highlightEnabled",null),g([m()],T.prototype,"location",null),g([m()],T.prototype,"label",null),g([m()],T.prototype,"maxInlineActions",void 0),g([m(),Te("esri/widgets/Popup/t9n/Popup")],T.prototype,"messages",void 0),g([m(),Te("esri/t9n/common")],T.prototype,"messagesCommon",void 0),g([m()],T.prototype,"promises",null),g([m({readOnly:!0})],T.prototype,"selectedFeature",null),g([m()],T.prototype,"selectedFeatureIndex",null),g([m({readOnly:!0})],T.prototype,"selectedFeatureWidget",null),g([m()],T.prototype,"spinnerEnabled",void 0),g([m()],T.prototype,"title",null),g([m()],T.prototype,"updateLocationEnabled",null),g([m()],T.prototype,"view",null),g([m({type:Xn}),za(["triggerAction","trigger-action"])],T.prototype,"viewModel",void 0),g([m()],T.prototype,"visible",null),g([m()],T.prototype,"visibleElements",void 0),g([yt("visibleElements")],T.prototype,"castVisibleElements",null),g([Ye()],T.prototype,"_close",null),g([Ye()],T.prototype,"_toggleDockEnabled",null),g([Ye()],T.prototype,"_toggleFeatureMenu",null),g([Ye()],T.prototype,"_toggleActionsMenu",null),g([Ye()],T.prototype,"_triggerAction",null),g([Ye()],T.prototype,"_selectFeature",null),g([Ye()],T.prototype,"_next",null),g([Ye()],T.prototype,"_previous",null),T=g([X("esri.widgets.Popup")],T);const Nd=T,ac=Object.freeze(Object.defineProperty({__proto__:null,default:Nd},Symbol.toStringTag,{value:"Module"}));export{wl as $,Me as A,Pu as B,mr as C,Cu as D,Si as E,Ot as F,ie as G,wu as H,Mu as I,Pe as J,zl as K,js as L,Ts as M,Ru as N,ke as O,ul as P,xi as Q,He as R,xu as S,sh as T,li as U,ku as V,bu as W,I as X,Tt as Y,G as Z,dl as _,U as a,ac as a0,Au as b,k as c,Xl as d,Kl as e,B as f,fe as g,Cs as h,En as i,_e as j,xn as k,D as l,qe as m,we as n,As as o,El as p,Zt as q,pl as r,Yl as s,lh as t,ei as u,Qe as v,bl as w,ct as x,se as y,Q as z}; diff --git a/assets/PopupSceneLayerView-c49dd096.js b/assets/PopupSceneLayerView-c49dd096.js new file mode 100644 index 0000000..ea70530 --- /dev/null +++ b/assets/PopupSceneLayerView-c49dd096.js @@ -0,0 +1 @@ +import{ai as y,al as d,ar as o,dL as f,dM as w}from"./index-080e108a.js";import{p as c,n as F}from"./popupUtils-f04ec9a9.js";const v=h=>{let r=class extends h{_validateFetchPopupFeatures(p){const{layer:e}=this,{popupEnabled:t}=e;if(!t)throw new o("scenelayerview3d:fetchPopupFeatures","Popups are disabled",{layer:e});if(!c(e,p))throw new o("scenelayerview3d:fetchPopupFeatures","Layer does not define a popup template",{layer:e})}async prepareFetchPopupFeatures(p){}async fetchPopupFeatures(p,e){this._validateFetchPopupFeatures(e);const t=e!=null?e.clientGraphics:null;if(!t||t.length===0)return[];const u=this.layer.type==="scene"&&this.layer.associatedLayer!=null?this.layer.associatedLayer:this.layer;let i=[];"fieldsIndex"in this.layer&&(i=f(this.layer.fieldsIndex,await F(u,c(this.layer,e)))),await this.prepareFetchPopupFeatures(i);const l=new Set,n=[],s=[];for(const a of t)w(i,a,l)?s.push(a):n.push(a);return s.length===0?n:this.whenGraphicAttributes(s,[...l]).catch(()=>s).then(a=>n.concat(a))}};return r=y([d("esri.views.3d.layers.support.PopupSceneLayerView")],r),r};export{v as i}; diff --git a/assets/PortalLayer-310c2800.js b/assets/PortalLayer-310c2800.js new file mode 100644 index 0000000..1aef91d --- /dev/null +++ b/assets/PortalLayer-310c2800.js @@ -0,0 +1,2 @@ +import{ai as l,aj as c,b5 as f,ay as w,bY as $,al as E,ah as b,aw as U,ax as H,bn as F,bz as L,as as n,bZ as T,b_ as O,b$ as j,c0 as y,b9 as I,c1 as v,b7 as x,at as D,c2 as M,c3 as R,ar as S}from"./index-080e108a.js";import{f as P}from"./portalItemUtils-792a27e1.js";const A=_=>{let i=class extends _{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=b(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(r){r!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",r))}readPortalItem(r,t,e){if(t.itemId)return new f({id:t.itemId,portal:e&&e.portal})}writePortalItem(r,t){r&&r.id&&(t.itemId=r.id)}async loadFromPortal(r,t){if(this.portalItem&&this.portalItem.id)try{const{load:e}=await U(()=>import("./layersLoader-0106cc6e.js"),["assets/layersLoader-0106cc6e.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/fetchService-82a8c4d0.js","assets/jsonContext-5f3816dc.js","assets/portalItemUtils-792a27e1.js","assets/styleUtils-25825fd6.js"]);return H(t),await e({instance:this,supportedTypes:r.supportedTypes,validateItem:r.validateItem,supportsData:r.supportsData,layerModuleTypeMap:r.layerModuleTypeMap},t)}catch(e){throw F(e)||L.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id}) + ${e}`),e}}async finishLoadEditablePortalLayer(r){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(r).catch(t=>(n(t),!0)))}async _setUserPrivileges(r,t){if(!T.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:e,fullEdit:s},content:{updateItem:a}}=await this._fetchUserPrivileges(r,t);this._set("userHasEditingPrivileges",e),this._set("userHasFullEditingPrivileges",s),this._set("userHasUpdateItemPrivileges",a)}catch(e){n(e)}}async _fetchUserPrivileges(r,t){var p;let e=this.portalItem;if(!r||!e||!e.loaded||e.sourceUrl)return this._fetchFallbackUserPrivileges(t);const s=r===e.id;if(s&&e.portal.user)return P(e);let a,h;if(s)a=e.portal.url;else try{a=await O(this.url,t)}catch(o){n(o)}if(!a||!j(a,e.portal.url))return this._fetchFallbackUserPrivileges(t);try{const o=t!=null?t.signal:null;h=await((p=y)==null?void 0:p.getCredential(`${a}/sharing`,{prompt:!1,signal:o}))}catch(o){n(o)}const m=!0,u=!1,d=!1;if(!h)return{features:{edit:m,fullEdit:u},content:{updateItem:d}};try{if(s?await e.reload():(e=new f({id:r,portal:{url:a}}),await e.load(t)),e.portal.user)return P(e)}catch(o){n(o)}return{features:{edit:m,fullEdit:u},content:{updateItem:d}}}async _fetchFallbackUserPrivileges(r){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(r)}catch(e){n(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(r){var s;const t=this.url?(s=y)==null?void 0:s.findCredential(this.url):null;if(!t)return!0;const e=g.credential===t?g.user:await this._fetchEditingUser(r);return g.credential=t,g.user=e,e==null||e.privileges==null||e.privileges.includes("features:user:edit")}async _fetchEditingUser(r){var d,p;const t=(p=(d=this.portalItem)==null?void 0:d.portal)==null?void 0:p.user;if(t)return t;const e=y.findServerInfo(this.url??"");if(!(e!=null&&e.owningSystemUrl))return null;const s=`${e.owningSystemUrl}/sharing/rest`,a=I.getDefault();if(a&&a.loaded&&v(a.restUrl)===v(s))return a.user;const h=`${s}/community/self`,m=r!=null?r.signal:null,u=await x(D(h,{authMode:"no-prompt",query:{f:"json"},signal:m}));return u.ok?M.fromJSON(u.value.data):null}read(r,t){t&&(t.layer=this),super.read(r,t)}write(r,t){const e=t&&t.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||I.getDefault());return e&&s&&!R(s.restUrl,e.restUrl)?(t.messages&&t.messages.push(new S("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(r,{...t,layer:this})}};return l([c({type:f})],i.prototype,"portalItem",null),l([w("web-document","portalItem",["itemId"])],i.prototype,"readPortalItem",null),l([$("web-document","portalItem",{itemId:{type:String}})],i.prototype,"writePortalItem",null),l([c({clonable:!1})],i.prototype,"resourceReferences",void 0),l([c({type:Boolean,readOnly:!0})],i.prototype,"userHasEditingPrivileges",void 0),l([c({type:Boolean,readOnly:!0})],i.prototype,"userHasFullEditingPrivileges",void 0),l([c({type:Boolean,readOnly:!0})],i.prototype,"userHasUpdateItemPrivileges",void 0),i=l([E("esri.layers.mixins.PortalLayer")],i),i},g={credential:null,user:null};export{A as j}; diff --git a/assets/Precipitation.glsl-5b05b6be.js b/assets/Precipitation.glsl-5b05b6be.js new file mode 100644 index 0000000..999e3e6 --- /dev/null +++ b/assets/Precipitation.glsl-5b05b6be.js @@ -0,0 +1 @@ +import{d as r}from"./index-080e108a.js";export{r as build}; diff --git a/assets/Query-1c961d4c.js b/assets/Query-1c961d4c.js new file mode 100644 index 0000000..d712fb8 --- /dev/null +++ b/assets/Query-1c961d4c.js @@ -0,0 +1 @@ +import{ai as e,d2 as p,aj as t,ck as u,eZ as U,al as c,bc as P,fy as G,jA as z,ay as _,f4 as C,cj as K,lY as k,cw as H,cq as Q,cz as X,cp as x,cl as T,ca as Z,bY as g,jo as J,cr as W,cs as Y,c7 as ee,cR as te}from"./index-080e108a.js";var $;let f=$=class extends u{constructor(r){super(r),this.type="map-layer"}clone(){const{mapLayerId:r,gdbVersion:i}=this;return new $({mapLayerId:r,gdbVersion:i})}};e([p({mapLayer:"map-layer"})],f.prototype,"type",void 0),e([t({type:U,json:{write:!0}})],f.prototype,"mapLayerId",void 0),e([t({type:String,json:{write:!0}})],f.prototype,"gdbVersion",void 0),f=$=e([c("esri.layers.support.source.MapLayerSource")],f);var O;let y=O=class extends u{constructor(r){super(r),this.type="query-table"}clone(){const{workspaceId:r,query:i,oidFields:s,spatialReference:n,geometryType:d}=this,m={workspaceId:r,query:i,oidFields:s,spatialReference:(n==null?void 0:n.clone())??void 0,geometryType:d};return new O(m)}};e([p({queryTable:"query-table"})],y.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],y.prototype,"workspaceId",void 0),e([t({type:String,json:{write:!0}})],y.prototype,"query",void 0),e([t({type:String,json:{write:!0}})],y.prototype,"oidFields",void 0),e([t({type:P,json:{write:!0}})],y.prototype,"spatialReference",void 0),e([p(G)],y.prototype,"geometryType",void 0),y=O=e([c("esri.layers.support.source.QueryTableDataSource")],y);var V;let b=V=class extends u{constructor(r){super(r),this.type="raster"}clone(){const{workspaceId:r,dataSourceName:i}=this;return new V({workspaceId:r,dataSourceName:i})}};e([p({raster:"raster"})],b.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],b.prototype,"dataSourceName",void 0),e([t({type:String,json:{write:!0}})],b.prototype,"workspaceId",void 0),b=V=e([c("esri.layers.support.source.RasterDataSource")],b);var D;let v=D=class extends u{constructor(r){super(r),this.type="table"}clone(){const{workspaceId:r,gdbVersion:i,dataSourceName:s}=this;return new D({workspaceId:r,gdbVersion:i,dataSourceName:s})}};e([p({table:"table"})],v.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"workspaceId",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"gdbVersion",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"dataSourceName",void 0),v=D=e([c("esri.layers.support.source.TableDataSource")],v);var M,I;const re=z()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let a=M=class extends u{constructor(r){super(r),this.type="join-table"}readLeftTableSource(r,i,s){return A()(r,i,s)}castLeftTableSource(r){return k(N(),r)}readRightTableSource(r,i,s){return A()(r,i,s)}castRightTableSource(r){return k(N(),r)}clone(){const{leftTableKey:r,rightTableKey:i,leftTableSource:s,rightTableSource:n,joinType:d}=this,m={leftTableKey:r,rightTableKey:i,leftTableSource:(s==null?void 0:s.clone())??void 0,rightTableSource:(n==null?void 0:n.clone())??void 0,joinType:d};return new M(m)}};e([p({joinTable:"join-table"})],a.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],a.prototype,"leftTableKey",void 0),e([t({type:String,json:{write:!0}})],a.prototype,"rightTableKey",void 0),e([t({json:{write:!0}})],a.prototype,"leftTableSource",void 0),e([_("leftTableSource")],a.prototype,"readLeftTableSource",null),e([C("leftTableSource")],a.prototype,"castLeftTableSource",null),e([t({json:{write:!0}})],a.prototype,"rightTableSource",void 0),e([_("rightTableSource")],a.prototype,"readRightTableSource",null),e([C("rightTableSource")],a.prototype,"castRightTableSource",null),e([p(re)],a.prototype,"joinType",void 0),a=M=e([c("esri.layers.support.source.JoinTableDataSource")],a);let R=null;function A(){return R||(R=H({types:N()})),R}let F=null;function N(){return F||(F={key:"type",base:null,typeMap:{"data-layer":h,"map-layer":f}}),F}const oe={key:"type",base:null,typeMap:{"join-table":a,"query-table":y,raster:b,table:v}};let h=I=class extends u{constructor(r){super(r),this.type="data-layer"}clone(){const{fields:r,dataSource:i}=this;return new I({fields:r,dataSource:i})}};e([p({dataLayer:"data-layer"})],h.prototype,"type",void 0),e([t({type:[Q],json:{write:!0}})],h.prototype,"fields",void 0),e([t({types:oe,json:{write:!0}})],h.prototype,"dataSource",void 0),h=I=e([c("esri.layers.support.source.DataLayerSource")],h),h.from=K(h);let w=class extends X(u){constructor(i){super(i),this.onFields=null,this.operator=null,this.searchTerm=null,this.searchType=null}};e([t({type:[String],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.onFields!=null&&this.onFields.length>0}}}}})],w.prototype,"onFields",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"operator",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"searchTerm",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"searchType",void 0),w=e([c("esri.rest.support.FullTextSearch")],w);const ie=w;var E;const B=new x({upperLeft:"upper-left",lowerLeft:"lower-left"});let S=E=class extends u{constructor(r){super(r),this.extent=null,this.mode="view",this.originPosition="upper-left",this.tolerance=1}clone(){return new E(T({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};e([t({type:Z,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],S.prototype,"extent",void 0),e([t({type:["view","edit"],json:{write:!0}})],S.prototype,"mode",void 0),e([t({type:String,json:{read:B.read,write:B.write}})],S.prototype,"originPosition",void 0),e([t({type:Number,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],S.prototype,"tolerance",void 0),S=E=e([c("esri.rest.support.QuantizationParameters")],S);const se=S;var L;const q=new x({count:"count",sum:"sum",min:"min",max:"max",avg:"avg",stddev:"stddev",var:"var",exceedslimit:"exceedslimit",percentile_cont:"percentile-continuous",percentile_disc:"percentile-discrete",EnvelopeAggregate:"envelope-aggregate",CentroidAggregate:"centroid-aggregate",ConvexHullAggregate:"convex-hull-aggregate"});let l=L=class extends u{constructor(r){super(r),this.maxPointCount=void 0,this.maxRecordCount=void 0,this.maxVertexCount=void 0,this.onStatisticField=null,this.outStatisticFieldName=null,this.statisticType=null,this.statisticParameters=null}writeStatisticParameters(r,i){this.statisticType!=="percentile-continuous"&&this.statisticType!=="percentile-discrete"||(i.statisticParameters=T(r))}clone(){return new L({maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,statisticType:this.statisticType,statisticParameters:T(this.statisticParameters)})}};e([t({type:Number,json:{write:!0}})],l.prototype,"maxPointCount",void 0),e([t({type:Number,json:{write:!0}})],l.prototype,"maxRecordCount",void 0),e([t({type:Number,json:{write:!0}})],l.prototype,"maxVertexCount",void 0),e([t({type:String,json:{write:!0}})],l.prototype,"onStatisticField",void 0),e([t({type:String,json:{write:!0}})],l.prototype,"outStatisticFieldName",void 0),e([t({type:String,json:{read:{source:"statisticType",reader:q.read},write:{target:"statisticType",writer:q.write}}})],l.prototype,"statisticType",void 0),e([t({type:Object})],l.prototype,"statisticParameters",void 0),e([g("statisticParameters")],l.prototype,"writeStatisticParameters",null),l=L=e([c("esri.rest.support.StatisticDefinition")],l);const ae=l;var j;const ne=new x({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),le=new x({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let o=j=class extends u{static from(r){return J(j,r)}constructor(r){super(r),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.where=null}castDatumTransformation(r){return typeof r=="number"||typeof r=="object"?r:null}writeHistoricMoment(r,i){i.historicMoment=r&&r.getTime()}writeParameterValues(r,i){if(r){const s={};for(const n in r){const d=r[n];Array.isArray(d)?s[n]=d.map(m=>m instanceof Date?m.getTime():m):d instanceof Date?s[n]=d.getTime():s[n]=d}i.parameterValues=s}}writeStart(r,i){i.resultOffset=this.start,i.resultRecordCount=this.num||10,i.where="1=1"}writeWhere(r,i){i.where=r||"1=1"}clone(){return new j(T({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:this.historicMoment!=null?new Date(this.historicMoment.getTime()):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,where:this.where}))}};o.MAX_MAX_RECORD_COUNT_FACTOR=5,e([t({json:{write:!0}})],o.prototype,"aggregateIds",void 0),e([t({type:Boolean,json:{write:!0}})],o.prototype,"cacheHint",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"compactGeometryEnabled",void 0),e([t({json:{write:!0}})],o.prototype,"datumTransformation",void 0),e([C("datumTransformation")],o.prototype,"castDatumTransformation",null),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"defaultSpatialReferenceEnabled",void 0),e([t({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],o.prototype,"distance",void 0),e([t({type:h,json:{write:!0}})],o.prototype,"dynamicDataSource",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"formatOf3DObjects",void 0),e([t({type:[ie],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.fullText!=null&&this.fullText.length>0}}}}})],o.prototype,"fullText",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"gdbVersion",void 0),e([t({types:W,json:{read:Y,write:!0}})],o.prototype,"geometry",void 0),e([t({type:Number,json:{write:!0}})],o.prototype,"geometryPrecision",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"groupByFieldsForStatistics",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"having",void 0),e([t({type:Date})],o.prototype,"historicMoment",void 0),e([g("historicMoment")],o.prototype,"writeHistoricMoment",null),e([t({type:Number,json:{write:!0}})],o.prototype,"maxAllowableOffset",void 0),e([t({type:Number,cast:r=>r<1?1:r>j.MAX_MAX_RECORD_COUNT_FACTOR?j.MAX_MAX_RECORD_COUNT_FACTOR:r,json:{write:{overridePolicy:r=>({enabled:r>1})}}})],o.prototype,"maxRecordCountFactor",void 0),e([t({type:["xyFootprint"],json:{write:!0}})],o.prototype,"multipatchOption",void 0),e([t({type:Number,json:{read:{source:"resultRecordCount"}}})],o.prototype,"num",void 0),e([t({json:{write:!0}})],o.prototype,"objectIds",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"outFields",void 0),e([t({type:P,json:{name:"outSR",write:!0}})],o.prototype,"outSpatialReference",void 0),e([t({type:[ae],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],o.prototype,"outStatistics",void 0),e([t({json:{write:!0}})],o.prototype,"parameterValues",void 0),e([g("parameterValues")],o.prototype,"writeParameterValues",null),e([t({type:ee,json:{write:!0}})],o.prototype,"pixelSize",void 0),e([t({type:se,json:{write:!0}})],o.prototype,"quantizationParameters",void 0),e([t({type:[Object],json:{write:!0}})],o.prototype,"rangeValues",void 0),e([t({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:this.spatialRelationship==="relation"}}}}})],o.prototype,"relationParameter",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"resultType",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnCentroid",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnDistinctValues",void 0),e([t({type:Boolean,json:{default:!0,write:!0}})],o.prototype,"returnExceededLimitFeatures",void 0),e([t({type:Boolean,json:{write:!0}})],o.prototype,"returnGeometry",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnQueryGeometry",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnM",void 0),e([t({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],o.prototype,"returnZ",void 0),e([t({type:P,json:{write:!0}})],o.prototype,"sourceSpatialReference",void 0),e([p(ne,{ignoreUnknown:!1,name:"spatialRel"})],o.prototype,"spatialRelationship",void 0),e([t({type:Number,json:{read:{source:"resultOffset"}}})],o.prototype,"start",void 0),e([g("start"),g("num")],o.prototype,"writeStart",null),e([t({type:String,json:{write:!0}})],o.prototype,"sqlFormat",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"text",void 0),e([t({type:te,json:{write:!0}})],o.prototype,"timeExtent",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"timeReferenceUnknownClient",void 0),e([p(le,{ignoreUnknown:!1}),t({json:{write:{overridePolicy(r){return{enabled:!!r&&this.distance!=null&&this.distance>0}}}}})],o.prototype,"units",void 0),e([t({type:String,json:{write:{overridePolicy(r){return{enabled:r!=null||this.start!=null&&this.start>0}}}}})],o.prototype,"where",void 0),e([g("where")],o.prototype,"writeWhere",null),o=j=e([c("esri.rest.support.Query")],o);const ce=o;export{h as K,se as a,ce as b,f as c,ae as m}; diff --git a/assets/QueryEngine-19eda5ff.js b/assets/QueryEngine-19eda5ff.js new file mode 100644 index 0000000..0e0bc04 --- /dev/null +++ b/assets/QueryEngine-19eda5ff.js @@ -0,0 +1 @@ +import{gQ as ot,nx as ut,cM as T,ny as je,dE as he,gR as Oe,dZ as ct,bd as ht,eA as G,cp as J,nz as dt,nA as ae,nB as ft,nC as ne,cs as le,dH as N,ct as L,dI as mt,aB as pt,jD as yt,kw as gt,eo as Se,aw as de,bM as H,nD as oe,nE as xt,nF as _t,nG as St,bx as we,ar as R,bA as Ze,nH as wt,nI as Ft,ey as Fe,nJ as Re,nK as Rt,nL as It,nM as bt,nN as vt,nO as At,nP as Ie,nQ as Tt,nR as $t,es as Vt,nS as Et,nT as Mt,hV as be,ah as ve,ax as zt,nc as Qt,jh as Pt,dw as Ct,jj as qt,cZ as te,nU as Ae,cl as Te,bP as Nt,eq as Gt,jE as $e,dJ as Dt,dz as jt,bQ as Ot}from"./index-080e108a.js";import{b as ue}from"./normalizeUtils-cf8b8053.js";import{f as Zt}from"./WhereClause-c86b9974.js";import{t as Be}from"./json-48e3ea08.js";import{t as Bt}from"./QueryEngineCapabilities-42e44ded.js";import{c as ie,z as kt,m as Ut,f as Ve,d as Ee,g as Lt,x as Ht,F as Jt,D as Yt,S as Wt,M as Kt,v as Xt,p as ei}from"./utils-2fe9d339.js";import{r as ti}from"./FieldsIndex-f79a8f26.js";const se=[0,0];function ke(n,e){if(!e)return null;if("x"in e){const t={x:0,y:0};return[t.x,t.y]=n(e.x,e.y,se),e.z!=null&&(t.z=e.z),e.m!=null&&(t.m=e.m),t}if("xmin"in e){const t={xmin:0,ymin:0,xmax:0,ymax:0};return[t.xmin,t.ymin]=n(e.xmin,e.ymin,se),[t.xmax,t.ymax]=n(e.xmax,e.ymax,se),e.hasZ&&(t.zmin=e.zmin,t.zmax=e.zmax,t.hasZ=!0),e.hasM&&(t.mmin=e.mmin,t.mmax=e.mmax,t.hasM=!0),t}return"rings"in e?{rings:Me(e.rings,n),hasM:e.hasM,hasZ:e.hasZ}:"paths"in e?{paths:Me(e.paths,n),hasM:e.hasM,hasZ:e.hasZ}:"points"in e?{points:Ue(e.points,n),hasM:e.hasM,hasZ:e.hasZ}:null}function Me(n,e){const t=[];for(const i of n)t.push(Ue(i,e));return t}function Ue(n,e){const t=[];for(const i of n){const s=e(i[0],i[1],[0,0]);t.push(s),i.length>2&&s.push(i[2]),i.length>3&&s.push(i[3])}return t}async function Z(n,e){if(!n||!e)return;const t=Array.isArray(n)?n.map(i=>i.geometry!=null?i.geometry.spatialReference:null).filter(ct):[n];await ht(t.map(i=>({source:i,dest:e})))}const Le=ke.bind(null,ot),He=ke.bind(null,ut);function E(n,e,t,i){if(!n||(t||(t=e,e=n.spatialReference),!G(e)||!G(t)||T(e,t)))return n;if(je(e,t)){const s=he(t)?Le(n):He(n);return s.spatialReference=t,s}return Oe(Be,[n],e,t,null,i)[0]}let ii=class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,i){if(!e||!e.length||!t||!i||T(t,i))return e;const s={geometries:e,inSpatialReference:t,outSpatialReference:i,resolve:null};return this._jobs.push(s),new Promise(r=>{s.resolve=r,this._timer===null&&(this._timer=setTimeout(this._process,10))})}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:i,outSpatialReference:s,resolve:r}=e;je(i,s)?he(s)?r(t.map(Le)):r(t.map(He)):r(Oe(Be,t,i,s,null,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};const si=new ii;function ri(n,e,t){return si.push(n,e,t)}const ai=new J({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),P=Object.freeze({}),ze=new H,ni=new H,ce=new H,V={esriGeometryPoint:oe,esriGeometryPolyline:xt,esriGeometryPolygon:_t,esriGeometryMultipoint:St};function Qe(n,e,t,i=n.hasZ,s=n.hasM){if(e==null)return null;const r=n.hasZ&&i,a=n.hasM&&s;if(t){const l=ae(ce,e,n.hasZ,n.hasM,"esriGeometryPoint",t,i,s);return oe(l,r,a)}return oe(e,r,a)}function M(n,e,t,i,s,r,a=e,l=t){var d,h,f;const o=e&&a,u=t&&l,c=i!=null?"coords"in i?i:i.geometry:null;if(c==null)return null;if(s){let m=dt(ni,c,e,t,n,s,a,l);return r&&(m=ae(ce,m,o,u,n,r)),((d=V[n])==null?void 0:d.call(V,m,o,u))??null}if(r){const m=ae(ce,c,e,t,n,r,a,l);return((h=V[n])==null?void 0:h.call(V,m,o,u))??null}return ft(ze,c,e,t,a,l),((f=V[n])==null?void 0:f.call(V,ze,o,u))??null}async function Pe(n,e,t){const{outFields:i,orderByFields:s,groupByFieldsForStatistics:r,outStatistics:a}=n;if(i)for(let l=0;lE(i,Se));return(await ci())(a.spatialReference,a,e,r)}async function ci(){return(await de(()=>import("./geometryEngineJSON-c939b27e.js"),["assets/geometryEngineJSON-c939b27e.js","assets/geometryEngineBase-324c1c81.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/geometryEngineJSON-b173802a.js","assets/json-48e3ea08.js"])).geodesicBuffer}function k(n){return n&&Ye in n?JSON.parse(JSON.stringify(n,hi)):n}const Ye="_geVersion",hi=(n,e)=>n!==Ye?e:void 0;let di=class{constructor(e,t){this._cache=new we(e),this._invalidCache=new we(t)}get(e,t){const i=`${t.uid}:${e}`,s=this._cache.get(i);if(s)return s;if(this._invalidCache.get(i)!==void 0)return null;try{const r=Zt.create(e,t);return this._cache.put(i,r),r}catch{return this._invalidCache.put(i,null),null}}};const We=new di(50,500),U="feature-store:unsupported-query",Ke=" as ",Xe=new J({esriFieldTypeString:"string"}),X=new J({esriFieldTypeOID:"oid",esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long"}),ee=new J({esriFieldTypeDate:"date"}),et=new J({esriFieldTypeGUID:"guid",esriFieldTypeGlobalId:"global-id"}),fi=new Set([...X.jsonValues,...ee.jsonValues,...Xe.jsonValues,...et.jsonValues]),Ce=new Intl.ListFormat("en-US",{type:"conjunction"}).format([...X.apiValues,...ee.apiValues,...Xe.apiValues,...et.apiValues]);function fe(n,e,t={}){const i=O(n,e);if(!i)throw new R(U,"invalid SQL expression",{expression:n});const s=t.expressionName||"expression";if(t.validateStandardized&&!i.isStandardized)throw new R(U,`${s} is not standard`,{expression:n});if(t.validateAggregate&&!i.isAggregate)throw new R(U,`${s} does not contain a valid aggregate function`,{expression:n});return i.fieldNames}function mi(n,e,t){if(!e)return!0;const i="where clause",s=fe(e,n,{validateStandardized:!0,expressionName:i});return q(n,s,{expressionName:i,query:t}),me(n,s,{expressionName:i,query:t}),!0}function pi(n,e,t,i){if(!e)return!0;const s="having",r=fe(e,n,{validateAggregate:!0,expressionName:s});q(n,r,{expressionName:s,query:i}),me(n,r,{expressionName:s,query:i});const a=We.get(e,n);if(!(a==null?void 0:a.getExpressions().every(o=>{var h;const{aggregateType:u,field:c}=o,d=(h=n.get(c))==null?void 0:h.name;return t.some(f=>{var x;const{onStatisticField:m,statisticType:p}=f;return((x=n.get(m))==null?void 0:x.name)===d&&p.toLowerCase().trim()===u})})))throw new R(U,"expressions in having should also exist in outStatistics",{having:e});return!0}function O(n,e){return n?We.get(n,e):null}function q(n,e,t={}){t.errorMessage||(t.errorMessage=t.expressionName?`${t.expressionName} contains invalid fields`:"Fields are invalid"),pe(n,e,(i,s)=>s.has(i),t)}function me(n,e,t={}){t.errorMessage||(t.errorMessage=t.expressionName?`${t.expressionName} only supports ${Ce} field types`:`Only ${Ce} field types are supported`),pe(n,e,(i,s)=>!it(i,s),t)}function pe(n,e,t,i={}){const s=i.verifyExpression??!0,r=[];for(const a of e){const l=t(a,n);if(a!=="*"&&!l)if(s){const o=tt(a);try{pe(n,fe(o,n,{validateStandardized:!0}),t,i)}catch(u){const c=u==null?void 0:u.details;if(c!=null&&c.expression)throw u;c!=null&&c.invalidFields?r.push(...c.invalidFields):r.push(a)}}else r.push(a)}if(r.length)throw new R(U,i.errorMessage,{invalidFields:r,query:i.query})}function tt(n){return n.split(Ke)[0]}function yi(n){return n.split(Ke)[1]}function it(n,e,t=fi){const i=e.get(n);return!!i&&!t.has(i.type)}let W=class{constructor(e,t,i){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=i,this.featureAdapter=t;const s=e.outFields;if(s&&!s.includes("*")){this.outFields=s;let r=0;for(const a of s){const l=tt(a),o=this.fieldsIndex.get(l),u=o?null:O(l,i),c=o?o.name:yi(a)||"FIELD_EXP_"+r++;this._fieldDataCache.set(a,{alias:c,clause:u})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach(t=>this.getAttributes(t)),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,i){var a;const s=i?i.name:t;let r=null;return this._fieldDataCache.has(s)?r=(a=this._fieldDataCache.get(s))==null?void 0:a.clause:i||(r=O(t,this.fieldsIndex),this._fieldDataCache.set(s,{alias:s,clause:r})),i?this.featureAdapter.getAttribute(e,s):r==null?void 0:r.calculateValue(e,this.featureAdapter)}getDataValues(e,t){const i=t.normalizationType,s=t.normalizationTotal;return e.map(r=>{let a=t.field&&this.getFieldValue(r,t.field,this.fieldsIndex.get(t.field));if(t.field2&&(a=`${ie(a)}${t.fieldDelimiter}${ie(this.getFieldValue(r,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(a=`${a}${t.fieldDelimiter}${ie(this.getFieldValue(r,t.field3,this.fieldsIndex.get(t.field3)))}`)),i&&Number.isFinite(a)){const l=i==="field"&&t.normalizationField?this.getFieldValue(r,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;a=kt(a,i,l,s)}return a})}async getExpressionValues(e,t,i,s){const{arcadeUtils:r}=await Ze(),a=r.hasGeometryOperations(t);a&&await r.enableGeometryOperations();const l=r.createFunction(t),o=i&&r.getViewInfo(i),u={fields:this.fieldsIndex.fields};return e.map(c=>{const d={attributes:this.featureAdapter.getAttributes(c),layer:u,geometry:a?{...M(s.geometryType,s.hasZ,s.hasM,this.featureAdapter.getGeometry(c)),spatialReference:i==null?void 0:i.spatialReference}:null},h=r.createExecContext(d,o);return r.executeFunction(l,h)})}validateItem(e,t){var i,s;return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:O(t,this.fieldsIndex)}),((s=(i=this._fieldDataCache.get(t))==null?void 0:i.clause)==null?void 0:s.testFeature(e,this.featureAdapter))??!1}validateItems(e,t){var i,s;return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:O(t,this.fieldsIndex)}),((s=(i=this._fieldDataCache.get(t))==null?void 0:i.clause)==null?void 0:s.testSet(e,this.featureAdapter))??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!t||!t.length)return this.featureAdapter.getAttributes(e);const i={};for(const s of t){const{alias:r,clause:a}=this._fieldDataCache.get(s);i[r]=a?a.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,r)}return i}_processAttributesForDistinctValues(e){if(e==null||!this.returnDistinctValues)return e;const t=this.outFields,i=[];if(t)for(const a of t){const{alias:l}=this._fieldDataCache.get(a);i.push(e[l])}else for(const a in e)i.push(e[a]);const s=`${(t||["*"]).join(",")}=${i.join(",")}`;let r=this._returnDistinctMap.get(s)||0;return this._returnDistinctMap.set(s,++r),r>1?null:e}};class b{constructor(e,t,i){this.items=e,this.query=t,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new W(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:i,outStatistics:s}=this.query;if(!(t==null?void 0:t.length))return 1;const a=new Map,l=new Map,o=new Set;for(const u of s){const{statisticType:c}=u,d=c!=="exceedslimit"?u.onStatisticField:void 0;if(!l.has(d)){const f=[];for(const m of t){const p=this._getAttributeValues(e,m,a);f.push(p)}l.set(d,this._calculateUniqueValues(f,e.returnDistinctValues))}const h=l.get(d);for(const f in h){const{data:m,items:p}=h[f],S=m.join(",");i&&!e.validateItems(p,i)||o.add(S)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics?e=this.query.outStatistics.some(t=>t.statisticType==="exceedslimit")?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):e=this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;G(this.query.outSR)&&!T(t.spatialReference,this.query.outSR)?e.queryGeometry=k({spatialReference:this.query.outSR,...E(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=k({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const i=this.featureAdapter,s=qe(this.hasZ,this.hasM),{point:r,mode:a}=e,l=typeof e.distance=="number"?e.distance:e.distance.x,o=typeof e.distance=="number"?e.distance:e.distance.y,u={candidates:[]},c=this.geometryType==="esriGeometryPolygon",d=this._getPointCreator(a,this.spatialReference,t),h=new Ne(null,0),f=new Ne(null,0),m={x:0,y:0,z:0};for(const p of this.items){const S=i.getGeometry(p);if(S==null)continue;const{coords:x,lengths:F}=S;if(h.coords=x,f.coords=x,e.returnEdge){let w=0;for(let y=0;yp.distance-S.distance),u}_getPointCreator(e,t,i){const s=i==null||T(t,i)?l=>l:l=>E(l,t,i),{hasZ:r}=this,a=0;return e==="3d"?r?({x:l,y:o,z:u})=>s({x:l,y:o,z:u}):({x:l,y:o})=>s({x:l,y:o,z:a}):({x:l,y:o})=>s({x:l,y:o})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:a,minValue:l,maxValue:o,scale:u}=e,c=this.fieldsIndex.isDateField(t),d=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:a,scale:u}),h=Ut({normalizationType:r,normalizationField:s,minValue:l,maxValue:o}),f=this.fieldsIndex.get(t),m={value:.5,fieldType:f==null?void 0:f.type},p=Fe(f)?Ve({values:d,supportsNullCount:h,percentileParams:m}):Ee({values:d,minValue:l,maxValue:o,useSampleStdDev:!r,supportsNullCount:h,percentileParams:m});return Lt(p,c)}async createUniqueValuesResponse(e){const{field:t,valueExpression:i,domains:s,returnAllCodedValues:r,scale:a}=e,l=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:i,scale:a}),o=Ht(l);return Jt(o,s,r,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:a,classificationMethod:l,standardDeviationInterval:o,minValue:u,maxValue:c,numClasses:d,scale:h}=e,f=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:a,scale:h}),m=Yt(f,{field:t,normalizationField:s,normalizationType:r,normalizationTotal:a,classificationMethod:l,standardDeviationInterval:o,minValue:u,maxValue:c,numClasses:d});return Wt(m,l)}async createHistogramResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:a,classificationMethod:l,standardDeviationInterval:o,minValue:u,maxValue:c,numBins:d,scale:h}=e,f=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:a,scale:h});return Kt(f,{field:t,normalizationField:s,normalizationType:r,normalizationTotal:a,classificationMethod:l,standardDeviationInterval:o,minValue:u,maxValue:c,numBins:d})}_sortFeatures(e,t,i){if(e.length>1&&t&&t.length)for(const s of t.reverse()){const r=s.split(" "),a=r[0],l=this.fieldsIndex.get(a),o=!!r[1]&&r[1].toLowerCase()==="desc",u=Xt(l==null?void 0:l.type,o);e.sort((c,d)=>{const h=i(c,a,l),f=i(d,a,l);return u(h,f)})}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:i,hasM:s,hasZ:r,objectIdField:a,spatialReference:l}=this,{outFields:o,outSR:u,quantizationParameters:c,resultRecordCount:d,resultOffset:h,returnZ:f,returnM:m}=e,p=d!=null&&t.length>(h||0)+d,S=o&&(o.includes("*")?[...this.fieldsIndex.fields]:o.map(x=>this.fieldsIndex.get(x)));return{exceededTransferLimit:p,features:this._createFeatures(e,t),fields:S,geometryType:i,hasM:s&&m,hasZ:r&&f,objectIdFieldName:a,spatialReference:k(u||l),transform:c&&Re(c)||null}}_createFeatures(e,t){const i=new W(e,this.featureAdapter,this.fieldsIndex),{hasM:s,hasZ:r}=this,{orderByFields:a,quantizationParameters:l,returnGeometry:o,returnCentroid:u,maxAllowableOffset:c,resultOffset:d,resultRecordCount:h,returnZ:f=!1,returnM:m=!1}=e,p=r&&f,S=s&&m;let x=[],F=0;const w=[...t];if(this._sortFeatures(w,a,(g,_,I)=>i.getFieldValue(g,_,I)),o||u){const g=Re(l)??void 0;if(o&&!u)for(const _ of w)x[F++]={attributes:i.getAttributes(_),geometry:M(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(_),c,g,p,S)};else if(!o&&u)for(const _ of w)x[F++]={attributes:i.getAttributes(_),centroid:Qe(this,this.featureAdapter.getCentroid(_,this),g)};else for(const _ of w)x[F++]={attributes:i.getAttributes(_),centroid:Qe(this,this.featureAdapter.getCentroid(_,this),g),geometry:M(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(_),c,g,p,S)}}else for(const g of w){const _=i.getAttributes(g);_&&(x[F++]={attributes:_})}const y=d||0;if(h!=null){const g=y+h;x=x.slice(y,Math.min(x.length,g))}return x}_createExceedsLimitQueryResponse(e){let t=!1,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;for(const a of e.outStatistics??[])if(a.statisticType==="exceedslimit"){i=a.maxPointCount!=null?a.maxPointCount:Number.POSITIVE_INFINITY,s=a.maxRecordCount!=null?a.maxRecordCount:Number.POSITIVE_INFINITY,r=a.maxVertexCount!=null?a.maxVertexCount:Number.POSITIVE_INFINITY;break}if(this.geometryType==="esriGeometryPoint")t=this.items.length>i;else if(this.items.length>s)t=!0;else{const a=qe(this.hasZ,this.hasM),l=this.featureAdapter;t=this.items.reduce((o,u)=>{const c=l.getGeometry(u);return o+(c!=null&&c.coords.length||0)},0)/a>r}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},i=[],s=new Map,r=new Map,a=new Map,l=new Map,o=new W(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:d,orderByFields:h}=e,f=c&&c.length,m=!!f,p=m?c[0]:null,S=m&&!this.fieldsIndex.get(p);for(const F of u??[]){const{outStatisticFieldName:w,statisticType:y}=F,g=F,_=y!=="exceedslimit"?F.onStatisticField:void 0,I=y==="percentile_disc"||y==="percentile_cont",A=y==="EnvelopeAggregate"||y==="CentroidAggregate"||y==="ConvexHullAggregate",C=m&&f===1&&(_===p||S)&&y==="count";if(m){if(!a.has(_)){const $=[];for(const D of c){const Y=this._getAttributeValues(o,D,s);$.push(Y)}a.set(_,this._calculateUniqueValues($,!A&&o.returnDistinctValues))}const v=a.get(_);for(const $ in v){const{count:D,data:Y,items:ge,itemPositions:at}=v[$],xe=Y.join(",");if(!d||o.validateItems(ge,d)){const j=l.get(xe)||{attributes:{}};if(A){j.aggregateGeometries||(j.aggregateGeometries={});const{aggregateGeometries:z,outStatisticFieldName:B}=await this._getAggregateGeometry(g,ge);j.aggregateGeometries[B]=z}else{let z=null;if(C)z=D;else{const B=this._getAttributeValues(o,_,s),_e=at.map(lt=>B[lt]);z=I&&"statisticParameters"in g?this._getPercentileValue(g,_e):this._getStatisticValue(g,_e,null,o.returnDistinctValues)}j.attributes[w]=z}let nt=0;c.forEach((z,B)=>j.attributes[this.fieldsIndex.get(z)?z:"EXPR_"+ ++nt]=Y[B]),l.set(xe,j)}}}else if(A){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:v,outStatisticFieldName:$}=await this._getAggregateGeometry(g,this.items);t.aggregateGeometries[$]=v}else{const v=this._getAttributeValues(o,_,s);t.attributes[w]=I&&"statisticParameters"in g?this._getPercentileValue(g,v):this._getStatisticValue(g,v,r,o.returnDistinctValues)}i.push({name:w,alias:w,type:"esriFieldTypeDouble"})}const x=m?Array.from(l.values()):[t];return this._sortFeatures(x,h,(F,w)=>F.attributes[w]),{fields:i,features:x}}async _getAggregateGeometry(e,t){const{convexHull:i,union:s}=await de(()=>import("./geometryEngineJSON-c939b27e.js"),["assets/geometryEngineJSON-c939b27e.js","assets/geometryEngineBase-324c1c81.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/geometryEngineJSON-b173802a.js","assets/json-48e3ea08.js"]),{statisticType:r,outStatisticFieldName:a}=e,{featureAdapter:l,spatialReference:o,geometryType:u,hasZ:c,hasM:d}=this,h=t.map(p=>M(u,c,d,l.getGeometry(p))),f=i(o,h,!0)[0],m={aggregateGeometries:null,outStatisticFieldName:null};if(r==="EnvelopeAggregate"){const p=f?Rt(f):ne(s(o,h));m.aggregateGeometries={...p,spatialReference:o},m.outStatisticFieldName=a||"extent"}else if(r==="CentroidAggregate"){const p=f?It(f):bt(ne(s(o,h)));m.aggregateGeometries={x:p[0],y:p[1],spatialReference:o},m.outStatisticFieldName=a||"centroid"}else r==="ConvexHullAggregate"&&(m.aggregateGeometries=f,m.outStatisticFieldName=a||"convexHull");return m}_getStatisticValue(e,t,i,s){const{onStatisticField:r,statisticType:a}=e;let l=null;return l=i!=null&&i.has(r)?i.get(r):Fe(this.fieldsIndex.get(r))?Ve({values:t,returnDistinct:s}):Ee({values:s?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(r,l),l[a==="var"?"variance":a]}_getPercentileValue(e,t){const{onStatisticField:i,statisticParameters:s,statisticType:r}=e,{value:a,orderBy:l}=s,o=this.fieldsIndex.get(i);return ei(t,{value:a,orderBy:l,fieldType:o==null?void 0:o.type,isDiscrete:r==="percentile_disc"})}_getAttributeValues(e,t,i){if(i.has(t))return i.get(t);const s=this.fieldsIndex.get(t),r=this.items.map(a=>e.getFieldValue(a,t,s));return i.set(t,r),r}_calculateUniqueValues(e,t){const i={},s=this.items,r=s.length;for(let a=0;a=a||m=a)&&d+(a-h)/(m-h)*(f-d)import("./geometryEngineJSON-c939b27e.js"),["assets/geometryEngineJSON-c939b27e.js","assets/geometryEngineBase-324c1c81.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/geometryEngineJSON-b173802a.js","assets/json-48e3ea08.js"])}function K(n,e,t,i,s){if(L(e)&&t==="esriGeometryPoint"&&(n==="esriSpatialRelIntersects"||n==="esriSpatialRelContains")){const r=Ie(new H,e,!1,!1);return Promise.resolve(a=>_i(r,!1,!1,a))}if(L(e)&&t==="esriGeometryMultipoint"){const r=Ie(new H,e,!1,!1);if(n==="esriSpatialRelContains")return Promise.resolve(a=>Si(r,!1,!1,a,i,s))}if(N(e)&&t==="esriGeometryPoint"&&(n==="esriSpatialRelIntersects"||n==="esriSpatialRelContains"))return Promise.resolve(r=>Tt(e,M(t,i,s,r)));if(N(e)&&t==="esriGeometryMultipoint"&&n==="esriSpatialRelContains")return Promise.resolve(r=>$t(e,M(t,i,s,r)));if(N(e)&&n==="esriSpatialRelIntersects"){const r=xi(t);return Promise.resolve(a=>r(e,M(t,i,s,a)))}return vi().then(r=>{const a=r[Fi[n]].bind(null,e.spatialReference,e);return l=>a(M(t,i,s,l))})}async function Ge(n,e,t){const{spatialRel:i,geometry:s}=n;if(s){if(!Ri(i))throw new R(re,"Unsupported query spatial relationship",{query:n});if(G(s.spatialReference)&&G(t)){if(!Ii(s))throw new R(re,"Unsupported query geometry type",{query:n});if(!bi(e))throw new R(re,"Unsupported layer geometry type",{query:n});if(n.outSR)return Z(n.geometry&&n.geometry.spatialReference,n.outSR)}}}function De(n){if(N(n))return!0;if(L(n)){for(const e of n.rings)if(e.length!==5||e[0][0]!==e[1][0]||e[0][0]!==e[4][0]||e[2][0]!==e[3][0]||e[0][1]!==e[3][1]||e[0][1]!==e[4][1]||e[1][1]!==e[2][1])return!1;return!0}return!1}async function Ai(n,e){if(!n)return null;const t=e.featureAdapter,{startTimeField:i,endTimeField:s}=n;let r=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;if(i&&s)await e.forEach(l=>{const o=t.getAttribute(l,i),u=t.getAttribute(l,s);o==null||isNaN(o)||(r=Math.min(r,o)),u==null||isNaN(u)||(a=Math.max(a,u))});else{const l=i||s;await e.forEach(o=>{const u=t.getAttribute(o,l);u==null||isNaN(u)||(r=Math.min(r,u),a=Math.max(a,u))})}return{start:r,end:a}}function Ti(n,e,t){if(!e||!n)return null;const{startTimeField:i,endTimeField:s}=n;if(!i&&!s)return null;const{start:r,end:a}=e;return r===null&&a===null?null:r===void 0&&a===void 0?Ei():i&&s?$i(t,i,s,r,a):Vi(t,i||s,r,a)}function $i(n,e,t,i,s){return i!=null&&s!=null?r=>{const a=n.getAttribute(r,e),l=n.getAttribute(r,t);return(a==null||a<=s)&&(l==null||l>=i)}:i!=null?r=>{const a=n.getAttribute(r,t);return a==null||a>=i}:s!=null?r=>{const a=n.getAttribute(r,e);return a==null||a<=s}:void 0}function Vi(n,e,t,i){return t!=null&&i!=null&&t===i?s=>n.getAttribute(s,e)===t:t!=null&&i!=null?s=>{const r=n.getAttribute(s,e);return r>=t&&r<=i}:t!=null?s=>n.getAttribute(s,e)>=t:i!=null?s=>n.getAttribute(s,e)<=i:void 0}function Ei(){return()=>!1}function Mi(n){return n!=null&&n.every(e=>e.statisticType!=="exceedslimit")}const Q="feature-store:unsupported-query",zi=new Et(2e6);let Qi=0;class ki{constructor(e){this._geometryQueryCache=null,this._changeHandle=null,this.capabilities={query:Bt},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 Mt(Qi+++"$$",zi)),this.fieldsIndex=new ti(e.fields),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=be(this._frameTask),this.clearCache(),ve(this._geometryQueryCache),this._changeHandle=be(this._changeHandle),ve(this.fieldsIndex)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){var e;(e=this._geometryQueryCache)==null||e.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null}async executeQuery(e,t){try{return(await this._executeQuery(e,{},t)).createQueryResponse()}catch(i){if(i!==P)throw i;return new b([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},t)).createQueryResponseForCount()}catch(i){if(i!==P)throw i;return 0}}async executeQueryForExtent(e,t){const i=e.outSR;try{const s=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),r=s.size;return r?{count:r,extent:await this._getBounds(s.items,s.spatialReference,i||this.spatialReference)}:{count:0,extent:null}}catch(s){if(s===P)return{count:0,extent:null};throw s}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then(i=>Array.from(i))}async executeQueryForIdSet(e,t){try{const i=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),s=i.items,r=new Set;return await this._reschedule(()=>{for(const a of s)r.add(i.featureAdapter.getObjectId(a))},t),r}catch(i){if(i===P)return new Set;throw i}}async executeQueryForSnapping(e,t){const{point:i,distance:s,returnEdge:r,returnVertex:a}=e;if(!r&&!a)return{candidates:[]};const l=await this._reschedule(()=>this._checkQuerySupport(e.query),t),o=!T(i.spatialReference,this.spatialReference);o&&await Z(i.spatialReference,this.spatialReference);const u=typeof s=="number"?s:s.x,c=typeof s=="number"?s:s.y,d={xmin:i.x-u,xmax:i.x+u,ymin:i.y-c,ymax:i.y+c,spatialReference:i.spatialReference},h=o?E(d,this.spatialReference):d;if(!h)return{candidates:[]};const f=(await ue(le(i),null,{signal:t}))[0],m=(await ue(le(h),null,{signal:t}))[0];if(f==null||m==null)return{candidates:[]};const p=new b(await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(m.toJSON())),t),l,this);await this._reschedule(()=>this._executeObjectIdsQuery(p),t),await this._reschedule(()=>this._executeTimeQuery(p),t),await this._reschedule(()=>this._executeAttributesQuery(p),t);const S=f.toJSON(),x=o?E(S,this.spatialReference):S,F=o?Math.max(h.xmax-h.xmin,h.ymax-h.ymin)/2:s;return p.createSnappingResponse({...e,point:x,distance:F},i.spatialReference)}async executeQueryForLatestObservations(e,t){if(!this.timeInfo||!this.timeInfo.trackIdField)throw new R(Q,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const i=await this._executeQuery(e,{},t);return await this._reschedule(()=>this._filterLatest(i),t),i.createQueryResponse()}catch(i){if(i!==P)throw i;return new b([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,i){const{field:s,normalizationField:r,valueExpression:a}=t;return(await this._getQueryEngineResultForStats(e,{field:s,normalizationField:r,valueExpression:a},i)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,i){const{field:s,field2:r,field3:a,valueExpression:l}=t;return(await this._getQueryEngineResultForStats(e,{field:s,field2:r,field3:a,valueExpression:l},i)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,i){const{field:s,normalizationField:r,valueExpression:a}=t;return(await this._getQueryEngineResultForStats(e,{field:s,normalizationField:r,valueExpression:a},i)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,i){const{field:s,normalizationField:r,valueExpression:a}=t;return(await this._getQueryEngineResultForStats(e,{field:s,normalizationField:r,valueExpression:a},i)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const[t,i]=await Promise.all(["getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getBounds(await this._getAllFeatures(),this.spatialReference,this.spatialReference),this._timeExtentPromise!=null?this._timeExtentPromise:this._timeExtentPromise=Ai(this.timeInfo,this.featureStore)]);return zt(e),{fullExtent:t,timeExtent:i}}async _getBounds(e,t,i){const s=Qt(Ct(),Pt);await this.featureStore.forEachBounds(e,l=>qt(s,l));const r={xmin:s[0],ymin:s[1],xmax:s[3],ymax:s[4],spatialReference:k(this.spatialReference)};this.hasZ&&isFinite(s[2])&&isFinite(s[5])&&(r.zmin=s[2],r.zmax=s[5]);const a=E(r,t,i);if(a.spatialReference=k(i),a.xmax-a.xmin==0){const l=te(a.spatialReference);a.xmin-=l,a.xmax+=l}if(a.ymax-a.ymin==0){const l=te(a.spatialReference);a.ymin-=l,a.ymax+=l}if(this.hasZ&&a.zmin!=null&&a.zmax!=null&&a.zmax-a.zmin==0){const l=te(a.spatialReference);a.zmin-=l,a.zmax+=l}return a}async _schedule(e,t){return this._frameTask!=null?this._frameTask.schedule(e,t):e(Ae)}async _reschedule(e,t){return this._frameTask!=null?this._frameTask.reschedule(e,t):e(Ae)}async _getAllFeaturesQueryEngineResult(e){return new b(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(this._allFeaturesPromise==null){const i=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach(s=>i.push(s))})().then(()=>i)}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,i){e=Te(e),e=await this._schedule(()=>Pe(e,this.definitionExpression,this.spatialReference),i),e=await this._reschedule(()=>this._checkQuerySupport(e),i),e={...e,...t};const s=await this._reschedule(()=>this._executeSceneFilterQuery(e,i),i),r=await this._reschedule(()=>this._executeGeometryQuery(e,s,i),i);return await this._reschedule(()=>this._executeAggregateIdsQuery(r),i),await this._reschedule(()=>this._executeObjectIdsQuery(r),i),await this._reschedule(()=>this._executeTimeQuery(r),i),await this._reschedule(()=>this._executeAttributesQuery(r),i),r}async _executeSceneFilterQuery(e,t){if(e.sceneFilter==null)return null;const{outSR:i,returnGeometry:s,returnCentroid:r}=e,a=this.featureStore.featureSpatialReference,l=e.sceneFilter.geometry,o=a==null||T(a,l.spatialReference)?l:E(l,a);if(!o)return null;const u=s||r,c=G(i)&&!T(this.spatialReference,i)&&u?async p=>this._project(p,i):p=>p,d=this.featureAdapter,h=await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(o)),t);if(e.sceneFilter.spatialRelationship==="disjoint"){if(!h.length)return null;const p=new Set;for(const F of h)p.add(d.getObjectId(F));const S=await this._reschedule(()=>this._getAllFeatures(),t),x=await this._reschedule(async()=>{const F=await K("esriSpatialRelDisjoint",o,this.geometryType,this.hasZ,this.hasM),w=g=>!p.has(d.getObjectId(g))||F(d.getGeometry(g)),y=await this._runSpatialFilter(S,w,t);return new b(y,e,this)},t);return c(x)}if(!h.length)return new b([],e,this);if(this._canExecuteSinglePass(o,e))return c(new b(h,e,this));const f=await K("esriSpatialRelContains",o,this.geometryType,this.hasZ,this.hasM),m=await this._runSpatialFilter(h,p=>f(d.getGeometry(p)),t);return c(new b(m,e,this))}async _executeGeometryQuery(e,t,i){if(t!=null&&t.items.length===0)return t;e=t!=null?t.query:e;const{geometry:s,outSR:r,spatialRel:a,returnGeometry:l,returnCentroid:o}=e,u=this.featureStore.featureSpatialReference,c=!s||u==null||T(u,s.spatialReference)?s:E(s,u),d=l||o,h=G(r)&&!T(this.spatialReference,r),f=this._geometryQueryCache&&t==null?JSON.stringify(h&&d?{originalFilterGeometry:s,spatialRelationship:a,outSpatialReference:r}:{originalFilterGeometry:s,spatialRelationship:a}):null,m=f?this._geometryQueryCache.get(f):null;if(m!=null)return new b(m,e,this);const p=async y=>(h&&d&&await this._project(y,r),f&&this._geometryQueryCache.put(f,y.items,y.items.length+1),y);if(!c)return p(t??await this._getAllFeaturesQueryEngineResult(e));const S=this.featureAdapter;let x=await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(s)),i);if(a==="esriSpatialRelDisjoint"){if(!x.length)return p(t??await this._getAllFeaturesQueryEngineResult(e));const y=new Set;for(const I of x)y.add(S.getObjectId(I));const g=t!=null?t.items:await this._reschedule(()=>this._getAllFeatures(),i),_=await this._reschedule(async()=>{const I=await K(a,c,this.geometryType,this.hasZ,this.hasM),A=v=>!y.has(S.getObjectId(v))||I(S.getGeometry(v)),C=await this._runSpatialFilter(g,A,i);return new b(C,e,this)},i);return p(_)}if(t!=null){const y=new Ot;x=x.filter(g=>Nt(t.items,g,t.items.length,y)>=0)}if(!x.length){const y=new b([],e,this);return f&&this._geometryQueryCache.put(f,y.items,1),y}if(this._canExecuteSinglePass(c,e))return p(new b(x,e,this));const F=await K(a,c,this.geometryType,this.hasZ,this.hasM),w=await this._runSpatialFilter(x,y=>F(S.getGeometry(y)),i);return p(new b(w,e,this))}_executeAggregateIdsQuery(e){if(e.items.length===0||!e.query.aggregateIds||!e.query.aggregateIds.length||this.aggregateAdapter==null)return;const t=new Set;for(const s of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(s).forEach(r=>t.add(r));const i=this.featureAdapter.getObjectId;e.items=e.items.filter(s=>t.has(i(s)))}_executeObjectIdsQuery(e){if(e.items.length===0||!e.query.objectIds||!e.query.objectIds.length)return;const t=new Set(e.query.objectIds),i=this.featureAdapter.getObjectId;e.items=e.items.filter(s=>t.has(i(s)))}_executeTimeQuery(e){if(e.items.length===0)return;const t=Ti(this.timeInfo,e.query.timeExtent,this.featureAdapter);t!=null&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(e.items.length===0)return;const t=O(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(i=>t.testFeature(i,this.featureAdapter))}}async _runSpatialFilter(e,t,i){if(!t)return e;if(this._frameTask==null)return e.filter(l=>t(l));let s=0;const r=new Array,a=async l=>{for(;sa(u),i)}};return this._reschedule(l=>a(l),i).then(()=>r)}_filterLatest(e){const{trackIdField:t,startTimeField:i,endTimeField:s}=this.timeInfo,r=s||i,a=new Map,l=this.featureAdapter.getAttribute;for(const o of e.items){const u=l(o,t),c=l(o,r),d=a.get(u);(!d||c>l(d,r))&&a.set(u,o)}e.items=Array.from(a.values())}_canExecuteSinglePass(e,t){const{spatialRel:i}=t;return De(e)&&(i==="esriSpatialRelEnvelopeIntersects"||this.geometryType==="esriGeometryPoint"&&(i==="esriSpatialRelIntersects"||i==="esriSpatialRelContains"||i==="esriSpatialRelWithin"))}async _project(e,t){if(!t||T(this.spatialReference,t))return e;const i=this.featureAdapter,s=await ri(e.items.map(r=>M(this.geometryType,this.hasZ,this.hasM,i.getGeometry(r))),this.spatialReference,t);return e.items=s.map((r,a)=>i.cloneWithGeometry(e.items[a],Gt(r,this.hasZ,this.hasM))),e}_getQueryBBoxes(e){if(De(e)){if(N(e))return[$e(e.xmin,e.ymin,e.xmax,e.ymax)];if(L(e))return e.rings.map(t=>$e(Math.min(t[0][0],t[2][0]),Math.min(t[0][1],t[2][1]),Math.max(t[0][0],t[2][0]),Math.max(t[0][1],t[2][1])))}return[Dt(jt(),e)]}async _searchFeatures(e){const t=new Set;await Promise.all(e.map(s=>this.featureStore.forEachInBounds(s,r=>t.add(r))));const i=Array.from(t.values());return t.clear(),i}async _checkStatisticsSupport(e,t){if((e.distance??0)<0||e.geometryPrecision!=null||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new R(Q,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),Promise.all([this._checkStatisticsParamsSupport(t,e),Ge(e,this.geometryType,this.spatialReference),Z(this.spatialReference,e.outSR)]).then(()=>e)}async _checkStatisticsParamsSupport(e,t){let i=[];if(e.valueExpression){const{arcadeUtils:s}=await Ze();i=s.extractFieldNames(e.valueExpression)}if(e.field&&i.push(e.field),e.field2&&i.push(e.field2),e.field3&&i.push(e.field3),e.normalizationField&&i.push(e.normalizationField),!i.length&&!e.valueExpression)throw new R(Q,"field or valueExpression is required",{params:e});q(this.fieldsIndex,i,{errorMessage:"Cannot calculate statistics for missing fields",query:t}),me(this.fieldsIndex,i,{expressionName:"statistics",query:t})}async _checkQuerySupport(e){if((e.distance??0)<0||e.geometryPrecision!=null||e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new R(Q,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),this._checkStatisticsQuerySupport(e),Promise.all([Ge(e,this.geometryType,this.spatialReference),Z(this.spatialReference,e.outSR)]).then(()=>e)}_checkAttributesQuerySupport(e){const{outFields:t,orderByFields:i,returnDistinctValues:s,outStatistics:r}=e,a=r?r.map(l=>l.outStatisticFieldName&&l.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(i&&i.length>0){const l=" asc",o=" desc",u=i.map(c=>{const d=c.toLowerCase();return d.includes(l)?d.split(l)[0]:d.includes(o)?d.split(o)[0]:c}).filter(c=>!a.includes(c));q(this.fieldsIndex,u,{expressionName:"orderByFields",query:e})}if(t&&t.length>0)q(this.fieldsIndex,t,{expressionName:"outFields",query:e});else if(s)throw new R(Q,"outFields should be specified for returnDistinctValues",{query:e});mi(this.fieldsIndex,e.where,e)}_checkStatisticsQuerySupport(e){const{outStatistics:t,groupByFieldsForStatistics:i,having:s}=e,r=i&&i.length,a=t&&t.length;if(s){if(!r||!a)throw new R(Q,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:e});pi(this.fieldsIndex,s,t,e)}if(a){if(!Mi(t))return;const l=t.map(c=>c.onStatisticField).filter(Boolean);q(this.fieldsIndex,l,{expressionName:"onStatisticFields",query:e}),r&&q(this.fieldsIndex,i,{expressionName:"groupByFieldsForStatistics",query:e});const o=new Set([...X.jsonValues,...ee.jsonValues]),u=new Intl.ListFormat("en-US",{type:"conjunction"}).format([...X.apiValues,...ee.apiValues]);for(const c of t){const{onStatisticField:d,statisticType:h}=c;if((h==="percentile_disc"||h==="percentile_cont")&&"statisticParameters"in c){const{statisticParameters:f}=c;if(!f)throw new R(Q,"statisticParameters should be set for percentile type",{definition:c,query:e})}else if(h!=="count"&&h!=="min"&&h!=="max"&&d&&it(d,this.fieldsIndex,o))throw new R(Q,`outStatistics with '${h}' statistic type, only supports ${u} field types`,{definition:c,query:e})}}}async _getQueryEngineResultForStats(e,t,i){e=Te(e);try{e=await this._schedule(()=>Pe(e,this.definitionExpression,this.spatialReference),i),e=await this._reschedule(()=>this._checkStatisticsSupport(e,t),i);const s=await this._reschedule(()=>this._executeSceneFilterQuery(e,i),i),r=await this._reschedule(()=>this._executeGeometryQuery(e,s,i),i);return await this._reschedule(()=>this._executeAggregateIdsQuery(r),i),await this._reschedule(()=>this._executeObjectIdsQuery(r),i),await this._reschedule(()=>this._executeTimeQuery(r),i),await this._reschedule(()=>this._executeAttributesQuery(r),i),r}catch(s){if(s!==P)throw s;return new b([],e,this)}}}export{k as Z,ki as e,Z as f,E as g,Ti as n,K as v,li as z}; diff --git a/assets/QueryEngineCapabilities-42e44ded.js b/assets/QueryEngineCapabilities-42e44ded.js new file mode 100644 index 0000000..dea6e7d --- /dev/null +++ b/assets/QueryEngineCapabilities-42e44ded.js @@ -0,0 +1 @@ +const t={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,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0};export{t}; diff --git a/assets/QueryTask-6f808a9e.js b/assets/QueryTask-6f808a9e.js new file mode 100644 index 0000000..3fa744d --- /dev/null +++ b/assets/QueryTask-6f808a9e.js @@ -0,0 +1 @@ +import{cm as y,ca as T,ai as s,aj as u,al as A,ao as w,bf as Q,cn as P,fv as p,aw as a,fl as f,fm as h,ar as j}from"./index-080e108a.js";import{b as _,K as S}from"./Query-1c961d4c.js";import{n as q,s as L}from"./executeForIds-5eaf002d.js";import{S as J}from"./query-93c6e211.js";import{a as N}from"./executeQueryJSON-7c41ada5.js";import{n as $}from"./executeQueryPBF-0f188593.js";import{d as z}from"./FeatureSet-111cb247.js";async function C(e,t,r){const o=y(e);return J(o,_.from(t),{...r}).then(c=>({count:c.data.count,extent:T.fromJSON(c.data.extent)}))}let i=class extends w{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return Q(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){var n;const r=this._normalizeQuery(e),o=((n=e.outStatistics)==null?void 0:n[0])!=null,c=P("featurelayer-pbf-statistics"),l=!o||c;let d;if(this.pbfSupported&&l)try{d=await $(this.url,r,t)}catch(m){if(m.name!=="query:parsing-pbf")throw m;this.pbfSupported=!1}return this.pbfSupported&&l||(d=await N(this.url,r,t)),this._normalizeFields(d.fields),d}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||this.infoFor3D==null||!t.features)return z.fromJSON(t);const{meshFeatureSetFromJSON:o}=await p(a(()=>import("./meshFeatureSet-8442b8e6.js"),["assets/meshFeatureSet-8442b8e6.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/FeatureSet-111cb247.js"]),r);return o(e,this.infoFor3D,t)}executeForCount(e,t){return q(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return C(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return L(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:o}]=await p(Promise.all([a(()=>import("./RelationshipQuery-39c07195.js"),["assets/RelationshipQuery-39c07195.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/Query-1c961d4c.js"]),a(()=>import("./executeRelationshipQuery-39c5c9fd.js"),["assets/executeRelationshipQuery-39c5c9fd.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/RelationshipQuery-39c07195.js","assets/Query-1c961d4c.js"])]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),o(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:o}]=await p(Promise.all([a(()=>import("./RelationshipQuery-39c07195.js"),["assets/RelationshipQuery-39c07195.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/Query-1c961d4c.js"]),a(()=>import("./executeRelationshipQuery-39c5c9fd.js"),["assets/executeRelationshipQuery-39c5c9fd.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/RelationshipQuery-39c07195.js","assets/Query-1c961d4c.js"])]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),o(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:o,processAttachmentQueryResult:c}=await p(a(()=>import("./queryAttachments-1706bb4d.js"),["assets/queryAttachments-1706bb4d.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/AttachmentInfo-cb670dd0.js"]),t),l=y(this.url);return c(l,await(this.queryAttachmentsSupported?r(l,e,t):o(l,e,t)))}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await p(a(()=>import("./executeTopFeaturesQuery-6e0504e9.js"),["assets/executeTopFeaturesQuery-6e0504e9.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/queryTopFeatures-70149ca3.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/TopFeaturesQuery-e44d05be.js"]),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await p(a(()=>import("./executeForTopIds-53feffc9.js"),["assets/executeForTopIds-53feffc9.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/queryTopFeatures-70149ca3.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/TopFeaturesQuery-e44d05be.js"]),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await p(a(()=>import("./executeForTopExtents-9cf44843.js"),["assets/executeForTopExtents-9cf44843.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/queryTopFeatures-70149ca3.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/TopFeaturesQuery-e44d05be.js"]),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await p(a(()=>import("./executeForTopCount-6d9058c4.js"),["assets/executeForTopCount-6d9058c4.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/queryTopFeatures-70149ca3.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/TopFeaturesQuery-e44d05be.js"]),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=_.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?S.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(r!=null&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;const{supportedFormats:o,queryFormats:c}=r,l=f("model/gltf-binary",o)??h("glb",o),d=f("model/gltf+json",o)??h("gtlf",o);for(const n of c){if(n===l){t.formatOf3DObjects=n;break}n!==d||t.formatOf3DObjects||(t.formatOf3DObjects=n)}if(!t.formatOf3DObjects)throw new j("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outFields==null||!t.outFields.includes("*")){t=t===e?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:n,originY:m,originZ:D,translationX:F,translationY:b,translationZ:O,scaleX:x,scaleY:g,scaleZ:V,rotationX:E,rotationY:R,rotationZ:v,rotationDeg:I}=r.transformFieldRoles;t.outFields.push(n,m,D,F,b,O,x,g,V,E,R,v,I)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(const t of e){const r=this.fieldsIndex.get(t.name);r&&Object.assign(t,r.toJSON())}}_queryIs3DObjectFormat(e){return this.infoFor3D!=null&&e.returnGeometry===!0&&e.multipatchOption!=="xyFootprint"&&!e.outStatistics}};s([u({type:S})],i.prototype,"dynamicDataSource",void 0),s([u()],i.prototype,"fieldsIndex",void 0),s([u()],i.prototype,"gdbVersion",void 0),s([u()],i.prototype,"infoFor3D",void 0),s([u({readOnly:!0})],i.prototype,"parsedUrl",null),s([u()],i.prototype,"pbfSupported",void 0),s([u()],i.prototype,"queryAttachmentsSupported",void 0),s([u()],i.prototype,"sourceSpatialReference",void 0),s([u({type:String})],i.prototype,"url",void 0),i=s([A("esri.tasks.QueryTask")],i);const M=i;export{M as x}; diff --git a/assets/RasterColorizer.glsl-724b79fe.js b/assets/RasterColorizer.glsl-724b79fe.js new file mode 100644 index 0000000..a4b90d9 --- /dev/null +++ b/assets/RasterColorizer.glsl-724b79fe.js @@ -0,0 +1 @@ +import{K as i,L as s,M as e,N as l}from"./index-080e108a.js";export{i as ColorizerHillshadeUniforms,s as ColorizerStretchUniforms,e as ColorizerUniforms,l as build}; diff --git a/assets/RasterWorker-cd959d79.js b/assets/RasterWorker-cd959d79.js new file mode 100644 index 0000000..dc7f297 --- /dev/null +++ b/assets/RasterWorker-cd959d79.js @@ -0,0 +1 @@ +import{ca as a,c7 as l,eL as c}from"./index-080e108a.js";import{u as i,f as m,m as f,j as u,L as p,h as S,W as d,U as x,R as y,I as h,a as O,s as N}from"./dataUtils-69946c3c.js";import{_ as J,i as P}from"./utils-12672bd4.js";import{d as b,k as g,$ as k}from"./rasterProjectionHelper-072edec4.js";import"./colorUtils-c0f43caf.js";class T{convertVectorFieldData(t){const e=i.fromJSON(t.pixelBlock),s=m(e,t.type);return Promise.resolve(s!=null?s.toJSON():null)}computeStatisticsHistograms(t){const e=i.fromJSON(t.pixelBlock),s=f(e);return Promise.resolve(s)}async decode(t){const e=await u(t.data,t.options);return e&&e.toJSON()}symbolize(t){t.pixelBlock=i.fromJSON(t.pixelBlock),t.extent=t.extent?a.fromJSON(t.extent):null;const e=this.symbolizer.symbolize(t);return Promise.resolve(e!=null?e.toJSON():null)}async updateSymbolizer(t){var e;this.symbolizer=p.fromJSON(t.symbolizerJSON),t.histograms&&((e=this.symbolizer)==null?void 0:e.rendererJSON.type)==="rasterStretch"&&(this.symbolizer.rendererJSON.histograms=t.histograms)}async updateRasterFunction(t){this.rasterFunction=J(t.rasterFunctionJSON)}async process(t){var s;const e=this.rasterFunction.process({extent:a.fromJSON(t.extent),primaryPixelBlocks:t.primaryPixelBlocks.map(o=>o!=null?i.fromJSON(o):null),primaryPixelSizes:(s=t.primaryPixelSizes)==null?void 0:s.map(o=>o!=null?l.fromJSON(o):null),primaryRasterIds:t.primaryRasterIds});return e!=null?e.toJSON():null}stretch(t){const e=this.symbolizer.simpleStretch(i.fromJSON(t.srcPixelBlock),t.stretchParams);return Promise.resolve(e!=null&&e.toJSON())}estimateStatisticsHistograms(t){const e=S(i.fromJSON(t.srcPixelBlock));return Promise.resolve(e)}split(t){const e=d(i.fromJSON(t.srcPixelBlock),t.tileSize,t.maximumPyramidLevel);return e&&e.forEach((s,o)=>{e.set(o,s==null?void 0:s.toJSON())}),Promise.resolve(e)}async mosaicAndTransform(t){const e=t.srcPixelBlocks.map(n=>n?new i(n):null),s=x(e,t.srcMosaicSize,{blockWidths:t.blockWidths,alignmentInfo:t.alignmentInfo,clipOffset:t.clipOffset,clipSize:t.clipSize});let o,r=s;return t.coefs&&(r=y(s,t.destDimension,t.coefs,t.sampleSpacing,t.interpolation)),t.projectDirections&&t.gcsGrid&&(o=h(t.destDimension,t.gcsGrid),r=O(r,t.isUV?"vector-uv":"vector-magdir",o)),{pixelBlock:r==null?void 0:r.toJSON(),localNorthDirections:o}}async createFlowMesh(t,e){const s={data:new Float32Array(t.flowData.buffer),mask:new Uint8Array(t.flowData.maskBuffer),width:t.flowData.width,height:t.flowData.height},{vertexData:o,indexData:r}=await N(t.meshType,t.simulationSettings,s,e.signal);return{result:{vertexBuffer:o.buffer,indexBuffer:r.buffer},transferList:[o.buffer,r.buffer]}}async getProjectionOffsetGrid(t){const e=a.fromJSON(t.projectedExtent),s=a.fromJSON(t.srcBufferExtent);let o=null;t.datumTransformationSteps&&(o=new c({steps:t.datumTransformationSteps})),(t.includeGCSGrid||b(e.spatialReference,s.spatialReference,o))&&await g();const r=t.rasterTransform?P(t.rasterTransform):null;return k({...t,projectedExtent:e,srcBufferExtent:s,datumTransformation:o,rasterTransform:r})}}export{T as default}; diff --git a/assets/RealisticTree.glsl-2623185f.js b/assets/RealisticTree.glsl-2623185f.js new file mode 100644 index 0000000..fa24fe4 --- /dev/null +++ b/assets/RealisticTree.glsl-2623185f.js @@ -0,0 +1 @@ +import{F as a}from"./index-080e108a.js";export{a as build}; diff --git a/assets/Rect-98da58d6.js b/assets/Rect-98da58d6.js new file mode 100644 index 0000000..5b2b3d6 --- /dev/null +++ b/assets/Rect-98da58d6.js @@ -0,0 +1 @@ +class a{constructor(h=0,t=0,i=0,s=0){this.x=h,this.y=t,this.width=i,this.height=s}get isEmpty(){return this.width<=0||this.height<=0}union(h){this.x=Math.min(this.x,h.x),this.y=Math.min(this.y,h.y),this.width=Math.max(this.width,h.width),this.height=Math.max(this.height,h.height)}}export{a as t}; diff --git a/assets/RefreshableLayerView-915e7f53.js b/assets/RefreshableLayerView-915e7f53.js new file mode 100644 index 0000000..d92c75a --- /dev/null +++ b/assets/RefreshableLayerView-915e7f53.js @@ -0,0 +1 @@ +import{ai as s,aj as t,al as h,aT as l,bn as o,bz as d}from"./index-080e108a.js";const y=r=>{let e=class extends r{initialize(){this.handles.add(l(()=>this.layer,"refresh",i=>{this.doRefresh(i.dataChanged).catch(a=>{o(a)||d.getLogger(this).error(a)})}),"RefreshableLayerView")}};return s([t()],e.prototype,"layer",void 0),e=s([h("esri.layers.mixins.RefreshableLayerView")],e),e};export{y as a}; diff --git a/assets/RelationshipQuery-39c07195.js b/assets/RelationshipQuery-39c07195.js new file mode 100644 index 0000000..0e10cb5 --- /dev/null +++ b/assets/RelationshipQuery-39c07195.js @@ -0,0 +1 @@ +import{ai as e,aj as o,bY as s,bc as a,al as d,cj as p,ck as l,cl as u}from"./index-080e108a.js";import{K as h}from"./Query-1c961d4c.js";var n;let t=n=class extends l{constructor(i){super(i),this.cacheHint=void 0,this.dynamicDataSource=void 0,this.gdbVersion=null,this.geometryPrecision=void 0,this.historicMoment=null,this.maxAllowableOffset=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.relationshipId=void 0,this.start=void 0,this.num=void 0,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.where=null}_writeHistoricMoment(i,r){r.historicMoment=i&&i.getTime()}writeStart(i,r){r.resultOffset=this.start,r.resultRecordCount=this.num||10,this.start>0&&this.where==null&&(r.definitionExpression="1=1")}clone(){return new n(u({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))}};e([o({type:Boolean,json:{write:!0}})],t.prototype,"cacheHint",void 0),e([o({type:h,json:{write:!0}})],t.prototype,"dynamicDataSource",void 0),e([o({type:String,json:{write:!0}})],t.prototype,"gdbVersion",void 0),e([o({type:Number,json:{write:!0}})],t.prototype,"geometryPrecision",void 0),e([o({type:Date})],t.prototype,"historicMoment",void 0),e([s("historicMoment")],t.prototype,"_writeHistoricMoment",null),e([o({type:Number,json:{write:!0}})],t.prototype,"maxAllowableOffset",void 0),e([o({type:[Number],json:{write:!0}})],t.prototype,"objectIds",void 0),e([o({type:[String],json:{write:!0}})],t.prototype,"orderByFields",void 0),e([o({type:[String],json:{write:!0}})],t.prototype,"outFields",void 0),e([o({type:a,json:{read:{source:"outSR"},write:{target:"outSR"}}})],t.prototype,"outSpatialReference",void 0),e([o({json:{write:!0}})],t.prototype,"relationshipId",void 0),e([o({type:Number,json:{read:{source:"resultOffset"}}})],t.prototype,"start",void 0),e([s("start"),s("num")],t.prototype,"writeStart",null),e([o({type:Number,json:{read:{source:"resultRecordCount"}}})],t.prototype,"num",void 0),e([o({json:{write:!0}})],t.prototype,"returnGeometry",void 0),e([o({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],t.prototype,"returnM",void 0),e([o({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],t.prototype,"returnZ",void 0),e([o({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],t.prototype,"where",void 0),t=n=e([d("esri.rest.support.RelationshipQuery")],t),t.from=p(t);const m=t;export{m as default}; diff --git a/assets/RibbonLine.glsl-0c86e4e2.js b/assets/RibbonLine.glsl-0c86e4e2.js new file mode 100644 index 0000000..fa03344 --- /dev/null +++ b/assets/RibbonLine.glsl-0c86e4e2.js @@ -0,0 +1 @@ +import{O,P as _}from"./index-080e108a.js";export{O as RIBBONLINE_NUM_ROUND_JOIN_SUBDIVISIONS,_ as build}; diff --git a/assets/RightAngleQuadVisualElement-8daf0594.js b/assets/RightAngleQuadVisualElement-8daf0594.js new file mode 100644 index 0000000..c5fa48e --- /dev/null +++ b/assets/RightAngleQuadVisualElement-8daf0594.js @@ -0,0 +1 @@ +import{am as q,ao as F,aQ as A,aD as C,iZ as z,ai as n,aj as _,al as V,aV as R,dT as p,i_ as y,i$ as G,j0 as g,h1 as O,dR as D,j1 as v,fs as h,j2 as b,j3 as f,j4 as M,j5 as j,b0 as E,aG as I,j6 as Q,gv as N,j7 as l,hw as w,j8 as S,b2 as U,j9 as Z,aZ as H,a_ as P,a$ as B,fu as L,gD as Y}from"./index-080e108a.js";import{t as k}from"./LineVisualElement-b605d10c.js";import{a as J}from"./VisualElementResources-e52972a5.js";class K{constructor(e){this._resourceFactory=e,this._resources=null,this._visible=!0,this._attached=!1,this._renderGroup=z.Outline}destroy(){this._destroyResources()}get resources(){return this._resources!=null?this._resources.external:null}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this._syncGeometriesToRenderer())}get attached(){return this._attached}set attached(e){e!==this._attached&&(this._attached=e,this._createOrDestroyResources())}get renderGroup(){return this._renderGroup}set renderGroup(e){var t;this._renderGroup=e;const r=(t=this._resources)==null?void 0:t.layerView;r&&(r.renderGroup=e)}recreate(){this.attached&&this._createResources()}recreateGeometry(){this._resourceFactory.recreateGeometry?this._resources!=null&&(this._ensureRenderGeometriesRemoved(),this._resourceFactory.recreateGeometry(this._resources.external),this._syncGeometriesToRenderer()):this.recreate()}_createOrDestroyResources(){this._attached?this._resources==null&&this._createResources():this._destroyResources()}_createResources(){var s;this._destroyResources();const e=this._resourceFactory.createResources(),r=new o({view:this._resourceFactory.view,renderGroup:this._renderGroup}),t=(s=this._resourceFactory.view.basemapTerrain)==null?void 0:s.overlayManager;this._resources={layerView:new o({view:this._resourceFactory.view,renderGroup:this._renderGroup}),external:e,geometriesAdded:!1},t&&(this._resources.drapeSourceRenderer=t.registerGeometryDrapeSource(r)),this._syncGeometriesToRenderer()}_destroyResources(){var r;if(this._resources==null)return;this._ensureRenderGeometriesRemoved();const e=(r=this._resourceFactory.view.basemapTerrain)==null?void 0:r.overlayManager;e&&e.unregisterDrapeSource(this._resources.layerView),this._resourceFactory.destroyResources(this._resources.external),this._resources=null}_syncGeometriesToRenderer(){this._visible?this._ensureRenderGeometriesAdded():this._ensureRenderGeometriesRemoved()}_ensureRenderGeometriesRemoved(){this._resources==null||this._resources.drapeSourceRenderer==null||this._resources.geometriesAdded&&(this._resources.drapeSourceRenderer.removeGeometries(this._resources.external.geometries,R.UPDATE),this._resources.geometriesAdded=!1)}_ensureRenderGeometriesAdded(){this._resources==null||this._resources.drapeSourceRenderer==null||this._resources.geometriesAdded||(this._resources.drapeSourceRenderer.addGeometries(this._resources.external.geometries,R.UPDATE),this._resources.geometriesAdded=!0)}}let o=class extends q(F){constructor(u){super(u),this.drapeSourceType=A.Features,this.updatePolicy=C.SYNC,this.renderGroup=z.Outline}};n([_({constructOnly:!0})],o.prototype,"view",void 0),n([_({readOnly:!0})],o.prototype,"drapeSourceType",void 0),n([_()],o.prototype,"renderGroup",void 0),o=n([V("DrapedVisualElementLayerView")],o);class W extends k{constructor({view:e,isDraped:r}){super(e),this._isDraped=!1,this.object3dResources=new J(this.createObject3DResourceFactory(e)),this.drapedResources=new K(this.createDrapedResourceFactory(e)),this.isDraped=r??!1}get isDraped(){return this._isDraped}set isDraped(e){e!==this._isDraped&&(this._isDraped=e,this.object3dResources.attached=this.attached&&!e,this.drapedResources.attached=this.attached&&e)}get renderGroup(){return this.drapedResources.renderGroup}set renderGroup(e){this.drapedResources.renderGroup=e}createResources(){this.object3dResources.attached=!this._isDraped,this.drapedResources.attached=this._isDraped}destroyResources(){this.object3dResources.attached=!1,this.drapedResources.attached=!1}recreate(){this.object3dResources.recreate(),this.drapedResources.recreate()}recreateGeometry(){this.object3dResources.recreateGeometry(),this.drapedResources.recreateGeometry()}destroy(){this.object3dResources.destroy(),this.drapedResources.destroy(),super.destroy()}updateVisibility(e){this.object3dResources.visible=e,this.drapedResources.visible=e}}class se extends W{constructor(e){super(e),this._maxSize=0,this._position=p(),this._up=p(),this._right=p(),this._renderOccluded=y.OccludeAndTransparent,this._color=G(1,0,0,1),this._outlineColor=G(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=y.Opaque,this.applyProps(e)}createObject3DResourceFactory(e){return{view:e,createResources:r=>this._createObject3DResources(r),destroyResources:r=>this._destroyObject3DResources(r),cameraChanged:()=>this._updateTransformObject3D()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:r=>this._destroyDrapedResources(r)}}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get color(){return this._color}set color(e){g(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){g(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){const r=this._outlineSize===0!=(e===0);this._outlineSize=e,r?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:r,next:t}){this._maxSize=Math.min(O(r,e),O(r,t))/3,D(this._up,v(this._up,e,r)),D(this._right,v(this._right,t,r)),h(this._position,r),this.recreateGeometry()}_createObject3DResources(e){const r=new b(this._quadMaterialParameters),t=this._outlineSize===0?void 0:new f(this._outlineMaterialParameters);return this._createObject3DGeometries(e,r,t),{quadMaterial:r,outlineMaterial:t,forEach:s=>{s(r),t&&s(t)}}}_destroyObject3DResources(e){var r;e.quadMaterial.dispose(),(r=e.outlineMaterial)==null||r.dispose()}_createObject3DGeometries(e,r,t){if(M(this._up,j)&&M(this._right,j))return;const s=this._createGeometries(r,t);for(const c of s)e.addGeometry(c);this._updateTransformObject3D(e)}_createDrapedResources(){const e=new b(this._quadMaterialParameters),r=this._outlineSize===0?void 0:new f(this._outlineMaterialParameters),t=this._createGeometries(e,r).map(s=>new E(s));return this._setTransformDraped(t),{quadMaterial:e,outlineMaterial:r,geometries:t,pixelRatioHandle:I(()=>this.view.state.contentPixelRatio,()=>{this.drapedResources.recreateGeometry()})}}_destroyDrapedResources(e){var r;e.pixelRatioHandle.remove(),e.geometries=[],(r=e.outlineMaterial)==null||r.dispose(),e.quadMaterial.dispose()}_createGeometries(e,r){const{up:t,right:s,corner:c}=this._getVertices(),a=this._quadGeometryData(t,s,c,e);return r?[a,Q(r,[t,c,s])]:[a]}_getVertices(){let e=this._up,r=this._right;const t=N(l.get(),e,r);return this.isDraped&&(e=h(l.get(),e),r=h(l.get(),r),e[2]=0,r[2]=0,t[2]=0),{up:e,right:r,corner:t}}_updateTransform(){this.isDraped?this.drapedResources.recreateGeometry():this._updateTransformObject3D()}_updateTransformObject3D(e=this.object3dResources.object){if(!e)return;const r=this.view.state.camera,t=this._size*r.computeScreenPixelSizeAt(this._position),s=Math.min(this._maxSize,t);w(i,this._position),S(i,i,[s,s,s]),e.transformation=i}_setTransformDraped(e){if(e.length===0)return;const{view:{basemapTerrain:{overlayManager:r},state:{contentPixelRatio:t}}}=this,{_position:s,_size:c}=this,a=h(l.get(),s);a[2]=U;const d=X;d.spatialReference=r.renderer.spatialReference,d.x=a[0],d.y=a[1];const T=c*(r.overlayPixelSizeInMapUnits(d)*t),m=Math.min(this._maxSize,T);w(i,a),S(i,i,[m,m,1]);for(const x of e)x.updateTransformation($=>{Z($,i)})}_quadGeometryData(e,r,t,s){return new H(s,[[P.POSITION,new B([0,0,0,...r,...e,...t],3,!0)]],[[P.POSITION,[0,1,2,1,2,3]]])}get _quadMaterialParameters(){return{color:this._color,transparent:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:this._renderOccluded}}_updateQuadMaterial(){var e,r;(e=this.object3dResources.resources)==null||e.quadMaterial.setParameters(this._quadMaterialParameters),(r=this.drapedResources.resources)==null||r.quadMaterial.setParameters(this._quadMaterialParameters)}get _outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded}}_updateOutlineMaterial(){var e,r,t,s;(r=(e=this.object3dResources.resources)==null?void 0:e.outlineMaterial)==null||r.setParameters(this._outlineMaterialParameters),(s=(t=this.drapedResources.resources)==null?void 0:t.outlineMaterial)==null||s.setParameters(this._outlineMaterialParameters)}}const i=L(),X=Y(0,0,void 0,null);export{se as P,W as t}; diff --git a/assets/RouteLayer-fdf5da4e.js b/assets/RouteLayer-fdf5da4e.js new file mode 100644 index 0000000..00577e6 --- /dev/null +++ b/assets/RouteLayer-fdf5da4e.js @@ -0,0 +1,2 @@ +import{ai as r,aj as s,jy as C,al as A,ck as L,bJ as z,bK as he,bg as nt,d2 as I,ay as P,bY as W,bz as Ze,ar as M,kR as fe,at as re,ml as Se,kN as at,cm as ze,cp as Ve,c7 as Ke,aK as K,c8 as be,ca as He,bc as q,dZ as Qe,cz as Pe,cr as lt,cs as ut,jo as pt,aF as j,eQ as ct,eS as yt,cX as dt,aT as mt,cO as ft,c9 as ht,eo as Ce,bZ as ke,bX as vt,bf as wt,b5 as gt,b9 as St,bn as bt,cC as Tt,bd as Bt,be as Nt,cf as Pt,aA as Rt}from"./index-080e108a.js";import"./UniqueValueRenderer-fef4204d.js";import{o as $t}from"./jsonUtils-f73b3833.js";import{O as It}from"./MultiOriginJSONSupport-e4912ffd.js";import{i as At}from"./originUtils-1469eeaf.js";import{c as jt}from"./OperationalLayer-0e8f8b28.js";import{j as Ot}from"./PortalLayer-310c2800.js";import{l as Lt}from"./portalItemUtils-792a27e1.js";import{U as H,y as Re,s as Dt,R as Mt,r as Xe,a as $e,b as Ct,n as kt,o as Jt,w as _t,d as xt,D as Je,e as Ft,k as Et,i as Gt,f as Ut,l as Wt,m as oe,c as se,C as X,T as Y,j as ee,O as te,S as le,g as qt}from"./Stop-9d81fe58.js";import{b as Zt}from"./normalizeUtils-cf8b8053.js";import{d as E}from"./FeatureSet-111cb247.js";import"./diffUtils-590c9088.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./multiOriginJSONSupportUtils-c978f4c3.js";import"./commonProperties-30089b06.js";import"./normalizeUtilsCommon-500064b3.js";let G=class extends L{constructor(t){super(t),this.break=new z({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}}),this.first=new z({color:[0,255,0],size:20,outline:{color:[255,255,255],width:4}}),this.unlocated=new z({color:[255,0,0],size:12,outline:{color:[255,255,255],width:3}}),this.last=new z({color:[255,0,0],size:20,outline:{color:[255,255,255],width:4}}),this.middle=new z({color:[51,51,51],size:12,outline:{color:[0,122,194],width:3}}),this.waypoint=new z({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}})}};r([s({types:C})],G.prototype,"break",void 0),r([s({types:C})],G.prototype,"first",void 0),r([s({types:C})],G.prototype,"unlocated",void 0),r([s({types:C})],G.prototype,"last",void 0),r([s({types:C})],G.prototype,"middle",void 0),r([s({types:C})],G.prototype,"waypoint",void 0),G=r([A("esri.layers.support.RouteStopSymbols")],G);const Ye=G;let x=class extends L{constructor(t){super(t),this.directionLines=new he({color:[0,122,194],width:6}),this.directionPoints=new z({color:[255,255,255],size:6,outline:{color:[0,122,194],width:2}}),this.pointBarriers=new z({style:"x",size:10,outline:{color:[255,0,0],width:3}}),this.polygonBarriers=new nt({color:[255,170,0,.6],outline:{width:7.5,color:[255,0,0,.6]}}),this.polylineBarriers=new he({width:7.5,color:[255,85,0,.7]}),this.routeInfo=new he({width:8,color:[20,89,127]}),this.stops=new Ye}};r([s({types:C})],x.prototype,"directionLines",void 0),r([s({types:C})],x.prototype,"directionPoints",void 0),r([s({types:C})],x.prototype,"pointBarriers",void 0),r([s({types:C})],x.prototype,"polygonBarriers",void 0),r([s({types:C})],x.prototype,"polylineBarriers",void 0),r([s({types:C})],x.prototype,"routeInfo",void 0),r([s({type:Ye})],x.prototype,"stops",void 0),x=r([A("esri.layers.support.RouteSymbols")],x);const et=x;let J=class extends L{constructor(t){super(t),this.dataType=null,this.name=null,this.parameterNames=null,this.restrictionUsageParameterName=null,this.timeNeutralAttributeName=null,this.trafficSupport=null,this.units=null,this.usageType=null}};r([s({type:String})],J.prototype,"dataType",void 0),r([I(H,{ignoreUnknown:!1})],J.prototype,"name",void 0),r([s({type:[String]})],J.prototype,"parameterNames",void 0),r([s({type:String})],J.prototype,"restrictionUsageParameterName",void 0),r([I(Re,{ignoreUnknown:!1})],J.prototype,"timeNeutralAttributeName",void 0),r([s({type:String})],J.prototype,"trafficSupport",void 0),r([I(Dt)],J.prototype,"units",void 0),r([I(Mt)],J.prototype,"usageType",void 0),J=r([A("esri.rest.support.NetworkAttribute")],J);const zt=J;let Z=class extends L{constructor(t){super(t),this.buildTime=null,this.name=null,this.networkAttributes=null,this.networkSources=null,this.state=null}};r([s({type:Number})],Z.prototype,"buildTime",void 0),r([s({type:String})],Z.prototype,"name",void 0),r([s({type:[zt]})],Z.prototype,"networkAttributes",void 0),r([s()],Z.prototype,"networkSources",void 0),r([s({type:String})],Z.prototype,"state",void 0),Z=r([A("esri.rest.support.NetworkDataset")],Z);const Vt=Z;let $=class extends L{constructor(t){super(t),this.accumulateAttributeNames=null,this.attributeParameterValues=null,this.currentVersion=null,this.defaultTravelMode=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsSupportedLanguages=null,this.directionsTimeAttribute=null,this.hasZ=null,this.impedance=null,this.networkDataset=null,this.supportedTravelModes=null}readAccumulateAttributes(t){return t==null?null:t.map(o=>H.fromJSON(o))}writeAccumulateAttributes(t,o,i){t!=null&&t.length&&(o[i]=t.map(n=>H.toJSON(n)))}readDefaultTravelMode(t,o){var n,u;const i=((n=o.supportedTravelModes)==null?void 0:n.find(({id:p})=>p===o.defaultTravelMode))??((u=o.supportedTravelModes)==null?void 0:u.find(({itemId:p})=>p===o.defaultTravelMode));return i?$e.fromJSON(i):null}};r([s()],$.prototype,"accumulateAttributeNames",void 0),r([P("accumulateAttributeNames")],$.prototype,"readAccumulateAttributes",null),r([W("accumulateAttributeNames")],$.prototype,"writeAccumulateAttributes",null),r([s()],$.prototype,"attributeParameterValues",void 0),r([s()],$.prototype,"currentVersion",void 0),r([s()],$.prototype,"defaultTravelMode",void 0),r([P("defaultTravelMode",["defaultTravelMode","supportedTravelModes"])],$.prototype,"readDefaultTravelMode",null),r([s()],$.prototype,"directionsLanguage",void 0),r([I(Xe)],$.prototype,"directionsLengthUnits",void 0),r([s()],$.prototype,"directionsSupportedLanguages",void 0),r([I(Re,{ignoreUnknown:!1})],$.prototype,"directionsTimeAttribute",void 0),r([s()],$.prototype,"hasZ",void 0),r([I(H,{ignoreUnknown:!1})],$.prototype,"impedance",void 0),r([s({type:Vt})],$.prototype,"networkDataset",void 0),r([s({type:[$e]})],$.prototype,"supportedTravelModes",void 0),$=r([A("esri.rest.support.NetworkServiceDescription")],$);const Kt=$,Ht=Ze.getLogger("esri.rest.networkService");function ue(e,t,o,i){i[o]=[t.length,t.length+e.length],e.forEach(n=>{t.push(n.geometry)})}function Qt(e,t){for(let o=0;o=10.4?er(e,t,o):Yt(e,o),{defaultTravelMode:p,supportedTravelModes:y}=await u;return n.defaultTravelMode=p,n.supportedTravelModes=y,Kt.fromJSON(n)}async function Yt(e,t){var w,d,a;const o=fe({f:"json"},t),{data:i}=await re(e.replace(/\/rest\/.*$/i,"/info"),o);if(!i||!i.owningSystemUrl)return{supportedTravelModes:[],defaultTravelMode:null};const{owningSystemUrl:n}=i,u=Se(n)+"/sharing/rest/portals/self",{data:p}=await re(u,o),y=at("helperServices.routingUtilities.url",p);if(!y)return{supportedTravelModes:[],defaultTravelMode:null};const v=ze(n),S=/\/solve$/i.test(v.path)?"Route":/\/solveclosestfacility$/i.test(v.path)?"ClosestFacility":"ServiceAreas",l=fe({f:"json",serviceName:S},t),b=Se(y)+"/GetTravelModes/execute",N=await re(b,l),B=[];let h=null;if((d=(w=N==null?void 0:N.data)==null?void 0:w.results)!=null&&d.length){const T=N.data.results;for(const f of T)if(f.paramName==="supportedTravelModes"){if((a=f.value)!=null&&a.features){for(const{attributes:R}of f.value.features)if(R){const k=JSON.parse(R.TravelMode);B.push(k)}}}else f.paramName==="defaultTravelMode"&&(h=f.value)}return{supportedTravelModes:B,defaultTravelMode:h}}async function er(e,t,o){try{const i=fe({f:"json",token:t},o),n=Se(e)+"/retrieveTravelModes",{data:{supportedTravelModes:u,defaultTravelMode:p}}=await re(n,i);return{supportedTravelModes:u,defaultTravelMode:p}}catch(i){throw new M("network-service:retrieveTravelModes","Could not get to the NAServer's retrieveTravelModes.",{error:i})}}const _e=new Ve({esriJobMessageTypeInformative:"informative",esriJobMessageTypeProcessDefinition:"process-definition",esriJobMessageTypeProcessStart:"process-start",esriJobMessageTypeProcessStop:"process-stop",esriJobMessageTypeWarning:"warning",esriJobMessageTypeError:"error",esriJobMessageTypeEmpty:"empty",esriJobMessageTypeAbort:"abort"});let ie=class extends L{constructor(t){super(t),this.description=null,this.type=null}};r([s({type:String,json:{write:!0}})],ie.prototype,"description",void 0),r([s({type:String,json:{read:_e.read,write:_e.write}})],ie.prototype,"type",void 0),ie=r([A("esri.rest.support.GPMessage")],ie);const tr=ie,xe=new Ve({0:"informative",1:"process-definition",2:"process-start",3:"process-stop",50:"warning",100:"error",101:"empty",200:"abort"});let de=class extends tr{constructor(t){super(t),this.type=null}};r([s({type:String,json:{read:xe.read,write:xe.write}})],de.prototype,"type",void 0),de=r([A("esri.rest.support.NAMessage")],de);const rr=de;let ne=class extends L{constructor(t){super(t)}};r([s({json:{read:{source:"string"}}})],ne.prototype,"text",void 0),r([I(Ct,{name:"stringType"})],ne.prototype,"type",void 0),ne=r([A("esri.rest.support.DirectionsString")],ne);const rt=ne;let U=class extends L{constructor(t){super(t),this.arriveTime=null,this.arriveTimeOffset=null,this.geometry=null,this.strings=null}readArriveTimeOffset(t,o){return kt(o.ETA,o.arriveTimeUTC)}readGeometry(t,o){return Ke.fromJSON(o.point)}};r([s({type:Date,json:{read:{source:"arriveTimeUTC"}}})],U.prototype,"arriveTime",void 0),r([s()],U.prototype,"arriveTimeOffset",void 0),r([P("arriveTimeOffset",["arriveTimeUTC","ETA"])],U.prototype,"readArriveTimeOffset",null),r([s({type:Ke})],U.prototype,"geometry",void 0),r([P("geometry",["point"])],U.prototype,"readGeometry",null),r([s({type:[rt]})],U.prototype,"strings",void 0),U=r([A("esri.rest.support.DirectionsEvent")],U);const or=U;function sr(e){if(e==null||e==="")return null;let t=0,o=0,i=0,n=0;const u=[];let p,y,v,S,l,b,N,B,h=0,w=0,d=0;if(l=e.match(/((\+|\-)[^\+\-\|]+|\|)/g),l||(l=[]),parseInt(l[h],32)===0){h=2;const a=parseInt(l[h],32);h++,b=parseInt(l[h],32),h++,1&a&&(w=l.indexOf("|")+1,N=parseInt(l[w],32),w++),2&a&&(d=l.indexOf("|",w)+1,B=parseInt(l[d],32),d++)}else b=parseInt(l[h],32),h++;for(;h0,hasM:d>0}}let Q=class extends K{constructor(e){super(e),this.events=null,this.strings=null}readGeometry(e,t){const o=sr(t.compressedGeometry);return o!=null?be.fromJSON(o):null}};r([s({type:[or]})],Q.prototype,"events",void 0),r([P("geometry",["compressedGeometry"])],Q.prototype,"readGeometry",null),r([s({type:[rt]})],Q.prototype,"strings",void 0),Q=r([A("esri.rest.support.DirectionsFeature")],Q);const ir=Q;function nr(e,t){if(e.length===0)return new be({spatialReference:t});const o=[];for(const p of e)for(const y of p.paths)o.push(...y);const i=[];o.forEach((p,y)=>{y!==0&&p[0]===o[y-1][0]&&p[1]===o[y-1][1]||i.push(p)});const{hasM:n,hasZ:u}=e[0];return new be({hasM:n,hasZ:u,paths:[i],spatialReference:t})}let O=class extends E{constructor(e){super(e),this.extent=null,this.features=[],this.geometryType="polyline",this.routeId=null,this.routeName=null,this.totalDriveTime=null,this.totalLength=null,this.totalTime=null}readFeatures(e,t){if(!e)return[];const o=t.summary.envelope.spatialReference??t.spatialReference,i=o&&q.fromJSON(o);return e.map(n=>{const u=ir.fromJSON(n);if(u.geometry!=null&&(u.geometry.spatialReference=i),u.events!=null)for(const p of u.events)p.geometry!=null&&(p.geometry.spatialReference=i);return u})}get mergedGeometry(){return this.features?nr(this.features.map(({geometry:e})=>e),this.extent.spatialReference):null}get strings(){return this.features.map(({strings:e})=>e).flat().filter(Qe)}};r([s({type:He,json:{read:{source:"summary.envelope"}}})],O.prototype,"extent",void 0),r([s({nonNullable:!0})],O.prototype,"features",void 0),r([P("features")],O.prototype,"readFeatures",null),r([s()],O.prototype,"geometryType",void 0),r([s({readOnly:!0})],O.prototype,"mergedGeometry",null),r([s()],O.prototype,"routeId",void 0),r([s()],O.prototype,"routeName",void 0),r([s({value:null,readOnly:!0})],O.prototype,"strings",null),r([s({json:{read:{source:"summary.totalDriveTime"}}})],O.prototype,"totalDriveTime",void 0),r([s({json:{read:{source:"summary.totalLength"}}})],O.prototype,"totalLength",void 0),r([s({json:{read:{source:"summary.totalTime"}}})],O.prototype,"totalTime",void 0),O=r([A("esri.rest.support.DirectionsFeatureSet")],O);const ar=O;let D=class extends L{constructor(t){super(t),this.directionLines=null,this.directionPoints=null,this.directions=null,this.route=null,this.routeName=null,this.stops=null,this.traversedEdges=null,this.traversedJunctions=null,this.traversedTurns=null}};r([s({type:E,json:{write:!0}})],D.prototype,"directionLines",void 0),r([s({type:E,json:{write:!0}})],D.prototype,"directionPoints",void 0),r([s({type:ar,json:{write:!0}})],D.prototype,"directions",void 0),r([s({type:K,json:{write:!0}})],D.prototype,"route",void 0),r([s({type:String,json:{write:!0}})],D.prototype,"routeName",void 0),r([s({type:[K],json:{write:!0}})],D.prototype,"stops",void 0),r([s({type:E,json:{write:!0}})],D.prototype,"traversedEdges",void 0),r([s({type:E,json:{write:!0}})],D.prototype,"traversedJunctions",void 0),r([s({type:E,json:{write:!0}})],D.prototype,"traversedTurns",void 0),D=r([A("esri.rest.support.RouteResult")],D);const lr=D;function ve(e){return e?E.fromJSON(e).features.filter(Qe):[]}let _=class extends L{constructor(t){super(t),this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.routeResults=null}readPointBarriers(t,o){return ve(o.barriers)}readPolylineBarriers(t){return ve(t)}readPolygonBarriers(t){return ve(t)}};r([s({type:[rr]})],_.prototype,"messages",void 0),r([s({type:[K]})],_.prototype,"pointBarriers",void 0),r([P("pointBarriers",["barriers"])],_.prototype,"readPointBarriers",null),r([s({type:[K]})],_.prototype,"polylineBarriers",void 0),r([P("polylineBarriers")],_.prototype,"readPolylineBarriers",null),r([s({type:[K]})],_.prototype,"polygonBarriers",void 0),r([P("polygonBarriers")],_.prototype,"readPolygonBarriers",null),r([s({type:[lr]})],_.prototype,"routeResults",void 0),_=r([A("esri.rest.support.RouteSolveResult")],_);const ur=_;function pe(e){return e instanceof E}async function pr(e,t,o){const i=[],n=[],u={},p={},y=ze(e),{path:v}=y;pe(t.stops)&&ue(t.stops.features,n,"stops.features",u),pe(t.pointBarriers)&&ue(t.pointBarriers.features,n,"pointBarriers.features",u),pe(t.polylineBarriers)&&ue(t.polylineBarriers.features,n,"polylineBarriers.features",u),pe(t.polygonBarriers)&&ue(t.polygonBarriers.features,n,"polygonBarriers.features",u);const S=await Zt(n);for(const B in u){const h=u[B];i.push(B),p[B]=S.slice(h[0],h[1])}if(Xt(p,i)){let B=null;try{B=await tt(v,t.apiKey,o)}catch{}B&&!B.hasZ&&Qt(p,i)}for(const B in p)p[B].forEach((h,w)=>{t.get(B)[w].geometry=h});const l={...o,query:{...y.query,...Jt(t),f:"json"}},b=v.endsWith("/solve")?v:`${v}/solve`,{data:N}=await re(b,l);return cr(N)}function cr(e){const{barriers:t,directionLines:o,directionPoints:i,directions:n,messages:u,polygonBarriers:p,polylineBarriers:y,routes:v,stops:S,traversedEdges:l,traversedJunctions:b,traversedTurns:N}=e,B=a=>{const T=w.find(R=>R.routeName===a);if(T!=null)return T;const f={routeId:w.length+1,routeName:a};return w.push(f),f},h=a=>{const T=w.find(R=>R.routeId===a);if(T!=null)return T;const f={routeId:a,routeName:null};return w.push(f),f},w=[];v==null||v.features.forEach((a,T)=>{a.geometry.spatialReference=v.spatialReference??void 0;const f=a.attributes.Name,R=T+1;w.push({routeId:R,routeName:f,route:a})}),n==null||n.forEach(a=>{const{routeName:T}=a;B(T).directions=a});const d=((S==null?void 0:S.features.every(a=>a.attributes.RouteName==null))??!1)&&w.length>0?w[0].routeName:null;return S==null||S.features.forEach(a=>{var R;a.geometry&&((R=a.geometry).spatialReference??(R.spatialReference=S.spatialReference??void 0));const T=d??a.attributes.RouteName,f=B(T);f.stops??(f.stops=[]),f.stops.push(a)}),o==null||o.features.forEach(a=>{const T=a.attributes.RouteID,f=h(T),{geometryType:R,spatialReference:k}=o;f.directionLines??(f.directionLines={features:[],geometryType:R,spatialReference:k}),f.directionLines.features.push(a)}),i==null||i.features.forEach(a=>{const T=a.attributes.RouteID,f=h(T),{geometryType:R,spatialReference:k}=i;f.directionPoints??(f.directionPoints={features:[],geometryType:R,spatialReference:k}),f.directionPoints.features.push(a)}),l==null||l.features.forEach(a=>{const T=a.attributes.RouteID,f=h(T),{geometryType:R,spatialReference:k}=l;f.traversedEdges??(f.traversedEdges={features:[],geometryType:R,spatialReference:k}),f.traversedEdges.features.push(a)}),b==null||b.features.forEach(a=>{const T=a.attributes.RouteID,f=h(T),{geometryType:R,spatialReference:k}=b;f.traversedJunctions??(f.traversedJunctions={features:[],geometryType:R,spatialReference:k}),f.traversedJunctions.features.push(a)}),N==null||N.features.forEach(a=>{const T=a.attributes.RouteID,f=h(T);f.traversedTurns??(f.traversedTurns={features:[]}),f.traversedTurns.features.push(a)}),ur.fromJSON({routeResults:w,barriers:t,polygonBarriers:p,polylineBarriers:y,messages:u})}const yr={type:String,json:{read:{source:"token"},write:{target:"token"}}};let F=class extends Pe(L){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.geometry=null,this.geometryType=null,this.name=null,this.spatialRelationship=null,this.type="layer",this.where=null}};r([s({type:Boolean,json:{write:!0}})],F.prototype,"doNotLocateOnRestrictedElements",void 0),r([s({types:lt,json:{read:ut,write:!0}})],F.prototype,"geometry",void 0),r([I(_t)],F.prototype,"geometryType",void 0),r([s({type:String,json:{name:"layerName",write:!0}})],F.prototype,"name",void 0),r([I(xt,{name:"spatialRel"})],F.prototype,"spatialRelationship",void 0),r([s({type:String,json:{write:!0}})],F.prototype,"type",void 0),r([s({type:String,json:{write:!0}})],F.prototype,"where",void 0),F=r([A("esri.rest.support.DataLayer")],F);const dr=F;var Te;let me=Te=class extends E{constructor(e){super(e),this.doNotLocateOnRestrictedElements=null}clone(){return new Te({doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements,...this.cloneProperties()})}};r([s({type:Boolean,json:{write:!0}})],me.prototype,"doNotLocateOnRestrictedElements",void 0),me=Te=r([A("esri.rest.support.NetworkFeatureSet")],me);const mr=me;let ae=class extends Pe(L){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.url=null}};r([s({type:Boolean,json:{write:!0}})],ae.prototype,"doNotLocateOnRestrictedElements",void 0),r([s({type:String,json:{write:!0}})],ae.prototype,"url",void 0),ae=r([A("esri.rest.support.NetworkUrl")],ae);const fr=ae;var Be;let c=Be=class extends Pe(L){constructor(e){super(e),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsOutputType=null,this.directionsStyleName=null,this.directionsTimeAttribute=null,this.findBestSequence=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines="true-shape",this.outSpatialReference=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnBarriers=!1,this.returnDirections=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.returnRoutes=!0,this.returnStops=!1,this.returnTraversedEdges=null,this.returnTraversedJunctions=null,this.returnTraversedTurns=null,this.returnZ=!0,this.startTime=null,this.startTimeIsUTC=!0,this.stops=null,this.timeWindowsAreUTC=null,this.travelMode=null,this.useHierarchy=null,this.useTimeWindows=null}static from(e){return pt(Be,e)}readAccumulateAttributes(e){return e==null?null:e.map(t=>H.fromJSON(t))}writeAccumulateAttributes(e,t,o){e!=null&&e.length&&(t[o]=e.map(i=>H.toJSON(i)))}writePointBarriers(e,t,o){ce(e,t,o)}writePolygonBarrier(e,t,o){ce(e,t,o)}writePolylineBarrier(e,t,o){ce(e,t,o)}readRestrictionAttributes(e){return e==null?null:e.map(t=>Je.fromJSON(t))}writeRestrictionAttributes(e,t,o){e!=null&&e.length&&(t[o]=e.map(i=>Je.toJSON(i)))}readStartTime(e,t){const{startTime:o}=t;return o==null?null:o==="now"?"now":new Date(o)}writeStartTime(e,t){e!=null&&(t.startTime=e==="now"?"now":e.getTime())}readStops(e,t){return Sr(t.stops)}writeStops(e,t,o){ce(e,t,o)}};r([s({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],c.prototype,"accumulateAttributes",void 0),r([P("accumulateAttributes")],c.prototype,"readAccumulateAttributes",null),r([W("accumulateAttributes")],c.prototype,"writeAccumulateAttributes",null),r([s(yr)],c.prototype,"apiKey",void 0),r([s({json:{write:!0}})],c.prototype,"attributeParameterValues",void 0),r([s({type:String,json:{write:!0}})],c.prototype,"directionsLanguage",void 0),r([I(Xe)],c.prototype,"directionsLengthUnits",void 0),r([I(Ft)],c.prototype,"directionsOutputType",void 0),r([I(Et)],c.prototype,"directionsStyleName",void 0),r([I(Re,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],c.prototype,"directionsTimeAttribute",void 0),r([s({type:Boolean,json:{write:!0}})],c.prototype,"findBestSequence",void 0),r([s({type:Number,json:{write:!0}})],c.prototype,"geometryPrecision",void 0),r([s({type:Number,json:{write:!0}})],c.prototype,"geometryPrecisionM",void 0),r([s({type:Number,json:{write:!0}})],c.prototype,"geometryPrecisionZ",void 0),r([s({type:Boolean,json:{write:!0}})],c.prototype,"ignoreInvalidLocations",void 0),r([I(H,{name:"impedanceAttributeName",ignoreUnknown:!1})],c.prototype,"impedanceAttribute",void 0),r([s({type:Number,json:{write:!0}})],c.prototype,"outputGeometryPrecision",void 0),r([I(Gt)],c.prototype,"outputGeometryPrecisionUnits",void 0),r([I(Ut)],c.prototype,"outputLines",void 0),r([s({type:q,json:{name:"outSR",write:!0}})],c.prototype,"outSpatialReference",void 0),r([s({json:{write:!0}})],c.prototype,"overrides",void 0),r([s({json:{name:"barriers",write:!0}})],c.prototype,"pointBarriers",void 0),r([W("pointBarriers")],c.prototype,"writePointBarriers",null),r([s({json:{write:!0}})],c.prototype,"polygonBarriers",void 0),r([W("polygonBarriers")],c.prototype,"writePolygonBarrier",null),r([s({json:{write:!0}})],c.prototype,"polylineBarriers",void 0),r([W("polylineBarriers")],c.prototype,"writePolylineBarrier",null),r([s({type:Boolean,json:{write:!0}})],c.prototype,"preserveFirstStop",void 0),r([s({type:Boolean,json:{write:!0}})],c.prototype,"preserveLastStop",void 0),r([s({type:Boolean,json:{write:!0}})],c.prototype,"preserveObjectID",void 0),r([s({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],c.prototype,"restrictionAttributes",void 0),r([P("restrictionAttributes")],c.prototype,"readRestrictionAttributes",null),r([W("restrictionAttributes")],c.prototype,"writeRestrictionAttributes",null),r([I(Wt)],c.prototype,"restrictUTurns",void 0),r([s({type:Boolean,json:{write:!0}})],c.prototype,"returnBarriers",void 0),r([s({type:Boolean,json:{write:!0}})],c.prototype,"returnDirections",void 0),r([s({type:Boolean,json:{write:!0}})],c.prototype,"returnPolygonBarriers",void 0),r([s({type:Boolean,json:{write:!0}})],c.prototype,"returnPolylineBarriers",void 0),r([s({type:Boolean,json:{write:!0}})],c.prototype,"returnRoutes",void 0),r([s({type:Boolean,json:{write:!0}})],c.prototype,"returnStops",void 0),r([s({type:Boolean,json:{write:!0}})],c.prototype,"returnTraversedEdges",void 0),r([s({type:Boolean,json:{write:!0}})],c.prototype,"returnTraversedJunctions",void 0),r([s({type:Boolean,json:{write:!0}})],c.prototype,"returnTraversedTurns",void 0),r([s({type:Boolean,json:{write:!0}})],c.prototype,"returnZ",void 0),r([s({type:Date,json:{type:Number,write:!0}})],c.prototype,"startTime",void 0),r([P("startTime")],c.prototype,"readStartTime",null),r([W("startTime")],c.prototype,"writeStartTime",null),r([s({type:Boolean,json:{write:!0}})],c.prototype,"startTimeIsUTC",void 0),r([s({json:{write:!0}})],c.prototype,"stops",void 0),r([P("stops")],c.prototype,"readStops",null),r([W("stops")],c.prototype,"writeStops",null),r([s({type:Boolean,json:{write:!0}})],c.prototype,"timeWindowsAreUTC",void 0),r([s({type:$e,json:{write:!0}})],c.prototype,"travelMode",void 0),r([s({type:Boolean,json:{write:!0}})],c.prototype,"useHierarchy",void 0),r([s({type:Boolean,json:{write:!0}})],c.prototype,"useTimeWindows",void 0),c=Be=r([A("esri.rest.support.RouteParameters")],c);const Fe=c;function hr(e){return e&&"type"in e}function vr(e){return e&&"features"in e&&"doNotLocateOnRestrictedElements"in e}function wr(e){return e&&"url"in e}function gr(e){return e&&"features"in e}function Sr(e){return hr(e)?dr.fromJSON(e):wr(e)?fr.fromJSON(e):vr(e)?mr.fromJSON(e):gr(e)?E.fromJSON(e):null}function ce(e,t,o){e!=null&&(t[o]=j.isCollection(e)?{features:e.toArray().map(i=>i.toJSON())}:e.toJSON())}function we(e){return e.length?e:null}function Ne(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:Ne("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:Ne("esriGeometryPolyline")}}}function ye(e){return"layers"in e}function br(e){return e.declaredClass==="esri.rest.support.FeatureSet"}function Tr(e){return e.declaredClass==="esri.rest.support.NetworkFeatureSet"}function Br(e,t,o){var Ie,Ae,je,Oe,Le,De;const i=(Ie=t.networkDataset)==null?void 0:Ie.networkAttributes,n=(i==null?void 0:i.filter(({usageType:m})=>m==="cost"))??[],u=o.travelMode??t.defaultTravelMode;if(u==null)return void st.warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:p,distanceAttributeName:y}=u,v=n.find(({name:m})=>m===p),S=n.find(({name:m})=>m===y),l=((Ae=o.travelMode)==null?void 0:Ae.impedanceAttributeName)??o.impedanceAttribute??t.impedance,b=v==null?void 0:v.units,N=S==null?void 0:S.units;if(!b||!N)throw new M("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const B=o.directionsLanguage??t.directionsLanguage,h=o.accumulateAttributes??t.accumulateAttributeNames??[],w=new Set(n.filter(({name:m})=>m===p||m===y||m===l||m!=null&&h.includes(m)).map(({name:m})=>m)),d=m=>{for(const Me in m)w.has(Me)||delete m[Me]};for(const m of e.pointBarriers)m.costs!=null&&(m.addedCost=m.costs[l]??0,d(m.costs));for(const m of e.polygonBarriers)m.costs!=null&&(m.scaleFactor=m.costs[l]??1,d(m.costs));for(const m of e.polylineBarriers)m.costs!=null&&(m.scaleFactor=m.costs[l]??1,d(m.costs));const{routeInfo:a}=e,{findBestSequence:T,preserveFirstStop:f,preserveLastStop:R,startTimeIsUTC:k,timeWindowsAreUTC:it}=o;a.analysisSettings=new qt({accumulateAttributes:h,directionsLanguage:B,findBestSequence:T,preserveFirstStop:f,preserveLastStop:R,startTimeIsUTC:k,timeWindowsAreUTC:it,travelMode:u}),a.totalDuration=V(((je=a.totalCosts)==null?void 0:je[p])??0,b),a.totalDistance=ge(((Oe=a.totalCosts)==null?void 0:Oe[y])??0,N),a.totalLateDuration=V(((Le=a.totalViolations)==null?void 0:Le[p])??0,b),a.totalWaitDuration=V(((De=a.totalWait)==null?void 0:De[p])??0,b),a.totalCosts!=null&&d(a.totalCosts),a.totalViolations!=null&&d(a.totalViolations),a.totalWait!=null&&d(a.totalWait);for(const m of e.stops)m.serviceCosts!=null&&(m.serviceDuration=V(m.serviceCosts[p]??0,b),m.serviceDistance=ge(m.serviceCosts[y]??0,N),d(m.serviceCosts)),m.cumulativeCosts!=null&&(m.cumulativeDuration=V(m.cumulativeCosts[p]??0,b),m.cumulativeDistance=ge(m.cumulativeCosts[y]??0,N),d(m.cumulativeCosts)),m.violations!=null&&(m.lateDuration=V(m.violations[p]??0,b),d(m.violations)),m.wait!=null&&(m.waitDuration=V(m.wait[p]??0,b),d(m.wait))}async function Ee(e){const t=q.WGS84;return await Bt(e.spatialReference,t),Nt(e,t)}function V(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function ge(e,t){return t==="decimal-degrees"||t==="points"||t==="unknown"?e:Pt(e,t,"meters")}function Nr(e){const{attributes:t,geometry:o,popupTemplate:i,symbol:n}=e.toGraphic().toJSON();return{attributes:t,geometry:o,popupInfo:i,symbol:n}}const Pr=j.ofType(oe),Rr=j.ofType(se),Ge=j.ofType(X),Ue=j.ofType(Y),We=j.ofType(ee),qe=j.ofType(te),ot="esri.layers.RouteLayer",st=Ze.getLogger(ot);let g=class extends ct(yt(jt(Ot(It(dt(Rt)))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new et,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new Ge,this.polygonBarriers=new Ue,this.polylineBarriers=new We,this.routeInfo=null,this.spatialReference=q.WGS84,this.stops=new qe,this.type="route";const t=()=>{this._setStopSymbol(this.stops)};this.addHandles(mt(()=>this.stops,"change",t,{sync:!0,onListenerAdd:t}))}writeFeatureCollectionWebmap(e,t,o,i){const n=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter(y=>!!y),u=n.map((y,v)=>v),p=i.origin==="web-map"?"featureCollection.layers":"layers";ft(p,n,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=u}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",o=>oe.fromGraphic(o))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",o=>se.fromGraphic(o))}get fullExtent(){const e=new He({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:q.WGS84});if(this.routeInfo!=null&&this.routeInfo.geometry!=null)return this.routeInfo.geometry.extent??e;if(this.stops==null)return e;const t=this.stops.filter(n=>n.geometry!=null);if(t.length<2)return e;const{spatialReference:o}=t.at(0).geometry;if(o==null)return e;const i=t.toArray().map(n=>{const u=n.geometry;return[u.x,u.y]});return new ht({points:i,spatialReference:o}).extent}readMaxScale(e,t){var n;const o=ye(t)?t.layers:(n=t.featureCollection)==null?void 0:n.layers,i=o==null?void 0:o.find(u=>u.layerDefinition.maxScale!=null);return(i==null?void 0:i.layerDefinition.maxScale)??0}readMinScale(e,t){var n;const o=ye(t)?t.layers:(n=t.featureCollection)==null?void 0:n.layers,i=o==null?void 0:o.find(u=>u.layerDefinition.minScale!=null);return(i==null?void 0:i.layerDefinition.minScale)??0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",o=>X.fromGraphic(o))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",o=>Y.fromGraphic(o))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",o=>ee.fromGraphic(o))}readRouteInfo(e,t){const o=this._getNetworkFeatures(t,"RouteInfo",i=>le.fromGraphic(i));return o.length>0?o.at(0):null}readSpatialReference(e,t){var y,v;const o=ye(t)?t.layers:(y=t.featureCollection)==null?void 0:y.layers;if(!(o!=null&&o.length))return q.WGS84;const{layerDefinition:i,featureSet:n}=o[0],u=n.features[0],p=((v=u==null?void 0:u.geometry)==null?void 0:v.spatialReference)??n.spatialReference??i.spatialReference??i.extent.spatialReference??Ce;return q.fromJSON(p)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",o=>te.fromGraphic(o),o=>this._setStopSymbol(o))}get title(){return this.routeInfo!=null&&this.routeInfo.name!=null?this.routeInfo.name:"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return ke.routeServiceUrl}set url(e){e!=null?this._set("url",vt(e,st)):this._set("url",ke.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}removeResult(){this.directionLines!=null&&(this.directionLines.removeAll(),this._set("directionLines",null)),this.directionPoints!=null&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),this.routeInfo!=null&&this._set("routeInfo",null)}async save(){await this.load();const{fullExtent:e,portalItem:t}=this;if(!t)throw new M("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!t.id)throw new M("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if(t.type!=="Feature Collection")throw new M("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(this.routeInfo==null)throw new M("routelayer:route-unsolved","save() requires a solved route");const{portal:o}=t;await o.signIn(),o.user||await t.reload();const{itemUrl:i,itemControl:n}=t;if(n!=="admin"&&n!=="update")throw new M("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");const u={messages:[],origin:"portal-item",portal:o,url:i?wt(i):void 0,writtenProperties:[]},p=this.write(void 0,u);return t.extent=await Ee(e),t.title=this.title,await t.update({data:p}),t}async saveAs(e,t={}){var y;if(await this.load(),this.routeInfo==null)throw new M("routelayer:route-unsolved","saveAs() requires a solved route");const o=gt.from(e).clone();o.extent??(o.extent=await Ee(this.fullExtent)),o.id=null,o.portal??(o.portal=St.getDefault()),o.title??(o.title=this.title),o.type="Feature Collection",o.typeKeywords=["Data","Feature Collection",Lt.MULTI_LAYER,"Route Layer"];const{portal:i}=o,n={messages:[],origin:"portal-item",portal:i,url:null,writtenProperties:[]};await i.signIn();const u=t==null?void 0:t.folder,p=this.write(void 0,n);return await((y=i.user)==null?void 0:y.addItem({item:o,folder:u,data:p})),this.portalItem=o,At(n),n.portalItem=o,o}async solve(e,t){const o=(e==null?void 0:e.stops)??this.stops,i=(e==null?void 0:e.pointBarriers)??we(this.pointBarriers),n=(e==null?void 0:e.polylineBarriers)??we(this.polylineBarriers),u=(e==null?void 0:e.polygonBarriers)??we(this.polygonBarriers);if(o==null)throw new M("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((br(o)||Tr(o))&&o.features.length<2||j.isCollection(o)&&o.length<2)throw new M("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(j.isCollection(o))for(const d of o)d.routeName=null;const p=e==null?void 0:e.apiKey,y=this.url,v=await this._getServiceDescription(y,p,t),S=(e==null?void 0:e.travelMode)??v.defaultTravelMode,l=(e==null?void 0:e.accumulateAttributes)??[];S!=null&&(l.push(S.distanceAttributeName),S.timeAttributeName&&l.push(S.timeAttributeName));const b={startTime:new Date},N={accumulateAttributes:l,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:i,polylineBarriers:n,polygonBarriers:u,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!i,returnDirections:!0,returnPolygonBarriers:!!u,returnPolylineBarriers:!!n,returnRoutes:!0,returnStops:!0,stops:o},B=e?Fe.from(e):new Fe;for(const d in b)B[d]==null&&(B[d]=b[d]);let h;B.set(N);try{h=await pr(y,B,t)}catch(d){throw bt(d)?d:new M("routelayer:failed-route-request","the routing request failed",{error:d})}const w=this._toRouteLayerSolution(h);return this._isOverridden("title")||(this.title=w.routeInfo.name??"Route"),Br(w,v,B),w}update(e){const{stops:t,directionLines:o,directionPoints:i,pointBarriers:n,polylineBarriers:u,polygonBarriers:p,routeInfo:y}=e;this.set({stops:t,pointBarriers:n,polylineBarriers:u,polygonBarriers:p}),this._set("directionLines",o),this._set("directionPoints",i),this._set("routeInfo",y),y.geometry!=null&&(this.spatialReference=y.geometry.spatialReference)}_getNetworkFeatures(e,t,o,i){var w;const n=ye(e)?e.layers:(w=e.featureCollection)==null?void 0:w.layers,u=n==null?void 0:n.find(d=>d.layerDefinition.name===t);if(u==null)return new j;const{layerDefinition:p,popupInfo:y,featureSet:v}=u,S=p.drawingInfo.renderer,{features:l}=v,b=v.spatialReference??p.spatialReference??p.extent.spatialReference??Ce,N=S&&$t(S),B=q.fromJSON(b),h=l.map(d=>{const a=K.fromJSON(d);a.geometry!=null&&d.geometry!=null&&d.geometry.spatialReference==null&&(a.geometry.spatialReference=B);const T=o(a);return T.symbol??(T.symbol=(N==null?void 0:N.getSymbol(a))??this._getNetworkSymbol(t)),T.popupTemplate??(T.popupTemplate=y&&Tt.fromJSON(y)),T});return i&&h.some(d=>!d.symbol)&&i(h),new j(h)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,t,o){if(this._cachedServiceDescription!=null&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const i=await tt(e,t,o);return this._cachedServiceDescription={serviceDescription:i,url:e},i}_setStopSymbol(e){if(!e||e.length===0||this.defaultSymbols.stops==null||e.every(({symbol:l})=>l!=null))return;const{first:t,last:o,middle:i,unlocated:n,waypoint:u,break:p}=this.defaultSymbols.stops;if(this.routeInfo==null||e.length===1)return void e.forEach((l,b)=>{switch(b){case 0:l.symbol=t;break;case e.length-1:l.symbol=o;break;default:l.symbol=i}});const y=e.map(({sequence:l})=>l).filter(l=>l!=null),v=Math.min(...y),S=Math.max(...y);for(const l of e)l.sequence!==v?l.sequence!==S?l.status==="ok"||l.status==="not-located-on-closest"?l.locationType!=="waypoint"?l.locationType!=="break"?l.symbol=i:l.symbol=p:l.symbol=u:l.symbol=n:l.symbol=o:l.symbol=t}_toRouteLayerSolution(e){var S,l,b,N,B,h,w;const t=(S=e.routeResults[0].stops)==null?void 0:S.map(d=>te.fromJSON(d.toJSON()));this._setStopSymbol(t);const o=new qe(t),i=new Ue((l=e.polygonBarriers)==null?void 0:l.map(d=>{const a=Y.fromJSON(d.toJSON());return a.symbol=this.defaultSymbols.polygonBarriers,a})),n=new We((b=e.polylineBarriers)==null?void 0:b.map(d=>{const a=ee.fromJSON(d.toJSON());return a.symbol=this.defaultSymbols.polylineBarriers,a})),u=new Ge((N=e.pointBarriers)==null?void 0:N.map(d=>{const a=X.fromJSON(d.toJSON());return a.symbol=this.defaultSymbols.pointBarriers,a})),p=(B=e.routeResults[0].route)==null?void 0:B.toJSON(),y=le.fromJSON(p);y.symbol=this.defaultSymbols.routeInfo;const v=new Rr((h=e.routeResults[0].directionPoints)==null?void 0:h.features.map(d=>{const a=se.fromJSON(d.toJSON());return a.symbol=this.defaultSymbols.directionPoints,a}));return{directionLines:new Pr((w=e.routeResults[0].directionLines)==null?void 0:w.features.map(d=>{const a=oe.fromJSON(d.toJSON());return a.symbol=this.defaultSymbols.directionLines,a})),directionPoints:v,pointBarriers:u,polygonBarriers:i,polylineBarriers:n,routeInfo:y,stops:o}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",oe.fields,oe.popupInfo,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",se.fields,se.popupInfo,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,t,o,i,n,u,p){if(e==null||!e.length)return null;const y=this.spatialReference.toJSON(),{fullExtent:v,maxScale:S,minScale:l}=this;return{featureSet:{features:e.toArray().map(b=>Nr(b)),geometryType:o,spatialReference:y},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:t!=null?t.toJSON():Ne(o)}},extent:v.toJSON(),fields:i,geometryType:o,hasM:!1,hasZ:!1,maxScale:S,minScale:l,name:u,objectIdField:"ObjectID",spatialReference:y,title:p,type:"Feature Layer",typeIdField:""},popupInfo:n}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",X.fields,X.popupInfo,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",Y.fields,Y.popupInfo,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",ee.fields,ee.popupInfo,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(this.routeInfo!=null?new j([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",le.fields,le.popupInfo,"RouteInfo","Route Details")}_writeStops(){const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",te.fields,te.popupInfo,"Stops","Stops");if(e==null)return null;const{stops:t}=this.defaultSymbols,o=t!=null&&t.first!=null&&t.first.toJSON(),i=t!=null&&t.middle!=null&&t.middle.toJSON(),n=t!=null&&t.last!=null&&t.last.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:i,uniqueValueInfos:[{value:"1",symbol:o,label:"First Stop"},{value:`${this.stops.length}`,symbol:n,label:"Last Stop"}]},e}};r([s({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:this.portalItem==null}}}}}}})],g.prototype,"_featureCollection",void 0),r([W(["web-map","portal-item"],"_featureCollection")],g.prototype,"writeFeatureCollectionWebmap",null),r([s({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:this.portalItem!=null}}}}}}})],g.prototype,"_type",void 0),r([s({nonNullable:!0,type:et})],g.prototype,"defaultSymbols",void 0),r([s({readOnly:!0})],g.prototype,"directionLines",void 0),r([P(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],g.prototype,"readDirectionLines",null),r([s({readOnly:!0})],g.prototype,"directionPoints",void 0),r([P(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],g.prototype,"readDirectionPoints",null),r([s({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],g.prototype,"featureCollectionType",void 0),r([s({readOnly:!0})],g.prototype,"fullExtent",null),r([s({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],g.prototype,"legendEnabled",void 0),r([s({type:["show","hide"]})],g.prototype,"listMode",void 0),r([s({type:Number,nonNullable:!0,json:{write:!1}})],g.prototype,"maxScale",void 0),r([P(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],g.prototype,"readMaxScale",null),r([s({type:Number,nonNullable:!0,json:{write:!1}})],g.prototype,"minScale",void 0),r([P(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],g.prototype,"readMinScale",null),r([s({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],g.prototype,"operationalLayerType",void 0),r([s({nonNullable:!0,type:j.ofType(X)})],g.prototype,"pointBarriers",void 0),r([P(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],g.prototype,"readPointBarriers",null),r([s({nonNullable:!0,type:j.ofType(Y)})],g.prototype,"polygonBarriers",void 0),r([P(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],g.prototype,"readPolygonBarriers",null),r([s({nonNullable:!0,type:j.ofType(ee)})],g.prototype,"polylineBarriers",void 0),r([P(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],g.prototype,"readPolylineBarriers",null),r([s({readOnly:!0})],g.prototype,"routeInfo",void 0),r([P(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],g.prototype,"readRouteInfo",null),r([s({type:q})],g.prototype,"spatialReference",void 0),r([P(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],g.prototype,"readSpatialReference",null),r([s({nonNullable:!0,type:j.ofType(te)})],g.prototype,"stops",void 0),r([P(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],g.prototype,"readStops",null),r([s()],g.prototype,"title",null),r([s({readOnly:!0,json:{read:!1}})],g.prototype,"type",void 0),r([s()],g.prototype,"url",null),g=r([A(ot)],g);const ro=g;export{ro as default}; diff --git a/assets/RouteLayerView3D-0557987b.js b/assets/RouteLayerView3D-0557987b.js new file mode 100644 index 0000000..0777574 --- /dev/null +++ b/assets/RouteLayerView3D-0557987b.js @@ -0,0 +1 @@ +import{ag as u,aC as c,ah as m,dU as y,aF as d,aG as h,aD as g,ai as i,aj as o,al as f}from"./index-080e108a.js";import{m as b,c as v,C as I,T as O,j as _,S as w,O as S}from"./Stop-9d81fe58.js";import{n as V}from"./LayerView3D-ffd35809.js";import{x as G}from"./GraphicsProcessor-750d4e2b.js";import{l as C}from"./projectExtentUtils-efa4cddd.js";import{r as P}from"./EventedSet-d13fada5.js";import{d as R}from"./LayerView-448bc5ea.js";import"./diffUtils-590c9088.js";import"./Query-1c961d4c.js";import"./Graphics3DObjectStates-bb2a6162.js";import"./UniqueValueRenderer-fef4204d.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./popupUtils-f04ec9a9.js";function j(e){return e instanceof b||e instanceof v||e instanceof I||e instanceof O||e instanceof _||e instanceof w||e instanceof S}let r=class extends V(R){constructor(){super(...arguments),this.type="route-3d",this.loadedGraphics=new P,this._byObjectID=new Map,this.slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null}initialize(){this._set("processor",new G({owner:this,scaleVisibilityEnabled:!0,frustumVisibilityEnabled:!0})),this.addResolvingPromise(this.processor.initializePromise),this.updatingHandles.addOnCollectionChange(()=>this._routeItems,e=>this._routeItemsChanged(e),u),this.addResolvingPromise(C(this).then(e=>this.fullExtentInLocalViewSpatialReference=e)),this.handles.add(c(()=>{var e,t;return(t=(e=this.view)==null?void 0:e.basemapTerrain)==null?void 0:t.ready},()=>()=>this.notifyChange("updating"),{once:!0}))}destroy(){var e;this.handles.removeAll(),this.updatingHandles.removeAll(),this._set("processor",m(this.processor)),(e=this._get("_routeItems"))==null||e.destroy()}get _routeItems(){return new y({getCollections:()=>[this.layer.pointBarriers,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.stops,this.layer.directionLines,this.layer.directionPoints,this.layer.routeInfo!=null?new d([this.layer.routeInfo]):null]})}_routeItemsChanged(e){if(e.removed.length){this.loadedGraphics.removeMany(e.removed.map(t=>{const s=this._byObjectID.get(t);return this._byObjectID.delete(t),s}));for(const t of e.removed)this.handles.remove(t)}if(e.added.length){this.loadedGraphics.addMany(e.added.map(t=>{const s=t.toGraphic();return this._byObjectID.set(t,s),s}));for(const t of e.added)this.handles.add([h(()=>t.geometry,(s,a)=>{this._updateGraphic(t,"geometry",s,a)}),h(()=>t.symbol,(s,a)=>{this._updateGraphic(t,"symbol",s,a)})],t)}}get legendEnabled(){var e;return this.canResume()&&!((e=this.processor)!=null&&e.frustumVisibilitySuspended)}getSuspendInfo(){var t,s;const e=super.getSuspendInfo();return e.outsideScaleRange=((t=this.processor)==null?void 0:t.scaleVisibilitySuspended)??!1,e.outsideOfView=((s=this.processor)==null?void 0:s.frustumVisibilitySuspended)??!1,e}async fetchPopupFeatures(e,t){return(t==null?void 0:t.clientGraphics)??[]}getHit(e){return this.processor.getHit(e)}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){var s;return(s=this.processor)==null?void 0:s.computeAttachmentOrigin(e,t)}getSymbolLayerSize(e,t){return this.processor.getSymbolLayerSize(e,t)}async queryGraphics(){return new d(this.loadedGraphics.toArray())}maskOccludee(e){return this.processor.maskOccludee(e)}highlight(e){return j(e)&&(e=this._byObjectID.get(e)),this.processor.highlight(e)}get updatePolicy(){var e;return((e=this.processor)==null?void 0:e.graphicsCore.effectiveUpdatePolicy)||g.SYNC}canResume(){var e;return super.canResume()&&!((e=this.processor)!=null&&e.scaleVisibilitySuspended)}isUpdating(){var e,t,s;return!(!((e=this.processor)!=null&&e.updating)&&((s=(t=this.view)==null?void 0:t.basemapTerrain)!=null&&s.ready))}get performanceInfo(){var e,t;return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:-1,totalNumberOfFeatures:-1,nodes:0,core:null,updating:this.updating,elevationUpdating:((e=this.processor)==null?void 0:e.elevationAlignment.updating)??!1,visibilityFrustum:!((t=this.processor)!=null&&t.frustumVisibilitySuspended)}}_updateGraphic(e,t,s,a){var p;const l=this._byObjectID.get(e);l[t]=s,n.graphic=l,n.property=t,n.oldValue=a,n.newValue=s,(p=this.processor)==null||p.graphicsCore.graphicUpdateHandler(n)}};i([o()],r.prototype,"_routeItems",null),i([o()],r.prototype,"loadedGraphics",void 0),i([o({readOnly:!0})],r.prototype,"legendEnabled",null),i([o()],r.prototype,"layer",void 0),i([o({readOnly:!0})],r.prototype,"processor",void 0),i([o({type:Boolean})],r.prototype,"slicePlaneEnabled",void 0),r=i([f("esri.views.3d.layers.RouteLayerView3D")],r);const n={graphic:null,property:null,oldValue:null,newValue:null},Z=r;export{Z as default}; diff --git a/assets/SSAO.glsl-8e275b51.js b/assets/SSAO.glsl-8e275b51.js new file mode 100644 index 0000000..4e3e42e --- /dev/null +++ b/assets/SSAO.glsl-8e275b51.js @@ -0,0 +1 @@ +import{H as d,J as e}from"./index-080e108a.js";export{d as build,e as getRadius}; diff --git a/assets/SSAOBlur.glsl-1cf88496.js b/assets/SSAOBlur.glsl-1cf88496.js new file mode 100644 index 0000000..b6a85d5 --- /dev/null +++ b/assets/SSAOBlur.glsl-1cf88496.js @@ -0,0 +1 @@ +import{G as a}from"./index-080e108a.js";export{a as build}; diff --git a/assets/SceneLayer-fdf1363f.js b/assets/SceneLayer-fdf1363f.js new file mode 100644 index 0000000..0b45b84 --- /dev/null +++ b/assets/SceneLayer-fdf1363f.js @@ -0,0 +1 @@ +import{ai as i,aj as a,al as I,ck as G,eP as B,aF as O,ak as S,aB as H,b8 as A,d3 as Z,ay as h,af as X,aT as Y,aH as ee,ho as te,at as q,cl as re,eS as ie,cz as se,hi as T,dV as x,bz as u,as as oe,dL as ae,ar as d,aK as ne,c5 as le,aw as pe,bu as D,c_ as F,cB as de,bn as ye,cT as ue,fP as ce,cC as he,aA as fe}from"./index-080e108a.js";import"./UniqueValueRenderer-fef4204d.js";import{n as me}from"./jsonUtils-f73b3833.js";import{O as ge}from"./MultiOriginJSONSupport-e4912ffd.js";import{i as ve}from"./APIKeyMixin-878a7aa7.js";import{l as we}from"./ArcGISService-83287338.js";import{c as be}from"./EditBusLayer-d71787e9.js";import{c as Ie}from"./OperationalLayer-0e8f8b28.js";import{j as Le}from"./PortalLayer-310c2800.js";import{N as Se,K as P}from"./SceneService-6fea113d.js";import{t as Fe}from"./capabilities-5d185925.js";import{d as _e,m as je,c as Oe,p as Ee,l as $e}from"./commonProperties-30089b06.js";import{t as Ae,p as Te}from"./FeatureReductionLayer-4262cf54.js";import{i as xe}from"./FetchAssociatedFeatureLayer-15c90b75.js";import{s as De}from"./fieldProperties-62c55499.js";import{r as Pe}from"./FieldsIndex-f79a8f26.js";import{s as C,l as Re,u as Ne,m as Ue}from"./I3SLayerDefinitions-ffdb3821.js";import{C as Ge}from"./LabelClass-2d53c485.js";import{i as R}from"./labelingInfo-144f3d9f.js";import{p as qe}from"./serviceCapabilitiesUtils-959e798a.js";import{g as Ce}from"./persistable-ca976a2c.js";import{t as Qe}from"./styleUtils-25825fd6.js";import{b as Ve}from"./Query-1c961d4c.js";import{p as ke}from"./popupUtils-82ea8abb.js";import{l as Je}from"./I3SUtil-2c288808.js";import{n as Ke,p as ze}from"./popupUtils-f04ec9a9.js";import"./diffUtils-590c9088.js";import"./DictionaryLoader-c0729336.js";import"./heatmapUtils-327ef4c5.js";import"./portalItemUtils-792a27e1.js";import"./originUtils-1469eeaf.js";import"./multiOriginJSONSupportUtils-c978f4c3.js";import"./I3SIndexInfo-445e6968.js";import"./resourceUtils-b667b05b.js";import"./featureLayerUtils-6cf06f83.js";import"./sql-734ecbc5.js";import"./AttachmentQuery-972bbd60.js";import"./RelationshipQuery-39c07195.js";import"./FeatureLayer-5c6d2c3b.js";import"./FeatureLayerBase-7c7dfccb.js";import"./editsZScale-1b5a53a6.js";import"./queryZScale-8f9616ff.js";import"./FeatureSet-111cb247.js";import"./CustomParametersMixin-231c4be8.js";import"./FeatureEffectLayer-4160946c.js";import"./FeatureEffect-86735d98.js";import"./FeatureFilter-00f4be05.js";import"./OrderedLayer-68067459.js";import"./TemporalLayer-f17c9161.js";import"./FeatureTemplate-2a7e96c1.js";import"./FeatureType-db96032c.js";import"./versionUtils-f17daa93.js";import"./TopFeaturesQuery-e44d05be.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./resourceExtension-91e7c3ce.js";import"./I3SBinaryReader-2b8e30f7.js";let y=class extends G{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};i([a({type:String,json:{read:!0,write:!0}})],y.prototype,"name",void 0),i([a({type:String,json:{read:!0,write:!0}})],y.prototype,"field",void 0),i([a({type:[Number],json:{read:!0,write:!0}})],y.prototype,"currentRangeExtent",void 0),i([a({type:[Number],json:{read:!0,write:!0}})],y.prototype,"fullRangeExtent",void 0),i([a({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],y.prototype,"type",void 0),y=i([I("esri.layers.support.RangeInfo")],y);var w;let _=w=class extends B(O.ofType(S)){constructor(e){super(e)}clone(){return new w(this.items.map(e=>e.clone()))}write(e,t){return this.toJSON(t)}toJSON(e){var r;const t=(r=e==null?void 0:e.layer)==null?void 0:r.spatialReference;return t?this.toArray().map(o=>{if(!t.equals(o.spatialReference)){if(!H(o.spatialReference,t))return e&&e.messages&&e.messages.push(new A("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const l=new S;Z(o,l,t),o=l}const n=o.toJSON(e);return delete n.spatialReference,n}).filter(o=>o!=null):(e!=null&&e.messages&&e.messages.push(new A("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map(o=>o.toJSON(e)))}static fromJSON(e,t){const r=new w;return e.forEach(o=>r.add(S.fromJSON(o,t))),r}};_=w=i([I("esri.layers.support.PolygonCollection")],_);const b=_;var j;let f=j=class extends G{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new b,this._geometriesSource=null,this._handles=new X}initialize(){this._handles.add(Y(()=>this.geometries,"after-changes",()=>this.geometries=this.geometries,ee))}destroy(){this._handles.destroy()}readGeometries(e,t,r){Array.isArray(e)?this.geometries=b.fromJSON(e,r):this._geometriesSource={url:te(e,r),context:r}}async loadGeometries(e,t){if(this._geometriesSource==null)return;const{url:r,context:o}=this._geometriesSource,n=await q(r,{responseType:"json",signal:t==null?void 0:t.signal}),l=e.toJSON(),p=n.data.map(c=>({...c,spatialReference:l}));this.geometries=b.fromJSON(p,o),this._geometriesSource=null}clone(){const e=new j({geometries:re(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};i([a({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],f.prototype,"spatialRelationship",void 0),i([a({type:b,nonNullable:!0,json:{write:!0}}),Ce({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries"})],f.prototype,"geometries",void 0),i([h(["web-scene","portal-item"],"geometries")],f.prototype,"readGeometries",null),f=j=i([I("esri.layers.support.SceneFilter")],f);const Me=f,We=["3DObject","Point"],N=De();let s=class extends be(Se(we(Ie(Le(ie(ge(ve(se(fe))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new O,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this._set("renderer",null)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var o,n,l;const r=(n=(o=this.getFeatureType(t==null?void 0:t.feature))==null?void 0:o.domains)==null?void 0:n[e];return r&&r.type!=="inherited"?r:((l=this.getField(e))==null?void 0:l.domain)??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){var e;return((e=this.associatedLayer)==null?void 0:e.types)??[]}get typeIdField(){var e;return((e=this.associatedLayer)==null?void 0:e.typeIdField)??null}get templates(){var e;return((e=this.associatedLayer)==null?void 0:e.templates)??null}get formTemplate(){var e;return((e=this.associatedLayer)==null?void 0:e.formTemplate)??null}get fieldsIndex(){return new Pe(this.fields)}readNodePages(e,t,r){return t.layerType==="Point"&&(e=t.pointNodePages),e==null||typeof e!="object"?null:C.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get geometryType(){return Be[this.profile]||"mesh"}set renderer(e){T(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return e!=null&&typeof e=="object"||(e={}),e.color==null&&(e.color=!1),e}get capabilities(){var E,$;const e=((E=this.associatedLayer)==null?void 0:E.capabilities)??Fe,{query:t,editing:{supportsGlobalId:r,supportsRollbackOnFailure:o,supportsUploadWithItemId:n,supportsGeometryUpdate:l,supportsReturnServiceEditsInSourceSpatialReference:p},data:{supportsZ:c,supportsM:m,isVersioned:g,supportsAttachment:Q},operations:{supportsEditing:V,supportsAdd:k,supportsUpdate:J,supportsDelete:K,supportsQuery:z,supportsQueryAttachments:M,supportsAsyncConvert3D:W}}=e,v=e.operations.supportsChangeTracking,L=!!(($=this.associatedLayer)!=null&&$.infoFor3D)&&x();return{query:t,editing:{supportsGlobalId:r,supportsReturnServiceEditsInSourceSpatialReference:p,supportsRollbackOnFailure:o,supportsGeometryUpdate:L&&l,supportsUploadWithItemId:n},data:{supportsAttachment:Q,supportsZ:c,supportsM:m,isVersioned:g},operations:{supportsQuery:z,supportsQueryAttachments:M,supportsEditing:V&&v,supportsAdd:L&&k&&v,supportsDelete:L&&K&&v,supportsUpdate:J&&v,supportsAsyncConvert3D:W}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){var e;return((e=this.associatedLayer)==null?void 0:e.infoFor3D)??null}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeOID"&&(e=r.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeGlobalID"&&(e=r.name),!!e)),e||void 0}get displayField(){var e;return((e=this.associatedLayer)==null?void 0:e.displayField)??null}readProfile(e,t){const r=t.store.profile;return r!=null&&U[r]?U[r]:(u.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}load(e){const t=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(oe).then(()=>this._fetchService(t)).then(()=>Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()])).then(()=>this._validateElevationInfo()).then(()=>this._applyAssociatedLayerOverrides()).then(()=>this._populateFieldUsageInfo()).then(()=>Qe(this,{origin:"service"},t)).then(()=>T(this.renderer,this.fieldsIndex)).then(()=>this.finishLoadEditablePortalLayer(e));return this.addResolvingPromise(r),Promise.resolve(this)}async beforeSave(){this.filter!=null&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){u.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new Ve;return this.geometryType!=="mesh"&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(r=>{if(r!=null&&r.features)for(const o of r.features)o.layer=this,o.sourceLayer=this;return r})}async queryCachedAttributes(e,t){const r=ae(this.fieldsIndex,await Ke(this,ze(this)));return Je(this.parsedUrl.path,this.attributeStorageInfo??[],e,t,r)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||r.length===0)throw new d("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const o=new ne;return o.attributes=r[0],o.layer=this,o.sourceLayer=this,o}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(u.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return ke(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e!=null&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new d("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return this.statisticsInfo!=null&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new d("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new d("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const o of this.statisticsInfo)if(o.name===r.name){const n=le(this.parsedUrl.path,o.href);return q(n,{query:{f:"json",token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then(l=>l.data)}throw new d("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(P.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(P.SAVE,e)}async applyEdits(e,t){const{applyEdits:r}=await pe(()=>import("./editingSupport-b5feb7b5.js"),["assets/editingSupport-b5feb7b5.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/EditBusLayer-d71787e9.js"]);if(await this.load(),!this.associatedLayer)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),r(this,this.associatedLayer.source,e,t)}async uploadAssets(e,t){if(await this.load(),this.associatedLayer==null)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}validateLayer(e){if(e.layerType&&!We.includes(e.layerType))throw new d("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new d("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(r,o){let n=!1,l=!1;if(r==null)n=!0,l=!0;else{const p=o&&o.isGeographic;switch(r){case"east-north-up":case"earth-centered":n=!0,l=p;break;case"vertex-reference-frame":n=!0,l=!p;break;default:n=!1}}if(!n)throw new d("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!l)throw new d("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if(this.profile==="points")e.push("Point");else{if(this.profile!=="mesh-pyramids")throw new d("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){var e,t;if(this._fieldUsageInfo={},this.fields)for(const r of this.fields){const o=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some(p=>p.name===r.name)),n=!!((t=(e=this.associatedLayer)==null?void 0:e.fields)!=null&&t.some(p=>p&&r.name===p.name)),l={supportsLabelingInfo:o,supportsRenderer:o,supportsPopupTemplate:o||n,supportsLayerQuery:n};this._fieldUsageInfo[r.name]=l}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride()}_applyAssociatedLayerFieldsOverrides(){var t;if(!((t=this.associatedLayer)!=null&&t.fields))return;let e=null;for(const r of this.associatedLayer.fields){const o=this.getField(r.name);o?(!o.domain&&r.domain&&(o.domain=r.domain.clone()),o.editable=r.editable,o.nullable=r.nullable,o.length=r.length):(e||(e=this.fields?this.fields.slice():[]),e.push(r.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=D(this);for(let r=0;rthis.popupEnabled&&this.popupTemplate!=null);const e=`this SceneLayer: ${this.title}`;this.attributeStorageInfo==null?u.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):u.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;e&&(this.profile==="mesh-pyramids"&&e.mode==="relative-to-scene"&&u.getLogger(this).warn(".elevationInfo=","Mesh scene layers don't support relative-to-scene elevation mode"),e.featureExpressionInfo&&e.featureExpressionInfo.expression!=="0"&&u.getLogger(this).warn(".elevationInfo=","Scene layers do not support featureExpressionInfo"))}};i([a({types:{key:"type",base:Ae,typeMap:{selection:Te}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],s.prototype,"featureReduction",void 0),i([a({type:[y],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],s.prototype,"rangeInfos",void 0),i([a({json:{read:!1}})],s.prototype,"associatedLayer",void 0),i([a({type:["show","hide"]})],s.prototype,"listMode",void 0),i([a({type:["ArcGISSceneServiceLayer"]})],s.prototype,"operationalLayerType",void 0),i([a({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),i([a({...N.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],s.prototype,"fields",void 0),i([a()],s.prototype,"types",null),i([a()],s.prototype,"typeIdField",null),i([a()],s.prototype,"templates",null),i([a()],s.prototype,"formTemplate",null),i([a({readOnly:!0})],s.prototype,"fieldsIndex",null),i([a({type:qe,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],s.prototype,"floorInfo",void 0),i([a(N.outFields)],s.prototype,"outFields",void 0),i([a({type:C,readOnly:!0,json:{read:!1}})],s.prototype,"nodePages",void 0),i([h("service","nodePages",["nodePages","pointNodePages"])],s.prototype,"readNodePages",null),i([a({type:[Re],readOnly:!0})],s.prototype,"materialDefinitions",void 0),i([a({type:[Ne],readOnly:!0})],s.prototype,"textureSetDefinitions",void 0),i([a({type:[Ue],readOnly:!0})],s.prototype,"geometryDefinitions",void 0),i([a({readOnly:!0})],s.prototype,"serviceUpdateTimeStamp",void 0),i([a({readOnly:!0})],s.prototype,"attributeStorageInfo",void 0),i([a({readOnly:!0})],s.prototype,"statisticsInfo",void 0),i([a({type:O.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],s.prototype,"excludeObjectIds",void 0),i([a({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],s.prototype,"definitionExpression",void 0),i([a({type:Me,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],s.prototype,"filter",void 0),i([a({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),i([a(_e)],s.prototype,"elevationInfo",null),i([a({type:String})],s.prototype,"geometryType",null),i([a(je)],s.prototype,"labelsVisible",void 0),i([a({type:[Ge],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:R},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:R},write:!0}})],s.prototype,"labelingInfo",void 0),i([a(Oe)],s.prototype,"legendEnabled",void 0),i([a({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){var o,n;if(typeof e=="number"&&e>=0&&e<=1)return e;const r=(n=(o=t.layerDefinition)==null?void 0:o.drawingInfo)==null?void 0:n.transparency;return r!==void 0?ce(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],s.prototype,"opacity",void 0),i([a({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],s.prototype,"priority",void 0),i([a({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],s.prototype,"semantic",void 0),i([a({types:me,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],s.prototype,"renderer",null),i([a({json:{read:!1}})],s.prototype,"cachedDrawingInfo",void 0),i([h("service","cachedDrawingInfo")],s.prototype,"readCachedDrawingInfo",null),i([a({readOnly:!0,json:{read:!1}})],s.prototype,"capabilities",null),i([a({type:Boolean,json:{read:!1}})],s.prototype,"editingEnabled",null),i([a({readOnly:!0,json:{write:!1,read:!1}})],s.prototype,"infoFor3D",null),i([a(Ee)],s.prototype,"popupEnabled",void 0),i([a({type:he,json:{name:"popupInfo",write:!0}})],s.prototype,"popupTemplate",void 0),i([a({readOnly:!0,json:{read:!1}})],s.prototype,"defaultPopupTemplate",null),i([a({type:String,json:{read:!1}})],s.prototype,"objectIdField",void 0),i([h("service","objectIdField",["objectIdField","fields"])],s.prototype,"readObjectIdField",null),i([a({type:String,json:{read:!1}})],s.prototype,"globalIdField",void 0),i([h("service","globalIdField",["globalIdField","fields"])],s.prototype,"readGlobalIdField",null),i([a({readOnly:!0,type:String,json:{read:!1}})],s.prototype,"displayField",null),i([a({type:String,json:{read:!1}})],s.prototype,"profile",void 0),i([h("service","profile",["store.profile"])],s.prototype,"readProfile",null),i([a({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],s.prototype,"normalReferenceFrame",void 0),i([a($e)],s.prototype,"screenSizePerspectiveEnabled",void 0),s=i([I("esri.layers.SceneLayer")],s);const U={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Be={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},Yt=s;export{Yt as default}; diff --git a/assets/SceneLayerGraphicsView3D-8d7d0182.js b/assets/SceneLayerGraphicsView3D-8d7d0182.js new file mode 100644 index 0000000..7ff50ef --- /dev/null +++ b/assets/SceneLayerGraphicsView3D-8d7d0182.js @@ -0,0 +1 @@ +import{iR as $,cu as j,iS as q,ah as y,ag as N,aG as H,aw as U,g8 as O,aD as T,cN as z,bq as Q,bz as w,eG as D,iT as k,gq as B,dO as W,g5 as F,iU as Z,dS as K,iV as Y,iW as X,aK as G,gD as J,iX as ee,i3 as te,iY as re,gk as ie,dW as se,ai as p,aj as g,aL as oe,al as ae,dT as ne,a$ as de}from"./index-080e108a.js";import{D as S,e as le}from"./I3SOverrides-96f73e2b.js";import{d as he}from"./FeatureFilter-00f4be05.js";import{b as A}from"./Query-1c961d4c.js";import{n as ue}from"./LayerView3D-ffd35809.js";import{_ as ce,c as pe}from"./FeatureLikeLayerView3D-2e3185ce.js";import{p as ge,r as me,l as _e,i as fe,j as ye}from"./SceneLayerView-b7d3fe23.js";import{y as be,g as ve,Z as xe,n as Ee,f as V}from"./I3SUtil-2c288808.js";import{t as Ie}from"./DefinitionExpressionSceneLayerView-66b62d34.js";import{i as we}from"./PopupSceneLayerView-c49dd096.js";import{t as Ne}from"./popupUtils-f04ec9a9.js";import"./I3SNode-2025159f.js";import"./I3SBinaryReader-2b8e30f7.js";import"./meshFeatureSet-8442b8e6.js";import"./FeatureSet-111cb247.js";import"./FeatureLayerView3D-7e7e2653.js";import"./FeatureLayerViewBase3D-8474587e.js";import"./query-93c6e211.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./EventedSet-d13fada5.js";import"./commonProperties-30089b06.js";import"./FeatureEffect-86735d98.js";import"./floorFilterUtils-080a7cd2.js";import"./LayerView-448bc5ea.js";import"./RefreshableLayerView-915e7f53.js";import"./dehydratedFeatureComparison-a3375a3e.js";import"./queryForSymbologySnapping-0264f2b5.js";import"./elevationInfoUtils-4fd79d95.js";import"./hash-6f442295.js";import"./diffUtils-590c9088.js";import"./Graphics3DObjectStates-bb2a6162.js";import"./UniqueValueRenderer-fef4204d.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./QueryEngine-19eda5ff.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./FeatureStore-f0e312fc.js";import"./BoundsStore-b6bd3c14.js";import"./projectExtentUtils-efa4cddd.js";class M extends ${constructor(t){super("SceneLayerWorker","dracoDecompressPointCloudData",{dracoDecompressPointCloudData:i=>[i.geometryBuffer]},t,{hasInitialize:!0})}}class Oe extends j{constructor(t,i){super(),this._updateAndCompare=t,this._notifyUpdated=i,this._nodes=new Map,this._graphics=new Map,this._duplicates=new Map}clear(){if(this._graphics.size>0){const t=this.toArray();this._graphics.clear(),this.emit("change",{added:[],removed:t})}this._nodes.clear()}get length(){return this._graphics.size}get(t){return this._graphics.get(t)}getNode(t){return this._nodes.get(t)}hasNode(t){return this._nodes.has(t)}nodes(){return this._nodes.values()}addNode(t,i){this._nodes.set(t,i);const r=i.graphics;if(r.length===0)return;const s=new Set;for(let a=0;a0?r.filter(a=>!s.has(a.objectId)):r;o.length>0&&this.emit("change",{added:o,removed:[]})}removeNode(t){const i=this._nodes.get(t);if(!i)return void console.error("Removing unknown node");this._nodes.delete(t);const r=new Set,s=[];for(const o of i.graphics){const a=o.objectId,n=this._graphics.get(a);if(!n)continue;const d=this._duplicates.get(a);if(d){const h=d.indexOf(t);if(h===-1){console.error("error: removing graphic from node that should not reference it.");continue}if(d.splice(h,1),n.nodeIndex===t){let u=this.getNode(d[0]);for(let l=1;lu.node.level)&&(u=m)}u!=null&&r.add(u)}d.length===1&&this._duplicates.delete(a)}else this._graphics.delete(a),s.push(o)}s.length>0&&this.emit("change",{added:[],removed:s}),r.forEach(o=>this._updateForeignGraphics(o))}_updateForeignGraphics(t){const i=[],r=t.node.index,s=t.node.level;let o=0;for(;os)o+=n;else{for(let h=o;h!!t(r)&&(i=r,!0)),i}forEach(t){this._graphics.forEach(i=>t(i))}forEachNode(t){this._nodes.forEach((i,r)=>t(i,r))}get nodeCount(){return this._nodes.size}_checkInvariants(){const t=new Map;this._nodes.forEach((r,s)=>{s!==r.node.index&&console.error("Mismatched node index"),r.graphics.forEach(o=>{t.set(o.objectId,1+(t.get(o.objectId)??0));const a=this._duplicates.get(o.objectId);a&&!a.includes(s)&&console.error("Node not listed in duplicate list"),a||o.nodeIndex===s||console.error("Unique graphic does not reference owning node index")})}),this._graphics.size!==t.size&&console.error("Mismatch between actual and expected number of graphics");let i=0;t.forEach((r,s)=>{i+=r>1?1:0;const o=this._graphics.get(s);if(!o)return void console.error("Missing graphic entry");const a=this._nodes.get(o.nodeIndex);if(!a)return void console.error("Graphic references unkown node");const n=this._duplicates.get(s);n?(n.length!==r&&console.error("Wrong number of entries in duplicate list"),n.forEach(d=>{const h=this._nodes.get(d);h?h.node.level>a.node.level&&console.error("Duplicated graphic does not reference highest level node"):console.error("Unknown node in duplicate list")})):r>1&&console.error("Missing duplicates entry")}),this._duplicates.size!==i&&console.error("Mismatch between expected and actual number of duplicate entries")}}const P=fe();class Ce{constructor(t,i,r,s){this.graphics=t,this.featureIds=i,this.attributeInfo=r,this.node=s}}let c=class extends Ie(we(ue(ye))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this.loadedGraphics=new Oe((e,t,i)=>Fe(e,t,i),e=>this.processor.graphicsCore.recreateGraphics(e)),this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}tryRecycleWith(e,t){return e.url===this.layer.url&&this._i3sOverrides.isEmpty?e.load(t).then(()=>{var r;be(this.layer,e,this._i3sOverrides),this.layer=e,this._i3sOverrides.destroy();const i=(r=this.view.resourceController)==null?void 0:r.memoryController;this._i3sOverrides=new S({view:this.view,layer:e,memoryController:i}),y(this._queryEngine),this._setupQueryEngine(),this.processor.resetObjectStates()}):null}initialize(){var t,i;this.addResolvingPromise(this.layer.indexInfo);const e=(t=this.view.resourceController)==null?void 0:t.memoryController;this._i3sOverrides=new S({view:this.view,layer:this.layer,memoryController:e}),ve(this.layer,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new ge({layerView:this}),this.updatingHandles.add(()=>this.layer.rangeInfos,r=>this._rangeInfosChanged(r),N),this.updatingHandles.add(()=>this.layer.renderer,(r,s)=>this._rendererChange(r,s)),this.updatingHandles.add(()=>[this.parsedDefinitionExpression,this._excludeObjectIdsSorted],()=>this._filterChange()),this.handles.add(H(()=>O.I3S_TREE_SHOW_TILES,r=>{if(r&&!this._treeDebugger){const s=this._controller.crsIndex;U(()=>import("./I3STreeDebugger-794166fd.js"),["assets/I3STreeDebugger-794166fd.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/TileTreeDebugger-142b9f39.js"]).then(({I3STreeDebugger:o})=>{!this._treeDebugger&&O.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new o({lv:this,view:this.view,nodeSR:s}))})}else r||!this._treeDebugger||O.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)},N)),this._set("processor",new ce({owner:this,preferredUpdatePolicy:T.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:this.layer.fullExtent,updateClippingExtent:r=>this._updateClippingExtent(r)})),(i=this.processor.elevationAlignment)==null||i.events.on("invalidate-elevation",r=>this._controller.updateElevationChanged(r.extent,r.spatialReference)),this.supportsHeightUnitConversion&&(this._verticalScale=z("point",this.layer.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.initializePromise),this._memCache=this.view.resourceController.memoryController.newCache(`psl-${this.uid}`),this._controller=new le({layerView:this,scaleVisibilityEnabled:!1}),xe(this.layer.geometryDefinitions)&&(this._worker=new M(r=>this.view.resourceController.immediate.schedule(r))),this.handles.add(this.layer.on("apply-edits",r=>this.updatingHandles.addPromise(r.result))),this.handles.add(this.layer.on("edits",r=>this._handleEdits(r))),this.when(()=>{this._setupQueryEngine(),this.updatingHandles.add(()=>this.maximumNumberOfFeatures,r=>this._controller.featureTarget=r,N),this.updatingHandles.add(()=>this.suspended,r=>{r&&this._removeAllNodeData()})})}destroy(){this._treeDebugger=y(this._treeDebugger),this._i3sOverrides=y(this._i3sOverrides),this._set("processor",y(this.processor)),this._controller=y(this._controller),this._queryEngine=y(this._queryEngine),this._worker=y(this._worker),this._memCache=y(this._memCache),this.loadedGraphics.clear(),this._fieldsHelper=y(this._fieldsHelper)}get i3slayer(){return this.layer}get updatingProgressValue(){var e;return((e=this._controller)==null?void 0:e.updatingProgress)??1}get requiredFields(){var e;return((e=this._fieldsHelper)==null?void 0:e.requiredFields)??[]}get maximumNumberOfFeatures(){var t,i;const e=(i=(t=this.processor)==null?void 0:t.graphicsCore)==null?void 0:i.displayFeatureLimit;return(e==null?void 0:e.maximumNumberOfFeatures)??0}set maximumNumberOfFeatures(e){e!=null?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){var e;return!this.suspended&&!!((e=this._controller)!=null&&e.useMaximumNumberOfFeatures)&&!this._controller.leavesReached}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds;return e.length?e.toArray().sort((t,i)=>t-i):null}get lodFactor(){return this.layer.semantic==="Labels"?1:this.view.qualitySettings.sceneService.point.lodFactor}get hasM(){return!1}get hasZ(){return!0}get contentVisible(){var e;return!this.suspended&&!!((e=this._controller)!=null&&e.rootNodeVisible)}get legendEnabled(){var e;return this.contentVisible&&((e=this.i3slayer)==null?void 0:e.legendEnabled)===!0}async whenGraphicAttributes(e,t){return Ee(this.layer,e,this._getObjectIdField(),t,()=>[...this.loadedGraphics.nodes()])}getHit(e){if(!this.loadedGraphics)return null;const t=Q(this.loadedGraphics.find(r=>r.uid===e),this.layer),i=this._getObjectIdField();return t&&t.attributes&&t.attributes[i]?(t.layer=this.layer,t.sourceLayer=this.layer,{type:"graphic",graphic:t,layer:t.layer}):null}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}isUpdating(){var e,t,i;return!!((e=this._controller)!=null&&e.updating||(t=this.processor)!=null&&t.updating||(i=this._fieldsHelper)!=null&&i.updating||this.layerFilterUpdating)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return me(this._attributeEditingContext,e)}async _decompressBinaryPointData(e,t){const i={geometryBuffer:e.geometryBuffer};this._worker==null&&(this._worker=new M(s=>this.view.resourceController.immediate.schedule(s)));const r=await this._worker.invoke(i,t);if(r==null)throw new Error("Failed to decompress Draco point data");return{positionData:r.positions,featureIds:r.featureIds}}async addNode(e,t,i){var f;if(!C(t)&&!De(t))throw new Error;if(this.loadedGraphics.hasNode(e.index))return void w.getLogger(this).error("I3S node "+e.id+" already added");const r=this.layer.fullExtent!=null?Ge(this.layer.fullExtent.clone(),.5):null,s=[],{featureIds:o,pointPositions:a}=C(t)?await this._extractBinaryPointPositions(e,t,i):this._extractLegacyPointPositions(t);this._validatePositions(e,o,a,r,s);const n=this._controller.crsVertex,d=this.view.spatialReference;D(a,n,0,a,d,0,o.length);const h=C(t)?e.level:0,u=this._createGraphics(o,a,e.index,h),l=new Ce(u,o,t.attributeDataInfo,e);if(await this._i3sOverrides.applyAttributeOverrides(l.featureIds,t.attributeDataInfo,i),e.numFeatures=l.graphics.length,this._updateNodeMemory(e),L(l),s.length>0&&(this._computeObb(e,s,n),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return void this._cacheNodeData(l);if(this._verticalScale!=null)for(const b of l.graphics)this._verticalScale(b.geometry);const m=this.view._stage.renderView.objectAndLayerIdRenderHelper;if(m!=null){const b=k(this.view.map,this.layer.uid);for(let x=0;x3)continue;const m=((o=u.params.vertexAttributes)==null?void 0:o.position)??[0,0,0],f=3*r.length;i[f]=d[0]+m[0],i[f+1]=d[1]+m[1],i[f+2]=h===3?d[2]+m[2]:NaN,r.push(l)}return{featureIds:r,pointPositions:i}}_validatePositions(e,t,i,r,s){if(r==null&&e.serviceObb)return;const o=t.length,a=3;for(let n=0;nee(r)+i,te(e.featureIds)+1024);this._memCache.put(this._getMemCacheKey(e.node),e,t)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this.loadedGraphics.forEachNode((e,t)=>{if(e){const i=e.node;this._updateNodeMemory(i),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)}),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this.loadedGraphics.getNode(e);return t==null?null:(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeNode(e),this._treeDebugger&&this._treeDebugger.update(),t)}async loadCachedNodeData(e){var t;return(t=this._memCache)==null?void 0:t.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,t,i,r){this.loadedGraphics.hasNode(e.index)?w.getLogger(this).error("I3S node "+e.id+" already added"):(await this._i3sOverrides.applyAttributeOverrides(t.featureIds,i,r),this.loadedGraphics.addNode(e.index,t),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),t.attributeInfo=i,this._attributeValuesChanged(t),this._filterNode(t),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const e=[];return this.loadedGraphics.forEachNode(t=>e.push(t.node.id)),e.sort()}getVisibleNodes(){const e=new Array;return this.loadedGraphics.forEachNode(t=>e.push(t.node)),e}getLoadedNodeIndices(e){this.loadedGraphics.forEachNode((t,i)=>e.push(i))}getLoadedAttributes(e){const t=this.loadedGraphics.getNode(e);if(t!=null&&t.attributeInfo!=null)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this.loadedGraphics.getNode(e);if(t!=null&&t.attributeInfo!=null)return t.attributeInfo.attributeData}_setAttributeData(e,t){const i=this.loadedGraphics.getNode(e);i!=null&&i.attributeInfo!=null&&(i.attributeInfo.attributeData=t,this._attributeValuesChanged(i))}async updateAttributes(e,t,i){const r=this.loadedGraphics.getNode(e);r!=null&&(await this._i3sOverrides.applyAttributeOverrides(r.featureIds,t,i),r.attributeInfo=t,this._attributeValuesChanged(r))}_attributeValuesChanged(e){if(L(e),this._filterNode(e),this.processor.graphicsCore.labelsEnabled){const t=e.graphics.map(i=>i.uid);this.processor.graphicsCore.updateLabelingInfo(t)}}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||re}_getGlobalIdField(){var e;return(e=this.layer.associatedLayer)==null?void 0:e.globalIdField}async _rendererChange(e,t){const{layer:{fieldsIndex:i}}=this,r=new Set;let s,o;e?(await e.collectRequiredFields(r,i),s=Array.from(r).sort()):s=[],r.clear(),t?(await t.collectRequiredFields(r,i),o=Array.from(r).sort()):o=[],s.length===o.length&&s.every((a,n)=>s[n]===o[n])||this._reloadAllNodes()}_rangeInfosChanged(e){e!=null&&e.length>0&&w.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this.loadedGraphics.forEachNode(e=>this._filterNode(e))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression,i=this._excludeObjectIdsSorted,r=this._getObjectIdField();for(const s of e.graphics){const o=s.visible,a=!t||this._evaluateClause(t,s),n=i==null||ie(i,s.attributes[r])<0;s.visible=a&&n,o!==s.visible&&(_.graphic=s,_.property="visible",_.oldValue=o,_.newValue=s.visible,this.processor.graphicsCore.graphicUpdateHandler(_))}}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return this.filter!=null?this.filter.createQuery(e):new A(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t==null?void 0:t.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t==null?void 0:t.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t==null?void 0:t.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t==null?void 0:t.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(e==null?this.createQuery():A.from(e))}_setupQueryEngine(){const e=()=>this.processor.featureStore;this._queryEngine=new pe({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return e()},hasZ:this.hasZ,hasM:this.hasM},priority:se.FEATURE_QUERY_ENGINE})}get usedMemory(){var e,t;return((t=(e=this.processor)==null?void 0:e.graphicsCore)==null?void 0:t.usedMemory)??0}get unloadedMemory(){var e,t,i;return .8*((((e=this._controller)==null?void 0:e.unloadedMemoryEstimate)??0)+(((i=(t=this.processor)==null?void 0:t.graphicsCore)==null?void 0:i.unprocessedMemoryEstimate)??0))}get ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}_handleEdits(e){_e(this._attributeEditingContext,e)}get _attributeEditingContext(){const e=this._getObjectIdField(),t=this._getGlobalIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,globalIdField:t,forEachNode:i=>this.loadedGraphics.forEachNode(r=>i(r.node,r.featureIds)),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this._i3sOverrides,getAttributeData:i=>this.getAttributeData(i),setAttributeData:(i,r,s)=>{this._setAttributeData(i,r);const o=this.loadedGraphics.getNode(i);if(s!=null){const a=this.loadedGraphics.get(s.attributes[e]);a!=null&&this.processor.graphicsCore.recreateGraphics([a])}else o!=null&&this.processor.graphicsCore.recreateGraphics(o.graphics)},clearMemCache:()=>{}}}get performanceInfo(){const e={displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:this.maximumNumberOfFeatures,totalNumberOfFeatures:-1,nodes:this.loadedGraphics.nodeCount,core:this.processor.graphicsCore.performanceInfo};return this._controller&&this._controller.updateStats(e),e}get test(){return{controller:this._controller,numNodes:this.loadedGraphics.nodeCount,loadedGraphics:this.loadedGraphics}}};p([g()],c.prototype,"processor",void 0),p([g({type:he})],c.prototype,"filter",void 0),p([g()],c.prototype,"loadedGraphics",void 0),p([g()],c.prototype,"i3slayer",null),p([g()],c.prototype,"_controller",void 0),p([g()],c.prototype,"updating",void 0),p([g()],c.prototype,"suspended",void 0),p([g()],c.prototype,"holeFilling",void 0),p([g(oe)],c.prototype,"updatingProgress",void 0),p([g()],c.prototype,"updatingProgressValue",null),p([g(P.requiredFields)],c.prototype,"requiredFields",null),p([g(P.availableFields)],c.prototype,"availableFields",void 0),p([g()],c.prototype,"_fieldsHelper",void 0),p([g({type:Number})],c.prototype,"maximumNumberOfFeatures",null),p([g({readOnly:!0})],c.prototype,"maximumNumberOfFeaturesExceeded",null),p([g()],c.prototype,"_excludeObjectIdsSorted",null),p([g({readOnly:!0})],c.prototype,"lodFactor",null),p([g({readOnly:!0})],c.prototype,"hasM",null),p([g({readOnly:!0})],c.prototype,"hasZ",null),p([g()],c.prototype,"contentVisible",null),p([g({readOnly:!0})],c.prototype,"legendEnabled",null),c=p([ae("esri.views.3d.layers.SceneLayerGraphicsView3D")],c);const Pt=c;function De(e){return"pointData"in e}function C(e){return"geometryBuffer"in e&&e.geometryBuffer!==null}function Fe(e,t,i){const r=t.attributeInfo;if(r==null||r.loadedAttributes==null||r.attributeData==null)return!1;let s=!1;for(const{name:o}of r.loadedAttributes)if(r.attributeData[o]){const a=V(r.attributeData[o],i);a!==e.attributes[o]&&(e.attributes[o]=a,s=!0)}return s}function L(e){const t=e.attributeInfo,i=e.node.index;if(t!=null&&t.loadedAttributes!=null&&t.attributeData!=null)for(let r=0;rthis._fetchAllEdgeLocations(e,t)})}async fetchCandidates(e,t){const s=e.coordinateHelper,{point:u}=e,a=P;this.renderCoordsHelper.toRenderCoords(u,s.spatialReference,a);const p=e.distance,c=typeof p=="number"?p:p.distance,h=await this._workerHandle.invoke({bounds:f(a[0],a[1],a[2],c),returnEdge:e.returnEdge,returnVertex:e.returnVertex},t);return h.candidates.sort((y,m)=>y.distance-m.distance),h.candidates.map(y=>this._convertCandidate(s,y))}async add(e,t){this._ids.add(e.id),await this._workerHandle.invokeMethod("add",e,t)}async remove(e,t){this._ids.delete(e.id),await this._workerHandle.invokeMethod("remove",e,t)}_convertCandidate(e,t){switch(t.type){case"edge":return new I({objectId:t.objectId,targetPoint:this._convertRenderCoordinate(e,t.target),edgeStart:this._convertRenderCoordinate(e,t.start),edgeEnd:this._convertRenderCoordinate(e,t.end),isDraped:!1});case"vertex":return new x({objectId:t.objectId,targetPoint:this._convertRenderCoordinate(e,t.target),isDraped:!1})}}_convertRenderCoordinate({spatialReference:e},t){const s=v();return this.renderCoordsHelper.fromRenderCoords(t,s,e),R(s)}async _fetchAllEdgeLocations(e,t){const s=[],u=[];for(const{id:a,uid:p}of e.components)this._ids.has(a)&&s.push((async()=>{const c=await this.fetchEdgeLocations(a,t.signal),h=c.locations.buffer;return u.push(h),{id:a,uid:p,objectIds:c.objectIds,locations:h,origin:c.origin,type:c.type}})());return{result:{components:(await Promise.all(s)).filter(({id:a})=>this._ids.has(a))},transferList:u}}};i([o({constructOnly:!0})],d.prototype,"renderCoordsHelper",void 0),i([o({constructOnly:!0})],d.prototype,"fetchEdgeLocations",void 0),i([o({constructOnly:!0})],d.prototype,"schedule",void 0),i([o({readOnly:!0})],d.prototype,"availability",void 0),d=i([g("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],d);class j extends b{constructor(e,t){super("SceneLayerSnappingSourceWorker","fetchCandidates",{},e,{strategy:"dedicated",client:t})}}const P=v();let n=class extends S{get updating(){return this.updatingHandles.updating}constructor(r){super(r),this.availability=1,this._abortController=new AbortController}destroy(){this._tracker=k(this._tracker),this._abortController=C(this._abortController)}initialize(){const{view:r}=this,e=r.resourceController;this._edgeWorker=new L(_(e)),this._workerHandle=new d({renderCoordsHelper:this.view.renderCoordsHelper,schedule:_(e),fetchEdgeLocations:async(t,s)=>{if(this._tracker==null)throw new Error("tracker-not-initialized");return this._tracker.fetchEdgeLocations(t,this._edgeWorker,s)}}),this.updatingHandles.addPromise(this._setupLayerView()),this.handles.add([w(this._workerHandle),w(this._edgeWorker)])}async fetchCandidates(r,e){return this._workerHandle.fetchCandidates(r,e)}refresh(){}async _setupLayerView(){if(this.destroyed)return;const r=H(this._abortController,t=>t.signal),e=await this.getLayerView();e==null||E(r)||(this._tracker=e.trackSnappingSources({add:(t,s)=>{this.updatingHandles.addPromise(this._workerHandle.add({id:t,bounds:s},r))},remove:t=>{this.updatingHandles.addPromise(this._workerHandle.remove({id:t},r))}}))}};function _(r){return e=>r.immediate.schedule(e)}i([o({constructOnly:!0})],n.prototype,"getLayerView",void 0),i([o({constructOnly:!0})],n.prototype,"view",void 0),i([o({readOnly:!0})],n.prototype,"updating",null),i([o({readOnly:!0})],n.prototype,"availability",void 0),n=i([g("esri.views.interactive.snapping.featureSources.I3SSnappingSource")],n);let l=class extends O{get updating(){return this._i3sSources.some(r=>r.updating)}constructor(r){super(r),this.availability=1,this._i3sSources=[]}destroy(){this._i3sSources.forEach(r=>r.destroy()),this._i3sSources.length=0}initialize(){const{view:r}=this,e=this.layerSource.layer;this._i3sSources=e.type==="building-scene"?this._getBuildingSceneI3SSources(r,e):[this._getSceneLayerI3SSource(r,e)]}async fetchCandidates(r,e){const t=await Promise.all(this._i3sSources.map(s=>s.fetchCandidates(r,e)));return $(e),t.flat()}refresh(){this._i3sSources.forEach(r=>r.refresh())}_getBuildingSceneI3SSources(r,e){return e.allSublayers.toArray().map(t=>t.type==="building-component"?new n({getLayerView:async()=>(await r.whenLayerView(e)).whenSublayerView(t),view:r}):null).filter(V)}_getSceneLayerI3SSource(r,e){return new n({getLayerView:async()=>{const t=await r.whenLayerView(e);return t.type==="scene-layer-graphics-3d"?void 0:t},view:r})}};i([o({constructOnly:!0})],l.prototype,"layerSource",void 0),i([o({constructOnly:!0})],l.prototype,"view",void 0),i([o({readOnly:!0})],l.prototype,"updating",null),i([o({readOnly:!0})],l.prototype,"availability",void 0),l=i([g("esri.views.interactive.snapping.featureSources.SceneLayerSnappingSource")],l);export{l as SceneLayerSnappingSource}; diff --git a/assets/SceneLayerSnappingSourceWorker-3df2f794.js b/assets/SceneLayerSnappingSourceWorker-3df2f794.js new file mode 100644 index 0000000..15d6c5f --- /dev/null +++ b/assets/SceneLayerSnappingSourceWorker-3df2f794.js @@ -0,0 +1 @@ +import{h0 as f,h1 as g,gv as m,h2 as w,h3 as _,ai as E,al as v,h4 as b,h5 as y,dT as h,ax as L,em as V,h6 as j,h7 as P,h8 as C,h9 as u}from"./index-080e108a.js";const S=1e3;function $(t,e,n){const s=w(),o=_(s);return f(o,o,t,.5),f(o,o,e,.5),s[3]=g(o,t),m(o,o,n),s}let l=class{constructor(){this._idToComponent=new Map,this._components=new b(t=>t.bounds),this._edges=new b(t=>t.bounds),this._tmpLineSegment=y(),this._tmpP1=h(),this._tmpP2=h(),this._tmpP3=h(),this.remoteClient=null}async fetchCandidates(t,e){await Promise.resolve(),L(e),await this._ensureEdgeLocations(t,e);const n=[];return this._edges.forEachNeighbor(s=>(this._addCandidates(t,s,n),n.length{if(i.info==null){const{id:c,uid:d}=i;n.push({id:c,uid:d})}return!0},t.bounds),!n.length)return;const s={components:n},o=await this.remoteClient.invoke("fetchAllEdgeLocations",s,e??{});for(const i of o.components)this._setFetchEdgeLocations(i)}async add(t){const e=new p(t.id,t.bounds);return this._idToComponent.set(e.id,e),this._components.add([e]),{result:{}}}async remove(t){const e=this._idToComponent.get(t.id);if(e){const n=[];this._edges.forEachNeighbor(s=>(s.component===e&&n.push(s),!0),e.bounds),this._edges.remove(n),this._components.remove([e]),this._idToComponent.delete(e.id)}return{result:{}}}_setFetchEdgeLocations(t){const e=this._idToComponent.get(t.id);if(e==null||t.uid!==e.uid)return;const n=V.createView(t.locations),s=new Array(n.count),o=h(),i=h();for(let a=0;a{const f=i.get(m);if(f==null){const u=b.indexOf(t);return i.set(m,u),u}return f};let a=E.EDITING;const g={setAttribute(m,b){if(a!==E.EDITING)return;const f=e.fieldsIndex.get(m);if(!f)return;const u=e.attributeStorageInfo.findIndex(F=>F.name===f.name);if(u<0)return;l.setAttribute(u,b);const d=e.attributeStorageInfo[u];let h=!1;o.add(m),e.forEachNode((F,_)=>{const A=y(F,_);if(A===-1)return;const N=e.getAttributeData(F.index);if(N){const O=N[d.name];O&&(O[A]=b,e.setAttributeData(F.index,N,n),h=!0)}}),h&&e.clearMemCache()},setGeometry(m){a===E.EDITING&&l.setGeometry(m)},rollback(){if(a===E.EDITING){for(const m of o)this.setAttribute(m,s[m]);l.rollback(),a=E.ROLLED_BACK,e.sessions.delete(t)}},commit(){a===E.EDITING&&(l.commit(),a=E.COMMITTED,e.sessions.delete(t))}};return e.sessions.set(t,g),g}function xe(e,n){var f;const t=e.fieldsIndex,r=e.objectIdField,s=e.globalIdField;if(s==null)return;const o=new Map,l=P(n.addedFeatures),i=n.edits.addFeatures,y=L(n.updatedFeatures),a=n.edits.updateFeatures,g=me(t,r,s,(f=n.edits)==null?void 0:f.deleteFeatures),m=L(n.deletedFeatures,g),b=n.edits.deleteFeatures;if(i!=null&&i.length>0)for(const u of i){const d=v(t,u.attributes,s),h=l.get(d);u.geometry!=null&&u.geometry.type==="mesh"&&h!=null&&o.set(h,u.geometry)}if(a!=null&&a.length>0)for(const u of a){const d=v(t,u.attributes,r);u.geometry!=null&&u.geometry.type==="mesh"&&y.has(d)&&o.set(d,u.geometry)}if(b!=null&&b.length>0)for(const u of b){let d=null;d="attributes"in u?v(t,u.attributes,r):u.objectId,d!=null&&m.has(d)&&o.set(d,null)}for(const[u,d]of o)e.i3sOverrides.updateGeometry(u,d)}function ve(e,n){var b;const t=pe(e,n),r=fe(e,n);if(t.size===0&&r.size===0)return;const s=new Map;for(let f=0;f{const d=e.getAttributeData(u);let h=!1;f.forEach((F,_)=>{const A=d!=null?d[_]:null,N=s.get(_);for(const{featureIndex:O,value:M,featureId:B}of F)A&&(A[O]=M,h=!0,o=!0),e.i3sOverrides.updateAttributeValue(B,N,M)}),h&&e.setAttributeData(u,d,null)}),o&&e.clearMemCache();const{fieldsIndex:l,i3sOverrides:i,objectIdField:y,globalIdField:a}=e,g=(b=i.layer.associatedLayer)==null?void 0:b.infoFor3D,m=new Set(g?[...Object.values(g.assetMapFieldRoles),...Object.values(g.transformFieldRoles)]:[]);for(const[f,u]of r){i.featureAdded(f);const{attributes:d}=u;for(const h in d){if(h!==y&&h!==a&&m.has(h))continue;const F=l.normalizeFieldName(h),_=F!=null?s.get(F):null;if(_==null)continue;const A=d[h];i.updateAttributeValue(f,_,A)}}}function fe(e,{edits:n,addedFeatures:t}){const r=new Map,s=n.addAssetFeatures,{fieldsIndex:o,globalIdField:l}=e;if(!s||s.length===0||l==null)return r;const i=P(t);for(const y of s){const a=v(o,y.attributes,l),g=i.get(a);y.geometry!=null&&y.geometry.type==="mesh"&&g!=null&&r.set(g,y)}return r}function pe(e,n){const t=n.edits.updateFeatures;if(!t||t.length===0)return new R;const r=L(n.updatedFeatures),s=new R,o=new Map;for(let a=0;a{const g=v(l,a.attributes,i);return r.has(g)});return e.forEachNode((a,g)=>{const m=new Set(g);for(const b of y){const f=v(l,b.attributes,i);if(!m.has(f))continue;const u=g.indexOf(f);for(const d in b.attributes){const h=e.fieldsIndex.normalizeFieldName(d),F=ye(s,a.index,h),_=b.attributes[d];F.push({featureIndex:u,featureId:f,value:_})}}}),s}function ye(e,n,t){const r=ge(e,n),s=t!=null&&r.get(t);if(s)return s;const o=new Array;return r.set(t,o),o}function ge(e,n){const t=e.get(n);if(t)return t;const r=new he;return e.set(n,r),r}function me(e,n,t,r){const s=new Map;if(!r)return s;for(const o of r){let l=null,i=null;"attributes"in o?(l=v(e,o.attributes,n),i=v(e,o.attributes,t)):(l=o.objectId,i=o.globalId),i!=null&&l!=null&&s.set(i,l)}return s}function P(e){const n=new Map;if(!e)return n;for(const t of e)t.globalId!=null&&t.objectId!=null&&t.error==null&&n.set(t.globalId,t.objectId);return n}function L(e,n=null){const t=new Set;if(!e)return t;for(const r of e)if(r.error==null){if(r.objectId!=null&&r.objectId!==-1)t.add(r.objectId);else if(r.globalId!=null&&n!=null){const s=n.get(r.globalId);s!=null&&t.add(s)}}return t}(function(e){e[e.EDITING=0]="EDITING",e[e.ROLLED_BACK=1]="ROLLED_BACK",e[e.COMMITTED=2]="COMMITTED"})(E||(E={}));const he=Map,R=Map;function Ae(){return{requiredFields:{type:[String],readOnly:!0},availableFields:{type:[String],readOnly:!0,get:function(){const{layer:e,layer:{fieldsIndex:n},requiredFields:t}=this;return e.outFields?$(n,[...Y(n,e.outFields),...t]):$(n,t)}}}}const G=e=>{let n=class extends e{constructor(){super(...arguments),this._numUpdating=0,this._asyncUpdateState=new Map}get updating(){return this._numUpdating>0}autoUpdateAsync(t,r){return be(s=>this._updateAsync(t,s),r)}async _updateAsync(t,r){if(!this._startAsyncUpdate(t)){try{const s=await r();this._set(t,s)}catch{D.getLogger(this).warn(`Async update of "${String(t)}" failed. Async update functions should not throw exceptions.`)}this._endAsyncUpdate(t)&&this._updateAsync(t,r)}}_startAsyncUpdate(t){const r=this._asyncUpdateState.get(t)??w.None;return r&w.Updating?(this._asyncUpdateState.set(t,r|w.Invalidated),!0):(++this._numUpdating,this._asyncUpdateState.set(t,r|w.Updating),!1)}_endAsyncUpdate(t){--this._numUpdating;const r=(this._asyncUpdateState.get(t)??w.None)&~w.Updating;return r&w.Invalidated?(this._asyncUpdateState.set(t,r&~w.Invalidated),!0):(this._asyncUpdateState.set(t,r),!1)}};return c([p({readOnly:!0})],n.prototype,"updating",null),c([p()],n.prototype,"_numUpdating",void 0),n=c([U("esri.core.AsyncUpdate")],n),n};var w;function be(e,n){const t=()=>{o&&!l&&e(r)},r=()=>{if(!o||l)return n();o.clear(),l=!0;const i=Z(o,n);return l=!1,i},s=()=>{o&&(o.destroy(),o=null)};let o=new Q(t),l=!1;return e(r),{remove:s}}(function(e){e[e.None=0]="None",e[e.Updating=1]="Updating",e[e.Invalidated=2]="Invalidated"})(w||(w={}));let q=class extends G(X){};q=c([U("esri.core.AsyncUpdate")],q);const V="esri.views.3d.layers.support.SceneLayerViewRequiredFields";let x=class extends G(W){get layer(){return this.layerView.layer}get requiredFields(){const{layerView:{layer:{fieldsIndex:e},definitionExpressionFields:n},rendererFields:t,labelingFields:r,viewFilterFields:s}=this;return $(e,[...n??[],...t??[],...r??[],...s??[]])}constructor(e){super(e)}initialize(){this.handles.add([this.autoUpdateAsync("rendererFields",async()=>{const{fieldsIndex:e,renderer:n}=this.layer;return n?j(t=>n.collectRequiredFields(t,e)):null}),this.autoUpdateAsync("labelingFields",async()=>{const{layer:e}=this;return e.labelsVisible?j(n=>H(n,e)):null}),this.autoUpdateAsync("viewFilterFields",()=>{const{layer:e,filter:n}=this.layerView;return j(t=>J(t,e,n))})])}};async function j(e){const n=new Set;try{return await e(n),Array.from(n).sort()}catch(t){return D.getLogger(V).error(t),null}}c([p()],x.prototype,"layerView",void 0),c([p()],x.prototype,"layer",null),c([p()],x.prototype,"requiredFields",null),c([p()],x.prototype,"rendererFields",void 0),c([p()],x.prototype,"labelingFields",void 0),c([p()],x.prototype,"viewFilterFields",void 0),x=c([U(V)],x);const z="esri.views.layers.SceneLayerView",S=D.getLogger(z);let I=class extends de{constructor(){super(...arguments),this.layer=null,this.filter=null,this._geometryEngine=null,this._projectionEngineLoaded=!1,this._abortController=new AbortController}get availableFields(){return[]}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){throw new Error("Not implemented")}get maximumNumberOfFeaturesExceeded(){return!1}get layerFilter(){return ae(this._layerFilter)}get _layerFilter(){const e=this.layer.filter;if(e==null||e.geometries.length<1)return null;const n=this._geometryEngine;if(n==null||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine)return le;const t=e.geometries.at(0).spatialReference,r=e.geometries.toArray().map(i=>{try{i=n.simplify(i)}catch{return S.warnOncePerTick("Failed to simplify scene filter mask polygon. Polygon will be ignored."),null}if(i==null)return null;if(i.spatialReference.equals(t))return i;try{return ee(i,t)}catch{return S.warnOncePerTick("Failed to project scene filter mask polygon. Polygon will be ignored."),null}}).filter(te).sort((i,y)=>i.extent.xmin-y.extent.xmin),s=new Set,o=new Array,l=new Array;for(let i of r){const y=i.extent.xmin;if(o.length=0,s.forEach(a=>{if(y>=a.extent.xmax)return l.push(a),void s.delete(a);i.extent.ymin<=a.extent.ymax&&i.extent.ymax>=a.extent.ymin&&n.intersects(i,a)&&o.push(a)}),o.length>0){o.push(i);try{i=n.union(o)}catch{S.warnOncePerTick("Failed to unify filter mask polygons. Polygon will be ignored.");continue}o.pop(),o.forEach(a=>s.delete(a))}s.add(i)}return s.forEach(i=>l.push(i)),l.length>0?{spatialRelationship:e.spatialRelationship,geometries:l}:null}get _filterNeedsProjectionEngine(){const e=this.layer.filter;if(e==null||e.geometries.length<=1)return!1;const n=e.geometries.at(0).spatialReference;return e.geometries.some(({spatialReference:t})=>!t.equals(n)&&!ne(t,n))}get layerFilterUpdating(){return ue(this._layerFilter)}initialize(){const{signal:e}=this._abortController;T(()=>{var n,t,r;return this.destroyed||!this._geometryEngine&&((r=(t=(n=this.layer)==null?void 0:n.filter)==null?void 0:t.geometries)==null?void 0:r.length)},e).then(async()=>{k(e),this._geometryEngine=await re(()=>import("./geometryEngine-5a631b21.js"),["assets/geometryEngine-5a631b21.js","assets/geometryEngineBase-324c1c81.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/hydrated-c10ab4a5.js"])}).catch(C),this._projectionEngineLoaded=se(),T(()=>this.destroyed||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine,e).then(async()=>{k(e),await ie(),this._projectionEngineLoaded=!0}).catch(C)}destroy(){this._abortController=oe(this._abortController)}highlight(e){throw new Error("Not implemented")}queryFeatures(e,n){throw new Error("Not implemented")}queryObjectIds(e,n){throw new Error("Not implemented")}queryFeatureCount(e,n){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(e,n){throw new Error("Not implemented")}};c([p()],I.prototype,"layer",void 0),c([p()],I.prototype,"availableFields",null),c([p()],I.prototype,"maximumNumberOfFeatures",null),c([p({readOnly:!0})],I.prototype,"maximumNumberOfFeaturesExceeded",null),c([p()],I.prototype,"filter",void 0),c([p({readOnly:!0})],I.prototype,"layerFilter",null),c([p({readOnly:!0})],I.prototype,"_layerFilter",null),c([p()],I.prototype,"_geometryEngine",void 0),c([p()],I.prototype,"_projectionEngineLoaded",void 0),c([p()],I.prototype,"_filterNeedsProjectionEngine",null),c([p()],I.prototype,"layerFilterUpdating",null),I=c([U(z)],I);const Oe=I;export{Ae as i,Oe as j,ve as l,x as p,Ee as r,xe as s}; diff --git a/assets/SceneLayerView3D-ef96402b.js b/assets/SceneLayerView3D-ef96402b.js new file mode 100644 index 0000000..7b54457 --- /dev/null +++ b/assets/SceneLayerView3D-ef96402b.js @@ -0,0 +1 @@ +import{ag as h,dV as a,ah as m,bz as f,dW as _,aK as b,ai as l,aj as n,aL as F,al as v}from"./index-080e108a.js";import{s as I,D as w}from"./I3SOverrides-96f73e2b.js";import{f as E}from"./WhereClause-c86b9974.js";import{d as O}from"./FeatureFilter-00f4be05.js";import{o as x}from"./floorFilterUtils-080a7cd2.js";import{b as d}from"./Query-1c961d4c.js";import{x as S,c as j,E as C}from"./I3SMeshView3D-86f2c945.js";import{n as H}from"./LayerView3D-ffd35809.js";import{p as Q,r as q,s as V,l as D,i as A,j as R}from"./SceneLayerView-b7d3fe23.js";import{L as p,d as L,l as $,o as G}from"./I3SQueryFeatureStore-0cfa6ebc.js";import{n as y}from"./I3SNode-2025159f.js";import{y as U,p as P,V as u}from"./I3SUtil-2c288808.js";import{t as M}from"./DefinitionExpressionSceneLayerView-66b62d34.js";import{i as N}from"./PopupSceneLayerView-c49dd096.js";import{t as z}from"./popupUtils-f04ec9a9.js";import"./I3SBinaryReader-2b8e30f7.js";import"./meshFeatureSet-8442b8e6.js";import"./FeatureSet-111cb247.js";import"./FeatureLayerView3D-7e7e2653.js";import"./FeatureLayerViewBase3D-8474587e.js";import"./FeatureLikeLayerView3D-2e3185ce.js";import"./dehydratedFeatureComparison-a3375a3e.js";import"./queryForSymbologySnapping-0264f2b5.js";import"./elevationInfoUtils-4fd79d95.js";import"./hash-6f442295.js";import"./diffUtils-590c9088.js";import"./Graphics3DObjectStates-bb2a6162.js";import"./UniqueValueRenderer-fef4204d.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./QueryEngine-19eda5ff.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./FeatureStore-f0e312fc.js";import"./BoundsStore-b6bd3c14.js";import"./projectExtentUtils-efa4cddd.js";import"./query-93c6e211.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./EventedSet-d13fada5.js";import"./commonProperties-30089b06.js";import"./FeatureEffect-86735d98.js";import"./LayerView-448bc5ea.js";import"./RefreshableLayerView-915e7f53.js";import"./executionError-c92d3b85.js";import"./SceneModification-2715f58a.js";import"./persistable-ca976a2c.js";import"./multiOriginJSONSupportUtils-c978f4c3.js";import"./resourceExtension-91e7c3ce.js";import"./SceneLayerWorker-e92c2264.js";const c=A();let s=class extends S(M(N(H(R)))){constructor(){super(...arguments),this.type="scene-layer-3d",this._setVisibilityHiddenObjectIds=new I,this.progressiveLoadFactor=1,this._elevationContext="scene",this._isIntegratedMesh=!1,this._supportsLabeling=!0,this._interactiveEditingSessions=new Map,this._queryEngine=null}get i3slayer(){return this.layer}tryRecycleWith(e,t){return e.url===this.layer.url&&this.i3sOverrides.isEmpty?e.load(t).then(()=>{var r;U(this.layer,e,this.i3sOverrides),this.layer=e,this.i3sOverrides.destroy();const i=(r=this.view.resourceController)==null?void 0:r.memoryController;this.i3sOverrides=new w({view:this.view,layer:e,memoryController:i}),this.resetHighlights()}):null}get layerPopupEnabledAndHasTemplate(){var e;return this.layer.popupEnabled&&z(this.layer,(e=this.view.popup)==null?void 0:e.defaultPopupTemplateEnabled)}get filter(){return this._get("filter")}set filter(e){this._set("filter",p.checkSupport(e)?e:null)}get viewFilter(){const e=this.filter,t=this.layerFilter;if(e==null&&t==null)return null;const i=this._get("viewFilter");return i==null?new p({layerFilter:t,viewFilter:e,layerFieldsIndex:this.layer.fieldsIndex,loadAsyncModule:r=>this._loadAsyncModule(r),addSqlFilter:(r,o)=>this.addSqlFilter(r,o,this.logError)}):(i.viewFilter=e,i.layerFilter=t,i)}get requiredFields(){var e;return((e=this._fieldsHelper)==null?void 0:e.requiredFields)??[]}get _floorFilterClause(){const e=x(this);return e!=null?E.create(e,this.layer.fieldsIndex):null}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds.toArray();return e.length?e.sort((t,i)=>t-i):null}get _setVisibilityHiddenObjectIdsSorted(){return this._setVisibilityHiddenObjectIds.size?Array.from(this._setVisibilityHiddenObjectIds).sort((e,t)=>e-t):null}get _objectQualitySettings(){var e,t,i;return(i=(t=(e=this.view)==null?void 0:e.qualitySettings)==null?void 0:t.sceneService)==null?void 0:i.object}get lodFactor(){var e;return((e=this._objectQualitySettings)==null?void 0:e.lodFactor)??1}get lodCrossfadeinDuration(){return this._objectQualitySettings.lodCrossfadeinDuration??0}get lodCrossfadeoutDuration(){return this._objectQualitySettings.lodCrossfadeoutDuration??0}get lodCrossfadeUncoveredDuration(){return this._objectQualitySettings.lodCrossfadeUncoveredDuration??0}get updatingProgressValue(){var e;return((e=this._controller)==null?void 0:e.updatingProgress)??0}initialize(){this._fieldsHelper=new Q({layerView:this}),this.updatingHandles.add(()=>this.layer.rangeInfos,t=>this._rangeInfosChanged(t),h),this.updatingHandles.add(()=>this.layer.renderer,t=>this.updatingHandles.addPromise(this._rendererChange(t)),h);const e=()=>this._filterChange();this.updatingHandles.add(()=>this.parsedDefinitionExpression,e),this.updatingHandles.add(()=>this.filter,e),this.updatingHandles.add(()=>this._floorFilterClause,e),this.updatingHandles.add(()=>this._excludeObjectIdsSorted,e),this.updatingHandles.add(()=>this._setVisibilityHiddenObjectIdsSorted,e),this.updatingHandles.add(()=>this.viewFilter!=null?this.viewFilter.sortedObjectIds:null,e),this.updatingHandles.add(()=>this.viewFilter!=null?this.viewFilter.parsedWhereClause:null,e),this.updatingHandles.add(()=>[this.viewFilter!=null?this.viewFilter.parsedGeometry:null,this.filter!=null?this.filter.spatialRelationship:null,this.layer.filter!=null?this.layer.filter.spatialRelationship:null],()=>this._geometryFilterChange()),a()&&this.i3sOverrides.is3DOFL&&this.updatingHandles.add(()=>this.i3sOverrides.sortedGeometryChangedObjectIds,e),this.handles.add(this.layer.on("apply-edits",t=>this.updatingHandles.addPromise(t.result))),this.handles.add(this.layer.on("edits",t=>this._handleEdits(t)))}destroy(){this._fieldsHelper=m(this._fieldsHelper)}_rangeInfosChanged(e){e!=null&&e.length>0&&f.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}createQuery(){const e={outFields:["*"],returnGeometry:!1,outSpatialReference:this.view.spatialReference};return this.filter!=null?this.filter.createQuery(e):new d(e)}queryExtent(e,t){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),t==null?void 0:t.signal)}queryFeatureCount(e,t){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),t==null?void 0:t.signal)}queryFeatures(e,t){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),t==null?void 0:t.signal).then(i=>{if(!(i!=null&&i.features))return i;const r=this.layer;for(const o of i.features)o.layer=r,o.sourceLayer=r;return i})}queryObjectIds(e,t){return this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),t==null?void 0:t.signal)}_ensureQueryEngine(){return this._queryEngine||(this._queryEngine=this._createQueryEngine()),this._queryEngine}_createQueryEngine(){const e=j(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new L({layerView:this,priority:_.FEATURE_QUERY_ENGINE,spatialIndex:new $({featureAdapter:new G({objectIdField:this.layer.objectIdField,attributeStorageInfo:this.layer.attributeStorageInfo??[],getFeatureExtent:e}),forAllFeatures:(t,i)=>this._forAllFeatures((r,o,g)=>t({id:r,index:o,meta:g}),i,C.QUERYABLE),getFeatureExtent:e,sourceSpatialReference:P(this.layer),viewSpatialReference:this.view.spatialReference})})}highlight(e){const t=this._highlights;if(e instanceof d){const{set:i,handle:r}=t.acquireSet();return this.queryObjectIds(e).then(o=>t.setFeatureIds(i,o)),r}return super.highlight(e)}createInteractiveEditSession(e){return q(this._attributeEditingContext,e)}_createLayerGraphic(e){const t=new b(null,null,e);return t.layer=this.layer,t.sourceLayer=this.layer,t}getFilters(){const e=super.getFilters();a()&&this.i3sOverrides.is3DOFL&&this.i3sOverrides.sortedGeometryChangedObjectIds.length>0&&e.push((r,o)=>{o.node.index>=0&&u(this.i3sOverrides.sortedGeometryChangedObjectIds,!1,r)});const t=this._setVisibilityHiddenObjectIdsSorted;t!=null&&e.push(r=>u(t,!1,r));const i=this._excludeObjectIdsSorted;return i!=null&&e.push(r=>u(i,!1,r)),this._floorFilterClause&&this.addSqlFilter(e,this._floorFilterClause,this.logError),this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),this.viewFilter!=null&&this.viewFilter.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}setVisibility(e,t){t?this._setVisibilityHiddenObjectIds.delete(e):this._setVisibilityHiddenObjectIds.add(e)}isUpdating(){return super.isUpdating()||this.layerFilterUpdating||this.viewFilter!=null&&this.viewFilter.updating||this.i3sOverrides!=null&&this.i3sOverrides.updating}_ensureQuery(e){return this._addDefinitionExpressionToQuery(e==null?this.createQuery():d.from(e))}get _attributeEditingContext(){return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:this._getObjectIdField(),globalIdField:this._getGlobalIdField(),forEachNode:e=>this._forAllNodes(t=>t!=null?e(t.node,t.featureIds):null),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this.i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(e,t)=>this.setAttributeData(e,t),clearMemCache:()=>this.clearMemCache()}}_handleEdits(e){a()&&V(this._attributeEditingContext,e),D(this._attributeEditingContext,e)}get hasGeometryFilter(){const e=this.viewFilter;return e!=null&&e.parsedGeometry!=null}computeNodeFiltering(e){const t=this.viewFilter;return t==null||!this.view.spatialReference||t.isMBSGeometryVisible(e,this.view.spatialReference,this._controller.crsIndex)?y.Unmodified:y.Culled}};l([n()],s.prototype,"i3slayer",null),l([n(F)],s.prototype,"updatingProgress",void 0),l([n({type:O})],s.prototype,"filter",null),l([n({readOnly:!0})],s.prototype,"viewFilter",null),l([n(c.requiredFields)],s.prototype,"requiredFields",null),l([n(c.availableFields)],s.prototype,"availableFields",void 0),l([n()],s.prototype,"_fieldsHelper",void 0),l([n()],s.prototype,"_floorFilterClause",null),l([n()],s.prototype,"_excludeObjectIdsSorted",null),l([n()],s.prototype,"_setVisibilityHiddenObjectIds",void 0),l([n()],s.prototype,"_setVisibilityHiddenObjectIdsSorted",null),l([n()],s.prototype,"_objectQualitySettings",null),l([n()],s.prototype,"lodFactor",null),l([n()],s.prototype,"updatingProgressValue",null),s=l([v("esri.views.3d.layers.SceneLayerView3D")],s);const et=s;export{et as default}; diff --git a/assets/SceneLayerWorker-e92c2264.js b/assets/SceneLayerWorker-e92c2264.js new file mode 100644 index 0000000..bd3b26d --- /dev/null +++ b/assets/SceneLayerWorker-e92c2264.js @@ -0,0 +1 @@ +import{aw as v,hf as G,bc as j,iN as q,dh as Q,di as W,iO as K,iP as X,iQ as Z}from"./index-080e108a.js";import{o as L}from"./I3SNode-2025159f.js";var S,D;(function(e){e[e.None=0]="None",e[e.Int16=1]="Int16",e[e.Int32=2]="Int32"})(S||(S={})),function(e){e[e.Replace=0]="Replace",e[e.Outside=1]="Outside",e[e.Inside=2]="Inside",e[e.Finished=3]="Finished"}(D||(D={}));function ee(){return M||(M=new Promise(e=>v(()=>import("./i3s-dc0aca0d.js"),["assets/i3s-dc0aca0d.js","assets/index-080e108a.js","assets/index-a8e73b5e.css"]).then(t=>t.i).then(({default:t})=>{const r=t({locateFile:te,onRuntimeInitialized:()=>e(r)});delete r.then})).catch(e=>{throw e})),M}function te(e){return G(`esri/libs/i3s/${e}`)}let M;async function ne(e){await _();const t=[e.geometryBuffer];return{result:C(e,t),transferList:t}}async function re(e){var f;await _();const t=[e.geometryBuffer],{geometryBuffer:r}=e,s=r.byteLength,a=o._malloc(s),u=new Uint8Array(o.HEAPU8.buffer,a,s);u.set(new Uint8Array(r));const i=o.dracoDecompressPointCloudData(a,u.byteLength);if(o._free(a),i.error.length>0)throw new Error(`i3s.wasm: ${i.error}`);const d=((f=i.featureIds)==null?void 0:f.length)>0?i.featureIds.slice():null,y=i.positions.slice();return d&&t.push(d.buffer),t.push(y.buffer),{result:{positions:y,featureIds:d},transferList:t}}async function oe(e){await _(),Y(e);const t={buffer:e.buffer};return{result:t,transferList:[t.buffer]}}async function ie(e){await _(),$(e)}async function se(e){await _(),o.setLegacySchema(e.context,e.jsonSchema)}async function ae(e){const{localMatrix:t,origin:r,positions:s,vertexSpace:a,local:u}=e,i=j.fromJSON(e.inSpatialReference),d=j.fromJSON(e.outSpatialReference),y={georeferenced:q,georeferencedRelative:Q,local:W}[a.type].fromJSON(a);let f;if(y.type==="georeferenced"){const{projectBuffer:l,initializeProjection:g}=await v(()=>import("./index-080e108a.js").then(c=>c.uO),["assets/index-080e108a.js","assets/index-a8e73b5e.css"]);await g(i,d),f=new Float64Array(s.length),l(s,i,0,f,d,0,f.length/3)}else{const{project:l}=await v(()=>import("./index-080e108a.js").then(g=>g.uS),["assets/index-080e108a.js","assets/index-a8e73b5e.css"]);f=K(l({positions:s,transform:t?{localMatrix:t}:void 0,vertexSpace:y,inSpatialReference:i,outSpatialReference:d,local:u}))}const P=f.length,[O,w,A]=r;for(let l=0;lh.some(p=>p.name==="color")),normal:e.needNormals&&e.layouts.some(h=>h.some(p=>p.name==="normalCompressed")),uv0:e.layouts.some(h=>h.some(p=>p.name==="uv0")),uvRegion:e.layouts.some(h=>h.some(p=>p.name==="uvRegion")),featureIndex:x.featureIndex},n=o.process(r,!!e.obb,w,g.byteLength,x,z,l,d,P,O,e.normalReferenceFrame);if(o._free(l),o._free(w),n.error.length>0)throw new Error(`i3s.wasm: ${n.error}`);if(n.discarded)return null;const R=n.componentOffsets.length>0?n.componentOffsets.slice():null,T=n.featureIds.length>0?n.featureIds.slice():null,H=n.anchorIds.length>0?Array.from(n.anchorIds):null,J=n.anchors.length>0?Array.from(n.anchors):null,F=n.interleavedVertedData.slice().buffer,U=n.indicesType===S.Int16?new Uint16Array(n.indices.buffer,n.indices.byteOffset,n.indices.byteLength/2).slice():new Uint32Array(n.indices.buffer,n.indices.byteOffset,n.indices.byteLength/4).slice(),N=n.positions.slice(),B=n.positionIndicesType===S.Int16?new Uint16Array(n.positionIndices.buffer,n.positionIndices.byteOffset,n.positionIndices.byteLength/2).slice():new Uint32Array(n.positionIndices.buffer,n.positionIndices.byteOffset,n.positionIndices.byteLength/4).slice(),k={layout:e.layouts[0],interleavedVertexData:F,indices:U,hasColors:n.hasColors,hasModifications:n.hasModifications,positionData:{data:N,indices:B}};return T&&t.push(T.buffer),R&&t.push(R.buffer),t.push(F),t.push(U.buffer),t.push(N.buffer),t.push(B.buffer),{componentOffsets:R,featureIds:T,anchorIds:H,anchors:J,transformedGeometry:k,obb:n.obb}}function le(e){return e===0?L.Unmodified:e===1?L.PotentiallyModified:e===2?L.Culled:L.Unknown}function Y(e){const{context:t,buffer:r}=e,s=o._malloc(r.byteLength),a=r.byteLength/Float64Array.BYTES_PER_ELEMENT,u=new Float64Array(o.HEAPU8.buffer,s,a),i=new Float64Array(r);u.set(i),o.filterOBBs(t,s,a),i.set(u),o._free(s)}function V(e){o&&(o.destroy(e),o=null)}function E(e,t){for(let r=0;r{o=e,I=null})),I)}const ue={transform:C,destroy:V},me=Object.freeze(Object.defineProperty({__proto__:null,destroyContext:ce,dracoDecompressPointCloudData:re,filterObbsForModifications:oe,filterObbsForModificationsSync:Y,initialize:_,interpretObbModificationResults:le,process:ne,project:ae,setLegacySchema:se,setModifications:ie,setModificationsSync:$,test:ue,transformNormals:fe},Symbol.toStringTag,{value:"Module"}));export{le as L,Y as S,me as a,D as e,_ as j,$ as w}; diff --git a/assets/SceneModification-2715f58a.js b/assets/SceneModification-2715f58a.js new file mode 100644 index 0000000..edf4889 --- /dev/null +++ b/assets/SceneModification-2715f58a.js @@ -0,0 +1 @@ +import{ai as r,aj as l,ak as c,bY as y,al as m,ck as f,aB as u,b8 as d,d3 as g,cl as R}from"./index-080e108a.js";import{g as n}from"./persistable-ca976a2c.js";var s;let t=s=class extends f{constructor(a){super(a),this.geometry=null,this.type="clip"}writeGeometry(a,i,o,e){if(e.layer&&e.layer.spatialReference&&!e.layer.spatialReference.equals(this.geometry.spatialReference)){if(!u(a.spatialReference,e.layer.spatialReference))return void(e&&e.messages&&e.messages.push(new d("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})));const p=new c;g(a,p,e.layer.spatialReference),i[o]=p.toJSON(e)}else i[o]=a.toJSON(e);delete i[o].spatialReference}clone(){return new s({geometry:R(this.geometry),type:this.type})}};r([l({type:c}),n()],t.prototype,"geometry",void 0),r([y(["web-scene","portal-item"],"geometry")],t.prototype,"writeGeometry",null),r([l({type:["clip","mask","replace"],nonNullable:!0}),n()],t.prototype,"type",void 0),t=s=r([m("esri.layers.support.SceneModification")],t);const b=t;export{b as f}; diff --git a/assets/SceneService-6fea113d.js b/assets/SceneService-6fea113d.js new file mode 100644 index 0000000..8a57bf7 --- /dev/null +++ b/assets/SceneService-6fea113d.js @@ -0,0 +1,3 @@ +import{df as L,fp as P,ax as V,ar as y,b7 as K,bz as k,ai as p,aj as d,bc as b,ay as f,ca as _,az as q,bY as z,al as C,aR as M,jb as F,bW as J,jc as D,jd as B,je as Z,bf as N,at as R,b5 as G,b9 as j}from"./index-080e108a.js";import{i as E}from"./originUtils-1469eeaf.js";import{v as H,f as W}from"./commonProperties-30089b06.js";import{r as Y}from"./I3SIndexInfo-445e6968.js";import{getSiblingOfSameTypeI as Q}from"./resourceUtils-b667b05b.js";let X=null;function ee(){return X}async function $(s,i,e){if(!i||!i.resources)return;const t=i.portalItem===s.portalItem?new Set(s.paths):new Set;s.paths.length=0,s.portalItem=i.portalItem;const a=new Set(i.resources.toKeep.map(n=>n.resource.path)),r=new Set,o=[];a.forEach(n=>{t.delete(n),s.paths.push(n)});for(const n of i.resources.toUpdate)if(t.delete(n.resource.path),a.has(n.resource.path)||r.has(n.resource.path)){const{resource:h,content:u,finish:I,error:x}=n,S=Q(h,L());s.paths.push(S.path),o.push(T({resource:S,content:u,compress:n.compress,finish:I,error:x},e))}else s.paths.push(n.resource.path),o.push(te(n,e)),r.add(n.resource.path);for(const n of i.resources.toAdd)o.push(T(n,e)),s.paths.push(n.resource.path);if(t.forEach(n=>{if(i.portalItem){const h=i.portalItem.resourceFromPath(n);o.push(h.portalItem.removeResource(h).catch(()=>{}))}}),o.length===0)return;const l=await P(o);V(e);const c=l.filter(n=>"error"in n).map(n=>n.error);if(c.length>0)throw new y("save:resources","Failed to save one or more resources",{errors:c})}async function T(s,i){var a,r;const e={...i??{},compress:s.compress},t=await K(s.resource.portalItem.addResource(s.resource,s.content,e));if(t.ok!==!0)throw(a=s.error)==null||a.call(s,t.error),t.error;(r=s.finish)==null||r.call(s,s.resource)}async function te(s,i){var t,a;const e=await K(s.resource.update(s.content,i));if(e.ok!==!0)throw(t=s.error)==null||t.call(s,e.error),e.error;(a=s.finish)==null||a.call(s,s.resource)}const U="esri.layers.mixins.SceneService",m=k.getLogger(U),ne=s=>{let i=class extends s{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=M(async(e,t,a)=>{switch(e){case w.SAVE:return this._save(t);case w.SAVE_AS:return this._saveAs(a,t)}})}readSpatialReference(e,t){return this._readSpatialReference(t)}_readSpatialReference(e){if(e.spatialReference!=null)return b.fromJSON(e.spatialReference);{const t=e.store,a=t.indexCRS||t.geographicCRS,r=a&&parseInt(a.substring(a.lastIndexOf("/")+1,a.length),10);return r!=null?new b(r):null}}readFullExtent(e,t,a){if(e!=null&&typeof e=="object"){const l=e.spatialReference==null?{...e,spatialReference:this._readSpatialReference(t)}:e;return _.fromJSON(l,a)}const r=t.store,o=this._readSpatialReference(t);return o==null||r==null||r.extent==null||!Array.isArray(r.extent)||r.extent.some(l=>l=2&&(t.major=parseInt(a[0],10),t.minor=parseInt(a[1],10)),t}readVersion(e,t){const a=t.store,r=a.version!=null?a.version.toString():"";return this.parseVersionString(r)}readTitlePortalItem(e){return this.sublayerTitleMode!=="item-title"?void 0:e}readTitleService(e,t){const a=this.portalItem&&this.portalItem.title;if(this.sublayerTitleMode==="item-title")return F(this.url,t.name);let r=t.name;if(!r&&this.url){const o=J(this.url);o!=null&&(r=o.title)}return this.sublayerTitleMode==="item-title-and-service-name"&&a&&(r=a+" - "+r),D(r)}set url(e){const t=B({layer:this,url:e,nonStandardUrlAllowed:!1,logger:m});this._set("url",t.url),t.layerId!=null&&this._set("layerId",t.layerId)}writeUrl(e,t,a,r){Z(this,e,"layers",t,r)}get parsedUrl(){const e=this._get("url"),t=N(e);return this.layerId!=null&&(t.path=`${t.path}/layers/${this.layerId}`),t}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=Y(this.parsedUrl.path,this.rootNode,e,this.apiKey,m,t),this.fullExtent==null||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){var t,a,r;if((e==null?void 0:e.type)==="page"){const o=e.rootIndex%e.pageSize,l=(a=(t=e.rootPage)==null?void 0:t.nodes)==null?void 0:a[o];if(l==null||l.obb==null||l.obb.center==null||l.obb.halfSize==null)throw new y("sceneservice:invalid-node-page","Invalid node page.");if(l.obb.center[0]0)return t.data.layers[0].id}async _fetchServiceLayer(e){var o;const t=await R(((o=this.parsedUrl)==null?void 0:o.path)??"",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});t.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let a=!1;if(t.data.layerType&&t.data.layerType==="Voxel"&&(a=!0),a)return this._fetchVoxelServiceLayer();const r=t.data;this.read(r,this._getServiceContext()),this.validateLayer(r)}async _fetchVoxelServiceLayer(e){var a;const t=(await R(((a=this.parsedUrl)==null?void 0:a.path)+"/layer",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,this._getServiceContext()),this.validateLayer(t)}_getServiceContext(){var e;return{origin:"service",portalItem:this.portalItem,portal:(e=this.portalItem)==null?void 0:e.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&typeof this.beforeSave=="function"&&await this.beforeSave()}validateLayer(e){}_updateTypeKeywords(e,t,a){e.typeKeywords||(e.typeKeywords=[]);const r=t.getTypeKeywords();for(const o of r)e.typeKeywords.push(o);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((o,l,c)=>c.indexOf(o)===l),a===v.newItem&&(e.typeKeywords=e.typeKeywords.filter(o=>o!=="Hosted Service")))}async _saveAs(e,t){var n;const a={...O,...t};let r=G.from(e);r||(m.error("_saveAs(): requires a portal item parameter"),await Promise.reject(new y("sceneservice:portal-item-required","_saveAs() requires a portal item to save to"))),r.id&&(r=r.clone(),r.id=null);const o=r.portal||j.getDefault();await this._ensureLoadBeforeSave(),r.type=g,r.portal=o;const l={origin:"portal-item",url:null,messages:[],portal:o,portalItem:r,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},c={layers:[this.write({},l)]};return await Promise.all(l.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(c,l,a),r.url=this.url,r.title||(r.title=this.title),this._updateTypeKeywords(r,a,v.newItem),await o.signIn(),await((n=o.user)==null?void 0:n.addItem({item:r,folder:a&&a.folder,data:c})),await $(this.resourceReferences,l,null),this.portalItem=r,E(l),l.portalItem=r,r}async _save(e){const t={...O,...e};if(!this.portalItem)throw m.error("_save(): requires the .portalItem property to be set"),new y("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==g)throw m.error("_save(): Non-matching portal item type. Got "+this.portalItem.type+", expected "+g),new y("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${g}"`);await this._ensureLoadBeforeSave();const a={origin:"portal-item",url:this.portalItem.itemUrl&&N(this.portalItem.itemUrl),messages:[],portal:this.portalItem.portal||j.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},r={layers:[this.write({},a)]};return await Promise.all(a.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(r,a,t),this.portalItem.url=this.url,this.portalItem.title||(this.portalItem.title=this.title),this._updateTypeKeywords(this.portalItem,t,v.existingItem),await this.portalItem.update({data:r}),await $(this.resourceReferences,a,null),E(a),this.portalItem}async _validateAgainstJSONSchema(e,t,a){var n,h;let r=((n=t.messages)==null?void 0:n.filter(u=>u.type==="error").map(u=>new y(u.name,u.message,u.details)))??[];(h=a==null?void 0:a.validationOptions)!=null&&h.ignoreUnsupported&&(r=r.filter(u=>u.name!=="layer:unsupported"&&u.name!=="symbol:unsupported"&&u.name!=="symbol-layer:unsupported"&&u.name!=="property:unsupported"&&u.name!=="url:unsupported"&&u.name!=="scenemodification:unsupported"));const o=a==null?void 0:a.validationOptions,l=o==null?void 0:o.enabled,c=ee();if(l&&c){const u=(await c()).validate(e,a.portalItemLayerType);if(u.length>0){const I=`Layer item did not validate: +${u.join(` +`)}`;if(m.error(`_validateAgainstJSONSchema(): ${I}`),o.failPolicy==="throw"){const x=u.map(S=>new y("sceneservice:schema-validation",S)).concat(r);throw new y("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{combined:x})}}}if(r.length>0)throw new y("sceneservice:save","Failed to save SceneService due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:r})}};return p([d(H)],i.prototype,"id",void 0),p([d({type:b})],i.prototype,"spatialReference",void 0),p([f("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],i.prototype,"readSpatialReference",null),p([d({type:_})],i.prototype,"fullExtent",void 0),p([f("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],i.prototype,"readFullExtent",null),p([d({readOnly:!0,type:q})],i.prototype,"heightModelInfo",void 0),p([d({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],i.prototype,"minScale",void 0),p([d({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],i.prototype,"maxScale",void 0),p([d({readOnly:!0})],i.prototype,"version",void 0),p([f("version",["store.version"])],i.prototype,"readVersion",null),p([d({type:String,json:{read:{source:"copyrightText"}}})],i.prototype,"copyright",void 0),p([d({type:String,json:{read:!1}})],i.prototype,"sublayerTitleMode",void 0),p([d({type:String})],i.prototype,"title",void 0),p([f("portal-item","title")],i.prototype,"readTitlePortalItem",null),p([f("service","title",["name"])],i.prototype,"readTitleService",null),p([d({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],i.prototype,"layerId",void 0),p([d(W)],i.prototype,"url",null),p([z("url")],i.prototype,"writeUrl",null),p([d()],i.prototype,"parsedUrl",null),p([d({readOnly:!0})],i.prototype,"store",void 0),p([d({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],i.prototype,"rootNode",void 0),i=p([C(U)],i),i},A=-1e38;var v;(function(s){s[s.existingItem=0]="existingItem",s[s.newItem=1]="newItem"})(v||(v={}));const g="Scene Service",O={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var w;(function(s){s[s.SAVE=0]="SAVE",s[s.SAVE_AS=1]="SAVE_AS"})(w||(w={}));export{w as K,ne as N}; diff --git a/assets/Segment-50129b50.js b/assets/Segment-50129b50.js new file mode 100644 index 0000000..d6b3da6 --- /dev/null +++ b/assets/Segment-50129b50.js @@ -0,0 +1 @@ +import{b9 as dt,lZ as pt,l_ as T,cf as ut,l$ as _t,gD as xt,dT as m,kK as O,fs as it,kz as ot,kA as F,kB as $,ai as a,aj as h,al as st,ao as rt,bh as w,af as mt,m0 as b,m1 as q,m2 as z,m3 as j,m4 as yt,aG as ft,gv as G,lW as H,m5 as nt,j1 as C,dR as L,j7 as gt,gu as vt,h9 as D,dO as k,gm as bt,aB as St,m6 as wt,m7 as Ct}from"./index-080e108a.js";import{b as $t,p as Rt,x as kt,y as It,d as Pt}from"./unitFormatUtils-b70a7bff.js";import{t as Tt}from"./LineVisualElement-b605d10c.js";import{v as zt}from"./elevationInfoUtils-4fd79d95.js";function Et(e){var r,s;const t="metric";if(e==null)return t;const i=e.map,o=(i&&"portalItem"in i?(r=i.portalItem)==null?void 0:r.portal:null)??dt.getDefault();switch(((s=o.user)==null?void 0:s.units)??o.units){case t:return t;case"english":return"imperial"}return pt(e.spatialReference)??t}function jt(e,t){return{type:T(t),value:e,unit:t}}function At(e,t){return{type:T(t),value:e,unit:t}}function Mt(e,t){return{type:T(t),value:e,unit:t}}function Lt(e,t,i="arithmetic"){return{type:T(t),value:e,unit:t,rotationType:i}}function Xt(e,t){return jt(ut(e.value,e.unit,t),t)}At(0,"meters");Mt(0,"square-meters");Lt(0,"radians");function Jt(e,t,i,o=2,r="abbr"){return $t(e,Xt(t,i).value,i,o,r)}function Kt(e,t,i=2,o="abbr"){return Rt(e,t.value,t.unit,i,o)}function Qt(e,t,i=2,o="abbr"){return kt(e,t.value,t.unit,i,o)}function te(e,t,i=2,o="abbr"){return It(e,t.value,t.unit,i,o)}function ee(e,t,i=2,o="abbr"){return Pt(e,t.value,t.unit,i,o)}function Yt(e,t,i,o){i.projectToRenderScreen(e,N),i.projectToRenderScreen(t,W),ot(o,W,N),F(o,o)}function Bt(e,t,i,o,r=m()){const s=it(X,e);return s[2]=zt(o,s,t,i)||0,o.renderCoordsHelper.toRenderCoords(s,t,r),r}function ie(e,t,i,o){return o.type==="2d"?(I.x=e[0],I.y=e[1],I.spatialReference=t,o.toScreen(I)):(Bt(e,t,i,o,X),o.state.camera.projectToScreen(X,A),_t(A[0],A[1]))}const I=xt(0,0,0,null),X=m(),N=$(),W=$(),A=O();let Ot=e=>({vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}),at=(e,t,i)=>{for(let o=0,r=t.length;o1)&&(o.renderToScreen(d,i),!0)}_computeLabelPositionFromCorner(t,i,o,r){if(!t)return!1;const s=this._camera;return J(t.left,1,s,f),j(f,f),J(t.right,0,s,tt),b(n,f,tt),j(n,n),F(n,n),s.projectToRenderScreen(t.left.endRenderSpace,d),!(d[2]<0||d[2]>1)&&(s.renderToScreen(d,o),z(n,n,i),b(n,n,d),s.renderToScreen(n,r),!0)}_computeLabelPositionFromSegment(t,i,o,r,s){if(!t)return!1;const u=t.segment,c=this._camera;Yt(u.startRenderSpace,u.endRenderSpace,c,f),q(n,-f[1],f[0]);let l=!1;switch(o){case"top":l=n[1]<0;break;case"bottom":l=n[1]>0;break;case"left":l=n[0]>0;break;case"right":l=n[0]<0}if(l&&j(n,n),yt(n)===0)switch(o){case"top":n[1]=1;break;case"bottom":n[1]=-1;break;case"left":n[0]=-1;break;case"right":n[0]=1}return u.eval(qt[t.sampleLocation],et),c.projectToRenderScreen(et,d),!(d[2]<0||d[2]>1)&&(c.renderToScreen(d,r),z(n,n,i),b(n,n,d),c.renderToScreen(n,s),!0)}_updatePosition(t,i){if(i){const o=i[0]-t[0],r=i[1]-t[1];return this._textItem.position=[i[0],i[1]],this._textItem.anchor=Math.abs(o)>Math.abs(r)?o>0?"left":"right":r>0?"top":"bottom",this._calloutItem.startPosition=[t[0],t[1]],this._calloutItem.endPosition=[i[0],i[1]],!0}return this._textItem.position=[t[0],t[1]],this._textItem.anchor="center",!1}createResources(){var t;this._textItem=new Ht({visible:!0,text:this._text,fontSize:this._fontSize,backgroundColor:this._backgroundColor,textColor:this._textColor}),this._calloutItem=new Ft({color:this._calloutColor.toRgba(),visible:!0,width:2}),this.updateLabelPosition(),(t=this.view.overlay)==null||t.items.addMany([this._textItem,this._calloutItem]),this.updatePositionOnCameraMove&&this._handles.add(ft(()=>this.view.state.camera,()=>this.updateLabelPosition()))}destroyResources(){this.view.overlay&&!this.view.overlay.destroyed&&this.view.overlay.items.removeMany([this._textItem,this._calloutItem]),this._handles.removeAll()}updateVisibility(t){this._textItem.visible=this._showText&&t,this._calloutItem.visible=this._showCallout&&t}}function J(e,t,i,o){e.eval(t,M,Q),G(K,M,Q),i.projectToRenderScreen(M,ht),i.projectToRenderScreen(K,lt),ot(o,Vt,Ut),F(o,o)}function se(e){switch(e){case"top":return"bottom";case"right":return"left";case"bottom":return"top";case"left":return"right"}}const M=m(),K=m(),Q=m(),f=H(),tt=H(),n=H(),et=m(),d=$(),y=O(),g=O(),ht=$(),Ut=ht,lt=$(),Vt=lt,qt={start:0,center:.5,end:1};class ct{constructor(t=m(),i=m()){this.startRenderSpace=t,this.endRenderSpace=i,this.type="euclidean"}eval(t,i,o){return nt(i,this.startRenderSpace,this.endRenderSpace,t),o&&(C(o,this.endRenderSpace,this.startRenderSpace),L(o,o)),i}createRenderGeometry(t,i){const o=[],r=[],s=(c,l)=>{const _=B;C(_,c,t),o.push([_[0],_[1],_[2]]),r.push([l[0],l[1],l[2]])},u=i.worldUpAtPosition(this.eval(.5,v),gt.get());return s(this.startRenderSpace,u),s(this.endRenderSpace,u),{points:o,normals:r}}static fromPositionAndVector(t,i,o=1){return vt(v,i,o),G(v,t,v),new ct(D(t),D(v))}}class re{_projectIn(t,i){this._project?k(t,this.renderSpatialReference,i,this._pcpf):it(i,t)}constructor(t,i,o){this.startRenderSpace=t,this.endRenderSpace=i,this.renderSpatialReference=o,this.type="geodesic",this._start=m(),this._end=m(),this._pcpf=bt(o),this._project=St(o,this._pcpf),this._projectIn(t,this._start),this._projectIn(i,this._end)}eval(t,i,o){if(this._project)if(o){const r=B;wt(this._start,this._end,t,i,r),G(S,i,r),k(i,this._pcpf,i,this.renderSpatialReference),k(S,this._pcpf,S,this.renderSpatialReference),C(o,S,i),L(o,o)}else Ct(this._start,this._end,t,i),k(i,this._pcpf,i,this.renderSpatialReference);else nt(i,this._start,this._end,t),o&&(C(o,this._end,this._start),L(o,o));return i}createRenderGeometry(t,i){const o=[],r=[],s=(c,l)=>{const _=S;C(_,c,t),o.push([_[0],_[1],_[2]]),r.push([l[0],l[1],l[2]])};for(let c=0;c<128;++c){const l=c/127,_=v,R=B;this.eval(l,_),i.worldUpAtPosition(_,R),s(_,R)}return{points:o,normals:r}}}const v=m(),B=m(),S=m();export{se as C,Kt as L,te as R,Xt as a,Bt as b,Qt as d,Et as e,ct as f,oe as g,Jt as h,jt as i,Mt as l,re as m,At as r,ie as u,ee as y}; diff --git a/assets/ShadedColorMaterial.glsl-2686362a.js b/assets/ShadedColorMaterial.glsl-2686362a.js new file mode 100644 index 0000000..3c5f392 --- /dev/null +++ b/assets/ShadedColorMaterial.glsl-2686362a.js @@ -0,0 +1 @@ +import"./index-080e108a.js";import{p as m}from"./analysisViewUtils-68ab721d.js";import"./ImageMaterial-5c48df66.js";export{m as build}; diff --git a/assets/ShadowCastAccumulate.glsl-15b89038.js b/assets/ShadowCastAccumulate.glsl-15b89038.js new file mode 100644 index 0000000..cc88f17 --- /dev/null +++ b/assets/ShadowCastAccumulate.glsl-15b89038.js @@ -0,0 +1 @@ +import{X as e,Z as t,a0 as m}from"./index-080e108a.js";export{e as ShadowCastAccumulatePassParameters,t as ShadowCastMaxSamples,m as build}; diff --git a/assets/ShadowCastVisualize.glsl-2c61efe0.js b/assets/ShadowCastVisualize.glsl-2c61efe0.js new file mode 100644 index 0000000..02fcd79 --- /dev/null +++ b/assets/ShadowCastVisualize.glsl-2c61efe0.js @@ -0,0 +1 @@ +import{a6 as e,a7 as r}from"./index-080e108a.js";export{e as ShadowCastVisualizePassParameters,r as build}; diff --git a/assets/ShadowHighlight.glsl-56ab9734.js b/assets/ShadowHighlight.glsl-56ab9734.js new file mode 100644 index 0000000..a497352 --- /dev/null +++ b/assets/ShadowHighlight.glsl-56ab9734.js @@ -0,0 +1 @@ +import{a1 as r}from"./index-080e108a.js";export{r as build}; diff --git a/assets/SimpleAtmosphere.glsl-137a19b0.js b/assets/SimpleAtmosphere.glsl-137a19b0.js new file mode 100644 index 0000000..19a5cca --- /dev/null +++ b/assets/SimpleAtmosphere.glsl-137a19b0.js @@ -0,0 +1 @@ +import{b as a,g as r,c as t}from"./index-080e108a.js";export{a as SilhouetteCircle,r as SimpleAtmospherePassParameters,t as build}; diff --git a/assets/SliceAnalysisView3D-63c25320.js b/assets/SliceAnalysisView3D-63c25320.js new file mode 100644 index 0000000..432889b --- /dev/null +++ b/assets/SliceAnalysisView3D-63c25320.js @@ -0,0 +1,16 @@ +import{cz as Yt,ck as Qt,ja as Jt,ai as u,aj as d,c7 as ei,f4 as et,gL as tt,gM as it,al as ce,bh as y,cn as ti,lV as me,ia as ii,ib as ai,a_ as at,id as st,lJ as nt,ii as si,im as ni,aw as ri,is as li,it as oi,iu as ui,iv as hi,oK as ci,ip as pe,hL as di,iB as pi,mN as gi,i$ as be,iH as _i,n$ as wi,iJ as yi,iK as vi,hH as fi,hI as Pi,lO as mi,i_ as C,j0 as rt,g3 as bi,oQ as Ce,kC as $t,j7 as o,gu as w,fs as I,py as Dt,mF as A,dQ as B,dR as $,gv as v,n2 as M,j1 as x,pz as Ge,o3 as Ot,pe as k,pA as Vi,pB as Ue,pC as Mi,pD as Ti,h9 as St,dS as te,pE as Ke,j8 as Rt,mR as Q,pF as It,na as Ei,pf as At,j6 as he,o$ as F,dT as J,l9 as Ci,hQ as kt,kf as $i,pG as Di,lx as V,pH as Ne,dk as j,j2 as ge,ir as _e,oC as lt,pI as Ve,pJ as Oi,bz as xt,j3 as Si,p3 as ot,nZ as ut,fu as Re,fr as ht,pK as ct,pL as dt,pM as pt,pN as Ri,gU as Ii,ao as qe,af as Me,aA as gt,aG as R,pO as Ai,l$ as ki,kI as xi,hW as Li,aH as Hi,aM as ze,aq as _t,ah as W,pw as oe,pP as b,pQ as wt,n1 as Be,kH as fe,pR as Gi,pS as Ui,ft as yt,pT as Ni,hV as vt,kD as ft,kG as zi,kF as Bi,pU as Lt,pV as Ht,kK as Fi,lQ as ji}from"./index-080e108a.js";import{i as ie,u as Gt,b as Wi,c as Ki,r as qi,a as Zi,e as Xi}from"./LineVisualElement-b605d10c.js";import{g as ue}from"./persistable-ca976a2c.js";import{C as Yi}from"./BuildingComponentSublayer-5d49e5f9.js";import{N as Qi,$ as Ut,e as H,R as Ji,U as ea,a as ta,d as we,D as ia,b as aa,v as sa}from"./analysisViewUtils-68ab721d.js";import{n as na,l as ra,H as ye}from"./Factory-8e329f4b.js";let L=class extends Yt(Qt){constructor(t){super(t),this.type="plane",this.position=null,this.heading=0,this.tilt=0,this.width=10,this.height=10}equals(t){return this.heading===t.heading&&this.tilt===t.tilt&&Jt(this.position,t.position)&&this.width===t.width&&this.height===t.height}};u([d({readOnly:!0,json:{read:!1,write:!0}})],L.prototype,"type",void 0),u([d({type:ei}),ue()],L.prototype,"position",void 0),u([d({type:Number,nonNullable:!0,range:{min:0,max:360}}),ue(),et(e=>tt.normalize(it(e),0,!0))],L.prototype,"heading",void 0),u([d({type:Number,nonNullable:!0,range:{min:0,max:360}}),ue(),et(e=>tt.normalize(it(e),0,!0))],L.prototype,"tilt",void 0),u([d({type:Number,nonNullable:!0}),ue()],L.prototype,"width",void 0),u([d({type:Number,nonNullable:!0}),ue()],L.prototype,"height",void 0),L=u([ce("esri.analysis.SlicePlane")],L);const Ze=L;let la=class{constructor(){this.color=ie()}},oa=class{constructor(){this.color=new y([0,0,0,.04]),this.gridColor=ie(.5),this.outlineColor=ie(.7)}},ua=class{constructor(){this.color=ie()}},ha=class{constructor(){this.color=ie(.5),this.contrastColor=Gt()}},ca=class{constructor(){this.color=Gt(),this.outlineColor=ie()}},da=class{constructor(){this.callouts=new la,this.plane=new oa,this.resizeManipulators=new ua,this.rotateManipulators=new ha,this.shiftManipulator=new ca}},P=new da;const Ie=ti("mac")?"Meta":"Control",Ae="Shift",pa=2,ga=1.15,_a=1.15,wa=2500,ya=.02,va=Math.cos(me(45)),Pt=Math.cos(me(5)),fa=.95,Pa=.3,Nt=2,zt=1,ma=3,Bt=11,Fe=22.5,Pe=40,mt=48,ba=2.25,Va=4,bt=1,Ma=.3,Ta=6,Ea=4,Vt=1600,Ca=.4;function $a(e){const t=new ii,{vertex:i,fragment:a,attributes:s,varyings:n}=t;return ai(i,e),s.add(at.POSITION,"vec3"),s.add(at.UV0,"vec2"),n.add("vUV","vec2"),i.code.add(st`void main(void) { +vUV = uv0; +gl_Position = proj * view * vec4(position, 1.0); +}`),a.uniforms.add(new nt("backgroundColor",r=>r.backgroundColor),new nt("gridColor",r=>r.gridColor),new si("gridWidth",r=>r.gridWidth)),a.code.add(st`void main() { +const float LINE_WIDTH = 1.0; +vec2 uvScaled = vUV * gridWidth; +vec2 gridUV = (fract(uvScaled + 0.5) - 0.5) / (LINE_WIDTH * fwidth(uvScaled)); +vec2 grid = (1.0 - step(0.5, gridUV)) * step(-0.5, gridUV); +grid.x *= step(0.5, uvScaled.x) * step(uvScaled.x, gridWidth - 0.5); +grid.y *= step(0.5, uvScaled.y) * step(uvScaled.y, gridWidth - 0.5); +float gridFade = max(grid.x, grid.y); +float gridAlpha = gridColor.a * gridFade; +fragColor = +vec4(backgroundColor.rgb * backgroundColor.a, backgroundColor.a) * (1.0 - gridAlpha) + +vec4(gridColor.rgb, 1.0) * gridAlpha; +}`),t}const Da=Object.freeze(Object.defineProperty({__proto__:null,build:$a},Symbol.toStringTag,{value:"Module"}));let Oa=class extends gi{constructor(){super(...arguments),this.backgroundColor=be(1,0,0,.5),this.gridColor=be(0,1,0,.5),this.gridWidth=4}};class $e extends li{initializeProgram(t){return new oi(t.rctx,$e.shader.get().build(this.configuration),ui)}initializePipeline(){return hi({blending:ci(pe.ONE,pe.ONE,pe.ONE_MINUS_SRC_ALPHA,pe.ONE_MINUS_SRC_ALPHA),depthTest:{func:di.LESS},colorWrite:pi})}}$e.shader=new ni(Da,()=>ri(()=>import("./SlicePlaneMaterial.glsl-99e82c24.js"),["assets/SlicePlaneMaterial.glsl-99e82c24.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/LineVisualElement-b605d10c.js","assets/persistable-ca976a2c.js","assets/multiOriginJSONSupportUtils-c978f4c3.js","assets/resourceExtension-91e7c3ce.js","assets/BuildingComponentSublayer-5d49e5f9.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/AttachmentQuery-972bbd60.js","assets/Query-1c961d4c.js","assets/RelationshipQuery-39c07195.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/TopFeaturesQuery-e44d05be.js","assets/popupUtils-82ea8abb.js","assets/capabilities-5d185925.js","assets/I3SIndexInfo-445e6968.js","assets/I3SLayerDefinitions-ffdb3821.js","assets/I3SUtil-2c288808.js","assets/I3SBinaryReader-2b8e30f7.js","assets/popupUtils-f04ec9a9.js","assets/analysisViewUtils-68ab721d.js","assets/ImageMaterial-5c48df66.js","assets/Factory-8e329f4b.js"]));class Sa extends _i{constructor(t){super(t,new Ia),this._configuration=new wi}createBufferWriter(){return new yi(vi)}requiresSlot(t,i){return i===fi.Color&&t===Pi.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL}createGLMaterial(t){return new Ra(t)}getConfiguration(){return this._configuration}}let Ra=class extends mi{constructor(t){super(t),this.ensureTechnique($e,null)}beginSlot(){return this.technique}},Ia=class extends Oa{constructor(){super(...arguments),this.renderOccluded=C.Occlude}},Aa=class extends Wi{constructor(t){super(t),this._material=null,this._renderOccluded=C.OccludeAndTransparent,this._gridWidth=1,this._gridColor=be(1,0,0,1),this._backgroundColor=be(1,0,0,1),this.applyProps(t)}get renderOccluded(){return this._renderOccluded}set renderOccluded(t){t!==this._renderOccluded&&(this._renderOccluded=t,this._updateMaterial())}get gridWidth(){return this._gridWidth}set gridWidth(t){this._gridWidth!==t&&(this._gridWidth=t,this._updateMaterial())}get gridColor(){return this._gridColor}set gridColor(t){rt(this._gridColor,t),this._updateMaterial()}get backgroundColor(){return this._backgroundColor}set backgroundColor(t){rt(this._backgroundColor,t),this._updateMaterial()}createExternalResources(){this._material=new Sa(this._materialParameters)}destroyExternalResources(){this._material=null}forEachExternalMaterial(t){this._material!=null&&t(this._material)}createGeometries(t){if(this._material!=null){const i=bi(this._material);t.addGeometry(i)}}get _materialParameters(){return{backgroundColor:this._backgroundColor,gridWidth:this._gridWidth,gridColor:this._gridColor,renderOccluded:this._renderOccluded}}_updateMaterial(){this._material!=null&&this._material.setParameters(this._materialParameters)}};function ka(e,t,i,a,s,n,r,l){return xa(t,r.worldUpAtPosition(e,o.get()),s,n,l.basis1,l.basis2),w(l.basis1,l.basis1,i),w(l.basis2,l.basis2,a),I(l.origin,e),Dt(l.basis2,l.basis1,l.origin,l.plane),l}function xa(e,t,i,a,s,n){const r=A(e,t),l=o.get(),h=o.get();switch(a===E.HORIZONTAL_OR_VERTICAL?Math.abs(r)>va?E.HORIZONTAL:E.VERTICAL:a){case E.VERTICAL:{const g=Math.abs(r)<=Pt?e:i.viewUp;B(l,g,t),I(h,t);break}case E.HORIZONTAL:B(l,i.viewUp,t),B(h,t,l);break;case E.TILTED:{const g=Math.abs(r)<=Pt?t:i.viewUp;B(l,g,e),B(h,e,l);break}}const _=B(o.get(),l,h);A(_,i.viewForward)>0&&w(h,h,-1),$(s,l),$(n,h)}function La(e,t,i){const a=t.worldUpAtPosition(e.origin,o.get()),s=e.basis1,n=Qe(e,a),r=Math.round(n/se)*se;return Ne(e,r-n,s,i)}function Ha(e,t,i,a,s,n){const r=I(o.get(),s.origin);v(r,r,w(o.get(),s.basis1,e.direction[0]<0?1:-1)),v(r,r,w(o.get(),s.basis2,e.direction[1]<0?1:-1));const l=M(s.basis1),h=M(s.basis2),_=x(o.get(),i,r),g=x(o.get(),t,r);let p=0,c=0;if(Ye(e)){const O=je(s),De=je(n);p=l-.5*e.direction[0]*A(s.basis1,g)/l,c=h-.5*e.direction[1]*A(s.basis2,g)/h;const ne=De/O;p*=ne,c*=ne}const D=p+.5*e.direction[0]*A(s.basis1,_)/l,T=c+.5*e.direction[1]*A(s.basis2,_)/h,K=w(o.get(),s.basis1,D/l),U=w(o.get(),s.basis2,T/h);(D<=0||Tt(n.origin,K,a)<=Vt)&&I(K,n.basis1),(T<=0||Tt(n.origin,U,a)<=Vt)&&I(U,n.basis2);const N=I(o.get(),r);return v(N,N,w(o.get(),K,e.direction[0]<0?-1:1)),v(N,N,w(o.get(),U,e.direction[1]<0?-1:1)),Ge(N,K,U,n)}function Ga(e,t){return Ca*Math.min(t.width,t.height)*t.computeRenderPixelSizeAt(e)}function Ua(e,t,i,a){const s=B(o.get(),t,i);return B(s,s,t),Ot(e,s,a)}function Ft(e,t){return Qi(e.basis1,e.basis2,e.origin,t)}function Mt(e,t,i,a){const s=t.worldUpAtPosition(e.origin,o.get()),n=o.get();switch(i){case ae.HEADING:I(n,s);break;case ae.TILT:I(n,e.basis1)}return Ot(e.origin,n,a)}function Na(e,t,i,a){const s=Xe(i,G.NEGATIVE_X),n=k.get();Vi(n,t,s.edge*Math.PI/2);const r=$(o.get(),s.basis);let l=w(o.get(),r,s.direction*a.computeScreenPixelSizeAt(s.position)*Pe);v(l,l,s.position);const h=a.projectToRenderScreen(l,Ue(o.get())),_=za(a,h);Mi(a,h,ve),$(ve.direction,ve.direction);const g=o.get();!_&&Ti(i,ve,g)&&(l=g),n[12]=0,n[13]=0,n[14]=0,e.modelTransform=n,e.renderLocation=St(l),_?e.state|=Te:e.state&=~Te}function za(e,t){const[i,a,s,n]=e.viewport,r=Math.min(s,n)/16;let l=!0;return t[0]i+s-r&&(t[0]=i+s-r,l=!1),t[1]a+n-r&&(t[1]=a+n-r,l=!1),l}function Ba(e,t,i,a){const s=M(a.basis1),n=M(a.basis2),r=jt(a),l=je(a),h=te(o.get(),0,0,0);v(h,w(o.get(),a.basis1,t.direction[0]),w(o.get(),a.basis2,t.direction[1])),v(h,a.origin,h);let _=0,g=1;if(Ye(t))t.direction[0]===1&&t.direction[1]===-1?_=se:t.direction[0]===1&&t.direction[1]===1?_=Math.PI:t.direction[0]===-1&&t.direction[1]===1&&(_=3*Math.PI/2),g=l;else{const c=t.direction[0]!==0?1:2;_=c===1?se:0,g=(c===1?n:s)-r}const p=Ke(k.get(),_);Rt(p,p,te(o.get(),g,g,g)),Q(p,i,p),p[12]=0,p[13]=0,p[14]=0,e.modelTransform=p,e.renderLocation=h}function Fa(e,t,i,a){const s=a.worldUpAtPosition(i.origin,o.get()),n=Xe(i,G.POSITIVE_X),r=Ke(k.get(),n.edge*Math.PI/2);It(r,r,-Qe(i,s)),Q(r,t,r),r[12]=0,r[13]=0,r[14]=0,e.modelTransform=r,e.renderLocation=n.position}function ja(e,t,i){const a=Xe(i,G.POSITIVE_Y),s=Ke(k.get(),a.edge*Math.PI/2);It(s,s,se),Q(s,t,s),s[12]=0,s[13]=0,s[14]=0,e.modelTransform=s,e.renderLocation=a.position}var G;function Xe(e,t){switch(t){case G.POSITIVE_X:return{basis:e.basis1,direction:1,position:v(o.get(),e.origin,e.basis1),edge:t};case G.POSITIVE_Y:return{basis:e.basis2,direction:1,position:v(o.get(),e.origin,e.basis2),edge:t};case G.NEGATIVE_X:return{basis:e.basis1,direction:-1,position:x(o.get(),e.origin,e.basis1),edge:t};case G.NEGATIVE_Y:return{basis:e.basis2,direction:-1,position:x(o.get(),e.origin,e.basis2),edge:t}}}function Tt(e,t,i){const a=i.projectToRenderScreen(v(o.get(),e,t),Ue(o.get())),s=i.projectToRenderScreen(x(o.get(),e,t),Ue(o.get()));return Ei(x(a,a,s))}function jt(e){const t=M(e.basis1),i=M(e.basis2);return Ma*Math.min(t,i)}function je(e){return jt(e)}function Ye(e){return e.direction[0]!==0&&e.direction[1]!==0}function Wa(e,t){const i=t.offsetMode===Ee.CENTER_ON_CALLOUT?Pe:0,a=[j(i,0,-mt/2),j(i,0,mt/2)],s=Xa(a,!0),n=(p,c)=>qa(a,p,c,t),r=n(0,!1),l=n(ba,!0),h=new At({color:y.toUnitRGBA(t.calloutColor),renderOccluded:C.OccludeAndTransparent}),_=he(h,[[i,0,0],[i-Pe,0,0]]),g=he(h,[[i,0,0],[i-Pe,0,0]]);return new Ut({view:e,renderObjects:[...r.normal.map(p=>new H(p,F.Unfocused|m)),...l.normal.map(p=>new H(p,F.Unfocused|m)),new H(_,F.Unfocused|m|Te),...r.focused.map(p=>new H(p,F.Focused|m)),...l.focused.map(p=>new H(p,F.Focused|m)),new H(g,F.Focused|m|Te)],autoScaleRenderObjects:!1,collisionType:{type:"line",paths:[s]},collisionPriority:1,radius:Bt,state:m})}function Et(e,t){const i=Ji(e,{calloutColor:y.toUnitRGBA(P.callouts.color),customStateMask:m,texture:t});return i.state=m,i}function Wt(e){const t=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0],[-1,-1,0]];return new Ki({view:e,attached:!1,color:y.toUnitRGBA(P.plane.outlineColor),width:zt,renderOccluded:C.OccludeAndTransparent,geometry:[t]})}function Kt(e){return new Aa({view:e,attached:!1,backgroundColor:y.toUnitRGBA(P.plane.color),gridColor:y.toUnitRGBA(P.plane.gridColor),gridWidth:4,renderOccluded:C.OccludeAndTransparent})}function Ka(e,t,i){const a=Ye(t),s=a?[j(1,0,0),j(0,0,0),j(0,1,0)]:[j(1,0,0),j(-1,0,0)],n=y.toUnitRGBA(i.color),r=T=>new Si({color:n,width:T,renderOccluded:C.OccludeAndTransparent}),l=()=>new At({color:n,renderOccluded:C.OccludeAndTransparent}),h=a?Va:bt,_=h*pa,g=bt,p=T=>T>1?r(T):l(),c=[new H(he(p(h),s),F.Unfocused|ke),new H(he(p(_),s),F.Focused|ke),new H(he(p(g),s),es)],D=new Ut({view:e,renderObjects:c,collisionType:{type:"line",paths:[s]},radius:a?Ta:Ea,...ea});return D.state=ke,D}function qa(e,t,i,a){const s=y.blendColors(a.color,a.outlineColor,.4),n=y.blendColors(a.color,a.outlineColor,.14),r=new ge({color:y.toUnitRGBA(a.color),cullFace:_e.Back,renderOccluded:C.Opaque}),l=new ge({color:y.toUnitRGBA(s),cullFace:_e.Back,renderOccluded:C.Opaque}),h=new ge({color:y.toUnitRGBA(n),cullFace:_e.Back,renderOccluded:C.Opaque}),_=new ge({color:y.toUnitRGBA(a.outlineColor),transparent:!0,writeDepth:!1,cullFace:_e.Front,renderOccluded:C.Transparent}),g=p=>{const c=e.slice(0),D=x(o.get(),c[0],c[1]);$(D,D);const T=x(o.get(),c[c.length-1],c[c.length-2]);if($(T,T),t>0){const le=w(J(),T,-t);c[c.length-1]=v(le,le,c[c.length-1]);const ee=w(J(),D,-t);c[0]=v(ee,ee,c[0])}const K=p?_a:1,U=Fe*K,N=Bt*K,O=ot(k.get());if(t>0){const le=U/4,ee=te(o.get(),0,le,0),de=1+t/le;ut(O,O,ee),Rt(O,O,te(o.get(),de,de,de)),ut(O,O,w(ee,ee,-1/de))}const De=ot(Re()),ne=j(0,1,0),q=ht(Re(),ct(dt.get(),ne,T));q[12]=c[c.length-1][0],q[13]=c[c.length-1][1],q[14]=c[c.length-1][2],Q(q,q,O);const Je=Za(ma*(p?ga:1)+t,c,i?_:h);Je.transformation=De;const re=[Je],Oe=pt(i?_:r,U,N,24,!1,!1,!0);Oe.transformation=q,re.push(Oe);const Se=pt(i?_:l,U,N,24,!1,!0,!1);Se.transformation=q,re.push(Se);const Z=ht(Re(),ct(dt.get(),ne,D));return Z[12]=c[0][0],Z[13]=c[0][1],Z[14]=c[0][2],Q(Z,Z,O),re.push(Oe.instantiate({transformation:Z})),re.push(Se.instantiate({transformation:Z})),re};return{normal:g(!1),focused:g(!0)}}function Za(e,t,i){const a=[];for(let n=0;n<12;n++){const r=n/12*2*Math.PI;a.push([Math.cos(r)*e,Math.sin(r)*e])}return Ri(i,a,t,[],[],!1)}function Xa(e,t){const i=x(J(),e[e.length-1],e[e.length-2]);if($(i,i),w(i,i,Fe),v(i,i,e[e.length-1]),t){const a=x(J(),e[0],e[1]);return $(a,a),w(a,a,Fe),v(a,a,e[0]),[a,...e,i]}return[...e,i]}function qt(e,t,i,a=new Ze){if(e==null)return null;const{renderCoordsHelper:s}=t,n=s.fromRenderCoords(e.origin,t.spatialReference);if(n==null)return null;const r=Ci(n,i);if(r==null)return null;a.position=r;const l=2*M(e.basis1),h=2*M(e.basis2),_=kt.renderUnitScaleFactor(t.spatialReference,i);a.width=l*_,a.height=h*_;const g=s.worldUpAtPosition(e.origin,o.get());return a.tilt=$i(Qe(e,g)),a.heading=s.headingAtPosition(e.origin,e.basis1)-90,a}function Qe(e,t){return Di(t,e.basis2,e.basis1)+se}function Ya(e,t,i,a,s,n,r=V()){return n.toRenderCoords(e,r.origin)?(n.worldBasisAtPosition(r.origin,lt.X,r.basis1),n.worldBasisAtPosition(r.origin,lt.Y,r.basis2),Dt(r.basis2,r.basis1,r.origin,r.plane),Ne(r,-me(t),Ve(r),r),Ne(r,me(i),r.basis1,r),w(r.basis1,r.basis1,a/2),w(r.basis2,r.basis2,s/2),Oi(r),r):(xt.getLogger("esri.views.3d.analysis.Slice.sliceToolUtils").error(`Failed to project slice plane position, projection from ${e.spatialReference.wkid} is not supported`),null)}function Qa(e,t){if(e==null||e.position==null)return null;const i=qi(e.position,t.spatialReference,t.elevationProvider);if(i==null)return null;const a=kt.renderUnitScaleFactor(e.position.spatialReference,t.spatialReference),s=e.width*a,n=e.height*a;return{position:i,heading:e.heading,tilt:e.tilt,renderWidth:s,renderHeight:n}}function Ja(e,t,i,a=V()){if(e==null)return null;const s=Ya(e.position,e.heading,e.tilt,e.renderWidth,e.renderHeight,t.renderCoordsHelper,a);return i.tiltEnabled||s==null||La(s,t.renderCoordsHelper,s),s}(function(e){e[e.POSITIVE_X=0]="POSITIVE_X",e[e.POSITIVE_Y=1]="POSITIVE_Y",e[e.NEGATIVE_X=2]="NEGATIVE_X",e[e.NEGATIVE_Y=3]="NEGATIVE_Y"})(G||(G={}));const m=Ce.Custom1;var ae,E;(function(e){e[e.HEADING=1]="HEADING",e[e.TILT=2]="TILT"})(ae||(ae={})),function(e){e[e.HORIZONTAL_OR_VERTICAL=0]="HORIZONTAL_OR_VERTICAL",e[e.HORIZONTAL=1]="HORIZONTAL",e[e.VERTICAL=2]="VERTICAL",e[e.TILTED=3]="TILTED"}(E||(E={}));const Te=Ce.Custom2,ve=$t(),se=Math.PI/2,ke=Ce.Custom1,es=Ce.Custom2;var Ee;function ts(e){return(e.type==="building-scene-3d"?e:null)!=null}(function(e){e[e.CENTER_ON_CALLOUT=0]="CENTER_ON_CALLOUT",e[e.CENTER_ON_ARROW=1]="CENTER_ON_ARROW"})(Ee||(Ee={}));function is(e){switch(e.type){case"building-scene":case"csv":case"dimension":case"feature":case"geo-rss":case"geojson":case"graphics":case"group":case"integrated-mesh":case"kml":case"knowledge-graph":case"link-chart":case"knowledge-graph-sublayer":case"line-of-sight":case"map-notes":case"ogc-feature":case"oriented-imagery":case"point-cloud":case"route":case"scene":case"stream":case"voxel":case"subtype-group":case"unknown":case"unsupported":case"wfs":case null:return!1;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"elevation":case"imagery":case"imagery-tile":case"map-image":case"media":case"open-street-map":case"tile":case"vector-tile":case"video":case"wcs":case"web-tile":case"wms":case"wmts":return!0;default:return Ii(e.type),!1}}const Zt="esri.views.3d.analysis.Slice.SliceController",xe=xt.getLogger(Zt);let X=class extends qe{constructor(e){super(e),this._handles=new Me,this._internalChange=!1,this._currentSlicePlane=null}initialize(){this._handles.add(this.analysis.excludedLayers.on("before-add",e=>{const t=e.item;t!=null&&(t instanceof gt||t instanceof Yi)?t instanceof gt&&is(t)?(xe.error("excludedLayers",`Layer '${t.title}, id:${t.id}' of type '${t.type}' can not be individually excluded from slicing. Use 'excludeGroundSurface' instead.`),e.preventDefault()):this.analysis.excludedLayers.includes(t)&&e.preventDefault():(xe.error("excludedLayers","Invalid layer type, layer must derive from Layer or BuildingComponentSublayer"),e.preventDefault())})),ss(this.view,this),this._handles.add([R(()=>this.analysisViewData.plane,()=>{this._internalChange||this._updateSlicePlaneFromBoundedPlane(),this._updateLayerViews()},{sync:!0}),R(()=>this.analysis.excludeGroundSurface,()=>this._updateLayerViews(),{sync:!0}),this.analysis.excludedLayers.on("change",()=>this._updateLayerViews()),R(()=>[this.analysisViewData.active,this.analysisViewData.visible],()=>{this._updateActiveController(),this._updateViewSlicePlane()},{sync:!0}),R(()=>this._allLayerAndSubLayerViews,()=>this._updateLayerViews())]),this._handles.add([R(()=>this.analysis.shape,()=>{this._internalChange||(this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane())},{sync:!0})],"analysis"),this._updateActiveController(),this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane()}destroy(){this.analysisViewData.active&&(this.analysisViewData.active=!1,this.view.slicePlane=null),ns(this.view,this),this._handles.destroy(),this.set("view",null)}get _allLayerAndSubLayerViews(){const e=this.view.allLayerViews.items;return e.concat(e.filter(ts).flatMap(({sublayerViews:t})=>t.items))}_updateBoundedPlaneFromSlicePlane(){const e=this.analysis.shape,t=this._currentSlicePlane;if(t==null&&e==null||t!=null&&e!=null&&e.equals(t))return;let i=null,a=null;if(e!=null&&e.position!=null){const s=e.position.spatialReference,n=Qa(e,this.view);n==null&&Zi(this.analysis,s,xe),i=Ja(n,this.view,{tiltEnabled:this.analysis.tiltEnabled},V()),i!=null&&(a={heading:e.heading,tilt:e.tilt,position:e.position,width:e.width,height:e.height})}this._currentSlicePlane=a,this._internalChange=!0,this.analysisViewData.plane=i,this._internalChange=!1}_updateSlicePlaneFromBoundedPlane(){const e=this.analysisViewData.plane,t=qt(e,this.view,this.view.spatialReference,new Ze);let i=null;t!=null&&(i={heading:t.heading,tilt:t.tilt,position:t.position,width:t.width,height:t.height}),this._currentSlicePlane=i,this._internalChange=!0,this.analysis.shape=t,this._internalChange=!1,this._updateViewSlicePlane()}_updateActiveController(){if(Le)return;const e=Xt(this.view);if(e)if(this.analysisViewData.active)e.activeController!=null&&e.activeController!==this?(Le=!0,e.activeController.analysisViewData.active=!1,Le=!1):e.activeController!=null&&e.activeController,this._updateLayerViews(),e.activeController=this;else{if(e.activeController!=null&&e.activeController!==this)return;e.activeController!=null&&e.activeController===this&&(e.activeController=null,this._updateLayerViews())}}_updateViewSlicePlane(){as(this.view)}_updateLayerViews(){const e=this.analysisViewData.plane!=null&&this.analysisViewData.visible&&this.analysisViewData.active,t=[],i=a=>{"layers"in a?a.layers.forEach(i):t.push(a)};this.analysis.excludedLayers.forEach(i),this.view.allLayerViews.forEach(a=>{a.destroyed||("slicePlaneEnabled"in a&&(a.slicePlaneEnabled=e&&!t.includes(a.layer)),"sublayerViews"in a&&a.sublayerViews.forEach(s=>{s.slicePlaneEnabled=e&&!t.includes(s.sublayer)}))}),this.view.basemapTerrain!=null&&(this.view.basemapTerrain.slicePlaneEnabled=e&&!this.analysis.excludeGroundSurface)}};u([d()],X.prototype,"view",void 0),u([d()],X.prototype,"analysis",void 0),u([d()],X.prototype,"analysisViewData",void 0),u([d()],X.prototype,"_allLayerAndSubLayerViews",null),X=u([ce(Zt)],X);const Y=new Map;let Le=!1;function as(e){const t=Xt(e),i=t==null?void 0:t.activeController;i!=null&&i.analysisViewData.plane!=null&&i.analysisViewData.visible?e.slicePlane=i.analysisViewData.plane:e.slicePlane=null}function ss(e,t){var i;Y.has(e)||Y.set(e,{all:[],activeController:null}),(i=Y.get(e))==null||i.all.push(t)}function Xt(e){return Y.get(e)}function ns(e,t){if(!Y.has(e))throw new Error("view expected in global slice register");const i=Y.get(e),a=(i==null?void 0:i.all.lastIndexOf(t))??-1;if(!i||a===-1)throw new Error("controller expected in global slice register");i.all.splice(a,1),i.all.length===0&&Y.delete(e)}var We;let f=We=class extends ta{constructor(e){super(e),this._clock=Ai,this._previewPlaneOpacity=1,this.removeIncompleteOnCancel=!1,this.layersMode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._handles=new Me,this._viewHandles=new Me,this._frameTask=null,this._pointerMoveTimerMs=wa,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=V(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=ki(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=xi(e.view.state.viewingMode),this._intersector.options.store=Li.MIN}initialize(){var s;if(this.analysis==null)throw new Error("SliceTool requires valid analysis, but null was provided.");const e=!((s=this.view._stage)!=null&&s.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result),t={accentColor:P.rotateManipulators.color,contrastColor:P.rotateManipulators.contrastColor,preMultiplyAlpha:e};this._rotateHeadingImage=na(this.view.toolViewManager.textures,t),this._rotateTiltImage=ra(this.view.toolViewManager.textures,t);const i=n=>{this._updateManipulatorsInteractive(n),n.grabbing||(this.analysisViewData.plane!=null&&b(this.analysisViewData.plane,this._startPlane),this.inputState=null)};this.shiftManipulator=Wa(this.view,{offsetMode:Ee.CENTER_ON_ARROW,calloutColor:P.callouts.color,color:P.shiftManipulator.color,outlineColor:P.shiftManipulator.outlineColor}),this.manipulators.add(this.shiftManipulator),this.shiftManipulator.events.on("grab-changed",n=>{this._onShiftGrab(n),i(this.shiftManipulator)}),this._handles.add(this._createShiftDragPipeline(this.shiftManipulator)),this.rotateHeadingManipulator=Et(this.view,this._rotateHeadingImage.texture),this.manipulators.add(this.rotateHeadingManipulator),this.rotateHeadingManipulator.events.on("grab-changed",n=>{this._onRotateHeadingGrab(n),i(this.rotateHeadingManipulator)}),this._handles.add(this._createRotateHeadingDragPipeline(this.rotateHeadingManipulator)),this.rotateTiltManipulator=Et(this.view,this._rotateTiltImage.texture),this.manipulators.add(this.rotateTiltManipulator),this.rotateTiltManipulator.events.on("grab-changed",n=>{this._onRotateTiltGrab(n),i(this.rotateTiltManipulator)}),this._handles.add(this._createRotateTiltDragPipeline(this.rotateTiltManipulator)),this.resizeManipulators=this._resizeHandles.map((n,r)=>{const l=Ka(this.view,n,{color:P.resizeManipulators.color});return l.events.on("grab-changed",h=>{this._onResizeGrab(h,r),i(l)}),this._handles.add(this._createResizeDragPipeline(l)),l}),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=Kt(this.view),this._previewPlaneOutlineVisualElement=Wt(this.view),this._previewPlaneOutlineVisualElement.width=Nt,this._handles.add(R(()=>[this.analysisViewData.plane,this.analysis.tiltEnabled],()=>this._updateManipulators(),Hi));const a=R(()=>this.state,n=>{n==="sliced"&&this.finishToolCreation()},ze);this._handles.add([a,R(()=>this.view.state.camera,()=>this._onCameraChange())])}destroy(){this._rotateHeadingImage=_t(this._rotateHeadingImage),this._rotateTiltImage=_t(this._rotateTiltImage),this._handles=W(this._handles),this._viewHandles=W(this._viewHandles),this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=W(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=W(this._previewPlaneGridVisualElement)}get state(){const e=!!this.analysisViewData.plane,t=!!this.inputState;return e?e&&t?"slicing":e&&!t?"sliced":"ready":"ready"}get cursor(){return this._isPlacingSlicePlane||this.layersMode==="exclude"?"crosshair":this._creatingPointerId!=null?"grabbing":null}set analysis(e){if(e==null)throw new Error("SliceTool requires valid analysis, but null was provided.");this._handles.remove("analysis"),this._set("analysis",e)}get inputState(){return this._get("inputState")}set inputState(e){this._set("inputState",e),this.analysisViewData.showGrid=e!=null&&e.type==="resize",this._updateMaterials()}get _isPlacingSlicePlane(){return!this.inputState&&!this.analysisViewData.plane&&this.active}get _creatingPointerId(){return this.inputState!=null&&this.inputState.type==="shift"?this.inputState.creatingPointerId:null}enterExcludeLayerMode(){this.analysisViewData.plane!=null&&(this._set("layersMode","exclude"),this.active||(this.view.activeTool=this))}exitExcludeLayerMode(){this.analysisViewData.plane!=null&&(this._set("layersMode","none"),this.active&&(this.view.activeTool=null))}onDeactivate(){this._set("layersMode","none"),this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(e){this._updateManipulators(),e||this._clearPointerMoveTimeout()}onInputEvent(e){switch(e.type){case"pointer-drag":if(!He(e))return;this._isPlacingSlicePlane?this._onClickPlacePlane(e)&&e.stopPropagation():this._onPointerDrag(e)&&e.stopPropagation();break;case"pointer-move":this._onPointerMove(e);break;case"pointer-up":this._onPointerUp(e)&&e.stopPropagation();break;case"immediate-click":if(!He(e))return;this._onClickPlacePlane(e)&&e.stopPropagation();break;case"click":if(!He(e))return;this._onClickExcludeLayer(e)&&e.stopPropagation();break;case"drag":this.inputState&&e.stopPropagation();break;case"key-down":this._onKeyDown(e)&&e.stopPropagation();break;case"key-up":this._onKeyUp(e)&&e.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerDrag(e){const t=this.inputState;if(e.pointerId===this._creatingPointerId&&t!=null&&t.type==="shift"){const i=oe(e);return this.shiftManipulator.events.emit("drag",{action:t.hasBeenDragged?"update":"start",pointerType:e.pointerType,start:i,screenPoint:i}),t.hasBeenDragged=!0,!0}return!1}_onPointerMove(e){this._lastCursorPosition.x=e.x,this._lastCursorPosition.y=e.y,this._resetPointerMoveTimeout(),e.pointerType!=="touch"&&this._updatePreviewPlane(oe(e),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(e){if(e.pointerId===this._creatingPointerId&&this.analysisViewData.plane!=null){const t=oe(e);return this.shiftManipulator.events.emit("drag",{action:"end",start:t,screenPoint:t}),b(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(e){if(this.layersMode==="exclude")return!1;if(this._isPlacingSlicePlane){const t=oe(e),i=V();if(this._pickPlane(t,!1,this._activeKeyModifiers,i)){if(e.type==="pointer-drag"){const a=this._calculatePickRay(t);this.inputState=Ct(a,e.pointerId,i.origin,i)}return b(i,this._startPlane),this.analysis.shape=qt(i,this.view,this.view.spatialReference,new Ze),!0}}return!1}_onClickExcludeLayer(e){return!(this.layersMode!=="exclude"||!this.created)&&(this.view.hitTest(oe(e)).then(t=>{if(t.results.length){const i=t.results[0],a=(i==null?void 0:i.type)==="graphic"&&i.graphic;if(a){const s=a.sourceLayer||a.layer;s&&this.analysis.excludedLayers.push(s)}}else t.ground.layer?this.analysis.excludedLayers.push(t.ground.layer):this.analysis.excludeGroundSurface=!0}),this._set("layersMode","none"),this.active&&(this.view.activeTool=null),!0)}_onKeyDown(e){return(e.key===Ae||e.key===Ie)&&(this._activeKeyModifiers[e.key]=!0,this._previewPlane!=null&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(e){return!(e.key!==Ae&&e.key!==Ie||!this._activeKeyModifiers[e.key])&&(delete this._activeKeyModifiers[e.key],this._previewPlane!=null&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(e){if(e.action!=="start"||this.analysisViewData.plane==null||!e.screenPoint)return;const t=this._calculatePickRay(e.screenPoint);b(this.analysisViewData.plane,this._startPlane),this.inputState=Ct(t,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(e){return we(e,(t,i,a)=>{const s=this.inputState;if(s==null||s.type!=="shift")return;const n=this.analysisViewData.plane!=null?b(this.analysisViewData.plane,V()):null;i.next(ye(this.view,s.shiftPlane)).next(this._shiftDragAdjustSensitivity(s)).next(this._shiftDragUpdatePlane(s)),a.next(()=>{n!=null&&this._updateBoundedPlane(n)})})}_shiftDragAdjustSensitivity(e){return t=>{if(this.analysisViewData.plane==null)return null;const i=.001,a=Math.min((1-Math.abs(A(Ve(this.analysisViewData.plane),t.ray.direction)/M(t.ray.direction)))/i,1),s=-wt(this._startPlane.plane,t.renderEnd),n=-wt(this._startPlane.plane,e.startPoint);return e.depth=e.depth*(1-a)+s*a-n,t}}_shiftDragUpdatePlane(e){return()=>{if(this.analysisViewData.plane==null)return;const t=I(o.get(),this._startPlane.origin),i=I(o.get(),Ve(this._startPlane));w(i,i,-e.depth),v(i,i,t);const a=Ge(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,V());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(e){if(e.action!=="start"||this.analysisViewData.plane==null||!e.screenPoint)return;const t=Mt(this.analysisViewData.plane,this.view.renderCoordsHelper,ae.HEADING,Be()),i=this._calculatePickRay(e.screenPoint),a=J();fe(t,i,a)&&(b(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:t,startPoint:a})}_createRotateHeadingDragPipeline(e){return we(e,(t,i,a)=>{const s=this.inputState;if(s==null||s.type!=="rotate")return;const n=this.analysisViewData.plane!=null?b(this.analysisViewData.plane,V()):null;i.next(ye(this.view,s.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(s)).next(this._rotateDragUpdatePlaneFromRotate()),a.next(()=>{n!=null&&this._updateBoundedPlane(n)})})}_onRotateTiltGrab(e){if(e.action!=="start"||this.analysisViewData.plane==null||!e.screenPoint)return;const t=Mt(this.analysisViewData.plane,this.view.renderCoordsHelper,ae.TILT,Be()),i=this._calculatePickRay(e.screenPoint),a=J();fe(t,i,a)&&(b(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:t,startPoint:a})}_createRotateTiltDragPipeline(e){return we(e,(t,i,a)=>{const s=this.inputState;if(s==null||s.type!=="rotate")return;const n=this.analysisViewData.plane!=null?b(this.analysisViewData.plane,V()):null;i.next(ye(this.view,s.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(s)).next(this._rotateDragUpdatePlaneFromRotate()),a.next(()=>{n!=null&&this._updateBoundedPlane(n)})})}_rotateDragRenderPlaneToRotate(e){return t=>{if(this.analysisViewData.plane==null)return null;const i=Gi(e.rotatePlane),a=ia(e.startPoint,t.renderEnd,this.analysisViewData.plane.origin,i);return{...t,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return e=>{if(this.analysisViewData.plane==null)return;const t=Ui(k.get(),e.rotateAngle,e.rotateAxis);if(t==null)return;const i=yt(o.get(),this._startPlane.basis1,t),a=yt(o.get(),this._startPlane.basis2,t),s=Ge(this.analysisViewData.plane.origin,i,a,V());this._updateBoundedPlane(s)}}_onResizeGrab(e,t){if(e.action!=="start"||this.analysisViewData.plane==null||!e.screenPoint)return;const i=this._calculatePickRay(e.screenPoint),a=o.get();fe(this.analysisViewData.plane.plane,i,a)&&(b(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:t,startPoint:St(a)})}_createResizeDragPipeline(e){return we(e,(t,i,a)=>{const s=this.inputState;if(s==null||s.type!=="resize"||this.analysisViewData.plane==null)return;const n=b(this.analysisViewData.plane,V());i.next(ye(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(s)),a.next(()=>{this._updateBoundedPlane(n)})})}_resizeDragUpdatePlane(e){return t=>{if(this.analysisViewData.plane==null)return;const i=this._resizeHandles[e.activeHandleIdx],a=Ha(i,e.startPoint,t.renderEnd,this.view.state.camera,this._startPlane,b(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(e){const t=this.analysisViewData;if(t==null)throw new Error("valid internal object expected");t.plane=e}_updatePreviewPlane(e,t={}){let i=this._previewPlane;if(this._previewPlane=null,e==null)return this._removeFrameTask(),void this._updateManipulators();if(!this.analysisViewData.plane&&this.active){const a=i??V();if(i=i!=null?b(i,rs):null,this._pickPlane(e,!0,t,a)){const s=fa;let n=!1;i!=null&&(n=A(i.plane,a.plane){this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+a/(1e3*Pa),1),this._updateManipulators(),this._previewPlaneOpacity===1&&this._removeFrameTask()}}):this._previewPlane==null&&this._frameTask!=null?this._removeFrameTask():this._previewPlane!=null&&this._updateManipulators()}_removeFrameTask(){this._frameTask=vt(this._frameTask)}_calculatePickRay(e){const t=$t(),i=ft(e,ls);return zi(this.view.state.camera,i,t),$(t.direction,t.direction),t}_pickMinResult(e){const t=ft(e,Bi.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(t,this._intersector),this._intersector.results.min}_pickPlane(e,t,i,a){const s=this._pickMinResult(e),n=o.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(o.get()),l=this.view.state.camera;A(r,l.viewForward)>0&&w(r,r,-1);const h=Ga(n,l),_=(t?1:-1)*h*ya,g=w(o.get(),r,_);v(g,g,n);const p=this.analysis.tiltEnabled?E.TILTED:E.HORIZONTAL_OR_VERTICAL,c=i[Ae]?E.VERTICAL:i[Ie]?E.HORIZONTAL:p;return ka(g,r,h,h,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=vt(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=m,this.rotateHeadingManipulator.state|=m,this.rotateTiltManipulator.state|=m,this._prevPointerMoveTimeout=this._clock.setTimeout(()=>{this.shiftManipulator.state&=~m,this.rotateHeadingManipulator.state&=~m,this.rotateTiltManipulator.state&=~m},this._pointerMoveTimerMs)}_updateManipulators(){if(We.disableEngineLayers)return;let e,t=!1;if(this.analysisViewData.plane!=null)e=this.analysisViewData.plane,t=!1;else{if(this._previewPlane==null)return this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach(r=>r.available=!1),this._previewPlaneOutlineVisualElement.visible=!1,void(this._previewPlaneGridVisualElement.visible=!1);e=this._previewPlane,t=!0}const i=Ft(e,k.get());t?(this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach(r=>r.available=!1),this._previewPlaneOutlineVisualElement.attached=!0,this._previewPlaneGridVisualElement.attached=!0,this._previewPlaneOutlineVisualElement.visible=!0,this._previewPlaneGridVisualElement.visible=!0):(this.shiftManipulator.available=!0,this.rotateHeadingManipulator.available=!0,this.rotateTiltManipulator.available=this.analysis.tiltEnabled,this.resizeManipulators.forEach(r=>r.available=!0),Na(this.shiftManipulator,i,e,this.view.state.camera),Fa(this.rotateHeadingManipulator,i,e,this.view.renderCoordsHelper),ja(this.rotateTiltManipulator,i,e),this.resizeManipulators.forEach((r,l)=>Ba(r,this._resizeHandles[l],i,e)),this._previewPlaneOutlineVisualElement.visible=!1,this._previewPlaneGridVisualElement.visible=!1);const a=te(o.get(),M(e.basis1),M(e.basis2),1),s=Lt(k.get(),a),n=Q(s,i,s);this._previewPlaneOutlineVisualElement.transform=n,this._previewPlaneGridVisualElement.transform=n,this._updateMaterials()}_updateMaterials(){const e=y.toUnitRGBA(P.plane.outlineColor);e[3]*=this._previewPlaneOpacity;const t=y.toUnitRGBA(P.plane.color);t[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=e,this._previewPlaneGridVisualElement.backgroundColor=t,this._previewPlaneGridVisualElement.gridColor=Ht}_updateManipulatorsInteractive(e){if(!e.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach(t=>{t.interactive=!0});this.shiftManipulator.interactive=this.shiftManipulator===e,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===e,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===e,this.resizeManipulators.forEach(t=>{t.interactive=t===e})}testData(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:e=>{this._pointerMoveTimerMs=e}}}};function Ct(e,t,i,a){const s=Ua(i,Ve(a),e.direction,Be()),n=J();return fe(s,e,n)?{type:"shift",creatingPointerId:t,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function He(e){return e.pointerType!=="mouse"||e.button===0}f.disableEngineLayers=!1,u([d()],f.prototype,"_clock",void 0),u([d({constructOnly:!0})],f.prototype,"view",void 0),u([d()],f.prototype,"analysisViewData",void 0),u([d({readOnly:!0})],f.prototype,"state",null),u([d({readOnly:!0})],f.prototype,"cursor",null),u([d()],f.prototype,"analysis",null),u([d()],f.prototype,"removeIncompleteOnCancel",void 0),u([d({readOnly:!0})],f.prototype,"layersMode",void 0),u([d({value:null})],f.prototype,"inputState",null),u([d()],f.prototype,"_isPlacingSlicePlane",null),u([d()],f.prototype,"_creatingPointerId",null),f=We=u([ce("esri.views.3d.analysis.Slice.SliceTool")],f);const rs=V(),ls=Fi(),os=f;let z=class extends qe{constructor(e){super(e),this._handles=new Me,this._gridVisualElement=null,this._outlineVisualElement=null,this.showGrid=!1,this.preview=!0}initialize(){const e=this.analysisViewData;if(e==null)throw new Error("expected internal object to be valid");this._gridVisualElement=Kt(this.view),this._outlineVisualElement=Wt(this.view),this._handles.add([R(()=>({visible:e.plane!=null&&this.analysisViewData.visible,active:this.analysisViewData.active,preview:this.preview,showGrid:this.showGrid}),t=>this._updateMaterials(t),ze),R(()=>e.plane,t=>this._updatePlane(t),ze)],"internal")}destroy(){this._handles.destroy(),this._gridVisualElement=W(this._gridVisualElement),this._outlineVisualElement=W(this._outlineVisualElement),this.set("view",null)}_updatePlane(e){if(e==null)return;this._gridVisualElement.attached=!0,this._outlineVisualElement.attached=!0;const t=te(o.get(),M(e.basis1),M(e.basis2),1),i=Lt(k.get(),t),a=Ft(e,k.get()),s=Q(i,a,i);this._outlineVisualElement.transform=s,this._gridVisualElement.transform=s}_updateMaterials({visible:e,active:t,preview:i,showGrid:a}){this._outlineVisualElement.color=y.toUnitRGBA(P.plane.outlineColor),this._outlineVisualElement.width=i?Nt:zt,this._outlineVisualElement.stipplePattern=t?null:ji(5),this._gridVisualElement.backgroundColor=y.toUnitRGBA(P.plane.color),this._gridVisualElement.gridColor=a?y.toUnitRGBA(P.plane.gridColor):Ht,this._gridVisualElement.visible=e,this._outlineVisualElement.visible=e}};u([d()],z.prototype,"view",void 0),u([d()],z.prototype,"analysis",void 0),u([d()],z.prototype,"analysisViewData",void 0),u([d()],z.prototype,"showGrid",void 0),u([d()],z.prototype,"preview",void 0),z=u([ce("esri.views.3d.analysis.Slice.SliceVisualization")],z);let S=class extends Xi(qe){constructor(e){super(e),this.type="slice-view-3d",this.analysis=null,this.tool=null,this.analysisVisualization=null,this.analysisController=null,this.plane=null,this.active=!0}initialize(){this.analysisVisualization=new z({view:this.view,analysis:this.analysis,analysisViewData:this}),this.analysisController=new X({view:this.view,analysis:this.analysis,analysisViewData:this}),this.addHandles(aa(this,os))}destroy(){sa(this),this.analysisVisualization=W(this.analysisVisualization),this.analysisController=W(this.analysisController)}get showGrid(){var e;return((e=this.analysisVisualization)==null?void 0:e.showGrid)??!1}set showGrid(e){this.analysisVisualization&&(this.analysisVisualization.showGrid=e)}get editable(){return!this.analysisVisualization.preview}set editable(e){this.analysisVisualization.preview=!e}get testData(){return{visualization:this.analysisVisualization,controller:this.analysisController,tool:this.tool}}};u([d({readOnly:!0})],S.prototype,"type",void 0),u([d({constructOnly:!0,nonNullable:!0})],S.prototype,"analysis",void 0),u([d()],S.prototype,"tool",void 0),u([d()],S.prototype,"plane",void 0),u([d()],S.prototype,"active",void 0),u([d()],S.prototype,"showGrid",null),u([d()],S.prototype,"editable",null),S=u([ce("esri.views.3d.analysis.SliceAnalysisView3D")],S);const us=S,Cs=Object.freeze(Object.defineProperty({__proto__:null,default:us},Symbol.toStringTag,{value:"Module"}));export{Cs as S,$a as t}; diff --git a/assets/SlicePlaneMaterial.glsl-99e82c24.js b/assets/SlicePlaneMaterial.glsl-99e82c24.js new file mode 100644 index 0000000..3fee179 --- /dev/null +++ b/assets/SlicePlaneMaterial.glsl-99e82c24.js @@ -0,0 +1 @@ +import"./index-080e108a.js";import{t as ao}from"./SliceAnalysisView3D-63c25320.js";import"./LineVisualElement-b605d10c.js";import"./persistable-ca976a2c.js";import"./multiOriginJSONSupportUtils-c978f4c3.js";import"./resourceExtension-91e7c3ce.js";import"./BuildingComponentSublayer-5d49e5f9.js";import"./UniqueValueRenderer-fef4204d.js";import"./diffUtils-590c9088.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./FeatureLayer-5c6d2c3b.js";import"./MultiOriginJSONSupport-e4912ffd.js";import"./sql-734ecbc5.js";import"./FeatureLayerBase-7c7dfccb.js";import"./commonProperties-30089b06.js";import"./featureLayerUtils-6cf06f83.js";import"./AttachmentQuery-972bbd60.js";import"./Query-1c961d4c.js";import"./RelationshipQuery-39c07195.js";import"./serviceCapabilitiesUtils-959e798a.js";import"./editsZScale-1b5a53a6.js";import"./queryZScale-8f9616ff.js";import"./FeatureSet-111cb247.js";import"./APIKeyMixin-878a7aa7.js";import"./ArcGISService-83287338.js";import"./CustomParametersMixin-231c4be8.js";import"./EditBusLayer-d71787e9.js";import"./FeatureEffectLayer-4160946c.js";import"./FeatureEffect-86735d98.js";import"./FeatureFilter-00f4be05.js";import"./FeatureReductionLayer-4262cf54.js";import"./LabelClass-2d53c485.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./OperationalLayer-0e8f8b28.js";import"./OrderedLayer-68067459.js";import"./PortalLayer-310c2800.js";import"./portalItemUtils-792a27e1.js";import"./TemporalLayer-f17c9161.js";import"./FeatureTemplate-2a7e96c1.js";import"./FeatureType-db96032c.js";import"./fieldProperties-62c55499.js";import"./labelingInfo-144f3d9f.js";import"./versionUtils-f17daa93.js";import"./styleUtils-25825fd6.js";import"./TopFeaturesQuery-e44d05be.js";import"./popupUtils-82ea8abb.js";import"./capabilities-5d185925.js";import"./I3SIndexInfo-445e6968.js";import"./I3SLayerDefinitions-ffdb3821.js";import"./I3SUtil-2c288808.js";import"./I3SBinaryReader-2b8e30f7.js";import"./popupUtils-f04ec9a9.js";import"./analysisViewUtils-68ab721d.js";import"./ImageMaterial-5c48df66.js";import"./Factory-8e329f4b.js";export{ao as build}; diff --git a/assets/SmaaRenderPassData-660b7d34.js b/assets/SmaaRenderPassData-660b7d34.js new file mode 100644 index 0000000..c928176 --- /dev/null +++ b/assets/SmaaRenderPassData-660b7d34.js @@ -0,0 +1 @@ +const A="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZLNHTarZGrLJJllt1W2qKrsumZWZcTvn7L3W54e1vrXX3vuciLPPORFR1XE2EomorB0nVuz//r71re/y/1eMvb4Cb3N11xV/PP/2v4UBAwJG/7H8urx6/25/Gf8O5hypMQ0EEEQwAqLfoN/Z+97f/SW+/NvcgQk4sGBJK6H7N4PFVL+K+e0N11yNfkKvwUdwdlUAXPHHL38oa15f/i/46Ih6SuMSPmLAYAwyRKn7dfMGH97jaMFBYCJUgotIC2YAdu+LyW9vvubxAP8kAL8H/koAuOKP3+q6+xGnd5kdYCeECnGIJViwGJMAkQKfDvB3WZxjLKGh8VSCCzhwEWBpMc5/kBbjawT4HnwJfhr+pPBIu7uu+OOTo9vsmtQcniMBGkKFd4jDWMSCRUpLjJYNJkM+IRzQ+PQvIeAMTrBS2LEiaiR9b/5PuT6Ap/AcfAFO4Y3dA3DFH7/VS+M8k4baEAQfMI4QfbVDDGIRg7GKaIY52qAjTAgTvGBAPGIIghOCYAUrGFNgzA7Q3QhgCwfwAnwe5vDejgG44o/fbm1C5ZlYQvQDARPAIQGxCWBM+wWl37ZQESb4gImexGMDouhGLx1Cst0Saa4b4AqO4Hk4gxo+3DHAV/nx27p3JziPM2pVgoiia5MdEzCGULprIN7gEEeQ5IQxEBBBQnxhsDb5auGmAAYcHMA9eAAz8PBol8/xij9+C4Djlim4gJjWcwZBhCBgMIIYxGAVIkH3ZtcBuLdtRFMWsPGoY9rN+HoBji9VBYdwD2ZQg4cnO7OSq/z4rU5KKdwVbFAjNojCQzTlCLPFSxtamwh2jMUcEgg2Wm/6XgErIBhBckQtGN3CzbVacERgCnfgLswhnvqf7QyAq/z4rRZm1YglYE3affGITaZsdIe2FmMIpnOCap25I6jt2kCwCW0D1uAD9sZctNGXcQIHCkINDQgc78aCr+zjtw3BU/ijdpw3zhCwcaONwBvdeS2YZKkJNJsMPf2JKEvC28RXxxI0ASJyzQCjCEQrO4Q7sFArEzjZhaFc4cdv+/JFdKULM4px0DfUBI2hIsy06BqLhGTQEVdbfAIZXYMPesq6VoCHICzUyjwInO4Y411//LYLs6TDa9wvg2CC2rElgAnpTBziThxaL22MYhzfkghz6GAs2VHbbdM91VZu1MEEpupMMwKyVTb5ij9+u4VJG/5EgEMMmFF01cFai3isRbKbzb+YaU/MQbAm2XSMoUPAmvZzbuKYRIFApbtlrfFuUGd6vq2hXNnH78ZLh/iFhsQG3T4D1ib7k5CC6vY0DCbtrohgLEIClXiGtl10zc0CnEGIhhatLBva7NP58Tvw0qE8yWhARLQ8h4+AhQSP+I4F5xoU+VilGRJs6wnS7ruti/4KvAY/CfdgqjsMy4pf8fodQO8/gnuX3f/3xi3om1/h7THr+co3x93PP9+FBUfbNUjcjEmhcrkT+8K7ml7V10Jo05mpIEFy1NmCJWx9SIKKt+EjAL4Ez8EBVOB6havuT/rByPvHXK+9zUcfcbb254+9fydJknYnRr1oGfdaiAgpxu1Rx/Rek8KISftx3L+DfsLWAANn8Hvw0/AFeAGO9DFV3c6D+CcWbL8Dj9e7f+T1k8AZv/d7+PXWM/Z+VvdCrIvuAKO09RpEEQJM0Ci6+B4xhTWr4cZNOvhktabw0ta0rSJmqz3Yw5/AKXwenod7cAhTmBSPKf6JBdvH8IP17h95pXqw50/+BFnj88fev4NchyaK47OPhhtI8RFSvAfDSNh0Ck0p2gLxGkib5NJj/JWCr90EWQJvwBzO4AHcgztwAFN1evHPUVGwfXON+0debT1YeGON9Yy9/63X+OguiwmhIhQhD7l4sMqlG3D86Suc3qWZ4rWjI1X7u0Ytw6x3rIMeIOPDprfe2XzNgyj6PahhBjO4C3e6puDgXrdg+/5l948vF3bqwZetZ+z9Rx9zdIY5pInPK4Nk0t+l52xdK2B45Qd87nM8fsD5EfUhIcJcERw4RdqqH7Yde5V7m1vhNmtedkz6EDzUMF/2jJYWbC+4fzzA/Y+/8PPH3j9dcBAPIRP8JLXd5BpAu03aziOL3VVHZzz3CXWDPWd+SH2AnxIqQoTZpo9Ckc6HIrFbAbzNmlcg8Ag8NFDDAhbJvTBZXbC94P7t68EXfv6o+21gUtPETU7bbkLxvNKRFG2+KXzvtObonPP4rBvsgmaKj404DlshFole1Glfh02fE7bYR7dZ82oTewIBGn1Md6CG6YUF26X376oevOLzx95vhUmgblI6LBZwTCDY7vMq0op5WVXgsObOXJ+1x3qaBl9j1FeLxbhU9w1F+Wiba6s1X/TBz1LnUfuYDi4r2C69f1f14BWfP+p+W2GFKuC9phcELMYRRLur9DEZTUdEH+iEqWdaM7X4WOoPGI+ZYD2+wcQ+y+ioHUZ9dTDbArzxmi/bJI9BND0Ynd6lBdve/butBw8+f/T9D3ABa3AG8W3VPX4hBin+bj8dMMmSpp5pg7fJ6xrBFE2WQQEWnV8Qg3FbAWzYfM1rREEnmvkN2o1+acG2d/9u68GDzx91v3mAjb1zkpqT21OipPKO0b9TO5W0nTdOmAQm0TObts3aBKgwARtoPDiCT0gHgwnbArzxmtcLc08HgF1asN0C4Ms/fvD5I+7PhfqyXE/b7RbbrGyRQRT9ARZcwAUmgdoz0ehJ9Fn7QAhUjhDAQSw0bV3T3WbNa59jzmiP6GsWbGXDX2ytjy8+f9T97fiBPq9YeLdBmyuizZHaqXITnXiMUEEVcJ7K4j3BFPurtB4bixW8wTpweL8DC95szWMOqucFYGsWbGU7p3TxxxefP+r+oTVktxY0v5hbq3KiOKYnY8ddJVSBxuMMVffNbxwIOERShst73HZ78DZrHpmJmH3K6sGz0fe3UUj0eyRrSCGTTc+rjVNoGzNSv05srAxUBh8IhqChiQgVNIIBH3AVPnrsnXQZbLTm8ammv8eVXn/vWpaTem5IXRlt+U/LA21zhSb9cye6jcOfCnOwhIAYXAMVTUNV0QhVha9xjgA27ODJbLbmitt3tRN80lqG6N/khgot4ZVlOyO4WNg3OIMzhIZQpUEHieg2im6F91hB3I2tubql6BYNN9Hj5S7G0G2tahslBWKDnOiIvuAEDzakDQKDNFQT6gbn8E2y4BBubM230YIpBnDbMa+y3dx0n1S0BtuG62lCCXwcY0F72T1VRR3t2ONcsmDjbmzNt9RFs2LO2hQNyb022JisaI8rAWuw4HI3FuAIhZdOGIcdjLJvvObqlpqvWTJnnQbyi/1M9O8UxWhBs//H42I0q1Yb/XPGONzcmm+ri172mHKvZBpHkJaNJz6v9jxqiklDj3U4CA2ugpAaYMWqNXsdXbmJNd9egCnJEsphXNM+MnK3m0FCJ5S1kmJpa3DgPVbnQnPGWIDspW9ozbcO4K/9LkfaQO2KHuqlfFXSbdNzcEcwoqNEFE9zcIXu9/6n/ym/BC/C3aJLzEKPuYVlbFnfhZ8kcWxV3dbv4bKl28566wD+8C53aw49lTABp9PWbsB+knfc/Li3eVizf5vv/xmvnPKg5ihwKEwlrcHqucuVcVOxEv8aH37E3ZqpZypUulrHEtIWKUr+txHg+ojZDGlwnqmkGlzcVi1dLiNSJiHjfbRNOPwKpx9TVdTn3K05DBx4psIk4Ei8aCkJahRgffk4YnEXe07T4H2RR1u27E6wfQsBDofUgjFUFnwC2AiVtA+05J2zpiDK2Oa0c5fmAecN1iJzmpqFZxqYBCYhFTCsUNEmUnIcZ6aEA5rQVhEywG6w7HSW02XfOoBlQmjwulOFQAg66SvJblrTEX1YtJ3uG15T/BH1OfOQeuR8g/c0gdpT5fx2SKbs9EfHTKdM8A1GaJRHLVIwhcGyydZsbifAFVKl5EMKNU2Hryo+06BeTgqnxzYjThVySDikbtJPieco75lYfKAJOMEZBTjoITuWHXXZVhcUDIS2hpiXHV9Ku4u44bN5OYLDOkJo8w+xJSMbhBRHEdEs9JZUCkQrPMAvaHyLkxgkEHxiNkx/x2YB0mGsQ8EUWj/stW5YLhtS5SMu+/YBbNPDCkGTUybN8krRLBGPlZkVOA0j+a1+rkyQKWGaPHPLZOkJhioQYnVZ2hS3zVxMtgC46KuRwbJNd9nV2PHgb36F194ecf/Yeu2vAFe5nm/bRBFrnY4BauE8ERmZRFUn0k8hbftiVYSKMEme2dJCJSCGYAlNqh87bXOPdUkGy24P6d1ll21MBqqx48Fvv8ZHH8HZFY7j/uAq1xMJUFqCSUlJPmNbIiNsmwuMs/q9CMtsZsFO6SprzCS1Z7QL8xCQClEelpjTduDMsmWD8S1PT152BtvmIGvUeDA/yRn83u/x0/4qxoPHjx+PXY9pqX9bgMvh/Nz9kpP4pOe1/fYf3axUiMdHLlPpZCNjgtNFAhcHEDxTumNONhHrBduW+vOyY++70WWnPXj98eA4kOt/mj/5E05l9+O4o8ePx67HFqyC+qSSnyselqjZGaVK2TadbFLPWAQ4NBhHqDCCV7OTpo34AlSSylPtIdd2AJZlyzYQrDJ5lcWGNceD80CunPLGGzsfD+7wRb95NevJI5docQ3tgCyr5bGnyaPRlmwNsFELViOOx9loebGNq2moDOKpHLVP5al2cymWHbkfzGXL7kfRl44H9wZy33tvt+PB/Xnf93e+nh5ZlU18wCiRUa9m7kib9LYuOk+hudQNbxwm0AQqbfloimaB2lM5fChex+ylMwuTbfmXQtmWlenZljbdXTLuOxjI/fDDHY4Hjx8/Hrse0zXfPFxbUN1kKqSCCSk50m0Ajtx3ub9XHBKHXESb8iO6E+qGytF4nO0OG3SXzbJlhxBnKtKyl0NwybjvYCD30aMdjgePHz8eu56SVTBbgxJMliQ3Oauwg0QHxXE2Ez/EIReLdQj42Gzb4CLS0YJD9xUx7bsi0vJi5mUbW1QzL0h0PFk17rtiIPfJk52MB48fPx67npJJwyrBa2RCCQRTbGZSPCxTPOiND4G2pYyOQ4h4jINIJh5wFU1NFZt+IsZ59LSnDqBjZ2awbOku+yInunLcd8VA7rNnOxkPHj9+PGY9B0MWJJNozOJmlglvDMXDEozdhQWbgs/U6oBanGzLrdSNNnZFjOkmbi5bNt1lX7JLLhn3vXAg9/h4y/Hg8ePHI9dzQMEkWCgdRfYykYKnkP7D4rIujsujaKPBsB54vE2TS00ccvFY/Tth7JXeq1hz+qgVy04sAJawTsvOknHfCwdyT062HA8eP348Zj0vdoXF4pilKa2BROed+9fyw9rWRXeTFXESMOanvDZfJuJaSXouQdMdDJZtekZcLLvEeK04d8m474UDuaenW44Hjx8/Xns9YYqZpszGWB3AN/4VHw+k7WSFtJ3Qicuqb/NlVmgXWsxh570xg2UwxUw3WfO6B5nOuO8aA7lnZxuPB48fPx6znm1i4bsfcbaptF3zNT78eFPtwi1OaCNOqp1x3zUGcs/PN++AGD1+fMXrSVm2baTtPhPahbPhA71wIHd2bXzRa69nG+3CraTtPivahV/55tXWg8fyRY/9AdsY8VbSdp8V7cKrrgdfM//z6ILQFtJ2nxHtwmuoB4/kf74+gLeRtvvMaBdeSz34+vifx0YG20jbfTa0C6+tHrwe//NmOG0L8EbSdp8R7cLrrQe/996O+ai3ujQOskpTNULa7jOjXXj99eCd8lHvoFiwsbTdZ0a78PrrwTvlo966pLuRtB2fFe3Cm6oHP9kNH/W2FryxtN1nTLvwRurBO+Kj3pWXHidtx2dFu/Bm68Fb81HvykuPlrb7LGkX3mw9eGs+6h1Y8MbSdjegXcguQLjmevDpTQLMxtJ2N6NdyBZu9AbrwVvwUW+LbteULUpCdqm0HTelXbhNPe8G68Gb8lFvVfYfSNuxvrTdTWoXbozAzdaDZzfkorOj1oxVxlIMlpSIlpLrt8D4hrQL17z+c3h6hU/wv4Q/utps4+bm+6P/hIcf0JwQ5oQGPBL0eKPTYEXTW+eL/2DKn73J9BTXYANG57hz1cEMviVf/4tf5b/6C5pTQkMIWoAq7hTpOJjtAM4pxKu5vg5vXeUrtI09/Mo/5H+4z+Mp5xULh7cEm2QbRP2tFIKR7WM3fPf/jZ3SWCqLM2l4NxID5zB72HQXv3jj/8mLR5xXNA5v8EbFQEz7PpRfl1+MB/hlAN65qgDn3wTgH13hK7T59bmP+NIx1SHHU84nLOITt3iVz8mNO+lPrjGAnBFqmioNn1mTyk1ta47R6d4MrX7tjrnjYUpdUbv2rVr6YpVfsGG58AG8Ah9eyUN8CX4WfgV+G8LVWPDGb+Zd4cU584CtqSbMKxauxTg+dyn/LkVgA+IR8KHtejeFKRtTmLLpxN6mYVLjYxwXf5x2VofiZcp/lwKk4wGOpYDnoIZPdg/AAbwMfx0+ge9dgZvYjuqKe4HnGnykYo5TvJbG0Vj12JagRhwKa44H95ShkZa5RyLGGdfYvG7aw1TsF6iapPAS29mNS3NmsTQZCmgTzFwgL3upCTgtBTRwvGMAKrgLn4evwin8+afJRcff+8izUGUM63GOOuAs3tJkw7J4kyoNreqrpO6cYLQeFUd7TTpr5YOTLc9RUUogUOVJQ1GYJaFLAW0oTmKyYS46ZooP4S4EON3xQ5zC8/CX4CnM4c1PE8ApexpoYuzqlP3d4S3OJP8ZDK7cKWNaTlqmgDiiHwl1YsE41w1zT4iRTm3DBqxvOUsbMKKDa/EHxagtnta072ejc3DOIh5ojvh8l3tk1JF/AV6FU6jh3U8HwEazLgdCLYSQ+MYiAI2ltomkzttUb0gGHdSUUgsIYjTzLG3mObX4FBRaYtpDVNZrih9TgTeYOBxsEnN1gOCTM8Bsw/ieMc75w9kuAT6A+/AiHGvN/+Gn4KRkiuzpNNDYhDGFndWRpE6SVfm8U5bxnSgVV2jrg6JCKmneqey8VMFgq2+AM/i4L4RUbfSi27lNXZ7R7W9RTcq/q9fk4Xw3AMQd4I5ifAZz8FcVtm9SAom/dyN4lczJQW/kC42ZrHgcCoIf1oVMKkVItmMBi9cOeNHGLqOZk+QqQmrbc5YmYgxELUUN35z2iohstgfLIFmcMV7s4CFmI74L9+EFmGsi+tGnAOD4Yk9gIpo01Y4cA43BWGygMdr4YZekG3OBIUXXNukvJS8tqa06e+lSDCtnqqMFu6hWHXCF+WaYt64m9QBmNxi7Ioy7D+fa1yHw+FMAcPt7SysFLtoG4PXAk7JOA3aAxBRqUiAdU9Yp5lK3HLSRFtOim0sa8euEt08xvKjYjzeJ2GU7YawexrnKI9tmobInjFXCewpwriY9+RR4aaezFhMhGCppKwom0ChrgFlKzyPKkGlTW1YQrE9HJqu8hKGgMc6hVi5QRq0PZxNfrYNgE64utmRv6KKHRpxf6VDUaOvNP5jCEx5q185My/7RKz69UQu2im5k4/eownpxZxNLwiZ1AZTO2ZjWjkU9uaB2HFn6Q3u0JcsSx/qV9hTEApRzeBLDJQXxYmTnq7bdLa3+uqFrxLJ5w1TehnNHx5ECvCh2g2c3hHH5YsfdaSKddztfjQ6imKFGSyFwlLzxEGPp6r5IevVjk1AMx3wMqi1NxDVjLBiPs9tbsCkIY5we5/ML22zrCScFxnNtzsr9Wcc3CnD+pYO+4VXXiDE0oc/vQQ/fDK3oPESJMYXNmJa/DuloJZkcTpcYE8lIH8Dz8DJMiynNC86Mb2lNaaqP/+L7f2fcE/yP7/Lde8xfgSOdMxvOixZf/9p3+M4hT1+F+zApxg9XfUvYjc8qX2lfOOpK2gNRtB4flpFu9FTKCp2XJRgXnX6olp1zyYjTKJSkGmLE2NjUr1bxFM4AeAAHBUFIeSLqXR+NvH/M9fOnfHzOD2vCSyQJKzfgsCh+yi/Mmc35F2fUrw7miW33W9hBD1vpuUojFphIyvg7aTeoymDkIkeW3XLHmguMzbIAJejN6B5MDrhipE2y6SoFRO/AK/AcHHZHNIfiWrEe/C6cr3f/yOvrQKB+zMM55/GQdLDsR+ifr5Fiuu+/y+M78LzOE5dsNuXC3PYvYWd8NXvphLSkJIasrlD2/HOqQ+RjcRdjKTGWYhhVUm4yxlyiGPuMsZR7sMCHUBeTuNWA7if+ifXgc/hovftHXs/DV+Fvwe+f8shzMiMcweFgBly3//vwJfg5AN4450fn1Hd1Rm1aBLu22Dy3y3H2+OqMemkbGZ4jozcDjJf6596xOLpC0eMTHbKnxLxH27uZ/bMTGs2jOaMOY4m87CfQwF0dw53oa1k80JRuz/XgS+8fX3N9Af4qPIMfzKgCp4H5TDGe9GGeFPzSsZz80SlPTxXjgwJmC45njzgt2vbQ4b4OAdUK4/vWhO8d8v6EE8fMUsfakXbPpFJeLs2ubM/qdm/la3WP91uWhxXHjoWhyRUq2iJ/+5mA73zwIIo+LoZ/SgvIRjAd1IMvvn98PfgOvAJfhhm8scAKVWDuaRaK8aQ9f7vuPDH6Bj47ZXau7rqYJ66mTDwEDU6lLbCjCK0qTXyl5mnDoeNRxanj3FJbaksTk0faXxHxLrssgPkWB9LnA/MFleXcJozzjwsUvUG0X/QCve51qkMDXp9mtcyOy3rwBfdvVJK7D6/ACSzg3RoruIq5UDeESfEmVclDxnniU82vxMLtceD0hGZWzBNPMM/jSPne2OVatiTKUpY5vY7gc0LdUAWeWM5tH+O2I66AOWw9xT2BuyRVLGdoDHUsVRXOo/c+ZdRXvFfnxWyIV4upFLCl9eAL7h8Zv0QH8Ry8pA2cHzQpGesctVA37ZtklBTgHjyvdSeKY/RZw/kJMk0Y25cSNRWSigQtlULPTw+kzuJPeYEkXjQRpoGZobYsLF79pyd1dMRHInbgFTZqNLhDqiIsTNpoex2WLcy0/X6rHcdMMQvFSd5dWA++4P7xv89deACnmr36uGlL69bRCL6BSZsS6c0TU2TKK5gtWCzgAOOwQcurqk9j8whvziZSMLcq5hbuwBEsYjopUBkqw1yYBGpLA97SRElEmx5MCInBY5vgLk94iKqSWmhIGmkJ4Bi9m4L645J68LyY4wsFYBfUg5feP/6gWWm58IEmKQM89hq7KsZNaKtP5TxxrUZZVkNmMJtjbKrGxLNEbHPJxhqy7lAmbC32ZqeF6lTaknRWcYaFpfLUBh/rwaQycCCJmW15Kstv6jRHyJFry2C1ahkkIW0LO75s61+owxK1y3XqweX9m5YLM2DPFeOjn/iiqCKJ+yKXF8t5Yl/kNsqaSCryxPq5xWTFIaP8KSW0RYxqupaUf0RcTNSSdJZGcKYdYA6kdtrtmyBckfKXwqk0pHpUHlwWaffjNRBYFPUDWa8e3Lt/o0R0CdisKDM89cX0pvRHEfM8ca4t0s2Xx4kgo91MPQJ/0c9MQYq0co8MBh7bz1fio0UUHLR4aAIOvOmoYO6kwlEVODSSTliWtOtH6sPkrtctF9ZtJ9GIerBskvhdVS5cFNv9s1BU0AbdUgdK4FG+dRnjFmDTzniRMdZO1QhzMK355vigbdkpz9P6qjUGE5J2qAcXmwJ20cZUiAD0z+pGMx6xkzJkmEf40Hr4qZfVg2XzF9YOyoV5BjzVkUJngKf8lgNYwKECEHrCNDrWZzMlflS3yBhr/InyoUgBc/lKT4pxVrrC6g1YwcceK3BmNxZcAtz3j5EIpqguh9H6wc011YN75cKDLpFDxuwkrPQmUwW4KTbj9mZTwBwLq4aQMUZbHm1rylJ46dzR0dua2n3RYCWZsiHROeywyJGR7mXKlpryyCiouY56sFkBWEnkEB/raeh/Sw4162KeuAxMQpEkzy5alMY5wamMsWKKrtW2WpEWNnReZWONKWjrdsKZarpFjqCslq773PLmEhM448Pc3+FKr1+94vv/rfw4tEcu+lKTBe4kZSdijBrykwv9vbCMPcLQTygBjzVckSLPRVGslqdunwJ4oegtFOYb4SwxNgWLCmD7T9kVjTv5YDgpo0XBmN34Z/rEHp0sgyz7lngsrm4lvMm2Mr1zNOJYJ5cuxuQxwMGJq/TP5emlb8fsQBZviK4t8hFL+zbhtlpwaRSxQRWfeETjuauPsdGxsBVdO7nmP4xvzSoT29pRl7kGqz+k26B3Oy0YNV+SXbbQas1ctC/GarskRdFpKczVAF1ZXnLcpaMuzVe6lZ2g/1ndcvOVgRG3sdUAY1bKD6achijMPdMxV4muKVorSpiDHituH7rSTs7n/4y5DhRXo4FVBN4vO/zbAcxhENzGbHCzU/98Mcx5e7a31kWjw9FCe/zNeYyQjZsWb1uc7U33pN4Mji6hCLhivqfa9Ss6xLg031AgfesA/l99m9fgvnaF9JoE6bYKmkGNK3aPbHB96w3+DnxFm4hs0drLsk7U8kf/N/CvwQNtllna0rjq61sH8L80HAuvwH1tvBy2ChqWSCaYTaGN19sTvlfzFD6n+iKTbvtayfrfe9ueWh6GJFoxLdr7V72a5ZpvHcCPDzma0wTO4EgbLyedxstO81n57LYBOBzyfsOhUKsW1J1BB5vr/tz8RyqOFylQP9Tvst2JALsC5lsH8PyQ40DV4ANzYa4dedNiKNR1s+x2wwbR7q4/4cTxqEk4LWDebfisuo36JXLiWFjOtLrlNWh3K1rRS4xvHcDNlFnNmWBBAl5SWaL3oPOfnvbr5pdjVnEaeBJSYjuLEkyLLsWhKccadmOphZkOPgVdalj2QpSmfOsADhMWE2ZBu4+EEJI4wKTAuCoC4xwQbWXBltpxbjkXJtKxxabo9e7tyhlgb6gNlSbUpMh+l/FaqzVwewGu8BW1Zx7pTpQDJUjb8tsUTW6+GDXbMn3mLbXlXJiGdggxFAoUrtPS3wE4Nk02UZG2OOzlk7fRs7i95QCLo3E0jtrjnM7SR3uS1p4qtS2nJ5OwtQVHgOvArLBFijZUV9QtSl8dAY5d0E0hM0w3HS2DpIeB6m/A1+HfhJcGUq4sOxH+x3f5+VO+Ds9rYNI7zPXOYWPrtf8bYMx6fuOAX5jzNR0PdsuON+X1f7EERxMJJoU6GkTEWBvVolVlb5lh3tKCg6Wx1IbaMDdJ+9sUCc5KC46hKGCk3IVOS4TCqdBNfUs7Kd4iXf2RjnT/LLysJy3XDcHLh/vde3x8DoGvwgsa67vBk91G5Pe/HbOe7xwym0NXbtiuuDkGO2IJDh9oQvJ4cY4vdoqLDuoH9Zl2F/ofsekn8lkuhIlhQcffUtSjytFyp++p6NiE7Rqx/lodgKVoceEp/CP4FfjrquZaTtj2AvH5K/ywpn7M34K/SsoYDAdIN448I1/0/wveW289T1/lX5xBzc8N5IaHr0XMOQdHsIkDuJFifj20pBm5jzwUv9e2FhwRsvhAbalCIuIw3bhJihY3p6nTFFIZgiSYjfTf3aXuOjmeGn4bPoGvwl+CFzTRczBIuHBEeImHc37/lGfwZR0cXzVDOvaKfNHvwe+suZ771K/y/XcBlsoN996JpBhoE2toYxOznNEOS5TJc6Id5GEXLjrWo+LEWGNpPDU4WAwsIRROu+1vM+0oW37z/MBN9kqHnSArwPfgFJ7Cq/Ai3Ie7g7ncmI09v8sjzw9mzOAEXoIHxURueaAce5V80f/DOuuZwHM8vsMb5wBzOFWM7wymTXPAEvm4vcFpZ2ut0VZRjkiP2MlmLd6DIpbGSiHOjdnUHN90hRYmhTnmvhzp1iKDNj+b7t5hi79lWGwQ+HN9RsfFMy0FXbEwhfuczKgCbyxYwBmcFhhvo/7a44v+i3XWcwDP86PzpGQYdWh7csP5dBvZ1jNzdxC8pBGuxqSW5vw40nBpj5JhMwvOzN0RWqERHMr4Lv1kWX84xLR830G3j6yqZ1a8UstTlW+qJPOZ+sZ7xZPKTJLhiNOAFd6tk+jrTH31ncLOxid8+nzRb128HhUcru/y0Wn6iT254YPC6FtVSIMoW2sk727AhvTtrWKZTvgsmckfXYZWeNRXx/3YQ2OUxLDrbHtN11IwrgXT6c8dATDwLniYwxzO4RzuQqTKSC5gAofMZ1QBK3zQ4JWobFbcvJm87FK+6JXrKahLn54m3p+McXzzYtP8VF/QpJuh1OwieElEoI1pRxPS09FBrkq2tWCU59+HdhNtTIqKm8EBrw2RTOEDpG3IKo2Y7mFdLm3ZeVjYwVw11o/oznceMve4CgMfNym/utA/d/ILMR7gpXzRy9eDsgLcgbs8O2Va1L0zzIdwGGemTBuwROHeoMShkUc7P+ISY3KH5ZZeWqO8mFTxQYeXTNuzvvK5FGPdQfuu00DwYFY9dyhctEt+OJDdnucfpmyhzUJzfsJjr29l8S0bXBfwRS9ZT26tmMIdZucch5ZboMz3Nio3nIOsYHCGoDT4kUA9MiXEp9Xsui1S8th/kbWIrMBxDGLodWUQIWcvnXy+9M23xPiSMOiRPqM+YMXkUN3gXFrZJwXGzUaMpJfyRS9ZT0lPe8TpScuRlbMHeUmlaKDoNuy62iWNTWNFYjoxFzuJs8oR+RhRx7O4SVNSXpa0ZJQ0K1LAHDQ+D9IepkMXpcsq5EVCvClBUIzDhDoyKwDw1Lc59GbTeORivugw1IcuaEOaGWdNm+Ps5fQ7/tm0DjMegq3yM3vb5j12qUId5UZD2oxDSEWOZMSqFl/W+5oynWDa/aI04tJRQ2eTXusg86SQVu/nwSYwpW6wLjlqIzwLuxGIvoAvul0PS+ZNz0/akp/pniO/8JDnGyaCkzbhl6YcqmK/69prxPqtpx2+Km9al9sjL+rwMgHw4jE/C8/HQ3m1vBuL1fldbzd8mOueVJ92syqdEY4KJjSCde3mcRw2TA6szxedn+zwhZMps0XrqEsiUjnC1hw0TELC2Ek7uAAdzcheXv1BYLagspxpzSAoZZUsIzIq35MnFQ9DOrlNB30jq3L4pkhccKUAA8/ocvN1Rzx9QyOtERs4CVsJRK/DF71kPYrxYsGsm6RMh4cps5g1DOmM54Ly1ii0Hd3Y/BMk8VWFgBVmhqrkJCPBHAolwZaWzLR9Vb7bcWdX9NyUYE+uB2BKfuaeBUcjDljbYVY4DdtsVWvzRZdWnyUzDpjNl1Du3aloAjVJTNDpcIOVVhrHFF66lLfJL1zJr9PQ2nFJSBaKoDe+sAvLufZVHVzYh7W0h/c6AAZ+7Tvj6q9j68G/cTCS/3n1vLKHZwNi+P+pS0WkZNMBMUl+LDLuiE4omZy71r3UFMwNJV+VJ/GC5ixVUkBStsT4gGKh0Gm4Oy3qvq7Lbmq24nPdDuDR9deR11XzP4vFu3TYzfnIyiSVmgizUYGqkIXNdKTY9pgb9D2Ix5t0+NHkVzCdU03suWkkVZAoCONCn0T35gAeW38de43mf97sMOpSvj4aa1KYUm58USI7Wxxes03bAZdRzk6UtbzMaCQ6IxO0dy7X+XsjoD16hpsBeGz9dfzHj+R/Hp8nCxZRqkEDTaCKCSywjiaoMJ1TITE9eg7Jqnq8HL6gDwiZb0u0V0Rr/rmvqjxKuaLCX7ZWXTvAY+uvm3z8CP7nzVpngqrJpZKwWnCUjIviYVlirlGOzPLI3SMVyp/elvBUjjDkNhrtufFFErQ8pmdSlbK16toBHlt/HV8uHMX/vEGALkV3RJREiSlopxwdMXOZPLZ+ix+kAHpMKIk8UtE1ygtquttwxNhphrIZ1IBzjGF3IIGxGcBj6q8bHJBG8T9vdsoWrTFEuebEZuVxhhClH6P5Zo89OG9fwHNjtNQTpD0TG9PJLEYqvEY6Rlxy+ZZGfL0Aj62/bnQCXp//eeM4KzfQVJbgMQbUjlMFIm6TpcfWlZje7NBSV6IsEVmumWIbjiloUzQX9OzYdo8L1wjw2PrrpimONfmfNyzKklrgnEkSzT5QWYQW40YShyzqsRmMXbvVxKtGuYyMKaU1ugenLDm5Ily4iT14fP11Mx+xJv+zZ3MvnfdFqxU3a1W/FTB4m3Qfsyc1XUcdVhDeUDZXSFHHLQj/Y5jtC7ZqM0CXGwB4bP11i3LhOvzPGygYtiUBiwQV/4wFO0majijGsafHyRLu0yG6q35cL1rOpVxr2s5cM2jJYMCdc10Aj6q/blRpWJ//+dmm5psMl0KA2+AFRx9jMe2WbC4jQxnikd4DU8TwUjRVacgdlhmr3bpddzuJ9zXqr2xnxJfzP29RexdtjDVZqzkqa6PyvcojGrfkXiJ8SEtml/nYskicv0ivlxbqjemwUjMw5evdg8fUX9nOiC/lf94Q2i7MURk9nW1MSj5j8eAyV6y5CN2S6qbnw3vdA1Iwq+XOSCl663udN3IzLnrt+us25cI1+Z83SXQUldqQq0b5XOT17bGpLd6ssN1VMPf8c+jG8L3NeCnMdF+Ra3fRa9dft39/LuZ/3vwHoHrqGmQFafmiQw6eyzMxS05K4bL9uA+SKUQzCnSDkqOGokXyJvbgJ/BHI+qvY69//4rl20NsmK2ou2dTsyIALv/91/8n3P2Aao71WFGi8KKv1fRC5+J67Q/507/E/SOshqN5TsmYIjVt+kcjAx98iz/4SaojbIV1rexE7/C29HcYD/DX4a0rBOF5VTu7omsb11L/AWcVlcVZHSsqGuXLLp9ha8I//w3Mv+T4Ew7nTBsmgapoCrNFObIcN4pf/Ob/mrvHTGqqgAupL8qWjWPS9m/31jAe4DjA+4+uCoQoT/zOzlrNd3qd4SdphFxsUvYwGWbTWtISc3wNOWH+kHBMfc6kpmpwPgHWwqaSUG2ZWWheYOGQGaHB+eQ/kn6b3pOgLV+ODSn94wDvr8Bvb70/LLuiPPEr8OGVWfDmr45PZyccEmsVXZGe1pRNX9SU5+AVQkNTIVPCHF/jGmyDC9j4R9LfWcQvfiETmgMMUCMN1uNCakkweZsowdYobiMSlnKA93u7NzTXlSfe+SVbfnPQXmg9LpYAQxpwEtONyEyaueWM4FPjjyjG3uOaFmBTWDNgBXGEiQpsaWhnAqIijB07Dlsy3fUGeP989xbWkyf+FF2SNEtT1E0f4DYYVlxFlbaSMPIRMk/3iMU5pME2SIWJvjckciebkQuIRRyhUvkHg/iUljG5kzVog5hV7vIlCuBrmlhvgPfNHQM8lCf+FEGsYbMIBC0qC9a0uuy2wLXVbLBaP5kjHokCRxapkQyzI4QEcwgYHRZBp+XEFTqXFuNVzMtjXLJgX4gAid24Hjwc4N3dtVSe+NNiwTrzH4WVUOlDobUqr1FuAgYllc8pmzoVrELRHSIW8ViPxNy4xwjBpyR55I6J220qQTZYR4guvUICJiSpr9gFFle4RcF/OMB7BRiX8sSfhpNSO3lvEZCQfLUVTKT78Ek1LRLhWN+yLyTnp8qWUZ46b6vxdRGXfHVqx3eI75YaLa4iNNiK4NOW7wPW6lhbSOF9/M9qw8e/aoB3d156qTzxp8pXx5BKAsYSTOIIiPkp68GmTq7sZtvyzBQaRLNxIZ+paozHWoLFeExIhRBrWitHCAHrCF7/thhD8JhYz84wg93QRV88wLuLY8zF8sQ36qF1J455bOlgnELfshKVxYOXKVuKx0jaj22sczTQqPqtV/XDgpswmGTWWMSDw3ssyUunLLrVPGjYRsH5ggHeHSWiV8kT33ycFSfMgkoOK8apCye0J6VW6GOYvffgU9RWsukEi2kUV2nl4dOYUzRik9p7bcA4ggdJ53LxKcEe17B1R8eqAd7dOepV8sTXf5lhejoL85hUdhDdknPtKHFhljOT+bdq0hxbm35p2nc8+Ja1Iw+tJykgp0EWuAAZYwMVwac5KzYMslhvgHdHRrxKnvhTYcfKsxTxtTETkjHO7rr3zjoV25lAQHrqpV7bTiy2aXMmUhTBnKS91jhtR3GEoF0oLnWhWNnYgtcc4N0FxlcgT7yz3TgNIKkscx9jtV1ZKpWW+Ub1tc1eOv5ucdgpx+FJy9pgbLE7xDyXb/f+hLHVGeitHOi6A7ybo3sF8sS7w7cgdk0nJaOn3hLj3uyD0Zp5pazFIUXUpuTTU18d1EPkDoX8SkmWTnVIozEdbTcZjoqxhNHf1JrSS/AcvHjZ/SMHhL/7i5z+POsTUh/8BvNfYMTA8n+yU/MlTZxSJDRStqvEuLQKWwDctMTQogUDyQRoTQG5Kc6oQRE1yV1jCA7ri7jdZyK0sYTRjCR0Hnnd+y7nHxNgTULqw+8wj0mQKxpYvhjm9uSUxg+TTy7s2GtLUGcywhXSKZN275GsqlclX90J6bRI1aouxmgL7Q0Nen5ziM80SqMIo8cSOo+8XplT/5DHNWsSUr/6lLN/QQ3rDyzLruEW5enpf7KqZoShEduuSFOV7DLX7Ye+GmXb6/hnNNqKsVXuMDFpb9Y9eH3C6NGEzuOuI3gpMH/I6e+zDiH1fXi15t3vA1czsLws0TGEtmPEJdiiFPwlwKbgLHAFk4P6ZyPdymYYHGE0dutsChQBl2JcBFlrEkY/N5bQeXQ18gjunuMfMfsBlxJSx3niO485fwO4fGD5T/+3fPQqkneWVdwnw/3bMPkW9Wbqg+iC765Zk+xcT98ibKZc2EdgHcLoF8cSOo/Oc8fS+OyEULF4g4sJqXVcmfMfsc7A8v1/yfGXmL9I6Fn5pRwZhsPv0TxFNlAfZCvG+Oohi82UC5f/2IsJo0cTOm9YrDoKhFPEUr/LBYTUNht9zelHXDqwfPCIw4owp3mOcIQcLttWXFe3VZ/j5H3cIc0G6oPbCR+6Y2xF2EC5cGUm6wKC5tGEzhsWqw5hNidUiKX5gFWE1GXh4/Qplw4sVzOmx9QxU78g3EF6wnZlEN4FzJ1QPSLEZz1KfXC7vd8ssGdIbNUYpVx4UapyFUHzJoTOo1McSkeNn1M5MDQfs4qQuhhX5vQZFw8suwWTcyYTgioISk2YdmkhehG4PkE7w51inyAGGaU+uCXADabGzJR1fn3lwkty0asIo8cROm9Vy1g0yDxxtPvHDAmpu+PKnM8Ix1wwsGw91YJqhteaWgjYBmmQiebmSpwKKzE19hx7jkzSWOm66oPbzZ8Yj6kxVSpYjVAuvLzYMCRo3oTQecOOjjgi3NQ4l9K5/hOGhNTdcWVOTrlgYNkEXINbpCkBRyqhp+LdRB3g0OU6rMfW2HPCFFMV9nSp+uB2woepdbLBuJQyaw/ZFysXrlXwHxI0b0LovEkiOpXGA1Ijagf+KUNC6rKNa9bQnLFqYNkEnMc1uJrg2u64ELPBHpkgWbmwKpJoDhMwNbbGzAp7Yg31wS2T5rGtzit59PrKhesWG550CZpHEzpv2NGRaxlNjbMqpmEIzygJqQfjypycs2pg2cS2RY9r8HUqkqdEgKTWtWTKoRvOBPDYBltja2SO0RGjy9UHtxwRjA11ujbKF+ti5cIR9eCnxUg6owidtyoU5tK4NLji5Q3HCtiyF2IqLGYsHViOXTXOYxucDqG0HyttqYAKqYo3KTY1ekyDXRAm2AWh9JmsVh/ccg9WJ2E8YjG201sPq5ULxxX8n3XLXuMInbft2mk80rRGjCGctJ8/GFdmEQ9Ug4FlE1ll1Y7jtiraqm5Fe04VV8lvSVBL8hiPrfFVd8+7QH3Qbu2ipTVi8cvSGivc9cj8yvH11YMHdNSERtuOslM97feYFOPKzGcsI4zW0YGAbTAOaxCnxdfiYUmVWslxiIblCeAYr9VYR1gM7GmoPrilunSxxeT3DN/2eBQ9H11+nk1adn6VK71+5+Jfct4/el10/7KBZfNryUunWSCPxPECk1rdOv1WVSrQmpC+Tl46YD3ikQYcpunSQgzVB2VHFhxHVGKDgMEY5GLlQnP7FMDzw7IacAWnO6sBr12u+XanW2AO0wQ8pknnFhsL7KYIqhkEPmEXFkwaN5KQphbkUmG72wgw7WSm9RiL9QT925hkjiVIIhphFS9HKI6/8QAjlpXqg9W2C0apyaVDwKQwrwLY3j6ADR13ZyUNByQXHQu6RY09Hu6zMqXRaNZGS/KEJs0cJEe9VH1QdvBSJv9h09eiRmy0V2uJcqHcShcdvbSNg5fxkenkVprXM9rDVnX24/y9MVtncvbKY706anNl3ASll9a43UiacVquXGhvq4s2FP62NGKfQLIQYu9q1WmdMfmUrDGt8eDS0cXozH/fjmUH6Jruvm50hBDSaEU/2Ru2LEN/dl006TSc/g7tfJERxGMsgDUEr104pfWH9lQaN+M4KWQjwZbVc2rZVNHsyHal23wZtIs2JJqtIc/WLXXRFCpJkfE9jvWlfFbsNQ9pP5ZBS0zKh4R0aMFj1IjTcTnvi0Zz2rt7NdvQb2mgbju1plsH8MmbnEk7KbK0b+wC2iy3aX3szW8xeZvDwET6hWZYwqTXSSG+wMETKum0Dq/q+x62gt2ua2ppAo309TRk9TPazfV3qL9H8z7uhGqGqxNVg/FKx0HBl9OVUORn8Q8Jx9gFttGQUDr3tzcXX9xGgN0EpzN9mdZ3GATtPhL+CjxFDmkeEU6x56kqZRusLzALXVqkCN7zMEcqwjmywDQ6OhyUe0Xao1Qpyncrg6wKp9XfWDsaZplElvQ/b3sdweeghorwBDlHzgk1JmMc/wiERICVy2VJFdMjFuLQSp3S0W3+sngt2njwNgLssFGVQdJ0tu0KH4ky1LW4yrbkuaA6Iy9oz/qEMMXMMDWyIHhsAyFZc2peV9hc7kiKvfULxCl9iddfRK1f8kk9qvbdOoBtOg7ZkOZ5MsGrSHsokgLXUp9y88smniwWyuFSIRVmjplga3yD8Uij5QS1ZiM4U3Qw5QlSm2bXjFe6jzzBFtpg+/YBbLAWG7OPynNjlCw65fukGNdkJRf7yM1fOxVzbxOJVocFoYIaGwH22mIQkrvu1E2nGuebxIgW9U9TSiukPGU+Lt++c3DJPKhyhEEbXCQLUpae2exiKy6tMPe9mDRBFCEMTWrtwxN8qvuGnt6MoihKWS5NSyBhbH8StXoAz8PLOrRgLtOT/+4vcu+7vDLnqNvztOq7fmd8sMmY9Xzn1zj8Dq8+XVdu2Nv0IIySgEdQo3xVHps3Q5i3fLFsV4aiqzAiBhbgMDEd1uh8qZZ+lwhjkgokkOIv4xNJmyncdfUUzgB4oFMBtiu71Xumpz/P+cfUP+SlwFExwWW62r7b+LSPxqxn/gvMZ5z9C16t15UbNlq+jbGJtco7p8wbYlL4alSyfWdeuu0j7JA3JFNuVAwtst7F7FhWBbPFNKIUORndWtLraFLmMu7KFVDDOzqkeaiN33YAW/r76wR4XDN/yN1z7hejPau06EddkS/6XThfcz1fI/4K736fO48vlxt2PXJYFaeUkFS8U15XE3428xdtn2kc8GQlf1vkIaNRRnOMvLTWrZbElEHeLWi1o0dlKPAh1MVgbbVquPJ5+Cr8LU5/H/+I2QlHIU2ClXM9G8v7Rr7oc/hozfUUgsPnb3D+I+7WF8kNO92GY0SNvuxiE+2Bt8prVJTkzE64sfOstxuwfxUUoyk8VjcTlsqe2qITSFoSj6Epd4KsT6BZOWmtgE3hBfir8IzZDwgV4ZTZvD8VvPHERo8v+vL1DASHTz/i9OlKueHDjK5Rnx/JB1Vb1ioXdBra16dmt7dgik10yA/FwJSVY6XjA3oy4SqM2frqDPPSRMex9qs3XQtoWxMj7/Er8GWYsXgjaVz4OYumP2+9kbxvny/6kvWsEBw+fcb5bInc8APdhpOSs01tEqIkoiZjbAqKMruLbJYddHuHFRIyJcbdEdbl2sVLaySygunutBg96Y2/JjKRCdyHV+AEFtTvIpbKIXOamknYSiB6KV/0JetZITgcjjk5ZdaskBtWO86UF0ap6ozGXJk2WNiRUlCPFir66lzdm/SLSuK7EUdPz8f1z29Skq6F1fXg8+5UVR6bszncP4Tn4KUkkdJ8UFCY1zR1i8RmL/qQL3rlei4THG7OODlnKko4oI01kd3CaM08Ia18kC3GNoVaO9iDh+hWxSyTXFABXoau7Q6q9OxYg/OVEMw6jdbtSrJ9cBcewGmaZmg+bvkUnUUaGr+ZfnMH45Ivevl61hMcXsxYLFTu1hTm2zViCp7u0o5l+2PSUh9bDj6FgYypufBDhqK2+oXkiuHFHR3zfj+9PtA8oR0xnqX8qn+sx3bFODSbbF0X8EUvWQ8jBIcjo5bRmLOljDNtcqNtOe756h3l0VhKa9hDd2l1eqmsnh0MNMT/Cqnx6BInumhLT8luljzQ53RiJeA/0dxe5NK0o2fA1+GLXr6eNQWHNUOJssQaTRlGpLHKL9fD+IrQzTOMZS9fNQD4AnRNVxvTdjC+fJdcDDWQcyB00B0t9BDwTxXgaAfzDZ/DBXzRnfWMFRwuNqocOmX6OKNkY63h5n/fFcB28McVHqnXZVI27K0i4rDLNE9lDKV/rT+udVbD8dFFu2GGZ8mOt0kAXcoX3ZkIWVtw+MNf5NjR2FbivROHmhV1/pj2egv/fMGIOWTIWrV3Av8N9imV9IWml36H6cUjqEWNv9aNc+veb2sH46PRaHSuMBxvtW+twxctq0z+QsHhux8Q7rCY4Ct8lqsx7c6Sy0dl5T89rIeEuZKoVctIk1hNpfavER6yyH1Vvm3MbsUHy4ab4hWr/OZPcsRBphnaV65/ZcdYPNNwsjN/djlf9NqCw9U5ExCPcdhKxUgLSmfROpLp4WSUr8ojdwbncbvCf+a/YzRaEc6QOvXcGO256TXc5Lab9POvB+AWY7PigWYjzhifbovuunzRawsO24ZqQQAqguBtmpmPB7ysXJfyDDaV/aPGillgz1MdQg4u5MYaEtBNNHFjkRlSpd65lp4hd2AVPTfbV7FGpyIOfmNc/XVsPfg7vzaS/3nkvLL593ANLvMuRMGpQIhiF7kUEW9QDpAUbTWYBcbp4WpacHHY1aacqQyjGZS9HI3yCBT9kUZJhVOD+zUDvEH9ddR11fzPcTDQ5TlgB0KwqdXSavk9BC0pKp0WmcuowSw07VXmXC5guzSa4p0UvRw2lbDiYUx0ExJJRzWzi6Gm8cnEkfXXsdcG/M/jAJa0+bmCgdmQ9CYlNlSYZOKixmRsgiFxkrmW4l3KdFKv1DM8tk6WxPYJZhUUzcd8Kdtgrw/gkfXXDT7+avmfVak32qhtkg6NVdUS5wgkru1YzIkSduTW1FDwVWV3JQVJVuieTc0y4iDpFwc7/BvSalvKdQM8sv662cevz/+8sQVnjVAT0W2wLllw1JiMhJRxgDjCjLQsOzSFSgZqx7lAW1JW0e03yAD3asC+GD3NbQhbe+mN5GXH1F83KDOM4n/e5JIuH4NpdQARrFPBVptUNcjj4cVMcFSRTE2NpR1LEYbYMmfWpXgP9KejaPsLUhuvLCsVXznAG9dfx9SR1ud/3hZdCLHb1GMdPqRJgqDmm76mHbvOXDtiO2QPUcKo/TWkQ0i2JFXpBoo7vij1i1Lp3ADAo+qvG3V0rM//vFnnTE4hxd5Ka/Cor5YEdsLVJyKtDgVoHgtW11pWSjolPNMnrlrVj9Fv2Qn60twMwKPqr+N/wvr8z5tZcDsDrv06tkqyzESM85Ycv6XBWA2birlNCXrI6VbD2lx2L0vQO0QVTVVLH4SE67fgsfVXv8n7sz7/85Z7cMtbE6f088wSaR4kCkCm10s6pKbJhfqiUNGLq+0gLWC6eUAZFPnLjwqtKd8EwGvWX59t7iPW4X/eAN1svgRVSY990YZg06BD1ohLMtyFTI4pKTJsS9xREq9EOaPWiO2gpms7397x6nQJkbh+Fz2q/rqRROX6/M8bJrqlVW4l6JEptKeUFuMYUbtCQ7CIttpGc6MY93x1r1vgAnRXvY5cvwWPqb9uWQm+lP95QxdNMeWhOq1x0Db55C7GcUv2ZUuN6n8iKzsvOxibC//Yfs9Na8r2Rlz02vXXDT57FP/zJi66/EJSmsJKa8QxnoqW3VLQ+jZVUtJwJ8PNX1NQCwfNgdhhHD9on7PdRdrdGPF28rJr1F+3LBdeyv+8yYfLoMYet1vX4upNAjVvwOUWnlNXJXlkzk5Il6kqeoiL0C07qno+/CYBXq/+utlnsz7/Mzvy0tmI4zm4ag23PRN3t/CWryoUVJGm+5+K8RJ0V8Hc88/XHUX/HfiAq7t+BH+x6v8t438enWmdJwFA6ZINriLGKv/95f8lT9/FnyA1NMVEvQyaXuu+gz36f/DD73E4pwqpLcvm/o0Vle78n//+L/NPvoefp1pTJye6e4A/D082FERa5/opeH9zpvh13cNm19/4v/LDe5xMWTi8I0Ta0qKlK27AS/v3/r+/x/2GO9K2c7kVMonDpq7//jc5PKCxeNPpFVzaRr01wF8C4Pu76hXuX18H4LduTr79guuFD3n5BHfI+ZRFhY8w29TYhbbLi/bvBdqKE4fUgg1pBKnV3FEaCWOWyA+m3WpORZr/j+9TKJtW8yBTF2/ZEODI9/QavHkVdGFp/Pjn4Q+u5hXapsP5sOH+OXXA1LiKuqJxiMNbhTkbdJTCy4llEt6NnqRT4dhg1V3nbdrm6dYMecA1yTOL4PWTE9L5VzPFlLBCvlG58AhehnN4uHsAYinyJ+AZ/NkVvELbfOBUuOO5syBIEtiqHU1k9XeISX5bsimrkUUhnGDxourN8SgUsCZVtKyGbyGzHXdjOhsAvOAswSRyIBddRdEZWP6GZhNK/yjwew9ehBo+3jEADu7Ay2n8mDc+TS7awUHg0OMzR0LABhqLD4hJEh/BEGyBdGlSJoXYXtr+3HS4ijzVpgi0paWXtdruGTknXBz+11qT1Q2inxaTzQCO46P3lfLpyS4fou2PH/PupwZgCxNhGlj4IvUuWEsTkqMWm6i4xCSMc9N1RDQoCVcuGItJ/MRWefais+3synowi/dESgJjkilnWnBTGvRWmaw8oR15257t7CHmCf8HOn7cwI8+NQBXMBEmAa8PMRemrNCEhLGEhDQKcGZWS319BX9PFBEwGTbRBhLbDcaV3drFcDqk5kCTd2JF1Wp0HraqBx8U0wwBTnbpCadwBA/gTH/CDrcCs93LV8E0YlmmcyQRQnjBa8JESmGUfIjK/7fkaDJpmD2QptFNVJU1bbtIAjjWQizepOKptRjbzR9Kag6xZmMLLjHOtcLT3Tx9o/0EcTT1XN3E45u24AiwEypDJXihKjQxjLprEwcmRKclaDNZCVqr/V8mYWyFADbusiY5hvgFoU2vio49RgJLn5OsReRFN6tabeetiiy0V7KFHT3HyZLx491u95sn4K1QQSPKM9hNT0wMVvAWbzDSVdrKw4zRjZMyJIHkfq1VAVCDl/bUhNKlGq0zGr05+YAceXVPCttVk0oqjVwMPt+BBefx4yPtGVkUsqY3CHDPiCM5ngupUwCdbkpd8kbPrCWHhkmtIKLEetF2499eS1jZlIPGYnlcPXeM2KD9vLS0bW3ktYNqUllpKLn5ZrsxlIzxvDu5eHxzGLctkZLEY4PgSOg2IUVVcUONzUDBEpRaMoXNmUc0tFZrTZquiLyKxrSm3DvIW9Fil+AkhXu5PhEPx9mUNwqypDvZWdKlhIJQY7vn2OsnmBeOWnYZ0m1iwbbw1U60by5om47iHRV6fOgzjMf/DAZrlP40Z7syxpLK0lJ0gqaAK1c2KQKu7tabTXkLFz0sCftuwX++MyNeNn68k5Buq23YQhUh0SNTJa1ioQ0p4nUG2y0XilF1JqODqdImloPS4Bp111DEWT0jJjVv95uX9BBV7eB3bUWcu0acSVM23YZdd8R8UbQUxJ9wdu3oMuhdt929ME+mh6JXJ8di2RxbTi6TbrDquqV4aUKR2iwT6aZbyOwEXN3DUsWr8Hn4EhwNyHuXHh7/pdaUjtR7vnDh/d8c9xD/s5f501eQ1+CuDiCvGhk1AN/4Tf74RfxPwD3toLarR0zNtsnPzmS64KIRk861dMWCU8ArasG9T9H0ZBpsDGnjtAOM2+/LuIb2iIUGXNgl5ZmKD/Tw8TlaAuihaFP5yrw18v4x1898zIdP+DDAX1bM3GAMvPgRP/cJn3zCW013nrhHkrITyvYuwOUkcHuKlRSW5C6rzIdY4ppnF7J8aAJbQepgbJYBjCY9usGXDKQxq7RZfh9eg5d1UHMVATRaD/4BHK93/1iAgYZ/+jqPn8Dn4UExmWrpa3+ZOK6MvM3bjwfzxNWA2dhs8+51XHSPJiaAhGSpWevEs5xHLXcEGFXYiCONySH3fPWq93JIsBiSWvWyc3CAN+EcXoT7rCSANloPPoa31rt/5PUA/gp8Q/jDD3hyrjzlR8VkanfOvB1XPubt17vzxAfdSVbD1pzAnfgyF3ycadOTOTXhpEUoLC1HZyNGW3dtmjeXgr2r56JNmRwdNNWaQVBddd6rh4MhviEB9EFRD/7RGvePvCbwAL4Mx/D6M541hHO4D3e7g6PafdcZVw689z7NGTwo5om7A8sPhccT6qKcl9NJl9aM/9kX+e59Hh1yPqGuCCZxuITcsmNaJ5F7d0q6J3H48TO1/+M57085q2icdu2U+W36Ldllz9Agiv4YGljoEN908EzvDOrBF98/vtJwCC/BF2AG75xxEmjmMIcjxbjoaxqOK3/4hPOZzhMPBpYPG44CM0dTVm1LjLtUWWVz1Bcf8tEx0zs8O2A2YVHRxKYOiy/aOVoAaMu0i7ubu43njjmd4ibMHU1sIDHaQNKrZND/FZYdk54oCXetjq7E7IVl9eAL7t+oHnwXXtLx44czzoRFHBztYVwtH1d+NOMkupZ5MTM+gUmq90X+Bh9zjRlmaQ+m7YMqUL/veemcecAtOJ0yq1JnVlN27di2E0+Klp1tAJ4KRw1eMI7aJjsO3R8kPSI3fUFXnIOfdQe86sIIVtWDL7h//Ok6vj8vwDk08NEcI8zz7OhBy+WwalzZeZ4+0XniRfst9pAJqQHDGLzVQ2pheZnnv1OWhwO43/AgcvAEXEVVpa4db9sGvNK8wjaENHkfFQ4Ci5i7dqnQlPoLQrHXZDvO3BIXZbJOBrOaEbML6sFL798I4FhKihjHMsPjBUZYCMFr6nvaArxqXPn4lCa+cHfSa2cP27g3Z3ziYTRrcbQNGLQmGF3F3cBdzzzX7AILx0IB9rbwn9kx2G1FW3Inic+ZLIsVvKR8Zwfj0l1fkqo8LWY1M3IX14OX3r9RKTIO+d9XzAI8qRPGPn/4NC2n6o4rN8XJ82TOIvuVA8zLKUHRFgBCetlDZlqR1gLKjS39xoE7Bt8UvA6BxuEDjU3tFsEijgA+615tmZkXKqiEENrh41iLDDZNq4pKTWR3LZfnos81LOuNa15cD956vLMsJd1rqYp51gDUQqMYm2XsxnUhD2jg1DM7SeuJxxgrmpfISSXVIJIS5qJJSvJPEQ49DQTVIbYWJ9QWa/E2+c/oPK1drmC7WSfJRNKBO5Yjvcp7Gc3dmmI/Xh1kDTEuiSnWqQf37h+fTMhGnDf6dsS8SQfQWlqqwXXGlc/PEZ/SC5mtzIV0nAshlQdM/LvUtYutrEZ/Y+EAFtq1k28zQhOwLr1AIeANzhF8t9qzTdZf2qRKO6MWE9ohBYwibbOmrFtNmg3mcS+tB28xv2uKd/agYCvOP+GkSc+0lr7RXzyufL7QbkUpjLjEWFLqOIkAGu2B0tNlO9Eau2W1qcOUvVRgKzypKIQZ5KI3q0MLzqTNRYqiZOqmtqloIRlmkBHVpHmRYV6/HixbO6UC47KOFJnoMrVyr7wYz+SlW6GUaghYbY1I6kkxA2W1fSJokUdSh2LQ1GAimRGm0MT+uu57H5l7QgOWxERpO9moLRPgTtquWCfFlGlIjQaRly9odmzMOWY+IBO5tB4sW/0+VWGUh32qYk79EidWKrjWuiLpiVNGFWFRJVktyeXWmbgBBzVl8anPuXyNJlBJOlKLTgAbi/EYHVHxWiDaVR06GnHQNpJcWcK2jJtiCfG2sEHLzuI66sGrMK47nPIInPnu799935aOK2cvmvubrE38ZzZjrELCmXM2hM7UcpXD2oC3+ECVp7xtIuxptJ0jUr3sBmBS47TVxlvJ1Sqb/E0uLdvLj0lLr29ypdd/eMX3f6lrxGlKwKQxEGvw0qHbkbwrF3uHKwVENbIV2wZ13kNEF6zD+x24aLNMfDTCbDPnEikZFyTNttxWBXDaBuM8KtI2rmaMdUY7cXcUPstqTGvBGSrFWIpNMfbdea990bvAOC1YX0qbc6smDS1mPxSJoW4fwEXvjMmhlijDRq6qale6aJEuFGoppYDoBELQzLBuh/mZNx7jkinv0EtnUp50lO9hbNK57lZaMAWuWR5Yo9/kYwcYI0t4gWM47Umnl3YmpeBPqSyNp3K7s2DSAS/39KRuEN2bS4xvowV3dFRMx/VFcp2Yp8w2nTO9hCXtHG1kF1L4KlrJr2wKfyq77R7MKpFKzWlY9UkhYxyHWW6nBWPaudvEAl3CGcNpSXPZ6R9BbBtIl6cHL3gIBi+42CYXqCx1gfGWe7Ap0h3luyXdt1MKy4YUT9xSF01G16YEdWsouW9mgDHd3veyA97H+Ya47ZmEbqMY72oPztCGvK0onL44AvgC49saZKkWRz4veWljE1FHjbRJaWv6ZKKtl875h4CziFCZhG5rx7tefsl0aRT1bMHZjm8dwL/6u7wCRysaQblQoG5yAQN5zpatMNY/+yf8z+GLcH/Qn0iX2W2oEfXP4GvwQHuIL9AYGnaO3zqAX6946nkgqZNnUhx43DIdQtMFeOPrgy/y3Yd85HlJWwjLFkU3kFwq28xPnuPhMWeS+tDLV9Otllq7pQCf3uXJDN9wFDiUTgefHaiYbdfi3b3u8+iY6TnzhgehI1LTe8lcd7s1wJSzKbahCRxKKztTLXstGAiu3a6rPuQs5pk9TWAan5f0BZmGf7Ylxzzk/A7PAs4QPPPAHeFQ2hbFHszlgZuKZsJcUmbDC40sEU403cEjczstOEypa+YxevL4QBC8oRYqWdK6b7sK25tfE+oDZgtOQ2Jg8T41HGcBE6fTWHn4JtHcu9S7uYgU5KSCkl/mcnq+5/YBXOEr6lCUCwOTOM1taOI8mSxx1NsCXBEmLKbMAg5MkwbLmpBaFOPrNSlO2HnLiEqW3tHEwd8AeiQLmn+2gxjC3k6AxREqvKcJbTEzlpLiw4rNZK6oJdidbMMGX9FULKr0AkW+2qDEPBNNm5QAt2Ik2nftNWHetubosHLo2nG4vQA7GkcVCgVCgaDixHqo9UUn1A6OshapaNR/LPRYFV8siT1cCtJE0k/3WtaNSuUZYKPnsVIW0xXWnMUxq5+En4Kvw/MqQmVXnAXj9Z+9zM98zM/Agy7F/qqj2Nh67b8HjFnPP3iBn/tkpdzwEJX/whIcQUXOaikeliCRGUk7tiwF0rItwMEhjkZ309hikFoRAmLTpEXWuHS6y+am/KB/fM50aLEhGnSMwkpxzOov4H0AvgovwJ1iGzDLtJn/9BU+fAINfwUe6FHSLhu83viV/+/HrOePX+STT2B9uWGbrMHHLldRBlhS/CJQmcRxJFqZica01XixAZsYiH1uolZxLrR/SgxVIJjkpQP4PE9sE59LKLr7kltSBogS5tyszzH8Fvw8/AS8rNOg0xUS9fIaHwb+6et8Q/gyvKRjf5OusOzGx8evA/BP4IP11uN/grca5O0lcsPLJ5YjwI4QkJBOHa0WdMZYGxPbh2W2nR9v3WxEWqgp/G3+6VZbRLSAAZ3BhdhAaUL33VUSw9yjEsvbaQ9u4A/gGXwZXoEHOuU1GSj2chf+Mo+f8IcfcAxfIKVmyunRbYQVnoevwgfw3TXXcw++xNuP4fhyueEUNttEduRVaDttddoP0eSxLe2LENk6itYxlrxBNBYrNNKSQmeaLcm9c8UsaB5WyO6675yyQIAWSDpBVoA/gxmcwEvwoDv0m58UE7gHn+fJOa8/Ywan8EKRfjsopF83eCglX/Sfr7OeaRoQfvt1CGvIDccH5BCvw1sWIzRGC/66t0VTcLZQZtm6PlAasbOJ9iwWtUo7biktTSIPxnR24jxP1ZKaqq+2RcXM9OrBAm/AAs7hDJ5bNmGb+KIfwCs8a3jnjBrOFeMjHSCdbKr+2uOLfnOd9eiA8Hvvwwq54VbP2OqwkB48Ytc4YEOiH2vTXqodabfWEOzso4qxdbqD5L6tbtNPECqbhnA708DZH4QOJUXqScmUlks7Ot6FBuZw3n2mEbaUX7kDzxHOOQk8nKWMzAzu6ZZ8sOFw4RK+6PcuXo9tB4SbMz58ApfKDXf3szjNIIbGpD5TKTRxGkEMLjLl+K3wlWXBsCUxIDU+jbOiysESqAy1MGUJpXgwbTWzNOVEziIXZrJ+VIztl1PUBxTSo0dwn2bOmfDRPD3TRTGlfbCJvO9KvuhL1hMHhB9wPuPRLGHcdOWG2xc0U+5bQtAJT0nRTewXL1pgk2+rZAdeWmz3jxAqfNQQdzTlbF8uJ5ecEIWvTkevAHpwz7w78QujlD/Lr491bD8/1vhM2yrUQRrWXNQY4fGilfctMWYjL72UL/qS9eiA8EmN88nbNdour+PBbbAjOjIa4iBhfFg6rxeKdEGcL6p3EWR1Qq2Qkhs2DrnkRnmN9tG2EAqmgPw6hoL7Oza7B+3SCrR9tRftko+Lsf2F/mkTndN2LmzuMcKTuj/mX2+4Va3ki16+nnJY+S7MefpkidxwnV+4wkXH8TKnX0tsYzYp29DOOoSW1nf7nTh2akYiWmcJOuTidSaqESrTYpwjJJNVGQr+rLI7WsqerHW6Kp/oM2pKuV7T1QY9gjqlZp41/WfKpl56FV/0kvXQFRyeQ83xaTu5E8p5dNP3dUF34ihyI3GSpeCsywSh22ZJdWto9winhqifb7VRvgktxp13vyjrS0EjvrRfZ62uyqddSWaWYlwTPAtJZ2oZ3j/Sgi/mi+6vpzesfAcWNA0n8xVyw90GVFGuZjTXEQy+6GfLGLMLL523f5E0OmxVjDoOuRiH91RKU+vtoCtH7TgmvBLvtFXWLW15H9GTdVw8ow4IlRLeHECN9ym1e9K0I+Cbnhgv4Yu+aD2HaQJ80XDqOzSGAV4+4yCqBxrsJAX6ZTIoX36QnvzhhzzMfFW2dZVLOJfo0zbce5OvwXMFaZ81mOnlTVXpDZsQNuoYWveketKb5+6JOOsgX+NTm7H49fUTlx+WLuWL7qxnOFh4BxpmJx0p2gDzA/BUARuS6phR+pUsY7MMboAHx5xNsSVfVZcYSwqCKrqon7zM+8ecCkeS4nm3rINuaWvVNnMRI1IRpxTqx8PZUZ0Br/UEduo3B3hNvmgZfs9gQPj8vIOxd2kndir3awvJ6BLvoUuOfFWNYB0LR1OQJoUySKb9IlOBx74q1+ADC2G6rOdmFdJcD8BkfualA+BdjOOzP9uUhGUEX/TwhZsUduwRr8wNuXKurCixLBgpQI0mDbJr9dIqUuV+92ngkJZ7xduCk2yZKbfWrH1VBiTg9VdzsgRjW3CVXCvAwDd+c1z9dWw9+B+8MJL/eY15ZQ/HqvTwVdsZn5WQsgRRnMaWaecu3jFvMBEmgg+FJFZsnSl0zjB9OqPYaBD7qmoVyImFvzi41usesV0julaAR9dfR15Xzv9sEruRDyk1nb+QaLU67T885GTls6YgcY+UiMa25M/pwGrbCfzkvR3e0jjtuaFtnwuagHTSb5y7boBH119HXhvwP487jJLsLJ4XnUkHX5sLbS61dpiAXRoZSCrFJ+EjpeU3puVfitngYNo6PJrAigKktmwjyQdZpfq30mmtulaAx9Zfx15Xzv+cyeuiBFUs9zq8Kq+XB9a4PVvph3GV4E3y8HENJrN55H1X2p8VyqSKwVusJDKzXOZzplWdzBUFK9e+B4+uv468xvI/b5xtSAkBHQaPvtqWzllVvEOxPbuiE6+j2pvjcKsbvI7txnRErgfH7LdXqjq0IokKzga14GzQ23SSbCQvO6r+Or7SMIr/efOkkqSdMnj9mBx2DRsiY29Uj6+qK9ZrssCKaptR6HKURdwUYeUWA2kPzVKQO8ku2nU3Anhs/XWkBx3F/7wJtCTTTIKftthue1ty9xvNYLY/zo5KSbIuKbXpbEdSyeRyYdAIwKY2neyoc3+k1XUaufYga3T9daMUx/r8z1s10ITknIO0kuoMt+TB8jK0lpayqqjsJ2qtXAYwBU932zinimgmd6mTRDnQfr88q36NAI+tv24E8Pr8zxtasBqx0+xHH9HhlrwsxxNUfKOHQaZBITNf0uccj8GXiVmXAuPEAKSdN/4GLHhs/XWj92dN/uetNuBMnVR+XWDc25JLjo5Mg5IZIq226tmCsip2zZliL213YrTlL2hcFjpCduyim3M7/eB16q/blQsv5X/esDRbtJeabLIosWy3ycavwLhtxdWzbMmHiBTiVjJo6lCLjXZsi7p9PEPnsq6X6wd4bP11i0rD5fzPm/0A6brrIsllenZs0lCJlU4abakR59enZKrKe3BZihbTxlyZ2zl1+g0wvgmA166/bhwDrcn/7Ddz0eWZuJvfSESug6NzZsox3Z04FIxz0mUjMwVOOVTq1CQ0AhdbBGVdjG/CgsfUX7esJl3K/7ytWHRv683praW/8iDOCqWLLhpljDY1ZpzK75QiaZoOTpLKl60auHS/97oBXrv+umU9+FL+5+NtLFgjqVLCdbmj7pY5zPCPLOHNCwXGOcLquOhi8CmCWvbcuO73XmMUPab+ug3A6/A/78Bwe0bcS2+tgHn4J5pyS2WbOck0F51Vq3LcjhLvZ67p1ABbaL2H67bg78BfjKi/jr3+T/ABV3ilLmNXTI2SpvxWBtt6/Z//D0z/FXaGbSBgylzlsEGp+5//xrd4/ae4d8DUUjlslfIYS3t06HZpvfQtvv0N7AHWqtjP2pW08QD/FLy//da38vo8PNlKHf5y37Dxdfe/oj4kVIgFq3koLReSR76W/bx//n9k8jonZxzWTANVwEniDsg87sOSd/z7//PvMp3jQiptGVWFX2caezzAXwfgtzYUvbr0iozs32c3Uge7varH+CNE6cvEYmzbPZ9hMaYDdjK4V2iecf6EcEbdUDVUARda2KzO/JtCuDbNQB/iTeL0EG1JSO1jbXS+nLxtPMDPw1fh5+EPrgSEKE/8Gry5A73ui87AmxwdatyMEBCPNOCSKUeRZ2P6Myb5MRvgCHmA9ywsMifU+AYXcB6Xa5GibUC5TSyerxyh0j6QgLVpdyhfArRTTLqQjwe4HOD9s92D4Ap54odXAPBWLAwB02igG5Kkc+piN4lvODIFGAZgT+EO4Si1s7fjSR7vcQETUkRm9O+MXyo9OYhfe4xt9STQ2pcZRLayCV90b4D3jR0DYAfyxJ+eywg2IL7NTMXna7S/RpQ63JhWEM8U41ZyQGjwsVS0QBrEKLu8xwZsbi4wLcCT+OGidPIOCe1PiSc9Qt+go+vYqB7cG+B9d8cAD+WJPz0Am2gxXgU9IneOqDpAAXOsOltVuMzpdakJXrdPCzXiNVUpCeOos5cxnpQT39G+XVLhs1osQVvJKPZyNq8HDwd4d7pNDuWJPxVX7MSzqUDU6gfadKiNlUFTzLeFHHDlzO4kpa7aiKhBPGKwOqxsBAmYkOIpipyXcQSPlRTf+Tii0U3EJGaZsDER2qoB3h2hu0qe+NNwUooYU8y5mILbJe6OuX+2FTKy7bieTDAemaQyQ0CPthljSWO+xmFDIYiESjM5xKd6Ik5lvLq5GrQ3aCMLvmCA9wowLuWJb9xF59hVVP6O0CrBi3ZjZSNOvRy+I6klNVRJYRBaEzdN+imiUXQ8iVF8fsp+W4JXw7WISW7fDh7lptWkCwZ4d7QTXyBPfJMYK7SijjFppGnlIVJBJBYj7eUwtiP1IBXGI1XCsjNpbjENVpSAJ2hq2LTywEly3hUYazt31J8w2+aiLx3g3fohXixPfOMYm6zCGs9LVo9MoW3MCJE7R5u/WsOIjrqBoHUO0bJE9vxBpbhsd3+Nb4/vtPCZ4oZYCitNeYuC/8UDvDvy0qvkiW/cgqNqRyzqSZa/s0mqNGjtKOoTm14zZpUauiQgVfqtQiZjq7Q27JNaSK5ExRcrGCXO1FJYh6jR6CFqK7bZdQZ4t8g0rSlPfP1RdBtqaa9diqtzJkQ9duSryi2brQXbxDwbRUpFMBHjRj8+Nt7GDKgvph9okW7LX47gu0SpGnnFQ1S1lYldOsC7hYteR574ZuKs7Ei1lBsfdz7IZoxzzCVmmVqaSySzQbBVAWDek+N4jh9E/4VqZrJjPwiv9BC1XcvOWgO8275CVyBPvAtTVlDJfZkaZGU7NpqBogAj/xEHkeAuJihWYCxGN6e8+9JtSegFXF1TrhhLGP1fak3pebgPz192/8gB4d/6WT7+GdYnpH7hH/DJzzFiYPn/vjW0SgNpTNuPIZoAEZv8tlGw4+RLxy+ZjnKa5NdFoC7UaW0aduoYse6+bXg1DLg6UfRYwmhGEjqPvF75U558SANrElK/+MdpXvmqBpaXOa/MTZaa1DOcSiLaw9j0NNNst3c+63c7EKTpkvKHzu6bPbP0RkuHAVcbRY8ijP46MIbQeeT1mhA+5PV/inyDdQipf8LTvMXbwvoDy7IruDNVZKTfV4CTSRUYdybUCnGU7KUTDxLgCknqUm5aAW6/1p6eMsOYsphLzsHrE0Y/P5bQedx1F/4yPHnMB3/IOoTU9+BL8PhtjuFKBpZXnYNJxTuv+2XqolKR2UQgHhS5novuxVySJhBNRF3SoKK1XZbbXjVwWNyOjlqWJjrWJIy+P5bQedyldNScP+HZ61xKSK3jyrz+NiHG1hcOLL/+P+PDF2gOkekKGiNWKgJ+8Z/x8Iv4DdQHzcpZyF4v19I27w9/yPGDFQvmEpKtqv/TLiWMfn4sofMm9eAH8Ao0zzh7h4sJqYtxZd5/D7hkYPneDzl5idlzNHcIB0jVlQ+8ULzw/nc5/ojzl2juE0apD7LRnJxe04dMz2iOCFNtGFpTuXA5AhcTRo8mdN4kz30nVjEC4YTZQy4gpC7GlTlrePKhGsKKgeXpCYeO0MAd/GH7yKQUlXPLOasOH3FnSphjHuDvEu4gB8g66oNbtr6eMbFIA4fIBJkgayoXriw2XEDQPJrQeROAlY6aeYOcMf+IVYTU3XFlZufMHinGywaW3YLpObVBAsbjF4QJMsVUSayjk4voPsHJOQfPWDhCgDnmDl6XIRerD24HsGtw86RMHOLvVSHrKBdeVE26gKB5NKHzaIwLOmrqBWJYZDLhASG16c0Tn+CdRhWDgWXnqRZUTnPIHuMJTfLVpkoYy5CzylHVTGZMTwkGAo2HBlkQplrJX6U+uF1wZz2uwS1SQ12IqWaPuO4baZaEFBdukksJmkcTOm+YJSvoqPFzxFA/YUhIvWxcmSdPWTWwbAKVp6rxTtPFUZfKIwpzm4IoMfaYQLWgmlG5FME2gdBgm+J7J+rtS/XBbaVLsR7bpPQnpMFlo2doWaVceHk9+MkyguZNCJ1He+kuHTWyQAzNM5YSUg/GlTk9ZunAsg1qELVOhUSAK0LABIJHLKbqaEbHZLL1VA3VgqoiOKXYiS+HRyaEKgsfIqX64HYWbLRXy/qWoylIV9gudL1OWBNgBgTNmxA6b4txDT4gi3Ri7xFSLxtXpmmYnzAcWDZgY8d503LFogz5sbonDgkKcxGsWsE1OI+rcQtlgBBCSOKD1mtqYpIU8cTvBmAT0yZe+zUzeY92fYjTtGipXLhuR0ePoHk0ofNWBX+lo8Z7pAZDk8mEw5L7dVyZZoE/pTewbI6SNbiAL5xeygW4xPRuLCGbhcO4RIeTMFYHEJkYyEO9HmJfXMDEj/LaH781wHHZEtqSQ/69UnGpzH7LKIAZEDSPJnTesJTUa+rwTepI9dLJEawYV+ZkRn9g+QirD8vF8Mq0jFQ29js6kCS3E1+jZIhgPNanHdHFqFvPJLHqFwQqbIA4jhDxcNsOCCQLDomaL/dr5lyJaJU6FxPFjO3JOh3kVMcROo8u+C+jo05GjMF3P3/FuDLn5x2M04xXULPwaS6hBYki+MrMdZJSgPHlcB7nCR5bJ9Kr5ACUn9jk5kivdd8tk95SOGrtqu9lr2IhK65ZtEl7ZKrp7DrqwZfRUSN1el7+7NJxZbywOC8neNKTch5vsTEMNsoCCqHBCqIPRjIPkm0BjvFODGtto99rCl+d3wmHkW0FPdpZtC7MMcVtGFQjJLX5bdQ2+x9ypdc313uj8xlsrfuLgWXz1cRhZvJYX0iNVBRcVcmCXZs6aEf3RQF2WI/TcCbKmGU3IOoDJGDdDub0+hYckt6PlGu2BcxmhbTdj/klhccLGJMcqRjMJP1jW2ETqLSWJ/29MAoORluJ+6LPffBZbi5gqi5h6catQpmOT7/OFf5UorRpLzCqcMltBLhwd1are3kztrSzXO0LUbXRQcdLh/RdSZ+swRm819REDrtqzC4es6Gw4JCKlSnjYVpo0xeq33PrADbFLL3RuCmObVmPN+24kfa+AojDuM4umKe2QwCf6EN906HwjujaitDs5o0s1y+k3lgbT2W2i7FJdnwbLXhJUBq/9liTctSmFC/0OqUinb0QddTWamtjbHRFuWJJ6NpqZ8vO3fZJ37Db+2GkaPYLGHs7XTTdiFQJ68SkVJFVmY6McR5UycflNCsccHFaV9FNbR4NttLxw4pQ7wJd066Z0ohVbzihaxHVExd/ay04oxUKWt+AsdiQ9OUyZ2krzN19IZIwafSTFgIBnMV73ADj7V/K8u1MaY2sJp2HWm0f41tqwajEvdHWOJs510MaAqN4aoSiPCXtN2KSi46dUxHdaMquar82O1x5jqhDGvqmoE9LfxcY3zqA7/x3HA67r9ZG4O6Cuxu12/+TP+eLP+I+HErqDDCDVmBDO4larujNe7x8om2rMug0MX0rL1+IWwdwfR+p1TNTyNmVJ85ljWzbWuGv8/C7HD/izjkHNZNYlhZcUOKVzKFUxsxxN/kax+8zPWPSFKw80rJr9Tizyj3o1gEsdwgWGoxPezDdZ1TSENE1dLdNvuKL+I84nxKesZgxXVA1VA1OcL49dFlpFV5yJMhzyCmNQ+a4BqusPJ2bB+xo8V9u3x48VVIEPS/mc3DvAbXyoYr6VgDfh5do5hhHOCXMqBZUPhWYbWZECwVJljLgMUWOCB4MUuMaxGNUQDVI50TQ+S3kFgIcu2qKkNSHVoM0SHsgoZxP2d5HH8B9woOk4x5bPkKtAHucZsdykjxuIpbUrSILgrT8G7G5oCW+K0990o7E3T6AdW4TilH5kDjds+H64kS0mz24grtwlzDHBJqI8YJQExotPvoC4JBq0lEjjQkyBZ8oH2LnRsQ4Hu1QsgDTJbO8fQDnllitkxuVskoiKbRF9VwzMDvxHAdwB7mD9yCplhHFEyUWHx3WtwCbSMMTCUCcEmSGlg4gTXkHpZXWQ7kpznK3EmCHiXInqndkQjunG5kxTKEeGye7jWz9cyMR2mGiFQ15ENRBTbCp+Gh86vAyASdgmJq2MC6hoADQ3GosP0QHbnMHjyBQvQqfhy/BUbeHd5WY/G/9LK/8Ka8Jd7UFeNWEZvzPb458Dn8DGLOe3/wGL/4xP+HXlRt+M1PE2iLhR8t+lfgxsuh7AfO2AOf+owWhSZRYQbd622hbpKWKuU+XuvNzP0OseRDa+mObgDHJUSc/pKx31QdKffQ5OIJpt8GWjlgTwMc/w5MPCR/yl1XC2a2Yut54SvOtMev55Of45BOat9aWG27p2ZVORRvnEk1hqWMVUmqa7S2YtvlIpspuF1pt0syuZS2NV14mUidCSfzQzg+KqvIYCMljIx2YK2AO34fX4GWdu5xcIAb8MzTw+j/lyWM+Dw/gjs4GD6ehNgA48kX/AI7XXM/XAN4WHr+9ntywqoCakCqmKP0rmQrJJEErG2Upg1JObr01lKQy4jskWalKYfJ/EDLMpjNSHFEUAde2fltaDgmrNaWQ9+AAb8I5vKjz3L1n1LriB/BXkG/wwR9y/oRX4LlioHA4LzP2inzRx/DWmutRweFjeP3tNeSGlaE1Fde0OS11yOpmbIp2u/jF1n2RRZviJM0yBT3IZl2HWImKjQOxIyeU325b/qWyU9Moj1o07tS0G7qJDoGHg5m8yeCxMoEH8GU45tnrNM84D2l297DQ9t1YP7jki/7RmutRweEA77/HWXOh3HCxkRgldDQkAjNTMl2Iloc1qN5JfJeeTlyTRzxURTdn1Ixv2uKjs12AbdEWlBtmVdk2k7FFwj07PCZ9XAwW3dG+8xKzNFr4EnwBZpy9Qzhh3jDXebBpYcpuo4fQ44u+fD1dweEnHzI7v0xuuOALRUV8rXpFyfSTQYkhd7IHm07jpyhlkCmI0ALYqPTpUxXS+z4jgDj1Pflvmz5ecuItpIBxyTHpSTGWd9g1ApfD/bvwUhL4nT1EzqgX7cxfCcNmb3mPL/qi9SwTHJ49oj5ZLjccbTG3pRmlYi6JCG0mQrAt1+i2UXTZ2dv9IlQpN5naMYtviaXlTrFpoMsl3bOAFEa8sqPj2WCMrx3Yjx99qFwO59Aw/wgx+HlqNz8oZvA3exRDvuhL1jMQHPaOJ0+XyA3fp1OfM3qObEVdhxjvynxNMXQV4+GJyvOEFqeQBaIbbO7i63rpxCltdZShPFxkjM2FPVkn3TG+Rp9pO3l2RzFegGfxGDHIAh8SteR0C4HopXzRF61nheDw6TFN05Ebvq8M3VKKpGjjO6r7nhudTEGMtYM92HTDaR1FDMXJ1eThsbKfywyoWwrzRSXkc51flG3vIid62h29bIcFbTGhfV+faaB+ohj7dPN0C2e2lC96+XouFByen9AsunLDJZ9z7NExiUc0OuoYW6UZkIyx2YUR2z6/TiRjyKMx5GbbjLHvHuf7YmtKghf34LJfx63Yg8vrvN2zC7lY0x0tvKezo4HmGYDU+Gab6dFL+KI761lDcNifcjLrrr9LWZJctG1FfU1uwhoQE22ObjdfkSzY63CbU5hzs21WeTddH2BaL11Gi7lVdlxP1nkxqhnKhVY6knS3EPgVGg1JpN5cP/hivujOelhXcPj8HC/LyI6MkteVjlolBdMmF3a3DbsuAYhL44dxzthWSN065xxUd55Lmf0wRbOYOqH09/o9WbO2VtFdaMb4qBgtFJoT1SqoN8wPXMoXLb3p1PUEhxfnnLzGzBI0Ku7FxrKsNJj/8bn/H8fPIVOd3rfrklUB/DOeO+nkghgSPzrlPxluCMtOnDL4Yml6dK1r3vsgMxgtPOrMFUZbEUbTdIzii5beq72G4PD0DKnwjmBULUVFmy8t+k7fZ3pKc0Q4UC6jpVRqS9Umv8bxw35flZVOU1X7qkjnhZlsMbk24qQ6Hz7QcuL6sDC0iHHki96Uh2UdvmgZnjIvExy2TeJdMDZNSbdZyAHe/Yd1xsQhHiKzjh7GxQ4yqMPaywPkjMamvqrYpmO7Knad+ZQC5msCuAPWUoxrxVhrGv7a+KLXFhyONdTMrZ7ke23qiO40ZJUyzgYyX5XyL0mV7NiUzEs9mjtbMN0dERqwyAJpigad0B3/zRV7s4PIfXSu6YV/MK7+OrYe/JvfGMn/PHJe2fyUdtnFrKRNpXV0Y2559aWPt/G4BlvjTMtXlVIWCnNyA3YQBDmYIodFz41PvXPSa6rq9lWZawZ4dP115HXV/M/tnFkkrBOdzg6aP4pID+MZnTJ1SuuB6iZlyiox4HT2y3YBtkUKWooacBQUDTpjwaDt5poBHl1/HXltwP887lKKXxNUEyPqpGTyA699UqY/lt9yGdlUKra0fFWS+36iylVWrAyd7Uw0CZM0z7xKTOduznLIjG2Hx8cDPLb+OvK6Bv7n1DYci4CxUuRxrjBc0bb4vD3rN5Zz36ntLb83eVJIB8LiIzCmn6SMPjlX+yNlTjvIGjs+QzHPf60Aj62/jrzG8j9vYMFtm1VoRWCJdmw7z9N0t+c8cxZpPeK4aTRicS25QhrVtUp7U578chk4q04Wx4YoQSjFryUlpcQ1AbxZ/XVMknIU//OGl7Q6z9Zpxi0+3yFhSkjUDpnCIUhLWVX23KQ+L9vKvFKI0ZWFQgkDLvBoylrHNVmaw10zwCPrr5tlodfnf94EWnQ0lFRWy8pW9LbkLsyUVDc2NSTHGDtnD1uMtchjbCeb1mpxFP0YbcClhzdLu6lfO8Bj6q+bdT2sz/+8SZCV7VIxtt0DUn9L7r4cLYWDSXnseEpOGFuty0qbOVlS7NNzs5FOGJUqQpl2Q64/yBpZf90sxbE+//PGdZ02HSipCbmD6NItmQ4Lk5XUrGpDMkhbMm2ZVheNYV+VbUWTcv99+2NyX1VoafSuC+AN6q9bFIMv5X/eagNWXZxEa9JjlMwNWb00akGUkSoepp1/yRuuqHGbUn3UdBSTxBU6SEVklzWRUkPndVvw2PrrpjvxOvzPmwHc0hpmq82npi7GRro8dXp0KXnUQmhZbRL7NEVp1uuZmO45vuzKsHrktS3GLWXODVjw+vXXLYx4Hf7njRPd0i3aoAGX6W29GnaV5YdyDj9TFkakje7GHYzDoObfddHtOSpoi2SmzJHrB3hM/XUDDEbxP2/oosszcRlehWXUvzHv4TpBVktHqwenFo8uLVmy4DKLa5d3RtLrmrM3aMFr1183E4sewf+85VWeg1c5ag276NZrM9IJVNcmLEvDNaV62aq+14IAOGFsBt973Ra8Xv11YzXwNfmft7Jg2oS+XOyoC8/cwzi66Dhmgk38kUmP1CUiYWOX1bpD2zWXt2FCp7uq8703APAa9dfNdscR/M/bZLIyouVxqJfeWvG9Je+JVckHQ9+CI9NWxz+blX/KYYvO5n2tAP/vrlZ7+8/h9y+9qeB/Hnt967e5mevX10rALDWK//FaAT5MXdBXdP0C/BAes792c40H+AiAp1e1oH8HgH94g/Lttx1gp63op1eyoM/Bvw5/G/7xFbqJPcCXnmBiwDPb/YKO4FX4OjyCb289db2/Noqicw4i7N6TVtoz8tNwDH+8x/i6Ae7lmaQVENzJFb3Di/BFeAwz+Is9SjeQySpPqbLFlNmyz47z5a/AF+AYFvDmHqibSXTEzoT4Gc3OALaqAP4KPFUJ6n+1x+rGAM6Zd78bgJ0a8QN4GU614vxwD9e1Amy6CcskNrczLx1JIp6HE5UZD/DBHrFr2oNlgG4Odv226BodoryjGJ9q2T/AR3vQrsOCS0ctXZi3ruLlhpFDJYl4HmYtjQCP9rhdn4suySLKDt6wLcC52h8xPlcjju1fn+yhuw4LZsAGUuo2b4Fx2UwQu77uqRHXGtg92aN3tQCbFexc0uk93vhTXbct6y7MulLycoUljx8ngDMBg1tvJjAazpEmOtxlzclvj1vQf1Tx7QlPDpGpqgtdSKz/d9/hdy1vTfFHSmC9dGDZbLiezz7Ac801HirGZsWjydfZyPvHXL/Y8Mjzg8BxTZiuwKz4Eb8sBE9zznszmjvFwHKPIWUnwhqfVRcd4Ck0K6ate48m1oOfrX3/yOtvAsJ8zsPAM89sjnddmuLuDPjX9Bu/L7x7xpMzFk6nWtyQfPg278Gn4Aekz2ZgOmU9eJ37R14vwE/BL8G3aibCiWMWWDQ0ZtkPMnlcGeAu/Ag+8ZyecU5BPuy2ILD+sQqyZhAKmn7XZd+jIMTN9eBL7x95xVLSX4On8EcNlXDqmBlqS13jG4LpmGbkF/0CnOi3H8ETOIXzmnmtb0a16Tzxj1sUvQCBiXZGDtmB3KAefPH94xcUa/6vwRn80GOFyjEXFpba4A1e8KQfFF+259tx5XS4egYn8fQsLGrqGrHbztr+uByTahWuL1NUGbDpsnrwBfePPwHHIf9X4RnM4Z2ABWdxUBlqQ2PwhuDxoS0vvqB1JzS0P4h2nA/QgTrsJFn+Y3AOjs9JFC07CGWX1oNX3T/yHOzgDjwPn1PM3g9Jk9lZrMEpxnlPmBbjyo2+KFXRU52TJM/2ALcY57RUzjObbjqxVw++4P6RAOf58pcVsw9Daje3htriYrpDOonre3CudSe6bfkTEgHBHuDiyu5MCsc7BHhYDx7ePxLjqigXZsw+ijMHFhuwBmtoTPtOxOrTvYJDnC75dnUbhfwu/ZW9AgYd+peL68HD+0emKquiXHhWjJg/UrkJYzuiaL3E9aI/ytrCvAd4GcYZMCkSQxfUg3v3j8c4e90j5ZTPdvmJJGHnOCI2nHS8081X013pHuBlV1gB2MX1YNmWLHqqGN/TWmG0y6clJWthxNUl48q38Bi8vtMKyzzpFdSDhxZ5WBA5ZLt8Jv3895DduBlgbPYAj8C4B8hO68FDkoh5lydC4FiWvBOVqjYdqjiLv92t8yPDjrDaiHdUD15qkSURSGmXJwOMSxWAXYwr3zaAufJ66l+94vv3AO+vPcD7aw/w/toDvL/2AO+vPcD7aw/wHuD9tQd4f+0B3l97gPfXHuD9tQd4f+0B3l97gG8LwP8G/AL8O/A5OCq0Ys2KIdv/qOIXG/4mvFAMF16gZD+2Xvu/B8as5+8bfllWyg0zaNO5bfXj6vfhhwD86/Aq3NfRS9t9WPnhfnvCIw/CT8GLcFTMnpntdF/z9V+PWc/vWoIH+FL3Znv57PitcdGP4R/C34avw5fgRVUInCwbsn1yyA8C8zm/BH8NXoXnVE6wVPjdeCI38kX/3+Ct9dbz1pTmHFRu+Hm4O9Ch3clr99negxfwj+ER/DR8EV6B5+DuQOnTgUw5rnkY+FbNU3gNXh0o/JYTuWOvyBf9FvzX663HH/HejO8LwAl8Hl5YLTd8q7sqA3wbjuExfAFegQdwfyDoSkWY8swzEf6o4Qyewefg+cHNbqMQruSL/u/WWc+E5g7vnnEXgDmcDeSGb/F4cBcCgT+GGRzDU3hZYburAt9TEtHgbM6JoxJ+6NMzzTcf6c2bycv2+KK/f+l6LBzw5IwfqZJhA3M472pWT/ajKxnjv4AFnMEpnBTPND6s2J7qHbPAqcMK74T2mZ4VGB9uJA465It+/eL1WKhYOD7xHOkr1ajK7d0C4+ke4Hy9qXZwpgLr+Znm/uNFw8xQOSy8H9IzjUrd9+BIfenYaylf9FsXr8fBAadnPIEDna8IBcwlxnuA0/Wv6GAWPd7dDIKjMdSWueAsBj4M7TOd06qBbwDwKr7oleuxMOEcTuEZTHWvDYUO7aHqAe0Bbq+HEFRzOz7WVoTDQkVds7A4sIIxfCQdCefFRoIOF/NFL1mPab/nvOakSL/Q1aFtNpUb/nFOVX6gzyg/1nISyDfUhsokIzaBR9Kxm80s5mK+6P56il1jXic7nhQxsxSm3OwBHl4fFdLqi64nDQZvqE2at7cWAp/IVvrN6/BFL1mPhYrGMBfOi4PyjuSGf6wBBh7p/FZTghCNWGgMzlBbrNJoPJX2mW5mwZfyRffXo7OFi5pZcS4qZUrlViptrXtw+GQoyhDPS+ANjcGBNRiLCQDPZPMHuiZfdFpPSTcQwwKYdRNqpkjm7AFeeT0pJzALgo7g8YYGrMHS0iocy+YTm2vyRUvvpXCIpQ5pe666TJrcygnScUf/p0NDs/iAI/nqDHC8TmQT8x3NF91l76oDdQGwu61Z6E0ABv7uO1dbf/37Zlv+Zw/Pbh8f1s4Avur6657/+YYBvur6657/+YYBvur6657/+YYBvur6657/+aYBvuL6657/+VMA8FXWX/f8zzcN8BXXX/f8zzcNMFdbf93zP38KLPiK6697/uebtuArrr/u+Z9vGmCusP6653/+1FjwVdZf9/zPN7oHX339dc//fNMu+irrr3v+50+Bi+Zq6697/uebA/jz8Pudf9ht/fWv517J/XUzAP8C/BAeX9WCDrUpZ3/dEMBxgPcfbtTVvsYV5Yn32u03B3Ac4P3b8I+vxNBKeeL9dRMAlwO83959qGO78sT769oB7g3w/vGVYFzKE++v6wV4OMD7F7tckFkmT7y/rhHgpQO8b+4Y46XyxPvrugBeNcB7BRiX8sT767oAvmCA9woAHsoT76+rBJjLBnh3txOvkifeX1dswZcO8G6N7sXyxPvr6i340gHe3TnqVfLE++uKAb50gHcXLnrX8sR7gNdPRqwzwLu7Y/FO5Yn3AK9jXCMGeHdgxDuVJ75VAI8ljP7PAb3/RfjcZfePHBB+79dpfpH1CanN30d+mT1h9GqAxxJGM5LQeeQ1+Tb+EQJrElLb38VHQ94TRq900aMIo8cSOo+8Dp8QfsB8zpqE1NO3OI9Zrj1h9EV78PqE0WMJnUdeU6E+Jjyk/hbrEFIfeWbvId8H9oTRFwdZaxJGvziW0Hn0gqYB/wyZ0PwRlxJST+BOw9m77Amj14ii1yGM/txYQudN0qDzGe4EqfA/5GJCagsHcPaEPWH0esekSwmjRxM6b5JEcZ4ww50ilvAOFxBSx4yLW+A/YU8YvfY5+ALC6NGEzhtmyZoFZoarwBLeZxUhtY4rc3bKnjB6TKJjFUHzJoTOozF2YBpsjcyxDgzhQ1YRUse8+J4wenwmaylB82hC5w0zoRXUNXaRBmSMQUqiWSWkLsaVqc/ZE0aPTFUuJWgeTei8SfLZQeMxNaZSIzbII4aE1Nmr13P2hNHjc9E9guYNCZ032YlNwESMLcZiLQHkE4aE1BFg0yAR4z1h9AiAGRA0jyZ03tyIxWMajMPWBIsxYJCnlITU5ShiHYdZ94TR4wCmSxg9jtB5KyPGYzymAYexWEMwAPIsAdYdV6aObmNPGD0aYLoEzaMJnTc0Ygs+YDw0GAtqxBjkuP38bMRWCHn73xNGjz75P73WenCEJnhwyVe3AEe8TtKdJcYhBl97wuhNAObK66lvD/9J9NS75v17wuitAN5fe4D31x7g/bUHeH/tAd5fe4D3AO+vPcD7aw/w/toDvL/2AO+vPcD7aw/w/toDvAd4f/24ABzZ8o+KLsSLS+Pv/TqTb3P4hKlQrTGh+fbIBT0Axqznnb+L/V2mb3HkN5Mb/nEHeK7d4IcDld6lmDW/iH9E+AH1MdOw/Jlu2T1xNmY98sv4wHnD7D3uNHu54WUuOsBTbQuvBsPT/UfzNxGYzwkP8c+Yz3C+r/i6DcyRL/rZ+utRwWH5PmfvcvYEt9jLDS/bg0/B64DWKrQM8AL8FPwS9beQCe6EMKNZYJol37jBMy35otdaz0Bw2H/C2Smc7+WGB0HWDELBmOByA3r5QONo4V+DpzR/hFS4U8wMW1PXNB4TOqYz9urxRV++ntWCw/U59Ty9ebdWbrgfRS9AYKKN63ZokZVygr8GZ/gfIhZXIXPsAlNjPOLBby5c1eOLvmQ9lwkOy5x6QV1j5TYqpS05JtUgUHUp5toHGsVfn4NX4RnMCe+AxTpwmApTYxqMxwfCeJGjpXzRF61nbcHhUBPqWze9svwcHJ+S6NPscKrEjug78Dx8Lj3T8D4YxGIdxmJcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII=",b="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII=";export{A as areaTexture,b as searchTexure}; diff --git a/assets/SpatialFilter-d44507d6.js b/assets/SpatialFilter-d44507d6.js new file mode 100644 index 0000000..a376b12 --- /dev/null +++ b/assets/SpatialFilter-d44507d6.js @@ -0,0 +1 @@ +import{f as T,s as _,t as f,o as m,n as y}from"./WhereClause-c86b9974.js";import{c as J,T as j}from"./arcadeTimeUtils-e1438cc8.js";import{hr as L,gY as v,bc as W,aY as G}from"./index-080e108a.js";import{af as h,ag as x,ah as O,ai as z,aj as Z,ak as X,al as ee,am as b,an as te,ao as ae,ap as M,aq as $,ar as U}from"./arcadeUtils-b902d678.js";import{b as re,K as se,W as ne,M as ie,F as le,R as ce,m as ue,S as oe,x as he,O as de,p as pe,h as B}from"./geometryEngineAsync-e8b91fe5.js";import{r as _e}from"./FieldsIndex-f79a8f26.js";class A{constructor(){this._databaseTypeMetaData={},this._layerInfo={}}clearDatabaseType(e){this._databaseTypeMetaData[e]===void 0&&delete this._databaseTypeMetaData[e]}getDatabaseType(e){return e==="MUSTBESET"||this._databaseTypeMetaData[e]===void 0?null:this._databaseTypeMetaData[e]}setDatabaseType(e,t){this._databaseTypeMetaData[e]=t}getLayerInfo(e){return this._layerInfo[e]===void 0?null:this._layerInfo[e]}setLayerInfo(e,t){this._layerInfo[e]=t}clearLayerInfo(e){this._layerInfo[e]!==void 0&&delete this._layerInfo[e]}}A.applicationCache=null;class fe{constructor(e,t){this._lastId=-1,this._progress=t,this._parent=e}reset(){this._lastId=-1}nextBatch(e){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(r=>this.nextBatch(e),r=>this.nextBatch(e));const t={returnpromise:null,hasset:!1},a=[];return t.returnpromise=new Promise((r,s)=>{this._parent._getSet(this._progress).then(i=>{const l=L(i._known,"known");let c=l.length-1;if(l[l.length-1]==="GETPAGES"&&(c-=1),this._lastId+e>c&&l.length>0&&l[l.length-1]==="GETPAGES")return void this._parent._expandPagedSet(i,this._parent._maxQueryRate(),0,0,this._progress).then(u=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,s)},u=>{t.hasset=!0,this._parent._mainSetInUse=null,s(u)});const p=L(i._candidates,"candidates");if(c>=this._lastId+e||p.length===0){for(let u=0;u=l.length)break;a[u]=l[g]}return this._lastId+=a.length,a.length===0&&(t.hasset=!0,this._parent._mainSetInUse=null,r([])),void this._parent._getFeatureBatch(a,this._progress).then(u=>{t.hasset=!0,this._parent._mainSetInUse=null,r(u)},u=>{t.hasset=!0,this._parent._mainSetInUse=null,s(u)})}this._parent._refineSetBlock(i,this._parent._maxProcessingRate(),this._progress).then(()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,s)},u=>{t.hasset=!0,this._parent._mainSetInUse=null,s(u)})},i=>{t.hasset=!0,this._parent._mainSetInUse=null,s(i)})}),t.hasset===!1&&(this._parent._mainSetInUse=t.returnpromise,t.hasset=!0),t.returnpromise}next(){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(t=>this.next(),t=>this.next());const e={returnpromise:null,hasset:!1};return e.returnpromise=new Promise((t,a)=>{this._parent._getSet(this._progress).then(r=>{const s=L(r._known,"known");this._lastId(e.hasset=!0,this._parent._mainSetInUse=null,this.next())).then(t,a):(this._lastId+=1,this._parent._getFeature(r,s[this._lastId],this._progress).then(i=>{e.hasset=!0,this._parent._mainSetInUse=null,t(i)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,a(i)})):L(r._candidates,"candidates").length>0?this._parent._refineSetBlock(r,this._parent._maxProcessingRate(),this._progress).then(()=>{e.hasset=!0,this._parent._mainSetInUse=null,this.next().then(t,a)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,a(i)}):(e.hasset=!0,this._parent._mainSetInUse=null,t(null))},r=>{e.hasset=!0,this._parent._mainSetInUse=null,a(r)})}),e.hasset===!1&&(this._parent._mainSetInUse=e.returnpromise,e.hasset=!0),e.returnpromise}async count(){if(this._parent._totalCount!==-1)return this._parent._totalCount;const e=await this._parent._getSet(this._progress),t=await this._refineAllSets(e);return this._parent._totalCount=t._known.length,this._parent._totalCount}async _refineAllSets(e){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,1,this._progress),this._refineAllSets(e);if(e._candidates.length>0){if(e._known[e._candidates.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,2,this._progress),this._refineAllSets(e);const t=await this._parent._refineSetBlock(e,this._parent._maxProcessingRate(),this._progress);return t._candidates.length>0?this._refineAllSets(t):t}return e}}class R{constructor(e,t,a,r){this._lastFetchedIndex=0,this._ordered=!1,this.pagesDefinition=null,this._candidates=e,this._known=t,this._ordered=a,this.pagesDefinition=r}}function H(n,e){return o(n==null?void 0:n.parseTree,e,n==null?void 0:n.parameters)}function Ge(n,e,t){return o(n,e,t)}function Me(n,e,t,a){return T.create(o(n.parseTree,h.Standardised,n.parameters,e,t),a)}function $e(n,e,t="AND"){return T.create("(("+H(n,h.Standardised)+")"+t+"("+H(e,h.Standardised)+"))",n.fieldsIndex)}function o(n,e,t,a=null,r=null,s=null){let i,l,c,p;switch(n.type){case"interval":return we(o(n.value,e,t,a,r,s),n.qualifier,n.op);case"case-expression":{let u=" CASE ";n.format==="simple"&&(u+=o(n.operand,e,t,a,r,s));for(let g=0;g":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+o(n.left,e,t,a,r,s)+" "+n.operator+" "+o(n.right,e,t,a,r,s)+") ";case"||":return" ("+o(n.left,e,t,a,r,s)+" "+(e===h.SqlServer?"+":n.operator)+" "+o(n.right,e,t,a,r,s)+") "}throw new _(f.UnsupportedOperator,{operator:n.operator});case"null":return"null";case"boolean":return n.value===!0?"1":"0";case"string":return"'"+n.value.toString().replaceAll("'","''")+"'";case"timestamp":case"date":return k(n.value,e,s);case"number":return n.value.toString();case"current-time":return me(n.mode==="date",e);case"column-reference":return a&&a.toLowerCase()===n.column.toLowerCase()?"("+r+")":n.column;case"data-type":return n.value;case"function":{const u=o(n.args,e,t,a,r,s);return ge(n.name,u,e)}}throw new _(f.UnsupportedSyntax,{node:n.type})}function ge(n,e,t){switch(n.toLowerCase().trim()){case"cos":case"sin":case"tan":case"cosh":case"tanh":case"sinh":case"acos":case"asin":case"atan":case"floor":case"log10":case"log":case"abs":if(e.length!==1)throw new _(f.InvalidFunctionParameters,{function:n.toLowerCase().trim()});return`${n.toUpperCase().trim()}(${e[0]})`;case"ceiling":case"ceil":if(e.length!==1)throw new _(f.InvalidFunctionParameters,{function:"ceiling"});switch(t){case h.Standardised:case h.StandardisedNoInterval:}return"CEILING("+e[0]+")";case"mod":case"power":case"nullif":if(e.length!==2)throw new _(f.InvalidFunctionParameters,{function:n.toLowerCase().trim()});return`${n.toUpperCase().trim()}(${e[0]},${e[1]})`;case"round":if(e.length===2)return"ROUND("+e[0]+","+e[1]+")";if(e.length===1)return"ROUND("+e[0]+")";throw new _(f.InvalidFunctionParameters,{function:"round"});case"truncate":if(e.length<1||e.length>2)throw new _(f.InvalidFunctionParameters,{function:"truncate"});return t===h.SqlServer?"ROUND("+e[0]+(e.length===1?"0":","+e[1])+",1)":"TRUNCATE("+e[0]+(e.length===1?")":","+e[1]+")");case"char_length":case"len":if(e.length!==1)throw new _(f.InvalidFunctionParameters,{function:"char_length"});switch(t){case h.SqlServer:return"LEN("+e[0]+")";case h.Oracle:return"LENGTH("+e[0]+")";default:return"CHAR_LENGTH("+e[0]+")"}case"coalesce":case"concat":{if(e.length<1)throw new _(f.InvalidFunctionParameters,{function:n.toLowerCase()});let a=n.toUpperCase().trim()+"(";for(let r=0;r":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if(e.right.type!=="null")throw new _(f.UnsupportedIsRhs);return"boolean";case"*":case"-":case"+":case"/":return N([S(n,e.left,t,a),S(n,e.right,t,a)]);case"||":return"string";default:throw new _(f.UnsupportedOperator,{operator:e.operator})}case"null":return"";case"boolean":return"boolean";case"string":return"string";case"number":return e.value===null?"":e.value%1==0?"integer":"double";case"date":case"timestamp":case"current-time":return"date";case"column-reference":{const l=n[e.column.toLowerCase()];return l===void 0?"":l}case"function":switch(e.name.toLowerCase()){case"cast":switch(((i=(s=e.args)==null?void 0:s.value[1])==null?void 0:i.value.type)??""){case"integer":case"smallint":return"integer";case"real":case"float":return"double";case"date":case"timestamp":return"date";case"varchar":return"string";default:return""}case"position":case"extract":case"char_length":case"mod":return"integer";case"round":if(r=S(n,e.args,t,a),r instanceof Array){if(r.length<=0)return"double";r=r[0]}return r;case"sign":return"integer";case"ceiling":case"floor":case"abs":return r=S(n,e.args,t,a),r instanceof Array&&(r=N(r)),r==="integer"||r==="double"?r:"double";case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"cosh":case"sinh":case"tanh":case"power":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string";case"truncate":return"double";case"nullif":case"coalesce":return r=S(n,e.args,t,a),r instanceof Array?r.length>0?r[0]:"":r}return""}throw new _(f.UnsupportedSyntax,{node:e.type})}const Q={boolean:1,string:2,integer:3,double:4,date:5};function N(n){if(n){let e="";for(const t of n)t!==""&&(e=e===""||Q[e]=e&&e!==-1)return t}return t}function Be(n){switch(n.toLowerCase()){case"distinct":return"distinct";case"avg":case"mean":return"avg";case"min":return"min";case"sum":return"sum";case"max":return"max";case"stdev":case"stddev":return"stddev";case"var":case"variance":return"var";case"count":return"count"}return""}function He(n,e,t=1e3){switch(n.toLowerCase()){case"distinct":return Ie(e,t);case"avg":case"mean":return P(e);case"min":return Math.min.apply(Math,e);case"sum":return q(e);case"max":return Math.max.apply(Math,e);case"stdev":case"stddev":return Math.sqrt(K(e));case"var":case"variance":return K(e);case"count":return e.length}return 0}async function Fe(n,e,t){const a=await D(n,e,t,!0);return a.length===0?null:Math.min.apply(Math,a)}async function be(n,e,t){const a=await D(n,e,t,!0);return a.length===0?null:Math.max.apply(Math,a)}async function Ee(n,e,t){let a="";e&&!Se(e)&&(a=ye(e,n.fields));const r=await D(n,e,t,!0);if(r.length===0)return null;const s=P(r);return s===null?s:a==="integer"?Te(s):s}async function Re(n,e,t){const a=await D(n,e,t,!0);return a.length===0?null:V(a)}async function Ae(n,e,t){const a=await D(n,e,t,!0);return a.length===0?null:Math.sqrt(V(a))}async function De(n,e,t){const a=await D(n,e,t,!0);return a.length===0?null:q(a)}async function Le(n,e){return n.iterator(e).count()}async function D(n,e,t,a=!1){const r=n.iterator(t),s=[],i={ticker:0};let l=await r.next();for(;l!==null;){if(i.ticker++,t.aborted)throw new m(y.Cancelled);i.ticker%100==0&&(i.ticker=0,await new Promise(p=>{setTimeout(p,0)}));const c=e==null?void 0:e.calculateValue(l);c===null?a===!1&&(s[s.length]=c):s[s.length]=c,l=await r.next()}return s}async function xe(n,e,t=1e3,a=null){const r=n.iterator(a),s=[],i={},l={ticker:0};let c=await r.next();for(;c!==null;){if(l.ticker++,a&&a.aborted)throw new m(y.Cancelled);l.ticker%100==0&&(l.ticker=0,await new Promise(u=>{setTimeout(u,0)}));const p=e==null?void 0:e.calculateValue(c);if(p!=null&&i[p]===void 0&&(s.push(p),i[p]=1),s.length>=t&&t!==-1)return s;c=await r.next()}return s}class d{constructor(e){this.recentlyUsedQueries=null,this.featureSetQueryInterceptor=null,this._idstates=[],this._parent=null,this._wset=null,this._mainSetInUse=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=h.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=[],this.typeIdField=null,this.types=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,this._dateFieldIndex=null,e&&e.lrucache&&(this.recentlyUsedQueries=e.lrucache),e&&e.interceptor&&(this.featureSetQueryInterceptor=e.interceptor)}optimisePagingFeatureQueries(e){this._parent&&this._parent.optimisePagingFeatureQueries(e)}_hasMemorySource(){return!0}prop(e,t){return t===void 0?this[e]:(this[e]!==void 0&&(this[e]=t),this)}end(){return this._parent!==null&&this._parent._transparent===!0?this._parent.end():this._parent}_ensureLoaded(){return this.load()}load(){return this._loadPromise===null&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){var e,t;return((e=this._parent)==null?void 0:e.loaded)===!0?(this._initialiseFeatureSet(),this):(await((t=this._parent)==null?void 0:t.load()),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.fields=[],this.typeIdField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new W({wkid:4326}),this.geometryType=ee.point)}getField(e,t){let a;return(t=t||this.fields)&&(e=e.toLowerCase(),t.some(r=>(r&&r.name.toLowerCase()===e&&(a=r),!!a))),a}getFieldsIndex(){return this._fieldsIndex===null&&(this._fieldsIndex=new _e(this.fields)),this._fieldsIndex}_maxProcessingRate(){return this._parent!==null?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return this._parent!==null?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}_checkCancelled(e){if(e!=null&&e.aborted)throw new m(y.Cancelled)}nativeCapabilities(){return this._parent.nativeCapabilities()}async _canDoAggregates(e,t,a,r,s){return this._parent!==null&&this._parent._canDoAggregates(e,t,a,r,s)}async _getAggregatePagesDataSourceDefinition(e,t,a,r,s,i,l){if(this._parent===null)throw new m(y.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,t,a,r,s,i,l)}async _getAgregagtePhysicalPage(e,t,a){if(this._parent===null)throw new m(y.NeverReach);return this._parent._getAgregagtePhysicalPage(e,t,a)}async databaseType(){if(this._databaseType===h.NotEvaluated){if(A.applicationCache!==null){const e=A.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(e!==null)return e}if(this._databaseTypeProbed!==null)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),A.applicationCache!==null&&A.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw A.applicationCache!==null&&A.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{thetype:h.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:h.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:h.StandardisedNoInterval,testwhere:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}];for(const t of e)if(await this._runDatabaseProbe(t.testwhere)===!0)return t.thetype;return h.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(this._parent!==null)return this._parent._runDatabaseProbe(e);throw new m(y.NotImplemented)}isTable(){var e;return((e=this._parent)==null?void 0:e.isTable())??!1}_featureFromCache(e){if(this._featureCache[e]!==void 0)return this._featureCache[e]}_isInFeatureSet(e){return b.Unknown}_getSet(e){throw new m(y.NotImplemented)}async _getFeature(e,t,a){if(this._checkCancelled(a),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);if(await this._getFeatures(e,t,this._maxProcessingRate(),a),this._checkCancelled(a),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);throw new m(y.MissingFeatures)}async _getFeatureBatch(e,t){this._checkCancelled(t);const a=new R([],e,!1,null),r=[];await this._getFeatures(a,-1,e.length,t),this._checkCancelled(t);for(const s of e)this._featureFromCache(s)!==void 0&&r.push(this._featureFromCache(s));return r}async _getFeatures(e,t,a,r){return"success"}_getFilteredSet(e,t,a,r,s){throw new m(y.NotImplemented)}async _refineSetBlock(e,t,a){if(this._checkIfNeedToExpandCandidatePage(e,this._maxQueryRate())===!0)return await this._expandPagedSet(e,this._maxQueryRate(),0,0,a),this._refineSetBlock(e,t,a);this._checkCancelled(a);const r=e._candidates.length;this._refineKnowns(e,t);let s=r-e._candidates.length;if(e._candidates.length===0||s>=t)return e;if(await this._refineIfParentKnown(e,t-s,a),this._checkCancelled(a),this._refineKnowns(e,t-s),s=r-e._candidates.length,s0){const i=t-s,l=this._prepareFetchAndRefineSet(e._candidates);return await this._fetchAndRefineFeatures(l,l.length>i?i:e._candidates.length,a),this._checkCancelled(a),this._refineKnowns(e,t-s),e}return e}_fetchAndRefineFeatures(e,t,a){return null}_prepareFetchAndRefineSet(e){const t=[];for(let a=0;a=t)break}r!==null&&s.push(r);for(let i=s.length-1;i>=0;i--)e._candidates.splice(s[i].start,s[i].end-s[i].start+1)}_refineIfParentKnown(e,t,a){const r=new R([],[],e._ordered,null);return r._candidates=e._candidates.slice(0),this._parent._refineSetBlock(r,t,a)}_candidateIdTransform(e){return this._parent._candidateIdTransform(e)}_checkIfNeedToExpandKnownPage(e,t){if(e.pagesDefinition===null)return!1;let a=0;for(let r=e._lastFetchedIndex;r=t))break}return!1}_checkIfNeedToExpandCandidatePage(e,t){if(e.pagesDefinition===null)return!1;let a=0;for(let r=0;r=t)break}return!1}async _expandPagedSet(e,t,a,r,s){if(this._parent===null)throw new m(y.NotImplemented);return this._parent._expandPagedSet(e,t,a,r,s)}async _expandPagedSetFeatureSet(e,t,a,r,s){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"&&(r=1),r===0&&e._candidates.length>0&&e._candidates[e._candidates.length-1]==="GETPAGES"&&(r=2),r===0)return"finished";const i=await this._getPage(e,r,s);return a+ie.pagesDefinition.resultOffset||e.pagesDefinition.internal.fullyResolved===!0){r.length=r.length-1;let s=0;for(let l=0;l=e.pagesDefinition.internal.set.length);l++)r[r.length]=e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset+l],s++;e.pagesDefinition.resultOffset+=s;let i=!1;return e.pagesDefinition.internal.fullyResolved===!0&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset&&(i=!0),i===!1&&r.push("GETPAGES"),s}return await this._getPhysicalPage(e,t,a),this._getPage(e,t,a)}_getPhysicalPage(e,t,a){return null}_clonePageDefinition(e){return this._parent===null?null:this._parent._clonePageDefinition(e)}_first(e){return this.iterator(e).next()}first(e){return this._first(e)}async calculateStatistic(e,t,a,r){await this._ensureLoaded();let s=await this._stat(e,t,"",null,null,a,r);return s.calculated===!1&&(s=await this._manualStat(e,t,a,r)),s.result}async _manualStat(e,t,a,r){let s=null;switch(e.toLowerCase()){case"count":return s=await Le(this,r),{calculated:!0,result:s};case"distinct":return s=await xe(this,t,a,r),{calculated:!0,result:s};case"avg":case"mean":return s=await Ee(this,t,r),{calculated:!0,result:s};case"stdev":return s=await Ae(this,t,r),{calculated:!0,result:s};case"variance":return s=await Re(this,t,r),{calculated:!0,result:s};case"sum":return s=await De(this,t,r),{calculated:!0,result:s};case"min":return s=await Fe(this,t,r),{calculated:!0,result:s};case"max":return s=await be(this,t,r),{calculated:!0,result:s};default:return{calculated:!0,result:0}}}async _stat(e,t,a,r,s,i,l){const c=await this._parent._stat(e,t,a,r,s,i,l);return c.calculated===!1?s===null&&a===""&&r===null?this._manualStat(e,t,i,l):{calculated:!1}:c}_unionAllGeomSelf(e){const t=this.iterator(this._defaultTracker(e)),a=[];return new Promise((r,s)=>{this._unionShapeInBatches(a,t,r,s)})}_unionAllGeom(e){return new Promise((t,a)=>{const r=this.iterator(this._defaultTracker(e)),s=[];this._unionShapeInBatches(s,r,t,a)})}_unionShapeInBatches(e,t,a,r){t.next().then(s=>{try{s!==null&&s.geometry!==null&&e.push(s.geometry),e.length>30||s===null&&e.length>1?re(e).then(i=>{try{s===null?a(i):(e=[i],this._unionShapeInBatches(e,t,a,r))}catch(l){r(l)}},r):s===null?e.length===1?a(e[0]):a(null):this._unionShapeInBatches(e,t,a,r)}catch(i){r(i)}},r)}iterator(e){return new fe(this,e)}intersection(e,t=!1){return d._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,a=!0){return d._featuresetFunctions.difference.bind(this)(e,t,a)}symmetricDifference(e,t=!1,a=!0){return d._featuresetFunctions.symmetricDifference.bind(this)(e,t,a)}morphShape(e,t,a="unknown",r=null){return d._featuresetFunctions.morphShape.bind(this)(e,t,a,r)}morphShapeAndAttributes(e,t,a="unknown"){return d._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,a)}union(e,t=!1){return d._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return d._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return d._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return d._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return d._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return d._featuresetFunctions.relate.bind(this)(e,t)}within(e){return d._featuresetFunctions.within.bind(this)(e)}touches(e){return d._featuresetFunctions.touches.bind(this)(e)}top(e){return d._featuresetFunctions.top.bind(this)(e)}crosses(e){return d._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,a,r=!0){return d._featuresetFunctions.buffer.bind(this)(e,t,a,r)}filter(e,t=null){return d._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return d._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return d._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return d._featuresetFunctions.groupby.bind(this)(e,t)}reduce(e,t=null,a){return new Promise((r,s)=>{this._reduceImpl(this.iterator(this._defaultTracker(a)),e,t,0,r,s,0)})}_reduceImpl(e,t,a,r,s,i,l){try{if(++l>1e3)return void setTimeout(()=>{l=0,this._reduceImpl(e,t,a,r,s,i,l)});e.next().then(c=>{try{if(c===null)s(a);else{const p=t(a,c,r,this);G(p)?p.then(u=>{this._reduceImpl(e,t,u,r+1,s,i,l)},i):this._reduceImpl(e,t,p,r+1,s,i,l)}}catch(p){i(p)}},i)}catch(c){i(c)}}removeField(e){return d._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,a=null){return d._featuresetFunctions.addField.bind(this)(e,t,a)}sumArea(e,t=!1,a){const r=te(e);return this.reduce((s,i)=>i.geometry===null?0:t?se(i.geometry,r).then(l=>s+l):ne(i.geometry,r).then(l=>s+l),0,a)}sumLength(e,t=!1,a){const r=ae(e);return this.reduce((s,i)=>i.geometry===null?0:t?ie(i.geometry,r).then(l=>s+l):le(i.geometry,r).then(l=>s+l),0,a)}_substituteVars(e,t){if(t!==null){const a={};for(const r in t)a[r.toLowerCase()]=t[r];e.parameters=a}}async distinct(e,t=1e3,a=null,r){await this.load();const s=T.create(e,this.getFieldsIndex());return this._substituteVars(s,a),this.calculateStatistic("distinct",s,t,this._defaultTracker(r))}async min(e,t=null,a){await this.load();const r=T.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("min",r,-1,this._defaultTracker(a))}async max(e,t=null,a){await this.load();const r=T.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("max",r,-1,this._defaultTracker(a))}async avg(e,t=null,a){await this.load();const r=T.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("avg",r,-1,this._defaultTracker(a))}async sum(e,t=null,a){await this.load();const r=T.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("sum",r,-1,this._defaultTracker(a))}async stdev(e,t=null,a){await this.load();const r=T.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("stdev",r,-1,this._defaultTracker(a))}async variance(e,t=null,a){await this.load();const r=T.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("variance",r,-1,this._defaultTracker(a))}async count(e){return await this.load(),this.calculateStatistic("count",T.create("1",this.getFieldsIndex()),-1,this._defaultTracker(e))}_defaultTracker(e){return e??{aborted:!1}}forEach(e,t){return new Promise((a,r)=>{this._forEachImpl(this.iterator(this._defaultTracker(t)),e,this,a,r,0)})}_forEachImpl(e,t,a,r,s,i){try{if(++i>1e3)return void setTimeout(()=>{i=0,this._forEachImpl(e,t,a,r,s,i)},0);e.next().then(l=>{try{if(l===null)r(a);else{const c=t(l);c==null?this._forEachImpl(e,t,a,r,s,i):G(c)?c.then(()=>{try{this._forEachImpl(e,t,a,r,s,i)}catch(p){s(p)}},s):this._forEachImpl(e,t,a,r,s,i)}}catch(c){s(c)}},s)}catch(l){s(l)}}convertToJSON(e){const t={layerDefinition:{geometryType:this.geometryType,fields:[]},featureSet:{features:[],geometryType:this.geometryType}};for(let a=0;a{const s={geometry:r.geometry&&r.geometry.toJSON(),attributes:{}};for(const i in r.attributes)s.attributes[i]=r.attributes[i];return t.featureSet.features.push(s),1},0,e).then(()=>t)}castToText(e=!1){return"object, FeatureSet"}queryAttachments(e,t,a,r,s){return this._parent.queryAttachments(e,t,a,r,s)}serviceUrl(){return this._parent.serviceUrl()}subtypes(){return this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map(e=>({name:e.name,code:e.id})):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push(M(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:$[this.geometryType]===void 0?"esriGeometryNull":$[this.geometryType],fields:e}}async convertToText(e,t){if(e==="schema")return await this._ensureLoaded(),JSON.stringify(this.schema());if(e==="featureset"){await this._ensureLoaded();const a=[];await this.reduce((s,i)=>{const l={geometry:i.geometry?i.geometry.toJSON():null,attributes:i.attributes};return l.geometry!==null&&l.geometry.spatialReference&&delete l.geometry.spatialReference,a.push(l),1},0,t);const r=this.schema();return r.features=a,r.spatialReference=this.spatialReference.toJSON(),JSON.stringify(r)}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return this._parent!==null?this._parent.getRootFeatureSet():this}getDataSourceFeatureSet(){return this._parent!==null?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return(e==null?void 0:e.featureset)==="keeptype"?this:(e==null?void 0:e.featureset)==="none"?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){var s;if((t==null?void 0:t.featureset)==="keeptype")return this;if((t==null?void 0:t.featureset)==="schema")return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if((t==null?void 0:t.featureset)==="none")return null;await this._ensureLoaded();const a=[];await this.reduce((i,l)=>{const c={geometry:l.geometry?(t==null?void 0:t.keepGeometryType)===!0?l.geometry:l.geometry.toJSON():null,attributes:l.attributes};return c.geometry!==null&&c.geometry.spatialReference&&(t==null?void 0:t.keepGeometryType)!==!0&&delete c.geometry.spatialReference,a.push(c),1},0,e);const r=this.schema();return r.features=a,r.spatialReference=(t==null?void 0:t.keepGeometryType)===!0?this.spatialReference:(s=this.spatialReference)==null?void 0:s.toJSON(),r}get dateTimeReferenceFieldIndex(){return this._dateFieldIndex===null&&(this._dateFieldIndex=j.create(this.getFieldsIndex(),this)),this._dateFieldIndex}fieldTimeZone(e){return this.dateTimeReferenceFieldIndex.fieldTimeZone(e)}get preferredTimeReference(){var e;return((e=this._parent)==null?void 0:e.preferredTimeReference)??null}get dateFieldsTimeReference(){var e;return((e=this._parent)==null?void 0:e.dateFieldsTimeReference)??null}get datesInUnknownTimezone(){return this._parent.datesInUnknownTimezone}get editFieldsInfo(){var e;return((e=this._parent)==null?void 0:e.editFieldsInfo)??null}get timeInfo(){var e;return((e=this._parent)==null?void 0:e.timeInfo)??null}}d._featuresetFunctions={};class E extends d{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._wset=new R([],[],!1,null),this._parent=e.parentfeatureset,this._databaseType=h.Standardised}async _getSet(){return this._wset}optimisePagingFeatureQueries(){}_isInFeatureSet(){return b.NotInFeatureSet}async _getFeature(){throw new m(y.NeverReach)}async queryAttachments(){return[]}async _getFeatures(){return"success"}_featureFromCache(){return null}async _fetchAndRefineFeatures(){throw new m(y.NeverReach)}async _getFilteredSet(){return new R([],[],!1,null)}_stat(e,t,a,r,s,i,l){return this._manualStat(e,t,i,l)}async _canDoAggregates(){return!1}}class F extends d{constructor(e){super(e),this._relation="",this._relationGeom=null,this._relationString="",this.declaredClass="esri.arcade.featureset.actions.SpatialFilter",this._relationString=e.relationString,this._parent=e.parentfeatureset,this._maxProcessing=40,this._relation=e.relation,this._relationGeom=e.relationGeom}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._parent._getFilteredSet(this._relation!=="esriSpatialRelRelation"?this._relation:this._relation+":"+this._relationString,this._relationGeom,null,null,e);return this._checkCancelled(e),this._wset=new R(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===b.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?b.Unknown:t)}_getFeature(e,t,a){return this._parent._getFeature(e,t,a)}_getFeatures(e,t,a,r){return this._parent._getFeatures(e,t,a,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}async executeSpatialRelationTest(e){if(e.geometry===null)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":return B(U(this._relationGeom),U(e.geometry));case"esriSpatialRelIntersects":return B(this._relationGeom,e.geometry);case"esriSpatialRelContains":return pe(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return de(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return he(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return oe(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return ue(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return ce(this._relationGeom,e.geometry,this._relationString??"")}}async _fetchAndRefineFeatures(e,t,a){var l;const r=new R([],e,!1,null),s=Math.min(t,e.length);await((l=this._parent)==null?void 0:l._getFeatures(r,-1,s,a)),this._checkCancelled(a);const i=[];for(let c=0;cX.fromJSON(m))}writeRestrictionAttributes(e,a,l){e!=null&&(a[l]=e.map(m=>X.toJSON(m)))}};t([i({type:[Object],json:{write:!0}})],d.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"description",void 0),t([x(te,{ignoreUnknown:!1})],d.prototype,"distanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"id",void 0),t([p("id",["id","itemId"])],d.prototype,"readId",null),t([x(C,{ignoreUnknown:!1})],d.prototype,"impedanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"name",void 0),t([i({type:[String],json:{write:!0}})],d.prototype,"restrictionAttributeNames",void 0),t([p("restrictionAttributeNames")],d.prototype,"readRestrictionAttributes",null),t([D("restrictionAttributeNames")],d.prototype,"writeRestrictionAttributes",null),t([i({type:Number,json:{write:{allowNull:!0}}})],d.prototype,"simplificationTolerance",void 0),t([x(Q)],d.prototype,"simplificationToleranceUnits",void 0),t([x(ie,{ignoreUnknown:!1})],d.prototype,"timeAttributeName",void 0),t([x(ee)],d.prototype,"type",void 0),t([i({type:Boolean,json:{write:!0}})],d.prototype,"useHierarchy",void 0),t([x($)],d.prototype,"uturnAtJunctions",void 0),d=t([g("esri.rest.support.TravelMode")],d);const ae=d;let v=class extends S{constructor(e){super(e),this.accumulateAttributes=null,this.directionsLanguage=null,this.findBestSequence=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.startTimeIsUTC=null,this.timeWindowsAreUTC=null,this.travelMode=null}readAccumulateAttributes(e){return e==null?null:e.map(a=>C.fromJSON(a))}writeAccumulateAttributes(e,a,l){e!=null&&e.length&&(a[l]=e.map(m=>C.toJSON(m)))}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],v.prototype,"accumulateAttributes",void 0),t([p("accumulateAttributes")],v.prototype,"readAccumulateAttributes",null),t([D("accumulateAttributes")],v.prototype,"writeAccumulateAttributes",null),t([i({type:String,json:{write:!0}})],v.prototype,"directionsLanguage",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"findBestSequence",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"startTimeIsUTC",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"timeWindowsAreUTC",void 0),t([i({type:ae,json:{write:!0}})],v.prototype,"travelMode",void 0),v=t([g("esri.layers.support.RouteSettings")],v);const re=v;var q;let s=q=class extends A(S){constructor(e){super(e),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.type="route-info",this.version="1.0.0"}readEndTime(e,a){return a.attributes.EndTimeUTC!=null?new Date(a.attributes.EndTimeUTC):null}readEndTimeOffset(e,a){return B(a.attributes.EndTime,a.attributes.EndTimeUTC)}readStartTime(e,a){return a.attributes.StartTimeUTC!=null?new Date(a.attributes.StartTimeUTC):null}readStartTimeOffset(e,a){return B(a.attributes.StartTime,a.attributes.StartTimeUTC)}readTotalCosts(e,a){return f(a.attributes,"Total_")}readTotalViolations(e,a){return f(a.attributes,"TotalViolation_")}readTotalWait(e,a){return f(a.attributes,"TotalWait_")}static fromGraphic(e){return new q({analysisSettings:e.attributes.AnalysisSettings!=null?re.fromJSON(JSON.parse(e.attributes.AnalysisSettings)):null,endTime:e.attributes.EndTime!=null?new Date(e.attributes.EndTime):null,endTimeOffset:e.attributes.EndUTCOffset??null,geometry:e.geometry,messages:e.attributes.Messages!=null?JSON.parse(e.attributes.Messages):null,name:e.attributes.RouteName,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,startTime:e.attributes.StartTime!=null?new Date(e.attributes.StartTime):null,startTimeOffset:e.attributes.StartUTCOffset??null,symbol:e.symbol,totalCosts:e.attributes.TotalCosts!=null?E(JSON.parse(e.attributes.TotalCosts)):null,totalDistance:e.attributes.TotalMeters??null,totalDuration:e.attributes.TotalMinutes??null,totalLateDuration:e.attributes.TotalLateMinutes??null,totalWaitDuration:e.attributes.TotalWaitMinutes??null,version:e.attributes.Version})}toGraphic(){const e={ObjectID:this.objectId,AnalysisSettings:this.analysisSettings!=null?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:this.endTime!=null?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:this.messages!=null?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:this.startTime!=null?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:this.totalCosts!=null?JSON.stringify(j(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};s.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"EndUTCOffset",alias:"End Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Messages",alias:"Analysis Messages",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:1024,editable:!0,nullable:!0,visible:!0,domain:null},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"StartUTCOffset",alias:"Start Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Version",alias:"Version",type:"esriFieldTypeString",length:16,editable:!0,nullable:!0,visible:!0,domain:null}],s.popupInfo={title:"Route Details",fieldInfos:[{fieldName:"RouteName",label:"Route Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TotalMinutes",label:"Total Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalMeters",label:"Total Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalLateMinutes",label:"Total Late Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalWaitMinutes",label:"Total Wait Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalCosts",label:"Total Costs",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"StartTime",label:"Start Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"StartUTCOffset",label:"Start Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"EndTime",label:"End Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"EndUTCOffset",label:"End Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Messages",label:"Analysis Messages",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"AnalysisSettings",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"Version",label:"Version",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i()],s.prototype,"analysisSettings",void 0),t([i()],s.prototype,"endTime",void 0),t([p("endTime",["attributes.EndTimeUTC"])],s.prototype,"readEndTime",null),t([i()],s.prototype,"endTimeOffset",void 0),t([p("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],s.prototype,"readEndTimeOffset",null),t([i({json:{read:{source:"attributes.FirstStopID"}}})],s.prototype,"firstStopId",void 0),t([i({type:z})],s.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.LastStopID"}}})],s.prototype,"lastStopId",void 0),t([i()],s.prototype,"messages",void 0),t([i({json:{read:{source:"attributes.Name"}}})],s.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],s.prototype,"objectId",void 0),t([i({type:F})],s.prototype,"popupTemplate",void 0),t([i()],s.prototype,"startTime",void 0),t([p("startTime",["attributes.StartTimeUTC"])],s.prototype,"readStartTime",null),t([i()],s.prototype,"startTimeOffset",void 0),t([p("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],s.prototype,"readStartTimeOffset",null),t([i({json:{read:{source:"attributes.StopCount"}}})],s.prototype,"stopCount",void 0),t([i({types:I})],s.prototype,"symbol",void 0),t([i()],s.prototype,"totalCosts",void 0),t([p("totalCosts",["attributes"])],s.prototype,"readTotalCosts",null),t([i()],s.prototype,"totalDistance",void 0),t([i()],s.prototype,"totalDuration",void 0),t([i()],s.prototype,"totalLateDuration",void 0),t([i()],s.prototype,"totalViolations",void 0),t([p("totalViolations",["attributes"])],s.prototype,"readTotalViolations",null),t([i()],s.prototype,"totalWait",void 0),t([p("totalWait",["attributes"])],s.prototype,"readTotalWait",null),t([i()],s.prototype,"totalWaitDuration",void 0),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"type",void 0),t([i()],s.prototype,"version",void 0),s=q=t([g("esri.rest.support.RouteInfo")],s);const Se=s;var G;let r=G=class extends A(S){constructor(e){super(e),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(e,a){return B(a.attributes.ArriveTime,a.attributes.ArriveTimeUTC)}readCumulativeCosts(e,a){return f(a.attributes,"Cumul_")}readDepartTimeOffset(e,a){return B(a.attributes.DepartTime,a.attributes.DepartTimeUTC)}readServiceCosts(e,a){return f(a.attributes,"Attr_")}writeServiceCosts(e,a){Y(e,a,"Attr_")}writeTimeWindowEnd(e,a){e!=null&&(a.attributes||(a.attributes={}),a.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,a){e!=null&&(a.attributes||(a.attributes={}),a.attributes.TimeWindowStart=e.getTime())}readViolations(e,a){return f(a.attributes,"Violation_")}readWait(e,a){return f(a.attributes,"Wait_")}static fromGraphic(e){return new G({arriveCurbApproach:e.attributes.ArrivalCurbApproach!=null?b.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:e.attributes.CumulativeCosts!=null?E(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:e.attributes.CumulativeMeters??null,cumulativeDuration:e.attributes.CumulativeMinutes??null,curbApproach:e.attributes.CurbApproach!=null?b.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:e.attributes.DepartureCurbApproach!=null?b.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:e.attributes.DepartureTime!=null?new Date(e.attributes.DepartureTime):null,departTimeOffset:e.attributes.DepartureUTCOffset??null,geometry:e.geometry,lateDuration:e.attributes.LateMinutes??null,locationType:e.attributes.LocationType!=null?M.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:e.attributes.Sequence??null,serviceCosts:e.attributes.ServiceCosts!=null?E(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:e.attributes.ServiceMeters??null,serviceDuration:e.attributes.ServiceMinutes??null,status:e.attributes.Status!=null?O.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:e.attributes.TimeWindowEnd!=null?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:e.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:e.attributes.TimeWindowStart!=null?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:e.attributes.TimeWindowStartUTCOffset??null,waitDuration:e.attributes.WaitMinutes??null})}toGraphic(){const e={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach!=null?b.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime!=null?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts!=null?JSON.stringify(j(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach!=null?b.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach!=null?b.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime!=null?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType!=null?M.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts!=null?JSON.stringify(j(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status!=null?O.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd!=null?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart!=null?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};r.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"ArrivalUTCOffset",alias:"Arrival Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"DepartureUTCOffset",alias:"Departure Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNALocationType",codedValues:[{name:"Stop",code:0},{name:"Waypoint",code:1}]}},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Status",alias:"Status",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:"OK",code:0},{name:"Not Located on Network",code:1},{name:"Network Unbuilt",code:2},{name:"Prohibited Street",code:3},{name:"Invalid Field Values",code:4},{name:"Cannot Reach",code:5},{name:"Time Window Violation",code:6}]}},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowEndUTCOffset",alias:"Time Window End: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"WaitMinutes",alias:"Minutes Early",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1}],r.popupInfo={title:"{Name}",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"RouteName",label:"Route Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:"Sequence",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:"Arrival Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:"Arrival Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureTime",label:"Departure Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"DepartureUTCOffset",label:"Departure Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CurbApproach",label:"Curb Approach",isEditable:!0,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalCurbApproach",label:"Arrival Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureCurbApproach",label:"Departure Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Status",label:"Status",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"LocationType",label:"Location Type",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowStart",label:"Time Window Start",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowStartUTCOffset",label:"Time Window Start: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowEnd",label:"Time Window End",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowEndUTCOffset",label:"Time Window End: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMinutes",label:"Service Minutes",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMeters",label:"Service Meters",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceCosts",label:"Service Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"CumulativeMinutes",label:"Cumulative Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeMeters",label:"Cumulative Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeCosts",label:"Cumulative Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"LateMinutes",label:"Minutes Late",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"WaitMinutes",label:"Minutes Early",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i({type:b.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:b.read}}})],r.prototype,"arriveCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],r.prototype,"arriveTime",void 0),t([i()],r.prototype,"arriveTimeOffset",void 0),t([p("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],r.prototype,"readArriveTimeOffset",null),t([i({json:{name:"attributes.Bearing",read:!1,write:!0}})],r.prototype,"bearing",void 0),t([i({json:{name:"attributes.BearingTol",read:!1,write:!0}})],r.prototype,"bearingTol",void 0),t([i()],r.prototype,"cumulativeCosts",void 0),t([p("cumulativeCosts",["attributes"])],r.prototype,"readCumulativeCosts",null),t([i()],r.prototype,"cumulativeDistance",void 0),t([i()],r.prototype,"cumulativeDuration",void 0),t([i({type:b.apiValues,json:{name:"attributes.CurbApproach",read:{reader:b.read},write:{writer:b.write}}})],r.prototype,"curbApproach",void 0),t([i({type:b.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:b.read}}})],r.prototype,"departCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],r.prototype,"departTime",void 0),t([i()],r.prototype,"departTimeOffset",void 0),t([p("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],r.prototype,"readDepartTimeOffset",null),t([i({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],r.prototype,"distanceToNetworkInMeters",void 0),t([i({type:H,json:{write:!0}})],r.prototype,"geometry",void 0),t([i()],r.prototype,"lateDuration",void 0),t([i({type:M.apiValues,json:{name:"attributes.LocationType",read:{reader:M.read},write:{writer:M.write}}})],r.prototype,"locationType",void 0),t([i({json:{name:"attributes.Name"}})],r.prototype,"name",void 0),t([i({json:{name:"attributes.NavLatency",read:!1,write:!0}})],r.prototype,"navLatency",void 0),t([i({json:{name:"attributes.ObjectID"}})],r.prototype,"objectId",void 0),t([i({type:F})],r.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.PosAlong"}}})],r.prototype,"posAlong",void 0),t([i({json:{name:"attributes.RouteName"}})],r.prototype,"routeName",void 0),t([i()],r.prototype,"serviceCosts",void 0),t([p("serviceCosts",["attributes"])],r.prototype,"readServiceCosts",null),t([D("serviceCosts")],r.prototype,"writeServiceCosts",null),t([i()],r.prototype,"serviceDistance",void 0),t([i()],r.prototype,"serviceDuration",void 0),t([i({json:{name:"attributes.Sequence"}})],r.prototype,"sequence",void 0),t([i({type:L.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:L.read}}})],r.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SnapX"}}})],r.prototype,"snapX",void 0),t([i({json:{read:{source:"attributes.SnapY"}}})],r.prototype,"snapY",void 0),t([i({json:{read:{source:"attributes.SnapZ"}}})],r.prototype,"snapZ",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],r.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],r.prototype,"sourceOid",void 0),t([i({type:O.apiValues,json:{read:{source:"attributes.Status",reader:O.read}}})],r.prototype,"status",void 0),t([i({types:I})],r.prototype,"symbol",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowEnd"}})],r.prototype,"timeWindowEnd",void 0),t([D("timeWindowEnd")],r.prototype,"writeTimeWindowEnd",null),t([i()],r.prototype,"timeWindowEndOffset",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowStart"}})],r.prototype,"timeWindowStart",void 0),t([D("timeWindowStart")],r.prototype,"writeTimeWindowStart",null),t([i()],r.prototype,"timeWindowStartOffset",void 0),t([i({readOnly:!0,json:{read:!1}})],r.prototype,"type",void 0),t([i()],r.prototype,"violations",void 0),t([p("violations",["attributes"])],r.prototype,"readViolations",null),t([i()],r.prototype,"waitDuration",void 0),t([i()],r.prototype,"wait",void 0),t([p("wait",["attributes"])],r.prototype,"readWait",null),r=G=t([g("esri.rest.support.Stop")],r);const Ne=r;export{ve as C,X as D,Ne as O,be as R,Se as S,fe as T,C as U,ae as a,ce as b,Te as c,de as d,ne as e,ue as f,re as g,Q as i,ge as j,pe as k,$ as l,ye as m,B as n,he as o,se as r,oe as s,me as w,ie as y}; diff --git a/assets/StreamFeatureManager-4b8ac3ac.js b/assets/StreamFeatureManager-4b8ac3ac.js new file mode 100644 index 0000000..c80ed2d --- /dev/null +++ b/assets/StreamFeatureManager-4b8ac3ac.js @@ -0,0 +1 @@ +import{bI as _}from"./index-080e108a.js";class n{constructor(t){this.size=0,this._start=0,this.maxSize=t,this._buffer=new Array(t)}get entries(){return this._buffer}enqueue(t){if(this.size===this.maxSize){const e=this._buffer[this._start];return this._buffer[this._start]=t,this._start=(this._start+1)%this.maxSize,e}return this._buffer[(this._start+this.size++)%this.maxSize]=t,null}dequeue(){if(this.size===0)return null;const t=this._buffer[this._start];return this._buffer[this._start]=null,this.size--,this._start=(this._start+1)%this.maxSize,t}peek(){return this.size===0?null:this._buffer[this._start]}find(t){if(this.size===0)return null;for(const e of this._buffer)if(e!=null&&t(e))return e;return null}clear(t){let e=this.dequeue();for(;e!=null;)t&&t(e),e=this.dequeue()}}const c="__esri_stream_id__",a="__esri_timestamp__",d=1e3;class f{constructor(t,e,s,i,r=128){this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=s,this._purgeOptions=i,this.store=t,this.objectIdField=e,this.purgeInterval=r,this._useGeneratedIds=this.objectIdField===c}removeById(t){this._removed.push(t)}removeByTrackId(t){const e=this._trackIdToObservations.get(t);if(e)for(const s of e.entries)this._removed.push(s)}add(t){if(this._useGeneratedIds){const o=this._nextId();t.attributes[this.objectIdField]=o,t.objectId=o}else t.objectId=t.attributes[this.objectIdField];const e=t.objectId;if(this._addOrUpdated.set(e,t),this._maxAge=Math.max(this._maxAge,t.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return this._trackIdLessObservations==null&&(this._trackIdLessObservations=new n(1e5)),void this._trackIdLessObservations.enqueue(e);const s=t.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(s)){const o=this._purgeOptions!=null&&this._purgeOptions.maxObservations!=null?this._purgeOptions.maxObservations:d,h=_(o,0,d);this._trackIdToObservations.set(s,new n(h))}const i=this._trackIdToObservations.get(s),r=i==null?void 0:i.enqueue(e);r!=null&&(this._addOrUpdated.has(r)?this._addOrUpdated.delete(r):this._removed.push(r))}checkForUpdates(){const t=this._getToAdd(),e=this._getToRemove(),s=performance.now();s-this._lastPurge>=this.purgeInterval&&(this._purge(s),this._lastPurge=s);const i=[];if(e!=null)for(const o of e){const h=this.store.removeById(o);h!=null&&i.push(h)}const r=[];if(t!=null){const o=new Set(e??[]);for(const h of t)o.has(h.objectId)||(h.attributes[a]=s,this.store.add(h),r.push(h))}(r.length||i!=null&&i.length)&&this.store.update(r,i)}_getToAdd(){if(!this._addOrUpdated.size)return null;const t=new Array(this._addOrUpdated.size);let e=0;return this._addOrUpdated.forEach(s=>t[e++]=s),this._addOrUpdated.clear(),t}_getToRemove(){const t=this._removed;return this._removed.length?(this._removed=[],t):null}_nextId(){const t=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,t}_purge(t){const e=this._purgeOptions;e!=null&&(this._purgeSomeByDisplayCount(e),this._purgeByAge(e),this._purgeByAgeReceived(t,e),this._purgeTracks())}_purgeSomeByDisplayCount(t){if(!t.displayCount)return;let e=this.store.size;if(e>t.displayCount){if(this._timeInfo.trackIdField){for(const s of this._trackIdToObservations.values())if(e>t.displayCount&&s.size){const i=s.dequeue();this._removed.push(i),e--}}if(this._trackIdLessObservations!=null){let s=e-t.displayCount;for(;s-- >0;){const i=this._trackIdLessObservations.dequeue();i!=null&&this._removed.push(i)}}}}_purgeByAge(t){var r;const e=(r=this._timeInfo)==null?void 0:r.startTimeField;if(!t.age||!e)return;const s=60*t.age*1e3,i=this._maxAge-s;this.store.forEach(o=>{o.attributes[e]{i.attributes[a]{t.size===0&&this._trackIdToObservations.delete(e)})}}export{f as o,n as t}; diff --git a/assets/StreamLayer-bacc7345.js b/assets/StreamLayer-bacc7345.js new file mode 100644 index 0000000..e66d0a8 --- /dev/null +++ b/assets/StreamLayer-bacc7345.js @@ -0,0 +1 @@ +import{ai as t,aj as r,al as b,ck as T,eQ as P,eS as F,eR as k,bc as I,ar as d,as as D,hi as u,bz as _,aw as O,fy as y,aW as E,at as C,cq as N,hj as U,fR as A,ca as L,eZ as f,cC as G,ay as g,aA as J}from"./index-080e108a.js";import"./UniqueValueRenderer-fef4204d.js";import{o as M,p as V,n as z}from"./jsonUtils-f73b3833.js";import{O as W}from"./MultiOriginJSONSupport-e4912ffd.js";import{l as q}from"./ArcGISService-83287338.js";import{o as Q}from"./CustomParametersMixin-231c4be8.js";import{p as H}from"./FeatureEffectLayer-4160946c.js";import{n as K}from"./FeatureReductionLayer-4262cf54.js";import{c as X}from"./OperationalLayer-0e8f8b28.js";import{j as Z}from"./PortalLayer-310c2800.js";import{a as B}from"./TemporalLayer-f17c9161.js";import{m as Y,c as ee,D as te,I as ie,p as re,l as oe,f as se}from"./commonProperties-30089b06.js";import{v as ne}from"./featureLayerUtils-6cf06f83.js";import{s as ae}from"./fieldProperties-62c55499.js";import{C as pe}from"./LabelClass-2d53c485.js";import{i as le}from"./labelingInfo-144f3d9f.js";import{t as de}from"./styleUtils-25825fd6.js";import{b as me}from"./Query-1c961d4c.js";import{p as ce}from"./popupUtils-82ea8abb.js";import"./diffUtils-590c9088.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./FeatureEffect-86735d98.js";import"./FeatureFilter-00f4be05.js";import"./portalItemUtils-792a27e1.js";import"./sql-734ecbc5.js";import"./AttachmentQuery-972bbd60.js";import"./RelationshipQuery-39c07195.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";var h;let p=h=class extends T{constructor(){super(...arguments),this.age=null,this.ageReceived=null,this.displayCount=null,this.maxObservations=1}clone(){return new h({age:this.age,ageReceived:this.ageReceived,displayCount:this.displayCount,maxObservations:this.maxObservations})}};t([r({type:Number,json:{write:!0}})],p.prototype,"age",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,"ageReceived",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,"displayCount",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,"maxObservations",void 0),p=h=t([b("esri.layers.support.PurgeOptions")],p);const S=p,v=ae();function w(e,o){return new d("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${o}`,{layer:e})}let i=class extends K(H(P(B(F(k(q(X(Z(W(Q(J))))))))))){constructor(...e){super(...e),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.geometryDefinition=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.maxReconnectionAttempts=0,this.maxReconnectionInterval=20,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.operationalLayerType="ArcGISStreamLayer",this.popupEnabled=!0,this.popupTemplate=null,this.purgeOptions=new S,this.refreshInterval=0,this.screenSizePerspectiveEnabled=!0,this.sourceJSON=null,this.spatialReference=I.WGS84,this.type="stream",this.url=null,this.updateInterval=300,this.useViewTime=!0,this.webSocketUrl=null}normalizeCtorArgs(e,o){return typeof e=="string"?{url:e,...o}:e}load(e){if(!("WebSocket"in globalThis))return this.addResolvingPromise(Promise.reject(new d("stream-layer:websocket-unsupported","WebSocket is not supported in this browser. StreamLayer will not have real-time connection with the stream service."))),Promise.resolve(this);const o=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Stream Service","Feed"]},e).catch(D).then(()=>this._fetchService(o))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const o=this._normalizeFeatureReduction(e);this._set("featureReduction",o)}set renderer(e){u(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,o,s){var n;o=o.layerDefinition||o;const a=(n=o.drawingInfo)==null?void 0:n.renderer;if(a){const l=M(a,o,s)||void 0;return l||_.getLogger(this).error("Failed to create renderer",{rendererDefinition:o.drawingInfo.renderer,layer:this,context:s}),l}return ne(o,s)}async connect(e){const[{createConnection:o}]=await Promise.all([O(()=>import("./createConnection-4b117798.js"),["assets/createConnection-4b117798.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/Query-1c961d4c.js"]),this.load()]),s=this.geometryType?y.toJSON(this.geometryType):null,{customParameters:a=null,definitionExpression:n=null,geometryDefinition:l=null,maxReconnectionAttempts:x=0,maxReconnectionInterval:R=20,spatialReference:j=this.spatialReference}=e||this.createConnectionParameters(),m=o(this.parsedUrl,this.spatialReference,j,s,{geometry:l,where:n},x,R,a??void 0),$=E([this.on("send-message-to-socket",c=>m.sendMessageToSocket(c)),this.on("send-message-to-client",c=>m.sendMessageToClient(c))]);return m.once("destroy",$.remove),m}createConnectionParameters(){return{spatialReference:this.spatialReference,customParameters:this.customParameters,definitionExpression:this.definitionExpression,geometryDefinition:this.geometryDefinition,maxReconnectionAttempts:this.maxReconnectionAttempts,maxReconnectionInterval:this.maxReconnectionInterval}}createPopupTemplate(e){return ce(this,e)}createQuery(){const e=new me;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,o){if(!this.fields)return null;let s=null;return this.fields.some(a=>(a.name===e&&(s=a.domain),!!s)),s}getField(e){return this.fieldsIndex.get(e)}serviceSupportsSpatialReference(e){return!0}sendMessageToSocket(e){this.emit("send-message-to-socket",e)}sendMessageToClient(e){this.emit("send-message-to-client",e)}write(e,o){const s=o==null?void 0:o.messages;return this.webSocketUrl?(s==null||s.push(w(this,"using a custom websocket connection cannot be written to web scenes and web maps")),null):this.parsedUrl?super.write(e,o):(s==null||s.push(w(this,"using a client-side only connection without a url cannot be written to web scenes and web maps")),null)}async _fetchService(e){var o,s,a;if(!this.webSocketUrl&&this.parsedUrl){if(!this.sourceJSON){const{data:n}=await C(this.parsedUrl.path,{query:{f:"json",...this.customParameters,...this.parsedUrl.query},responseType:"json",signal:e});this.sourceJSON=n}}else{if(!((o=this.timeInfo)!=null&&o.trackIdField))throw new d("stream-layer:missing-metadata","The stream layer trackIdField must be specified.");if(!this.objectIdField){const n=(s=this.fields.find(l=>l.type==="oid"))==null?void 0:s.name;if(!n)throw new d("stream-layer:missing-metadata","The stream layer objectIdField must be specified.");this.objectIdField=n}if(!this.fields)throw new d("stream-layer:missing-metadata","The stream layer fields must be specified.");if(this.fields.some(n=>n.name===this.objectIdField)||this.fields.push(new N({name:this.objectIdField,alias:this.objectIdField,type:"oid"})),!this.geometryType)throw new d("stream-layer:missing-metadata","The stream layer geometryType must be specified.");this.webSocketUrl&&(this.url=this.webSocketUrl)}return this.read(this.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:(a=this.portalItem)==null?void 0:a.portal,url:this.parsedUrl}),u(this.renderer,this.fieldsIndex),U(this.timeInfo,this.fieldsIndex),this.objectIdField||(this.objectIdField="__esri_stream_id__"),de(this,{origin:"service"})}};t([r({type:String})],i.prototype,"copyright",void 0),t([r({readOnly:!0})],i.prototype,"defaultPopupTemplate",null),t([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r({type:String})],i.prototype,"displayField",void 0),t([r({type:A})],i.prototype,"elevationInfo",void 0),t([r({json:{origins:{"web-map":{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],i.prototype,"featureReduction",null),t([r(v.fields)],i.prototype,"fields",void 0),t([r(v.fieldsIndex)],i.prototype,"fieldsIndex",void 0),t([r({type:L,json:{name:"layerDefinition.definitionGeometry",write:!0}})],i.prototype,"geometryDefinition",void 0),t([r({type:y.apiValues,json:{read:{reader:y.read}}})],i.prototype,"geometryType",void 0),t([r(Y)],i.prototype,"labelsVisible",void 0),t([r({type:[pe],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo",reader:le},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],i.prototype,"labelingInfo",void 0),t([r(ee)],i.prototype,"legendEnabled",void 0),t([r({type:["show","hide"]})],i.prototype,"listMode",void 0),t([r({type:f})],i.prototype,"maxReconnectionAttempts",void 0),t([r({type:f})],i.prototype,"maxReconnectionInterval",void 0),t([r(te)],i.prototype,"maxScale",void 0),t([r(ie)],i.prototype,"minScale",void 0),t([r({type:String})],i.prototype,"objectIdField",void 0),t([r({value:"ArcGISStreamLayer",type:["ArcGISStreamLayer"]})],i.prototype,"operationalLayerType",void 0),t([r(re)],i.prototype,"popupEnabled",void 0),t([r({type:G,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),t([r({type:S})],i.prototype,"purgeOptions",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"refreshInterval",void 0),t([r({types:V,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{name:"layerDefinition.drawingInfo.renderer",types:z,write:!0}},write:{target:"layerDefinition.drawingInfo.renderer"}}})],i.prototype,"renderer",null),t([g("service","renderer",["drawingInfo.renderer","defaultSymbol"]),g("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],i.prototype,"readRenderer",null),t([r(oe)],i.prototype,"screenSizePerspectiveEnabled",void 0),t([r()],i.prototype,"sourceJSON",void 0),t([r({type:I,json:{origins:{service:{read:{source:"spatialReference"}}}}})],i.prototype,"spatialReference",void 0),t([r({json:{read:!1}})],i.prototype,"type",void 0),t([r(se)],i.prototype,"url",void 0),t([r({type:Number})],i.prototype,"updateInterval",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"useViewTime",void 0),t([r({type:String})],i.prototype,"webSocketUrl",void 0),i=t([b("esri.layers.StreamLayer")],i);const ze=i;export{ze as default}; diff --git a/assets/StreamLayerView3D-9f3bc35d.js b/assets/StreamLayerView3D-9f3bc35d.js new file mode 100644 index 0000000..7222a75 --- /dev/null +++ b/assets/StreamLayerView3D-9f3bc35d.js @@ -0,0 +1 @@ +import{ai as r,aj as o,al as p,cX as P,cY as M,ao as R,ah as y,fy as U,aG as _,aK as k,aD as $,ar as T}from"./index-080e108a.js";import{o as C}from"./StreamFeatureManager-4b8ac3ac.js";import{createConnection as x}from"./createConnection-4b117798.js";import{r as G}from"./EventedSet-d13fada5.js";import{b as j}from"./Query-1c961d4c.js";import{E}from"./FeatureLikeLayerView3D-2e3185ce.js";import{n as V}from"./LayerView3D-ffd35809.js";import{d as L}from"./LayerView-448bc5ea.js";import{d as F}from"./FeatureFilter-00f4be05.js";import"./query-93c6e211.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./dehydratedFeatureComparison-a3375a3e.js";import"./queryForSymbologySnapping-0264f2b5.js";import"./elevationInfoUtils-4fd79d95.js";import"./hash-6f442295.js";import"./diffUtils-590c9088.js";import"./Graphics3DObjectStates-bb2a6162.js";import"./UniqueValueRenderer-fef4204d.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./popupUtils-f04ec9a9.js";import"./floorFilterUtils-080a7cd2.js";import"./QueryEngine-19eda5ff.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./FeatureSet-111cb247.js";import"./FeatureStore-f0e312fc.js";import"./BoundsStore-b6bd3c14.js";import"./projectExtentUtils-efa4cddd.js";const N=2500;let l=class extends k{getObjectId(){return this.objectId}};r([o({type:Number,json:{read:!0}})],l.prototype,"objectId",void 0),l=r([p("esri.layers.graphics.controllers.StreamGraphic")],l);let z=class{constructor(t){this.onUpdate=t,this._idToGraphic=new Map}destroy(){this._idToGraphic.clear()}add(t){this._idToGraphic.set(t.objectId,t)}get(t){return this._idToGraphic.get(t)}forEach(t){this._idToGraphic.forEach(t)}removeById(t){const s=this._idToGraphic.get(t);return s?(s.sourceLayer=s.layer=null,this._idToGraphic.delete(t),s):null}update(t,s){this.onUpdate(t,s)}get size(){return this._idToGraphic.size}},a=class extends P(M(R)){constructor(){super(...arguments),this.isPaused=!1,this.graphics=new G,this._updateInfo={websocket:0,client:0},this._updateIntervalId=null,this._outSpatialReference=null}initialize(){this.addResolvingPromise(this.layer.when(()=>this._startup()))}destroy(){this.clear()}_clearInterval(){this._updateIntervalId!==null&&(clearInterval(this._updateIntervalId),this._updateIntervalId=null)}clear(){this._clearInterval(),this.connection=y(this.connection),this.store=y(this.store),this.graphics.clear(),this.handles.removeAll()}get updating(){return!this.connection||this.connection.connectionStatus==="connected"}_startup(){const{layer:e,layerView:t}=this,{spatialReference:s,definitionExpression:c,geometryDefinition:d,objectIdField:h,timeInfo:f,purgeOptions:g,maxReconnectionAttempts:v,maxReconnectionInterval:I,customParameters:S}=e,w=e.geometryType?U.toJSON(e.geometryType):null,b=s,u=t.view.spatialReference,O={geometry:d,where:c};this.clear(),this._set("connection",x(e.parsedUrl,b,u,w,O,v,I,S??void 0)),this._outSpatialReference=u.toJSON(),this.store=new z(this._onUpdate.bind(this)),this.featuresManager=new C(this.store,h,f.toJSON(),g);const m="startup-watches";this.handles.remove(m),this.handles.add([e.on("send-message-to-socket",n=>this.connection.sendMessageToSocket(n)),e.on("send-message-to-client",n=>this.connection.sendMessageToClient(n)),this.connection.on("data-received",n=>this._onFeature(n)),this.connection.on("message-received",n=>this._onWebSocketMessage(n)),_(()=>[e.definitionExpression,e.geometryDefinition,e.purgeOptions],()=>this._startup())],m),this.isPaused||this._initUpdateInterval()}_onWebSocketMessage(e){if(this.layerView.emit("message-received",e),"type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this.featuresManager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this.featuresManager.removeByTrackId(t);break;case"clear":this.store.forEach(t=>this.featuresManager.removeById(t.objectId))}}_onFeature(e){this._updateInfo.websocket++,this.layerView.hasEventListener("data-received")&&this.layerView.emit("data-received",{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry});try{e.geometry==null||e.geometry.spatialReference||(e.geometry.spatialReference=this._outSpatialReference);const t=l.fromJSON(e);t.sourceLayer=t.layer=this.layer,this.featuresManager.add(t)}catch{}}_onUpdate(e,t){t!=null&&this.graphics.removeMany(t),e!=null&&(this._updateInfo.client+=e.length,this.graphics.addMany(e))}_initUpdateInterval(){this._clearInterval();const{updateInterval:e}=this.layer;let t=performance.now();this._updateIntervalId=setInterval(()=>{const s=performance.now(),c=s-t;if(c>N){t=s;const d=Math.round(this._updateInfo.client/(c/1e3)),h=Math.round(this._updateInfo.websocket/(c/1e3));this._updateInfo.client=0,this._updateInfo.websocket=0,this.layerView.emit("update-rate",{client:d,websocket:h})}this.featuresManager.checkForUpdates()},e)}pauseStream(){this.isPaused=!0,this._clearInterval()}resumeStream(){this.isPaused=!1,this._initUpdateInterval()}};r([o()],a.prototype,"isPaused",void 0),r([o({constructOnly:!0})],a.prototype,"layer",void 0),r([o({constructOnly:!0})],a.prototype,"layerView",void 0),r([o()],a.prototype,"connection",void 0),r([o({readOnly:!0})],a.prototype,"updating",null),a=r([p("esri.layers.graphics.controllers.StreamController")],a);const B=e=>{let t=class extends e{resume(){this._isUserPaused=!1,this.suspended||this._doResume()}pause(){this._isUserPaused=!0,this.suspended||this._doPause()}constructor(...s){super(...s),this._isUserPaused=!1,this.filter=null}get connectionStatus(){return this._isUserPaused?"paused":this._streamConnectionStatus}_onSuspendedChange(s){s?this._doPause():this._isUserPaused||this._doResume()}};return r([o()],t.prototype,"_isUserPaused",void 0),r([o({readOnly:!0})],t.prototype,"connectionStatus",null),r([o({type:F})],t.prototype,"filter",void 0),t=r([p("esri.layers.mixins.StreamLayerView")],t),t};let i=class extends B(E(V(L))){constructor(){super(...arguments),this.type="stream-3d",this.updatePolicy=$.ASYNC,this.hasZ=!0,this.hasM=!1}initialize(){this.handles.add(_(()=>this.suspended,e=>{this.controller&&this._onSuspendedChange(e)}))}get connectionError(){const e=this.get("controller.connection.errorString");return e?new T("stream-controller",e):null}createQuery(){return new j({outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference})}queryLatestObservations(e,t){return this.queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t==null?void 0:t.signal)}get _streamConnectionStatus(){var e,t;return((t=(e=this.controller)==null?void 0:e.connection)==null?void 0:t.connectionStatus)??"disconnected"}createController(){return new a({layer:this.layer,layerView:this})}beforeSetController(){}_doPause(){var e;(e=this.controller)==null||e.pauseStream()}_doResume(){var e;(e=this.controller)==null||e.resumeStream()}};r([o({readOnly:!0})],i.prototype,"updatePolicy",void 0),r([o({readOnly:!0})],i.prototype,"connectionError",null),r([o()],i.prototype,"controller",void 0),r([o({readOnly:!0})],i.prototype,"hasZ",void 0),r([o({readOnly:!0})],i.prototype,"hasM",void 0),r([o({readOnly:!0})],i.prototype,"_streamConnectionStatus",null),i=r([p("esri.views.3d.layers.StreamLayerView3D")],i);const Ee=i;export{Ee as default}; diff --git a/assets/StyleRepository-2362164f.js b/assets/StyleRepository-2362164f.js new file mode 100644 index 0000000..9b82290 --- /dev/null +++ b/assets/StyleRepository-2362164f.js @@ -0,0 +1,9 @@ +import{n0 as _,m$ as x,bh as D,rf as W,rg as v,rh as M,ri as Q}from"./index-080e108a.js";import{v as Xt,p as te,z as ee}from"./colorUtils-c0f43caf.js";import{t as vt}from"./TileClipper-ae6eca9e.js";import{$ as ge}from"./definitions-0bc08d4c.js";const Ye=Number.POSITIVE_INFINITY,St=Math.PI,He=2*St,_e=128/St,je=St/180,de=1/Math.LN2;function me(n,t){return(n%=t)>=0?n:n+t}function Ke(n){return me(n*_e,256)}function qe(n){return Math.log(n)*de}function U(n,t,e){return n*(1-e)+t*e}let we=class{constructor(t){this._array=[],t<=0&&console.error("strideInBytes must be positive!"),this._stride=t}get array(){return this._array}get index(){return 4*this._array.length/this._stride}get itemSize(){return this._stride}get sizeInBytes(){return 4*this._array.length}reset(){this.array.length=0}toBuffer(){return new Uint32Array(this._array).buffer}static i1616to32(t,e){return 65535&t|e<<16}static i8888to32(t,e,r,s){return 255&t|(255&e)<<8|(255&r)<<16|s<<24}static i8816to32(t,e,r){return 255&t|(255&e)<<8|r<<16}};var c,K;(function(n){n[n.R8_SIGNED=0]="R8_SIGNED",n[n.R8_UNSIGNED=1]="R8_UNSIGNED",n[n.R16_SIGNED=2]="R16_SIGNED",n[n.R16_UNSIGNED=3]="R16_UNSIGNED",n[n.R8G8_SIGNED=4]="R8G8_SIGNED",n[n.R8G8_UNSIGNED=5]="R8G8_UNSIGNED",n[n.R16G16_SIGNED=6]="R16G16_SIGNED",n[n.R16G16_UNSIGNED=7]="R16G16_UNSIGNED",n[n.R8G8B8A8_SIGNED=8]="R8G8B8A8_SIGNED",n[n.R8G8B8A8_UNSIGNED=9]="R8G8B8A8_UNSIGNED",n[n.R8G8B8A8_COLOR=10]="R8G8B8A8_COLOR",n[n.R16G16B16A16_DASHARRAY=11]="R16G16B16A16_DASHARRAY",n[n.R16G16B16A16_PATTERN=12]="R16G16B16A16_PATTERN"})(c||(c={})),function(n){n[n.UNIFORM=0]="UNIFORM",n[n.DATA_DRIVEN=1]="DATA_DRIVEN",n[n.INTERPOLATED_DATA_DRIVEN=2]="INTERPOLATED_DATA_DRIVEN",n[n.UNUSED=3]="UNUSED"}(K||(K={}));let H=class Dt{constructor(t){this._locations=new Map,this._key=t}get key(){return this._key}get type(){return 7&this._key}defines(){return[]}getStride(){return this._layoutInfo||this._buildAttributesInfo(),this._stride}getAttributeLocations(){return this._locations.size===0&&this._buildAttributesInfo(),this._locations}getLayoutInfo(){return this._layoutInfo||this._buildAttributesInfo(),this._layoutInfo}getEncodingInfos(){return this._propertyEncodingInfo||this._buildAttributesInfo(),this._propertyEncodingInfo}getUniforms(){return this._uniforms||this._buildAttributesInfo(),this._uniforms}getShaderHeader(){return this._shaderHeader||this._buildAttributesInfo(),this._shaderHeader}getShaderMain(){return this._shaderMain||this._buildAttributesInfo(),this._shaderMain}setDataUniforms(t,e,r,s,i){const o=this.getUniforms();for(const a of o){const{name:l,type:u,getValue:p}=a,h=p(r,e,s,i);if(h!==null)switch(u){case"float":t.setUniform1f(l,h);break;case"vec2":t.setUniform2fv(l,h);break;case"vec4":t.setUniform4fv(l,h)}}}encodeAttributes(t,e,r,s){var p;const i=this.attributesInfo(),o=this.getEncodingInfos(),a=[];let l=0,u=0;for(const h of Object.keys(o)){const f=o[h],{type:m,precisionFactor:g,isLayout:A}=i[h],w=A?r.getLayoutProperty(h):r.getPaintProperty(h),S=(p=w.interpolator)==null?void 0:p.getInterpolationRange(e);let d=0;for(const I of f){const{offset:E,bufferElementsToAdd:L}=I;if(L>0){for(let N=0;N4)s++,N={dataIndex:s,count:0,offset:0},I!==4&&(r[R]=N),t.push({location:-1,name:"a_data_"+s,count:I,type:S,normalized:E}),$=Math.ceil(Math.max(L/4,1));else{const z=t[N.dataIndex];z.count+=I,$=Math.ceil(Math.max(z.count*d/4,1))-Math.ceil(Math.max(N.offset/4,1))}g.push({dataIndex:N.dataIndex,offset:N.offset,bufferElementsToAdd:$}),N.offset+=L,N.count+=I}}for(const h of t)switch(h.type){case _.BYTE:case _.UNSIGNED_BYTE:h.count=4;break;case _.SHORT:case _.UNSIGNED_SHORT:h.count+=h.count%2}this._buildVertexBufferLayout(t);let l=0;const u=this._layoutInfo.geometry;for(const h of u)this._locations.set(h.name,l++);const p=this._layoutInfo.opacity;if(p)for(const h of p)this._locations.set(h.name,l++);this._buildShaderInfo(t,e),this._propertyEncodingInfo=e}_buildVertexBufferLayout(t){const e={},r=this.geometryInfo();let s=r[0].stride;if(t.length===0)e.geometry=r;else{const i=[];let o=s;for(const a of t)s+=re(a.type)*a.count;for(const a of r)i.push(new x(a.name,a.count,a.type,a.offset,s,a.normalized));for(const a of t)i.push(new x(a.name,a.count,a.type,o,s,a.normalized)),o+=re(a.type)*a.count;e.geometry=i}this.opacityInfo()&&(e.opacity=this.opacityInfo()),this._layoutInfo=e,this._stride=s}_buildShaderInfo(t,e){let r=` +`,s=` +`;const i=[];for(const u of t)r+=`attribute ${this._getType(u.count)} ${u.name}; +`;const o=this.attributes(),a=this.attributesInfo();let l=-1;for(const u of o){l++;const{name:p,type:h,precisionFactor:f,isLayout:m}=a[u],g=f&&f!==1?" * "+1/f:"",{bytesPerElement:A,count:w}=Dt._encodingInfo[h],S=d=>`a_data_${d.dataIndex}${Ee(w,d.offset,A)}`;switch(this.getAtributeState(l)){case K.UNIFORM:{const d=this._getType(w),I=`u_${p}`;i.push({name:I,type:d,getValue:(E,L,R,N)=>{const $=m?E.getLayoutValue(u,L):E.getPaintValue(u,L);if(h===c.R16G16B16A16_DASHARRAY){const z=E.getDashKey($,E.getLayoutValue("line-cap",L)),it=N.getMosaicItemPosition(z,!1);if(it==null)return null;const{tl:nt,br:Jt}=it;return[nt[0],Jt[1],Jt[0],nt[1]]}if(h===c.R16G16B16A16_PATTERN){const z=N.getMosaicItemPosition($,!u.includes("line-"));if(z==null)return null;const{tl:it,br:nt}=z;return[it[0],nt[1],nt[0],it[1]]}if(h===c.R8G8B8A8_COLOR){const z=$[3];return[z*$[0],z*$[1],z*$[2],z]}return $}}),r+=`uniform ${d} ${I}; +`,s+=`${d} ${p} = ${I}; +`}break;case K.DATA_DRIVEN:{const d=S(e[u][0]);s+=`${this._getType(w)} ${p} = ${d}${g}; +`}break;case K.INTERPOLATED_DATA_DRIVEN:{const d=`u_t_${p}`;i.push({name:d,type:"float",getValue:(L,R,N,$)=>(m?L.getLayoutProperty(u):L.getPaintProperty(u)).interpolator.interpolationUniformValue(N,R)}),r+=`uniform float ${d}; +`;const I=S(e[u][0]),E=S(e[u][1]);s+=`${this._getType(w)} ${p} = mix(${I}${g}, ${E}${g}, ${d}); +`}}}this._shaderHeader=r,this._shaderMain=s,this._uniforms=i}_bit(t){return(this._key&1<>t}_getType(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4"}throw new Error("Invalid count")}_encodeColor(t){const e=255*t[3];return we.i8888to32(t[0]*e,t[1]*e,t[2]*e,e)}_encodePattern(t,e,r){if(!r||!r.rect)return;const s=2,i=r.rect,o=r.width,a=r.height;e[t]=this._encodeShort(i.x+s,0),e[t]|=this._encodeShort(i.y+s+a,16),e[t+1]=this._encodeShort(i.x+s+o,0),e[t+1]|=this._encodeShort(i.y+s,16)}_encodeByte(t,e){return(255&t)<{switch(n){case _.FLOAT:case _.INT:case _.UNSIGNED_INT:return 4;case _.SHORT:case _.UNSIGNED_SHORT:return 2;case _.BYTE:case _.UNSIGNED_BYTE:return 1}},Ee=(n,t,e)=>{const r=t/e;if(n===1)switch(r){case 0:return".x";case 1:return".y";case 2:return".z";case 3:return".w"}else if(n===2)switch(r){case 0:return".xy";case 1:return".yz";case 2:return".zw"}else if(n===3)switch(r){case 0:return".xyz";case 1:return".yzw"}return""};let J=class pt extends H{constructor(t){super(t)}geometryInfo(){return pt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return pt.ATTRIBUTES}attributesInfo(){return pt.ATTRIBUTES_INFO}};J.ATTRIBUTES=[],J.GEOMETRY_LAYOUT=[new x("a_pos",2,_.BYTE,0,2)],J.ATTRIBUTES_INFO={};let X=class yt extends H{constructor(t){super(t)}geometryInfo(){return yt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return yt.ATTRIBUTES}attributesInfo(){return yt.ATTRIBUTES_INFO}};X.ATTRIBUTES=["circle-radius","circle-color","circle-opacity","circle-stroke-width","circle-stroke-color","circle-stroke-opacity","circle-blur"],X.GEOMETRY_LAYOUT=[new x("a_pos",2,_.SHORT,0,4)],X.ATTRIBUTES_INFO={"circle-radius":{name:"radius",type:c.R8_UNSIGNED},"circle-color":{name:"color",type:c.R8G8B8A8_COLOR},"circle-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"circle-stroke-width":{name:"stroke_width",type:c.R8_UNSIGNED,precisionFactor:4},"circle-stroke-color":{name:"stroke_color",type:c.R8G8B8A8_COLOR},"circle-stroke-opacity":{name:"stroke_opacity",type:c.R8_UNSIGNED,precisionFactor:100},"circle-blur":{name:"blur",type:c.R8_UNSIGNED,precisionFactor:32}};let tt=class ft extends H{constructor(t){super(t)}geometryInfo(){return ft.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return ft.ATTRIBUTES}attributesInfo(){return ft.ATTRIBUTES_INFO}};tt.ATTRIBUTES=["fill-color","fill-opacity","fill-pattern"],tt.GEOMETRY_LAYOUT=[new x("a_pos",2,_.SHORT,0,4)],tt.ATTRIBUTES_INFO={"fill-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"fill-pattern":{name:"tlbr",type:c.R16G16B16A16_PATTERN,isOptional:!0}};let V=class Z extends H{constructor(t,e){super(t),this._usefillColor=e}geometryInfo(){return Z.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return this._usefillColor?Z.ATTRIBUTES_FILL:Z.ATTRIBUTES_OUTLINE}attributesInfo(){return this._usefillColor?Z.ATTRIBUTES_INFO_FILL:Z.ATTRIBUTES_INFO_OUTLINE}};V.ATTRIBUTES_OUTLINE=["fill-outline-color","fill-opacity"],V.ATTRIBUTES_FILL=["fill-color","fill-opacity"],V.GEOMETRY_LAYOUT=[new x("a_pos",2,_.SHORT,0,8),new x("a_offset",2,_.BYTE,4,8),new x("a_xnormal",2,_.BYTE,6,8)],V.ATTRIBUTES_INFO_OUTLINE={"fill-outline-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100}},V.ATTRIBUTES_INFO_FILL={"fill-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100}};let et=class gt extends H{constructor(t){super(t)}geometryInfo(){return gt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return gt.ATTRIBUTES}attributesInfo(){return gt.ATTRIBUTES_INFO}};et.ATTRIBUTES=["line-blur","line-color","line-gap-width","line-offset","line-opacity","line-width","line-pattern","line-dasharray"],et.GEOMETRY_LAYOUT=[new x("a_pos",2,_.SHORT,0,16),new x("a_extrude_offset",4,_.BYTE,4,16),new x("a_dir_normal",4,_.BYTE,8,16),new x("a_accumulatedDistance",2,_.UNSIGNED_SHORT,12,16)],et.ATTRIBUTES_INFO={"line-width":{name:"width",type:c.R8_UNSIGNED,precisionFactor:2},"line-gap-width":{name:"gap_width",type:c.R8_UNSIGNED,precisionFactor:2},"line-offset":{name:"offset",type:c.R8_SIGNED,precisionFactor:2},"line-color":{name:"color",type:c.R8G8B8A8_COLOR},"line-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"line-blur":{name:"blur",type:c.R8_UNSIGNED,precisionFactor:4},"line-pattern":{name:"tlbr",type:c.R16G16B16A16_PATTERN,isOptional:!0},"line-dasharray":{name:"tlbr",type:c.R16G16B16A16_DASHARRAY,isOptional:!0}};const le=[new x("a_pos",2,_.SHORT,0,16),new x("a_vertexOffset",2,_.SHORT,4,16),new x("a_texAngleRange",4,_.UNSIGNED_BYTE,8,16),new x("a_levelInfo",4,_.UNSIGNED_BYTE,12,16)],ue=[new x("a_opacityInfo",1,_.UNSIGNED_BYTE,0,1)];let ot=class Rt extends H{constructor(t){super(t)}geometryInfo(){return le}opacityInfo(){return ue}attributes(){return Rt.ATTRIBUTES}attributesInfo(){return Rt.ATTRIBUTES_INFO}};ot.ATTRIBUTES=["icon-color","icon-opacity","icon-halo-blur","icon-halo-color","icon-halo-width","icon-size"],ot.ATTRIBUTES_INFO={"icon-color":{name:"color",type:c.R8G8B8A8_COLOR},"icon-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"icon-halo-color":{name:"halo_color",type:c.R8G8B8A8_COLOR},"icon-halo-width":{name:"halo_width",type:c.R8_UNSIGNED,precisionFactor:4},"icon-halo-blur":{name:"halo_blur",type:c.R8_UNSIGNED,precisionFactor:4},"icon-size":{name:"size",type:c.R8_UNSIGNED,precisionFactor:32,isLayout:!0}};let lt=class Nt extends H{constructor(t){super(t)}geometryInfo(){return le}opacityInfo(){return ue}attributes(){return Nt.ATTRIBUTES}attributesInfo(){return Nt.ATTRIBUTES_INFO}};lt.ATTRIBUTES=["text-color","text-opacity","text-halo-blur","text-halo-color","text-halo-width","text-size"],lt.ATTRIBUTES_INFO={"text-color":{name:"color",type:c.R8G8B8A8_COLOR},"text-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"text-halo-color":{name:"halo_color",type:c.R8G8B8A8_COLOR},"text-halo-width":{name:"halo_width",type:c.R8_UNSIGNED,precisionFactor:4},"text-halo-blur":{name:"halo_blur",type:c.R8_UNSIGNED,precisionFactor:4},"text-size":{name:"size",type:c.R8_UNSIGNED,isLayout:!0}};function be(n,t,e,r){const s=3*n,i=3*(e-n)-s,o=1-s-i,a=3*t,l=3*(r-t)-a,u=1-a-l;function p(g){return((o*g+i)*g+s)*g}function h(g){return((u*g+l)*g+a)*g}function f(g){return(3*o*g+2*i)*g+s}function m(g,A){let w,S,d,I,E,L;for(d=g,L=0;L<8;L++){if(I=p(d)-g,Math.abs(I)S)return S;for(;wI?w=d:S=d,d=.5*(S-w)+w}return d}return function(g,A=1e-6){return h(m(g,A))}}const ce={kind:"null"},T={kind:"number"},k={kind:"string"},P={kind:"boolean"},Y={kind:"color"},bt={kind:"object"},C={kind:"value"};function ct(n,t){return{kind:"array",itemType:n,n:t}}const Te=[ce,T,k,P,Y,bt,ct(C)];function rt(n){if(n.kind==="array"){const t=rt(n.itemType);return typeof n.n=="number"?`array<${t}, ${n.n}>`:n.itemType.kind==="value"?"array":`array<${t}>`}return n.kind}function Tt(n){if(n===null)return ce;if(typeof n=="string")return k;if(typeof n=="boolean")return P;if(typeof n=="number")return T;if(n instanceof D)return Y;if(Array.isArray(n)){let t;for(const e of n){const r=Tt(e);if(t){if(t!==r){t=C;break}}else t=r}return ct(t||C,n.length)}return typeof n=="object"?bt:C}function At(n,t){if(t.kind==="array")return n.kind==="array"&&(n.n===0&&n.itemType.kind==="value"||At(n.itemType,t.itemType))&&(typeof t.n!="number"||t.n===n.n);if(t.kind==="value"){for(const e of Te)if(At(n,e))return!0}return t.kind===n.kind}function xt(n){if(n===null)return"";const t=typeof n;return t==="string"?n:t==="number"||t==="boolean"?String(n):n instanceof D?n.toString():JSON.stringify(n)}let Ie=class{constructor(t){this._parent=t,this._vars={}}add(t,e){this._vars[t]=e}get(t){return this._vars[t]?this._vars[t]:this._parent?this._parent.get(t):null}};class Lt{constructor(){this.type=C}static parse(t){if(t.length>1)throw new Error('"id" does not expect arguments');return new Lt}evaluate(t,e){return t==null?void 0:t.id}}class Ut{constructor(){this.type=k}static parse(t){if(t.length>1)throw new Error('"geometry-type" does not expect arguments');return new Ut}evaluate(t,e){if(!t)return null;switch(t.type){case vt.Point:return"Point";case vt.LineString:return"LineString";case vt.Polygon:return"Polygon";default:return null}}}let ve=class he{constructor(){this.type=bt}static parse(t){if(t.length>1)throw new Error('"properties" does not expect arguments');return new he}evaluate(t,e){return t==null?void 0:t.values}};class It{constructor(){this.type=T}static parse(t){if(t.length>1)throw new Error('"zoom" does not expect arguments');return new It}evaluate(t,e){return e}}class G{constructor(t,e,r){this._lhs=t,this._rhs=e,this._compare=r,this.type=P}static parse(t,e,r){if(t.length!==3&&t.length!==4)throw new Error(`"${t[0]}" expects 2 or 3 arguments`);if(t.length===4)throw new Error(`"${t[0]}" collator not supported`);return new G(y(t[1],e),y(t[2],e),r)}evaluate(t,e){return this._compare(this._lhs.evaluate(t,e),this._rhs.evaluate(t,e))}}class De extends G{static parse(t,e){return G.parse(t,e,(r,s)=>r===s)}}class Re extends G{static parse(t,e){return G.parse(t,e,(r,s)=>r!==s)}}class Ne extends G{static parse(t,e){return G.parse(t,e,(r,s)=>rr<=s)}}class xe extends G{static parse(t,e){return G.parse(t,e,(r,s)=>r>s)}}class Pe extends G{static parse(t,e){return G.parse(t,e,(r,s)=>r>=s)}}class Bt{constructor(t){this._arg=t,this.type=P}static parse(t,e){if(t.length!==2)throw new Error('"!" expects 1 argument');return new Bt(y(t[1],e))}evaluate(t,e){return!this._arg.evaluate(t,e)}}class Ot{constructor(t){this._args=t,this.type=P}static parse(t,e){const r=[];for(let s=1;s1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error(`"${t[0]}" unknown interpolation type "${i[0]}"`)}if(t.length%2!=1)throw new Error(`"${s}" expects an even number of arguments`);const o=y(t[2],e,T);let a;s==="interpolate-hcl"||s==="interpolate-lab"?a=Y:r&&r.kind!=="value"&&(a=r);const l=[];for(let u=3;u=p)throw new Error(`"${s}" requires strictly ascending stop inputs`);const h=y(t[u+1],e,a);a||(a=h.type),l.push([p,h])}if(a&&a!==Y&&a!==T&&(a.kind!=="array"||a.itemType!==T))throw new Error(`"${s}" cannot interpolate type ${rt(a)}`);return new j(s,a,i,o,l)}evaluate(t,e){const r=this._stops;if(r.length===1)return r[0][1].evaluate(t,e);const s=this.input.evaluate(t,e);if(s<=r[0][0])return r[0][1].evaluate(t,e);if(s>=r[r.length-1][0])return r[r.length-1][1].evaluate(t,e);let i=0;for(;++iU(h,p[f],l));if(this.type.kind==="color"&&u instanceof D&&p instanceof D){const h=new D(u),f=new D(p);return new D([U(h.r,f.r,l),U(h.g,f.g,l),U(h.b,f.b,l),U(h.a,f.a,l)])}if(this.type.kind==="number"&&typeof u=="number"&&typeof p=="number")return U(u,p,l);throw new Error(`"${this._operator}" cannot interpolate type ${rt(this.type)}`)}if(this._operator==="interpolate-hcl"){const h=Xt(u),f=Xt(p),m=f.h-h.h,g=te({h:h.h+l*(m>180||m<-180?m-360*Math.round(m/360):m),c:U(h.c,f.c,l),l:U(h.l,f.l,l)});return new D({a:U(u.a,p.a,l),...g})}if(this._operator==="interpolate-lab"){const h=ee(u),f=ee(p),m=te({l:U(h.l,f.l,l),a:U(h.a,f.a,l),b:U(h.b,f.b,l)});return new D({a:U(u.a,p.a,l),...m})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(t,e){const r=this._stops;if(r.length===1||t>=r[r.length-1][0])return 0;let s=0;for(;++s=r)return[r,r];let s=0;for(;++s1&&(i=1),i}static _exponentialInterpolationRatio(t,e,r,s){const i=s-r;if(i===0)return 0;const o=t-r;return e===1?o/i:(e**o-1)/(e**i-1)}};class Ft{constructor(t,e,r){this.type=t,this._input=e,this._stops=r}static parse(t,e){if(t.length<5)throw new Error('"step" expects at least 4 arguments');if(t.length%2!=1)throw new Error('"step" expects an even number of arguments');const r=y(t[1],e,T);let s;const i=[];i.push([-1/0,y(t[2],e)]);for(let o=3;o=a)throw new Error('"step" requires strictly ascending stop inputs');const l=y(t[o+1],e);s||(s=l.type),i.push([a,l])}return new Ft(s,r,i)}evaluate(t,e){const r=this._stops;if(r.length===1)return r[0][1].evaluate(t,e);const s=this._input.evaluate(t,e);let i=0;for(;++i=s.length)throw new Error('"at" index out of bounds');if(r!==Math.floor(r))throw new Error('"at" index must be an integer');return s[r]}}class dt{constructor(t,e){this._key=t,this._obj=e,this.type=C}static parse(t,e){let r,s;switch(t.length){case 2:return r=y(t[1],e),new dt(r);case 3:return r=y(t[1],e),s=y(t[2],e),new dt(r,s);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);return this._obj?this._obj.evaluate(t,e)[r]:t==null?void 0:t.values[r]}}class mt{constructor(t,e){this._key=t,this._obj=e,this.type=P}static parse(t,e){let r,s;switch(t.length){case 2:return r=y(t[1],e),new mt(r);case 3:return r=y(t[1],e),s=y(t[2],e),new mt(r,s);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);return this._obj?r in this._obj.evaluate(t,e):!!(t!=null&&t.values[r])}}class Ct{constructor(t,e){this._key=t,this._vals=e,this.type=P}static parse(t,e){if(t.length!==3)throw new Error('"in" expects 2 arguments');return new Ct(y(t[1],e),y(t[2],e))}evaluate(t,e){const r=this._key.evaluate(t,e);return this._vals.evaluate(t,e).includes(r)}}let Ue=class Pt{constructor(t,e,r){this._item=t,this._array=e,this._from=r,this.type=T}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=y(t[1],e),s=y(t[2],e);if(t.length===4){const i=y(t[3],e,T);return new Pt(r,s,i)}return new Pt(r,s)}evaluate(t,e){const r=this._item.evaluate(t,e),s=this._array.evaluate(t,e);if(this._from){const i=this._from.evaluate(t,e);if(i!==Math.floor(i))throw new Error('"index-of" index must be an integer');return s.indexOf(r,i)}return s.indexOf(r)}};class Yt{constructor(t){this._arg=t,this.type=T}static parse(t,e){if(t.length!==2)throw new Error('"length" expects 2 arguments');const r=y(t[1],e);return new Yt(r)}evaluate(t,e){const r=this._arg.evaluate(t,e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}}class wt{constructor(t,e,r,s){this.type=t,this._array=e,this._from=r,this._to=s}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=y(t[1],e),s=y(t[2],e,T);if(s.type!==T)throw new Error('"slice" index must return a number');if(t.length===4){const i=y(t[3],e,T);if(i.type!==T)throw new Error('"slice" index must return a number');return new wt(r.type,r,s,i)}return new wt(r.type,r,s)}evaluate(t,e){const r=this._array.evaluate(t,e);if(!Array.isArray(r)&&typeof r!="string")throw new Error('"slice" input must be an array or a string');const s=this._from.evaluate(t,e);if(s<0||s>=r.length)throw new Error('"slice" index out of bounds');if(s!==Math.floor(s))throw new Error('"slice" index must be an integer');if(this._to){const i=this._to.evaluate(t,e);if(i<0||i>=r.length)throw new Error('"slice" index out of bounds');if(i!==Math.floor(i))throw new Error('"slice" index must be an integer');return r.slice(s,i)}return r.slice(s)}}class Ht{constructor(){this.type=P}static parse(t){if(t.length!==1)throw new Error('"has-id" expects no arguments');return new Ht}evaluate(t,e){return t&&t.id!==void 0}}class B{constructor(t,e){this._args=t,this._calculate=e,this.type=T}static parse(t,e,r){const s=t.slice(1).map(i=>y(i,e));return new B(s,r)}evaluate(t,e){let r;return this._args&&(r=this._args.map(s=>s.evaluate(t,e))),this._calculate(r)}}class Be extends B{static parse(t,e){switch(t.length){case 2:return B.parse(t,e,r=>-r[0]);case 3:return B.parse(t,e,r=>r[0]-r[1]);default:throw new Error('"-" expects 1 or 2 arguments')}}}class Oe extends B{static parse(t,e){return B.parse(t,e,r=>{let s=1;for(const i of r)s*=i;return s})}}class Ge extends B{static parse(t,e){if(t.length===3)return B.parse(t,e,r=>r[0]/r[1]);throw new Error('"/" expects 2 arguments')}}class ke extends B{static parse(t,e){if(t.length===3)return B.parse(t,e,r=>r[0]%r[1]);throw new Error('"%" expects 2 arguments')}}class $e extends B{static parse(t,e){if(t.length===3)return B.parse(t,e,r=>r[0]**r[1]);throw new Error('"^" expects 1 or 2 arguments')}}class ze extends B{static parse(t,e){return B.parse(t,e,r=>{let s=0;for(const i of r)s+=i;return s})}}class b{constructor(t,e){this._args=t,this._calculate=e,this.type=T}static parse(t,e){const r=t.slice(1).map(s=>y(s,e));return new b(r,b.ops[t[0]])}evaluate(t,e){let r;return this._args&&(r=this._args.map(s=>s.evaluate(t,e))),this._calculate(r)}}b.ops={abs:n=>Math.abs(n[0]),acos:n=>Math.acos(n[0]),asin:n=>Math.asin(n[0]),atan:n=>Math.atan(n[0]),ceil:n=>Math.ceil(n[0]),cos:n=>Math.cos(n[0]),e:()=>Math.E,floor:n=>Math.floor(n[0]),ln:n=>Math.log(n[0]),ln2:()=>Math.LN2,log10:n=>Math.log(n[0])/Math.LN10,log2:n=>Math.log(n[0])/Math.LN2,max:n=>Math.max(...n),min:n=>Math.min(...n),pi:()=>Math.PI,round:n=>Math.round(n[0]),sin:n=>Math.sin(n[0]),sqrt:n=>Math.sqrt(n[0]),tan:n=>Math.tan(n[0])};class jt{constructor(t){this._args=t,this.type=k}static parse(t,e){return new jt(t.slice(1).map(r=>y(r,e)))}evaluate(t,e){return this._args.map(r=>r.evaluate(t,e)).join("")}}class st{constructor(t,e){this._arg=t,this._calculate=e,this.type=k}static parse(t,e){if(t.length!==2)throw new Error(`${t[0]} expects 1 argument`);const r=y(t[1],e);return new st(r,st.ops[t[0]])}evaluate(t,e){return this._calculate(this._arg.evaluate(t,e))}}st.ops={downcase:n=>n.toLowerCase(),upcase:n=>n.toUpperCase()};class Kt{constructor(t){this._args=t,this.type=Y}static parse(t,e){if(t.length!==4)throw new Error('"rgb" expects 3 arguments');const r=t.slice(1).map(s=>y(s,e));return new Kt(r)}evaluate(t,e){const r=this._validate(this._args[0].evaluate(t,e)),s=this._validate(this._args[1].evaluate(t,e)),i=this._validate(this._args[2].evaluate(t,e));return new D({r,g:s,b:i})}_validate(t){if(typeof t!="number"||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}}class qt{constructor(t){this._args=t,this.type=Y}static parse(t,e){if(t.length!==5)throw new Error('"rgba" expects 4 arguments');const r=t.slice(1).map(s=>y(s,e));return new qt(r)}evaluate(t,e){const r=this._validate(this._args[0].evaluate(t,e)),s=this._validate(this._args[1].evaluate(t,e)),i=this._validate(this._args[2].evaluate(t,e)),o=this._validateAlpha(this._args[3].evaluate(t,e));return new D({r,g:s,b:i,a:o})}_validate(t){if(typeof t!="number"||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}_validateAlpha(t){if(typeof t!="number"||t<0||t>1)throw new Error(`${t}: invalid alpha color component`);return t}}class Wt{constructor(t){this._color=t,this.type=ct(T,4)}static parse(t,e){if(t.length!==2)throw new Error('"to-rgba" expects 1 argument');const r=y(t[1],e);return new Wt(r)}evaluate(t,e){return new D(this._color.evaluate(t,e)).toRgba()}}class q{constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0];if(t.length<2)throw new Error(`${r} expects at least one argument`);let s,i=1;if(r==="array"){if(t.length>2){switch(t[1]){case"string":s=k;break;case"number":s=T;break;case"boolean":s=P;break;default:throw new Error('"array" type argument must be string, number or boolean')}i++}else s=C;let a;if(t.length>3){if(a=t[2],a!==null&&(typeof a!="number"||a<0||a!==Math.floor(a)))throw new Error('"array" length argument must be a positive integer literal');i++}s=ct(s,a)}else switch(r){case"string":s=k;break;case"number":s=T;break;case"boolean":s=P;break;case"object":s=bt}const o=[];for(;i":xe,">=":Pe,all:Ot,any:Gt,case:$t,coalesce:Se,match:zt,within:null,interpolate:_t,"interpolate-hcl":_t,"interpolate-lab":_t,step:Ft,let:Mt,var:Le,concat:jt,downcase:st,"is-supported-script":null,"resolved-locale":null,upcase:st,rgb:Kt,rgba:qt,"to-rgba":Wt,"-":Be,"*":Oe,"/":Ge,"%":ke,"^":$e,"+":ze,abs:b,acos:b,asin:b,atan:b,ceil:b,cos:b,e:b,floor:b,ln:b,ln2:b,log10:b,log2:b,max:b,min:b,pi:b,round:b,sin:b,sqrt:b,tan:b,zoom:It,"heatmap-density":null,"has-id":Ht,none:kt};class O{constructor(t){this._expression=t}filter(t,e){if(!this._expression)return!0;try{return this._expression.evaluate(t,e)}catch(r){return console.log(r.message),!0}}static createFilter(t){if(!t)return null;this.isLegacyFilter(t)&&(t=this.convertLegacyFilter(t));try{const e=y(t,null,P);return new O(e)}catch(e){return console.log(e.message),null}}static isLegacyFilter(t){if(!Array.isArray(t)||t.length===0)return!0;switch(t[0]){case"==":case"!=":case">":case"<":case">=":case"<=":return t.length===3&&typeof t[1]=="string"&&!Array.isArray(t[2]);case"in":return t.length>=3&&typeof t[1]=="string"&&!Array.isArray(t[2]);case"!in":case"none":case"!has":return!0;case"any":case"all":for(let e=1;e":case"<":case">=":case"<=":return O.convertComparison(e,t[1],t[2]);case"in":return O.convertIn(t[1],t.slice(2));case"!in":return O.negate(O.convertIn(t[1],t.slice(2)));case"any":case"all":case"none":return O.convertCombining(e,t.slice(1));case"has":return O.convertHas(t[1]);case"!has":return O.negate(O.convertHas(t[1]));default:throw new Error("Unexpected legacy filter.")}}static convertComparison(t,e,r){switch(e){case"$type":return[t,["geometry-type"],r];case"$id":return[t,["id"],r];default:return[t,["get",e],r]}}static convertIn(t,e){switch(t){case"$type":return["in",["geometry-type"],["literal",e]];case"$id":return["in",["id"],["literal",e]];default:return["in",["get",t],["literal",e]]}}static convertHas(t){switch(t){case"$type":return!0;case"$id":return["has-id"];default:return["has",t]}}static convertCombining(t,e){return[t].concat(e.map(this.convertLegacyFilter))}static negate(t){return["!",t]}}class Et{constructor(t,e){let r;switch(this.isDataDriven=!1,this.interpolator=null,t.type){case"number":case"color":r=!0;break;case"array":r=t.value==="number";break;default:r=!1}if(e==null&&(e=t.default),Array.isArray(e)&&e.length>0&&fe[e[0]]){const i={number:T,color:Y,string:k,boolean:P,enum:k};try{const o=t.type==="array"?ct(i[t.value]||C,t.length):i[t.type],a=y(e,null,o);this.getValue=this._buildExpression(a,t),this.isDataDriven=!0,a instanceof _t&&a.input instanceof It&&(this.interpolator=a)}catch(o){console.log(o.message),this.getValue=this._buildSimple(t.default)}return}r&&e.type==="interval"&&(r=!1);const s=e&&e.stops&&e.stops.length>0;if(s)for(const i of e.stops)i[1]=this._validate(i[1],t);if(this.isDataDriven=!!e&&!!e.property,this.isDataDriven)if(e.default!==void 0&&(e.default=this._validate(e.default,t)),s)switch(e.type){case"identity":this.getValue=this._buildIdentity(e,t);break;case"categorical":this.getValue=this._buildCategorical(e,t);break;default:this.getValue=r?this._buildInterpolate(e,t):this._buildInterval(e,t)}else this.getValue=this._buildIdentity(e,t);else s?this.getValue=r?this._buildZoomInterpolate(e):this._buildZoomInterval(e):(e=this._validate(e,t),this.getValue=this._buildSimple(e))}_validate(t,e){if(e.type==="number"){if(e.minimum!=null&&te.maximum)return e.maximum}else e.type==="color"?t=Et._parseColor(t):e.type==="enum"?typeof t=="string"&&(t=e.values.indexOf(t)):e.type==="array"&&e.value==="enum"?t=t.map(r=>typeof r=="string"?e.values.indexOf(r):r):e.type==="string"&&(t=xt(t));return t}_buildSimple(t){return()=>t}_buildExpression(t,e){return(r,s)=>{try{const i=t.evaluate(s,r);return i===void 0?e.default:this._validate(i,e)}catch(i){return console.log(i.message),e.default}}}_buildIdentity(t,e){return(r,s)=>{let i;return s&&(i=s.values[t.property]),i!==void 0&&(i=this._validate(i,e)),i??(t.default!==void 0?t.default:e.default)}}_buildCategorical(t,e){return(r,s)=>{let i;return s&&(i=s.values[t.property]),i=this._categorical(i,t.stops),i!==void 0?i:t.default!==void 0?t.default:e.default}}_buildInterval(t,e){return(r,s)=>{let i;return s&&(i=s.values[t.property]),typeof i=="number"?this._interval(i,t.stops):t.default!==void 0?t.default:e.default}}_buildInterpolate(t,e){return(r,s)=>{let i;return s&&(i=s.values[t.property]),typeof i=="number"?this._interpolate(i,t.stops,t.base||1):t.default!==void 0?t.default:e.default}}_buildZoomInterpolate(t){return e=>this._interpolate(e,t.stops,t.base||1)}_buildZoomInterval(t){return e=>this._interval(e,t.stops)}_categorical(t,e){const r=e.length;for(let s=0;sthis._create(e,r,s)).filter(e=>!!e),this.layers){let e;for(let r=0;r=this.layers.length?null:this.layers[t].id}getStyleLayerByUID(t){return this._uidToLayer.get(t)??null}getStyleLayerIndex(t){const e=this._layerByName[t];return e?this.layers.indexOf(e):-1}setStyleLayer(t,e){if(!t||!t.id)return;const r=this._style;e!=null&&e>=this.layers.length&&(e=this.layers.length-1);let s,i=!0;const o=this._layerByName[t.id];if(o){const a=this.layers.indexOf(o);e||(e=a),e===a?(i=!1,s=at._recreateLayer(t,o),this.layers[e]=s,r.layers[e]=t):(this.layers.splice(a,1),r.layers.splice(a,1),s=this._create(t,e,this.layers),this.layers.splice(e,0,s),r.layers.splice(e,0,t))}else s=this._create(t,e,this.layers),!e||e>=this.layers.length?(this.layers.push(s),r.layers.push(t)):(this.layers.splice(e,0,s),r.layers.splice(e,0,t));this._layerByName[t.id]=s,this._uidToLayer.set(s.uid,s),i&&this._recomputeZValues(),this._identifyRefLayers()}getStyleLayer(t){const e=this._layerByName[t];return e?{type:e.typeName,id:e.id,source:e.source,"source-layer":e.sourceLayer,minzoom:e.minzoom,maxzoom:e.maxzoom,filter:e.filter,layout:e.layout,paint:e.paint}:null}deleteStyleLayer(t){const e=this._layerByName[t];if(e){delete this._layerByName[t],this._uidToLayer.delete(e.uid);const r=this.layers.indexOf(e);this.layers.splice(r,1),this._style.layers.splice(r,1),this._recomputeZValues(),this._identifyRefLayers()}}getLayerById(t){return this._layerByName[t]}getLayoutProperties(t){const e=this._layerByName[t];return e?e.layout:null}getPaintProperties(t){const e=this._layerByName[t];return e?e.paint:null}setPaintProperties(t,e){const r=this._layerByName[t];if(!r)return;const s={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:r.layout,paint:e},i=at._recreateLayer(s,r),o=this.layers.indexOf(r);this.layers[o]=i,this._style.layers[o].paint=e,this._layerByName[r.id]=i,this._uidToLayer.set(r.uid,i)}setLayoutProperties(t,e){const r=this._layerByName[t];if(!r)return;const s={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:e,paint:r.paint},i=at._recreateLayer(s,r),o=this.layers.indexOf(r);this.layers[o]=i,this._style.layers[o].layout=e,this._layerByName[r.id]=i,this._uidToLayer.set(r.uid,i)}setStyleLayerVisibility(t,e){const r=this._layerByName[t];if(!r)return;const s=r.layout||{};s.visibility=e;const i={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:s,paint:r.paint},o=at._recreateLayer(i,r),a=this.layers.indexOf(r);this.layers[a]=o,this._style.layers[a].layout=s,this._layerByName[r.id]=o,this._uidToLayer.set(r.uid,o)}getStyleLayerVisibility(t){const e=this._layerByName[t];if(!e)return"none";const r=e.layout;return(r==null?void 0:r.visibility)??"visible"}_recomputeZValues(){const t=this.layers,e=1/(t.length+1);for(let r=0;ri.keyo.key?1:0);const s=t.length;for(let i=0;i{let r=class extends e{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(t,i){const s=i.capabilities&&i.capabilities.split(",").map(X=>X.toLowerCase().trim());if(!s)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const o=this.type,n=o!=="tile"&&!!i.supportsDynamicLayers,y=s.includes("query"),d=s.includes("map"),h=!!i.exportTilesAllowed,b=s.includes("tilemap"),I=s.includes("data"),x=o!=="tile"&&(!i.tileInfo||n),O=o!=="tile"&&(!i.tileInfo||n),c=o!=="tile",f=i.cimVersion&&Z.parse(i.cimVersion),T=(f==null?void 0:f.since(1,4))??!1,D=(f==null?void 0:f.since(2,0))??!1;return{operations:{supportsExportMap:d,supportsExportTiles:h,supportsIdentify:y,supportsQuery:I,supportsTileMap:b},exportMap:d?{supportsArcadeExpressionForLabeling:T,supportsSublayersChanges:c,supportsDynamicLayers:n,supportsSublayerVisibility:x,supportsSublayerDefinitionExpression:O,supportsCIMSymbols:D}:null,exportTiles:h?{maxExportTilesCount:+i.maxExportTilesCount}:null}}readVersion(t,i){let s=i.currentVersion;return s||(s=i.hasOwnProperty("capabilities")||i.hasOwnProperty("tables")?10:i.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),s}async fetchRelatedService(t){const i=this.portalItem;if(!i||!G(i))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=i.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},t).then(o=>o.find(n=>n.type==="Feature Service")??null,()=>null));const s=await this._relatedFeatureServicePromise;return J(t),s?{itemId:s.id,url:s.url}:null}async fetchSublayerInfo(t,i){const{source:s}=t;if(this!=null&&this.portalItem&&this.type==="tile"&&(s==null?void 0:s.type)==="map-layer"&&G(this.portalItem)&&t.originIdOf("url")u.SERVICE)try{n=(await this._fetchAllLayersAndTablesFromService(o)).get(s.mapLayerId)}catch{}else{let y=t.id;(s==null?void 0:s.type)==="map-layer"&&(y=s.mapLayerId);try{n=(await this.fetchAllLayersAndTables(i)).get(y)}catch{}}return n}async fetchAllLayersAndTables(t){var i;return this._fetchAllLayersAndTablesFromService((i=this.parsedUrl)==null?void 0:i.path,t)}async _fetchAllLayersAndTablesFromService(t,i){await this.load(i),this._allLayersAndTablesMap||(this._allLayersAndTablesMap=new Map);const s=ee(t),o=te(this._allLayersAndTablesMap,s==null?void 0:s.url.path,()=>N(Q(s==null?void 0:s.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(y=>{const d=new Map;for(const h of y.data.layers)d.set(h.id,h);return{result:d}},y=>({error:y}))),n=await o;if(J(i),"result"in n)return n.result;throw n.error}};return a([p({readOnly:!0})],r.prototype,"capabilities",void 0),a([S("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],r.prototype,"readCapabilities",null),a([p({json:{read:{source:"copyrightText"}}})],r.prototype,"copyright",void 0),a([p({type:K})],r.prototype,"fullExtent",void 0),a([p(ge)],r.prototype,"id",void 0),a([p({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],r.prototype,"legendEnabled",void 0),a([p(Se)],r.prototype,"popupEnabled",void 0),a([p({type:Y})],r.prototype,"spatialReference",void 0),a([p({readOnly:!0})],r.prototype,"version",void 0),a([S("version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],r.prototype,"readVersion",null),r=a([k("esri.layers.mixins.ArcGISMapService")],r),r};var A;function V(e){return e!=null&&e.type==="esriSMS"}function M(e,r,t){var s;const i=this.originIdOf(r)>=L(t.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!t&&((s=t.layer)==null?void 0:s.type)==="map-image"&&(t.writeSublayerStructure||i)}}function C(e,r,t){var i;return{enabled:!!t&&((i=t.layer)==null?void 0:i.type)==="tile"&&(t.origin&&this.originIdOf(r)>=L(t.origin)||this._isOverridden(r))}}function m(e,r,t){return{ignoreOrigin:!0,enabled:t&&t.writeSublayerStructure||!1}}function F(e,r,t){return{ignoreOrigin:!0,enabled:!!t&&(t.writeSublayerStructure||this.originIdOf(r)>=L(t.origin))}}let Me=0;const v=new Set;v.add("layer"),v.add("parent"),v.add("loaded"),v.add("loadStatus"),v.add("loadError"),v.add("loadWarnings");let l=A=class extends re(we(ie(ce))){constructor(e){super(e),this.capabilities=void 0,this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.sourceJSON=null,this.title=null,this.typeIdField=null,this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:r,url:t}=this;if(!r&&!t)throw new g("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const i=r?await r.fetchSublayerInfo(this,e):(await N(t,{responseType:"json",query:{f:"json"},...e})).data;i&&(this.sourceJSON=i,this.read({layerDefinition:i},{origin:"service"}))})()),this}readCapabilities(e,r){r=r.layerDefinition||r;const{operations:{supportsQuery:t,supportsQueryAttachments:i},query:{supportsFormatPBF:s},data:{supportsAttachment:o}}=_e(r,this.url);return{exportMap:{supportsModification:!!r.canModifyLayer},operations:{supportsQuery:t,supportsQueryAttachments:i},data:{supportsAttachment:o},query:{supportsFormatPBF:s}}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get effectiveScaleRange(){const{minScale:e,maxScale:r}=this;return{minScale:e,maxScale:r}}get fieldsIndex(){return new Oe(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,r){if((r=r.layerDefinition||r).globalIdField)return r.globalIdField;if(r.fields){for(const t of r.fields)if(t.type==="esriFieldTypeGlobalID")return t.name}}get id(){return this._get("id")??Me++}set id(e){var r,t,i;this._get("id")!==e&&(((i=(t=(r=this.layer)==null?void 0:r.capabilities)==null?void 0:t.exportMap)==null?void 0:i.supportsDynamicLayers)!==!1?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,r,t,i){e&&e.length&&(r.layerDefinition={drawingInfo:{labelingInfo:e.map(s=>s.write({},i))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers&&this.sublayers.forEach(r=>r.layer=e)}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,r){return r.minScale||r.layerDefinition&&r.layerDefinition.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,r){return r.maxScale||r.layerDefinition&&r.layerDefinition.maxScale||0}readObjectIdFieldFromService(e,r){if((r=r.layerDefinition||r).objectIdField)return r.objectIdField;if(r.fields){for(const t of r.fields)if(t.type==="esriFieldTypeOID")return t.name}}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,r){var i;const t=r.layerDefinition;return 1-.01*(((t==null?void 0:t.transparency)!=null?t.transparency:(i=t==null?void 0:t.drawingInfo)==null?void 0:i.transparency)??0)}writeOpacity(e,r,t,i){r.layerDefinition={drawingInfo:{transparency:100-100*e}}}writeParent(e,r){this.parent&&this.parent!==this.layer?r.parentLayerId=se(this.parent.id):r.parentLayerId=-1}get queryTask(){var n;if(!this.layer)return null;const{spatialReference:e}=this.layer,r="gdbVersion"in this.layer?this.layer.gdbVersion:void 0,{capabilities:t,fieldsIndex:i}=this,s=ae("featurelayer-pbf")&&(t==null?void 0:t.query.supportsFormatPBF),o=((n=t==null?void 0:t.operations)==null?void 0:n.supportsQueryAttachments)??!1;return new Le({url:this.url,pbfSupported:s,fieldsIndex:i,gdbVersion:r,sourceSpatialReference:e,queryAttachmentsSupported:o})}set renderer(e){if(e){for(const r of e.getSymbols())if(oe(r)){E.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new q({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return le(U.ofType(A),e)}writeSublayers(e,r,t){var i;(i=this.sublayers)!=null&&i.length&&(r[t]=this.sublayers.map(s=>s.id).toArray().reverse())}readTypeIdField(e,r){let t=(r=r.layerDefinition||r).typeIdField;if(t&&r.fields){t=t.toLowerCase();const i=r.fields.find(s=>s.name.toLowerCase()===t);i&&(t=i.name)}return t}get url(){var i;const e=((i=this.layer)==null?void 0:i.parsedUrl)??this._lastParsedUrl,r=this.source;if(!e)return null;if(this._lastParsedUrl=e,(r==null?void 0:r.type)==="map-layer")return`${e.path}/${r.mapLayerId}`;const t={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${ne(t)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,r,t,i){r[t]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=P(this),r=new A;return P(r).store=e.clone(v),this.commitProperty("url"),r._lastParsedUrl=this._lastParsedUrl,r}createPopupTemplate(e){return je(this,e)}createQuery(){return new Pe({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){var i;if(this.hasOwnProperty("sublayers"))return null;const{layer:e}=this,r=e==null?void 0:e.parsedUrl,t=new(await pe(()=>import("./FeatureLayer-5c6d2c3b.js"),["assets/FeatureLayer-5c6d2c3b.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/AttachmentQuery-972bbd60.js","assets/Query-1c961d4c.js","assets/RelationshipQuery-39c07195.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/TopFeaturesQuery-e44d05be.js","assets/popupUtils-82ea8abb.js"])).default({url:r==null?void 0:r.path});return r&&this.source&&(this.source.type==="map-layer"?t.layerId=this.source.mapLayerId:t.dynamicDataSource=this.source),(e==null?void 0:e.refreshInterval)!=null&&(t.refreshInterval=e.refreshInterval),this.definitionExpression&&(t.definitionExpression=this.definitionExpression),this.floorInfo&&(t.floorInfo=_(this.floorInfo)),this.originIdOf("labelingInfo")>u.SERVICE&&(t.labelingInfo=_(this.labelingInfo)),this.originIdOf("labelsVisible")>u.DEFAULTS&&(t.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>u.DEFAULTS&&(t.legendEnabled=this.legendEnabled),this.originIdOf("visible")>u.DEFAULTS&&(t.visible=this.visible),this.originIdOf("minScale")>u.DEFAULTS&&(t.minScale=this.minScale),this.originIdOf("maxScale")>u.DEFAULTS&&(t.maxScale=this.maxScale),this.originIdOf("opacity")>u.DEFAULTS&&(t.opacity=this.opacity),this.originIdOf("popupTemplate")>u.DEFAULTS&&(t.popupTemplate=_(this.popupTemplate)),this.originIdOf("renderer")>u.SERVICE&&(t.renderer=_(this.renderer)),((i=this.source)==null?void 0:i.type)==="data-layer"&&(t.dynamicDataSource=this.source.clone()),this.originIdOf("title")>u.DEFAULTS&&(t.title=this.title),(e==null?void 0:e.type)==="map-image"&&e.originIdOf("customParameters")>u.DEFAULTS&&(t.customParameters=e.customParameters),(e==null?void 0:e.type)==="tile"&&e.originIdOf("customParameters")>u.DEFAULTS&&(t.customParameters=e.customParameters),t}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){const{typeIdField:r,types:t}=this;if(!r||!e)return null;const i=e.attributes?e.attributes[r]:void 0;if(i==null)return null;let s=null;return t==null||t.some(o=>{const{id:n}=o;return n!=null&&(n.toString()===i.toString()&&(s=o),!!s)}),s}getFieldDomain(e,r){const t=r&&r.feature,i=this.getFeatureType(t);if(i){const s=i.domains&&i.domains[e];if(s&&s.type!=="inherited")return s}return this._getLayerDomain(e)}async queryAttachments(e,r){var b,I;await this.load(),e=Ae.from(e);const t=this.capabilities;if(!((b=t==null?void 0:t.data)!=null&&b.supportsAttachment))throw new g("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:o,num:n,size:y,start:d,where:h}=e;if(!((I=t==null?void 0:t.operations)!=null&&I.supportsQueryAttachments)&&((i==null?void 0:i.length)>0||(o==null?void 0:o.length)>0||(y==null?void 0:y.length)>0||n||d||h))throw new g("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(s!=null&&s.length||o!=null&&o.length||h))throw new g("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e=this.createQuery(),r){var i,s;if(await this.load(),!this.capabilities.operations.supportsQuery)throw new g("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new g("queryFeatures:not-supported","this layer has no url.");const t=await this.queryTask.execute(e,{...r,query:{...(i=this.layer)==null?void 0:i.customParameters,token:(s=this.layer)==null?void 0:s.apiKey}});if(t!=null&&t.features)for(const o of t.features)o.sourceLayer=this;return t}toExportImageJSON(e){var o;const r={id:this.id,source:((o=this.source)==null?void 0:o.toJSON())||{mapLayerId:this.id,type:"mapLayer"}},t=Ee(e,this.definitionExpression);t!=null&&(r.definitionExpression=t);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce((n,y)=>(n[y]=this.originIdOf(y),n),{});if(Object.keys(i).some(n=>i[n]>u.SERVICE)){const n=r.drawingInfo={};if(i.renderer>u.SERVICE&&(n.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>u.SERVICE&&(n.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>u.SERVICE){!this.loaded&&this.labelingInfo.some(d=>!d.labelPlacement)&&E.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let y=this.labelingInfo;this.geometryType!=null&&(y=De(this.labelingInfo,R.toJSON(this.geometryType))),n.labelingInfo=y.filter(d=>d.labelPlacement).map(d=>d.toJSON({origin:"service",layer:this.layer})),n.showLabels=!0}i.opacity>u.SERVICE&&(n.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(n.renderer)}return r}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,r=>{r.color||r.style!=="esriSMSX"&&r.style!=="esriSMSCross"||(r.outline&&r.outline.color?r.color=r.outline.color:r.color=[0,0,0,0])})}_forEachSimpleMarkerSymbols(e,r){if(e){const t=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const i of t)V(i.symbol)&&r(i.symbol);"symbol"in e&&V(e.symbol)&&r(e.symbol),"defaultSymbol"in e&&V(e.defaultSymbol)&&r(e.defaultSymbol)}}_setAndNotifyLayer(e,r){var y,d,h,b;const t=this.layer,i=this._get(e);let s,o;switch(e){case"definitionExpression":case"floorInfo":s="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":s="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":s="supportsDynamicLayers",o="supportsModification"}const n=P(this).getDefaultOrigin();if(n!=="service"){if(s&&((h=(d=(y=this.layer)==null?void 0:y.capabilities)==null?void 0:d.exportMap)==null?void 0:h[s])===!1)return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${s}'`);if(o&&((b=this.capabilities)==null?void 0:b.exportMap[o])===!1)return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${o}'`)}e!=="source"||this.loadStatus==="not-loaded"?(this._set(e,r),n!=="service"&&i!==r&&t&&t.emit&&t.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,r){r&&(r.forEach(t=>{t.parent=null,t.layer=null}),this.handles.removeAll()),e&&(e.forEach(t=>{t.parent=this,t.layer=this.layer}),this.handles.add([e.on("after-add",({item:t})=>{t.parent=this,t.layer=this.layer}),e.on("after-remove",({item:t})=>{t.parent=null,t.layer=null}),e.on("before-changes",t=>{var s,o,n;const i=(n=(o=(s=this.layer)==null?void 0:s.capabilities)==null?void 0:o.exportMap)==null?void 0:n.supportsSublayersChanges;i==null||i||(E.getLogger(this).error(new g("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),t.preventDefault())})]))}_logLockedError(e,r){const{layer:t,declaredClass:i}=this;E.getLogger(i).error(new g("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${t==null?void 0:t.id}'`,{reason:r,sublayer:this,layer:t}))}_getLayerDomain(e){const r=this.fieldsIndex.get(e);return r?r.domain:null}};l.test={isMapImageLayerOverridePolicy:e=>e===m||e===M,isTileImageLayerOverridePolicy:e=>e===C},a([p({readOnly:!0})],l.prototype,"capabilities",void 0),a([S("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],l.prototype,"readCapabilities",null),a([p()],l.prototype,"defaultPopupTemplate",null),a([p({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:M}}})],l.prototype,"definitionExpression",null),a([p({readOnly:!0})],l.prototype,"effectiveScaleRange",null),a([p({type:[ye],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],l.prototype,"fields",void 0),a([p({readOnly:!0})],l.prototype,"fieldsIndex",null),a([p({type:Fe,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:M},origins:{"web-scene":{read:!1,write:!1}}}})],l.prototype,"floorInfo",null),a([p({type:K,json:{read:{source:"layerDefinition.extent"}}})],l.prototype,"fullExtent",void 0),a([p({type:R.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:R.read}}}}})],l.prototype,"geometryType",void 0),a([p({type:String})],l.prototype,"globalIdField",void 0),a([S("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],l.prototype,"readGlobalIdFieldFromService",null),a([p({type:j,json:{write:{ignoreOrigin:!0}}})],l.prototype,"id",null),a([p({value:null,type:[Te],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:m}}})],l.prototype,"labelingInfo",null),a([w("labelingInfo")],l.prototype,"writeLabelingInfo",null),a([p({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:m}}})],l.prototype,"labelsVisible",null),a([p({value:null})],l.prototype,"layer",null),a([p({type:String,json:{write:{overridePolicy:C}}})],l.prototype,"layerItemId",void 0),a([p({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:F}}})],l.prototype,"legendEnabled",void 0),a([p({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],l.prototype,"listMode",null),a([p({type:Number,value:0,json:{write:{overridePolicy:m}}})],l.prototype,"minScale",null),a([S("minScale",["minScale","layerDefinition.minScale"])],l.prototype,"readMinScale",null),a([p({type:Number,value:0,json:{write:{overridePolicy:m}}})],l.prototype,"maxScale",null),a([S("maxScale",["maxScale","layerDefinition.maxScale"])],l.prototype,"readMaxScale",null),a([p({type:String})],l.prototype,"objectIdField",void 0),a([S("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],l.prototype,"readObjectIdFieldFromService",null),a([p({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:m}}})],l.prototype,"opacity",null),a([S("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],l.prototype,"readOpacity",null),a([w("opacity")],l.prototype,"writeOpacity",null),a([p({json:{type:j,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:m}}})],l.prototype,"parent",void 0),a([w("parent")],l.prototype,"writeParent",null),a([p({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,r)=>!r.disablePopup},write:{target:"disablePopup",overridePolicy:F,writer(e,r,t){r[t]=!e}}}})],l.prototype,"popupEnabled",void 0),a([p({type:ue,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:F}}})],l.prototype,"popupTemplate",void 0),a([p({readOnly:!0})],l.prototype,"queryTask",null),a([p({types:Ie,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:m},origins:{"web-scene":{types:ve,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:m}}}}})],l.prototype,"renderer",null),a([p({types:{key:"type",base:null,typeMap:{"data-layer":H,"map-layer":q}},cast(e){if(e){if("mapLayerId"in e)return W(q,e);if("dataSource"in e)return W(H,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:m}}})],l.prototype,"source",null),a([p()],l.prototype,"sourceJSON",void 0),a([p({value:null,json:{type:[j],write:{target:"subLayerIds",allowNull:!0,overridePolicy:m}}})],l.prototype,"sublayers",null),a([de("sublayers")],l.prototype,"castSublayers",null),a([w("sublayers")],l.prototype,"writeSublayers",null),a([p({type:String,json:{name:"name",write:{overridePolicy:F}}})],l.prototype,"title",void 0),a([p({type:String})],l.prototype,"typeIdField",void 0),a([S("typeIdField",["layerDefinition.typeIdField"])],l.prototype,"readTypeIdField",null),a([p({type:[xe],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],l.prototype,"types",void 0),a([p({type:String,json:{name:"layerUrl",write:{overridePolicy:C}}})],l.prototype,"url",null),a([p({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:m}}})],l.prototype,"visible",null),a([w("visible")],l.prototype,"writeVisible",null),l=A=a([k("esri.layers.support.Sublayer")],l);const B=l,Ce=E.getLogger("esri.layers.TileLayer");function $e(e,r){const t=[],i={};return e&&e.forEach(s=>{const o=new B;if(o.read(s,r),i[o.id]=o,s.parentLayerId!=null&&s.parentLayerId!==-1){const n=i[s.parentLayerId];n.sublayers||(n.sublayers=[]),n.sublayers.unshift(o)}else t.unshift(o)}),t}const $=U.ofType(B);function z(e,r){e&&e.forEach(t=>{r(t),t.sublayers&&t.sublayers.length&&z(t.sublayers,r)})}const rt=e=>{let r=class extends e{constructor(...t){super(...t),this.allSublayers=new fe({getCollections:()=>[this.sublayers],getChildrenFunction:i=>i.sublayers}),this.sublayersSourceJSON={[u.SERVICE]:{},[u.PORTAL_ITEM]:{},[u.WEB_SCENE]:{},[u.WEB_MAP]:{}},this.addHandles(he(()=>this.sublayers,(i,s)=>this._handleSublayersChange(i,s),be))}destroy(){this.allSublayers.destroy()}readSublayers(t,i){if(!i||!t)return;const{sublayersSourceJSON:s}=this,o=L(i.origin);if(ou.SERVICE))return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:n,origin:y}=this.createSublayersForOrigin("web-document"),d=P(this);d.setDefaultOrigin(y),this._set("sublayers",new $(n)),d.setDefaultOrigin("user")}findSublayerById(t){return this.allSublayers.find(i=>i.id===t)}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(t){const i=L(t==="web-document"?"web-map":t);let s=u.SERVICE,o=this.sublayersSourceJSON[u.SERVICE].layers,n=this.sublayersSourceJSON[u.SERVICE].context,y=null;const d=[u.PORTAL_ITEM,u.WEB_SCENE,u.WEB_MAP].filter(c=>c<=i);for(const c of d){const f=this.sublayersSourceJSON[c];Ve(f.layers)&&(s=c,o=f.layers,n=f.context,f.visibleLayers&&(y={visibleLayers:f.visibleLayers,context:f.context}))}const h=[u.PORTAL_ITEM,u.WEB_SCENE,u.WEB_MAP].filter(c=>c>s&&c<=i);let b=null;for(const c of h){const{layers:f,visibleLayers:T,context:D}=this.sublayersSourceJSON[c];f&&(b={layers:f,context:D}),T&&(y={visibleLayers:T,context:D})}const I=$e(o,n),x=new Map,O=new Set;if(b)for(const c of b.layers)x.set(c.id,c);if(y!=null&&y.visibleLayers)for(const c of y.visibleLayers)O.add(c);return z(I,c=>{b&&c.read(x.get(c.id),b.context),y&&c.read({defaultVisibility:O.has(c.id)},y.context)}),{origin:me(s),sublayers:new $({items:I})}}read(t,i){super.read(t,i),this.readSublayers(t,i)}_handleSublayersChange(t,i){i&&(i.forEach(s=>{s.parent=null,s.layer=null}),this.removeHandles("sublayers-owner")),t&&(t.forEach(s=>{s.parent=this,s.layer=this}),this.addHandles([t.on("after-add",({item:s})=>{s.parent=this,s.layer=this}),t.on("after-remove",({item:s})=>{s.parent=null,s.layer=null})],"sublayers-owner"),this.type==="tile"&&this.addHandles(t.on("before-changes",s=>{Ce.error(new g("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),s.preventDefault()}),"sublayers-owner"))}};return a([p({readOnly:!0})],r.prototype,"allSublayers",void 0),a([p({readOnly:!0,type:U.ofType(B)})],r.prototype,"serviceSublayers",void 0),a([p({value:null,type:$,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],r.prototype,"sublayers",void 0),a([p({readOnly:!0})],r.prototype,"sublayersSourceJSON",void 0),r=a([k("esri.layers.mixins.SublayersOwner")],r),r};export{rt as E,B as Y,tt as f}; diff --git a/assets/SubtypeGroupLayer-181166ae.js b/assets/SubtypeGroupLayer-181166ae.js new file mode 100644 index 0000000..0a52065 --- /dev/null +++ b/assets/SubtypeGroupLayer-181166ae.js @@ -0,0 +1 @@ +import{ai as i,aj as s,ay as O,bY as V,al as L,ck as Z,cA as K,cw as W,cX as k,am as ee,cl as S,cO as te,bz as re,hi as ie,cy as A,ar as m,c_ as N,cC as se,jp as ne,gC as oe,eQ as ae,eS as le,eR as pe,aF as _,aG as ue,aH as de,as as ye,bf as ce,c5 as he,jb as me,fv as fe,aw as be,eX as ge,hj as ve,da as P,aA as we}from"./index-080e108a.js";import{O as M}from"./MultiOriginJSONSupport-e4912ffd.js";import{n as x}from"./sql-734ecbc5.js";import{i as Fe}from"./APIKeyMixin-878a7aa7.js";import{l as Se}from"./ArcGISService-83287338.js";import{o as Oe}from"./CustomParametersMixin-231c4be8.js";import{c as Ie}from"./EditBusLayer-d71787e9.js";import{y as $e,w as je}from"./FeatureLayerBase-7c7dfccb.js";import{c as Ee}from"./OperationalLayer-0e8f8b28.js";import{j as Ce}from"./PortalLayer-310c2800.js";import{a as Te,d as _e}from"./TemporalLayer-f17c9161.js";import{m as Le,c as Ae,I as xe,D as Pe,p as Ge,v as De}from"./commonProperties-30089b06.js";import{E as Q,M as qe,Q as Re,y as Ve,m as ke,h as Ne,b as Me,g as Qe,j as Ue,q as He,F as Be,I as Je,P as ze,A as Xe,O as Ye}from"./featureLayerUtils-6cf06f83.js";import{s as U}from"./fieldProperties-62c55499.js";import{A as Ze,w as Ke}from"./UniqueValueRenderer-fef4204d.js";import"./jsonUtils-f73b3833.js";import{p as H}from"./FeatureTemplate-2a7e96c1.js";import{C as We}from"./LabelClass-2d53c485.js";import{i as et}from"./labelingInfo-144f3d9f.js";import{b as B}from"./Query-1c961d4c.js";import{p as tt}from"./popupUtils-82ea8abb.js";import{c as rt,u as it,S as st}from"./defaults-34554cbf.js";import{e as nt}from"./versionUtils-f17daa93.js";import"./serviceCapabilitiesUtils-959e798a.js";import"./portalItemUtils-792a27e1.js";import"./AttachmentQuery-972bbd60.js";import"./RelationshipQuery-39c07195.js";import"./FieldsIndex-f79a8f26.js";import"./diffUtils-590c9088.js";import"./DictionaryLoader-c0729336.js";import"./heatmapUtils-327ef4c5.js";import"./defaultsJSON-59981e75.js";let b=class extends Z{constructor(){super(...arguments),this.code=null,this.defaultValues={},this.domains=null,this.name=null}readDomains(e){if(!e)return null;const t={};for(const r of Object.keys(e))t[r]=K(e[r]);return t}writeDomains(e,t){var n;if(!e)return;const r={};for(const o of Object.keys(e))e[o]&&(r[o]=(n=e[o])==null?void 0:n.toJSON());t.domains=r}};i([s({type:Number,json:{write:!0}})],b.prototype,"code",void 0),i([s({type:Object,json:{write:!0}})],b.prototype,"defaultValues",void 0),i([s({json:{write:!0}})],b.prototype,"domains",void 0),i([O("domains")],b.prototype,"readDomains",null),i([V("domains")],b.prototype,"writeDomains",null),i([s({type:String,json:{write:!0}})],b.prototype,"name",void 0),b=i([L("esri.layers.support.Subtype")],b);const ot=b,at=["charts","editingEnabled","formTemplate","labelsVisible","labelingInfo","legendEnabled","minScale","maxScale","opacity","popupEnabled","popupTemplate","renderer","subtypeCode","templates","title","visible"],J={key:"type",base:ne,errorContext:"renderer",typeMap:{simple:A,"unique-value":Ze,"class-breaks":Ke}},G=U(),D=W({types:J});let lt=0;function $(e){const t=e.json.write;return typeof t=="object"?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function pt(e){return new A({symbol:ut(e)})}function ut(e){switch(e){case"point":case"multipoint":return st.clone();case"polyline":return it.clone();case"polygon":case"multipatch":return rt.clone();default:return null}}function dt(e,t){return!!t&&(e==null?void 0:e.type)==="unique-value"&&typeof e.field=="string"&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression}function z(e,t){var r;return e==null?null:(r=t.subtypes)==null?void 0:r.find(n=>n.code===e)}function yt(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const n={},o=z(e,t);if(o!=null){const{defaultValues:l}=o;for(const p in l)n[p]=l[p]}return n[t.subtypeField]=e,new H({name:"New Feature",drawingTool:r,prototype:{attributes:n}})}const X="esri.layers.support.SubtypeSublayer";let a=class extends k(M(ee(oe))){constructor(e){super(e),this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${lt++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}get capabilities(){var e;return(e=this.parent)==null?void 0:e.capabilities}get effectiveCapabilities(){var e;return(e=this.parent)==null?void 0:e.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){var e;return(e=this.parent)==null?void 0:e.elevationInfo}writeFieldOverrides(e,t,r){const{fields:n,parent:o}=this;let l;if(n){l=[];let p=0;n.forEach(({name:y,alias:c,editable:g,visible:v})=>{var j;if(!v)return;const d=(j=o==null?void 0:o.fields)==null?void 0:j.find(I=>I.name===y);if(!d)return;const f={name:y};let F=!1;c!==d.alias&&(f.alias=c,F=!0),g!==d.editable&&(f.editable=g,F=!0),l.push(f),F&&p++}),p===0&&l.length===n.length&&(l=null)}else l=S(e);l!=null&&l.length&&te(r,l,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,n=e==null?void 0:e.fields;if(!e||!(n!=null&&n.length))return null;const{subtypes:o,subtypeField:l}=e,p=o==null?void 0:o.find(v=>v.code===r),y=p==null?void 0:p.defaultValues,c=p==null?void 0:p.domains,g=[];for(const v of n){const d=v.clone(),{name:f}=d,F=t==null?void 0:t.find(E=>E.name===f);if(d.visible=!t||!!F,F){const{alias:E,editable:Y}=F;E&&(d.alias=E),Y===!1&&(d.editable=!1)}const j=(y==null?void 0:y[f])??null;d.defaultValue=f===l?r:j;const I=(c==null?void 0:c[f])??null;d.domain=f===l?null:I?I.type==="inherited"?d.domain:I.clone():null,g.push(d)}return g}get floorInfo(){var e;return(e=this.parent)==null?void 0:e.floorInfo}get geometryType(){var e;return(e=this.parent)==null?void 0:e.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){var e;return this.parent||re.getLogger(X).error(w("objectIdField")),(e=this.parent)==null?void 0:e.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){ie(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&e.geometryType!=="mesh"?pt(e.geometryType):null}readRendererFromService(e,t,r){var y,c,g;if(t.type==="Table")return null;const n=(y=t.drawingInfo)==null?void 0:y.renderer,o=D(n,t,r);let l;const{subtypeCode:p}=this;if(p!=null&&dt(o,t.subtypeField)){const v=(c=o.uniqueValueInfos)==null?void 0:c.find(({value:d})=>(d=typeof d=="number"?String(d):d)===String(p));v&&(l=new A({symbol:v.symbol}))}else(o==null?void 0:o.type)!=="simple"||(g=o.visualVariables)!=null&&g.length||(l=o);return l}readRenderer(e,t,r){var l,p,y;const n=(p=(l=t==null?void 0:t.layerDefinition)==null?void 0:l.drawingInfo)==null?void 0:p.renderer;return n?((y=n.visualVariables)==null?void 0:y.some(c=>c.type!=="rotationInfo"))?void 0:D(n,t,r)||void 0:void 0}get spatialReference(){var e;return(e=this.parent)==null?void 0:e.spatialReference}readTemplatesFromService(e,t){return[yt(this.subtypeCode,t)]}readTitleFromService(e,t){const r=z(this.subtypeCode,t);return r!=null?r.name:null}get url(){var e;return(e=this.parent)==null?void 0:e.url}get userHasUpdateItemPrivileges(){var e;return!!((e=this.parent)!=null&&e.userHasUpdateItemPrivileges)}async addAttachment(e,t){const{parent:r}=this;if(!r)throw w("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new m("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:n}=this;if(!n)throw w("updateAttachment");if(e.getAttribute(n.subtypeField)!==this.subtypeCode)throw new m("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return n.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw w("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new m("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw w("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:n,title:o}=this;if(r){const{displayField:l,editFieldsInfo:p,objectIdField:y}=r;t={displayField:l,editFieldsInfo:p,fields:n,objectIdField:y,title:o}}return tt(t,e)}createQuery(){if(!this.parent)throw w("createQuery");const e=Q(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=x(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e){return this._getLayerDomain(e)}hasUserOverrides(){return at.some(e=>this.originIdOf(e)===N.USER)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw w("queryAttachments");const n=e.clone();return n.where=q(n.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw w("queryFeatures");const n=B.from(e)??r.createQuery();return e!=null&&(n.where=q(n.where,r.parent.subtypeField,r.subtypeCode)),r.parent.queryFeatures(n,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};i([s({readOnly:!0,json:{read:!1}})],a.prototype,"capabilities",null),i([s({readOnly:!0,json:{read:!1}})],a.prototype,"effectiveCapabilities",null),i([s({json:{write:{ignoreOrigin:!0}}})],a.prototype,"charts",void 0),i([s({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],a.prototype,"editingEnabled",void 0),i([s({type:Boolean,readOnly:!0})],a.prototype,"effectiveEditingEnabled",null),i([s({readOnly:!0,json:{read:!1}})],a.prototype,"elevationInfo",null),i([s({readOnly:!0,json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],a.prototype,"fieldOverrides",void 0),i([V("fieldOverrides")],a.prototype,"writeFieldOverrides",null),i([s({...G.fields,readOnly:!0,json:{read:!1}})],a.prototype,"fields",null),i([s(G.fieldsIndex)],a.prototype,"fieldsIndex",void 0),i([s({readOnly:!0,json:{read:!1}})],a.prototype,"floorInfo",null),i([s({type:$e,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],a.prototype,"formTemplate",void 0),i([s({type:String,readOnly:!0,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],a.prototype,"id",void 0),i([s({readOnly:!0,json:{read:!1}})],a.prototype,"geometryType",null),i([s({readOnly:!0,json:{read:!1}})],a.prototype,"type",void 0),i([s($(S(Le)))],a.prototype,"labelsVisible",void 0),i([s({type:[We],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:et},write:{ignoreOrigin:!0}}})],a.prototype,"labelingInfo",void 0),i([s({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],a.prototype,"layerType",void 0),i([s($(S(Ae)))],a.prototype,"legendEnabled",void 0),i([s({type:["show","hide"]})],a.prototype,"listMode",void 0),i([s((()=>{const e=S(xe);return e.json.origins.service.read=!1,$(e)})())],a.prototype,"minScale",void 0),i([s((()=>{const e=S(Pe);return e.json.origins.service.read=!1,$(e)})())],a.prototype,"maxScale",void 0),i([s({readOnly:!0})],a.prototype,"effectiveScaleRange",null),i([s({readOnly:!0,json:{read:!1}})],a.prototype,"objectIdField",null),i([s({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],a.prototype,"opacity",void 0),i([s()],a.prototype,"parent",void 0),i([s($(S(Ge)))],a.prototype,"popupEnabled",void 0),i([s({type:se,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],a.prototype,"popupTemplate",void 0),i([s({readOnly:!0})],a.prototype,"defaultPopupTemplate",null),i([s({types:J,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],a.prototype,"renderer",null),i([O("service","renderer",["drawingInfo.renderer","subtypeField","type"])],a.prototype,"readRendererFromService",null),i([O("renderer",["layerDefinition.drawingInfo.renderer"])],a.prototype,"readRenderer",null),i([s({readOnly:!0,json:{read:!1}})],a.prototype,"spatialReference",null),i([s({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],a.prototype,"subtypeCode",void 0),i([s({type:[H],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],a.prototype,"templates",void 0),i([O("service","templates",["geometryType","subtypeField","subtypes","type"])],a.prototype,"readTemplatesFromService",null),i([s({type:String,json:{write:{ignoreOrigin:!0}}})],a.prototype,"title",void 0),i([O("service","title",["subtypes"])],a.prototype,"readTitleFromService",null),i([s({readOnly:!0,json:{read:!1}})],a.prototype,"url",null),i([s({readOnly:!0})],a.prototype,"userHasUpdateItemPrivileges",null),i([s({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],a.prototype,"visible",void 0),a=i([L(X)],a);const q=(e,t,r)=>{const n=new RegExp(`${t}\\s*=\\s*\\d+`),o=`${t}=${r}`,l=e??"";return n.test(l)?l.replace(n,o):x(o,l)},w=e=>new m(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),C=a,h="SubtypeGroupLayer",ct="esri.layers.SubtypeGroupLayer";function R(e,t){return new m("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}const T=U();let u=class extends je(Ie(ae(Te(le(pe(Se(Ee(Ce(M(Oe(Fe(k(we))))))))))))){constructor(...e){super(...e),this._sublayersCollectionChanged=!1,this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.subtypes=null,this.sublayers=new(_.ofType(C)),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this.addHandles(ue(()=>this.sublayers,(t,r)=>this._handleSublayersChange(t,r),de))}destroy(){var e;(e=this.source)==null||e.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(ye).then(async()=>{if(!this.url)throw new m("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(this.layerId==null)throw new m("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))}).then(()=>this._setUserPrivileges(this.serviceItemId,e)).then(()=>qe(this,e));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return Re(this)}get parsedUrl(){const e=ce(this.url);return e!=null&&this.layerId!=null&&(e.path=he(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?me(this.url,t):t}async addAttachment(e,t){return Ve(this,e,t,h)}async updateAttachment(e,t,r){return ke(this,e,t,r,h)}async applyEdits(e,t){return Ne(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await fe(be(()=>import("./FeatureLayerSource-b0c6b618.js"),["assets/FeatureLayerSource-b0c6b618.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/editingSupport-b5feb7b5.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/EditBusLayer-d71787e9.js","assets/clientSideDefaults-ab04bd90.js","assets/QueryEngineCapabilities-42e44ded.js","assets/defaultsJSON-59981e75.js","assets/QueryTask-6f808a9e.js","assets/Query-1c961d4c.js","assets/executeForIds-5eaf002d.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/executeQueryJSON-7c41ada5.js","assets/FeatureSet-111cb247.js","assets/executeQueryPBF-0f188593.js","assets/editsZScale-1b5a53a6.js"]),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=Q(this),t=this.sublayers.map(r=>r.subtypeCode);return e.where=x(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){return Me(this,e,t,h)}async fetchRecomputedExtents(e){return Qe(this,e,h)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}loadAll(){return ge(this,e=>{e(this.sublayers)})}async queryAttachments(e,t){return Ue(this,e,t,h)}async queryFeatures(e,t){const r=await this.load(),n=B.from(e)??r.createQuery(),o=n.outFields??[];o.includes(this.subtypeField)||(o.push(this.subtypeField),n.outFields=o);const l=await r.source.queryFeatures(n,t);if(l!=null&&l.features)for(const p of l.features)p.layer=p.sourceLayer=this.findSublayerForFeature(p);return l}async queryObjectIds(e,t){return He(this,e,t,h)}async queryFeatureCount(e,t){return Be(this,e,t,h)}async queryExtent(e,t){return Je(this,e,t,h)}async queryRelatedFeatures(e,t){return ze(this,e,t,h)}async queryRelatedFeaturesCount(e,t){return Xe(this,e,t,h)}write(e,t){var l;const{origin:r,layerContainerType:n,messages:o}=t;if(this.isTable){if(r==="web-scene"||r==="web-map"&&n!=="tables")return o==null||o.push(R(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&r==="web-map"&&n==="tables")return o==null||o.push(R(this,"using a non-table source cannot be written to tables in web maps")),null;return(l=this.sublayers)!=null&&l.length?super.write(e,t):(o==null||o.push(new m("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&nt(this,e)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){var r;this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),this.isTable)throw new m("subtype-grouplayer:unsupported-source","SubtypeGroupLayer cannot be created using a layer with table source");if(!((r=this.subtypes)!=null&&r.length))throw new m("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),ve(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return Ye(this)}_verifyFields(){var t,r;const e=((t=this.parsedUrl)==null?void 0:t.path)??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||e.search(/\/FeatureServer\//i)!==-1||(r=this.fields)!=null&&r.some(n=>n.type==="geometry")||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach(r=>{r.parent=null}),this.handles.remove("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(r=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),this._sublayersCollectionChanged=!1,this.handles.add([e.on("after-add",({item:r})=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),e.on("after-remove",({item:r})=>{r.parent=null,this._sublayerLookup.delete(r.subtypeCode)}),e.on("after-changes",()=>{this._sublayersCollectionChanged=!0})],"sublayers-owner"))}};i([s({readOnly:!0})],u.prototype,"createQueryVersion",null),i([s({readOnly:!0})],u.prototype,"editingEnabled",null),i([s({readOnly:!0})],u.prototype,"effectiveEditingEnabled",null),i([s({...T.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],u.prototype,"fields",void 0),i([s(T.fieldsIndex)],u.prototype,"fieldsIndex",void 0),i([s(De)],u.prototype,"id",void 0),i([s({type:["show","hide","hide-children"]})],u.prototype,"listMode",void 0),i([s({value:"SubtypeGroupLayer",type:["SubtypeGroupLayer"]})],u.prototype,"operationalLayerType",void 0),i([s(T.outFields)],u.prototype,"outFields",void 0),i([s({readOnly:!0})],u.prototype,"parsedUrl",null),i([s()],u.prototype,"source",null),i([s({type:[ot],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],u.prototype,"subtypes",void 0),i([s({type:_.ofType(C),json:{origins:{service:{read:{source:"subtypes",reader:(e,t,r)=>{const n=e.map(({code:o})=>{const l=new C({subtypeCode:o});return l.read(t,r),l});return new(_.ofType(C))(n)}}}},name:"layers",write:{overridePolicy(e,t,r){const n=this.originOf("sublayers"),o=N.PORTAL_ITEM;let l=!0;if(P(n)===o&&P(r.origin)>o){const p=e.some(y=>y.hasUserOverrides());l=this._sublayersCollectionChanged||p}return{enabled:l,ignoreOrigin:!0}}}}})],u.prototype,"sublayers",void 0),i([s({type:_e})],u.prototype,"timeInfo",void 0),i([s({json:{origins:{"portal-item":{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],u.prototype,"title",void 0),i([O("service","title",["name"])],u.prototype,"readTitleFromService",null),i([s({json:{read:!1}})],u.prototype,"type",void 0),u=i([L(ct)],u);const Bt=u;export{Bt as default}; diff --git a/assets/SymbolProcessor-f81deaae.js b/assets/SymbolProcessor-f81deaae.js new file mode 100644 index 0000000..ecf4333 --- /dev/null +++ b/assets/SymbolProcessor-f81deaae.js @@ -0,0 +1 @@ +import{sz as es,sy as $t,sQ as tt,sR as ce,sS as Le,sT as ni,bF as v,m1 as at,sU as It,sV as ie,sW as Ie,ai as R,aj as K,al as Ue,ao as is,ah as ss,oG as rs,ku as ns,ar as ut,fT as Hs,sX as N,bz as Ct,bI as as,sY as js,sZ as Zt,bM as Qs,hg as ai,lj as Ut,s_ as T,cv as Js,l6 as tr,as as qe,s$ as er,t0 as os,t1 as hs,b9 as ir,bf as sr,t2 as rr,ho as nr,t3 as ar,t4 as or,t5 as hr,bn as Xe,aP as oi,bx as lr,aw as ls,dZ as cr,sD as ur,t6 as dr,ax as Et,bc as fr,fA as se,hr as _r}from"./index-080e108a.js";import{b as mr,c as cs,g as pr,d as ue,f as yr,s as gr,h as us,j as ds,k as ze,m as xr,o as vr,p as Mr,V as wr,G as br}from"./cimAnalyzer-01879161.js";import{a as Sr,s as hi}from"./diffUtils-590c9088.js";import{u as fs,f as Tr,R as $e,k as Lr,G as Ir,p as _s}from"./Pipeline-98b9d349.js";import{E as b,S as W,L as Z,A as qt}from"./TileInfoView-346e56d0.js";import{d as Pe,f as zr,c as yt,w as $r,b as ms,m as A,q as Pr,g as V,h as Cr,n as ps,l as ys,p as ot,i as Er,x as gs,j as xs,$ as kr,k as Vr,o as vs,s as de,u as Ms,v as ws,y as nt,z as E,A as re,B as ne}from"./definitions-0bc08d4c.js";import{o as Wr,p as Ar}from"./tileUtils-48cbbab9.js";import{r as Rr,c as Fr,i as Br}from"./TurboLine-aac2edf4.js";import{x as $,w as M}from"./number-e491b09e.js";import{t as Or}from"./Rect-98da58d6.js";import{r as li,s as ci,y as ui}from"./defaultsJSON-59981e75.js";import{c as Ce}from"./GeometryUtils-0258f920.js";import{e as bs,t as Ss}from"./TileClipper-ae6eca9e.js";function P(n){if(!n)return 0;const{r:t,g:e,b:i,a:s}=n;return $(t*s,e*s,i*s,255*s)}function D(n){if(!n)return 0;const[t,e,i,s]=n;return $(t*(s/255),e*(s/255),i*(s/255),s)}let Vt=class Ee{constructor(t,e,i,s){this.center=es(t,e),this.centerT=$t(),this.halfWidth=i/2,this.halfHeight=s/2,this.width=i,this.height=s}get x(){return this.center[0]}get y(){return this.center[1]}get blX(){return this.center[0]+this.halfWidth}get blY(){return this.center[1]+this.halfHeight}get trX(){return this.center[0]-this.halfWidth}get trY(){return this.center[1]-this.halfHeight}get xmin(){return this.x-this.halfWidth}get xmax(){return this.x+this.halfWidth}get ymin(){return this.y-this.halfHeight}get ymax(){return this.y+this.halfHeight}set x(t){this.center[0]=t}set y(t){this.center[1]=t}clone(){return new Ee(this.x,this.y,this.width,this.height)}serialize(t){return t.writeF32(this.center[0]),t.writeF32(this.center[1]),t.push(this.width),t.push(this.height),t}findCollisionDelta(t,e=4){const i=Math.abs(t.centerT[0]-this.centerT[0]),s=Math.abs(t.centerT[1]-this.centerT[1]),r=(t.halfWidth+this.halfWidth+e)/i,a=(t.halfHeight+this.halfHeight+e)/s,o=Math.min(r,a);return Math.log2(o)}extend(t){const e=Math.min(this.xmin,t.xmin),i=Math.min(this.ymin,t.ymin),s=Math.max(this.xmax,t.xmax)-e,r=Math.max(this.ymax,t.ymax)-i,a=e+s/2,o=i+r/2;this.width=s,this.height=r,this.halfWidth=s/2,this.halfHeight=r/2,this.x=a,this.y=o}static deserialize(t){const e=t.readF32(),i=t.readF32(),s=t.readInt32(),r=t.readInt32();return new Ee(e,i,s,r)}};const Ye=26,Ts=4,Dr=Ye+Ts,Kr=Ye-6,di=3,k=8,Gr=Math.PI/180,et=8,Nr=1.5;let Ls=class{constructor(t,e,i,s){this._rotationT=tt(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const r=i.rect,a=new Float32Array(8);t*=s,e*=s;const o=i.code?r.width*s:i.metrics.width,h=i.code?r.height*s:i.metrics.height;this.width=o,this.height=h,a[0]=t,a[1]=e,a[2]=t+o,a[3]=e,a[4]=t,a[5]=e+h,a[6]=t+o,a[7]=e+h,this._data=a,this._setTextureCoords(r),this._scale=s,this._mosaic=i,this.x=t,this.y=e,this.maxOffset=Math.max(t+o,e+h)}get mosaic(){return this._mosaic}set angle(t){this._angle=t,ce(this._rotationT,-t),this._setOffsets(this._data)}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){return this._offsets||this._setOffsets(this._data),this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:t,width:e}=this._mosaic.metrics,i=e*this._scale,s=Math.abs(t)*this._scale,r=new Float32Array(8);r[0]=this.x,r[1]=this.y,r[2]=this.x+i,r[3]=this.y,r[4]=this.x,r[5]=this.y+s,r[6]=this.x+i,r[7]=this.y+s;const a=Le(tt(),this._rotationT,this._transform);ni(r,r,a);let o=1/0,h=1/0,l=0,u=0;for(let _=0;_<4;_++){const p=r[2*_],y=r[2*_+1];o=Math.min(o,p),h=Math.min(h,y),l=Math.max(l,p),u=Math.max(u,y)}const c=l-o,d=u-h,f=o+c/2,m=h+d/2;this._bounds=new Vt(f,m,c,d)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}_setOffsets(t){this._offsets||(this._offsets={upperLeft:0,upperRight:0,lowerLeft:0,lowerRight:0});const e=this._offsets,i=new Float32Array(8),s=Le(tt(),this._rotationT,this._transform);ni(i,t,s),e.upperLeft=M(i[0]*k,i[1]*k),e.upperRight=M(i[2]*k,i[3]*k),e.lowerLeft=M(i[4]*k,i[5]*k),e.lowerRight=M(i[6]*k,i[7]*k)}_setTextureCoords({x:t,y:e,width:i,height:s}){this._texcoords={upperLeft:M(t,e),upperRight:M(t+i,e),lowerLeft:M(t,e+s),lowerRight:M(t+i,e+s)}}};const Zr=(n,t)=>({code:0,page:0,sdf:!0,rect:new Or(0,0,11,8),textureBinding:t,metrics:{advance:0,height:4,width:n,left:0,top:0}});function kt(n,t){return n.forEach(e=>It(e,e,t)),{upperLeft:M(k*n[0][0],k*n[0][1]),upperRight:M(k*n[1][0],k*n[1][1]),lowerLeft:M(k*n[2][0],k*n[2][1]),lowerRight:M(k*n[3][0],k*n[3][1])}}let Ur=class{constructor(t,e,i){this._rotation=0,this._decorate(t,e,i),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=i.angle!==0,this._transform=this._createGlyphTransform(this.bounds,i),this._borderLineSize=i.borderLineSize,(i.borderLineSize||i.hasBackground)&&([this.bounds,this.background]=this.shapeBackground(this._transform));for(const s of t)s.setTransform(this._transform)}setRotation(t){if(t===0&&this._rotation===0)return;this._rotation=t;const e=this._transform,i=ce(tt(),t);Le(e,i,e);for(const s of this.glyphs)s.setTransform(this._transform)}_decorate(t,e,i){if(!i.decoration||i.decoration==="none"||!t.length)return;const s=i.scale,r=i.decoration==="underline"?Dr:Kr,a=t[0].textureBinding;for(const o of e){const h=o.startX*s,l=o.startY*s,u=(o.width+o.glyphWidthEnd)*s;t.push(new Ls(h,l+r*s,Zr(u,a),1))}}shapeBackground(t){const e=v(this._borderLineSize||0),i=(Nr+e)/2,s=this._borderLineSize?i:0,{xmin:r,ymin:a,xmax:o,ymax:h,x:l,y:u,width:c,height:d}=this.bounds,f=[r-et,a-et],m=[o+et,a-et],_=[r-et,h+et],p=[o+et,h+et],y=kt([[f[0]-i,f[1]-i],[m[0]+i,m[1]-i],[f[0]+s,f[1]+s],[m[0]-s,m[1]+s]],t),g=kt([[_[0]+s,_[1]-s],[p[0]-s,p[1]-s],[_[0]-i,_[1]+i],[p[0]+i,p[1]+i]],t),x=kt([[f[0]-i,f[1]-i],[f[0]+s,f[1]+s],[_[0]-i,_[1]+i],[_[0]+s,_[1]-s]],t),w=kt([[m[0]-s,m[1]+s],[m[0]+i,m[1]-i],[p[0]-s,p[1]-s],[p[0]+i,p[1]+i]],t),S={main:kt([f,m,_,p],t),top:y,bot:g,left:x,right:w};return[new Vt(l,u,c+2*i,d+2*i),S]}get boundsT(){const t=this.bounds,e=at($t(),t.x,t.y);if(It(e,e,this._transform),this._hasRotation){const i=Math.max(t.width,t.height);return new Vt(e[0],e[1],i,i)}return new Vt(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,i=1/0,s=0,r=0;for(const h of t)e=Math.min(e,h.xTopLeft),i=Math.min(i,h.yTopLeft),s=Math.max(s,h.xBottomRight),r=Math.max(r,h.yBottomRight);const a=s-e,o=r-i;return new Vt(e+a/2,i+o/2,a,o)}_createGlyphTransform(t,e){const i=Gr*e.angle,s=tt(),r=$t();return ie(s,s,at(r,e.xOffset,-e.yOffset)),e.isCIM?Ie(s,s,i):(ie(s,s,at(r,t.x,t.y)),Ie(s,s,i),ie(s,s,at(r,-t.x,-t.y))),s}},Xt=class{constructor(t,e,i,s,r,a){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,i)),this.end=Math.max(0,Math.max(e,i)),this.endn===10,fi=n=>n===32;function qr(n,t,e){const i=new Array,s=1/e.scale,r=e.maxLineWidth*s,a=t?n.length-1:0,o=t?-1:n.length,h=t?-1:1;let l=a,u=0,c=0,d=l,f=d,m=0,_=1/0,p=0;for(;l!==o;){const{code:g,metrics:x}=n[l],w=Math.abs(x.top);if(ke(g)||fi(g)||(_=Math.min(_,w),p=Math.max(p,w+x.height)),ke(g))l!==a&&(i.push(new Xt(n,d,l-h,u,_,p)),_=1/0,p=0),u=0,d=l+h,f=l+h,c=0;else if(fi(g))f=l+h,c=0,m=x.advance,u+=x.advance;else if(u>r){if(f!==d){const S=f-2*h;u-=m,i.push(new Xt(n,d,S,u-c,_,p)),_=1/0,p=0,d=f,u=c}else i.push(new Xt(n,d,l-h,u,_,p)),_=1/0,p=0,d=l,f=l,u=0;u+=x.advance,c+=x.advance}else u+=x.advance,c+=x.advance;l+=h}const y=new Xt(n,d,l-h,u,_,p);return y.start>=0&&y.endn.push(e)),n}const Me=new Set,Yt=[],Mt=new Map,_i=[0,0];let it=class extends is{constructor(t){super(t),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:t,process:e}=this;this._queue=new fs({concurrency:t,process:(i,s)=>{const r=this._keyToItem.get(i);return e(r,{signal:s})},peeker:i=>i.values().next().value})}destroy(){this.clear(),this._queue=ss(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}get updating(){return this.length>0||this.onGoingCount>0}abort(t){const e=typeof t=="string"?t:t.id;this._queue.abort(e)}clear(){this._queue.clear(),this._keyToItem.clear(),this.notifyChange("updating")}has(t){return typeof t=="string"?this._keyToItem.has(t):this._keyToItem.has(t.id)}isOngoing(t){const e=typeof t=="string"?t:t.id;return this.has(e)&&this._queue.isOngoing(e)}pause(){this._queue.pause()}push(t,e){const i=t.key.id+"-"+e;if(this.has(i))return this.get(i);const s=this._queue.push(i),r=()=>{this._keyToItem.delete(i),this.notifyChange("updating")};return this._keyToItem.set(i,t),s.then(r,r),this.notifyChange("updating"),s}reset(){this._queue.reset(),this.notifyChange("updating")}resume(){this._queue.resume()}_peekByScaleFirst(t){if(!this.state)return t.values().next().value;const e=this.tileInfoView;let i=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;t.forEach(u=>{const c=this._keyToItem.get(u),d=this.tileInfoView.getTileScale(c.key);Mt.has(d)||(Mt.set(d,[]),i=Math.max(d,i),s=Math.min(d,s)),Mt.get(d).push(c.key),Me.add(d)});let r=this.state.scale;Mt.has(r)||(Hr(Yt,Me),Yt.sort((u,c)=>u-c),r=Yt.reduce((u,c)=>Math.abs(c-r){const d=o.denormalizeCol(u.col,u.world),f=o.denormalizeCol(c.col,c.world);return Math.sqrt((h-d)*(h-d)+(l-u.row)*(l-u.row))-Math.sqrt((h-f)*(h-f)+(l-c.row)*(l-c.row))}),Me.clear(),Mt.clear(),a[0].id}_peekByCenterFirst(t){if(!this.state)return t.values().next().value;const e=this.tileInfoView,i=this.state.center;let s,r=Number.POSITIVE_INFINITY;return t.forEach(a=>{const o=this._keyToItem.get(a);e.getTileCoords(_i,o.key);const h=rs(_i,i);hn.push(e)),n}const we=new Set,Ht=[],wt=new Map,mi=[0,0];let st=class extends is{constructor(t){super(t),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:t,process:e,strategy:i}=this;this._queue=new fs({concurrency:t,process:(s,r)=>{const a=this._keyToItem.get(s);return e(a,{signal:r})},peeker:i==="scale-first"?s=>this._peekByScaleFirst(s):s=>this._peekByCenterFirst(s)})}destroy(){this.clear(),this._queue=ss(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}get updating(){return this.length>0||this.onGoingCount>0}abort(t){const e=typeof t=="string"?t:t.id;this._queue.abort(e)}clear(){this._queue.clear(),this._keyToItem.clear(),this.notifyChange("updating")}has(t){return typeof t=="string"?this._keyToItem.has(t):this._keyToItem.has(t.id)}isOngoing(t){const e=typeof t=="string"?t:t.id;return this.has(e)&&this._queue.isOngoing(e)}pause(){this._queue.pause()}push(t){const e=t.key.id;if(this._queue.has(e))return this._queue.get(e);const i=this._queue.push(e),s=()=>{this._keyToItem.delete(e),this.notifyChange("updating")};return this._keyToItem.set(e,t),i.then(s,s),this.notifyChange("updating"),i}reset(){this._queue.reset()}resume(){this._queue.resume()}_peekByScaleFirst(t){if(!this.state)return t.values().next().value;const e=this.tileInfoView;let i=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;t.forEach(u=>{const c=this._keyToItem.get(u),d=this.tileInfoView.getTileScale(c.key);wt.has(d)||(wt.set(d,[]),i=Math.max(d,i),s=Math.min(d,s)),wt.get(d).push(c.key),we.add(d)});let r=this.state.scale;wt.has(r)||(jr(Ht,we),Ht.sort((u,c)=>u-c),r=Ht.reduce((u,c)=>Math.abs(c-r){const d=o.denormalizeCol(u.col,u.world),f=o.denormalizeCol(c.col,c.world);return Math.sqrt((h-d)*(h-d)+(l-u.row)*(l-u.row))-Math.sqrt((h-f)*(h-f)+(l-c.row)*(l-c.row))}),we.clear(),wt.clear(),a[0].id}_peekByCenterFirst(t){if(!this.state)return t.values().next().value;const e=this.tileInfoView,i=this.state.center;let s,r=Number.POSITIVE_INFINITY;return t.forEach(a=>{const o=this._keyToItem.get(a);e.getTileCoords(mi,o.key);const h=rs(mi,i);h=this._buffer.length){const e=this._roundToNearest((this._array.byteLength+t*this._buffer.BYTES_PER_ELEMENT)*Jr,this._buffer.BYTES_PER_ELEMENT),i=new ArrayBuffer(e),s=new this._ctor(i);s.set(this._buffer,0),this._array=i,this._buffer=s,this._i16View=new Int16Array(this._array)}}ensureSize(t){this._ensureSize(t)}writeF32(t){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=t,this._pos++,e}push(t){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=t,e}writeFixed(t){this._buffer[this._pos++]=t}setValue(t,e){this._buffer[t]=e}i1616Add(t,e,i){this._i16View[2*t]+=e,this._i16View[2*t+1]+=i}getValue(t){return this._buffer[t]}incr(t){if(this._buffer.length{const r=1<=yt-i?xi:vi|xi)|(e<0+s?wi:e>=yt-s?Mi:wi|Mi));this._current.overlaps|=r}_getVertexWriter(t){if(!this._data.self.has(t)){const e=this._data.self,i=$e(t,this._symbologyType).geometry;e.set(t,new pi(t,i,this.hint.records))}return this._data.self.get(t)}};function en(n,t,e){const i=Z.SIZE_FIELD_STOPS|Z.SIZE_MINMAX_VALUE|Z.SIZE_SCALE_STOPS|Z.SIZE_UNIT_VALUE,s=(t&(qt.FIELD_TARGETS_OUTLINE|qt.MINMAX_TARGETS_OUTLINE|qt.SCALE_TARGETS_OUTLINE|qt.UNIT_TARGETS_OUTLINE))>>>4;return n===b.LINE&&e.isOutline||n===b.FILL&&Is(e.symbologyType)?i&s:i&~s}const bi=0,Si=8,sn=7,Ti=8,Li=11,Ii=11,zi=12,$i=13,Pi=14,Ci=15,Ei=16,ki=17,Vi=18,Wi=19,Ai=20,Ri=21,Fi=26,rn=Object.keys(W).filter(n=>typeof W[n]=="number").reduce((n,t)=>({...n,[t]:W[t]}),{});function nn(n){return n===W.SIMPLE||n===W.OUTLINE_FILL_SIMPLE}function Is(n){return n===W.OUTLINE_FILL||n===W.OUTLINE_FILL_SIMPLE}function zs(n){return nn(n.symbologyType)}function ae(n){return Is(n.symbologyType)}function ye(n,t){switch(n){case b.FILL:return H.from(t);case b.LINE:return ht.from(t);case b.MARKER:return gt.from(t);case b.TEXT:return Ft.from(t);case b.LABEL:return pt.from(t);default:throw new Error(`Unable to createMaterialKey for unknown geometryType ${n}`)}}function Za(n){switch(U.load(n).geometryType){case b.MARKER:return new gt(n);case b.FILL:return new H(n);case b.LINE:return new ht(n);case b.TEXT:return new Ft(n);case b.LABEL:return new pt(n)}}class U{static load(t){const e=this.shared;return e.data=t,e}constructor(t){this._data=0,this._data=t}set data(t){this._data=t??0}get data(){return this._data}get geometryType(){return this.bits(Ti,Li)}set geometryType(t){this.setBits(t,Ti,Li)}get mapAligned(){return!!this.bit(Ai)}set mapAligned(t){this.setBit(Ai,t)}get sdf(){return!!this.bit(Ii)}set sdf(t){this.setBit(Ii,t??!1)}get pattern(){return!!this.bit(zi)}set pattern(t){this.setBit(zi,t)}get textureBinding(){return this.bits(bi,Si)}set textureBinding(t){this.setBits(t,bi,Si)}get symbologyType(){return this.bits(Ri,Fi)}set symbologyType(t){this.setBits(t,Ri,Fi)}get geometryTypeString(){switch(this.geometryType){case b.FILL:return"fill";case b.MARKER:return"marker";case b.LINE:return"line";case b.TEXT:return"text";case b.LABEL:return"label";default:throw new ut(`Unable to handle unknown geometryType: ${this.geometryType}`)}}setBit(t,e){const i=1<>t}setBits(t,e,i){for(let s=e,r=0;sclass extends n{get vvSizeMinMaxValue(){return this.bit(Ei)!==0}set vvSizeMinMaxValue(t){this.setBit(Ei,t)}get vvSizeScaleStops(){return this.bit(ki)!==0}set vvSizeScaleStops(t){this.setBit(ki,t)}get vvSizeFieldStops(){return this.bit(Vi)!==0}set vvSizeFieldStops(t){this.setBit(Vi,t)}get vvSizeUnitValue(){return this.bit(Wi)!==0}set vvSizeUnitValue(t){this.setBit(Wi,t)}hasSizeVV(){return this.vvSizeMinMaxValue||this.vvSizeScaleStops||this.vvSizeFieldStops||this.vvSizeUnitValue}hasVV(){return super.hasVV()||this.hasSizeVV()}setVV(t,e){super.setVV(t,e);const i=en(this.geometryType,t,e)&t;this.vvSizeMinMaxValue=!!(i&Z.SIZE_MINMAX_VALUE),this.vvSizeFieldStops=!!(i&Z.SIZE_FIELD_STOPS),this.vvSizeUnitValue=!!(i&Z.SIZE_UNIT_VALUE),this.vvSizeScaleStops=!!(i&Z.SIZE_SCALE_STOPS)}},$s=n=>class extends n{get vvRotation(){return this.bit(Ci)!==0}set vvRotation(t){this.setBit(Ci,t)}hasVV(){return super.hasVV()||this.vvRotation}setVV(t,e){super.setVV(t,e),this.vvRotation=!e.isOutline&&!!(t&Z.ROTATION)}},ge=n=>class extends n{get vvColor(){return this.bit($i)!==0}set vvColor(t){this.setBit($i,t)}hasVV(){return super.hasVV()||this.vvColor}setVV(t,e){super.setVV(t,e),this.vvColor=!e.isOutline&&!!(t&Z.COLOR)}},xe=n=>class extends n{get vvOpacity(){return this.bit(Pi)!==0}set vvOpacity(t){this.setBit(Pi,t)}hasVV(){return super.hasVV()||this.vvOpacity}setVV(t,e){super.setVV(t,e),this.vvOpacity=!e.isOutline&&!!(t&Z.OPACITY)}};let H=class extends ge(xe(Gt(U))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const{symbologyType:e,vvFlags:i}=t,s=this.load(0);return s.geometryType=b.FILL,s.symbologyType=e,e!==W.DOT_DENSITY&&s.setVV(i,t),s.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};H.shared=new H(0);class gt extends ge(xe($s(Gt(U)))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const{symbologyType:e,vvFlags:i}=t,s=this.load(0);return s.geometryType=b.MARKER,s.symbologyType=e,e!==W.HEATMAP&&s.setVV(i,t),s.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvRotation:this.vvRotation,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}gt.shared=new gt(0);let ht=class extends ge(xe(Gt(U))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=b.LINE,e.symbologyType=t.symbologyType,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};ht.shared=new ht(0);let Ft=class extends ge(xe($s(Gt(U)))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=b.TEXT,e.symbologyType=t.symbologyType,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvRotation:this.vvRotation,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};Ft.shared=new Ft(0);let pt=class extends Gt(U){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=b.LABEL,e.symbologyType=t.symbologyType,e.setVV(t.vvFlags,t),e.mapAligned=cs(t.placement),e.data}getVariation(){return{...super.getVariation(),vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};pt.shared=new pt(0);const q=0,X=100;function Bi(n,t,e){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n}function Ps(n,t){return Math.sqrt(n*n+t*t)}function Oi(n){const t=Ps(n[0],n[1]);n[0]/=t,n[1]/=t}function an(n,t){return Ps(n[0]-t[0],n[1]-t[1])}function Ve(n=2){return 1/Math.max(n,1)}function dt(n,t){return[!!(n!=null&&n.minScale)&&t.scaleToZoom(n.minScale)||q,!!(n!=null&&n.maxScale)&&t.scaleToZoom(n.maxScale)||X]}function on(n,t){return n[t+1]}function Cs(n){return n.length-1}function hn(n){let t=0;for(let e=0;et._index||this._index===t._index&&this._distance>=t._distance}get _segment(){return this._segments[this._index+1]}get angle(){const t=this.dy,e=(0*t+-1*-this.dx)/(1*this.length);let i=Math.acos(e);return t>0&&(i=2*Math.PI-i),i}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:t,dy:e}=this;return Math.sqrt(t*t+e*e)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1t)return this._seekBackwards(t-s);s+=this.length}return this._distance=0,e?this:null}seek(t,e=!1){if(t<0)return this._seekBackwards(Math.abs(t),e);if(t<=this.remainingLength)return this._distance=(this.backwardLength+t)/this.length,this;let i=this.remainingLength;for(;this.next();){if(i+this.length>t)return this.seek(t-i,e);i+=this.length}return this._distance=1,e?this:null}};function un(n,t,e,i=!0){const s=hn(n),r=cn.create(n),a=s/2;if(!i)return r.seek(a),void e(r.clone(),0,a+0*t,s);const o=Math.max((s-t)/2,0),h=Math.floor(o/t),l=a-h*t;r.seek(l);for(let u=-h;u<=h;u++)r.x<512&&r.x>=0&&r.y<512&&r.y>=0&&e(r.clone(),u,a+u*t,s),r.seek(t)}function dn(n,t){const e=t;for(let i=0;i=0&&!(s[_+1]s[c]+u);_++){const p=u-s[_-1]+s[c],y=s[_]-s[_-1],g=s[_]-s[c]class extends n{constructor(...t){super(...t),this._isCIM=!1,this._vertexBoundsScale=1,this.geometryType=b.TEXT,this._aux=$(0,0,this._referenceSize,this._bitset)}bindTextInfo(t,e){t&&t.length?this._shapingInfo=Yr(t,e,{scale:this._scale,angle:this._angle,xOffset:this._xOffset,yOffset:this._yOffset,hAlign:this._xAlignD,vAlign:this._yAlignD,maxLineWidth:Math.max(32,Math.min(this._lineWidth,512)),lineHeight:$r*Math.max(.25,Math.min(this._lineHeight,4)),decoration:this._decoration,isCIM:this._isCIM,hasBackground:!!this._backgroundColor,borderLineSize:this._borderLineSize}):this._shapingInfo=null}_write(t,e,i,s){const r=e.getDisplayId();this._writeGeometry(t,e,r,i,s)}_writeGeometry(t,e,i,s,r){const a=this._shapingInfo;if(a==null)return;if(this._textPlacement)return this._writePlacedText(t,i,a,s,e,r);const o=r?r.asOptimized():e.geometryType==="esriGeometryPolygon"?e.readCentroid():e.readGeometryForDisplay();if(o!=null){if(o.isPoint){const[h,l]=o.coords;return!t.hasAggregates&&t.hasPixelBufferEnabled&&(h<0||h>=512||l<0||l>=512)?void 0:this._writeGlyphs(t,i,{x:h,y:l},a)}o.forEachVertex((h,l)=>this._writeGlyphs(t,i,{x:h,y:l},a))}}_writePlacedText(t,e,i,s,r,a){const o=this._textPlacement,h=a||ue.fromFeatureSetReaderCIM(r);if(!h)return;const l=-1,u=Es.getPlacement(h,l,o,v(1),t.tileKey,s.geometryEngine);if(!u)return;const c=i.bounds,d=Math.sqrt(c.height*c.height+c.width*c.width);let f,m,_;for(;f=u.next();)if(m=f.tx,_=-f.ty,m+d>=0&&m-d<512&&_+d>=0&&_-d<512){const p=-f.getAngle();i.setRotation(p),this._writeGlyphs(t,e,{x:m,y:_},i),i.setRotation(-p)}}_writeGlyphs(t,e,i,s){const r=U.load(this._materialKey),a=M(Math.round(bt*i.x),Math.round(bt*i.y)),o=this._vertexBoundsScale,{bounds:h,background:l,glyphs:u}=s;u.length>0&&(this._borderLineColor||this._backgroundColor)&&(r.textureBinding=u[0].textureBinding,t.recordStart(e,r.data,this.geometryType,!0),this._writeBackgroundGeometry(t,e,i,h,l),t.recordEnd());const c=2*Math.max(h.width,h.height);for(const d of s.glyphs)r.textureBinding=d.textureBinding,t.recordStart(e,r.data,this.geometryType,!0),t.vertexBounds(i.x+h.x+this._xOffset,i.y+h.y-this._yOffset,c*o,c*o),this._writeVertices(t,e,a,d),t.recordEnd()}_writeGlyph(t,e,i,s,r){const a=U.load(this._materialKey),o=M(Math.round(bt*i),Math.round(bt*s));a.textureBinding=r.textureBinding,t.recordStart(e,a.data,this.geometryType,!0);const h=r.bounds,l=this._vertexBoundsScale;t.vertexBounds(i+h.x*l,s+h.y*l,h.width*l,h.height*l),this._writeVertices(t,e,o,r),t.recordEnd()}_writeVertices(t,e,i,s){const r=t.vertexCount();this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.upperLeft),t.vertexWrite(s.texcoords.upperLeft),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.upperRight),t.vertexWrite(s.texcoords.upperRight),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.lowerLeft),t.vertexWrite(s.texcoords.lowerLeft),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.lowerRight),t.vertexWrite(s.texcoords.lowerRight),t.vertexEnd(),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}_writeVertexCommon(t,e,i,s){const r=this._color,a=this._haloColor,o=$(0,0,this._referenceSize,this._bitset),h=$(0,0,this._size,this._haloSize);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(a),t.vertexWrite(h),t.vertexWrite(o),t.vertexWrite(this._minMaxZoom)}_writeBackgroundVertex(t,e,i,s,r,a){const o=$(0,1,this._referenceSize,this._bitset),h=$(0,0,this._size,this._haloSize),l=$(0,0,0,0);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(s),t.vertexWrite(l),t.vertexWrite(h),t.vertexWrite(o),t.vertexWrite(this._minMaxZoom),t.vertexWrite(r),t.vertexWrite(a),t.vertexEnd()}_writeBackgroundQuad(t,e,i,s,r,a){const o=t.vertexCount();this._writeBackgroundVertex(t,e,i,s,r.upperLeft,a[0]),this._writeBackgroundVertex(t,e,i,s,r.upperRight,a[1]),this._writeBackgroundVertex(t,e,i,s,r.lowerLeft,a[2]),this._writeBackgroundVertex(t,e,i,s,r.lowerRight,a[3]),t.indexWrite(o+0),t.indexWrite(o+1),t.indexWrite(o+2),t.indexWrite(o+1),t.indexWrite(o+3),t.indexWrite(o+2)}_writeBackgroundGeometry(t,e,i,s,r){const a=M(Math.round(bt*i.x),Math.round(bt*i.y)),{x:o,y:h,width:l,height:u}=s,c=2*Math.max(l,u);if(t.vertexBounds(i.x+o+this._xOffset,i.y+h-this._yOffset,c*this._vertexBoundsScale,c*this._vertexBoundsScale),this._backgroundColor){const d=[Qt,Qt,Qt,Qt];this._writeBackgroundQuad(t,e,a,this._backgroundColor,r.main,d)}if(this._borderLineColor||this._backgroundColor){const d=!!this._borderLineColor&&!!this._borderLineSize&&this._borderLineSize>0,[f,m,_,p,y]=d?[Di,Di,Ki,Ki,this._borderLineColor]:[_n,mn,pn,yn,this._backgroundColor];this._writeBackgroundQuad(t,e,a,y,r.top,f),this._writeBackgroundQuad(t,e,a,y,r.bot,m),this._writeBackgroundQuad(t,e,a,y,r.left,_),this._writeBackgroundQuad(t,e,a,y,r.right,p)}}};let Nt=class{constructor(){this._materialKey=null}bindFeature(t,e,i){}write(t,e,i,s){if(this._effects&&this._effects.length>0){let r=ue.fromFeatureSetReaderCIM(e);if(r){r.invertY();const a=yr.executeEffects(this._effects,r,t.tileKey,s.geometryEngine);for(;r=a.next();)r.invertY(),this._write(t,e,s,r)}}else this._write(t,e,s)}_write(t,e,i,s){}};const gn=5;let Ae=class Re extends ks(Nt){constructor(t,e,i,s,r,a,o,h,l,u,c,d,f,m,_,p,y,g,x,w,S,L,I,z){super(),this._xOffset=v(f),this._yOffset=v(m),this._decoration=u||"none",this._backgroundColor=L,this._borderLineColor=I,this._borderLineSize=z,this._color=r,this._haloColor=a,this._haloSize=Math.min(Math.floor(gn*v(Hs(i))),127),this._size=Math.min(Math.round(v(e)),127);const j=Math.min(Math.round(v(s||e)),127);this._referenceSize=Math.round(Math.sqrt(256*j)),this._scale=this._size/ms,this._angle=d,this._justify=gr(o||"center"),this._xAlignD=us(o||"center"),this._yAlignD=ds(h||"baseline"),this._baseline=(h||"baseline")==="baseline",this._bitset=(l===N.MAP?1:0)|(c?1:0)<<1;const xt=U.load(t);xt.sdf=!0,this._materialKey=xt.data,this._lineWidth=v(_)||512,this._lineHeight=p||1,this._textPlacement=y,this._effects=g,this._isCIM=x??!1,this._minMaxZoom=M(Math.round(w*A),Math.round(S*A))}static fromText(t,e){var a,o;const i=(a=t.font)==null?void 0:a.size,s=new Re(t.materialKey,i,t.haloSize||0,i,t.color&&D(t.color)||0,t.haloColor&&D(t.haloColor)||0,t.horizontalAlignment,t.verticalAlignment,N.SCREEN,(o=t.font)==null?void 0:o.decoration,!1,t.angle||0,t.xoffset||0,t.yoffset||0,t.lineWidth||0,t.lineHeight||0,null,null,!1,q,X,t.backgroundColor&&D(t.backgroundColor),t.borderLineColor&&D(t.borderLineColor),t.borderLineSize),[,r]=ze(t.text);return s.bindTextInfo(e??[],r),s._vertexBoundsScale=t.maxVVSize&&i?t.maxVVSize/i:1,s}static fromCIMText(t,e,i){const s=t.scaleFactor||1,r=t.size*t.sizeRatio*s,[a,o]=dt(t.scaleInfo,i),h=new Re(t.materialKey,r,t.outlineSize*t.sizeRatio,t.referenceSize,P(t.color),P(t.outlineColor),t.horizontalAlignment,t.verticalAlignment,t.alignment,t.decoration,t.colorLocked??!1,t.angle,t.offsetX*t.sizeRatio*s,t.offsetY*t.sizeRatio*s,512,1,t.markerPlacement,t.effects,!0,a,o,t.backgroundColor?P(t.backgroundColor):void 0,t.borderLineColor?P(t.borderLineColor):void 0,t.borderLineWidth),[,l]=ze(t.text);return h.bindTextInfo(e,l),h._vertexBoundsScale=t.maxVVSize?t.maxVVSize/r:1,h}};const Vs=Ct.getLogger("esri.views.2d.engine.webgl.WGLLabelTemplate"),xn=(n,t="mapview-labeling")=>Vs.error(new ut(t,n)),Jt=1,St=0,vn=4,be=25;function Mn(n,t){const e=!!n.minScale&&t.scaleToZoom(n.minScale)||0;return as(e,0,25.5)}function wn(n,t){const e=!!n.maxScale&&t.scaleToZoom(n.maxScale)||255;return as(e,0,25.5)}function bn(n){const t=new Map;return e=>(t.has(e)||t.set(e,n(e)),t.get(e))}const Sn=bn(n=>{let t=0;if(n===0)return 1/0;for(;!(n%2);)t++,n/=2;return t}),te=n=>Math.floor(127*n+127),ft=n=>Math.floor(10*n),rt=n=>Math.round(n*(254/360));let Gi=class Ws extends Ae{constructor(t,e,i,s){var c,d,f;super(t,(c=i.font)==null?void 0:c.size,i.haloSize||0,(d=i.font)==null?void 0:d.size,i.color&&D(i.color)||0,i.haloColor&&D(i.haloColor)||0,i.horizontalAlignment,i.verticalAlignment,cs(e.labelPlacement)?N.MAP:N.SCREEN,(f=i.font)==null?void 0:f.decoration,!1,i.angle||0,i.xoffset,i.yoffset,i.lineWidth,i.lineHeight,null,null,!1,null,null,i.backgroundColor&&D(i.backgroundColor),i.borderLineColor&&D(i.borderLineColor),i.borderLineSize),this._outLineLabelAngle=0,this._refPlacementPadding=0,this._refPlacementDirX=0,this._refPlacementDirY=0,this._refOffsetX=0,this._refOffsetY=0,this._zoomLevel=0,this.geometryType=b.LABEL,this._allowOverrun=e.allowOverrun??!1,this._repeatLabel=e.repeatLabel??!0,this._labelPosition=e.labelPosition??"curved";const r=Mn(e,s),a=wn(e,s),o=e.labelPlacement,[h,l]=xr(o);this._xAlignD=h,this._yAlignD=l,this._minZoom=r,this._maxZoom=a,this._minBackgroundZoom=r,this._maxBackgroundZoom=a,this._refPlacementPadding=v(i.haloSize)+Pr,this._repeatLabelDistance=e.repeatLabelDistance?v(e.repeatLabelDistance):128;const u=pt.load(t);u.sdf=!0,this._materialKey=u.data}static fromLabelClass(t,e){if(t.labelPlacement==="esriServerLinePlacementCenterAlong"){const i=t.symbol;i.xoffset=0,i.yoffset=0,i.angle=0,i.font.decoration="none"}return new Ws(t.materialKey,t,t.symbol,e)}get _shapedBox(){return this._shapingInfo.bounds}setZoomLevel(t){this._zoomLevel=t}bindReferenceTemplate(t){let e=vr(this._xAlignD),i=Mr(this._yAlignD);if(this._refOffsetX=0,this._refOffsetY=0,t==null)return void(this._refSymbolAndPlacementOffset=$(0,0,te(e),te(i)));if(t.boundsType==="circle"&&(e||i)){const a=Math.sqrt(e*e+i*i);e/=a,i/=a}const s=Math.max(t.height,t.width),r=this._refPlacementPadding*vn;this._refSymbolAndPlacementOffset=$(r,s,te(e),te(i)),this._referenceSize=s,this._refPlacementDirX=e,this._refPlacementDirY=i,this._refOffsetX=t.xOffset,this._refOffsetY=t.yOffset}_write(t,e){if(this._shapingInfo==null)return;const i=this._shapingInfo,s=e.getDisplayId(),r=e.geometryType==="esriGeometryPolygon"?e.readLegacyCentroid():e.readLegacyGeometry();if(r)switch(this._current={out:t,inId:s,inShaping:i,zoomLevel:this._zoomLevel},e.geometryType==="esriGeometryPolyline"&&this._labelPosition==="curved"&&(this._borderLineColor||this._backgroundColor)&&Vs.warnOnce("TextSymbol properties 'borderLineColor', 'borderLineSize', and 'backgroundColor' are not supported in curved labels"),e.geometryType){case"esriGeometryPolyline":this._placeLineLabels(r);break;case"esriGeometryPoint":case"esriGeometryPolygon":this._placePointLabels(r);break;default:xn(`Geometry of type ${e.geometryType} is not supported`)}}_isVisible(t,e){const i=ft(this._current.zoomLevel);return ft(t)<=i&&i<=ft(e)}_placePointLabels(t){const{out:e,inId:i,inShaping:s}=this._current;this._writeGlyphs(e,i,t,s)}_placeLineLabels(t){const e=dn(t.paths,this._current.inShaping.bounds.width),i=this._placeSubdivGlyphs.bind(this),s=(this._shapedBox.width+this._repeatLabelDistance)/(1<0&&(this._borderLineColor||this._backgroundColor);if(this._maxBackgroundZoom=be,this._minBackgroundZoom=Math.max(e,0),l){const u=pt.load(this._materialKey);u.textureBinding=r.glyphs[0].textureBinding;const c=ce(tt(),-t.angle),[d,f]=r.shapeBackground(c);this._outLineLabelAngle=rt(o),i.recordStart(s,u.data,this.geometryType,!0),this._writeBackgroundGeometry(i,s,t,d,f),i.recordEnd(),this._outLineLabelAngle=rt(h),i.recordStart(s,u.data,this.geometryType,!0),this._writeBackgroundGeometry(i,s,t,d,f),i.recordEnd()}this._outLineLabelAngle=rt(o),this._placeFirst(a,e,1,!0),this._outLineLabelAngle=rt(h),this._placeFirst(a,e,0,!0),i.metricEnd()}_placeBack(t,e,i,s,r){const a=t.clone();let o=t.backwardLength+St;for(;a.prev()&&!(o>=s);)this._placeOnSegment(a,e,o,i,-1,r),o+=a.length+St}_placeForward(t,e,i,s,r){const a=t.clone();let o=t.remainingLength+St;for(;a.next()&&!(o>=s);)this._placeOnSegment(a,e,o,i,1,r),o+=a.length+St}_placeFirst(t,e,i,s=!1){const r=t,a=this._current.inShaping,o=a.glyphs,h=this._current.zoomLevel,{out:l,inId:u}=this._current;for(const c of o){const d=c.x>a.bounds.x?i:1-i,f=d*t.remainingLength+(1-d)*t.backwardLength,m=Math.abs(c.x+c.width/2-a.bounds.x),_=Math.max(0,h+Math.log2(m/(f+St))),p=Math.max(e,s?0:_);if(c.maxZoom=be,c.angle=t.angle+(1-i)*Math.PI,c.minZoom=p,this._writeGlyph(l,u,r.x,r.y,c),i&&this._isVisible(c.minZoom,c.maxZoom)){const y=c.bounds;l.metricBoxWrite(y.center[0],y.center[1],y.width,y.height)}}}_placeOnSegment(t,e,i,s,r,a){const o=this._current.inShaping.glyphs,{out:h,inId:l}=this._current,u=this._current.inShaping,c=this._current.zoomLevel,d=t.dx/t.length,f=t.dy/t.length,m={x:t.x+i*-r*d,y:t.y+i*-r*f};for(const _ of o){const p=_.x>u.bounds.x?a:1-a;if(!(p&&r===1||!p&&r===-1))continue;const y=Math.abs(_.x+_.width/2-u.bounds.x),g=Math.max(0,c+Math.log2(y/i)-.1),x=Math.max(s,c+Math.log2(y/(i+t.length+St)));if(g!==0&&(_.angle=t.angle+(1-a)*Math.PI,_.minZoom=x,_.maxZoom=g,this._writeGlyph(h,l,m.x,m.y,_),a&&this._isVisible(_.minZoom,_.maxZoom))){const w=_.bounds,S=t.x-e.x,L=t.y-e.y;h.metricBoxWrite(w.center[0]+S,w.center[1]+L,w.width,w.height)}}}_writeGlyphs(t,e,i,s,r=this._minZoom){if(i.x<0||i.x>=512||i.y<0||i.y>=512)return;if(s.glyphs.length>0&&(this._borderLineColor||this._backgroundColor)){const c=pt.load(this._materialKey);c.textureBinding=s.glyphs[0].textureBinding,t.recordStart(e,c.data,this.geometryType,!0),this._writeBackgroundGeometry(t,e,i,s.bounds,s.background),t.recordEnd()}const a=i.x+this._refOffsetX,o=i.y-this._refOffsetY;for(const c of s.glyphs)c.minZoom=r,c.maxZoom=this._maxZoom,this._writeGlyph(t,e,a,o,c);const h=this._refPlacementDirX,l=this._refPlacementDirY,u=s.boundsT;t.metricStart(e,r,a,o,h,l,this._referenceSize,this._materialKey),t.metricBoxWrite(u.center[0],u.center[1],u.width,u.height),t.metricEnd()}_writeVertexCommon(t,e,i,s){const r=this._color,a=this._haloColor,o=$(0,0,this._size,this._haloSize),h=Math.max(s.minZoom,this._minZoom),l=Math.min(s.maxZoom,this._maxZoom),u=$(ft(h),ft(l),this._outLineLabelAngle,0);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(a),t.vertexWrite(o),t.vertexWrite(this._refSymbolAndPlacementOffset),t.vertexWrite(u)}_writeBackgroundVertex(t,e,i,s,r,a){const o=$(0,0,this._size,this._haloSize),h=$(0,0,0,0),l=$(ft(this._minBackgroundZoom),ft(this._maxBackgroundZoom),this._outLineLabelAngle,1);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(s),t.vertexWrite(h),t.vertexWrite(o),t.vertexWrite(this._refSymbolAndPlacementOffset),t.vertexWrite(l),t.vertexWrite(r),t.vertexWrite(a),t.vertexEnd()}};const Se=3.14159265359/180,Ni=8,As=n=>class extends n{constructor(...t){super(...t),this.angle=0,this.xOffset=0,this.yOffset=0,this.width=0,this.height=0,this.boundsType="square",this._anchorX=0,this._anchorY=0,this._computedWidth=0,this._computedHeight=0,this._allowBorrowing=!0,this._vertexBoundsScaleX=1,this._vertexBoundsScaleY=1,this.geometryType=b.MARKER}_write(t,e,i,s){const r=e.getDisplayId();t.recordStart(r,this._materialKey,this.geometryType,!0),this._writeGeometry(t,e,r,i,s),t.recordEnd()}_writeGeometry(t,e,i,s,r){if(this._markerPlacement!=null)return this._writePlacedMarkers(t,e,s,r);if(this._allowBorrowing=!0,!r&&e.geometryType==="esriGeometryPoint"){const o=e.getX(),h=e.getY();return!t.hasAggregates&&t.hasPixelBufferEnabled&&(o<0||o>=513||h<0||h>=513)?void 0:this._writeVertices(t,i,this._getPos(o,h),o,h)}const a=r?r.asOptimized():e.geometryType==="esriGeometryPolygon"?e.readCentroid():e.readGeometryForDisplay();if(a!=null){if(a.isPoint){const[o,h]=a.coords;return!t.hasAggregates&&t.hasPixelBufferEnabled&&(o<0||o>=512||h<0||h>=512)?void 0:this._writeVertices(t,i,this._getPos(o,h),o,h)}a.forEachVertex((o,h)=>{const l=2*yt;o<-l||o>=l||h<-l||h>=l||this._writeVertices(t,i,this._getPos(o,h),o,h)})}}_writePlacedMarkers(t,e,i,s){const r=s||ue.fromFeatureSetReaderCIM(e);if(!r)return;const a=-1,o=Es.getPlacement(r,a,this._markerPlacement,v(1),t.tileKey,i.geometryEngine);if(!o)return;this._allowBorrowing=e.geometryType!=="esriGeometryPolygon";const h=e.getDisplayId(),l=$t(),u=tt(),c=-128,d=640;let f=o.next();for(;f!=null;){const m=f.tx,_=-f.ty;m>=c&&m<=d&&_>=c&&_<=d&&(this._applyTransformation(u,l,-f.getAngle()/Se),this._writeVertices(t,h,this._getPos(m,_),m,_)),f=o.next()}}_writeVertices(t,e,i,s,r){const a=gt.load(this._materialKey);return a.symbologyType===W.HEATMAP?this._writeHeatmapVertices(t,e,i):this._writeMarkerVertices(t,e,a,i,s,r)}_writeMarkerVertices(t,e,i,s,r,a){const o=i.vvRotation,h=t.vertexCount();let l=this._computedWidth*this._vertexBoundsScaleX,u=this._computedHeight*this._vertexBoundsScaleY;if(this.angle){const c=Math.max(l,u);l=c,u=c}if(o){const c=Math.max(this.xOffset,this.yOffset);l+=c,u+=c}this._allowBorrowing&&t.vertexBounds(r+this.xOffset,a-this.yOffset,l,u),t.vertexWrite(s),t.vertexWrite(this._offsetUpperLeft),t.vertexWrite(this._texUpperLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(s),t.vertexWrite(this._offsetUpperRight),t.vertexWrite(this._texUpperRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(s),t.vertexWrite(this._offsetBottomLeft),t.vertexWrite(this._texBottomLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(s),t.vertexWrite(this._offsetBottomRight),t.vertexWrite(this._texBottomRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),this._writeIndices(t,h)}_writeHeatmapVertices(t,e,i){const s=t.vertexCount();t.vertexWrite(i),t.vertexWrite(this._offsetUpperLeft),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetUpperRight),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomLeft),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomRight),t.vertexWrite(e),t.vertexEnd(),this._writeIndices(t,s)}_writeIndices(t,e){t.indexWrite(e+0),t.indexWrite(e+1),t.indexWrite(e+2),t.indexWrite(e+1),t.indexWrite(e+3),t.indexWrite(e+2)}_applyTransformation(t,e,i=0){i?ce(t,Se*i):js(t),ie(t,t,es(this.xOffset,-this.yOffset)),this.angle&&Ie(t,t,Se*this.angle);const s=this._computedWidth,r=this._computedHeight,a=-(.5+this._anchorX)*s,o=-(.5-this._anchorY)*r;at(e,a,o),It(e,e,t),this._offsetUpperLeft=M(16*e[0],16*e[1]),at(e,a+s,o),It(e,e,t),this._offsetUpperRight=M(16*e[0],16*e[1]),at(e,a,o+r),It(e,e,t),this._offsetBottomLeft=M(16*e[0],16*e[1]),at(e,a+s,o+r),It(e,e,t),this._offsetBottomRight=M(16*e[0],16*e[1])}_computeSize(t,e,i,s,r,a,o,h){const l=t*i,u=e*i;if(a.sdf&&!o){const L=h&&t>e?l:t,I=e,z=s+2*1;t=Math.min(L+z,l),e=Math.min(I+z,u)}else t=l,e=u;const c=Cr/Math.max(l,u),d=.5*(l-t)*c,f=.5*(u-e)*c,m=a.rect.x+V+d,_=a.rect.y+V+f,p=m+a.width-2*d,y=_+a.height-2*f,g=Math.floor(m),x=Math.floor(_),w=Math.ceil(p),S=Math.ceil(y);t*=(w-g)/(p-m),e*=(S-x)/(y-_),this._texUpperLeft=M(g,x),this._texUpperRight=M(w,x),this._texBottomLeft=M(g,S),this._texBottomRight=M(w,S),this._anchorX*=l/t,this._anchorY*=u/e,t*=r,e*=r,this._computedWidth=t,this._computedHeight=e}_getPos(t,e){return M(Math.round(Ni*t),Math.round(Ni*e))}};let Wt=class At extends As(Nt){constructor(t,e,i,s,r,a,o,h,l,u,c,d,f,m,_,p,y,g,x,w,S,L,I,z){super(),this.angle=s,this.height=o,this.width=a,this.xOffset=e*x,this.yOffset=i*x,this._markerPlacement=w||void 0,this._effects=S||void 0,this._anchorX=p,this._anchorY=y,this._minMaxZoom=M(Math.round(L*A),Math.round(I*A));const j=(m===N.MAP?ps:ys)|(c?ot:0)|(f?Er:0)|(d?gs:0),xt=_&&_.sdf,vt=gt.load(t);vt.sdf=xt,vt.pattern=!0,vt.textureBinding=_.textureBinding,this._materialKey=vt.data,this._fillColor=r,this._outlineColor=l,this._sizeOutlineWidth=$(Math.round(Math.min(Math.sqrt(128*a),255)),Math.round(Math.min(Math.sqrt(128*o),255)),Math.round(Math.min(Math.sqrt(128*u),255)),Math.round(Math.min(Math.sqrt(128*h),255))),vt.symbologyType===W.PIE_CHART?(a*=g*x,o*=g*x,this._computedWidth=a,this._computedHeight=o,this._texUpperLeft=M(0,1),this._texUpperRight=M(1,1),this._texBottomLeft=M(0,0),this._texBottomRight=M(1,0)):this._computeSize(a,o,g,u,x,_,vt.hasSizeVV(),z);const qs=Math.round(64*g);this._bitestAndDistRatio=M(j,qs);const Xs=$t(),Ys=tt();this._applyTransformation(Ys,Xs)}static fromCIMMarker(t,e,i){const s=e&&e.width||1,r=e&&e.height||1,a=t.size,o=s/r*t.scaleX,h=t.scaleSymbolsProportionally&&t.frameHeight?a/t.frameHeight:1,l=P(t.color),u=P(t.outlineColor),c=v(a),d=c*o,f=v(t.offsetX||0),m=v(t.offsetY||0),_=v(t.outlineWidth||0)*h,p=t.alignment||N.SCREEN,y=v(t.referenceSize),[g,x]=dt(t.scaleInfo,i);let w=t.rotation||0;t.rotateClockwise||(w=-w);let S=0,L=0;const I=t.anchorPoint;I&&(t.isAbsoluteAnchorPoint?a&&(S=I.x/(a*o),L=I.y/a):(S=I.x,L=I.y));const z=new At(t.materialKey,f,m,w,l,d,c,y,u,_,t.colorLocked,t.scaleSymbolsProportionally,!1,p,e,S,L,t.sizeRatio,t.scaleFactor??1,t.markerPlacement,t.effects,g,x,!0);return z._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/d:1,z._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/c:1,z}static fromPictureMarker(t,e){const i=Math.round(v(t.width)),s=Math.round(v(t.height)),r=xs,a=Math.round(v(t.xoffset||0)),o=Math.round(v(t.yoffset||0)),h=new At(t.materialKey,a,o,t.angle,r,i,s,s,0,0,!1,!1,!1,N.SCREEN,e,0,0,1,1,null,null,q,X,!1);return h._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.width:1,h._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.height:1,h}static fromSimpleMarker(t,e){const i=t.style,s=D(t.color),r=Math.round(v(t.size));let a=r;i==="esriSMSTriangle"&&(a*=e.height/e.width);const o=Math.round(v(t.xoffset||0)),h=Math.round(v(t.yoffset||0)),l=t.outline,u=0|((l==null?void 0:l.color)&&D(l.color)),c=0|((l==null?void 0:l.width)&&Math.round(v(l.width))),d=new At(t.materialKey,o,h,t.angle??0,s,r,a,a,u,c,!1,!1,i==="esriSMSCross"||i==="esriSMSX",N.SCREEN,e,0,0,2,1,null,null,q,X,!1);return d.boundsType=i==="esriSMSCircle"?"circle":"square",d._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.size:1,d._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.size:1,d}static fromLineSymbolMarker(t,e){const i=D(t.color),s=6,r=Math.round(v(s*t.lineWidth)),a=r,o=t.style==="cross"||t.style==="x";let h;switch(t.placement){case"begin-end":h=Zt.Both;break;case"begin":h=Zt.JustBegin;break;case"end":h=Zt.JustEnd;break;default:h=Zt.None}const l={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:h,offsetAlongLine:0},u=new At(t.materialKey,0,0,0,i,r,a,a/s,i,o?Math.round(v(t.lineWidth)):0,!1,!1,o,N.MAP,e,0,0,2,1,l,null,q,X,!1);return u.boundsType=t.style==="circle"?"circle":"square",u}};function Tn(n,t,e,i,s,r,a){Oe=0;const o=(i-e)*r,h=s&&s.length,l=h?(s[0]-e)*r:o;let u,c,d,f,m,_=Rs(t,e,i,0,l,r,!0);if(_&&_.next!==_.prev){if(h&&(_=$n(t,e,i,s,_,r)),o>80*r){u=d=t[0+e*r],c=f=t[1+e*r];for(let p=r;p0)for(let h=i;h=i;h-=r)o=Zi(h+t*r,n[h+t*r],n[h+1+t*r],o);return o&&mt(o,o.next)&&(Dt(o),o=o.next),o}function Bt(n,t=n){if(!n)return n;let e,i=n;do if(e=!1,i.steiner||!mt(i,i.next)&&C(i.prev,i,i.next)!==0)i=i.next;else{if(Dt(i),i=t=i.prev,i===i.next)break;e=!0}while(e||i!==t);return t}function Ot(n,t,e,i,s,r,a,o){if(!n)return;!o&&r&&(n=Fs(n,i,s,r));let h=n;for(;n.prev!==n.next;){const l=n.prev,u=n.next;if(r?In(n,i,s,r):Ln(n))t.push(l.index/e+a),t.push(n.index/e+a),t.push(u.index/e+a),Dt(n),n=u.next,h=u.next;else if((n=u)===h){o?o===1?Ot(n=An(n,t,e,a),t,e,i,s,r,a,2):o===2&&Rn(n,t,e,i,s,r,a):Ot(Bt(n),t,e,i,s,r,a,1);break}}}function Ln(n){const t=n.prev,e=n,i=n.next;if(C(t,e,i)>=0)return!1;let s=n.next.next;const r=s;let a=0;for(;s!==n.prev&&(a===0||s!==r);){if(a++,zt(t.x,t.y,e.x,e.y,i.x,i.y,s.x,s.y)&&C(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function In(n,t,e,i){const s=n.prev,r=n,a=n.next;if(C(s,r,a)>=0)return!1;const o=s.xr.x?s.x>a.x?s.x:a.x:r.x>a.x?r.x:a.x,u=s.y>r.y?s.y>a.y?s.y:a.y:r.y>a.y?r.y:a.y,c=Fe(o,h,t,e,i),d=Fe(l,u,t,e,i);let f=n.prevZ,m=n.nextZ;for(;f&&f.z>=c&&m&&m.z<=d;){if(f!==n.prev&&f!==n.next&&zt(s.x,s.y,r.x,r.y,a.x,a.y,f.x,f.y)&&C(f.prev,f,f.next)>=0||(f=f.prevZ,m!==n.prev&&m!==n.next&&zt(s.x,s.y,r.x,r.y,a.x,a.y,m.x,m.y)&&C(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;f&&f.z>=c;){if(f!==n.prev&&f!==n.next&&zt(s.x,s.y,r.x,r.y,a.x,a.y,f.x,f.y)&&C(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;m&&m.z<=d;){if(m!==n.prev&&m!==n.next&&zt(s.x,s.y,r.x,r.y,a.x,a.y,m.x,m.y)&&C(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function Zi(n,t,e,i){const s=Pt.create(n,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function Dt(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function zn(n){let t=n,e=n;do(t.x=e.next.y&&e.next.y!==e.y){const d=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(d<=i&&d>a){if(a=d,d===i){if(s===e.y)return e;if(s===e.next.y)return e.next}r=e.x=e.x&&e.x>=h&&i!==e.x&&zt(sr.x)&&Kt(e,n)&&(r=e,c=u)),e=e.next;return r}function Fs(n,t,e,i){let s;for(;s!==n;s=s.next){if(s=s||n,s.z===null&&(s.z=Fe(s.x,s.y,t,e,i)),s.prev.next!==s||s.next.prev!==s)return s.prev.next=s,s.next.prev=s,Fs(n,t,e,i);s.prevZ=s.prev,s.nextZ=s.next}return n.prevZ.nextZ=null,n.prevZ=null,En(n)}function En(n){let t,e=1;for(;;){let i,s=n;n=null,t=null;let r=0;for(;s;){r++,i=s;let a=0;for(;a0||o>0&&i;){let h;a===0?(h=i,i=i.nextZ,o--):o!==0&&i?s.z<=i.z?(h=s,s=s.nextZ,a--):(h=i,i=i.nextZ,o--):(h=s,s=s.nextZ,a--),t?t.nextZ=h:n=h,h.prevZ=t,t=h}s=i}if(t.nextZ=null,e*=2,r<2)return n}}function C(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function Bs(n,t,e,i){return!!(mt(n,t)&&mt(e,i)||mt(n,i)&&mt(e,t))||C(n,t,e)>0!=C(n,t,i)>0&&C(e,i,n)>0!=C(e,i,t)>0}function kn(n,t){let e=n;do{if(e.index!==n.index&&e.next.index!==n.index&&e.index!==t.index&&e.next.index!==t.index&&Bs(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function Vn(n,t,e,i,s,r){let a=0;for(let o=i,h=s-r;o=0&&(n-a)*(i-o)-(e-a)*(t-o)>=0&&(e-a)*(r-o)-(s-a)*(i-o)>=0}function Kt(n,t){return C(n.prev,n,n.next)<0?C(n,t,n.next)>=0&&C(n,n.prev,t)>=0:C(n,t,n.prev)<0||C(n,n.next,t)<0}function Fe(n,t,e,i,s){return(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-e)*s)|n<<8))|n<<4))|n<<2))|n<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*s)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function mt(n,t){return n.x===t.x&&n.y===t.y}function Wn(n,t){return n.x-t.x}function An(n,t,e,i){let s=n;do{const r=s.prev,a=s.next.next;!mt(r,a)&&Bs(r,s,s.next,a)&&Kt(r,a)&&Kt(a,r)&&(t.push(r.index/e+i),t.push(s.index/e+i),t.push(a.index/e+i),Dt(s),Dt(s.next),s=n=a),s=s.next}while(s!==n);return s}function Rn(n,t,e,i,s,r,a){let o=n;do{let h=o.next.next;for(;h!==o.prev;){if(o.index!==h.index&&Fn(o,h)){let l=Os(o,h);return o=Bt(o,o.next),l=Bt(l,l.next),Ot(o,t,e,i,s,r,a,0),void Ot(l,t,e,i,s,r,a,0)}h=h.next}o=o.next}while(o!==n)}function Fn(n,t){return n.next.index!==t.index&&n.prev.index!==t.index&&!kn(n,t)&&Kt(n,t)&&Kt(t,n)&&Bn(n,t)}function Bn(n,t){let e=n,i=!1;const s=(n.x+t.x)/2,r=(n.y+t.y)/2;do e.y>r!=e.next.y>r&&e.next.y!==e.y&&s<(e.next.x-e.x)*(r-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==n);return i}function Os(n,t){const e=Pt.create(n.index,n.x,n.y),i=Pt.create(t.index,t.x,t.y),s=n.next,r=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,i.next=e,e.prev=i,r.next=i,i.prev=r,i}class Pt{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(t,e,i){const s=Oe0))break;c+=y,d.push(o+u),u+=p}const f=a.length;Tn(a,e,o,o+u,d,2,r);const m=Kn(a,e,f,a.length,r),_=Math.abs(c);if(Math.abs((m-_)/Math.max(1e-7,_))>Dn)return a.length=0,!1;h=l,o+=u}return!0}function Nn(n){const{coords:t,lengths:e}=n,{buffer:i}=Rr(t,e);return i}function Zn(n,t,e){let i=0;for(let s=0;se||he)return!0}i+=r}return!1}function Un(n,t){if(n==null)return null;if(!Zn(n,-128,yt+128))return n;_t.setPixelMargin(t),_t.reset(Ss.Polygon);let e=0;for(let a=0;as||us){a=!0;continue}h.push({x:l,y:u})}let c=!1;for(;n.nextPoint();)if(l=n.x,u=n.y,a)e.lineTo(l,u);else{if(ls||us){c=!0;break}h.push({x:l,y:u})}if(c)a=!0;else{if(a){const d=e.resultWithStarts();if(d)for(const f of d)r.push(f)}else r.push({line:h,start:0});o=n.nextPath(),a=!1}}return r=r.filter(h=>h.line.length>1),r.length===0?null:r}_t.setExtent(yt),De.setExtent(yt);const he=8,B=16,qi=65535,Ds=n=>class extends n{constructor(...t){super(...t),this.tessellationProperties={},this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0},this.geometryType=b.LINE}writeGeometry(t,e,i,s){this._writeGeometry(t,e,i,s)}_initializeTessellator(t){const e=ht.load(this._materialKey),i=H.load(this._materialKey),s=this._tessellationOptions,r=e.vvSizeFieldStops||e.vvSizeMinMaxValue||e.vvSizeScaleStops||e.vvSizeUnitValue,a=this.tessellationProperties._halfWidth(i,s,r,a,o,h,l,u,c,d,f)=>{const m=M(f,Math.ceil(B*n._halfWidth)),_=$(Math.round(B*l),Math.round(B*u),Math.round(B*c),Math.round(B*d)),p=$(B*o,B*h,0,n._bitset),y=n.out;return y.vertexBounds(i,s,t,e),y.vertexWrite(M(he*i,he*s)),y.vertexWrite(n.id),y.vertexWrite(n._fillColor),y.vertexWrite(_),y.vertexWrite(m),y.vertexWrite(n._tl),y.vertexWrite(n._br),y.vertexWrite(p),y.vertexWrite(M(Math.ceil(B*n._halfReferenceWidth),0)),y.vertexWrite(n.minMaxZoom),y.vertexEnd(),n.offset+n.vertexCount++},Yn=(n,t,e)=>(i,s,r,a,o,h,l,u,c,d,f)=>{const m=M(B*n._halfWidth,B*n._halfReferenceWidth),_=$(B*l+128,B*u+128,B*c+128,B*d+128),p=n.out,y=n._bitset<<24|n.id;p.vertexBounds(i,s,t,e),p.vertexWrite(M(he*i,he*s)),p.vertexWrite(y),p.vertexWrite(n._fillColor);const g=zs(n.key);return g||(p.vertexWrite(0),p.vertexWrite(0)),p.vertexWrite(0),p.vertexWrite(m),p.vertexWrite(_),g||p.vertexWrite(n.minMaxZoom),p.vertexEnd(),n.offset+n.vertexCount++},Hn=n=>(t,e,i)=>{const s=n.out;s.indexWrite(t),s.indexWrite(e),s.indexWrite(i),n.indexCount+=3};let Ke=class Lt extends Ds(Nt){constructor(t,e,i,s,r,a,o,h,l,u,c,d,f,m,_,p,y,g,x,w){super();const S=ht.load(t);e&&(S.sdf=e.sdf,S.pattern=!0,S.textureBinding=e.textureBinding),this._capType=s,this._joinType=r,this._miterLimitCosine=Ve(a),this.tessellationProperties._fillColor=o,this.tessellationProperties._tl=h,this.tessellationProperties._br=l,this._hasPattern=u,this._isDashed=c,this._zOrder=y,this._effects=g||null,this._minMaxZoom=M(Math.round(x*A),Math.round(w*A)),this._materialKey=S.data;const L=(f?ot:0)|(m?Vr:0)|(d?vs:0)|(_?de:0);this.tessellationProperties._bitset=L,this.tessellationProperties._halfWidth=.5*i,this.tessellationProperties._halfReferenceWidth=.5*p,this.tessellationProperties.offset=0,this._initializeTessellator(!1)}static fromCIMLine(t,e,i){const s=t.color,r=t.scaleFactor||1,a=!!t.dashTemplate;let o=t.cap;a&&o===ai.ROUND&&(o=ai.SQUARE);const h=t.join,l=v(t.width)*r,u=v(t.referenceWidth),c=v(t.miterLimit),d=s&&P(s)||0,[f,m]=dt(t.scaleInfo,i),_=!1;if(!e)return new Lt(t.materialKey,e,l,o,h,c,d,0,0,!1,a,t.scaleDash??!1,t.colorLocked??!1,_,t.sampleAlphaOnly,u,t.zOrder,t.effects,f,m);const{rect:p,width:y,height:g}=e,x=p.x+V,w=p.y+V,S=x+y,L=w+g,I=M(x,w),z=M(S,L),j=!1;return new Lt(t.materialKey,e,l,o,h,c,d,I,z,!0,a,t.scaleDash??!1,t.colorLocked??!1,j,t.sampleAlphaOnly,u,t.zOrder,t.effects,f,m)}static fromFillOutline(t){var i;const e=H.load(t.materialKey);return ae(e)&&t.outline&&((i=t.outline)==null?void 0:i.style)==="esriSLSSolid"?Lt.fromSimpleLine({hash:"",materialKey:t.materialKey,...t.outline},null,!0):null}static fromSimpleLine(t,e,i=!1){const{color:s}=t,r=t.style!=="esriSLSSolid"&&t.style!=="esriSLSNull",a=Lr(t.cap||"round"),o=Ir(t.join||"round");let h=s&&t.style!=="esriSLSNull"&&D(s)||0;t.style==="esriSLSNull"&&(h=0);const l=v(t.width),u=t.miterLimit;if(!e)return new Lt(t.materialKey,e,l,a,o,u,h,0,0,!1,r,!0,!1,i,!1,l,0,null,q,X);const{rect:c,width:d,height:f}=e,m=c.x+V,_=c.y+V,p=m+d,y=_+f,g=M(m,_),x=M(p,y);return new Lt(t.materialKey,e,l,a,o,u,h,g,x,!0,r,!0,!1,i,!1,l,0,null,q,X)}static fromPictureLineSymbol(t,e,i,s){return Ct.getLogger("esri.views.2d.engine.webgl.WGLLineTemplate").error("PictureLineSymbol support does not exist!"),null}};const jn=100,Xi=1,Ks=n=>class extends n{constructor(...t){super(...t),this.forceLibtess=!1,this._bitset=0,this._lineTemplate=null,this.geometryType=b.FILL}_maybeAddLineTemplate(t){this._lineTemplate=Ke.fromFillOutline(t)}_write(t,e,i,s){const r=e.geometryType==="esriGeometryPoint",a=H.load(this._materialKey);t.recordStart(e.getDisplayId(),this._materialKey,this.geometryType,r),this._writeGeometry(t,e,a,s,r),ae(a)&&this._lineTemplate!=null&&this._lineTemplate.writeGeometry(t,e,s,r),t.recordEnd()}_writeGeometry(t,e,i,s,r){const a=this._getGeometry(e,s,r);if(a==null)return;const o=[];if(!(a.maxLength>jn)&&!this.forceLibtess&&Gn(o,a))return void(o.length&&this._writeVertices(t,e,a.coords,a.lengths,i,o));const h=Nn(a);this._writeVertices(t,e,h,[h.length/2],i)}_writeVertex(t,e,i,s,r,a){const o=M(Xi*s,Xi*r);if(t.vertexBounds(s,r,0,0),t.vertexWrite(o),t.vertexWrite(e),i.symbologyType===W.DOT_DENSITY)t.vertexWriteF32(1/Math.abs(a.readGeometryArea()));else{t.vertexWrite(this.fillColor);const h=zs(i);h||(t.vertexWrite(this.tl),t.vertexWrite(this.br)),t.vertexWrite(this.aux21),t.vertexWrite(this.aux22),t.vertexWrite(this.aux3),h||t.vertexWrite(this._minMaxZoom)}}_writeVertices(t,e,i,s,r,a){const o=e.getDisplayId(),h=this._bitset<<24|o,l=s.reduce((f,m)=>f+m),u=$e(r.geometryType,r.symbologyType).geometry/4,c=t.vertexCount();t.vertexEnsureSize(u*l);let d=0;if(a)for(const f of a){const m=i[2*f],_=i[2*f+1];this._writeVertex(t,h,r,m,_,e),d++}else for(let f=0;f0,o=e.readLegacyFeature(),h=e.getObjectId(),l=this._materialCache,u=this._cimLayer.materialHash;if(!u)return Yi.error("A Dynamic mesh template must have a material hash value or function!"),null;const c=typeof u=="function"?u(o,i,s,h):u,d=l.get(c);if(d!=null)return d;const f=this._ongoingMaterialRequestMap.get(c);if(f)return f;const m=this._cimLayer,_=wr(m.cim,this._cimLayer.materialOverrides);_.mosaicHash=c;const{type:p,url:y}=m,g={cim:_,type:p,mosaicHash:c,url:y,size:null,dashTemplate:null,text:null,fontName:null,objectId:h,animatedSymbolProperties:null};switch(p){case"marker":g.size=Ut(m.size,o,i,s),g.animatedSymbolProperties=Ut(m.animatedSymbolProperties,o,i,s);break;case"line":g.dashTemplate=m.dashTemplate;break;case"text":g.text=Ut(m.text,o,i,s),g.fontName=Ut(m.fontName,o,i,s)}const x=t.getMosaicItem(g,r).then(w=>(a||(this._ongoingMaterialRequestMap.delete(c),l.set(c,w)),w)).catch(w=>(this._ongoingMaterialRequestMap.delete(c),Yi.error(".analyze()",w.message),null));return a||this._ongoingMaterialRequestMap.set(c,x),x}};function O(n,t){if(n&&"name"in n){const e=n;return t&&t.error(new ut(e.name,e.message,e.details)),!1}return!0}let Qn=class Gs extends Ks(ve){constructor(t,e,i){var u;if(super(t),this._minMaxZoom=M(Math.round(e*A),Math.round(i*A)),T(t.color)){const c=(d,f,m)=>{const _=t.color(d,f,m);return _&&P(_)||0};this._dynamicPropertyMap.set("fillColor",c)}else{const c=t.color;this.fillColor=c&&P(c)||0}const s=((u=t.cim.placement)==null?void 0:u.type)==="CIMMarkerPlacementInsidePolygon"&&t.cim.placement.shiftOddRows?2:1,r=t.height;if(T(r)){const c=(d,f,m)=>r(d,f,m)*s;this._dynamicPropertyMap.set("_height",c)}else this._height=(r||0)*s;const a=t.offsetX;if(T(a)){const c=(d,f,m)=>v(a(d,f,m));this._dynamicPropertyMap.set("_offsetX",c)}else this._offsetX=v(a||0);const o=t.offsetY;if(T(o)){const c=(d,f,m)=>v(-o(d,f,m));this._dynamicPropertyMap.set("_offsetY",c)}else this._offsetY=v(-o||0);const h=t.scaleX;T(h)?this._dynamicPropertyMap.set("_scaleX",h):this._scaleX=h||1;const l=t.angle;if(T(l)){const c=(d,f,m)=>Ce(l(d,f,m));this._dynamicPropertyMap.set("_angle",c)}else this._angle=Ce(l)||0;if(t.effects!=null){const c=t.effects;T(c)?this._dynamicPropertyMap.set("_effects",c):this._effects=c}this._cimFillLayer=t,this._bitset=(t.colorLocked?ot:0)|(t.applyRandomOffset?Ms:0)|(t.sampleAlphaOnly?de:0)|(t.hasUnresolvedReplacementColor?ws:0),this._fillMaterialKey=t.materialKey}static fromCIMFill(t,e){const[i,s]=dt(t.scaleInfo,e);return new Gs(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature();this._dynamicPropertyMap.forEach((u,c)=>{this[c]=u(s,e,i)});const r=H.load(this._fillMaterialKey),a=this._materialCache,o=(0,this._cimFillLayer.materialHash)(s,e,i),h=a.get(o);let l=null;if(h&&O(h.spriteMosaicItem)&&(l=h.spriteMosaicItem),l){const{rect:u,width:c,height:d}=l,f=u.x+V,m=u.y+V,_=f+c,p=m+d;let y=v(this._height);y<=0&&(y=p-m),yT(t.width)?.5*v(t.width(c,d,f)):s;this._dynamicPropertyMap.set("_halfWidth",r),T(t.cap)?this._dynamicPropertyMap.set("_capType",t.cap):this._capType=t.cap,T(t.join)?this._dynamicPropertyMap.set("_joinType",t.join):this._joinType=t.join;const a=t.color;if(T(a)){const c=(d,f,m)=>P(a(d,f,m));this._dynamicPropertyMap.set("_fillColor",c)}else this._fillColor=a&&P(a)||0;const o=t.miterLimit;if(T(o)){const c=(d,f,m)=>Ve(o(d,f,m));this._dynamicPropertyMap.set("_miterLimitCosine",c)}else this._miterLimitCosine=Ve(o);if(t.effects!=null){const c=t.effects;T(c)?this._dynamicPropertyMap.set("_effects",c):this._effects=c}this._scaleFactor=t.scaleFactor||1,this._isDashed=t.dashTemplate!=null;const h=t.colorLocked?ot:0,l=t.scaleDash?vs:0,u=t.sampleAlphaOnly?de:0;this.tessellationProperties._bitset=h|l|u,this._materialKey=t.materialKey,this._initializeTessellator(!0)}static fromCIMLine(t,e){const[i,s]=dt(t.scaleInfo,e);return new Ns(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature();this._dynamicPropertyMap.forEach((u,c)=>{this[c]=u(s,e,i)}),this._halfWidth*=this._scaleFactor;const r=this._materialCache,a=(0,this._cimLineLayer.materialHash)(s,e,i),o=r.get(a);let h=null;if(o&&O(o.spriteMosaicItem)&&(h=o.spriteMosaicItem),h){this._hasPattern=!0;const{rect:u,width:c,height:d}=h,f=u.x+V,m=u.y+V,_=f+c,p=m+d;this.tessellationProperties._tl=M(f,m),this.tessellationProperties._br=M(_,p)}else this._hasPattern=!1,this.tessellationProperties._tl=0,this.tessellationProperties._br=0;this.tessellationProperties._fillColor=this._fillColor,this.tessellationProperties._halfWidth=this._halfWidth,this.tessellationProperties.offset=0,this.tessellationProperties._halfReferenceWidth=this.tessellationProperties._halfWidth;const l=ht.load(this._materialKey);h&&(l.sdf=h.sdf,l.pattern=!0,l.textureBinding=h.textureBinding),this._materialKey=l.data}};const ta=$t(),ea=tt();let ia=class Zs extends As(ve){constructor(t,e,i){super(t),this._cimMarkerLayer=t,this._minMaxZoom=M(Math.round(e*A),Math.round(i*A));const s=t.color;if(T(s)){const d=(f,m,_)=>P(s(f,m,_));this._dynamicPropertyMap.set("_fillColor",d)}else this._fillColor=P(s);const r=t.outlineColor;if(T(r)){const d=(f,m,_)=>P(r(f,m,_));this._dynamicPropertyMap.set("_outlineColor",d)}else this._outlineColor=P(r);const a=t.size;if(T(a)){const d=(f,m,_)=>v(a(f,m,_));this._dynamicPropertyMap.set("_size",d)}else this._size=v(a)||0;const o=t.scaleX;T(o)?this._dynamicPropertyMap.set("_scaleX",o):this._scaleX=o;const h=t.offsetX;if(T(h)){const d=(f,m,_)=>v(h(f,m,_));this._dynamicPropertyMap.set("xOffset",d)}else this.xOffset=v(h)||0;const l=t.offsetY;if(T(l)){const d=(f,m,_)=>v(l(f,m,_));this._dynamicPropertyMap.set("yOffset",d)}else this.yOffset=v(l)||0;const u=t.outlineWidth;if(T(u)){const d=(f,m,_)=>v(u(f,m,_));this._dynamicPropertyMap.set("_outlineWidth",d)}else this._outlineWidth=v(u)||0;const c=t.rotation;if(T(c)?this._dynamicPropertyMap.set("_angle",c):this._angle=c||0,t.effects!=null){const d=t.effects;T(d)?this._dynamicPropertyMap.set("_effects",d):this._effects=d}if(t.markerPlacement!=null){const d=t.markerPlacement;T(d)?this._dynamicPropertyMap.set("_markerPlacement",d):this._markerPlacement=d}this._scaleFactor=t.scaleFactor??1,this._bitSet=(t.alignment===N.MAP?ps:ys)|(t.colorLocked?ot:0)|(t.scaleSymbolsProportionally?gs:0),this._materialKey=t.materialKey}static fromCIMMarker(t,e){const[i,s]=dt(t.scaleInfo,e);return new Zs(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature(),r=t.getObjectId();this._dynamicPropertyMap.forEach((j,xt)=>{this[xt]=j(s,e,i)});const a=this._cimMarkerLayer.materialHash,o=typeof a=="function"?a(s,e,i,r):a,h=this._materialCache.get(o);if(!h||!O(h.spriteMosaicItem)||!h.spriteMosaicItem)return void Ct.getLogger("esri.views.2d.engine.webgl.WGLDynamicMarkerTemplate").error(new ut("mapview-cim","Encountered an error when binding feature"));const l=h.spriteMosaicItem,u=this._cimMarkerLayer.sizeRatio,c=l.width/l.height*this._scaleX,d=gt.load(this._materialKey);d.sdf=l.sdf,d.pattern=!0,d.textureBinding=l.textureBinding,this._materialKey=d.data;const f=this._cimMarkerLayer.rotateClockwise?this._angle:-this._angle,m=this._size,_=m*c,p=this.xOffset,y=this.yOffset;this.xOffset*=this._scaleFactor,this.yOffset*=this._scaleFactor;const g=this._cimMarkerLayer.scaleSymbolsProportionally&&this._cimMarkerLayer.frameHeight?this._size/v(this._cimMarkerLayer.frameHeight):1,x=this._outlineWidth*g,w=v(this._cimMarkerLayer.referenceSize);let S=0,L=0;const I=this._cimMarkerLayer.anchorPoint;I&&(this._cimMarkerLayer.isAbsoluteAnchorPoint?this._size&&(S=v(I.x)/(this._size*c),L=v(I.y)/this._size):(S=I.x,L=I.y)),this._anchorX=S,this._anchorY=L,this._sizeOutlineWidth=$(Math.round(Math.min(Math.sqrt(128*_),255)),Math.round(Math.min(Math.sqrt(128*m),255)),Math.round(Math.min(Math.sqrt(128*x),255)),Math.round(Math.min(Math.sqrt(128*w),255))),this.angle=f;const z=Math.round(64*u);this._bitestAndDistRatio=M(this._bitSet,z),this._computeSize(_,m,u,x,this._scaleFactor,l,d.hasSizeVV(),!0),this._applyTransformation(ea,ta),this.xOffset=p,this.yOffset=y}};function ti(n){if(n==null)return[];const t=new Array(n.length);for(let e=0;eP(r(p,y,g));this._dynamicPropertyMap.set("_color",_)}else this._color=P(r);const a=t.outlineColor;if(T(a)){const _=(p,y,g)=>P(a(p,y,g));this._dynamicPropertyMap.set("_haloColor",_)}else this._haloColor=P(a);let o;T(t.size)||(o=Math.min(Math.round(v(t.size*t.sizeRatio)),127));const h=(_,p,y)=>T(t.size)?Math.min(Math.round(v(t.size(_,p,y)*t.sizeRatio)),127):o;if(this._dynamicPropertyMap.set("_size",h),T(t.outlineSize)){const _=(p,y,g)=>Math.min(Math.floor(Hi*v(t.outlineSize(p,y,g)*t.sizeRatio)),127);this._dynamicPropertyMap.set("_haloSize",_)}else this._haloSize=Math.min(Math.floor(Hi*v(t.outlineSize*t.sizeRatio)),127);let l;T(t.offsetX)||(l=Math.round(v(t.offsetX*t.sizeRatio)));const u=(_,p,y)=>T(t.offsetX)?Math.round(v(t.offsetX(_,p,y)*t.sizeRatio)):l;let c;this._dynamicPropertyMap.set("_xOffset",u),T(t.offsetY)||(c=Math.round(v(t.offsetY*t.sizeRatio)));const d=(_,p,y)=>T(t.offsetY)?Math.round(v(t.offsetY(_,p,y)*t.sizeRatio)):c;if(this._dynamicPropertyMap.set("_yOffset",d),T(t.angle)?this._dynamicPropertyMap.set("_angle",t.angle):this._angle=t.angle,T(t.horizontalAlignment)?this._dynamicPropertyMap.set("_horizontalAlignment",t.horizontalAlignment):this._horizontalAlignment=t.horizontalAlignment,T(t.verticalAlignment)?this._dynamicPropertyMap.set("_verticalAlignment",t.verticalAlignment):this._verticalAlignment=t.verticalAlignment,t.effects!=null){const _=t.effects;T(_)?this._dynamicPropertyMap.set("_effects",_):this._effects=_}if(t.markerPlacement!=null){const _=t.markerPlacement;T(_)?this._dynamicPropertyMap.set("_markerPlacement",_):this._textPlacement=_}T(t.text)?this._dynamicPropertyMap.set("_text",t.text):this._text=t.text,this._backgroundColor=t.backgroundColor&&P(t.backgroundColor),this._borderLineColor=t.borderLineColor&&P(t.borderLineColor),this._borderLineSize=t.borderLineWidth,this._scaleFactor=s;const f=Math.min(Math.round(v(t.referenceSize*t.sizeRatio)),127);this._referenceSize=Math.round(Math.sqrt(256*f)),this._materialKey=t.materialKey;const m=Ft.load(this._materialKey);m.sdf=!0,this._bitset=(t.alignment===N.MAP?1:0)|(t.colorLocked?1:0)<<1,this._materialKey=m.data,this._decoration="none",this._lineHeight=1,this._lineWidth=512,this._isCIM=!0}static fromCIMText(t,e){const[i,s]=dt(t.scaleInfo,e);return new Us(t,i,s)}async analyze(t,e,i,s){const r=e.readLegacyFeature(),a=sa(this._cimTextLayer,r,i,s),o=await super.analyze(t,e,i,s,ti(a));return o&&o.glyphMosaicItems&&this._textToGlyphs.set(a,o.glyphMosaicItems),o}bindFeature(t,e,i){const s=t.readLegacyFeature();if(this._dynamicPropertyMap.forEach((a,o)=>{this[o]=a(s,e,i)}),!this._text||this._text.length===0)return void(this._shapingInfo=null);this._size*=this._scaleFactor,this._scale=this._size/ms,this._xOffset*=this._scaleFactor,this._yOffset*=this._scaleFactor,this._xAlignD=us(this._horizontalAlignment??"center"),this._yAlignD=ds(this._verticalAlignment??"baseline");const r=this._textToGlyphs.get(this._text)??[];this.bindTextInfo(r,!1)}};class J extends Ks(Nt){constructor(t,e,i,s,r,a,o,h,l,u,c,d,f,m,_,p){super(),this._effects=m||void 0;const y=H.load(t);e&&(y.sdf=e.sdf,y.pattern=!0,y.textureBinding=e.textureBinding),this.fillColor=i,this.tl=s,this.br=r,this.aux21=M(a,o),this.aux22=M(h,l),this.aux3=$(u,c,d,0),this._bitset=f,this._minMaxZoom=M(Math.round(_*A),Math.round(p*A)),this._materialKey=y.data}static fromCIMFill(t,e,i){const s=t.color,r=s&&P(s)||0,a=t.materialKey,[o,h]=dt(t.scaleInfo,i);let l=(t.colorLocked?ot:0)|(t.applyRandomOffset?Ms:0)|(t.sampleAlphaOnly?de:0)|(t.hasUnresolvedReplacementColor?ws:0);if(!e)return new J(a,null,r,0,0,0,0,0,0,0,0,0,l,t.effects,o,h);const{rect:u,width:c,height:d}=e,f=t.scaleX||1,m=u.x+V,_=u.y+V,p=m+c,y=_+d,g=v(t.height);let x=f*g;t.cim.type==="CIMHatchFill"&&(x*=c/d);let w=g;w<=0&&(w=y-_),w{const i=new br(e,t);return new ha(await i.analyzeSymbolReference(n.data,!1),n.data,n.rendererKey,n.maxVVSize)};async function Y(n,t,e,i){if(!n)return null;if(n.type==="cim")return ji(n,t,e);if(n.type==="web-style"){const s={type:"cim",data:await ca(n,null,i)??void 0,rendererKey:n.rendererKey,maxVVSize:n.maxVVSize};return ji(s,t,e)}return n}function ee(n){if(!n)return null;const{avoidSDFRasterization:t,type:e,cim:i,url:s,materialHash:r,maxVVSize:a}=n,o={cim:i,type:e,mosaicHash:r,url:s,size:null,dashTemplate:null,path:null,text:null,fontName:null,animatedSymbolProperties:null,avoidSDFRasterization:t};switch(e){case"marker":a&&"size"in i&&(i.size=Math.max(a,i.size)),o.size=n.size,o.path=n.path,o.animatedSymbolProperties=n.animatedSymbolProperties;break;case"line":o.dashTemplate=n.dashTemplate;break;case"text":o.text=n.text,o.fontName=n.fontName}return o}const F=Ct.getLogger("esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore"),Qi={sortKey:null,templates:new Array},ei={isOutline:!1,placement:null,symbologyType:W.DEFAULT,vvFlags:0},fa={...li,hash:JSON.stringify(li),materialKey:ye(b.MARKER,ei)},_a={...ci,hash:JSON.stringify(ci),materialKey:ye(b.LINE,ei)},ma={...ui,hash:JSON.stringify(ui),materialKey:ye(b.FILL,ei)};function Q(n,t){const e=n.length;return n.push(null),t.then(i=>n[e]=i),n}function Rt(n){return n!=null&&!!(1&n)}function pa(n){return n.name==="worker:port-closed"}class ya{constructor(t,e){this._idCounter=1,this._templateIdCounter=1,this._idToTemplateGroup=new Map,this._symbolToTemplate=new Map,this._fetchQueue=[],this._idToResolver=new Map,this._cimTemplateCache=new Map,this._cimAnalyses=[],this._lock=new na,this._fetchResource=t,this._tileInfo=e}get _markerError(){return this._errorTemplates.marker[0]}get _fillError(){return this._errorTemplates.fill[0]}get _lineError(){return this._errorTemplates.line[0]}get _textError(){return this._errorTemplates.line[0]}createTemplateGroup(t,e,i=null){this._initErrorTemplates();const s=t.hash,r=this._symbolToTemplate.get(s);if(r!=null)return r;const a=new Array,o={sortKey:i,templates:a};e&&this._createMeshTemplates(a,e,!0),this._createMeshTemplates(a,t,!1);const h=this._createGroupId(t.type==="expanded-cim"&&ga(t));return this._idToTemplateGroup.set(h,o),this._symbolToTemplate.set(s,h),h}getTemplateGroup(t){return this._idToTemplateGroup.get(t)??Qi}getDynamicTemplateGroup(t){return this._idToTemplateGroup.has(t)?(Rt(t)||F.error("mapview-template-store",`Id ${t} does not refer to a dynamic template`),this._idToTemplateGroup.get(t)):Qi}getMosaicItem(t,e){const i=this._createTemplateId(),s=new Promise(r=>this._idToResolver.set(i,r));return this._fetchQueue.push({symbol:t,id:i,glyphIds:e}),s}finalize(t){return this._fetchQueue.length||this._lock.isHeld()?aa(this._lock,this._fetchAllQueuedResources.bind(this),t):Promise.resolve()}_initErrorTemplates(){this._errorTemplates||(this._errorTemplates={fill:this._createMeshTemplates([],ma,!1),marker:this._createMeshTemplates([],fa,!1),line:this._createMeshTemplates([],_a,!1)})}_fetchAllQueuedResources(t){if(!this._fetchQueue.length)return Promise.resolve();const e=this._fetchQueue,i=this._cimAnalyses;return this._fetchQueue=[],this._cimAnalyses=[],Promise.all(i).then(()=>this._fetchResource(e,t).then(s=>{for(const{id:r,mosaicItem:a}of s)this._idToResolver.get(r)(a),this._idToResolver.delete(r)})).catch(s=>{Xe(s)?this._fetchQueue=this._fetchQueue.concat(e):pa(s)||F.error(new ut("mapview-template-store","Unable to fetch requested texture resources",s))})}_createGroupId(t){return this._idCounter++<<1|(t?1:0)}_createTemplateId(){return this._templateIdCounter++}async _createSMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return O(e,F)?Wt.fromSimpleMarker(t,e):this._markerError}async _createPMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return O(e,F)?Wt.fromPictureMarker(t,e):this._markerError}async _createSFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return O(i,F)?J.fromSimpleFill(t,i,e):this._fillError}async _createPFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return O(i,F)?J.fromPictureFill(t,i,e):this._fillError}async _createSLS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return O(i,F)?Ke.fromSimpleLine(t,i):this._lineError}async _createLMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return O(e,F)?Wt.fromLineSymbolMarker(t,e):this._markerError}async _createTS(t){const{glyphMosaicItems:e}=await this.getMosaicItem(t);return Ae.fromText(t,e??[])}async _createCIMText(t){const{glyphMosaicItems:e}=await this.getMosaicItem(ee(t),ti(t.text));return O(e,F)?Ae.fromCIMText(t,e,this._tileInfo):this._textError}async _createCIMFill(t){const{spriteMosaicItem:e}=await this.getMosaicItem(ee(t));return O(e,F)?J.fromCIMFill(t,e,this._tileInfo):this._fillError}async _createCIMLine(t){const{spriteMosaicItem:e}=await this.getMosaicItem(ee(t));return O(e,F)?Ke.fromCIMLine(t,e,this._tileInfo):this._lineError}async _createCIMMarker(t){const{spriteMosaicItem:e}=await this.getMosaicItem(ee(t));return O(e,F)?Wt.fromCIMMarker(t,e,this._tileInfo):this._markerError}async _createCIM(t){const e=t.templateHash;let i=this._cimTemplateCache.get(e);if(i!=null)return i;switch(t.type){case"marker":i=await this._createCIMMarker(t);break;case"line":i=await this._createCIMLine(t);break;case"fill":i=await this._createCIMFill(t);break;case"text":i=await this._createCIMText(t)}return this._cimTemplateCache.set(e,i),i}async _createDynamicCIM(t){const e=t.templateHash;let i=this._cimTemplateCache.get(e);if(i!=null)return i;switch(t.type){case"marker":i=ia.fromCIMMarker(t,this._tileInfo);break;case"line":i=Jn.fromCIMLine(t,this._tileInfo);break;case"fill":i=Qn.fromCIMFill(t,this._tileInfo);break;case"text":i=ra.fromCIMText(t,this._tileInfo)}return this._cimTemplateCache.set(e,i),i}_createPrimitiveMeshTemplates(t,e,i){switch(e.type){case"esriSMS":return Q(t,this._createSMS(e));case"esriPMS":return Q(t,this._createPMS(e));case"esriSFS":return Q(t,this._createSFS(e,i));case"line-marker":return Q(t,this._createLMS(e));case"esriPFS":return Q(t,this._createPFS(e,i));case"esriSLS":return Q(t,this._createSLS(e,!1));case"esriTS":return Q(t,this._createTS(e));default:return F.error("Unable to create mesh template for unknown symbol type {: $ }{symbol.type}"),t}}_createMeshTemplates(t,e,i){if(e.type.includes("3d"))return F.error("3D symbols are not supported with MapView"),t;if(e.type==="expanded-cim"){for(const s of e.layers)typeof s.materialHash=="function"?Q(t,this._createDynamicCIM(s)):Q(t,this._createCIM(s));return t}if(e.type==="composite-symbol"){for(const s of e.layers)this._createPrimitiveMeshTemplates(t,s,i);return t}return e.type==="cim"||e.type==="label"||e.type==="web-style"?t:this._createPrimitiveMeshTemplates(t,e,i)}}const ga=n=>{if(!n.layers)return!1;for(const t of n.layers)if(typeof t.materialHash=="function")return!0;return!1};class xa{constructor(t,e,i){this._loadPromise=Br(),this._geometryType=t,this._idField=e,this._templateStore=i}update(t,e){t.mesh.labels!=null&&(this._labelTemplates=this._createLabelTemplates(t.mesh.labels,e)),this._schema=t}_createLabelTemplates(t,e){const i=new Map;if(t.type==="simple"){for(const s of t.classes){const r=Gi.fromLabelClass(s,e);i.set(s.index,r)}return i}for(const s in t.classes){const r=t.classes[s];for(const a of r){const o=Gi.fromLabelClass(a,e);i.set(a.index,o)}}return i}get templates(){return this._templateStore}async analyze(t,e,i,s,r,a,o){if(oi(o))return;let h;(i==null?void 0:i.type)==="dictionary"&&(h=await i.analyze(this._idField,t.copy(),e,r,a,o));let l=0;for(;t.next();){let u=null;if(u=h?h[l++]:s!=null&&_s(t.getDisplayId())&&t.readAttribute("cluster_count")!==1?s.match(this._idField,t,this._geometryType,r,a):i.match(this._idField,t,this._geometryType,r,a),t.setGroupId(u),Rt(u)){const c=this._templateStore.getDynamicTemplateGroup(u).templates;for(const d of c)d&&d.analyze&&d.analyze(this._templateStore,t,r,a)}}return await this._loadPromise,this._templateStore.finalize(o)}async analyzeGraphics(t,e,i,s,r,a){if(oi(a))return;const o=t.getCursor();for(i&&await i.analyze(this._idField,o.copy(),e,s,r,a);o.next();){let h=o.getGroupId();if(h!=null&&h!==-1||(h=i==null?void 0:i.match(this._idField,o,o.geometryType,s,r),o.setGroupId(h)),Rt(h)){const l=this._templateStore.getDynamicTemplateGroup(h).templates;for(const u of l)u&&u.analyze&&u.analyze(this._templateStore,o,s,r)}o.setGroupId(h)}return await this._loadPromise,this._templateStore.finalize(a)}writeGraphic(t,e,i,s){const r=e.getGroupId(),a=e.getDisplayId(),o=this._templateStore.getTemplateGroup(r);if(t.featureStart(e.insertAfter,0),a!=null){if(Rt(r))for(const h of o.templates)h&&h.bindFeature(e,null,null);if(o){for(const h of o.templates)h&&h.write(t,e,i,s);t.featureEnd()}}}writeCursor(t,e,i,s,r,a,o){const h=e.getGroupId(),l=e.getDisplayId(),u=this._templateStore.getTemplateGroup(h),c=u.templates,d=this._getSortKeyValue(e,u);if(t.featureStart(0,d),l!=null&&c){if(Rt(h))for(const f of c)f.bindFeature(e,i,s);for(const f of c)f.write(t,e,r,o);if(a!=null&&t.hasRecords){const f=a&&this._findLabelRef(c);this._writeLabels(t,e,a,f,r,o)}t.featureEnd()}}_getSortKeyValue(t,e){const i=this._schema.mesh.sortKey;if(i==null)return 0;let s=0;return s=i.byRenderer===!0&&e.sortKey!=null?e.sortKey:i.fieldIndex!=null?t.getComputedNumericAtIndex(i.fieldIndex):i.field!=null?t.readAttribute(i.field):t.readAttribute(this._idField),s*=i.order==="asc"?1:-1,s==null||isNaN(s)?0:s}_findLabelRef(t){for(const e of t)if(e instanceof Wt)return e;return null}_writeLabels(t,e,i,s,r,a){for(const o of i)if(o!=null&&o){const{glyphs:h,rtl:l,index:u}=o,c=this._labelTemplates.get(u);if(!c)continue;c.setZoomLevel(r),c.bindReferenceTemplate(s),c.bindTextInfo(h,l),c.write(t,e,null,a)}}}const Ge=Ct.getLogger("esri/views/2d/engine/webgl/util/Matcher");async function Ne(n,t,e,i){switch(n.type){case"simple":case"heatmap":return ct.fromBasicRenderer(n,t,e,i);case"map":return si.fromUVRenderer(n,t,e,i);case"interval":return ii.fromCBRenderer(n,t,e,i);case"dictionary":return ri.fromDictionaryRenderer(n,t,e,i);case"pie-chart":return le.fromPieChartRenderer(n,t,e,i);case"subtype":return le.fromSubtypes(n,t,e,i)}}class ct{constructor(){this.type="feature",this._defaultResult=null}static async fromBasicRenderer(t,e,i,s){const r=new ct;if(t.symbol){const a=await Y(t.symbol,i,s),o=e.createTemplateGroup(a,null);r.setDefault(o)}return r}static async fromPieChartRenderer(t,e,i,s){const r=new ct;if(t.markerSymbol){const a=await Y(t.markerSymbol,i,s);let o;t.fillSymbol&&(o=await Y(t.fillSymbol,i,s));const h=e.createTemplateGroup(a,o);r.setDefault(h)}return r}size(){return 1}getDefault(){return this._defaultResult}setDefault(t){this._defaultResult=t}match(t,e,i,s,r){return this.getDefault()}async analyze(t,e,i,s,r,a){return null}}class le extends ct{constructor(t,e){super(),this._subMatchers=t,this._subtypeField=e}static async fromSubtypes(t,e,i,s){const r=new Map,a=[];for(const o in t.renderers){const h=parseInt(o,10),l=Ne(t.renderers[o],e,i,s).then(u=>r.set(h,u));a.push(l)}return await Promise.all(a),new le(r,t.subtypeField)}match(t,e,i,s,r){const a=e.readAttribute(this._subtypeField),o=this._subMatchers.get(a);return o?o.match(t,e,i,s,r):null}}class ii extends ct{constructor(t,e,i,s){super(),this.type="interval",this._intervals=[],this._isMaxInclusive=e,this._fieldIndex=s,this._field=t,this._normalizationInfo=i}static async fromCBRenderer(t,e,i,s){const{isMaxInclusive:r,normalizationField:a,normalizationTotal:o,normalizationType:h}=t,l=t.field,u=new ii(l,r,{normalizationField:a,normalizationTotal:o,normalizationType:h},t.fieldIndex),c=await Y(t.backgroundFillSymbol,i,s);await Promise.all(t.intervals.map(async f=>{const m=await Y(f.symbol,i,s),_=await e.createTemplateGroup(m,c),p={min:f.min,max:f.max};u.add(p,_)}));const d=await Y(t.defaultSymbol,i,s);if(d){const f=await e.createTemplateGroup(d,c);u.setDefault(f)}return u}add(t,e){this._intervals.push({interval:t,result:e}),this._intervals.sort((i,s)=>i.interval.min-s.interval.min)}size(){return super.size()+this._intervals.length}match(t,e,i,s,r){if(this._fieldIndex==null&&!this._field)return this.getDefault();const a=this._fieldIndex!=null?e.getComputedNumericAtIndex(this._fieldIndex):this._getValueFromField(e);if(a==null||isNaN(a)||a===1/0||a===-1/0)return this.getDefault();for(let o=0;o=h.min,c=this._isMaxInclusive?a<=h.max:a{const d=await Y(u.symbol,i,s),f=c+1,m=await e.createTemplateGroup(d,o,f);u.value===""?h.setNullResult(m):h.add(u.value,m)}));const l=await Y(t.defaultSymbol,i,s);if(l){const u=Number.MAX_SAFE_INTEGER,c=await e.createTemplateGroup(l,o,u);h.setDefault(c)}return h}setNullResult(t){this._nullResult=t}add(t,e){this._resultsMap.set(t.toString(),e)}size(){return super.size()+this._resultsMap.size}match(t,e,i,s,r){if(this._fieldsIndex==null&&!this._fields)return this.getDefault();const a=this._fieldsIndex!=null?e.getComputedStringAtIndex(this._fieldsIndex):this._getValueFromFields(e);if(this._nullResult!==null&&(a==null||a===""||a===""))return this._nullResult;if(a==null)return this.getDefault();const o=a.toString();return this._resultsMap.has(o)?this._resultsMap.get(o):this.getDefault()}_getValueFromFields(t){const e=[];for(const i of this._fields){const s=t.readAttribute(i);s==null||s===""?e.push(""):e.push(s)}return e.join(this._seperator)}}async function va(n,t){const e=n||1;if(typeof e=="number")return(s,r,a)=>e;const i=await ur(e,t.spatialReference,t.fields);return(s,r,a)=>dr(i,s,{$view:a},t.geometryType,r)||1}let Te;async function Ma(){return Te||(Te=ls(()=>import("./createSymbolSchema-16296a2b.js"),["assets/createSymbolSchema-16296a2b.js","assets/TileInfoView-346e56d0.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/cimAnalyzer-01879161.js","assets/TileClipper-ae6eca9e.js","assets/definitions-0bc08d4c.js","assets/number-e491b09e.js","assets/BidiEngine-9a40f2f4.js","assets/diffUtils-590c9088.js","assets/Pipeline-98b9d349.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FieldsIndex-f79a8f26.js","assets/StreamFeatureManager-4b8ac3ac.js","assets/quickselect-e80674f5.js","assets/arcadeTimeUtils-e1438cc8.js","assets/centroid-8e8cfa47.js","assets/ogcFeatureUtils-1ccf1f8d.js","assets/geojson-077f67ec.js","assets/clientSideDefaults-ab04bd90.js","assets/defaultsJSON-59981e75.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/Query-1c961d4c.js","assets/createConnection-4b117798.js","assets/geohashUtils-77d8429b.js","assets/tileUtils-48cbbab9.js","assets/TurboLine-aac2edf4.js","assets/Rect-98da58d6.js","assets/GeometryUtils-0258f920.js"])),Te}class ri extends ct{constructor(t,e,i,s,r,a){super(),this.type="dictionary",this._groupIdCache=new lr(100),this._loader=t,this._fieldMap=t.fieldMap,this._symbolFields=t.getSymbolFields(),this._templates=e,this._info=i,this._scaleFn=s,this._schemaUtilsModule=r,this._symbolOptions=a}static async fromDictionaryRenderer(t,e,i,s){const[{DictionaryLoader:r},a]=await Promise.all([ls(()=>import("./DictionaryLoader-c0729336.js"),["assets/DictionaryLoader-c0729336.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/FieldsIndex-f79a8f26.js"]),Ma()]),o=new r(t.url,t.config,t.fieldMap);await o.fetchResources({spatialReference:i.spatialReference,fields:i.fields});const h=await va(t.scaleExpression,i);return new ri(o,e,i,h,a,t.symbolOptions)}async _analyzeFeature(t,e,i,s,r){const a=t.readLegacyFeature(),o=this._scaleFn(a,i,s),h=this._attributeHash(a)+"-"+o,l=this._groupIdCache.get(h);if(l)return l;const u={...s,spatialReference:this._info.spatialReference,abortOptions:r,fields:this._info.fields},c=await this._loader.getSymbolAsync(a,u),d=this._schemaUtilsModule.createSymbolSchema(c,this._symbolOptions),f=Y(d,this._info,e,r).then(m=>{if((m==null?void 0:m.type)!=="expanded-cim")return Ge.error(new ut("mapview-bad-type",`Found unexpected type ${m==null?void 0:m.type} in dictionary response`)),null;m.hash+="-"+o;for(const _ of m.layers)_.scaleFactor=o,_.templateHash+="-"+o;return this._templates.createTemplateGroup(m,null)});return this._groupIdCache.put(h,f,1),f}async analyze(t,e,i,s,r,a){const o=e.getCursor(),h=[];for(;o.next();)h.push(this._analyzeFeature(o,i,s,r,a));return Promise.all(h).then(l=>l.filter(cr))}match(t,e,i,s,r){return null}_attributeHash(t){var i;let e="";for(const s of this._symbolFields){const r=(i=this._fieldMap)==null?void 0:i[s];r&&(e+=t.attributes[r]+"-")}return e}}class wa{constructor(t){this._remoteClient=t,this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null,this.geometryEnginePromise=null}destroy(){}async fetchResource(t,e){const i=this._resourceMap,s=i.get(t);if(s)return s;let r=this._inFlightResourceMap.get(t);if(r)return r;try{r=this._remoteClient.invoke("tileRenderer.fetchResource",{url:t},{...e}),this._inFlightResourceMap.set(t,r),r.then(a=>(this._inFlightResourceMap.delete(t),i.set(t,a),a))}catch(a){return Xe(a)?null:{width:0,height:0}}return r}getResource(t){return this._resourceMap.get(t)??null}loadFont(t){return Promise.resolve(null)}}function Ji(n,t){return(!n.minScale||n.minScale>=t)&&(!n.maxScale||n.maxScale<=t)}function ts(n){const t=n.message,e={message:{data:{},tileKey:t.tileKey,tileKeyOrigin:t.tileKeyOrigin,version:t.version},transferList:new Array};for(const i in t.data){const s=i,r=t.data[s];if(e.message.data[s]=null,r!=null){const a=r.stride,o=r.indices.slice(0),h=r.vertices.slice(0),l=r.records.slice(0),u={stride:a,indices:o,vertices:h,records:l,metrics:se(r.metrics,c=>c.slice(0))};e.transferList.push(o,h,l),e.message.data[s]=u}}return e}let Ze=class extends Ar{constructor(){super(...arguments),this.type="symbol",this._matchers={feature:null,aggregate:null},this._bufferData=new Map,this._bufferIds=new Map}initialize(){this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this))]),this._resourceManagerProxy=new wa(this.remoteClient)}destroy(){this._resourceManagerProxy.destroy()}get supportsTileUpdates(){return!0}forEachBufferId(n){this._bufferIds.forEach(t=>{t.forEach(n)})}async update(n,t){var s;const e=t.schema.processors[0];if(e.type!=="symbol")return;const i=Sr(this._schema,e);(hi(i,"mesh")||hi(i,"target"))&&(n.mesh=!0,(s=n.why)==null||s.mesh.push("Symbology changed"),this._schema=e,this._factory=this._createFactory(e),this._factory.update(e,this.tileStore.tileScheme.tileInfo))}onTileMessage(n,t,e,i){return Et(i),this._onTileData(n,t,e,i)}onTileClear(n,t){const e={clear:!0,end:t};return this._bufferData.delete(n.key.id),this._bufferIds.delete(n.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:n.id,data:e})}onTileError(n,t,e){const i=e.signal,s={tileKey:n.id,error:t};return this.remoteClient.invoke("tileRenderer.onTileError",s,{signal:i})}onTileUpdate(n){for(const t of n.removed)this._bufferData.has(t.key.id)&&this._bufferData.delete(t.key.id),this._bufferIds.has(t.key.id)&&this._bufferIds.delete(t.key.id);for(const t of n.added)this._bufferData.forEach(e=>{for(const i of e)i.message.tileKey===t.id&&this._updateTileMesh("append",t,ts(i),[],!1,!1,null)})}_addBufferData(n,t){var e;this._bufferData.has(n)||this._bufferData.set(n,[]),(e=this._bufferData.get(n))==null||e.push(ts(t))}_createFactory(n){const{geometryType:t,objectIdField:e,fields:i}=this.service,s=(l,u)=>this.remoteClient.invoke("tileRenderer.getMaterialItems",l,u),r={geometryType:t,fields:i,spatialReference:fr.fromJSON(this.spatialReference)},a=new ya(s,this.tileStore.tileScheme.tileInfo),{matcher:o,aggregateMatcher:h}=n.mesh;return this._store=a,this._matchers.feature=Ne(o,a,r,this._resourceManagerProxy),this._matchers.aggregate=se(h,l=>Ne(l,a,r,this._resourceManagerProxy)),new xa(t,e,a)}async _onTileData(n,t,e,i){var c;Et(i);const{type:s,addOrUpdate:r,remove:a,clear:o,end:h}=t,l=!!this._schema.mesh.sortKey;if(!r){const d={type:s,addOrUpdate:null,remove:a,clear:o,end:h,sort:l};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:n.id,data:d},i)}const u=this._processFeatures(n,r,e,i,(c=t.status)==null?void 0:c.version);try{const d=await u;if(d==null){const m={type:s,addOrUpdate:null,remove:a,clear:o,end:h,sort:l};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:n.id,data:m},i)}const f=[];for(const m of d){let _=!1;const p=m.message.bufferIds,y=n.key.id,g=m.message.tileKey;if(y!==g&&p!=null){if(!this.tileStore.get(g)){this._addBufferData(y,m),f.push(m);continue}let x=this._bufferIds.get(g);x||(x=new Set,this._bufferIds.set(g,x));const w=Array.from(p);for(const S of w){if(x.has(S)){_=!0;break}x.add(S)}}_||(this._addBufferData(y,m),f.push(m))}await Promise.all(f.map(m=>{const _=n.key.id===m.message.tileKey,p=_?t.remove:[],y=_&&t.end;return this._updateTileMesh(s,n,m,p,y,!!t.clear,i.signal)}))}catch(d){this._handleError(n,d,i)}}async _updateTileMesh(n,t,e,i,s,r,a){const o=n,h=e.message.tileKey,l=!!this._schema.mesh.sortKey;h!==t.key.id&&(s=!1);const u={type:o,addOrUpdate:se(e,d=>d.message),remove:i,clear:r,end:s,sort:l},c={transferList:se(e,d=>d.transferList)||[],signal:a};return Et(c),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:h,data:u},c)}async _processFeatures(n,t,e,i,s){if(t==null||!t.hasFeatures)return null;const r={transform:n.transform,hasZ:!1,hasM:!1},a=this._factory,o={viewingMode:"",scale:n.scale},h=await this._matchers.feature,l=await this._matchers.aggregate;Et(i);const u=this._getLabelInfos(n,t);return await a.analyze(t.getCursor(),this._resourceManagerProxy,h,l,r,o),Et(i),this._writeFeatureSet(n,t,r,u,a,e,s)}_writeFeatureSet(n,t,e,i,s,r,a){const o=t.getSize(),h=this._schema.mesh.matcher.symbologyType,l=new tn(n.key.id,{features:o,records:o,metrics:0},h,r,h!==W.HEATMAP,a),u={viewingMode:"",scale:n.scale},c=t.getCursor();for(;c.next();)try{const f=c.getDisplayId(),m=i!=null?i.get(f):null;s.writeCursor(l,c,e,u,n.level,m,this._resourceManagerProxy)}catch{}const d=n.tileInfoView.tileInfo.isWrappable;return l.serialize(d)}_handleError(n,t,e){if(!Xe(t)){const i={tileKey:n.id,error:t.message};return this.remoteClient.invoke("tileRenderer.onTileError",i,{signal:e.signal})}return Promise.resolve()}_getLabelingSchemaForScale(n){const t=this._schema.mesh.labels;if(t==null)return null;if(t.type==="subtype"){const i={type:"subtype",classes:{}};let s=!1;for(const r in t.classes){const a=t.classes[r].filter(o=>Ji(o,n.scale));s=s||!!a.length,i.classes[r]=a}return s?i:null}const e=t.classes.filter(i=>Ji(i,n.scale));return e.length?{type:"simple",classes:e}:null}_getLabels(n,t){if(t.type==="subtype"){const e=this.service.subtypeField,i=_r(e,"Expected to find subtype Field"),s=n.readAttribute(i);return s==null?[]:t.classes[s]??[]}return t.classes}_getLabelInfos(n,t){const e=this._getLabelingSchemaForScale(n);if(e==null)return null;const i=new Map,s=t.getCursor();for(;s.next();){const r=s.getDisplayId(),a=[],o=_s(r),h=o&&s.readAttribute("cluster_count")!==1?"aggregate":"feature",l=this._getLabels(s,e);for(const u of l){if(u.target!==h)continue;const c=s.getStorage(),d=o&&h==="feature"?c.getComputedStringAtIndex(s.readAttribute("referenceId"),u.fieldIndex):c.getComputedStringAtIndex(r,u.fieldIndex);if(!d)continue;const f=ze(d.toString()),m=f[0],_=f[1];this._store.getMosaicItem(u.symbol,ti(m)).then(p=>{a[u.index]={glyphs:p.glyphMosaicItems??[],rtl:_,index:u.index}})}i.set(r,a)}return i}};Ze=R([Ue("esri.views.2d.layers.features.processors.SymbolProcessor")],Ze);const ba=Ze,eo=Object.freeze(Object.defineProperty({__proto__:null,default:ba},Symbol.toStringTag,{value:"Module"}));export{Za as A,eo as S,Is as _,ye as f}; diff --git a/assets/TemporalLayer-f17c9161.js b/assets/TemporalLayer-f17c9161.js new file mode 100644 index 0000000..c1b8546 --- /dev/null +++ b/assets/TemporalLayer-f17c9161.js @@ -0,0 +1 @@ +import{jA as I,cz as T,jB as h,ai as t,d2 as U,aj as l,al as p,ck as w,cR as d,ay as m,bY as c,eY as E,hj as j}from"./index-080e108a.js";const x=I()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0});let r=class extends T(w){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return h(this.value,this.unit,"milliseconds")}};t([U(x,{nonNullable:!0})],r.prototype,"unit",void 0),t([l({type:Number,json:{write:!0},nonNullable:!0})],r.prototype,"value",void 0),r=t([p("esri.TimeInterval")],r);const o=r;function f(i,e){return o.fromJSON({value:i,unit:e})}let n=class extends T(w){constructor(i){super(i),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeReference=null,this.trackIdField=null,this.useTime=!0}readFullTimeExtent(i,e){if(!e.timeExtent||!Array.isArray(e.timeExtent)||e.timeExtent.length!==2)return null;const s=new Date(e.timeExtent[0]),a=new Date(e.timeExtent[1]);return new d({start:s,end:a})}writeFullTimeExtent(i,e){i&&i.start!=null&&i.end!=null?e.timeExtent=[i.start.getTime(),i.end.getTime()]:e.timeExtent=null}readInterval(i,e){return e.timeInterval&&e.timeIntervalUnits?f(e.timeInterval,e.timeIntervalUnits):e.defaultTimeInterval&&e.defaultTimeIntervalUnits?f(e.defaultTimeInterval,e.defaultTimeIntervalUnits):null}writeInterval(i,e){e.timeInterval=(i==null?void 0:i.toJSON().value)??null,e.timeIntervalUnits=(i==null?void 0:i.toJSON().unit)??null}};t([l({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],n.prototype,"cumulative",void 0),t([l({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],n.prototype,"endField",void 0),t([l({type:d,json:{write:{enabled:!0,allowNull:!0}}})],n.prototype,"fullTimeExtent",void 0),t([m("fullTimeExtent",["timeExtent"])],n.prototype,"readFullTimeExtent",null),t([c("fullTimeExtent")],n.prototype,"writeFullTimeExtent",null),t([l({type:Boolean,json:{write:!0}})],n.prototype,"hasLiveData",void 0),t([l({type:o,json:{write:{enabled:!0,allowNull:!0}}})],n.prototype,"interval",void 0),t([m("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],n.prototype,"readInterval",null),t([c("interval")],n.prototype,"writeInterval",null),t([l({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],n.prototype,"startField",void 0),t([l({type:E,json:{write:{enabled:!0,allowNull:!0}}})],n.prototype,"timeReference",void 0),t([l({type:String,json:{write:{enabled:!0,allowNull:!0}}})],n.prototype,"trackIdField",void 0),t([l({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],n.prototype,"useTime",void 0),n=t([p("esri.layers.support.TimeInfo")],n);const O=n,F=i=>{let e=class extends i{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(s,a){const u=a.timeInfo.exportOptions;if(!u)return null;const v=u.timeOffset,y=x.fromJSON(u.timeOffsetUnits);return v&&y?new o({value:v,unit:y}):null}set timeInfo(s){j(s,this.fieldsIndex),this._set("timeInfo",s)}};return t([l({type:d,json:{write:!1}})],e.prototype,"timeExtent",void 0),t([l({type:o})],e.prototype,"timeOffset",void 0),t([m("service","timeOffset",["timeInfo.exportOptions"])],e.prototype,"readOffset",null),t([l({value:null,type:O,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],e.prototype,"timeInfo",null),t([l({type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation"},origins:{"web-scene":{read:!1,write:!1}}}})],e.prototype,"useViewTime",void 0),e=t([p("esri.layers.mixins.TemporalLayer")],e),e};export{F as a,O as d}; diff --git a/assets/Terrain.glsl-84e9c4a7.js b/assets/Terrain.glsl-84e9c4a7.js new file mode 100644 index 0000000..c771c23 --- /dev/null +++ b/assets/Terrain.glsl-84e9c4a7.js @@ -0,0 +1 @@ +import{_ as s,k as e}from"./index-080e108a.js";export{s as TerrainPassParameters,e as build}; diff --git a/assets/TerrainTileTree3DDebugger-33a28731.js b/assets/TerrainTileTree3DDebugger-33a28731.js new file mode 100644 index 0000000..fcbf6f1 --- /dev/null +++ b/assets/TerrainTileTree3DDebugger-33a28731.js @@ -0,0 +1 @@ +import{aG as s,ag as i,ak as t,aU as n,ai as l,al as o}from"./index-080e108a.js";import{y as p}from"./TileTreeDebugger-142b9f39.js";let r=class extends p{constructor(e){super(e),this.enablePolygons=!1}initialize(){s(()=>this.enabled,e=>this.view.basemapTerrain.renderPatchBorders=e,i)}getTiles(){const e=this.view.basemapTerrain.spatialReference!=null?this.view.basemapTerrain.spatialReference:null;return this.view.basemapTerrain.test.getRenderedTiles().map(a=>({...a,geometry:t.fromExtent(n(a.extent,e))}))}};r=l([o("esri.views.3d.layers.support.TerrainTileTree3DDebugger")],r);export{r as TerrainTileTree3DDebugger}; diff --git a/assets/TextureOnly.glsl-41ddb8a9.js b/assets/TextureOnly.glsl-41ddb8a9.js new file mode 100644 index 0000000..a40bd34 --- /dev/null +++ b/assets/TextureOnly.glsl-41ddb8a9.js @@ -0,0 +1 @@ +import{i as r,l as s}from"./index-080e108a.js";export{r as TextureOnlyPassParameters,s as build}; diff --git a/assets/Tick-c7ca49b9.js b/assets/Tick-c7ca49b9.js new file mode 100644 index 0000000..594c8ed --- /dev/null +++ b/assets/Tick-c7ca49b9.js @@ -0,0 +1 @@ +import{fj as M}from"./index-080e108a.js";import{J as I,R as q,T as Y,c as b,g as Q,k as K,z as x,r as J,l as T,X as L,a as Z,s as W,Q as E,_ as H,w as ee}from"./Popup-db207f4c.js";class te extends K{constructor(){super(...arguments),Object.defineProperty(this,"processor",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}incrementRef(){}decrementRef(){}_onPush(e){this.processor&&this.processor.processRow(e),super._onPush(e)}_onInsertIndex(e,t){this.processor&&this.processor.processRow(t),super._onInsertIndex(e,t)}_onSetIndex(e,t,i){this.processor&&this.processor.processRow(i),super._onSetIndex(e,t,i)}}class V extends Y{constructor(e,t,i){super(i),Object.defineProperty(this,"component",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"open",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"close",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dataContext=t,this.component=e,this._settings.visible=!0,this._checkDirty()}markDirty(){this.component.markDirtyValues(this)}_startAnimation(){this.component._root._addAnimation(this)}_animationTime(){return this.component._root.animationTime}_dispose(){this.component&&this.component.disposeDataItem(this),super._dispose()}show(e){this.setRaw("visible",!0),this.component&&this.component.showDataItem(this,e)}hide(e){this.setRaw("visible",!1),this.component&&this.component.hideDataItem(this,e)}isHidden(){return!this.get("visible")}}class j extends I{constructor(){super(...arguments),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new te}),Object.defineProperty(this,"_dataItems",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mainDataItems",{enumerable:!0,configurable:!0,writable:!0,value:this._dataItems}),Object.defineProperty(this,"valueFields",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"fields",{enumerable:!0,configurable:!0,writable:!0,value:["id"]}),Object.defineProperty(this,"_valueFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueFieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valuesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataChanged",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataGrouped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inited",{enumerable:!0,configurable:!0,writable:!0,value:!1})}set data(e){e.incrementRef(),this._data.decrementRef(),this._data=e}get data(){return this._data}_dispose(){super._dispose(),this._data.decrementRef()}_onDataClear(){}_afterNew(){super._afterNew(),this._data.incrementRef(),this._updateFields(),this._disposers.push(this.data.events.onAll(e=>{const t=this._mainDataItems;if(this.markDirtyValues(),this._markDirtyGroup(),this._dataChanged=!0,e.type==="clear")b(t,i=>{i.dispose()}),t.length=0,this._onDataClear();else if(e.type==="push"){const i=new V(this,e.newValue,this._makeDataItem(e.newValue));t.push(i),this.processDataItem(i)}else if(e.type==="setIndex"){const i=t[e.index],s=this._makeDataItem(e.newValue);i.bullets&&i.bullets.length==0&&(i.bullets=void 0),Q(s).forEach(a=>{i.animate({key:a,to:s[a],duration:this.get("interpolationDuration",0),easing:this.get("interpolationEasing")})}),i.dataContext=e.newValue}else if(e.type==="insertIndex"){const i=new V(this,e.newValue,this._makeDataItem(e.newValue));t.splice(e.index,0,i),this.processDataItem(i)}else if(e.type==="removeIndex")t[e.index].dispose(),t.splice(e.index,1);else{if(e.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");{const i=t[e.oldIndex];t.splice(e.oldIndex,1),t.splice(e.newIndex,0,i)}}this._afterDataChange()}))}_updateFields(){this.valueFields&&(this._valueFields=[],this._valueFieldsF={},b(this.valueFields,e=>{this.get(e+"Field")&&(this._valueFields.push(e),this._valueFieldsF[e]={fieldKey:e+"Field",workingKey:e+"Working"})})),this.fields&&(this._fields=[],this._fieldsF={},b(this.fields,e=>{this.get(e+"Field")&&(this._fields.push(e),this._fieldsF[e]=e+"Field")}))}get dataItems(){return this._dataItems}processDataItem(e){}_makeDataItem(e){const t={};return this._valueFields&&b(this._valueFields,i=>{const s=this.get(this._valueFieldsF[i].fieldKey);t[i]=e[s],t[this._valueFieldsF[i].workingKey]=t[i]}),this._fields&&b(this._fields,i=>{const s=this.get(this._fieldsF[i]);t[i]=e[s]}),t}makeDataItem(e){let t=new V(this,void 0,e);return this.processDataItem(t),t}pushDataItem(e){const t=this.makeDataItem(e);return this._mainDataItems.push(t),t}disposeDataItem(e){}showDataItem(e,t){return M(this,void 0,void 0,function*(){e.set("visible",!0)})}hideDataItem(e,t){return M(this,void 0,void 0,function*(){e.set("visible",!1)})}_clearDirty(){super._clearDirty(),this._valuesDirty=!1}_afterDataChange(){}_afterChanged(){if(super._afterChanged(),this._dataChanged){const e="datavalidated";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this}),this._dataChanged=!1}this.inited=!0}markDirtyValues(e){this.markDirty(),this._valuesDirty=!0}_markDirtyGroup(){this._dataGrouped=!1}markDirtySize(){this._sizeDirty=!0,this.markDirty()}}function ie(l){return new Promise((e,t)=>{setTimeout(e,l)})}Object.defineProperty(j,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Component"}),Object.defineProperty(j,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:I.classNames.concat([j.className])});let se={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2629742400,year:31536e6};function O(l,e){return e==null&&(e=1),se[l]*e}function z(l,e,t,i,s,a,n){if(!n||s){let o=0;switch(s||e=="millisecond"||(o=l.getTimezoneOffset(),l.setUTCMinutes(l.getUTCMinutes()-o)),e){case"day":let u=l.getUTCDate();if(t>1){if(a){a=z(a,"day",1);let y=l.getTime()-a.getTime(),w=Math.floor(y/O("day")/t),D=O("day",w*t);l.setTime(a.getTime()+D-o*O("minute"))}}else l.setUTCDate(u);l.setUTCHours(0,0,0,0);break;case"second":let h=l.getUTCSeconds();t>1&&(h=Math.floor(h/t)*t),l.setUTCSeconds(h,0);break;case"millisecond":if(t==1)return l;let c=l.getUTCMilliseconds();c=Math.floor(c/t)*t,l.setUTCMilliseconds(c);break;case"hour":let m=l.getUTCHours();t>1&&(m=Math.floor(m/t)*t),l.setUTCHours(m,0,0,0);break;case"minute":let d=l.getUTCMinutes();t>1&&(d=Math.floor(d/t)*t),l.setUTCMinutes(d,0,0);break;case"month":let r=l.getUTCMonth();t>1&&(r=Math.floor(r/t)*t),l.setUTCMonth(r,1),l.setUTCHours(0,0,0,0);break;case"year":let p=l.getUTCFullYear();t>1&&(p=Math.floor(p/t)*t),l.setUTCFullYear(p,0,1),l.setUTCHours(0,0,0,0);break;case"week":let g=l.getUTCDate(),f=l.getUTCDay();T(i)||(i=1),g=f>=i?g-f+i:g-(7+f)+i,l.setUTCDate(g),l.setUTCHours(0,0,0,0)}if(!s&&e!="millisecond"&&(l.setUTCMinutes(l.getUTCMinutes()+o),e=="day"||e=="week"||e=="month"||e=="year")){let u=l.getTimezoneOffset();if(u!=o){let h=u-o;l.setUTCMinutes(l.getUTCMinutes()+h)}}return l}{if(isNaN(l.getTime()))return l;let o=n.offsetUTC(l),u=l.getTimezoneOffset(),h=n.parseDate(l),c=h.year,m=h.month,d=h.day,r=h.hour,p=h.minute,g=h.second,f=h.millisecond,y=h.weekday;switch(e){case"day":if(t>1&&a){a=z(a,"day",1,i,s,void 0,n);let D=l.getTime()-a.getTime(),_=Math.floor(D/O("day")/t),C=O("day",_*t);l.setTime(a.getTime()+C),h=n.parseDate(l),c=h.year,m=h.month,d=h.day}r=0,p=o-u,g=0,f=0;break;case"second":p+=o-u,t>1&&(g=Math.floor(g/t)*t),f=0;break;case"millisecond":p+=o-u,t>1&&(f=Math.floor(f/t)*t);break;case"hour":t>1&&(r=Math.floor(r/t)*t),p=o-u,g=0,f=0;break;case"minute":t>1&&(p=Math.floor(p/t)*t),p+=o-u,g=0,f=0;break;case"month":t>1&&(m=Math.floor(m/t)*t),d=1,r=0,p=o-u,g=0,f=0;break;case"year":t>1&&(c=Math.floor(c/t)*t),m=0,d=1,r=0,p=o-u,g=0,f=0;break;case"week":T(i)||(i=1),d=y>=i?d-y+i:d-(7+y)+i,r=0,p=o-u,g=0,f=0}let w=(l=new Date(c,m,d,r,p,g,f)).getTimezoneOffset();return w!=u&&l.setTime(l.getTime()+6e4*(u-w)),l}}class N extends j{constructor(){super(...arguments),Object.defineProperty(this,"_aggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionAggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_psi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pei",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:new K}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:I.new(this._root,{width:x,height:x,position:"absolute"})})}_afterNew(){this.valueFields.push("value"),super._afterNew(),this.setPrivate("customData",{}),this._disposers.push(this.bullets.events.onAll(e=>{if(e.type==="clear")this._handleBullets(this.dataItems);else if(e.type==="push")this._handleBullets(this.dataItems);else if(e.type==="setIndex")this._handleBullets(this.dataItems);else if(e.type==="insertIndex")this._handleBullets(this.dataItems);else if(e.type==="removeIndex")this._handleBullets(this.dataItems);else{if(e.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._handleBullets(this.dataItems)}}))}_dispose(){this.bulletsContainer.dispose(),super._dispose()}startIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("startIndex",0),e)}endIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("endIndex",e),e)}_handleBullets(e){b(e,t=>{const i=t.bullets;i&&(b(i,s=>{s.dispose()}),t.bullets=void 0)}),this.markDirtyValues()}getDataItemById(e){return J(this.dataItems,t=>t.get("id")==e)}_makeBullets(e){this._shouldMakeBullet(e)&&(e.bullets=[],this.bullets.each(t=>{this._makeBullet(e,t)}))}_shouldMakeBullet(e){return!0}_makeBullet(e,t,i){const s=t(this._root,this,e);if(s){let a=s.get("sprite");a&&(a._setDataItem(e),a.setRaw("position","absolute"),this.bulletsContainer.children.push(a)),s._index=i,s.series=this,e.bullets.push(s)}return s}_clearDirty(){super._clearDirty(),this._aggregatesCalculated=!1,this._selectionAggregatesCalculated=!1}_prepareChildren(){super._prepareChildren();let e=this.startIndex(),t=this.endIndex();if(this.isDirty("heatRules")&&(this._valuesDirty=!0),this.isPrivateDirty("baseValueSeries")){const i=this.getPrivate("baseValueSeries");i&&this._disposers.push(i.onPrivate("startIndex",()=>{this.markDirtyValues()}))}if(this.get("calculateAggregates")&&(this._valuesDirty&&!this._dataProcessed&&(this._aggregatesCalculated||(this._calculateAggregates(0,this.dataItems.length),this._aggregatesCalculated=!0)),this._psi==e&&this._pei==t||this._selectionAggregatesCalculated||(e===0&&t===this.dataItems.length&&this._aggregatesCalculated||this._calculateAggregates(e,t),this._selectionAggregatesCalculated=!0)),this.isDirty("tooltip")){let i=this.get("tooltip");i&&(i.hide(0),i.set("tooltipTarget",this))}if(this.isDirty("fill")||this.isDirty("stroke")){let i;const s=this.get("legendDataItem");if(s&&(i=s.get("markerRectangle"),i&&this.isVisible())){if(this.isDirty("stroke")){let a=this.get("stroke");i.set("stroke",a)}if(this.isDirty("fill")){let a=this.get("fill");i.set("fill",a)}}this.updateLegendMarker(void 0)}if(this.bullets.length>0){let i=this.startIndex(),s=this.endIndex();s{s[r]=0,a[r]=0,n[r]=0}),b(i,r=>{let p=r+"Change",g=r+"ChangePercent",f=r+"ChangePrevious",y=r+"ChangePreviousPercent",w=r+"ChangeSelection",D=r+"ChangeSelectionPercent",_="valueY";r!="valueX"&&r!="openValueX"&&r!="lowValueX"&&r!="highValueX"||(_="valueX");const C=this.getPrivate("baseValueSeries");for(let S=e;Sv||o[r]==null)&&(o[r]=v),(u[r]{this.setPrivate(r+"AverageSelection",m[r]),this.setPrivate(r+"CountSelection",n[r]),this.setPrivate(r+"SumSelection",s[r]),this.setPrivate(r+"AbsoluteSumSelection",a[r]),this.setPrivate(r+"LowSelection",o[r]),this.setPrivate(r+"HighSelection",u[r]),this.setPrivate(r+"OpenSelection",h[r]),this.setPrivate(r+"CloseSelection",c[r])}),e===0&&t===this.dataItems.length&&b(i,r=>{this.setPrivate(r+"Average",m[r]),this.setPrivate(r+"Count",n[r]),this.setPrivate(r+"Sum",s[r]),this.setPrivate(r+"AbsoluteSum",a[r]),this.setPrivate(r+"Low",o[r]),this.setPrivate(r+"High",u[r]),this.setPrivate(r+"Open",h[r]),this.setPrivate(r+"Close",c[r])})}_updateChildren(){super._updateChildren(),this._psi=this.startIndex(),this._pei=this.endIndex(),this.isDirty("visible")&&this.bulletsContainer.set("visible",this.get("visible"));const e=this.get("heatRules");if(this._valuesDirty&&e&&e.length>0&&b(e,t=>{const i=t.minValue||this.getPrivate(t.dataField+"Low")||0,s=t.maxValue||this.getPrivate(t.dataField+"High")||0;b(t.target._entities,a=>{const n=a.dataItem.get(t.dataField);if(T(n))if(t.customFunction)t.customFunction.call(this,a,i,s,n);else{let o,u;o=t.logarithmic?(Math.log(n)*Math.LOG10E-Math.log(i)*Math.LOG10E)/(Math.log(s)*Math.LOG10E-Math.log(i)*Math.LOG10E):(n-i)/(s-i),!T(n)||T(o)&&Math.abs(o)!=1/0||(o=.5),T(t.min)?u=t.min+(t.max-t.min)*o:t.min instanceof L?u=L.interpolate(o,t.min,t.max):t.min instanceof Z&&(u=W(o,t.min,t.max)),a.set(t.key,u)}else t.neutral&&a.set(t.key,t.neutral)})}),this.get("visible")&&this.bullets.length>0){let t=this.dataItems.length,i=this.startIndex(),s=this.endIndex();s0&&i--;for(let a=0;a{this._positionBullet(t);const i=t.get("sprite");t.get("dynamic")&&(i&&(i._markDirtyKey("fill"),i.markDirtySize()),i instanceof I&&i.walkChildren(s=>{s._markDirtyKey("fill"),s.markDirtySize(),s instanceof E&&s.text.markDirtyText()})),i instanceof E&&i.get("populateText")&&i.text.markDirtyText()})}_hideBullets(e){e.bullets&&b(e.bullets,t=>{let i=t.get("sprite");i&&i.setPrivate("visible",!1)})}_positionBullet(e){}_placeBulletsContainer(e){e.bulletsContainer.children.moveValue(this.bulletsContainer)}_removeBulletsContainer(){const e=this.bulletsContainer;e.parent&&e.parent.children.removeValue(e)}disposeDataItem(e){const t=e.bullets;t&&b(t,i=>{i.dispose()})}_getItemReaderLabel(){return""}showDataItem(e,t){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return M(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,e,t)],a=e.bullets;a&&b(a,n=>{s.push(n.get("sprite").show(t))}),yield Promise.all(s)})}hideDataItem(e,t){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return M(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,e,t)],a=e.bullets;a&&b(a,n=>{s.push(n.get("sprite").hide(t))}),yield Promise.all(s)})}_sequencedShowHide(e,t){return M(this,void 0,void 0,function*(){if(this.get("sequencedInterpolation"))if(T(t)||(t=this.get("interpolationDuration",0)),t>0){const i=this.startIndex(),s=this.endIndex();yield Promise.all(H(this.dataItems,(a,n)=>M(this,void 0,void 0,function*(){let o=t||0;(ns+10)&&(o=0);let u=this.get("sequencedDelay",0)+o/(s-i);yield ie(u*(n-i)),e?yield this.showDataItem(a,o):yield this.hideDataItem(a,o)})))}else yield Promise.all(H(this.dataItems,i=>e?this.showDataItem(i,0):this.hideDataItem(i,0)))})}updateLegendValue(e){if(e){const t=e.get("legendDataItem");if(t){const i=t.get("valueLabel");if(i){const a=i.text;let n="";i._setDataItem(e),n=this.get("legendValueText",a.get("text","")),i.set("text",n),a.markDirtyText()}const s=t.get("label");if(s){const a=s.text;let n="";s._setDataItem(e),n=this.get("legendLabelText",a.get("text","")),s.set("text",n),a.markDirtyText()}}}}updateLegendMarker(e){}_onHide(){super._onHide();const e=this.getTooltip();e&&e.hide()}hoverDataItem(e){}unhoverDataItem(e){}_getBase(e){const t=this.dataItems[this.startIndex()];return t?t.get(e):0}}function G(l,e){for(let t=0,i=e.length;t0){let a=s[0];if(a.length>0){let n=a[0];l.moveTo(n.x,n.y);for(let o=0,u=s.length;o0){let i=e[0];this._display.moveTo(i.x,i.y),G(this._display,[[e]])}else if(t)G(this._display,t);else if(!this.get("draw")){let i=this.width(),s=this.height();this._display.moveTo(0,0),this._display.lineTo(i,s)}}}}function ue(l){return function(){return l}}Object.defineProperty($,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Line"}),Object.defineProperty($,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:q.classNames.concat([$.className])});const R=Math.PI,A=2*R,k=1e-6,re=A-k;function X(l){this._+=l[0];for(let e=1,t=l.length;e=0))throw new Error(`invalid digits: ${l}`);if(e>15)return X;const t=10**e;return function(i){this._+=i[0];for(let s=1,a=i.length;sk)if(Math.abs(m*u-h*c)>k&&a){let r=i-n,p=s-o,g=u*u+h*h,f=r*r+p*p,y=Math.sqrt(g),w=Math.sqrt(d),D=a*Math.tan((R-Math.acos((g+d-f)/(2*y*w)))/2),_=D/w,C=D/y;Math.abs(_-1)>k&&this._append`L${e+_*c},${t+_*m}`,this._append`A${a},${a},0,0,${+(m*r>c*p)},${this._x1=e+C*u},${this._y1=t+C*h}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,i,s,a,n){if(e=+e,t=+t,n=!!n,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=i*Math.cos(s),u=i*Math.sin(s),h=e+o,c=t+u,m=1^n,d=n?s-a:a-s;this._x1===null?this._append`M${h},${c}`:(Math.abs(this._x1-h)>k||Math.abs(this._y1-c)>k)&&this._append`L${h},${c}`,i&&(d<0&&(d=d%A+A),d>re?this._append`A${i},${i},0,1,${m},${e-o},${t-u}A${i},${i},0,1,${m},${this._x1=h},${this._y1=c}`:d>k&&this._append`A${i},${i},0,${+(d>=R)},${m},${this._x1=e+i*Math.cos(a)},${this._y1=t+i*Math.sin(a)}`)}rect(e,t,i,s){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${i=+i}v${+s}h${-i}Z`}toString(){return this._}}function de(l){let e=3;return l.digits=function(t){if(!arguments.length)return e;if(t==null)e=null;else{const i=Math.floor(t);if(!(i>=0))throw new RangeError(`invalid digits: ${t}`);e=i}return l},()=>new ne(e)}class F extends I{constructor(){super(...arguments),Object.defineProperty(this,"chartContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(I.new(this._root,{width:x,height:x,interactiveChildren:!1}))}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:I.new(this._root,{interactiveChildren:!1,isMeasured:!1,position:"absolute",width:x,height:x})})}}Object.defineProperty(F,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Chart"}),Object.defineProperty(F,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:I.classNames.concat([F.className])});class U extends F{constructor(){super(...arguments),Object.defineProperty(this,"seriesContainer",{enumerable:!0,configurable:!0,writable:!0,value:I.new(this._root,{width:x,height:x,isMeasured:!1})}),Object.defineProperty(this,"series",{enumerable:!0,configurable:!0,writable:!0,value:new ee})}_afterNew(){super._afterNew(),this._disposers.push(this.series);const e=this.seriesContainer.children;this._disposers.push(this.series.events.onAll(t=>{if(t.type==="clear"){b(t.oldValues,s=>{this._removeSeries(s)});const i=this.get("colors");i&&i.reset()}else if(t.type==="push")e.moveValue(t.newValue),this._processSeries(t.newValue);else if(t.type==="setIndex")e.setIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="insertIndex")e.insertIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="removeIndex")this._removeSeries(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IListEvent type");e.moveValue(t.value,t.newIndex),this._processSeries(t.value)}}))}_processSeries(e){e.chart=this,e._placeBulletsContainer(this)}_removeSeries(e){e.isDisposed()||(this.seriesContainer.children.removeValue(e),e._removeBulletsContainer())}}Object.defineProperty(U,"className",{enumerable:!0,configurable:!0,writable:!0,value:"SerialChart"}),Object.defineProperty(U,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:F.classNames.concat([U.className])});class B extends ${}Object.defineProperty(B,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tick"}),Object.defineProperty(B,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:$.classNames.concat([B.className])});export{B,N as D,z as I,U,de as V,j as _,V as g,ue as k}; diff --git a/assets/TileClipper-ae6eca9e.js b/assets/TileClipper-ae6eca9e.js new file mode 100644 index 0000000..797a570 --- /dev/null +++ b/assets/TileClipper-ae6eca9e.js @@ -0,0 +1 @@ +var T,c;(function(o){o[o.Unknown=0]="Unknown",o[o.Point=1]="Point",o[o.LineString=2]="LineString",o[o.Polygon=3]="Polygon"})(T||(T={}));class g{constructor(t,s){this.x=t,this.y=s}clone(){return new g(this.x,this.y)}equals(t,s){return t===this.x&&s===this.y}isEqual(t){return t.x===this.x&&t.y===this.y}setCoords(t,s){this.x=t,this.y=s}normalize(){const t=this.x,s=this.y,i=Math.sqrt(t*t+s*s);this.x/=i,this.y/=i}rightPerpendicular(){const t=this.x;this.x=this.y,this.y=-t}move(t,s){this.x+=t,this.y+=s}assign(t){this.x=t.x,this.y=t.y}assignAdd(t,s){this.x=t.x+s.x,this.y=t.y+s.y}assignSub(t,s){this.x=t.x-s.x,this.y=t.y-s.y}rotate(t,s){const i=this.x,h=this.y;this.x=i*t-h*s,this.y=i*s+h*t}scale(t){this.x*=t,this.y*=t}length(){const t=this.x,s=this.y;return Math.sqrt(t*t+s*s)}static distance(t,s){const i=s.x-t.x,h=s.y-t.y;return Math.sqrt(i*i+h*h)}static add(t,s){return new g(t.x+s.x,t.y+s.y)}static sub(t,s){return new g(t.x-s.x,t.y-s.y)}}class R{constructor(t,s,i){this.ratio=t,this.x=s,this.y=i}}class L{constructor(t,s,i,h=8,e=8){this._lines=[],this._starts=[],this.validateTessellation=!0,this._pixelRatio=h,this._pixelMargin=e,this._tileSize=512*h,this._dz=t,this._yPos=s,this._xPos=i}setPixelMargin(t){t!==this._pixelMargin&&(this._pixelMargin=t,this.setExtent(this._extent))}setExtent(t){this._extent=t,this._finalRatio=this._tileSize/t*(1<>this._dz;s>i&&(s=i),this._margin=s,this._xmin=i*this._xPos-s,this._ymin=i*this._yPos-s,this._xmax=this._xmin+i+2*s,this._ymax=this._ymin+i+2*s}reset(t){this._type=t,this._lines=[],this._starts=[],this._line=null,this._start=0}moveTo(t,s){this._pushLine(),this._prevIsIn=this._isIn(t,s),this._moveTo(t,s,this._prevIsIn),this._prevPt=new g(t,s),this._firstPt=new g(t,s),this._dist=0}lineTo(t,s){const i=this._isIn(t,s),h=new g(t,s),e=g.distance(this._prevPt,h);let n,a,_,y,d,f,r,p;if(i)this._prevIsIn?this._lineTo(t,s,!0):(n=this._prevPt,a=h,_=this._intersect(a,n),this._start=this._dist+e*(1-this._r),this._lineTo(_.x,_.y,!0),this._lineTo(a.x,a.y,!0));else if(this._prevIsIn)a=this._prevPt,n=h,_=this._intersect(a,n),this._lineTo(_.x,_.y,!0),this._lineTo(n.x,n.y,!1);else{const x=this._prevPt,l=h;if(x.x<=this._xmin&&l.x<=this._xmin||x.x>=this._xmax&&l.x>=this._xmax||x.y<=this._ymin&&l.y<=this._ymin||x.y>=this._ymax&&l.y>=this._ymax)this._lineTo(l.x,l.y,!1);else{const u=[];if((x.xthis._xmin||x.x>this._xmin&&l.x=this._ymax?f=!0:u.push(new R(y,this._xmin,p))),(x.xthis._xmax||x.x>this._xmax&&l.x=this._ymax?f=!0:u.push(new R(y,this._xmax,p))),(x.ythis._ymin||x.y>this._ymin&&l.y=this._xmax?d=!0:u.push(new R(y,r,this._ymin))),(x.ythis._ymax||x.y>this._ymax&&l.y=this._xmax?d=!0:u.push(new R(y,r,this._ymax))),u.length===0)d?f?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):f?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(u.length>1&&u[0].ratio>u[1].ratio)this._start=this._dist+e*u[1].ratio,this._lineTo(u[1].x,u[1].y,!0),this._lineTo(u[0].x,u[0].y,!0);else{this._start=this._dist+e*u[0].ratio;for(let m=0;m2){const t=this._firstPt,s=this._prevPt;t.x===s.x&&t.y===s.y||this.lineTo(t.x,t.y);const i=this._line;let h=i.length;for(;h>=4&&(i[0].x===i[1].x&&i[0].x===i[h-2].x||i[0].y===i[1].y&&i[0].y===i[h-2].y);)i.pop(),i[0].x=i[h-2].x,i[0].y=i[h-2].y,--h}}result(t=!0){return this._pushLine(),this._lines.length===0?null:(this._type===T.Polygon&&t&&P.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==T.LineString)throw new Error("Only valid for lines");this._pushLine();const t=this._lines,s=t.length;if(s===0)return null;const i=[];for(let h=0;h=this._xmin&&t<=this._xmax&&s>=this._ymin&&s<=this._ymax}_intersect(t,s){let i,h,e;if(s.x>=this._xmin&&s.x<=this._xmax)h=s.y<=this._ymin?this._ymin:this._ymax,e=(h-t.y)/(s.y-t.y),i=t.x+e*(s.x-t.x);else if(s.y>=this._ymin&&s.y<=this._ymax)i=s.x<=this._xmin?this._xmin:this._xmax,e=(i-t.x)/(s.x-t.x),h=t.y+e*(s.y-t.y);else{h=s.y<=this._ymin?this._ymin:this._ymax,i=s.x<=this._xmin?this._xmin:this._xmax;const n=(i-t.x)/(s.x-t.x),a=(h-t.y)/(s.y-t.y);n0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===T.LineString?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===T.Polygon&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(t,s,i){this._type!==T.Polygon?i&&(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),s=Math.round((s-(this._ymin+this._margin))*this._finalRatio),this._line.push(new g(t,s))):(i||(tthis._xmax&&(t=this._xmax),sthis._ymax&&(s=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),s=Math.round((s-(this._ymin+this._margin))*this._finalRatio),this._line.push(new g(t,s)),this._isH=!1,this._isV=!1)}_lineTo(t,s,i){let h,e;if(this._type!==T.Polygon)if(i){if(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),s=Math.round((s-(this._ymin+this._margin))*this._finalRatio),this._line.length>0&&(h=this._line[this._line.length-1],h.equals(t,s)))return;this._line.push(new g(t,s))}else this._line&&this._line.length>0&&this._pushLine();else if(i||(tthis._xmax&&(t=this._xmax),sthis._ymax&&(s=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),s=Math.round((s-(this._ymin+this._margin))*this._finalRatio),this._line&&this._line.length>0){h=this._line[this._line.length-1];const n=h.x===t,a=h.y===s;if(n&&a)return;this._isH&&n||this._isV&&a?(h.x=t,h.y=s,e=this._line[this._line.length-2],e.x===t&&e.y===s?(this._line.pop(),this._line.length<=1?(this._isH=!1,this._isV=!1):(e=this._line[this._line.length-2],this._isH=e.x===t,this._isV=e.y===s)):(this._isH=e.x===t,this._isV=e.y===s)):(this._line.push(new g(t,s)),this._isH=n,this._isV=a)}else this._line.push(new g(t,s))}}class I{setExtent(t){this._ratio=t===4096?1:4096/t}get validateTessellation(){return this._ratio<1}reset(t){this._lines=[],this._line=null}moveTo(t,s){this._line&&this._lines.push(this._line),this._line=[];const i=this._ratio;this._line.push(new g(t*i,s*i))}lineTo(t,s){const i=this._ratio;this._line.push(new g(t*i,s*i))}close(){const t=this._line;t&&!t[0].isEqual(t[t.length-1])&&t.push(t[0])}result(){return this._line&&this._lines.push(this._line),this._lines.length===0?null:this._lines}}(function(o){o[o.sideLeft=0]="sideLeft",o[o.sideRight=1]="sideRight",o[o.sideTop=2]="sideTop",o[o.sideBottom=3]="sideBottom"})(c||(c={}));class P{static simplify(t,s,i){if(!i)return;const h=-s,e=t+s,n=-s,a=t+s,_=[],y=[],d=i.length;for(let r=0;rx.y?(_.push(r),_.push(m),_.push(c.sideLeft),_.push(-1)):(y.push(r),y.push(m),y.push(c.sideLeft),y.push(-1))),l.x>=e&&(l.y=a&&(l.x>x.x?(_.push(r),_.push(m),_.push(c.sideBottom),_.push(-1)):(y.push(r),y.push(m),y.push(c.sideBottom),y.push(-1)))),l=x}if(_.length===0||y.length===0)return;P.fillParent(i,y,_),P.fillParent(i,_,y);const f=[];P.calcDeltas(f,y,_),P.calcDeltas(f,_,y),P.addDeltas(f,i)}static fillParent(t,s,i){const h=i.length,e=s.length;for(let n=0;n1&&h[n-2]===e?0:(h.push(e),P.calcDelta(e,i,s,h)+1)}static addDeltas(t,s){const i=t.length;let h=0;for(let e=0;eh&&(h=n)}for(let e=0;eo>=t&&o<=s||o>=s&&o<=t;export{I as _,L as e,g as h,T as t}; diff --git a/assets/TileInfoTilemapCache-b3f5dda7.js b/assets/TileInfoTilemapCache-b3f5dda7.js new file mode 100644 index 0000000..b17286e --- /dev/null +++ b/assets/TileInfoTilemapCache-b3f5dda7.js @@ -0,0 +1 @@ +import{c4 as s,ar as h,bn as r}from"./index-080e108a.js";class f{constructor(i,e=0,l=i.lods[i.lods.length-1].level){this.tileInfo=i,this.minLOD=e,this.maxLOD=l,i.lodAt(e)||(this.minLOD=i.lods[0].level),i.lodAt(l)||(this.maxLOD=i.lods[i.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(i,e,l){var a;const t=(a=this.tileInfo)==null?void 0:a.lodAt(i);return!t||ithis.maxLOD?"unavailable":t.cols&&t.rows?l>=t.cols[0]&&l<=t.cols[1]&&e>=t.rows[0]&&e<=t.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(i,e,l,t){await s(t);const a=this.getAvailability(i,e,l);if(a==="unavailable")throw new h("tile-map:tile-unavailable","Tile is not available",{level:i,row:e,col:l});return a}async fetchAvailabilityUpsample(i,e,l,t,a){await s(a),t.level=i,t.row=e,t.col=l;const n=this.tileInfo;return n.updateTileInfo(t),this.fetchAvailability(i,e,l,a).catch(o=>{if(r(o))throw o;if(n.upsampleTile(t))return this.fetchAvailabilityUpsample(t.level,t.row,t.col,t,a);throw o})}}export{f as e}; diff --git a/assets/TileInfoView-346e56d0.js b/assets/TileInfoView-346e56d0.js new file mode 100644 index 0000000..aafe45c --- /dev/null +++ b/assets/TileInfoView-346e56d0.js @@ -0,0 +1 @@ +import{co as D,ku as P,dD as z}from"./index-080e108a.js";var R,v,y,B,N,p,x;(function(o){o[o.FILL=0]="FILL",o[o.LINE=1]="LINE",o[o.MARKER=2]="MARKER",o[o.TEXT=3]="TEXT",o[o.LABEL=4]="LABEL"})(R||(R={})),function(o){o[o.NONE=0]="NONE",o[o.MAP=1]="MAP",o[o.LABEL=2]="LABEL",o[o.LABEL_ALPHA=4]="LABEL_ALPHA",o[o.HITTEST=8]="HITTEST",o[o.HIGHLIGHT=16]="HIGHLIGHT",o[o.CLIP=32]="CLIP",o[o.DEBUG=64]="DEBUG",o[o.NUM_DRAW_PHASES=9]="NUM_DRAW_PHASES"}(v||(v={})),function(o){o[o.SIZE=0]="SIZE",o[o.COLOR=1]="COLOR",o[o.OPACITY=2]="OPACITY",o[o.ROTATION=3]="ROTATION"}(y||(y={})),function(o){o[o.NONE=0]="NONE",o[o.OPACITY=1]="OPACITY",o[o.COLOR=2]="COLOR",o[o.ROTATION=4]="ROTATION",o[o.SIZE_MINMAX_VALUE=8]="SIZE_MINMAX_VALUE",o[o.SIZE_SCALE_STOPS=16]="SIZE_SCALE_STOPS",o[o.SIZE_FIELD_STOPS=32]="SIZE_FIELD_STOPS",o[o.SIZE_UNIT_VALUE=64]="SIZE_UNIT_VALUE"}(B||(B={})),function(o){o[o.MINMAX_TARGETS_OUTLINE=128]="MINMAX_TARGETS_OUTLINE",o[o.SCALE_TARGETS_OUTLINE=256]="SCALE_TARGETS_OUTLINE",o[o.FIELD_TARGETS_OUTLINE=512]="FIELD_TARGETS_OUTLINE",o[o.UNIT_TARGETS_OUTLINE=1024]="UNIT_TARGETS_OUTLINE"}(N||(N={})),function(o){o[o.SPRITE=0]="SPRITE",o[o.GLYPH=1]="GLYPH"}(p||(p={})),function(o){o[o.DEFAULT=0]="DEFAULT",o[o.SIMPLE=1]="SIMPLE",o[o.DOT_DENSITY=2]="DOT_DENSITY",o[o.OUTLINE_FILL=3]="OUTLINE_FILL",o[o.OUTLINE_FILL_SIMPLE=4]="OUTLINE_FILL_SIMPLE",o[o.HEATMAP=5]="HEATMAP",o[o.PIE_CHART=6]="PIE_CHART"}(x||(x={}));class C{constructor(){this.spans=[]}acquire(t){this.lodInfo=t}release(){this.lodInfo=null,this.spans.length=0}forEach(t,l){const{spans:e,lodInfo:i}=this,{level:s}=i;if(e.length!==0)for(const{row:h,colFrom:r,colTo:n}of e)for(let a=r;a<=n;a++)t.call(l,s,h,i.normalizeCol(a),i.getWorldForColumn(a))}}C.pool=new D(C);function M(o,t){return[o,t]}function w(o,t,l){return o[0]=t,o[1]=l,o}function Y(o,t,l,e,i){return o[0]=t,o[1]=l,o[2]=e,o[3]=i,o}const d=new P("0/0/0/0");let H=class U{static create(t,l,e=null){const i=z(t.spatialReference),s=l.origin||M(t.origin.x,t.origin.y),h=M(t.size[0]*l.resolution,t.size[1]*l.resolution),r=M(-1/0,-1/0),n=M(1/0,1/0),a=M(1/0,1/0);e!=null&&(w(r,Math.max(0,Math.floor((e.xmin-s[0])/h[0])),Math.max(0,Math.floor((s[1]-e.ymax)/h[1]))),w(n,Math.max(0,Math.floor((e.xmax-s[0])/h[0])),Math.max(0,Math.floor((s[1]-e.ymin)/h[1]))),w(a,n[0]-r[0]+1,n[1]-r[1]+1));const{cols:c,rows:T}=l;let m,A,S,I;return!e&&c&&T&&(w(r,c[0],T[0]),w(n,c[1],T[1]),w(a,c[1]-c[0]+1,T[1]-T[0]+1)),t.isWrappable?(m=M(Math.ceil(Math.round((i.valid[1]-i.valid[0])/l.resolution)/t.size[0]),a[1]),A=M(Math.floor((i.origin[0]-s[0])/h[0]),r[1]),S=M(m[0]+A[0]-1,n[1]),I=!0):(A=r,S=n,m=a,I=!1),new U(l.level,l.resolution,l.scale,s,r,n,a,h,A,S,m,I)}constructor(t,l,e,i,s,h,r,n,a,c,T,m){this.level=t,this.resolution=l,this.scale=e,this.origin=i,this.first=s,this.last=h,this.size=r,this.norm=n,this.worldStart=a,this.worldEnd=c,this.worldSize=T,this.wrap=m}normalizeCol(t){if(!this.wrap)return t;const l=this.worldSize[0];return t<0?l-1-Math.abs((t+1)%l):t%l}denormalizeCol(t,l){return this.wrap?this.worldSize[0]*l+t:t}getWorldForColumn(t){return this.wrap?Math.floor(t/this.worldSize[0]):0}getFirstColumnForWorld(t){return t*this.worldSize[0]+this.first[0]}getLastColumnForWorld(t){return t*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(t){return(t-this.origin[0])/this.norm[0]}getXForColumn(t){return this.origin[0]+t*this.norm[0]}getRowForY(t){return(this.origin[1]-t)/this.norm[1]}getYForRow(t){return this.origin[1]-t*this.norm[1]}getTileBounds(t,l,e=!1){d.set(l);const i=e?d.col:this.denormalizeCol(d.col,d.world),s=d.row;return Y(t,this.getXForColumn(i),this.getYForRow(s+1),this.getXForColumn(i+1),this.getYForRow(s)),t}getTileCoords(t,l,e=!1){d.set(l);const i=e?d.col:this.denormalizeCol(d.col,d.world);return Array.isArray(t)?w(t,this.getXForColumn(i),this.getYForRow(d.row)):(t.x=this.getXForColumn(i),t.y=this.getYForRow(d.row)),t}};class F{constructor(t,l,e){this.row=t,this.colFrom=l,this.colTo=e}}const u=new P("0/0/0/0");class O{static create(t,l){t[1]>l[1]&&([t,l]=[l,t]);const[e,i]=t,[s,h]=l,r=s-e,n=h-i,a=n!==0?r/n:0,c=(Math.ceil(i)-i)*a,T=(Math.floor(i)-i)*a;return new O(e,Math.floor(i),Math.ceil(h),a,r<0?c:T,r<0?T:c,r<0?s:e,r<0?e:s)}constructor(t,l,e,i,s,h,r,n){this.x=t,this.ymin=l,this.ymax=e,this.invM=i,this.leftAdjust=s,this.rightAdjust=h,this.leftBound=r,this.rightBound=n}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}}const _=[[0,0],[0,0],[0,0],[0,0]],X=1e-6;class E{constructor(t,l=null,e=t.lods[0].level,i=t.lods[t.lods.length-1].level){this.tileInfo=t,this.fullExtent=l,this.scales=[],this._infoByScale={},this._infoByLevel={};const s=t.lods.filter(r=>r.level>=e&&r.level<=i);this.minScale=s[0].scale,this.maxScale=s[s.length-1].scale;const h=this._lodInfos=s.map(r=>H.create(t,r,l));s.forEach((r,n)=>{this._infoByLevel[r.level]=h[n],this._infoByScale[r.scale]=h[n],this.scales[n]=r.scale},this),this._wrap=t.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(t){return this._infoByLevel[typeof t=="number"?t:t.level]}getTileBounds(t,l,e=!1){u.set(l);const i=this._infoByLevel[u.level];return i?i.getTileBounds(t,u,e):t}getTileCoords(t,l,e=!1){u.set(l);const i=this._infoByLevel[u.level];return i?i.getTileCoords(t,u,e):t}getTileCoverage(t,l=192,e=!0,i="closest"){if(!e&&(t.scale>this.minScale||t.scale100)return null;let g=[];for(n=T;n=0;f--){const L=g[f];a=Math.min(a,L.getLeftCol()),c=Math.max(c,L.getRightCol())}if(a=Math.floor(a),c=Math.floor(c),n>=s.first[1]&&n<=s.last[1])if(r)if(s.size[0]s.last[0]||c=0;f--){const L=g[f];L.ymax>=n?L.incrRow():g.splice(f,1)}}return h}getTileParentId(t){u.set(t);const l=this._infoByLevel[u.level],e=this._lodInfos.indexOf(l)-1;return e<0?null:(this._getTileIdAtLOD(u,this._lodInfos[e],u),u.id)}getTileResolution(t){const l=this._infoByLevel[typeof t=="object"?t.level:t];return l?l.resolution:-1}getTileScale(t){const l=this._infoByLevel[t.level];return l?l.scale:-1}intersects(t,l){u.set(l);const e=this._infoByLevel[u.level],i=t.lodInfo;if(i.resolution>e.resolution){this._getTileIdAtLOD(u,i,u);const h=i.denormalizeCol(u.col,u.world);for(const r of t.spans)if(r.row===u.row&&r.colFrom<=h&&r.colTo>=h)return!0}if(i.resolution(I[0]=Math.min(I[0],g.row),I[1]=Math.max(I[1],g.row),I[2]=Math.min(I[2],g.colFrom),I[3]=Math.max(I[3],g.colTo),I),[1/0,-1/0,1/0,-1/0]),c=e.denormalizeCol(u.col,u.world),T=i.getColumnForX(e.getXForColumn(c)),m=i.getRowForY(e.getYForRow(u.row)),A=i.getColumnForX(e.getXForColumn(c+1))-1,S=i.getRowForY(e.getYForRow(u.row+1))-1;return!(T>a||Ar||Sh.row===u.row&&h.colFrom<=s&&h.colTo>=s)}normalizeBounds(t,l,e){if(t[0]=l[0],t[1]=l[1],t[2]=l[2],t[3]=l[3],this._wrap){const i=z(this.tileInfo.spatialReference),s=-e*(i.valid[1]-i.valid[0]);t[0]+=s,t[2]+=s}return t}getSmallestInfoForScale(t){const l=this.scales;if(this._infoByScale[t])return this._infoByScale[t];if(t>l[0])return this._infoByScale[l[0]];for(let e=1;el[e]+X)return this._infoByScale[l[e-1]];return this._infoByScale[l[l.length-1]]}getClosestInfoForScale(t){const l=this.scales;return this._infoByScale[t]||(t=l.reduce((e,i)=>Math.abs(i-t)=0;e--)if(tthis._fetchService(r))),Promise.resolve(this)}get attributionDataUrl(){var r;const e=(r=this.parsedUrl)==null?void 0:r.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){return(e=e||r.tileInfo&&r.tileInfo.spatialReference)&&v.fromJSON(e)}writeSublayers(e,r,t,s){if(!this.loaded||!e)return;const p=e.slice().reverse().flatten(({sublayers:l})=>l&&l.toArray().reverse()).toArray(),n=[],c={writeSublayerStructure:!1,...s};p.forEach(l=>{const d=l.write({},c);n.push(d)}),n.some(l=>Object.keys(l).length>1)&&(r.layers=n)}get tileServers(){var e;return this._getDefaultTileServers((e=this.parsedUrl)==null?void 0:e.path)}castTileServers(e){return Array.isArray(e)?e.map(r=>O(r).path):null}fetchTile(e,r,t,s={}){const{signal:p}=s,n=this.getTileUrl(e,r,t),c={responseType:"image",signal:p,query:{...this.refreshParameters}};return u(n,c).then(l=>l.data)}async fetchImageBitmapTile(e,r,t,s={}){const{signal:p}=s;if(this.fetchTile!==m.prototype.fetchTile){const d=await this.fetchTile(e,r,t,s);return y(d,e,r,t,p)}const n=this.getTileUrl(e,r,t),c={responseType:"blob",signal:p,query:{...this.refreshParameters}},{data:l}=await u(n,c);return y(l,e,r,t,p)}getTileUrl(e,r,t){var c,l;const s=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,p=$({...(c=this.parsedUrl)==null?void 0:c.query,blankTile:!s&&null,...this.customParameters,token:this.apiKey}),n=this.tileServers;return`${n&&n.length?n[r%n.length]:(l=this.parsedUrl)==null?void 0:l.path}/tile/${e}/${r}/${t}${p?"?"+p:""}`}loadAll(){return R(this,e=>{e(this.allSublayers)})}_fetchService(e){return new Promise((r,t)=>{if(this.sourceJSON){if(this.sourceJSON.bandCount!=null&&this.sourceJSON.pixelSizeX!=null)throw new h("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void r({data:this.sourceJSON})}if(!this.parsedUrl)throw new h("tile-layer:undefined-url","layer's url is not defined");const s=W(this.parsedUrl.path);if(s!=null&&s.serverType==="ImageServer")throw new h("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");u(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r,t)}).then(r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),this.version===10.1&&!j(t))return this._fetchServerVersion(t,e).then(s=>{this.read({currentVersion:s})}).catch(()=>{})})}_fetchServerVersion(e,r){if(!U(e))return Promise.reject();const t=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return u(t,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(s=>{if(s.data&&s.data.currentVersion)return s.data.currentVersion;throw new h("tile-layer:version-not-available")})}_getMapName(e){const r=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/mapserver/i);return r?r[2]:void 0}_getDefaultAttribution(e){if(e==null)return null;let r;e=e.toLowerCase();for(let t=0,s=f.length;t({enabled:!1})}}})],i.prototype,"isReference",void 0),a([o({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],i.prototype,"operationalLayerType",void 0),a([o({type:Boolean})],i.prototype,"resampling",void 0),a([o()],i.prototype,"sourceJSON",void 0),a([o({type:v})],i.prototype,"spatialReference",void 0),a([P("spatialReference",["spatialReference","tileInfo"])],i.prototype,"readSpatialReference",null),a([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],i.prototype,"path",void 0),a([o({readOnly:!0})],i.prototype,"sublayers",void 0),a([A("sublayers",{layers:{type:[q]}})],i.prototype,"writeSublayers",null),a([o({json:{read:!1,write:!1}})],i.prototype,"popupEnabled",void 0),a([o()],i.prototype,"tileServers",null),a([B("tileServers")],i.prototype,"castTileServers",null),a([o({readOnly:!0,json:{read:!1}})],i.prototype,"type",void 0),a([o(K)],i.prototype,"url",void 0),i=m=a([M("esri.layers.TileLayer")],i);const g=Symbol("default-fetch-tile");i.prototype.fetchTile[g]=!0;const ke=i;export{ke as default}; diff --git a/assets/TileLayerView3D-844ae299.js b/assets/TileLayerView3D-844ae299.js new file mode 100644 index 0000000..3c65195 --- /dev/null +++ b/assets/TileLayerView3D-844ae299.js @@ -0,0 +1 @@ +import{aB as a,ar as o,ai as r,aj as s,al as p}from"./index-080e108a.js";import{n}from"./LayerView3D-ffd35809.js";import{o as h}from"./TiledLayerView3D-a11f8026.js";import{d as u}from"./LayerView-448bc5ea.js";import{a as m}from"./RefreshableLayerView-915e7f53.js";import{S as f,U as y}from"./MapServiceLayerViewHelper-fdadc63a.js";import{r as d}from"./drapedUtils-909caa2b.js";import"./floorFilterUtils-080a7cd2.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./sql-734ecbc5.js";import"./sublayerUtils-1269bca6.js";import"./popupUtils-f04ec9a9.js";let t=class extends m(h(n(u))){constructor(){super(...arguments),this.type="tile-3d",this._popupHighlightHelper=null}get imageFormatIsOpaque(){return this.layer.tileInfo.format==="jpg"}get hasMixedImageFormats(){return this.layer.tileInfo.format==="mixed"}get tileInfo(){return this.layer.tileInfo}initialize(){if(this.layer.type==="web-tile"){const e=this.layer.get("fullExtent.spatialReference"),i=this.layer.get("tileInfo.spatialReference");if(e==null||i==null||!a(e,i)){const l=this.layer.originOf("fullExtent")==="defaults"||this.layer.fullExtent==null?"SceneView requires fullExtent to be specified by the user on WebTileLayer":"SceneView requires fullExtent to be specified in the same spatial reference as tileInfo on WebTileLayer";this.addResolvingPromise(Promise.reject(new o("layerview:incompatible-fullextent",l)))}}f(this,this.layer)&&(this._popupHighlightHelper=new y({createFetchPopupFeaturesQueryGeometry:(e,i)=>d(e,i,this.view),layerView:this,updatingHandles:this.updatingHandles})),this._addTilingSchemeMatchPromise()}destroy(){var e;(e=this._popupHighlightHelper)==null||e.destroy()}async fetchPopupFeatures(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeatures(e,i):[]}async doRefresh(){this.suspended||this.emit("data-changed")}};r([s()],t.prototype,"imageFormatIsOpaque",null),r([s()],t.prototype,"hasMixedImageFormats",null),r([s()],t.prototype,"layer",void 0),r([s()],t.prototype,"tileInfo",null),t=r([p("esri.views.3d.layers.TileLayerView3D")],t);const R=t;export{R as default}; diff --git a/assets/TileTreeDebugger-142b9f39.js b/assets/TileTreeDebugger-142b9f39.js new file mode 100644 index 0000000..2f0cdb2 --- /dev/null +++ b/assets/TileTreeDebugger-142b9f39.js @@ -0,0 +1 @@ +import{ai as n,ao as $,bg as M,aK as f,bh as P,bi as j,bj as x,bk as O,aj as p,al as k,bl as z}from"./index-080e108a.js";const A=[[0,179,255],[117,62,128],[0,104,255],[215,189,166],[32,0,193],[98,162,206],[102,112,129],[52,125,0],[142,118,246],[138,83,0],[92,122,255],[122,55,83],[0,142,255],[81,40,179],[0,200,244],[13,24,127],[0,170,147],[19,58,241],[22,44,35]];let a=class extends ${constructor(s){super(s),this.updating=!1,this.enablePolygons=!0,this.enableLabels=!0,this._polygons=new Map,this._labels=new Map,this._enabled=!0}initialize(){this._symbols=A.map(s=>new M({color:[s[0],s[1],s[2],.6],outline:{color:"black",width:1}})),this.update()}destroy(){this._enabled=!1,this.clear()}get enabled(){return this._enabled}set enabled(s){this._enabled!==s&&(this._enabled=s,this.update())}update(){if(!this._enabled)return void this.clear();const s=e=>{if(e.label!=null)return e.label;let l=e.lij.toString();return e.loadPriority!=null&&(l+=` (${e.loadPriority})`),l},h=this.getTiles(),y=new Array,g=new Set((this._labels.size,this._labels.keys()));h.forEach((e,l)=>{const t=e.lij.toString();g.delete(t);const S=e.lij[0],d=e.geometry;if(this.enablePolygons&&!this._polygons.has(t)){const i=new f({geometry:d,symbol:this._symbols[S%this._symbols.length]});this._polygons.set(t,i),y.push(i)}if(this.enableLabels){const i=s(e),u=l/(h.length-1),c=z(0,200,u),_=z(20,6,u)/.75,m=e.loadPriority!=null&&e.loadPriority>=h.length,w=new P([c,m?0:c,m?0:c]),v=this.view.type==="3d"?()=>new j({verticalOffset:{screenLength:40/.75},callout:{type:"line",color:"white",border:{color:"black"}},symbolLayers:[new x({text:i,halo:{color:"white",size:1/.75},material:{color:w},size:_})]}):()=>new O({text:i,haloColor:"white",haloSize:1/.75,color:w,size:_}),r=this._labels.get(t);if(r){const o=v();r.symbol!=null&&JSON.stringify(o)===JSON.stringify(r.symbol)||(r.symbol=o)}else{const o=new f({geometry:d.extent.center,symbol:v()});this._labels.set(t,o),y.push(o)}}});const b=new Array;g.forEach(e=>{const l=this._polygons.get(e);l!=null&&(b.push(l),this._polygons.delete(e));const t=this._labels.get(e);t!=null&&(b.push(t),this._labels.delete(e))}),this.view.graphics.removeMany(b),this.view.graphics.addMany(y)}clear(){this.view.graphics.removeMany(Array.from(this._polygons.values())),this.view.graphics.removeMany(Array.from(this._labels.values())),this._polygons.clear(),this._labels.clear()}};n([p({constructOnly:!0})],a.prototype,"view",void 0),n([p({readOnly:!0})],a.prototype,"updating",void 0),n([p()],a.prototype,"enabled",null),a=n([k("esri.views.support.TileTreeDebugger")],a);export{a as y}; diff --git a/assets/TiledLayerView3D-a11f8026.js b/assets/TiledLayerView3D-a11f8026.js new file mode 100644 index 0000000..c7d12fe --- /dev/null +++ b/assets/TiledLayerView3D-a11f8026.js @@ -0,0 +1 @@ +import{ai as r,aj as n,aL as u,cV as g,al as d,ar as o,cT as f,cW as y}from"./index-080e108a.js";const w=p=>{let i=class extends p{get imageFormatIsOpaque(){return!1}get fullExtent(){return this.layer.fullExtent}get isOpaque(){return this.fullOpacity>=1&&this.imageFormatIsOpaque}get dataScaleRange(){const e=this.tileInfo.lods;let a=e[0].scale,t=e[e.length-1].scale;if("tilemapCache"in this.layer&&this.layer.tilemapCache){const{effectiveMinLOD:l,effectiveMaxLOD:s}=this.layer.tilemapCache;a=this.tileInfo.lodAt(l).scale,t=this.tileInfo.lodAt(s).scale}return{minScale:a,maxScale:t}}get dataLevelRange(){const{minScale:e,maxScale:a}=this.dataScaleRange;return this.levelRangeFromScaleRange(e,a)}get displayLevelRange(){const e=this.layer.minScale||this.dataScaleRange.minScale,a=this.layer.maxScale||this.dataScaleRange.maxScale,t=this.levelRangeFromScaleRange(e,a);return this.layer.maxScale&&t.maxLevel++,t}getTileUrl(e,a,t){return this.layer.getTileUrl(e,a,t)}_addTilingSchemeMatchPromise(){if(this.fullExtent==null)return this.addResolvingPromise(Promise.reject(new o("tilingscheme:extent-not-defined","This layer doesn't define a fullExtent.")));const e=this._getTileInfoSupportError(this.tileInfo,this.fullExtent);if(e!=null)return this.addResolvingPromise(Promise.reject(e));const a=f(()=>{var t,l;return(l=(t=this.view)==null?void 0:t.basemapTerrain)==null?void 0:l.tilingSchemeLocked}).then(()=>{const t=this.view.basemapTerrain.tilingScheme,l=this._getTileInfoCompatibilityError(this.tileInfo,t);if(l)throw l});this.addResolvingPromise(a)}_getTileInfoSupportError(e,a){const t=y(e,a,this.view.spatialReference,this.view.state.viewingMode);if(t){const l={layer:this.layer,error:t};let s;switch(t.name){case"tilingscheme:spatial-reference-mismatch":case"tilingscheme:global-unsupported-spatial-reference":case"tilingscheme:local-unsupported-spatial-reference":s=new o("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",l);break;default:s=new o("layerview:tiling-scheme-unsupported","The tiling scheme of this layer is not supported by SceneView",l)}return s}return null}_getTileInfoCompatibilityError(e,a){return e!=null&&a.compatibleWith(e)?null:new o("layerview:tiling-scheme-incompatible","The tiling scheme of this layer is incompatible with the tiling scheme of the surface")}levelRangeFromScaleRange(e,a){const t={minLevel:0,maxLevel:1/0},l=this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.tilingScheme;if(!l)return t;const s=l.levels[0],h=m=>{const c=Math.log(s.scale/m)/Math.LN2;return .5-Math.abs(.5-c%1)<1e-9?Math.round(c):Math.ceil(c)};return e!=null&&e>0&&(t.minLevel=Math.max(0,h(e))),a!=null&&a>0&&(t.maxLevel=Math.max(0,h(a))),t}isUpdating(){return!!(this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.updating)}};return r([n({readOnly:!0})],i.prototype,"imageFormatIsOpaque",null),r([n({readOnly:!0})],i.prototype,"updating",void 0),r([n(u)],i.prototype,"updatingProgress",void 0),r([n(g)],i.prototype,"updatingProgressValue",void 0),r([n()],i.prototype,"fullExtent",null),r([n({readOnly:!0})],i.prototype,"isOpaque",null),r([n()],i.prototype,"dataScaleRange",null),r([n({readOnly:!0})],i.prototype,"dataLevelRange",null),r([n({readOnly:!0})],i.prototype,"displayLevelRange",null),r([n()],i.prototype,"layer",void 0),r([n()],i.prototype,"tileInfo",void 0),i=r([d("esri.views.3d.layers.TiledLayerView3D")],i),i};export{w as o}; diff --git a/assets/TilemapCache-67ada3c3.js b/assets/TilemapCache-67ada3c3.js new file mode 100644 index 0000000..c6b6b4f --- /dev/null +++ b/assets/TilemapCache-67ada3c3.js @@ -0,0 +1 @@ +import{i2 as A,cl as D,i3 as S,at as O,i4 as z,ar as m,bN as q,ai as d,aj as y,ao as L,bx as x,cb as P,aG as M,ag as C,g9 as E,bn as _,i5 as I,aP as U,av as j,al as k,fL as N,aS as J,fJ as F}from"./index-080e108a.js";function H(e,i=!1){return e<=A?i?new Array(e).fill(0):new Array(e):new Uint32Array(e)}class w{constructor(i){this._validateJSON(i);const{location:a,data:t}=i;this.location=Object.freeze(D(a));const l=this.location.width,n=this.location.height;let o=!0,r=!0;const c=Math.ceil(l*n/32),s=H(c);let h=0;for(let f=0;f>5,o=this._availability;return n<0||n>o.length?"unknown":o[n]&1<s.data).catch(s=>{if(s&&s.details&&s.details.httpStatus===422)return{location:{top:l,left:n,width:o,height:r},valid:!0,data:z(o*r,0)};throw s}).then(s=>{if(s.location&&(s.location.top!==l||s.location.left!==n||s.location.width!==o||s.location.height!==r))throw new m("tilemap:location-mismatch","Tilemap response for different location than requested",{response:s,definition:{top:l,left:n,width:o,height:r}});return w.fromJSON(s)})}static fromJSON(i){return Object.freeze(new w(i))}_validateJSON(i){if(!i||!i.location)throw new m("tilemap:missing-location","Location missing from tilemap response");if(i.valid===!1)throw new m("tilemap:invalid","Tilemap response was marked as invalid");if(!i.data)throw new m("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(i.data))throw new m("tilemap:data-mismatch","Data must be an array of numbers");if(i.data.length!==i.location.width*i.location.height)throw new m("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}}function $(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function R(e){var t;let i;if((t=e.service.tileServers)!=null&&t.length){const l=e.service.tileServers;i=`${l&&l.length?l[e.row%l.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else i=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const a=e.service.query;return a&&(i=`${i}?${a}`),i}var u;let p=u=class extends L{constructor(e){super(e),this._pendingTilemapRequests={},this.request=O,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new x(2*P.MEGABYTES),this.addHandles([M(()=>{const{layer:e}=this;return[e==null?void 0:e.parsedUrl,e==null?void 0:e.tileServers,e==null?void 0:e.apiKey,e==null?void 0:e.customParameters]},()=>this._initializeTilemapDefinition(),C)])}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}fetchTilemap(e,i,a,t){if(!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD)return Promise.reject(new m("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const l=this._tmpTilemapDefinition,n=this._tilemapFromCache(e,i,a,l);if(n)return Promise.resolve(n);const o=t&&t.signal;return t={...t,signal:null},new Promise((r,c)=>{E(o,()=>c(N()));const s=$(l);let h=this._pendingTilemapRequests[s];if(!h){h=w.fromDefinition(l,t).then(v=>(this._tilemapCache.put(s,v,v.byteSize),v));const f=()=>delete this._pendingTilemapRequests[s];this._pendingTilemapRequests[s]=h,h.then(f,f)}h.then(r,c)})}getAvailability(e,i,a){if(!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD)return"unavailable";const t=this._tilemapFromCache(e,i,a,this._tmpTilemapDefinition);return t?t.getAvailability(i,a):"unknown"}fetchAvailability(e,i,a,t){return!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD?Promise.reject(new m("tile-map:tile-unavailable","Tile is not available",{level:e,row:i,col:a})):this.fetchTilemap(e,i,a,t).catch(l=>l).then(l=>{if(l instanceof w){const n=l.getAvailability(i,a);if(n==="unavailable")throw new m("tile-map:tile-unavailable","Tile is not available",{level:e,row:i,col:a});return n}if(_(l))throw l;return"unknown"})}fetchAvailabilityUpsample(e,i,a,t,l){t.level=e,t.row=i,t.col=a;const n=this.layer.tileInfo;n.updateTileInfo(t);const o=this.fetchAvailability(e,i,a,l).catch(r=>{if(_(r))throw r;if(n.upsampleTile(t))return this.fetchAvailabilityUpsample(t.level,t.row,t.col,t,l);throw r});return this._fetchAvailabilityUpsamplePrefetch(t.id,e,i,a,l,o),o}async _fetchAvailabilityUpsamplePrefetch(e,i,a,t,l,n){if(!this._prefetchingEnabled||e==null)return;const o=`prefetch-${e}`;if(this.hasHandles(o))return;const r=new AbortController;n.then(()=>r.abort(),()=>r.abort());let c=!1;const s=J(()=>{c||(c=!0,r.abort())});if(this.addHandles(s,o),await I(10,r.signal).catch(()=>{}),c||(c=!0,this.removeHandles(o)),U(r))return;const h=new F(e,i,a,t),f={...l,signal:r.signal},v=this.layer.tileInfo;for(let T=0;u._prefetches.length{u._prefetches.removeUnordered(b)};b.then(g,g)}}_initializeTilemapDefinition(){var t;if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:i,customParameters:a}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:j({...e.query,...a,token:i??((t=e.query)==null?void 0:t.token)}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,i,a,t){t.level=e,t.row=i-i%this.size,t.col=a-a%this.size;const l=$(t);return this._tilemapCache.get(l)}get test(){const e=this;return{get prefetchingEnabled(){return e._prefetchingEnabled},set prefetchingEnabled(i){e._prefetchingEnabled=i},hasTilemap:(i,a,t)=>!!e._tilemapFromCache(i,a,t,e._tmpTilemapDefinition)}}};p._maxPrefetch=4,p._prefetches=new q({initialSize:u._maxPrefetch}),d([y({constructOnly:!0})],p.prototype,"layer",void 0),d([y({constructOnly:!0})],p.prototype,"minLOD",void 0),d([y({constructOnly:!0})],p.prototype,"maxLOD",void 0),d([y({constructOnly:!0})],p.prototype,"request",void 0),d([y({constructOnly:!0})],p.prototype,"size",void 0),p=u=d([k("esri.layers.support.TilemapCache")],p);export{p as T}; diff --git a/assets/TopFeaturesQuery-e44d05be.js b/assets/TopFeaturesQuery-e44d05be.js new file mode 100644 index 0000000..e5e988e --- /dev/null +++ b/assets/TopFeaturesQuery-e44d05be.js @@ -0,0 +1 @@ +import{ai as t,aj as i,al as u,ck as y,cp as c,cr as h,cs as v,bc as m,bY as p,cR as w,cj as S,cl as j}from"./index-080e108a.js";var o;let s=o=class extends y{constructor(r){super(r),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new o({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};t([i({type:[String],json:{write:!0}})],s.prototype,"groupByFields",void 0),t([i({type:Number,json:{write:!0}})],s.prototype,"topCount",void 0),t([i({type:[String],json:{write:!0}})],s.prototype,"orderByFields",void 0),s=o=t([u("esri.rest.support.TopFilter")],s);const R=s;var n;const a=new c({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new c({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let e=n=class extends y{constructor(r){super(r),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(r,l){l.resultOffset=this.start,l.resultRecordCount=this.num||10}clone(){return new n(j({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};t([i({type:Boolean,json:{write:!0}})],e.prototype,"cacheHint",void 0),t([i({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],e.prototype,"distance",void 0),t([i({types:h,json:{read:v,write:!0}})],e.prototype,"geometry",void 0),t([i({type:Number,json:{write:!0}})],e.prototype,"geometryPrecision",void 0),t([i({type:Number,json:{write:!0}})],e.prototype,"maxAllowableOffset",void 0),t([i({type:Number,json:{read:{source:"resultRecordCount"}}})],e.prototype,"num",void 0),t([i({json:{write:!0}})],e.prototype,"objectIds",void 0),t([i({type:[String],json:{write:!0}})],e.prototype,"orderByFields",void 0),t([i({type:[String],json:{write:!0}})],e.prototype,"outFields",void 0),t([i({type:m,json:{read:{source:"outSR"},write:{target:"outSR"}}})],e.prototype,"outSpatialReference",void 0),t([i({type:String,json:{write:!0}})],e.prototype,"resultType",void 0),t([i({json:{write:!0}})],e.prototype,"returnGeometry",void 0),t([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],e.prototype,"returnM",void 0),t([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],e.prototype,"returnZ",void 0),t([i({type:Number,json:{read:{source:"resultOffset"}}})],e.prototype,"start",void 0),t([p("start"),p("num")],e.prototype,"writeStart",null),t([i({type:String,json:{read:{source:"spatialRel",reader:a.read},write:{target:"spatialRel",writer:a.write}}})],e.prototype,"spatialRelationship",void 0),t([i({type:w,json:{write:!0}})],e.prototype,"timeExtent",void 0),t([i({type:R,json:{write:!0}})],e.prototype,"topFilter",void 0),t([i({type:String,json:{read:d.read,write:{writer:d.write,overridePolicy(r){return{enabled:r!=null&&this.distance!=null&&this.distance>0}}}}})],e.prototype,"units",void 0),t([i({type:String,json:{write:!0}})],e.prototype,"where",void 0),e=n=t([u("esri.rest.support.TopFeaturesQuery")],e),e.from=S(e);const g=e;export{g as S}; diff --git a/assets/TurboLine-aac2edf4.js b/assets/TurboLine-aac2edf4.js new file mode 100644 index 0000000..44b4989 --- /dev/null +++ b/assets/TurboLine-aac2edf4.js @@ -0,0 +1 @@ +import{cn as bt,aw as wt,hf as Rt,hg as $,hh as D}from"./index-080e108a.js";import{$ as pt}from"./definitions-0bc08d4c.js";const Mt=128e3;let dt=null,mt=null;async function At(){return dt||(dt=Ut()),dt}async function Ut(){mt=await(bt("esri-csp-restrictions")?await wt(()=>import("./libtess-asm-990bba69.js"),["assets/libtess-asm-990bba69.js","assets/index-080e108a.js","assets/index-a8e73b5e.css"]).then(i=>i.l):await wt(()=>import("./libtess-61f6382d.js"),["assets/libtess-61f6382d.js","assets/index-080e108a.js","assets/index-a8e73b5e.css"]).then(i=>i.l)).load({locateFile:i=>Rt(`esri/core/libs/libtess/${i}`)})}function Ot(r,i){const x=Math.max(r.length,Mt);return mt.triangulate(r,i,x)}function Vt(r,i){return r.x===i.x&&r.y===i.y}function kt(r){if(!r)return;const i=r.length;if(i<=1)return;let x=0;for(let g=1;gg){I=!0;const t=(g-N)/w;w=g-N,W=(1-t)*C+t*W,X=(1-t)*F+t*X,--j}const o=this._writeVertex(C,F,0,0,b,v,v,-b,0,-1,N),y=this._writeVertex(C,F,0,0,b,v,-v,b,0,1,N);N+=w;const G=this._writeVertex(W,X,0,0,b,v,v,-b,0,-1,N),e=this._writeVertex(W,X,0,0,b,v,-v,b,0,1,N);this._writeTriangle(o,y,G),this._writeTriangle(y,G,e),C=W,F=X}}_tessellate(i,x){const g=i[0],N=i[i.length-1],I=Vt(g,N),C=I?3:2;if(i.length{const O=Et(o,y,_,c,H,m,p,st,L,A,l);return u>=0&&h>=0&&O>=0&&Nt(u,h,O),u=h,h=O,O};I&&(w=i[i.length-2],t.x=N.x-w.x,t.y=N.y-w.y,Q=ft(t),t.x/=Q,t.y/=Q);let Y=!1;for(let p=0;p_t&&(Y=!0)),Y){const n=(_t-l)/K;K=_t-l,w={x:(1-n)*w.x+n*i[p].x,y:(1-n)*w.y+n*i[p].y},--p}else w=i[p];o=w.x,y=w.y;const st=p<=0&&!Y,H=p===i.length-1;if(st||(l+=K),G=H?I?i[1]:null:i[p+1],G?(t.x=G.x-o,t.y=G.y-y,Q=ft(t),t.x/=Q,t.y/=Q):(t.x=void 0,t.y=void 0),!I){if(st){R(s,t),_=s.x,c=s.y,B===$.SQUARE&&(d(-t.y-t.x,t.x-t.y,t.x,t.y,0,-1),d(t.y-t.x,-t.x-t.y,t.x,t.y,0,1)),B===$.ROUND&&(d(-t.y-t.x,t.x-t.y,t.x,t.y,-1,-1),d(t.y-t.x,-t.x-t.y,t.x,t.y,-1,1)),B!==$.ROUND&&B!==$.BUTT||(d(-t.y,t.x,t.x,t.y,0,-1),d(t.y,-t.x,t.x,t.y,0,1));continue}if(H){k(s,e),_=s.x,c=s.y,B!==$.ROUND&&B!==$.BUTT||(d(e.y,-e.x,-e.x,-e.y,0,-1),d(-e.y,e.x,-e.x,-e.y,0,1)),B===$.SQUARE&&(d(e.y-e.x,-e.x-e.y,-e.x,-e.y,0,-1),d(-e.y-e.x,e.x-e.y,-e.x,-e.y,0,1)),B===$.ROUND&&(d(e.y-e.x,-e.x-e.y,-e.x,-e.y,1,-1),d(-e.y-e.x,e.x-e.y,-e.x,-e.y,1,1));continue}}let m,L,A=-Bt(e,t);if(Math.abs(A)<.01)gt(e,t)>0?(s.x=e.x,s.y=e.y,A=1,m=Number.MAX_VALUE,L=!0):(R(s,t),A=1,m=1,L=!1);else{s.x=(e.x+t.x)/A,s.y=(e.y+t.y)/A,m=ft(s);const n=(m-1)*b*F;L=m>4||n>K&&n>Q}_=s.x,c=s.y;let O=j;switch(j){case D.BEVEL:m<1.05&&(O=D.MITER);break;case D.ROUND:mW&&(O=D.BEVEL)}switch(O){case D.MITER:if(d(s.x,s.y,-e.x,-e.y,0,-1),d(-s.x,-s.y,-e.x,-e.y,0,1),H)break;if(v){const n=Y?0:l;u=this._writeVertex(o,y,_,c,t.x,t.y,s.x,s.y,0,-1,n),h=this._writeVertex(o,y,_,c,t.x,t.y,-s.x,-s.y,0,1,n)}break;case D.BEVEL:{const n=A<0;let T,V,q,M;if(n){const a=u;u=h,h=a,T=xt,V=nt}else T=nt,V=xt;if(L)q=n?R(this._innerPrev,e):k(this._innerPrev,e),M=n?k(this._innerNext,t):R(this._innerNext,t);else{const a=n?vt(this._inner,s):Tt(this._inner,s);q=a,M=a}const U=n?k(this._bevelStart,e):R(this._bevelStart,e);d(q.x,q.y,-e.x,-e.y,T.x,T.y);const yt=d(U.x,U.y,-e.x,-e.y,V.x,V.y);if(H)break;const P=n?R(this._bevelEnd,t):k(this._bevelEnd,t);if(L){const a=this._writeVertex(o,y,_,c,-e.x,-e.y,0,0,0,0,l);u=this._writeVertex(o,y,_,c,t.x,t.y,M.x,M.y,T.x,T.y,l),h=this._writeVertex(o,y,_,c,t.x,t.y,P.x,P.y,V.x,V.y,l),this._writeTriangle(yt,a,h)}else{if(v){const a=this._bevelMiddle;a.x=(U.x+P.x)/2,a.y=(U.y+P.y)/2,et(f,a,-e.x,-e.y),d(a.x,a.y,-e.x,-e.y,f.x,f.y),et(f,a,t.x,t.y),u=this._writeVertex(o,y,_,c,t.x,t.y,a.x,a.y,f.x,f.y,l),h=this._writeVertex(o,y,_,c,t.x,t.y,M.x,M.y,T.x,T.y,l)}else{const a=u;u=h,h=a}d(P.x,P.y,t.x,t.y,V.x,V.y)}if(n){const a=u;u=h,h=a}break}case D.ROUND:{const n=A<0;let T,V;if(n){const E=u;u=h,h=E,T=xt,V=nt}else T=nt,V=xt;const q=n?vt(this._inner,s):Tt(this._inner,s);let M,U;L?(M=n?R(this._innerPrev,e):k(this._innerPrev,e),U=n?k(this._innerNext,t):R(this._innerNext,t)):(M=q,U=q);const yt=n?k(this._roundStart,e):R(this._roundStart,e),P=n?R(this._roundEnd,t):k(this._roundEnd,t),a=d(M.x,M.y,-e.x,-e.y,T.x,T.y),ot=d(yt.x,yt.y,-e.x,-e.y,V.x,V.y);if(H)break;const z=this._writeVertex(o,y,_,c,-e.x,-e.y,0,0,0,0,l);L||this._writeTriangle(u,h,z);const S=vt(this._outer,q),J=this._writeVertex(o,y,_,c,t.x,t.y,P.x,P.y,V.x,V.y,l);let Z,tt;const ht=m>2;if(ht){let E;m!==Number.MAX_VALUE?(S.x/=m,S.y/=m,E=gt(e,S),E=(m*(E*E-1)+1)/E):E=-1,Z=n?k(this._startBreak,e):R(this._startBreak,e),Z.x+=e.x*E,Z.y+=e.y*E,tt=n?R(this._endBreak,t):k(this._endBreak,t),tt.x+=t.x*E,tt.y+=t.y*E}et(f,S,-e.x,-e.y);const lt=this._writeVertex(o,y,_,c,-e.x,-e.y,S.x,S.y,f.x,f.y,l);et(f,S,t.x,t.y);const ct=v?this._writeVertex(o,y,_,c,t.x,t.y,S.x,S.y,f.x,f.y,l):lt,ut=z,at=v?this._writeVertex(o,y,_,c,t.x,t.y,0,0,0,0,l):z;let it=-1,rt=-1;if(ht&&(et(f,Z,-e.x,-e.y),it=this._writeVertex(o,y,_,c,-e.x,-e.y,Z.x,Z.y,f.x,f.y,l),et(f,tt,t.x,t.y),rt=this._writeVertex(o,y,_,c,t.x,t.y,tt.x,tt.y,f.x,f.y,l)),v?ht?(this._writeTriangle(ut,ot,it),this._writeTriangle(ut,it,lt),this._writeTriangle(at,ct,rt),this._writeTriangle(at,rt,J)):(this._writeTriangle(ut,ot,lt),this._writeTriangle(at,ct,J)):ht?(this._writeTriangle(z,ot,it),this._writeTriangle(z,it,rt),this._writeTriangle(z,rt,J)):(this._writeTriangle(z,ot,lt),this._writeTriangle(z,ct,J)),L?(u=this._writeVertex(o,y,_,c,t.x,t.y,U.x,U.y,T.x,T.y,l),h=J):(u=v?this._writeVertex(o,y,_,c,t.x,t.y,U.x,U.y,T.x,T.y,l):a,this._writeTriangle(u,at,J),h=J),n){const E=u;u=h,h=E}break}}}}}export{Pt as c,At as i,Ot as r}; diff --git a/assets/UniqueValueRenderer-fef4204d.js b/assets/UniqueValueRenderer-fef4204d.js new file mode 100644 index 0000000..6031b4b --- /dev/null +++ b/assets/UniqueValueRenderer-fef4204d.js @@ -0,0 +1 @@ +import{ai as i,aj as n,ck as z,k_ as G,al as w,cp as ye,cj as te,k$ as le,bz as $,l0 as ie,l1 as oe,cl as c,bA as R,l2 as ae,ko as O,ay as L,bY as H,f4 as W,d2 as ne,l3 as re,l4 as ue,gM as me,jp as pe,cz as X,l5 as D,dZ as ve,ar as be,b9 as J,ho as ge,d8 as Ve,l6 as Ie,l7 as _e,aG as A,l8 as Se}from"./index-080e108a.js";import{a as we}from"./diffUtils-590c9088.js";var Y;let g=Y=class extends z{constructor(e){super(e),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new Y({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const e=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${e}`}};i([n({type:String,json:{write:!0}})],g.prototype,"description",void 0),i([n({type:String,json:{write:!0}})],g.prototype,"label",void 0),i([n({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],g.prototype,"minValue",void 0),i([n({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],g.prototype,"maxValue",void 0),i([n(G)],g.prototype,"symbol",void 0),g=Y=i([w("esri.renderers.support.ClassBreakInfo")],g);const P=g;var Z;const de="log",C="percent-of-total",T="field",M=new ye({esriNormalizeByLog:de,esriNormalizeByPercentOfTotal:C,esriNormalizeByField:T}),qe=te(P);let p=Z=class extends le(pe){constructor(e){super(e),this._compiledValueExpression={valueExpression:null,compiledFunction:null},this.backgroundFillSymbol=null,this.classBreakInfos=null,this.defaultLabel=null,this.defaultSymbol=null,this.field=null,this.isMaxInclusive=!0,this.legendOptions=null,this.normalizationField=null,this.normalizationTotal=null,this.type="class-breaks",this.valueExpression=null,this.valueExpressionTitle=null,this._set("classBreakInfos",[])}readClassBreakInfos(e,s,t){if(!Array.isArray(e))return;let l=s.minValue;return e.map(o=>{const a=new P;return a.read(o,t),a.minValue==null&&(a.minValue=l),a.maxValue==null&&(a.maxValue=a.minValue),l=a.maxValue,a})}writeClassBreakInfos(e,s,t,l){const o=e.map(a=>a.write({},l));this._areClassBreaksConsecutive()&&o.forEach(a=>delete a.classMinValue),s[t]=o}castField(e){return e==null?e:typeof e=="function"?($.getLogger(this).error(".field: field must be a string value"),null):ie(e)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let e=this._get("normalizationType");const s=!!this.normalizationField,t=this.normalizationTotal!=null;return s||t?(e=s&&T||t&&C||null,s&&t&&$.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==T&&e!==C||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}addClassBreakInfo(e,s,t){let l=null;l=typeof e=="number"?new P({minValue:e,maxValue:s,symbol:oe(t)}):qe(c(e)),this.classBreakInfos.push(l),this.classBreakInfos.length===1&&this.notifyChange("minValue")}removeClassBreakInfo(e,s){const t=this.classBreakInfos.length;for(let l=0;l-1?this.classBreakInfos[t].symbol:this.defaultSymbol}async getSymbolAsync(e,s){let t=s;if(this.valueExpression&&(s==null||s.arcade==null)){const o=await R(),{arcadeUtils:a}=o;a.hasGeometryOperations(this.valueExpression)&&await a.enableGeometryOperations(),t={...t,arcade:o}}const l=this.getBreakIndex(e,t);return l>-1?this.classBreakInfos[l].symbol:this.defaultSymbol}getSymbols(){const e=[];return this.classBreakInfos.forEach(s=>{s.symbol&&e.push(s.symbol)}),this.defaultSymbol&&e.push(this.defaultSymbol),e}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,s)=>e+s.getAttributeHash(),"")}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),s=JSON.stringify(this.defaultSymbol),t=`${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;return`${e}.${s}.${this.classBreakInfos.reduce((l,o)=>l+o.getMeshHash(),"")}.${t}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new Z({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol&&this.backgroundFillSymbol.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol&&this.defaultSymbol.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:c(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:c(this.visualVariables),legendOptions:c(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}async collectRequiredFields(e,s){const t=[this.collectVVRequiredFields(e,s),this.collectSymbolFields(e,s)];await Promise.all(t)}async collectSymbolFields(e,s){const t=[...this.getSymbols().map(l=>l.collectRequiredFields(e,s)),ae(e,s,this.valueExpression)];O(e,s,this.field),O(e,s,this.normalizationField),await Promise.all(t)}_getBreakIndexForExpression(e,s){const{viewingMode:t,scale:l,spatialReference:o,arcade:a}=s??{},{valueExpression:r}=this;let d=this._compiledValueExpression.valueExpression===r?this._compiledValueExpression.compiledFunction:null;const h=a.arcadeUtils;if(!d){const I=h.createSyntaxTree(r);d=h.createFunction(I),this._compiledValueExpression.compiledFunction=d}this._compiledValueExpression.valueExpression=r;const f=h.executeFunction(d,h.createExecContext(e,h.getViewInfo({viewingMode:t,scale:l,spatialReference:o})));return this._getBreakIndexfromInfos(f)}_getBreakIndexForField(e){const s=this.field,t=e.attributes,l=this.normalizationType;let o=parseFloat(t[s]);if(l){const a=this.normalizationTotal,r=parseFloat(this.normalizationField?t[this.normalizationField]:void 0);if(l===de)o=Math.log(o)*Math.LOG10E;else if(l!==C||a==null||isNaN(a)){if(l===T&&!isNaN(r)){if(isNaN(o)||isNaN(r))return-1;o/=r}}else o=o/a*100}return this._getBreakIndexfromInfos(o)}_getBreakIndexfromInfos(e){const s=this.isMaxInclusive;if(e!=null&&typeof e=="number"&&!isNaN(e))for(let t=0;tme(e),json:{write:!0}})],p.prototype,"normalizationTotal",void 0),i([n({type:M.apiValues,value:null,json:{type:M.jsonValues,read:M.read,write:M.write}})],p.prototype,"normalizationType",null),i([ne({classBreaks:"class-breaks"})],p.prototype,"type",void 0),i([n({type:String,json:{write:!0}})],p.prototype,"valueExpression",void 0),i([n({type:String,json:{write:!0}})],p.prototype,"valueExpressionTitle",void 0),p=Z=i([w("esri.renderers.ClassBreaksRenderer")],p);const Ue=p;let q=class extends X(z){constructor(s){super(s),this.value=null,this.value2=null,this.value3=null}};i([n(D)],q.prototype,"value",void 0),i([n(D)],q.prototype,"value2",void 0),i([n(D)],q.prototype,"value3",void 0),q=i([w("esri.renderers.support.UniqueValue")],q);const x=q;let V=class extends X(z){constructor(s){super(s),this.description=null,this.label=null,this.symbol=null,this.values=null}castValues(s){if(s==null)return null;const t=typeof(s=Array.isArray(s)?s:[s])[0];return t==="string"||t==="number"?s.map(l=>new x({value:l})):t==="object"?s[0]instanceof x?s:s.map(l=>new x(l)):null}};i([n({type:String,json:{write:!0}})],V.prototype,"description",void 0),i([n({type:String,json:{write:!0}})],V.prototype,"label",void 0),i([n(G)],V.prototype,"symbol",void 0),i([n({type:[x],json:{type:[[String]],read:{reader:e=>e?e.map(s=>new x({value:s[0],value2:s[1],value3:s[2]})):null},write:{writer:(e,s)=>{const t=[];for(const l of e){const o=[l.value,l.value2,l.value3].filter(ve).map(a=>a.toString());t.push(o)}s.values=t}}}})],V.prototype,"values",void 0),i([W("values")],V.prototype,"castValues",null),V=i([w("esri.renderers.support.UniqueValueClass")],V);const he=V;let U=class extends X(z){constructor(e){super(e),this.heading=null,this.classes=null}};i([n({type:String,json:{write:!0}})],U.prototype,"heading",void 0),i([n({type:[he],json:{write:!0}})],U.prototype,"classes",void 0),U=i([w("esri.renderers.support.UniqueValueGroup")],U);const K=U;var Q;let S=Q=class extends z{constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new Q({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const e=JSON.stringify(this.symbol&&this.symbol.toJSON());return`${this.value}.${e}`}};i([n({type:String,json:{write:!0}})],S.prototype,"description",void 0),i([n({type:String,json:{write:!0}})],S.prototype,"label",void 0),i([n(G)],S.prototype,"symbol",void 0),i([n(D)],S.prototype,"value",void 0),S=Q=i([w("esri.renderers.support.UniqueValueInfo")],S);const j=S;var B;const ce="esri.renderers.UniqueValueRenderer",b=$.getLogger(ce),ee="uvInfos-watcher",se="uvGroups-watcher",xe=",",Fe=te(j);function ke(e){const{field1:s,field2:t,field3:l,fieldDelimiter:o,uniqueValueInfos:a,valueExpression:r}=e,d=!(!s||!t);return[{classes:(a??[]).map(h=>{var _;const{symbol:f,label:I,value:y,description:m}=h,[F,k,E]=d?((_=y==null?void 0:y.toString())==null?void 0:_.split(o||""))||[]:[y],v=[];return(s||r)&&v.push(F),t&&v.push(k),l&&v.push(E),{symbol:f,label:I,values:[v],description:m}})}]}let u=B=class extends le(pe){constructor(e){super(e),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.orderByClassesEnabled=!1,this.valueExpressionTitle=null,this.legendOptions=null,this.defaultLabel=null,this.portal=null,this.styleOrigin=null,this.diff={uniqueValueInfos(s,t){if(!s&&!t)return;if(!s||!t)return{type:"complete",oldValue:s,newValue:t};let l=!1;const o={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let a=0;ad.value===t[a].value);r?we(r,t[a])?(o.changed.push({type:"complete",oldValue:r,newValue:t[a]}),l=!0):o.unchanged.push({oldValue:r,newValue:t[a]}):(o.added.push(t[a]),l=!0)}for(let a=0;ar.value===s[a].value)||(o.removed.push(s[a]),l=!0);return l?o:void 0}},this._set("uniqueValueInfos",[]),this._set("uniqueValueGroups",[])}get _cache(){return{compiledFunc:null}}set field(e){this._set("field",e),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(e){return e==null||typeof e=="function"?e:ie(e)}writeField(e,s,t,l){typeof e=="string"?s[t]=e:l&&l.messages?l.messages.push(new be("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):b.error(".field: cannot write field to JSON since it's not a string value")}set field2(e){this._set("field2",e),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(e){this._set("field3",e),this._updateUniqueValues()}set valueExpression(e){this._set("valueExpression",e),this._updateUniqueValues()}set defaultSymbol(e){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",e)}set fieldDelimiter(e){this._set("fieldDelimiter",e),this._updateUniqueValues()}readPortal(e,s,t){return t.portal||J.getDefault()}readStyleOrigin(e,s,t){if(s.styleName)return Object.freeze({styleName:s.styleName});if(s.styleUrl){const l=ge(s.styleUrl,t);return Object.freeze({styleUrl:l})}}writeStyleOrigin(e,s,t,l){e.styleName?s.styleName=e.styleName:e.styleUrl&&(s.styleUrl=Ve(e.styleUrl,l))}set uniqueValueGroups(e){this.styleOrigin?b.error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",e),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(e){this.styleOrigin?b.error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(e,s){var l;if(this.styleOrigin)return void b.error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let t;t=typeof e=="object"?Fe(e):new j({value:e,symbol:oe(s)}),(l=this.uniqueValueInfos)==null||l.push(t),this._valueInfoMap[t.value]=t,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(e){if(this.styleOrigin)return void b.error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const s=this.uniqueValueInfos;if(s){for(let t=0;te+s.getAttributeHash(),"")}getMeshHash(){var l;const e=JSON.stringify(this.backgroundFillSymbol),s=JSON.stringify(this.defaultSymbol),t=(l=this.uniqueValueInfos)==null?void 0:l.reduce((o,a)=>o+a.getMeshHash(),"");return`${e}.${s}.${t}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const e=new B({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:c(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:c(this.visualVariables),legendOptions:c(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),backgroundFillSymbol:c(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(e._isDefaultSymbolDerived=!0),e._set("portal",this.portal);const s=c(this.uniqueValueInfos),t=c(this.uniqueValueGroups);return this.styleOrigin&&(e._set("styleOrigin",Object.freeze(c(this.styleOrigin))),Object.freeze(s),Object.freeze(t)),e._set("uniqueValueInfos",s),e._updateValueInfoMap(),e._set("uniqueValueGroups",t),e._isInfosSource=this._isInfosSource,e._watchUniqueValueInfosAndGroups(),e}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(e,s){const t=[this.collectVVRequiredFields(e,s),this.collectSymbolFields(e,s)];await Promise.all(t)}async collectSymbolFields(e,s){const t=[...this.getSymbols().map(l=>l.collectRequiredFields(e,s)),ae(e,s,this.valueExpression)];O(e,s,this.field),O(e,s,this.field2),O(e,s,this.field3),await Promise.all(t)}populateFromStyle(){return Ie(this.styleOrigin,{portal:this.portal}).then(e=>{var t;const s=[];return this._valueInfoMap={},e&&e.data&&Array.isArray(e.data.items)&&e.data.items.forEach(l=>{const o=new _e({styleUrl:e.styleUrl,styleName:e.styleName,portal:this.portal,name:l.name});this.defaultSymbol||l.name!==e.data.defaultItem||(this.defaultSymbol=o,this._isDefaultSymbolDerived=!0);const a=new j({value:l.name,symbol:o});s.push(a),this._valueInfoMap[l.name]=a}),this._set("uniqueValueInfos",Object.freeze(s)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&((t=this.uniqueValueInfos)!=null&&t.length)&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this})}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",xe)}_updateUniqueValues(){this._isInfosSource!=null&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:e}=this;if(e)for(const s of e)this._valueInfoMap[s.value+""]=s}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(ee);const{uniqueValueInfos:e}=this;if(e){const s=[];for(const t of e)s.push(A(()=>({symbol:t.symbol,value:t.value,label:t.label,description:t.description}),(l,o)=>{l!==o&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(s,ee)}}_watchUniqueValueGroups(){this.removeHandles(se);const{uniqueValueGroups:e}=this;if(e){const s=[];for(const t of e){s.push(A(()=>({classes:t.classes}),(l,o)=>{l!==o&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const l of t.classes??[])s.push(A(()=>({symbol:l.symbol,values:l.values,label:l.label,description:l.description}),(o,a)=>{o!==a&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}))}this.addHandles(s,se)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const e=[],{field:s,field2:t,field3:l,fieldDelimiter:o,uniqueValueGroups:a,valueExpression:r}=this;if(!s&&!r)return this._set("uniqueValueInfos",e),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const d=!(!s||!t);for(const h of a)for(const f of h.classes??[]){const{symbol:I,label:y,values:m,description:F}=f;for(const k of m??[]){const{value:E,value2:v,value3:_}=k,N=[E];t&&N.push(v),l&&N.push(_);const fe=d?N.join(o||""):N[0];e.push(new j({symbol:I,label:y,value:fe,description:F}))}}this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(e=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:s,field2:t,valueExpression:l,fieldDelimiter:o,uniqueValueInfos:a}=this;if(!s&&!l||!a.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const r=!(!s||!t),d=a.map(f=>{var _;const{symbol:I,label:y,value:m,description:F}=f,[k,E,v]=r?((_=m==null?void 0:m.toString())==null?void 0:_.split(o||""))||[]:[m];return new he({symbol:I,label:y,description:F,values:[new x({value:k,value2:E,value3:v})]})}),h=[new K({classes:d})];e&&Object.freeze(h),this._set("uniqueValueGroups",h),this._watchUniqueValueGroups()}_getUniqueValueInfo(e,s){return this.valueExpression?this._getUnqiueValueInfoForExpression(e,s):this._getUnqiueValueInfoForFields(e)}_getUnqiueValueInfoForExpression(e,s){const{viewingMode:t,scale:l,spatialReference:o,arcade:a}=s??{};let r=this._cache.compiledFunc;const d=a.arcadeUtils;if(!r){const f=d.createSyntaxTree(this.valueExpression);r=d.createFunction(f),this._cache.compiledFunc=r}const h=d.executeFunction(r,d.createExecContext(e,d.getViewInfo({viewingMode:t,scale:l,spatialReference:o})));return this._valueInfoMap[h+""]}_getUnqiueValueInfoForFields(e){const s=this.field,t=e.attributes;let l;if(typeof s!="function"&&this.field2){const o=this.field2,a=this.field3,r=[];s&&r.push(t[s]),o&&r.push(t[o]),a&&r.push(t[a]),l=r.join(this.fieldDelimiter||"")}else typeof s=="function"?l=s(e):s&&(l=t[s]);return this._valueInfoMap[l+""]}static fromPortalStyle(e,s){const t=new B(s&&s.properties);t._set("styleOrigin",Object.freeze({styleName:e})),t._set("portal",s&&s.portal||J.getDefault());const l=t.populateFromStyle();return l.catch(o=>{b.error(`#fromPortalStyle('${e}'[, ...])`,"Failed to create unique value renderer from style name",o)}),l}static fromStyleUrl(e,s){const t=new B(s&&s.properties);t._set("styleOrigin",Object.freeze({styleUrl:e}));const l=t.populateFromStyle();return l.catch(o=>{b.error(`#fromStyleUrl('${e}'[, ...])`,"Failed to create unique value renderer from style URL",o)}),l}};i([n({readOnly:!0})],u.prototype,"_cache",null),i([ne({uniqueValue:"unique-value"})],u.prototype,"type",void 0),i([n(re)],u.prototype,"backgroundFillSymbol",void 0),i([n({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],u.prototype,"field",null),i([W("field")],u.prototype,"castField",null),i([H("field")],u.prototype,"writeField",null),i([n({type:String,value:null,json:{write:!0}})],u.prototype,"field2",null),i([n({type:String,value:null,json:{write:!0}})],u.prototype,"field3",null),i([n({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],u.prototype,"orderByClassesEnabled",void 0),i([n({type:String,value:null,json:{write:!0}})],u.prototype,"valueExpression",null),i([n({type:String,json:{write:!0}})],u.prototype,"valueExpressionTitle",void 0),i([n({type:ue,json:{write:!0}})],u.prototype,"legendOptions",void 0),i([n({type:String,json:{write:!0}})],u.prototype,"defaultLabel",void 0),i([n(Se({...G},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],u.prototype,"defaultSymbol",null),i([n({type:String,value:null,json:{write:!0}})],u.prototype,"fieldDelimiter",null),i([n({type:J,readOnly:!0})],u.prototype,"portal",void 0),i([L("portal",["styleName"])],u.prototype,"readPortal",null),i([n({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],u.prototype,"styleOrigin",void 0),i([L("styleOrigin",["styleName","styleUrl"])],u.prototype,"readStyleOrigin",null),i([H("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],u.prototype,"writeStyleOrigin",null),i([n({type:[K],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(e,s,t)=>(s.uniqueValueGroups||ke(s)).map(l=>K.fromJSON(l,t))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],u.prototype,"uniqueValueGroups",null),i([n({type:[j],json:{read:!1,write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],u.prototype,"uniqueValueInfos",null),u=B=i([w(ce)],u);const je=u;export{je as A,P as a,j as n,Ue as w}; diff --git a/assets/UnitNormalizer-818a6664.js b/assets/UnitNormalizer-818a6664.js new file mode 100644 index 0000000..980d9ff --- /dev/null +++ b/assets/UnitNormalizer-818a6664.js @@ -0,0 +1 @@ +import{e as Q}from"./Segment-50129b50.js";import{ar as x,cf as V,kv as g,kw as X,kx as Y,bc as tt,ky as et,dS as nt,gv as st,gu as at,kz as it,kA as rt,kB as G,cZ as D}from"./index-080e108a.js";const gt={readOnly:!0,get(){return Q(this.view)}};var F;(function(t){t[t.Auto=0]="Auto",t[t.Euclidean=1]="Euclidean",t[t.Geodesic=2]="Geodesic"})(F||(F={}));function O(t){if(!t)return null;if(X(t)&&t.wkid){const e=Y[t.wkid];if(e)return e}if(t.wkt){const e=ot(t.wkt);if(e)return e}return null}function ot(t){const e=et.exec(t);if(!e||e.length!==2)return null;const n=e[1].split(",");if(!n||n.length<3)return null;const s=parseFloat(n[1]),a=parseFloat(n[2]);return isNaN(s)||isNaN(a)?null:{a:s,f:a===0?0:1/a}}function ct(t){const e=O(t??tt.WGS84);if(ht(e))return e;const n=e.a*(1-e.f);return Object.assign(e,{b:n,eSq:1-(n/e.a)**2,radius:(2*e.a+n)/3,densificationRatio:1e4/((2*e.a+n)/3)})}function ht(t){return t!=null&&"b"in t&&"eSq"in t&&"radius"in t}function lt(t){return O(t)!==null}function vt(t,e="meters"){if(!t)throw new x("geodesic-lengths:invalid-geometries","the input geometries type is not supported");if(t.some(s=>!lt(s.spatialReference)))throw new x("geodesic-lengths:invalid-spatial-reference","the input geometries spatial reference is not supported");const n=[];for(let s=0;s1e-12&&--q>0);if(q===0){const W=M,Z=Math.acos(Math.sin(m)*Math.sin(r)+Math.cos(m)*Math.cos(r)*Math.cos(v-a))*W,j=v-a,J=Math.sin(j)*Math.cos(r),K=Math.cos(m)*Math.sin(r)-Math.sin(m)*Math.cos(r)*Math.cos(j),L=Math.atan2(J,K);return t.azimuth=L/g,t.distance=Z,t.reverseAzimuth=void 0,t}const p=$*(z*z-o*o)/(o*o),E=p/1024*(256+p*(p*(74-47*p)-128)),C=o*(1+p/16384*(4096+p*(p*(320-175*p)-768)))*(y-E*d*(i+E/4*(A*(2*i*i-1)-E/6*i*(4*d*d-3)*(4*i*i-3)))),H=Math.atan2(l*Math.sin(u),c*R-h*l*Math.cos(u)),I=Math.atan2(c*Math.sin(u),c*R*Math.cos(u)-h*l);return t.azimuth=H/g,t.distance=C,t.reverseAzimuth=I/g,t}function zt(t,e){if(nt(e,0,0,0),t.length>0){for(let n=0;n{i(()=>{const n=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let a="Unknown layer type";n&&(a+=" "+n),o(new y("layer:unknown-layer-type",a,{layerType:n}))})}))}read(r,o){super.read({resourceInfo:r},o)}write(r,o){return null}};s([t({readOnly:!0})],e.prototype,"resourceInfo",void 0),s([t({type:["show","hide"]})],e.prototype,"listMode",void 0),s([t({json:{read:!1},readOnly:!0,value:"unknown"})],e.prototype,"type",void 0),e=s([l("esri.layers.UnknownLayer")],e);const h=e;export{h as default}; diff --git a/assets/UnsupportedLayer-7b99a9d5.js b/assets/UnsupportedLayer-7b99a9d5.js new file mode 100644 index 0000000..52f69ae --- /dev/null +++ b/assets/UnsupportedLayer-7b99a9d5.js @@ -0,0 +1 @@ +import{f5 as p,ai as s,aj as i,al as n,aA as l,ar as u}from"./index-080e108a.js";import{O as d}from"./MultiOriginJSONSupport-e4912ffd.js";import{j as y}from"./PortalLayer-310c2800.js";import"./portalItemUtils-792a27e1.js";let t=class extends y(d(l)){constructor(e){super(e),this.resourceInfo=null,this.type="unsupported"}initialize(){this.addResolvingPromise(new Promise((e,o)=>{p(()=>{const r=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let a="Unsupported layer type";r&&(a+=" "+r),o(new u("layer:unsupported-layer-type",a,{layerType:r}))})}))}read(e,o){const r={resourceInfo:e};e.id!=null&&(r.id=e.id),e.title!=null&&(r.title=e.title),super.read(r,o)}write(e,o){return Object.assign(e||{},this.resourceInfo,{id:this.id})}};s([i({readOnly:!0})],t.prototype,"resourceInfo",void 0),s([i({type:["show","hide"]})],t.prototype,"listMode",void 0),s([i({json:{read:!1},readOnly:!0,value:"unsupported"})],t.prototype,"type",void 0),t=s([n("esri.layers.UnsupportedLayer")],t);const I=t;export{I as default}; diff --git a/assets/VectorTileLayer-43018d94.js b/assets/VectorTileLayer-43018d94.js new file mode 100644 index 0000000..0950152 --- /dev/null +++ b/assets/VectorTileLayer-43018d94.js @@ -0,0 +1 @@ +import{bz as J,ar as I,eF as G,mk as Y,bf as w,av as X,at as S,ax as k,ku as C,ah as H,bn as Z,jg as A,dn as ee,g9 as te,aP as re,cl as v,db as N,c5 as $,bV as U,ca as q,hu as Q,ml as V,c1 as F,mm as se,mn as z,c7 as ie,f2 as oe,eQ as le,eS as ae,as as R,mo as ne,mp as ue,gK as L,aN as pe,ai as c,aj as h,bc as ce,bY as he,ay as D,al as ye,aA as de}from"./index-080e108a.js";import{O as fe}from"./MultiOriginJSONSupport-e4912ffd.js";import{i as me}from"./APIKeyMixin-878a7aa7.js";import{p as ge}from"./ArcGISCachedService-344b6262.js";import{l as Ae}from"./ArcGISService-83287338.js";import{o as Se}from"./CustomParametersMixin-231c4be8.js";import{c as we}from"./OperationalLayer-0e8f8b28.js";import{j as xe}from"./PortalLayer-310c2800.js";import{T as K}from"./TilemapCache-67ada3c3.js";import{e as ve}from"./jsonContext-5f3816dc.js";import{l as _e}from"./StyleRepository-2362164f.js";import"./TileInfoTilemapCache-b3f5dda7.js";import"./commonProperties-30089b06.js";import"./portalItemUtils-792a27e1.js";import"./colorUtils-c0f43caf.js";import"./TileClipper-ae6eca9e.js";import"./definitions-0bc08d4c.js";let _=null;function be(e){if(_)return _;const t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return _=new Promise(r=>{const s=new Image;s.onload=()=>{s.onload=s.onerror=null,r(s.width>0&&s.height>0)},s.onerror=()=>{s.onload=s.onerror=null,r(!1)},s.src="data:image/webp;base64,"+t[e]}),_}const j=1.15;class E{constructor(t,r){this._spriteSource=t,this._maxTextureSize=r,this.devicePixelRatio=1,this._spriteImageFormat="png",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus="not-loaded",t.type==="url"&&t.spriteFormat&&(this._spriteImageFormat=t.spriteFormat),t.pixelRatio&&(this.devicePixelRatio=t.pixelRatio),this.baseURL=t.spriteUrl}get spriteNames(){const t=[];for(const r in this._spritesData)t.push(r);return t.sort(),t}getSpriteInfo(t){return this._spritesData?this._spritesData[t]:null}async load(t){if(this.baseURL){this.loadStatus="loading";try{await this._loadSprites(t),this.loadStatus="loaded"}catch{this.loadStatus="failed"}}else this.loadStatus="failed"}async _loadSprites(t){this._isRetina=this.devicePixelRatio>j;const{width:r,height:s,data:i,json:l}=await this._getSpriteData(this._spriteSource,t),o=Object.keys(l);if(!o||o.length===0||!i)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=l,this.width=r,this.height=s;const n=Math.max(this._maxTextureSize,4096);if(r>n||s>n){const u=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${n} pixels}`;throw J.getLogger("esri.layers.support.SpriteSource").error(u),new I("SpriteSource",u)}let a;for(let u=0;ut.data.index)),this._tileIndexPromise}async dataKey(t,r){const s=await this.fetchTileIndex();return k(r),this._getIndexedDataKey(s,t)}_getIndexedDataKey(t,r){const s=[r];if(r.level<0||r.row<0||r.col<0||r.row>>r.level>0||r.col>>r.level>0)return null;let i=r;for(;i.level!==0;)i=new C(i.level-1,i.row>>1,i.col>>1,i.world),s.push(i);let l,o,n=t,a=s.pop();if(n===1)return a;for(;s.length;)if(l=s.pop(),o=(1&l.col)+((1&l.row)<<1),n){if(n[o]===0){a=null;break}if(n[o]===1){a=l;break}a=l,n=n[o]}return a}},Ue=class{constructor(t,r){this._tilemap=t,this._tileIndexUrl=r}destroy(){this._tilemap=H(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(t){return this._tileIndexPromise||(this._tileIndexPromise=S(this._tileIndexUrl,{query:{...t==null?void 0:t.query}}).then(r=>r.data.index)),this._tileIndexPromise}dataKey(t,r){const{level:s,row:i,col:l}=t,o=new C(t);return this._tilemap.fetchAvailabilityUpsample(s,i,l,o,r).then(()=>(o.world=t.world,o)).catch(n=>{if(Z(n))throw n;return null})}};class Re{constructor(t){this._tileUrl=t,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(t){this._promise===null&&(this._abortController=new AbortController,this._promise=this._makeRequest(this._tileUrl,this._abortController.signal));const r=this._abortOptions;return r.push(t),te(t,()=>{r.every(s=>re(s))&&this._abortController.abort()}),this._promise.then(s=>v(s))}async _makeRequest(t,r){const{data:s}=await S(t,{responseType:"array-buffer",signal:r});return s}}const T=new Map;function Te(e,t,r,s,i){const l=w(e),o=l.query;if(o)for(const[a,u]of Object.entries(o))switch(u){case"{x}":o[a]=s.toString();break;case"{y}":o[a]=r.toString();break;case"{z}":o[a]=t.toString()}const n=l.path;return $e(A(n.replaceAll(/\{z\}/gi,t.toString()).replaceAll(/\{y\}/gi,r.toString()).replaceAll(/\{x\}/gi,s.toString()),{...l.query}),i)}function $e(e,t){return ee(T,e,()=>new Re(e)).getData(t).then(r=>(T.delete(e),r)).catch(r=>{throw T.delete(e),r})}class Pe{constructor(t,r,s){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.name=t,this.sourceUrl=r;const i=w(this.sourceUrl),l=v(s),o=l.tiles;if(i)for(let m=0;mm.toLowerCase().trim()),a=(s==null?void 0:s.exportTilesAllowed)===!0,u=(n==null?void 0:n.includes("tilemap"))===!0,y=a&&s.hasOwnProperty("maxExportTilesCount")?s.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:a,supportsTileMap:u},exportTiles:a?{maxExportTilesCount:+y}:null},this.tileInfo=U.fromJSON(l.tileInfo);const d=s.tileMap?A($(i.path,s.tileMap),i.query??{}):null;u?(this.type="vector-tile",this.tilemap=new Ue(new K({layer:{parsedUrl:i,tileInfo:this.tileInfo},minLOD:l.minLOD??this.tileInfo.lods[0].level,maxLOD:l.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),d)):d&&(this.tilemap=new Ie(d)),this.fullExtent=q.fromJSON(s.fullExtent)}destroy(){var t;(t=this.tilemap)==null||t.destroy()}async getRefKey(t,r){var s;return await((s=this.tilemap)==null?void 0:s.dataKey(t,r))??t}requestTile(t,r,s,i){const l=this.tileServers[r%this.tileServers.length];return Te(l,t,r,s,i)}isCompatibleWith(t){const r=this.tileInfo,s=t.tileInfo;if(!r.spatialReference.equals(s.spatialReference)||!r.origin.equals(s.origin)||Math.round(r.dpi)!==Math.round(s.dpi))return!1;const i=r.lods,l=s.lods,o=Math.min(i.length,l.length);for(let n=0;n=o&&l.push({level:a,scale:i,resolution:s}),s/=2,i/=2;return{capabilities:"TilesOnly",initialExtent:t,fullExtent:t,minScale:0,maxScale:0,tiles:e.tiles,tileInfo:{rows:r,cols:r,dpi:96,format:"pbf",origin:{x:-20037508342787e-6,y:20037508342787e-6},lods:l,spatialReference:{wkid:102100}}}}const b=1e-6;function Ee(e,t){if(e===t)return!0;if(e==null&&t!=null||e!=null&&t==null||e==null||t==null||!e.spatialReference.equals(t.spatialReference)||e.dpi!==t.dpi)return!1;const r=e.origin,s=t.origin;if(Math.abs(r.x-s.x)>=b||Math.abs(r.y-s.y)>=b)return!1;let i,l;e.lods[0].scale>t.lods[0].scale?(i=e,l=t):(l=e,i=t);for(let o=i.lods[0].scale;o>=l.lods[l.lods.length-1].scale-b;o/=2)if(Math.abs(o-l.lods[0].scale)t.lods[0].scale?e.lods[0]:t.lods[0],a=e.lods[e.lods.length-1].scale<=t.lods[t.lods.length-1].scale?e.lods[e.lods.length-1]:t.lods[t.lods.length-1],u=n.scale,y=n.resolution,d=a.scale,m=[];let f=u,P=y,O=0;for(;f>d;)m.push(new oe({level:O,resolution:P,scale:f})),O++,f/=2,P/=2;return new U({size:[r,r],dpi:i,format:s||"pbf",origin:l,lods:m,spatialReference:o})}let p=class extends le(ae(ge(Ae(we(xe(Se(me(fe(de))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.style=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.tilemapCache=null,this.type="vector-tile",this.url=null,this.showCollisionBoxes="none",this.path=null}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){var e;if(this.sourceNameToSource)for(const t of Object.values(this.sourceNameToSource))t==null||t.destroy();(e=this.primarySource)==null||e.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const t=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(R).then(async()=>{if(!this.portalItem||!this.portalItem.id)return;const r=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await S(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},ve(this.portalItem))}).catch(R).then(()=>this._loadStyle(e));return this.addResolvingPromise(t),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e&&e.serviceUrl&&w(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?A(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){var e;return((e=this.primarySource)==null?void 0:e.fullExtent)||null}get parsedUrl(){return this.serviceUrl?w(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo&&this.currentStyleInfo.serviceUrl||null}get spatialReference(){var e;return((e=this.tileInfo)==null?void 0:e.spatialReference)??null}get styleUrl(){return this.currentStyleInfo&&this.currentStyleInfo.styleUrl||null}writeStyleUrl(e,t){e&&Q(e)&&(e=`https:${e}`);const r=ne(e);t.styleUrl=ue(e,r)}get tileInfo(){var r;const e=[];for(const s in this.sourceNameToSource)e.push(this.sourceNameToSource[s]);let t=((r=this.primarySource)==null?void 0:r.tileInfo)||new U;if(e.length>1)for(let s=0;s(this._spriteSourceMap.clear(),this._getSourceAndStyle(r,{signal:i})),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return v(this.styleRepository.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const s=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||s})}getStyleLayer(e){return v(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return v(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t!=null&&t.origin&&!this.styleUrl?(t.messages&&t.messages.push(new I("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await Oe(e,{...t,query:{...this.customParameters,token:this.apiKey}});r.spriteFormat==="webp"&&(await be("lossy")||(r.spriteFormat="png")),this._set("currentStyleInfo",{...r}),typeof e=="string"?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new _e(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^\/]+)?\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/vectortileserver/i),r=["OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2"];if(!t)return;const s=t[2]&&t[2].toLowerCase();if(!s)return;const i=t[1]||"";for(const l of r)if(l.toLowerCase().includes(s))return F(`//static.arcgis.com/attribution/Vector${i}/${l}`)}async _loadStyle(e){var t;return((t=this._loadingTask)==null?void 0:t.promise)??this.loadStyle(null,e)}};c([h({readOnly:!0})],p.prototype,"attributionDataUrl",null),c([h({type:["show","hide"]})],p.prototype,"listMode",void 0),c([h({json:{read:!0,write:!0}})],p.prototype,"blendMode",void 0),c([h({readOnly:!0,json:{read:!1}})],p.prototype,"capabilities",null),c([h({readOnly:!0})],p.prototype,"currentStyleInfo",void 0),c([h({json:{read:!1},readOnly:!0,type:q})],p.prototype,"fullExtent",null),c([h()],p.prototype,"style",void 0),c([h({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],p.prototype,"isReference",void 0),c([h({type:["VectorTileLayer"]})],p.prototype,"operationalLayerType",void 0),c([h({readOnly:!0})],p.prototype,"parsedUrl",null),c([h({readOnly:!0})],p.prototype,"serviceUrl",null),c([h({type:ce,readOnly:!0})],p.prototype,"spatialReference",null),c([h({readOnly:!0})],p.prototype,"styleRepository",void 0),c([h({readOnly:!0})],p.prototype,"sourceNameToSource",void 0),c([h({readOnly:!0})],p.prototype,"primarySource",void 0),c([h({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],p.prototype,"styleUrl",null),c([he(["portal-item","web-document"],"styleUrl")],p.prototype,"writeStyleUrl",null),c([h({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:U})],p.prototype,"tileInfo",null),c([h()],p.prototype,"tilemapCache",void 0),c([D("service","tilemapCache",["capabilities","tileInfo"])],p.prototype,"readTilemapCache",null),c([h({json:{read:!1},readOnly:!0,value:"vector-tile"})],p.prototype,"type",void 0),c([h({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],p.prototype,"url",void 0),c([h({readOnly:!0})],p.prototype,"version",void 0),c([D("version",["version","currentVersion"])],p.prototype,"readVersion",null),c([h({type:String})],p.prototype,"showCollisionBoxes",void 0),c([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],p.prototype,"path",void 0),p=c([ye("esri.layers.VectorTileLayer")],p);const rt=p;export{rt as default}; diff --git a/assets/VectorTileLayerView3D-617343b6.js b/assets/VectorTileLayerView3D-617343b6.js new file mode 100644 index 0000000..e3c6b17 --- /dev/null +++ b/assets/VectorTileLayerView3D-617343b6.js @@ -0,0 +1,555 @@ +import{rQ as Le,r_ as We,b4 as Ue,rT as Ae,at as Ge,aO as ze,jg as ce,fD as Be,kt as Je,as as Ke,ku as Q,bn as Ye,fp as ue,sk as ke,sl as je,sm as Xe,ro as oe,ri as U,sn as K,so as re,sp as he,sq as Qe,sr as Oe,ss as Ze,bV as et,ax as tt,dz as it,st as nt,qQ as st,su as at,sv as ot,sw as rt,rZ as Y,e4 as de,hL as W,lL as N,nf as lt,ng as ct,sx as ut,n0 as q,sy as ht,sz as dt,rf as A,nd as $e,ip as se,rg as ee,cn as fe,ar as ft,sA as _t,sB as mt,cT as pt,aG as gt,aM as vt,aP as yt,ah as _e,ai as F,aj as G,al as xt}from"./index-080e108a.js";import{t as $}from"./Rect-98da58d6.js";import{n as wt}from"./pbf-d9aa3914.js";import{e as bt}from"./rasterizingUtils-4df93c6e.js";import{h as St,T as H}from"./TileInfoView-346e56d0.js";import{e as k,t as Ne,r as me}from"./definitions-0bc08d4c.js";import{M as ie}from"./number-e491b09e.js";import{c as pe}from"./GeometryUtils-0258f920.js";import{l as ge}from"./StyleRepository-2362164f.js";import{n as Tt}from"./LayerView3D-ffd35809.js";import{o as Pt}from"./TiledLayerView3D-a11f8026.js";import{d as It}from"./LayerView-448bc5ea.js";import"./colorUtils-c0f43caf.js";import"./TileClipper-ae6eca9e.js";let Mt=class{constructor(e,i,t){this._scale=e,this._shift=i,this._levelShift=t}getLevelRowColumn(e){const i=this.getLevelShift(e[0]),t=this._shift+i;return t?[e[0]-i,e[1]>>t,e[2]>>t]:e}getLevelShift(e){return Math.min(e,this._levelShift)}getOffset(e,i){let t=0,n=0;const s=this._shift+this.getLevelShift(e[0]);if(s){const a=(1<this._width||i>this._height)return new $;let t=null,n=-1;for(let s=0;se&&this._free.push(new $(t.x+e,t.y,t.width-e,i)),t.height>i&&this._free.push(new $(t.x,t.y+i,t.width,t.height-i))):(t.width>e&&this._free.push(new $(t.x+e,t.y,t.width-e,t.height)),t.height>i&&this._free.push(new $(t.x,t.y+i,e,t.height-i))),new $(t.x,t.y,e,i))}release(e){for(let i=0;i{const l=e+r;if(this._rangePromises.has(l))o.push(this._rangePromises.get(l));else{const h=n.getRange(e,r).then(()=>{this._rangePromises.delete(l)},()=>{this._rangePromises.delete(l)});this._rangePromises.set(l,h),o.push(h)}}),Promise.all(o).then(()=>{let r=this._glyphIndex[e];r||(r={},this._glyphIndex[e]=r);for(const l of i){const h=r[l];if(h){t[l]={sdf:!0,rect:h.rect,metrics:h.metrics,page:h.page,code:l};continue}const d=n.getGlyph(e,l);if(!d||!d.metrics)continue;const f=d.metrics;let c;if(f.width===0)c=new $(0,0,0,0);else{const p=f.width+6,_=f.height+2*3;let m=p%4?4-p%4:4,y=_%4?4-_%4:4;m===1&&(m=5),y===1&&(y=5),c=this._binPack.allocate(p+m,_+y),c.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new te(this.width-4,this.height-4),c=this._binPack.allocate(p+m,_+y));const P=this._glyphData[this._currentPage],I=d.bitmap;let x,b;if(I)for(let w=0;w<_;w++){x=p*w,b=this.width*(c.y+w+1)+c.x;for(let g=0;g{t.addRange(i,new ae(new wt(new Uint8Array(o.data),new DataView(o.data))))}).catch(()=>{t.addRange(i,new ae)})}return t.addRange(i,new ae),Promise.resolve()}getGlyph(e,i){const t=this._getFontStack(e);if(!t)return;const n=Math.floor(i/256),s=t.getRange(n);return s?{metrics:s.getMetrics(i),bitmap:s.getBitmap(i)}:void 0}_getFontStack(e){let i=this._glyphInfo[e];return i||(i=this._glyphInfo[e]=new Rt),i}};const Dt="dasharray-";let xe=class Ve{constructor(e,i,t=0){this._size=[],this._mosaicsData=[],this._textures=[],this._dirties=[],this._maxItemSize=0,this._currentPage=0,this._pageWidth=0,this._pageHeight=0,this._mosaicRects={},this.pixelRatio=1,(e<=0||i<=0)&&console.error("Sprites mosaic defaultWidth and defaultHeight must be greater than zero!"),this._pageWidth=e,this._pageHeight=i,t>0&&(this._maxItemSize=t),this._binPack=new te(e-4,i-4)}dispose(){this._binPack=null,this._mosaicRects={};for(const e of this._textures)e&&e.dispose();this._textures.length=0}getWidth(e){return e>=this._size.length?-1:this._size[e][0]}getHeight(e){return e>=this._size.length?-1:this._size[e][1]}getPageSize(e){return e>=this._size.length?null:this._size[e]}setSpriteSource(e){if(this.dispose(),this.pixelRatio=e.devicePixelRatio,this._mosaicsData.length===0){this._binPack=new te(this._pageWidth-4,this._pageHeight-4);const i=Math.floor(this._pageWidth),t=Math.floor(this._pageHeight),n=new Uint32Array(i*t);this._mosaicsData[0]=n,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=e}getSpriteItem(e,i=!1){let t,n,s=this._mosaicRects[e];if(s)return s;if(!this._sprites||this._sprites.loadStatus!=="loaded"||(e&&e.startsWith(Dt)?([t,n]=this._rasterizeDash(e),i=!0):t=this._sprites.getSpriteInfo(e),!t||!t.width||!t.height||t.width<0||t.height<0))return null;const a=t.width,o=t.height,[r,l,h]=this._allocateImage(a,o);return r.width<=0?null:(this._copy(r,t,l,h,i,n),s={rect:r,width:a,height:o,sdf:t.sdf,simplePattern:!1,pixelRatio:t.pixelRatio,page:l},this._mosaicRects[e]=s,s)}getSpriteItems(e){const i={};for(const t of e)i[t.name]=this.getSpriteItem(t.name,t.repeat);return i}getMosaicItemPosition(e,i){const t=this.getSpriteItem(e,i),n=t&&t.rect;if(!n)return null;n.width=t.width,n.height=t.height;const s=t.width,a=t.height,o=2;return{tl:[n.x+o,n.y+o],br:[n.x+o+s,n.y+o+a],page:t.page}}bind(e,i,t=0,n=0){if(t>=this._size.length||t>=this._mosaicsData.length)return;if(!this._textures[t]){const a=new Le;a.wrapMode=Ue.CLAMP_TO_EDGE,a.width=this._size[t][0],a.height=this._size[t][1],this._textures[t]=new Ae(e,a,new Uint8Array(this._mosaicsData[t].buffer))}const s=this._textures[t];s.setSamplingMode(i),this._dirties[t]&&s.setData(new Uint8Array(this._mosaicsData[t].buffer)),e.bindTexture(s,n),this._dirties[t]=!1}static _copyBits(e,i,t,n,s,a,o,r,l,h,d){let f=n*i+t,c=r*a+o;if(d){c-=a;for(let v=-1;v<=h;v++,f=((v+h)%h+n)*i+t,c+=a)for(let p=-1;p<=l;p++)s[c+p]=e[f+(p+l)%l]}else for(let v=0;v=this._mosaicsData.length)return;const o=new Uint32Array(a?a.buffer:this._sprites.image.buffer),r=this._mosaicsData[t];r&&o||console.error("Source or target images are uninitialized!");const l=2,h=a?i.width:this._sprites.width;Ve._copyBits(o,h,i.x,i.y,r,n[0],e.x+l,e.y+l,i.width,i.height,s),this._dirties[t]=!0}_allocateImage(e,i){e+=2,i+=2;const t=Math.max(e,i);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(e){this._requestSprite(e);const i=this._layer.currentStyleInfo.glyphsUrl,t=new ye(i?ce(i,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new ve(1024,1024,t),this._broadcastPromise=Be("WorkerTileHandler",{client:this,schedule:e.schedule,signal:e.signal}).then(n=>{var s;if(this._layer&&((s=this._connection)==null||s.close(),this._connection=n,this._layer&&!this._connection.closed)){const a=n.broadcast("setStyle",this._layer.currentStyleInfo.style,e);Promise.all(a).catch(o=>Je(o))}})}_requestSprite(e){var a,o;(a=this._spriteSourceAbortController)==null||a.abort();const i=new AbortController;this._spriteSourceAbortController=i;const t=e==null?void 0:e.signal;this._inputSignalEventListener&&((o=this._startOptionsInputSignal)==null||o.removeEventListener("abort",this._inputSignalEventListener)),this._startOptionsInputSignal=null,t&&(this._inputSignalEventListener=Et(i),t.addEventListener("abort",this._inputSignalEventListener,{once:!0}));const{signal:n}=i,s={...e,signal:n};this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,s),this._spriteSourcePromise.then(r=>{Ke(n),this._spriteMosaic=new xe(1024,1024,250),this._spriteMosaic.setSpriteSource(r)})}async updateStyle(e){return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(e){const i=new xe(1024,1024,250);return i.setSpriteSource(e),this._spriteMosaic=i,this._spriteSourcePromise=Promise.resolve(e),this._spriteSourceAbortController=null,i}async setStyle(e,i){await this._broadcastPromise,this._styleRepository=e,this._requestSprite();const t=new ye(this._layer.currentStyleInfo.glyphsUrl?ce(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new ve(1024,1024,t),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",i)),this._broadcastPromise}fetchTileData(e,i){return this._getRefKeys(e,i).then(t=>{const n=this._layer.sourceNameToSource,s=[];for(const a in n)s.push(a);return this._getSourcesData(s,t,i)})}parseTileData(e,i){const t=e&&e.data;if(!t)return Promise.resolve(null);const{sourceName2DataAndRefKey:n,transferList:s}=t;return Object.keys(n).length===0?Promise.resolve(null):this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:e.key.id,sourceName2DataAndRefKey:n,styleLayerUIDs:e.styleLayerUIDs},{...i,transferList:s}))}async getSprites(e){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(e)}getGlyphs(e){return this._glyphMosaic.getGlyphItems(e.font,e.codePoints)}async _getTilePayload(e,i,t){const n=Q.pool.acquire(e.id),s=this._layer.sourceNameToSource[i],{level:a,row:o,col:r}=n;Q.pool.release(n);try{return{protobuff:await s.requestTile(a,o,r,t),sourceName:i}}catch(l){if(Ye(l))throw l;return{protobuff:null,sourceName:i}}}_getRefKeys(e,i){const t=this._layer.sourceNameToSource,n=new Array;for(const s in t){const a=t[s].getRefKey(e,i);n.push(a)}return ue(n)}_getSourcesData(e,i,t){const n=[];for(let s=0;s{const a={},o=[];for(let r=0;r0){const h=i[r].value.id;a[l.sourceName]={refKey:h,protobuff:l.protobuff},o.push(l.protobuff)}}return{sourceName2DataAndRefKey:a,transferList:o}})}};function Et(u){return()=>u.abort()}function Lt(u,e,i,t,n,s){const{iconRotationAlignment:a,textRotationAlignment:o,iconTranslate:r,iconTranslateAnchor:l,textTranslate:h,textTranslateAnchor:d}=t;let f=0;for(const c of u.colliders){const[v,p]=c.partIndex===0?r:h,_=c.partIndex===0?l:d,m=c.minLod<=s&&s<=c.maxLod;f+=m?0:1,c.enabled=m,c.xScreen=c.xTile*n[0]+c.yTile*n[3]+n[6],c.yScreen=c.xTile*n[1]+c.yTile*n[4]+n[7],_===K.MAP?(c.xScreen+=i*v-e*p,c.yScreen+=e*v+i*p):(c.xScreen+=v,c.yScreen+=p),U.VIEWPORT===(c.partIndex===0?a:o)?(c.dxScreen=c.dxPixels,c.dyScreen=c.dyPixels):(c.dxScreen=i*(c.dxPixels+c.width/2)-e*(c.dyPixels+c.height/2)-c.width/2,c.dyScreen=e*(c.dxPixels+c.width/2)+i*(c.dyPixels+c.height/2)-c.height/2)}u.colliders.length>0&&f===u.colliders.length&&(u.unique.show=!1)}let Ut=class{constructor(e,i,t,n,s,a){this._symbols=e,this._styleRepository=n,this._zoom=s,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new ke(i,t,je),this._si=Math.sin(Math.PI*a/180),this._co=Math.cos(Math.PI*a/180);for(const o of e)for(const r of o.symbols)this._allNeededMatrices.has(r.tile)||this._allNeededMatrices.set(r.tile,Xe(r.tile.transforms.tileUnitsToPixels))}work(e){const i=this._gridIndex;function t(s){const a=s.xScreen+s.dxScreen,o=s.yScreen+s.dyScreen,r=a+s.width,l=o+s.height,[h,d,f,c]=i.getCellSpan(a,o,r,l);for(let v=d;v<=c;v++)for(let p=h;p<=f;p++){const _=i.cells[v][p];for(const m of _){const y=m.xScreen+m.dxScreen,P=m.yScreen+m.dyScreen,I=y+m.width,x=P+m.height;if(!(rI||lx))return!0}}return!1}const n=performance.now();for(;this._currentLayerCursore)return!1;const o=s.symbols[this._currentSymbolCursor];if(!o.unique.show)continue;Lt(o,this._si,this._co,a,this._allNeededMatrices.get(o.tile),this._zoom);const r=o.unique;if(!r.show)continue;const{iconAllowOverlap:l,iconIgnorePlacement:h,textAllowOverlap:d,textIgnorePlacement:f}=a;for(const c of o.colliders){if(!c.enabled)continue;const v=r.parts[c.partIndex];v.show&&!(c.partIndex?d:l)&&t(c)&&(c.hard?r.show=!1:v.show=!1)}if(r.show)for(const c of o.colliders){if(!c.enabled||(c.partIndex?f:h)||!r.parts[c.partIndex].show)continue;const v=c.xScreen+c.dxScreen,p=c.yScreen+c.dyScreen,_=v+c.width,m=p+c.height,[y,P,I,x]=this._gridIndex.getCellSpan(v,p,_,m);for(let b=P;b<=x;b++)for(let w=y;w<=I;w++)this._gridIndex.cells[b][w].push(c)}}}return!0}_getProperties(e){const i=this._styleProps.get(e);if(i)return i;const t=this._zoom,n=this._styleRepository.getStyleLayerByUID(e),s=n.getLayoutValue("symbol-placement",t)!==oe.POINT;let a=n.getLayoutValue("icon-rotation-alignment",t);a===U.AUTO&&(a=s?U.MAP:U.VIEWPORT);let o=n.getLayoutValue("text-rotation-alignment",t);o===U.AUTO&&(o=s?U.MAP:U.VIEWPORT);const r=n.getPaintValue("icon-translate",t),l=n.getPaintValue("icon-translate-anchor",t),h=n.getPaintValue("text-translate",t),d=n.getPaintValue("text-translate-anchor",t),f={iconAllowOverlap:n.getLayoutValue("icon-allow-overlap",t),iconIgnorePlacement:n.getLayoutValue("icon-ignore-placement",t),textAllowOverlap:n.getLayoutValue("text-allow-overlap",t),textIgnorePlacement:n.getLayoutValue("text-ignore-placement",t),iconRotationAlignment:a,textRotationAlignment:o,iconTranslateAnchor:l,iconTranslate:r,textTranslateAnchor:d,textTranslate:h};return this._styleProps.set(e,f),f}};function At(u,e){if(u.priority-e.priority)return u.priority-e.priority;const i=u.tile.key,t=e.tile.key;return i.world-t.world?i.world-t.world:i.level-t.level?i.level-t.level:i.row-t.row?i.row-t.row:i.col-t.col?i.col-t.col:u.xTile-e.xTile?u.xTile-e.xTile:u.yTile-e.yTile}let zt=class{get running(){return this._running}constructor(e,i,t,n,s,a){this._visibleTiles=e,this._symbolRepository=i,this._createCollisionJob=t,this._assignTileSymbolsOpacity=n,this._symbolLayerSorter=s,this._isLayerVisible=a,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}setScreenSize(e,i){this._screenWidth===e&&this._screenHeight===i||this.restart(),this._screenWidth=e,this._screenHeight=i}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(e){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const i=performance.now();if(!this._selectionJob.work(e)||(this._selectionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-i)))===0))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const i=performance.now();if(!this._collisionJob.work(e)||(this._collisionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-i)))===0))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const i=performance.now();if(!this._opacityJob.work(e)||(this._opacityJobCompleted=!0,(e=Math.max(0,e-(performance.now()-i)))===0))return!1}return this._running=!1,!0}_createSelectionJob(){const e=this._symbolRepository.uniqueSymbols;for(let r=0;rr)return!1;let v=null,p=!1,_=!1;for(const m of l.tileSymbols)if(!_||!p){const y=m.tile;(!v||y.isCoverage||y.neededForCoverage&&!p)&&(v=m,(y.neededForCoverage||y.isCoverage)&&(_=!0),y.isCoverage&&(p=!0))}if(v.selectedForRendering=!0,_){c.symbols.push(v),l.show=!0;for(const m of l.parts)m.show=!0}else l.show=!1}}for(const d of i)d.symbols.sort(At);return!0}const o=this._symbolLayerSorter;return{work:a,get sortedSymbols(){return i.sort(o)}}}_createOpacityJob(){const e=this._assignTileSymbolsOpacity,i=this._visibleTiles;let t=0;function n(s,a){const o=s.symbols;for(const[r,l]of o)kt(l,a);e(s,a);for(const r of s.childrenTiles)n(r,a)}return{work(s){const a=performance.now();for(;ts)return!1;const o=i[t];o.parentTile==null&&n(o,performance.now())}return!0}}}};function kt(u,e){for(const i of u){const t=i.unique;for(const n of t.parts){const s=n.targetOpacity>.5?1:-1;n.startOpacity+=s*((e-n.startTime)/re),n.startOpacity=Math.min(Math.max(n.startOpacity,0),1),n.startTime=e,n.targetOpacity=t.show&&n.show?1:0}}}const Ot=32,$t=8,Nt=64;let Vt=class{constructor(e,i,t){this.tileCoordRange=e,this._visibleTiles=i,this._createUnique=t,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return this._uniqueSymbolLayerArray==null&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}add(e,i){this._uniqueSymbolLayerArray=null;let t=this._tiles.get(e.id);t||(t={symbols:new Map},this._tiles.set(e.id,t));const n=new Map;if(i)for(const o of i)t.symbols.has(o)&&(n.set(o,t.symbols.get(o)),t.symbols.delete(o));else for(const[o,r]of e.layerData)t.symbols.has(o)&&(n.set(o,t.symbols.get(o)),t.symbols.delete(o));this._removeSymbols(n);const s=e.symbols,a=new Map;for(const[o,r]of s){let l=r.length;if(l>=Ot){let h=this.tileCoordRange;do h/=2,l/=4;while(l>$t&&h>Nt);const d=new ke(this.tileCoordRange,this.tileCoordRange,h);a.set(o,{flat:r,index:d}),t.symbols.set(o,{flat:r,index:d});for(const f of r)d.getCell(f.xTile,f.yTile).push(f)}else a.set(o,{flat:r}),t.symbols.set(o,{flat:r})}this._addSymbols(e.key,s)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[i,t]of this._tiles){const n=new Map;for(const s of e)t.symbols.has(s)&&(n.set(s,t.symbols.get(s)),t.symbols.delete(s));this._removeSymbols(n),t.symbols.size===0&&this._tiles.delete(i)}}removeTile(e){this._uniqueSymbolLayerArray=null;const i=this._tiles.get(e.id);if(!i)return;const t=new Map;for(const[n,s]of e.symbols)i.symbols.has(n)&&(t.set(n,i.symbols.get(n)),i.symbols.delete(n));this._removeSymbols(t),i.symbols.size===0&&this._tiles.delete(e.id)}_removeSymbols(e){for(const[i,{flat:t}]of e)for(const n of t){const s=n.unique,a=s.tileSymbols,o=a.length-1;for(let r=0;ri.level){const s=e.key.level-i.level;if(e.key.row>>s!==i.row||e.key.col>>s!==i.col)return}if(i.level>e.key.level){const s=i.level-e.key.level;if(i.row>>s!==e.key.row||i.col>>s!==e.key.col)return}if(i.equals(e.key)){for(const s of e.childrenTiles)this._matchSymbols(s,i,t);return}const n=new Map;for(const[s,a]of t){const o=[];for(const d of a){const f=he(this.tileCoordRange,d.xTile,i.level,i.col,e.key.level,e.key.col),c=he(this.tileCoordRange,d.yTile,i.level,i.row,e.key.level,e.key.row);f>=0&&f=0&&c0&&n.set(s,r)}for(const s of e.childrenTiles)this._matchSymbols(s,i,n)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,i=new Array(e.size);let t,n=0;for(const[s,a]of e){const o=new Array(a.size);t=0;for(const r of a)o[t++]=r;i[n]={styleLayerUID:s,uniqueSymbols:o},n++}return i}};function Ft(u){const e=[],i=new Vt(4096,e,()=>{const n=new Ze;return n.show=!1,n.parts.push({startTime:0,startOpacity:0,targetOpacity:0,show:!1}),n.parts.push({startTime:0,startOpacity:0,targetOpacity:0,show:!1}),n}),t=new zt(e,i,(n,s,a)=>new Ut(n,s,a,u.styleRepository,u.key.level,0),(n,s)=>{Qe(n,s,!1)},()=>0,n=>{const s=u.styleRepository.getStyleLayerByUID(n).getLayoutProperty("visibility");return!s||s.getValue()!==Oe.NONE});e.push(u),i.add(u),t.setScreenSize(512,512),t.continue(1/0)}let qt=class extends St{constructor(){super(...arguments),this._fullCacheLodInfos=null,this._levelByScale={}}getTileParentId(e){const i=Q.pool.acquire(e),t=i.level===0?null:Q.getId(i.level-1,i.row>>1,i.col>>1,i.world);return Q.pool.release(i),t}getTileCoverage(e,i,t=!0,n){const s=super.getTileCoverage(e,i,t,n);if(!s)return s;const a=1<o.row>=0&&o.rowi[0].scale)return i[0].level;let t,n;for(let s=0;sn.scale)return t=i[s],t.level+(t.scale-e)/(t.scale-n.scale);return i[i.length-1].level}}_initializeFullCacheLODs(e){let i;if(e[0].level===0)i=e.map(t=>({level:t.level,resolution:t.resolution,scale:t.scale}));else{const t=this.tileInfo.size[0],n=this.tileInfo.spatialReference;i=et.create({size:t,spatialReference:n}).lods.map(s=>({level:s.level,resolution:s.resolution,scale:s.scale}))}for(let t=0;te.abort()),this._ongoingRequestToController.clear(),this._ongoingTileRequests.clear()}async getVectorTile(e,i,t,n){const s=new Q(e,i,t,0);let a=this._memCache.get(s.id);if(a!=null)return a.retain(),a;const o=await this._getVectorTileData(s);if(tt(n),!this._layer)return null;if(a=this._memCache.get(s.id),a!=null)return a.retain(),a;const r=this._layer.tileInfo.getTileBounds(it(),s),l=this._tileInfoView.getTileResolution(e);return a=new nt(s,l,r[0],r[3],512,512,this._styleRepository,this._memCache),o?(a.setData(o),a.retain(),this._memCache.put(s.id,a,a.memoryUsed,st)):a.setData(null),a.neededForCoverage=!0,a.transforms.tileUnitsToPixels=at(1/8,0,0,0,1/8,0,0,0,1),Ft(a),a}_getVectorTileData(e){const i=e.id;if(this._ongoingTileRequests.has(i))return this._ongoingTileRequests.get(i);const t=new AbortController,n={signal:t.signal},s=this._getParsedVectorTileData(e,n).then(a=>(this._ongoingTileRequests.delete(i),this._ongoingRequestToController.delete(i),a)).catch(()=>(this._ongoingTileRequests.delete(i),this._ongoingRequestToController.delete(i),null));return this._ongoingTileRequests.set(i,s),this._ongoingRequestToController.set(i,t),s}_getParsedVectorTileData(e,i){return this.fetchTileData(e,i).then(t=>this.parseTileData({key:e,data:t},i))}},ne=class{constructor(){this.name=this.constructor.name||"UnnamedBrush",this.brushEffect=null}prepareState(e,i){}draw(e,i,t){}drawMany(e,i,t){for(const n of i)n.visible&&this.draw(e,n,t)}},Ht=class extends ne{constructor(){super(...arguments),this._color=ot(1,0,0,1),this._patternMatrix=rt(),this._programOptions={id:!1,pattern:!1}}dispose(){this._vao&&(this._vao.dispose(),this._vao=null)}drawMany(e,i){const{context:t,painter:n,styleLayerUID:s,requestRender:a,allowDelayedRender:o}=e;this._loadWGLResources(e);const r=e.displayLevel,l=e.styleLayer,h=l.backgroundMaterial,d=n.vectorTilesMaterialManager,f=l.getPaintValue("background-color",r),c=l.getPaintValue("background-opacity",r),v=l.getPaintValue("background-pattern",r),p=v!==void 0,_=f[3]*c,m=1|window.devicePixelRatio,y=e.spriteMosaic;let P,I;const x=m>Ne?2:1,b=e.drawPhase===H.HITTEST,w=this._programOptions;w.id=b,w.pattern=p;const g=d.getMaterialProgram(t,h,w);if(!o||a==null||g.compiled){if(t.bindVAO(this._vao),t.useProgram(g),p){const S=y.getMosaicItemPosition(v,!0);if(S!=null){const{tl:M,br:T,page:D}=S;P=T[0]-M[0],I=T[1]-M[1];const R=y.getPageSize(D);R!=null&&(y.bind(t,Y.LINEAR,D,k),g.setUniform4f("u_tlbr",M[0],M[1],T[0],T[1]),g.setUniform2fv("u_mosaicSize",R),g.setUniform1i("u_texture",k))}g.setUniform1f("u_opacity",c)}else this._color[0]=_*f[0],this._color[1]=_*f[1],this._color[2]=_*f[2],this._color[3]=_,g.setUniform4fv("u_color",this._color);if(g.setUniform1f("u_depth",l.z||0),b){const S=ie(s+1);g.setUniform4fv("u_id",S)}for(const S of i){if(g.setUniform1f("u_coord_range",S.rangeX),g.setUniformMatrix3fv("u_dvsMat3",S.transforms.dvs),p){const M=Math.max(2**(Math.round(r)-S.key.level),1),T=x*S.width*M,D=T/de(P),R=T/de(I);this._patternMatrix[0]=D,this._patternMatrix[4]=R,g.setUniformMatrix3fv("u_pattern_matrix",this._patternMatrix)}t.setStencilFunction(W.EQUAL,0,255),t.drawArrays(N.TRIANGLE_STRIP,0,4)}}else a()}_loadWGLResources(e){if(this._vao)return;const{context:i,styleLayer:t}=e,n=t.backgroundMaterial,s=new Int8Array([0,0,1,0,0,1,1,1]),a=lt.createVertex(i,ct.STATIC_DRAW,s),o=new ut(i,n.getAttributeLocations(),n.getLayoutInfo(),{geometry:a});this._vao=o}},Wt=class extends ne{constructor(){super(...arguments),this._programOptions={id:!1}}dispose(){}drawMany(e,i){const{context:t,displayLevel:n,requiredLevel:s,state:a,drawPhase:o,painter:r,spriteMosaic:l,styleLayerUID:h,requestRender:d,allowDelayedRender:f}=e;if(!i.some(w=>{var g;return((g=w.layerData.get(h))==null?void 0:g.circleIndexCount)??!1}))return;const c=e.styleLayer,v=c.circleMaterial,p=r.vectorTilesMaterialManager,_=1.2,m=c.getPaintValue("circle-translate",n),y=c.getPaintValue("circle-translate-anchor",n),P=o===H.HITTEST,I=this._programOptions;I.id=P;const x=p.getMaterialProgram(t,v,I);if(f&&d!=null&&!x.compiled)return void d();t.useProgram(x),x.setUniformMatrix3fv("u_displayMat3",y===K.VIEWPORT?a.displayMat3:a.displayViewMat3),x.setUniform2fv("u_circleTranslation",m),x.setUniform1f("u_depth",c.z),x.setUniform1f("u_antialiasingWidth",_);let b=-1;if(P){const w=ie(h+1);x.setUniform4fv("u_id",w)}for(const w of i){if(!w.layerData.has(h))continue;w.key.level!==b&&(b=w.key.level,v.setDataUniforms(x,n,c,b,l));const g=w.layerData.get(h);if(!g.circleIndexCount)continue;g.prepareForRendering(t);const S=g.vao;S!=null&&(t.bindVAO(S),x.setUniformMatrix3fv("u_dvsMat3",w.transforms.dvs),s!==w.key.level?t.setStencilFunction(W.EQUAL,w.stencilRef,255):t.setStencilFunction(W.GREATER,255,255),t.drawElements(N.TRIANGLES,g.circleIndexCount,q.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*g.circleIndexStart),w.triangleCount+=g.circleIndexCount/3)}}};const be=1/65536;let Gt=class extends ne{constructor(){super(...arguments),this._fillProgramOptions={id:!1,pattern:!1},this._outlineProgramOptions={id:!1}}dispose(){}drawMany(e,i){const{displayLevel:t,drawPhase:n,renderPass:s,spriteMosaic:a,styleLayerUID:o}=e;let r=!1;for(const x of i)if(x.layerData.has(o)){const b=x.layerData.get(o);if(b.fillIndexCount>0||b.outlineIndexCount>0){r=!0;break}}if(!r)return;const l=e.styleLayer,h=l.getPaintProperty("fill-pattern"),d=h!==void 0,f=d&&h.isDataDriven;let c;if(d&&!f){const x=h.getValue(t);c=a.getMosaicItemPosition(x,!0)}const v=!d&&l.getPaintValue("fill-antialias",t);let p=!0,_=1;if(!d){const x=l.getPaintProperty("fill-color"),b=l.getPaintProperty("fill-opacity");if(!(x!=null&&x.isDataDriven)&&!(b!=null&&b.isDataDriven)){const w=l.getPaintValue("fill-color",t);_=l.getPaintValue("fill-opacity",t)*w[3],_>=1&&(p=!1)}}if(p&&s==="opaque")return;let m;n===H.HITTEST&&(m=ie(o+1));const y=l.getPaintValue("fill-translate",t),P=l.getPaintValue("fill-translate-anchor",t);(p||s!=="translucent")&&this._drawFill(e,o,l,i,y,P,d,c,f,m);const I=!l.hasDataDrivenOutlineColor&&l.outlineUsesFillColor&&_<1;v&&s!=="opaque"&&!I&&this._drawOutline(e,o,l,i,y,P,m)}_drawFill(e,i,t,n,s,a,o,r,l,h){if(o&&!l&&r==null)return;const{context:d,displayLevel:f,state:c,drawPhase:v,painter:p,pixelRatio:_,spriteMosaic:m,requestRender:y,allowDelayedRender:P}=e,I=t.fillMaterial,x=p.vectorTilesMaterialManager,b=_>Ne?2:1,w=v===H.HITTEST,g=this._fillProgramOptions;g.id=w,g.pattern=o;const S=x.getMaterialProgram(d,I,g);if(P&&y!=null&&!S.compiled)return void y();if(d.useProgram(S),r!=null){const{page:T}=r,D=m.getPageSize(T);D!=null&&(m.bind(d,Y.LINEAR,T,k),S.setUniform2fv("u_mosaicSize",D),S.setUniform1i("u_texture",k))}S.setUniformMatrix3fv("u_displayMat3",a===K.VIEWPORT?c.displayMat3:c.displayViewMat3),S.setUniform2fv("u_fillTranslation",s),S.setUniform1f("u_depth",t.z+be),w&&S.setUniform4fv("u_id",h);let M=-1;for(const T of n){if(!T.layerData.has(i))continue;T.key.level!==M&&(M=T.key.level,I.setDataUniforms(S,f,t,M,m));const D=T.layerData.get(i);if(!D.fillIndexCount)continue;D.prepareForRendering(d);const R=D.fillVAO;if(R!=null){if(d.bindVAO(R),S.setUniformMatrix3fv("u_dvsMat3",T.transforms.dvs),d.setStencilFunction(W.EQUAL,T.stencilRef,255),o){const E=Math.max(2**(Math.round(f)-T.key.level),1),L=T.rangeX/(b*T.width*E);S.setUniform1f("u_patternFactor",L)}if(l){const E=D.patternMap;if(!E)continue;for(const[L,B]of E){const J=m.getPageSize(L);J!=null&&(m.bind(d,Y.LINEAR,L,k),S.setUniform2fv("u_mosaicSize",J),S.setUniform1i("u_texture",k),d.drawElements(N.TRIANGLES,B[1],q.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*B[0]))}}else d.drawElements(N.TRIANGLES,D.fillIndexCount,q.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*D.fillIndexStart);T.triangleCount+=D.fillIndexCount/3}}}_drawOutline(e,i,t,n,s,a,o){const{context:r,displayLevel:l,state:h,drawPhase:d,painter:f,pixelRatio:c,spriteMosaic:v,requestRender:p,allowDelayedRender:_}=e,m=t.outlineMaterial,y=f.vectorTilesMaterialManager,P=.75/c,I=d===H.HITTEST,x=this._outlineProgramOptions;x.id=I;const b=y.getMaterialProgram(r,m,x);if(_&&p!=null&&!b.compiled)return void p();r.useProgram(b),b.setUniformMatrix3fv("u_displayMat3",a===K.VIEWPORT?h.displayMat3:h.displayViewMat3),b.setUniform2fv("u_fillTranslation",s),b.setUniform1f("u_depth",t.z+be),b.setUniform1f("u_outline_width",P),I&&b.setUniform4fv("u_id",o);let w=-1;for(const g of n){if(!g.layerData.has(i))continue;g.key.level!==w&&(w=g.key.level,m.setDataUniforms(b,l,t,w,v));const S=g.layerData.get(i);if(S.prepareForRendering(r),!S.outlineIndexCount)continue;const M=S.outlineVAO;M!=null&&(r.bindVAO(M),b.setUniformMatrix3fv("u_dvsMat3",g.transforms.dvs),r.setStencilFunction(W.EQUAL,g.stencilRef,255),r.drawElements(N.TRIANGLES,S.outlineIndexCount,q.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*S.outlineIndexStart),g.triangleCount+=S.outlineIndexCount/3)}}},Bt=class extends ne{constructor(){super(...arguments),this._programOptions={id:!1,pattern:!1,sdf:!1}}dispose(){}drawMany(e,i){const{context:t,displayLevel:n,state:s,drawPhase:a,painter:o,pixelRatio:r,spriteMosaic:l,styleLayerUID:h,requestRender:d,allowDelayedRender:f}=e;if(!i.some(R=>{var E;return((E=R.layerData.get(h))==null?void 0:E.lineIndexCount)??!1}))return;const c=e.styleLayer,v=c.lineMaterial,p=o.vectorTilesMaterialManager,_=c.getPaintValue("line-translate",n),m=c.getPaintValue("line-translate-anchor",n),y=c.getPaintProperty("line-pattern"),P=y!==void 0,I=P&&y.isDataDriven;let x,b;if(P&&!I){const R=y.getValue(n);x=l.getMosaicItemPosition(R)}let w=!1;if(!P){const R=c.getPaintProperty("line-dasharray");if(b=R!==void 0,w=b&&R.isDataDriven,b&&!w){const E=R.getValue(n),L=c.getDashKey(E,c.getLayoutValue("line-cap",n));x=l.getMosaicItemPosition(L)}}const g=1/r,S=a===H.HITTEST,M=this._programOptions;M.id=S,M.pattern=P,M.sdf=b;const T=p.getMaterialProgram(t,v,M);if(f&&d!=null&&!T.compiled)return void d();if(t.useProgram(T),T.setUniformMatrix3fv("u_displayViewMat3",s.displayViewMat3),T.setUniformMatrix3fv("u_displayMat3",m===K.VIEWPORT?s.displayMat3:s.displayViewMat3),T.setUniform2fv("u_lineTranslation",_),T.setUniform1f("u_depth",c.z),T.setUniform1f("u_antialiasing",g),S){const R=ie(h+1);T.setUniform4fv("u_id",R)}if(x&&x!=null){const{page:R}=x,E=l.getPageSize(R);E!=null&&(l.bind(t,Y.LINEAR,R,k),T.setUniform2fv("u_mosaicSize",E),T.setUniform1i("u_texture",k))}let D=-1;for(const R of i){if(!R.layerData.has(h))continue;R.key.level!==D&&(D=R.key.level,v.setDataUniforms(T,n,c,D,l));const E=2**(n-D)/r;T.setUniform1f("u_zoomFactor",E);const L=R.layerData.get(h);if(!L.lineIndexCount)continue;L.prepareForRendering(t);const B=L.vao;if(B!=null){if(t.bindVAO(B),T.setUniformMatrix3fv("u_dvsMat3",R.transforms.dvs),t.setStencilFunction(W.EQUAL,R.stencilRef,255),I||w){const J=L.patternMap;if(!J)continue;for(const[Z,C]of J){const X=l.getPageSize(Z);X!=null&&(l.bind(t,Y.LINEAR,Z,k),T.setUniform2fv("u_mosaicSize",X),T.setUniform1i("u_texture",k),t.drawElements(N.TRIANGLES,C[1],q.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*C[0]))}}else t.drawElements(N.TRIANGLES,L.lineIndexCount,q.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*L.lineIndexStart);R.triangleCount+=L.lineIndexCount/3}}}};const Jt=1/65536;class Kt extends ne{constructor(){super(...arguments),this._iconProgramOptions={id:!1,sdf:!1},this._sdfProgramOptions={id:!1},this._spritesTextureSize=ht()}dispose(){}drawMany(e,i){const{drawPhase:t,styleLayerUID:n}=e,s=e.styleLayer;let a;t===H.HITTEST&&(a=ie(n+1)),this._drawIcons(e,s,i,a),this._drawText(e,s,i,a)}_drawIcons(e,i,t,n){const{context:s,displayLevel:a,drawPhase:o,painter:r,spriteMosaic:l,state:h,styleLayerUID:d,requestRender:f,allowDelayedRender:c}=e,v=i.iconMaterial,p=r.vectorTilesMaterialManager;let _,m=!1;for(const D of t)if(D.layerData.has(d)&&(_=D.layerData.get(d),_.iconPerPageElementsMap.size>0)){m=!0;break}if(!m)return;const y=i.getPaintValue("icon-translate",a),P=i.getPaintValue("icon-translate-anchor",a);let I=i.getLayoutValue("icon-rotation-alignment",a);I===U.AUTO&&(I=i.getLayoutValue("symbol-placement",a)===oe.POINT?U.VIEWPORT:U.MAP);const x=I===U.MAP,b=i.getLayoutValue("icon-keep-upright",a)&&x,w=_.isIconSDF,g=o===H.HITTEST,S=this._iconProgramOptions;S.id=g,S.sdf=w;const M=p.getMaterialProgram(s,v,S);if(c&&f!=null&&!M.compiled)return void f();s.useProgram(M),M.setUniformMatrix3fv("u_displayViewMat3",I===U.MAP?h.displayViewMat3:h.displayMat3),M.setUniformMatrix3fv("u_displayMat3",P===K.VIEWPORT?h.displayMat3:h.displayViewMat3),M.setUniform2fv("u_iconTranslation",y),M.setUniform1f("u_depth",i.z),M.setUniform1f("u_mapRotation",pe(h.rotation)),M.setUniform1f("u_keepUpright",b?1:0),M.setUniform1f("u_level",10*a),M.setUniform1i("u_texture",k),M.setUniform1f("u_fadeDuration",re/1e3),g&&M.setUniform4fv("u_id",n);let T=-1;for(const D of t){if(!D.layerData.has(d)||(D.key.level!==T&&(T=D.key.level,v.setDataUniforms(M,a,i,T,l)),_=D.layerData.get(d),_.iconPerPageElementsMap.size===0))continue;_.prepareForRendering(s),_.updateOpacityInfo();const R=_.iconVAO;if(R!=null){s.bindVAO(R),M.setUniformMatrix3fv("u_dvsMat3",D.transforms.dvs),M.setUniform1f("u_time",(performance.now()-_.lastOpacityUpdate)/1e3);for(const[E,L]of _.iconPerPageElementsMap)this._renderIconRange(e,M,L,E,D)}}}_renderIconRange(e,i,t,n,s){const{context:a,spriteMosaic:o}=e;this._spritesTextureSize[0]=o.getWidth(n)/4,this._spritesTextureSize[1]=o.getHeight(n)/4,i.setUniform2fv("u_mosaicSize",this._spritesTextureSize),o.bind(a,Y.LINEAR,n,k),a.setStencilTestEnabled(!0),a.setStencilFunction(W.GREATER,255,255),a.setStencilWriteMask(0),a.drawElements(N.TRIANGLES,t[1],q.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),s.triangleCount+=t[1]/3}_drawText(e,i,t,n){const{context:s,displayLevel:a,drawPhase:o,glyphMosaic:r,painter:l,pixelRatio:h,spriteMosaic:d,state:f,styleLayerUID:c,requestRender:v,allowDelayedRender:p}=e,_=i.textMaterial,m=l.vectorTilesMaterialManager;let y,P=!1;for(const V of t)if(V.layerData.has(c)&&(y=V.layerData.get(c),y.glyphPerPageElementsMap.size>0)){P=!0;break}if(!P)return;const I=i.getPaintProperty("text-opacity");if(I&&!I.isDataDriven&&I.getValue(a)===0)return;const x=i.getPaintProperty("text-color"),b=!x||x.isDataDriven||x.getValue(a)[3]>0,w=i.getPaintProperty("text-halo-width"),g=i.getPaintProperty("text-halo-color"),S=(!w||w.isDataDriven||w.getValue(a)>0)&&(!g||g.isDataDriven||g.getValue(a)[3]>0);if(!b&&!S)return;const M=24/8;let T=i.getLayoutValue("text-rotation-alignment",a);T===U.AUTO&&(T=i.getLayoutValue("symbol-placement",a)===oe.POINT?U.VIEWPORT:U.MAP);const D=T===U.MAP,R=i.getLayoutValue("text-keep-upright",a)&&D,E=o===H.HITTEST,L=.8*M/h;this._glyphTextureSize||(this._glyphTextureSize=dt(r.width/4,r.height/4));const B=i.getPaintValue("text-translate",a),J=i.getPaintValue("text-translate-anchor",a),Z=this._sdfProgramOptions;Z.id=E;const C=m.getMaterialProgram(s,_,Z);if(p&&v!=null&&!C.compiled)return void v();s.useProgram(C),C.setUniformMatrix3fv("u_displayViewMat3",T===U.MAP?f.displayViewMat3:f.displayMat3),C.setUniformMatrix3fv("u_displayMat3",J===K.VIEWPORT?f.displayMat3:f.displayViewMat3),C.setUniform2fv("u_textTranslation",B),C.setUniform1f("u_depth",i.z+Jt),C.setUniform2fv("u_mosaicSize",this._glyphTextureSize),C.setUniform1f("u_mapRotation",pe(f.rotation)),C.setUniform1f("u_keepUpright",R?1:0),C.setUniform1f("u_level",10*a),C.setUniform1i("u_texture",me),C.setUniform1f("u_antialiasingWidth",L),C.setUniform1f("u_fadeDuration",re/1e3),E&&C.setUniform4fv("u_id",n);let X=-1;for(const V of t){if(!V.layerData.has(c)||(V.key.level!==X&&(X=V.key.level,_.setDataUniforms(C,a,i,X,d)),y=V.layerData.get(c),y.glyphPerPageElementsMap.size===0))continue;y.prepareForRendering(s),y.updateOpacityInfo();const le=y.textVAO;if(le==null)continue;s.bindVAO(le),C.setUniformMatrix3fv("u_dvsMat3",V.transforms.dvs),s.setStencilTestEnabled(!0),s.setStencilFunction(W.GREATER,255,255),s.setStencilWriteMask(0);const Fe=(performance.now()-y.lastOpacityUpdate)/1e3;C.setUniform1f("u_time",Fe),y.glyphPerPageElementsMap.forEach((qe,He)=>{this._renderGlyphRange(s,qe,He,r,C,S,b,V)})}}_renderGlyphRange(e,i,t,n,s,a,o,r){n.bind(e,Y.LINEAR,t,me),a&&(s.setUniform1f("u_halo",1),e.drawElements(N.TRIANGLES,i[1],q.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*i[0]),r.triangleCount+=i[1]/3),o&&(s.setUniform1f("u_halo",0),e.drawElements(N.TRIANGLES,i[1],q.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*i[0]),r.triangleCount+=i[1]/3)}}const Yt={vtlBackground:Ht,vtlFill:Gt,vtlLine:Bt,vtlCircle:Wt,vtlSymbol:Kt},jt={background:{"background.frag":`#ifdef PATTERN +uniform lowp float u_opacity; +uniform lowp sampler2D u_texture; +varying mediump vec4 v_tlbr; +varying mediump vec2 v_tileTextureCoord; +#else +uniform lowp vec4 u_color; +#endif +#ifdef ID +varying mediump vec4 v_id; +#endif +void main() { +#ifdef PATTERN +mediump vec2 normalizedTextureCoord = mod(v_tileTextureCoord, 1.0); +mediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord); +lowp vec4 color = texture2D(u_texture, samplePos); +gl_FragColor = u_opacity * color; +#else +gl_FragColor = u_color; +#endif +#ifdef ID +if (gl_FragColor.a < 1.0 / 255.0) { +discard; +} +gl_FragColor = v_id; +#endif +}`,"background.vert":`precision mediump float; +attribute vec2 a_pos; +#ifdef ID +uniform mediump vec4 u_id; +varying mediump vec4 v_id; +#endif +uniform highp mat3 u_dvsMat3; +uniform mediump float u_coord_range; +uniform mediump float u_depth; +#ifdef PATTERN +uniform mediump mat3 u_pattern_matrix; +varying mediump vec2 v_tileTextureCoord; +uniform mediump vec4 u_tlbr; +uniform mediump vec2 u_mosaicSize; +varying mediump vec4 v_tlbr; +#endif +void main() { +gl_Position = vec4((u_dvsMat3 * vec3(u_coord_range * a_pos, 1.0)).xy, u_depth, 1.0); +#ifdef PATTERN +v_tileTextureCoord = (u_pattern_matrix * vec3(a_pos, 1.0)).xy; +v_tlbr = u_tlbr / u_mosaicSize.xyxy; +#endif +#ifdef ID +v_id = u_id / 255.0; +#endif +}`},circle:{"circle.frag":`precision lowp float; +varying lowp vec4 v_color; +varying lowp vec4 v_stroke_color; +varying mediump float v_blur; +varying mediump float v_stroke_width; +varying mediump float v_radius; +varying mediump vec2 v_offset; +#ifdef ID +varying mediump vec4 v_id; +#endif +void main() +{ +mediump float dist = length(v_offset); +mediump float alpha = smoothstep(0.0, -v_blur, dist - 1.0); +lowp float color_mix_ratio = v_stroke_width < 0.01 ? 0.0 : smoothstep(-v_blur, 0.0, dist - v_radius / (v_radius + v_stroke_width)); +gl_FragColor = alpha * mix(v_color, v_stroke_color, color_mix_ratio); +#ifdef ID +if (gl_FragColor.a < 1.0 / 255.0) { +discard; +} +gl_FragColor = v_id; +#endif +}`,"circle.vert":`precision mediump float; +attribute vec2 a_pos; +#pragma header +varying lowp vec4 v_color; +varying lowp vec4 v_stroke_color; +varying mediump float v_blur; +varying mediump float v_stroke_width; +varying mediump float v_radius; +varying mediump vec2 v_offset; +#ifdef ID +uniform mediump vec4 u_id; +varying mediump vec4 v_id; +#endif +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform mediump vec2 u_circleTranslation; +uniform mediump float u_depth; +uniform mediump float u_antialiasingWidth; +void main() +{ +#pragma main +v_color = color * opacity; +v_stroke_color = stroke_color * stroke_opacity; +v_stroke_width = stroke_width; +v_radius = radius; +v_blur = max(blur, u_antialiasingWidth / (radius + stroke_width)); +mediump vec2 offset = vec2(mod(a_pos, 2.0) * 2.0 - 1.0); +v_offset = offset; +#ifdef ID +v_id = u_id / 255.0; +#endif +mediump vec3 pos = u_dvsMat3 * vec3(a_pos * 0.5, 1.0) + u_displayMat3 * vec3((v_radius + v_stroke_width) * offset + u_circleTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth, 1.0); +}`},fill:{"fill.frag":`precision lowp float; +#ifdef PATTERN +uniform lowp sampler2D u_texture; +varying mediump vec2 v_tileTextureCoord; +varying mediump vec4 v_tlbr; +#endif +#ifdef ID +varying mediump vec4 v_id; +#endif +varying lowp vec4 v_color; +vec4 mixColors(vec4 color1, vec4 color2) { +float compositeAlpha = color2.a + color1.a * (1.0 - color2.a); +vec3 compositeColor = color2.rgb + color1.rgb * (1.0 - color2.a); +return vec4(compositeColor, compositeAlpha); +} +void main() +{ +#ifdef PATTERN +mediump vec2 normalizedTextureCoord = fract(v_tileTextureCoord); +mediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord); +lowp vec4 color = texture2D(u_texture, samplePos); +gl_FragColor = v_color[3] * color; +#else +gl_FragColor = v_color; +#endif +#ifdef ID +if (gl_FragColor.a < 1.0 / 255.0) { +discard; +} +gl_FragColor = v_id; +#endif +}`,"fill.vert":`precision mediump float; +attribute vec2 a_pos; +#pragma header +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform mediump float u_depth; +uniform mediump vec2 u_fillTranslation; +#ifdef PATTERN +#include +uniform mediump vec2 u_mosaicSize; +uniform mediump float u_patternFactor; +varying mediump vec2 v_tileTextureCoord; +varying mediump vec4 v_tlbr; +#endif +#ifdef ID +uniform mediump vec4 u_id; +varying mediump vec4 v_id; +#endif +varying lowp vec4 v_color; +void main() +{ +#pragma main +v_color = color * opacity; +#ifdef ID +v_id = u_id / 255.0; +#endif +#ifdef PATTERN +float patternWidth = nextPOT(tlbr.z - tlbr.x); +float patternHeight = nextPOT(tlbr.w - tlbr.y); +float scaleX = 1.0 / (patternWidth * u_patternFactor); +float scaleY = 1.0 / (patternHeight * u_patternFactor); +mat3 patterMat = mat3(scaleX, 0.0, 0.0, +0.0, -scaleY, 0.0, +0.0, 0.0, 1.0); +v_tileTextureCoord = (patterMat * vec3(a_pos, 1.0)).xy; +v_tlbr = tlbr / u_mosaicSize.xyxy; +#endif +vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(u_fillTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth, 1.0); +}`},icon:{"icon.frag":`precision mediump float; +uniform lowp sampler2D u_texture; +#ifdef SDF +uniform lowp vec4 u_color; +uniform lowp vec4 u_outlineColor; +#endif +varying mediump vec2 v_tex; +varying lowp float v_opacity; +varying mediump vec2 v_size; +varying lowp vec4 v_color; +#ifdef SDF +varying mediump flaot v_halo_width; +#endif +#ifdef ID +varying mediump vec4 v_id; +#endif +#include +vec4 mixColors(vec4 color1, vec4 color2) { +float compositeAlpha = color2.a + color1.a * (1.0 - color2.a); +vec3 compositeColor = color2.rgb + color1.rgb * (1.0 - color2.a); +return vec4(compositeColor, compositeAlpha); +} +void main() +{ +#ifdef SDF +lowp vec4 fillPixelColor = v_color; +float d = rgba2float(texture2D(u_texture, v_tex)) - 0.5; +const float softEdgeRatio = 0.248062016; +float size = max(v_size.x, v_size.y); +float dist = d * softEdgeRatio * size; +fillPixelColor *= clamp(0.5 - dist, 0.0, 1.0); +if (v_halo_width > 0.25) { +lowp vec4 outlinePixelColor = u_outlineColor; +const float outlineLimitRatio = (16.0 / 86.0); +float clampedOutlineSize = softEdgeRatio * min(v_halo_width, outlineLimitRatio * max(v_size.x, v_size.y)); +outlinePixelColor *= clamp(0.5 - (abs(dist) - clampedOutlineSize), 0.0, 1.0); +gl_FragColor = v_opacity * mixColors(fillPixelColor, outlinePixelColor); +} +else { +gl_FragColor = v_opacity * fillPixelColor; +} +#else +lowp vec4 texColor = texture2D(u_texture, v_tex); +gl_FragColor = v_opacity * texColor; +#endif +#ifdef ID +if (gl_FragColor.a < 1.0 / 255.0) { +discard; +} +gl_FragColor = v_id; +#endif +}`,"icon.vert":`attribute vec2 a_pos; +attribute vec2 a_vertexOffset; +attribute vec4 a_texAngleRange; +attribute vec4 a_levelInfo; +attribute float a_opacityInfo; +#pragma header +#ifdef ID +uniform mediump vec4 u_id; +varying mediump vec4 v_id; +#endif +varying lowp vec4 v_color; +#ifdef SDF +varying mediump float v_halo_width; +#endif +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform highp mat3 u_displayViewMat3; +uniform mediump vec2 u_iconTranslation; +uniform vec2 u_mosaicSize; +uniform mediump float u_depth; +uniform mediump float u_mapRotation; +uniform mediump float u_level; +uniform lowp float u_keepUpright; +uniform mediump float u_fadeDuration; +varying mediump vec2 v_tex; +varying lowp float v_opacity; +varying mediump vec2 v_size; +const float C_OFFSET_PRECISION = 1.0 / 8.0; +const float C_256_TO_RAD = 3.14159265359 / 128.0; +const float C_DEG_TO_RAD = 3.14159265359 / 180.0; +const float tileCoordRatio = 1.0 / 8.0; +uniform highp float u_time; +void main() +{ +#pragma main +v_color = color; +v_opacity = opacity; +#ifdef SDF +v_halo_width = halo_width; +#endif +float modded = mod(a_opacityInfo, 128.0); +float targetOpacity = (a_opacityInfo - modded) / 128.0; +float startOpacity = modded / 127.0; +float interpolatedOpacity = clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0); +v_opacity *= interpolatedOpacity; +mediump float a_angle = a_levelInfo[1]; +mediump float a_minLevel = a_levelInfo[2]; +mediump float a_maxLevel = a_levelInfo[3]; +mediump vec2 a_tex = a_texAngleRange.xy; +mediump float delta_z = 0.0; +mediump float rotated = mod(a_angle + u_mapRotation, 256.0); +delta_z += (1.0 - step(u_keepUpright, 0.0)) * step(64.0, rotated) * (1.0 - step(192.0, rotated)); +delta_z += 1.0 - step(a_minLevel, u_level); +delta_z += step(a_maxLevel, u_level); +delta_z += step(v_opacity, 0.0); +vec2 offset = C_OFFSET_PRECISION * a_vertexOffset; +v_size = abs(offset); +#ifdef SDF +offset = (120.0 / 86.0) * offset; +#endif +mediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayViewMat3 * vec3(size * offset, 0.0) + u_displayMat3 * vec3(u_iconTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth + delta_z, 1.0); +#ifdef ID +v_id = u_id / 255.0; +#endif +v_tex = a_tex.xy / u_mosaicSize; +}`},line:{"line.frag":`precision lowp float; +varying mediump vec2 v_normal; +varying highp float v_accumulatedDistance; +varying mediump float v_lineHalfWidth; +varying lowp vec4 v_color; +varying mediump float v_blur; +#if defined (PATTERN) || defined(SDF) +varying mediump vec4 v_tlbr; +varying mediump vec2 v_patternSize; +varying mediump float v_widthRatio; +uniform sampler2D u_texture; +uniform mediump float u_antialiasing; +#endif +#ifdef SDF +#include +#endif +#ifdef ID +varying mediump vec4 v_id; +#endif +void main() +{ +mediump float fragDist = length(v_normal) * v_lineHalfWidth; +lowp float alpha = clamp((v_lineHalfWidth - fragDist) / v_blur, 0.0, 1.0); +#ifdef PATTERN +mediump float relativeTexX = fract(v_accumulatedDistance / (v_patternSize.x * v_widthRatio)); +mediump float relativeTexY = 0.5 + v_normal.y * v_lineHalfWidth / (v_patternSize.y * v_widthRatio); +mediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY)); +lowp vec4 color = texture2D(u_texture, texCoord); +gl_FragColor = alpha * v_color[3] * color; +#elif defined(SDF) +mediump float relativeTexX = fract((v_accumulatedDistance * 0.5) / (v_patternSize.x * v_widthRatio)); +mediump float relativeTexY = 0.5 + 0.25 * v_normal.y; +mediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY)); +mediump float d = rgba2float(texture2D(u_texture, texCoord)) - 0.5; +float dist = d * (v_lineHalfWidth + u_antialiasing / 2.0); +gl_FragColor = alpha * clamp(0.5 - dist, 0.0, 1.0) * v_color; +#else +gl_FragColor = alpha * v_color; +#endif +#ifdef ID +if (gl_FragColor.a < 1.0 / 255.0) { +discard; +} +gl_FragColor = v_id; +#endif +}`,"line.vert":`precision mediump float; +attribute vec2 a_pos; +attribute vec4 a_extrude_offset; +attribute vec4 a_dir_normal; +attribute vec2 a_accumulatedDistance; +#pragma header +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform highp mat3 u_displayViewMat3; +uniform mediump float u_zoomFactor; +uniform mediump vec2 u_lineTranslation; +uniform mediump float u_antialiasing; +uniform mediump float u_depth; +varying mediump vec2 v_normal; +varying highp float v_accumulatedDistance; +const float scale = 1.0 / 31.0; +const mediump float tileCoordRatio = 8.0; +#if defined (SDF) +const mediump float sdfPatternHalfWidth = 15.5; +#endif +#if defined (PATTERN) || defined(SDF) +uniform mediump vec2 u_mosaicSize; +varying mediump vec4 v_tlbr; +varying mediump vec2 v_patternSize; +varying mediump float v_widthRatio; +#endif +#ifdef ID +uniform mediump vec4 u_id; +varying mediump vec4 v_id; +#endif +varying lowp vec4 v_color; +varying mediump float v_lineHalfWidth; +varying mediump float v_blur; +void main() +{ +#pragma main +v_color = color * opacity; +v_blur = blur + u_antialiasing; +v_normal = a_dir_normal.zw * scale; +#if defined (PATTERN) || defined(SDF) +v_tlbr = tlbr / u_mosaicSize.xyxy; +v_patternSize = vec2(tlbr.z - tlbr.x, tlbr.y - tlbr.w); +#if defined (PATTERN) +v_widthRatio = width / v_patternSize.y; +#else +v_widthRatio = width / sdfPatternHalfWidth / 2.0; +#endif +#endif +v_lineHalfWidth = (width + u_antialiasing) * 0.5; +mediump vec2 dir = a_dir_normal.xy * scale; +mediump vec2 offset_ = a_extrude_offset.zw * scale * offset; +mediump vec2 dist = v_lineHalfWidth * scale * a_extrude_offset.xy; +mediump vec3 pos = u_dvsMat3 * vec3(a_pos + offset_ * tileCoordRatio / u_zoomFactor, 1.0) + u_displayViewMat3 * vec3(dist, 0.0) + u_displayMat3 * vec3(u_lineTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth, 1.0); +#if defined (PATTERN) || defined(SDF) +v_accumulatedDistance = a_accumulatedDistance.x * u_zoomFactor / tileCoordRatio + dot(dir, dist + offset_); +#endif +#ifdef ID +v_id = u_id / 255.0; +#endif +}`},outline:{"outline.frag":`varying lowp vec4 v_color; +varying mediump vec2 v_normal; +#ifdef ID +varying mediump vec4 v_id; +#endif +void main() +{ +lowp float dist = abs(v_normal.y); +lowp float alpha = smoothstep(1.0, 0.0, dist); +gl_FragColor = alpha * v_color; +#ifdef ID +if (gl_FragColor.a < 1.0 / 255.0) { +discard; +} +gl_FragColor = v_id; +#endif +}`,"outline.vert":`attribute vec2 a_pos; +attribute vec2 a_offset; +attribute vec2 a_xnormal; +#pragma header +varying lowp vec4 v_color; +#ifdef ID +uniform mediump vec4 u_id; +varying mediump vec4 v_id; +#endif +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform mediump vec2 u_fillTranslation; +uniform mediump float u_depth; +uniform mediump float u_outline_width; +varying lowp vec2 v_normal; +const float scale = 1.0 / 15.0; +void main() +{ +#pragma main +v_color = color * opacity; +#ifdef ID +v_id = u_id / 255.0; +#endif +v_normal = a_xnormal; +mediump vec2 dist = u_outline_width * scale * a_offset; +mediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(dist + u_fillTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth, 1.0); +}`},text:{"text.frag":`uniform lowp sampler2D u_texture; +varying lowp vec2 v_tex; +varying lowp vec4 v_color; +varying mediump float v_edgeWidth; +varying mediump float v_edgeDistance; +#ifdef ID +varying mediump vec4 v_id; +#endif +void main() +{ +lowp float dist = texture2D(u_texture, v_tex).a; +mediump float alpha = smoothstep(v_edgeDistance - v_edgeWidth, v_edgeDistance + v_edgeWidth, dist); +gl_FragColor = alpha * v_color; +#ifdef ID +if (gl_FragColor.a < 1.0 / 255.0) { +discard; +} +gl_FragColor = v_id; +#endif +}`,"text.vert":`attribute vec2 a_pos; +attribute vec2 a_vertexOffset; +attribute vec4 a_texAngleRange; +attribute vec4 a_levelInfo; +attribute float a_opacityInfo; +#pragma header +varying lowp vec4 v_color; +#ifdef ID +uniform mediump vec4 u_id; +varying mediump vec4 v_id; +#endif +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform highp mat3 u_displayViewMat3; +uniform mediump vec2 u_textTranslation; +uniform vec2 u_mosaicSize; +uniform mediump float u_depth; +uniform mediump float u_mapRotation; +uniform mediump float u_level; +uniform lowp float u_keepUpright; +uniform mediump float u_fadeDuration; +varying lowp vec2 v_tex; +const float offsetPrecision = 1.0 / 8.0; +const mediump float edgePos = 0.75; +uniform mediump float u_antialiasingWidth; +varying mediump float v_edgeDistance; +varying mediump float v_edgeWidth; +uniform lowp float u_halo; +const float sdfFontScale = 1.0 / 24.0; +const float sdfPixel = 3.0; +uniform highp float u_time; +void main() +{ +#pragma main +if (u_halo > 0.5) +{ +v_color = halo_color * opacity; +halo_width *= sdfPixel; +halo_blur *= sdfPixel; +} +else +{ +v_color = color * opacity; +halo_width = 0.0; +halo_blur = 0.0; +} +float modded = mod(a_opacityInfo, 128.0); +float targetOpacity = (a_opacityInfo - modded) / 128.0; +float startOpacity = modded / 127.0; +float interpolatedOpacity = clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0); +v_color *= interpolatedOpacity; +mediump float a_angle = a_levelInfo[1]; +mediump float a_minLevel = a_levelInfo[2]; +mediump float a_maxLevel = a_levelInfo[3]; +mediump vec2 a_tex = a_texAngleRange.xy; +mediump float a_visMinAngle = a_texAngleRange.z; +mediump float a_visMaxAngle = a_texAngleRange.w; +mediump float delta_z = 0.0; +mediump float angle = mod(a_angle + u_mapRotation, 256.0); +if (a_visMinAngle < a_visMaxAngle) +{ +delta_z += (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) + (1.0 - step(a_visMinAngle, angle))); +} +else +{ +delta_z += (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) * (1.0 - step(a_visMinAngle, angle))); +} +delta_z += 1.0 - step(a_minLevel, u_level); +delta_z += step(a_maxLevel, u_level); +delta_z += step(v_color[3], 0.0); +v_tex = a_tex.xy / u_mosaicSize; +#ifdef ID +v_id = u_id / 255.0; +#endif +v_edgeDistance = edgePos - halo_width / size; +v_edgeWidth = (u_antialiasingWidth + halo_blur) / size; +mediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + sdfFontScale * u_displayViewMat3 * vec3(offsetPrecision * size * a_vertexOffset, 0.0) + u_displayMat3 * vec3(u_textTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth + delta_z, 1.0); +}`},util:{"encoding.glsl":`const vec4 rgba2float_factors = vec4( +255.0 / (256.0), +255.0 / (256.0 * 256.0), +255.0 / (256.0 * 256.0 * 256.0), +255.0 / (256.0 * 256.0 * 256.0 * 256.0) +); +float rgba2float(vec4 rgba) { +return dot(rgba, rgba2float_factors); +}`,"util.glsl":`float nextPOT(in float x) { +return pow(2.0, ceil(log2(abs(x)))); +}`}};let Xt=class{constructor(e){this._readFile=e}resolveIncludes(e){return this._resolve(e)}_resolve(e,i=new Map){if(i.has(e))return i.get(e);const t=this._read(e);if(!t)throw new Error(`cannot find shader file ${e}`);const n=/^[^\S\n]*#include\s+<(\S+)>[^\S\n]?/gm;let s=n.exec(t);const a=[];for(;s!=null;)a.push({path:s[1],start:s.index,length:s[0].length}),s=n.exec(t);let o=0,r="";return a.forEach(l=>{r+=t.slice(o,l.start),r+=i.has(l.path)?"":this._resolve(l.path,i),o=l.start+l.length}),r+=t.slice(o),i.set(e,r),r}_read(e){return this._readFile(e)}};function Qt(u){let e=jt;return u.split("/").forEach(i=>{e&&(e=e[i])}),e}const Zt=new Xt(Qt);function z(u){return Zt.resolveIncludes(u)}function ei(u){const{options:e,value:i}=u;return typeof e[i]=="number"}function j(u){let e="";for(const i in u){const t=u[i];if(typeof t=="boolean")t&&(e+=`#define ${i} +`);else if(typeof t=="number")e+=`#define ${i} ${t.toFixed()} +`;else if(typeof t=="object")if(ei(t)){const{value:n,options:s,namespace:a}=t,o=a?`${a}_`:"";for(const r in s)e+=`#define ${o}${r} ${s[r].toFixed()} +`;e+=`#define ${i} ${o}${n} +`}else{const n=t.options;let s=0;for(const a in n)e+=`#define ${n[a]} ${(s++).toFixed()} +`;e+=`#define ${i} ${n[t.value]} +`}}return e}const Se=u=>j({ID:u.id,PATTERN:u.pattern}),ti={shaders:u=>({vertexShader:Se(u)+z("background/background.vert"),fragmentShader:Se(u)+z("background/background.frag")})},Te=u=>j({ID:u.id}),ii={shaders:u=>({vertexShader:Te(u)+z("circle/circle.vert"),fragmentShader:Te(u)+z("circle/circle.frag")})},Pe=u=>j({ID:u.id,PATTERN:u.pattern}),ni={shaders:u=>({vertexShader:Pe(u)+z("fill/fill.vert"),fragmentShader:Pe(u)+z("fill/fill.frag")})},Ie=u=>j({ID:u.id}),si={shaders:u=>({vertexShader:Ie(u)+z("outline/outline.vert"),fragmentShader:Ie(u)+z("outline/outline.frag")})},Me=u=>j({ID:u.id,SDF:u.sdf}),ai={shaders:u=>({vertexShader:Me(u)+z("icon/icon.vert"),fragmentShader:Me(u)+z("icon/icon.frag")})},Re=u=>j({ID:u.id,PATTERN:u.pattern,SDF:u.sdf}),oi={shaders:u=>({vertexShader:Re(u)+z("line/line.vert"),fragmentShader:Re(u)+z("line/line.frag")})},De=u=>j({ID:u.id}),ri={shaders:u=>({vertexShader:De(u)+z("text/text.vert"),fragmentShader:De(u)+z("text/text.frag")})};let li=class{constructor(){this._programByKey=new Map}dispose(){this._programByKey.forEach(e=>e.dispose()),this._programByKey.clear()}getMaterialProgram(e,i,t){const n=i.key<<3|this._getMaterialOptionsValue(i.type,t);if(this._programByKey.has(n))return this._programByKey.get(n);const s=this._getProgramTemplate(i.type),{shaders:a}=s,{vertexShader:o,fragmentShader:r}=a(t),l=i.getShaderHeader(),h=i.getShaderMain(),d=o.replace("#pragma header",l).replace("#pragma main",h),f=e.programCache.acquire(d,r,i.getAttributeLocations());return this._programByKey.set(n,f),f}_getMaterialOptionsValue(e,i){switch(e){case A.BACKGROUND:{const t=i;return(t.pattern?1:0)<<1|(t.id?1:0)}case A.FILL:{const t=i;return(t.pattern?1:0)<<1|(t.id?1:0)}case A.OUTLINE:return i.id?1:0;case A.LINE:{const t=i;return(t.sdf?1:0)<<2|(t.pattern?1:0)<<1|(t.id?1:0)}case A.ICON:{const t=i;return(t.sdf?1:0)<<1|(t.id?1:0)}case A.CIRCLE:return i.id?1:0;case A.TEXT:return i.id?1:0;default:return 0}}_getProgramTemplate(e){switch(e){case A.BACKGROUND:return ti;case A.CIRCLE:return ii;case A.FILL:return ni;case A.ICON:return ai;case A.LINE:return oi;case A.OUTLINE:return si;case A.TEXT:return ri;default:return null}}};const Ce=1e-6;class Ee{constructor(e,i){this.spriteMosaic=e,this.glyphMosaic=i,this._brushCache=new Map,this._vtlMaterialManager=new li}dispose(){this._brushCache&&(this._brushCache.forEach(e=>e.dispose()),this._brushCache=null),this._vtlMaterialManager=$e(this._vtlMaterialManager),this.spriteMosaic.dispose(),this.glyphMosaic.dispose()}get vectorTilesMaterialManager(){return this._vtlMaterialManager}drawTile(e,i,t,n){const{context:s}=e,a=t.layers;t.backgroundBucketIds.length>0&&(e.renderPass="background",t.backgroundBucketIds.forEach(o=>{const r=t.getLayerById(o);n!=null&&n!==r.type||this._renderStyleLayer(r,e,i,!0)})),s.setBlendingEnabled(!1),s.setDepthTestEnabled(!0),s.setDepthWriteEnabled(!0),s.setDepthFunction(W.LEQUAL),e.renderPass="opaque";for(let o=a.length-1;o>=0;o--){const r=a[o];n!=null&&n!==r.type||this._renderStyleLayer(r,e,i,!1)}s.setDepthWriteEnabled(!1),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(se.ONE,se.ONE_MINUS_SRC_ALPHA,se.ONE,se.ONE_MINUS_SRC_ALPHA),e.renderPass="translucent";for(let o=0;or+Ce||e.maxzoom!==void 0&&e.maxzoom<=r-Ce||(i.styleLayerUID=e.uid,i.styleLayer=e,this._drawWithBrush(i,t,o))}_drawWithBrush(e,i,t){if(!this._brushCache.has(t)){const n=Yt[t];this._brushCache.set(t,new n)}this._brushCache.get(t).drawMany(e,[i])}}let O=class extends Pt(Tt(It)){constructor(){super(...arguments),this._tileHandlerController=null,this.type="vector-tile-3d",this.levelShift=fe("disable-feature:vtl-level-shift")?0:1,this.contentZoom=fe("disable-feature:vtl-level-shift")?1:1.5}initialize(){if(this.layer.fullExtent==null)return void this.addResolvingPromise(Promise.reject(new ft("vectortilelayerview:full-extent-undefined","This layer view's layer does not define a fullExtent.")));const{basemapTerrain:u,spatialReference:e,state:i,viewingMode:t}=this.view,n=t==="local"&&!_t(e)||mt.force512VTL,s=this.layer.tileInfo.spatialReference.isGeographic,a=n?this.layer.tileInfo:this.layer.tileInfo.getOrCreateCompatible(256,s?1:2),o=this._getTileInfoSupportError(a,this.layer.fullExtent);if(o!=null)return this.addResolvingPromise(Promise.reject(o));const r=pt(()=>{var _,m;return(m=(_=this.view)==null?void 0:_.basemapTerrain)==null?void 0:m.tilingSchemeLocked}).then(()=>{var w,g,S;const _=u.tilingScheme,m=_.pixelSize,y=m===256?1:2,P=(w=u.spatialReference)!=null&&w.isGeographic&&m===256?1:0,I=(g=u.spatialReference)!=null&&g.isGeographic||m!==256?0:1;let x;if(this.schemaHelper=new Mt(y,P,this.levelShift+I),m===256){const M=this.layer.tileInfo.spatialReference.isGeographic;x=this.layer.tileInfo.getOrCreateCompatible(256,M?1:2)}else x=(S=this.view.spatialReference)!=null&&S.isGeographic?this.layer.tileInfo.getOrCreateCompatible(512,.5):this.layer.tileInfo;const b=this._getTileInfoCompatibilityError(x,_);if(b)throw b;this.tileInfo=x});this._tileHandlerController=new AbortController;const l=this.view.resourceController;this._memCache=l.memoryController.newCache(`vtl-${this.layer.uid}`,_=>{_.release()}),this.handles.add(gt(()=>this.view.qualitySettings.memoryLimit,_=>this._memCache.maxSize=Math.ceil(_/10*1048576),vt));const h=new ge(this.layer.currentStyleInfo.style);this._tileHandler=new we(this.layer,h,i.contentPixelRatio,this._memCache);const d=this._tileHandlerController.signal,f=ci(l),c=this._tileHandler.start({signal:d,schedule:f}),v=this._tileHandler.spriteMosaic;v.then(_=>{!yt(d)&&this._tileHandler&&(this.painter=new Ee(_,this._tileHandler.glyphMosaic))}),c.then(()=>this._tileHandlerController=null),this.updatingHandles.add(()=>{var _;return{style:this.layer.currentStyleInfo.style,pixelRatio:(_=this.view.state)==null?void 0:_.contentPixelRatio}},({style:_,pixelRatio:m})=>{this._tileHandlerController&&this._tileHandlerController.abort(),this._tileHandlerController=new AbortController,this._memCache.clear();const y=new ge(_),P=new we(this.layer,y,m,this._memCache),I=P.start({signal:this._tileHandlerController.signal,schedule:f}),x=P.spriteMosaic;I.then(()=>this._tileHandlerController=null),this.updatingHandles.addPromise(Promise.all([I,x]).then(([,b])=>{const w=this._tileHandler,g=this.painter;this.painter=new Ee(b,P.glyphMosaic),this._tileHandler=P,this.emit("data-changed"),w.destroy(),g&&g.dispose()}))});const p=Promise.all([r,c,v]);this.addResolvingPromise(p)}destroy(){this.painter=$e(this.painter),this._tileHandlerController=ze(this._tileHandlerController),this._tileHandler=_e(this._tileHandler),this._memCache=_e(this._memCache)}get displayLevelRange(){const u=this.tileInfo.lods,e=this.layer.minScale||u[0].scale,i=this.layer.maxScale||u[u.length-1].scale,t=this.levelRangeFromScaleRange(e,i);return this.layer.maxScale?t.maxLevel++:t.maxLevel+=this.levelShift,t}get dataScaleRange(){const u=this.tileInfo.lods;return{minScale:u[0].scale,maxScale:u[u.length-1].scale}}get dataLevelRange(){const{minScale:u,maxScale:e}=this.dataScaleRange,i=this.levelRangeFromScaleRange(u,e);return i.minLevel===1&&this.tileInfo.size[0]===256&&(i.minLevel=0),i.maxLevel+=this.levelShift,i}async fetchTile(u,e,i,t){return this._tileHandler.getVectorTile(u,e,i,t)}};F([G()],O.prototype,"layer",void 0),F([G()],O.prototype,"levelShift",void 0),F([G()],O.prototype,"contentZoom",void 0),F([G()],O.prototype,"displayLevelRange",null),F([G()],O.prototype,"tileInfo",void 0),F([G()],O.prototype,"dataScaleRange",null),F([G()],O.prototype,"dataLevelRange",null),F([G()],O.prototype,"updatingProgressValue",void 0),O=F([xt("esri.views.3d.layers.VectorTileLayerView3D")],O);const Hi=O;function ci(u){return e=>u.immediate.schedule(e)}export{Hi as default}; diff --git a/assets/VertexSnappingCandidate-0a987e12.js b/assets/VertexSnappingCandidate-0a987e12.js new file mode 100644 index 0000000..eccbc02 --- /dev/null +++ b/assets/VertexSnappingCandidate-0a987e12.js @@ -0,0 +1 @@ +import{n as r,T as n,a as s}from"./DimensionAnalysisView3D-4f55aca1.js";class o extends r{constructor(t){super({...t,constraint:new n(t.targetPoint)})}get hints(){return[new s(this.targetPoint,this.isDraped,this.domain)]}}export{o as r}; diff --git a/assets/VisualElementResources-e52972a5.js b/assets/VisualElementResources-e52972a5.js new file mode 100644 index 0000000..e256b3c --- /dev/null +++ b/assets/VisualElementResources-e52972a5.js @@ -0,0 +1 @@ +import{e7 as t,e8 as _,aD as l,e9 as n,b3 as y,aG as d,ag as b}from"./index-080e108a.js";class p{constructor(e){this._resourceFactory=e,this._resources=null,this._visible=!0,this._attached=!1}destroy(){this._destroyResources()}get object(){return this._resources!=null?this._resources.object:null}get resources(){return this._resources!=null?this._resources.external:null}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this._syncVisible())}get attached(){return this._attached}set attached(e){e!==this._attached&&(this._attached=e,this._createOrDestroyResources())}recreate(){this.attached&&this._createResources()}recreateGeometry(){if(!this._resourceFactory.recreateGeometry)return void this.recreate();const e=this._resourceFactory.view._stage;if(this._resources==null||!e)return;const r=this._resources.object;this._resources.external.forEach(s=>{s.type!==t.Mesh&&s.type!==t.Line&&s.type!==t.Point||e.remove(s)}),r.removeAllGeometries(),this._resourceFactory.recreateGeometry(this._resources.external,r,this._resources.layer),this._resources.external.forEach(s=>{s.type!==t.Mesh&&s.type!==t.Line&&s.type!==t.Point||e.add(s)})}_createOrDestroyResources(){this._attached?this._resources||this._createResources():this._destroyResources()}_createResources(){this._destroyResources();const e=this._resourceFactory,r=e.view,s=r._stage;if(!s)return;const i=new _(s,{pickable:!1,updatePolicy:l.SYNC}),o=new n({castShadow:!1}),a=e.createResources(o,i);a.forEach(c=>{s.add(c),c instanceof y&&s.loadImmediate(c)}),s.add(o),i.add(o);const h=e.cameraChanged,u=h?d(()=>r.state.camera,c=>h(c),b):null;this._resources={layer:i,object:o,external:a,cameraHandle:u},this._syncVisible()}_destroyResources(){var r;if(this._resources==null)return;const e=this._resourceFactory.view._stage;e&&(e.remove(this._resources.object),this._resources.layer.destroy(),this._resources.external.forEach(s=>e.remove(s))),this._resources.object.dispose(),(r=this._resources.cameraHandle)==null||r.remove(),this._resourceFactory.destroyResources(this._resources.external),this._resources=null}_syncVisible(){this._resources!=null&&(this._resources.object.visible=this._visible)}}export{p as a}; diff --git a/assets/VoxelLayer-b454e868.js b/assets/VoxelLayer-b454e868.js new file mode 100644 index 0000000..cff80c9 --- /dev/null +++ b/assets/VoxelLayer-b454e868.js @@ -0,0 +1 @@ +import{fs as $e,dR as ve,sa as ae,ot as se,eJ as ze,sb as ge,mB as fe,gs as Ee,dT as Oe,dk as Y,cz as A,gL as z,gM as R,ai as e,aj as o,f4 as ee,al as d,ck as v,d7 as ke,eZ as $,bh as B,aF as c,aI as te,bI as Z,bl as H,cl as G,bz as Re,bc as Ie,cM as Ce,j1 as Ue,sc as Je,c7 as ne,px as We,sd as Xe,gv as Ge,eS as Ye,bX as Ze,as as He,ar as le,ca as Ne,cq as E,ay as be,aA as Ke}from"./index-080e108a.js";import{O as Qe}from"./MultiOriginJSONSupport-e4912ffd.js";import{i as et}from"./APIKeyMixin-878a7aa7.js";import{l as tt}from"./ArcGISService-83287338.js";import{c as it}from"./OperationalLayer-0e8f8b28.js";import{j as ot}from"./PortalLayer-310c2800.js";import{N as st}from"./SceneService-6fea113d.js";import{c as rt,f as nt,p as lt}from"./commonProperties-30089b06.js";import{g as at}from"./persistable-ca976a2c.js";import{p as pt}from"./popupUtils-82ea8abb.js";import"./portalItemUtils-792a27e1.js";import"./originUtils-1469eeaf.js";import"./multiOriginJSONSupportUtils-c978f4c3.js";import"./I3SIndexInfo-445e6968.js";import"./resourceUtils-b667b05b.js";import"./resourceExtension-91e7c3ce.js";const f=Oe(),Se=se(),xe=se(),we=se(),Te=Y(0,0,1),ut=Y(0,1,0),ct=Y(1,0,0);function O(t){$e(f,t),ve(f,f);const i=Math.atan2(f[1],f[0]),s=ae(se(),Te,-i);ze(f,f,s);const r=-1*Math.atan2(f[2],f[0]);return[ge(i)+270,ge(r)+90]}function ie(t,i){return ae(xe,Te,fe(t-270)),ae(we,ut,fe(i-90)),Ee(Se,xe,we),$e(f,ct),ze(f,f,Se),ve(f,f),[f[0],f[1],f[2]]}let I=class extends A(v){constructor(i){super(i),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[i,s]=O(this.normal);return z.normalize(R(i),0,!0)}set orientation(i){const s=ie(i,this.tilt);this._set("normal",s),this._set("orientation",i)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[i,s]=O(this.normal);return z.normalize(R(s),0,!0)}set tilt(i){const s=ie(this.orientation,i);this._set("normal",s),this._set("tilt",i)}};e([o({type:Boolean,json:{write:!0}})],I.prototype,"enabled",void 0),e([o({type:String,json:{write:!0}})],I.prototype,"label",void 0),e([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ee(t=>z.normalize(R(t),0,!0))],I.prototype,"orientation",null),e([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ee(t=>z.normalize(R(t),0,!0))],I.prototype,"tilt",null),e([o({type:[Number],json:{write:!0}})],I.prototype,"normal",void 0),e([o({type:[Number],json:{write:!0}})],I.prototype,"point",void 0),I=e([d("esri.layers.voxel.VoxelSlice")],I);const oe=I;let S=class extends A(v){constructor(){super(...arguments),this.enabled=!0,this.href=null,this.id=null,this.label="",this.normal=null,this.point=null,this.sizeInPixel=null,this.slices=null,this.timeId=0,this.variableId=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[i,s]=O(this.normal);return z.normalize(R(i),0,!0)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[i,s]=O(this.normal);return z.normalize(R(s),0,!0)}};e([o({type:Boolean,json:{default:!0,write:!0}})],S.prototype,"enabled",void 0),e([o({type:String,json:{origins:{service:{read:ke}},write:{enabled:!0,isRequired:!0}}}),at({origins:["web-scene"],type:"resource",prefix:"sections",compress:!0})],S.prototype,"href",void 0),e([o({type:$,json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"id",void 0),e([o({type:String,json:{write:!0}})],S.prototype,"label",void 0),e([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],S.prototype,"orientation",null),e([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],S.prototype,"tilt",null),e([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"normal",void 0),e([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"point",void 0),e([o({type:[$],json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"sizeInPixel",void 0),e([o({type:[oe],json:{write:!0}})],S.prototype,"slices",void 0),e([o({type:$,json:{default:0,write:!0}})],S.prototype,"timeId",void 0),e([o({type:$,json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"variableId",void 0),S=e([d("esri.layers.voxel.VoxelSection")],S);const pe=S;let C=class extends v{constructor(){super(...arguments),this.diffuseFactor=.5,this.specularFactor=.5}};e([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],C.prototype,"diffuseFactor",void 0),e([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],C.prototype,"specularFactor",void 0),C=e([d("esri.layers.voxel.VoxelSimpleShading")],C);const qe=C;let N=class extends v{constructor(){super(...arguments),this.continuity=null,this.hasNoData=!1,this.noData=0,this.offset=0,this.scale=1,this.type=null}};e([o({type:["discrete","continuous"],json:{write:!0}})],N.prototype,"continuity",void 0),e([o({type:Boolean,json:{write:!0}})],N.prototype,"hasNoData",void 0),e([o({type:Number,json:{write:!0}})],N.prototype,"noData",void 0),e([o({type:Number,json:{write:!0}})],N.prototype,"offset",void 0),e([o({type:Number,json:{write:!0}})],N.prototype,"scale",void 0),e([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],N.prototype,"type",void 0),N=e([d("esri.layers.voxel.VoxelFormat")],N);const Ve=N;let j=class extends v{constructor(){super(...arguments),this.id=null,this.description="",this.name=null,this.originalFormat=null,this.renderingFormat=null,this.unit="",this.volumeId=0,this.type=null}};e([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],j.prototype,"id",void 0),e([o({type:String,json:{write:!0}})],j.prototype,"description",void 0),e([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],j.prototype,"name",void 0),e([o({type:Ve,json:{write:!0}})],j.prototype,"originalFormat",void 0),e([o({type:Ve,json:{write:{enabled:!0,isRequired:!0}}})],j.prototype,"renderingFormat",void 0),e([o({type:String,json:{write:!0}})],j.prototype,"unit",void 0),e([o({type:Number,json:{write:!0}})],j.prototype,"volumeId",void 0),e([o({type:["stc-hot-spot-results","stc-cluster-outlier-results","stc-estimated-bin","generic-nearest-interpolated"],json:{write:!0}})],j.prototype,"type",void 0),j=e([d("esri.layers.voxel.VoxelVariable")],j);const yt=j;let F=class extends A(v){constructor(){super(...arguments),this.color=B.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label="",this.colorLocked=!1}};e([o({type:B,json:{type:[$],write:{enabled:!0,isRequired:!0}}})],F.prototype,"color",void 0),e([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],F.prototype,"value",void 0),e([o({type:Boolean,json:{default:!0,write:!0}})],F.prototype,"enabled",void 0),e([o({type:String,json:{write:!0}})],F.prototype,"label",void 0),e([o({type:Boolean,json:{default:!1,write:!0}})],F.prototype,"colorLocked",void 0),F=e([d("esri.layers.voxel.VoxelIsosurface")],F);const De=F;let U=class extends A(v){constructor(){super(...arguments),this.color=null,this.position=0}};e([o({type:B,json:{type:[$],write:{enabled:!0,isRequired:!0}}})],U.prototype,"color",void 0),e([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],U.prototype,"position",void 0),U=e([d("esri.layers.voxel.VoxelColorStop")],U);const ue=U;let J=class extends A(v){constructor(){super(...arguments),this.opacity=1,this.position=0}};e([o({type:Number,json:{name:"alpha",write:{enabled:!0,isRequired:!0}}})],J.prototype,"opacity",void 0),e([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],J.prototype,"position",void 0),J=e([d("esri.layers.voxel.VoxelOpacityStop")],J);const ce=J;let W=class extends A(v){constructor(){super(...arguments),this.enabled=!1,this.range=null}};e([o({type:Boolean,json:{default:!1,write:!0}})],W.prototype,"enabled",void 0),e([o({type:[Number],json:{write:!0}})],W.prototype,"range",void 0),W=e([d("esri.layers.voxel.VoxelRangeFilter")],W);const dt=W;var V;(function(t){t[t.Color=1]="Color",t[t.Alpha=2]="Alpha",t[t.Both=3]="Both"})(V||(V={}));let T=class extends A(v){constructor(i){super(i),this.interpolation=null,this.stretchRange=null,this.rangeFilter=null,this._colorMapSize=256,this.colorStops=new(c.ofType(ue)),this.opacityStops=new(c.ofType(ce))}set colorStops(i){this._set("colorStops",te(i,this._get("colorStops"),c.ofType(ue)))}set opacityStops(i){this._set("opacityStops",te(i,this._get("opacityStops"),c.ofType(ce)))}getPreviousNext(i,s,r){let n=i;for(;--n>0&&s[n].type!==r&&s[n].type!==V.Both;);let l=i;const y=s.length;for(;++lu.position{h.color[re]=Math.round(H(k[re],Be[re],g))})}else m!==-1?K.forEach(g=>{h.color[g]=r[m].color[g]}):K.forEach(g=>{h.color[g]=r[b].color[g]})}}for(const u of r)s.push({color:u.color,position:u.position})}s[0].position=0,s[s.length-1].position=1;let l=0,y=1;for(let p=0;ps[y].position;)l=y++;const h=(u-s[l].position)/(s[y].position-s[l].position),m=s[l].color,b=s[y].color,g=new B;K.forEach(k=>{g[k]=Math.round(H(m[k],b[k],h))}),g.a=Z(1-H(m.a,b.a,h)/255,0,1),i.push(g)}return i}getColorForContinuousDataValue(i,s){const r=this.rasterizedTransferFunction;if(this.colorStops.length<2||!Array.isArray(this.stretchRange)||this.stretchRange.length<2||r.length<256)return null;let n=this.stretchRange[0],l=this.stretchRange[1];if(n>l){const p=n;n=l,l=p}i=Z(i,n,l);const y=r[Math.round((i-n)/(l-n)*(this._colorMapSize-1))].clone();return s||(y.a=1),y}};e([o({type:["linear","nearest"],json:{write:!0}})],T.prototype,"interpolation",void 0),e([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],T.prototype,"stretchRange",void 0),e([o({type:c.ofType(ue),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.colorStops&&this.colorStops.length>0}}}}})],T.prototype,"colorStops",null),e([o({type:c.ofType(ce),json:{read:{source:"alphaStops"},write:{enabled:!0,target:"alphaStops",overridePolicy(){return{enabled:!!this.opacityStops&&this.opacityStops.length>0}}}}})],T.prototype,"opacityStops",null),e([o({type:dt,json:{write:!0}})],T.prototype,"rangeFilter",void 0),e([o({type:[B],clonable:!1,json:{read:!1}})],T.prototype,"rasterizedTransferFunction",null),T=e([d("esri.layers.voxel.VoxelTransferFunctionStyle")],T);const ht=T,K=["r","g","b"];let P=class extends A(v){constructor(){super(...arguments),this.color=B.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=""}};e([o({type:B,json:{type:[$],write:{enabled:!0,isRequired:!0}}})],P.prototype,"color",void 0),e([o({type:$,json:{write:{enabled:!0,isRequired:!0}}})],P.prototype,"value",void 0),e([o({type:Boolean,json:{default:!0,write:!0}})],P.prototype,"enabled",void 0),e([o({type:String,json:{write:!0}})],P.prototype,"label",void 0),P=e([d("esri.layers.voxel.VoxelUniqueValue")],P);const Ae=P;var ye;let L=ye=class extends v{constructor(t){super(t),this.variableId=0,this.label="",this.transferFunction=null,this.uniqueValues=null,this.isosurfaces=null,this.uniqueValues=new(c.ofType(Ae)),this.isosurfaces=new(c.ofType(De))}clone(){return new ye({variableId:this.variableId,label:this.label,transferFunction:G(this.transferFunction),uniqueValues:G(this.uniqueValues),isosurfaces:G(this.isosurfaces)})}};e([o({type:$,json:{write:{enabled:!0,isRequired:!0}}})],L.prototype,"variableId",void 0),e([o({type:String,json:{write:!0}})],L.prototype,"label",void 0),e([o({type:ht,json:{write:{enabled:!0,overridePolicy(){return{enabled:!this.uniqueValues||this.uniqueValues.length<1}}}}})],L.prototype,"transferFunction",void 0),e([o({type:c.ofType(Ae),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.uniqueValues&&this.uniqueValues.length>0}}}}})],L.prototype,"uniqueValues",void 0),e([o({type:c.ofType(De),json:{write:{enabled:!0,overridePolicy(){const t=!this.uniqueValues||this.uniqueValues.length<1,i=!!this.isosurfaces&&this.isosurfaces.length>0;return{enabled:t&&i}}}}})],L.prototype,"isosurfaces",void 0),L=ye=e([d("esri.layers.voxel.VoxelVariableStyle")],L);const Fe=L;let Q=class extends v{constructor(){super(...arguments),this.values=null}};e([o({type:[Number],json:{write:!0}})],Q.prototype,"values",void 0),Q=e([d("esri.layers.voxel.VoxelIrregularSpacing")],Q);const mt=Q;let X=class extends v{constructor(){super(...arguments),this.scale=1,this.offset=0}};e([o({type:Number,json:{write:!0}})],X.prototype,"scale",void 0),e([o({type:Number,json:{write:!0}})],X.prototype,"offset",void 0),X=e([d("esri.layers.voxel.VoxelRegularSpacing")],X);const vt=X;let x=class extends v{constructor(){super(...arguments),this.irregularSpacing=null,this.isPositiveUp=!0,this.isWrappedDateLine=!1,this.label=null,this.name=null,this.quantity=null,this.regularSpacing=null,this.size=0,this.unit=null}get isRegular(){return(this.irregularSpacing==null||this.irregularSpacing===void 0)&&this.regularSpacing!==null}getRange(){var i;return this.isRegular?[this.regularSpacing.offset,this.regularSpacing.offset+this.regularSpacing.scale*(this.size-1)]:Array.isArray((i=this.irregularSpacing)==null?void 0:i.values)&&this.irregularSpacing.values.length>1?[this.irregularSpacing.values[0],this.irregularSpacing.values[this.irregularSpacing.values.length-1]]:[0,0]}};e([o({type:mt,json:{write:!0}})],x.prototype,"irregularSpacing",void 0),e([o({type:Boolean,json:{write:!0}})],x.prototype,"isPositiveUp",void 0),e([o({type:Boolean,json:{write:!0}})],x.prototype,"isWrappedDateLine",void 0),e([o({type:String,json:{write:!0}})],x.prototype,"label",void 0),e([o({type:String,json:{write:!0}})],x.prototype,"name",void 0),e([o({type:String,json:{write:!0}})],x.prototype,"quantity",void 0),e([o({type:vt,json:{write:!0}})],x.prototype,"regularSpacing",void 0),e([o({type:Number,json:{write:!0}})],x.prototype,"size",void 0),e([o({type:String,json:{write:!0}})],x.prototype,"unit",void 0),e([o({type:Boolean,json:{read:!1}})],x.prototype,"isRegular",null),x=e([d("esri.layers.voxel.VoxelDimension")],x);const gt=x,Le="esri.layers.voxel.VoxelVolume",je=Re.getLogger(Le);let w=class extends v{constructor(t){super(t),this.id=0,this.dimensions=null,this.spatialReference=Ie.WGS84}get zDimension(){if(!this.dimensions||!Array.isArray(this.dimensions)||this.dimensions.length!==4)return-1;for(let t=2;t<4;++t)if(this.dimensions[t].size>0)return t;return-1}get isValid(){return!!this.dimensions&&!!Array.isArray(this.dimensions)&&this.dimensions.length===4&&!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(this.zDimension===-1||this.dimensions[this.zDimension].size<1)}get originInLayerSpace3D(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const t=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size];return[t[0],i[0],r[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const t=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size],n=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let l=0;l<3;++l)n[l]<2?n[l]=1:n[l]-=1;return s.isRegular&&!s.isPositiveUp&&(n[2]*=-1),[(t[1]-t[0])/n[0],(i[1]-i[0])/n[1],(r[1]-r[0])/n[2]]}get volumeType(){if(this.isValid){const t=this.dimensions[2].size>0,i=this.dimensions[3].size>0;if(!t&&i)return"xyt";if(t&&i)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const t=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[t].size]}computeVoxelSpaceLocation(t){var r;if(!this.isValid)return[0,0,0];if(this.volumeType==="xyt")return je.error("computeVoxelSpacePosition cannot be used with XYT volumes."),[0,0,0];if(!Ce(this.spatialReference,t.spatialReference))return je.error("pos argument should have the same spatial reference as the VoxelLayer."),[0,0,0];const i=Y(t.x,t.y,t.z??0);Ue(i,i,this.originInLayerSpace3D),Je(i,i,this.voxelSizeInLayerSpaceSigned);const s=this.dimensions[this.zDimension];if(!s.isRegular&&Array.isArray((r=s.irregularSpacing)==null?void 0:r.values)&&s.irregularSpacing.values.length>1){const n=t.z??0,l=s.irregularSpacing.values,y=s.isPositiveUp?1:-1,p=l.reduce((u,h)=>Math.abs(y*h-n)z.normalize(R(t),0,!0))],q.prototype,"orientation",null),e([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ee(t=>z.normalize(R(t),0,!0))],q.prototype,"tilt",null),e([o({type:[Number],json:{write:!0}})],q.prototype,"normal",void 0),e([o({type:[Number],json:{write:!0}})],q.prototype,"point",void 0),q=e([d("esri.layers.voxel.VoxelDynamicSection")],q);const he=q;var me;let D=me=class extends v{constructor(t){super(t),this.volumeId=0,this.verticalExaggeration=1,this.exaggerationMode="scale-height",this.verticalOffset=0,this.slices=new(c.ofType(oe)),this.dynamicSections=new(c.ofType(he))}set slices(t){this._set("slices",te(t,this._get("slices"),c.ofType(oe)))}set dynamicSections(t){this._set("dynamicSections",te(t,this._get("dynamicSections"),c.ofType(he)))}clone(){return new me({volumeId:this.volumeId,verticalExaggeration:this.verticalExaggeration,exaggerationMode:this.exaggerationMode,verticalOffset:this.verticalOffset,slices:G(this.slices),dynamicSections:G(this.dynamicSections)})}};e([o({type:$,json:{write:{enabled:!0,isRequired:!0}}})],D.prototype,"volumeId",void 0),e([o({type:Number,json:{default:1,write:!0}})],D.prototype,"verticalExaggeration",void 0),e([o({type:["scale-position","scale-height"],json:{default:"scale-height",write:!0}})],D.prototype,"exaggerationMode",void 0),e([o({type:Number,json:{default:0,write:!0}})],D.prototype,"verticalOffset",void 0),e([o({type:c.ofType(oe),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.slices&&this.slices.length>0}}}}})],D.prototype,"slices",null),e([o({type:c.ofType(he),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.dynamicSections&&this.dynamicSections.length>0}}}}})],D.prototype,"dynamicSections",null),D=me=e([d("esri.layers.voxel.VoxelVolumeStyle")],D);const Pe=D,_e="esri.layers.VoxelLayer",M=Re.getLogger(_e);let a=class extends st(tt(it(ot(Ye(Qe(et(Ke))))))){constructor(t){super(t),this.serviceRoot="",this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.shading=new qe,this.opacity=1,this.variables=new c,this.volumes=new c,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.popupEnabled=!0,this.popupTemplate=null,this.test=null,this.volumeStyles=new(c.ofType(Pe)),this.variableStyles=new(c.ofType(Fe)),this.sections=new(c.ofType(pe)),t!=null&&t.constantUpscaling&&(this.test={constantUpscaling:!0})}set url(t){this._set("url",Ze(t,M))}load(t){const i=t!=null?t.signal:null,s=this.loadFromPortal({supportedTypes:["Scene Service"]},t).catch(He).then(()=>this._fetchService(i)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(s),Promise.resolve(this)}read(t,i){super.read(t,i);for(const s of this.volumes)s.spatialReference=this.spatialReference}readVersion(t,i){return super.parseVersionString(t)}validateLayer(t){if(t.layerType&&t.layerType!==this.operationalLayerType)throw new le("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:t.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new le("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new le("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(t,i,s){if(t!=null&&typeof t=="object"){const r=Ne.fromJSON(t,s);if(r.zmin===0&&r.zmax===0&&Array.isArray(i.volumes)){const n=Me.fromJSON(i.volumes[0]);if(n.isValid&&n.volumeType!=="xyt"){const l=n.dimensions[2];if(l.isRegular){let y=l.regularSpacing.offset,p=l.regularSpacing.offset+l.regularSpacing.scale*(l.size-1);if(y>p){const u=y;y=p,p=u}r.zmin=y,r.zmax=p}}}return r}return null}get voxelFields(){const t=[new E({name:"Voxel.ServiceValue",alias:"Value",domain:null,editable:!1,length:128,type:"string"}),new E({name:"Voxel.ServiceVariableLabel",alias:"Variable",domain:null,editable:!1,length:128,type:"string"}),new E({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"})],i=this.getVolume(null);if(i!=null){if(i.volumeType==="xyzt"||i.volumeType==="xyt"){const s=new E({name:"Voxel.ServiceLocalTime",alias:"Local Time",domain:null,editable:!1,length:128,type:"string"});t.push(s);const r=new E({name:"Voxel.ServiceNativeTime",alias:"Native Time",domain:null,editable:!1,length:128,type:"string"});t.push(r)}if(i.volumeType!=="xyt"){const s=new E({name:"Voxel.ServiceDepth",alias:"Depth",domain:null,editable:!1,length:128,type:"string"});t.push(s)}}return t}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(t){const i=this.voxelFields,s=this.title;return pt({fields:i,title:s},t)}getConfiguration(){var i,s;const t={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:(i=this.index)==null?void 0:i.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return t.index&&((s=this.index)!=null&&s.isValid())?JSON.stringify(t):""}getVariableStyle(t){let i=-1;if(i=t??this.currentVariableId,!this.variableStyles||i===-1)return null;const s=this.variableStyles.findIndex(r=>r.variableId===i);return s<0?null:this.variableStyles.at(s)}getVariable(t){let i=-1;if(i=t??this.currentVariableId,!this.variables||i===-1)return null;const s=this.variables.findIndex(r=>r.id===i);return s<0?null:this.variables.at(s)}getVolume(t){const i=this.getVariable(t);return i!=null?this.volumes.find(({id:s})=>s===i.volumeId):null}getVolumeStyle(t){const i=this.getVariable(t);return i!=null?this.volumeStyles.find(({volumeId:s})=>s===i.volumeId):null}getColorForContinuousDataValue(t,i,s){var y;const r=this.getVariable(t);if(r==null||((y=r.renderingFormat)==null?void 0:y.continuity)!=="continuous"||!this.variableStyles)return null;const n=this.variableStyles.findIndex(p=>p.variableId===t);if(n<0)return null;const l=this.variableStyles.at(n);return l!=null&&l.transferFunction?l.transferFunction.getColorForContinuousDataValue(i,s):null}getSections(){const t=[];for(const i of this.sections)t.push(new pe({enabled:i.enabled,href:i.href,id:i.id,label:i.label,normal:i.normal,point:i.point,sizeInPixel:i.sizeInPixel,slices:i.slices,timeId:i.timeId,variableId:i.variableId}));return t}getVariableStyles(){const t=[];for(const i of this.variableStyles){const s=this._getVariable(i);if(s!=null){const r=i.clone();r.isosurfaces.length>4&&(r.isosurfaces=r.isosurfaces.slice(0,3),M.error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const n of r.isosurfaces)if(!n.colorLocked){const l=this.getColorForContinuousDataValue(r.variableId,n.value,!1);l===null||l.equals(n.color)||(n.color=l)}if(s.renderingFormat.continuity==="continuous")(r.transferFunction===null||r.transferFunction.colorStops.length<2)&&M.error(`VoxelVariableStyle for variable ${s.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),r.transferFunction!==null&&(Array.isArray(r.transferFunction.stretchRange)&&r.transferFunction.stretchRange.length===2||(M.error(`VoxelVariableStyle for variable ${s.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),r.transferFunction.stretchRange=[0,1],r.transferFunction.colorStops.removeAll()));else if(s.renderingFormat.continuity==="discrete")if(i.uniqueValues.length===0)M.error(`VoxelVariableStyle for variable ${s.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const n of i.uniqueValues)n.label!==null&&n.label!==void 0||n.value===null||n.value===void 0||(n.label=n.value.toString());t.push(r)}else M.error(`VoxelVariable ID=${i.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return t}getVolumeStyles(){const t=[];for(const i of this.volumeStyles){const s=this._getVolumeFromVolumeId(i.volumeId);if(s!=null){const r=i.clone();for(const n of r.slices)this._isPlaneValid(n,[0,1,s.zDimension],s.dimensions)||(n.enabled=!1,n.label="invalid");for(const n of r.dynamicSections)this._isPlaneValid(n,[0,1,s.zDimension],s.dimensions)||(n.enabled=!1,n.label="invalid");t.push(r)}else M.error(`VoxelVolume ID=${i.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return t}_getVariable(t){const i=t.variableId;for(const s of this.variables)if(s.id===i)return s;return null}_getVolumeFromVolumeId(t){for(const i of this.volumes)if(i.id===t)return i;return null}_isPlaneValid(t,i,s){if(!t.point||!Array.isArray(t.point)||t.point.length!==3||!t.normal||!Array.isArray(t.normal)||t.normal.length!==3)return!1;const r=Y(t.normal[0],t.normal[1],t.normal[2]);ve(r,r);const n=1e-6;return!(Math.abs(r[0])+Math.abs(r[1])+Math.abs(r[2])1){const v=a.dimensions[c],W=h.size*t.size*v.size;let b=1;switch(l.renderingFormat.type){case"Int16":case"UInt16":b=2;break;case"Int32":case"UInt32":case"Float32":b=4}this._futureMemory=b*W}}const r=this.view.addVoxelLayerViewToWasm(this).then(h=>{this._wasmLayerId=h,this._suspendedHandle=o(()=>this.suspended,t=>{const c=this.view.voxelWasm;c!=null&&c.setEnabled(this,!t)},g),this.handles.add([o(()=>this.layer.renderMode,t=>this._pushRenderModeToWasm(t)),o(()=>this.layer.currentVariableId,t=>this._pushCurrentVariableIdToWasm(t)),o(()=>this.layer.getSections(),t=>this._pushSectionsToWasm(t)),o(()=>this.layer.getVariableStyles(),t=>this._pushVariableStylesToWasm(t)),o(()=>this.layer.getVolumeStyles(),t=>this._pushVolumeStylesToWasm(t)),o(()=>this.layer.enableDynamicSections,t=>this._pushEnableDynamicSectionsToWasm(t)),o(()=>this.layer.enableIsosurfaces,t=>this._pushEnableIsosurfacesToWasm(t)),o(()=>this.layer.enableSections,t=>this._pushEnableSectionsToWasm(t)),o(()=>this.layer.enableSlices,t=>this._pushEnableSlicesToWasm(t)),o(()=>this.slicePlaneEnabled,t=>this._pushAnalysisSliceToWasm(t,this.view.slicePlane)),o(()=>this.view.slicePlane,t=>this._pushAnalysisSliceToWasm(this.slicePlaneEnabled,t))])}).catch(h=>{if(this.view.removeVoxelLayerViewFromWasm(this),this._wasmLayerId=-1,h===-1)throw new m("voxel:addLayer-failure","The voxel layer description was invalid.",{});if(h===-2)throw new m("voxel:addLayer-failure","The voxel layer web assembly module failed to download.",{})});this.addResolvingPromise(r)}destroy(){this.view.removeVoxelLayerViewFromWasm(this),this._suspendedHandle&&(this._suspendedHandle.remove(),this._suspendedHandle=null)}isUpdating(){const e=this.view.voxelWasm;return!(this._wasmLayerId<0||e==null)&&e.isUpdating(this._wasmLayerId)}updatingFlagChanged(){this.notifyChange("updating")}get usedMemory(){return this._usedMemory}get unloadedMemory(){return this._futureMemory}get performanceInfo(){return{nodes:0,displayedNumberOfFeatures:0,maximumNumberOfFeatures:0,totalNumberOfFeatures:0,core:null}}whenGraphicBounds(e,s){const a=e.attributes["Voxel.WorldPosition"];if(a){const l=f(),r=JSON.parse(a);if(x(r,this.view.renderSpatialReference,V,this.view.spatialReference||T.WGS84))return E(l,V),Promise.resolve({boundingBox:l,screenSpaceObjects:[]})}return Promise.reject()}setUsedMemory(e){this._usedMemory=e,this._futureMemory=0}captureFrustum(){const e=this.view.voxelWasm;e!=null&&e.captureFrustum()}toggleFullVolumeExtentDraw(){const e=this.view.voxelWasm;e!=null&&e.toggleFullVolumeExtentDraw(this)}getLayerTimes(){let e=[];const s=this.view.voxelWasm;return s!=null&&(e=s.getLayerTimes(this)),e}getCurrentLayerTimeIndex(){let e=0;const s=this.view.voxelWasm;return s!=null&&(e=s.getCurrentLayerTimeIndex(this)),e}_pushRenderModeToWasm(e){const s=this.view.voxelWasm;this._dbg(i.VerboseAPI,"VoxelLayerView3D._pushRenderModeToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s!=null&&s.setRenderMode(this,e)||this._dbg(i.Error,"VoxelLayerView3D._pushRenderModeToWasm() failed!")}_pushSectionsToWasm(e){const s=this.view.voxelWasm;this._dbg(i.VerboseAPI,"VoxelLayerView3D._pushSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s!=null&&s.setStaticSections(this,e)||this._dbg(i.Error,"VoxelLayerView3D._pushSectionsToWasm() failed!")}_pushCurrentVariableIdToWasm(e){const s=this.view.voxelWasm;this._dbg(i.VerboseAPI,"VoxelLayerView3D._pushCurrentVariableIdToWasm() called!, "+(s!=null?"have WASM":"don't have WASM!!!")),s!=null&&s.setCurrentVariable(this,e)||this._dbg(i.Error,"VoxelLayerView3D._pushCurrentVariableIdToWasm() failed!")}_pushVariableStylesToWasm(e){const s=this.view.voxelWasm;this._dbg(i.VerboseAPI,"VoxelLayerView3D._pushVariableStylesToWasm() called, "+(s?"have WASM":"don't have WASM!!!"));let a=!1;s!=null&&(a=s.setVariableStyles(this,e),a||this._dbg(i.Error,"VoxelLayerView3D._pushVariableStylesToWasm() failed!"))}_accountForEnableSlices(e,s){const a=s??this.layer.enableSlices;for(let l=0;lM(()=>import("./vxlLayer-78040c8d.js"),["assets/vxlLayer-78040c8d.js","assets/index-080e108a.js","assets/index-a8e73b5e.css"]).then(t=>t.v).then(({default:t})=>{const i=t({locateFile:ne,preinitializedWebGLContext:s,onRuntimeInitialized:()=>e(i)})})).catch(e=>{throw e})}function ne(s){return q(`esri/libs/vxl/${s}`)}const b=O.getLogger("esri.layers.VoxelWasmPerSceneView");var o;(function(s){s[s.Lifetime=1]="Lifetime",s[s.RequestResponse=2]="RequestResponse",s[s.Rendering=3]="Rendering",s[s.Error=4]="Error"})(o||(o={}));class oe{constructor(e){this._halfIntTexturesAvailable=!1,this._textureFloatLinearAvailable=!1,this._havePreparedWithAllLayers=!1,this._readyWatchHandle=null,this._qualityWatchHandle=null,this._stationaryWatchHandle=null,this._timeExtentWatchHandle=null,this._renderPluginContext=null,this._vxlPromise=null,this._vxl=null,this._pluginIsActive=!1,this._moreToLoad=!1,this._viewportWidth=-1,this._viewportHeight=-1,this._newLayers=[],this._layers=new Map,this._shaderOutput=$.Color,this._renderSlot=N.VOXEL,this._rctx=null,this._renderTargetToRestore=null,this._lastFrameWasStationary=!1,this._wasmMemBlockSizes=[512,1024,2048,4096,8192,16384,32768,65536],this._wasmMemBlocks=new Map,this._dbgFlags=new Set,this._captureFrustum=!1,this._frustum=null,this._frustumRenderableId=-1,this._renderCoordsHelper=null,this.type=D.VOXEL,this.slicePlaneEnabled=!0,this.isGround=!1,this.layerUid=[],this._view=e,this._initialize()}get canRender(){return!!this._vxl&&this._view.viewingMode==="local"}_dbg(e,t){this._dbgFlags.has(e)&&(e===o.Error?b.error(t):b.warn(t))}_removeRenderPlugin(){this._pluginIsActive&&this._view._stage&&(this._dbg(o.Lifetime,"--removeRenderPlugin--"),this._view._stage.removeRenderPlugin(this)),this._pluginIsActive=!1}_initialize(){this._dbg(o.Lifetime,"--initialize--");for(const e of this._wasmMemBlockSizes)this._wasmMemBlocks.set(e,0);this._readyWatchHandle=E(()=>this._view.ready,e=>{e&&this._view.viewingMode==="local"?(this._dbg(o.Lifetime,"view ready status changed to ready on a local view, calling addRenderPlugin"),this._view._stage.addRenderPlugin([this._renderSlot],this),this._pluginIsActive=!0):(this._dbg(o.Lifetime,"view ready status changed, not ready or not a local view!"),this._removeRenderPlugin())},{initial:!0}),this._qualityWatchHandle=E(()=>{var e;return(e=this._view)==null?void 0:e.qualityProfile},e=>{this._dbg(o.Rendering,"qualityProfile changed to "+e),this._vxl&&this._vxl.set_quality(this._toWasmQuality(e))},{initial:!0}),this._timeExtentWatchHandle=E(()=>{var e;return(e=this._view)==null?void 0:e.timeExtent},()=>{var e;if(this._vxl){const t=this._getTimeArgs((e=this._view)==null?void 0:e.timeExtent);this._dbg(o.Rendering,"sceneView timeExtent changed to useTime="+t.useTime+" st="+t.startTime+" et="+t.endTime),this._vxl.set_scene_time_extent(t.startTime,t.endTime,t.useTime),this._renderPluginContext.requestRender()}},{initial:!0}),this._stationaryWatchHandle=E(()=>{var e;return(e=this._view)==null?void 0:e.stationary},e=>{this._vxl&&e&&!this._lastFrameWasStationary&&this._renderPluginContext.requestRender()})}initializeRenderContext(e){this._dbg(o.Lifetime,"--initializeRenderContext--");const t=e.renderContext.rctx;t.type===H.WEBGL2?(this._renderPluginContext=e,this._rctx=e.renderContext.rctx,this._halfIntTexturesAvailable=!!this._rctx.capabilities.textureNorm16,this._textureFloatLinearAvailable=this._rctx.capabilities.textureFloatLinear,this._initializeWasm(t.gl)):this._dbg(o.Error,"WebGL 1 context only!")}uninitializeRenderContext(){this._renderPluginContext=null,this._rctx=null,this._dbg(o.Lifetime,"--uninitializeRenderContext--")}_restoreFramebuffer(){if(!this._renderTargetToRestore)return;const e=this._renderTargetToRestore.fbo;if(!this._rctx)return void this._dbg(o.Error,"no context in restoreFramebuffer!");this._rctx.bindFramebuffer(e,!0);const t=this._renderTargetToRestore.viewport;this._rctx.setViewport(t.x,t.y,t.width,t.height)}_bindPreviousDepthToSlot(e,t){const i=!!this._rctx,r=!!this._renderTargetToRestore;if(!i||!r)return 0;const n=this._renderTargetToRestore.fbo.depthStencilTexture;return n?(t===0?this._rctx.bindTexture(null,e,!0):this._rctx.bindTexture(n,e,!0),1):(this._dbg(o.Error,"no depth/stencil texture exists!"),0)}_modifyResourceCount(e,t,i){if(!this._rctx)return void this._dbg(o.Error,"modifyAllocation callback has no rendering context!");const r=e;i===1?this._rctx.instanceCounter.increment(r,t):this._rctx.instanceCounter.decrement(r,t)}_setBlendState(e,t,i,r){this._rctx?(this._rctx.setBlendingEnabled(e===1),this._rctx.setBlendFunction(t,i),this._rctx.setBlendEquation(r)):this._dbg(o.Error,"setBlendState callback has no rendering context!")}_setFrontFace(e){this._rctx?this._rctx.setFrontFace(e):this._dbg(o.Error,"setFrontFace callback has no rendering context!")}_setDepthStencilStateFunction(e,t,i){this._rctx?(this._rctx.setDepthFunction(i),this._rctx.setDepthTestEnabled(e===1),this._rctx.setDepthWriteEnabled(t===1),this._rctx.setStencilTestEnabled(!1),this._rctx.setStencilFunction(z.ALWAYS,0,255),this._rctx.setStencilOpSeparate(V.FRONT,T.KEEP,T.INCR,T.KEEP),this._rctx.setStencilOpSeparate(V.BACK,T.KEEP,T.DECR,T.KEEP)):this._dbg(o.Error,"setDepthStencilStateFunction callback has no rendering context!")}_setRasterizerState(e){if(this._rctx)switch(e){case S.None:this._rctx.setFaceCullingEnabled(!1);break;case S.Back:this._rctx.setCullFace(V.BACK),this._rctx.setFaceCullingEnabled(!0);break;case S.Front:this._rctx.setCullFace(V.FRONT),this._rctx.setFaceCullingEnabled(!0)}else this._dbg(o.Error,"setRasterizerState callback has no rendering context!")}_setViewport(e,t,i,r){this._rctx?this._rctx.setViewport(e,t,i,r):this._dbg(o.Error,"setViewport callback has no rendering context!")}_updateMemoryUsage(){this._layers.forEach((e,t)=>{if(e.needMemoryUsageUpdate){const i=this._vxl.estimate_memory_usage(t);i>=0&&(e.needMemoryUsageUpdate=!1,e.layerView.setUsedMemory(i))}})}_syncRequestsResponses(){this._layers.forEach((e,t)=>{const i=[];e.responses.forEach((a,u)=>{i.push(u),this._dbg(o.RequestResponse,"responding for requestID:"+u+" size:"+a.size),this._vxl.respond(t,u,a),a.requestType!==F.TreeIndex&&a.requestType!==F.Section||(e.needMemoryUsageUpdate=!0)});const r=e.responses;for(const a of i)r.delete(a);const n=this._vxl.get_new_requests(t),l=e.abortController.signal;for(const a in n){e.outstandingRequestCount+=1,e.outstandingRequestCount===1&&e.layerView.updatingFlagChanged();const u=n[a],f={responseType:"array-buffer",signal:l};this._dbg(o.RequestResponse,"making requestID:"+a+" url:"+u.url),j(u.url,f).then(d=>{e.outstandingRequestCount-=1,e.outstandingRequestCount===0&&e.layerView.updatingFlagChanged(),this._dbg(o.RequestResponse,"have response for requestID:"+a);let c=0;if(d.data.byteLength>0){c=this._vxl._malloc(d.data.byteLength);const _=new Uint8Array(this._vxl.HEAPU8.buffer,c,d.data.byteLength),g=new Uint8Array(d.data);for(let x=0;x{e.outstandingRequestCount-=1,e.outstandingRequestCount===0&&e.layerView.updatingFlagChanged(),G(d)||(this._dbg(o.Error,`requestID:${a} failed, error=${d.toString()}`),r.set(+a,{responseType:u.responseType,ptr:0,size:0,success:!1,requestType:u.requestType}))})}})}updateWasmCamera(e){this._vxl.set_projection_matrix.apply(this._vxl,e.projectionMatrix),this._vxl.set_view_matrix.apply(this._vxl,e.viewMatrix),this._vxl.set_near_far(e.near,e.far)}isUpdating(e){if(!this._vxl&&this._vxlPromise)return!0;const t=this._layers.get(e);return!!t&&t.outstandingRequestCount>0}getLayerTimes(e){const t=[];return this._layers.forEach((i,r)=>{if(i.layerView.wasmLayerId===e.wasmLayerId){const n=this._vxl.get_layer_epoch_times(r,e.layer.currentVariableId);for(let l=0;l{i.layerView.wasmLayerId===e.wasmLayerId&&(t=this._vxl.get_layer_current_time_id(r))}),t}setEnabled(e,t){this._layers.forEach((i,r)=>{i.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl.set_enabled(r,t),i.needMemoryUsageUpdate=!0,this._renderPluginContext.requestRender())})}setStaticSections(e,t){const i={mask:y.StaticSections,staticSections:t};return this._doMaskedUIUpdate(e,i,!0)}setCurrentVariable(e,t){const i={mask:y.CurrentVariable,currentVariable:t};return this._doMaskedUIUpdate(e,i,!0)}setRenderMode(e,t){const i={mask:y.RenderMode,renderMode:t};return this._doMaskedUIUpdate(e,i,!0)}setVerticalExaggerationAndOffset(e,t,i,r){const n={mask:y.ExaggerationAndOffset,volStyleDesc:{volumeId:t,verticalExaggeration:i,verticalOffset:r}};return this._doMaskedUIUpdate(e,n,!0)}setVariableStyles(e,t){const i={mask:y.VariableStyles,variableStyles:t};return this._doMaskedUIUpdate(e,i,!0)}setVolumeStyles(e,t){const i={mask:y.VolumeStyles,volumeStyles:t};return this._doMaskedUIUpdate(e,i,!0)}setEnableDynamicSections(e,t){const i={mask:y.ContainerVisibility,containerIsVisible:t,container:R.DynamicSections};return this._doMaskedUIUpdate(e,i,!0)}setEnableIsosurfaces(e,t){const i={mask:y.ContainerVisibility,containerIsVisible:t,container:R.Isosurfaces};return this._doMaskedUIUpdate(e,i,!0)}setEnableSections(e,t){const i={mask:y.ContainerVisibility,containerIsVisible:t,container:R.StaticSections};return this._doMaskedUIUpdate(e,i,!0)}setAnalysisSlice(e,t,i,r){const n={mask:y.AnalysisSlice,analysisSlice:{point:i,normal:r,enabled:t}};return this._doMaskedUIUpdate(e,n,!0)}_doMaskedUIUpdate(e,t,i){if(!this._vxl)return!1;let r=!1;return this._layers.forEach((n,l)=>{if(n.layerView.wasmLayerId===e.wasmLayerId){const a={str:JSON.stringify(t),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(a)&&(r=this._vxl.handle_masked_ui_update(l,a.ptr,a.byteCount)===1,a.isReusable||this._vxl._free(a.ptr))}}),r&&i&&this._renderPluginContext.requestRender(),r}_addTriangleToWasmBuffer(e,t,i,r,n){return e[3*t]=i[0],e[3*t+1]=i[1],e[3*t+2]=i[2],e[3*(t+=1)]=r[0],e[3*t+1]=r[1],e[3*t+2]=r[2],e[3*(t+=1)]=n[0],e[3*t+1]=n[1],e[3*t+2]=n[2],t+=1}_addNormalToWasmBuffer(e,t,i){return e[3*t]=i[0],e[3*t+1]=i[1],e[3*t+2]=i[2],t+=1}_doCaptureFrustum(){if(!this._vxl)return;const e=36,t=e/3,i=this._vxl._malloc(3*e*Float32Array.BYTES_PER_ELEMENT),r=new Float32Array(this._vxl.HEAPF32.buffer,i,3*e),n=this._vxl._malloc(3*t*Float32Array.BYTES_PER_ELEMENT),l=new Float32Array(this._vxl.HEAPF32.buffer,n,e),a=this._frustum.points[v.NEAR_BOTTOM_LEFT],u=this._frustum.points[v.NEAR_BOTTOM_RIGHT],f=this._frustum.points[v.NEAR_TOP_RIGHT],d=this._frustum.points[v.NEAR_TOP_LEFT],c=this._frustum.points[v.FAR_BOTTOM_LEFT],_=this._frustum.points[v.FAR_BOTTOM_RIGHT],g=this._frustum.points[v.FAR_TOP_RIGHT],x=this._frustum.points[v.FAR_TOP_LEFT];let h=0,m=0;const p=this._frustum.planes[w.NEAR];h=this._addTriangleToWasmBuffer(r,h,f,u,a),m=this._addNormalToWasmBuffer(l,m,p),h=this._addTriangleToWasmBuffer(r,h,a,d,f),m=this._addNormalToWasmBuffer(l,m,p);const L=this._frustum.planes[w.FAR];h=this._addTriangleToWasmBuffer(r,h,c,_,g),m=this._addNormalToWasmBuffer(l,m,L),h=this._addTriangleToWasmBuffer(r,h,g,x,c),m=this._addNormalToWasmBuffer(l,m,L);const I=this._frustum.planes[w.TOP];h=this._addTriangleToWasmBuffer(r,h,g,f,d),m=this._addNormalToWasmBuffer(l,m,I),h=this._addTriangleToWasmBuffer(r,h,d,x,g),m=this._addNormalToWasmBuffer(l,m,I);const W=this._frustum.planes[w.BOTTOM];h=this._addTriangleToWasmBuffer(r,h,a,u,_),m=this._addNormalToWasmBuffer(l,m,W),h=this._addTriangleToWasmBuffer(r,h,_,c,a),m=this._addNormalToWasmBuffer(l,m,W);const U=this._frustum.planes[w.LEFT];h=this._addTriangleToWasmBuffer(r,h,d,a,c),m=this._addNormalToWasmBuffer(l,m,U),h=this._addTriangleToWasmBuffer(r,h,c,x,d),m=this._addNormalToWasmBuffer(l,m,U);const k=this._frustum.planes[w.RIGHT];h=this._addTriangleToWasmBuffer(r,h,f,g,_),m=this._addNormalToWasmBuffer(l,m,k),h=this._addTriangleToWasmBuffer(r,h,_,u,f),m=this._addNormalToWasmBuffer(l,m,k),this._frustumRenderableId!==-1&&this._vxl.remove_generic_mesh(this._frustumRenderableId),this._frustumRenderableId=this._vxl.add_generic_mesh(i,3*e,n,e,255,0,0,64),this._vxl._free(i),this._vxl._free(n),this._captureFrustum=!1,this._renderPluginContext.requestRender()}captureFrustum(){this._renderCoordsHelper===null&&(this._renderCoordsHelper=X.create(K.Local,Y(!1,this._view.spatialReference))),this._frustum===null&&(this._frustum=new Q(this._renderCoordsHelper)),this._captureFrustum=!0,this._renderPluginContext!==null&&this._renderPluginContext.requestRender()}toggleFullVolumeExtentDraw(e){this._vxl&&this._layers.forEach((t,i)=>{t.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl.toggle_full_volume_extent_draw(i),this._renderPluginContext.requestRender())})}addVoxelLayer(e){if(!this._vxl){const i={layerView:e,resolveCallback:null,rejectCallback:null},r=new Promise((n,l)=>{i.resolveCallback=n,i.rejectCallback=l});return this._newLayers.push(i),r}const t=this._addVoxelLayer(e);return t<0?Promise.reject(-1):Promise.resolve(t)}removeVoxelLayer(e){if(!this._vxl){const r=this._newLayers.findIndex(l=>e.uid===l.layerView.uid);r>=0&&(this._newLayers[r].resolveCallback(-1),this._newLayers.splice(r,1));const n=this._newLayers.length;return n===0&&(this._dbg(o.Lifetime," no voxel layers left after removing a layer, removing RenderPlugin and destroying"),this.destroy()),n}let t=-1;this._layers.forEach((r,n)=>{if(r.layerView.wasmLayerId===e.wasmLayerId){t=n,r.abortController.abort(),this._vxl.remove_layer(t);const l=this.layerUid.indexOf(e.layer.uid);l!==-1&&this.layerUid.splice(l,1)}}),t>=0&&this._layers.delete(t);const i=this._layers.size;return i===0&&(this._dbg(o.Lifetime," no voxel layers left after removing a layer, removing RenderPlugin and destroying"),this.destroy()),i}_getBlockSize(e){for(const t of this._wasmMemBlockSizes)if(e=0){(f=t.test)!=null&&f.constantUpscaling&&(this._setUpscalingLimits(0,.25,.25),this._setUpscalingLimits(1,.5,.5),this._setUpscalingLimits(2,.75,.75));const d=new AbortController;if(this._layers.set(i,{layerView:e,responses:new Map,outstandingRequestCount:0,abortController:d,needMemoryUsageUpdate:!1}),this.layerUid.push(e.layer.uid),!this._halfIntTexturesAvailable||P("mac")){const c=[];let _="";for(const g of e.layer.variables)g.renderingFormat.type!=="Int16"&&g.renderingFormat.type!=="UInt16"||(c.push(g.name),g.id===e.layer.currentVariableId&&(_=g.name));_!==""&&b.error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${_}' in this browser`),c.length>0&&b.warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${c.toString()}' in this browser`)}if(!this._textureFloatLinearAvailable){const c=[];let _="";for(const g of e.layer.variables)g.renderingFormat.type==="Float32"&&(c.push(g.name),g.id===e.layer.currentVariableId&&(_=g.name));_!==""&&b.error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${_}' in this browser`),c.length>0&&b.warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${c.toString()}' in this browser`)}return P("esri-mobile")&&b.warnOnce("Mobile support differs across devices. Voxel layer might not display as expected."),i}return-1}prepareRender(e){if(!this._vxl)return;const t=e.bindParameters.camera.viewForward,i=e.bindParameters.camera.eye;this._vxl.update_camera_pos_and_direction(i[0],i[1],i[2],t[0],t[1],t[2]);const r=this._vxl.cull();this._dbg(o.RequestResponse,"missingResourceCount="+r),this._moreToLoad=r>0,this._havePreparedWithAllLayers=this._newLayers.length===0,this._updateMemoryUsage()}render(e){if(!this._vxl||e.output!==this._shaderOutput||e.bindParameters.slot!==this._renderSlot)return;for(const i of this._newLayers){const r=this._addVoxelLayer(i.layerView);r===-1?i.rejectCallback(-1):i.resolveCallback(r)}if(this._newLayers=[],this._layers.size===0)return void this._dbg(o.Error,"No voxel layers but RenderPlugin instance is being asked to render!");this._lastFrameWasStationary=this._view.stationary,this._syncRequestsResponses(),this._beforeDraw(),this._vxl.begin_color_frame(!this._view._stage.renderer.isFeatureEnabled(J.HighResolutionVoxel),e.bindParameters.lighting.mainLight.direction[0],e.bindParameters.lighting.mainLight.direction[1],e.bindParameters.lighting.mainLight.direction[2]);const t=this._renderTargetToRestore.viewport;t.width===this._viewportWidth&&t.height===this._viewportHeight||(this._viewportWidth=t.width,this._viewportHeight=t.height,this._vxl.set_viewport(t.width,t.height),this._layers.forEach(i=>{i.needMemoryUsageUpdate=!0})),t.x===0&&t.y===0||this._dbg(o.Error,"Unsupported viewport parameters detected!"),this.updateWasmCamera(e.bindParameters.camera),this._captureFrustum&&(this._frustum.update(e.bindParameters.camera),this._doCaptureFrustum()),this._vxl.draw(),this._afterDraw(),(this._moreToLoad||!this._havePreparedWithAllLayers&&this._layers.size>0)&&this._renderPluginContext.requestRender()}destroy(){this._dbg(o.Lifetime,"--destroy--"),this._removeRenderPlugin(),this._readyWatchHandle=C(this._readyWatchHandle),this._qualityWatchHandle=C(this._qualityWatchHandle),this._timeExtentWatchHandle=C(this._timeExtentWatchHandle),this._stationaryWatchHandle=C(this._stationaryWatchHandle),this._vxl&&(this._layers.forEach(e=>{e.abortController.abort()}),this._wasmMemBlocks.forEach(e=>{e!==0&&this._vxl._free(e)}),this._vxl.uninitialize_voxel_wasm(),this._vxl=null)}_initializeWasm(e){return this._vxl?Promise.resolve():(this._vxlPromise||(this._vxlPromise=ae(e).then(t=>{var x;if(this._vxl=t,this._vxlPromise=null,this._newLayers.length<=0)return this._dbg(o.Lifetime," no voxel layers left after WASM downloaded, removing RenderPlugin and destroying"),void this.destroy();const i=this._getTimeArgs((x=this._view)==null?void 0:x.timeExtent),r=this._vxl.addFunction(this._restoreFramebuffer.bind(this),"v"),n=this._vxl.addFunction(this._setBlendState.bind(this),"viiii"),l=this._vxl.addFunction(this._setFrontFace.bind(this),"vi"),a=this._vxl.addFunction(this._setRasterizerState.bind(this),"vi"),u=this._vxl.addFunction(this._setDepthStencilStateFunction.bind(this),"viii"),f=this._vxl.addFunction(this._setViewport.bind(this),"viiii"),d=this._vxl.addFunction(this._bindPreviousDepthToSlot.bind(this),"iii"),c=this._vxl.addFunction(this._modifyResourceCount.bind(this),"viii"),_=this._halfIntTexturesAvailable&&!P("mac"),g=this._textureFloatLinearAvailable;this._vxl.initialize_voxel_wasm(r,n,l,a,u,f,d,c,i.startTime,i.endTime,i.useTime,_,g),this._renderPluginContext&&this._renderPluginContext.requestRender()}).catch(()=>{for(const t of this._newLayers)t.rejectCallback(-2);this._dbg(o.Error," WASM failed to download, removing RenderPlugin and destroying"),this.destroy()})),this._vxlPromise)}pickDepth(e,t,i){if(!this._vxl||!this._rctx||this._layers.size===0)return null;const r=i.viewport[3]-t;if(e<0||e>i.viewport[2]||t<0||t>i.viewport[3])return this._dbg(o.Error,`[js] pickDepth: outOfRange, screenXY=[${e.toFixed(0)}, ${r.toFixed(0)}]]`),null;this._beforeDraw();const n=i.viewForward,l=i.eye;this._vxl.update_camera_pos_and_direction(l[0],l[1],l[2],n[0],n[1],n[2]),this.updateWasmCamera(i),this._vxl.begin_frame();const a=this._vxl.pick_depth(e,r);return this._afterDraw(),a.success?a.distanceToCamera:null}pickObject(e,t,i,r){if(!this._vxl||!this._rctx||this._layers.size===0)return null;const n=Math.round(e),l=Math.round(t);if(n<0||n>i.viewport[2]||l<0||l>i.viewport[3])return this._dbg(o.Error,`[js] pickObject: outOfRange, screenXY=[${n}, ${l}], vp=[${i.viewport.toString()}]`),null;this._beforeDraw();const a=i.viewForward,u=i.eye;this._vxl.update_camera_pos_and_direction(u[0],u[1],u[2],a[0],a[1],a[2]),this.updateWasmCamera(i),this._vxl.begin_frame();let f=null;if(r.length===0)f=this._vxl.pick_object(n,l,0,0);else{const d={str:JSON.stringify({layerIds:r}),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(d)&&(f=this._vxl.pick_object(n,l,d.ptr,d.byteCount),d.isReusable||this._vxl._free(d.ptr))}return this._afterDraw(),f}_beforeDraw(){this._renderTargetToRestore={fbo:this._rctx.getBoundFramebufferObject(),viewport:this._rctx.getViewport()},this._rctx.setPolygonOffsetFillEnabled(!1),this._rctx.setScissorTestEnabled(!1),this._rctx.setColorMask(!0,!0,!0,!0)}_afterDraw(){this._renderTargetToRestore.fbo=null,this._rctx.externalTextureUnitUpdate(this._vxl.get_texture_units_bound_in_frame(),this._vxl.get_active_texture_unit()),this._rctx.externalVertexArrayObjectUpdate(),this._rctx.externalVertexBufferUpdate(),this._rctx.externalProgramUpdate()}intersect(e,t,i,r,n){if(!this._vxl||!this._rctx||this._layers.size===0||!e.options.selectionMode||e.options.isFiltered)return;if(n[0]<0||n[0]>e.camera.viewport[2]||n[1]<0||n[1]>e.camera.viewport[3])return this._dbg(o.Error,`[js] VoxelWasmPerScene.intersect: outOfRange, screenXY=[${n[0].toFixed(0)}, ${n[1].toFixed(0)}]`),null;const l=[];this._layers.forEach(f=>{e.options.filteredLayerUids.includes(f.layerView.layer.uid)&&l.push(f.layerView.wasmLayerId)});const a=this.pickObject(n[0],n[1],e.camera,l);if(a==null||a.layerId===-1)return;const u=this._layers.get(a.layerId);if(u){const f=u.layerView.layer.uid,d=a.distanceToCamera/Z(i,r),c=se();c[0]=a.worldX,c[1]=a.worldY,c[2]=a.worldZ;const _={};if(a.continuousValue!=null&&a.continuousValueUnits!=null?_["Voxel.ServiceValue"]=`${a.continuousValue.toLocaleString()} ${a.continuousValueUnits}`:a.uniqueValueLabel!=null&&a.uniqueValue!=null?_["Voxel.ServiceValue"]=`${a.uniqueValueLabel} (${a.uniqueValue})`:a.uniqueValue!=null&&(_["Voxel.ServiceValue"]=`${a.uniqueValue}`),_["Voxel.ServiceVariableLabel"]=a.variableLabel,_["Voxel.Position"]=a.voxelSpacePosition,a.epochTime!=null&&a.nativeTime!=null&&a.nativeTimeUnits!=null){const p=new Date(a.epochTime);_["Voxel.ServiceLocalTime"]=p.toString(),_["Voxel.ServiceNativeTime"]=`${a.nativeTime.toLocaleString()} ${a.nativeTimeUnits}`}a.depth!=null&&a.depthUnits!=null&&(_["Voxel.ServiceDepth"]=`${a.depth.toLocaleString()} ${a.depthUnits}`);const g=a.faceNormal;_["Voxel.WorldPosition"]=`[${c[0]}, ${c[1]}, ${c[2]}]`;const x=p=>{const L=new re(c,f,()=>this._createVoxelGraphic(u.layerView.layer,_));p.set(this.type,L,d,g)},h=e.results,m=e.options.store===ee.ALL;if((h.min.dist==null||dh.max.dist)&&x(h.max),m){const p=te(e.ray);x(p),e.results.all.push(p)}}}_createVoxelGraphic(e,t){return new ie({layer:e,sourceLayer:e,attributes:t})}_toWasmQuality(e){switch(e){case"low":return 0;case"medium":return 1;case"high":return 2}}_setUpscalingLimits(e,t,i){this._vxl&&this._vxl.set_upscaling_limits(e,t,i)}}export{oe as default}; diff --git a/assets/WFSLayer-c70988b2.js b/assets/WFSLayer-c70988b2.js new file mode 100644 index 0000000..173beac --- /dev/null +++ b/assets/WFSLayer-c70988b2.js @@ -0,0 +1 @@ +import{cX as T,aR as $,ca as I,ar as P,fy as c,fp as C,fD as E,cn as N,ai as i,aj as r,al as j,gC as U,eQ as _,eR as J,eS as k,bc as x,hi as b,hj as Y,cq as R,cO as W,bf as X,bY as D,eZ as O,cC as L,aA as Q}from"./index-080e108a.js";import"./UniqueValueRenderer-fef4204d.js";import{p as V,n as M}from"./jsonUtils-f73b3833.js";import{O as G}from"./MultiOriginJSONSupport-e4912ffd.js";import{c as z,o as B}from"./clientSideDefaults-ab04bd90.js";import{v as A,V as Z,Y as H,M as K,S as ee}from"./wfsUtils-372b3e59.js";import{d as te}from"./FeatureSet-111cb247.js";import{o as ie}from"./CustomParametersMixin-231c4be8.js";import{p as re}from"./FeatureEffectLayer-4160946c.js";import{n as oe}from"./FeatureReductionLayer-4262cf54.js";import{c as se}from"./OperationalLayer-0e8f8b28.js";import{c as ae}from"./OrderedLayer-68067459.js";import{j as ne}from"./PortalLayer-310c2800.js";import{a as pe}from"./TemporalLayer-f17c9161.js";import{d as le,m as de,c as ue,g as ye,p as ce,l as me,f as fe}from"./commonProperties-30089b06.js";import{s as he}from"./fieldProperties-62c55499.js";import{C as ge}from"./LabelClass-2d53c485.js";import{i as we}from"./labelingInfo-144f3d9f.js";import{b as y}from"./Query-1c961d4c.js";import{p as ve}from"./popupUtils-82ea8abb.js";import"./diffUtils-590c9088.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./QueryEngineCapabilities-42e44ded.js";import"./defaultsJSON-59981e75.js";import"./geojson-077f67ec.js";import"./xmlUtils-444cb4c0.js";import"./FeatureEffect-86735d98.js";import"./FeatureFilter-00f4be05.js";import"./featureLayerUtils-6cf06f83.js";import"./sql-734ecbc5.js";import"./AttachmentQuery-972bbd60.js";import"./RelationshipQuery-39c07195.js";import"./portalItemUtils-792a27e1.js";import"./defaults-34554cbf.js";let d=class extends T(U){constructor(){super(...arguments),this._connection=null,this.capabilities=z(!1,!1),this.type="wfs",this.refresh=$(async e=>{await this.load();const{extent:t}=await this._connection.invoke("refresh",e);return t&&(this.sourceJSON.extent=t),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}})}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:t})),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);const s=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return te.fromJSON(s)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._connection.invoke("queryFeatures",e?e.toJSON():null,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t)}async queryObjectIds(e,t={}){return await this.load(t),this._connection.invoke("queryObjectIds",e?e.toJSON():null,t)}async queryExtent(e,t={}){await this.load(t);const s=await this._connection.invoke("queryExtent",e?e.toJSON():null,t);return{count:s.count,extent:I.fromJSON(s.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke("querySnapping",e,t)}async _createLoadOptions(e){var F;const{url:t,customParameters:s,name:n,namespaceUri:p,spatialReference:a,fields:u,geometryType:m,swapXY:f}=this.layer;if(!t)throw new P("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await A(t,{customParameters:s,...e}));const h=["fields","geometryType","name","namespaceUri","spatialReference","swapXY"].some(w=>this.layer[w]==null),l=h?await Z(this.wfsCapabilities,n,p,{spatialReference:a,customParameters:s,signal:e==null?void 0:e.signal}):{...H(u??[]),geometryType:m,name:n,namespaceUri:p,spatialReference:a,swapXY:f},g=K(this.wfsCapabilities.readFeatureTypes(),l.name,l.namespaceUri),q=c.toJSON(l.geometryType);return{customParameters:s,featureType:g,fields:((F=l.fields)==null?void 0:F.map(w=>w.toJSON()))??[],geometryField:l.geometryField,geometryType:q,getFeatureUrl:this.wfsCapabilities.operations.GetFeature.url,getFeatureOutputFormat:this.wfsCapabilities.operations.GetFeature.outputFormat,objectIdField:l.objectIdField,spatialReference:l.spatialReference.toJSON(),swapXY:!!l.swapXY}}async _startWorker(e){const[t,s]=await C([this._createLoadOptions(e),E("WFSSourceWorker",{...e,strategy:N("feature-layers-workers")?"dedicated":"local"})]),n=t.error||s.error||null,p=s.value||null;if(n)throw p&&p.close(),n;const a=t.value;this._connection=s.value;const u=(await this._connection.invoke("load",a,e)).extent;this.sourceJSON={extent:u,fields:a.fields,geometryType:a.geometryType,objectIdField:a.objectIdField,geometryField:a.geometryField,drawingInfo:B(a.geometryType),name:a.featureType.title,wfsInfo:{name:a.featureType.name,featureUrl:a.getFeatureUrl,maxFeatures:3e3,swapXY:a.swapXY,supportedSpatialReferences:a.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:a.featureType.namespaceUri}}}};i([r()],d.prototype,"capabilities",void 0),i([r({constructOnly:!0})],d.prototype,"layer",void 0),i([r()],d.prototype,"sourceJSON",void 0),i([r()],d.prototype,"type",void 0),i([r()],d.prototype,"wfsCapabilities",void 0),d=i([j("esri.layers.graphics.sources.WFSSource")],d);var v;const S=he();let o=v=class extends ae(ie(oe(re(_(pe(J(k(se(ne(G(Q))))))))))){static fromWFSLayerInfo(e){const{customParameters:t,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:u,objectIdField:m,spatialReference:f,swapXY:h,url:l,wfsCapabilities:g}=e;return new v({customParameters:t,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:u,objectIdField:m,spatialReference:f,swapXY:h,url:l,wfsCapabilities:g})}constructor(e){super(e),this.copyright=null,this.customParameters=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxFeatures=3e3,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=x.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),b(this.renderer,this.fieldsIndex),Y(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}get capabilities(){var e;return(e=this.source)==null?void 0:e.capabilities}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,t,s){const n=e.filter(p=>p.name!==ee);this.geometryField&&n.unshift(new R({name:this.geometryField,alias:this.geometryField,type:"geometry"})),W(s,n.map(p=>p.toJSON()),t)}get parsedUrl(){return X(this.url)}set renderer(e){b(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){var e;return(e=this.source)==null?void 0:e.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return ve(this,e)}createQuery(){const e=new y;e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:t,timeExtent:s}=this;return e.timeExtent=t!=null&&s!=null?s.offset(-t.value,t.unit):s||null,e}getFieldDomain(e,t){var s;return(s=this.getField(e))==null?void 0:s.domain}getField(e){var t;return(t=this.fieldsIndex)==null?void 0:t.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(y.from(e)||this.createQuery(),t)).then(s=>{if(s!=null&&s.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(y.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(y.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(y.from(e)||this.createQuery(),t))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return t!=null&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};i([r({readOnly:!0})],o.prototype,"capabilities",null),i([r({type:String})],o.prototype,"copyright",void 0),i([r({readOnly:!0})],o.prototype,"createQueryVersion",null),i([r({json:{name:"wfsInfo.customParameters",write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0),ignoreOrigin:!0})}}})],o.prototype,"customParameters",void 0),i([r({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),i([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),i([r({type:String})],o.prototype,"displayField",void 0),i([r(le)],o.prototype,"elevationInfo",void 0),i([r({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"featureUrl",void 0),i([r({type:[R],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],o.prototype,"fields",void 0),i([D("fields")],o.prototype,"writeFields",null),i([r(S.fieldsIndex)],o.prototype,"fieldsIndex",void 0),i([r({type:I,json:{name:"extent"}})],o.prototype,"fullExtent",void 0),i([r()],o.prototype,"geometryField",void 0),i([r({type:String,json:{read:{source:"layerDefinition.geometryType",reader:c.read},write:{target:"layerDefinition.geometryType",writer:c.write,ignoreOrigin:!0},origins:{service:{read:c.read}}}})],o.prototype,"geometryType",void 0),i([r({type:String})],o.prototype,"id",void 0),i([r(de)],o.prototype,"labelsVisible",void 0),i([r({type:[ge],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:we},write:!0}})],o.prototype,"labelingInfo",void 0),i([r(ue)],o.prototype,"legendEnabled",void 0),i([r({type:["show","hide"]})],o.prototype,"listMode",void 0),i([r({type:String})],o.prototype,"objectIdField",void 0),i([r({type:["WFS"]})],o.prototype,"operationalLayerType",void 0),i([r({type:O,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"maxFeatures",void 0),i([r({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],o.prototype,"mode",void 0),i([r({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"name",void 0),i([r({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"namespaceUri",void 0),i([r(ye)],o.prototype,"opacity",void 0),i([r(S.outFields)],o.prototype,"outFields",void 0),i([r({readOnly:!0})],o.prototype,"parsedUrl",null),i([r(ce)],o.prototype,"popupEnabled",void 0),i([r({type:L,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),i([r({types:V,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:M,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],o.prototype,"renderer",null),i([r(me)],o.prototype,"screenSizePerspectiveEnabled",void 0),i([r({readOnly:!0})],o.prototype,"source",void 0),i([r({type:x,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],o.prototype,"spatialReference",void 0),i([r({readOnly:!0,type:[O],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"spatialReferences",void 0),i([r({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"swapXY",void 0),i([r({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],o.prototype,"title",void 0),i([r({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),i([r(fe)],o.prototype,"url",void 0),i([r({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"version",void 0),i([r()],o.prototype,"wfsCapabilities",null),o=v=i([j("esri.layers.WFSLayer")],o);const it=o;export{it as default}; diff --git a/assets/WFSLayerView3D-37f84843.js b/assets/WFSLayerView3D-37f84843.js new file mode 100644 index 0000000..9ca6dfc --- /dev/null +++ b/assets/WFSLayerView3D-37f84843.js @@ -0,0 +1 @@ +import{ai as r,aj as o,al as i}from"./index-080e108a.js";import{_ as p}from"./FeatureLayerViewBase3D-8474587e.js";import"./FeatureLikeLayerView3D-2e3185ce.js";import"./Query-1c961d4c.js";import"./dehydratedFeatureComparison-a3375a3e.js";import"./queryForSymbologySnapping-0264f2b5.js";import"./elevationInfoUtils-4fd79d95.js";import"./hash-6f442295.js";import"./diffUtils-590c9088.js";import"./Graphics3DObjectStates-bb2a6162.js";import"./UniqueValueRenderer-fef4204d.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./popupUtils-f04ec9a9.js";import"./FeatureFilter-00f4be05.js";import"./floorFilterUtils-080a7cd2.js";import"./QueryEngine-19eda5ff.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./FeatureSet-111cb247.js";import"./FeatureStore-f0e312fc.js";import"./BoundsStore-b6bd3c14.js";import"./projectExtentUtils-efa4cddd.js";import"./LayerView3D-ffd35809.js";import"./query-93c6e211.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./EventedSet-d13fada5.js";import"./commonProperties-30089b06.js";import"./FeatureEffect-86735d98.js";import"./LayerView-448bc5ea.js";import"./RefreshableLayerView-915e7f53.js";let t=class extends p{constructor(){super(...arguments),this.type="wfs-3d"}};r([o()],t.prototype,"layer",void 0),t=r([i("esri.views.3d.layers.WFSLayerView3D")],t);const Z=t;export{Z as default}; diff --git a/assets/WFSSourceWorker-1db6d954.js b/assets/WFSSourceWorker-1db6d954.js new file mode 100644 index 0000000..cd6135c --- /dev/null +++ b/assets/WFSSourceWorker-1db6d954.js @@ -0,0 +1 @@ +import{ax as p,cM as l,eo as o,eq as g,er as _,ar as u,aN as d,bn as f,bz as w}from"./index-080e108a.js";import{m as E}from"./FeatureStore-f0e312fc.js";import{g as q,e as F,f as x}from"./QueryEngine-19eda5ff.js";import{T as S,I as T}from"./geojson-077f67ec.js";import{d as b}from"./sourceUtils-e3b344c8.js";import{H as I}from"./wfsUtils-372b3e59.js";import{r as j}from"./FieldsIndex-f79a8f26.js";import"./BoundsStore-b6bd3c14.js";import"./PooledRBush-3cae7682.js";import"./quickselect-e80674f5.js";import"./optimizedFeatureQueryEngineAdapter-58185a60.js";import"./centroid-8e8cfa47.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./xmlUtils-444cb4c0.js";class V{constructor(){this._queryEngine=null,this._customParameters=null,this._snapshotFeatures=async e=>{const{objectIdField:t}=this._queryEngine,s=await I(this._getFeatureUrl??"",this._featureType.typeName,this._getFeatureOutputFormat,{customParameters:this._customParameters,dateFields:this._queryEngine.fieldsIndex.dateFields.map(r=>r.name),signal:e});await S(s),p(e);const a=T(s,{geometryType:this._queryEngine.geometryType,hasZ:!1,objectIdField:t});if(!l(this._queryEngine.spatialReference,o))for(const r of a)r.geometry!=null&&(r.geometry=g(q(_(r.geometry,this._queryEngine.geometryType,!1,!1),o,this._queryEngine.spatialReference)));let n=1;for(const r of a){const i={};b(this._fieldsIndex,i,r.attributes,!0),r.attributes=i,r.attributes[t]==null&&(r.objectId=r.attributes[t]=n++)}return a}}destroy(){var e;(e=this._queryEngine)==null||e.destroy(),this._queryEngine=null}async load(e,t){const{getFeatureUrl:s,getFeatureOutputFormat:a,spatialReference:n,fields:r,geometryType:i,featureType:h,objectIdField:y,customParameters:m}=e;this._featureType=h,this._customParameters=m,this._getFeatureUrl=s,this._getFeatureOutputFormat=a,this._fieldsIndex=new j(r),await this._checkProjection(n),p(t),this._queryEngine=new F({fields:r,geometryType:i,hasM:!1,hasZ:!1,objectIdField:y,spatialReference:n,timeInfo:null,featureStore:new E({geometryType:i,hasM:!1,hasZ:!1})});const c=await this._snapshotFeatures(t.signal);return this._queryEngine.featureStore.addMany(c),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new u("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){var t;return this._customParameters=e,(t=this._snapshotTask)==null||t.abort(),this._snapshotTask=d(this._snapshotFeatures),this._snapshotTask.promise.then(s=>{this._queryEngine.featureStore.clear(),s&&this._queryEngine.featureStore.addMany(s)},s=>{this._queryEngine.featureStore.clear(),f(s)||w.getLogger("esri.layers.WFSLayer").error(new u("wfs-layer:getfeature-error","An error occurred during the GetFeature request",{error:s}))}),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _checkProjection(e){try{await x(o,e)}catch{throw new u("unsupported-projection","Projection not supported",{spatialReference:e})}}}export{V as default}; diff --git a/assets/WMSLayer-a3157ab4.js b/assets/WMSLayer-a3157ab4.js new file mode 100644 index 0000000..14130c7 --- /dev/null +++ b/assets/WMSLayer-a3157ab4.js @@ -0,0 +1,2 @@ +import{am as Le,aT as V,aH as N,aG as H,cj as Ae,aF as Z,ai as o,aj as u,ca as R,ay as O,f4 as Me,al as ge,ar as Ue,dZ as j,bc as E,bf as be,cp as je,eQ as Te,eR as _e,eS as Ce,dU as qe,as as Ve,jg as ne,eW as se,at as D,jq as We,cM as Be,fE as ke,cC as De,aK as Ge,ht as Xe,bZ as He,cl as Je,bY as G,eZ as Qe,aA as Ze,fM as ze}from"./index-080e108a.js";import{S as Ke,O as Ye}from"./MultiOriginJSONSupport-e4912ffd.js";import{c as et}from"./OperationalLayer-0e8f8b28.js";import{j as tt}from"./PortalLayer-310c2800.js";import{a as rt}from"./TemporalLayer-f17c9161.js";import{o as J}from"./crsUtils-3bab3d8c.js";import{c as nt,f as st}from"./commonProperties-30089b06.js";import{l as ie}from"./ExportWMSImageParameters-d63354ac.js";import{t as it}from"./imageBitmapUtils-391f7b8f.js";import"./portalItemUtils-792a27e1.js";var _;let at=0,h=_=class extends Le(Ke){constructor(e){super(e),this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.name=null,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.title=null,this.addHandles([V(()=>this.sublayers,"after-add",({item:t})=>{t.parent=this,t.layer=this.layer},N),V(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},N),H(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=this,n.layer=this.layer},N),H(()=>this.layer,t=>{if(this.sublayers)for(const r of this.sublayers)r.layer=t},N)])}get id(){return this._get("id")??at++}set id(e){this._set("id",e)}readLegendUrl(e,t){return t.legendUrl??t.legendURL??null}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}castSublayers(e){return Ae(Z.ofType(_),e)}set visible(e){this._setAndNotifyLayer("visible",e)}clone(){var t,r;const e=new _;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(e.fullExtents=((t=this.fullExtents)==null?void 0:t.map(n=>n.clone()))??null),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("legendEnabled")&&(e.legendEnabled=this.legendEnabled),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("name")&&(e.name=this.name),this.hasOwnProperty("parent")&&(e.parent=this.parent),this.hasOwnProperty("queryable")&&(e.queryable=this.queryable),this.hasOwnProperty("sublayers")&&(e.sublayers=this.sublayers&&this.sublayers.map(n=>n.clone())),this.hasOwnProperty("spatialReferences")&&(e.spatialReferences=(r=this.spatialReferences)==null?void 0:r.map(n=>n)),this.hasOwnProperty("visible")&&(e.visible=this.visible),this.hasOwnProperty("title")&&(e.title=this.title),e}_setAndNotifyLayer(e,t){const r=this.layer;this._get(e)!==t&&(this._set(e,t),r&&r.emit("wms-sublayer-update",{propertyName:e,id:this.id}))}};o([u()],h.prototype,"description",void 0),o([u({readOnly:!0})],h.prototype,"dimensions",void 0),o([u({type:R,json:{name:"extent"}})],h.prototype,"fullExtent",void 0),o([u()],h.prototype,"fullExtents",void 0),o([u({type:Number,json:{write:{enabled:!1,overridePolicy:()=>({ignoreOrigin:!0,enabled:!0})}}})],h.prototype,"id",null),o([u({type:String,json:{name:"legendUrl",write:{ignoreOrigin:!0}}})],h.prototype,"legendUrl",void 0),o([O("legendUrl",["legendUrl","legendURL"])],h.prototype,"readLegendUrl",null),o([u({type:Boolean,json:{name:"showLegend",origins:{"web-map":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],h.prototype,"legendEnabled",void 0),o([u()],h.prototype,"layer",void 0),o([u()],h.prototype,"maxScale",void 0),o([u()],h.prototype,"minScale",void 0),o([u({readOnly:!0})],h.prototype,"effectiveScaleRange",null),o([u({type:String,json:{write:{ignoreOrigin:!0}}})],h.prototype,"name",void 0),o([u()],h.prototype,"parent",void 0),o([u({type:Boolean,json:{read:{source:"showPopup"},write:{ignoreOrigin:!0,target:"showPopup"}}})],h.prototype,"popupEnabled",void 0),o([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],h.prototype,"queryable",void 0),o([u()],h.prototype,"sublayers",void 0),o([Me("sublayers")],h.prototype,"castSublayers",null),o([u({type:[Number],json:{read:{source:"spatialReferences"}}})],h.prototype,"spatialReferences",void 0),o([u({type:String,json:{write:{ignoreOrigin:!0}}})],h.prototype,"title",void 0),o([u({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],h.prototype,"visible",null),h=_=o([ge("esri.layers.support.WMSSublayer")],h);const Q=h,ae={84:4326,83:4269,27:4267};function ot(e){if(!e)return null;const t={idCounter:-1};typeof e=="string"&&(e=new DOMParser().parseFromString(e,"text/xml"));const r=e.documentElement;if(r.nodeName==="ServiceExceptionReport"){const b=Array.prototype.slice.call(r.childNodes).map(L=>L.textContent).join(`\r +`);throw new Ue("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",b)}const n=x("Capability",r),s=x("Service",r),l=n&&x("Request",n);if(!n||!s||!l)return null;const a=x("Layer",n);if(!a)return null;const m=r.nodeName==="WMS_Capabilities"||r.nodeName==="WMT_MS_Capabilities"?r.getAttribute("version"):"1.3.0",i=v("Title",s,"")||v("Name",s,""),y=v("AccessConstraints",s,""),p=/^none$/i.test(y)?"":y,f=v("Abstract",s,""),d=parseInt(v("MaxWidth",s,"5000"),10),w=parseInt(v("MaxHeight",s,"5000"),10),S=le(l,"GetMap"),P=oe(l,"GetMap"),g=U(a,m,t);if(!g)return null;let z,W=0;const Ne=Array.prototype.slice.call(n.childNodes),Ee=g.sublayers??[],B=b=>{b!=null&&Ee.push(b)};Ne.forEach(b=>{b.nodeName==="Layer"&&(W===0?z=b:(W===1&&g.name&&(g.name="",B(U(z,m,t))),B(U(b,m,t))),W++)});let F=g.sublayers,k=g.extent;const Fe=g.fullExtents??[];if(F||(F=[]),F.length===0&&F.push(g),!k){const b=new R(F[0].extent);g.extent=b.toJSON(),k=g.extent}const Ie=g.spatialReferences.length>0?g.spatialReferences:xe(g),K=oe(l,"GetFeatureInfo"),$e=K?le(l,"GetFeatureInfo"):null,Y=we(F),Oe=g.minScale||0,Re=g.maxScale||0,ee=g.dimensions??[],Pe=Y.reduce((b,L)=>b.concat(L.dimensions??[]),[]),te=ee.concat(Pe).filter(Se);let re=null;if(te.length){const b=te.map(L=>{const{extent:A}=L;return pt(A)?A.map(T=>T.getTime()):A==null?void 0:A.map(T=>[T.min.getTime(),T.max.getTime()])}).flat(2).filter(j);re={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[Math.min(...b),Math.max(...b)]}}return{copyright:p,description:f,dimensions:ee,extent:k,fullExtents:Fe,featureInfoFormats:$e,featureInfoUrl:K,mapUrl:P,maxWidth:d,maxHeight:w,maxScale:Re,minScale:Oe,layers:Y,spatialReferences:Ie,supportedImageFormatTypes:S,timeInfo:re,title:i,version:m}}function lt(e){const t=e.filter(r=>r.popupEnabled&&r.name&&r.queryable);return t.length?t.map(({name:r})=>r).join():null}function xe(e){if(e.spatialReferences.length>0)return e.spatialReferences;if(e.sublayers)for(const t of e.sublayers){const r=xe(t);if(r.length>0)return r}return[]}function we(e){var r;let t=[];for(const n of e)t.push(n),(r=n.sublayers)!=null&&r.length&&(t=t.concat(we(n.sublayers)),delete n.sublayers);return t}function C(e,t,r){return t.getAttribute(e)??r}function ut(e,t,r,n){const s=x(e,r);return s?C(t,s,n):n}function x(e,t){for(let r=0;rs).filter(j);const n=[];for(const s of r)if(s.getAttribute("name")===t){const l=q("Format",s);for(const{textContent:a}of l)a!=null&&n.push(a)}return n}function ue(e,t,r){const n=x(t,e);if(!n)return r;const{textContent:s}=n;if(s==null||s==="")return r;const l=Number(s);return isNaN(l)?r:l}function U(e,t,r){if(!e)return null;const n={id:r.idCounter++,fullExtents:[],parentLayerId:null,queryable:e.getAttribute("queryable")==="1",spatialReferences:[],sublayers:null},s=x("LatLonBoundingBox",e),l=x("EX_GeographicBoundingBox",e);let a=null;s&&(a=M(s,4326)),l&&(a=new R(0,0,0,0,new E({wkid:4326})),a.xmin=parseFloat(v("westBoundLongitude",l,"0")),a.ymin=parseFloat(v("southBoundLatitude",l,"0")),a.xmax=parseFloat(v("eastBoundLongitude",l,"0")),a.ymax=parseFloat(v("northBoundLatitude",l,"0"))),s||l||(a=new R(-180,-90,180,90,new E({wkid:4326}))),n.minScale=ue(e,"MaxScaleDenominator",0),n.maxScale=ue(e,"MinScaleDenominator",0);const m=["1.0.0","1.1.0","1.1.1"].includes(t)?"SRS":"CRS";return Array.prototype.slice.call(e.childNodes).forEach(i=>{var y;if(i.nodeName==="Name")n.name=i.textContent||"";else if(i.nodeName==="Title")n.title=i.textContent||"";else if(i.nodeName==="Abstract")n.description=i.textContent||"";else if(i.nodeName==="BoundingBox"){const p=i.getAttribute(m);if(p&&p.indexOf("EPSG:")===0){const d=parseInt(p.substring(5),10);d===0||isNaN(d)||a||(a=t==="1.3.0"?M(i,d,J(d)):M(i,d))}const f=p&&p.indexOf(":");if(f&&f>-1){let d=parseInt(p.substring(f+1,p.length),10);d===0||isNaN(d)||(d=ae[d]??d);const w=t==="1.3.0"?M(i,d,J(d)):M(i,d);w&&n.fullExtents&&n.fullExtents.push(w)}}else if(i.nodeName===m)(((y=i.textContent)==null?void 0:y.split(" "))??[]).forEach(p=>{const f=p.includes(":")?parseInt(p.split(":")[1],10):parseInt(p,10);if(f!==0&&!isNaN(f)){const d=ae[f]??f;n.spatialReferences.includes(d)||n.spatialReferences.push(d)}});else if(i.nodeName!=="Style"||n.legendUrl){if(i.nodeName==="Layer"){const p=U(i,t,r);p&&(p.parentLayerId=n.id,n.sublayers||(n.sublayers=[]),n.sublayers.push(p))}}else{const p=x("LegendURL",i);if(p){const f=x("OnlineResource",p);f&&(n.legendUrl=f.getAttribute("xlink:href"))}}}),n.extent=a==null?void 0:a.toJSON(),n.dimensions=q("Dimension",e).filter(i=>i.getAttribute("name")&&i.getAttribute("units")&&i.textContent).map(i=>{const y=i.getAttribute("name"),p=i.getAttribute("units"),f=i.textContent,d=i.getAttribute("unitSymbol")??void 0,w=i.getAttribute("default")??void 0,S=C("default",i,"0")!=="0",P=C("nearestValue",i,"0")!=="0",g=C("current",i,"0")!=="0";return Se({name:y,units:p})?{name:"time",units:"ISO8601",extent:de(f),default:de(w),multipleValues:S,nearestValue:P,current:g}:ct({name:y,units:p})?{name:"elevation",units:p,extent:pe(f),unitSymbol:d,default:pe(w),multipleValues:S,nearestValue:P}:{name:y,units:p,extent:ce(f),unitSymbol:d,default:ce(w),multipleValues:S,nearestValue:P}}),n}function pt(e){return Array.isArray(e)&&e.length>0&&e[0]instanceof Date}function ve(e){return e.nodeType===Node.ELEMENT_NODE}function ct(e){return/^elevation$/i.test(e.name)&&/^(epsg|crs):\d+$/i.test(e.units)}function Se(e){return/^time$/i.test(e.name)&&/^iso8601$/i.test(e.units)}function dt(e,t){const r=[],n=be(e);for(const s in n.query)n.query.hasOwnProperty(s)&&(t.includes(s.toLowerCase())||r.push(s+"="+n.query[s]));return n.path+(r.length?"?"+r.join("&"):"")}function pe(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const s=n.split("/");return s.length<2?null:{min:parseFloat(s[0]),max:parseFloat(s[1]),resolution:s.length>=3&&s[2]!=="0"?parseFloat(s[2]):void 0}}).filter(j):r.map(n=>parseFloat(n))}function ce(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const s=n.split("/");return s.length<2?null:{min:s[0],max:s[1],resolution:s.length>=3&&s[2]!=="0"?s[2]:void 0}}).filter(j):r}function de(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const s=n.split("/");return s.length<2?null:{min:new Date(s[0]),max:new Date(s[1]),resolution:s.length>=3&&s[2]!=="0"?mt(s[2]):void 0}}).filter(j):r.map(n=>new Date(n))}function mt(e){const t=/(?:p(\d+y|\d+(?:.|,)\d+y)?(\d+m|\d+(?:.|,)\d+m)?(\d+d|\d+(?:.|,)\d+d)?)?(?:t(\d+h|\d+(?:.|,)\d+h)?(\d+m|\d+(?:.|,)\d+m)?(\d+s|\d+(?:.|,)\d+s)?)?/i,r=e.match(t);return r?{years:I(r[1]),months:I(r[2]),days:I(r[3]),hours:I(r[4]),minutes:I(r[5]),seconds:I(r[6])}:null}function I(e){if(!e)return 0;const t=/(?:\d+(?:.|,)\d+|\d+)/,r=e.match(t);if(!r)return 0;const n=r[0].replace(",",".");return Number(n)}function $(e){return e.toISOString().replace(/\.[0-9]{3}/,"")}const me=new Set([102100,3857,102113,900913]),ft=new Set([3395,54004]);function yt(e,t){let r=e.wkid;return t==null?r:(r!=null&&t.includes(r)||!e.latestWkid||(r=e.latestWkid),r!=null&&me.has(r)?t.find(n=>me.has(n))||t.find(n=>ft.has(n))||102100:r)}const X=new je({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function fe(e){return e==="text/html"}function ye(e){return e==="text/plain"}let c=class extends Te(rt(_e(Ce(et(tt(Ye(Ze))))))){constructor(...e){super(...e),this.allSublayers=new qe({getCollections:()=>[this.sublayers],getChildrenFunction:t=>t.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType="WMS",this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type="wms",this.version=null,this.addHandles([V(()=>this.sublayers,"after-add",({item:t})=>{t.parent=t.layer=this},N),V(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},N),H(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=n.layer=this},N)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch(Ve).then(()=>this._fetchService(t))),Promise.resolve(this)}readFullExtentFromItemOrMap(e,t){const r=t.extent;return r?new R({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return this.featureInfoFormats==null?null:this.featureInfoFormats.find(fe)??this.featureInfoFormats.find(ye)??null}set featureInfoFormat(e){e==null?(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat")):(fe(e)||ye(e))&&this._override("featureInfoFormat",e)}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes("image/png")?"image/png":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,t){return new E(t.spatialReferences[0])}writeSpatialReferences(e,t){var n;const r=(n=this.spatialReference)==null?void 0:n.wkid;e&&r?(t.spatialReferences=e.filter(s=>s!==r),t.spatialReferences.unshift(r)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,r){return he(t.layers,r,t.visibleLayers)}readSublayers(e,t,r){return he(t.layers,r)}writeSublayers(e,t,r,n){var a,m;t.layers=[];const s=new Map,l=e.flatten(({sublayers:i})=>i??[]);for(const i of l)if(typeof((a=i.parent)==null?void 0:a.id)=="number"){const y=s.get(i.parent.id);y!=null?y.push(i.id):s.set(i.parent.id,[i.id])}for(const i of l){const y={sublayer:i,...n},p=i.write({parentLayerId:typeof((m=i.parent)==null?void 0:m.id)=="number"?i.parent.id:-1},y);if(s.has(i.id)&&(p.sublayerIds=s.get(i.id)),!i.sublayers&&i.name){const f=i.write({},y);delete f.id,t.layers.push(f)}}t.visibleLayers=l.filter(({visible:i,sublayers:y})=>i&&!y).map(({name:i})=>i).toArray()}set url(e){if(!e)return void this._set("url",e);const{path:t,query:r}=be(e);for(const s in r)/^(request|service)$/i.test(s)&&delete r[s];const n=ne(t,r??{});this._set("url",n)}createExportImageParameters(e,t,r,n){const s=(n==null?void 0:n.pixelRatio)??1,l=se({extent:e,width:t})*s,a=new ie({layer:this,scale:l}),{xmin:m,ymin:i,xmax:y,ymax:p,spatialReference:f}=e,d=yt(f,this.spatialReferences),w=this.version==="1.3.0"&&J(d)?`${i},${m},${p},${y}`:`${m},${i},${y},${p}`,S=a.toJSON();return{bbox:w,[this.version==="1.3.0"?"crs":"srs"]:d==null||isNaN(d)?void 0:"EPSG:"+d,...S}}async fetchImage(e,t,r,n){var p,f;const s=this.mapUrl,l=this.createExportImageParameters(e,t,r,n);if(!l.layers){const d=document.createElement("canvas");return d.width=t,d.height=r,d}const a=(p=n==null?void 0:n.timeExtent)==null?void 0:p.start,m=(f=n==null?void 0:n.timeExtent)==null?void 0:f.end,i=a!=null&&m!=null?a.getTime()===m.getTime()?$(a):`${$(a)}/${$(m)}`:void 0,y={responseType:"image",query:this._mixCustomParameters({width:t,height:r,...l,time:i,...this.refreshParameters}),signal:n==null?void 0:n.signal};return D(s??"",y).then(d=>d.data)}async fetchImageBitmap(e,t,r,n){var f,d;const s=this.mapUrl??"",l=this.createExportImageParameters(e,t,r,n);if(!l.layers){const w=document.createElement("canvas");return w.width=t,w.height=r,w}const a=(f=n==null?void 0:n.timeExtent)==null?void 0:f.start,m=(d=n==null?void 0:n.timeExtent)==null?void 0:d.end,i=a!=null&&m!=null?a.getTime()===m.getTime()?$(a):`${$(a)}/${$(m)}`:void 0,y={responseType:"blob",query:this._mixCustomParameters({width:t,height:r,...l,time:i,...this.refreshParameters}),signal:n==null?void 0:n.signal},{data:p}=await D(s,y);return it(p,s,n==null?void 0:n.signal)}fetchFeatureInfo(e,t,r,n,s){const l=se({extent:e,width:t}),a=new ie({layer:this,scale:l}),m=lt(a.visibleSublayers);if(this.featureInfoUrl==null||m==null)return Promise.resolve([]);if(this.fetchFeatureInfoFunction==null&&this.featureInfoFormat==null)return Promise.resolve([]);const i=this.version==="1.3.0"?{I:n,J:s}:{x:n,y:s},y={query_layers:m,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:t,height:r,...i},p={...this.createExportImageParameters(e,t,r),...y},f=this._mixCustomParameters(p);return this.fetchFeatureInfoFunction!=null?this.fetchFeatureInfoFunction(f):this._defaultFetchFeatureInfoFunction(ne(this.featureInfoUrl,f))}findSublayerById(e){return this.allSublayers.find(t=>t.id===e)}findSublayerByName(e){return this.allSublayers.find(t=>t.name===e)}serviceSupportsSpatialReference(e){return We(this.url)||this.spatialReferences!=null&&this.spatialReferences.some(t=>{const r=t===900913?E.WebMercator:new E({wkid:t});return Be(r,e)})}_defaultFetchFeatureInfoFunction(e){const t=document.createElement("iframe");t.src=ke(e),t.style.border="none",t.style.margin="0",t.style.width="100%",t.setAttribute("sandbox","");const r=new De({title:this.title,content:t}),n=new Ge({sourceLayer:this,popupTemplate:r});return Promise.resolve([n])}async _fetchService(e){var t;if(!this.resourceInfo&&((t=this.parsedUrl)!=null&&t.path)){const{path:r,query:n}=this.parsedUrl,{data:s}=await D(r,{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...n,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=ot(s)}if(this.parsedUrl){const r=new Xe(this.parsedUrl.path),{httpsDomains:n}=He.request;r.scheme!=="https"||r.port&&r.port!=="443"||!r.host||n.includes(r.host)||n.push(r.host)}this.read(this.resourceInfo,{origin:"service"})}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const t={...this.customParameters,...this.customLayerParameters};for(const r in t)e[r.toLowerCase()]=t[r];return e}};function ht(e,t){return e.some(r=>{for(const n in r)if(ze(r,n,null,t))return!0;return!1})}function he(e,t,r){e=e??[];const n=new Map;e.every(l=>l.id==null)&&(e=Je(e)).forEach((l,a)=>l.id=a);for(const l of e){const a=new Q;a.read(l,t),r&&!r.includes(a.name)&&(a.visible=!1),n.set(a.id,a)}const s=[];for(const l of e){const a=l.id!=null?n.get(l.id):null;if(a)if(l.parentLayerId!=null&&l.parentLayerId>=0){const m=n.get(l.parentLayerId);if(!m)continue;m.sublayers||(m.sublayers=new Z),m.sublayers.push(a)}else s.push(a)}return s}o([u({readOnly:!0})],c.prototype,"allSublayers",void 0),o([u({json:{type:Object,write:!0}})],c.prototype,"customParameters",void 0),o([u({json:{type:Object,write:!0}})],c.prototype,"customLayerParameters",void 0),o([u({type:String,json:{write:!0}})],c.prototype,"copyright",void 0),o([u()],c.prototype,"description",void 0),o([u({readOnly:!0})],c.prototype,"dimensions",void 0),o([u({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],c.prototype,"fullExtent",void 0),o([O(["web-document","portal-item"],"fullExtent",["extent"])],c.prototype,"readFullExtentFromItemOrMap",null),o([G(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],c.prototype,"writeFullExtent",null),o([u()],c.prototype,"fullExtents",void 0),o([u({type:String,json:{write:{ignoreOrigin:!0}}})],c.prototype,"featureInfoFormat",null),o([u({type:[String],readOnly:!0})],c.prototype,"featureInfoFormats",void 0),o([u({type:String,json:{write:{ignoreOrigin:!0}}})],c.prototype,"featureInfoUrl",void 0),o([u()],c.prototype,"fetchFeatureInfoFunction",void 0),o([u({type:String,json:{origins:{"web-document":{default:"image/png",type:X.jsonValues,read:{reader:X.read,source:"format"},write:{writer:X.write,target:"format"}}}}})],c.prototype,"imageFormat",void 0),o([O("imageFormat",["supportedImageFormatTypes"])],c.prototype,"readImageFormat",null),o([u({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],c.prototype,"imageMaxHeight",void 0),o([u({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],c.prototype,"imageMaxWidth",void 0),o([u()],c.prototype,"imageTransparency",void 0),o([u(nt)],c.prototype,"legendEnabled",void 0),o([u({type:["show","hide","hide-children"]})],c.prototype,"listMode",void 0),o([u({type:String,json:{write:{ignoreOrigin:!0}}})],c.prototype,"mapUrl",void 0),o([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],c.prototype,"isReference",void 0),o([u({type:["WMS"]})],c.prototype,"operationalLayerType",void 0),o([u()],c.prototype,"resourceInfo",void 0),o([u({type:E,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],c.prototype,"spatialReference",void 0),o([O(["web-document","portal-item"],"spatialReference",["spatialReferences"])],c.prototype,"readSpatialReferenceFromItemOrDocument",null),o([u({type:[Qe],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],c.prototype,"spatialReferences",void 0),o([G(["web-document","portal-item"],"spatialReferences")],c.prototype,"writeSpatialReferences",null),o([u({type:Z.ofType(Q),json:{write:{target:"layers",overridePolicy(e,t,r){if(ht(this.allSublayers,r))return{ignoreOrigin:!0}}}}})],c.prototype,"sublayers",void 0),o([O(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],c.prototype,"readSublayersFromItemOrMap",null),o([O("service","sublayers",["layers"])],c.prototype,"readSublayers",null),o([G("sublayers",{layers:{type:[Q]},visibleLayers:{type:[String]}})],c.prototype,"writeSublayers",null),o([u({json:{read:!1},readOnly:!0,value:"wms"})],c.prototype,"type",void 0),o([u(st)],c.prototype,"url",null),o([u({type:String,json:{write:{ignoreOrigin:!0}}})],c.prototype,"version",void 0),c=o([ge("esri.layers.WMSLayer")],c);const $t=c;export{$t as default}; diff --git a/assets/WMSLayerView3D-4330be5d.js b/assets/WMSLayerView3D-4330be5d.js new file mode 100644 index 0000000..e9f7601 --- /dev/null +++ b/assets/WMSLayerView3D-4330be5d.js @@ -0,0 +1 @@ +import{ai as s,aj as h,al as c,ah as f,ar as m,ca as w}from"./index-080e108a.js";import{z as x}from"./DynamicLayerView3D-b48678f2.js";import{b as g}from"./commonProperties-30089b06.js";import{l as P}from"./ExportWMSImageParameters-d63354ac.js";import"./LayerView3D-ffd35809.js";import"./projectExtentUtils-efa4cddd.js";import"./ImageMaterial-5c48df66.js";import"./LayerView-448bc5ea.js";import"./RefreshableLayerView-915e7f53.js";const v=r=>{let e=class extends r{initialize(){this.exportImageParameters=new P({layer:this.layer})}destroy(){this.exportImageParameters=f(this.exportImageParameters)}get exportImageVersion(){var t;return(t=this.exportImageParameters)==null||t.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}fetchPopupFeatures(t){const{layer:i}=this;if(!t)return Promise.reject(new m("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:i}));const{popupEnabled:o}=i;if(!o)return Promise.reject(new m("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:o}));const n=this.createFetchPopupFeaturesQuery(t);if(!n)return Promise.resolve([]);const{extent:p,width:a,height:u,x:d,y}=n;if(!(p&&a&&u))throw new m("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:p,width:a,height:u});return i.fetchFeatureInfo(p,a,u,d,y)}};return s([h()],e.prototype,"exportImageParameters",void 0),s([h({readOnly:!0})],e.prototype,"exportImageVersion",null),s([h()],e.prototype,"layer",void 0),s([h(g)],e.prototype,"timeExtent",void 0),e=s([c("esri.layers.mixins.WMSLayerView")],e),e};let l=class extends v(x){constructor(){super(...arguments),this.type="wms-3d"}initialize(){this.layer.serviceSupportsSpatialReference(this.view.spatialReference)||this.addResolvingPromise(Promise.reject(new m("layerview:spatial-reference-incompatible","The spatial references supported by this WMS layer are incompatible with the spatial reference of the view"))),this.updatingHandles.add(()=>{var r;return(r=this.exportImageParameters)==null?void 0:r.version},()=>{this.updatingHandles.addPromise(this.refreshDebounced())})}createFetchPopupFeaturesQuery(r){const e=this.findExtentInfoAt(r),t=e.extent,i=new w(t[0],t[1],t[2],t[3],this._spatialReference),o=e.imageSize,n=o.width,p=o.height,a=i.width/n;return{extent:i,width:n,height:p,x:Math.round((r.x-i.xmin)/a),y:Math.round((i.ymax-r.y)/a)}}getFetchOptions(){return{timeExtent:this.timeExtent}}};l=s([c("esri.views.3d.layers.WMSLayerView3D")],l);const R=l;export{R as default}; diff --git a/assets/WMTSLayer-d2e84f3b.js b/assets/WMTSLayer-d2e84f3b.js new file mode 100644 index 0000000..b102895 --- /dev/null +++ b/assets/WMTSLayer-d2e84f3b.js @@ -0,0 +1 @@ +import{ai as o,aj as u,ca as A,bV as z,al as N,ck as Q,ay as O,aF as G,ar as _,c7 as ge,f2 as we,kL as B,kM as xe,dZ as de,eQ as ve,eR as Se,eS as Me,aG as re,aH as U,aT as ie,as as se,kN as Ie,at as K,cl as le,bf as ae,av as Te,bY as Le,aA as Ee}from"./index-080e108a.js";import{O as Pe}from"./MultiOriginJSONSupport-e4912ffd.js";import{p as Ce,L as be}from"./WebTileLayer-df8c0816.js";import{c as Oe}from"./OperationalLayer-0e8f8b28.js";import{j as Re}from"./PortalLayer-310c2800.js";import{o as oe}from"./imageBitmapUtils-391f7b8f.js";import{e as Ae}from"./TileInfoTilemapCache-b3f5dda7.js";import{o as X}from"./crsUtils-3bab3d8c.js";import{o as ne}from"./xmlUtils-444cb4c0.js";import"./commonProperties-30089b06.js";import"./portalItemUtils-792a27e1.js";var J;let F=J=class extends Q{constructor(e){super(e),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const e=new J;return this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo&&this.tileInfo.clone()),e}};o([u({type:A,json:{read:{source:"fullExtent"}}})],F.prototype,"fullExtent",void 0),o([u({type:String,json:{read:{source:"id"}}})],F.prototype,"id",void 0),o([u({type:z,json:{read:{source:"tileInfo"}}})],F.prototype,"tileInfo",void 0),F=J=o([N("esri.layer.support.TileMatrixSet")],F);const Fe=F;var q;let E=q=class extends Q{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new q;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("isDefault")&&(e.isDefault=this.isDefault),this.hasOwnProperty("keywords")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([u({json:{read:{source:"id"}}})],E.prototype,"id",void 0),o([u({json:{read:{source:"title"}}})],E.prototype,"title",void 0),o([u({json:{read:{source:"abstract"}}})],E.prototype,"description",void 0),o([u({json:{read:{source:"legendUrl"}}})],E.prototype,"legendUrl",void 0),o([u({json:{read:{source:"isDefault"}}})],E.prototype,"isDefault",void 0),o([u({json:{read:{source:"keywords"}}})],E.prototype,"keywords",void 0),E=q=o([N("esri.layer.support.WMTSStyle")],E);const $e=E;var H;let x=H=class extends Q{constructor(e){super(e),this.description=null,this.fullExtent=null,this.fullExtents=null,this.id=null,this.imageFormats=null,this.layer=null,this.parent=null,this.styles=null,this.title=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}readFullExtent(e,t){return(e=t.fullExtent)?A.fromJSON(e):null}readFullExtents(e,t){var r,i;return(r=t.fullExtents)!=null&&r.length?t.fullExtents.map(s=>A.fromJSON(s)):((i=t.tileMatrixSets)==null?void 0:i.map(s=>A.fromJSON(s.fullExtent)).filter(s=>s))??[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=this.imageFormats&&this.imageFormats.length?this.imageFormats[0]:""),e}set imageFormat(e){const t=this.imageFormats;e&&(e.includes("image/")||t&&!t.includes(e))&&(e.includes("image/")||(e="image/"+e),t&&!t.includes(e))?console.error("The layer doesn't support the format of "+e):this._set("imageFormat",e)}get styleId(){var t,r;let e=this._get("styleId");return e||(e=((r=(t=this.styles)==null?void 0:t.at(0))==null?void 0:r.id)??""),e}set styleId(e){this._set("styleId",e)}get tileMatrixSet(){return this.tileMatrixSets?this.tileMatrixSets.find(e=>e.id===this.tileMatrixSetId):null}clone(){var t;const e=new H;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats&&this.imageFormats.slice()),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("styleId")&&(e.styleId=this.styleId),this.hasOwnProperty("styles")&&(e.styles=this.styles&&this.styles.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=(t=this.tileMatrixSets)==null?void 0:t.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([u()],x.prototype,"description",void 0),o([u()],x.prototype,"fullExtent",void 0),o([O("fullExtent",["fullExtent"])],x.prototype,"readFullExtent",null),o([u({readOnly:!0})],x.prototype,"fullExtents",void 0),o([O("fullExtents",["fullExtents","tileMatrixSets"])],x.prototype,"readFullExtents",null),o([u()],x.prototype,"id",void 0),o([u()],x.prototype,"imageFormat",null),o([u({json:{read:{source:"formats"}}})],x.prototype,"imageFormats",void 0),o([u()],x.prototype,"layer",void 0),o([u()],x.prototype,"parent",void 0),o([u()],x.prototype,"styleId",null),o([u({type:G.ofType($e),json:{read:{source:"styles"}}})],x.prototype,"styles",void 0),o([u({json:{write:{ignoreOrigin:!0}}})],x.prototype,"title",void 0),o([u()],x.prototype,"tileMatrixSetId",void 0),o([u({readOnly:!0})],x.prototype,"tileMatrixSet",null),o([u({type:G.ofType(Fe),json:{read:{source:"tileMatrixSets"}}})],x.prototype,"tileMatrixSets",void 0),x=H=o([N("esri.layers.support.WMTSSublayer")],x);const j=x,me=90.71428571428571;function ue(e){const t=e.replaceAll(/ows:/gi,"");if(!g("Contents",new DOMParser().parseFromString(t,"text/xml").documentElement))throw new _("wmtslayer:wmts-capabilities-xml-is-not-valid","the wmts get capabilities response is not compliant",{text:e})}function Ve(e,t){var te;e=e.replaceAll(/ows:/gi,"");const r=new DOMParser().parseFromString(e,"text/xml").documentElement,i=new Map,s=new Map,a=g("Contents",r);if(!a)throw new _("wmtslayer:wmts-capabilities-xml-is-not-valid");const l=g("OperationsMetadata",r),n=l==null?void 0:l.querySelector("[name='GetTile']"),p=n==null?void 0:n.getElementsByTagName("Get"),m=p&&Array.prototype.slice.call(p),y=(te=t.url)==null?void 0:te.indexOf("https"),f=y!==void 0&&y>-1;let c,w,S=t.serviceMode,v=t==null?void 0:t.url;if(m&&m.length&&m.some(T=>{const L=g("Constraint",T);return!L||$("AllowedValues","Value",S,L)?(v=T.attributes[0].nodeValue,!0):(!L||$("AllowedValues","Value","RESTful",L)||$("AllowedValues","Value","REST",L)?w=T.attributes[0].nodeValue:L&&!$("AllowedValues","Value","KVP",L)||(c=T.attributes[0].nodeValue),!1)}),!v)if(w)v=w,S="RESTful";else if(c)v=c,S="KVP";else{const T=g("ServiceMetadataURL",r);v=T==null?void 0:T.getAttribute("xlink:href")}const P=v.indexOf("1.0.0/");P===-1&&S==="RESTful"?v+="/":P>-1&&(v=v.substring(0,P)),S==="KVP"&&(v+=P>-1?"":"?"),f&&(v=v.replace(/^http:/i,"https:"));const M=h("ServiceIdentification>ServiceTypeVersion",r),I=h("ServiceIdentification>AccessConstraints",r),C=I&&/^none$/i.test(I)?null:I,k=b("Layer",a),W=b("TileMatrixSet",a),D=k.map(T=>{const L=h("Identifier",T);return i.set(L,T),Ue(L,T,W,f,M)});return{copyright:C,dimensionMap:s,layerMap:i,layers:D,serviceMode:S,tileUrl:v}}function je(e){return e.layers.forEach(t=>{var r;(r=t.tileMatrixSets)==null||r.forEach(i=>{var a;const s=i.tileInfo;s&&s.dpi!==96&&((a=s.lods)==null||a.forEach(l=>{var n;l.scale=96*l.scale/s.dpi,l.resolution=fe((n=s.spatialReference)==null?void 0:n.wkid,l.scale*me/96,i.id)}),s.dpi=96)})}),e}function Z(e){return e.nodeType===Node.ELEMENT_NODE}function g(e,t){for(let r=0;ri.textContent).filter(de)}function h(e,t){return e.split(">").forEach(r=>{t&&(t=g(r,t))}),t&&t.textContent}function $(e,t,r,i){let s;return Array.prototype.slice.call(i.childNodes).some(a=>{if(a.nodeName.includes(e)){const l=g(t,a),n=l&&l.textContent;if(n===r||r.split(":")&&r.split(":")[1]===n)return s=a,!0}return!1}),s}function Ue(e,t,r,i,s){const a=h("Abstract",t),l=R("Format",t);return{id:e,fullExtent:We(t),fullExtents:De(t),description:a,formats:l,styles:Be(t,i),title:h("Title",t),tileMatrixSets:Ke(s,t,r)}}function he(e,t){var y;const r=[],i=(y=e.layerMap)==null?void 0:y.get(t);if(!i)return null;const s=b("ResourceURL",i),a=b("Dimension",i);let l,n,p,m;return a.length&&(l=h("Identifier",a[0]),n=R("Default",a[0])||R("Value",a[0])),a.length>1&&(p=h("Identifier",a[1]),m=R("Default",a[1])||R("Value",a[1])),e.dimensionMap.set(t,{dimensions:n,dimensions2:m}),s.forEach(f=>{let c=f.getAttribute("template");if(f.getAttribute("resourceType")==="tile"){if(l&&n.length)if(c.includes("{"+l+"}"))c=c.replace("{"+l+"}","{dimensionValue}");else{const w=c.toLowerCase().indexOf("{"+l.toLowerCase()+"}");w>-1&&(c=c.substring(0,w)+"{dimensionValue}"+c.substring(w+l.length+2))}if(p&&m.length)if(c.includes("{"+p+"}"))c=c.replace("{"+p+"}","{dimensionValue2}");else{const w=c.toLowerCase().indexOf("{"+p.toLowerCase()+"}");w>-1&&(c=c.substring(0,w)+"{dimensionValue2}"+c.substring(w+p.length+2))}r.push({template:c,format:f.getAttribute("format"),resourceType:"tile"})}}),r}function _e(e,t,r,i,s,a,l,n){var c,w;const p=Ne(e,t,i);if(!((p==null?void 0:p.length)>0))return"";const{dimensionMap:m}=e,y=(c=m.get(t).dimensions)==null?void 0:c[0],f=(w=m.get(t).dimensions2)==null?void 0:w[0];return p[l%p.length].template.replaceAll(/\{Style\}/gi,s??"").replaceAll(/\{TileMatrixSet\}/gi,r??"").replaceAll(/\{TileMatrix\}/gi,a).replaceAll(/\{TileRow\}/gi,""+l).replaceAll(/\{TileCol\}/gi,""+n).replaceAll(/\{dimensionValue\}/gi,y).replaceAll(/\{dimensionValue2\}/gi,f)}function Ne(e,t,r){const i=he(e,t),s=i==null?void 0:i.filter(a=>a.format===r);return(s!=null&&s.length?s:i)??[]}function ke(e,t,r,i){const{dimensionMap:s}=e,a=he(e,t);let l="";if(a&&a.length>0){const n=s.get(t).dimensions&&s.get(t).dimensions[0],p=s.get(t).dimensions2&&s.get(t).dimensions2[0];l=a[0].template,l.indexOf(".xxx")===l.length-4&&(l=l.slice(0,l.length-4)),l=l.replaceAll(/\{Style\}/gi,i),l=l.replaceAll(/\{TileMatrixSet\}/gi,r),l=l.replaceAll(/\{TileMatrix\}/gi,"{level}"),l=l.replaceAll(/\{TileRow\}/gi,"{row}"),l=l.replaceAll(/\{TileCol\}/gi,"{col}"),l=l.replaceAll(/\{dimensionValue\}/gi,n),l=l.replaceAll(/\{dimensionValue2\}/gi,p)}return l}function We(e){const t=g("WGS84BoundingBox",e),r=t?h("LowerCorner",t).split(" "):["-180","-90"],i=t?h("UpperCorner",t).split(" "):["180","90"];return{xmin:parseFloat(r[0]),ymin:parseFloat(r[1]),xmax:parseFloat(i[0]),ymax:parseFloat(i[1]),spatialReference:{wkid:4326}}}function De(e){const t=[];return ne(e,{BoundingBox:r=>{if(!r.getAttribute("crs"))return;const i=r.getAttribute("crs").toLowerCase(),s=ee(i),a=i.includes("epsg")&&X(s.wkid);let l,n,p,m;ne(r,{LowerCorner:y=>{[l,n]=y.textContent.split(" ").map(f=>Number.parseFloat(f)),a&&([l,n]=[n,l])},UpperCorner:y=>{[p,m]=y.textContent.split(" ").map(f=>Number.parseFloat(f)),a&&([p,m]=[m,p])}}),t.push({xmin:l,ymin:n,xmax:p,ymax:m,spatialReference:s})}}),t}function Be(e,t){return b("Style",e).map(r=>{const i=g("LegendURL",r),s=g("Keywords",r),a=s?R("Keyword",s):[];let l=i&&i.getAttribute("xlink:href");return t&&(l=l&&l.replace(/^http:/i,"https:")),{abstract:h("Abstract",r),id:h("Identifier",r),isDefault:r.getAttribute("isDefault")==="true",keywords:a,legendUrl:l,title:h("Title",r)}})}function Ke(e,t,r){return b("TileMatrixSetLink",t).map(i=>Ge(e,i,r))}function Ge(e,t,r){const i=g("TileMatrixSet",t).textContent,s=R("TileMatrix",t),a=r.find(M=>{const I=g("Identifier",M),C=I&&I.textContent;return!!(C===i||i.split(":")&&i.split(":")[1]===C)}),l=g("TileMatrixSetLimits",t),n=l&&b("TileMatrixLimits",l),p=new Map;if(n!=null&&n.length)for(const M of n){const I=g("TileMatrix",M).textContent,C=+g("MinTileRow",M).textContent,k=+g("MaxTileRow",M).textContent,W=+g("MinTileCol",M).textContent,D=+g("MaxTileCol",M).textContent;p.set(I,{minCol:W,maxCol:D,minRow:C,maxRow:k})}const m=h("SupportedCRS",a).toLowerCase(),y=Je(a,m),f=y.spatialReference,c=g("TileMatrix",a),w=[parseInt(h("TileWidth",c),10),parseInt(h("TileHeight",c),10)],S=[];s.length?s.forEach((M,I)=>{const C=$("TileMatrix","Identifier",M,a);S.push(pe(C,m,I,i,p))}):b("TileMatrix",a).forEach((M,I)=>{S.push(pe(M,m,I,i,p))});const v=qe(e,a,y,w,S[0]).toJSON(),P=new z({dpi:96,spatialReference:f,size:w,origin:y,lods:S}).toJSON();return{id:i,fullExtent:v,tileInfo:P}}function ee(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);t!==900913&&t!==3857||(t=102100);const r=Ye(e);return r!=null&&(t=r),{wkid:t}}function Je(e,t){return ye(g("TileMatrix",e),t)}function ye(e,t){const r=ee(t),[i,s]=h("TopLeftCorner",e).split(" ").map(l=>parseFloat(l)),a=t.includes("epsg")&&X(r.wkid);return new ge(a?{x:s,y:i,spatialReference:r}:{x:i,y:s,spatialReference:r})}function qe(e,t,r,i,s){const a=g("BoundingBox",t);let l,n,p,m,y,f;if(a&&(l=h("LowerCorner",a).split(" "),n=h("UpperCorner",a).split(" ")),l&&l.length>1&&n&&n.length>1)p=parseFloat(l[0]),y=parseFloat(l[1]),m=parseFloat(n[0]),f=parseFloat(n[1]);else{const c=g("TileMatrix",t),w=parseInt(h("MatrixWidth",c),10),S=parseInt(h("MatrixHeight",c),10);p=r.x,f=r.y,m=p+w*i[0]*s.resolution,y=f-S*i[1]*s.resolution}return He(e,r.spatialReference,r)?new A(y,p,f,m,r.spatialReference):new A(p,y,m,f,r.spatialReference)}function He(e,t,r){return e==="1.0.0"&&X(t.wkid)&&!(r.spatialReference.isGeographic&&r.x<-90&&r.y>=-90)}var V;function Ye(e){return e.includes("crs84")||e.includes("crs:84")?V.CRS84:e.includes("crs83")||e.includes("crs:83")?V.CRS83:e.includes("crs27")||e.includes("crs:27")?V.CRS27:null}function pe(e,t,r,i,s){const a=ee(t),l=h("Identifier",e);let n=parseFloat(h("ScaleDenominator",e));const p=fe(a.wkid,n,i);n*=96/me;const m=+h("MatrixWidth",e),y=+h("MatrixHeight",e),{maxCol:f=m-1,maxRow:c=y-1,minCol:w=0,minRow:S=0}=s.get(l)??{},{x:v,y:P}=ye(e,t);return new we({cols:[w,f],level:r,levelValue:l,origin:[v,P],scale:n,resolution:p,rows:[S,c]})}function fe(e,t,r){let i;return i=B.hasOwnProperty(""+e)?B.values[B[e]]:r==="default028mm"?6370997*Math.PI/180:xe(e).metersPerDegree,7*t/25e3/i}(function(e){e[e.CRS84=4326]="CRS84",e[e.CRS83=4269]="CRS83",e[e.CRS27=4267]="CRS27"})(V||(V={}));var Y;const ce={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},ze=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let d=Y=class extends ve(Se(Me(Oe(Re(Pe(Ee)))))){constructor(...e){super(...e),this.activeLayer=null,this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([re(()=>this.activeLayer,(t,r)=>{var i;r&&!((i=this.sublayers)!=null&&i.includes(r))&&(r.layer=null,r.parent=null),t&&(t.layer=this,t.parent=this)},U),ie(()=>this.sublayers,"after-add",({item:t})=>{t.layer=this,t.parent=this},U),ie(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=null,t.parent=null},U),re(()=>this.sublayers,(t,r)=>{if(r)for(const i of r)i.layer=null,i.parent=null;if(t)for(const i of t)i.layer=this,i.parent=this},U)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(se).then(()=>this._fetchService(e)).catch(t=>{throw se(t),new _("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:t})})),Promise.resolve(this)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new j);let i=t.layers.find(s=>s.id===this.activeLayer.id);return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,a=i==null?void 0:i.layerIdentifier;let l=null;const n=i==null?void 0:i.tileMatrixSet;n&&(Array.isArray(n)?n.length&&(l=n[0]):l=n);const p=s==null?void 0:s.format,m=s==null?void 0:s.style;return new j({id:a,imageFormat:p,styleId:m,tileMatrixSetId:l})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const a=Ie("tileMatrixSet.tileInfo",s);t.tileInfo=a?a.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,r){return Qe(t.layers,r)}get supportedSpatialReferences(){var e;return((e=this.activeLayer.tileMatrixSets)==null?void 0:e.map(t=>{var r;return(r=t.tileInfo)==null?void 0:r.spatialReference}).toArray().filter(de))??[]}get tilemapCache(){var t,r;const e=(r=(t=this.activeLayer)==null?void 0:t.tileMatrixSet)==null?void 0:r.tileInfo;return e?new Ae(e):void 0}get title(){var e;return((e=this.activeLayer)==null?void 0:e.title)??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.substr(-1)==="/"?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId),i=r==null?void 0:r.tileInfo,s=e.fullExtent,a=new Ce({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(a.customLayerParameters=this.customLayerParameters),this.customParameters&&(a.customParameters=this.customParameters),new be({fullExtent:s,urlTemplate:t,tileInfo:i,wmtsInfo:a})}async fetchTile(e,t,r,i={}){const{signal:s}=i,a=this.getTileUrl(e,t,r),{data:l}=await K(a,{responseType:"image",signal:s});return l}async fetchImageBitmapTile(e,t,r,i={}){const{signal:s}=i;if(this.fetchTile!==Y.prototype.fetchTile){const n=await this.fetchTile(e,t,r,i);return oe(n,e,t,r,s)}const a=this.getTileUrl(e,t,r),{data:l}=await K(a,{responseType:"blob",signal:s});return oe(l,e,t,r,s)}findSublayerById(e){var t;return(t=this.sublayers)==null?void 0:t.find(r=>r.id===e)}getTileUrl(e,t,r){var n;const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId),s=(n=i==null?void 0:i.tileInfo)==null?void 0:n.lods[e],a=s?s.levelValue||`${s.level}`:`${e}`;let l=this.resourceInfo?"":_e({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,a,t,r);return l||(l=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,a).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${r}`)),l=this._appendCustomLayerParameters(l),l}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const s=ke({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(s)return s}if(this.serviceMode==="KVP")return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if(this.serviceMode==="RESTful"){let s="";return ce[r.toLowerCase()]&&(s=ce[r.toLowerCase()]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){let t;if(this.resourceInfo)this.resourceInfo.serviceMode==="KVP"&&(this.url+=this.url.includes("?")?"":"?"),t={ssl:!1,data:this.resourceInfo};else try{t=await this._getCapabilities(this.serviceMode,e),ue(t.data)}catch{const r=this.serviceMode==="KVP"?"RESTful":"KVP";try{t=await this._getCapabilities(r,e),ue(t.data),this.serviceMode=r}catch(i){throw new _("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:i})}}this.resourceInfo?t.data=je(t.data):t.data=Ve(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:"service"})}async _getCapabilities(e,t){const r=this._getCapabilitiesUrl(e);return await K(r,{...t,responseType:"text"})}_getTileMatrixSetById(e){var i;const t=this.findSublayerById(this.activeLayer.id);return(i=t==null?void 0:t.tileMatrixSets)==null?void 0:i.find(s=>s.id===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...le(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=ae(e),i={...r.query,...t},s=Te(i);return s===""?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=this.url.split("?")[0];const t=e==="KVP"?`${this.url}?request=GetCapabilities&service=WMTS&version=${this.version}`:`${this.url}/${this.version}/WMTSCapabilities.xml`;return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=ae(e).query;if(!t)return null;const r={};return Object.keys(t).forEach(i=>{r[i.toLowerCase()]=t[i]}),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const i=Object.keys(r);i.length&&(e=e?le(e):{},i.forEach(s=>{e.hasOwnProperty(s)||ze.has(s)||(e[s]=r[s])}))}return e}};function Qe(e,t){return e.map(r=>{const i=new j;return i.read(r,t),i})}o([u()],d.prototype,"dimensionMap",void 0),o([u()],d.prototype,"layerMap",void 0),o([u({type:j,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],d.prototype,"activeLayer",void 0),o([O("service","activeLayer",["layers"])],d.prototype,"readActiveLayerFromService",null),o([O(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],d.prototype,"readActiveLayerFromItemOrWebDoc",null),o([Le(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:z},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],d.prototype,"writeActiveLayer",null),o([u({type:String,value:"",json:{write:!0}})],d.prototype,"copyright",void 0),o([u({type:["show","hide"]})],d.prototype,"listMode",void 0),o([u({json:{read:!0,write:!0}})],d.prototype,"blendMode",void 0),o([u({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],d.prototype,"customParameters",void 0),o([O(["portal-item","web-document"],"customParameters")],d.prototype,"readCustomParameters",null),o([u({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],d.prototype,"customLayerParameters",void 0),o([u({type:A,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],d.prototype,"fullExtent",void 0),o([u({readOnly:!0})],d.prototype,"fullExtents",null),o([u({type:["WebTiledLayer"]})],d.prototype,"operationalLayerType",void 0),o([u()],d.prototype,"resourceInfo",void 0),o([u()],d.prototype,"serviceMode",void 0),o([O(["portal-item","web-document"],"serviceMode",["templateUrl"])],d.prototype,"readServiceMode",null),o([u({type:G.ofType(j)})],d.prototype,"sublayers",void 0),o([O("service","sublayers",["layers"])],d.prototype,"readSublayersFromService",null),o([u({readOnly:!0})],d.prototype,"supportedSpatialReferences",null),o([u({readOnly:!0})],d.prototype,"tilemapCache",null),o([u({json:{read:{source:"title"}}})],d.prototype,"title",null),o([u({json:{read:!1},readOnly:!0,value:"wmts"})],d.prototype,"type",void 0),o([u({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],d.prototype,"url",null),o([u()],d.prototype,"version",void 0),d=Y=o([N("esri.layers.WMTSLayer")],d);const ut=d;export{ut as default}; diff --git a/assets/WMTSLayerView3D-b2043cf0.js b/assets/WMTSLayerView3D-b2043cf0.js new file mode 100644 index 0000000..27926a4 --- /dev/null +++ b/assets/WMTSLayerView3D-b2043cf0.js @@ -0,0 +1 @@ +import{cT as d,e6 as f,aF as u,bz as n,ai as s,aj as a,al as m}from"./index-080e108a.js";import{n as p}from"./LayerView3D-ffd35809.js";import{o as c}from"./TiledLayerView3D-a11f8026.js";import{d as g}from"./LayerView-448bc5ea.js";import{a as y}from"./RefreshableLayerView-915e7f53.js";let r=class extends y(c(p(g))){constructor(){super(...arguments),this.type="wmts-3d"}initialize(){this._getCompatibleTileInfoMatrixSet(e=>this._getTileInfoSupportError(e.tileInfo,e.fullExtent));const t=d(()=>{var e,i;return(i=(e=this.view)==null?void 0:e.basemapTerrain)==null?void 0:i.tilingSchemeLocked}).then(()=>{const e=this._getCompatibleTileInfoMatrixSet(i=>this._getTileInfoError(i.tileInfo,i.fullExtent));e!=null&&(e.id!==null&&this.layer.activeLayer.tileMatrixSetId!==e.id&&(this.layer.activeLayer.tileMatrixSetId=e.id),e.tileInfo&&(this.tileInfo=e.tileInfo),this.layer.fullExtent=e.fullExtent)});this.addResolvingPromise(t),this.when(()=>this._postInitialize())}get hasMixedImageFormats(){return!0}refresh(){this.emit("data-changed")}canResume(){if(!super.canResume())return!1;const t=this.layer.activeLayer.tileMatrixSet;return t!=null&&!this._getTileInfoError(t.tileInfo,t.fullExtent)}async doRefresh(){this.suspended||this.emit("data-changed")}_postInitialize(){this.updatingHandles.add(()=>{var t,e;return(e=(t=this.layer)==null?void 0:t.activeLayer)==null?void 0:e.styleId},()=>this.refresh()),this.updatingHandles.add(()=>{var t;return(t=this.layer)==null?void 0:t.activeLayer},t=>{const e=this._getCompatibleTileInfoMatrixSet(i=>this._getTileInfoError(i.tileInfo,i.fullExtent),!0);e!=null&&e.id!==null&&t.tileMatrixSetId!==e.id&&(this.layer.activeLayer.tileMatrixSetId=e.id),this.notifyChange("suspended"),this.canResume()&&this.refresh()})}_getCompatibleTileInfoMatrixSet(t,e=!1){const i=f(this.layer);if(i!=null){if(u.isCollection(i))return i.find(h=>{const l=t(h);return l!=null&&(e?n.getLogger(this).error("The selected tile matrix set is not compatible with the view",l):this.addResolvingPromise(Promise.reject(l))),l==null});const o=t(i);return o!=null&&(e?n.getLogger(this).error("The selected tile matrix set is not compatible with the view",o):this.addResolvingPromise(Promise.reject(o))),i}return null}_getTileInfoError(t,e){return this._getTileInfoSupportError(t,e)||this._getTileInfoCompatibilityError(t,this.view.basemapTerrain.tilingScheme)}};s([a({readOnly:!0})],r.prototype,"hasMixedImageFormats",null),s([a()],r.prototype,"layer",void 0),s([a()],r.prototype,"suspended",void 0),s([a()],r.prototype,"tileInfo",void 0),r=s([m("esri.views.3d.layers.WMTSLayerView3d")],r);const _=r;export{_ as default}; diff --git a/assets/WaterSurface.glsl-a424eae6.js b/assets/WaterSurface.glsl-a424eae6.js new file mode 100644 index 0000000..177067d --- /dev/null +++ b/assets/WaterSurface.glsl-a424eae6.js @@ -0,0 +1 @@ +import{a5 as r}from"./index-080e108a.js";export{r as build}; diff --git a/assets/WebTileLayer-df8c0816.js b/assets/WebTileLayer-df8c0816.js new file mode 100644 index 0000000..310fd51 --- /dev/null +++ b/assets/WebTileLayer-df8c0816.js @@ -0,0 +1 @@ +import{ai as l,aj as o,al as T,ck as x,cl as v,eQ as P,eR as $,eS as I,ca as j,bc as h,bV as S,c7 as M,f2 as r,ht as m,ar as U,hu as W,c1 as L,at as w,cd as E,ay as g,bY as D,aA as O}from"./index-080e108a.js";import{O as A}from"./MultiOriginJSONSupport-e4912ffd.js";import{c as z}from"./OperationalLayer-0e8f8b28.js";import{j as V}from"./PortalLayer-310c2800.js";import{o as b}from"./imageBitmapUtils-391f7b8f.js";var d;let y=d=class extends x{constructor(e){super(e)}clone(){return new d({customLayerParameters:v(this.customLayerParameters),customParameters:v(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};l([o({json:{type:Object,write:!0}})],y.prototype,"customLayerParameters",void 0),l([o({json:{type:Object,write:!0}})],y.prototype,"customParameters",void 0),l([o({type:String,json:{write:!0}})],y.prototype,"layerIdentifier",void 0),l([o({type:String,json:{write:!0}})],y.prototype,"tileMatrixSet",void 0),l([o({type:String,json:{write:!0}})],y.prototype,"url",void 0),y=d=l([T("esri.layer.support.WMTSLayerInfo")],y);var f;let s=f=class extends P($(I(z(V(A(O)))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new j(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,h.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=h.WebMercator,this.subDomains=null,this.tileInfo=new S({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new M({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:h.WebMercator}),spatialReference:h.WebMercator,lods:[new r({level:0,scale:591657527591555e-6,resolution:156543.033928}),new r({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new r({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new r({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new r({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new r({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new r({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new r({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new r({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new r({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new r({level:10,scale:577790.554289,resolution:152.874056570411}),new r({level:11,scale:288895.277144,resolution:76.4370282850732}),new r({level:12,scale:144447.638572,resolution:38.2185141425366}),new r({level:13,scale:72223.819286,resolution:19.1092570712683}),new r({level:14,scale:36111.909643,resolution:9.55462853563415}),new r({level:15,scale:18055.954822,resolution:4.77731426794937}),new r({level:16,scale:9027.977411,resolution:2.38865713397468}),new r({level:17,scale:4513.988705,resolution:1.19432856685505}),new r({level:18,scale:2256.994353,resolution:.597164283559817}),new r({level:19,scale:1128.497176,resolution:.298582141647617}),new r({level:20,scale:564.248588,resolution:.14929107082380833}),new r({level:21,scale:282.124294,resolution:.07464553541190416}),new r({level:22,scale:141.062147,resolution:.03732276770595208}),new r({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return typeof e=="string"?{urlTemplate:e,...t}:e}load(e){const t=this.loadFromPortal({supportedTypes:["WMTS"]},e).then(()=>{var a;let i="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const n=new m(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&((a=n.authority)!=null&&a.includes("{subDomain}"))&&(i="is missing 'subDomains' property")}else i="spatialReference must match tileInfo.spatialReference";else i="is missing the required 'urlTemplate' property value";if(i)throw new U("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${i}`)});return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){const e=[];if(!this.tileInfo)return null;for(const t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}readSpatialReference(e,t){return e||t.fullExtent&&t.fullExtent.spatialReference&&h.fromJSON(t.fullExtent.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:i}=this,a=new m(t),n=a.scheme?a.scheme+"://":"//",c=n+a.authority+"/",p=a.authority;if(p!=null&&p.includes("{subDomain}")){if(i&&i.length>0&&p.split(".").length>1)for(const u of i)e.push(n+p.replaceAll(/\{subDomain\}/gi,u)+"/")}else e.push(c);return e.map(u=>(u.charAt(u.length-1)!=="/"&&(u+="/"),u))}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new m(e),i=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.substring(i.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){e&&W(e)&&(e="https:"+e),e&&(e=e.replaceAll(/\{z\}/gi,"{level}").replaceAll(/\{x\}/gi,"{col}").replaceAll(/\{y\}/gi,"{row}"),e=L(e)),t.templateUrl=e}fetchTile(e,t,i,a={}){const{signal:n}=a,c=this.getTileUrl(e,t,i),p={responseType:"image",signal:n,query:{...this.refreshParameters}};return w(c,p).then(u=>u.data)}async fetchImageBitmapTile(e,t,i,a={}){const{signal:n}=a;if(this.fetchTile!==f.prototype.fetchTile){const R=await this.fetchTile(e,t,i,a);return b(R,e,t,i,n)}const c=this.getTileUrl(e,t,i),p={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:u}=await w(c,p);return b(u,e,t,i,n)}getTileUrl(e,t,i){const{levelValues:a,tileServers:n,urlPath:c}=this;if(!a||!n||!c)return"";const p=a[e];return n[t%n.length]+E(c,{level:p,z:p,col:i,x:i,row:t,y:t})}};l([o({type:String,value:"",json:{write:!0}})],s.prototype,"copyright",void 0),l([o({type:j,json:{write:!0},nonNullable:!0})],s.prototype,"fullExtent",void 0),l([o({readOnly:!0,json:{read:!1,write:!1}})],s.prototype,"legendEnabled",void 0),l([o({type:["show","hide"]})],s.prototype,"listMode",void 0),l([o({json:{read:!0,write:!0}})],s.prototype,"blendMode",void 0),l([o()],s.prototype,"levelValues",null),l([o({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],s.prototype,"isReference",void 0),l([o({type:["WebTiledLayer"],value:"WebTiledLayer"})],s.prototype,"operationalLayerType",void 0),l([o({readOnly:!0,json:{read:!1,write:!1}})],s.prototype,"popupEnabled",void 0),l([o({type:h})],s.prototype,"spatialReference",void 0),l([g("spatialReference",["spatialReference","fullExtent.spatialReference"])],s.prototype,"readSpatialReference",null),l([o({type:[String],json:{write:!0}})],s.prototype,"subDomains",void 0),l([o({type:S,json:{write:!0}})],s.prototype,"tileInfo",void 0),l([o({readOnly:!0})],s.prototype,"tileServers",null),l([o({json:{read:!1}})],s.prototype,"type",void 0),l([o()],s.prototype,"urlPath",null),l([o({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],s.prototype,"urlTemplate",void 0),l([g("urlTemplate",["urlTemplate","templateUrl"])],s.prototype,"readUrlTemplate",null),l([D("urlTemplate",{templateUrl:{type:String}})],s.prototype,"writeUrlTemplate",null),l([o({type:y,json:{write:!0}})],s.prototype,"wmtsInfo",void 0),s=f=l([T("esri.layers.WebTileLayer")],s);const q=s,C=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"}));export{q as L,C as W,y as p}; diff --git a/assets/WhereClause-c86b9974.js b/assets/WhereClause-c86b9974.js new file mode 100644 index 0000000..6ce6ac0 --- /dev/null +++ b/assets/WhereClause-c86b9974.js @@ -0,0 +1,7 @@ +import{ef as _o,gY as Lo,cn as Se}from"./index-080e108a.js";import{i as Re}from"./executionError-c92d3b85.js";function Mo(l,s){const o=De[l.toLowerCase()];if(o==null)throw new Error("Function Not Recognised");if(s.lengtho.maxParams)throw new Error(`Invalid Parameter count for call to ${l.toUpperCase()}`);return o.evaluate(s)}function Ro(l,s){const o=De[l.toLowerCase()];return o!=null&&s>=o.minParams&&s<=o.maxParams}const De={min:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.min.apply(Math,l[0])},max:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.max.apply(Math,l[0])},avg:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Oe(l[0])},sum:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Do(l[0])},stddev:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.sqrt(Ee(l[0]))},count:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:l[0].length},var:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Ee(l[0])}};function Oe(l){let s=0;for(let o=0;o1?f/(o-1):0}var C;(function(l){l.InvalidFunctionParameters="InvalidFunctionParameters",l.UnsupportedSqlFunction="UnsupportedSqlFunction",l.UnsupportedOperator="UnsupportedOperator",l.UnsupportedSyntax="UnsupportedSyntax",l.UnsupportedIsRhs="UnsupportedIsRhs",l.UnsupportedIsLhs="UnsupportedIsLhs",l.InvalidDataType="InvalidDataType",l.CannotCastValue="CannotCastValue",l.MissingStatisticParameters="MissingStatisticParameters"})(C||(C={}));const Oo={[C.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[C.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[C.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[C.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[C.UnsupportedOperator]:"Unsupported operator - {operator}",[C.UnsupportedSyntax]:"Unsupported syntax - {node}",[C.UnsupportedSqlFunction]:"Sql function not found = {function}",[C.InvalidDataType]:"Invalid sql data type",[C.CannotCastValue]:"Cannot cast value to the required data type"};let j=class $e extends Error{constructor(s,o){super(Re(Oo[s],o)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,$e)}};var M;(function(l){l.NeverReach="NeverReach",l.NotImplemented="NotImplemented",l.Cancelled="Cancelled",l.InvalidStatResponse="InvalidStatResponse",l.InvalidRequest="InvalidRequest",l.RequestFailed="RequestFailed",l.MissingFeatures="MissingFeatures",l.AggregationFieldNotFound="AggregationFieldNotFound",l.DataElementsNotFound="DataElementsNotFound"})(M||(M={}));const $o={[M.Cancelled]:"Cancelled",[M.InvalidStatResponse]:"Invalid statistics response from service",[M.InvalidRequest]:"Invalid request",[M.RequestFailed]:"Request failed - {reason}",[M.MissingFeatures]:"Missing features",[M.AggregationFieldNotFound]:"Aggregation field not found",[M.DataElementsNotFound]:"Data elements not found on service",[M.NeverReach]:"Encountered unreachable logic",[M.NotImplemented]:"Not implemented"};let Xo=class Je extends Error{constructor(s,o){super(Re($o[s],o)),this.declaredRootClass="esri.arcade.featureset.support.featureseterror",Error.captureStackTrace&&Error.captureStackTrace(this,Je)}},k=class D{constructor(){this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static _fixDefaults(s){if(s.precision!==null||s.secondary!==null)throw new Error("Primary and Secondary SqlInterval qualifiers not supported")}static _parseSecondsComponent(s,o){if(o.includes(".")){const f=o.split(".");s.second=parseFloat(f[0]),s.millis=parseInt(f[1],10)}else s.second=parseFloat(o)}static createFromMilliseconds(s){const o=new D;return o.second=s/1e3,o}static createFromValueAndQualifer(s,o,f){let i=null;const d=new D;if(d.op=f==="-"?"-":"+",o.type==="interval-period"){D._fixDefaults(o);const m=new RegExp("^[0-9]{1,}$");if(o.period==="year"||o.period==="month")throw new Error("Year-Month Intervals not supported");if(o.period==="second"){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(s))throw new Error("Illegal Interval");D._parseSecondsComponent(d,s)}else{if(!m.test(s))throw new Error("Illegal Interval");d[o.period]=parseFloat(s)}}else{if(D._fixDefaults(o.start),D._fixDefaults(o.end),o.start.period==="year"||o.start.period==="month")throw new Error("Year-Month Intervals not supported");if(o.end.period==="year"||o.end.period==="month")throw new Error("Year-Month Intervals not supported");switch(o.start.period){case"day":switch(o.end.period){case"hour":if(i=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!i.test(s))throw new Error("Illegal Interval");d[o.start.period]=parseFloat(s.split(" ")[0]),d[o.end.period]=parseFloat(s.split(" ")[1]);break;case"minute":if(i=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!i.test(s))throw new Error("Illegal Interval");{d[o.start.period]=parseFloat(s.split(" ")[0]);const m=s.split(" ")[1].split(":");d.hour=parseFloat(m[0]),d.minute=parseFloat(m[1])}break;case"second":if(i=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!i.test(s))throw new Error("Illegal Interval");{d[o.start.period]=parseFloat(s.split(" ")[0]);const m=s.split(" ")[1].split(":");d.hour=parseFloat(m[0]),d.minute=parseFloat(m[1]),D._parseSecondsComponent(d,m[2])}break;default:throw new Error("Invalid Interval.")}break;case"hour":switch(o.end.period){case"minute":if(i=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!i.test(s))throw new Error("Illegal Interval");d.hour=parseFloat(s.split(":")[0]),d.minute=parseFloat(s.split(":")[1]);break;case"second":if(i=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!i.test(s))throw new Error("Illegal Interval");{const m=s.split(":");d.hour=parseFloat(m[0]),d.minute=parseFloat(m[1]),D._parseSecondsComponent(d,m[2])}break;default:throw new Error("Invalid Interval.")}break;case"minute":if(o.end.period!=="second")throw new Error("Invalid Interval.");if(i=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!i.test(s))throw new Error("Illegal Interval");{const m=s.split(":");d.minute=parseFloat(m[0]),D._parseSecondsComponent(d,m[1])}break;default:throw new Error("Invalid Interval.")}}return d}valueInMilliseconds(){return(this.op==="-"?-1:1)*(this.millis+1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}};function _t(l,s){const o=Ue[l.toLowerCase()];if(o==null)throw new Error("Function Not Recognised");if(s.lengtho.maxParams)throw new Error(`Invalid Parameter count for call to ${l.toUpperCase()}`);return o.evaluate(s)}function Jo(l,s){const o=Ue[l.toLowerCase()];return o!=null&&s>=o.minParams&&s<=o.maxParams}function Uo(l){return typeof l=="string"||l instanceof String}function ko(l){return l instanceof Date}function Ce(l){const s=new Date(l.getTime());return s.setHours(0,0,0,0),s}function Fe(l,s){if(ko(l))return s?Ce(l):l;if(Uo(l)){const o=Lo.fromSQL(l);if(o.isValid)return s?Ce(o.toJSDate()):o.toJSDate()}throw new j(C.CannotCastValue)}const Ue={extract:{minParams:2,maxParams:2,evaluate:([l,s])=>{if(s==null)return null;if(s instanceof Date)switch(l.toUpperCase()){case"SECOND":return s.getSeconds();case"MINUTE":return s.getMinutes();case"HOUR":return s.getHours();case"DAY":return s.getDate();case"MONTH":return s.getMonth()+1;case"YEAR":return s.getFullYear()}throw new Error("Invalid Parameter for call to EXTRACT")}},substring:{minParams:2,maxParams:3,evaluate:l=>{if(l.length===2){const[s,o]=l;return s==null||o==null?null:s.toString().substring(o-1)}if(l.length===3){const[s,o,f]=l;return s==null||o==null||f==null?null:f<=0?"":s.toString().substring(o-1,o+f-1)}}},position:{minParams:2,maxParams:2,evaluate:([l,s])=>l==null||s==null?null:s.indexOf(l)+1},trim:{minParams:2,maxParams:3,evaluate:l=>{const s=l.length===3,o=s?l[1]:" ",f=s?l[2]:l[1];if(o==null||f==null)return null;const i=`(${_o(o)})`;switch(l[0]){case"BOTH":return f.replaceAll(new RegExp(`^${i}*|${i}*$`,"g"),"");case"LEADING":return f.replaceAll(new RegExp(`^${i}*`,"g"),"");case"TRAILING":return f.replaceAll(new RegExp(`${i}*$`,"g"),"")}throw new Error("Invalid Parameter for call to TRIM")}},abs:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.abs(l[0])},ceiling:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.ceil(l[0])},floor:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.floor(l[0])},log:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.log(l[0])},log10:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.log(l[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.sin(l[0])},cos:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.cos(l[0])},tan:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.tan(l[0])},asin:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.asin(l[0])},acos:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.acos(l[0])},atan:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.atan(l[0])},sign:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:l[0]>0?1:l[1]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:l=>l[0]==null||l[1]==null?null:l[0]**l[1]},mod:{minParams:2,maxParams:2,evaluate:l=>l[0]==null||l[1]==null?null:l[0]%l[1]},round:{minParams:1,maxParams:2,evaluate:l=>{const s=l[0],o=l.length===2?10**l[1]:1;return s==null?null:Math.round(s*o)/o}},truncate:{minParams:1,maxParams:2,evaluate:l=>l[0]==null?null:l.length===1?parseInt(l[0].toFixed(0),10):parseFloat(l[0].toFixed(l[1]))},char_length:{minParams:1,maxParams:1,evaluate:l=>typeof l[0]=="string"||l[0]instanceof String?l[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:l=>{let s="";for(let o=0;ol[0]==null?null:l[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:l[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:l=>{for(const s of l)if(s!==null)return s;return null}},cosh:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.cosh(l[0])},sinh:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.sinh(l[0])},tanh:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.tanh(l[0])},nullif:{minParams:2,maxParams:2,evaluate:l=>{const s=l[0],o=l[1];return(s instanceof Date?s.valueOf():s)===(o instanceof Date?o.valueOf():o)?null:s}},cast:{minParams:2,maxParams:2,evaluate:l=>{const s=l[0],o=l[1];if(s===null)return null;switch(o.type){case"integer":{const f=parseInt(s,10);if(isNaN(f))throw new j(C.CannotCastValue);return f}case"smallint":{const f=parseInt(s,10);if(isNaN(f))throw new j(C.CannotCastValue);if(f>32767||f<-32767)throw new j(C.CannotCastValue);return f}case"float":case"real":{const f=parseFloat(s);if(isNaN(f))throw new j(C.CannotCastValue);return f}case"date":return Fe(s,!0);case"timestamp":return Fe(s,!1);case"varchar":{const f=s.toString();if(f.length>o.size)throw new j(C.CannotCastValue);return f}default:throw new j(C.InvalidDataType)}}}};var Pe,_e,St={exports:{}};St.exports,_e=function(){function l(i,d){function m(){this.constructor=i}m.prototype=d.prototype,i.prototype=new m}function s(i,d,m,e){var N=Error.call(this,i);return Object.setPrototypeOf&&Object.setPrototypeOf(N,s.prototype),N.expected=d,N.found=m,N.location=e,N.name="SyntaxError",N}function o(i,d,m){return m=m||" ",i.length>d?i:(d-=i.length,i+(m+=m.repeat(d)).slice(0,d))}function f(i,d){var m,e={},N=(d=d!==void 0?d:{}).grammarSource,b={start:Yt},_=Yt,q="!",O="=",T=">=",S=">",L="<=",E="<>",Ge="<",Mt="!=",pt="+",dt="-",Rt="||",We="*",Ye="/",Ke="@",Dt="'",Ot="N'",X="''",Qe=".",Ze="null",Xe="true",tn="false",en="in",nn="is",rn="like",an="escape",sn="not",un="and",on="or",ln="between",cn="from",fn="for",pn="substring",dn="extract",vn="trim",hn="position",mn="timestamp",gn="date",yn="leading",wn="trailing",Nn="both",In="cast",bn="as",Tn="integer",xn="smallint",An="float",Sn="real",En="varchar",Cn="to",Fn="interval",Pn="year",_n="month",Ln="day",Mn="hour",Rn="minute",Dn="second",On="case",$n="end",Jn="when",Un="then",kn="else",qn=",",Vn="(",Hn=")",$t="`",Bn=/^[A-Za-z_\x80-\uFFFF]/,jn=/^[A-Za-z0-9_]/,zn=/^[A-Za-z0-9_.\x80-\uFFFF]/,Jt=/^[^']/,Gn=/^[0-9]/,Wn=/^[eE]/,Yn=/^[+\-]/,Kn=/^[ \t\n\r]/,Ut=/^[^`]/,Qn=g("!",!1),kt=g("=",!1),Zn=g(">=",!1),Xn=g(">",!1),tr=g("<=",!1),er=g("<>",!1),nr=g("<",!1),rr=g("!=",!1),vt=g("+",!1),ht=g("-",!1),ar=g("||",!1),sr=g("*",!1),ur=g("/",!1),or=$([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),ir=$([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),lr=$([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),cr=g("@",!1),qt=g("'",!1),fr=g("N'",!1),Vt=g("''",!1),Ht=$(["'"],!0,!1),pr=g(".",!1),dr=$([["0","9"]],!1,!1),vr=$(["e","E"],!1,!1),hr=$(["+","-"],!1,!1),mr=g("NULL",!0),gr=g("TRUE",!0),yr=g("FALSE",!0),wr=g("IN",!0),Nr=g("IS",!0),Ir=g("LIKE",!0),br=g("ESCAPE",!0),Tr=g("NOT",!0),xr=g("AND",!0),Ar=g("OR",!0),Sr=g("BETWEEN",!0),Er=g("FROM",!0),Cr=g("FOR",!0),Fr=g("SUBSTRING",!0),Pr=g("EXTRACT",!0),_r=g("TRIM",!0),Lr=g("POSITION",!0),Mr=g("TIMESTAMP",!0),Rr=g("DATE",!0),Dr=g("LEADING",!0),Or=g("TRAILING",!0),$r=g("BOTH",!0),Jr=g("CAST",!0),Ur=g("AS",!0),kr=g("INTEGER",!0),qr=g("SMALLINT",!0),Vr=g("FLOAT",!0),Hr=g("REAL",!0),Br=g("VARCHAR",!0),jr=g("TO",!0),zr=g("INTERVAL",!0),Gr=g("YEAR",!0),Wr=g("MONTH",!0),Yr=g("DAY",!0),Kr=g("HOUR",!0),Qr=g("MINUTE",!0),Zr=g("SECOND",!0),Xr=g("CASE",!0),ta=g("END",!0),ea=g("WHEN",!0),na=g("THEN",!0),ra=g("ELSE",!0),aa=g(",",!1),sa=g("(",!1),ua=g(")",!1),oa=$([" "," ",` +`,"\r"],!1,!1),Bt=g("`",!1),jt=$(["`"],!0,!1),ia=function(t){return t},la=function(t,r){var a={type:"expression-list"},u=Po(t,r);return a.value=u,a},ca=function(t,r){return Q(t,r)},fa=function(t,r){return Q(t,r)},pa=function(t){return Co("NOT",t)},da=function(t,r){return r==""||r==null||r==null?t:r.type=="arithmetic"?Q(t,r.tail):Ae(r.op,t,r.right,r.escape)},va=function(t){return{type:"arithmetic",tail:t}},ha=function(t,r){return{op:t+"NOT",right:r}},ma=function(t,r){return{op:t,right:r}},ga=function(t,r,a){return{op:"NOT"+t,right:{type:"expression-list",value:[r,a]}}},ya=function(t,r,a){return{op:t,right:{type:"expression-list",value:[r,a]}}},wa=function(t){return t[0]+" "+t[2]},Na=function(t){return t[0]+" "+t[2]},Ia=function(t,r,a){return{op:t,right:r,escape:a.value}},ba=function(t,r){return{op:t,right:r,escape:""}},Ta=function(t,r){return{op:t,right:r}},xa=function(t){return{op:t,right:{type:"expression-list",value:[]}}},Aa=function(t,r){return{op:t,right:r}},Sa=function(t,r){return Q(t,r)},Ea=function(t,r){return Q(t,r)},Ca=function(t){return t.paren=!0,t},Fa=function(t){return/^CURRENT_DATE$/i.test(t)?{type:"current-time",mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(t)?{type:"current-time",mode:"timestamp"}:{type:"column-reference",table:"",column:t}},Pa=function(t){return t},_a=function(t,r){return t+r.join("")},La=function(t,r){return t+r.join("")},Ma=function(t){return{type:"parameter",value:t[1]}},Ra=function(t,r){return{type:"function",name:"extract",args:{type:"expression-list",value:[{type:"string",value:t},r]}}},Da=function(t,r,a){return{type:"function",name:"substring",args:{type:"expression-list",value:a?[t,r,a[2]]:[t,r]}}},Oa=function(t,r){return{type:"function",name:"cast",args:{type:"expression-list",value:[t,r]}}},$a=function(){return{type:"data-type",value:{type:"integer"}}},Ja=function(){return{type:"data-type",value:{type:"smallint"}}},Ua=function(){return{type:"data-type",value:{type:"float"}}},ka=function(){return{type:"data-type",value:{type:"real"}}},qa=function(){return{type:"data-type",value:{type:"date"}}},Va=function(){return{type:"data-type",value:{type:"timestamp"}}},Ha=function(t){return{type:"data-type",value:{type:"varchar",size:parseInt(t)}}},Ba=function(t,r,a){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:t??"BOTH"},r,a]}}},ja=function(t,r){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:t??"BOTH"},r]}}},za=function(t,r){return{type:"function",name:"position",args:{type:"expression-list",value:[t,r]}}},Ga=function(t,r){return{type:"function",name:t,args:r||{type:"expression-list",value:[]}}},Wa=function(t){return{type:"timestamp",value:t.value}},Ya=function(t,r,a){return{type:"interval",value:r,qualifier:a,op:t}},Ka=function(t,r){return{type:"interval",value:t,qualifier:r,op:""}},Qa=function(t,r){return{type:"interval-qualifier",start:t,end:r}},Za=function(t,r){return{type:"interval-period",period:t.value,precision:r,secondary:null}},Xa=function(t){return{type:"interval-period",period:t.value,precision:null,secondary:null}},ts=function(t){return{type:"interval-period",period:t.value,precision:null,secondary:null}},es=function(t,r){return{type:"interval-period",period:"second",precision:t,secondary:r}},ns=function(t){return{type:"interval-period",period:"second",precision:t,secondary:null}},rs=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},as=function(t,r){return{type:"interval-period",period:t.value,precision:r,secondary:null}},ss=function(t){return{type:"interval-period",period:t.value,precision:null,secondary:null}},us=function(t,r){return{type:"interval-period",period:"second",precision:t,secondary:r}},os=function(t){return{type:"interval-period",period:"second",precision:t,secondary:null}},is=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},ls=function(){return{type:"string",value:"day"}},cs=function(){return{type:"string",value:"hour"}},fs=function(){return{type:"string",value:"minute"}},ps=function(){return{type:"string",value:"month"}},ds=function(){return{type:"string",value:"year"}},vs=function(t){return parseFloat(t)},hs=function(t){return parseFloat(t)},ms=function(t){return{type:"date",value:t.value}},gs=function(){return{type:"null",value:null}},ys=function(){return{type:"boolean",value:!0}},ws=function(){return{type:"boolean",value:!1}},zt=function(){return"'"},Ns=function(t){return{type:"string",value:t.join("")}},Is=function(t,r){return{type:"case-expression",format:"simple",operand:t,clauses:r,else:null}},bs=function(t,r,a){return{type:"case-expression",format:"simple",operand:t,clauses:r,else:a.value}},Ts=function(t){return{type:"case-expression",format:"searched",clauses:t,else:null}},xs=function(t,r){return{type:"case-expression",format:"searched",clauses:t,else:r.value}},As=function(t,r){return{type:"when-clause",operand:t,value:r}},Ss=function(t,r){return{type:"when-clause",operand:t,value:r}},Es=function(t){return{type:"else-clause",value:t}},Cs=function(t){return{type:"number",value:t}},Fs=function(t,r,a){return parseFloat(t+r+a)},Ps=function(t,r){return parseFloat(t+r)},_s=function(t,r){return parseFloat(t+r)},Ls=function(t){return parseFloat(t)},Ms=function(t,r){return t[0]+r},Rs=function(t){return"."+(t??"")},Ds=function(t,r){return t+r},Os=function(t){return t.join("")},$s=function(t,r){return"e"+(r===null?"":r)},Js=function(){return"IN"},Us=function(){return"IS"},ks=function(){return"LIKE"},qs=function(){return"ESCAPE"},Vs=function(){return"NOT"},Hs=function(){return"AND"},Bs=function(){return"OR"},js=function(){return"BETWEEN"},zs=function(){return"FROM"},Gs=function(){return"FOR"},Ws=function(){return"SUBSTRING"},Ys=function(){return"EXTRACT"},Ks=function(){return"TRIM"},Qs=function(){return"POSITION"},Zs=function(){return"TIMESTAMP"},Xs=function(){return"DATE"},tu=function(){return"LEADING"},eu=function(){return"TRAILING"},nu=function(){return"BOTH"},ru=function(){return"CAST"},au=function(){return"AS"},su=function(){return"INTEGER"},uu=function(){return"SMALLINT"},ou=function(){return"FLOAT"},iu=function(){return"REAL"},lu=function(){return"VARCHAR"},cu=function(){return"TO"},fu=function(){return"INTERVAL"},pu=function(){return"YEAR"},du=function(){return"MONTH"},vu=function(){return"DAY"},hu=function(){return"HOUR"},mu=function(){return"MINUTE"},gu=function(){return"SECOND"},yu=function(){return"CASE"},wu=function(){return"END"},Nu=function(){return"WHEN"},Iu=function(){return"THEN"},bu=function(){return"ELSE"},Tu=function(t){return t},xu=function(t){return t.join("")},n=0,tt=[{line:1,column:1}],R=0,mt=[],c=0;if("startRule"in d){if(!(d.startRule in b))throw new Error(`Can't start parsing from rule "`+d.startRule+'".');_=b[d.startRule]}function g(t,r){return{type:"literal",text:t,ignoreCase:r}}function $(t,r,a){return{type:"class",parts:t,inverted:r,ignoreCase:a}}function Au(){return{type:"end"}}function Gt(t){var r,a=tt[t];if(a)return a;for(r=t-1;!tt[r];)r--;for(a={line:(a=tt[r]).line,column:a.column};rR&&(R=n,mt=[]),mt.push(t))}function Su(t,r,a){return new s(s.buildMessage(t,r),t,r,a)}function Yt(){var t,r;return t=n,p(),(r=A())!==e?(p(),t=ia(r)):(n=t,t=e),t}function Kt(){var t,r,a,u,h,w,I,x;if(t=n,(r=A())!==e){for(a=[],u=n,h=p(),(w=ct())!==e?(I=p(),(x=A())!==e?u=h=[h,w,I,x]:(n=u,u=e)):(n=u,u=e);u!==e;)a.push(u),u=n,h=p(),(w=ct())!==e?(I=p(),(x=A())!==e?u=h=[h,w,I,x]:(n=u,u=e)):(n=u,u=e);t=la(r,a)}else n=t,t=e;return t}function A(){var t,r,a,u,h,w,I,x;if(t=n,(r=gt())!==e){for(a=[],u=n,h=p(),(w=fe())!==e?(I=p(),(x=gt())!==e?u=h=[h,w,I,x]:(n=u,u=e)):(n=u,u=e);u!==e;)a.push(u),u=n,h=p(),(w=fe())!==e?(I=p(),(x=gt())!==e?u=h=[h,w,I,x]:(n=u,u=e)):(n=u,u=e);t=ca(r,a)}else n=t,t=e;return t}function gt(){var t,r,a,u,h,w,I,x;if(t=n,(r=et())!==e){for(a=[],u=n,h=p(),(w=ot())!==e?(I=p(),(x=et())!==e?u=h=[h,w,I,x]:(n=u,u=e)):(n=u,u=e);u!==e;)a.push(u),u=n,h=p(),(w=ot())!==e?(I=p(),(x=et())!==e?u=h=[h,w,I,x]:(n=u,u=e)):(n=u,u=e);t=fa(r,a)}else n=t,t=e;return t}function et(){var t,r,a,u,h;return t=n,(r=K())===e&&(r=n,i.charCodeAt(n)===33?(a=q,n++):(a=e,c===0&&v(Qn)),a!==e?(u=n,c++,i.charCodeAt(n)===61?(h=O,n++):(h=e,c===0&&v(kt)),c--,h===e?u=void 0:(n=u,u=e),u!==e?r=a=[a,u]:(n=r,r=e)):(n=r,r=e)),r!==e?(a=p(),(u=et())!==e?t=pa(u):(n=t,t=e)):(n=t,t=e),t===e&&(t=Eu()),t}function Eu(){var t,r,a;return t=n,(r=J())!==e?(p(),(a=Cu())===e&&(a=null),t=da(r,a)):(n=t,t=e),t}function Cu(){var t;return(t=Fu())===e&&(t=Mu())===e&&(t=_u())===e&&(t=Pu())===e&&(t=Lu()),t}function Fu(){var t,r,a,u,h,w;if(t=[],r=n,a=p(),(u=Qt())!==e?(h=p(),(w=J())!==e?r=a=[a,u,h,w]:(n=r,r=e)):(n=r,r=e),r!==e)for(;r!==e;)t.push(r),r=n,a=p(),(u=Qt())!==e?(h=p(),(w=J())!==e?r=a=[a,u,h,w]:(n=r,r=e)):(n=r,r=e);else t=e;return t!==e&&(t=va(t)),t}function Qt(){var t;return i.substr(n,2)===T?(t=T,n+=2):(t=e,c===0&&v(Zn)),t===e&&(i.charCodeAt(n)===62?(t=S,n++):(t=e,c===0&&v(Xn)),t===e&&(i.substr(n,2)===L?(t=L,n+=2):(t=e,c===0&&v(tr)),t===e&&(i.substr(n,2)===E?(t=E,n+=2):(t=e,c===0&&v(er)),t===e&&(i.charCodeAt(n)===60?(t=Ge,n++):(t=e,c===0&&v(nr)),t===e&&(i.charCodeAt(n)===61?(t=O,n++):(t=e,c===0&&v(kt)),t===e&&(i.substr(n,2)===Mt?(t=Mt,n+=2):(t=e,c===0&&v(rr)))))))),t}function Pu(){var t,r,a,u;return t=n,(r=le())!==e?(p(),(a=K())!==e?(p(),(u=J())!==e?t=ha(r,u):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(r=le())!==e?(p(),(a=J())!==e?t=ma(r,a):(n=t,t=e)):(n=t,t=e)),t}function _u(){var t,r,a,u,h,w;return t=n,(r=K())!==e?(p(),(a=pe())!==e?(p(),(u=J())!==e?(p(),(h=ot())!==e?(p(),(w=J())!==e?t=ga(a,u,w):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(r=pe())!==e?(p(),(a=J())!==e?(p(),(u=ot())!==e?(p(),(h=J())!==e?t=ya(r,a,h):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)),t}function Zt(){var t,r,a,u,h;return t=n,r=n,(a=K())!==e?(u=p(),(h=ce())!==e?r=a=[a,u,h]:(n=r,r=e)):(n=r,r=e),r!==e&&(r=wa(r)),(t=r)===e&&(t=ce()),t}function yt(){var t,r,a,u,h;return t=n,r=n,(a=K())!==e?(u=p(),(h=xt())!==e?r=a=[a,u,h]:(n=r,r=e)):(n=r,r=e),r!==e&&(r=Na(r)),(t=r)===e&&(t=xt()),t}function Lu(){var t,r,a,u;return t=n,(r=Zt())!==e?(p(),(a=W())!==e?(p(),lo()!==e?(p(),(u=Tt())!==e?t=Ia(r,a,u):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(r=Zt())!==e?(p(),(a=W())!==e?t=ba(r,a):(n=t,t=e)):(n=t,t=e)),t}function Mu(){var t,r,a,u;return t=n,(r=yt())!==e?(p(),(a=F())!==e?(p(),(u=Kt())!==e?(p(),P()!==e?t=Ta(r,u):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(r=yt())!==e?(p(),(a=F())!==e?(p(),(u=P())!==e?t=xa(r):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(r=yt())!==e?(p(),(a=bt())!==e?t=Aa(r,a):(n=t,t=e)):(n=t,t=e))),t}function J(){var t,r,a,u,h,w,I,x;if(t=n,(r=wt())!==e){for(a=[],u=n,h=p(),(w=Xt())!==e?(I=p(),(x=wt())!==e?u=h=[h,w,I,x]:(n=u,u=e)):(n=u,u=e);u!==e;)a.push(u),u=n,h=p(),(w=Xt())!==e?(I=p(),(x=wt())!==e?u=h=[h,w,I,x]:(n=u,u=e)):(n=u,u=e);t=Sa(r,a)}else n=t,t=e;return t}function Xt(){var t;return i.charCodeAt(n)===43?(t=pt,n++):(t=e,c===0&&v(vt)),t===e&&(i.charCodeAt(n)===45?(t=dt,n++):(t=e,c===0&&v(ht)),t===e&&(i.substr(n,2)===Rt?(t=Rt,n+=2):(t=e,c===0&&v(ar)))),t}function wt(){var t,r,a,u,h,w,I,x;if(t=n,(r=Nt())!==e){for(a=[],u=n,h=p(),(w=te())!==e?(I=p(),(x=Nt())!==e?u=h=[h,w,I,x]:(n=u,u=e)):(n=u,u=e);u!==e;)a.push(u),u=n,h=p(),(w=te())!==e?(I=p(),(x=Nt())!==e?u=h=[h,w,I,x]:(n=u,u=e)):(n=u,u=e);t=Ea(r,a)}else n=t,t=e;return t}function te(){var t;return i.charCodeAt(n)===42?(t=We,n++):(t=e,c===0&&v(sr)),t===e&&(i.charCodeAt(n)===47?(t=Ye,n++):(t=e,c===0&&v(ur))),t}function Nt(){var t,r;return(t=ju())===e&&(t=$u())===e&&(t=Ju())===e&&(t=qu())===e&&(t=Vu())===e&&(t=Uu())===e&&(t=Hu())===e&&(t=to())===e&&(t=Ru())===e&&(t=bt())===e&&(t=n,F()!==e?(p(),(r=A())!==e?(p(),P()!==e?t=Ca(r):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)),t}function Ru(){var t;return(t=Du())!==e&&(t=Fa(t)),t}function Du(){var t;return(t=Ou())!==e&&(t=Pa(t)),t}function Ou(){var t,r,a,u;if(t=n,(r=It())!==e){for(a=[],u=ne();u!==e;)a.push(u),u=ne();t=_a(r,a)}else n=t,t=e;return t}function ee(){var t,r,a,u;if(t=n,(r=It())!==e){for(a=[],u=y();u!==e;)a.push(u),u=y();t=La(r,a)}else n=t,t=e;return t}function It(){var t;return Bn.test(i.charAt(n))?(t=i.charAt(n),n++):(t=e,c===0&&v(or)),t}function y(){var t;return jn.test(i.charAt(n))?(t=i.charAt(n),n++):(t=e,c===0&&v(ir)),t}function ne(){var t;return zn.test(i.charAt(n))?(t=i.charAt(n),n++):(t=e,c===0&&v(lr)),t}function bt(){var t,r,a;return t=n,i.charCodeAt(n)===64?(r=Ke,n++):(r=e,c===0&&v(cr)),r!==e&&(a=ee())!==e?t=r=[r,a]:(n=t,t=e),t!==e&&(t=Ma(t)),t}function $u(){var t,r,a;return t=n,po()!==e?(p(),F()!==e?(p(),(r=Bu())!==e?(p(),At()!==e?(p(),(a=A())!==e?(p(),P()!==e?t=Ra(r,a):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function Ju(){var t,r,a,u,h,w,I;return t=n,fo()!==e?(p(),F()!==e?(p(),(r=A())!==e?(p(),At()!==e?(p(),(a=A())!==e?(p(),u=n,(h=co())!==e?(w=p(),(I=A())!==e?u=h=[h,w,I,p()]:(n=u,u=e)):(n=u,u=e),u===e&&(u=null),(h=P())!==e?t=Da(r,a,u):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function Uu(){var t,r,a;return t=n,yo()!==e?(p(),F()!==e?(p(),(r=A())!==e?(p(),wo()!==e?(p(),(a=ku())!==e?(p(),P()!==e?t=Oa(r,a):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function ku(){var t,r,a;return t=n,(r=No())!==e&&(r=$a()),(t=r)===e&&(t=n,(r=Io())!==e&&(r=Ja()),(t=r)===e&&(t=n,(r=bo())!==e&&(r=Ua()),(t=r)===e&&(t=n,(r=To())!==e&&(r=ka()),(t=r)===e&&(t=n,(r=he())!==e&&(r=qa()),(t=r)===e&&(t=n,(r=ve())!==e&&(r=Va()),(t=r)===e&&(t=n,(r=xo())!==e?(p(),F()!==e?(p(),(a=V())!==e?(p(),P()!==e?t=Ha(a):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e))))))),t}function qu(){var t,r,a,u;return t=n,de()!==e?(p(),F()!==e?(p(),(r=re())===e&&(r=null),p(),(a=A())!==e?(p(),At()!==e?(p(),(u=A())!==e?(p(),P()!==e?t=Ba(r,a,u):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,de()!==e?(p(),F()!==e?(p(),(r=re())===e&&(r=null),p(),(a=A())!==e?(p(),P()!==e?t=ja(r,a):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)),t}function re(){var t;return(t=ho())===e&&(t=mo())===e&&(t=go()),t}function Vu(){var t,r,a;return t=n,vo()!==e?(p(),F()!==e?(p(),(r=A())!==e?(p(),xt()!==e?(p(),(a=A())!==e?(p(),P()!==e?t=za(r,a):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function Hu(){var t,r,a;return t=n,(r=Eo())!==e?(p(),F()!==e?(p(),(a=Kt())===e&&(a=null),p(),P()!==e?t=Ga(r,a):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function Bu(){var t;return(t=ge())===e&&(t=ye())===e&&(t=we())===e&&(t=Ne())===e&&(t=Ie())===e&&(t=H()),t}function ju(){var t;return(t=Tt())===e&&(t=ro())===e&&(t=Xu())===e&&(t=Zu())===e&&(t=Qu())===e&&(t=zu())===e&&(t=Gu()),t}function zu(){var t,r;return t=n,ve()!==e?(p(),(r=W())!==e?t=Wa(r):(n=t,t=e)):(n=t,t=e),t}function Gu(){var t,r,a,u;return t=n,me()!==e?(p(),i.charCodeAt(n)===45?(r=dt,n++):(r=e,c===0&&v(ht)),r===e&&(i.charCodeAt(n)===43?(r=pt,n++):(r=e,c===0&&v(vt))),r!==e?(p(),(a=W())!==e?(p(),(u=ae())!==e?t=Ya(r,a,u):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,me()!==e?(p(),(r=W())!==e?(p(),(a=ae())!==e?t=Ka(r,a):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)),t}function ae(){var t,r,a;return t=n,(r=Wu())!==e?(p(),Ao()!==e?(p(),(a=Yu())!==e?t=Qa(r,a):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=Ku()),t}function Wu(){var t,r,a;return t=n,(r=Y())!==e?(p(),F()!==e?(p(),(a=rt())!==e?(p(),P()!==e?t=Za(r,a):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(r=Y())!==e&&(r=Xa(r)),t=r),t}function Yu(){var t,r,a,u;return t=n,(r=Y())!==e&&(r=ts(r)),(t=r)===e&&(t=n,(r=H())!==e?(p(),F()!==e?(p(),(a=rt())!==e?(p(),ct()!==e?(p(),(u=nt())!==e?(p(),P()!==e?t=es(a,u):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(r=H())!==e?(p(),F()!==e?(p(),(a=rt())!==e?(p(),P()!==e?t=ns(a):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(r=H())!==e&&(r=rs()),t=r))),t}function Ku(){var t,r,a,u;return t=n,(r=Y())!==e?(p(),F()!==e?(p(),(a=nt())!==e?(p(),P()!==e?t=as(r,a):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(r=Y())!==e&&(r=ss(r)),(t=r)===e&&(t=n,(r=H())!==e?(p(),F()!==e?(p(),(a=rt())!==e?(p(),ct()!==e?(p(),(u=nt())!==e?(p(),P()!==e?t=us(a,u):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(r=H())!==e?(p(),F()!==e?(p(),(a=nt())!==e?(p(),P()!==e?t=os(a):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(r=H())!==e&&(r=is()),t=r)))),t}function Y(){var t,r;return t=n,(r=we())!==e&&(r=ls()),(t=r)===e&&(t=n,(r=Ne())!==e&&(r=cs()),(t=r)===e&&(t=n,(r=Ie())!==e&&(r=fs()),(t=r)===e&&(t=n,(r=ye())!==e&&(r=ps()),(t=r)===e&&(t=n,(r=ge())!==e&&(r=ds()),t=r)))),t}function nt(){var t;return(t=V())!==e&&(t=vs(t)),t}function rt(){var t;return(t=V())!==e&&(t=hs(t)),t}function Qu(){var t,r;return t=n,he()!==e?(p(),(r=W())!==e?t=ms(r):(n=t,t=e)):(n=t,t=e),t}function Zu(){var t;return(t=uo())!==e&&(t=gs()),t}function Xu(){var t,r;return t=n,(r=oo())!==e&&(r=ys()),(t=r)===e&&(t=n,(r=io())!==e&&(r=ws()),t=r),t}function W(){var t;return(t=Tt())===e&&(t=bt()),t}function Tt(){var t,r,a,u,h;if(t=n,i.charCodeAt(n)===39?(r=Dt,n++):(r=e,c===0&&v(qt)),r===e&&(i.substr(n,2)===Ot?(r=Ot,n+=2):(r=e,c===0&&v(fr))),r!==e){for(a=[],u=n,i.substr(n,2)===X?(h=X,n+=2):(h=e,c===0&&v(Vt)),h!==e&&(h=zt()),(u=h)===e&&(Jt.test(i.charAt(n))?(u=i.charAt(n),n++):(u=e,c===0&&v(Ht)));u!==e;)a.push(u),u=n,i.substr(n,2)===X?(h=X,n+=2):(h=e,c===0&&v(Vt)),h!==e&&(h=zt()),(u=h)===e&&(Jt.test(i.charAt(n))?(u=i.charAt(n),n++):(u=e,c===0&&v(Ht)));i.charCodeAt(n)===39?(u=Dt,n++):(u=e,c===0&&v(qt)),u!==e?t=Ns(a):(n=t,t=e)}else n=t,t=e;return t}function to(){var t;return(t=eo())===e&&(t=no()),t}function eo(){var t,r,a,u,h;if(t=n,it()!==e)if(p(),(r=A())!==e){for(p(),a=[],u=st();u!==e;)a.push(u),u=st();u=p(),(h=lt())!==e?t=Is(r,a):(n=t,t=e)}else n=t,t=e;else n=t,t=e;if(t===e)if(t=n,it()!==e)if(p(),(r=A())!==e){for(p(),a=[],u=st();u!==e;)a.push(u),u=st();u=p(),(h=se())!==e?(p(),lt()!==e?t=bs(r,a,h):(n=t,t=e)):(n=t,t=e)}else n=t,t=e;else n=t,t=e;return t}function no(){var t,r,a,u;if(t=n,it()!==e){for(p(),r=[],a=at();a!==e;)r.push(a),a=at();a=p(),(u=lt())!==e?t=Ts(r):(n=t,t=e)}else n=t,t=e;if(t===e)if(t=n,it()!==e){for(p(),r=[],a=at();a!==e;)r.push(a),a=at();a=p(),(u=se())!==e?(p(),lt()!==e?t=xs(r,u):(n=t,t=e)):(n=t,t=e)}else n=t,t=e;return t}function at(){var t,r,a;return t=n,be()!==e?(p(),(r=A())!==e?(p(),Te()!==e?(p(),(a=A())!==e?t=As(r,a):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function st(){var t,r,a;return t=n,be()!==e?(p(),(r=A())!==e?(p(),Te()!==e?(p(),(a=A())!==e?t=Ss(r,a):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function se(){var t,r;return t=n,So()!==e?(p(),(r=A())!==e?t=Es(r):(n=t,t=e)):(n=t,t=e),t}function ro(){var t,r,a,u;return t=n,(r=ao())!==e?(a=n,c++,u=It(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=Cs(r):(n=t,t=e)):(n=t,t=e),t}function ao(){var t,r,a,u;return t=n,(r=ut())!==e&&(a=ue())!==e&&(u=oe())!==e?t=Fs(r,a,u):(n=t,t=e),t===e&&(t=n,(r=ut())!==e&&(a=ue())!==e?t=Ps(r,a):(n=t,t=e),t===e&&(t=n,(r=ut())!==e&&(a=oe())!==e?t=_s(r,a):(n=t,t=e),t===e&&(t=n,(r=ut())!==e&&(r=Ls(r)),t=r))),t}function ut(){var t,r,a;return(t=V())===e&&(t=n,i.charCodeAt(n)===45?(r=dt,n++):(r=e,c===0&&v(ht)),r===e&&(i.charCodeAt(n)===43?(r=pt,n++):(r=e,c===0&&v(vt))),r!==e&&(a=V())!==e?t=Ms(r,a):(n=t,t=e)),t}function ue(){var t,r,a;return t=n,i.charCodeAt(n)===46?(r=Qe,n++):(r=e,c===0&&v(pr)),r!==e?((a=V())===e&&(a=null),t=Rs(a)):(n=t,t=e),t}function oe(){var t,r,a;return t=n,(r=so())!==e&&(a=V())!==e?t=Ds(r,a):(n=t,t=e),t}function V(){var t,r;if(t=[],(r=ie())!==e)for(;r!==e;)t.push(r),r=ie();else t=e;return t!==e&&(t=Os(t)),t}function ie(){var t;return Gn.test(i.charAt(n))?(t=i.charAt(n),n++):(t=e,c===0&&v(dr)),t}function so(){var t,r,a;return t=n,Wn.test(i.charAt(n))?(r=i.charAt(n),n++):(r=e,c===0&&v(vr)),r!==e?(Yn.test(i.charAt(n))?(a=i.charAt(n),n++):(a=e,c===0&&v(hr)),a===e&&(a=null),t=$s(r,a)):(n=t,t=e),t}function uo(){var t,r,a,u;return t=n,i.substr(n,4).toLowerCase()===Ze?(r=i.substr(n,4),n+=4):(r=e,c===0&&v(mr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=r=[r,a]:(n=t,t=e)):(n=t,t=e),t}function oo(){var t,r,a,u;return t=n,i.substr(n,4).toLowerCase()===Xe?(r=i.substr(n,4),n+=4):(r=e,c===0&&v(gr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=r=[r,a]:(n=t,t=e)):(n=t,t=e),t}function io(){var t,r,a,u;return t=n,i.substr(n,5).toLowerCase()===tn?(r=i.substr(n,5),n+=5):(r=e,c===0&&v(yr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=r=[r,a]:(n=t,t=e)):(n=t,t=e),t}function xt(){var t,r,a,u;return t=n,i.substr(n,2).toLowerCase()===en?(r=i.substr(n,2),n+=2):(r=e,c===0&&v(wr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=Js():(n=t,t=e)):(n=t,t=e),t}function le(){var t,r,a,u;return t=n,i.substr(n,2).toLowerCase()===nn?(r=i.substr(n,2),n+=2):(r=e,c===0&&v(Nr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=Us():(n=t,t=e)):(n=t,t=e),t}function ce(){var t,r,a,u;return t=n,i.substr(n,4).toLowerCase()===rn?(r=i.substr(n,4),n+=4):(r=e,c===0&&v(Ir)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=ks():(n=t,t=e)):(n=t,t=e),t}function lo(){var t,r,a,u;return t=n,i.substr(n,6).toLowerCase()===an?(r=i.substr(n,6),n+=6):(r=e,c===0&&v(br)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=qs():(n=t,t=e)):(n=t,t=e),t}function K(){var t,r,a,u;return t=n,i.substr(n,3).toLowerCase()===sn?(r=i.substr(n,3),n+=3):(r=e,c===0&&v(Tr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=Vs():(n=t,t=e)):(n=t,t=e),t}function ot(){var t,r,a,u;return t=n,i.substr(n,3).toLowerCase()===un?(r=i.substr(n,3),n+=3):(r=e,c===0&&v(xr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=Hs():(n=t,t=e)):(n=t,t=e),t}function fe(){var t,r,a,u;return t=n,i.substr(n,2).toLowerCase()===on?(r=i.substr(n,2),n+=2):(r=e,c===0&&v(Ar)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=Bs():(n=t,t=e)):(n=t,t=e),t}function pe(){var t,r,a,u;return t=n,i.substr(n,7).toLowerCase()===ln?(r=i.substr(n,7),n+=7):(r=e,c===0&&v(Sr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=js():(n=t,t=e)):(n=t,t=e),t}function At(){var t,r,a,u;return t=n,i.substr(n,4).toLowerCase()===cn?(r=i.substr(n,4),n+=4):(r=e,c===0&&v(Er)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=zs():(n=t,t=e)):(n=t,t=e),t}function co(){var t,r,a,u;return t=n,i.substr(n,3).toLowerCase()===fn?(r=i.substr(n,3),n+=3):(r=e,c===0&&v(Cr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=Gs():(n=t,t=e)):(n=t,t=e),t}function fo(){var t,r,a,u;return t=n,i.substr(n,9).toLowerCase()===pn?(r=i.substr(n,9),n+=9):(r=e,c===0&&v(Fr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=Ws():(n=t,t=e)):(n=t,t=e),t}function po(){var t,r,a,u;return t=n,i.substr(n,7).toLowerCase()===dn?(r=i.substr(n,7),n+=7):(r=e,c===0&&v(Pr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=Ys():(n=t,t=e)):(n=t,t=e),t}function de(){var t,r,a,u;return t=n,i.substr(n,4).toLowerCase()===vn?(r=i.substr(n,4),n+=4):(r=e,c===0&&v(_r)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=Ks():(n=t,t=e)):(n=t,t=e),t}function vo(){var t,r,a,u;return t=n,i.substr(n,8).toLowerCase()===hn?(r=i.substr(n,8),n+=8):(r=e,c===0&&v(Lr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=Qs():(n=t,t=e)):(n=t,t=e),t}function ve(){var t,r,a,u;return t=n,i.substr(n,9).toLowerCase()===mn?(r=i.substr(n,9),n+=9):(r=e,c===0&&v(Mr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=Zs():(n=t,t=e)):(n=t,t=e),t}function he(){var t,r,a,u;return t=n,i.substr(n,4).toLowerCase()===gn?(r=i.substr(n,4),n+=4):(r=e,c===0&&v(Rr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=Xs():(n=t,t=e)):(n=t,t=e),t}function ho(){var t,r,a,u;return t=n,i.substr(n,7).toLowerCase()===yn?(r=i.substr(n,7),n+=7):(r=e,c===0&&v(Dr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=tu():(n=t,t=e)):(n=t,t=e),t}function mo(){var t,r,a,u;return t=n,i.substr(n,8).toLowerCase()===wn?(r=i.substr(n,8),n+=8):(r=e,c===0&&v(Or)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=eu():(n=t,t=e)):(n=t,t=e),t}function go(){var t,r,a,u;return t=n,i.substr(n,4).toLowerCase()===Nn?(r=i.substr(n,4),n+=4):(r=e,c===0&&v($r)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=nu():(n=t,t=e)):(n=t,t=e),t}function yo(){var t,r,a,u;return t=n,i.substr(n,4).toLowerCase()===In?(r=i.substr(n,4),n+=4):(r=e,c===0&&v(Jr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=ru():(n=t,t=e)):(n=t,t=e),t}function wo(){var t,r,a,u;return t=n,i.substr(n,2).toLowerCase()===bn?(r=i.substr(n,2),n+=2):(r=e,c===0&&v(Ur)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=au():(n=t,t=e)):(n=t,t=e),t}function No(){var t,r,a,u;return t=n,i.substr(n,7).toLowerCase()===Tn?(r=i.substr(n,7),n+=7):(r=e,c===0&&v(kr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=su():(n=t,t=e)):(n=t,t=e),t}function Io(){var t,r,a,u;return t=n,i.substr(n,8).toLowerCase()===xn?(r=i.substr(n,8),n+=8):(r=e,c===0&&v(qr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=uu():(n=t,t=e)):(n=t,t=e),t}function bo(){var t,r,a,u;return t=n,i.substr(n,5).toLowerCase()===An?(r=i.substr(n,5),n+=5):(r=e,c===0&&v(Vr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=ou():(n=t,t=e)):(n=t,t=e),t}function To(){var t,r,a,u;return t=n,i.substr(n,4).toLowerCase()===Sn?(r=i.substr(n,4),n+=4):(r=e,c===0&&v(Hr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=iu():(n=t,t=e)):(n=t,t=e),t}function xo(){var t,r,a,u;return t=n,i.substr(n,7).toLowerCase()===En?(r=i.substr(n,7),n+=7):(r=e,c===0&&v(Br)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=lu():(n=t,t=e)):(n=t,t=e),t}function Ao(){var t,r,a,u;return t=n,i.substr(n,2).toLowerCase()===Cn?(r=i.substr(n,2),n+=2):(r=e,c===0&&v(jr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=cu():(n=t,t=e)):(n=t,t=e),t}function me(){var t,r,a,u;return t=n,i.substr(n,8).toLowerCase()===Fn?(r=i.substr(n,8),n+=8):(r=e,c===0&&v(zr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=fu():(n=t,t=e)):(n=t,t=e),t}function ge(){var t,r,a,u;return t=n,i.substr(n,4).toLowerCase()===Pn?(r=i.substr(n,4),n+=4):(r=e,c===0&&v(Gr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=pu():(n=t,t=e)):(n=t,t=e),t}function ye(){var t,r,a,u;return t=n,i.substr(n,5).toLowerCase()===_n?(r=i.substr(n,5),n+=5):(r=e,c===0&&v(Wr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=du():(n=t,t=e)):(n=t,t=e),t}function we(){var t,r,a,u;return t=n,i.substr(n,3).toLowerCase()===Ln?(r=i.substr(n,3),n+=3):(r=e,c===0&&v(Yr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=vu():(n=t,t=e)):(n=t,t=e),t}function Ne(){var t,r,a,u;return t=n,i.substr(n,4).toLowerCase()===Mn?(r=i.substr(n,4),n+=4):(r=e,c===0&&v(Kr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=hu():(n=t,t=e)):(n=t,t=e),t}function Ie(){var t,r,a,u;return t=n,i.substr(n,6).toLowerCase()===Rn?(r=i.substr(n,6),n+=6):(r=e,c===0&&v(Qr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=mu():(n=t,t=e)):(n=t,t=e),t}function H(){var t,r,a,u;return t=n,i.substr(n,6).toLowerCase()===Dn?(r=i.substr(n,6),n+=6):(r=e,c===0&&v(Zr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=gu():(n=t,t=e)):(n=t,t=e),t}function it(){var t,r,a,u;return t=n,i.substr(n,4).toLowerCase()===On?(r=i.substr(n,4),n+=4):(r=e,c===0&&v(Xr)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=yu():(n=t,t=e)):(n=t,t=e),t}function lt(){var t,r,a,u;return t=n,i.substr(n,3).toLowerCase()===$n?(r=i.substr(n,3),n+=3):(r=e,c===0&&v(ta)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=wu():(n=t,t=e)):(n=t,t=e),t}function be(){var t,r,a,u;return t=n,i.substr(n,4).toLowerCase()===Jn?(r=i.substr(n,4),n+=4):(r=e,c===0&&v(ea)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=Nu():(n=t,t=e)):(n=t,t=e),t}function Te(){var t,r,a,u;return t=n,i.substr(n,4).toLowerCase()===Un?(r=i.substr(n,4),n+=4):(r=e,c===0&&v(na)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=Iu():(n=t,t=e)):(n=t,t=e),t}function So(){var t,r,a,u;return t=n,i.substr(n,4).toLowerCase()===kn?(r=i.substr(n,4),n+=4):(r=e,c===0&&v(ra)),r!==e?(a=n,c++,u=y(),c--,u===e?a=void 0:(n=a,a=e),a!==e?t=bu():(n=t,t=e)):(n=t,t=e),t}function ct(){var t;return i.charCodeAt(n)===44?(t=qn,n++):(t=e,c===0&&v(aa)),t}function F(){var t;return i.charCodeAt(n)===40?(t=Vn,n++):(t=e,c===0&&v(sa)),t}function P(){var t;return i.charCodeAt(n)===41?(t=Hn,n++):(t=e,c===0&&v(ua)),t}function p(){var t,r;for(t=[],r=xe();r!==e;)t.push(r),r=xe();return t}function xe(){var t;return Kn.test(i.charAt(n))?(t=i.charAt(n),n++):(t=e,c===0&&v(oa)),t}function Eo(){var t,r,a,u;if(t=n,(r=ee())!==e&&(r=Tu(r)),(t=r)===e)if(t=n,i.charCodeAt(n)===96?(r=$t,n++):(r=e,c===0&&v(Bt)),r!==e){if(a=[],Ut.test(i.charAt(n))?(u=i.charAt(n),n++):(u=e,c===0&&v(jt)),u!==e)for(;u!==e;)a.push(u),Ut.test(i.charAt(n))?(u=i.charAt(n),n++):(u=e,c===0&&v(jt));else a=e;a!==e?(i.charCodeAt(n)===96?(u=$t,n++):(u=e,c===0&&v(Bt)),u!==e?t=xu(a):(n=t,t=e)):(n=t,t=e)}else n=t,t=e;return t}function Co(t,r){return{type:"unary-expression",operator:t,expr:r}}function Ae(t,r,a,u){var h={type:"binary-expression",operator:t,left:r,right:a};return u!==void 0&&(h.escape=u),h}function Fo(t,r){for(var a=[t],u=0;u `+_+` +`+O+` | +`+b.line+" | "+T+` +`+O+" | "+o("",N.column-1," ")+o("",S,"^")}else d+=` + at `+_}return d},s.buildMessage=function(i,d){var m={literal:function(T){return'"'+N(T.text)+'"'},class:function(T){var S=T.parts.map(function(L){return Array.isArray(L)?b(L[0])+"-"+b(L[1]):b(L)});return"["+(T.inverted?"^":"")+S.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(T){return T.description}};function e(T){return T.charCodeAt(0).toString(16).toUpperCase()}function N(T){return T.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(S){return"\\x0"+e(S)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(S){return"\\x"+e(S)})}function b(T){return T.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(S){return"\\x0"+e(S)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(S){return"\\x"+e(S)})}function _(T){return m[T.type](T)}function q(T){var S,L,E=T.map(_);if(E.sort(),E.length>0){for(S=1,L=1;S=s?l:new Array(s-l.length+1).join("0")+l}function Z(l,s,o="0",f="0",i="0",d="0",m="",e="0",N="0"){if(m==="+"||m==="-"){const b=`${B(parseInt(l,10),4)}-${B(parseInt(s,10),2)}-${B(parseInt(o,10),2)}`;let _="";parseFloat(d)<10&&(_="0");const q=`${B(parseInt(f,10),2)}:${B(parseInt(i,10),2)}:${_+parseFloat(d).toString()}`,O=`${m}${B(parseInt(e,10),2)}:${B(parseInt(N,10),2)}`;return new Date(b+"T"+q+O)}return new Date(parseInt(l,10),parseInt(s,10)-1,parseInt(o,10),parseInt(f,10),parseInt(i,10),parseFloat(d))}class Wo{static makeBool(s){return qe(s)}static featureValue(s,o,f,i){return ze(s,o,f,i)}static equalsNull(s){return s===null}static applyLike(s,o,f){return Pt(s,o,f)}static ensureArray(s){return Ct(s)}static applyIn(s,o){return Ft(s,o)}static currentDate(){const s=new Date;return s.setHours(0,0,0,0),s}static makeSqlInterval(s,o,f){return k.createFromValueAndQualifer(s,o,f)}static convertInterval(s){return s instanceof k?s.valueInMilliseconds():s}static currentTimestamp(){return new Date}static compare(s,o,f){return Be(s,o,f)}static calculate(s,o,f){return je(s,o,f)}static makeComparable(s){return U(s)}static evaluateFunction(s,o){return _t(s,o)}static lookup(s,o){const f=o[s];return f===void 0?null:f}static between(s,o){return s==null||o[0]==null||o[1]==null?null:s>=o[0]&&s<=o[1]}static notbetween(s,o){return s==null||o[0]==null||o[1]==null?null:so[1]}static ternaryNot(s){return ft(s)}static ternaryAnd(s,o){return Ve(s,o)}static ternaryOr(s,o){return He(s,o)}}class Lt{constructor(s,o){this.fieldsIndex=o,this._datefields={},this.parameters={},this._hasDateFunctions=void 0,this.parseTree=Vo.parse(s);const{isStandardized:f,isAggregate:i,referencedFieldNames:d}=this._extractExpressionInfo(o);this._referencedFieldNames=d,this.isStandardized=f,this.isAggregate=i}static create(s,o){return new Lt(s,o)}get fieldNames(){return this._referencedFieldNames}testSet(s,o=z){const f={};for(const i of this.fieldNames)f[i]=s.map(d=>o.getAttribute(d,i));return!!this._evaluateNode(this.parseTree,{attributes:f},z)}calculateValue(s,o=z){const f=this._evaluateNode(this.parseTree,s,o);return f instanceof k?f.valueInMilliseconds()/864e5:f}calculateValueCompiled(s,o=z){return this.parseTree._compiledVersion!=null?this.parseTree._compiledVersion(s,this.parameters,o,this._datefields):Se("esri-csp-restrictions")?this.calculateValue(s,o):(this._compileMe(),this.parseTree._compiledVersion(s,this.parameters,o,this._datefields))}testFeature(s,o=z){return!!this._evaluateNode(this.parseTree,s,o)}testFeatureCompiled(s,o=z){return this.parseTree._compiledVersion!=null?!!this.parseTree._compiledVersion(s,this.parameters,o,this._datefields):Se("esri-csp-restrictions")?this.testFeature(s,o):(this._compileMe(),!!this.parseTree._compiledVersion(s,this.parameters,o,this._datefields))}get hasDateFunctions(){return this._hasDateFunctions!=null||(this._hasDateFunctions=!1,this._visitAll(this.parseTree,s=>{s.type==="current-time"?this._hasDateFunctions=!0:s.type==="function"&&(this._hasDateFunctions=this._hasDateFunctions||Go.has(s.name.toLowerCase()))})),this._hasDateFunctions}getFunctions(){const s=new Set;return this._visitAll(this.parseTree,o=>{o.type==="function"&&s.add(o.name.toLowerCase())}),Array.from(s)}getExpressions(){const s=new Map;return this._visitAll(this.parseTree,o=>{if(o.type==="function"){const f=o.name.toLowerCase(),i=o.args.value[0];if(i.type==="column-reference"){const d=i.column,m=`${f}-${d}`;s.has(m)||s.set(m,{aggregateType:f,field:d})}}}),[...s.values()]}getVariables(){const s=new Set;return this._visitAll(this.parseTree,o=>{o.type==="parameter"&&s.add(o.value.toLowerCase())}),Array.from(s)}_compileMe(){const s="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","datefields",s).bind(Wo)}_extractExpressionInfo(s){const o=[],f=new Set;let i=!0,d=!0;return this._visitAll(this.parseTree,m=>{switch(m.type){case"column-reference":{const e=s==null?void 0:s.get(m.column);let N,b;e?N=b=e.name??"":(b=m.column,N=b.toLowerCase()),e&&e.name&&(e.type==="date"||e.type==="esriFieldTypeDate")&&(this._datefields[e.name]=1),f.has(N)||(f.add(N),o.push(b)),m.column=b;break}case"function":{const{name:e,args:N}=m,b=N.value.length;i&&(i=Jo(e,b)),d&&(d=Ro(e,b));break}}}),{referencedFieldNames:Array.from(o),isStandardized:i,isAggregate:d}}_visitAll(s,o){if(s!=null)switch(o(s),s.type){case"when-clause":this._visitAll(s.operand,o),this._visitAll(s.value,o);break;case"case-expression":for(const f of s.clauses)this._visitAll(f,o);s.format==="simple"&&this._visitAll(s.operand,o),s.else!==null&&this._visitAll(s.else,o);break;case"expression-list":for(const f of s.value)this._visitAll(f,o);break;case"unary-expression":this._visitAll(s.expr,o);break;case"binary-expression":this._visitAll(s.left,o),this._visitAll(s.right,o);break;case"function":this._visitAll(s.args,o)}}evaluateNodeToJavaScript(s){switch(s.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(s.value)+", "+JSON.stringify(s.qualifier)+","+JSON.stringify(s.op)+")";case"case-expression":{let o="";if(s.format==="simple"){const f="this.makeComparable("+this.evaluateNodeToJavaScript(s.operand)+")";o="( ";for(let i=0;i":case"<":case">":case">=":case"<=":case"=":return"this.compare("+JSON.stringify(s.operator)+","+this.evaluateNodeToJavaScript(s.left)+","+this.evaluateNodeToJavaScript(s.right)+")";case"*":case"-":case"+":case"/":case"||":return"this.calculate("+JSON.stringify(s.operator)+","+this.evaluateNodeToJavaScript(s.left)+","+this.evaluateNodeToJavaScript(s.right)+")"}throw new Error("Not Supported Operator "+s.operator);case"null":case"boolean":case"string":case"number":return JSON.stringify(s.value);case"date":return"(new Date("+Le(s.value).getTime().toString()+"))";case"timestamp":return"(new Date("+Et(s.value).getTime().toString()+"))";case"current-time":return s.mode==="date"?"this.currentDate()":"this.currentTimestamp()";case"column-reference":return"this.featureValue(feature,"+JSON.stringify(s.column)+",datefields,attributeAdapter)";case"function":return"this.evaluateFunction("+JSON.stringify(s.name)+","+this.evaluateNodeToJavaScript(s.args)+")"}throw new Error("Unsupported sql syntax "+s.type)}_evaluateNode(s,o,f){switch(s.type){case"interval":{const i=this._evaluateNode(s.value,o,f);return k.createFromValueAndQualifer(i,s.qualifier,s.op)}case"case-expression":if(s.format==="simple"){const i=U(this._evaluateNode(s.operand,o,f));for(let d=0;d=U(d[0])&&i<=U(d[1])}case"NOTBETWEEN":{const i=this._evaluateNode(s.left,o,f),d=this._evaluateNode(s.right,o,f);return i==null||d[0]==null||d[1]==null?null:iU(d[1])}case"LIKE":return Pt(this._evaluateNode(s.left,o,f),this._evaluateNode(s.right,o,f),s.escape);case"NOT LIKE":return ft(Pt(this._evaluateNode(s.left,o,f),this._evaluateNode(s.right,o,f),s.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return Be(s.operator,this._evaluateNode(s.left,o,f),this._evaluateNode(s.right,o,f));case"-":case"+":case"*":case"/":case"||":return je(s.operator,this._evaluateNode(s.left,o,f),this._evaluateNode(s.right,o,f))}case"null":case"boolean":case"string":case"number":return s.value;case"date":return Le(s.value);case"timestamp":return Et(s.value);case"current-time":{const i=new Date;return s.mode==="date"&&i.setHours(0,0,0,0),i}case"column-reference":return ze(o,s.column,this._datefields,f);case"data-type":return s.value;case"function":{const i=this._evaluateNode(s.args,o,f);return this.isAggregate?Mo(s.name,i):_t(s.name,i)}}throw new Error("Unsupported sql syntax "+s.type)}}function Et(l){let s=Ho.exec(l);if(s!==null){const[,o,f,i,d,m,e]=s;return Z(o,f,i,d,m,e)}if(s=Bo.exec(l),s!==null){const[,o,f,i,d,m,e,N,b,_]=s;return Z(o,f,i,d,m,e,N,b,_)}if(s=jo.exec(l),s!==null){const[,o,f,i,d,m,e,N,b]=s;return Z(o,f,i,d,m,"0",e,N,b)}if(s=zo.exec(l),s!==null){const[,o,f,i,d,m]=s;return Z(o,f,i,d,m)}if(s=ke.exec(l),s!==null){const[,o,f,i]=s;return Z(o,f,i)}throw new Error("SQL Invalid Timestamp")}function Le(l){const s=ke.exec(l);if(s===null)try{return Et(l)}catch{throw new Error("SQL Invalid Date")}const[,o,f,i]=s;return new Date(parseInt(o,10),parseInt(f,10)-1,parseInt(i,10))}function qe(l){return l===!0}function Ct(l){return Array.isArray(l)?l:[l]}function ft(l){return l!==null?l!==!0:null}function Ve(l,s){return l!=null&&s!=null?l===!0&&s===!0:l!==!1&&s!==!1&&null}function He(l,s){return l!=null&&s!=null?l===!0||s===!0:l===!0||s===!0||null}function Ft(l,s){if(l==null)return null;let o=!1;for(const f of s)if(f==null)o=null;else if(l===f){o=!0;break}return o}const Me="-[]/{}()*+?.\\^$|";var G;function Yo(l,s){const o=s;let f="",i=G.Normal;for(let d=0;d":return f!==i;case"=":return f===i;case">":return f>i;case"<":return f=":return f>=i;case"<=":return f<=i}}function je(l,s,o){if(l==="||")return _t("concat",[s,o]);if(s instanceof k)if(o instanceof Date)switch(l){case"+":return new Date(s.valueInMilliseconds()+o.getTime());case"-":return s.valueInMilliseconds()-o.getTime();case"*":return s.valueInMilliseconds()*o.getTime();case"/":return s.valueInMilliseconds()/o.getTime()}else if(o instanceof k)switch(l){case"+":return k.createFromMilliseconds(s.valueInMilliseconds()+o.valueInMilliseconds());case"-":return k.createFromMilliseconds(s.valueInMilliseconds()-o.valueInMilliseconds());case"*":return s.valueInMilliseconds()*o.valueInMilliseconds();case"/":return s.valueInMilliseconds()/o.valueInMilliseconds()}else s=s.valueInMilliseconds();else if(o instanceof k)if(s instanceof Date)switch(l){case"+":return new Date(o.valueInMilliseconds()+s.getTime());case"-":return new Date(s.getTime()-o.valueInMilliseconds());case"*":return s.getTime()*o.valueInMilliseconds();case"/":return s.getTime()/o.valueInMilliseconds()}else o=o.valueInMilliseconds();else if(s instanceof Date&&typeof o=="number")switch(o=24*o*60*60*1e3,s=s.getTime(),l){case"+":return new Date(s+o);case"-":return new Date(s-o);case"*":return new Date(s*o);case"/":return new Date(s/o)}else if(o instanceof Date&&typeof s=="number")switch(s=24*s*60*60*1e3,o=o.getTime(),l){case"+":return new Date(s+o);case"-":return new Date(s-o);case"*":return new Date(s*o);case"/":return new Date(s/o)}switch(l){case"+":return s+o;case"-":return s-o;case"*":return s*o;case"/":return s/o}}function Ko(l){return l&&typeof l.attributes=="object"}function ze(l,s,o,f){const i=f.getAttribute(l,s);return i!=null&&o[s]===1?new Date(i):i}(function(l){l[l.Normal=0]="Normal",l[l.Escaped=1]="Escaped"})(G||(G={}));const z={getAttribute:(l,s)=>(Ko(l)?l.attributes:l)[s]},ei=Object.freeze(Object.defineProperty({__proto__:null,WhereClause:Lt,defaultAttributeAdapter:z},Symbol.toStringTag,{value:"Module"}));export{ei as W,Lt as f,M as n,Xo as o,j as s,C as t}; diff --git a/assets/WorkerTileHandler-fcaca023.js b/assets/WorkerTileHandler-fcaca023.js new file mode 100644 index 0000000..a39fc0e --- /dev/null +++ b/assets/WorkerTileHandler-fcaca023.js @@ -0,0 +1,2 @@ +import{ri as ie,rj as Ve,rk as k,rl as _e,rm as ke,oA as ve,rn as Se,by as Ce,ro as be,fI as Ye,rp as Ze,rq as Pe,rg as ee,aP as Je,bn as He,rr as oe}from"./index-080e108a.js";import{h as A,t as Qe,e as Xe,_ as et}from"./TileClipper-ae6eca9e.js";import{e as Be,t as le,n as se,f as Ee,i as Ke,r as Re,a as E,T as tt,m as st,N as Y,h as ge,l as it}from"./StyleRepository-2362164f.js";import{t as Oe}from"./Rect-98da58d6.js";import{n as rt}from"./pbf-d9aa3914.js";import{r as nt,c as at,i as ot}from"./TurboLine-aac2edf4.js";import{C as lt}from"./BidiEngine-9a40f2f4.js";import"./colorUtils-c0f43caf.js";import"./definitions-0bc08d4c.js";function ht(u){return u===746||u===747||!(u<4352)&&(u>=12704&&u<=12735||u>=12544&&u<=12591||u>=65072&&u<=65103&&!(u>=65097&&u<=65103)||u>=63744&&u<=64255||u>=13056&&u<=13311||u>=11904&&u<=12031||u>=12736&&u<=12783||u>=12288&&u<=12351&&!(u>=12296&&u<=12305||u>=12308&&u<=12319||u===12336)||u>=13312&&u<=19903||u>=19968&&u<=40959||u>=12800&&u<=13055||u>=12592&&u<=12687||u>=43360&&u<=43391||u>=55216&&u<=55295||u>=4352&&u<=4607||u>=44032&&u<=55215||u>=12352&&u<=12447||u>=12272&&u<=12287||u>=12688&&u<=12703||u>=12032&&u<=12255||u>=12784&&u<=12799||u>=12448&&u<=12543&&u!==12540||u>=65280&&u<=65519&&!(u===65288||u===65289||u===65293||u>=65306&&u<=65310||u===65339||u===65341||u===65343||u>=65371&&u<=65503||u===65507||u>=65512&&u<=65519)||u>=65104&&u<=65135&&!(u>=65112&&u<=65118||u>=65123&&u<=65126)||u>=5120&&u<=5759||u>=6320&&u<=6399||u>=65040&&u<=65055||u>=19904&&u<=19967||u>=40960&&u<=42127||u>=42128&&u<=42191)}function ct(u){return!(u<11904)&&(u>=12704&&u<=12735||u>=12544&&u<=12591||u>=65072&&u<=65103||u>=63744&&u<=64255||u>=13056&&u<=13311||u>=11904&&u<=12031||u>=12736&&u<=12783||u>=12288&&u<=12351||u>=13312&&u<=19903||u>=19968&&u<=40959||u>=12800&&u<=13055||u>=65280&&u<=65519||u>=12352&&u<=12447||u>=12272&&u<=12287||u>=12032&&u<=12255||u>=12784&&u<=12799||u>=12448&&u<=12543||u>=65040&&u<=65055||u>=42128&&u<=42191||u>=40960&&u<=42127)}function ut(u){switch(u){case 10:case 32:case 38:case 40:case 41:case 43:case 45:case 47:case 173:case 183:case 8203:case 8208:case 8211:case 8231:return!0}return!1}function Fe(u){switch(u){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}const K=24,We=17;let je=class{constructor(e,t,i,s,r,n,a){this._glyphItems=e,this._maxWidth=t,this._lineHeight=i,this._letterSpacing=s,this._hAnchor=r,this._vAnchor=n,this._justify=a}getShaping(e,t,i){const s=this._letterSpacing,r=this._lineHeight,n=this._justify,a=this._maxWidth,o=[];let c=0,h=0;for(const g of e){const I=g.codePointAt(0);if(I==null)continue;const b=i&&ht(I);let _;for(const M of this._glyphItems)if(_=M[I],_)break;o.push({codePoint:I,x:c,y:h,vertical:b,glyphMosaicItem:_}),_&&(c+=_.metrics.advance+s)}let f=c;a>0&&(f=c/Math.max(1,Math.ceil(c/a)));const l=e.includes("​"),d=[],x=o.length;for(let g=0;gb&&Fe(o[_].codePoint);)o[_].glyphMosaicItem=null,--_;if(b<=_){const M=o[b].x;for(let T=b;T<=_;T++)o[T].x-=M,o[T].y=h;let B=o[_].x;o[_].glyphMosaicItem&&(B+=o[_].glyphMosaicItem.metrics.advance),w=Math.max(B,w),n&&this._applyJustification(o,b,_)}m=I,h+=y}if(o.length>0){const g=p.length-1,I=(n-this._hAnchor)*w;let b=(-this._vAnchor*(g+1)+.5)*r;t&&g&&(b+=g*r);for(const _ of o)_.x+=I,_.y+=b}return o.filter(g=>g.glyphMosaicItem)}static getTextBox(e,t){if(!e.length)return null;let i=1/0,s=1/0,r=0,n=0;for(const a of e){const o=a.glyphMosaicItem.metrics.advance,c=a.x,h=a.y-We,f=c+o,l=h+t;i=Math.min(i,c),r=Math.max(r,f),s=Math.min(s,h),n=Math.max(n,l)}return{x:i,y:s,width:r-i,height:n-s}}static getBox(e){if(!e.length)return null;let t=1/0,i=1/0,s=0,r=0;for(const n of e){const{height:a,left:o,top:c,width:h}=n.glyphMosaicItem.metrics,f=n.x,l=n.y-(a-Math.abs(c)),d=f+h+o,x=l+a;t=Math.min(t,f),s=Math.max(s,d),i=Math.min(i,l),r=Math.max(r,x)}return{x:t,y:i,width:s-t,height:r-i}}static addDecoration(e,t){const i=e.length;if(i===0)return;const s=3;let r=e[0].x+e[0].glyphMosaicItem.metrics.left,n=e[0].y;for(let o=1;o=0&&a,d=s.allowOverlap&&s.ignorePlacement?null:[],x=[],p=4,w=!l;let y=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=y,I=m;const b=(l||a)&&o,_=s.size/K;let M=!1;for(const P of t)if(P.vertical){M=!0;break}let B,T=0,D=0;if(!l&&M){const P=je.getTextBox(t,s.lineHeight*K);switch(s.anchor){case k.LEFT:T=P.height/2,D=-P.width/2;break;case k.RIGHT:T=-P.height/2,D=P.width/2;break;case k.TOP:T=P.height/2,D=P.width/2;break;case k.BOTTOM:T=-P.height/2,D=-P.width/2;break;case k.TOP_LEFT:T=P.height;break;case k.BOTTOM_LEFT:D=-P.width;break;case k.TOP_RIGHT:D=P.width;break;case k.BOTTOM_RIGHT:T=-P.height}}T+=s.offset[0]*K,D+=s.offset[1]*K;for(const P of t){const S=P.glyphMosaicItem;if(!S||S.rect.isEmpty)continue;const V=S.rect,v=S.metrics,R=S.page;if(d&&w){if(B!==void 0&&B!==P.y){let C,F,N,z;M?(C=-I+T,F=y+D,N=I-g,z=m-y):(C=y+T,F=g+D,N=m-y,z=I-g);const G={xTile:e.x,yTile:e.y,dxPixels:C*_-c,dyPixels:F*_-c,hard:!s.optional,partIndex:1,width:N*_+2*c,height:z*_+2*c,angle:n,minLod:X,maxLod:se};d.push(G),y=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=y,I=m}B=P.y}const Z=[];if(l){const C=.5*S.metrics.width,F=(P.x+v.left-p+C)*_*he;if(h=this._placeGlyph(e,h,F,i,e.segment,1,P.vertical,R,Z),o&&(h=this._placeGlyph(e,h,F,i,e.segment,-1,P.vertical,R,Z)),h>=Te)break}else Z.push(new me(r,f,f,R,!1)),a&&o&&Z.push(new me(r,f+le,f+le,R,!1));const $=P.x+v.left,j=P.y-We-v.top,J=$+v.width,we=j+v.height;let O,H,ce,ue,Q,fe,Ae,Le;if(!l&&M)if(P.vertical){const C=($+J)/2-v.height/2,F=(j+we)/2+v.width/2;O=new A(-F-p+T,C-p+D),H=new A(O.x+V.width,O.y+V.height),ce=new A(O.x,H.y),ue=new A(H.x,O.y)}else O=new A(-j+p+T,$-p+D),H=new A(O.x-V.height,O.y+V.width),ce=new A(H.x,O.y),ue=new A(O.x,H.y);else O=new A($-p+T,j-p+D),H=new A(O.x+V.width,O.y+V.height),ce=new A(O.x,H.y),ue=new A(H.x,O.y);for(const C of Z){let F,N,z,G;if(C.alternateVerticalGlyph){if(!Q){const q=(j+we)/2+D;Q=new A(($+J)/2+T-v.height/2-p,q+v.width/2+p),fe=new A(Q.x+V.height,Q.y-V.width),Ae=new A(fe.x,Q.y),Le=new A(Q.x,fe.y)}F=Q,N=Ae,z=Le,G=fe}else F=O,N=ce,z=ue,G=H;const de=j,Me=we,ye=C.glyphAngle+n;if(ye!==0){const q=Math.cos(ye),xe=Math.sin(ye);F=F.clone(),N=N==null?void 0:N.clone(),z=z==null?void 0:z.clone(),G=G==null?void 0:G.clone(),F.rotate(q,xe),G==null||G.rotate(q,xe),N==null||N.rotate(q,xe),z==null||z.rotate(q,xe)}let ne=0,ae=256;if(l&&M?P.vertical?C.alternateVerticalGlyph?(ne=32,ae=96):(ne=224,ae=32):(ne=224,ae=96):(ne=192,ae=64),x.push(new ze(F,z,N,G,V,C.labelAngle,ne,ae,C.anchor,C.minzoom,C.maxzoom,C.page)),d&&(!b||this._legible(C.labelAngle))){if(w)$m&&(m=J),Me>I&&(I=Me);else if(C.minzoom=Te)return null;if(d&&w){let P,S,V,v;M?(P=-I+T,S=y+D,V=I-g,v=m-y):(P=y+T,S=g+D,V=m-y,v=I-g);const R={xTile:e.x,yTile:e.y,dxPixels:P*_-c,dyPixels:S*_-c,hard:!s.optional,partIndex:1,width:V*_+2*c,height:v*_+2*c,angle:n,minLod:X,maxLod:se};d.push(R)}const L=new Ue(x);return d&&d.length>0&&(L.textColliders=d),L}_legible(e){const t=Ke(e);return t<65||t>=193}_placeGlyph(e,t,i,s,r,n,a,o,c){let h=n;const f=h<0?Ee(e.angle+le,Re):e.angle;let l=0;i<0&&(h*=-1,i*=-1,l=le),h>0&&++r;let d=new A(e.x,e.y),x=s[r],p=se;if(s.length<=r)return p;for(;;){const w=x.x-d.x,y=x.y-d.y,m=Math.sqrt(w*w+y*y),g=Math.max(i/m,t),I=w/m,b=y/m,_=Ee(Math.atan2(b,I)+l,Re);if(c.push(new me(d,f,_,o,!1,g,p)),a&&c.push(new me(d,f,_,o,!0,g,p)),g<=t)return g;d=x.clone();do{if(r+=h,s.length<=r||r<0)return g;x=s[r]}while(d.isEqual(x));let M=x.x-d.x,B=x.y-d.y;const T=Math.sqrt(M*M+B*B);M*=m/T,B*=m/T,d.x-=M,d.y-=B,p=g}}};var re;(function(u){u[u.moveTo=1]="moveTo",u[u.lineTo=2]="lineTo",u[u.close=7]="close"})(re||(re={}));let dt=class{constructor(e,t){this.values={},this._geometry=void 0,this._pbfGeometry=null;const i=t.keys,s=t.values,r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:this.id=r.getUInt64();break;case 2:{const n=r.getMessage().asUnsafe(),a=this.values;for(;!n.empty();){const o=n.getUInt32(),c=n.getUInt32();a[i[o]]=s[c]}n.release();break}case 3:this.type=r.getUInt32();break;case 4:this._pbfGeometry=r.getMessage();break;default:r.skip()}}getGeometry(e){if(this._geometry!==void 0)return this._geometry;if(!this._pbfGeometry)return null;const t=this._pbfGeometry.asUnsafe();let i,s;this._pbfGeometry=null,e?e.reset(this.type):i=[];let r,n=re.moveTo,a=0,o=0,c=0;for(;!t.empty();){if(a===0){const h=t.getUInt32();n=7&h,a=h>>3}switch(a--,n){case re.moveTo:o+=t.getSInt32(),c+=t.getSInt32(),e?e.moveTo(o,c):i&&(s&&i.push(s),s=[],s.push(new A(o,c)));break;case re.lineTo:o+=t.getSInt32(),c+=t.getSInt32(),e?e.lineTo(o,c):s&&s.push(new A(o,c));break;case re.close:e?e.close():s&&!s[0].equals(o,c)&&s.push(s[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?r=e.result():i&&(s&&i.push(s),r=i),t.release(),this._geometry=r,r}},te=class extends E{constructor(){super(12)}add(e,t,i){const s=this.array;s.push(e),s.push(t),s.push(i)}};class De{constructor(e){this.extent=4096,this.keys=[],this.values=[],this._pbfLayer=e.clone();const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:this.name=t.getString();break;case 3:this.keys.push(t.getString());break;case 4:this.values.push(t.processMessage(De._parseValue));break;case 5:this.extent=t.getUInt32();break;default:t.skip()}}getData(){return this._pbfLayer}static _parseValue(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}}let yt=class extends E{constructor(e){super(e)}add(e,t,i,s,r,n,a,o,c,h,f,l){const d=this.array;let x=E.i1616to32(e,t);d.push(x);const p=31;x=E.i8888to32(Math.round(p*i),Math.round(p*s),Math.round(p*r),Math.round(p*n)),d.push(x),x=E.i8888to32(Math.round(p*a),Math.round(p*o),Math.round(p*c),Math.round(p*h)),d.push(x),x=E.i1616to32(f,0),d.push(x),l&&d.push(...l)}},xt=class extends E{constructor(e){super(e)}add(e,t,i){const s=this.array;s.push(E.i1616to32(e,t)),i&&s.push(...i)}};class gt extends E{constructor(e){super(e)}add(e,t,i,s,r,n,a){const o=this.array,c=this.index;let h=E.i1616to32(e,t);o.push(h);const f=15;return h=E.i8888to32(Math.round(f*i),Math.round(f*s),r,n),o.push(h),a&&o.push(...a),c}}class Ge extends E{constructor(e){super(e)}add(e,t,i,s,r,n,a,o,c,h,f,l){const d=this.array;let x=E.i1616to32(e,t);d.push(x),x=E.i1616to32(Math.round(8*i),Math.round(8*s)),d.push(x),x=E.i8888to32(r/4,n/4,o,c),d.push(x),x=E.i8888to32(0,Ke(a),10*h,Math.min(10*f,255)),d.push(x),l&&d.push(...l)}}class pt extends E{constructor(e){super(e)}add(e,t,i,s,r){const n=this.array,a=E.i1616to32(2*e+i,2*t+s);n.push(a),r&&n.push(...r)}}class Ie{constructor(e,t,i){this.layerExtent=4096,this._features=[],this.layer=e,this.zoom=t,this._spriteInfo=i,this._filter=e.getFeatureFilter()}pushFeature(e){this._filter&&!this._filter.filter(e,this.zoom)||this._features.push(e)}hasFeatures(){return this._features.length>0}getResources(e,t,i){}}let mt=class extends Ie{constructor(e,t,i,s,r){super(e,t,i),this.type=_e.CIRCLE,this._circleVertexBuffer=s,this._circleIndexBuffer=r}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(e){const t=this._circleVertexBuffer,i=this._circleIndexBuffer;this._circleIndexStart=3*i.index,this._circleIndexCount=0;const s=this.layer,r=this.zoom;e&&e.setExtent(this.layerExtent);for(const n of this._features){const a=n.getGeometry(e);if(!a)continue;const o=s.circleMaterial.encodeAttributes(n,r,s);for(const c of a)if(c)for(const h of c){const f=t.index;t.add(h.x,h.y,0,0,o),t.add(h.x,h.y,0,1,o),t.add(h.x,h.y,1,0,o),t.add(h.x,h.y,1,1,o),i.add(f,f+1,f+2),i.add(f+1,f+2,f+3),this._circleIndexCount+=6}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this._circleVertexBuffer.array.length,e+=this._circleIndexBuffer.array.length;const t=new Uint32Array(e),i=new Int32Array(t.buffer);let s=0;t[s++]=this.type,t[s++]=this.layerUIDs.length;for(let r=0;rI.page-b.page);for(const{ddFillAttributes:I,ddOutlineAttributes:b,page:_,geometry:M}of d)this._processFeature(M,h,t.outlineUsesFillColor,I,b,l,_)}}else for(const d of f){const x=n?s.encodeAttributes(d,i,t):null,p=h&&a?r.encodeAttributes(d,i,t):null,w=d.getGeometry(e);this._processFeature(w,h,t.outlineUsesFillColor,x,p,l)}}serialize(){let e=10;e+=this.layerUIDs.length,e+=this._fillVertexBuffer.array.length,e+=this._fillIndexBuffer.array.length,e+=this._outlineVertexBuffer.array.length,e+=this._outlineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),i=new Int32Array(t.buffer);let s=0;t[s++]=this.type,t[s++]=this.layerUIDs.length;for(let a=0;a0)for(const[a,[o,c]]of r)t[s++]=a,t[s++]=o,t[s++]=c;t[s++]=this._fillVertexBuffer.array.length;for(let a=0;ah?(f!==void 0&&this._processFill(e,f,s,n,a),f=[l]):d<-h&&f!==void 0&&f.push(l)}f!==void 0&&this._processFill(e,f,s,n,a)}_processOutline(e,t){const i=this._outlineVertexBuffer,s=this._outlineIndexBuffer,r=s.index;let n,a,o;const c=new A(0,0),h=new A(0,0),f=new A(0,0);let l=-1,d=-1,x=-1,p=-1,w=-1,y=!1;const m=0;let g=e.length;if(g<2)return;const I=e[m];let b=e[g-1];for(;g&&b.isEqual(I);)--g,b=e[g-1];if(!(g-m<2)){for(let _=m;_8&&(D=8),B>=0?(x=i.add(a.x,a.y,c.x,c.y,0,1,t),p===-1&&(p=x),l>=0&&d>=0&&x>=0&&!M&&s.add(l,d,x),d=i.add(a.x,a.y,D*-f.x,D*-f.y,0,-1,t),w===-1&&(w=d),l>=0&&d>=0&&x>=0&&!M&&s.add(l,d,x),l=d,d=x,x=i.add(a.x,a.y,f.x,f.y,0,1,t),l>=0&&d>=0&&x>=0&&!M&&s.add(l,d,x),d=i.add(a.x,a.y,h.x,h.y,0,1,t),l>=0&&d>=0&&x>=0&&!M&&s.add(l,d,x)):(x=i.add(a.x,a.y,D*f.x,D*f.y,0,1,t),p===-1&&(p=x),l>=0&&d>=0&&x>=0&&!M&&s.add(l,d,x),d=i.add(a.x,a.y,-c.x,-c.y,0,-1,t),w===-1&&(w=d),l>=0&&d>=0&&x>=0&&!M&&s.add(l,d,x),l=d,d=x,x=i.add(a.x,a.y,-f.x,-f.y,0,-1,t),l>=0&&d>=0&&x>=0&&!M&&s.add(l,d,x),l=i.add(a.x,a.y,-h.x,-h.y,0,-1,t),l>=0&&d>=0&&x>=0&&!M&&s.add(l,d,x))}l>=0&&d>=0&&p>=0&&!y&&s.add(l,d,p),l>=0&&p>=0&&w>=0&&!y&&s.add(l,w,p),this._outlineIndexCount+=3*(s.index-r)}}_processFill(e,t,i,s,r){s=!0;let n;t.length>1&&(n=[]);let a=0;for(const f of t)a!==0&&n.push(a),a+=e[f].length;const o=2*a,c=ke.acquire();for(const f of t){const l=e[f],d=l.length;for(let x=0;x0){const f=t.map(x=>e[x].length),{buffer:l,vertexCount:d}=nt(c,f);if(d>0){const x=this._fillVertexBuffer.index;for(let p=0;p0){const l=this._fillVertexBuffer.index;let d=0;for(;d=4160:e.y===t.y&&(e.y<=-64||e.y>=4160)}static _area(e){let t=0;const i=e.length-1;for(let s=0;sP.page-S.page),r.textured=!0;for(const{ddAttributes:P,page:S,cap:V,join:v,miterLimit:R,roundLimit:Z,halfWidth:$,offset:j,geometry:J}of L)r.capType=V,r.joinType=v,r.miterLimit=R,r.roundLimit=Z,r.halfWidth=$,r.offset=j,this._processFeature(J,P,S)}else{if(o){const L=o.getValue(i),P=this._spriteInfo[L];if(!P||!P.rect)return}r.textured=!(!o&&!c),r.capType=x,r.joinType=m,r.miterLimit=I,r.roundLimit=_,r.halfWidth=.5*B,r.offset=D;for(const L of s){const P=n?a.encodeAttributes(L,i,t):null;d&&(r.capType=d.getValue(i,L)),y&&(r.joinType=y.getValue(i,L)),g&&(r.miterLimit=g.getValue(i,L)),b&&(r.roundLimit=b.getValue(i,L)),M&&(r.halfWidth=.5*M.getValue(i,L)),T&&(r.offset=T.getValue(i,L));const S=L.getGeometry(e);this._processFeature(S,P)}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this.tessellationProperties._lineVertexBuffer.array.length,e+=this.tessellationProperties._lineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),i=new Int32Array(t.buffer);let s=0;t[s++]=this.type,t[s++]=this.layerUIDs.length;for(let a=0;a0)for(const[a,[o,c]]of r)t[s++]=a,t[s++]=o,t[s++]=c;t[s++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let a=0;a(e,t,i,s,r,n,a,o,c,h,f)=>(u._lineVertexBuffer.add(e,t,a,o,i,s,r,n,c,h,f,u._ddValues),u._lineVertexBuffer.index-1),bt=u=>(e,t,i)=>{u._lineIndexBuffer.add(e,t,i)},$e=10;function Pt(u,e){return u.iconMosaicItem&&e.iconMosaicItem?u.iconMosaicItem.page===e.iconMosaicItem.page?0:u.iconMosaicItem.page-e.iconMosaicItem.page:u.iconMosaicItem&&!e.iconMosaicItem?1:!u.iconMosaicItem&&e.iconMosaicItem?-1:0}class U extends Ie{constructor(e,t,i,s,r,n,a,o){super(e,t,o.getSpriteItems()),this.type=_e.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._iconVertexBuffer=i,this._iconIndexBuffer=s,this._textVertexBuffer=r,this._textIndexBuffer=n,this._placementEngine=a,this._workerTileHandler=o}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}getResources(e,t,i){const s=this.layer,r=this.zoom;e&&e.setExtent(this.layerExtent);const n=s.getLayoutProperty("icon-image"),a=s.getLayoutProperty("text-field");let o=s.getLayoutProperty("text-transform"),c=s.getLayoutProperty("text-font");const h=[];let f,l,d,x;n&&!n.isDataDriven&&(f=n.getValue(r)),a&&!a.isDataDriven&&(l=a.getValue(r)),o&&o.isDataDriven||(d=s.getLayoutValue("text-transform",r),o=null),c&&c.isDataDriven||(x=s.getLayoutValue("text-font",r),c=null);for(const p of this._features){const w=p.getGeometry(e);if(!w||w.length===0)continue;let y,m;n&&(y=n.isDataDriven?n.getValue(r,p):this._replaceKeys(f,p.values),y&&t(y));let g=!1;if(a&&(m=a.isDataDriven?a.getValue(r,p):this._replaceKeys(l,p.values),m)){switch(m=m.replaceAll("\\n",` +`),o&&(d=o.getValue(r,p)),d){case Se.LOWERCASE:m=m.toLowerCase();break;case Se.UPPERCASE:m=m.toUpperCase()}if(U._bidiEngine.hasBidiChar(m)){let _;_=U._bidiEngine.checkContextual(m)==="rtl"?"IDNNN":"ICNNN",m=U._bidiEngine.bidiTransform(m,_,"VLYSN"),g=!0}if(m.length>0){c&&(x=c.getValue(r,p));for(const _ of x){let M=i[_];M||(M=i[_]=new Set);for(const B of m){const T=B.codePointAt(0);T!=null&&M.add(T)}}}}if(!y&&!m)continue;const I=s.getLayoutValue("symbol-sort-key",r,p),b={feature:p,sprite:y,label:m,rtl:g,geometry:w,hash:(m?Ce(m):0)^(y?Ce(y):0),priority:I,textFont:x};h.push(b)}this._symbolFeatures=h}processFeatures(e){e&&e.setExtent(this.layerExtent);const t=this.layer,i=this.zoom,s=t.getLayoutValue("symbol-placement",i),r=s!==be.POINT,n=t.getLayoutValue("symbol-spacing",i)*he,a=t.getLayoutProperty("icon-image"),o=t.getLayoutProperty("text-field"),c=a?new tt(t,i,r):null,h=o?new st(t,i,r):null,f=this._workerTileHandler;let l;a&&(l=f.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const d=[];let x=1;h&&h.size&&(x=h.size/K);const p=h?h.maxAngle*Be:0,w=h?h.size*he:0;for(const y of this._symbolFeatures){let m;c&&l&&y.sprite&&(m=l[y.sprite],m&&m.sdf&&(this._isIconSDF=!0));let g;m&&c.update(i,y.feature);let I=0;const b=y.label;if(b){Ye(h),h.update(i,y.feature);const _=r&&h.rotationAlignment===ie.MAP?h.keepUpright:h.writingMode&&h.writingMode.includes(Ze.VERTICAL);let M=.5;switch(h.anchor){case k.TOP_LEFT:case k.LEFT:case k.BOTTOM_LEFT:M=0;break;case k.TOP_RIGHT:case k.RIGHT:case k.BOTTOM_RIGHT:M=1}let B=.5;switch(h.anchor){case k.TOP_LEFT:case k.TOP:case k.TOP_RIGHT:B=0;break;case k.BOTTOM_LEFT:case k.BOTTOM:case k.BOTTOM_RIGHT:B=1}let T=.5;switch(h.justify){case Pe.AUTO:T=M;break;case Pe.LEFT:T=0;break;case Pe.RIGHT:T=1}const D=h.letterSpacing*K,L=r?0:h.maxWidth*K,P=h.lineHeight*K,S=y.textFont.map(V=>f.getGlyphItems(V));if(g=new je(S,L,P,D,M,B,T).getShaping(b,y.rtl,_),g&&g.length>0){let V=1e30,v=-1e30;for(const R of g)V=Math.min(V,R.x),v=Math.max(v,R.x);I=(v-V+2*K)*x*he}}for(let _ of y.geometry){const M=[];if(s===be.LINE){if(g!=null&&g.length&&(h!=null&&h.size)){const B=h.size*he*(2+Math.min(2,4*Math.abs(h.offset[1])));_=U._smoothVertices(_,B)}U._pushAnchors(M,_,n,I)}else s===be.LINE_CENTER?U._pushCenterAnchor(M,_):y.feature.type===Qe.Polygon?U._pushCentroid(M,_):M.push(new pe(_[0].x,_[0].y));for(const B of M){if(B.x<0||B.x>Ne||B.y<0||B.y>Ne||r&&I>0&&(h==null?void 0:h.rotationAlignment)===ie.MAP&&!U._honorsTextMaxAngle(_,B,I,p,w))continue;const T={shaping:g,line:_,iconMosaicItem:m,anchor:B,symbolFeature:y,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};d.push(T),this._processFeature(T,c,h)}}}d.sort(Pt),this._addPlacedGlyphs(),this._symbolInstances=d}serialize(){let e=11;e+=this.layerUIDs.length,e+=3*this.markerPageMap.size,e+=3*this.glyphsPageMap.size,e+=U._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;const t=new Uint32Array(e),i=new Int32Array(t.buffer),s=new Float32Array(t.buffer);let r=0;t[r++]=this.type,t[r++]=this.layerUIDs.length;for(let n=0;ns in t?t[s]:"")}_processFeature(e,t,i){const{line:s,iconMosaicItem:r,shaping:n,anchor:a}=e,o=this.zoom,c=this.layer,h=!!r;let f=!0;h&&(f=(t==null?void 0:t.optional)||!r);const l=n&&n.length>0,d=!l||(i==null?void 0:i.optional);let x,p;if(h&&(x=this._placementEngine.getIconPlacement(a,r,t)),(x||f)&&(l&&(p=this._placementEngine.getTextPlacement(a,n,s,i)),p||d)){if(x&&p||(d||f?d||p?f||x||(p=null):x=null:(x=null,p=null)),p){const w=c.hasDataDrivenText?c.textMaterial.encodeAttributes(e.symbolFeature.feature,o,c):null;if(this._storePlacedGlyphs(e,p.shapes,o,i.rotationAlignment,w),p.textColliders){e.textColliders=p.textColliders;for(const y of p.textColliders){y.minLod=Math.max(o+Y(y.minLod),0),y.maxLod=Math.min(o+Y(y.maxLod),25);const m=y.angle;if(m){const g=Math.cos(m),I=Math.sin(m),b=y.dxPixels*g-y.dyPixels*I,_=y.dxPixels*I+y.dyPixels*g,M=(y.dxPixels+y.width)*g-y.dyPixels*I,B=(y.dxPixels+y.width)*I+y.dyPixels*g,T=y.dxPixels*g-(y.dyPixels+y.height)*I,D=y.dxPixels*I+(y.dyPixels+y.height)*g,L=(y.dxPixels+y.width)*g-(y.dyPixels+y.height)*I,P=(y.dxPixels+y.width)*I+(y.dyPixels+y.height)*g,S=Math.min(b,M,T,L),V=Math.max(b,M,T,L),v=Math.min(_,B,D,P),R=Math.max(_,B,D,P);y.dxPixels=S,y.dyPixels=v,y.width=V-S,y.height=R-v}}}}if(x){const w=c.hasDataDrivenIcon?c.iconMaterial.encodeAttributes(e.symbolFeature.feature,o,c):null;if(this._addPlacedIcons(e,x.shapes,o,r.page,t.rotationAlignment===ie.VIEWPORT,w),x.iconColliders){e.iconColliders=x.iconColliders;for(const y of x.iconColliders){y.minLod=Math.max(o+Y(y.minLod),0),y.maxLod=Math.min(o+Y(y.maxLod),25);const m=y.angle;if(m){const g=Math.cos(m),I=Math.sin(m),b=y.dxPixels*g-y.dyPixels*I,_=y.dxPixels*I+y.dyPixels*g,M=(y.dxPixels+y.width)*g-y.dyPixels*I,B=(y.dxPixels+y.width)*I+y.dyPixels*g,T=y.dxPixels*g-(y.dyPixels+y.height)*I,D=y.dxPixels*I+(y.dyPixels+y.height)*g,L=(y.dxPixels+y.width)*g-(y.dyPixels+y.height)*I,P=(y.dxPixels+y.width)*I+(y.dyPixels+y.height)*g,S=Math.min(b,M,T,L),V=Math.max(b,M,T,L),v=Math.min(_,B,D,P),R=Math.max(_,B,D,P);y.dxPixels=S,y.dyPixels=v,y.width=V-S,y.height=R-v}}}}}}_addPlacedIcons(e,t,i,s,r,n){const a=Math.max(i-1,0),o=this._iconVertexBuffer,c=this._iconIndexBuffer,h=this._markerMap;for(const f of t){const l=r?0:Math.max(i+Y(f.minzoom),a),d=r?25:Math.min(i+Y(f.maxzoom),25);if(d<=l)continue;const x=f.tl,p=f.tr,w=f.bl,y=f.br,m=f.mosaicRect,g=f.labelAngle,I=f.minAngle,b=f.maxAngle,_=f.anchor,M=o.index,B=m.x,T=m.y,D=B+m.width,L=T+m.height,P=o.index;o.add(_.x,_.y,x.x,x.y,B,T,g,I,b,l,d,n),o.add(_.x,_.y,p.x,p.y,D,T,g,I,b,l,d,n),o.add(_.x,_.y,w.x,w.y,B,L,g,I,b,l,d,n),o.add(_.x,_.y,y.x,y.y,D,L,g,I,b,l,d,n),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===P?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([P,4]),c.add(M,M+1,M+2),c.add(M+1,M+2,M+3),h.has(s)?h.get(s)[1]+=6:h.set(s,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const e=this._textVertexBuffer,t=this._textIndexBuffer,i=this._glyphMap;for(const[s,r]of this._glyphBufferDataStorage)for(const n of r){const a=e.index,o=n.symbolInstance,c=n.ddAttributes,h=e.index;e.add(n.glyphAnchor[0],n.glyphAnchor[1],n.tl[0],n.tl[1],n.xmin,n.ymin,n.labelAngle,n.minAngle,n.maxAngle,n.minLod,n.maxLod,c),e.add(n.glyphAnchor[0],n.glyphAnchor[1],n.tr[0],n.tr[1],n.xmax,n.ymin,n.labelAngle,n.minAngle,n.maxAngle,n.minLod,n.maxLod,c),e.add(n.glyphAnchor[0],n.glyphAnchor[1],n.bl[0],n.bl[1],n.xmin,n.ymax,n.labelAngle,n.minAngle,n.maxAngle,n.minLod,n.maxLod,c),e.add(n.glyphAnchor[0],n.glyphAnchor[1],n.br[0],n.br[1],n.xmax,n.ymax,n.labelAngle,n.minAngle,n.maxAngle,n.minLod,n.maxLod,c),o.textVertexRanges.length>0&&o.textVertexRanges[0][0]+o.textVertexRanges[0][1]===h?o.textVertexRanges[0][1]+=4:o.textVertexRanges.push([h,4]),t.add(a,a+1,a+2),t.add(a+1,a+2,a+3),i.has(s)?i.get(s)[1]+=6:i.set(s,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(e,t,i,s,r){const n=Math.max(i-1,0),a=s===ie.VIEWPORT;let o,c,h,f,l,d,x,p,w,y,m;for(const g of t)o=a?0:Math.max(i+Y(g.minzoom),n),c=a?25:Math.min(i+Y(g.maxzoom),25),!(c<=o)&&(h=g.tl,f=g.tr,l=g.bl,d=g.br,x=g.labelAngle,p=g.minAngle,w=g.maxAngle,y=g.anchor,m=g.mosaicRect,this._glyphBufferDataStorage.has(g.page)||this._glyphBufferDataStorage.set(g.page,[]),this._glyphBufferDataStorage.get(g.page).push({glyphAnchor:[y.x,y.y],tl:[h.x,h.y],tr:[f.x,f.y],bl:[l.x,l.y],br:[d.x,d.y],xmin:m.x,ymin:m.y,xmax:m.x+m.width,ymax:m.y+m.height,labelAngle:x,minAngle:p,maxAngle:w,minLod:o,maxLod:c,placementLod:n,symbolInstance:e,ddAttributes:r}))}static _pushAnchors(e,t,i,s){i+=s;let r=0;const n=t.length-1;for(let l=0;l-a;){if(--c,c<0)return!1;n-=A.distance(e[c],o),o=e[c]}n+=A.distance(e[c],e[c+1]);const h=[];let f=0;const l=e.length;for(;nr;)f-=h.shift().deviation;if(Math.abs(f)>s)return!1;n+=A.distance(x,w),c=p}return!0}static _smoothVertices(e,t){if(t<=0)return e;let i=e.length;if(i<3)return e;const s=[];let r=0,n=0;s.push(0);for(let p=1;p0&&(r+=w,s.push(r),n++,n!==p&&(e[n]=e[p]))}if(i=n+1,i<3)return e;t=Math.min(t,.2*r);const a=e[0].x,o=e[0].y,c=e[i-1].x,h=e[i-1].y,f=A.sub(e[0],e[1]);f.normalize(),e[0].x+=t*f.x,e[0].y+=t*f.y,f.assignSub(e[i-1],e[i-2]),f.normalize(),e[i-1].x+=t*f.x,e[i-1].y+=t*f.y,s[0]-=t,s[i-1]+=t;const l=[];l.push(new A(a,o));const d=1e-6,x=.5*t;for(let p=1;p=0;g--){const I=x+s[g+1]-s[p];if(I<0)break;const b=s[g+1]-s[g],_=s[p]-s[g]4096&&(f=4096),f<0&&(f=0),l>4096&&(l=4096),l<0&&(l=0);for(let d=1;d4096&&(x=4096),x<0&&(x=0),p>4096&&(p=4096),p<0&&(p=0),w>4096&&(w=4096),w<0&&(w=0),y>4096&&(y=4096),y<0&&(y=0);const m=(x-f)*(y-l)-(w-f)*(p-l);o+=m*(f+x+w),c+=m*(l+p+y),h+=m}o/=3*h,c/=3*h,isNaN(o)||isNaN(c)||e.push(new pe(o,c))}}U._bidiEngine=new lt;var W;(function(u){u[u.INITIALIZED=0]="INITIALIZED",u[u.NO_DATA=1]="NO_DATA",u[u.READY=2]="READY",u[u.MODIFIED=3]="MODIFIED",u[u.INVALID=4]="INVALID"})(W||(W={}));const Tt=8,Bt=14,Dt=5;class At{constructor(e,t,i,s,r){var h;if(this._pbfTiles={},this._tileClippers={},this._client=i,this._tile=t,r){this._styleLayerUIDs=new Set;for(const f of r)this._styleLayerUIDs.add(f)}this._styleRepository=s,this._layers=((h=this._styleRepository)==null?void 0:h.layers)??[];const[n,a,o]=t.tileKey.split("/").map(parseFloat);this._level=n;const c=Tt+Math.max((this._level-Bt)*Dt,0);for(const f of Object.keys(e)){const l=e[f];if(this._pbfTiles[f]=new rt(new Uint8Array(l.protobuff),new DataView(l.protobuff)),l.refKey){const[d]=l.refKey.split("/").map(parseFloat),x=n-d;if(x>0){const p=(1<{n.has(h)||(r.push({name:h,repeat:f}),n.add(h))},o={};for(const h of s)h.getResources(h.tileClipper,a,o);if(this._tile.status===W.INVALID)return[];const c=this._fetchResources(r,o,e);return Promise.all([...c,t]).then(()=>this._processFeatures(i.returnedBuckets))}_initialize(e){return{signal:e&&e.signal,sourceNameToTileData:this._parseTileData(this._pbfTiles),layers:this._layers,zoom:this._level,sourceNameToTileClipper:this._tileClippers,sourceNameToUniqueSourceLayerBuckets:{},sourceNameToUniqueSourceLayers:{},returnedBuckets:[],layerIdToBucket:{},referencerUIDToReferencedId:new Map}}_processLayers(e){const{sourceNameToTileData:t,layers:i,zoom:s,sourceNameToTileClipper:r,sourceNameToUniqueSourceLayerBuckets:n,sourceNameToUniqueSourceLayers:a,returnedBuckets:o,layerIdToBucket:c,referencerUIDToReferencedId:h}=e;for(let f=i.length-1;f>=0;f--){const l=i[f];if(!this._canParseStyleLayer(l.uid)||l.minzoom&&s=l.maxzoom||l.type===ee.BACKGROUND||!t[l.source]||!r[l.source])continue;const d=t[l.source],x=r[l.source],p=l.sourceLayer,w=d[p];if(w){let y=a[l.source];if(y||(y=a[l.source]=new Set),y.add(l.sourceLayer),l.refLayerId)h.set(l.uid,l.refLayerId);else{const m=this._createBucket(l);if(m){m.layerUIDs=[l.uid],m.layerExtent=w.extent,m.tileClipper=x;let g=n[l.source];g||(g=n[l.source]={});let I=g[p];I||(I=g[p]=[]),I.push(m),o.push(m),c[l.id]=m}}}}}_linkReferences(e){const{layerIdToBucket:t,referencerUIDToReferencedId:i}=e;i.forEach((s,r)=>{t[s]&&t[s].layerUIDs.push(r)})}_filterFeatures(e){const{signal:t,sourceNameToTileData:i,sourceNameToUniqueSourceLayerBuckets:s,sourceNameToUniqueSourceLayers:r}=e,n=10*this._level,a=10*(this._level+1),o=[],c=[];for(const h of Object.keys(r))r[h].forEach(f=>{o.push(f),c.push(h)});for(let h=0;h=a)continue;const I=m._maxzoom;if(I&&I<=n)continue}for(const g of x)g.pushFeature(y)}}}_fetchResources(e,t,i){const s=[],r=this._tile.getWorkerTileHandler();let n,a;e.length>0&&(n=r.fetchSprites(e,this._client,i),s.push(n));for(const o in t){const c=t[o];c.size>0&&(a=r.fetchGlyphs(this._tile.tileKey,o,c,this._client,i),s.push(a))}return s}_processFeatures(e){const t=e.filter(i=>i.hasFeatures()||this._canParseStyleLayer(i.layer.uid));for(const i of t)i.processFeatures(i.tileClipper);return t}_parseTileData(e){const t={};for(const i of Object.keys(e)){const s=e[i],r={};for(;s.next();)switch(s.tag()){case 3:{const n=s.getMessage(),a=new De(n);n.release(),r[a.name]=a;break}default:s.skip()}t[i]=r}return t}_createBucket(e){switch(e.type){case ee.BACKGROUND:return null;case ee.FILL:return this._createFillBucket(e);case ee.LINE:return this._createLineBucket(e);case ee.CIRCLE:return this._createCircleBucket(e);case ee.SYMBOL:return this._createSymbolBucket(e)}}_createFillBucket(e){return new _t(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new xt(e.fillMaterial.getStride()),new te,new gt(e.outlineMaterial.getStride()),new te)}_createLineBucket(e){return new wt(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new yt(e.lineMaterial.getStride()),new te)}_createCircleBucket(e){return new mt(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new pt(e.circleMaterial.getStride()),new te)}_createSymbolBucket(e){const t=this._tile;return new U(e,this._level,new Ge(e.iconMaterial.getStride()),new te,new Ge(e.textMaterial.getStride()),new te,t.placementEngine,t.getWorkerTileHandler())}}class Lt{constructor(e,t,i,s){this.status=W.INITIALIZED,this.placementEngine=new ft,this.tileKey=e,this.refKeys=t,this._workerTileHandler=i,this._styleRepository=s}release(){this.tileKey="",this.refKeys=null,this.status=W.INITIALIZED,this._workerTileHandler=null}async parse(e,t){const i=t&&t.signal;if(i!=null){const h=()=>{i.removeEventListener("abort",h),this.status=W.INVALID};i.addEventListener("abort",h)}let s;const r={bucketsWithData:[],emptyBuckets:null};try{s=await this._parse(e,t)}catch(h){if(He(h))throw h;return{result:r,transferList:[]}}this.status=W.READY;const n=r.bucketsWithData,a=[];for(const h of s)if(h.hasFeatures()){const f=h.serialize();n.push(f)}else a.push(h.layer.uid);const o=[...n];let c=null;return a.length>0&&(c=Uint32Array.from(a),o.push(c.buffer)),r.emptyBuckets=c,{result:r,transferList:o}}setObsolete(){this.status=W.INVALID}getLayers(){return this._workerTileHandler.getLayers()}getWorkerTileHandler(){return this._workerTileHandler}async _parse(e,t){const i=e.sourceName2DataAndRefKey;return Object.keys(i).length===0?[]:(this.status=W.MODIFIED,new At(i,this,t.client,this._styleRepository,e.styleLayerUIDs).parse(t))}}class qt{constructor(){this._spriteInfo={},this._glyphInfo={}}reset(){return this._spriteInfo={},this._glyphInfo={},Promise.resolve()}getLayers(){var e;return((e=this._styleRepository)==null?void 0:e.layers)??[]}async createTileAndParse(e,t){const{key:i}=e,s={};for(const n of Object.keys(e.sourceName2DataAndRefKey)){const a=e.sourceName2DataAndRefKey[n];s[n]=a.refKey}const r=new Lt(i,s,this,this._styleRepository);try{return await r.parse(e,t)}catch(n){if(r.setObsolete(),r.release(),!He(n))throw n;return null}}updateStyle(e){if(!e||e.length===0||!this._styleRepository)return;const t=this._styleRepository;for(const i of e){const s=i.type,r=i.data;switch(s){case oe.PAINTER_CHANGED:t.setPaintProperties(r.layer,r.paint);break;case oe.LAYOUT_CHANGED:t.setLayoutProperties(r.layer,r.layout);break;case oe.LAYER_REMOVED:t.deleteStyleLayer(r.layer);break;case oe.LAYER_CHANGED:t.setStyleLayer(r.layer,r.index);break;case oe.SPRITES_CHANGED:this._spriteInfo={}}}}setStyle(e){this._styleRepository=new it(e),this._spriteInfo={},this._glyphInfo={}}fetchSprites(e,t,i){const s=[],r=this._spriteInfo;for(const n of e)r[n.name]===void 0&&s.push(n);return s.length===0?Promise.resolve():t.invoke("getSprites",s,{signal:i&&i.signal}).then(n=>{for(const a in n){const o=n[a];r[a]=o}})}getSpriteItems(){return this._spriteInfo}fetchGlyphs(e,t,i,s,r){const n=[];let a=this._glyphInfo[t];return a?i.forEach(o=>{a[o]||n.push(o)}):(a=this._glyphInfo[t]=[],i.forEach(o=>n.push(o))),n.length===0?Promise.resolve():s.invoke("getGlyphs",{tileID:e,font:t,codePoints:n},r).then(o=>{for(let c=0;cx(this)),this.guid=`calcite-action-${C()}`,this.indicatorId=`${this.guid}-indicator`,this.buttonId=`${this.guid}-button`,this.handleTooltipSlotChange=t=>{const i=t.target.assignedElements({flatten:!0}).filter(o=>o==null?void 0:o.matches("calcite-tooltip"))[0];i&&(i.referenceElement=this.buttonEl)},this.active=!1,this.alignment=void 0,this.appearance="solid",this.compact=!1,this.disabled=!1,this.icon=void 0,this.iconFlipRtl=!1,this.indicator=!1,this.label=void 0,this.loading=!1,this.scale="m",this.text=void 0,this.textEnabled=!1,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0}onMessagesChange(){}effectiveLocaleChange(){S(this,this.effectiveLocale)}connectedCallback(){var t;z(this),M(this),O(this),(t=this.mutationObserver)==null||t.observe(this.el,{childList:!0,subtree:!0})}async componentWillLoad(){L(this),await $(this)}componentDidLoad(){I(this)}disconnectedCallback(){var t;w(this),F(this),H(this),(t=this.mutationObserver)==null||t.disconnect()}componentDidRender(){E(this)}async setFocus(){var t;await T(this),(t=this.buttonEl)==null||t.focus()}renderTextContainer(){const{text:t,textEnabled:e}=this,i={[a.textContainer]:!0,[a.textContainerVisible]:e};return t?n("div",{class:i,key:"text-container"},t):null}renderIndicatorText(){const{indicator:t,messages:e,indicatorId:i,buttonId:o}=this;return n("div",{"aria-labelledby":o,"aria-live":"polite",class:a.indicatorText,id:i,role:"region"},t?e.indicator:null)}renderIconContainer(){var r;const{loading:t,icon:e,scale:i,el:o,iconFlipRtl:l}=this,d=i==="l"?"m":"s",u=i==="l"?"l":"m",s=t?n("calcite-loader",{inline:!0,label:this.messages.loading,scale:u}):null,b=e?n("calcite-icon",{flipRtl:l,icon:e,scale:d}):null,c=s||b,h=c||((r=o.children)==null?void 0:r.length),f=n("div",{class:{[a.slotContainer]:!0,[a.slotContainerHidden]:t}},n("slot",null));return h?n("div",{"aria-hidden":"true",class:a.iconContainer,key:"icon-container"},c,f):null}render(){const{active:t,compact:e,disabled:i,loading:o,textEnabled:l,label:d,text:u,indicator:s,indicatorId:b,buttonId:c,messages:h}=this,f=`${d||u}${s?` (${h.indicator})`:""}`,r={[a.button]:!0,[a.buttonTextVisible]:l,[a.buttonCompact]:e};return n(y,null,n("button",{"aria-busy":p(o),"aria-controls":s?b:null,"aria-disabled":p(i),"aria-label":f,"aria-pressed":p(t),class:r,disabled:i,id:c,ref:g=>this.buttonEl=g},this.renderIconContainer(),this.renderTextContainer()),n("slot",{name:D.tooltip,onSlotchange:this.handleTooltipSlotChange}),this.renderIndicatorText())}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return V}},[1,"calcite-action",{active:[516],alignment:[513],appearance:[513],compact:[516],disabled:[516],icon:[1],iconFlipRtl:[516,"icon-flip-rtl"],indicator:[516],label:[1],loading:[516],scale:[513],text:[1],textEnabled:[516,"text-enabled"],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]}]);function A(){if(typeof customElements>"u")return;["calcite-action","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-action":customElements.get(e)||customElements.define(e,_);break;case"calcite-icon":customElements.get(e)||j();break;case"calcite-loader":customElements.get(e)||k();break}})}A();export{_ as A,A as d}; diff --git a/assets/analysisViewUtils-68ab721d.js b/assets/analysisViewUtils-68ab721d.js new file mode 100644 index 0000000..d642bc2 --- /dev/null +++ b/assets/analysisViewUtils-68ab721d.js @@ -0,0 +1,31 @@ +import{h5 as ke,kC as Ve,n1 as Ue,c7 as U,oP as Be,fu as G,dT as $,oQ as P,cu as Ge,kK as Fe,kB as He,oR as qe,j9 as Qe,oS as le,oT as Xe,gv as B,kD as Ye,gU as Ke,kG as K,oU as ce,jH as he,o3 as de,kH as ue,ft as F,oV as Ze,h6 as pe,j7 as O,gu as te,oW as _e,fs as ge,j5 as Je,ox as et,oX as tt,oY as it,e8 as st,aD as at,aB as nt,ah as ot,oZ as rt,o_ as lt,la as Z,o$ as S,e9 as ct,dS as ie,j1 as Pe,p0 as ht,mR as ve,gf as dt,p1 as ut,p2 as pt,lV as fe,p3 as _t,gz as gt,p4 as vt,ii as be,id as y,ia as ft,hH as m,ic as bt,ie as mt,ik as yt,ib as St,lJ as me,a_ as d,p5 as wt,ig as Et,nY as Tt,p6 as At,il as x,bH as Ot,im as $t,aw as Lt,ai as l,iq as A,ir as I,is as Rt,it as jt,iv as Mt,lK as Ft,iw as Pt,ix as Ct,hL as J,iz as Dt,iA as zt,iB as xt,p7 as It,iG as Nt,lN as Wt,p8 as ye,hI as C,lO as kt,iM as Vt,i$ as se,dR as ae,lM as Ut,p9 as Bt,pa as Gt,k8 as Ht,pb as qt,pc as Qt,pd as Xt,pe as Yt,dQ as Ce,gA as Kt,i_ as ne,j3 as Zt,pf as Jt,j6 as Se,pg as ei,j2 as ti,aZ as ii,a$ as we,cl as si,aF as ai,aj as f,al as De,ao as ni,ph as L,cv as oi,bz as ri,aG as ze,aM as xe,g9 as li,aN as ci,cT as hi,hV as di}from"./index-080e108a.js";import{c as ui}from"./ImageMaterial-5c48df66.js";class Ie{constructor(e){var i;this.metadata=void 0,this._camera=new Be,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=new Array,this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=G(),this._worldFrame=null,this._renderLocation=$(),this._renderLocationDirty=!0,this._location=new U({x:0,y:0,z:0}),this._elevationAlignedLocation=new U,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=P.None,this._focused=!1,this.events=new Ge.EventEmitter,this._screenLocation={screenPointArray:Fe(),renderScreenPointArray:He(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=e.view.spatialReference,Object.assign(this,e);const t=(i=this.view.state)==null?void 0:i.camera;t&&this._camera.copyFrom(t)}destroy(){this._applyObjectTransform=fi,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){var e;return(e=this.view)==null?void 0:e._stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,this._noDisplayCount===1&&this._updateEngineObject(),{remove:qe(()=>{this._noDisplayCount--,this._noDisplayCount===0&&this._updateEngineObject()})}}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){Ee(e)&&(this._screenLocationDirty=!0),Qe(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=G()),pi(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){le(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){le(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){const e=this._elevation.override!=null?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=Xe(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:e===!0?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(Ee(this._modelTransform)){const t=this._calculateModelTransformOffset(vi);e=B(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(e,t){if(!this.available)return null;const i=Ye(e,_i),a=this._getCollisionRadius(t),n=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(it(this.screenLocation.screenPointArray,i)0;for(const{stateMask:o,objects:r}of i){if(n){for(const c of r)c.visible=!1;continue}const p=(o&S.All)!==S.None,u=(o&P.All)!==P.None,g=!p||(a&o)==(o&S.All),v=!u||(this.state&o)==(o&P.All);if(g&&v)for(const c of r)c.visible=!0,c.transformation=t;else for(const c of r)c.visible=!1}}_ensureEngineResources(){if(this._engineResources==null){const e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach(({geometry:{material:o}})=>{i.has(o)||(t.push(o),i.add(o))});const a=new Map;this._renderObjects.forEach(o=>{const r=new ct({castShadow:!1,geometries:[o.geometry]}),p=a.get(o.stateMask)||[];p.push(r),a.set(o.stateMask,p)});const n=[];a.forEach((o,r)=>n.push({stateMask:r,objects:o})),this._engineResources={objectsByState:n,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){const e=this._stage;if(this._engineResourcesAddedToStage||this._engineResources==null||!e)return;const{objectsByState:t,layer:i,materials:a}=this._engineResources;a.forEach(n=>{const o=this._materialIdReferences,r=o.get(n.id)||0;r===0&&e.add(n),o.set(n.id,r+1)}),t.forEach(({objects:n})=>{i.addMany(n),e.addMany(n)}),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){const e=this._stage;if(!this._engineResourcesAddedToStage||this._engineResources==null||!e)return;const{objectsByState:t,layer:i,materials:a}=this._engineResources;t.forEach(({objects:n})=>{i.removeMany(n),e.removeMany(n)}),a.forEach(n=>{const o=this._materialIdReferences,r=o.get(n.id);r===1?(e.remove(n),o.delete(n.id)):o.set(n.id,r-1)}),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*(e==="touch"?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,gi);return ie(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return Pe(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return ht(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&ve(t,t,this._worldFrame),ve(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,this._applyObjectTransform!=null&&this._applyObjectTransform(t),t}get test(){let e=!1;if(this._engineResources!=null)for(const t in this._engineResources.objectsByState){const i=this._engineResources.objectsByState[t];for(const a of i.objects)if(a.visible){e=!0;break}if(e)break}return{areAnyResourcesVisible:e}}}function Ee(s){return s[12]!==0||s[13]!==0||s[14]!==0}function pi(s,e,t){switch(s.viewingMode){case"local":return _t(t),!0;case"global":{const i=dt(s.renderCoordsHelper.spatialReference);return ut(e,0,z,0,i.radius),pt(fe(z[0]),fe(z[1]),t),!0}}}const _i=Fe(),Te=ke(),ee=Ve(),Ae=gt(),gi=G(),N=G(),W=Ue(),z=$(),Oe=$(),$e=$(),Le=$(),Re=$(),vi=$(),je=new U({x:0,y:0,z:0,spatialReference:null}),fi=()=>{};class D{constructor(e,t=S.None){this.geometry=e,this.stateMask=t}}function bi(s,e){if(!e.screenSizeEnabled)return;const t=s.vertex;vt(t,e),t.uniforms.add(new be("perScreenPixelRatio",(i,a)=>a.camera.perScreenPixelRatio),new be("screenSizeScale",i=>i.screenSizeScale)),t.code.add(y`float computeRenderPixelSizeAt( vec3 pWorld ){ +vec3 viewForward = - vec3(view[0][2], view[1][2], view[2][2]); +float viewDirectionDistance = abs(dot(viewForward, pWorld - cameraPosition)); +return viewDirectionDistance * perScreenPixelRatio; +} +vec3 screenSizeScaling(vec3 position, vec3 anchor){ +return position * screenSizeScale * computeRenderPixelSizeAt(anchor) + anchor; +}`)}function mi(s){const e=new ft,t=s.hasMultipassTerrain&&(s.output===m.Color||s.output===m.Alpha);e.include(bt,s),e.include(bi,s),e.include(mt,s);const{vertex:i,fragment:a}=e;return a.include(yt),St(i,s),a.uniforms.add(new me("uColor",n=>n.color)),e.attributes.add(d.POSITION,"vec3"),e.varyings.add("vWorldPosition","vec3"),t&&e.varyings.add("depth","float"),s.screenSizeEnabled&&e.attributes.add(d.OFFSET,"vec3"),s.shadingEnabled&&(wt(i),e.attributes.add(d.NORMAL,"vec3"),e.varyings.add("vViewNormal","vec3")),i.code.add(y` + void main(void) { + vWorldPosition = ${s.screenSizeEnabled?"screenSizeScaling(offset, position)":"position"}; + `),s.shadingEnabled&&i.code.add(y`vec3 worldNormal = normal; +vViewNormal = (viewNormal * vec4(worldNormal, 1)).xyz;`),i.code.add(y` + ${t?"depth = (view * vec4(vWorldPosition, 1.0)).z;":""} + gl_Position = transformPosition(proj, view, vWorldPosition); + } + `),t&&e.include(Et,s),a.code.add(y` + void main() { + discardBySlice(vWorldPosition); + ${t?"terrainDepthTest(gl_FragCoord, depth);":""} + `),s.shadingEnabled?(a.uniforms.add(new Tt("shadingDirection",n=>n.shadingDirection)),a.uniforms.add(new me("shadedColor",n=>yi(n.shadingTint,n.color))),a.code.add(y`vec3 viewNormalNorm = normalize(vViewNormal); +float shadingFactor = 1.0 - clamp(-dot(viewNormalNorm, shadingDirection), 0.0, 1.0); +vec4 finalColor = mix(uColor, shadedColor, shadingFactor);`)):a.code.add(y`vec4 finalColor = uColor;`),a.code.add(y` + ${s.output===m.ObjectAndLayerIdColor?y`finalColor.a = 1.0;`:""} + if (finalColor.a < ${y.float(At)}) { + discard; + } + ${s.output===m.Alpha?y`fragColor = vec4(finalColor.a);`:""} + + ${s.output===m.Color?y`fragColor = highlightSlice(finalColor, vWorldPosition); ${s.transparencyPassType===x.Color?"fragColor = premultiplyAlpha(fragColor);":""}`:""} + } + `),e}function yi(s,e){const t=1-s[3],i=s[3]+e[3]*t;return i===0?(R[3]=i,R):(R[0]=(s[0]*s[3]+e[0]*e[3]*t)/i,R[1]=(s[1]*s[3]+e[1]*e[3]*t)/i,R[2]=(s[2]*s[3]+e[2]*e[3]*t)/i,R[3]=e[3],R)}const R=Ot(),Si=Object.freeze(Object.defineProperty({__proto__:null,build:mi},Symbol.toStringTag,{value:"Module"}));class q extends Rt{initializeProgram(e){return new jt(e.rctx,q.shader.get().build(this.configuration),Ne)}_setPipelineState(e){const t=this.configuration,i=e===x.NONE,a=e===x.FrontFace;return Mt({blending:t.output!==m.Color&&t.output!==m.Alpha||!t.transparent?null:i?Ft:Pt(e),culling:Ct(t.cullFace),depthTest:{func:a?J.LESS:t.shadingEnabled?J.LEQUAL:J.LESS},depthWrite:i?t.writeDepth?Dt:null:zt(e),colorWrite:xt,polygonOffset:i||a?null:It})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}}q.shader=new $t(Si,()=>Lt(()=>import("./ShadedColorMaterial.glsl-2686362a.js"),["assets/ShadedColorMaterial.glsl-2686362a.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/ImageMaterial-5c48df66.js"]));let E=class extends Nt{constructor(){super(...arguments),this.output=m.Color,this.cullFace=I.None,this.transparencyPassType=x.NONE,this.hasSlicePlane=!1,this.transparent=!1,this.writeDepth=!0,this.screenSizeEnabled=!0,this.shadingEnabled=!0,this.hasMultipassTerrain=!1,this.cullAboveGround=!1}};l([A({count:m.COUNT})],E.prototype,"output",void 0),l([A({count:I.COUNT})],E.prototype,"cullFace",void 0),l([A({count:x.COUNT})],E.prototype,"transparencyPassType",void 0),l([A()],E.prototype,"hasSlicePlane",void 0),l([A()],E.prototype,"transparent",void 0),l([A()],E.prototype,"writeDepth",void 0),l([A()],E.prototype,"screenSizeEnabled",void 0),l([A()],E.prototype,"shadingEnabled",void 0),l([A()],E.prototype,"hasMultipassTerrain",void 0),l([A()],E.prototype,"cullAboveGround",void 0);const Ne=new Map([[d.POSITION,0],[d.NORMAL,1],[d.OFFSET,2]]);class wi extends Wt{constructor(e){super(e,new Ti),this.supportsEdges=!0,this._configuration=new E,this._vertexAttributeLocations=Ne}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,t,i,a,n,o){if(this.parameters.screenSizeEnabled){const r=e.vertexAttributes.get(d.OFFSET);ye(e,i,a,n,{applyToVertex:(u,g,v,c)=>{const b=ie(Me,r.data[3*c],r.data[3*c+1],r.data[3*c+2]),h=ie(Oi,u,g,v);return te(b,b,this.parameters.screenSizeScale*i.camera.computeRenderPixelSizeAt(b)),B(h,h,b),[h[0],h[1],h[2]]},applyToAabb:u=>{const g=Qt(u,Me);return Xt(u,this.parameters.screenSizeScale*i.camera.computeRenderPixelSizeAt(g))}},o)}else ye(e,i,a,n,void 0,o)}requiresSlot(e,t){if(t===m.Highlight)return e===C.OPAQUE_MATERIAL;if(t===m.Color||t===m.Alpha||t===m.ObjectAndLayerIdColor){let i=C.OPAQUE_MATERIAL;return this.parameters.transparent&&(i=this.parameters.writeDepth?C.TRANSPARENT_MATERIAL:C.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),e===i||e===C.DRAPED_MATERIAL}return!1}createGLMaterial(e){return new Ei(e)}createBufferWriter(){return new Ai(this.parameters.screenSizeEnabled)}}class Ei extends kt{beginSlot(e){return this.ensureTechnique(q,e)}}class Ti extends Vt{constructor(){super(...arguments),this.color=se(1,1,1,1),this.shadingTint=se(0,0,0,.25),this.shadingDirection=ae($(),[.5,-.5,-.5]),this.screenSizeScale=14,this.transparent=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=I.None,this.screenSizeEnabled=!1,this.shadingEnabled=!0}}class Ai{constructor(e){this.screenSizeEnabled=e;const t=Ut().vec3f(d.POSITION).vec3f(d.NORMAL);this.screenSizeEnabled&&t.vec3f(d.OFFSET),this.vertexBufferLayout=t}elementCount(e){return e.indices.get(d.POSITION).length}write(e,t,i,a,n){if(Bt(i,this.vertexBufferLayout,e,t,a,n),this.screenSizeEnabled){if(!i.vertexAttributes.has(d.OFFSET))throw new Error(`${d.OFFSET} vertex attribute required for screenSizeEnabled ShadedColorMaterial`);{const o=i.vertexAttributes.get(d.OFFSET),r=i.indices.get(d.OFFSET);Gt(o.size===3);const p=a.getField(d.OFFSET,Ht);if(!p)throw new Error("unable to acquire view for "+d.OFFSET);qt(r,o.data,t,p,n)}}}}const Me=$(),Oi=$();function $i(s,e=ne.OccludeAndTransparent,t=!0){const i=se(s[0],s[1],s[2],s.length>3?s[3]:1),a=s[3]<1,n=!a;return t?new wi({color:i,transparent:a,writeDepth:n,cullFace:I.Back,renderOccluded:e}):new ti({color:i,transparent:a,writeDepth:n,cullFace:I.Back,renderOccluded:e})}const k=Object.freeze({calloutLength:40,calloutWidth:1,discRadius:27,focusMultiplier:1.1});function Ii(s,e){const t=new Ie({view:s,autoScaleRenderObjects:!1,collisionPriority:1,metadata:e.metadata});return Li(t,e),t}function Li(s,e){var b;const t=e.material??new ui({transparent:!0,writeDepth:!1,textureId:(b=e.texture)==null?void 0:b.id,renderOccluded:ne.Opaque}),i=e.focusMultiplier??k.focusMultiplier,a=e.calloutLength??k.calloutLength,n=k.discRadius*(e.discScale??1),o=n*i,r=(h,T)=>{const w=[0,1,2,2,3,0];return new ii(T,[[d.POSITION,new we([a-h,-h,0,a+h,-h,0,a+h,h,0,a-h,h,0],3,!0)],[d.UV0,new we([0,0,1,0,1,1,0,1],2,!0)]],[[d.POSITION,w],[d.UV0,w]])},p=e.calloutWidth??k.calloutWidth,u=new(p>1?Zt:Jt)({width:p,color:e.calloutColor,renderOccluded:ne.OccludeAndTransparent}),g=Se(u,[[0,0,0],[a-n,0,0]]),v=Se(u,[[0,0,0],[a-o,0,0]]),c=e.customStateMask??P.None;s.collisionType={type:"disc",direction:[0,0,1],offset:[a,0,0]},s.focusMultiplier=i,s.metadata=e.metadata,s.radius=n,s.renderObjects=[new D(r(n,t),S.Unfocused|c),new D(g,S.Unfocused|c),new D(r(o,t),S.Focused|c),new D(v,S.Focused|c)]}function Ni(s,e,t=P.None){const i=$i(e),a=[new D(ei(i,1,32,32),t)];return new Ie({view:s,renderObjects:a})}const Wi=Object.freeze({autoScaleRenderObjects:!1,worldSized:!0});function ki(s,e,t,i){const a=Pe(O.get(),s,t),n=Ri(a,Ce(O.get(),i,a),t,Yt.get());Kt(n,n);const o=F(O.get(),e,n);return Math.atan2(o[1],o[0])}function Ri(s,e,t,i){const a=ae(O.get(),s),n=ae(O.get(),e),o=Ce(O.get(),a,n);return i[0]=a[0],i[1]=a[1],i[2]=a[2],i[3]=0,i[4]=n[0],i[5]=n[1],i[6]=n[2],i[7]=0,i[8]=o[0],i[9]=o[1],i[10]=o[2],i[11]=0,i[12]=t[0],i[13]=t[1],i[14]=t[2],i[15]=1,i}function ji(s,e){let t=null,i=null;return a=>{if(a.action==="cancel")return void(i!=null&&(i.execute({action:"cancel"}),t=null,i=null));const n={action:a.action,screenStart:a.start,screenEnd:a.screenPoint};a.action==="start"&&t==null&&(t=new H,i=new H,e(s,t,i,a.pointerType,n)),t!=null&&t.execute(n),a.action==="end"&&t!=null&&(t=null,i=null)}}function Vi(s,e){return s.events.on("drag",ji(s,e))}function Ui(s,e){const t=new Map;for(const i of e)t.set(i,si(s[i]));return i=>(t.forEach((a,n)=>{s[n]=a}),i)}const Mi=()=>{};class H{constructor(){this.execute=Mi}next(e,t=new H){return e!=null&&(this.execute=i=>{const a=e(i);a!=null&&t.execute(a)}),t}}var j;(function(s){s[s.WhenToolEditable=0]="WhenToolEditable",s[s.WhenToolNotEditable=1]="WhenToolNotEditable",s[s.Always=2]="Always"})(j||(j={}));class Fi{constructor(){this._isToolEditable=!0,this._manipulators=new ai,this._resourceContexts={manipulator3D:{}},this._attached=!1}set isToolEditable(e){this._isToolEditable=e}get length(){return this._manipulators.length}add(e,t=j.WhenToolEditable){this.addMany([e],t)}addMany(e,t=j.WhenToolEditable){for(const i of e){const a={manipulator:i,visibilityPredicate:t,attached:!1};this._manipulators.add(a),this._attached&&this._updateManipulatorAttachment(a)}}remove(e){for(let t=0;t{this._detachManipulator(e)}),this._manipulators.removeAll()}attach(){this._manipulators.forEach(e=>{this._updateManipulatorAttachment(e)}),this._attached=!0}detach(){this._manipulators.forEach(e=>{this._detachManipulator(e)}),this._attached=!1}destroy(){this.detach(),this._manipulators.forEach(({manipulator:e})=>{e.destroy&&e.destroy()}),this._manipulators.destroy(),this._resourceContexts=null}on(e,t){return this._manipulators.on(e,i=>{t(i)})}forEach(e){for(const t of this._manipulators.items)e(t)}some(e){return this._manipulators.items.some(e)}toArray(){const e=[];return this.forEach(t=>e.push(t.manipulator)),e}intersect(e,t){let i=null,a=Number.MAX_VALUE;return this._manipulators.forEach(({manipulator:n,attached:o})=>{if(!o||!n.interactive)return;const r=n.intersectionDistance(e,t);r!=null&&rthis.analysisViewData.visible,e=>this.visible=e,xe))}deactivate(){this.onDeactivate(),this.created||this.analysis.clear()}resetCreated(){this._set("created",!1)}};l([f({constructOnly:!0})],V.prototype,"analysis",void 0),l([f()],V.prototype,"analysisViewData",void 0),V=l([De("esri.views.interactive.AnalysisToolBase")],V);function Hi(s,e){s.interactive=!0;const{tool:t,view:i}=s;i.activeTool=t;let a=li(e,()=>{i.activeTool===t&&(i.activeTool=null)});return ci(async n=>{await hi(()=>t==null||!t.active,n),a=di(a)},e)}function qi(s,e){return ze(()=>s.interactive,()=>Pi(s,e),xe)}function Pi(s,e){s.interactive?Ci(s,e):We(s)}function Ci(s,e){We(s);const{view:t,analysis:i}=s,a=new e({view:t,analysis:i,analysisViewData:s});return s.tool=a,t.tools.add(a),a}function We(s){const{view:e,tool:t}=s;t!=null&&(e.tools.remove(t),s.tool=null)}export{Ie as $,ki as D,$i as F,Li as L,Ri as N,Ii as R,Ni as T,Wi as U,V as a,qi as b,Ui as c,Vi as d,D as e,H as f,wi as g,Hi as l,mi as p,We as v}; diff --git a/assets/ar2-dfb29e9e.js b/assets/ar2-dfb29e9e.js new file mode 100644 index 0000000..47bb85e --- /dev/null +++ b/assets/ar2-dfb29e9e.js @@ -0,0 +1 @@ +const d={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"م",_era_bc:"ق.م",A:"ص",P:"م",AM:"ص",PM:"م","A.M.":"ص","P.M.":"م",January:"يناير",February:"فبراير",March:"مارس",April:"أبريل",May:"مايو",June:"يونيو",July:"يوليو",August:"أغسطس",September:"سبتمبر",October:"أكتوبر",November:"نوفمبر",December:"ديسمبر",Jan:"يناير",Feb:"فبراير",Mar:"مارس",Apr:"أبريل","May(short)":"مايو",Jun:"يونيو",Jul:"يوليو",Aug:"أغسطس",Sep:"سبتمبر",Oct:"أكتوبر",Nov:"نوفمبر",Dec:"ديسمبر",Sunday:"الأحد",Monday:"الاثنين",Tuesday:"الثلاثاء",Wednesday:"الأربعاء",Thursday:"الخميس",Friday:"الجمعة",Saturday:"السبت",Sun:"الأحد",Mon:"الاثنين",Tue:"الثلاثاء",Wed:"الأربعاء",Thu:"الخميس",Fri:"الجمعة",Sat:"السبت",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"تغيير مقياس الرسم",Play:"تشغيل",Stop:"إيقاف تشغيل",Legend:"وسيلة الإيضاح","Press ENTER to toggle":"",Loading:"تحميل",Home:"الصفحة الرئيسية",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"طباعة",Image:"صورة",Data:"بيانات",Print:"طباعة","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"من %1 إلى %2","From %1":"من %1","To %1":"إلى %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/assets/arcadeAsyncRuntime-8b244fcf.js b/assets/arcadeAsyncRuntime-8b244fcf.js new file mode 100644 index 0000000..2d531b0 --- /dev/null +++ b/assets/arcadeAsyncRuntime-8b244fcf.js @@ -0,0 +1,2 @@ +import{T as se,G as ce,N as ue,Z as fe,f as pe,Q as we,Y as I,e as _,o as de,s as $,D as y,a as O,F as w,C as S,R as E,O as v,p as he,L as h,A as R,z as B,q as j,E as M,V as me,J as F,b as d,W as J,c as L,d as ge,i as D,g as ye,y as ve,h as ee,r as be,j as G,n as Q,k as Se}from"./arcadeUtils-b902d678.js";import{t as l,e as s,u as xe}from"./executionError-c92d3b85.js";import{registerFunctions as Ie}from"./geomasync-463bba62.js";import{bc as ne,fB as Z}from"./index-080e108a.js";import"./arcadeTimeUtils-e1438cc8.js";import"./FieldsIndex-f79a8f26.js";import"./number-e5825aa4.js";import"./hash-6f442295.js";import"./geometryEngineAsync-e8b91fe5.js";import"./portalUtils-2eff95c6.js";function H(n){return n&&typeof n.then=="function"}const P=100;async function Y(n,e){const t=[];for(let r=0;r{const r={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,timeReference:this.context.timeReference??null,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:e.depthCounter+1},globalScope:this.context.globalScope};if(r.depthCounter.depth>64)throw new l(e,s.MaximumCallDepth,null);return q(this.definition,r,t,null)}}call(e,t){return N(e,t,(r,o,a)=>{const i={spatialReference:e.spatialReference,services:e.services,console:e.console,libraryResolver:e.libraryResolver,exports:e.exports,lrucache:e.lrucache,timeReference:e.timeReference??null,interceptor:e.interceptor,localScope:{},abortSignal:e.abortSignal,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1}};if(i.depthCounter.depth>64)throw new l(e,s.MaximumCallDepth,t);return q(this.definition,i,a,t)})}marshalledCall(e,t,r,o){return o(e,t,async(a,i,u)=>{const f={spatialReference:e.spatialReference,globalScope:r.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,abortSignal:e.abortSignal,lrucache:e.lrucache,timeReference:e.timeReference??null,interceptor:e.interceptor,localScope:{}};return u=u.map(p=>!v(p)||p instanceof G?p:Q(p,e,o)),Q(await q(this.definition,f,u,t),r,o)})}}class C extends Se{constructor(e){super(e)}async global(e){const t=this.executingContext.globalScope[e.toLowerCase()];if(t.valueset||(t.value=await c(this.executingContext,t.node),t.valueset=!0),v(t.value)&&!(t.value instanceof G)){const r=new G;r.fn=t.value,r.parameterEvaluator=N,r.context=this.executingContext,t.value=r}return t.value}setGlobal(e,t){if(v(t))throw new l(null,s.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:t,valueset:!0,node:null}}hasGlobal(e){return this.executingContext.exports[e]===void 0&&(e=e.toLowerCase()),this.executingContext.exports[e]!==void 0}async loadModule(e){let t=e.spatialReference;t==null&&(t=new ne({wkid:102100})),this.moduleScope=ie({},e.customfunctions,e.timeReference),this.executingContext={spatialReference:t,services:e.services,libraryResolver:new $(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},abortSignal:e.abortSignal===void 0||e.abortSignal===null?{aborted:!1}:e.abortSignal,globalScope:this.moduleScope,console:e.console??le,lrucache:e.lrucache,timeReference:e.timeReference??null,interceptor:e.interceptor,localScope:null,depthCounter:{depth:1}},await c(this.executingContext,this.source.syntax)}}async function N(n,e,t){if(e.preparsed===!0){const o=t(n,null,e.arguments);return H(o),o}const r=t(n,e,await Y(n,e));return H(r),r}async function c(n,e,t){if(e.breakpoint&&t!==!0)return await e.breakpoint(),c(n,e,!0);try{switch(e==null?void 0:e.type){case"VariableDeclarator":return await Ue(n,e);case"ImportDeclaration":return await Ge(n,e);case"ExportNamedDeclaration":return await Te(n,e);case"VariableDeclaration":return await re(n,e,0);case"BlockStatement":case"Program":return await Ke(n,e);case"FunctionDeclaration":return await De(n,e);case"ReturnStatement":return await qe(n,e);case"IfStatement":return await Pe(n,e);case"ExpressionStatement":return await je(n,e);case"UpdateExpression":return await Ee(n,e);case"AssignmentExpression":return await Be(n,e);case"ForStatement":return await Le(n,e);case"WhileStatement":return await Ae(n,e);case"ForInStatement":return await ke(n,e);case"BreakStatement":return S;case"EmptyStatement":return w;case"ContinueStatement":return E;case"TemplateElement":return await Qe(n,e);case"TemplateLiteral":return await He(n,e);case"Identifier":return await z(n,e);case"MemberExpression":return await Ve(n,e);case"Literal":return e.value;case"CallExpression":return await Je(n,e);case"UnaryExpression":return await We(n,e);case"BinaryExpression":return await Ye(n,e);case"LogicalExpression":return await ze(n,e);case"ArrayExpression":return await _e(n,e);case"ObjectExpression":return await Ce(n,e);case"Property":return await Fe(n,e);default:throw new l(n,s.Unrecognised,e)}}catch(r){throw xe(n,e,r)}}async function Ce(n,e){const t=[];for(let i=0;i{try{t.testResult===!0?++a>P?(a=0,setTimeout(()=>{k(n,e,t,r,o,a)},0)):k(n,e,t,r,o,a):t.lastAction instanceof y?r(t.lastAction):r(w)}catch(i){o(i)}},i=>{o(i)})}catch(i){o(i)}}function Le(n,e){try{return e.init!==null?c(n,e.init).then(()=>new Promise((t,r)=>{k(n,e,{testResult:!0,lastAction:w},o=>{t(o)},o=>{r(o)},0)})):new Promise((t,r)=>{k(n,e,{testResult:!0,lastAction:w},o=>{t(o)},o=>{r(o)},0)})}catch(t){return Promise.reject(t)}}function T(n,e,t,r,o,a,i,u,f,p){try{if(r<=a)return void u(w);o.value=i==="k"?t[a]:a,c(n,e.body).then(g=>{try{g instanceof y?u(g):g===S?u(w):++p>P?(p=0,setTimeout(()=>{T(n,e,t,r,o,a+1,i,u,f,p)},0)):T(n,e,t,r,o,a+1,i,u,f,p)}catch(K){f(K)}},g=>{f(g)})}catch(g){f(g)}}function U(n,e,t,r,o,a,i,u,f){try{if(t.length()<=o)return void i(w);r.value=a==="k"?t.get(o):o,c(n,e.body).then(p=>{p instanceof y?i(p):p===S?i(w):++f>P?(f=0,setTimeout(()=>{U(n,e,t,r,o+1,a,i,u,f)},0)):U(n,e,t,r,o+1,a,i,u,f)},p=>{u(p)})}catch(p){u(p)}}function V(n,e,t,r,o,a){try{if(a===void 0&&(a="i"),t.length===0)return void r.resolve(w);T(n,e,t,t.length,o,0,a,i=>{r.resolve(i)},i=>{r.reject(i)},0)}catch(i){r.reject(i)}}function Ne(n,e,t,r,o,a){try{if(a===void 0&&(a="i"),t.length===0)return void r.resolve(w);U(n,e,t,o,0,a,i=>{r.resolve(i)},i=>{r.reject(i)},0)}catch(i){r.reject(i)}}function Oe(n,e,t,r,o){try{V(n,e,t.keys(),r,o,"k")}catch(a){r.reject(a)}}function W(n,e,t,r,o,a,i,u){try{n.next().then(f=>{try{if(f===null)a(w);else{const p=ee.createFromGraphicLikeObject(f.geometry,f.attributes,r,e.timeReference);p._underlyingGraphic=f,o.value=p,c(e,t.body).then(g=>{try{g===S?a(w):g instanceof y?a(g):++u>P?(u=0,setTimeout(()=>{W(n,e,t,r,o,a,i,u)},0)):W(n,e,t,r,o,a,i,u)}catch(K){i(K)}},g=>{i(g)})}}catch(p){i(p)}},f=>{i(f)})}catch(f){i(f)}}async function ke(n,e){return new Promise((t,r)=>{c(n,e.right).then(o=>{try{let a=null;a=e.left.type==="VariableDeclaration"?c(n,e.left):Promise.resolve(),a.then(()=>{try{let i="";if(e.left.type==="VariableDeclaration"){const f=e.left.declarations[0].id;f.type==="Identifier"&&(i=f.name)}else e.left.type==="Identifier"&&(i=e.left.name);if(!i)throw new l(n,s.InvalidIdentifier,e);i=i.toLowerCase();let u=null;if(n.localScope!=null&&n.localScope[i]!==void 0&&(u=n.localScope[i]),u===null&&n.globalScope[i]!==void 0&&(u=n.globalScope[i]),u===null)return void r(new l(n,s.InvalidIdentifier,e));B(o)||h(o)?V(n,e,o,{reject:r,resolve:t},u):j(o)?Ne(n,e,o,{reject:r,resolve:t},u):o instanceof R||M(o)?Oe(n,e,o,{reject:r,resolve:t},u):me(o)?W(o.iterator(n.abortSignal),n,e,o,u,f=>{t(f)},f=>{r(f)},0):V(n,e,[],{reject:r,resolve:t},u)}catch(i){r(i)}},r)}catch(a){r(a)}},r)})}async function Ee(n,e){const t=e.argument;if(t.type==="MemberExpression"){const a={t:null},i=await c(n,t.object);let u=null;a.t=i,t.computed===!0?u=await c(n,t.property):t.property.type==="Identifier"&&(u=t.property.name);const f=a.t;let p;if(B(f)){if(!F(u))throw new l(n,s.ArrayAccessorMustBeNumber,e);if(u<0&&(u=f.length+u),u<0||u>=f.length)throw new l(n,s.OutOfBounds,e);p=d(f[u]),f[u]=e.operator==="++"?p+1:p-1}else if(f instanceof R){if(h(u)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(f.hasField(u)!==!0)throw new l(n,s.FieldNotFound,e,{key:u});p=d(f.field(u)),f.setField(u,e.operator==="++"?p+1:p-1)}else if(f instanceof C){if(h(u)===!1)throw new l(n,s.ModuleAccessorMustBeString,e);if(f.hasGlobal(u)!==!0)throw new l(n,s.ModuleExportNotFound,e);p=d(await f.global(u)),f.setGlobal(u,e.operator==="++"?p+1:p-1)}else{if(!M(f))throw j(f)?new l(n,s.Immutable,e):new l(n,s.InvalidParameter,e);if(h(u)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(f.hasField(u)!==!0)throw new l(n,s.FieldNotFound,e,{key:u});p=d(f.field(u)),f.setField(u,e.operator==="++"?p+1:p-1)}return e.prefix===!1?p:e.operator==="++"?p+1:p-1}const r=e.argument.type==="Identifier"?e.argument.name.toLowerCase():"";if(!r)throw new l(n,s.InvalidIdentifier,e);let o;if(n.localScope!=null&&n.localScope[r]!==void 0)return o=d(n.localScope[r].value),n.localScope[r]={value:e.operator==="++"?o+1:o-1,valueset:!0,node:e},e.prefix===!1?o:e.operator==="++"?o+1:o-1;if(n.globalScope[r]!==void 0)return o=d(n.globalScope[r].value),n.globalScope[r]={value:e.operator==="++"?o+1:o-1,valueset:!0,node:e},e.prefix===!1?o:e.operator==="++"?o+1:o-1;throw new l(n,s.InvalidIdentifier,e)}function b(n,e,t,r,o){switch(e){case"=":return n===w?null:n;case"/=":return d(t)/d(n);case"*=":return d(t)*d(n);case"-=":return d(t)-d(n);case"+=":return h(t)||h(n)?L(t)+L(n):d(t)+d(n);case"%=":return d(t)%d(n);default:throw new l(o,s.UnsupportedOperator,r)}}async function Be(n,e){const t=e.left;if(t.type==="MemberExpression"){const o=await c(n,t.object);let a=null;if(t.computed===!0)a=await c(n,t.property);else{if(t.property.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);a=t.property.name}const i=await c(n,e.right);if(B(o)){if(!F(a))throw new l(n,s.ArrayAccessorMustBeNumber,e);if(a<0&&(a=o.length+a),a<0||a>o.length)throw new l(n,s.OutOfBounds,e);if(a===o.length){if(e.operator!=="=")throw new l(n,s.OutOfBounds,e);o[a]=b(i,e.operator,o[a],e,n)}else o[a]=b(i,e.operator,o[a],e,n)}else if(o instanceof R){if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(o.hasField(a)===!0)o.setField(a,b(i,e.operator,o.field(a),e,n));else{if(e.operator!=="=")throw new l(n,s.FieldNotFound,e,{key:a});o.setField(a,b(i,e.operator,null,e,n))}}else if(o instanceof C){if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(o.hasGlobal(a)!==!0)throw new l(n,s.ModuleExportNotFound,e);o.setGlobal(a,b(i,e.operator,await o.global(a),e,n))}else{if(!M(o))throw j(o)?new l(n,s.Immutable,e):new l(n,s.InvalidParameter,e);if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(o.hasField(a)===!0)o.setField(a,b(i,e.operator,o.field(a),e,n));else{if(e.operator!=="=")throw new l(n,s.FieldNotFound,e,{key:a});o.setField(a,b(i,e.operator,null,e,n))}}return w}const r=t.name.toLowerCase();if(n.localScope!=null&&n.localScope[r]!==void 0){const o=await c(n,e.right);return n.localScope[r]={value:b(o,e.operator,n.localScope[r].value,e,n),valueset:!0,node:e.right},w}if(n.globalScope[r]!==void 0){const o=await c(n,e.right);return n.globalScope[r]={value:b(o,e.operator,n.globalScope[r].value,e,n),valueset:!0,node:e.right},w}throw new l(n,s.InvalidIdentifier,e)}async function je(n,e){if(e.expression.type==="AssignmentExpression")return c(n,e.expression);if(e.expression.type==="CallExpression"){const r=await c(n,e.expression);return r===w?w:new O(r)}const t=await c(n,e.expression);return t===w?w:new O(t)}async function Pe(n,e){const t=await c(n,e.test);if(t===!0)return c(n,e.consequent);if(t===!1)return e.alternate!==null?c(n,e.alternate):w;throw new l(n,s.BooleanConditionRequired,e)}async function Ke(n,e){return te(n,e,0)}async function te(n,e,t){if(t>=e.body.length)return w;const r=await c(n,e.body[t]);return r instanceof y||r===S||r===E||t===e.body.length-1?r:te(n,e,t+1)}async function qe(n,e){if(e.argument===null)return new y(w);const t=await c(n,e.argument);return new y(t)}async function De(n,e){const t=e.id.name.toLowerCase();return n.globalScope[t]={valueset:!0,node:null,value:new Re(e,n)},w}async function Ge(n,e){var a,i;const t=e.specifiers[0].local.name.toLowerCase(),r=n.libraryResolver.loadLibrary(t);let o=null;return(a=n.libraryResolver._moduleSingletons)!=null&&a.has(r.uri)?o=n.libraryResolver._moduleSingletons.get(r.uri):(o=new C(r),await o.loadModule(n),(i=n.libraryResolver._moduleSingletons)==null||i.set(r.uri,o)),n.globalScope[t]={value:o,valueset:!0,node:e},w}async function Te(n,e){if(await c(n,e.declaration),e.declaration.type==="FunctionDeclaration")n.exports[e.declaration.id.name.toLowerCase()]="function";else if(e.declaration.type==="VariableDeclaration")for(const t of e.declaration.declarations)n.exports[t.id.name.toLowerCase()]="variable";return w}async function re(n,e,t){return t>=e.declarations.length?w:(await c(n,e.declarations[t]),t===e.declarations.length-1||await re(n,e,t+1),w)}async function Ue(n,e){let t=null;if(t=e.init===null?null:await c(n,e.init),n.localScope!==null){if(t===w&&(t=null),e.id.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);const o=e.id.name.toLowerCase();return n.localScope!=null&&(n.localScope[o]={value:t,valueset:!0,node:e.init}),w}if(e.id.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);const r=e.id.name.toLowerCase();return t===w&&(t=null),n.globalScope[r]={value:t,valueset:!0,node:e.init},w}async function Ve(n,e){const t=await c(n,e.object);if(t===null)throw new l(n,s.MemberOfNull,e);if(e.computed===!1){if(e.property.type==="Identifier"){if(t instanceof R||M(t))return t.field(e.property.name);if(t instanceof Z)return J(t,e.property.name,n,e);if(t instanceof C){if(!t.hasGlobal(e.property.name))throw new l(n,s.InvalidIdentifier,e);return t.global(e.property.name)}throw new l(n,s.InvalidMemberAccessKey,e)}throw new l(n,s.InvalidMemberAccessKey,e)}let r=await c(n,e.property);if(t instanceof R||M(t)){if(h(r))return t.field(r);throw new l(n,s.InvalidMemberAccessKey,e)}if(t instanceof C){if(h(r))return t.global(r);throw new l(n,s.InvalidMemberAccessKey,e)}if(t instanceof Z){if(h(r))return J(t,r,n,e);throw new l(n,s.InvalidMemberAccessKey,e)}if(B(t)){if(F(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length+r),r>=t.length||r<0)throw new l(n,s.OutOfBounds,e);return t[r]}throw new l(n,s.InvalidMemberAccessKey,e)}if(j(t)){if(F(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length()+r),r>=t.length()||r<0)throw new l(n,s.OutOfBounds,e);return t.get(r)}throw new l(n,s.InvalidMemberAccessKey,e)}if(h(t)){if(F(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length+r),r>=t.length||r<0)throw new l(n,s.OutOfBounds,e);return t[r]}throw new l(n,s.InvalidMemberAccessKey,e)}throw new l(n,s.InvalidMemberAccessKey,e)}async function We(n,e){const t=await c(n,e.argument);if(I(t)){if(e.operator==="!")return!t;if(e.operator==="-")return-1*d(t);if(e.operator==="+")return 1*d(t);if(e.operator==="~")return~d(t);throw new l(n,s.UnsupportedUnaryOperator,e)}if(e.operator==="-")return-1*d(t);if(e.operator==="+")return 1*d(t);if(e.operator==="~")return~d(t);throw new l(n,s.UnsupportedUnaryOperator,e)}async function _e(n,e){const t=[];for(let r=0;r>":case">>>":case"^":case"&":return ye(d(r),d(o),e.operator);case"==":return D(r,o);case"!=":return!D(r,o);case"<":case">":case"<=":case">=":return ge(r,o,e.operator);case"+":return h(r)||h(o)?L(r)+L(o):d(r)+d(o);case"-":return d(r)-d(o);case"*":return d(r)*d(o);case"/":return d(r)/d(o);case"%":return d(r)%d(o);default:throw new l(n,s.UnsupportedOperator,e)}}async function ze(n,e){const t=await c(n,e.left);let r=null;if(!I(t))throw new l(n,s.LogicalExpressionOnlyBoolean,e);switch(e.operator){case"||":if(t===!0)return t;if(r=await c(n,e.right),I(r))return r;throw new l(n,s.LogicExpressionOrAnd,e);case"&&":if(t===!1)return t;if(r=await c(n,e.right),I(r))return r;throw new l(n,s.LogicExpressionOrAnd,e);default:throw new l(n,s.LogicExpressionOrAnd,e)}}async function z(n,e){const t=e.name.toLowerCase();if(n.localScope!=null&&n.localScope[t]!==void 0){const r=n.localScope[t];if(r.valueset===!0)return r.value;if(r.d!==null)return r.d;r.d=c(n,r.node);const o=await r.d;return r.value=o,r.valueset=!0,o}if(n.globalScope[t]!==void 0){const r=n.globalScope[t];if(r.valueset===!0)return r.value;if(r.d!==null)return r.d;r.d=c(n,r.node);const o=await r.d;return r.value=o,r.valueset=!0,o}throw new l(n,s.InvalidIdentifier,e)}async function Je(n,e){if(e.callee.type==="MemberExpression"){const t=await c(n,e.callee.object);if(!(t instanceof C))throw new l(n,s.FunctionNotFound,e);const r=e.callee.computed===!1?e.callee.property.name:await c(n,e.callee.property);if(!t.hasGlobal(r))throw new l(n,s.FunctionNotFound,e);const o=await t.global(r);if(!v(o))throw new l(n,s.CallNonFunction,e);return o.call(n,e)}if(e.callee.type!=="Identifier")throw new l(n,s.FunctionNotFound,e);if(n.localScope!=null&&n.localScope[e.callee.name.toLowerCase()]!==void 0){const t=n.localScope[e.callee.name.toLowerCase()];if(v(t.value))return t.value.call(n,e);throw new l(n,s.CallNonFunction,e)}if(n.globalScope[e.callee.name.toLowerCase()]!==void 0){const t=n.globalScope[e.callee.name.toLowerCase()];if(v(t.value))return t.value.call(n,e);throw new l(n,s.CallNonFunction,e)}throw new l(n,s.FunctionNotFound,e)}async function Qe(n,e){return e.value?e.value.cooked:""}function Ze(n,e,t){if(v(n))throw new l(e,s.NoFunctionInTemplateLiteral,t);return n}async function He(n,e){const t=[];for(let a=0;aI&&(f=n-I,n=I);let u=0;t>12?(u=t-12,t=12):t<1&&(u=t-1,t=1);let h=0;r>59?(h=r-59,r=59):r<0&&(h=r,r=0);let T=0;s>59?(T=s-59,s=59):s<0&&(T=s,s=0);let w=0;d>999?(w=d-999,d=999):d<0&&(w=d,d=0);let o=c.fromObject({day:n,year:e,month:t,hour:m,minute:r,second:s,millisecond:d},{zone:y(D)});return u!==0&&(o=o.plus({months:u})),f!==0&&(o=o.plus({days:f})),h!==0&&(o=o.plus({minutes:h})),T!==0&&(o=o.plus({seconds:T})),w!==0&&(o=o.plus({milliseconds:w})),new a(o)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const n=y(t);return e.isUnknownTimeZone||n===l.instance?a.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,n):new a(e._date.setZone(t))}static dateJSToArcadeDate(e){return new a(c.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){return new a(c.fromJSDate(e,{zone:t}))}static unknownEpochToArcadeDate(e){return new a(c.fromMillis(e,{zone:l.instance}))}static unknownDateJSToArcadeDate(e){return new a(c.fromMillis(e.getTime(),{zone:l.instance}))}static epochToArcadeDate(e,t="system"){return new a(c.fromMillis(e,{zone:t}))}static dateTimeToArcadeDate(e){return new a(e)}clone(){return new a(this._date)}changeTimeZone(e){const t=y(e);return a.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const n=y(t);return e.zone===l.instance||n===l.instance?a.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,n):new a(e.setZone(n))}static nowToArcadeDate(e){return new a(c.fromJSDate(new Date,{zone:e}))}static nowUTCToArcadeDate(){return new a(c.utc())}get isSystem(){return this.timeZone==="system"||this.timeZone===a.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===l.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if(this._date.zone.type==="system")return"system";const e=this.zone;return e.type==="fixed"?e.fixed===0?"utc":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new a(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toFormat(e,t){return this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLString(){return"timestamp '"+this._date.toFormat("yyyy-LL-dd HH:mm:ss")+"'"}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new a(this._date.toUTC())}toLocal(){return new a(this._date.toLocal())}toString(){return this.toISOString(!0)}};function y(i){if(i instanceof b)return i;if(i.toLowerCase()==="system")return"system";if(i.toLowerCase()==="utc")return"utc";if(i.toLowerCase()==="unknown")return l.instance;if(/^[\+\-]?[0-9]{1,2}([:][0-9]{2})?$/.test(i)){const t=$.parseSpecifier("UTC"+(i.startsWith("+")||i.startsWith("-")?"":"+")+i);if(t)return t}const e=v.create(i);if(!e.isValid)throw new Z(_.TimeZoneNotRecognised);return e}function q(i){return i!=null&&i.timeZoneIANA?i==null?void 0:i.timeZoneIANA:i!=null&&i.timeZone?W(i,""):""}class R{constructor(){this.dateTimeReferenceMetaData=null,this._fieldTimeZoneIndex={},this._fieldIndex=null,this._ianaPreferred=null,this._ianaTimeInfo=null,this._ianaEditFields=null,this._ianaLayerDateFields=null}static create(e,t){const n=new R;return n.dateTimeReferenceMetaData=t,n._fieldIndex=e instanceof E?e:new E(e),n}static createFromLayer(e){var n,m,r,s;if(!e)return null;if(!e.fieldsIndex)return!e.declaredClass&&e.fields?R.create(e.fields,e):null;const t=new R;return t._fieldIndex=e.fieldsIndex,t.dateTimeReferenceMetaData={timeInfo:((n=e==null?void 0:e.timeInfo)==null?void 0:n.toJSON())??null,editFieldsInfo:((m=e==null?void 0:e.editFieldsInfo)==null?void 0:m.toJSON())??null,dateFieldsTimeReference:((r=e==null?void 0:e.dateFieldsTimeReference)==null?void 0:r.toJSON())??null,preferredTimeReference:((s=e==null?void 0:e.preferredTimeReference)==null?void 0:s.toJSON())??null,datesInUnknownTimezone:(e==null?void 0:e.datesInUnknownTimezone)===!0},t}fieldTimeZone(e){var s,d,D,f,I,u,h,T,w,o,F,N,k,S,A,M,p,z,U,O,J,x,L;const t=(s=this._fieldIndex)==null?void 0:s.get(e);if(!t||t.type!=="date"&&t.type!=="esriFieldTypeDate")return null;const n=this._fieldTimeZoneIndex[t.name];if(n!==void 0)return n;const m=[{field:(D=(d=this.dateTimeReferenceMetaData)==null?void 0:d.editFieldsInfo)==null?void 0:D.creationDateField,timeReference:(I=(f=this.dateTimeReferenceMetaData)==null?void 0:f.editFieldsInfo)==null?void 0:I.dateFieldsTimeReference,isunknown:((u=this.dateTimeReferenceMetaData)==null?void 0:u.datesInUnknownTimezone)===!0},{field:(T=(h=this.dateTimeReferenceMetaData)==null?void 0:h.editFieldsInfo)==null?void 0:T.editDateField,timeReference:(o=(w=this.dateTimeReferenceMetaData)==null?void 0:w.editFieldsInfo)==null?void 0:o.dateFieldsTimeReference,isunknown:((F=this.dateTimeReferenceMetaData)==null?void 0:F.datesInUnknownTimezone)===!0},{field:(k=(N=this.dateTimeReferenceMetaData)==null?void 0:N.timeInfo)==null?void 0:k.startTimeField,timeReference:(A=(S=this.dateTimeReferenceMetaData)==null?void 0:S.timeInfo)==null?void 0:A.timeReference,isunknown:((M=this.dateTimeReferenceMetaData)==null?void 0:M.datesInUnknownTimezone)===!0},{field:(z=(p=this.dateTimeReferenceMetaData)==null?void 0:p.timeInfo)==null?void 0:z.endTimeField,timeReference:(O=(U=this.dateTimeReferenceMetaData)==null?void 0:U.timeInfo)==null?void 0:O.timeReference,isunknown:((J=this.dateTimeReferenceMetaData)==null?void 0:J.datesInUnknownTimezone)===!0}];for(const g of m)if(g.field===t.name){const C=this.convertToIANA(g.timeReference,g.isunknown);return this._fieldTimeZoneIndex[t.name]=C,C}const r=this.convertToIANA((x=this.dateTimeReferenceMetaData)==null?void 0:x.dateFieldsTimeReference,(L=this.dateTimeReferenceMetaData)==null?void 0:L.datesInUnknownTimezone);return this._fieldTimeZoneIndex[t.name]=r,r}convertToIANA(e,t){return t?"unknown":q(e)}get layerPreferredTimeZone(){var t,n;if(this._ianaPreferred!==null)return this._ianaPreferred;this._ianaPreferred="";const e=(t=this.dateTimeReferenceMetaData)==null?void 0:t.preferredTimeReference;return this._ianaPreferred=this.convertToIANA(e,((n=this.dateTimeReferenceMetaData)==null?void 0:n.datesInUnknownTimezone)===!0),this._ianaPreferred}get layerTimeInfoTimeZone(){var t,n;if(this._ianaTimeInfo!==null)return this._ianaTimeInfo;this._ianaTimeInfo="";const e=(n=(t=this.dateTimeReferenceMetaData)==null?void 0:t.timeInfo)==null?void 0:n.timeReference;return this._ianaTimeInfo=this.convertToIANA(e,!1),this._ianaTimeInfo}get layerEditFieldsTimeZone(){var t,n,m;if(this._ianaEditFields!==null)return this._ianaEditFields;this._ianaEditFields="";const e=(n=(t=this.dateTimeReferenceMetaData)==null?void 0:t.editFieldsInfo)==null?void 0:n.dateFieldsTimeReference;return this._ianaEditFields=this.convertToIANA(e,(m=this.dateTimeReferenceMetaData)==null?void 0:m.datesInUnknownTimezone),this._ianaEditFields}get layerDateFieldsTimeZone(){var t,n;if(this._ianaLayerDateFields!==null)return this._ianaLayerDateFields;this._ianaLayerDateFields="";const e=(t=this.dateTimeReferenceMetaData)==null?void 0:t.dateFieldsTimeReference;return this._ianaLayerDateFields=this.convertToIANA(e,((n=this.dateTimeReferenceMetaData)==null?void 0:n.datesInUnknownTimezone)===!0),this._ianaLayerDateFields}}export{R as T,Q as c,y as u}; diff --git a/assets/arcadeUtils-b902d678.js b/assets/arcadeUtils-b902d678.js new file mode 100644 index 0000000..db5b904 --- /dev/null +++ b/assets/arcadeUtils-b902d678.js @@ -0,0 +1,163 @@ +import{aY as Ue,c7 as q,cq as ra,ca as fe,ak as ae,c8 as ie,c9 as xe,fB as T,ee as zn,gY as nt,sP as Jr,fC as Vr,bZ as ia,cs as de,er as aa,oH as or,cZ as sa,fI as Zr,b9 as jn,c3 as ua,bc as It,aw as Ne,at as oa,cn as Hr,cl as la}from"./index-080e108a.js";import{c as j,u as ca,T as lr}from"./arcadeTimeUtils-e1438cc8.js";import{s as fa,p as Wr}from"./number-e5825aa4.js";import{t as f,e as c,a as ue,c as sn,p as un,l as on,u as ha}from"./executionError-c92d3b85.js";import{i as da}from"./hash-6f442295.js";let kt=class{constructor(t){this.source=t}},Ze=class{constructor(){}};function at(e,t,n){if(e instanceof Ze&&!(e instanceof Le)){const r=new Le;return r.fn=e,r.parameterEvaluator=n,r.context=t,r}return e}let He=class extends Ze{constructor(t){super(),this.fn=t}createFunction(t){return(...n)=>this.fn(t,{preparsed:!0,arguments:n})}call(t,n){return this.fn(t,n)}marshalledCall(t,n,r,a){return a(t,n,(u,s,i)=>{i=i.map(l=>l instanceof Ze&&!(l instanceof Le)?at(l,t,a):l);const o=this.call(r,{args:i});return Ue(o)?o.then(l=>at(l,r,a)):o})}},Le=class extends Ze{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(t){return this.fn.createFunction(this.context)}call(t,n){return this.fn.marshalledCall(t,n,this.context,this.parameterEvaluator)}marshalledCall(t,n,r){return this.fn.marshalledCall(t,n,this.context,this.parameterEvaluator)}},se=class{constructor(t=[]){this._elements=t}length(){return this._elements.length}get(t){return this._elements[t]}toArray(){const t=[];for(let n=0;nn)throw new f(r,c.WrongNumberOfParameters,a)}function vn(e){return e<0?-Math.round(-e):Math.round(e)}function tt(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g,t=>{const n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(t==="x"?n:3&n|8).toString(16)})}function Zn(e,t){return isNaN(e)||t==null||t===""?e.toString():(t=ze(t,"‰",""),t=ze(t,"¤",""),fa(e,{pattern:t}))}function Kt(e,t){return t==null||t===""?e.toISOString(!0):e.toFormat(Hn(t),{locale:zn(),numberingSystem:"latn"})}function Hn(e){e=e.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let t="";const n=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of e.match(n)||[])switch(r){case"D":t+="d";break;case"DD":t+="dd";break;case"DDD":t+="o";break;case"d":t+="c";break;case"ddd":t+="ccc";break;case"dddd":t+="cccc";break;case"M":t+="L";break;case"MM":t+="LL";break;case"MMM":t+="LLL";break;case"MMMM":t+="LLLL";break;case"YY":t+="yy";break;case"Y":case"YYYY":t+="yyyy";break;case"Q":t+="q";break;case"Z":t+="ZZ";break;case"ZZ":t+="ZZZ";break;case"S":t+="'S'";break;case"SS":t+="'SS'";break;case"SSS":t+="u";break;case"A":case"a":t+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":t+=r;break;default:r.length>=2&&r.slice(0,1)==="["&&r.slice(-1)==="]"?t+=`'${r.slice(1,-1)}'`:t+=`'${r}'`}return t}function W(e,t,n){switch(n){case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t}return!1}function Wn(e,t,n){if(e===null){if(t===null||t===C)return W(null,null,n);if(G(t))return W(0,t,n);if(b(t)||U(t))return W(0,m(t),n);if(H(t))return W(0,t.toNumber(),n)}if(e===C){if(t===null||t===C)return W(null,null,n);if(G(t))return W(0,t,n);if(b(t)||U(t))return W(0,m(t),n);if(H(t))return W(0,t.toNumber(),n)}else if(G(e)){if(G(t))return W(e,t,n);if(U(t))return W(e,m(t),n);if(t===null||t===C)return W(e,0,n);if(b(t))return W(e,m(t),n);if(H(t))return W(e,t.toNumber(),n)}else if(b(e)){if(b(t))return W(A(e),A(t),n);if(H(t))return W(m(e),t.toNumber(),n);if(G(t))return W(m(e),t,n);if(t===null||t===C)return W(m(e),0,n);if(U(t))return W(m(e),m(t),n)}else if(H(e)){if(H(t))return W(e.toNumber(),t.toNumber(),n);if(t===null||t===C)return W(e.toNumber(),0,n);if(G(t))return W(e.toNumber(),t,n);if(U(t)||b(t))return W(e.toNumber(),m(t),n)}else if(U(e)){if(U(t))return W(e,t,n);if(G(t))return W(m(e),m(t),n);if(H(t))return W(m(e),t.toNumber(),n);if(t===null||t===C)return W(m(e),0,n);if(b(t))return W(m(e),m(t),n)}return!!Fe(e,t)&&(n==="<="||n===">=")}function Fe(e,t){if(e===t||e===null&&t===C||t===null&&e===C)return!0;if(H(e)&&H(t))return e.equals(t);if(e instanceof En||e instanceof Ke)return e.equalityTest(t);if(e instanceof q&&t instanceof q){const n=e.cache._arcadeCacheId,r=t.cache._arcadeCacheId;if(n!=null)return n===r}return!!(bn(e)&&bn(t)&&(e._arcadeCacheId===t._arcadeCacheId&&e._arcadeCacheId!==void 0&&e._arcadeCacheId!==null||e._underlyingGraphic===t._underlyingGraphic&&e._underlyingGraphic!==void 0&&e._underlyingGraphic!==null))}function A(e,t){if(b(e))return e;if(e===null)return"";if(G(e))return Zn(e,t);if(U(e))return e.toString();if(H(e))return Kt(e,t);if(e instanceof T)return JSON.stringify(e.toJSON());if(B(e)){const n=[];for(let r=0;rr.key===a.key?0:r.key==="spatialReference"?1:a.key==="spatialReference"||r.keya.key?1:0);if(B(e)){const r=[];for(let a=0;a0)return e;return null}if(e instanceof ie){if(e.paths.length===0)return null;for(const t of e.paths)if(t.length>0)return e;return null}return e instanceof xe?e.points.length===0?null:e:e instanceof fe?e.xmin==="NaN"||e.xmin===null||isNaN(e.xmin)?null:e:null}function ti(e,t){if(!e||!e.domain)return t;let n=null,r=null;if(e.field.type==="string"||e.field.type==="esriFieldTypeString")n=A(t);else{if(t==null)return null;if(t==="")return t;n=m(t)}for(let a=0;ai.id===r&&(a=i.domains&&i.domains[s.name],a&&a.type==="inherited"&&(a=Dr(s.name,t),u=!0),!0)),u||a||(a=Dr(e,t)),{field:s,domain:a}}function Dr(e,t){let n;return t.fields.some(r=>(r.name.toLowerCase()===e.toLowerCase()&&(n=r.domain),!!n)),n}function Sn(e,t){t||(t={}),typeof t=="function"&&(t={cmp:t});const n=typeof t.cycles=="boolean"&&t.cycles,r=t.cmp&&(a=t.cmp,function(s){return function(i,o){const l={key:i,value:s[i]},d={key:o,value:s[o]};return a(l,d)}});var a;const u=[];return function s(i){if(i&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let o,l;if(Array.isArray(i)){for(l="[",o=0;o0&&(u=e[0].spatialReference,n=e[0].hasZ,r=e[0].hasM)}else if(e instanceof Ke)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,u=e.get(0).spatialReference);else{if(!L(e))throw new f(null,c.InvalidParameter,null);for(const s of e.toArray())ot(a,s);a.length>0&&(u=e.get(0).spatialReference,n=e.get(0).hasZ===!0,r=e.get(0).hasM===!0)}return a.length===0?null:(Jr(a,r,n)||(a=a.slice(0).reverse()),new ae({rings:[a],spatialReference:u,hasZ:n,hasM:r}))}return e}function wt(e,t){if(B(e)||L(e)){let n=!1,r=!1,a=[],u=t;if(B(e)){for(const s of e)ot(a,s);a.length>0&&(u=e[0].spatialReference,n=e[0].hasZ===!0,r=e[0].hasM===!0)}else if(e instanceof Ke)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,u=e.get(0).spatialReference);else if(L(e)){for(const s of e.toArray())ot(a,s);a.length>0&&(u=e.get(0).spatialReference,n=e.get(0).hasZ===!0,r=e.get(0).hasM===!0)}return a.length===0?null:new ie({paths:[a],spatialReference:u,hasZ:n,hasM:r})}return e}function Ot(e,t){if(B(e)||L(e)){let n=!1,r=!1,a=[],u=t;if(B(e)){for(const s of e)ot(a,s);a.length>0&&(u=e[0].spatialReference,n=e[0].hasZ===!0,r=e[0].hasM===!0)}else if(e instanceof Ke)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,u=e.get(0).spatialReference);else if(L(e)){for(const s of e.toArray())ot(a,s);a.length>0&&(u=e.get(0).spatialReference,n=e.get(0).hasZ===!0,r=e.get(0).hasM===!0)}return a.length===0?null:new xe({points:a,spatialReference:u,hasZ:n,hasM:r})}return e}function Da(e,t=!1){const n=[];if(e===null)return n;if(B(e)===!0){for(let r=0;r{setTimeout(()=>{t(e)},0)})):e}function Kn(e,t,n){switch(n){case"&":return e&t;case"|":return e|t;case"^":return e^t;case"<<":return e<>":return e>>t;case">>>":return e>>>t}}function je(e,t=null){return e==null?null:U(e)||G(e)||b(e)?e:e instanceof T?(t==null?void 0:t.keepGeometryType)===!0?e:e.toJSON():e instanceof se?e.toArray().map(n=>je(n,t)):e instanceof Array?e.map(n=>je(n,t)):zt(e)?e:H(e)?e.toJSDate():e!==null&&typeof e=="object"&&e.castAsJson!==void 0?e.castAsJson(t):null}async function ya(e,t,n,r,a){const u=await Yn(e,t,n);a[r]=u}async function Yn(e,t=null,n=null){if(e instanceof se&&(e=e.toArray()),e==null)return null;if(Re(e)||e instanceof T||zt(e)||H(e))return je(e,n);if(e instanceof Array){const r=[],a=[];for(const u of e)u===null||Re(u)||u instanceof T||zt(u)||H(u)?a.push(je(u,n)):(a.push(null),r.push(ya(u,t,n,a.length-1,a)));return r.length>0&&await Promise.all(r),a}return e!==null&&typeof e=="object"&&e.castAsJsonAsync!==void 0?e.castAsJsonAsync(t,n):null}function _t(e){return ri(e)?e.parent:e}function ri(e){return e&&"declaredClass"in e&&e.declaredClass==="esri.layers.support.SubtypeSublayer"}function wa(e){return e&&"declaredClass"in e&&e.declaredClass==="esri.layers.SubtypeGroupLayer"}function ii(e,t,n){const r=_t(e.fullSchema());return r===null||!r.fields?null:Yt(t,r,e,n)}function Pt(e){const t=_t(e.fullSchema());return t===null?null:t.fields&&t.typeIdField?{subtypeField:t.typeIdField,subtypes:t.types?t.types.map(n=>({name:n.name,code:n.id})):[]}:null}function ai(e,t,n,r){const a=_t(e.fullSchema());if(a===null||!a.fields)return null;const u=Yt(t,a,e,r);if(n===void 0)try{n=e.field(t)}catch{return null}return ti(u,n)}function si(e,t,n,r){const a=_t(e.fullSchema());if(a===null||!a.fields)return null;if(n===void 0){try{n=e.field(t)}catch{return null}return n}return ni(Yt(t,a,e,r),n)}function $(e){var t;return((t=e==null?void 0:e.timeReference)==null?void 0:t.timeZone)??"system"}function ui(e){const t=_t(e.fullSchema());if(t===null||!t.fields)return null;const n=[];for(const r of t.fields)n.push(ma(r));return{objectIdField:t.objectIdField,globalIdField:t.globalIdField??"",geometryType:mr[t.geometryType]===void 0?"":mr[t.geometryType],fields:n}}function oi(e,t){return e==="system"&&(e=j.systemTimeZoneCanonicalName),{version:li,engineVersion:Vr,timeZone:e,spatialReference:t.toJSON(),application:ia.applicationName??"",engine:"web",locale:zn()}}const li="1.23",ci=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:st,ImplicitResultE:Qr,ReturnResult:me,ReturnResultE:Xr,absRound:vn,arcadeVersion:li,autoCastArrayOfPointsToMultiPoint:Ot,autoCastArrayOfPointsToPolygon:In,autoCastArrayOfPointsToPolyline:wt,autoCastFeatureToGeometry:P,binaryOperator:Kn,breakResult:Ee,castAsJson:je,castAsJsonAsync:Yn,continueResult:ht,defaultExecutingContext:oi,defaultTimeZone:$,defaultUndefined:M,equalityTest:Fe,featureDomainCodeLookup:si,featureDomainValueLookup:ai,featureFullDomain:ii,featureSchema:ui,featureSubtypes:Pt,fixNullGeometry:Je,fixSpatialReference:ee,formatDate:Kt,formatNumber:Zn,generateUUID:tt,getDomain:Yt,getDomainCode:ni,getDomainValue:ti,getType:Jn,greaterThanLessThan:Wn,isArray:B,isBoolean:U,isDate:H,isDictionary:ei,isFeature:Q,isFeatureSet:Bt,isFeatureSetCollection:Tt,isFunctionParameter:K,isGeometry:Vn,isImmutableArray:L,isInteger:_e,isJsDate:zt,isModule:qn,isNumber:G,isObject:bn,isSimpleType:Re,isString:b,isSubtypeGrouplayer:wa,isSubtypeSublayer:ri,multiReplace:ze,pcCheck:D,stableStringify:Sn,standardiseDateFormat:Hn,tick:ga,toBoolean:ut,toDate:X,toNumber:m,toNumberArray:qe,toString:A,toStringArray:Da,toStringExplicit:pe,voidOperation:C},Symbol.toStringTag,{value:"Module"}));function xa(e){fi=e}let fi;function Et(e){return e===null?null:H(e)?e.clone():Re(e)?e:Vn(e)?e.clone():L(e)?e.toArray().map(t=>Et(t)):B(e)?e.map(t=>Et(t)):Q(e)?fi.createFromArcadeFeature(e):Tt(e)||Bt(e)?e:ei(e)||(e==null?void 0:e.declaredClass)==="esri.arcade.Attachment"?e.deepClone():((e==null?void 0:e.declaredClass)==="esri.arcade.Portal"||e instanceof kt||K(e),e)}function qt(e,t,n=!1,r=!1){if(e==null)return null;if(G(e))return m(e);if(U(e))return ut(e);if(b(e))return A(e);if(H(e))return X(e,t);if(B(e)){const u=[];for(const s of e)u.push(qt(s,t,n,r));return u}if(r&&Vn(e))return e;const a=new k;a.immutable=!1;for(const u of Object.keys(e)){const s=e[u];s!==void 0&&a.setField(u,qt(s,t,n,r))}return a.immutable=n,a}let k=class Ut{constructor(t){this.declaredClass="esri.arcade.Dictionary",this.attributes=null,this.plain=!1,this.immutable=!0,this.attributes=t instanceof Ut?t.attributes:t??{}}field(t){const n=t.toLowerCase(),r=this.attributes[t];if(r!==void 0)return r;for(const a in this.attributes)if(a.toLowerCase()===n)return this.attributes[a];throw new f(null,c.FieldNotFound,null,{key:t})}setField(t,n){if(this.immutable)throw new f(null,c.Immutable,null);if(K(n))throw new f(null,c.NoFunctionInDictionary,null);const r=t.toLowerCase();if(n instanceof Date&&(n=j.dateJSToArcadeDate(n)),this.attributes[t]===void 0){for(const a in this.attributes)if(a.toLowerCase()===r)return void(this.attributes[a]=n);this.attributes[t]=n}else this.attributes[t]=n}hasField(t){const n=t.toLowerCase();if(this.attributes[t]!==void 0)return!0;for(const r in this.attributes)if(r.toLowerCase()===n)return!0;return!1}keys(){let t=[];for(const n in this.attributes)t.push(n);return t=t.sort(),t}castToText(t=!1){let n="";for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":U(a)||G(a)||b(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof T?n+=JSON.stringify(r)+":"+pe(a):a instanceof se||a instanceof Array?n+=JSON.stringify(r)+":"+pe(a,null,t):a instanceof j?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return"{"+n+"}"}static convertObjectToArcadeDictionary(t,n,r=!0,a=!1){const u=new Ut;u.immutable=!1;for(const s in t){const i=t[s];i!==void 0&&u.setField(s.toString(),qt(i,n,r,a))}return u.immutable=r,u}static convertJsonToArcade(t,n,r=!1){return qt(t,n,r)}castAsJson(t=null){const n={};for(let r in this.attributes){const a=this.attributes[r];a!==void 0&&(t!=null&&t.keyTranslate&&(r=t.keyTranslate(r)),n[r]=je(a,t))}return n}async castDictionaryValueAsJsonAsync(t,n,r,a=null,u){const s=await Yn(r,a,u);return t[n]=s,s}async castAsJsonAsync(t=null,n=null){const r={},a=[];for(let u in this.attributes){const s=this.attributes[u];n!=null&&n.keyTranslate&&(u=n.keyTranslate(u)),s!==void 0&&(Re(s)||s instanceof T||s instanceof j?r[u]=je(s,n):a.push(this.castDictionaryValueAsJsonAsync(r,u,s,t,n)))}return a.length>0&&await Promise.all(a),r}deepClone(){const t=new Ut;t.immutable=!1;for(const n of this.keys())t.setField(n,Et(this.field(n)));return t}},Y=class ge{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._optimizedGeomDefinition=null,this._geometry=null,this.attributes=null,this._layer=null,this._datesfixed=!0,this.dateTimeReferenceFieldIndex=null,this.contextTimeReference=null,this.immutable=!0,this._datefields=null,this.immutable=!0}static createFromGraphic(t,n){const r=new ge;return r.contextTimeReference=n??null,r._geometry=t.geometry!=null?t.geometry:null,t.attributes===void 0||t.attributes===null?r.attributes={}:r.attributes=t.attributes,t._sourceLayer?(r._layer=t._sourceLayer,r._datesfixed=!1):t._layer?(r._layer=t._layer,r._datesfixed=!1):t.layer&&"fields"in t.layer?(r._layer=t.layer,r._datesfixed=!1):t.sourceLayer&&"fields"in t.sourceLayer&&(r._layer=t.sourceLayer,r._datesfixed=!1),r._layer&&r._datesfixed===!1&&(r._layer.dateTimeReferenceFieldIndex!==void 0?r.dateTimeReferenceFieldIndex=r._layer.dateTimeReferenceFieldIndex:r.dateTimeReferenceFieldIndex=lr.createFromLayer(r._layer)),r}static createFromArcadeFeature(t){if(t instanceof ge){const r=new ge;return r._datesfixed=t._datesfixed,r.attributes=t.attributes,r._geometry=t._geometry,r._optimizedGeomDefinition=t._optimizedGeomDefinition,t._layer&&(r._layer=t._layer),r.dateTimeReferenceFieldIndex=t.dateTimeReferenceFieldIndex,r.contextTimeReference=t.contextTimeReference,r}const n={};for(const r of t.keys())n[r]=t.field(r);return ge.createFromGraphicLikeObject(t.geometry(),n,t.fullSchema(),t.contextTimeReference)}static createFromOptimisedFeature(t,n,r){const a=new ge;return a._geometry=t.geometry?{geometry:t.geometry}:null,a._optimizedGeomDefinition=r,a.attributes=t.attributes||{},a._layer=n,a._datesfixed=!1,a}static createFromArcadeDictionary(t){const n=new ge;return n.attributes=t.field("attributes"),n.attributes!==null&&n.attributes instanceof k?(n.attributes=n.attributes.attributes,n.attributes===null&&(n.attributes={})):n.attributes={},n._geometry=t.field("geometry"),n._geometry!==null&&(n._geometry instanceof k?n._geometry=ge.parseGeometryFromDictionary(n._geometry):n._geometry instanceof T||(n._geometry=null)),n}static createFromGraphicLikeObject(t,n,r=null,a){const u=new ge;return u.contextTimeReference=a??null,n===null&&(n={}),u.attributes=n,u._geometry=t??null,u._layer=r,u._layer&&(u._datesfixed=!1,u._layer.dateTimeReferenceFieldIndex!==void 0?u.dateTimeReferenceFieldIndex=u._layer.dateTimeReferenceFieldIndex:u.dateTimeReferenceFieldIndex=lr.createFromLayer(u._layer)),u}repurposeFromGraphicLikeObject(t,n,r=null){n===null&&(n={}),this.attributes=n,this._geometry=t??null,this._layer=r,this._layer?this._datesfixed=!1:this._datesfixed=!0}get layerPreferredTimeZone(){var t;return((t=this.dateTimeReferenceFieldIndex)==null?void 0:t.layerPreferredTimeZone)??""}fieldSourceTimeZone(t){var n;return((n=this.dateTimeReferenceFieldIndex)==null?void 0:n.fieldTimeZone(t))??""}castToText(t=!1){let n="";this._datesfixed===!1&&this._fixDates();for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":U(a)||G(a)||b(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof T?n+=JSON.stringify(r)+":"+pe(a):a instanceof se||a instanceof Array?n+=JSON.stringify(r)+":"+pe(a,null,t):a instanceof j?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return'{"geometry":'+(this.geometry()===null?"null":pe(this.geometry()))+',"attributes":{'+n+"}}"}_fixDates(){if(this._datefields!==null)return this._datefields.length>0&&this._fixDateFields(this._datefields),void(this._datesfixed=!0);const t=[],n=this._layer.fields;for(let r=0;r0&&this._fixDateFields(t),this._datesfixed=!0}isUnknownDateTimeField(t){var n;return((n=this.dateTimeReferenceFieldIndex)==null?void 0:n.fieldTimeZone(t))==="unknown"}_fixDateFields(t){var r;this.attributes={...this.attributes};const n=((r=this.contextTimeReference)==null?void 0:r.timeZone)??"system";for(let a=0;a!n&&(a.type==="Identifier"&&a.name&&a.name.toLowerCase()===r&&(n=!0),!0)),n}function di(e){const t=[];return J(e,n=>(n.type==="ImportDeclaration"&&n.source&&n.source.value&&t.push({libname:n.specifiers[0].local.name.toLowerCase(),source:n.source.value}),!0)),t}function Aa(e,t){let n=!1;const r=t.toLowerCase();return J(e,a=>!n&&(a.type!=="CallExpression"||a.callee.type!=="Identifier"||!a.callee.name||a.callee.name.toLowerCase()!==r||(n=!0,!1))),n}function Ea(e){const t=[];return J(e,n=>{var r;return n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&t.push(n.object.name.toLowerCase()+"."+((r=n.property.value)==null?void 0:r.toString().toLowerCase())),!1)}),t}function ba(e){const t=[];return J(e,n=>{var r;if(n.type==="CallExpression"){if(n.callee.type==="Identifier"&&n.callee.name.toLowerCase()==="expects"){let a="";for(let u=0;u<(n.arguments||[]).length;u++)u===0?n.arguments[u].type==="Identifier"&&(a=n.arguments[u].name.toLowerCase()):a&&n.arguments[u].type==="Literal"&&yr(n.arguments[u].value)&&t.push(a+"."+n.arguments[u].value.toLowerCase());return!1}if(n.callee.type==="Identifier"&&["domainname","domaincode","domain","haskey"].includes(n.callee.name.toLowerCase())&&n.arguments.length>=2){let a="";return n.arguments[0].type==="Identifier"&&(a=n.arguments[0].name.toLowerCase()),a&&n.arguments[1].type==="Literal"&&yr(n.arguments[1].value)&&t.push(a+"."+n.arguments[1].value.toLowerCase()),!1}}return n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&t.push(n.object.name.toLowerCase()+"."+((r=n.property.value)==null?void 0:r.toString().toLowerCase())),!1)}),t}function Bn(e){const t=[];return J(e,n=>(n.type==="CallExpression"&&n.callee.type==="Identifier"&&t.push(n.callee.name.toLowerCase()),!0)),t}function Mt(e,t=[]){let n=null;if(e.usesFeatureSet===void 0){n===null&&(n=Bn(e)),e.usesFeatureSet=!1;for(let r=0;r0){for(const r of t)if(hi(e,r)){e.usesFeatureSet=!0,e.isAsync=!0;break}}}if(e.usesModules===void 0&&(e.usesModules=!1,di(e).length>0&&(e.usesModules=!0)),e.usesGeometry===void 0){e.usesGeometry=!1,n===null&&(n=Bn(e));for(let r=0;r0||o.length>0;)if(i.length>0&&o.length>0){let h=l(i[0],o[0]);isNaN(h)&&(h=0),h<=0?(d.push(i[0]),i=i.slice(1)):(d.push(o[0]),o=o.slice(1))}else i.length>0?(d.push(i[0]),i=i.slice(1)):o.length>0&&(d.push(o[0]),o=o.slice(1));return d}async function a(i,o){const l=i.length,d=Math.floor(l/2);if(l===0)return[];if(l===1)return[i[0]];const h=[await a(i.slice(0,d),o),await a(i.slice(d,l),o)];return u(h[0],h[1],o,[])}async function u(i,o,l,d){const h=d;if(!(i.length>0||o.length>0))return d;if(i.length>0&&o.length>0){let p=await l(i[0],o[0]);return isNaN(p)&&(p=1),p<=0?(h.push(i[0]),i=i.slice(1)):(h.push(o[0]),o=o.slice(1)),u(i,o,l,d)}return i.length>0?(h.push(i[0]),u(i=i.slice(1),o,l,d)):o.length>0?(h.push(o[0]),u(i,o=o.slice(1),l,d)):void 0}function s(i,o,l,d){D(l,1,2,i,o);let h=l[0];if(L(h)&&(h=h.toArray()),B(h)===!1)throw new f(i,c.InvalidParameter,o);if(l.length>1){if(K(l[1])===!1)throw new f(i,c.InvalidParameter,o);let I=h;const V=l[1].createFunction(i);return d?a(I,V):(I=n(I,(he,Nt)=>V(he,Nt)),I)}let p=h;if(p.length===0)return[];const g={};for(let I=0;I1||_==="String"?n(p,(I,V)=>{if(I==null||I===C)return V==null||V===C?0:1;if(V==null||V===C)return-1;const he=A(I),Nt=A(V);return heI-V):_==="Boolean"?n(p,(I,V)=>I===V?0:V?-1:1):_==="Date"?n(p,(I,V)=>V-I):p.slice(0),p}e.functions.array=function(i,o){return e.standardFunction(i,o,(l,d,h)=>{if(D(h,0,2,i,o),h.length===0)return new Array;if(h.length===1&&h[0]===null)return new Array;if(B(h[0])){if(h.length===2&&U(h[1])===!1)throw new f(i,c.InvalidParameter,o);return M(h[1],!1)===!0?Et(h[0]):h[0].slice(0)}if(L(h[0])){if(h.length===2&&U(h[1])===!1)throw new f(i,c.InvalidParameter,o);return M(h[1],!1)===!0?Et(h[0]):h[0].toArray().slice(0)}const p=m(h[0]);if(isNaN(p)||_e(p)===!1)throw new f(i,c.InvalidParameter,o);const g=M(h[1],null),w=new Array(p);return w.fill(g),w})},e.functions.front=function(i,o){return e.standardFunction(i,o,(l,d,h)=>{if(D(h,1,1,i,o),L(h[0])){if(h[0].length()<=0)throw new f(i,c.OutOfBounds,o);return h[0].get(0)}if(B(h[0])){if(h[0].length<=0)throw new f(i,c.OutOfBounds,o);return h[0][0]}throw new f(i,c.InvalidParameter,o)})},e.functions.back=function(i,o){return e.standardFunction(i,o,(l,d,h)=>{if(D(h,1,1,i,o),L(h[0])){if(h[0].length()<=0)throw new f(i,c.OutOfBounds,o);return h[0].get(h[0].length()-1)}if(B(h[0])){if(h[0].length<=0)throw new f(i,c.OutOfBounds,o);return h[0][h[0].length-1]}throw new f(i,c.InvalidParameter,o)})},e.functions.push=function(i,o){return e.standardFunction(i,o,(l,d,h)=>{if(D(h,1,2,i,o),B(h[0]))return h[0][h[0].length]=h[1],h[0].length;throw new f(i,c.InvalidParameter,o)})},e.functions.pop=function(i,o){return e.standardFunction(i,o,(l,d,h)=>{if(D(h,1,1,i,o),B(h[0])){if(h[0].length<=0)throw new f(i,c.OutOfBounds,o);const p=h[0][h[0].length-1];return h[0].length=h[0].length-1,p}throw new f(i,c.InvalidParameter,o)})},e.functions.erase=function(i,o){return e.standardFunction(i,o,(l,d,h)=>{if(D(h,2,2,i,o),B(h[0])){let p=m(h[1]);if(isNaN(p)||_e(p)===!1)throw new f(i,c.InvalidParameter,o);const g=h[0];if(g.length<=0)throw new f(i,c.OutOfBounds,o);if(p<0&&(p=g.length+p),p<0)throw new f(i,c.OutOfBounds,o);if(p>=g.length)throw new f(i,c.OutOfBounds,o);return g.splice(p,1),C}throw new f(i,c.InvalidParameter,o)})},e.functions.insert=function(i,o){return e.standardFunction(i,o,(l,d,h)=>{if(D(h,3,3,i,o),B(h[0])){const p=m(h[1]);if(isNaN(p)||_e(p)===!1)throw new f(i,c.InvalidParameter,o);const g=h[2],w=h[0];if(p>w.length)throw new f(i,c.OutOfBounds,o);if(p<0&&p<-1*w.length)throw new f(i,c.OutOfBounds,o);return p===w.length?(w[p]=g,C):(w.splice(p,0,g),C)}throw new f(i,c.InvalidParameter,o)})},e.functions.resize=function(i,o){return e.standardFunction(i,o,(l,d,h)=>{if(D(h,2,3,i,o),B(h[0])){const p=m(h[1]);if(isNaN(p)||_e(p)===!1)throw new f(i,c.InvalidParameter,o);if(p<0)throw new f(i,c.InvalidParameter,o);const g=M(h[2],null),w=h[0];if(w.length>=p)return w.length=p,C;const _=w.length;w.length=p;for(let I=_;I{if(D(h,2,2,i,o),B(h[0])){const p=h[1];return h[0].findIndex(g=>Fe(g,p))>-1}if(L(h[0])){const p=h[1];return h[0].toArray().findIndex(g=>Fe(g,p))>-1}throw new f(i,c.InvalidParameter,o)})},e.functions.slice=function(i,o){return e.standardFunction(i,o,(l,d,h)=>{if(D(h,1,3,i,o),B(h[0])){const p=m(M(h[1],0)),g=m(M(h[2],h[0].length));if(isNaN(p)||_e(p)===!1)throw new f(i,c.InvalidParameter,o);if(isNaN(g)||_e(g)===!1)throw new f(i,c.InvalidParameter,o);return h[0].slice(p,g)}if(L(h[0])){const p=h[0],g=m(M(h[1],0)),w=m(M(h[2],p.length()));if(isNaN(g)||_e(g)===!1)throw new f(i,c.InvalidParameter,o);if(isNaN(w)||_e(w)===!1)throw new f(i,c.InvalidParameter,o);return p.toArray().slice(g,w)}throw new f(i,c.InvalidParameter,o)})},e.functions.splice=function(i,o){return e.standardFunction(i,o,(l,d,h)=>{const p=[];for(let g=0;g{if(D(h,2,2,i,o),B(h[0]))return m(h[1])>=h[0].length?h[0].slice(0):h[0].slice(0,m(h[1]));if(L(h[0]))return m(h[1])>=h[0].length()?h[0].slice(0):h[0].slice(0,m(h[1]));throw new f(i,c.InvalidParameter,o)})},e.functions.first=function(i,o){return e.standardFunction(i,o,(l,d,h)=>(D(h,1,1,i,o),B(h[0])?h[0].length===0?null:h[0][0]:L(h[0])?h[0].length()===0?null:h[0].get(0):null))},e.mode==="sync"&&(e.functions.sort=function(i,o){return e.standardFunction(i,o,(l,d,h)=>s(i,o,h,!1))},e.functions.any=function(i,o){return e.standardFunction(i,o,(l,d,h)=>{D(h,2,2,i,o);const p=h[1].createFunction(i),g=t(h[0],i,o);for(const w of g){const _=p(w);if(U(_)&&_===!0)return!0}return!1})},e.functions.all=function(i,o){return e.standardFunction(i,o,(l,d,h)=>{D(h,2,2,i,o);const p=h[1].createFunction(i),g=t(h[0],i,o);for(const w of g)if(p(w)!==!0)return!1;return!0})},e.functions.none=function(i,o){return e.standardFunction(i,o,(l,d,h)=>{D(h,2,2,i,o);const p=h[1].createFunction(i),g=t(h[0],i,o);for(const w of g)if(p(w)===!0)return!1;return!0})},e.functions.reduce=function(i,o){return e.standardFunction(i,o,(l,d,h)=>{D(h,2,3,i,o);const p=h[1].createFunction(i),g=t(h[0],i,o);return h.length===2?g.length===0?null:g.reduce((w,_)=>{const I=p(w,_);return w=I!==void 0&&I!==C?I:null}):g.reduce((w,_)=>{const I=p(w,_);return w=I!==void 0&&I!==C?I:null},h[2])})},e.functions.map=function(i,o){return e.standardFunction(i,o,(l,d,h)=>{D(h,2,2,i,o);const p=h[1].createFunction(i),g=t(h[0],i,o),w=[];for(const _ of g){const I=p(_);I!==void 0&&I!==C?w.push(I):w.push(null)}return w})},e.functions.filter=function(i,o){return e.standardFunction(i,o,(l,d,h)=>{D(h,2,2,i,o);const p=h[1].createFunction(i),g=t(h[0],i,o),w=[];for(const _ of g)p(_)===!0&&w.push(_);return w})}),e.mode==="async"&&(e.functions.sort=function(i,o){return e.standardFunctionAsync(i,o,(l,d,h)=>s(i,o,h,!0))},e.functions.any=function(i,o){return e.standardFunctionAsync(i,o,async(l,d,h)=>{D(h,2,2,i,o);const p=h[1].createFunction(i),g=t(h[0],i,o);for(const w of g){const _=await p(w);let I=null;if(I=Ue(I)?await _:_,U(I)&&I===!0)return!0}return!1})},e.functions.all=function(i,o){return e.standardFunctionAsync(i,o,async(l,d,h)=>{D(h,2,2,i,o);const p=h[1].createFunction(i),g=t(h[0],i,o);for(const w of g){const _=await p(w);let I=null;if(I=Ue(I)?await _:_,I!==!0)return!1}return!0})},e.functions.none=function(i,o){return e.standardFunctionAsync(i,o,async(l,d,h)=>{D(h,2,2,i,o);const p=h[1].createFunction(i),g=t(h[0],i,o);for(const w of g){const _=await p(w);let I=null;if(I=Ue(I)?await _:_,I===!0)return!1}return!0})},e.functions.filter=function(i,o){return e.standardFunctionAsync(i,o,async(l,d,h)=>{D(h,2,2,i,o);const p=h[1].createFunction(i),g=t(h[0],i,o),w=[];for(const _ of g){const I=await p(_);let V=null;V=Ue(V)?await I:I,V===!0&&w.push(_)}return w})},e.functions.reduce=function(i,o){return e.standardFunctionAsync(i,o,(l,d,h)=>{D(h,2,3,i,o);const p=h[1].createFunction(i),g=t(h[0],i,o);let w=null;if(h.length>2){const _=M(h[2],null);w=g.reduce(async(I,V)=>{let he=await I;return he!==void 0&&he!==C||(he=null),p(he,V)},Promise.resolve(_))}else{if(g.length===0)return null;w=g.reduce(async(_,I,V)=>{if(V<=1)return p(_,I);let he=await _;return he!==void 0&&he!==C||(he=null),p(he,I)})}return w.then(_=>_!==void 0&&_!==C?_:null)})},e.functions.map=function(i,o){return e.standardFunctionAsync(i,o,async(l,d,h)=>{D(h,2,2,i,o);const p=h[1].createFunction(i),g=t(h[0],i,o),w=[];for(const _ of g){const I=await p(_);let V=null;V=Ue(V)?await I:I,V!==void 0&&V!==C?w.push(V):w.push(null)}return w})})}const Tn=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:va},Symbol.toStringTag,{value:"Module"}));function Sa(e,t,n){return e+(Ia(n)?Ba:ka)[t]}function Ia(e){return e%4==0&&(e%100!=0||e%400==0)}const ka=[0,31,59,90,120,151,181,212,243,273,304,334],Ba=[0,31,60,91,121,152,182,213,244,274,305,335];function Ye(e){return e===null?e:e.isValid===!1?null:e}function wr(e,t){return e===""||e.toLowerCase().trim()==="default"?$(t):e}function mi(e,t){e.today=function(n,r){return t(n,r,(a,u,s)=>{D(s,0,0,n,r);const i=new Date;return i.setHours(0,0,0,0),j.dateJSAndZoneToArcadeDate(i,$(n))})},e.changetimezone=function(n,r){return t(n,r,(a,u,s)=>{D(s,2,2,n,r);const i=X(s[0],$(n));if(i===null)return null;const o=j.arcadeDateAndZoneToArcadeDate(i,wr(A(s[1]),n));return o.isValid===!1?null:o})},e.timezone=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,2,n,r);const i=X(s[0],$(n));if(i===null)return null;const o=i.timeZone;return o==="system"?j.systemTimeZoneCanonicalName:o})},e.timezoneoffset=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=X(s[0],$(n));return i===null?null:i.timeZoneOffset})},e.now=function(n,r){return t(n,r,(a,u,s)=>{D(s,0,0,n,r);const i=j.nowToArcadeDate($(n));return i.isValid===!1?null:i})},e.timestamp=function(n,r){return t(n,r,(a,u,s)=>{D(s,0,0,n,r);const i=j.nowUTCToArcadeDate();return i.isValid===!1?null:i})},e.toutc=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=X(s[0],$(n));return i===null?null:i.toUTC()})},e.tolocal=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=X(s[0],$(n));return i===null?null:i.toLocal()})},e.day=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=X(s[0],$(n));return i===null?NaN:i.day})},e.month=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=X(s[0],$(n));return i===null?NaN:i.monthJS})},e.year=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=X(s[0],$(n));return i===null?NaN:i.year})},e.hour=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=X(s[0],$(n));return i===null?NaN:i.hour})},e.second=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=X(s[0],$(n));return i===null?NaN:i.second})},e.millisecond=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=X(s[0],$(n));return i===null?NaN:i.millisecond})},e.minute=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=X(s[0],$(n));return i===null?NaN:i.minute})},e.week=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,2,n,r);const i=X(s[0],$(n));if(i===null)return NaN;const o=m(M(s[1],0));if(o<0||o>6)throw new f(n,c.InvalidParameter,r);const l=i.day,d=i.monthJS,h=i.year,p=i.dayOfWeekJS,g=Sa(l,d,h)-1,w=Math.floor(g/7);return p-o+(p-o<0?7:0){D(s,1,1,n,r);const i=X(s[0],$(n));return i===null?NaN:i.dayOfWeekJS})},e.isoweekday=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=X(s[0],$(n));return i===null?NaN:i.dayOfWeekISO})},e.isomonth=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=X(s[0],$(n));return i===null?NaN:i.monthISO})},e.isoweek=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=X(s[0],$(n));return i===null?NaN:i.weekISO})},e.isoyear=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=X(s[0],$(n));return i===null?NaN:i.yearISO})},e.date=function(n,r){return t(n,r,(a,u,s)=>{if(D(s,0,8,n,r),s.length===3)return Ye(j.fromParts(m(s[0]),m(s[1])+1,m(s[2]),0,0,0,0,$(n)));if(s.length===4)return Ye(j.fromParts(m(s[0]),m(s[1])+1,m(s[2]),m(s[3]),0,0,0,$(n)));if(s.length===5)return Ye(j.fromParts(m(s[0]),m(s[1])+1,m(s[2]),m(s[3]),m(s[4]),0,0,$(n)));if(s.length===6)return Ye(j.fromParts(m(s[0]),m(s[1])+1,m(s[2]),m(s[3]),m(s[4]),m(s[5]),0,$(n)));if(s.length===7)return Ye(j.fromParts(m(s[0]),m(s[1])+1,m(s[2]),m(s[3]),m(s[4]),m(s[5]),m(s[6]),$(n)));if(s.length===8)return Ye(j.fromParts(m(s[0]),m(s[1])+1,m(s[2]),m(s[3]),m(s[4]),m(s[5]),m(s[6]),wr(A(s[7]),n)));if(s.length===2){let i,o=A(s[1]);return o===""?null:(o=Hn(o),i=o==="X"?nt.fromSeconds(m(s[0])):o==="x"?nt.fromMillis(m(s[0])):nt.fromFormat(A(s[0]),o,{locale:zn(),numberingSystem:"latn"}),i.isValid?j.dateTimeToArcadeDate(i):null)}if(s.length===1){if(b(s[0])){if(s[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(s[0])===!0)return X(s[0]+"-01-01",$(n))}const i=m(s[0]);if(isNaN(i)===!1){const o=nt.fromMillis(i);return o.isValid?j.dateTimeAndZoneToArcadeDate(o,$(n)):null}return X(s[0],$(n))}return s.length===0?j.nowToArcadeDate($(n)):null})},e.datediff=function(n,r){return t(n,r,(a,u,s)=>{D(s,2,4,n,r);let i=X(s[0],$(n)),o=X(s[1],$(n));if(i===null||o===null)return NaN;let l=M(s[3],"");switch(l!==""&&l!==null?(l=A(l),i=j.arcadeDateAndZoneToArcadeDate(i,l),o=j.arcadeDateAndZoneToArcadeDate(o,l)):i.timeZone!==o.timeZone&&(i.isUnknownTimeZone?i=j.arcadeDateAndZoneToArcadeDate(i,o.timeZone):o=(o.isUnknownTimeZone,j.arcadeDateAndZoneToArcadeDate(o,i.timeZone))),A(s[2]).toLowerCase()){case"days":case"day":case"d":return i.diff(o,"days");case"months":case"month":return i.diff(o,"months");case"minutes":case"minute":case"m":return s[2]==="M"?i.diff(o,"months"):i.diff(o,"minutes");case"seconds":case"second":case"s":return i.diff(o,"seconds");case"milliseconds":case"millisecond":case"ms":default:return i.diff(o);case"hours":case"hour":case"h":return i.diff(o,"hours");case"years":case"year":case"y":return i.diff(o,"years")}})},e.dateadd=function(n,r){return t(n,r,(a,u,s)=>{D(s,2,3,n,r);const i=X(s[0],$(n));if(i===null)return null;let o=m(s[1]);if(isNaN(o))return i;let l="milliseconds";switch(A(s[2]).toLowerCase()){case"days":case"day":case"d":l="days",o=vn(o);break;case"months":case"month":l="months",o=vn(o);break;case"minutes":case"minute":case"m":l=s[2]==="M"?"months":"minutes";break;case"seconds":case"second":case"s":l="seconds";break;case"milliseconds":case"millisecond":case"ms":l="milliseconds";break;case"hours":case"hour":case"h":l="hours";break;case"years":case"year":case"y":l="years"}return i.plus({[l]:o})})}}function dt(e,t,n){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0))}const pt=[];for(const e of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const t=e[0];for(let n=1;n0?(r.x/=a,r.y/=a,t&&(r.z/=a),n&&(r.m/=a)):(r.x=e[0][0],r.y=e[0][1],t&&(r.z=e[0][2]),n&&t?r.m=e[0][3]:n&&(r.m=e[0][2])),r}function _a(e,t,n,r){const a={x:(e[0]+t[0])/2,y:(e[1]+t[1])/2};return n&&(a.z=(e[2]+t[2])/2),n&&r?a.m=(e[3]+t[3])/2:r&&(a.m=(e[2]+t[2])/2),a}function Ma(e,t){if(e.length<=1)return 0;let n=0;for(let r=1;r0?(n.x/=a,n.y/=a,e.hasZ===!0&&(n.z/=a),e.hasM===!0&&(n.m/=a),new q(n)):r>0?(t.x/=r,t.y/=r,e.hasZ===!0&&(n.z/=r),e.hasM===!0&&(t.m/=r),new q(t)):null}function La(e){if(e.points.length===0)return null;let t=0,n=0,r=0,a=0;for(let s=0;s=r;)e-=t;return e}function Di(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function Pa(e,t){return en(Di(e,t),2*Math.PI)*(180/Math.PI)}function Ua(e,t){return en(Math.PI/2-Di(e,t),2*Math.PI)*(180/Math.PI)}function gi(e,t,n){const r={x:e.x-t.x,y:e.y-t.y},a={x:n.x-t.x,y:n.y-t.y};return Math.atan2(Oa(r,a),Ra(r,a))}function Ga(e,t,n){return en(gi(e,t,n),2*Math.PI)*(180/Math.PI)}function za(e,t,n){return en(-1*gi(e,t,n),2*Math.PI)*(180/Math.PI)}xt[9002]=.3048,xt[9003]=.3048006096012192,xt[9095]=.3048007491;const ne=[0,0];function Fr(e){for(let t=0;t{D(s,1,1,n,r);let i=[],o=!1,l=!1;if(s[0]===null)return!1;if(B(s[0])){for(const d of s[0]){if(!(d instanceof q))throw new f(n,c.InvalidParameter,r);i.push(d.hasZ?d.hasM?[d.x,d.y,d.z,d.m]:[d.x,d.y,d.z]:[d.x,d.y])}i.length>0&&(o=s[0][0].hasZ,l=s[0][0].hasM)}else if(s[0]instanceof Ke)i=s[0]._elements,i.length>0&&(o=s[0]._hasZ,l=s[0]._hasM);else{if(!L(s[0]))throw new f(n,c.InvalidParameter,r);for(const d of s[0].toArray()){if(!(d instanceof q))throw new f(n,c.InvalidParameter,r);i.push(d.hasZ?d.hasM?[d.x,d.y,d.z,d.m]:[d.x,d.y,d.z]:[d.x,d.y])}i.length>0&&(o=s[0].get(0).hasZ,l=s[0].get(0).hasM)}return!(i.length<3)&&Jr(i,l,o)})},e.polygon=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);let i=null;if(s[0]instanceof k){if(i=ee(Y.parseGeometryFromDictionary(s[0]),n.spatialReference),!(i instanceof ae))throw new f(n,c.InvalidParameter,r)}else i=s[0]instanceof ae?de(s[0].toJSON()):ee(new ae(JSON.parse(s[0])),n.spatialReference);if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new f(n,c.WrongSpatialReference,r);return Je(i)})},e.polyline=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);let i=null;if(s[0]instanceof k){if(i=ee(Y.parseGeometryFromDictionary(s[0]),n.spatialReference),!(i instanceof ie))throw new f(n,c.InvalidParameter,r)}else i=s[0]instanceof ie?de(s[0].toJSON()):ee(new ie(JSON.parse(s[0])),n.spatialReference);if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new f(n,c.WrongSpatialReference,r);return Je(i)})},e.point=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);let i=null;if(s[0]instanceof k){if(i=ee(Y.parseGeometryFromDictionary(s[0]),n.spatialReference),!(i instanceof q))throw new f(n,c.InvalidParameter,r)}else i=s[0]instanceof q?de(s[0].toJSON()):ee(new q(JSON.parse(s[0])),n.spatialReference);if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new f(n,c.WrongSpatialReference,r);return Je(i)})},e.multipoint=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);let i=null;if(s[0]instanceof k){if(i=ee(Y.parseGeometryFromDictionary(s[0]),n.spatialReference),!(i instanceof xe))throw new f(n,c.InvalidParameter,r)}else i=s[0]instanceof xe?de(s[0].toJSON()):ee(new xe(JSON.parse(s[0])),n.spatialReference);if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new f(n,c.WrongSpatialReference,r);return Je(i)})},e.extent=function(n,r){return t(n,r,(a,u,s)=>{var o;s=P(s),D(s,1,1,n,r);let i=null;if(s[0]instanceof k)i=ee(Y.parseGeometryFromDictionary(s[0]),n.spatialReference);else if(s[0]instanceof q){const l={xmin:s[0].x,ymin:s[0].y,xmax:s[0].x,ymax:s[0].y,spatialReference:s[0].spatialReference.toJSON()},d=s[0];d.hasZ?(l.zmin=d.z,l.zmax=d.z):d.hasM&&(l.mmin=d.m,l.mmax=d.m),i=de(l)}else i=s[0]instanceof ae||s[0]instanceof ie||s[0]instanceof xe?de((o=s[0].extent)==null?void 0:o.toJSON()):s[0]instanceof fe?de(s[0].toJSON()):ee(new fe(JSON.parse(s[0])),n.spatialReference);if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new f(n,c.WrongSpatialReference,r);return Je(i)})},e.geometry=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);let i=null;if(s[0]===null)return null;if(i=Lt(s[0])?ee(s[0].geometry(),n.spatialReference):s[0]instanceof k?ee(Y.parseGeometryFromDictionary(s[0]),n.spatialReference):ee(de(JSON.parse(s[0])),n.spatialReference),i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new f(n,c.WrongSpatialReference,r);return Je(i)})},e.setgeometry=function(n,r){return t(n,r,(a,u,s)=>{if(D(s,2,2,n,r),!Lt(s[0]))throw new f(n,c.InvalidParameter,r);if(s[0].immutable===!0)throw new f(n,c.Immutable,r);if(!(s[1]instanceof T||s[1]===null))throw new f(n,c.InvalidParameter,r);return s[0]._geometry=s[1],C})},e.feature=function(n,r){return t(n,r,(a,u,s)=>{if(s.length===0)throw new f(n,c.WrongNumberOfParameters,r);let i=null;if(s.length===1)if(b(s[0]))i=Y.fromJson(JSON.parse(s[0]),n.timeReference);else if(Lt(s[0]))i=Y.createFromArcadeFeature(s[0]);else if(s[0]instanceof T)i=Y.createFromGraphicLikeObject(s[0],null,null,n.timeReference);else{if(!(s[0]instanceof k))throw new f(n,c.InvalidParameter,r);{let o=s[0].hasField("geometry")?s[0].field("geometry"):null,l=s[0].hasField("attributes")?s[0].field("attributes"):null;o!==null&&o instanceof k&&(o=Y.parseGeometryFromDictionary(o)),l!==null&&(l=Y.parseAttributesFromDictionary(l)),i=Y.createFromGraphicLikeObject(o,l,null,n.timeReference)}}else if(s.length===2){let o=null,l=null;if(s[0]!==null)if(s[0]instanceof T)o=s[0];else{if(!(o instanceof k))throw new f(n,c.InvalidParameter,r);o=Y.parseGeometryFromDictionary(s[0])}if(s[1]!==null){if(!(s[1]instanceof k))throw new f(n,c.InvalidParameter,r);l=Y.parseAttributesFromDictionary(s[1])}i=Y.createFromGraphicLikeObject(o,l,null,n.timeReference)}else{let o=null;const l={};if(s[0]!==null)if(s[0]instanceof T)o=s[0];else{if(!(o instanceof k))throw new f(n,c.InvalidParameter,r);o=Y.parseGeometryFromDictionary(s[0])}for(let d=1;d{if(s.length===0||s.length===1&&s[0]===null){const l=new k;return l.immutable=!1,l}if(s.length===1&&b(s[0]))try{const l=JSON.parse(s[0]),d=k.convertObjectToArcadeDictionary(l,$(n),!1);return d.immutable=!1,d}catch{throw new f(n,c.InvalidParameter,r)}if(s.length===1&&s[0]instanceof T)try{const l=s[0].toJSON();l.hasZ=s[0].hasZ===!0,l.hasM=s[0].hasM===!0;const d=k.convertObjectToArcadeDictionary(l,$(n),!1);return d.immutable=!1,d}catch{throw new f(n,c.InvalidParameter,r)}if(s.length===1&&Q(s[0]))try{const l=new k;l.immutable=!1,l.setField("geometry",s[0].geometry());const d=new k;d.immutable=!1,l.setField("attributes",d);for(const h of s[0].keys())d.setField(h,s[0].field(h));return l}catch{throw new f(n,c.InvalidParameter,r)}if(s.length===1&&s[0]instanceof k)try{const l=new k;l.immutable=!1;for(const d of s[0].keys())l.setField(d,s[0].field(d));return l}catch{throw new f(n,c.InvalidParameter,r)}if(s.length===2&&s[0]instanceof k&&U(s[1]))try{if(s[1]!==!0){const l=new k;l.immutable=!1;for(const d of s[0].keys())l.setField(d,s[0].field(d));return l}return s[0].deepClone()}catch{throw new f(n,c.InvalidParameter,r)}if(s.length%2!=0)throw new f(n,c.WrongNumberOfParameters,r);const i={};for(let l=0;l{D(s,2,2,n,r);const i=A(s[1]);if(Lt(s[0])||s[0]instanceof k)return s[0].hasField(i);if(s[0]instanceof T){const o=bt(s[0],i,null,null,2);return!o||o.keystate!=="notfound"}throw new f(n,c.InvalidParameter,r)})},e.hasvalue=function(n,r){return t(n,r,(a,u,s)=>{if(D(s,2,2,n,r),s[0]===null||s[1]===null)return!1;const i=A(s[1]);return Q(s[0])||s[0]instanceof k?!!s[0].hasField(i)&&s[0].field(i)!==null:s[0]instanceof T?bt(s[0],i,null,null,0)!==null:!1})},e.indexof=function(n,r){return t(n,r,(a,u,s)=>{D(s,2,2,n,r);const i=s[1];if(B(s[0])){for(let o=0;o{if(s=P(s),D(s,2,3,n,r),!(s[0]instanceof q))throw new f(n,c.InvalidParameter,r);if(!(s[1]instanceof q))throw new f(n,c.InvalidParameter,r);if(s.length>2&&!(s[2]instanceof q))throw new f(n,c.InvalidParameter,r);return s.length===2?Pa(s[0],s[1]):Ga(s[0],s[1],s[2])})},e.bearing=function(n,r){return t(n,r,(a,u,s)=>{if(s=P(s),D(s,2,3,n,r),!(s[0]instanceof q))throw new f(n,c.InvalidParameter,r);if(!(s[1]instanceof q))throw new f(n,c.InvalidParameter,r);if(s.length>2&&!(s[2]instanceof q))throw new f(n,c.InvalidParameter,r);return s.length===2?Ua(s[0],s[1]):za(s[0],s[1],s[2])})},e.isselfintersecting=function(n,r){return t(n,r,(a,u,s)=>{s=P(s),D(s,1,1,n,r);let i=s[0];if(i instanceof ae)return i.isSelfIntersecting;if(i instanceof ie)return i=i.paths,Fr(i);if(i instanceof xe){const o=i.points;for(let l=0;l(i=P(i),n(r,a,i),i[0]===null||i[1]===null||R.disjoint(i[0],i[1])))},e.intersects=function(r,a){return t(r,a,(u,s,i)=>(i=P(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.intersects(i[0],i[1])))},e.touches=function(r,a){return t(r,a,(u,s,i)=>(i=P(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.touches(i[0],i[1])))},e.crosses=function(r,a){return t(r,a,(u,s,i)=>(i=P(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.crosses(i[0],i[1])))},e.within=function(r,a){return t(r,a,(u,s,i)=>(i=P(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.within(i[0],i[1])))},e.contains=function(r,a){return t(r,a,(u,s,i)=>(i=P(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.contains(i[0],i[1])))},e.overlaps=function(r,a){return t(r,a,(u,s,i)=>(i=P(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.overlaps(i[0],i[1])))},e.equals=function(r,a){return t(r,a,(u,s,i)=>(D(i,2,2,r,a),i[0]===i[1]||(i[0]instanceof T&&i[1]instanceof T?R.equals(i[0],i[1]):!(!H(i[0])||!H(i[1]))&&i[0].equals(i[1]))))},e.relate=function(r,a){return t(r,a,(u,s,i)=>{if(i=P(i),D(i,3,3,r,a),i[0]instanceof T&&i[1]instanceof T)return R.relate(i[0],i[1],A(i[2]));if(i[0]instanceof T&&i[1]===null||i[1]instanceof T&&i[0]===null||i[0]===null&&i[1]===null)return!1;throw new f(r,c.InvalidParameter,a)})},e.intersection=function(r,a){return t(r,a,(u,s,i)=>(i=P(i),n(r,a,i),i[0]===null||i[1]===null?null:R.intersect(i[0],i[1])))},e.union=function(r,a){return t(r,a,(u,s,i)=>{const o=[];if((i=P(i)).length===0)throw new f(r,c.WrongNumberOfParameters,a);if(i.length===1)if(B(i[0])){const l=P(i[0]);for(let d=0;d(i=P(i),n(r,a,i),i[0]!==null&&i[1]===null?Ce(i[0]):i[0]===null?null:R.difference(i[0],i[1])))},e.symmetricdifference=function(r,a){return t(r,a,(u,s,i)=>(i=P(i),n(r,a,i),i[0]===null&&i[1]===null?null:i[0]===null?Ce(i[1]):i[1]===null?Ce(i[0]):R.symmetricDifference(i[0],i[1])))},e.clip=function(r,a){return t(r,a,(u,s,i)=>{if(i=P(i),D(i,2,2,r,a),!(i[1]instanceof fe)&&i[1]!==null)throw new f(r,c.InvalidParameter,a);if(i[0]===null)return null;if(!(i[0]instanceof T))throw new f(r,c.InvalidParameter,a);return i[1]===null?null:R.clip(i[0],i[1])})},e.cut=function(r,a){return t(r,a,(u,s,i)=>{if(i=P(i),D(i,2,2,r,a),!(i[1]instanceof ie)&&i[1]!==null)throw new f(r,c.InvalidParameter,a);if(i[0]===null)return[];if(!(i[0]instanceof T))throw new f(r,c.InvalidParameter,a);return i[1]===null?[Ce(i[0])]:R.cut(i[0],i[1])})},e.area=function(r,a){return t(r,a,(u,s,i)=>{if(D(i,1,2,r,a),(i=P(i))[0]===null)return 0;if(B(i[0])||L(i[0])){const o=In(i[0],r.spatialReference);return o===null?0:R.planarArea(o,Rt(M(i[1],-1)))}if(!(i[0]instanceof T))throw new f(r,c.InvalidParameter,a);return R.planarArea(i[0],Rt(M(i[1],-1)))})},e.areageodetic=function(r,a){return t(r,a,(u,s,i)=>{if(D(i,1,2,r,a),(i=P(i))[0]===null)return 0;if(B(i[0])||L(i[0])){const o=In(i[0],r.spatialReference);return o===null?0:R.geodesicArea(o,Rt(M(i[1],-1)))}if(!(i[0]instanceof T))throw new f(r,c.InvalidParameter,a);return R.geodesicArea(i[0],Rt(M(i[1],-1)))})},e.length=function(r,a){return t(r,a,(u,s,i)=>{if(D(i,1,2,r,a),(i=P(i))[0]===null)return 0;if(B(i[0])||L(i[0])){const o=wt(i[0],r.spatialReference);return o===null?0:R.planarLength(o,re(M(i[1],-1)))}if(!(i[0]instanceof T))throw new f(r,c.InvalidParameter,a);return R.planarLength(i[0],re(M(i[1],-1)))})},e.length3d=function(r,a){return t(r,a,(u,s,i)=>{if(D(i,1,2,r,a),(i=P(i))[0]===null)return 0;if(B(i[0])||L(i[0])){const o=wt(i[0],r.spatialReference);return o===null?0:o.hasZ===!0?Ar(o,re(M(i[1],-1))):R.planarLength(o,re(M(i[1],-1)))}if(!(i[0]instanceof T))throw new f(r,c.InvalidParameter,a);return i[0].hasZ===!0?Ar(i[0],re(M(i[1],-1))):R.planarLength(i[0],re(M(i[1],-1)))})},e.lengthgeodetic=function(r,a){return t(r,a,(u,s,i)=>{if(D(i,1,2,r,a),(i=P(i))[0]===null)return 0;if(B(i[0])||L(i[0])){const o=wt(i[0],r.spatialReference);return o===null?0:R.geodesicLength(o,re(M(i[1],-1)))}if(!(i[0]instanceof T))throw new f(r,c.InvalidParameter,a);return R.geodesicLength(i[0],re(M(i[1],-1)))})},e.distance=function(r,a){return t(r,a,(u,s,i)=>{i=P(i),D(i,2,3,r,a);let o=i[0];(B(i[0])||L(i[0]))&&(o=Ot(i[0],r.spatialReference));let l=i[1];if((B(i[1])||L(i[1]))&&(l=Ot(i[1],r.spatialReference)),!(o instanceof T))throw new f(r,c.InvalidParameter,a);if(!(l instanceof T))throw new f(r,c.InvalidParameter,a);return R.distance(o,l,re(M(i[2],-1)))})},e.distancegeodetic=function(r,a){return t(r,a,(u,s,i)=>{i=P(i),D(i,2,3,r,a);const o=i[0],l=i[1];if(!(o instanceof q))throw new f(r,c.InvalidParameter,a);if(!(l instanceof q))throw new f(r,c.InvalidParameter,a);const d=new ie({paths:[],spatialReference:o.spatialReference});return d.addPath([o,l]),R.geodesicLength(d,re(M(i[2],-1)))})},e.densify=function(r,a){return t(r,a,(u,s,i)=>{if(i=P(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof T))throw new f(r,c.InvalidParameter,a);const o=m(i[1]);if(isNaN(o))throw new f(r,c.InvalidParameter,a);if(o<=0)throw new f(r,c.InvalidParameter,a);return i[0]instanceof ae||i[0]instanceof ie?R.densify(i[0],o,re(M(i[2],-1))):i[0]instanceof fe?R.densify(Cr(i[0]),o,re(M(i[2],-1))):i[0]})},e.densifygeodetic=function(r,a){return t(r,a,(u,s,i)=>{if(i=P(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof T))throw new f(r,c.InvalidParameter,a);const o=m(i[1]);if(isNaN(o))throw new f(r,c.InvalidParameter,a);if(o<=0)throw new f(r,c.InvalidParameter,a);return i[0]instanceof ae||i[0]instanceof ie?R.geodesicDensify(i[0],o,re(M(i[2],-1))):i[0]instanceof fe?R.geodesicDensify(Cr(i[0]),o,re(M(i[2],-1))):i[0]})},e.generalize=function(r,a){return t(r,a,(u,s,i)=>{if(i=P(i),D(i,2,4,r,a),i[0]===null)return null;if(!(i[0]instanceof T))throw new f(r,c.InvalidParameter,a);const o=m(i[1]);if(isNaN(o))throw new f(r,c.InvalidParameter,a);return R.generalize(i[0],o,ut(M(i[2],!0)),re(M(i[3],-1)))})},e.buffer=function(r,a){return t(r,a,(u,s,i)=>{if(i=P(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof T))throw new f(r,c.InvalidParameter,a);const o=m(i[1]);if(isNaN(o))throw new f(r,c.InvalidParameter,a);return o===0?Ce(i[0]):R.buffer(i[0],o,re(M(i[2],-1)))})},e.buffergeodetic=function(r,a){return t(r,a,(u,s,i)=>{if(i=P(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof T))throw new f(r,c.InvalidParameter,a);const o=m(i[1]);if(isNaN(o))throw new f(r,c.InvalidParameter,a);return o===0?Ce(i[0]):R.geodesicBuffer(i[0],o,re(M(i[2],-1)))})},e.offset=function(r,a){return t(r,a,(u,s,i)=>{if(i=P(i),D(i,2,6,r,a),i[0]===null)return null;if(!(i[0]instanceof ae||i[0]instanceof ie))throw new f(r,c.InvalidParameter,a);const o=m(i[1]);if(isNaN(o))throw new f(r,c.InvalidParameter,a);const l=m(M(i[4],10));if(isNaN(l))throw new f(r,c.InvalidParameter,a);const d=m(M(i[5],0));if(isNaN(d))throw new f(r,c.InvalidParameter,a);return R.offset(i[0],o,re(M(i[2],-1)),A(M(i[3],"round")).toLowerCase(),l,d)})},e.rotate=function(r,a){return t(r,a,(u,s,i)=>{i=P(i),D(i,2,3,r,a);let o=i[0];if(o===null)return null;if(!(o instanceof T))throw new f(r,c.InvalidParameter,a);o instanceof fe&&(o=ae.fromExtent(o));const l=m(i[1]);if(isNaN(l))throw new f(r,c.InvalidParameter,a);const d=M(i[2],null);if(d===null)return R.rotate(o,l);if(d instanceof q)return R.rotate(o,l,d);throw new f(r,c.InvalidParameter,a)})},e.centroid=function(r,a){return t(r,a,(u,s,i)=>{if(i=P(i),D(i,1,1,r,a),i[0]===null)return null;let o=i[0];if((B(i[0])||L(i[0]))&&(o=Ot(i[0],r.spatialReference)),o===null)return null;if(!(o instanceof T))throw new f(r,c.InvalidParameter,a);return o instanceof q?ee(Ce(i[0]),r.spatialReference):o instanceof ae?o.centroid:o instanceof ie?Na(o):o instanceof xe?La(o):o instanceof fe?o.center:null})},e.multiparttosinglepart=function(r,a){return t(r,a,(u,s,i)=>{i=P(i),D(i,1,1,r,a);const o=[];if(i[0]===null)return null;if(!(i[0]instanceof T))throw new f(r,c.InvalidParameter,a);if(i[0]instanceof q)return[ee(Ce(i[0]),r.spatialReference)];if(i[0]instanceof fe)return[ee(Ce(i[0]),r.spatialReference)];const l=R.simplify(i[0]);if(l instanceof ae){const d=[],h=[];for(let p=0;p{if(i=P(i),D(i,1,1,r,a),i[0]===null)return!0;if(!(i[0]instanceof T))throw new f(r,c.InvalidParameter,a);return R.isSimple(i[0])})},e.simplify=function(r,a){return t(r,a,(u,s,i)=>{if(i=P(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof T))throw new f(r,c.InvalidParameter,a);return R.simplify(i[0])})},e.convexhull=function(r,a){return t(r,a,(u,s,i)=>{if(i=P(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof T))throw new f(r,c.InvalidParameter,a);return R.convexHull(i[0])})},e.nearestcoordinate=function(r,a){return t(r,a,(u,s,i)=>{if(i=P(i),D(i,2,2,r,a),!(i[0]instanceof T||i[0]===null))throw new f(r,c.InvalidParameter,a);if(!(i[1]instanceof q||i[1]===null))throw new f(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const o=R.nearestCoordinate(i[0],i[1]);return o===null||o.isEmpty?null:k.convertObjectToArcadeDictionary({coordinate:o.coordinate,distance:o.distance},$(r),!1,!0)})},e.nearestvertex=function(r,a){return t(r,a,(u,s,i)=>{if(i=P(i),D(i,2,2,r,a),!(i[0]instanceof T||i[0]===null))throw new f(r,c.InvalidParameter,a);if(!(i[1]instanceof q||i[1]===null))throw new f(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const o=R.nearestVertex(i[0],i[1]);return o===null||o.isEmpty?null:k.convertObjectToArcadeDictionary({coordinate:o.coordinate,distance:o.distance},$(r),!1,!0)})}}const qa=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:Xn,setGeometryEngine:ja},Symbol.toStringTag,{value:"Module"}));function cn(e,t,n){return n===void 0||+n==0?Math[e](t):(t=+t,n=+n,isNaN(t)||typeof n!="number"||n%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-n:-n)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+n:n))))}function wi(e,t){function n(r,a,u){const s=m(r);return isNaN(s)?s:isNaN(a)||isNaN(u)||a>u?NaN:su?u:s}e.number=function(r,a){return t(r,a,(u,s,i)=>{D(i,1,2,r,a);const o=i[0];if(G(o))return o;if(o===null)return 0;if(H(o))return o.toNumber();if(U(o))return Number(o);if(B(o))return NaN;if(o===""||o===void 0)return Number(o);if(b(o)){if(i[1]!==void 0){let l=ze(i[1],"‰","");return l=ze(l,"¤",""),Wr(o,{pattern:l})}return Number(o.trim())}return Number(o)})},e.abs=function(r,a){return t(r,a,(u,s,i)=>(D(i,1,1,r,a),Math.abs(m(i[0]))))},e.acos=function(r,a){return t(r,a,(u,s,i)=>(D(i,1,1,r,a),Math.acos(m(i[0]))))},e.asin=function(r,a){return t(r,a,(u,s,i)=>(D(i,1,1,r,a),Math.asin(m(i[0]))))},e.atan=function(r,a){return t(r,a,(u,s,i)=>(D(i,1,1,r,a),Math.atan(m(i[0]))))},e.atan2=function(r,a){return t(r,a,(u,s,i)=>(D(i,2,2,r,a),Math.atan2(m(i[0]),m(i[1]))))},e.ceil=function(r,a){return t(r,a,(u,s,i)=>{if(D(i,1,2,r,a),i.length===2){let o=m(i[1]);return isNaN(o)&&(o=0),cn("ceil",m(i[0]),-1*o)}return Math.ceil(m(i[0]))})},e.round=function(r,a){return t(r,a,(u,s,i)=>{if(D(i,1,2,r,a),i.length===2){let o=m(i[1]);return isNaN(o)&&(o=0),cn("round",m(i[0]),-1*o)}return Math.round(m(i[0]))})},e.floor=function(r,a){return t(r,a,(u,s,i)=>{if(D(i,1,2,r,a),i.length===2){let o=m(i[1]);return isNaN(o)&&(o=0),cn("floor",m(i[0]),-1*o)}return Math.floor(m(i[0]))})},e.cos=function(r,a){return t(r,a,(u,s,i)=>(D(i,1,1,r,a),Math.cos(m(i[0]))))},e.isnan=function(r,a){return t(r,a,(u,s,i)=>(D(i,1,1,r,a),typeof i[0]=="number"&&isNaN(i[0])))},e.exp=function(r,a){return t(r,a,(u,s,i)=>(D(i,1,1,r,a),Math.exp(m(i[0]))))},e.log=function(r,a){return t(r,a,(u,s,i)=>(D(i,1,1,r,a),Math.log(m(i[0]))))},e.pow=function(r,a){return t(r,a,(u,s,i)=>(D(i,2,2,r,a),m(i[0])**m(i[1])))},e.random=function(r,a){return t(r,a,(u,s,i)=>(D(i,0,0,r,a),Math.random()))},e.sin=function(r,a){return t(r,a,(u,s,i)=>(D(i,1,1,r,a),Math.sin(m(i[0]))))},e.sqrt=function(r,a){return t(r,a,(u,s,i)=>(D(i,1,1,r,a),Math.sqrt(m(i[0]))))},e.tan=function(r,a){return t(r,a,(u,s,i)=>(D(i,1,1,r,a),Math.tan(m(i[0]))))},e.defaultvalue=function(r,a){return t(r,a,(u,s,i)=>(D(i,2,2,r,a),i[0]===null||i[0]===""||i[0]===void 0?i[1]:i[0]))},e.isempty=function(r,a){return t(r,a,(u,s,i)=>(D(i,1,1,r,a),i[0]===null||i[0]===""||i[0]===void 0))},e.boolean=function(r,a){return t(r,a,(u,s,i)=>{D(i,1,1,r,a);const o=i[0];return ut(o)})},e.constrain=function(r,a){return t(r,a,(u,s,i)=>{D(i,3,3,r,a);const o=m(i[1]),l=m(i[2]);if(B(i[0])){const d=[];for(const h of i[0])d.push(n(h,o,l));return d}if(L(i[0])){const d=[];for(let h=0;h=t&&t!==-1)return n}return n}function fn(e,t,n=1e3){switch(e.toLowerCase()){case"distinct":return Va(t,n);case"avg":case"mean":return xi(qe(t));case"min":return Math.min.apply(Math,qe(t));case"sum":return Ja(qe(t));case"max":return Math.max.apply(Math,qe(t));case"stdev":case"stddev":return Math.sqrt(Er(qe(t)));case"var":case"variance":return Er(qe(t));case"count":return t.length}return 0}function Oe(e,t,n,r){if(r.length===1){if(B(r[0]))return fn(e,r[0],-1);if(L(r[0]))return fn(e,r[0].toArray(),-1)}return fn(e,r,-1)}function Fi(e,t){e.stdev=function(n,r){return t(n,r,(a,u,s)=>Oe("stdev",a,u,s))},e.variance=function(n,r){return t(n,r,(a,u,s)=>Oe("variance",a,u,s))},e.average=function(n,r){return t(n,r,(a,u,s)=>Oe("mean",a,u,s))},e.mean=function(n,r){return t(n,r,(a,u,s)=>Oe("mean",a,u,s))},e.sum=function(n,r){return t(n,r,(a,u,s)=>Oe("sum",a,u,s))},e.min=function(n,r){return t(n,r,(a,u,s)=>Oe("min",a,u,s))},e.max=function(n,r){return t(n,r,(a,u,s)=>Oe("max",a,u,s))},e.distinct=function(n,r){return t(n,r,(a,u,s)=>Oe("distinct",a,u,s))},e.count=function(n,r){return t(n,r,(a,u,s)=>{if(D(s,1,1,n,r),B(s[0])||b(s[0]))return s[0].length;if(L(s[0]))return s[0].length();throw new f(n,c.InvalidParameter,r)})}}let _n=class extends k{constructor(t){super(),this.declaredClass="esri.arcade.Portal",this.immutable=!1,this.setField("url",t),this.immutable=!0}},Za=class Ci extends k{constructor(t,n,r,a,u,s,i){super(),this.attachmentUrl=u,this.declaredClass="esri.arcade.Attachment",this.immutable=!1,this.setField("id",t),this.setField("name",n),this.setField("contenttype",r),this.setField("size",a),this.setField("exifinfo",s),this.setField("keywords",i),this.immutable=!0}deepClone(){var t;return new Ci(this.field("id"),this.field("name"),this.field("contenttype"),this.field("size"),this.attachmentUrl,((t=this.field("exifinfo"))==null?void 0:t.deepClone())??null,this.field("keywords"))}};const Qn=e=>(t,n,r)=>(r=r||14,+e(t,n).toFixed(r)),Ha=(e,t)=>e+t,Wa=(e,t)=>e*t,Ka=(e,t)=>e/t,br=(e,t,n)=>Qn(Ha)(e,t,n),it=(e,t,n)=>Qn(Wa)(e,t,n),Jt=(e,t,n)=>Qn(Ka)(e,t,n),Vt=360,Ya=400,Xa=2*Math.PI,Ae=3600,vr=3240,Ft=60,Ge=60,Sr=180*Ae/Math.PI,Dt=Vt*Ft*Ge,hn=90*Ae,Xe=180*Ae,Qa=270*Ae,Ai=String.fromCharCode(7501),gt="°";function mt(e){if(b(e)===!1)throw new f(null,c.InvalidParameter,null);return e}function Mn(e,t){const n=10**t;return Math.round(e*n)/n}function es(e,t){return e%t}function Qe(e){const t=parseFloat(e.toString().replace(Math.trunc(e).toString(),"0"))*Math.sign(e);return e<0?{fraction:t,integer:Math.ceil(e)}:{fraction:t,integer:Math.floor(e)}}var Z,y,z,$n;function rt(e,t){switch(e){case Z.north:return t==="SHORT"?"N":"North";case Z.east:return t==="SHORT"?"E":"East";case Z.south:return t==="SHORT"?"S":"South";case Z.west:return t==="SHORT"?"W":"West"}}function dn(e,t,n){for(;e.length=Qa?Z.north:Z.south,r=n===Z.north?Math.min(Dt-t,t):Math.abs(t-Xe),a=t>Xe?Z.west:Z.east;return new ts(n,r,a)}static createFromAngleMeridianAndDirection(t,n,r){return new Me(new Se(Me.secondsQuadrantToNorthAzimuth(t.extractAngularUnits(y.seconds),n,r)))}static secondsQuadrantToNorthAzimuth(t,n,r){return n===Z.north?r===Z.east?t:Dt-t:r===Z.east?Xe-t:Xe+t}static _convertDirectionFormat(t,n,r){let a=0;switch(n){case z.north_azimuth:a=t;break;case z.polar:a=hn-t;break;case z.quadrant:throw new f(null,c.LogicError,null,{reason:"unexpected evaluation"});case z.south_azimuth:a=t+Xe}let u=0;switch(r){case z.north_azimuth:u=a;break;case z.polar:u=hn-a;break;case z.quadrant:throw new f(null,c.LogicError,null,{reason:"unexpected evaluation"});case z.south_azimuth:u=a-Xe}return u=es(u,Dt),u<0?Dt+u:u}};function Br(e,t,n){let r=null;switch(t){case y.decimal_degrees:r=it(e,Ae);break;case y.seconds:r=e;break;case y.gradians:r=it(e,vr);break;case y.radians:r=it(e,Sr);break;default:throw new f(null,c.LogicError,null,{reason:"unexpected evaluation"})}switch(n){case y.decimal_degrees:return Jt(r,Ae);case y.seconds:return r;case y.gradians:return Jt(r,vr);case y.radians:return r/Sr;default:throw new f(null,c.LogicError,null,{reason:"unexpected evaluation"})}}let Se=class Nn{constructor(t){this._seconds=t}static createFromAngleAndUnits(t,n){return new Nn(Br(t,n,y.seconds))}extractAngularUnits(t){return Br(this._seconds,y.seconds,vt(t))}static createFromDegreesMinutesSeconds(t,n,r){return new Nn(br(br(it(t,Ae),it(n,Ge)),r))}};function vt(e){switch(Zr(e),e){case y.decimal_degrees:case y.truncated_degrees:case y.degrees_minutes_seconds:return y.decimal_degrees;case y.gradians:return y.gradians;case y.fractional_degree_minutes:return y.fractional_degree_minutes;case y.radians:return y.radians;case y.seconds:case y.fractional_minute_seconds:return y.seconds}}let ns=class Ei{constructor(t,n,r,a){this.view=t,this.angle=n,this.merdian=r,this.direction=a,this._dms=null,this._formattedDms=null}static createFromStringAndBearing(t,n,r){return new Ei(t,n.getAngle(r),n.getMeridian(r),n.getDirection(r))}fetchAngle(){return this.angle}fetchMeridian(){return this.merdian}fetchDirection(){return this.direction}fetchView(){return this.view}fetchDms(){return this._dms===null&&this._calculateDms(),this._dms}fetchFormattedDms(){return this._formattedDms===null&&this._calculateDms(),this._formattedDms}_calculateDms(){let t=null,n=y.truncated_degrees,r=0;for(let a=0;a0?1:0));case y.truncated_degrees:case y.fractional_degree_minutes:return u=mn(a.fetchFormattedDms().getField(t),pn(t)),dn(u.toFixed(r),"0",n+r+(r>0?1:0));case y.fractional_minute_seconds:return u=mn(Mn(a.fetchDms().getField(t),r),pn(t)),dn(u.toFixed(r),"0",n+r+(r>0?1:0));default:throw new f(null,c.LogicError,null,{reason:"unexpected evaluation"})}}function is(e,t,n){if(n===z.quadrant)throw new f(null,c.LogicError,null,{reason:"conversion error"});if(t===y.degrees_minutes_seconds){const r=lt.numberToDms(e);return Pe.createFromAngleAndDirection(Se.createFromDegreesMinutesSeconds(r.m_degrees,r.m_minutes,r.m_seconds),n)}return Pe.createFromAngleAndDirection(Se.createFromAngleAndUnits(e,vt(t)),n)}function as(e){switch(m(e)){case 1:return{first:Z.north,second:Z.east};case 2:return{first:Z.south,second:Z.east};case 3:return{first:Z.south,second:Z.west};case 4:return{first:Z.north,second:Z.west}}return null}function Tr(e){switch(e.toUpperCase().trim()){case"N":case"NORTH":return Z.north;case"E":case"EAST":return Z.east;case"S":case"SOUTH":return Z.south;case"W":case"WEST":return Z.west}return null}function et(e){const t=parseFloat(e);if(G(t)){if(isNaN(t))throw new f(null,c.LogicError,null,{reason:"invalid conversion"});return t}throw new f(null,c.LogicError,null,{reason:"invalid conversion"})}function Dn(e,t,n){const r=n===z.quadrant;let a=null,u=null,s=0,i=0,o=0;if(r){if(e.length<2)throw new f(null,c.LogicError,null,{reason:"conversion error"});o=1;const l=as(A(e[e.length-1]));if(l?(a=l.first,u=l.second):(s=1,a=Tr(A(e[0])),u=Tr(A(e[e.length-1]))),a===null||u===null)throw new f(null,c.LogicError,null,{reason:"invalid conversion"})}switch(t){case y.decimal_degrees:case y.radians:case y.gradians:if(e.length===0)throw new f(null,c.LogicError,null,{reason:"invalid conversion"});return r?Pe.createFromAngleMeridianAndDirection(Se.createFromAngleAndUnits(et(e[s]),vt(t)),a,u):Pe.createFromAngleAndDirection(Se.createFromAngleAndUnits(et(e[s]),vt(t)),n);case y.degrees_minutes_seconds:if(i=e.length-o-s,i===3){const l=Se.createFromDegreesMinutesSeconds(et(e[s]),et(e[s+1]),et(e[s+2]));return r?Pe.createFromAngleMeridianAndDirection(l,a,u):Pe.createFromAngleAndDirection(l,n)}if(i===1){const l=et(e[s]),d=lt.numberToDms(l),h=Se.createFromDegreesMinutesSeconds(d.m_degrees,d.m_minutes,d.m_seconds);return r?Pe.createFromAngleMeridianAndDirection(h,a,u):Pe.createFromAngleAndDirection(h,n)}}throw new f(null,c.LogicError,null,{reason:"invalid conversion"})}function ss(e){const t=[" ","-","/","'",'"',"\\","^",gt,Ai," ","\r",` +`,"*"];let n="";for(let r=0;rr!=="")}function us(e,t,n){if(G(e))return is(m(e),t,n);if(b(e))return Dn(ss(e),t,n);if(B(e))return Dn(e,t,n);if(L(e))return Dn(e.toArray(),t,n);throw new f(null,c.LogicError,null,{reason:"conversion error"})}function os(e,t,n){const r=vt(n);if(r&&n!==y.degrees_minutes_seconds)return e.getAngle(t).extractAngularUnits(r);throw new f(null,c.LogicError,null,{reason:"conversion error"})}function ls(e,t,n){const r=e.getAngle(t);if(t===z.quadrant&&n===y.degrees_minutes_seconds){const a=lt.secondsToDMS(r.extractAngularUnits(y.seconds));return[rt(e.getMeridian(t),"SHORT"),a.m_degrees,a.m_minutes,a.m_seconds,rt(e.getDirection(t),"SHORT")]}if(n===y.degrees_minutes_seconds){const a=lt.secondsToDMS(r.extractAngularUnits(y.seconds));return[a.m_degrees,a.m_minutes,a.m_seconds]}return t===z.quadrant?[rt(e.getMeridian(t),"SHORT"),r.extractAngularUnits(n),rt(e.getDirection(t),"SHORT")]:[r.extractAngularUnits(n)]}function cs(e,t){let n="";switch(e){case y.decimal_degrees:n=t===z.quadrant?"DD.DD"+gt:"DDD.DD"+gt;break;case y.degrees_minutes_seconds:n=t===z.quadrant?"dd"+gt+` mm' ss"`:"ddd"+gt+` mm' ss.ss"`;break;case y.radians:n="R.RR";break;case y.gradians:n="GGG.GG"+Ai;break;default:throw new f(null,c.LogicError,null,{reason:"conversion error"})}return t===z.quadrant&&(n="p "+n+" b"),n}function Ln(e,t,n){const r={padding:0,rounding:0,newpos:t};let a=!1;for(;t(D(s,1,1,n,r),new _n(A(s[0]))))},e.typeof=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=Jn(s[0]);if(i==="Unrecognised Type")throw new f(n,c.UnrecognisedType,r);return i})},e.trim=function(n,r){return t(n,r,(a,u,s)=>(D(s,1,1,n,r),A(s[0]).trim()))},e.tohex=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=m(s[0]);return isNaN(i)?i:i.toString(16)})},e.upper=function(n,r){return t(n,r,(a,u,s)=>(D(s,1,1,n,r),A(s[0]).toUpperCase()))},e.proper=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,2,n,r);let i=1;s.length===2&&A(s[1]).toLowerCase()==="firstword"&&(i=2);const o=/\s/,l=A(s[0]);let d="",h=!0;for(let p=0;p(D(s,1,1,n,r),A(s[0]).toLowerCase()))},e.guid=function(n,r){return t(n,r,(a,u,s)=>{if(D(s,0,1,n,r),s.length>0)switch(A(s[0]).toLowerCase()){case"digits":return tt().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return tt();case"digits-hyphen-braces":return"{"+tt()+"}";case"digits-hyphen-parentheses":return"("+tt()+")"}return"{"+tt()+"}"})},e.standardizeguid=function(n,r){return t(n,r,(a,u,s)=>{D(s,2,2,n,r);let i=A(s[0]);if(i===""||i===null)return"";const o=/^(\{|\()?(?[0-9a-z]{8})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{12})(\}|\))?$/gim.exec(i);if(!o)return"";const l=o.groups;switch(i=l.partA+"-"+l.partB+"-"+l.partC+"-"+l.partD+"-"+l.partE,A(s[1]).toLowerCase()){case"digits":return i.replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return i;case"digits-hyphen-braces":return"{"+i+"}";case"digits-hyphen-parentheses":return"("+i+")"}return"{"+i+"}"})},e.console=function(n,r){return t(n,r,(a,u,s)=>(s.length===0||(s.length===1?n.console(A(s[0])):n.console(A(s))),C))},e.mid=function(n,r){return t(n,r,(a,u,s)=>{D(s,2,3,n,r);let i=m(s[1]);if(isNaN(i))return"";if(i<0&&(i=0),s.length===2)return A(s[0]).substr(i);let o=m(s[2]);return isNaN(o)?"":(o<0&&(o=0),A(s[0]).substr(i,o))})},e.find=function(n,r){return t(n,r,(a,u,s)=>{D(s,2,3,n,r);let i=0;if(s.length>2){if(i=m(M(s[2],0)),isNaN(i))return-1;i<0&&(i=0)}return A(s[1]).indexOf(A(s[0]),i)})},e.left=function(n,r){return t(n,r,(a,u,s)=>{D(s,2,2,n,r);let i=m(s[1]);return isNaN(i)?"":(i<0&&(i=0),A(s[0]).substr(0,i))})},e.right=function(n,r){return t(n,r,(a,u,s)=>{D(s,2,2,n,r);let i=m(s[1]);return isNaN(i)?"":(i<0&&(i=0),A(s[0]).substr(-1*i,i))})},e.split=function(n,r){return t(n,r,(a,u,s)=>{let i;D(s,2,4,n,r);let o=m(M(s[2],-1));const l=ut(M(s[3],!1));if(o===-1||o===null||l===!0?i=A(s[0]).split(A(s[1])):(isNaN(o)&&(o=-1),o<-1&&(o=-1),i=A(s[0]).split(A(s[1]),o)),l===!1)return i;const d=[];for(let h=0;h=o);h++)i[h]!==""&&i[h]!==void 0&&d.push(i[h]);return d})},e.text=function(n,r){return t(n,r,(a,u,s)=>(D(s,1,2,n,r),pe(s[0],s[1])))},e.concatenate=function(n,r){return t(n,r,(a,u,s)=>{const i=[];if(s.length<1)return"";if(B(s[0])){const o=M(s[2],"");for(let l=0;l1?i.join(s[1]):i.join("")}if(L(s[0])){const o=M(s[2],"");for(let l=0;l1?i.join(s[1]):i.join("")}for(let o=0;o{if(D(s,1,1,n,r),B(s[0])){const i=s[0].slice(0);return i.reverse(),i}if(L(s[0])){const i=s[0].toArray().slice(0);return i.reverse(),i}throw new f(n,c.InvalidParameter,r)})},e.replace=function(n,r){return t(n,r,(a,u,s)=>{D(s,3,4,n,r);const i=A(s[0]),o=A(s[1]),l=A(s[2]);return s.length!==4||ut(s[3])?ze(i,o,l):i.replace(o,l)})},e.schema=function(n,r){return t(n,r,(a,u,s)=>{if(Q(s[0])){const i=ui(s[0]);return i?k.convertObjectToArcadeDictionary(i,$(n)):null}throw new f(n,c.InvalidParameter,r)})},e.subtypes=function(n,r){return t(n,r,(a,u,s)=>{if(D(s,1,1,n,r),Q(s[0])){const i=Pt(s[0]);return i?k.convertObjectToArcadeDictionary(i,$(n)):null}throw new f(n,c.InvalidParameter,r)})},e.subtypecode=function(n,r){return t(n,r,(a,u,s)=>{if(D(s,1,1,n,r),Q(s[0])){const i=Pt(s[0]);if(!i)return null;if(i.subtypeField&&s[0].hasField(i.subtypeField)){const o=s[0].field(i.subtypeField);for(const l of i.subtypes)if(l.code===o)return l.code;return null}return null}throw new f(n,c.InvalidParameter,r)})},e.subtypename=function(n,r){return t(n,r,(a,u,s)=>{if(D(s,1,1,n,r),Q(s[0])){const i=Pt(s[0]);if(!i)return"";if(i.subtypeField&&s[0].hasField(i.subtypeField)){const o=s[0].field(i.subtypeField);for(const l of i.subtypes)if(l.code===o)return l.name;return""}return""}throw new f(n,c.InvalidParameter,r)})},e.gdbversion=function(n,r){return t(n,r,(a,u,s)=>{if(D(s,1,1,n,r),Q(s[0]))return s[0].gdbVersion();throw new f(n,c.InvalidParameter,r)})},e.domain=function(n,r){return t(n,r,(a,u,s)=>{if(D(s,2,3,n,r),Q(s[0])){const i=ii(s[0],A(s[1]),s[2]===void 0?void 0:s[2]);return i&&i.domain?i.domain.type==="coded-value"||i.domain.type==="codedValue"?k.convertObjectToArcadeDictionary({type:"codedValue",name:i.domain.name,dataType:pr[i.field.type],codedValues:i.domain.codedValues.map(o=>({name:o.name,code:o.code}))},$(n)):k.convertObjectToArcadeDictionary({type:"range",name:i.domain.name,dataType:pr[i.field.type],min:i.domain.min,max:i.domain.max},$(n)):null}throw new f(n,c.InvalidParameter,r)})},e.domainname=function(n,r){return t(n,r,(a,u,s)=>{if(D(s,2,4,n,r),Q(s[0]))return ai(s[0],A(s[1]),s[2],s[3]===void 0?void 0:s[3]);throw new f(n,c.InvalidParameter,r)})},e.domaincode=function(n,r){return t(n,r,(a,u,s)=>{if(D(s,2,4,n,r),Q(s[0]))return si(s[0],A(s[1]),s[2],s[3]===void 0?void 0:s[3]);throw new f(n,c.InvalidParameter,r)})},e.urlencode=function(n,r){return t(n,r,(a,u,s)=>{if(D(s,1,1,n,r),s[0]===null)return"";if(s[0]instanceof k){let i="";for(const o of s[0].keys()){const l=s[0].field(o);i!==""&&(i+="&"),i+=l===null?encodeURIComponent(o)+"=":encodeURIComponent(o)+"="+encodeURIComponent(l)}return i}return encodeURIComponent(A(s[0]))})},e.hash=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,1,n,r);const i=new da(0);return ye(s[0],i,{context:n,node:r,map:new Map,currentLength:0}),i.digest()})},e.convertdirection=function(n,r){return t(n,r,(a,u,s)=>(D(s,3,3,n,r),ds(s[0],s[1],s[2])))},e.fromjson=function(n,r){return t(n,r,(a,u,s)=>{if(D(s,1,1,n,r),b(s[0])===!1)throw new f(n,c.InvalidParameter,r);return k.convertJsonToArcade(JSON.parse(A(s[0])),$(n))})},e.expects=function(n,r){return t(n,r,(a,u,s)=>{if(s.length<1)throw new f(n,c.WrongNumberOfParameters,r);return C})},e.tocharcode=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,2,n,r);const i=m(M(s[1],0)),o=A(s[0]);if(o.length===0&&s.length===1)return null;if(o.length<=i||i<0)throw new f(n,c.OutOfBounds,r);return o.charCodeAt(i)})},e.tocodepoint=function(n,r){return t(n,r,(a,u,s)=>{D(s,1,2,n,r);const i=m(M(s[1],0)),o=A(s[0]);if(o.length===0&&s.length===1)return null;if(o.length<=i||i<0)throw new f(n,c.OutOfBounds,r);return o.codePointAt(i)})},e.fromcharcode=function(n,r){return t(n,r,(a,u,s)=>{if(s.length<1)throw new f(n,c.WrongNumberOfParameters,r);const i=s.map(o=>Math.trunc(m(o))).filter(o=>o>=0&&o<=65535);return i.length===0?null:String.fromCharCode.apply(null,i)})},e.fromcodepoint=function(n,r){return t(n,r,(a,u,s)=>{if(s.length<1)throw new f(n,c.WrongNumberOfParameters,r);let i;try{i=s.map(o=>Math.trunc(m(o))).filter(o=>o<=1114111&&o>>>0===o)}catch{return null}return i.length===0?null:String.fromCodePoint.apply(null,i)})},e.getuser=function(n,r){return t(n,r,(a,u,s)=>{D(s,0,2,n,r);let i=M(s[1],"");if(i=i===!0||i===!1?"":A(i),i!==null&&i!=="")return null;if(s.length===0||s[0]instanceof _n){let o=null;if(o=n.services&&n.services.portal?n.services.portal:jn.getDefault(),s.length>0&&!ps(s[0].field("url"),o)||!o)return null;if(i===""){const l=ms(o);if(l){const d=JSON.parse(JSON.stringify(l));for(const h of["lastLogin","created","modified"])d[h]!==void 0&&d[h]!==null&&(d[h]=new Date(d[h]));return k.convertObjectToArcadeDictionary(d,$(n))}}return null}throw new f(n,c.InvalidParameter,r)})},e.getenvironment=function(n,r){return t(n,r,(a,u,s)=>(D(s,0,0,n,r),k.convertObjectToArcadeDictionary(oi($(n),n.spatialReference),$(n),!0)))}}let tn=class{constructor(t,n){this._moduleSingletons=t,this._syntaxModules=n}loadLibrary(t){if(this._syntaxModules==null)return null;const n=this._syntaxModules[t.toLowerCase()];return n?{syntax:n.script,uri:n.uri}:null}},Ds=class extends Ze{constructor(t,n){super(),this.paramCount=n,this.fn=t}createFunction(t){return(...n)=>{if(n.length!==this.paramCount)throw new f(t,c.WrongNumberOfParameters,null);return this.fn(...n)}}call(t,n){return this.fn(...n.arguments)}marshalledCall(t,n,r,a){return a(t,n,(u,s,i)=>{i=i.map(l=>!K(l)||l instanceof Le?l:at(l,t,a));const o=this.call(r,{arguments:i});return Ue(o)?o.then(l=>at(l,r,a)):o})}};function we(e,t,n){try{return n(e,null,t.arguments)}catch(r){throw r}}function v(e,t){try{switch(t.type){case"EmptyStatement":return"lc.voidOperation";case"VariableDeclarator":return Bs(e,t);case"VariableDeclaration":return ks(e,t);case"BlockStatement":case"Program":return Rn(e,t);case"FunctionDeclaration":return Is(e,t);case"ImportDeclaration":return vs(e,t);case"ExportNamedDeclaration":return Ss(e,t);case"ReturnStatement":return bs(e,t);case"IfStatement":return vi(e,t);case"ExpressionStatement":return Es(e,t);case"AssignmentExpression":return As(e,t);case"UpdateExpression":return Fs(e,t);case"BreakStatement":return"break";case"ContinueStatement":return"continue";case"TemplateLiteral":return $s(e,t);case"TemplateElement":return JSON.stringify(t.value?t.value.cooked:"");case"ForStatement":return xs(e,t);case"ForInStatement":return ws(e,t);case"WhileStatement":return Cs(e,t);case"Identifier":return Rs(e,t);case"MemberExpression":return Ts(e,t);case"Literal":return t.value===null||t.value===void 0?"null":JSON.stringify(t.value);case"CallExpression":return Os(e,t);case"UnaryExpression":return _s(e,t);case"BinaryExpression":return Ns(e,t);case"LogicalExpression":return Ls(e,t);case"ArrayExpression":return Ms(e,t);case"ObjectExpression":return gs(e,t);case"Property":return ys(e,t);case"Array":throw new ue(e,c.NeverReach,t);default:throw new ue(e,c.Unrecognised,t)}}catch(n){throw n}}function gs(e,t){let n="lang.dictionary([";for(let r=0;r0&&(n+=","),n+="lang.strCheck("+(a.key.type==="Identifier"?"'"+a.key.name+"'":v(e,a.key))+",'ObjectExpression'),lang.aCheck("+v(e,a.value)+", 'ObjectExpression')"}return n+="])",n}function ys(e,t){throw new ue(e,c.NeverReach,t)}function ws(e,t){const n=Ie(e),r=Ie(e),a=Ie(e);let u="var "+n+" = "+v(e,t.right)+`; +`;t.left.type==="VariableDeclaration"&&(u+=v(e,t.left));let s=t.left.type==="VariableDeclaration"?t.left.declarations[0].id.name:t.left.name;s=s.toLowerCase(),De(s);let i="";e.localScope!==null&&(e.localScope[s]!==void 0?i="lscope['"+s+"']":e.localScope._SymbolsMap[s]!==void 0&&(i="lscope['"+e.localScope._SymbolsMap[s]+"']"));let o="";if(i===""){if(e.globalScope[s]!==void 0)i="gscope['"+s+"']";else if(e.globalScope._SymbolsMap[s]!==void 0)i="gscope['"+e.globalScope._SymbolsMap[s]+"']";else if(e.localScope!==null)if(e.undeclaredGlobalsInFunctions.has(s))i="gscope['"+e.undeclaredGlobalsInFunctions.get(s).manglename+"']",o=e.undeclaredGlobalsInFunctions.get(s).manglename;else{const l={manglename:ve(e),node:t.left};e.undeclaredGlobalsInFunctions.set(s,l),i="gscope['"+l.manglename+"']",o=l.manglename}}return o&&(u+="lang.chkAssig('"+o+`',runtimeCtx); +`),u+="if ("+n+`===null) { lastStatement = lc.voidOperation; } + `,u+="else if (lc.isArray("+n+") || lc.isString("+n+")) {",u+="var "+r+"="+n+`.length; +`,u+="for(var "+a+"=0; "+a+"<"+r+"; "+a+`++) { +`,u+=i+"="+a+`; +`,u+=v(e,t.body),u+=` +} +`,u+=` lastStatement = lc.voidOperation; +`,u+=` +} +`,u+="else if (lc.isImmutableArray("+n+")) {",u+="var "+r+"="+n+`.length(); +`,u+="for(var "+a+"=0; "+a+"<"+r+"; "+a+`++) { +`,u+=i+"="+a+`; +`,u+=v(e,t.body),u+=` +} +`,u+=` lastStatement = lc.voidOperation; +`,u+=` +} +`,u+="else if (( "+n+" instanceof lang.Dictionary) || ( "+n+" instanceof lang.Feature)) {",u+="var "+r+"="+n+`.keys(); +`,u+="for(var "+a+"=0; "+a+"<"+r+".length; "+a+`++) { +`,u+=i+"="+r+"["+a+`]; +`,u+=v(e,t.body),u+=` +} +`,u+=` lastStatement = lc.voidOperation; +`,u+=` +} +`,e.isAsync&&(u+="else if (lc.isFeatureSet("+n+")) {",u+="var "+r+"="+n+`.iterator(runtimeCtx.abortSignal); +`,u+="for(var "+a+"=lang. graphicToFeature( yield "+r+".next(),"+n+", runtimeCtx); "+a+"!=null; "+a+"=lang. graphicToFeature( yield "+r+".next(),"+n+`, runtimeCtx)) { +`,u+=i+"="+a+`; +`,u+=v(e,t.body),u+=` +} +`,u+=` lastStatement = lc.voidOperation; +`,u+=` +} +`),u+=`else { lastStatement = lc.voidOperation; } +`,u}function xs(e,t){let n=`lastStatement = lc.voidOperation; +`;t.init!==null&&(n+=v(e,t.init)+"; ");const r=Ie(e),a=Ie(e);return n+="var "+r+" = true; ",n+=` + do { `,t.update!==null&&(n+=" if ("+r+`===false) { + `+v(e,t.update)+` +} + `+r+`=false; +`),t.test!==null&&(n+="var "+a+" = "+v(e,t.test)+"; ",n+="if ("+a+"===false) { break; } else if ("+a+"!==true) { lang.error('"+c.BooleanConditionRequired+`'); } +`),n+=v(e,t.body),t.update!==null&&(n+=` + `+v(e,t.update)),n+=` +`+r+` = true; +} while(true); lastStatement = lc.voidOperation; `,n}function Fs(e,t){let n=null,r="";if(t.argument.type==="MemberExpression")return n=v(e,t.argument.object),t.argument.computed===!0?r=v(e,t.argument.property):(r="'"+t.argument.property.name+"'",De(t.argument.property.name)),"lang.memberupdate("+n+","+r+",'"+t.operator+"',"+t.prefix+")";if(n=t.argument.name.toLowerCase(),De(n),e.localScope!==null){if(e.localScope[n]!==void 0)return"lang.update(lscope, '"+n+"','"+t.operator+"',"+t.prefix+")";if(e.localScope._SymbolsMap[n]!==void 0)return"lang.update(lscope, '"+e.localScope._SymbolsMap[n]+"','"+t.operator+"',"+t.prefix+")"}if(e.globalScope[n]!==void 0)return"lang.update(gscope, '"+n+"','"+t.operator+"',"+t.prefix+")";if(e.globalScope._SymbolsMap[n]!==void 0)return"lang.update(gscope, '"+e.globalScope._SymbolsMap[n]+"','"+t.operator+"',"+t.prefix+")";if(e.localScope!==null){if(e.undeclaredGlobalsInFunctions.has(n))return"lang.update(gscope,lang.chkAssig( '"+e.undeclaredGlobalsInFunctions.get(n).manglename+"',runtimeCtx),'"+t.operator+"',"+t.prefix+")";const a={manglename:ve(e),node:t.argument};return e.undeclaredGlobalsInFunctions.set(n,a),"lang.update(gscope, lang.chkAssig('"+a.manglename+"',runtimeCtx),'"+t.operator+"',"+t.prefix+")"}throw new f(e,c.InvalidIdentifier,t)}function Cs(e,t){let n=`lastStatement = lc.voidOperation; +`;const r=Ie(e);return n+=` + var ${r} = true; + do { + ${r} = ${v(e,t.test)}; + if (${r}==false) { + break; + } + if (${r}!==true) { + lang.error('${c.BooleanConditionRequired}'); + } + ${v(e,t.body)} + } + while (${r} !== false); + lastStatement = lc.voidOperation; + `,n}function As(e,t){const n=v(e,t.right);let r=null,a="";if(t.left.type==="MemberExpression")return r=v(e,t.left.object),t.left.computed===!0?a=v(e,t.left.property):(a="'"+t.left.property.name+"'",De(t.left.property.name)),"lang.assignmember("+r+","+a+",'"+t.operator+"',"+n+")";if(r=t.left.name.toLowerCase(),De(r),e.localScope!==null){if(e.localScope[r]!==void 0)return"lscope['"+r+"']=lang.assign("+n+",'"+t.operator+"', lscope['"+r+"'])";if(e.localScope._SymbolsMap[r]!==void 0)return"lscope['"+e.localScope._SymbolsMap[r]+"']=lang.assign("+n+",'"+t.operator+"', lscope['"+e.localScope._SymbolsMap[r]+"'])"}if(e.globalScope[r]!==void 0)return"gscope['"+r+"']=lang.assign("+n+",'"+t.operator+"', gscope['"+r+"'])";if(e.globalScope._SymbolsMap[r]!==void 0)return"gscope['"+e.globalScope._SymbolsMap[r]+"']=lang.assign("+n+",'"+t.operator+"', gscope['"+e.globalScope._SymbolsMap[r]+"'])";if(e.localScope!==null){if(e.undeclaredGlobalsInFunctions.has(r))return"gscope[lang.chkAssig('"+e.undeclaredGlobalsInFunctions.get(r).manglename+"',runtimeCtx)]=lang.assign("+n+",'"+t.operator+"', gscope['"+e.undeclaredGlobalsInFunctions.get(r).manglename+"'])";const u={manglename:ve(e),node:t.argument};return e.undeclaredGlobalsInFunctions.set(r,u),"gscope[lang.chkAssig('"+u.manglename+"',runtimeCtx)]=lang.assign("+n+",'"+t.operator+"', gscope['"+u.manglename+"'])"}throw new f(e,c.InvalidIdentifier,t)}function Es(e,t){return t.expression.type==="AssignmentExpression"?"lastStatement = lc.voidOperation; "+v(e,t.expression)+`; + `:(t.expression.type,"lastStatement = "+v(e,t.expression)+"; ")}function Mr(e,t){return t.type==="BlockStatement"?v(e,t):t.type==="ReturnStatement"||t.type==="BreakStatement"||t.type==="ContinueStatement"?v(e,t)+"; ":t.type==="UpdateExpression"?"lastStatement = "+v(e,t)+"; ":t.type==="ExpressionStatement"?v(e,t):t.type==="ObjectExpression"?"lastStatement = "+v(e,t)+"; ":v(e,t)+"; "}function vi(e,t){if(t.test.type==="AssignmentExpression"||t.test.type==="UpdateExpression")throw new ue(e,c.BooleanConditionRequired,t);return`if (lang.mustBoolean(${v(e,t.test)}, runtimeCtx) === true) { + ${Mr(e,t.consequent)} + } `+(t.alternate!==null?t.alternate.type==="IfStatement"?" else "+vi(e,t.alternate):` else { + ${Mr(e,t.alternate)} + } +`:` else { + lastStatement = lc.voidOperation; + } +`)}function Rn(e,t){let n="";for(let r=0;r0&&(u+=", "),u+=v(e,t.arguments[s]);return u+="]",e.isAsync?"(yield lang.callModuleFunction("+v(e,t.callee.object)+","+u+","+a+",runtimeCtx))":"lang.callModuleFunction("+v(e,t.callee.object)+","+u+","+a+",runtimeCtx)"}if(t.callee.type!=="Identifier")throw new ue(e,c.FunctionNotFound,t);const n=t.callee.name.toLowerCase();if(n==="iif")return Ps(e,t);if(n==="when")return Us(e,t);if(n==="decode")return Gs(e,t);let r="";if(e.localScope!==null&&(e.localScope[n]!==void 0?r="lscope['"+n+"']":e.localScope._SymbolsMap[n]!==void 0&&(r="lscope['"+e.localScope._SymbolsMap[n]+"']")),r===""){if(e.globalScope[n]!==void 0)r="gscope['"+n+"']";else if(e.globalScope._SymbolsMap[n]!==void 0)r="gscope['"+e.globalScope._SymbolsMap[n]+"']";else if(e.localScope!==null)if(e.undeclaredGlobalsInFunctions.has(n))r="gscope[lang.chkAssig('"+e.undeclaredGlobalsInFunctions.get(n).manglename+"',runtimeCtx)]";else{const a={manglename:ve(e),node:t.argument};e.undeclaredGlobalsInFunctions.set(n,a),r="gscope[lang.chkAssig('"+a.manglename+"',runtimeCtx)]"}}if(r!==""){let a="[";for(let u=0;u0&&(a+=", "),a+=v(e,t.arguments[u]);return a+="]",e.isAsync?"(yield lang.callfunc("+r+","+a+",runtimeCtx) )":"lang.callfunc("+r+","+a+",runtimeCtx)"}throw new ue(e,c.FunctionNotFound,t)}catch(n){throw n}}function Ps(e,t){try{if(t.arguments.length!==3)throw new ue(e,c.WrongNumberOfParameters,t);const n=Ie(e);return`${e.isAsync?`(yield (function() { + return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} + var ${n} = ${v(e,t.arguments[0])}; + + if (${n} === true) { + return ${v(e,t.arguments[1])}; + } + else if (${n} === false) { + return ${v(e,t.arguments[2])}; + } + else { + lang.error('ExecutionErrorCodes.BooleanConditionRequired'); + } + ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function Us(e,t){try{if(t.arguments.length<3)throw new ue(e,c.WrongNumberOfParameters,t);if(t.arguments.length%2==0)throw new ue(e,c.WrongNumberOfParameters,t);const n=Ie(e);let r="var ";for(let a=0;a{throw new f(e,c.Unrecognised,t)})}catch(n){throw n}},te.decode=function(e,t){try{return we(e,t,(n,r,a)=>{throw new f(e,c.Unrecognised,t)})}catch(n){throw n}},te.when=function(e,t){try{return we(e,t,(n,r,a)=>{throw new f(e,c.Unrecognised,t)})}catch(n){throw n}};const ct={};for(const e in te)ct[e]=new He(te[e]);Xn(te,we);for(const e in te)te[e]=new He(te[e]);const er=function(){};er.prototype=te;const tr=function(){};function Si(e,t,n){const r={};e||(e={}),n||(n={}),r._SymbolsMap={},r.textformatting=1,r.infinity=1,r.pi=1;for(const a in t)r[a]=1;for(const a in n)r[a]=1;for(const a in e)r[a]=1;return r}function Ii(e,t,n,r){const a=n?new tr:new er;e||(e={}),t||(t={});const u=new k({newline:` +`,tab:" ",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});u.immutable=!1,a._SymbolsMap={textformatting:1,infinity:1,pi:1},a.textformatting=u,a.infinity=Number.POSITIVE_INFINITY,a.pi=Math.PI;for(const s in t)a[s]=t[s],a._SymbolsMap[s]=1;for(const s in e)a._SymbolsMap[s]=1,e[s]&&e[s].declaredClass==="esri.Graphic"?a[s]=Y.createFromGraphic(e[s],r??null):a[s]=e[s];return a}tr.prototype=ct;function We(e,t){const n={mode:t,compiled:!0,functions:{},signatures:[],standardFunction:we,standardFunctionAsync:we,evaluateIdentifier:zs};for(let r=0;r0){if(n.substr(0,2).toLowerCase()!=="_t"&&e.localStack[e.localStack.length-1][n]!==void 0)return e.localStack[e.localStack.length-1][n];const a=e.mangleMap[n];if(a!==void 0&&e.localStack[e.localStack.length-1][a]!==void 0)return e.localStack[e.localStack.length-1][a]}if(n.substr(0,2).toLowerCase()!=="_t"&&e.globalScope[n]!==void 0||e.globalScope._SymbolsMap[n]===1)return e.globalScope[n];const r=e.mangleMap[n];return r!==void 0?e.globalScope[r]:void 0}We([Tn],"sync"),We([Tn],"async");let gn=0;const ki={error(e){throw new f(null,e,null)},__awaiter:(e,t,n,r)=>new Promise((a,u)=>{function s(l){try{o(r.next(l))}catch(d){u(d)}}function i(l){try{o(r.throw(l))}catch(d){u(d)}}function o(l){l.done?a(l.value):l.value&&l.value.then?l.value.then(s,i):(gn++,gn%100==0?setTimeout(()=>{gn=0,s(l.value)},0):s(l.value))}o((r=r.apply(e,t||[])).next())}),functionDepthchecker:(e,t)=>function(){if(t.depthCounter.depth++,t.localStack.push([]),t.depthCounter.depth>64)throw new f(null,c.MaximumCallDepth,null);const n=e.apply(this,arguments);return Ue(n)?n.then(r=>(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,r)):(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,n)},chkAssig(e,t){if(t.gdefs[e]===void 0)throw new f(t,c.InvalidIdentifier,null);return e},mustBoolean(e,t){if(e===!0||e===!1)return e;throw new f(t,c.BooleanConditionRequired,null)},setAssig:(e,t)=>(t.gdefs[e]=1,e),castString:e=>A(e),aCheck(e,t){if(K(e))throw t==="ArrayExpression"?new f(null,c.NoFunctionInArray,null):t==="ObjectExpression"?new f(null,c.NoFunctionInDictionary,null):new f(null,c.NoFunctionInTemplateLiteral,null);return e===C?null:e},Dictionary:k,Feature:Y,UserDefinedCompiledFunction:Ds,dictionary(e){const t={},n=new Map;for(let a=0;a>":case">>>":case"^":case"&":return Kn(m(e),m(t),n);case"==":case"=":return Fe(e,t);case"!=":return!Fe(e,t);case"<":case">":case"<=":case">=":return Wn(e,t,n);case"+":return b(e)||b(t)?A(e)+A(t):m(e)+m(t);case"-":return m(e)-m(t);case"*":return m(e)*m(t);case"/":return m(e)/m(t);case"%":return m(e)%m(t);default:throw new f(null,c.UnsupportedOperator,null)}},assign(e,t,n){switch(t){case"=":return e===C?null:e;case"/=":return m(n)/m(e);case"*=":return m(n)*m(e);case"-=":return m(n)-m(e);case"+=":return b(n)||b(e)?A(n)+A(e):m(n)+m(e);case"%=":return m(n)%m(e);default:throw new f(null,c.UnsupportedOperator,null)}},update(e,t,n,r){const a=m(e[t]);return e[t]=n==="++"?a+1:a-1,r===!1?a:n==="++"?a+1:a-1},graphicToFeature:(e,t,n)=>e===null?null:Y.createFromGraphicLikeObject(e.geometry,e.attributes,t,n.timeReference),memberupdate(e,t,n,r){let a;if(B(e)){if(!G(t))throw new f(null,c.ArrayAccessorMustBeNumber,null);if(t<0&&(t=e.length+t),t<0||t>=e.length)throw new f(null,c.OutOfBounds,null);a=m(e[t]),e[t]=n==="++"?a+1:a-1}else if(e instanceof k){if(b(t)===!1)throw new f(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)!==!0)throw new f(null,c.FieldNotFound,null,{key:t});a=m(e.field(t)),e.setField(t,n==="++"?a+1:a-1)}else if(Q(e)){if(b(t)===!1)throw new f(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)!==!0)throw new f(null,c.FieldNotFound,null);a=m(e.field(t)),e.setField(t,n==="++"?a+1:a-1)}else{if(L(e))throw new f(null,c.Immutable,null);if(!(e instanceof yt))throw new f(null,c.InvalidIdentifier,null);if(b(t)===!1)throw new f(null,c.ModuleAccessorMustBeString,null);if(e.hasGlobal(t)!==!0)throw new f(null,c.ModuleExportNotFound,null);a=m(e.global(t)),e.setGlobal(t,n==="++"?a+1:a-1)}return r===!1?a:n==="++"?a+1:a-1},assignmember(e,t,n,r){if(B(e)){if(!G(t))throw new f(null,c.ArrayAccessorMustBeNumber,null);if(t<0&&(t=e.length+t),t<0||t>e.length)throw new f(null,c.OutOfBounds,null);if(t===e.length){if(n!=="=")throw new f(null,c.OutOfBounds,null);e[t]=this.assign(r,n,e[t])}else e[t]=this.assign(r,n,e[t])}else if(e instanceof k){if(b(t)===!1)throw new f(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)===!0)e.setField(t,this.assign(r,n,e.field(t)));else{if(n!=="=")throw new f(null,c.FieldNotFound,null);e.setField(t,this.assign(r,n,null))}}else if(Q(e)){if(b(t)===!1)throw new f(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)===!0)e.setField(t,this.assign(r,n,e.field(t)));else{if(n!=="=")throw new f(null,c.FieldNotFound,null);e.setField(t,this.assign(r,n,null))}}else{if(L(e))throw new f(null,c.Immutable,null);if(!(e instanceof yt))throw new f(null,c.InvalidIdentifier,null);if(b(t)===!1)throw new f(null,c.ModuleAccessorMustBeString,null);if(!e.hasGlobal(t))throw new f(null,c.ModuleExportNotFound,null);e.setGlobal(t,this.assign(r,n,e.global(t)))}},member(e,t){if(e===null)throw new f(null,c.MemberOfNull,null);if(e instanceof k||Q(e)){if(b(t))return e.field(t);throw new f(null,c.InvalidMemberAccessKey,null)}if(e instanceof T){if(b(t))return bt(e,t,null,null);throw new f(null,c.InvalidMemberAccessKey,null)}if(B(e)){if(G(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length+t),t>=e.length||t<0)throw new f(null,c.OutOfBounds,null);return e[t]}throw new f(null,c.InvalidMemberAccessKey,null)}if(b(e)){if(G(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length+t),t>=e.length||t<0)throw new f(null,c.OutOfBounds,null);return e[t]}throw new f(null,c.InvalidMemberAccessKey,null)}if(L(e)){if(G(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length()+t),t>=e.length()||t<0)throw new f(null,c.OutOfBounds,null);return e.get(t)}throw new f(null,c.InvalidMemberAccessKey,null)}if(e instanceof yt){if(b(t))return e.global(t);throw new f(null,c.InvalidMemberAccessKey,null)}throw new f(null,c.InvalidMemberAccessKey,null)},callfunc:(e,t,n)=>e.call(n,{arguments:t,preparsed:!0}),loadModule(e,t){const n=t.moduleFactoryMap[e];if(t.moduleSingletons[n])return t.moduleSingletons[n];const r=t.moduleFactory[n]({vars:{},moduleSingletons:t.moduleSingletons,depthCounter:t.depthCounter,console:t.console,abortSignal:t.abortSignal,isAsync:t.isAsync,services:t.services,lrucache:t.lrucache,timeReference:t.timeReference??null,interceptor:t.interceptor},t.spatialReference);return t.moduleSingletons[n]=r,r},callModuleFunction(e,t,n,r){if(!(e instanceof yt))throw new f(null,c.FunctionNotFound,null);const a=e.global(n);if(K(a)===!1)throw new f(null,c.CallNonFunction,null);return a.call(r,{preparsed:!0,arguments:t})}};function Zt(e){console.log(e)}function Bi(e,t,n=!1){t===null&&(t={vars:{},customfunctions:{}});let r=null;e.usesModules&&(r=new tn(null,e.loadedModules));const a={isAsync:n,globalScope:Si(t.vars,n?ct:te,t.customfunctions),moduleFactory:{},moduleFactoryMap:{},undeclaredGlobalsInFunctions:new Map,customfunctions:t.customfunctions,libraryResolver:r,localScope:null,mangleMap:{},depthCounter:{depth:1},exports:{},console:Zt,lrucache:t.lrucache,timeReference:t.timeReference??null,interceptor:t.interceptor,services:t.services,symbols:{symbolCounter:0}};let u=v(a,e);u===""&&(u="lc.voidOperation; "),a.undeclaredGlobalsInFunctions.size>0&&a.undeclaredGlobalsInFunctions.forEach(p=>{throw new ue(t,c.InvalidIdentifier,p.node)});let s="";s=n?`var runtimeCtx=this.prepare(context, true); + var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; +return lang.__awaiter(this, void 0, void 0, function* () { + + function mainBody() { + var lastStatement=lc.voidOperation; + return lang.__awaiter(this, void 0, void 0, function* () { +`+u+` + return lastStatement; }); } + return this.postProcess(yield mainBody()); }); `:`var runtimeCtx=this.prepare(context, false); + var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; + function mainBody() { + var lastStatement=lc.voidOperation; + `+u+` + return lastStatement; } + return this.postProcess(mainBody()); `;const i=a.moduleFactory,o=a.moduleFactoryMap,l=a.exports,d={};for(const p in l)d[p]=a.mangleMap[p]!==void 0?a.mangleMap[p]:p;const h={lc:ci,lang:ki,mangles:a.mangleMap,postProcess(p){if(p instanceof me&&(p=p.value),p instanceof st&&(p=p.value),p===C&&(p=null),p===Ee)throw new f(null,c.IllegalResult,null);if(p===ht)throw new f(null,c.IllegalResult,null);if(K(p))throw new f(null,c.IllegalResult,null);return p},prepare(p,g){let w=p.spatialReference;w==null&&(w=It.WebMercator);const _=Ii(p.vars,p.customfunctions,g,p.timeReference);return{localStack:[],isAsync:g,moduleFactory:i,moduleFactoryMap:o,mangleMap:this.mangles,moduleSingletons:{},exports:l,gdefs:{},exportmangle:d,spatialReference:w,globalScope:_,abortSignal:p.abortSignal===void 0||p.abortSignal===null?{aborted:!1}:p.abortSignal,localScope:null,services:p.services,console:p.console??Zt,lrucache:p.lrucache,timeReference:p.timeReference??null,interceptor:p.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return new Function("context","spatialReference",s).bind(h)}async function js(){return We([await Ne(()=>import("./geomasync-463bba62.js"),["assets/geomasync-463bba62.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/geometryEngineAsync-e8b91fe5.js","assets/executionError-c92d3b85.js","assets/portalUtils-2eff95c6.js","assets/arcadeTimeUtils-e1438cc8.js","assets/FieldsIndex-f79a8f26.js","assets/number-e5825aa4.js","assets/hash-6f442295.js"])],"async"),!0}class yt extends kt{constructor(t){super(null),this.moduleContext=t}hasGlobal(t){return this.moduleContext.exports[t]===void 0&&(t=t.toLowerCase()),this.moduleContext.exports[t]!==void 0}setGlobal(t,n){const r=this.moduleContext.globalScope,a=t.toLowerCase();if(K(n))throw new f(null,c.AssignModuleFunction,null);r[this.moduleContext.exportmangle[a]]=n}global(t){const n=this.moduleContext.globalScope;t=t.toLowerCase();const r=n[this.moduleContext.exportmangle[t]];if(r===void 0)throw new f(null,c.InvalidIdentifier,null);if(K(r)&&!(r instanceof Le)){const a=new Le;return a.fn=r,a.parameterEvaluator=we,a.context=this.moduleContext,n[this.moduleContext.exportmangle[t]]=a,a}return r}}function qs(e,t,n=!1){const r={isAsync:n,moduleFactory:t.moduleFactory,moduleFactoryMap:{},libraryResolver:new tn(null,e.loadedModules),globalScope:Si(t.vars,n?ct:te,t.customfunctions),customfunctions:t.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map,depthCounter:{depth:1},exports:{},console:Zt,lrucache:t.lrucache,timeReference:t.timeReference??null,interceptor:t.interceptor,services:t.services,symbols:{symbolCounter:0}};let a=v(r,e);a===""&&(a="lc.voidOperation; ");let u="";u=n?`var runtimeCtx=this.prepare(context, true); + var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; +return lang.__awaiter(this, void 0, void 0, function* () { + + function mainBody() { + var lastStatement=lc.voidOperation; + return lang.__awaiter(this, void 0, void 0, function* () { +`+a+` + return lastStatement; }); } + yield mainBody(); + return this.prepareModule(runtimeCtx); }); `:`var runtimeCtx=this.prepare(context, false); + var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; + function mainBody() { + var lastStatement=lc.voidOperation; + `+a+` + return lastStatement; } + mainBody(); + return this.prepareModule(runtimeCtx); `;const s=r.moduleFactory,i=r.moduleFactoryMap,o=r.exports,l={};for(const h in o)l[h]=r.mangleMap[h]!==void 0?r.mangleMap[h]:h;const d={lc:ci,lang:ki,mangles:r.mangleMap,prepareModule:h=>new yt(h),prepare(h,p){let g=h.spatialReference;g==null&&(g=new It({wkid:102100}));const w=Ii(h.vars,h.customfunctions,p,h.timeReference);return{localStack:[],isAsync:p,exports:o,exportmangle:l,gdefs:{},moduleFactory:s,moduleFactoryMap:i,moduleSingletons:h.moduleSingletons,mangleMap:this.mangles,spatialReference:g,globalScope:w,abortSignal:h.abortSignal===void 0||h.abortSignal===null?{aborted:!1}:h.abortSignal,localScope:null,services:h.services,console:h.console??Zt,lrucache:h.lrucache,timeReference:h.timeReference??null,interceptor:h.interceptor,symbols:{symbolCounter:0},depthCounter:h.depthCounter}}};return new Function("context","spatialReference",u).bind(d)}var N,F;(function(e){e.Break="break",e.Continue="continue",e.Else="else",e.False="false",e.For="for",e.From="from",e.Function="function",e.If="if",e.Import="import",e.Export="export",e.In="in",e.Null="null",e.Return="return",e.True="true",e.Var="var",e.While="while"})(N||(N={})),function(e){e.AssignmentExpression="AssignmentExpression",e.ArrayExpression="ArrayExpression",e.BlockComment="BlockComment",e.BlockStatement="BlockStatement",e.BinaryExpression="BinaryExpression",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.ContinueStatement="ContinueStatement",e.EmptyStatement="EmptyStatement",e.ExpressionStatement="ExpressionStatement",e.ExportNamedDeclaration="ExportNamedDeclaration",e.ExportSpecifier="ExportSpecifier",e.ForStatement="ForStatement",e.ForInStatement="ForInStatement",e.FunctionDeclaration="FunctionDeclaration",e.Identifier="Identifier",e.IfStatement="IfStatement",e.ImportDeclaration="ImportDeclaration",e.ImportDefaultSpecifier="ImportDefaultSpecifier",e.LineComment="LineComment",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.ObjectExpression="ObjectExpression",e.Program="Program",e.Property="Property",e.ReturnStatement="ReturnStatement",e.TemplateElement="TemplateElement",e.TemplateLiteral="TemplateLiteral",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement"}(F||(F={}));const On=["++","--"],Ti=["-","+","!","~"],_i=["=","/=","*=","%=","+=","-="],Mi=["||","&&"],Js=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"],Vs={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10};var E;(function(e){e[e.Unknown=0]="Unknown",e[e.BooleanLiteral=1]="BooleanLiteral",e[e.EOF=2]="EOF",e[e.Identifier=3]="Identifier",e[e.Keyword=4]="Keyword",e[e.NullLiteral=5]="NullLiteral",e[e.NumericLiteral=6]="NumericLiteral",e[e.Punctuator=7]="Punctuator",e[e.StringLiteral=8]="StringLiteral",e[e.Template=10]="Template"})(E||(E={}));const Zs=["Unknown","Boolean","","Identifier","Keyword","Null","Numeric","Punctuator","String","RegularExpression","Template"];var x;(function(e){e.InvalidModuleUri="InvalidModuleUri",e.ForInOfLoopInitializer="ForInOfLoopInitializer",e.IdentiferExpected="IdentiferExpected",e.InvalidEscapedReservedWord="InvalidEscapedReservedWord",e.InvalidExpression="InvalidExpression",e.InvalidFunctionIdentifier="InvalidFunctionIdentifier",e.InvalidHexEscapeSequence="InvalidHexEscapeSequence",e.InvalidLeftHandSideInAssignment="InvalidLeftHandSideInAssignment",e.InvalidLeftHandSideInForIn="InvalidLeftHandSideInForIn",e.InvalidTemplateHead="InvalidTemplateHead",e.InvalidVariableAssignment="InvalidVariableAssignment",e.KeyMustBeString="KeyMustBeString",e.NoFunctionInsideBlock="NoFunctionInsideBlock",e.NoFunctionInsideFunction="NoFunctionInsideFunction",e.ModuleExportRootOnly="ModuleExportRootOnly",e.ModuleImportRootOnly="ModuleImportRootOnly",e.PunctuatorExpected="PunctuatorExpected",e.TemplateOctalLiteral="TemplateOctalLiteral",e.UnexpectedBoolean="UnexpectedBoolean",e.UnexpectedEndOfScript="UnexpectedEndOfScript",e.UnexpectedIdentifier="UnexpectedIdentifier",e.UnexpectedKeyword="UnexpectedKeyword",e.UnexpectedNull="UnexpectedNull",e.UnexpectedNumber="UnexpectedNumber",e.UnexpectedPunctuator="UnexpectedPunctuator",e.UnexpectedString="UnexpectedString",e.UnexpectedTemplate="UnexpectedTemplate",e.UnexpectedToken="UnexpectedToken"})(x||(x={}));const Hs={[x.InvalidModuleUri]:"Module uri must be a text literal.",[x.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[x.IdentiferExpected]:"'${value}' is an invalid identifier.",[x.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[x.InvalidExpression]:"Invalid expression.",[x.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[x.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[x.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[x.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.",[x.InvalidTemplateHead]:"Invalid template structure.",[x.InvalidVariableAssignment]:"Invalid variable assignment.",[x.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[x.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[x.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[x.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[x.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.",[x.PunctuatorExpected]:"'${value}' expected.",[x.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[x.UnexpectedBoolean]:"Unexpected boolean literal.",[x.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[x.UnexpectedIdentifier]:"Unexpected identifier.",[x.UnexpectedKeyword]:"Unexpected keyword.",[x.UnexpectedNull]:"Unexpected null literal.",[x.UnexpectedNumber]:"Unexpected number.",[x.UnexpectedPunctuator]:"Unexpected ponctuator.",[x.UnexpectedString]:"Unexpected text literal.",[x.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[x.UnexpectedToken]:"Unexpected token '${value}'."};let St=class $i extends Error{constructor({code:t,index:n,line:r,column:a,len:u=0,description:s,data:i}){var o;super(`${s??t}`),this.declaredRootClass="esri.arcade.lib.parsingerror",this.name="ParsingError",this.code=t,this.index=n,this.line=r,this.column=a,this.len=u,this.data=i,this.description=s,this.range={start:{line:r,column:a-1},end:{line:r,column:a+u}},(o=Error.captureStackTrace)==null||o.call(Error,this,$i)}};function Ws(e){return(e==null?void 0:e.type)===F.Program}function $r(e){return(e==null?void 0:e.type)===F.BlockStatement}function Ks(e){return(e==null?void 0:e.type)===F.BlockComment}function Ys(e){return(e==null?void 0:e.type)===F.EmptyStatement}function Xs(e){return(e==null?void 0:e.type)===F.VariableDeclarator}function yn(e,t){return!!t&&t.loc.end.line===e.loc.start.line&&t.loc.end.column<=e.loc.start.column}function Nr(e,t){return e.range[0]>=t.range[0]&&e.range[1]<=t.range[1]}let Qs=class{constructor(){this.comments=[],this._nodeStack=[],this._newComments=[]}insertInnerComments(t){if(!$r(t)||t.body.length!==0)return;const n=[];for(let r=this._newComments.length-1;r>=0;--r){const a=this._newComments[r];t.range[1]>=a.range[0]&&(n.unshift(a),this._newComments.splice(r,1))}n.length&&(t.innerComments=n)}attachTrailingComments(t){if(!t)return;const n=this._nodeStack[this._nodeStack.length-1];if($r(t)&&Nr(n,t))for(let a=this._newComments.length-1;a>=0;--a){const u=this._newComments[a];Nr(u,t)&&(n.trailingComments=[...n.trailingComments??[],u],this._newComments.splice(a,1))}let r=[];if(this._newComments.length>0)for(let a=this._newComments.length-1;a>=0;--a){const u=this._newComments[a];yn(u,n)?(n.trailingComments=[...n.trailingComments??[],u],this._newComments.splice(a,1)):yn(u,t)&&(r.unshift(u),this._newComments.splice(a,1))}n!=null&&n.trailingComments&&yn(n.trailingComments[0],t)&&(r=[...r,...n.trailingComments],delete n.trailingComments),r.length>0&&(t.trailingComments=r)}attachLeadingComments(t){var u,s;if(!t)return;let n;for(;this._nodeStack.length>0;){const i=this._nodeStack[this._nodeStack.length-1];if(!(t.range[0]<=i.range[0]))break;n=i,this._nodeStack.pop()}const r=[],a=[];if(n){for(let i=(((u=n.leadingComments)==null?void 0:u.length)??0)-1;i>=0;--i){const o=n.leadingComments[i];t.range[0]>=o.range[1]?(r.unshift(o),n.leadingComments.splice(i,1)):Xs(t)&&!Ks(o)&&(a.unshift(o),n.leadingComments.splice(i,1))}return((s=n.leadingComments)==null?void 0:s.length)===0&&delete n.leadingComments,r.length&&(t.leadingComments=r),void(a.length&&(t.trailingComments=[...a,...t.trailingComments??[]]))}for(let i=this._newComments.length-1;i>=0;--i){const o=this._newComments[i];t.range[0]>=o.range[0]&&(r.unshift(o),this._newComments.splice(i,1))}r.length&&(t.leadingComments=r)}attachComments(t){if(Ws(t)&&t.body.length>0){const n=this._nodeStack[this._nodeStack.length-1];return n?(n.trailingComments=[...n.trailingComments??[],...this._newComments],this._newComments.length=0,void this._nodeStack.pop()):(t.trailingComments=[...this._newComments],void(this._newComments.length=0))}this.attachTrailingComments(t),this.attachLeadingComments(t),this.insertInnerComments(t),this._nodeStack.push(t)}collectComment(t){this.comments.push(t),this._newComments.push(t)}};function Pn(e,t){const n=Hs[e];return t?n.replaceAll(/\${(.*?)}/g,(r,a)=>{var u;return((u=t[a])==null?void 0:u.toString())??""}):n}let eu=class{constructor(t=!1){this.tolerant=t,this.errors=[]}recordError(t){this.errors.push(t)}tolerate(t){if(!this.tolerant)throw t;this.recordError(t)}throwError(t){throw t.description=t.description??Pn(t.code,t.data),new St(t)}tolerateError(t){t.description=t.description??Pn(t.code,t.data);const n=new St(t);if(!this.tolerant)throw n;this.recordError(n)}};function Lr(e,t){if(!e)throw new Error("ASSERT: "+t)}const Rr={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDEC0-\uDEEB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD30-\uDD39\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD46\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E\uDC5F\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCE9\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},O={fromCodePoint:e=>e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023)),isWhiteSpace:e=>e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e),isLineTerminator:e=>e===10||e===13||e===8232||e===8233,isIdentifierStart:e=>e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Rr.NonAsciiIdentifierStart.test(O.fromCodePoint(e)),isIdentifierPart:e=>e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Rr.NonAsciiIdentifierPart.test(O.fromCodePoint(e)),isDecimalDigit:e=>e>=48&&e<=57,isHexDigit:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,isOctalDigit:e=>e>=48&&e<=55};function Or(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function wn(e){return"01234567".indexOf(e)}const Ve=[[],[],[]];On.forEach(e=>Ve[e.length-1].push(e)),Ti.forEach(e=>Ve[e.length-1].push(e)),Mi.forEach(e=>Ve[e.length-1].push(e)),_i.forEach(e=>Ve[e.length-1].push(e)),Js.forEach(e=>Ve[e.length-1].push(e));let tu=class{constructor(t,n){this.source=t,this.errorHandler=n,this._length=t.length,this.index=0,this.lineNumber=1,this.lineStart=0,this.curlyStack=[]}saveState(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart,curlyStack:this.curlyStack.slice()}}restoreState(t){this.index=t.index,this.lineNumber=t.lineNumber,this.lineStart=t.lineStart,this.curlyStack=t.curlyStack}eof(){return this.index>=this._length}throwUnexpectedToken(t=x.UnexpectedToken){this.errorHandler.throwError({code:t,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}tolerateUnexpectedToken(t=x.UnexpectedToken){this.errorHandler.tolerateError({code:t,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}skipSingleLineComment(t){const n=[],r=this.index-t,a={start:{line:this.lineNumber,column:this.index-this.lineStart-t},end:{line:0,column:0}};for(;!this.eof();){const u=this.source.charCodeAt(this.index);if(++this.index,O.isLineTerminator(u)){if(a){a.end={line:this.lineNumber,column:this.index-this.lineStart-1};const s={multiLine:!1,start:r+t,end:this.index-1,range:[r,this.index-1],loc:a};n.push(s)}return u===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,n}}if(a){a.end={line:this.lineNumber,column:this.index-this.lineStart};const u={multiLine:!1,start:r+t,end:this.index,range:[r,this.index],loc:a};n.push(u)}return n}skipMultiLineComment(){const t=[],n=this.index-2,r={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{line:0,column:0}};for(;!this.eof();){const a=this.source.charCodeAt(this.index);if(O.isLineTerminator(a))a===13&&this.source.charCodeAt(this.index+1)===10&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(a===42){if(this.source.charCodeAt(this.index+1)===47){if(this.index+=2,r){r.end={line:this.lineNumber,column:this.index-this.lineStart};const u={multiLine:!0,start:n+2,end:this.index-2,range:[n,this.index],loc:r};t.push(u)}return t}++this.index}else++this.index}if(r){r.end={line:this.lineNumber,column:this.index-this.lineStart};const a={multiLine:!0,start:n+2,end:this.index,range:[n,this.index],loc:r};t.push(a)}return this.tolerateUnexpectedToken(),t}scanComments(){let t=[];for(;!this.eof();){let n=this.source.charCodeAt(this.index);if(O.isWhiteSpace(n))++this.index;else if(O.isLineTerminator(n))++this.index,n===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index;else{if(n!==47)break;if(n=this.source.charCodeAt(this.index+1),n===47){this.index+=2;const r=this.skipSingleLineComment(2);t=[...t,...r]}else{if(n!==42)break;{this.index+=2;const r=this.skipMultiLineComment();t=[...t,...r]}}}}return t}isKeyword(t){switch((t=t.toLowerCase()).length){case 2:return t===N.If||t===N.In;case 3:return t===N.Var||t===N.For;case 4:return t===N.Else;case 5:return t===N.Break||t===N.While;case 6:return t===N.Return||t===N.Import||t===N.Export;case 8:return t===N.Function||t===N.Continue;default:return!1}}codePointAt(t){let n=this.source.charCodeAt(t);if(n>=55296&&n<=56319){const r=this.source.charCodeAt(t+1);r>=56320&&r<=57343&&(n=1024*(n-55296)+r-56320+65536)}return n}scanHexEscape(t){const n=t==="u"?4:2;let r=0;for(let a=0;a1114111||t!=="}")&&this.throwUnexpectedToken(),O.fromCodePoint(n)}getIdentifier(){const t=this.index++;for(;!this.eof();){const n=this.source.charCodeAt(this.index);if(n===92)return this.index=t,this.getComplexIdentifier();if(n>=55296&&n<57343)return this.index=t,this.getComplexIdentifier();if(!O.isIdentifierPart(n))break;++this.index}return this.source.slice(t,this.index)}getComplexIdentifier(){let t,n=this.codePointAt(this.index),r=O.fromCodePoint(n);for(this.index+=r.length,n===92&&(this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,t=this.scanUnicodeCodePointEscape()):(t=this.scanHexEscape("u"),t!==null&&t!=="\\"&&O.isIdentifierStart(t.charCodeAt(0))||this.throwUnexpectedToken()),r=t);!this.eof()&&(n=this.codePointAt(this.index),O.isIdentifierPart(n));)t=O.fromCodePoint(n),r+=t,this.index+=t.length,n===92&&(r=r.substring(0,r.length-1),this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,t=this.scanUnicodeCodePointEscape()):(t=this.scanHexEscape("u"),t!==null&&t!=="\\"&&O.isIdentifierPart(t.charCodeAt(0))||this.throwUnexpectedToken()),r+=t);return r}octalToDecimal(t){let n=t!=="0",r=wn(t);return!this.eof()&&O.isOctalDigit(this.source.charCodeAt(this.index))&&(n=!0,r=8*r+wn(this.source[this.index++]),"0123".includes(t)&&!this.eof()&&O.isOctalDigit(this.source.charCodeAt(this.index))&&(r=8*r+wn(this.source[this.index++]))),{code:r,octal:n}}scanIdentifier(){let t;const n=this.index,r=this.source.charCodeAt(n)===92?this.getComplexIdentifier():this.getIdentifier();if(t=r.length===1?E.Identifier:this.isKeyword(r)?E.Keyword:r.toLowerCase()===N.Null?E.NullLiteral:r.toLowerCase()===N.True||r.toLowerCase()===N.False?E.BooleanLiteral:E.Identifier,t!==E.Identifier&&n+r.length!==this.index){const a=this.index;this.index=n,this.tolerateUnexpectedToken(x.InvalidEscapedReservedWord),this.index=a}return{type:t,value:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}}scanPunctuator(){const t=this.index;let n=this.source[this.index];switch(n){case"(":case"{":n==="{"&&this.curlyStack.push("{"),++this.index;break;case".":case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;case"}":++this.index,this.curlyStack.pop();break;default:for(let r=Ve.length;r>0;r--)if(n=this.source.substring(this.index,this.index+r),Ve[r-1].includes(n)){this.index+=r;break}}return this.index===t&&this.throwUnexpectedToken(),{type:E.Punctuator,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanHexLiteral(t){let n="";for(;!this.eof()&&O.isHexDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return n.length===0&&this.throwUnexpectedToken(),O.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:E.NumericLiteral,value:parseInt("0x"+n,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanBinaryLiteral(t){let n="";for(;!this.eof();){const r=this.source[this.index];if(r!=="0"&&r!=="1")break;n+=this.source[this.index++]}if(n.length===0&&this.throwUnexpectedToken(),!this.eof()){const r=this.source.charCodeAt(this.index);(O.isIdentifierStart(r)||O.isDecimalDigit(r))&&this.throwUnexpectedToken()}return{type:E.NumericLiteral,value:parseInt(n,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanOctalLiteral(t,n){let r="",a=!1;for(O.isOctalDigit(t.charCodeAt(0))?(a=!0,r="0"+this.source[this.index++]):++this.index;!this.eof()&&O.isOctalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];return a||r.length!==0||this.throwUnexpectedToken(),(O.isIdentifierStart(this.source.charCodeAt(this.index))||O.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:E.NumericLiteral,value:parseInt(r,8),lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}}scanNumericLiteral(){const t=this.index;let n=this.source[t];Lr(O.isDecimalDigit(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point");let r="";if(n!=="."){if(r=this.source[this.index++],n=this.source[this.index],r==="0"){if(n==="x"||n==="X")return++this.index,this.scanHexLiteral(t);if(n==="b"||n==="B")return++this.index,this.scanBinaryLiteral(t);if(n==="o"||n==="O")return this.scanOctalLiteral(n,t)}for(;O.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];n=this.source[this.index]}if(n==="."){for(r+=this.source[this.index++];O.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];n=this.source[this.index]}if(n==="e"||n==="E")if(r+=this.source[this.index++],n=this.source[this.index],n!=="+"&&n!=="-"||(r+=this.source[this.index++]),O.isDecimalDigit(this.source.charCodeAt(this.index)))for(;O.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];else this.throwUnexpectedToken();return O.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:E.NumericLiteral,value:parseFloat(r),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanStringLiteral(){const t=this.index;let n=this.source[t];Lr(n==="'"||n==='"',"String literal must starts with a quote"),++this.index;let r=!1,a="";for(;!this.eof();){let u=this.source[this.index++];if(u===n){n="";break}if(u==="\\")if(u=this.source[this.index++],u&&O.isLineTerminator(u.charCodeAt(0)))++this.lineNumber,u==="\r"&&this.source[this.index]===` +`&&++this.index,this.lineStart=this.index;else switch(u){case"u":if(this.source[this.index]==="{")++this.index,a+=this.scanUnicodeCodePointEscape();else{const s=this.scanHexEscape(u);s===null&&this.throwUnexpectedToken(),a+=s}break;case"x":{const s=this.scanHexEscape(u);s===null&&this.throwUnexpectedToken(x.InvalidHexEscapeSequence),a+=s;break}case"n":a+=` +`;break;case"r":a+="\r";break;case"t":a+=" ";break;case"b":a+="\b";break;case"f":a+="\f";break;case"v":a+="\v";break;case"8":case"9":a+=u,this.tolerateUnexpectedToken();break;default:if(u&&O.isOctalDigit(u.charCodeAt(0))){const s=this.octalToDecimal(u);r=s.octal||r,a+=String.fromCharCode(s.code)}else a+=u}else{if(O.isLineTerminator(u.charCodeAt(0)))break;a+=u}}return n!==""&&(this.index=t,this.throwUnexpectedToken()),{type:E.StringLiteral,value:a,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanTemplate(){let t="",n=!1;const r=this.index,a=this.source[r]==="`";let u=!1,s=2;for(++this.index;!this.eof();){let i=this.source[this.index++];if(i==="`"){s=1,u=!0,n=!0;break}if(i!=="$")if(i!=="\\")O.isLineTerminator(i.charCodeAt(0))?(++this.lineNumber,i==="\r"&&this.source[this.index]===` +`&&++this.index,this.lineStart=this.index,t+=` +`):t+=i;else if(i=this.source[this.index++],O.isLineTerminator(i.charCodeAt(0)))++this.lineNumber,i==="\r"&&this.source[this.index]===` +`&&++this.index,this.lineStart=this.index;else switch(i){case"n":t+=` +`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"u":if(this.source[this.index]==="{")++this.index,t+=this.scanUnicodeCodePointEscape();else{const o=this.index,l=this.scanHexEscape(i);l!==null?t+=l:(this.index=o,t+=i)}break;case"x":{const o=this.scanHexEscape(i);o===null&&this.throwUnexpectedToken(x.InvalidHexEscapeSequence),t+=o;break}case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:i==="0"?(O.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(x.TemplateOctalLiteral),t+="\0"):O.isOctalDigit(i.charCodeAt(0))?this.throwUnexpectedToken(x.TemplateOctalLiteral):t+=i}else{if(this.source[this.index]==="{"){this.curlyStack.push("${"),++this.index,n=!0;break}t+=i}}return n||this.throwUnexpectedToken(),a||this.curlyStack.pop(),{type:E.Template,value:this.source.slice(r+1,this.index-s),cooked:t,head:a,tail:u,lineNumber:this.lineNumber,lineStart:this.lineStart,start:r,end:this.index}}lex(){if(this.eof())return{type:E.EOF,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};const t=this.source.charCodeAt(this.index);return O.isIdentifierStart(t)?this.scanIdentifier():t===40||t===41||t===59?this.scanPunctuator():t===39||t===34?this.scanStringLiteral():t===46?O.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():O.isDecimalDigit(t)?this.scanNumericLiteral():t===96||t===125&&this.curlyStack[this.curlyStack.length-1]==="${"?this.scanTemplate():t>=55296&&t<57343&&O.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()}};var oe,Ct;function Pr(e,t=0){let n=e.start-e.lineStart,r=e.lineNumber;return n<0&&(n+=t,r--),{index:e.start,line:r,column:n}}function Ur(e){return[{index:e.range[0],...e.loc.start},{index:e.range[1],...e.loc.end}]}function Gr(e){return Vs[e]??0}(function(e){e[e.None=0]="None",e[e.Function=1]="Function",e[e.IfClause=2]="IfClause",e[e.ForLoop=4]="ForLoop",e[e.WhileLoop=8]="WhileLoop"})(oe||(oe={})),function(e){e[e.AsObject=0]="AsObject",e[e.Automatic=1]="Automatic"}(Ct||(Ct={}));class nu{constructor(t,n={},r){this.delegate=r,this.hasLineTerminator=!1,this.options={tokens:typeof n.tokens=="boolean"&&n.tokens,comments:typeof n.comments=="boolean"&&n.comments,tolerant:typeof n.tolerant=="boolean"&&n.tolerant},this.options.comments&&(this.commentHandler=new Qs),this.errorHandler=new eu(this.options.tolerant),this.scanner=new tu(t,this.errorHandler),this.context={isAssignmentTarget:!1,blockContext:oe.None,curlyParsingType:Ct.AsObject},this.rawToken={type:E.EOF,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.endMarker={index:0,line:this.scanner.lineNumber,column:0},this.readNextRawToken(),this.endMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}throwIfInvalidType(t,n,{validTypes:r,invalidTypes:a}){r!=null&&r.some(u=>t.type===u)||a!=null&&a.some(u=>t.type===u)&&this.throwError(x.InvalidExpression,n)}throwError(t,n,r=this.endMarker){const{index:a,line:u,column:s}=n,i=r.index-a-1;this.errorHandler.throwError({code:t,index:a,line:u,column:s+1,len:i})}tolerateError(t,n){throw new Error("######################################### !!!")}unexpectedTokenError(t={}){const{rawToken:n}=t;let r,{code:a,data:u}=t;if(n){if(!a)switch(n.type){case E.EOF:a=x.UnexpectedEndOfScript;break;case E.Identifier:a=x.UnexpectedIdentifier;break;case E.NumericLiteral:a=x.UnexpectedNumber;break;case E.StringLiteral:a=x.UnexpectedString;break;case E.Template:a=x.UnexpectedTemplate}r=n.value.toString()}else r="ILLEGAL";a=a??x.UnexpectedToken,u||(u={value:r});const s=Pn(a,u);if(n){const l=n.start,d=n.lineNumber,h=n.start-n.lineStart+1;return new St({code:a,index:l,line:d,column:h,len:n.end-n.start-1,data:u,description:s})}const{index:i,line:o}=this.endMarker;return new St({code:a,index:i,line:o,column:this.endMarker.column+1,data:u,description:s})}throwUnexpectedToken(t={}){throw t.rawToken=t.rawToken??this.rawToken,this.unexpectedTokenError(t)}collectComments(t){const{commentHandler:n}=this;n&&t.length&&t.forEach(r=>{const a={type:r.multiLine?F.BlockComment:F.LineComment,value:this.getSourceValue(r),range:r.range,loc:r.loc};n.collectComment(a)})}peekAhead(t){const n=()=>(this.scanner.scanComments(),this.scanner.lex()),r=this.scanner.saveState(),a=t.call(this,n);return this.scanner.restoreState(r),a}getSourceValue(t){return this.scanner.source.slice(t.start,t.end)}convertToToken(t){return{type:Zs[t.type],value:this.getSourceValue(t),range:[t.start,t.end],loc:{start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}}}readNextRawToken(){this.endMarker.index=this.scanner.index,this.endMarker.line=this.scanner.lineNumber,this.endMarker.column=this.scanner.index-this.scanner.lineStart;const t=this.rawToken;this.collectComments(this.scanner.scanComments()),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart),this.rawToken=this.scanner.lex(),this.hasLineTerminator=t.lineNumber!==this.rawToken.lineNumber,this.options.tokens&&this.rawToken.type!==E.EOF&&this.tokens.push(this.convertToToken(this.rawToken))}captureStartMarker(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}}getItemLocation(t){return{range:[t.index,this.endMarker.index],loc:{start:{line:t.line,column:t.column},end:{line:this.endMarker.line,column:this.endMarker.column}}}}finalize(t){var n,r;return(this.delegate||this.commentHandler)&&((n=this.commentHandler)==null||n.attachComments(t),(r=this.delegate)==null||r.call(this,t)),t}expectPunctuator(t){const n=this.rawToken;this.matchPunctuator(t)?this.readNextRawToken():this.throwUnexpectedToken({rawToken:n,code:x.PunctuatorExpected,data:{value:t}})}expectKeyword(t){this.rawToken.type!==E.Keyword||this.rawToken.value.toLowerCase()!==t?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}expectContextualKeyword(t){this.rawToken.type!==E.Identifier||this.rawToken.value.toLowerCase()!==t?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}matchKeyword(t){return this.rawToken.type===E.Keyword&&this.rawToken.value.toLowerCase()===t}matchContextualKeyword(t){return this.rawToken.type===E.Identifier&&this.rawToken.value===t}matchPunctuator(t){return this.rawToken.type===E.Punctuator&&this.rawToken.value===t}getMatchingPunctuator(t){if(typeof t=="string"&&(t=t.split("")),this.rawToken.type===E.Punctuator&&(t==null?void 0:t.length))return t.find(this.matchPunctuator,this)}isolateCoverGrammar(t){const n=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;const r=t.call(this);return this.context.isAssignmentTarget=n,r}inheritCoverGrammar(t){const n=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;const r=t.call(this);return this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,r}withBlockContext(t,n){const r=this.context.blockContext;this.context.blockContext=this.context.blockContext|t;const a=this.context.curlyParsingType;this.context.curlyParsingType=Ct.Automatic;const u=n.call(this);return this.context.blockContext=r,this.context.curlyParsingType=a,u}consumeSemicolon(){if(this.matchPunctuator(";"))this.readNextRawToken();else if(!this.hasLineTerminator)return this.rawToken.type===E.EOF||this.matchPunctuator("}")?(this.endMarker.index=this.startMarker.index,this.endMarker.line=this.startMarker.line,void(this.endMarker.column=this.startMarker.column)):void this.throwUnexpectedToken({rawToken:this.rawToken})}parsePrimaryExpression(){const t=this.captureStartMarker(),n=this.rawToken;switch(n.type){case E.Identifier:return this.readNextRawToken(),this.finalize({type:F.Identifier,name:n.value,...this.getItemLocation(t)});case E.NumericLiteral:case E.StringLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:F.Literal,value:n.value,raw:this.getSourceValue(n),isString:typeof n.value=="string",...this.getItemLocation(t)});case E.BooleanLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:F.Literal,value:n.value.toLowerCase()===N.True,raw:this.getSourceValue(n),isString:!1,...this.getItemLocation(t)});case E.NullLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:F.Literal,value:null,raw:this.getSourceValue(n),isString:!1,...this.getItemLocation(t)});case E.Template:return this.parseTemplateLiteral();case E.Punctuator:switch(n.value){case"(":return this.inheritCoverGrammar(this.parseGroupExpression);case"[":return this.inheritCoverGrammar(this.parseArrayInitializer);case"{":return this.inheritCoverGrammar(this.parseObjectExpression);default:return this.throwUnexpectedToken({rawToken:this.rawToken})}case E.Keyword:return this.context.isAssignmentTarget=!1,this.throwUnexpectedToken({rawToken:this.rawToken});default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseArrayInitializer(){const t=this.captureStartMarker();this.expectPunctuator("[");const n=[];for(;!this.matchPunctuator("]");){const r=this.captureStartMarker();this.matchPunctuator(",")?(this.readNextRawToken(),this.throwError(x.InvalidExpression,r)):(n.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.matchPunctuator("]")||this.expectPunctuator(","))}return this.expectPunctuator("]"),this.finalize({type:F.ArrayExpression,elements:n,...this.getItemLocation(t)})}parseObjectPropertyKey(){const t=this.captureStartMarker(),n=this.rawToken;switch(n.type){case E.StringLiteral:return this.readNextRawToken(),this.finalize({type:F.Literal,value:n.value,raw:this.getSourceValue(n),isString:!0,...this.getItemLocation(t)});case E.Identifier:case E.BooleanLiteral:case E.NullLiteral:case E.Keyword:return this.readNextRawToken(),this.finalize({type:F.Identifier,name:n.value,...this.getItemLocation(t)});default:this.throwError(x.KeyMustBeString,t)}}parseObjectProperty(){const t=this.rawToken,n=this.captureStartMarker(),r=this.parseObjectPropertyKey();let a=!1,u=null;return this.matchPunctuator(":")?(this.readNextRawToken(),u=this.inheritCoverGrammar(this.parseAssignmentExpression)):t.type===E.Identifier?(a=!0,u=this.finalize({type:F.Identifier,name:t.value,...this.getItemLocation(n)})):this.throwUnexpectedToken({rawToken:this.rawToken}),this.finalize({type:F.Property,kind:"init",key:r,value:u,shorthand:a,...this.getItemLocation(n)})}parseObjectExpression(){const t=this.captureStartMarker();this.expectPunctuator("{");const n=[];for(;!this.matchPunctuator("}");)n.push(this.parseObjectProperty()),this.matchPunctuator("}")||this.expectPunctuator(",");return this.expectPunctuator("}"),this.finalize({type:F.ObjectExpression,properties:n,...this.getItemLocation(t)})}parseTemplateElement(t=!1){const n=this.rawToken;n.type!==E.Template&&this.throwUnexpectedToken({rawToken:n}),t&&!n.head&&this.throwUnexpectedToken({code:x.InvalidTemplateHead,rawToken:n});const r=this.captureStartMarker();this.readNextRawToken();const{value:a,cooked:u,tail:s}=n,i=this.finalize({type:F.TemplateElement,value:{raw:a,cooked:u},tail:s,...this.getItemLocation(r)});return i.loc.start.column++,i.loc.end.column=i.loc.end.column-(s?1:2),i}parseTemplateLiteral(){const t=this.captureStartMarker(),n=[],r=[];let a=this.parseTemplateElement(!0);for(r.push(a);!a.tail;)n.push(this.parseExpression()),a=this.parseTemplateElement(),r.push(a);return this.finalize({type:F.TemplateLiteral,quasis:r,expressions:n,...this.getItemLocation(t)})}parseGroupExpression(){this.expectPunctuator("(");const t=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.expectPunctuator(")"),t}parseArguments(){this.expectPunctuator("(");const t=[];if(!this.matchPunctuator(")"))for(;;){const n=this.isolateCoverGrammar(this.parseAssignmentExpression);if(t.push(n),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),t}parseMemberName(){const t=this.rawToken,n=this.captureStartMarker();return this.readNextRawToken(),t.type!==E.NullLiteral&&t.type!==E.Identifier&&t.type!==E.Keyword&&t.type!==E.BooleanLiteral&&this.throwUnexpectedToken({rawToken:t}),this.finalize({type:F.Identifier,name:t.value,...this.getItemLocation(n)})}parseLeftHandSideExpression(){const t=this.captureStartMarker();let n=this.inheritCoverGrammar(this.parsePrimaryExpression);const r=this.captureStartMarker();let a;for(;a=this.getMatchingPunctuator("([.");)switch(a){case"(":{this.context.isAssignmentTarget=!1,n.type!==F.Identifier&&n.type!==F.MemberExpression&&this.throwError(x.IdentiferExpected,t,r);const u=this.parseArguments();n=this.finalize({type:F.CallExpression,callee:n,arguments:u,...this.getItemLocation(t)});continue}case"[":{this.context.isAssignmentTarget=!0,this.expectPunctuator("[");const u=this.isolateCoverGrammar(this.parseExpression);this.expectPunctuator("]"),n=this.finalize({type:F.MemberExpression,computed:!0,object:n,property:u,...this.getItemLocation(t)});continue}case".":{this.context.isAssignmentTarget=!0,this.expectPunctuator(".");const u=this.parseMemberName();n=this.finalize({type:F.MemberExpression,computed:!1,object:n,property:u,...this.getItemLocation(t)});continue}}return n}parseUpdateExpression(){const t=this.captureStartMarker();let n=this.getMatchingPunctuator(On);if(n){this.readNextRawToken();const s=this.captureStartMarker(),i=this.inheritCoverGrammar(this.parseUnaryExpression);return i.type!==F.Identifier&&i.type!==F.MemberExpression&&i.type!==F.CallExpression&&this.throwError(x.InvalidExpression,s),this.context.isAssignmentTarget||this.tolerateError(x.InvalidLeftHandSideInAssignment,t),this.context.isAssignmentTarget=!1,this.finalize({type:F.UpdateExpression,operator:n,argument:i,prefix:!0,...this.getItemLocation(t)})}const r=this.captureStartMarker(),a=this.inheritCoverGrammar(this.parseLeftHandSideExpression),u=this.captureStartMarker();return this.hasLineTerminator?a:(n=this.getMatchingPunctuator(On),n?(a.type!==F.Identifier&&a.type!==F.MemberExpression&&this.throwError(x.InvalidExpression,r,u),this.context.isAssignmentTarget||this.tolerateError(x.InvalidLeftHandSideInAssignment,t),this.readNextRawToken(),this.context.isAssignmentTarget=!1,this.finalize({type:F.UpdateExpression,operator:n,argument:a,prefix:!1,...this.getItemLocation(t)})):a)}parseUnaryExpression(){const t=this.getMatchingPunctuator(Ti);if(t){const n=this.captureStartMarker();this.readNextRawToken();const r=this.inheritCoverGrammar(this.parseUnaryExpression);return this.context.isAssignmentTarget=!1,this.finalize({type:F.UnaryExpression,operator:t,argument:r,prefix:!0,...this.getItemLocation(n)})}return this.parseUpdateExpression()}parseBinaryExpression(){const t=this.rawToken;let n=this.inheritCoverGrammar(this.parseUnaryExpression);if(this.rawToken.type!==E.Punctuator)return n;const r=this.rawToken.value;let a=Gr(r);if(a===0)return n;this.readNextRawToken(),this.context.isAssignmentTarget=!1;const u=[t,this.rawToken];let s=n,i=this.inheritCoverGrammar(this.parseUnaryExpression);const o=[s,r,i],l=[a];for(;this.rawToken.type===E.Punctuator&&(a=Gr(this.rawToken.value))>0;){for(;o.length>2&&a<=l[l.length-1];){i=o.pop();const p=o.pop();l.pop(),s=o.pop(),u.pop();const g=u[u.length-1],w=Pr(g,g.lineStart);o.push(this.finalize(this.createBinaryOrLogicalExpression(w,p,s,i)))}o.push(this.rawToken.value),l.push(a),u.push(this.rawToken),this.readNextRawToken(),o.push(this.inheritCoverGrammar(this.parseUnaryExpression))}let d=o.length-1;n=o[d];let h=u.pop();for(;d>1;){const p=u.pop();if(!p)break;const g=h==null?void 0:h.lineStart,w=Pr(p,g),_=o[d-1];n=this.finalize(this.createBinaryOrLogicalExpression(w,_,o[d-2],n)),d-=2,h=p}return n}createBinaryOrLogicalExpression(t,n,r,a){const u=Mi.includes(n)?F.LogicalExpression:F.BinaryExpression;return u===F.BinaryExpression||(r.type!==F.AssignmentExpression&&r.type!==F.UpdateExpression||this.throwError(x.InvalidExpression,...Ur(r)),a.type!==F.AssignmentExpression&&a.type!==F.UpdateExpression||this.throwError(x.InvalidExpression,...Ur(r))),{type:u,operator:n,left:r,right:a,...this.getItemLocation(t)}}parseAssignmentExpression(){const t=this.captureStartMarker(),n=this.inheritCoverGrammar(this.parseBinaryExpression),r=this.captureStartMarker(),a=this.getMatchingPunctuator(_i);if(!a)return n;n.type!==F.Identifier&&n.type!==F.MemberExpression&&this.throwError(x.InvalidExpression,t,r),this.context.isAssignmentTarget||this.tolerateError(x.InvalidLeftHandSideInAssignment,t),this.matchPunctuator("=")||(this.context.isAssignmentTarget=!1),this.readNextRawToken();const u=this.isolateCoverGrammar(this.parseAssignmentExpression);return this.finalize({type:F.AssignmentExpression,left:n,operator:a,right:u,...this.getItemLocation(t)})}parseExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpression)}parseStatements(t){const n=[];for(;this.rawToken.type!==E.EOF&&!this.matchPunctuator(t);){const r=this.parseStatementListItem();Ys(r)||n.push(r)}return n}parseStatementListItem(){return this.context.isAssignmentTarget=!0,this.matchKeyword(N.Function)?this.parseFunctionDeclaration():this.matchKeyword(N.Export)?this.parseExportDeclaration():this.matchKeyword(N.Import)?this.parseImportDeclaration():this.parseStatement()}parseBlock(){const t=this.captureStartMarker();this.expectPunctuator("{");const n=this.parseStatements("}");return this.expectPunctuator("}"),this.finalize({type:F.BlockStatement,body:n,...this.getItemLocation(t)})}parseObjectStatement(){const t=this.captureStartMarker(),n=this.parseObjectExpression();return this.finalize({type:F.ExpressionStatement,expression:n,...this.getItemLocation(t)})}parseBlockOrObjectStatement(){return this.context.curlyParsingType===Ct.AsObject?this.parseObjectStatement():this.peekAhead(t=>{let n=t();return(n.type===E.Identifier||n.type===E.StringLiteral)&&(n=t(),n.type===E.Punctuator&&n.value===":")})?this.parseObjectStatement():this.parseBlock()}parseIdentifier(){const t=this.rawToken;if(t.type!==E.Identifier)return null;const n=this.captureStartMarker();return this.readNextRawToken(),this.finalize({type:F.Identifier,name:t.value,...this.getItemLocation(n)})}parseVariableDeclarator(){const t=this.captureStartMarker(),n=this.parseIdentifier();n||this.throwUnexpectedToken({code:x.IdentiferExpected});let r=null;if(this.matchPunctuator("=")){this.readNextRawToken();const a=this.rawToken;try{r=this.isolateCoverGrammar(this.parseAssignmentExpression)}catch{this.throwUnexpectedToken({rawToken:a,code:x.InvalidVariableAssignment})}}return this.finalize({type:F.VariableDeclarator,id:n,init:r,...this.getItemLocation(t)})}parseVariableDeclarationList(){const t=[this.parseVariableDeclarator()];for(;this.matchPunctuator(",");)this.readNextRawToken(),t.push(this.parseVariableDeclarator());return t}parseVariableDeclaration(){const t=this.captureStartMarker();this.expectKeyword(N.Var);const n=this.parseVariableDeclarationList();return this.consumeSemicolon(),this.finalize({type:F.VariableDeclaration,declarations:n,kind:"var",...this.getItemLocation(t)})}parseEmptyStatement(){const t=this.captureStartMarker();return this.expectPunctuator(";"),this.finalize({type:F.EmptyStatement,...this.getItemLocation(t)})}parseExpressionStatement(){const t=this.captureStartMarker(),n=this.parseExpression();return this.consumeSemicolon(),this.finalize({type:F.ExpressionStatement,expression:n,...this.getItemLocation(t)})}parseIfClause(){return this.withBlockContext(oe.IfClause,this.parseStatement)}parseIfStatement(){const t=this.captureStartMarker();this.expectKeyword(N.If),this.expectPunctuator("(");const n=this.captureStartMarker(),r=this.parseExpression(),a=this.captureStartMarker();this.expectPunctuator(")"),r.type!==F.AssignmentExpression&&r.type!==F.UpdateExpression||this.throwError(x.InvalidExpression,n,a);const u=this.parseIfClause();let s=null;return this.matchKeyword(N.Else)&&(this.readNextRawToken(),s=this.parseIfClause()),this.finalize({type:F.IfStatement,test:r,consequent:u,alternate:s,...this.getItemLocation(t)})}parseWhileStatement(){const t=this.captureStartMarker();this.expectKeyword(N.While),this.expectPunctuator("(");const n=this.captureStartMarker(),r=this.parseExpression(),a=this.captureStartMarker();this.expectPunctuator(")"),r.type!==F.AssignmentExpression&&r.type!==F.UpdateExpression||this.throwError(x.InvalidExpression,n,a);const u=this.withBlockContext(oe.WhileLoop,this.parseStatement);return this.finalize({type:F.WhileStatement,test:r,body:u,...this.getItemLocation(t)})}parseForStatement(){let t=null,n=null,r=null,a=null,u=null;const s=this.captureStartMarker();if(this.expectKeyword(N.For),this.expectPunctuator("("),this.matchPunctuator(";"))this.readNextRawToken();else if(this.matchKeyword(N.Var)){const o=this.captureStartMarker();this.readNextRawToken();const l=this.parseVariableDeclarationList();l.length===1&&this.matchKeyword(N.In)?(l[0].init&&this.throwError(x.ForInOfLoopInitializer,o),a=this.finalize({type:F.VariableDeclaration,declarations:l,kind:"var",...this.getItemLocation(o)}),this.readNextRawToken(),u=this.parseExpression()):(this.matchKeyword(N.In)&&this.throwError(x.InvalidLeftHandSideInForIn,o),t=this.finalize({type:F.VariableDeclaration,declarations:l,kind:"var",...this.getItemLocation(o)}),this.expectPunctuator(";"))}else{const o=this.context.isAssignmentTarget,l=this.captureStartMarker();t=this.inheritCoverGrammar(this.parseAssignmentExpression),this.matchKeyword(N.In)?(this.context.isAssignmentTarget||this.tolerateError(x.InvalidLeftHandSideInForIn,l),t.type!==F.Identifier&&this.throwError(x.InvalidLeftHandSideInForIn,l),this.readNextRawToken(),a=t,u=this.parseExpression(),t=null):(this.context.isAssignmentTarget=o,this.expectPunctuator(";"))}a||(this.matchPunctuator(";")||(n=this.isolateCoverGrammar(this.parseExpression)),this.expectPunctuator(";"),this.matchPunctuator(")")||(r=this.isolateCoverGrammar(this.parseExpression))),this.expectPunctuator(")");const i=this.withBlockContext(oe.ForLoop,()=>this.isolateCoverGrammar(this.parseStatement));return a&&u?this.finalize({type:F.ForInStatement,left:a,right:u,body:i,...this.getItemLocation(s)}):this.finalize({type:F.ForStatement,init:t,test:n,update:r,body:i,...this.getItemLocation(s)})}parseContinueStatement(){const t=this.captureStartMarker();return this.expectKeyword(N.Continue),this.consumeSemicolon(),this.finalize({type:F.ContinueStatement,...this.getItemLocation(t)})}parseBreakStatement(){const t=this.captureStartMarker();return this.expectKeyword(N.Break),this.consumeSemicolon(),this.finalize({type:F.BreakStatement,...this.getItemLocation(t)})}parseReturnStatement(){const t=this.captureStartMarker();this.expectKeyword(N.Return);const n=!this.matchPunctuator(";")&&!this.matchPunctuator("}")&&!this.hasLineTerminator&&this.rawToken.type!==E.EOF||this.rawToken.type===E.StringLiteral||this.rawToken.type===E.Template?this.parseExpression():null;return this.consumeSemicolon(),this.finalize({type:F.ReturnStatement,argument:n,...this.getItemLocation(t)})}parseStatement(){switch(this.rawToken.type){case E.BooleanLiteral:case E.NullLiteral:case E.NumericLiteral:case E.StringLiteral:case E.Template:case E.Identifier:return this.parseExpressionStatement();case E.Punctuator:return this.rawToken.value==="{"?this.parseBlockOrObjectStatement():this.rawToken.value==="("?this.parseExpressionStatement():this.rawToken.value===";"?this.parseEmptyStatement():this.parseExpressionStatement();case E.Keyword:switch(this.rawToken.value.toLowerCase()){case N.Break:return this.parseBreakStatement();case N.Continue:return this.parseContinueStatement();case N.For:return this.parseForStatement();case N.Function:return this.parseFunctionDeclaration();case N.If:return this.parseIfStatement();case N.Return:return this.parseReturnStatement();case N.Var:return this.parseVariableDeclaration();case N.While:return this.parseWhileStatement();default:return this.parseExpressionStatement()}default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseFormalParameters(){const t=[];if(this.expectPunctuator("("),!this.matchPunctuator(")"))for(;this.rawToken.type!==E.EOF;){const n=this.parseIdentifier();if(n||this.throwUnexpectedToken({rawToken:this.rawToken,code:x.IdentiferExpected}),t.push(n),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),t}parseFunctionDeclaration(){(this.context.blockContext&oe.Function)===oe.Function&&this.throwUnexpectedToken({code:x.NoFunctionInsideFunction}),(this.context.blockContext&oe.WhileLoop)!==oe.WhileLoop&&(this.context.blockContext&oe.IfClause)!==oe.IfClause||this.throwUnexpectedToken({code:x.NoFunctionInsideBlock});const t=this.captureStartMarker();this.expectKeyword(N.Function);const n=this.parseIdentifier();n||this.throwUnexpectedToken({code:x.InvalidFunctionIdentifier});const r=this.parseFormalParameters(),a=this.context.blockContext;this.context.blockContext=this.context.blockContext|oe.Function;const u=this.parseBlock();return this.context.blockContext=a,this.finalize({type:F.FunctionDeclaration,id:n,params:r,body:u,...this.getItemLocation(t)})}parseScript(){const t=this.captureStartMarker(),n=this.parseStatements(),r=this.finalize({type:F.Program,body:n,...this.getItemLocation(t)});return this.options.tokens&&(r.tokens=this.tokens),this.options.tolerant&&(r.errors=this.errorHandler.errors),r}parseExportDeclaration(){this.context.blockContext!==oe.None&&this.throwUnexpectedToken({code:x.ModuleExportRootOnly});let t=null;const n=this.captureStartMarker();return this.expectKeyword(N.Export),this.matchKeyword(N.Var)?t=this.parseVariableDeclaration():this.matchKeyword("function")?t=this.parseFunctionDeclaration():this.throwUnexpectedToken({code:x.InvalidExpression}),this.finalize({type:F.ExportNamedDeclaration,declaration:t,specifiers:[],source:null,...this.getItemLocation(n)})}parseModuleSpecifier(){const t=this.captureStartMarker(),n=this.rawToken;if(n.type===E.StringLiteral)return this.readNextRawToken(),this.finalize({type:F.Literal,value:n.value,raw:this.getSourceValue(n),isString:!0,...this.getItemLocation(t)});this.throwError(x.InvalidModuleUri,t)}parseDefaultSpecifier(){const t=this.captureStartMarker(),n=this.parseIdentifier();return n||this.throwUnexpectedToken({code:x.IdentiferExpected}),this.finalize({type:F.ImportDefaultSpecifier,local:n,...this.getItemLocation(t)})}parseImportDeclaration(){this.context.blockContext!==oe.None&&this.throwUnexpectedToken({code:x.ModuleImportRootOnly});const t=this.captureStartMarker();this.expectKeyword(N.Import);const n=this.parseDefaultSpecifier();this.expectContextualKeyword(N.From);const r=this.parseModuleSpecifier();return this.finalize({type:F.ImportDeclaration,specifiers:[n],source:r,...this.getItemLocation(t)})}}function ru(e,t,n){return new nu(e,t,n).parseScript()}function Ht(e,t=[]){const n=ru(e);if(n.body===null||n.body===void 0)throw new St({index:0,line:0,column:0,data:null,description:"",code:x.InvalidExpression});return n.loadedModules={},Mt(n,t),n}class Wt{constructor(t){const n=this;n._keys=[],n._values=[],n.length=0,t&&t.forEach(r=>{n.set(r[0],r[1])})}entries(){return[].slice.call(this.keys().map((t,n)=>[t,this._values[n]]))}keys(){return[].slice.call(this._keys)}values(){return[].slice.call(this._values)}has(t){return this._keys.includes(t)}get(t){const n=this._keys.indexOf(t);return n>-1?this._values[n]:null}deepGet(t){if(!t||!t.length)return null;const n=(r,a)=>r==null?null:a.length?n(r instanceof Wt?r.get(a[0]):r[a[0]],a.slice(1)):r;return n(this.get(t[0]),t.slice(1))}set(t,n){const r=this,a=this._keys.indexOf(t);return a>-1?r._values[a]=n:(r._keys.push(t),r._values.push(n),r.length=r._values.length),this}sortedSet(t,n,r,a){const u=this,s=this._keys.length,i=r||0,o=a!==void 0?a:s-1;if(s===0)return u._keys.push(t),u._values.push(n),u;if(t===this._keys[i])return this._values.splice(i,0,n),this;if(t===this._keys[o])return this._values.splice(o,0,n),this;if(t>this._keys[o])return this._keys.splice(o+1,0,t),this._values.splice(o+1,0,n),this;if(t=o)return this;const l=i+Math.floor((o-i)/2);return tthis._keys[l]?this.sortedSet(t,n,l+1,o):this}size(){return this.length}clear(){const t=this;return t._keys.length=t.length=t._values.length=0,this}delete(t){const n=this,r=n._keys.indexOf(t);return r>-1&&(n._keys.splice(r,1),n._values.splice(r,1),n.length=n._keys.length,!0)}forEach(t){this._keys.forEach((n,r)=>{t(this._values[r],n,r)})}map(t){return this.keys().map((n,r)=>t(this._values[r],n,r))}filter(t){const n=this;return n._keys.forEach((r,a)=>{t(n._values[a],r,a)===!1&&n.delete(r)}),this}clone(){return new Wt(this.entries())}}class zr{constructor(t=20){this._maxEntries=t,this._values=new Wt}delete(t){this._values.has(t)&&this._values.delete(t)}get(t){let n=null;return this._values.has(t)&&(n=this._values.get(t),this._values.delete(t),this._values.set(t,n)),n}put(t,n){if(this._values.size()>=this._maxEntries){const r=this._values.keys()[0];this._values.delete(r)}this._values.set(t,n)}}class iu{constructor(t=20){this._maxEntries=t,this._cache=new zr(this._maxEntries)}clear(){this._cache=new zr(this._maxEntries)}addToCache(t,n){this._cache.put(t,n)}removeFromCache(t){this._cache.delete(t)}getFromCache(t){return this._cache.get(t)}}class ce{constructor(t){this.portalUri=t}normalizeModuleUri(t){const n=/^[a-z0-9A-Z]+(@[0-9]+\.[0-9]+\.[0-9]+)?([\?|\/].*)?$/gi,r=/(?.+)\/home\/item\.html\?id\=(?.+)$/gi,a=/(?.+)\/sharing\/rest\/content\/users\/[a-zA-Z0-9]+\/items\/(?.+)$/gi,u=/(?.+)\/sharing\/rest\/content\/items\/(?.+)$/gi,s=/(?.*)@(?[0-9]+\.[0-9]+\.[0-9]+)([\?|\/].*)?$/gi;if(t.startsWith("portal+")){let i=t.substring(7),o="",l=i,d=!1;for(const g of[r,u,a]){const w=g.exec(i);if(w!==null){const _=w.groups;l=_.itemid,o=_.portalurl,d=!0;break}}if(d===!1){if(!n.test(i))throw new un(on.UnsupportedUriProtocol,{uri:t});l=i,o=this.portalUri}l.includes("/")&&(l=l.split("/")[0]),l.includes("?")&&(l=l.split("?")[0]);let h="current";const p=s.exec(l);if(p!==null){const g=p.groups;l=g.itemid,h=g.versionstring}return i=new jn({url:o}).restUrl+"/content/items/"+l+"/resources/"+h+".arc",{url:i,scheme:"portal",uri:"PO:"+i}}if(t.startsWith("mock")){if(t==="mock")return{url:"",scheme:"mock",data:` + export var hello = 1; + export function helloWorld() { + return "Hello World " + hello; + } + `,uri:"mock"};const i=t.replace("mock:","");if(ce.mocks[i]!==void 0)return{url:"",scheme:"mock",data:ce.mocks[i],uri:t}}throw new un(on.UnrecognisedUri,{uri:t})}async fetchModule(t){const n=ce.cachedModules.getFromCache(t.uri);if(n)return n;const r=this.fetchSource(t);ce.cachedModules.addToCache(t.uri,r);let a=null;try{a=await r}catch(u){throw ce.cachedModules.removeFromCache(t.uri),u}return a}async fetchSource(t){if(t.scheme==="portal"){const n=await oa(t.url,{responseType:"text",query:{}});if(n.data)return Ht(n.data,[])}if(t.scheme==="mock")return Ht(t.data??"",[]);throw new un(on.UnsupportedUriProtocol)}static create(t){return new ce(t)}static getDefault(){return this._default??(ce._default=ce._moduleResolverFactory())}static set moduleResolverClass(t){this._moduleResolverFactory=t,this._default=null}}ce.mocks={},ce.cachedModules=new iu(30),ce._default=null,ce._moduleResolverFactory=()=>{const e=jn.getDefault();return new ce(e.url)};let au=class extends Ze{constructor(t,n){super(),this.definition=null,this.context=null,this.definition=t,this.context=n}createFunction(t){return(...n)=>{const r={spatialReference:this.context.spatialReference,console:this.context.console,services:this.context.services,timeReference:this.context.timeReference??null,lrucache:this.context.lrucache,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:t.depthCounter.depth+1},globalScope:this.context.globalScope};if(r.depthCounter.depth>64)throw new f(t,c.MaximumCallDepth,null);return xn(this.definition,r,n,null)}}call(t,n){return $e(t,n,(r,a,u)=>{const s={spatialReference:t.spatialReference,services:t.services,globalScope:t.globalScope,depthCounter:{depth:t.depthCounter.depth+1},libraryResolver:t.libraryResolver,exports:t.exports,timeReference:t.timeReference??null,console:t.console,lrucache:t.lrucache,interceptor:t.interceptor,localScope:{}};if(s.depthCounter.depth>64)throw new f(t,c.MaximumCallDepth,n);return xn(this.definition,s,u,n)})}marshalledCall(t,n,r,a){return a(t,n,(u,s,i)=>{const o={spatialReference:t.spatialReference,globalScope:r.globalScope,services:t.services,depthCounter:{depth:t.depthCounter.depth+1},libraryResolver:t.libraryResolver,exports:t.exports,console:t.console,timeReference:t.timeReference??null,lrucache:t.lrucache,interceptor:t.interceptor,localScope:{}};return i=i.map(l=>!K(l)||l instanceof Le?l:at(l,t,a)),at(xn(this.definition,o,i,n),r,a)})}},ft=class extends kt{constructor(t){super(t)}global(t){const n=this.executingContext.globalScope[t.toLowerCase()];if(n.valueset||(n.value=S(this.executingContext,n.node),n.valueset=!0),K(n.value)&&!(n.value instanceof Le)){const r=new Le;r.fn=n.value,r.parameterEvaluator=$e,r.context=this.executingContext,n.value=r}return n.value}setGlobal(t,n){if(K(n))throw new f(null,c.AssignModuleFunction,null);this.executingContext.globalScope[t.toLowerCase()]={value:n,valueset:!0,node:null}}hasGlobal(t){return this.executingContext.exports[t]===void 0&&(t=t.toLowerCase()),this.executingContext.exports[t]!==void 0}loadModule(t){let n=t.spatialReference;n==null&&(n=new It({wkid:102100})),this.moduleScope=Oi({},t.customfunctions,t.timeReference),this.executingContext={spatialReference:n,globalScope:this.moduleScope,localScope:null,libraryResolver:new tn(t.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},services:t.services,console:t.console??Pi,timeReference:t.timeReference??null,lrucache:t.lrucache,interceptor:t.interceptor,depthCounter:{depth:1}},S(this.executingContext,this.source.syntax)}};function su(e,t){const n=[];for(let r=0;r=r.length)throw new f(e,c.OutOfBounds,t);n=m(r[a]),r[a]=t.operator==="++"?n+1:n-1}else if(r instanceof k){if(b(a)===!1)throw new f(e,c.KeyAccessorMustBeString,t);if(r.hasField(a)!==!0)throw new f(e,c.FieldNotFound,t);n=m(r.field(a)),r.setField(a,t.operator==="++"?n+1:n-1)}else if(Q(r)){if(b(a)===!1)throw new f(e,c.KeyAccessorMustBeString,t);if(r.hasField(a)!==!0)throw new f(e,c.FieldNotFound,t);n=m(r.field(a)),r.setField(a,t.operator==="++"?n+1:n-1)}else{if(L(r))throw new f(e,c.Immutable,t);if(!(r instanceof ft))throw new f(e,c.InvalidParameter,t);if(b(a)===!1)throw new f(e,c.ModuleAccessorMustBeString,t);if(r.hasGlobal(a)!==!0)throw new f(e,c.ModuleExportNotFound,t);n=m(r.global(a)),r.setGlobal(a,t.operator==="++"?n+1:n-1)}return t.prefix===!1?n:t.operator==="++"?n+1:n-1}if(r=t.argument.type==="Identifier"?t.argument.name.toLowerCase():"",!r)throw new f(e,c.InvalidIdentifier,t);if(e.localScope!=null&&e.localScope[r]!==void 0)return n=m(e.localScope[r].value),e.localScope[r]={value:t.operator==="++"?n+1:n-1,valueset:!0,node:t},t.prefix===!1?n:t.operator==="++"?n+1:n-1;if(e.globalScope[r]!==void 0)return n=m(e.globalScope[r].value),e.globalScope[r]={value:t.operator==="++"?n+1:n-1,valueset:!0,node:t},t.prefix===!1?n:t.operator==="++"?n+1:n-1;throw new f(e,c.InvalidIdentifier,t)}function Te(e,t,n,r,a){switch(t){case"=":return e===C?null:e;case"/=":return m(n)/m(e);case"*=":return m(n)*m(e);case"-=":return m(n)-m(e);case"+=":return b(n)||b(e)?A(n)+A(e):m(n)+m(e);case"%=":return m(n)%m(e);default:throw new f(a,c.UnsupportedOperator,r)}}function mu(e,t){let n=null,r="";if(t.left.type==="MemberExpression"){if(n=S(e,t.left.object),t.left.computed===!0)r=S(e,t.left.property);else{if(t.left.property.type!=="Identifier")throw new f(e,c.InvalidIdentifier,t);r=t.left.property.name}const u=S(e,t.right);if(B(n)){if(!G(r))throw new f(e,c.ArrayAccessorMustBeNumber,t);if(r<0&&(r=n.length+r),r<0||r>n.length)throw new f(e,c.OutOfBounds,t);if(r===n.length){if(t.operator!=="=")throw new f(e,c.OutOfBounds,t);n[r]=Te(u,t.operator,n[r],t,e)}else n[r]=Te(u,t.operator,n[r],t,e)}else if(n instanceof k){if(b(r)===!1)throw new f(e,c.KeyAccessorMustBeString,t);if(n.hasField(r)===!0)n.setField(r,Te(u,t.operator,n.field(r),t,e));else{if(t.operator!=="=")throw new f(e,c.FieldNotFound,t,{key:r});n.setField(r,Te(u,t.operator,null,t,e))}}else if(Q(n)){if(b(r)===!1)throw new f(e,c.KeyAccessorMustBeString,t);if(n.hasField(r)===!0)n.setField(r,Te(u,t.operator,n.field(r),t,e));else{if(t.operator!=="=")throw new f(e,c.FieldNotFound,t,{key:r});n.setField(r,Te(u,t.operator,null,t,e))}}else{if(L(n))throw new f(e,c.Immutable,t);if(!(n instanceof ft))throw new f(e,c.InvalidIdentifier,t);if(b(r)===!1)throw new f(e,c.ModuleAccessorMustBeString,t);if(n.hasGlobal(r)!==!0)throw new f(e,c.ModuleExportNotFound,t);n.setGlobal(r,Te(u,t.operator,n.global(r),t,e))}return C}n=t.left.name.toLowerCase();const a=S(e,t.right);if(e.localScope!=null&&e.localScope[n]!==void 0)return e.localScope[n]={value:Te(a,t.operator,e.localScope[n].value,t,e),valueset:!0,node:t.right},C;if(e.globalScope[n]!==void 0)return e.globalScope[n]={value:Te(a,t.operator,e.globalScope[n].value,t,e),valueset:!0,node:t.right},C;throw new f(e,c.InvalidIdentifier,t)}function pu(e,t){if(t.expression.type==="AssignmentExpression"||t.expression.type==="UpdateExpression")return S(e,t.expression);if(t.expression.type==="CallExpression"){const n=S(e,t.expression);return n===C?C:new st(n)}{const n=S(e,t.expression);return n===C?C:new st(n)}}function Du(e,t){const n=S(e,t.test);if(n===!0)return S(e,t.consequent);if(n===!1)return t.alternate!==null?S(e,t.alternate):C;throw new f(e,c.BooleanConditionRequired,t)}function gu(e,t){let n=C;for(let r=0;r=n.length||r<0)throw new f(e,c.OutOfBounds,t);return n[r]}throw new f(e,c.InvalidMemberAccessKey,t)}if(b(n)){if(G(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length+r),r>=n.length||r<0)throw new f(e,c.OutOfBounds,t);return n[r]}throw new f(e,c.InvalidMemberAccessKey,t)}if(L(n)){if(G(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length()+r),r>=n.length()||r<0)throw new f(e,c.OutOfBounds,t);return n.get(r)}throw new f(e,c.InvalidMemberAccessKey,t)}throw new f(e,c.InvalidMemberAccessKey,t)}}catch(n){throw n}}function bu(e,t){try{const n=S(e,t.argument);if(U(n)){if(t.operator==="!")return!n;if(t.operator==="-")return-1*m(n);if(t.operator==="+")return 1*m(n);if(t.operator==="~")return~m(n);throw new f(e,c.UnsupportedUnaryOperator,t)}if(t.operator==="~")return~m(n);if(t.operator==="-")return-1*m(n);if(t.operator==="+")return 1*m(n);throw new f(e,c.UnsupportedUnaryOperator,t)}catch(n){throw n}}function vu(e,t){try{const n=[];for(let r=0;r>":case">>>":case"^":case"&":return Kn(m(r),m(a),t.operator);case"==":return Fe(r,a);case"!=":return!Fe(r,a);case"<":case">":case"<=":case">=":return Wn(r,a,t.operator);case"+":return b(r)||b(a)?A(r)+A(a):m(r)+m(a);case"-":return m(r)-m(a);case"*":return m(r)*m(a);case"/":return m(r)/m(a);case"%":return m(r)%m(a);default:throw new f(e,c.UnsupportedOperator,t)}}catch(n){throw n}}function Iu(e,t){try{const n=S(e,t.left);if(U(n))switch(t.operator){case"||":if(n===!0)return n;{const r=S(e,t.right);if(U(r))return r;throw new f(e,c.LogicExpressionOrAnd,t)}case"&&":if(n===!1)return n;{const r=S(e,t.right);if(U(r))return r;throw new f(e,c.LogicExpressionOrAnd,t)}default:throw new f(e,c.LogicExpressionOrAnd,t)}throw new f(e,c.LogicalExpressionOnlyBoolean,t)}catch(n){throw n}}function ku(e,t){return t.value?t.value.cooked:""}function Bu(e,t,n){if(K(e))throw new f(t,c.NoFunctionInTemplateLiteral,n);return e}function Tu(e,t){let n="",r=0;for(const a of t.quasis)n+=a.value?a.value.cooked:"",a.tail===!1&&(n+=t.expressions[r]?A(Bu(S(e,t.expressions[r]),e,t)):"",r++);return n}function Ni(e,t){let n;try{const r=t.name.toLowerCase();if(e.localScope!=null&&e.localScope[r]!==void 0)return n=e.localScope[r],n.valueset===!0||(n.value=S(e,n.node),n.valueset=!0),n.value;if(e.globalScope[r]!==void 0)return n=e.globalScope[r],n.valueset===!0||(n.value=S(e,n.node),n.valueset=!0),n.value;throw new f(e,c.InvalidIdentifier,t)}catch(r){throw r}}function _u(e,t){try{if(t.callee.type==="MemberExpression"){const n=S(e,t.callee.object);if(!(n instanceof ft))throw new f(e,c.FunctionNotFound,t);const r=t.callee.computed===!1?t.callee.property.name:S(e,t.callee.property);if(!n.hasGlobal(r))throw new f(e,c.FunctionNotFound,t);const a=n.global(r);if(!K(a))throw new f(e,c.CallNonFunction,t);return a.call(e,t)}if(t.callee.type!=="Identifier")throw new f(e,c.FunctionNotFound,t);if(e.localScope!=null&&e.localScope[t.callee.name.toLowerCase()]!==void 0){const n=e.localScope[t.callee.name.toLowerCase()];if(K(n.value))return n.value.call(e,t);throw new f(e,c.CallNonFunction,t)}if(e.globalScope[t.callee.name.toLowerCase()]!==void 0){const n=e.globalScope[t.callee.name.toLowerCase()];if(K(n.value))return n.value.call(e,t);throw new f(e,c.CallNonFunction,t)}throw new f(e,c.FunctionNotFound,t)}catch(n){throw n}}const le={};function Li(e,t,n,r){try{const a=t.arguments,u=S(e,a[n]);if(Fe(u,r))return S(e,a[n+1]);{const s=a.length-n;return s===1?S(e,a[n]):s===2?null:s===3?S(e,a[n+2]):Li(e,t,n+2,r)}}catch(a){throw a}}function Ri(e,t,n,r){try{const a=t.arguments;if(r===!0)return S(e,a[n+1]);if(a.length-n===3)return S(e,a[n+2]);{const u=S(e,a[n+2]);if(U(u)===!1)throw new f(e,c.BooleanConditionRequired,a[n+2]);return Ri(e,t,n+2,u)}}catch(a){throw a}}function xn(e,t,n,r){try{const a=e.body;if(n.length!==e.params.length)throw new f(t,c.WrongNumberOfParameters,r);if(t.localScope!=null)for(let s=0;simport("./geometryEngine-5a631b21.js"),["assets/geometryEngine-5a631b21.js","assets/geometryEngineBase-324c1c81.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/hydrated-c10ab4a5.js"]),Ne(()=>Promise.resolve().then(()=>qa),void 0)]);return zi=!0,t.setGeometryEngine(e),!0}let Cn=null;function ar(){return Cn!==null||(Cn=Vi()),Cn}async function Vi(){await js(),be=await Ne(()=>import("./arcadeAsyncRuntime-8b244fcf.js"),["assets/arcadeAsyncRuntime-8b244fcf.js","assets/executionError-c92d3b85.js","assets/geomasync-463bba62.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/geometryEngineAsync-e8b91fe5.js","assets/portalUtils-2eff95c6.js","assets/arcadeTimeUtils-e1438cc8.js","assets/FieldsIndex-f79a8f26.js","assets/number-e5825aa4.js","assets/hash-6f442295.js"]);for(const e of Gn)be.extend(e),We(e,"async");return Gn=null,!0}function Zi(){return Gi}function Hi(){return!!be}function Wi(){return zi}let An=null;function sr(){return An||(An=Ki(),An)}async function Ki(){await ar();const[e,t,n,r,a]=await Promise.all([Ne(()=>import("./featureSetUtils-86900014.js").then(u=>u.h),["assets/featureSetUtils-86900014.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/SpatialFilter-d44507d6.js","assets/arcadeTimeUtils-e1438cc8.js","assets/FieldsIndex-f79a8f26.js","assets/geometryEngineAsync-e8b91fe5.js","assets/FeatureReductionLayer-4262cf54.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/heatmapUtils-327ef4c5.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/sql-734ecbc5.js","assets/AttachmentQuery-972bbd60.js","assets/Query-1c961d4c.js","assets/RelationshipQuery-39c07195.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/FeatureLayerBase-7c7dfccb.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/TopFeaturesQuery-e44d05be.js","assets/popupUtils-82ea8abb.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/executeQueryPBF-0f188593.js","assets/AttachmentInfo-cb670dd0.js","assets/executeForIds-5eaf002d.js","assets/SubtypeGroupLayer-181166ae.js"]),Ne(()=>import("./featuresetbase-deb31b6d.js"),["assets/featuresetbase-deb31b6d.js","assets/arcadeTimeUtils-e1438cc8.js","assets/executionError-c92d3b85.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/FieldsIndex-f79a8f26.js","assets/featureSetUtils-86900014.js","assets/WhereClause-c86b9974.js","assets/SpatialFilter-d44507d6.js","assets/geometryEngineAsync-e8b91fe5.js","assets/FeatureReductionLayer-4262cf54.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/heatmapUtils-327ef4c5.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/sql-734ecbc5.js","assets/AttachmentQuery-972bbd60.js","assets/Query-1c961d4c.js","assets/RelationshipQuery-39c07195.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/FeatureLayerBase-7c7dfccb.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/TopFeaturesQuery-e44d05be.js","assets/popupUtils-82ea8abb.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/executeQueryPBF-0f188593.js","assets/AttachmentInfo-cb670dd0.js","assets/executeForIds-5eaf002d.js","assets/SubtypeGroupLayer-181166ae.js","assets/portalUtils-2eff95c6.js","assets/number-e5825aa4.js","assets/hash-6f442295.js"]),Ne(()=>import("./featuresetgeom-f8824c82.js"),["assets/featuresetgeom-f8824c82.js","assets/executionError-c92d3b85.js","assets/SpatialFilter-d44507d6.js","assets/WhereClause-c86b9974.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/arcadeTimeUtils-e1438cc8.js","assets/FieldsIndex-f79a8f26.js","assets/geometryEngineAsync-e8b91fe5.js","assets/number-e5825aa4.js","assets/hash-6f442295.js"]),Ne(()=>import("./featuresetstats-f8717896.js"),["assets/featuresetstats-f8717896.js","assets/executionError-c92d3b85.js","assets/WhereClause-c86b9974.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/arcadeTimeUtils-e1438cc8.js","assets/FieldsIndex-f79a8f26.js","assets/number-e5825aa4.js","assets/hash-6f442295.js"]),Ne(()=>import("./featuresetstring-f0b4377e.js"),["assets/featuresetstring-f0b4377e.js","assets/executionError-c92d3b85.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/arcadeTimeUtils-e1438cc8.js","assets/FieldsIndex-f79a8f26.js","assets/number-e5825aa4.js","assets/hash-6f442295.js"])]);return ta=e,be.extend([t,n,r,a]),We([t,n,r,a],"async"),Gi=!0,!0}function Yi(e,t=[]){return e.usesFeatureSet===void 0&&Mt(e,t),e.usesFeatureSet===!0}function Gu(e,t=[]){return e.isAsync===void 0&&Mt(e,t),e.isAsync===!0}function zu(e,t){if(t){for(const n of t)if(nn(e,n))return!0;return!1}return!1}async function Xi(e,t,n=[],r=!1,a=null){return ur(new Set,e,t,n,r,a)}async function ur(e,t,n,r=[],a=!1,u=null){const s=typeof t=="string"?nr(t):t,i=[];return s&&(Wi()===!1&&(rn(s)||a)&&i.push(ir()),Hi()===!1&&(s.isAsync===!0||n)&&i.push(ar()),Zi()===!1&&(Yi(s)||zu(s,r))&&i.push(sr())),i.length&&await Promise.all(i),await Qi(e,s,u,n,a),!0}function ju(e,t=[]){return e.usesModules===void 0&&Mt(e,t),e.usesModules===!0}async function Qi(e,t,n=null,r=!1,a=!1){const u=di(t);n===null&&u.length>0&&(n=ce.getDefault()),t.loadedModules={};for(const s of u){Zr(n);const i=n.normalizeModuleUri(s.source);if(e.has(i.uri))throw new f(null,c.CircularModules,null);e.add(i.uri);const o=await n.fetchModule(i);await ur(e,o,r,[],a,n),e.delete(i.uri),o.isAsync&&(t.isAsync=!0),o.usesFeatureSet&&(t.usesFeatureSet=!0),o.usesGeometry&&(t.usesGeometry=!0),t.loadedModules[s.libname]={uri:i.uri,script:o}}}function ea(e){if(rn(e))return!0;const t=Bn(e);let n=!1;for(let r=0;r{jr.test(s)&&(s=s.replace(jr,""),a.push(s))});const u=a.filter(s=>s.includes("*"));return a=a.filter(s=>!u.includes(s)),t&&u.forEach(s=>{const i=new RegExp(`^${s.split(/\*+/).map(Vu).join(".*")}$`,"i");t.forEach(o=>i.test(o)?a.push(o):null)}),[...new Set(a.sort())]}function no(e){return nn(e,"$view")}function ro(e,t){return!!e&&nn(e,t)}function io(e){if(!(!e||e.spatialReference==null&&(e.scale==null||e.viewingMode==null)))return{view:e.viewingMode&&e.scale!=null?new k({viewingMode:e.viewingMode,scale:e.scale}):null,sr:e.spatialReference}}function ao({url:e,spatialReference:t,lrucache:n,interceptor:r}){const a=an();return a?a.createFeatureSetCollectionFromService(e,t,n,r):null}function so({layer:e,spatialReference:t,outFields:n,returnGeometry:r,lrucache:a,interceptor:u}){if(e===null)return null;const s=an();return s?s.constructFeatureSet(e,t,n,r??!0,a,u):null}function uo(e){if((e==null?void 0:e.map)===null)return null;const t=an();return t?t.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function oo(e,t){return k.convertJsonToArcade(e,t)}function lo(e,t,n=[]){return Xi(e,t,n)}function co(){return ir()}function fo(){return sr()}function ho(e){return e.type==="simple"||e.type==="class-breaks"||e.type==="unique-value"||e.type==="dot-density"||e.type==="dictionary"||e.type==="pie-chart"}function mo(e){return e.declaredClass==="esri.layers.support.LabelClass"}function po(e){return e.declaredClass==="esri.PopupTemplate"}function na(e,t){var r;if(!e)return!1;if(typeof e=="string")return t(e);const n=e;if(ho(n)){if(n.type==="dot-density"){const s=(r=n.attributes)==null?void 0:r.some(i=>t(i.valueExpression));if(s)return s}const a=n.visualVariables,u=!!a&&a.some(s=>{let i=t(s.valueExpression);return s.type==="size"&&(qr(s.minSize)&&(i=i||t(s.minSize.valueExpression)),qr(s.maxSize)&&(i=i||t(s.maxSize.valueExpression))),i});return!(!("valueExpression"in n)||!t(n.valueExpression))||u}if(mo(n)){const a=n.labelExpressionInfo&&n.labelExpressionInfo.expression;return!(!a||!t(a))||!1}return!!po(n)&&(!!n.expressionInfos&&n.expressionInfos.some(a=>t(a.expression))||Array.isArray(n.content)&&n.content.some(a=>{var u;return a.type==="expression"&&t((u=a.expressionInfo)==null?void 0:u.expression)}))}function Do(e){const t=$t(e);return!!t&&ea(t)}function go(e){return na(e,Do)}function yo(e){const t=$t(e);return!!t&&rn(t)}function wo(e){return na(e,yo)}function qr(e){return e&&e.declaredClass==="esri.renderers.visualVariables.SizeVariable"}const Qo=Object.freeze(Object.defineProperty({__proto__:null,Dictionary:k,arcade:qu,arcadeFeature:Y,convertFeatureLayerToFeatureSet:so,convertJsonToArcade:oo,convertMapToFeatureSetCollection:uo,convertServiceUrlToWorkspace:ao,createExecContext:Wu,createFeature:Ku,createFunction:Hu,createSyntaxTree:$t,dependsOnView:no,enableFeatureSetOperations:fo,enableGeometryOperations:co,evalSyntaxTree:Xu,executeAsyncFunction:eo,executeFunction:Qu,extractFieldNames:to,getArcadeType:Zu,getViewInfo:io,hasGeometryFunctions:go,hasGeometryOperations:wo,hasVariable:ro,loadScriptDependencies:lo,updateExecContext:Yu},Symbol.toStringTag,{value:"Module"}));export{se as $,k as A,H as B,Ee as C,me as D,Q as E,C as F,bi as G,Ot as H,ut as I,G as J,Na as K,b as L,La as M,wi as N,K as O,_n as P,D as Q,ht as R,$ as S,mi as T,Ta as U,Bt as V,bt as W,dt as X,U as Y,yi as Z,X as _,st as a,Da as a0,ze as a1,Bo as a2,fn as a3,jo as a4,ii as a5,Yt as a6,Pt as a7,ai as a8,ti as a9,si as aa,ni as ab,pe as ac,ui as ad,pr as ae,cr as af,hr as ag,dr as ah,_o as ai,To as aj,Mo as ak,Oo as al,fr as am,$o as an,Lo as ao,ma as ap,mr as aq,No as ar,ga as as,Ro as at,Uo as au,Po as av,Za as aw,wa as ax,ri as ay,Qo as az,m as b,A as c,Wn as d,He as e,Fi as f,Kn as g,Y as h,Fe as i,Le as j,kt as k,P as l,Ce as m,at as n,kn as o,Tn as p,L as q,Ze as r,tn as s,Rt as t,In as u,M as v,re as w,wt as x,ee as y,B as z}; diff --git a/assets/arcgis-knowledge-client-core-59a3e261.js b/assets/arcgis-knowledge-client-core-59a3e261.js new file mode 100644 index 0000000..b861597 --- /dev/null +++ b/assets/arcgis-knowledge-client-core-59a3e261.js @@ -0,0 +1,3 @@ +import{bU as rn,eM as Rr}from"./index-080e108a.js";function en(F,c){for(var z=0;zO[U]})}}}return Object.freeze(Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}))}var ke,Yr,We,Cr={exports:{}};Cr.exports,ke=Cr,Cr.exports,Yr=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,We=function(F){var c,z,O;F=F||{},c||(c=F!==void 0?F:{}),c.ready=new Promise(function(r,e){z=r,O=e});var U=Object.assign({},c),q="./this.program",x="";typeof document<"u"&&document.currentScript&&(x=document.currentScript.src),Yr&&(x=Yr),x=x.indexOf("blob:")!==0?x.substr(0,x.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var Z,Oe=c.print||console.log.bind(console),N=c.printErr||console.warn.bind(console);Object.assign(c,U),U=null,c.thisProgram&&(q=c.thisProgram),c.wasmBinary&&(Z=c.wasmBinary),c.noExitRuntime,typeof WebAssembly!="object"&&Q("no native wasm support detected");var _r,$r,S,P,Y,X,w,y,Hr,Vr,Br,zr,qr=!1,Nr=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ur(r,e,n){var t=e+n;for(n=e;r[n]&&!(n>=t);)++n;if(16(a=(240&a)==224?(15&a)<<12|i<<6|f:(7&a)<<18|i<<12|f<<6|63&r[e++])?t+=String.fromCharCode(a):(a-=65536,t+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else t+=String.fromCharCode(a)}return t}function Lr(r,e,n,t){if(0=i&&(i=65536+((1023&i)<<10)|1023&r.charCodeAt(++a)),127>=i){if(n>=t)break;e[n++]=i}else{if(2047>=i){if(n+1>=t)break;e[n++]=192|i>>6}else{if(65535>=i){if(n+2>=t)break;e[n++]=224|i>>12}else{if(n+3>=t)break;e[n++]=240|i>>18,e[n++]=128|i>>12&63}e[n++]=128|i>>6&63}e[n++]=128|63&i}}e[n]=0}}function Gr(r){for(var e=0,n=0;n=t?e++:2047>=t?e+=2:55296<=t&&57343>=t?(e+=4,++n):e+=3}return e}function Jr(){var r=_r.buffer;$r=r,c.HEAP8=S=new Int8Array(r),c.HEAP16=Y=new Int16Array(r),c.HEAP32=w=new Int32Array(r),c.HEAPU8=P=new Uint8Array(r),c.HEAPU16=X=new Uint16Array(r),c.HEAPU32=y=new Uint32Array(r),c.HEAPF32=Hr=new Float32Array(r),c.HEAPF64=zr=new Float64Array(r),c.HEAP64=Vr=new BigInt64Array(r),c.HEAPU64=Br=new BigUint64Array(r)}var Zr,Xr=[],Kr=[],Qr=[];function je(){var r=c.preRun.shift();Xr.unshift(r)}var D,H=0,K=null;function Q(r){throw c.onAbort&&c.onAbort(r),N(r="Aborted("+r+")"),qr=!0,r=new WebAssembly.RuntimeError(r+". Build with -sASSERTIONS for more info."),O(r),r}function re(){return D.startsWith("data:application/octet-stream;base64,")}if(D="arcgis-knowledge-client-core.wasm",!re()){var ee=D;D=c.locateFile?c.locateFile(ee,x):x+ee}function ne(){var r=D;try{if(r==D&&Z)return new Uint8Array(Z);throw"both async and sync fetching of the wasm failed"}catch(e){Q(e)}}function Fe(){return Z||typeof fetch!="function"?Promise.resolve().then(function(){return ne()}):fetch(D,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+D+"'";return r.arrayBuffer()}).catch(function(){return ne()})}function kr(r){for(;0>2]=e},this.Ua=function(e){y[this.ga+8>>2]=e},this.Va=function(){w[this.ga>>2]=0},this.Oa=function(){S[this.ga+12>>0]=0},this.Ya=function(){S[this.ga+13>>0]=0},this.La=function(e,n){this.Ma(),this.Za(e),this.Ua(n),this.Va(),this.Oa(),this.Ya()},this.Ma=function(){y[this.ga+16>>2]=0}}var cr={};function fr(r){for(;r.length;){var e=r.pop();r.pop()(e)}}function rr(r){return this.fromWireType(w[r>>2])}var L={},V={},sr={};function te(r){if(r===void 0)return"_unknown";var e=(r=r.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=e&&57>=e?"_"+r:r}function Wr(r,e){return r=te(r),function(){return e.apply(this,arguments)}}function Er(r){var e=Error,n=Wr(r,function(t){this.name=r,this.message=t,(t=Error(t).stack)!==void 0&&(this.stack=this.toString()+` +`+t.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},n}var ae=void 0;function lr(r){throw new ae(r)}function $(r,e,n){function t(u){(u=n(u)).length!==r.length&&lr("Mismatched type converter count");for(var l=0;l{V.hasOwnProperty(u)?a[l]=V[u]:(i.push(u),L.hasOwnProperty(u)||(L[u]=[]),L[u].push(()=>{a[l]=V[u],++f===i.length&&t(a)}))}),i.length===0&&t(a)}function er(r){if(r===null)return"null";var e=typeof r;return e==="object"||e==="array"||e==="function"?r.toString():""+r}var ie=void 0;function b(r){for(var e="";P[r];)e+=ie[P[r++]];return e}var G=void 0;function m(r){throw new G(r)}function W(r,e,n={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var t=e.name;if(r||m('type "'+t+'" must have a positive integer typeid pointer'),V.hasOwnProperty(r)){if(n.Wa)return;m("Cannot register type '"+t+"' twice")}V[r]=e,delete sr[r],L.hasOwnProperty(r)&&(e=L[r],delete L[r],e.forEach(a=>a()))}function oe(r,e,n){switch(e){case 0:return n?function(t){return S[t]}:function(t){return P[t]};case 1:return n?function(t){return Y[t>>1]}:function(t){return X[t>>1]};case 2:return n?function(t){return w[t>>2]}:function(t){return y[t>>2]};case 3:return n?function(t){return Vr[t>>3]}:function(t){return Br[t>>3]};default:throw new TypeError("Unknown integer type: "+r)}}function nr(r){switch(r){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+r)}}function Or(r){m(r.ea.ha.fa.name+" instance already deleted")}var jr=!1;function ue(){}function ce(r){--r.count.value,r.count.value===0&&(r.ja?r.la.oa(r.ja):r.ha.fa.oa(r.ga))}function fe(r,e,n){return e===n?r:n.ma===void 0||(r=fe(r,e,n.ma))===null?null:n.Ka(r)}var se={},tr=[];function Fr(){for(;tr.length;){var r=tr.pop();r.ea.ua=!1,r.delete()}}var ar=void 0,ir={};function De(r,e){for(e===void 0&&m("ptr should not be undefined");r.ma;)e=r.wa(e),r=r.ma;return ir[e]}function hr(r,e){return e.ha&&e.ga||lr("makeClassHandle requires ptr and ptrType"),!!e.la!=!!e.ja&&lr("Both smartPtrType and smartPtr must be specified"),e.count={value:1},pr(Object.create(r,{ea:{value:e}}))}function pr(r){return typeof FinalizationRegistry>"u"?(pr=e=>e,r):(jr=new FinalizationRegistry(e=>{ce(e.ea)}),ue=e=>{jr.unregister(e)},(pr=e=>{var n=e.ea;return n.ja&&jr.register(e,{ea:n},e),e})(r))}function I(){}function Sr(r,e,n){if(r[e].ia===void 0){var t=r[e];r[e]=function(){return r[e].ia.hasOwnProperty(arguments.length)||m("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+r[e].ia+")!"),r[e].ia[arguments.length].apply(this,arguments)},r[e].ia=[],r[e].ia[t.ta]=t}}function Dr(r,e,n){c.hasOwnProperty(r)?((n===void 0||c[r].ia!==void 0&&c[r].ia[n]!==void 0)&&m("Cannot register public name '"+r+"' twice"),Sr(c,r,r),c.hasOwnProperty(n)&&m("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),c[r].ia[n]=e):(c[r]=e,n!==void 0&&(c[r].lb=n))}function Me(r,e,n,t,a,i,f,u){this.name=r,this.constructor=e,this.pa=n,this.oa=t,this.ma=a,this.Pa=i,this.wa=f,this.Ka=u,this.ab=[]}function vr(r,e,n){for(;e!==n;)e.wa||m("Expected null or instance of "+n.name+", got an instance of "+e.name),r=e.wa(r),e=e.ma;return r}function Ue(r,e){return e===null?(this.Ba&&m("null is not a valid "+this.name),0):(e.ea||m('Cannot pass "'+er(e)+'" as a '+this.name),e.ea.ga||m("Cannot pass deleted object as a pointer of type "+this.name),vr(e.ea.ga,e.ea.ha.fa,this.fa))}function xe(r,e){if(e===null){if(this.Ba&&m("null is not a valid "+this.name),this.ya){var n=this.Ca();return r!==null&&r.push(this.oa,n),n}return 0}if(e.ea||m('Cannot pass "'+er(e)+'" as a '+this.name),e.ea.ga||m("Cannot pass deleted object as a pointer of type "+this.name),!this.xa&&e.ea.ha.xa&&m("Cannot convert argument of type "+(e.ea.la?e.ea.la.name:e.ea.ha.name)+" to parameter type "+this.name),n=vr(e.ea.ga,e.ea.ha.fa,this.fa),this.ya)switch(e.ea.ja===void 0&&m("Passing raw pointer to smart pointer is illegal"),this.gb){case 0:e.ea.la===this?n=e.ea.ja:m("Cannot convert argument of type "+(e.ea.la?e.ea.la.name:e.ea.ha.name)+" to parameter type "+this.name);break;case 1:n=e.ea.ja;break;case 2:if(e.ea.la===this)n=e.ea.ja;else{var t=e.clone();n=this.bb(n,k(function(){t.delete()})),r!==null&&r.push(this.oa,n)}break;default:m("Unsupporting sharing policy")}return n}function Ie(r,e){return e===null?(this.Ba&&m("null is not a valid "+this.name),0):(e.ea||m('Cannot pass "'+er(e)+'" as a '+this.name),e.ea.ga||m("Cannot pass deleted object as a pointer of type "+this.name),e.ea.ha.xa&&m("Cannot convert argument of type "+e.ea.ha.name+" to parameter type "+this.name),vr(e.ea.ga,e.ea.ha.fa,this.fa))}function j(r,e,n,t,a,i,f,u,l,s,h){this.name=r,this.fa=e,this.Ba=n,this.xa=t,this.ya=a,this.$a=i,this.gb=f,this.Ha=u,this.Ca=l,this.bb=s,this.oa=h,a||e.ma!==void 0?this.toWireType=xe:(this.toWireType=t?Ue:Ie,this.ka=null)}function le(r,e,n){c.hasOwnProperty(r)||lr("Replacing nonexistant public symbol"),c[r].ia!==void 0&&n!==void 0?c[r].ia[n]=e:(c[r]=e,c[r].ta=n)}var dr=[];function T(r,e){r=b(r);var n=dr[e];return n||(e>=dr.length&&(dr.length=e+1),dr[e]=n=Zr.get(e)),typeof n!="function"&&m("unknown function pointer with signature "+r+": "+e),n}var he=void 0;function pe(r){var e=b(r=Ce(r));return M(r),e}function B(r,e){function n(i){a[i]||V[i]||(sr[i]?sr[i].forEach(n):(t.push(i),a[i]=!0))}var t=[],a={};throw e.forEach(n),new he(r+": "+t.map(pe).join([", "]))}function gr(r,e,n,t,a){var i=e.length;2>i&&m("argTypes array size mismatch! Must at least get return value and 'this' types!");var f=e[1]!==null&&n!==null,u=!1;for(n=1;n>2]);return n}function ve(r,e,n){return r instanceof Object||m(n+' with invalid "this": '+r),r instanceof e.fa.constructor||m(n+' incompatible with "this" of type '+r.constructor.name),r.ea.ga||m("cannot call emscripten binding method "+n+" on deleted object"),vr(r.ea.ga,r.ea.ha.fa,e.fa)}var Mr=[],E=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Ur(r){4(r||m("Cannot use deleted val. handle = "+r),E[r].value),k=r=>{switch(r){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=Mr.length?Mr.pop():E.length;return E[e]={Da:1,value:r},e}};function Re(r,e,n){switch(e){case 0:return function(t){return this.fromWireType((n?S:P)[t])};case 1:return function(t){return this.fromWireType((n?Y:X)[t>>1])};case 2:return function(t){return this.fromWireType((n?w:y)[t>>2])};default:throw new TypeError("Unknown integer type: "+r)}}function J(r,e){var n=V[r];return n===void 0&&m(e+" has unknown type "+pe(r)),n}function Ye(r,e){switch(e){case 2:return function(n){return this.fromWireType(Hr[n>>2])};case 3:return function(n){return this.fromWireType(zr[n>>3])};default:throw new TypeError("Unknown float type: "+r)}}var de=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function He(r,e){for(var n=r>>1,t=n+e/2;!(n>=t)&&X[n];)++n;if(32<(n<<=1)-r&&de)return de.decode(P.subarray(r,n));for(n="",t=0;!(t>=e/2);++t){var a=Y[r+2*t>>1];if(a==0)break;n+=String.fromCharCode(a)}return n}function Ve(r,e,n){if(n===void 0&&(n=2147483647),2>n)return 0;var t=e;n=(n-=2)<2*r.length?n/2:r.length;for(var a=0;a>1]=r.charCodeAt(a),e+=2;return Y[e>>1]=0,e-t}function Be(r){return 2*r.length}function ze(r,e){for(var n=0,t="";!(n>=e/4);){var a=w[r+4*n>>2];if(a==0)break;++n,65536<=a?(a-=65536,t+=String.fromCharCode(55296|a>>10,56320|1023&a)):t+=String.fromCharCode(a)}return t}function qe(r,e,n){if(n===void 0&&(n=2147483647),4>n)return 0;var t=e;n=t+n-4;for(var a=0;a=i&&(i=65536+((1023&i)<<10)|1023&r.charCodeAt(++a)),w[e>>2]=i,(e+=4)+4>n)break}return w[e>>2]=0,e-t}function Ne(r){for(var e=0,n=0;n=t&&++n,e+=4}return e}function ge(r,e){for(var n=Array(r),t=0;t>2],"parameter "+t);return n}var Le={};function yr(r){var e=Le[r];return e===void 0?b(r):e}var br=[];function me(){function r(e){e.$$$embind_global$$$=e;var n=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return n||delete e.$$$embind_global$$$,n}if(typeof globalThis=="object")return globalThis;if(typeof $$$embind_global$$$=="object"||(typeof Rr=="object"&&r(Rr)?$$$embind_global$$$=Rr:typeof self=="object"&&r(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")}function Ge(r){var e=br.length;return br.push(r),e}var ye=[];function Je(r){var e=Array(r+1);return function(n,t,a){e[0]=n;for(var i=0;i>2],"parameter "+i);e[i+1]=f.readValueFromPointer(a),a+=f.argPackAdvance}return n=new(n.bind.apply(n,e)),k(n)}}var be={},xr={};function we(){if(!Ir){var r,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:q||"./this.program"};for(r in xr)xr[r]===void 0?delete e[r]:e[r]=xr[r];var n=[];for(r in e)n.push(r+"="+e[r]);Ir=n}return Ir}var Ir,Ze=[null,[],[]];function wr(r){return r%4==0&&(r%100!=0||r%400==0)}var Ae=[31,29,31,30,31,30,31,31,30,31,30,31],Te=[31,28,31,30,31,30,31,31,30,31,30,31];function Xe(r){var e=Array(Gr(r)+1);return Lr(r,e,0,e.length),e}function Ke(r,e,n,t){function a(o,p,g){for(o=typeof o=="number"?o.toString():o||"";o.length_?-1:0<_?1:0}var A;return(A=g(o.getFullYear()-p.getFullYear()))===0&&(A=g(o.getMonth()-p.getMonth()))===0&&(A=g(o.getDate()-p.getDate())),A}function u(o){switch(o.getDay()){case 0:return new Date(o.getFullYear()-1,11,29);case 1:return o;case 2:return new Date(o.getFullYear(),0,3);case 3:return new Date(o.getFullYear(),0,2);case 4:return new Date(o.getFullYear(),0,1);case 5:return new Date(o.getFullYear()-1,11,31);case 6:return new Date(o.getFullYear()-1,11,30)}}function l(o){var p=o.ra;for(o=new Date(new Date(o.sa+1900,0,1).getTime());0A-o.getDate())){o.setDate(o.getDate()+p);break}p-=A-o.getDate()+1,o.setDate(1),11>g?o.setMonth(g+1):(o.setMonth(0),o.setFullYear(o.getFullYear()+1))}return g=new Date(o.getFullYear()+1,0,4),p=u(new Date(o.getFullYear(),0,4)),g=u(g),0>=f(p,o)?0>=f(g,o)?o.getFullYear()+1:o.getFullYear():o.getFullYear()-1}var s=w[t+40>>2];for(var h in t={jb:w[t>>2],ib:w[t+4>>2],za:w[t+8>>2],Ea:w[t+12>>2],Aa:w[t+16>>2],sa:w[t+20>>2],na:w[t+24>>2],ra:w[t+28>>2],mb:w[t+32>>2],hb:w[t+36>>2],kb:s&&s?ur(P,s):""},n=n?ur(P,n):"",s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(h,"g"),s[h]);var v="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(h in s={"%a":function(o){return v[o.na].substring(0,3)},"%A":function(o){return v[o.na]},"%b":function(o){return d[o.Aa].substring(0,3)},"%B":function(o){return d[o.Aa]},"%C":function(o){return i((o.sa+1900)/100|0,2)},"%d":function(o){return i(o.Ea,2)},"%e":function(o){return a(o.Ea,2," ")},"%g":function(o){return l(o).toString().substring(2)},"%G":function(o){return l(o)},"%H":function(o){return i(o.za,2)},"%I":function(o){return(o=o.za)==0?o=12:12o.za?"AM":"PM"},"%S":function(o){return i(o.jb,2)},"%t":function(){return" "},"%u":function(o){return o.na||7},"%U":function(o){return i(Math.floor((o.ra+7-o.na)/7),2)},"%V":function(o){var p=Math.floor((o.ra+7-(o.na+6)%7)/7);if(2>=(o.na+371-o.ra-2)%7&&p++,p)p==53&&((g=(o.na+371-o.ra)%7)==4||g==3&&wr(o.sa)||(p=1));else{p=52;var g=(o.na+7-o.ra-1)%7;(g==4||g==5&&wr(o.sa%400-1))&&p++}return i(p,2)},"%w":function(o){return o.na},"%W":function(o){return i(Math.floor((o.ra+7-(o.na+6)%7)/7),2)},"%y":function(o){return(o.sa+1900).toString().substring(2)},"%Y":function(o){return o.sa+1900},"%z":function(o){var p=0<=(o=o.hb);return o=Math.abs(o)/60,(p?"+":"-")+("0000"+(o/60*100+o%60)).slice(-4)},"%Z":function(o){return o.kb},"%%":function(){return"%"}},n=n.replace(/%%/g,"\0\0"),s)n.includes(h)&&(n=n.replace(new RegExp(h,"g"),s[h](t)));return(h=Xe(n=n.replace(/\0\0/g,"%"))).length>e?0:(S.set(h,r),h.length-1)}ae=c.InternalError=Er("InternalError");for(var Pe=Array(256),Ar=0;256>Ar;++Ar)Pe[Ar]=String.fromCharCode(Ar);ie=Pe,G=c.BindingError=Er("BindingError"),I.prototype.isAliasOf=function(r){if(!(this instanceof I&&r instanceof I))return!1;var e=this.ea.ha.fa,n=this.ea.ga,t=r.ea.ha.fa;for(r=r.ea.ga;e.ma;)n=e.wa(n),e=e.ma;for(;t.ma;)r=t.wa(r),t=t.ma;return e===t&&n===r},I.prototype.clone=function(){if(this.ea.ga||Or(this),this.ea.va)return this.ea.count.value+=1,this;var r=pr,e=Object,n=e.create,t=Object.getPrototypeOf(this),a=this.ea;return(r=r(n.call(e,t,{ea:{value:{count:a.count,ua:a.ua,va:a.va,ga:a.ga,ha:a.ha,ja:a.ja,la:a.la}}}))).ea.count.value+=1,r.ea.ua=!1,r},I.prototype.delete=function(){this.ea.ga||Or(this),this.ea.ua&&!this.ea.va&&m("Object already scheduled for deletion"),ue(this),ce(this.ea),this.ea.va||(this.ea.ja=void 0,this.ea.ga=void 0)},I.prototype.isDeleted=function(){return!this.ea.ga},I.prototype.deleteLater=function(){return this.ea.ga||Or(this),this.ea.ua&&!this.ea.va&&m("Object already scheduled for deletion"),tr.push(this),tr.length===1&&ar&&ar(Fr),this.ea.ua=!0,this},c.getInheritedInstanceCount=function(){return Object.keys(ir).length},c.getLiveInheritedInstances=function(){var r,e=[];for(r in ir)ir.hasOwnProperty(r)&&e.push(ir[r]);return e},c.flushPendingDeletes=Fr,c.setDelayFunction=function(r){ar=r,tr.length&&ar&&ar(Fr)},j.prototype.Qa=function(r){return this.Ha&&(r=this.Ha(r)),r},j.prototype.Fa=function(r){this.oa&&this.oa(r)},j.prototype.argPackAdvance=8,j.prototype.readValueFromPointer=rr,j.prototype.deleteObject=function(r){r!==null&&r.delete()},j.prototype.fromWireType=function(r){function e(){return this.ya?hr(this.fa.pa,{ha:this.$a,ga:n,la:this,ja:r}):hr(this.fa.pa,{ha:this,ga:r})}var n=this.Qa(r);if(!n)return this.Fa(r),null;var t=De(this.fa,n);if(t!==void 0)return t.ea.count.value===0?(t.ea.ga=n,t.ea.ja=r,t.clone()):(t=t.clone(),this.Fa(r),t);if(t=this.fa.Pa(n),!(t=se[t]))return e.call(this);t=this.xa?t.Ia:t.pointerType;var a=fe(n,this.fa,t.fa);return a===null?e.call(this):this.ya?hr(t.fa.pa,{ha:t,ga:a,la:this,ja:r}):hr(t.fa.pa,{ha:t,ga:a})},he=c.UnboundTypeError=Er("UnboundTypeError"),c.count_emval_handles=function(){for(var r=0,e=5;ei.Ta).concat(a.map(i=>i.eb)),i=>{var f={};return a.forEach((u,l)=>{var s=i[l],h=u.Ra,v=u.Sa,d=i[l+a.length],o=u.cb,p=u.fb;f[u.Na]={read:g=>s.fromWireType(h(v,g)),write:(g,A)=>{var _=[];o(p,g,d.toWireType(_,A)),fr(_)}}}),[{name:e.name,fromWireType:function(u){var l,s={};for(l in f)s[l]=f[l].read(u);return t(u),s},toWireType:function(u,l){for(var s in f)if(!(s in l))throw new TypeError('Missing field: "'+s+'"');var h=n();for(s in f)f[s].write(h,l[s]);return u!==null&&u.push(t,h),h},argPackAdvance:8,readValueFromPointer:rr,ka:t}]})},A:function(r,e,n,t,a){e=b(e),n=nr(n);var i=e.indexOf("u")!=-1;i&&(a=(1n<<64n)-1n),W(r,{name:e,fromWireType:function(f){return f},toWireType:function(f,u){if(typeof u!="bigint"&&typeof u!="number")throw new TypeError('Cannot convert "'+er(u)+'" to '+this.name);if(ua)throw new TypeError('Passing a number "'+er(u)+'" from JS side to C/C++ side to an argument of type "'+e+'", which is outside the valid range ['+t+", "+a+"]!");return u},argPackAdvance:8,readValueFromPointer:oe(e,n,!i),ka:null})},R:function(r,e,n,t,a){var i=nr(n);W(r,{name:e=b(e),fromWireType:function(f){return!!f},toWireType:function(f,u){return u?t:a},argPackAdvance:8,readValueFromPointer:function(f){if(n===1)var u=S;else if(n===2)u=Y;else{if(n!==4)throw new TypeError("Unknown boolean type size: "+e);u=w}return this.fromWireType(u[f>>i])},ka:null})},f:function(r,e,n,t,a,i,f,u,l,s,h,v,d){h=b(h),i=T(a,i),u&&(u=T(f,u)),s&&(s=T(l,s)),d=T(v,d);var o=te(h);Dr(o,function(){B("Cannot construct "+h+" due to unbound types",[t])}),$([r,e,n],t?[t]:[],function(p){if(p=p[0],t)var g=p.fa,A=g.pa;else A=I.prototype;p=Wr(o,function(){if(Object.getPrototypeOf(this)!==_)throw new G("Use 'new' to construct "+h);if(R.qa===void 0)throw new G(h+" has no accessible constructor");var $e=R.qa[arguments.length];if($e===void 0)throw new G("Tried to invoke ctor of "+h+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(R.qa).toString()+") parameters instead!");return $e.apply(this,arguments)});var _=Object.create(A,{constructor:{value:p}});p.prototype=_;var R=new Me(h,p,_,d,g,i,u,s);g=new j(h,R,!0,!1,!1),A=new j(h+"*",R,!1,!1,!1);var or=new j(h+" const*",R,!1,!0,!1);return se[r]={pointerType:A,Ia:or},le(o,p),[g,A,or]})},D:function(r,e,n,t,a,i,f){var u=mr(n,t);e=b(e),i=T(a,i),$([],[r],function(l){function s(){B("Cannot call "+h+" due to unbound types",u)}var h=(l=l[0]).name+"."+e;e.startsWith("@@")&&(e=Symbol[e.substring(2)]);var v=l.fa.constructor;return v[e]===void 0?(s.ta=n-1,v[e]=s):(Sr(v,e,h),v[e].ia[n-1]=s),$([],u,function(d){return d=gr(h,[d[0],null].concat(d.slice(1)),null,i,f),v[e].ia===void 0?(d.ta=n-1,v[e]=d):v[e].ia[n-1]=d,[]}),[]})},o:function(r,e,n,t,a,i){0{B("Cannot construct "+u.name+" due to unbound types",f)},$([],f,function(s){return s.splice(1,0,null),u.fa.qa[e-1]=gr(l,s,null,a,i),[]}),[]})},b:function(r,e,n,t,a,i,f,u){var l=mr(n,t);e=b(e),i=T(a,i),$([],[r],function(s){function h(){B("Cannot call "+v+" due to unbound types",l)}var v=(s=s[0]).name+"."+e;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),u&&s.fa.ab.push(e);var d=s.fa.pa,o=d[e];return o===void 0||o.ia===void 0&&o.className!==s.name&&o.ta===n-2?(h.ta=n-2,h.className=s.name,d[e]=h):(Sr(d,e,v),d[e].ia[n-2]=h),$([],l,function(p){return p=gr(v,p,s,i,f),d[e].ia===void 0?(p.ta=n-2,d[e]=p):d[e].ia[n-2]=p,[]}),[]})},c:function(r,e,n,t,a,i,f,u,l,s){e=b(e),a=T(t,a),$([],[r],function(h){var v=(h=h[0]).name+"."+e,d={get:function(){B("Cannot access "+v+" due to unbound types",[n,f])},enumerable:!0,configurable:!0};return d.set=l?()=>{B("Cannot access "+v+" due to unbound types",[n,f])}:()=>{m(v+" is a read-only property")},Object.defineProperty(h.fa.pa,e,d),$([],l?[n,f]:[n],function(o){var p=o[0],g={get:function(){var _=ve(this,h,v+" getter");return p.fromWireType(a(i,_))},enumerable:!0};if(l){l=T(u,l);var A=o[1];g.set=function(_){var R=ve(this,h,v+" setter"),or=[];l(s,R,A.toWireType(or,_)),fr(or)}}return Object.defineProperty(h.fa.pa,e,g),[]}),[]})},Q:function(r,e){W(r,{name:e=b(e),fromWireType:function(n){var t=C(n);return Ur(n),t},toWireType:function(n,t){return k(t)},argPackAdvance:8,readValueFromPointer:rr,ka:null})},q:function(r,e,n,t){function a(){}n=nr(n),e=b(e),a.values={},W(r,{name:e,constructor:a,fromWireType:function(i){return this.constructor.values[i]},toWireType:function(i,f){return f.value},argPackAdvance:8,readValueFromPointer:Re(e,n,t),ka:null}),Dr(e,a)},e:function(r,e,n){var t=J(r,"enum");e=b(e),r=t.constructor,t=Object.create(t.constructor.prototype,{value:{value:n},constructor:{value:Wr(t.name+"_"+e,function(){})}}),r.values[n]=t,r[e]=t},z:function(r,e,n){n=nr(n),W(r,{name:e=b(e),fromWireType:function(t){return t},toWireType:function(t,a){return a},argPackAdvance:8,readValueFromPointer:Ye(e,n),ka:null})},V:function(r,e,n,t,a,i){var f=mr(e,n);r=b(r),a=T(t,a),Dr(r,function(){B("Cannot call "+r+" due to unbound types",f)},e-1),$([],f,function(u){return le(r,gr(r,[u[0],null].concat(u.slice(1)),null,a,i),e-1),[]})},r:function(r,e,n,t,a){e=b(e),a===-1&&(a=4294967295),a=nr(n);var i=u=>u;if(t===0){var f=32-8*n;i=u=>u<>>f}n=e.includes("unsigned")?function(u,l){return l>>>0}:function(u,l){return l},W(r,{name:e,fromWireType:i,toWireType:n,argPackAdvance:8,readValueFromPointer:oe(e,a,t!==0),ka:null})},l:function(r,e,n){function t(i){var f=y;return new a($r,f[1+(i>>=2)],f[i])}var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][e];W(r,{name:n=b(n),fromWireType:t,argPackAdvance:8,readValueFromPointer:t},{Wa:!0})},k:function(r,e,n,t,a,i,f,u,l,s,h,v){n=b(n),i=T(a,i),u=T(f,u),s=T(l,s),v=T(h,v),$([r],[e],function(d){return d=d[0],[new j(n,d.fa,!1,!1,!0,d,t,i,u,s,v)]})},B:function(r,e){var n=(e=b(e))==="std::string";W(r,{name:e,fromWireType:function(t){var a=y[t>>2],i=t+4;if(n)for(var f=i,u=0;u<=a;++u){var l=i+u;if(u==a||P[l]==0){if(f=f?ur(P,f,l-f):"",s===void 0)var s=f;else s+=String.fromCharCode(0),s+=f;f=l+1}}else{for(s=Array(a),u=0;u>2]=f,n&&i)Lr(a,P,l,f+1);else if(i)for(i=0;iX,u=1;else e===4&&(t=ze,a=qe,i=Ne,f=()=>y,u=2);W(r,{name:n,fromWireType:function(l){for(var s,h=y[l>>2],v=f(),d=l+4,o=0;o<=h;++o){var p=l+4+o*e;o!=h&&v[p>>u]!=0||(d=t(d,p-d),s===void 0?s=d:(s+=String.fromCharCode(0),s+=d),d=p+e)}return M(l),s},toWireType:function(l,s){typeof s!="string"&&m("Cannot pass non-string to C++ string type "+n);var h=i(s),v=Pr(4+h+e);return y[v>>2]=h>>u,a(s,v+4,h+e),l!==null&&l.push(M,v),v},argPackAdvance:8,readValueFromPointer:rr,ka:function(l){M(l)}})},u:function(r,e,n,t,a,i){cr[r]={name:b(e),Ca:T(n,t),oa:T(a,i),Ga:[]}},h:function(r,e,n,t,a,i,f,u,l,s){cr[r].Ga.push({Na:b(e),Ta:n,Ra:T(t,a),Sa:i,eb:f,cb:T(u,l),fb:s})},S:function(r,e){W(r,{Xa:!0,name:e=b(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},n:function(r,e,n){r=C(r),e=J(e,"emval::as");var t=[],a=k(t);return y[n>>2]=a,e.toWireType(t,r)},E:function(r,e){return r=C(r),(e=J(e,"emval::as")).toWireType(null,r)},X:function(r,e,n,t){r=C(r),n=ge(e,n);for(var a=Array(e),i=0;i>2]=k(i),r(e,n,i,a)},C:function(r,e,n,t){(r=br[r])(e=C(e),n=yr(n),null,t)},a:Ur,x:function(r){return r===0?k(me()):(r=yr(r),k(me()[r]))},w:function(r,e){var n=ge(r,e),t=n[0];e=t.name+"_$"+n.slice(1).map(function(f){return f.name}).join("_")+"$";var a=ye[e];if(a!==void 0)return a;var i=Array(r-1);return a=Ge((f,u,l,s)=>{for(var h=0,v=0;v>>=0))return!1;for(var n=1;4>=n;n*=2){var t=e*(1+.2/n);t=Math.min(t,r+100663296);var a=Math;t=Math.max(r,t),a=a.min.call(a,2147483648,t+(65536-t%65536)%65536);r:{try{_r.grow(a-$r.byteLength+65535>>>16),Jr();var i=1;break r}catch{}i=void 0}if(i)return!0}return!1},I:function(r,e){var n=0;return we().forEach(function(t,a){var i=e+n;for(a=y[r+4*a>>2]=i,i=0;i>0]=t.charCodeAt(i);S[a>>0]=0,n+=t.length+1}),0},J:function(r,e){var n=we();y[r>>2]=n.length;var t=0;return n.forEach(function(a){t+=a.length+1}),y[e>>2]=t,0},O:function(){return 52},N:function(){return 70},M:function(r,e,n,t){for(var a=0,i=0;i>2],u=y[e+4>>2];e+=8;for(var l=0;l>2]=a,0},H:function(r,e,n,t){return Ke(r,e,n,t)}};(function(){function r(a){c.asm=a.exports,_r=c.asm.Y,Jr(),Zr=c.asm.ca,Kr.unshift(c.asm.Z),H--,c.monitorRunDependencies&&c.monitorRunDependencies(H),H==0&&K&&(a=K,K=null,a())}function e(a){r(a.instance)}function n(a){return Fe().then(function(i){return WebAssembly.instantiate(i,t)}).then(function(i){return i}).then(a,function(i){N("failed to asynchronously prepare wasm: "+i),Q(i)})}var t={a:Qe};if(H++,c.monitorRunDependencies&&c.monitorRunDependencies(H),c.instantiateWasm)try{return c.instantiateWasm(t,r)}catch(a){N("Module.instantiateWasm callback failed with error: "+a),O(a)}(Z||typeof WebAssembly.instantiateStreaming!="function"||re()||typeof fetch!="function"?n(e):fetch(D,{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,t).then(e,function(i){return N("wasm streaming compile failed: "+i),N("falling back to ArrayBuffer instantiation"),n(e)})})).catch(O)})(),c.___wasm_call_ctors=function(){return(c.___wasm_call_ctors=c.asm.Z).apply(null,arguments)};var Tr,Pr=c._malloc=function(){return(Pr=c._malloc=c.asm._).apply(null,arguments)},M=c._free=function(){return(M=c._free=c.asm.$).apply(null,arguments)},Ce=c.___getTypeName=function(){return(Ce=c.___getTypeName=c.asm.aa).apply(null,arguments)};function _e(){function r(){if(!Tr&&(Tr=!0,c.calledRun=!0,!qr)){if(kr(Kr),z(c),c.onRuntimeInitialized&&c.onRuntimeInitialized(),c.postRun)for(typeof c.postRun=="function"&&(c.postRun=[c.postRun]);c.postRun.length;){var e=c.postRun.shift();Qr.unshift(e)}kr(Qr)}}if(!(0O[U]})}}}return Object.freeze(Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}))}var ke,Yr,We,Cr={exports:{}};Cr.exports,ke=Cr,Cr.exports,Yr=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,We=function(F){var c,z,O;F=F||{},c||(c=F!==void 0?F:{}),c.ready=new Promise(function(r,e){z=r,O=e});var U=Object.assign({},c),q="./this.program",x="";typeof document<"u"&&document.currentScript&&(x=document.currentScript.src),Yr&&(x=Yr),x=x.indexOf("blob:")!==0?x.substr(0,x.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var Z,Oe=c.print||console.log.bind(console),N=c.printErr||console.warn.bind(console);Object.assign(c,U),U=null,c.thisProgram&&(q=c.thisProgram),c.wasmBinary&&(Z=c.wasmBinary),c.noExitRuntime,typeof WebAssembly!="object"&&Q("no native wasm support detected");var _r,$r,S,P,Y,X,w,y,Hr,Vr,Br,zr,qr=!1,Nr=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ur(r,e,n){var t=e+n;for(n=e;r[n]&&!(n>=t);)++n;if(16(a=(240&a)==224?(15&a)<<12|i<<6|f:(7&a)<<18|i<<12|f<<6|63&r[e++])?t+=String.fromCharCode(a):(a-=65536,t+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else t+=String.fromCharCode(a)}return t}function Lr(r,e,n,t){if(0=i&&(i=65536+((1023&i)<<10)|1023&r.charCodeAt(++a)),127>=i){if(n>=t)break;e[n++]=i}else{if(2047>=i){if(n+1>=t)break;e[n++]=192|i>>6}else{if(65535>=i){if(n+2>=t)break;e[n++]=224|i>>12}else{if(n+3>=t)break;e[n++]=240|i>>18,e[n++]=128|i>>12&63}e[n++]=128|i>>6&63}e[n++]=128|63&i}}e[n]=0}}function Gr(r){for(var e=0,n=0;n=t?e++:2047>=t?e+=2:55296<=t&&57343>=t?(e+=4,++n):e+=3}return e}function Jr(){var r=_r.buffer;$r=r,c.HEAP8=S=new Int8Array(r),c.HEAP16=Y=new Int16Array(r),c.HEAP32=w=new Int32Array(r),c.HEAPU8=P=new Uint8Array(r),c.HEAPU16=X=new Uint16Array(r),c.HEAPU32=y=new Uint32Array(r),c.HEAPF32=Hr=new Float32Array(r),c.HEAPF64=zr=new Float64Array(r),c.HEAP64=Vr=new BigInt64Array(r),c.HEAPU64=Br=new BigUint64Array(r)}var Zr,Xr=[],Kr=[],Qr=[];function je(){var r=c.preRun.shift();Xr.unshift(r)}var D,H=0,K=null;function Q(r){throw c.onAbort&&c.onAbort(r),N(r="Aborted("+r+")"),qr=!0,r=new WebAssembly.RuntimeError(r+". Build with -sASSERTIONS for more info."),O(r),r}function re(){return D.startsWith("data:application/octet-stream;base64,")}if(D="arcgis-knowledge-client-core-simd.wasm",!re()){var ee=D;D=c.locateFile?c.locateFile(ee,x):x+ee}function ne(){var r=D;try{if(r==D&&Z)return new Uint8Array(Z);throw"both async and sync fetching of the wasm failed"}catch(e){Q(e)}}function Fe(){return Z||typeof fetch!="function"?Promise.resolve().then(function(){return ne()}):fetch(D,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+D+"'";return r.arrayBuffer()}).catch(function(){return ne()})}function kr(r){for(;0>2]=e},this.Ua=function(e){y[this.ga+8>>2]=e},this.Va=function(){w[this.ga>>2]=0},this.Oa=function(){S[this.ga+12>>0]=0},this.Ya=function(){S[this.ga+13>>0]=0},this.La=function(e,n){this.Ma(),this.Za(e),this.Ua(n),this.Va(),this.Oa(),this.Ya()},this.Ma=function(){y[this.ga+16>>2]=0}}var cr={};function fr(r){for(;r.length;){var e=r.pop();r.pop()(e)}}function rr(r){return this.fromWireType(w[r>>2])}var L={},V={},sr={};function te(r){if(r===void 0)return"_unknown";var e=(r=r.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=e&&57>=e?"_"+r:r}function Wr(r,e){return r=te(r),function(){return e.apply(this,arguments)}}function Er(r){var e=Error,n=Wr(r,function(t){this.name=r,this.message=t,(t=Error(t).stack)!==void 0&&(this.stack=this.toString()+` +`+t.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},n}var ae=void 0;function lr(r){throw new ae(r)}function $(r,e,n){function t(u){(u=n(u)).length!==r.length&&lr("Mismatched type converter count");for(var l=0;l{V.hasOwnProperty(u)?a[l]=V[u]:(i.push(u),L.hasOwnProperty(u)||(L[u]=[]),L[u].push(()=>{a[l]=V[u],++f===i.length&&t(a)}))}),i.length===0&&t(a)}function er(r){if(r===null)return"null";var e=typeof r;return e==="object"||e==="array"||e==="function"?r.toString():""+r}var ie=void 0;function b(r){for(var e="";P[r];)e+=ie[P[r++]];return e}var G=void 0;function m(r){throw new G(r)}function W(r,e,n={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var t=e.name;if(r||m('type "'+t+'" must have a positive integer typeid pointer'),V.hasOwnProperty(r)){if(n.Wa)return;m("Cannot register type '"+t+"' twice")}V[r]=e,delete sr[r],L.hasOwnProperty(r)&&(e=L[r],delete L[r],e.forEach(a=>a()))}function oe(r,e,n){switch(e){case 0:return n?function(t){return S[t]}:function(t){return P[t]};case 1:return n?function(t){return Y[t>>1]}:function(t){return X[t>>1]};case 2:return n?function(t){return w[t>>2]}:function(t){return y[t>>2]};case 3:return n?function(t){return Vr[t>>3]}:function(t){return Br[t>>3]};default:throw new TypeError("Unknown integer type: "+r)}}function nr(r){switch(r){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+r)}}function Or(r){m(r.ea.ha.fa.name+" instance already deleted")}var jr=!1;function ue(){}function ce(r){--r.count.value,r.count.value===0&&(r.ja?r.la.oa(r.ja):r.ha.fa.oa(r.ga))}function fe(r,e,n){return e===n?r:n.ma===void 0||(r=fe(r,e,n.ma))===null?null:n.Ka(r)}var se={},tr=[];function Fr(){for(;tr.length;){var r=tr.pop();r.ea.ua=!1,r.delete()}}var ar=void 0,ir={};function De(r,e){for(e===void 0&&m("ptr should not be undefined");r.ma;)e=r.wa(e),r=r.ma;return ir[e]}function hr(r,e){return e.ha&&e.ga||lr("makeClassHandle requires ptr and ptrType"),!!e.la!=!!e.ja&&lr("Both smartPtrType and smartPtr must be specified"),e.count={value:1},pr(Object.create(r,{ea:{value:e}}))}function pr(r){return typeof FinalizationRegistry>"u"?(pr=e=>e,r):(jr=new FinalizationRegistry(e=>{ce(e.ea)}),ue=e=>{jr.unregister(e)},(pr=e=>{var n=e.ea;return n.ja&&jr.register(e,{ea:n},e),e})(r))}function I(){}function Sr(r,e,n){if(r[e].ia===void 0){var t=r[e];r[e]=function(){return r[e].ia.hasOwnProperty(arguments.length)||m("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+r[e].ia+")!"),r[e].ia[arguments.length].apply(this,arguments)},r[e].ia=[],r[e].ia[t.ta]=t}}function Dr(r,e,n){c.hasOwnProperty(r)?((n===void 0||c[r].ia!==void 0&&c[r].ia[n]!==void 0)&&m("Cannot register public name '"+r+"' twice"),Sr(c,r,r),c.hasOwnProperty(n)&&m("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),c[r].ia[n]=e):(c[r]=e,n!==void 0&&(c[r].lb=n))}function Me(r,e,n,t,a,i,f,u){this.name=r,this.constructor=e,this.pa=n,this.oa=t,this.ma=a,this.Pa=i,this.wa=f,this.Ka=u,this.ab=[]}function vr(r,e,n){for(;e!==n;)e.wa||m("Expected null or instance of "+n.name+", got an instance of "+e.name),r=e.wa(r),e=e.ma;return r}function Ue(r,e){return e===null?(this.Ba&&m("null is not a valid "+this.name),0):(e.ea||m('Cannot pass "'+er(e)+'" as a '+this.name),e.ea.ga||m("Cannot pass deleted object as a pointer of type "+this.name),vr(e.ea.ga,e.ea.ha.fa,this.fa))}function xe(r,e){if(e===null){if(this.Ba&&m("null is not a valid "+this.name),this.ya){var n=this.Ca();return r!==null&&r.push(this.oa,n),n}return 0}if(e.ea||m('Cannot pass "'+er(e)+'" as a '+this.name),e.ea.ga||m("Cannot pass deleted object as a pointer of type "+this.name),!this.xa&&e.ea.ha.xa&&m("Cannot convert argument of type "+(e.ea.la?e.ea.la.name:e.ea.ha.name)+" to parameter type "+this.name),n=vr(e.ea.ga,e.ea.ha.fa,this.fa),this.ya)switch(e.ea.ja===void 0&&m("Passing raw pointer to smart pointer is illegal"),this.gb){case 0:e.ea.la===this?n=e.ea.ja:m("Cannot convert argument of type "+(e.ea.la?e.ea.la.name:e.ea.ha.name)+" to parameter type "+this.name);break;case 1:n=e.ea.ja;break;case 2:if(e.ea.la===this)n=e.ea.ja;else{var t=e.clone();n=this.bb(n,k(function(){t.delete()})),r!==null&&r.push(this.oa,n)}break;default:m("Unsupporting sharing policy")}return n}function Ie(r,e){return e===null?(this.Ba&&m("null is not a valid "+this.name),0):(e.ea||m('Cannot pass "'+er(e)+'" as a '+this.name),e.ea.ga||m("Cannot pass deleted object as a pointer of type "+this.name),e.ea.ha.xa&&m("Cannot convert argument of type "+e.ea.ha.name+" to parameter type "+this.name),vr(e.ea.ga,e.ea.ha.fa,this.fa))}function j(r,e,n,t,a,i,f,u,l,s,h){this.name=r,this.fa=e,this.Ba=n,this.xa=t,this.ya=a,this.$a=i,this.gb=f,this.Ha=u,this.Ca=l,this.bb=s,this.oa=h,a||e.ma!==void 0?this.toWireType=xe:(this.toWireType=t?Ue:Ie,this.ka=null)}function le(r,e,n){c.hasOwnProperty(r)||lr("Replacing nonexistant public symbol"),c[r].ia!==void 0&&n!==void 0?c[r].ia[n]=e:(c[r]=e,c[r].ta=n)}var dr=[];function T(r,e){r=b(r);var n=dr[e];return n||(e>=dr.length&&(dr.length=e+1),dr[e]=n=Zr.get(e)),typeof n!="function"&&m("unknown function pointer with signature "+r+": "+e),n}var he=void 0;function pe(r){var e=b(r=Ce(r));return M(r),e}function B(r,e){function n(i){a[i]||V[i]||(sr[i]?sr[i].forEach(n):(t.push(i),a[i]=!0))}var t=[],a={};throw e.forEach(n),new he(r+": "+t.map(pe).join([", "]))}function gr(r,e,n,t,a){var i=e.length;2>i&&m("argTypes array size mismatch! Must at least get return value and 'this' types!");var f=e[1]!==null&&n!==null,u=!1;for(n=1;n>2]);return n}function ve(r,e,n){return r instanceof Object||m(n+' with invalid "this": '+r),r instanceof e.fa.constructor||m(n+' incompatible with "this" of type '+r.constructor.name),r.ea.ga||m("cannot call emscripten binding method "+n+" on deleted object"),vr(r.ea.ga,r.ea.ha.fa,e.fa)}var Mr=[],E=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Ur(r){4(r||m("Cannot use deleted val. handle = "+r),E[r].value),k=r=>{switch(r){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=Mr.length?Mr.pop():E.length;return E[e]={Da:1,value:r},e}};function Re(r,e,n){switch(e){case 0:return function(t){return this.fromWireType((n?S:P)[t])};case 1:return function(t){return this.fromWireType((n?Y:X)[t>>1])};case 2:return function(t){return this.fromWireType((n?w:y)[t>>2])};default:throw new TypeError("Unknown integer type: "+r)}}function J(r,e){var n=V[r];return n===void 0&&m(e+" has unknown type "+pe(r)),n}function Ye(r,e){switch(e){case 2:return function(n){return this.fromWireType(Hr[n>>2])};case 3:return function(n){return this.fromWireType(zr[n>>3])};default:throw new TypeError("Unknown float type: "+r)}}var de=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function He(r,e){for(var n=r>>1,t=n+e/2;!(n>=t)&&X[n];)++n;if(32<(n<<=1)-r&&de)return de.decode(P.subarray(r,n));for(n="",t=0;!(t>=e/2);++t){var a=Y[r+2*t>>1];if(a==0)break;n+=String.fromCharCode(a)}return n}function Ve(r,e,n){if(n===void 0&&(n=2147483647),2>n)return 0;var t=e;n=(n-=2)<2*r.length?n/2:r.length;for(var a=0;a>1]=r.charCodeAt(a),e+=2;return Y[e>>1]=0,e-t}function Be(r){return 2*r.length}function ze(r,e){for(var n=0,t="";!(n>=e/4);){var a=w[r+4*n>>2];if(a==0)break;++n,65536<=a?(a-=65536,t+=String.fromCharCode(55296|a>>10,56320|1023&a)):t+=String.fromCharCode(a)}return t}function qe(r,e,n){if(n===void 0&&(n=2147483647),4>n)return 0;var t=e;n=t+n-4;for(var a=0;a=i&&(i=65536+((1023&i)<<10)|1023&r.charCodeAt(++a)),w[e>>2]=i,(e+=4)+4>n)break}return w[e>>2]=0,e-t}function Ne(r){for(var e=0,n=0;n=t&&++n,e+=4}return e}function ge(r,e){for(var n=Array(r),t=0;t>2],"parameter "+t);return n}var Le={};function yr(r){var e=Le[r];return e===void 0?b(r):e}var br=[];function me(){function r(e){e.$$$embind_global$$$=e;var n=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return n||delete e.$$$embind_global$$$,n}if(typeof globalThis=="object")return globalThis;if(typeof $$$embind_global$$$=="object"||(typeof Rr=="object"&&r(Rr)?$$$embind_global$$$=Rr:typeof self=="object"&&r(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")}function Ge(r){var e=br.length;return br.push(r),e}var ye=[];function Je(r){var e=Array(r+1);return function(n,t,a){e[0]=n;for(var i=0;i>2],"parameter "+i);e[i+1]=f.readValueFromPointer(a),a+=f.argPackAdvance}return n=new(n.bind.apply(n,e)),k(n)}}var be={},xr={};function we(){if(!Ir){var r,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:q||"./this.program"};for(r in xr)xr[r]===void 0?delete e[r]:e[r]=xr[r];var n=[];for(r in e)n.push(r+"="+e[r]);Ir=n}return Ir}var Ir,Ze=[null,[],[]];function wr(r){return r%4==0&&(r%100!=0||r%400==0)}var Ae=[31,29,31,30,31,30,31,31,30,31,30,31],Te=[31,28,31,30,31,30,31,31,30,31,30,31];function Xe(r){var e=Array(Gr(r)+1);return Lr(r,e,0,e.length),e}function Ke(r,e,n,t){function a(o,p,g){for(o=typeof o=="number"?o.toString():o||"";o.length_?-1:0<_?1:0}var A;return(A=g(o.getFullYear()-p.getFullYear()))===0&&(A=g(o.getMonth()-p.getMonth()))===0&&(A=g(o.getDate()-p.getDate())),A}function u(o){switch(o.getDay()){case 0:return new Date(o.getFullYear()-1,11,29);case 1:return o;case 2:return new Date(o.getFullYear(),0,3);case 3:return new Date(o.getFullYear(),0,2);case 4:return new Date(o.getFullYear(),0,1);case 5:return new Date(o.getFullYear()-1,11,31);case 6:return new Date(o.getFullYear()-1,11,30)}}function l(o){var p=o.ra;for(o=new Date(new Date(o.sa+1900,0,1).getTime());0A-o.getDate())){o.setDate(o.getDate()+p);break}p-=A-o.getDate()+1,o.setDate(1),11>g?o.setMonth(g+1):(o.setMonth(0),o.setFullYear(o.getFullYear()+1))}return g=new Date(o.getFullYear()+1,0,4),p=u(new Date(o.getFullYear(),0,4)),g=u(g),0>=f(p,o)?0>=f(g,o)?o.getFullYear()+1:o.getFullYear():o.getFullYear()-1}var s=w[t+40>>2];for(var h in t={jb:w[t>>2],ib:w[t+4>>2],za:w[t+8>>2],Ea:w[t+12>>2],Aa:w[t+16>>2],sa:w[t+20>>2],na:w[t+24>>2],ra:w[t+28>>2],mb:w[t+32>>2],hb:w[t+36>>2],kb:s&&s?ur(P,s):""},n=n?ur(P,n):"",s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(h,"g"),s[h]);var v="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(h in s={"%a":function(o){return v[o.na].substring(0,3)},"%A":function(o){return v[o.na]},"%b":function(o){return d[o.Aa].substring(0,3)},"%B":function(o){return d[o.Aa]},"%C":function(o){return i((o.sa+1900)/100|0,2)},"%d":function(o){return i(o.Ea,2)},"%e":function(o){return a(o.Ea,2," ")},"%g":function(o){return l(o).toString().substring(2)},"%G":function(o){return l(o)},"%H":function(o){return i(o.za,2)},"%I":function(o){return(o=o.za)==0?o=12:12o.za?"AM":"PM"},"%S":function(o){return i(o.jb,2)},"%t":function(){return" "},"%u":function(o){return o.na||7},"%U":function(o){return i(Math.floor((o.ra+7-o.na)/7),2)},"%V":function(o){var p=Math.floor((o.ra+7-(o.na+6)%7)/7);if(2>=(o.na+371-o.ra-2)%7&&p++,p)p==53&&((g=(o.na+371-o.ra)%7)==4||g==3&&wr(o.sa)||(p=1));else{p=52;var g=(o.na+7-o.ra-1)%7;(g==4||g==5&&wr(o.sa%400-1))&&p++}return i(p,2)},"%w":function(o){return o.na},"%W":function(o){return i(Math.floor((o.ra+7-(o.na+6)%7)/7),2)},"%y":function(o){return(o.sa+1900).toString().substring(2)},"%Y":function(o){return o.sa+1900},"%z":function(o){var p=0<=(o=o.hb);return o=Math.abs(o)/60,(p?"+":"-")+("0000"+(o/60*100+o%60)).slice(-4)},"%Z":function(o){return o.kb},"%%":function(){return"%"}},n=n.replace(/%%/g,"\0\0"),s)n.includes(h)&&(n=n.replace(new RegExp(h,"g"),s[h](t)));return(h=Xe(n=n.replace(/\0\0/g,"%"))).length>e?0:(S.set(h,r),h.length-1)}ae=c.InternalError=Er("InternalError");for(var Pe=Array(256),Ar=0;256>Ar;++Ar)Pe[Ar]=String.fromCharCode(Ar);ie=Pe,G=c.BindingError=Er("BindingError"),I.prototype.isAliasOf=function(r){if(!(this instanceof I&&r instanceof I))return!1;var e=this.ea.ha.fa,n=this.ea.ga,t=r.ea.ha.fa;for(r=r.ea.ga;e.ma;)n=e.wa(n),e=e.ma;for(;t.ma;)r=t.wa(r),t=t.ma;return e===t&&n===r},I.prototype.clone=function(){if(this.ea.ga||Or(this),this.ea.va)return this.ea.count.value+=1,this;var r=pr,e=Object,n=e.create,t=Object.getPrototypeOf(this),a=this.ea;return(r=r(n.call(e,t,{ea:{value:{count:a.count,ua:a.ua,va:a.va,ga:a.ga,ha:a.ha,ja:a.ja,la:a.la}}}))).ea.count.value+=1,r.ea.ua=!1,r},I.prototype.delete=function(){this.ea.ga||Or(this),this.ea.ua&&!this.ea.va&&m("Object already scheduled for deletion"),ue(this),ce(this.ea),this.ea.va||(this.ea.ja=void 0,this.ea.ga=void 0)},I.prototype.isDeleted=function(){return!this.ea.ga},I.prototype.deleteLater=function(){return this.ea.ga||Or(this),this.ea.ua&&!this.ea.va&&m("Object already scheduled for deletion"),tr.push(this),tr.length===1&&ar&&ar(Fr),this.ea.ua=!0,this},c.getInheritedInstanceCount=function(){return Object.keys(ir).length},c.getLiveInheritedInstances=function(){var r,e=[];for(r in ir)ir.hasOwnProperty(r)&&e.push(ir[r]);return e},c.flushPendingDeletes=Fr,c.setDelayFunction=function(r){ar=r,tr.length&&ar&&ar(Fr)},j.prototype.Qa=function(r){return this.Ha&&(r=this.Ha(r)),r},j.prototype.Fa=function(r){this.oa&&this.oa(r)},j.prototype.argPackAdvance=8,j.prototype.readValueFromPointer=rr,j.prototype.deleteObject=function(r){r!==null&&r.delete()},j.prototype.fromWireType=function(r){function e(){return this.ya?hr(this.fa.pa,{ha:this.$a,ga:n,la:this,ja:r}):hr(this.fa.pa,{ha:this,ga:r})}var n=this.Qa(r);if(!n)return this.Fa(r),null;var t=De(this.fa,n);if(t!==void 0)return t.ea.count.value===0?(t.ea.ga=n,t.ea.ja=r,t.clone()):(t=t.clone(),this.Fa(r),t);if(t=this.fa.Pa(n),!(t=se[t]))return e.call(this);t=this.xa?t.Ia:t.pointerType;var a=fe(n,this.fa,t.fa);return a===null?e.call(this):this.ya?hr(t.fa.pa,{ha:t,ga:a,la:this,ja:r}):hr(t.fa.pa,{ha:t,ga:a})},he=c.UnboundTypeError=Er("UnboundTypeError"),c.count_emval_handles=function(){for(var r=0,e=5;ei.Ta).concat(a.map(i=>i.eb)),i=>{var f={};return a.forEach((u,l)=>{var s=i[l],h=u.Ra,v=u.Sa,d=i[l+a.length],o=u.cb,p=u.fb;f[u.Na]={read:g=>s.fromWireType(h(v,g)),write:(g,A)=>{var _=[];o(p,g,d.toWireType(_,A)),fr(_)}}}),[{name:e.name,fromWireType:function(u){var l,s={};for(l in f)s[l]=f[l].read(u);return t(u),s},toWireType:function(u,l){for(var s in f)if(!(s in l))throw new TypeError('Missing field: "'+s+'"');var h=n();for(s in f)f[s].write(h,l[s]);return u!==null&&u.push(t,h),h},argPackAdvance:8,readValueFromPointer:rr,ka:t}]})},A:function(r,e,n,t,a){e=b(e),n=nr(n);var i=e.indexOf("u")!=-1;i&&(a=(1n<<64n)-1n),W(r,{name:e,fromWireType:function(f){return f},toWireType:function(f,u){if(typeof u!="bigint"&&typeof u!="number")throw new TypeError('Cannot convert "'+er(u)+'" to '+this.name);if(ua)throw new TypeError('Passing a number "'+er(u)+'" from JS side to C/C++ side to an argument of type "'+e+'", which is outside the valid range ['+t+", "+a+"]!");return u},argPackAdvance:8,readValueFromPointer:oe(e,n,!i),ka:null})},R:function(r,e,n,t,a){var i=nr(n);W(r,{name:e=b(e),fromWireType:function(f){return!!f},toWireType:function(f,u){return u?t:a},argPackAdvance:8,readValueFromPointer:function(f){if(n===1)var u=S;else if(n===2)u=Y;else{if(n!==4)throw new TypeError("Unknown boolean type size: "+e);u=w}return this.fromWireType(u[f>>i])},ka:null})},f:function(r,e,n,t,a,i,f,u,l,s,h,v,d){h=b(h),i=T(a,i),u&&(u=T(f,u)),s&&(s=T(l,s)),d=T(v,d);var o=te(h);Dr(o,function(){B("Cannot construct "+h+" due to unbound types",[t])}),$([r,e,n],t?[t]:[],function(p){if(p=p[0],t)var g=p.fa,A=g.pa;else A=I.prototype;p=Wr(o,function(){if(Object.getPrototypeOf(this)!==_)throw new G("Use 'new' to construct "+h);if(R.qa===void 0)throw new G(h+" has no accessible constructor");var $e=R.qa[arguments.length];if($e===void 0)throw new G("Tried to invoke ctor of "+h+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(R.qa).toString()+") parameters instead!");return $e.apply(this,arguments)});var _=Object.create(A,{constructor:{value:p}});p.prototype=_;var R=new Me(h,p,_,d,g,i,u,s);g=new j(h,R,!0,!1,!1),A=new j(h+"*",R,!1,!1,!1);var or=new j(h+" const*",R,!1,!0,!1);return se[r]={pointerType:A,Ia:or},le(o,p),[g,A,or]})},D:function(r,e,n,t,a,i,f){var u=mr(n,t);e=b(e),i=T(a,i),$([],[r],function(l){function s(){B("Cannot call "+h+" due to unbound types",u)}var h=(l=l[0]).name+"."+e;e.startsWith("@@")&&(e=Symbol[e.substring(2)]);var v=l.fa.constructor;return v[e]===void 0?(s.ta=n-1,v[e]=s):(Sr(v,e,h),v[e].ia[n-1]=s),$([],u,function(d){return d=gr(h,[d[0],null].concat(d.slice(1)),null,i,f),v[e].ia===void 0?(d.ta=n-1,v[e]=d):v[e].ia[n-1]=d,[]}),[]})},o:function(r,e,n,t,a,i){0{B("Cannot construct "+u.name+" due to unbound types",f)},$([],f,function(s){return s.splice(1,0,null),u.fa.qa[e-1]=gr(l,s,null,a,i),[]}),[]})},b:function(r,e,n,t,a,i,f,u){var l=mr(n,t);e=b(e),i=T(a,i),$([],[r],function(s){function h(){B("Cannot call "+v+" due to unbound types",l)}var v=(s=s[0]).name+"."+e;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),u&&s.fa.ab.push(e);var d=s.fa.pa,o=d[e];return o===void 0||o.ia===void 0&&o.className!==s.name&&o.ta===n-2?(h.ta=n-2,h.className=s.name,d[e]=h):(Sr(d,e,v),d[e].ia[n-2]=h),$([],l,function(p){return p=gr(v,p,s,i,f),d[e].ia===void 0?(p.ta=n-2,d[e]=p):d[e].ia[n-2]=p,[]}),[]})},c:function(r,e,n,t,a,i,f,u,l,s){e=b(e),a=T(t,a),$([],[r],function(h){var v=(h=h[0]).name+"."+e,d={get:function(){B("Cannot access "+v+" due to unbound types",[n,f])},enumerable:!0,configurable:!0};return d.set=l?()=>{B("Cannot access "+v+" due to unbound types",[n,f])}:()=>{m(v+" is a read-only property")},Object.defineProperty(h.fa.pa,e,d),$([],l?[n,f]:[n],function(o){var p=o[0],g={get:function(){var _=ve(this,h,v+" getter");return p.fromWireType(a(i,_))},enumerable:!0};if(l){l=T(u,l);var A=o[1];g.set=function(_){var R=ve(this,h,v+" setter"),or=[];l(s,R,A.toWireType(or,_)),fr(or)}}return Object.defineProperty(h.fa.pa,e,g),[]}),[]})},Q:function(r,e){W(r,{name:e=b(e),fromWireType:function(n){var t=C(n);return Ur(n),t},toWireType:function(n,t){return k(t)},argPackAdvance:8,readValueFromPointer:rr,ka:null})},q:function(r,e,n,t){function a(){}n=nr(n),e=b(e),a.values={},W(r,{name:e,constructor:a,fromWireType:function(i){return this.constructor.values[i]},toWireType:function(i,f){return f.value},argPackAdvance:8,readValueFromPointer:Re(e,n,t),ka:null}),Dr(e,a)},e:function(r,e,n){var t=J(r,"enum");e=b(e),r=t.constructor,t=Object.create(t.constructor.prototype,{value:{value:n},constructor:{value:Wr(t.name+"_"+e,function(){})}}),r.values[n]=t,r[e]=t},z:function(r,e,n){n=nr(n),W(r,{name:e=b(e),fromWireType:function(t){return t},toWireType:function(t,a){return a},argPackAdvance:8,readValueFromPointer:Ye(e,n),ka:null})},V:function(r,e,n,t,a,i){var f=mr(e,n);r=b(r),a=T(t,a),Dr(r,function(){B("Cannot call "+r+" due to unbound types",f)},e-1),$([],f,function(u){return le(r,gr(r,[u[0],null].concat(u.slice(1)),null,a,i),e-1),[]})},r:function(r,e,n,t,a){e=b(e),a===-1&&(a=4294967295),a=nr(n);var i=u=>u;if(t===0){var f=32-8*n;i=u=>u<>>f}n=e.includes("unsigned")?function(u,l){return l>>>0}:function(u,l){return l},W(r,{name:e,fromWireType:i,toWireType:n,argPackAdvance:8,readValueFromPointer:oe(e,a,t!==0),ka:null})},l:function(r,e,n){function t(i){var f=y;return new a($r,f[1+(i>>=2)],f[i])}var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][e];W(r,{name:n=b(n),fromWireType:t,argPackAdvance:8,readValueFromPointer:t},{Wa:!0})},k:function(r,e,n,t,a,i,f,u,l,s,h,v){n=b(n),i=T(a,i),u=T(f,u),s=T(l,s),v=T(h,v),$([r],[e],function(d){return d=d[0],[new j(n,d.fa,!1,!1,!0,d,t,i,u,s,v)]})},B:function(r,e){var n=(e=b(e))==="std::string";W(r,{name:e,fromWireType:function(t){var a=y[t>>2],i=t+4;if(n)for(var f=i,u=0;u<=a;++u){var l=i+u;if(u==a||P[l]==0){if(f=f?ur(P,f,l-f):"",s===void 0)var s=f;else s+=String.fromCharCode(0),s+=f;f=l+1}}else{for(s=Array(a),u=0;u>2]=f,n&&i)Lr(a,P,l,f+1);else if(i)for(i=0;iX,u=1;else e===4&&(t=ze,a=qe,i=Ne,f=()=>y,u=2);W(r,{name:n,fromWireType:function(l){for(var s,h=y[l>>2],v=f(),d=l+4,o=0;o<=h;++o){var p=l+4+o*e;o!=h&&v[p>>u]!=0||(d=t(d,p-d),s===void 0?s=d:(s+=String.fromCharCode(0),s+=d),d=p+e)}return M(l),s},toWireType:function(l,s){typeof s!="string"&&m("Cannot pass non-string to C++ string type "+n);var h=i(s),v=Pr(4+h+e);return y[v>>2]=h>>u,a(s,v+4,h+e),l!==null&&l.push(M,v),v},argPackAdvance:8,readValueFromPointer:rr,ka:function(l){M(l)}})},u:function(r,e,n,t,a,i){cr[r]={name:b(e),Ca:T(n,t),oa:T(a,i),Ga:[]}},h:function(r,e,n,t,a,i,f,u,l,s){cr[r].Ga.push({Na:b(e),Ta:n,Ra:T(t,a),Sa:i,eb:f,cb:T(u,l),fb:s})},S:function(r,e){W(r,{Xa:!0,name:e=b(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},n:function(r,e,n){r=C(r),e=J(e,"emval::as");var t=[],a=k(t);return y[n>>2]=a,e.toWireType(t,r)},E:function(r,e){return r=C(r),(e=J(e,"emval::as")).toWireType(null,r)},X:function(r,e,n,t){r=C(r),n=ge(e,n);for(var a=Array(e),i=0;i>2]=k(i),r(e,n,i,a)},C:function(r,e,n,t){(r=br[r])(e=C(e),n=yr(n),null,t)},a:Ur,x:function(r){return r===0?k(me()):(r=yr(r),k(me()[r]))},w:function(r,e){var n=ge(r,e),t=n[0];e=t.name+"_$"+n.slice(1).map(function(f){return f.name}).join("_")+"$";var a=ye[e];if(a!==void 0)return a;var i=Array(r-1);return a=Ge((f,u,l,s)=>{for(var h=0,v=0;v>>=0))return!1;for(var n=1;4>=n;n*=2){var t=e*(1+.2/n);t=Math.min(t,r+100663296);var a=Math;t=Math.max(r,t),a=a.min.call(a,2147483648,t+(65536-t%65536)%65536);r:{try{_r.grow(a-$r.byteLength+65535>>>16),Jr();var i=1;break r}catch{}i=void 0}if(i)return!0}return!1},I:function(r,e){var n=0;return we().forEach(function(t,a){var i=e+n;for(a=y[r+4*a>>2]=i,i=0;i>0]=t.charCodeAt(i);S[a>>0]=0,n+=t.length+1}),0},J:function(r,e){var n=we();y[r>>2]=n.length;var t=0;return n.forEach(function(a){t+=a.length+1}),y[e>>2]=t,0},O:function(){return 52},N:function(){return 70},M:function(r,e,n,t){for(var a=0,i=0;i>2],u=y[e+4>>2];e+=8;for(var l=0;l>2]=a,0},H:function(r,e,n,t){return Ke(r,e,n,t)}};(function(){function r(a){c.asm=a.exports,_r=c.asm.Y,Jr(),Zr=c.asm.ca,Kr.unshift(c.asm.Z),H--,c.monitorRunDependencies&&c.monitorRunDependencies(H),H==0&&K&&(a=K,K=null,a())}function e(a){r(a.instance)}function n(a){return Fe().then(function(i){return WebAssembly.instantiate(i,t)}).then(function(i){return i}).then(a,function(i){N("failed to asynchronously prepare wasm: "+i),Q(i)})}var t={a:Qe};if(H++,c.monitorRunDependencies&&c.monitorRunDependencies(H),c.instantiateWasm)try{return c.instantiateWasm(t,r)}catch(a){N("Module.instantiateWasm callback failed with error: "+a),O(a)}(Z||typeof WebAssembly.instantiateStreaming!="function"||re()||typeof fetch!="function"?n(e):fetch(D,{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,t).then(e,function(i){return N("wasm streaming compile failed: "+i),N("falling back to ArrayBuffer instantiation"),n(e)})})).catch(O)})(),c.___wasm_call_ctors=function(){return(c.___wasm_call_ctors=c.asm.Z).apply(null,arguments)};var Tr,Pr=c._malloc=function(){return(Pr=c._malloc=c.asm._).apply(null,arguments)},M=c._free=function(){return(M=c._free=c.asm.$).apply(null,arguments)},Ce=c.___getTypeName=function(){return(Ce=c.___getTypeName=c.asm.aa).apply(null,arguments)};function _e(){function r(){if(!Tr&&(Tr=!0,c.calledRun=!0,!qr)){if(kr(Kr),z(c),c.onRuntimeInitialized&&c.onRuntimeInitialized(),c.postRun)for(typeof c.postRun=="function"&&(c.postRun=[c.postRun]);c.postRun.length;){var e=c.postRun.shift();Qr.unshift(e)}kr(Qr)}}if(!(0import("./GroupLayer-d83741dd.js"),["assets/GroupLayer-d83741dd.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/lazyLayerLoader-8b31b2e1.js"])).default({title:e.parsedUrl.title});return N(s,e,a),s}function S(r,l){return r?r.find(e=>e.id===l):null}function N(r,l,e){function a(s,t){const u={...e,layerId:s,sublayerTitleMode:"service-name"};return t!=null&&(u.sourceJSON=t),new l.Constructor(u)}l.sublayerIds.forEach(s=>{const t=a(s,S(l.sublayerInfos,s));r.add(t)}),l.tableIds.forEach(s=>{const t=a(s,S(l.tableInfos,s));r.tables.add(t)})}async function J(r,l){var m,f,p,I;let e=h(r);if(e==null&&(e=await U(r,l)),e==null)throw new O("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:r});const{serverType:a,sublayer:s}=e;let t;const u={FeatureServer:"FeatureLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer"};switch(a){case"MapServer":s!=null?t="FeatureLayer":t=await x(r,l)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const n=await d(r,{customParameters:l}),{tileInfo:c,cacheType:y}=n;t=c?((m=c==null?void 0:c.format)==null?void 0:m.toUpperCase())!=="LERC"||y&&y.toLowerCase()!=="elevation"?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const n=await d(e.url.path,{customParameters:l});if(t="SceneLayer",n){const c=n==null?void 0:n.layers;if((n==null?void 0:n.layerType)==="Voxel")t="VoxelLayer";else if(c!=null&&c.length){const y=(f=c[0])==null?void 0:f.layerType;y!=null&&b[y]!=null&&(t=b[y])}}break}default:t=u[a]}const o=a==="FeatureServer",i={parsedUrl:e,Constructor:null,layerOrTableId:o?s:void 0,sublayerIds:null,tableIds:null};if(F[t]&&s==null){const n=await V(r,a,l);o&&(i.sublayerInfos=n.layerInfos,i.tableInfos=n.tableInfos),n.layerIds.length+n.tableIds.length!==1?(i.sublayerIds=n.layerIds,i.tableIds=n.tableIds):o&&(i.layerOrTableId=n.layerIds[0]??n.tableIds[0],i.sourceJSON=((p=n.layerInfos)==null?void 0:p[0])??((I=n.tableInfos)==null?void 0:I[0]))}return i.Constructor=await _(t),i}async function U(r,l){var o;const e=await d(r,{customParameters:l});let a=null,s=null;const t=e.type;if(t==="Feature Layer"||t==="Table"?(a="FeatureServer",s=e.id??null):t==="indexedVector"?a="VectorTileServer":e.hasOwnProperty("mapName")?a="MapServer":e.hasOwnProperty("bandCount")&&e.hasOwnProperty("pixelSizeX")?a="ImageServer":e.hasOwnProperty("maxRecordCount")&&e.hasOwnProperty("allowGeometryUpdates")?a="FeatureServer":e.hasOwnProperty("streamUrls")?a="StreamServer":w(e)?(a="SceneServer",s=e.id):e.hasOwnProperty("layers")&&w((o=e.layers)==null?void 0:o[0])&&(a="SceneServer"),!a)return null;const u=s!=null?L(r):null;return{title:u!=null&&e.name||P(r),serverType:a,sublayer:s,url:{path:u!=null?u.serviceUrl:T(r).path}}}function w(r){return r!=null&&r.hasOwnProperty("store")&&r.hasOwnProperty("id")&&typeof r.id=="number"}async function V(r,l,e){let a,s=!1;if(l==="FeatureServer"){const o=await g(r,{customParameters:e});s=!!o.layersJSON,a=o.layersJSON||o.serviceJSON}else a=await d(r,{customParameters:e});const t=a==null?void 0:a.layers,u=a==null?void 0:a.tables;return{layerIds:(t==null?void 0:t.map(o=>o.id).reverse())||[],tableIds:(u==null?void 0:u.map(o=>o.id).reverse())||[],layerInfos:s?t:[],tableInfos:s?u:[]}}async function _(r){return(0,C[r])()}async function x(r,l){return(await d(r,{customParameters:l})).tileInfo}export{R as fromUrl}; diff --git a/assets/basis_transcoder-bff818ce.js b/assets/basis_transcoder-bff818ce.js new file mode 100644 index 0000000..9ed6905 --- /dev/null +++ b/assets/basis_transcoder-bff818ce.js @@ -0,0 +1,2 @@ +import{bU as Sn,eM as ze}from"./index-080e108a.js";function On(k,Y){for(var H=0;Hn[C]})}}}return Object.freeze(Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}))}var Ar,se,Wr,_e={exports:{}};_e.exports,Ar=_e,_e.exports,se=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(se=se||__filename),Wr=function(k){var Y,H,n=(k=k||{})!==void 0?k:{};n.ready=new Promise(function(e,r){Y=e,H=r});var C,E={};for(C in n)n.hasOwnProperty(C)&&(E[C]=n[C]);var le=!1,I=!1,Pe=!1,qe=!1;le=typeof window=="object",I=typeof importScripts=="function",Pe=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",qe=!le&&!Pe&&!I;var ce,Z,Ae,We,T="";function Sr(e){return n.locateFile?n.locateFile(e,T):T+e}Pe?(T=I?require("path").dirname(T)+"/":__dirname+"/",ce=function(e,r){return Ae||(Ae=require("fs")),We||(We=require("path")),e=We.normalize(e),Ae.readFileSync(e,r?null:"utf8")},Z=function(e){var r=ce(e,!0);return r.buffer||(r=new Uint8Array(r)),Ee(r.buffer),r},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof Wn))throw e}),process.on("unhandledRejection",B),n.inspect=function(){return"[Emscripten Module object]"}):qe?(typeof read<"u"&&(ce=function(e){return read(e)}),Z=function(e){var r;return typeof readbuffer=="function"?new Uint8Array(readbuffer(e)):(Ee(typeof(r=read(e,"binary"))=="object"),r)},typeof scriptArgs<"u"&&scriptArgs,typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)):(le||I)&&(I?T=self.location.href:document.currentScript&&(T=document.currentScript.src),se&&(T=se),T=T.indexOf("blob:")!==0?T.substr(0,T.lastIndexOf("/")+1):"",ce=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},I&&(Z=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}));var K,Q,Or=n.print||console.log.bind(console),z=n.printErr||console.warn.bind(console);for(C in E)E.hasOwnProperty(C)&&(n[C]=E[C]);E=null,n.arguments&&n.arguments,n.thisProgram&&n.thisProgram,n.quit&&n.quit,n.wasmBinary&&(K=n.wasmBinary),n.noExitRuntime&&n.noExitRuntime,typeof WebAssembly!="object"&&B("no native wasm support detected");var jr=new WebAssembly.Table({initial:157,maximum:157,element:"anyfunc"}),Be=!1;function Ee(e,r){e||B("Assertion failed: "+r)}var Ne=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function Ge(e,r,t){for(var i=r+t,o=r;e[o]&&!(o>=i);)++o;if(o-r>16&&e.subarray&&Ne)return Ne.decode(e.subarray(r,o));for(var a="";r>10,56320|1023&c)}}else a+=String.fromCharCode((31&s)<<6|u)}else a+=String.fromCharCode(s)}return a}function Le(e,r){return e?Ge(b,e,r):""}function kr(e,r,t,i){if(!(i>0))return 0;for(var o=t,a=t+i-1,s=0;s=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&e.charCodeAt(++s)),u<=127){if(t>=a)break;r[t++]=u}else if(u<=2047){if(t+1>=a)break;r[t++]=192|u>>6,r[t++]=128|63&u}else if(u<=65535){if(t+2>=a)break;r[t++]=224|u>>12,r[t++]=128|u>>6&63,r[t++]=128|63&u}else{if(t+3>=a)break;r[t++]=240|u>>18,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|63&u}}return r[t]=0,t-o}function Fr(e,r,t){return kr(e,b,r,t)}function Rr(e){for(var r=0,t=0;t=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++t)),i<=127?++r:r+=i<=2047?2:i<=65535?3:4}return r}var Xe=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function xr(e,r){for(var t=e,i=t>>1,o=i+r/2;!(i>=o)&&ee[i];)++i;if((t=i<<1)-e>32&&Xe)return Xe.decode(b.subarray(e,t));for(var a=0,s="";;){var u=U[e+2*a>>1];if(u==0||a==r/2)return s;++a,s+=String.fromCharCode(u)}}function Dr(e,r,t){if(t===void 0&&(t=2147483647),t<2)return 0;for(var i=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a>1]=s,r+=2}return U[r>>1]=0,r-i}function Ir(e){return 2*e.length}function Ur(e,r){for(var t=0,i="";!(t>=r/4);){var o=g[e+4*t>>2];if(o==0)break;if(++t,o>=65536){var a=o-65536;i+=String.fromCharCode(55296|a>>10,56320|1023&a)}else i+=String.fromCharCode(o)}return i}function Mr(e,r,t){if(t===void 0&&(t=2147483647),t<4)return 0;for(var i=r,o=i+t-4,a=0;a=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),g[r>>2]=s,(r+=4)+4>o)break}return g[r>>2]=0,r-i}function Vr(e){for(var r=0,t=0;t=55296&&i<=57343&&++t,r+=4}return r}var q,fe,b,U,ee,g,P,Je,Ye,Ze=65536;function Hr(e,r){return e%r>0&&(e+=r-e%r),e}function Ke(e){q=e,n.HEAP8=fe=new Int8Array(e),n.HEAP16=U=new Int16Array(e),n.HEAP32=g=new Int32Array(e),n.HEAPU8=b=new Uint8Array(e),n.HEAPU16=ee=new Uint16Array(e),n.HEAPU32=P=new Uint32Array(e),n.HEAPF32=Je=new Float32Array(e),n.HEAPF64=Ye=new Float64Array(e)}var zr=5565536,qr=322496,Qe=n.INITIAL_MEMORY||16777216;function pe(e){for(;e.length>0;){var r=e.shift();if(typeof r!="function"){var t=r.func;typeof t=="number"?r.arg===void 0?n.dynCall_v(t):n.dynCall_vi(t,r.arg):t(r.arg===void 0?null:r.arg)}else r(n)}}(Q=n.wasmMemory?n.wasmMemory:new WebAssembly.Memory({initial:Qe/Ze,maximum:2147483648/Ze}))&&(q=Q.buffer),Qe=q.byteLength,Ke(q),g[qr>>2]=zr;var er=[],rr=[],Br=[],tr=[];function Nr(){if(n.preRun)for(typeof n.preRun=="function"&&(n.preRun=[n.preRun]);n.preRun.length;)Jr(n.preRun.shift());pe(er)}function Gr(){pe(rr)}function Lr(){pe(Br)}function Xr(){if(n.postRun)for(typeof n.postRun=="function"&&(n.postRun=[n.postRun]);n.postRun.length;)Yr(n.postRun.shift());pe(tr)}function Jr(e){er.unshift(e)}function Yr(e){tr.unshift(e)}var Zr=Math.ceil,Kr=Math.floor,M=0,re=null;function Qr(e){M++,n.monitorRunDependencies&&n.monitorRunDependencies(M)}function et(e){if(M--,n.monitorRunDependencies&&n.monitorRunDependencies(M),M==0&&re){var r=re;re=null,r()}}function B(e){n.onAbort&&n.onAbort(e),z(e+=""),Be=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var r=new WebAssembly.RuntimeError(e);throw H(r),r}function nr(e,r){return String.prototype.startsWith?e.startsWith(r):e.indexOf(r)===0}n.preloadedImages={},n.preloadedAudios={};var rt="data:application/octet-stream;base64,";function ir(e){return nr(e,rt)}var tt="file://";function or(e){return nr(e,tt)}var A="basis_transcoder.wasm";function ar(){try{if(K)return new Uint8Array(K);if(Z)return Z(A);throw"both async and sync fetching of the wasm failed"}catch(e){B(e)}}function nt(){return K||!le&&!I||typeof fetch!="function"||or(A)?new Promise(function(e,r){e(ar())}):fetch(A,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+A+"'";return e.arrayBuffer()}).catch(function(){return ar()})}function it(){var e={a:An};function r(a,s){var u=a.exports;n.asm=u,et()}function t(a){r(a.instance)}function i(a){return nt().then(function(s){return WebAssembly.instantiate(s,e)}).then(a,function(s){z("failed to asynchronously prepare wasm: "+s),B(s)})}function o(){if(K||typeof WebAssembly.instantiateStreaming!="function"||ir(A)||or(A)||typeof fetch!="function")return i(t);fetch(A,{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,e).then(t,function(s){return z("wasm streaming compile failed: "+s),z("falling back to ArrayBuffer instantiation"),i(t)})})}if(Qr(),n.instantiateWasm)try{return n.instantiateWasm(e,r)}catch(a){return z("Module.instantiateWasm callback failed with error: "+a),!1}return o(),{}}ir(A)||(A=Sr(A)),rr.push({func:function(){Cr()}});var de={};function ye(e){for(;e.length;){var r=e.pop();e.pop()(r)}}function te(e){return this.fromWireType(P[e>>2])}var N={},V={},me={},ot=48,at=57;function ur(e){if(e===void 0)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=ot&&r<=at?"_"+e:e}function Se(e,r){return e=ur(e),function(){return r.apply(this,arguments)}}function Oe(e,r){var t=Se(r,function(i){this.name=r,this.message=i;var o=new Error(i).stack;o!==void 0&&(this.stack=this.toString()+` +`+o.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},t}var sr=void 0;function he(e){throw new sr(e)}function F(e,r,t){function i(u){var l=t(u);l.length!==e.length&&he("Mismatched type converter count");for(var c=0;c>a])},destructorFunction:null})}function ct(e){if(!(this instanceof R)||!(e instanceof R))return!1;for(var r=this.$$.ptrType.registeredClass,t=this.$$.ptr,i=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;i.baseClass;)o=i.upcast(o),i=i.baseClass;return r===i&&t===o}function ft(e){return{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}}function je(e){function r(t){return t.$$.ptrType.registeredClass.name}p(r(e)+" instance already deleted")}var ke=!1;function cr(e){}function pt(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}function fr(e){e.count.value-=1,e.count.value===0&&pt(e)}function ne(e){return typeof FinalizationGroup>"u"?(ne=function(r){return r},e):(ke=new FinalizationGroup(function(r){for(var t=r.next();!t.done;t=r.next()){var i=t.value;i.ptr?fr(i):console.warn("object already deleted: "+i.ptr)}}),ne=function(r){return ke.register(r,r.$$,r.$$),r},cr=function(r){ke.unregister(r.$$)},ne(e))}function dt(){if(this.$$.ptr||je(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=ne(Object.create(Object.getPrototypeOf(this),{$$:{value:ft(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function yt(){this.$$.ptr||je(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&p("Object already scheduled for deletion"),cr(this),fr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function mt(){return!this.$$.ptr}var ie=void 0,oe=[];function Fe(){for(;oe.length;){var e=oe.pop();e.$$.deleteScheduled=!1,e.delete()}}function ht(){return this.$$.ptr||je(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&p("Object already scheduled for deletion"),oe.push(this),oe.length===1&&ie&&ie(Fe),this.$$.deleteScheduled=!0,this}function vt(){R.prototype.isAliasOf=ct,R.prototype.clone=dt,R.prototype.delete=yt,R.prototype.isDeleted=mt,R.prototype.deleteLater=ht}function R(){}var pr={};function dr(e,r,t){if(e[r].overloadTable===void 0){var i=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||p("Function '"+t+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[r].overloadTable+")!"),e[r].overloadTable[arguments.length].apply(this,arguments)},e[r].overloadTable=[],e[r].overloadTable[i.argCount]=i}}function Re(e,r,t){n.hasOwnProperty(e)?((t===void 0||n[e].overloadTable!==void 0&&n[e].overloadTable[t]!==void 0)&&p("Cannot register public name '"+e+"' twice"),dr(n,e,e),n.hasOwnProperty(t)&&p("Cannot register multiple overloads of a function with the same number of arguments ("+t+")!"),n[e].overloadTable[t]=r):(n[e]=r,t!==void 0&&(n[e].numArguments=t))}function gt(e,r,t,i,o,a,s,u){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=i,this.baseClass=o,this.getActualType=a,this.upcast=s,this.downcast=u,this.pureVirtualFunctions=[]}function xe(e,r,t){for(;r!==t;)r.upcast||p("Expected null or instance of "+t.name+", got an instance of "+r.name),e=r.upcast(e),r=r.baseClass;return e}function bt(e,r){if(r===null)return this.isReference&&p("null is not a valid "+this.name),0;r.$$||p('Cannot pass "'+L(r)+'" as a '+this.name),r.$$.ptr||p("Cannot pass deleted object as a pointer of type "+this.name);var t=r.$$.ptrType.registeredClass;return xe(r.$$.ptr,t,this.registeredClass)}function $t(e,r){var t;if(r===null)return this.isReference&&p("null is not a valid "+this.name),this.isSmartPointer?(t=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,t),t):0;r.$$||p('Cannot pass "'+L(r)+'" as a '+this.name),r.$$.ptr||p("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&r.$$.ptrType.isConst&&p("Cannot convert argument of type "+(r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name)+" to parameter type "+this.name);var i=r.$$.ptrType.registeredClass;if(t=xe(r.$$.ptr,i,this.registeredClass),this.isSmartPointer)switch(r.$$.smartPtr===void 0&&p("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:p("Cannot convert argument of type "+(r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var o=r.clone();t=this.rawShare(t,O(function(){o.delete()})),e!==null&&e.push(this.rawDestructor,t)}break;default:p("Unsupporting sharing policy")}return t}function Ct(e,r){if(r===null)return this.isReference&&p("null is not a valid "+this.name),0;r.$$||p('Cannot pass "'+L(r)+'" as a '+this.name),r.$$.ptr||p("Cannot pass deleted object as a pointer of type "+this.name),r.$$.ptrType.isConst&&p("Cannot convert argument of type "+r.$$.ptrType.name+" to parameter type "+this.name);var t=r.$$.ptrType.registeredClass;return xe(r.$$.ptr,t,this.registeredClass)}function wt(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function Tt(e){this.rawDestructor&&this.rawDestructor(e)}function _t(e){e!==null&&e.delete()}function yr(e,r,t){if(r===t)return e;if(t.baseClass===void 0)return null;var i=yr(e,r,t.baseClass);return i===null?null:t.downcast(i)}function Pt(){return Object.keys(ae).length}function At(){var e=[];for(var r in ae)ae.hasOwnProperty(r)&&e.push(ae[r]);return e}function Wt(e){ie=e,oe.length&&ie&&ie(Fe)}function Et(){n.getInheritedInstanceCount=Pt,n.getLiveInheritedInstances=At,n.flushPendingDeletes=Fe,n.setDelayFunction=Wt}var ae={};function St(e,r){for(r===void 0&&p("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r}function Ot(e,r){return r=St(e,r),ae[r]}function ge(e,r){return r.ptrType&&r.ptr||he("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&he("Both smartPtrType and smartPtr must be specified"),r.count={value:1},ne(Object.create(e,{$$:{value:r}}))}function jt(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=Ot(this.registeredClass,r);if(t!==void 0){if(t.$$.count.value===0)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var i=t.clone();return this.destructor(e),i}function o(){return this.isSmartPointer?ge(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):ge(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,s=this.registeredClass.getActualType(r),u=pr[s];if(!u)return o.call(this);a=this.isConst?u.constPointerType:u.pointerType;var l=yr(r,this.registeredClass,a.registeredClass);return l===null?o.call(this):this.isSmartPointer?ge(a.registeredClass.instancePrototype,{ptrType:a,ptr:l,smartPtrType:this,smartPtr:e}):ge(a.registeredClass.instancePrototype,{ptrType:a,ptr:l})}function kt(){S.prototype.getPointee=wt,S.prototype.destructor=Tt,S.prototype.argPackAdvance=8,S.prototype.readValueFromPointer=te,S.prototype.deleteObject=_t,S.prototype.fromWireType=jt}function S(e,r,t,i,o,a,s,u,l,c,f){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=i,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=s,this.rawGetPointee=u,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=f,o||r.baseClass!==void 0?this.toWireType=$t:i?(this.toWireType=bt,this.destructorFunction=null):(this.toWireType=Ct,this.destructorFunction=null)}function mr(e,r,t){n.hasOwnProperty(e)||he("Replacing nonexistant public symbol"),n[e].overloadTable!==void 0&&t!==void 0?n[e].overloadTable[t]=r:(n[e]=r,n[e].argCount=t)}function _(e,r){function t(o){var a=[r];return function(){a.length=arguments.length+1;for(var s=0;s>2)+i]);return t}function Rt(e,r,t,i,o,a){Ee(r>0);var s=De(r,t);o=_(i,o);var u=[a],l=[];F([],[e],function(c){var f="constructor "+(c=c[0]).name;if(c.registeredClass.constructor_body===void 0&&(c.registeredClass.constructor_body=[]),c.registeredClass.constructor_body[r-1]!==void 0)throw new G("Cannot register multiple constructors with identical number of parameters ("+(r-1)+") for class '"+c.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return c.registeredClass.constructor_body[r-1]=function(){be("Cannot construct "+c.name+" due to unbound types",s)},F([],s,function(m){return c.registeredClass.constructor_body[r-1]=function(){arguments.length!==r-1&&p(f+" called with "+arguments.length+" arguments, expected "+(r-1)),l.length=0,u.length=r;for(var d=1;d4&&--w[e].refcount==0&&(w[e]=void 0,Ie.push(e))}function It(){for(var e=0,r=5;r>1])};case 2:return function(i){var o=t?g:P;return this.fromWireType(o[i>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function zt(e,r,t,i){var o=ve(t);function a(){}r=v(r),a.values={},W(e,{name:r,constructor:a,fromWireType:function(s){return this.constructor.values[s]},toWireType:function(s,u){return u.value},argPackAdvance:8,readValueFromPointer:Ht(r,o,i),destructorFunction:null}),Re(r,a)}function $e(e,r){var t=V[e];return t===void 0&&p(r+" has unknown type "+vr(e)),t}function qt(e,r,t){var i=$e(e,"enum");r=v(r);var o=i.constructor,a=Object.create(i.constructor.prototype,{value:{value:t},constructor:{value:Se(i.name+"_"+r,function(){})}});o.values[t]=a,o[r]=a}function L(e){if(e===null)return"null";var r=typeof e;return r==="object"||r==="array"||r==="function"?e.toString():""+e}function Bt(e,r){switch(r){case 2:return function(t){return this.fromWireType(Je[t>>2])};case 3:return function(t){return this.fromWireType(Ye[t>>3])};default:throw new TypeError("Unknown float type: "+e)}}function Nt(e,r,t){var i=ve(t);W(e,{name:r=v(r),fromWireType:function(o){return o},toWireType:function(o,a){if(typeof a!="number"&&typeof a!="boolean")throw new TypeError('Cannot convert "'+L(a)+'" to '+this.name);return a},argPackAdvance:8,readValueFromPointer:Bt(r,i),destructorFunction:null})}function Gt(e,r,t,i,o,a){var s=De(r,t);e=v(e),o=_(i,o),Re(e,function(){be("Cannot call "+e+" due to unbound types",s)},r-1),F([],s,function(u){var l=[u[0],null].concat(u.slice(1));return mr(e,gr(e,l,null,o,a),r-1),[]})}function Lt(e,r,t){switch(r){case 0:return t?function(i){return fe[i]}:function(i){return b[i]};case 1:return t?function(i){return U[i>>1]}:function(i){return ee[i>>1]};case 2:return t?function(i){return g[i>>2]}:function(i){return P[i>>2]};default:throw new TypeError("Unknown integer type: "+e)}}function Xt(e,r,t,i,o){r=v(r),o===-1&&(o=4294967295);var a=ve(t),s=function(c){return c};if(i===0){var u=32-8*t;s=function(c){return c<>>u}}var l=r.indexOf("unsigned")!=-1;W(e,{name:r,fromWireType:s,toWireType:function(c,f){if(typeof f!="number"&&typeof f!="boolean")throw new TypeError('Cannot convert "'+L(f)+'" to '+this.name);if(fo)throw new TypeError('Passing a number "'+L(f)+'" from JS side to C/C++ side to an argument of type "'+r+'", which is outside the valid range ['+i+", "+o+"]!");return l?f>>>0:0|f},argPackAdvance:8,readValueFromPointer:Lt(r,a,i!==0),destructorFunction:null})}function Jt(e,r,t){var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function o(a){var s=P,u=s[a>>=2],l=s[a+1];return new i(q,l,u)}W(e,{name:t=v(t),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}function Yt(e,r){var t=(r=v(r))==="std::string";W(e,{name:r,fromWireType:function(i){var o,a=P[i>>2];if(t)for(var s=i+4,u=0;u<=a;++u){var l=i+4+u;if(u==a||b[l]==0){var c=Le(s,l-s);o===void 0?o=c:(o+=String.fromCharCode(0),o+=c),s=l+1}}else{var f=new Array(a);for(u=0;u>2]=s,t&&a)Fr(o,u+4,s+1);else if(a)for(var l=0;l255&&(j(u),p("String has UTF-16 code units that do not fit in 8 bits")),b[u+4+l]=c}else for(l=0;l>2],m=a(),d=l+4,h=0;h<=f;++h){var $=l+4+h*r;if(h==f||m[$>>u]==0){var y=i(d,$-d);c===void 0?c=y:(c+=String.fromCharCode(0),c+=y),d=$+r}}return j(l),c},toWireType:function(l,c){typeof c!="string"&&p("Cannot pass non-string to C++ string type "+t);var f=s(c),m=Ve(4+f+r);return P[m>>2]=f>>u,o(c,m+4,f+r),l!==null&&l.push(j,m),m},argPackAdvance:8,readValueFromPointer:te,destructorFunction:function(l){j(l)}})}function Kt(e,r,t,i,o,a){de[e]={name:v(r),rawConstructor:_(t,i),rawDestructor:_(o,a),fields:[]}}function Qt(e,r,t,i,o,a,s,u,l,c){de[e].fields.push({fieldName:v(r),getterReturnType:t,getter:_(i,o),getterContext:a,setterArgumentType:s,setter:_(u,l),setterContext:c})}function en(e,r){W(e,{isVoid:!0,name:r=v(r),argPackAdvance:0,fromWireType:function(){},toWireType:function(t,i){}})}function ue(e){return e||p("Cannot use deleted val. handle = "+e),w[e].value}function rn(e,r,t){e=ue(e),r=$e(r,"emval::as");var i=[],o=O(i);return g[t>>2]=o,r.toWireType(i,e)}var tn={};function Ce(e){var r=tn[e];return r===void 0?v(e):r}var Me=[];function nn(e,r,t,i){(e=Me[e])(r=ue(r),t=Ce(t),null,i)}function br(){if(typeof globalThis=="object")return globalThis;function e(r){r.$$$embind_global$$$=r;var t=typeof $$$embind_global$$$=="object"&&r.$$$embind_global$$$===r;return t||delete r.$$$embind_global$$$,t}if(typeof $$$embind_global$$$=="object"||(typeof ze=="object"&&e(ze)?$$$embind_global$$$=ze:typeof self=="object"&&e(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")}function on(e){return e===0?O(br()):(e=Ce(e),O(br()[e]))}function an(e){var r=Me.length;return Me.push(e),r}function un(e,r){for(var t=new Array(e),i=0;i>2)+i],"parameter "+i);return t}function sn(e,r){var t=un(e,r),i=t[0],o=new Array(e-1);return an(function(a,s,u,l){for(var c=0,f=0;f4&&(w[e].refcount+=1)}function pn(e){var r=new Array(e+1);return function(t,i,o){r[0]=t;for(var a=0;a>2)+a],"parameter "+a);r[a+1]=s.readValueFromPointer(o),o+=s.argPackAdvance}return O(new(t.bind.apply(t,r)))}}var $r={};function dn(e,r,t,i){e=ue(e);var o=$r[r];return o||(o=pn(r),$r[r]=o),o(e,t,i)}function yn(e){return O(Ce(e))}function mn(e){ye(w[e].value),Ue(e)}function hn(){B()}function vn(e,r,t){b.copyWithin(e,r,r+t)}function gn(){return b.length}function bn(e){try{return Q.grow(e-q.byteLength+65535>>>16),Ke(Q.buffer),1}catch{}}function $n(e){e>>>=0;var r=gn(),t=65536,i=2147483648;if(e>i)return!1;for(var o=16777216,a=1;a<=4;a*=2){var s=r*(1+.2/a);if(s=Math.min(s,e+100663296),bn(Math.min(i,Hr(Math.max(o,e,s),t))))return!0}return!1}var we={mappings:{},buffers:[null,[],[]],printChar:function(e,r){var t=we.buffers[e];r===0||r===10?((e===1?Or:z)(Ge(t,0)),t.length=0):t.push(r)},varargs:void 0,get:function(){return we.varargs+=4,g[we.varargs-4>>2]},getStr:function(e){return Le(e)},get64:function(e,r){return e}};function Cn(e){return 0}function wn(e,r,t,i,o){}function Tn(e,r,t,i){for(var o=0,a=0;a>2],u=g[r+(8*a+4)>>2],l=0;l>2]=o,0}function _n(e){return(e=+e)>=0?+Kr(e+.5):+Zr(e-.5)}function Pn(e){}sr=n.InternalError=Oe(Error,"InternalError"),st(),G=n.BindingError=Oe(Error,"BindingError"),vt(),kt(),Et(),hr=n.UnboundTypeError=Oe(Error,"UnboundTypeError"),Mt();var An={u:ut,J:lt,y:Ft,x:Rt,d:xt,k:Dt,I:Vt,n:zt,a:qt,B:Nt,i:Gt,j:Xt,h:Jt,C:Yt,w:Zt,v:Kt,c:Qt,K:en,m:rn,s:nn,b:Ue,z:on,t:sn,r:ln,e:cn,g:fn,q:dn,f:yn,l:mn,p:hn,F:vn,G:$n,H:Cn,D:wn,A:Tn,memory:Q,o:_n,E:Pn,table:jr};it();var Te,Cr=n.___wasm_call_ctors=function(){return(Cr=n.___wasm_call_ctors=n.asm.L).apply(null,arguments)},Ve=n._malloc=function(){return(Ve=n._malloc=n.asm.M).apply(null,arguments)},j=n._free=function(){return(j=n._free=n.asm.N).apply(null,arguments)},wr=n.___getTypeName=function(){return(wr=n.___getTypeName=n.asm.O).apply(null,arguments)};function Wn(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function He(e){function r(){Te||(Te=!0,n.calledRun=!0,Be||(Gr(),Lr(),Y(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),Xr()))}M>0||(Nr(),M>0||(n.setStatus?(n.setStatus("Running..."),setTimeout(function(){setTimeout(function(){n.setStatus("")},1),r()},1)):r()))}if(n.___embind_register_native_and_builtin_types=function(){return(n.___embind_register_native_and_builtin_types=n.asm.P).apply(null,arguments)},n.dynCall_viii=function(){return(n.dynCall_viii=n.asm.Q).apply(null,arguments)},n.dynCall_vi=function(){return(n.dynCall_vi=n.asm.R).apply(null,arguments)},n.dynCall_v=function(){return(n.dynCall_v=n.asm.S).apply(null,arguments)},n.dynCall_i=function(){return(n.dynCall_i=n.asm.T).apply(null,arguments)},n.dynCall_iii=function(){return(n.dynCall_iii=n.asm.U).apply(null,arguments)},n.dynCall_ii=function(){return(n.dynCall_ii=n.asm.V).apply(null,arguments)},n.dynCall_vii=function(){return(n.dynCall_vii=n.asm.W).apply(null,arguments)},n.dynCall_iiii=function(){return(n.dynCall_iiii=n.asm.X).apply(null,arguments)},n.dynCall_iiiii=function(){return(n.dynCall_iiiii=n.asm.Y).apply(null,arguments)},n.dynCall_iiiiii=function(){return(n.dynCall_iiiiii=n.asm.Z).apply(null,arguments)},n.dynCall_iiiiiiii=function(){return(n.dynCall_iiiiiiii=n.asm._).apply(null,arguments)},n.dynCall_iiiiiiiii=function(){return(n.dynCall_iiiiiiiii=n.asm.$).apply(null,arguments)},n.dynCall_viiii=function(){return(n.dynCall_viiii=n.asm.aa).apply(null,arguments)},n.dynCall_iiiiiii=function(){return(n.dynCall_iiiiiii=n.asm.ba).apply(null,arguments)},n.dynCall_iiiiiiiiiiiiiiiiiiii=function(){return(n.dynCall_iiiiiiiiiiiiiiiiiiii=n.asm.ca).apply(null,arguments)},n.dynCall_iiiiiiiiiiiiiiiiiiiii=function(){return(n.dynCall_iiiiiiiiiiiiiiiiiiiii=n.asm.da).apply(null,arguments)},n.dynCall_iiiiiiiiiiiiiiiiiii=function(){return(n.dynCall_iiiiiiiiiiiiiiiiiii=n.asm.ea).apply(null,arguments)},n.dynCall_viiiii=function(){return(n.dynCall_viiiii=n.asm.fa).apply(null,arguments)},n.dynCall_iiiiiiiiii=function(){return(n.dynCall_iiiiiiiiii=n.asm.ga).apply(null,arguments)},n.dynCall_iiiiiiiiiii=function(){return(n.dynCall_iiiiiiiiiii=n.asm.ha).apply(null,arguments)},n.dynCall_jiji=function(){return(n.dynCall_jiji=n.asm.ia).apply(null,arguments)},n.dynCall_viiiiii=function(){return(n.dynCall_viiiiii=n.asm.ja).apply(null,arguments)},re=function e(){Te||He(),Te||(re=e)},n.run=He,n.preInit)for(typeof n.preInit=="function"&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return He(),k.ready},Ar.exports=Wr;var Er=_e.exports;const kn=On({__proto__:null,default:Sn(Er)},[Er]);export{kn as b}; diff --git a/assets/bg_BG2-08c99e6c.js b/assets/bg_BG2-08c99e6c.js new file mode 100644 index 0000000..2b2d85f --- /dev/null +++ b/assets/bg_BG2-08c99e6c.js @@ -0,0 +1 @@ +const d={firstDayOfWeek:1,_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"януари",February:"февруари",March:"март",April:"април",May:"май",June:"юни",July:"юли",August:"август",September:"септември",October:"октомври",November:"ноември",December:"декември",Jan:"януари",Feb:"февруари",Mar:"март",Apr:"април","May (short)":"май",Jun:"юни",Jul:"юли",Aug:"август",Sep:"септември",Oct:"октомври",Nov:"ноември",Dec:"декември",Sunday:"неделя",Monday:"понеделник",Tuesday:"вторник",Wednesday:"сряда",Thursday:"четвъртък",Friday:"петък",Saturday:"събота",Sun:"нд",Mon:"пн",Tues:"вт",Wed:"ср",Thu:"чт",Fri:"пт",Sat:"сб",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Отдалечаване",Play:"",Stop:"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"От %1 до %2","From %1":"От %1","To %1":"До %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:""};export{d as default}; diff --git a/assets/bs_BA2-f2917445.js b/assets/bs_BA2-f2917445.js new file mode 100644 index 0000000..337a06a --- /dev/null +++ b/assets/bs_BA2-f2917445.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n. e.",_era_bc:"p. n. e.",A:"prijepodne",P:"popodne",AM:"AM",PM:"PM","A.M.":"prijepodne","P.M.":"popodne",January:"januar",February:"februar",March:"mart",April:"april",May:"maj",June:"juni",July:"juli",August:"august",September:"septembar",October:"oktobar",November:"novembar",December:"decembar",Jan:"jan",Feb:"feb",Mar:"mar",Apr:"apr","May(short)":"maj",Jun:"jun",Jul:"jul",Aug:"aug",Sep:"sep",Oct:"okt",Nov:"nov",Dec:"dec",Sunday:"nedjelja",Monday:"ponedjeljak",Tuesday:"utorak",Wednesday:"srijeda",Thursday:"četvrtak",Friday:"petak",Saturday:"subota",Sun:"ned",Mon:"pon",Tue:"uto",Wed:"sri",Thu:"čet",Fri:"pet",Sat:"sub",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Povećaj",Play:"Reproduciraj",Stop:"Zaustavi",Legend:"Legenda","Press ENTER to toggle":"",Loading:"Učitavanje",Home:"Početna",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Ispis",Image:"Slika",Data:"Podaci",Print:"Ispis","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{a as default}; diff --git a/assets/ca_ES2-f5f347b0.js b/assets/ca_ES2-f5f347b0.js new file mode 100644 index 0000000..36fafe3 --- /dev/null +++ b/assets/ca_ES2-f5f347b0.js @@ -0,0 +1 @@ +const _={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"dC",_era_bc:"aC",A:"a. m.",P:"p. m.",AM:"a. m.",PM:"p. m.","A.M.":"a. m.","P.M.":"p. m.",January:"de gener",February:"de febrer",March:"de març",April:"d’abril",May:"de maig",June:"de juny",July:"de juliol",August:"d’agost",September:"de setembre",October:"d’octubre",November:"de novembre",December:"de desembre",Jan:"de gen.",Feb:"de febr.",Mar:"de març",Apr:"d’abr.","May(short)":"de maig",Jun:"de juny",Jul:"de jul.",Aug:"d’ag.",Sep:"de set.",Oct:"d’oct.",Nov:"de nov.",Dec:"de des.",Sunday:"diumenge",Monday:"dilluns",Tuesday:"dimarts",Wednesday:"dimecres",Thursday:"dijous",Friday:"divendres",Saturday:"dissabte",Sun:"dg.",Mon:"dl.",Tue:"dt.",Wed:"dc.",Thu:"dj.",Fri:"dv.",Sat:"ds.",_dateOrd:function(d){let e="th";if(d<11||d>13)switch(d%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Zoom",Play:"Reprodueix",Stop:"Parada",Legend:"Llegenda","Press ENTER to toggle":"",Loading:"S'està carregant",Home:"Inici",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Imprimeix",Image:"Imatge",Data:"Dades",Print:"Imprimeix","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"De %1 a %2","From %1":"De %1","To %1":"A %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{_ as default}; diff --git a/assets/calcite-action-0d34f2ad.js b/assets/calcite-action-0d34f2ad.js new file mode 100644 index 0000000..9ef33b0 --- /dev/null +++ b/assets/calcite-action-0d34f2ad.js @@ -0,0 +1,5 @@ +import{A as t,d as o}from"./action-0a339dee.js";import"./index-080e108a.js";import"./guid-114f0fc6.js";import"./loader-2996ba2a.js";import"./loadable-759e1c0c.js";import"./t9n-537805d4.js";import"./observers-4ce6e1b4.js";import"./icon-25aef281.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const a=t,d=o;export{a as CalciteAction,d as defineCustomElement}; diff --git a/assets/calcite-flow-4396f57a.js b/assets/calcite-flow-4396f57a.js new file mode 100644 index 0000000..35f4887 --- /dev/null +++ b/assets/calcite-flow-4396f57a.js @@ -0,0 +1,5 @@ +import{f6 as d,f7 as h,f9 as l}from"./index-080e108a.js";import{c as u}from"./observers-4ce6e1b4.js";import{c as p,s as g,a as w}from"./loadable-759e1c0c.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const c={frame:"frame",frameAdvancing:"frame--advancing",frameRetreating:"frame--retreating"},b=":host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;align-items:stretch;overflow:hidden;background-color:transparent}:host .frame{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;padding:0px}:host ::slotted(calcite-flow-item),:host ::slotted(calcite-panel){block-size:100%}:host ::slotted(.calcite-match-height:last-child){display:flex;flex:1 1 auto;overflow:hidden}:host .frame--advancing{animation:calcite-frame-advance var(--calcite-animation-timing)}:host .frame--retreating{animation:calcite-frame-retreat var(--calcite-animation-timing)}@keyframes calcite-frame-advance{0%{--tw-bg-opacity:0.5;transform:translate3d(50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}@keyframes calcite-frame-retreat{0%{--tw-bg-opacity:0.5;transform:translate3d(-50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}",m=d(class extends h{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.itemMutationObserver=u("mutation",()=>this.updateFlowProps()),this.getFlowDirection=(t,e)=>{const i=t>1;return!(t&&e>1)&&!i?null:e{const{el:t,items:e}=this,i=Array.from(t.querySelectorAll("calcite-flow-item")).filter(o=>o.closest("calcite-flow")===t),n=e.length,a=i.length,s=i[a-1],r=i[a-2];if(a&&s&&i.forEach(o=>{o.showBackButton=o===s&&a>1,o.hidden=o!==s}),r&&(r.menuOpen=!1),this.items=i,n!==a){const o=this.getFlowDirection(n,a);this.itemCount=a,this.flowDirection=o}},this.flowDirection=null,this.itemCount=0,this.items=[]}async back(){const{items:t}=this,e=t[t.length-1];return e?(await(e.beforeBack?e.beforeBack:()=>Promise.resolve()).call(e),e.remove(),e):void 0}async setFocus(){await p(this);const{items:t}=this,e=t[t.length-1];return e==null?void 0:e.setFocus()}connectedCallback(){var t;(t=this.itemMutationObserver)==null||t.observe(this.el,{childList:!0,subtree:!0}),this.updateFlowProps()}async componentWillLoad(){g(this)}componentDidLoad(){w(this)}disconnectedCallback(){var t;(t=this.itemMutationObserver)==null||t.disconnect()}async handleItemBackClick(){return await this.back(),this.setFocus()}render(){const{flowDirection:t}=this,e={[c.frame]:!0,[c.frameAdvancing]:t==="advancing",[c.frameRetreating]:t==="retreating"};return l("div",{class:e},l("slot",null))}get el(){return this}static get style(){return b}},[1,"calcite-flow",{flowDirection:[32],itemCount:[32],items:[32],back:[64],setFocus:[64]},[[0,"calciteFlowItemBack","handleItemBackClick"]]]);function f(){if(typeof customElements>"u")return;["calcite-flow"].forEach(e=>{switch(e){case"calcite-flow":customElements.get(e)||customElements.define(e,m);break}})}f();const x=m,C=f;export{x as CalciteFlow,C as defineCustomElement}; diff --git a/assets/calcite-flow-item-55ff42f9.js b/assets/calcite-flow-item-55ff42f9.js new file mode 100644 index 0000000..d09f5c2 --- /dev/null +++ b/assets/calcite-flow-item-55ff42f9.js @@ -0,0 +1,42 @@ +import{ln as Me,lo as Ze,lp as te,lq as et,lr as tt,ls as D,lt as R,f9 as c,f6 as _,f7 as j,ff as C,fa as U,f8 as nt,lu as Re,fg as it,fb as ze,fh as ae,lv as Ne,hv as T,lw as at,fc as ot}from"./index-080e108a.js";import{d as G,c as Ke,u as $e,a as Ue}from"./loader-2996ba2a.js";import{s as q,a as W,c as Y}from"./loadable-759e1c0c.js";import{u as se,c as re,a as ce,s as le,d as de,b as ue,i as _e}from"./t9n-537805d4.js";import{c as je}from"./observers-4ce6e1b4.js";import{g as Ge}from"./guid-114f0fc6.js";import{d as V}from"./action-0a339dee.js";import{d as X}from"./icon-25aef281.js";import{f as st,c as rt,d as ct,o as we,a as lt,r as dt,b as ut,F as ke}from"./FloatingArrow-54d0aa06.js";import{d as qe}from"./scrim-ffa718f9.js";import"./debounce-14ebcd9e.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */function Ce(t,e){return(t+e)%e}/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + *//*! +* focus-trap 7.5.2 +* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE +*/function xe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Fe(t){for(var e=1;e0){var o=e[e.length-1];o!==n&&o.pause()}var r=e.indexOf(n);r===-1||e.splice(r,1),e.push(n)},deactivateTrap:function(e,n){var o=e.indexOf(n);o!==-1&&e.splice(o,1),e.length>0&&e[e.length-1].unpause()}},mt=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},bt=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},N=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},vt=function(e){return N(e)&&!e.shiftKey},gt=function(e){return N(e)&&e.shiftKey},Pe=function(e){return setTimeout(e,0)},Be=function(e,n){var o=-1;return e.every(function(r,l){return n(r)?(o=l,!1):!0}),o},z=function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r1?d-1:0),h=1;h=0)i=o.activeElement;else{var a=s.tabbableGroups[0],d=a&&a.firstTabbableNode;i=d||P("fallbackFocus")}if(!i)throw new Error("Your focus-trap needs to have at least one focusable element");return i},I=function(){if(s.containerGroups=s.containers.map(function(i){var a=et(i,l.tabbableOptions),d=tt(i,l.tabbableOptions),u=a.length>0?a[0]:void 0,h=a.length>0?a[a.length-1]:void 0,m=d.find(function(g){return D(g)}),v=d.slice().reverse().find(function(g){return D(g)}),w=!!a.find(function(g){return R(g)>0});return{container:i,tabbableNodes:a,focusableNodes:d,posTabIndexesFound:w,firstTabbableNode:u,lastTabbableNode:h,firstDomTabbableNode:m,lastDomTabbableNode:v,nextTabbableNode:function(S){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,F=a.indexOf(S);return F<0?L?d.slice(d.indexOf(S)+1).find(function(M){return D(M)}):d.slice(0,d.indexOf(S)).reverse().find(function(M){return D(M)}):a[F+(L?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(i){return i.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!P("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(i){return i.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},B=function p(i){if(i!==!1&&i!==o.activeElement){if(!i||!i.focus){p(O());return}i.focus({preventScroll:!!l.preventScroll}),s.mostRecentlyFocusedNode=i,mt(i)&&i.select()}},fe=function(i){var a=P("setReturnFocus",i);return a||(a===!1?!1:i)},pe=function(i){var a=i.target,d=i.event,u=i.isBackward,h=u===void 0?!1:u;a=a||$(d),I();var m=null;if(s.tabbableGroups.length>0){var v=k(a,d),w=v>=0?s.containerGroups[v]:void 0;if(v<0)h?m=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:m=s.tabbableGroups[0].firstTabbableNode;else if(h){var g=Be(s.tabbableGroups,function(Z){var ee=Z.firstTabbableNode;return a===ee});if(g<0&&(w.container===a||te(a,l.tabbableOptions)&&!D(a,l.tabbableOptions)&&!w.nextTabbableNode(a,!1))&&(g=v),g>=0){var S=g===0?s.tabbableGroups.length-1:g-1,L=s.tabbableGroups[S];m=R(a)>=0?L.lastTabbableNode:L.lastDomTabbableNode}else N(d)||(m=w.nextTabbableNode(a,!1))}else{var F=Be(s.tabbableGroups,function(Z){var ee=Z.lastTabbableNode;return a===ee});if(F<0&&(w.container===a||te(a,l.tabbableOptions)&&!D(a,l.tabbableOptions)&&!w.nextTabbableNode(a))&&(F=v),F>=0){var M=F===s.tabbableGroups.length-1?0:F+1,ye=s.tabbableGroups[M];m=R(a)>=0?ye.firstTabbableNode:ye.firstDomTabbableNode}else N(d)||(m=w.nextTabbableNode(a))}}else m=P("fallbackFocus");return m},K=function(i){var a=$(i);if(!(k(a,i)>=0)){if(z(l.clickOutsideDeactivates,i)){f.deactivate({returnFocus:l.returnFocusOnDeactivate});return}z(l.allowOutsideClick,i)||i.preventDefault()}},me=function(i){var a=$(i),d=k(a,i)>=0;if(d||a instanceof Document)d&&(s.mostRecentlyFocusedNode=a);else{i.stopImmediatePropagation();var u,h=!0;if(s.mostRecentlyFocusedNode)if(R(s.mostRecentlyFocusedNode)>0){var m=k(s.mostRecentlyFocusedNode),v=s.containerGroups[m].tabbableNodes;if(v.length>0){var w=v.findIndex(function(g){return g===s.mostRecentlyFocusedNode});w>=0&&(l.isKeyForward(s.recentNavEvent)?w+1=0&&(u=v[w-1],h=!1))}}else s.containerGroups.some(function(g){return g.tabbableNodes.some(function(S){return R(S)>0})})||(h=!1);else h=!1;h&&(u=pe({target:s.mostRecentlyFocusedNode,isBackward:l.isKeyBackward(s.recentNavEvent)})),B(u||s.mostRecentlyFocusedNode||O())}s.recentNavEvent=void 0},Je=function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=i;var d=pe({event:i,isBackward:a});d&&(N(i)&&i.preventDefault(),B(d))},be=function(i){if(bt(i)&&z(l.escapeDeactivates,i)!==!1){i.preventDefault(),f.deactivate();return}(l.isKeyForward(i)||l.isKeyBackward(i))&&Je(i,l.isKeyBackward(i))},ve=function(i){var a=$(i);k(a,i)>=0||z(l.clickOutsideDeactivates,i)||z(l.allowOutsideClick,i)||(i.preventDefault(),i.stopImmediatePropagation())},ge=function(){if(s.active)return Ae.activateTrap(r,f),s.delayInitialFocusTimer=l.delayInitialFocus?Pe(function(){B(O())}):B(O()),o.addEventListener("focusin",me,!0),o.addEventListener("mousedown",K,{capture:!0,passive:!1}),o.addEventListener("touchstart",K,{capture:!0,passive:!1}),o.addEventListener("click",ve,{capture:!0,passive:!1}),o.addEventListener("keydown",be,{capture:!0,passive:!1}),f},Ee=function(){if(s.active)return o.removeEventListener("focusin",me,!0),o.removeEventListener("mousedown",K,!0),o.removeEventListener("touchstart",K,!0),o.removeEventListener("click",ve,!0),o.removeEventListener("keydown",be,!0),f},Qe=function(i){var a=i.some(function(d){var u=Array.from(d.removedNodes);return u.some(function(h){return h===s.mostRecentlyFocusedNode})});a&&B(O())},Q=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(Qe):void 0,H=function(){Q&&(Q.disconnect(),s.active&&!s.paused&&s.containers.map(function(i){Q.observe(i,{subtree:!0,childList:!0})}))};return f={get active(){return s.active},get paused(){return s.paused},activate:function(i){if(s.active)return this;var a=b(i,"onActivate"),d=b(i,"onPostActivate"),u=b(i,"checkCanFocusTrap");u||I(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=o.activeElement,a==null||a();var h=function(){u&&I(),ge(),H(),d==null||d()};return u?(u(s.containers.concat()).then(h,h),this):(h(),this)},deactivate:function(i){if(!s.active)return this;var a=Fe({onDeactivate:l.onDeactivate,onPostDeactivate:l.onPostDeactivate,checkCanReturnFocus:l.checkCanReturnFocus},i);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,Ee(),s.active=!1,s.paused=!1,H(),Ae.deactivateTrap(r,f);var d=b(a,"onDeactivate"),u=b(a,"onPostDeactivate"),h=b(a,"checkCanReturnFocus"),m=b(a,"returnFocus","returnFocusOnDeactivate");d==null||d();var v=function(){Pe(function(){m&&B(fe(s.nodeFocusedBeforeActivation)),u==null||u()})};return m&&h?(h(fe(s.nodeFocusedBeforeActivation)).then(v,v),this):(v(),this)},pause:function(i){if(s.paused||!s.active)return this;var a=b(i,"onPause"),d=b(i,"onPostPause");return s.paused=!0,a==null||a(),Ee(),H(),d==null||d(),this},unpause:function(i){if(!s.paused||!s.active)return this;var a=b(i,"onUnpause"),d=b(i,"onPostUnpause");return s.paused=!1,a==null||a(),I(),ge(),H(),d==null||d(),this},updateContainerElements:function(i){var a=[].concat(i).filter(Boolean);return s.containers=a.map(function(d){return typeof d=="string"?o.querySelector(d):d}),s.active&&I(),H(),this}},f.updateContainerElements(e),f};const ne=globalThis.calciteConfig,wt=(ne==null?void 0:ne.focusTrapStack)||[];function kt(t,e){const{el:n}=t,o=(e==null?void 0:e.focusTrapEl)||n;if(!o)return;const r={clickOutsideDeactivates:!0,escapeDeactivates:!1,fallbackFocus:o,setReturnFocus:l=>(Me(l),!1),...e==null?void 0:e.focusTrapOptions,document:n.ownerDocument,tabbableOptions:Ze,trapStack:wt};t.focusTrap=yt(o,r)}function Se(t,e){var n;t.focusTrapDisabled||(n=t.focusTrap)==null||n.activate(e)}function ie(t,e){var n;(n=t.focusTrap)==null||n.deactivate(e)}function Ct(t){var e;(e=t.focusTrap)==null||e.updateContainerElements(t.el)}/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const We=(t,e)=>{const n=t.level?`h${t.level}`:"div";return delete t.level,c(n,{...t},e)};/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const x={container:"container",imageContainer:"image-container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContent:"header-content",heading:"heading"},xt="auto",Te="aria-controls",De="aria-expanded";class Ft{constructor(){this.registeredElements=new Map,this.registeredElementCount=0,this.queryPopover=e=>{const{registeredElements:n}=this,o=e.find(r=>n.has(r));return n.get(o)},this.togglePopovers=e=>{const n=e.composedPath(),o=this.queryPopover(n);o&&!o.triggerDisabled&&(o.open=!o.open),Array.from(this.registeredElements.values()).filter(r=>r!==o&&r.autoClose&&r.open&&!n.includes(r)).forEach(r=>r.open=!1)},this.keyHandler=e=>{e.defaultPrevented||(e.key==="Escape"?this.closeAllPopovers():_e(e.key)&&this.togglePopovers(e))},this.clickHandler=e=>{ae(e)&&this.togglePopovers(e)}}registerElement(e,n){this.registeredElementCount++,this.registeredElements.set(e,n),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}closeAllPopovers(){Array.from(this.registeredElements.values()).forEach(e=>e.open=!1)}addListeners(){document.addEventListener("pointerdown",this.clickHandler,{capture:!0}),document.addEventListener("keydown",this.keyHandler,{capture:!0})}removeListeners(){document.removeEventListener("pointerdown",this.clickHandler,{capture:!0}),document.removeEventListener("keydown",this.keyHandler,{capture:!0})}}const At=":host{--calcite-floating-ui-z-index:var(--calcite-popover-z-index, var(--calcite-app-z-index-popup));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-app-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{transform:translateY(-5px)}:host([data-placement^=top]) .calcite-floating-ui-anim{transform:translateY(5px)}:host([data-placement^=left]) .calcite-floating-ui-anim{transform:translateX(5px)}:host([data-placement^=right]) .calcite-floating-ui-anim{transform:translateX(-5px)}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-app-z-index) * -1);fill:var(--calcite-ui-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-ui-border-3)}:host([scale=s]) .heading{padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .heading{padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .heading{padding-inline:1.25rem;padding-block:1rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host{pointer-events:none}:host([open]){pointer-events:initial}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);background-color:var(--calcite-ui-foreground-1)}.arrow::before{outline:1px solid var(--calcite-ui-border-3)}.header{display:flex;flex:1 1 auto;align-items:stretch;justify-content:flex-start;border-width:0px;border-block-end-width:1px;border-style:solid;border-block-end-color:var(--calcite-ui-border-3)}.heading{margin:0px;display:block;flex:1 1 auto;align-self:center;white-space:normal;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);word-wrap:break-word;word-break:break-word}.container{position:relative;display:flex;block-size:100%;flex-direction:row;flex-wrap:nowrap;border-radius:0.25rem;color:var(--calcite-ui-text-1)}.container.has-header{flex-direction:column}.content{display:flex;block-size:100%;inline-size:100%;flex-direction:column;flex-wrap:nowrap;align-self:center;word-wrap:break-word;word-break:break-word}.close-button-container{display:flex;overflow:hidden;flex:0 0 auto;border-start-end-radius:0.25rem;border-end-end-radius:0.25rem}::slotted(calcite-panel),::slotted(calcite-flow){block-size:100%}:host([hidden]){display:none}[hidden]{display:none}",Oe=new Ft,Pt=_(class extends j{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calcitePopoverBeforeClose=C(this,"calcitePopoverBeforeClose",6),this.calcitePopoverClose=C(this,"calcitePopoverClose",6),this.calcitePopoverBeforeOpen=C(this,"calcitePopoverBeforeOpen",6),this.calcitePopoverOpen=C(this,"calcitePopoverOpen",6),this.mutationObserver=je("mutation",()=>this.updateFocusTrapElements()),this.guid=`calcite-popover-${Ge()}`,this.openTransitionProp="opacity",this.hasLoaded=!1,this.setTransitionEl=t=>{this.transitionEl=t},this.setFilteredPlacements=()=>{const{el:t,flipPlacements:e}=this;this.filteredFlipPlacements=e?st(e,t):null},this.setUpReferenceElement=(t=!0)=>{this.removeReferences(),this.effectiveReferenceElement=this.getReferenceElement(),rt(this,this.effectiveReferenceElement,this.el);const{el:e,referenceElement:n,effectiveReferenceElement:o}=this;t&&n&&!o&&console.warn(`${e.tagName}: reference-element id "${n}" was not found.`,{el:e}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.setExpandedAttr=()=>{const{effectiveReferenceElement:t,open:e}=this;t&&"setAttribute"in t&&t.setAttribute(De,U(e))},this.addReferences=()=>{const{effectiveReferenceElement:t}=this;if(!t)return;const e=this.getId();"setAttribute"in t&&t.setAttribute(Te,e),Oe.registerElement(t,this.el),this.setExpandedAttr()},this.removeReferences=()=>{const{effectiveReferenceElement:t}=this;t&&("removeAttribute"in t&&(t.removeAttribute(Te),t.removeAttribute(De)),Oe.unregisterElement(t))},this.hide=()=>{this.open=!1},this.storeArrowEl=t=>{this.arrowEl=t,this.reposition(!0)},this.autoClose=!1,this.closable=!1,this.flipDisabled=!1,this.focusTrapDisabled=!1,this.pointerDisabled=!1,this.flipPlacements=void 0,this.heading=void 0,this.headingLevel=void 0,this.label=void 0,this.messageOverrides=void 0,this.messages=void 0,this.offsetDistance=ct,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement=xt,this.referenceElement=void 0,this.scale="m",this.triggerDisabled=!1,this.effectiveLocale="",this.floatingLayout="vertical",this.effectiveReferenceElement=void 0,this.defaultMessages=void 0}handleFocusTrapDisabled(t){this.open&&(t?ie(this):Se(this))}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMessagesChange(){}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(t){we(this),t&&this.reposition(!0),this.setExpandedAttr()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement(),this.reposition(!0)}effectiveLocaleChange(){se(this,this.effectiveLocale)}connectedCallback(){this.setFilteredPlacements(),re(this),ce(this),this.setUpReferenceElement(this.hasLoaded),kt(this),this.open&&we(this)}async componentWillLoad(){await le(this),q(this)}componentDidLoad(){W(this),this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement(),this.reposition(),this.hasLoaded=!0}disconnectedCallback(){this.removeReferences(),de(this),ue(this),lt(this,this.effectiveReferenceElement,this.el),ie(this)}async reposition(t=!1){const{el:e,effectiveReferenceElement:n,placement:o,overlayPositioning:r,flipDisabled:l,filteredFlipPlacements:s,offsetDistance:f,offsetSkidding:b,arrowEl:k}=this;return dt(this,{floatingEl:e,referenceEl:n,overlayPositioning:r,placement:o,flipDisabled:l,flipPlacements:s,offsetDistance:f,offsetSkidding:b,arrowEl:k,type:"popover"},t)}async setFocus(){await Y(this),nt(this.el),Re(this.el)}async updateFocusTrapElements(){Ct(this)}getReferenceElement(){const{referenceElement:t,el:e}=this;return(typeof t=="string"?it(e,{id:t}):t)||null}onBeforeOpen(){this.calcitePopoverBeforeOpen.emit()}onOpen(){this.calcitePopoverOpen.emit(),Se(this)}onBeforeClose(){this.calcitePopoverBeforeClose.emit()}onClose(){this.calcitePopoverClose.emit(),ie(this)}renderCloseButton(){const{messages:t,closable:e}=this;return e?c("div",{class:x.closeButtonContainer,key:x.closeButtonContainer},c("calcite-action",{appearance:"transparent",class:x.closeButton,onClick:this.hide,scale:this.scale,text:t.close,ref:n=>this.closeButtonEl=n},c("calcite-icon",{icon:"x",scale:this.scale==="l"?"m":this.scale}))):null}renderHeader(){const{heading:t,headingLevel:e}=this,n=t?c(We,{class:x.heading,level:e},t):null;return n?c("div",{class:x.header,key:x.header},n,this.renderCloseButton()):null}render(){const{effectiveReferenceElement:t,heading:e,label:n,open:o,pointerDisabled:r,floatingLayout:l}=this,s=t&&o,f=!s,b=r?null:c(ut,{floatingLayout:l,key:"floating-arrow",ref:this.storeArrowEl});return c(ze,{"aria-hidden":U(f),"aria-label":n,"aria-live":"polite","calcite-hydrated-hidden":f,id:this.getId(),role:"dialog"},c("div",{class:{[ke.animation]:!0,[ke.animationActive]:s},ref:this.setTransitionEl},b,c("div",{class:{[x.hasHeader]:!!e,[x.container]:!0}},this.renderHeader(),c("div",{class:x.content},c("slot",null)),e?null:this.renderCloseButton())))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{focusTrapDisabled:["handleFocusTrapDisabled"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return At}},[1,"calcite-popover",{autoClose:[516,"auto-close"],closable:[516],flipDisabled:[516,"flip-disabled"],focusTrapDisabled:[516,"focus-trap-disabled"],pointerDisabled:[516,"pointer-disabled"],flipPlacements:[16],heading:[1],headingLevel:[514,"heading-level"],label:[1],messageOverrides:[1040],messages:[1040],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],scale:[513],triggerDisabled:[516,"trigger-disabled"],effectiveLocale:[32],floatingLayout:[32],effectiveReferenceElement:[32],defaultMessages:[32],reposition:[64],setFocus:[64],updateFocusTrapElements:[64]}]);function J(){if(typeof customElements>"u")return;["calcite-popover","calcite-action","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-popover":customElements.get(e)||customElements.define(e,Pt);break;case"calcite-action":customElements.get(e)||V();break;case"calcite-icon":customElements.get(e)||X();break;case"calcite-loader":customElements.get(e)||G();break}})}J();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const Ie={menu:"menu",defaultTrigger:"default-trigger"},oe={tooltip:"tooltip",trigger:"trigger"},Bt={menu:"ellipsis"},St=`:host{box-sizing:border-box;display:flex;flex-direction:column;background-color:var(--calcite-ui-foreground-1);font-size:var(--calcite-font-size-1);color:var(--calcite-ui-text-2)}.menu ::slotted(calcite-action){margin:0.125rem;display:flex;outline-color:transparent}.menu ::slotted(calcite-action[active]){outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + 2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + );outline-offset:0px}.default-trigger{position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}slot[name=trigger]::slotted(calcite-action),calcite-action::slotted([slot=trigger]){position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}.menu{flex-direction:column;flex-wrap:nowrap;outline:2px solid transparent;outline-offset:2px}:host([hidden]){display:none}[hidden]{display:none}`,Tt=["ArrowUp","ArrowDown","End","Home"],Dt=_(class extends j{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionMenuOpen=C(this,"calciteActionMenuOpen",6),this.actionElements=[],this.guid=`calcite-action-menu-${Ge()}`,this.menuId=`${this.guid}-menu`,this.menuButtonId=`${this.guid}-menu-button`,this.connectMenuButtonEl=()=>{const{menuButtonId:t,menuId:e,open:n,label:o}=this,r=this.slottedMenuButtonEl||this.defaultMenuButtonEl;this.menuButtonEl!==r&&(this.disconnectMenuButtonEl(),this.menuButtonEl=r,this.setTooltipReferenceElement(),r&&(r.active=n,r.setAttribute("aria-controls",e),r.setAttribute("aria-expanded",U(n)),r.setAttribute("aria-haspopup","true"),r.id||(r.id=t),r.label||(r.label=o),r.text||(r.text=o),r.addEventListener("pointerdown",this.menuButtonClick),r.addEventListener("keydown",this.menuButtonKeyDown)))},this.disconnectMenuButtonEl=()=>{const{menuButtonEl:t}=this;t&&(t.removeEventListener("pointerdown",this.menuButtonClick),t.removeEventListener("keydown",this.menuButtonKeyDown))},this.setMenuButtonEl=t=>{const e=t.target.assignedElements({flatten:!0}).filter(n=>n==null?void 0:n.matches("calcite-action"));this.slottedMenuButtonEl=e[0],this.connectMenuButtonEl()},this.setDefaultMenuButtonEl=t=>{this.defaultMenuButtonEl=t,this.connectMenuButtonEl()},this.handleCalciteActionClick=()=>{this.open=!1,this.setFocus()},this.menuButtonClick=t=>{ae(t)&&this.toggleOpen()},this.updateTooltip=t=>{const e=t.target.assignedElements({flatten:!0}).filter(n=>n==null?void 0:n.matches("calcite-tooltip"));this.tooltipEl=e[0],this.setTooltipReferenceElement()},this.setTooltipReferenceElement=()=>{const{tooltipEl:t,expanded:e,menuButtonEl:n,open:o}=this;t&&(t.referenceElement=!e&&!o?n:null)},this.updateAction=(t,e)=>{const{guid:n,activeMenuItemIndex:o}=this,r=`${n}-action-${e}`;t.tabIndex=-1,t.setAttribute("role","menuitem"),t.id||(t.id=r),t.active=e===o},this.updateActions=t=>{t==null||t.forEach(this.updateAction)},this.handleDefaultSlotChange=t=>{const e=t.target.assignedElements({flatten:!0}).filter(n=>n==null?void 0:n.matches("calcite-action"));this.actionElements=e},this.menuButtonKeyDown=t=>{const{key:e}=t,{actionElements:n,activeMenuItemIndex:o,open:r}=this;if(n.length){if(_e(e)){if(t.preventDefault(),!r){this.toggleOpen();return}const l=n[o];l?l.click():this.toggleOpen(!1)}if(e==="Tab"){this.open=!1;return}if(e==="Escape"){this.toggleOpen(!1),t.preventDefault();return}this.handleActionNavigation(t,e,n)}},this.handleActionNavigation=(t,e,n)=>{if(!this.isValidKey(e,Tt))return;if(t.preventDefault(),!this.open){this.toggleOpen(),(e==="Home"||e==="ArrowDown")&&(this.activeMenuItemIndex=0),(e==="End"||e==="ArrowUp")&&(this.activeMenuItemIndex=n.length-1);return}e==="Home"&&(this.activeMenuItemIndex=0),e==="End"&&(this.activeMenuItemIndex=n.length-1);const o=this.activeMenuItemIndex;e==="ArrowUp"&&(this.activeMenuItemIndex=Ce(Math.max(o-1,-1),n.length)),e==="ArrowDown"&&(this.activeMenuItemIndex=Ce(o+1,n.length))},this.toggleOpenEnd=()=>{this.setFocus(),this.el.removeEventListener("calcitePopoverOpen",this.toggleOpenEnd)},this.toggleOpen=(t=!this.open)=>{this.el.addEventListener("calcitePopoverOpen",this.toggleOpenEnd),this.open=t},this.expanded=!1,this.flipPlacements=void 0,this.label=void 0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.scale=void 0,this.menuButtonEl=void 0,this.activeMenuItemIndex=-1}componentWillLoad(){q(this)}componentDidLoad(){W(this)}disconnectedCallback(){this.disconnectMenuButtonEl()}expandedHandler(){this.open=!1,this.setTooltipReferenceElement()}openHandler(t){this.activeMenuItemIndex=this.open?0:-1,this.menuButtonEl&&(this.menuButtonEl.active=t),this.calciteActionMenuOpen.emit(),this.setTooltipReferenceElement()}closeCalciteActionMenuOnClick(t){!ae(t)||t.composedPath().includes(this.el)||(this.open=!1)}activeMenuItemIndexHandler(){this.updateActions(this.actionElements)}async setFocus(){return await Y(this),Me(this.menuButtonEl)}renderMenuButton(){const{label:t,scale:e,expanded:n}=this;return c("slot",{name:oe.trigger,onSlotchange:this.setMenuButtonEl},c("calcite-action",{class:Ie.defaultTrigger,icon:Bt.menu,scale:e,text:t,textEnabled:n,ref:this.setDefaultMenuButtonEl}))}renderMenuItems(){const{actionElements:t,activeMenuItemIndex:e,open:n,menuId:o,menuButtonEl:r,label:l,placement:s,overlayPositioning:f,flipPlacements:b}=this,k=t[e],P=(k==null?void 0:k.id)||null;return c("calcite-popover",{flipPlacements:b,focusTrapDisabled:!0,label:l,offsetDistance:0,open:n,overlayPositioning:f,placement:s,pointerDisabled:!0,referenceElement:r},c("div",{"aria-activedescendant":P,"aria-labelledby":r==null?void 0:r.id,class:Ie.menu,id:o,onClick:this.handleCalciteActionClick,role:"menu",tabIndex:-1},c("slot",{onSlotchange:this.handleDefaultSlotChange})))}render(){return c(Ne,null,this.renderMenuButton(),this.renderMenuItems(),c("slot",{name:oe.tooltip,onSlotchange:this.updateTooltip}))}isValidKey(t,e){return!!e.find(n=>n===t)}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}}static get style(){return St}},[1,"calcite-action-menu",{expanded:[516],flipPlacements:[16],label:[1],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],scale:[513],menuButtonEl:[32],activeMenuItemIndex:[32],setFocus:[64]},[[9,"pointerdown","closeCalciteActionMenuOnClick"]]]);function he(){if(typeof customElements>"u")return;["calcite-action-menu","calcite-action","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-menu":customElements.get(e)||customElements.define(e,Dt);break;case"calcite-action":customElements.get(e)||V();break;case"calcite-icon":customElements.get(e)||X();break;case"calcite-loader":customElements.get(e)||G();break;case"calcite-popover":customElements.get(e)||J();break}})}he();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const E={actionBarContainer:"action-bar-container",backButton:"back-button",container:"container",header:"header",headerContainer:"header-container",headerContainerBorderEnd:"header-container--border-end",heading:"heading",summary:"summary",description:"description",headerContent:"header-content",headerActions:"header-actions",headerActionsEnd:"header-actions--end",headerActionsStart:"header-actions--start",contentWrapper:"content-wrapper",fabContainer:"fab-container",footer:"footer"},He={close:"x",menu:"ellipsis",backLeft:"chevron-left",backRight:"chevron-right"},y={actionBar:"action-bar",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerActions:"footer-actions"},Ot=":host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;overflow:hidden;--calcite-min-header-height:calc(var(--calcite-icon-size) * 3);--calcite-panel-footer-padding:0.5rem;--calcite-internal-panel-header-border-block-end:1px solid var(--calcite-ui-border-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.header{margin:0px;display:flex;align-content:space-between;align-items:center;fill:var(--calcite-ui-text-2);color:var(--calcite-ui-text-2)}.heading{margin:0px;padding:0px;font-weight:var(--calcite-font-weight-medium)}.header .heading{flex:1 1 auto;padding:0.5rem}.container{margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;background-color:var(--calcite-ui-background);padding:0px;transition:max-block-size var(--calcite-animation-timing), inline-size var(--calcite-animation-timing)}.container[hidden]{display:none}.header{z-index:var(--calcite-app-z-index-header);display:flex;flex-direction:column;background-color:var(--calcite-ui-foreground-1);border-block-end:var(--calcite-internal-panel-header-border-block-end)}.header-container{display:flex;inline-size:100%;flex-direction:row;align-items:stretch;justify-content:flex-start;flex:0 0 auto}.header-container--border-end{border-block-end:1px solid var(--calcite-ui-border-3)}.action-bar-container{inline-size:100%}.action-bar-container ::slotted(calcite-action-bar){inline-size:100%}.header-content{display:flex;flex-direction:column;overflow:hidden;padding-inline:0.75rem;padding-block:0.875rem;margin-inline-end:auto}.header-content .heading,.header-content .description{display:block;overflow-wrap:break-word;padding:0px}.header-content .heading{margin-inline:0px;margin-block:0px 0.25rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;font-weight:var(--calcite-font-weight-medium)}.header-content .heading:only-child{margin-block-end:0px}.header-content .description{font-size:var(--calcite-font-size--1);line-height:1rem;color:var(--calcite-ui-text-2)}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-ui-border-3);border-inline-end-width:1px}.header-actions{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:stretch}.header-actions--end{margin-inline-start:auto}.content-wrapper{display:flex;block-size:100%;flex:1 1 auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch;overflow:auto;background-color:var(--calcite-ui-background)}.footer{display:flex;inline-size:100%;justify-content:space-evenly;background-color:var(--calcite-ui-foreground-1);flex:0 0 auto;padding:var(--calcite-panel-footer-padding);border-block-start:1px solid var(--calcite-ui-border-3)}.fab-container{position:sticky;inset-block-end:0px;z-index:var(--calcite-app-z-index-sticky);margin-block:0px;margin-inline:auto;display:block;padding:0.5rem;inset-inline:0;inline-size:-moz-fit-content;inline-size:fit-content}:host([hidden]){display:none}[hidden]{display:none}",It=_(class extends j{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calcitePanelClose=C(this,"calcitePanelClose",6),this.calcitePanelScroll=C(this,"calcitePanelScroll",6),this.resizeObserver=je("resize",()=>this.resizeHandler()),this.resizeHandler=()=>{const{panelScrollEl:t}=this;!t||typeof t.scrollHeight!="number"||typeof t.offsetHeight!="number"||(t.tabIndex=t.scrollHeight>t.offsetHeight?0:-1)},this.setContainerRef=t=>{this.containerEl=t},this.setCloseRef=t=>{this.closeButtonEl=t},this.setBackRef=t=>{this.backButtonEl=t},this.panelKeyDownHandler=t=>{this.closable&&t.key==="Escape"&&!t.defaultPrevented&&(this.close(),t.preventDefault())},this.close=()=>{this.closed=!0,this.calcitePanelClose.emit()},this.panelScrollHandler=()=>{this.calcitePanelScroll.emit()},this.handleHeaderActionsStartSlotChange=t=>{this.hasStartActions=T(t)},this.handleHeaderActionsEndSlotChange=t=>{this.hasEndActions=T(t)},this.handleHeaderMenuActionsSlotChange=t=>{this.hasMenuItems=T(t)},this.handleActionBarSlotChange=t=>{const e=at(t).filter(n=>n==null?void 0:n.matches("calcite-action-bar"));e.forEach(n=>n.layout="horizontal"),this.hasActionBar=!!e.length},this.handleHeaderContentSlotChange=t=>{this.hasHeaderContent=T(t)},this.handleFooterSlotChange=t=>{this.hasFooterContent=T(t)},this.handleFooterActionsSlotChange=t=>{this.hasFooterActions=T(t)},this.handleFabSlotChange=t=>{this.hasFab=T(t)},this.setPanelScrollEl=t=>{var e,n;this.panelScrollEl=t,(e=this.resizeObserver)==null||e.disconnect(),t&&((n=this.resizeObserver)==null||n.observe(t),this.resizeHandler())},this.closed=!1,this.disabled=!1,this.closable=!1,this.headingLevel=void 0,this.loading=!1,this.heading=void 0,this.description=void 0,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.hasStartActions=!1,this.hasEndActions=!1,this.hasMenuItems=!1,this.hasHeaderContent=!1,this.hasActionBar=!1,this.hasFooterContent=!1,this.hasFooterActions=!1,this.hasFab=!1,this.defaultMessages=void 0,this.effectiveLocale="",this.showHeaderContent=!1}onMessagesChange(){}connectedCallback(){Ke(this),re(this),ce(this)}async componentWillLoad(){q(this),await le(this)}componentDidLoad(){W(this)}componentDidRender(){$e(this)}disconnectedCallback(){var t;Ue(this),de(this),ue(this),(t=this.resizeObserver)==null||t.disconnect()}effectiveLocaleChange(){se(this,this.effectiveLocale)}async setFocus(){await Y(this),Re(this.containerEl)}async scrollContentTo(t){var e;(e=this.panelScrollEl)==null||e.scrollTo(t)}renderHeaderContent(){const{heading:t,headingLevel:e,description:n,hasHeaderContent:o}=this,r=t?c(We,{class:E.heading,level:e},t):null,l=n?c("span",{class:E.description},n):null;return!o&&(r||l)?c("div",{class:E.headerContent,key:"header-content"},r,l):null}renderActionBar(){return c("div",{class:E.actionBarContainer,hidden:!this.hasActionBar},c("slot",{name:y.actionBar,onSlotchange:this.handleActionBarSlotChange}))}renderHeaderSlottedContent(){return c("div",{class:E.headerContent,hidden:!this.hasHeaderContent,key:"slotted-header-content"},c("slot",{name:y.headerContent,onSlotchange:this.handleHeaderContentSlotChange}))}renderHeaderStartActions(){const{hasStartActions:t}=this;return c("div",{class:{[E.headerActionsStart]:!0,[E.headerActions]:!0},hidden:!t,key:"header-actions-start"},c("slot",{name:y.headerActionsStart,onSlotchange:this.handleHeaderActionsStartSlotChange}))}renderHeaderActionsEnd(){const{close:t,hasEndActions:e,messages:n,closable:o,hasMenuItems:r}=this,l=n.close,s=o?c("calcite-action",{"aria-label":l,"data-test":"close",icon:He.close,onClick:t,text:l,title:l,ref:this.setCloseRef}):null,f=c("slot",{name:y.headerActionsEnd,onSlotchange:this.handleHeaderActionsEndSlotChange}),b=e||s||r;return c("div",{class:{[E.headerActionsEnd]:!0,[E.headerActions]:!0},hidden:!b,key:"header-actions-end"},f,this.renderMenu(),s)}renderMenu(){const{hasMenuItems:t,messages:e,menuOpen:n}=this;return c("calcite-action-menu",{flipPlacements:["top","bottom"],hidden:!t,key:"menu",label:e.options,open:n,placement:"bottom-end"},c("calcite-action",{icon:He.menu,slot:oe.trigger,text:e.options}),c("slot",{name:y.headerMenuActions,onSlotchange:this.handleHeaderMenuActionsSlotChange}))}renderHeaderNode(){const{hasHeaderContent:t,hasStartActions:e,hasEndActions:n,closable:o,hasMenuItems:r,hasActionBar:l}=this,s=this.renderHeaderContent(),f=t||!!s||e||n||o||r;return this.showHeaderContent=f,c("header",{class:E.header,hidden:!(f||l)},c("div",{class:{[E.headerContainer]:!0,[E.headerContainerBorderEnd]:l},hidden:!f},this.renderHeaderStartActions(),this.renderHeaderSlottedContent(),s,this.renderHeaderActionsEnd()),this.renderActionBar())}renderFooterNode(){const{hasFooterContent:t,hasFooterActions:e}=this,n=t||e;return c("footer",{class:E.footer,hidden:!n},c("slot",{key:"footer-slot",name:y.footer,onSlotchange:this.handleFooterSlotChange}),c("slot",{key:"footer-actions-slot",name:y.footerActions,onSlotchange:this.handleFooterActionsSlotChange}))}renderContent(){return c("div",{class:E.contentWrapper,onScroll:this.panelScrollHandler,ref:this.setPanelScrollEl},c("slot",null),this.renderFab())}renderFab(){return c("div",{class:E.fabContainer,hidden:!this.hasFab},c("slot",{name:y.fab,onSlotchange:this.handleFabSlotChange}))}render(){const{loading:t,panelKeyDownHandler:e,closed:n,closable:o}=this,r=c("article",{"aria-busy":U(t),class:E.container,hidden:n,onKeyDown:e,tabIndex:o?0:-1,ref:this.setContainerRef},this.renderHeaderNode(),this.renderContent(),this.renderFooterNode());return c(Ne,null,t?c("calcite-scrim",{loading:t}):null,r)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Ot}},[1,"calcite-panel",{closed:[1540],disabled:[516],closable:[516],headingLevel:[514,"heading-level"],loading:[516],heading:[1],description:[1],menuOpen:[516,"menu-open"],messageOverrides:[1040],messages:[1040],hasStartActions:[32],hasEndActions:[32],hasMenuItems:[32],hasHeaderContent:[32],hasActionBar:[32],hasFooterContent:[32],hasFooterActions:[32],hasFab:[32],defaultMessages:[32],effectiveLocale:[32],showHeaderContent:[32],setFocus:[64],scrollContentTo:[64]}]);function Ye(){if(typeof customElements>"u")return;["calcite-panel","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover","calcite-scrim"].forEach(e=>{switch(e){case"calcite-panel":customElements.get(e)||customElements.define(e,It);break;case"calcite-action":customElements.get(e)||V();break;case"calcite-action-menu":customElements.get(e)||he();break;case"calcite-icon":customElements.get(e)||X();break;case"calcite-loader":customElements.get(e)||G();break;case"calcite-popover":customElements.get(e)||J();break;case"calcite-scrim":customElements.get(e)||qe();break}})}Ye();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const Ht={backButton:"back-button"},Le={backLeft:"chevron-left",backRight:"chevron-right"},A={actionBar:"action-bar",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerActions:"footer-actions"},Lt=":host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;overflow:hidden;--calcite-flow-item-footer-padding:0.5rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-ui-border-3);border-inline-end-width:1px}calcite-panel{--calcite-panel-footer-padding:var(--calcite-flow-item-footer-padding)}:host([hidden]){display:none}[hidden]{display:none}",Ve=_(class extends j{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFlowItemBack=C(this,"calciteFlowItemBack",6),this.calciteFlowItemScroll=C(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=C(this,"calciteFlowItemClose",6),this.handlePanelScroll=t=>{t.stopPropagation(),this.calciteFlowItemScroll.emit()},this.handlePanelClose=t=>{t.stopPropagation(),this.calciteFlowItemClose.emit()},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=t=>{this.backButtonEl=t},this.setContainerRef=t=>{this.containerEl=t},this.closable=!1,this.closed=!1,this.beforeBack=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.showBackButton=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){Ke(this),re(this),ce(this)}async componentWillLoad(){await le(this),q(this)}componentDidRender(){$e(this)}disconnectedCallback(){Ue(this),de(this),ue(this)}componentDidLoad(){W(this)}effectiveLocaleChange(){se(this,this.effectiveLocale)}async setFocus(){await Y(this);const{backButtonEl:t,containerEl:e}=this;if(t)return t.setFocus();if(e)return e.setFocus()}async scrollContentTo(t){var e;await((e=this.containerEl)==null?void 0:e.scrollContentTo(t))}renderBackButton(){const{el:t}=this,e=ot(t)==="rtl",{showBackButton:n,backButtonClick:o,messages:r}=this,l=r.back,s=e?Le.backRight:Le.backLeft;return n?c("calcite-action",{"aria-label":l,class:Ht.backButton,icon:s,key:"flow-back-button",onClick:o,scale:"s",slot:"header-actions-start",text:l,title:l,ref:this.setBackRef}):null}render(){const{closable:t,closed:e,description:n,disabled:o,heading:r,headingLevel:l,loading:s,menuOpen:f,messages:b}=this;return c(ze,null,c("calcite-panel",{closable:t,closed:e,description:n,disabled:o,heading:r,headingLevel:l,loading:s,menuOpen:f,messageOverrides:b,onCalcitePanelClose:this.handlePanelClose,onCalcitePanelScroll:this.handlePanelScroll,ref:this.setContainerRef},this.renderBackButton(),c("slot",{name:A.actionBar,slot:y.actionBar}),c("slot",{name:A.headerActionsStart,slot:y.headerActionsStart}),c("slot",{name:A.headerActionsEnd,slot:y.headerActionsEnd}),c("slot",{name:A.headerContent,slot:y.headerContent}),c("slot",{name:A.headerMenuActions,slot:y.headerMenuActions}),c("slot",{name:A.fab,slot:y.fab}),c("slot",{name:A.footerActions,slot:y.footerActions}),c("slot",{name:A.footer,slot:y.footer}),c("slot",null)))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Lt}},[1,"calcite-flow-item",{closable:[516],closed:[516],beforeBack:[16],description:[1],disabled:[516],heading:[1],headingLevel:[514,"heading-level"],loading:[516],menuOpen:[516,"menu-open"],messageOverrides:[1040],messages:[1040],showBackButton:[4,"show-back-button"],defaultMessages:[32],effectiveLocale:[32],setFocus:[64],scrollContentTo:[64]}]);function Xe(){if(typeof customElements>"u")return;["calcite-flow-item","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-panel","calcite-popover","calcite-scrim"].forEach(e=>{switch(e){case"calcite-flow-item":customElements.get(e)||customElements.define(e,Ve);break;case"calcite-action":customElements.get(e)||V();break;case"calcite-action-menu":customElements.get(e)||he();break;case"calcite-icon":customElements.get(e)||X();break;case"calcite-loader":customElements.get(e)||G();break;case"calcite-panel":customElements.get(e)||Ye();break;case"calcite-popover":customElements.get(e)||J();break;case"calcite-scrim":customElements.get(e)||qe();break}})}Xe();const Wt=Ve,Yt=Xe;export{Wt as CalciteFlowItem,Yt as defineCustomElement}; diff --git a/assets/calcite-icon-2c0948c4.js b/assets/calcite-icon-2c0948c4.js new file mode 100644 index 0000000..0303d7b --- /dev/null +++ b/assets/calcite-icon-2c0948c4.js @@ -0,0 +1,5 @@ +import{I as o,d as t}from"./icon-25aef281.js";import"./index-080e108a.js";import"./observers-4ce6e1b4.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const i=o,s=t;export{i as CalciteIcon,s as defineCustomElement}; diff --git a/assets/calcite-list-9839fae2.js b/assets/calcite-list-9839fae2.js new file mode 100644 index 0000000..5a6e31a --- /dev/null +++ b/assets/calcite-list-9839fae2.js @@ -0,0 +1,73 @@ +import{jr as cn,f6 as Ve,f7 as je,hv as ve,f9 as f,fb as vi,fg as yi,js as Dt,fc as Ei,mq as wi,ff as Z,jv as $t,fh as un,ju as Xt,lv as dn,fa as hn}from"./index-080e108a.js";import{c as kt,a as Tt,u as At,d as fn}from"./loader-2996ba2a.js";import{c as xi}from"./observers-4ce6e1b4.js";import{u as pn,a as mn,M as gn}from"./utils3-4f0533d1.js";import{s as Lt,a as _t,c as Ot}from"./loadable-759e1c0c.js";import{S as Yt,i as Ft,r as bn,b as zt,f as vn,a as yn,c as Ii,d as Si}from"./debounce-14ebcd9e.js";import{n as $,e as ce,p as En,f as wn,g as xn,u as Ci,c as Di,a as ki,d as Ti,b as Ai,s as Li,B as In,h as Sn}from"./t9n-537805d4.js";import{d as Pt}from"./icon-25aef281.js";import{d as Cn}from"./scrim-ffa718f9.js";import"./guid-114f0fc6.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + *//**! + * Sortable 1.15.0 + * @author RubaXa + * @author owenm + * @license MIT + */function Kt(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),i.push.apply(i,n)}return i}function K(e){for(var t=1;t=0)&&(i[a]=e[a]);return i}function Tn(e,t){if(e==null)return{};var i=kn(e,t),n,a;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var An="1.15.0";function Q(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var ee=Q(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Be=Q(/Edge/i),qt=Q(/firefox/i),Oe=Q(/safari/i)&&!Q(/chrome/i)&&!Q(/android/i),_i=Q(/iP(ad|od|hone)/i),Oi=Q(/chrome/i)&&Q(/android/i),Fi={capture:!1,passive:!1};function E(e,t,i){e.addEventListener(t,i,!ee&&Fi)}function y(e,t,i){e.removeEventListener(t,i,!ee&&Fi)}function Je(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function Ln(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function X(e,t,i,n){if(e){i=i||document;do{if(t!=null&&(t[0]===">"?e.parentNode===i&&Je(e,t):Je(e,t))||n&&e===i)return e;if(e===i)break}while(e=Ln(e))}return null}var Gt=/\s+/g;function H(e,t,i){if(e&&t)if(e.classList)e.classList[i?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(Gt," ").replace(" "+t+" "," ");e.className=(n+(i?" "+t:"")).replace(Gt," ")}}function m(e,t,i){var n=e&&e.style;if(n){if(i===void 0)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(i=e.currentStyle),t===void 0?i:i[t];!(t in n)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),n[t]=i+(typeof i=="string"?"":"px")}}function we(e,t){var i="";if(typeof e=="string")i=e;else do{var n=m(e,"transform");n&&n!=="none"&&(i=n+" "+i)}while(!t&&(e=e.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(i)}function zi(e,t,i){if(e){var n=e.getElementsByTagName(t),a=0,r=n.length;if(i)for(;a=r:o=a<=r,!o)return n;if(n===Y())break;n=re(n,!1)}return!1}function Ie(e,t,i,n){for(var a=0,r=0,o=e.children;r2&&arguments[2]!==void 0?arguments[2]:{},a=n.evt,r=Tn(n,Mn);Re.pluginEvent.bind(g)(t,i,K({dragEl:d,parentEl:D,ghostEl:b,rootEl:S,nextEl:fe,lastDownEl:qe,cloneEl:C,cloneHidden:ae,dragStarted:Ae,putSortable:A,activeSortable:g.active,originalEvent:a,oldIndex:ye,oldDraggableIndex:ze,newIndex:M,newDraggableIndex:ne,hideGhostForTarget:Bi,unhideGhostForTarget:Ri,cloneNowHidden:function(){ae=!0},cloneNowShown:function(){ae=!1},dispatchSortableEvent:function(s){F({sortable:i,name:s,originalEvent:a})}},r))};function F(e){Hn(K({putSortable:A,cloneEl:C,targetEl:d,rootEl:S,oldIndex:ye,oldDraggableIndex:ze,newIndex:M,newDraggableIndex:ne},e))}var d,D,b,S,fe,qe,C,ae,ye,M,ze,ne,Ue,A,be=!1,et=!1,tt=[],ue,W,dt,ht,Jt,ei,Ae,me,Pe,Ne=!1,$e=!1,Ge,L,ft=[],yt=!1,it=[],ot=typeof document<"u",Xe=_i,ti=Be||ee?"cssFloat":"float",Vn=ot&&!Oi&&!_i&&"draggable"in document.createElement("div"),Mi=function(){if(ot){if(ee)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),Vi=function(t,i){var n=m(t),a=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),r=Ie(t,0,i),o=Ie(t,1,i),s=r&&m(r),l=o&&m(o),c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+T(r).width,h=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+T(o).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&s.float&&s.float!=="none"){var u=s.float==="left"?"left":"right";return o&&(l.clear==="both"||l.clear===u)?"vertical":"horizontal"}return r&&(s.display==="block"||s.display==="flex"||s.display==="table"||s.display==="grid"||c>=a&&n[ti]==="none"||o&&n[ti]==="none"&&c+h>a)?"vertical":"horizontal"},jn=function(t,i,n){var a=n?t.left:t.top,r=n?t.right:t.bottom,o=n?t.width:t.height,s=n?i.left:i.top,l=n?i.right:i.bottom,c=n?i.width:i.height;return a===s||r===l||a+o/2===s+c/2},Bn=function(t,i){var n;return tt.some(function(a){var r=a[V].options.emptyInsertThreshold;if(!(!r||Nt(a))){var o=T(a),s=t>=o.left-r&&t<=o.right+r,l=i>=o.top-r&&i<=o.bottom+r;if(s&&l)return n=a}}),n},ji=function(t){function i(r,o){return function(s,l,c,h){var u=s.options.group.name&&l.options.group.name&&s.options.group.name===l.options.group.name;if(r==null&&(o||u))return!0;if(r==null||r===!1)return!1;if(o&&r==="clone")return r;if(typeof r=="function")return i(r(s,l,c,h),o)(s,l,c,h);var p=(o?s:l).options.group.name;return r===!0||typeof r=="string"&&r===p||r.join&&r.indexOf(p)>-1}}var n={},a=t.group;(!a||Ke(a)!="object")&&(a={name:a}),n.name=a.name,n.checkPull=i(a.pull,!0),n.checkPut=i(a.put),n.revertClone=a.revertClone,t.group=n},Bi=function(){!Mi&&b&&m(b,"display","none")},Ri=function(){!Mi&&b&&m(b,"display","")};ot&&!Oi&&document.addEventListener("click",function(e){if(et)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),et=!1,!1},!0);var de=function(t){if(d){t=t.touches?t.touches[0]:t;var i=Bn(t.clientX,t.clientY);if(i){var n={};for(var a in t)t.hasOwnProperty(a)&&(n[a]=t[a]);n.target=n.rootEl=i,n.preventDefault=void 0,n.stopPropagation=void 0,i[V]._onDragOver(n)}}},Rn=function(t){d&&d.parentNode[V]._isOutsideThisEl(t.target)};function g(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=J({},t),e[V]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Vi(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,s){o.setData("Text",s.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:g.supportPointer!==!1&&"PointerEvent"in window&&!Oe,emptyInsertThreshold:5};Re.initializePlugins(this,e,i);for(var n in i)!(n in t)&&(t[n]=i[n]);ji(t);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=t.forceFallback?!1:Vn,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?E(e,"pointerdown",this._onTapStart):(E(e,"mousedown",this._onTapStart),E(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(E(e,"dragover",this),E(e,"dragenter",this)),tt.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),J(this,zn())}g.prototype={constructor:g,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(me=null)},_getDirection:function(t,i){return typeof this.options.direction=="function"?this.options.direction.call(this,t,i,d):this.options.direction},_onTapStart:function(t){if(t.cancelable){var i=this,n=this.el,a=this.options,r=a.preventOnFilter,o=t.type,s=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(s||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,h=a.filter;if(Gn(n),!d&&!(/mousedown|pointerdown/.test(o)&&t.button!==0||a.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Oe&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=X(l,a.draggable,n,!1),!(l&&l.animated)&&qe!==l)){if(ye=j(l),ze=j(l,a.draggable),typeof h=="function"){if(h.call(this,t,l,this)){F({sortable:i,rootEl:c,name:"filter",targetEl:l,toEl:n,fromEl:n}),z("filter",i,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(h&&(h=h.split(",").some(function(u){if(u=X(c,u.trim(),n,!1),u)return F({sortable:i,rootEl:u,name:"filter",targetEl:l,fromEl:n,toEl:n}),z("filter",i,{evt:t}),!0}),h)){r&&t.cancelable&&t.preventDefault();return}a.handle&&!X(c,a.handle,n,!1)||this._prepareDragStart(t,s,l)}}},_prepareDragStart:function(t,i,n){var a=this,r=a.el,o=a.options,s=r.ownerDocument,l;if(n&&!d&&n.parentNode===r){var c=T(n);if(S=r,d=n,D=d.parentNode,fe=d.nextSibling,qe=n,Ue=o.group,g.dragged=d,ue={target:d,clientX:(i||t).clientX,clientY:(i||t).clientY},Jt=ue.clientX-c.left,ei=ue.clientY-c.top,this._lastX=(i||t).clientX,this._lastY=(i||t).clientY,d.style["will-change"]="all",l=function(){if(z("delayEnded",a,{evt:t}),g.eventCanceled){a._onDrop();return}a._disableDelayedDragEvents(),!qt&&a.nativeDraggable&&(d.draggable=!0),a._triggerDragStart(t,i),F({sortable:a,name:"choose",originalEvent:t}),H(d,o.chosenClass,!0)},o.ignore.split(",").forEach(function(h){zi(d,h.trim(),pt)}),E(s,"dragover",de),E(s,"mousemove",de),E(s,"touchmove",de),E(s,"mouseup",a._onDrop),E(s,"touchend",a._onDrop),E(s,"touchcancel",a._onDrop),qt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,d.draggable=!0),z("delayStart",this,{evt:t}),o.delay&&(!o.delayOnTouchOnly||i)&&(!this.nativeDraggable||!(Be||ee))){if(g.eventCanceled){this._onDrop();return}E(s,"mouseup",a._disableDelayedDrag),E(s,"touchend",a._disableDelayedDrag),E(s,"touchcancel",a._disableDelayedDrag),E(s,"mousemove",a._delayedDragTouchMoveHandler),E(s,"touchmove",a._delayedDragTouchMoveHandler),o.supportPointer&&E(s,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(l,o.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var i=t.touches?t.touches[0]:t;Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){d&&pt(d),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;y(t,"mouseup",this._disableDelayedDrag),y(t,"touchend",this._disableDelayedDrag),y(t,"touchcancel",this._disableDelayedDrag),y(t,"mousemove",this._delayedDragTouchMoveHandler),y(t,"touchmove",this._delayedDragTouchMoveHandler),y(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,i){i=i||t.pointerType=="touch"&&t,!this.nativeDraggable||i?this.options.supportPointer?E(document,"pointermove",this._onTouchMove):i?E(document,"touchmove",this._onTouchMove):E(document,"mousemove",this._onTouchMove):(E(d,"dragend",this),E(S,"dragstart",this._onDragStart));try{document.selection?Ze(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,i){if(be=!1,S&&d){z("dragStarted",this,{evt:i}),this.nativeDraggable&&E(document,"dragover",Rn);var n=this.options;!t&&H(d,n.dragClass,!1),H(d,n.ghostClass,!0),g.active=this,t&&this._appendGhost(),F({sortable:this,name:"start",originalEvent:i})}else this._nulling()},_emulateDragOver:function(){if(W){this._lastX=W.clientX,this._lastY=W.clientY,Bi();for(var t=document.elementFromPoint(W.clientX,W.clientY),i=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(W.clientX,W.clientY),t!==i);)i=t;if(d.parentNode[V]._isOutsideThisEl(t),i)do{if(i[V]){var n=void 0;if(n=i[V]._onDragOver({clientX:W.clientX,clientY:W.clientY,target:t,rootEl:i}),n&&!this.options.dragoverBubble)break}t=i}while(i=i.parentNode);Ri()}},_onTouchMove:function(t){if(ue){var i=this.options,n=i.fallbackTolerance,a=i.fallbackOffset,r=t.touches?t.touches[0]:t,o=b&&we(b,!0),s=b&&o&&o.a,l=b&&o&&o.d,c=Xe&&L&&Qt(L),h=(r.clientX-ue.clientX+a.x)/(s||1)+(c?c[0]-ft[0]:0)/(s||1),u=(r.clientY-ue.clientY+a.y)/(l||1)+(c?c[1]-ft[1]:0)/(l||1);if(!g.active&&!be){if(n&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))=0&&(F({rootEl:D,name:"add",toEl:D,fromEl:S,originalEvent:t}),F({sortable:this,name:"remove",toEl:D,originalEvent:t}),F({rootEl:D,name:"sort",toEl:D,fromEl:S,originalEvent:t}),F({sortable:this,name:"sort",toEl:D,originalEvent:t})),A&&A.save()):M!==ye&&M>=0&&(F({sortable:this,name:"update",toEl:D,originalEvent:t}),F({sortable:this,name:"sort",toEl:D,originalEvent:t})),g.active&&((M==null||M===-1)&&(M=ye,ne=ze),F({sortable:this,name:"end",toEl:D,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){z("nulling",this),S=d=D=b=fe=C=qe=ae=ue=W=Ae=M=ne=ye=ze=me=Pe=A=Ue=g.dragged=g.ghost=g.clone=g.active=null,it.forEach(function(t){t.checked=!0}),it.length=dt=ht=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":d&&(this._onDragOver(t),Wn(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],i,n=this.el.children,a=0,r=n.length,o=this.options;an.right+a||e.clientX<=n.right&&e.clientY>n.bottom&&e.clientX>=n.left:e.clientX>n.right&&e.clientY>n.top||e.clientX<=n.right&&e.clientY>n.bottom+a}function Yn(e,t,i,n,a,r,o,s){var l=n?e.clientY:e.clientX,c=n?i.height:i.width,h=n?i.top:i.left,u=n?i.bottom:i.right,p=!1;if(!o){if(s&&Geh+c*r/2:lu-Ge)return-Pe}else if(l>h+c*(1-a)/2&&lu-c*r/2)?l>h+c/2?1:-1:0}function Kn(e){return j(d)e.canPull({toEl:r.el,fromEl:o.el,dragEl:s})},...!!e.canPut&&{put:(r,o,s)=>e.canPut({toEl:r.el,fromEl:o.el,dragEl:s})}}},handle:n,onStart:r=>{Jn(e),e.onDragStart(r)},onEnd:r=>{ea(e),e.onDragEnd(r)},onSort:r=>{e.onDragSort(r)}})}function Ui(e){var t;Vt.delete(e),!st.has(e)&&((t=e.sortable)==null||t.destroy(),e.sortable=null)}function $i(e){return Array.from(Vt).filter(t=>t!==e&&cn(e.el,t.el))}function Jn(e){$i(e).forEach(t=>st.add(t))}function ea(e){$i(e).forEach(t=>st.delete(t))}/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const ge={container:"container",actionsStart:"actions-start",contentStart:"content-start",content:"content",contentEnd:"content-end",actionsEnd:"actions-end"},Ee={actionsStart:"actions-start",contentStart:"content-start",contentEnd:"content-end",actionsEnd:"actions-end"},ta=":host([disabled]) .content{cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) .content *,:host([disabled]) .content ::slotted(*){pointer-events:none}:host{display:flex;flex:1 1 0%;flex-direction:column}.container{display:flex;flex:1 1 auto;align-items:stretch;font-family:var(--calcite-sans-family);font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2)}.content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;font-size:var(--calcite-font-size--2);line-height:1.375;padding-inline:var(--calcite-stack-padding-inline, 0.75rem);padding-block:var(--calcite-stack-padding-block, 0.5rem)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:0 1 auto}.actions-start,.actions-end,.content-start,.content-end{display:flex;align-items:center}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.actions-start ::slotted(calcite-action),.actions-end ::slotted(calcite-action){align-self:stretch;color:inherit}:host([hidden]){display:none}[hidden]{display:none}",ia=Ve(class extends je{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.handleActionsStartSlotChange=e=>{this.hasActionsStart=ve(e)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=ve(e)},this.handleContentStartSlotChange=e=>{this.hasContentStart=ve(e)},this.handleContentEndSlotChange=e=>{this.hasContentEnd=ve(e)},this.disabled=!1,this.hasActionsStart=!1,this.hasActionsEnd=!1,this.hasContentStart=!1,this.hasContentEnd=!1}renderActionsStart(){const{hasActionsStart:e}=this;return f("div",{class:ge.actionsStart,hidden:!e,key:"actions-start-container"},f("slot",{name:Ee.actionsStart,onSlotchange:this.handleActionsStartSlotChange}))}renderActionsEnd(){const{hasActionsEnd:e}=this;return f("div",{class:ge.actionsEnd,hidden:!e,key:"actions-end-container"},f("slot",{name:Ee.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}))}renderContentStart(){const{hasContentStart:e}=this;return f("div",{class:ge.contentStart,hidden:!e},f("slot",{name:Ee.contentStart,onSlotchange:this.handleContentStartSlotChange}))}renderDefaultContent(){return f("div",{class:ge.content},f("slot",null))}renderContentEnd(){const{hasContentEnd:e}=this;return f("div",{class:ge.contentEnd,hidden:!e},f("slot",{name:Ee.contentEnd,onSlotchange:this.handleContentEndSlotChange}))}render(){return f(vi,null,f("div",{class:ge.container},this.renderActionsStart(),this.renderContentStart(),this.renderDefaultContent(),this.renderContentEnd(),this.renderActionsEnd()))}static get style(){return ta}},[1,"calcite-stack",{disabled:[516],hasActionsStart:[32],hasActionsEnd:[32],hasContentStart:[32],hasContentEnd:[32]}]);function Xi(){if(typeof customElements>"u")return;["calcite-stack"].forEach(t=>{switch(t){case"calcite-stack":customElements.get(t)||customElements.define(t,ia);break}})}Xi();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */function na(e,t){for(var i=-1,n=e==null?0:e.length,a=Array(n);++i-1&&e%1==0&&e-1&&e%1==0&&e<=pa}function ma(e){return e!=null&&qi(e.length)&&!ua(e)}var ga=Object.prototype;function ba(e){var t=e&&e.constructor,i=typeof t=="function"&&t.prototype||ga;return e===i}function va(e,t){for(var i=-1,n=Array(e);++i{const i=pr(t),n=new RegExp(i,"i");e.length===0&&console.warn(`No data was passed to the filter function. + The data argument should be an array of objects`);const a=(o,s)=>{if(o!=null&&o.constant||o!=null&&o.filterDisabled)return!0;let l=!1;return mr(o,c=>{typeof c=="function"||c==null||(Array.isArray(c)||typeof c=="object"&&c!==null?a(c,s)&&(l=!0):s.test(c)&&(l=!0))}),l};return e.filter(o=>a(o,n))};/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */(function(e){if(typeof e.requestSubmit=="function")return;e.requestSubmit=function(n){n?(t(n,this),n.click()):(n=document.createElement("input"),n.type="submit",n.hidden=!0,this.appendChild(n),n.click(),this.removeChild(n))};function t(n,a){n instanceof HTMLElement||i(TypeError,"parameter 1 is not of type 'HTMLElement'"),n.type=="submit"||i(TypeError,"The specified element is not a submit button"),n.form==a||i(DOMException,"The specified element is not owned by this form element","NotFoundError")}function i(n,a,r){throw new n("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+a+".",r)}})(HTMLFormElement.prototype);const It="hidden-form-input";function jt(e){return"checked"in e}const St=new WeakMap,Bt=new WeakSet;function gr(e,t){if(Dt(t.parentElement,"[form]"))return!0;const n="calciteInternalFormComponentRegister";let a=!1;return e.addEventListener(n,r=>{a=r.composedPath().some(o=>Bt.has(o)),r.stopPropagation()},{once:!0}),t.dispatchEvent(new CustomEvent(n,{bubbles:!0,composed:!0})),a}function br(e){const{formEl:t}=e;return t?(t.requestSubmit(),!0):!1}function vr(e){const{el:t,value:i}=e,n=yr(e);if(!n||gr(n,t))return;e.formEl=n,e.defaultValue=i,jt(e)&&(e.defaultChecked=e.checked);const a=(e.onFormReset||Er).bind(e);n.addEventListener("reset",a),St.set(e.el,a),Bt.add(t)}function yr(e){const{el:t,form:i}=e;return i?yi(t,{id:i}):Dt(t,"form")}function Er(){if(jt(this)){this.checked=this.defaultChecked;return}this.value=this.defaultValue}function wr(e){const{el:t,formEl:i}=e;if(!i)return;const n=St.get(t);i.removeEventListener("reset",n),St.delete(t),e.formEl=null,Bt.delete(t)}const en=e=>{e.target.dispatchEvent(new CustomEvent("calciteInternalHiddenInputChange",{bubbles:!0}))},di=e=>e.removeEventListener("change",en);function xr(e){const{el:t,formEl:i,name:n,value:a}=e,{ownerDocument:r}=t,o=t.querySelectorAll(`input[slot="${It}"]`);if(!i||!n){o.forEach(u=>{di(u),u.remove()});return}const s=Array.isArray(a)?a:[a],l=[],c=new Set;o.forEach(u=>{const p=s.find(w=>w==u.value);p!=null?(c.add(p),hi(e,u,p)):l.push(u)});let h;s.forEach(u=>{if(c.has(u))return;let p=l.pop();p||(p=r.createElement("input"),p.slot=It),h||(h=r.createDocumentFragment()),h.append(p),p.addEventListener("change",en),hi(e,p,u)}),h&&t.append(h),l.forEach(u=>{di(u),u.remove()})}function hi(e,t,i){var l;const{defaultValue:n,disabled:a,form:r,name:o,required:s}=e;t.defaultValue=n,t.disabled=a,t.name=o,t.required=s,t.tabIndex=-1,r?t.setAttribute("form",r):t.removeAttribute("form"),jt(e)?(t.checked=e.checked,t.defaultChecked=e.defaultChecked,t.value=e.checked?i||"on":""):t.value=i||"",(l=e.syncHiddenFormInput)==null||l.call(e,t)}const Ir=({component:e})=>(xr(e),f("slot",{name:It}));/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const tn="calciteInternalLabelClick",Rt="calciteInternalLabelConnected",Ct="calciteInternalLabelDisconnected",fi="calcite-label",at=new WeakMap,Me=new WeakMap,rt=new WeakMap,xe=new Set,Sr=e=>{const{id:t}=e,i=t&&yi(e,{selector:`${fi}[for="${t}"]`});if(i)return i;const n=Dt(e,fi);return!n||Cr(n,e)?null:n};function Cr(e,t){let i;const n="custom-element-ancestor-check",a=o=>{o.stopImmediatePropagation();const s=o.composedPath();i=s.slice(s.indexOf(t),s.indexOf(e))};return e.addEventListener(n,a,{once:!0}),t.dispatchEvent(new CustomEvent(n,{composed:!0,bubbles:!0})),e.removeEventListener(n,a),i.filter(o=>o!==t&&o!==e).filter(o=>{var s;return(s=o.tagName)==null?void 0:s.includes("-")}).length>0}function nn(e){const t=Sr(e.el);if(at.has(t)||!t&&xe.has(e))return;const i=Ar.bind(e);if(t){e.labelEl=t;const n=kr.bind(e);at.set(e.labelEl,n),e.labelEl.addEventListener(tn,n),xe.delete(e),document.removeEventListener(Rt,Me.get(e)),rt.set(e,i),document.addEventListener(Ct,i)}else xe.has(e)||(i(),document.removeEventListener(Ct,rt.get(e)))}function Dr(e){if(xe.delete(e),document.removeEventListener(Rt,Me.get(e)),document.removeEventListener(Ct,rt.get(e)),Me.delete(e),rt.delete(e),!e.labelEl)return;const t=at.get(e.labelEl);e.labelEl.removeEventListener(tn,t),at.delete(e.labelEl)}function pi(e){var t,i;return e.label||((i=(t=e.labelEl)==null?void 0:t.textContent)==null?void 0:i.trim())||""}function kr(e){this.disabled||this.el.contains(e.detail.sourceEvent.target)||this.onLabelClick(e)}function Tr(){xe.has(this)&&nn(this)}function Ar(){xe.add(this);const e=Me.get(this)||Tr.bind(this);Me.set(this,e),document.addEventListener(Rt,e)}/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const Lr=":host{position:relative;display:block;inline-size:100%}.track,.bar{position:absolute;inset-block-start:0px;block-size:2px}.track{z-index:var(--calcite-app-z-index);inline-size:100%;overflow:hidden;background:var(--calcite-ui-border-3)}.bar{z-index:var(--calcite-app-z-index);background-color:var(--calcite-ui-brand)}@media (forced-colors: active){.track{background-color:highlightText}.bar{background-color:linkText}}.indeterminate{inline-size:20%;animation:looping-progress-bar-ani calc(var(--calcite-internal-animation-timing-medium) / var(--calcite-internal-duration-factor) * 11 / var(--calcite-internal-duration-factor)) linear infinite}.indeterminate.calcite--rtl{animation-name:looping-progress-bar-ani-rtl}.reversed{animation-direction:reverse}.text{padding-inline:0px;padding-block:1rem 0px;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2)}@keyframes looping-progress-bar-ani{0%{transform:translate3d(-100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(600%, 0, 0)}}@keyframes looping-progress-bar-ani-rtl{0%{transform:translate3d(100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(-600%, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}",_r=Ve(class extends je{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.type="determinate",this.value=0,this.label=void 0,this.text=void 0,this.reversed=!1}render(){const t=this.type==="determinate"?{width:`${this.value*100}%`}:{},i=Ei(this.el);return f("div",{"aria-label":this.label||this.text,"aria-valuemax":1,"aria-valuemin":0,"aria-valuenow":this.value,role:"progressbar"},f("div",{class:"track"},f("div",{class:{bar:!0,indeterminate:this.type==="indeterminate",[wi.rtl]:i==="rtl",reversed:this.reversed},style:t})),this.text?f("div",{class:"text"},this.text):null)}get el(){return this}static get style(){return Lr}},[1,"calcite-progress",{type:[513],value:[2],label:[1],text:[1],reversed:[516]}]);function lt(){if(typeof customElements>"u")return;["calcite-progress"].forEach(t=>{switch(t){case"calcite-progress":customElements.get(t)||customElements.define(t,_r);break}})}lt();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const _={loader:"loader",clearButton:"clear-button",editingEnabled:"editing-enabled",inlineChild:"inline-child",inputIcon:"icon",prefix:"prefix",suffix:"suffix",numberButtonWrapper:"number-button-wrapper",buttonItemHorizontal:"number-button-item--horizontal",wrapper:"element-wrapper",inputWrapper:"wrapper",actionWrapper:"action-wrapper",resizeIconWrapper:"resize-icon-wrapper",numberButtonItem:"number-button-item"},mi={tel:"phone",password:"lock",email:"email-address",date:"calendar",time:"clock",search:"search"},Or={action:"action"},Fr=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]) input,:host([scale=s]) .prefix,:host([scale=s]) .suffix{block-size:1.5rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) textarea{block-size:1.5rem;min-block-size:1.5rem}:host([scale=s]) .number-button-wrapper,:host([scale=s]) .action-wrapper calcite-button,:host([scale=s]) .action-wrapper calcite-button button{block-size:1.5rem}:host([scale=s]) input[type=file]{block-size:1.5rem}:host([scale=s]) .clear-button{min-block-size:1.5rem;min-inline-size:1.5rem}:host([scale=s]) textarea{block-size:auto;padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]) input,:host([scale=m]) .prefix,:host([scale=m]) .suffix{block-size:2rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) textarea{min-block-size:2rem}:host([scale=m]) .number-button-wrapper,:host([scale=m]) .action-wrapper calcite-button,:host([scale=m]) .action-wrapper calcite-button button{block-size:2rem}:host([scale=m]) input[type=file]{block-size:2rem}:host([scale=m]) .clear-button{min-block-size:2rem;min-inline-size:2rem}:host([scale=m]) textarea{block-size:auto;padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) input,:host([scale=l]) .prefix,:host([scale=l]) .suffix{block-size:2.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) textarea{min-block-size:2.75rem}:host([scale=l]) .number-button-wrapper,:host([scale=l]) .action-wrapper calcite-button,:host([scale=l]) .action-wrapper calcite-button button{block-size:2.75rem}:host([scale=l]) input[type=file]{block-size:2.75rem}:host([scale=l]) .clear-button{min-block-size:2.75rem;min-inline-size:2.75rem}:host([scale=l]) textarea{block-size:auto;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([disabled]) textarea{resize:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host textarea,:host input{transition:var(--calcite-animation-timing), block-size 0, outline-offset 0s;-webkit-appearance:none;position:relative;margin:0px;box-sizing:border-box;display:flex;max-block-size:100%;inline-size:100%;max-inline-size:100%;flex:1 1 0%;border-radius:0px;background-color:var(--calcite-ui-foreground-1);font-family:inherit;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-1)}:host input[type=search]::-webkit-search-decoration{-webkit-appearance:none}:host input,:host textarea{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);color:var(--calcite-ui-text-1)}:host input::placeholder,:host input:-ms-input-placeholder,:host input::-ms-input-placeholder,:host textarea::placeholder,:host textarea:-ms-input-placeholder,:host textarea::-ms-input-placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}:host input:focus,:host textarea:focus{border-color:var(--calcite-ui-brand);color:var(--calcite-ui-text-1)}:host input[readonly],:host textarea[readonly]{background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium)}:host input[readonly]:focus,:host textarea[readonly]:focus{color:var(--calcite-ui-text-1)}:host calcite-icon{color:var(--calcite-ui-text-3)}:host textarea,:host input{outline-color:transparent}:host textarea:focus,:host input:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}:host([status=invalid]) input,:host([status=invalid]) textarea{border-color:var(--calcite-ui-danger)}:host([status=invalid]) input:focus,:host([status=invalid]) textarea:focus{outline:2px solid var(--calcite-ui-danger);outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}:host([scale=s]) .icon{inset-inline-start:0.5rem}:host([scale=m]) .icon{inset-inline-start:0.75rem}:host([scale=l]) .icon{inset-inline-start:1rem}:host([icon][scale=s]) input{padding-inline-start:2rem}:host([icon][scale=m]) input{padding-inline-start:2.5rem}:host([icon][scale=l]) input{padding-inline-start:3.5rem}.element-wrapper{position:relative;order:3;display:inline-flex;flex:1 1 0%;align-items:center}.icon{pointer-events:none;position:absolute;display:block;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.icon,.resize-icon-wrapper{z-index:var(--calcite-app-z-index)}input[type=text]::-ms-clear,input[type=text]::-ms-reveal{display:none;block-size:0px;inline-size:0px}input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration,input[type=date]::-webkit-clear-button,input[type=time]::-webkit-clear-button{display:none}.clear-button{pointer-events:initial;order:4;margin:0px;box-sizing:border-box;display:flex;min-block-size:100%;cursor:pointer;align-items:center;justify-content:center;align-self:stretch;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);outline-color:transparent;border-inline-start-width:0px}.clear-button:hover{background-color:var(--calcite-ui-foreground-2);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:hover calcite-icon{color:var(--calcite-ui-text-1);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:active{background-color:var(--calcite-ui-foreground-3)}.clear-button:active calcite-icon{color:var(--calcite-ui-text-1)}.clear-button:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}.clear-button:disabled{opacity:var(--calcite-ui-opacity-disabled)}.loader{inset-block-start:1px;inset-inline:1px;pointer-events:none;position:absolute;display:block}.action-wrapper{order:7;display:flex}.prefix,.suffix{box-sizing:border-box;display:flex;block-size:auto;min-block-size:100%;-webkit-user-select:none;user-select:none;align-content:center;align-items:center;overflow-wrap:break-word;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium);line-height:1;color:var(--calcite-ui-text-2)}.prefix{order:2;border-inline-end-width:0px}.suffix{order:5;border-inline-start-width:0px}:host([alignment=start]) textarea,:host([alignment=start]) input{text-align:start}:host([alignment=end]) textarea,:host([alignment=end]) input{text-align:end}:host input[type=number]{-moz-appearance:textfield}:host input[type=number]::-webkit-inner-spin-button,:host input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:textfield;margin:0px}.number-button-wrapper{pointer-events:none;order:6;box-sizing:border-box;display:flex;flex-direction:column;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([number-button-type=vertical]) .wrapper{flex-direction:row;display:flex}:host([number-button-type=vertical]) input,:host([number-button-type=vertical]) textarea{order:2}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=down] calcite-icon{transform:rotate(-90deg)}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=up] calcite-icon{transform:rotate(-90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down],.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:1;max-block-size:100%;min-block-size:100%;align-self:stretch}.number-button-item.number-button-item--horizontal[data-adjustment=down] calcite-icon,.number-button-item.number-button-item--horizontal[data-adjustment=up] calcite-icon{transform:rotate(90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down]{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);border-inline-end-width:0px}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover{background-color:var(--calcite-ui-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover calcite-icon{color:var(--calcite-ui-text-1)}.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:5}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover{background-color:var(--calcite-ui-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover{background-color:var(--calcite-ui-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover{background-color:var(--calcite-ui-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]{border-block-start-width:0px}.number-button-item{max-block-size:50%;min-block-size:50%;pointer-events:initial;margin:0px;box-sizing:border-box;display:flex;cursor:pointer;align-items:center;align-self:center;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);padding-block:0px;padding-inline:0.5rem;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-inline-start-width:0px}.number-button-item calcite-icon{pointer-events:none;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.number-button-item:focus{background-color:var(--calcite-ui-foreground-2)}.number-button-item:focus calcite-icon{color:var(--calcite-ui-text-1)}.number-button-item:active{background-color:var(--calcite-ui-foreground-3)}.number-button-item:disabled{pointer-events:none}.wrapper{position:relative;display:flex;flex-direction:row;align-items:center}:host input::-webkit-calendar-picker-indicator{display:none}:host input[type=date]::-webkit-input-placeholder{visibility:hidden !important}:host textarea::-webkit-resizer{position:absolute;inset-block-end:0px;box-sizing:border-box;padding-block:0px;padding-inline:0.25rem;inset-inline-end:0}.resize-icon-wrapper{inset-block-end:2px;inset-inline-end:2px;pointer-events:none;position:absolute;block-size:0.75rem;inline-size:0.75rem;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-3)}.resize-icon-wrapper calcite-icon{inset-block-end:0.25rem;inset-inline-end:0.25rem;transform:rotate(-45deg)}.calcite--rtl .resize-icon-wrapper calcite-icon{transform:rotate(45deg)}:host([type=color]) input{padding:0.25rem}:host([type=file]) input{cursor:pointer;border-width:1px;border-style:dashed;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);text-align:center}:host([type=file][scale=s]) input{padding-block:1px;padding-inline:0.5rem}:host([type=file][scale=m]) input{padding-block:0.25rem;padding-inline:0.75rem}:host([type=file][scale=l]) input{padding-block:0.5rem;padding-inline:1rem}:host(.no-bottom-border) input{border-block-end-width:0px}:host(.border-top-color-one) input{border-block-start-color:var(--calcite-ui-border-1)}:host .inline-child{background-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host .inline-child .editing-enabled{background-color:inherit}:host .inline-child:not(.editing-enabled){display:flex;cursor:pointer;text-overflow:ellipsis;border-color:transparent;padding-inline-start:0}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}:host([hidden]){display:none}[hidden]{display:none}`,zr=Ve(class extends je{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalInputFocus=Z(this,"calciteInternalInputFocus",6),this.calciteInternalInputBlur=Z(this,"calciteInternalInputBlur",6),this.calciteInputInput=Z(this,"calciteInputInput",7),this.calciteInputChange=Z(this,"calciteInputChange",6),this.childElType="input",this.previousValueOrigin="initial",this.mutationObserver=xi("mutation",()=>this.setDisabledAction()),this.userChangedValue=!1,this.keyDownHandler=e=>{this.readOnly||this.disabled||(this.isClearable&&e.key==="Escape"&&(this.clearInputValue(e),e.preventDefault()),e.key==="Enter"&&!e.defaultPrevented&&br(this)&&e.preventDefault())},this.clearInputValue=e=>{this.setValue({committing:!0,nativeEvent:e,origin:"user",value:""})},this.emitChangeIfUserModified=()=>{this.previousValueOrigin==="user"&&this.value!==this.previousEmittedValue&&(this.calciteInputChange.emit(),this.setPreviousEmittedValue(this.value))},this.inputBlurHandler=()=>{this.calciteInternalInputBlur.emit(),this.emitChangeIfUserModified()},this.clickHandler=e=>{if(this.disabled)return;const t=$t(this.el,"action");e.target!==t&&this.setFocus()},this.inputFocusHandler=()=>{this.calciteInternalInputFocus.emit()},this.inputChangeHandler=()=>{this.type==="file"&&(this.files=this.childEl.files)},this.inputInputHandler=e=>{this.disabled||this.readOnly||this.setValue({nativeEvent:e,origin:"user",value:e.target.value})},this.inputKeyDownHandler=e=>{this.disabled||this.readOnly||e.key==="Enter"&&this.emitChangeIfUserModified()},this.inputNumberInputHandler=e=>{if(this.disabled||this.readOnly)return;const t=e.target.value;$.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator};const i=$.delocalize(t);e.inputType==="insertFromPaste"?(ce(i)||e.preventDefault(),this.setValue({nativeEvent:e,origin:"user",value:En(i)}),this.childNumberEl.value=this.localizedValue):this.setValue({nativeEvent:e,origin:"user",value:i})},this.inputNumberKeyDownHandler=e=>{if(this.type!=="number"||this.disabled||this.readOnly)return;if(e.key==="ArrowUp"){e.preventDefault(),this.nudgeNumberValue("up",e);return}if(e.key==="ArrowDown"){this.nudgeNumberValue("down",e);return}const t=[...Sn,"ArrowLeft","ArrowRight","Backspace","Delete","Enter","Escape","Tab"];if(e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&e.key==="Tab";if(t.includes(e.key)||i){e.key==="Enter"&&this.emitChangeIfUserModified();return}$.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},!(e.key===$.decimal&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.indexOf($.decimal)===-1))&&(/[eE]/.test(e.key)&&(!this.value&&!this.childNumberEl.value||this.value&&!/[eE]/.test(this.childNumberEl.value))||e.key==="-"&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.split("-").length<=2)||e.preventDefault())},this.nudgeNumberValue=(e,t)=>{if(t instanceof KeyboardEvent&&t.repeat||this.type!=="number")return;const i=this.maxString?parseFloat(this.maxString):null,n=this.minString?parseFloat(this.minString):null,a=150;this.incrementOrDecrementNumberValue(e,i,n,t),this.nudgeNumberValueIntervalId&&window.clearInterval(this.nudgeNumberValueIntervalId);let r=!0;this.nudgeNumberValueIntervalId=window.setInterval(()=>{if(r){r=!1;return}this.incrementOrDecrementNumberValue(e,i,n,t)},a)},this.numberButtonPointerUpAndOutHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.numberButtonPointerDownHandler=e=>{if(!un(e))return;e.preventDefault();const t=e.target.dataset.adjustment;this.disabled||this.nudgeNumberValue(t,e)},this.hiddenInputChangeHandler=e=>{e.target.name===this.name&&this.setValue({value:e.target.value,origin:"direct"}),e.stopPropagation()},this.setChildElRef=e=>{this.childEl=e},this.setChildNumberElRef=e=>{this.childNumberEl=e},this.setInputValue=e=>{this.type==="text"&&!this.childEl||this.type==="number"&&!this.childNumberEl||(this[`child${this.type==="number"?"Number":""}El`].value=e)},this.setPreviousEmittedValue=e=>{this.previousEmittedValue=this.normalizeValue(e)},this.setPreviousValue=e=>{this.previousValue=this.normalizeValue(e)},this.setValue=({committing:e=!1,nativeEvent:t,origin:i,previousValue:n,value:a})=>{var r,o;if(this.setPreviousValue(n??this.value),this.previousValueOrigin=i,this.type==="number"){$.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator,signDisplay:"never"};const s=((r=this.previousValue)==null?void 0:r.length)>a.length||((o=this.value)==null?void 0:o.length)>a.length,l=a.charAt(a.length-1)===".",c=l&&s?a:wn(a),h=a&&!c?ce(this.previousValue)?this.previousValue:"":c;let u=$.localize(h);i!=="connected"&&!l&&(u=xn(u,h,$)),this.localizedValue=l&&s?`${u}${$.decimal}`:u,this.userChangedValue=i==="user"&&this.value!==h,this.value=["-","."].includes(h)?"":h}else this.userChangedValue=i==="user"&&this.value!==a,this.value=a;i==="direct"&&(this.setInputValue(a),this.previousEmittedValue=a),t&&(this.calciteInputInput.emit().defaultPrevented?(this.value=this.previousValue,this.localizedValue=this.type==="number"?$.localize(this.previousValue):this.previousValue):e&&this.emitChangeIfUserModified())},this.inputKeyUpHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.alignment="start",this.autofocus=!1,this.clearable=!1,this.disabled=!1,this.form=void 0,this.groupSeparator=!1,this.hidden=!1,this.icon=void 0,this.iconFlipRtl=!1,this.label=void 0,this.loading=!1,this.numberingSystem=void 0,this.localeFormat=!1,this.max=void 0,this.min=void 0,this.maxLength=void 0,this.minLength=void 0,this.name=void 0,this.numberButtonType="vertical",this.placeholder=void 0,this.prefixText=void 0,this.readOnly=!1,this.required=!1,this.scale="m",this.status="idle",this.step=void 0,this.autocomplete=void 0,this.pattern=void 0,this.accept=void 0,this.multiple=!1,this.inputMode="text",this.enterKeyHint=void 0,this.suffixText=void 0,this.editingEnabled=!1,this.type="text",this.value="",this.files=void 0,this.messages=void 0,this.messageOverrides=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.localizedValue=void 0,this.slottedActionElDisabledInternally=!1}disabledWatcher(){this.setDisabledAction()}maxWatcher(){var e;this.maxString=((e=this.max)==null?void 0:e.toString())||null}minWatcher(){var e;this.minString=((e=this.min)==null?void 0:e.toString())||null}onMessagesChange(){}valueWatcher(e,t){this.userChangedValue||(this.setValue({origin:"direct",previousValue:t,value:e==null||e==""?"":this.type==="number"?ce(e)?e:this.previousValue||"":e}),this.warnAboutInvalidNumberValue(e)),this.userChangedValue=!1}updateRequestedIcon(){this.requestedIcon=Xt(mi,this.icon,this.type)}get isClearable(){var e;return!this.isTextarea&&(this.clearable||this.type==="search")&&((e=this.value)==null?void 0:e.length)>0}get isTextarea(){return this.childElType==="textarea"}effectiveLocaleChange(){Ci(this,this.effectiveLocale)}connectedCallback(){var e;kt(this),Di(this),ki(this),this.inlineEditableEl=this.el.closest("calcite-inline-editable"),this.inlineEditableEl&&(this.editingEnabled=this.inlineEditableEl.editingEnabled||!1),nn(this),vr(this),this.setPreviousEmittedValue(this.value),this.setPreviousValue(this.value),this.type==="number"&&(this.warnAboutInvalidNumberValue(this.value),this.setValue({origin:"connected",value:ce(this.value)?this.value:""})),(e=this.mutationObserver)==null||e.observe(this.el,{childList:!0}),this.setDisabledAction(),this.el.addEventListener("calciteInternalHiddenInputChange",this.hiddenInputChangeHandler)}disconnectedCallback(){var e;Tt(this),Dr(this),wr(this),Ti(this),Ai(this),(e=this.mutationObserver)==null||e.disconnect(),this.el.removeEventListener("calciteInternalHiddenInputChange",this.hiddenInputChangeHandler)}async componentWillLoad(){var e,t;Lt(this),this.childElType=this.type==="textarea"?"textarea":"input",this.maxString=(e=this.max)==null?void 0:e.toString(),this.minString=(t=this.min)==null?void 0:t.toString(),this.requestedIcon=Xt(mi,this.icon,this.type),await Li(this)}componentDidLoad(){_t(this)}componentShouldUpdate(e,t,i){return this.type==="number"&&i==="value"&&e&&!ce(e)?(this.setValue({origin:"reset",value:t}),!1):!0}componentDidRender(){At(this)}async setFocus(){var e,t;await Ot(this),this.type==="number"?(e=this.childNumberEl)==null||e.focus():(t=this.childEl)==null||t.focus()}async selectText(){var e,t;this.type==="number"?(e=this.childNumberEl)==null||e.select():(t=this.childEl)==null||t.select()}onLabelClick(){this.setFocus()}incrementOrDecrementNumberValue(e,t,i,n){const{value:a}=this,r=e==="up"?1:-1,o=this.step==="any"?1:Math.abs(this.step||1),l=new In(a!==""?a:"0").add(`${o*r}`),c=()=>typeof i=="number"&&!isNaN(i)&&l.subtract(`${i}`).isNegative,h=()=>typeof t=="number"&&!isNaN(t)&&!l.subtract(`${t}`).isNegative,u=c()?`${i}`:h()?`${t}`:l.toString();this.setValue({committing:!0,nativeEvent:n,origin:"user",value:u})}onFormReset(){this.setValue({origin:"reset",value:this.defaultValue})}syncHiddenFormInput(e){var i,n;const{type:t}=this;e.type=t,t==="number"?(e.min=((i=this.min)==null?void 0:i.toString(10))??"",e.max=((n=this.max)==null?void 0:n.toString(10))??""):t==="text"&&(this.minLength!=null&&(e.minLength=this.minLength),this.maxLength!=null&&(e.maxLength=this.maxLength))}setDisabledAction(){const e=$t(this.el,"action");e&&(this.disabled?(e.getAttribute("disabled")==null&&(this.slottedActionElDisabledInternally=!0),e.setAttribute("disabled","")):this.slottedActionElDisabledInternally&&(e.removeAttribute("disabled"),this.slottedActionElDisabledInternally=!1))}normalizeValue(e){return this.type==="number"?ce(e)?e:"":e}warnAboutInvalidNumberValue(e){this.type==="number"&&e&&!ce(e)&&console.warn(`The specified value "${e}" cannot be parsed, or is out of range.`)}render(){const e=Ei(this.el),t=f("div",{class:_.loader},f("calcite-progress",{label:this.messages.loading,type:"indeterminate"})),i=f("button",{"aria-label":this.messages.clear,class:_.clearButton,disabled:this.disabled||this.readOnly,onClick:this.clearInputValue,tabIndex:-1,type:"button"},f("calcite-icon",{icon:"x",scale:this.scale==="l"?"m":"s"})),n=f("calcite-icon",{class:_.inputIcon,flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:this.scale==="l"?"m":"s"}),a=this.numberButtonType==="horizontal",r=f("button",{"aria-hidden":"true",class:{[_.numberButtonItem]:!0,[_.buttonItemHorizontal]:a},"data-adjustment":"up",disabled:this.disabled||this.readOnly,onPointerDown:this.numberButtonPointerDownHandler,onPointerOut:this.numberButtonPointerUpAndOutHandler,onPointerUp:this.numberButtonPointerUpAndOutHandler,tabIndex:-1,type:"button"},f("calcite-icon",{icon:"chevron-up",scale:this.scale==="l"?"m":"s"})),o=f("button",{"aria-hidden":"true",class:{[_.numberButtonItem]:!0,[_.buttonItemHorizontal]:a},"data-adjustment":"down",disabled:this.disabled||this.readOnly,onPointerDown:this.numberButtonPointerDownHandler,onPointerOut:this.numberButtonPointerUpAndOutHandler,onPointerUp:this.numberButtonPointerUpAndOutHandler,tabIndex:-1,type:"button"},f("calcite-icon",{icon:"chevron-down",scale:this.scale==="l"?"m":"s"})),s=f("div",{class:_.numberButtonWrapper},r,o),l=f("div",{class:_.prefix},this.prefixText),c=f("div",{class:_.suffix},this.suffixText),h=this.type==="number"?f("input",{accept:this.accept,"aria-label":pi(this),autocomplete:this.autocomplete,autofocus:this.autofocus?!0:null,defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:this.enterKeyHint,inputMode:this.inputMode,key:"localized-input",maxLength:this.maxLength,minLength:this.minLength,multiple:this.multiple,name:void 0,onBlur:this.inputBlurHandler,onFocus:this.inputFocusHandler,onInput:this.inputNumberInputHandler,onKeyDown:this.inputNumberKeyDownHandler,onKeyUp:this.inputKeyUpHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,type:"text",value:this.localizedValue,ref:this.setChildNumberElRef}):null,u=this.type!=="number"?[f(this.childElType,{accept:this.accept,"aria-label":pi(this),autocomplete:this.autocomplete,autofocus:this.autofocus?!0:null,class:{[_.editingEnabled]:this.editingEnabled,[_.inlineChild]:!!this.inlineEditableEl},defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:this.enterKeyHint,inputMode:this.inputMode,max:this.maxString,maxLength:this.maxLength,min:this.minString,minLength:this.minLength,multiple:this.multiple,name:this.name,onBlur:this.inputBlurHandler,onChange:this.inputChangeHandler,onFocus:this.inputFocusHandler,onInput:this.inputInputHandler,onKeyDown:this.inputKeyDownHandler,onKeyUp:this.inputKeyUpHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,required:this.required?!0:null,step:this.step,tabIndex:this.disabled||this.inlineEditableEl&&!this.editingEnabled?-1:null,type:this.type,value:this.value,ref:this.setChildElRef}),this.isTextarea?f("div",{class:_.resizeIconWrapper},f("calcite-icon",{icon:"chevron-down",scale:this.scale==="l"?"m":"s"})):null]:null;return f(vi,{onClick:this.clickHandler,onKeyDown:this.keyDownHandler},f("div",{class:{[_.inputWrapper]:!0,[wi.rtl]:e==="rtl"}},this.type==="number"&&this.numberButtonType==="horizontal"&&!this.readOnly?o:null,this.prefixText?l:null,f("div",{class:_.wrapper},h,u,this.isClearable?i:null,this.requestedIcon?n:null,this.loading?t:null),f("div",{class:_.actionWrapper},f("slot",{name:Or.action})),this.type==="number"&&this.numberButtonType==="vertical"&&!this.readOnly?s:null,this.suffixText?c:null,this.type==="number"&&this.numberButtonType==="horizontal"&&!this.readOnly?r:null,f(Ir,{component:this})))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{disabled:["disabledWatcher"],max:["maxWatcher"],min:["minWatcher"],messageOverrides:["onMessagesChange"],value:["valueWatcher"],icon:["updateRequestedIcon"],type:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Fr}},[1,"calcite-input",{alignment:[513],autofocus:[516],clearable:[516],disabled:[516],form:[513],groupSeparator:[516,"group-separator"],hidden:[516],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],label:[1],loading:[516],numberingSystem:[513,"numbering-system"],localeFormat:[4,"locale-format"],max:[514],min:[514],maxLength:[514,"max-length"],minLength:[514,"min-length"],name:[513],numberButtonType:[513,"number-button-type"],placeholder:[1],prefixText:[1,"prefix-text"],readOnly:[516,"read-only"],required:[516],scale:[513],status:[513],step:[520],autocomplete:[1],pattern:[1],accept:[1],multiple:[4],inputMode:[1,"input-mode"],enterKeyHint:[1,"enter-key-hint"],suffixText:[1,"suffix-text"],editingEnabled:[1540,"editing-enabled"],type:[513],value:[1025],files:[16],messages:[1040],messageOverrides:[1040],defaultMessages:[32],effectiveLocale:[32],localizedValue:[32],slottedActionElDisabledInternally:[32],setFocus:[64],selectText:[64]}]);function Wt(){if(typeof customElements>"u")return;["calcite-input","calcite-icon","calcite-progress"].forEach(t=>{switch(t){case"calcite-input":customElements.get(t)||customElements.define(t,zr);break;case"calcite-icon":customElements.get(t)||Pt();break;case"calcite-progress":customElements.get(t)||lt();break}})}Wt();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const Pr={container:"container",searchIcon:"search-icon"},Nr={search:"search",close:"x"},Hr=250,Mr=":host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;inline-size:100%}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{display:flex;inline-size:100%;padding:0.5rem}label{position:relative;margin-inline:0.25rem;margin-block:0px;display:flex;inline-size:100%;align-items:center;overflow:hidden}input[type=text]{margin-block-end:0.25rem;inline-size:100%;border-style:none;background-color:transparent;padding-block:0.25rem;font-family:inherit;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-ui-text-1);padding-inline-end:0.25rem;padding-inline-start:1.5rem;transition:padding var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing)}input[type=text]::-ms-clear{display:none}calcite-input{inline-size:100%}.search-icon{position:absolute;display:flex;color:var(--calcite-ui-text-2);inset-inline-start:0;transition:inset-inline-start var(--calcite-animation-timing), inset-inline-end var(--calcite-animation-timing), opacity var(--calcite-animation-timing)}input[type=text]:focus{border-color:var(--calcite-ui-brand);outline:2px solid transparent;outline-offset:2px;padding-inline:0.25rem}input[type=text]:focus~.search-icon{inset-inline-start:calc(1rem * -1);opacity:0}.clear-button{display:flex;cursor:pointer;align-items:center;border-width:0px;background-color:transparent;color:var(--calcite-ui-text-2)}.clear-button:hover,.clear-button:focus{color:var(--calcite-ui-text-1)}:host([hidden]){display:none}[hidden]{display:none}",Vr=Ve(class extends je{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFilterChange=Z(this,"calciteFilterChange",6),this.filterDebounced=Si((e,t=!1,i)=>this.updateFiltered(ui(this.items,e),t,i),Hr),this.inputHandler=e=>{const t=e.target;this.value=t.value,this.filterDebounced(t.value,!0)},this.keyDownHandler=e=>{e.key==="Escape"&&(this.clear(),e.preventDefault()),e.key==="Enter"&&e.preventDefault()},this.clear=()=>{this.value="",this.filterDebounced("",!0),this.setFocus()},this.items=[],this.disabled=!1,this.filteredItems=[],this.placeholder=void 0,this.scale="m",this.value="",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}watchItemsHandler(){this.filterDebounced(this.value)}onMessagesChange(){}valueHandler(e){this.filterDebounced(e)}effectiveLocaleChange(){Ci(this,this.effectiveLocale)}async componentWillLoad(){Lt(this),this.updateFiltered(ui(this.items,this.value)),await Li(this)}connectedCallback(){kt(this),Di(this),ki(this)}componentDidRender(){At(this)}disconnectedCallback(){Tt(this),Ti(this),Ai(this),this.filterDebounced.cancel()}componentDidLoad(){_t(this)}async filter(e=this.value){return new Promise(t=>{this.value=e,this.filterDebounced(e,!1,t)})}async setFocus(){var e;await Ot(this),(e=this.el)==null||e.focus()}updateFiltered(e,t=!1,i){this.filteredItems=e,t&&this.calciteFilterChange.emit(),i==null||i()}render(){const{disabled:e,scale:t}=this;return f(dn,null,f("div",{class:Pr.container},f("label",null,f("calcite-input",{"aria-label":this.messages.label,clearable:!0,disabled:e,icon:Nr.search,messageOverrides:{clear:this.messages.clear},onCalciteInputInput:this.inputHandler,onKeyDown:this.keyDownHandler,placeholder:this.placeholder,scale:t,type:"text",value:this.value,ref:i=>{this.textInput=i}}))))}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{items:["watchItemsHandler"],messageOverrides:["onMessagesChange"],value:["valueHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Mr}},[17,"calcite-filter",{items:[16],disabled:[516],filteredItems:[1040],placeholder:[1],scale:[513],value:[1025],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],filter:[64],setFocus:[64]}]);function an(){if(typeof customElements>"u")return;["calcite-filter","calcite-icon","calcite-input","calcite-progress"].forEach(t=>{switch(t){case"calcite-filter":customElements.get(t)||customElements.define(t,Vr);break;case"calcite-icon":customElements.get(t)||Pt();break;case"calcite-input":customElements.get(t)||Wt();break;case"calcite-progress":customElements.get(t)||lt();break}})}an();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const he={container:"container",table:"table",scrim:"scrim",stack:"stack",tableContainer:"table-container",sticky:"sticky-pos",assistiveText:"assistive-text"},jr=0,gi={filterActionsStart:"filter-actions-start",filterActionsEnd:"filter-actions-end"},Br=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{position:relative}.table-container{position:relative;z-index:var(--calcite-app-z-index);box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:transparent}.table-container *{box-sizing:border-box}.table{inline-size:100%;border-collapse:collapse}.stack{--calcite-stack-padding-inline:0;--calcite-stack-padding-block:0}::slotted(calcite-list-item){margin-block-end:1px;--tw-shadow:0 1px 0 var(--calcite-ui-border-3);--tw-shadow-colored:0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}::slotted(calcite-list-item:last-child){--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.sticky-pos{position:sticky;inset-block-start:0px;z-index:var(--calcite-app-z-index-sticky);background-color:var(--calcite-ui-foreground-1)}.sticky-pos th{padding:0px}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}",bi="calcite-list-item",Rr=":scope > calcite-list-item",Wr="calcite-list-item-group, calcite-list-item",rn=Ve(class extends je{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListChange=Z(this,"calciteListChange",6),this.calciteListFilter=Z(this,"calciteListFilter",6),this.calciteListOrderChange=Z(this,"calciteListOrderChange",6),this.calciteInternalListDefaultSlotChange=Z(this,"calciteInternalListDefaultSlotChange",6),this.dragSelector="calcite-list-item",this.enabledListItems=[],this.handleSelector="calcite-handle",this.listItems=[],this.mutationObserver=xi("mutation",()=>this.updateListItems()),this.handleDefaultSlotChange=e=>{pn(mn(e.target)),this.parentListEl&&this.calciteInternalListDefaultSlotChange.emit()},this.handleFilterActionsStartSlotChange=e=>{this.hasFilterActionsStart=ve(e)},this.handleFilterActionsEndSlotChange=e=>{this.hasFilterActionsEnd=ve(e)},this.setActiveListItem=()=>{const{enabledListItems:e}=this;e.some(t=>t.active)||e[0]&&(e[0].active=!0)},this.updateSelectedItems=(e=!1)=>{this.selectedItems=this.enabledListItems.filter(t=>t.selected),e&&this.calciteListChange.emit()},this.updateFilteredItems=(e=!1)=>{const{listItems:t,filteredData:i,filterText:n}=this,a=i.map(l=>l.value),r=t==null?void 0:t.filter(l=>t.every(c=>c===l||!l.contains(c))),o=t.filter(l=>!n||a.includes(l.value))||[],s=new WeakSet;r.forEach(l=>this.filterElements({el:l,filteredItems:o,visibleParents:s})),this.filteredItems=o,e&&this.calciteListFilter.emit()},this.setFilterEl=e=>{this.filterEl=e,this.performFilter()},this.handleFilterChange=e=>{e.stopPropagation();const{value:t}=e.currentTarget;this.filterText=t,this.updateFilteredData(!0)},this.getItemData=()=>this.listItems.map(e=>({label:e.label,description:e.description,metadata:e.metadata,value:e.value})),this.updateListItems=Si((e=!1)=>{const{selectionAppearance:t,selectionMode:i,dragEnabled:n}=this;if(this.parentListEl){this.queryListItems(!0).forEach(o=>{o.selectionAppearance=t,o.selectionMode=i,o.dragHandle=n}),this.setUpSorting();return}const a=this.queryListItems();a.forEach(r=>{r.selectionAppearance=t,r.selectionMode=i,r.dragHandle=n}),this.listItems=a,this.filterEnabled&&(this.dataForFilter=this.getItemData(),this.filterEl&&(this.filterEl.items=this.dataForFilter)),this.updateFilteredItems(e),this.enabledListItems=this.filteredItems.filter(r=>!r.disabled&&!r.closed),this.setActiveListItem(),this.updateSelectedItems(e),this.setUpSorting()},jr),this.queryListItems=(e=!1)=>Array.from(this.el.querySelectorAll(e?Rr:bi)),this.focusRow=e=>{const{enabledListItems:t}=this;e&&(t.forEach(i=>i.active=i===e),e.setFocus())},this.isNavigable=e=>{var i;const t=(i=e.parentElement)==null?void 0:i.closest(bi);return t?t.open&&this.isNavigable(t):!0},this.handleListKeydown=e=>{var a;if(e.defaultPrevented||this.parentListEl)return;const{key:t}=e,i=this.enabledListItems.filter(r=>this.isNavigable(r)),n=i.findIndex(r=>r.active);if(t==="ArrowDown"){e.preventDefault();const r=e.target===this.filterEl?0:n+1;i[r]&&this.focusRow(i[r])}else if(t==="ArrowUp"){if(e.preventDefault(),n===0&&this.filterEnabled){(a=this.filterEl)==null||a.setFocus();return}const r=n-1;i[r]&&this.focusRow(i[r])}else if(t==="Home"){e.preventDefault();const r=i[0];r&&this.focusRow(r)}else if(t==="End"){e.preventDefault();const r=i[i.length-1];r&&this.focusRow(r)}},this.disabled=!1,this.canPull=void 0,this.canPut=void 0,this.dragEnabled=!1,this.group=void 0,this.filterEnabled=!1,this.filteredItems=[],this.filteredData=[],this.filterPlaceholder=void 0,this.filterText=void 0,this.label=void 0,this.loading=!1,this.openable=!1,this.selectedItems=[],this.selectionMode="none",this.selectionAppearance="icon",this.assistiveText=void 0,this.dataForFilter=[],this.hasFilterActionsEnd=!1,this.hasFilterActionsStart=!1}async handleFilterTextChange(){this.performFilter()}handleListItemChange(){this.updateListItems()}handleCalciteInternalFocusPreviousItem(e){if(this.parentListEl)return;e.stopPropagation();const{enabledListItems:t}=this,n=t.findIndex(a=>a.active)-1;t[n]&&this.focusRow(t[n])}handleCalciteInternalListItemActive(e){if(this.parentListEl)return;e.stopPropagation();const t=e.target,{listItems:i}=this;i.forEach(n=>{n.active=n===t})}handleCalciteListItemSelect(){this.parentListEl||this.updateSelectedItems(!0)}handleCalciteInternalHandleChange(e){this.assistiveText=e.detail.message,e.stopPropagation()}handleCalciteHandleNudge(e){this.parentListEl||this.handleNudgeEvent(e)}handleCalciteInternalListItemSelect(e){if(this.parentListEl)return;e.stopPropagation();const t=e.target,{listItems:i,selectionMode:n}=this;t.selected&&(n==="single"||n==="single-persist")&&i.forEach(a=>a.selected=a===t),this.updateSelectedItems()}handleCalciteInternalListItemChange(e){this.parentListEl||(e.stopPropagation(),this.updateListItems(!0))}handleCalciteInternalListItemGroupDefaultSlotChange(e){e.stopPropagation()}connectedCallback(){this.connectObserver(),this.updateListItems(),this.setUpSorting(),kt(this),this.parentListEl=this.el.parentElement.closest("calcite-list")}disconnectedCallback(){this.disconnectObserver(),Ui(this),Tt(this)}componentWillLoad(){Lt(this)}componentDidRender(){At(this)}componentDidLoad(){_t(this)}async setFocus(){var e,t;return await Ot(this),this.filterEnabled?(e=this.filterEl)==null?void 0:e.setFocus():(t=this.enabledListItems.find(i=>i.active))==null?void 0:t.setFocus()}render(){const{loading:e,label:t,disabled:i,dataForFilter:n,filterEnabled:a,filterPlaceholder:r,filterText:o,hasFilterActionsStart:s,hasFilterActionsEnd:l}=this;return f("div",{class:he.container},this.dragEnabled?f("span",{"aria-live":"assertive",class:he.assistiveText},this.assistiveText):null,e?f("calcite-scrim",{class:he.scrim,loading:e}):null,f("table",{"aria-busy":hn(e),"aria-label":t||"",class:he.table,onKeyDown:this.handleListKeydown,role:"treegrid"},a||s||l?f("thead",null,f("tr",{class:{[he.sticky]:!0}},f("th",{colSpan:gn},f("calcite-stack",{class:he.stack},f("slot",{name:gi.filterActionsStart,onSlotchange:this.handleFilterActionsStartSlotChange,slot:Ee.actionsStart}),f("calcite-filter",{"aria-label":r,disabled:e||i,items:n,onCalciteFilterChange:this.handleFilterChange,placeholder:r,value:o,ref:this.setFilterEl}),f("slot",{name:gi.filterActionsEnd,onSlotchange:this.handleFilterActionsEndSlotChange,slot:Ee.actionsEnd}))))):null,f("tbody",{class:he.tableContainer},f("slot",{onSlotchange:this.handleDefaultSlotChange}))))}connectObserver(){var e;(e=this.mutationObserver)==null||e.observe(this.el,{childList:!0,subtree:!0})}disconnectObserver(){var e;(e=this.mutationObserver)==null||e.disconnect()}setUpSorting(){const{dragEnabled:e}=this;e&&Qn(this)}onDragStart(){this.disconnectObserver()}onDragEnd(){this.connectObserver()}onDragSort(e){this.updateListItems();const{from:t,item:i,to:n}=e;this.calciteListOrderChange.emit({dragEl:i,fromEl:t,toEl:n})}filterElements({el:e,filteredItems:t,visibleParents:i}){const n=!i.has(e)&&!t.includes(e);e.hidden=n;const a=e.parentElement.closest(Wr);a&&(n||i.add(a),this.filterElements({el:a,filteredItems:t,visibleParents:i}))}updateFilteredData(e=!1){const{filterEl:t}=this;t&&(t.filteredItems&&(this.filteredData=t.filteredItems),this.updateListItems(e))}async performFilter(){const{filterEl:e,filterText:t}=this;e&&(e.value=t,await e.filter(t),this.updateFilteredData())}handleNudgeEvent(e){const{direction:t}=e.detail,i=e.composedPath(),n=i.find(p=>p.tagName==="CALCITE-HANDLE"),a=i.find(p=>p.tagName==="CALCITE-LIST-ITEM"),r=a==null?void 0:a.parentElement;if(!r)return;const{enabledListItems:o}=this,s=o.filter(p=>p.parentElement===r),l=s.length-1,c=s.indexOf(a);let h=!1,u;t==="up"?c===0?h=!0:u=c-1:c===l?u=0:c===l-1?h=!0:u=c+2,this.disconnectObserver(),h?r.appendChild(a):r.insertBefore(a,s[u]),this.updateListItems(),this.connectObserver(),this.calciteListOrderChange.emit({dragEl:a,fromEl:null,toEl:null}),n.setFocus().then(()=>{n.activated=!0})}get el(){return this}static get watchers(){return{filterText:["handleFilterTextChange"],filterEnabled:["handleListItemChange"],group:["handleListItemChange"],dragEnabled:["handleListItemChange"],selectionMode:["handleListItemChange"],selectionAppearance:["handleListItemChange"]}}static get style(){return Br}},[1,"calcite-list",{disabled:[516],canPull:[16],canPut:[16],dragEnabled:[516,"drag-enabled"],group:[513],filterEnabled:[516,"filter-enabled"],filteredItems:[1040],filteredData:[1040],filterPlaceholder:[513,"filter-placeholder"],filterText:[1537,"filter-text"],label:[1],loading:[516],openable:[4],selectedItems:[1040],selectionMode:[513,"selection-mode"],selectionAppearance:[513,"selection-appearance"],assistiveText:[32],dataForFilter:[32],hasFilterActionsEnd:[32],hasFilterActionsStart:[32],setFocus:[64]},[[0,"calciteInternalFocusPreviousItem","handleCalciteInternalFocusPreviousItem"],[0,"calciteInternalListItemActive","handleCalciteInternalListItemActive"],[0,"calciteListItemSelect","handleCalciteListItemSelect"],[0,"calciteInternalHandleChange","handleCalciteInternalHandleChange"],[0,"calciteHandleNudge","handleCalciteHandleNudge"],[0,"calciteInternalListItemSelect","handleCalciteInternalListItemSelect"],[0,"calciteInternalListItemChange","handleCalciteInternalListItemChange"],[0,"calciteInternalListItemGroupDefaultSlotChange","handleCalciteInternalListItemGroupDefaultSlotChange"]]]);function on(){if(typeof customElements>"u")return;["calcite-list","calcite-filter","calcite-icon","calcite-input","calcite-loader","calcite-progress","calcite-scrim","calcite-stack"].forEach(t=>{switch(t){case"calcite-list":customElements.get(t)||customElements.define(t,rn);break;case"calcite-filter":customElements.get(t)||an();break;case"calcite-icon":customElements.get(t)||Pt();break;case"calcite-input":customElements.get(t)||Wt();break;case"calcite-loader":customElements.get(t)||fn();break;case"calcite-progress":customElements.get(t)||lt();break;case"calcite-scrim":customElements.get(t)||Cn();break;case"calcite-stack":customElements.get(t)||Xi();break}})}on();const to=rn,io=on;export{to as CalciteList,io as defineCustomElement}; diff --git a/assets/calcite-list-item-d9ff27a1.js b/assets/calcite-list-item-d9ff27a1.js new file mode 100644 index 0000000..d0ea7c9 --- /dev/null +++ b/assets/calcite-list-item-d9ff27a1.js @@ -0,0 +1,29 @@ +import{f6 as I,f7 as L,ff as m,f9 as n,fa as S,hv as g,fc as K,fb as U}from"./index-080e108a.js";import{d as j,c as R,u as W,a as G}from"./loader-2996ba2a.js";import{g as x,I as p,C as a,S as C,a as q,u as J}from"./utils3-4f0533d1.js";import{a as E,c as k,s as A,b as w,d as D,u as H}from"./t9n-537805d4.js";import{s as M,a as z,c as P}from"./loadable-759e1c0c.js";import{d as Q}from"./action-0a339dee.js";import{d as O}from"./icon-25aef281.js";import"./guid-114f0fc6.js";import"./observers-4ce6e1b4.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const y={handle:"handle",handleActivated:"handle--activated"},V={drag:"drag"},X=`:host{display:flex}.handle{display:flex;cursor:move;align-items:center;justify-content:center;align-self:stretch;border-style:none;background-color:transparent;outline-color:transparent;color:var(--calcite-ui-border-input);padding-block:0.75rem;padding-inline:0.25rem;line-height:0}.handle:hover{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.handle:focus{color:var(--calcite-ui-text-1);outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}.handle--activated{background-color:var(--calcite-ui-foreground-3);color:var(--calcite-ui-text-1)}.handle calcite-icon{color:inherit}:host([hidden]){display:none}[hidden]{display:none}`,Y=I(class extends L{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteHandleNudge=m(this,"calciteHandleNudge",6),this.calciteInternalHandleChange=m(this,"calciteInternalHandleChange",6),this.handleKeyDown=e=>{switch(e.key){case" ":this.activated=!this.activated,e.preventDefault();break;case"ArrowUp":if(!this.activated)return;e.preventDefault(),this.calciteHandleNudge.emit({direction:"up"});break;case"ArrowDown":if(!this.activated)return;e.preventDefault(),this.calciteHandleNudge.emit({direction:"down"});break}},this.handleBlur=()=>{this.activated=!1},this.activated=!1,this.dragHandle=void 0,this.messages=void 0,this.setPosition=void 0,this.setSize=void 0,this.label=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}handleAriaTextChange(){const e=this.getAriaText("live");e&&this.calciteInternalHandleChange.emit({message:e})}onMessagesChange(){}connectedCallback(){E(this),k(this)}async componentWillLoad(){M(this),await A(this)}componentDidLoad(){z(this)}disconnectedCallback(){w(this),D(this)}effectiveLocaleChange(){H(this,this.effectiveLocale)}async setFocus(){var e;await P(this),(e=this.handleButton)==null||e.focus()}getAriaText(e){const{setPosition:t,setSize:i,label:s,messages:l,activated:o}=this;return!l||!s||typeof i!="number"||typeof t!="number"?null:(e==="label"?o?l.dragHandleChange:l.dragHandleIdle:o?l.dragHandleActive:l.dragHandleCommit).replace("{position}",t.toString()).replace("{itemLabel}",s).replace("{total}",i.toString())}render(){var e;return n("span",{"aria-label":this.getAriaText("label"),"aria-pressed":S(this.activated),class:{[y.handle]:!0,[y.handleActivated]:this.activated},onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,role:"button",tabindex:"0",title:(e=this.messages)==null?void 0:e.dragHandle,ref:t=>{this.handleButton=t}},n("calcite-icon",{icon:V.drag,scale:"s"}))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messages:["handleAriaTextChange"],label:["handleAriaTextChange"],activated:["handleAriaTextChange"],setPosition:["handleAriaTextChange"],setSize:["handleAriaTextChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return X}},[1,"calcite-handle",{activated:[1540],dragHandle:[513,"drag-handle"],messages:[16],setPosition:[2,"set-position"],setSize:[2,"set-size"],label:[1],messageOverrides:[16],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]}]);function B(){if(typeof customElements>"u")return;["calcite-handle","calcite-icon"].forEach(t=>{switch(t){case"calcite-handle":customElements.get(t)||customElements.define(t,Y);break;case"calcite-icon":customElements.get(t)||O();break}})}B();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const Z=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column;--calcite-list-item-icon-color:var(--calcite-ui-brand);--calcite-list-item-spacing-indent:1rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{box-sizing:border-box;display:flex;flex:1 1 0%;background-color:var(--calcite-ui-foreground-1);font-family:var(--calcite-sans-family);padding-inline-start:calc(var(--calcite-list-item-spacing-indent) * var(--calcite-list-item-spacing-indent-multiplier))}.container *{box-sizing:border-box}.container:hover{cursor:pointer;background-color:var(--calcite-ui-foreground-2)}.container--border-selected{border-inline-start:4px solid var(--calcite-ui-brand)}.container--border-unselected{border-inline-start:4px solid transparent}.nested-container{display:flex;flex-direction:column;background-color:var(--calcite-ui-foreground-1)}.nested-container--hidden{display:none}.content-container{display:flex;flex:1 1 auto;align-items:stretch;padding:0px;font-family:var(--calcite-sans-family);font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2)}tr,td{outline-color:transparent}tr:focus,td:focus{z-index:var(--calcite-app-z-index-sticky);outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}.content,.custom-content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--2);line-height:1.375}.label,.description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);word-wrap:break-word;word-break:break-word}.label:only-child,.description:only-child{margin:0px;padding-block:0.25rem}.label{color:var(--calcite-ui-text-1)}.description{margin-block-start:0.125rem;color:var(--calcite-ui-text-3)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:1 1 auto}.content-container--has-center-content .content-start,.content-container--has-center-content .content-end{flex:0 1 auto}.selection-container{display:flex;padding-inline:0.75rem;color:var(--calcite-list-item-icon-color)}.actions-start,.actions-end,.content-start,.content-end,.selection-container,.drag-container,.open-container{display:flex;align-items:center}.open-container,.selection-container{cursor:pointer}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.actions-start ::slotted(calcite-action),.actions-end ::slotted(calcite-action){align-self:stretch;color:inherit}::slotted(calcite-list-item){border-width:0px;border-block-start-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}:host([hidden]){display:none}[hidden]{display:none}`,v=new Map,N="calcite-list",T=I(class extends L{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListItemSelect=m(this,"calciteListItemSelect",6),this.calciteListItemClose=m(this,"calciteListItemClose",6),this.calciteInternalListItemSelect=m(this,"calciteInternalListItemSelect",6),this.calciteInternalListItemActive=m(this,"calciteInternalListItemActive",6),this.calciteInternalFocusPreviousItem=m(this,"calciteInternalFocusPreviousItem",6),this.calciteInternalListItemChange=m(this,"calciteInternalListItemChange",6),this.closeClickHandler=()=>{this.closed=!0,this.calciteListItemClose.emit()},this.handleContentSlotChange=e=>{this.hasCustomContent=g(e)},this.handleActionsStartSlotChange=e=>{this.hasActionsStart=g(e)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=g(e)},this.handleContentStartSlotChange=e=>{this.hasContentStart=g(e)},this.handleContentEndSlotChange=e=>{this.hasContentEnd=g(e)},this.handleDefaultSlotChange=e=>{this.handleOpenableChange(e.target)},this.toggleOpen=()=>{this.open=!this.open},this.itemClicked=e=>{e.defaultPrevented||(this.toggleSelected(),this.calciteInternalListItemActive.emit())},this.toggleSelected=()=>{const{selectionMode:e,selected:t}=this;this.disabled||(e==="multiple"||e==="single"?this.selected=!t:e==="single-persist"&&(this.selected=!0),this.calciteListItemSelect.emit())},this.handleItemKeyDown=e=>{if(e.defaultPrevented)return;const{key:t}=e,i=e.composedPath(),{containerEl:s,contentEl:l,actionsStartEl:o,actionsEndEl:c,open:h,openable:f}=this,r=[o,l,c].filter(Boolean),u=r.findIndex(d=>i.includes(d));if(t==="Enter")e.preventDefault(),this.toggleSelected();else if(t==="ArrowRight"){e.preventDefault();const d=u+1;u===-1?!h&&f?(this.open=!0,this.focusCell(null)):r[0]&&this.focusCell(r[0]):r[u]&&r[d]&&this.focusCell(r[d])}else if(t==="ArrowLeft"){e.preventDefault();const d=u-1;u===-1?(this.focusCell(null),h&&f?this.open=!1:this.calciteInternalFocusPreviousItem.emit()):u===0?(this.focusCell(null),s.focus()):r[u]&&r[d]&&this.focusCell(r[d])}},this.focusCellNull=()=>{this.focusCell(null)},this.focusCell=(e,t=!0)=>{const{contentEl:i,actionsStartEl:s,actionsEndEl:l,parentListEl:o}=this;t&&v.set(o,null),[s,i,l].filter(Boolean).forEach((c,h)=>{const f="tabindex";c===e?(c.setAttribute(f,"0"),t&&v.set(o,h)):c.removeAttribute(f)}),e==null||e.focus()},this.active=!1,this.closable=!1,this.closed=!1,this.description=void 0,this.disabled=!1,this.dragHandle=!1,this.label=void 0,this.metadata=void 0,this.open=!1,this.setSize=null,this.setPosition=null,this.selected=!1,this.value=void 0,this.selectionMode=null,this.selectionAppearance=null,this.messageOverrides=void 0,this.messages=void 0,this.effectiveLocale="",this.defaultMessages=void 0,this.level=null,this.visualLevel=null,this.parentListEl=void 0,this.openable=!1,this.hasActionsStart=!1,this.hasActionsEnd=!1,this.hasCustomContent=!1,this.hasContentStart=!1,this.hasContentEnd=!1}activeHandler(e){e||this.focusCell(null,!1)}handleClosedChange(){this.emitCalciteInternalListItemChange()}handleDisabledChange(){this.emitCalciteInternalListItemChange()}handleSelectedChange(){this.calciteInternalListItemSelect.emit()}onMessagesChange(){}handleCalciteInternalListDefaultSlotChanges(e){e.stopPropagation(),this.handleOpenableChange(this.defaultSlotEl)}effectiveLocaleChange(){H(this,this.effectiveLocale)}connectedCallback(){R(this),k(this),E(this);const{el:e}=this;this.parentListEl=e.closest(N),this.level=x(e)+1,this.visualLevel=x(e,!0),this.setSelectionDefaults()}async componentWillLoad(){M(this),await A(this)}componentDidLoad(){z(this)}componentDidRender(){W(this,"managed")}disconnectedCallback(){G(this),D(this),w(this)}async setFocus(){await P(this);const{containerEl:e,contentEl:t,actionsStartEl:i,actionsEndEl:s,parentListEl:l}=this,o=v.get(l);if(typeof o=="number"){const c=[i,t,s].filter(Boolean);c[o]?this.focusCell(c[o]):e==null||e.focus();return}e==null||e.focus()}renderSelected(){const{selected:e,selectionMode:t,selectionAppearance:i}=this;return t==="none"||i==="border"?null:n("td",{class:a.selectionContainer,key:"selection-container",onClick:this.itemClicked},n("calcite-icon",{icon:e?t==="multiple"?p.selectedMultiple:p.selectedSingle:p.unselected,scale:"s"}))}renderDragHandle(){return this.dragHandle?n("td",{class:a.dragContainer,key:"drag-handle-container"},n("calcite-handle",{label:this.label,setPosition:this.setPosition,setSize:this.setSize})):null}renderOpen(){const{el:e,open:t,openable:i,parentListEl:s}=this,l=K(e);return i?n("td",{class:a.openContainer,key:"open-container",onClick:this.toggleOpen},n("calcite-icon",{icon:t?p.open:l==="rtl"?p.closedRTL:p.closedLTR,scale:"s"})):s!=null&&s.openable?n("td",{class:a.openContainer,key:"open-container",onClick:this.itemClicked},n("calcite-icon",{icon:p.blank,scale:"s"})):null}renderActionsStart(){const{label:e,hasActionsStart:t}=this;return n("td",{"aria-label":e,class:a.actionsStart,hidden:!t,key:"actions-start-container",role:"gridcell",ref:i=>this.actionsStartEl=i},n("slot",{name:C.actionsStart,onSlotchange:this.handleActionsStartSlotChange}))}renderActionsEnd(){const{label:e,hasActionsEnd:t,closable:i,messages:s}=this;return n("td",{"aria-label":e,class:a.actionsEnd,hidden:!(t||i),key:"actions-end-container",role:"gridcell",ref:l=>this.actionsEndEl=l},n("slot",{name:C.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}),i?n("calcite-action",{appearance:"transparent",icon:p.close,key:"close-action",label:s.close,onClick:this.closeClickHandler,text:s.close}):null)}renderContentStart(){const{hasContentStart:e}=this;return n("div",{class:a.contentStart,hidden:!e},n("slot",{name:C.contentStart,onSlotchange:this.handleContentStartSlotChange}))}renderCustomContent(){const{hasCustomContent:e}=this;return n("div",{class:a.customContent,hidden:!e},n("slot",{name:C.content,onSlotchange:this.handleContentSlotChange}))}renderContentEnd(){const{hasContentEnd:e}=this;return n("div",{class:a.contentEnd,hidden:!e},n("slot",{name:C.contentEnd,onSlotchange:this.handleContentEndSlotChange}))}renderContentProperties(){const{label:e,description:t,hasCustomContent:i}=this;return!i&&(e||t)?n("div",{class:a.content,key:"content"},e?n("div",{class:a.label,key:"label"},e):null,t?n("div",{class:a.description,key:"description"},t):null):null}renderContentContainer(){const{description:e,label:t,selectionMode:i,hasCustomContent:s}=this,l=s||!!t||!!e,o=[this.renderContentStart(),this.renderCustomContent(),this.renderContentProperties(),this.renderContentEnd()];return n("td",{"aria-label":t,class:{[a.contentContainer]:!0,[a.contentContainerSelectable]:i!=="none",[a.contentContainerHasCenterContent]:l},key:"content-container",onClick:this.itemClicked,role:"gridcell",ref:c=>this.contentEl=c},o)}render(){const{openable:e,open:t,level:i,setPosition:s,setSize:l,active:o,label:c,selected:h,selectionAppearance:f,selectionMode:r,closed:u}=this,d=r!=="none"&&f==="border",_=d&&h,$=d&&!h;return n(U,null,n("tr",{"aria-expanded":e?S(t):null,"aria-label":c,"aria-level":i,"aria-posinset":s,"aria-selected":S(h),"aria-setsize":l,class:{[a.container]:!0,[a.containerBorderSelected]:_,[a.containerBorderUnselected]:$},hidden:u,onFocus:this.focusCellNull,onKeyDown:this.handleItemKeyDown,role:"row",style:{"--calcite-list-item-spacing-indent-multiplier":`${this.visualLevel}`},tabIndex:o?0:-1,ref:b=>this.containerEl=b},this.renderDragHandle(),this.renderSelected(),this.renderOpen(),this.renderActionsStart(),this.renderContentContainer(),this.renderActionsEnd()),n("div",{class:{[a.nestedContainer]:!0,[a.nestedContainerHidden]:e&&!t}},n("slot",{onSlotchange:this.handleDefaultSlotChange,ref:b=>this.defaultSlotEl=b})))}emitCalciteInternalListItemChange(){this.calciteInternalListItemChange.emit()}setSelectionDefaults(){const{parentListEl:e,selectionMode:t,selectionAppearance:i}=this;e&&(t||(this.selectionMode=e.selectionMode),i||(this.selectionAppearance=e.selectionAppearance))}handleOpenableChange(e){if(!e)return;const{parentListEl:t}=this,i=q(e);J(i);const s=!!i.length;s&&t&&!t.openable&&(t.openable=!0),this.openable=s,s||(this.open=!1)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{active:["activeHandler"],closed:["handleClosedChange"],disabled:["handleDisabledChange"],selected:["handleSelectedChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Z}},[1,"calcite-list-item",{active:[4],closable:[516],closed:[1540],description:[1],disabled:[516],dragHandle:[4,"drag-handle"],label:[1],metadata:[16],open:[1540],setSize:[2,"set-size"],setPosition:[2,"set-position"],selected:[1540],value:[8],selectionMode:[1025,"selection-mode"],selectionAppearance:[1025,"selection-appearance"],messageOverrides:[1040],messages:[1040],effectiveLocale:[32],defaultMessages:[32],level:[32],visualLevel:[32],parentListEl:[32],openable:[32],hasActionsStart:[32],hasActionsEnd:[32],hasCustomContent:[32],hasContentStart:[32],hasContentEnd:[32],setFocus:[64]},[[0,"calciteInternalListItemGroupDefaultSlotChange","handleCalciteInternalListDefaultSlotChanges"],[0,"calciteInternalListDefaultSlotChange","handleCalciteInternalListDefaultSlotChanges"]]]);function F(){if(typeof customElements>"u")return;["calcite-list-item","calcite-action","calcite-handle","calcite-icon","calcite-loader"].forEach(t=>{switch(t){case"calcite-list-item":customElements.get(t)||customElements.define(t,T);break;case"calcite-action":customElements.get(t)||Q();break;case"calcite-handle":customElements.get(t)||B();break;case"calcite-icon":customElements.get(t)||O();break;case"calcite-loader":customElements.get(t)||j();break}})}F();const re=T,de=F;export{re as CalciteListItem,de as defineCustomElement}; diff --git a/assets/calcite-notice-1e5c2a0f.js b/assets/calcite-notice-1e5c2a0f.js new file mode 100644 index 0000000..f87b074 --- /dev/null +++ b/assets/calcite-notice-1e5c2a0f.js @@ -0,0 +1,23 @@ +import{f8 as p,f6 as v,f7 as b,ff as a,ju as l,f9 as t,jv as k}from"./index-080e108a.js";import{c as x}from"./observers-4ce6e1b4.js";import{s as w,a as z,c as y}from"./loadable-759e1c0c.js";import{c as C,a as E,d as L,b as M,s as S,u as q}from"./t9n-537805d4.js";import{d as O}from"./icon-25aef281.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const r=new Set;let n;const d={childList:!0};function R(e){n||(n=x("mutation",h)),n.observe(e.el,d)}function F(e){r.delete(e.el),h(n.takeRecords()),n.disconnect();for(const[i]of r.entries())n.observe(i,d)}function h(e){e.forEach(({target:i})=>{p(i)})}/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */var c;(function(e){e.brand="lightbulb",e.danger="exclamationMarkTriangle",e.info="information",e.success="checkCircle",e.warning="exclamationMarkTriangle"})(c||(c={}));/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const o={title:"title",message:"message",link:"link",actionsEnd:"actions-end"},s={actionsEnd:"actions-end",close:"notice-close",container:"container",content:"notice-content",icon:"notice-icon"},B=`:host([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:none;inline-size:100%;background-color:var(--calcite-ui-foreground-1);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;max-block-size:0;text-align:start;border-inline-start:0px solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}:host{display:flex}:host([open]) .container{pointer-events:auto;display:flex;max-block-size:100%;align-items:center;border-width:2px;opacity:1;--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.container slot[name=title]::slotted(*),.container *::slotted([slot=title]){margin:0px;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}.container slot[name=message]::slotted(*),.container *::slotted([slot=message]){margin:0px;display:inline;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2);margin-inline-end:var(--calcite-notice-spacing-token-small)}.notice-content{box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;display:flex;min-inline-size:0px;flex-direction:column;overflow-wrap:break-word;flex:1 1 0;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:0 var(--calcite-notice-spacing-token-small)}.notice-content:first-of-type:not(:only-child){padding-inline-start:var(--calcite-notice-spacing-token-large)}.notice-content:only-of-type{padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large)}.notice-icon{display:flex;align-items:center;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto}.notice-close{display:flex;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;-webkit-appearance:none}.notice-close:hover,.notice-close:focus{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.notice-close:active{background-color:var(--calcite-ui-foreground-3)}.actions-end{display:flex;align-self:stretch}:host([kind=brand]) .container{border-color:var(--calcite-ui-brand)}:host([kind=brand]) .container .notice-icon{color:var(--calcite-ui-brand)}:host([kind=info]) .container{border-color:var(--calcite-ui-info)}:host([kind=info]) .container .notice-icon{color:var(--calcite-ui-info)}:host([kind=danger]) .container{border-color:var(--calcite-ui-danger)}:host([kind=danger]) .container .notice-icon{color:var(--calcite-ui-danger)}:host([kind=success]) .container{border-color:var(--calcite-ui-success)}:host([kind=success]) .container .notice-icon{color:var(--calcite-ui-success)}:host([kind=warning]) .container{border-color:var(--calcite-ui-warning)}:host([kind=warning]) .container .notice-icon{color:var(--calcite-ui-warning)}:host([hidden]){display:none}[hidden]{display:none}`,m=v(class extends b{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteNoticeClose=a(this,"calciteNoticeClose",6),this.calciteNoticeOpen=a(this,"calciteNoticeOpen",6),this.close=()=>{this.open=!1,this.calciteNoticeClose.emit()},this.open=!1,this.kind="brand",this.closable=!1,this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.width="auto",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}onMessagesChange(){}updateRequestedIcon(){this.requestedIcon=l(c,this.icon,this.kind)}connectedCallback(){R(this),C(this),E(this)}disconnectedCallback(){F(this),L(this),M(this)}async componentWillLoad(){w(this),this.requestedIcon=l(c,this.icon,this.kind),await S(this)}componentDidLoad(){z(this)}render(){const{el:e}=this,i=t("button",{"aria-label":this.messages.close,class:s.close,onClick:this.close,ref:u=>this.closeButton=u},t("calcite-icon",{icon:"x",scale:this.scale==="l"?"m":"s"})),f=k(e,o.actionsEnd);return t("div",{class:s.container},this.requestedIcon?t("div",{class:s.icon},t("calcite-icon",{flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:this.scale==="l"?"m":"s"})):null,t("div",{class:s.content},t("slot",{name:o.title}),t("slot",{name:o.message}),t("slot",{name:o.link})),f?t("div",{class:s.actionsEnd},t("slot",{name:o.actionsEnd})):null,this.closable?i:null)}async setFocus(){await y(this);const e=this.el.querySelector("calcite-link");if(!(!this.closeButton&&!e)){if(e)return e.setFocus();this.closeButton&&this.closeButton.focus()}}effectiveLocaleChange(){q(this,this.effectiveLocale)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],icon:["updateRequestedIcon"],kind:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return B}},[1,"calcite-notice",{open:[1540],kind:[513],closable:[516],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],width:[513],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]}]);function g(){if(typeof customElements>"u")return;["calcite-notice","calcite-icon"].forEach(i=>{switch(i){case"calcite-notice":customElements.get(i)||customElements.define(i,m);break;case"calcite-icon":customElements.get(i)||O();break}})}g();const j=m,D=g;export{j as CalciteNotice,D as defineCustomElement}; diff --git a/assets/calcite-tooltip-1b461e59.js b/assets/calcite-tooltip-1b461e59.js new file mode 100644 index 0000000..4487526 --- /dev/null +++ b/assets/calcite-tooltip-1b461e59.js @@ -0,0 +1,5 @@ +import{f6 as g,f7 as T,ff as l,f9 as r,fa as E,fb as w,fg as C,fh as y,fi as H}from"./index-080e108a.js";import{c as b,d as L,o as c,a as k,r as O,F as d,b as R}from"./FloatingArrow-54d0aa06.js";import{g as S}from"./guid-114f0fc6.js";import"./debounce-14ebcd9e.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const x={container:"container"},D=300,A=500,h="aria-describedby";function u(o){const{referenceElement:e}=o;return(typeof e=="string"?C(o,{id:e}):e)||null}class P{constructor(){this.registeredElements=new WeakMap,this.registeredShadowRootCounts=new WeakMap,this.hoverOpenTimeout=null,this.hoverCloseTimeout=null,this.hoveredTooltip=null,this.clickedTooltip=null,this.activeTooltip=null,this.registeredElementCount=0,this.queryTooltip=e=>{const{registeredElements:t}=this,i=e.find(s=>t.has(s));return t.get(i)},this.keyDownHandler=e=>{if(e.key==="Escape"&&!e.defaultPrevented){const{activeTooltip:t}=this;if(t!=null&&t.open){this.clearHoverTimeout(),this.closeActiveTooltip();const i=u(t);i instanceof Element&&i.contains(e.target)&&e.preventDefault()}}},this.pointerMoveHandler=e=>{const t=e.composedPath(),{activeTooltip:i}=this;if((i==null?void 0:i.open)&&t.includes(i)){this.clearHoverTimeout();return}const n=this.queryTooltip(t);this.hoveredTooltip=n,!this.isClosableClickedTooltip(n)&&(this.clickedTooltip=null,n?this.openHoveredTooltip(n):i&&this.closeHoveredTooltip())},this.pointerDownHandler=e=>{if(!y(e))return;const t=this.queryTooltip(e.composedPath());this.clickedTooltip=t,t!=null&&t.closeOnClick&&(this.toggleTooltip(t,!1),this.clearHoverTimeout())},this.focusInHandler=e=>{this.queryFocusedTooltip(e,!0)},this.focusOutHandler=e=>{this.queryFocusedTooltip(e,!1)},this.openHoveredTooltip=e=>{this.hoverOpenTimeout=window.setTimeout(()=>{this.hoverOpenTimeout!==null&&(this.clearHoverCloseTimeout(),this.activeTooltip!==this.hoveredTooltip&&(this.closeActiveTooltip(),e===this.hoveredTooltip&&this.toggleTooltip(e,!0)))},this.activeTooltip?0:D)},this.closeHoveredTooltip=()=>{this.hoverCloseTimeout=window.setTimeout(()=>{this.hoverCloseTimeout!==null&&this.closeActiveTooltip()},A)}}registerElement(e,t){this.registeredElementCount++,this.registeredElements.set(e,t);const i=this.getReferenceElShadowRootNode(e);i&&this.registerShadowRoot(i),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){const t=this.getReferenceElShadowRootNode(e);t&&this.unregisterShadowRoot(t),this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}addShadowListeners(e){e.addEventListener("focusin",this.focusInHandler,{capture:!0}),e.addEventListener("focusout",this.focusOutHandler,{capture:!0})}removeShadowListeners(e){e.removeEventListener("focusin",this.focusInHandler,{capture:!0}),e.removeEventListener("focusout",this.focusOutHandler,{capture:!0})}addListeners(){document.addEventListener("keydown",this.keyDownHandler,{capture:!0}),document.addEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),document.addEventListener("pointerdown",this.pointerDownHandler,{capture:!0}),document.addEventListener("focusin",this.focusInHandler,{capture:!0}),document.addEventListener("focusout",this.focusOutHandler,{capture:!0})}removeListeners(){document.removeEventListener("keydown",this.keyDownHandler,{capture:!0}),document.removeEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),document.removeEventListener("pointerdown",this.pointerDownHandler,{capture:!0}),document.removeEventListener("focusin",this.focusInHandler,{capture:!0}),document.removeEventListener("focusout",this.focusOutHandler,{capture:!0})}clearHoverOpenTimeout(){window.clearTimeout(this.hoverOpenTimeout),this.hoverOpenTimeout=null}clearHoverCloseTimeout(){window.clearTimeout(this.hoverCloseTimeout),this.hoverCloseTimeout=null}clearHoverTimeout(){this.clearHoverOpenTimeout(),this.clearHoverCloseTimeout()}closeActiveTooltip(){const{activeTooltip:e}=this;e!=null&&e.open&&this.toggleTooltip(e,!1)}toggleFocusedTooltip(e,t){this.closeActiveTooltip(),t&&this.clearHoverTimeout(),this.toggleTooltip(e,t)}toggleTooltip(e,t){e.open=t,this.activeTooltip=t?e:null}queryFocusedTooltip(e,t){const i=this.queryTooltip(e.composedPath());!i||this.isClosableClickedTooltip(i)||this.toggleFocusedTooltip(i,t)}isClosableClickedTooltip(e){return(e==null?void 0:e.closeOnClick)&&e===this.clickedTooltip}registerShadowRoot(e){const{registeredShadowRootCounts:t}=this,i=(t.get(e)??0)+1;i===1&&this.addShadowListeners(e),t.set(e,i)}unregisterShadowRoot(e){const{registeredShadowRootCounts:t}=this,i=t.get(e)-1;i===0&&this.removeShadowListeners(e),t.set(e,i)}getReferenceElShadowRootNode(e){return e instanceof Element?H(e):null}}const I=":host{--calcite-floating-ui-z-index:var(--calcite-tooltip-z-index, var(--calcite-app-z-index-tooltip));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-app-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{transform:translateY(-5px)}:host([data-placement^=top]) .calcite-floating-ui-anim{transform:translateY(5px)}:host([data-placement^=left]) .calcite-floating-ui-anim{transform:translateX(5px)}:host([data-placement^=right]) .calcite-floating-ui-anim{transform:translateX(-5px)}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-app-z-index) * -1);fill:var(--calcite-ui-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-ui-border-3)}.container{position:relative;overflow:hidden;border-radius:0.25rem;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size--2);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);max-inline-size:20rem;max-block-size:20rem;text-align:start}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);background-color:var(--calcite-ui-foreground-1)}.arrow::before{outline:1px solid var(--calcite-ui-border-3)}:host([hidden]){display:none}[hidden]{display:none}",f=new P,p=g(class extends T{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteTooltipBeforeClose=l(this,"calciteTooltipBeforeClose",6),this.calciteTooltipClose=l(this,"calciteTooltipClose",6),this.calciteTooltipBeforeOpen=l(this,"calciteTooltipBeforeOpen",6),this.calciteTooltipOpen=l(this,"calciteTooltipOpen",6),this.guid=`calcite-tooltip-${S()}`,this.hasLoaded=!1,this.openTransitionProp="opacity",this.setTransitionEl=o=>{this.transitionEl=o},this.setUpReferenceElement=(o=!0)=>{this.removeReferences(),this.effectiveReferenceElement=u(this.el),b(this,this.effectiveReferenceElement,this.el);const{el:e,referenceElement:t,effectiveReferenceElement:i}=this;o&&t&&!i&&console.warn(`${e.tagName}: reference-element id "${t}" was not found.`,{el:e}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.addReferences=()=>{const{effectiveReferenceElement:o}=this;if(!o)return;const e=this.getId();"setAttribute"in o&&o.setAttribute(h,e),f.registerElement(o,this.el)},this.removeReferences=()=>{const{effectiveReferenceElement:o}=this;o&&("removeAttribute"in o&&o.removeAttribute(h),f.unregisterElement(o))},this.closeOnClick=!1,this.label=void 0,this.offsetDistance=L,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.referenceElement=void 0,this.effectiveReferenceElement=void 0,this.floatingLayout="vertical"}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(o){c(this),o&&this.reposition(!0)}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement()}connectedCallback(){this.setUpReferenceElement(this.hasLoaded),this.open&&c(this)}async componentWillLoad(){this.open&&c(this)}componentDidLoad(){this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement(),this.reposition(!0),this.hasLoaded=!0}disconnectedCallback(){this.removeReferences(),k(this,this.effectiveReferenceElement,this.el)}async reposition(o=!1){const{el:e,effectiveReferenceElement:t,placement:i,overlayPositioning:s,offsetDistance:n,offsetSkidding:a,arrowEl:v}=this;return O(this,{floatingEl:e,referenceEl:t,overlayPositioning:s,placement:i,offsetDistance:n,offsetSkidding:a,arrowEl:v,type:"tooltip"},o)}onBeforeOpen(){this.calciteTooltipBeforeOpen.emit()}onOpen(){this.calciteTooltipOpen.emit()}onBeforeClose(){this.calciteTooltipBeforeClose.emit()}onClose(){this.calciteTooltipClose.emit()}render(){const{effectiveReferenceElement:o,label:e,open:t,floatingLayout:i}=this,s=o&&t,n=!s;return r(w,{"aria-hidden":E(n),"aria-label":e,"aria-live":"polite","calcite-hydrated-hidden":n,id:this.getId(),role:"tooltip"},r("div",{class:{[d.animation]:!0,[d.animationActive]:s},ref:this.setTransitionEl},r(R,{floatingLayout:i,ref:a=>this.arrowEl=a}),r("div",{class:x.container},r("slot",null))))}get el(){return this}static get watchers(){return{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}}static get style(){return I}},[1,"calcite-tooltip",{closeOnClick:[516,"close-on-click"],label:[1],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[516],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],effectiveReferenceElement:[32],floatingLayout:[32],reposition:[64]}]);function m(){if(typeof customElements>"u")return;["calcite-tooltip"].forEach(e=>{switch(e){case"calcite-tooltip":customElements.get(e)||customElements.define(e,p);break}})}m();const q=p,M=m;export{q as CalciteTooltip,M as defineCustomElement}; diff --git a/assets/capabilities-5d185925.js b/assets/capabilities-5d185925.js new file mode 100644 index 0000000..3efbdcf --- /dev/null +++ b/assets/capabilities-5d185925.js @@ -0,0 +1 @@ +const t={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsResize:!1},data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCompactGeometry:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}};export{t}; diff --git a/assets/centroid-8e8cfa47.js b/assets/centroid-8e8cfa47.js new file mode 100644 index 0000000..95d9b79 --- /dev/null +++ b/assets/centroid-8e8cfa47.js @@ -0,0 +1 @@ +function P(n,r){return n?r?4:3:r?3:2}function M(n,r,u,l,s){if(r==null||!r.lengths.length)return null;const o=(s==null?void 0:s.originPosition)==="upperLeft"?-1:1;n.lengths.length&&(n.lengths.length=0),n.coords.length&&(n.coords.length=0);const I=n.coords,N=[],t=u?[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:T,coords:g}=r,F=P(u,l);let m=0;for(const e of T){const c=O(t,g,m,e,u,l,o);c&&N.push(c),m+=e*F}if(N.sort((e,c)=>{let i=o*e[2]-o*c[2];return i===0&&u&&(i=e[4]-c[4]),i}),N.length){let e=6*N[0][2];I[0]=N[0][0]/e,I[1]=N[0][1]/e,u&&(e=6*N[0][4],I[2]=e!==0?N[0][3]/e:0),(I[0]t[1]||I[1]t[3]||u&&(I[2]t[5]))&&(I.length=0)}if(!I.length){const e=r.lengths[0]?S(g,0,T[0],u,l):null;if(!e)return null;I[0]=e[0],I[1]=e[1],u&&e.length>2&&(I[2]=e[2])}return n}function O(n,r,u,l,s,o,I=1){const N=P(s,o);let t=u,T=u+N,g=0,F=0,m=0,e=0,c=0;for(let _=0,V=l-1;_n[1]&&(n[1]=h),bn[3]&&(n[3]=b),s&&(fn[5]&&(n[5]=f))}if(e*I>0&&(e*=-1),c*I>0&&(c*=-1),!e)return null;const i=[g,F,.5*e];return s&&(i[3]=m,i[4]=.5*c),i}function S(n,r,u,l,s){const o=P(l,s);let I=r,N=r+o,t=0,T=0,g=0,F=0;for(let m=0,e=u-1;m0?l?[T/t,g/t,F/t]:[T/t,g/t]:u>0?l?[n[r],n[r+1],n[r+2]]:[n[r],n[r+1]]:null}function d(n,r,u,l){const s=u-n,o=l-r;return Math.sqrt(s*s+o*o)}function p(n,r,u,l,s,o){const I=l-n,N=s-r,t=o-u;return Math.sqrt(I*I+N*N+t*t)}function a(n,r,u,l){return[n+.5*(u-n),r+.5*(l-r)]}function q(n,r,u,l,s,o){return[n+.5*(l-n),r+.5*(s-r),u+.5*(o-u)]}export{M as t}; diff --git a/assets/chartCommon-98b0365b.js b/assets/chartCommon-98b0365b.js new file mode 100644 index 0000000..1cde58d --- /dev/null +++ b/assets/chartCommon-98b0365b.js @@ -0,0 +1 @@ +import{J as S,K as X,R as H,p as D,l as b,t as w,X as s,A as P,v as T,z as M,U as f}from"./Popup-db207f4c.js";import{u as Gt,Y as Nt}from"./Popup-db207f4c.js";import{n as x,o as R}from"./Button-5999eab8.js";import{s as Vt}from"./ColorSet-bb3b0c3c.js";import"./index-080e108a.js";import"./unitFormatUtils-b70a7bff.js";import"./AttachmentInfo-cb670dd0.js";import"./AttachmentQuery-972bbd60.js";import"./widget-78e8b6fe.js";import"./jsonUtils-f73b3833.js";import"./UniqueValueRenderer-fef4204d.js";import"./diffUtils-590c9088.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./Query-1c961d4c.js";import"./executeQueryJSON-7c41ada5.js";import"./query-93c6e211.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./FeatureSet-111cb247.js";import"./RelationshipQuery-39c07195.js";import"./TopFeaturesQuery-e44d05be.js";import"./FeatureLayer-5c6d2c3b.js";import"./MultiOriginJSONSupport-e4912ffd.js";import"./sql-734ecbc5.js";import"./FeatureLayerBase-7c7dfccb.js";import"./commonProperties-30089b06.js";import"./featureLayerUtils-6cf06f83.js";import"./serviceCapabilitiesUtils-959e798a.js";import"./editsZScale-1b5a53a6.js";import"./APIKeyMixin-878a7aa7.js";import"./ArcGISService-83287338.js";import"./CustomParametersMixin-231c4be8.js";import"./EditBusLayer-d71787e9.js";import"./FeatureEffectLayer-4160946c.js";import"./FeatureEffect-86735d98.js";import"./FeatureFilter-00f4be05.js";import"./FeatureReductionLayer-4262cf54.js";import"./LabelClass-2d53c485.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./OperationalLayer-0e8f8b28.js";import"./OrderedLayer-68067459.js";import"./PortalLayer-310c2800.js";import"./portalItemUtils-792a27e1.js";import"./TemporalLayer-f17c9161.js";import"./FeatureTemplate-2a7e96c1.js";import"./FeatureType-db96032c.js";import"./fieldProperties-62c55499.js";import"./labelingInfo-144f3d9f.js";import"./versionUtils-f17daa93.js";import"./styleUtils-25825fd6.js";import"./popupUtils-82ea8abb.js";class _ extends S{constructor(){super(...arguments),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:this._makeThumb()}),Object.defineProperty(this,"startGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"endGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"_thumbBusy",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_startDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_endDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_thumbDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_gripDown",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_addOrientationClass(){this._settings.themeTags=X(this._settings.themeTags,["scrollbar",this._settings.orientation]),this._settings.background||(this._settings.background=x.new(this._root,{themeTags:X(this._settings.themeTags,["main","background"])}))}_makeButton(){return this.children.push(R.new(this._root,{themeTags:["resize","button",this.get("orientation")],icon:H.new(this._root,{themeTags:["icon"]})}))}_makeThumb(){return this.children.push(x.new(this._root,{themeTags:["thumb",this.get("orientation")]}))}_handleAnimation(i){i&&this._disposers.push(i.events.on("stopped",()=>{this.setPrivateRaw("isBusy",!1),this._thumbBusy=!1}))}_afterNew(){this._addOrientationClass(),super._afterNew();const i=this.startGrip,r=this.endGrip,n=this.thumb,o=this.get("background");o&&this._disposers.push(o.events.on("click",a=>{this.setPrivateRaw("isBusy",!0);const h=this._display.toLocal(a.point),l=this.width(),m=this.height(),u=this.get("orientation");let d,p,g;d=u=="vertical"?(h.y-n.height()/2)/m:(h.x-n.width()/2)/l,u=="vertical"?(p=d*m,g="y"):(p=d*l,g="x");const c=this.get("animationDuration",0);c>0?(this._thumbBusy=!0,this._handleAnimation(this.thumb.animate({key:g,to:p,duration:c,easing:this.get("animationEasing")}))):(this.thumb.set(g,p),this._root.events.once("frameended",()=>{this.setPrivateRaw("isBusy",!1)}))})),this._disposers.push(n.events.on("dblclick",a=>{if(!D(a.originalEvent,this))return;const h=this.get("animationDuration",0),l=this.get("animationEasing");this.animate({key:"start",to:0,duration:h,easing:l}),this.animate({key:"end",to:1,duration:h,easing:l})})),this._disposers.push(i.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._startDown=!0,this._gripDown="start"})),this._disposers.push(r.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._endDown=!0,this._gripDown="end"})),this._disposers.push(n.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._thumbDown=!0,this._gripDown=void 0})),this._disposers.push(i.events.on("globalpointerup",()=>{this._startDown&&this.setPrivateRaw("isBusy",!1),this._startDown=!1})),this._disposers.push(r.events.on("globalpointerup",()=>{this._endDown&&this.setPrivateRaw("isBusy",!1),this._endDown=!1})),this._disposers.push(n.events.on("globalpointerup",()=>{this._thumbDown&&this.setPrivateRaw("isBusy",!1),this._thumbDown=!1})),this._disposers.push(i.on("x",()=>{this._updateThumb()})),this._disposers.push(r.on("x",()=>{this._updateThumb()})),this._disposers.push(i.on("y",()=>{this._updateThumb()})),this._disposers.push(r.on("y",()=>{this._updateThumb()})),this._disposers.push(n.events.on("positionchanged",()=>{this._updateGripsByThumb()})),this.get("orientation")=="vertical"?(i.set("x",0),r.set("x",0),this._disposers.push(n.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()-n.height()),0))),this._disposers.push(n.adapters.add("x",a=>this.width()/2)),this._disposers.push(i.adapters.add("x",a=>this.width()/2)),this._disposers.push(r.adapters.add("x",a=>this.width()/2)),this._disposers.push(i.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0))),this._disposers.push(r.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0)))):(i.set("y",0),r.set("y",0),this._disposers.push(n.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()-n.width()),0))),this._disposers.push(n.adapters.add("y",a=>this.height()/2)),this._disposers.push(i.adapters.add("y",a=>this.height()/2)),this._disposers.push(r.adapters.add("y",a=>this.height()/2)),this._disposers.push(i.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))),this._disposers.push(r.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))))}_updateChildren(){super._updateChildren(),(this.isDirty("end")||this.isDirty("start")||this._sizeDirty)&&this.updateGrips()}_changed(){if(super._changed(),this.isDirty("start")||this.isDirty("end")){const i="rangechanged";this.events.isEnabled(i)&&this.events.dispatch(i,{type:i,target:this,start:this.get("start",0),end:this.get("end",1),grip:this._gripDown})}}updateGrips(){const i=this.startGrip,r=this.endGrip,n=this.get("orientation"),o=this.height(),a=this.width();n=="vertical"?(i.set("y",o*this.get("start",0)),r.set("y",o*this.get("end",1))):(i.set("x",a*this.get("start",0)),r.set("x",a*this.get("end",1)));const h=this.getPrivate("positionTextFunction"),l=Math.round(100*this.get("start",0)),m=Math.round(100*this.get("end",0));let u,d;h?(u=h.call(this,this.get("start",0)),d=h.call(this,this.get("end",0))):(u=l+"%",d=m+"%"),i.set("ariaLabel",this._t("From %1",void 0,u)),i.set("ariaValueNow",""+l),i.set("ariaValueText",l+"%"),i.set("ariaValueMin","0"),i.set("ariaValueMax","100"),r.set("ariaLabel",this._t("To %1",void 0,d)),r.set("ariaValueNow",""+m),r.set("ariaValueText",m+"%"),r.set("ariaValueMin","0"),r.set("ariaValueMax","100")}_updateThumb(){const i=this.thumb,r=this.startGrip,n=this.endGrip,o=this.height(),a=this.width();let h=r.x(),l=n.x(),m=r.y(),u=n.y(),d=0,p=1;this.get("orientation")=="vertical"?b(m)&&b(u)&&(this._thumbBusy||i.isDragging()||(i.set("height",u-m),i.set("y",m)),d=m/o,p=u/o):b(h)&&b(l)&&(this._thumbBusy||i.isDragging()||(i.set("width",l-h),i.set("x",h)),d=h/a,p=l/a),!this.getPrivate("isBusy")||this.get("start")==d&&this.get("end")==p||(this.set("start",d),this.set("end",p));const g=this.getPrivate("positionTextFunction"),c=Math.round(100*this.get("start",0)),L=Math.round(100*this.get("end",0));let v,y;g?(v=g.call(this,this.get("start",0)),y=g.call(this,this.get("end",0))):(v=c+"%",y=L+"%"),i.set("ariaLabel",this._t("From %1 to %2",void 0,v,y)),i.set("ariaValueNow",""+c),i.set("ariaValueText",c+"%")}_updateGripsByThumb(){const i=this.thumb,r=this.startGrip,n=this.endGrip;if(this.get("orientation")=="vertical"){const o=i.height();r.set("y",i.y()),n.set("y",i.y()+o)}else{const o=i.width();r.set("x",i.x()),n.set("x",i.x()+o)}}}Object.defineProperty(_,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Scrollbar"}),Object.defineProperty(_,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:S.classNames.concat([_.className])});const kt=class extends w{setupDefaultRules(){super.setupDefaultRules(),this.rule("Component").setAll({interpolationDuration:600}),this.rule("Hierarchy").set("animationDuration",600),this.rule("Scrollbar").set("animationDuration",600),this.rule("Tooltip").set("animationDuration",300),this.rule("MapChart").set("animationDuration",1e3),this.rule("MapChart").set("wheelDuration",300),this.rule("Entity").setAll({stateAnimationDuration:600}),this.rule("Sprite").states.create("default",{stateAnimationDuration:600}),this.rule("Tooltip",["axis"]).setAll({animationDuration:200}),this.rule("WordCloud").set("animationDuration",500)}},At=class extends w{setupDefaultRules(){super.setupDefaultRules(),this.rule("InterfaceColors").setAll({stroke:s.fromHex(0),fill:s.fromHex(2829099),primaryButton:s.lighten(s.fromHex(6788316),-.2),primaryButtonHover:s.lighten(s.fromHex(6779356),-.2),primaryButtonDown:s.lighten(s.fromHex(6872181),-.2),primaryButtonActive:s.lighten(s.fromHex(6872182),-.2),primaryButtonText:s.fromHex(16777215),primaryButtonStroke:s.lighten(s.fromHex(6788316),-.2),secondaryButton:s.fromHex(3881787),secondaryButtonHover:s.lighten(s.fromHex(3881787),.1),secondaryButtonDown:s.lighten(s.fromHex(3881787),.15),secondaryButtonActive:s.lighten(s.fromHex(3881787),.2),secondaryButtonText:s.fromHex(12303291),secondaryButtonStroke:s.lighten(s.fromHex(3881787),-.2),grid:s.fromHex(12303291),background:s.fromHex(0),alternativeBackground:s.fromHex(16777215),text:s.fromHex(16777215),alternativeText:s.fromHex(0),disabled:s.fromHex(11382189),positive:s.fromHex(5288704),negative:s.fromHex(11730944)})}};let e=class extends w{constructor(){super(...arguments),Object.defineProperty(this,"responsiveRules",{enumerable:!0,configurable:!0,writable:!0,value:[]})}static widthXXS(t,i){return t<=e.XXS}static widthXS(t,i){return t<=e.XS}static widthS(t,i){return t<=e.S}static widthM(t,i){return t<=e.M}static widthL(t,i){return t<=e.L}static widthXL(t,i){return t<=e.XL}static widthXXL(t,i){return t<=e.XXL}static heightXXS(t,i){return i<=e.XXS}static heightXS(t,i){return i<=e.XS}static heightS(t,i){return i<=e.S}static heightM(t,i){return i<=e.M}static heightL(t,i){return i<=e.L}static heightXL(t,i){return i<=e.XL}static heightXXL(t,i){return i<=e.XXL}static isXXS(t,i){return t<=e.XXS&&i<=e.XXS}static isXS(t,i){return t<=e.XS&&i<=e.XS}static isS(t,i){return t<=e.S&&i<=e.S}static isM(t,i){return t<=e.M&&i<=e.M}static isL(t,i){return t<=e.L&&i<=e.L}static isXL(t,i){return t<=e.XL&&i<=e.XL}static isXXL(t,i){return t<=e.XXL&&i<=e.XXL}static maybeXXS(t,i){return t<=e.XXS||i<=e.XXS}static maybeXS(t,i){return t<=e.XS||i<=e.XS}static maybeS(t,i){return t<=e.S||i<=e.S}static maybeM(t,i){return t<=e.M||i<=e.M}static maybeL(t,i){return t<=e.L||i<=e.L}static maybeXL(t,i){return t<=e.XL||i<=e.XL}static maybeXXL(t,i){return t<=e.XXL||i<=e.XXL}static newEmpty(t){return new this(t,!0)}addRule(t){return t.name&&!t.template&&(t.template=this.rule(t.name,t.tags)),t._dp=new P([this._root._rootContainer.onPrivate("width",i=>{this._isUsed()&&this._applyRule(t)}),this._root._rootContainer.onPrivate("height",i=>{this._isUsed()&&this._applyRule(t)})]),this.responsiveRules.push(t),this._applyRule(t),t}removeRule(t){T(this.responsiveRules,t),t._dp&&t._dp.dispose()}_isUsed(){return this._root._rootContainer.get("themes").indexOf(this)!==-1}_applyRule(t){const i=this._root._rootContainer.getPrivate("width"),r=this._root._rootContainer.getPrivate("height"),n=t.relevant.call(t,i,r),o=t.applied;n?o||(t.applied=!0,t.template&&t.settings&&t.template.setAll(t.settings),t.applying&&t.applying.call(t)):o&&(t.applied=!1,t.template&&t.template.removeAll(),t.removing&&t.removing.call(t))}setupDefaultRules(){super.setupDefaultRules();const t=i=>this.addRule(i);t({name:"Chart",relevant:e.widthXXS,settings:{paddingLeft:0,paddingRight:0}}),t({name:"Chart",relevant:e.heightXXS,settings:{paddingTop:0,paddingBottom:0}}),t({name:"Bullet",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"Legend",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["vertical"],relevant:e.widthXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["horizontal"],relevant:e.heightXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","start"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","end"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Button",tags:["resize"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisRendererX",relevant:e.heightXS,settings:{inside:!0}}),t({name:"AxisRendererY",relevant:e.widthXS,settings:{inside:!0}}),t({name:"AxisRendererXLabel",relevant:e.heightXS,settings:{minPosition:.1,maxPosition:.9}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXS,settings:{centerY:M,maxPosition:.9}}),t({name:"AxisLabel",tags:["x"],relevant:e.heightXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXXS,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["x"],relevant:e.heightXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"AxisTick",tags:["y"],relevant:e.widthXXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"Grid",relevant:e.maybeXXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["radial"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeS,settings:{inside:!0}}),t({name:"AxisTick",relevant:e.maybeS,settings:{inside:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["circular"],relevant:e.maybeXS,settings:{inside:!0}}),t({name:"PieChart",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"PieChart",relevant:e.widthM,settings:{radius:f(99)}}),t({name:"RadialLabel",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"FunnelSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PyramidSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PictorialStackedSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","horizontal"],relevant:e.widthS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","vertical"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Chord",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"Label",tags:["hierarchy","node"],relevant:e.maybeXS,settings:{forceHidden:!0}})}};Object.defineProperty(e,"XXS",{enumerable:!0,configurable:!0,writable:!0,value:100}),Object.defineProperty(e,"XS",{enumerable:!0,configurable:!0,writable:!0,value:200}),Object.defineProperty(e,"S",{enumerable:!0,configurable:!0,writable:!0,value:300}),Object.defineProperty(e,"M",{enumerable:!0,configurable:!0,writable:!0,value:400}),Object.defineProperty(e,"L",{enumerable:!0,configurable:!0,writable:!0,value:600}),Object.defineProperty(e,"XL",{enumerable:!0,configurable:!0,writable:!0,value:800}),Object.defineProperty(e,"XXL",{enumerable:!0,configurable:!0,writable:!0,value:1e3});const Ot=e;export{kt as AnimatedThemeAm5,Vt as ColorSetAm5,At as DarkThemeAm5,Ot as ResponsiveThemeAm5,_ as ScrollbarAm5,w as ThemeAm5,Gt as TooltipAm5,Nt as colorAm5}; diff --git a/assets/cimAnalyzer-01879161.js b/assets/cimAnalyzer-01879161.js new file mode 100644 index 0000000..f1d303d --- /dev/null +++ b/assets/cimAnalyzer-01879161.js @@ -0,0 +1 @@ +import{bM as Be,t7 as le,ct as K,dI as mt,dG as xe,dH as Q,dF as We,cl as B,t8 as Ct,t9 as Me,ta as wt,bc as Qe,tb as L,tc as Y,td as Et,te as ts,tf as ue,tg as it,sZ as _t,th as Ne,sC as ks,ti as Gt,dJ as Is,dz as vt,tj as _i,tk as os,tl as di,tm as gi,oH as yi,tn as Pi,to as xi,tp as Mi,tq as fe,cn as bi,tr as Si,bF as ot,ts as Ci,bz as es,tt as b,tu as Ot,bE as Tt,tv as dt,tw as gt,tx as ss,ty as is,tz as vi,tA as Ls,tB as Os,tC as Ft,tD as Ue,tE as be,tF as wi,tG as ki,co as Ii,nL as Li,jE as Oi,tH as zi,tI as Ni,tJ as Ai,tK as Ti,tL as Fi,tM as as,tN as $i,tO as Ei,tP as hs,tQ as Gi,tR as Ri,tS as Xi,sD as zs,t6 as Nt,tT as Di,tU as Hi,bh as Ns,tV as Yi,tW as Vi,e5 as Ji,by as T,sX as ve,tX as V,tY as me,s_ as k,tZ as Bi,t_ as Wi,li as Ui,lj as ls,t$ as Rt,hg as Ae,hh as Te}from"./index-080e108a.js";import{t as cs,e as qi}from"./TileClipper-ae6eca9e.js";import{C as As,g as Ts}from"./definitions-0bc08d4c.js";import"./number-e491b09e.js";import{C as ji}from"./BidiEngine-9a40f2f4.js";const Fe=new ji;function Zi(l){if(l==null)return["",!1];if(!Fe.hasBidiChar(l))return[l,!1];let t;return t=Fe.checkContextual(l)==="rtl"?"IDNNN":"ICNNN",[Fe.bidiTransform(l,t,"VLYSN"),!0]}let A=class{static fromOptimized(t,e,s=!1,n=!1){return new qe().initialize(t,e,s,n,1)}static fromJSON(t,e=!1,s=!1){const[n,i]=us(t);return new je().initialize(n,i,e,s,1)}static fromOptimizedCIM(t,e,s=!1,n=!1){return new fs().initialize(t,e,s,n,1)}static fromJSONCIM(t,e=!1,s=!1){const[n,i]=us(t);return new ms().initialize(n,i,e,s,1)}static fromFeatureSetReader(t){const e=t.readGeometryForDisplay(),s=t.geometryType;return e&&s?this.fromOptimized(e,s):null}static fromFeatureSetReaderCIM(t){const e=t.readGeometryForDisplay(),s=t.geometryType;return e&&s?this.fromOptimizedCIM(e,s):null}static createEmptyOptimized(t,e=!1,s=!1){return new qe().initialize(new Be,t,e,s,1)}static createEmptyJSON(t,e=!1,s=!1){return new je().initialize([],t,e,s,1)}static createEmptyOptimizedCIM(t,e=!1,s=!1){return new fs().initialize(new Be,t,e,s,1)}static createEmptyJSONCIM(t,e=!1,s=!1){return new ms().initialize([],t,e,s,1)}asJSON(){const t=le(this);return this.geometryType==="esriGeometryEnvelope"?{xmin:t[0][0][0],ymin:t[0][0][1],xmax:t[0][2][0],ymax:t[0][2][1]}:this.geometryType==="esriGeometryMultipoint"?{points:t.flat()}:this.geometryType==="esriGeometryPoint"?{x:t[0][0][0],y:t[0][0][1]}:this.geometryType==="esriGeometryPolygon"?{rings:t}:{paths:t}}invertY(){this.yFactor*=-1}},qe=class Fs extends A{constructor(){super(...arguments),this._end=-1}initialize(t,e,s,n,i){return this.hasZ=s,this.hasM=n,this.geometryType=e,this._stride=2+Number(s)+Number(n),this._geometry=t,this._pathIndex=-1,this._pathOffset=0,this._pointOffset=-this._stride,this._end=-1,this.yFactor=i,this}reset(){this.initialize(this._geometry,this.geometryType,this.hasZ,this.hasM,this.yFactor)}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(t){const e=this._pathOffset+t*this._stride;return e>=0&&e=this._pathOffset}nextPath(){if(this._pathIndex>=0){const e=this._geometry.isPoint?1:this._geometry.lengths[this._pathIndex];this._pathOffset+=this._stride*e}this._pointOffset=this._pathOffset-this._stride;const t=this._geometry.isPoint?1:this._geometry.lengths[this._pathIndex+1];return this._end=this._pointOffset+this._stride+this._stride*t,++this._pathIndext.length-1?0:t[this._pathIndex]}get numPaths(){return this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(t){this._geometry.coords[this._pointOffset]=t}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(t){this._geometry.coords[this._pointOffset+1]=this.yFactor*t}get z(){return this._geometry.coords[this._pointOffset+2]}set z(t){this._geometry.coords[this._pointOffset+2]=t}get m(){const t=this.hasZ?3:2;return this._geometry.coords[this._pointOffset+t]}set m(t){this._geometry.coords[this._pointOffset+3]=t}get pathIndex(){return this._pathIndex}get pointIndex(){return this._pointOffset/this._stride}};function Ki(l){const t=[l.x,l.y];return l.z&&t.push(l.z),l.m&&t.push(l.m),t}function us(l){return K(l)?[l.rings,"esriGeometryPolygon"]:mt(l)?[l.paths,"esriGeometryPolyline"]:xe(l)?[[l.points],"esriGeometryMultipoint"]:Q(l)?[[[[l.xmin,l.ymin],[l.xmin,l.ymax],[l.xmax,l.ymax],[l.xmax,l.ymin],[l.xmin,l.ymin]]],"esriGeometryEnvelope"]:We(l)?[[[Ki(l)]],"esriGeometryPoint"]:[[],"esriGeometryPolyline"]}let je=class $s extends A{initialize(t,e,s,n,i){return this._paths=t,this.geometryType=e,this.hasZ=s,this.hasM=n,this._pathIndex=this._pointIndex=-1,this.yFactor=i,this._mIdx=this.hasZ?3:2,this}reset(){this._pathIndex=this._pointIndex=-1}seekPathStart(){this._pointIndex=-1}seekPathEnd(){this._pointIndex=this._currentPath.length}seekInPath(t){return t>=0&&t=0}nextPath(){return this._pointIndex=-1,this._currentPath=this._paths[++this._pathIndex],this._pathIndexthis.numPaths-1?-1:this._paths[this._pathIndex].length}get numPaths(){return this._paths.length}get x(){return this._currentPoint[0]}set x(t){this._currentPoint[0]=t}get y(){return this.yFactor*this._currentPoint[1]}set y(t){this._currentPoint[1]=this.yFactor*t}get z(){return this._currentPoint[2]}set z(t){this._currentPoint[2]=t}get m(){return this._currentPoint[this._mIdx]}set m(t){this._currentPoint[this._mIdx]=t}get pathIndex(){return this._pathIndex}get pointIndex(){return this._pointIndex}};const pe=4,_e=1;let fs=class Es extends qe{initialize(t,e,s,n,i){return super.initialize(t,e,s,n,i),this._controlPoints||(this._controlPoints=this._controlPoints=new Array(this.numPaths).fill(void 0).map(r=>new Set)),this}startPath(){super.startPath(),this._controlPoints.push(new Set)}clone(){const t=new Es().initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor);return t._controlPoints=this._controlPoints,t}setControlPoint(){this._controlPoints[this.pathIndex].add(this.pointIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this.pointIndex)}setControlPointAt(t){this._controlPoints[this.pathIndex].add(t)}getControlPointAt(t){return this._controlPoints[this.pathIndex].has(t)}},ms=class Gs extends je{initialize(t,e,s,n,i){return super.initialize(t,e,s,n,i)}clone(){return new Gs().initialize(B(this._paths),this.geometryType,this.hasZ,this.hasM,1)}setControlPoint(){this._paths[this.pathIndex][this.pointIndex][pe]=_e}getControlPoint(){return this._paths[this.pathIndex][this.pointIndex][pe]===_e}setControlPointAt(t){this._paths[this.pathIndex][t][pe]=_e}getControlPointAt(t){return this._paths[this.pathIndex][t][pe]===_e}};const Qi=512;let rt,Ze=class{constructor(t){this._geometry=t}next(){const t=this._geometry;return this._geometry=null,t}};function rs(l,t){rt||(rt=new qi(0,0,0,1));const e=l.geometryType==="esriGeometryPolygon",s=e?cs.Polygon:cs.LineString,n=e?3:2;let i,r;for(rt.reset(s),rt.setPixelMargin(t+1),rt.setExtent(Qi);l.nextPath();)if(!(l.numPoints1&&y>0&&h>0&&(o*g+a*d)/y/h<=this._maxCosAngle&&t.setControlPointAt(f-1),f===1&&(c=g,u=d,m=y),y>0&&(n=_,i=p,o=g,a=d,h=y)}this._isClosed&&h>0&&m>0&&(o*c+a*u)/m/h<=this._maxCosAngle&&t.setControlPointAt(0)}}},$t=class{constructor(){this.setIdentity()}getAngle(){return(this.rz==null||this.rz===0&&this.rzCos!==1&&this.rzSin!==0)&&(this.rz=Math.atan2(this.rzSin,this.rzCos)),this.rz}setIdentity(){this.tx=0,this.ty=0,this.tz=0,this.s=1,this.rx=0,this.ry=0,this.rz=0,this.rzCos=1,this.rzSin=0}setTranslate(t,e){this.tx=t,this.ty=e}setTranslateZ(t){this.tz=t}setRotateCS(t,e){this.rz=void 0,this.rzCos=t,this.rzSin=e}setRotate(t){this.rz=t,this.rzCos=void 0,this.rzSin=void 0}setRotateY(t){this.ry=t}setScale(t){this.s=t}setMeasure(t){this.m=t}};function $e(l,t){l[4]=t}let ce=class{constructor(t,e=!0,s=!0,n=0){this.isClosed=!1,this.geometryCursor=null,this.geometryCursor=!e&&t.geometryType==="esriGeometryPolygon"||!s&&t.geometryType==="esriGeometryPolyline"?null:t,this.geomUnitsPerPoint=n,this.iteratePath=!1,this.internalPlacement=new $t}next(){if(!this.geometryCursor)return null;for(;this.iteratePath||this.geometryCursor.nextPath();){this.geometryCursor.seekPathStart();const t=this.processPath(this.geometryCursor);if(t)return t}return this.geometryCursor=null,null}},Le=class{constructor(t,e,s,n=0){this.isClosed=!1,this.inputGeometries=t,this.acceptPolygon=e,this.acceptPolyline=s,this.geomUnitsPerPoint=n,this.iteratePath=!1,this.multiPathCursor=null}next(){for(;;){if(!this.multiPathCursor){let t=this.inputGeometries.next();for(;t&&(this.isClosed=this.acceptPolygon&&t.geometryType==="esriGeometryPolygon"||t.geometryType==="esriGeometryEnvelope",this.multiPathCursor=t,!this.multiPathCursor);)t=this.inputGeometries.next();if(!this.multiPathCursor)return null}for(;this.iteratePath||this.multiPathCursor.nextPath();){this.multiPathCursor.seekPathStart();const t=this.processPath(this.multiPathCursor);if(t)return t}this.multiPathCursor=null}}};const he=.03;let at=class{constructor(t=0,e=!1){}isEmpty(t){if(!t.nextPoint())return!0;let e,s,n,i;for(e=t.x,s=t.y;t.nextPoint();e=s,s=i)if(n=t.x,i=t.y,n!==e||i!==s)return t.seekPathStart(),!1;return t.seekPathStart(),!0}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);e!==0&&(t[0]/=e,t[1]/=e)}getLength(t,e,s,n){const i=s-t,r=n-e;return Math.sqrt(i*i+r*r)}getSegLength(t){const[[e,s],[n,i]]=t;return this.getLength(e,s,n,i)}getCoord2D(t,e,s,n,i){return[t+(s-t)*i,e+(n-e)*i]}getSegCoord2D(t,e){const[[s,n],[i,r]]=t;return this.getCoord2D(s,n,i,r,e)}getAngle(t,e,s,n,i){const r=s-t,o=n-e;return Math.atan2(o,r)}getAngleCS(t,e,s,n,i){const r=s-t,o=n-e,a=Math.sqrt(r*r+o*o);return a>0?[r/a,o/a]:[1,0]}getSegAngleCS(t,e){const[[s,n],[i,r]]=t;return this.getAngleCS(s,n,i,r,e)}cut(t,e,s,n,i,r){return[i<=0?[t,e]:this.getCoord2D(t,e,s,n,i),r>=1?[s,n]:this.getCoord2D(t,e,s,n,r)]}getSubCurve(t,e,s){const n=A.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(n,t,e,s)?n:null}appendSubCurve(t,e,s,n){t.startPath(),e.seekPathStart();let i=0,r=!0;if(!e.nextPoint())return!1;let o=e.x,a=e.y;for(;e.nextPoint();){const h=this.getLength(o,a,e.x,e.y);if(h!==0){if(r){if(i+h>s){const c=(s-i)/h;let u=1,m=!1;i+h>=n&&(u=(n-i)/h,m=!0);const f=this.cut(o,a,e.x,e.y,c,u);if(f&&t.pushPoints(f),m)break;r=!1}}else{if(i+h>n){const c=this.cut(o,a,e.x,e.y,0,(n-i)/h);c&&t.pushPoint(c[1]);break}t.pushXY(e.x,e.y)}i+=h,o=e.x,a=e.y}else o=e.x,a=e.y}return!0}getCIMPointAlong(t,e){if(!t.nextPoint())return null;let s,n,i,r,o=0;for(s=t.x,n=t.y;t.nextPoint();s=i,n=r){i=t.x,r=t.y;const a=this.getLength(s,n,i,r);if(a!==0){if(o+a>e){const h=(e-o)/a;return this.getCoord2D(s,n,i,r,h)}o+=a}}return null}offset(t,e,s,n,i){if(!t||t.length<2)return null;let r=0,o=t[r++],a=r;for(;r=0==e<=0){if(d<1){const y=[_[0]-p[0],_[1]-p[1]];this.normalize(y);const x=Math.sqrt((1+d)/2);if(x>1/n){const P=-Math.abs(e)/x;c.push([u[0]-y[0]*P,u[1]-y[1]*P])}}}else switch(s){case Ct.Mitered:{const y=Math.sqrt((1+d)/2);if(y>0&&1/y0){const x=1/y;let P=x;for(let M=1;M0){const i=A.createEmptyOptimizedCIM(t.geometryType),r=le(t)[0],o=this._curveHelper.offset(r,this._size,Ct.Rounded,4,this._offsetFlattenError);if(o)return i.pushPath(o),i}else if(this._size<0){const i=t.asJSON();if(Math.min(i.xmax-i.xmin,i.ymax-i.ymin)+2*this._size>0)return A.fromJSONCIM({xmin:i.xmin-this._size,xmax:i.xmax+this._size,ymin:i.ymin-this._size,ymax:i.ymax+this._size})}}const e=this._geometryEngine;if(e==null)return null;const s=this._tileKey?rs(t,this._maxInflateSize):t;if(!s)continue;const n=e.buffer(Qe.WebMercator,s.asJSON(),this._size,1);return n?A.fromJSONCIM(n):null}return null}},Hs=class Vt{static local(){return Vt.instance===null&&(Vt.instance=new Vt),Vt.instance}execute(t,e,s,n,i){return new or(t,e,s)}};Hs.instance=null;let or=class{constructor(t,e,s){this._defaultPointSize=20,this._inputGeometries=t,this._geomUnitsPerPoint=s,this._rule=e.rule??L.FullGeometry,this._defaultSize=this._defaultPointSize*s}next(){let t;for(;t=this._inputGeometries.next();){const e=this._processGeom(le(t));if(e&&e.length)return A.fromJSONCIM({paths:e})}return null}_clone(t){return[t[0],t[1]]}_mid(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}_mix(t,e,s,n){return[t[0]*e+s[0]*n,t[1]*e+s[1]*n]}_add(t,e){return[t[0]+e[0],t[1]+e[1]]}_add2(t,e,s){return[t[0]+e,t[1]+s]}_sub(t,e){return[t[0]-e[0],t[1]-e[1]]}_dist(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}_norm(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}_normalize(t,e=1){const s=e/this._norm(t);t[0]*=s,t[1]*=s}_leftPerpendicular(t){const e=-t[1],s=t[0];t[0]=e,t[1]=s}_leftPerp(t){return[-t[1],t[0]]}_rightPerpendicular(t){const e=t[1],s=-t[0];t[0]=e,t[1]=s}_rightPerp(t){return[t[1],-t[0]]}_dotProduct(t,e){return t[0]*e[0]+t[1]*e[1]}_crossProduct(t,e){return t[0]*e[1]-t[1]*e[0]}_rotateDirect(t,e,s){const n=t[0]*e-t[1]*s,i=t[0]*s+t[1]*e;t[0]=n,t[1]=i}_makeCtrlPt(t){const e=[t[0],t[1]];return $e(e,1),e}_addAngledTicks(t,e,s,n){const i=this._sub(s,e);this._normalize(i);const r=this._crossProduct(i,this._sub(n,e));let o;o=r>0?this._rightPerp(i):this._leftPerp(i);const a=Math.abs(r)/2,h=[];h.push([e[0]+(o[0]-i[0])*a,e[1]+(o[1]-i[1])*a]),h.push(e),h.push(s),h.push([s[0]+(o[0]+i[0])*a,s[1]+(o[1]+i[1])*a]),t.push(h)}_addBezier2(t,e,s,n,i){if(i--==0)return void t.push(n);const r=this._mid(e,s),o=this._mid(s,n),a=this._mid(r,o);this._addBezier2(t,e,r,a,i),this._addBezier2(t,a,o,n,i)}_addBezier3(t,e,s,n,i,r){if(r--==0)return void t.push(i);const o=this._mid(e,s),a=this._mid(s,n),h=this._mid(n,i),c=this._mid(o,a),u=this._mid(a,h),m=this._mid(c,u);this._addBezier3(t,e,o,c,m,r),this._addBezier3(t,m,u,h,i,r)}_add90DegArc(t,e,s,n,i){const r=i??this._crossProduct(this._sub(s,e),this._sub(n,e))>0,o=this._mid(e,s),a=this._sub(o,e);r?this._leftPerpendicular(a):this._rightPerpendicular(a),o[0]+=a[0],o[1]+=a[1],this._addBezier3(t,e,this._mix(e,.33333,o,.66667),this._mix(s,.33333,o,.66667),s,4)}_addArrow(t,e,s){const n=e[0],i=e[1],r=e[e.length-1],o=this._sub(n,i);this._normalize(o);const a=this._crossProduct(o,this._sub(r,i)),h=.5*a,c=this._leftPerp(o),u=[r[0]-c[0]*a,r[1]-c[1]*a],m=e.length-1,f=[];f.push(s?[-c[0],-c[1]]:c);let _=[-o[0],-o[1]];for(let p=1;p0;p--)t.push([e[p][0]+f[p][0]*h,e[p][1]+f[p][1]*h]);t.push([u[0]+f[0][0]*h,u[1]+f[0][1]*h]),t.push([u[0]+f[0][0]*a,u[1]+f[0][1]*a]),t.push(n),t.push([u[0]-f[0][0]*a,u[1]-f[0][1]*a]),t.push([u[0]-f[0][0]*h,u[1]-f[0][1]*h]);for(let p=1;p=2?t[1]:this._add2(t[0],e*this._defaultSize,s*this._defaultSize)}_cp3(t,e,s,n){if(t.length>=3)return t[2];const i=this._mix(t[0],1-s,e,s),r=this._sub(e,t[0]);return this._normalize(r),this._rightPerpendicular(r),[i[0]+r[0]*n*this._defaultSize,i[1]+r[1]*n*this._defaultSize]}_arrowPath(t){if(t.length>2)return t;const e=t[0],s=this._cp2(t,-4,0),n=this._sub(e,s);this._normalize(n);const i=this._rightPerp(n);return[e,s,[e[0]+(i[0]-n[0])*this._defaultSize,e[1]+(i[1]-n[1])*this._defaultSize]]}_arrowLastSeg(t){const e=t[0],s=this._cp2(t,-4,0);let n;if(t.length>=3)n=t[t.length-1];else{const i=this._sub(e,s);this._normalize(i);const r=this._rightPerp(i);n=[e[0]+(r[0]-i[0])*this._defaultSize,e[1]+(r[1]-i[1])*this._defaultSize]}return[s,n]}_processGeom(t){if(!t)return null;const e=[];for(const s of t){if(!s||s.length===0)continue;const n=s.length;let i=s[0];switch(this._rule){case L.PerpendicularFromFirstSegment:{const r=this._cp2(s,0,-1),o=this._cp3(s,r,.5,4),a=[];a.push(o),a.push(this._mid(i,r)),e.push(a);break}case L.ReversedFirstSegment:{const r=this._cp2(s,0,-1);e.push([r,i]);break}case L.PerpendicularToSecondSegment:{const r=this._cp2(s,-4,1),o=this._cp3(s,r,.882353,-1.94),a=[];a.push(this._mid(r,o)),a.push(i),e.push(a);break}case L.SecondSegmentWithTicks:{const r=this._cp2(s,-4,1),o=this._cp3(s,r,.882353,-1.94),a=this._sub(o,r);let h;h=this._crossProduct(a,this._sub(i,r))>0?this._rightPerp(h):this._leftPerp(a);const c=[];c.push([r[0]+(h[0]-a[0])/3,r[1]+(h[1]-a[1])/3]),c.push(r),c.push(o),c.push([o[0]+(h[0]+a[0])/3,o[1]+(h[1]+a[1])/3]),e.push(c);break}case L.DoublePerpendicular:{const r=this._cp2(s,0,-1),o=this._cp3(s,r,.5,3),a=this._mid(i,r),h=this._sub(a,o);this._normalize(h);const c=this._crossProduct(h,this._sub(i,o));this._leftPerpendicular(h);const u=[];u.push(i),u.push([o[0]+h[0]*c,o[1]+h[1]*c]),e.push(u);const m=[];m.push([o[0]-h[0]*c,o[1]-h[1]*c]),m.push(r),e.push(m);break}case L.OppositeToFirstSegment:{const r=this._cp2(s,0,-1),o=this._cp3(s,r,.5,3),a=this._mid(i,r),h=this._sub(a,o);this._normalize(h);const c=this._crossProduct(h,this._sub(i,o));this._leftPerpendicular(h);const u=[];u.push([o[0]+h[0]*c,o[1]+h[1]*c]),u.push([o[0]-h[0]*c,o[1]-h[1]*c]),e.push(u);break}case L.TriplePerpendicular:{const r=this._cp2(s,0,-1),o=this._cp3(s,r,.5,4),a=this._mid(i,r),h=this._sub(a,o);this._normalize(h);const c=this._crossProduct(h,this._sub(i,o));this._leftPerpendicular(h);const u=[];u.push([o[0]+h[0]*c*.8,o[1]+h[1]*c*.8]),u.push([a[0]+.8*(i[0]-a[0]),a[1]+.8*(i[1]-a[1])]),e.push(u),e.push([o,a]);const m=[];m.push([o[0]-h[0]*c*.8,o[1]-h[1]*c*.8]),m.push([a[0]+.8*(r[0]-a[0]),a[1]+.8*(r[1]-a[1])]),e.push(m);break}case L.HalfCircleFirstSegment:{const r=this._cp2(s,0,-1),o=this._cp3(s,r,.5,4),a=this._mid(i,r);let h=this._sub(r,i);const c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),m=Math.sqrt((1+c)/2),f=Math.sqrt((1-c)/2),_=[];let p;this._crossProduct(h,this._sub(o,i))>0?(_.push(i),h=this._sub(i,a),p=r):(_.push(r),h=this._sub(r,a),p=i),this._rotateDirect(h,m,f),h[0]/=m,h[1]/=m;for(let g=1;g<=18;g++)_.push(this._add(a,h)),this._rotateDirect(h,c,u);_.push(p),e.push(_);break}case L.HalfCircleSecondSegment:{const r=this._cp2(s,0,-1),o=this._cp3(s,r,1,-1);let a=this._sub(i,r);this._normalize(a);const h=this._crossProduct(a,this._sub(o,r))/2;this._leftPerpendicular(a);const c=[r[0]+a[0]*h,r[1]+a[1]*h];a=this._sub(r,c);const u=Math.cos(Math.PI/18);let m=Math.sin(Math.PI/18);h>0&&(m=-m);const f=[r];for(let _=1;_<=18;_++)this._rotateDirect(a,u,m),f.push(this._add(c,a));e.push(f);break}case L.HalfCircleExtended:{const r=this._cp2(s,0,-2),o=this._cp3(s,r,1,-1);let a;if(n>=4)a=s[3];else{const _=this._sub(i,r);a=this._add(o,_)}const h=this._dist(r,o)/2/.75,c=this._sub(r,i);this._normalize(c,h);const u=this._sub(o,a);this._normalize(u,h);const m=[a,o];e.push(m);const f=[this._clone(o)];this._addBezier3(f,o,this._add(o,u),this._add(r,c),r,4),f.push(i),e.push(f);break}case L.OpenCircle:{const r=this._cp2(s,-2,0),o=this._sub(r,i),a=Math.cos(Math.PI/18),h=-Math.sin(Math.PI/18),c=[r];for(let u=1;u<=33;u++)this._rotateDirect(o,a,h),c.push(this._add(i,o));e.push(c);break}case L.CoverageEdgesWithTicks:{const r=this._cp2(s,0,-1);let o,a;if(n>=3)o=s[2];else{const m=this._sub(r,i),f=this._leftPerp(m);o=[i[0]+f[0]-.25*m[0],i[1]+f[1]-.25*m[1]]}if(n>=4)a=s[3];else{const m=this._mid(i,r),f=this._sub(i,r);this._normalize(f),this._leftPerpendicular(f);const _=this._crossProduct(f,this._sub(o,m));this._rightPerpendicular(f),a=[o[0]+f[0]*_*2,o[1]+f[1]*_*2]}const h=this._sub(r,i);let c,u;c=this._crossProduct(h,this._sub(o,i))>0?this._rightPerp(h):this._leftPerp(h),u=[],u.push(o),u.push(i),u.push([i[0]+(c[0]-h[0])/3,i[1]+(c[1]-h[1])/3]),e.push(u),c=this._crossProduct(h,this._sub(a,r))>0?this._rightPerp(c):this._leftPerp(h),u=[],u.push([r[0]+(c[0]+h[0])/3,r[1]+(c[1]+h[1])/3]),u.push(r),u.push(a),e.push(u);break}case L.GapExtentWithDoubleTicks:{const r=this._cp2(s,0,2),o=this._cp3(s,r,0,1);let a;if(n>=4)a=s[3];else{const h=this._sub(r,i);a=this._add(o,h)}this._addAngledTicks(e,i,r,this._mid(o,a)),this._addAngledTicks(e,o,a,this._mid(i,r));break}case L.GapExtentMidline:{const r=this._cp2(s,2,0),o=this._cp3(s,r,0,1);let a;if(n>=4)a=s[3];else{const c=this._sub(r,i);a=this._add(o,c)}const h=[];h.push(this._mid(i,o)),h.push(this._mid(r,a)),e.push(h);break}case L.Chevron:{const r=this._cp2(s,-1,-1);let o;if(n>=3)o=s[2];else{const a=this._sub(r,i);this._leftPerpendicular(a),o=this._add(i,a)}e.push([r,this._makeCtrlPt(i),o]);break}case L.PerpendicularWithArc:{const r=this._cp2(s,0,-2),o=this._cp3(s,r,.5,-1);let a=this._sub(r,i);const h=this._norm(a);a[0]/=h,a[1]/=h;const c=this._crossProduct(a,this._sub(o,i));let u=this._dotProduct(a,this._sub(o,i));u<.05*h?u=.05*h:u>.95*h&&(u=.95*h);const m=[i[0]+a[0]*u,i[1]+a[1]*u];this._leftPerpendicular(a);let f=[];f.push([m[0]-a[0]*c,m[1]-a[1]*c]),f.push([m[0]+a[0]*c,m[1]+a[1]*c]),e.push(f);const _=[r[0]+a[0]*c,r[1]+a[1]*c];a=this._sub(r,_);const p=Math.cos(Math.PI/18);let g=Math.sin(Math.PI/18);c<0&&(g=-g),f=[i,r];for(let d=1;d<=9;d++)this._rotateDirect(a,p,g),f.push(this._add(_,a));e.push(f);break}case L.ClosedHalfCircle:{const r=this._cp2(s,2,0),o=this._mid(i,r),a=this._sub(r,o),h=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[i,r];for(let m=1;m<=18;m++)this._rotateDirect(a,h,c),u.push(this._add(o,a));e.push(u);break}case L.TripleParallelExtended:{const r=this._cp2(s,0,-2),o=this._cp3(s,r,1,-2),a=this._mid(i,r),h=this._sub(o,r);this._normalize(h);const c=Math.abs(this._crossProduct(h,this._sub(a,r)))/2,u=this._dist(r,o),m=[r,i];m.push([i[0]+h[0]*u*.5,i[1]+h[1]*u*.5]),e.push(m);const f=[];f.push([a[0]-h[0]*c,a[1]-h[1]*c]),f.push([a[0]+h[0]*u*.375,a[1]+h[1]*u*.375]),$e(f[f.length-1],1),f.push([a[0]+h[0]*u*.75,a[1]+h[1]*u*.75]),e.push(f);const _=[r,o];e.push(_);break}case L.ParallelWithTicks:{const r=this._cp2(s,3,0),o=this._cp3(s,r,.5,-1),a=this._sub(o,r);this._normalize(a);const h=this._crossProduct(a,this._sub(o,i));this._leftPerpendicular(a),this._addAngledTicks(e,i,r,o),this._addAngledTicks(e,this._mix(i,1,a,h),this._mix(r,1,a,h),this._mid(i,r));break}case L.Parallel:{const r=this._cp2(s,3,0),o=this._cp3(s,r,.5,-1),a=this._sub(r,i);this._normalize(a);const h=this._leftPerp(a),c=this._crossProduct(a,this._sub(o,i));let u=[i,r];e.push(u),u=[],u.push([i[0]+h[0]*c,i[1]+h[1]*c]),u.push([r[0]+h[0]*c,r[1]+h[1]*c]),e.push(u);break}case L.PerpendicularToFirstSegment:{const r=this._cp2(s,3,0),o=this._cp3(s,r,.5,-1),a=this._mid(i,r),h=this._sub(r,i);this._normalize(h);const c=this._crossProduct(h,this._sub(o,i));this._leftPerpendicular(h);const u=[];u.push([a[0]-h[0]*c*.25,a[1]-h[1]*c*.25]),u.push([a[0]+h[0]*c*1.25,a[1]+h[1]*c*1.25]),e.push(u);break}case L.ParallelOffset:{const r=this._cp2(s,3,0),o=this._cp3(s,r,.5,-1),a=this._sub(r,i);this._normalize(a);const h=this._crossProduct(a,this._sub(o,i));this._leftPerpendicular(a);const c=[];c.push([i[0]-a[0]*h,i[1]-a[1]*h]),c.push([r[0]-a[0]*h,r[1]-a[1]*h]),e.push(c);const u=[];u.push([i[0]+a[0]*h,i[1]+a[1]*h]),u.push([r[0]+a[0]*h,r[1]+a[1]*h]),e.push(u);break}case L.OffsetOpposite:{const r=this._cp2(s,3,0),o=this._cp3(s,r,.5,-1),a=this._sub(r,i);this._normalize(a);const h=this._crossProduct(a,this._sub(o,i));this._leftPerpendicular(a);const c=[];c.push([i[0]-a[0]*h,i[1]-a[1]*h]),c.push([r[0]-a[0]*h,r[1]-a[1]*h]),e.push(c);break}case L.OffsetSame:{const r=this._cp2(s,3,0),o=this._cp3(s,r,.5,-1),a=this._sub(r,i);this._normalize(a);const h=this._crossProduct(a,this._sub(o,i));this._leftPerpendicular(a);const c=[];c.push([i[0]+a[0]*h,i[1]+a[1]*h]),c.push([r[0]+a[0]*h,r[1]+a[1]*h]),e.push(c);break}case L.CircleWithArc:{let r=this._cp2(s,3,0);const o=this._cp3(s,r,.5,-1);let a,h;if(n>=4)a=s[3],h=this._crossProduct(this._sub(a,r),this._sub(o,r))>0;else{a=r,h=this._crossProduct(this._sub(a,i),this._sub(o,i))>0;const _=24*this._geomUnitsPerPoint,p=this._sub(a,i);this._normalize(p,_);const g=Math.sqrt(2)/2;this._rotateDirect(p,g,h?g:-g),r=this._add(i,p)}const c=this._sub(r,i),u=Math.cos(Math.PI/18),m=Math.sin(Math.PI/18),f=[r];for(let _=1;_<=36;_++)this._rotateDirect(c,u,m),f.push(this._add(i,c));this._add90DegArc(f,r,a,o,h),$e(f[f.length-8],1),e.push(f);break}case L.DoubleJog:{let r,o,a=this._cp2(s,-3,1);if(r=n>=3?s[2]:this._add(i,this._sub(i,a)),n>=4)o=s[3];else{const d=i;i=a,o=r;const y=this._dist(i,d),x=this._dist(o,d);let P=30*this._geomUnitsPerPoint;.5*y0?this._rotateDirect(p,_,-_):this._rotateDirect(p,_,_);let g=[];g.push(a),g.push(this._add(h,p)),g.push(this._sub(h,p)),g.push(i),e.push(g),p=this._sub(o,r),this._normalize(p,f),this._crossProduct(p,this._sub(i,r))<0?this._rotateDirect(p,_,_):this._rotateDirect(p,_,-_),g=[],g.push(r),g.push(this._add(c,p)),g.push(this._sub(c,p)),g.push(o),e.push(g);break}case L.PerpendicularOffset:{const r=this._cp2(s,-4,1),o=this._cp3(s,r,.882353,-1.94),a=this._sub(o,r);this._crossProduct(a,this._sub(i,r))>0?this._rightPerpendicular(a):this._leftPerpendicular(a);const h=[a[0]/8,a[1]/8],c=this._sub(this._mid(r,o),h);e.push([c,i]);break}case L.LineExcludingLastSegment:{const r=this._arrowPath(s),o=[];let a=r.length-2;for(;a--;)o.push(r[a]);e.push(o);break}case L.MultivertexArrow:{const r=this._arrowPath(s),o=[];this._addArrow(o,r,!1),e.push(o);break}case L.CrossedArrow:{const r=this._arrowPath(s),o=[];this._addArrow(o,r,!0),e.push(o);break}case L.ChevronArrow:{const[r,o]=this._arrowLastSeg(s),a=10*this._geomUnitsPerPoint,h=this._sub(i,r);this._normalize(h);const c=this._crossProduct(h,this._sub(o,r)),u=this._leftPerp(h),m=[o[0]-u[0]*c*2,o[1]-u[1]*c*2],f=[];f.push([o[0]+h[0]*a,o[1]+h[1]*a]),f.push(i),f.push([m[0]+h[0]*a,m[1]+h[1]*a]),e.push(f);break}case L.ChevronArrowOffset:{const[r,o]=this._arrowLastSeg(s),a=this._sub(i,r);this._normalize(a);const h=this._crossProduct(a,this._sub(o,r));this._leftPerpendicular(a);const c=[o[0]-a[0]*h,o[1]-a[1]*h],u=[];u.push([c[0]+a[0]*h*.5,c[1]+a[1]*h*.5]),u.push(this._mid(c,i)),u.push([c[0]-a[0]*h*.5,c[1]-a[1]*h*.5]),e.push(u);break}case L.PartialFirstSegment:{const[r,o]=this._arrowLastSeg(s),a=this._sub(i,r);this._normalize(a);const h=this._crossProduct(a,this._sub(o,r));this._leftPerpendicular(a);const c=[o[0]-a[0]*h,o[1]-a[1]*h];e.push([r,c]);break}case L.Arch:{const r=this._cp2(s,0,-1),o=this._cp3(s,r,.5,1),a=this._sub(i,r),h=this._mix(o,1,a,.55),c=this._mix(o,1,a,-.55),u=[i];this._addBezier2(u,i,h,o,4),this._addBezier2(u,o,c,r,4),e.push(u);break}case L.CurvedParallelTicks:{const r=this._cp2(s,-4,1),o=this._cp3(s,r,.882353,-1.94),a=this._sub(o,r);this._crossProduct(a,this._sub(i,r))>0?this._rightPerpendicular(a):this._leftPerpendicular(a);const h=[a[0]/8,a[1]/8],c=this._sub(this._mid(r,o),h),u=this._sub(this._mix(r,.75,o,.25),h),m=this._sub(this._mix(r,.25,o,.75),h),f=[r];this._addBezier2(f,r,u,c,3),this._addBezier2(f,c,m,o,3),e.push(f);for(let _=0;_<8;_++){const p=f[2*_+1],g=[this._clone(p)];g.push(this._add(p,[a[0]/4,a[1]/4])),e.push(g)}break}case L.Arc90Degrees:{const r=this._cp2(s,0,-1),o=this._cp3(s,r,.5,1),a=[r];this._add90DegArc(a,r,i,o),e.push(a);break}case L.FullGeometry:default:e.push(s)}}return e}},Ys=class Jt{static local(){return Jt.instance===null&&(Jt.instance=new Jt),Jt.instance}execute(t,e,s,n,i){return new ar(t,e,s)}};Ys.instance=null;let ar=class extends Le{constructor(t,e,s){super(t,!0,!0),this._curveHelper=new at,this._beginCut=(e.beginCut!==void 0?e.beginCut:1)*s,this._endCut=(e.endCut!==void 0?e.endCut:1)*s,this._middleCut=(e.middleCut!==void 0?e.middleCut:0)*s,this._invert=e.invert!==void 0&&e.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(t){const{_beginCut:e,_endCut:s,_middleCut:n}=this,i=t.pathLength(),r=A.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._invert){if(e!==0||s!==0||n!==0)if(e+s+n>=i)for(r.startPath();t.nextPoint();)r.pushXY(t.x,t.y);else this._curveHelper.appendSubCurve(r,t,0,e),this._curveHelper.appendSubCurve(r,t,.5*(i-n),.5*(i+n)),this._curveHelper.appendSubCurve(r,t,i-s,s)}else if(e===0&&s===0&&n===0)for(r.startPath();t.nextPoint();)r.pushXY(t.x,t.y);else e+s+n0&&(i/=this._currentPosition.segmentLength),this._currentPosition.copyTo(e);e.abscissa+t*this._partLengthRatio>e.segmentLength+this._tolerance;){if(s){if(s.numPoints===0)if(i===0){const o=e.segment[0];s.pushXY(o[0],o[1])}else s.pushPoint(this.getSegCoord2D(e.segment,i));const r=e.segment[1];s.pushXY(r[0],r[1])}if(i=0,t-=(e.segmentLength-e.abscissa)/this._partLengthRatio,this._partSegCount)e.segment=this._nextSegment(),e.segmentLength=this.getSegLength(e.segment),e.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return n!==pt.FAIL&&(e.segmentLength=this.getSegLength(e.segment),e.isPartEnd=!0,n===pt.END?(e.abscissa=e.segmentLength,e.isPathEnd=!0):e.abscissa=e.segmentLength+t,!0);this._currentPosition.copyTo(e)}}if(e.abscissa+=t*this._partLengthRatio,s){s.numPoints===0&&(i===0?s.pushPoint(e.segment[0]):s.pushPoint(this.getSegCoord2D(e.segment,i)));const r=e.abscissa/e.segmentLength;r===1?s.pushPoint(e.segment[1]):s.pushPoint(this.getSegCoord2D(e.segment,r))}return this._partSegCount||Math.abs(e.abscissa-e.segmentLength)=this._pathCursor.numPoints&&(s=0),this._ctrlPtEnd=this._pathCursor.getControlPointAt(s),this._patternLength>0){const n=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,i=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let r=Math.round((this._partLength-(n+i))/this._patternLength);r<=0&&(r=n+i>0?0:1),this._partLengthRatio=this._partLength/(n+i+r*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg=e;)n-=e,e=this._pattern.nextValue(),r=!r;e-=n,r?(this._walker.nextPosition(e),e=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(e),e=this._pattern.nextValue(),this._walker.nextPosition(e),e=this._pattern.nextValue())}let s=this._walker.nextCurve(e);if(s)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)s.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else e=this._pattern.nextValue(),!this._walker.nextPosition(e)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(s=this._firstCurve,this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,s=this._firstCurve,this._firstCurve=null;return s==null||s.reset(),s}},Js=class Wt{static local(){return Wt.instance===null&&(Wt.instance=new Wt),Wt.instance}execute(t,e,s,n,i,r){return new lr(t,e,s,n,i,r)}};Js.instance=null;let lr=class{constructor(t,e,s,n,i,r){switch(this._inputGeometries=t,this._tileKey=n,this._geometryEngine=i,this._maxInflateSize=r*s,this._width=(e.width!==void 0?e.width:2)*s,e.method){case Et.Mitered:case Et.Bevelled:case Et.Rounded:case Et.TrueBuffer:case Et.Square:}this._option=e.option}next(){let t;for(;t=this._inputGeometries.next();){if(t.geometryType==="esriGeometryEnvelope"&&this._width>0){const e=t.asJSON();return Math.min(e.xmax-e.xmin,e.ymax-e.ymin)-2*this._width<0?t:A.fromJSONCIM({paths:[[[e.xmin+this._width,e.ymin+this._width],[e.xmax-this._width,e.ymin+this._width],[e.xmax-this._width,e.ymax-this._width],[e.xmin+this._width,e.ymax-this._width],[e.xmin+this._width,e.ymin+this._width]],[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]})}if(t.geometryType==="esriGeometryPolygon"){if(this._width===0)return t.clone();const e=this._geometryEngine;if(e==null)return null;const s=this._tileKey?rs(t,this._maxInflateSize):t.clone();if(!s)continue;const n=e.buffer(Qe.WebMercator,s.asJSON(),-this._width,1);if(n)for(const i of n.rings)i&&s.pushPath(i.reverse());return s}}return null}},Bs=class Ut{static local(){return Ut.instance===null&&(Ut.instance=new Ut),Ut.instance}execute(t,e,s,n,i){return new cr(t,e,s)}};Bs.instance=null;let cr=class extends Le{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new at,this._length=(e.length!==void 0?e.length:20)*s,this._angle=e.angle!==void 0?e.angle:225,this._position=e.position!==void 0?e.position:50,this._length<0&&(this._length=-this._length),this._position<20&&(this._position=20),this._position>80&&(this._position=80),this._mirror=!1}processPath(t){const e=A.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._curveHelper.isEmpty(t))return null;t.seekInPath(0);const s=t.x,n=t.y;t.seekInPath(t.numPoints-1);const i=t.x,r=t.y,o=[i-s,r-n];this._curveHelper.normalize(o);const a=s+(i-s)*this._position/100,h=n+(r-n)*this._position/100,c=Math.cos((90-this._angle)/180*Math.PI);let u=Math.sin((90-this._angle)/180*Math.PI);this._mirror&&(u=-u),this._mirror=!this._mirror;const m=[a-this._length/2*c,h-this._length/2*u],f=[a+this._length/2*c,h+this._length/2*u];return e.pushPath([[s,n],m,f,[i,r]]),e}},Ws=class qt{static local(){return qt.instance===null&&(qt.instance=new qt),qt.instance}execute(t,e,s,n,i){return new ur(t,e,s)}};Ws.instance=null;let ur=class{constructor(t,e,s){this._inputGeometries=t,this._offsetX=e.offsetX!==void 0?e.offsetX*s:0,this._offsetY=e.offsetY!==void 0?e.offsetY*s:0}next(){let t=this._inputGeometries.next();for(;t;){if(t.numPaths>0)return this._move(t.clone(),this._offsetX,this._offsetY);t=this._inputGeometries.next()}return null}_move(t,e,s){for(;t.nextPath();)for(;t.nextPoint();)t.x=t.x+e,t.y=t.y+s;return t.reset(),t}},Us=class jt{static local(){return jt.instance===null&&(jt.instance=new jt),jt.instance}execute(t,e,s,n,i,r){return new fr(t,e,s,n,i,r)}};Us.instance=null;let fr=class{constructor(t,e,s,n,i,r){this._inputGeometries=t,this._tileKey=n,this._geometryEngine=i,this._curveHelper=new at,this._offset=(e.offset??1)*s,this._method=e.method,this._maxInflateSize=r*s,this._option=e.option,this._offsetFlattenError=he*s}next(){let t;for(;t=this._inputGeometries.next();){if(this._offset===0)return t.clone();if(t.geometryType==="esriGeometryEnvelope"){if(this._method===Ct.Rounded&&this._offset>0){const r=wt(t),o=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(o){const a=A.createEmptyOptimizedCIM(t.geometryType);return a.pushPath(o),a}return null}const i=t.asJSON();if(Q(i)&&Math.min(i.xmax-i.xmin,i.ymax-i.ymin)+2*this._offset>0)return A.fromJSONCIM({xmin:i.xmin-this._offset,xmax:i.xmax+this._offset,ymin:i.ymin-this._offset,ymax:i.ymax+this._offset})}const e=this._geometryEngine;if(e==null)continue;const s=this._tileKey?rs(t,this._maxInflateSize):t.clone();if(!s)continue;const n=e.offset(Qe.WebMercator,s.asJSON(),-this._offset,1,this._method,4,this._offsetFlattenError);return n?A.fromJSONCIM(n):null}return null}},qs=class Zt{static local(){return Zt.instance===null&&(Zt.instance=new Zt),Zt.instance}execute(t,e,s,n,i){return new mr(t,e,s)}};qs.instance=null;let mr=class{constructor(t,e,s){this._inputGeometries=t,this._reverse=e.reverse===void 0||e.reverse}next(){let t=this._inputGeometries.next();for(;t;){if(!this._reverse)return t;if(t.geometryType==="esriGeometryPolyline")return pr(t.clone());t=this._inputGeometries.next()}return null}};function pr(l){for(;l.nextPath();)for(let t=0;t0){const e=ts(t),s=(e[2]+e[0])/2,n=(e[3]+e[1])/2;return t.reset(),this._rotate(t.clone(),s,n)}t=this._inputGeometries.next()}return null}_rotate(t,e,s){const n=Math.cos(this._rotateAngle),i=Math.sin(this._rotateAngle);for(;t.nextPath();)for(;t.nextPoint();){const r=t.x-e,o=t.y-s;t.x=e+r*n-o*i,t.y=s+r*i+o*n}return t.reset(),t}},Zs=class Qt{static local(){return Qt.instance===null&&(Qt.instance=new Qt),Qt.instance}execute(t,e,s,n,i){return new dr(t,e,s)}};Zs.instance=null;let dr=class{constructor(t,e,s){this._inputGeometries=t,this._xFactor=e.XScaleFactor!==void 0?e.XScaleFactor:1.15,this._yFactor=e.YScaleFactor!==void 0?e.YScaleFactor:1.15}next(){const t=this._inputGeometries.next();if(t){if(this._xFactor===1&&this._yFactor===1||t.geometryType==="esriGeometryPoint")return t;if(t.numPaths>0){const e=ts(t),s=(e[2]+e[0])/2,n=(e[3]+e[1])/2;return t.reset(),this._scaleCursor(t.clone(),s,n)}}return null}_scaleCursor(t,e,s){for(;t.nextPath();)for(;t.nextPoint();)t.x=e+(t.x-e)*this._xFactor,t.y=s+(t.y-s)*this._yFactor;return t.reset(),t}},Ks=class te{static local(){return te.instance===null&&(te.instance=new te),te.instance}execute(t,e,s,n,i){return new gr(t,e,s)}};Ks.instance=null;let gr=class{constructor(t,e,s){this._inputGeometries=t,this._height=(e.amplitude!==void 0?e.amplitude:2)*s,this._period=(e.period!==void 0?e.period:3)*s,this._style=e.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new Oe,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new ze,this._walker.updateTolerance(s)}next(){let t=this._inputGeometries.next();for(;t;){if(this._height===0||this._period===0)return t;const e=this._processGeom(t);if(e)return e;t=this._inputGeometries.next()}return null}_processGeom(t){const e=A.createEmptyOptimizedCIM(t.geometryType);for(;t.nextPath();){e.startPath();const s=t.pathLength();if(this._walker.init(t,this._pattern))switch(this._style){case ue.Sinus:default:this._constructCurve(e,s,!1);break;case ue.Square:this._constructSquare(e,s);break;case ue.Triangle:this._constructTriangle(e,s);break;case ue.Random:this._constructCurve(e,s,!0)}else for(;t.nextPoint();)e.pushXY(t.x,t.y)}return e}_constructCurve(t,e,s){let n=Math.round(e/this._period);n===0&&(n=1);const i=n*16+1,r=e/n,o=this._period/16,a=1/i,h=2*Math.PI*e/r,c=2*Math.PI*Math.random(),u=2*Math.PI*Math.random(),m=2*Math.PI*Math.random(),f=.75-Math.random()/2,_=.75-Math.random()/2,p=new nt;this._walker.curPointAndAngle(p),t.pushPoint(p.pt);let g=0;for(;;){if(!this._walker.nextPointAndAngle(o,p)){t.pushPoint(this._walker.getPathEnd());break}{const d=g;let y;if(g+=a,s){const x=this._height/2*(1+.3*Math.sin(f*h*d+c));y=x*Math.sin(h*d+u),y+=x*Math.sin(_*h*d+m),y/=2}else y=.5*this._height*Math.sin(.5*h*d);t.pushXY(p.pt[0]-y*p.sa,p.pt[1]+y*p.ca)}}}_constructSquare(t,e){Math.round(e/this._period);let s=!0;for(;;){let n=!1;if(this._walker.curPositionIsValid()){const i=new nt;this._walker.curPointAndAngle(i);const r=new nt;if(this._walker.nextPointAndAngle(this._period,r)){const o=new nt;this._walker.nextPointAndAngle(this._period,o)&&(s?(t.pushPoint(i.pt),s=!1):t.pushPoint(i.pt),t.pushXY(i.pt[0]-this._height/2*i.sa,i.pt[1]+this._height/2*i.ca),t.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),t.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca),t.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca),n=!0)}}if(!n){t.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(t,e){Math.round(e/this._period);let s=!0;for(;;){let n=!1;if(this._walker.curPositionIsValid()){const i=new nt;this._walker.curPointAndAngle(i);const r=new nt;if(this._walker.nextPointAndAngle(this._period/2,r)){const o=new nt;this._walker.nextPointAndAngle(this._period,o)&&(this._walker.nextPosition(this._period/2)&&(s?(t.pushPoint(i.pt),s=!1):t.pushPoint(i.pt),t.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),t.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca)),n=!0)}}if(!n){t.pushPoint(this._walker.getPathEnd());break}}}},Qs=class ee{static local(){return ee.instance===null&&(ee.instance=new ee),ee.instance}execute(t,e,s,n,i){return new yr(t,e,s)}};Qs.instance=null;let yr=class extends ce{constructor(t,e,s){super(t),this._geometryWalker=new ze,this._geometryWalker.updateTolerance(s),this._angleToLine=e.angleToLine??!0,this._offset=(e.offset?e.offset:0)*s,this._originalEndings=e.endings,this._offsetAtEnd=(e.customEndingOffset?e.customEndingOffset:0)*s,this._position=-(e.offsetAlongLine?e.offsetAlongLine:0)*s,this._pattern=new Oe,this._pattern.init(e.placementTemplate,!1),this._pattern.scale(s),this._endings=this._originalEndings}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath)e=this._pattern.nextValue();else{this._originalEndings===it.WithFullGap&&this.isClosed?this._endings=it.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let n,i=!0;switch(this._endings){case it.NoConstraint:n=-this._position,n=this._adjustPosition(n),i=!1;break;case it.WithHalfGap:default:n=-this._pattern.lastValue()/2;break;case it.WithFullGap:n=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case it.WithMarkers:n=0;break;case it.Custom:n=-this._position,n=this._adjustPosition(n),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(t,this._pattern,i))return null;this._pattern.reset();let r=0;for(;n>r;)n-=r,r=this._pattern.nextValue();r-=n,e=r,this.iteratePath=!0}const s=new nt;return this._geometryWalker.nextPointAndAngle(e,s)?this._endings===it.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===it.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(t){let e=t/this._pattern.length();return e-=Math.floor(e),e*this._pattern.length()}},ti=class se{static local(){return se.instance===null&&(se.instance=new se),se.instance}execute(t,e,s,n,i){return new Pr(t,e,s)}};ti.instance=null;let Pr=class extends ce{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new at,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._type=e.extremityPlacement,this._position=e.offsetAlongLine!==void 0?e.offsetAlongLine*s:0,this._beginProcessed=!1}processPath(t){let e;switch(this._type){case _t.Both:default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iteratePath=!0);break;case _t.JustBegin:e=this._atExtremities(t,this._position,!0);break;case _t.JustEnd:e=this._atExtremities(t,this._position,!1);case _t.None:}return e}_atExtremities(t,e,s){if(s||t.seekPathEnd(),s?t.nextPoint():t.prevPoint()){let n=0,[i,r]=[0,0],[o,a]=[t.x,t.y];for(;s?t.nextPoint():t.prevPoint();){i=o,r=a,o=t.x,a=t.y;const h=this._curveHelper.getLength(i,r,o,a);if(n+h>e){const c=(e-n)/h,[u,m]=this._curveHelper.getAngleCS(i,r,o,a,c),f=this._curveHelper.getCoord2D(i,r,o,a,c);return this.internalPlacement.setTranslate(f[0]-this._offset*m,f[1]+this._offset*u),this._angleToLine&&this.internalPlacement.setRotateCS(-u,-m),this.internalPlacement}n+=h}}return null}},ei=class ie{static local(){return ie.instance===null&&(ie.instance=new ie),ie.instance}execute(t,e,s,n,i){return new xr(t,e,s)}};ei.instance=null;let xr=class extends ce{constructor(t,e,s){super(t),this._walker=new ze,this._walker.updateTolerance(s),this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._beginGap=e.beginPosition!==void 0?e.beginPosition*s:0,this._endGap=e.endPosition!==void 0?e.endPosition*s:0,this._flipFirst=e.flipFirst===void 0||e.flipFirst,this._pattern=new Oe,this._pattern.init(e.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath){const o=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+o;e=a-this._prevPos,this._prevPos=a}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=t.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(t,this._pattern,!1))return null;this._pattern.reset();const o=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+o;e=a-this._prevPos,this._prevPos=a,this.iteratePath=!0}const s=new nt;if(!this._walker.nextPointAndAngle(e,s,pt.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca);const n=this._isFirst&&this._flipFirst;let i,r;return this._angleToLine?(i=s.ca,r=s.sa):(i=1,r=0),n&&(i=-i,r=-r),this.internalPlacement.setRotateCS(i,r),this._isFirst=!1,this._posCount--,this._posCount===0&&(this.iteratePath=!1),this.internalPlacement}};const ft=512,Mr=10,U=24,we=1e-6;let si=class re{static local(){return re.instance===null&&(re.instance=new re),re.instance}execute(t,e,s,n,i){return new br(t,e,s,n,i)}};si.instance=null;let br=class xt{constructor(t,e,s,n,i){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(e.stepX??16)*s,this._stepY=Math.abs(e.stepY??16)*s,this._stepX=Math.round(128*this._stepX)/128,this._stepY=Math.round(128*this._stepY)/128,this._stepX!==0&&this._stepY!==0){if(this._gridType=e.gridType??Ne.Fixed,this._gridType===Ne.Random){const r=e.seed??13,o=1;this._randomLCG=new ks(r*o),this._randomness=(e.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=e.gridAngle??0,this._shiftOddRows=e.shiftOddRows??!1,this._offsetX=(e.offsetX??0)*s,this._offsetY=(e.offsetY??0)*s,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}if(this._graphicOriginX=0,this._graphicOriginY=0,n!=null){const[r,o,a,h]=n.split("/"),c=parseFloat(r),u=parseFloat(o),m=parseFloat(a),f=parseFloat(h);this._graphicOriginX=-(f*2**c+m)*ft,this._graphicOriginY=u*ft,this._testInsidePolygon=!0}this._internalPlacement=new $t,this._calculateMinMax(t),this._geometryCursor=t}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!xt._randValues){xt._randValues=[];for(let t=0;t=y,this._polygonMin=this._verticalSubdivision?m:_,this._testInsidePolygon){let x=0-this._graphicOriginX-this._offsetX-this._stepX,P=ft-this._graphicOriginX-this._offsetX+this._stepX,M=-ft-this._graphicOriginY-this._offsetY-this._stepY,S=0-this._graphicOriginY-this._offsetY+this._stepY;if(g){const w=[[x,M],[x,S],[P,M],[P,S]];x=M=Number.MAX_VALUE,P=S=-Number.MAX_VALUE;for(const C of w){const I=this._cosAngle*C[0]-this._sinAngle*C[1],v=this._sinAngle*C[0]+this._cosAngle*C[1];x=Math.min(x,I),P=Math.max(P,I),M=Math.min(M,v),S=Math.max(S,v)}}a=a!==Number.MAX_VALUE?Math.max(a,x):x,h=h!==Number.MAX_VALUE?Math.max(h,M):M,c=c!==-Number.MAX_VALUE?Math.min(c,P):P,u=u!==-Number.MAX_VALUE?Math.min(u,S):S}this._xMin=Math.round(a/this._stepX),this._xMax=Math.round(c/this._stepX),this._yMin=Math.round(h/this._stepY),this._yMax=Math.round(u/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(t,_,p,m,f)}_buildAccelerationMap(t,e,s,n,i){t.reset();const r=new Map,o=this._verticalSubdivision,a=o?i-n:s-e;let h=Math.ceil(a/Mr);if(h<=1)return;const c=Math.floor(a/h);let u,m,f,_,p,g,d,y,x,P,M;for(h++,this._delta=c,o?(x=-ft-this._stepY,P=this._stepY,M=n):(x=-this._stepX,P=ft+this._stepX,M=e);t.nextPath();)if(!(t.numPoints<2)&&t.nextPoint())for(u=t.x,m=t.y;t.nextPoint();u=f,m=_){if(f=t.x,_=t.y,o){if(m===_||mP&&_>P)continue;p=Math.min(m,_),g=Math.max(m,_)}else{if(u===f||uP&&f>P)continue;p=Math.min(u,f),g=Math.max(u,f)}for(;pd&&_s(y,u,m,f,_,r)}this._accelerationMap=r}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let t=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(t+=.5*this._stepX);const e=this._currentY*this._stepY+this._offsetY;let s,n;if(this._currentX++,this._gridType===Ne.Random){const i=(this._currentX%U+U)%U,r=(this._currentY%U+U)%U;s=this._graphicOriginX+t+this._stepX*this._randomness*(.5-xt._randValues[r*U+i])*2/3,n=this._graphicOriginY+e+this._stepY*this._randomness*(.5-xt._randValues[r*U+i+1])*2/3}else s=this._graphicOriginX+this._cosAngle*t+this._sinAngle*e,n=this._graphicOriginY-this._sinAngle*t+this._cosAngle*e;if(!this._testInsidePolygon||this._isInsidePolygon(s,n,this._geometryCursor))return this._internalPlacement.setTranslate(s,n),this._internalPlacement}}_isInsidePolygon(t,e,s){if(this._accelerationMap==null)return Sr(t,e,s);t+=we,e+=we;const n=this._verticalSubdivision,i=n?e:t,r=Math.floor((i-this._polygonMin)/this._delta),o=this._accelerationMap.get(r);if(!o)return!1;let a,h,c,u=0;for(const m of o){if(a=m[0],h=m[1],n){if(a[1]>e==h[1]>e)continue;c=(h[0]-a[0])*(e-a[1])-(h[1]-a[1])*(t-a[0])}else{if(a[0]>t==h[0]>t)continue;c=(h[1]-a[1])*(t-a[0])-(h[0]-a[0])*(e-a[1])}c>0?u++:u--}return u!==0}};function Sr(l,t,e){let s,n,i,r,o=0;for(l+=we,t+=we,e.reset();e.nextPath();)if(e.nextPoint())for(s=e.x,n=e.y;e.nextPoint();s=i,n=r)i=e.x,r=e.y,n>t!=r>t&&((i-s)*(t-n)-(r-n)*(l-s)>0?o++:o--);return o!==0}function _s(l,t,e,s,n,i){let r=i.get(l);r||(r=[],i.set(l,r)),r.push([[t,e],[s,n]])}const Cr=.001;let ii=class ne{static local(){return ne.instance===null&&(ne.instance=new ne),ne.instance}execute(t,e,s,n,i){return new vr(t,e,s)}};ii.instance=null;let vr=class extends ce{constructor(t,e,s){super(t),this._curveHelper=new at,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._relativeTo=e.relativeTo,this._position=e.startPointOffset!==void 0?e.startPointOffset*s:0,this._epsilon=Cr*s}processPath(t){const e=this._position;if(this._relativeTo===Gt.SegmentMidpoint){if(this.iteratePath||(this.iteratePath=!0),t.nextPoint()){let[n,i]=[t.x,t.y],[r,o]=[0,0];for(;t.nextPoint();){r=t.x,o=t.y;const a=this._curveHelper.getLength(n,i,r,o);if(an){const m=(n-r)/u,[f,_]=this._curveHelper.getAngleCS(o,a,h,c,m),p=this._curveHelper.getCoord2D(o,a,h,c,m),g=i?-this._offset:this._offset;return this.internalPlacement.setTranslate(p[0]-g*_,p[1]+g*f),this._angleToLine&&(i?this.internalPlacement.setRotateCS(-f,-_):this.internalPlacement.setRotateCS(f,_)),this.internalPlacement}o=h,a=c,r+=u}}return null}};const wr=1e-15;let ri=class oe{static local(){return oe.instance===null&&(oe.instance=new oe),oe.instance}execute(t,e,s,n,i){return new kr(t,e,s)}};ri.instance=null;let kr=class extends ce{constructor(t,e,s){super(t),this._curveHelper=new at,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._endPoints=e.placeOnEndPoints===void 0||e.placeOnEndPoints,this._controlPoints=e.placeOnControlPoints===void 0||e.placeOnControlPoints,this._regularVertices=e.placeOnRegularVertices===void 0||e.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(t){if(this.iteratePath||(this._preparePath(t),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const e=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(e[2]);let s=e[0],n=e[1];if(this._offset!==0){const i=Math.cos(e[2]),r=Math.sin(e[2]);s-=this._offset*r,n+=this._offset*i}return this.internalPlacement.setTranslate(s,n),this._tagIterator++,this.internalPlacement}_preparePath(t){this._tags.length=0,this._tagIterator=0,t.seekPathStart();const e=t.isClosed();let s=0,n=!1,i=0,r=0;if(t.seekPathStart(),t.nextPoint()){let o=t.x,a=t.y,h=t.getControlPoint(),c=!0,u=t.nextPoint();for(;u;){const m=t.x,f=t.y,_=t.getControlPoint();(this._angleToLine||this._offset!==0)&&(i=this._curveHelper.getAngle(o,a,m,f,0)),c?(c=!1,e?(s=i,n=h):(this._endPoints||this._controlPoints&&h)&&this._tags.push([o,a,i])):h?this._controlPoints&&this._tags.push([o,a,ge(r,i)]):this._regularVertices&&this._tags.push([o,a,ge(r,i)]),(this._angleToLine||this._offset!==0)&&(r=this._curveHelper.getAngle(o,a,m,f,1)),u=t.nextPoint(),u||(e?_||n?this._controlPoints&&this._tags.push([m,f,ge(r,s)]):this._regularVertices&&this._tags.push([m,f,ge(r,s)]):(this._endPoints||this._controlPoints&&_)&&this._tags.push([m,f,r])),o=m,a=f,h=_}}this._tagIterator=0}};function ge(l,t){const e=Math.PI;for(;Math.abs(t-l)>e+2*wr;)t-l>e?t-=2*e:t+=2*e;return(l+t)/2}let Ir=class{constructor(t=Lr){this._data=[],this._compare=t}get size(){return this._data.length}enqueue(t){if(t==null)return;const{_data:e,_compare:s}=this;e.push(t);let n=e.length-1>>>0;const i=e[n];for(;n>0;){const r=n-1>>1,o=e[r];if(!(s(o,i)<=0))break;e[r]=i,e[n]=o,n=r}}dequeue(){const{_data:t,_compare:e}=this,s=t[0],n=t.pop();if(t.length===0)return s;t[0]=n;let i=0;const r=t.length,o=t[0];let a,h,c=null;for(;;){const u=2*i+1,m=2*i+2;if(c=null,u0&&(c=u)),mlt?1:0,Or=100*222045e-21;function zr(l){return Nr({rings:le(l)})}function Nr(l){const{rings:t}=l;if(!t||t.length===0)return null;const e=Is(vt(),l);if(!e)return null;const s=4*(Math.abs(e[0])+Math.abs(e[2])+Math.abs(e[1])+Math.abs(e[3])+1)*Or;let n=0,i=0;for(let v=0;vi&&(i=O,n=v)}if(Math.abs(i)<=2*s*s){const v=os(vt(),t[n]);return[(v[0]+v[2])/2,(v[1]+v[3])/2]}const r=di(t[n],!1,vt());if(r===null)return null;if(t.length===1&&t[0].length<4)return r;const o=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],a=[NaN,NaN,NaN,NaN],h=[NaN,NaN,NaN,NaN];let c=!1,u=Xt(r,l,!0);u.distance===0&&(c=!0,o[0][0]=r[0],o[0][1]=r[1],u=Xt(r,l,!1)),a[0]=u.distance,h[0]=0;const m=[NaN,NaN];let f=!1,_=.25,p=-1;const g=os(vt(),t[n]);let d=NaN;do if(d=NaN,o[1]=Ge(l,Re(g[0],g[2],_),s,e),isNaN(o[1][0])||isNaN(o[1][1])||(u=Xt(o[1],l,!1),d=u.distance),!isNaN(d)&&d>s&&Se(o[1],l))f=!0,a[1]=d,h[1]=Mt(o[1],r);else if(!isNaN(d)&&d>p&&(p=d,m[0]=o[1][0],m[1]=o[1][1]),_-=.01,_<.1){if(!(p>=0))break;f=!0,a[1]=p,o[1][0]=m[0],o[1][1]=m[1],h[1]=Mt(o[1],r)}while(!f);f=!1,_=.5,p=-1;let y=.01,x=1;do if(d=NaN,o[2]=Ge(l,Re(g[0],g[2],_),s,e),isNaN(o[2][0])||isNaN(o[2][1])||(u=Xt(o[2],l,!1),d=u.distance),!isNaN(d)&&d>s&&Se(o[2],l))f=!0,a[2]=d,h[2]=Mt(o[2],r);else if(!isNaN(d)&&d>p)p=d,m[0]=o[2][0],m[1]=o[2][1];else if(d>p&&(p=d,m[0]=o[2][0],m[1]=o[2][1]),_=.5+y*x,y+=.01,x*=-1,_<.3||_>.7){if(!(p>=0))break;f=!0,a[2]=p,o[2][0]=m[0],o[2][1]=m[1],h[2]=Mt(o[2],r)}while(!f);f=!1,_=.75,p=-1;do if(d=NaN,o[3]=Ge(l,Re(g[0],g[2],_),s,e),isNaN(o[3][0])||isNaN(o[3][1])||(u=Xt(o[3],l,!1),d=u.distance),!isNaN(d)&&d>s&&Se(o[3],l))f=!0,a[3]=d,h[3]=Mt(o[3],r);else if(d>p&&(p=d,m[0]=o[3][0],m[1]=o[3][1]),_+=.01,_>.9){if(!(p>=0))break;f=!0,a[3]=p,o[3][0]=m[0],o[3][1]=m[1],h[3]=Mt(o[3],r)}while(!f);const P=[0,1,2,3],M=c?0:1;let S;for(let v=M;v<4;v++)for(let O=M;O<3;O++){const G=h[O],z=h[O+1];Fr(G,z)>0&&(S=P[O],P[O]=P[O+1],P[O+1]=S,h[O]=z,h[O+1]=G)}let w=M,C=0,I=0;for(let v=M;v<4;v++){switch(v){case 0:I=2*a[P[v]];break;case 1:I=1.66666666*a[P[v]];break;case 2:I=1.33333333*a[P[v]];break;case 3:I=a[P[v]]}I>C&&(C=I,w=P[v])}return o[w]}function Se(l,t){const{rings:e}=t;let s=0;for(const n of e){const i=n.length;for(let r=1;rl[1]!=a[1]>l[1]&&((a[0]-o[0])*(l[1]-o[1])-(a[1]-o[1])*(l[0]-o[0])>0?s++:s--)}}return s!==0}function Xt(l,t,e){if(e&&Se(l,t))return{coord:l,distance:0};let s=1/0,n=0,i=0;const r=[0,0],{rings:o}=t;for(const a of o)if(!(a.length<2))for(let h=0;hr?yu)s&ds?(s&ye?(t[1]+=u*(i-t[0])/c,t[0]=i):(t[1]+=u*(o-t[0])/c,t[0]=o),s=q(t,l)):n&ds?(n&ye?(e[1]+=u*(i-e[0])/c,e[0]=i):(e[1]+=u*(o-e[0])/c,e[0]=o),n=q(e,l)):s?(s&Pe?(t[0]+=c*(r-t[1])/u,t[1]=r):(t[0]+=c*(a-t[1])/u,t[1]=a),s=q(t,l)):(n&Pe?(e[0]+=c*(r-e[1])/u,e[1]=r):(e[0]+=c*(a-e[1])/u,e[1]=a),n=q(e,l));else if(s&gs?(s&Pe?(t[0]+=c*(r-t[1])/u,t[1]=r):(t[0]+=c*(a-t[1])/u,t[1]=a),s=q(t,l)):n&gs?(n&Pe?(e[0]+=c*(r-e[1])/u,e[1]=r):(e[0]+=c*(a-e[1])/u,e[1]=a),n=q(e,l)):s?(s&ye?(t[1]+=u*(i-t[0])/c,t[0]=i):(t[1]+=u*(o-t[0])/c,t[0]=o),s=q(t,l)):(n&ye?(e[1]+=u*(i-e[0])/c,e[0]=i):(e[1]+=u*(o-e[0])/c,e[0]=o),n=q(e,l)),s&n)return 0}while(s|n);return h}function q(l,t){return(l[0]t[2]?1:0)<<1|(l[1]t[3]?1:0)<<3}function Re(l,t,e){return l+(t-l)*e}function Mt(l,t){return(l[0]-t[0])*(l[0]-t[0])+(l[1]-t[1])*(l[1]-t[1])}function Fr(l,t){if(lt)return 1;if(l===t)return 0;const e=isNaN(l),s=isNaN(t);return es?1:0}let zt=class{constructor(t,e,s,n){this.x=t,this.y=e,this.cellSize=s,this.distancefromCellCenter=Mi(t,e,n),this.maxDistanceToPolygon=this.distancefromCellCenter+this.cellSize*Math.SQRT2}};const $r=1,Er=100;function Gr(l){if(!l.nextPath()||!l.numPoints)return null;const t=Pi(l),e=t[2]-t[0],s=t[3]-t[1];if(e===0||s===0)return[t[0]+e/2,t[1]+s/2];const n=Math.max(Math.min(e,s)/Er,$r),i=new Ir((f,_)=>_.maxDistanceToPolygon-f.maxDistanceToPolygon),r=Math.min(e,s);let o=r/2,a=0,h=0;for(a=t[0];a0;)u=i.dequeue(),u.distancefromCellCenter>m.distancefromCellCenter&&(m=u),u.maxDistanceToPolygon-m.distancefromCellCenter<=n||(o=u.cellSize/2,i.enqueue(new zt(u.x-o,u.y-o,o,l)),i.enqueue(new zt(u.x+o,u.y-o,o,l)),i.enqueue(new zt(u.x-o,u.y+o,o,l)),i.enqueue(new zt(u.x+o,u.y+o,o,l)));return[m.x,m.y]}let ni=class ae{static local(){return ae.instance===null&&(ae.instance=new ae),ae.instance}execute(t,e,s,n,i){return new Rr(t,e,s)}};ni.instance=null;let Rr=class{constructor(t,e,s){this._geometryCursor=t,this._offsetX=e.offsetX!==void 0?e.offsetX*s:0,this._offsetY=e.offsetY!==void 0?e.offsetY*s:0,this._method=e.method!==void 0?e.method:fe.OnPolygon,this._internalPlacement=new $t}next(){const t=this._geometryCursor;return this._geometryCursor=null,t?this._polygonCenter(t):null}_polygonCenter(t){let e=!1;switch(this._method){case fe.CenterOfMass:{const s=Si(t);s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),e=!0)}break;case fe.BoundingBoxCenter:{const s=ts(t);s&&(this._internalPlacement.setTranslate((s[2]+s[0])/2+this._offsetX,(s[3]+s[1])/2+this._offsetY),e=!0)}break;case fe.OnPolygon:default:{let s;s=bi("polylabel-placement-enabled")?Gr(t):zr(t),s!==null&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),e=!0)}}return e?this._internalPlacement:null}};function Ke(l){if(!l)return null;switch(l.type){case"CIMGeometricEffectAddControlPoints":return Rs.local();case"CIMGeometricEffectArrow":return Xs.local();case"CIMGeometricEffectBuffer":return Ds.local();case"CIMGeometricEffectControlMeasureLine":return Hs.local();case"CIMGeometricEffectCut":return Ys.local();case"CIMGeometricEffectDashes":return Vs.local();case"CIMGeometricEffectDonut":return Js.local();case"CIMGeometricEffectJog":return Bs.local();case"CIMGeometricEffectMove":return Ws.local();case"CIMGeometricEffectOffset":return Us.local();case"CIMGeometricEffectReverse":return qs.local();case"CIMGeometricEffectRotate":return js.local();case"CIMGeometricEffectScale":return Zs.local();case"CIMGeometricEffectWave":return Ks.local()}return null}function Xr(l){if(!l)return null;switch(l.type){case"CIMMarkerPlacementAlongLineSameSize":return Qs.local();case"CIMMarkerPlacementAtExtremities":return ti.local();case"CIMMarkerPlacementAtRatioPositions":return ei.local();case"CIMMarkerPlacementInsidePolygon":return si.local();case"CIMMarkerPlacementOnLine":return ii.local();case"CIMMarkerPlacementOnVertices":return ri.local();case"CIMMarkerPlacementPolygonCenter":return ni.local()}return null}function Xe(l){const t=l.getFrame(0);if(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement)return t;const e=document.createElement("canvas");e.width=l.width,e.height=l.height;const s=e.getContext("2d");return t instanceof ImageData?s.putImageData(t,0,0):s.drawImage(t,0,0),e}let oi=class{constructor(t=0,e=0,s=0,n=0){this.x=t,this.y=e,this.width=s,this.height=n}get isEmpty(){return this.width<=0||this.height<=0}union(t){this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.width=Math.max(this.width,t.width),this.height=Math.max(this.height,t.height)}};function Dr(l){return`rgb(${l.slice(0,3).toString()})`}function De(l){return`rgba(${l.slice(0,3).toString()},${l[3]})`}let ai=class{constructor(t){t&&(this._textRasterizationCanvas=t)}rasterizeText(t,e){var O,G;this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const s=this._textRasterizationCanvas,n=s.getContext("2d");this._setFontProperties(n,e),this._parameters=e,this._textLines=t.split(/\r?\n/),this._lineHeight=this._computeLineHeight();const{decoration:i,weight:r}=e.font;this._lineThroughWidthOffset=i&&i==="line-through"?.1*this._lineHeight:0;const o=e.backgroundColor!=null||e.borderLine!=null,a=o?Ci:0,h=this._computeTextWidth(n,e)+2*a,c=this._lineHeight*this._textLines.length+2*a;if(s.width=h+2*this._lineThroughWidthOffset,s.height=c,s.width===0||s.height===0)return s.width=s.height=1,{size:[0,0],image:new Uint32Array(0),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0,canvas:s};this._renderedLineHeight=Math.round(this._lineHeight*e.pixelRatio),this._renderedHaloSize=ot(e.halo.size)*e.pixelRatio,this._renderedWidth=h*e.pixelRatio,this._renderedHeight=c*e.pixelRatio,this._lineThroughWidthOffset*=e.pixelRatio;const u=e.color??[0,0,0,0],m=e.halo&&e.halo.color?e.halo.color:[0,0,0,0];this._fillStyle=De(u),this._haloStyle=Dr(m);const f=this._renderedLineHeight,_=this._renderedHaloSize;n.save(),n.clearRect(0,0,s.width,s.height),this._setFontProperties(n,e);const p=a*e.pixelRatio,g=Hr(n.textAlign,this._renderedWidth-2*p)+_+p,d=_+p,y=_>0;let x=this._lineThroughWidthOffset,P=0;if(o){n.save();const z=e.backgroundColor??[0,0,0,0],$=((O=e.borderLine)==null?void 0:O.color)??[0,0,0,0],J=2*ot(((G=e.borderLine)==null?void 0:G.size)??0);n.fillStyle=De(z),n.strokeStyle=De($),n.lineWidth=J,n.fillRect(0,0,s.width,s.height),n.strokeRect(0,0,s.width,s.height),n.restore()}y&&this._renderHalo(n,g,d,x,P,e),P+=d,x+=g;for(const z of this._textLines)y?(n.globalCompositeOperation="destination-out",n.fillStyle="rgb(0, 0, 0)",n.fillText(z,x,P),n.globalCompositeOperation="source-over",n.fillStyle=this._fillStyle,n.fillText(z,x,P)):(n.fillStyle=this._fillStyle,n.fillText(z,x,P)),i&&i!=="none"&&this._renderDecoration(n,x,P,i,r),P+=f;n.restore();const M=this._renderedWidth+2*this._lineThroughWidthOffset,S=this._renderedHeight,w=n.getImageData(0,0,M,S),C=new Uint8Array(w.data);if(e.premultiplyColors){let z;for(let $=0;$600)&&(s+=.3*t.measureText("w").width),s+=2*ot(this._parameters.halo.size),Math.round(s)}_computeLineHeight(){let t=1.275*this._parameters.size;const e=this._parameters.font.decoration;return e&&e==="underline"&&(t*=1.3),Math.round(t+2*ot(this._parameters.halo.size))}_renderDecoration(t,e,s,n,i,r){const o=.9*this._lineHeight,a=i==="bold"?.06:i==="bolder"?.09:.04;switch(t.textAlign){case"center":e-=this._renderedWidth/2;break;case"right":e-=this._renderedWidth}const h=t.textBaseline;if(n==="underline")switch(h){case"top":s+=o;break;case"middle":s+=o/2}else if(n==="line-through")switch(h){case"top":s+=o/1.5;break;case"middle":s+=o/3}const c=r?1.5*r:Math.ceil(o*a);t.save(),t.beginPath(),t.strokeStyle=t.fillStyle,t.lineWidth=c,t.moveTo(e-this._lineThroughWidthOffset,s),t.lineTo(e+this._renderedWidth+2*this._lineThroughWidthOffset,s),t.stroke(),t.restore()}};function Hr(l,t){return l==="center"?.5*t:l==="right"?t:0}var F,E;function co(l){switch(l){case"left":return F.Left;case"right":return F.Right;case"center":return F.Center}}function uo(l){switch(l){case"top":return E.Top;case"middle":return E.Center;case"baseline":return E.Baseline;case"bottom":return E.Bottom}}function fo(l){switch(l){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return[F.Right,E.Bottom];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return[F.Center,E.Bottom];case"above-right":case"esriServerPointLabelPlacementAboveRight":return[F.Left,E.Bottom];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return[F.Right,E.Center];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return[F.Center,E.Center];case"center-right":case"esriServerPointLabelPlacementCenterRight":return[F.Left,E.Center];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return[F.Right,E.Top];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return[F.Center,E.Top];case"below-right":case"esriServerPointLabelPlacementBelowRight":return[F.Left,E.Top];default:return console.debug(`Found invalid placement type ${l}`),[F.Center,E.Center]}}function mo(l){switch(l){case F.Right:return-1;case F.Center:return 0;case F.Left:return 1;default:return console.debug(`Found invalid horizontal alignment ${l}`),0}}function po(l){switch(l){case E.Top:return 1;case E.Center:return 0;case E.Bottom:case E.Baseline:return-1;default:return console.debug(`Found invalid vertical alignment ${l}`),0}}function _o(l){switch(l){case"left":return F.Left;case"right":return F.Right;case"center":return F.Center}}function go(l){switch(l){case"above-along":case"below-along":case"center-along":case"esriServerLinePlacementAboveAlong":case"esriServerLinePlacementBelowAlong":case"esriServerLinePlacementCenterAlong":return!0;default:return!1}}(function(l){l[l.Left=-1]="Left",l[l.Center=0]="Center",l[l.Right=1]="Right"})(F||(F={})),function(l){l[l.Top=1]="Top",l[l.Center=0]="Center",l[l.Bottom=-1]="Bottom",l[l.Baseline=2]="Baseline"}(E||(E={}));const Pt=Math.PI/180,Yr=es.getLogger("esri.symbols.cim.CIMSymbolDrawHelper"),At=4,ke=10,Vr=10,ns=4,hi=10;let bt=class Z{constructor(t){this._t=t}static createIdentity(){return new Z([1,0,0,0,1,0])}clone(){const t=this._t;return new Z(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new Z([t,0,0,0,e,0])}scale(t,e){const s=this._t;return s[0]*=t,s[1]*=t,s[2]*=t,s[3]*=e,s[4]*=e,s[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new Z([0,0,t,0,0,e])}translate(t,e){const s=this._t;return s[2]+=t,s[5]+=e,this}static createRotate(t){const e=Math.cos(t),s=Math.sin(t);return new Z([e,-s,0,s,e,0])}rotate(t){return Z.multiply(this,Z.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],s=Math.sqrt(t*t+e*e);return[t/s,e/s]}static multiply(t,e,s){const n=t._t,i=e._t,r=n[0]*i[0]+n[3]*i[1],o=n[1]*i[0]+n[4]*i[1],a=n[2]*i[0]+n[5]*i[1]+i[2],h=n[0]*i[3]+n[3]*i[4],c=n[1]*i[3]+n[4]*i[4],u=n[2]*i[3]+n[5]*i[4]+i[5],m=s._t;return m[0]=r,m[1]=o,m[2]=a,m[3]=h,m[4]=c,m[5]=u,s}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(e===0)return new Z([0,0,0,0,0,0]);e=1/e;const s=(t[1]*t[5]-t[2]*t[4])*e,n=(t[2]*t[3]-t[0]*t[5])*e,i=t[4]*e,r=-t[1]*e,o=-t[3]*e,a=t[0]*e;return new Z([i,r,s,o,a,n])}},li=class{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new Ii($t,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||bt.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||bt.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const s=e?t.scaleRatio():1;bt.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*s)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,s){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,s)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const s=t.symbolLayers;if(!s)return;const n=t.effects;if(n&&n.length>0){const i=this.executeEffects(n,e);if(i){let r=i.next();for(;r;)this.drawSymbolLayers(s,r.asJSON()),r=i.next()}}else this.drawSymbolLayers(s,e)}executeEffects(t,e){const s=this._resourceManager.geometryEngine;let n=new Ze(A.fromJSONCIM(e));for(const i of t){const r=Ke(i);r&&(n=r.execute(n,i,this.geomUnitsPerPoint(),null,s))}return n}drawSymbolLayers(t,e){let s=t.length;for(;s--;){const n=t[s];if(!n||n.enable===!1)continue;const i=n.effects;if(i&&i.length>0){const r=this.executeEffects(i,e);if(r){let o=null;for(;(o=r.next())&&(this.drawSymbolLayer(n,o.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(n,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const s=this._buildHatchPolyline(e,t,this.geomUnitsPerPoint());s&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,s),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const s=t.markerPlacement;if(s){const n=Xr(s);if(n){const i=s.type==="CIMMarkerPlacementInsidePolygon"||s.type==="CIMMarkerPlacementPolygonCenter"&&s.clipAtBoundary;i&&this.pushClipPath(e);const r=n.execute(A.fromJSONCIM(e),s,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(r){let o=null;for(;(o=r.next())&&(this.drawMarker(t,o),!this._earlyReturn););}i&&this.popClipPath()}}else{const n=this._placementPool.acquire();if(We(e))n.tx=e.x,n.ty=e.y,this.drawMarker(t,n);else if(K(e)){const i=Li(e);i&&([n.tx,n.ty]=i,this.drawMarker(t,n))}else for(const i of e.points)if(n.tx=i[0],n.ty=i[1],this.drawMarker(t,n),this._earlyReturn)break;this._placementPool.release(n)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const s=this._resourceManager.getResource(t.url),n=b(t.size,ke);if(s==null||n<=0)return;const i=s.width,r=s.height;if(!i||!r)return;const o=i/r,a=b(t.scaleX,1),h=bt.createIdentity(),c=t.anchorPoint;if(c){let g=c.x,d=c.y;t.anchorPointUnits!=="Absolute"&&(g*=n*o*a,d*=n),h.translate(-g,-d)}let u=b(t.rotation);t.rotateClockwise&&(u=-u),this._mapRotation&&(u+=this._mapRotation),u&&h.rotate(u*Pt);let m=b(t.offsetX),f=b(t.offsetY);if(m||f){if(this._mapRotation){const g=Pt*this._mapRotation,d=Math.cos(g),y=Math.sin(g),x=m*y+f*d;m=m*d-f*y,f=x}h.translate(m,f)}const _=this.geomUnitsPerPoint();_!==1&&h.scale(_,_);const p=e.getAngle();p&&h.rotate(p),h.translate(e.tx,e.ty),this.push(h,!1),this.drawImage(t,n),this.pop()}drawVectorMarker(t,e){if(!t)return;const s=t.markerGraphics;if(!s)return;const n=b(t.size,ke),i=t.frame,r=i?i.ymax-i.ymin:0,o=n&&r?n/r:1,a=bt.createIdentity();i&&a.translate(.5*-(i.xmax+i.xmin),.5*-(i.ymax+i.ymin));const h=t.anchorPoint;if(h){let p=h.x,g=h.y;t.anchorPointUnits!=="Absolute"?i&&(p*=i.xmax-i.xmin,g*=i.ymax-i.ymin):(p/=o,g/=o),a.translate(-p,-g)}o!==1&&a.scale(o,o);let c=b(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&a.rotate(c*Pt);let u=b(t.offsetX),m=b(t.offsetY);if(u||m){if(this._mapRotation){const p=Pt*this._mapRotation,g=Math.cos(p),d=Math.sin(p),y=u*d+m*g;u=u*g-m*d,m=y}a.translate(u,m)}const f=this.geomUnitsPerPoint();f!==1&&a.scale(f,f);const _=e.getAngle();_&&a.rotate(_),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const p of s)if(p&&p.symbol&&p.geometry||Yr.error("Invalid marker graphic",p),this.drawSymbol(p.symbol,p.geometry,p.textString),this._earlyReturn)break;this.pop()}drawTextSymbol(t,e,s){if(!t||!We(e)||b(t.height,hi)<=0)return;const n=bt.createIdentity();let i=b(t.angle);i=-i,i&&n.rotate(i*Pt);const r=b(t.offsetX),o=b(t.offsetY);(r||o)&&n.translate(r,o);const a=this.geomUnitsPerPoint();a!==1&&n.scale(a,a),n.translate(e.x,e.y),this.push(n,!1),this.drawText(t,s),this.pop()}_buildHatchPolyline(t,e,s){let n=b(t.separation,ns)*s,i=b(t.rotation);if(n===0)return null;n<0&&(n=-n);let r=0;const o=.5*n;for(;r>o;)r-=n;for(;r<-o;)r+=n;const a=vt();Is(a,e),a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o;const h=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;i>180;)i-=180;for(;i<0;)i+=180;const c=Math.cos(i*Pt),u=Math.sin(i*Pt),m=-n*u,f=n*c;let _,p,g,d;r=b(t.offsetX)*s*u-b(t.offsetY)*s*c,_=g=Number.MAX_VALUE,p=d=-Number.MAX_VALUE;for(const C of h){const I=C[0],v=C[1],O=c*I+u*v,G=-u*I+c*v;_=Math.min(_,O),g=Math.min(g,G),p=Math.max(p,O),d=Math.max(d,G)}g=Math.floor(g/n)*n;let y=c*_-u*g-m*r/n,x=u*_+c*g-f*r/n,P=c*p-u*g-m*r/n,M=u*p+c*g-f*r/n;const S=1+Math.round((d-g)/n),w=[];for(let C=0;C0))if(K(t))this._processPath(t.rings,0);else if(mt(t))this._processPath(t.paths,0);else if(Q(t)){const e=St(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,s){if(!t||this._clipCount>0)return;const n=.5*this.transformSize(b(s,At));if(K(t))this._processPath(t.rings,n);else if(mt(t))this._processPath(t.paths,n);else if(Q(t)){const i=St(t);i&&this._processPath(i.rings,n)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){K(e)&&t.markerPlacement&&(t.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||t.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:s}=t,n=b(t.scaleX,1);let i=n*e,r=e;const o=this._resourceManager.getResource(s);e||o==null||(i=n*o.width,r=o.height),this._merge(this.transformPt([-i/2,-r/2]),0),this._merge(this.transformPt([-i/2,r/2]),0),this._merge(this.transformPt([i/2,-r/2]),0),this._merge(this.transformPt([i/2,r/2]),0)}drawText(t,e){if(!e||e.length===0)return;this._textRasterizer||(this._textRasterizer=new ai);const s=ci(t),[n,i]=this._textRasterizer.computeTextSize(e,s);let r=0;switch(t.horizontalAlignment){case"Left":r=n/2;break;case"Right":r=-n/2}let o=0;switch(t.verticalAlignment){case"Bottom":o=i/2;break;case"Top":o=-i/2;break;case"Baseline":o=i/6}this._merge(this.transformPt([-n/2+r,-i/2+o]),0),this._merge(this.transformPt([-n/2+r,i/2+o]),0),this._merge(this.transformPt([n/2+r,-i/2+o]),0),this._merge(this.transformPt([n/2+r,i/2+o]),0)}_processPath(t,e){if(t)for(const s of t){const n=s?s.length:0;if(n>1){this._merge(this.transformPt(s[0]),e);for(let i=1;ithis._xmax&&(this._xmax=t[0]+e),t[1]-ethis._ymax&&(this._ymax=t[1]+e)}};class Br extends li{constructor(t,e,s,n){super(e,s),this._applyAdditionalRenderProps=n,this._colorSubstitutionHelper=new tr,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(K(t))this._buildPath(t.rings,!0);else if(mt(t))this._buildPath(t.paths,!0);else if(Q(t))this._buildPath(St(t).rings,!0);else{if(!xe(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const s=this._ctx;s.fillStyle=typeof e=="string"?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",s.fill("evenodd")}drawSolidStroke(t,e,s,n,i,r){if(!t||!e||s===0)return;if(K(t))this._buildPath(t.rings,!0);else if(mt(t))this._buildPath(t.paths,!1);else{if(!Q(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(St(t).rings,!0)}const o=this._ctx;o.strokeStyle=typeof e=="string"?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",o.lineWidth=Math.max(this.transformSize(s),.5),this._setCapStyle(n),this._setJoinStyle(i),o.miterLimit=r,o.stroke()}pushClipPath(t){if(this._ctx.save(),K(t))this._buildPath(t.rings,!0);else if(mt(t))this._buildPath(t.paths,!0);else{if(!Q(t))return;this._buildPath(St(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:s,url:n,tintColor:i}=t,r=b(t.scaleX,1),o=this._resourceManager.getResource(n);if(o==null)return;let a=e*(o.width/o.height),h=e;e||(a=o.width,h=o.height);const c=Ot(n)||"src"in o&&Ot(o.src);let u="getFrame"in o?Xe(o):o;s&&(u=this._colorSubstitutionHelper.applyColorSubstituition(u,s)),this._applyAdditionalRenderProps&&!c&&i&&(u=this._colorSubstitutionHelper.tintImageData(u,i));const m=this.transformPt([0,0]),[f,_]=this.getTransformAngle(),p=this.transformSize(1),g=this._ctx;g.save(),g.setTransform({m11:r*p*f,m12:r*p*_,m21:-p*_,m22:p*f,m41:m[0],m42:m[1]}),g.drawImage(u,-a/2,-h/2,a,h),g.restore()}drawText(t,e){if(!e||e.length===0)return;this._textRasterizer||(this._textRasterizer=new ai);const s=ci(t);s.size*=this.transformSize(Tt(1));const n=this._textRasterizer.rasterizeText(e,s);if(!n)return;const{size:i,anchorX:r,anchorY:o,canvas:a}=n,h=i[0]*(r+.5),c=i[1]*(o-.5),u=this._ctx,m=this.transformPt([0,0]),[f,_]=this.getTransformAngle(),p=1;u.save(),u.setTransform({m11:p*f,m12:p*_,m21:-p*_,m22:p*f,m41:m[0]-p*h,m42:m[1]+p*c}),u.drawImage(a,0,0),u.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:s,height:n,offsetX:i,offsetY:r,rotation:o,scaleX:a,tintColor:h,url:c}=e;const u=this._resourceManager.getResource(c);if(u==null)return;if(K(t))this._buildPath(t.rings,!0);else if(mt(t))this._buildPath(t.paths,!0);else if(Q(t))this._buildPath(St(t).rings,!0);else{if(!xe(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,f=Ot(c)||"src"in u&&Ot(u.src);let _,p="getFrame"in u?Xe(u):u;if(s&&(p=this._colorSubstitutionHelper.applyColorSubstituition(p,s)),this._applyAdditionalRenderProps){f||h&&(p=this._colorSubstitutionHelper.tintImageData(p,h)),_=m.createPattern(p,"repeat");const g=this.transformSize(1);o||(o=0),i?i*=g:i=0,r?r*=g:r=0,n&&(n*=g);const d=n?n/u.height:1,y=a&&n?a*n/u.width:1;if(o!==0||d!==1||y!==1||i!==0||r!==0){const x=new DOMMatrix;x.rotateSelf(0,0,-o).translateSelf(i,r).scaleSelf(y,d,1),_.setTransform(x)}}else _=m.createPattern(p,"repeat");m.save(),m.fillStyle=_,m.fill("evenodd"),m.restore()}drawPictureStroke(t,e){if(!t)return;let{colorSubstitutions:s,capStyle:n,joinStyle:i,miterLimit:r,tintColor:o,url:a,width:h}=e;const c=this._resourceManager.getResource(a);if(c==null)return;let u;if(K(t))u=t.rings;else if(mt(t))u=t.paths;else{if(!Q(t))return xe(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;u=St(t).rings}h||(h=c.width);const m=Ot(a)||"src"in c&&Ot(c.src);let f="getFrame"in c?Xe(c):c;s&&(f=this._colorSubstitutionHelper.applyColorSubstituition(f,s)),this._applyAdditionalRenderProps&&(m||o&&(f=this._colorSubstitutionHelper.tintImageData(f,o)));const _=Math.max(this.transformSize(ot(h)),.5),p=_/f.width,g=this._ctx,d=g.createPattern(f,"repeat-y");let y,x;g.save(),this._setCapStyle(n),this._setJoinStyle(i),r!==void 0&&(g.miterLimit=r),g.lineWidth=_;for(let P of u)if(P=B(P),qr(P),P&&!(P.length<=1)){y=this.transformPt(P[0]);for(let M=1;M1){let r=this.transformPt(n[0]);s.moveTo(r[0],r[1]);for(let o=1;ol?{spatialReference:l.spatialReference,rings:[[[l.xmin,l.ymin],[l.xmin,l.ymax],[l.xmax,l.ymax],[l.xmax,l.ymin],[l.xmin,l.ymin]]]}:null;function ci(l,t=1){var d;const e=ss(l),s=is(l.fontStyleName),n=l.fontFamilyName??vi,{weight:i,style:r}=s,o=t*(l.height||5),a=Ls(l.horizontalAlignment),h=Os(l.verticalAlignment),c=Ft(l),u=Ft(l.haloSymbol),m=u?t*(0|l.haloSize):0,f=((d=l.callout)==null?void 0:d.type)==="CIMBackgroundCallout"?l.callout.backgroundSymbol:null,_=Ft(f),p=Ue(f),g=be(f);return{color:c,size:o,horizontalAlignment:a,verticalAlignment:h,font:{family:n,style:wi(r),weight:ki(i),decoration:e},halo:{size:m||0,color:u,style:r},backgroundColor:_,borderLine:p!=null&&g!=null?{size:p,color:g}:null,pixelRatio:1,premultiplyColors:!0}}const Ur=1e-4;function qr(l){let t,e,s,n,i,r=l[0],o=1;for(;o.667?ot(Math.round(Tt(u.width))):u.width,color:H(u.color)})}else!e||t.type!=="line-marker"||t.style!=="cross"&&t.style!=="x"||h.push({type:"CIMSolidStroke",enable:!0,width:e,color:H(i)});h.push({type:"CIMSolidFill",enable:!0,color:H(i)});const c={type:"CIMPolygonSymbol",symbolLayers:h};a={type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:b(-t.angle),size:b(t.size||6*e),offsetX:b(t.xoffset),offsetY:b(t.yoffset),frame:r,markerGraphics:[{type:"CIMMarkerGraphic",geometry:o,symbol:c}]}]}}return a}static fromCIMHatchFill(t,e){var a;const s=e*(t.separation??ns),n=s/2,i=B(t.lineSymbol);(a=i.symbolLayers)==null||a.forEach(h=>{var c;switch(h.type){case"CIMSolidStroke":h.width!=null&&(h.width*=e),(c=h.effects)==null||c.forEach(u=>{u.type==="CIMGeometricEffectDashes"&&(u.dashTemplate=u.dashTemplate.map(m=>m*e))});break;case"CIMVectorMarker":{h.size!=null&&(h.size*=e);const u=h.markerPlacement;u!=null&&"placementTemplate"in u&&(u.placementTemplate=u.placementTemplate.map(m=>m*e));break}}});let r=this._getLineSymbolPeriod(i)||ys;for(;r{Ie.error(`Unsupported font ${n} in CIM symbol`)}))}}}static _getLineSymbolPeriod(t){if(t){const e=this._getEffectsRepeat(t.effects);if(e)return e;if(t.symbolLayers){for(const s of t.symbolLayers)if(s){const n=this._getEffectsRepeat(s.effects);if(n)return n;switch(s.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const i=this._getPlacementRepeat(s.markerPlacement);if(i)return i}}}}}return 0}static _getEffectsRepeat(t){if(t){for(const e of t)if(e)switch(e.type){case"CIMGeometricEffectDashes":{const s=e.dashTemplate;if(s&&s.length){let n=0;for(const i of s)n+=i;return 1&s.length&&(n*=2),n}break}case"CIMGeometricEffectWave":return e.period;default:Ie.error(`unsupported geometric effect type ${e.type}`)}}return 0}static _getPlacementRepeat(t){if(t)switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const e=t.placementTemplate;if(e&&e.length){let s=0;for(const n of e)s+=+n;return 1&e.length&&(s*=2),s}break}}return 0}static fromCIMInsidePolygon(t){const e=t.markerPlacement,s={...t};s.markerPlacement=null,s.anchorPoint=null;const n=Math.abs(e.stepX),i=Math.abs(e.stepY),r=(e.randomness??100)/100;let o,a,h,c;if(e.gridType==="Random"){const u=Tt(As),m=Math.max(Math.floor(u/n),1),f=Math.max(Math.floor(u/i),1);o=m*n/2,a=f*i/2,h=2*a;const _=new ks(e.seed),p=r*n/1.5,g=r*i/1.5;c=[];for(let d=0;d({type:"CIMMarkerGraphic",geometry:u,symbol:{type:"CIMPointSymbol",symbolLayers:[s]}})),size:h}}static getSize(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let e=0;if(t.symbolLayers){for(const s of t.symbolLayers)if(s)switch(s.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const n=s.size;n!=null&&n>e&&(e=n);break}}}return e}case"CIMLineSymbol":case"CIMPolygonSymbol":{let e=0;if(t.symbolLayers){for(const s of t.symbolLayers)if(s)switch(s.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const n=s.width;n!=null&&n>e&&(e=n);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(s.markerPlacement&&Ri(s.markerPlacement)){const n=s.size;n!=null&&n>e&&(e=n)}}}return e}}}static getMarkerScaleRatio(t){if(t&&t.type==="CIMVectorMarker"&&t.scaleSymbolsProportionally!==!1&&t.frame&&t.size!=null){const e=t.frame.ymax-t.frame.ymin;return t.size/e}return 1}}class N{static findApplicableOverrides(t,e,s){if(t&&e){if(t.primitiveName){let n=!1;for(const i of s)if(i.primitiveName===t.primitiveName){n=!0;break}if(!n)for(const i of e)i.primitiveName===t.primitiveName&&s.push(i)}switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(t.effects)for(const n of t.effects)N.findApplicableOverrides(n,e,s);if(t.symbolLayers)for(const n of t.symbolLayers)N.findApplicableOverrides(n,e,s);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(t.effects)for(const n of t.effects)N.findApplicableOverrides(n,e,s);if(t.markerPlacement&&N.findApplicableOverrides(t.markerPlacement,e,s),t.type==="CIMVectorMarker"){if(t.markerGraphics)for(const n of t.markerGraphics)N.findApplicableOverrides(n,e,s),N.findApplicableOverrides(n.symbol,e,s)}else t.type==="CIMCharacterMarker"?N.findApplicableOverrides(t.symbol,e,s):t.type==="CIMHatchFill"?N.findApplicableOverrides(t.lineSymbol,e,s):t.type==="CIMPictureMarker"&&N.findApplicableOverrides(t.animatedSymbolProperties,e,s)}}}static findEffectOverrides(t,e,s){if(!e||!t)return;const n=t.length;for(let i=0;i{var f;return!((f=m.valueExpressionInfo)!=null&&f.expression.includes("$feature"))})),o||(h=h.filter(m=>{var f;return!((f=m.valueExpressionInfo)!=null&&f.expression.includes("$view"))})),h.length>0){const m=Xi(e.attributes);await N.evaluateOverrides(h,e,{spatialReference:s,fields:m,geometryType:i},r,o)}N.applyOverrides(a,h)}return n&&N.applyDictionaryTextOverrides(a,e,n),a}static async evaluateOverrides(t,e,s,n,i){if(!e)return;let r;for(const o of t){const a=o.valueExpressionInfo;if(a&&s&&s.geometryType){r||(r=[]),o.value=void 0;const h=zs(a.expression,s.spatialReference,s.fields).then(c=>{o.value=Nt(c,e,{$view:i},s.geometryType,n)});r.push(h)}}r!==void 0&&r.length>0&&await Promise.all(r)}static applyDictionaryTextOverrides(t,e,s,n="Normal"){if(t&&t.type)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const i=t.symbolLayers;if(!i)return;for(const r of i)r&&r.type==="CIMVectorMarker"&&N.applyDictionaryTextOverrides(r,e,s,t.type==="CIMTextSymbol"?t.textCase:n)}break;case"CIMVectorMarker":{const i=t.markerGraphics;if(!i)return;for(const r of i)r&&N.applyDictionaryTextOverrides(r,e,s)}break;case"CIMMarkerGraphic":{const i=t.textString;if(i&&i.includes("[")){const r=Di(i,s);t.textString=Hi(e,r,n)}}}}static applyOverrides(t,e,s,n){if(t.primitiveName){for(const i of e)if(i.primitiveName===t.primitiveName){const r=nn(i.propertyName);if(n&&n.push({cim:t,nocapPropertyName:r,value:t[r]}),i.expression&&(i.value=N.toValue(i.propertyName,i.expression)),s){let o=!1;for(const a of s)a.primitiveName===t.primitiveName&&(o=!0);o||s.push(i)}i.value!=null&&(t[r]=i.value)}}switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(t.effects)for(const i of t.effects)N.applyOverrides(i,e,s,n);if(t.symbolLayers)for(const i of t.symbolLayers)N.applyOverrides(i,e,s,n);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(t.effects)for(const i of t.effects)N.applyOverrides(i,e,s,n);if(t.type==="CIMVectorMarker"&&t.markerGraphics)for(const i of t.markerGraphics)N.applyOverrides(i,e,s,n),N.applyOverrides(i.symbol,e,s,n)}}static restoreOverrides(t){for(const e of t)e.cim[e.nocapPropertyName]=e.value}static buildOverrideKey(t){let e="";for(const s of t)s.value!==void 0&&(e+=`${s.primitiveName}${s.propertyName}${JSON.stringify(s.value)}`);return e}static toValue(t,e){if(t==="DashTemplate")return e.split(" ").map(s=>Number(s));if(t==="Color"){const s=new Ns(e).toRgba();return s[3]*=255,s}return e}}const fi=l=>{if(!l)return dt.Butt;switch(l){case"butt":return dt.Butt;case"square":return dt.Square;case"round":return dt.Round}},mi=l=>{if(!l)return gt.Miter;switch(l){case"miter":return gt.Miter;case"round":return gt.Round;case"bevel":return gt.Bevel}},Kr=l=>{if(l==null)return"Center";switch(l){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},Qr=l=>{if(l==null)return"Center";switch(l){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},H=l=>{if(!l)return[0,0,0,0];const{r:t,g:e,b:s,a:n}=l;return[t,e,s,255*n]},tn=(l,t)=>{const e=en(t),s=sn(l);return e&&s?`${e}-${s}`:`${e}${s}`},en=l=>{if(!l)return"";switch(l.toLowerCase()){case"bold":case"bolder":return"bold"}return""},sn=l=>{if(!l)return"";switch(l.toLowerCase()){case"italic":case"oblique":return"italic"}return""},pi=(l,t)=>{const e=t==="butt";switch(l){case"dash":case"esriSLSDash":return e?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return e?[4,3,1,3]:[3,4,0,4];case"dot":case"esriSLSDot":return e?[1,3]:[0,4];case"long-dash":case"esriSLSLongDash":return e?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return e?[8,3,1,3]:[7,4,0,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return e?[8,3,1,3,1,3]:[7,4,0,4,0,4];case"short-dash":case"esriSLSShortDash":return e?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return e?[4,1,1,1]:[3,2,0,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return e?[4,1,1,1,1,1]:[3,2,0,2,0,2];case"short-dot":case"esriSLSShortDot":return e?[1,1]:[0,2];case"solid":case"esriSLSSolid":case"none":return Ie.error("Unexpected: style does not require rasterization"),[0,0];default:return Ie.error(`Tried to rasterize SLS, but found an unexpected style: ${l}!`),[0,0]}},xs=l=>{let s,n;const i=l;if(i==="circle"||i==="esriSMSCircle"){let o=Math.acos(.995),a=Math.ceil(ui/o/4);a===0&&(a=1),o=jr/a,a*=4;const h=[];h.push([50,0]);for(let c=1;cl==="vertical"||l==="horizontal"||l==="cross"||l==="esriSFSCross"||l==="esriSFSVertical"||l==="esriSFSHorizontal",nn=l=>l&&l.charAt(0).toLowerCase()+l.substr(1);function on(l,t,e){if(!(!l.effects||t.geometryEngine!=null)){if(t.geometryEnginePromise)return void e.push(t.geometryEnginePromise);Yi(l.effects)&&(t.geometryEnginePromise=Vi(),e.push(t.geometryEnginePromise),t.geometryEnginePromise.then(s=>t.geometryEngine=s))}}function Ms(l){if(!l)return null;let t=null;const{cap:e,color:s,join:n,miterLimit:i,style:r,width:o}=l;return r!=="solid"&&r!=="none"&&r!=="esriSLSSolid"&&r!=="esriSLSNull"&&(t=[{type:"CIMGeometricEffectDashes",dashTemplate:pi(r,e),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:r!=="esriSLSNull"&&r!=="none"?H(s):[0,0,0,0],capStyle:fi(e),joinStyle:mi(n),miterLimit:i,width:o,effects:t}}const bs=.05;function an(l){return Math.max(Math.round(l/bs),1)*bs}const hn=new Set(["StartTimeOffset","Duration","RepeatDelay"]);function ln(l,t){return hn.has(t)?an(l):l}function cn(l){var t;if(!l)return null;switch(l.type){case"CIMPointSymbol":{const e=l.symbolLayers;return e&&e.length===1?cn(e[0]):null}case"CIMVectorMarker":{const e=l.markerGraphics;if(!e||e.length!==1)return null;const s=e[0];if(!s)return null;const n=s.geometry;if(!n)return null;const i=s.symbol;return!i||i.type!=="CIMPolygonSymbol"&&i.type!=="CIMLineSymbol"||(t=i.symbolLayers)!=null&&t.some(r=>!!r.effects)?null:{geom:n,asFill:i.type==="CIMPolygonSymbol"}}case"sdf":return{geom:l.geom,asFill:l.asFill}}return null}function un(l){return l?l.rings?l.rings:l.paths?l.paths:l.xmin!==void 0&&l.ymin!==void 0&&l.xmax!==void 0&&l.ymax!==void 0?[[[l.xmin,l.ymin],[l.xmin,l.ymax],[l.xmax,l.ymax],[l.xmax,l.ymin],[l.xmin,l.ymin]]]:null:null}function fn(l){let t=1/0,e=-1/0,s=1/0,n=-1/0;for(const i of l)for(const r of i)r[0]e&&(e=r[0]),r[1]n&&(n=r[1]);return new oi(t,s,e-t,n-s)}function Ss(l){let t=1/0,e=-1/0,s=1/0,n=-1/0;for(const i of l)for(const r of i)r[0]e&&(e=r[0]),r[1]n&&(n=r[1]);return[t,s,e,n]}function Cs(l){return l?l.rings?Ss(l.rings):l.paths?Ss(l.paths):Q(l)?[l.xmin,l.ymin,l.xmax,l.ymax]:null:null}function vs(l,t,e,s,n){const[i,r,o,a]=l;if(o0&&(P=(t.xmax-t.xmin)/(t.ymax-t.ymin),y=s.x/(e*P),x=s.y/e):(y=s.x,x=s.y)),t&&(y=.5*(t.xmax+t.xmin)+y*(t.xmax-t.xmin),x=.5*(t.ymax+t.ymin)+x*(t.ymax-t.ymin)),y-=i,x-=r,y*=_,x*=_,y+=f,x+=f;let M=y/p-.5,S=x/g-.5;return n&&e&&(M*=e*P,S*=e),[d,M,S]}function xo(l){const t=un(l.geom),e=fn(t),s=128,n=Ts,i=Math.floor(.5*(.5*s-n)),r=(s-2*(i+n))/Math.max(e.width,e.height),o=Math.round(e.width*r)+2*i,a=Math.round(e.height*r)+2*i,h=[];for(const u of t)if(u&&u.length>1){const m=[];for(const f of u){let[_,p]=f;_-=e.x,p-=e.y,_*=r,p*=r,_+=i-.5,p+=i-.5,l.asFill?m.push([_,p]):m.push([Math.round(_),Math.round(p)])}if(l.asFill){const f=m.length-1;m[0][0]===m[f][0]&&m[0][1]===m[f][1]||m.push(m[0])}h.push(m)}const c=mn(h,o,a,i);return l.asFill&&pn(h,o,a,i,c),[_n(c,i),o,a]}function mn(l,t,e,s){const n=t*e,i=new Array(n),r=s*s+1;for(let o=0;ot&&(d=t),y<0&&(y=0),x>e&&(x=e);const P=u[0]-c[0],M=u[1]-c[1],S=P*P+M*M;for(let w=g;wS?(I=u[0],v=u[1]):(O/=S,I=c[0]+O*P,v=c[1]+O*M);const G=(w-I)*(w-I)+(C-v)*(C-v),z=(e-C-1)*t+w;Gt-s&&(p=t-s),ge-s&&(d=e-s);for(let y=g;yy==h[1]>y)continue;const x=(e-y-1)*t;for(let P=_;P>8^e)+s|0;while(--s!=0)}return(1+e/(1<<31))/2}function yn(l){return Math.floor(gn(l,Pn)*xn)}const Pn=53290320,xn=10,Mn=es.getLogger("esri.symbols.cim.cimAnalyzer");function He(l){switch(l){case"Butt":return Ae.BUTT;case"Square":return Ae.SQUARE;default:return Ae.ROUND}}function Ye(l){switch(l){case"Bevel":return Te.BEVEL;case"Miter":return Te.MITER;default:return Te.ROUND}}function bn(l){const t=l.markerPlacement;return t&&t.angleToLine?ve.MAP:ve.SCREEN}class Mo{constructor(t,e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],this._resourceManager=t,this._info=e}async analyzeSymbolReference(t,e,s){if(this._cimLayers=s??[],!t)return this._cimLayers;if(t.primitiveOverrides){this._primitiveOverrides=t.primitiveOverrides,this._poMap={};const r=[],o=this._info;for(const a of this._primitiveOverrides){const h=a.valueExpressionInfo;if(h&&o){const c=h.expression,u=zs(c,o.spatialReference,o.fields).then(m=>{m!=null&&this._setPoMap(a.primitiveName,a.propertyName,m)});r.push(u)}else a.value!=null&&this._setPoMap(a.primitiveName,a.propertyName,a.value);r.length>0&&await Promise.all(r)}}const n=t.symbol,i=[];return kt.fetchResources(n,this._resourceManager,i),i.length>0&&await Promise.all(i),this._analyzeSymbol(n,e),this._cimLayers}_analyzeSymbol(t,e){switch(t==null?void 0:t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(t,e,1,0,0,0)}}_analyzeMultiLayerSymbol(t,e,s,n,i,r){const o=t==null?void 0:t.symbolLayers;if(!o)return;const a=t.effects;let h=ve.SCREEN;const c=kt.getSize(t)??0;t.type==="CIMPointSymbol"&&t.angleAlignment==="Map"&&(h=ve.MAP);const u=t.type==="CIMPolygonSymbol";let m=o.length;for(;m--;){const f=o[m];if(!f||f.enable===!1)continue;let _;a&&a.length&&(_=[...a]);const p=f.effects;p&&p.length&&(a?_.push(...p):_=[...p]);const g=[];let d;N.findEffectOverrides(_,this._primitiveOverrides,g),d=g.length>0?this._createEffectsOverrideFunction(_,g):_;const y=[];switch(N.findApplicableOverrides(f,this._primitiveOverrides,y),f.type){case"CIMSolidFill":this._analyzeSolidFill(f,d);break;case"CIMPictureFill":this._analyzePictureFill(f,d);break;case"CIMHatchFill":this._analyzeHatchFill(f,d);break;case"CIMGradientFill":this._analyzeGradientFill(f,d);break;case"CIMSolidStroke":this._analyzeSolidStroke(f,d,u,c);break;case"CIMPictureStroke":this._analyzePictureStroke(f,d,u,c);break;case"CIMGradientStroke":this._analyzeGradientStroke(f,d,u,c);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{t.type==="CIMLineSymbol"&&(h=bn(f));const x=[],P=f.primitiveName;P&&x.push(P),this._analyzeMarker(f,d,null,x,h,c,1,e,s,n,i,r);break}default:Mn.error("Cannot analyze CIM layer",f.type)}}}_analyzeSolidFill(t,e){const s=t.primitiveName,n=V(t.color),[i,r]=this._analyzePrimitiveOverrides(s,e,null,null),o=T(JSON.stringify(t)+r).toString();this._cimLayers.push({type:"fill",templateHash:o,materialHash:i?()=>o:o,cim:t,materialOverrides:null,colorLocked:!!t.colorLocked,color:this._createOverrideFunction(s,"Color",n,D),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:e,applyRandomOffset:!1,sampleAlphaOnly:!0})}_analyzePictureFill(t,e){const s=t.primitiveName,n=me(t),[i,r]=this._analyzePrimitiveOverrides(s,e,null,null),o=T(JSON.stringify(t)+r).toString(),a=T(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString(),h=b(t.height,Vr);let c=b(t.scaleX,1);if("width"in t&&typeof t.width=="number"){const u=t.width;let m=1;const f=this._resourceManager.getResource(t.url);f!=null&&(m=f.width/f.height),c/=m*(h/u)}this._cimLayers.push({type:"fill",templateHash:o,materialHash:i?()=>a:a,cim:t,materialOverrides:null,colorLocked:!!t.colorLocked,effects:e,color:this._createOverrideFunction(s,"TintColor",n,D),height:this._createOverrideFunction(s,"Height",h),scaleX:this._createOverrideFunction(s,"ScaleX",c),angle:this._createOverrideFunction(s,"Rotation",b(t.rotation)),offsetX:this._createOverrideFunction(s,"OffsetX",b(t.offsetX)),offsetY:this._createOverrideFunction(s,"OffsetY",b(t.offsetY)),url:t.url,applyRandomOffset:!1,sampleAlphaOnly:!1})}_analyzeHatchFill(t,e){var m,f;const s=t.primitiveName,n=this._analyzeMaterialOverrides(s,["Rotation","OffsetX","OffsetY"]);let[i,r]=this._analyzePrimitiveOverrides(s,e,null,null);const o=T(JSON.stringify(t)+r).toString(),a=T(`${t.separation}${JSON.stringify(t.lineSymbol)}`).toString();let h={r:255,g:255,b:255,a:1},c=!1;const u=(f=(m=t.lineSymbol)==null?void 0:m.symbolLayers)==null?void 0:f.find(_=>{var p;return _.type==="CIMSolidStroke"&&((p=this._poMap[_.primitiveName])==null?void 0:p.Color)!=null});if(u){h=V(u.color),h=this._createOverrideFunction(u.primitiveName,"Color",h,D);const _=typeof h=="function";i=i||_,c=u.color!=null||_}this._cimLayers.push({type:"fill",templateHash:o,materialHash:i&&n?this._createMaterialHashFunction(a,n):a,cim:t,materialOverrides:n,colorLocked:!!t.colorLocked,effects:e,color:h,height:this._createOverrideFunction(s,"Separation",b(t.separation,ns)),scaleX:1,angle:this._createOverrideFunction(s,"Rotation",b(t.rotation)),offsetX:this._createOverrideFunction(s,"OffsetX",b(t.offsetX)),offsetY:this._createOverrideFunction(s,"OffsetY",b(t.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!c})}_analyzeGradientFill(t,e){const s=t.primitiveName,[n,i]=this._analyzePrimitiveOverrides(s,e,null,null),r=T(JSON.stringify(t)+i).toString();this._cimLayers.push({type:"fill",templateHash:r,materialHash:n?()=>r:r,cim:t,materialOverrides:null,colorLocked:!!t.colorLocked,effects:e,color:{r:128,g:128,b:128,a:1},height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1})}_analyzeSolidStroke(t,e,s,n){const i=t.primitiveName,r=V(t.color),o=b(t.width,At),a=He(t.capStyle),h=Ye(t.joinStyle),c=t.miterLimit,[u,m]=this._analyzePrimitiveOverrides(i,e,null,null),f=T(JSON.stringify(t)+m).toString();let _,p;if(e&&e instanceof Array&&e.length>0){const g=e[e.length-1];if(g.type==="CIMGeometricEffectDashes"&&g.lineDashEnding==="NoConstraint"&&g.offsetAlongLine===null){const d=(e=[...e]).pop();_=d.dashTemplate,p=d.scaleDash}}this._cimLayers.push({type:"line",templateHash:f,materialHash:u?()=>f:f,cim:t,materialOverrides:null,isOutline:s,colorLocked:!!t.colorLocked,effects:e,color:this._createOverrideFunction(i,"Color",r,D),width:this._createOverrideFunction(i,"Width",o),cap:this._createOverrideFunction(i,"CapStyle",a),join:this._createOverrideFunction(i,"JoinStyle",h),miterLimit:c&&this._createOverrideFunction(i,"MiterLimit",c),referenceWidth:n,zOrder:Ve(t.name),dashTemplate:_,scaleDash:p,sampleAlphaOnly:!0})}_analyzePictureStroke(t,e,s,n){const i=T(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString(),r=t.primitiveName,o=me(t),a=b(t.width,At),h=He(t.capStyle),c=Ye(t.joinStyle),u=t.miterLimit,[m,f]=this._analyzePrimitiveOverrides(r,e,null,null),_=T(JSON.stringify(t)+f).toString();this._cimLayers.push({type:"line",templateHash:_,materialHash:m?()=>i:i,cim:t,materialOverrides:null,isOutline:s,colorLocked:!!t.colorLocked,effects:e,color:this._createOverrideFunction(r,"TintColor",o,D),width:this._createOverrideFunction(r,"Width",a),cap:this._createOverrideFunction(r,"CapStyle",h),join:this._createOverrideFunction(r,"JoinStyle",c),miterLimit:u&&this._createOverrideFunction(r,"MiterLimit",u),referenceWidth:n,zOrder:Ve(t.name),dashTemplate:null,scaleDash:!1,url:t.url,sampleAlphaOnly:!1})}_analyzeGradientStroke(t,e,s,n){const i=t.primitiveName,r=b(t.width,At),o=He(t.capStyle),a=Ye(t.joinStyle),h=t.miterLimit,[c,u]=this._analyzePrimitiveOverrides(i,e,null,null),m=T(JSON.stringify(t)+u).toString();this._cimLayers.push({type:"line",templateHash:m,materialHash:c?()=>m:m,cim:t,materialOverrides:null,isOutline:s,colorLocked:!!t.colorLocked,effects:e,color:{r:128,g:128,b:128,a:1},width:this._createOverrideFunction(i,"Width",r),cap:this._createOverrideFunction(i,"CapStyle",o),join:this._createOverrideFunction(i,"JoinStyle",a),miterLimit:h&&this._createOverrideFunction(i,"MiterLimit",h),referenceWidth:n,zOrder:Ve(t.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeMarker(t,e,s,n,i,r,o,a,h,c,u,m,f=!1){if(this._analyzeMarkerInsidePolygon(t,e))return;const _=b(t.size,ke),p=b(t.rotation),g=b(t.offsetX),d=b(t.offsetY);let y=this._createOverrideFunction(t.primitiveName,"Size",_),x=this._createOverrideFunction(t.primitiveName,"Rotation",p),P=this._createOverrideFunction(t.primitiveName,"OffsetX",g),M=this._createOverrideFunction(t.primitiveName,"OffsetY",d);y=this._transformSize(y,o),x=this._transformRotation(x,!!t.rotateClockwise,c);const S=this._transformOffsetX(P,M,c,o,u),w=this._transformOffsetY(P,M,c,o,m);switch(P=S,M=w,t.type){case"CIMPictureMarker":this._analyzePictureMarker(t,e,s,n,i,r,y,x,P,M,t.colorLocked||f);break;case"CIMVectorMarker":this._analyzeVectorMarker(t,e,s,n,i,r,o,a,y,x,P,M,t.colorLocked||f)}}_analyzeMarkerInsidePolygon(t,e){const{markerPlacement:s,type:n}=t;if(!s||s.type!=="CIMMarkerPlacementInsidePolygon")return!1;if(n==="CIMVectorMarker"||n==="CIMPictureMarker"){const g=t.primitiveName;if(g){const[y,x]=this._analyzePrimitiveOverrides([g],e,null,null);if(y)return!1}const d=s.primitiveName;if(d){const[y,x]=this._analyzePrimitiveOverrides([d],e,null,null);if(y)return!1}if(n==="CIMVectorMarker"){const{markerGraphics:y}=t;if(y)for(const x of y){const{symbol:P}=x;if((P==null?void 0:P.type)==="CIMPolygonSymbol"&&P.symbolLayers){const{symbolLayers:M}=P;for(const S of M)if(S.type==="CIMSolidStroke")return!1}}}else{const{animatedSymbolProperties:y}=t;if(y)return!1}}const i=s,r=Math.abs(i.stepX),o=Math.abs(i.stepY);if(r===0||o===0)return!0;const a=["Rotation","OffsetX","OffsetY"],h=this._primitiveOverrides.filter(g=>g.primitiveName!==t.primitiveName||!a.includes(g.propertyName)),c="url"in t&&typeof t.url=="string"?t.url:void 0,u=T(JSON.stringify(t)).toString();let m,f,_=null;if(s.gridType==="Random"){const g=Tt(As),d=Math.max(Math.floor(g/r),1),y=Math.max(Math.floor(g/o),1);m=o*y,_=x=>x?x*y:0,f=d*r/m}else s.shiftOddRows?(m=2*o,_=g=>g?2*g:0,f=r/o*.5):(m=o,_=null,f=r/o);const p=me(t);return this._cimLayers.push({type:"fill",templateHash:u,materialHash:u,cim:t,materialOverrides:h,colorLocked:!!t.colorLocked,effects:e,color:p,height:this._createOverrideFunction(i.primitiveName,"StepY",m,_),scaleX:f,angle:i.gridAngle,offsetX:b(i.offsetX),offsetY:b(i.offsetY),url:c,applyRandomOffset:s.gridType==="Random",sampleAlphaOnly:!c,hasUnresolvedReplacementColor:!0}),!0}_analyzePictureMarker(t,e,s,n,i,r,o,a,h,c,u){let m=b(t.scaleX,1);const f=me(t),_=T(`${t.url}${JSON.stringify(t.colorSubstitutions)}${JSON.stringify(t.animatedSymbolProperties)}`).toString();s||(s=this._createMarkerPlacementOverrideFunction(t.markerPlacement));const p=this._createAnimatedSymbolPropertiesOverrideFunction(t.animatedSymbolProperties),[g,d]=this._analyzePrimitiveOverrides(n,e,s,p),y=T(JSON.stringify(t)+d).toString(),x=t.anchorPoint??{x:0,y:0};if("width"in t&&typeof t.width=="number"){const S=t.width;let w=1;const C=this._resourceManager.getResource(t.url);C!=null&&(w=C.width/C.height),m/=w*(b(t.size)/S)}function P(S,w){return p!=null?ls(p,S,w):null}const M=t.animatedSymbolProperties&&t.animatedSymbolProperties.randomizeStartTime===!0?(S,w,C,I)=>{const v=yn(I??0),O=P(S,w);return _+`-MATERIALGROUP(${v})-ASP(${JSON.stringify(O)})`}:g?(S,w)=>{const C=P(S,w);return _+`-ASP(${JSON.stringify(C)})`}:_;this._cimLayers.push({type:"marker",templateHash:y,materialHash:M,cim:t,materialOverrides:null,colorLocked:!!t.colorLocked||!!u,effects:e,scaleSymbolsProportionally:!1,alignment:i,size:o,scaleX:this._createOverrideFunction(t.primitiveName,"ScaleX",m),rotation:a,offsetX:h,offsetY:c,color:this._createOverrideFunction(t.primitiveName,"TintColor",f,D),anchorPoint:{x:x.x,y:x.y},isAbsoluteAnchorPoint:t.anchorPointUnits!=="Relative",outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,frameHeight:0,rotateClockwise:!1,referenceSize:r,sizeRatio:1,markerPlacement:s,url:t.url,animatedSymbolProperties:p})}_analyzeVectorMarker(t,e,s,n,i,r,o,a,h,c,u,m,f){const _=t.markerGraphics;if(!_)return;const p=t.frame;let g=0,d=1;t.scaleSymbolsProportionally&&p&&(g=p.ymax-p.ymin,d=this._transformSize(h,1/g)),d=this._transformSize(d,o),s||(s=this._createMarkerPlacementOverrideFunction(t.markerPlacement));for(const y of _)if(y){const x=y.symbol;if(!x)continue;const P=y.primitiveName;P&&n.push(P);let M=u,S=m;if((x.type==="CIMPointSymbol"||x.type==="CIMTextSymbol")&&p){let w=0,C=0;const I=y.geometry;"x"in I&&"y"in I&&(w+=I.x-.5*(p.xmin+p.xmax),C+=I.y-.5*(p.ymin+p.ymax));const v=t.anchorPoint;v&&(t.anchorPointUnits==="Absolute"?(w-=v.x,C-=v.y):p&&(w-=(p.xmax-p.xmin)*v.x,C-=(p.ymax-p.ymin)*v.y)),M=this._transformOffsetX(w,C,c,d,u),S=this._transformOffsetY(w,C,c,d,m)}switch(x.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":a?this._analyzeMultiLayerGraphicNonSDF(t,e,s,null,y,n,i,r,g,!!f||!!t.colorLocked):this._analyzeMultiLayerGraphic(t,e,s,null,y,n,i,r,g,d,h,c,M,S,!!f||!!t.colorLocked);break;case"CIMTextSymbol":this._analyzeTextGraphic(t,e,s,y,n,i,r,g,d,h,c,M,S,f)}P&&n.pop()}}_analyzeMultiLayerGraphic(t,e,s,n,i,r,o,a,h,c,u,m,f,_,p){const g=i.symbol,d=g.symbolLayers;if(!d)return;let y=d.length;if(Sn(d))return void this._analyzeCompositeMarkerGraphic(t,e,s,n,i,d,r,o,a,h,u,m,f,_,!!p||!!t.colorLocked);const x=this._resourceManager.geometryEngine,P=ws.applyEffects(g.effects,i.geometry,x);if(P)for(;y--;){const M=d[y];if(!M||M.enable===!1)continue;const S=M.primitiveName;switch(S&&r.push(S),M.type){case"CIMSolidFill":case"CIMSolidStroke":{const w=ws.applyEffects(M.effects,P,x),C=Cs(w);if(!C)continue;const I=t.anchorPointUnits!=="Relative",[v,O,G]=vs(C,t.frame,t.size,t.anchorPoint,I),z=M.type==="CIMSolidFill",$={type:"sdf",geom:w,asFill:z},J=M.path,tt=V(z?Ft(M):be(M)),ht=z?{r:0,g:0,b:0,a:0}:V(be(M)),lt=Ue(M)??0;if(!z&&!lt)break;const W=i.primitiveName;let ct=null;!z||M.colorLocked||p||(ct=this._createOverrideFunction(W,"FillColor",tt,D));let R=null;M.colorLocked||p||(R=this._createOverrideFunction(W,"StrokeColor",ht,D));const ut=this._createOverrideFunction(W,"StrokeWidth",lt);let et=!1,X="";for(const Lt of this._primitiveOverrides)r.includes(Lt.primitiveName)&&(Lt.value!=null?X+=`-${Lt.primitiveName}-${Lt.propertyName}-${JSON.stringify(Lt.value)}`:Lt.valueExpressionInfo&&(et=!0));(e!=null&&typeof e=="function"||s!=null&&typeof s=="function")&&(et=!0),(k(u)||k(m)||k(f)||k(_))&&(et=!0);const It=JSON.stringify({...t,markerGraphics:null}),yt=T(JSON.stringify($)+J).toString(),st=T(JSON.stringify(i)+JSON.stringify(M)+It+X).toString();this._cimLayers.push({type:"marker",templateHash:st,materialHash:et?()=>yt:yt,cim:$,materialOverrides:null,colorLocked:!!M.colorLocked||!!p,effects:e,scaleSymbolsProportionally:!!t.scaleSymbolsProportionally,alignment:o,anchorPoint:{x:O,y:G},isAbsoluteAnchorPoint:I,size:u,rotation:m,offsetX:f,offsetY:_,scaleX:1,frameHeight:h,rotateClockwise:!1,referenceSize:a,sizeRatio:v,color:k(ct)?ct:this._createOverrideFunction(S,"Color",tt,D),outlineColor:k(R)?R:this._createOverrideFunction(S,"Color",ht,D),outlineWidth:k(ut)?ut:this._createOverrideFunction(S,"Width",lt),markerPlacement:s,animatedSymbolProperties:n,path:J});break}case"CIMVectorMarker":M.markerPlacement?this._analyzeMultiLayerGraphicNonSDF(t,e,s,n,i,r,o,a,h,!!p||!!M.colorLocked):this._analyzeMarker(M,e,s,r,o,a,c,!1,u,m,f,_,!!p||!!t.colorLocked);break;default:this._analyzeMultiLayerGraphicNonSDF(t,e,s,n,i,r,o,a,h,!!p||!!t.colorLocked)}S&&r.pop()}}_analyzeTextGraphic(t,e,s,n,i,r,o,a,h,c,u,m,f,_){const p=[];N.findApplicableOverrides(n,this._primitiveOverrides,p);const g=n.geometry;if(!("x"in g)||!("y"in g))return;const d=n.symbol,y=ss(d),x=is(d.fontStyleName),P=Bi(d.fontFamilyName);d.font={family:P,decoration:y,...x};let M=b(d.height,hi),S=b(d.angle),w=b(d.offsetX),C=b(d.offsetY);M=this._transformSize(M,h),S=this._transformRotation(S,!1,u);const I=this._transformOffsetX(w,C,u,h,m),v=this._transformOffsetY(w,C,u,h,f);w=I,C=v;const O=V(Ft(d));let G=V(be(d)),z=Ue(d)??0;z||(G=V(Ft(d.haloSymbol)),z=b(d.haloSize)),z=this._transformSize(z,h);let $=null,J=null,tt=0;if(d.callout&&d.callout.type==="CIMBackgroundCallout"){const It=d.callout;if(It.backgroundSymbol){const yt=It.backgroundSymbol.symbolLayers;if(yt)for(const st of yt)st.type==="CIMSolidFill"?$=V(st.color):st.type==="CIMSolidStroke"&&(J=V(st.color),tt=b(st.width,At))}}const[ht,lt]=this._analyzePrimitiveOverrides(i,e,s,null),W=JSON.stringify(t.effects)+Number(t.colorLocked||_).toString()+JSON.stringify(t.anchorPoint)+t.anchorPointUnits+JSON.stringify(t.markerPlacement)+t.size.toString(),ct=T(JSON.stringify(n)+W+lt).toString();let R=this._createOverrideFunction(n.primitiveName,"TextString",n.textString??"",Wi,d.textCase);if(R==null)return;const{fontStyleName:ut}=d,et=P+(ut?"-"+ut.toLowerCase():"-regular"),X=et;typeof R=="string"&&R.includes("[")&&d.fieldMap&&(R=Ui(d.fieldMap,R,d.textCase)),this._cimLayers.push({type:"text",templateHash:ct,materialHash:ht||typeof R=="function"||/\[(.*?)\]/.test(R)?(It,yt,st)=>X+"-"+ls(R,It,yt,st):X+"-"+T(R),cim:d,materialOverrides:null,colorLocked:!!t.colorLocked||!!_,effects:e,alignment:r,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:t.anchorPointUnits!=="Relative",fontName:et,decoration:y,weight:x.weight,style:x.style,size:M,angle:S,offsetX:w,offsetY:C,horizontalAlignment:Ls(d.horizontalAlignment),verticalAlignment:Os(d.verticalAlignment),text:R,color:O,outlineColor:G,outlineSize:z,backgroundColor:$,borderLineColor:J,borderLineWidth:tt,referenceSize:o,sizeRatio:1,markerPlacement:s})}_analyzeMultiLayerGraphicNonSDF(t,e,s,n,i,r,o,a,h,c){const u=this._buildSimpleMarker(t,i),m=t.primitiveName,f=this._analyzeMaterialOverrides(m,["Rotation","OffsetX","OffsetY"]),[_,p]=this._analyzePrimitiveOverrides(r,null,null,null),[g,d,y]=kt.getTextureAnchor(u,this._resourceManager),x=b(t.rotation),P=b(t.offsetX),M=b(t.offsetY),S=T(JSON.stringify(u)+p).toString(),w=f&&f.length>0||e!=null&&typeof e=="function";this._cimLayers.push({type:"marker",templateHash:S,materialHash:w&&f?this._createMaterialHashFunction(S,f):S,cim:u,materialOverrides:f,colorLocked:!!t.colorLocked||!!c,effects:e,scaleSymbolsProportionally:!!t.scaleSymbolsProportionally,alignment:o,anchorPoint:{x:g,y:d},isAbsoluteAnchorPoint:!1,size:b(t.size,ke),rotation:this._createOverrideFunction(m,"Rotation",x),offsetX:this._createOverrideFunction(m,"OffsetX",P),offsetY:this._createOverrideFunction(m,"OffsetY",M),color:{r:255,g:255,b:255,a:1},outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,scaleX:1,frameHeight:h,rotateClockwise:!!t.rotateClockwise,referenceSize:a,sizeRatio:y/ot(t.size),markerPlacement:s,animatedSymbolProperties:n,avoidSDFRasterization:!0})}_buildSimpleMarker(t,e){return{type:t.type,enable:!0,name:t.name,colorLocked:t.colorLocked,primitiveName:t.primitiveName,anchorPoint:t.anchorPoint,anchorPointUnits:t.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:t.rotateClockwise,rotation:0,size:t.size,billboardMode3D:t.billboardMode3D,depth3D:t.depth3D,frame:t.frame,markerGraphics:[e],scaleSymbolsProportionally:t.scaleSymbolsProportionally,respectFrame:t.respectFrame,clippingPath:t.clippingPath}}_analyzeCompositeMarkerGraphic(t,e,s,n,i,r,o,a,h,c,u,m,f,_,p){const g=i.geometry,d=r[0],y=r[1],x=Cs(g);if(!x)return;const P=t.anchorPointUnits!=="Relative",[M,S,w]=vs(x,t.frame,t.size,t.anchorPoint,P),C={type:"sdf",geom:g,asFill:!0},I=y.path,v=y.primitiveName,O=d.primitiveName,G=V(y.color),z=V(d.color),$=b(d.width,At),J=i.primitiveName;let tt=null;y.colorLocked||p||(tt=this._createOverrideFunction(J,"FillColor",G,D));let ht=null;d.colorLocked||p||(ht=this._createOverrideFunction(J,"StrokeColor",z,D));const lt=this._createOverrideFunction(J,"StrokeWidth",$);let W=!1,ct="";for(const X of this._primitiveOverrides)(X.primitiveName===v||X.primitiveName===O||o.includes(X.primitiveName))&&(X.value!=null?ct+=`-${X.primitiveName}-${X.propertyName}-${JSON.stringify(X.value)}`:X.valueExpressionInfo&&(W=!0));s!=null&&typeof s=="function"&&(W=!0),(k(u)||k(m)||k(f)||k(_))&&(W=!0);const R=JSON.stringify({...t,markerGraphics:null}),ut=T(JSON.stringify(C)+I).toString(),et=T(JSON.stringify(i)+JSON.stringify(y)+JSON.stringify(d)+R+ct).toString();this._cimLayers.push({type:"marker",templateHash:et,materialHash:W?()=>ut:ut,cim:C,materialOverrides:null,colorLocked:!!p,effects:e,scaleSymbolsProportionally:!!t.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:S,y:w},isAbsoluteAnchorPoint:P,size:u,rotation:m,offsetX:f,offsetY:_,scaleX:1,frameHeight:c,rotateClockwise:!1,referenceSize:h,sizeRatio:M,color:k(tt)?tt:this._createOverrideFunction(v,"Color",G,D),outlineColor:k(ht)?ht:this._createOverrideFunction(O,"Color",z,D),outlineWidth:k(lt)?lt:this._createOverrideFunction(O,"Width",$),markerPlacement:s,path:I,animatedSymbolProperties:n})}_createMaterialHashFunction(t,e){var n;const s=(n=this._info)==null?void 0:n.geometryType;if(s){const i=this._poMap;for(const r of e)if(r.valueExpressionInfo){const o=i[r.primitiveName]&&i[r.primitiveName][r.propertyName];o instanceof Rt&&(r.fn=(a,h,c)=>Nt(o,a,{$view:c},s,h))}}return(i,r,o)=>{for(const a of e)a.fn&&(a.value=a.fn(i,r,o));return T(t+N.buildOverrideKey(e)).toString()}}_setPoMap(t,e,s){let n;this._poMap[t]?n=this._poMap[t]:(n={},this._poMap[t]=n),n[e]=s}_createOverrideFunction(t,e,s,n,i){var h;if(t==null)return s;const r=this._poMap[t];if(r==null)return s;const o=r[e];if(typeof o=="string"||typeof o=="number"||o instanceof Array)return n?n.call(null,o,i):o;const a=(h=this._info)==null?void 0:h.geometryType;return o!=null&&o instanceof Rt&&a!=null?(c,u,m)=>{let f=Nt(o,c,{$view:m},a,u);return f!==null&&n&&(f=n.call(null,f,i)),f!==null?f:s}:s}_createEffectsOverrideFunction(t,e){var i;const s=this._poMap,n=(i=this._info)==null?void 0:i.geometryType;for(const r of e)if(r.valueExpressionInfo&&n){const o=s[r.primitiveName]&&s[r.primitiveName][r.propertyName];o instanceof Rt&&(r.fn=(a,h,c)=>Nt(o,a,{$view:c},n,h))}return(r,o,a)=>{for(const c of e)c.fn&&(c.value=c.fn(r,o,a));const h=[];for(let c of t){const u=c==null?void 0:c.primitiveName;if(u){let m=!1;for(const f of e)if(f.primitiveName===u){const _=Je(f.propertyName);f.value!=null&&f.value!==c[_]&&(m||(c=B(c),m=!0),c[_]=f.value)}}h.push(c)}return h}}_createMarkerPlacementOverrideFunction(t){var i;const e=[];if(N.findApplicableOverrides(t,this._primitiveOverrides,e),t==null||e.length===0)return t;const s=this._poMap,n=(i=this._info)==null?void 0:i.geometryType;for(const r of e)if(r.valueExpressionInfo&&n){const o=s[r.primitiveName]&&s[r.primitiveName][r.propertyName];o instanceof Rt&&(r.fn=(a,h,c)=>Nt(o,a,{$view:c},n,h))}return(r,o,a)=>{for(const u of e)u.fn&&(u.value=u.fn(r,o,a));const h=B(t),c=t.primitiveName;for(const u of e)if(u.primitiveName===c){const m=Je(u.propertyName);u.value!=null&&u.value!==h[m]&&(h[m]=u.value)}return h}}_createAnimatedSymbolPropertiesOverrideFunction(t){var n;const e=[];if(N.findApplicableOverrides(t,this._primitiveOverrides,e),t==null||e.length===0)return t;const s=(n=this._info)==null?void 0:n.geometryType;if(s){const i=this._poMap;for(const r of e)if(r.valueExpressionInfo){const o=i[r.primitiveName]&&i[r.primitiveName][r.propertyName];o instanceof Rt&&(r.fn=(a,h,c)=>Nt(o,a,{$view:c},s,h))}}return(i,r,o)=>{for(const c of e)c.fn&&(c.value=c.fn(i,r,o));const a=B(t),h=t.primitiveName;for(const c of e)if(c.primitiveName===h){const u=Je(c.propertyName);if(c.value!=null){const m=ln(c.value,c.propertyName);m!==a[u]&&(a[u]=m)}}return a}}_analyzePrimitiveOverrides(t,e,s,n){let i=!1,r="";typeof t=="string"&&(t=[t]);for(const o of this._primitiveOverrides)t!=null&&t.includes(o.primitiveName)&&(o.value!=null?r+=`-${o.primitiveName}-${o.propertyName}-${JSON.stringify(o.value)}`:o.valueExpressionInfo&&(i=!0));return e!=null&&typeof e=="function"&&(i=!0),s!=null&&typeof s=="function"&&(i=!0),n!=null&&typeof n=="function"&&(i=!0),[i,r]}_analyzeMaterialOverrides(t,e){return this._primitiveOverrides.filter(s=>s.primitiveName!==t||!e.includes(s.propertyName))}_transformSize(t,e){return k(t)||k(e)?(s,n,i)=>(k(t)?t(s,n,i):t)*(k(e)?e(s,n,i):e):t*e}_transformRotation(t,e,s){return k(t)||k(s)?(n,i,r)=>{const o=k(t)?t(n,i,r):t,a=k(s)?s(n,i,r):s;return e?a-o:a+o}:e?s-t:s+t}_transformOffsetX(t,e,s,n,i){if(!(k(t)||k(e)||k(s)||k(n)||k(i))){const r=s*Math.PI/180;if(r){const o=Math.cos(r),a=Math.sin(r);return(o*t-a*e)*n+i}return t*n+i}return(r,o,a)=>{let h=k(s)?s(r,o,a):s;const c=k(n)?n(r,o,a):n,u=k(t)?t(r,o,a):t,m=k(i)?i(r,o,a):i;return h?(h*=Math.PI/180,(Math.cos(h)*u-Math.sin(h)*(k(e)?e(r,o,a):e))*c+m):u*c+m}}_transformOffsetY(t,e,s,n,i){if(!(k(t)||k(e)||k(s)||k(n)||k(i))){const r=s*Math.PI/180;if(r){const o=Math.cos(r);return(Math.sin(r)*t+o*e)*n+i}return e*n+i}return(r,o,a)=>{let h=k(s)?s(r,o,a):s;const c=k(n)?n(r,o,a):n,u=k(e)?e(r,o,a):e,m=k(i)?i(r,o,a):i;if(h){h*=Math.PI/180;const f=Math.cos(h);return(Math.sin(h)*(k(t)?t(r,o,a):t)+f*u)*c+m}return u*c+m}}}function Ve(l){if(l&&l.indexOf("Level_")===0){const t=parseInt(l.substr(6),10);if(!isNaN(t))return t}return 0}function D(l){if(!l||l.length===0)return null;const t=new Ns(l).toRgba();return{r:t[0],g:t[1],b:t[2],a:t[3]}}function Je(l){return l&&l.charAt(0).toLowerCase()+l.substr(1)}function bo(l,t){if(!t||t.length===0)return l;const e=B(l);return N.applyOverrides(e,t),e}const Sn=l=>l&&l.length===2&&l[0].enable&&l[1].enable&&l[0].type==="CIMSolidStroke"&&l[1].type==="CIMSolidFill"&&!l[0].effects&&!l[1].effects;export{Mo as G,pi as M,bt as Q,bo as V,xo as a,E as b,go as c,A as d,Br as e,ws as f,Xr as g,co as h,kt as i,uo as j,Zi as k,cn as l,fo as m,N as n,mo as o,po as p,ai as r,_o as s,oi as t}; diff --git a/assets/clientSideDefaults-ab04bd90.js b/assets/clientSideDefaults-ab04bd90.js new file mode 100644 index 0000000..594fdb1 --- /dev/null +++ b/assets/clientSideDefaults-ab04bd90.js @@ -0,0 +1,7 @@ +import{cn as o,cl as u}from"./index-080e108a.js";import{t as n}from"./QueryEngineCapabilities-42e44ded.js";import{l as i,o as a,S as c}from"./defaultsJSON-59981e75.js";function A(t){return{renderer:{type:"simple",symbol:t==="esriGeometryPoint"||t==="esriGeometryMultipoint"?i:t==="esriGeometryPolyline"?a:c}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let y=1;function $(t,s){if(o("esri-csp-restrictions"))return()=>({[s]:null,...t});try{let r=`this.${s} = null;`;for(const e in t)r+=`this${l.test(e)?`.${e}`:`["${e}"]`} = ${JSON.stringify(t[e])};`;const p=new Function(` + return class AttributesClass$${y++} { + constructor() { + ${r}; + } + } + `)();return()=>new p}catch{return()=>({[s]:null,...t})}}function f(t={}){return[{name:"New Feature",description:"",prototype:{attributes:u(t)}}]}function C(t,s){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:t},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:s,supportsDelete:s,supportsEditing:s,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:s,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:n,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:s,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1}}}export{f as a,C as c,$ as i,A as o}; diff --git a/assets/colorUtils-c0f43caf.js b/assets/colorUtils-c0f43caf.js new file mode 100644 index 0000000..a7a5574 --- /dev/null +++ b/assets/colorUtils-c0f43caf.js @@ -0,0 +1 @@ +function x(t){return"r"in t&&"g"in t&&"b"in t}function f(t){return"h"in t&&"s"in t&&"v"in t}function b(t){return"l"in t&&"a"in t&&"b"in t}function l(t){return"l"in t&&"c"in t&&"h"in t}function k(t){return"x"in t&&"y"in t&&"z"in t}const p=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],y=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function g(t,n){const r=[];let u,o;if(t[0].length!==n.length)throw new Error("dimensions do not match");const c=t.length,a=t[0].length;let i=0;for(u=0;uu<=.04045?u/12.92:((u+.055)/1.055)**2.4),r=g(p,n);return{x:100*r[0],y:100*r[1],z:100*r[2]}}function e(t){const n=g(y,[t.x/100,t.y/100,t.z/100]).map(r=>{const u=r<=.0031308?12.92*r:1.055*r**.4166666666666667-.055;return Math.min(1,Math.max(u,0))});return{r:Math.round(255*n[0]),g:Math.round(255*n[1]),b:Math.round(255*n[2])}}function m(t){const n=[t.x/95.047,t.y/100,t.z/108.883].map(r=>r>.008856451679035631?r**.3333333333333333:7.787037037037035*r+.13793103448275862);return{l:116*n[1]-16,a:500*(n[0]-n[1]),b:200*(n[1]-n[2])}}function d(t){const n=t.l,r=[(n+16)/116+t.a/500,(n+16)/116,(n+16)/116-t.b/200].map(u=>u>6/29?u**3:3*(6/29)**2*(u-4/29));return{x:95.047*r[0],y:100*r[1],z:108.883*r[2]}}function z(t){const n=t.l,r=t.a,u=t.b,o=Math.sqrt(r*r+u*u);let c=Math.atan2(u,r);return c=c>0?c:c+2*Math.PI,{l:n,c:o,h:c}}function v(t){const n=t.l,r=t.c,u=t.h;return{l:n,a:r*Math.cos(u),b:r*Math.sin(u)}}function w(t){return m(M(t))}function q(t){return e(d(t))}function E(t){return z(m(M(t)))}function I(t){return e(d(v(t)))}function P(t){const n=t.r,r=t.g,u=t.b,o=Math.max(n,r,u),c=o-Math.min(n,r,u);let a=o,i=c===0?0:o===n?(r-u)/c%6:o===r?(u-n)/c+2:(n-r)/c+4,s=c===0?0:c/a;return i<0&&(i+=6),i*=60,s*=100,a*=100/255,{h:i,s,v:a}}function j(t){const n=(t.h+360)%360/60,r=t.s/100,u=t.v/100*255,o=u*r,c=o*(1-Math.abs(n%2-1));let a;switch(Math.floor(n)){case 0:a={r:o,g:c,b:0};break;case 1:a={r:c,g:o,b:0};break;case 2:a={r:0,g:o,b:c};break;case 3:a={r:0,g:c,b:o};break;case 4:a={r:c,g:0,b:o};break;case 5:case 6:a={r:o,g:0,b:c};break;default:a={r:0,g:0,b:0}}return a.r=Math.round(a.r+u-o),a.g=Math.round(a.g+u-o),a.b=Math.round(a.b+u-o),a}function h(t){return x(t)?t:l(t)?I(t):b(t)?q(t):k(t)?e(t):f(t)?j(t):t}function A(t){return f(t)?t:P(h(t))}function B(t){return b(t)?t:w(h(t))}function C(t){return l(t)?t:E(h(t))}export{h as p,C as v,A as y,B as z}; diff --git a/assets/commonProperties-30089b06.js b/assets/commonProperties-30089b06.js new file mode 100644 index 0000000..2679d96 --- /dev/null +++ b/assets/commonProperties-30089b06.js @@ -0,0 +1 @@ +import{cR as s,fO as a,fP as d,fQ as y,fR as w,ca as u,bc as g}from"./index-080e108a.js";function v(i){if(!i)return i;const{start:e,end:n}=i;return new s({start:e!=null?a(e,-e.getTimezoneOffset(),"minutes"):e,end:n!=null?a(n,-n.getTimezoneOffset(),"minutes"):n})}function b(i){if(!i)return i;const{start:e,end:n}=i;return new s({start:e!=null?a(e,e.getTimezoneOffset(),"minutes"):e,end:n!=null?a(n,n.getTimezoneOffset(),"minutes"):n})}const I={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:!0}},O={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(i,e)=>!e.disablePopup},write:{enabled:!0,writer(i,e,n){e[n]=!i}}}},D={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:!0}},S={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:y}}},N={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:!0}},h={value:null,type:w,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:!0}};function R(i){return{type:i,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const p={write:!0,read:!0},m={type:Number,json:{origins:{"web-document":p,"portal-item":{write:!0}}}},x={...m,json:{...m.json,origins:{"web-document":{...p,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(i,e,n)=>n&&n.origin!=="service"||!e.drawingInfo||e.drawingInfo.transparency===void 0?e.layerDefinition&&e.layerDefinition.drawingInfo&&e.layerDefinition.drawingInfo.transparency!==void 0?d(e.layerDefinition.drawingInfo.transparency):void 0:d(e.drawingInfo.transparency)}}},T={type:s,readOnly:!0,get(){var f,c;if(!((f=this.layer)!=null&&f.timeInfo))return null;const{datesInUnknownTimezone:i,timeOffset:e,useViewTime:n}=this.layer,o=(c=this.view)==null?void 0:c.timeExtent;let t=this.layer.timeExtent;i&&(t=b(t));let r=n?o&&t?o.intersection(t):o||t:t;if(!r||r.isEmpty||r.isAllTime)return r;e&&(r=r.offset(-e.value,e.unit)),i&&(r=v(r));const l=this._get("timeExtent");return r.equals(l)?l:r}},z={type:u,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(i,e)=>{const n=u.fromJSON(i);return e.spatialReference!=null&&typeof e.spatialReference=="object"&&(n.spatialReference=g.fromJSON(e.spatialReference)),n}}}},read:!1}},E={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},B={type:Number,json:{origins:{service:{write:{enabled:!1}}},read:{source:"layerDefinition.minScale"},write:{target:"layerDefinition.minScale"}}},P={type:Number,json:{origins:{service:{write:{enabled:!1}}},read:{source:"layerDefinition.maxScale"},write:{target:"layerDefinition.maxScale"}}},q={json:{write:{ignoreOrigin:!0},origins:{"web-map":{read:!1,write:!1}}}};export{P as D,B as I,q as S,T as b,N as c,h as d,S as f,x as g,z as j,I as l,D as m,O as p,m as u,E as v,R as y}; diff --git a/assets/createConnection-4b117798.js b/assets/createConnection-4b117798.js new file mode 100644 index 0000000..8a0ed60 --- /dev/null +++ b/assets/createConnection-4b117798.js @@ -0,0 +1 @@ +import{cu as N,ar as a,ai as d,aj as p,al as S,cN as v,jg as F,bz as c,hy as L,cv as C,at as O,cs as x,aw as E,bc as P}from"./index-080e108a.js";import{m as k}from"./query-93c6e211.js";import{b as M}from"./Query-1c961d4c.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";let m=class extends N.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new a("stream-connection",this.errorString):null}onFeature(t){this.emit("data-received",t)}onMessage(t){this.emit("message-received",t)}};d([p({readOnly:!0})],m.prototype,"connectionError",null),m=d([S("esri.layers.support.StreamConnection")],m);const R=m;var g;(function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"})(g||(g={}));let f=class extends R{constructor(t){super(),this._outstandingMessages=[],this.errorString=null;const{geometryType:r,spatialReference:s,sourceSpatialReference:o}=t;this._config=t,this._featureZScaler=v(r,o,s),this._open()}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),this._websocket!=null&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(this._websocket==null)return"disconnected";switch(this._websocket.readyState){case g.CONNECTING:case g.OPEN:return"connected";case g.CLOSING:case g.CLOSED:return"disconnected"}}sendMessageToSocket(t){this._websocket!=null?this._websocket.send(JSON.stringify(t)):this._outstandingMessages.push(t)}sendMessageToClient(t){this._onMessage(t)}updateCustomParameters(t){this._config.customParameters=t,this._websocket!=null&&this._websocket.close()}async _tryCreateWebSocket(t=this._config.source.path,r=1e3,s=0){try{if(this.destroyed)return;const o=F(t,this._config.customParameters??{});this._websocket=await this._createWebSocket(o),this.notifyChange("connectionStatus")}catch(o){const n=r/1e3;return this._config.maxReconnectionAttempts&&s>=this._config.maxReconnectionAttempts?(c.getLogger(this).error(new a("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(c.getLogger(this).error(new a("websocket-connection",`Failed to connect. Attempting to reconnect in ${n}s`,o)),await L(r),this._tryCreateWebSocket(t,Math.min(1.5*r,1e3*this._config.maxReconnectionInterval),s+1))}}_setWebSocketJSONParseHandler(t){t.onmessage=r=>{try{const s=JSON.parse(r.data);this._onMessage(s)}catch(s){return void c.getLogger(this).error(new a("websocket-connection","Failed to parse message, invalid JSON",{error:s}))}}}_createWebSocket(t){return new Promise((r,s)=>{const o=new WebSocket(t);o.onopen=()=>{if(o.onopen=null,this.destroyed)return o.onclose=null,void o.close();o.onclose=n=>this._onClose(n),o.onerror=n=>this._onError(n),this._setWebSocketJSONParseHandler(o),r(o)},o.onclose=n=>{o.onopen=o.onclose=null,s(n)}})}async _handshake(t=1e4){const r=this._websocket;if(r==null)return;const s=C(),o=r.onmessage,{filter:n,outFields:u,spatialReference:l}=this._config;return s.timeout(t),r.onmessage=h=>{var w;let i=null;try{i=JSON.parse(h.data)}catch{}i&&typeof i=="object"||(c.getLogger(this).error(new a("websocket-connection","Protocol violation. Handshake failed - malformed message",h.data)),s.reject(),this.destroy()),((w=i.spatialReference)==null?void 0:w.wkid)!==(l==null?void 0:l.wkid)&&(c.getLogger(this).error(new a("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${l.wkid}`,h.data)),s.reject(),this.destroy()),i.format!=="json"&&(c.getLogger(this).error(new a("websocket-connection","Protocol violation. Handshake failed - format is not set",h.data)),s.reject(),this.destroy()),n&&i.filter!==n&&c.getLogger(this).error(new a("websocket-connection","Tried to set filter, but server doesn't support it")),u&&i.outFields!==u&&c.getLogger(this).error(new a("websocket-connection","Tried to set outFields, but server doesn't support it")),r.onmessage=o;for(const y of this._outstandingMessages)r.send(JSON.stringify(y));this._outstandingMessages=[],s.resolve()},r.send(JSON.stringify({filter:n,outFields:u,format:"json",spatialReference:{wkid:l.wkid}})),s.promise}_onMessage(t){if(this.onMessage(t),"type"in t)switch(t.type){case"features":case"featureResult":for(const r of t.features)this._featureZScaler!=null&&this._featureZScaler(r.geometry),this.onFeature(r)}}_onError(t){const r="Encountered an error over WebSocket connection";this._set("errorString",r),c.getLogger(this).error("websocket-connection",r)}_onClose(t){this._websocket=null,this.notifyChange("connectionStatus"),t.code!==1e3&&c.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${t.code}`),this.destroyed||this._open()}};d([p()],f.prototype,"connectionStatus",null),d([p()],f.prototype,"errorString",void 0),f=d([S("esri.layers.graphics.sources.connections.WebSocketConnection")],f);const W=1e4,T={maxQueryDepth:5,maxRecordCountFactor:3};let b=class extends f{constructor(e){super({...T,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||c.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:r,outFields:s}=this._config;this.destroyed||this._setFilter(r,s)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),this._featureZScaler!=null&&this._featureZScaler(t.geometry)}catch(r){return void c.getLogger(this).error(new a("geoevent-connection","Failed to parse message",r))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},r=O(e.path,{query:t,responseType:"json"}),s=(await r).data;return this._serviceDefinition=s,s}_fetchWebSocketUrl(e,t){const r=e[0],{urls:s,token:o}=r,n=this._inferWebSocketBaseUrl(s);return F(`${n}/subscribe`,{outSR:""+t.wkid,token:o})}_inferWebSocketBaseUrl(e){if(e.length===1)return e[0];for(const t of e)if(t.includes("wss"))return t;return c.getLogger(this).error(new a("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const r=this._websocket;if(r==null||e==null&&t==null)return;const s=JSON.stringify({filter:this._serializeFilter(e,t)});let o=!1;const n=C(),u=()=>{o||(this.destroyed||this._websocket!==r||c.getLogger(this).error(new a("geoevent-connection","Server timed out when setting filter")),n.reject())},l=h=>{const i=JSON.parse(h.data);i.filter&&(i.error&&(c.getLogger(this).error(new a("geoevent-connection","Failed to set service filter",i.error)),this._set("errorString",`Could not set service filter - ${i.error}`),n.reject(i.error)),this._setWebSocketJSONParseHandler(r),o=!0,n.resolve())};return r.onmessage=l,r.send(s),setTimeout(u,W),n.promise}_serializeFilter(e,t){const r={};if(e==null&&t==null)return r;if(e!=null&&e.geometry)try{const s=x(e.geometry);if(s.type!=="extent")throw new a(`Expected extent but found type ${s.type}`);r.geometry=JSON.stringify(s.shiftCentralMeridian())}catch(s){c.getLogger(this).error(new a("geoevent-connection","Encountered an error when setting connection geometryDefinition",s))}return e!=null&&e.where&&e.where!=="1 = 1"&&e.where!=="1=1"&&(r.where=e.where),t!=null&&(r.outFields=t.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[t],s=this._relatedFeatures.get(r);if(!s)return c.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:o,geometry:n}=s;for(const u in o)e.attributes[u]=o[u];return n&&(e.geometry=n),e.geometry||e.centroid||c.getLogger(this).error(new a("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),s=this._queryArchive(t);await r;const o=await s;if(!o)return;for(const n of o.features)this.onFeature(this._enrich(n))}catch(e){c.getLogger(this).error(new a("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){var y;const t=new(await E(()=>import("./FeatureLayer-5c6d2c3b.js"),["assets/FeatureLayer-5c6d2c3b.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/AttachmentQuery-972bbd60.js","assets/Query-1c961d4c.js","assets/RelationshipQuery-39c07195.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/TopFeaturesQuery-e44d05be.js","assets/popupUtils-82ea8abb.js"])).default({url:e}),{capabilities:r}=await t.load(),s=r.query.supportsMaxRecordCountFactor,o=r.query.supportsPagination,n=r.query.supportsCentroid,u=this._config.maxRecordCountFactor,l=t.capabilities.query.maxRecordCount,h=s?l*u:l,i=new M;if(i.outFields=this._config.outFields??["*"],i.where=((y=this._config.filter)==null?void 0:y.where)??"1=1",i.returnGeometry=!0,i.returnExceededLimitFeatures=!0,i.outSpatialReference=P.fromJSON(this._config.spatialReference),n&&(i.returnCentroid=!0),s&&(i.maxRecordCountFactor=u),o)return i.num=h,t.destroy(),this._queryPages(e,i);const w=await k(e,i,this._config.sourceSpatialReference);return t.destroy(),w.data}async _queryPages(e,t,r=[],s=0){t.start=t.num!=null?s*t.num:null;const{data:o}=await k(e,t,this._config.sourceSpatialReference);return o.exceededTransferLimit&&s<(this._config.maxQueryDepth??0)?(o.features.forEach(n=>r.push(n)),this._queryPages(e,t,r,s+1)):(r.forEach(n=>o.features.push(n)),o)}_addRelatedFeatures(e){const t=new Map,r=e.features,s=this._serviceDefinition.relatedFeatures.joinField;for(const o of r){const n=o.attributes[s];t.set(n,o)}this._relatedFeatures=t}};b=d([S("esri.layers.graphics.sources.connections.GeoEventConnection")],b);const $=b;let _=class extends R{constructor(e){super(),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:s}=e;this._featureZScaler=v(t,s,r)}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};d([p()],_.prototype,"connectionStatus",void 0),d([p()],_.prototype,"errorString",void 0),_=d([S("esri.layers.support.ClientSideConnection")],_);function H(e,t,r,s,o,n,u,l){const h={source:e,sourceSpatialReference:t,spatialReference:r,geometryType:s,filter:o,maxReconnectionAttempts:n,maxReconnectionInterval:u,customParameters:l};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new f(h):new $(h):new _(h)}export{H as createConnection}; diff --git a/assets/createSymbolSchema-16296a2b.js b/assets/createSymbolSchema-16296a2b.js new file mode 100644 index 0000000..d3f533e --- /dev/null +++ b/assets/createSymbolSchema-16296a2b.js @@ -0,0 +1 @@ +import{E as c,S}from"./TileInfoView-346e56d0.js";import{f as h,_ as V,A as b}from"./SymbolProcessor-f81deaae.js";import"./index-080e108a.js";import"./cimAnalyzer-01879161.js";import"./TileClipper-ae6eca9e.js";import"./definitions-0bc08d4c.js";import"./number-e491b09e.js";import"./BidiEngine-9a40f2f4.js";import"./diffUtils-590c9088.js";import"./Pipeline-98b9d349.js";import"./QueryEngine-19eda5ff.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./WhereClause-c86b9974.js";import"./executionError-c92d3b85.js";import"./json-48e3ea08.js";import"./QueryEngineCapabilities-42e44ded.js";import"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";import"./FieldsIndex-f79a8f26.js";import"./StreamFeatureManager-4b8ac3ac.js";import"./quickselect-e80674f5.js";import"./arcadeTimeUtils-e1438cc8.js";import"./centroid-8e8cfa47.js";import"./ogcFeatureUtils-1ccf1f8d.js";import"./geojson-077f67ec.js";import"./clientSideDefaults-ab04bd90.js";import"./defaultsJSON-59981e75.js";import"./query-93c6e211.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./Query-1c961d4c.js";import"./createConnection-4b117798.js";import"./geohashUtils-77d8429b.js";import"./tileUtils-48cbbab9.js";import"./TurboLine-aac2edf4.js";import"./Rect-98da58d6.js";import"./GeometryUtils-0258f920.js";function u(e){var r;return e.type==="line-marker"?{type:"line-marker",color:(r=e.color)==null?void 0:r.toJSON(),placement:e.placement,style:e.style}:e.constructor.fromJSON(e.toJSON()).toJSON()}function y(e){return b(e)}function ne(e,r,t=!1){if(!e)return null;switch(e.type){case"simple-fill":case"picture-fill":return x(e,r,t);case"simple-marker":case"picture-marker":return g(e,r,t);case"simple-line":return K(e,r,t);case"text":return z(e,r,t);case"label":return d(e,r,t);case"cim":return{type:"cim",rendererKey:r.vvFlags,data:e.data,maxVVSize:r.maxVVSize};case"CIMSymbolReference":return{type:"cim",rendererKey:r.vvFlags,data:e,maxVVSize:r.maxVVSize};case"web-style":return{...u(e),type:"web-style",hash:e.hash(),rendererKey:r.vvFlags,maxVVSize:r.maxVVSize};default:throw new Error(`symbol not supported ${e.type}`)}}function d(e,r,t){const o=e.toJSON(),i=h(c.LABEL,{...r,placement:o.labelPlacement});return{materialKey:t?y(i):i,hash:e.hash(),...o,labelPlacement:o.labelPlacement}}function x(e,r,t){const o=h(c.FILL,r),i=t?y(o):o,m=e.clone(),a=m.outline,s=V(r.symbologyType);s||(m.outline=null);const p={materialKey:i,hash:m.hash(),...u(m)};if(s)return p;const l=[];if(l.push(p),a){const n=h(c.LINE,{...r,isOutline:!0}),f={materialKey:t?y(n):n,hash:a.hash(),...u(a)};l.push(f)}return{type:"composite-symbol",layers:l,hash:l.reduce((n,f)=>f.hash+n,"")}}function K(e,r,t){const o=V(r.symbologyType)?S.DEFAULT:r.symbologyType,i=h(c.LINE,{...r,symbologyType:o}),m=t?y(i):i,a=e.clone(),s=a.marker;a.marker=null;const p=[];if(p.push({materialKey:m,hash:a.hash(),...u(a)}),s){const l=h(c.MARKER,r),n=t?y(l):l;s.color=s.color??a.color,p.push({materialKey:n,hash:s.hash(),lineWidth:a.width,...u(s)})}return{type:"composite-symbol",layers:p,hash:p.reduce((l,n)=>n.hash+l,"")}}function g(e,r,t){const o=h(c.MARKER,r),i=t?y(o):o,m=u(e);return{materialKey:i,hash:e.hash(),...m,angle:e.angle,maxVVSize:r.maxVVSize}}function z(e,r,t){const o=h(c.TEXT,r),i=t?y(o):o,m=u(e);return{materialKey:i,hash:e.hash(),...m,angle:e.angle,maxVVSize:r.maxVVSize}}export{ne as createSymbolSchema}; diff --git a/assets/crsUtils-3bab3d8c.js b/assets/crsUtils-3bab3d8c.js new file mode 100644 index 0000000..4a9f2af --- /dev/null +++ b/assets/crsUtils-3bab3d8c.js @@ -0,0 +1 @@ +const o=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]];function r(n){return n!=null&&o.some(([t,e])=>n>=t&&n<=e)}export{r as o}; diff --git a/assets/cs_CZ2-1e33a1ce.js b/assets/cs_CZ2-1e33a1ce.js new file mode 100644 index 0000000..5cee446 --- /dev/null +++ b/assets/cs_CZ2-1e33a1ce.js @@ -0,0 +1 @@ +const d={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n. l.",_era_bc:"př. n. l.",A:"dop.",P:"odp.",AM:"dop.",PM:"odp.","A.M.":"dop.","P.M.":"odp.",January:"ledna",February:"února",March:"března",April:"dubna",May:"května",June:"června",July:"července",August:"srpna",September:"září",October:"října",November:"listopadu",December:"prosince",Jan:"led",Feb:"úno",Mar:"bře",Apr:"dub","May(short)":"kvě",Jun:"čvn",Jul:"čvc",Aug:"srp",Sep:"zář",Oct:"říj",Nov:"lis",Dec:"pro",Sunday:"neděle",Monday:"pondělí",Tuesday:"úterý",Wednesday:"středa",Thursday:"čtvrtek",Friday:"pátek",Saturday:"sobota",Sun:"ne",Mon:"po",Tue:"út",Wed:"st",Thu:"čt",Fri:"pá",Sat:"so",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Zvětšení",Play:"Přehrát",Stop:"Ukončit iteraci (Stop)",Legend:"Legenda","Press ENTER to toggle":"",Loading:"Načítání",Home:"Domů",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Tisk",Image:"Snímek",Data:"Data",Print:"Tisk","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/assets/da_DK2-4e72198c.js b/assets/da_DK2-4e72198c.js new file mode 100644 index 0000000..00aacdf --- /dev/null +++ b/assets/da_DK2-4e72198c.js @@ -0,0 +1 @@ +const r={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"e.Kr.",_era_bc:"f.Kr.",A:"a",P:"p",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"januar",February:"februar",March:"marts",April:"april",May:"maj",June:"juni",July:"juli",August:"august",September:"september",October:"oktober",November:"november",December:"december",Jan:"jan.",Feb:"feb.",Mar:"mar.",Apr:"apr.","May(short)":"maj",Jun:"jun.",Jul:"jul.",Aug:"aug.",Sep:"sep.",Oct:"okt.",Nov:"nov.",Dec:"dec.",Sunday:"søndag",Monday:"mandag",Tuesday:"tirsdag",Wednesday:"onsdag",Thursday:"torsdag",Friday:"fredag",Saturday:"lørdag",Sun:"søn.",Mon:"man.",Tue:"tir.",Wed:"ons.",Thu:"tor.",Fri:"fre.",Sat:"lør.",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Zoom",Play:"Afspil",Stop:"Stop",Legend:"Signaturforklaring","Press ENTER to toggle":"",Loading:"Indlæser",Home:"Hjem",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Udskriv",Image:"Billede",Data:"Data",Print:"Udskriv","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Fra %1 til %2","From %1":"Fra %1","To %1":"Til %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{r as default}; diff --git a/assets/dataUtils-69946c3c.js b/assets/dataUtils-69946c3c.js new file mode 100644 index 0000000..56487cc --- /dev/null +++ b/assets/dataUtils-69946c3c.js @@ -0,0 +1 @@ +import{ai as D,aj as B,f4 as Er,al as Ot,ck as Dt,ar as yt,cl as et,bz as gt,bU as ir,aP as Rr,fL as Lr,aw as Ur,hf as Or,fI as Kt,ay as Dr,bY as Gr,c7 as Br,ca as Pe,bc as Nr,cp as ve,bh as Ee,cn as $r,ax as Fr,sC as sr}from"./index-080e108a.js";import{z as Re,y as Yt,v as Le,p as Vr}from"./colorUtils-c0f43caf.js";let Ue=class{constructor(e=null,r=null,o=null){this.minValue=e,this.maxValue=r,this.noDataValue=o}};const _r=9999999e31,jr=2e-7,zr={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};function Vt(t){return zr[t]??[-34028234663852886e22,34028234663852886e22]}function xe(t,e,r){if(t.depthCount&&t.depthCount>1)return;const{pixels:o,statistics:c,pixelType:i}=t,u=o[0].length,n=t.bandMasks??[],s=t.mask??new Uint8Array(u).fill(255),l=i==="f32"||i==="f64",a=Vt(i);let h=!1;for(let p=0;pf+Number.EPSILON||g=_r?jr*Math.abs(f):i==="f32"?2**-23:Number.EPSILON);for(let b=0;bthis._calculateBandStatistics(r,this.mask));const t=this.mask;let e=0;if(t!=null)for(let r=0;rr?r:np>=e.length),i=o===t.length&&!t.some((p,f)=>p!==f);if(c||i)return this;const u=((h=this.bandMasks)==null?void 0:h.length)===o?t.map(p=>this.bandMasks[p]):void 0;let{mask:n,validPixelCount:s}=this;const{width:l,height:a}=this;if(u){if(u.length===1)n=u[0];else{const p=l*a;n=new Uint8Array(p).fill(255);for(let f=0;f!!p).length}return new St({pixelType:this.pixelType,width:l,height:a,mask:n,bandMasks:u,validPixelCount:s,maskIsAlpha:this.maskIsAlpha,pixels:t.map(p=>e[p]),statistics:r&&t.map(p=>r[p])})}clone(){const t=new St({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;this.mask!=null&&(this.mask instanceof Uint8Array?t.mask=new Uint8Array(this.mask):t.mask=this.mask.slice(0)),this.bandMasks&&(t.bandMasks=this.bandMasks.map(o=>new Uint8Array(o)));const r=St.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const o=!!this.pixels[0].slice;for(e=0;e=3?(u=c[1],n=c[2]):c.length===2&&(u=c[1]);const l=new Uint32Array(t),a=this.width*this.height;if(i.length===a)if(e!=null&&e.length===a)if(r)for(s=0;s0){for(const g of o)if(g.minValue!=null&&(u=Math.min(u,g.minValue)),g.maxValue!=null&&g.minValue!=null){const C=g.maxValue-g.minValue;n=Math.max(n,C)}i=255/n}else{let g=255;c==="s8"?(u=-128,g=127):c==="u16"?g=65535:c==="s16"?(u=-32768,g=32767):c==="u32"?g=4294967295:c==="s32"?(u=-2147483648,g=2147483647):c==="f32"?(u=-34e38,g=34e38):c==="f64"&&(u=-Number.MAX_VALUE,g=Number.MAX_VALUE),i=255/(g-u)}const s=new Uint32Array(t),l=this.width*this.height;let a,h,p,f,m;if(a=h=p=e[0],a.length!==l)return gt.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(h=e[1],e.length>=3&&(p=e[2]),r!=null&&r.length===l)for(f=0;f=3?(c=e[1],i=e[2]):e.length===2&&(c=e[1]);const n=this.width*this.height;if(o.length!==n)return gt.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let s=0;if(r!=null&&r.length===n)for(u=0;uo?u:o);else for(i=0;io?u:o;return new Ue(r,o)}};D([B({json:{write:!0}})],it.prototype,"width",void 0),D([B({json:{write:!0}})],it.prototype,"height",void 0),D([B({json:{write:!0}})],it.prototype,"pixelType",void 0),D([Er("pixelType")],it.prototype,"castPixelType",null),D([B({json:{write:!0}})],it.prototype,"validPixelCount",void 0),D([B({json:{write:!0}})],it.prototype,"mask",void 0),D([B({json:{write:!0}})],it.prototype,"maskIsAlpha",void 0),D([B({json:{write:!0}})],it.prototype,"pixels",void 0),D([B()],it.prototype,"premultiplyAlpha",void 0),D([B({json:{write:!0}})],it.prototype,"statistics",void 0),D([B({json:{write:!0}})],it.prototype,"depthCount",void 0),D([B({json:{write:!0}})],it.prototype,"noDataValues",void 0),D([B({json:{write:!0}})],it.prototype,"bandMasks",void 0),it=St=D([Ot("esri.layers.support.PixelBlock")],it);const H=it;var re,Oe,De,ce={exports:{}};ce.exports,Oe=ce,re=function(){function t(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return t.prototype={ensureBuffer:function(e){var r=this.buffer,o=r?r.byteLength:0;if(ec&&(o=c)}else{for(;!this.eof;)this.readBlock();o=this.bufferLength}return this.pos=o,this.buffer.subarray(r,o)},lookChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(e,r,o){for(var c=e+r;this.bufferLength<=c&&!this.eof;)this.readBlock();return new Stream(this.buffer,e,r,o)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0}},t}(),(De=function(){if(!self||!self.Uint32Array)return null;var t=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),e=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),r=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),o=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],c=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function i(n){throw new Error(n)}function u(n){var s=0,l=n[s++],a=n[s++];l!=-1&&a!=-1||i("Invalid header in flate stream"),(15&l)!=8&&i("Unknown compression method in flate stream"),((l<<8)+a)%31!=0&&i("Bad FCHECK in flate stream"),32&a&&i("FDICT bit set in flate stream"),this.bytes=n,this.bytesPos=s,this.codeSize=0,this.codeBuf=0,re.call(this)}return u.prototype=Object.create(re.prototype),u.prototype.getBits=function(n){for(var s,l=this.codeSize,a=this.codeBuf,h=this.bytes,p=this.bytesPos;l>n,this.codeSize=l-=n,this.bytesPos=p,s},u.prototype.getCode=function(n){for(var s=n[0],l=n[1],a=this.codeSize,h=this.codeBuf,p=this.bytes,f=this.bytesPos;a>16,d=65535&g;return(a==0||a>C,this.codeSize=a-C,this.bytesPos=f,d},u.prototype.generateHuffmanTable=function(n){for(var s=n.length,l=0,a=0;al&&(l=n[a]);for(var h=1<>=1;for(a=d;a0;)j[g++]=_}var s=this.getBits(3);if(1&s&&(this.eof=!0),(s>>=1)!=0){var l,a;if(s==1)l=o,a=c;else if(s==2){for(var h=this.getBits(5)+257,p=this.getBits(5)+1,f=this.getBits(4)+4,m=Array(t.length),g=0;g=v&&(v=(R=this.ensureBuffer(x+1)).length),R[x++]=k;else{if(k==256)return void(this.bufferLength=x);var S=(k=e[k-=257])>>16;S>0&&(S=this.getBits(S)),d=(65535&k)+S,k=this.getCode(a),(S=(k=r[k])>>16)>0&&(S=this.getBits(S));var A=(65535&k)+S;x+d>=v&&(v=(R=this.ensureBuffer(x+d)).length);for(var M=0;M{let a=null;u==="jpg"&&n&&(a=ar._getMask(e,{width:c,height:i}));const h=new Blob([new Uint8Array(e)],{type:"image/"+u=="jpg"?"jpeg":u}),p=URL.createObjectURL(h),f=new Image;let m;f.src=p,f.onload=()=>{if(URL.revokeObjectURL(p),Rr(o))return void l(Lr());c=f.width,i=f.height,this._canvas&&this._ctx?(this._canvas.width===c&&this._canvas.height===i||(this._canvas.width=c,this._canvas.height=i),this._ctx.clearRect(0,0,c,i)):(this._canvas=document.createElement("canvas"),this._canvas.width=c,this._canvas.height=i,this._ctx=this._canvas.getContext("2d")),this._ctx.drawImage(f,0,0);const g=this._ctx.getImageData(0,0,c,i);let C;if(m=g.data,r.renderOnCanvas){if(a)for(C=0;C{URL.revokeObjectURL(p),l("cannot load image")}})}static _getMask(e,r){let o=null;try{const c=new Uint8Array(e),i=Math.ceil(c.length/2);let u=0;const n=c.length-2;for(u=i;u=0;h--)o[l++]=s[a]>>h&1}}catch{}return o}};var Ge,Be,Ne,ue={exports:{}};ue.exports,Ge=ue,Be=function(){var t=function(){function e(r){this.message="JPEG error: "+r}return e.prototype=new Error,e.prototype.name="JpegError",e.constructor=e,e}();return function(){if(!self||!self.Uint8ClampedArray)return null;var e=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),r=4017,o=799,c=3406,i=2276,u=1567,n=3784,s=5793,l=2896;function a(){this.decodeTransform=null,this.colorTransform=-1}function h(d,y){for(var w,b,v=0,x=[],k=16;k>0&&!d[k-1];)k--;x.push({children:[],index:0});var S,A=x[0];for(w=0;w0;)A=x.pop();for(A.index++,x.push(A);x.length<=w;)x.push(S={children:[],index:0}),A.children[A.index]=S.children,A=S;v++}w+10)return L--,P>>L&1;if((P=d[y++])===255){var $=d[y++];if($)throw new t("unexpected marker "+(P<<8|$).toString(16))}return L=7,P>>>7}function U($){for(var W=$;;){if(typeof(W=W[E()])=="number")return W;if(typeof W!="object")throw new t("invalid huffman sequence")}}function R($){for(var W=0;$>0;)W=W<<1|E(),$--;return W}function N($){if($===1)return E()===1?1:-1;var W=R($);return W>=1<<$-1?W:W+(-1<<$)+1}function G($,W){var K=U($.huffmanTableDC),rt=K===0?0:N(K);$.blockData[W]=$.pred+=rt;for(var at=1;at<64;){var ft=U($.huffmanTableAC),ot=15&ft,lt=ft>>4;if(ot!==0){var Pr=e[at+=lt];$.blockData[W+Pr]=N(ot),at++}else{if(lt<15)break;at+=16}}}function O($,W){var K=U($.huffmanTableDC),rt=K===0?0:N(K)<0)F--;else for(var K=x,rt=k;K<=rt;){var at=U($.huffmanTableAC),ft=15&at,ot=at>>4;if(ft!==0){var lt=e[K+=ot];$.blockData[W+lt]=N(ft)*(1<>4,(K=15&rt)==0)ot<15?(F=R(ot)+(1<=65488&&kt<=65495))break;y+=2}return(ut=C(d,y))&&ut.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+ut.invalid),y=ut.offset),y-I}function m(d,y,w){var b,v,x,k,S,A,M,T,I,P,L,E,U,R,N,G,O,j=d.quantizationTable,F=d.blockData;if(!j)throw new t("missing required Quantization Table.");for(var V=0;V<64;V+=8)I=F[y+V],P=F[y+V+1],L=F[y+V+2],E=F[y+V+3],U=F[y+V+4],R=F[y+V+5],N=F[y+V+6],G=F[y+V+7],I*=j[V],P|L|E|U|R|N|G?(P*=j[V+1],L*=j[V+2],E*=j[V+3],U*=j[V+4],R*=j[V+5],N*=j[V+6],G*=j[V+7],v=(b=(b=s*I+128>>8)+(v=s*U+128>>8)+1>>1)-v,O=(x=L)*n+(k=N)*u+128>>8,x=x*u-k*n+128>>8,M=(S=(S=l*(P-G)+128>>8)+(M=R<<4)+1>>1)-M,A=(T=(T=l*(P+G)+128>>8)+(A=E<<4)+1>>1)-A,k=(b=b+(k=O)+1>>1)-k,x=(v=v+x+1>>1)-x,O=S*i+T*c+2048>>12,S=S*c-T*i+2048>>12,T=O,O=A*o+M*r+2048>>12,A=A*r-M*o+2048>>12,M=O,w[V]=b+T,w[V+7]=b-T,w[V+1]=v+M,w[V+6]=v-M,w[V+2]=x+A,w[V+5]=x-A,w[V+3]=k+S,w[V+4]=k-S):(O=s*I+512>>10,w[V]=O,w[V+1]=O,w[V+2]=O,w[V+3]=O,w[V+4]=O,w[V+5]=O,w[V+6]=O,w[V+7]=O);for(var _=0;_<8;++_)I=w[_],(P=w[_+8])|(L=w[_+16])|(E=w[_+24])|(U=w[_+32])|(R=w[_+40])|(N=w[_+48])|(G=w[_+56])?(v=(b=4112+((b=s*I+2048>>12)+(v=s*U+2048>>12)+1>>1))-v,O=(x=L)*n+(k=N)*u+2048>>12,x=x*u-k*n+2048>>12,k=O,M=(S=(S=l*(P-G)+2048>>12)+(M=R)+1>>1)-M,A=(T=(T=l*(P+G)+2048>>12)+(A=E)+1>>1)-A,O=S*i+T*c+2048>>12,S=S*c-T*i+2048>>12,T=O,O=A*o+M*r+2048>>12,A=A*r-M*o+2048>>12,I=(I=(b=b+k+1>>1)+T)<16?0:I>=4080?255:I>>4,P=(P=(v=v+x+1>>1)+(M=O))<16?0:P>=4080?255:P>>4,L=(L=(x=v-x)+A)<16?0:L>=4080?255:L>>4,E=(E=(k=b-k)+S)<16?0:E>=4080?255:E>>4,U=(U=k-S)<16?0:U>=4080?255:U>>4,R=(R=x-A)<16?0:R>=4080?255:R>>4,N=(N=v-M)<16?0:N>=4080?255:N>>4,G=(G=b-T)<16?0:G>=4080?255:G>>4,F[y+_]=I,F[y+_+8]=P,F[y+_+16]=L,F[y+_+24]=E,F[y+_+32]=U,F[y+_+40]=R,F[y+_+48]=N,F[y+_+56]=G):(O=(O=s*I+8192>>14)<-2040?0:O>=2024?255:O+2056>>4,F[y+_]=O,F[y+_+8]=O,F[y+_+16]=O,F[y+_+24]=O,F[y+_+32]=O,F[y+_+40]=O,F[y+_+48]=O,F[y+_+56]=O)}function g(d,y){for(var w=y.blocksPerLine,b=y.blocksPerColumn,v=new Int16Array(64),x=0;x=v)return null;var k=b(y);if(k>=65472&&k<=65534)return{invalid:null,marker:k,offset:y};for(var S=b(x);!(S>=65472&&S<=65534);){if(++x>=v)return null;S=b(x)}return{invalid:k.toString(16),marker:S,offset:x}}return a.prototype={parse:function(d){function y(){var $=d[k]<<8|d[k+1];return k+=2,$}function w(){var $=y(),W=k+$-2,K=C(d,W,k);K&&K.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+K.invalid),W=K.offset);var rt=d.subarray(k,W);return k+=rt.length,rt}function b($){for(var W=Math.ceil($.samplesPerLine/8/$.maxH),K=Math.ceil($.scanLines/8/$.maxV),rt=0;rt<$.components.length;rt++){Z=$.components[rt];var at=Math.ceil(Math.ceil($.samplesPerLine/8)*Z.h/$.maxH),ft=Math.ceil(Math.ceil($.scanLines/8)*Z.v/$.maxV),ot=W*Z.h,lt=K*Z.v*64*(ot+1);Z.blockData=new Int16Array(lt),Z.blocksPerLine=at,Z.blocksPerColumn=ft}$.mcusPerLine=W,$.mcusPerColumn=K}var v,x,k=0,S=null,A=null,M=[],T=[],I=[],P=y();if(P!==65496)throw new t("SOI not found");for(P=y();P!==65497;){var L,E,U;switch(P){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var R=w();P===65504&&R[0]===74&&R[1]===70&&R[2]===73&&R[3]===70&&R[4]===0&&(S={version:{major:R[5],minor:R[6]},densityUnits:R[7],xDensity:R[8]<<8|R[9],yDensity:R[10]<<8|R[11],thumbWidth:R[12],thumbHeight:R[13],thumbData:R.subarray(14,14+3*R[12]*R[13])}),P===65518&&R[0]===65&&R[1]===100&&R[2]===111&&R[3]===98&&R[4]===101&&(A={version:R[5]<<8|R[6],flags0:R[7]<<8|R[8],flags1:R[9]<<8|R[10],transformCode:R[11]});break;case 65499:for(var N=y()+k-2;k>4){if(G>>4!=1)throw new t("DQT - invalid table spec");for(E=0;E<64;E++)O[e[E]]=y()}else for(E=0;E<64;E++)O[e[E]]=d[k++];M[15&G]=O}break;case 65472:case 65473:case 65474:if(v)throw new t("Only single frame JPEGs supported");y(),(v={}).extended=P===65473,v.progressive=P===65474,v.precision=d[k++],v.scanLines=y(),v.samplesPerLine=y(),v.components=[],v.componentIds={};var j,F=d[k++],V=0,_=0;for(L=0;L>4,tt=15&d[k+1];V>4?T:I)[15&J]=h(q,dt)}break;case 65501:y(),x=y();break;case 65498:y();var Z,Gt=d[k++],vt=[];for(L=0;L>4],Z.huffmanTableAC=T[15&xt],vt.push(Z)}var jt=d[k++],zt=d[k++],mt=d[k++],Wt=f(d,k,v,vt,x,jt,zt,mt>>4,15&mt);k+=Wt;break;case 65535:d[k]!==255&&k--;break;default:if(d[k-3]===255&&d[k-2]>=192&&d[k-2]<=254){k-=3;break}throw new t("unknown marker "+P.toString(16))}P=y()}for(this.width=v.samplesPerLine,this.height=v.scanLines,this.jfif=S,this.eof=k,this.adobe=A,this.components=[],L=0;L>8)+F[T+1];return G},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(d){for(var y,w,b,v=0,x=d.length;v4)throw new t("Unsupported color mode");var b=this._getLinearizedBlockData(d,y);if(this.numComponents===1&&w){for(var v=b.length,x=new Uint8ClampedArray(3*v),k=0,S=0;S=0;g--)p[d++]=C[f]>>g&1}catch{}if(n===1&&l.length===i*u){const C=new Uint8Array(l.buffer);h=[C,C,C]}else{for(h=[],f=0;f<3;f++)h.push(new Uint8Array(a));for(g=0,m=0;mimport("./lerc-wasm-acc570d7.js"),["assets/lerc-wasm-acc570d7.js","assets/index-080e108a.js","assets/index-a8e73b5e.css"]).then(t=>t.l).then(({default:t})=>t({locateFile:e=>Or(`esri/layers/support/rasterFormats/${e}`)})).then(t=>{Kr(t)}),oe)}const Xt={getBlobInfo:null,decode:null};function qr(t){return 16+(t>>3<<3)}function Ct(t,e,r){r.set(t.slice(e,e+r.length))}function Kr(t){const{_malloc:e,_free:r,_lerc_getBlobInfo:o,_lerc_getDataRanges:c,_lerc_decode_4D:i,asm:u}=t;let n;const s=Object.values(u).find(a=>a&&"buffer"in a&&a.buffer===t.HEAPU8.buffer),l=a=>{const h=a.map(g=>qr(g)),p=h.reduce((g,C)=>g+C),f=e(p);n=new Uint8Array(s.buffer);let m=h[0];h[0]=f;for(let g=1;g{const f=new Uint8Array(48),m=new Uint8Array(8*3),[g,C,d]=l([a.length,f.length,m.length]);n.set(a,g),n.set(f,C),n.set(m,d);let y=o(g,a.length,C,d,12,3);if(y)throw r(g),new Error(`lerc-getBlobInfo: error code is ${y}`);n=new Uint8Array(s.buffer),Ct(n,C,f),Ct(n,d,m);const w=new Uint32Array(f.buffer),b=new Float64Array(m.buffer),[v,x,,k,S,A,M,T,I,P,L]=w,E={version:v,depthCount:P,width:k,height:S,validPixelCount:M,bandCount:A,blobSize:T,maskCount:I,dataType:x,minValue:b[0],maxValue:b[1],maxZerror:b[2],statistics:[],bandCountWithNoData:L};if(L)return E;if(P===1&&A===1)return r(g),E.statistics.push({minValue:b[0],maxValue:b[1]}),E;const U=P*A*8,R=new Uint8Array(U),N=new Uint8Array(U);let G=g,O=0,j=0,F=!1;if(n.byteLength1){const wt=V.slice(tt*P,(tt+1)*P),bt=_.slice(tt*P,(tt+1)*P),J=Math.min.apply(null,wt),q=Math.max.apply(null,bt);X.push({minValue:J,maxValue:q,depthStats:{minValues:wt,maxValues:bt}})}else X.push({minValue:V[tt],maxValue:_[tt]});return r(G),F||r(O),E},Xt.decode=(a,h)=>{const{maskCount:p,depthCount:f,bandCount:m,width:g,height:C,dataType:d,bandCountWithNoData:y}=h,w=cr[d],b=g*C,v=new Uint8Array(b*m),x=b*f*m*w.size,k=new Uint8Array(x),S=new Uint8Array(m),A=new Uint8Array(8*m),[M,T,I,P,L]=l([a.length,v.length,k.length,S.length,A.length]);n.set(a,M),n.set(v,T),n.set(k,I),n.set(S,P),n.set(A,L);const E=i(M,a.length,p,T,f,g,C,m,d,I,P,L);if(E)throw r(M),new Error(`lerc-decode: error code is ${E}`);n=new Uint8Array(s.buffer),Ct(n,I,k),Ct(n,T,v);let U=null;if(y){Ct(n,P,S),Ct(n,L,A),U=[];const R=new Float64Array(A.buffer);for(let N=0;N1){v.set(y[0]);for(let M=1;M=x;if(f>0&&k)for(let M=0;M1?y:null,{pixelType:A}=g;return{width:s,height:l,bandCount:a,pixelType:A,depthCount:h,statistics:m,pixels:d,mask:v,bandMasks:S,noDataValues:n}}function Yr(t,e,r,o=!0){if(e%4!=0||r%4!=0){const c=new ArrayBuffer(4*Math.ceil(r/4)),i=new Uint8Array(c),u=new Uint8Array(t,e,r);if(o)for(let n=0;n=i)n-=i,p=h>>>32-i,h<<=i;else{p=h>>>32-n,h=c[a++];const d=i-n;n=32-d,p=(p<>>n),h<<=d}if(p===257)break;if(p===256){i=9,u=$e(),s=u.length,l=[];continue}const C=u[p];if(C==null){if(p>u.length)throw new Error("data integrity issue: code does not exist on code page");l.push(l[0]),u[s++]=l.slice(),Fe(g,l)}else Fe(g,C),l.push(C[0]),l.length>1&&(u[s++]=l.slice()),l=C.slice();if(Et.has(s)&&i++,n===0&&(h=c[a++],n=32),a>f||a===f&&n<=m)break}return new Uint8Array(g)}Et.add(511),Et.add(1023),Et.add(2047),Et.add(4095),Et.add(8191);const Ve=(t,e)=>{const r=e.width*e.height,o=e.pixelType;return Math.floor(t.byteLength/(r*fr(o)))},fr=t=>{let e=1;switch(t){case Uint8Array:case Int8Array:e=1;break;case Uint16Array:case Int16Array:e=2;break;case Uint32Array:case Int32Array:case Float32Array:e=4;break;case Float64Array:e=8}return e},Xr=(t,e)=>{if(8*t.byteLength=0;n--)o[c++]=i>>n&1;for(n=7;c>n&1,n--;return o};let Zr=class{static decode(e,r){const o=r.pixelType,c=[],i=r.width*r.height,u=Ve(e,r),{bandIds:n,format:s}=r,l=n&&n.length||Ve(e,r),a=e.byteLength-e.byteLength%(i*fr(o)),h=new o(e,0,i*u);let p,f,m,g,C=null;if(s==="bip")for(p=0;p>4,c<8?c=1:c===15?(c=4,i=(7&i)<<18|(63&t[r++])<<12|(63&t[r++])<<6|63&t[r++]):c===14?(c=3,i=(15&i)<<12|(63&t[r++])<<6|63&t[r++]):(c=2,i=(31&i)<<6|63&t[r++]),(i!==0||e)&&(o+=String.fromCharCode(i));return o}const Ae=(()=>{const t=[];return t[254]="NEWSUBFILETYPE",t[255]="SUBFILETYPE",t[256]="IMAGEWIDTH",t[257]="IMAGELENGTH",t[258]="BITSPERSAMPLE",t[259]="COMPRESSION",t[262]="PHOTOMETRICINTERPRETATION",t[263]="THRESHHOLDING",t[264]="CELLWIDTH",t[265]="CELLLENGTH",t[266]="FILLORDER",t[269]="DOCUMENTNAME",t[270]="IMAGEDESCRIPTION",t[271]="MAKE",t[272]="MODEL",t[273]="STRIPOFFSETS",t[274]="ORIENTATION",t[277]="SAMPLESPERPIXEL",t[278]="ROWSPERSTRIP",t[279]="STRIPBYTECOUNTS",t[280]="MINSAMPLEVALUE",t[281]="MAXSAMPLEVALUE",t[282]="XRESOLUTION",t[283]="YRESOLUTION",t[284]="PLANARCONFIGURATION",t[285]="PAGENAME",t[286]="XPOSITION",t[287]="YPOSITION",t[288]="FREEOFFSETS",t[289]="FREEBYTECOUNTS",t[290]="GRAYRESPONSEUNIT",t[291]="GRAYRESPONSECURVE",t[292]="T4OPTIONS",t[293]="T6OPTIONS",t[296]="RESOLUTIONUNIT",t[297]="PAGENUMBER",t[300]="COLORRESPONSEUNIT",t[301]="TRANSFERFUNCTION",t[305]="SOFTWARE",t[306]="DATETIME",t[315]="ARTIST",t[316]="HOSTCOMPUTER",t[317]="PREDICTOR",t[318]="WHITEPOINT",t[319]="PRIMARYCHROMATICITIES",t[320]="COLORMAP",t[321]="HALFTONEHINTS",t[322]="TILEWIDTH",t[323]="TILELENGTH",t[324]="TILEOFFSETS",t[325]="TILEBYTECOUNTS",t[326]="BADFAXLINES",t[327]="CLEANFAXDATA",t[328]="CONSECUTIVEBADFAXLINES",t[330]="SUBIFD",t[332]="INKSET",t[333]="INKNAMES",t[334]="NUMBEROFINKS",t[336]="DOTRANGE",t[337]="TARGETPRINTER",t[338]="EXTRASAMPLES",t[339]="SAMPLEFORMAT",t[340]="SMINSAMPLEVALUE",t[341]="SMAXSAMPLEVALUE",t[342]="TRANSFERRANGE",t[347]="JPEGTABLES",t[512]="JPEGPROC",t[513]="JPEGIFOFFSET",t[514]="JPEGIFBYTECOUNT",t[515]="JPEGRESTARTINTERVAL",t[517]="JPEGLOSSLESSPREDICTORS",t[518]="JPEGPOINTTRANSFORM",t[519]="JPEGQTABLES",t[520]="JPEGDCTABLES",t[521]="JPEGACTABLES",t[529]="YCBCRCOEFFICIENTS",t[530]="YCBCRSUBSAMPLING",t[531]="YCBCRPOSITIONING",t[532]="REFERENCEBLACKWHITE",t[700]="XMP",t[33550]="GEOPIXELSCALE",t[33922]="GEOTIEPOINTS",t[33432]="COPYRIGHT",t[42112]="GDAL_METADATA",t[42113]="GDAL_NODATA",t[50844]="RPCCOEFFICIENT",t[34264]="GEOTRANSMATRIX",t[34735]="GEOKEYDIRECTORY",t[34736]="GEODOUBLEPARAMS",t[34737]="GEOASCIIPARAMS",t[34665]="EXIFIFD",t[34853]="GPSIFD",t[40965]="INTEROPERABILITYIFD",t})(),to=(()=>{const t=Ae.slice();return t[36864]="ExifVersion",t[40960]="FlashpixVersion",t[40961]="ColorSpace",t[42240]="Gamma",t[37121]="ComponentsConfiguration",t[37122]="CompressedBitsPerPixel",t[40962]="PixelXDimension",t[40963]="PixelYDimension",t[37500]="MakerNote",t[37510]="UserComment",t[40964]="RelatedSoundFile",t[36867]="DateTimeOriginal",t[36868]="DateTimeDigitized",t[36880]="OffsetTime",t[36881]="OffsetTimeOriginal",t[36882]="OffsetTimeDigitized",t[37520]="SubSecTime",t[37521]="SubSecTimeOriginal",t[37522]="SubSecTimeDigitized",t[37888]="Temperature",t[37889]="Humidity",t[37890]="Pressure",t[37891]="WaterDepth",t[37892]="Acceleration",t[37893]="CameraElevationAngle",t[42016]="ImageUniqueID",t[42032]="CameraOwnerName",t[42033]="BodySerialNumber",t[42034]="LensSpecification",t[42035]="LensMake",t[42036]="LensModel",t[42037]="LensSerialNumber",t[33434]="ExposureTime",t[33437]="FNumber",t[34850]="ExposureProgram",t[34852]="SpectralSensitivity",t[34855]="PhotographicSensitivity",t[34856]="OECF",t[34864]="SensitivityType",t[34865]="StandardOutputSensitivity",t[34866]="RecommendedExposureIndex",t[34867]="ISOSpeed",t[34868]="ISOSpeedLatitudeyyy",t[34869]="ISOSpeedLatitudezzz",t[37377]="ShutterSpeedValue",t[37378]="ApertureValue",t[37379]="BrightnessValue",t[37380]="ExposureBiasValue",t[37381]="MaxApertureValue",t[37382]="SubjectDistance",t[37383]="MeteringMode",t[37384]="LightSource",t[37385]="Flash",t[37386]="FocalLength",t[37396]="SubjectArea",t[41483]="FlashEnergy",t[41484]="SpatialFrequencyResponse",t[41486]="FocalPlaneXResolution",t[41487]="FocalPlaneYResolution",t[41488]="FocalPlaneResolutionUnit",t[41492]="SubjectLocation",t[41493]="ExposureIndex",t[41495]="SensingMethod",t[41728]="FileSource",t[41729]="SceneType",t[41730]="CFAPattern",t[41985]="CustomRendered",t[41986]="ExposureMode",t[41987]="WhiteBalance",t[41988]="DigitalZoomRatio",t[41989]="FocalLengthIn35mmFilm",t[41990]="SceneCaptureType",t[41991]="GainControl",t[41992]="Contrast",t[41993]="Saturation",t[41994]="Sharpness",t[41995]="DeviceSettingDescription",t[41996]="SubjectDistanceRange",t})(),eo=["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"],ro=(()=>{const t=[];return t[1024]="GTModelTypeGeoKey",t[1025]="GTRasterTypeGeoKey",t[1026]="GTCitationGeoKey",t[2048]="GeographicTypeGeoKey",t[2049]="GeogCitationGeoKey",t[2050]="GeogGeodeticDatumGeoKey",t[2051]="GeogPrimeMeridianGeoKey",t[2052]="GeogLinearUnitsGeoKey",t[2053]="GeogLinearUnitSizeGeoKey",t[2054]="GeogAngularUnitsGeoKey",t[2055]="GeogAngularUnitSizeGeoKey",t[2056]="GeogEllipsoidGeoKey",t[2057]="GeogSemiMajorAxisGeoKey",t[2058]="GeogSemiMinorAxisGeoKey",t[2059]="GeogInvFlatteningGeoKey",t[2061]="GeogPrimeMeridianLongGeoKey",t[2060]="GeogAzimuthUnitsGeoKey",t[3072]="ProjectedCSTypeGeoKey",t[3073]="PCSCitationGeoKey",t[3074]="ProjectionGeoKey",t[3075]="ProjCoordTransGeoKey",t[3076]="ProjLinearUnitsGeoKey",t[3077]="ProjLinearUnitSizeGeoKey",t[3078]="ProjStdParallel1GeoKey",t[3079]="ProjStdParallel2GeoKey",t[3080]="ProjNatOriginLongGeoKey",t[3081]="ProjNatOriginLatGeoKey",t[3082]="ProjFalseEastingGeoKey",t[3083]="ProjFalseNorthingGeoKey",t[3084]="ProjFalseOriginLongGeoKey",t[3085]="ProjFalseOriginLatGeoKey",t[3086]="ProjFalseOriginEastingGeoKey",t[3087]="ProjFalseOriginNorthingGeoKey",t[3088]="ProjCenterLongGeoKey",t[3090]="ProjCenterEastingGeoKey",t[3091]="ProjCenterNorthingGeoKey",t[3092]="ProjScaleAtNatOriginGeoKey",t[3093]="ProjScaleAtCenterGeoKey",t[3094]="ProjAzimuthAngleGeoKey",t[3095]="ProjStraightVertPoleLongGeoKey",t[4096]="VerticalCSTypeGeoKey",t[4097]="VerticalCitationGeoKey",t[4098]="VerticalDatumGeoKey",t[4099]="VerticalUnitsGeoKey",t})(),oo=(t,e)=>{let r=(e||Ae)[t];return r===void 0&&(r="unknown"+String(t)),r},he=new Map;he.set("EXIFIFD",to),he.set("GPSIFD",eo);const Lt={TIFF_TAGS:Ae,ifdTags:he,GEO_KEYS:ro,getTagName:oo},Se=(()=>{const t=new ArrayBuffer(4),e=new Uint8Array(t);return new Uint32Array(t)[0]=1,e[0]===1})(),_e=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],Ut=4294967296,no=new Set([1,5,6,7,8,34712,34887]);function Te(t,e){let r="unknown";return t===3?r=e===64?"f64":"f32":t===1?e===1?r="u1":e===2?r="u2":e===4?r="u4":e<=8?r="u8":e<=16?r="u16":e<=32&&(r="u32"):t===2&&(e<=8?r="s8":e<=16?r="s16":e<=32&&(r="s32")),r}function Zt(t){let e=null;switch(t?t.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":e=Uint8Array;break;case"u16":e=Uint16Array;break;case"u32":e=Uint32Array;break;case"s8":e=Int8Array;break;case"s16":e=Int16Array;break;case"s32":e=Int32Array;break;case"f64":e=Float64Array;break;default:e=Float32Array}return e}function io(t,e){return{x:e[0]*t.x+e[1]*t.y+e[2],y:e[3]*t.x+e[4]*t.y+e[5]}}function pr(t,e){var r;return(r=t.get(e))==null?void 0:r.values}function Mt(t,e){var r;return(r=t.get(e))==null?void 0:r.values}function je(t,e){var r,o;return(o=(r=t.get(e))==null?void 0:r.values)==null?void 0:o[0]}function z(t,e){var r,o;return(o=(r=t.get(e))==null?void 0:r.values)==null?void 0:o[0]}function ne(t,e,r,o=0,c=Lt.TIFF_TAGS,i=4){const u=i===8,n=u?Me(new DataView(t,r,8),0,e):new DataView(t,r,2).getUint16(0,e),s=4+2*i,l=u?8:2,a=l+n*s;if(r+a>t.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:a};const h=r+a+4<=t.byteLength?Jt(new DataView(t,r+a,i===8?8:4),0,e,i===8):null,p=r+l,f=new Map;let m,g,C,d,y,w=0,b=0;for(let v=0;vhr(t,{inputOffset:e}).pixels[0];function fe(t,e){if(e!==1&&e!==2&&e!==4)return t;const r=new Uint8Array(t),o=8/e,c=new Uint8Array(t.byteLength*o);let i=0;const u=2**e-1;for(let n=0;n>>8-e&u}return c.buffer}function pe(t,e,r){const o=new lr;o.parse(t),o.colorTransform=r===6?-1:0;const c=o.getData(o.width,o.height,e!==1);return new Uint8Array(c.buffer)}function de(t){const e=new _t(t).getBytes(),r=new ArrayBuffer(e.length),o=new Uint8Array(r);return o.set(e),o}async function me(t,e,r,o,c){const i=Se===e,u=z(r,"BITSPERSAMPLE"),n=z(r,"SAMPLESPERPIXEL")??1,s=z(r,"PHOTOMETRICINTERPRETATION"),l=z(r,"SAMPLEFORMAT")??1,a=Te(l,u),h=z(r,"COMPRESSION")??1,p=Zt(a);let f,m,g;if(h===34887)return await ur(),so(t,o);if(h===1)f=t.slice(o,o+c),m=new Uint8Array(f);else if(h===8||h===32946)m=new Uint8Array(t,o,c),m=de(m),f=m.buffer;else if(h===6)m=new Uint8Array(t,o,c),m=pe(m,n,s),f=m.buffer;else if(h===7){const w=r.get("JPEGTABLES").values,b=w.length-2;m=new Uint8Array(b+c-2);for(let x=0;x1&&(h===5||h===8||h===32946)&&d&&y){const w=Qt(r),b=new p(g.length);b.set(g),g=yo(b,y,d,l===3&&C===3,w?1:n)}return g}async function ao(t,e,r){const o=Mt(r,"TILEOFFSETS");if(o===void 0)return null;const c=Mt(r,"TILEBYTECOUNTS"),{width:i,height:u,pixelType:n,tileWidth:s,tileHeight:l}=Ie([r]),a=Qt(r,e),h=z(r,"SAMPLESPERPIXEL")||e.planes,p=i*u,f=z(r,"BITSPERSAMPLE"),m=(z(r,"COMPRESSION")??1)===34887,g=Zt(n),C=[];for(let E=0;E1){const E=Math.round(o.length/h);for(d=0;d{const o=Se===e.littleEndian,c=Mt(r,"STRIPOFFSETS");if(c===void 0)return null;const{width:i,height:u,pixelType:n}=Ie([r]),s=z(r,"SAMPLESPERPIXEL")||e.planes,l=z(r,"PHOTOMETRICINTERPRETATION"),a=i*u,h=z(r,"BITSPERSAMPLE"),p=Zt(n),f=new p(a*s),m=Mt(r,"STRIPBYTECOUNTS"),g=z(r,"ROWSPERSTRIP"),C=z(r,"COMPRESSION")??1;let d,y,w,b,v,x,k,S,A,M=g;if(h%8==0)for(d=0;du?u-d*g:g,n==="u8"||n==="s8"||o)C===8||C===32946?(k=new Uint8Array(t,c[d],m[d]),k=de(k),x=k.buffer):C===6?(k=new Uint8Array(t,c[d],m[d]),k=pe(k,s,l),x=k.buffer):C===5?(k=ke(t,c[d],m[d],e.littleEndian),x=k.buffer):(m[d]!==M*i*s*h/8&&console.log("strip byte counts is different than expected"),x=t.slice(c[d],c[d]+m[d])),x=fe(x,h),b=new p(x);else{switch(C===6||C===8||C===32946?(k=new Uint8Array(t,c[d],m[d]),S=de(k),x=S.buffer):(m[d]!==M*i*s*h/8&&console.log("strip byte counts is different than expected"),x=new ArrayBuffer(m[d]),k=new Uint8Array(t,c[d],m[d]),S=new Uint8Array(x)),n){case"u16":case"s16":for(w=0;w{if(!(t&&t.length>0&&e&&r))return null;let o,c,i;const u=t[0].length,n=t.length,s=new Uint8Array(u);for(let l=0;li?0:1;else for(let a=0;ai?0:1);return s},uo=t=>{if(!t)return null;const e=t.match(//gi);if(!e||e.length===0)return null;const r=new Map;let o,c,i,u,n;for(let d=0;d")),u=o.indexOf("sample="),u>-1&&(n=o.slice(u+8,o.indexOf('"',u+8))),u=o.indexOf("name="),u>-1&&(c=o.slice(u+6,o.indexOf('"',u+6))),c&&(i=o.slice(o.indexOf(">")+1,o.indexOf("")).trim(),n!=null?r.has(c)?r.get(c)[n]=i:r.set(c,[i]):r.set(c,i)),n=null;const s=r.get("STATISTICS_MINIMUM"),l=r.get("STATISTICS_MAXIMUM"),a=r.get("STATISTICS_MEAN"),h=r.get("STATISTICS_STDDEV");let p=null;if(s&&l){p=[];for(let d=0;dC&&p>(c?t.byteLength:t?t.byteLength-s+o:0))return r.offlineOffsetSize=[s,p],r.values=null,!1;if(f<=C){if(!e)if(C<=32)s>>>=32-f;else{const y=d!=null&&d.length?d[0]:s>>>0,w=d!=null&&d.length?d[1]:Math.round((s-y)/Ut);f<=32?(s=y>>>32-f,d[0]=s):(s=y*2**(32-f)+(w>>>32-f),d[0]=y,d[1]=w>>>32-f)}if(n===1&&h===C)l=[s];else if(C===64){const y=d!=null&&d.length?d[0]:s>>>0,w=d!=null&&d.length?d[1]:Math.round((s-y)/Ut);let b=y,v=32;for(g=1;g<=n;g++){const x=32-h*g%32;if(v>>32-v,S=w<<32-v>>>32-v;b=w,l.push(k+S*2**(h-v)),v-=32-(h-v)}else l.push(b<>>32-h),v-=h;v===0&&(v=32,b=w)}}else for(g=1;g<=n;g++){const y=32-h*g;l.push(s<>>32-h)}}else{s-=o,c&&(s=0);for(let y=s;yparseFloat(G)),p.some(G=>isNaN(G))&&(p=null));const f=z(e,"COMPRESSION")??1;let m;switch(f){case 1:m="NONE";break;case 2:case 3:case 4:case 32771:m="CCITT";break;case 5:m="LZW";break;case 6:case 7:m="JPEG";break;case 32773:m="PACKBITS";break;case 8:case 32946:m="DEFLATE";break;case 34712:m="JPEG2000";break;case 34887:m="LERC";break;default:m=String(f)}let g=!0,C="";no.has(f)||(g=!1,C+="unsupported tag compression "+f),s>3&&(g=!1,C+="unsupported tag sampleFormat "+s),u!==1&&u!==2&&u!==4&&u%8!=0&&(g=!1,C+="unsupported tag bitsPerSample "+u);const d=je(e,"GEOASCIIPARAMS");let y;if(d){const G=d.split("|").find(j=>j.includes("ESRI PE String = ")),O=G?G.replace("ESRI PE String = ",""):"";y=O.startsWith("COMPD_CS")||O.startsWith("PROJCS")||O.startsWith("GEOGCS")?{wkid:null,wkt:O}:null}const w=Mt(e,"GEOTIEPOINTS"),b=Mt(e,"GEOPIXELSCALE"),v=Mt(e,"GEOTRANSMATRIX"),x=e.has("GEOKEYDIRECTORY")?e.get("GEOKEYDIRECTORY").data:null;let k,S,A=!1,M=!1;if(x){A=z(x,"GTRasterTypeGeoKey")===2;const G=z(x,"GTModelTypeGeoKey");if(G===2){const O=z(x,"GeographicTypeGeoKey");O>=1024&&O<=32766&&(y={wkid:O}),y||O!==32767||(M=!0,y={wkid:4326})}else if(G===1){const O=z(x,"ProjectedCSTypeGeoKey");O>=1024&&O<=32766&&(y={wkid:O})}}if(b&&w&&w.length>=6?(k=[b[0],0,w[3]-w[0]*b[0],0,-Math.abs(b[1]),w[4]-w[1]*b[1]],A&&(k[2]-=.5*k[0]+.5*k[1],k[5]-=.5*k[3]+.5*k[4])):v&&v.length===16&&(k=A?[v[0],v[1],v[3]-.5*v[0],v[4],v[5],v[7]-.5*v[5]]:[v[0],v[1],v[3],v[4],v[5],v[7]]),k){const G=[{x:0,y:i},{x:0,y:0},{x:c,y:i},{x:c,y:0}];let O,j=Number.POSITIVE_INFINITY,F=Number.POSITIVE_INFINITY,V=Number.NEGATIVE_INFINITY,_=Number.NEGATIVE_INFINITY;for(let X=0;Xj?j:O.x,V=O.xF?F:O.y,_=O.y<_?_:O.y;S={xmin:j,xmax:V,ymin:F,ymax:_,spatialReference:y}}else S={xmin:-.5,ymin:.5-i,xmax:c-.5,ymax:.5,spatialReference:y};M&&(S.xmax-S.xmin>400||Math.max(Math.abs(S.xmin),Math.abs(S.xmax))>361)&&(y=null,S.spatialReference=null);const T=dr(t);let I,P,L,E,U;if(T.length>0){L=Math.round(Math.log(c/z(T[0],"IMAGEWIDTH"))/Math.LN2);const G=T[T.length-1];E=Math.round(Math.log(c/z(G,"IMAGEWIDTH"))/Math.LN2),I=z(G,"TILEWIDTH"),P=z(G,"TILELENGTH")}I=E!=null&&E>0?I||r:null,P=E!=null&&E>0?P||o:null,r&&(U=[{maxCol:Math.ceil(c/r)-1,maxRow:Math.ceil(i/o)-1,minRow:0,minCol:0}],T.forEach(G=>{U.push({maxCol:Math.ceil(z(G,"IMAGEWIDTH")/z(G,"TILEWIDTH"))-1,maxRow:Math.ceil(z(G,"IMAGELENGTH")/z(G,"TILELENGTH"))-1,minRow:0,minCol:0})}));const R=je(t[0],"GDAL_METADATA"),N=uo(R);return C+=" "+gr({width:c,height:i,tileWidth:r,tileHeight:o,planes:n,ifds:t}),{width:c,height:i,tileWidth:r,tileHeight:o,planes:n,isBSQ:a,pixelType:l,compression:m,noData:p,hasMaskBand:mr(t).length===T.length+1,isSupported:g,message:C,extent:S,isPseudoGeographic:M,affine:b?null:k,firstPyramidLevel:L,maximumPyramidLevel:E,pyramidBlockWidth:I,pyramidBlockHeight:P,tileBoundary:U,metadata:N}}function Qt(t,e){const r=pr(t,"PLANARCONFIGURATION");return r?r[0]===2:!!e&&e.isBSQ}function dr(t){return t.filter(e=>z(e,"NEWSUBFILETYPE")===1)}function mr(t){return t.filter(e=>{const r=(4&(z(e,"NEWSUBFILETYPE")??0))==4,o=z(e,"PHOTOMETRICINTERPRETATION")===4;return r&&o})}function fo(t){const{littleEndian:e,isBigTiff:r,firstIFDPos:o}=mo(t);let c=o;const i=[];do{const u=go(t,e,c,0,Lt.TIFF_TAGS,r?8:4);if(!u.success)break;i.push(u.ifd),c=u.nextIFD}while(c>0);return{...Ie(i),littleEndian:e,isBigTiff:r,ifds:i,pyramidIFDs:dr(i),maskIFDs:mr(i)}}function Me(t,e,r){const o=t.getUint32(e,r),c=t.getUint32(e+4,r);return r?c*Ut+o:o*Ut+c}function po(t,e,r){let o=r?t.getInt32(e,r):t.getUint32(e,r),c=r?t.getUint32(e+4,r):t.getInt32(e+4,r);const i=(r?o:c)>=0?1:-1;return r?o*=i:c*=i,i*(r?c*Ut+o:o*Ut+c)}function Jt(t,e,r,o){return o?Me(t,e,r):t.getUint32(e,r)}function mo(t){const e=new DataView(t,0,16),r=e.getUint16(0,!1);let o=null;if(r===18761)o=!0;else{if(r!==19789)throw new Error("unexpected endianess byte");o=!1}const c=e.getUint16(2,o);if(c!==42&&c!==43)throw new Error("unexpected tiff identifier");let i=4;const u=c===43;if(u){const n=e.getUint16(i,o);if(i+=2,n!==8)throw new Error("unsupported bigtiff version");if(e.getUint16(i,o)!==0)throw new Error("unsupported bigtiff version");i+=2}return{littleEndian:o,isBigTiff:u,firstIFDPos:Jt(e,i,o,u)}}function go(t,e,r,o=0,c=Lt.TIFF_TAGS,i=4){const u=ne(t,e,r,o,c,i);let n;const s=u.ifd;if(s){if(Lt.ifdTags.forEach((l,a)=>{s.has(a)&&(n=s.get(a),n.data=ne(t,e,n.valueOffset-o,o,l).ifd)}),s.has("GEOKEYDIRECTORY")){n=s.get("GEOKEYDIRECTORY");const l=n.values;if(l&&l.length>4){const a=l[0]+"."+l[1]+"."+l[2];n.data=ne(t,e,n.valueOffset+6-o,o,Lt.GEO_KEYS,2).ifd,n.data&&n.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[a]})}}if(s.has("XMP")){n=s.get("XMP");const l=n.values;typeof l[0]=="number"&&n.type===7&&(n.values=[Qr(new Uint8Array(l))])}}return u}function gr(t){const{width:e,height:r,tileHeight:o,tileWidth:c}=t,i=t.planes,u=c?c*o:e*r,n=z(t.ifds[0],"BITSPERSAMPLE");let s="";return u*i>2**30/(n>8?n/8:1)&&(s=c?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),s}function yo(t,e,r,o,c){const i=o?4:1,u=r*i*c;o&&(t=new Uint8Array(t.buffer));for(let l=0;lA.min):null,k=v?v.map(A=>A.max):null,S={pixelType:l,width:p,height:f,pixels:d,noDataValue:b};return b!=null?xe(S,b):x&&k&&e.applyMinMaxConstraint&&(S.mask=co(d,x,k)),S}async function bo(t,e={}){const r=e.pyramidLevel||0,o=e.headerInfo||fo(t),{ifds:c,noData:i}=o;if(c.length===0)throw new Error("no valid image file directory");const u=gr(o);if(u)throw u;let n=null;const s=r===-1?c[c.length-1]:c[r],l=i??e.noDataValue;return n=o.tileWidth?await ao(t,o,s):await lo(t,o,s),n&&(l!=null&&xe(n,l),n)}var Co=function(t){var e,r,o,c,i,u;function n(s){var l,a,h,p,f,m,g,C,d,y,w,b,v;for(this.data=s,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},f=null;;){switch(l=this.readUInt32(),C=(function(){var x,k;for(k=[],x=0;x<4;++x)k.push(String.fromCharCode(this.data[this.pos++]));return k}).call(this).join(""),C){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(l);break;case"fcTL":f&&this.animation.frames.push(f),this.pos+=4,f={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},p=this.readUInt16(),h=this.readUInt16()||100,f.delay=1e3*p/h,f.disposeOp=this.data[this.pos++],f.blendOp=this.data[this.pos++],f.data=[];break;case"IDAT":case"fdAT":for(C==="fdAT"&&(this.pos+=4,l-=4),s=(f!=null?f.data:void 0)||this.imgData,w=0;0<=l?wl;0<=l?++w:--w)s.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(l),(d=255-this.transparency.indexed.length)>0)for(b=0;0<=d?bd;0<=d?++b:--b)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(l)[0];break;case 2:this.transparency.rgb=this.read(l)}break;case"tEXt":m=(y=this.read(l)).indexOf(0),g=String.fromCharCode.apply(String,y.slice(0,m)),this.text[g]=String.fromCharCode.apply(String,y.slice(m+1));break;case"IEND":return f&&this.animation.frames.push(f),this.colors=(function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}).call(this),this.hasAlphaChannel=(v=this.colorType)===4||v===6,a=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*a,this.colorSpace=(function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}).call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=l}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return n.load=function(s,l,a){var h;return typeof l=="function"&&(a=l),(h=new XMLHttpRequest).open("GET",s,!0),h.responseType="arraybuffer",h.onload=function(){var p;return p=new n(new Uint8Array(h.response||h.mozResponseArrayBuffer)),typeof(l!=null?l.getContext:void 0)=="function"&&p.render(l),typeof a=="function"?a(p):void 0},h.send(null)},r=1,o=2,e=0,n.prototype.read=function(s){var l,a;for(a=[],l=0;0<=s?ls;0<=s?++l:--l)a.push(this.data[this.pos++]);return a},n.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.decodePixels=function(s){var l,a,h,p,f,m,g,C,d,y,w,b,v,x,k,S,A,M,T,I,P,L,E;if(s==null&&(s=this.imgData),s.length===0)return new Uint8Array(0);for(s=(s=new _t(s)).getBytes(),S=(b=this.pixelBitlength/8)*this.width,v=new Uint8Array(S*this.height),m=s.length,k=0,x=0,a=0;x1&&a/pIo(r,o,t);break;case"tiff":e=ko;break;case"deflate":e=So;break;case"lzw":e=To;break;case"error":e=()=>{throw new yt("rasterCodec:decode","input data contains error")};break;default:e=()=>{throw new yt("rasterCodec:decode","unsupported raster format")}}return e}function Lo(t){let e=null,r=null;switch(t?t.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":r=255,e=Uint8Array;break;case"u16":r=r||65535,e=Uint16Array;break;case"u32":r=r||2**32-1,e=Uint32Array;break;case"s8":r=r||-128,e=Int8Array;break;case"s16":r=r||-32768,e=Int16Array;break;case"s32":r=r||0-2**31,e=Int32Array;break;default:e=Float32Array}return{pixelTypeCtor:e,noDataValue:r}}function Uo(t,e=1){if(!t)return;const{pixels:r,width:o,height:c,mask:i}=t;if(!r||r.length===0)return;const u=r.length,n=o-1,s=c-1,l=[];let a,h,p,f,m,g,C=null;const d=H.getPixelArrayConstructor(t.pixelType);if(e===0){for(a=0;a0}function Rn(t){var a;if(!(t!=null&&t.length)||t.some(h=>!Q(h)))return null;if(t.length===1)return((a=t[0])==null?void 0:a.clone())??null;const e=t,{width:r,height:o,pixelType:c}=e[0];if(e.some(h=>h.width!==r||h.height!==o))return null;const i=e.map(({mask:h})=>h).filter(h=>h!=null);let u=null;i.length&&(u=new Uint8Array(r*o),u.set(i[0]),i.length>1&&Cr(i.slice(1),u));const n=[];e.forEach(({pixels:h})=>n.push(...h));const s=e.map(({statistics:h})=>h).filter(h=>h==null?void 0:h.length),l=[];return s.forEach(h=>l.push(...h)),new H({pixelType:c,width:r,height:o,mask:u,pixels:n,statistics:l.length?l:null})}function Bt(t){if(!t)return;const e=t.colormap;if(!e||e.length===0)return;const r=e.sort((h,p)=>h[0]-p[0]);let o=0;r[0][0]<0&&(o=r[0][0]);const c=Math.max(256,r[r.length-1][0]-o+1),i=new Uint8Array(4*c),u=[];let n,s=0,l=0;const a=r[0].length===5;if(c>65536)return r.forEach(h=>{u[h[0]-o]=a?h.slice(1):h.slice(1).concat([255])}),{indexed2DColormap:u,offset:o,alphaSpecified:a};if(t.fillUnspecified)for(n=r[l],s=n[0]-o;sd?c[a]=0:(p[a]=u[C],f[a]=u[C+1],m[a]=u[C+2],c[a]=u[C+3]));else{for(c=new Uint8Array(i),a=0;ad?c[a]=0:(p[a]=u[C],f[a]=u[C+1],m[a]=u[C+2],c[a]=u[C+3]);r.mask=c}}else if(n)if(c!=null)for(a=0;ai));const n=[],s=e.outputPixelType||"u8";for(let a=0;a1;){if(l===a.value){g=!0;break}l>a.value?h=m:p=m,m=Math.floor((h+p)/2),a=e[Math.floor(m)]}g||(l===e[h].value?(a=e[h],g=!0):l===e[p].value?(a=e[p],g=!0):le[h].value&&(lb-m);g[0]=c[0],g[g.length-1]=c[c.length-1]+(l?1e-6:0);const C=c.length/2,[d,y]=Vt(u);for(let b=0;b=0;A--)if(k===g[2*A]||k>g[2*A]&&ky?y:k=n[S]&&k<=n[S+1]){h[x]=0,f[x]=0;break}}}return new H({width:r,height:o,pixelType:u,pixels:[h],mask:f})}function qe(t,e,r,o){const c=r!=null&&r.length>=2?new Set(r):null,i=(r==null?void 0:r.length)===1?r[0]:null,u=!!(e!=null&&e.length);for(let n=0;n=e[a]&&s<=e[a+1]){l=!0;break}l||(o[n]=0)}o[n]&&(s===i||c!=null&&c.has(s))&&(o[n]=0)}}function Ke(t,e){const r=t[0].length;for(let o=0;oC-1e-6);g[0]=r[0],u&&(g[g.length-1]=r[r.length-1]);for(let C=0;Cf?f:o[C]g?m=i.rightPadding:d>=g&&(f=i.leftMargin-i.rightPadding,m=0)}if(p.xmax-=m,typeof e!="number")for(let g=p.ymin;gQ(T));if(n==null)return null;const s=c?c.width:e.width,l=c?c.height:e.height,a=n.width,h=n.height,p=e.width/a,f=e.height/h,m={offset:o||{x:0,y:0},mosaic:c||e,block:{width:a,height:h}},g=n.pixelType,C=H.getPixelArrayConstructor(g),d=n.pixels.length,y=[];let w,b;for(let T=0;TT==null||T.mask!=null&&T.mask.length>0),x=t.some(T=>T!=null&&T.bandMasks&&T.bandMasks.length>1),k=v?new Uint8Array(s*l):void 0,S=x?[]:void 0;if(k){for(let T=0;Td!=null);if(o==null)return null;const c=t.some(d=>d==null||!!d.mask),{width:i,height:u}=e,n=c?new Uint8Array(i*u):null,{blockWidths:s}=r,l=[],a=o.getPlaneCount(),h=H.getPixelArrayConstructor(o.pixelType);if(c)for(let d=0,y=0;dd!=null&&d.bandMasks&&d.bandMasks.length>1),f=p?[]:void 0,m=i*u;for(let d=0;do||s>c||i===0&&u===0&&n===o&&s===c)return t;t.mask||(t.mask=new Uint8Array(o*c));const l=t.mask;for(let a=0;a=s||p=n?0:1}return t.updateStatistics(),t}function Bo(t){if(!Q(t))return null;const e=t.clone(),{width:r,height:o,pixels:c}=t,i=c[0],u=e.pixels[0],n=t.mask;for(let s=2;se&&(r=i.value,e=o),i=c.next();return r}function Ht(t,e,r){if(r===0)return;const o=t.get(e);o===1?t.delete(e):t.set(e,o-1)}function Nt(t,e,r){r!==0&&t.set(e,t.has(e)?t.get(e)+1:1)}function No(t,e,r){let{x:o,y:c}=e;const{width:i,height:u}=r;if(o===0&&c===0&&u===t.height&&i===t.width)return t;const{width:n,height:s}=t,l=Math.max(0,c),a=Math.max(0,o),h=Math.min(o+i,n),p=Math.min(c+u,s);if(h<0||p<0||!Q(t))return null;o=Math.max(0,-o),c=Math.max(0,-c);const{pixels:f}=t,m=i*u,g=f.length,C=[];for(let b=0;b{const U=I instanceof Float32Array||I instanceof Float64Array?0:.5;for(let R=0;RYe.fromJSON(r));for(let r=0;r.001&&(p/=Rt,f/=Rt),u==="adjusted")if(n){const I=a*Rt,P=h*Rt;p=(l+I**c*i)/(8*I),f=(l+P**c*i)/(8*P)}else p=(l+a**c*i)/(8*a),f=(l+h**c*i)/(8*h);let m=(90-e)*Math.PI/180,g=Math.cos(m),C=(360-r+90)*Math.PI/180,d=Math.sin(m)*Math.cos(C),y=Math.sin(m)*Math.sin(C);const w=[315,270,225,360,180,0],b=[60,60,60,60,60,90],v=new Float32Array([3,5,3,2,1,4]),x=v.reduce((I,P)=>I+P),k=v.map(I=>I/x),S=o==="multi-directional"?w.length:1,A=new Float32Array(6),M=new Float32Array(6),T=new Float32Array(6);if(o==="multi-directional")for(let I=0;Im?m:C],w=u[g],b=w*y,v=b*(1-Math.abs(d%2-1)),x=w-b;switch(Math.floor(d)){case 0:h[g]=b+x,p[g]=v+x,f[g]=x;break;case 1:h[g]=v+x,p[g]=b+x,f[g]=x;break;case 2:h[g]=x,p[g]=b+x,f[g]=v+x;break;case 3:h[g]=x,p[g]=v+x,f[g]=b+x;break;case 4:h[g]=v+x,p[g]=x,f[g]=b+x;break;case 5:case 6:h[g]=b+x,p[g]=x,f[g]=v+x}}t.pixels=[h,p,f],t.updateStatistics()}function Vn(t,e){if(!Q(t))return t;const r=e.zFactor,o=e.pixelSizePower??1,c=e.pixelSizeFactor??1,i=e.slopeType,u=e.isGCS,{x:n,y:s}=e.resolution;let l=r/(8*n),a=r/(8*s);u&&Math.abs(r-1)<1e-4&&(l/=Rt,a/=Rt),i==="adjusted"&&(l=(r+n**o*c)/(8*n),a=(r+s**o*c)/(8*s));const{dzxs:h,dzys:p,outMask:f}=te(t),{width:m,height:g}=t,C=new Float32Array(m*g);for(let y=st;y360&&(d%=360)),a[p+f]=d}}}return ee(a,s,l),new H({width:s,height:l,pixels:[a],mask:n,pixelType:"f32",validPixelCount:t.validPixelCount,statistics:[{minValue:-1,maxValue:360}]})}function jn(t,e){if(!Q(t))return t;const{curvatures:r,outMask:o}=te(t,e),{width:c,height:i}=t;ee(r,c,i);const u=new H({width:c,height:i,pixels:[r],mask:o,pixelType:"f32",validPixelCount:t.validPixelCount});return u.updateStatistics(),u}const zn=["random","ndvi","ndvi2","ndvi3","elevation","gray","hillshade"],kr=[{id:"aspect",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"black-to-white",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blue-bright",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blue-light-to-dark",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blue-green-bright",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blue-green-light-to-dark",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brown-light-to-dark",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brown-to-blue-green-diverging-right",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brown-to-blue-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficient-bias",fromColor:[214,214,255],toColor:[0,57,148]},{id:"cold-to-hot-diverging",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"condition-number",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyan-to-purple",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyan-light-to-blue-dark",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors",fromColor:[255,235,214],toColor:[196,10,10]},{id:"gray-light-to-dark",fromColor:[219,219,219],toColor:[69,69,69]},{id:"green-bright",fromColor:[204,255,204],toColor:[14,204,14]},{id:"green-light-to-dark",fromColor:[220,245,233],toColor:[34,102,51]},{id:"green-to-blue",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orange-bright",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orange-light-to-dark",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partial-spectrum",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partial-spectrum-1-diverging",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partial-spectrum-2-diverging",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pink-to-yellow-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pink-to-yellow-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purple-bright",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purple-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purple-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purple-blue-bright",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purple-blue-light-to-dark",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purple-red-bright",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purple-red-light-to-dark",fromColor:[250,215,246],toColor:[143,17,57]},{id:"red-bright",fromColor:[255,204,204],toColor:[219,0,0]},{id:"red-light-to-dark",fromColor:[255,224,224],toColor:[143,10,10]},{id:"red-to-blue-diverging-bright",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"red-to-blue-diverging-dark",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"red-to-green",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"red-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"red-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrum-full-bright",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrum-full-dark",type:"multipart",colorRamps:[{fromColor:[153,0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrum-full-light",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"white-to-black",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellow-to-dark-red",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellow-to-green-to-dark-blue",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellow-to-red",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellow-green-bright",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellow-green-light-to-dark",fromColor:[215,240,175],toColor:[96,107,45]}],Wo=new ve({Aspect:"aspect","Black to White":"black-to-white","Blue Bright":"blue-bright","Blue Light to Dark":"blue-light-to-dark","Blue-Green Bright":"blue-green-bright","Blue-Green Light to Dark":"blue-green-light-to-dark","Brown Light to Dark":"brown-light-to-dark","Brown to Blue Green Diverging, Bright":"brown-to-blue-green-diverging-right","Brown to Blue Green Diverging, Dark":"brown-to-blue-green-diverging-dark","Coefficient Bias":"coefficient-bias","Cold to Hot Diverging":"cold-to-hot-diverging","Condition Number":"condition-number","Cyan to Purple":"cyan-to-purple","Cyan-Light to Blue-Dark":"cyan-light-to-blue-dark",Distance:"distance","Elevation #1":"elevation1","Elevation #2":"elevation2",Errors:"errors","Gray Light to Dark":"gray-light-to-dark","Green Bright":"green-bright","Green Light to Dark":"green-light-to-dark","Green to Blue":"green-to-blue","Orange Bright":"orange-bright","Orange Light to Dark":"orange-light-to-dark","Partial Spectrum":"partial-spectrum","Partial Spectrum 1 Diverging":"partial-spectrum-1-diverging","Partial Spectrum 2 Diverging":"partial-spectrum-2-diverging","Pink to YellowGreen Diverging, Bright":"pink-to-yellow-green-diverging-bright","Pink to YellowGreen Diverging, Dark":"pink-to-yellow-green-diverging-dark",Precipitation:"precipitation",Prediction:"prediction","Purple Bright":"purple-bright","Purple to Green Diverging, Bright":"purple-to-green-diverging-bright","Purple to Green Diverging, Dark":"purple-to-green-diverging-dark","Purple-Blue Bright":"purple-blue-bright","Purple-Blue Light to Dark":"purple-blue-light-to-dark","Purple-Red Bright":"purple-red-bright","Purple-Red Light to Dark":"purple-red-light-to-dark","Red Bright":"red-bright","Red Light to Dark":"red-light-to-dark","Red to Blue Diverging, Bright":"red-to-blue-diverging-bright","Red to Blue Diverging, Dark":"red-to-blue-diverging-dark","Red to Green":"red-to-green","Red to Green Diverging, Bright":"red-to-green-diverging-bright","Red to Green Diverging, Dark":"red-to-green-diverging-dark",Slope:"slope","Spectrum-Full Bright":"spectrum-full-bright","Spectrum-Full Dark":"spectrum-full-dark","Spectrum-Full Light":"spectrum-full-light",Surface:"surface",Temperature:"temperature","White to Black":"white-to-black","Yellow to Dark Red":"yellow-to-dark-red","Yellow to Green to Dark Blue":"yellow-to-green-to-dark-blue","Yellow to Red":"yellow-to-red","Yellow-Green Bright":"yellow-green-bright","Yellow-Green Light to Dark":"yellow-green-light-to-dark"});function qt(t,e){if(!t||!e||t.length!==e.length)return!1;for(let r=0;re[r]+2||t[r]Xe(o))),r}return Xe(t)}function Ze(t,e){if(!t)return;const r=e??kr;let o=null;return t.type==="algorithmic"?r.some(c=>{if(qt(t.fromColor.toRgb(),c.fromColor)&&qt(t.toColor.toRgb(),c.toColor))return o=c.id,!0}):t.type==="multipart"&&r.some(c=>{const i=t.colorRamps,u=c.colorRamps;if(i&&u&&i.length===u.length&&!u.some((n,s)=>{if(!qt(i[s].fromColor.toRgb(),new Ee(n.fromColor).toRgb())||!qt(i[s].toColor.toRgb(),new Ee(n.toColor).toRgb()))return!0})){if(o)return!0;o=c.id}}),o}function qo(t,e,r=!1){if(!t)return;let o=Ze(t,e);return o!=null||r||(o=Ze(t=Ho(t),e)),o}function Ko(t,e=!1){const r=typeof t=="string"?t:qo(t,void 0,e);return r?Wo.toJSON(r):null}function Wn(t,e="esriCIELabAlgorithm"){const r=kr.find(({id:o})=>o===t);return r?r.colorRamps?{type:"multipart",colorRamps:r.colorRamps.map(o=>({type:"algorithmic",algorithm:e,fromColor:[...o.fromColor],toColor:[...o.toColor]}))}:{type:"algorithmic",algorithm:e,fromColor:[...r.fromColor],toColor:[...r.toColor]}:null}function Ar(t){const e=(t=t||{}).numColors||256,r=t.distanceOffset||0,o=t.isCustomInterval!=null?t.isCustomInterval:t.distanceInterval!==null&&t.distanceInterval!==1/(e-1),c=t.distanceInterval||1/(e-1);return{...t,numColors:e,distanceOffset:r,interpolateAlpha:!!t.interpolateAlpha,distanceInterval:c,isCustomInterval:o,weights:t.weights}}function Jo(t,e,r){const{numColors:o,distanceOffset:c,distanceInterval:i,isCustomInterval:u}=r,n=t.s===0,s=e.s===0;let l=t.h,a=e.h;n&&!s?l=a:s&&!n&&(e={...e,h:l},a=l);let h,p=Math.abs(a-l);const f=360;pa?p*i:-p*i);const m=(e.s-t.s)*i,g=(e.v-t.v)*i;let{s:C,v:d}=t,y=l;if(c){const b=c/i;y=(y+b*h+f)%f,C+=b*m,d+=b*g}const w=[];for(let b=0;bf+m);c=c.map(f=>f/p)}else{c=[];for(let p=0;p{c.unshift(i),o||c.pop()}),r}function tr(t){const e=Yt(t);return{type:"HsvColor",Hue:e.h,Saturation:e.s,Value:e.v,AlphaValue:255}}function er(t){const e=t.toJSON();return{Algorithm:(e==null?void 0:e.Algorithm)||"esriHSVAlgorithm",type:"AlgorithmicColorRamp",FromColor:tr(t.fromColor),ToColor:tr(t.toColor)}}function Hn(t){const e=Ko(t);if(!e)return null;if(t.type==="algorithmic")return{...er(t),Name:e};if(t.colorRamps){const r=t.colorRamps.map(er);return{type:"MultiPartColorRamp",NumColorRamps:r.length,ArrayOfColorRamp:r,Name:e}}return null}function qn(t){const e=t.reverse().map(r=>{const o=r.toString(16);return o.length<2?"0"+o:o});return 4294967295&Number.parseInt(e.join(""),16)}const Kn=new ve({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),tn={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"},ae=1,en=[.299,.587,.114];function Tr(t,e=256){e=Math.min(e,256);const{size:r,counts:o}=t,c=new Uint8Array(r),i=o.reduce((a,h)=>a+h/e,0);let u=0,n=0,s=0,l=i;for(let a=0;a=s){const v=Ir(s,o);for(l=0;l1&&(w-=(1/g)**(C*v[l])),ye[l]){const x=w*g*C**(1/o[l])+u;b[a]=i==="floor"?Math.floor(x):i==="round"?Math.round(x):x}else y>=r[l]?b[a]=n:b[a]=u;else b[a]=u;d[l]=b}}else for(l=0;l=r[l])b[a]=n;else{const v=(y-e[l])*f[l]+u;b[a]=i==="floor"?Math.floor(v):i==="round"?Math.round(v):v}d[l]=b}if(t.contrastOffset!=null){const v=rn(t.contrastOffset,t.brightnessOffset);for(l=0;l0&&r<100?n=(200*u-100*c+2*c*o)/(2*(100-r))+i:r<=0&&r>-100?n=(200*u-100*c+2*c*o)*(100+r)/2e4+i:r===100?(n=200*u-100*c+(c+1)*(100-r)+2*c*o,n=n>0?c:0):r===-100&&(n=i),s[u]=n>c?c:n<0?0:n;return s}function on(t,e,r){const o=[];for(let c=0;c=255)return ae;let e=0;t!==150&&(e=t<=150?45*Math.cos(.01047*t):17*Math.sin(.021*t));const r=255,o=t+e,c=Math.log(t/r),i=Math.log(o/r);if(i===0)return ae;const u=c/i;return isNaN(u)?ae:Math.min(9.9,Math.max(.01,u))}function sn(t,e,r,o){let c=1/0,i=-1/0,u=0,n=0;const s=t.length;for(let d=0;di?y:i,u+=y,n++)}if(n===0)return{statistics:{min:0,max:0,avg:0,stddev:0},histogram:null};const l=u/n;let a=0;for(let d=0;dd).length:s,p={min:c,max:i,avg:l,stddev:h<=1?0:Math.sqrt(a/(h-1))};if(!o)return{statistics:p,histogram:null};if(["u8","s8","u4","u2","u1"].includes(r)){const d=i-c+1,y=new Uint32Array(d);for(let w=0;wsn(u,(c==null?void 0:c[n])??r,o,!0));return{statistics:i.map(({statistics:u})=>u),histograms:i.map(({histogram:u})=>u)}}function an(t){var A;if(t==null||!((A=t.pixels)!=null&&A.length))return null;const{pixels:e,mask:r,bandMasks:o,pixelType:c}=t,i=t.width*t.height,u=e.length;let n,s,l,a,h;const p=[],f=[];let m,g,C,d,y,w,b,v,x,k;const S=256;for(a=0;a[T.minValue,T.maxValue,0,0]);else{const T=an(r);u=T!=null?T.statistics:null,n=T!=null?T.histograms:null}else u=((M=t.statistics)==null?void 0:M.length)>0?t.statistics:i.statistics,n="histograms"in t?t.histograms:void 0,n||(n=i.histograms);s!=="percentClip"&&s!=="histogramEqualization"||n!=null&&n.length||(s="minMax");const l=(u==null?void 0:u.length)||(n==null?void 0:n.length)||i.bandCount,a=[],h=[];let p,f,m,g,C,d,y,w,b;u&&!Array.isArray(u[0])&&(u=u.map(T=>[T.min,T.max,T.avg,T.stddev]));const[v,x]=Vt(i.pixelType);if(!(u!=null&&u.length)){for(u=[],w=0;wT[1]&&(h[w]=T[1])}break;case"histogramEqualization":for(Kt(n),w=0;w=20&&(g[0]=g[1]=g[2]=g[g.length-1]=g[g.length-2]=0),m=0,f=(p.max-p.min)/p.size,y=p.min===-.5&&f===1?.5:0,b=0;bd){a[w]=p.min+f*(b+y);break}for(d=(1-(t.maxPercent||0)/100)*m,h[w]=p.max+y,b=p.size-2;b>=0;b--)if(C[b]Tr(T)))):(S=t.max||255,k=t.min||0),ln({minCutOff:a,maxCutOff:h,outMax:S,outMin:k,histogramLut:A},o)}function ln(t,e){if(e==null||e.length===0)return t;const r=Math.max.apply(null,e),{minCutOff:o,maxCutOff:c,outMin:i,outMax:u,histogramLut:n}=t;return o.length===e.length||o.length<=r?t:{minCutOff:e.map(s=>o[s]),maxCutOff:e.map(s=>c[s]),histogramLut:n?e.map(s=>n[s]):null,outMin:i,outMax:u}}function Ir(t,e){const r=new Float32Array(t);for(let o=0;o1?e[o]>2?r[o]=6.5+(e[o]-2)**2.5:r[o]=6.5+100*(2-e[o])**4:r[o]=1;return r}function le(t,e){var k;if(t==null||!((k=t.pixels)!=null&&k.length))return t;const{mask:r,bandMasks:o,width:c,height:i,pixels:u}=t,{minCutOff:n,maxCutOff:s,gamma:l}=e,a=e.outMin||0,h=e.outMax||255,p=c*i,f=e.outputPixelType||"u8",m=t.pixels.map(()=>H.createEmptyBand(f,p)),g=m.length,C=h-a,d=[],y=[];for(let S=0;S=g,v=!!e.isRenderer;if(b){const S=Ir(g,l);for(let A=0;A1&&(L-=(1/C)**(P*S[A])),In[A]){const E=L*C*P**(1/l[A])+a;m[A][T]=v?Math.floor(E):w?Math.round(E):E}else I>=s[A]?m[A][T]=h:m[A][T]=a}}}else for(let S=0;Sn[S]){const I=(T-n[S])*d[S]+a;m[S][M]=v?Math.floor(I):w?Math.round(I):I}else T>=s[S]?m[S][M]=h:m[S][M]=a}}const x=new H({width:c,height:i,mask:r,bandMasks:o,pixels:m,pixelType:f});return x.updateStatistics(),x}const It=new Map;It.set("meter-per-second",1),It.set("kilometer-per-hour",.277778),It.set("knots",.514444),It.set("feet-per-second",.3048),It.set("mile-per-hour",.44704);const Ce=180/Math.PI,Xn=new ve({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"});function Zn(t,e){return It.get(t)/It.get(e)||1}function Mr(t){return(450-t)%360}function cn(t,e="geographic"){const[r,o]=t,c=Math.sqrt(r*r+o*o);let i=Math.atan2(o,r)*Ce;return i=(360+i)%360,e==="geographic"&&(i=Mr(i)),[c,i]}function un(t,e="geographic"){let r=t[1];e==="geographic"&&(r=Mr(r)),r%=360;const o=t[0];return[o*Math.cos(r/Ce),o*Math.sin(r/Ce)]}function Qn(t,e,r,o="geographic"){if(!Q(t)||r==null)return t;const c=e==="vector-magdir"?t.clone():or(t,e),i=c.pixels[1];for(let u=0;u1||e&&r.fields.find(c=>c.name.toLowerCase()===e.toLowerCase())==null)}function pn(t){const{bandCount:e,dataType:r,pixelType:o}=t;return r==="elevation"||r==="generic"&&e===1&&(o==="s16"||o==="s32"||o==="f32"||o==="f64")}function dn(t,e=!1){const{bandCount:r,colormap:o,pixelType:c}=t;return r===1&&(!!(o!=null&&o.length)||!e&&c==="u8")}function ei(t,e=!1){const{attributeTable:r,bandCount:o}=t;return o===1&&(!e||r!=null||t.histograms!=null)}function ri(t){const{dataType:e}=t;return e==="vector-uv"||e==="vector-magdir"}function oi(t){const{dataType:e}=t;return e==="vector-uv"||e==="vector-magdir"}let Tt=class extends Dt{constructor(t){super(t)}bind(){const{rendererJSON:t}=this;if(!t)return{success:!1};let e;switch(this.lookup={rendererJSON:{}},t.type){case"uniqueValue":e=this._updateUVRenderer(t);break;case"rasterColormap":e=this._updateColormapRenderer(t);break;case"rasterStretch":e=this._updateStretchRenderer(t);break;case"classBreaks":e=this._updateClassBreaksRenderer(t);break;case"rasterShadedRelief":e=this._updateShadedReliefRenderer(t);break;case"vectorField":e=this._updateVectorFieldRenderer();break;case"flowRenderer":e=this._updateFlowRenderer()}return e}symbolize(t){let e=t&&t.pixelBlock;if(!nr(e))return e;if(t.simpleStretchParams&&this.rendererJSON.type==="rasterStretch")return this.simpleStretch(e,t.simpleStretchParams);try{let r;switch(e.pixels.length>3&&(e=e.extractBands([0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(e);break;case"classBreaks":r=this._symbolizeClassBreaks(e);break;case"rasterStretch":r=this._symbolizeStretch(e,t.bandIds);break;case"rasterShadedRelief":{const o=t.extent,c=o.spatialReference.isGeographic,i={x:(o.xmax-o.xmin)/e.width,y:(o.ymax-o.ymin)/e.height};r=this._symbolizeShadedRelief(e,{isGCS:c,resolution:i});break}}return r}catch(r){return gt.getLogger(this).error("symbolize",r.message),e}}simpleStretch(t,e){if(!nr(t))return t;try{return t.pixels.length>3&&(t=t.extractBands([0,1,2])),le(t,{...e,isRenderer:!0})}catch(r){return gt.getLogger(this).error("symbolize",r.message),t}}generateWebGLParameters(t){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:u,offset:n}=this.lookup.colormapLut||{};return{colormap:u,colormapOffset:n,type:"lut"}}const{pixelBlock:e,isGCS:r,resolution:o,bandIds:c}=t,{rendererJSON:i}=this;return i.type==="rasterStretch"?this._generateStretchWebGLParams(e,i,c):i.type==="rasterShadedRelief"?this._generateShadedReliefWebGLParams(i,r,o??void 0):i.type==="vectorField"?this._generateVectorFieldWebGLParams(i):null}_isLUTChanged(t){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const e=this.rendererJSON.colorRamp;return t?JSON.stringify(e)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(t){return this._isLUTChanged()&&!this.bind().success?t:ie(t,this.lookup.colormapLut)}_symbolizeClassBreaks(t){const{canUseIndexedLUT:e}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?t:e?ie(t,this.lookup.colormapLut):Oo(t,this.lookup.remapLut??[])}_symbolizeStretch(t,e){var h,p;const{rasterInfo:r}=this,{pixelType:o,bandCount:c}=r,i=this.rendererJSON,u=["u8","u16","s8","s16"].includes(o);let n,s;const{dra:l}=i,{gamma:a}=this.lookup;if(i.stretchType==="histogramEqualization"){const f=l?null:(h=this.lookup)==null?void 0:h.histogramLut,m=Ft(i,{rasterInfo:r,pixelBlock:t,bandIds:e,returnHistogramLut:!f}),g=le(t,{...m,gamma:a,isRenderer:!0});s=He(g,{lut:l?m.histogramLut:f,offset:0})}else if(u){if(l){const f=Ft(i,{rasterInfo:r,pixelBlock:t,bandIds:e});n=rr({pixelType:o,...f,gamma:a,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return t;n=this.lookup?this.lookup.stretchLut:null}else n=this.lookup?this.lookup.stretchLut:null;if(!n)return t;c>1&&e!=null&&e.length===(t==null?void 0:t.pixels.length)&&(n==null?void 0:n.lut.length)===c&&(n={lut:e.map(f=>n.lut[f]),offset:n.offset}),s=He(t,n)}else{const f=Ft(i,{rasterInfo:r,pixelBlock:t,bandIds:e});s=le(t,{...f,gamma:a,isRenderer:!0})}if(i.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return t;s=ie(s,(p=this.lookup)==null?void 0:p.colormapLut)}return s}_symbolizeShadedRelief(t,e){var n;const r=this.rendererJSON,o={...r,...e},c=jo(t,o);if(!r.colorRamp)return c;let i;if(this._isLUTChanged(!0)){if(!this.bind().success)return c;i=this.lookup?this.lookup.hsvMap:null}else i=this.lookup?this.lookup.hsvMap:null;if(!i)return c;const u=((n=this.rasterInfo.statistics)==null?void 0:n[0])??{min:0,max:8e3};return zo(c,t,i,u),c}_isVectorFieldData(){const{bandCount:t,dataType:e}=this.rasterInfo;return t===2&&(e==="vector-magdir"||e==="vector-uv")}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(t){var l;const{bandCount:e,attributeTable:r,pixelType:o}=this.rasterInfo,c=t.field1;if(!c)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const i=t.defaultSymbol,u=e===1&&["u8","s8"].includes(o);if(!fn(this.rasterInfo,c)&&!u)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const n=[];if(r!=null){const a=r.fields.find(h=>h.name.toLowerCase()==="value");if(!a)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(h=>{var m,g;const p=(m=t.uniqueValueInfos)==null?void 0:m.find(C=>String(C.value)===String(h.attributes[c])),f=(g=p==null?void 0:p.symbol)==null?void 0:g.color;f?n.push([h.attributes[a.name]].concat(f)):i&&n.push([h.attributes[a.name]].concat(i.color))})}else{if(c.toLowerCase()!=="value")return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.'};(l=t.uniqueValueInfos)==null||l.forEach(a=>{var p;const h=(p=a==null?void 0:a.symbol)==null?void 0:p.color;h?n.push([parseInt(""+a.value,10)].concat(h)):i&&n.push([parseInt(""+a.value,10)].concat(i==null?void 0:i.color))})}if(n.length===0)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const s=Bt({colormap:n});return this.lookup={rendererJSON:t,colormapLut:s},this.canRenderInWebGL=!0,{success:!0}}_updateColormapRenderer(t){if(!dn(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const e=t.colormapInfos.map(o=>[o.value].concat(o.color)).sort((o,c)=>o[0]-c[0]);if(!e||e.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=Bt({colormap:e});return this.lookup={rendererJSON:t,colormapLut:r},this.canRenderInWebGL=!0,{success:!0}}_updateShadedReliefRenderer(t){if(!pn(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(t.colorRamp){const e=Qe(t.colorRamp,{interpolateAlpha:!0}),r=Bt({colormap:e}),o=[],c=r.indexedColormap;for(let i=0;iu.name.toLowerCase()==="value"):null,c=e!=null?e.fields.find(u=>u.name.toLowerCase()===t.field.toLowerCase()):null,i=o!=null&&c!==null;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||i,tableValueField:o,tableBreakField:c}}_updateClassBreaksRenderer(t){const{attributeTable:e}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:o,tableBreakField:c}=this._analyzeClassBreaks(t),i=t.classBreakInfos;if(!(i!=null&&i.length))return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const u=i.sort((h,p)=>h.classMaxValue-p.classMaxValue),n=u[u.length-1];let s=t.minValue;if(!r){const h=[];for(let p=0;pw>d);y&&l.push([C].concat(y.symbol.color))}}else{s=Math.floor(t.minValue);for(let h=0;h0&&t[0].min!=null&&t[0].max!=null}_updateStretchRenderer(t){var a,h;let{stretchType:e,dra:r}=t;if(!(e==="none"||(a=t.statistics)!=null&&a.length||this._isValidRasterStatistics(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};const o=t.histograms||this.rasterInfo.histograms;!this._isHistogramRequired(t.stretchType)||o!=null&&o.length||r||(e="minMax");const{computeGamma:c,useGamma:i,colorRamp:u}=t;let{gamma:n}=t;if(i&&c&&!(n!=null&&n.length)){const p=(h=t.statistics)!=null&&h.length?t.statistics:this.rasterInfo.statistics;n=on(this.rasterInfo.pixelType,p)}const s=this.rasterInfo.pixelType,l=!r&&["u8","u16","s8","s16"].includes(s);if(e==="histogramEqualization"){const p=o.map(f=>Tr(f));this.lookup={rendererJSON:t,histogramLut:p}}else if(l){const p=Ft(t,{rasterInfo:this.rasterInfo}),f=rr({pixelType:s,...p,gamma:i?n:null,rounding:"floor"});this.lookup={rendererJSON:t,stretchLut:f}}if(u){const p=Qe(u,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:t}),this.lookup.colormapLut=Bt({colormap:p}),this.lookup.rendererJSON=t}return this.lookup.gamma=i&&(n!=null&&n.length)?n:null,this.canRenderInWebGL=!0,{success:!0}}_generateStretchWebGLParams(t,e,r){let o=null,c=null;const i=this.lookup&&this.lookup.colormapLut;e.colorRamp&&i&&(o=i.indexedColormap,c=i.offset),e.stretchType==="histogramEqualization"&&(e={...e,stretchType:"minMax"});const{gamma:u}=this.lookup,n=!!(e.useGamma&&u&&u.some(w=>w!==1)),{minCutOff:s,maxCutOff:l,outMin:a,outMax:h}=Ft(e,{rasterInfo:this.rasterInfo,pixelBlock:t,bandIds:r});let p=0;t!=null&&(p=t.getPlaneCount(),p===2&&((t=t.clone()).statistics=[t.statistics[0]],t.pixels=[t.pixels[0]]));const{bandCount:f}=this.rasterInfo,m=Math.min(3,(r==null?void 0:r.length)||p||f,f),g=new Float32Array(m),C=o||n?1:255;let d;for(d=0;d1?u[d]>2?y[d]=6.5+(u[d]-2)**2.5:y[d]=6.5+100*(2-u[d])**4:y[d]=1;return{bandCount:m,outMin:a/C,outMax:h/C,minCutOff:s,maxCutOff:l,factor:g,useGamma:n,gamma:n?u:[1,1,1],gammaCorrection:n?y:[1,1,1],colormap:o,colormapOffset:c,stretchType:e.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(t,e=!1,r={x:0,y:0}){var l;let o=null,c=null;const i=this.lookup&&this.lookup.colormapLut;t.colorRamp&&i&&(o=i.indexedColormap,c=i.offset);const u={...t,isGCS:e,resolution:r},n=xr(u),s=(l=this.rasterInfo.statistics)==null?void 0:l[0];return{...n,minValue:(s==null?void 0:s.min)??0,maxValue:(s==null?void 0:s.max)??8e3,hillshadeType:t.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:o,colormapOffset:c}}_generateVectorFieldWebGLParams(t){var d,y,w;const{style:e,inputUnit:r,outputUnit:o,visualVariables:c,symbolTileSize:i,flowRepresentation:u}=t;let n;const s=((d=this.rasterInfo.statistics)==null?void 0:d[0].min)??0,l=((y=this.rasterInfo.statistics)==null?void 0:y[0].max)??50,a=(c==null?void 0:c.find(b=>b.type==="sizeInfo"))??{type:"sizeInfo",field:"Magnitude",maxDataValue:l,maxSize:.8*i,minDataValue:s,minSize:.2*i},h=a.minDataValue??s,p=a.maxDataValue??l,f=a.maxSize!=null&&a.minSize!=null?[a.minSize/i,a.maxSize/i]:[.2,.8];if(e==="wind_speed"){const b=(f[0]+f[1])/2;f[0]=f[1]=b}const m=h!=null&&p!=null?[h,p]:null;if(e==="classified_arrow")if(h!=null&&p!=null&&a!=null){n=[];const b=(a.maxDataValue-a.minDataValue)/5;for(let v=0;v<6;v++)n.push(a.minDataValue+b*v)}else n=[0,1e-6,3.5,7,10.5,14];const g=u==="flow_to"==(e==="ocean_current_kn"||e==="ocean_current_m")?0:Math.PI,C=c==null?void 0:c.find(b=>b.type==="rotationInfo");return{breakValues:n,dataRange:m,inputUnit:r,outputUnit:o,symbolTileSize:i,symbolPercentRange:f,style:e||"single_arrow",rotation:g,rotationType:(w=this.rasterInfo.storageInfo)!=null&&w.tileInfo&&this.rasterInfo.dataType==="vector-uv"?"geographic":(C==null?void 0:C.rotationType)||t.rotationType,type:"vectorField"}}};function nr(t){return Q(t)&&t.validPixelCount!==0}D([B({json:{write:!0}})],Tt.prototype,"rendererJSON",void 0),D([B({type:_o,json:{write:!0}})],Tt.prototype,"rasterInfo",void 0),D([B({json:{write:!0}})],Tt.prototype,"lookup",void 0),D([B()],Tt.prototype,"canRenderInWebGL",void 0),Tt=D([Ot("esri.renderers.support.RasterSymbolizer")],Tt);const ni=Tt,Pt=gt.getLogger("esri.views.2d.engine.flow.dataUtils"),mn=10;async function ii(t,e,r,o){const c=performance.now(),i=gn(e,r),u=performance.now(),n=wn(e,i,r.width,r.height),s=performance.now(),l=Cn(n,!0),a=performance.now(),h=t==="Streamlines"?vn(l,mn):xn(l),p=performance.now();return $r("esri-2d-profiler")&&(Pt.info("I.1","_createFlowFieldFromData (ms)",Math.round(u-c)),Pt.info("I.2","_getStreamlines (ms)",Math.round(s-u)),Pt.info("I.3","createAnimatedLinesData (ms)",Math.round(a-s)),Pt.info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(p-a)),Pt.info("I.5","createFlowMesh (ms)",Math.round(p-c)),Pt.info("I.6","Mesh size (bytes)",h.vertexData.buffer.byteLength+h.indexData.buffer.byteLength)),await Promise.resolve(),Fr(o),h}function gn(t,e){const r=bn(e.data,e.width,e.height,t.smoothing);return t.interpolate?(o,c)=>{const i=Math.floor(o),u=Math.floor(c);if(i<0||i>=e.width)return[0,0];if(u<0||u>=e.height)return[0,0];const n=o-i,s=c-u,l=i,a=u,h=i{const i=Math.round(o),u=Math.round(c);return i<0||i>=e.width||u<0||u>=e.height?[0,0]:[r[2*(u*e.width+i)],r[2*(u*e.width+i)+1]]}}function yn(t,e,r,o,c,i,u,n,s){const l=[];let a=r,h=o,p=0,[f,m]=e(a,h);f*=t.velocityScale,m*=t.velocityScale;const g=Math.sqrt(f*f+m*m);let C,d;l.push({x:a,y:h,t:p,speed:g});for(let y=0;yt.maxTurnAngle)return l;if(t.collisions){const S=Math.round(a*s),A=Math.round(h*s);if(S<0||S>u-1||A<0||A>n-1)return l;const M=i[A*u+S];if(M!==-1&&M!==c)return l;i[A*u+S]=c}l.push({x:a,y:h,t:p,speed:v}),C=x,d=k}return l}function wn(t,e,r,o){const c=[],i=new sr,u=1/Math.max(t.lineCollisionWidth,1),n=Math.round(r*u),s=Math.round(o*u),l=new Int32Array(n*s);for(let h=0;hh.sort-p.sort);for(const{x:h,y:p}of a)if(i.getFloat()=e)continue;const m=i[f+c];h+=m*t[2*(l*e+(a+f))],p+=m*t[2*(l*e+(a+f))+1]}n[2*(l*e+a)]=h,n[2*(l*e+a)+1]=p}const s=new Float32Array(t.length);for(let l=0;l=r)continue;const m=i[f+c];h+=m*n[2*((a+f)*e+l)],p+=m*n[2*((a+f)*e+l)+1]}s[2*(a*e+l)]=h,s[2*(a*e+l)+1]=p}return s}function Cn(t,e){const r=new sr,o=t.reduce((s,l)=>s+l.length,0),c=new Float32Array(4*o),i=new Array(t.length);let u=0,n=0;for(const s of t){const l=u;for(const a of s)c[4*u]=a.x,c[4*u+1]=a.y,c[4*u+2]=a.t,c[4*u+3]=a.speed,u++;i[n++]={startVertex:l,numberOfVertices:s.length,totalTime:s[s.length-1].t,timeSeed:e?r.getFloat():0}}return{lineVertices:c,lineDescriptors:i}}function vn(t,e){const{lineVertices:o,lineDescriptors:c}=t;let i=0,u=0;for(const f of c)i+=2*f.numberOfVertices,u+=6*(f.numberOfVertices-1);const n=new Float32Array(i*9),s=new Uint32Array(u);let l=0,a=0;function h(){s[a++]=l-2,s[a++]=l,s[a++]=l-1,s[a++]=l,s[a++]=l+1,s[a++]=l-1}function p(f,m,g,C,d,y,w,b){const v=l*9;let x=0;n[v+x++]=f,n[v+x++]=m,n[v+x++]=1,n[v+x++]=g,n[v+x++]=y,n[v+x++]=w,n[v+x++]=C/2,n[v+x++]=d/2,n[v+x++]=b,l++,n[v+x++]=f,n[v+x++]=m,n[v+x++]=-1,n[v+x++]=g,n[v+x++]=y,n[v+x++]=w,n[v+x++]=-C/2,n[v+x++]=-d/2,n[v+x++]=b,l++}for(const f of c){const{totalTime:m,timeSeed:g}=f;let C=null,d=null,y=null,w=null,b=null,v=null;for(let x=0;x0){T=k-C,I=S-d;const E=Math.sqrt(T*T+I*I);if(T/=E,I/=E,x>1){let U=T+b,R=I+v;const N=Math.sqrt(U*U+R*R);U/=N,R/=N;const G=Math.min(1/(U*T+R*I),e);U*=G,R*=G,P=-R,L=U}else P=-I,L=T;P!==null&&L!==null&&(p(C,d,y,P,L,m,g,M),h())}C=k,d=S,y=A,b=T,v=I,w=M}p(C,d,y,-v,b,m,g,w)}return{vertexData:n,indexData:s}}function xn(t){const{lineVertices:c,lineDescriptors:i}=t;let u=0,n=0;for(const E of i){const U=E.numberOfVertices-1;u+=4*U*2,n+=6*U*2}const s=new Float32Array(u*16),l=new Uint32Array(n);let a,h,p,f,m,g,C,d,y,w,b,v,x,k,S=0,A=0;function M(){l[A++]=S-8,l[A++]=S-7,l[A++]=S-6,l[A++]=S-7,l[A++]=S-5,l[A++]=S-6,l[A++]=S-4,l[A++]=S-3,l[A++]=S-2,l[A++]=S-3,l[A++]=S-1,l[A++]=S-2}function T(E,U,R,N,G,O,j,F,V,_,X,tt,wt,bt){const J=S*16;let q=0;for(const ht of[1,2])for(const dt of[1,2,3,4])s[J+q++]=E,s[J+q++]=U,s[J+q++]=R,s[J+q++]=N,s[J+q++]=j,s[J+q++]=F,s[J+q++]=V,s[J+q++]=_,s[J+q++]=ht,s[J+q++]=dt,s[J+q++]=wt,s[J+q++]=bt,s[J+q++]=G/2,s[J+q++]=O/2,s[J+q++]=X/2,s[J+q++]=tt/2,S++}function I(E,U){let R=y+b,N=w+v;const G=Math.sqrt(R*R+N*N);R/=G,N/=G;const O=y*R+w*N;R/=O,N/=O;let j=b+x,F=v+k;const V=Math.sqrt(j*j+F*F);j/=V,F/=V;const _=b*j+v*F;j/=_,F/=_,T(a,h,p,f,-N,R,m,g,C,d,-F,j,E,U),M()}function P(E,U,R,N,G,O){if(y=b,w=v,b=x,v=k,y==null&&w==null&&(y=b,w=v),m!=null&&g!=null){x=E-m,k=U-g;const j=Math.sqrt(x*x+k*k);x/=j,k/=j}y!=null&&w!=null&&I(G,O),a=m,h=g,p=C,f=d,m=E,g=U,C=R,d=N}function L(E,U){y=b,w=v,b=x,v=k,y==null&&w==null&&(y=b,w=v),y!=null&&w!=null&&I(E,U)}for(const E of i){a=null,h=null,p=null,f=null,m=null,g=null,C=null,d=null,y=null,w=null,b=null,v=null,x=null,k=null;const{totalTime:U,timeSeed:R}=E;for(let N=0;N=n||o<0||l&&b>=s}function m(){var t=S();if(h(t))return x(t);r=setTimeout(m,P(t))}function x(t){return r=void 0,y&&a?j(t):(a=f=void 0,u)}function A(){r!==void 0&&clearTimeout(r),d=0,a=c=f=r=void 0}function C(){return r===void 0?u:x(S())}function p(){var t=S(),o=h(t);if(a=arguments,f=this,c=t,o){if(r===void 0)return N(c);if(l)return clearTimeout(r),r=setTimeout(m,n),j(c)}return r===void 0&&(r=setTimeout(m,n)),u}return p.cancel=A,p.flush=C,p}export{T as S,J as a,X as b,O as c,oe as d,M as f,q as i,W as r}; diff --git a/assets/defaults-34554cbf.js b/assets/defaults-34554cbf.js new file mode 100644 index 0000000..c864479 --- /dev/null +++ b/assets/defaults-34554cbf.js @@ -0,0 +1 @@ +import{bJ as o,bK as m,bg as r,bk as S}from"./index-080e108a.js";import{l as f,o as s,S as J,t as a,r as N,s as O,y as t}from"./defaultsJSON-59981e75.js";const p=o.fromJSON(f),y=m.fromJSON(s),c=r.fromJSON(J),i=S.fromJSON(a);o.fromJSON(N);m.fromJSON(O);r.fromJSON(t);export{p as S,i as a,c,y as u}; diff --git a/assets/defaultsJSON-59981e75.js b/assets/defaultsJSON-59981e75.js new file mode 100644 index 0000000..322cdcb --- /dev/null +++ b/assets/defaultsJSON-59981e75.js @@ -0,0 +1 @@ +const e=[252,146,31,255],i=[153,153,153,255],l={type:"esriSMS",style:"esriSMSCircle",size:6,color:e,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},o={type:"esriSLS",style:"esriSLSSolid",width:.75,color:e},S={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},t={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},r={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},s={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},y={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null};export{S,e,i,l,o,r,s,t,y}; diff --git a/assets/definitions-0bc08d4c.js b/assets/definitions-0bc08d4c.js new file mode 100644 index 0000000..458a509 --- /dev/null +++ b/assets/definitions-0bc08d4c.js @@ -0,0 +1 @@ +import{cn as a}from"./index-080e108a.js";const r=1e-30,t=4294967295,o=512,c=128,f=511,m=29,n=24,d=8,p=1,x=2,h=3,i=2,k=1,l=1.05;a("featurelayer-force-marker-text-draw-order");const u=5,w=6,y=1.15,e=2,b=128-2*e,g=8,j=500,v=10,q=1024,z=2,A=0,B=1,C=4,Q=8,R=16,S=4,V=1,W=4,$=8,D=32,E=64;export{l as $,D as A,E as B,q as C,p as Q,x as R,h as S,i as V,k as W,r as a,n as b,o as c,g as d,u as e,j as f,e as g,b as h,C as i,t as j,V as k,A as l,v as m,B as n,S as o,z as p,d as q,w as r,R as s,y as t,W as u,$ as v,m as w,Q as x,f as y,c as z}; diff --git a/assets/dehydratedFeatureComparison-a3375a3e.js b/assets/dehydratedFeatureComparison-a3375a3e.js new file mode 100644 index 0000000..001809f --- /dev/null +++ b/assets/dehydratedFeatureComparison-a3375a3e.js @@ -0,0 +1 @@ +import{cM as u}from"./index-080e108a.js";function l(e,r){if(e===r)return!0;if(e==null||r==null||e.length!==r.length)return!1;for(let t=0;t!l.includes(o)),w=l.filter(o=>!i.includes(o)),m=l.filter(o=>i.includes(o)&&p(n,o)!==p(t,o)).concat(s,w).sort(),b=c(n);if(b&&P.includes(b)&&m.length)return{type:"complete",oldValue:n,newValue:t};let a;const A=d(n)&&d(t);for(const o of m){const r=p(n,o),f=p(t,o);let u;if((A||typeof r!="function"&&typeof f!="function")&&r!==f&&(r!=null||f!=null)){if(e&&e[o]&&typeof e[o]=="function")u=(h=e[o])==null?void 0:h.call(e,r,f);else if(r instanceof Date&&f instanceof Date){if(r.getTime()===f.getTime())continue;u={type:"complete",oldValue:r,newValue:f}}else u=typeof r=="object"&&typeof f=="object"&&c(r)===c(f)?j(r,f):{type:"complete",oldValue:r,newValue:f};u!=null&&(a!=null?a.diff[o]=u:a={type:"partial",diff:{[o]:u}})}}return a}function O(n,t){if(n==null)return!1;const e=t.split(".");let l=n;for(const i of e){if(l.type==="complete")return!0;if(l.type!=="partial")return!1;{const s=l.diff[i];if(!s)return!1;l=s}}return!0}function T(n,t){for(const e of t)if(O(n,e))return!0;return!1}function v(n,t){if(typeof n!="function"&&typeof t!="function"&&(n!=null||t!=null))return n==null||t==null||typeof n=="object"&&typeof t=="object"&&c(n)!==c(t)?{type:"complete",oldValue:n,newValue:t}:j(n,t)}function y(n){if(n==null)return!0;switch(n.type){case"complete":return!1;case"collection":{const t=n;for(const e of t.added)if(!y(e))return!1;for(const e of t.removed)if(!y(e))return!1;for(const e of t.changed)if(!y(e))return!1;return!0}case"partial":for(const t in n.diff)if(!y(n.diff[t]))return!1;return!0}}export{v as a,T as p,O as s,y}; diff --git a/assets/drapedUtils-909caa2b.js b/assets/drapedUtils-909caa2b.js new file mode 100644 index 0000000..6f883a8 --- /dev/null +++ b/assets/drapedUtils-909caa2b.js @@ -0,0 +1 @@ +import{ca as o,cZ as i}from"./index-080e108a.js";function M(t,s,e,a=new o){let n=0;if(e.type==="2d")n=s*(e.resolution??0);else if(e.type==="3d"){const f=e.overlayPixelSizeInMapUnits(t),l=e.basemapSpatialReference;n=l==null||l.equals(e.spatialReference)?s*f:i(l)/i(e.spatialReference)}const m=t.x-n,p=t.y-n,r=t.x+n,c=t.y+n,{spatialReference:x}=e;return a.xmin=Math.min(m,r),a.ymin=Math.min(p,c),a.xmax=Math.max(m,r),a.ymax=Math.max(p,c),a.spatialReference=x,a}new o;export{M as r}; diff --git a/assets/editingSupport-b5feb7b5.js b/assets/editingSupport-b5feb7b5.js new file mode 100644 index 0000000..96a56ae --- /dev/null +++ b/assets/editingSupport-b5feb7b5.js @@ -0,0 +1 @@ +import{cv as A,cl as I,ar as l,fk as v,ds as b,bz as $,aF as h,ed as E,aK as S,fl as R,fm as O}from"./index-080e108a.js";import{b as k}from"./normalizeUtils-cf8b8053.js";import{n as L,l as U}from"./EditBusLayer-d71787e9.js";import"./normalizeUtilsCommon-500064b3.js";function F(e){return e&&e.applyEdits!=null}function j(e){return typeof e=="object"&&e!=null&&"objectId"in e&&!!e.objectId}function K(e){return e.every(j)}function G(e){return typeof e=="object"&&e!=null&&"globalId"in e&&!!e.globalId}function H(e){return e.every(G)}async function J(e,t,a,s={}){var o;let n;if(L(e)&&e.url)n=U(e.url,e.layerId,s.returnServiceEditsOption==="original-and-current-features");else{n=A(),n.promise.then(d=>{(d.addedFeatures.length||d.updatedFeatures.length||d.deletedFeatures.length||d.addedAttachments.length||d.updatedAttachments.length||d.deletedAttachments.length)&&e.emit("edits",d)});const i={result:n.promise};e.emit("apply-edits",i)}try{const{results:i,edits:d}=await B(e,t,a,s),r=u=>u.filter(c=>!c.error).map(I),p={edits:d,addedFeatures:r(i.addFeatureResults),updatedFeatures:r(i.updateFeatureResults),deletedFeatures:r(i.deleteFeatureResults),addedAttachments:r(i.addAttachmentResults),updatedAttachments:r(i.updateAttachmentResults),deletedAttachments:r(i.deleteAttachmentResults),exceededTransferLimit:!1};return(o=i.editedFeatureResults)!=null&&o.length&&(p.editedFeatures=i.editedFeatureResults),n.resolve(p),i}catch(i){throw n.reject(i),i}}async function B(e,t,a,s){var i,d,r,p,u,c;if(await e.load(),!F(t))throw new l(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!v(e))throw new l(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:n,options:o}=await W(e,a,s);return(i=n.addFeatures)!=null&&i.length||(d=n.updateFeatures)!=null&&d.length||(r=n.deleteFeatures)!=null&&r.length||(p=n.addAttachments)!=null&&p.length||(u=n.updateAttachments)!=null&&u.length||(c=n.deleteAttachments)!=null&&c.length?{edits:n,results:await t.applyEdits(n,o)}:{edits:n,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function W(e,t,a){const s=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),n=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),o=e.infoFor3D!=null;if(!t||!s&&!n)throw new l(`${e.type}-layer:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");const i=b(e);if(!i.data.isVersioned&&(a!=null&&a.gdbVersion))throw new l(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!i.editing.supportsRollbackOnFailure&&(a!=null&&a.rollbackOnFailureEnabled))throw new l(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");if(!i.editing.supportsGlobalId&&(a!=null&&a.globalIdUsed))throw new l(`${e.type}-layer:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!i.editing.supportsGlobalId&&n)throw new l(`${e.type}-layer:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!(a!=null&&a.globalIdUsed)&&n)throw new l(`${e.type}-layer:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true");const d={...a};if(d.rollbackOnFailureEnabled!=null||i.editing.supportsRollbackOnFailure||(d.rollbackOnFailureEnabled=!0),d.rollbackOnFailureEnabled||d.returnServiceEditsOption!=="original-and-current-features"||(d.rollbackOnFailureEnabled===!1&&$.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwrritten and set to true."),d.rollbackOnFailureEnabled=!0),!i.editing.supportsReturnServiceEditsInSourceSpatialReference&&d.returnServiceEditsInSourceSR)throw new l(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(d.returnServiceEditsInSourceSR&&d.returnServiceEditsOption!=="original-and-current-features")throw new l(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const r={...t};if(r.addFeatures=t&&h.isCollection(t.addFeatures)?t.addFeatures.toArray():r.addFeatures||[],r.updateFeatures=t&&h.isCollection(t.updateFeatures)?t.updateFeatures.toArray():r.updateFeatures||[],r.deleteFeatures=t&&h.isCollection(t.deleteFeatures)?t.deleteFeatures.toArray():r.deleteFeatures||[],r.addFeatures.length&&!i.operations.supportsAdd)throw new l(`${e.type}-layer:unsupported-operation`,"Layer does not support adding features.");if(r.updateFeatures.length&&!i.operations.supportsUpdate)throw new l(`${e.type}-layer:unsupported-operation`,"Layer does not support updating features.");if(r.deleteFeatures.length&&!i.operations.supportsDelete)throw new l(`${e.type}-layer:unsupported-operation`,"Layer does not support deleting features.");r.addAttachments=r.addAttachments||[],r.updateAttachments=r.updateAttachments||[],r.deleteAttachments=r.deleteAttachments||[],r.addFeatures=r.addFeatures.map(f),r.updateFeatures=r.updateFeatures.map(f),r.addAssetFeatures=[];const p=(a==null?void 0:a.globalIdUsed)||o;return r.addFeatures.forEach(u=>T(u,e,p)),r.updateFeatures.forEach(u=>V(u,e,p)),r.deleteFeatures.forEach(u=>D(u,e,p)),r.addAttachments.forEach(u=>m(u,e)),r.updateAttachments.forEach(u=>m(u,e)),o&&await C(r,e),{edits:await z(r),options:d}}function y(e,t,a){var s,n;if(a){if("attributes"in e&&!e.attributes[t.globalIdField])throw new l(`${t.type}-layer:invalid-parameter`,"Feature should have 'globalId' when 'globalIdUsed' is true");if(!("attributes"in e)&&!e.globalId)throw new l(`${t.type}-layer:invalid-parameter`,"'globalId' of the feature should be passed when 'globalIdUsed' is true")}if("geometry"in e&&e.geometry!=null){if(e.geometry.hasZ&&((s=t.capabilities)==null?void 0:s.data.supportsZ)===!1)throw new l(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&((n=t.capabilities)==null?void 0:n.data.supportsM)===!1)throw new l(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function w(e,t){var a;if("geometry"in e&&((a=e.geometry)==null?void 0:a.type)==="mesh"){const{geometry:s}=e;if(s.vertexSpace.isGeoreferenced)throw new l(`${t.type}-layer:georeferenced-mesh-unsupported`,"Uploading georeferenced meshes to a layer is not supported.")}}function T(e,t,a){y(e,t,a),w(e,t)}function D(e,t,a){y(e,t,a)}function V(e,t,a){y(e,t,a),w(e,t);const s=b(t);if("geometry"in e&&e.geometry!=null&&!(s!=null&&s.editing.supportsGeometryUpdate))throw new l(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function m(e,t){var n;const{feature:a,attachment:s}=e;if(!a||"attributes"in a&&!a.attributes[t.globalIdField])throw new l(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in a)&&!a.globalId)throw new l(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!s.globalId)throw new l(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!s.data&&!s.uploadId)throw new l(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(s.data instanceof File&&s.data.name)&&!s.name)throw new l(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!((n=t.capabilities)!=null&&n.editing.supportsUploadWithItemId)&&s.uploadId)throw new l(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if(typeof s.data=="string"){const o=E(s.data);if(o&&!o.isBase64)throw new l(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}async function z(e){const t=e.addFeatures??[],a=e.updateFeatures??[],s=t.concat(a).map(d=>d.geometry),n=await k(s),o=t.length,i=a.length;return n.slice(0,o).forEach((d,r)=>t[r].geometry=d),n.slice(o,o+i).forEach((d,r)=>a[r].geometry=d),e}function f(e){const t=new S;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}async function C(e,t){if(t.infoFor3D==null)return;const{infoFor3D:a}=t,s=R("model/gltf-binary",a.supportedFormats)??O("glb",a.supportedFormats);if(!(s&&a.editFormats.includes(s)))throw new l(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??(e.addAssetFeatures=[]);const{addAssetFeatures:n}=e;for(const o of e.addFeatures??[])g(o)&&n.push(o);for(const o of e.updateFeatures??[])g(o)&&n.push(o)}function g(e){var t;return((t=e==null?void 0:e.geometry)==null?void 0:t.type)==="mesh"}function N(e,t,a,s){if(!F(t))throw new l(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new l(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(a,s)}export{J as applyEdits,H as isFeatureIdentifierArrayWithGlobalId,K as isFeatureIdentifierArrayWithObjectId,G as isFeatureIdentifierWithGlobalId,j as isFeatureIdentifierWithObjectId,N as uploadAssets}; diff --git a/assets/editsZScale-1b5a53a6.js b/assets/editsZScale-1b5a53a6.js new file mode 100644 index 0000000..299ab99 --- /dev/null +++ b/assets/editsZScale-1b5a53a6.js @@ -0,0 +1 @@ +import{cL as l,cM as c}from"./index-080e108a.js";function t(n,o,s){if(n.hasM==null||n.hasZ)for(const f of o)for(const e of f)e.length>2&&(e[2]*=s)}function i(n,o,s){if(!n&&!o||!s)return;const f=l(s);r(n,s,f),r(o,s,f)}function r(n,o,s){if(n)for(const f of n)a(f.geometry,o,s)}function a(n,o,s){if(n==null||!n.spatialReference||c(n.spatialReference,o))return;const f=l(n.spatialReference)/s;if(f!==1){if("x"in n)n.z!=null&&(n.z*=f);else if("rings"in n)t(n,n.rings,f);else if("paths"in n)t(n,n.paths,f);else if("points"in n&&(n.hasM==null||n.hasZ))for(const e of n.points)e.length>2&&(e[2]*=f)}}export{i}; diff --git a/assets/el_GR2-2b9c8a60.js b/assets/el_GR2-2b9c8a60.js new file mode 100644 index 0000000..95dfc16 --- /dev/null +++ b/assets/el_GR2-2b9c8a60.js @@ -0,0 +1 @@ +const d={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"μ.Χ.",_era_bc:"π.Χ.",A:"πμ",P:"μμ",AM:"π.μ.",PM:"μ.μ.","A.M.":"π.μ.","P.M.":"μ.μ.",January:"Ιανουαρίου",February:"Φεβρουαρίου",March:"Μαρτίου",April:"Απριλίου",May:"Μαΐου",June:"Ιουνίου",July:"Ιουλίου",August:"Αυγούστου",September:"Σεπτεμβρίου",October:"Οκτωβρίου",November:"Νοεμβρίου",December:"Δεκεμβρίου",Jan:"Ιαν",Feb:"Φεβ",Mar:"Μαρ",Apr:"Απρ","May(short)":"Μαΐ",Jun:"Ιουν",Jul:"Ιουλ",Aug:"Αυγ",Sep:"Σεπ",Oct:"Οκτ",Nov:"Νοε",Dec:"Δεκ",Sunday:"Κυριακή",Monday:"Δευτέρα",Tuesday:"Τρίτη",Wednesday:"Τετάρτη",Thursday:"Πέμπτη",Friday:"Παρασκευή",Saturday:"Σάββατο",Sun:"Κυρ",Mon:"Δευ",Tue:"Τρί",Wed:"Τετ",Thu:"Πέμ",Fri:"Παρ",Sat:"Σάβ",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Εστίαση",Play:"Αναπαραγωγή",Stop:"Στάση",Legend:"Υπόμνημα","Press ENTER to toggle":"",Loading:"Φόρτωση",Home:"Αρχική",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Εκτύπωση",Image:"Image",Data:"Δεδομένα",Print:"Εκτύπωση","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Από %1 έως %2","From %1":"Από %1","To %1":"Έως %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/assets/elevationInfoUtils-4fd79d95.js b/assets/elevationInfoUtils-4fd79d95.js new file mode 100644 index 0000000..a825e59 --- /dev/null +++ b/assets/elevationInfoUtils-4fd79d95.js @@ -0,0 +1 @@ +import{dv as f}from"./index-080e108a.js";function a(t){return t?Z:y}function v(t,e){return e!=null&&e.mode?e.mode:a(t).mode}function d(t,e){return e??a(t)}function g(t,e){return v(t!=null&&t.hasZ,e)}function P(t,e){return d(t!=null&&!!t.hasZ,e)}function p(t){const e=h(t),n=g(t.geometry,e);return{mode:n,offset:e!=null&&n!=="on-the-ground"?(e.offset??0)*f(e.unit??"meters"):0}}function h(t){return t.layer&&"elevationInfo"in t.layer?t.layer.elevationInfo:null}function w(t,e,n,o=null){return c(t,e.x,e.y,e.hasZ?e.z:0,e.spatialReference,n,o)}function x(t,e,n,o,u=null){return c(t,e[0],e[1],e.length>2?e[2]:0,n,o,u)}function c(t,e,n,o,u,i,l=null){if(i==null)return;const r=l!=null?l.mode:"absolute-height";if(r==="on-the-ground")return 0;const{absoluteZ:s}=m(e,n,o,u,t,i);return b(s,e,n,o,u,t,l,r)}function m(t,e,n,o,u,i){const l=i.offset!=null?i.offset:0;switch(i.mode){case"absolute-height":return{absoluteZ:n+l,elevation:0};case"on-the-ground":{const r=u.elevationProvider.getElevation(t,e,0,o,"ground")??0;return{absoluteZ:r,elevation:r}}case"relative-to-ground":{const r=u.elevationProvider.getElevation(t,e,n,o,"ground")??0;return{absoluteZ:n+r+l,elevation:r}}case"relative-to-scene":{const r=u.elevationProvider.getElevation(t,e,n,o,"scene")??0;return{absoluteZ:n+r+l,elevation:r}}}}function b(t,e,n,o,u,i,l,r){const s=l!=null&&l.offset!=null?l.offset:0;switch(r){case"absolute-height":return t-s;case"relative-to-ground":return t-((i.elevationProvider.getElevation(e,n,o,u,"ground")??0)+s);case"relative-to-scene":return t-((i.elevationProvider.getElevation(e,n,o,u,"scene")??0)+s)}}function I(t,e){if(e==null)return!1;const{mode:n}=e;return n!=null&&(t==="scene"&&n==="relative-to-scene"||t==="ground"&&n!=="absolute-height")}const Z={mode:"absolute-height",offset:0},y={mode:"on-the-ground",offset:null};export{Z as b,w as c,m as g,I as m,y as p,g as r,p as s,P as u,x as v}; diff --git a/assets/en_CA2-40dcf3cc.js b/assets/en_CA2-40dcf3cc.js new file mode 100644 index 0000000..84ef54c --- /dev/null +++ b/assets/en_CA2-40dcf3cc.js @@ -0,0 +1 @@ +const o={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"hh:mm:ss a",_date_second_full:"hh:mm:ss a",_date_minute:"hh:mm a",_date_minute_full:"hh:mm a - MMM dd, yyyy",_date_hour:"hh:mm a",_date_hour_full:"hh:mm a - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(a){let e="th";if(a<11||a>13)switch(a%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},Play:"",Stop:"","Zoom Out":"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Chord diagram":"","Flow diagram":"","TreeMap chart":"",Series:"","Candlestick Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{o as default}; diff --git a/assets/en_US2-40dcf3cc.js b/assets/en_US2-40dcf3cc.js new file mode 100644 index 0000000..84ef54c --- /dev/null +++ b/assets/en_US2-40dcf3cc.js @@ -0,0 +1 @@ +const o={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"hh:mm:ss a",_date_second_full:"hh:mm:ss a",_date_minute:"hh:mm a",_date_minute_full:"hh:mm a - MMM dd, yyyy",_date_hour:"hh:mm a",_date_hour_full:"hh:mm a - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(a){let e="th";if(a<11||a>13)switch(a%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},Play:"",Stop:"","Zoom Out":"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Chord diagram":"","Flow diagram":"","TreeMap chart":"",Series:"","Candlestick Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{o as default}; diff --git a/assets/es_ES2-c856435b.js b/assets/es_ES2-c856435b.js new file mode 100644 index 0000000..1db4450 --- /dev/null +++ b/assets/es_ES2-c856435b.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - dd MMM",_date_hour:"HH:mm",_date_hour_full:"HH:mm - dd MMM",_date_day:"dd MMM",_date_day_full:"dd MMM",_date_week:"ww",_date_week_full:"dd MMM",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"DC",_era_bc:"AC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Enero",February:"Febrero",March:"Marzo",April:"Abril",May:"Mayo",June:"Junio",July:"Julio",August:"Agosto",September:"Septiembre",October:"Octubre",November:"Noviembre",December:"Diciembre",Jan:"Ene",Feb:"Feb",Mar:"Mar",Apr:"Abr","May(short)":"May",Jun:"Jun",Jul:"Jul",Aug:"Ago",Sep:"Sep",Oct:"Oct",Nov:"Nov",Dec:"Dic",Sunday:"Domingo",Monday:"Lunes",Tuesday:"Martes",Wednesday:"Miércoles",Thursday:"Jueves",Friday:"Viernes",Saturday:"Sábado",Sun:"Dom",Mon:"Lun",Tue:"Mar",Wed:"Mie",Thu:"Jue",Fri:"Vie",Sat:"Sáb",_dateOrd:function(e){return"º"},"Zoom Out":"Aumentar Zoom",Play:"Reproducir",Stop:"Detener",Legend:"Leyenda","Press ENTER to toggle":"Haga clic, toque o presione ENTER para alternar",Loading:"Cargando",Home:"Inicio",Chart:"Gráfico","Serial chart":"Gráfico de serie","X/Y chart":"Gráfico X/Y","Pie chart":"Gráfico circular","Gauge chart":"Gráfico de medidor radial","Radar chart":"Gráfico de radar","Sankey diagram":"Diagrama de sankey","Chord diagram":"Diagrama de cuerdas","Flow diagram":"Diagrama de flujo","TreeMap chart":"Gráfico de mapa de árbol",Series:"Series","Candlestick Series":"Series de velas","Column Series":"Series de columnas","Line Series":"Series de líneas","Pie Slice Series":"Series de trozos circular","X/Y Series":"Series de X/Y",Map:"Mapa","Press ENTER to zoom in":"Presione ENTER para aumentar el zoom","Press ENTER to zoom out":"Presione ENTER para disminuir el zoom","Use arrow keys to zoom in and out":"Use los cursores para disminuir o aumentar el zoom","Use plus and minus keys on your keyboard to zoom in and out":"Use las teclas mas o menos en su teclado para disminuir ou aumentar el zoom",Export:"Exportar",Image:"Imagen",Data:"Datos",Print:"Imprimir","Press ENTER to open":"Haga clic, toque o presione ENTER para abrir","Press ENTER to print.":"Haga clic, toque o presione ENTER para imprimir","Press ENTER to export as %1.":"Haga clic, toque o presione ENTER para exportar como %1.","(Press ESC to close this message)":"(Presione ESC para cerrar este mensaje)","Image Export Complete":"Exportación de imagen completada","Export operation took longer than expected. Something might have gone wrong.":"La operación de exportación llevó más tiempo de lo esperado. Algo pudo haber salido mal.","Saved from":"Guardado de",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Use TAB para seleccionar los botones de agarre o las flechas izquierda y derecha para cambiar la selección","Use left and right arrows to move selection":"Use las flechas izquierda y derecha para mover la selección","Use left and right arrows to move left selection":"Use las flechas izquierda y derecha para mover la selección izquierda","Use left and right arrows to move right selection":"Use las flechas izquierda y derecha para mover la selección derecha","Use TAB select grip buttons or up and down arrows to change selection":"Utilice los botones de control de selección TAB o flechas arriba y abajo para cambiar la selección","Use up and down arrows to move selection":"Use las flechas hacia arriba y hacia abajo para mover la selección","Use up and down arrows to move lower selection":"Use las flechas hacia arriba y hacia abajo para mover la selección inferior","Use up and down arrows to move upper selection":"Use las flechas hacia arriba y hacia abajo para mover la selección superior","From %1 to %2":"Desde %1 hasta %2","From %1":"Desde %1","To %1":"Hasta %1","No parser available for file: %1":"No hay analizador disponible para el archivo: %1","Error parsing file: %1":"Error al analizar el archivo: %1","Unable to load file: %1":"No se puede cargar el archivo: %1","Invalid date":"Fecha inválida"};export{a as default}; diff --git a/assets/et_EE2-193ac1c8.js b/assets/et_EE2-193ac1c8.js new file mode 100644 index 0000000..cb8970e --- /dev/null +++ b/assets/et_EE2-193ac1c8.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"pKr",_era_bc:"eKr",A:"AM",P:"PM",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"jaanuar",February:"veebruar",March:"märts",April:"aprill",May:"mai",June:"juuni",July:"juuli",August:"august",September:"september",October:"oktoober",November:"november",December:"detsember",Jan:"jaan",Feb:"veebr",Mar:"märts",Apr:"apr","May(short)":"mai",Jun:"juuni",Jul:"juuli",Aug:"aug",Sep:"sept",Oct:"okt",Nov:"nov",Dec:"dets",Sunday:"pühapäev",Monday:"esmaspäev",Tuesday:"teisipäev",Wednesday:"kolmapäev",Thursday:"neljapäev",Friday:"reede",Saturday:"laupäev",Sun:"P",Mon:"E",Tue:"T",Wed:"K",Thu:"N",Fri:"R",Sat:"L",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Suumi",Play:"Esita",Stop:"Lõpeta",Legend:"Legend","Press ENTER to toggle":"",Loading:"Laadin",Home:"Kodu",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Prindi",Image:"Pilt",Data:"Andmed",Print:"Prindi","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Alates %1 kuni %2","From %1":"Alates %1","To %1":"Kuni %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{a as default}; diff --git a/assets/executeForIds-5eaf002d.js b/assets/executeForIds-5eaf002d.js new file mode 100644 index 0000000..1262dc3 --- /dev/null +++ b/assets/executeForIds-5eaf002d.js @@ -0,0 +1 @@ +import{cm as m}from"./index-080e108a.js";import{p as a,d as s}from"./query-93c6e211.js";import{b as f}from"./Query-1c961d4c.js";async function u(t,n,o){const r=m(t);return a(r,f.from(n),{...o}).then(c=>c.data.count)}async function d(t,n,o){const r=m(t);return s(r,f.from(n),{...o}).then(c=>c.data.objectIds)}export{u as n,d as s}; diff --git a/assets/executeForTopCount-6d9058c4.js b/assets/executeForTopCount-6d9058c4.js new file mode 100644 index 0000000..64762bf --- /dev/null +++ b/assets/executeForTopCount-6d9058c4.js @@ -0,0 +1 @@ +import{cm as i}from"./index-080e108a.js";import{m as p}from"./queryTopFeatures-70149ca3.js";import{S as a}from"./TopFeaturesQuery-e44d05be.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./query-93c6e211.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";async function y(o,t,r){const m=i(o);return(await p(m,a.from(t),{...r})).data.count}export{y as executeForTopCount}; diff --git a/assets/executeForTopExtents-9cf44843.js b/assets/executeForTopExtents-9cf44843.js new file mode 100644 index 0000000..acb1abd --- /dev/null +++ b/assets/executeForTopExtents-9cf44843.js @@ -0,0 +1 @@ +import{cm as a,ca as i}from"./index-080e108a.js";import{p as e}from"./queryTopFeatures-70149ca3.js";import{S as n}from"./TopFeaturesQuery-e44d05be.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./query-93c6e211.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";async function y(o,r,m){const p=a(o),t=await e(p,n.from(r),{...m});return{count:t.data.count,extent:i.fromJSON(t.data.extent)}}export{y as executeForTopExtents}; diff --git a/assets/executeForTopIds-53feffc9.js b/assets/executeForTopIds-53feffc9.js new file mode 100644 index 0000000..d980da0 --- /dev/null +++ b/assets/executeForTopIds-53feffc9.js @@ -0,0 +1 @@ +import{cm as i}from"./index-080e108a.js";import{d as p}from"./queryTopFeatures-70149ca3.js";import{S as a}from"./TopFeaturesQuery-e44d05be.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./query-93c6e211.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";async function b(o,r,t){const m=i(o);return(await p(m,a.from(r),{...t})).data.objectIds}export{b as executeForTopIds}; diff --git a/assets/executeQueryJSON-7c41ada5.js b/assets/executeQueryJSON-7c41ada5.js new file mode 100644 index 0000000..ae89fa7 --- /dev/null +++ b/assets/executeQueryJSON-7c41ada5.js @@ -0,0 +1 @@ +import{cm as i}from"./index-080e108a.js";import{m as c}from"./query-93c6e211.js";import{d as s}from"./FeatureSet-111cb247.js";import{b as e}from"./Query-1c961d4c.js";async function S(r,o,t){const a=await p(r,o,t);return s.fromJSON(a)}async function p(r,o,t){const a=i(r),n={...t},m=e.from(o),{data:f}=await c(a,m,m.sourceSpatialReference,n);return f}export{p as a,S as s}; diff --git a/assets/executeQueryPBF-0f188593.js b/assets/executeQueryPBF-0f188593.js new file mode 100644 index 0000000..e0aeb29 --- /dev/null +++ b/assets/executeQueryPBF-0f188593.js @@ -0,0 +1 @@ +import{cN as l,fI as f,gT as p,er as m,hr as u,cm as _}from"./index-080e108a.js";import{c as y}from"./query-93c6e211.js";import"./FeatureSet-111cb247.js";import{b as P}from"./Query-1c961d4c.js";function C(o,t){return t}function h(o,t,e,r){switch(e){case 0:return n(o,t+r,0);case 1:return o.originPosition==="lowerLeft"?n(o,t+r,1):M(o,t+r,1)}}function c(o,t,e,r){return e===2?n(o,t,2):h(o,t,e,r)}function g(o,t,e,r){return e===2?n(o,t,3):h(o,t,e,r)}function G(o,t,e,r){return e===3?n(o,t,3):c(o,t,e,r)}function n({translate:o,scale:t},e,r){return o[r]+e*t[r]}function M({translate:o,scale:t},e,r){return o[r]-e*t[r]}class R{constructor(t){this._options=t,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=C,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=l(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const r of t.features)e(r.geometry)}createSpatialReference(){return{}}addField(t,e){const r=t.fields;f(r),r.push(e);const s=r.map(i=>i.name);this._attributesConstructor=function(){for(const i of s)this[i]=null}}addFeature(t,e){t.features.push(e)}prepareFeatures(t){switch(this._transform=t.transform,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&this._vertexDimension++,t.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,r,s)=>this.addCoordinatePoint(e,r,s),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,r,s)=>this._addCoordinatePolygon(e,r,s),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,r,s)=>this._addCoordinatePolyline(e,r,s),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,r,s)=>this._addCoordinateMultipoint(e,r,s),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(t,e,r){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}addQueryGeometry(t,e){const{queryGeometry:r,queryGeometryType:s}=e,i=p(r.clone(),r,!1,!1,this._transform),a=m(i,s,!1,!1);t.queryGeometryType=s,t.queryGeometry={...a}}createPointGeometry(t){const e={x:0,y:0,spatialReference:t.spatialReference};return t.hasZ&&(e.z=0),t.hasM&&(e.m=0),e}addCoordinatePoint(t,e,r){const s=u(this._transform,"transform");switch(e=this._applyTransform(s,e,r,0),r){case 0:t.x=e;break;case 1:t.y=e;break;case 2:"z"in t?t.z=e:t.m=e;break;case 3:t.m=e}}_transformPathLikeValue(t,e){let r=0;e<=1&&(r=this._previousCoordinate[e],this._previousCoordinate[e]+=t);const s=u(this._transform,"transform");return this._applyTransform(s,t,e,r)}_addCoordinatePolyline(t,e,r){this._dehydratedAddPointsCoordinate(t.paths,e,r)}_addCoordinatePolygon(t,e,r){this._dehydratedAddPointsCoordinate(t.rings,e,r)}_addCoordinateMultipoint(t,e,r){r===0&&t.points.push([]);const s=this._transformPathLikeValue(e,r);t.points[t.points.length-1].push(s)}_createPolygonGeometry(t){return{rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,r){r===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(e,r),i=t[t.length-1];r===0&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),i.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=s}_deriveApplyTransform(t){const{hasZ:e,hasM:r}=t;return e&&r?G:e?c:r?g:h}}async function A(o,t,e){const r=_(o),s={...e},i=P.from(t),a=!i.quantizationParameters,{data:d}=await y(r,i,new R({sourceSpatialReference:i.sourceSpatialReference,applyTransform:a}),s);return d}export{A as n}; diff --git a/assets/executeRelationshipQuery-39c5c9fd.js b/assets/executeRelationshipQuery-39c5c9fd.js new file mode 100644 index 0000000..4097b40 --- /dev/null +++ b/assets/executeRelationshipQuery-39c5c9fd.js @@ -0,0 +1 @@ +import{at as m,cm as l}from"./index-080e108a.js";import{t as p}from"./query-93c6e211.js";import{d as j}from"./FeatureSet-111cb247.js";import f from"./RelationshipQuery-39c07195.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./Query-1c961d4c.js";function R(r,t){const e=r.toJSON();return e.objectIds&&(e.objectIds=e.objectIds.join(",")),e.orderByFields&&(e.orderByFields=e.orderByFields.join(",")),e.outFields&&!(t!=null&&t.returnCountOnly)?e.outFields.includes("*")?e.outFields="*":e.outFields=e.outFields.join(","):delete e.outFields,e.outSpatialReference&&(e.outSR=e.outSR.wkid||JSON.stringify(e.outSR.toJSON()),delete e.outSpatialReference),e.dynamicDataSource&&(e.layer=JSON.stringify({source:e.dynamicDataSource}),delete e.dynamicDataSource),e}async function S(r,t,e){const n=await y(r,t,e),o=n.data,s=o.geometryType,a=o.spatialReference,c={};for(const d of o.relatedRecordGroups){const i={fields:void 0,objectIdFieldName:void 0,geometryType:s,spatialReference:a,hasZ:!!o.hasZ,hasM:!!o.hasM,features:d.relatedRecords};if(d.objectId!=null)c[d.objectId]=i;else for(const u of Object.keys(d))u!=="relatedRecords"&&(c[d[u]]=i)}return{...n,data:c}}async function F(r,t,e){const n=await y(r,t,e,{returnCountOnly:!0}),o=n.data,s={};for(const a of o.relatedRecordGroups)a.objectId!=null&&(s[a.objectId]=a.count);return{...n,data:s}}async function y(r,t,e={},n){const o=p({...r.query,f:"json",...n,...R(t,n)});return m(r.path+"/queryRelatedRecords",{...e,query:{...e.query,...o}})}async function w(r,t,e){t=f.from(t);const n=l(r);return S(n,t,e).then(o=>{const s=o.data,a={};return Object.keys(s).forEach(c=>a[c]=j.fromJSON(s[c])),a})}async function x(r,t,e){t=f.from(t);const n=l(r);return F(n,t,{...e}).then(o=>o.data)}export{w as executeRelationshipQuery,x as executeRelationshipQueryForCount}; diff --git a/assets/executeTopFeaturesQuery-6e0504e9.js b/assets/executeTopFeaturesQuery-6e0504e9.js new file mode 100644 index 0000000..26da5bf --- /dev/null +++ b/assets/executeTopFeaturesQuery-6e0504e9.js @@ -0,0 +1 @@ +import{cm as f}from"./index-080e108a.js";import{y as e}from"./queryTopFeatures-70149ca3.js";import{d as s}from"./FeatureSet-111cb247.js";import{S as c}from"./TopFeaturesQuery-e44d05be.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./query-93c6e211.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";async function N(r,o,m,t){const i=f(r),p={...t},{data:a}=await e(i,c.from(o),m,p);return s.fromJSON(a)}export{N as executeTopFeaturesQuery}; diff --git a/assets/executionError-c92d3b85.js b/assets/executionError-c92d3b85.js new file mode 100644 index 0000000..da9fb89 --- /dev/null +++ b/assets/executionError-c92d3b85.js @@ -0,0 +1 @@ +var r;(function(e){e.AsyncNotEnabled="AsyncNotEnabled",e.ModulesNotSupported="ModulesNotSupported",e.CircularModules="CircularModules",e.NeverReach="NeverReach",e.UnsupportedHashType="UnsupportedHashType",e.InvalidParameter="InvalidParameter",e.UnexpectedToken="UnexpectedToken",e.Unrecognised="Unrecognised",e.UnrecognisedType="UnrecognisedType",e.MaximumCallDepth="MaximumCallDepth",e.BooleanConditionRequired="BooleanConditionRequired",e.TypeNotAllowedInFeature="TypeNotAllowedInFeature",e.KeyMustBeString="KeyMustBeString",e.WrongNumberOfParameters="WrongNumberOfParameters",e.CallNonFunction="CallNonFunction",e.NoFunctionInTemplateLiteral="NoFunctionInTemplateLiteral",e.NoFunctionInDictionary="NoFunctionInDictionary",e.NoFunctionInArray="NoFunctionInArray",e.AssignModuleFunction="AssignModuleFunction",e.LogicExpressionOrAnd="LogicExpressionOrAnd",e.LogicalExpressionOnlyBoolean="LogicalExpressionOnlyBoolean",e.FunctionNotFound="FunctionNotFound",e.InvalidMemberAccessKey="InvalidMemberAccessKey",e.UnsupportedUnaryOperator="UnsupportUnaryOperator",e.InvalidIdentifier="InvalidIdentifier",e.MemberOfNull="MemberOfNull",e.UnsupportedOperator="UnsupportedOperator",e.Cancelled="Cancelled",e.ModuleAccessorMustBeString="ModuleAccessorMustBeString",e.ModuleExportNotFound="ModuleExportNotFound",e.Immutable="Immutable",e.OutOfBounds="OutOfBounds",e.IllegalResult="IllegalResult",e.FieldNotFound="FieldNotFound",e.PortalRequired="PortalRequired",e.LogicError="LogicError",e.ArrayAccessorMustBeNumber="ArrayAccessMustBeNumber",e.KeyAccessorMustBeString="KeyAccessorMustBeString",e.WrongSpatialReference="WrongSpatialReference"})(r||(r={}));const l={[r.TypeNotAllowedInFeature]:"Feature attributes only support dates, numbers, strings, guids.",[r.LogicError]:"Logic error - {reason}",[r.NeverReach]:"Encountered unreachable logic",[r.AsyncNotEnabled]:"Async Arcade must be enabled for this script",[r.ModuleAccessorMustBeString]:"Module accessor must be a string",[r.ModuleExportNotFound]:"Module has no export with provided identifier",[r.ModulesNotSupported]:"Current profile does not support modules",[r.ArrayAccessorMustBeNumber]:"Array accessor must be a number",[r.FunctionNotFound]:"Function not found",[r.FieldNotFound]:"Key not found - {key}",[r.CircularModules]:"Circular module dependencies are not allowed",[r.Cancelled]:"Execution cancelled",[r.UnsupportedHashType]:"Type not supported in hash function",[r.IllegalResult]:"Value is not a supported return type",[r.PortalRequired]:"Portal is required",[r.InvalidParameter]:"Invalid parameter",[r.WrongNumberOfParameters]:"Call with wrong number of parameters",[r.Unrecognised]:"Unrecognised code structure",[r.UnrecognisedType]:"Unrecognised type",[r.WrongSpatialReference]:"Cannot work with geometry in this spatial reference. It is different to the execution spatial reference",[r.BooleanConditionRequired]:"Conditions must use booleans",[r.NoFunctionInDictionary]:"Dictionaries cannot contain functions.",[r.NoFunctionInArray]:"Arrays cannot contain functions.",[r.NoFunctionInTemplateLiteral]:"Template Literals do not expect functions by value.",[r.KeyAccessorMustBeString]:"Accessor must be a string",[r.KeyMustBeString]:"Object keys must be a string",[r.Immutable]:"Object is immutable",[r.UnexpectedToken]:"Unexpected token",[r.MemberOfNull]:"Cannot access property of null object",[r.MaximumCallDepth]:"Exceeded maximum function depth",[r.OutOfBounds]:"Out of bounds",[r.InvalidIdentifier]:"Identifier not recognised",[r.CallNonFunction]:"Expression is not a function",[r.InvalidMemberAccessKey]:"Cannot access value using a key of this type",[r.AssignModuleFunction]:"Cannot assign function to module variable",[r.UnsupportedUnaryOperator]:"Unsupported unary operator",[r.UnsupportedOperator]:"Unsupported operator",[r.LogicalExpressionOnlyBoolean]:"Logical expressions must be boolean",[r.LogicExpressionOrAnd]:"Logical expression can only be combined with || or &&"};class y extends Error{constructor(...t){super(...t)}}class s extends y{constructor(t,o){super(i(o)+t.message,{cause:t}),this.loc=null,Error.captureStackTrace&&Error.captureStackTrace(this,s),o&&o.loc&&(this.loc=o.loc)}}class d extends Error{constructor(t,o,n,c){super("Execution error - "+i(n)+u(l[o],c)),this.loc=null,this.declaredRootClass="esri.arcade.arcadeexecutionerror",Error.captureStackTrace&&Error.captureStackTrace(this,d),n&&n.loc&&(this.loc=n.loc)}}function i(e){var t,o;return e&&e.loc?`Line : ${(t=e.loc.start)==null?void 0:t.line}, ${(o=e.loc.start)==null?void 0:o.column}: `:""}class p extends Error{constructor(t,o,n,c){super("Compilation error - "+i(n)+u(l[o],c)),this.loc=null,this.declaredRootClass="esri.arcade.arcadecompilationerror",Error.captureStackTrace&&Error.captureStackTrace(this,p),n&&n.loc&&(this.loc=n.loc)}}class m extends Error{constructor(){super("Uncompilable code structures"),this.declaredRootClass="esri.arcade.arcadeuncompilableerror",Error.captureStackTrace&&Error.captureStackTrace(this,m)}}function u(e,t){try{if(!t)return e;for(const o in t){let n=t[o];n||(n=""),e=e.replace("{"+o+"}",t[o])}}catch{}return e}function b(e,t,o){return o.declaredRootClass==="esri.arcade.arcadeexecutionerror"||o.declaredRootClass==="esri.arcade.arcadecompilationerror"?o.loc===null&&t&&t.loc?new s(o,{cause:o}):o:(o.declaredRootClass==="esri.arcade.featureset.support.featureseterror"||o.declaredRootClass==="esri.arcade.featureset.support.sqlerror"||o.declaredRootClass,t&&t.loc?new s(o,{cause:o}):o)}var a;(function(e){e.UnrecognisedUri="UnrecognisedUri",e.UnsupportedUriProtocol="UnsupportedUriProtocol"})(a||(a={}));const f={[a.UnrecognisedUri]:"Unrecognised uri - {uri}",[a.UnsupportedUriProtocol]:"Unrecognised uri protocol"};class g extends Error{constructor(t,o){super(u(f[t],o)),this.declaredRootClass="esri.arcade.arcademoduleerror",Error.captureStackTrace&&Error.captureStackTrace(this,g)}}export{p as a,m as c,r as e,u as i,a as l,g as p,d as t,b as u}; diff --git a/assets/featureLayerUtils-6cf06f83.js b/assets/featureLayerUtils-6cf06f83.js new file mode 100644 index 0000000..bcb2587 --- /dev/null +++ b/assets/featureLayerUtils-6cf06f83.js @@ -0,0 +1 @@ +import{cp as P,cw as A,cx as E,ar as o,aw as g,cy as O,c0 as c,b_ as R}from"./index-080e108a.js";import{e as x}from"./sql-734ecbc5.js";import{A as j}from"./UniqueValueRenderer-fef4204d.js";import{c as L}from"./AttachmentQuery-972bbd60.js";import{b as l}from"./Query-1c961d4c.js";import I from"./RelationshipQuery-39c07195.js";const T=new P({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function U(e,t,n,r){const a=await i(e);if(await m(e,t,r),!a.addAttachment)throw new o(r,"Layer source does not support addAttachment capability");return a.addAttachment(t,n)}function m(e,t,n){const{attributes:r}=t,{objectIdField:a}=e;return e.get("capabilities.data.supportsAttachment")?t?r?a&&r[a]?Promise.resolve():Promise.reject(new o(n,`feature is missing the identifying attribute ${a}`)):Promise.reject(new o(n,"'attributes' are required on a feature to query attachments")):Promise.reject(new o(n,"A feature is required to add/delete/update attachments")):Promise.reject(new o(n,"this layer doesn't support attachments"))}async function D(e,t,n,r,a){const s=await i(e);if(await m(e,t,a),!s.updateAttachment)throw new o(a,"Layer source does not support updateAttachment capability");return s.updateAttachment(t,n,r)}async function Q(e,t,n){const{applyEdits:r}=await g(()=>import("./editingSupport-b5feb7b5.js"),["assets/editingSupport-b5feb7b5.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/EditBusLayer-d71787e9.js"]),a=await e.load();return r(a,a.source,t,n)}async function Z(e,t,n){const{uploadAssets:r}=await g(()=>import("./editingSupport-b5feb7b5.js"),["assets/editingSupport-b5feb7b5.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/EditBusLayer-d71787e9.js"]),a=await e.load();return r(a,a.source,t,n)}async function H(e,t,n,r){const a=await i(e);if(await m(e,t,r),!a.deleteAttachments)throw new o(r,"Layer source does not support deleteAttachments capability");return a.deleteAttachments(t,n)}async function J(e,t,n){const r=(await e.load({signal:t==null?void 0:t.signal})).source;if(!r.fetchRecomputedExtents)throw new o(n,"Layer source does not support fetchUpdates capability");return r.fetchRecomputedExtents(t)}async function N(e,t,n,r){var w,b;t=L.from(t),await e.load();const a=e.source,s=e.capabilities;if(!((w=s==null?void 0:s.data)!=null&&w.supportsAttachment))throw new o(r,"this layer doesn't support attachments");const{attachmentTypes:p,objectIds:d,globalIds:u,num:q,size:y,start:F,where:h}=t;if(!((b=s==null?void 0:s.operations)!=null&&b.supportsQueryAttachments)&&((p==null?void 0:p.length)>0||(u==null?void 0:u.length)>0||(y==null?void 0:y.length)>0||q||F||h))throw new o(r,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",t);if(!(d!=null&&d.length||u!=null&&u.length||h))throw new o(r,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",t);if(!a.queryAttachments)throw new o(r,"Layer source does not support queryAttachments capability",t);return a.queryAttachments(t)}async function k(e,t,n,r){const a=await i(e);if(!a.queryObjectIds)throw new o(r,"Layer source does not support queryObjectIds capability");return a.queryObjectIds(l.from(t)??e.createQuery(),n)}async function z(e,t,n,r){const a=await i(e);if(!a.queryFeatureCount)throw new o(r,"Layer source does not support queryFeatureCount capability");return a.queryFeatureCount(l.from(t)??e.createQuery(),n)}async function B(e,t,n,r){const a=await i(e);if(!a.queryExtent)throw new o(r,"Layer source does not support queryExtent capability");return a.queryExtent(l.from(t)??e.createQuery(),n)}async function K(e,t,n,r){const a=await i(e);if(!a.queryRelatedFeatures)throw new o(r,"Layer source does not support queryRelatedFeatures capability");return a.queryRelatedFeatures(I.from(t),n)}async function W(e,t,n,r){const a=await i(e);if(!a.queryRelatedFeaturesCount)throw new o(r,"Layer source does not support queryRelatedFeaturesCount capability");return a.queryRelatedFeaturesCount(I.from(t),n)}async function X(e){const t=e.source;if(t!=null&&t.refresh)try{const{dataChanged:n,updates:r}=await t.refresh();if(r!=null&&(e.sourceJSON={...e.sourceJSON,...r},e.read(r,{origin:"service",url:e.parsedUrl})),n)return!0}catch{}if(e.definitionExpression)try{return(await x(e.definitionExpression,e.fieldsIndex)).hasDateFunctions}catch{}return!1}function Y(e){const t=new l,n=e.get("capabilities.data"),r=e.get("capabilities.query");t.historicMoment=e.historicMoment,t.gdbVersion=e.gdbVersion,t.returnGeometry=!0,r&&(t.compactGeometryEnabled=r.supportsCompactGeometry,t.defaultSpatialReferenceEnabled=r.supportsDefaultSpatialReference),n&&(n.supportsZ&&e.returnZ!=null&&(t.returnZ=e.returnZ),n.supportsM&&e.returnM!=null&&(t.returnM=e.returnM)),t.outFields=["*"];const{timeOffset:a,timeExtent:s}=e;return t.timeExtent=a!=null&&s!=null?s.offset(-a.value,a.unit):s||null,t.multipatchOption=e.geometryType==="multipatch"?"xyFootprint":null,t}function ee(e){const{globalIdField:t,fields:n}=e;if(t)return t;if(n){for(const r of n)if(r.type==="esriFieldTypeGlobalID")return r.name}}function te(e){const{objectIdField:t,fields:n}=e;if(t)return t;if(n){for(const r of n)if(r.type==="esriFieldTypeOID")return r.name}}function re(e){return e.currentVersion?e.currentVersion:e.hasOwnProperty("capabilities")||e.hasOwnProperty("drawingInfo")||e.hasOwnProperty("hasAttachments")||e.hasOwnProperty("htmlPopupType")||e.hasOwnProperty("relationships")||e.hasOwnProperty("timeInfo")||e.hasOwnProperty("typeIdField")||e.hasOwnProperty("types")?10:9.3}async function i(e){return(await e.load()).source}async function S(e,t){if(!c||c.findCredential(e))return;let n;try{const r=await R(e,t);r&&(n=await c.checkSignInStatus(`${r}/sharing`))}catch{}if(n)try{const r=t!=null?t.signal:null;await c.getCredential(e,{signal:r})}catch{}}async function ne(e,t){var r;const n=(r=e.parsedUrl)==null?void 0:r.path;n&&_(e)&&await S(n,t)}function _(e){const t=e.editFieldsInfo;return!(!(t!=null&&t.creatorField)&&!(t!=null&&t.editorField))||(e.userHasUpdateItemPrivileges?e.hasUpdateItemRestrictions:!!e.userHasFullEditingPrivileges&&e.hasFullEditingRestrictions)}function ae(e){var t;return!((t=e.sourceJSON)!=null&&t.isMultiServicesView)&&(e.userHasUpdateItemPrivileges||e.editingEnabled)}const f=A({types:E});function oe(e,t){if(e.defaultSymbol)return e.types&&e.types.length?new j({defaultSymbol:f(e.defaultSymbol,e,t),field:e.typeIdField,uniqueValueInfos:e.types.map(n=>({id:n.id,symbol:f(n.symbol,n,t)}))}):new O({symbol:f(e.defaultSymbol,e,t)})}export{W as A,Y as E,z as F,B as I,ne as M,X as O,K as P,ae as Q,te as R,ee as S,H as b,T as d,J as g,Q as h,N as j,D as m,k as q,oe as v,Z as w,re as x,U as y}; diff --git a/assets/featureLayerUtils-d15eb75b.js b/assets/featureLayerUtils-d15eb75b.js new file mode 100644 index 0000000..e0edb06 --- /dev/null +++ b/assets/featureLayerUtils-d15eb75b.js @@ -0,0 +1 @@ +import{bz as x,aR as y,fn as E,ar as n,fo as L,fp as K,b5 as R,b9 as F,bW as D,fq as j}from"./index-080e108a.js";import{i as f}from"./originUtils-1469eeaf.js";import q from"./FeatureLayer-5c6d2c3b.js";import{r as z}from"./fetchService-82a8c4d0.js";import{o as w}from"./jsonContext-5f3816dc.js";import{i as c,a as M,u as I,l as m}from"./portalItemUtils-792a27e1.js";import"./multiOriginJSONSupportUtils-c978f4c3.js";import"./UniqueValueRenderer-fef4204d.js";import"./diffUtils-590c9088.js";import"./jsonUtils-f73b3833.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./MultiOriginJSONSupport-e4912ffd.js";import"./sql-734ecbc5.js";import"./FeatureLayerBase-7c7dfccb.js";import"./commonProperties-30089b06.js";import"./featureLayerUtils-6cf06f83.js";import"./AttachmentQuery-972bbd60.js";import"./Query-1c961d4c.js";import"./RelationshipQuery-39c07195.js";import"./serviceCapabilitiesUtils-959e798a.js";import"./editsZScale-1b5a53a6.js";import"./queryZScale-8f9616ff.js";import"./FeatureSet-111cb247.js";import"./APIKeyMixin-878a7aa7.js";import"./ArcGISService-83287338.js";import"./CustomParametersMixin-231c4be8.js";import"./EditBusLayer-d71787e9.js";import"./FeatureEffectLayer-4160946c.js";import"./FeatureEffect-86735d98.js";import"./FeatureFilter-00f4be05.js";import"./FeatureReductionLayer-4262cf54.js";import"./LabelClass-2d53c485.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./OperationalLayer-0e8f8b28.js";import"./OrderedLayer-68067459.js";import"./PortalLayer-310c2800.js";import"./TemporalLayer-f17c9161.js";import"./FeatureTemplate-2a7e96c1.js";import"./FeatureType-db96032c.js";import"./fieldProperties-62c55499.js";import"./labelingInfo-144f3d9f.js";import"./versionUtils-f17daa93.js";import"./styleUtils-25825fd6.js";import"./TopFeaturesQuery-e44d05be.js";import"./popupUtils-82ea8abb.js";const U=x.getLogger("esri.layers.FeatureLayer"),d="Feature Service";function u(a,t){return`Layer (title: ${a.title}, id: ${a.id}) of type '${a.declaredClass}' ${t}`}function g(a,t){if(t.type!==d)throw new n("feature-layer:portal-item-wrong-type",u(a,`should have portal item of type "${d}"`))}async function A(a){if(await a.load(),E(a))throw new n("feature-layer:save",u(a,"using an in-memory source cannot be saved to a portal item"))}function Y(a,t){let e=(a.messages??[]).filter(({type:r})=>r==="error").map(({name:r,message:s,details:o})=>new n(r,s,o));if(t!=null&&t.ignoreUnsupported&&(e=e.filter(({name:r})=>r!=="layer:unsupported"&&r!=="symbol:unsupported"&&r!=="symbol-layer:unsupported"&&r!=="property:unsupported"&&r!=="url:unsupported")),e.length>0)throw new n("feature-layer:save","Failed to save feature layer due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:e})}async function b(a,t,e){"beforeSave"in a&&typeof a.beforeSave=="function"&&await a.beforeSave();const r=a.write({},t);return Y(t,e),r}function J(a){const{layer:t,layerJSON:e}=a;return t.isTable?{layers:[],tables:[e]}:{layers:[e],tables:[]}}function v(a){c(a,m.JSAPI),a.typeKeywords&&(a.typeKeywords=a.typeKeywords.filter((t,e,r)=>r.indexOf(t)===e))}function _(a){const t=a.portalItem;if(!t)throw U.error("save: requires the portalItem property to be set"),new n("feature-layer:portal-item-not-set",u(a,"requires the portalItem property to be set"));if(!t.loaded)throw new n("feature-layer:portal-item-not-loaded",u(a,"cannot be saved to a portal item that does not exist or is inaccessible"));g(a,t)}async function N(a,t){return/\/\d+\/?$/.test(a.url??"")?J(t[0]):B(a,t)}async function B(a,t){const{layer:{url:e,customParameters:r,apiKey:s}}=t[0];let o=await a.fetchData("json");o&&o.layers!=null&&o.tables!=null||(o=await C(o,{url:e??"",customParameters:r,apiKey:s},t.map(i=>i.layer.layerId)));for(const i of t)O(i.layer,i.layerJSON,o);return o}async function C(a,t,e){a||(a={}),a.layers||(a.layers=[]),a.tables||(a.tables=[]);const{url:r,customParameters:s,apiKey:o}=t,{serviceJSON:i,layersJSON:l}=await z(r,{customParameters:s,apiKey:o}),p=S(a.layers,i.layers,e),h=S(a.tables,i.tables,e);a.layers=p.itemResources,a.tables=h.itemResources;const P=[...p.added,...h.added],T=l?[...l.layers,...l.tables]:[];return await k(a,P,r,T),a}function S(a,t,e){const r=L(a,t,(o,i)=>o.id===i.id);a=a.filter(o=>!r.removed.some(i=>i.id===o.id));const s=r.added.map(({id:o})=>({id:o}));return s.forEach(({id:o})=>{a.push({id:o})}),{itemResources:a,added:s.filter(({id:o})=>!e.includes(o))}}async function k(a,t,e,r){const s=t.map(({id:o})=>new q({url:e,layerId:o,sourceJSON:r.find(({id:i})=>i===o)}));await K(s.map(o=>o.load())),s.forEach(o=>{const{layerId:i,loaded:l,defaultPopupTemplate:p}=o;!l||p==null||O(o,{id:i,popupInfo:p.toJSON()},a)})}function O(a,t,e){a.isTable?$(e.tables,t):$(e.layers,t)}function $(a,t){if(!a)return;const e=a.findIndex(({id:r})=>r===t.id);e===-1?a.push(t):a[e]=t}function G(a){const{portalItem:t}=a;return j(a)&&!a.dynamicDataSource&&!!(t!=null&&t.loaded)&&t.type===d}async function W(a){if(!(a!=null&&a.length))throw new n("feature-layer-utils-saveall:missing-parameters","'layers' array should contain at least one feature layer");await Promise.all(a.map(r=>r.load()));for(const r of a)if(!G(r))throw new n("feature-layer-utils-saveall:invalid-parameters",`'layers' array should only contain layers or tables in a feature service loaded from 'Feature Service' item. ${u(r,"does not conform")}`,{layer:r});const t=a.map(r=>r.portalItem.id);if(new Set(t).size>1)throw new n("feature-layer-utils-saveall:invalid-parameters","All layers in the 'layers' array should be loaded from the same portal item");const e=a.map(r=>r.layerId);if(new Set(e).size!==e.length)throw new n("feature-layer-utils-saveall:invalid-parameters","'layers' array should contain only one instance each of layer or table in a feature service")}function H(a,t){let e=R.from(t);return e.id&&(e=e.clone(),e.id=null),e.type??(e.type=d),e.portal??(e.portal=F.getDefault()),g(a,e),e}async function Q(a,t){const{url:e,layerId:r,title:s,fullExtent:o,isTable:i}=a,l=D(e),p=l!=null&&l.serverType==="FeatureServer";t.url=p?e:`${e}/${r}`,t.title||(t.title=s),t.extent=null,i||o==null||(t.extent=await M(o)),I(t,m.METADATA),I(t,m.MULTI_LAYER),c(t,m.SINGLE_LAYER),i&&c(t,m.TABLE),v(t)}async function V(a,t,e){var s;const r=a.portal;await(r==null?void 0:r.signIn()),await((s=r==null?void 0:r.user)==null?void 0:s.addItem({item:a,data:t,folder:e==null?void 0:e.folder}))}const Wa=y(X);async function X(a,t){await A(a),_(a);const e=a.portalItem,r=w(e),s=await b(a,r,t),o=await N(e,[{layer:a,layerJSON:s}]);return v(e),await e.update({data:o}),f(r),e}const Ha=y(async(a,t)=>{await W(a);const e=a[0].portalItem,r=w(e),s=await Promise.all(a.map(i=>b(i,r,t))),o=await N(e,a.map((i,l)=>({layer:i,layerJSON:s[l]})));return v(e),await e.update({data:o}),await Promise.all(a.slice(1).map(i=>i.portalItem.reload())),f(r),e.clone()}),Qa=y(Z);async function Z(a,t,e){await A(a);const r=H(a,t),s=w(r),o=J({layer:a,layerJSON:await b(a,s,e)});return await Q(a,r),await V(r,o,e),a.portalItem=r,f(s),r}export{Wa as save,Ha as saveAll,Qa as saveAs}; diff --git a/assets/featureSetUtils-86900014.js b/assets/featureSetUtils-86900014.js new file mode 100644 index 0000000..69ca396 --- /dev/null +++ b/assets/featureSetUtils-86900014.js @@ -0,0 +1 @@ +import{bc as ae,aY as Oe,hr as W,fI as Le,aK as q,cq as G,cn as Ee,fv as Pe,aw as qe,fl as he,fm as fe,ar as je,at as B,cs as Ge,c0 as pe,fB as Be,b5 as Ue}from"./index-080e108a.js";import{al as re,am as I,a2 as Me,af as v,m as We,as as $,at as ne,au as $e,av as X,A as Ve,aw as Qe,ax as V,ay as Je}from"./arcadeUtils-b902d678.js";import{f as k,o as D,n as C,s as N,t as x}from"./WhereClause-c86b9974.js";import{v as L,t as _,m as P,p as Q,a as R,g as ze,L as Ze,T as K,h as _e,R as Ke,A as be,b as Xe,N as J,S as Ye,c as j,d as He,f as et,e as m}from"./SpatialFilter-d44507d6.js";import{c as ye}from"./arcadeTimeUtils-e1438cc8.js";import{x as Ie,a as De}from"./FeatureReductionLayer-4262cf54.js";import{r as tt}from"./FieldsIndex-f79a8f26.js";import T from"./FeatureLayer-5c6d2c3b.js";import{b as A,K as it,m as ge}from"./Query-1c961d4c.js";import{a as st,s as me}from"./executeQueryJSON-7c41ada5.js";import{n as at}from"./executeQueryPBF-0f188593.js";import{d as rt}from"./FeatureSet-111cb247.js";import"./AttachmentInfo-cb670dd0.js";import"./AttachmentQuery-972bbd60.js";import{n as nt,s as lt}from"./executeForIds-5eaf002d.js";import"./normalizeUtils-cf8b8053.js";import"./pbf-d9aa3914.js";import we from"./RelationshipQuery-39c07195.js";import"./TopFeaturesQuery-e44d05be.js";import Ce from"./SubtypeGroupLayer-181166ae.js";import{n as ot}from"./FeatureType-db96032c.js";let Re=class{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection",this._layerById={},this._layerByName={}}add(e,t,i){this._layerById[t]=i,this._layerByName[e]=i}async featureSetByName(e,t=!0,i=["*"]){return this._layerByName[e]===void 0?null:this._layerByName[e]}async featureSetById(e,t=!0,i=["*"]){return this._layerById[e]===void 0?null:this._layerById[e]}castToText(e=!1){return"object, FeatureSetCollection"}},Te=class Y extends L{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.actions.AttributeFilter",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof k?(this._whereclause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereclause=null)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.fields=[],this.typeIdField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new ae({wkid:4326}),this.geometryType=re.point)}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._parent._getFilteredSet("",null,this._whereclause,null,e);return this._checkCancelled(e),this._whereClauseFunction!==null?this._wset=new _(t._candidates.slice(0).concat(t._known.slice(0)),[],t._ordered,this._clonePageDefinition(t.pagesDefinition)):this._wset=new _(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){var i;let t=(i=this._parent)==null?void 0:i._isInFeatureSet(e);return t===I.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?I.Unknown:t)}_getFeature(e,t,i){return this._parent._getFeature(e,t,i)}_getFeatures(e,t,i,s){return this._parent._getFeatures(e,t,i,s)}_featureFromCache(e){return this._parent._featureFromCache(e)}executeWhereClause(e){var t;return((t=this._whereclause)==null?void 0:t.testFeature(e))??!1}async executeWhereClauseDeferred(e){if(this._whereClauseFunction!==null){const t=this._whereClauseFunction(e);return Oe(t),t}return this.executeWhereClause(e)}async _fetchAndRefineFeatures(e,t,i){var a,l,o;const s=new _([],e,!1,null),r=Math.min(t,e.length);if(await((a=this._parent)==null?void 0:a._getFeatures(s,-1,r,i)),this._checkCancelled(i),this._whereClauseFunction==null){for(let u=0;u":case"=":if(e.left.type==="column-reference"&&e.right.type==="string"){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&this.lkp[e.right.value.toString()]!==void 0)return" ("+s+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if(e.right.type==="column-reference"&&e.left.type==="string"&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+s+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,r)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,r)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,r)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,r)+") "}case"null":return"null";case"boolean":return e.value===!0?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":case"date":return K(e.value,t,null);case"number":return e.value.toString();case"current-time":return Ze(e.mode==="date",t);case"column-reference":return i&&i.toLowerCase()===e.column.toLowerCase()?"("+s+")":e.column;case"data-type":return e.value;case"function":{const u=this.evaluateNodeToWhereClause(e.args,t,i,F.BADNESS,r);return ze(e.name,u,t)}}throw new N(x.UnsupportedSyntax,{node:e.type})}extractValue(e){return this.codefield instanceof k?this.reverseLkp[this.codefield.calculateValueCompiled(e)]:this.reverseLkp[e.attributes[this.codefield]]}}F.BADNESS="_!!!_BAD_LKP_!!!!";class dt extends z{constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:Q(e,this.field.name,R(this._sql,v.Standardised),t.getFieldsIndex())}}extractValue(e){return this._sql.calculateValueCompiled(e)}}let ct=class extends L{static findField(e,t){for(const i of e)if(i.name.toLowerCase()===t.toString().toLowerCase())return i;return null}constructor(e){super(e),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=e.extraFilter,this._parent=e.parentfeatureset,this._maxProcessing=30,this.adaptedFields=e.adaptedFields}_initialiseFeatureSet(){this._parent!==null?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new ae({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=re.point,this.typeIdField="",this.types=null),this.fields=[];for(const e of this.adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}async _getSet(e){var t;if(this._wset===null){await this._ensureLoaded();let i=null;return i=this._extraFilter?await this._getFilteredSet("",null,null,null,e):await((t=this._parent)==null?void 0:t._getSet(e)),this._checkCancelled(e),Le(i),this._wset=new _(i._candidates.slice(0),i._known.slice(0),i._ordered,this._clonePageDefinition(i.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){return W(this._parent)._isInFeatureSet(e)}async _getFeatures(e,t,i,s){var u,c;const r=[];t!==-1&&this._featureCache[t]===void 0&&r.push(t);const n=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,n)===!0)return await this._expandPagedSet(e,n,0,0,s),this._getFeatures(e,t,i,s);let a=0;for(let h=e._lastFetchedIndex;h=n)));h++);if(r.length===0)return"success";e=new _([],r,e._ordered,null);const l=Math.min(r.length,i);await((u=this._parent)==null?void 0:u._getFeatures(e,-1,l,s)),this._checkCancelled(s);const o=[];for(let h=0;h0&&(s=s.replaceFields(c))}i!==null?this._extraFilter!==null&&(i=P(this._extraFilter,i)):i=this._extraFilter,await this._ensureLoaded();const o=await W(this._parent)._getFilteredSet(e,t,i,s,r);let u;return this._checkCancelled(r),u=n===!0?new _(o._candidates.slice(0).concat(o._known.slice(0)),[],l===!0&&o._ordered,this._clonePageDefinition(o.pagesDefinition)):new _(o._candidates.slice(0),o._known.slice(0),l===!0&&o._ordered,this._clonePageDefinition(o.pagesDefinition)),u}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(e!==null){for(const i of this.adaptedFields)if(be(e,i.field.name)===!0){const s=i.rewriteSql(e,this);if(s.rewritten!==!0){t.cannot=!0,t.where=null;break}t.where=s.where}}return t}async _stat(e,t,i,s,r,n,a){let l=!1,o=this._reformulateWithoutAdaptions(t);if(l=o.cannot,t=o.where,o=this._reformulateWithoutAdaptions(r),l=l||o.cannot,(r=o.where)!==null?this._extraFilter!==null&&(r=P(this._extraFilter,r)):r=this._extraFilter,l===!0)return r===null&&i===""&&s===null?this._manualStat(e,t,n,a):{calculated:!1};const u=await W(this._parent)._stat(e,t,i,s,r,n,a);return u.calculated===!1?r===null&&i===""&&s===null?this._manualStat(e,t,n,a):{calculated:!1}:u}async _canDoAggregates(e,t,i,s,r){if(this._parent===null)return!1;for(let l=0;l{for(let s=0;s0?(await $(this._refineSetBlock(e,this._maxProcessingRate(),s)),this._checkCancelled(s),this.getIdColumnDictionary(e,t,i,s)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,i,s){return this._parent._getFeatures(e,t,i,s)}_featureFromCache(e){if(this._featureCache[e]===void 0){const t=this._parent._featureFromCache(e);return t===void 0?void 0:t===null?null:(this._featureCache[e]=t,t)}return this._featureCache[e]}async _fetchAndRefineFeatures(){throw new D(C.NeverReach)}async _getFilteredSet(e,t,i,s,r){await this._ensureLoaded();const n=await this._parent._getFilteredSet(e,t,i,s===null?this._orderbyclause:s,r);this._checkCancelled(r);const a=new _(n._candidates.slice(0),n._known.slice(0),n._ordered,this._clonePageDefinition(n.pagesDefinition));let l=!0;if(n._candidates.length>0&&(l=!1),a._ordered===!1){let o=await this.manualOrderSet(a,r);return l===!1&&(t===null&&i===null||(o=new _(o._candidates.slice(0).concat(o._known.slice(0)),[],o._ordered,this._clonePageDefinition(o.pagesDefinition)))),o}return a}static registerAction(){L._featuresetFunctions.orderBy=function(e){return e===""?this:new ke({parentfeatureset:this,orderbyclause:new U(e)})}}};function ht(d){if(d.parseTree.type==="function"){if(d.parseTree.args.value.length===0)return{name:d.parseTree.name,expr:null};if(d.parseTree.args.value.length>1)throw new N(x.MissingStatisticParameters);const e=k.create(Xe(d.parseTree.args.value[0],v.Standardised,d.parameters),d.fieldsIndex);return{name:d.parseTree.name,expr:e}}return null}let Se=class te{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new te;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,i){const s=new te;s.field=e;const r=k.create(t,i),n=ht(r);if(n===null)throw new N(x.UnsupportedSqlFunction,{function:""});const a=n.name.toUpperCase().trim();if(a==="MIN"){if(s.typeofstat="MIN",s.workingexpr=n.expr,r===null)throw new N(x.InvalidFunctionParameters,{function:"min"})}else if(a==="MAX"){if(s.typeofstat="MAX",s.workingexpr=n.expr,r===null)throw new N(x.InvalidFunctionParameters,{function:"max"})}else if(a==="COUNT")s.typeofstat="COUNT",s.workingexpr=n.expr;else if(a==="STDEV"){if(s.typeofstat="STDDEV",s.workingexpr=n.expr,r===null)throw new N(x.InvalidFunctionParameters,{function:"stdev"})}else if(a==="SUM"){if(s.typeofstat="SUM",s.workingexpr=n.expr,r===null)throw new N(x.InvalidFunctionParameters,{function:"sum"})}else if(a==="MEAN"){if(s.typeofstat="AVG",s.workingexpr=n.expr,r===null)throw new N(x.InvalidFunctionParameters,{function:a})}else if(a==="AVG"){if(s.typeofstat="AVG",s.workingexpr=n.expr,r===null)throw new N(x.InvalidFunctionParameters,{function:"avg"})}else{if(a!=="VAR")throw new N(x.UnsupportedSqlFunction,{function:a});if(s.typeofstat="VAR",s.workingexpr=n.expr,r===null)throw new N(x.InvalidFunctionParameters,{function:"var"})}return s}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}};function ft(d){if(!d)return"COUNT";switch(d.toLowerCase()){case"max":return"MAX";case"var":case"variance":return"VAR";case"avg":case"average":case"mean":return"AVG";case"min":return"MIN";case"sum":return"SUM";case"stdev":case"stddev":return"STDDEV";case"count":return"COUNT"}return"COUNT"}let pt=class ve extends L{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField="ROW__ID",this._internalObjectIdField="ROW__ID",this._adaptedFields=[],this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}async _getSet(e){if(this._wset===null){const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,this._wset}return this._wset}_isInFeatureSet(){return I.InFeatureSet}_nextUniqueName(e){for(;e["T"+this._uniqueIds.toString()]===1;)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,i=1;const s=this._parent?this._parent.getFieldsIndex():new tt([]);for(this.objectIdField="ROW__ID",this.globalIdField="";t===!1;){let n=!1;for(let a=0;a0)for(const n of this._parent.fields)this._adaptedFields.push(new H(n));for(let n=0;n0&&(l=new ct({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),a.nowhereclause===!0)n=new _(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new ee({parentfeatureset:l,orderbyclause:new U(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let o=l;if(i!==null){let u=null;i&&(u=this._reformulateWhereClauseWithoutGroupByFields(i)),o=new Te({parentfeatureset:o,whereclause:u})}n=new _(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new ee({parentfeatureset:o,orderbyclause:new U(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return n}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=Q(e,t.tofieldname,R(t.workingexpr,v.Standardised),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=Q(e,t.tofieldname,R(t.expression,v.Standardised),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const i of this._decodedGroupbyfield)i.tofieldname!==i.name&&t.push({field:i.tofieldname,newfield:i.name});return t.length>0?e.replaceFields(t):e}_clonePageDefinition(e){return e===null?null:e.aggregatefeaturesetpagedefinition===!0?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)}async _refineSetBlock(e,t,i){return this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)===!0?(await this._expandPagedSet(e,this._maxQuery,0,0,i),this._refineSetBlock(e,t,i)):(this._checkCancelled(i),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,i,s,r){return this._expandPagedSetFeatureSet(e,t,i,s,r)}async _getPhysicalPage(e,t,i){if(e.pagesDefinition.aggregatefeaturesetpagedefinition===!0)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,i,[]);const s=await this._getAgregagtePhysicalPage(e,t,i);for(const r of s){const n={geometry:r.geometry,attributes:{}},a={};for(const l in r.attributes)a[l.toLowerCase()]=r.attributes[l];for(const l of this._decodedGroupbyfield)n.attributes[l.tofieldname]=a[l.name.toLowerCase()];for(const l of this._decodedStatsfield)n.attributes[l.tofieldname]=a[l.field.toLowerCase()];this._featureCache[n.attributes[this.objectIdField]]=new q(n)}return s.length}_sequentialGetPhysicalItem(e,t,i,s){return new Promise((r,n)=>{e.pagesDefinition.internal.iterator===null&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(i)),e.pagesDefinition.internal.fullyResolved===!0||t===0?r(s.length):this._nextAggregateItem(e,t,i,s,a=>{a===null?r(s.length):(t-=1,r(this._sequentialGetPhysicalItem(e,t,i,s)))},n)})}_nextAggregateItem(e,t,i,s,r,n){try{$(e.pagesDefinition.internal.iterator.next()).then(a=>{if(a===null)if(e.pagesDefinition.internal.workingItem!==null){const l=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);s.push(l),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(l.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,r(null)}else e.pagesDefinition.internal.fullyResolved=!0,r(null);else{const l=this._generateAggregateHash(a);if(e.pagesDefinition.internal.workingItem===null)e.pagesDefinition.internal.workingItem={features:[a],id:l};else{if(l!==e.pagesDefinition.internal.workingItem.id){const o=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return s.push(o),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(o.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[a],id:l},void r(o)}e.pagesDefinition.internal.workingItem.features.push(a)}this._nextAggregateItem(e,t,i,s,r,n)}},n)}catch(a){n(a)}}_calculateFieldStat(e,t,i){const s=[];for(let r=0;rthis._topnum&&(this._wset._known=this._wset._known.slice(0,this._topnum)),this._setKnownLength(this._wset)>=this._topnum&&(this._wset._candidates=[]),this._wset}return this._wset}_setKnownLength(e){return e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"?e._known.length-1:e._known.length}_isInFeatureSet(e){const t=this._parent._isInFeatureSet(e);if(t===I.NotInFeatureSet)return t;const i=this._idstates[e];return i===I.InFeatureSet||i===I.NotInFeatureSet?i:t===I.InFeatureSet&&i===void 0?this._countedinthis._topnum&&(t=this._topnum),this._countedin>=this._topnum&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset){let a=e._known.length;return a>0&&e._known[a-1]==="GETPAGES"&&(e._known.length=a-1),a=e._candidates.length,a>0&&e._candidates[a-1]==="GETPAGES"&&(e._candidates.length=a-1),"success"}const n=await this._parent._expandPagedSet(e,t,i,s,r);return this._setKnownLength(e)>this._topnum&&(e._known.length=this._topnum),this._setKnownLength(e)>=this._topnum&&(e._candidates.length=0),n}async _getFeatures(e,t,i,s){const r=[],n=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,n)===!0)return await this._expandPagedSet(e,n,0,0,s),this._getFeatures(e,t,i,s);t!==-1&&this._featureCache[t]===void 0&&r.push(t);let a=0;for(let u=e._lastFetchedIndex;un)));u++);if(r.length===0)return"success";const l=new _([],r,!1,null),o=Math.min(r.length,i);await this._parent._getFeatures(l,-1,o,s);for(let u=0;u=this._topnum)break}else if(a===I.NotInFeatureSet)s===null?s={start:n,end:n}:s.end===n-1?s.end=n:(r.push(s),s={start:n,end:n}),i+=1;else if(a===I.Unknown)break;if(i>=t)break}s!==null&&r.push(s);for(let n=r.length-1;n>=0;n--)e._candidates.splice(r[n].start,r[n].end-r[n].start+1);this._setKnownLength(e)>this._topnum&&(e._known=e._known.slice(0,this._topnum)),this._setKnownLength(e)>=this._topnum&&(e._candidates=[])}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}static registerAction(){L._featuresetFunctions.top=function(e){return new le({parentfeatureset:this,topnum:e})}}}async function _t(d,e,t,i){return mt(e,await yt(d,e,t,i),t,i)}async function yt(d,e,t,i){var u;const s={...i},r=wt(e,t),n=((u=e.outStatistics)==null?void 0:u[0])!=null,a=Ee("featurelayer-pbf-statistics"),l=!n||a;let o;if((t==null?void 0:t.format)==="pbf"&&l)try{o=await at(d,r,s)}catch(c){if(c.name!=="query:parsing-pbf")throw c;t.format="json"}return(t==null?void 0:t.format)!=="json"&&l||(o=await st(d,r,s)),gt(t==null?void 0:t.fieldsIndex,o.fields),o}function gt(d,e){if(d!=null&&e!=null)for(const t of e){const i=d.get(t.name);i&&Object.assign(t,i.toJSON())}}async function mt(d,e,t,i){const s=t==null?void 0:t.infoFor3D;if(!(Ne(d,s)&&s!=null&&e.assetMaps&&e.features&&e.features.length))return rt.fromJSON(e);const{meshFeatureSetFromJSON:r}=await Pe(qe(()=>import("./meshFeatureSet-8442b8e6.js"),["assets/meshFeatureSet-8442b8e6.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/FeatureSet-111cb247.js"]),i);return r(d,s,e)}function wt(d,e){let t=A.from(d);t.sourceSpatialReference=t.sourceSpatialReference??(e==null?void 0:e.sourceSpatialReference)??null,(e!=null&&e.gdbVersion||e!=null&&e.dynamicDataSource)&&(t=t===d?t.clone():t,t.gdbVersion=d.gdbVersion||e.gdbVersion,t.dynamicDataSource=d.dynamicDataSource?it.from(d.dynamicDataSource):e.dynamicDataSource);const i=e==null?void 0:e.infoFor3D;if(i!=null&&Ne(d,i)){t=t===d?t.clone():t,t.formatOf3DObjects=null;const{supportedFormats:s,queryFormats:r}=i,n=he("model/gltf-binary",s)??fe("glb",s),a=he("model/gltf+json",s)??fe("gtlf",s);for(const l of r){if(l===n){t.formatOf3DObjects=l;break}l!==a||t.formatOf3DObjects||(t.formatOf3DObjects=l)}if(!t.formatOf3DObjects)throw new je("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outFields==null||!t.outFields.includes("*")){t=t===d?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:l,originY:o,originZ:u,translationX:c,translationY:h,translationZ:p,scaleX:y,scaleY:g,scaleZ:b,rotationX:S,rotationY:f,rotationZ:w,rotationDeg:M}=i.transformFieldRoles;t.outFields.push(l,o,u,c,h,p,y,g,b,S,f,w,M)}}return t}function Ne(d,e){return e!=null&&d.returnGeometry===!0&&d.multipatchOption!=="xyFootprint"&&!d.outStatistics}let Ft=class ie extends L{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this.formulaCredential=null,this._pageJustIds=!1,this._requestStandardised=!1,this._useDefinitionExpression=!0,this._cachedDateMetaData={},e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return ne}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+$e(e.toJSON());return Ie(t,De.String)}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){var e,t,i,s,r,n;if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this.hasZ=((i=(t=(e=this._layer)==null?void 0:e.capabilities)==null?void 0:t.data)==null?void 0:i.supportsZ)===!0,this.hasM=((n=(r=(s=this._layer)==null?void 0:s.capabilities)==null?void 0:r.data)==null?void 0:n.supportsM)===!0,this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const a=[],l=[];for(const o of this.fields)if(o.type==="oid")a.push(o),l.push(o.name);else for(const u of this._overrideFields)if(u.toLowerCase()===o.name.toLowerCase()){a.push(o),l.push(o.name);break}this.fields=a,this._overrideFields=l}if(this._layer.source&&this._layer.source.sourceJSON){const a=this._layer.source.sourceJSON.currentVersion;this._layer.source.sourceJSON.useStandardizedQueries===!0?(this._databaseType=v.StandardisedNoInterval,a!=null&&a>=10.61&&(this._databaseType=v.Standardised)):a!=null&&(a>=10.5&&(this._databaseType=v.StandardisedNoInterval,this._requestStandardised=!0),a>=10.61&&(this._databaseType=v.Standardised))}this.objectIdField=this._layer.objectIdField;for(const a of this.fields)a.type==="global-id"&&(this.globalIdField=a.name);this._layer instanceof Ce?(this.typeIdField=this._layer.subtypeField??"",this.types=this._layer.subtypes):(this.typeIdField=this._layer.typeIdField??"",this.types=this._layer.types)}_isInFeatureSet(){return I.InFeatureSet}async _refineSetBlock(e){return e}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new A;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||this._layer.capabilities.query.supportsPagination!==!0)}_cacheableFeatureSetSourceKey(){return this._layer.url}pbfSupportedForQuery(e){var i,s;const t=(s=(i=this._layer)==null?void 0:i.capabilities)==null?void 0:s.query;return!e.outStatistics&&(t==null?void 0:t.supportsFormatPBF)===!0&&(t==null?void 0:t.supportsQuantizationEditMode)===!0}async queryPBF(e){return e.quantizationParameters={mode:"edit"},(await _t(this._layer.parsedUrl,e,{format:"pbf"},{})).unquantize()}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}executeQuery(e,t){e.returnZ=this.hasZ,e.returnM=this.hasM;const i=t==="execute"?me:t==="executeForCount"?nt:lt,s=t==="execute"&&this.pbfSupportedForQuery(e);let r=null;if(this.recentlyUsedQueries){const n=this.convertQueryToLruCacheKey(e);r=this.recentlyUsedQueries.getFromCache(n),r===null&&(r=s!==!0?i(this._layer.parsedUrl.path,e):this.queryPBF(e),this.recentlyUsedQueries.addToCache(n,r),r=r.catch(a=>{var l;throw(l=this.recentlyUsedQueries)==null||l.removeFromCache(n),a}))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),r===null&&(r=s!==!0?i(this._layer.parsedUrl.path,e):this.queryPBF(e)),r}async _getFilteredSet(e,t,i,s,r){const n=await this.databaseType();if(this.isTable()&&t&&e!==null&&e!=="")return new _([],[],!0,null);if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,i,s,r);let a="",l=!1;s!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(a=s.constructClause(),l=!0);const o=new A;this.datesInUnknownTimezone&&(o.timeReferenceUnknownClient=!0),o.where=i===null?t===null?"1=1":"":R(i,n),this._requestStandardised&&(o.sqlFormat="standard"),o.spatialRelationship=this._makeRelationshipEnum(e),o.outSpatialReference=this.spatialReference,o.orderByFields=a!==""?a.split(","):null,o.geometry=t===null?null:t,o.relationParameter=this._makeRelationshipParam(e);let u=await this.executeQuery(o,"executeForIds");return u===null&&(u=[]),this._checkCancelled(r),new _([],u,l,null)}_expandPagedSet(e,t,i,s,r){return this._expandPagedSetFeatureSet(e,t,i,s,r)}async _getFilteredSetUsingPaging(e,t,i,s,r){var p;let n="",a=!1;s!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(n=s.constructClause(),a=!0);const l=await this.databaseType();let o=i===null?t===null?"1=1":"":R(i,l);this._layer.definitionExpression&&this._useDefinitionExpression&&(o=o!==""?"(("+this._layer.definitionExpression+") AND ("+o+"))":this._layer.definitionExpression);let u=this._maxQueryRate();const c=(p=this._layer.capabilities)==null?void 0:p.query.maxRecordCount;c!=null&&c=this._maxProcessingRate()-1))break}if(n>=i&&r.length===0)break}if(r.length===0)return"success";const a=new A;this._requestStandardised&&(a.sqlFormat="standard"),this.datesInUnknownTimezone&&(a.timeReferenceUnknownClient=!0),a.objectIds=r,a.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),a.returnGeometry=!0,this._removeGeometry===!0&&(a.returnGeometry=!1),a.outSpatialReference=this.spatialReference;const l=await this.executeQuery(a,"execute");if(this._checkCancelled(s),l.error!==void 0)throw new D(C.RequestFailed,{reason:l.error});const o=this._layer.objectIdField;for(let u=0;u=a)break}return g.features.length===0?l:g.features.length===((S=this._layer.capabilities)==null?void 0:S.query.maxRecordCount)&&l.length"+e.pagesDefinition.internal.lastMaxId.toString()+")":e.pagesDefinition.generatedOid+">"+e.pagesDefinition.internal.lastMaxId.toString());const r=e.pagesDefinition.internal.lastRetrieved,n=r,a=e.pagesDefinition.internal.lastPage,l=new A;if(this._requestStandardised&&(l.sqlFormat="standard"),l.where=s,l.spatialRelationship=e.pagesDefinition.spatialRel,l.relationParameter=e.pagesDefinition.relationParam,l.outFields=e.pagesDefinition.outFields,l.outStatistics=e.pagesDefinition.outStatistics,l.geometry=e.pagesDefinition.geometry,l.groupByFieldsForStatistics=e.pagesDefinition.groupByFieldsForStatistics,l.num=e.pagesDefinition.resultRecordCount,l.start=e.pagesDefinition.internal.lastPage,l.returnGeometry=e.pagesDefinition.returnGeometry,this.datesInUnknownTimezone&&(l.timeReferenceUnknownClient=!0),l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,this.isTable()&&l.geometry&&l.spatialRelationship)return[];const o=await this.executeQuery(l,"execute");if(this._checkCancelled(i),!o.hasOwnProperty("features"))throw new D(C.InvalidStatResponse);const u=[];if(e.pagesDefinition.internal.lastPage!==a)return[];o.features.length>0&&o.features[0].attributes[e.pagesDefinition.generatedOid]===void 0&&(e.pagesDefinition.generatedOid=e.pagesDefinition.generatedOid.toLowerCase());for(let c=0;c0||i&&i>0)&&(a.size=[t&&t>0?t:0,i&&i>0?i:t+1]),s&&s.length>0&&(a.attachmentTypes=s),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:a,method:"attachments"});const l=await this._layer.queryAttachments(a),o=[];return l&&l[e]&&l[e].forEach(u=>{const c=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+u.id.toString();let h=null;r&&u.exifInfo&&(h=Ve.convertJsonToArcade(u.exifInfo,"system",!0)),o.push(new Qe(u.id,u.name,u.contentType,u.size,c,h,u.keywords??null))}),o}return[]}async queryRelatedFeatures(e){var s;const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:(s=e.outFields)==null?void 0:s.join(","),returnGeometry:e.returnGeometry.toString()};e.resultOffset!==void 0&&e.resultOffset!==null&&(t.resultOffset=e.resultOffset.toString()),e.resultRecordCount!==void 0&&e.resultRecordCount!==null&&(t.resultRecordCount=e.resultRecordCount.toString()),e.orderByFields&&(t.orderByFields=e.orderByFields.join(",")),e.objectIds&&e.objectIds.length>0&&(t.objectIds=e.objectIds.join(",")),e.outSpatialReference&&(t.outSR=JSON.stringify(e.outSpatialReference.toJSON())),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const i=await B(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(i.data){const r={},n=i.data;if(n&&n.relatedRecordGroups){const a=n.spatialReference;for(const l of n.relatedRecordGroups){const o=l.objectId,u=[];for(const c of l.relatedRecords){c.geometry&&(c.geometry.spatialReference=a);const h=new q({geometry:c.geometry?Ge(c.geometry):null,attributes:c.attributes});u.push(h)}r[o]={features:u,exceededTransferLimit:n.exceededTransferLimit===!0}}}return r}throw new D(C.InvalidRequest)}async getFeatureByObjectId(e,t){const i=new A;i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=this.objectIdField+"="+e.toString(),this.datesInUnknownTimezone&&(i.timeReferenceUnknownClient=!0),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:i,method:"execute"});const s=await me(this._layer.parsedUrl.path,i);return s.features.length===1?s.features[0]:null}async getIdentityUser(){var t;await this.load();const e=(t=pe)==null?void 0:t.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){var s;await this.load();const e=(s=pe)==null?void 0:s.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const i=t.toLowerCase().indexOf("/rest/services");if(t=i>-1?t.substring(0,i):t,t){t+="/rest/info";try{const r=await B(t,{query:{f:"json"}});let n="";return r.data&&r.data.owningSystemUrl&&(n=r.data.owningSystemUrl),n}catch{return""}}return""}getDataSourceFeatureSet(){const e=new ie({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this.recentlyUsedQueries??void 0,interceptor:this.featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeReference(){var e,t;return this._cachedDateMetaData.preferredTimeReference===void 0&&(this._cachedDateMetaData.preferredTimeReference=((t=(e=this._layer)==null?void 0:e.preferredTimeReference)==null?void 0:t.toJSON())??null),this._cachedDateMetaData.preferredTimeReference}get dateFieldsTimeReference(){var e,t;return this._cachedDateMetaData.dateFieldsTimeReference===void 0&&(this._cachedDateMetaData.dateFieldsTimeReference=((t=(e=this._layer)==null?void 0:e.dateFieldsTimeReference)==null?void 0:t.toJSON())??null),this._cachedDateMetaData.dateFieldsTimeReference}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone}get editFieldsInfo(){var e,t;return this._cachedDateMetaData.editFieldsInfo===void 0&&(this._cachedDateMetaData.editFieldsInfo=((t=(e=this._layer)==null?void 0:e.editFieldsInfo)==null?void 0:t.toJSON())??null),this._cachedDateMetaData.editFieldsInfo}get timeInfo(){var e,t;return this._cachedDateMetaData.timeInfo===void 0&&(this._cachedDateMetaData.timeInfo=((t=(e=this._layer)==null?void 0:e.timeInfo)==null?void 0:t.toJSON())??null),this._cachedDateMetaData.timeInfo}};class oe extends L{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.isTable===!0&&(this._forceIsTable=!0),e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return ne}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){var e,t,i,s,r,n;if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const a=[],l=[];for(const o of this.fields)if(o.type==="oid")a.push(o),l.push(o.name);else for(const u of this._overrideFields)if(u.toLowerCase()===o.name.toLowerCase()){a.push(o),l.push(o.name);break}this.fields=a,this._overrideFields=l}this.objectIdField=this._layer.objectIdField;for(const a of this.fields)a.type==="global-id"&&(this.globalIdField=a.name);this._databaseType=v.Standardised,this.hasZ=((i=(t=(e=this._layer)==null?void 0:e.capabilities)==null?void 0:t.data)==null?void 0:i.supportsZ)===!0,this.hasM=((n=(r=(s=this._layer)==null?void 0:s.capabilities)==null?void 0:r.data)==null?void 0:n.supportsM)===!0,this._layer instanceof Ce?(this.typeIdField=this._layer.subtypeField??"",this.types=this._layer.subtypes):(this.typeIdField=this._layer.typeIdField??"",this.types=this._layer.types)}isTable(){return this._forceIsTable||this._layer.isTable||this._layer.type==="table"||!this._layer.geometryType}_isInFeatureSet(){return I.InFeatureSet}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(e){const t={};for(const i of this.fields)t[i.name]=e.attributes[i.name];return new q({geometry:this._removeGeometry===!0?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,s,r){let n="",a=!1;if(s!==null&&(n=s.constructClause(),a=!0),this.isTable()&&t&&e!==null&&e!=="")return new _([],[],!0,null);const l=new A;l.returnZ=this.hasZ,l.returnM=this.hasM,l.where=i===null?t===null?"1=1":"":R(i,v.Standardised),l.spatialRelationship=this._makeRelationshipEnum(e),l.outSpatialReference=this.spatialReference,l.orderByFields=n!==""?n.split(","):null,l.geometry=t===null?null:t,l.returnGeometry=!0,l.relationParameter=this._makeRelationshipParam(e);const o=await this._layer.queryFeatures(l);if(o===null)return new _([],[],a,null);this._checkCancelled(r);const u=[];return o.features.forEach(c=>{const h=c.attributes[this._layer.objectIdField];u.push(h),this._featureCache[h]=this._changeFeature(c)}),new _([],u,a,null)}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _queryAllFeatures(){if(this._wset)return this._wset;const e=new A;if(e.where="1=1",await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const s=[];return this._layer.source.items.forEach(r=>{const n=r.attributes[this._layer.objectIdField];s.push(n),this._featureCache[n]=this._changeFeature(r)}),this._wset=new _([],s,!1,null),this._wset}e.returnZ=this.hasZ,e.returnM=this.hasM;const t=await this._layer.queryFeatures(e),i=[];return t.features.forEach(s=>{const r=s.attributes[this._layer.objectIdField];i.push(r),this._featureCache[r]=this._changeFeature(s)}),this._wset=new _([],i,!1,null),this._wset}async _getFeatures(e,t,i){const s=[];t!==-1&&this._featureCache[t]===void 0&&s.push(t);for(let r=e._lastFetchedIndex;ri)));r++);if(s.length===0)return"success";throw new D(C.MissingFeatures)}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const i in e)t[i]=e[i];return t}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){var y,g,b,S;let i=e.layerDefinition.objectIdField;const s=e.layerDefinition.typeIdField??"",r=[];if(e.layerDefinition.types)for(const f of e.layerDefinition.types)r.push(ot.fromJSON(f));let n=e.layerDefinition.geometryType;n===void 0&&(n=e.featureSet.geometryType||"");let a=e.featureSet.features;const l=t.toJSON();if(!i){let f=!1;for(const w of e.layerDefinition.fields)if(w.type==="oid"||w.type==="esriFieldTypeOID"){i=w.name,f=!0;break}if(f===!1){let w="FID",M=!0,ce=0;for(;M;){let E=!0;for(const Ae of e.layerDefinition.fields)if(Ae.name===w){E=!1;break}E===!0?M=!1:(ce++,w="FID"+ce.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:w,alias:w});const Z=[];for(let E=0;Ef.name):["*"]);o.outFields=u,o.relationshipId=this.relationship.id,o.where="1=1";let c=!0;this._removeGeometry===!0&&(c=!1),o.returnGeometry=c,this._requestStandardised&&(o.sqlFormat="standard"),o.outSpatialReference=this.spatialReference,o.orderByFields=a!==""?a.split(","):null;const h=await n.source.queryRelatedFeatures(o);this._checkCancelled(r);const p=h[this._findObjectId]?h[this._findObjectId].features:[],y=[];for(let f=0;fw.name):["*"]);return y=new _(h||p?["GETPAGES"]:[],h||p?[]:["GETPAGES"],a,{outFields:b.join(","),resultRecordCount:u,resultOffset:0,objectIds:[this._findObjectId],where:o,orderByFields:n,returnGeometry:g,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(y,u,0,0,r),y}_expandPagedSet(e,t,i,s,r){return this._expandPagedSetFeatureSet(e,t,i,s,r)}_clonePageDefinition(e){return e===null?null:e.groupbypage!==!0?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,i){const s=e.pagesDefinition.internal.lastRetrieved,r=s,n=e.pagesDefinition.internal.lastPage,a=this._layer.nativeCapabilities(),l=new we;this._requestStandardised===!0&&(l.sqlFormat="standard"),l.relationshipId=this.relationship.id,l.objectIds=e.pagesDefinition.objectIds,l.resultOffset=e.pagesDefinition.internal.lastPage,l.resultRecordCount=e.pagesDefinition.resultRecordCount,l.outFields=e.pagesDefinition.outFields.split(","),l.where=e.pagesDefinition.where,l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,l.returnGeometry=e.pagesDefinition.returnGeometry,l.outSpatialReference=this.spatialReference;const o=await a.source.queryRelatedFeatures(l);if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==n)return 0;const u=o[this._findObjectId]?o[this._findObjectId].features:[];for(let h=0;hi)))&&!(a>=i&&r.length===0);l++);if(r.length===0)return"success";throw new D(C.MissingFeatures)}async _refineSetBlock(e,t,i){return e}async _stat(e,t,i,s,r,n,a){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,i,s,r){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,i,s,r){return this._relatedLayer.queryAttachments(e,t,i,s,r)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeReference(){var e;return((e=this._relatedLayer)==null?void 0:e.preferredTimeReference)??null}get dateFieldsTimeReference(){var e;return((e=this._relatedLayer)==null?void 0:e.dateFieldsTimeReference)??null}get datesInUnknownTimezone(){var e;return(e=this._relatedLayer)==null?void 0:e.datesInUnknownTimezone}get editFieldsInfo(){var e;return((e=this._relatedLayer)==null?void 0:e.editFieldsInfo)??null}get timeInfo(){var e;return((e=this._relatedLayer)==null?void 0:e.timeInfo)??null}}function bt(){m.applicationCache===null&&(m.applicationCache=new m)}async function se(d,e){if(m.applicationCache){const t=m.applicationCache.getLayerInfo(d);if(t){const r=await t;return new T({url:d,outFields:e,sourceJSON:r})}const i=new T({url:d,outFields:e}),s=(async()=>(await i.load(),i.sourceJSON))();if(m.applicationCache){m.applicationCache.setLayerInfo(d,s);try{return await s,i}catch(r){throw m.applicationCache.clearLayerInfo(d),r}}return await s,i}return new T({url:d,outFields:e})}async function ue(d,e,t,i,s,r=null){return O(await se(d,["*"]),e,t,i,s,r)}function O(d,e=null,t=null,i=!0,s=null,r=null){var n;if(d instanceof T||V(d)){const a={layer:d,spatialReference:e,outFields:t,includeGeometry:i,lrucache:s,interceptor:r};return d.url||!d.source?new Ft(a):new oe(a)}return O(d.parent,e,t,i,s,r).filter(k.create(d.parent.subtypeField+"="+d.subtypeCode.toString(),(n=d.parent)==null?void 0:n.fieldsIndex))}async function It(d){if(m.applicationCache!==null){const t=m.applicationCache.getLayerInfo(d);if(t!==null)return t}const e=(async()=>{const t=await B(d,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(m.applicationCache!==null){m.applicationCache.setLayerInfo(d,e);try{return await e}catch(t){throw m.applicationCache.clearLayerInfo(d),t}}return e}async function Dt(d,e){const t="QUERYDATAELEMTS:"+e.toString()+":"+d;if(m.applicationCache!==null){const s=m.applicationCache.getLayerInfo(t);if(s!==null)return s}const i=(async()=>{const s=await B(d+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([e.toString()]),f:"json"}});if(s.data){const r=s.data;if(r.layerDataElements&&r.layerDataElements[0])return r.layerDataElements[0]}throw new D(C.DataElementsNotFound)})();if(m.applicationCache!==null){m.applicationCache.setLayerInfo(t,i);try{return await i}catch(s){throw m.applicationCache.clearLayerInfo(t),s}}return i}async function xe(d){if(m.applicationCache!==null){const t=m.applicationCache.getLayerInfo(d);if(t!==null)return t}const e=(async()=>{const t=await B(d,{responseType:"json",query:{f:"json"}});if(t.data){const i=t.data;return i.layers||(i.layers=[]),i.tables||(i.tables=[]),i}return{layers:[],tables:[]}})();if(m.applicationCache!==null){m.applicationCache.setLayerInfo(d,e);try{return await e}catch(t){throw m.applicationCache.clearLayerInfo(d),t}}return e}async function Ct(d,e){const t={metadata:null,networkId:-1,unVersion:3,terminals:[],queryelem:null,layerNameLkp:{},lkp:null},i=await xe(d);if(t.metadata=i,i.controllerDatasetLayers&&i.controllerDatasetLayers.utilityNetworkLayerId!==void 0&&i.controllerDatasetLayers.utilityNetworkLayerId!==null){if(i.layers)for(const n of i.layers)t.layerNameLkp[n.id]=n.name;if(i.tables)for(const n of i.tables)t.layerNameLkp[n.id]=n.name;const s=i.controllerDatasetLayers.utilityNetworkLayerId;t.networkId=s;const r=await Dt(d,s);if(r){t.queryelem=r,t.queryelem&&t.queryelem.dataElement&&t.queryelem.dataElement.schemaGeneration!==void 0&&(t.unVersion=t.queryelem.dataElement.schemaGeneration),t.lkp={},t.queryelem.dataElement.domainNetworks||(t.queryelem.dataElement.domainNetworks=[]);for(const a of t.queryelem.dataElement.domainNetworks){for(const l of a.edgeSources??[]){const o={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]??null};o.className&&(t.lkp[o.className]=o)}for(const l of a.junctionSources??[]){const o={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]??null};o.className&&(t.lkp[o.className]=o)}}if(t.queryelem.dataElement.terminalConfigurations)for(const a of t.queryelem.dataElement.terminalConfigurations)for(const l of a.terminals)t.terminals.push({terminalId:l.terminalId,terminalName:l.terminalName});const n=await It(d+"/"+s);if(n.systemLayers&&n.systemLayers.associationsTableId!==void 0&&n.systemLayers.associationsTableId!==null){const a=[];t.unVersion>=4&&(a.push("STATUS"),a.push("PERCENTALONG"));let l=await ue(d+"/"+n.systemLayers.associationsTableId.toString(),e,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...a],!1,null,null);return await l.load(),t.unVersion>=4&&(l=l.filter(k.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62,63)",l.getFieldsIndex())),await l.load()),{lkp:t.lkp,associations:l,unVersion:t.unVersion,terminals:t.terminals}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}async function Rt(d,e,t,i=null,s=null,r=!0,n=null,a=null){let l=d.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+e.relatedTableId.toString():l+"/"+e.relatedTableId.toString();const o=await ue(l,i,s,r,n,a);return new St({layer:d,relatedLayer:o,relationship:e,objectId:t,spatialReference:i,outFields:s,includeGeometry:r,lrucache:n,interceptor:a})}Te.registerAction(),pt.registerAction(),ee.registerAction(),et.registerAction(),le.registerAction();class Tt extends Re{constructor(e,t=null,i=null,s=null){super(),this._map=e,this._overridespref=t,this._lrucache=i,this._interceptor=s,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,i=null){const s=O(e,this._overridespref,i===null?["*"]:i,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:s,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),s}async featureSetByName(e,t=!0,i=null){if(this._map.loaded!==void 0&&this._map.load!==void 0&&this._map.loaded===!1)return await this._map.load(),this.featureSetByName(e,t,i);i===null&&(i=["*"]),i=(i=i.slice(0)).sort();const s=JSON.stringify(i);for(let a=0;a{if(a instanceof T){if(a.title===e)return!0}else if(V(a)){if(a.title===e)return!0;r.push(a)}return!1});if(n)return this._makeAndAddFeatureSet(n,t,i);if(this._map.tables){const a=this._map.tables.find(l=>!!(l.title&&l.title===e||l.title&&l.title===e));if(a){if(a instanceof T)return this._makeAndAddFeatureSet(a,t,i);if(!a._materializedTable){const l=a.outFields?a:{...a,outFields:["*"]};a._materializedTable=new T(l)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,i)}}for(const a of r){if(a.loadStatus==="not-loaded"||a.loadStatus==="loading")try{await a.load()}catch{}const l=a.sublayers.find(o=>o.title===e);if(l)return this._makeAndAddFeatureSet(l,t,i)}return null}async featureSetById(e,t=!0,i=["*"]){if(this._map.loaded!==void 0&&this._map.load!==void 0&&this._map.loaded===!1)return await this._map.load(),this.featureSetById(e,t,i);i===null&&(i=["*"]),i=(i=i.slice(0)).sort();const s=JSON.stringify(i);for(let a=0;a{if(a instanceof T){if(a.id===e)return!0}else if(V(a)){if(a.id===e)return!0;r.push(a)}return!1});if(n)return this._makeAndAddFeatureSet(n,t,i);if(this._map.tables){const a=this._map.tables.find(l=>l.id===e);if(a){if(a instanceof T)return this._makeAndAddFeatureSet(a,t,i);if(!a._materializedTable){const l={...a,outFields:["*"]};a._materializedTable=new T(l)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,i)}}for(const a of r){if(a.loadStatus==="not-loaded"||a.loadStatus==="loading")try{await a.load()}catch{}const l=a.sublayers.find(o=>o.id===e);if(l)return this._makeAndAddFeatureSet(l,t,i)}return null}}class de extends Re{constructor(e,t=null,i=null,s=null){super(),this._url=e,this._overridespref=t,this._lrucache=i,this._interceptor=s,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,i=null){const s=O(e,this._overridespref,i===null?["*"]:i,t,this._lrucache);return this._instantLayers.push({featureset:s,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),s}async _loadMetaData(){const e=await xe(this._url);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new de(this._url,this._overridespref,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,i=null){i===null&&(i=["*"]),i=(i=i.slice(0)).sort();const s=JSON.stringify(i);for(let a=0;a0){const E=[];for(let i=0;i{if(A(e,1,2,n,a),L(e[0])){if(await e[0].load(),e.length===1||e[1]===null)return e[0].dateTimeReferenceFieldIndex.layerDateFieldsTimeZone;if(!(e[1]instanceof R)||e[1].hasField("type")===!1)throw new p(n,y.InvalidParameter,a);const u=e[1].field("type");if(P(u)===!1)throw new p(n,y.InvalidParameter,a);switch(x(u).toLowerCase()){case"preferredtimezone":return e[0].dateTimeReferenceFieldIndex.layerPreferredTimeZone;case"editfieldsinfo":return e[0].dateTimeReferenceFieldIndex.layerEditFieldsTimeZone;case"timeinfo":return e[0].dateTimeReferenceFieldIndex.layerTimeInfoTimeZone;case"field":if(e[1].hasField("fieldname")&&P(e[1].field("fieldname")))return e[0].dateTimeReferenceFieldIndex.fieldTimeZone(x(e[1].field("fieldname")))}throw new p(n,y.InvalidParameter,a)}const i=we(e[0],Ie(n));if(i===null)return null;const t=i.timeZone;return t==="system"?ge.systemTimeZoneCanonicalName:t})},o.functions.sqltimestamp=function(n,a){return o.standardFunctionAsync(n,a,async(d,E,e)=>{A(e,1,3,n,a);const i=e[0];if(se(i)){if(e.length===1)return i.toSQLString();if(e.length===2)return i.changeTimeZone(x(e[1])).toSQLString();throw new p(n,y.InvalidParameter,a)}if(L(i)){if(e.length!==3)throw new p(n,y.InvalidParameter,a);await i.load();const t=x(e[1]);if(se(e[2])===!1)throw new p(n,y.InvalidParameter,a);const u=i.fieldTimeZone(t);return u===null?e[2].toSQLString():e[2].changeTimeZone(u).toSQLString()}throw new p(n,y.InvalidParameter,a)})},o.signatures.push({name:"sqltimestamp",min:2,max:4}),o.functions.featuresetbyid=function(n,a){return o.standardFunctionAsync(n,a,(d,E,e)=>{if(A(e,2,4,n,a),e[0]instanceof le){const i=x(e[1]);let t=S(e[2],null);const u=j(S(e[3],!0));if(t===null&&(t=["*"]),N(t)===!1)throw new p(n,y.InvalidParameter,a);return e[0].featureSetById(i,u,t)}throw new p(n,y.InvalidParameter,a)})},o.signatures.push({name:"featuresetbyid",min:2,max:4}),o.functions.getfeatureset=function(n,a){return o.standardFunctionAsync(n,a,(d,E,e)=>{if(A(e,1,2,n,a),q(e[0])){let i=S(e[1],"datasource");return i===null&&(i="datasource"),i=x(i).toLowerCase(),Ae(e[0].fullSchema(),i,n.lrucache,n.interceptor,n.spatialReference)}throw new p(n,y.InvalidParameter,a)})},o.signatures.push({name:"getfeatureset",min:1,max:2}),o.functions.featuresetbyportalitem=function(n,a){return o.standardFunctionAsync(n,a,(d,E,e)=>{var l;if(A(e,2,5,n,a),e[0]===null)throw new p(n,y.PortalRequired,a);if(e[0]instanceof Fe){const r=x(e[1]),s=x(e[2]);let f=S(e[3],null);const h=j(S(e[4],!0));if(f===null&&(f=["*"]),N(f)===!1)throw new p(n,y.InvalidParameter,a);let g=null;return g=n.services&&n.services.portal?n.services.portal:de.getDefault(),g=Me(e[0],g),fe(r,s,n.spatialReference,f,h,g,n.lrucache,n.interceptor)}if(P(e[0])===!1)throw new p(n,y.PortalRequired,a);const i=x(e[0]),t=x(e[1]);let u=S(e[2],null);const m=j(S(e[3],!0));if(u===null&&(u=["*"]),N(u)===!1)throw new p(n,y.InvalidParameter,a);return fe(i,t,n.spatialReference,u,m,((l=n.services)==null?void 0:l.portal)??de.getDefault(),n.lrucache,n.interceptor)})},o.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),o.functions.featuresetbyname=function(n,a){return o.standardFunctionAsync(n,a,(d,E,e)=>{if(A(e,2,4,n,a),e[0]instanceof le){const i=x(e[1]);let t=S(e[2],null);const u=j(S(e[3],!0));if(t===null&&(t=["*"]),N(t)===!1)throw new p(n,y.InvalidParameter,a);return e[0].featureSetByName(i,u,t)}throw new p(n,y.InvalidParameter,a)})},o.signatures.push({name:"featuresetbyname",min:2,max:4}),o.functions.featureset=function(n,a){return o.standardFunction(n,a,(d,E,e)=>{var u;A(e,1,1,n,a);let i=e[0];const t={layerDefinition:{geometryType:"",objectIdField:"",hasM:!1,hasZ:!1,globalIdField:"",typeIdField:"",fields:[]},featureSet:{geometryType:"",features:[]}};if(P(i))i=JSON.parse(i),i.layerDefinition!==void 0?(t.layerDefinition=i.layerDefinition,t.featureSet=i.featureSet,i.layerDefinition.spatialReference&&(t.layerDefinition.spatialReference=i.layerDefinition.spatialReference)):(t.featureSet.features=i.features,t.featureSet.geometryType=i.geometryType,t.layerDefinition.geometryType=t.featureSet.geometryType,t.layerDefinition.objectIdField=i.objectIdFieldName??"",t.layerDefinition.typeIdField=i.typeIdFieldName,t.layerDefinition.globalIdField=i.globalIdFieldName,t.layerDefinition.fields=i.fields,i.spatialReference&&(t.layerDefinition.spatialReference=i.spatialReference));else{if(!(e[0]instanceof R))throw new p(n,y.InvalidParameter,a);{i=JSON.parse(e[0].castToText(!0));const m=c(i,"layerdefinition");if(m!==null){t.layerDefinition.geometryType=c(m,"geometrytype",""),t.featureSet.geometryType=t.layerDefinition.geometryType,t.layerDefinition.globalIdField=c(m,"globalidfield",""),t.layerDefinition.objectIdField=c(m,"objectidfield",""),t.layerDefinition.typeIdField=c(m,"typeidfield",""),t.layerDefinition.hasZ=c(m,"hasz",!1)===!0,t.layerDefinition.hasM=c(m,"hasm",!1)===!0;const l=c(m,"spatialreference",null);l&&(t.layerDefinition.spatialReference=ne(l));for(const s of c(m,"fields",[])){const f={name:c(s,"name",""),alias:c(s,"alias",""),type:c(s,"type",""),nullable:c(s,"nullable",!0),editable:c(s,"editable",!0),length:c(s,"length",null),domain:me(c(s,"domain"))};t.layerDefinition.fields.push(f)}const r=c(i,"featureset",null);if(r){const s={};for(const f of t.layerDefinition.fields)s[f.name.toLowerCase()]=f.name;for(const f of c(r,"features",[])){const h={},g=c(f,"attributes",{});for(const I in g)h[s[I.toLowerCase()]]=g[I];t.featureSet.features.push({attributes:h,geometry:pe(c(f,"geometry",null))})}}}else{t.layerDefinition.hasZ=c(i,"hasz",!1)===!0,t.layerDefinition.hasM=c(i,"hasm",!1)===!0,t.layerDefinition.geometryType=c(i,"geometrytype",""),t.featureSet.geometryType=t.layerDefinition.geometryType,t.layerDefinition.objectIdField=c(i,"objectidfieldname",""),t.layerDefinition.typeIdField=c(i,"typeidfieldname","");const l=c(i,"spatialreference",null);l&&(t.layerDefinition.spatialReference=ne(l));let r=c(i,"fields",null);if(N(r))for(const h of r){const g={name:c(h,"name",""),alias:c(h,"alias",""),type:c(h,"type",""),nullable:c(h,"nullable",!0),editable:c(h,"editable",!0),length:c(h,"length",null),domain:me(c(h,"domain"))};t.layerDefinition.fields.push(g)}else r=null,t.layerDefinition.fields=r;const s={};for(const h of t.layerDefinition.fields)s[h.name.toLowerCase()]=h.name;let f=c(i,"features",null);if(N(f))for(const h of f){const g={},I=c(h,"attributes",{});for(const D in I)g[s[D.toLowerCase()]]=I[D];t.featureSet.features.push({attributes:g,geometry:pe(c(h,"geometry",null))})}else f=null,t.featureSet.features=f}}}if(He(t)===!1)throw new p(n,y.InvalidParameter,a);return(((u=t==null?void 0:t.layerDefinition)==null?void 0:u.geometryType)||"")===""&&(t.layerDefinition.geometryType="esriGeometryNull"),Ne.create(t,n.spatialReference)})},o.signatures.push({name:"featureset",min:1,max:1}),o.functions.filter=function(n,a){return o.standardFunctionAsync(n,a,async(d,E,e)=>{if(A(e,2,2,n,a),N(e[0])||z(e[0])){const i=[];let t=e[0];t instanceof Ee&&(t=t.toArray());let u=null;if(!De(e[1]))throw new p(n,y.InvalidParameter,a);u=e[1].createFunction(n);for(const m of t){const l=u(m);ke(l)?await l===!0&&i.push(m):l===!0&&i.push(m)}return i}if(L(e[0])){const i=await e[0].load(),t=b.create(e[1],i.getFieldsIndex()),u=t.getVariables();if(u.length>0){const m=[];for(let r=0;r{if(A(e,2,2,n,a),L(e[0])){const i=new Te(e[1]);return new Se({parentfeatureset:e[0],orderbyclause:i})}throw new p(n,y.InvalidParameter,a)})},o.signatures.push({name:"orderby",min:2,max:2}),o.functions.top=function(n,a){return o.standardFunctionAsync(n,a,async(d,E,e)=>{if(A(e,2,2,n,a),L(e[0]))return new Le({parentfeatureset:e[0],topnum:e[1]});if(N(e[0]))return H(e[1])>=e[0].length?e[0].slice(0):e[0].slice(0,H(e[1]));if(z(e[0]))return H(e[1])>=e[0].length()?e[0].slice(0):e[0].slice(0,H(e[1]));throw new p(n,y.InvalidParameter,a)})},o.signatures.push({name:"top",min:2,max:2}),o.functions.first=function(n,a){return o.standardFunctionAsync(n,a,async(d,E,e)=>{if(A(e,1,1,n,a),L(e[0])){const i=await e[0].first(d.abortSignal);if(i!==null){const t=be.createFromGraphicLikeObject(i.geometry,i.attributes,e[0],n.timeReference);return t._underlyingGraphic=i,t}return i}return N(e[0])?e[0].length===0?null:e[0][0]:z(e[0])?e[0].length()===0?null:e[0].get(0):null})},o.signatures.push({name:"first",min:1,max:1}),o.functions.attachments=function(n,a){return o.standardFunctionAsync(n,a,async(d,E,e)=>{A(e,1,2,n,a);const i={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(e.length>1){if(e[1]instanceof R){if(e[1].hasField("minsize")&&(i.minsize=H(e[1].field("minsize"))),e[1].hasField("metadata")&&(i.returnMetadata=j(e[1].field("metadata"))),e[1].hasField("maxsize")&&(i.maxsize=H(e[1].field("maxsize"))),e[1].hasField("types")){const t=xe(e[1].field("types"),!1);t.length>0&&(i.types=t)}}else if(e[1]!==null)throw new p(n,y.InvalidParameter,a)}if(q(e[0])){let t=e[0]._layer;return t instanceof $&&(t=X(t,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),t===null?[]:L(t)===!1?[]:(await t.load(),t.queryAttachments(e[0].field(t.objectIdField),i.minsize,i.maxsize,i.types,i.returnMetadata))}if(e[0]===null)return[];throw new p(n,y.InvalidParameter,a)})},o.signatures.push({name:"attachments",min:1,max:2}),o.functions.featuresetbyrelationshipname=function(n,a){return o.standardFunctionAsync(n,a,async(d,E,e)=>{A(e,2,4,n,a);const i=e[0],t=x(e[1]);let u=S(e[2],null);const m=j(S(e[3],!0));if(u===null&&(u=["*"]),N(u)===!1)throw new p(n,y.InvalidParameter,a);if(e[0]===null)return null;if(!q(e[0]))throw new p(n,y.InvalidParameter,a);let l=i._layer;if(l instanceof $&&(l=X(l,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),l===null||L(l)===!1)return null;l=await l.load();const r=l.relationshipMetaData().filter(I=>I.name===t);if(r.length===0)return null;if(r[0].relationshipTableId!==void 0&&r[0].relationshipTableId!==null&&r[0].relationshipTableId>-1)return ve(l,r[0],i.field(l.objectIdField),l.spatialReference,u,m,n.lrucache,n.interceptor);let s=l.serviceUrl();if(!s)return null;s=s.charAt(s.length-1)==="/"?s+r[0].relatedTableId.toString():s+"/"+r[0].relatedTableId.toString();const f=await Pe(s,l.spatialReference,u,m,n.lrucache,n.interceptor);await f.load();let h=f.relationshipMetaData();if(h=h.filter(I=>I.id===r[0].id),i.hasField(r[0].keyField)===!1||i.field(r[0].keyField)===null){const I=await l.getFeatureByObjectId(i.field(l.objectIdField),[r[0].keyField]);if(I){const D=b.create(h[0].keyField+"= @id",f.getFieldsIndex());return D.parameters={id:I.attributes[r[0].keyField]},f.filter(D)}return new Oe({parentfeatureset:f})}const g=b.create(h[0].keyField+"= @id",f.getFieldsIndex());return g.parameters={id:i.field(r[0].keyField)},f.filter(g)})},o.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),o.functions.featuresetbyassociation=function(n,a){return o.standardFunctionAsync(n,a,async(d,E,e)=>{A(e,2,3,n,a);const i=e[0],t=x(S(e[1],"")).toLowerCase(),u=P(e[2])?x(e[2]):null;if(e[0]===null)return null;if(!q(e[0]))throw new p(n,y.InvalidParameter,a);let m=i._layer;if(m instanceof $&&(m=X(m,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),m===null||L(m)===!1)return null;await m.load();const l=m.serviceUrl(),r=await Re(l,n.spatialReference);let s=null,f=null,h=!1;if(u!==null&&u!==""&&u!==void 0){for(const F of r.terminals)F.terminalName===u&&(f=F.terminalId);f===null&&(h=!0)}const g=r.associations.getFieldsIndex(),I=g.get("TOGLOBALID").name,D=g.get("FROMGLOBALID").name,Q=g.get("TOTERMINALID").name,J=g.get("FROMTERMINALID").name,Z=g.get("FROMNETWORKSOURCEID").name,G=g.get("TONETWORKSOURCEID").name,O=g.get("ASSOCIATIONTYPE").name,ye=g.get("ISCONTENTVISIBLE").name,he=g.get("OBJECTID").name;for(const F of m.fields)if(F.type==="global-id"){s=i.field(F.name);break}let C=null,te=new k(new W({name:"percentalong",alias:"percentalong",type:"double"}),b.create("0",r.associations.getFieldsIndex())),ie=new k(new W({name:"side",alias:"side",type:"string"}),b.create("''",r.associations.getFieldsIndex()));const T="globalid",ae="globalId",re={};for(const F in r.lkp)re[F]=r.lkp[F].sourceId;const M=new Ce(new W({name:"classname",alias:"classname",type:"string"}),null,re);let w="";switch(t){case"midspan":{w=`((${I}='${s}') OR ( ${D}='${s}')) AND (${O} IN (5))`,M.codefield=b.create(`CASE WHEN (${I}='${s}') THEN ${Z} ELSE ${G} END`,r.associations.getFieldsIndex());const F=K(v.findField(r.associations.fields,D));F.name=T,F.alias=T,C=new k(F,b.create(`CASE WHEN (${D}='${s}') THEN ${I} ELSE ${D} END`,r.associations.getFieldsIndex())),te=r.unVersion>=4?new _(v.findField(r.associations.fields,g.get("PERCENTALONG").name)):new k(new W({name:"percentalong",alias:"percentalong",type:"double"}),b.create("0",r.associations.getFieldsIndex()));break}case"junctionedge":{w=`((${I}='${s}') OR ( ${D}='${s}')) AND (${O} IN (4,6))`,M.codefield=b.create(`CASE WHEN (${I}='${s}') THEN ${Z} ELSE ${G} END`,r.associations.getFieldsIndex());const F=K(v.findField(r.associations.fields,D));F.name=T,F.alias=T,C=new k(F,b.create(`CASE WHEN (${D}='${s}') THEN ${I} ELSE ${D} END`,r.associations.getFieldsIndex())),ie=new k(new W({name:"side",alias:"side",type:"string"}),b.create(`CASE WHEN (${O}=4) THEN 'from' ELSE 'to' END`,r.associations.getFieldsIndex()));break}case"connected":{let F=`${I}='@T'`,oe=`${D}='@T'`;f!==null&&(F+=` AND ${Q}=@A`,oe+=` AND ${J}=@A`),w="(("+F+") OR ("+oe+"))",w=B(w,"@T",s??""),F=B(F,"@T",s??""),f!==null&&(F=B(F,"@A",f.toString()),w=B(w,"@A",f.toString())),M.codefield=b.create("CASE WHEN "+F+` THEN ${Z} ELSE ${G} END`,r.associations.getFieldsIndex());const U=K(v.findField(r.associations.fields,D));U.name=T,U.alias=T,C=new k(U,b.create("CASE WHEN "+F+` THEN ${D} ELSE ${I} END`,r.associations.getFieldsIndex()));break}case"container":w=`${I}='${s}' AND ${O} = 2`,f!==null&&(w+=` AND ${Q} = `+f.toString()),M.codefield=Z,w="( "+w+" )",C=new V(v.findField(r.associations.fields,D),T,T);break;case"content":w=`(${D}='${s}' AND ${O} = 2)`,f!==null&&(w+=` AND ${J} = `+f.toString()),M.codefield=G,w="( "+w+" )",C=new V(v.findField(r.associations.fields,I),T,T);break;case"structure":w=`(${I}='${s}' AND ${O} = 3)`,f!==null&&(w+=` AND ${Q} = `+f.toString()),M.codefield=Z,w="( "+w+" )",C=new V(v.findField(r.associations.fields,D),T,ae);break;case"attached":w=`(${D}='${s}' AND ${O} = 3)`,f!==null&&(w+=` AND ${J} = `+f.toString()),M.codefield=G,w="( "+w+" )",C=new V(v.findField(r.associations.fields,I),T,ae);break;default:throw new p(n,y.InvalidParameter,a)}return h&&(w="1 <> 1"),new v({parentfeatureset:r.associations,adaptedFields:[new _(v.findField(r.associations.fields,he)),new _(v.findField(r.associations.fields,ye)),C,ie,M,te],extraFilter:w?b.create(w,r.associations.getFieldsIndex()):null})})},o.signatures.push({name:"featuresetbyassociation",min:2,max:6}),o.functions.groupby=function(n,a){return o.standardFunctionAsync(n,a,async(d,E,e)=>{if(A(e,3,3,n,a),!L(e[0]))throw new p(n,y.InvalidParameter,a);const i=await e[0].load(),t=[],u=[];let m=!1,l=[];if(P(e[1]))l.push(e[1]);else if(e[1]instanceof R)l.push(e[1]);else if(N(e[1]))l=e[1];else{if(!z(e[1]))throw new p(n,y.InvalidParameter,a);l=e[1].toArray()}for(const r of l)if(P(r)){const s=b.create(x(r),i.getFieldsIndex()),f=ue(s)===!0?x(r):"%%%%FIELDNAME";t.push({name:f,expression:s}),f==="%%%%FIELDNAME"&&(m=!0)}else{if(!(r instanceof R))throw new p(n,y.InvalidParameter,a);{const s=r.hasField("name")?r.field("name"):"%%%%FIELDNAME",f=r.hasField("expression")?r.field("expression"):"";if(s==="%%%%FIELDNAME"&&(m=!0),!s)throw new p(n,y.InvalidParameter,a);t.push({name:s,expression:b.create(f||s,i.getFieldsIndex())})}}if(l=[],P(e[2]))l.push(e[2]);else if(N(e[2]))l=e[2];else if(z(e[2]))l=e[2].toArray();else{if(!(e[2]instanceof R))throw new p(n,y.InvalidParameter,a);l.push(e[2])}for(const r of l){if(!(r instanceof R))throw new p(n,y.InvalidParameter,a);{const s=r.hasField("name")?r.field("name"):"",f=r.hasField("statistic")?r.field("statistic"):"",h=r.hasField("expression")?r.field("expression"):"";if(!s||!f||!h)throw new p(n,y.InvalidParameter,a);u.push({name:s,statistic:f.toLowerCase(),expression:b.create(h,i.getFieldsIndex())})}}if(m){const r={};for(const f of i.fields)r[f.name.toLowerCase()]=1;for(const f of t)f.name!=="%%%%FIELDNAME"&&(r[f.name.toLowerCase()]=1);for(const f of u)f.name!=="%%%%FIELDNAME"&&(r[f.name.toLowerCase()]=1);let s=0;for(const f of t)if(f.name==="%%%%FIELDNAME"){for(;r["field_"+s.toString()]===1;)s++;r["field_"+s.toString()]=1,f.name="FIELD_"+s.toString()}}for(const r of t)await ee(r.expression,o,n);for(const r of u)await ee(r.expression,o,n);return e[0].groupby(t,u)})},o.signatures.push({name:"groupby",min:3,max:3}),o.functions.distinct=function(n,a){return o.standardFunctionAsync(n,a,async(d,E,e)=>{if(L(e[0])){A(e,2,2,n,a);const i=await e[0].load(),t=[];let u=[];if(P(e[1]))u.push(e[1]);else if(e[1]instanceof R)u.push(e[1]);else if(N(e[1]))u=e[1];else{if(!z(e[1]))throw new p(n,y.InvalidParameter,a);u=e[1].toArray()}let m=!1;for(const l of u)if(P(l)){const r=b.create(x(l),i.getFieldsIndex()),s=ue(r)===!0?x(l):"%%%%FIELDNAME";t.push({name:s,expression:r}),s==="%%%%FIELDNAME"&&(m=!0)}else{if(!(l instanceof R))throw new p(n,y.InvalidParameter,a);{const r=l.hasField("name")?l.field("name"):"%%%%FIELDNAME",s=l.hasField("expression")?l.field("expression"):"";if(r==="%%%%FIELDNAME"&&(m=!0),!r)throw new p(n,y.InvalidParameter,a);t.push({name:r,expression:b.create(s||r,i.getFieldsIndex())})}}if(m){const l={};for(const s of i.fields)l[s.name.toLowerCase()]=1;for(const s of t)s.name!=="%%%%FIELDNAME"&&(l[s.name.toLowerCase()]=1);let r=0;for(const s of t)if(s.name==="%%%%FIELDNAME"){for(;l["field_"+r.toString()]===1;)r++;l["field_"+r.toString()]=1,s.name="FIELD_"+r.toString()}}for(const l of t)await ee(l.expression,o,n);return e[0].groupby(t,[])}return ze("distinct",d,E,e)})})}export{Xn as registerFunctions}; diff --git a/assets/featuresetgeom-f8824c82.js b/assets/featuresetgeom-f8824c82.js new file mode 100644 index 0000000..602e57c --- /dev/null +++ b/assets/featuresetgeom-f8824c82.js @@ -0,0 +1 @@ +import{t as o,e as l}from"./executionError-c92d3b85.js";import{l as h,Q as F,c as p,V as s,a4 as w}from"./arcadeUtils-b902d678.js";import{u as c,f as R}from"./SpatialFilter-d44507d6.js";import{fB as u}from"./index-080e108a.js";import{R as I,m as A,S as P,x as g,O as C,p as O,h as S}from"./geometryEngineAsync-e8b91fe5.js";import"./arcadeTimeUtils-e1438cc8.js";import"./FieldsIndex-f79a8f26.js";import"./number-e5825aa4.js";import"./hash-6f442295.js";import"./WhereClause-c86b9974.js";function f(r){return r instanceof u}function a(r,t,i,d){return d(r,t,async(y,e,n)=>{if(n.length<2)throw new o(r,l.WrongNumberOfParameters,t);if((n=h(n))[0]===null&&n[1]===null)return!1;if(s(n[0])){if(n[1]instanceof u)return new R({parentfeatureset:n[0],relation:i,relationGeom:n[1]});if(n[1]===null)return new c({parentfeatureset:n[0]});throw new o(r,l.InvalidParameter,t)}if(f(n[0])){if(f(n[1])){switch(i){case"esriSpatialRelEnvelopeIntersects":return S(w(n[0]),w(n[1]));case"esriSpatialRelIntersects":return S(n[0],n[1]);case"esriSpatialRelContains":return O(n[0],n[1]);case"esriSpatialRelOverlaps":return C(n[0],n[1]);case"esriSpatialRelWithin":return g(n[0],n[1]);case"esriSpatialRelTouches":return P(n[0],n[1]);case"esriSpatialRelCrosses":return A(n[0],n[1])}throw new o(r,l.InvalidParameter,t)}if(s(n[1]))return new R({parentfeatureset:n[1],relation:i,relationGeom:n[0]});if(n[1]===null)return!1;throw new o(r,l.InvalidParameter,t)}if(n[0]!==null)throw new o(r,l.InvalidParameter,t);return s(n[1])?new c({parentfeatureset:n[1]}):!(n[1]instanceof u||n[1]===null)&&void 0})}function j(r){r.mode==="async"&&(r.functions.intersects=function(t,i){return a(t,i,"esriSpatialRelIntersects",r.standardFunctionAsync)},r.functions.envelopeintersects=function(t,i){return a(t,i,"esriSpatialRelEnvelopeIntersects",r.standardFunctionAsync)},r.signatures.push({name:"envelopeintersects",min:2,max:2}),r.functions.contains=function(t,i){return a(t,i,"esriSpatialRelContains",r.standardFunctionAsync)},r.functions.overlaps=function(t,i){return a(t,i,"esriSpatialRelOverlaps",r.standardFunctionAsync)},r.functions.within=function(t,i){return a(t,i,"esriSpatialRelWithin",r.standardFunctionAsync)},r.functions.touches=function(t,i){return a(t,i,"esriSpatialRelTouches",r.standardFunctionAsync)},r.functions.crosses=function(t,i){return a(t,i,"esriSpatialRelCrosses",r.standardFunctionAsync)},r.functions.relate=function(t,i){return r.standardFunctionAsync(t,i,(d,y,e)=>{if(e=h(e),F(e,3,3,t,i),f(e[0])&&f(e[1]))return I(e[0],e[1],p(e[2]));if(e[0]instanceof u&&e[1]===null||e[1]instanceof u&&e[0]===null)return!1;if(s(e[0])&&e[1]===null)return new c({parentfeatureset:e[0]});if(s(e[1])&&e[0]===null)return new c({parentfeatureset:e[1]});if(s(e[0])&&e[1]instanceof u)return e[0].relate(e[1],p(e[2]));if(s(e[1])&&e[0]instanceof u)return e[1].relate(e[0],p(e[2]));if(e[0]===null&&e[1]===null)return!1;throw new o(t,l.InvalidParameter,i)})})}export{j as registerFunctions}; diff --git a/assets/featuresetstats-f8717896.js b/assets/featuresetstats-f8717896.js new file mode 100644 index 0000000..dd02ec9 --- /dev/null +++ b/assets/featuresetstats-f8717896.js @@ -0,0 +1 @@ +import{t as p,e as F}from"./executionError-c92d3b85.js";import{Q as h,V as d,z as m,L as A,q as l,a3 as c,v as i}from"./arcadeUtils-b902d678.js";import{f as g}from"./WhereClause-c86b9974.js";import"./index-080e108a.js";import"./arcadeTimeUtils-e1438cc8.js";import"./FieldsIndex-f79a8f26.js";import"./number-e5825aa4.js";import"./hash-6f442295.js";async function s(n,r,a,t,o,e){if(t.length===1){if(m(t[0]))return c(n,t[0],i(t[1],-1));if(l(t[0]))return c(n,t[0].toArray(),i(t[1],-1))}else if(t.length===2){if(m(t[0]))return c(n,t[0],i(t[1],-1));if(l(t[0]))return c(n,t[0].toArray(),i(t[1],-1));if(d(t[0])){const u=await t[0].load(),f=await y(g.create(t[1],u.getFieldsIndex()),e,o);return t[0].calculateStatistic(n,f,i(t[2],1e3),r.abortSignal)}}else if(t.length===3&&d(t[0])){const u=await t[0].load(),f=await y(g.create(t[1],u.getFieldsIndex()),e,o);return t[0].calculateStatistic(n,f,i(t[2],1e3),r.abortSignal)}return c(n,t,-1)}async function y(n,r,a){const t=n.getVariables();if(t.length>0){const o=[];for(let u=0;us("stdev",t,o,e,r,n))},n.functions.variance=function(r,a){return n.standardFunctionAsync(r,a,(t,o,e)=>s("variance",t,o,e,r,n))},n.functions.average=function(r,a){return n.standardFunctionAsync(r,a,(t,o,e)=>s("mean",t,o,e,r,n))},n.functions.mean=function(r,a){return n.standardFunctionAsync(r,a,(t,o,e)=>s("mean",t,o,e,r,n))},n.functions.sum=function(r,a){return n.standardFunctionAsync(r,a,(t,o,e)=>s("sum",t,o,e,r,n))},n.functions.min=function(r,a){return n.standardFunctionAsync(r,a,(t,o,e)=>s("min",t,o,e,r,n))},n.functions.max=function(r,a){return n.standardFunctionAsync(r,a,(t,o,e)=>s("max",t,o,e,r,n))},n.functions.count=function(r,a){return n.standardFunctionAsync(r,a,(t,o,e)=>{if(h(e,1,1,r,a),d(e[0]))return e[0].count(t.abortSignal);if(m(e[0])||A(e[0]))return e[0].length;if(l(e[0]))return e[0].length();throw new p(r,F.InvalidParameter,a)})})}export{q as registerFunctions}; diff --git a/assets/featuresetstring-f0b4377e.js b/assets/featuresetstring-f0b4377e.js new file mode 100644 index 0000000..65f5dc9 --- /dev/null +++ b/assets/featuresetstring-f0b4377e.js @@ -0,0 +1 @@ +import{Q as o,E as s,a5 as b,c as u,V as c,a6 as p,a7 as h,A as v,S as f,a8 as A,a9 as g,aa as x,ab as F,ac as L,v as P,ad as V,ae as w}from"./arcadeUtils-b902d678.js";import{t as m,e as y}from"./executionError-c92d3b85.js";import"./index-080e108a.js";import"./arcadeTimeUtils-e1438cc8.js";import"./FieldsIndex-f79a8f26.js";import"./number-e5825aa4.js";import"./hash-6f442295.js";function l(a,e){return a&&a.domain?a.domain.type==="coded-value"||a.domain.type==="codedValue"?v.convertObjectToArcadeDictionary({type:"codedValue",name:a.domain.name,dataType:w[a.field.type],codedValues:a.domain.codedValues.map(t=>({name:t.name,code:t.code}))},f(e)):v.convertObjectToArcadeDictionary({type:"range",name:a.domain.name,dataType:w[a.field.type],min:a.domain.min,max:a.domain.max},f(e)):null}function E(a){a.mode==="async"&&(a.functions.domain=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,3,e,t),s(n[0]))return l(b(n[0],u(n[1]),n[2]===void 0?void 0:n[2]),e);if(c(n[0]))return await n[0]._ensureLoaded(),l(p(u(n[1]),n[0],null,n[2]===void 0?void 0:n[2]),e);throw new m(e,y.InvalidParameter,t)})},a.functions.subtypes=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),s(n[0])){const r=h(n[0]);return r?v.convertObjectToArcadeDictionary(r,f(e)):null}if(c(n[0])){await n[0]._ensureLoaded();const r=n[0].subtypes();return r?v.convertObjectToArcadeDictionary(r,f(e)):null}throw new m(e,y.InvalidParameter,t)})},a.functions.domainname=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,4,e,t),s(n[0]))return A(n[0],u(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=p(u(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return g(r,n[2])}throw new m(e,y.InvalidParameter,t)})},a.signatures.push({name:"domainname",min:2,max:4}),a.functions.domaincode=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,4,e,t),s(n[0]))return x(n[0],u(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=p(u(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return F(r,n[2])}throw new m(e,y.InvalidParameter,t)})},a.signatures.push({name:"domaincode",min:2,max:4})),a.functions.text=function(e,t){return a.standardFunctionAsync(e,t,(i,d,n)=>{if(o(n,1,2,e,t),!c(n[0]))return L(n[0],n[1]);{const r=P(n[1],"");if(r==="")return n[0].castToText();if(r.toLowerCase()==="schema")return n[0].convertToText("schema",i.abortSignal);if(r.toLowerCase()==="featureset")return n[0].convertToText("featureset",i.abortSignal)}})},a.functions.gdbversion=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),s(n[0]))return n[0].gdbVersion();if(c(n[0]))return(await n[0].load()).gdbVersion;throw new m(e,y.InvalidParameter,t)})},a.functions.schema=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),c(n[0]))return await n[0].load(),v.convertObjectToArcadeDictionary(n[0].schema(),f(e));if(s(n[0])){const r=V(n[0]);return r?v.convertObjectToArcadeDictionary(r,f(e)):null}throw new m(e,y.InvalidParameter,t)})}}export{E as registerFunctions}; diff --git a/assets/fetchService-82a8c4d0.js b/assets/fetchService-82a8c4d0.js new file mode 100644 index 0000000..9a2063b --- /dev/null +++ b/assets/fetchService-82a8c4d0.js @@ -0,0 +1 @@ +import{at as y}from"./index-080e108a.js";async function s(e,t){const{data:r}=await y(e,{responseType:"json",query:{f:"json",...t==null?void 0:t.customParameters,token:t==null?void 0:t.apiKey}});return r}async function u(e,t){const r=await s(e,t);r.layers=r.layers.filter(i);const a={serviceJSON:r};if((r.currentVersion??0)<10.5)return a;const n=await s(e+"/layers",t);return a.layersJSON={layers:n.layers.filter(i),tables:n.tables},a}function i(e){return!e.type||e.type==="Feature Layer"}export{u as r,s as t}; diff --git a/assets/fi_FI2-53484f9e.js b/assets/fi_FI2-53484f9e.js new file mode 100644 index 0000000..8fa9a0f --- /dev/null +++ b/assets/fi_FI2-53484f9e.js @@ -0,0 +1 @@ +const _={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"jKr.",_era_bc:"eKr.",A:"ap.",P:"ip.",AM:"ap.",PM:"ip.","A.M.":"ap.","P.M.":"ip.",January:"tammikuuta",February:"helmikuuta",March:"maaliskuuta",April:"huhtikuuta",May:"toukokuuta",June:"kesäkuuta",July:"heinäkuuta",August:"elokuuta",September:"syyskuuta",October:"lokakuuta",November:"marraskuuta",December:"joulukuuta",Jan:"tammik.",Feb:"helmik.",Mar:"maalisk.",Apr:"huhtik.","May(short)":"toukok.",Jun:"kesäk.",Jul:"heinäk.",Aug:"elok.",Sep:"syysk.",Oct:"lokak.",Nov:"marrask.",Dec:"jouluk.",Sunday:"sunnuntaina",Monday:"maanantaina",Tuesday:"tiistaina",Wednesday:"keskiviikkona",Thursday:"torstaina",Friday:"perjantaina",Saturday:"lauantaina",Sun:"su",Mon:"ma",Tue:"ti",Wed:"ke",Thu:"to",Fri:"pe",Sat:"la",_dateOrd:function(a){let e="th";if(a<11||a>13)switch(a%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Tarkennus",Play:"Toista",Stop:"Lopeta",Legend:"Selite","Press ENTER to toggle":"",Loading:"Ladataan",Home:"Aloitussivu",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Tulosta",Image:"kuva",Data:"Data",Print:"Tulosta","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Mistä %1 mihin %2","From %1":"Mistä %1","To %1":"Mihin %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{_ as default}; diff --git a/assets/fieldProperties-62c55499.js b/assets/fieldProperties-62c55499.js new file mode 100644 index 0000000..08d6b54 --- /dev/null +++ b/assets/fieldProperties-62c55499.js @@ -0,0 +1 @@ +import{cq as s,bz as r,bw as n}from"./index-080e108a.js";import{r as l}from"./FieldsIndex-f79a8f26.js";function f(){return{fields:{type:[s],value:null},fieldsIndex:{readOnly:!0,get(){return new l(this.fields||[])}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){var t;const e=this._userOutFields;if(!e||!e.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const i of e)((t=this.fieldsIndex)==null?void 0:t.has(i))||r.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${i} found in outFields`,{layer:this,outFields:e});return n(this.fieldsIndex,e)}}}}export{f as s}; diff --git a/assets/floorFilterUtils-080a7cd2.js b/assets/floorFilterUtils-080a7cd2.js new file mode 100644 index 0000000..a6b6c35 --- /dev/null +++ b/assets/floorFilterUtils-080a7cd2.js @@ -0,0 +1 @@ +function i(o){var n;const l=o.layer;return"floorInfo"in l&&((n=l.floorInfo)!=null&&n.floorField)&&"floors"in o.view?f(o.view.floors,l.floorInfo.floorField):null}function e(o,l){var n;return"floorInfo"in l&&((n=l.floorInfo)!=null&&n.floorField)?f(o,l.floorInfo.floorField):null}function f(o,l){if(!(o!=null&&o.length))return null;const n=o.filter(r=>r!=="").map(r=>`'${r}'`);return n.push("''"),`${l} IN (${n.join(",")}) OR ${l} IS NULL`}export{e as n,i as o}; diff --git a/assets/fr_FR2-8b6dd3fc.js b/assets/fr_FR2-8b6dd3fc.js new file mode 100644 index 0000000..2acbfe2 --- /dev/null +++ b/assets/fr_FR2-8b6dd3fc.js @@ -0,0 +1 @@ +const o={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - dd MMM",_date_hour:"HH:mm",_date_hour_full:"HH:mm - dd MMM",_date_day:"dd MMM",_date_day_full:"dd MMM",_date_week:"ww",_date_week_full:"dd MMM",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"A",P:"P",AM:"AM",PM:"PM","A.M.":"A.M.","P.M.":"P.M.",January:"Janvier",February:"Février",March:"Mars",April:"Avril",May:"Mai",June:"Juin",July:"Juillet",August:"Août",September:"Septembre",October:"Octobre",November:"Novembre",December:"Décembre",Jan:"Jan",Feb:"Fév",Mar:"Mar",Apr:"Avr","May(short)":"Mai",Jun:"Jui",Jul:"Jul",Aug:"Aoû",Sep:"Sep",Oct:"Oct",Nov:"Nov",Dec:"Déc",Sunday:"Dimanche",Monday:"Lundi",Tuesday:"Mardi",Wednesday:"Mercredi",Thursday:"Jeudi",Friday:"Vendredi",Saturday:"Samedi",Sun:"Dim",Mon:"Lun",Tue:"Mar",Wed:"Mer",Thu:"Jeu",Fri:"Ven",Sat:"Sam",_dateOrd:function(e){let r="e";return(e<11||e>13)&&e%10==1&&(r="er"),r},"Zoom Out":"Zoom Arrière",Play:"Joue",Stop:"Arrête",Legend:"Légende","Press ENTER to toggle":"cliquez, appuyez ou appuyez sur entrée pour basculer",Loading:"Charger",Home:"Accueil",Chart:"Graphique","Serial chart":"Graphique sérial","X/Y chart":"Graphique X/Y","Pie chart":"Camembert","Gauge chart":"Jauge graphique","Radar chart":"Carte radar","Sankey diagram":"Graphique Sankey","Flow diagram":"représentation schématique","Chord diagram":"diagramme d'accord","TreeMap chart":"carte de l'arbre","Sliced chart":"graphique en tranches",Series:"Séries","Candlestick Series":"Séries chandelier","OHLC Series":"Séries OHLC","Column Series":"Séries de colonnes","Line Series":"Série de lignes","Pie Slice Series":"Tarte tranche Séries","Funnel Series":"Séries d'entonnoir","Pyramid Series":"Séries pyramidale","X/Y Series":"Séries X/Y",Map:"Mappe","Press ENTER to zoom in":"Appuyez sur ENTER pour zoomer","Press ENTER to zoom out":"Appuyez sur ENTER pour effectuer un zoom arrière","Use arrow keys to zoom in and out":"Utilisez les touches fléchées pour zoomer et dézoomer","Use plus and minus keys on your keyboard to zoom in and out":"Utilisez les touches plus et moins de votre clavier pour effectuer un zoom avant ou arrière",Export:"Exporter",Image:"Image",Data:"Data",Print:"Imprimer","Press ENTER to open":"Cliquez, appuyez ou appuyez sur ENTER pour ouvrir","Press ENTER to print.":"Cliquez, appuyez ou appuyez sur ENTER pour imprimer","Press ENTER to export as %1.":"Cliquez, appuyez ou appuyez sur ENTER pour exporter comme %1","(Press ESC to close this message)":"(Appuyez sur ESC pour fermer ce message)","Image Export Complete":"Exportation d'image terminée","Export operation took longer than expected. Something might have gone wrong.":"L'exportation a pris plus de temps que prévu. Quelque chose aurait mal tourné.","Saved from":"Enregistré de",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Utilisez la touche TAB pour sélectionner les boutons des poignées ou les flèches gauche et droite pour modifier la sélection.","Use left and right arrows to move selection":"Utilisez les flèches gauche et droite pour déplacer la sélection","Use left and right arrows to move left selection":"Utilisez les flèches gauche et droite pour déplacer la sélection gauche","Use left and right arrows to move right selection":"Utilisez les flèches gauche et droite pour déplacer la sélection droite","Use TAB select grip buttons or up and down arrows to change selection":"Utilisez les boutons de sélection TAB ou les flèches vers le haut et le bas pour modifier la sélection.","Use up and down arrows to move selection":"Utilisez les flèches haut et bas pour déplacer la sélection","Use up and down arrows to move lower selection":"Utilisez les flèches haut et bas pour déplacer la sélection inférieure","Use up and down arrows to move upper selection":"Utilisez les flèches haut et bas pour déplacer la sélection supérieure","From %1 to %2":"De %1 à %2","From %1":"De %1","To %1":"à %1","No parser available for file: %1":"Aucun analyseur disponible pour le fichier: %1","Error parsing file: %1":"Erreur d'analyse du fichier: %1","Unable to load file: %1":"Impossible de charger le fichier: %1","Invalid date":"Date invalide"};export{o as default}; diff --git a/assets/generateRendererUtils-1e52a587.js b/assets/generateRendererUtils-1e52a587.js new file mode 100644 index 0000000..47c524a --- /dev/null +++ b/assets/generateRendererUtils-1e52a587.js @@ -0,0 +1 @@ +import{cp as C,ai as v,d2 as I,aj as g,al as S,ck as F,bz as j}from"./index-080e108a.js";const q=new C({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"}),w=new C({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});let V=class extends F{constructor(s){super(s),this.type="class-breaks-definition",this.breakCount=null,this.classificationField=null,this.classificationMethod=null,this.normalizationField=null,this.normalizationType=null}set standardDeviationInterval(s){this.classificationMethod==="standard-deviation"&&this._set("standardDeviationInterval",s)}set definedInterval(s){this.classificationMethod==="defined-interval"&&this._set("definedInterval",s)}};v([I({classBreaksDef:"class-breaks-definition"})],V.prototype,"type",void 0),v([g({json:{write:!0}})],V.prototype,"breakCount",void 0),v([g({json:{write:!0}})],V.prototype,"classificationField",void 0),v([g({type:String,json:{read:q.read,write:q.write}})],V.prototype,"classificationMethod",void 0),v([g({json:{write:!0}})],V.prototype,"normalizationField",void 0),v([g({json:{read:w.read,write:w.write}})],V.prototype,"normalizationType",void 0),v([g({value:null,json:{write:!0}})],V.prototype,"standardDeviationInterval",null),v([g({value:null,json:{write:!0}})],V.prototype,"definedInterval",null),V=v([S("esri.rest.support.ClassBreaksDefinition")],V);const O=V,B=j.getLogger("esri.rest.support.generateRendererUtils");function M(n,s){return Number(n.toFixed(s))}function P(n){const{normalizationTotal:s}=n;return{classBreaks:N(n),normalizationTotal:s}}function N(n){const s=n.definition,{classificationMethod:a,normalizationType:i,definedInterval:h}=s,f=s.breakCount??1,u=[];let l=n.values;if(l.length===0)return[];l=l.sort((o,c)=>o-c);const d=l[0],p=l[l.length-1];if(a==="equal-interval")if(l.length>=f){const o=(p-d)/f;let c=d;for(let t=1;t{u.push({minValue:o,maxValue:o,label:b(o,o,i)})});else if(a==="natural-breaks"){const o=D(l),c=n.valueFrequency||o.valueFrequency,t=$(o.uniqueValues,c,f);let e=d;for(let r=1;rr){const m=M(o.uniqueValues[t[r]],6);u.push({minValue:e,maxValue:m,label:b(e,m,i)}),e=m}u.push({minValue:e,maxValue:p,label:b(e,p,i)})}else if(a==="quantile")if(l.length>=f&&d!==p){let o=d,c=Math.ceil(l.length/f),t=0;for(let e=1;el.length&&(r=l.length-1),r<0&&(r=0),u.push({minValue:o,maxValue:l[r],label:b(o,l[r],i)}),o=l[r],t+=c,c=Math.ceil((l.length-t)/(f-e))}u.push({minValue:o,maxValue:p,label:b(o,p,i)})}else{let o=-1;for(let c=0;c=1;y--){const k=M(o-(y-.5)*t,6);u.push({minValue:r,maxValue:k,label:b(r,k,i)}),r=k,e++}let m=M(o+.5*t,6);u.push({minValue:r,maxValue:m,label:b(r,m,i)}),r=m,e++;for(let y=1;y<=f;y++)m=e===2*f?p:M(o+(y+.5)*t,6),u.push({minValue:r,maxValue:m,label:b(r,m,i)}),r=m,e++}}else if(a==="defined-interval"){if(!h)return u;const o=l[0],c=l[l.length-1],t=Math.ceil((c-o)/h);let e=o;for(let r=1;ri&&(a=i);for(let u=0;u0&&r!==n[e+1]&&Math.abs(o-d[e])>Math.abs(o-d[e-1]))n[e]=r;else if(eMath.abs(o-d[e+1])){n[e+1]=r-1;break}c=l,l=0,f=[],u=[];for(let e=0;ec){for(let e=0;e0;t--)for(;a[t]!==a[t-1]+1;){a[t]=a[t]-1;const e=x(t-1,a,i,h);d=e.sbMean,u=e.sbSdcm;const r=x(t,a,i,h);if(p=r.sbMean,l=r.sbSdcm,!(u+l=1?1:f>=.5?.5:.25,f}function L(n){let s=0;for(let a=0;aX(o);return m(o,c),c}function q(o,r){let c=-90,l=90,e=-180,s=180;for(let u=0;u>g,b=(a&o.geohashY)>>i;for(let p=f-1;p>=0;p--){const y=(e+s)/2,d=Y&1<=0;p--){const y=(c+l)/2,d=b&1<f?1:0;e|=t<<29-(i+5*g),w=(1-t)*w+t*f,h=(1-t)*f+t*h}for(let i=0;i<5;i++){const f=(u+n)/2,t=r>f?1:0;s|=t<<29-(i+5*g),u=(1-t)*u+t*f,n=(1-t)*f+t*n}}o.geohashX=e,o.geohashY=s}function z(o,r,c,l,e){e%2&&(e+=1);let s=0,u=0,n=-90,w=90,h=-180,g=180;for(let i=0;it?1:0;s|=a<<29-(f+5*i),h=(1-a)*h+a*t,g=(1-a)*t+a*g}for(let f=0;f<5;f++){const t=(n+w)/2,a=c>t?1:0;u|=a<<29-(f+5*i),n=(1-a)*n+a*t,w=(1-a)*t+a*w}}o[2*r]=s,o[2*r+1]=u}function B(o,r,c){let l="";const e=M(x,-90,90),s=M(F,-180,180);for(let u=0;u2)return!0;return!1}function D(t){return!T(t)}function E(t){return T(t)}function T(t){let n=0;for(let o=0;o=0;e--)S(t,n[e],o);t.lengths.push(n.length)}function S(t,n,o){const[e,r,s]=n;t.coords.push(e,r),o.hasZ&&t.coords.push(s||0)}function U(t){switch(typeof t){case"string":return"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function W(t){if(!t)throw new w("geojson-layer:empty","GeoJSON data is empty");if(t.type!=="Feature"&&t.type!=="FeatureCollection")throw new w("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:t});const{crs:n}=t;if(!n)return;const o=typeof n=="string"?n:n.type==="name"?n.properties.name:n.type==="EPSG"?n.properties.code:null,e=new RegExp(".*(CRS84H?|4326)$","i");if(!o||!e.test(o))throw new w("geojson-layer:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:n})}function X(t,n={}){const o=[],e=new Set,r=new Set;let s,d=!1,i=null,l=!1,{geometryType:c=null}=n,m=!1;for(const p of k(t)){const{geometry:h,properties:u,id:a}=p;if((!h||(c||(c=P(h.type)),P(h.type)===c))&&(d||(d=A(v(h))),l||(l=a!=null,l&&(s=typeof a,u&&(i=Object.keys(u).filter(y=>u[y]===a)))),u&&i&&l&&a!=null&&(i.length>1?i=i.filter(y=>u[y]===a):i.length===1&&(i=u[i[0]]===a?i:[])),!m&&u)){let y=!0;for(const f in u){if(e.has(f))continue;const F=u[f];if(F==null){y=!1,r.add(f);continue}const M=U(F);if(M==="unknown"){r.add(f);continue}r.delete(f),e.add(f);const j=G(f);j&&o.push({name:j,alias:f,type:M})}m=y}}const b=G((i==null?void 0:i.length)===1&&i[0]||null)??void 0;if(b){for(const p of o)if(p.name===b&&$(p)){p.type="esriFieldTypeOID";break}}return{fields:o,geometryType:c,hasZ:d,objectIdFieldName:b,objectIdFieldType:s,unknownFields:Array.from(r)}}function Y(t,n){return Array.from(x(k(t),n))}export{Y as I,X as L,W as T,P as s}; diff --git a/assets/geomasync-463bba62.js b/assets/geomasync-463bba62.js new file mode 100644 index 0000000..f96e379 --- /dev/null +++ b/assets/geomasync-463bba62.js @@ -0,0 +1 @@ +import{fB as d,ca as S,c8 as x,c7 as b,ak as N,c9 as U,cs as V,b9 as W,fC as rn,cZ as an}from"./index-080e108a.js";import{l,Q as h,B as q,c as z,z as A,q as F,y as j,m as P,V as D,t as O,v as w,u as E,w as p,x as L,H as T,b as R,I as sn,K as un,M as cn,P as H,A as M,S as C,U as fn,X as Z}from"./arcadeUtils-b902d678.js";import{A as on,h as ln,S as dn,m as wn,x as hn,p as mn,O as yn,g as pn,R as vn,D as gn,b as Pn,E as In,k as An,y as Fn,w as Rn,W as K,K as Q,F as k,M as B,d as xn,C as X,U as G,B as Nn,L as bn,P as Sn,v as On,H as Y,N as _,J as jn,j as Dn,T as Mn,V as Cn}from"./geometryEngineAsync-e8b91fe5.js";import{t as a,e as s}from"./executionError-c92d3b85.js";import{t as $,s as nn}from"./portalUtils-2eff95c6.js";import"./arcadeTimeUtils-e1438cc8.js";import"./FieldsIndex-f79a8f26.js";import"./number-e5825aa4.js";import"./hash-6f442295.js";function tn(r){return rn.indexOf("4.")===0?N.fromExtent(r):new N({spatialReference:r.spatialReference,rings:[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]})}function I(r,t,e){if(h(r,2,2,t,e),!(r[0]instanceof d&&r[1]instanceof d)){if(!(r[0]instanceof d&&r[1]===null)){if(!(r[1]instanceof d&&r[0]===null)){if(r[0]!==null||r[1]!==null)throw new a(t,s.InvalidParameter,e)}}}}async function en(r,t){if(r.type!=="polygon"&&r.type!=="polyline"&&r.type!=="extent")return 0;let e=1;(r.spatialReference.vcsWkid||r.spatialReference.latestVcsWkid)&&(e=fn(r.spatialReference)/an(r.spatialReference));let c=0;if(r.type==="polyline")for(const n of r.paths)for(let i=1;i(I(n=l(n),t,e),n[0]===null||n[1]===null||on(n[0],n[1])))},r.functions.intersects=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>(I(n=l(n),t,e),n[0]!==null&&n[1]!==null&&ln(n[0],n[1])))},r.functions.touches=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>(I(n=l(n),t,e),n[0]!==null&&n[1]!==null&&dn(n[0],n[1])))},r.functions.crosses=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>(I(n=l(n),t,e),n[0]!==null&&n[1]!==null&&wn(n[0],n[1])))},r.functions.within=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>(I(n=l(n),t,e),n[0]!==null&&n[1]!==null&&hn(n[0],n[1])))},r.functions.contains=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>(I(n=l(n),t,e),n[0]!==null&&n[1]!==null&&mn(n[0],n[1])))},r.functions.overlaps=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>(I(n=l(n),t,e),n[0]!==null&&n[1]!==null&&yn(n[0],n[1])))},r.functions.equals=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>(h(n,2,2,t,e),n[0]===n[1]||(n[0]instanceof d&&n[1]instanceof d?pn(n[0],n[1]):!(!q(n[0])||!q(n[1]))&&n[0].equals(n[1]))))},r.functions.relate=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{if(n=l(n),h(n,3,3,t,e),n[0]instanceof d&&n[1]instanceof d)return vn(n[0],n[1],z(n[2]));if(n[0]instanceof d&&n[1]===null||n[1]instanceof d&&n[0]===null||n[0]===null&&n[1]===null)return!1;throw new a(t,s.InvalidParameter,e)})},r.functions.intersection=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>(I(n=l(n),t,e),n[0]===null||n[1]===null?null:gn(n[0],n[1])))},r.functions.union=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{const i=[];if((n=l(n)).length===0)throw new a(t,s.WrongNumberOfParameters,e);if(n.length===1)if(A(n[0])){const u=l(n[0]);for(let f=0;f(I(n=l(n),t,e),n[0]!==null&&n[1]===null?P(n[0]):n[0]===null?null:In(n[0],n[1])))},r.functions.symmetricdifference=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>(I(n=l(n),t,e),n[0]===null&&n[1]===null?null:n[0]===null?P(n[1]):n[1]===null?P(n[0]):An(n[0],n[1])))},r.functions.clip=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{if(n=l(n),h(n,2,2,t,e),!(n[1]instanceof S)&&n[1]!==null)throw new a(t,s.InvalidParameter,e);if(n[0]===null)return null;if(!(n[0]instanceof d))throw new a(t,s.InvalidParameter,e);return n[1]===null?null:Fn(n[0],n[1])})},r.functions.cut=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{if(n=l(n),h(n,2,2,t,e),!(n[1]instanceof x)&&n[1]!==null)throw new a(t,s.InvalidParameter,e);if(n[0]===null)return[];if(!(n[0]instanceof d))throw new a(t,s.InvalidParameter,e);return n[1]===null?[P(n[0])]:Rn(n[0],n[1])})},r.functions.area=function(t,e){return r.standardFunctionAsync(t,e,async(c,o,n)=>{if(h(n,1,2,t,e),(n=l(n))[0]===null)return 0;if(D(n[0])){const i=await n[0].sumArea(O(w(n[1],-1)),!1,t.abortSignal);if(t.abortSignal.aborted)throw new a(t,s.Cancelled,e);return i}if(A(n[0])||F(n[0])){const i=E(n[0],t.spatialReference);return i===null?0:K(i,O(w(n[1],-1)))}if(!(n[0]instanceof d))throw new a(t,s.InvalidParameter,e);return K(n[0],O(w(n[1],-1)))})},r.functions.areageodetic=function(t,e){return r.standardFunctionAsync(t,e,async(c,o,n)=>{if(h(n,1,2,t,e),(n=l(n))[0]===null)return 0;if(D(n[0])){const i=await n[0].sumArea(O(w(n[1],-1)),!0,t.abortSignal);if(t.abortSignal.aborted)throw new a(t,s.Cancelled,e);return i}if(A(n[0])||F(n[0])){const i=E(n[0],t.spatialReference);return i===null?0:Q(i,O(w(n[1],-1)))}if(!(n[0]instanceof d))throw new a(t,s.InvalidParameter,e);return Q(n[0],O(w(n[1],-1)))})},r.functions.length=function(t,e){return r.standardFunctionAsync(t,e,async(c,o,n)=>{if(h(n,1,2,t,e),(n=l(n))[0]===null)return 0;if(D(n[0])){const i=await n[0].sumLength(p(w(n[1],-1)),!1,t.abortSignal);if(t.abortSignal.aborted)throw new a(t,s.Cancelled,e);return i}if(A(n[0])||F(n[0])){const i=L(n[0],t.spatialReference);return i===null?0:k(i,p(w(n[1],-1)))}if(!(n[0]instanceof d))throw new a(t,s.InvalidParameter,e);return k(n[0],p(w(n[1],-1)))})},r.functions.length3d=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{if(h(n,1,2,t,e),(n=l(n))[0]===null)return 0;if(A(n[0])||F(n[0])){const i=L(n[0],t.spatialReference);return i===null?0:i.hasZ===!0?en(i,p(w(n[1],-1))):k(i,p(w(n[1],-1)))}if(!(n[0]instanceof d))throw new a(t,s.InvalidParameter,e);return n[0].hasZ===!0?en(n[0],p(w(n[1],-1))):k(n[0],p(w(n[1],-1)))})},r.functions.lengthgeodetic=function(t,e){return r.standardFunctionAsync(t,e,async(c,o,n)=>{if(h(n,1,2,t,e),(n=l(n))[0]===null)return 0;if(D(n[0])){const i=await n[0].sumLength(p(w(n[1],-1)),!0,t.abortSignal);if(t.abortSignal.aborted)throw new a(t,s.Cancelled,e);return i}if(A(n[0])||F(n[0])){const i=L(n[0],t.spatialReference);return i===null?0:B(i,p(w(n[1],-1)))}if(!(n[0]instanceof d))throw new a(t,s.InvalidParameter,e);return B(n[0],p(w(n[1],-1)))})},r.functions.distance=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{n=l(n),h(n,2,3,t,e);let i=n[0];(A(n[0])||F(n[0]))&&(i=T(n[0],t.spatialReference));let u=n[1];if((A(n[1])||F(n[1]))&&(u=T(n[1],t.spatialReference)),!(i instanceof d))throw new a(t,s.InvalidParameter,e);if(!(u instanceof d))throw new a(t,s.InvalidParameter,e);return xn(i,u,p(w(n[2],-1)))})},r.functions.distancegeodetic=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{n=l(n),h(n,2,3,t,e);const i=n[0],u=n[1];if(!(i instanceof b))throw new a(t,s.InvalidParameter,e);if(!(u instanceof b))throw new a(t,s.InvalidParameter,e);const f=new x({paths:[],spatialReference:i.spatialReference});return f.addPath([i,u]),B(f,p(w(n[2],-1)))})},r.functions.densify=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{if(n=l(n),h(n,2,3,t,e),n[0]===null)return null;if(!(n[0]instanceof d))throw new a(t,s.InvalidParameter,e);const i=R(n[1]);if(isNaN(i))throw new a(t,s.InvalidParameter,e);if(i<=0)throw new a(t,s.InvalidParameter,e);return n[0]instanceof N||n[0]instanceof x?X(n[0],i,p(w(n[2],-1))):n[0]instanceof S?X(tn(n[0]),i,p(w(n[2],-1))):n[0]})},r.functions.densifygeodetic=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{if(n=l(n),h(n,2,3,t,e),n[0]===null)return null;if(!(n[0]instanceof d))throw new a(t,s.InvalidParameter,e);const i=R(n[1]);if(isNaN(i))throw new a(t,s.InvalidParameter,e);if(i<=0)throw new a(t,s.InvalidParameter,e);return n[0]instanceof N||n[0]instanceof x?G(n[0],i,p(w(n[2],-1))):n[0]instanceof S?G(tn(n[0]),i,p(w(n[2],-1))):n[0]})},r.functions.generalize=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{if(n=l(n),h(n,2,4,t,e),n[0]===null)return null;if(!(n[0]instanceof d))throw new a(t,s.InvalidParameter,e);const i=R(n[1]);if(isNaN(i))throw new a(t,s.InvalidParameter,e);return Nn(n[0],i,sn(w(n[2],!0)),p(w(n[3],-1)))})},r.functions.buffer=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{if(n=l(n),h(n,2,3,t,e),n[0]===null)return null;if(!(n[0]instanceof d))throw new a(t,s.InvalidParameter,e);const i=R(n[1]);if(isNaN(i))throw new a(t,s.InvalidParameter,e);return i===0?P(n[0]):bn(n[0],i,p(w(n[2],-1)))})},r.functions.buffergeodetic=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{if(n=l(n),h(n,2,3,t,e),n[0]===null)return null;if(!(n[0]instanceof d))throw new a(t,s.InvalidParameter,e);const i=R(n[1]);if(isNaN(i))throw new a(t,s.InvalidParameter,e);return i===0?P(n[0]):Sn(n[0],i,p(w(n[2],-1)))})},r.functions.offset=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{if(n=l(n),h(n,2,6,t,e),n[0]===null)return null;if(!(n[0]instanceof N||n[0]instanceof x))throw new a(t,s.InvalidParameter,e);const i=R(n[1]);if(isNaN(i))throw new a(t,s.InvalidParameter,e);const u=R(w(n[4],10));if(isNaN(u))throw new a(t,s.InvalidParameter,e);const f=R(w(n[5],0));if(isNaN(f))throw new a(t,s.InvalidParameter,e);return On(n[0],i,p(w(n[2],-1)),z(w(n[3],"round")).toLowerCase(),u,f)})},r.functions.rotate=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{n=l(n),h(n,2,3,t,e);let i=n[0];if(i===null)return null;if(!(i instanceof d))throw new a(t,s.InvalidParameter,e);i instanceof S&&(i=N.fromExtent(i));const u=R(n[1]);if(isNaN(u))throw new a(t,s.InvalidParameter,e);const f=w(n[2],null);if(f===null)return Y(i,u);if(f instanceof b)return Y(i,u,f);throw new a(t,s.InvalidParameter,e)})},r.functions.centroid=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{if(n=l(n),h(n,1,1,t,e),n[0]===null)return null;let i=n[0];if((A(n[0])||F(n[0]))&&(i=T(n[0],t.spatialReference)),i===null)return null;if(!(i instanceof d))throw new a(t,s.InvalidParameter,e);return i instanceof b?j(P(n[0]),t.spatialReference):i instanceof N?i.centroid:i instanceof x?un(i):i instanceof U?cn(i):i instanceof S?i.center:null})},r.functions.multiparttosinglepart=function(t,e){return r.standardFunctionAsync(t,e,async(c,o,n)=>{n=l(n),h(n,1,1,t,e);const i=[];if(n[0]===null)return null;if(!(n[0]instanceof d))throw new a(t,s.InvalidParameter,e);if(n[0]instanceof b)return[j(P(n[0]),t.spatialReference)];if(n[0]instanceof S)return[j(P(n[0]),t.spatialReference)];const u=await _(n[0]);if(u instanceof N){const f=[],y=[];for(let m=0;m{if(n=l(n),h(n,1,1,t,e),n[0]===null)return!0;if(!(n[0]instanceof d))throw new a(t,s.InvalidParameter,e);return jn(n[0])})},r.functions.simplify=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{if(n=l(n),h(n,1,1,t,e),n[0]===null)return null;if(!(n[0]instanceof d))throw new a(t,s.InvalidParameter,e);return _(n[0])})},r.functions.convexhull=function(t,e){return r.standardFunctionAsync(t,e,(c,o,n)=>{if(n=l(n),h(n,1,1,t,e),n[0]===null)return null;if(!(n[0]instanceof d))throw new a(t,s.InvalidParameter,e);return Dn(n[0])})},r.functions.getuser=function(t,e){return r.standardFunctionAsync(t,e,async(c,o,n)=>{h(n,0,2,t,e);let i=w(n[1],""),u=i===!0;if(i=i===!0||i===!1?"":z(i),n.length===0||n[0]instanceof H){let y=null;y=t.services&&t.services.portal?t.services.portal:W.getDefault(),n.length>0&&(y=$(n[0],y));const m=await nn(y,i,u);if(m){const v=JSON.parse(JSON.stringify(m));for(const g of["lastLogin","created","modified"])v[g]!==void 0&&v[g]!==null&&(v[g]=new Date(v[g]));return M.convertObjectToArcadeDictionary(v,C(t))}return null}let f=null;if(D(n[0])&&(f=n[0]),f){if(u=!1,i)return null;await f.load();const y=await f.getOwningSystemUrl();if(!y){if(!i){const g=await f.getIdentityUser();return g?M.convertObjectToArcadeDictionary({username:g},C(t)):null}return null}let m=null;m=t.services&&t.services.portal?t.services.portal:W.getDefault(),m=$(new H(y),m);const v=await nn(m,i,u);if(v){const g=JSON.parse(JSON.stringify(v));for(const J of["lastLogin","created","modified"])g[J]!==void 0&&g[J]!==null&&(g[J]=new Date(g[J]));return M.convertObjectToArcadeDictionary(g,C(t))}return null}throw new a(t,s.InvalidParameter,e)})}),r.functions.nearestcoordinate=function(t,e){return r.standardFunctionAsync(t,e,async(c,o,n)=>{if(n=l(n),h(n,2,2,t,e),!(n[0]instanceof d||n[0]===null))throw new a(t,s.InvalidParameter,e);if(!(n[1]instanceof b||n[1]===null))throw new a(t,s.InvalidParameter,e);if(n[0]===null||n[1]===null)return null;const i=await Mn(n[0],n[1]);return i===null?null:M.convertObjectToArcadeDictionary({coordinate:i.coordinate,distance:i.distance},C(t),!1,!0)})},r.functions.nearestvertex=function(t,e){return r.standardFunctionAsync(t,e,async(c,o,n)=>{if(n=l(n),h(n,2,2,t,e),!(n[0]instanceof d||n[0]===null))throw new a(t,s.InvalidParameter,e);if(!(n[1]instanceof b||n[1]===null))throw new a(t,s.InvalidParameter,e);if(n[0]===null||n[1]===null)return null;const i=await Cn(n[0],n[1]);return i===null?null:M.convertObjectToArcadeDictionary({coordinate:i.coordinate,distance:i.distance},C(t),!1,!0)})}}export{Wn as registerFunctions}; diff --git a/assets/geometryEngine-5a631b21.js b/assets/geometryEngine-5a631b21.js new file mode 100644 index 0000000..77ccae4 --- /dev/null +++ b/assets/geometryEngine-5a631b21.js @@ -0,0 +1 @@ +import{G as t}from"./geometryEngineBase-324c1c81.js";import{hydratedAdapter as r}from"./hydrated-c10ab4a5.js";import"./index-080e108a.js";function i(e){return Array.isArray(e)?e[0].spatialReference:e&&e.spatialReference}function g(e){return t.extendedSpatialReferenceInfo(e)}function h(e,n){return t.clip(r,i(e),e,n)}function m(e,n){return t.cut(r,i(e),e,n)}function w(e,n){return t.contains(r,i(e),e,n)}function R(e,n){return t.crosses(r,i(e),e,n)}function x(e,n,a){return t.distance(r,i(e),e,n,a)}function y(e,n){return t.equals(r,i(e),e,n)}function S(e,n){return t.intersects(r,i(e),e,n)}function A(e,n){return t.touches(r,i(e),e,n)}function D(e,n){return t.within(r,i(e),e,n)}function L(e,n){return t.disjoint(r,i(e),e,n)}function T(e,n){return t.overlaps(r,i(e),e,n)}function V(e,n,a){return t.relate(r,i(e),e,n,a)}function v(e){return t.isSimple(r,i(e),e)}function z(e){return t.simplify(r,i(e),e)}function H(e,n=!1){return t.convexHull(r,i(e),e,n)}function I(e,n){return t.difference(r,i(e),e,n)}function J(e,n){return t.symmetricDifference(r,i(e),e,n)}function N(e,n){return t.intersect(r,i(e),e,n)}function O(e,n=null){return t.union(r,i(e),e,n)}function b(e,n,a,s,c,o){return t.offset(r,i(e),e,n,a,s,c,o)}function j(e,n,a,s=!1){return t.buffer(r,i(e),e,n,a,s)}function q(e,n,a,s,c,o){return t.geodesicBuffer(r,i(e),e,n,a,s,c,o)}function B(e,n,a=!0){return t.nearestCoordinate(r,i(e),e,n,a)}function C(e,n){return t.nearestVertex(r,i(e),e,n)}function E(e,n,a,s){return t.nearestVertices(r,i(e),e,n,a,s)}function f(e){var n;return"xmin"in e?"center"in e?e.center:null:"x"in e?e:"extent"in e?((n=e.extent)==null?void 0:n.center)??null:null}function P(e,n,a){if(e==null)throw new u;const s=e.spatialReference;if((a=a??f(e))==null)throw new u;const c=e.constructor.fromJSON(t.rotate(e,n,a));return c.spatialReference=s,c}function G(e,n){if(e==null)throw new u;const a=e.spatialReference;if((n=n??f(e))==null)throw new u;const s=e.constructor.fromJSON(t.flipHorizontal(e,n));return s.spatialReference=a,s}function $(e,n){if(e==null)throw new u;const a=e.spatialReference;if((n=n??f(e))==null)throw new u;const s=e.constructor.fromJSON(t.flipVertical(e,n));return s.spatialReference=a,s}function k(e,n,a,s){return t.generalize(r,i(e),e,n,a,s)}function F(e,n,a){return t.densify(r,i(e),e,n,a)}function K(e,n,a,s=0){return t.geodesicDensify(r,i(e),e,n,a,s)}function M(e,n){return t.planarArea(r,i(e),e,n)}function Q(e,n){return t.planarLength(r,i(e),e,n)}function U(e,n,a){return t.geodesicArea(r,i(e),e,n,a)}function W(e,n,a){return t.geodesicLength(r,i(e),e,n,a)}function X(e,n){return t.intersectLinesToPoints(r,i(e),e,n)}function Y(e,n){t.changeDefaultSpatialReferenceTolerance(e,n)}function Z(e){t.clearDefaultSpatialReferenceTolerance(e)}class u extends Error{constructor(){super("Illegal Argument Exception")}}export{j as buffer,Y as changeDefaultSpatialReferenceTolerance,Z as clearDefaultSpatialReferenceTolerance,h as clip,w as contains,H as convexHull,R as crosses,m as cut,F as densify,I as difference,L as disjoint,x as distance,y as equals,g as extendedSpatialReferenceInfo,G as flipHorizontal,$ as flipVertical,k as generalize,U as geodesicArea,q as geodesicBuffer,K as geodesicDensify,W as geodesicLength,N as intersect,X as intersectLinesToPoints,S as intersects,v as isSimple,B as nearestCoordinate,C as nearestVertex,E as nearestVertices,b as offset,T as overlaps,M as planarArea,Q as planarLength,V as relate,P as rotate,z as simplify,J as symmetricDifference,A as touches,O as union,D as within}; diff --git a/assets/geometryEngineAsync-e8b91fe5.js b/assets/geometryEngineAsync-e8b91fe5.js new file mode 100644 index 0000000..345fd60 --- /dev/null +++ b/assets/geometryEngineAsync-e8b91fe5.js @@ -0,0 +1 @@ +import{c7 as l,cs as f,fD as d}from"./index-080e108a.js";function i(t){var r;return Array.isArray(t)?(r=t[0])==null?void 0:r.spatialReference:t==null?void 0:t.spatialReference}function w(t){return t&&(Array.isArray(t)?t.map(w):t.toJSON?t.toJSON():t)}function c(t){return Array.isArray(t)?t.map(r=>f(r)):f(t)}function m(t,r){let n;return Array.isArray(t)?n=t:(n=[],n.push(t),r!=null&&n.push(r)),n}let s;async function g(){return s||(s=d("geometryEngineWorker",{strategy:"distributed"})),s}async function e(t,r){return(await g()).invoke("executeGEOperation",{operation:t,parameters:w(r)})}async function h(t,r){return c(await e("clip",[i(t),t,r]))}async function O(t,r){return c(await e("cut",[i(t),t,r]))}function S(t,r){return e("contains",[i(t),t,r])}function J(t,r){return e("crosses",[i(t),t,r])}function N(t,r,n){return e("distance",[i(t),t,r,n])}function E(t,r){return e("equals",[i(t),t,r])}function R(t,r){return e("intersects",[i(t),t,r])}function v(t,r){return e("touches",[i(t),t,r])}function D(t,r){return e("within",[i(t),t,r])}function b(t,r){return e("disjoint",[i(t),t,r])}function k(t,r){return e("overlaps",[i(t),t,r])}function L(t,r,n){return e("relate",[i(t),t,r,n])}function j(t){return e("isSimple",[i(t),t])}async function B(t){return c(await e("simplify",[i(t),t]))}async function C(t,r=!1){return c(await e("convexHull",[i(t),t,r]))}async function G(t,r){return c(await e("difference",[i(t),t,r]))}async function H(t,r){return c(await e("symmetricDifference",[i(t),t,r]))}async function V(t,r){return c(await e("intersect",[i(t),t,r]))}async function W(t,r=null){const n=m(t,r);return c(await e("union",[i(n),n]))}async function $(t,r,n,a,u,o){return c(await e("offset",[i(t),t,r,n,a,u,o]))}async function q(t,r,n,a=!1){const u=[i(t),t,r,n,a];return c(await e("buffer",u))}async function z(t,r,n,a,u,o){const p=[i(t),t,r,n,a,u,o];return c(await e("geodesicBuffer",p))}async function F(t,r,n=!0){const a=await e("nearestCoordinate",[i(t),t,r,n]);return{...a,coordinate:l.fromJSON(a.coordinate)}}async function I(t,r){const n=await e("nearestVertex",[i(t),t,r]);return{...n,coordinate:l.fromJSON(n.coordinate)}}function A(t){var r;return"xmin"in t?t.center:"x"in t?t:(r=t.extent)==null?void 0:r.center}async function K(t,r,n){if(t==null)throw new y;const a=t.spatialReference;if((n=n??A(t))==null)throw new y;const u=t.constructor.fromJSON(await e("rotate",[a,t,r,n]));return u.spatialReference=a,u}async function M(t,r,n,a){return c(await e("generalize",[i(t),t,r,n,a]))}async function P(t,r,n){return c(await e("densify",[i(t),t,r,n]))}async function T(t,r,n,a=0){return c(await e("geodesicDensify",[i(t),t,r,n,a]))}function U(t,r){return e("planarArea",[i(t),t,r])}function Z(t,r){return e("planarLength",[i(t),t,r])}function Q(t,r,n){return e("geodesicArea",[i(t),t,r,n])}function X(t,r,n){return e("geodesicLength",[i(t),t,r,n])}class y extends Error{constructor(){super("Illegal Argument Exception")}}export{b as A,M as B,P as C,V as D,G as E,Z as F,K as H,j as J,Q as K,q as L,X as M,B as N,k as O,z as P,L as R,v as S,F as T,T as U,I as V,U as W,W as b,N as d,E as g,R as h,C as j,H as k,J as m,S as p,$ as v,O as w,D as x,h as y}; diff --git a/assets/geometryEngineBase-324c1c81.js b/assets/geometryEngineBase-324c1c81.js new file mode 100644 index 0000000..cd56a01 --- /dev/null +++ b/assets/geometryEngineBase-324c1c81.js @@ -0,0 +1 @@ +import{bU as pi}from"./index-080e108a.js";function vi(ct,dt){for(var lt=0;ltrt[_]})}}}return Object.freeze(Object.defineProperty(ct,Symbol.toStringTag,{value:"Module"}))}var At={exports:{}};(function(ct,dt){function lt(){function _(e){if(typeof e=="number")return k.Uc.ah(e);if(e==null)return null;if(kt[e]!=null)return k.Uc.ah(kt[e]);throw Error("Unrecognised Unit Type")}function ut(e){if(typeof e=="number")return k.Uc.ah(e);if(e==null)return null;if(Mt[e]!=null)return k.Uc.ah(Mt[e]);throw Error("Unrecognised Unit Type")}function pt(e){if(e)switch(e){case"loxodrome":return 1;case"great-elliptic":return 2;case"normal-section":return 3;case"shape-preserving":return 4}return 0}function Y(e,y,f,r){if(f==null||f.B())return null;switch(f.K()){case k.sn.Point:return e.exportPoint(y,f,r);case k.sn.Polygon:return e.exportPolygon(y,f,r);case k.sn.Polyline:return e.exportPolyline(y,f,r);case k.sn.MultiPoint:return e.exportMultipoint(y,f,r);case k.sn.Envelope:return e.exportExtent(y,f,r)}return null}function gt(e,y,f,r){if(f.K()!==k.sn.Point)throw Error("Geometry not Point");return e.exportPoint(y,f,r)}function G(e,y,f){return e.convertToGEGeometry(y,f)}function T(e){var y=e.wkid;e=e.wkt;var f=at.get(y||e);return f==null&&(y!==-1&&y!=null?(f=k.Gg.create(y),at.set(y,f)):e&&(f=k.Gg.lP(e),at.set(e,f)),ft.has(y||e)&&f.QW(ft.get(y||e))),f}function Nt(e){var y;if(e==null)return null;var f=T(e);return e=f.Id(),f=f.Mn(),(y={}).tolerance=f,y.unitType=e==null?-1:e.pd,y.unitID=e==null?-1:e.Fc(),y.unitBaseFactor=e==null?0:e.ci,y.unitSquareDerivative=e==null?0:k.Uc.WF(e).Fc(),y}function It(e,y,f,r){return f==null?null:(f=k.ac.clip(G(e,q,f),G(e,q,r),T(y)),Y(e,q,f,y))}function Pt(e,y,f,r){f=k.ac.fl(G(e,q,f),G(e,q,r),T(y)),r=[];for(var n=0;n>6)>>1},r.Tn=function(n){return(32&n)!=0},r.PS=function(n){return(128&n)!=0},r.zd=function(n){return(256&n)!=0},r.zj=function(n){return(512&n)!=0},r.Ic=function(n){return(1024&n)!=0},r.prototype.Qf=function(){var n=this.Ja();return this.copyTo(n),n},r.prototype.ng=function(){return null},r.kg=function(n){var t=n.Ja();return n.copyTo(t),t},r.prototype.wc=function(){0<=this.QA&&(this.QA+=2147483649)},r.zx=function(n){var t=n.K();if(r.zj(t))return n.I();if(n.B())return 0;if(t==197)return 4;if(t==33)return 1;if(r.zd(t))return 2;throw e.i.ga("missing type")},r}();e.ba=f})(k||(k={})),it=k||(k={}),jt=function(){function e(){this.y=this.x=0}return e.construct=function(y,f){var r=new e;return r.x=y,r.y=f,r},e.cl=function(y){var f=new e;return f.x=y.x,f.y=y.y,f},e.prototype.na=function(y,f){this.x=y,this.y=f},e.prototype.N=function(y){this.x=y.x,this.y=y.y},e.prototype.hq=function(y,f){return this.x===y&&this.y===f},e.prototype.Mz=function(y){return 2220446049250313e-31>=Math.abs(this.x-y.x)&&2220446049250313e-31>=Math.abs(this.y-y.y)},e.prototype.rb=function(y){return this.x===y.x&&this.y===y.y},e.prototype.Nb=function(y){return y==this||y instanceof e&&this.x==y.x&&this.y==y.y},e.prototype.sub=function(y){this.x-=y.x,this.y-=y.y},e.prototype.vc=function(y,f){this.x=y.x-f.x,this.y=y.y-f.y},e.prototype.add=function(y,f){f!==void 0?(this.x=y.x+f.x,this.y=y.y+f.y):(this.x+=y.x,this.y+=y.y)},e.prototype.Uq=function(){this.x=-this.x,this.y=-this.y},e.prototype.nt=function(y){this.x=-y.x,this.y=-y.y},e.prototype.IS=function(y,f,r){this.x=y.x*(1-r)+f.x*r,this.y=y.y*(1-r)+f.y*r},e.prototype.Dt=function(y,f){this.x=this.x*y+f.x,this.y=this.y*y+f.y},e.prototype.BW=function(y,f,r){this.x=f.x*y+r.x,this.y=f.y*y+r.y},e.prototype.scale=function(y){this.x*=y,this.y*=y},e.prototype.compare=function(y){return this.yy.y?1:this.xy.x?1:0},e.prototype.normalize=function(){var y=this.length();y==0&&(this.x=1,this.y=0),this.x/=y,this.y/=y},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.Uk=function(){return this.x*this.x+this.y*this.y},e.ub=function(y,f){return Math.sqrt(this.zc(y,f))},e.Jy=function(y,f,r,n){return y-=r,f-=n,Math.sqrt(y*y+f*f)},e.prototype.Sh=function(y){return this.x*y.x+this.y*y.y},e.prototype.aD=function(y){return Math.abs(this.x*y.x)+Math.abs(this.y*y.y)},e.prototype.yi=function(y){return this.x*y.y-this.y*y.x},e.prototype.Ct=function(y,f){var r=-this.x*f+this.y*y;this.x=this.x*y+this.y*f,this.y=r},e.prototype.Jv=function(){var y=this.x;this.x=-this.y,this.y=y},e.prototype.HG=function(y){this.x=-y.y,this.y=y.x},e.prototype.cr=function(){var y=this.x;this.x=this.y,this.y=-y},e.prototype.su=function(){return 0(y=y.yi(f))?1:0(r=n.value())?-1:0r?-1:0=t?r+(n-r)*t:n-(n-r)*(1-t)},f.JG=function(r,n,t,i){.5>=t?(i.x=r.x+(n.x-r.x)*t,i.y=r.y+(n.y-r.y)*t):(i.x=n.x-(n.x-r.x)*(1-t),i.y=n.y-(n.y-r.y)*(1-t))},f.gT=function(r,n,t,i,h,s){.5>=h?(s.x=r+(t-r)*h,s.y=n+(i-n)*h):(s.x=t-(t-r)*(1-h),s.y=i-(i-n)*(1-h))},f}()}(k||(k={})),function(e){var y=function(f){function r(){var n=f.call(this)||this;return n.ta=0,n.oa=0,n.qa=0,n.ma=0,n.la=null,n}return J(r,f),r.prototype.bc=function(){return e.h.construct(this.ta,this.oa)},r.prototype.$p=function(n){n.x=this.ta,n.y=this.oa},r.prototype.Ec=function(n){this.gm(0,n)},r.prototype.UB=function(n,t){this.gm(0,e.h.construct(n,t))},r.prototype.Vo=function(n){this.cD(0,n)},r.prototype.setStart=function(n){this.pD(0,n)},r.prototype.yv=function(n,t){return this.Pd(0,n,t)},r.prototype.TB=function(n,t,i){this.vn(0,n,t,i)},r.prototype.xc=function(){return e.h.construct(this.qa,this.ma)},r.prototype.Vr=function(n){n.x=this.qa,n.y=this.ma},r.prototype.Rc=function(n){this.gm(1,n)},r.prototype.Sl=function(n,t){this.gm(1,e.h.construct(n,t))},r.prototype.Ro=function(n){this.cD(1,n)},r.prototype.setEnd=function(n){this.pD(1,n)},r.prototype.jv=function(n,t){return this.Pd(1,n,t)},r.prototype.JB=function(n,t,i){this.vn(1,n,t,i)},r.prototype.Eb=function(){return 1},r.prototype.B=function(){return this.Bc()},r.prototype.Pa=function(){},r.prototype.He=function(){return 0},r.prototype.Fa=function(n,t,i,h,s){return this.FM(n,t,i,h,s)},r.prototype.isIntersecting=function(n,t){return this.Br(n,t,!1)!=0},r.prototype.ss=function(n,t){return this.tu(n,t,!1)},r.prototype.tu=function(){return null},r.prototype.Bc=function(){return!1},r.prototype.$x=function(n){if(this.wc(),this.la==null&&0=e.sa.Wa(t))throw e.i.de();var h=this.description.Rf(t);return 0<=h?(this.la!=null&&this.$x(this.description.Be.length-2),this.la[r.Ig(this.description,n)+this.description.bk(h)-2+i]):e.sa.te(t)},r.prototype.vn=function(n,t,i,h){if(this.wc(),i>=e.sa.Wa(t))throw e.i.de();var s=this.description.Rf(t);0>s&&(this.se(t),s=this.description.Rf(t)),t==0?n!=0?i!=0?this.ma=h:this.qa=h:i!=0?this.oa=h:this.ta=h:(this.la==null&&this.$x(this.description.Be.length-2),this.la[r.Ig(this.description,n)+this.description.bk(s)-2+i]=h)},r.prototype.copyTo=function(n){if(n.K()!=this.K())throw e.i.O();n.description=this.description,n.$x(this.description.Be.length-2),r.bM(this.la,n.la,2*(this.description.Be.length-2)),n.ta=this.ta,n.oa=this.oa,n.qa=this.qa,n.ma=this.ma,n.wc(),this.qp(n)},r.prototype.Vg=function(n,t){var i=new e.Oc;return this.Bc()?(i.Pa(),i):(i.pa=this.Pd(0,n,t),i.wa=i.pa,i.Nk(this.Pd(1,n,t)),i)},r.prototype.UI=function(n){this.Bc()?n.Pa():(n.pa=this.Pd(0,0,0),n.wa=n.pa,n.Nk(this.Pd(1,0,0)))},r.prototype.Vw=function(n,t){t.Pf(this.description),t.Db(this.ic(n));for(var i=1,h=this.description.Ba;it||t>=this.xa)throw e.i.ga("index out of bounds");this.oc(),i.Pf(this.description),i.B()&&i.wn();for(var h=0;ht||t>=this.I())throw e.i.de();this.oc(),this.Aa[0].uc(2*t,i)},n.prototype.Oa=function(t){var i=new e.h;return this.D(t,i),i},n.prototype.Hc=function(t,i){this.Aa[0].uc(2*t,i)},n.prototype.Db=function(t,i,h){if(0>t||t>=this.xa)throw e.i.de();this.oc();var s=this.Aa[0];h!==void 0?(s.write(2*t,i),s.write(2*t+1,h)):s.Vt(2*t,i),this.Qc(1993)},n.prototype.xz=function(){if(void 0>=this.I())throw e.i.de();this.oc();var t=this.Aa[0],i=new e.Od;return i.x=t.read(NaN),i.y=t.read(NaN),i.z=this.hasAttribute(1)?this.Aa[1].gg(void 0):e.sa.te(1),i},n.prototype.ZB=function(t){if(0>t||t>=this.I())throw e.i.de();this.se(1),this.oc(),this.Qc(1993);var i=this.Aa[0];i.write(2*t,(void 0).x),i.write(2*t+1,(void 0).y),this.Aa[1].rr(t,(void 0).z)},n.prototype.Vc=function(t,i,h){if(0>i||i>=this.xa)throw e.i.de();var s=e.sa.Wa(t);if(h>=s)throw e.i.de();this.oc();var o=this.description.Rf(t);return 0<=o?this.Aa[o].gg(i*s+h):e.sa.te(t)},n.prototype.tF=function(t,i){return this.Vc(t,i,void 0)},n.prototype.setAttribute=function(t,i,h,s){if(0>i||i>=this.xa)throw e.i.de();var o=e.sa.Wa(t);if(h>=o)throw e.i.de();this.se(t),this.oc(),t=this.description.Rf(t),this.Qc(1993),this.Aa[t].rr(i*o+h,s)},n.prototype.vb=function(t){return this.vx(),this.se(t),this.oc(),this.Aa[this.description.Rf(t)]},n.prototype.kn=function(t,i){if(i!=null&&e.sa.Vp(t)!=i.Vp())throw e.i.O();this.se(t),t=this.description.Rf(t),this.Aa==null&&(this.Aa=e.Zc.lI(this.description.Ba)),this.Aa[t]=i,this.Qc(16777215)},n.prototype.un=function(t){var i=null;if(this.Aa!=null){var h=e.fe.Kw(t,this.description);i=[];for(var s=0,o=t.Ba;sthis.xa+5?(5*this.xa+3)/4:this.xa),this.Aa[t].resize(s*h,e.sa.te(i))),st)throw e.i.O();t!=this.xa&&(this.xa=t,this.Qc(65535))},n.prototype.qm=function(t){if(!this.ck(1)){if(!this.ck(2))return 0;if(this.LT>=t)return this.ck(8)?1:2}return-1},n.prototype.Eh=function(t,i){if(this.LT=i,t==-1)this.Nf(1,!0),this.Nf(8,!0);else if(this.Nf(1,!1),this.Nf(8,!0),t==0)this.Nf(2,!1),this.Nf(4,!1);else if(t==1)this.Nf(2,!0),this.Nf(4,!1);else{if(t!=2)throw e.i.ga("internal error.");this.Nf(2,!0),this.Nf(4,!0)}},n.prototype.gM=function(){this.Cb!=null&&(this.Cb=null)},n.prototype.fD=function(t,i,h,s){if(0>t||t>=this.xa||0>i||i>=this.xa)throw e.i.ga("index out of bounds");this.oc(),s.Pf(this.description),s.B()&&s.wn();for(var o=0;ot||t>=this.xa)throw e.i.de();this.oc();var i=new e.Ta;i.Pf(this.description),i.B()&&i.wn();for(var h=0;ht||t>=this.xa)throw e.i.de();if(i.B())throw e.i.O();this.oc();for(var h=i.description,s=0;se.P.XA(this.Vm)>>1:n!=-1)?r=n:i=o,n=!0;;){if(0>i){if((o=s[7*r])==-1){i=r,t=this.ob.Nl([-1,-1,r,t,this.il(),-1,-1]),(s=this.ob.o)[7*r]=t;break}r=o}else{if((o=s[7*r+1])==-1){i=s[7*r+6],t=this.ob.Nl([-1,-1,r,t,this.il(),-1,-1]),(s=this.ob.o)[7*r+1]=t;break}r=o}n&&(i*=-1,n=!1)}return this.ky(t,s),s[7*t+2]===-1&&(s[7*h]=t),this.xp(i,t,h,s),t},f.prototype.AF=function(){return this.dR(this.Ne)},f.prototype.wd=function(r,n){n=n==-1?this.Ne:n,this.Tv?this.GP(r,n):this.eY(r,n)},f.prototype.search=function(r,n){for(n=this.uv(n);n!=-1;){var t=this.ao.compare(this,r,n);if(t==0)return n;n=0>t?this.nl(n):this.Zp(n)}return-1},f.prototype.DW=function(r){for(var n=this.uv(-1),t=-1;n!=-1;){var i=r.compare(this,n);if(i==0)return n;0>i?n=this.nl(n):(t=n,n=this.Zp(n))}return t},f.prototype.pJ=function(r){for(var n=this.uv(-1),t=-1;n!=-1;){var i=r.compare(this,n);if(i==0)return n;0>i?(t=n,n=this.nl(n)):n=this.Zp(n)}return t},f.prototype.ka=function(r){return this.ob.U(r,3)},f.prototype.nl=function(r){return this.ob.U(r,0)},f.prototype.Zp=function(r){return this.ob.U(r,1)},f.prototype.getParent=function(r){return this.ob.U(r,2)},f.prototype.lb=function(r){return this.ob.U(r,6)},f.prototype.xe=function(r){return this.ob.U(r,5)},f.prototype.sc=function(r){return r==-1?this.ml(this.Ne):this.ml(r)},f.prototype.Gc=function(r){return r==-1?this.bs(this.Ne):this.bs(r)},f.prototype.UR=function(r){return r==-1?this.XF(this.Ne):this.XF(r)},f.prototype.Uj=function(r,n){this.IB(r,n)},f.prototype.uv=function(r){return r==-1?this.TF(this.Ne):this.TF(r)},f.prototype.clear=function(){this.ob.oj(!1),this.Ne=-1},f.prototype.size=function(r){return r==-1?this.VF(this.Ne):this.VF(r)},f.prototype.FN=function(r,n){for(var t=n[7*r],i=n[7*r+1],h=n[7*r+4];t!=-1||i!=-1;){var s=t!=-1?n[7*t+4]:2147483647;if(i=i!=-1?n[7*i+4]:2147483647,h<=Math.min(s,i))break;s<=i?this.nJ(t,n):this.mJ(r,n),t=n[7*r],i=n[7*r+1]}},f.prototype.ky=function(r,n){if(this.Tv)for(var t=n[7*r+4],i=n[7*r+2];i!=-1&&n[7*i+4]>t;)n[7*i]==r?this.nJ(r,n):this.mJ(i,n),i=n[7*r+2]},f.prototype.mJ=function(r,n){var t=n[7*r+1];n[7*t+2]=n[7*r+2],n[7*r+2]=t;var i=n[7*t];n[7*r+1]=i,i!=-1&&(n[7*i+2]=r),n[7*t]=r,(i=n[7*t+2])!=-1&&(n[7*i]==r?n[7*i]=t:n[7*i+1]=t)},f.prototype.nJ=function(r,n){var t=n[7*r+2];n[7*r+2]=n[7*t+2],n[7*t+2]=r;var i=n[7*r+1];n[7*t]=i,i!=-1&&(n[7*i+2]=t),n[7*r+1]=t,(i=n[7*r+2])!=-1&&(n[7*i]===t?n[7*i]=r:n[7*i+1]=r)},f.prototype.Rk=function(r,n){this.ob.T(r,2,n)},f.prototype.OB=function(r,n){this.ob.T(r,0,n)},f.prototype.SB=function(r,n){this.ob.T(r,1,n)},f.prototype.RB=function(r,n){this.ob.T(r,5,n)},f.prototype.fx=function(r,n){this.ob.T(r,6,n)},f.prototype.SJ=function(r,n){this.ob.T(n,0,r)},f.prototype.nX=function(r){this.ob.T(r,4,0)},f.prototype.qX=function(r,n){this.ob.T(n,5,r)},f.prototype.TF=function(r){return r==-1?-1:this.ob.U(r,0)},f.prototype.ml=function(r){return r==-1?-1:this.ob.U(r,1)},f.prototype.bs=function(r){return r==-1?-1:this.ob.U(r,2)},f.prototype.dR=function(r){return r==-1?-1:this.ob.U(r,3)},f.prototype.VF=function(r){return r==-1?0:this.ob.U(r,4)},f.prototype.XF=function(r){return this.ob.U(r,5)},f.prototype.Rw=function(){return this.ob.Nl([-1,-1,-1,void 0,this.il(),-1,-1])},f.prototype.hl=function(r){r!=-1&&this.ob.kd(r)},f.prototype.il=function(){return this.Vm=e.P.XA(this.Vm),1073741823&this.Vm},f.prototype.AD=function(r,n,t){var i=this.ob.o;if(t==-1||i[7*t]==-1)return r=this.ob.Nl([-1,-1,-1,r,this.il(),-1,-1]),(i=this.ob.o)[7*t]=r,this.xp(-1,r,t,i),r;for(var h=t==-1?-1:i[7*t];;){var s=n==-1?1:this.ao.compare(this,r,h);if(0>s){if((s=this.nl(h))==-1){n=h,r=this.ob.Nl([-1,-1,h,r,this.il(),-1,-1]),(i=this.ob.o)[7*h]=r;break}h=s}else{if(n==1&&s==0)return i[7*t+3]=h,-1;if((s=i[7*h+1])==-1){n=i[7*h+6],r=this.ob.Nl([-1,-1,h,r,this.il(),-1,-1]),(i=this.ob.o)[7*h+1]=r;break}h=s}}return this.ky(r,i),i[7*r+2]===-1&&(i[7*t]=r),this.xp(n,r,t,i),r},f.prototype.xp=function(r,n,t,i){if(r!=-1){var h=i[7*r+5];i[7*r+5]=n}else h=t==-1?-1:i[7*t+2];i[7*n+5]=h,h!=-1&&(i[7*h+6]=n),i[7*n+6]=r,r==(t==-1?-1:i[7*t+1])&&(i[7*t+1]=n),r==-1&&(i[7*t+2]=n),i[7*t+4]=(t==-1?0:i[7*t+4])+1},f.prototype.vB=function(r,n){var t=this.ob.o,i=t[7*r+5];r=t[7*r+6],i!=-1?t[7*i+6]=r:t[7*n+1]=r,r!=-1?t[7*r+5]=i:t[7*n+2]=i,t[7*n+4]=n===-1?-1:t[7*n+4]-1},f.prototype.eY=function(r,n){this.vB(r,n);var t=this.nl(r),i=this.Zp(r),h=this.getParent(r),s=r;if(t!=-1&&i!=-1){this.Vm=e.P.XA(this.Vm);var o=1073741823=r.pa:r.wa>=this.pa},f.prototype.move=function(r){this.B()||(this.pa+=r,this.wa+=r)},f.prototype.normalize=function(){if(!isNaN(this.pa)){if(this.pa>this.wa){var r=this.pa;this.pa=this.wa,this.wa=r}isNaN(this.wa)&&this.Pa()}},f.prototype.Pa=function(){this.wa=this.pa=NaN},f.prototype.B=function(){return isNaN(this.pa)},f.prototype.$b=function(r){typeof r=="number"?this.B()?this.wa=this.pa=r:this.Nk(r):r.B()||(this.B()?(this.pa=r.pa,this.wa=r.wa):(this.pa>r.pa&&(this.pa=r.pa),this.wathis.wa&&this.Pa()))},f.prototype.Nk=function(r){rthis.wa&&(this.wa=r)},f.prototype.contains=function(r){return typeof r=="number"?r>=this.pa&&r<=this.wa:r.pa>=this.pa&&r.wa<=this.wa},f.prototype.Fa=function(r){this.B()||r.B()?this.Pa():(this.par.wa&&(this.wa=r.wa),this.pa>this.wa&&this.Pa())},f.prototype.X=function(r){this.B()||(this.pa-=r,this.wa+=r,this.wan?(this.pa=n,this.wa=r):(this.pa=r,this.wa=n)},f.prototype.Kt=function(r){return e.P.Tk(r,this.pa,this.wa)},f.prototype.S=function(){return this.wa-this.pa},f.prototype.tf=function(){return .5*(this.pa+this.wa)},f.prototype.Nb=function(r){return r==this||r instanceof f&&(!(!this.B()||!r.B())||this.pa==r.pa&&this.wa==r.wa)},f.prototype.dc=function(){return e.P.wj(e.P.wj())},f}();e.Oc=y}(k||(k={})),function(e){var y=new e.Oc,f=new e.Oc,r=function(){this.oe=null,this.pb=-1,this.tb=new e.zb,this.lA=55555555,this.Vv=this.Xv=!1,this.Wf=new e.Oc,this.Wf.FB(0,0)};e.EY=r;var n=function(){function t(i,h,s){this.g=i,this.Jk=NaN,this.IH=this.Mq=0,this.JH=NaN,this.ra=h,this.Pq=10*h,this.KH=this.LH=NaN,this.sg=!1,this.Fm=this.ht=this.No=this.Zs=this.Ys=-1,this.bA=s,this.OA=new r,this.TH=new r,e.P.truncate(3*i.gd/2)}return t.prototype.hG=function(i,h,s,o){i.oe=o===null?null:o[s[5*h]],i.Vv=i.oe!=null,i.Vv||((o=s[5*h+2])!==-1&&this.g.hW(s[5*h],s[5*o],i.tb),i.oe=i.tb,i.Wf.FB(i.tb.ta,i.tb.qa),i.Wf.wa+=this.ra,i.tb.mI(),i.Xv=i.tb.ma==i.tb.oa,i.Xv||(i.lA=(i.tb.qa-i.tb.ta)/(i.tb.ma-i.tb.oa)))},t.prototype.JO=function(i,h){var s=i.Br(h,this.ra,!0);return s!=0?s==2?this.Ly():this.zi():(i.$p(ht),i.Vr(et),h.$p(st),h.Vr(ot),Q.na(this.Mq,this.Jk),ht.rb(st)&&this.Jk==ht.y?0>et.compare(ot)?Q.N(et):Q.N(ot):ht.rb(ot)&&this.Jk==ht.y?0>et.compare(st)?Q.N(et):Q.N(st):st.rb(et)&&this.Jk==st.y?0>ht.compare(ot)?Q.N(ht):Q.N(ot):et.rb(ot)&&this.Jk==et.y&&(0>ht.compare(st)?Q.N(ht):Q.N(st)),i.Me(Q.y,Q.x)s&&0>i?-1:0h.qa){if(h.qa>h.ta&&h.ma-h.oa<2*this.ra&&i.xi(h.qa,h.ma,this.ra))return this.zi()}else if((h.ma-h.oa)/(h.qa-h.ta)*(i.qa-i.ta)h.ta&&h.ma-h.oa<2*this.ra&&i.xi(h.qa,h.ma,this.ra))return this.zi()}else if((h.ma-h.oa)/(h.qa-h.ta)*(i.ta-i.qa)o&&0>s?-1:0h+u?s:o.xi(i.ta,i.oa,this.ra)?this.zi():ah+u?s:o.xi(i.qa,i.ma,this.ra)?this.zi():aa?1:0)},t.prototype.Mr=function(){this.sg=!1},t.prototype.tm=function(){return this.Pi},t.prototype.VJ=function(i,h){this.Jk=i,this.Mq=h,this.ht=this.No=this.Zs=this.Ys=-1},t.prototype.compare=function(i,h,s){return this.sg?-1:(i=i.ka(s),this.Fm=s,this.ME(h,h,i,i))},t.prototype.ME=function(i,h,s,o){if(this.No==h)var a=this.OA;else this.No=h,a=this.OA,this.OA.pb=i,this.hG(a,h,this.g.ud.o,this.g.Te);if(u==null){this.ht=o;var u=this.TH;this.TH.pb=s,this.hG(u,o,this.g.ud.o,this.g.Te)}return a.Vv||u.Vv?this.IO(h,o,a,u):a.Wf.wathis.Wf.wa)return 1;if(this.je.oa==this.je.ma)return this.Fm=r,this.sg=!0,0;this.je.mI(),t=this.je.bc(),(n=new e.h).vc(this.je.xc(),t),n.cr();var i=new e.h;return i.vc(this.Iq,t),t=n.Sh(i),(t/=n.length())<10*-this.ra?-1:t>10*this.ra?1:this.je.ss(this.Iq,this.ra)&&((n=Math.abs(t))t?-1:1},f}();e.WL=y}(k||(k={})),function(e){function y(r,n,t,i){t=new Float64Array(r.subarray(t,i)),r.set(t,n)}var f=function(){function r(n){this.Pb=this.rk=!1,this.o=null;var t=n;2>t&&(t=2),this.o=new Float64Array(t),this.size=n}return r.prototype.rotate=function(n,t,i){if(this.Pb)throw e.i.ga("invalid_call");if(ti||n>i)throw e.i.O();n!=t&&i!=t&&(this.pi(n,t-n,1),this.pi(t,i-t,1),this.pi(n,i-n,1))},r.rf=function(n,t){var i=new r(n),h=i.o;if(2>n&&(n=2),t!==0)for(var s=0;st&&(i.size=t),2>(t=i.size)&&(t=2),i.o=new Float64Array(t),i.o.set(n.o.length<=t?n.o:n.o.subarray(0,t),0),i},r.prototype.Jb=function(n){0>=n||(this.o==null?this.o=new Float64Array(n):n<=this.o.length||(0this.o.length&&(i=e.P.truncate(64>n?Math.max(2*n,4):5*n/4),(i=new Float64Array(i)).set(this.o),this.o=i),i=this.o;for(var h=this.size;hthis.o.length)&&this.resize(n),this.rk)throw e.i.ga("invalid call. Attribute Stream is locked and cannot be resized.");this.size=n},r.prototype.rr=function(n,t){this.write(n,t)},r.prototype.Cn=function(n,t,i){for(var h=this.size;th||i>s&&h!=s)return!1;for(i>h&&(i=h);ts||i%s!=0))throw e.i.O();var o=this.size;if(this.resize(o+i),h)this.o.set(n.o.subarray(t,t+i),o);else{h=i;for(var a=0;ao||h%o!=0))throw e.i.O();var u=this.size-a;if(uo&&(o=this.size),this.size+2*h>this.o.length?this.resize(this.size+2*h):this.size+=2*h,y(this.o,n+2*h,n,n+(o-n)),s)for(s=0;sn||0>t||0>h||!s&&(0>=o||t%o!=0)||i.sizethis.size)throw e.i.Hb();0i||t%i!=0)throw e.i.Hb();for(var h=t>>1,s=0;st||0>i||0>t||i+t>this.size)throw e.i.O();for(var h=t;hn||0>t||0>h)throw e.i.O();if(t!=0)for(this.size<(t<<1)+n&&this.resize((t<<1)+n),s||(n+=t-1<<1),s=s?2:-2,t+=h;hn||0>t)throw e.i.O();if(t!=0){this.size<(t<<1)+n&&this.resize((t<<1)+n),t+=0;for(var h=0;hn||0>t||0>h||this.sizen||0>t||this.size<(t>>1)+n)throw e.i.O();if(t!=0){t=0+t;for(var h=0;ht&&(t=2),this.o=new Int32Array(t),this.size=n}return r.prototype.rotate=function(n,t,i){if(this.Pb)throw e.i.ga("invalid_call");if(ti||n>i)throw e.i.O();n!=t&&i!=t&&(this.pi(n,t-n,1),this.pi(t,i-t,1),this.pi(n,i-n,1))},r.rf=function(n,t){var i=new r(n),h=i.o;if(2>n&&(n=2),t!==0)for(var s=0;st&&(i.size=t),2>(t=i.size)&&(t=2),i.o=new Int32Array(t),i.o.set(n.o.length<=t?n.o:n.o.subarray(0,t),0),i},r.prototype.Jb=function(n){0>=n||(this.o==null?this.o=new Int32Array(n):n<=this.o.length||(0this.o.length&&(i=e.P.truncate(64>n?Math.max(2*n,4):5*n/4),(i=new Int32Array(i)).set(this.o),this.o=i),i=this.o;for(var h=this.size;hthis.o.length)&&this.resize(n),this.rk)throw e.i.ga("invalid call. Attribute Stream is locked and cannot be resized.");this.size=n},r.prototype.rr=function(n,t){this.write(n,t)},r.prototype.Cn=function(n,t,i){for(var h=this.size;th||i>s&&h!=s)return!1;for(i>h&&(i=h);ts||i%s!=0))throw e.i.O();var o=this.size;if(this.resize(o+i),h)this.o.set(n.o.subarray(t,t+i),o);else{h=i;for(var a=0;ao||h%o!=0))throw e.i.O();if(y(this.o,n+h,n,n+(a-n)),this.o==t.o&&no&&(o=this.size),this.size+2*h>this.o.length?this.resize(this.size+2*h):this.size+=2*h,y(this.o,n+2*h,n,n+(o-n)),s)for(s=0;sn||0>t||0>h||!s&&(0>=o||t%o!=0)||i.sizethis.size)throw e.i.Hb();0i||t%i!=0)throw e.i.Hb();for(var h=t>>1,s=0;st||0>i||0>t||i+t>this.size)throw e.i.O();for(var h=t;hn||0>t||0>h)throw e.i.O();if(t!=0)for(this.size<(t<<1)+n&&this.resize((t<<1)+n),s||(n+=t-1<<1),s=s?2:-2,t+=h;hn||0>t||0>h||this.sizet-n?r.mG(this.o,n,t,i):r.lB(this.o,n,t-1,i)},r.prototype.Vp=function(){return 2},r.prototype.Gc=function(){return this.o[this.size-1]},r.prototype.Jf=function(){this.resize(this.size-1)},r.prototype.XW=function(n){this.o[this.size-1]=n},r.prototype.NV=function(n){n=t&&0=i))for(;;){if(9>i-t){r.mG(n,t,i+1,h);break}var s=n[t];r.sx(n,t,i);for(var o=t,a=t;a=h(n[a],s)&&(r.sx(n,o,a),o+=1);r.sx(n,o,i),o-tt&&(t=2),this.o=new Int8Array(t),this.size=n}return r.prototype.rotate=function(n,t,i){if(this.Pb)throw e.i.ga("invalid_call");if(ti||n>i)throw e.i.O();n!=t&&i!=t&&(this.pi(n,t-n,1),this.pi(t,i-t,1),this.pi(n,i-n,1))},r.rf=function(n,t){var i=new r(n),h=i.o;if(2>n&&(n=2),t!==0)for(var s=0;st&&(i.size=t),2>(t=i.size)&&(t=2),i.o=new Int8Array(t),i.o.set(n.o.length<=t?n.o:n.o.subarray(0,t),0),i},r.prototype.Jb=function(n){0>=n||(this.o==null?this.o=new Int8Array(n):n<=this.o.length||(0this.o.length&&(i=e.P.truncate(64>n?Math.max(2*n,4):5*n/4),(i=new Int8Array(i)).set(this.o),this.o=i),i=this.o;for(var h=this.size;hthis.o.length)&&this.resize(n),this.rk)throw e.i.ga("invalid call. Attribute Stream is locked and cannot be resized.");this.size=n},r.prototype.rr=function(n,t){this.write(n,t)},r.prototype.Cn=function(n,t,i){for(var h=this.size;th||i>s&&h!=s)return!1;for(i>h&&(i=h);ts||i%s!=0))throw e.i.O();var o=this.size;if(this.resize(o+i),h)this.o.set(n.o.subarray(t,t+i),o);else{h=i;for(var a=0;ao||h%o!=0))throw e.i.O();if(y(this.o,n+h,n,n+(a-n)),this.o==t.o&&no&&(o=this.size),this.size+2*h>this.o.length?this.resize(this.size+2*h):this.size+=2*h,y(this.o,n+2*h,n,n+(o-n)),s)for(s=0;sn||0>t||0>h||!s&&(0>=o||t%o!=0)||i.sizethis.size)throw e.i.Hb();0i||t%i!=0)throw e.i.Hb();for(var h=t>>1,s=0;st||0>i||0>t||i+t>this.size)throw e.i.O();for(var h=t;hn||0>t||0>h)throw e.i.O();if(t!=0)for(this.size<(t<<1)+n&&this.resize((t<<1)+n),s||(n+=t-1<<1),s=s?2:-2,t+=h;hn||0>t||0>h||this.sizer?-r:r},f.vi=function(r){return 3552713678800501e-30>r},f.FC=function(r,n,t){return f.R(r-n)<=t*(1+(f.R(r)+f.R(n))/2)},f.$=function(r,n){return f.FC(r,n,3552713678800501e-30)},f.AL=function(r){return 3552713678800501e-30>=f.R(r)},f.Dd=function(r){return f.AL(r)},f}();e.s=y,e.F=function(){function f(){}return f.ip=function(r,n){var t=0;return(r=y.R(r))+(n=y.R(n))!=0&&(r>n?(t=n/r,t=r*Math.sqrt(1+t*t)):(t=r/n,t=n*Math.sqrt(1+t*t))),t},f.Yq=function(r,n,t,i,h){for(var s=[0,0,0],o=[0,0,0],a=0;2>=a;a++)n[a]-=r[a],t[a]-=n[a];t=s[1]*o[2]-s[2]*o[1],n=s[2]*o[0]-s[0]*o[2],s=s[0]*o[1]-s[1]*o[0],r=-1*(t*r[0]+n*r[1]+s*r[2]),i[0]=t,i[1]=n,i[2]=s,i[3]=r,o=f.qn(i),i[0]/=o,i[1]/=o,i[2]/=o,i[3]/=o,h!=0&&(o=y.Dd(s)?y.Dd(r)?y.Mb(1,n):-y.Mb(1,r):y.Mb(1,s),o*=y.Mb(1,h),i[0]*=o,i[1]*=o,i[2]*=o,i[3]*=o)},f.yx=function(r,n,t){t[0]=r[1]*n[2]-n[1]*r[2],t[1]=r[2]*n[0]-n[2]*r[0],t[2]=r[0]*n[1]-n[0]*r[1]},f.Ut=function(r,n){return r[0]*n[0]+r[1]*n[1]+r[2]*n[2]},f.qn=function(r){return f.ip(f.ip(r[0],r[1]),r[2])},f.el=function(r,n,t,i,h,s,o,a){r=f.n(r,n,t);var u=Math.cos(t);s.u=(r+h)*u*Math.cos(i),o.u=(r+h)*u*Math.sin(i),a.u=(r*(1-n)+h)*Math.sin(t)},f.eO=function(r,n,t,i,h,s,o){var a=f.ip(n,t),u=1*Math.sqrt(1-r),c=u/1;if(y.$(a,0))s.u=0,h.u=y.Mb(1.570796326794897,i),o.u=y.R(i)-u;else{s.u=Math.atan2(t,n),t=Math.atan2(1*i,u*a),s=Math.cos(t);var l=Math.sin(t);n=u*r/(1-r),r*=1,t=Math.atan2(i+n*l*l*l,a-r*s*s*s),3.141592653589793r){var t=Math.sqrt(1-r),i=(1-t)/(1+t),h=i*i,s=i*h,o=i*s,a=i*o,u=i*a,c=i*u,l=1.572916666666667*s-3.2578125*a+4.295068359375*c;r=2.142578125*o-6.071484375*u,t=3.129296875*a-11.249837239583334*c;var p=4.775276692708333*u,v=7.958636765252976*c,b=Math.cos(2*n);return n+Math.sin(2*n)*(1.5*i-.84375*s+.525390625*a-.2688395182291667*c-l+t-v+b*(2*(1.3125*h-1.71875*o+1.650146484375*u)-4*r+6*p+b*(4*l-12*t+24*v+b*(8*r-32*p+b*(16*t-80*v+b*(32*p+64*b*v))))))}for(t=1-r,i=r/2,s=(h=y.R(n))*f.av(r)/(1.570796326794897*t),o=9999,u=h,h=0;1e-16h;h++)c=f.w(r,u),a=u-(l=(a=(f.fG(u,r)-i*Math.sin(2*u)/c)/t-s)/(c=1/(c*c*c))),o=y.R(l),u=a;return 0<=n?u:-u},f.lW=function(r,n){return y.vi(n)?r:r*f.av(n)/1.570796326794897},f.ca=function(r){return 0>(r=f.kF(r,6.283185307179586))?r+6.283185307179586:3.141592653589793>y.R(r)||y.$(y.R(r),3.141592653589793)?r:r-6.283185307179586},f.kF=function(r,n){return r-Math.floor(r/n)*n},f.Ch=function(r,n){if(.006884661117170036>n){var t=(n=(1-(n=Math.sqrt(1-n)))/(1+n))*n,i=t*t;return r/(1+n)*(1+.25*t+.015625*i+.00390625*t*i)*1.570796326794897}return r*f.av(n)},f.Xq=function(r,n){var t=y.Mb(1,Math.sin(n));return n=1.570796326794897>=(n=y.R(f.kF(n,3.141592653589793)))?n:3.141592653589793-n,(y.$(n,1.570796326794897)?n:Math.atan(Math.sqrt(1-r)*Math.tan(n)))*t},f.q=function(r,n,t){if(.006884661117170036>n){var i=(n=(1-(n=Math.sqrt(1-n)))/(1+n))*n,h=n*i,s=n*h,o=n*s,a=n*o,u=n*a,c=-.7291666666666666*h+.2278645833333333*o+.03987630208333334*u,l=.615234375*s-.21533203125*a,p=-.54140625*o+.20302734375*u,v=.48876953125*a,b=-.4488699776785715*u,d=Math.cos(2*t);return r/(1+n)*((1+.25*i+.015625*s+.00390625*a)*t+Math.sin(2*t)*(-1.5*n+.1875*h+.0234375*o+.00732421875*u-c+p-b+d*(2*(.9375*i-.234375*s-.03662109375*a)-4*l+6*v+d*(4*c-12*p+24*b+d*(8*l-32*v+d*(16*p-80*b+d*(32*v+64*d*b)))))))}return r*(f.fG(t,n)-.5*n*Math.sin(2*t)/f.w(n,t))},f.w=function(r,n){return n=Math.sin(n),Math.sqrt(1-r*n*n)},f.av=function(r){return y.FC(r,1,2220446049250313e-31)?1:1>r?f.Zw(0,1-r)-r/3*f.Ww(0,1-r):NaN},f.fG=function(r,n){var t=y.Mb(1,r);r=y.R(r);var i=Math.floor(r/1.570796326794897);if(1y.R(i)&&1e-4>y.R(h)&&1e-4>y.R(s));)s=Math.sqrt(a),n+=r/((t=Math.sqrt(u))*(u+(s=Math.sqrt(o)*(s+t)+s*t))),r*=.25,o=.25*(o+s),a=.25*(a+s),u=.25*(u+s);return a=(o=i*h)-(u=s*s),3*n+r*(1+(u=o-6*u)*(.10227272727272728*u-.2142857142857143-.1730769230769231*s*(i=u+a+a))+s*(.1666666666666667*i+s*(-.4090909090909091*a+.1153846153846154*s*o)))/(t*Math.sqrt(t))},f.Zw=function(r,n){for(var t,i,h,s,o=1;i=2-((t=(r+n+o)/3)+r)/t,h=2-(t+n)/t,s=2-(t+o)/t,!(1e-4>y.R(i)&&1e-4>y.R(h)&&1e-4>y.R(s));o=.25*(o+t))t=Math.sqrt(n),i=Math.sqrt(o),r=.25*(r+(t=Math.sqrt(r)*(t+i)+t*i)),n=.25*(n+t);return(1+(.04166666666666666*(r=i*h-s*s)-.1-.06818181818181818*(n=i*h*s))*r+.07142857142857142*n)/Math.sqrt(t)},f.Sw=function(r,n){if(y.vi(r)||n==0||y.$(y.R(n),1.570796326794897))return n;if(.006884661117170036>r){var t=r*r,i=r*t,h=r*i,s=r*h,o=r*s,a=r*o,u=-(.02708333333333333*i+.03430059523809524*h+.03149181547619048*s+.02634359154541446*o+.02156896735835538*a),c=.007669890873015873*h+.01299603174603175*s+.0148051353064374*o+.01454454953803912*a,l=-(.002275545634920635*s+.004830845032667949*o+.006558395368616723*a),p=.0006957236677288761*o+.001775193002406544*a,v=-.000217324089394402*a,b=Math.cos(2*n);return n+Math.sin(2*n)*(-(.5*r+.2083333333333333*t+.09375*i+.04878472222222222*h+.02916666666666667*s+.01938905423280423*o+.01388255931712963*a)-u+l-v+b*(2*(.1041666666666667*t+.0875*i+.06050347222222222*h+.04151785714285714*s+.02958958540013228*o+.02203667534722222*a)-4*c+6*p+b*(4*u-12*l+24*v+b*(8*c-32*p+b*(16*l-80*v+b*(32*p+64*b*v))))))}return n==0||y.$(y.R(n),1.570796326794897)?t=n:(h=(i=Math.sqrt(r))*Math.sin(n),t=Math.tan(.7853981633974483+n/2)*Math.pow((1-h)/(1+h),i/2),t=2*Math.atan(t)-1.570796326794897),t},f.tO=function(r,n){if(y.vi(r)||n==0||y.$(y.R(n),1.570796326794897))return n;if(.006884661117170036>r){var t=r*(p=r*(l=r*(b=r*r))),i=r*(v=r*t),h=.05833333333333333*l+.07232142857142858*p+.05634300595238095*t+.0355325796406526*v+.020235546186067*i,s=.02653149801587302*p+.04379960317460317*t+.0429211791776896*v+.03255384637546096*i,o=.01294022817460318*t+.02668104344536636*v+.03155651254609588*i,a=.00659454790965208*v+.0163075268674227*i,u=.003463473736911237*i,c=Math.cos(2*n);return n+Math.sin(2*n)*(.5*r+.2083333333333333*b+.08333333333333333*l+.03611111111111111*p+.01875*t+.01195601851851852*v+.008863673941798942*i-h+o-u+c*(2*(.1458333333333333*b+.1208333333333333*l+.07039930555555556*p+.03616071428571429*t+.01839451058201058*v+.01017113095238095*i)-4*s+6*a+c*(4*h-12*o+24*u+c*(8*s-32*a+c*(16*o-80*u+c*(32*a+64*c*u))))))}var l=Math.sqrt(r),p=l/2,v=Math.tan(.7853981633974483+n/2);r=0,h=1;for(var b=n;h!=0;b=i)t=l*Math.sin(b),i=v*Math.pow((1+t)/(1-t),p),i=2*Math.atan(i)-1.570796326794897,r++,(y.$(i,b)||3e4this.Mk&&(this.Mk=0);var t=this.Re.getType();if(this.eH=t==e.Tc.PE_TYPE_PROJCS?2:1,t==e.Tc.PE_TYPE_PROJCS&&!r.loadConstants())throw e.i.O("PeProjcs.loadConstants failed");n=t==e.Tc.PE_TYPE_GEOGCS?this.Re:this.Re.getGeogcs(),t!=e.Tc.PE_TYPE_GEOGCS&&e.qf.getCode(n),this.Go=r.getUnit(),this.MH=n.getPrimem().getLongitude(),this.rH=r=n.getUnit().getUnitFactor(),r=Math.PI/(180*r),1e-10>Math.abs(r-1)&&(r=1),this.BA=r,t&e.Tc.PE_TYPE_PROJCS?(n=this.Re,this.CA=1/n.getUnit().getUnitFactor(),this.uw=.001/this.Re.getUnit().getUnitFactor(),this.vw=e.Eg.generate(n,e.Eg.PE_PCSINFO_OPTION_NONE),this.Bl=this.vw.isPannableRectangle(),this.Xz=e.Ab.lN(this.vw.getCentralMeridian(),this.BA)):(this.FA=this.Bl=!0,this.CA=0,t=1/n.getUnit().getUnitFactor(),this.uw=.001/n.getDatum().getSpheroid().getAxis()*t,this.Xz=0),this.Bl&&(this.wx(),this.yK(),this.jY(),this.xK(),this.hY(),this.iY())}return f.prototype.cs=function(){return this.Mk},f.prototype.mk=function(){return this.vw},f.Ky=function(r,n){return r==n||r!=null&&n!=null&&r.Mk==0&&n.Mk==0&&r.Cs===n.Cs},f.prototype.Xc=function(){return this.Bl},f.prototype.ih=function(r){r.L(this.uo)},f.prototype.rv=function(){return this.uo.v},f.prototype.qv=function(){return this.uo.C},f.prototype.BR=function(r){r.L(this.ww)},f.prototype.hY=function(){var r=this.Re.getType();if(r==e.Tc.PE_TYPE_PROJCS){r=this.Re;var n=this.mk().getCentralMeridian(),t=r.getGeogcs();if(t==null)throw e.i.ga("internal error");n=[[n+(t=1/t.getUnit().getUnitFactor()*Math.PI),0]],e.gj.geogToProj(r,1,n),n=n[0][0],t=r.getParameters()[e.Tc.PE_PARM_X0].getValue();var i=this.ol();r=new e.l,i.A(r),n=(i=Math.abs(n-t))+t,t=-1*i+t,i=r.H,r=r.G;var h=new e.l;h.L(t,r,n,i),this.uo==null&&(this.uo=h)}else{if(r!=e.Tc.PE_TYPE_GEOGCS)throw e.i.ga("internal error");t=1/this.Re.getUnit().getUnitFactor()*Math.PI,(r=new e.l).L(-t,-t/2,t,t/2),this.uo==null&&(this.uo=r)}},f.prototype.iY=function(){var r=this.Re.getType();if(r==e.Tc.PE_TYPE_PROJCS){var n=this.Re;if(r=this.mk().getCentralMeridian(),(n=n.getGeogcs())==null)throw e.i.ga("internal error");n=1/n.getUnit().getUnitFactor()*Math.PI;var t=this.Xr(),i=new e.l;t.A(i),(t=new e.l).L(r-n,i.G,r+n,i.H),this.ww==null&&(this.ww=t)}else{if(r!=e.Tc.PE_TYPE_GEOGCS)throw e.i.ga("internal error");n=1/this.Re.getUnit().getUnitFactor()*Math.PI,(r=new e.l).L(-n,-n/2,n,n/2),this.ww==null&&(this.ww=r)}},f.prototype.bf=function(){return this.BA},f.prototype.rm=function(){return this.CA},f.prototype.Xr=function(){if(this.Bl)return this.wl;var r=this.wl;return r??(this.wx(),this.wl)},f.prototype.Yr=function(){return this.Bl?null:(this.wl!=null||this.wx(),this.TG)},f.prototype.wx=function(){if(this.Re.getType()==e.Tc.PE_TYPE_PROJCS){var r=this.Re,n=r.getGeogcs(),t=r.horizonGcsGenerate();if(t!=null){var i=t[0].getNump(),h=t[0].getKind();r=0u&&(t=-400*s,l.L(t,l.G,t+5*a,l.H)),t=new e.Hh(l),this.wl==null&&(this.wl=t,this.Kv=r);else{if(u=new e.Ea,a=this.mk().isGcsHorizonMultiOverlap(),l=e.iu.XE(n,e.ju.Integer64),a){for(u=new e.bL,c=e.Ih.local().W(u,l,null),v=0;vthis.us&&(this.us=0),this.Go=n=this.FT.getUnit(),this.DH=1/n.getUnitFactor(),e.qf.getCode(r)}return f.Ky=function(r,n){return r==n||r!=null&&n!=null&&r.us==0&&n.us==0&&r.Cs===n.Cs},f.prototype.cs=function(){return this.us},f}();e.KL=y}(k||(k={})),function(e){e.$g=function(){function y(){}return y.ub=function(f,r,n,t,i,h,s,o){if(h!=null||s!=null||o!=null){t=e.F.ca(t),r=e.F.ca(r),n=e.F.ca(n),i=e.F.ca(i),1.570796326794897n?t:e.F.ca(3.141592653589793-t):Math.atan2(l*b,u*p-c*l*v)),o!=null&&(e.s.$(e.s.R(i),1.570796326794897)?o.u=0>i?r:e.F.ca(3.141592653589793-r):(o.u=Math.atan2(u*b,p*u*v-l*c),o.u=e.F.ca(o.u+3.141592653589793)))}}},y.sf=function(f,r,n,t,i,h,s){if(h!=null||s!=null){r=e.F.ca(r),n=e.F.ca(n),1.570796326794897p?i:e.F.ca(3.141592653589793-i):r:e.s.$(e.s.R(n),1.570796326794897)&&e.s.$(f,3.141592653589793)?0>n?i:e.F.ca(3.141592653589793-i):e.F.ca(r+Math.atan2(l*a,u*t-c*l*o)))}},y}()}(k||(k={})),function(e){e.Yk=function(){function y(){}return y.ub=function(f,r,n,t,i,h,s,o,a){var u=new e.ha(0),c=new e.ha(0),l=[0,0,0],p=[0,0,0],v=[0,0,0],b=new e.ha(0),d=new e.ha(0),g=new e.ha(0),x=new e.ha(0),m=new e.ha(0);if(s!=null||o!=null||a!=null)if(e.s.vi(r))e.$g.ub(f,n,t,i,h,s,o,a);else{i=e.F.ca(i),n=e.F.ca(n);var w=e.F.ca(i-n);if(e.s.$(t,h)&&(e.s.$(n,i)||e.s.$(e.s.R(t),1.570796326794897)))s!=null&&(s.u=0),o!=null&&(o.u=0),a!=null&&(a.u=0);else{if(e.s.$(t,-h)){if(e.s.$(e.s.R(t),1.570796326794897))return s!=null&&(s.u=2*e.F.Ch(f,r)),o!=null&&(o.u=0w){j=1;var M=n;n=i,i=M,M=t,t=h,h=M}w=e.F.pt(r,t);var A=e.F.pt(r,h);o==null&&a==null||(e.$g.ub(f,n,w,i,A,null,u,c),u=Math.atan2(Math.sin(u.u)*Math.cos(t-w),Math.cos(u.u)),c=Math.atan2(Math.sin(c.u)*Math.cos(h-A),Math.cos(c.u)),j!=0&&(M=u,u=c,c=M),o!=null&&(o.u=u),a!=null&&(a.u=c)),s!=null&&(e.F.el(1,r,t,n,0,g,x,m),l[0]=g.u,l[1]=x.u,l[2]=m.u,e.F.el(1,r,h,i,0,g,x,m),p[0]=g.u,p[1]=x.u,p[2]=m.u,v[0]=l[1]*p[2]-p[1]*l[2],v[1]=-(l[0]*p[2]-p[0]*l[2]),v[2]=l[0]*p[1]-p[0]*l[1],r=1-e.F.w(r,e.F.Xq(r,e.F.Sj(r,Math.acos(v[2]/Math.sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]))))),r*=2-r,o=Math.atan2(-v[1],-v[0]),v=e.F.ca(o-1.570796326794897),o=e.F.ca(o+1.570796326794897),v=e.s.R(e.F.ca(n-v))<=e.s.R(e.F.ca(n-o))?v:o,e.$g.ub(1,v,0,n,w,b,null,null),e.$g.ub(1,v,0,i,A,d,null,null),3.141592653589793i&&(i=e.s.R(i),h=e.F.ca(h+3.141592653589793)),n=e.F.ca(n),t=e.F.ca(t),1.570796326794897=e.s.R(h)?1:-1);h=e.F.ca(n+Math.atan(Math.tan(h)*-Math.sin(g))),e.$g.ub(f,h,0,n,g,null,c,null),g=e.s.R(1.570796326794897-e.s.R(c.u)),g=e.F.Sj(r,g),g=1-e.F.w(r,e.F.Xq(r,g)),g*=2-g,e.F.el(1,r,0,h,0,v,b,d),l[0]=v.u,l[1]=b.u,l[2]=d.u,e.F.el(1,r,t,n,0,v,b,d),p[0]=v.u,p[1]=b.u,p[2]=d.u,t=Math.acos((l[0]*p[0]+l[1]*p[1]+l[2]*p[2])/Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2])),t=e.F.Sj(g,t),i=0<(t=e.F.q(f,g,t)+i*x)?c.u:e.F.ca(c.u+3.141592653589793),f=e.s.R(t)/e.F.Ch(f,g)*1.570796326794897,f=e.F.Tq(g,f),f=e.F.pt(g,f),e.$g.sf(1,h,0,f,i,s,u),o!=null&&(a=u.u),o!=null&&(o.u=e.F.Sj(r,a))}},y}()}(k||(k={})),function(e){e.eu=function(){function y(){}return y.ub=function(f,r,n,t,i,h,s,o,a){var u=0,c=0,l=0;if(s!=null||o!=null||a!=null)if(e.s.vi(r))e.$g.ub(f,n,t,i,h,s,o,a);else{var p=e.F.ca(i-n);if(e.s.$(t,h)&&(e.s.Dd(p)||e.s.$(e.s.R(t),1.570796326794897)))s!=null&&(s.u=0),o!=null&&(o.u=0),a!=null&&(a.u=0);else{if(e.s.$(t,-h)){if(e.s.$(e.s.R(t),1.570796326794897))return s!=null&&(s.u=2*e.F.Ch(f,r)),o!=null&&(o.u=0=N&&!e.s.$(I,j));if(z!=0)v=(b*=u)*(256+b*(b*(74-47*b)-128))/1024,s!=null&&(s.u=d*(1+b*(4096+b*(b*(320-175*b)-768))/16384)*(B-v*D*(c+v/4*(P*(2*l-1)-v/6*c*(4*D*D-3)*(4*l-3))))),o!=null&&(o.u=e.s.$(e.s.R(t),1.570796326794897)?0>t?i:e.F.ca(3.141592653589793-i):Math.atan2(m*A,r*w-x*m*M)),a!=null&&(e.s.$(e.s.R(h),1.570796326794897)?a.u=0>h?n:e.F.ca(3.141592653589793-n):(a.u=Math.atan2(r*A,r*w*M-x*m),a.u=e.F.ca(a.u+3.141592653589793)));else{j=e.s.Mb(3.141592653589793,p),P=x*w-r*m,B=Math.acos(P),D=Math.sin(B),u=1,N=C=0;do l=C,M=1-.25*(C=v*(u*=u)*(1+v+v*v))+.1875*(c=v*v*(M=u*u)*(1+2.25*v))-.1953125*(z=v*v*v*M*u),C=.25*C-.25*c+.29296875*z,A=.03125*c-.05859375*z,z*=.00651041666666667,c=P-2*x*w/u,1=N&&!e.s.$(l,C));s!=null&&(M=1+(b*=u*=u)*(4096+b*(b*(320-175*b)-768))/16384,e.s.$(t,-h)?s.u=3.141592653589793*d*M:(c=P-2*x*w/u,u=Math.acos(c),P=Math.cos(2*u),I=Math.cos(3*u),s.u=d*(M*B+b*(b*(128+b*(35*b-60))-512)/2048*D*c+b*(5*b-4)/6144*b*b*Math.sin(2*B)*P+z*Math.sin(3*B)*I+-762939453125e-16*b*b*b*b*Math.sin(4*B)*Math.cos(4*u)))),o!=null&&(e.s.Dd(t)&&e.s.Dd(h)?(u=Math.sqrt(1-C*C),o.u=Math.acos(u),0>p&&(o.u*=-1)):e.s.$(e.s.R(t),1.570796326794897)?o.u=0>t?i:e.F.ca(3.141592653589793-i):(s=C/r,d=Math.sqrt(1-s*s),0>r*w-x*m*Math.cos(j)&&(d*=-1),o.u=Math.atan2(s,d),e.s.$(t,-h)&&e.s.R(e.F.ca(n-i))>3.141592653589793*(1-v*Math.cos(t))&&(0e.s.R(o.u)||0>t&&1.570796326794897h?n:e.F.ca(3.141592653589793-n):(p=C/m,s=Math.sqrt(1-p*p),d=Math.sin(j/2),0>Math.sin(g-f)-2*r*w*d*d&&(s*=-1),a.u=Math.atan2(p,s),a.u=e.F.ca(a.u+3.141592653589793),e.s.$(t,-h)&&!e.s.Dd(t)&&!e.s.$(e.s.R(t),1.570796326794897)&&e.s.R(e.F.ca(n-i))>3.141592653589793*(1-v*Math.cos(t))&&(o!=null?d=o.u:(s=C/r,d=Math.sqrt(1-s*s),0>r*w-x*m*Math.cos(j)&&(d*=-1),d=Math.atan2(s,d),e.s.$(t,-h)&&e.s.R(e.F.ca(n-i))>3.141592653589793*(1-v*Math.cos(t))&&(0e.s.R(d)||0>t&&1.570796326794897=e.s.R(d)&&1.570796326794897e.s.R(a.u))&&(a.u=-1*e.F.ca(a.u+3.141592653589793))))}}}},y.sf=function(f,r,n,t,i,h,s,o){if(s!=null||o!=null)if(e.s.vi(r))e.$g.sf(f,n,t,i,h,s,o);else if(h=e.F.ca(h),e.s.$(e.s.R(t),1.570796326794897)||e.s.Dd(h)||e.s.$(e.s.R(h),3.141592653589793))e.Yk.sf(f,r,n,t,i,h,s,o);else{var a=e.s.R(h)==1.570796326794897?0:Math.cos(h),u=e.s.R(h)==3.141592653589793?0:Math.sin(h);e.s.$(e.s.R(t),1.570796326794897)&&(n=0),h=1-Math.sqrt(1-r);var c=e.F.Xq(r,t);t=e.s.R(c)==1.570796326794897?0:Math.cos(c);var l=Math.sin(c);c=Math.atan2(Math.tan(c),a);var p=t*u,v=p*p,b=1-v,d=r/(1-r)*b,g=(r=d*(256+d*(d*(74-47*d)-128))/1024)/4,x=r/6,m=i/(f*(1-h)*(1+d*(4096+d*(d*(320-175*d)-768))/16384)),w=m;do{var j=w;i=e.s.R(w)==1.570796326794897?0:Math.cos(w);var M=(d=e.s.R(w)==3.141592653589793?0:Math.sin(w))*d;w=r*d*((f=Math.cos(2*c+w))+g*(i*(2*(w=f*f)-1)-x*f*(4*M-3)*(4*w-3)))+m}while(!e.s.$(j,w));i=e.s.R(w)==1.570796326794897?0:Math.cos(w),d=e.s.R(w)==3.141592653589793?0:Math.sin(w),s!=null&&(u=Math.atan2(d*u,t*i-l*d*a),b=h/16*b*(4+h*(4-3*b)),f=Math.cos(2*c+w),s.u=e.F.ca(n+(u-(1-b)*h*p*(w+b*d*(f+b*i*(2*f*f-1)))))),o!=null&&(b=l*d-t*i*a,b=(1-h)*Math.sqrt(v+b*b),o.u=Math.atan2(l*i+t*d*a,b))}},y}()}(k||(k={})),function(e){e.KC=function(){function y(){}return y.ub=function(f,r,n,t,i,h,s,o,a){var u=e.F.ca(i-n),c=e.s.$(e.s.R(t),1.570796326794897),l=e.s.$(e.s.R(h),1.570796326794897);if(e.s.$(t,h)&&(e.s.Dd(u)||c))s!=null&&(s.u=0),o!=null&&(o.u=0),a!=null&&(a.u=0);else{if(e.s.vi(r)){var p=Math.sin(t),v=Math.sin(h);p=Math.sqrt((1+p)/(1-p)),v=Math.sqrt((1+v)/(1-v)),p=Math.log(v)-Math.log(p),p=Math.atan2(u,p),s!=null&&(s.u=e.s.$(t,h)?e.s.R(f*Math.cos(t)*u):e.s.R((f*h-f*t)/Math.cos(p)))}else v=e.F.Sw(r,h),p=Math.sin(e.F.Sw(r,t)),v=Math.sin(v),p=Math.sqrt((1+p)/(1-p)),v=Math.sqrt((1+v)/(1-v)),p=Math.log(v)-Math.log(p),p=Math.atan2(u,p),s!=null&&(e.s.$(t,h)?s.u=e.s.R(f*u*Math.cos(t)/e.F.w(r,t)):(u=e.F.q(f,r,t),f=e.F.q(f,r,h),s.u=e.s.R((f-u)/Math.cos(p))));o==null&&a==null||(s=e.F.ca(p+3.141592653589793),c&&l||!c&&!l||(c?p=0>t?i:e.F.ca(3.141592653589793-i):l&&(s=0>h?n:e.F.ca(3.141592653589793-n))),o!=null&&(o.u=p),a!=null&&(a.u=s))}},y.sf=function(f,r,n,t,i,h,s,o){h=e.F.ca(h),0>i&&(i=e.s.R(i),h=e.F.ca(h+3.141592653589793)),e.s.vi(r)?e.s.$(e.s.R(t),1.570796326794897)?(n=0>t?h:e.F.ca(3.141592653589793-h),3.141592653589793>=(h=i/f%6.283185307179586)?f=t-e.s.Mb(h,t):(n=e.F.ca(n+3.141592653589793),f=-t+e.s.Mb(h-3.141592653589793,t))):e.s.$(e.s.R(h),1.570796326794897)?(n=e.F.ca(n+e.s.Mb(i,h)/(f*Math.cos(t))),f=t):(f=t+i*Math.cos(h)/f,1.570796326794897t?h:e.F.ca(3.141592653589793-h),h=i/e.F.lW(f,r),3.141592653589793>=(h%=6.283185307179586)?f=t-e.s.Mb(h,t):(n=e.F.ca(n+3.141592653589793),f=-t+e.s.Mb(h-3.141592653589793,t)),f=e.F.Tq(r,f)):e.s.$(e.s.R(h),1.570796326794897)?(n=e.F.ca(n+e.s.Mb(i,h)*e.F.w(r,t)/(f*Math.cos(t))),f=t):(f=1.570796326794897*(i*Math.cos(h)+e.F.q(f,r,t))/e.F.Ch(f,r),1.570796326794897Math.PI||Math.abs(t.y)>.5*Math.PI||Math.abs(i.y)>.5*Math.PI||(Math.abs(t.y)==.5*Math.PI||Math.abs(i.y)==.5*Math.PI)&&t.x!=i.x)return NaN;if(h=r.YA(h,Math.min(t.x,i.x),Math.max(t.x,i.x)),!new e.Oc(t.x,i.x).contains(h))return NaN;var s=y.construct(t);if(i=y.construct(i),s=r.$u(n,s),i=r.$u(n,i),(i=s.YE(i)).z.rg())return t.y;var o=new e.Xb;o.set(i.x),o.lm(i.z),o.Po(-1);var a=new e.Xb;a.set(i.y),a.lm(i.z),a.Po(-1);var u=new e.Xb;return u.set(a),u.Bg(a),(s=new e.Xb).set(o),s.Bg(o),s.add(u),s.sqrt(),s.rg()||o.rg()&&a.rg()?t.y:(t=Math.atan2(a.value(),o.value()),t=Math.atan2(s.value()*Math.cos(t-h),1-n),h=r.yP(n,e.h.construct(h,t)),n=new e.Od(h.x,h.y,-h.z),h=i.value().Sh(h),n=i.value().Sh(n),Math.abs(n)Math.PI||Math.abs(t.y)>.5*Math.PI||Math.abs(i.y)>.5*Math.PI||(Math.abs(t.y)==.5*Math.PI||Math.abs(i.y)==.5*Math.PI)&&t.x!=i.x||Math.abs(h)>=.5*Math.PI||0h&&i.y>h||0>t.y&&0>i.y&&t.yMath.abs(s[1]-t.x)&&(t=s[0],s[0]=s[1],s[1]=t)),h))},r.YA=function(n,t,i){return n>i?n-=2*(t=Math.ceil((n-i)/(2*Math.PI)))*Math.PI:ni.x?(i.x-=i.x%360,-180>i.x&&(i.x+=360)):180i.y&&(i.y=-90);for(var h=-180,s=180,o=(f=5*n)-1,a=(r=(f+31)/32)-1;0<=a;a--)for(var u=o-32*a,c=Math.min(32,f-32*a),l=1;l=p?(t[a]|=1<=p?(t[a]|=1<>h&31;if(31<(h+=5)){var a=37-h;o&=(1<r)for(s=0;s=r[0]?r:'"'+r.trim()+'"'}var f=[];e.SC=function(){function r(){}return r.zQ=function(n){try{for(var t=0;tn||n>this.Ba)throw e.i.O();return this.dg[n]},r.prototype.Rf=function(n){return this.wh[n]},r.gz=function(n){return r.EM[n]},r.Vp=function(n){return r.NM[n]},r.Wa=function(n){return r.mM[n]},r.prototype.hasAttribute=function(n){return 0<=this.wh[n]},r.prototype.dG=function(){return this.hasAttribute(1)},r.te=function(n){return r.$C[n]},r.prototype.GR=function(n){return this.Xs[n]},r.yG=function(n,t){return r.$C[n]===t},r.prototype.Nb=function(n){return this===n},r.prototype.Cn=function(){for(var n=e.P.Vh(this.dg[0]),t=1;t++o&&f(s,u,h.gu),c[0]?a?u=o:(c=s.c,u=s.e+u+1):++u;c.lengths.Cd&&c[0]?"-":"")+(1u?"e":"e+")+u:s.toString()}function f(s,o,a,u){var c=s.c,l=s.e+o+1;if(a===1?u=5<=c[l]:a===2?u=5l||c[l+1]!==void 0||1&c[l-1]):a===3?u=u||c[l]!==void 0||0>l:(u=!1,a!==0&&r("!Big.RM!")),1>l||!c[0])u?(s.e=-o,s.c=[1]):s.c=[s.e=0];else{if(c.length=l--,u)for(;9<++c[l];)c[l]=0,l--||(++s.e,c.unshift(1));for(l=c.length;!c[--l];c.pop());}return s}function r(s){throw(s=Error(s)).name="BigError",s}var n=-7,t=21,i=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,h=function(){function s(o){if(o instanceof s)this.Cd=o.Cd,this.e=o.e,this.c=o.c.slice();else{var a,u,c;for(o===0&&0>1/o?o="-0":i.test(o+="")||r(NaN),this.Cd=o.charAt(0)=="-"?(o=o.slice(1),-1):1,-1<(a=o.indexOf("."))&&(o=o.replace(".","")),0<(u=o.search(/e/i))?(0>a&&(a=u),a+=+o.slice(u+1),o=o.substring(0,u)):0>a&&(a=o.length),u=0;o.charAt(u)=="0";u++);if(u==(c=o.length))this.c=[this.e=0];else{for(;o.charAt(--c)=="0";);for(this.e=a-u-1,this.c=[],a=0;u<=c;this.c[a++]=+o.charAt(u++));}}}return s.prototype.abs=function(){var o=new s(this);return o.Cd=1,o},s.prototype.cmp=function(o){var a=this.c,u=(o=new s(o)).c,c=this.Cd,l=o.Cd,p=this.e,v=o.e;if(!a[0]||!u[0])return a[0]?c:u[0]?-l:0;if(c!=l)return c;if(o=0>c,p!=v)return p>(v^o)?1:-1;for(c=-1,l=(p=a.length)<(v=u.length)?p:v;++c(u[c]^o)?1:-1;return p==v?0:p>(v^o)?1:-1},s.prototype.lm=function(o){var a=this.c,u=(o=new s(o)).c,c=this.Cd==o.Cd?1:-1,l=s.tr;if((l!==~~l||0>l||1e6A?0:A,b.unshift(0);m++v;v++){if(p!=(m=x.length))var z=p>m?1:-1;else{var N=-1;for(z=0;++Nx[N]?1:-1;break}}if(!(0>z))break;for(o=m==p?u:b;m;){if(x[--m]A&&f(w,l,s.gu,x[0]!==void 0),w},s.prototype.aS=function(){return 0this.cmp(0)},s.prototype.kt=function(o){var a,u=this.Cd,c=(o=new s(o)).Cd;if(u!=c)return o.Cd=-c,this.oI(o);var l=this.c.slice(),p=this.e,v=o.c,b=o.e;if(!l[0]||!v[0])return v[0]?(o.Cd=-c,o):new s(l[0]?this:0);if(u=p-b){for((a=0>u)?(u=-u,p=l):(b=p,p=v),p.reverse(),c=u;c--;p.push(0));p.reverse()}else for(p=((a=l.lengthu;){if(l[--p]c.length-p.length&&(u=p,p=c,c=u),a=p.length,u=0;a;)u=(c[--a]=c[a]+p[a]+u)/10|0,c[a]%=10;for(u&&(c.unshift(u),++l),a=c.length;c[--a]==0;c.pop());return o.c=c,o.e=l,o},s.prototype.pow=function(o){var a=this,u=new s(1),c=u,l=0>o;for((o!==~~o||-1e6>o||1e6>=1;)a=a.nr(a);return l?u.lm(c):c},s.prototype.round=function(o,a){var u=this;return o==null?o=0:(o!==~~o||0>o||1e6a&&r(NaN),(a=Math.sqrt(this.toString()))==0||a==1/0?((a=o.join("")).length+u&1||(a+="0"),(o=new s(Math.sqrt(a).toString())).e=((u+1)/2|0)-(0>u||1&u)):o=new s(a.toString()),a=o.e+(s.tr+=4);do u=o,o=c.nr(u.oI(this.lm(u)));while(u.c.slice(0,a).join("")!==o.c.slice(0,a).join(""));return f(o,s.tr-=4,s.gu),o},s.prototype.nr=function(o){var a=this.c,u=(o=new s(o)).c,c=a.length,l=u.length,p=this.e,v=o.e;if(o.Cd=this.Cd==o.Cd?1:-1,!a[0]||!u[0])return new s(0*o.Cd);if(o.e=p+v,cp;)l=b[v]+u[p]*a[v-p-1]+l,b[v--]=l%10,l=l/10|0;b[v]=(b[v]+l)%10}for(l&&++o.e,b[0]||b.shift(),p=b.length;!b[--p];b.pop());return o.c=b,o},s.prototype.toString=function(){var o=this.e,a=this.c.join(""),u=a.length;if(o<=n||o>=t)a=a.charAt(0)+(1o?"e":"e+")+o;else if(0>o){for(;++o;a="0"+a);a="0."+a}else if(0u)for(o-=u;o--;a+="0");else othis.Cd&&this.c[0]?"-"+a:a},s.prototype.toExponential=function(o){return o==null?o=this.c.length-1:(o!==~~o||0>o||1e6=o&&(c=y(this,this.e+o),0>this.Cd&&this.c[0]&&0>c.indexOf("-")&&(c="-"+c));return n=a,t=u,c||r("!toFix!"),c},s.prototype.toPrecision=function(o){return o==null?this.toString():((o!==~~o||1>o||1e6h.get(p)?(h.set(a,2147483647),a=p):h.set(p,2147483647),u++;else{if(!(1&u))h.set(a,2147483647);else if(n)return t!=null&&(t[0]=!0),null;o.N(l),a=p,u=1}if(!(1&u))h.set(a,2147483647);else if(n)return t!=null&&(t[0]=!0),null;if(!n)for(h.Wd(0,h.size,function(b,d){return b-d}),p=0,v=h.size;pt-n)i.qr(n,t,r);else{var h=!0;try{for(var s=1/0,o=-1/0,a=n;ao&&(o=u)}if(this.reset(t-n,s,o,t-n)){for(a=n;ah&&i.qr(n+h,n+t,r);100r||t==n)&&(r=Math.min(f.cL,r),this.zf.Jb(r),this.zf.resize(r),this.zf.Yj(0,0,this.zf.size),this.zH=n,this.As.resize(i),this.Gs=(t-n)/(r-1),!0)},f.prototype.uF=function(r){return e.P.truncate((r-this.zH)/this.Gs)},f.cL=65536,f}();e.Zt=y}(k||(k={})),function(e){var y,f;(f=y||(y={}))[f.enum_line=1]="enum_line",f[f.enum_arc=2]="enum_arc",f[f.enum_dummy=4]="enum_dummy",f[f.enum_concave_dip=8]="enum_concave_dip",f[f.enum_connection=3]="enum_connection";var r=function(){function s(){}return s.Su=function(o,a,u,c,l,p){var v=new s;return v.Km=new e.h,v.Xm=new e.h,v.cw=new e.h,v.Km.N(o),v.Xm.N(a),v.cw.N(u),v.Eo=c,v.sh=l,v.uh=p,v},s.construct=function(o,a,u,c){var l=new s;return l.Km=new e.h,l.Xm=new e.h,l.cw=new e.h,l.Km.N(o),l.Xm.N(a),l.cw.Sc(),l.Eo=4,l.sh=u,l.uh=c,l},s}(),n=function(){function s(o,a,u,c,l,p){this.$v=null,this.za=0,this.zA=o,this.XH=this.VH=0,this.La=a,this.Oj=u,this.xk=c,this.Fq=l,this.Vb=p}return s.prototype.next=function(){for(var o=new e.Ta;;){if(this.za==this.zA.I())return null;if(this.zA.we(this.za,o),this.za++,!o.B())break}var a=!1;if(this.$v==null&&(this.VH=o.Ng(),this.XH=o.kh(),this.$v=h.buffer(o,this.La,this.Oj,this.xk,this.Fq,this.Vb),a=!0),this.zac)throw e.i.O();if(o.B())return new e.Ea(o.description);var v=new e.l;return o.yc(v),0=l&&(l=96),p.sb=Math.abs(p.La),p.Mv=p.sb!=0?1/p.sb:0,isNaN(c)||c==0?c=1e-5*p.sb:c>.5*p.sb&&(c=.5*p.sb),12>l&&(l=12),(o=Math.abs(a)*(1-Math.cos(Math.PI/l)))>c?c=o:(o=Math.PI/Math.acos(1-c/Math.abs(a)))(l=e.P.truncate(o))&&(l=12,c=Math.abs(a)*(1-Math.cos(Math.PI/l))),p.xk=c,p.Fq=l,p.oA=Math.min(p.dt,.25*c),p.gE()},s.prototype.ev=function(){if(this.Jd==null)this.Jd=[];else if(this.Jd.length!==0)return;var o=this.lE();o=e.P.truncate((o+3)/4);var a=.5*Math.PI/o;this.jA=a;for(var u=0;u<4*o;u++)this.Jd.push(null);var c=Math.cos(a);a=Math.sin(a);var l=e.h.construct(0,1);for(u=0;u=this.La&&(o=new e.l,this.Y.A(o),o.S()<=2*-this.La||o.da()<=2*this.La))return new e.Ea(this.Y.description)}switch(this.Y.K()){case 33:return this.KN();case 550:return this.JN();case 1607:return this.MN();case 1736:return this.LN();case 197:return this.GN();default:throw e.i.Ra()}},s.prototype.MN=function(){if(this.zG(this.Y)){var o=new e.Ta;this.Y.we(0,o);var a=new e.l;return this.Y.A(a),o.Db(a.tf()),this.Iu(o)}return this.Y=this.RV(this.Y),o=new t(this,this.qq),e.Ih.local().W(o,this.Oj,this.Vb).next()},s.prototype.LN=function(){if(this.La==0)return this.Y;var o=e.$l.local();if(this.ev(),this.Y=o.W(this.Y,null,!1,this.Vb),0>this.La){var a=this.Y;return a=this.ly(a,0,a.ea()),o.W(a,this.Oj,!1,this.Vb)}return this.zG(this.Y)?(o=new e.Ta,this.Y.we(0,o),a=new e.l,this.Y.A(a),o.Db(a.tf()),this.Iu(o)):(o=new i(this),e.Ih.local().W(o,this.Oj,this.Vb).next())},s.prototype.ly=function(o,a,u){for(var c=new e.Ea(o.description);ao.Ka(a))){var l=o.Kr(a),p=new e.l;if(o.Tj(a,p),0=this.La){if(this.La==0)o.bd(this.Y,!1);else{var a=new e.Hh;this.Y.dn(a),a.X(this.La,this.La),o.bd(a,!1)}return o}return o.bd(this.Y,!1),this.Y=o,this.eE(o,0)},s.prototype.eE=function(o,a){this.ev();var u=new e.Ea(o.description),c=new e.h,l=new e.h,p=new e.h,v=new e.h,b=new e.h,d=new e.h,g=new e.h,x=new e.h,m=o.Ka(a),w=o.Ca(a),j=0;for(a=o.Ka(a);jo.Ka(a))return null;if(this.AG(o,a)&&0(o=-1>o?4:2*Math.PI/Math.acos(o)+.5)?o=4:o>this.Fq&&(o=this.Fq),e.P.truncate(o)},s.prototype.BD=function(o,a,u,c,l){this.ev();var p=new e.h;p.vc(u,a),p.scale(this.Mv);var v=new e.h;v.vc(c,a),v.scale(this.Mv),0>(p=Math.atan2(p.y,p.x)/this.jA)&&(p=this.Jd.length+p),p=this.Jd.length-p,0>(v=Math.atan2(v.y,v.x)/this.jA)&&(v=this.Jd.length+v),(v=this.Jd.length-v)p.I(v))return 0>l||(l=o,p=new e.Ta,l.we(l.Ca(a),p),this.Au(u,p)),1;var b=p.Oa(p.Ya(p.Ob(v))),d=new e.Ed;if(d.ig(-b.x,-b.y),p.Pc(d),c&&(this.oQ(p,v,l),2>p.I(v)))return 0>l||(l=o,p=new e.Ta,l.we(l.Ca(a),p),this.Au(u,p)),1;this.$d.length=0;var g=p.Ob(v);a=p.Ya(g);var x=l==1?p.Na(a):p.V(a);o=l==1?p.V(a):p.Na(a);var m=!0;c=new e.h,v=new e.h;var w=new e.h,j=new e.h,M=new e.h,A=new e.h,z=new e.h,N=new e.h,I=new e.h,D=new e.h,P=this.sb;g=p.Ka(g);for(var B=0;Bx||0>m&&x==0?this.$d.push(r.Su(j,M,c,2,this.$d.length+1,this.$d.length-1)):j.rb(M)||(this.$d.push(r.construct(j,c,this.$d.length+1,this.$d.length-1,"dummy")),this.$d.push(r.construct(c,M,this.$d.length+1,this.$d.length-1,"dummy"))),A.add(v,I),this.$d.push(r.Su(M,A,c,1,this.$d.length+1,this.$d.length-1)),j.N(A),D.N(I),w.N(c),c.N(v),N.N(z),x=a,a=o,m=!1,o=l==1?p.V(a):p.Na(a);return this.$d[this.$d.length-1].sh=0,this.$d[0].uh=this.$d.length-1,this.TV(u),d.ig(b.x,b.y),u.TD(d,u.ea()-1),1},s.prototype.TV=function(o){for(var a=this.uO(),u=!0,c=a+1,l=a;c!=a;l=c){var p=this.$d[l];c=p.sh!=-1?p.sh:(l+1)%this.$d.length,p.Eo!=0&&(u&&o.Nt(p.Km),p.Eo==2?this.BD(o,p.cw,p.Km,p.Xm,!0):o.Ei(p.Xm),u=!1)}},s.prototype.uO=function(){this.Ms==null&&(this.Ms=[null,null,null,null,null,null,null,null,null]);for(var o=0,a=0,u=this.$d.length;a=this.sb)return!0}return!1},s.prototype.oQ=function(o,a,u){for(var c=0;1>c;c++){var l=!1,p=o.Ob(a),v=o.Ka(p);if(v==0)break;var b=v;if(3>v)break;!o.ec(p)&&(b=v-1),p=o.Ya(p),v=0F||0>H&&F==0||!this.Hv(j,m,w)||(z.N(w),U=!1,++C,l=!0),U){if(0.5*this.xk?(A.add(j,m),A.scale(.5),D.normalize(),D.cr(),P.N(D),P.scale(B-C),A.add(P),o.mf(v,A)):o.qd(v,!0),C=0}j.N(m),g=p}m.N(w),v=p,p=d,d=0a?(this.qq=!1,o):(this.qq=!0,e.Hg.Ok(o,this.dt,!1,!0,this.Vb))},s.prototype.Au=function(o,a){if(a=a.D(),this.Jd!=null&&this.Jd.length!==0){var u=new e.h;u.N(this.Jd[0]),u.Dt(this.sb,a),o.Nt(u);for(var c=1,l=this.Jd.length;c=t?1:-1;case 1:if(r.G=t?1:-1;case 2:if(r.v>=t&&r.C>t)break;return r.C<=t?1:-1;case 3:if(!(r.G>=t&&r.H>t))return r.H<=t?1:-1}return 0},f.prototype.vy=function(r,n){return r.K()==1736?this.xy(r,n):this.yy(r)},f.prototype.xy=function(r,n){if(this.Da.S()==0||this.Da.da()==0)return r.Ja();var t=new e.l;r.yc(t),this.Y=this.g.Ib(r);var i=new e.l,h=new e.l,s=new e.h,o=new e.h,a=[0,0,0,0,0,0,0,0,0],u=[0,0,0,0,0,0,0,0,0];new e.jg;var c=new e.zb,l=new e.ja(0);l.Jb(Math.min(100,r.I()));for(var p=!1,v=0;!p&&4>v;v++){var b=!1,d=(1&v)!=0,g=0;switch(v){case 0:g=this.Da.v,b=t.v<=g&&t.C>=g;break;case 1:g=this.Da.G,b=t.G<=g&&t.H>=g;break;case 2:g=this.Da.C,b=t.v<=g&&t.C>=g;break;case 3:g=this.Da.H,b=t.G<=g&&t.H>=g}if(b)for(p=!0,b=this.g.Ob(this.Y);b!=-1;){var x=-1,m=-1,w=this.g.Ya(b),j=w;do{var M=this.g.cc(j);M==null&&(M=c,this.g.D(j,s),M.Ec(s),this.g.D(this.g.V(j),o),M.Rc(o)),M.A(i);var A=this.Nh(i,v,g),z=0,N=-1;if(A==-1){z=0<(M=M.fq(d,g,a,u))?this.g.Wl(j,u,M):0,z+=1;var I=j,D=this.g.V(I);for(M=0;Mthis.g.Ka(b)?this.g.ar(b):this.g.Sb(b)}}return p?r.Ja():(this.AB(),0u;u++){var c=!1,l=(1&u)!=0,p=0;switch(u){case 0:p=this.Da.v,c=a.v<=p&&a.C>=p;break;case 1:p=this.Da.G,c=a.G<=p&&a.H>=p;break;case 2:p=this.Da.C,c=a.v<=p&&a.C>=p;break;case 3:p=this.Da.H,c=a.G<=p&&a.H>=p}if(c){c=o,o=r.Ja(),(c=c.Ha()).aj();for(var v,b=new e.h;c.ab();)for(var d,g=!0;c.Ia();){var x=c.ia();x.A(n);var m=this.Nh(n,u,p);if(m==-1){if(0<(m=x.fq(l,p,i,h))){var w=0;v=x.bc();for(var j=0;j<=m;j++)if(w!=(d=j=(u=e.P.truncate(Math.min(Math.ceil(u/r),2048)))))){for(var c=1;ch.size)){var l=this;h.Wd(0,h.size,function(A,z){return l.Oh(A,z)}),t=new e.h,s=new e.h,o=new e.h,s.Sc();var p=-1;a=new e.ja(0),u=new e.ja(0),c=this.g.Hd();for(var v=this.g.Hd(),b=0,d=h.size;bthis.Oh(p,m)&&(this.g.D(m,t),r?t.y==n:t.x==n)&&(a.add(p),w=!0,this.g.Sa(p,v,1)),0>this.Oh(p,g)&&(this.g.D(g,t),r?t.y==n:t.x==n)&&(w||a.add(p),this.g.Sa(p,c,1))}for(x=0,w=a.size;xthis.Oh(d,x)&&(this.g.D(x,a),r?a.y==n:a.x==n)&&(g=x),x=-1;var m=this.g.Na(d);if(0>this.Oh(d,m)&&(this.g.D(m,a),r?a.y==n:a.x==n)&&(x=m),g!=-1&&x!=-1)this.Mh(d,i,h),this.g.qd(d,!1),this.Mh(g,i,h),this.g.qd(g,!1),l=!0;else if(g!=-1||x!=-1){for(m=b+1;mthis.Oh(w,j)&&(this.g.D(j,a),r?a.y==n:a.x==n)&&(M=j),j=this.g.Na(w);var A=-1;if(0>this.Oh(w,j)&&(this.g.D(j,a),r?a.y==n:a.x==n)&&(A=j),M!=-1&&A!=-1){this.Mh(w,i,h),this.g.qd(w,!1),this.Mh(M,i,h),this.g.qd(M,!1),l=!0;break}if(g!=-1&&A!=-1){this.At(i,d,g,w,A,h),l=!0;break}if(x!=-1&&M!=-1){this.At(i,w,M,d,x,h),l=!0;break}}}if(l)break}}}if(!l)break}p=s,u.N(t)}}this.g.Ud(h)},f.prototype.Mh=function(r,n,t){t=this.g.Qa(r,t),n.set(t,-1),t=this.g.Qa(r,this.li),this.ed.set(t,-1),(n=this.g.cd(r))!=-1&&this.g.Ya(n)==r&&(this.g.Kf(n,-1),this.g.Yg(n,-1))},f.prototype.At=function(r,n,t,i,h,s){this.g.Cc(n,i),this.g.Dc(i,n),this.g.Dc(t,h),this.g.Cc(h,t),this.Mh(i,r,s),this.g.oi(i,!1),this.Mh(h,r,s),this.g.oi(h,!0)},f.prototype.Oy=function(){for(var r=0,n=this.ed.size;r=a?(t=this.g.Qa(o,this.li),this.ed.set(t,-1),o=this.g.qd(o,!1),a==2&&(t=this.g.Qa(o,this.li),this.ed.set(t,-1),this.g.qd(o,!1)),a=s,s=this.g.Sb(s),this.g.Kf(a,-1),this.g.br(a)):(this.g.fp(s,!1),this.g.Yg(s,this.g.Na(o)),this.g.Xj(s,a),h+=a,i++,s=this.g.Sb(s))}}for(r=0,n=this.ed.size;r=a?(t=this.g.Qa(o,this.li),this.ed.set(t,-1),o=this.g.qd(o,!1),a==2&&(0<=(t=this.g.Qa(o,this.li))&&this.ed.set(t,-1),this.g.qd(o,!1)),a=s,this.g.Kf(a,-1),this.g.br(a)):(this.g.mn(s,!0),this.g.Xj(s,a),this.g.Kf(s,o),this.g.Yg(s,this.g.Na(o)),this.g.fp(s,!1),h+=a,i++)}for(this.g.Tl(this.Y,i),this.g.Vj(this.Y,h),r=0,n=this.g.md;n!=-1;n=this.g.ve(n))r+=this.g.I(n);this.g.XB(r)},f.wy=function(r,n,t){return new f(n).vy(r,t)},f.clip=function(r,n,t,i){if(r.B())return r;if(n.B())return r.Ja();if((t=r.K())==33)return i=r.D(),n.contains(i)?r:r.Ja();if(t==197)return i=new e.l,r.A(i),i.Fa(n)?(n=new e.Hh,r.copyTo(n),n.Zo(i),n):r.Ja();var h=new e.l;if(r.yc(h),n.contains(h))return r;if(!n.isIntersecting(h))return r.Ja();if((h=r.Cb)!=null&&(h=h.Hk)!=null){if((h=h.To(n))==1){if(t!=1736)throw e.i.Ra();return(r=new e.Ea(r.description)).vp(n),r}if(h==0)return r.Ja()}switch(t){case 550:t=null,h=r.I();for(var s=r.vb(0),o=0,a=0;a=t?1:-1;case 1:if(r.G=t?1:-1;case 2:if(r.v>=t&&r.C>t)break;return r.C<=t?1:-1;case 3:if(!(r.G>=t&&r.H>t))return r.H<=t?1:-1}return 0},f.prototype.vy=function(r,n){return r.K()==1736?this.xy(r,n):this.yy(r)},f.prototype.xy=function(r,n){if(this.Da.S()==0||this.Da.da()==0)return r.Ja();var t=new e.l;r.yc(t),this.Y=this.g.Ib(r);var i=new e.l,h=new e.l,s=new e.h,o=new e.h,a=[0,0,0,0,0,0,0,0,0],u=[0,0,0,0,0,0,0,0,0],c=new e.zb,l=new e.ja(0);l.Jb(256);for(var p=!1,v=0;!p&&4>v;v++){var b=!1,d=(1&v)!=0,g=0;switch(v){case 0:g=this.Da.v,b=t.v<=g&&t.C>=g;break;case 1:g=this.Da.G,b=t.G<=g&&t.H>=g;break;case 2:g=this.Da.C,b=t.v<=g&&t.C>=g;break;case 3:g=this.Da.H,b=t.G<=g&&t.H>=g}if(b)for(p=!0,b=this.g.Ob(this.Y);b!=-1;){var x=!0,m=-1,w=-1,j=this.g.Ya(b),M=j;do{var A=this.g.cc(M);A==null&&(A=c,this.g.D(M,s),A.Ec(s),this.g.D(this.g.V(M),o),A.Rc(o)),A.A(i);var z=this.Nh(i,v,g),N=0,I=-1;if(z==-1){N=0<(A=A.fq(d,g,a,u))?this.g.HX(M,u,A):0,N+=1;var D=M,P=this.g.V(D);for(A=0;Av;v++){var b=!1,d=(1&v)!=0,g=0;switch(v){case 0:g=this.Da.v,b=a.v<=g&&a.C>=g;break;case 1:g=this.Da.G,b=a.G<=g&&a.H>=g;break;case 2:g=this.Da.C,b=a.v<=g&&a.C>=g;break;case 3:g=this.Da.H,b=a.G<=g&&a.H>=g}if(b)for(b=o,o=r.Ja(),(b=b.Ha()).aj();b.ab();)for(var x,m=!0;b.Ia();){var w=b.ia();w.A(n);var j=this.Nh(n,v,g);if(j==-1){if(0<(j=w.fq(d,g,i,h))){var M=0;w.$p(u);for(var A=0;A<=j;A++)if(M!=(x=Ai.x&&(i.x+=r)}else p=n.y-this.Da.G,h.y=e.mc.sign(t.y-n.y),i.y=r*e.mc.En(Math.floor(Math.abs(p/r)),p)+this.Da.G,0>i.y&&(i.y+=r);p=l!=0?t.y-n.y:t.x-n.x;var v=Math.abs(p);if(65536=d||(s[v]=d,v++)}v!=0&&this.g.Wl(u,s,v)}}u=c}while(u!=a)}},f.prototype.Xl=function(r,n){for(var t=-1,i=new e.h,h=null,s=this.g.Ob(this.Y);s!=-1;s=this.g.Sb(s))for(var o=this.g.Ya(s),a=0,u=this.g.Ka(s);ah.size)){var l=this;h.Wd(0,h.size,function(A,z){return l.Oh(A,z)}),t=new e.h,s=new e.h,o=new e.h,s.Sc();var p=-1;a=new e.ja(0),u=new e.ja(0),c=null;for(var v=this.g.Hd(),b=this.g.Hd(),d=0,g=h.size;ds.compare(t)&&(r?t.y==n:t.x==n)&&(a.add(p),j=!0,this.g.Sa(p,b,1)),this.g.D(x,t),0>s.compare(t)&&(r?t.y==n:t.x==n)&&(j||a.add(p),this.g.Sa(p,v,1))}for(m=0,j=a.size;mu.compare(a)&&(r?a.y==n:a.x==n)&&(g=x),x=-1;var m=this.g.Na(d);if(this.g.D(m,a),0>u.compare(a)&&(r?a.y==n:a.x==n)&&(x=m),g!=-1&&x!=-1)this.Mh(d,i,h),this.g.qd(d,!1),this.Mh(g,i,h),this.g.qd(g,!1),l=!0;else if(g!=-1||x!=-1){for(m=b+1;mu.compare(a)&&(r?a.y==n:a.x==n)&&(M=j),j=this.g.Na(w);var A=-1;if(this.g.D(j,a),0>u.compare(a)&&(r?a.y==n:a.x==n)&&(A=j),M!=-1&&A!=-1){this.Mh(w,i,h),this.g.qd(w,!1),this.Mh(M,i,h),this.g.qd(M,!1),l=!0;break}if(g!=-1&&A!=-1){this.At(i,d,g,w,A,h),l=!0;break}if(x!=-1&&M!=-1){this.At(i,w,M,d,x,h),l=!0;break}}}if(l)break}}}if(!l)break}p=s,u.N(t)}this.g.Ud(h)}},f.prototype.Mh=function(r,n,t){t=this.g.Qa(r,t),n.set(t,-1),t=this.g.Qa(r,this.li),this.ed.set(t,-1),(n=this.g.cd(r))!=-1&&this.g.Ya(n)==r&&(this.g.Kf(n,-1),this.g.Yg(n,-1))},f.prototype.At=function(r,n,t,i,h,s){this.g.Cc(n,i),this.g.Dc(i,n),this.g.Dc(t,h),this.g.Cc(h,t),this.Mh(i,r,s),this.g.oi(i,!1),this.Mh(h,r,s),this.g.oi(h,!0)},f.prototype.Oy=function(){for(var r=0,n=this.ed.size;r=a?(t=this.g.Qa(o,this.li),this.ed.set(t,-1),o=this.g.qd(o,!1),a==2&&(0<=(t=this.g.Qa(o,this.li))&&this.ed.set(t,-1),this.g.qd(o,!1)),a=s,this.g.Kf(a,-1),this.g.br(a)):(this.g.mn(s,!0),this.g.Xj(s,a),this.g.Kf(s,o),this.g.Yg(s,this.g.Na(o)),this.g.fp(s,!1),h+=a,i++)}for(this.g.Tl(this.Y,i),this.g.Vj(this.Y,h),r=0,n=this.g.md;n!=-1;n=this.g.ve(n))r+=this.g.I(n);this.g.XB(r)},f.wy=function(r,n,t,i){return new f(n,i).vy(r,t)},f.clip=function(r,n,t,i,h){return f.Pu(r,n,null,t,i,h)},f.Pu=function(r,n,t,i,h,s){var o=r.K();if(o==33)return h=r.D(),n.contains(h)?r:r.Ja();if(o==197)return h=new e.l,r.A(h),h.Fa(n)?(n=new e.Hh,r.copyTo(n),n.Zo(h),n):r.Ja();if(r.B())return r;if(n.B())return r.Ja();var a=new e.l;if(r.yc(a),n.contains(a))return r;if(!n.isIntersecting(a))return r.Ja();if((t!=null||isNaN(i))&&e.ua.oy(t,n,!1),!e.ba.zj(o))throw e.i.O();if((t=r.Cb)!=null&&(t=t.Hk)!=null){if((t=t.To(n))==1){if(o!=1736)throw e.i.ga("internal error");return(r=new e.Ea(r.description)).vp(n),r}if(t==0)return r.Ja()}switch(o){case 550:for(s=null,o=r.I(),t=r.vb(0),i=0,h=new e.h,a=0;a=a;a+=1)for(var u=0;1>=u;u+=1){var c=n.eG(s+a,o+u),l=this.zl.lR(c);l!=-1&&(this.rq[h]=l,this.zs[h]=c,h++)}for(s=h-1;1<=s;s--)for(l=this.rq[s],o=s-1;0<=o;o--)if(l==this.rq[o]){this.zs[o]=-1,s!=--h&&(this.zs[s]=this.zs[h],this.rq[s]=this.rq[h]);break}for(o=0;oo.Eb())throw e.i.O();return a==0||o.B()?o:((p=new s(p)).mo=o,p.La=a,p.ra=l,p.Mi=u,p.xA=c,p.Qx())},s.prototype.$L=function(){var o=this.mo,a=o.bc(),u=o.xc(),c=new e.h;return c.vc(u,a),c.normalize(),c.Jv(),c.scale(this.La),a.add(c),u.add(c),c=o.Ja(),o.Ec(a),o.Rc(u),c},s.prototype.ZL=function(){var o=this.mo;if(0p&&(0this.La?-f:f,-1d&&(.017453292519943295>(g=2*Math.acos(d))&&(g=.017453292519943295),1<(v=e.P.truncate(f/g+1.5))&&(b/=v)),g=w+n,w=t.Qd(p,this.La,g),o==0&&(w.type|=1024),this.hc(w,o),d=this.La/Math.cos(b/2),g+=b/2,(w=t.Qd(p,d,g)).type|=1024,this.hc(w);0<--v;)g+=b,(w=t.Qd(p,d,g)).type|=1024,this.hc(w);(w=t.Qd(p,this.La,j-n)).type|=1024,this.hc(w)}else if(this.Mi==1)w=t.Qd(p,this.La,w+n),this.hc(w,o),w=t.Qd(p,this.La,j-n),this.hc(w);else if(this.Mi==0)for(d=1-u/Math.abs(this.La),v=1,b=j-n-(w+n),-1d&&(.017453292519943295>(g=2*Math.acos(d))&&(g=.017453292519943295),1<(v=e.P.truncate(Math.abs(b)/g+1.5))&&(b/=v)),d=this.La/Math.cos(.5*b),g=w+n+.5*b,w=t.Qd(p,d,g),this.hc(w,o);0<--v;)g+=b,w=t.Qd(p,d,g),this.hc(w);else this.Mi==2?(d=v.x-p.x,g=v.y-p.y,.99999999<(v=(d*(x=b.x-p.x)+g*(m=b.y-p.y))/Math.sqrt(d*d+g*g)/Math.sqrt(x*x+m*m))?(w=t.Qd(p,1.4142135623730951*this.La,j-.25*f),this.hc(w,o),w=t.Qd(p,1.4142135623730951*this.La,j+.25*f),this.hc(w)):(v=Math.abs(this.La/Math.sin(.5*Math.acos(v))))>(b=Math.abs(this.xA*this.La))?(d=.5*(j-w),d=this.La/Math.abs(Math.sin(d)),w=t.Qd(p,d,.5*(w+j)),j=e.h.construct(w.x,w.y),w=e.h.construct(p.x,p.y),(p=new e.h).vc(j,w),(j=new e.h).BW(b/p.length(),p,w),w=(v-b)*Math.abs(this.La)/Math.sqrt(v*v-this.La*this.La),0w&&(j-=r),v=w-j(d=1.4142135623730951*this.La)?w+.25*f:w+.75*f,w=t.Qd(p,d,g),this.hc(w,o),g=0>d?j-.25*f:j-.75*f,w=t.Qd(p,d,g),this.hc(w)):(d=.5*(j-w),d=this.La/Math.abs(Math.sin(d)),ja))for(var u=0;u=c+1;a--)(u=t.cl(o.Oa(a))).type|=1024,this.xg.push(u);if(this.hE())if(2<=this.Zb.length){for(o=-1,(l=(1024&this.Zb[this.gf-1].type)!=0)||(o=0),a=1;a=Math.min(u.x,c.x)&&Math.max(u.x,c.x)>=Math.min(o.x,a.x)&&Math.max(o.y,a.y)>=Math.min(u.y,c.y)&&Math.max(u.y,c.y)>=Math.min(o.y,a.y)},s.prototype.sQ=function(o,a,u,c,l){l.XD=!1;var p=(a.y-o.y)*(c.x-u.x)-(a.x-o.x)*(c.y-u.y),v=(u.y-o.y)*(a.x-o.x)-(u.x-o.x)*(a.y-o.y);if(0<=(p=p==0?2:v/p)&&1>=p){var b=p;if(p=(c.y-u.y)*(a.x-o.x)-(c.x-u.x)*(a.y-o.y),v=(o.y-u.y)*(c.x-u.x)-(o.x-u.x)*(c.y-u.y),0<=(p=p==0?2:v/p)&&1>=p)return l.cn=t.OO(o.x+p*(a.x-o.x),o.y+p*(a.y-o.y)),l.cn.Wh=u.Wh+b*(c.Wh-u.Wh),b!=0&&b!=1||p!=0&&p!=1||(l.XD=!0),l.RY=p,l.SY=b,!((b==0||b==1)&&0p||(p==0||p==1)&&0b)}return!1},s.prototype.LO=function(o){for(;this.Zb[o].uho-(s*=2))return!0;h=new e.h;var a=new e.h,u=new e.h;i.uc(s,h),i.uc(s+2,a),i.uc(s+4,u);var c=t.Yu(a,u,h);if(c.rs()||!t.wm(c.value()))return!1;var l=e.h.construct(a.x,a.y),p=new e.h;for(s+=6;so;o++){i.hB(o,s);var a=this.Er(s);if(a!=-1){i.If(o,h);var u=this.g.hc(this.Us,h);this.Ga.Uj(a,u)}}},t.prototype.jN=function(i){var h=new e.Ta,s=i.bc();if((s=this.Er(s))!=-1){i.Vo(h);var o=this.g.hc(this.Us,h);this.Ga.Uj(s,o)}s=i.xc(),(s=this.Er(s))!=-1&&(i.Ro(h),i=this.g.hc(this.Us,h),this.Ga.Uj(s,i))},t.prototype.iN=function(i){var h=i.D();(h=this.Er(h))!=-1&&(i=this.g.hc(this.Us,i),this.Ga.Uj(h,i))},t.prototype.Er=function(i){var h=-1;if(this.Ga.size(-1)==0)return this.Ga.addElement(-4,-1);if(this.Ga.size(-1)==1){var s=this.g.Oa(this.Ga.ka(this.Ga.sc(-1)));return i.Mz(s)||(h=this.Ga.zn(-5)),h}return this.kC(i)},t.prototype.kC=function(i){var h=-1;do{var s=this.Ga.sc(-1),o=this.Ga.Gc(-1),a=this.Ga.ka(s),u=this.Ga.ka(o),c=new e.h,l=new e.h;if(this.Zh.D(a,c),this.Zh.D(u,l),a=e.h.Wq(l,i,c),t.wm(a))h=this.Ga.zn(-1),(c=this.iC(i,o,s))!=s&&this.jC(i,s,this.Ga.xe(c));else if(t.xG(a)){l=this.Ga.uv(-1);var p=this.Ga.sc(-1),v=this.Ga.Gc(-1);for(a=new e.h,u=new e.h;p!=this.Ga.xe(v);){var b=this.Ga.ka(l);this.Zh.D(b,a),b=e.h.Wq(a,i,c),t.xG(b)?(v=l,l=this.Ga.nl(l)):(p=l,l=this.Ga.Zp(l))}if(l=v,c=p,b=this.Ga.ka(l),p=this.Ga.ka(c),this.Zh.D(b,a),this.Zh.D(p,u),c!=s&&(a=e.h.Wq(u,i,a),!t.wm(a)))continue;h=this.Ga.Bu(c,l,-2,!1),this.jC(i,l,o),this.iC(i,c,s)}else this.tb==null&&(this.tb=new e.zb),this.tb.Ec(l),this.tb.Rc(c),0>(c=this.tb.ge(i,!0))?(c=this.Ga.xe(o),this.Ga.wd(o,-1),h=this.Ga.zn(-3),this.iC(i,c,s)):1i},t.xG=function(i){return 0h)throw e.i.ga("Internal Error: max number of iterations exceeded");var a=this.iM(n);if(i=i||a,this.oH&&(a=this.g.Ip(n,!0,!1)!=0,i=i||a),a=!1,(s==0||o||e.bu.fI(!0,this.g,r,null,this.od))&&(a=this.nM(t),i=i||a),!a)break;e.op.Bp(this.od)}return i},f}();e.Vk=y}(k||(k={})),function(e){var y=function(){function r(n){this.ae=this.Nc=null,this.$s=0,this.Vb=n,this.Yz=!0}return r.prototype.wv=function(n,t){var i=this.g.cc(n);if(i==null){if(!this.g.fd(n,t))return null;i=t}return i},r.prototype.Zq=function(){var n;n===void 0&&(n=!1),this.$s++,(n||!(4095&this.$s))&&(this.$s=0,e.op.Bp(this.Vb))},r.prototype.iP=function(){var n=this.g.$q(!1),t=!1,i=new e.zb,h=new e.zb,s=new e.l;s.Pa();var o=new e.l;o.Pa();for(var a=new e.Ta,u=new e.OC,c=n.next();c!=-1;c=n.next()){e.op.Bp(this.Vb);var l=null,p=!1;if(!e.ba.Tn(this.g.jc(n.ek))){if((l=this.wv(c,i))==null)continue;if(l.A(s),s.X(this.ra,this.ra),l.Di(this.ra)){if(!l.Di(0))continue;p=!0,l=null}}var v=this.g.$q(n),b=v.next();for(b!=-1&&(b=v.next());b!=-1;b=v.next()){var d=null,g=!1;if(!e.ba.Tn(this.g.jc(v.ek))){if((d=this.wv(b,h))==null)continue;if(d.A(o),d.Di(this.ra)){if(!d.Di(0))continue;g=!0,d=null}}var x=0,m=0;if(l!=null&&d!=null)s.CG(o)&&(u.Qo(l),u.Qo(d),u.Fa(this.ra,!1),0<(x=u.ql(0))+(m=u.ql(1))&&(this.g.lr(c,u,0,!0),this.g.lr(b,u,1,!0)),u.clear());else if(l!=null){var w=new e.h;if(this.g.D(b,w),s.contains(w)){if(u.Qo(l),this.g.Xi(b,a),u.Fz(this.ra,a,!1),0<(x=u.ql(0)))if(this.g.lr(c,u,0,!0),g){for(g=-1,w=this.g.V(b);w!=-1&&w!=b&&(g=w,(d=this.wv(w,h))!=null&&d.Di(0));w=this.g.V(w));for(w=b;w!=-1&&(this.g.Fh(w,u.Cf),w!=g);w=this.g.V(w));}else this.g.Fh(b,u.Cf);u.clear()}}else{if(d==null)continue;if(w=new e.h,this.g.D(c,w),o.X(this.ra,this.ra),o.contains(w)){if(u.Qo(d),this.g.Xi(c,a),u.Fz(this.ra,a,!1),0<(m=u.ql(0)))if(this.g.lr(b,u,0,!0),p){for(g=-1,w=this.g.V(c);w!=-1&&w!=c&&(g=w,(d=this.wv(w,h))!=null&&d.Di(0));w=this.g.V(w));for(w=c;w!=-1&&(this.g.Fh(w,u.Cf),w!=g);w=this.g.V(w));}else this.g.Fh(c,u.Cf);u.clear()}}if(x+m!=0){if(x!=0){if((l=this.g.cc(c))==null){if(!this.g.fd(c,i))continue;l=i,i.A(s)}else l.A(s);if(l.Di(this.ra))break}t=!0}}}return t},r.prototype.jP=function(){return this.LU()},r.prototype.LU=function(){return new e.MC().LX(this.g,this.ra)},r.prototype.gI=function(){var n=!1;this.Nc==null&&(this.Nc=new e.$j);var t=new e.ja(0);t.Jb(this.g.gd+1);for(var i=this.g.$q(),h=i.next();h!=-1;h=i.next())t.add(h);this.g.nx(t,t.size),t.add(-1),i=this.g.Hd(),h=this.g.Hd(),this.ae=new e.PC(this.g,this.ra,!this.Yz),this.Nc.Xo(this.ae);var s=new e.ja(0),o=new e.ja(0),a=0;new e.h;var u=this.g.ud;this.g.wb.oc();for(var c,l,p=this.g.wb.Aa[0].o,v=t.get(a++);v!=-1;){var b=c=p[2*(l=u.U(v,0))],d=l=p[2*l+1];do{var g=u.U(v,2),x=u.U(v,1);if(g!=-1){var m=u.U(g,0),w=p[2*m];0>(d<(m=p[2*m+1])?-1:d>m?1:bw?1:0)&&(o.add(v),o.add(g))}x!=-1&&(w=p[2*(m=u.U(x,0))],0>(d<(m=p[2*m+1])?-1:d>m?1:bw?1:0)&&(o.add(x),o.add(x))),(w=this.g.Qa(v,i))!=-1&&(s.add(w),this.g.Sa(v,i,-1)),(w=this.g.Qa(v,h))!=-1&&(s.add(w),this.g.Sa(v,h,-1)),(v=t.get(a++))!==-1&&(b=p[2*(d=u.U(v,0))],d=p[2*d+1])}while(v!=-1&&b===c&&d===l);for(b=s.size==1&&o.size==2,w=d=-1,g=0,x=s.size;gn.gd?n=t.iP():t.jP())},r.W=function(n,t,i){return r.aQ(n,n.DF(),t,i)},r.fI=function(n,t,i,h,s){if(!r.tE(t))return!1;var o=new r(s);if(o.g=t,o.ra=i,o.Yz=n,o.gI())return h!=null&&h.Yt(o.Pi),!0;var a=new e.Ed;return a.VB(),t.Pc(a),(o=new r(s)).g=t,o.ra=i,o.Yz=n,n=o.gI(),a.VB(),t.Pc(a),!!n&&(h!=null&&h.Yt(o.Pi),!0)},r.Ol=function(n,t){return!(16>(n=n.I()))&&2*n+Math.log(n)*Math.LOG10E/Math.log(2)*t<1*n*t},r.gP=function(n,t,i,h){if(e.ba.Ic(t.K()))return new r(h).hP(n,t,i);throw e.i.ga("crack_A_with_B")},r.prototype.hP=function(n,t,i){var h=new e.l;n.yc(h);var s=new e.l;if(t.yc(s),s.X(i,i),!s.isIntersecting(h))return n;var o=n.Cb,a=null;o!=null&&(a=o.Gb),r.Ol(n,n.I())&&(a=e.ua.lj(n,s));var u=a!=null?a.getIterator():null,c=t.Ha();t=n.Ha();var l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=[];c.ab();)for(;c.Ia();){var p=c.ia();if(a!=null){for(u.Wo(p,i),o=u.next();o!=-1;o=u.next())if(this.Zq(),t.Wb(a.ka(o),-1),t.Ia()){var v=(o=t.ia()).Fa(p,null,l,null,i);for(o=0;ot.t?1:n.tt.index?1:-1},r}()}(k||(k={})),function(e){var y;(y=e.FK||(e.FK={}))[y.Left=0]="Left",y[y.Right=1]="Right",y[y.Coincident=2]="Coincident",y[y.Undefined=3]="Undefined",y[y.Uncut=4]="Uncut";var f=function(t,i,h,s,o,a,u,c,l,p,v){this.Y=t,this.ct=i,this.Ps=h,this.ug=s,this.Nm=p,this.Cl=v};e.qY=f;var r=function(){function t(i,h){this.EH=i,this.Ji=h}return t.prototype.lM=function(i,h){var s=new e.h;this.Ji.D(i,s);var o=new e.h;return this.Ji.D(h,o),(s=s.compare(o))!=0?s:(i=this.Ji.Qa(i,this.EH))<(h=this.Ji.Qa(h,this.EH))?-1:i==h?0:1},t}(),n=function(t,i,h,s,o,a,u,c,l){this.ug=t,this.Ps=i,this.JA=h,this.PH=s,this.Gi=o,this.Cl=a,this.Nm=u,this.QH=c,this.JT=l};e.pY=n,e.GK=function(){function t(){}return t.EK=function(i,h,s,o,a,u){if(h.B())i=new f(h,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),a.push(i);else if(s.B())i=new f(h,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),a.push(i);else{var c=new e.hd;if(c.Ib(h),c.Ib(s),e.Vk.W(c,o,u,!0),c.gd==0)i=new f(h.Ja(),4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),a.push(i);else{for(h=0,s=c.Hd(),o=c.md;o!=-1;o=c.ve(o))for(u=c.Ob(o);u!=-1;u=c.Sb(u))for(var l=c.Ya(u),p=0,v=c.Ka(u);p(d=d.Fa(l,null,v,b,0))&&(o=new n(a,o,v[0],NaN,d,c,u,b[0],NaN),s.push(o),0>(o=h.Qa(a,i))&&h.Sa(a,i,s.length-1)),!0},t.rM=function(i,h,s,o,a,u,c){var l=new e.zb,p=new e.zb,v=[0,0],b=[0,0],d=h.cc(a);return d==null&&(h.fd(a,l),d=l),(l=h.cc(c))==null&&(h.fd(c,p),l=p),2>(d=d.Fa(l,null,v,b,0))&&(o=new n(a,o,v[0],NaN,d,c,u,b[0],NaN),s.push(o),0>(o=h.Qa(a,i))&&h.Sa(a,i,s.length-1),!0)},t.sM=function(i,h,s,o,a,u,c,l){var p=new e.zb,v=new e.zb,b=[0,0],d=[0,0],g=h.cc(a);return g==null&&(h.fd(a,p),g=p),(p=h.cc(c))==null&&(h.fd(c,v),p=v),(g=g.Fa(p,null,b,d,0))==2?(o=new n(a,o,b[0],b[1],g,c,u,d[0],d[1]),s.push(o),0>(o=h.Qa(a,i))&&h.Sa(a,i,s.length-1),!0):(v=!1,a==l&&(o=new n(a,o,b[0],NaN,g,c,u,d[0],NaN),s.push(o),0>(o=h.Qa(a,i))&&h.Sa(a,i,s.length-1),v=!0),v)},t.tM=function(i,h,s,o,a,u,c,l){var p=new e.zb,v=new e.zb,b=[0,0],d=[0,0],g=h.cc(a);return g==null&&(h.fd(a,p),g=p),(p=h.cc(c))==null&&(h.fd(c,v),p=v),(g=g.Fa(p,null,b,d,0))==2?(o=new n(a,o,b[0],b[1],g,c,u,d[0],d[1]),s.push(o),0>(o=h.Qa(a,i))&&h.Sa(a,i,s.length-1),!0):(v=!1,a==l&&(o=new n(a,o,b[0],NaN,g,c,u,d[0],NaN),s.push(o),0>(o=h.Qa(a,i))&&h.Sa(a,i,s.length-1),v=!0),v)},t.YL=function(i,h,s,o){var a=[];a[0]=new e.h,a[1]=new e.h,a[2]=new e.h,a[3]=new e.h;var u=new e.h,c=new e.h,l=new e.h,p=new e.h,v=null;o!=null&&(v=new e.jg).Qr();var b=0,d=null,g=new e.zb;new e.zb;for(var x=s.Ob(s.md);x!=-1;x=s.Sb(x)){for(var m=4,w=-1,j=-1,M=-1,A=-1,z=NaN,N=!0,I=!1,D=!0,P=!0,B=!0,C=0,S=x,F=0,H=s.Ya(x),U=s.Ka(x),$=0;$=h.length-2||h[b+2].Ps!=w)&&(m=0):m=1):((E!=R||L&&R==0)&&(o!=null?(O=new f(d,3,w,K,E,m,S,j,F,X,V),o.push(O)):null.add(C)),m=1):m!=0?((E!=R||L&&R==0)&&(o!=null?(O=new f(d,0,w,K,E,m,S,j,F,X,V),o.push(O)):null.add(C)),tt?(b>=h.length-2||h[b+2].Ps!=w)&&(m=1):m=0):((E!=R||L&&R==0)&&(o!=null?(O=new f(d,3,w,K,E,m,S,j,F,X,V),o.push(O)):null.add(C)),m=0),(E!=R||L&&R==0)&&(R=E,S=w,j=K,F=E,M=X,A=V,z=nt,N=D=!1,P=B=!0))}}b++}R!=1&&(B&&(o!=null?d=new e.Ua:C=0),o!=null?(W.dh(R,1,v),d.pc(v.get(),P)):C++,P=B=!1,D=!0)}D&&(E=1,K=s.tj(x),K=s.Na(K),V=X=-1,nt=NaN,N?o!=null?(O=new f(d,4,w,K,E,m,S,j,F,X,V),o.push(O)):null.add(C):(N=m==1?0:m==0?1:3,o!=null?(O=new f(d,N,w,K,E,m,S,j,F,X,V),o.push(O)):null.add(C)))}},t.xM=function(i,h,s,o,a,u){var c=s[o].QH;if(c==1)return t.vM(i,h,s,o,a,u);if(c==0)return t.wM(i,h,s,o,a,u);throw e.i.Ra()},t.vM=function(i,h,s,o,a,u){var c=new e.zb,l=s[o].ug,p=s[o].Nm,v=s[o].Cl,b=-1,d=-1,g=-1,x=-1;if(!i&&0.01*n&&(i*=1+(1+(r=r.yb/n))*r),this.pb=t,this.yb=i+2220446049250313e-31*Math.abs(t)},f.prototype.sqrt=function(){if(0<=this.pb){var r=Math.sqrt(this.pb),n=this.pb>10*this.yb?.5*this.yb/r:this.pb>this.yb?r-Math.sqrt(this.pb-this.yb):Math.max(r,Math.sqrt(this.pb+this.yb)-r);n+=2220446049250313e-31*Math.abs(r)}else this.pb<-1*this.yb?n=r=NaN:(r=0,n=Math.sqrt(this.yb));this.pb=r,this.yb=n},f.prototype.sin=function(r){var n=Math.sin(r.pb),t=Math.cos(r.pb);this.pb=n,n=Math.abs(n),this.yb=(Math.abs(t)+.5*n*r.yb)*r.yb+2220446049250313e-31*n},f.prototype.cos=function(r){var n=Math.sin(r.pb),t=Math.cos(r.pb);this.pb=t,t=Math.abs(t),this.yb=(Math.abs(n)+.5*t*r.yb)*r.yb+2220446049250313e-31*t},f.prototype.rg=function(){return Math.abs(this.pb)<=this.yb},f.prototype.rs=function(){return this.rg()&&this.yb!=0},f}();e.Xb=y}(k||(k={}));var Q=new k.h,ht=new k.h,et=new k.h,st=new k.h,ot=new k.h;(function(e){var y,f;(f=y||(y={}))[f.closedPath=1]="closedPath",f[f.exteriorPath=2]="exteriorPath",f[f.ringAreaValid=4]="ringAreaValid";var r=function(){function n(t,i,h,s,o,a,u){i!==void 0?(this.ib=t,this.ek=i,this.dl=h,this.ki=s,this.za=a,this.cA=u,this.gw=o):(this.ib=t.ib,this.ek=t.ek,this.dl=t.dl,this.ki=t.ki,this.za=t.za,this.cA=t.cA,this.gw=t.gw),this.XG=!0}return n.prototype.next=function(){return this.XG?(this.XG=!1,this.ki):this.ki!=-1?(this.ki=this.ib.V(this.ki),this.za++,this.ki!=-1&&this.ki!=this.gw?this.ki:this.VT()):-1},n.prototype.VT=function(){for(this.dl=this.ib.Sb(this.dl),this.za=0;this.ek!=-1;){for(;this.dl!=-1;this.dl=this.ib.Sb(this.dl))if(this.gw=this.ki=this.ib.Ya(this.dl),this.ki!=-1)return this.ki;if(this.ek=this.ib.ve(this.ek),this.ek==-1)break;this.cA&&!e.ba.Ic(this.ib.jc(this.ek))||(this.dl=this.ib.Ob(this.ek))}return-1},n.vP=function(t,i,h,s,o,a,u){return new n(t,i,h,s,o,a,u)},n}();e.vY=r,y=function(){function n(){this.lo=this.Cm=this.yk=this.dd=this.Ek=this.xo=this.Qi=this.nd=this.di=this.Ug=this.Te=this.Kl=null,this.sw=this.md=-1,this.gd=0,this.aA=!1,this.it=this.jt=this.wb=null}return n.prototype.Uh=function(t){return this.Te!=null?this.Te[t]:null},n.prototype.Zg=function(t,i){if(this.Te==null){if(i==null)return;this.Te=[];for(var h=0,s=this.wb.I();h=this.Qi.size&&(t=16>i?16:e.P.truncate(3*i/2),this.Qi.resize(t),this.xo.resize(t)),this.Qi.set(i,0),this.xo.set(i,0),i},n.prototype.nF=function(t){this.nd.kd(t)},n.prototype.Qy=function(t){this.ud.kd(t),this.gd--},n.prototype.jI=function(t){this.nd==null&&(this.nd=new e.ad(8),this.ud=new e.ad(5),this.Qi=new e.ce(0),this.xo=new e.ce(0));var i=this.ud.De(),h=0<=t?t:i;if(this.ud.T(i,0,h),0>t){if(h>=this.wb.I()){if(t=16>h?16:e.P.truncate(3*h/2),this.wb.resize(t),this.Te!=null)for(var s=0;si.Ka(s))){var a=this.wf(t,-1);this.mn(a,i.ec(s));for(var u=i.Ca(s),c=i.Wc(s);ut.Ka(i))return h;this.Kl.Gd(t,t.Ca(i),t.Wc(i)),this.jt=this.wb.vb(0);var s=this.wf(h,-1);this.mn(s,t.ec(i)||!0);var o=this.Te!=null&&t.Se!=null,a=t.Ca(i);for(i=t.Wc(i);a=i.size&&i.resize(Math.max(e.P.truncate(1.25*t),16),-1),i.write(t,h)},n.prototype.FF=function(t,i){return(t=this.EF(t))<(i=this.yk[i]).size?i.read(t):-1},n.prototype.WE=function(){this.yk==null&&(this.yk=[]);for(var t=0;tl:2>l)?(u=this.ar(u),s=0v){var b=v;c!=null&&(b=0b){var d=b;if(c!=null&&(d=0s||o>this.gd-1)throw e.i.O("invalid call");if(s>o&&!this.ec(t))throw e.i.O("cannot iterate across an open path");for(t=0;i!=h;i=this.V(i))s=this.Va(i),(o=this.Uh(s))!=null?t+=o.Rb():(o=this.Va(this.V(i)),t+=this.wb.Ar(s,o));return t},n.prototype.Fh=function(t,i){var h=this.Va(t);this.wb.It(h,i),(h=this.Uh(h))!=null&&h.setStart(i),(t=this.Na(t))!=-1&&(t=this.Va(t),this.Uh(t)!=null&&h.setEnd(i))},n.prototype.Xi=function(t,i){t=this.Va(t),this.wb.we(t,i)},n.prototype.mf=function(t,i){this.Db(t,i.x,i.y)},n.prototype.Db=function(t,i,h){var s=this.Va(t);this.wb.Db(s,i,h),(s=this.Uh(s))!=null&&s.UB(i,h),(t=this.Na(t))!=-1&&(t=this.Va(t),this.Uh(t)!=null&&s.Sl(i,h))},n.prototype.D=function(t,i){this.wb.D(this.ud.U(t,0),i)},n.prototype.Hc=function(t,i){this.wb.Aa[0].uc(2*this.ud.U(t,0),i)},n.prototype.Oa=function(t){var i=new e.h;return this.wb.D(this.ud.U(t,0),i),i},n.prototype.ZF=function(t,i){this.jt.uc(2*t,i)},n.prototype.Vc=function(t,i,h){return this.wb.Vc(t,this.Va(i),h)},n.prototype.setAttribute=function(t,i,h,s){this.wb.setAttribute(t,this.Va(i),h,s)},n.prototype.Va=function(t){return this.ud.U(t,0)},n.prototype.kh=function(){var t=new e.h;return this.D(void 0,t),t.y},n.prototype.hq=function(t,i){t=this.Va(t),i=this.Va(i);var h=this.wb.Aa[0].o;return h[2*t]===h[2*i]&&h[2*t+1]===h[2*i+1]},n.prototype.Fv=function(t,i){t=this.Va(t);var h=this.wb.Aa[0].o;return h[2*t]===i.x&&h[2*t+1]===i.y},n.prototype.rX=function(t,i){if(1>i&&(i=1),this.Ug==null){if(i==1)return;this.Ug=e.Zc.Fn(this.wb.I(),1)}(t=this.Va(t))>=this.Ug.size&&this.Ug.resize(t+1,1),this.Ug.write(t,i)},n.prototype.YF=function(t){return t=this.Va(t),this.Ug==null||t>=this.Ug.size?1:this.Ug.read(t)},n.prototype.Sa=function(t,i,h){i=this.di[i],t=this.Va(t),i.sizeo?1:ac?1:0})},n.prototype.eS=function(){for(var t=this.md;t!=-1;t=this.ve(t))if(!e.ba.Ic(this.jc(t)))return!0;return!1},n.prototype.cC=function(t,i){for(var h=this.Ob(t),s=this.Ob(i),o=this.mv(t),a=this.mv(i),u=this.Ob(t);u!=-1;u=this.Sb(u))this.gx(u,i);for(u=this.Ob(i);u!=-1;u=this.Sb(u))this.gx(u,t);this.ap(t,s),this.ap(i,h),this.bp(t,a),this.bp(i,o),h=this.I(t),s=this.ea(t),o=this.ea(i),this.Vj(t,this.I(i)),this.Vj(i,h),this.Tl(t,o),this.Tl(i,s),h=this.dd.U(t,2),this.dd.T(t,2,this.dd.U(i,2)),this.dd.T(i,2,h)},n}(),e.hd=y})(k||(k={})),function(e){var y=function(f){function r(n,t,i,h){var s=f.call(this)||this;return s.aa=new e.l,n===void 0?s.PE():typeof n=="number"?s.QO(n,t,i,h):n instanceof e.Ta?t!==void 0?s.Su(n,t,i):s.RO(n):n instanceof e.sa?t!==void 0?s.TO(n,t):s.SO(n):n instanceof e.l?s.PO(n):s.PE(),s}return J(r,f),r.prototype.Su=function(n,t,i){this.description=e.fe.pg(),this.aa.Pa(),n.B()||this.vu(n,t,i)},r.prototype.PO=function(n){this.description=e.fe.pg(),this.aa.L(n),this.aa.normalize()},r.prototype.SO=function(n){if(n==null)throw e.i.O();this.description=n,this.aa.Pa()},r.prototype.TO=function(n,t){if(n==null)throw e.i.O();this.description=n,this.aa.L(t),this.aa.normalize()},r.prototype.PE=function(){this.description=e.fe.pg(),this.aa.Pa()},r.prototype.RO=function(n){this.description=e.fe.pg(),this.aa.Pa(),n.B()||this.vu(n)},r.prototype.QO=function(n,t,i,h){this.description=e.fe.pg(),this.L(n,t,i,h)},r.prototype.L=function(n,t,i,h){if(this.wc(),typeof n=="number")this.aa.L(n,t,i,h);else for(this.Pa(),t=0,i=n.length;t=e.sa.Wa(t))throw e.i.O();var h=this.description.Rf(t);return this.qu(),0<=h?this.la[this.fR(this.description,n)+this.description.GR(h)-2+i]:e.sa.te(t)},r.prototype.qu=function(){if(this.wc(),this.la==null&&2=e.sa.Wa(t))throw e.i.de();var h=this.description.Rf(t);return 0<=h?(this.qu(),this.la[r.Ig(this.description,n)+this.description.bk(h)-2+i]):e.sa.te(t)},r.prototype.qD=function(n,t,i,h){if(this.wc(),t==0)n!=0?i!=0?this.aa.H=h:this.aa.C=h:i!=0?this.aa.G=h:this.aa.v=h;else{if(i>=e.sa.Wa(t))throw e.i.de();if(!this.hasAttribute(t)){if(e.sa.yG(t,h))return;this.se(t)}t=this.description.Rf(t),this.qu(),this.la[r.Ig(this.description,n)+this.description.bk(t)-2+i]=h}},r.Ig=function(n,t){return t*(n.Be.length-2)},r.prototype.Fa=function(n){this.wc();var t=new e.l;return n.A(t),this.aa.Fa(t)},r.prototype.isIntersecting=function(n){return n instanceof e.l?this.aa.isIntersecting(n):this.aa.isIntersecting(n.aa)},r.prototype.Lu=function(n,t){this.wc(),n.B()?this.Pa():t!==void 0?this.vu(n,t,void 0):this.aa.Lu(n.Ng(),n.kh())},r.prototype.offset=function(n,t){this.wc(),this.aa.offset(n,t)},r.prototype.normalize=function(){this.wc(),this.aa.normalize()},r.prototype.tf=function(n){if(n===void 0){if(n=new e.Ta(this.description),this.B())return n;for(t=this.description.Ba,i=1;ithis.C&&(this.C=i.x),i.ythis.H&&(this.H=i.y)}}else if(r==null||r.length==0)this.Pa();else for(i=r[0],this.L(i.x,i.y),t=1;tr?this.v=r:this.Cn?this.G=n:this.Hr?this.v=r:this.Cn?this.G=n:this.Hthis.C||this.G>this.H)&&this.Pa())},f.prototype.scale=function(r){0>r&&this.Pa(),this.B()||(this.v*=r,this.C*=r,this.G*=r,this.H*=r)},f.prototype.zoom=function(r,n){this.B()||this.L(this.tf(),r*this.S(),n*this.da())},f.prototype.isIntersecting=function(r){return!this.B()&&!r.B()&&(this.v<=r.v?this.C>=r.v:r.C>=this.v)&&(this.G<=r.G?this.H>=r.G:r.H>=this.G)},f.prototype.CG=function(r){return(this.v<=r.v?this.C>=r.v:r.C>=this.v)&&(this.G<=r.G?this.H>=r.G:r.H>=this.G)},f.prototype.Fa=function(r){return!this.B()&&!r.B()&&(r.v>this.v&&(this.v=r.v),r.Cthis.G&&(this.G=r.G),r.Hr.length)throw e.i.O();r[0]!=null?r[0].na(this.v,this.G):r[0]=e.h.construct(this.v,this.G),r[1]!=null?r[1].na(this.v,this.H):r[1]=e.h.construct(this.v,this.H),r[2]!=null?r[2].na(this.C,this.H):r[2]=e.h.construct(this.C,this.H),r[3]!=null?r[3].na(this.C,this.G):r[3]=e.h.construct(this.C,this.G)},f.prototype.rF=function(){return this.B()?0:this.S()*this.da()},f.prototype.tR=function(){return this.B()?0:2*(this.S()+this.da())},f.prototype.ik=function(){return(this.C+this.v)/2},f.prototype.Lp=function(){return(this.H+this.G)/2},f.prototype.S=function(){return this.C-this.v},f.prototype.da=function(){return this.H-this.G},f.prototype.move=function(r,n){this.B()||(this.v+=r,this.G+=n,this.C+=r,this.H+=n)},f.prototype.Lu=function(r,n){if(n!==void 0)this.move(r-this.ik(),n-this.Lp());else if(r instanceof e.h)this.Lu(r.x,r.y);else{if(!(r instanceof e.Ta))throw e.i.O();n=(this.C-this.v)/2;var t=(this.H-this.G)/2;this.v=r.Ng()-n,this.C=r.Ng()+n,this.G=r.kh()-t,this.H=r.kh()+t}},f.prototype.offset=function(r,n){this.v+=r,this.C+=r,this.G+=n,this.H+=n},f.prototype.normalize=function(){if(!this.B()){var r=Math.min(this.v,this.C),n=Math.max(this.v,this.C);this.v=r,this.C=n,r=Math.min(this.G,this.H),n=Math.max(this.G,this.H),this.G=r,this.H=n}},f.prototype.fn=function(r){r.na(this.v,this.G)},f.prototype.VI=function(r){r.na(this.C,this.G)},f.prototype.YI=function(r){r.na(this.v,this.H)},f.prototype.gn=function(r){r.na(this.C,this.H)},f.prototype.aT=function(){return this.B()||this.v<=this.C&&this.G<=this.H},f.prototype.tf=function(){return e.h.construct((this.C+this.v)/2,(this.H+this.G)/2)},f.prototype.hz=function(){return e.h.construct(this.v,this.G)},f.prototype.contains=function(r,n){if(n!==void 0)return r>=this.v&&r<=this.C&&n>=this.G&&n<=this.H;if(r instanceof e.Ta)return this.contains(r.Ng(),r.kh());if(r instanceof e.h)return this.contains(r.x,r.y);if(r instanceof f)return r.v>=this.v&&r.C<=this.C&&r.G>=this.G&&r.H<=this.H;throw e.i.O()},f.prototype.jm=function(r,n){if(n!==void 0)return r>this.v&&rthis.G&&nthis.v&&r.Cthis.G&&r.H>>32);var n=e.P.Vh(r);return r=this.C,r=e.P.truncate(r^r>>>32),n=e.P.Vh(r,n),r=this.G,r=e.P.truncate(r^r>>>32),n=e.P.Vh(r,n),r=this.H,r=e.P.truncate(r^r>>>32),e.P.Vh(r,n)},f.prototype.zr=function(){return this.B()?2220446049250313e-29:2220446049250313e-29*(Math.abs(this.v)+Math.abs(this.C)+Math.abs(this.G)+Math.abs(this.H)+1)},f.prototype.uy=function(r,n){var t=this.ak(r),i=this.ak(n);if(t&i)return 0;if(!(t|i))return 4;var h=(t!=0?1:0)|(i!=0?2:0);do{var s=n.x-r.x,o=n.y-r.y;if(s>o?t&f.TC?(t&f.lu?(r.y+=o*(this.v-r.x)/s,r.x=this.v):(r.y+=o*(this.C-r.x)/s,r.x=this.C),t=this.ak(r)):i&f.TC?(i&f.lu?(n.y+=o*(this.v-n.x)/s,n.x=this.v):(n.y+=o*(this.C-n.x)/s,n.x=this.C),i=this.ak(n)):t!=0?(t&f.mu?(r.x+=s*(this.G-r.y)/o,r.y=this.G):(r.x+=s*(this.H-r.y)/o,r.y=this.H),t=this.ak(r)):(i&f.mu?(n.x+=s*(this.G-n.y)/o,n.y=this.G):(n.x+=s*(this.H-n.y)/o,n.y=this.H),i=this.ak(n)):t&f.UC?(t&f.mu?(r.x+=s*(this.G-r.y)/o,r.y=this.G):(r.x+=s*(this.H-r.y)/o,r.y=this.H),t=this.ak(r)):i&f.UC?(i&f.mu?(n.x+=s*(this.G-n.y)/o,n.y=this.G):(n.x+=s*(this.H-n.y)/o,n.y=this.H),i=this.ak(n)):t!=0?(t&f.lu?(r.y+=o*(this.v-r.x)/s,r.x=this.v):(r.y+=o*(this.C-r.x)/s,r.x=this.C),t=this.ak(r)):(i&f.lu?(n.y+=o*(this.v-n.x)/s,n.x=this.v):(n.y+=o*(this.C-n.x)/s,n.x=this.C),i=this.ak(n)),(t&i)!=0)return 0}while(t|i);return h},f.prototype.ak=function(r){return(r.xthis.C?1:0)<<1|(r.ythis.H?1:0)<<3},f.prototype.Di=function(r){return!this.B()&&(this.S()<=r||this.da()<=r)},f.prototype.ub=function(r){return r instanceof e.h?Math.sqrt(this.dK(r)):Math.sqrt(this.px(r))},f.prototype.px=function(r){var n=0,t=0,i=this.v-r.C;return i>n&&(n=i),(i=this.G-r.H)>t&&(t=i),(i=r.v-this.C)>n&&(n=i),(i=r.G-this.H)>t&&(t=i),n*n+t*t},f.prototype.dK=function(r){var n=0,t=0,i=this.v-r.x;return i>n&&(n=i),(i=this.G-r.y)>t&&(t=i),(i=r.x-this.C)>n&&(n=i),(i=r.y-this.H)>t&&(t=i),n*n+t*t},f.prototype.en=function(r){this.B()?r.Pa():r.L(this.v,this.C)},f.lu=1,f.mu=4,f.TC=3,f.UC=12,f}();e.l=y}(k||(k={})),function(e){var y,f;(f=y||(y={}))[f.initialize=0]="initialize",f[f.initializeRed=1]="initializeRed",f[f.initializeBlue=2]="initializeBlue",f[f.initializeRedBlue=3]="initializeRedBlue",f[f.sweep=4]="sweep",f[f.sweepBruteForce=5]="sweepBruteForce",f[f.sweepRedBlueBruteForce=6]="sweepRedBlueBruteForce",f[f.sweepRedBlue=7]="sweepRedBlue",f[f.sweepRed=8]="sweepRed",f[f.sweepBlue=9]="sweepBlue",f[f.iterate=10]="iterate",f[f.iterateRed=11]="iterateRed",f[f.iterateBlue=12]="iterateBlue",f[f.iterateBruteForce=13]="iterateBruteForce",f[f.iterateRedBlueBruteForce=14]="iterateRedBlueBruteForce",f[f.resetRed=15]="resetRed",f[f.resetBlue=16]="resetBlue";var r=function(){function n(t,i){this.ei=t,this.ZG=i}return n.prototype.qr=function(t,i,h){this.ei.FX(h,t,i,this.ZG)},n.prototype.bq=function(t){return this.ei.Tr(t,this.ZG)},n}();y=function(){function n(){this.qw=this.qo=this.ff=this.sd=null,this.yq=new e.l,this.Cm=this.Jj=this.Kj=this.Bd=this.Ff=this.Md=this.ew=this.io=this.rd=this.Fb=null,this.Yb=-1,this.ra=0,this.Pk()}return n.prototype.mr=function(){this.Pk(),this.Rv=!0,this.Fb==null?(this.io=new e.ja(0),this.Fb=[]):(this.io.Dh(0),this.Fb.length=0)},n.prototype.bd=function(t,i){if(!this.Rv)throw e.i.Hb();var h=new e.l;h.L(i),this.io.add(t),this.Fb.push(h)},n.prototype.Hp=function(){if(!this.Rv)throw e.i.Hb();this.Rv=!1,this.Fb!=null&&0this.Fb.length)return this.qe=this.Fb.length,this.Yb=5,!0;this.sd==null&&(this.sd=new e.ur(!0),this.qo=this.sd.getIterator(),this.Md=new e.ja(0)),this.sd.mr();for(var t=0;tthis.Fb.length||10>this.rd.length)return this.qe=this.Fb.length,this.Yb=6,!0;this.sd==null&&(this.sd=new e.ur(!0),this.qo=this.sd.getIterator(),this.Md=new e.ja(0)),this.sd.mr();for(var t=0;tthis.Fb.length||10>this.rd.length)return this.qe=this.Fb.length,this.Yb=6,!0;this.ff==null&&(this.ff=new e.ur(!0),this.qw=this.ff.getIterator(),this.Ff=new e.ja(0)),this.ff.mr();for(var t=0;tthis.Fb.length||10>this.rd.length)return this.qe=this.Fb.length,this.Yb=6,!0;this.sd==null&&(this.sd=new e.ur(!0),this.qo=this.sd.getIterator(),this.Md=new e.ja(0)),this.ff==null&&(this.ff=new e.ur(!0),this.qw=this.ff.getIterator(),this.Ff=new e.ja(0)),this.sd.mr();for(var t=0;t>1;return n.gq(t)?(this.sd.remove(i),this.qe!=0||(this.Bf=this.Xf=-1,this.Jc=!0,!1)):(this.qo.zB(this.Fb[i].v,this.Fb[i].C,this.ra),this.Xf=i,this.Yb=10,!0)},n.prototype.MX=function(){return--this.qe==-1?(this.Bf=this.Xf=-1,this.Jc=!0,!1):(this.Tg=this.Xf=this.qe,this.Yb=13,!0)},n.prototype.NX=function(){return--this.qe==-1?(this.Bf=this.Xf=-1,this.Jc=!0,!1):(this.Xf=this.qe,this.Tg=this.rd.length,this.Yb=14,!0)},n.prototype.OX=function(){var t=this.Md.get(this.qe-1),i=this.Ff.get(this.Tg-1),h=this.Tr(t,!0),s=this.Tr(i,!1);return h>s?this.tx():h>1;if(n.gq(t))return this.Ef!=-1&&this.Kj.get(i)!=-1?(this.Bd.kd(this.Ef,this.Kj.get(i)),this.Kj.set(i,-1)):this.sd.remove(i),this.qe!=0||(this.Bf=this.Xf=-1,this.Jc=!0,!1);if(this.Df!=-1&&0>1;if(n.gq(t))return this.Df!=-1&&this.Jj.get(i)!=-1?(this.Bd.kd(this.Df,this.Jj.get(i)),this.Jj.set(i,-1)):this.ff.remove(i),this.Tg!=0||(this.Bf=this.Xf=-1,this.Jc=!0,!1);if(this.Ef!=-1&&0>1;return this.sd.xj(t),this.Yb=4,!0},n.prototype.eT=function(){if(this.Xf=this.qo.next(),this.Xf!=-1)return!1;this.Bf=this.Xf=-1;var t=this.Ff.get(this.Tg)>>1;return this.ff.xj(t),this.Yb=7,!0},n.prototype.bT=function(){if(this.Bf=this.qw.next(),this.Bf!=-1)return!1;var t=this.Md.get(this.qe)>>1;return this.sd.xj(t),this.Yb=7,!0},n.prototype.cT=function(){if(--this.Tg==-1)return this.Yb=5,!0;this.yq.L(this.Fb[this.qe]);var t=this.Fb[this.Tg];return this.yq.X(this.ra,this.ra),!this.yq.isIntersecting(t)||(this.Bf=this.Tg,!1)},n.prototype.dT=function(){if(--this.Tg==-1)return this.Yb=6,!0;this.yq.L(this.Fb[this.qe]);var t=this.rd[this.Tg];return this.yq.X(this.ra,this.ra),!this.yq.isIntersecting(t)||(this.Bf=this.Tg,!1)},n.prototype.fJ=function(){return this.sd==null?(this.Jc=!0,!1):(this.qe=this.Md.size,0>1],n.gq(t)?i.G-h:i.H+h):(i=this.rd[t>>1],n.gq(t)?i.G-h:i.H+h)},n}(),e.sC=y}(k||(k={})),function(e){var y=function(){function f(){}return f.construct=function(r,n,t,i,h,s){var o=new f;return o.v=r,o.G=n,o.Xe=t,o.C=i,o.H=h,o.Dg=s,o},f.prototype.Pa=function(){this.Xe=this.v=NaN},f.prototype.B=function(){return isNaN(this.v)},f.prototype.SS=function(){return isNaN(this.Xe)},f.prototype.L=function(r,n,t,i,h,s){i!==void 0?typeof r=="number"?(this.v=r,this.G=n,this.Xe=t,this.C=i,this.H=h,this.Dg=s):(this.v=r.x-.5*n,this.C=this.v+n,this.G=r.y-.5*t,this.H=this.G+t,this.Xe=r.z-.5*i,this.Dg=this.Xe+i):(this.v=r,this.G=n,this.Xe=t,this.C=r,this.H=n,this.Dg=t)},f.prototype.move=function(r){this.v+=r.x,this.G+=r.y,this.Xe+=r.z,this.C+=r.x,this.H+=r.y,this.Dg+=r.z},f.prototype.copyTo=function(r){r.v=this.v,r.G=this.G,r.C=this.C,r.H=this.H},f.prototype.Nk=function(r,n,t){this.v>r?this.v=r:this.Cn?this.G=n:this.Ht?this.Xe=t:this.Dgr.length)throw e.i.O();r[0]=new e.Od(this.v,this.G,this.Xe),r[1]=new e.Od(this.v,this.H,this.Xe),r[2]=new e.Od(this.C,this.H,this.Xe),r[3]=new e.Od(this.C,this.G,this.Xe),r[4]=new e.Od(this.v,this.G,this.Dg),r[5]=new e.Od(this.v,this.H,this.Dg),r[6]=new e.Od(this.C,this.H,this.Dg),r[7]=new e.Od(this.C,this.G,this.Dg)},f.prototype.bx=function(r){if(r==null||r.length==0)this.Pa();else{var n=r[0];for(this.L(n.x,n.y,n.z),n=1;nthis.AA;){var a=this.td.ia();if(h.N(a.bc()),s.N(a.xc()),h.scale(this.Xa.fc),s.scale(this.Xa.fc),e.ej.Ou(h,s)?h.x=s.x:e.ej.Mu(h,s)&&(s.x=h.x),this.wk.length=0,e.ej.oF(this.Xa.Ub,this.Xa.lc,this.Xa.Ae,h,s,this.Xa.LA,this.Xa.at,o,this.Pj,this.Is,this.wk,this.dw),this.fo!=null&&(a=this.wk.slice(0),this.fo.lG(this.fo.ea()-1,a,a.length-1)),e.ej.Nu(h,s)?(this.sq.Pa(),this.Xa.ny(h,this.ul,this.sq),this.Zn=!0):(this.sq.Pa(),this.Zn=this.sy(o[0],this.sq)),this.Zn){if(this.td.ni(),this.td.zz()){this.td.ni(),this.td.ia();break}this.td.xW();break}t==null&&(t=new e.Ea).$k(null,0),this.JD(t),i++}if(this.dw[0]=0,0=this.Pj[0]){var o=this.fi+1.570796326794897;h=o+3.141592653589793-(this.fi-this.Pj[0])}else h=(o=this.fi+1.570796326794897)+3.141592653589793-(6.283185307179586-(this.Pj[0]-this.fi));var a=!(this.fi>=this.Pj[0]&&3.141592653589793>=this.fi-this.Pj[0])&&!(this.fio;)c-=6.283185307179586;ci.x-this.uk[0]?this.uk[0]-=6.283185307179586:3.141592653589793o?u.tX():u.bo=o,h=t.K(),e.ba.zd(h)?((h=new e.Ua(t.description)).pc(t,!0),t=h,h=1607):h==197&&(h=new e.l,t.A(h),h.S()<=u.ra||h.da()<=u.ra?((h=new e.Ua(t.description)).bd(t,!1),t=h,h=1607):((h=new e.Ea(t.description)).bd(t,!1),t=h,h=1736)),u.uX(),e.ba.Tn(h)||u.vX(),u.sb<=.5*u.bo)return h!=1736?new e.Ea(t.description):u.Yv?t:e.ej.Sr(t,u.Sg,u.Ae,u.LA,-1,a);if(0>u.La&&h!=1736)return new e.Ea(t.description);if(u.Yv&&e.ba.Ic(h)?(i=e.ej.Sr(t,i,4,NaN,u.bo,a),t=e.cb.Bh(i,u.Sg,u.Kc)):t=e.cb.Bh(t,u.Sg,u.Kc),(t=e.Jh.nj(t,u.Kc)).B())return new e.Ea(t.description);switch(!u.Yv&&e.ba.Ic(h)&&(t=e.ej.kI(u.fc,t)),t=n.GX(t,u.Kc),h){case 1736:i=u.PN(t);break;case 1607:i=u.QN(t);break;case 550:i=u.NN(t);break;case 33:i=u.ON(t);break;default:throw e.i.ga("corrupted_geometry")}return(u=e.cb.Bh(i,u.Kc,u.Sg)).Ll(t.description),u},n.prototype.PN=function(t){var i=new e.Ea;t=new f(this,t,i),t=e.Ih.local().W(t,this.Kc,this.Vb).next(),t=e.kp.pj(t,this.Kc,2);var h=new e.Ed;return h.scale(1/this.fc,1/this.fc),i.Pc(h),i=e.kp.pj(i,this.Kc,2),0<=this.La?e.Ih.local().W(i,t,this.Kc,this.Vb):e.mp.local().W(i,t,this.Kc,this.Vb)},n.prototype.QN=function(t){return t=new f(this,t,null),t=e.Ih.local().W(t,this.Kc,this.Vb).next(),e.kp.pj(t,this.Kc,2)},n.prototype.NN=function(t){return t=new y(this,t),t=e.Ih.local().W(t,this.Kc,this.Vb).next(),e.kp.pj(t,this.Kc,2)},n.prototype.ON=function(t){(t=t.D()).scale(this.fc);var i=new e.Ea;return this.ny(t,!1,i),e.kp.pj(i,this.Kc,2)},n.prototype.sy=function(t,i,h,s,o,a){var u=t[0],c=t[t.length-1],l=u.y>c.y?u.y:c.y,p=e.F.q(this.Ub,this.lc,u.yt.He()&&(this.PV(t),!0)},n.prototype.JI=function(t,i,h){var s=h.I(),o=0a.x?(a=this.Bq,s.ig(-this.Ls,0)):(a=-this.Bq,s.ig(this.Ls,0)),i.add(t,!1),t.Pa(),h.add(i,!1),h.Pc(s),o=new e.l,h.A(o),o.X((this.Ls-o.S())/2,0),o.G=-this.Bq,o.H=this.Bq;for(var c=0;c=u));)e.kb.Ai(t,i,o.x,o.y,s,A,g,x),l?w.na(g.u,x.u):(m.na(g.u,x.u),n.bJ(o.x,m.x,j.x,p),w.na(p[0]+m.x,m.y),j.N(w)),w.scale(h),v.xf(0,-1,w),a=A,A=M++*c}},n.ZI=function(t,i,h,s,o,a,u,c,l,p){var v=new e.h,b=new e.h,d=new e.ha(0),g=new e.ha(0);for(e.kb.Ai(t,i,s.x,s.y,h,o,d,g),v.na(d.u,g.u),e.kb.Ai(t,i,s.x,s.y,h,a,d,g),b.na(d.u,g.u),h=new e.ha(0),e.kb.Sy(t,i,u.x,u.y,v.x,v.y,h),l[0]=h.u,e.kb.Sy(t,i,u.x,u.y,b.x,b.y,h),p[0]=h.u;l[0]<=p[0];)l[0]+=6.283185307179586;for(;l[0]>p[0];)l[0]-=6.283185307179586;for(;l[0]>=c;)l[0]-=6.283185307179586,p[0]-=6.283185307179586;for(;l[0]a[v]?1:0}),i=t.Ja(),c=0;cthis.sb/t&&(t=this.sb/500),.01>t&&(t=.01),this.bo=t},n}();e.QK=r}(k||(k={})),function(e){var y=function(){function f(){}return f.Of=function(r,n){var t=new e.h;t.N(n),r.push(t)},f.wp=function(r,n){r.add(n.x),r.add(n.y)},f.cB=function(r){r.Dh(r.size-2)},f.jB=function(r,n){n.na(r.get(r.size-2),r.get(r.size-1))},f.Sr=function(r,n,t,i,h,s){if(r==null)throw e.i.O();var o=r.K();if(r.B()||e.ba.Tn(o))return r;var a=new f;a.Sg=n,a.Kc=e.cb.tc(n);var u=e.cb.xv(a.Kc);if(a.Vb=s,a.Ub=e.cb.gv(a.Kc),a.lc=u*(2-u),a.fc=a.Kc.Id().ci,a.Cq=a.Kc.Mn(),a.at=a.Cq*a.fc,a.vA=i,a.uA=h,a.Ae=t,o==197?(t=new e.Ea(r.description)).bd(r,!1):e.ba.zd(o)?(t=new e.Ua(r.description)).pc(r,!0):t=r,a.Ae!=4){if((n=a.Sg.Nb(a.Kc)==0?e.cb.Bh(t,a.Sg,a.Kc):e.Jh.nj(t,a.Kc)).B())return n;n=f.kI(a.fc,n),n=a.Uy(n),n=e.kp.pj(n,a.Kc,a.Ae),a=e.cb.Bh(n,a.Kc,a.Sg)}else{if(e.Gg.Tb(n)==2?(r=e.cb.ol(),(n=e.Zj.local().W(t,r,n,s))==r&&(n=new e.Ea,r.copyTo(n))):n=e.Jh.nj(t,a.Kc),n.B())return n;a=a.yX(n)}return a},f.kI=function(r,n){var t=new e.l;if(n.yc(t),3.141592653589793>t.S()*r)return n;var i=!1;t=n.Ha();for(var h=new e.h,s=new e.h;t.ab();)for(;t.Ia();){var o=t.ia();if(h.N(o.bc()),s.N(o.xc()),h.scale(r),s.scale(r),3.141592653589793s.x-h.x)for(;-6.283185307179586>s.x-h.x;)s.x+=6.283185307179586;f.Yi(s.x,NaN,g),p.N(s)}else c.N(s),f.vU(c),f.Yi(c.x,d,g),p.na(g[0]+c.x,c.y);.5>Math.abs(p.x-s.x)&&p.N(s),u?(o.Vw(0,b),v.N(l),v.scale(1/r),b.Db(v),(a=t.xm())?i.nf(b):i.lineTo(b),t.Sn()&&!n.ec(t.gb)&&(o.Vw(1,b),v.N(p),v.scale(1/r),b.Db(v),i.lineTo(b))):((a=t.xm())&&i.Cz(null,0),o=i.ea()-1,v.N(l),v.scale(1/r),i.xf(o,-1,v),t.Sn()&&!n.ec(t.gb)&&(v.N(p),v.scale(1/r),i.xf(o,-1,v)))}return i},f.oF=function(r,n,t,i,h,s,o,a,u,c,l,p){var v=new e.h,b=new e.h,d=0m&&(m+=6.283185307179586),0>(g=g.u)&&(g+=6.283185307179586),u!=null&&(u[0]=x),c!=null&&(c[0]=m),l!=null&&(l[0]=g),c=u=NaN,p!=null&&(u=((c=e.F.Ch(r,n))-(l=e.F.q(r,n,i.y)))/x,c=(c+l)/x),l=f.Ou(i,h),g=f.Mu(i,h),m=l||g;var w=f.AE(i,h,a),j=new e.ha(0),M=new e.ha(0),A=new e.h,z=new e.h,N=new e.h;f.Yi(i.x,NaN,b);var I=[b[0]];if(x<=s)f.Of(v,i),f.Yi(h.x,NaN,b),p!=null&&p.add(0),m?(l&&f.fB(i,h,p,v),g&&f.dB(i,h,p,v)):w?f.eB(i,h,d,u,c,p,v):0N.x&&(b[0]+=6.283185307179586,N.na(b[0]+A.x,A.y)):P.xo.x?o.x+=6.283185307179586:3.141592653589793S;S++)if(P=D[S]*c+(1-D[S])*u,e.kb.qj(r,n,i.x,i.y,P*h,s,x,m,t),A.na(x.u,m.u),S==0&&(C=P,z.N(A)),f.RW(j,A,M,I),I.ic(I.ge(A,!0),N),e.kb.xd(r,n,A.x,A.y,N.x,N.y,w,null,null,2),w.u>l){B=!0;break}B?(M.N(z),c=C,f.wp(o,M),a.add(c)):(f.cB(o),a.Gn(a.size-1,1,a.size-1),0=o&&W.u<=s&&3.141592653589793>Math.abs(d.x-g.x)||i.Tx(B,C)<=h));I++){var L=U[I]*C+(1-U[I])*B;if(i.ic(L,p),N?x.na(p.x*t,p.y*t):(z[0][0]=p.x,z[0][1]=p.y,e.cb.wt(),x.x=z[0][0]*t,x.y=z[0][1]*t),I==0&&(tt=L,b.N(p),w.N(x),0s||3.141592653589793<=Math.abs(d.x-g.x)))){O=!0;break}if(S&&0s||3.141592653589793<=Math.abs(d.x-x.x)){O=!0;break}}else if(0o){O=!0;break}if(S){if(e.kb.xd(r,n,A.x,A.y,m.x,m.y,V,null,null,2),V.u>o){O=!0;break}if(e.kb.xd(r,n,m.x,m.y,x.x,x.y,nt,null,null,2),nt.u>o){O=!0;break}}}}O?(l.N(b),g.N(w),C=tt,f.wp(D,l),f.wp(F,g),H.add(C)):(f.cB(D),f.cB(F),H.Gn(H.size-1,1,H.size-1),f.Of(u,l),P+=W.u,a!=null&&a.add(P),0Math.abs(n.x-r.x)?(i.Ec(r),3.141592653589793<=t.x-r.x?i.Sl(t.x-6.283185307179586,t.y):3.141592653589793<=r.x-t.x?i.Sl(t.x+6.283185307179586,t.y):i.Sl(t.x,t.y)):(i.Ec(t),3.141592653589793<=r.x-t.x?i.Sl(r.x-6.283185307179586,r.y):3.141592653589793<=t.x-r.x?i.Sl(r.x+6.283185307179586,r.y):i.Sl(r.x,r.y))},f.TJ=function(r,n){for(var t=0;tr.x)for(;-3.141592653589793>r.x;)r.x+=6.283185307179586;if(3.141592653589793f.v+i&&sf?-f:f},y.Mb=function(f,r){return 0<=r?y.R(f):-y.R(f)},y.$=function(f,r){return f==r||y.R(f-r)<=y.EC*(1+(y.R(f)+y.R(r))/2)},y.Dd=function(f){return f==0||y.R(f)<=y.EC},y.Ch=function(f,r){var n=(r=(1-(r=Math.sqrt(1-r)))/(1+r))*r;return f/(1+r)*(1+n*(.25+n*(.015625+1/256*n)))*y.zL},y.zL=1.5707963267948966,y.EC=3552713678800501e-30,y}()}(k||(k={})),function(e){var y=function(r){this.Yf=r,this.Mk=this.Yf.getCode(),0>this.Mk&&(this.Mk=0)};e.zY=y;var f=function(){function r(n){n===void 0&&(n=null),this.Ej=null,this.Wn=!1,n!==null&&(this.Ej=new y(n))}return r.prototype.Fc=function(){return this.Ej!=null?this.Ej.Mk:0},r.prototype.Qf=function(){var n=new r;return this.copyTo(n),n},r.prototype.copyTo=function(n){n.Ej=this.Ej,n.Wn=this.Wn},r.prototype.Lz=function(){this.Wn=!this.Wn},r.prototype.sm=function(){return this.Ej!=null?this.Ej.Yf:null},r.prototype.GJ=function(n){if(0>=n)throw e.i.O();if(n!=this.Fc()){if((n=e.qf.geogtran(n))==null)throw e.i.O("Geogtran not found.");this.Ej=new y(n)}},r.prototype.wz=function(){return this.Ej==null?null:this.Ej.Yf.toString()},r.prototype.pX=function(n){if(n==null)throw e.i.O();var t=null;try{t=e.qf.fromString(e.Tc.PE_TYPE_GEOGTRAN,n)}catch{throw e.i.O()}this.Ej=new y(t)},r.prototype.Nb=function(n){return n==this||!(!(n instanceof r)||(0>=this.Fc()||this.Fc()!=n.Fc())&&!this.sm().isEqual(n.sm()))&&this.Wn==n.Wn},r.prototype.toString=function(){var n="GeographicTransformation: "+this.wz();return 200r.I())},f.wE=function(r){return!(r.B()||r.K()!=1607&&r.K()!=1736||20>r.I())},f}();e.Wk=y}(k||(k={})),function(e){e.ac=function(){function y(){}return y.OT=function(f){var r=new e.Ea;return r.rx(f.gs(),f.js()),r.Aj(f.gs(),f.hs()),r.Aj(f.fs(),f.hs()),r.Aj(f.fs(),f.js()),r},y.Bh=function(f,r){return f===null?null:e.Gx.local().W(f,r,null)},y.fY=function(f,r){var n=e.Ih.local();return f=new e.$c(f),n.W(f,r,null).next()},y.km=function(f,r,n){return e.mp.local().W(f,r,n,null)},y.gp=function(f,r,n){return e.Jx.local().W(f,r,n,null)},y.RX=function(f,r,n){var t=e.Jx.local();for(f=new e.$c(f),r=new e.$c(r),n=t.W(f,r,n,null),t=[];(r=n.next())!=null;)t.push(r);return t},y.Nb=function(f,r,n){return e.fj.local().W(3,f,r,n,null)},y.OP=function(f,r,n){return e.fj.local().W(4,f,r,n,null)},y.MS=function(f,r,n){var t=e.Zj.local();for(f=new e.$c(f),r=new e.$c(r),n=t.W(f,r,n,null),t=[];(r=n.next())!=null;)t.push(r);return t},y.LP=function(f,r,n){var t=e.mp.local();for(f=new e.$c(f),r=new e.$c(r),n=t.W(f,r,n,null),t=[];(r=n.next())!=null;)t.push(r);return t},y.Fa=function(f,r,n){return e.Zj.local().W(f,r,n,null)},y.LS=function(f,r,n){if((f=e.Zj.local().W(f,r,n,null,1))===null)return[];if(f.K()===550){for(r=[],n=0;nf.Eb())return 0;var t=null;if(r!=null){if(t=r.Id(),n!=null&&t.Fc()!=n.Fc()&&t.pd!=n.pd)throw e.i.Zk()}else if(n!=null)throw e.i.O();f.K()==1736||f.K()==197?r=f.ng():e.ba.zd(f.K())?(r=new e.Ua(f.description)).pc(f,!0):r=f,f=0,r=r.Ha();for(var i=new e.h,h=new e.h;r.ab();)for(;r.Ia();){var s=r.ia();s.$p(i),s.Vr(h),f+=e.h.ub(i,h)}return t!==null&&n!==null&&(f=e.Uc.Ph(f,t,n)),f},y.aP=function(f){return f.points!==void 0?y.hS(f,f.hasZ!==void 0&&f.hasZ,f.hasM!==void 0&&f.hasM):f.rings!==void 0?y.gG(f.rings,f.hasZ!==void 0&&f.hasZ,f.hasM!==void 0&&f.hasM,"P"):f.paths!==void 0?y.gG(f.paths,f.hasZ!==void 0&&f.hasZ,f.hasM!==void 0&&f.hasM,"L"):f.x!==void 0?y.iS(f):f.xmin!==void 0?y.gS(f):null},y.iS=function(f){if(f.x==null||f.x=="NaN")return new e.Ta;var r=new e.Ta(f.x,f.y);return f.z!==void 0&&f.z!==null&&r.sX(f.z),f.m!==void 0&&f.m!==null&&r.cX(f.m),r},y.gS=function(f){if(f.xmin==null||f.xmin=="NaN")return new e.Hh;var r=new e.Hh(f.xmin,f.ymin,f.xmax,f.ymax);return f.zmin!==void 0&&f.zmin!==null&&r.setInterval(1,0,f.zmin,f.zmax),f.mmin!==void 0&&f.mmin!==null&&r.setInterval(2,0,f.mmin,f.mmax),r},y.hS=function(f,r,n){var t=0,i=new e.ee,h=3*f.points.length;h%2!=0&&h++,2>h&&(h=2);var s=e.P.truncate(3*f.points.length/2);4>s?s=4:16>s&&(s=16),h=e.Zc.Fn(h,0);var o=e.Zc.Fn(s);s=e.Zc.Fn(s);for(var a=0;a=h?(p[v]=!1,c+=1,o.add(u),a.add(i),u+=b):p[v]=!0}for((t=3*u)%2!=0&&t++,2>t&&(t=2),4>(v=e.P.truncate(3*u/2))?v=4:16>v&&(v=16),t=e.Zc.Fn(t,0),i=e.Zc.Fn(v),h=e.Zc.Fn(v),v=b=0;vo)throw e.i.O();this.Si.pa=s-a,this.Si.wa=o+a,this.ji.resize(0),this.ie=0,this.tg[0]=0},h.prototype.Wo=function(s,o){this.Si.pa=s-o,this.Si.wa=s+o,this.ji.resize(0),this.ie=0,this.tg[0]=0},h.prototype.next=function(){if(!this.Za.nq)throw e.i.Hb();if(0>this.ie)return-1;for(var s=!0;s;)switch(this.tg[this.ie]){case 1:s=this.AU();break;case 2:s=this.BU();break;case 3:s=this.CU();break;case 4:s=this.DU();break;case 5:s=this.AW();break;case 6:s=this.fT();break;case 7:s=this.oN();break;case 0:s=this.Bz();break;default:throw e.i.Ra()}return this.Qg!=-1?this.Op()>>1:-1},h.construct=function(s){var o=new h;return o.Za=s,o.ji.Jb(20),o.ie=-1,o},h.prototype.Bz=function(){return this.Qg=this.qH=this.Oi=this.Mc=-1,this.Za.ne!=null&&0=this.Si.pa?(this.gi=this.LR(),!1):(this.ie--,!0)},h.prototype.oN=function(){return this.Qg=this.gi,this.Qg!=-1&&i.iq(this.Op())?(this.gi=this.NF(),!1):(this.ie--,!0)},h.prototype.NF=function(){return this.Za.Uf?this.Za.bg.lb(this.Qg):this.Za.Vi.lb(this.Qg)},h.prototype.LR=function(){return this.Za.Uf?this.Za.bg.xe(this.Qg):this.Za.Vi.xe(this.Qg)},h.prototype.Op=function(){return this.Za.Uf?this.Za.bg.ka(this.Qg):this.Za.Vi.getData(this.Qg)},h}();e.AY=t;var i=function(){function h(s){this.Cm=this.bi=this.bg=this.Vi=this.Mm=this.Gj=this.ne=this.Hj=null,this.Uf=s,this.nq=this.Uv=!1}return h.prototype.mr=function(){this.Pk(!0)},h.prototype.Dr=function(s,o){if(!this.Uv)throw e.i.Hb();this.Hj.push(new e.Oc(s,o))},h.prototype.Hp=function(){if(!this.Uv)throw e.i.ga("invalid call");this.Uv=!1,this.nq=!0,this.Uf||(this.qS(),this.aw=this.Hj.length)},h.prototype.xj=function(s){if(!this.Uf||!this.nq)throw e.i.O("invalid call");if(this.kf==-1){var o=this.Hj.length;if(this.dA){var a=new e.ja(0);a.Jb(2*o),this.XI(a),this.bi.Jb(2*o),this.bi.resize(0),this.WI(a),this.Mm.resize(o,-1),this.Mm.Yj(-1,0,o),this.dA=!1}else this.Mm.Yj(-1,0,o);this.kf=this.Vu()}o=this.kG(s<<1,this.kf),a=this.bg.addElement(1+(s<<1),this.rz(o)),this.QJ(o,a),this.Mm.set(s,o),this.aw++},h.prototype.remove=function(s){if(!this.Uf||!this.nq)throw e.i.ga("invalid call");var o=this.Mm.get(s);if(o==-1)throw e.i.O("the interval does not exist in the interval tree");this.Mm.set(s,-1),this.aw--;var a=this.rz(o),u=this.bg.UR(a);this.bg.wd(this.rR(o),a),this.bg.wd(this.OR(o),a),(s=this.bg.size(a))==0&&(this.bg.HP(a),this.UJ(u,-1)),this.Gj.kd(o),a=this.PF(u);var c=this.sj(u),l=this.nk(u);for(o=0;!(0>1);c!=-1?this.QJ(c,this.Vi.addElement(this.rz(c),u)):(c=this.kG(u,this.kf),a.set(u>>1,c))}},h.prototype.kG=function(s,o){var a=o,u=o,c=-1,l=0,p=this.bi.size-1,v=0,b=s>>1,d=NaN,g=NaN,x=!0,m=this.yR(b);for(b=this.vR(b);x;){lw&&(ww)o!=-1&&(o==a?(u=a,d=w,g=(o=this.nk(a))!=-1?this.Pp(o):NaN):g>1];return h.iq(s)?o.pa:o.wa},h}();e.ur=i}(k||(k={})),function(e){var y=function(){function f(r){if(r==null)throw e.i.ga("Invalid arguement");this.hf=r;var n=r.iR();n.cS()?r.ef.DG()?this.no=e.ui.PannableFold:this.no=e.ui.Clip:this.no=e.ui.DontClip,n.dS()?r.$f.DG()?this.Sm=e.ui.PannableFold:this.Sm=e.ui.Clip:this.Sm=e.ui.DontClip,this.Dm=n.Lr,this.hH=n.Xu,r=this.hf.nH,this.WG=r.ks(2147483648),this.Wv=r.ks(1073741824)}return f.Bh=function(r,n,t){return n.yw.Bh(r,t)},f.Tt=function(r,n,t,i){return r.yw.Tt(n,t,i)},f.St=function(r,n,t,i){if(t=0>t?n.length:t,(r=r.yw.Tt(n,t,i))==t)return r;for(var h=n=0;hh.H){var b=e.l.construct(a.v-1,h.G,a.C+1,h.H);if((v=e.ti.Pu(v,b,t,NaN,0,n)).B())return v}a.S()>2*h.S()&&(v=e.Ab.Jp(v,-2*h.S(),2*h.S(),t,!0,0,!0,n))}a=this.hH,(h=!isNaN(a))&&(v=e.Zl.local().W(v,a,n)),b=c?i.mk():null;var d=NaN;u&&(d=t.Bi());var g=i.Yr()!=null;if(this.WG)u&&(e.Ab.wr(t,d,v,o),h&&(u=t.jh(),a*=(d=t.tc().jh())/u)),e.Ab.vr(this.hf,v,p,o),h&&(u=t.tc().jh(),a*=(d=i.tc().jh())/u),t=v;else{var x=new e.Ua(v.description);x.yD(v),u&&(e.Ab.wr(t,d,x,o),h&&(u=t.jh(),a*=(d=t.tc().jh())/u)),e.Ab.vr(this.hf,x,p,o),h&&(u=t.tc().rm(),a*=(d=i.tc().rm())/u),p=NaN,c?(b=i.mk(),p=i.Bi()):isNaN(this.Dm)||(p=this.Dm),u=f.vv(t)|f.vv(i),d=10*l.Yd(0),this.Wv&&(u=3,d=0),t=e.Ab.PQ(v,t,x,l,p,n,u,d)}return g&&(t=e.Ab.SD(t,i,n)),c&&(s||(c=l.Le().S(),t.Vg(0,0).S()>=c-l.Yd(0)&&(l=b.getNorthPoleLocation(),c=b.getSouthPoleLocation(),v=b.getNorthPoleGeometry(),b=b.getSouthPoleGeometry(),p=0,v==e.Eg.PE_POLE_POINT&&l!=e.Eg.PE_POLE_OUTSIDE_BOUNDARY&&(p=1),b==e.Eg.PE_POLE_POINT&&c!=e.Eg.PE_POLE_OUTSIDE_BOUNDARY&&(p|=2),p!==0&&(s=!0))),t=e.Ab.Hz(t,i,this.Sm,n),h&&(t=e.Zl.local().W(t,a,n)),e.Ab.Kx(i,t,o)),t.B()||(s&&(t=e.$l.local().W(t,i,!1,n)),r!=null&&(t=r.al(t,!1),this.yp(r,e.dm.reverse,t),t=r.bl(t,!1))),t},f.vv=function(r){if(r.Tb()!=2)return 0;var n=0,t=r.mk();r=t.getNorthPoleLocation();var i=t.getSouthPoleLocation(),h=t.getNorthPoleGeometry();return t=t.getSouthPoleGeometry(),h==e.Eg.PE_POLE_POINT&&r!=e.Eg.PE_POLE_OUTSIDE_BOUNDARY&&(n=1),t==e.Eg.PE_POLE_POINT&&i!=e.Eg.PE_POLE_OUTSIDE_BOUNDARY&&(n|=2),n},f.prototype.cW=function(r,n){var t=this.hf.ef,i=this.hf.$f,h=t.Tb(),s=i.Tb(),o=e.P.Hu(Math.min(r.I(),64)),a=e.Ua.kg(r);h==3&&(h=(t=(r=t.Li).hk()).Tb(),a=r.bl(a,!0),this.yp(r,e.dm.forward,a),a=r.al(a,!0)),r=null,s==3&&(s=(i=(r=i.Li).hk()).Tb());var u=h==2;h=(s=s==2)?i.tc():i;var c=!s&&!this.Wv;if(u){if((a=e.Ab.OI(a,t,this.no,n)).B())return a}else{var l=new e.l;a.yc(l);var p=t.Le();if((l.Gp.H)&&(l=e.l.construct(l.v-1,p.G,l.C+1,p.H),(a=e.ti.Pu(a,l,t,NaN,0,n)).B()))return a}var v=NaN;u&&(v=t.Bi()),l=i.Yr()!=null,p=this.hH;var b=!isNaN(p);if(b&&(a=e.Zl.local().W(a,p,n)),this.WG)u&&e.Ab.wr(t,v,a,o),b&&(u=t.jh(),p*=(v=t.tc().jh())/u),e.Ab.vr(this.hf,a,c,o),b&&(u=t.tc().jh(),p*=(v=i.tc().jh())/u),t=a;else{var d=new e.Ua(a.description);d.yD(a),u&&(e.Ab.wr(t,v,d,o),b&&(u=t.jh(),p*=(v=t.tc().jh())/u)),e.Ab.vr(this.hf,d,c,o),b&&(u=t.tc().jh(),p*=(v=i.tc().jh())/u),c=NaN,s?c=i.Bi():isNaN(this.Dm)||(c=this.Dm),u=f.vv(t)|f.vv(i),v=10*h.Yd(0),this.Wv&&(u=3,v=0),t=e.Ab.QQ(a,t,d,h,c,n,u,v)}return l&&(t=e.Ab.SD(t,i,n)),s&&(t=e.Ab.Hz(t,i,this.Sm,n),b&&(t=e.Zl.local().W(t,p,n)),e.Ab.Kx(i,t,o)),t.B()||r!=null&&(t=r.al(t,!1),this.yp(r,e.dm.reverse,t),t=r.bl(t,!1)),t},f.prototype.$V=function(r,n){var t=(r.da()+r.S())/400;return t!=0?(t=e.Zl.local().W(r,t,n),t=this.QI(t,n),n=r.Ja(),t.dn(n)):(n=new e.Ta(r.Kp()),t=this.SI(n),n=r.Ja(),t.B()?n.Pa():(r.copyTo(n),r=t.D(),n.L(r.x,r.y,r.x,r.y))),n},f.prototype.aW=function(r,n){r=e.ba.kg(r);var t=this.hf.ef,i=this.hf.$f,h=t.Tb(),s=i.Tb(),o=e.P.Hu(Math.min(r.I(),64));if(h==3){var a=t.Li;h=(t=a.hk()).Tb(),r=a.al(r,!0),this.yp(a,e.dm.forward,r),r=a.bl(r,!0)}if(h==2){if(this.no==e.ui.Clip?r=e.Zj.local().W(r,t.ol(),t,n):t.Xc()&&(h=new e.l,r.yc(h),t.Le().contains(h)||(this.no==e.ui.PannableFold&&(r=e.Ab.nj(r,t)),e.Ab.Lt(r,t.Le(),t.Yd(0),!0),r=e.Ab.Hn(r,t,0,!0,0,n))),r.B())return r;e.Ab.wr(t,0,r,o)}else e.Ab.Lt(r,t.Le(),t.Yd(0),!0);return e.Ab.vr(this.hf,r,!1,o),t=0,h=!1,a=null,s==3&&(h=!0,s=(i=(a=i.Li).hk()).Tb()),(s=s==2)?t=i.Bi():isNaN(this.Dm)||(t=this.Dm),s&&this.Sm!=e.ui.Clip||(r=e.Ab.Hn(r,i.tc(),t,!1,0,n)),s&&(r=e.Ab.Hz(r,i,this.Sm,n),e.Ab.Kx(i,r,o),r.B())||h&&(r=a.al(r,!0),this.yp(a,e.dm.reverse,r),r=a.bl(r,!0)),r},f.prototype.yp=function(r,n,t){var i=t.I();if(i!=0){for(var h=t.vb(0),s=e.P.mg(200,0),o=[],a=0;ah.v+s&&an?this.yv(t,i):this.jv(t,i);case 1:var h=this.yv(t,i);return t=this.jv(t,i),e.mc.jq(h,t,n);case 2:throw e.i.ga("not implemented")}throw e.i.Ra()},r.prototype.ge=function(n,t){var i=this.qa-this.ta,h=this.ma-this.oa,s=i*i+h*h;return s==0?.5:(n=((n.x-this.ta)*i+(n.y-this.oa)*h)/s,t||(0>n?n=0:1(t=(t-this.oa)/n)||1(t=(t-this.ta)/n)||1(t=8881784197001252e-31*(Math.abs(i.x*t.y)+Math.abs(i.y*t.x)))?-1:n<-t?1:0},r.prototype.tp=function(n,t,i,h){var s=this.ta,o=this.oa,a=n-s,u=t-o;if((a=Math.sqrt(a*a+u*u))<=Math.max(i,6661338147750939e-31*a))return h&&a==0?NaN:0;if(a=n-this.qa,u=t-this.ma,(a=Math.sqrt(a*a+u*u))<=Math.max(i,6661338147750939e-31*a))return h&&a==0?NaN:1;if(a=this.qa-this.ta,u=this.ma-this.oa,0<(h=Math.sqrt(a*a+u*u))){var c=1/h,l=n-s,p=t-o,v=l*(a*=c)+p*(u*=c),b=17763568394002505e-31*(Math.abs(l*a)+Math.abs(p*u)),d=a;if(a=-u,u=d,v<-(b=Math.max(i,b))||v>h+b)return NaN;if(Math.abs(l*a+p*u)<=Math.max(i,17763568394002505e-31*(Math.abs(l*a)+Math.abs(p*u)))&&(.5>=(a=e.P.Tk(v*c,0,1))?(u=this.ta+(this.qa-this.ta)*a,h=this.oa+(this.ma-this.oa)*a):(u=this.qa-(this.qa-this.ta)*(1-a),h=this.ma-(this.ma-this.oa)*(1-a)),e.h.Jy(u,h,n,t)<=i)){if(.5>a){if(e.h.Jy(u,h,s,o)<=i)return 0}else if(e.h.Jy(u,h,this.qa,this.ma)<=i)return 1;return a}}return NaN},r.prototype.Nb=function(n){return n!=null&&(n==this||n.constructor===this.constructor&&this.AM(n))},r.prototype.mD=function(n,t,i){var h=i?this.ta:this.qa;i=i?this.oa:this.ma;var s=new e.h;return s.x=n.qa-h,s.y=n.ma-i,!(t.Sh(s)>6661338147750939e-31*t.aD(s))||(s.x=n.ta-h,s.y=n.oa-i,t.Sh(s)<=6661338147750939e-31*t.aD(s))},r.prototype.lD=function(n){var t=new e.h;return t.x=this.qa-this.ta,t.y=this.ma-this.oa,!!this.mD(n,t,!1)&&(t.Uq(),!!this.mD(n,t,!0))},r.IM=function(n,t){var i=n.wu(t.ta,t.oa),h=n.wu(t.qa,t.ma);return!(0>i&&0>h||0i&&0>h||0(h=t.Rb())?n.lD(t):t.lD(n)))},r.GM=function(n,t,i){var h=e.h.construct(NaN,NaN),s=n.qa-n.ta,o=n.ma-n.oa,a=t.qa-t.ta,u=t.ma-t.oa,c=a*o-s*u;if(c==0)return h;var l=8881784197001252e-31*(Math.abs(a*o)+Math.abs(s*u)),p=t.ta-n.ta,v=t.oa-n.oa,b=a*v-p*u,d=b/c,g=Math.abs(c);return d<-(a=(8881784197001252e-31*(Math.abs(a*v)+Math.abs(p*u))*g+l*Math.abs(b))/(c*c)+2220446049250313e-31*Math.abs(d))||d>1+a||(a=(u=s*v-p*o)/c)<-(s=(8881784197001252e-31*(Math.abs(s*v)+Math.abs(p*o))*g+l*Math.abs(u))/(c*c)+2220446049250313e-31*Math.abs(a))||a>1+s||(d=e.P.Tk(d,0,1),s=e.P.Tk(a,0,1),o=n.ic(d),c=t.ic(s),(l=new e.h).vc(o,c),l.length()>i&&(l.add(o,c),l.scale(.5),d=n.ge(l,!1),s=t.ge(l,!1),n=n.ic(d),t=t.ic(s),n.sub(t),n.length()>i)||h.na(d,s)),h},r.JM=function(n,t,i,h){var s=0;if((n.ta==t.ta&&n.oa==t.oa||n.ta==t.qa&&n.oa==t.ma)&&(s++,!h))return 1;if(n.qa==t.ta&&n.ma==t.oa||n.qa==t.qa&&n.ma==t.ma){if(++s==2)return 2;if(!h)return 1}return t.xi(n.ta,n.oa,i)||t.xi(n.qa,n.ma,i)||n.xi(t.ta,t.oa,i)||n.xi(t.qa,t.ma,i)?1:h&&s!=0||r.IM(n,t)==0?0:1},r.Yx=function(n,t,i,h,s,o){var a=0,u=n.tp(t.ta,t.oa,o,!1),c=n.tp(t.qa,t.ma,o,!1),l=t.tp(n.ta,n.oa,o,!1),p=t.tp(n.qa,n.ma,o,!1);return isNaN(u)||(h!=null&&(h[a]=u),s!=null&&(s[a]=0),i!=null&&(i[a]=e.h.construct(t.ta,t.oa)),a++),isNaN(c)||(h!=null&&(h[a]=c),s!=null&&(s[a]=1),i!=null&&(i[a]=e.h.construct(t.qa,t.ma)),a++),a==2||isNaN(l)||u==0&&l==0||c==0&&l==1||(h!=null&&(h[a]=0),s!=null&&(s[a]=l),i!=null&&(i[a]=e.h.construct(n.ta,n.oa)),a++),a==2||isNaN(p)||u==1&&p==0||c==1&&p==1||(h!=null&&(h[a]=1),s!=null&&(s[a]=p),i!=null&&(i[a]=e.h.construct(t.qa,t.ma)),a++),0h[1]&&(n=h[0],h[0]=h[1],h[1]=n,s!=null&&(h=s[0],s[0]=s[1],s[1]=h),i!=null&&(s=e.h.construct(i[0].x,i[0].y),i[0]=i[1],i[1]=s)),a):(a=r.GM(n,t,o),isNaN(a.x)?0:(i!=null&&(i[0]=n.ic(a.x)),h!=null&&(h[0]=a.x),s!=null&&(s[0]=a.y),1))},r.prototype.$F=function(){return 0},r.prototype.qp=function(){},r.prototype.toString=function(){return"Line: ["+this.ta.toString()+", "+this.oa.toString()+", "+this.qa.toString()+", "+this.ma.toString()+"]"},r}(e.NC);e.zb=y}(k||(k={})),function(e){var y=function(){function f(){this.Lm=[],this.za=-1}return f.prototype.Ma=function(){return this.za},f.prototype.next=function(){if(this.Lm!=null&&this.Lm.length!=0){this.za++;var r=this.Lm[0];return this.Lm=1>=this.Lm.length?[]:this.Lm.slice(1),r}return this.Lm=null},f.prototype.VX=function(r){this.Lm.push(r)},f.prototype.re=function(){},f}();e.bL=y}(k||(k={})),function(e){var y;(y=e.NL||(e.NL={}))[y.enumFillRuleOddEven=0]="enumFillRuleOddEven",y[y.enumFillRuleWinding=1]="enumFillRuleWinding";var f=function(r){function n(t,i){var h=r.call(this)||this;if(h.yf=!1,h.Gq=null,h.uq=0,h.tq=0,h.Cj=null,h.Og=!1,h.nb=null,h.mb=null,h.Se=null,h.Nj=null,h.Td=null,h.vq=0,h.gb=0,h.zq=0,i===void 0)h.yf=t,h.Og=!1,h.vq=0,h.uq=0,h.tq=0,h.xa=0,h.description=e.fe.pg();else{if(i==null)throw e.i.O();h.yf=t,h.Og=!1,h.vq=0,h.uq=0,h.tq=0,h.xa=0,h.description=i}return h.Cj=null,h.gb=0,h}return J(n,r),n.prototype.vm=function(){return 0i)throw e.i.Ra();if(this.ec(t)){if(this.mb==null)throw e.i.Ra();var h=this.xa,s=this.Ca(t),o=this.Wc(t);this.fm(this.xa+1),this.oc();for(var a=0,u=this.description.Ba;at;i--)h=this.nb.read(i),this.nb.write(i,h+1);this.mb.FE(t,1)}},n.prototype.Cp=function(){if(this.vx(),t===void 0){this.Og=!1;var t=this.ea()-1}var i=this.mb.read(t);this.mb.write(t,1|i),this.Se!=null&&(t=this.Wc(t)-1,this.Se.write(t,1),this.Nj.write(t,-1))},n.prototype.ec=function(t){return(1&this.mb.read(t))!=0},n.prototype.Pn=function(t){if(this.ec(t))return!0;var i=this.Ca(t);return!(i>(t=this.Wc(t)-1))&&(i=this.Oa(i),t=this.Oa(t),i.rb(t))},n.prototype.Av=function(t){return(2&this.mb.read(t))!=0},n.prototype.pc=function(t,i){if(this.Ll(t.description),t.K()!=322)throw e.i.Ra();var h=new e.Ta;(i||this.B())&&(t.Vo(h),this.nf(h)),t.Ro(h),this.lineTo(h)},n.prototype.vp=function(t){var i=this.xa==0;this.rx(t.v,t.G),this.Aj(t.v,t.H),this.Aj(t.C,t.H),this.Aj(t.C,t.G),this.Cp(),this.Og=!1,i&&this.Nf(256,!1)},n.prototype.bd=function(t,i){if(!t.B()){for(var h=this.xa==0,s=new e.Ta(this.description),o=0;4>o;o++)t.If(i?4-o-1:o,s),o==0?this.nf(s):this.lineTo(s);this.Cp(),this.Og=!1,h&&!i&&this.Nf(256,!1)}},n.prototype.add=function(t,i){for(var h=0;hi&&(i=t.ea()-1),i>=t.ea()||0>h||0>s||s>t.tv(i))throw e.i.ga("index out of bounds");if(s!=0){var a=t.ec(i)&&h+s==t.tv(i);if(!a||s!=1){if(this.Og=!1,this.Ll(t.description),h=t.Ca(i)+h+1,o&&(s++,h--),a&&s--,a=this.xa,this.fm(this.xa+s),this.oc(),o){if(s==0)return;this.nb.add(this.xa),o=t.mb.read(i),o&=-5,this.yf&&(o|=1),this.mb.write(this.mb.size-1,o),this.mb.add(0)}else this.nb.write(this.mb.size-1,this.xa);o=0;for(var u=this.description.Ba;op||t.Aa[p]==null?this.Aa[o].Nn(l*a,e.sa.te(c),s*l,l*a):this.Aa[o].On(l*a,t.Aa[p],l*h,s*l,!0,l,l*a)}if(this.vm()||t.Av(i))throw e.i.Ra();this.Qc(1993)}}},n.prototype.jJ=function(){for(var t=0,i=this.ea();t=this.ea())throw e.i.O();var i=this.Ca(t),h=this.Ka(t);t=this.ec(t)?1:0;for(var s=0,o=this.description.Ba;st&&(t=i-1),t>=i)throw e.i.O();for(var h=this.Ca(t),s=this.Ka(t),o=0,a=this.description.Ba;o=i.ea())throw e.i.O();var o=this.ea();if(t>o)throw e.i.O();0>t&&(t=o),0>h&&(h=i.ea()-1),this.Og=!1,this.Ll(i.description),i.oc();var a=i.Ca(h),u=i.Ka(h),c=this.xa,l=i.ec(h)&&!s?1:0;this.fm(this.xa+u),this.oc();for(var p=t=t+1;s--)a=this.nb.read(s-1),this.nb.write(s,a+u);for(i.Av(h),this.mb.add(0),s=o-1;s>=t+1;s--)o=this.mb.read(s),o&=-5,this.mb.write(s+1,o);o=i.ER().read(h),o&=-5,this.yf&&(o|=1),this.mb.write(t,o)},n.prototype.Cz=function(t,i){var h=-1,s=this.ea();if(h>s)throw e.i.O();0>h&&(h=s),this.Og=!1;var o=this.xa;this.fm(this.xa+i),this.oc();var a=h=h+1;o--)a=this.nb.read(o-1),this.nb.write(o,a+i);for(this.mb.add(0),o=s-1;o>=h+1;o--)i=this.mb.read(o),i&=-5,this.mb.write(o+1,i);this.yf&&this.mb.write(h,1)},n.prototype.lG=function(t,i,h){var s=-1;if(0>t&&(t=this.ea()),t>this.ea()||s>this.Ka(t)||h>i.length)throw e.i.ga("index out of bounds");if(h!=0){t==this.ea()&&(this.nb.add(this.xa),this.yf?this.mb.add(1):this.mb.add(0)),0>s&&(s=this.Ka(t)),this.oc();var o=this.xa;this.fm(this.xa+h),this.oc();for(var a=0,u=this.description.Ba;at&&(t=this.ea()),t>=s||i>this.Ka(t))throw e.i.ga("index out of bounds");t==this.ea()&&(this.nb.add(this.xa),this.yf?this.mb.add(1):this.mb.add(0)),0>i&&(i=this.Ka(t));var o=this.xa;this.fm(this.xa+1),this.oc();var a=this.Ca(t);this.Aa[0].xj(2*(a+i),h,2*o),h=1;for(var u=this.description.Ba;ht&&(t=h-1),t>=h||i>=this.Ka(t))throw e.i.ga("index out of bounds");this.oc();var s=this.Ca(t);0>i&&(i=this.Ka(t)-1),i=s+i,s=0;for(var o=this.description.Ba;s=t+1;h--)i=this.nb.read(h),this.nb.write(h,i-1);this.xa--,this.Rg--,this.Qc(1993)},n.prototype.pE=function(t,i,h,s){if(t=this.Ca(t)+i,(h=this.Ca(h)+s)t||h>this.I()-1)throw e.i.O();i=0,(s=this.Ha()).Wb(t);do{for(;s.Ia()&&(t=s.ia(),s.xb()!=h);)i+=t=t.Rb();if(s.xb()==h)break}while(s.ab());return i},n.prototype.aO=function(t,i,h){if(i=this.Ca(t)+i,h=this.Ca(t)+h,0>i||h>this.I()-1)throw e.i.O();var s=this.Ha();if(i>h){if(!this.ec(t))throw e.i.O("cannot iterate across an open path");s.EB()}var o=t=0;s.Wb(i);do o+=t,t=s.ia().Rb();while(s.xb()!=h);return o},n.prototype.ng=function(){return e.si.im(this,null)},n.prototype.FS=function(t,i,h){for(var s=t;si){var a=this.vm(),u=0;i=this.xa}else a=this.Av(i),u=this.Ca(i),i=this.Wc(i);for(;u=this.Ca(i))return i;i--}else i++;if(0<=i&&i=this.Ca(i)&&th){for(i=0;ii;){var s=i+(h-i>>1);if(t=(i=this.Wc(s))))return this.gb=s;i=s+1}}return this.gb=i},n.prototype.sz=function(){var t=this.I();if(!this.yf){t-=this.ea();for(var i=0,h=this.ea();ih.MR()))return!0;this.Cb.tD(null)}return h=e.Mx.create(this,t,i),this.Cb.tD(h),!0},n.prototype.dc=function(){var t=r.prototype.dc.call(this);if(!this.Bc()){var i=this.ea();this.nb!=null&&this.nb.Cn(t,0,i+1),this.mb!=null&&this.mb.Cn(t,0,i)}return t},n.prototype.UF=function(t){return this.Se!=null?this.Se.read(t):1},n.prototype.cc=function(t,i,h){var s=this.nz(t);if(t==this.Wc(s)-1&&!this.ec(s))throw e.i.ga("index out of bounds");this.oc();var o=this.Se,a=1;if(o!=null&&(a=7&o.read(t)),a!==1)throw e.i.Ra();if(i.Qr(),i=i.get(),h?i.Pf(e.fe.pg()):i.Pf(this.description),s=t==this.Wc(s)-1&&this.ec(s)?this.Ca(s):t+1,o=new e.h,this.D(t,o),i.Ec(o),this.D(s,o),i.Rc(o),!h)for(h=1,o=this.description.Ba;h=this.ea())throw e.i.O();if(this.B())i.Pa();else{if(this.Av(t))throw e.i.ga("not implemented");var h=this.vb(0),s=new e.h,o=new e.l;o.Pa();var a=this.Ca(t);for(t=this.Wc(t);athis.I())&&(t=e.ua.iE(this),this.Cb.RM(t),!0)},n.prototype.cM=function(){if(this.Cb==null&&(this.Cb=new e.Wk),this.Cb.Bo==null){this.Cb.sD(null);var t=e.ua.TN(this);this.Cb.sD(t)}},n.prototype.$o=function(t){this.zq=t},n.prototype.Kn=function(){return this.zq},n.prototype.yD=function(t){if(this==t)throw e.i.ga("MultiPathImpl.add");for(var i=this.ea(),h=0;h=(i=this.Wc(i))||ti?n.I():i,0>t||t>n.I()||it?i:t,0>i||0>t)throw e.i.O();if(t!=0){i=t-0,t=this.xa,this.resize(this.xa+i);for(var h=0;hn||n>=this.I())throw e.i.ga("index out of bounds");this.oc();for(var t=0,i=this.description.Ba;tt||t>=this.xa||in?n:f},y.Vh=function(f,r){var n=5381;return((n=((n=((n=r!==void 0?(r<<5)+r+(255&f):(n<<5)+n+(255&f))<<5)+n+(f>>8&255))<<5)+n+(f>>16&255))<<5)+n+(f>>24&255)&2147483647},y.wj=function(){throw Error("Not Implemented")},y.XA=function(f){return y.WT(f)+12345&2147483647},y.SG=function(f){var r=32,n=f%y.Px|0,t=f/y.Px|0;return(r&=63)==0?f:(32>r?(f=n>>>r|t<<32-r,r=t>>r):(f=t>>r-32,r=0<=t?0:-1),r*y.Px+(f>>>0))},y.WT=function(f){var r=1103515245,n=65535&r;return((r-n)*(f|=0)|0)+(n*f|0)|0},y.truncate=function(f){return 0>f?-1*Math.floor(Math.abs(f)):Math.floor(f)},y.MAX_SAFE_INTEGER=Math.pow(2,53)-1,y.MIN_SAFE_INTEGER=-y.MAX_SAFE_INTEGER,y.QC=65536,y.Px=y.QC*y.QC,y}()}(k||(k={})),function(e){var y;(y=e.xL||(e.xL={}))[y.Project=0]="Project",y[y.Union=1]="Union",y[y.Difference=2]="Difference",y[y.Proximity2D=3]="Proximity2D",y[y.Relate=4]="Relate",y[y.Equals=5]="Equals",y[y.Disjoint=6]="Disjoint",y[y.Intersects=7]="Intersects",y[y.Within=8]="Within",y[y.Contains=9]="Contains",y[y.Crosses=10]="Crosses",y[y.Touches=11]="Touches",y[y.Overlaps=12]="Overlaps",y[y.Buffer=13]="Buffer",y[y.Distance=14]="Distance",y[y.Intersection=15]="Intersection",y[y.Clip=16]="Clip",y[y.Cut=17]="Cut",y[y.DensifyByLength=18]="DensifyByLength",y[y.DensifyByAngle=19]="DensifyByAngle",y[y.LabelPoint=20]="LabelPoint",y[y.GeodesicBuffer=21]="GeodesicBuffer",y[y.GeodeticDensifyByLength=22]="GeodeticDensifyByLength",y[y.ShapePreservingDensify=23]="ShapePreservingDensify",y[y.GeodeticLength=24]="GeodeticLength",y[y.GeodeticArea=25]="GeodeticArea",y[y.Simplify=26]="Simplify",y[y.SimplifyOGC=27]="SimplifyOGC",y[y.Offset=28]="Offset",y[y.Generalize=29]="Generalize",y[y.SymmetricDifference=30]="SymmetricDifference",y[y.ConvexHull=31]="ConvexHull",y[y.Boundary=32]="Boundary",y[y.SimpleRelation=33]="SimpleRelation";var f=function(){function r(){}return r.prototype.K=function(){return null},r.prototype.yn=function(){},r.prototype.Ku=function(){return!1},r}();e.Ge=f}(k||(k={})),function(e){var y=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.K=function(){return 13},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.W=function(n,t,i,h,s){return n instanceof e.ba?(s=new e.$c(n),this.W(s,t,[i],!1,h).next()):h===!0?(i=new e.wC(n,t,i,!1,s),e.Ih.local().W(i,t,s)):new e.wC(n,t,i,!1,s)},r.instance=null,r}(e.Ge);e.vC=y}(k||(k={})),function(e){var y=function(){function f(r,n,t,i,h){this.za=-1,this.Sd=r,this.Vz=n,this.Es=t,this.nT=new e.l,this.nT.Pa(),this.ho=-1,this.Vb=h}return f.prototype.next=function(){for(var r;(r=this.Sd.next())!=null;)return this.za=this.Sd.Ma(),this.ho+1=r.I():r.ea()==1&&(2>=r.I()||e.au.EG(r,0)))},f}();e.yC=y}(k||(k={})),function(e){var y=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.K=function(){return 17},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.W=function(n,t,i,h,s){return new e.iL(n,t,i,h,s)},r.instance=null,r}(e.Ge);e.hL=y}(k||(k={})),function(e){var y=function(){function f(r,n,t,i,h){if(this.Vf=null,n==null||t==null)throw e.i.ga("invalid argument");this.kT=r,this.iA=n,this.gH=t,r=e.ua.ov(n,t),this.ra=e.ua.Xd(i,r,!0),this.fH=-1,this.od=h}return f.prototype.Ma=function(){return 0},f.prototype.next=function(){return this.MQ(),++this.fHthis.Vf.length&&(this.Vf.length=0)},f.prototype.NQ=function(){var r=new e.ja(0),n=new e.hd,t=n.WE(),i=n.Ib(this.iA),h=n.Ib(this.gH),s=new e.Hg;try{s.Gt(n,this.ra,this.od),s.fl(t,i,h,r);var o=n.Ke(i),a=new e.Ea,u=new e.Ea;for(this.Vf.length=0,this.Vf.push(a),this.Vf.push(u),i=0;i=t)throw e.i.O();return new e.jL(n,t,i)},r.instance=null,r}(e.Ge);e.Zl=y}(k||(k={})),function(e){var y=function(){function f(r,n){this.za=-1,this.Sd=r,this.Rs=n}return f.prototype.Ma=function(){return this.za},f.prototype.next=function(){var r;return(r=this.Sd.next())!=null?(this.za=this.Sd.Ma(),this.IP(r)):null},f.prototype.IP=function(r){if(r.B()||1>r.Eb())return r;var n=r.K();if(n==1736||n==1607)return this.Iy(r);if(e.ba.zd(n))return this.KP(r);if(n==197)return this.JP(r);throw e.i.Ra()},f.prototype.KP=function(r){if(r.Rb()<=this.Rs)return r;var n=new e.Ua(r.description);return n.pc(r,!0),this.Iy(n)},f.prototype.JP=function(r){var n=new e.Ea(r.description);n.bd(r,!1);var t=new e.l;return r.A(t),r=t.da(),t.S()<=this.Rs&&r<=this.Rs?n:this.Iy(n)},f.prototype.Iy=function(r){for(var n=r.Ja(),t=r.Ha();t.ab();)for(var i=!0;t.Ia();){var h=t.ia();if(h.K()!=322)throw e.i.ga("not implemented");var s=t.Qn(),o=h.Rb();if(o>this.Rs){var a=Math.ceil(o/this.Rs);o=new e.Ta(r.description),i&&(h.Vo(o),n.nf(o));var u=i=1/a,c=0;for(--a;co)return n;var a=n.K(),u=t.K(),c=new e.l,l=new e.l,p=new e.l;n.A(c),t.A(l),p.L(c),p.$b(l);var v=(p=e.ua.Xd(i,p,!0))*Math.sqrt(2)*1.00001,b=new e.l;if(b.L(c),b.X(v,v),!b.isIntersecting(l))return n;if(s==1&&o==2)return r.FV(n,t,u,i,h);if(a==33)switch(e.Xk.zd(u)?(i=new e.Ua(t.description),i.pc(t,!0)):i=t,u){case 1736:return r.SU(n,i,p);case 1607:return r.TU(n,i,p);case 550:return r.QU(n,i,p);case 197:return r.PU(n,i,p);case 33:return r.RU(n,i,p);default:throw e.i.O()}else if(a==550)switch(u){case 1736:return r.iU(n,t,p);case 197:return r.gU(n,t,p);case 33:return r.hU(n,t,p)}return e.Hg.km(n,t,i,h)},r.SU=function(n,t,i){return e.jd.FG(t,n,i)==0?n:n.Ja()},r.TU=function(n,t,i){var h=n.D();t=t.Ha();for(var s=i*Math.sqrt(2)*1.00001,o=s*s,a=new e.l;t.ab();)for(;t.Ia();){var u=t.ia();if(u.A(a),a.X(s,s),a.contains(h)){if(u.ss(h,i))return n.Ja();var c=u.bc();if(e.h.zc(h,c)<=o||(c=u.xc(),e.h.zc(h,c)<=o))return n.Ja()}}return n},r.QU=function(n,t,i){var h=t.vb(0);t=t.I();var s=n.D(),o=new e.h;i=i*Math.sqrt(2)*1.00001,i*=i;for(var a=0;at.I()?this.bE(n,t,i):(this.Pt(),n=this.bE(t,n,i),this.Pt(),n):n.K()==550&&e.ba.Ic(t.K())?(n=this.cE(t,n,i),this.Pt(),n):t.K()==550&&e.ba.Ic(n.K())?this.cE(n,t,i):n.K()==550&&t.K()==550?n.I()>t.I()?this.dE(n,t):(this.Pt(),n=this.dE(t,n),this.Pt(),n):0},r.prototype.bE=function(n,t,i){var h=n.Ha(),s=t.Ha(),o=new e.l,a=new e.l,u=17976931348623157e292;if(!i&&this.lY(n,t,h,s))return 0;for(;h.ab();)for(;h.Ia();)if((n=h.ia()).A(o),!(o.px(this.qh)>u)){for(;s.ab();)for(;s.Ia();)if((t=s.ia()).A(a),o.px(a)o)){for(var l=0;lh)){for(var l=0;lr.Ka(n))){var h=r.Ca(n),s=r.Wc(n)-1,o=r.vb(0),a=r.ec(n),u=new e.ja(0);u.Jb(r.Ka(n)+1);var c=new e.ja(0);for(c.Jb(r.Ka(n)+1),u.add(a?h:s),u.add(h),h=new e.h;1this.yH&&a>s&&(h=i,s=a)}return h},f.prototype.re=function(){},f}();e.mL=y}(k||(k={})),function(e){var y=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.K=function(){return 29},r.prototype.W=function(n,t,i,h){return n instanceof e.ba?(n=new e.$c(n),this.W(n,t,i,h).next()):new e.mL(n,t,i,h)},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.instance=null,r}(e.Ge);e.zC=y}(k||(k={})),function(e){var y=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.K=function(){return 21},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.W=function(n,t,i,h,s,o,a,u){return n instanceof e.ba?(u=new e.$c(n),this.W(u,t,i,[h],s,o,!1,a).next()):a===!0?(i=new e.BC(n,t,i,h,s,!1,!1,u),e.Ih.local().W(i,t,u)):new e.BC(n,t,i,h,s,!1,!1,u)},r.instance=null,r}(e.Ge);e.AC=y}(k||(k={})),function(e){var y=function(){function f(r,n,t,i,h,s,o,a){if(s)throw e.i.Fe();if(n==null)throw e.i.O();this.za=-1,this.Os=r,this.wg=n,this.Ae=t,this.Es=i,this.bo=h,this.ho=-1,this.Vb=a,this.oT=new e.l,this.oT.Pa()}return f.prototype.next=function(){for(var r;(r=this.Os.next())!=null;)return this.za=this.Os.Ma(),this.ho+1n.Eb())return 0;if(i==4)throw e.i.Fe();var h=e.cb.tc(t),s=e.cb.xv(h),o=e.cb.gv(h);s*=2-s;var a=h.Id().ci,u=n.K();if(u==1736||u==197)var c=n.ng();else e.ba.zd(u)?(c=new e.Ua(n.description)).pc(n,!0):c=n;if(h.Nb(t)==0){if(e.cb.Xc(t)){c=e.Jh.nj(c,t),u==1607&&c==n&&(c=e.ba.kg(n)),n=new e.Oc,e.cb.ih(t).en(n),u=0;for(var l=c.I();u=this.Hi||7h||t==0&&n==550&&this.Fj==33?this.iJ():f.CB(r,i);if((this.Hi==-1||this.Hi==4)&&n==197&&this.Fj==197)return t=this.Pe,n=new e.l,r.A(n),i=new e.l,t.A(i),n.Fa(i),t=new e.Hh,r.copyTo(t),t.Zo(n),t;if(n==197&&e.ba.uf(this.Fj)==0||this.Fj==197&&e.ba.uf(n)==0)return i=n==197?r:this.Pe,r=n==197?this.Pe:r,n=new e.l,i.A(n),e.Vd.clip(r,n,t,0);if(e.ba.uf(n)==0&&0a&&(a=t.sz()),s=t.I()+i.I(),a*i.I()>Math.log(s)*s*4)return null;s=null,a=i.Ha(),u!=null&&u.Gb!=null&&(s=u.Gb),s==null&&20w){if(s!=null)for(i==null?i=s.qR(j,h):i.Wo(j,h),w=i.next();w!=-1;w=i.next()){a.Wb(s.ka(w)),w=a.ia();var M=j.Fa(w,null,c,null,h);for(w=0;wm?(v=u.xb()-t.Ca(x),b=1,m=m==0?3:2):b++:(r.pc(A,m==0),m=1);break;case 0:m=0,v=-1,b=0;break;default:return null}A=N}}}else{if(0>(w=this.LD(n,j.bc(),h)))return null;w==1?(2>m&&(v=u.xb()-t.Ca(x),m=m==0?3:2),b++):(v=-1,b=0)}l.clear(!1)}else w!=0&&w==1&&(m==0?(m=3,v=u.xb()-t.Ca(x)):m==1?(m=2,v=u.xb()-t.Ca(x)):b++)}2<=m&&(r.Fr(t,x,v,b,m==3),v=-1)}return r},f.prototype.LD=function(r,n,t){return e.Fg.ym(r,n,t)},f.prototype.MD=function(r,n,t){var i=n.bc();n=n.xc();var h=e.Fg.ym(r,i,t),s=e.Fg.ym(r,n,t);return h==1&&s==0||h==0&&s==1?-1:h==0||s==0?0:h==1||s==1?1:((h=new e.h).add(i,n),h.scale(.5),(r=e.Fg.ym(r,h,t))==0?0:r==1?1:-1)},f.CB=function(r,n){return n?r:r.Ja()},f.prototype.iJ=function(){return this.tH==null&&(this.tH=this.Pe.Ja()),this.tH},f.prototype.re=function(){},f}();e.CC=y}(k||(k={})),function(e){var y=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.K=function(){return 28},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.W=function(n,t,i,h,s,o,a){return n instanceof e.ba?(n=new e.$c(n),this.W(n,t,i,h,s,o,a).next()):new e.sL(n,t,i,h,s,o,a)},r.instance=null,r}(e.Ge);e.DC=y}(k||(k={})),function(e){var y=function(){function f(r,n,t,i,h,s,o){this.za=-1,this.Sd=r,this.Oj=n,this.La=t,this.Mi=i,this.xA=h,this.pH=s,this.od=o}return f.prototype.next=function(){var r=this.Sd.next();return r!=null?(this.za=this.Sd.Ma(),this.eL(r)):null},f.prototype.Ma=function(){return this.za},f.prototype.eL=function(r){var n=0>=this.pH?e.ua.mj(this.Oj,r,!1):this.pH;return e.DK.W(r,this.La,this.Mi,this.xA,n,this.od)},f.prototype.re=function(){},f}();e.sL=y}(k||(k={})),function(e){var y;(y=e.IK||(e.IK={}))[y.clipToDomainOnly=1]="clipToDomainOnly",y[y.clipWithHorizon=2]="clipWithHorizon",y[y.foldAndClipWithHorizon=3]="foldAndClipWithHorizon";var f=function(r){function n(){return r!==null&&r.apply(this,arguments)||this}return J(n,r),n.prototype.K=function(){return 0},n.local=function(){return n.instance===null&&(n.instance=new n),n.instance},n.prototype.W=function(t,i,h){return t instanceof e.ba?(t=new e.$c(t),this.W(t,i,h).next()):new e.tL(t,i,h)},n.prototype.transform=function(t,i,h,s){return e.du.transform(t,i,h,s,!0)},n.prototype.St=function(t,i,h,s){return e.du.St(t,i,h,s)},n.instance=null,n}(e.Ge);e.Gx=f}(k||(k={})),function(e){var y=function(){function f(r,n,t){this.za=-1,this.Sd=r,this.HT=n,this.od=t}return f.prototype.next=function(){var r=this.Sd.next();return r!=null?(this.za=this.Sd.Ma(),e.du.Bh(r,this.HT,this.od)):null},f.prototype.Ma=function(){return this.za},f.prototype.re=function(){},f}();e.tL=y}(k||(k={})),function(e){var y=function(){function r(){}return r.prototype.reset=function(){this.rh=this.zk=-1,this.ws=this.mq=!1},r.prototype.vQ=function(n,t,i){for(n.Wb(t,i);n.Ia();){var h=n.ia();if((h=h.Rb())!=0)return n.xb()}for(n.Wb(t,i);n.zz();)if((h=(h=n.ni()).Rb())!=0)return n.xb();return-1},r.prototype.wQ=function(n,t){for(n.Wb(t,-1);n.zz();)if(n.ni().Rb()!=0)return n.xb();return-1},r.prototype.uQ=function(n,t){for(n.Wb(t,-1),n.ia();n.Ia();)if(n.ia().Rb()!=0)return n.xb();return-1},r.prototype.tQ=function(n,t,i,h){if(this.zk=this.vQ(t,i,h),this.zk!=-1){t.Wb(this.zk,-1);var s=t.ia(),o=s.ic(s.ge(n,!1));if(i=e.h.zc(o,n),(h=new e.h).N(o),h.sub(s.bc()),(o=new e.h).N(n),o.sub(s.bc()),this.mq=0>h.yi(o),this.rh=this.uQ(t,this.zk),this.rh!=-1){t.Wb(this.rh,-1);var a=(s=t.ia()).ge(n,!1);a=s.ic(a);var u=e.h.zc(a,n);u>i?this.rh=-1:(h.N(a),h.sub(s.bc()),o.N(n),o.sub(s.bc()),this.ws=0>h.yi(o))}this.rh==-1&&(this.rh=this.wQ(t,this.zk),this.rh!=-1&&(t.Wb(this.rh,-1),a=(s=t.ia()).ge(n,!1),a=s.ic(a),(u=e.h.zc(a,n))>i?this.rh=-1:(h.N(a),h.sub(s.bc()),o.N(n),o.sub(s.bc()),this.ws=0>h.yi(o),n=this.zk,this.zk=this.rh,this.rh=n,n=this.mq,this.mq=this.ws,this.ws=n)))}},r.prototype.YN=function(n,t,i,h,s){return i=i.Ha(),this.tQ(n,i,h,s),this.zk!=-1&&this.rh==-1?this.mq:this.zk!=-1&&this.rh!=-1?this.mq==this.ws?this.mq:(i.Wb(this.zk,-1),n=i.ia().lg(),i.Wb(this.rh,-1),t=i.ia().lg(),0<=n.yi(t)):t},r}(),f=function(r){function n(){return r!==null&&r.apply(this,arguments)||this}return J(n,r),n.local=function(){return n.instance===null&&(n.instance=new n),n.instance},n.prototype.K=function(){return 3},n.prototype.iz=function(t,i,h){var s;if(s===void 0&&(s=!1),t.B())return new e.bm;i=i.D();var o=t,a=t.K();switch(a==197&&((o=new e.Ea).bd(t,!1),a=1736),a){case 33:return this.sI(o,i);case 550:return this.eI(o,i);case 1607:case 1736:return this.XT(o,i,h,s);default:throw e.i.ga("not implemented")}},n.prototype.jz=function(t,i){if(t.B())return new e.bm;i=i.D();var h=t,s=t.K();switch(s==197&&((h=new e.Ea).bd(t,!1),s=1736),s){case 33:return this.sI(h,i);case 550:case 1607:case 1736:return this.eI(h,i);default:throw e.i.ga("not implemented")}},n.prototype.kz=function(t,i,h,s){if(0>s)throw e.i.O();if(t.B())return[];i=i.D();var o=t,a=t.K();switch(a==197&&((o=new e.Ea).bd(t,!1),a=1736),a){case 33:return this.OU(o,i,h,s);case 550:case 1607:case 1736:return this.oU(o,i,h,s);default:throw e.i.ga("not implemented")}},n.prototype.XT=function(t,i,h,s){if(t.K()==1736&&h&&(h=new e.l,t.A(h),h=e.ua.Xd(null,h,!1),(s?e.jd.Zd(t,i,0):e.jd.Zd(t,i,h))!=0)){var o=new e.bm(i,0,0);return s&&o.RJ(!0),o}var a=t.Ha();o=new e.h;for(var u=h=-1,c=17976931348623157e292,l=0;a.ab();)for(;a.Ia();){var p=a.ia();p=p.ic(p.ge(i,!1));var v=e.h.zc(p,i);ve.h.Wq(i,p.bc(),p.xc()),1=i||(t.length=s),t.slice(0)},n.instance=null,n}(e.Ge);e.Hx=f}(k||(k={})),function(e){var y=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.K=function(){return 4},r.prototype.W=function(n,t,i,h,s){return e.cm.tB(n,t,i,h,s)},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.Ku=function(n){return e.Xt.ry(n)},r.prototype.yn=function(n,t,i){e.Xt.xD(n,t,i)},r.instance=null,r}(e.Ge);e.uL=y}(k||(k={})),function(e){var y=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.K=function(){return 33},r.prototype.W=function(n,t,i,h,s){return n===1073741824?!e.vd.uB(t,i,h,4,s):e.vd.uB(t,i,h,n,s)},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.Ku=function(n){return e.Xt.ry(n)},r.prototype.yn=function(n,t,i){e.Xt.xD(n,t,i)},r.instance=null,r}(e.Ge);e.fj=y}(k||(k={})),function(e){var y=function(){function f(r,n,t,i){if(this.od=i,this.lT=t,this.za=-1,r==null)throw e.i.O();this.Ak=r,this.Oj=n}return f.prototype.next=function(){var r;if((r=this.Ak.next())!=null){if(this.za=this.Ak.Ma(),this.od!=null&&!this.od.progress(-1,-1))throw e.i.hu("user_canceled");return this.$B(r)}return null},f.prototype.Ma=function(){return this.za},f.prototype.$B=function(r){if(r==null)throw e.i.O();return e.Ix.YJ(r,this.Oj,this.lT,this.od)},f.prototype.re=function(){},f}();e.vL=y}(k||(k={})),function(e){var y=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.K=function(){return 26},r.prototype.W=function(n,t,i,h){return n instanceof e.ba?(n=new e.$c(n),this.W(n,t,i,h).next()):new e.vL(n,t,i,h)},r.prototype.ts=function(n,t,i,h,s){return 0<(h!==void 0?e.Ix.ts(n,t,i,h,s):e.Ix.ts(n,t,!1,null,i))},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.instance=null,r}(e.Ge);e.$l=y}(k||(k={})),function(e){var y=function(){function s(){this.Aq=0}return s.prototype.iX=function(o){this.Aq&=-2,this.Aq|=o?1:0},s.prototype.Yp=function(){return(1&this.Aq)!=0},s.prototype.SF=function(){return this.Yp()?0:1},s}();e.tY=y;var f=function(){},r=function(s,o,a,u){this.x=s,this.y=o,this.Ci=a,this.zm=u},n=function(){function s(o){this.Ce=o}return s.prototype.compare=function(o,a,u){return o=o.ka(u),a=this.Ce.lf.read(2*a),0>(a-=o=this.Ce.lf.read(2*o))?-1:0p?1:0},s}(),i=function(){function s(o,a){this.TI=new e.h,this.parent=o,this.ZR=a}return s.prototype.qr=function(o,a,u){var c=this.parent,l=this.ZR;u.Wd(o,a,function(p,v){return c.Oh(p,v,l)})},s.prototype.bq=function(o){return o=this.parent.ii.get(o),this.parent.lf.uc(2*(o>>1),this.TI),this.TI.y+(1&o?this.parent.Qj:-this.parent.Qj)},s}(),h=function(){function s(o,a,u,c,l){this.iH=o.description,this.Y=o,this.Sg=a,this.Qj=e.ua.mj(this.Sg,o,!1),this.Do=e.ua.mj(this.Sg,o,!0),this.sA=u,this.jT=this.iH.Ba,this.hb=[],this.ro=[],this.oh=new e.lp,this.fb=new e.$j,this.le=new e.Nd,this.UG=this.sl=l}return s.prototype.$S=function(){return this.UG=!0,(!e.ba.Ic(this.Y.K())||this.BE()&&this.yE(!1))&&this.hO()?e.ba.Ic(this.Y.K())?this.kO()?this.Y.K()==1607?this.mO()?2:0:this.nO()?this.oO():0:0:2:0},s.prototype.fC=function(o,a){var u=this.lf.read(2*o);o=this.lf.read(2*o+1);var c=this.lf.read(2*a);a=this.lf.read(2*a+1);var l=!e.$t.Ev(u,o,c,a,this.Qj*this.Qj);return l||this.Y.Eb()!=0&&u==c&&o==a},s.prototype.BE=function(){for(var o=this.Y,a=o.yf?3:2,u=0,c=o.ea();uthis.Qj)){if(o&&c){var p=l.yv(1,0);if(l=l.yv(1,0),Math.abs(l-p)>a)continue}return this.le=new e.Nd(2,u.xb(),-1),!1}}return!0},s.prototype.hO=function(){var o=this.Y,a=null;e.ba.Ic(this.Y.K())&&(a=this.Y);var u=(this.UG||this.sl)&&a!=null,c=o.I();this.lf=o.vb(0),this.ii=new e.ja(0),this.ii.Jb(2*c),this.hi=new e.ja(0),this.hi.Jb(2*c),u&&(this.Hl==null&&(this.Hl=new e.ja(0)),this.Hl.Jb(c));for(var l=o=0;l=a.Wc(o);)o++;this.Hl.add(o)}for(new e.Zt().sort(this.hi,0,2*c,new i(this,u)),this.fb.clear(),this.fb.Xo(new n(this)),this.fb.Ee(c),a=0,c*=2;a>1,(1&o)==0){if(o=this.fb.addElement(u,-1),(l=this.fb.xe(o))!=-1&&!this.fC(this.fb.ka(l),u))return this.le=new e.Nd(3,u,this.fb.ka(l)),!1;var p=this.fb.lb(o);if(p!=-1&&!this.fC(this.fb.ka(p),u))return this.le=new e.Nd(3,u,this.fb.ka(p)),!1}else if(o=this.fb.search(u,-1),l=this.fb.xe(o),p=this.fb.lb(o),this.fb.wd(o,-1),l!=-1&&p!=-1&&!this.fC(this.fb.ka(l),this.fb.ka(p)))return this.le=new e.Nd(3,this.fb.ka(l),this.fb.ka(p)),!1;return!0},s.prototype.kO=function(){return 10>this.Y.I()?this.iO():this.jO()},s.prototype.jO=function(){var o=new e.hd;o.Ib(this.Y);var a=new e.Nd;return!e.bu.fI(!1,o,this.Qj,a,this.od)||(a.Lo=o.Va(a.Lo),a.Mo=o.Va(a.Mo),this.le.Yt(a),!1)},s.prototype.iO=function(){var o=this.Y,a=o.Ha();for(o=o.Ha();a.ab();)for(;a.Ia();){var u=a.ia();if(!a.Sn()||!a.VS()){o.wW(a);do for(;o.Ia();){var c=o.ia();if((c=u.Br(c,this.Qj,!0))!=0)return this.le=new e.Nd(c==2?5:4,a.xb(),o.xb()),!1}while(o.ab())}}return!0},s.prototype.nO=function(){var o=this.Y;this.hb.length=0,this.ro.length=0,this.ag=o.Ha(),this.ag.EB();var a=new e.ja(0);a.Jb(10);var u=NaN,c=0,l=0;for(o=2*o.I();l>=1;var v=this.lf.read(2*p),b=this.lf.read(2*p+1);if(a.size!=0&&(v!=u||b!=c)){if(!this.LI(a))return!1;a!=null&&a.clear(!1)}a.add(p),u=v,c=b}}return!!this.LI(a)},s.prototype.mO=function(){for(var o=this.Y,a=Array(o.ea()),u=0,c=o.ea();u>1;this.lf.uc(2*p,l);var v=a[u=this.Hl.get(p)],b=o.Ca(u),d=o.Wc(u)-1;c.gl=p==b||p==d,c.jy=this.sl?!v&&c.gl:c.gl,c.Ci=u,c.x=l.x,c.y=l.y,c.zm=p;for(var g=new f,x=1,m=this.hi.size;x>1,this.lf.uc(2*p,l),(u=this.Hl.get(p))!=c.Ci&&(v=a[u],b=o.Ca(u),d=o.Wc(u)-1);var w=p==b||p==d,j=this.sl?!v&&c.gl:c.gl;if(g.x=l.x,g.y=l.y,g.Ci=u,g.zm=p,g.jy=j,g.gl=w,g.x==c.x&&g.y==c.y){if(this.sl){if(!(g.jy&&c.jy||g.Ci==c.Ci&&(g.gl||c.gl)))return this.le=new e.Nd(8,g.zm,c.zm),!1}else if(!g.gl||!c.gl)return this.le=new e.Nd(5,g.zm,c.zm),!1}u=c,c=g,g=u}return!0},s.prototype.EE=function(){for(var o=this.Y,a=[],u=-1,c=!1,l=0,p=o.ea();l>1;this.lf.uc(2*v,c),l=this.Hl.get(v),u=new r(c.x,c.y,l,v,a[l]),o=[];var b=1;for(p=this.hi.size;b>1,this.lf.uc(2*v,c),l=this.Hl.get(v),(l=new r(c.x,c.y,l,v,a[l])).x==u.x&&l.y==u.y){if(l.Ci==u.Ci)return this.le=new e.Nd(9,l.zm,u.zm),!1;0<=a[l.Ci]&&a[l.Ci]==a[u.Ci]&&(o.length!=0&&o[o.length-1]==u||o.push(u),o.push(l))}u=l}if(o.length==0)return!0;for(l=new e.lp(!0),e.P.bv(a,-1),c=-1,(b=new e.h).Sc(),u=0,p=o.length;u=o.He())return this.le=new e.Nd(6,o.ea()==1?1:-1,-1),0;if(o.ea()==1)return this.sl&&!this.EE()?0:2;this.vo=e.ja.rf(o.ea(),0),this.EA=e.ja.rf(o.ea(),-1);for(var a=-1,u=0,c=0,l=o.ea();cp?0:256),0a||u>=1,(c=this.lf.read(2*u+1))!=this.Oo&&o.size!=0){if(!this.vt(o))return 0;o!=null&&o.clear(!1)}o.add(u),this.Oo=c}return 0l.ma){var v=this.ag.xb(),b=this.Uu(l,c,this.ag.gb,!0);0o.Ka(a.gb))){u.yW();for(var g,x,m=!0;a.Ia();){var w=a.ia(),j=u.ni();if(a.xb()>u.xb())break;m&&(b.add(a.xb()),d.add(u.kk()),m=!1),x=b.Gc();var M=a.kk();if(1this.Do?b.add(a.kk()):p&&(g=o.Vc(1,b.Gc(),0),w=w.jv(1,0),Math.abs(w-g)>v&&b.add(a.kk())),x>this.Do?d.add(u.xb()):p&&(g=o.Vc(1,d.Gc(),0),w=j.jv(1,0),Math.abs(w-g)>v&&d.add(u.xb()))}if(b.Gc()d.size?b.Jf():d.Jf():(b.Gc()!=d.Gc()&&d.Jf(),d.Jf()),2<=d.size+b.size){for(m=new e.Ta,j=0,w=b.size;j>1;var l=c>>1,p=new e.h,v=new e.h;return this.lf.uc(2*a,p),p.y+=1&o?this.Qj:-this.Qj,this.lf.uc(2*l,v),v.y+=1&c?this.Qj:-this.Qj,(o=p.compare(v))==0&&u?0>(u=this.Hl.get(a)-this.Hl.get(l))?-1:0l.x)return 1;if(c.yl.y)return 1;for(c=1;cd)return 1}}return 0},s.prototype.KO=function(o,a){var u=this.Qu(o,a);return u==0?oa?1:0o?n:t;if(n.B())return t;if(t.B())return n;var a=new e.l,u=new e.l,c=new e.l;return n.A(a),t.A(u),c.L(a),c.$b(u),a=e.ua.Xd(i,c,!0),u=n.K(),c=t.K(),u==33&&c==33?r.WU(n,t,a):u!=c?0o?n:t:u==550?r.dI(n,t,a):r.dI(t,n,a):e.Hg.gp(n,t,i,h)},r.WU=function(n,t,i){i=i*Math.sqrt(2)*1.00001,i*=i;var h=n.D(),s=t.D(),o=new e.ee(n.description);return e.h.zc(h,s)>i&&(o.add(n),o.add(t)),o},r.dI=function(n,t,i){var h=n.vb(0),s=n.I(),o=t.D(),a=n.Ja();i=i*Math.sqrt(2)*1.00001;var u=new e.l;if(n.A(u),u.X(i,i),u.contains(o)){i*=i,u=!1;for(var c=[],l=0;lthis.Bk||0>this.eo)throw e.i.Ra();if(this.vH[this.eo])break}return this.za++,this.aG(this.eo)}return this.za=0,this.eo=this.Bk,this.aG(this.Bk)},n.prototype.Ma=function(){return this.za},n.prototype.lK=function(){if(this.Jc)return!0;var t=null;if(this.Sd!=null&&(t=this.Sd.next())==null&&(this.Jc=!0,this.Sd=null),e.op.Bp(this.Vb),t!=null){var i=t.Eb();this.vH[i]=!0,i>=this.Bk&&!this.eA&&(this.HD(i,!1,t),i>this.Bk&&!this.eA&&this.uW(i))}if(0this.Fo.length)for(var o=0,a=Math.max(2,t+1);oi?e.F.Yq(l,c,u,p,0):e.F.Yq(l,u,c,p,0),b=[0,0,0],d=[0,0,0];var m=[0,0,0];u=[0,0,0],v=[0,0,0];var w=Math.acos(p[2]/1),j=1-r,M=Math.tan(w),A=1+M*M/j,z=2*l[2]*M/j;for(j=(-z+(M=Math.sqrt(z*z-4*A*(l[2]*l[2]/j-1))))/(A*=2),z=(-z-M)/A,M=Math.tan(w),w=(j+z)/2,l=((A=M*j+l[2])+(M*z+l[2]))/2,M=e.F.ip(j-w,A-l),j=l/x*1.570796326794897,z=0;100>z&&(A=(A=e.F.w(r,j))*A/Math.cos(j)*(Math.sin(j)-l*A/(1-r)),!e.s.Dd(A));z++)j-=A;l=e.F.n(1,r,j)*Math.cos(j),M=1-M/(l=Math.sqrt((l-w)*(l+w))),M*=2-M,A=e.F.qn(b),w=e.F.qn(d),j=e.F.qn(m);var N=e.F.Ut(m,b);z=e.F.Ut(m,d),e.F.yx(m,b,u),e.F.yx(m,d,v),b=Math.acos(N/(j*A)),d=Math.acos(z/(j*w)),d*=e.s.Mb(1,e.F.Ut(u,v)),(1.570796326794897<=e.s.R(b)&&1.570796326794897<=e.s.R(d)||3.141592653589793v&&0>i)&&(i=e.F.ca(i+3.141592653589793)),s!=null&&(s.u=u),o!=null&&(o.u=v),a!=null&&(a.u=i)}}},y.sf=function(f,r,n,t,i,h,s,o){var a=[0,0,0],u=[0,0,0],c=[0,0,0],l=[0,0,0],p=[0,0,0],v=[0,0,0],b=[0,0,0],d=[0,0,0,0],g=new e.ha(0),x=new e.ha(0),m=new e.ha(0),w=new e.ha(0),j=new e.ha(0),M=new e.ha(0);if(s!=null&&o!=null)if(e.s.vi(r))e.$g.sf(f,n,t,i,h,s,o);else if(e.s.Dd(i))s!=null&&(s.u=n),o!=null&&(o.u=t);else if(h=e.F.ca(h),0>i&&(i=e.s.R(i),h=e.F.ca(h+3.141592653589793)),n=e.F.ca(n),t=e.F.ca(t),1.570796326794897h?e.F.Yq(b,p,a,d,0):e.F.Yq(b,a,p,d,0),a=Math.acos(d[2]/1),d=Math.atan2(-d[1],-d[0]),t=1-r,j=1+(p=Math.tan(a))*p/t,t=(-(w=2*b[2]*p/t)+(p=Math.sqrt(w*w-4*j*(b[2]*b[2]/t-1))))/(j*=2),w=(-w-p)/j,p=Math.tan(a),a=(t+w)/2,b=((j=p*t+b[2])+(p*w+b[2]))/2,p=e.F.ip(t-a,j-b),A=b/A*1.570796326794897,t=0;100>t&&(w=(w=e.F.w(r,A))*w/Math.cos(A)*(Math.sin(A)-b*w/(1-r)),!e.s.Dd(w));t++)A-=w;A=e.F.n(1,r,A)*Math.cos(A),b=1-p/(A=Math.sqrt((A-a)*(A+a))),b*=2-b,v=Math.acos(e.F.Ut(v,u)/(e.F.qn(v)*e.F.qn(u))),v*=e.s.Mb(1,u[0]),h=(e.F.q(A,b,e.F.Sj(b,v))+f*e.s.Mb(1,h))/e.F.Ch(A,b),h=e.F.ca(1.570796326794897*h),h=e.F.Tq(b,h),e.F.n(A,b,h),p=e.F.ca(d+n),n=Math.cos(p),h=Math.sin(p),c[0]=l[0]*n+l[1]*-h,c[1]=l[0]*h+l[1]*n,c[2]=l[2],e.F.eO(r,c[0],c[1],c[2],m,x,g),s!=null&&(s.u=x.u),o!=null&&(o.u=m.u)}},y}()}(k||(k={})),function(e){var y=function(){function i(h){this.Za=null,this.xt=new e.h,this.yt=new e.h,this.g=h}return i.prototype.compare=function(h,s,o){return this.g.Hc(s,this.xt),this.g.Hc(h.ka(o),this.yt),this.xt.compare(this.yt)},i}(),f=function(){function i(h){this.Cf=new e.h,this.Fk=new e.h,this.g=h}return i.prototype.Fh=function(h){this.Cf.N(h)},i.prototype.compare=function(h,s){return this.g.Hc(h.ka(s),this.Fk),this.Cf.compare(this.Fk)},i}(),r=function(i){function h(s){var o=i.call(this,s.g,s.ra,!1)||this;return o.ib=s,o}return J(h,i),h.prototype.compare=function(s,o,a){if(this.sg)return-1;var u=this.ib.Rd.Ln(this.ib.Th(o));s=s.ka(a);var c=this.ib.Rd.Ln(this.ib.Th(s));return this.Fm=a,this.ME(o,u,s,c)},h}(e.PC),n=function(i){function h(s){var o=i.call(this,s.g,s.ra)||this;return o.ib=s,o}return J(h,i),h.prototype.compare=function(s,o){return this.sg?-1:(s=this.ib.Rd.Ln(this.ib.Th(s.ka(o))),this.Fm=o,this.NE(o,s))},h}(e.WL),t=function(){function i(){this.Nc=this.df=this.lo=this.Rd=this.nh=this.Ad=this.hb=this.g=null,this.Pg=!1,this.xh=this.Pm=this.je=this.Ik=this.ph=this.Ck=this.Gf=this.ae=null,this.zh=this.Lq=this.PA=this.ra=0,this.Zv=this.Yn=!1,this.Ao=new e.h,this.Ri=new e.h,this.hb=new e.ad(8),this.Ad=new e.ad(5),this.nh=new e.cu,this.Rd=new e.cu,this.Pg=!1,this.xh=new e.h,this.xh.na(0,0),this.ra=0,this.zh=-1,this.Yn=!1,this.g=null,this.df=new e.$j,this.Nc=new e.$j,this.ph=new e.ja(0),this.Ik=new e.OC,this.Gf=new e.ja(0),this.Ck=new e.ja(0),this.lo=new e.Ta}return i.prototype.LX=function(h,s){var o=new e.Ed;return o.VB(),h.Pc(o),this.gr(h),this.Yn=!1,this.ra=s,this.PA=s*s,s=this.eC(),h.Pc(o),s||(this.lQ(),s||this.eC()),this.zh!=-1&&(this.g.Ud(this.zh),this.zh=-1),this.g=null,this.Yn},i.prototype.PX=function(h,s){this.gr(h),this.Yn=!1,this.ra=s,this.PA=s*s,this.Pg=!1,this.eC(),this.Pg||(this.Pg=h.Ip(s,!0,!1)==1),this.zh!=-1&&(this.g.Ud(this.zh),this.zh=-1),this.g=null},i.prototype.qg=function(h,s){return this.hb.U(h,0+s)},i.prototype.GB=function(h,s,o){this.hb.T(h,0+s,o)},i.prototype.Th=function(h){return this.hb.U(h,2)},i.prototype.UW=function(h,s){this.hb.T(h,2,s)},i.prototype.MF=function(h,s){return this.hb.U(h,3+s)},i.prototype.Rp=function(h){return this.hb.U(h,7)},i.prototype.Rl=function(h,s){this.hb.T(h,7,s)},i.prototype.Tp=function(h,s){return this.hb.U(h,3+this.Qp(h,s))},i.prototype.hr=function(h,s,o){this.hb.T(h,3+this.Qp(h,s),o)},i.prototype.IR=function(h,s){return this.hb.U(h,5+this.Qp(h,s))},i.prototype.jr=function(h,s,o){this.hb.T(h,5+this.Qp(h,s),o)},i.prototype.Ur=function(h){return this.Ad.U(h,0)},i.prototype.PW=function(h,s){this.Ad.T(h,0,s)},i.prototype.$y=function(h){return this.Ad.U(h,4)},i.prototype.er=function(h,s){this.Ad.T(h,4,s)},i.prototype.kl=function(h){return this.Ad.U(h,1)},i.prototype.nn=function(h,s){this.Ad.T(h,1,s)},i.prototype.Zy=function(h){return this.Ad.U(h,3)},i.prototype.Ft=function(h,s){this.Ad.T(h,3,s)},i.prototype.$m=function(h){var s=this.Ad.De(),o=this.nh.Rh();return this.PW(s,o),h!=-1?(this.nh.addElement(o,h),this.g.Sa(h,this.zh,s),this.er(s,this.g.Va(h))):this.er(s,-1),s},i.prototype.CP=function(h){this.Ad.kd(h)},i.prototype.FD=function(h,s){this.nh.addElement(this.Ur(h),s),this.g.Sa(s,this.zh,h)},i.prototype.ot=function(h){var s=this.hb.De(),o=this.Rd.Rh();return this.UW(s,o),h!=-1&&this.Rd.addElement(o,h),s},i.prototype.GD=function(h,s){this.Rd.addElement(this.Th(h),s)},i.prototype.Wu=function(h){this.hb.kd(h),0<=(h=this.ph.gF(h))&&this.ph.NV(h)},i.prototype.jj=function(h,s){if(this.qg(h,0)==-1)this.GB(h,0,s);else{if(this.qg(h,1)!=-1)throw e.i.Ra();this.GB(h,1,s)}this.gy(h,s)},i.prototype.gy=function(h,s){var o=this.kl(s);if(o!=-1){var a=this.Tp(o,s);this.jr(a,s,h),this.hr(h,s,a),this.hr(o,s,h),this.jr(h,s,o)}else this.jr(h,s,h),this.hr(h,s,h),this.nn(s,h)},i.prototype.Qp=function(h,s){return this.qg(h,0)==s?0:1},i.prototype.Zm=function(h,s){var o,a=this.Zy(s);if(a!=-1&&(this.df.wd(a,-1),this.Ft(s,-1)),(a=this.kl(s))!=-1){var u=o=a;do{var c=!1,l=this.Qp(o,s),p=this.MF(o,l);if(this.qg(o,l+1&1)==h){if(this.Zu(o),this.Rd.eh(this.Th(o)),this.Wu(o),o==p){a=-1;break}a==o&&(a=this.kl(s),u=p,c=!0)}o=p}while(o!=u||c);if(a!=-1){do l=this.Qp(o,s),p=this.MF(o,l),this.GB(o,l,h),o=p;while(o!=u);(o=this.kl(h))!=-1?(u=this.Tp(o,h),c=this.Tp(a,h),u==o?(this.nn(h,a),this.gy(o,h),this.nn(h,o)):c==a&&this.gy(a,h),this.hr(a,h,u),this.jr(u,h,a),this.hr(o,h,c),this.jr(c,h,o)):this.nn(h,a)}}for(a=this.Ur(h),o=this.Ur(s),u=this.nh.sc(o);u!=-1;u=this.nh.lb(u))this.g.Sa(this.nh.ka(u),this.zh,h);this.nh.Cy(a,o),this.CP(s)},i.prototype.PT=function(h,s){var o=this.qg(h,0),a=this.qg(h,1),u=this.qg(s,0),c=this.qg(s,1);this.Rd.Cy(this.Th(h),this.Th(s)),s==this.kl(o)&&this.nn(o,h),s==this.kl(a)&&this.nn(a,h),this.Zu(s),this.Wu(s),o==u&&a==c||a==u&&o==c||(this.Jn(o,this.Ao),this.Jn(u,this.Ri),this.Ao.rb(this.Ri)?(o!=u&&this.Zm(o,u),a!=c&&this.Zm(a,c)):(a!=u&&this.Zm(a,u),o!=c&&this.Zm(o,c)))},i.prototype.Zu=function(h){var s=this.qg(h,1);this.ZE(h,this.qg(h,0)),this.ZE(h,s)},i.prototype.ZE=function(h,s){var o=this.Tp(h,s),a=this.IR(h,s),u=this.kl(s);o!=h?(this.hr(a,s,o),this.jr(o,s,a),u==h&&this.nn(s,o)):this.nn(s,-1)},i.prototype.RD=function(h,s,o){var a=this.Rd.sc(h),u=this.Rd.ka(a);h=this.Ie(u);var c=this.Ie(this.g.V(u));for(this.g.lr(u,s,o,!0),a=this.Rd.lb(a);a!=-1;a=this.Rd.lb(a)){u=this.Rd.ka(a);var l=this.Ie(u)==h;this.g.lr(u,s,o,l)}a=s.Xp(o,0).bc(),s=s.Xp(o,s.ql(o)-1).xc(),this.wK(h,a),this.wK(c,s)},i.prototype.UE=function(h,s,o){var a=this.Th(h),u=this.qg(h,0),c=this.qg(h,1),l=this.ot(-1);for(this.ph.add(l),this.Rl(l,-3),this.Gf.add(l),this.jj(l,u),h=1,s=s.ql(o);hthis.$y(l)&&this.er(l,this.g.Va(c))),l=this.Gf.get(h),h-=2,this.GD(l,c),c=this.g.V(c);while(0<=h)}this.Gf.clear(!1)},i.prototype.Ie=function(h){return this.g.Qa(h,this.zh)},i.prototype.NI=function(h,s,o){var a=this.qg(s,0),u=new e.h;this.Jn(a,u);var c=new e.h,l=this.qg(s,1);this.Jn(l,c);var p=o.ql(h),v=o.Xp(h,0),b=new e.h;if(v.$p(b),!u.rb(b)){if(!this.Pg){var d=u.compare(this.xh);0>d*(b=b.compare(this.xh))&&(this.Pg=!0)}this.qF(a,this.Gf),this.Ck.add(a)}for(!this.Pg&&1v.compare(this.xh))&&(this.Pg=!0)),h=(v=o.Xp(h,p-1)).xc(),c.rb(h)||(this.Pg||0>(d=c.compare(this.xh))*(b=h.compare(this.xh))&&(this.Pg=!0),this.qF(l,this.Gf),this.Ck.add(l)),this.Gf.add(s),c=0,l=this.Gf.size;cMath.max(100,this.g.gd)){this.ph.clear(!1),this.Pg=!0;break}var h=this.ph.Gc();this.ph.Jf(),this.Rl(h,-1),this.RS(h)!=-1&&this.rS(h),this.Xn=!1}},i.prototype.rS=function(h){if(this.Xn){var s=this.Nc.Bu(this.HH,this.BH,h,!0);this.Xn=!1}else s=this.Nc.ED(h);s==-1?this.PT(this.Nc.ka(this.Nc.AF()),h):(this.Rl(h,s),this.ae.sg&&(this.ae.Mr(),this.jF(this.ae.Fm,s)))},i.prototype.RS=function(h){var s=this.qg(h,0);if(h=this.qg(h,1),this.Jn(s,this.Ao),this.Jn(h,this.Ri),e.h.zc(this.Ao,this.Ri)<=this.PA)return this.Pg=!0,-1;var o=this.Ao.compare(this.xh),a=this.Ri.compare(this.xh);return 0>=o&&0=a&&0h&&(this.se(n),h=this.description.Rf(n)),this.la==null&&this.wn(),this.la[this.description.bk(h)+t]=i},r.prototype.K=function(){return 33},r.prototype.Eb=function(){return 0},r.prototype.Pa=function(){this.wc(),this.la!=null&&(this.la[0]=NaN,this.la[1]=NaN)},r.prototype.un=function(n){if(this.la!=null){for(var t=e.fe.Kw(n,this.description),i=[],h=0,s=0,o=n.Ba;s>>32),n=e.P.Vh(h,n)}return n},r.prototype.ng=function(){return null},r}(e.ba);e.Ta=y}(k||(k={})),function(e){var y=function(){function f(r,n,t){r!==void 0&&(this.x=r,this.y=n,this.z=t)}return f.construct=function(r,n,t){var i=new f;return i.x=r,i.y=n,i.z=t,i},f.prototype.L=function(r,n,t){this.x=r,this.y=n,this.z=t},f.prototype.lx=function(){this.z=this.y=this.x=0},f.prototype.normalize=function(){var r=this.length();r==0&&(this.x/=r,this.y/=r,this.z/=r)},f.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},f.prototype.sub=function(r){return new f(this.x-r.x,this.y-r.y,this.z-r.z)},f.prototype.Bg=function(r){new f(this.x*r,this.y*r,this.z*r)},f.prototype.Sh=function(r){return this.x*r.x+this.y*r.y+this.z*r.z},f}();e.Od=y}(k||(k={})),function(e){var y=function(){function f(r,n,t){this.Iw=this.yA=null,this.Zf=n,this.AT=n.y-t,this.zT=n.y+t,this.Gw=0,this.Zz=r,this.ra=t,this.MT=t*t,this.$z=t!=0,this.Nv=!1}return f.prototype.result=function(){return this.Gw!=0?1:0},f.prototype.UM=function(r){return r=r.ic(r.ge(this.Zf,!1)),e.h.zc(r,this.Zf)<=this.MT},f.prototype.aF=function(r){if(!this.$z&&(this.Zz&&this.Zf.rb(r.bc())||this.Zf.rb(r.xc())))this.Nv=!0;else if(r.oa==this.Zf.y&&r.oa==r.ma){if(this.Zz&&!this.$z){var n=Math.max(r.ta,r.qa);this.Zf.x>Math.min(r.ta,r.qa)&&this.Zf.xn?t=!0:this.Zf.x>=Math.min(r.ta,r.qa)&&(t=0r.xc().y?1:-1)}}},f.prototype.MI=function(r){var n=r.Vg(0,1);if(n.pa>this.zT||n.wathis.Zf.y||n.wa(r=r.I()))&&2*r+Math.log(r)/Math.log(2)*n<1*r*n},f}();e.Fg=y}(k||(k={})),function(e){var y=function(f){function r(n){return f.call(this,!0,n)||this}return J(r,f),r.prototype.Ja=function(){return new r(this.description)},r.prototype.Eb=function(){return 2},r.prototype.K=function(){return 1736},r.prototype.sG=function(n,t,i){this.ES(n,t,i)},r.prototype.kR=function(){this.AR()},r}(e.Xk);e.Ea=y}(k||(k={})),function(e){(function(y){y[y.PiPOutside=0]="PiPOutside",y[y.PiPInside=1]="PiPInside",y[y.PiPBoundary=2]="PiPBoundary"})(e.ML||(e.ML={})),e.jd=function(){function y(){}return y.FG=function(f,r,n){return(f=e.Fg.XS(f,r,n))==0?0:f==1?1:2},y.Zd=function(f,r,n){return(f=e.Fg.ym(f,r,n))==0?0:f==1?1:2},y.SX=function(f,r,n,t,i){if(r.lengthr?(0>r?r+=360:360<=r&&(r-=360),r):(0>(r=e.mc.MK(r))&&(r+=360),r)},f.bP=function(r){return 180<(r=f.cP(r))&&(r-=360),r},f.jW=57.29577951308232,f}();e.sr=y,e.Jh=function(){function f(){}return f.nj=function(r,n){var t=new e.l;r.A(t);var i=e.cb.ih(n),h=new e.l;return h.L(i),h.v=t.v,h.C=t.C,h.X(.01*h.da(),0),n=e.ua.Xd(n,t,!1),h.contains(t)?r:e.Vd.clip(r,h,n,0)},f.ms=function(r,n,t,i,h){if(!e.cb.Xc(n))throw e.i.O();var s=e.ua.mj(n,r,!1),o=e.cb.ih(n),a=e.cb.tc(n),u=a.Id().ci,c=e.cb.xv(a);a=e.cb.gv(a),c*=2-c;var l=new e.Oc;o.en(l);var p=[[0,0],[0,0]];if(e.Gg.Tb(n)==2?i?(p[0][0]=f.an(h,l),p[0][1]=o.Lp(),e.cb.wt(),o=p[0][0]*u):(p[0][0]=o.ik(),p[0][1]=h,e.cb.wt(),o=p[0][1]*u):o=h*u,!i&&o!=0)throw e.i.O();var v=new e.ha,b=new e.hd;r=b.Ib(r);for(var d=[0],g=new e.h,x=new e.h,m=new e.h,w=new e.h,j=new e.h,M=new e.h,A=b.Ob(r);A!=-1;A=b.Sb(A)){var z=b.Ya(A);b.D(z,m);for(var N=!1,I=z=b.V(z);I!=-1;I=b.V(I)){if(I==z){if(N)break;N=!0}if(b.D(I,w),i&&ss||ss||!i&&s<-m.y&&w.y>s||s<-w.y&&m.y>s)do if(!(Math.abs(m.x-w.x)>=.5*l.S())){if(e.Gg.Tb(n)==2?(p[0][0]=f.an(m.x,l),p[0][1]=m.y,p[1][0]=f.an(w.x,l),p[1][1]=w.y,e.cb.ZV(),j.x=p[0][0]*u,j.y=p[0][1]*u,M.x=p[1][0]*u,M.y=p[1][1]*u):(j.x=m.x*u,j.y=m.y*u,M.x=w.x*u,M.y=w.y*u),M.x=6.283185307179586*(w.x-m.x)/l.S()+j.x,i){if(x.x=o,x.y=f.Iz(a,c,j,M,o,t),isNaN(x.y))break}else{if(x.x=f.Gz(a,c,j,M,t),isNaN(x.x))break;x.y=0}e.kb.xd(a,c,j.x,j.y,M.x,M.y,v,null,null,t);var D=v.u;e.kb.xd(a,c,j.x,j.y,x.x,x.y,v,null,null,t);var P=v.u;e.Gg.Tb(n)==2?(p[0][0]=x.x/u,p[0][1]=x.y/u,e.cb.XQ(),i?(g.y=p[0][1],g.x=h):(g.x=f.qs(p[0][0],m.x,w.x,l),g.y=h)):i?(g.x=h,g.y=x.y/u):(g.x=f.qs(x.x/u,m.x,w.x,l),g.y=h),d[0]=0i.x)var o=i;else o=t,t=i;i=new e.ha(0);var a=new e.ha(0),u=new e.ha(0);e.kb.xd(r,n,o.x,o.y,t.x,t.y,a,i,null,s);var c=a.u,l=0,p=1,v=new e.h;for(v.N(o);c*(p-l)>1e-12*r;){var b=.5*(l+p);if(e.kb.qj(r,n,o.x,o.y,c*b,i.u,a,u,s),v.x=a.u,v.y=u.u,v.x==h)break;if(f.Un(o.x,v.x,h))p=b;else{if(!f.Un(t.x,v.x,h))return NaN;l=b}}return v.y},f.Un=function(r,n,t){return r=y.Ep(r),n=y.mx(r,y.Ep(n)),(t=y.mx(r,y.Ep(t)))==0||0n&&0>t&&t>=n},f.an=function(r,n){var t=n.wa-n.pa;return n.Kt(r-Math.floor((r-n.pa)/t)*t)},f.qs=function(r,n,t,i){var h=new e.Oc;for(h.L(n,t),t=i.S(),r=Math.floor((r-n)/t)*t+r,h=h.tf();Math.abs(r-h)>Math.abs(r+t-h);)r+=t;return r},f.Gz=function(r,n,t,i,h){if(t.y>i.y)var s=i;else s=t,t=i;if((i=new e.Oc).L(s.y,t.y),!i.contains(0)||3.141592653589793<=Math.abs(s.x-t.x))return NaN;if(s.x==t.x)return s.x;var o=new e.ha(0),a=new e.ha(0),u=new e.ha(0);e.kb.xd(r,n,s.x,s.y,t.x,t.y,a,o,null,h);var c=a.u,l=0,p=1,v=new e.h;for(v.N(s);c*(p-l)>1e-12*r;){var b=.5*(l+p);if(e.kb.qj(r,n,s.x,s.y,c*b,o.u,a,u,h),v.x=a.u,v.y=u.u,i.L(s.y,v.y),v.y==0)break;if(i.contains(0))p=b;else{if(i.L(t.y,v.y),!i.contains(0))return NaN;l=b}}return v.x},f.Jp=function(r,n,t,i,h,s,o){var a=new e.l;if(r.A(a),a.B())return r;var u=new e.Oc;a.en(u);var c=new e.Oc;if(c.L(n,n+t),c.contains(u)&&c.wa!=u.wa)return r;var l=new e.l;l.L(a);var p=r.K();if(p==33)return((a=(l=h?r:r.Qf()).Ng())=c.wa||o&&a==c.wa)&&(a+=Math.ceil((c.pa-a)/t)*t,a=c.Kt(a),l.YB(a)),l;if(p==550){for(i=(l=h?r:r.Qf()).vb(0),p=2*l.I(),r=!1,h=0;h=c.wa||o&&a==c.wa)&&(r=!0,a+=Math.ceil((c.pa-a)/t)*t,a=c.Kt(a),i.write(h,a));return r&&l.Qc(1993),l}if(c.contains(u))return r;if(p==197)return t=h?r:r.Qf(),a.Fa(l),t.Zo(a),t;var v=.1*Math.max(a.da(),a.S());for(l.X(0,v),o=r,c=i.Yd(0),r=e.Ih.local(),h=new e.Ed;;){var b=Math.floor((u.pa-n)/t),d=Math.ceil((u.wa-n)/t);if(!(3l.v;)(v=e.Vd.clip(o,l,c,0)).A(u),(p==1607?!v.B()&&(u.S()>c||u.da()>c):!v.B()&&(p!=1736||u.S()>c))&&(v.Pc(h),v.A(u),n.A(s),s.X(c,c),s.isIntersecting(u)&&p==1736?n=r.W(n,v,i,null):n.add(v,!1)),l.move(t,0),h.shift(-t,0);return n},f.RI=function(r,n,t,i){var h=new e.ee(t.description);h.Gd(t,0,-1),h=e.cb.Bh(h,r,n);var s=t.I();if(i.Pa(),!e.cb.Xc(r)||s!=h.I())return!1;var o=new e.l;t.A(o);var a=new e.l;if(h.A(a),o=o.S(),a=a.S(),o!=0&&a!=0){if(a/=o,r=e.cb.ih(n).S()/e.cb.ih(r).S(),1e-10=t[h]?i[h]=t[h].toUpperCase():t[h];return i.join()}return t.toString(e.Tc.PE_STR_AUTH_TOP)},n.wr=function(t,i,h,s){var o=s.length,a=h.I();if(a!=0){var u=h.vb(0),c=Math.min(a,o),l=0,p=t.gh();isNaN(i)&&(i=0);for(var v=t.Xc(),b=179*(t=v?t.tc().Le().S():0)/360;0x*e.mc.sign(m)&&Math.abs(g)>b&&(s[d][0]+=-x*t)}u.pC(l<<1,c,s),l+=c,a-=c,c=Math.min(a,o)}h.Qc(1993)}},n.DL=function(t,i,h,s){var o=0,a=t.gh();isNaN(o)&&(o=0);var u=t.Xc(),c=t.bf();t=360*c,c*=179;for(var l=s.length,p=0;pm*e.mc.sign(g)&&Math.abs(x)>c&&(s[v][0]-=m*t)}e.ua.Dy(i,p,s,b),p+=b}}},n.Kx=function(t,i,h){var s=h.length,o=i.I();if(!(1>o)){var a=i.vb(0),u=Math.min(o,s),c=0,l=t.gh(),p=t.Xc(),v=p?t.Le().S():0,b=179*v/360,d=0;for(p&&(d=t.Bi());0x*e.mc.sign(m)&&Math.abs(g)>b&&(h[t][0]+=-x*v)}a.pC(c<<1,u,h),c+=u,o-=u,u=Math.min(o,s)}i.Qc(1993)}},n.CL=function(t,i,h,s){if(h!=0){var o=t.gh(),a=t.Xc(),u=a?t.Le().S():0,c=179*u/360,l=0;for(a&&(l=t.Bi()),t=0;tg*e.mc.sign(i[b].x-l)&&Math.abs(d)>c&&(s[p][0]-=g*u)}e.ua.Dy(i,t,s,v),t+=v}}}},n.vr=function(t,i,h,s){var o=i.I();if(o!=0){var a=i.vb(0),u=t.ef,c=t.$f,l=u.tc().Sp(),p=c.tc().Sp(),v=u.bf(),b=c.bf();if((t=t.Yf)==null||t.count()==0){for(h=l/p,s=(u.Wp()-c.Wp())*b,p=-90*v,t=90*v,l=!1,b=1,u=2*o;bw?s[b][1]=w:s[b][1]<-w&&(s[b][1]=-w));for(v=0;vb){if(A){var V=I+(W+11*v&&(A=!1)}A||(E=K+(B-=e.mc.En(p,E-C)),++S,$=B!=0,R.x=E)}else F||e.ua.vG(U,H,R,N)&&(F=!0);$&&D.write(2*W,E),C=E,U.N(H),H.N(R)}0t?u=1:0>=c&&0.99*c&&(u=-1)):u=-1),u!=0&&((i=new e.Ea(o.description)).vp(l),(i=e.Zl.local().W(i,h,a)).add(o,!1),w=!0,o=i),w&&(o=e.$l.local().W(o,s,!1,a)),o},n.qQ=function(t,i,h,s,o){var a=h.I(),u=h.Oa(0),c=h.Oa(a-1);o=(s=n.fv(s,o)).S(),u=e.mc.sign(c.x-u.x);var l=new e.l;h.yc(l);var p=s.ik();if(c=p-o,p+=o,0<=u){var v=Math.ceil((c-l.v)/o);for(v*=o;c>l.v+v;)v+=o;for(;cl.v+v;)v+=o;b=v,720c;)1024<=m&&(m=0),d.move(v,0),g.Lb=v,h.Pc(g),x+=v,s.v<=x&&s.C>=x&&(o=l.I()-1),h.Db(0,b),b=h.Oa(a-1),l.Fr(h,0,0,a-1,!1);return h=new e.Ea(l.description),a=0u?a:!a)?(u=e.h.construct(c.x,s.H),h.Ei(u),u=e.h.construct(s.ik(),s.H),h.Ei(u),s=e.h.construct(t.x,s.H)):(u=e.h.construct(c.x,s.G),h.Ei(u),u=e.h.construct(s.ik(),s.G),h.Ei(u),s=e.h.construct(t.x,s.G)),h.Ei(s),h.sG(0,i,0),h.fO(o),h},n.pQ=function(t,i,h,s,o){var a=new e.Ea(t.description);a.add(t,!1),a.yB(0,a.I()-1);var u=new e.l;a.yc(u);var c=(h=n.fv(i,h)).S(),l=Math.ceil((h.v-u.v)/c);for(l*=c;h.v>u.v+l;)l+=c;for(;h.vu.C)return o&&(o=a.He(),i=(a=e.$l.local().W(a,i,!0,s)).He(),(i=e.mc.sign(o)!=e.mc.sign(i))&&a.jJ()),a;for((t=new e.Ea(t.description)).add(a,!1),o=o||u.S()>c-i.Yd(0);u.v=h){c=!0;break}if(2&o&&p.y<=-h){c=!0;break}}if(!c)return!1;a=!1,t&&(a=i.Pn(0)),u=(t=new e.hd).Ib(i),c=t.Ob(u);var v=-1,b=!0,d=new e.h;d.Sc(),l=new e.Ta;for(var g=-1,x=t.Ya(c);x!=-1;x=t.V(x)){p=t.Oa(x);var m=1&o&&90<=p.y?1:0;if(m|=2&o&&p.y<=-h?2:0,0c){if(new e.l().L(d.v-u,-c,d.C+u,c),(o=e.ti.Pu(o,i,t,NaN,0,s)).B())return o;o.A(d)}if(x&&(i.Hd.H))return o.Ja();if(d.S()>p&&(o=n.Jp(o,v-l,p,t,!0,0,!0,s)).A(d),(c=n.$N(d.v,d.C,i.v,i.C,p))!=0&&d.move(c,0),d.C>i.C||d.vi.C)for(;d.v>=i.C;)d.move(-p,0),c-=p;for(;d.vc;c++){if(m?u=e.ba.Ic(a)?e.ti.clip(o,i,h,b,s):e.ti.clip(o,i,h,0,s):(u=e.Zj.local().W(o,g,t,s))==g&&(u=e.ba.kg(u)),i.v<=d.v&&i.C>=d.C||i.v>=d.v&&i.C<=d.C)return u;x[c]=u,c==0&&(d.move(-p,0),(u=new e.Ed).ig(-p,0),o.Pc(u))}if(a==550)x[0].Gd(x[1],0,-1);else if(e.ba.Ic(a))x[0].add(x[1],!1);else{if(a!=33)throw e.i.ga("intersect_with_GCS_horizon: unexpected geometry type");x[0].B()&&(x[0]=x[1])}return x[0]}if(i.Hd.H)return o;for(a=0;!o.B()&&d.C>i.v;)a!=0&&((u=new e.Ed).ig(a,0),o.Pc(u)),e.fj.local().W(4,o,g,t,s)||g==(o=e.mp.local().W(o,g,t,s))&&(o=e.ba.kg(o)),a!=0&&((b=new e.Ed).ig(-a,0),o.Pc(b)),a-=p,d.move(-p,0);return o},n.tG=function(t,i,h,s){if(i!=0&&s!=y.DontClip)if(s==y.PannableFold){s=h.CR();for(var o=i,a=0;as.H||t[a].yu||t[a].y<-u)&&(t[a].Sc(),o--);if(o!=0){(o=new e.l).bx(t,i),u=h.Xr();var l=h.kv();a=u.K()==197;var p=new e.l;if(u.A(p),!l||!(p.Ho.H))if(l)if(n.cv(t,i,p.ik()-c,s),o=i,a)for(a=0;a=p||u&&v==p)&&(v+=Math.ceil((i-v)/h)*h,v=e.P.Tk(v,i,p),s.YB(v)),s}if(t.B()||(v=new e.l,t.A(v),v.B()))return t;var b=new e.Oc;v.en(b);var d=new e.Oc;if(d.L(i,p),d.contains(b))return t;if((p=new e.l).L(v),l===550){for(c=(s=o?t:t.Qf()).vb(0),l=2*s.I(),p=!1,i=0;i=d.wa||u&&v==d.wa)&&(p=!0,v+=Math.ceil((d.pa-v)/h)*h,v=d.Kt(v),c.write(i,v));return p&&s.Qc(1993),s}if(l==197)return h=o?t:t.Qf(),v.Fa(p),h.Zo(v),h;var g=.1*Math.max(v.da(),v.S());for(p.X(0,g),u=t,d=s.Yd(0),t=e.Ih.local(),o=new e.Ed;;){var x=Math.floor((b.pa-i)/h),m=Math.ceil((b.wa-i)/h);if(!(3p.v;)(g=e.ti.clip(u,p,d,0,c)).A(b),(l==1607?!g.B()&&(b.S()>d||b.da()>d):!g.B()&&(l!=1736||b.S()>d))&&(g.Pc(o),g.A(b),i.A(a),a.X(d,d),a.isIntersecting(b)&&l==1736?i=t.W(i,g,s,null):i.add(g,!1)),p.move(h,0),o.shift(-h,0);return i},n.cv=function(t,i,h,s){for(var o=h+s,a=0;ao||u==o)||(u+=Math.ceil((h-u)/s)*s,u=e.P.Tk(u,h,o),t[a].x=u)}},n.Hn=function(t,i,h,s,o,a){if(!i.Xc())throw e.i.ga("fold_into_360_degree_range");if(t.B())return t;if(i.Tb()==2){h=i.rv();var u=i.qv()-h}else{var c=i.bf();u=360*c,h-=180*c}return n.Jp(t,h,u,i,s,o,!0,a)},n.lF=function(t,i,h,s){if(h.Tb()==2)s=h.rv(),h=h.qv()-s;else{var o=h.bf();h=360*o,s-=180*o}n.cv(t,i,s,h)},n.nj=function(t,i){var h=i.Le();if(t.K()==33){var s=t.kh();return h.G<=s&&s<=h.H?t:t.Ja()}s=new e.l,t.A(s);var o=new e.l;return o.L(h),o.v=s.v,o.C=s.C,o.X(.01*o.da(),0),h=e.ua.py(i,s),o.contains(s)?t:e.ti.clip(t,o,h,0,null)},n.kr=function(t,i,h){return t>i.C&&t-i.Ch.H?t[o].Sc():t[o].x=n.kr(t[o].x,h,s)},n.Lt=function(t,i,h,s){if(!t.B()){var o=t.K();if(!s||o!=1736)if(e.ba.zj(o)){s=t.vb(0),o=0;for(var a=t.I();os||ss)||!a&&(u!=0||s<-z.y&&N.y>s||s<-N.y&&z.y>s))do if(!(Math.abs(z.x-N.x)>=.5*b.S())){if(h.Tb()==2?(g[0][0]=n.an(z.x,b),g[0][1]=z.y,g[1][0]=n.an(N.x,b),g[1][1]=N.y,e.gj.projToGeogCenter(d,2,g,0),I.x=g[0][0]*l,I.y=g[0][1]*l,D.y=g[1][1]*l):(I.x=z.x*l,I.y=z.y*l,D.y=N.y*l),D.x=2*(N.x-z.x)*Math.PI/b.S()+I.x,a){if(j.x=c,j.y=n.Iz(p,v,I,D,c,o),isNaN(j.y))break;A[0]=j;var S=1}else if(o==r.GreatElliptic){var F=[0,0];if((S=e.Nx.Jz(v,I,D,c,F))==0)break;j.x=F[0],j.y=c,A[0]=j,S==2&&(M.x=F[1],M.y=c,A[1]=M)}else{if(j.x=n.Gz(p,v,I,D,o),isNaN(j.x))break;j.y=0,A[0]=j,S=1}var H=-1;for(F=0;Fm[0]||(H=t.Na(C),t.Wl(H,m,1),t.Db(t.V(H),w.x,w.y),H=m[0])}}while(0);z.N(N)}}},n.an=function(t,i){var h=i.wa-i.pa;return i.Kt(t-Math.floor((t-i.pa)/h)*h)},n.qs=function(t,i,h,s){var o=new e.Oc;for(o.L(i,h),h=s.S(),t=Math.floor((t-i)/h)*h+t,o=o.tf();Math.abs(t-o)>Math.abs(t+h-o);)t+=h;return t},n.Un=function(t,i,h){return t=e.sr.Ep(t),i=e.sr.mx(t,e.sr.Ep(i)),(h=e.sr.mx(t,e.sr.Ep(h)))==0||0i&&0>h&&h>=i},n.Iz=function(t,i,h,s,o,a){if(a==r.GreatElliptic)return e.Nx.NS(i,h,s,o);if(Math.abs(h.x-s.x)>=Math.PI||!n.Un(h.x,s.x,o))return NaN;if(h.x>s.x)var u=s;else u=h,h=s;s=new e.ha;var c=new e.ha,l=new e.ha;e.kb.xd(t,i,u.x,u.y,h.x,h.y,c,s,null,a);var p=c.u,v=0,b=1,d=new e.h;for(d.N(u);p*(b-v)>1e-12*t;){var g=.5*(v+b);if(e.kb.qj(t,i,u.x,u.y,p*g,s.u,c,l,a),d.x=c.u,d.y=l.u,d.x==o)break;if(n.Un(u.x,d.x,o))b=g;else{if(!n.Un(h.x,d.x,o))return NaN;v=g}}return d.y},n.Gz=function(t,i,h,s,o){if(o==r.GreatElliptic)return t=[0,0],e.Nx.Jz(i,h,s,0,t),t[0];if(h.y>s.y)var a=s;else a=h,h=s;if((s=new e.Oc).L(a.y,h.y),!s.contains(0)||Math.abs(a.x-h.x)>=Math.PI)return NaN;if(a.x==h.x)return a.x;var u=new e.ha,c=new e.ha,l=new e.ha;e.kb.xd(t,i,a.x,a.y,h.x,h.y,c,u,null,o);var p=c.u,v=0,b=1,d=new e.h;for(d.N(a);p*(b-v)>1e-12*t;){var g=.5*(v+b);if(e.kb.qj(t,i,a.x,a.y,p*g,u.u,c,l,o),d.x=c.u,d.y=l.u,s.L(a.y,d.y),d.y==0)break;if(s.contains(0))b=g;else{if(s.L(h.y,d.y),!s.contains(0))return NaN;v=g}}return d.x},n.RI=function(t,i,h,s){if(!t.ef.Xc())return!1;var o=new e.ee(i.description);if(o.Gd(i,0,-1),s=e.Gx.local().W(o,t,s),o=i.I(),h.Pa(),o!=s.I())return!1;var a=new e.l;i.A(a);var u=new e.l;if(s.A(u),a=a.S(),u=u.S(),a!=0&&u!=0){if(u/=a,t=t.$f.ih().S()/t.ef.ih().S(),1e-10=180*i&&(t-=360*i),t},n.OI=function(t,i,h,s){if(h==y.Clip){var o=i.ol();o.K()==197?(h=new e.l,o.A(h),o=e.ua.py(i,h),t=e.ti.clip(t,h,o,5e4*i.rm(),s)):e.fj.local().W(1,o,t,i,s)||(t=e.Zj.local().W(t,o,i,s))==o&&(t=e.Xk.kg(t))}else i.Xc()&&(s=new e.l,t.yc(s),i.Le().contains(s)||(n.Lt(t,i.Le(),i.Yd(0),!0),h==y.PannableFold&&(t=n.nj(t,i)),t=n.Hn(t,i,0,!0,1e5*i.rm(),null)));return t},n.SD=function(t,i,h){var s=i.Yr();if(s==null)return t;var o=(i=i.tc()).Le().S(),a=new e.l;t.yc(a);var u=new e.Oc;a.en(u),a=s.Ha(),s=null;for(var c=new e.Ed;a.ab();)for(;a.Ia();){var l=a.ia(),p=l.Vg(0,0),v=new e.Oc;for(v.L(p.pa,p.wa),p=0;v.wa>u.pa;)v.move(-o),--p;for(;v.pa<=u.wa;){if(v.isIntersecting(u)){s==null&&(s=new e.Ua);var b=e.zb.YO(l.bc(),l.xc());p!=0&&(c.ig(p*o,0),b.Pc(c)),s.pc(b,!0)}v.move(o),++p}}return s!=null?(i=e.ua.bO(i,s),i=e.ua.Gr(i),e.bu.gP(t,s,i,h)):t},n.$N=function(t,i,h,s,o){return t>=h&&i<=s?0:n.oE(.5*(i+t),h,s,o)},n.oE=function(t,i,h,s){return e.mc.round((.5*(h+i)-t)/s)*s},n.QQ=function(t,i,h,s,o,a,u,c){var l=n.fv(s,o),p=l.S(),v=p/360,b=n.kE*v,d=t.vb(0),g=i.Xc(),x=g?p/i.Le().S():0;i=t.Ja();for(var m=0,w=h.ea();mb){if(j){var X=z+$-1,V=z;(!N||$+11*v&&(g=!1)}j||(K=R+(D-=e.mc.En(p,K-P)),++B,U=D!=0,W.x=K)}else S||e.ua.vG(F,H,W,C)&&(S=!0);U&&I.write(2*$,K),P=K,F.N(H),H.N(W)}B!=0&&M.Qc(1993),j=M.Oa(0),A=M.Oa(A-1),e.h.ub(j,A),M=n.rQ(M,s,isNaN(o)?0:o,a),i.add(M,!1)}return t=s.Yd(0),h=l.S()/180,n.Lt(i,l,.1*t,!1),e.ti.clip(i,l,t,h,a)},n.rQ=function(t,i,h,s){return n.Hn(t,i,h,!0,0,s)},n.JS=function(t,i,h,s){var o=t.K();if(o==1736)for(i=i!=null?i.Yd(0):0,o=0;oh)for(var o=new e.Ta,a=0;ah)for(var o=new e.Ta,a=0;athis.Ko},r.prototype.az=function(){if(this.B())throw e.i.ga("invalid call");return new e.Ta(this.Ds.x,this.Ds.y)},r.prototype.Va=function(){if(this.B())throw e.i.ga("invalid call");return this.Ko},r.prototype.cz=function(){if(this.B())throw e.i.ga("invalid call");return this.La},r.prototype.Nz=function(){return(1&this.pw)!=0},r.prototype.by=function(n,t,i,h){this.Ds.x=n,this.Ds.y=t,this.Ko=i,this.La=h},r}();e.bm=f}(k||(k={})),function(e){var y=function(){function r(){}return r.prototype.Wo=function(n,t){this.vh.resize(0),this.Ki.length=0,this.vk=-1,n.yc(this.Gk),this.Gk.X(t,t),this.Gk.isIntersecting(this.Gb.Da)?((this.xs=e.ba.zd(n.K()))?(this.OH=n.bc(),this.NH=n.xc(),this.ra=t):this.ra=NaN,this.vh.add(this.Gb.kf),this.Ki.push(this.Gb.Da),this.Ss=this.Gb.Wr(this.Gb.kf)):this.Ss=-1},r.prototype.Zi=function(n,t){this.vh.resize(0),this.Ki.length=0,this.vk=-1,this.Gk.L(n),this.Gk.X(t,t),this.ra=NaN,this.Gk.isIntersecting(this.Gb.Da)?(this.vh.add(this.Gb.kf),this.Ki.push(this.Gb.Da),this.Ss=this.Gb.Wr(this.Gb.kf),this.xs=!1):this.Ss=-1},r.prototype.next=function(){if(this.vh.size==0)return-1;this.vk=this.Ss;var n=null,t=null,i=null,h=null;this.xs&&(n=new e.h,t=new e.h,i=new e.l);for(var s=!1;!s;){for(;this.vk!=-1;){var o=this.Gb.Xy(this.Gb.hv(this.vk));if(o.isIntersecting(this.Gk)){if(!this.xs){s=!0;break}if(n.N(this.OH),t.N(this.NH),i.L(o),i.X(this.ra,this.ra),0a;a++){var u=this.Gb.Np(o,a);if(u!=-1&&0>h);s==0?(t.v=.5*(t.v+t.C),t.G=.5*(t.G+t.H)):s==1?(t.C=.5*(t.v+t.C),t.G=.5*(t.G+t.H)):(s==2?t.C=.5*(t.v+t.C):t.v=.5*(t.v+t.C),t.H=.5*(t.G+t.H))}return t},r.prototype.RR=function(n){return this.vz(n)},r.prototype.qR=function(n,t){return y.XO(this,n,t)},r.prototype.HF=function(n,t){return y.WO(this,n,t)},r.prototype.getIterator=function(){return y.VO(this)},r.prototype.Pk=function(n,t){if(0>t||32<2*t)throw e.i.O("invalid height");this.wT=t,this.Da.L(n),this.kf=this.jf.De(),this.jx(this.kf,0),this.dx(this.kf,0),this.IJ(this.kf,0),this.FJ(this.kf,0)},r.prototype.Bv=function(n,t,i,h,s,o,a){if(!h.contains(t))return i==0?-1:this.Bv(n,t,0,this.Da,this.kf,o,a);if(!o)for(var u=s;u!=-1;u=this.DR(u))this.jx(u,this.vz(u)+1);(u=new e.l).L(h),h=s;var c=[];for(c[0]=new e.l,c[1]=new e.l,c[2]=new e.l,c[3]=new e.l;ip;p++)if(c[p].contains(t)){l=!0;var v=this.Np(h,p);v==-1&&(v=this.mP(h,p)),this.jx(v,this.vz(v)+1),h=v,u.L(c[p]);break}if(!l)break}return this.nS(n,t,i,u,h,o,s,a)},r.prototype.nS=function(n,t,i,h,s,o,a,u){var c=this.IF(s);if(o){if(s==a)return u;this.NP(u),o=u}else o=this.oP(),this.IB(o,n),this.FW(this.hv(o),t);return this.hX(o,s),c!=-1?(this.hx(o,c),this.ex(c,o)):this.BJ(s,o),this.NB(s,o),this.dx(s,this.nv(s)+1),this.cO(s)&&this.HQ(i,h,s),o},r.prototype.NP=function(n){var t=this.RF(n),i=this.IF(t),h=this.JR(n),s=this.pv(n);this.Wr(t)==n?(s!=-1?this.hx(s,-1):this.NB(t,-1),this.BJ(t,s)):i==n?(this.ex(h,-1),this.NB(t,h)):(this.hx(s,h),this.ex(h,s)),this.hx(n,-1),this.ex(n,-1),this.dx(t,this.nv(t)-1)},r.zJ=function(n,t){var i=.5*(n.v+n.C),h=.5*(n.G+n.H);t[0].L(i,h,n.C,n.H),t[1].L(n.v,h,i,n.H),t[2].L(n.v,n.G,i,h),t[3].L(i,n.G,n.C,h)},r.prototype.cO=function(n){return this.nv(n)==8&&!this.bG(n)},r.prototype.HQ=function(n,t,i){var h=this.Wr(i);do{var s=this.hv(h),o=this.ai.U(h,0);s=this.Xy(s),this.Bv(o,s,n,t,i,!0,h),h=o=this.pv(h)}while(h!=-1)},r.prototype.dO=function(n){return 8<=this.nv(n)||this.bG(n)},r.prototype.bG=function(n){return this.Np(n,0)!=-1||this.Np(n,1)!=-1||this.Np(n,2)!=-1||this.Np(n,3)!=-1},r.prototype.mP=function(n,t){var i=this.jf.De();return this.JW(n,t,i),this.jx(i,0),this.dx(i,0),this.Rk(i,n),this.FJ(i,this.lv(n)+1),this.IJ(i,t<<2*this.lv(n)|this.LF(n)),i},r.prototype.oP=function(){var n=this.ai.De();if(0>4)]|=this.dH<<2*(15&s)},n}();e.DY=f;var r=function(){function n(t,i,h){this.Xh=null,this.NA=this.Kk=this.YH=this.WH=this.Gs=this.lH=this.Hf=this.Wm=0,this.Ti=this.Lk=this.xl=null,this.Az(t,i,h)}return n.create=function(t,i,h){if(!n.uE(t))throw e.i.O();return n.rP(t,i,h)},n.kW=function(t){switch(t){case 0:t=1024;break;case 1:t=16384;break;case 2:t=262144;break;default:throw e.i.ga("Internal Error")}return t},n.uE=function(t){return!(t.B()||t.K()!=1607&&t.K()!=1736)},n.prototype.mQ=function(t,i){i=i.Ha();for(var h=new e.h,s=new e.h;i.ab();)for(;i.Ia();){var o=i.ia();if(o.K()!=322)throw e.i.ga("Internal Error");t.Gh(o.bc(),h),t.Gh(o.xc(),s),this.Ti.fy(h.x,h.y,s.x,s.y)}this.Ti.dJ(e.Ox.Bx)},n.prototype.nQ=function(){throw e.i.ga("Internal Error")},n.prototype.My=function(t,i){for(var h=1;4>h;h++)t.fy(i[h-1].x,i[h-1].y,i[h].x,i[h].y);t.fy(i[3].x,i[3].y,i[0].x,i[0].y),this.Ti.dJ(e.Ox.Bx)},n.prototype.mK=function(t,i,h){for(var s=[null,null,null,null],o=0;o(g=o.length());g==0?o.na(1,0):(x||v.N(l),o.scale(h/g),a.na(-o.y,o.x),u.na(o.y,-o.x),c.sub(o),l.add(o),s[0].add(c,a),s[1].add(c,u),s[2].add(l,u),s[3].add(l,a),x?b=!0:this.My(t,s))}else b&&(this.My(t,s),b=!1),d=!0}b&&this.My(t,s)}},n.prototype.nC=function(t){return e.P.truncate(t*this.lH+this.WH)},n.prototype.oC=function(t){return e.P.truncate(t*this.Gs+this.YH)},n.rP=function(t,i,h){return new n(t,i,h)},n.prototype.Az=function(t,i,h){this.Hf=Math.max(e.P.truncate(2*Math.sqrt(h)+.5),64),this.Wm=e.P.truncate((2*this.Hf+31)/32),this.xl=new e.l,this.Kk=i,h=0;for(var s=this.Hf,o=this.Wm;8<=s;)h+=s*o,s=e.P.truncate(s/2),o=e.P.truncate((2*s+31)/32);this.Xh=e.P.mg(h,0),this.Ti=new e.Ox,h=new f(this.Xh,this.Wm,this),this.Ti.wX(this.Hf,this.Hf,h),t.A(this.xl),this.xl.X(i,i),s=new e.l;var a=i*(o=e.l.construct(1,1,this.Hf-2,this.Hf-2)).S();switch(i*=o.da(),s.L(this.xl.tf(),Math.max(a,this.xl.S()),Math.max(i,this.xl.da())),this.NA=this.Kk,this.Lk=new e.Ed,this.Lk.kS(s,o),new e.Ed,t.K()){case 550:h.ax(this.Ti,2),this.nQ();break;case 1607:h.ax(this.Ti,2),this.mK(this.Ti,t,this.NA);break;case 1736:h.ax(this.Ti,1),this.mQ(this.Lk,t),h.ax(this.Ti,2),this.mK(this.Ti,t,this.NA)}this.lH=this.Lk.eb,this.Gs=this.Lk.bb,this.WH=this.Lk.Lb,this.YH=this.Lk.Qb,this.SN()},n.prototype.SN=function(){this.Ti.flush();for(var t=0,i=this.Hf*this.Wm,h=this.Hf,s=e.P.truncate(this.Hf/2),o=this.Wm,a=e.P.truncate((2*s+31)/32);8>4;p=2*(15&p);var d=v>>4;v=2*(15&v);var g=this.Xh[t+o*u+b]>>p&3;g|=this.Xh[t+o*u+d]>>v&3,g|=this.Xh[t+o*c+b]>>p&3,g|=this.Xh[t+o*c+d]>>v&3,this.Xh[i+a*h+(l>>4)]|=g<<2*(15&l)}h=s,o=a,t=i,s=e.P.truncate(h/2),a=e.P.truncate((2*s+31)/32),i=t+o*h}},n.prototype.Uo=function(t,i){return this.xl.contains(t,i)?(t=this.nC(t),i=this.oC(i),0>t||t>=this.Hf||0>i||i>=this.Hf||(i=this.Xh[this.Wm*i+(t>>4)]>>2*(15&t)&3)==0?0:i==1?1:2):0},n.prototype.To=function(t){if(!t.Fa(this.xl))return 0;var i=this.nC(t.v),h=this.nC(t.C),s=this.oC(t.G);if(t=this.oC(t.H),0>i&&(i=0),0>s&&(s=0),h>=this.Hf&&(h=this.Hf-1),t>=this.Hf&&(t=this.Hf-1),i>h||s>t)return 0;for(var o=Math.max(h-i,1)*Math.max(t-s,1),a=0,u=this.Wm,c=this.Hf,l=0;;){if(32>o||16>c){for(o=s;o<=t;o++)for(var p=i;p<=h;p++)if(1<(l=this.Xh[a+u*o+(p>>4)]>>2*(15&p)&3))return 2;if(l==0)return 0;if(l==1)return 1}a+=u*c,c=e.P.truncate(c/2),u=e.P.truncate((2*c+31)/32),i=e.P.truncate(i/2),s=e.P.truncate(s/2),h=e.P.truncate(h/2),t=e.P.truncate(t/2),o=Math.max(h-i,1)*Math.max(t-s,1)}},n.prototype.MR=function(){return this.Hf*this.Wm},n}();e.Mx=r}(k||(k={})),function(e){var y;(y=e.QL||(e.QL={}))[y.contains=1]="contains",y[y.within=2]="within",y[y.equals=3]="equals",y[y.disjoint=4]="disjoint",y[y.touches=8]="touches",y[y.crosses=16]="crosses",y[y.overlaps=32]="overlaps",y[y.unknown=0]="unknown",y[y.intersects=1073741824]="intersects";var f=function(){function n(){}return n.construct=function(t,i,h,s,o,a,u,c){var l=new n;return l.rw=t,l.Om=i,l.Mj=h,l.Ui=s,l.wH=o,l.OY=a,l.PY=u,l.QY=c,l},n}();e.Xt=function(){function n(){}return n.xD=function(t,i,h){if(n.ry(t)){var s=e.ua.mj(i,t,!1);i=!1,e.Wk.xE(t)&&(i=i||t.nu(s,h)),(s=t.K())!=1736&&s!=1607||!e.Wk.vE(t)||h==0||(i=i||t.hj(h)),s!=1736&&s!=1607||!e.Wk.wE(t)||h==0||i||t.cM()}},n.ry=function(t){return e.Wk.xE(t)||e.Wk.vE(t)||e.Wk.wE(t)},n}();var r=function(){function n(){this.th=[]}return n.uB=function(t,i,h,s,o){var a=t.K(),u=i.K();if(a==197){if(u==197)return n.oW(t,i,h,s);if(u==33)return s==2?s=1:s==1&&(s=2),n.cJ(i,t,h,s)}else if(a==33){if(u==197)return n.cJ(t,i,h,s);if(u==33)return n.qW(t,i,h,s)}if(t.B()||i.B())return s==4;var c=new e.l;t.A(c);var l=new e.l;i.A(l);var p=new e.l;if(p.L(c),p.$b(l),h=e.ua.Xd(h,p,!1),n.fk(c,l,h))return s==4;switch(c=!1,e.Xk.zd(a)&&((a=new e.Ua(t.description)).pc(t,!0),t=a,a=1607),e.Xk.zd(u)&&((u=new e.Ua(i.description)).pc(i,!0),i=u,u=1607),a!=197&&u!=197?(t.Eb()4*Math.max(t.I(),i.I())*h)&&n.Rz(t,i,h,!0)))},n.fV=function(t,i,h){var s=n.rc(t,i,!0);return s==4||s!=1&&s!=2&&s!=1073741824&&n.zI(t,i,h)},n.qV=function(t,i,h){var s=n.rc(t,i,!1);return s!=4&&s!=1&&s!=2&&n.DI(t,i,h,null)},n.lV=function(t,i,h,s){var o=n.rc(t,i,!1);return o!=4&&o!=1&&o!=2&&n.AI(t,i,h,s)},n.Uw=function(t,i,h,s){var o=new e.l,a=new e.l;return t.A(o),i.A(a),!!n.Ac(o,a,h)&&(o=n.rc(t,i,!1))!=4&&o!=2&&(o==1||n.wI(t,i,h,s))},n.gV=function(t,i,h){var s=n.rc(t,i,!0);return s==4||s!=1&&s!=1073741824&&n.zI(t,i,h)},n.rV=function(t,i,h,s){var o=n.rc(t,i,!1);return o!=4&&o!=1&&n.EI(t,i,h,s)},n.bV=function(t,i,h){var s=n.rc(t,i,!1);return s!=4&&s!=1&&n.yI(t,i,h,null)},n.aB=function(t,i,h,s){var o=new e.l,a=new e.l;return t.A(o),i.A(a),!!n.Ac(o,a,h)&&(o=n.rc(t,i,!1))!=4&&(o==1||n.xI(t,i,h,s))},n.eV=function(t,i,h){return e.jd.FG(t,i,h)==0},n.pV=function(t,i,h){return i=i.D(),n.CI(t,i,h)},n.ZU=function(t,i,h){return i=i.D(),n.vI(t,i,h)},n.dV=function(t,i,h){var s=n.rc(t,i,!1);if(s==4)return!0;if(s==1)return!1;s=new e.l,t.A(s),s.X(h,h);for(var o=new e.h,a=0;ah&&a.S()>h||a.da()<=h&&a.S()<=h)&&(o=new e.Ua,a=new e.Ta,i.If(0,a),o.nf(a),i.If(2,a),o.lineTo(a),n.yI(t,o,h,s))},n.DV=function(t,i,h){var s=new e.l,o=new e.l;return t.A(s),i.A(o),!(!n.gk(s,o,h)||n.rc(t,i,!1)==4)&&(!!n.ZH(t,i,h)||n.Rz(t,i,h,!1))},n.BV=function(t,i,h){return this.rc(t,i,!1)==4||!!new e.am(t,i,h,!0).next()&&!this.OG(t,i,h)},n.II=function(t,i,h){if(n.rc(t,i,!1)==4)return!1;var s=new e.ce(0);if(n.Sz(t,i,h,s)!=0)return!1;for(var o=new e.ee,a=0;ah&&o.S()>h)&&n.gk(s,o,h)},n.yV=function(t,i,h){var s=new e.l,o=new e.l;return t.A(s),i.A(o),!n.Ac(o,s,h)&&!n.NG(t,o,h)},n.JV=function(t,i,h){var s=new e.l,o=new e.l;if(t.A(s),i.A(o),o.da()<=h&&o.S()<=h)return o=i.Kp(),n.Uz(t,o,h);if(o.da()<=h||o.S()<=h)return o=new e.Ua,s=new e.Ta,i.If(0,s),o.nf(s),i.If(2,s),o.lineTo(s),n.II(t,o,h);t=t.Ha(),i=new e.l,s=new e.l,i.L(o),s.L(o),i.X(-h,-h),s.X(h,h),o=!1;for(var a=new e.l,u=new e.l;t.ab();)for(;t.Ia();){if(t.ia().A(a),u.L(i),u.Fa(a),!u.B()&&(u.da()>h||u.S()>h))return!1;u.L(s),u.Fa(a),u.B()||(o=!0)}return o},n.GV=function(t,i,h){var s=new e.l,o=new e.l;return t.A(s),i.A(o),!(n.Ac(s,o,h)||n.Ac(o,s,h)||n.Ac(o,s,h)||o.da()>h&&o.S()>h||o.da()<=h&&o.S()<=h)&&(s=new e.Ua,o=new e.Ta,i.If(0,o),s.nf(o),i.If(2,o),s.lineTo(o),n.QG(t,s,h))},n.MV=function(t,i,h){var s=new e.l,o=new e.l;if(t.A(s),i.A(o),!n.Ac(o,s,h)||o.da()<=h&&o.S()<=h)return!1;if(o.da()<=h||o.S()<=h)return n.Ac(o,s,h);t=t.Ha(),(i=new e.l).L(o),i.X(-h,-h),o=!1,s=new e.l;for(var a=new e.l;t.ab();)for(;t.Ia();)t.ia().A(s),i.jm(s)?o=!0:(a.L(i),a.Fa(s),!a.B()&&(a.da()>h||a.S()>h)&&(o=!0));return o},n.tV=function(t,i,h){var s=new e.l,o=new e.l;return i.A(o),t.A(s),!(!n.Ac(s,o,h)||o.da()>h&&o.S()>h)&&(o.da()<=h&&o.S()<=h?(i=i.Kp(),n.MG(t,i,h)):(s=new e.Ua,o=new e.Ta,i.If(0,o),s.nf(o),i.If(2,o),s.lineTo(o),n.Am(s,t,h,!1)))},n.wV=function(t,i,h){var s=new e.l,o=new e.l;if(t.A(s),i.A(o),n.Ac(o,s,h)||o.da()<=h&&o.S()<=h)return!1;if(o.da()<=h||o.S()<=h)return s=new e.Ua,o=new e.Ta,i.If(0,o),s.nf(o),i.If(2,o),s.lineTo(o),n.GI(t,s,h);t=t.Ha(),i=new e.l,(s=new e.l).L(o),i.L(o),s.X(-h,-h),i.X(h,h);for(var a=o=!1,u=new e.l,c=new e.l;t.ab();)for(;t.Ia();)if(t.ia().A(u),a||i.contains(u)||(a=!0),o||(c.L(s),c.Fa(u),!c.B()&&(c.da()>h||c.S()>h)&&(o=!0)),o&&a)return!0;return!1},n.dU=function(t,i,h){var s=new e.l,o=new e.l;return t.A(s),i.A(o),!!n.gk(s,o,h)&&(!!n.eU(t,i,h)||n.TA(t,i,h,!1,!0,!1))},n.bU=function(t,i,h){return!n.bI(t,i,h)},n.jU=function(t,i,h){return n.TA(t,i,h,!1,!1,!0)},n.$H=function(t,i,h){var s=new e.l,o=new e.l;return t.A(s),i.A(o),!!n.Ac(s,o,h)&&n.TA(i,t,h,!0,!1,!1)},n.Ow=function(t,i,h){h*=h;for(var s=new e.h,o=new e.h,a=0;ah||o.S()>h)&&n.gk(s,o,h)},n.aU=function(t,i,h){var s=new e.l,o=new e.l;if(t.A(s),i.A(o),n.Ac(o,s,h))return!1;for((i=new e.l).L(o),i.X(h,h),h=new e.h,o=0;oh?a.X(0,-h):a.X(-h,0);for(var c=0;ch){if(i.y>a.G&&i.ya.v&&i.xh?s.X(0,-h):s.X(-h,0),a.X(h,h);for(var u=new e.h,c=0;ch?u.y>s.G&&u.ys.v&&u.xh||o.S()>h)&&(i=i.Kp(),!n.lt(t,i,h))},n.$T=function(t,i,h){var s=new e.l,o=new e.l;if(t.A(s),i.A(o),n.Ac(o,s,h)||o.da()<=h&&o.S()<=h)return!1;if(o.da()<=h||o.S()<=h){i=new e.l,s=new e.l,i.L(o),o.da()>h?i.X(0,-h):i.X(-h,0),s.L(o),s.X(h,h);for(var a=new e.h,u=!1,c=!1,l=0;lh?a.y>i.G&&a.yi.v&&a.xh*h},n.pI=function(t,i,h){return n.rI(t,i,h)},n.qI=function(t,i,h){var s=new e.l;return s.L(t),n.gk(s,i,h)},n.Tw=function(t,i,h){var s=new e.l;return s.L(i),s.X(h,h),!s.contains(t)},n.ZA=function(t,i,h){if(i.da()<=h&&i.S()<=h)return!1;var s=new e.l,o=new e.l;if(s.L(i),s.X(h,h),!s.contains(t))return!1;if(i.da()<=h||i.S()<=h){if(o.L(i),i.da()>h?o.X(0,-h):o.X(-h,0),i.da()>h){if(t.y>o.G&&t.yo.v&&t.xh?s.X(0,-h):s.X(-h,0);var o=!1;return i.da()>h?t.y>s.G&&t.ys.v&&t.xh&&t.S()>h&&(i.da()<=h||i.S()<=h)?s=i:(s=t,t=i),s.da()<=h||s.S()<=h){if(t.da()<=h||t.S()<=h){i=new e.zb;var o=new e.zb,a=[0,0],u=[0,0],c=new e.h;return s.fn(c),i.Ec(c),s.gn(c),i.Rc(c),t.fn(c),o.Ec(c),t.gn(c),o.Rc(c),i.Fa(o,null,a,u,h),i.Fa(o,null,null,null,h)==1&&(a[0]==0||a[1]==1||u[0]==0||u[1]==1)}return i=new e.l,o=new e.l,i.L(t),i.X(-h,-h),o.L(i),o.Fa(s),!(!o.B()&&(o.da()>h||o.S()>h))}return t.X(h,h),(o=new e.l).L(s),o.Fa(t),!(o.B()||!o.B()&&o.da()>h&&o.S()>h)},n.XP=function(t,i,h){if(n.Ac(t,i,h)||n.Ac(i,t,h)||t.da()<=h&&t.S()<=h||i.da()<=h&&i.S()<=h)return!1;if(t.da()<=h||t.S()<=h){if(i.da()>h&&i.S()>h)return!1;var s=new e.zb,o=new e.zb,a=[0,0],u=[0,0],c=new e.h;return t.fn(c),s.Ec(c),t.gn(c),s.Rc(c),i.fn(c),o.Ec(c),i.gn(c),o.Rc(c),s.Fa(o,null,a,u,h),s.Fa(o,null,null,null,h)==2&&(0a[1])&&(0u[1])}return!(i.da()<=h||i.S()<=h)&&((s=new e.l).L(t),s.Fa(i),!(s.B()||s.da()<=h||s.S()<=h))},n.eF=function(t,i,h){if(!n.Ac(t,i,h))return!1;if(t.da()<=h&&t.S()<=h)return t=t.tf(),n.$A(t,i,h);if(i.da()<=h&&i.S()<=h)return i=i.tf(),n.$A(i,t,h);if(t.da()<=h||t.S()<=h)return n.Ac(t,i,h);if(i.da()<=h||i.S()<=h){var s=new e.l;return s.L(t),s.X(-h,-h),s.jm(i)?!0:((t=new e.l).L(s),t.Fa(i),!(t.B()||t.da()<=h&&t.S()<=h))}return n.Ac(t,i,h)},n.WP=function(t,i,h){if(n.Ac(t,i,h)||n.Ac(i,t,h)||t.da()<=h&&t.S()<=h||i.da()<=h&&i.S()<=h||i.da()>h&&i.S()>h&&t.da()>h&&t.S()>h)return!1;if(t.da()>h&&t.S()>h)var s=i;else s=t,t=i;if(t.da()>h&&t.S()>h){i=new e.l;var o=new e.l;return o.L(t),o.X(-h,-h),i.L(o),i.Fa(s),!(i.B()||i.da()<=h&&i.S()<=h)}i=new e.zb,o=new e.zb;var a=[0,0],u=[0,0],c=new e.h;return s.fn(c),i.Ec(c),s.gn(c),i.Rc(c),t.fn(c),o.Ec(c),t.gn(c),o.Rc(c),i.Fa(o,null,a,u,h),i.Fa(o,null,null,null,h)==1&&0a[1]&&0u[1]},n.zI=function(t,i,h){var s=new e.l,o=new e.l,a=new e.am(t,i,h,!0);if(!a.next())return!0;if(this.OG(t,i,h))return!1;var u=t,c=null;i.K()==1736&&(c=i);var l=!1,p=!1;do{var v=a.pl(),b=a.jl();if(b=i.Oa(i.Ca(b)),s.L(a.oz()),s.X(h,h),s.contains(b)&&(b=e.jd.Zd(u,b,0))!=0||i.K()==1736&&(v=t.Oa(t.Ca(v)),o.L(a.Wy()),o.X(h,h),o.contains(v)&&(b=e.jd.Zd(c,v,0))!=0))return!1;l||(!e.Fg.Ol(t,i.ea()-1)||t.Cb!=null&&t.Cb.Gb!=null?u=t:(u=new e.Ea,t.copyTo(u),u.hj(1)),l=!0),i.K()!=1736||p||(p=i,!e.Fg.Ol(p,t.ea()-1)||i.Cb!=null&&i.Cb.Gb!=null?c=i:(c=new e.Ea,p.copyTo(c),c.hj(1)),p=!0)}while(a.next());return!0},n.Ac=function(t,i,h){var s=new e.l;return s.L(t),s.X(h,h),s.contains(i)},n.ns=function(t,i,h){var s=new e.l;return s.L(i),s.X(h,h),i=new e.h,t.fn(i),!s.contains(i)||(t.VI(i),!s.contains(i)||(t.YI(i),!s.contains(i)||(t.gn(i),!s.contains(i))))},n.ZH=function(t,i,h){if(t.ea()!=i.ea()||t.I()!=i.I())return!1;var s=new e.h,o=new e.h,a=!0;h*=h;for(var u=0;uh){a=!1;break}if(!a)break}return!!a},n.eU=function(t,i,h){if(t.I()!=i.I())return!1;var s=new e.h,o=new e.h,a=!0;h*=h;for(var u=0;uh){a=!1;break}return!!a},n.TA=function(t,i,h,s,o,a){var u=!1;if(t.I()>i.I()){s&&(s=!1,u=!0);var c=i}else c=t,t=i;if(i=null,o||a||u){i=new e.rn(t.I());for(var l=0;li.I())var s=i;else s=t,t=i;i=new e.l;var o=new e.l,a=new e.l;s.A(i),t.A(o),i.X(h,h),o.X(h,h),a.L(i),a.Fa(o),o=new e.h;for(var u=new e.h,c=h*h,l=e.ua.jE(t,a),p=l.getIterator(),v=0;vh)return!1;if(w*(1-(M=a.Ui))<=h||M==1)break}if(w*(1-M)>h)return!1;p=0,v.resize(0),b.th.length=0}}return u},n.QG=function(t,i,h){if(1>n.Sz(t,i,h,null))return!1;var s=new e.l,o=new e.l;t.A(s),i.A(o);var a=n.ns(s,o,h);return s=n.ns(o,s,h),!(!a||!s)||(a&&!s?!n.Am(i,t,h,!1):s&&!a?!n.Am(t,i,h,!1):!n.Am(t,i,h,!1)&&!n.Am(i,t,h,!1))},n.Sz=function(t,i,h,s){function o(H,U){return d.LE(H,U)}if(t.sz()>i.sz())var a=i,u=t;else a=t,u=i;t=a.Ha(),i=u.Ha();var c=[0,0],l=[0,0],p=-1,v=0,b=new e.ja(0),d=new n,g=new e.l,x=new e.l,m=new e.l;a.A(g),u.A(x),g.X(h,h),x.X(h,h),m.L(g),m.Fa(x),a=null,s!=null&&(a=new e.h);var w=x=x=null,j=u.Cb;for(j!=null?(x=j.Gb,w=j.Bo,x==null&&(x=e.ua.lj(u,m))):x=e.ua.lj(u,m),u=x.getIterator(),j=null,w!=null&&(j=w.getIterator());t.ab();)for(w=0;t.Ia();){var M=t.ia();if(M.A(g),g.isIntersecting(m)){if(j!=null&&(j.Zi(g,h),j.next()==-1))continue;var A=M.Rb();u.Wo(M,h);for(var z=u.next();z!=-1;z=u.next()){var N=x.ka(z);i.Wb(N);var I=i.ia(),D=I.Rb(),P=M.Fa(I,null,c,l,h);if(0h)return 1;var S=A*(B-z);if(i.Ia()){if(I=i.ia(),(P=M.Fa(I,null,c,null,h))==2){P=c[0];var F=c[1];if(S+(P=A*(F-P))>h)return 1}i.Wb(N),i.ia()}if(!i.xm()){if(i.ni(),I=i.ni(),(P=M.Fa(I,null,c,null,h))==2&&(P=c[0],S+(P=A*((F=c[1])-P))>h))return 1;i.Wb(N),i.ia()}if(t.Ia()){if(N=t.xb(),(P=(M=t.ia()).Fa(I,null,c,null,h))==2&&(P=c[0],S+(P=A*((F=c[1])-P))>h))return 1;t.Wb(N),t.ia()}if(!t.xm()){if(N=t.xb(),t.ni(),(P=(M=t.ni()).Fa(I,null,c,null,h))==2&&(P=c[0],S+(P=D*((F=c[1])-P))>h))return 1;t.Wb(N),t.ia()}I=f.construct(t.xb(),t.gb,z,B,i.xb(),i.gb,p,C),d.th.push(I),b.add(b.size)}p=0,s!=null&&(M.ic(z,a),s.add(a.x),s.add(a.y))}}if(vh)w=A*(I.Ui-I.Mj),M=I.Ui,z=I.Om;else{if(I.Om!=z?(w=A*(I.Ui-I.Mj),z=I.Om):w+=A*(I.Ui-I.Mj),w>h)return 1;if((M=I.Ui)==1)break}A*(1-M)>h&&(w=0),v=0,b.resize(0),d.th.length=0}}}return p},n.OG=function(t,i,h){var s=t.Ha(),o=i.Ha();for(t=new e.am(t,i,h,!1);t.next();){i=t.pl();var a=t.jl();if(s.Wb(i),o.Wb(a),i=s.ia(),0h)return!1;v=!0}else if(d!=0){if(v=c[0],b=l[0],0v&&0b)return!1;v=!0}}return!!v&&(a=new e.l,u=new e.l,o=new e.l,t.A(a),i.A(u),a.X(1e3*h,1e3*h),u.X(1e3*h,1e3*h),o.L(a),o.Fa(u),!(10h&&(l=!0,p&&v))return!0}else if(w!=0&&(w=g[0],j=x[0],0w&&0j))return!0}if(o=new e.l,b=new e.l,o.L(a),o.X(1e3*h,1e3*h),b.L(u),b.X(1e3*h,1e3*h),c.L(o),c.Fa(b),a="",a=l?a+"**":a+"T*",p){if(10v&&0b)))return s[0]=!0,!1}if(!p){for(s[0]=!0,u=new e.l,t.A(u),u.X(h,h),l=t,p=!1,c=new e.l,s=0,o=i.ea();sp&&0v)return!1;p=!0}}return!!p&&(a=new e.l,u=new e.l,o=new e.l,t.A(a),i.A(u),a.X(1e3*h,1e3*h),u.X(1e3*h,1e3*h),o.L(a),o.Fa(u),!(10p&&0v)return!0;p=!0}}return!!p&&(a=new e.l,u=new e.l,c=new e.l,l=new e.l,o=new e.l,t.A(a),i.A(u),n.ns(u,a,h)?(c.L(a),c.X(1e3*h,1e3*h),l.L(u),l.X(1e3*h,1e3*h),o.L(c),o.Fa(l),!(10a;a++){var u=s.charAt(a);if(u!="*"&&u!="T"&&u!="F"&&u!="0"&&u!="1"&&u!="2")throw e.i.ga("relation string")}if((a=this.HR(s,t.Eb(),i.Eb()))!=0)return e.vd.uB(t,i,h,a,o);a=new e.l,t.A(a),u=new e.l,i.A(u);var c=new e.l;if(c.L(a),c.$b(u),h=e.ua.Xd(h,c,!1),t=this.RE(t,h),i=this.RE(i,h),t.B()||i.B())return this.pW(t,i,s);switch(a=i.K(),u=!1,t.K()){case 1736:switch(a){case 1736:u=this.st(t,i,h,s,o);break;case 1607:u=this.bn(t,i,h,s,o);break;case 33:u=this.rt(t,i,h,s);break;case 550:u=this.qt(t,i,h,s,o)}break;case 1607:switch(a){case 1736:u=this.bn(i,t,h,this.aq(s),o);break;case 1607:u=this.bB(t,i,h,s,o);break;case 33:u=this.ut(t,i,h,s,o);break;case 550:u=this.tt(t,i,h,s,o)}break;case 33:switch(a){case 1736:u=this.rt(i,t,h,this.aq(s));break;case 1607:u=this.ut(i,t,h,this.aq(s),o);break;case 33:u=this.VU(t,i,h,s);break;case 550:u=this.mt(i,t,h,this.aq(s))}break;case 550:switch(a){case 1736:u=this.qt(i,t,h,this.aq(s),o);break;case 1607:u=this.tt(i,t,h,this.aq(s),o);break;case 550:u=this.UA(t,i,h,s,o);break;case 33:u=this.mt(t,i,h,s)}break;default:u=!1}return u},n.st=function(t,i,h,s,o){var a=new n;a.$i(),a.dj(s),a.sJ();var u=new e.l,c=new e.l;return t.A(u),i.A(c),s=!1,e.vd.fk(u,c,h)&&(a.Eu(t,i),s=!0),s||((u=e.vd.rc(t,i,!1))==4?(a.Eu(t,i),s=!0):u==1?(a.hy(i),s=!0):u==2&&(a.UD(t),s=!0)),s||(t=(s=new e.hd).Ib(t),i=s.Ib(i),a.Yo(s,h,o),a.Dp(t,i),a.j.Wg()),n.hg(a.J,a.Yc)},n.Uw=function(t,i,h,s){var o=new n;o.$i(),o.dj("T*****F**"),o.sJ();var a=new e.l,u=new e.l;t.A(a),i.A(u);var c=!1;return e.vd.fk(a,u,h)&&(o.Eu(t,i),c=!0),c||((a=e.vd.rc(t,i,!1))==4?(o.Eu(t,i),c=!0):a==1?(o.hy(i),c=!0):a==2&&(o.UD(t),c=!0)),c?this.hg(o.J,o.Yc):(t=(c=new e.hd).Ib(t),a=c.Ib(i),e.Vk.W(c,h,s,!1),h=c.Ke(a).ng(),c.Ip(0,!0,!0),e.tn.W(c,t,-1,!1,s),c.I(t)!=0&&(e.tn.W(c,a,-1,!1,s),o.gr(c,s),(i=c.I(a)==0)||(o.Dp(t,a),o.j.Wg(),a=this.hg(o.J,o.Yc))?(t=c.Ke(t),t=(c=new e.hd).Ib(t),a=c.Ib(h),o.gr(c,s),o.me=0,o.$i(),o.dj(i?"T*****F**":"******F**"),o.DB(),o.Dp(t,a),o.j.Wg(),this.hg(o.J,o.Yc)):a))},n.bn=function(t,i,h,s,o){var a=new n;a.$i(),a.dj(s),a.DB();var u=new e.l,c=new e.l;return t.A(u),i.A(c),s=!1,e.vd.fk(u,c,h)&&(a.Fu(t,i),s=!0),s||((u=e.vd.rc(t,i,!1))==4?(a.Fu(t,i),s=!0):u==1&&(a.VD(i),s=!0)),s||(t=(s=new e.hd).Ib(t),i=s.Ib(i),a.Yo(s,h,o),a.mh=a.j.Fp(),n.Lw(i,a.j,a.mh),a.Dp(t,i),a.j.Gp(a.mh),a.j.Wg()),n.hg(a.J,a.Yc)},n.aB=function(t,i,h,s){var o=new n;o.$i(),o.dj("T*****F**"),o.DB();var a=new e.l,u=new e.l;t.A(a),i.A(u);var c=!1;return e.vd.fk(a,u,h)&&(o.Fu(t,i),c=!0),c||((a=e.vd.rc(t,i,!1))==4?(o.Fu(t,i),c=!0):a==1&&(o.VD(i),c=!0)),c?this.hg(o.J,o.Yc):(t=(c=new e.hd).Ib(t),i=c.Ib(i),o.Yo(c,h,s),c.I(t)!=0&&(o.Dp(t,i),o.j.Wg(),this.hg(o.J,o.Yc)))},n.qt=function(t,i,h,s,o){var a=new n;a.$i(),a.dj(s),a.tJ();var u=new e.l,c=new e.l;return t.A(u),i.A(c),s=!1,e.vd.fk(u,c,h)&&(a.Gu(t),s=!0),s||((u=e.vd.rc(t,i,!1))==4?(a.Gu(t),s=!0):u==1&&(a.uN(),s=!0)),s||(t=(s=new e.hd).Ib(t),i=s.Ib(i),a.Yo(s,h,o),a.By(t,i),a.j.Wg()),n.hg(a.J,a.Yc)},n.bB=function(t,i,h,s,o){var a=new n;a.$i(),a.dj(s),a.$W(),s=new e.l;var u=new e.l;t.A(s),i.A(u);var c=!1;return e.vd.fk(s,u,h)&&(a.KG(t,i),c=!0),c||e.vd.rc(t,i,!1)!=4||(a.KG(t,i),c=!0),c||(t=(s=new e.hd).Ib(t),i=s.Ib(i),a.Yo(s,h,o),a.$h=a.j.Fp(),a.mh=a.j.Fp(),n.Lw(t,a.j,a.$h),n.Lw(i,a.j,a.mh),a.Dp(t,i),a.j.Gp(a.$h),a.j.Gp(a.mh),a.j.Wg()),n.hg(a.J,a.Yc)},n.tt=function(t,i,h,s,o){var a=new n;a.$i(),a.dj(s),a.HJ(),s=new e.l;var u=new e.l;t.A(s),i.A(u);var c=!1;return e.vd.fk(s,u,h)&&(a.Qz(t),c=!0),c||e.vd.rc(t,i,!1)!=4||(a.Qz(t),c=!0),c||(t=(s=new e.hd).Ib(t),i=s.Ib(i),a.Yo(s,h,o),a.$h=a.j.Fp(),n.Lw(t,a.j,a.$h),a.By(t,i),a.j.Gp(a.$h),a.j.Wg()),n.hg(a.J,a.Yc)},n.UA=function(t,i,h,s,o){var a=new n;a.$i(),a.dj(s),a.MJ(),s=new e.l;var u=new e.l;t.A(s),i.A(u);var c=!1;return e.vd.fk(s,u,h)&&(a.tI(),c=!0),c||(t=(s=new e.hd).Ib(t),i=s.Ib(i),a.Yo(s,h,o),a.By(t,i),a.j.Wg()),n.hg(a.J,a.Yc)},n.rt=function(t,i,h,s){var o=new n;o.$i(),o.dj(s),o.tJ();var a=new e.l;t.A(a),i=i.D();var u=!1;return e.vd.Tw(i,a,h)&&(o.Gu(t),u=!0),u||((h=e.jd.Zd(t,i,h))==1?(o.J[0]=0,o.J[2]=2,o.J[3]=-1,o.J[5]=1,o.J[6]=-1):h==2?(o.J[6]=-1,t.He()!=0?(o.J[0]=-1,o.J[3]=0,o.J[2]=2,o.J[5]=1):(o.J[0]=0,o.J[3]=-1,o.J[5]=-1,h=new e.l,t.A(h),o.J[2]=h.da()==0&&h.S()==0?-1:1)):o.Gu(t)),this.hg(o.J,s)},n.ut=function(t,i,h,s,o){var a=new n;a.$i(),a.dj(s),a.HJ();var u=new e.l;t.A(u),s=i.D();var c=!1;if(e.vd.Tw(s,u,h)&&(a.Qz(t),c=!0),!c){u=null;var l=c=!1;(a.fa[0]||a.fa[6])&&(e.vd.Tz(t,s,h)?(a.fa[0]&&(u=e.si.im(t,o),l=!e.vd.lt(u,s,h),c=!0,a.J[0]=l?-1:0),a.J[6]=-1):(a.J[0]=-1,a.J[6]=0)),a.fa[3]&&(u!=null&&u.B()?a.J[3]=-1:(c||(u==null&&(u=e.si.im(t,o)),l=!e.vd.lt(u,s,h),c=!0),a.J[3]=l?0:-1)),a.fa[5]&&(u!=null&&u.B()?a.J[5]=-1:c&&!l?a.J[5]=0:(u==null&&(u=e.si.im(t,o)),o=e.vd.Pw(u,i,h),a.J[5]=o?-1:0)),a.fa[2]&&(t.Rb()!=0?a.J[2]=1:((o=new e.ee(t.description)).Gd(t,0,t.I()),t=e.vd.Pw(o,i,h),a.J[2]=t?-1:0))}return this.hg(a.J,a.Yc)},n.mt=function(t,i,h,s){var o=new n;o.$i(),o.dj(s),o.MJ();var a=new e.l;t.A(a),i=i.D();var u=!1;if(e.vd.Tw(i,a,h)&&(o.tI(),u=!0),!u){a=!1,u=!0,h*=h;for(var c=0;ca;a++)o[a]=-1;return e.h.zc(t,i)<=h*h?o[0]=0:(o[2]=0,o[6]=0),o[8]=2,n.hg(o,s)},n.hg=function(t,i){for(var h=0;9>h;h++)switch(i.charAt(h)){case"T":if(t[h]==-1)return!1;break;case"F":if(t[h]!=-1)return!1;break;case"0":if(t[h]!=0)return!1;break;case"1":if(t[h]!=1)return!1;break;case"2":if(t[h]!=2)return!1}return!0},n.pW=function(t,i,h){var s=[-1,-1,-1,-1,-1,-1,-1,-1,-1];if(t.B()&&i.B()){for(var o=0;9>o;o++)s[o]=-1;return this.hg(s,h)}return o=!1,t.B()&&(t=i,o=!0),s[0]=-1,s[1]=-1,s[3]=-1,s[4]=-1,s[6]=-1,s[7]=-1,s[8]=2,i=t.K(),e.ba.Ic(i)?i==1736?t.He()!=0?(s[2]=2,s[5]=1):(s[5]=-1,i=new e.l,t.A(i),s[2]=i.da()==0&&i.S()==0?0:1):(i=t.Rb()!=0,s[2]=i?1:0,s[5]=e.si.cq(t)?0:-1):(s[2]=0,s[5]=-1),o&&this.qK(s),this.hg(s,h)},n.HR=function(t,i,h){return n.ZP(t)?3:n.PP(t)?4:n.ZX(t,i,h)?8:n.xP(t,i,h)?16:n.$O(t)?1:n.zU(t,i,h)?32:0},n.ZP=function(t){return t.charAt(0)=="T"&&t.charAt(1)=="*"&&t.charAt(2)=="F"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="F"&&t.charAt(6)=="F"&&t.charAt(7)=="F"&&t.charAt(8)=="*"},n.PP=function(t){return t.charAt(0)=="F"&&t.charAt(1)=="F"&&t.charAt(2)=="*"&&t.charAt(3)=="F"&&t.charAt(4)=="F"&&t.charAt(5)=="*"&&t.charAt(6)=="*"&&t.charAt(7)=="*"&&t.charAt(8)=="*"},n.ZX=function(t,i,h){return(i!=0||h!=0)&&((i!=2||h!=2)&&(t.charAt(0)=="F"&&t.charAt(1)=="*"&&t.charAt(2)=="*"&&t.charAt(3)=="T"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="*"&&t.charAt(7)=="*"&&t.charAt(8)=="*"||i==1&&h==1&&t.charAt(0)=="F"&&t.charAt(1)=="T"&&t.charAt(2)=="*"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="*"&&t.charAt(7)=="*"&&t.charAt(8)=="*")||h!=0&&t.charAt(0)=="F"&&t.charAt(1)=="*"&&t.charAt(2)=="*"&&t.charAt(3)=="*"&&t.charAt(4)=="T"&&t.charAt(5)=="*"&&t.charAt(6)=="*"&&t.charAt(7)=="*"&&t.charAt(8)=="*")},n.xP=function(t,i,h){return i>h?t.charAt(0)=="T"&&t.charAt(1)=="*"&&t.charAt(2)=="*"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="T"&&t.charAt(7)=="*"&&t.charAt(8)=="*":i==1&&h==1&&t.charAt(0)=="0"&&t.charAt(1)=="*"&&t.charAt(2)=="*"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="*"&&t.charAt(7)=="*"&&t.charAt(8)=="*"},n.$O=function(t){return t.charAt(0)=="T"&&t.charAt(1)=="*"&&t.charAt(2)=="*"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="F"&&t.charAt(7)=="F"&&t.charAt(8)=="*"},n.zU=function(t,i,h){if(i==h){if(i!=1)return t.charAt(0)=="T"&&t.charAt(1)=="*"&&t.charAt(2)=="T"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="T"&&t.charAt(7)=="*"&&t.charAt(8)=="*";if(t.charAt(0)=="1"&&t.charAt(1)=="*"&&t.charAt(2)=="T"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="T"&&t.charAt(7)=="*"&&t.charAt(8)=="*")return!0}return!1},n.Lw=function(t,i,h){t=i.Ma(t);for(var s=i.Oe;s!=-1;s=i.Tf(s))if(i.yd(s)&t){var o=i.Je(s);if(o==-1)i.pn(s,h,0);else{var a=o,u=0;do i.fh(a)&t&&u++,a=i.kc(i.ya(a));while(a!=o);i.pn(s,h,u)}}},n.aq=function(t){var i=""+t.charAt(0);return i+=t.charAt(3),i+=t.charAt(6),i+=t.charAt(1),i+=t.charAt(4),i+=t.charAt(7),i+=t.charAt(2),(i+=t.charAt(5))+t.charAt(8)},n.prototype.$i=function(){for(var t=0;9>t;t++)this.J[t]=-2,this.$a[t]=-2},n.qK=function(t){var i=t[1],h=t[2],s=t[5];t[1]=t[3],t[2]=t[6],t[5]=t[7],t[3]=i,t[6]=h,t[7]=s},n.prototype.dj=function(t){for(this.Yc=t,t=0;9>t;t++)this.Yc.charAt(t)!="*"?(this.fa[t]=!0,this.me++):this.fa[t]=!1},n.prototype.PJ=function(){for(var t=0;9>t;t++)this.fa[t]&&this.J[t]==-2&&(this.J[t]=-1,this.fa[t]=!1)},n.prototype.qc=function(t){return this.J[t]!=-2&&(this.J[t]==-1?(this.fa[t]=!1,this.me--,!0):this.Yc.charAt(t)!="T"&&this.Yc.charAt(t)!="F"?!(this.J[t]a?1:0},n.prototype.reset=function(){this.tA=-1},n}(),r=function(){function n(){this.Ym=this.Il=null,this.fb=new e.$j,this.fb.MP(),this.ae=new f(this),this.fb.Xo(this.ae)}return n.prototype.CQ=function(){var t=!1;if(this.hw&&(t=this.DQ()),this.g.ea(this.Y)==1){var i=this.g.Ob(this.Y);return t=this.g.qz(i),this.g.KB(i,!0),0>t&&(t=this.g.Ya(i),this.g.kJ(t),this.g.Yg(i,this.g.Na(t)),!0)}for(this.Gl=this.g.Fy(),this.yo=this.g.Fy(),i=this.g.Ob(this.Y);i!=-1;i=this.g.Sb(i))this.g.ir(i,this.Gl,0),this.g.ir(i,this.yo,-1);i=new e.ja(0),this.Ah=NaN;var h=new e.h;this.ft=this.g.ea(this.Y),this.to=this.g.Hd(),this.Ts=this.g.Hd();for(var s=this.Il.sc(this.Il.ke);s!=-1;s=this.Il.lb(s)){var o=this.Il.getData(s);if(this.g.Hc(o,h),h.y!=this.Ah&&i.size!=0&&(t=this.vt(i)||t,this.ae.reset(),i.clear(!1)),i.add(o),this.Ah=h.y,this.ft==0)break}for(0=this.HA.length&&this.HA.push(new e.jg);var n=this.HA[this.Ew];return this.Ew++,n},r.prototype.clear=function(){this.rB(this.oo),this.rB(this.bt),this.rB(this.Aw),this.Ew=0},r.prototype.Qo=function(n){this.oo.push(this.Qw(n))},r.prototype.ql=function(n){return n==0?this.bt.length:this.Aw.length},r.prototype.Xp=function(n,t){return this.NR(n,t).bj},r.prototype.Fa=function(n,t){if(this.oo.length!=2)throw e.i.Ra();this.ra=n;var i=e.mc.ox(.01*n),h=!1,s=this.oo[0],o=this.oo[1];if(t||5&s.bj.Br(o.bj,n,!0)){if(s.bj.K()==322){var a=s.bj;if(o.bj.K()==322){t=o.bj;var u=e.zb.Yx(a,t,null,this.Hq,this.Dk,n);if(u==0)throw e.zb.Yx(a,t,null,this.Hq,this.Dk,n),e.i.Ra();n=Array(9),e.P.bv(n,null);for(var c=0;ci&&(h=!0)):v>d?(a.ic(l,x),l=new e.h,t.ic(p,l),e.h.zc(x,l)>i&&(h=!0)):(t.ic(p,x),v=new e.h,a.ic(l,v),e.h.zc(x,v)>i&&(h=!0)),n[c]=x}for(s=0,o=-1,c=0;c<=u;c++)(g=cthis.Dk[1]&&(g=this.Dk[0],this.Dk[0]=this.Dk[1],this.Dk[1]=g,c=a[0],a[0]=a[1],a[1]=c),s=0,o=-1,c=0;c<=u;c++)(g=c=o;o++){if((t=1>o?this.Hq[o]:1)!=i){var a=this.WA();n.dh(i,t,a),s!=-1&&a.get().Ec(h),o!=1&&a.get().Rc(h),i=t,this.bt.push(this.Qw(a.get()))}s=o}this.Cf.Db(h)}},r}();e.OC=f}(k||(k={})),function(e){var y=function(){function f(r){this.Fs=this.tk=this.tb=null,this.cg=0,this.Bm=!1,this.Af=-1,this.El=this.Kd=0,this.gb=-1,this.ib=r,this.cg=this.Vx(this.El),this.Bm=!1,this.tk=null,this.Fs=new e.h}return f.prototype.wW=function(r){if(this.ib!=r.ib)throw e.i.Hb();this.Af=r.Af,this.Kd=r.Kd,this.gb=r.gb,this.El=r.El,this.cg=r.cg,this.Bm=r.Bm,this.tk=null},f.prototype.ia=function(){if(this.Af!=this.Kd&&this.wD(),this.Bm)this.Kd=(this.Kd+1)%this.cg;else{if(this.Kd==this.cg)throw e.i.de();this.Kd++}return this.tk},f.prototype.ni=function(){if(this.Bm)this.Kd=(this.cg+this.Kd-1)%this.cg;else{if(this.Kd==0)throw e.i.de();this.Kd--}return this.Kd!=this.Af&&this.wD(),this.tk},f.prototype.xW=function(){this.Af=-1,this.Kd=0},f.prototype.yW=function(){this.Kd=this.cg,this.Af=-1},f.prototype.Wb=function(r,n){if(n===void 0&&(n=-1),0<=this.gb&&this.gb=t&&r=this.ib.Ca(n)&&r=this.ib.ea())&&(this.Af=-1,this.Kd=0,this.cg=this.Vx(this.gb),this.ib.Ca(this.gb),this.ib.ec(this.gb),this.El++,!0)},f.prototype.aj=function(){this.cg=this.Kd=this.Af=-1,this.El=0,this.gb=-1},f.prototype.Vx=function(r){if(this.ib.Bc())return 0;var n=1;return this.ib.ec(r)&&(n=0),this.ib.Ka(r)-n},f.prototype.Qn=function(){return this.Af==this.cg-1&&this.ib.ec(this.gb)},f.prototype.EB=function(){this.Bm=!0},f.prototype.xb=function(){return this.ib.nb.o[this.gb]+this.Af},f.prototype.DM=function(){return this.ib.Ca(this.gb)},f.prototype.kk=function(){return this.Qn()?this.ib.Ca(this.gb):this.xb()+1},f.prototype.xm=function(){return this.Af==0},f.prototype.Sn=function(){return this.Af==this.cg-1},f.prototype.Ia=function(){return this.Kdthis.Kd||this.Kd>=this.cg)throw e.i.de();this.Af=this.Kd;var r=this.xb();this.ib.oc();var n=this.ib.Se,t=1;switch(n!=null&&(t=7&n.read(r)),n=this.ib.description,t){case 1:this.tb==null&&(this.tb=new e.zb),this.tk=this.tb;break;case 2:throw e.i.ga("internal error");default:throw e.i.Ra()}this.tk.Pf(n),t=this.kk(),this.ib.Hc(r,this.Fs),this.tk.Ec(this.Fs),this.ib.Hc(t,this.Fs),this.tk.Rc(this.Fs);for(var i=1,h=n.Ba;ih&&(s=n,n=i,i=s,s=t,t=h,h=s,s=-1),!(0>h||t>=this.rl)){0>n&&0>i?i=n=-1:n>=this.ri&&i>=this.ri&&(i=n=this.ri);var o=(i-n)/(h-t);h>this.rl&&(i=o*((h=this.rl)-t)+n),0>t&&(n=o*(0-t)+n,t=0);var a=Math.max(this.ri+1,8388607);-8388607>n?(t=(0-n)/o+t,n=0):n>a&&(t=(this.ri-n)/o+t,n=this.ri),-8388607>i?h=(0-n)/o+t:i>a&&(h=(this.ri-n)/o+t),(t=e.P.truncate(t))!=(h=e.P.truncate(h))&&((i=new y).x=e.P.truncate(4294967296*n),i.y=t,i.H=h,i.RP=e.P.truncate(4294967296*o),i.dir=s,this.Yl==null&&(this.Yl=e.P.mg(this.rl,null)),i.next=this.Yl[i.y],this.Yl[i.y]=i,i.ythis.Mw&&(this.Mw=i.H),this.Vq++)}}},r.prototype.nN=function(){if(this.Lh!=null){for(var n=!1,t=null,i=this.Lh;i!=null;)if(i.y++,i.y==i.H){var h=i;i=i.next,t!=null?t.next=i:this.Lh=i,h.next=null}else i.x+=i.RP,t!=null&&t.x>i.x&&(n=!0),t=i,i=i.next;n&&(this.Lh=this.aK(this.Lh))}},r.prototype.gN=function(n){if(!(n>=this.rl)){var t=this.Yl[n];if(t!=null){this.Yl[n]=null,t=this.aK(t),this.Vq-=this.bK,n=this.Lh;for(var i=!0,h=t,s=null;n!=null&&h!=null;)n.x>h.x?(i&&(this.Lh=h),i=h.next,h.next=n,s!=null&&(s.next=h),s=h,h=i):(i=n.next,n.next=h,s!=null&&(s.next=n),s=n,n=i),i=!1;this.Lh==null&&(this.Lh=t)}}},r.$J=function(n,t){return 0>n?0:n>t?t:n},r.prototype.UP=function(){if(this.Lh!=null){for(var n=0,t=this.Lh,i=e.P.truncate(e.P.SG(t.x)),h=t.next;h!=null;h=h.next)if(n=this.fF?1^n:n+h.dir,h.x>t.x){var s=e.P.truncate(e.P.SG(h.x));n!=0&&(t=r.$J(i,this.ri),(i=r.$J(s,this.ri))>t&&tthis.Lf[1].x&&(n=this.Lf[0],this.Lf[0]=this.Lf[1],this.Lf[1]=n):r.vN(this.Lf,t,function(s,o){return s==o?0:s.xo.x?1:0}),n=this.Lf[0],this.Lf[0]=null,i=n,h=1;hthis.Yh.size)break;var u=this;for(this.ye.Wd(0,this.ye.size,function(c,l){return u.kM(c,l)}),t=0,i=this.ye.size;tg?1:xm?1:0)==0&&(x=(v=u[c*v+3])<(b=u[c*b+3])?-1:v==b?0:1),x}),this.Rq=this.g.Hd(),this.pe=new e.lp,this.MA=this.pe.Rh(0),this.pe.hn(t),h=0;hu;u++){for(c=v[u],l=t[u],p=u-1;0<=p&&v[p]>c;)v[p+1]=v[p],t[p+1]=t[p],p--;v[p+1]=c,t[p+1]=l}return v=0,t[0]!=0&&(v|=1),t[1]!=0&&(v|=2),t[2]!=0&&(v|=4),t[3]!=0&&(v|=8),(v==5||v==10)&&(r==n?r?(this.g.Cc(a,i),this.g.Dc(i,a),this.g.Cc(h,o),this.g.Dc(o,h)):(this.g.Dc(a,i),this.g.Cc(i,a),this.g.Dc(h,o),this.g.Cc(o,h)):r?(this.g.Dc(i,s),this.g.Cc(s,i),this.g.Dc(o,h),this.g.Cc(h,o)):(this.g.Cc(i,s),this.g.Dc(s,i),this.g.Cc(o,h),this.g.Dc(h,o)),!0)},f.prototype.oD=function(r,n,t,i,h,s){this.IY?this.QM():this.PM(r,n,t,i,h,s)},f.prototype.QM=function(){throw e.i.ga("not implemented.")},f.prototype.PM=function(r,n,t,i,h,s){if(r!=n)r?(this.g.Cc(t,h),this.g.Dc(h,t),this.g.Cc(s,i),this.g.Dc(i,s),this.xn(h,t),this.wi(h,!0),this.g.oi(h,!0),this.dk(t),this.xn(s,i),this.wi(s,!0),this.g.oi(s,!1)):(this.g.Cc(h,t),this.g.Dc(t,h),this.g.Cc(i,s),this.g.Dc(s,i),this.xn(h,t),this.wi(h,!0),this.g.oi(h,!1),this.dk(t),this.xn(s,i),this.wi(s,!0),this.g.oi(s,!0)),this.dk(i);else{var o=r?t:i,a=n?h:s;for(r=r?i:t,n=n?s:h,h=!1,this.g.Cc(o,a),this.g.Cc(a,o),this.g.Dc(r,n),this.g.Dc(n,r),s=n;s!=a;)t=this.g.Na(s),i=this.g.V(s),this.g.Dc(s,i),this.g.Cc(s,t),h=h||s==o,s=i;h||(t=this.g.Na(a),i=this.g.V(a),this.g.Dc(a,i),this.g.Cc(a,t)),this.xn(a,o),this.wi(a,!0),this.g.oi(a,!1),this.dk(o),this.xn(n,r),this.wi(n,!0),this.g.oi(n,!1),this.dk(r)}},f.prototype.YC=function(){for(var r=!1,n=this.g.Ob(this.Y);n!=-1;){for(var t=this.g.Ya(n),i=0,h=this.g.Ka(n);ithis.g.Ka(n)){for(r=this.g.Ya(n),i=0,h=this.g.Ka(n);i=n)throw e.i.O("Invalid or unsupported wkid: "+n);var t=new r;return t.fg=n,t},r.lP=function(n){if(n==null||n.length==0)throw e.i.O("Cannot create SpatialReference from null or empty text.");var t=new r;return t.yh=n,t},r.prototype.Nb=function(n){return this==n||n!=null&&this.constructor==n.constructor&&this.fg==n.fg&&(this.fg!=0||this.yh===n.yh)},r.prototype.toString=function(){return"[ tol: "+this.Mn()+"; wkid: "+this.Fc()+"; wkt: "+this.wz()+"]"},r.prototype.dc=function(){if(this.rp!=="")return this.rp;var n=this.toString();if(Array.prototype.reduce)return this.rp="S"+n.split("").reduce(function(h,s){return(h=(h<<5)-h+s.charCodeAt(0))&h},0);var t=0;if(n.length===0)return"";for(var i=0;i=n.length)throw e.i.O();var t=null;try{t=e.IC.fromString(n)}catch{t=null}return t==null?null:r.XC(t,!0)},r.prototype.ay=function(n){this.Ld=n,this.Go=this.Ld.Id()},r.prototype.cy=function(n){this.FH=n,this.NT=this.FH!=null?this.FH.Go:null},r.prototype.Xc=function(){return this.Tb()!=0&&this.Tb()!=3&&this.Ld.Xc()},r.prototype.DG=function(){return this.Tb()!=0&&(this.Tb()==3?this.Li.hk().Xc():this.Ld.Xc())},r.prototype.gh=function(){return this.Ld!=null?this.Ld.Re:null},r.prototype.rm=function(){return this.Ld.rm()},r.prototype.bf=function(){return this.Ld.bf()},r.prototype.jh=function(){return this.Ld!=null?this.Ld.uw:NaN},r.prototype.Wp=function(){return this.Ld.Wp()},r.prototype.Yr=function(){return this.Ld.Yr()},r.prototype.mk=function(){return this.Ld.mk()},r.prototype.fS=function(n){return e.JC.Ky(this.Ld,n.Ld)},r.prototype.ol=function(){return this.Ld.ol()},r.prototype.Xr=function(){return this.Ld.Xr()},r.prototype.Bi=function(){return this.Tb()==3?this.Li.hk().Bi():this.Ld.Bi()},r.prototype.ih=function(){if(!this.Xc())throw e.i.O("!isPannable()");var n=new e.l;return this.Ld.ih(n),n},r.prototype.Le=function(){if(!this.Xc())throw e.i.O("!isPannable()");return this.Ld.uo},r.prototype.CR=function(){if(!this.Xc())throw e.i.O("!isPannable()");var n=new e.l;return this.Ld.BR(n),n},r.prototype.rv=function(){if(!this.Xc())throw e.i.O("!isPannable()");return this.Ld.rv()},r.prototype.qv=function(){if(!this.Xc())throw e.i.O("!isPannable()");return this.Ld.qv()},r.prototype.Zr=function(){return this.Li!=null?this.Li.hk().Zr():this.Ld.Zr()},r.prototype.KQ=function(){return this.Ld.kv()},r.prototype.Sp=function(){return this.Go.getUnitFactor()},r.prototype.pz=function(n){return this.Jq.pz(n)},r.prototype.tc=function(){var n=this.Tb();if(n==1)return this;if(n==3)return this.Li.hk().tc();if(n==0||n===4)throw e.i.ga("invalid call");if(this.lw!==null)return this.lw;if((n=this.gh().getGeogcs())==null)throw e.i.Ra();return this.lw=r.XE(n,this.Jq.QF())},r.XE=function(n,t){if(n==null)throw e.i.O("null pointer.");var i=new r;return n=r.ou(n,!0),i.Jq.Wx(n,null,t),i.ay(n),i.cy(null),i.fg=n.cs(),i},r.prototype.Tb=function(){var n=this.gh();if(n!=null)switch(n.getType()){case e.Tc.PE_TYPE_GEOGCS:return 1;case e.Tc.PE_TYPE_PROJCS:return 2}return 4},r.prototype.kv=function(){return this.Ld.kv()},r.ou=function(n,t){var i=n.getCode();if(0>=i&&0<(i=e.qf.getCode(n))){if((n=e.qf.coordsys(i))==null)throw e.i.O("Text to wkid mapping had failed: "+i);return r.ou(n,t)}if(t&&0=i?n:e.qf.coordsys(i),n=new e.JC(n),r.gK[t]=n,0=n)throw e.i.O("Invalid or unsupported wkid: "+n);var t=r.qx[n];if(t!=null)return t;if((t=e.qf.coordsys(n))==null)throw e.i.O("Invalid or unsupported wkid: "+n);return(t=r.ou(t,!1)).cs()!=n&&(r.qx[n]=t),t},r.fM=function(n){if(n==null||n===void 0||n.length==0)throw e.i.O("Cannot create SpatialReference from null or empty text.");var t=null;try{t=e.qf.fromString(e.Tc.PE_TYPE_COORDSYS,n)}catch(i){throw e.i.O("Cannot create SpatialReference from text. "+i.message)}if(t===null)throw e.i.O("Cannot create SpatialReference from text. ");return r.ou(t,!0)},r.XC=function(n,t){var i,h=n.getCode();if(0>=h&&0<(h=e.qf.getCode(n))){if((h=e.qf.vertcs(h))===null)throw e.i.O();return r.XC(h,t)}if(t&&0=h||(i=e.qf.vertcs(h)),i===null)throw e.i.O();return i=new e.KL(i),r.hK[n]=i,0t&&(this.Rj=t/(h-this.Hm)),i=this.Im+i,(s=e.P.truncate((i-this.Im)*this.Rj))>t&&(this.Rj=t/(i-this.Im))}},n.prototype.WB=function(t){switch(t){case 0:this.Kk=void 0;case 1:this.Oq=void 0;case 2:this.Nq=void 0}},n.prototype.Mn=function(t){switch(t){case 0:return this.Kk;case 1:return this.Oq;case 2:return this.Nq}return 0},n.prototype.pz=function(t){if(this.Tm==y.FloatingPoint)return 0;switch(t){case 0:return 1/this.Rj;case 1:case 2:return 1/this.Ho;default:return 0}},n.prototype.toString=function(){var t="SRPD [m_toleranceXY: "+this.Kk.toString();return(t=(t=(t=(t=(t=(t=(t=(t=(t=t+";m_falseX: "+this.Hm.toString())+";m_falseY: "+this.Im.toString())+";m_unitsXY: "+this.Rj.toString())+";m_falseZ: "+this.nA.toString())+";m_unitsZ: "+this.Ho.toString())+";m_falseM: "+this.mA.toString())+";m_toleranceZ: "+this.Oq.toString())+";m_toleranceM: "+this.Nq.toString())+";m_precision: "+this.Tm.toString())+"] "},n}();e.UL=r}(k||(k={})),function(e){function y(h,s){return 89.99999s&&(s=-89.99999),s*=.017453292519943,[111319.49079327169*h,31890685e-1*Math.log((1+Math.sin(s))/(1-Math.sin(s)))]}function f(h,s,o){return h=h/6378137*57.29577951308232,o?[h,57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*s/6378137)))]:[h-360*Math.floor((h+180)/360),57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*s/6378137)))]}function r(h,s,o){var a=h.Qf();if(h.K()===33)s=s(a.Ng(),a.kh()),a.Db(s[0],s[1]);else if(h.K()===197){var u=s(h.gs(),h.js(),o);s=s(h.fs(),h.hs(),o),a.L(u[0],u[1],s[0],s[1])}else for(u=new e.h,h=0;ho&&(o=637.100877141506);for(var a,u=[],c=0;cthis.Jg&&this.yz(r)},f.prototype.sx=function(r,n){r*=this.Mf,n*=this.Mf;for(var t=0;tthis.ps.wa)return 1;s=h.oa==h.ma;var o=i.oa==i.ma;if(s||o){if(s&&o)return 0;if(h.oa==i.oa&&h.ta==i.ta)return s?1:-1;if(h.ma==i.ma&&h.qa==i.qa)return s?-1:1}return(s=h.Me(this.Ah,this.os.pa))==(o=i.Me(this.Ah,this.ps.pa))&&((o=.5*((s=Math.min(h.ma,i.ma))+this.Ah))==this.Ah&&(o=s),s=h.Me(o,this.os.pa),o=i.Me(o,this.ps.pa)),so?1:0},t.prototype.WJ=function(i){this.Ah=i},t}(),n=function(){function t(i){this.ib=i,this.RH=new e.jg,this.Cf=new e.h,this.rA=new e.Oc}return t.prototype.fX=function(i){this.Cf.N(i)},t.prototype.compare=function(i,h){return this.ib.kB(i.ka(h),this.RH),i=this.RH.get(),this.rA.L(i.ta,i.qa),this.Cf.xthis.rA.wa?1:(i=i.Me(this.Cf.y,this.Cf.x),this.Cf.xi?1:0)},t}();y=function(){function t(){this.cH=this.Fi=this.Ii=this.fA=this.$n=this.ze=this.Lc=this.lh=this.he=null,this.Io=this.yg=-1,this.bH=!0,this.kA=!1,this.gA=NaN,this.Pi=new e.Nd,this.XN=2147483647,this.WN=e.P.truncate(-2147483648),this.eg=this.be=this.Jl=this.Eq=this.Em=this.Dq=this.Qs=this.Oe=-1,this.xa=0}return t.prototype.ty=function(i){this.gA=i},t.prototype.$m=function(){this.he==null&&(this.he=new e.ad(8));var i=this.he.De();return this.he.T(i,1,0),i},t.prototype.qU=function(){this.Lc==null&&(this.Lc=new e.ad(8));var i=this.Lc.De();this.Lc.T(i,2,0),this.Lc.T(i,3,0);var h=this.Lc.De();return this.Lc.T(h,2,0),this.Lc.T(h,3,0),this.EJ(i,h),this.EJ(h,i),i},t.prototype.hI=function(){this.ze==null&&(this.ze=new e.ad(8));var i=this.ze.De();return this.ze.T(i,2,0),i},t.prototype.OW=function(i,h){this.he.T(i,7,h)},t.prototype.on=function(i,h){this.he.T(i,2,h)},t.prototype.NW=function(i,h){this.he.T(i,1,h)},t.prototype.gX=function(i,h){this.he.T(i,3,h)},t.prototype.dX=function(i,h){this.he.T(i,4,h)},t.prototype.er=function(i,h){this.he.T(i,5,h)},t.prototype.$Q=function(i){return this.he.U(i,5)},t.prototype.MW=function(i,h){this.he.T(i,6,h)},t.prototype.YM=function(i,h){this.MW(h,i)},t.prototype.DJ=function(i,h){this.Lc.T(i,1,h)},t.prototype.EJ=function(i,h){this.Lc.T(i,4,h)},t.prototype.Vl=function(i,h){this.Lc.T(i,5,h)},t.prototype.Ul=function(i,h){this.Lc.T(i,6,h)},t.prototype.VW=function(i,h){this.Lc.T(i,2,h)},t.prototype.cx=function(i,h){this.Lc.T(i,3,h)},t.prototype.GF=function(i){return this.Lc.U(i,3)},t.prototype.Ht=function(i,h){this.Lc.T(i,7,h)},t.prototype.zK=function(i,h){if(this.om(i)!=-1)for(h=h?-1:i,i=this.om(i);i!=-1;i=this.ls(i))this.g.Sa(this.vj(i),this.Eq,h)},t.prototype.xx=function(i,h){i!=-1&&(this.zK(i,h),this.zK(this.ya(i),h))},t.prototype.Et=function(i,h){this.ze.T(i,1,h)},t.prototype.Xg=function(i,h){this.ze.T(i,2,h)},t.prototype.ln=function(i,h){this.ze.T(i,3,h),this.IW(i,this.ZQ(h)),this.HW(h,i)},t.prototype.HW=function(i,h){this.ze.T(i,4,h)},t.prototype.IW=function(i,h){this.ze.T(i,5,h)},t.prototype.yJ=function(i,h){this.ze.T(i,6,h)},t.prototype.wJ=function(i,h){this.ze.T(i,7,h)},t.prototype.vJ=function(i,h){this.$n.write(i,h)},t.prototype.xJ=function(i,h){this.fA.write(i,h)},t.prototype.gY=function(i){var h=0,s=0,o=this.vF(i),a=new e.h,u=new e.h,c=new e.h;this.$r(o,a),u.N(a);var l=o;do this.nm(l,c),s+=e.h.ub(u,c),this.$e(this.ya(l))!=i&&(h+=(c.x-a.x-(u.x-a.x))*(c.y-a.y+(u.y-a.y))*.5),u.N(c),l=this.kc(l);while(l!=o);this.$n.write(i,h),this.fA.write(i,s)},t.prototype.KU=function(i,h){var s=new r(this),o=new e.$j;o.Ee(e.P.truncate(this.xa/2)),o.Xo(s);for(var a=new e.ja(0),u=this.bh(),c=null,l=0,p=new e.h,v=this.Oe;v!=-1;v=this.Tf(v)){if(!(255&++l)&&h!=null&&!h.progress(-1,-1))throw e.i.RC();var b=this.Je(v);if(b!=-1){if(a.Dh(0),!this.cY(o,u,a,b)){this.D(v,p),s.WJ(p.y);var d=b;do{var g=this.Bb(d,u);g!=-1&&(o.wd(g,-1),this.Kb(d,u,-2)),d=this.kc(this.ya(d))}while(b!=d);d=b;do(g=this.Bb(d,u))==-1&&(g=o.addElement(d,-1),a.add(g)),d=this.kc(this.ya(d));while(b!=d)}for(b=a.size-1;0<=b;b--)g=a.get(b),d=o.ka(g),this.Kb(this.ya(d),u,g),this.JU(o,g,i)}else this.Yy(v)==-1&&(c==null&&(c=new n(this)),this.D(v,p),c.fX(p),d=o.DW(c),b=this.Jl,d!=-1&&(g=o.ka(d),this.$e(g)==this.$e(this.ya(g))&&(g=this.JF(o,d)),g!=-1&&(b=this.$e(g))),this.YM(b,v))}this.Lg(u)},t.prototype.JU=function(i,h,s){var o=i.ka(h),a=this.$e(o);if(this.In(a)==-1){var u=this.JF(i,h),c=this.ya(o),l=this.$e(c);this.Mp(a),this.Mp(l);var p=this.In(a),v=this.In(l);if(u==-1&&p==-1&&(l==a?(this.ln(l,this.Jl),p=v=this.Jl):(v==-1&&(this.ln(l,this.Jl),v=this.Jl),this.ln(a,l),p=l)),u!=-1){var b=this.$e(u);v==-1&&(0>=this.Mp(b)?(v=this.In(b),this.ln(l,v)):(this.ln(l,b),v=b),l==a&&(p=v))}p==-1&&this.dY(a,l),s==0?this.eW(i,h,o,u,a,l):s==5?this.fW(i,h,o,c,a,l):s==4&&this.dW(o,u,a,l)}},t.prototype.eW=function(i,h,s,o,a,u){var c=this.jk(a);if(o!=-1){var l=this.jk(u),p=this.jk(this.$e(o));o=c&l&p,p^=p&this.fh(s),(p|=o)!=0&&(this.Xg(u,l|p),this.Xg(a,p|c),c=c||p)}for(h=i.lb(h);h!=-1&&(o=i.ka(h),s=this.$e(this.ya(o)),a=this.jk(s),u=this.fh(o),l=this.$e(o),o=a&(p=this.jk(l))&c,c^=c&u,(c|=o)!=0);h=i.lb(h))this.Xg(s,a|c),this.Xg(l,p|c)},t.prototype.fW=function(i,h,s,o,a,u){if(a!=u){s=this.Bb(s,this.eg),s+=this.Bb(o,this.eg),o=0;var c=new e.ja(0),l=new e.ja(0);l.add(0);for(var p=i.sc(-1);p!=h;p=i.lb(p)){var v=i.ka(p),b=this.ya(v),d=this.$e(v),g=this.$e(b);if(d!=g){if(v=this.Bb(v,this.eg),o+=v+=this.Bb(b,this.eg),b=!1,c.size!=0&&c.Gc()==g&&(l.Jf(),c.Jf(),b=!0),this.In(g)==-1)throw e.i.Ra();b&&this.In(g)==d||(l.add(o),c.add(d))}}o+=s,c.size!=0&&c.Gc()==u&&(l.Jf(),c.Jf()),o!=0?l.Gc()==0&&(i=this.g.md,i=this.Ma(i),this.Xg(a,i)):l.Gc()!=0&&(i=this.g.md,i=this.Ma(i),this.Xg(a,i))}},t.prototype.dW=function(i,h,s,o){var a=this.Ma(this.g.md);if(h==-1)this.Xg(o,this.Io),1&(i=this.Bb(i,this.yg))?this.Xg(s,a):this.Xg(s,this.Io);else{var u=this.jk(o);u==0?(u=this.jk(this.$e(h)),this.Xg(o,u),1&(i=this.Bb(i,this.yg))?this.Xg(s,u==a?this.Io:a):this.Xg(s,u)):1&(i=this.Bb(i,this.yg))?this.Xg(s,u==a?this.Io:a):this.Xg(s,u)}},t.prototype.cY=function(i,h,s,o){var a=o,u=-1,c=-1,l=0;do{if(l==2)return!1;var p=this.Bb(a,h);if(p!=-1){if(u!=-1)return!1;u=p}else{if(c!=-1)return!1;c=a}l++,a=this.kc(this.ya(a))}while(o!=a);return c!=-1&&u!=-1&&(this.Kb(i.ka(u),h,-2),i.Uj(u,c),s.add(u),!0)},t.prototype.dY=function(i,h){var s=this.Mp(i);if(s!=0){var o=this.Mp(h);0o||0>s&&0v.compare(a)?p=1:u=-1,this.Kb(d,this.be,0),this.Kb(b,this.be,0),this.Kb(b,this.eg,p),this.Kb(d,this.eg,u)):i==7?(this.Kb(d,this.be,this.Io),this.Kb(b,this.be,l==1736?c:0)):i==4&&(this.Kb(d,this.be,0),this.Kb(b,this.be,0),this.Kb(b,this.yg,1),this.Kb(d,this.yg,1)),l=l==1736?this.WN:0,this.cx(b,c|l),this.cx(d,c|l)}}}}},t.prototype.QT=function(i,h){var s=this.om(h);if(s!=-1){var o=this.om(i);this.lh.T(s,1,o),this.Ht(i,s),this.Ht(h,-1)}i=this.ya(i),h=this.ya(h),(s=this.om(h))!=-1&&(o=this.om(i),this.lh.T(s,1,o),this.Ht(i,s),this.Ht(h,-1))},t.prototype.EX=function(i){function h(M,A){return o.CO(M,A)}var s=new e.ja(0);s.Jb(10);for(var o=this,a=this.Oe;a!=-1;a=this.Tf(a)){s.clear(!1);var u=this.Je(a);if(u!=-1){var c=u;do s.add(c),c=this.kc(this.ya(c));while(c!=u);if(1n.Eb())return f.mi(f.Ue(n.Ja()),r,"&")}return s=new f,o=(h=new e.hd).Ib(f.Ue(r)),n=h.Ib(f.Ue(n)),s.Gt(h,t,i),i=s.Cv(o,n),r=f.mi(h.Ke(i),r,"&"),e.ba.Ic(r.K())&&(r.Eh(2,t),r.K()==1736&&r.hm()),r},f.XV=function(r,n,t){if(r.B()||n.B())return r.Ja();var i=[null],h=[0],s=n.Eb()==2;if(n.Eb()!=1&&n.Eb()!=2)throw e.i.Ra();return i[0]=r.D(),s?e.jd.nK(n,i,1,t,h):e.jd.oK(n,i,1,t,h),h[0]==0?r.Ja():r},f.prototype.GU=function(r,n,t,i,h){if(r.B())return r;var s=new e.hd;return r=s.Ib(r),this.Ok(s,r,n,t,i,h)},f.prototype.IU=function(r,n,t,i,h,s){if(h&&r.jc(n)!=550){var o=new e.MC;o.PX(r,t),o.Pg?(e.Vk.W(r,t,s,!0),h=!1):this.j.ty(t)}else e.Vk.W(r,t,s,!0),h=!1;if(i&&r.jc(n)!=550?this.j.rJ(r,n,s):this.j.qJ(r,n,s),this.j.kA)return this.j.Wg(),this.j=null,this.Ok(r,n,t,i,!1,s);if(this.j.ty(NaN),s=this.j.Ma(n),this.eq(s+1),this.Ij[s]=!0,r.jc(n)==1736||i&&r.jc(n)!=550)return r.$o(n,0),n=this.Qt(n,-1,-1),(r=r.Ke(n)).$o(0),h?r.Eh(1,0):(r.Eh(2,t),r.hm()),r;if(r.jc(n)==1607)return n=this.Rt(-1),r=r.Ke(n),h||r.Eh(2,t),r;if(r.jc(n)==550)return n=this.pr(),r=r.Ke(n),h||r.Eh(2,t),r;throw e.i.Ra()},f.prototype.Ok=function(r,n,t,i,h,s){this.j=new e.ku;try{return this.IU(r,n,t,i,h,s)}finally{this.j.Wg()}},f.Ok=function(r,n,t,i,h){return new f().GU(r,n,t,i,h)},f.prototype.HU=function(r,n,t,i){this.Ov=r,this.j=new e.ku,r=n.Kn(t);var h=n.jc(t);if(r!=1||h==550?this.j.qJ(n,t,i):this.j.rJ(n,t,i),!this.j.kA)if(this.j.ty(NaN),i=this.j.Ma(t),this.eq(i+1),this.Ij[i]=!0,n.jc(t)==1736||r==1&&n.jc(t)!=550)n.$o(t,0),i=this.Qt(t,-1,-1),n.cC(i,t),n.wB(i);else if(n.jc(t)==1607)i=this.Rt(-1),n.cC(i,t),n.wB(i);else{if(n.jc(t)!=550)throw e.i.ga("internal error");i=this.pr(),n.cC(i,t),n.wB(i)}},f.prototype.km=function(r,n){var t=e.ba.uf(this.j.g.jc(r)),i=e.ba.uf(this.j.g.jc(n));if(t>i)return r;var h=this.j.Ma(r),s=this.j.Ma(n);if(this.eq(1+(h|s)),this.Ij[this.j.Ma(r)]=!0,t==2&&i==2)return this.Qt(r,n,-1);if(t==1&&i==2||t==1&&i==1)return this.Rt(-1);if(t==0)return this.pr();throw e.i.Ra()},f.prototype.Cv=function(r,n){var t=e.ba.uf(this.j.g.jc(r)),i=e.ba.uf(this.j.g.jc(n)),h=this.j.Ma(r),s=this.j.Ma(n);if(this.eq(1+(h|s)),this.Ij[this.j.Ma(r)|this.j.Ma(n)]=!0,h=-1,1n.Eb())return f.mi(f.Ue(r),r,"-");var h=new e.l;r.A(h);var s=new e.l;if(n.A(s),!h.isIntersecting(s))return f.mi(f.Ue(r),r,"-");var o=new e.l;return o.L(h),o.$b(s),t=e.ua.Xd(t,o,!0),s=new f,o=(h=new e.hd).Ib(f.Ue(r)),n=h.Ib(f.Ue(n)),s.Gt(h,t,i),i=s.km(o,n),i=h.Ke(i),r=f.mi(i,r,"-"),e.ba.Ic(r.K())&&(r.Eh(2,t),r.K()==1736&&r.hm()),r},f.QP=function(r,n,t){if(2>r.length)throw e.i.O("not enough geometries to dissolve");for(var i=0,h=0,s=r.length;hc?f.Ue(r[l]):(r=i==2,n=e.ua.Xd(i==0?n:null,o,!0),new f().Ok(a,u,n,r,!0,t))},f.Kz=function(r,n,t,i){var h=[null,null,null],s=new e.l;r.A(s);var o=new e.l;n.A(o);var a=new e.l;if(a.L(s),a.$b(o),t=e.ua.Xd(t,a,!0),(a=new e.l).L(o),o=e.ua.Gr(t),a.X(o,o),!s.isIntersecting(a)){if(r.Eb()<=n.Eb())return h[(r=f.mi(f.Ue(r.Ja()),r,"&")).Eb()]=r,h;if(r.Eb()>n.Eb())return h[(r=f.mi(f.Ue(n.Ja()),r,"&")).Eb()]=r,h}for(o=new f,a=(s=new e.hd).Ib(f.Ue(r)),n=s.Ib(f.Ue(n)),o.Gt(s,t,i),i=o.Kz(a,n),n=0;nn.Eb())return f.mi(f.Ue(r),r,"^");if(r.Eb()t;t++)n[t]=new e.h;r.iB(n),this.bY(n,n),r.bx(n,4)}},f.prototype.bY=function(r,n){for(var t=0;t(n=.5*n.Uk())?Math.sqrt(i):Math.sqrt(n))},f.prototype.MB=function(){this.eb=1,this.qb=this.Lb=this.jb=0,this.bb=1,this.Qb=0},f.prototype.isIdentity=function(r){if(r!==void 0){var n=e.h.construct(0,1);return this.Gh(n,n),n.sub(e.h.construct(0,1)),n.Uk()>r*r?!1:(n.na(0,0),this.Gh(n,n),!(n.Uk()>r*r)&&(n.na(1,0),this.Gh(n,n),n.sub(e.h.construct(1,0)),n.Uk()<=r*r))}return this.eb==1&&this.bb==1&&this.jb==0&&this.Lb==0&&this.qb==0&&this.Qb==0},f.prototype.Di=function(r){return Math.abs(this.eb*this.bb-this.qb*this.jb)<=2*r*(Math.abs(this.eb*this.bb)+Math.abs(this.qb*this.jb))},f.prototype.ig=function(r,n){this.eb=1,this.jb=0,this.Lb=r,this.qb=0,this.bb=1,this.Qb=n},f.prototype.Jt=function(r,n){n!==void 0?(this.eb=r,this.qb=this.Lb=this.jb=0,this.bb=n,this.Qb=0):this.Jt(r,r)},f.prototype.VB=function(){this.eb=0,this.jb=1,this.Lb=0,this.qb=1,this.Qb=this.bb=0},f.prototype.kX=function(r){this.lX(Math.cos(r),Math.sin(r))},f.prototype.lX=function(r,n){this.eb=r,this.jb=-n,this.Lb=0,this.qb=n,this.bb=r,this.Qb=0},f.prototype.shift=function(r,n){this.Lb+=r,this.Qb+=n},f.prototype.scale=function(r,n){this.eb*=r,this.jb*=r,this.Lb*=r,this.qb*=n,this.bb*=n,this.Qb*=n},f.prototype.flipX=function(r,n){this.eb=-this.eb,this.jb=-this.jb,this.Lb=r+n-this.Lb},f.prototype.flipY=function(r,n){this.qb=-this.qb,this.bb=-this.bb,this.Qb=r+n-this.Qb},f.prototype.rotate=function(r){var n=new f;n.kX(r),this.multiply(n)},f.prototype.inverse=function(r){if(r!==void 0){var n=this.eb*this.bb-this.jb*this.qb;n==0?r.lx():(n=1/n,r.Lb=(this.jb*this.Qb-this.Lb*this.bb)*n,r.Qb=(this.Lb*this.qb-this.eb*this.Qb)*n,r.eb=this.bb*n,r.jb=-this.jb*n,r.qb=-this.qb*n,r.bb=this.eb*n)}else this.inverse(this)},f}();e.Ed=y}(k||(k={})),function(e){var y=function(){function f(){}return f.prototype.lx=function(){this.Cg=this.Qb=this.Lb=this.Ze=this.We=this.Ve=this.Ye=this.bb=this.jb=this.pf=this.qb=this.eb=0},f.prototype.Jt=function(r,n){this.eb=r,this.jb=this.pf=this.qb=0,this.bb=n,this.We=this.Ve=this.Ye=0,this.Ze=void 0,this.Cg=this.Qb=this.Lb=0},f.prototype.translate=function(r,n,t){this.Lb+=r,this.Qb+=n,this.Cg+=t},f.prototype.hC=function(r){if(!r.B()){for(var n=new e.Od[8],t=0;8>t;t++)n[t]=new e.Od;r.iB(n),this.transform(n,8,n),r.bx(n)}},f.prototype.transform=function(r,n,t){for(var i=0;ii;i++)t.wh[i]=-1;t.wh[t.dg[0]]=0}return t.lq=!0,t}return J(n,r),n.prototype.se=function(t){this.hasAttribute(t)||(this.wh[t]=0,this.eD())},n.prototype.removeAttribute=function(t){if(t==0)throw e.i.O("Position attribue cannot be removed");this.hasAttribute(t)&&(this.wh[t]=-1,this.eD())},n.prototype.reset=function(){this.dg[0]=0,this.Ba=1;for(var t=0;tt;t++)0<=this.wh[t]&&(this.dg[i]=t,this.wh[t]=i,i++,this.Ba++);this.lq=!0},n.prototype.dc=function(){return this.lq&&(this.yl=this.Cn(),this.lq=!1),this.yl},n.prototype.Nb=function(t){if(t==null)return!1;if(t==this)return!0;if(!(t instanceof n)||t.Ba!=this.Ba)return!1;for(var i=0;is;s++)!t.hasAttribute(s)&&i.hasAttribute(s)&&(h==null&&(h=new n(t)),h.se(s));return h!=null?h.zF():t},n}(e.sa);e.fe=y;var f=function(){function r(){this.map=[];var n=new y;this.add(n),(n=new y).se(1),this.add(n)}return r.fz=function(){return r.XK},r.prototype.VR=function(){return r.gt},r.prototype.add=function(n){var t=n.dc();if(r.gt!=null&&r.gt.dc()==t&&n.BG(r.gt))return r.gt;if(r.Fw!=null&&r.Fw.dc()==t&&n.BG(r.Fw))return r.Fw;var i=null;return this.map[t]!==void 0&&(i=this.map[t]),i==null&&((i=n.oM()).Ba==1?r.gt=i:i.Ba==2&&i.ld(1)==1?r.Fw=i:this.map[t]=i),i},r.XK=new r,r}()}(k||(k={}));var kt={feet:9002,kilometers:9036,meters:9001,miles:9093,"nautical-miles":9030,yards:9096},Mt={acres:109402,ares:109463,hectares:109401,"square-feet":109405,"square-kilometers":109414,"square-meters":109404,"square-miles":109439,"square-yards":109442},at=new(function(){function e(){this.MM=50,this.pp=new Map,this.ij=[]}return e.prototype.clear=function(){this.ij.length=0,this.pp.clear()},e.prototype.delete=function(y){return!!this.pp.delete(y)&&(this.ij.splice(this.ij.indexOf(y),1),!0)},e.prototype.get=function(y){var f=this.pp.get(y);if(f!==void 0)return this.ij[0]!==y&&(this.ij.splice(this.ij.indexOf(y),1),this.ij.unshift(y)),f},e.prototype.has=function(y){return this.pp.has(y)},e.prototype.set=function(y,f){return this.get(y)!==void 0&&this.delete(y),this.ij.unshift(y),this.pp.set(y,f),this.jM(),this},e.prototype.jM=function(){for(;this.ij.length&&this.ij.length>this.MM;){var y=this.ij.pop();this.pp.delete(y)}},e}()),q=((Z={}).convertJSONToGeometry=function(e){return k.ac.aP(e)},Z.hasM=function(e){return e.hasAttribute(k.Kh.M)},Z.hasZ=function(e){return e.hasAttribute(k.Kh.Z)},Z.getPointX=function(e){return e.Ng()},Z.getPointY=function(e){return e.kh()},Z.getPointZ=function(e){return e.XR()},Z.getPointM=function(e){return e.uR()},Z.getXMin=function(e){return e.gs()},Z.getYMin=function(e){return e.js()},Z.getXMax=function(e){return e.fs()},Z.getYMax=function(e){return e.hs()},Z.getZExtent=function(e){return e.Vg(k.Kh.Z,0)},Z.getMExtent=function(e){return e.Vg(k.Kh.M,0)},Z.exportPaths=function(e){var y=[],f=e.ea(),r=null,n=null,t=e.hasAttribute(k.Kh.Z),i=e.hasAttribute(k.Kh.M);t&&(r=e.vb(k.Kh.Z)),i&&(n=e.vb(k.Kh.M));for(var h=new k.h,s=0;s=4&&n!==E.ELEMENT_ARRAY_BUFFER&&(this._bufferView.byteStride=a),t.bufferViews.push(this._bufferView),this._numComponentsForDataType=this._calculateNumComponentsForDataType()}push(e){const t=this._data.length;if(this._data.push(e),this._accessorIndex>=0){const s=t%this._numComponentsForDataType,i=this._accessorMin[s];this._accessorMin[s]=typeof i!="number"?e:Math.min(i,e);const n=this._accessorMax[s];this._accessorMax[s]=typeof n!="number"?e:Math.max(n,e)}}get dataSize(){return this._data.length*this._sizeComponentType()}get byteSize(){function e(t,s){return s*Math.ceil(t/s)}return e(this.dataSize,4)}getByteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}get byteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}_createTypedArray(e,t){switch(this._componentType){case u.BYTE:return new Int8Array(e,t);case u.FLOAT:return new Float32Array(e,t);case u.SHORT:return new Int16Array(e,t);case u.UNSIGNED_BYTE:return new Uint8Array(e,t);case u.UNSIGNED_INT:return new Uint32Array(e,t);case u.UNSIGNED_SHORT:return new Uint16Array(e,t)}}writeOutToBuffer(e,t){this._createTypedArray(e,t).set(this._data)}writeAsync(e){if(this._asyncWritePromise)throw new Error("Can't write multiple bufferView values asynchronously");return this._asyncWritePromise=e.then(t=>{const s=new Uint8Array(t);for(let i=0;i=0)throw new Error("Accessor was started without ending the previous one");this._accessorIndex=this._data.length,this._accessorAttribute=e;const t=this._numComponentsForDataType;this._accessorMin=new Array(t),this._accessorMax=new Array(t)}endAccessor(){if(this._accessorIndex<0)throw new Error("An accessor was not started, but was attempted to be ended");const e=this._getElementSize(),t=this._numComponentsForDataType,s=(this._data.length-this._accessorIndex)/t;if(s%1)throw new Error("An accessor was ended with missing component values");for(let n=0;nthis._finalizedPromiseResolve=e)}finalize(){const e=this._bufferView;return new Promise(t=>{const s=this._buffer.getViewFinalizePromises(this);this._asyncWritePromise&&s.push(this._asyncWritePromise),t(k(s))}).then(()=>{this._isFinalized=!0,e.byteOffset=this.getByteOffset(),e.byteLength=this.dataSize,this._finalizedPromiseResolve&&this._finalizedPromiseResolve()})}_getElementSize(){return this._sizeComponentType()*this._numComponentsForDataType}_sizeComponentType(){switch(this._componentType){case u.BYTE:case u.UNSIGNED_BYTE:return 1;case u.SHORT:case u.UNSIGNED_SHORT:return 2;case u.UNSIGNED_INT:case u.FLOAT:return 4}}_calculateNumComponentsForDataType(){switch(this._dataType){case w.SCALAR:return 1;case w.VEC2:return 2;case w.VEC3:return 3;case w.VEC4:case w.MAT2:return 4;case w.MAT3:return 9;case w.MAT4:return 16}}},X=class{constructor(e){this._gltf=e,this._bufferViews=[],this._isFinalized=!1,e.buffers||(e.buffers=[]),this.index=e.buffers.length;const t={byteLength:-1};e.buffers.push(t),this._buffer=t}addBufferView(e,t,s){if(this._finalizePromise)throw new Error("Cannot add buffer view after fiinalizing buffer");const i=new ye(this,this._gltf,e,t,s);return this._bufferViews.push(i),i}getByteOffset(e){let t=0;for(const s of this._bufferViews){if(s===e)return t;t+=s.byteSize}throw new Error("Given bufferView was not present in this buffer")}getViewFinalizePromises(e){const t=[];for(const s of this._bufferViews){if(e&&s===e)return t;t.push(s.finalized)}return t}getArrayBuffer(){if(!this._isFinalized)throw new Error("Cannot get ArrayBuffer from Buffer before it is finalized");const e=this._getTotalSize(),t=new ArrayBuffer(e);let s=0;for(const i of this._bufferViews)i.writeOutToBuffer(t,s),s+=i.byteSize;return t}finalize(){var e;if(this._finalizePromise)throw new Error(`Buffer ${this.index} was already finalized`);return this._finalizePromise=new Promise(t=>{t(k(this.getViewFinalizePromises()))}).then(()=>{this._isFinalized=!0;const t=this.getArrayBuffer();this._buffer.byteLength=t.byteLength,this._buffer.uri=t}),(e=this._gltf.extras)==null||e.promises.push(this._finalizePromise),this._finalizePromise}_getTotalSize(){let e=0;for(const t of this._bufferViews)e+=t.byteSize;return e}};function xe(r,e){if(r.components)for(const t of r.components)t.faces&&t.shading==="smooth"&&Ee(t,e)}function Ee(r,e){e.normal==null&&(e.normal=new Float32Array(e.position.length));const t=r.faces,{position:s,normal:i}=e,n=t.length/3;for(let a=0;a{this._addScene(i)}),s&&t.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const t={};e.name&&(t.name=e.name),e.forEachNode(s=>{t.nodes||(t.nodes=[]);const i=this._addNode(s);t.nodes.push(i)}),this.gltf.scenes.push(t)}_addNode(e){this.gltf.nodes||(this.gltf.nodes=[]);const t={};e.name&&(t.name=e.name);const s=e.translation;Z(s,ne)||(t.translation=C(s));const i=e.rotation;ae(i,oe)||(t.rotation=he(i));const n=e.scale;Z(n,Q)||(t.scale=C(n)),e.mesh&&e.mesh.vertexAttributes.position?t.mesh=this._addMesh(e.mesh):e.forEachNode(o=>{t.children||(t.children=[]);const h=this._addNode(o);t.children.push(h)});const a=this.gltf.nodes.length;return this.gltf.nodes.push(t),a}_addMesh(e){this.gltf.meshes||(this.gltf.meshes=[]);const t={primitives:[]},s=this.gltf.extras,i=s.options.bufferOutputType===R.GLB;let n;n=i?s.binChunkBuffer:new X(this.gltf),this.params.origin||(this.params.origin=Re(e));const{ignoreLocalTransform:a}=this.params,o=a?null:e.transform,{vertexSpace:h}=e,d=a?h.isRelative?new ce({origin:C(h.origin)}):new fe:h,m=le(e.vertexAttributes,d,o,this.params.origin,{geographic:this.params.geographic,unit:"meters"});xe(e,m),this._flipYZAxis(m);const _=n.addBufferView(u.FLOAT,w.VEC3,E.ARRAY_BUFFER);let f,g,p,l;m.normal&&(f=n.addBufferView(u.FLOAT,w.VEC3,E.ARRAY_BUFFER)),e.vertexAttributes.uv&&(g=n.addBufferView(u.FLOAT,w.VEC2,E.ARRAY_BUFFER)),m.tangent&&(p=n.addBufferView(u.FLOAT,w.VEC4,E.ARRAY_BUFFER)),e.vertexAttributes.color&&(l=n.addBufferView(u.UNSIGNED_BYTE,w.VEC4,E.ARRAY_BUFFER)),_.startAccessor("POSITION"),f&&f.startAccessor("NORMAL"),g&&g.startAccessor("TEXCOORD_0"),p&&p.startAccessor("TANGENT"),l&&l.startAccessor("COLOR_0");const y=m.position.length/3,{position:x,normal:M,tangent:I}=m,{color:O,uv:F}=e.vertexAttributes;for(let c=0;c0&&e.components[0].faces?(B=n.addBufferView(u.UNSIGNED_INT,w.SCALAR,E.ELEMENT_ARRAY_BUFFER),this._addMeshVertexIndexed(B,e.components,t,H,P,D,G,U)):this._addMeshVertexNonIndexed(e.components,t,H,P,D,G,U),_.finalize(),f&&f.finalize(),g&&g.finalize(),p&&p.finalize(),B&&B.finalize(),l&&l.finalize(),i||n.finalize();const te=this.gltf.meshes.length;return this.gltf.meshes.push(t),te}_flipYZAxis({position:e,normal:t,tangent:s}){this._flipYZBuffer(e,3),this._flipYZBuffer(t,3),this._flipYZBuffer(s,4)}_flipYZBuffer(e,t){if(e!=null)for(let s=1,i=2;so**2.1,n=o=>{const h=o.toRgba();return h[0]=i(h[0]/255),h[1]=i(h[1]/255),h[2]=i(h[2]/255),h};if(e.color!=null&&(s.pbrMetallicRoughness.baseColorFactor=n(e.color)),e.colorTexture!=null&&(s.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),e.normalTexture!=null&&(s.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof ue){if(e.emissiveTexture!=null&&(s.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),e.emissiveColor!=null){const o=n(e.emissiveColor);s.emissiveFactor=[o[0],o[1],o[2]]}e.occlusionTexture!=null&&(s.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),e.metallicRoughnessTexture!=null&&(s.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),s.pbrMetallicRoughness.metallicFactor=e.metallic,s.pbrMetallicRoughness.roughnessFactor=e.roughness}else s.pbrMetallicRoughness.metallicFactor=1,s.pbrMetallicRoughness.roughnessFactor=1,$.warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const a=this.gltf.materials.length;return this.gltf.materials.push(s),this._materialMap.push(e),a}_createTextureInfo(e,t){const s={index:this._addTexture(e)};return t&&(s.extensions||(s.extensions={}),s.extensions.KHR_texture_transform={scale:t.scale,offset:t.offset,rotation:de(t.rotation)}),s}_addTexture(e){const t=this.gltf.textures??[];return this.gltf.textures=t,_e(this._textureMap,e,()=>{const s={sampler:this._addSampler(e),source:this._addImage(e)},i=t.length;return t.push(s),i})}_addImage(e){const t=this._imageMap.get(e);if(t!=null)return t;this.gltf.images||(this.gltf.images=[]);const s={};if(e.url)s.uri=e.url;else{const n=e.data;s.extras=n;for(let o=0;o(s.mimeType=m,d));o.writeAsync(h).then(()=>{o.finalize()})}s.bufferView=o.index;break}case b.DataURI:if(v(n)){$.warnOnce("Image export for basis compressed textures not available.");break}s.uri=Te(n);break;default:if(v(n)){$.warnOnce("Image export for basis compressed textures not available.");break}a.promises.push(K(n).then(({data:o,type:h})=>{s.uri=o,s.mimeType=h}))}}const i=this.gltf.images.length;return this.gltf.images.push(s),this._imageMap.set(e,i),i}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let t=A.REPEAT,s=A.REPEAT;if(typeof e.wrap=="string")switch(e.wrap){case"clamp":t=A.CLAMP_TO_EDGE,s=A.CLAMP_TO_EDGE;break;case"mirror":t=A.MIRRORED_REPEAT,s=A.MIRRORED_REPEAT}else{switch(e.wrap.vertical){case"clamp":s=A.CLAMP_TO_EDGE;break;case"mirror":s=A.MIRRORED_REPEAT}switch(e.wrap.horizontal){case"clamp":t=A.CLAMP_TO_EDGE;break;case"mirror":t=A.MIRRORED_REPEAT}}const i={wrapS:t,wrapT:s};for(let a=0;a{const f={origin:n};delete a.extras;const g=typeof e.jsonSpacing=="number"?e.jsonSpacing:4,p=JSON.stringify(a,(l,y)=>{if(l!=="extras"){if(y instanceof ArrayBuffer){if(Ae(y))switch(e.imageOutputType){case b.DataURI:case b.GLB:break;case b.External:default:{const x=`img${d}.png`;return d++,f[x]=y,x}}switch(e.bufferOutputType){case R.DataURI:return be(y);case R.GLB:if(m)throw new Error("Already encountered an ArrayBuffer, there should only be one in the GLB format.");return void(m=y);case R.External:default:{const x=`data${h}.bin`;return h++,f[x]=y,x}}}return y}},g);return e.bufferOutputType===R.GLB||e.imageOutputType===b.GLB?f[q]=new T(p,m).buffer:f[Ce]=p,f})}function Ve(r,e){return ze(r,{bufferOutputType:R.GLB,imageOutputType:b.GLB,jsonSpacing:0},e)}class Fe{constructor(e,t){this._file={type:"model/gltf-binary",data:e},this.origin=t}buffer(){return Promise.resolve(this._file)}download(e){we(new Blob([this._file.data],{type:this._file.type}),e)}}function $e(r,e){const t=new Me,s=new Be;return t.addScene(s),s.addNode(new Le(r)),Ve(t,e).then(i=>new Fe(i[q],i.origin))}export{$e as toBinaryGLTF}; diff --git a/assets/guid-114f0fc6.js b/assets/guid-114f0fc6.js new file mode 100644 index 0000000..7e373cc --- /dev/null +++ b/assets/guid-114f0fc6.js @@ -0,0 +1,5 @@ +/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */function e(r){return r.map(o=>{let t="";for(let n=0;ne([2,1,1,1,3]);export{i as g}; diff --git a/assets/hash-6f442295.js b/assets/hash-6f442295.js new file mode 100644 index 0000000..6e15555 --- /dev/null +++ b/assets/hash-6f442295.js @@ -0,0 +1 @@ +function p(u){const s=[];for(let n=0,e=u.length;n>6,128|63&t):t<55296||t>=57344?s.push(224|t>>12,128|t>>6&63,128|63&t):(n++,t=65536+((1023&t)<<10|1023&u.charCodeAt(n)),s.push(240|t>>18,128|t>>12&63,128|t>>6&63,128|63&t))}return new Uint8Array(s)}class b{constructor(s){this._seed=s,this._totallen=0,this._bufs=[],this.init()}init(){return this._bufs=[],this._totallen=0,this}updateFloatArray(s){const n=[];for(const e of s)isNaN(e)?n.push("NaN"):e===1/0?n.push("Infinity"):e===-1/0?n.push("-Infinity"):e===0?n.push("0"):n.push(e.toString(16));this.update(p(n.join("")))}updateIntArray(s){const n=Int32Array.from(s);this.update(new Uint8Array(n.buffer))}updateUint8Array(s){this.update(Uint8Array.from(s))}updateWithString(s){return this.update(p(s))}update(s){return this._bufs.push(s),this._totallen+=s.length,this}digest(){const s=new Uint8Array(this._totallen);let n=0;for(const e of this._bufs)s.set(e,n),n+=e.length;return this.init(),this._xxHash32(s,this._seed)}_xxHash32(s,n=0){const e=s;let t=n+374761393&4294967295,h=0;if(e.length>=16){const r=[n+2654435761+2246822519&4294967295,n+2246822519&4294967295,n+0&4294967295,n-2654435761&4294967295],i=s,f=i.length-16;let a=0;for(h=0;(4294967280&h)<=f;h+=4){const l=h,d=i[l]+(i[l+1]<<8),_=i[l+2]+(i[l+3]<<8),g=d*2246822519+(_*2246822519<<16);let o=r[a]+g&4294967295;o=o<<13|o>>>19;const y=65535&o,A=o>>>16;r[a]=y*2654435761+(A*2654435761<<16)&4294967295,a=a+1&3}t=(r[0]<<1|r[0]>>>31)+(r[1]<<7|r[1]>>>25)+(r[2]<<12|r[2]>>>20)+(r[3]<<18|r[3]>>>14)&4294967295}t=t+s.length&4294967295;const c=s.length-4;for(;h<=c;h+=4){const r=h,i=e[r]+(e[r+1]<<8),f=e[r+2]+(e[r+3]<<8);t=t+(i*3266489917+(f*3266489917<<16))&4294967295,t=t<<17|t>>>15,t=(65535&t)*668265263+((t>>>16)*668265263<<16)&4294967295}for(;h>>21,t=(65535&t)*2654435761+((t>>>16)*2654435761<<16)&4294967295;return t^=t>>>15,t=((65535&t)*2246822519&4294967295)+((t>>>16)*2246822519<<16),t^=t>>>13,t=((65535&t)*3266489917&4294967295)+((t>>>16)*3266489917<<16),t^=t>>>16,t<0?t+4294967296:t}}export{b as i}; diff --git a/assets/he_IL2-ecc10351.js b/assets/he_IL2-ecc10351.js new file mode 100644 index 0000000..63f600a --- /dev/null +++ b/assets/he_IL2-ecc10351.js @@ -0,0 +1 @@ +const d={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"לספירה",_era_bc:"לפנה״ס",A:"לפנה״צ",P:"אחה״צ",AM:"לפנה״צ",PM:"אחה״צ","A.M.":"לפנה״צ","P.M.":"אחה״צ",January:"ינואר",February:"פברואר",March:"מרץ",April:"אפריל",May:"מאי",June:"יוני",July:"יולי",August:"אוגוסט",September:"ספטמבר",October:"אוקטובר",November:"נובמבר",December:"דצמבר",Jan:"ינו׳",Feb:"פבר׳",Mar:"מרץ",Apr:"אפר׳","May(short)":"מאי",Jun:"יוני",Jul:"יולי",Aug:"אוג׳",Sep:"ספט׳",Oct:"אוק׳",Nov:"נוב׳",Dec:"דצמ׳",Sunday:"יום ראשון",Monday:"יום שני",Tuesday:"יום שלישי",Wednesday:"יום רביעי",Thursday:"יום חמישי",Friday:"יום שישי",Saturday:"יום שבת",Sun:"יום א׳",Mon:"יום ב׳",Tue:"יום ג׳",Wed:"יום ד׳",Thu:"יום ה׳",Fri:"יום ו׳",Sat:"שבת",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"התמקד",Play:"נגן",Stop:"עצור",Legend:"מקרא","Press ENTER to toggle":"",Loading:"טעינה",Home:"דף הבית",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"הדפס",Image:"תמונה",Data:"נתונים",Print:"הדפס","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"מ %1 עד %2","From %1":"מ %1","To %1":"עד %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/assets/heatmapUtils-327ef4c5.js b/assets/heatmapUtils-327ef4c5.js new file mode 100644 index 0000000..219e852 --- /dev/null +++ b/assets/heatmapUtils-327ef4c5.js @@ -0,0 +1 @@ +import{bE as j,bF as b,bG as C,bH as O,bI as P}from"./index-080e108a.js";const g=2.4;function S(t){return j(t*g)}function U(t){return b(t)/g}function T(t,o,r,a){let{color:u,ratio:c}=o,{color:f,ratio:n}=r;n===c&&(n===1?c-=1e-6:n+=1e-6);const e=P((a-c)/(n-c),0,1);C(t,u.toArray(),f.toArray(),e)}function V(t){const r=new Uint8ClampedArray(2048);if(t=t.filter(({ratio:n})=>n>=0&&n<=1).sort((n,e)=>n.ratio-e.ratio).map(({color:n,ratio:e})=>({color:n,ratio:Math.max(e,.001)})),t.length<1)return r;let a=t[0],u=t[0],c=1;const f=O();for(let n=0;n<512;n++){const e=(n+.5)/512;for(;e>u.ratio&&c=r+d||i.y<-d||i.y>a+d)continue;const I=+A(l),N=Math.max(0,Math.round(i.x)-n),w=Math.max(0,Math.round(i.y)-n),E=Math.min(a,Math.round(i.y)+n),F=Math.min(r,Math.round(i.x)+n);for(let h=w;hm&&(m=s)}}}return{matrix:e.buffer,max:m}}function q(t,o,r){const a=Math.sqrt(t**2+o**2)/r;return a>1?0:3/(Math.PI*r**2)*(1-a**2)**2}function _(t,o){return typeof t=="function"?t:t?typeof o=="string"?r=>-1*+r[t]:r=>+r[t]+o:()=>1}function H(t,o){return t!=null?typeof o=="string"?r=>-1*+r.readAttribute(t):r=>+r.readAttribute(t)+o:r=>1}export{g as a,U as c,S as i,q as m,Y as s,V as u,_ as y}; diff --git a/assets/hr_HR2-6c8e87b3.js b/assets/hr_HR2-6c8e87b3.js new file mode 100644 index 0000000..fd34196 --- /dev/null +++ b/assets/hr_HR2-6c8e87b3.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"po. Kr.",_era_bc:"pr. Kr.",A:"AM",P:"PM",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"siječnja",February:"veljače",March:"ožujka",April:"travnja",May:"svibnja",June:"lipnja",July:"srpnja",August:"kolovoza",September:"rujna",October:"listopada",November:"studenoga",December:"prosinca",Jan:"sij",Feb:"velj",Mar:"ožu",Apr:"tra","May(short)":"svi",Jun:"lip",Jul:"srp",Aug:"kol",Sep:"ruj",Oct:"lis",Nov:"stu",Dec:"pro",Sunday:"nedjelja",Monday:"ponedjeljak",Tuesday:"utorak",Wednesday:"srijeda",Thursday:"četvrtak",Friday:"petak",Saturday:"subota",Sun:"ned",Mon:"pon",Tue:"uto",Wed:"sri",Thu:"čet",Fri:"pet",Sat:"sub",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Povećaj",Play:"Reproduciraj",Stop:"Zaustavi",Legend:"Legenda","Press ENTER to toggle":"",Loading:"Učitavanje",Home:"Početna",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Ispis",Image:"Slika",Data:"Podaci",Print:"Ispis","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{a as default}; diff --git a/assets/hu_HU2-fbe5572b.js b/assets/hu_HU2-fbe5572b.js new file mode 100644 index 0000000..04d5f17 --- /dev/null +++ b/assets/hu_HU2-fbe5572b.js @@ -0,0 +1 @@ +const d={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"i. sz.",_era_bc:"i. e.",A:"de.",P:"du.",AM:"de.",PM:"du.","A.M.":"de.","P.M.":"du.",January:"január",February:"február",March:"március",April:"április",May:"május",June:"június",July:"július",August:"augusztus",September:"szeptember",October:"október",November:"november",December:"december",Jan:"jan.",Feb:"febr.",Mar:"márc.",Apr:"ápr.","May(short)":"máj.",Jun:"jún.",Jul:"júl.",Aug:"aug.",Sep:"szept.",Oct:"okt.",Nov:"nov.",Dec:"dec.",Sunday:"vasárnap",Monday:"hétfő",Tuesday:"kedd",Wednesday:"szerda",Thursday:"csütörtök",Friday:"péntek",Saturday:"szombat",Sun:"V",Mon:"H",Tue:"K",Wed:"Sze",Thu:"Cs",Fri:"P",Sat:"Szo",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Nagyítás/kicsinyítés",Play:"Lejátszás",Stop:"Megálló",Legend:"Jelmagyarázat","Press ENTER to toggle":"",Loading:"Betöltés",Home:"Kezdőlap",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Nyomtatás",Image:"Kép",Data:"Adatok",Print:"Nyomtatás","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Ettől %1 eddig %2","From %1":"Ettől %1","To %1":"Eddig %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/assets/hydrated-c10ab4a5.js b/assets/hydrated-c10ab4a5.js new file mode 100644 index 0000000..1671a5b --- /dev/null +++ b/assets/hydrated-c10ab4a5.js @@ -0,0 +1 @@ +import{c7 as r,ak as c,c8 as h,c9 as x,ca as m}from"./index-080e108a.js";const Z={convertToGEGeometry:g,exportPoint:p,exportPolygon:u,exportPolyline:l,exportMultipoint:M,exportExtent:f};function g(t,e){if(e==null)return null;let a="cache"in e?e.cache._geVersion:void 0;return a==null&&(a=t.convertJSONToGeometry(e),"cache"in e&&(e.cache._geVersion=a)),a}function p(t,e,a){const o=t.hasZ(e),i=t.hasM(e),s=new r({x:t.getPointX(e),y:t.getPointY(e),spatialReference:a});return o&&(s.z=t.getPointZ(e)),i&&(s.m=t.getPointM(e)),s.cache._geVersion=e,s}function u(t,e,a){const o=new c({rings:t.exportPaths(e),hasZ:t.hasZ(e),hasM:t.hasM(e),spatialReference:a});return o.cache._geVersion=e,o}function l(t,e,a){const o=new h({paths:t.exportPaths(e),hasZ:t.hasZ(e),hasM:t.hasM(e),spatialReference:a});return o.cache._geVersion=e,o}function M(t,e,a){const o=new x({hasZ:t.hasZ(e),hasM:t.hasM(e),points:t.exportPoints(e),spatialReference:a});return o.cache._geVersion=e,o}function f(t,e,a){const o=t.hasZ(e),i=t.hasM(e),s=new m({xmin:t.getXMin(e),ymin:t.getYMin(e),xmax:t.getXMax(e),ymax:t.getYMax(e),spatialReference:a});if(o){const n=t.getZExtent(e);s.zmin=n.vmin,s.zmax=n.vmax}if(i){const n=t.getMExtent(e);s.mmin=n.vmin,s.mmax=n.vmax}return s.cache._geVersion=e,s}export{Z as hydratedAdapter}; diff --git a/assets/i3s-dc0aca0d.js b/assets/i3s-dc0aca0d.js new file mode 100644 index 0000000..fc5ca93 --- /dev/null +++ b/assets/i3s-dc0aca0d.js @@ -0,0 +1,2 @@ +import{bU as ur}from"./index-080e108a.js";function cr(k,H){for(var P=0;Pi[E]})}}}return Object.freeze(Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}))}var Ot,ct,Dt,tt={exports:{}};tt.exports,Ot=tt,tt.exports,ct=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,Dt=function(k={}){var H,P,i=k!==void 0?k:{};i.ready=new Promise((t,e)=>{H=t,P=e});var E=Object.assign({},i),x=typeof window=="object",q=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var et,w="";function zt(t){return i.locateFile?i.locateFile(t,w):w+t}(x||q)&&(q?w=self.location.href:typeof document<"u"&&document.currentScript&&(w=document.currentScript.src),ct&&(w=ct),w=w.indexOf("blob:")!==0?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf("/")+1):"",q&&(et=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}));var z,N,Vt=i.print||console.log.bind(console),U=i.printErr||console.warn.bind(console);Object.assign(i,E),E=null,i.arguments&&i.arguments,i.thisProgram&&i.thisProgram,i.quit&&i.quit,i.wasmBinary&&(z=i.wasmBinary),i.noExitRuntime,typeof WebAssembly!="object"&&$("no native wasm support detected");var j,v,I,L,F,p,st,ft,lt,dt=!1;function pt(){var t=N.buffer;i.HEAP8=j=new Int8Array(t),i.HEAP16=I=new Int16Array(t),i.HEAP32=F=new Int32Array(t),i.HEAPU8=v=new Uint8Array(t),i.HEAPU16=L=new Uint16Array(t),i.HEAPU32=p=new Uint32Array(t),i.HEAPF32=st=new Float32Array(t),i.HEAPF64=ft=new Float64Array(t)}var vt=[],ht=[],mt=[];function Mt(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)Nt(i.preRun.shift());rt(vt)}function Bt(){rt(ht)}function qt(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)$t(i.postRun.shift());rt(mt)}function Nt(t){vt.unshift(t)}function Lt(t){ht.unshift(t)}function $t(t){mt.unshift(t)}var R=0,V=null;function Gt(t){R++,i.monitorRunDependencies&&i.monitorRunDependencies(R)}function Xt(t){if(R--,i.monitorRunDependencies&&i.monitorRunDependencies(R),R==0&&V){var e=V;V=null,e()}}function $(t){i.onAbort&&i.onAbort(t),U(t="Aborted("+t+")"),dt=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw P(e),e}var M,Zt="data:application/octet-stream;base64,";function gt(t){return t.startsWith(Zt)}function yt(t){try{if(t==M&&z)return new Uint8Array(z);if(et)return et(t);throw"both async and sync fetching of the wasm failed"}catch(e){$(e)}}function Jt(t){return z||!x&&!q||typeof fetch!="function"?Promise.resolve().then(()=>yt(t)):fetch(t,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()}).catch(()=>yt(t))}function _t(t,e,r){return Jt(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{U("failed to asynchronously prepare wasm: "+n),$(n)})}function Kt(t,e,r,n){return t||typeof WebAssembly.instantiateStreaming!="function"||gt(e)||typeof fetch!="function"?_t(e,r,n):fetch(e,{credentials:"same-origin"}).then(o=>WebAssembly.instantiateStreaming(o,r).then(n,function(u){return U("wasm streaming compile failed: "+u),U("falling back to ArrayBuffer instantiation"),_t(e,r,n)}))}function Qt(){var t={env:St,wasi_snapshot_preview1:St};function e(n,o){var u=n.exports;return i.asm=u,N=i.asm.memory,pt(),lt=i.asm.__indirect_function_table,Lt(i.asm.__wasm_call_ctors),Xt(),u}function r(n){e(n.instance)}if(Gt(),i.instantiateWasm)try{return i.instantiateWasm(t,e)}catch(n){U("Module.instantiateWasm callback failed with error: "+n),P(n)}return Kt(z,M,t,r).catch(P),{}}function rt(t){for(;t.length>0;)t.shift()(i)}gt(M="i3s.wasm")||(M=zt(M));var G=[];function nt(t){var e=G[t];return e||(t>=G.length&&(G.length=t+1),G[t]=e=lt.get(t)),e}function Yt(t,e){nt(t)(e)}function te(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(e){p[this.ptr+4>>2]=e},this.get_type=function(){return p[this.ptr+4>>2]},this.set_destructor=function(e){p[this.ptr+8>>2]=e},this.get_destructor=function(){return p[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,j[this.ptr+12>>0]=e},this.get_caught=function(){return j[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,j[this.ptr+13>>0]=e},this.get_rethrown=function(){return j[this.ptr+13>>0]!=0},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){p[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return p[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Ut(this.get_type()))return p[this.excPtr>>2];var e=this.get_adjusted_ptr();return e!==0?e:this.excPtr}}function ee(t,e,r){throw new te(t).init(e,r),t}var X={};function bt(t){for(;t.length;){var e=t.pop();t.pop()(e)}}function Z(t){return this.fromWireType(F[t>>2])}var O={},S={},J={},re=48,ne=57;function ie(t){if(t===void 0)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=re&&e<=ne?"_"+t:t}function oe(t,e){return{[t=ie(t)]:function(){return e.apply(this,arguments)}}[t]}function it(t,e){var r=oe(e,function(n){this.name=e,this.message=n;var o=new Error(n).stack;o!==void 0&&(this.stack=this.toString()+` +`+o.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},r}var wt=void 0;function At(t){throw new wt(t)}function Tt(t,e,r){function n(a){var s=r(a);s.length!==t.length&&At("Mismatched type converter count");for(var f=0;f{S.hasOwnProperty(a)?o[s]=S[a]:(u.push(a),O.hasOwnProperty(a)||(O[a]=[]),O[a].push(()=>{o[s]=S[a],++c===u.length&&n(o)}))}),u.length===0&&n(o)}function ae(t){var e=X[t];delete X[t];var r=e.rawConstructor,n=e.rawDestructor,o=e.fields;Tt([t],o.map(u=>u.getterReturnType).concat(o.map(u=>u.setterArgumentType)),u=>{var c={};return o.forEach((a,s)=>{var f=a.fieldName,l=u[s],d=a.getter,C=a.getterContext,y=u[s+o.length],_=a.setter,W=a.setterContext;c[f]={read:b=>l.fromWireType(d(C,b)),write:(b,ut)=>{var Y=[];_(W,b,y.toWireType(Y,ut)),bt(Y)}}}),[{name:e.name,fromWireType:function(a){var s={};for(var f in c)s[f]=c[f].read(a);return n(a),s},toWireType:function(a,s){for(var f in c)if(!(f in s))throw new TypeError('Missing field: "'+f+'"');var l=r();for(f in c)c[f].write(l,s[f]);return a!==null&&a.push(n,l),l},argPackAdvance:8,readValueFromPointer:Z,destructorFunction:n}]})}function ue(t,e,r,n,o){}function ot(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}function ce(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);Ct=t}var Ct=void 0;function h(t){for(var e="",r=t;v[r];)e+=Ct[v[r++]];return e}var Pt=void 0;function m(t){throw new Pt(t)}function A(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=e.name;if(t||m('type "'+n+'" must have a positive integer typeid pointer'),S.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;m("Cannot register type '"+n+"' twice")}if(S[t]=e,delete J[t],O.hasOwnProperty(t)){var o=O[t];delete O[t],o.forEach(u=>u())}}function se(t,e,r,n,o){var u=ot(r);A(t,{name:e=h(e),fromWireType:function(c){return!!c},toWireType:function(c,a){return a?n:o},argPackAdvance:8,readValueFromPointer:function(c){var a;if(r===1)a=j;else if(r===2)a=I;else{if(r!==4)throw new TypeError("Unknown boolean type size: "+e);a=F}return this.fromWireType(a[c>>u])},destructorFunction:null})}function fe(){this.allocated=[void 0],this.freelist=[],this.get=function(t){return this.allocated[t]},this.allocate=function(t){let e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},this.free=function(t){this.allocated[t]=void 0,this.freelist.push(t)}}var g=new fe;function Et(t){t>=g.reserved&&--g.get(t).refcount==0&&g.free(t)}function le(){for(var t=0,e=g.reserved;e(t||m("Cannot use deleted val. handle = "+t),g.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return g.allocate({refcount:1,value:t})}}};function pe(t,e){A(t,{name:e=h(e),fromWireType:function(r){var n=K.toValue(r);return Et(r),n},toWireType:function(r,n){return K.toHandle(n)},argPackAdvance:8,readValueFromPointer:Z,destructorFunction:null})}function ve(t,e){switch(e){case 2:return function(r){return this.fromWireType(st[r>>2])};case 3:return function(r){return this.fromWireType(ft[r>>3])};default:throw new TypeError("Unknown float type: "+t)}}function he(t,e,r){var n=ot(r);A(t,{name:e=h(e),fromWireType:function(o){return o},toWireType:function(o,u){return u},argPackAdvance:8,readValueFromPointer:ve(e,n),destructorFunction:null})}function me(t,e,r,n,o,u){var c=e.length;c<2&&m("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=e[1]!==null&&r!==null,s=!1,f=1;f>2]);return r}function be(t,e,r){i.hasOwnProperty(t)||At("Replacing nonexistant public symbol"),i[t].overloadTable!==void 0&&r!==void 0?i[t].overloadTable[r]=e:(i[t]=e,i[t].argCount=r)}function we(t,e,r){var n=i["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)}function Ae(t,e,r){return t.includes("j")?we(t,e,r):nt(e).apply(null,r)}function Te(t,e){var r=[];return function(){return r.length=0,Object.assign(r,arguments),Ae(t,e,r)}}function B(t,e){function r(){return t.includes("j")?Te(t,e):nt(e)}t=h(t);var n=r();return typeof n!="function"&&m("unknown function pointer with signature "+t+": "+e),n}var Wt=void 0;function kt(t){var e=xt(t),r=h(e);return T(e),r}function Ce(t,e){var r=[],n={};function o(u){n[u]||S[u]||(J[u]?J[u].forEach(o):(r.push(u),n[u]=!0))}throw e.forEach(o),new Wt(t+": "+r.map(kt).join([", "]))}function Pe(t,e,r,n,o,u,c){var a=_e(e,r);t=h(t),o=B(n,o),ye(t,function(){Ce("Cannot call "+t+" due to unbound types",a)},e-1),Tt([],a,function(s){var f=[s[0],null].concat(s.slice(1));return be(t,me(t,f,null,o,u),e-1),[]})}function Ee(t,e,r){switch(e){case 0:return r?function(n){return j[n]}:function(n){return v[n]};case 1:return r?function(n){return I[n>>1]}:function(n){return L[n>>1]};case 2:return r?function(n){return F[n>>2]}:function(n){return p[n>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function We(t,e,r,n,o){e=h(e);var u=ot(r),c=l=>l;if(n===0){var a=32-8*r;c=l=>l<>>a}var s=e.includes("unsigned"),f=(l,d)=>{};A(t,{name:e,fromWireType:c,toWireType:s?function(l,d){return f(d,this.name),d>>>0}:function(l,d){return f(d,this.name),d},argPackAdvance:8,readValueFromPointer:Ee(e,u,n!==0),destructorFunction:null})}function ke(t,e,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function o(u){var c=p,a=c[u>>=2],s=c[u+1];return new n(c.buffer,s,a)}A(t,{name:r=h(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}function je(t,e,r,n){if(!(n>0))return 0;for(var o=r,u=r+n-1,c=0;c=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++c)),a<=127){if(r>=u)break;e[r++]=a}else if(a<=2047){if(r+1>=u)break;e[r++]=192|a>>6,e[r++]=128|63&a}else if(a<=65535){if(r+2>=u)break;e[r++]=224|a>>12,e[r++]=128|a>>6&63,e[r++]=128|63&a}else{if(r+3>=u)break;e[r++]=240|a>>18,e[r++]=128|a>>12&63,e[r++]=128|a>>6&63,e[r++]=128|63&a}}return e[r]=0,r-o}function Fe(t,e,r){return je(t,v,e,r)}function Re(t){for(var e=0,r=0;r=55296&&n<=57343?(e+=4,++r):e+=3}return e}var jt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function Ft(t,e,r){for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&jt)return jt.decode(t.subarray(e,o));for(var u="";e>10,56320|1023&f)}}else u+=String.fromCharCode((31&c)<<6|a)}else u+=String.fromCharCode(c)}return u}function Se(t,e){return t?Ft(v,t,e):""}function xe(t,e){var r=(e=h(e))==="std::string";A(t,{name:e,fromWireType:function(n){var o,u=p[n>>2],c=n+4;if(r)for(var a=c,s=0;s<=u;++s){var f=c+s;if(s==u||v[f]==0){var l=Se(a,f-a);o===void 0?o=l:(o+=String.fromCharCode(0),o+=l),a=f+1}}else{var d=new Array(u);for(s=0;s>2]=u,r&&c)Fe(o,s,u+1);else if(c)for(var f=0;f255&&(T(s),m("String has UTF-16 code units that do not fit in 8 bits")),v[s+f]=l}else for(f=0;f>1,o=n+e/2;!(n>=o)&&L[n];)++n;if((r=n<<1)-t>32&&Rt)return Rt.decode(v.subarray(t,r));for(var u="",c=0;!(c>=e/2);++c){var a=I[t+2*c>>1];if(a==0)break;u+=String.fromCharCode(a)}return u}function Ie(t,e,r){if(r===void 0&&(r=2147483647),r<2)return 0;for(var n=e,o=(r-=2)<2*t.length?r/2:t.length,u=0;u>1]=c,e+=2}return I[e>>1]=0,e-n}function Oe(t){return 2*t.length}function De(t,e){for(var r=0,n="";!(r>=e/4);){var o=F[t+4*r>>2];if(o==0)break;if(++r,o>=65536){var u=o-65536;n+=String.fromCharCode(55296|u>>10,56320|1023&u)}else n+=String.fromCharCode(o)}return n}function He(t,e,r){if(r===void 0&&(r=2147483647),r<4)return 0;for(var n=e,o=n+r-4,u=0;u=55296&&c<=57343&&(c=65536+((1023&c)<<10)|1023&t.charCodeAt(++u)),F[e>>2]=c,(e+=4)+4>o)break}return F[e>>2]=0,e-n}function ze(t){for(var e=0,r=0;r=55296&&n<=57343&&++r,e+=4}return e}function Ve(t,e,r){var n,o,u,c,a;r=h(r),e===2?(n=Ue,o=Ie,c=Oe,u=()=>L,a=1):e===4&&(n=De,o=He,c=ze,u=()=>p,a=2),A(t,{name:r,fromWireType:function(s){for(var f,l=p[s>>2],d=u(),C=s+4,y=0;y<=l;++y){var _=s+4+y*e;if(y==l||d[_>>a]==0){var W=n(C,_-C);f===void 0?f=W:(f+=String.fromCharCode(0),f+=W),C=_+e}}return T(s),f},toWireType:function(s,f){typeof f!="string"&&m("Cannot pass non-string to C++ string type "+r);var l=c(f),d=at(4+l+e);return p[d>>2]=l>>a,o(f,d+4,l+e),s!==null&&s.push(T,d),d},argPackAdvance:8,readValueFromPointer:Z,destructorFunction:function(s){T(s)}})}function Me(t,e,r,n,o,u){X[t]={name:h(e),rawConstructor:B(r,n),rawDestructor:B(o,u),fields:[]}}function Be(t,e,r,n,o,u,c,a,s,f){X[t].fields.push({fieldName:h(e),getterReturnType:r,getter:B(n,o),getterContext:u,setterArgumentType:c,setter:B(a,s),setterContext:f})}function qe(t,e){A(t,{isVoid:!0,name:e=h(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(r,n){}})}function Ne(t){t>4&&(g.get(t).refcount+=1)}var Le={};function $e(t){var e=Le[t];return e===void 0?h(t):e}function Ge(t){return K.toHandle($e(t))}function Xe(t,e){var r=S[t];return r===void 0&&m(e+" has unknown type "+kt(t)),r}function Ze(t,e){var r=(t=Xe(t,"_emval_take_value")).readValueFromPointer(e);return K.toHandle(r)}function Je(){$("")}function Ke(t,e,r){v.copyWithin(t,e,e+r)}function Qe(){return 2147483648}function Ye(t){var e=N.buffer;try{return N.grow(t-e.byteLength+65535>>>16),pt(),1}catch{}}function tr(t){var e=v.length;t>>>=0;var r=Qe();if(t>r)return!1;let n=(c,a)=>c+(a-c%a)%a;for(var o=1;o<=4;o*=2){var u=e*(1+.2/o);if(u=Math.min(u,t+100663296),Ye(Math.min(r,n(Math.max(t,u),65536))))return!0}return!1}function er(t){return 52}function rr(t,e,r,n,o){return 70}var nr=[null,[],[]];function ir(t,e){var r=nr[t];e===0||e===10?((t===1?Vt:U)(Ft(r,0)),r.length=0):r.push(e)}function or(t,e,r,n){for(var o=0,u=0;u>2],a=p[e+4>>2];e+=8;for(var s=0;s>2]=o,0}wt=i.InternalError=it(Error,"InternalError"),ce(),Pt=i.BindingError=it(Error,"BindingError"),de(),Wt=i.UnboundTypeError=it(Error,"UnboundTypeError");var St={__call_sighandler:Yt,__cxa_throw:ee,_embind_finalize_value_object:ae,_embind_register_bigint:ue,_embind_register_bool:se,_embind_register_emval:pe,_embind_register_float:he,_embind_register_function:Pe,_embind_register_integer:We,_embind_register_memory_view:ke,_embind_register_std_string:xe,_embind_register_std_wstring:Ve,_embind_register_value_object:Me,_embind_register_value_object_field:Be,_embind_register_void:qe,_emval_decref:Et,_emval_incref:Ne,_emval_new_cstring:Ge,_emval_take_value:Ze,abort:Je,emscripten_memcpy_big:Ke,emscripten_resize_heap:tr,fd_close:er,fd_seek:rr,fd_write:or};Qt();var at=function(){return(at=i.asm.malloc).apply(null,arguments)},T=function(){return(T=i.asm.free).apply(null,arguments)},xt=function(){return(xt=i.asm.__getTypeName).apply(null,arguments)};i.__embind_initialize_bindings=function(){return(i.__embind_initialize_bindings=i.asm._embind_initialize_bindings).apply(null,arguments)};var Q,Ut=function(){return(Ut=i.asm.__cxa_is_pointer_type).apply(null,arguments)};function It(){function t(){Q||(Q=!0,i.calledRun=!0,dt||(Bt(),H(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),qt()))}R>0||(Mt(),R>0||(i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),t()},1)):t()))}if(i.dynCall_vij=function(){return(i.dynCall_vij=i.asm.dynCall_vij).apply(null,arguments)},i.dynCall_jiji=function(){return(i.dynCall_jiji=i.asm.dynCall_jiji).apply(null,arguments)},V=function t(){Q||It(),Q||(V=t)},i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return It(),k.ready},Ot.exports=Dt;var Ht=tt.exports;const fr=cr({__proto__:null,default:ur(Ht)},[Ht]);export{fr as i}; diff --git a/assets/icon-25aef281.js b/assets/icon-25aef281.js new file mode 100644 index 0000000..c4c4758 --- /dev/null +++ b/assets/icon-25aef281.js @@ -0,0 +1,5 @@ +import{f6 as u,f7 as p,fc as b,f9 as h,fa as g,fb as v,fd as z}from"./index-080e108a.js";import{c as y}from"./observers-4ce6e1b4.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const C={icon:"icon",flipRtl:"flip-rtl"},m={},f={},d={s:16,m:24,l:32};async function w({icon:t,scale:e}){const s=d[e],n=I(t),o=n.charAt(n.length-1)==="F",i=`${o?n.substring(0,n.length-1):n}${s}${o?"F":""}`;if(m[i])return m[i];f[i]||(f[i]=fetch(z(`./assets/icon/${i}.json`)).then(r=>r.json()).catch(()=>(console.error(`"${i}" is not a valid calcite-ui-icon name`),"")));const c=await f[i];return m[i]=c,c}function I(t){const e=!isNaN(Number(t.charAt(0))),s=t.split("-");if(s.length>0){const o=/[a-z]/i;t=s.map((l,i)=>l.replace(o,function(r,a){return i===0&&a===0?r:r.toUpperCase()})).join("")}return e?`i${t}`:t}const x=":host{display:inline-flex;color:var(--calcite-ui-icon-color)}:host([scale=s]){block-size:1rem;inline-size:1rem;min-inline-size:1rem;min-block-size:1rem}:host([scale=m]){block-size:1.5rem;inline-size:1.5rem;min-inline-size:1.5rem;min-block-size:1.5rem}:host([scale=l]){block-size:2rem;inline-size:2rem;min-inline-size:2rem;min-block-size:2rem}.flip-rtl{transform:scaleX(-1)}.svg{display:block}:host([hidden]){display:none}[hidden]{display:none}",D=u(class extends p{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=null,this.flipRtl=!1,this.scale="m",this.textLabel=void 0,this.pathData=void 0,this.visible=!1}connectedCallback(){this.waitUntilVisible(()=>{this.visible=!0,this.loadIconPathData()})}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect(),this.intersectionObserver=null}async componentWillLoad(){this.loadIconPathData()}render(){const{el:t,flipRtl:e,pathData:s,scale:n,textLabel:o}=this,l=b(t),i=d[n],c=!!o,r=[].concat(s||"");return h(v,{"aria-hidden":g(!c),"aria-label":c?o:null,role:c?"img":null},h("svg",{"aria-hidden":"true",class:{[C.flipRtl]:l==="rtl"&&e,svg:!0},fill:"currentColor",height:"100%",viewBox:`0 0 ${i} ${i}`,width:"100%",xmlns:"http://www.w3.org/2000/svg"},r.map(a=>typeof a=="string"?h("path",{d:a}):h("path",{d:a.d,opacity:"opacity"in a?a.opacity:1}))))}async loadIconPathData(){const{icon:t,scale:e,visible:s}=this;!t||!s||(this.pathData=await w({icon:t,scale:e}))}waitUntilVisible(t){if(this.intersectionObserver=y("intersection",e=>{e.forEach(s=>{s.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,t())})},{rootMargin:"50px"}),!this.intersectionObserver){t();return}this.intersectionObserver.observe(this.el)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{icon:["loadIconPathData"],scale:["loadIconPathData"]}}static get style(){return x}},[1,"calcite-icon",{icon:[513],flipRtl:[516,"flip-rtl"],scale:[513],textLabel:[1,"text-label"],pathData:[32],visible:[32]}]);function k(){if(typeof customElements>"u")return;["calcite-icon"].forEach(e=>{switch(e){case"calcite-icon":customElements.get(e)||customElements.define(e,D);break}})}k();export{D as I,k as d}; diff --git a/assets/id_ID2-56ecb0c6.js b/assets/id_ID2-56ecb0c6.js new file mode 100644 index 0000000..6e14cfd --- /dev/null +++ b/assets/id_ID2-56ecb0c6.js @@ -0,0 +1 @@ +const _={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"M",_era_bc:"SM",A:"AM",P:"PM",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"Januari",February:"Februari",March:"Maret",April:"April",May:"Mei",June:"Juni",July:"Juli",August:"Agustus",September:"September",October:"Oktober",November:"November",December:"Desember",Jan:"Jan",Feb:"Feb",Mar:"Mar",Apr:"Apr","May(short)":"Mei",Jun:"Jun",Jul:"Jul",Aug:"Agu",Sep:"Sep",Oct:"Okt",Nov:"Nov",Dec:"Des",Sunday:"Minggu",Monday:"Senin",Tuesday:"Selasa",Wednesday:"Rabu",Thursday:"Kamis",Friday:"Jumat",Saturday:"Sabtu",Sun:"Min",Mon:"Sen",Tue:"Sel",Wed:"Rab",Thu:"Kam",Fri:"Jum",Sat:"Sab",_dateOrd:function(a){let e="th";if(a<11||a>13)switch(a%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Perkecil",Play:"Putar",Stop:"Hentikan",Legend:"Legenda","Press ENTER to toggle":"Klik, ketuk atau tekan ENTER untuk beralih",Loading:"Memuat",Home:"Beranda",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"Peta","Press ENTER to zoom in":"Tekan ENTER untuk memperbesar","Press ENTER to zoom out":"Tekan ENTER untuk memperkecil","Use arrow keys to zoom in and out":"Gunakan tombol panah untuk memperbesar dan memperkecil","Use plus and minus keys on your keyboard to zoom in and out":"Gunakan tombol plus dan minus pada keyboard Anda untuk memperbesar dan memperkecil",Export:"Cetak",Image:"Gambar",Data:"Data",Print:"Cetak","Press ENTER to open":"Klik, ketuk atau tekan ENTER untuk membuka","Press ENTER to print.":"Klik, ketuk atau tekan ENTER untuk mencetak","Press ENTER to export as %1.":"Klik, ketuk atau tekan ENTER untuk mengekspor sebagai %1","(Press ESC to close this message)":"Tekan ESC untuk menutup pesan ini","Image Export Complete":"Ekspor gambar selesai","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Dari %1 ke %2","From %1":"Dari %1","To %1":"Ke %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{_ as default}; diff --git a/assets/imageBitmapUtils-391f7b8f.js b/assets/imageBitmapUtils-391f7b8f.js new file mode 100644 index 0000000..8d56f43 --- /dev/null +++ b/assets/imageBitmapUtils-391f7b8f.js @@ -0,0 +1 @@ +import{ar as l,ax as c}from"./index-080e108a.js";async function u(a,e,t){let r;try{r=await createImageBitmap(a)}catch(o){throw new l("request:server",`Unable to load ${e}`,{url:e,error:o})}return c(t),r}async function w(a,e,t,r,o){let n;try{n=await createImageBitmap(a)}catch(s){throw new l("request:server",`Unable to load tile ${e}/${t}/${r}`,{error:s,level:e,row:t,col:r})}return c(o),n}export{w as o,u as t}; diff --git a/assets/imageutils-51a204ba.js b/assets/imageutils-51a204ba.js new file mode 100644 index 0000000..6b27bd4 --- /dev/null +++ b/assets/imageutils-51a204ba.js @@ -0,0 +1 @@ +import{ar as r,ec as g,ed as c}from"./index-080e108a.js";function f(n){const t=i(n);return t!=null?t.toDataURL():""}async function u(n){const t=i(n);if(t==null)throw new r("imageToArrayBuffer","Unsupported image type");const e=await s(n),a=await new Promise(o=>t.toBlob(o,e));if(!a)throw new r("imageToArrayBuffer","Failed to encode image");return{data:await a.arrayBuffer(),type:e}}async function s(n){if(!(n instanceof HTMLImageElement))return"image/png";const t=n.src;if(g(t)){const e=c(t);return(e==null?void 0:e.mediaType)==="image/jpeg"?e.mediaType:"image/png"}return/\.png$/i.test(t)?"image/png":/\.(jpg|jpeg)$/i.test(t)?"image/jpeg":"image/png"}function i(n){if(n instanceof HTMLCanvasElement)return n;if(n instanceof HTMLVideoElement)return null;const t=document.createElement("canvas");t.width=n.width,t.height=n.height;const e=t.getContext("2d");return n instanceof HTMLImageElement?e.drawImage(n,0,0,n.width,n.height):n instanceof ImageData&&e.putImageData(n,0,0),t}function p(n){const t=[],e=new Uint8Array(n);for(let a=0;a{for(const s of n)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function r(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(n){if(n.ep)return;n.ep=!0;const s=r(n);fetch(n.href,s)}})();function o$e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Lpe={exports:{}},CF={},Dpe={exports:{}},Nr={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var eP=Symbol.for("react.element"),a$e=Symbol.for("react.portal"),l$e=Symbol.for("react.fragment"),c$e=Symbol.for("react.strict_mode"),u$e=Symbol.for("react.profiler"),h$e=Symbol.for("react.provider"),d$e=Symbol.for("react.context"),p$e=Symbol.for("react.forward_ref"),f$e=Symbol.for("react.suspense"),m$e=Symbol.for("react.memo"),g$e=Symbol.for("react.lazy"),qK=Symbol.iterator;function y$e(t){return t===null||typeof t!="object"?null:(t=qK&&t[qK]||t["@@iterator"],typeof t=="function"?t:null)}var Npe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Fpe=Object.assign,Upe={};function sE(t,e,r){this.props=t,this.context=e,this.refs=Upe,this.updater=r||Npe}sE.prototype.isReactComponent={};sE.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};sE.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function kpe(){}kpe.prototype=sE.prototype;function xq(t,e,r){this.props=t,this.context=e,this.refs=Upe,this.updater=r||Npe}var Tq=xq.prototype=new kpe;Tq.constructor=xq;Fpe(Tq,sE.prototype);Tq.isPureReactComponent=!0;var XK=Array.isArray,zpe=Object.prototype.hasOwnProperty,Sq={current:null},Bpe={key:!0,ref:!0,__self:!0,__source:!0};function Vpe(t,e,r){var i,n={},s=null,o=null;if(e!=null)for(i in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)zpe.call(e,i)&&!Bpe.hasOwnProperty(i)&&(n[i]=e[i]);var a=arguments.length-2;if(a===1)n.children=r;else if(1>>1,Z=I[H];if(0>>1;Hn(Re,B))Ken(_t,Re)?(I[H]=_t,I[Ke]=B,H=Ke):(I[H]=Re,I[de]=B,H=de);else if(Ken(_t,B))I[H]=_t,I[Ke]=B,H=Ke;else break e}}return L}function n(I,L){var B=I.sortIndex-L.sortIndex;return B!==0?B:I.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,d=null,p=3,m=!1,y=!1,_=!1,v=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(I){for(var L=r(c);L!==null;){if(L.callback===null)i(c);else if(L.startTime<=I)i(c),L.sortIndex=L.expirationTime,e(l,L);else break;L=r(c)}}function S(I){if(_=!1,T(I),!y)if(r(l)!==null)y=!0,Q(A);else{var L=r(c);L!==null&&M(S,L.startTime-I)}}function A(I,L){y=!1,_&&(_=!1,b(P),P=-1),m=!0;var B=p;try{for(T(L),d=r(l);d!==null&&(!(d.expirationTime>L)||I&&!V());){var H=d.callback;if(typeof H=="function"){d.callback=null,p=d.priorityLevel;var Z=H(d.expirationTime<=L);L=t.unstable_now(),typeof Z=="function"?d.callback=Z:d===r(l)&&i(l),T(L)}else i(l);d=r(l)}if(d!==null)var K=!0;else{var de=r(c);de!==null&&M(S,de.startTime-L),K=!1}return K}finally{d=null,p=B,m=!1}}var C=!1,R=null,P=-1,F=5,k=-1;function V(){return!(t.unstable_now()-kI||125H?(I.sortIndex=B,e(c,I),r(l)===null&&I===r(c)&&(_?(b(P),P=-1):_=!0,M(S,B-H))):(I.sortIndex=Z,e(l,I),y||m||(y=!0,Q(A))),I},t.unstable_shouldYield=V,t.unstable_wrapCallback=function(I){var L=p;return function(){var B=p;p=L;try{return I.apply(this,arguments)}finally{p=B}}}})(Wpe);Hpe.exports=Wpe;var O$e=Hpe.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var qpe=Cq,gu=O$e;function Oe(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vB=Object.prototype.hasOwnProperty,R$e=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ZK={},QK={};function P$e(t){return vB.call(QK,t)?!0:vB.call(ZK,t)?!1:R$e.test(t)?QK[t]=!0:(ZK[t]=!0,!1)}function M$e(t,e,r,i){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function $$e(t,e,r,i){if(e===null||typeof e>"u"||M$e(t,e,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Ll(t,e,r,i,n,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var ga={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ga[t]=new Ll(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ga[e]=new Ll(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ga[t]=new Ll(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ga[t]=new Ll(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){ga[t]=new Ll(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ga[t]=new Ll(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ga[t]=new Ll(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ga[t]=new Ll(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ga[t]=new Ll(t,5,!1,t.toLowerCase(),null,!1,!1)});var Aq=/[\-:]([a-z])/g;function Oq(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Aq,Oq);ga[e]=new Ll(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Aq,Oq);ga[e]=new Ll(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Aq,Oq);ga[e]=new Ll(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ga[t]=new Ll(t,1,!1,t.toLowerCase(),null,!1,!1)});ga.xlinkHref=new Ll("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ga[t]=new Ll(t,1,!1,t.toLowerCase(),null,!0,!0)});function Rq(t,e,r,i){var n=ga.hasOwnProperty(e)?ga[e]:null;(n!==null?n.type!==0:i||!(2a||n[o]!==s[a]){var l=` +`+n[o].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{gU=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?r3(t):""}function I$e(t){switch(t.tag){case 5:return r3(t.type);case 16:return r3("Lazy");case 13:return r3("Suspense");case 19:return r3("SuspenseList");case 0:case 2:case 15:return t=yU(t.type,!1),t;case 11:return t=yU(t.type.render,!1),t;case 1:return t=yU(t.type,!0),t;default:return""}}function TB(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case W2:return"Fragment";case H2:return"Portal";case bB:return"Profiler";case Pq:return"StrictMode";case wB:return"Suspense";case xB:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Zpe:return(t.displayName||"Context")+".Consumer";case Ype:return(t._context.displayName||"Context")+".Provider";case Mq:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case $q:return e=t.displayName||null,e!==null?e:TB(t.type)||"Memo";case Ey:e=t._payload,t=t._init;try{return TB(t(e))}catch{}}return null}function L$e(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return TB(e);case 8:return e===Pq?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function M_(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Jpe(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function D$e(t){var e=Jpe(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return n.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function fM(t){t._valueTracker||(t._valueTracker=D$e(t))}function Kpe(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),i="";return t&&(i=Jpe(t)?t.checked?"true":"false":t.value),t=i,t!==r?(e.setValue(t),!0):!1}function SN(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function SB(t,e){var r=e.checked;return Yn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function KK(t,e){var r=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;r=M_(e.value!=null?e.value:r),t._wrapperState={initialChecked:i,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function efe(t,e){e=e.checked,e!=null&&Rq(t,"checked",e,!1)}function EB(t,e){efe(t,e);var r=M_(e.value),i=e.type;if(r!=null)i==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?CB(t,e.type,r):e.hasOwnProperty("defaultValue")&&CB(t,e.type,M_(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function eee(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function CB(t,e,r){(e!=="number"||SN(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var i3=Array.isArray;function ST(t,e,r,i){if(t=t.options,e){e={};for(var n=0;n"+e.valueOf().toString()+"",e=mM.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function MO(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var OA={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},N$e=["Webkit","ms","Moz","O"];Object.keys(OA).forEach(function(t){N$e.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),OA[e]=OA[t]})});function nfe(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||OA.hasOwnProperty(t)&&OA[t]?(""+e).trim():e+"px"}function sfe(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var i=r.indexOf("--")===0,n=nfe(r,e[r],i);r==="float"&&(r="cssFloat"),i?t.setProperty(r,n):t[r]=n}}var F$e=Yn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function RB(t,e){if(e){if(F$e[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Oe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Oe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Oe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Oe(62))}}function PB(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var MB=null;function Iq(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var $B=null,ET=null,CT=null;function iee(t){if(t=iP(t)){if(typeof $B!="function")throw Error(Oe(280));var e=t.stateNode;e&&(e=MF(e),$B(t.stateNode,t.type,e))}}function ofe(t){ET?CT?CT.push(t):CT=[t]:ET=t}function afe(){if(ET){var t=ET,e=CT;if(CT=ET=null,iee(t),e)for(t=0;t>>=0,t===0?32:31-(X$e(t)/Y$e|0)|0}var gM=64,yM=4194304;function n3(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function ON(t,e){var r=t.pendingLanes;if(r===0)return 0;var i=0,n=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~n;a!==0?i=n3(a):(s&=o,s!==0&&(i=n3(s)))}else o=r&~n,o!==0?i=n3(o):s!==0&&(i=n3(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&n)&&(n=i&-i,s=e&-e,n>=s||n===16&&(s&4194240)!==0))return e;if(i&4&&(i|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=i;0r;r++)e.push(t);return e}function tP(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Qd(e),t[e]=r}function K$e(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0=PA),dee=String.fromCharCode(32),pee=!1;function Afe(t,e){switch(t){case"keyup":return AIe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ofe(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var q2=!1;function RIe(t,e){switch(t){case"compositionend":return Ofe(e);case"keypress":return e.which!==32?null:(pee=!0,dee);case"textInput":return t=e.data,t===dee&&pee?null:t;default:return null}}function PIe(t,e){if(q2)return t==="compositionend"||!Bq&&Afe(t,e)?(t=Efe(),RL=Uq=Yy=null,q2=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=yee(r)}}function $fe(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?$fe(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Ife(){for(var t=window,e=SN();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=SN(t.document)}return e}function Vq(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function kIe(t){var e=Ife(),r=t.focusedElem,i=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&$fe(r.ownerDocument.documentElement,r)){if(i!==null&&Vq(r)){if(e=i.start,t=i.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var n=r.textContent.length,s=Math.min(i.start,n);i=i.end===void 0?s:Math.min(i.end,n),!t.extend&&s>i&&(n=i,i=s,s=n),n=_ee(r,s);var o=_ee(r,i);n&&o&&(t.rangeCount!==1||t.anchorNode!==n.node||t.anchorOffset!==n.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(n.node,n.offset),t.removeAllRanges(),s>i?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,X2=null,UB=null,$A=null,kB=!1;function vee(t,e,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;kB||X2==null||X2!==SN(i)||(i=X2,"selectionStart"in i&&Vq(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),$A&&FO($A,i)||($A=i,i=MN(UB,"onSelect"),0Q2||(t.current=HB[Q2],HB[Q2]=null,Q2--)}function pn(t,e){Q2++,HB[Q2]=t.current,t.current=e}var $_={},Ya=n1($_),_c=n1(!1),Bb=$_;function sS(t,e){var r=t.type.contextTypes;if(!r)return $_;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var n={},s;for(s in r)n[s]=e[s];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=n),n}function vc(t){return t=t.childContextTypes,t!=null}function IN(){Mn(_c),Mn(Ya)}function Cee(t,e,r){if(Ya.current!==$_)throw Error(Oe(168));pn(Ya,e),pn(_c,r)}function Vfe(t,e,r){var i=t.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var n in i)if(!(n in e))throw Error(Oe(108,L$e(t)||"Unknown",n));return Yn({},r,i)}function LN(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||$_,Bb=Ya.current,pn(Ya,t),pn(_c,_c.current),!0}function Aee(t,e,r){var i=t.stateNode;if(!i)throw Error(Oe(169));r?(t=Vfe(t,e,Bb),i.__reactInternalMemoizedMergedChildContext=t,Mn(_c),Mn(Ya),pn(Ya,t)):Mn(_c),pn(_c,r)}var ig=null,$F=!1,MU=!1;function Gfe(t){ig===null?ig=[t]:ig.push(t)}function QIe(t){$F=!0,Gfe(t)}function s1(){if(!MU&&ig!==null){MU=!0;var t=0,e=zi;try{var r=ig;for(zi=1;t>=o,n-=o,ug=1<<32-Qd(e)+n|r<P?(F=R,R=null):F=R.sibling;var k=p(b,R,T[P],S);if(k===null){R===null&&(R=F);break}t&&R&&k.alternate===null&&e(b,R),x=s(k,x,P),C===null?A=k:C.sibling=k,C=k,R=F}if(P===T.length)return r(b,R),Fn&&iv(b,P),A;if(R===null){for(;PP?(F=R,R=null):F=R.sibling;var V=p(b,R,k.value,S);if(V===null){R===null&&(R=F);break}t&&R&&V.alternate===null&&e(b,R),x=s(V,x,P),C===null?A=V:C.sibling=V,C=V,R=F}if(k.done)return r(b,R),Fn&&iv(b,P),A;if(R===null){for(;!k.done;P++,k=T.next())k=d(b,k.value,S),k!==null&&(x=s(k,x,P),C===null?A=k:C.sibling=k,C=k);return Fn&&iv(b,P),A}for(R=i(b,R);!k.done;P++,k=T.next())k=m(R,b,P,k.value,S),k!==null&&(t&&k.alternate!==null&&R.delete(k.key===null?P:k.key),x=s(k,x,P),C===null?A=k:C.sibling=k,C=k);return t&&R.forEach(function(z){return e(b,z)}),Fn&&iv(b,P),A}function v(b,x,T,S){if(typeof T=="object"&&T!==null&&T.type===W2&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case pM:e:{for(var A=T.key,C=x;C!==null;){if(C.key===A){if(A=T.type,A===W2){if(C.tag===7){r(b,C.sibling),x=n(C,T.props.children),x.return=b,b=x;break e}}else if(C.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Ey&&Lee(A)===C.type){r(b,C.sibling),x=n(C,T.props),x.ref=WE(b,C,T),x.return=b,b=x;break e}r(b,C);break}else e(b,C);C=C.sibling}T.type===W2?(x=Tb(T.props.children,b.mode,S,T.key),x.return=b,b=x):(S=FL(T.type,T.key,T.props,null,b.mode,S),S.ref=WE(b,x,T),S.return=b,b=S)}return o(b);case H2:e:{for(C=T.key;x!==null;){if(x.key===C)if(x.tag===4&&x.stateNode.containerInfo===T.containerInfo&&x.stateNode.implementation===T.implementation){r(b,x.sibling),x=n(x,T.children||[]),x.return=b,b=x;break e}else{r(b,x);break}else e(b,x);x=x.sibling}x=kU(T,b.mode,S),x.return=b,b=x}return o(b);case Ey:return C=T._init,v(b,x,C(T._payload),S)}if(i3(T))return y(b,x,T,S);if(BE(T))return _(b,x,T,S);SM(b,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,x!==null&&x.tag===6?(r(b,x.sibling),x=n(x,T),x.return=b,b=x):(r(b,x),x=UU(T,b.mode,S),x.return=b,b=x),o(b)):r(b,x)}return v}var aS=Qfe(!0),Jfe=Qfe(!1),nP={},$f=n1(nP),BO=n1(nP),VO=n1(nP);function db(t){if(t===nP)throw Error(Oe(174));return t}function Qq(t,e){switch(pn(VO,e),pn(BO,t),pn($f,nP),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:OB(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=OB(e,t)}Mn($f),pn($f,e)}function lS(){Mn($f),Mn(BO),Mn(VO)}function Kfe(t){db(VO.current);var e=db($f.current),r=OB(e,t.type);e!==r&&(pn(BO,t),pn($f,r))}function Jq(t){BO.current===t&&(Mn($f),Mn(BO))}var Wn=n1(0);function zN(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var $U=[];function Kq(){for(var t=0;t<$U.length;t++)$U[t]._workInProgressVersionPrimary=null;$U.length=0}var $L=Yg.ReactCurrentDispatcher,IU=Yg.ReactCurrentBatchConfig,Gb=0,qn=null,go=null,Io=null,BN=!1,IA=!1,GO=0,KIe=0;function Ta(){throw Error(Oe(321))}function eX(t,e){if(e===null)return!1;for(var r=0;rr?r:4,t(!0);var i=IU.transition;IU.transition={};try{t(!1),e()}finally{zi=r,IU.transition=i}}function mme(){return Ph().memoizedState}function tLe(t,e,r){var i=w_(t);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},gme(t))yme(e,r);else if(r=qfe(t,e,r,i),r!==null){var n=Al();Jd(r,t,i,n),_me(r,e,i)}}function rLe(t,e,r){var i=w_(t),n={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(gme(t))yme(e,n);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(n.hasEagerState=!0,n.eagerState=a,op(a,o)){var l=e.interleaved;l===null?(n.next=n,Yq(e)):(n.next=l.next,l.next=n),e.interleaved=n;return}}catch{}finally{}r=qfe(t,e,n,i),r!==null&&(n=Al(),Jd(r,t,i,n),_me(r,e,i))}}function gme(t){var e=t.alternate;return t===qn||e!==null&&e===qn}function yme(t,e){IA=BN=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function _me(t,e,r){if(r&4194240){var i=e.lanes;i&=t.pendingLanes,r|=i,e.lanes=r,Dq(t,r)}}var VN={readContext:Rh,useCallback:Ta,useContext:Ta,useEffect:Ta,useImperativeHandle:Ta,useInsertionEffect:Ta,useLayoutEffect:Ta,useMemo:Ta,useReducer:Ta,useRef:Ta,useState:Ta,useDebugValue:Ta,useDeferredValue:Ta,useTransition:Ta,useMutableSource:Ta,useSyncExternalStore:Ta,useId:Ta,unstable_isNewReconciler:!1},iLe={readContext:Rh,useCallback:function(t,e){return ff().memoizedState=[t,e===void 0?null:e],t},useContext:Rh,useEffect:Nee,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,IL(4194308,4,ume.bind(null,e,t),r)},useLayoutEffect:function(t,e){return IL(4194308,4,t,e)},useInsertionEffect:function(t,e){return IL(4,2,t,e)},useMemo:function(t,e){var r=ff();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var i=ff();return e=r!==void 0?r(e):e,i.memoizedState=i.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},i.queue=t,t=t.dispatch=tLe.bind(null,qn,t),[i.memoizedState,t]},useRef:function(t){var e=ff();return t={current:t},e.memoizedState=t},useState:Dee,useDebugValue:nX,useDeferredValue:function(t){return ff().memoizedState=t},useTransition:function(){var t=Dee(!1),e=t[0];return t=eLe.bind(null,t[1]),ff().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var i=qn,n=ff();if(Fn){if(r===void 0)throw Error(Oe(407));r=r()}else{if(r=e(),jo===null)throw Error(Oe(349));Gb&30||rme(i,e,r)}n.memoizedState=r;var s={value:r,getSnapshot:e};return n.queue=s,Nee(nme.bind(null,i,s,t),[t]),i.flags|=2048,HO(9,ime.bind(null,i,s,r,e),void 0,null),r},useId:function(){var t=ff(),e=jo.identifierPrefix;if(Fn){var r=hg,i=ug;r=(i&~(1<<32-Qd(i)-1)).toString(32)+r,e=":"+e+"R"+r,r=GO++,0<\/script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=o.createElement(r,{is:i.is}):(t=o.createElement(r),r==="select"&&(o=t,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):t=o.createElementNS(t,r),t[vf]=e,t[zO]=i,Ame(t,e,!1,!1),e.stateNode=t;e:{switch(o=PB(r,i),r){case"dialog":bn("cancel",t),bn("close",t),n=i;break;case"iframe":case"object":case"embed":bn("load",t),n=i;break;case"video":case"audio":for(n=0;nuS&&(e.flags|=128,i=!0,qE(s,!1),e.lanes=4194304)}else{if(!i)if(t=zN(o),t!==null){if(e.flags|=128,i=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),qE(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Fn)return Sa(e),null}else 2*Ts()-s.renderingStartTime>uS&&r!==1073741824&&(e.flags|=128,i=!0,qE(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Ts(),e.sibling=null,r=Wn.current,pn(Wn,i?r&1|2:r&1),e):(Sa(e),null);case 22:case 23:return uX(),i=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Xc&1073741824&&(Sa(e),e.subtreeFlags&6&&(e.flags|=8192)):Sa(e),null;case 24:return null;case 25:return null}throw Error(Oe(156,e.tag))}function hLe(t,e){switch(jq(e),e.tag){case 1:return vc(e.type)&&IN(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return lS(),Mn(_c),Mn(Ya),Kq(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Jq(e),null;case 13:if(Mn(Wn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Oe(340));oS()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Mn(Wn),null;case 4:return lS(),null;case 10:return Xq(e.type._context),null;case 22:case 23:return uX(),null;case 24:return null;default:return null}}var CM=!1,Ga=!1,dLe=typeof WeakSet=="function"?WeakSet:Set,ct=null;function tT(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){is(t,e,i)}else r.current=null}function iV(t,e,r){try{r()}catch(i){is(t,e,i)}}var Hee=!1;function pLe(t,e){if(zB=RN,t=Ife(),Vq(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var n=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,l=-1,c=0,u=0,d=t,p=null;t:for(;;){for(var m;d!==r||n!==0&&d.nodeType!==3||(a=o+n),d!==s||i!==0&&d.nodeType!==3||(l=o+i),d.nodeType===3&&(o+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===t)break t;if(p===r&&++c===n&&(a=o),p===s&&++u===i&&(l=o),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(BB={focusedElem:t,selectionRange:r},RN=!1,ct=e;ct!==null;)if(e=ct,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ct=t;else for(;ct!==null;){e=ct;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var _=y.memoizedProps,v=y.memoizedState,b=e.stateNode,x=b.getSnapshotBeforeUpdate(e.elementType===e.type?_:Rd(e.type,_),v);b.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var T=e.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Oe(163))}}catch(S){is(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,ct=t;break}ct=e.return}return y=Hee,Hee=!1,y}function LA(t,e,r){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var n=i=i.next;do{if((n.tag&t)===t){var s=n.destroy;n.destroy=void 0,s!==void 0&&iV(e,r,s)}n=n.next}while(n!==i)}}function DF(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var i=r.create;r.destroy=i()}r=r.next}while(r!==e)}}function nV(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function Pme(t){var e=t.alternate;e!==null&&(t.alternate=null,Pme(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[vf],delete e[zO],delete e[jB],delete e[YIe],delete e[ZIe])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Mme(t){return t.tag===5||t.tag===3||t.tag===4}function Wee(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Mme(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function sV(t,e,r){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=$N));else if(i!==4&&(t=t.child,t!==null))for(sV(t,e,r),t=t.sibling;t!==null;)sV(t,e,r),t=t.sibling}function oV(t,e,r){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(oV(t,e,r),t=t.sibling;t!==null;)oV(t,e,r),t=t.sibling}var ta=null,$d=!1;function g0(t,e,r){for(r=r.child;r!==null;)$me(t,e,r),r=r.sibling}function $me(t,e,r){if(Mf&&typeof Mf.onCommitFiberUnmount=="function")try{Mf.onCommitFiberUnmount(AF,r)}catch{}switch(r.tag){case 5:Ga||tT(r,e);case 6:var i=ta,n=$d;ta=null,g0(t,e,r),ta=i,$d=n,ta!==null&&($d?(t=ta,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):ta.removeChild(r.stateNode));break;case 18:ta!==null&&($d?(t=ta,r=r.stateNode,t.nodeType===8?PU(t.parentNode,r):t.nodeType===1&&PU(t,r),DO(t)):PU(ta,r.stateNode));break;case 4:i=ta,n=$d,ta=r.stateNode.containerInfo,$d=!0,g0(t,e,r),ta=i,$d=n;break;case 0:case 11:case 14:case 15:if(!Ga&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){n=i=i.next;do{var s=n,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&iV(r,e,o),n=n.next}while(n!==i)}g0(t,e,r);break;case 1:if(!Ga&&(tT(r,e),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(a){is(r,e,a)}g0(t,e,r);break;case 21:g0(t,e,r);break;case 22:r.mode&1?(Ga=(i=Ga)||r.memoizedState!==null,g0(t,e,r),Ga=i):g0(t,e,r);break;default:g0(t,e,r)}}function qee(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new dLe),e.forEach(function(i){var n=xLe.bind(null,t,i);r.has(i)||(r.add(i),i.then(n,n))})}}function Yh(t,e){var r=e.deletions;if(r!==null)for(var i=0;in&&(n=o),i&=~s}if(i=n,i=Ts()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*mLe(i/1960))-i,10t?16:t,Zy===null)var i=!1;else{if(t=Zy,Zy=null,HN=0,li&6)throw Error(Oe(331));var n=li;for(li|=4,ct=t.current;ct!==null;){var s=ct,o=s.child;if(ct.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lTs()-lX?xb(t,0):aX|=r),bc(t,e)}function zme(t,e){e===0&&(t.mode&1?(e=yM,yM<<=1,!(yM&130023424)&&(yM=4194304)):e=1);var r=Al();t=$g(t,e),t!==null&&(tP(t,e,r),bc(t,r))}function wLe(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),zme(t,r)}function xLe(t,e){var r=0;switch(t.tag){case 13:var i=t.stateNode,n=t.memoizedState;n!==null&&(r=n.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(Oe(314))}i!==null&&i.delete(e),zme(t,r)}var Bme;Bme=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||_c.current)fc=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return fc=!1,cLe(t,e,r);fc=!!(t.flags&131072)}else fc=!1,Fn&&e.flags&1048576&&jfe(e,NN,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;LL(t,e),t=e.pendingProps;var n=sS(e,Ya.current);OT(e,r),n=tX(null,e,i,t,n,r);var s=rX();return e.flags|=1,typeof n=="object"&&n!==null&&typeof n.render=="function"&&n.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,vc(i)?(s=!0,LN(e)):s=!1,e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,Zq(e),n.updater=IF,e.stateNode=n,n._reactInternals=e,ZB(e,i,t,r),e=KB(null,e,i,!0,s,r)):(e.tag=0,Fn&&s&&Gq(e),bl(null,e,n,r),e=e.child),e;case 16:i=e.elementType;e:{switch(LL(t,e),t=e.pendingProps,n=i._init,i=n(i._payload),e.type=i,n=e.tag=SLe(i),t=Rd(i,t),n){case 0:e=JB(null,e,i,t,r);break e;case 1:e=Vee(null,e,i,t,r);break e;case 11:e=zee(null,e,i,t,r);break e;case 14:e=Bee(null,e,i,Rd(i.type,t),r);break e}throw Error(Oe(306,i,""))}return e;case 0:return i=e.type,n=e.pendingProps,n=e.elementType===i?n:Rd(i,n),JB(t,e,i,n,r);case 1:return i=e.type,n=e.pendingProps,n=e.elementType===i?n:Rd(i,n),Vee(t,e,i,n,r);case 3:e:{if(Sme(e),t===null)throw Error(Oe(387));i=e.pendingProps,s=e.memoizedState,n=s.element,Xfe(t,e),kN(e,i,null,r);var o=e.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){n=cS(Error(Oe(423)),e),e=Gee(t,e,i,r,n);break e}else if(i!==n){n=cS(Error(Oe(424)),e),e=Gee(t,e,i,r,n);break e}else for(ou=__(e.stateNode.containerInfo.firstChild),cu=e,Fn=!0,Fd=null,r=Jfe(e,null,i,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(oS(),i===n){e=Ig(t,e,r);break e}bl(t,e,i,r)}e=e.child}return e;case 5:return Kfe(e),t===null&&qB(e),i=e.type,n=e.pendingProps,s=t!==null?t.memoizedProps:null,o=n.children,VB(i,n)?o=null:s!==null&&VB(i,s)&&(e.flags|=32),Tme(t,e),bl(t,e,o,r),e.child;case 6:return t===null&&qB(e),null;case 13:return Eme(t,e,r);case 4:return Qq(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=aS(e,null,i,r):bl(t,e,i,r),e.child;case 11:return i=e.type,n=e.pendingProps,n=e.elementType===i?n:Rd(i,n),zee(t,e,i,n,r);case 7:return bl(t,e,e.pendingProps,r),e.child;case 8:return bl(t,e,e.pendingProps.children,r),e.child;case 12:return bl(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(i=e.type._context,n=e.pendingProps,s=e.memoizedProps,o=n.value,pn(FN,i._currentValue),i._currentValue=o,s!==null)if(op(s.value,o)){if(s.children===n.children&&!_c.current){e=Ig(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=gg(-1,r&-r),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),XB(s.return,r,e),a.lanes|=r;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Oe(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),XB(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}bl(t,e,n.children,r),e=e.child}return e;case 9:return n=e.type,i=e.pendingProps.children,OT(e,r),n=Rh(n),i=i(n),e.flags|=1,bl(t,e,i,r),e.child;case 14:return i=e.type,n=Rd(i,e.pendingProps),n=Rd(i.type,n),Bee(t,e,i,n,r);case 15:return wme(t,e,e.type,e.pendingProps,r);case 17:return i=e.type,n=e.pendingProps,n=e.elementType===i?n:Rd(i,n),LL(t,e),e.tag=1,vc(i)?(t=!0,LN(e)):t=!1,OT(e,r),Zfe(e,i,n),ZB(e,i,n,r),KB(null,e,i,!0,t,r);case 19:return Cme(t,e,r);case 22:return xme(t,e,r)}throw Error(Oe(156,e.tag))};function Vme(t,e){return ffe(t,e)}function TLe(t,e,r,i){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yh(t,e,r,i){return new TLe(t,e,r,i)}function dX(t){return t=t.prototype,!(!t||!t.isReactComponent)}function SLe(t){if(typeof t=="function")return dX(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Mq)return 11;if(t===$q)return 14}return 2}function x_(t,e){var r=t.alternate;return r===null?(r=yh(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function FL(t,e,r,i,n,s){var o=2;if(i=t,typeof t=="function")dX(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case W2:return Tb(r.children,n,s,e);case Pq:o=8,n|=8;break;case bB:return t=yh(12,r,e,n|2),t.elementType=bB,t.lanes=s,t;case wB:return t=yh(13,r,e,n),t.elementType=wB,t.lanes=s,t;case xB:return t=yh(19,r,e,n),t.elementType=xB,t.lanes=s,t;case Qpe:return FF(r,n,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Ype:o=10;break e;case Zpe:o=9;break e;case Mq:o=11;break e;case $q:o=14;break e;case Ey:o=16,i=null;break e}throw Error(Oe(130,t==null?t:typeof t,""))}return e=yh(o,r,e,n),e.elementType=t,e.type=i,e.lanes=s,e}function Tb(t,e,r,i){return t=yh(7,t,i,e),t.lanes=r,t}function FF(t,e,r,i){return t=yh(22,t,i,e),t.elementType=Qpe,t.lanes=r,t.stateNode={isHidden:!1},t}function UU(t,e,r){return t=yh(6,t,null,e),t.lanes=r,t}function kU(t,e,r){return e=yh(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function ELe(t,e,r,i,n){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vU(0),this.expirationTimes=vU(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vU(0),this.identifierPrefix=i,this.onRecoverableError=n,this.mutableSourceEagerHydrationData=null}function pX(t,e,r,i,n,s,o,a,l){return t=new ELe(t,e,r,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=yh(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zq(s),t}function CLe(t,e,r){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Wme)}catch(t){console.error(t)}}Wme(),jpe.exports=Tu;var MLe=jpe.exports,tte=MLe;_B.createRoot=tte.createRoot,_B.hydrateRoot=tte.hydrateRoot;const $Le=t=>t.filter(e=>e!==void 0),qme=([t,e,r])=>`hsl(${t} ${e}% ${r}%)`;function VF(t,e=10){let r=t.flatMap(i=>Array.from({length:e},()=>i));return()=>{const i=rte(r),n=r.indexOf(i);return r.splice(n,1,rte(t)),i}}const rte=t=>t[Math.floor(Math.random()*t.length)],sP=10,yX=20,ILe=1e3,Xme=100,oP={I:{color:[180,100,50],definition:[["1"],["1"],["1"],["1"]],spawn:!0},O:{color:[200,100,50],definition:[["1","1"],["1","1"]],spawn:!0},T:{color:[300,100,50],definition:[["1","0"],["1","1"],["1","0"]],spawn:!0},S:{color:[120,100,50],definition:[["0","1","1"],["1","1","0"]],spawn:!0},J:{color:[240,100,50],definition:[["1","0","0"],["1","1","1"]],spawn:!0},Z:{color:[0,100,50],definition:[["1","1","0"],["0","1","1"]],spawn:!0},L:{color:[38.82,100,50],definition:[["1","0"],["1","0"],["1","1"]],spawn:!0},_:{color:[0,0,0],definition:[],spawn:!1}},UL=VF(Object.entries(oP).filter(([,{spawn:t}])=>t).map(([t])=>t));var Nn=(t=>(t.UP="UP",t.DOWN="DOWN",t.LEFT="LEFT",t.RIGHT="RIGHT",t))(Nn||{});const ite=t=>Object.entries(t).flatMap(([e,r])=>Object.keys(r).map(i=>[Number.parseInt(e),Number.parseInt(i)])),hS=(t,e,r=1)=>e===Nn.UP?LLe(t,r):Object.fromEntries(Object.entries(t).map(([i,n])=>[e===Nn.DOWN?Number.parseInt(i)+r:i,e===Nn.DOWN?n:Object.fromEntries(Object.keys(n).map(s=>[Number.parseInt(s)+(e===Nn.RIGHT?1:-1)*r,!0]))])),LLe=(t,e=1)=>DLe(t,r=>ULe(kLe(zLe(e,jLe(r))))),DLe=(t,e)=>[t].map(r=>({shape:r,shapeXOffset:XN(r,"x"),shapeYOffset:XN(r,"y")})).map(({shape:r,shapeXOffset:i,shapeYOffset:n})=>FLe(e(Yme(r,i,n)),i,n))[0],XN=(t,e)=>NLe((e==="x"?Object.values(t).flatMap(r=>Object.keys(r)):Object.keys(t)).map(r=>Number.parseInt(r))),NLe=t=>t.reduce((e,r)=>Number.isNaN(e)||rhS(hS(t,Nn.DOWN,r),Nn.RIGHT,e),Yme=(t,e,r)=>hS(hS(t,Nn.DOWN,-r),Nn.LEFT,e),ULe=t=>Yme(t,XN(t,"x"),XN(t,"y")),kLe=t=>Object.fromEntries(t.map((e,r)=>[r,Object.fromEntries(e.map((i,n)=>({cell:i,cellIndex:n})).filter(({cell:i})=>i).map(({cellIndex:i})=>[i,!0]))]).filter(([,e])=>Object.keys(e).length>0)),zLe=(t,e)=>Array.from(Array.from({length:t%4})).reduce(r=>BLe(r),e),BLe=t=>GLe(VLe(t)),VLe=t=>t[0].map((e,r)=>t.map(i=>i[r])),GLe=t=>t.map(e=>e.slice().reverse()),jLe=t=>[t].map(e=>({shape:e,size:Math.max(nte(e,"x"),nte(e,"y"))})).map(({shape:e,size:r})=>Array.from(new Array(r)).reduce((i,n,s)=>[...i,Array.from(new Array(r)).reduce((o,a,l)=>{var c;return[...o,(c=e[s])!=null&&c[l]?1:0]},[])],[]))[0],nte=(t,e)=>HLe((e==="y"?Object.keys(t):Object.values(t).flatMap(r=>Object.keys(r))).map(r=>Number.parseInt(r)+1)),HLe=t=>t.reduce((e,r)=>Number.isNaN(e)||r>e?r:e,Number.NaN);function WLe(t,e){const r=t.nextShapes[0],i=oP[r].definition,n=i[0].length,s=Math.round((sP-n)/2),o=t.board.some((c,u)=>c.some((d,p)=>{var m;return((m=i[u])==null?void 0:m[p-s])==="1"&&d!=="_"})),a={};function l(c,u){return a[c]??(a[c]={}),a[c][u]=!0,r}return{...t,isGameOver:o,currentShape:r,nextShapes:[...t.nextShapes.slice(1),e],currentShapeLocation:a,board:t.board.map((c,u)=>c.map((d,p)=>{var m;return((m=i[u])==null?void 0:m[p-s])==="1"?l(u,p):d}))}}function ste(t,e){return ite(e).some(([,r])=>r<0||r>=sP)?t:ite(e).some(([r])=>r>=yX)||t.board.some((r,i)=>r.some((n,s)=>{var o,a;return((o=e[i])==null?void 0:o[s])&&!((a=t.currentShapeLocation[i])!=null&&a[s])&&n!=="_"}))?qLe({...t,currentShapeLocation:{}},XLe(t.board)):{...t,currentShapeLocation:e,board:t.board.map((r,i)=>r.map((n,s)=>{var o,a;return(o=e[i])!=null&&o[s]?t.currentShape:(a=t.currentShapeLocation[i])!=null&&a[s]?"_":n}))}}const qLe=(t,e)=>e.length===0?t:{...t,score:t.score+Xme*2^e.length-1,board:[...Array.from({length:e.length}).fill(new Array(sP).fill("_")),...t.board.filter((r,i)=>!e.includes(i))]},XLe=t=>t.map((e,r)=>({isCompleted:e.every(i=>i!=="_"),index:r})).filter(({isCompleted:e})=>e).map(({index:e})=>e),Ay={initial:t=>({board:Array.from({length:yX}).fill(Array.from({length:sP}).fill("_")),currentShapeLocation:{},currentShape:"_",nextShapes:t,score:0,isPaused:!1}),togglePause:t=>({...t,isPaused:!t.isPaused}),move:(t,e)=>Object.keys(t.currentShapeLocation).length===0||t.isPaused&&e!==Nn.DOWN?t:ste(t,hS(t.currentShapeLocation,e,t.isPaused?-1:1)),hardDrop(t){let e=t,r=t;for(;Object.keys(e.currentShapeLocation).length>0;)e=r,r=Ay.move(e,Nn.DOWN);return r},gravity(t,e){return t.isPaused?t:Object.keys(t.currentShapeLocation).length===0?WLe(t,e):ste(t,hS(t.currentShapeLocation,Nn.DOWN))}},RM="tetris-react-";function Zme(t,e){const[r,i]=ai.useState(()=>{const s=localStorage.getItem(`${RM}${t}`);return s===null?e:JSON.parse(s)}),n=ai.useCallback(s=>{localStorage.setItem(`${RM}${t}`,JSON.stringify(s)),i(s)},[t]);return ai.useEffect(()=>{globalThis.addEventListener("storage",({storageArea:s,key:o,newValue:a})=>{s!==globalThis.localStorage||o===null||!o.startsWith(RM)||a===null||o.slice(RM.length)!==t||JSON.stringify(r)===a||i(JSON.parse(a))})},[]),[r,n]}const Qme=()=>Zme("bestScore",0),YLe=()=>Zme("gameState",Ay.initial(Array.from({length:5},UL))),Ss={title:"Tetris React",paused:"Game is paused",esc:"ESC",pressKeyToResume:t=>st.jsxs(st.Fragment,{children:["Press ",t," to resume"]}),instructions:"Control the game using WSAD or arrow keys. Pause using the ESC key",score:"Score: ",gameOver:"Game Over!",yourScore:"Your score was: ",yourBestScore:"Your best score is: ",playAgain:"Play again?",saveGame:"Save game",loadGame:"Load game",panoramaRenderer:"Panorama World",sceneryRenderer:"Scenery World",gridRenderer:"Grid World",changeMap:"Change Map",nextSong:"Next Song",inspiredBy:t=>st.jsxs(st.Fragment,{children:["Inspired by ",t("Tetris Effect")]}),sourceCode:"Source Code"};function Jme({score:t,nextShapes:e}){const[r]=Qme();return st.jsxs("div",{className:"p-2 overflow-hidden",children:[st.jsxs("span",{className:"text-4xl",children:[Ss.score,st.jsx("span",{className:t>r?"text-red-500":void 0,children:t})]}),st.jsx("br",{}),st.jsx("span",{className:"pt-2 text-4xl font-mono",children:e.map((i,n)=>st.jsx("span",{style:{color:qme(oP[i].color),colorScheme:"white only"},children:i},n))})]})}function ZLe({board:t,score:e,nextShapes:r}){return st.jsxs("div",{className:"grid grid-cols-4",style:{width:"100vmin",height:"100vmin"},children:[st.jsx("span",{}),st.jsx(QLe,{board:t}),st.jsx(Jme,{score:e,nextShapes:r})]})}function QLe({board:t}){return st.jsx("div",{className:"bg-gradient-to-tr from-yellow-400 to-purple-400 col-span-2 p-2",children:st.jsx("div",{className:"h-full grid grid-cols-10 gap-0.5",children:t.map((e,r)=>st.jsx(ai.Fragment,{children:e.map((i,n)=>st.jsx("div",{style:{backgroundColor:qme(oP[i].color)}},n))},r))})})}const JLe="modulepreload",KLe=function(t){return"/tetris-react/"+t},ote={},ce=function(e,r,i){if(!r||r.length===0)return e();const n=document.getElementsByTagName("link");return Promise.all(r.map(s=>{if(s=KLe(s),s in ote)return;ote[s]=!0;const o=s.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!i)for(let u=n.length-1;u>=0;u--){const d=n[u];if(d.href===s&&(!o||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${a}`))return;const c=document.createElement("link");if(c.rel=o?"stylesheet":JLe,o||(c.as="script",c.crossOrigin=""),c.href=s,document.head.appendChild(c),o)return new Promise((u,d)=>{c.addEventListener("load",u),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};function h(t,e,r,i){var n,s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(s<3?n(o):s>3?n(e,r,o):n(e,r))||o);return s>3&&o&&Object.defineProperty(e,r,o),o}function OEt(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{c(i.next(u))}catch(d){o(d)}}function l(u){try{c(i.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):n(u.value).then(a,l)}c((i=i.apply(t,e||[])).next())})}function eDe(t){return t&&t.release&&typeof t.release=="function"}function tDe(t){return t&&t.acquire&&typeof t.acquire=="function"}let ko=class hV{constructor(e,r,i,n=1,s=0){if(this._ctor=e,this._acquireFunction=r,this._releaseFunction=i,this.allocationSize=n,this._pool=new Array(s),this._initialSize=s,this._ctor)for(let o=0;o=this._pool.length)){for(let r=e;r{e+=r.length}),e}add(e,r){if(dV(e)){const i=this._getOrCreateGroup(r);for(const n of e)this._isHandle(n)&&i.push(n)}else this._isHandle(e)&&this._getOrCreateGroup(r).push(e);return this}forEach(e,r){if(typeof e=="function")this._groups.forEach(i=>i.forEach(e));else{const i=this._getGroup(e);i&&r&&i.forEach(r)}}has(e){return this._groups.has(this._ensureGroupKey(e))}remove(e){if(typeof e!="string"&&dV(e)){for(const r of e)this.remove(r);return this}return this.has(e)?(this._removeAllFromGroup(this._getGroup(e)),this._groups.delete(this._ensureGroupKey(e)),this):this}removeAll(){return this._groups.forEach(e=>this._removeAllFromGroup(e)),this._groups.clear(),this}_isHandle(e){return e&&(!!e.remove||e instanceof pV)}_getOrCreateGroup(e){if(this.has(e))return this._getGroup(e);const r=[];return this._groups.set(this._ensureGroupKey(e),r),r}_getGroup(e){return this._groups.get(this._ensureGroupKey(e))}_ensureGroupKey(e){return e||"_default_"}_removeAllFromGroup(e){for(const r of e)r instanceof pV?r.removeAll():r.remove()}};const Kme=Symbol("Accessor-beforeDestroy");function dS(t){return Za(()=>t.forEach(e=>e!=null&&e.remove()))}function Za(t){return{remove:()=>{t&&(t(),t=void 0)}}}function LEt(t){return Za(t!=null?()=>t.destroy():void 0)}let FA=class sv{constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*sv._m}getInt(){return this._seed=(sv._a*this._seed+sv._c)%sv._m,this._seed}getFloat(){return this.getInt()/(sv._m-1)}getIntRange(e,r){return Math.round(this.getFloatRange(e,r))}getFloatRange(e,r){const i=r-e;return e+this.getInt()/sv._m*i}};FA._m=2147483647,FA._a=48271,FA._c=0;const jF=1.5,sDe=1/jF,oDe=.5;function HF(t,e){return e?t.filter((r,i,n)=>n.findIndex(e.bind(null,r))===i):t.filter((r,i,n)=>n.indexOf(r)===i)}function Hf(t,e,r){if(t==null&&e==null)return!0;if(t==null||e==null||t.length!==e.length)return!1;if(r){for(let i=0;i!t.some(o=>r(o,s))),n=t.filter(s=>!e.some(o=>r(o,s)))):(i=e.filter(s=>!t.includes(s)),n=t.filter(s=>!e.includes(s))),{added:i,removed:n}}function lDe(t){return t&&typeof t.length=="number"}function DEt(t,e){const r=t.length;if(r===0)return[];const i=[];for(let n=0;nt[a]?n=a+1:s=a}const o=t[n];return r?e>=t[i-1]?-1:o===e?n:n-1:o===e?n:-1}let ege=class{constructor(){this.last=0}};const tge=new ege;function fV(t,e,r,i){i=i||tge;const n=Math.max(0,i.last-10);for(let o=n;oate.getFloat()):Math.random}function UEt(t,e){const r=fDe(e);for(let i=t.length-1;i>0;i--){const n=Math.floor(r()*(i+1)),s=t[i];t[i]=t[n],t[n]=s}return t}const ate=new FA;function vX(t,e){const r=t.indexOf(e);return r!==-1?(t.splice(r,1),e):null}function kEt(t,e){const r=new Map,i=t.length;for(let n=0;n((i||Qy[t]===void 0)&&(Qy[t]=e),r&&se(t)),se.cache=Qy,se.add("esri-deprecation-warnings",!0),se.add("esri-force-fullscreen-debug",!1),(()=>{var e;se.add("host-webworker",globalThis.WorkerGlobalScope!==void 0&&self instanceof globalThis.WorkerGlobalScope);const t=typeof window<"u"&&typeof location<"u"&&typeof document<"u"&&window.location===location&&window.document===document;if(se.add("host-browser",t),se.add("host-node",typeof globalThis.process=="object"&&((e=globalThis.process.versions)==null?void 0:e.node)&&globalThis.process.versions.v8),se.add("dom",t),se("host-browser")){const r=navigator,i=r.userAgent,n=r.appVersion,s=parseFloat(n);if(se.add("wp",parseFloat(i.split("Windows Phone")[1])||void 0),se.add("msapp",parseFloat(i.split("MSAppHost/")[1])||void 0),se.add("khtml",n.includes("Konqueror")?s:void 0),se.add("edge",parseFloat(i.split("Edge/")[1])||void 0),se.add("opr",parseFloat(i.split("OPR/")[1])||void 0),se.add("webkit",!se("wp")&&!se("edge")&&parseFloat(i.split("WebKit/")[1])||void 0),se.add("chrome",!se("edge")&&!se("opr")&&parseFloat(i.split("Chrome/")[1])||void 0),se.add("android",!se("wp")&&parseFloat(i.split("Android ")[1])||void 0),se.add("safari",!n.includes("Safari")||se("wp")||se("chrome")||se("android")||se("edge")||se("opr")?void 0:parseFloat(n.split("Version/")[1])),se.add("mac",n.includes("Macintosh")),!se("wp")&&/(iPhone|iPod|iPad)/.test(i)){const o=RegExp.$1.replace(/P/,"p"),a=/OS ([\d_]+)/.test(i)?RegExp.$1:"1",l=parseFloat(a.replace(/_/,".").replaceAll("_",""));se.add(o,l),se.add("ios",l)}se("webkit")||(!i.includes("Gecko")||se("wp")||se("khtml")||se("edge")||se.add("mozilla",s),se("mozilla")&&se.add("ff",parseFloat(i.split("Firefox/")[1]||i.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const t=navigator.userAgent,e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(t),r=/iPhone/i.test(t);e&&se.add("esri-mobile",e),r&&se.add("esri-iPhone",r),se.add("esri-geolocation",!!navigator.geolocation)}se.add("esri-wasm","WebAssembly"in globalThis),se.add("esri-shared-array-buffer",()=>{const t="SharedArrayBuffer"in globalThis,e=globalThis.crossOriginIsolated===!1;return t&&!e}),se.add("wasm-simd",()=>{const t=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(t))}),se.add("esri-atomics","Atomics"in globalThis),se.add("esri-workers","Worker"in globalThis),se.add("web-feat:cache","caches"in globalThis),se.add("esri-workers-arraybuffer-transfer",!se("safari")||Number(se("safari"))>=12),se.add("workers-pool-size",8),se.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),se.add("featurelayer-simplify-payload-size-factors",[1,1,4]),se.add("featurelayer-animation-enabled",!0),se.add("featurelayer-snapshot-enabled",!0),se.add("featurelayer-snapshot-point-min-threshold",8e4),se.add("featurelayer-snapshot-point-max-threshold",4e5),se.add("featurelayer-snapshot-point-coverage",.1),se.add("featurelayer-advanced-symbols",!1),se.add("featurelayer-pbf",!0),se.add("featurelayer-pbf-statistics",!1),se.add("feature-layers-workers",!0),se.add("feature-polyline-generalization-factor",1),se.add("mapview-transitions-duration",200),se.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),se.add("mapserver-pbf-version-support",10.81),se.add("mapservice-popup-identify-max-tolerance",20),se.add("heatmap-allow-raster-fallback",!1),se.add("heatmap-force-raster",!1),se("host-webworker")||se("host-browser")&&(se.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),se.add("esri-image-decode",()=>{if("decode"in new Image){const t=new Image;return t.src='data:image/svg+xml;charset=UTF-8,',void t.decode().then(()=>{se.add("esri-image-decode",!0,!0,!0)}).catch(()=>{se.add("esri-image-decode",!1,!0,!0)})}return!1}),se.add("esri-url-encodes-apostrophe",()=>{const t=window.document.createElement("a");return t.href="?'",t.href.includes("?%27")}))})();function o3(t){return t instanceof ArrayBuffer}function bX(t){var e;return((e=t==null?void 0:t.constructor)==null?void 0:e.name)==="Int8Array"}function Jy(t){var e;return((e=t==null?void 0:t.constructor)==null?void 0:e.name)==="Uint8Array"}function rge(t){var e;return((e=t==null?void 0:t.constructor)==null?void 0:e.name)==="Uint8ClampedArray"}function wX(t){var e;return((e=t==null?void 0:t.constructor)==null?void 0:e.name)==="Int16Array"}function WF(t){var e;return((e=t==null?void 0:t.constructor)==null?void 0:e.name)==="Uint16Array"}function xX(t){var e;return((e=t==null?void 0:t.constructor)==null?void 0:e.name)==="Int32Array"}function qF(t){var e;return((e=t==null?void 0:t.constructor)==null?void 0:e.name)==="Uint32Array"}function cE(t){var e;return((e=t==null?void 0:t.constructor)==null?void 0:e.name)==="Float32Array"}function uE(t){var e;return((e=t==null?void 0:t.constructor)==null?void 0:e.name)==="Float64Array"}function ap(t){return!("buffer"in t)}function Ky(t){return t!=null?ap(t)?8*t.length+12:t.byteLength+ige:0}const ige=145,_u=1024;function gDe(t){return uE(t)||cE(t)||xX(t)||wX(t)||bX(t)}function yDe(t){return uE(t)||cE(t)}function _De(t){return uE(t)?179769e303:cE(t)?3402823e32:qF(t)?4294967295:WF(t)?65535:Jy(t)||rge(t)?255:xX(t)?2147483647:wX(t)?32767:bX(t)?127:256}function nge(t,e){let r;if(e)for(r in t)t.hasOwnProperty(r)&&(t[r]===void 0?delete t[r]:t[r]instanceof Object&&nge(t[r],!0));else for(r in t)t.hasOwnProperty(r)&&t[r]===void 0&&delete t[r];return t}function ye(t){if(!t||typeof t!="object"||typeof t=="function")return t;const e=age(t);if(e!=null)return e;if(YN(t))return t.clone();if(sge(t))return t.map(ye);if(oge(t))return t.clone();const r={};for(const i of Object.getOwnPropertyNames(t))r[i]=ye(t[i]);return r}function mV(t){if(!t||typeof t!="object"||typeof t=="function"||"HTMLElement"in globalThis&&t instanceof HTMLElement)return t;const e=age(t);if(e!=null)return e;if(sge(t)){let r=!0;const i=t.map(n=>{const s=mV(n);return n!=null&&s==null&&(r=!1),s});return r?i:null}if(YN(t))return t.clone();if(t instanceof File||t instanceof Blob)return t;if(!oge(t)){const r=new(Object.getPrototypeOf(t)).constructor;for(const i of Object.getOwnPropertyNames(t)){const n=t[i],s=mV(n);if(n!=null&&s==null)return null;r[i]=s}return r}return null}function YN(t){return typeof t.clone=="function"}function sge(t){return typeof t.map=="function"&&typeof t.forEach=="function"}function oge(t){return typeof t.notifyChange=="function"&&typeof t.watch=="function"}function lte(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function age(t){if(bX(t)||Jy(t)||rge(t)||wX(t)||WF(t)||xX(t)||qF(t)||cE(t)||uE(t))return t.slice();if(t instanceof Date)return new Date(t.getTime());if(t instanceof ArrayBuffer)return t.slice(0,t.byteLength);if(t instanceof Map){const e=new Map;for(const[r,i]of t)e.set(r,ye(i));return e}if(t instanceof Set){const e=new Set;for(const r of t)e.add(ye(r));return e}return null}function TX(t,e){return t===e||typeof t=="number"&&isNaN(t)&&typeof e=="number"&&isNaN(e)||typeof(t||{}).getTime=="function"&&typeof(e||{}).getTime=="function"&&t.getTime()===e.getTime()||!1}function lge(t,e){return t===e||(t==null||typeof t=="string"?t===e:typeof t=="number"?t===e||typeof e=="number"&&isNaN(t)&&isNaN(e):t instanceof Date?e instanceof Date&&t.getTime()===e.getTime():Array.isArray(t)?Array.isArray(e)&&Hf(t,e):t instanceof Set?e instanceof Set&&bDe(t,e):t instanceof Map?e instanceof Map&&wDe(t,e):!!lte(t)&<e(e)&&vDe(t,e))}function vDe(t,e){if(t===null||e===null)return!1;const r=Object.keys(t);if(e===null||Object.keys(e).length!==r.length)return!1;for(const i of r)if(t[i]!==e[i]||!Object.prototype.hasOwnProperty.call(e,i))return!1;return!0}function bDe(t,e){if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0}function wDe(t,e){if(t.size!==e.size)return!1;for(const[r,i]of t){const n=e.get(r);if(n!==i||n===void 0&&!e.has(r))return!1}return!0}function I_(t){return t.__accessor__??null}function xDe(t,e){return t!=null&&t.metadatas&&t.metadatas[e]!=null}function kL(t,e,r){return r?ZN(t,e,{policy:r,path:""}):ZN(t,e,null)}function ZN(t,e,r){return e?Object.keys(e).reduce((i,n)=>{const s=n;let o=null,a="merge";if(r&&(o=r.path?`${r.path}.${n}`:n,a=r.policy(o)),a==="replace"||a==="replace-arrays"&&Array.isArray(i[s]))return i[s]=e[s],i;if(i[s]===void 0)return i[s]=ye(e[s]),i;let l=i[s],c=e[s];if(l===c)return i;if(Array.isArray(c)||Array.isArray(i))l=l?Array.isArray(l)?i[s]=l.concat():i[s]=[l]:i[s]=[],c&&(Array.isArray(c)||(c=[c]),c.forEach(u=>{l.includes(u)||l.push(u)}));else if(c&&typeof c=="object")if(r){const u=r.path;r.path=o,i[s]=ZN(l,c,r),r.path=u}else i[s]=ZN(l,c,null);else i.hasOwnProperty(n)&&!e.hasOwnProperty(n)||(i[s]=c);return i},t||{}):t}function cge(t){return Array.isArray(t)?t:t.split(".")}function cte(t){return t.includes(",")?t.split(",").map(e=>e.trim()):[t.trim()]}function TDe(t){if(Array.isArray(t)){const e=[];for(const r of t)e.push(...cte(r));return e}return cte(t)}function uge(t,e,r,i){const n=TDe(e);if(n.length!==1){const s=n.map(o=>i(t,o,r));return dS(s)}return i(t,n[0],r)}function SX(t){let e=!1;return()=>{e||(e=!0,t())}}function hge(t,e){const r=t[t.length-1]==="?"?t.slice(0,-1):t;if(e.getItemAt!=null||Array.isArray(e)){const n=parseInt(r,10);if(!isNaN(n))return Array.isArray(e)?e[n]:e.at(n)}const i=I_(e);return xDe(i,r)?i.get(r):e[r]}function dge(t,e,r){if(t==null)return t;const i=hge(e[r],t);return!i&&r{let s=i[n],o=e[n];return s===o?i:s===void 0?(i[n]=ye(o),i):(Array.isArray(o)||Array.isArray(i)?(s=s?Array.isArray(s)?i[n]=s.concat():i[n]=[s]:i[n]=[],o&&(Array.isArray(o)||(o=[o]),r?o.forEach(a=>{s.includes(a)||s.push(a)}):i[n]=o.concat())):o&&typeof o=="object"?i[n]=fge(s,o,r):i.hasOwnProperty(n)&&!e.hasOwnProperty(n)||(i[n]=o),i)},t||{}):t}var Ppe;const Jr={analysisTheme:{accentColor:[255,127,0],textColor:"white"},apiKey:void 0,applicationName:"",applicationUrl:(Ppe=globalThis.location)==null?void 0:Ppe.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!1,portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(ADe(Jr,globalThis.esriConfig,!0),delete Jr.has),!Jr.assetsPath){{const t="4.27";Jr.assetsPath=`https://js.arcgis.com/${t}/@arcgis/core/assets`}Jr.defaultAssetsPath=Jr.assetsPath}const ODe=/\{([^\}]+)\}/g;function hte(t){return t??""}function YF(t,e){return t.replaceAll(ODe,typeof e=="object"?(r,i)=>hte(uP(i,e)):(r,i)=>hte(e(i)))}function zEt(t,e){return t.replaceAll(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,r=>e&&e.includes(r)?r:`\\${r}`)}function mge(t){let e=0;for(let r=0;re._loggedMessages.warn.clear()}}static get test(){return{resetLoggers(e=new Map){const r=Oa._loggers;return Oa._loggers=e,r},set throttlingDisabled(e){Oa._throttlingDisabled=e}}}static getLogger(e){return e=typeof e!="string"?e.declaredClass:e,Oa._loggers.get(e)||new Oa({module:e})}_log(e,r,...i){if(this._matchLevel(e)){if(r!=="always"&&!Oa._throttlingDisabled){const n=this._argsToKey(i),s=this._loggedMessages[e].get(n);if(r==="once"&&s!=null||r==="oncePerTick"&&s&&s>=Oa._tickCounter)return;this._loggedMessages[e].set(n,Oa._tickCounter),Oa._scheduleTickCounterIncrement()}for(const n of Jr.log.interceptors)if(n(e,this.module,...i))return;this._inheritedWriter()(e,this.module,...i)}}_parentWithMember(e,r){let i=this;for(;i!=null;){const n=i[e];if(n!=null)return n;i=i.parent}return r}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,r,...i){console[e](`[${r}]`,...i)}_matchLevel(e){const r=Jr.log.level||"warn";return dte[this._parentWithMember("level",r)]<=dte[e]}_argsToKey(...e){return mge(JSON.stringify(e,(i,n)=>typeof n!="object"||Array.isArray(n)?n:"[Object]"))}static _scheduleTickCounterIncrement(){Oa._tickCounterScheduled||(Oa._tickCounterScheduled=!0,Promise.resolve().then(()=>{Oa._tickCounter++,Oa._tickCounterScheduled=!1}))}};J._loggers=new Map,J._tickCounter=0,J._tickCounterScheduled=!1,J._throttlingDisabled=!1;var ag;(function(t){t[t.INITIALIZING=0]="INITIALIZING",t[t.CONSTRUCTING=1]="CONSTRUCTING",t[t.CONSTRUCTED=2]="CONSTRUCTED"})(ag||(ag={}));let RDe=class{constructor(e,r){this._observers=e,this._observer=r}remove(){vX(this._observers,this._observer)}},gge=class{constructor(){this._observers=null,this.destroyed=!1}observe(e){if(this.destroyed||e.destroyed)return PDe;this._observers==null&&(this._observers=[]);const r=this._observers;let i=!1,n=!1;const s=r.length;for(let o=0;o0){if(!(n+i{},onTrackingEnd:()=>{}},a3=[];let UA=JN;function Ht(t){UA.onObservableAccessed(t)}let zL=!1,BL=!1;function Lg(t,e,r){if(zL)return EX(t,e,r);_ge(t);const i=e.call(r);return vge(),i}function $De(t,e){return Lg(JN,t,e)}function EX(t,e,r){const i=zL;zL=!0,_ge(t);let n=null;try{n=e.call(r)}catch(s){BL&&J.getLogger("esri.core.accessorSupport.tracking").error(s)}return vge(),zL=i,n}function _ge(t){UA=t,a3.push(t)}function vge(){const t=a3.length;if(t>1){const e=a3.pop();UA=a3[t-2],e.onTrackingEnd()}else if(t===1){const e=a3.pop();UA=JN,e.onTrackingEnd()}else UA=JN}function bge(t,e){const r=e.observerObject;if(r.flags&Ei.DepTrackingInitialized)return;const i=BL;BL=!1,r.flags&Ei.AutoTracked?EX(e,e.metadata.get,t):wge(t,e),BL=i}const IDe=[];function wge(t,e){const r=e.observerObject;r.flags&Ei.ExplicitlyTracking||(r.flags|=Ei.ExplicitlyTracking,EX(e,()=>{const i=e.metadata.dependsOn||IDe;for(const n of i)if(typeof n!="string"||n.includes(".")){const s=cge(n);for(let o=0,a=t;o0)for(const r of e)r.onInvalidated()}onCommitted(){const e=this._observers;if(e&&e.length>0){const r=e.slice();for(const i of r)i.onCommitted()}}destroy(){this.flags&Ei.Dirty&&this.onCommitted(),super.destroy()}},DDe=class xge{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const r=new xge;return this._values.forEach((i,n)=>{e&&e.has(n)||r.set(n,ye(i))}),r}get(e){return this._values.get(e)}originOf(){return Qr.USER}keys(){return[...this._values.keys()]}set(e,r){this._values.set(e,r)}delete(e){this._values.delete(e)}has(e){return this._values.has(e)}forEach(e){this._values.forEach(e)}};function PM(t,e,r){return t!==void 0}function mte(t,e,r,i){return t!==void 0&&(!(r==null&&t.observerObject.flags&Ei.NonNullable)||(i.lifecycle,ag.INITIALIZING,!1))}function NDe(t){return t&&typeof t.destroy=="function"}J.getLogger("esri.core.accessorSupport.Properties");let FDe=class{constructor(e){this.host=e,this.propertiesByName=new Map,this.ctorArgs=null,this.destroyed=!1,this.lifecycle=ag.INITIALIZING,this.store=new DDe,this._origin=Qr.USER;const r=this.host.constructor.__accessorMetadata__;for(const i in r){const n=new fte(i,r[i]);this.propertiesByName.set(i,n)}this.metadatas=r}initialize(){this.lifecycle=ag.CONSTRUCTING}constructed(){this.lifecycle=ag.CONSTRUCTED}destroy(){this.destroyed=!0;for(const[e,r]of this.propertiesByName){if(r.metadata.autoDestroy){const i=this.internalGet(e);i&&NDe(i)&&(i.destroy(),~r.observerObject.flags&Ei.NonNullable&&this._internalSet(r,null))}r.destroy()}}get initialized(){return this.lifecycle!==ag.INITIALIZING}get(e){const r=this.propertiesByName.get(e);if(r.metadata.get)return r.getComputed(this);Ht(r.observerObject);const i=this.store;return i.has(e)?i.get(e):r.metadata.value}originOf(e){const r=this.store.originOf(e);if(r===void 0){const i=this.propertiesByName.get(e);if(i!==void 0&&i.observerObject.flags&Ei.HasDefaultValue)return"defaults"}return gV(r)}has(e){return!!this.propertiesByName.has(e)&&this.store.has(e)}keys(){return[...this.propertiesByName.keys()]}internalGet(e){const r=this.propertiesByName.get(e);if(PM(r))return this.store.has(e)?this.store.get(e):r.metadata.value}internalSet(e,r){const i=this.propertiesByName.get(e);PM(i)&&this._internalSet(i,r)}getDependsInfo(e,r,i){const n=this.propertiesByName.get(r);if(!PM(n))return"";const s=new Set,o=Lg({onObservableAccessed:l=>s.add(l),onTrackingEnd:()=>{}},()=>{var l;return(l=n.metadata.get)==null?void 0:l.call(e)});let a=`${i}${e.declaredClass.split(".").pop()}.${r}: ${o} +`;if(s.size===0)return a;i+=" ";for(const l of s)l instanceof fte&&(a+=`${i}${l.propertyName}: undefined +`);return a}setAtOrigin(e,r,i){const n=this.propertiesByName.get(e);if(PM(n))return this._setAtOrigin(n,r,i)}isOverridden(e){const r=this.propertiesByName.get(e);return r!==void 0&&!!(r.observerObject.flags&Ei.Overriden)}clearOverride(e){const r=this.propertiesByName.get(e),i=r==null?void 0:r.observerObject;i&&i.flags&Ei.Overriden&&(i.flags&=~Ei.Overriden,r.notifyChange())}override(e,r){const i=this.propertiesByName.get(e);if(!mte(i,e,r,this))return;const n=i.metadata.cast;if(n){const s=this._cast(n,r),{valid:o,value:a}=s;if(BU.release(s),!o)return;r=a}i.observerObject.flags|=Ei.Overriden,this._internalSet(i,r)}set(e,r){const i=this.propertiesByName.get(e);if(!mte(i,e,r,this))return;const n=i.metadata.cast;if(n){const o=this._cast(n,r),{valid:a,value:l}=o;if(BU.release(o),!a)return;r=l}const s=i.metadata.set;s?s.call(this.host,r):this._internalSet(i,r)}setDefaultOrigin(e){this._origin=yge(e)}getDefaultOrigin(){return gV(this._origin)}notifyChange(e){const r=this.propertiesByName.get(e);r!==void 0&&r.notifyChange()}invalidate(e){const r=this.propertiesByName.get(e);r!==void 0&&r.invalidate()}commit(e){const r=this.propertiesByName.get(e);r!==void 0&&r.commit()}_internalSet(e,r){const i=this.lifecycle!==ag.INITIALIZING?this._origin:Qr.DEFAULTS;this._setAtOrigin(e,r,i)}_setAtOrigin(e,r,i){const n=this.store,s=e.propertyName;n.has(s,i)&&TX(r,n.get(s))&&~e.observerObject.flags&Ei.Overriden&&i===n.originOf(s)||(e.invalidate(),n.set(s,r,i),e.commit(),bge(this.host,e))}_cast(e,r){const i=BU.acquire();return i.valid=!0,i.value=r,e&&(i.value=e.call(this.host,r,i)),i}},UDe=class{constructor(){this.value=null,this.valid=!0}acquire(){this.valid=!0}release(){this.value=null}};const BU=new ko(UDe);function kDe(t,e){return t.replaceAll(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,(r,i)=>i===""?"$":(uP(i,e)??"").toString())}let Tge=class{constructor(e,r,i){this.name=e,this.details=i,this.message=(r&&kDe(r,i))??""}toString(){return"["+this.name+"]: "+this.message}},Y=class Sge extends Tge{constructor(e,r,i){super(e,r,i)}toJSON(){if(this.details!=null)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,(e,r)=>{if(r&&typeof r=="object"&&typeof r.toJSON=="function")return r;try{return ye(r)}catch{return"[object]"}}))}}catch(e){throw J.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new Sge(e.name,e.message,e.details)}};Y.prototype.type="error";function KN(t,e,r){if(t&&e)if(typeof e=="object")for(const i of Object.getOwnPropertyNames(e))KN(t,i,e[i]);else{if(e.includes(".")){const n=e.split("."),s=n.splice(n.length-1,1)[0];return void KN(QN(t,n),s,r)}const i=t.__accessor__;i!=null&&zDe(e,i),t[e]=r}}function zDe(t,e){if(se("esri-unknown-property-errors")&&!BDe(t,e))throw new Y("set:unknown-property",VDe(t,e))}function BDe(t,e){return e.metadatas[t]!=null}function VDe(t,e){return"setting unknown property '"+t+"' on instance of "+e.host.declaredClass}let GDe;function jDe(){return GDe}let Ege=class extends ko{constructor(){super(...arguments),this._set=new Set}destroy(){super.destroy(),this._set=lE(this._set)}acquire(...e){const r=super.acquire(...e);return this._set.delete(r),r}release(e){e&&!this._set.has(e)&&(super.release(e),this._set.add(e))}_dispose(e){this._set.delete(e),super._dispose(e)}};const MM=[];function pS(t){MM.push(t),MM.length===1&&queueMicrotask(()=>{const e=MM.slice();MM.length=0;for(const r of e)r()})}let dg=class{constructor(e,r=30){this.name=e,this._counter=0,this._samples=new Array(r)}record(e){e!=null&&(this._samples[++this._counter%this._samples.length]=e)}get median(){return this._samples.slice().sort((e,r)=>e-r)[Math.floor(this._samples.length/2)]}get average(){return this._samples.reduce((e,r)=>e+r,0)/this._samples.length}get last(){return this._samples[this._counter%this._samples.length]}};var yV;(function(t){const e=(s,o,a,l)=>{let c=o,u=o;const d=a>>>1,p=s[c-1];for(;u<=d;){u=c<<1,uso?1:0;function i(s,o,a,l){o===void 0&&(o=0),a===void 0&&(a=s.length),l===void 0&&(l=r);for(let u=a>>>1;u>o;u--)e(s,u,a,l);const c=o+1;for(let u=a-1;u>o;u--){const d=s[o];s[o]=s[u],s[u]=d,e(s,c,u,l)}}function*n(s,o,a,l){o===void 0&&(o=0),a===void 0&&(a=s.length),l===void 0&&(l=r);for(let u=a>>>1;u>o;u--)e(s,u,a,l),yield;const c=o+1;for(let u=a-1;u>o;u--){const d=s[o];s[o]=s[u],s[u]=d,e(s,c,u,l),yield}}t.sort=i,t.iterableSort=n})(yV||(yV={}));const gte=yV,HDe=1.5,WDe=1.1;let Nt=class{constructor(e){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new ege,e&&(e.initialSize&&(this.data=new Array(e.initialSize)),e.allocator&&(this._allocator=e.allocator),e.deallocator!==void 0&&(this._deallocator=e.deallocator),e.shrink&&(this._shrink=()=>yte(this)))}toArray(){return this.data.slice(0,this.length)}filter(e){const r=new Array;for(let i=0;i=this._length))return this.data[e]}includes(e,r){const i=this.data.indexOf(e,r);return i!==-1&&ithis._length){if(this._allocator){for(;this._length=this.length||e<0))return this.swapElements(e,this.length-1),this.pop()}removeUnorderedMany(e,r=e.length,i){this.length=dDe(this.data,e,this.length,r,this._hint,i),this._shrink()}front(){if(this.length!==0)return this.data[0]}back(){if(this.length!==0)return this.data[this.length-1]}swapElements(e,r){if(e>=this.length||r>=this.length||e===r)return;const i=this.data[e];this.data[e]=this.data[r],this.data[r]=i}sort(e){gte.sort(this.data,0,this.length,e)}iterableSort(e){return gte.iterableSort(this.data,0,this.length,e)}some(e,r){for(let i=0;iHDe*t.length&&(t.data.length=Math.floor(t.length*WDe))}function qDe(t){return{setTimeout:(e,r)=>{const i=t.setTimeout(e,r);return{remove:()=>t.clearTimeout(i)}}}}const hP=qDe(globalThis);function ZF(t){return t&&(typeof t.on=="function"||typeof t.addEventListener=="function")}function dP(t,e,r){if(!ZF(t))throw new TypeError("target is not a Evented or EventTarget object");if("on"in t)return t.on(e,r);if(Array.isArray(e)){const i=e.slice();for(const n of i)t.addEventListener(n,r);return{remove(){for(const n of i)t.removeEventListener(n,r)}}}return t.addEventListener(e,r),{remove(){t.removeEventListener(e,r)}}}function Cge(t,e,r){if(!ZF(t))throw new TypeError("target is not a Evented or EventTarget object");if("once"in t)return t.once(e,r);const i=dP(t,e,n=>{i.remove(),r.call(t,n)});return{remove(){i.remove()}}}const XDe={Win:"Meta",Scroll:"ScrollLock",Spacebar:" ",Down:"ArrowDown",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Del:"Delete",Apps:"ContextMenu",Esc:"Escape",Multiply:"*",Add:"+",Subtract:"-",Decimal:".",Divide:"/"};function YDe({key:t}){return XDe[t]||t}function wr(t="Aborted"){return new Y("AbortError",t)}function Bt(t,e="Aborted"){if(ss(t))throw wr(e)}function QF(t){return t!=null?"aborted"in t?t:t.signal:t}function ss(t){const e=QF(t);return e!=null&&e.aborted}function Mw(t){if(Zn(t))throw t}function _te(t){if(!Zn(t))throw t}function pa(t,e){const r=QF(t);if(r!=null){if(!r.aborted)return Cge(r,"abort",()=>e());e()}}function CX(t,e){const r=QF(t);if(r!=null)return Bt(r),Cge(r,"abort",()=>e(wr()))}function AX(t,e){return QF(e)==null?t:new Promise((r,i)=>{let n=pa(e,()=>i(wr()));const s=()=>n=Pi(n);t.then(s,s),t.then(r,i)})}function Zn(t){return(t==null?void 0:t.name)==="AbortError"}async function _V(t){try{return await t}catch(e){if(!Zn(e))throw e;return}}async function eCt(t,e=J.getLogger("esri")){try{return await t}catch(r){Zn(r)||e.error(r)}}async function o1(t){if(!t)return;if(typeof t.forEach!="function"){const r=Object.keys(t),i=r.map(o=>t[o]),n=await o1(i),s={};return r.map((o,a)=>s[o]=n[a]),s}const e=t;return Promise.allSettled(e).then(r=>Array.from(e,(i,n)=>{const s=r[n];return s.status==="fulfilled"?{promise:i,value:s.value}:{promise:i,error:s.reason}}))}async function e4(t){return(await o1(t)).filter(e=>!!e.value).map(e=>e.value)}function XO(t,e=void 0,r){const i=new AbortController;return pa(r,()=>i.abort()),new Promise((n,s)=>{let o=setTimeout(()=>{o=0,n(e)},t);pa(i,()=>{o&&(clearTimeout(o),s(wr()))})})}function Eu(t){return t&&typeof t.then=="function"}function vV(t){return Eu(t)?t:Promise.resolve(t)}function Age(t,e=-1){let r,i,n,s,o=null;const a=(...l)=>{if(r){i=l,s&&s.reject(wr()),s=Wo();const p=s.promise;if(o){const m=o;o=null,m.abort()}return p}if(n=s||Wo(),s=null,e>0){const p=new AbortController;r=vV(t(...l,p.signal));const m=r;XO(e).then(()=>{r===m&&(s?p.abort():o=p)})}else r=1,r=vV(t(...l));const c=()=>{const p=i;i=n=r=o=null,p!=null&&a(...p)},u=r,d=n;return u.then(c,c),u.then(d.resolve,d.reject),d.promise};return a}function Wo(){let t,e;const r=new Promise((n,s)=>{t=n,e=s}),i=n=>{t(n)};return i.resolve=n=>t(n),i.reject=n=>e(n),i.timeout=(n,s)=>hP.setTimeout(()=>i.reject(s),n),i.promise=r,i}function tCt(t,e){return t.then(e,e)}async function vte(t){await Promise.resolve(),Bt(t)}function rCt(t){return t}function Oge(t){return 1e3*t}function OX(t){return .001*t}function ZDe(){return performance.now()}let QDe=class{constructor(e){this.phases=e,this.paused=!1,this.ticks=-1,this.removed=!1}},JDe=class{constructor(e){this.callback=e,this.isActive=!0}remove(){this.isActive=!1}},bV=0,wV=0;const YE={time:0,deltaTime:0,elapsedFrameTime:0,frameDuration:0},xV=["prepare","preRender","render","postRender","update","finish"],TV=[],Wb=new Nt;let KDe=class{constructor(e){this._task=e}remove(){this._task.removed=!0}pause(){this._task.paused=!0}resume(){this._task.paused=!1}};const t4={frameTasks:Wb,willDispatch:!1,clearFrameTasks:eNe,dispatch:Mge,executeFrameTasks:rNe};function pP(t){const e=new JDe(t);return TV.push(e),t4.willDispatch||(t4.willDispatch=!0,pS(Mge)),e}function fS(t){const e=new QDe(t);return Wb.push(e),r4==null&&(bV=performance.now(),r4=requestAnimationFrame(Rge)),new KDe(e)}let r4=null;function eNe(t=!1){Wb.forAll(e=>{e.removed=!0}),t&&Pge()}function tNe(t){wV=Math.max(0,t)}function Rge(){const t=performance.now();r4=null,r4=Wb.length>0?requestAnimationFrame(Rge):null,t4.executeFrameTasks(t)}function rNe(t){const e=t-bV;bV=t;const r=wV>0?wV:1e3/60,i=Math.max(0,e-r);YE.time=t,YE.frameDuration=r-i;for(let n=0;n{var l;a.paused||a.removed||(n===0&&a.ticks++,a.phases[o]&&(YE.elapsedFrameTime=performance.now()-t,YE.deltaTime=a.ticks===0?0:e,(l=a.phases[o])==null||l.call(a,YE)))}),iNe[n].record(performance.now()-s)}Pge(),nNe.record(performance.now()-t)}const $M=new Nt;function Pge(){Wb.forAll(t=>{t.removed&&$M.push(t)}),Wb.removeUnorderedMany($M.data,$M.length),$M.clear()}function Mge(){for(;TV.length;){const t=TV.shift();t.isActive&&t.callback()}t4.willDispatch=!1}function oCt(t=1,e){const r=Wo(),i=()=>{ss(e)?r.reject(wr()):t===0?r():(--t,pS(()=>i()))};return i(),r.promise}const iNe=xV.map(t=>new dg(t)),nNe=new dg("total");function VL(t,e){for(const r of t.entries())if(e(r[0]))return!0;return!1}let sNe=0;const oNe=0;function wc(){return++sNe}let JF=class{constructor(e){this._accessed=[],this._handles=[],this._observerObject=new aNe(e),bte.register(this,new WeakRef(this._observerObject),this)}destroy(){var e;bte.unregister(this._observerObject),this._accessed.length=0,(e=this._observerObject)==null||e.destroy(),this.clear()}onObservableAccessed(e){const r=this._accessed;r.includes(e)||r.push(e)}onTrackingEnd(){const e=this._handles,r=this._accessed,i=this._observerObject;for(let n=0;n0?e-1:0}destroy(){this.destroyed=!0,this._notify=lNe}};const bte=new FinalizationRegistry(t=>{var e;(e=t.deref())==null||e.destroy()});function lNe(){}let PT=!1;const i4=[];function $ge(t,e){let r=new JF(s),i=null,n=!1;function s(){if(!r||n)return;if(PT)return void Dge(s);const a=i;r.clear(),PT=!0,n=!0,i=Lg(r,t),n=!1,PT=!1,e(i,a),Nge()}function o(){r&&(r.destroy(),r=null,i=null)}return n=!0,i=Lg(r,t),n=!1,{remove:o}}function Ige(t,e){let r=new JF(n),i=null;function n(){e(i,o)}function s(){r&&(r.destroy(),r=null),i=null}function o(){return r?(r.clear(),i=Lg(r,t),i):null}return o(),{remove:s}}function Lge(t){let e=new JF(i),r=!1;function i(){e&&!r&&(PT?Dge(i):(e.clear(),PT=!0,r=!0,Lg(e,t),r=!1,PT=!1,Nge()))}function n(){e&&(e.destroy(),e=null)}return r=!0,Lg(e,t),r=!1,{remove:n}}function Dge(t){i4.includes(t)||i4.unshift(t)}function Nge(){for(;i4.length;)i4.pop()()}var kA;(function(t){t[t.Untracked=0]="Untracked",t[t.Tracked=1]="Tracked"})(kA||(kA={}));let YO=class{constructor(){this.uid=wc(),this.removed=!1,this.type=null,this.oldValue=null,this.callback=null,this.getValue=null,this.target=null,this.path=null,this.equals=null}static acquireUntracked(e,r,i,n,s){return this.pool.acquire(kA.Untracked,e,r,i,n,s,TX)}static acquireTracked(e,r,i,n){return this.pool.acquire(kA.Tracked,e,r,i,null,null,n)}notify(e,r){this.type===kA.Untracked?this.callback.call(this.target,e,r,this.path,this.target):this.callback.call(null,e,r,void 0,void 0)}acquire(e,r,i,n,s,o,a){this.uid=wc(),this.removed=!1,this.type=e,this.oldValue=r,this.callback=i,this.getValue=n,this.target=s,this.path=o,this.equals=a}release(){this.target=this.path=this.oldValue=this.callback=this.getValue=null,this.uid=wc(),this.removed=!0}};YO.pool=new Ege(YO);const GL=new uc,yg=new Set;let n4;function s4(t){yg.delete(t),yg.add(t),n4||(n4=pP(hNe))}function cNe(t){if(t.removed)return;const e=t.oldValue,r=t.getValue();t.equals(e,r)||(t.oldValue=r,t.notify(r,e))}function uNe(t){for(const e of yg.values())e.target===t&&(e.removed=!0)}function hNe(){let t=10;for(;n4&&t--;){n4=null;const e=dNe(),r=GL.acquire();for(const i of e){const n=i.uid;cNe(i),n===i.uid&&i.removed&&r.push(i)}for(const i of yg)i.removed&&(r.push(i),yg.delete(i));for(const i of r)YO.pool.release(i);GL.release(r),GL.release(e),SV.forEach(i=>i())}}function dNe(){const t=GL.acquire();t.length=yg.size;let e=0;for(const r of yg)t[e]=r,++e;return yg.clear(),t}const SV=new Set;function Fge(t){return SV.add(t),{remove(){SV.delete(t)}}}function pNe(t,e,r){let i=uge(t,e,r,(n,s,o)=>{let a,l,c=Ige(()=>lP(n,s),(u,d)=>{n.__accessor__.destroyed||a&&a.uid!==l?i.remove():(a||(a=YO.acquireUntracked(u,o,d,n,s),l=a.uid),s4(a))});return{remove:SX(()=>{c.remove(),a&&(a.uid!==l||a.removed||(a.removed=!0,s4(a)),a=null),i=c=null})}});return i}function fNe(t,e,r){const i=uge(t,e,r,(n,s,o)=>{let a=!1;return $ge(()=>lP(n,s),(l,c)=>{n.__accessor__.destroyed?i.remove():a||(a=!0,TX(c,l)||o.call(n,l,c,s,n),a=!1)})});return i}function mNe(t,e,r,i=!1){return!t.__accessor__||t.__accessor__.destroyed?{remove(){}}:i?fNe(t,e,r):pNe(t,e,r)}function gNe(t,e,r){let i,n,s=Ige(t,(o,a)=>{i&&i.uid!==n?s.remove():(i||(i=YO.acquireTracked(o,e,a,r),n=i.uid),s4(i))});return{remove:SX(()=>{s.remove(),i&&(i.uid!==n||i.removed||(i.removed=!0,s4(i)),i=null),s=null})}}function yNe(t,e,r){let i=!1;return $ge(t,(n,s)=>{i||(i=!0,r(s,n)||e(n,s),i=!1)})}function _Ne(t,e,r=!1,i=lge){return r?yNe(t,e,i):gNe(t,e,i)}function wte(t){return VL(yg,e=>e.oldValue===t)}function Do(t,e){for(const[r,i]of t)if(e(i,r))return!0;return!1}function uCt(t,e){for(const[r,i]of t)if(e(i,r))return i;return null}function Uge(t,e,r){const i=t.get(e);if(i!==void 0)return i;const n=r();return t.set(e,n),n}const MT=J.getLogger("esri.core.accessorSupport.ensureTypes");function vNe(t){return t==null?t:new Date(t)}function bNe(t){return t==null?t:!!t}function kge(t){return t==null?t:t.toString()}function Ud(t){return t==null?t:(t=parseFloat(t),isNaN(t)?0:t)}function RX(t){return t==null?t:Math.round(parseFloat(t))}function zge(t){return t&&t.constructor&&t.constructor.__accessorMetadata__!==void 0}function o4(t,e){return e!=null&&t&&!(e instanceof t)}function Bge(t){return t&&"isCollection"in t}function xte(t){return t&&t.Type?typeof t.Type=="function"?t.Type:t.Type.base:null}function wNe(t,e){if(!e||!e.constructor||!Bge(e.constructor))return EV(t,e)?e:new t(e);const r=xte(t.prototype.itemType),i=xte(e.constructor.prototype.itemType);return r?i?r===i?e:r.prototype.isPrototypeOf(i.prototype)?new t(e):(EV(t,e),e):new t(e):e}function EV(t,e){return!!zge(e)&&(MT.error("Accessor#set","Assigning an instance of '"+(e.declaredClass||"unknown")+"' which is not a subclass of '"+KF(t)+"'"),!0)}function mS(t,e){return e==null?e:Bge(t)?wNe(t,e):o4(t,e)?EV(t,e)?e:new t(e):e}function KF(t){return t&&t.prototype&&t.prototype.declaredClass||"unknown"}const xNe=new WeakMap;function TNe(t){switch(t){case Number:return Ud;case mn:return RX;case Boolean:return bNe;case String:return kge;case Date:return vNe;default:return Uge(xNe,t,()=>mS.bind(null,t))}}function Qa(t,e){const r=TNe(t);return arguments.length===1?r:r(e)}function ZO(t,e,r){return arguments.length===1?ZO.bind(null,t):e&&(Array.isArray(e)?e.map(i=>t(i,r)):[t(e,r)])}function SNe(t,e){return arguments.length===1?ZO(r=>Qa(t,r)):ZO(r=>Qa(t,r),e)}function Vge(t,e,r){return e!==0&&Array.isArray(r)?r.map(i=>Vge(t,e-1,i)):t(r)}function a4(t,e,r){if(arguments.length===2)return s=>a4(t,e,s);if(!r)return r;r=Vge(t,e,r);let i=e,n=r;for(;i>0&&Array.isArray(n);)i--,n=n[0];if(n!==void 0)for(let s=0;sQa(t,i),e):a4(i=>Qa(t,i),e,r)}function Gge(t){return!!Array.isArray(t)&&!t.some(e=>{const r=typeof e;return!(r==="string"||r==="number"||r==="function"&&t.length>1)})}function CV(t,e){if(arguments.length===2)return CV(t).call(null,e);const r=new Set,i=t.filter(a=>typeof a!="function"),n=t.filter(a=>typeof a=="function");for(const a of t)typeof a!="string"&&typeof a!="number"||r.add(a);let s=null,o=null;return(a,l)=>{if(a==null)return a;const c=typeof a,u=c==="string"||c==="number";return u&&(r.has(a)||n.some(d=>c==="string"&&d===String||c==="number"&&d===Number))||c==="object"&&n.some(d=>!o4(a,d))?a:(u&&i.length?(s||(s=i.map(d=>typeof d=="string"?`'${d}'`:`${d}`).join(", ")),MT.error("Accessor#set",`'${a}' is not a valid value for this property, only the following values are valid: ${s}`)):typeof a=="object"&&n.length?(o||(o=n.map(d=>KF(d)).join(", ")),MT.error("Accessor#set",`'${a}' is not a valid value for this property, value must be one of ${o}`)):MT.error("Accessor#set",`'${a}' is not a valid value for this property`),l&&(l.valid=!1),null)}}function L_(t,e){if(arguments.length===2)return L_(t).call(null,e);const r={},i=[],n=[];for(const l in t.typeMap){const c=t.typeMap[l];r[l]=Qa(c),i.push(KF(c)),n.push(l)}const s=()=>`'${i.join("', '")}'`,o=()=>`'${n.join("', '")}'`,a=typeof t.key=="string"?l=>l[t.key]:t.key;return l=>{if(t.base&&!o4(t.base,l)||l==null)return l;const c=a(l)||t.defaultKeyValue,u=r[c];if(!u)return MT.error("Accessor#set",`Invalid property value, value needs to be one of ${s()}, or a plain object that can autocast (having .type = ${o()})`),null;if(!o4(t.typeMap[c],l))return l;if(typeof t.key=="string"&&!zge(l)){const d={};for(const p in l)p!==t.key&&(d[p]=l[p]);return u(d)}return u(l)}}let mn=class{};const dCt={native:t=>({type:"native",value:t}),array:t=>({type:"array",value:t}),oneOf:t=>({type:"one-of",values:t})};function CNe(t){if(!t||!("type"in t))return!1;switch(t.type){case"native":case"array":case"one-of":return!0}return!1}function jge(t){switch(t.type){case"native":return Qa(t.value);case"array":return ZO(jge(t.value));case"one-of":return ANe(t);default:return null}}function ANe(t){let e=null;return(r,i)=>OV(r,t)?r:(e==null&&(e=AV(t)),MT.error("Accessor#set",`Invalid property value, value needs to be of type ${e}`),i&&(i.valid=!1),null)}function AV(t){switch(t.type){case"native":switch(t.value){case Number:return"number";case String:return"string";case Boolean:return"boolean";case mn:return"integer";case Date:return"date";default:return KF(t.value)}case"array":return`array of ${AV(t.value)}`;case"one-of":{const e=t.values.map(r=>AV(r));return`one of ${e.slice(0,e.length-1)} or ${e[e.length-1]}`}}return"unknown"}function OV(t,e){if(t==null)return!0;switch(e.type){case"native":switch(e.value){case Number:case mn:return typeof t=="number";case Boolean:return typeof t=="boolean";case String:return typeof t=="string"}return t instanceof e.value;case"array":return!!Array.isArray(t)&&!t.some(r=>!OV(r,e.value));case"one-of":return e.values.some(r=>OV(t,r))}}function f(t={}){return(e,r)=>{if(e===Function.prototype)throw new Error(`Inappropriate use of @property() on a static field: ${e.name}.${r}. Accessor does not support static properties.`);const i=Object.getOwnPropertyDescriptor(e,r),n=XF(e,r);i&&(i.get||i.set?(n.get=i.get||n.get,n.set=i.set||n.set):"value"in i&&("value"in t&&J.getLogger("esri.core.accessorSupport.decorators.property").warn(`@property() will redefine the value of "${r}" on "${e.constructor.name}" already defined in the metadata`,t),n.value=t.value=i.value)),t.readOnly!=null&&(n.readOnly=t.readOnly);const s=t.aliasOf;if(s){const l=typeof s=="string"?s:s.source,c=typeof s=="string"?null:s.overridable===!0;let u;n.dependsOn=[l],n.get=function(){let d=QN(this,l);if(typeof d=="function"){u||(u=l.split(".").slice(0,-1).join("."));const p=QN(this,u);p&&(d=d.bind(p))}return d},n.readOnly||(n.set=c?function(d){this._override(r,d)}:function(d){KN(this,l,d)})}const o=t.type,a=t.types;n.cast||(o?n.cast=ONe(o):a&&(Array.isArray(a)?n.cast=ZO(L_(a[0])):n.cast=L_(a))),SDe(n,t),t.range&&(n.cast=RNe(n.cast,t.range))}}function Hge(t,e,r){const i=XF(t,r);i.json||(i.json={});let n=i.json;return e!==void 0&&(n.origins||(n.origins={}),n.origins[e]||(n.origins[e]={}),n=n.origins[e]),n}function ONe(t){let e=0,r=t;if(CNe(t))return jge(t);for(;Array.isArray(r)&&r.length===1&&typeof r[0]!="string"&&typeof r[0]!="number";)r=r[0],e++;const i=r;if(Gge(i))return e===0?CV(i):a4(CV(i),e);if(e===1)return SNe(i);if(e>1)return ENe(i,e);const n=t;return n.from?n.from:Qa(n)}function RNe(t,e){return r=>{let i=+t(r);return e.step!=null&&(i=Math.round(i/e.step)*e.step),e.min!=null&&(i=Math.max(e.min,i)),e.max!=null&&(i=Math.min(e.max,i)),i}}function PNe(t){if(t.json&&t.json.origins){const e=t.json.origins,r={"web-document":["web-scene","web-map"]};for(const i in r)if(e[i]){const n=e[i];r[i].forEach(s=>{e[s]=n}),delete e[i]}}}let D_=class extends Tge{constructor(e,r,i){super(e,r,i)}};D_.prototype.type="warning";function Wge(t){return!!t&&t.prototype&&t.prototype.declaredClass&&t.prototype.declaredClass.indexOf("esri.core.Collection")===0}const RV=J.getLogger("esri.core.accessorSupport.extensions.serializableProperty.reader");function Tte(t,e,r){var i,n;t&&(!r&&!e.read||(i=e.read)!=null&&i.reader||((n=e.read)==null?void 0:n.enabled)===!1||INe(t)&&Pw("read.reader",PX(t),e))}function PX(t){var r,i;const e=t.ndimArray??0;if(e>1)return $Ne(t);if(e===1)return Ste(t);if("type"in t&&Xge(t.type)){const n=(i=(r=t.type.prototype)==null?void 0:r.itemType)==null?void 0:i.Type,s=Ste(typeof n=="function"?{type:n}:{types:n});return(o,a,l)=>{const c=s(o,a,l);return c&&new t.type(c)}}return MX(t)}function MX(t){return"type"in t?MNe(t.type):LNe(t.types)}function MNe(t){return t.prototype.read?(e,r,i)=>{if(e==null)return e;const n=typeof e;if(n!=="object")return void RV.error(`Expected JSON value of type 'object' to deserialize type '${t.prototype.declaredClass}', but got '${n}'`);const s=new t;return s.read(e,i),s}:t.fromJSON}function qge(t,e,r,i){return i!==0&&Array.isArray(e)?e.map(n=>qge(t,n,r,i-1)):t(e,void 0,r)}function $Ne(t){const e=MX(t),r=qge.bind(null,e),i=t.ndimArray??0;return(n,s,o)=>{if(n==null)return n;n=r(n,o,i);let a=i,l=n;for(;a>0&&Array.isArray(l);)a--,l=l[0];if(l!==void 0)for(let c=0;c{if(r==null)return r;if(Array.isArray(r)){const o=[];for(const a of r){const l=e(a,void 0,n);l!==void 0&&o.push(l)}return o}const s=e(r,void 0,n);return s!==void 0?[s]:void 0}}function Xge(t){if(!Wge(t))return!1;const e=t.prototype.itemType;return!(!e||!e.Type)&&(typeof e.Type=="function"?$X(e.Type):Yge(e.Type))}function INe(t){return"types"in t?Yge(t.types):$X(t.type)}function $X(t){return!Array.isArray(t)&&!!t&&t.prototype&&("read"in t.prototype||"fromJSON"in t||Xge(t))}function Yge(t){for(const e in t.typeMap)if(!$X(t.typeMap[e]))return!1;return!0}function LNe(t){let e=null;const r=t.errorContext??"type";return(i,n,s)=>{if(i==null)return i;const o=typeof i;if(o!=="object")return void RV.error(`Expected JSON value of type 'object' to deserialize, but got '${o}'`);e||(e=DNe(t));const a=t.key;if(typeof a!="string")return;const l=i[a],c=l?e[l]:t.defaultKeyValue?t.typeMap[t.defaultKeyValue]:void 0;if(!c){const d=`Type '${l||"unknown"}' is not supported`;return s&&s.messages&&i&&s.messages.push(new D_(`${r}:unsupported`,d,{definition:i,context:s})),void RV.error(d)}const u=new c;return u.read(i,s),u}}function DNe(t){var r,i;const e={};for(const n in t.typeMap){const s=t.typeMap[n],o=cP(s.prototype);if(typeof t.key=="function")continue;const a=o[t.key];if(!a)continue;(r=a.json)!=null&&r.type&&Array.isArray(a.json.type)&&a.json.type.length===1&&typeof a.json.type[0]=="string"&&(e[a.json.type[0]]=s);const l=(i=a.json)==null?void 0:i.write;if(!l||!l.writer){e[n]=s;continue}const c=l.target,u=typeof c=="string"?c:t.key,d={};l.writer(n,d,u),d[u]&&(e[d[u]]=s)}return e}function NNe(t){if(t.json||(t.json={}),Cte(t.json),Ate(t.json),Ete(t.json),t.json.origins)for(const e in t.json.origins)Cte(t.json.origins[e]),Ate(t.json.origins[e]),Ete(t.json.origins[e]);return!0}function Ete(t){t.name&&(t.read&&typeof t.read=="object"?t.read.source===void 0&&(t.read.source=t.name):t.read={source:t.name},t.write&&typeof t.write=="object"?t.write.target===void 0&&(t.write.target=t.name):t.write={target:t.name})}function Cte(t){typeof t.read=="boolean"?t.read={enabled:t.read}:typeof t.read=="function"?t.read={enabled:!0,reader:t.read}:t.read&&typeof t.read=="object"&&t.read.enabled===void 0&&(t.read.enabled=!0)}function Ate(t){typeof t.write=="boolean"?t.write={enabled:t.write}:typeof t.write=="function"?t.write={enabled:!0,writer:t.write}:t.write&&typeof t.write=="object"&&t.write.enabled===void 0&&(t.write.enabled=!0)}function Ote(t,e){if(!e.write||e.write.writer||e.write.enabled===!1&&!e.write.overridePolicy)return;const r=(t==null?void 0:t.ndimArray)??0;t&&(r===1||"type"in t&&Wge(t.type))?e.write.writer=kNe:r>1?e.write.writer=zNe(r):e.types?Array.isArray(e.types)?e.write.writer=UNe(e.types[0]):e.write.writer=FNe(e.types):e.write.writer=QO}function FNe(t){return(e,r,i,n)=>e?Zge(e,t,n)?QO(e,r,i,n):void 0:QO(e,r,i,n)}function Zge(t,e,r){for(const i in e.typeMap)if(t instanceof e.typeMap[i])return!0;if(r!=null&&r.messages){const i=e.errorContext??"type",n=`Values of type '${(typeof e.key!="function"?t[e.key]:t.declaredClass)??"Unknown"}' cannot be written`;r&&r.messages&&t&&r.messages.push(new Y(`${i}:unsupported`,n,{definition:t,context:r})),J.getLogger("esri.core.accessorSupport.extensions.serializableProperty.writer").error(n)}return!1}function UNe(t){return(e,r,i,n)=>!e||!Array.isArray(e)?QO(e,r,i,n):QO(e.filter(s=>Zge(s,t,n)),r,i,n)}function QO(t,e,r,i){Pw(r,l4(t,i),e)}function l4(t,e){return t&&typeof t.write=="function"?t.write({},e):t&&typeof t.toJSON=="function"?t.toJSON():typeof t=="number"?c4(t):t}function c4(t){return t===-1/0?-Number.MAX_VALUE:t===1/0?Number.MAX_VALUE:isNaN(t)?null:t}function kNe(t,e,r,i){let n;t===null?n=null:t&&typeof t.map=="function"?(n=t.map(s=>l4(s,i)),typeof n.toArray=="function"&&(n=n.toArray())):n=[l4(t,i)],Pw(r,n,e)}function Qge(t,e,r){return r!==0&&Array.isArray(t)?t.map(i=>Qge(i,e,r-1)):l4(t,e)}function zNe(t){return(e,r,i,n)=>{let s;if(e===null)s=null;else{s=Qge(e,n,t);let o=t,a=s;for(;o>0&&Array.isArray(a);)o--,a=a[0];if(a!==void 0)for(let l=0;l{e.prototype.declaredClass=t,qNe(e);const r=[],i=[];let n=e.prototype;for(;n;)n.hasOwnProperty("initialize")&&!VU.has(n.initialize)&&(VU.add(n.initialize),r.push(n.initialize)),n.hasOwnProperty("destroy")&&!GU.has(n.destroy)&&(GU.add(n.destroy),i.push(n.destroy)),n=Object.getPrototypeOf(n);VU.clear(),GU.clear();class s extends e{constructor(...a){if(super(...a),this.constructor===s&&typeof this.postscript=="function"){if(r.length&&Object.defineProperty(this,"initialize",{enumerable:!1,configurable:!0,value(){for(let l=r.length-1;l>=0;l--)r[l].call(this)}}),i.length){let l=!1;const c=this[Kme];Object.defineProperty(this,"destroy",{enumerable:!1,configurable:!0,value(){if(!l){l=!0,c.call(this);for(let u=0;u0&&this.normalizeCtorArgs&&(r.ctorArgs=this.normalizeCtorArgs.apply(this,e)),Rte.register(this,r.propertiesByName,this)}postscript(e){const r=this.__accessor__,i=r.ctorArgs||e;r.initialize(),i&&(this.set(i),r.ctorArgs=null),r.constructed(),this.initialize(),this[$V]=!0}initialize(){}[Kme](){this[K0]=Me(this[K0])}destroy(){var e;this.destroyed||(Rte.unregister(this),uNe(this),this.__accessor__.destroy(),(e=jDe())==null||e.onInstanceDestroy(this))}get constructed(){return this.__accessor__&&this.__accessor__.initialized||!1}get initialized(){return this[$V]}get destroyed(){return this.__accessor__&&this.__accessor__.destroyed||!1}commitProperty(e){this.get(e)}get(e){return QN(this,e)}hasOwnProperty(e){return this.__accessor__?this.__accessor__.has(e):Object.prototype.hasOwnProperty.call(this,e)}keys(){return this.__accessor__?this.__accessor__.keys():[]}set(e,r){return KN(this,e,r),this}watch(e,r,i){return mNe(this,e,r,i)}own(e){this.addHandles(e)}addHandles(e,r){if(this.destroyed){const n=Array.isArray(e)?e:[e];for(const s of n)s.remove();return}let i=this[K0];i==null&&(i=this[K0]=new Vi),i.add(e,r)}removeHandles(e){const r=this[K0];r!=null&&r.remove(e)}removeAllHandles(){const e=this[K0];e!=null&&e.removeAll()}hasHandles(e){const r=this[K0];return r!=null&&r.has(e)}_override(e,r){r===void 0?this.__accessor__.clearOverride(e):this.__accessor__.override(e,r)}_clearOverride(e){return this.__accessor__.clearOverride(e)}_overrideIfSome(e,r){r==null?this.__accessor__.clearOverride(e):this.__accessor__.override(e,r)}_isOverridden(e){return this.__accessor__.isOverridden(e)}notifyChange(e){this.__accessor__.notifyChange(e)}_get(e){return this.__accessor__.internalGet(e)}_set(e,r){return this.__accessor__.internalSet(e,r),this}};e0e=K0,t0e=$V;const Rte=new FinalizationRegistry(t=>{for(const e of t.values())e.destroy()});let jL=class i0e{constructor(){this._emitter=new i0e.EventEmitter(this)}emit(e,r){return this._emitter.emit(e,r)}on(e,r){return this._emitter.on(e,r)}once(e,r){return this._emitter.once(e,r)}hasEventListener(e){return this._emitter.hasEventListener(e)}};(function(t){class e{constructor(n=null){this._target=n,this._listenersMap=null}clear(){var n;(n=this._listenersMap)==null||n.clear(),this._listenersMap=null}destroy(){this.clear()}emit(n,s){const o=this._listenersMap&&this._listenersMap.get(n);if(!o)return!1;const a=this._target||this;return[...o].forEach(l=>{l.call(a,s)}),o.length>0}on(n,s){if(Array.isArray(n)){const a=n.map(l=>this.on(l,s));return dS(a)}if(n.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap||(this._listenersMap=new Map);const o=this._listenersMap.get(n)||[];return o.push(s),this._listenersMap.set(n,o),{remove:()=>{const a=this._listenersMap&&this._listenersMap.get(n)||[],l=a.indexOf(s);l>=0&&a.splice(l,1)}}}once(n,s){const o=this.on(n,a=>{o.remove(),s.call(null,a)});return o}hasEventListener(n){const s=this._listenersMap&&this._listenersMap.get(n);return s!=null&&s.length>0}}t.EventEmitter=e,t.EventedMixin=i=>{let n=class extends i{constructor(){super(...arguments),this._emitter=new e}destroy(){this._emitter.clear()}emit(s,o){return this._emitter.emit(s,o)}on(s,o){return this._emitter.on(s,o)}once(s,o){return this._emitter.once(s,o)}hasEventListener(s){return this._emitter.hasEventListener(s)}};return n=h([N("esri.core.Evented")],n),n};let r=class extends xe{constructor(){super(...arguments),this._emitter=new jL.EventEmitter(this)}destroy(){this._emitter.clear()}emit(i,n){return this._emitter.emit(i,n)}on(i,n){return this._emitter.on(i,n)}once(i,n){return this._emitter.once(i,n)}hasEventListener(i){return this._emitter.hasEventListener(i)}};r=h([N("esri.core.Evented")],r),t.EventedAccessor=r})(jL||(jL={}));const Bn=jL;var Yr;(function(t){t[t.ADD=1]="ADD",t[t.REMOVE=2]="REMOVE",t[t.MOVE=4]="MOVE"})(Yr||(Yr={}));function n0e(t){return(e,r)=>{e[r]=t}}let e6=class extends gge{notify(){const e=this._observers;if(e&&e.length>0){const r=e.slice();for(const i of r)i.onInvalidated(),i.onCommitted()}}};var ng;let YNe=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}};const Ou=new ko(YNe,void 0,t=>{t.item=null,t.target=null,t.defaultPrevented=!1,t.cancellable=!1}),ZNe=()=>{};function jU(t){return t?t instanceof Yv?t.toArray():t.length?Array.prototype.slice.apply(t):[]:[]}function HU(t){if(t&&t.length)return t[0]}function QNe(t,e,r,i){const n=Math.min(t.length-r,e.length-i);let s=0;for(;s{t.push(n),s0e(t,r.call(i,n,s,o),r,i)})}const y0=new Set,_0=new Set,v0=new Set,WU=new Map;let JNe=0,Yv=ng=class extends Bn.EventedAccessor{static isCollection(t){return t!=null&&t instanceof ng}constructor(t){super(t),this._chgListeners=[],this._notifications=null,this._timer=null,this._observable=new e6,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:JNe++})}normalizeCtorArgs(t){return t?Array.isArray(t)||t instanceof ng?{items:t}:t:{}}destroy(){this._removeAllRaw()}*[Symbol.iterator](){yield*this.items}get items(){return Ht(this._observable),this._items}set items(t){this._emitBeforeChanges(Yr.ADD)||(this._splice(0,this.length,jU(t)),this._emitAfterChanges(Yr.ADD))}hasEventListener(t){return t==="change"?this._chgListeners.length>0:this._emitter.hasEventListener(t)}on(t,e){if(t==="change"){const r=this._chgListeners,i={removed:!1,callback:e};return r.push(i),this._notifications&&this._notifications.push({listeners:r.slice(),items:this._items.slice(),changes:[]}),{remove(){this.remove=ZNe,i.removed=!0,r.splice(r.indexOf(i),1)}}}return this._emitter.on(t,e)}once(t,e){const r=this.on(t,e);return{remove(){r.remove()}}}add(t,e){if(Ht(this._observable),this._emitBeforeChanges(Yr.ADD))return this;const r=this.getNextIndex(e??null);return this._splice(r,0,[t]),this._emitAfterChanges(Yr.ADD),this}addMany(t,e=this._items.length){if(Ht(this._observable),!t||!t.length)return this;if(this._emitBeforeChanges(Yr.ADD))return this;const r=this.getNextIndex(e);return this._splice(r,0,jU(t)),this._emitAfterChanges(Yr.ADD),this}at(t){if(Ht(this._observable),(t=Math.trunc(t)||0)<0&&(t+=this.length),!(t<0||t>=this.length))return this._items[t]}removeAll(){if(Ht(this._observable),!this.length||this._emitBeforeChanges(Yr.REMOVE))return[];const t=this._removeAllRaw();return this._emitAfterChanges(Yr.REMOVE),t}_removeAllRaw(){return this.length===0?[]:this._splice(0,this.length)||[]}clone(){return Ht(this._observable),this._createNewInstance({items:this._items.map(ye)})}concat(...t){Ht(this._observable);const e=t.map(jU);return this._createNewInstance({items:this._items.concat(...e)})}drain(t,e){if(Ht(this._observable),!this.length||this._emitBeforeChanges(Yr.REMOVE))return;const r=this._splice(0,this.length),i=r.length;for(let n=0;ne&&(t=e),t}includes(t,e=0){return Ht(this._observable),this._items.includes(t,e)}indexOf(t,e=0){return Ht(this._observable),this._items.indexOf(t,e)}join(t=","){return Ht(this._observable),this._items.join(t)}lastIndexOf(t,e=this.length-1){return Ht(this._observable),this._items.lastIndexOf(t,e)}map(t,e){Ht(this._observable);const r=this._items.map(t,e);return new ng({items:r})}reorder(t,e=this.length-1){Ht(this._observable);const r=this.indexOf(t);if(r!==-1){if(e<0?e=0:e>=this.length&&(e=this.length-1),r!==e){if(this._emitBeforeChanges(Yr.MOVE))return t;this._splice(r,1),this._splice(e,0,[t]),this._emitAfterChanges(Yr.MOVE)}return t}}pop(){if(Ht(this._observable),!this.length||this._emitBeforeChanges(Yr.REMOVE))return;const t=HU(this._splice(this.length-1,1));return this._emitAfterChanges(Yr.REMOVE),t}push(...t){return Ht(this._observable),this._emitBeforeChanges(Yr.ADD)||(this._splice(this.length,0,t),this._emitAfterChanges(Yr.ADD)),this.length}reduce(t,e){Ht(this._observable);const r=this._items;return arguments.length===2?r.reduce(t,e):r.reduce(t)}reduceRight(t,e){Ht(this._observable);const r=this._items;return arguments.length===2?r.reduceRight(t,e):r.reduceRight(t)}remove(t){return Ht(this._observable),this.removeAt(this.indexOf(t))}removeAt(t){if(Ht(this._observable),t<0||t>=this.length||this._emitBeforeChanges(Yr.REMOVE))return;const e=HU(this._splice(t,1));return this._emitAfterChanges(Yr.REMOVE),e}removeMany(t){if(Ht(this._observable),!t||!t.length||this._emitBeforeChanges(Yr.REMOVE))return[];const e=t instanceof ng?t.toArray():t,r=this._items,i=[],n=e.length;for(let s=0;s-1){const l=1+QNe(e,r,s+1,a+1),c=this._splice(a,l);c&&c.length>0&&i.push.apply(i,c),s+=l-1}}return this._emitAfterChanges(Yr.REMOVE),i}reverse(){if(Ht(this._observable),this._emitBeforeChanges(Yr.MOVE))return this;const t=this._splice(0,this.length);return t&&(t.reverse(),this._splice(0,0,t)),this._emitAfterChanges(Yr.MOVE),this}shift(){if(Ht(this._observable),!this.length||this._emitBeforeChanges(Yr.REMOVE))return;const t=HU(this._splice(0,1));return this._emitAfterChanges(Yr.REMOVE),t}slice(t=0,e=this.length){return Ht(this._observable),this._createNewInstance({items:this._items.slice(t,e)})}some(t,e){return Ht(this._observable),this._items.some(t,e)}sort(t){if(Ht(this._observable),!this.length||this._emitBeforeChanges(Yr.MOVE))return this;const e=this._splice(0,this.length);return arguments.length?e.sort(t):e.sort(),this._splice(0,0,e),this._emitAfterChanges(Yr.MOVE),this}splice(t,e,...r){Ht(this._observable);const i=(e?Yr.REMOVE:0)|(r.length?Yr.ADD:0);if(this._emitBeforeChanges(i))return[];const n=this._splice(t,e,r)||[];return this._emitAfterChanges(i),n}toArray(){return Ht(this._observable),this._items.slice()}toJSON(){return Ht(this._observable),this.toArray()}toLocaleString(){return Ht(this._observable),this._items.toLocaleString()}toString(){return Ht(this._observable),this._items.toString()}unshift(...t){return Ht(this._observable),!t.length||this._emitBeforeChanges(Yr.ADD)||(this._splice(0,0,t),this._emitAfterChanges(Yr.ADD)),this.length}_createNewInstance(t){return new this.constructor(t)}_splice(t,e,r){const i=this._items,n=this.itemType;let s,o;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._timer=pP(()=>this._dispatchChange())),e){if(o=i.splice(t,e),this.hasEventListener("before-remove")){const a=Ou.acquire();a.target=this,a.cancellable=!0;for(let l=0,c=o.length;l{i.push(l)});const n=uc.acquire();_0.forEach(l=>{n.push(l)});const s=this._items,o=e.items,a=uc.acquire();if(v0.forEach(l=>{o.indexOf(l)!==s.indexOf(l)&&a.push(l)}),e.listeners&&(i.length||n.length||a.length)){const l={target:this,added:i,removed:n,moved:a},c=e.listeners.length;for(let u=0;u{if(!t)return ng;if(WU.has(t))return WU.get(t);let e=null;if(typeof t=="function")e=t.prototype.declaredClass;else if(t.base)e=t.base.prototype.declaredClass;else for(const i in t.typeMap){const n=t.typeMap[i].prototype.declaredClass;e?e+=` | ${n}`:e=n}let r=class extends ng{};return h([n0e({Type:t,ensureType:typeof t=="function"?Qa(t):L_(t)})],r.prototype,"itemType",void 0),r=h([N(`esri.core.Collection<${e}>`)],r),WU.set(t,r),r},h([f()],Yv.prototype,"length",void 0),h([f()],Yv.prototype,"items",null),Yv=ng=h([N("esri.core.Collection")],Yv);const ir=Yv;function qb(t,e,r=ir){return e||(e=new r),e===t||(e.removeAll(),KNe(t)?e.addMany(t):t&&e.add(t)),e}function o0e(t){return t}function KNe(t){return t&&(Array.isArray(t)||"items"in t&&Array.isArray(t.items))}const Pte=new Set;function e4e(t,e,r=!1){r&&Pte.has(e)||(r&&Pte.add(e),t.warn(`🛑 DEPRECATED - ${e}`))}function e_(t,e,r={}){if(se("esri-deprecation-warnings")){const{moduleName:i}=r;u4(t,`Property: ${(i?i+"::":"")+e}`,r)}}function u4(t,e,r={}){if(se("esri-deprecation-warnings")){const{replacement:i,version:n,see:s,warnOnce:o}=r;let a=e;i&&(a+=` + 🛠️ Replacement: ${i}`),n&&(a+=` + ⚙️ Version: ${n}`),s&&(a+=` + 🔗 See ${s} for more details.`),e4e(t,a,o)}}let t4e=class a0e{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const r=new a0e;return this._values.forEach((i,n)=>{e&&e.has(n)||r.set(n,ye(i.value),i.origin)}),r}get(e,r){r=this._normalizeOrigin(r);const i=this._values.get(e);return r==null||(i==null?void 0:i.origin)===r?i==null?void 0:i.value:void 0}originOf(e){var r;return((r=this._values.get(e))==null?void 0:r.origin)??Qr.USER}keys(e){e=this._normalizeOrigin(e);const r=[...this._values.keys()];return e==null?r:r.filter(i=>{var n;return((n=this._values.get(i))==null?void 0:n.origin)===e})}set(e,r,i){if((i=this._normalizeOrigin(i))===Qr.DEFAULTS){const n=this._values.get(e);if(n&&n.origin!=null&&n.origin>i)return}this._values.set(e,new r4e(r,i))}delete(e,r){var i;(r=this._normalizeOrigin(r))!=null&&((i=this._values.get(e))==null?void 0:i.origin)!==r||this._values.delete(e)}has(e,r){var i;return(r=this._normalizeOrigin(r))!=null?((i=this._values.get(e))==null?void 0:i.origin)===r:this._values.has(e)}forEach(e){this._values.forEach(({value:r},i)=>e(r,i))}_normalizeOrigin(e){if(e!=null)return e===Qr.DEFAULTS?e:Qr.USER}},r4e=class{constructor(e,r){this.value=e,this.origin=r}};function i4e(t,e,r){e.keys().forEach(n=>{r.set(n,e.get(n),Qr.DEFAULTS)});const i=t.metadatas;Object.keys(i).forEach(n=>{t.internalGet(n)&&r.set(n,t.internalGet(n),Qr.DEFAULTS)})}function n4e(t,e,r){if(!t||!t.read||t.read.enabled===!1||!t.read.source)return!1;const i=t.read.source;if(typeof i=="string"){if(i===e||i.includes(".")&&i.indexOf(e)===0&&ute(i,r))return!0}else for(const n of i)if(n===e||n.includes(".")&&n.indexOf(e)===0&&ute(n,r))return!0;return!1}function s4e(t){return t&&(!t.read||t.read.enabled!==!1&&!t.read.source)}function o4e(t,e,r,i,n){let s=PV(e[r],n);s4e(s)&&(t[r]=!0);for(const o of Object.getOwnPropertyNames(e))s=PV(e[o],n),n4e(s,r,i)&&(t[o]=!0)}function a4e(t,e,r,i){const n=r.metadatas,s=BNe(n[e],i),o=s==null?void 0:s.default;if(o===void 0)return;const a=typeof o=="function"?o.call(t,e,i):o;a!==void 0&&r.set(e,a)}const l0e={origin:"service"};function l4e(t,e,r=l0e){if(!e||typeof e!="object")return;const i=I_(t),n=i.metadatas,s={};for(const o of Object.getOwnPropertyNames(e))o4e(s,n,o,e,r);i.setDefaultOrigin(r.origin);for(const o of Object.getOwnPropertyNames(s)){const a=PV(n[o],r).read,l=a&&a.source;let c;c=l&&typeof l=="string"?lP(e,l):e[o],a&&a.reader&&(c=a.reader.call(t,c,e,r)),c!==void 0&&i.set(o,c)}if(!r||!r.ignoreDefaults){i.setDefaultOrigin("defaults");for(const o of Object.getOwnPropertyNames(n))s[o]||a4e(t,o,i,r)}i.setDefaultOrigin("user")}function yCt(t,e,r,i=l0e){var s;const n={...i,messages:[]};r(n),(s=n.messages)==null||s.forEach(o=>{o.type!=="warning"||t.loaded?i&&i.messages&&i.messages.push(o):t.loadWarnings.push(o)})}function c4e(t,e,r,i,n){var o,a;const s={};return(a=(o=e.write)==null?void 0:o.writer)==null||a.call(t,i,s,r,n),s}function c0e(t,e,r,i,n,s){if(!i||!i.write)return!1;const o=t.get(r);if(!n&&i.write.overridePolicy){const a=i.write.overridePolicy.call(t,o,r,s??void 0);a!==void 0&&(n=a)}if(n||(n=i.write),!n||n.enabled===!1)return!1;if((o===null&&!n.allowNull&&!n.writerEnsuresNonNull||o===void 0)&&n.isRequired){const a=new Y("web-document-write:property-required",`Missing value for required property '${r}' on '${t.declaredClass}'`,{propertyName:r,target:t});return a&&s&&s.messages?s.messages.push(a):a&&!s&&J.getLogger("esri.core.accessorSupport.write").error(a.name,a.message),!1}return!(o===void 0||o===null&&!n.allowNull&&!n.writerEnsuresNonNull||!n.alwaysWriteDefaults&&(!e.store.multipleOriginsSupported||e.store.originOf(r)===Qr.DEFAULTS)&&u4e(t,r,s,i,o)||!n.ignoreOrigin&&s&&s.origin&&e.store.multipleOriginsSupported&&e.store.originOf(r)0&&(e=kL(e,u),(o=(s=r==null?void 0:r.resources)==null?void 0:s.pendingOperations)!=null&&o.length&&r.resources.pendingOperations.push(Promise.all(r.resources.pendingOperations).then(()=>kL(e,u,()=>"replace-arrays"))),r&&r.writtenProperties&&r.writtenProperties.push({target:t,propName:a,oldOrigin:MDe(i.store.originOf(a)),newOrigin:r.origin}))}return e}const fP=t=>{let e=class extends t{constructor(...r){super(...r);const i=I_(this),n=i.store,s=new t4e;i.store=s,i4e(i,n,s)}read(r,i){l4e(this,r,i)}write(r,i){return h4e(this,r??{},i)}toJSON(r){return this.write({},r)}static fromJSON(r,i){return d4e.call(this,r,i)}};return e=h([N("esri.core.JSONSupport")],e),e.prototype.toJSON.isDefaultToJSON=!0,e};function d4e(t,e){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");const r=new this;return r.read(t,e),r}let ke=class extends fP(xe){};ke=h([N("esri.core.JSONSupport")],ke);var Oy;(function(t){t[t.PENDING=0]="PENDING",t[t.RESOLVED=1]="RESOLVED",t[t.REJECTED=2]="REJECTED"})(Oy||(Oy={}));let p4e=class{constructor(){this._resolver=Wo(),this._status=Oy.PENDING,this._resolvingPromises=[],this._resolver.promise.then(()=>{this._status=Oy.RESOLVED,this._cleanUp()},()=>{this._status=Oy.REJECTED,this._cleanUp()}),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return this._status===Oy.RESOLVED}isRejected(){return this._status===Oy.REJECTED}isFulfilled(){return this._status!==Oy.PENDING}abort(){this._resolver.reject(wr())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const e=Wo(),r=[...this._resolvingPromises,e.promise],i=this._allPromise=Promise.all(r);i.then(()=>{this.isFulfilled()||this._allPromise!==i||this._resolver.resolve()},n=>{this.isFulfilled()||this._allPromise!==i||Zn(n)||this._resolver.reject(n)}),e.resolve()}};const t6=t=>{let e=class extends t{constructor(...r){super(...r),this._promiseProps=new p4e,this.addResolvingPromise(Promise.resolve())}destroy(){var r;(r=this._promiseProps)==null||r.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(r,i){return this._promiseProps.promise.then(()=>this).then(r,i)}catch(r){return this.when(null,r)}addResolvingPromise(r){r&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in r?r.when():r)}};return e=h([N("esri.core.Promise")],e),e};let h4=class extends t6(xe){};h4=h([N("esri.core.Promise")],h4);const f4e="not-loaded",m4e="loading",g4e="failed",Mte="loaded",u0e=t=>{let e=class extends t{constructor(...r){super(...r),this._loadController=null,this.loadError=null,this.loadStatus="not-loaded",this._set("loadWarnings",[]),this.addResolvingPromise(new Promise(i=>{const n=this.load.bind(this);this.load=s=>{const o=new Promise((a,l)=>{const c=CX(s,l);this.destroyed&&l(new Y("load:instance-destroyed",`Instance of '${this.declaredClass||this.constructor.name}' is already destroyed`,{instance:this})),this.when(a,l).finally(()=>{c&&c.remove()})});if(this.loadStatus===f4e){this._set("loadStatus",m4e);const a=this._loadController=new AbortController;n({signal:a.signal}),pa(a.signal,()=>{this._promiseProps.abort()})}return i(),o}})),this.when(()=>{this._set("loadStatus",Mte),this._loadController=null},i=>{this._set("loadStatus",g4e),this._set("loadError",i),this._loadController=null})}destroy(){this._loadController=yu(this._loadController),this._set("loadError",null),this._set("loadWarnings",[])}get loaded(){return this.loadStatus===Mte}get loadWarnings(){return this._get("loadWarnings")}load(){return null}cancelLoad(){var r;return this.isFulfilled()||(this._set("loadError",new Y("load:cancelled","Cancelled")),(r=this._loadController)==null||r.abort()),this}};return h([f({readOnly:!0})],e.prototype,"loaded",null),h([f({readOnly:!0})],e.prototype,"loadError",void 0),h([f({clonable:!1})],e.prototype,"loadStatus",void 0),h([f({type:[D_],readOnly:!0})],e.prototype,"loadWarnings",null),e=h([N("esri.core.Loadable")],e),e};let l3=class extends u0e(h4){};l3=h([N("esri.core.Loadable")],l3),function(t){function e(r){return!(!r||!r.load)}t.LoadableMixin=u0e,t.isLoadable=e}(l3||(l3={}));const Dg=l3;function r6(t,e,r){return o1(t.map((i,n)=>e.apply(r,[i,n])))}async function y4e(t,e,r){return(await o1(t.map((i,n)=>e.apply(r,[i,n])))).map(i=>i.value)}function LX(t){return{ok:!0,value:t}}function DX(t){return{ok:!1,error:t}}function _4e(t){return t!=null&&t.ok===!0?t.value:null}function v4e(t){return t!=null&&t.ok===!1?t.error:null}async function Ng(t){if(t==null)return{ok:!1,error:new Error("no promise provided")};try{return LX(await t)}catch(e){return DX(e)}}async function TCt(t){try{return LX(await t)}catch(e){return Mw(e),DX(e)}}function SCt(t){if(t.ok===!0)return t.value;throw t.error}function hE(t,e){return new ey(t,e)}let ey=class extends xe{get value(){return _4e(this._result)}get error(){return v4e(this._result)}get finished(){return this._result!=null}constructor(e,r){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=yu(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:i}=this._abortController;this.promise=e(i),this.promise.then(n=>{this._result=LX(n),this._cleanup()},n=>{this._result=DX(n),this._cleanup()}),this._abortHandle=pa(r,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=Pi(this._abortHandle),this._abortController=null}};h([f()],ey.prototype,"value",null),h([f()],ey.prototype,"error",null),h([f()],ey.prototype,"finished",null),h([f()],ey.prototype,"promise",void 0),h([f()],ey.prototype,"_result",void 0),ey=h([N("esri.core.asyncUtils.ReactiveTask")],ey);async function h0e(t,e){return await t.load(),b4e(t,e)}async function b4e(t,e){const r=[],i=(...s)=>{for(const o of s)o!=null&&(Array.isArray(o)?i(...o):ir.isCollection(o)?o.forEach(a=>i(a)):Dg.isLoadable(o)&&r.push(o))};e(i);let n=null;if(await y4e(r,async s=>{const o=await Ng(w4e(s)?s.loadAll():s.load());o.ok!==!1||n||(n=o)}),n)throw n.error;return t}function w4e(t){return"loadAll"in t&&typeof t.loadAll=="function"}const x4e=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,T4e={devext:{customBaseUrl:"mapsdevext.arcgis.com",portalHostname:"devext.arcgis.com"},qaext:{customBaseUrl:"mapsqa.arcgis.com",portalHostname:"qaext.arcgis.com"},www:{customBaseUrl:"maps.arcgis.com",portalHostname:"www.arcgis.com"}};function $te(t){const e=t==null?void 0:t.match(x4e);if(!e)return null;const[,r,i,n]=e;if(!r)return null;let s=null,o=null,a=null;const{devext:l,qaext:c,www:u}=T4e;if(i)if(s=r,n)switch(n.toLowerCase()){case"devext":({customBaseUrl:o,portalHostname:a}=l);break;case"qa":({customBaseUrl:o,portalHostname:a}=c);break;default:return null}else({customBaseUrl:o,portalHostname:a}=u);else switch(r.toLowerCase()){case"devext":({customBaseUrl:o,portalHostname:a}=l);break;case"qaext":({customBaseUrl:o,portalHostname:a}=c);break;case"www":({customBaseUrl:o,portalHostname:a}=u);break;default:return null}return{customBaseUrl:o,isPortal:!1,portalHostname:a,urlKey:s}}function S4e(t){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(t)}function E4e(t){const e=atob(t),r=new Uint8Array(e.length);for(let i=0;ija,ACt=()=>NX;function D4e(){const t=ja.path,e=t.substring(0,t.lastIndexOf(t.split("/")[t.split("/").length-1]));return`${`${ja.scheme}://${ja.host}${ja.port!=null?`:${ja.port}`:""}`}${e}`}function Ja(t){if(!t)return null;const e={path:null,query:null},r=new $T(t),i=t.indexOf("?");return r.query===null?e.path=t:(e.path=t.substring(0,i),e.query=UX(r.query)),r.fragment&&(e.hash=r.fragment,r.query===null&&(e.path=e.path.substring(0,e.path.length-(r.fragment.length+1)))),e}function UX(t){const e=t.split("&"),r={};for(const i of e){if(!i)continue;const n=i.indexOf("=");let s,o;n<0?(s=decodeURIComponent(i),o=""):(s=decodeURIComponent(i.slice(0,n)),o=decodeURIComponent(i.slice(n+1)));let a=r[s];typeof a=="string"&&(a=r[s]=[a]),Array.isArray(a)?a.push(o):r[s]=o}return r}function Lte(t){return t&&typeof t=="object"&&"toJSON"in t&&typeof t.toJSON=="function"}function JO(t,e){return t?e&&typeof e=="function"?Object.keys(t).map(r=>encodeURIComponent(r)+"="+encodeURIComponent(e(r,t[r]))).join("&"):Object.keys(t).map(r=>{const i=t[r];if(i==null)return"";const n=encodeURIComponent(r)+"=",s=e&&e[r];return s?n+encodeURIComponent(s(i)):Array.isArray(i)?i.map(o=>Lte(o)?n+encodeURIComponent(JSON.stringify(o)):n+encodeURIComponent(o)).join("&"):Lte(i)?n+encodeURIComponent(JSON.stringify(i)):n+encodeURIComponent(i)}).filter(r=>r).join("&"):""}function N4e(t=!1){let e,r=dE.proxyUrl;if(typeof t=="string"){e=V4e(t);const i=i6(t);i&&(r=i.proxyUrl)}else e=!!t;if(!r)throw C4e.warn(Ite),new Y("urlutils:proxy-not-set",Ite);return e&&IV()&&(r=GX(r)),Ja(r)}function OCt(t){const e=i6(t);let r,i;if(e){const n=kX(e.proxyUrl);r=n.path,i=n.query?UX(n.query):null}if(r){const n=Ja(t);t=r+"?"+n.path;const s=JO({...i,...n.query});s&&(t=`${t}?${s}`)}return t}const ZE={path:"",query:""};function kX(t){const e=t.indexOf("?");return e!==-1?(ZE.path=t.slice(0,e),ZE.query=t.slice(e+1)):(ZE.path=t,ZE.query=null),ZE}function f0e(t){return t=(t=p4(t=q4e(t=kX(t).path),!0)).toLowerCase()}function F4e(t){const e={proxyUrl:t.proxyUrl,urlPrefix:f0e(t.urlPrefix)},r=dE.proxyRules,i=e.urlPrefix;let n=r.length;for(let s=0;s0?t.substring(0,e):t.replace(/\/+$/,"")}function m0e(t){const e=i=>i==null||i instanceof RegExp&&i.test(t)||typeof i=="string"&&t.startsWith(i),r=dE.interceptors;if(r){for(const i of r)if(Array.isArray(i.urls)){if(i.urls.some(e))return i}else if(e(i.urls))return i}return null}function gS(t,e,r=!1){if(!t||!e)return!1;const i=DV(t),n=DV(e);return!(!r&&i.scheme!==n.scheme)&&i.host!=null&&n.host!=null&&i.host.toLowerCase()===n.host.toLowerCase()&&i.port===n.port}function zX(t){if(typeof t=="string"){if(!uu(t))return!0;t=DV(t)}if(gS(t,ja))return!0;const e=dE.trustedServers||[];for(let r=0;r(m=d.indexOf(p,m))===-1?d.length:m;let l=a(n,"/",n.indexOf("//")+2),c=-1;for(;n.slice(0,l+1)===s.slice(0,l)+"/"&&(c=l+1,l!==n.length);)l=a(n,"/",l+1);if(c===-1||o&&c0)for(let d=0;ds?n.concat(s.split("/")):n,[]);for(let n=0;n0&&r[r.length-1]!==".."?r.pop():(!s&&n===i.length-1||s&&(s!=="."||r.length===0))&&r.push(s)}return r.join("/")}function Kd(t,e=!1){if(t==null||KO(t)||im(t))return null;let r=t.indexOf("://");if(r===-1&&Wf(t))r=2;else{if(r===-1)return null;r+=3}const i=t.indexOf("/",r);return i!==-1&&(t=t.slice(0,i)),e&&(t=p4(t,!0)),t}function uu(t){return Wf(t)||VX(t)}function KO(t){return t!=null&&t.slice(0,5)==="blob:"}function im(t){return t!=null&&t.slice(0,5)==="data:"}function BX(t){const e=Xb(t);return e&&e.isBase64?E4e(e.data):null}function PCt(t){return btoa(String.fromCharCode.apply(null,t)).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const z4e=/^data:(.*?)(;base64)?,(.*)$/;function Xb(t){const e=t.match(z4e);if(!e)return null;const[,r,i,n]=e;return{mediaType:r,isBase64:!!i,data:n}}function g0e(t){return t.isBase64?`data:${t.mediaType};base64,${t.data}`:`data:${t.mediaType},${t.data}`}function MCt(t){const e=BX(t);if(!e)return null;const r=Xb(t);return new Blob([e],{type:r.mediaType})}function $Ct(t,e){B4e(t,e)}function B4e(t,e){if(!t)return!1;const r=document.createElement("a");if(!("download"in r))return!1;const i=URL.createObjectURL(t);return r.download=e,r.href=i,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(i),!0}function Wf(t){return t!=null&&t[0]==="/"&&t[1]==="/"}function VX(t){return t!=null&&d0e.test(t)}function V4e(t){return t!=null&&A4e.test(t)||ja.scheme==="https"&&Wf(t)}function G4e(t){return t!=null&&p0e.test(t)||ja.scheme==="http"&&Wf(t)}function j4e(t){return t!=null&&O4e.test(t)}function GX(t){return Wf(t)?`https:${t}`:t.replace(p0e,"https:")}function H4e(){return ja.scheme==="http"}function IV(){return ja.scheme==="https"}function p4(t,e=!1){return Wf(t)?t.slice(2):(t=t.replace(d0e,""),e&&t.length>1&&t[0]==="/"&&t[1]==="/"&&(t=t.slice(2)),t)}function W4e(t){const e=t.indexOf("//"),r=t.indexOf("/",e+2);return r===-1?t:t.slice(0,r)}function o6(t){let e=0;if(uu(t)){const i=t.indexOf("//");i!==-1&&(e=i+2)}const r=t.lastIndexOf("/");return ri===n||i.endsWith(`.${n}`))||IV()&&!i6(t))&&(t=GX(t)),t}function LV(t,e,r){if(!(e&&r&&t&&uu(t)))return t;const i=t.indexOf("//"),n=t.indexOf("/",i+2),s=t.indexOf(":",i+2),o=Math.min(n<0?t.length:n,s<0?t.length:s);return t.slice(i+2,o).toLowerCase()!==e.toLowerCase()?t:`${t.slice(0,i+2)}${r}${t.slice(o)}`}function DV(t){return typeof t=="string"?new $T(iu(t)):(t.scheme||(t.scheme=ja.scheme),t)}function _0e(t){return Q4e.test(t)}function v0e(t,e){const r=Ja(t),i=Object.keys(r.query||{});return i.length>0&&e&&e.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${i.join(", ")}.`),r.path}function b0e(t,e,r){const i=Ja(t),n=i.query||{};return n[e]=String(r),`${i.path}?${JO(n)}`}function qU(t,e){const r=Ja(t),i=r.query||{};for(const s in e)i[s]=e[s];const n=JO(i);return n?`${r.path}?${n}`:r.path}function LCt(t){if(t==null)return null;const e=t.match(w0e);return e?e[2]:null}function Dte(t){if(t==null)return null;const e=t.match(w0e);return e?{path:e[1],extension:e[2]}:{path:t,extension:null}}async function DCt(t){return typeof t=="string"?Xb(t)??{data:t}:new Promise((e,r)=>{const i=new FileReader;i.readAsDataURL(t),i.onload=()=>e(Xb(i.result)),i.onerror=n=>r(n)})}const w0e=/([^.]*)\.([^\/]*)$/,Q4e=/(^data:image\/svg|\.svg$)/i;function xr(t,e,r){let i,n;return e===void 0?(n=t,i=[void 0]):typeof e!="string"?(n=t,i=[void 0],r=e):(n=e,i=Array.isArray(t)?t:[t]),(s,o)=>{const a=s.constructor.prototype;for(const l of i){const c=Hge(s,l,n);c.write&&typeof c.write=="object"||(c.write={}),r&&(c.write.target=r),c.write.writer=a[o]}}}let zn=class{constructor(e,r={ignoreUnknown:!1,useNumericKeys:!1}){this._jsonToAPI=e,this._options=r,this.apiValues=[],this.jsonValues=[],this._apiToJSON=this._invertMap(e),this.apiValues=this._getKeysSorted(this._apiToJSON),this.jsonValues=this._getKeysSorted(this._jsonToAPI),this.read=i=>this.fromJSON(i),this.write=(i,n,s)=>{const o=this.toJSON(i);o!==void 0&&Pw(s,o,n)},this.write.isJSONMapWriter=!0}toJSON(e){if(e==null)return null;if(this._apiToJSON.hasOwnProperty(e)){const r=this._apiToJSON[e];return this._options.useNumericKeys?+r:r}return this._options.ignoreUnknown?void 0:e}fromJSON(e){return e!=null&&this._jsonToAPI.hasOwnProperty(e)?this._jsonToAPI[e]:this._options.ignoreUnknown?void 0:e}_invertMap(e){const r={};for(const i in e)r[e[i]]=i;return r}_getKeysSorted(e){const r=[];for(const i in e)r.push(i);return r.sort(),r}};function Oc(){return function(t,e){return new zn(t,{ignoreUnknown:!0,...e})}}let jX=class{constructor(e,r,i,n){this.semiMajorAxis=e,this.flattening=r,this.outerAtmosphereRimWidth=i;const s=1-this.flattening;this.semiMinorAxis=this.semiMajorAxis*s,this.halfSemiMajorAxis=this.semiMajorAxis/2,this.halfCircumference=Math.PI*this.semiMajorAxis,this.metersPerDegree=this.halfCircumference/180,this.inverseFlattening=1/(1-this.flattening)-1,this.eccentricitySquared=n||2*this.flattening-this.flattening*this.flattening,this.meanRadiusSemiAxes=(2*this.semiMajorAxis+this.semiMinorAxis)/3}get radius(){return this.semiMajorAxis}};const Kt=new jX(6378137,1/298.257223563,3e5,.006694379990137799),If=new jX(3396190,1/169.8944472236118,23e4),Fg=new jX(1737400,0,0);var fh;(function(t){t[t.CGCS2000=4490]="CGCS2000",t[t.GCSMARS2000=104971]="GCSMARS2000",t[t.GCSMARS2000_SPHERE=104905]="GCSMARS2000_SPHERE",t[t.GCSMOON2000=104903]="GCSMOON2000"})(fh||(fh={}));let g;const $={values:[1,.3048,.3048006096012192,.3047972654,.9143917962,.201166195164,.9143984146160287,.3047994715386762,20.11676512155263,20.11678249437587,.9143985307444408,.91439523,.3047997101815088,20.1168,20.116756,5e4,15e4],units:["Meter","Foot","Foot_US","Foot_Clarke","Yard_Clarke","Link_Clarke","Yard_Sears","Foot_Sears","Chain_Sears","Chain_Benoit_1895_B","Yard_Indian","Yard_Indian_1937","Foot_Gold_Coast","Chain","Chain_Sears_1922_Truncated","50_Kilometers","150_Kilometers"],2066:5,2136:12,2155:2,2157:0,2158:0,2159:12,2160:12,2204:2,2219:0,2220:0,2254:2,2255:2,2256:1,2265:1,2266:1,2267:2,2268:2,2269:1,2270:1,2271:2,2272:2,2273:1,2294:0,2295:0,2314:3,2899:2,2900:2,2901:1,2909:1,2910:1,2911:2,2912:2,2913:1,2914:1,2992:1,2993:0,2994:1,3080:1,3089:2,3090:0,3091:2,3102:2,3141:0,3142:0,3167:14,3359:2,3360:0,3361:1,3362:0,3363:2,3364:0,3365:2,3366:3,3404:2,3405:0,3406:0,3407:3,3439:0,3440:0,3479:1,3480:0,3481:1,3482:0,3483:1,3484:0,3485:2,3486:0,3487:2,3488:0,3489:0,3490:2,3491:0,3492:2,3493:0,3494:2,3495:0,3496:2,3497:0,3498:2,3499:0,3500:2,3501:0,3502:2,3503:0,3504:2,3505:0,3506:2,3507:0,3508:2,3509:0,3510:2,3511:0,3512:2,3513:0,3514:0,3515:2,3516:0,3517:2,3518:0,3519:2,3520:0,3521:2,3522:0,3523:2,3524:0,3525:2,3526:0,3527:2,3528:0,3529:2,3530:0,3531:2,3532:0,3533:2,3534:0,3535:2,3536:0,3537:2,3538:0,3539:2,3540:0,3541:2,3542:0,3543:2,3544:0,3545:2,3546:0,3547:2,3548:0,3549:2,3550:0,3551:2,3552:0,3553:2,3582:2,3583:0,3584:2,3585:0,3586:2,3587:0,3588:1,3589:0,3590:1,3591:0,3592:0,3593:1,3598:2,3599:0,3600:2,3605:1,3606:0,3607:0,3608:2,3609:0,3610:2,3611:0,3612:2,3613:0,3614:2,3615:0,3616:2,3617:0,3618:2,3619:0,3620:2,3621:0,3622:2,3623:0,3624:2,3625:0,3626:2,3627:0,3628:2,3629:0,3630:2,3631:0,3632:2,3633:0,3634:1,3635:0,3636:1,3640:2,3641:0,3642:2,3643:0,3644:1,3645:0,3646:1,3647:0,3648:1,3649:0,3650:2,3651:0,3652:2,3653:0,3654:2,3655:0,3656:1,3657:0,3658:2,3659:0,3660:2,3661:0,3662:2,3663:0,3664:2,3668:2,3669:0,3670:2,3671:0,3672:2,3673:0,3674:2,3675:0,3676:1,3677:2,3678:0,3679:1,3680:2,3681:0,3682:1,3683:2,3684:0,3685:0,3686:2,3687:0,3688:2,3689:0,3690:2,3691:0,3692:2,3696:2,3697:0,3698:2,3699:0,3700:2,3793:0,3794:0,3812:0,3854:0,3857:0,3920:0,3978:0,3979:0,3991:2,3992:2,4026:0,4037:0,4038:0,4071:0,4082:0,4083:0,4087:0,4088:0,4217:2,4414:0,4415:0,4417:0,4434:0,4437:0,4438:2,4439:2,4462:0,4467:0,4471:0,4474:0,4559:0,4647:0,4822:0,4826:0,4839:0,5018:0,5041:0,5042:0,5048:0,5167:0,5168:0,5221:0,5223:0,5234:0,5235:0,5243:0,5247:0,5266:0,5316:0,5320:0,5321:0,5325:0,5337:0,5361:0,5362:0,5367:0,5382:0,5383:0,5396:0,5456:0,5457:0,5469:0,5472:4,5490:0,5513:0,5514:0,5523:0,5559:0,5588:1,5589:3,5596:0,5627:0,5629:0,5641:0,5643:0,5644:0,5646:2,5654:2,5655:2,5659:0,5700:0,5825:0,5836:0,5837:0,5839:0,5842:0,5844:0,5858:0,5879:0,5880:0,5887:0,5890:0,6128:1,6129:1,6141:1,6204:0,6210:0,6211:0,6307:0,6312:0,6316:0,6362:0,6391:1,6405:1,6406:0,6407:1,6408:0,6409:1,6410:0,6411:2,6412:0,6413:2,6414:0,6415:0,6416:2,6417:0,6418:2,6419:0,6420:2,6421:0,6422:2,6423:0,6424:2,6425:0,6426:2,6427:0,6428:2,6429:0,6430:2,6431:0,6432:2,6433:0,6434:2,6435:0,6436:2,6437:0,6438:2,6439:0,6440:0,6441:2,6442:0,6443:2,6444:0,6445:2,6446:0,6447:2,6448:0,6449:2,6450:0,6451:2,6452:0,6453:2,6454:0,6455:2,6456:0,6457:2,6458:0,6459:2,6460:0,6461:2,6462:0,6463:2,6464:0,6465:2,6466:0,6467:2,6468:0,6469:2,6470:0,6471:2,6472:0,6473:2,6474:0,6475:2,6476:0,6477:2,6478:0,6479:2,6484:2,6485:0,6486:2,6487:0,6488:2,6489:0,6490:2,6491:0,6492:2,6493:0,6494:1,6495:0,6496:1,6497:0,6498:0,6499:1,6500:0,6501:2,6502:0,6503:2,6504:0,6505:2,6506:0,6507:2,6508:0,6509:0,6510:2,6515:1,6516:0,6518:0,6519:2,6520:0,6521:2,6522:0,6523:2,6524:0,6525:2,6526:0,6527:2,6528:0,6529:2,6530:0,6531:2,6532:0,6533:2,6534:0,6535:2,6536:0,6537:2,6538:0,6539:2,6540:0,6541:2,6542:0,6543:2,6544:0,6545:1,6546:0,6547:1,6548:0,6549:2,6550:0,6551:2,6552:0,6553:2,6554:0,6555:2,6556:0,6557:1,6558:0,6559:1,6560:0,6561:1,6562:0,6563:2,6564:0,6565:2,6566:0,6567:0,6568:2,6569:0,6570:1,6571:0,6572:2,6573:0,6574:2,6575:0,6576:2,6577:0,6578:2,6582:2,6583:0,6584:2,6585:0,6586:2,6587:0,6588:2,6589:0,6590:2,6591:0,6592:0,6593:2,6594:0,6595:2,6596:0,6597:2,6598:0,6599:2,6600:0,6601:2,6602:0,6603:2,6605:2,6606:0,6607:2,6608:0,6609:2,6610:0,6611:0,6612:2,6613:0,6614:2,6615:0,6616:2,6617:0,6618:2,6633:2,6646:0,6703:0,6784:0,6785:1,6786:0,6787:1,6788:0,6789:1,6790:0,6791:1,6792:0,6793:1,6794:0,6795:1,6796:0,6797:1,6798:0,6799:1,6800:0,6801:1,6802:0,6803:1,6804:0,6805:1,6806:0,6807:1,6808:0,6809:1,6810:0,6811:1,6812:0,6813:1,6814:0,6815:1,6816:0,6817:1,6818:0,6819:1,6820:0,6821:1,6822:0,6823:1,6824:0,6825:1,6826:0,6827:1,6828:0,6829:1,6830:0,6831:1,6832:0,6833:1,6834:0,6835:1,6836:0,6837:1,6838:0,6839:1,6840:0,6841:1,6842:0,6843:1,6844:0,6845:1,6846:0,6847:1,6848:0,6849:1,6850:0,6851:1,6852:0,6853:1,6854:0,6855:1,6856:0,6857:1,6858:0,6859:1,6860:0,6861:1,6862:0,6863:1,6867:0,6868:1,6870:0,6875:0,6876:0,6879:0,6880:2,6884:0,6885:1,6886:0,6887:1,6915:0,6922:0,6923:2,6924:0,6925:2,6962:0,6984:0,6991:0,7128:2,7131:0,7132:2,7142:0,7257:0,7258:2,7259:0,7260:2,7261:0,7262:2,7263:0,7264:2,7265:0,7266:2,7267:0,7268:2,7269:0,7270:2,7271:0,7272:2,7273:0,7274:2,7275:0,7276:2,7277:0,7278:2,7279:0,7280:2,7281:0,7282:2,7283:0,7284:2,7285:0,7286:2,7287:0,7288:2,7289:0,7290:2,7291:0,7292:2,7293:0,7294:2,7295:0,7296:2,7297:0,7298:2,7299:0,7300:2,7301:0,7302:2,7303:0,7304:2,7305:0,7306:2,7307:0,7308:2,7309:0,7310:2,7311:0,7312:2,7313:0,7314:2,7315:0,7316:2,7317:0,7318:2,7319:0,7320:2,7321:0,7322:2,7323:0,7324:2,7325:0,7326:2,7327:0,7328:2,7329:0,7330:2,7331:0,7332:2,7333:0,7334:2,7335:0,7336:2,7337:0,7338:2,7339:0,7340:2,7341:0,7342:2,7343:0,7344:2,7345:0,7346:2,7347:0,7348:2,7349:0,7350:2,7351:0,7352:2,7353:0,7354:2,7355:0,7356:2,7357:0,7358:2,7359:0,7360:2,7361:0,7362:2,7363:0,7364:2,7365:0,7366:2,7367:0,7368:2,7369:0,7370:2,7877:0,7878:0,7882:0,7883:0,7887:0,7899:0,7991:0,7992:0,8035:2,8036:2,8058:0,8059:0,8082:0,8083:0,8088:0,8090:0,8091:2,8092:0,8093:2,8095:0,8096:2,8097:0,8098:2,8099:0,8100:2,8101:0,8102:2,8103:0,8104:2,8105:0,8106:2,8107:0,8108:2,8109:0,8110:2,8111:0,8112:2,8113:0,8114:2,8115:0,8116:2,8117:0,8118:2,8119:0,8120:2,8121:0,8122:2,8123:0,8124:2,8125:0,8126:2,8127:0,8128:2,8129:0,8130:2,8131:0,8132:2,8133:0,8134:2,8135:0,8136:2,8137:0,8138:2,8139:0,8140:2,8141:0,8142:2,8143:0,8144:2,8145:0,8146:2,8147:0,8148:2,8149:0,8150:2,8151:0,8152:2,8153:0,8154:2,8155:0,8156:2,8157:0,8158:2,8159:0,8160:2,8161:0,8162:2,8163:0,8164:2,8165:0,8166:2,8167:0,8168:2,8169:0,8170:2,8171:0,8172:2,8173:0,8177:2,8179:0,8180:2,8181:0,8182:2,8184:0,8185:2,8187:0,8189:2,8191:0,8193:2,8196:0,8197:2,8198:0,8200:2,8201:0,8202:2,8203:0,8204:2,8205:0,8206:2,8207:0,8208:2,8209:0,8210:2,8212:0,8213:2,8214:0,8216:2,8218:0,8220:2,8222:0,8224:2,8225:0,8226:2,8311:0,8312:1,8313:0,8314:1,8315:0,8316:1,8317:0,8318:1,8319:0,8320:1,8321:0,8322:1,8323:0,8324:1,8325:0,8326:1,8327:0,8328:1,8329:0,8330:1,8331:0,8332:1,8333:0,8334:1,8335:0,8336:1,8337:0,8338:1,8339:0,8340:1,8341:0,8342:1,8343:0,8344:1,8345:0,8346:1,8347:0,8348:1,8352:0,8353:0,8379:0,8380:2,8381:0,8382:2,8383:0,8384:2,8385:0,8387:2,8391:0,8395:0,8433:0,8441:0,8455:0,8456:0,8531:2,8682:0,8686:0,8687:0,8692:0,8693:0,8826:0,8903:0,8950:0,8951:0,9039:0,9040:0,9141:0,9149:0,9150:0,9191:0,9221:0,9222:0,9249:0,9250:0,9252:0,9254:0,9265:0,9284:0,9285:0,9300:0,9354:0,9367:0,9373:0,9377:0,9387:0,9391:0,9456:0,9473:0,9498:0,9674:0,9678:0,9680:0,9709:0,9712:0,9713:0,9716:0,9741:0,9748:2,9749:2,9761:0,9766:0,9793:0,9794:0,9869:0,9874:0,9875:0,9880:0,9943:0,9945:0,9947:0,9967:0,9972:0,9977:0,20042:0,20050:1,20499:0,20538:0,20539:0,20790:0,20791:0,21291:0,21292:0,21500:0,21817:0,21818:0,22032:0,22033:0,22091:0,22092:0,22239:0,22240:0,22332:0,22337:0,22338:0,22391:0,22392:0,22639:0,22700:0,22739:0,22770:0,22780:0,22832:0,23090:0,23095:0,23239:0,23240:0,23433:0,23700:0,24047:0,24048:0,24100:3,24200:0,24305:0,24306:0,24382:10,24383:0,24500:0,24547:0,24548:0,24571:9,24600:0,25e3:0,25231:0,25884:0,25932:0,26237:0,26331:0,26332:0,26432:0,26591:0,26592:0,26632:0,26692:0,27120:0,27200:0,27291:6,27292:6,27429:0,27492:0,27493:0,27500:0,27700:0,28232:0,28600:0,28991:0,28992:0,29100:0,29101:0,29220:0,29221:0,29333:0,29635:0,29636:0,29701:0,29738:0,29739:0,29849:0,29850:0,29871:8,29872:7,29873:0,29874:0,30200:5,30339:0,30340:0,30591:0,30592:0,30791:0,30792:0,30800:0,31028:0,31121:0,31154:0,31170:0,31171:0,31370:0,31528:0,31529:0,31600:0,31700:0,31838:0,31839:0,31900:0,31901:0,32061:0,32062:0,32098:0,32099:2,32100:0,32104:0,32161:0,32766:0,53048:0,53049:0,54090:0,54091:0,65061:2,65062:2,65161:0,65163:0,102041:2,102064:11,102068:15,102069:16,102118:2,102119:1,102120:2,102121:2,102217:2,102218:0,102219:2,102220:2,102378:1,102379:1,102380:0,102381:1,102589:2,102599:2,102600:2,102604:2,102647:0,102704:2,102705:2,102706:0,102731:0,102732:0,102759:1,102760:1,102761:2,102762:0,102763:2,102764:0,102765:0,102766:2,102970:1,102974:2,102993:0,102994:0,102995:2,102996:2,103015:0,103016:2,103017:0,103018:2,103025:0,103026:0,103027:2,103028:2,103035:0,103036:0,103037:2,103038:2,103039:0,103040:0,103041:2,103042:2,103043:0,103044:0,103045:2,103046:2,103047:0,103048:0,103049:2,103050:2,103051:0,103052:2,103053:0,103054:2,103055:0,103056:2,103057:0,103058:0,103059:2,103060:2,103061:0,103062:0,103063:2,103064:2,103069:2,103070:0,103071:0,103072:2,103073:2,103086:0,103087:0,103088:2,103089:2,103094:1,103095:0,103096:2,103103:0,103104:2,103105:0,103106:2,103121:0,103122:2,103123:0,103124:0,103125:1,103126:1,103127:0,103128:0,103129:2,103130:2,103131:0,103132:0,103133:2,103134:2,103135:0,103136:0,103137:1,103138:1,103139:0,103140:2,103141:0,103142:2,103143:0,103144:2,103145:0,103146:1,103147:0,103148:0,103149:2,103150:2,103151:0,103152:2,103172:0,103173:2,103174:0,103175:0,103176:2,103177:2,103178:0,103179:0,103180:2,103181:2,103182:0,103183:0,103184:2,103185:2,103228:0,103229:0,103230:2,103231:2,103250:0,103251:2,103252:0,103253:2,103260:0,103261:0,103262:2,103263:2,103270:0,103271:0,103272:2,103273:2,103274:0,103275:0,103276:2,103277:2,103278:0,103279:0,103280:2,103281:2,103282:0,103283:0,103284:2,103285:2,103286:0,103287:2,103288:0,103289:2,103290:0,103291:2,103292:0,103293:0,103294:2,103295:2,103296:0,103297:0,103298:2,103299:2,103376:2,103377:0,103378:0,103379:2,103380:2,103393:0,103394:0,103395:2,103396:2,103472:0,103473:1,103474:0,103475:2,103482:0,103483:2,103484:0,103485:2,103500:0,103501:2,103502:0,103503:0,103504:1,103505:1,103506:0,103507:0,103508:2,103509:2,103510:0,103511:0,103512:2,103513:2,103514:0,103515:2,103516:0,103517:2,103518:0,103519:2,103520:0,103521:1,103522:0,103523:0,103524:2,103525:2,103526:0,103527:2,103561:2,103562:2,103563:0,103564:0,103565:2,103566:2,103567:0,103568:0,103569:2,103570:2,103584:0,103585:2,103586:0,103587:2,103588:1,103589:0,103590:2,103591:1,103592:0,103593:2,103594:1,103695:2};for(g=2e3;g<=2045;g++)$[g]=0;for(g=2056;g<=2065;g++)$[g]=0;for(g=2067;g<=2135;g++)$[g]=0;for(g=2137;g<=2154;g++)$[g]=0;for(g=2161;g<=2170;g++)$[g]=0;for(g=2172;g<=2193;g++)$[g]=0;for(g=2195;g<=2198;g++)$[g]=0;for(g=2200;g<=2203;g++)$[g]=0;for(g=2205;g<=2217;g++)$[g]=0;for(g=2222;g<=2224;g++)$[g]=1;for(g=2225;g<=2250;g++)$[g]=2;for(g=2251;g<=2253;g++)$[g]=1;for(g=2257;g<=2264;g++)$[g]=2;for(g=2274;g<=2279;g++)$[g]=2;for(g=2280;g<=2282;g++)$[g]=1;for(g=2283;g<=2289;g++)$[g]=2;for(g=2290;g<=2292;g++)$[g]=0;for(g=2308;g<=2313;g++)$[g]=0;for(g=2315;g<=2491;g++)$[g]=0;for(g=2494;g<=2866;g++)$[g]=0;for(g=2867;g<=2869;g++)$[g]=1;for(g=2870;g<=2888;g++)$[g]=2;for(g=2891;g<=2895;g++)$[g]=2;for(g=2896;g<=2898;g++)$[g]=1;for(g=2902;g<=2908;g++)$[g]=2;for(g=2915;g<=2920;g++)$[g]=2;for(g=2921;g<=2923;g++)$[g]=1;for(g=2924;g<=2930;g++)$[g]=2;for(g=2931;g<=2962;g++)$[g]=0;for(g=2964;g<=2968;g++)$[g]=2;for(g=2969;g<=2973;g++)$[g]=0;for(g=2975;g<=2991;g++)$[g]=0;for(g=2995;g<=3051;g++)$[g]=0;for(g=3054;g<=3079;g++)$[g]=0;for(g=3081;g<=3088;g++)$[g]=0;for(g=3092;g<=3101;g++)$[g]=0;for(g=3106;g<=3138;g++)$[g]=0;for(g=3146;g<=3151;g++)$[g]=0;for(g=3153;g<=3166;g++)$[g]=0;for(g=3168;g<=3172;g++)$[g]=0;for(g=3174;g<=3203;g++)$[g]=0;for(g=3294;g<=3358;g++)$[g]=0;for(g=3367;g<=3403;g++)$[g]=0;for(g=3408;g<=3416;g++)$[g]=0;for(g=3417;g<=3438;g++)$[g]=2;for(g=3441;g<=3446;g++)$[g]=2;for(g=3447;g<=3450;g++)$[g]=0;for(g=3451;g<=3459;g++)$[g]=2;for(g=3460;g<=3478;g++)$[g]=0;for(g=3554;g<=3559;g++)$[g]=0;for(g=3560;g<=3570;g++)$[g]=2;for(g=3571;g<=3581;g++)$[g]=0;for(g=3594;g<=3597;g++)$[g]=0;for(g=3601;g<=3604;g++)$[g]=0;for(g=3637;g<=3639;g++)$[g]=0;for(g=3665;g<=3667;g++)$[g]=0;for(g=3693;g<=3695;g++)$[g]=0;for(g=3701;g<=3727;g++)$[g]=0;for(g=3728;g<=3739;g++)$[g]=2;for(g=3740;g<=3751;g++)$[g]=0;for(g=3753;g<=3760;g++)$[g]=2;for(g=3761;g<=3773;g++)$[g]=0;for(g=3775;g<=3777;g++)$[g]=0;for(g=3779;g<=3781;g++)$[g]=0;for(g=3783;g<=3785;g++)$[g]=0;for(g=3788;g<=3791;g++)$[g]=0;for(g=3797;g<=3802;g++)$[g]=0;for(g=3814;g<=3816;g++)$[g]=0;for(g=3825;g<=3829;g++)$[g]=0;for(g=3832;g<=3841;g++)$[g]=0;for(g=3844;g<=3852;g++)$[g]=0;for(g=3873;g<=3885;g++)$[g]=0;for(g=3890;g<=3893;g++)$[g]=0;for(g=3907;g<=3912;g++)$[g]=0;for(g=3942;g<=3950;g++)$[g]=0;for(g=3968;g<=3970;g++)$[g]=0;for(g=3973;g<=3976;g++)$[g]=0;for(g=3986;g<=3989;g++)$[g]=0;for(g=3994;g<=3997;g++)$[g]=0;for(g=4048;g<=4051;g++)$[g]=0;for(g=4056;g<=4063;g++)$[g]=0;for(g=4093;g<=4096;g++)$[g]=0;for(g=4390;g<=4398;g++)$[g]=0;for(g=4399;g<=4413;g++)$[g]=2;for(g=4418;g<=4433;g++)$[g]=2;for(g=4455;g<=4457;g++)$[g]=2;for(g=4484;g<=4489;g++)$[g]=0;for(g=4491;g<=4554;g++)$[g]=0;for(g=4568;g<=4589;g++)$[g]=0;for(g=4652;g<=4656;g++)$[g]=0;for(g=4766;g<=4800;g++)$[g]=0;for(g=5014;g<=5016;g++)$[g]=0;for(g=5069;g<=5072;g++)$[g]=0;for(g=5105;g<=5130;g++)$[g]=0;for(g=5173;g<=5188;g++)$[g]=0;for(g=5253;g<=5259;g++)$[g]=0;for(g=5269;g<=5275;g++)$[g]=0;for(g=5292;g<=5311;g++)$[g]=0;for(g=5329;g<=5331;g++)$[g]=0;for(g=5343;g<=5349;g++)$[g]=0;for(g=5355;g<=5357;g++)$[g]=0;for(g=5387;g<=5389;g++)$[g]=0;for(g=5459;g<=5463;g++)$[g]=0;for(g=5479;g<=5482;g++)$[g]=0;for(g=5518;g<=5520;g++)$[g]=0;for(g=5530;g<=5539;g++)$[g]=0;for(g=5550;g<=5552;g++)$[g]=0;for(g=5562;g<=5583;g++)$[g]=0;for(g=5623;g<=5625;g++)$[g]=2;for(g=5631;g<=5639;g++)$[g]=0;for(g=5649;g<=5653;g++)$[g]=0;for(g=5663;g<=5680;g++)$[g]=0;for(g=5682;g<=5685;g++)$[g]=0;for(g=5875;g<=5877;g++)$[g]=0;for(g=5896;g<=5899;g++)$[g]=0;for(g=5921;g<=5940;g++)$[g]=0;for(g=6050;g<=6125;g++)$[g]=0;for(g=6244;g<=6275;g++)$[g]=0;for(g=6328;g<=6348;g++)$[g]=0;for(g=6350;g<=6356;g++)$[g]=0;for(g=6366;g<=6372;g++)$[g]=0;for(g=6381;g<=6387;g++)$[g]=0;for(g=6393;g<=6404;g++)$[g]=0;for(g=6480;g<=6483;g++)$[g]=0;for(g=6511;g<=6514;g++)$[g]=0;for(g=6579;g<=6581;g++)$[g]=0;for(g=6619;g<=6624;g++)$[g]=0;for(g=6625;g<=6627;g++)$[g]=2;for(g=6628;g<=6632;g++)$[g]=0;for(g=6634;g<=6637;g++)$[g]=0;for(g=6669;g<=6692;g++)$[g]=0;for(g=6707;g<=6709;g++)$[g]=0;for(g=6720;g<=6723;g++)$[g]=0;for(g=6732;g<=6738;g++)$[g]=0;for(g=6931;g<=6933;g++)$[g]=0;for(g=6956;g<=6959;g++)$[g]=0;for(g=7005;g<=7007;g++)$[g]=0;for(g=7057;g<=7070;g++)$[g]=2;for(g=7074;g<=7082;g++)$[g]=0;for(g=7109;g<=7118;g++)$[g]=0;for(g=7119;g<=7127;g++)$[g]=1;for(g=7374;g<=7376;g++)$[g]=0;for(g=7528;g<=7586;g++)$[g]=0;for(g=7587;g<=7645;g++)$[g]=2;for(g=7692;g<=7696;g++)$[g]=0;for(g=7755;g<=7787;g++)$[g]=0;for(g=7791;g<=7795;g++)$[g]=0;for(g=7799;g<=7801;g++)$[g]=0;for(g=7803;g<=7805;g++)$[g]=0;for(g=7825;g<=7831;g++)$[g]=0;for(g=7845;g<=7859;g++)$[g]=0;for(g=8013;g<=8032;g++)$[g]=0;for(g=8065;g<=8068;g++)$[g]=1;for(g=8518;g<=8529;g++)$[g]=2;for(g=8533;g<=8536;g++)$[g]=2;for(g=8538;g<=8540;g++)$[g]=2;for(g=8677;g<=8679;g++)$[g]=0;for(g=8836;g<=8840;g++)$[g]=0;for(g=8857;g<=8859;g++)$[g]=0;for(g=8908;g<=8910;g++)$[g]=0;for(g=9154;g<=9159;g++)$[g]=0;for(g=9205;g<=9218;g++)$[g]=0;for(g=9271;g<=9273;g++)$[g]=0;for(g=9295;g<=9297;g++)$[g]=0;for(g=9356;g<=9360;g++)$[g]=0;for(g=9404;g<=9407;g++)$[g]=0;for(g=9476;g<=9482;g++)$[g]=0;for(g=9487;g<=9494;g++)$[g]=0;for(g=9697;g<=9699;g++)$[g]=0;for(g=9821;g<=9865;g++)$[g]=0;for(g=20002;g<=20032;g++)$[g]=0;for(g=20047;g<=20049;g++)$[g]=0;for(g=20062;g<=20092;g++)$[g]=0;for(g=20135;g<=20138;g++)$[g]=0;for(g=20248;g<=20258;g++)$[g]=0;for(g=20348;g<=20358;g++)$[g]=0;for(g=20436;g<=20440;g++)$[g]=0;for(g=20822;g<=20824;g++)$[g]=0;for(g=20904;g<=20932;g++)$[g]=0;for(g=20934;g<=20936;g++)$[g]=0;for(g=21004;g<=21032;g++)$[g]=0;for(g=21035;g<=21037;g++)$[g]=0;for(g=21095;g<=21097;g++)$[g]=0;for(g=21148;g<=21150;g++)$[g]=0;for(g=21207;g<=21264;g++)$[g]=0;for(g=21307;g<=21364;g++)$[g]=0;for(g=21413;g<=21423;g++)$[g]=0;for(g=21453;g<=21463;g++)$[g]=0;for(g=21473;g<=21483;g++)$[g]=0;for(g=21780;g<=21782;g++)$[g]=0;for(g=21891;g<=21894;g++)$[g]=0;for(g=21896;g<=21899;g++)$[g]=0;for(g=22171;g<=22177;g++)$[g]=0;for(g=22181;g<=22187;g++)$[g]=0;for(g=22191;g<=22197;g++)$[g]=0;for(g=22207;g<=22222;g++)$[g]=0;for(g=22234;g<=22236;g++)$[g]=0;for(g=22243;g<=22250;g++)$[g]=0;for(g=22262;g<=22265;g++)$[g]=0;for(g=22307;g<=22322;g++)$[g]=0;for(g=22348;g<=22357;g++)$[g]=0;for(g=22407;g<=22422;g++)$[g]=0;for(g=22462;g<=22465;g++)$[g]=0;for(g=22521;g<=22525;g++)$[g]=0;for(g=22607;g<=22622;g++)$[g]=0;for(g=22641;g<=22646;g++)$[g]=0;for(g=22648;g<=22657;g++)$[g]=0;for(g=22707;g<=22722;g++)$[g]=0;for(g=22762;g<=22765;g++)$[g]=0;for(g=22991;g<=22994;g++)$[g]=0;for(g=23028;g<=23038;g++)$[g]=0;for(g=23830;g<=23853;g++)$[g]=0;for(g=23866;g<=23872;g++)$[g]=0;for(g=23877;g<=23884;g++)$[g]=0;for(g=23886;g<=23894;g++)$[g]=0;for(g=23946;g<=23948;g++)$[g]=0;for(g=24311;g<=24313;g++)$[g]=0;for(g=24342;g<=24347;g++)$[g]=0;for(g=24370;g<=24374;g++)$[g]=10;for(g=24375;g<=24381;g++)$[g]=0;for(g=24718;g<=24721;g++)$[g]=0;for(g=24817;g<=24821;g++)$[g]=0;for(g=24877;g<=24882;g++)$[g]=0;for(g=24891;g<=24893;g++)$[g]=0;for(g=25391;g<=25395;g++)$[g]=0;for(g=25828;g<=25838;g++)$[g]=0;for(g=26191;g<=26195;g++)$[g]=0;for(g=26391;g<=26393;g++)$[g]=0;for(g=26701;g<=26722;g++)$[g]=0;for(g=26729;g<=26799;g++)$[g]=2;for(g=26801;g<=26803;g++)$[g]=2;for(g=26811;g<=26813;g++)$[g]=2;for(g=26847;g<=26870;g++)$[g]=2;for(g=26891;g<=26899;g++)$[g]=0;for(g=26901;g<=26923;g++)$[g]=0;for(g=26929;g<=26946;g++)$[g]=0;for(g=26948;g<=26998;g++)$[g]=0;for(g=27037;g<=27040;g++)$[g]=0;for(g=27205;g<=27232;g++)$[g]=0;for(g=27258;g<=27260;g++)$[g]=0;for(g=27391;g<=27398;g++)$[g]=0;for(g=27561;g<=27564;g++)$[g]=0;for(g=27571;g<=27574;g++)$[g]=0;for(g=27581;g<=27584;g++)$[g]=0;for(g=27591;g<=27594;g++)$[g]=0;for(g=28191;g<=28193;g++)$[g]=0;for(g=28348;g<=28358;g++)$[g]=0;for(g=28402;g<=28432;g++)$[g]=0;for(g=28462;g<=28492;g++)$[g]=0;for(g=29118;g<=29122;g++)$[g]=0;for(g=29168;g<=29172;g++)$[g]=0;for(g=29177;g<=29185;g++)$[g]=0;for(g=29187;g<=29195;g++)$[g]=0;for(g=29900;g<=29903;g++)$[g]=0;for(g=30161;g<=30179;g++)$[g]=0;for(g=30491;g<=30494;g++)$[g]=0;for(g=30729;g<=30732;g++)$[g]=0;for(g=31251;g<=31259;g++)$[g]=0;for(g=31265;g<=31268;g++)$[g]=0;for(g=31275;g<=31279;g++)$[g]=0;for(g=31281;g<=31297;g++)$[g]=0;for(g=31461;g<=31469;g++)$[g]=0;for(g=31491;g<=31495;g++)$[g]=0;for(g=31917;g<=31922;g++)$[g]=0;for(g=31965;g<=32e3;g++)$[g]=0;for(g=32001;g<=32003;g++)$[g]=2;for(g=32005;g<=32031;g++)$[g]=2;for(g=32033;g<=32060;g++)$[g]=2;for(g=32064;g<=32067;g++)$[g]=2;for(g=32074;g<=32077;g++)$[g]=2;for(g=32081;g<=32086;g++)$[g]=0;for(g=32107;g<=32130;g++)$[g]=0;for(g=32133;g<=32159;g++)$[g]=0;for(g=32164;g<=32167;g++)$[g]=2;for(g=32180;g<=32199;g++)$[g]=0;for(g=32201;g<=32260;g++)$[g]=0;for(g=32301;g<=32360;g++)$[g]=0;for(g=32601;g<=32662;g++)$[g]=0;for(g=32664;g<=32667;g++)$[g]=2;for(g=32701;g<=32761;g++)$[g]=0;for(g=53001;g<=53004;g++)$[g]=0;for(g=53008;g<=53019;g++)$[g]=0;for(g=53021;g<=53032;g++)$[g]=0;for(g=53034;g<=53037;g++)$[g]=0;for(g=53042;g<=53046;g++)$[g]=0;for(g=53074;g<=53080;g++)$[g]=0;for(g=54001;g<=54004;g++)$[g]=0;for(g=54008;g<=54019;g++)$[g]=0;for(g=54021;g<=54032;g++)$[g]=0;for(g=54034;g<=54037;g++)$[g]=0;for(g=54042;g<=54046;g++)$[g]=0;for(g=54048;g<=54053;g++)$[g]=0;for(g=54074;g<=54080;g++)$[g]=0;for(g=54098;g<=54101;g++)$[g]=0;for(g=102001;g<=102040;g++)$[g]=0;for(g=102042;g<=102063;g++)$[g]=0;for(g=102065;g<=102067;g++)$[g]=0;for(g=102070;g<=102117;g++)$[g]=0;for(g=102122;g<=102216;g++)$[g]=0;for(g=102221;g<=102377;g++)$[g]=0;for(g=102382;g<=102388;g++)$[g]=0;for(g=102389;g<=102398;g++)$[g]=2;for(g=102399;g<=102444;g++)$[g]=0;for(g=102445;g<=102447;g++)$[g]=2;for(g=102448;g<=102458;g++)$[g]=0;for(g=102459;g<=102468;g++)$[g]=2;for(g=102469;g<=102499;g++)$[g]=0;for(g=102500;g<=102519;g++)$[g]=1;for(g=102520;g<=102524;g++)$[g]=0;for(g=102525;g<=102529;g++)$[g]=2;for(g=102530;g<=102588;g++)$[g]=0;for(g=102590;g<=102598;g++)$[g]=0;for(g=102601;g<=102603;g++)$[g]=0;for(g=102605;g<=102628;g++)$[g]=0;for(g=102629;g<=102646;g++)$[g]=2;for(g=102648;g<=102700;g++)$[g]=2;for(g=102701;g<=102703;g++)$[g]=0;for(g=102707;g<=102730;g++)$[g]=2;for(g=102733;g<=102758;g++)$[g]=2;for(g=102767;g<=102900;g++)$[g]=0;for(g=102901;g<=102933;g++)$[g]=2;for(g=102934;g<=102950;g++)$[g]=13;for(g=102951;g<=102955;g++)$[g]=0;for(g=102961;g<=102963;g++)$[g]=0;for(g=102965;g<=102969;g++)$[g]=0;for(g=102971;g<=102973;g++)$[g]=0;for(g=102975;g<=102989;g++)$[g]=0;for(g=102990;g<=102992;g++)$[g]=1;for(g=102997;g<=103002;g++)$[g]=0;for(g=103003;g<=103008;g++)$[g]=2;for(g=103009;g<=103011;g++)$[g]=0;for(g=103012;g<=103014;g++)$[g]=2;for(g=103019;g<=103021;g++)$[g]=0;for(g=103022;g<=103024;g++)$[g]=2;for(g=103029;g<=103031;g++)$[g]=0;for(g=103032;g<=103034;g++)$[g]=2;for(g=103065;g<=103068;g++)$[g]=0;for(g=103074;g<=103076;g++)$[g]=0;for(g=103077;g<=103079;g++)$[g]=1;for(g=103080;g<=103082;g++)$[g]=0;for(g=103083;g<=103085;g++)$[g]=2;for(g=103090;g<=103093;g++)$[g]=0;for(g=103097;g<=103099;g++)$[g]=0;for(g=103100;g<=103102;g++)$[g]=2;for(g=103107;g<=103109;g++)$[g]=0;for(g=103110;g<=103112;g++)$[g]=2;for(g=103113;g<=103116;g++)$[g]=0;for(g=103117;g<=103120;g++)$[g]=2;for(g=103153;g<=103157;g++)$[g]=0;for(g=103158;g<=103162;g++)$[g]=2;for(g=103163;g<=103165;g++)$[g]=0;for(g=103166;g<=103168;g++)$[g]=1;for(g=103169;g<=103171;g++)$[g]=2;for(g=103186;g<=103188;g++)$[g]=0;for(g=103189;g<=103191;g++)$[g]=2;for(g=103192;g<=103195;g++)$[g]=0;for(g=103196;g<=103199;g++)$[g]=2;for(g=103200;g<=103224;g++)$[g]=0;for(g=103225;g<=103227;g++)$[g]=1;for(g=103232;g<=103237;g++)$[g]=0;for(g=103238;g<=103243;g++)$[g]=2;for(g=103244;g<=103246;g++)$[g]=0;for(g=103247;g<=103249;g++)$[g]=2;for(g=103254;g<=103256;g++)$[g]=0;for(g=103257;g<=103259;g++)$[g]=2;for(g=103264;g<=103266;g++)$[g]=0;for(g=103267;g<=103269;g++)$[g]=2;for(g=103300;g<=103375;g++)$[g]=0;for(g=103381;g<=103383;g++)$[g]=0;for(g=103384;g<=103386;g++)$[g]=1;for(g=103387;g<=103389;g++)$[g]=0;for(g=103390;g<=103392;g++)$[g]=2;for(g=103397;g<=103399;g++)$[g]=0;for(g=103400;g<=103471;g++)$[g]=2;for(g=103476;g<=103478;g++)$[g]=0;for(g=103479;g<=103481;g++)$[g]=2;for(g=103486;g<=103488;g++)$[g]=0;for(g=103489;g<=103491;g++)$[g]=2;for(g=103492;g<=103495;g++)$[g]=0;for(g=103496;g<=103499;g++)$[g]=2;for(g=103528;g<=103543;g++)$[g]=0;for(g=103544;g<=103548;g++)$[g]=2;for(g=103549;g<=103551;g++)$[g]=0;for(g=103552;g<=103554;g++)$[g]=1;for(g=103555;g<=103557;g++)$[g]=2;for(g=103558;g<=103560;g++)$[g]=0;for(g=103571;g<=103573;g++)$[g]=0;for(g=103574;g<=103576;g++)$[g]=2;for(g=103577;g<=103580;g++)$[g]=0;for(g=103581;g<=103583;g++)$[g]=2;for(g=103595;g<=103694;g++)$[g]=0;for(g=103696;g<=103699;g++)$[g]=0;for(g=103700;g<=103793;g++)$[g]=2;for(g=103794;g<=103890;g++)$[g]=0;for(g=103891;g<=103896;g++)$[g]=2;for(g=103900;g<=103971;g++)$[g]=2;for(g=103972;g<=103977;g++)$[g]=0;for(g=112e3;g<=112101;g++)$[g]=0;const J4e={102113:!0,102100:!0,3857:!0,3785:!0},K4e={4326:!0,3785:!0,3857:!0,102113:!0,102100:!0,104905:!0,104971:!0},Nte='PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]',LM=[-20037508342788905e-9,20037508342788905e-9],DM=[-20037508342787e-6,20037508342787e-6],x0e={102113:{wkTemplate:'PROJCS["WGS_1984_Web_Mercator",GEOGCS["GCS_WGS_1984_Major_Auxiliary_Sphere",DATUM["D_WGS_1984_Major_Auxiliary_Sphere",SPHEROID["WGS_1984_Major_Auxiliary_Sphere",6378137.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],UNIT["Meter",1.0]]',valid:LM,origin:DM,dx:1e-5},102100:{wkTemplate:Nte,valid:LM,origin:DM,dx:1e-5},3785:{wkTemplate:'PROJCS["WGS_1984_Web_Mercator",GEOGCS["GCS_WGS_1984_Major_Auxiliary_Sphere",DATUM["D_WGS_1984_Major_Auxiliary_Sphere",SPHEROID["WGS_1984_Major_Auxiliary_Sphere",6378137.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],UNIT["Meter",1.0]]',valid:LM,origin:DM,dx:1e-5},3857:{wkTemplate:Nte,valid:LM,origin:DM,dx:1e-5},4326:{wkTemplate:'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",{Central_Meridian}],UNIT["Degree",0.0174532925199433]]',altTemplate:'PROJCS["WGS_1984_Plate_Carree",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Plate_Carree"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],UNIT["Degrees",111319.491]]',valid:[-180,180],origin:[-180,90],dx:1e-5},104971:{wkTemplate:'GEOGCS["Mars_2000_(Sphere)",DATUM["Mars_2000_(Sphere)",SPHEROID["Mars_2000_(Sphere)",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]',valid:[-180,180],origin:[-180,90],dx:1e-5},104905:{wkTemplate:'GEOGCS["GCS_Mars_2000",DATUM["D_Mars_2000",SPHEROID["Mars_2000_IAU_IAG",3396190.0,169.8944472236118]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]',valid:[-180,180],origin:[-180,90],dx:1e-5}};function Js(t,e){return t===e||t!=null&&e!=null&&(t.wkid!=null||e.wkid!=null?t.wkid===e.wkid||Yb(t)&&Yb(e)||e.latestWkid!=null&&t.wkid===e.latestWkid||t.latestWkid!=null&&e.wkid===t.latestWkid:!(!t.wkt||!e.wkt)&&t.wkt.toUpperCase()===e.wkt.toUpperCase())}function Sb(t){return ua(t)&&t.wkid&&x0e[t.wkid]||null}function T0e(t){return!!ua(t)&&(t.wkid?$[t.wkid]==null:!!t.wkt&&!!/^\s*GEOGCS/i.test(t.wkt))}function eR(t){return!(nm(t)||sm(t))}function tR(t){return ua(t)&&t.wkid===4326}function S0e(t){return ua(t)&&t.wkid===fh.CGCS2000}function Yb(t){return ua(t)&&t.wkid!=null&&J4e[t.wkid]===!0}function HX(t){return ua(t)&&t.wkid===32662}function WX(t){return t===fh.GCSMARS2000||t===fh.GCSMARS2000_SPHERE}function nm(t){return ua(t)&&t.wkid!=null&&WX(t.wkid)}function qX(t){return t===fh.GCSMOON2000}function sm(t){return ua(t)&&t.wkid!=null&&qX(t.wkid)}function e5e(t){return ua(t)&&t.wkid!=null&&K4e[t.wkid]===!0}function ua(t){return t!=null&&(t.wkid!=null&&t.wkid>=2e3||t.wkt!=null)}const t5e={wkid:4326,wkt:YF(x0e[4326].wkTemplate,{Central_Meridian:"0.0"})},r5e={wkid:102100,latestWkid:3857},i5e={wkid:32662};function XX(t){return{wkt:`GEOCCS["Spherical geocentric", + DATUM["Not specified", + SPHEROID["Sphere",${t.radius},0]], + PRIMEM["Greenwich",0.0, + AUTHORITY["EPSG","8901"]], + UNIT["m",1.0], + AXIS["Geocentric X",OTHER], + AXIS["Geocentric Y",EAST], + AXIS["Geocentric Z",NORTH] + ]`}}const E0e=XX(Kt),YX=XX(If),ZX=XX(Fg),C0e={wkt:`GEOCCS["WGS 84", + DATUM["WGS_1984", + SPHEROID["WGS 84",${Kt.radius},298.257223563, + AUTHORITY["EPSG","7030"]], + AUTHORITY["EPSG","6326"]], + PRIMEM["Greenwich",0, + AUTHORITY["EPSG","8901"]], + UNIT["m",1.0, + AUTHORITY["EPSG","9001"]], + AXIS["Geocentric X",OTHER], + AXIS["Geocentric Y",OTHER], + AXIS["Geocentric Z",NORTH], + AUTHORITY["EPSG","4978"] +]`};function Mr(t){return t!=null&&(nm(t)||Js(t,YX))?If:t!=null&&(sm(t)||Js(t,ZX))?Fg:Kt}function UCt(t){return WX(t)?If:qX(t)?Fg:Kt}const QX=39.37,n5e=Kt.radius*Math.PI/200,A0e=/UNIT\[([^\]]+)\]\]$/i,Eb=$,O0e=/UNIT\[([^\]]+)\]/i,s5e=new Set([4261,4305,4807,4810,4811,4812,4816,4819,4821,4901,4902,37225,104139,104140]),o5e=Oc()({meter:"meters",foot:"feet",foot_us:"us-feet",foot_clarke:"clarke-feet",yard_clarke:"clarke-yards",link_clarke:"clarke-links",yard_sears:"sears-yards",foot_sears:"sears-feet",chain_sears:"sears-chains",chain_benoit_1895_b:"benoit-1895-b-chains",yard_indian:"indian-yards",yard_indian_1937:"indian-1937-yards",foot_gold_coast:"gold-coast-feet",chain_sears_1922_truncated:"sears-1922-truncated-chains","50_kilometers":"50-kilometers","150_kilometers":"150-kilometers"}),Ep=t=>t*t,b0=t=>t*t*t,rR={length:{baseUnit:"meters",units:{millimeters:{inBaseUnits:.001},centimeters:{inBaseUnits:.01},decimeters:{inBaseUnits:.1},meters:{inBaseUnits:1},kilometers:{inBaseUnits:1e3},inches:{inBaseUnits:.0254},feet:{inBaseUnits:.3048},yards:{inBaseUnits:.9144},miles:{inBaseUnits:1609.344},"nautical-miles":{inBaseUnits:1852},"us-feet":{inBaseUnits:1200/3937}}},area:{baseUnit:"square-meters",units:{"square-millimeters":{inBaseUnits:Ep(.001)},"square-centimeters":{inBaseUnits:Ep(.01)},"square-decimeters":{inBaseUnits:Ep(.1)},"square-meters":{inBaseUnits:1},"square-kilometers":{inBaseUnits:Ep(1e3)},"square-inches":{inBaseUnits:Ep(.0254)},"square-feet":{inBaseUnits:Ep(.3048)},"square-yards":{inBaseUnits:Ep(.9144)},"square-miles":{inBaseUnits:Ep(1609.344)},"square-us-feet":{inBaseUnits:Ep(1200/3937)},acres:{inBaseUnits:.0015625*Ep(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:"liters",units:{liters:{inBaseUnits:1},"cubic-millimeters":{inBaseUnits:1e3*b0(.001)},"cubic-centimeters":{inBaseUnits:1e3*b0(.01)},"cubic-decimeters":{inBaseUnits:1e3*b0(.1)},"cubic-meters":{inBaseUnits:1e3},"cubic-kilometers":{inBaseUnits:1e3*b0(1e3)},"cubic-inches":{inBaseUnits:1e3*b0(.0254)},"cubic-feet":{inBaseUnits:1e3*b0(.3048)},"cubic-yards":{inBaseUnits:1e3*b0(.9144)},"cubic-miles":{inBaseUnits:1e3*b0(1609.344)}}},angle:{baseUnit:"radians",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},a5e=(()=>{const t={};for(const e in rR)for(const r in rR[e].units)t[r]=e;return t})();function l5e(t,e,r){return t*rR[r].units[e].inBaseUnits}function c5e(t,e,r){return t/rR[r].units[e].inBaseUnits}const u5e=["metric","imperial","inches","feet","yards","miles","nautical-miles","us-feet","meters","kilometers"];function NV(t){const e=a5e[t];if(!e)throw new Error("unknown type");return e}function Fte(t,e=null){return e=e||NV(t),rR[e].baseUnit===t}function fo(t,e,r){if(e===r)return t;const i=NV(e);if(i!==NV(r))throw new Error("incompatible units");const n=Fte(e,i)?t:l5e(t,e,i);return Fte(r,i)?n:c5e(n,r,i)}function kCt(t,e,r){switch(r){case"metric":return h5e(t,e);case"imperial":return p5e(t,e);default:return r}}function zCt(t,e,r){switch(r){case"metric":return d5e(t,e);case"imperial":return f5e(t,e);default:return r}}function h5e(t,e){const r=fo(t,e,"meters");return Math.abs(r)<3e3?"meters":"kilometers"}function d5e(t,e){const r=fo(t,e,"meters");return Math.abs(r)<1e5?"meters":"kilometers"}function p5e(t,e){const r=fo(t,e,"feet");return Math.abs(r)<1e3?"feet":"miles"}function f5e(t,e){const r=fo(t,e,"feet");return Math.abs(r)<1e5?"feet":"miles"}function BCt(t,e){const r=fo(t,e,"square-meters");return Math.abs(r)<3e6?"square-meters":"square-kilometers"}function VCt(t,e){const r=fo(t,e,"square-feet");return Math.abs(r)<1e6?"square-feet":"square-miles"}function m5e(t,e,r){return fo(t,e,"meters")/(r*Math.PI/180)}function R0e(t){return o5e.fromJSON(t.toLowerCase())||null}function FV(t){if(t!=null&&!eR(t))return 1;const e=el(t);return e>1e5?1:e}function g5e(t){return el(t)>=Mr(t).metersPerDegree?"meters":a6(t)}function el(t,e=Kt.metersPerDegree){return y5e(t,!0)??e}function y5e(t,e=!1){const r=t!=null?t.wkid:null,i=t!=null?t.wkt:null;let n=null;if(r){if(WX(r))return If.metersPerDegree;if(qX(r))return Fg.metersPerDegree;n=Eb.values[Eb[r]],!n&&e&&s5e.has(r)&&(n=n5e)}else i&&($0e(i)?n=Ute(A0e.exec(i),n):M0e(i)&&(n=Ute(O0e.exec(i),n)));return n}function UV(t){return t.isGeographic?1:el(t)}function Ute(t,e){return t&&t[1]?P0e(t[1]):e}function P0e(t){return parseFloat(t.split(",")[1])}function a6(t){const e=t!=null?t.wkid:null,r=t!=null?t.wkt:null;let i=null;if(e)i=Eb.units[Eb[e]];else if(r){const n=$0e(r)?A0e:M0e(r)?O0e:null;if(n){const s=n.exec(r);s&&s[1]&&(i=v5e(s[1]))}}return i!=null?R0e(i):null}function GCt(t){const e=a6(t);return e!=null&&u5e.includes(e)?e:null}function M0e(t){return/^GEOCCS/i.test(t)}function $0e(t){return/^PROJCS/i.test(t)}const _5e=1e-7;function v5e(t){const e=/[\\"\\']{1}([^\\"\\']+)/.exec(t);let r=e&&e[1];if(!r||!Eb.units.includes(r)){const i=P0e(t);r=null;const n=Eb.values;for(let s=0;sPromise.resolve().then(()=>B5e),void 0),i=t.options,n=i.responseType;i.signal=e==null?void 0:e.signal,i.responseType=n==="native"||n==="native-request-init"?"native-request-init":n&&["blob","json","text"].includes(n)&&((a=m0e(t.url))!=null&&a.after)?n:"array-buffer";const s=await r(t.url,i),o={data:s.data,httpStatus:s.httpStatus,ssl:s.ssl};switch((l=s.requestOptions)==null?void 0:l.responseType){case"native-request-init":return delete o.data.signal,o;case"blob":o.data=await o.data.arrayBuffer();break;case"json":o.data=new TextEncoder().encode(JSON.stringify(o.data)).buffer;break;case"text":o.data=new TextEncoder().encode(o.data).buffer}return{result:o,transferList:[o.data]}}};let sn;function XCt(t){sn=t}function YCt(t){const e=sn==null?void 0:sn.findCredential(t);return e!=null&&e.token?b0e(t,"token",e.token):t}se("host-webworker");const E5e=["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"];function D0e(t){const e=Kd(t,!0);return!!e&&e.endsWith(".arcgis.com")&&!E5e.includes(e)&&!t.endsWith("/sharing/rest/generateToken")}function N0e(t,e,r=!1,i){return new Promise((n,s)=>{if(ss(i))return void s(kte());let o=()=>{c(),s(new Error(`Unable to load ${e}`))},a=()=>{const u=t;c(),n(u)},l=()=>{if(!t)return;const u=t;c(),u.src="",s(kte())};const c=()=>{se("esri-image-decode")||(t.removeEventListener("error",o),t.removeEventListener("load",a)),o=null,a=null,t=null,i!=null&&i.removeEventListener("abort",l),l=null,r&&URL.revokeObjectURL(e)};i!=null&&i.addEventListener("abort",l),se("esri-image-decode")?t.decode().then(a,o):(t.addEventListener("error",o),t.addEventListener("load",a))})}function kte(){try{return new DOMException("Aborted","AbortError")}catch{const t=new Error;return t.name="AbortError",t}}const F0e="Timeout exceeded";function C5e(){return new Error(F0e)}function ZCt(t){return typeof t=="object"&&!!t&&"message"in t&&t.message===F0e}function A5e(t){Jr.request.crossOriginNoCorsDomains||(Jr.request.crossOriginNoCorsDomains={});const e=Jr.request.crossOriginNoCorsDomains;for(let r of t)r=r.toLowerCase(),/^https?:\/\//.test(r)?e[Kd(r)??""]=0:(e[Kd("http://"+r)??""]=0,e[Kd("https://"+r)??""]=0)}function O5e(t){const e=Jr.request.crossOriginNoCorsDomains;if(e){let r=Kd(t);if(r)return r=r.toLowerCase(),!gS(r,FX())&&e[r]o.abort());const a={controller:o,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:s,params:n,redoRequest:!1,useIdentity:Id.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},l=await k5e(a);return(c=s==null?void 0:s.after)==null||c.call(s,l),l}let f4;const Id=Jr.request,U0e="FormData"in globalThis,P5e=[499,498,403,401],M5e=["COM_0056","COM_0057","SB_0008"],$5e=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],KX=()=>null,m4=Symbol();function I5e(t){const e=Kd(t);e&&!kn._corsServers.includes(e)&&kn._corsServers.push(e)}function zte(t){const e=Kd(t);return!e||e.endsWith(".arcgis.com")||kn._corsServers.includes(e)||zX(e)}function Lf(t,e,r,i){let n="Error";const s={url:r.url,requestOptions:r.requestOptions,getHeader:KX,ssl:!1};if(e instanceof Y)return e.details?(e.details=ye(e.details),e.details.url=r.url,e.details.requestOptions=r.requestOptions):e.details=s,e;if(e){const o=i&&(c=>i.headers.get(c)),a=i==null?void 0:i.status,l=e.message;l&&(n=l),o&&(s.getHeader=o),s.httpStatus=(e.httpCode!=null?e.httpCode:e.code)||a||0,s.subCode=e.subcode,s.messageCode=e.messageCode,typeof e.details=="string"?s.messages=[e.details]:s.messages=e.details,s.raw=m4 in e?e[m4]:e}return Zn(e)?wr():new Y(t,n,s)}async function L5e(){se("host-webworker")?f4||(f4=await ce(()=>import("./request-14491776.js"),[])):kn._abortableFetch||(kn._abortableFetch=globalThis.fetch.bind(globalThis))}async function kV(){sn||await ce(()=>import("./IdentityManager-47bd1e1a.js"),["assets/IdentityManager-47bd1e1a.js","assets/widget-78e8b6fe.js"])}async function D5e(t){var a;const e=t.params.url,r=t.params.requestOptions,i=t.controller.signal,n=r.body;let s=null,o=null;if(U0e&&"HTMLFormElement"in globalThis&&(n instanceof FormData?s=n:n instanceof HTMLFormElement&&(s=new FormData(n))),typeof n=="string"&&(o=n),t.fetchOptions={cache:r.cacheBust&&!("polyfill"in kn._abortableFetch)?"no-cache":"default",credentials:"same-origin",headers:r.headers||{},method:r.method==="head"?"HEAD":"GET",mode:"cors",priority:Id.priority,redirect:"follow",signal:i},(s||o)&&(t.fetchOptions.body=s||o),r.authMode==="anonymous"&&(t.useIdentity=!1),t.hasToken=!!(/token=/i.test(e)||(a=r.query)!=null&&a.token||s!=null&&s.get("token")),!t.hasToken&&Jr.apiKey&&D0e(e)&&(r.query||(r.query={}),r.query.token=Jr.apiKey,t.hasToken=!0),t.useIdentity&&!t.hasToken&&!t.credentialToken&&!k0e(e)&&!ss(i)){let l;r.authMode==="immediate"?(await kV(),l=await sn.getCredential(e,{signal:i}),t.credential=l):r.authMode==="no-prompt"?(await kV(),l=await sn.getCredential(e,{prompt:!1,signal:i}).catch(()=>{}),t.credential=l):sn&&(l=sn.findCredential(e)),l&&(t.credentialToken=l.token,t.useSSL=!!l.ssl)}}function k0e(t){return $5e.some(e=>e.test(t))}async function N5e(t){let e=t.params.url;const r=t.params.requestOptions,i=t.fetchOptions??{},n=KO(e)||im(e),s=r.responseType||"json",o=n?0:r.timeout!=null?r.timeout:Id.timeout;let a=!1;if(!n){t.useSSL&&(e=GX(e)),r.cacheBust&&i.cache==="default"&&(e=b0e(e,"request.preventCache",Date.now()));let p={...r.query};t.credentialToken&&(p.token=t.credentialToken);let m=JO(p);se("esri-url-encodes-apostrophe")&&(m=m.replaceAll("'","%27"));const y=e.length+1+m.length;let _;a=r.method==="delete"||r.method==="post"||r.method==="put"||!!r.body||y>Id.maxUrlLength;const v=r.useProxy||!!i6(e);if(v){const b=N4e(e);_=b.path,!a&&_.length+1+y>Id.maxUrlLength&&(a=!0),b.query&&(p={...b.query,...p})}if(i.method==="HEAD"&&(a||v)){if(a)throw y>Id.maxUrlLength?Lf("request:invalid-parameters",new Error("URL exceeds maximum length"),t.params):Lf("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),t.params);if(v)throw Lf("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),t.params)}if(a?(i.method=r.method==="delete"?"DELETE":r.method==="put"?"PUT":"POST",r.body?e=qU(e,p):(i.body=JO(p),i.headers||(i.headers={}),i.headers["Content-Type"]="application/x-www-form-urlencoded")):e=qU(e,p),v&&(t.useProxy=!0,e=`${_}?${e}`),p.token&&U0e&&i.body instanceof FormData&&!S4e(e)&&i.body.set("token",p.token),r.hasOwnProperty("withCredentials"))t.withCredentials=r.withCredentials;else if(!gS(e,FX())){if(zX(e))t.withCredentials=!0;else if(sn){const b=sn.findServerInfo(e);b!=null&&b.webTierAuth&&(t.withCredentials=!0)}}t.withCredentials&&(i.credentials="include",O5e(e)&&await R5e(a?qU(e,p):e))}let l,c,u=0,d=!1;o>0&&(u=setTimeout(()=>{d=!0,t.controller.abort()},o));try{if(r.responseType==="native-request-init")c=i,c.url=e;else if(r.responseType!=="image"||i.cache!=="default"||i.method!=="GET"||a||U5e(r.headers)||!n&&!t.useProxy&&Id.proxyUrl&&!zte(e)){if(l=await kn._abortableFetch(e,i),t.useProxy||I5e(e),r.responseType==="native")c=l;else if(i.method!=="HEAD")if(l.ok){switch(s){case"array-buffer":c=await l.arrayBuffer();break;case"blob":case"image":c=await l.blob();break;default:c=await l.text()}if(u&&(clearTimeout(u),u=0),s==="json"||s==="xml"||s==="document")if(c)switch(s){case"json":c=JSON.parse(c);break;case"xml":c=Bte(c,"application/xml");break;case"document":c=Bte(c,"text/html")}else c=null;if(c){if(s==="array-buffer"||s==="blob"){const p=l.headers.get("Content-Type");if(p&&/application\/json|text\/plain/i.test(p)&&c[s==="blob"?"size":"byteLength"]<=750)try{const m=await new Response(c).json();m.error&&(c=m)}catch{}}s==="image"&&c instanceof Blob&&(c=await Vte(URL.createObjectURL(c),t,!0))}}else{c=await l.text();try{c=JSON.parse(c)}catch{}}}else c=await Vte(e,t)}catch(p){if(p.name==="AbortError")throw d?C5e():wr("Request canceled");if(!(!l&&p instanceof TypeError&&Id.proxyUrl)||r.body||r.method==="delete"||r.method==="head"||r.method==="post"||r.method==="put"||t.useProxy||zte(e))throw p;t.redoRequest=!0,F4e({proxyUrl:Id.proxyUrl,urlPrefix:Kd(e)??""})}finally{u&&clearTimeout(u)}return[l,c]}async function F5e(t,e){if(t.responseData!=null)return t.responseData;if(t.headers&&(e.requestOptions.headers={...e.requestOptions.headers,...t.headers}),t.query&&(e.requestOptions.query={...e.requestOptions.query,...t.query}),t.before){let r,i;try{i=await t.before(e)}catch(n){r=Lf("request:interceptor",n,e)}if((i instanceof Error||i instanceof Y)&&(r=Lf("request:interceptor",i,e)),r)throw t.error&&t.error(r),r;return i}}function U5e(t){if(t){for(const e of Object.getOwnPropertyNames(t))if(t[e])return!0}return!1}function Bte(t,e){let r;try{r=new DOMParser().parseFromString(t,e)}catch{}if(!r||r.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return r}async function k5e(t){var s,o;let e,r;await D5e(t);try{do[e,r]=await N5e(t);while(!await z5e(t,e,r))}catch(a){const l=Lf("request:server",a,t.params,e);throw l.details.ssl=t.useSSL,(s=t.interceptor)!=null&&s.error&&t.interceptor.error(l),l}const i=t.params.url;if(r&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(i)){if(!t.hasToken&&!t.credentialToken&&((o=r.user)!=null&&o.username)&&!zX(i)){const a=Kd(i,!0);a&&Id.trustedServers.push(a)}Array.isArray(r.authorizedCrossOriginNoCorsDomains)&&A5e(r.authorizedCrossOriginNoCorsDomains)}const n=t.credential;if(n&&sn){const a=sn.findServerInfo(n.server);let l=a==null?void 0:a.owningSystemUrl;if(l){l=l.replace(/\/?$/,"/sharing");const c=sn.findCredential(l,n.userId);c&&sn._getIdenticalSvcIdx(l,c)===-1&&c.resources.unshift(l)}}return{data:r,getHeader:e?a=>e==null?void 0:e.headers.get(a):KX,httpStatus:(e==null?void 0:e.status)??200,requestOptions:t.params.requestOptions,ssl:t.useSSL,url:t.params.url}}async function z5e(t,e,r){var c;if(t.redoRequest)return t.redoRequest=!1,!1;const i=t.params.requestOptions;if(!e||i.responseType==="native"||i.responseType==="native-request-init")return!0;let n,s;if(r&&(r.error?n=r.error:r.status==="error"&&Array.isArray(r.messages)&&(n={...r},n[m4]=r,n.details=r.messages)),!n&&!e.ok)throw n=new Error(`Unable to load ${e.url} status: ${e.status}`),n[m4]=r,n;let o,a=null;n&&(s=Number(n.code),a=n.hasOwnProperty("subcode")?Number(n.subcode):null,o=n.messageCode,o=o==null?void 0:o.toUpperCase());const l=i.authMode;if(s===403&&(a===4||(c=n.message)!=null&&c.toLowerCase().includes("ssl")&&!n.message.toLowerCase().includes("permission"))){if(!t.useSSL)return t.useSSL=!0,!1}else if(!t.hasToken&&t.useIdentity&&(l!=="no-prompt"||s===498)&&s!==void 0&&P5e.includes(s)&&!k0e(t.params.url)&&(s!==403||o&&!M5e.includes(o)&&(a==null||a===2&&t.credentialToken))){await kV();try{const u=await sn.getCredential(t.params.url,{error:Lf("request:server",n,t.params),prompt:l!=="no-prompt",signal:t.controller.signal,token:t.credentialToken});return t.credential=u,t.credentialToken=u.token,t.useSSL=t.useSSL||u.ssl,!1}catch(u){if(l==="no-prompt")return t.credential=void 0,t.credentialToken=void 0,!1;n=u}}if(n)throw n;return!0}function Vte(t,e,r=!1){const i=e.controller.signal,n=new Image;return e.withCredentials?n.crossOrigin="use-credentials":n.crossOrigin="anonymous",n.alt="",n.fetchPriority=Id.priority,n.src=t,N0e(n,t,r,i)}kn._abortableFetch=null,kn._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"];const B5e=Object.freeze(Object.defineProperty({__proto__:null,default:kn},Symbol.toStringTag,{value:"Module"}));function lr(t,e,r){let i,n;return e===void 0||Array.isArray(e)?(n=t,r=e,i=[void 0]):(n=e,i=Array.isArray(t)?t:[t]),(s,o)=>{const a=s.constructor.prototype;i.forEach(l=>{const c=Hge(s,l,n);c.read&&typeof c.read=="object"||(c.read={}),c.read.reader=a[o],r&&(c.read.source=(c.read.source||[]).concat(r))})}}let Wp=class extends ke{constructor(...e){super(...e),this.type=null,this.hasM=!1,this.hasZ=!1,this.spatialReference=St.WGS84}get cache(){return this.commitProperty("spatialReference"),{}}get extent(){return null}readSpatialReference(e,r){if(e instanceof St)return e;if(e!=null){const i=new St;return i.read(e,r),i}return e}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}clearCache(){this.notifyChange("cache")}getCacheValue(e){return this.cache[e]}setCacheValue(e,r){this.cache[e]=r}};h([f()],Wp.prototype,"type",void 0),h([f({readOnly:!0})],Wp.prototype,"cache",null),h([f({readOnly:!0})],Wp.prototype,"extent",null),h([f({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],Wp.prototype,"hasM",void 0),h([f({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],Wp.prototype,"hasZ",void 0),h([f({type:St,json:{write:!0},value:St.WGS84})],Wp.prototype,"spatialReference",void 0),h([lr("spatialReference")],Wp.prototype,"readSpatialReference",null),Wp=h([N("esri.geometry.Geometry")],Wp);const Zg=Wp,V5e=Object.prototype.toString;function G5e(t){const e="__accessorMetadata__"in t?Qa(t):t;return function(...r){if(r.push(e),typeof r[2]=="number")throw new Error("Using @cast has parameter decorator is not supported since 4.16");return j5e.apply(this,r)}}function j5e(t,e,r,i){XF(t,e).cast=i}function H5e(t){return(e,r)=>{XF(e,t).cast=e[r]}}function _i(...t){if(t.length!==3||typeof t[1]!="string")return t.length===1&&V5e.call(t[0])==="[object Function]"?G5e(t[0]):t.length===1&&typeof t[0]=="string"?H5e(t[0]):void 0}function W5e(t,e){const r=t.x-e.x,i=t.y-e.y,n=t.hasZ&&e.hasZ?t.z-e.z:0;return Math.sqrt(r*r+i*i+n*n)}const q5e=57.29577951308232,X5e=.017453292519943;function Gte(t){return t*q5e}function jte(t){return t*X5e}function Hte(t){return t/Kt.radius}function g4(t){return Math.PI/2-2*Math.atan(Math.exp(-t/Kt.radius))}function zV(t){return t.wkid!=null||t.wkt!=null}const XU=[0,0];function y4(t,e,r,i,n){const s=t,o=n;if(o.spatialReference=r,"x"in s&&"x"in o)[o.x,o.y]=e(s.x,s.y,XU,i);else if("xmin"in s&&"xmin"in o)[o.xmin,o.ymin]=e(s.xmin,s.ymin,XU,i),[o.xmax,o.ymax]=e(s.xmax,s.ymax,XU,i);else if("paths"in s&&"paths"in o||"rings"in s&&"rings"in o){const a="paths"in s?s.paths:s.rings,l=[];let c;for(let u=0;u2&&c[p].push(d[p][2]),d[p].length>3&&c[p].push(d[p][3])}"paths"in o?o.paths=l:o.rings=l}else if("points"in s&&"points"in o){const a=s.points,l=[];for(let c=0;c2&&l[c].push(a[c][2]),a[c].length>3&&l[c].push(a[c][3]);o.points=l}return n}function T_(t,e){const r=t&&(zV(t)?t:t.spatialReference),i=e&&(zV(e)?e:e.spatialReference);return!(t&&"type"in t&&t.type==="mesh"||e&&"type"in e&&e.type==="mesh"||!r||!i)&&(!!Js(i,r)||Yb(i)&&tR(r)||Yb(r)&&tR(i))}function $w(t,e){if(t==null)return null;const r=t.spatialReference,i=e&&(zV(e)?e:e.spatialReference);return T_(r,i)?Js(r,i)?ye(t):Yb(i)?y4(t,iT,St.WebMercator,!1,ye(t)):tR(i)?y4(t,zA,St.WGS84,!1,ye(t)):null:null}function iT(t,e,r=[0,0]){e>89.99999?e=89.99999:e<-89.99999&&(e=-89.99999);const i=jte(e);return r[0]=jte(t)*Kt.radius,r[1]=Kt.halfSemiMajorAxis*Math.log((1+Math.sin(i))/(1-Math.sin(i))),r}function zA(t,e,r=[0,0],i=!1){const n=Gte(t/Kt.radius);return r[0]=i?n:n-360*Math.floor((n+180)/360),r[1]=Gte(Math.PI/2-2*Math.atan(Math.exp(-e/Kt.radius))),r}function BA(t,e=!1,r=ye(t)){return y4(t,iT,St.WebMercator,e,r)}function NM(t,e=!1,r=ye(t)){return y4(t,zA,St.WGS84,e,r)}var HL;const QE=[0,0];function Wte(t){return t&&(t.declaredClass==="esri.geometry.SpatialReference"||t.wkid!=null)}let hl=HL=class extends Zg{static copy(t,e){e._set("x",t._get("x")),e._set("y",t._get("y")),e._set("z",t._get("z")),e._set("m",t._get("m"));const r=t._get("spatialReference");e._set("spatialReference",Object.isFrozen(r)?r:r.clone())}constructor(...t){super(...t),this.x=0,this.y=0,this.z=void 0,this.m=void 0,this.type="point"}normalizeCtorArgs(t,e,r,i,n){let s;if(Array.isArray(t))s=t,n=e,t=s[0],e=s[1],r=s[2],i=s[3];else if(t&&typeof t=="object"){if(s=t,t=s.x!=null?s.x:s.longitude,e=s.y!=null?s.y:s.latitude,r=s.z,i=s.m,(n=s.spatialReference)&&n.declaredClass!=="esri.geometry.SpatialReference"&&(n=new St(n)),s.longitude!=null||s.latitude!=null){if(s.longitude==null)J.getLogger(this).warn(".longitude=","Latitude was defined without longitude");else if(s.latitude==null)J.getLogger(this).warn(".latitude=","Longitude was defined without latitude");else if(!s.declaredClass&&n&&n.isWebMercator){const a=iT(s.longitude,s.latitude,QE);t=a[0],e=a[1]}}}else Wte(r)?(n=r,r=null):Wte(i)&&(n=i,i=null);const o={x:t,y:e};return o.x==null&&o.y!=null?J.getLogger(this).warn(".y=","Y coordinate was defined without an X coordinate"):o.y==null&&o.x!=null&&J.getLogger(this).warn(".x=","X coordinate was defined without a Y coordinate"),n!=null&&(o.spatialReference=n),r!=null&&(o.z=r),i!=null&&(o.m=i),o}get cache(){return this.commitProperty("x"),this.commitProperty("y"),this.commitProperty("z"),this.commitProperty("m"),this.commitProperty("spatialReference"),{}}get hasM(){return this.m!==void 0}set hasM(t){t!==(this._get("m")!==void 0)&&(this._set("m",t?0:void 0),this._set("hasM",t))}get hasZ(){return this.z!==void 0}set hasZ(t){t!==(this._get("z")!==void 0)&&(this._set("z",t?0:void 0),this._set("hasZ",t))}get latitude(){const{spatialReference:t,x:e,y:r}=this;if(t){if(t.isWebMercator)return zA(e,r,QE)[1];if(t.isGeographic)return r}return null}set latitude(t){const{spatialReference:e,x:r}=this;t!=null&&e&&(e.isWebMercator?this._set("y",iT(r,t,QE)[1]):e.isGeographic&&this._set("y",t),this._set("latitude",t))}get longitude(){const{x:t,y:e,spatialReference:r}=this;if(r){if(r.isWebMercator)return zA(t,e,QE)[0];if(r.isGeographic)return t}return null}set longitude(t){const{y:e,spatialReference:r}=this;t!=null&&r&&(r.isWebMercator?this._set("x",iT(t,e,QE)[0]):r.isGeographic&&this._set("x",t),this._set("longitude",t))}writeX(t,e,r){e[r]=isNaN(t)?"NaN":t}readX(t){return typeof t=="string"?NaN:t}clone(){const t=new HL;return t.x=this.x,t.y=this.y,t.z=this.z,t.m=this.m,t.spatialReference=this.spatialReference,t}copy(t){return HL.copy(t,this),this}equals(t){if(t==null)return!1;const{x:e,y:r,z:i,m:n,spatialReference:s}=this,{z:o,m:a}=t;let{x:l,y:c,spatialReference:u}=t;if(!s.equals(u))if(s.isWebMercator&&u.isWGS84)[l,c]=iT(l,c),u=s;else{if(!s.isWGS84||!u.isWebMercator)return!1;[l,c]=zA(l,c),u=s}return e===l&&r===c&&i===o&&n===a&&s.wkid===u.wkid}offset(t,e,r){return this.x+=t,this.y+=e,r!=null&&(this.z=(this.z??0)+r),this}normalize(){if(!this.spatialReference)return this;const t=Sb(this.spatialReference);if(!t)return this;let e=this.x;const[r,i]=t.valid,n=2*i;let s;return e>i?(s=Math.ceil(Math.abs(e-i)/n),e-=s*n):eisNaN(t)?t:Ud(t))],hl.prototype,"x",void 0),h([xr("x")],hl.prototype,"writeX",null),h([lr("x")],hl.prototype,"readX",null),h([f({type:Number,json:{write:!0}})],hl.prototype,"y",void 0),h([f({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasZ}}}}})],hl.prototype,"z",void 0),h([f({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasM}}}}})],hl.prototype,"m",void 0),hl=HL=h([N("esri.geometry.Point")],hl),hl.prototype.toJSON.isDefaultToJSON=!0;const ze=hl,YU=[0,0];function eY(t,e){return e!=null&&Fa(t,e.x,e.y,e.z)}function JCt(t,e){if(!e.points||e.points.length)return!1;for(const r of e.points)if(!yS(t,r))return!1;return!0}function Y5e(t,e){const{xmin:r,ymin:i,zmin:n,xmax:s,ymax:o,zmax:a}=e;return t.hasZ&&e.hasZ?Fa(t,r,i,n)&&Fa(t,r,o,n)&&Fa(t,s,o,n)&&Fa(t,s,i,n)&&Fa(t,r,i,a)&&Fa(t,r,o,a)&&Fa(t,s,o,a)&&Fa(t,s,i,a):Fa(t,r,i)&&Fa(t,r,o)&&Fa(t,s,o)&&Fa(t,s,i)}function yS(t,e){return Fa(t,e[0],e[1])}function Z5e(t,e){return Fa(t,e[0],e[1],e[2])}function Fa(t,e,r,i){return e>=t.xmin&&e<=t.xmax&&r>=t.ymin&&r<=t.ymax&&(i==null||!t.hasZ||i>=t.zmin&&i<=t.zmax)}function Q5e(t,e){return YU[1]=e.y,YU[0]=e.x,J5e(t,YU)}function J5e(t,e){return z0e(t.rings,e)}function z0e(t,e){if(!t)return!1;if(K5e(t))return qte(!1,t,e);let r=!1;for(let i=0,n=t.length;i=n||p=n)&&c+(n-u)/(p-u)*(d-c)=0&&S<=1&&A>=0&&A<=1&&(n&&(n[0]=s+S*(a-s),n[1]=o+S*(l-o)),!0)}function lFe(t){switch(t){case"esriGeometryEnvelope":case"extent":return tFe;case"esriGeometryMultipoint":case"multipoint":return rFe;case"esriGeometryPoint":case"point":return eFe;case"esriGeometryPolygon":case"polygon":return nFe;case"esriGeometryPolyline":case"polyline":return oFe}}var ku;function cFe(t){return t&&(t.declaredClass==="esri.geometry.SpatialReference"||t.wkid!=null)}function w0(t,e,r){return e==null?r:r==null?e:t(e,r)}let oo=ku=class extends Zg{constructor(...t){super(...t),this.type="extent",this.xmin=0,this.ymin=0,this.mmin=void 0,this.zmin=void 0,this.xmax=0,this.ymax=0,this.mmax=void 0,this.zmax=void 0}normalizeCtorArgs(t,e,r,i,n){return cFe(t)?{spatialReference:t,xmin:0,ymin:0,xmax:0,ymax:0}:typeof t=="object"?(t.spatialReference=t.spatialReference==null?St.WGS84:t.spatialReference,t):{xmin:t,ymin:e,xmax:r,ymax:i,spatialReference:n??St.WGS84}}static fromBounds(t,e){return new ku({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3],spatialReference:e})}static fromPoint(t){return new ku({xmin:t.x,ymin:t.y,zmin:t.z,xmax:t.x,ymax:t.y,zmax:t.z,spatialReference:t.spatialReference})}get cache(){return this.commitProperty("xmin"),this.commitProperty("ymin"),this.commitProperty("zmin"),this.commitProperty("mmin"),this.commitProperty("xmax"),this.commitProperty("ymax"),this.commitProperty("zmax"),this.commitProperty("mmax"),this.commitProperty("spatialReference"),{}}get center(){const t=new ze({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(t.z=.5*(this.zmin+this.zmax)),this.hasM&&(t.m=.5*(this.mmin+this.mmax)),t}get extent(){return this.clone()}get hasM(){return this.mmin!=null&&this.mmax!=null}get hasZ(){return this.zmin!=null&&this.zmax!=null}get height(){return Math.abs(this.ymax-this.ymin)}get width(){return Math.abs(this.xmax-this.xmin)}centerAt(t){const e=this.center;return t.z!=null&&this.hasZ?this.offset(t.x-e.x,t.y-e.y,t.z-e.z):this.offset(t.x-e.x,t.y-e.y)}clone(){const t=new ku;return t.xmin=this.xmin,t.ymin=this.ymin,t.xmax=this.xmax,t.ymax=this.ymax,t.spatialReference=this.spatialReference,this.zmin!=null&&(t.zmin=this.zmin,t.zmax=this.zmax),this.mmin!=null&&(t.mmin=this.mmin,t.mmax=this.mmax),t}contains(t){if(!t)return!1;const e=this.spatialReference,r=t.spatialReference;return e&&r&&!e.equals(r)&&T_(e,r)&&(t=e.isWebMercator?BA(t):NM(t,!0)),t.type==="point"?eY(this,t):t.type==="extent"&&Y5e(this,t)}equals(t){if(this===t)return!0;if(t==null)return!1;const e=this.spatialReference,r=t.spatialReference;return e&&r&&!e.equals(r)&&T_(e,r)&&(t=e.isWebMercator?BA(t):NM(t,!0)),this.xmin===t.xmin&&this.ymin===t.ymin&&this.zmin===t.zmin&&this.mmin===t.mmin&&this.xmax===t.xmax&&this.ymax===t.ymax&&this.zmax===t.zmax&&this.mmax===t.mmax}expand(t){const e=.5*(1-t),r=this.width*e,i=this.height*e;if(this.xmin+=r,this.ymin+=i,this.xmax-=r,this.ymax-=i,this.hasZ){const n=(this.zmax-this.zmin)*e;this.zmin+=n,this.zmax-=n}if(this.hasM){const n=(this.mmax-this.mmin)*e;this.mmin+=n,this.mmax-=n}return this}intersects(t){if(t==null)return!1;t.type==="mesh"&&(t=t.extent);const e=this.spatialReference,r=t.spatialReference;return e&&r&&!Js(e,r)&&T_(e,r)&&(t=e.isWebMercator?BA(t):NM(t,!0)),lFe(t.type)(this,t)}normalize(){const t=this._normalize(!1,!0);return Array.isArray(t)?t:[t]}offset(t,e,r){return this.xmin+=t,this.ymin+=e,this.xmax+=t,this.ymax+=e,r!=null&&(this.zmin+=r,this.zmax+=r),this}shiftCentralMeridian(){return this._normalize(!0)}union(t){return this===t||(this.xmin=Math.min(this.xmin,t.xmin),this.ymin=Math.min(this.ymin,t.ymin),this.xmax=Math.max(this.xmax,t.xmax),this.ymax=Math.max(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=w0(Math.min,this.zmin,t.zmin),this.zmax=w0(Math.max,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=w0(Math.min,this.mmin,t.mmin),this.mmax=w0(Math.max,this.mmax,t.mmax))),this}intersection(t){return this===t?this:t!=null&&this.intersects(t)?(this.xmin=Math.max(this.xmin,t.xmin),this.ymin=Math.max(this.ymin,t.ymin),this.xmax=Math.min(this.xmax,t.xmax),this.ymax=Math.min(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=w0(Math.max,this.zmin,t.zmin),this.zmax=w0(Math.min,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=w0(Math.max,this.mmin,t.mmin),this.mmax=w0(Math.min,this.mmax,t.mmax)),this):null}toJSON(t){return this.write({},t)}_shiftCM(t=Sb(this.spatialReference)){if(!t||!this.spatialReference)return this;const e=this.spatialReference,r=this._getCM(t);if(r){const i=e.isWebMercator?NM(r):r;this.xmin-=r.x,this.xmax-=r.x,e.isWebMercator||(i.x=this._normalizeX(i.x,t).x),this.spatialReference=new St(YF((e.isWGS84?t.altTemplate:null)??t.wkTemplate,{Central_Meridian:i.x}))}return this}_getCM(t){let e=null;const[r,i]=t.valid,n=this.xmin,s=this.xmax;return n>=r&&n<=i&&s>=r&&s<=i||(e=this.center),e}_normalize(t,e,r){const i=this.spatialReference;if(!i)return this;const n=r??Sb(i);if(n==null)return this;const s=this._getParts(n).map(l=>l.extent);if(s.length<2)return s[0]||this;if(s.length>2)return t?this._shiftCM(n):this.set({xmin:n.valid[0],xmax:n.valid[1]});if(t)return this._shiftCM(n);if(e)return s;let o=!0,a=!0;return s.forEach(l=>{l.hasZ||(o=!1),l.hasM||(a=!1)}),{rings:s.map(l=>{const c=[[l.xmin,l.ymin],[l.xmin,l.ymax],[l.xmax,l.ymax],[l.xmax,l.ymin],[l.xmin,l.ymin]];if(o){const u=(l.zmax-l.zmin)/2;for(let d=0;d0;if(a>2*p){const x=new ku(l_||b?e.push({extent:new ku(m,n,p,s,o),frameIds:[y]},{extent:new ku(d,n,_,s,o),frameIds:[v]}):e.push({extent:new ku(m,n,_,s,o),frameIds:[y]});this.cache._parts=e}const r=this.hasZ,i=this.hasM;if(r||i){const n={};r&&(n.zmin=this.zmin,n.zmax=this.zmax),i&&(n.mmin=this.mmin,n.mmax=this.mmax);for(let s=0;si?(s=Math.ceil(Math.abs(t-i)/n),t-=s*n,o=s):t{e.call(null,t)}),[...GA].forEach(e=>{e.call(null,t)}))}var Ipe;(Ipe=globalThis.addEventListener)==null||Ipe.call(globalThis,"languagechange",hFe);let FM;function dFe(t){return FM&&!FM.destroyed||(FM=t()),FM}var GV;const pFe=new zn({avgRating:"avg-rating",numRatings:"num-ratings",numComments:"num-comments",numViews:"num-views"});let zu=GV=class extends xe{constructor(t){super(t),this.categories=null,this.disableExtraQuery=!1,this.extent=null,this.filter=null,this.num=10,this.query=null,this.sortField=null,this.start=1}get sortOrder(){return this._get("sortOrder")||"asc"}set sortOrder(t){t!=="asc"&&t!=="desc"||this._set("sortOrder",t)}clone(){return new GV({categories:this.categories?ye(this.categories):null,disableExtraQuery:this.disableExtraQuery,extent:this.extent?this.extent.clone():null,filter:this.filter,num:this.num,query:this.query,sortField:this.sortField,sortOrder:this.sortOrder,start:this.start})}toRequestOptions(t,e){let r=[];this.categories&&(r=this.categories.map(o=>Array.isArray(o)?JSON.stringify(o):o));let i="";if(this.extent){const o=$w(this.extent,St.WGS84);o!=null&&(i=`${o.xmin},${o.ymin},${o.xmax},${o.ymax}`)}let n=this.query;!this.disableExtraQuery&&t.extraQuery&&(n="("+n+")"+t.extraQuery);const s={categories:r,bbox:i,q:n,filter:this.filter,num:this.num,sortField:null,sortOrder:null,start:this.start};return this.sortField&&(s.sortField=this.sortField.split(",").map(o=>pFe.toJSON(o.trim())).join(","),s.sortOrder=this.sortOrder),{query:{...e,...s}}}};h([f()],zu.prototype,"categories",void 0),h([f()],zu.prototype,"disableExtraQuery",void 0),h([f({type:Dr})],zu.prototype,"extent",void 0),h([f()],zu.prototype,"filter",void 0),h([f()],zu.prototype,"num",void 0),h([f()],zu.prototype,"query",void 0),h([f()],zu.prototype,"sortField",void 0),h([f()],zu.prototype,"sortOrder",null),h([f()],zu.prototype,"start",void 0),zu=GV=h([N("esri.portal.PortalQueryParams")],zu);const bf=zu;let ov=class extends xe{constructor(e){super(e),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};h([f()],ov.prototype,"nextQueryParams",void 0),h([f()],ov.prototype,"queryParams",void 0),h([f()],ov.prototype,"results",void 0),h([f()],ov.prototype,"total",void 0),ov=h([N("esri.portal.PortalQueryResult")],ov);const fFe=ov;let $m=class extends ke{constructor(e){super(e),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){const e=this.get("portal.restUrl");return e?`${e}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new Y("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};h([f({type:Date})],$m.prototype,"created",void 0),h([f()],$m.prototype,"id",void 0),h([f()],$m.prototype,"portal",void 0),h([f()],$m.prototype,"title",void 0),h([f({readOnly:!0})],$m.prototype,"url",null),h([f()],$m.prototype,"username",void 0),$m=h([N("esri.portal.PortalFolder")],$m);const mFe=$m;let ao=class extends ke{constructor(e){super(e),this.access=null,this.created=null,this.description=null,this.id=null,this.isInvitationOnly=!1,this.modified=null,this.owner=null,this.portal=null,this.snippet=null,this.sortField=null,this.sortOrder=null,this.tags=null,this.title=null}get thumbnailUrl(){var i;const e=this.url,r=this.thumbnail;return e&&r&&this.portal?(i=this.portal)==null?void 0:i.normalizeUrl(`${e}/info/${r}?f=json`):null}get url(){const e=this.get("portal.restUrl");return e?e+"/community/groups/"+this.id:null}fetchCategorySchema(e){return sc(this.portal).request(this.url+"/categorySchema",e).then(r=>{const i=r.categorySchema||[];return i.some(n=>n.source==="contentCategorySetsGroupQuery.LivingAtlas")?this._fetchCategorySchemaSet("LivingAtlas",e):i})}fetchMembers(e){return sc(this.portal).request(this.url+"/users",e)}getThumbnailUrl(e){let r=this.thumbnailUrl;return r&&e&&(r+=`&w=${e}`),r}toJSON(){throw new Y("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}queryItems(e,r){let i=Qa(bf,e);const n=sc(this.portal);return parseFloat(n.currentVersion)>5?(i=i||new bf,n.queryPortal(`/content/groups/${this.id}/search`,i,"PortalItem",r)):(i=i?i.clone():new bf,i.query="group:"+this.id+(i.query?" "+i.query:""),n.queryItems(i,r))}_fetchCategorySchemaSet(e,r){const i=sc(this.portal);return i.fetchSelf(i.authMode,!0,r).then(n=>{const s=n.contentCategorySetsGroupQuery;if(s){const o=new bf;return o.disableExtraQuery=!0,o.num=1,o.query=s,i.queryGroups(o,r)}throw new Y("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery value not found")}).then(n=>{if(n.total){const s=n.results[0],o=new bf;return o.num=1,o.query=`typekeywords:"${e}"`,s.queryItems(o,r)}throw new Y("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery group not found")}).then(n=>n.total?n.results[0].fetchData("json",r).then(s=>{const o=s&&s.categorySchema;return o&&o.length?o:[]}):[])}};h([f()],ao.prototype,"access",void 0),h([f({type:Date})],ao.prototype,"created",void 0),h([f()],ao.prototype,"description",void 0),h([f()],ao.prototype,"id",void 0),h([f()],ao.prototype,"isInvitationOnly",void 0),h([f({type:Date})],ao.prototype,"modified",void 0),h([f()],ao.prototype,"owner",void 0),h([f()],ao.prototype,"portal",void 0),h([f()],ao.prototype,"snippet",void 0),h([f()],ao.prototype,"sortField",void 0),h([f()],ao.prototype,"sortOrder",void 0),h([f()],ao.prototype,"tags",void 0),h([f()],ao.prototype,"thumbnail",void 0),h([f({readOnly:!0})],ao.prototype,"thumbnailUrl",null),h([f()],ao.prototype,"title",void 0),h([f({readOnly:!0})],ao.prototype,"url",null),ao=h([N("esri.portal.PortalGroup")],ao);const jV=ao,gFe=Object.freeze(Object.defineProperty({__proto__:null,default:jV},Symbol.toStringTag,{value:"Module"}));var HV;let cn=HV=class extends ke{constructor(...t){super(...t),this.access=null,this.created=null,this.culture=null,this.description=null,this.email=null,this.fullName=null,this.modified=null,this.orgId=null,this.portal=null,this.preferredView=null,this.privileges=null,this.region=null,this.role=null,this.roleId=null,this.sourceJSON=null,this.units=null,this.username=null,this.userType=null}get thumbnailUrl(){const t=this.url,e=this.thumbnail;return t&&e?this.portal.normalizeUrl(`${t}/info/${e}?f=json`):null}get userContentUrl(){const t=this.get("portal.restUrl");return t?`${t}/content/users/${this.username}`:null}get url(){const t=this.get("portal.restUrl");return t?`${t}/community/users/${this.username}`:null}addItem(t){const e=t&&t.item,r=t&&t.data,i=t&&t.folder,n={method:"post"};e&&(n.query=e.createPostQuery(),r!=null&&(typeof r=="string"?n.query.text=r:typeof r=="object"&&(n.query.text=JSON.stringify(r))));let s=this.userContentUrl;return i&&(s+="/"+(typeof i=="string"?i:i.id)),this.portal.request(s+"/addItem",n).then(o=>(e.id=o.id,e.portal=this.portal,e.loaded?e.reload():e.load()))}deleteItem(t){let e=this.userContentUrl;return t.ownerFolder&&(e+="/"+t.ownerFolder),this.portal.request(e+`/items/${t.id}/delete`,{method:"post"}).then(()=>{t.id=null,t.portal=null})}deleteItems(t){const e=this.userContentUrl+"/deleteItems",r=t.map(i=>i.id);if(r.length){const i={method:"post",query:{items:r.join(",")}};return this.portal.request(e,i).then(()=>{t.forEach(n=>{n.id=null,n.portal=null})})}return Promise.resolve(void 0)}fetchFolders(){const t={query:{num:1}};return this.portal.request(this.userContentUrl??"",t).then(e=>{let r;return r=e&&e.folders?e.folders.map(i=>{const n=mFe.fromJSON(i);return n.portal=this.portal,n}):[],r})}fetchGroups(){return this.portal.request(this.url??"").then(t=>{let e;return e=t&&t.groups?t.groups.map(r=>{const i=jV.fromJSON(r);return i.portal=this.portal,i}):[],e})}fetchItems(t){const e=t??{};let r,i=this.userContentUrl??"";return e.folder&&(i+="/"+e.folder.id),ce(()=>Promise.resolve().then(()=>q0e),void 0).then(({default:n})=>{r=n;const s={folders:!1,num:e.num||10,start:e.start||1,sortField:e.sortField||"created",sortOrder:e.sortOrder||"asc"};return this.portal.request(i,{query:s})}).then(n=>{let s;return n&&n.items?(s=n.items.map(o=>{const a=r.fromJSON(o);return a.portal=this.portal,a}),Promise.all(s.map(o=>o.load())).catch(o=>o).then(()=>({items:s,nextStart:n.nextStart,total:n.total}))):{items:[],nextStart:-1,total:0}})}fetchTags(){return this.portal.request(this.url+"/tags").then(t=>t.tags)}getThumbnailUrl(t){let e=this.thumbnailUrl;return e&&t&&(e+=`&w=${t}`),e}queryFavorites(t){return this.favGroupId?(this._favGroup||(this._favGroup=new jV({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(t)):Promise.reject(new Y("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}toJSON(){throw new Y("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");const e=new HV;return e.sourceJSON=t,e.read(t),e}};h([f()],cn.prototype,"access",void 0),h([f({type:Date})],cn.prototype,"created",void 0),h([f()],cn.prototype,"culture",void 0),h([f()],cn.prototype,"description",void 0),h([f()],cn.prototype,"email",void 0),h([f()],cn.prototype,"favGroupId",void 0),h([f()],cn.prototype,"fullName",void 0),h([f({type:Date})],cn.prototype,"modified",void 0),h([f()],cn.prototype,"orgId",void 0),h([f()],cn.prototype,"portal",void 0),h([f()],cn.prototype,"preferredView",void 0),h([f()],cn.prototype,"privileges",void 0),h([f()],cn.prototype,"region",void 0),h([f()],cn.prototype,"role",void 0),h([f()],cn.prototype,"roleId",void 0),h([f()],cn.prototype,"sourceJSON",void 0),h([f()],cn.prototype,"thumbnail",void 0),h([f({readOnly:!0})],cn.prototype,"thumbnailUrl",null),h([f()],cn.prototype,"units",void 0),h([f({readOnly:!0})],cn.prototype,"userContentUrl",null),h([f({readOnly:!0})],cn.prototype,"url",null),h([f()],cn.prototype,"username",void 0),h([f()],cn.prototype,"userType",void 0),cn=HV=h([N("esri.portal.PortalUser")],cn);const H0e=cn,yFe=Object.freeze(Object.defineProperty({__proto__:null,default:H0e},Symbol.toStringTag,{value:"Module"}));var Im;let UM;const Xte={PortalGroup:()=>ce(()=>Promise.resolve().then(()=>gFe),void 0),PortalItem:()=>ce(()=>Promise.resolve().then(()=>q0e),void 0),PortalUser:()=>ce(()=>Promise.resolve().then(()=>yFe),void 0)};let Pe=Im=class extends fP(Dg){constructor(t){super(t),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=Jr.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(t){return typeof t=="string"?{url:t}:t}destroy(){Yte.unregister(this),this.defaultBasemap=Me(this.defaultBasemap),this.defaultDevBasemap=Me(this.defaultDevBasemap),this.defaultVectorBasemap=Me(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=Pi(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(t){if(t)for(const e of t)Jr.request.trustedServers.includes(e)||Jr.request.trustedServers.push(e);return t}readDefaultBasemap(t){return this._readBasemap(t)}readDefaultDevBasemap(t){return this._readBasemap(t)}readDefaultVectorBasemap(t){return this._readBasemap(t)}get extraQuery(){const t=!(this.user&&this.user.orgId)||this.canSearchPublic;return this.id&&!t?` AND orgid:${this.id}`:null}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let t=this.url;if(t){const e=t.indexOf("/sharing");t=e>0?t.substring(0,e):this.url.replace(/\/+$/,""),t+="/sharing/rest"}return t}get thumbnailUrl(){const t=this.restUrl,e=this.thumbnail;return t&&e?this._normalizeSSL(t+"/portals/self/resources/"+e):null}readUrlKey(t){return t&&t.toLowerCase()}readUser(t){let e=null;return t&&(e=H0e.fromJSON(t),e.portal=this),e}load(t){const e=ce(()=>Promise.resolve().then(()=>HFe),void 0).then(({default:r})=>{Bt(t),UM=r}).then(()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,t)).then(r=>{var i;if(sn){const n=sn;this.credential=n.findCredential(this.restUrl),this.credential||this.authMode!==Im.AUTH_MODE_AUTO||((i=this._esriIdCredentialCreateHandle)==null||i.remove(),this._esriIdCredentialCreateHandle=n.on("credential-create",_Fe(new WeakRef(this))),Yte.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=r,this.read(r)});return this.addResolvingPromise(e),Promise.resolve(this)}async createElevationLayers(){await this.load();const t=this._getHelperService("defaultElevationLayers"),e=(await ce(()=>import("./ElevationLayer-61bc2d81.js"),["assets/ElevationLayer-61bc2d81.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/ArcGISCachedService-344b6262.js","assets/TileInfoTilemapCache-b3f5dda7.js","assets/TilemapCache-67ada3c3.js","assets/ArcGISService-83287338.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js"])).default;return t?t.map(r=>new e({id:r.id,url:r.url})):[]}async fetchBasemaps(t,e){const r=await this._fetchBasemaps(t,e);if((e==null?void 0:e.include3d)===!0&&this.use3dBasemaps!==!1){const i=await this._fetchBasemaps3D(t,e);r.unshift(...i)}return r}fetchCategorySchema(t){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",t).then(e=>e.categorySchema):ss(t)?Promise.reject(wr()):Promise.resolve([])}fetchFeaturedGroups(t){const e=this.featuredGroups,r=new bf;if(r.num=100,r.sortField="title",e&&e.length){const i=[];for(const n of e)i.push(`(title:"${n.title}" AND owner:${n.owner})`);return r.query=i.join(" OR "),this.queryGroups(r,t).then(n=>n.results)}return ss(t)?Promise.reject(wr()):Promise.resolve([])}fetchRegions(t){var r;const e=((r=this.user)==null?void 0:r.culture)||this.culture||ep();return this.request(this.restUrl+"/portals/regions",{...t,query:{culture:e}})}fetchSettings(t){var r;const e=((r=this.user)==null?void 0:r.culture)||this.culture||ep();return this.request(this.restUrl+"/portals/self/settings",{...t,query:{culture:e}})}static getDefault(){return dFe(()=>new Im)}queryGroups(t,e){return this.queryPortal("/community/groups",t,"PortalGroup",e)}queryItems(t,e){return this.queryPortal("/search",t,"PortalItem",e)}queryUsers(t,e){return t.sortField||(t.sortField="username"),this.queryPortal("/community/users",t,"PortalUser",e)}fetchSelf(t=this.authMode,e=!1,r){const i=this.restUrl+"/portals/self",n={authMode:t,query:{culture:ep().toLowerCase()},...r};return n.authMode==="auto"&&(n.authMode="no-prompt"),e&&(n.query.default=!0),this.request(i,n)}queryPortal(t,e,r,i){const n=Qa(bf,e),s=o=>this.request(this.restUrl+t,{...n.toRequestOptions(this),...i}).then(a=>{const l=n.clone();return l.start=a.nextStart,new fFe({nextQueryParams:l,queryParams:n,total:a.total,results:Im._resultsToTypedArray(o,{portal:this},a,i)})}).then(a=>Promise.all(a.results.map(l=>typeof l.when=="function"?l.when():a)).then(()=>a,l=>(Mw(l),a)));return r&&Xte[r]?Xte[r]().then(({default:o})=>(Bt(i),s(o))):s()}signIn(){if(this.authMode===Im.AUTH_MODE_ANONYMOUS)return Promise.reject(new Y("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if(this.loadStatus==="failed")return Promise.reject(this.loadError);const t=e=>Promise.resolve().then(()=>this.loadStatus==="not-loaded"?(e||(this.authMode="immediate"),this.load().then(()=>null)):this.loadStatus==="loading"?this.load().then(()=>this.credential?null:(this.credential=e,this.fetchSelf("immediate"))):this.user&&this.credential===e?null:(this.credential=e,this.fetchSelf("immediate"))).then(r=>{r&&(this.sourceJSON=r,this.read(r))});return sn?sn.getCredential(this.restUrl).then(e=>t(e)):t(this.credential)}normalizeUrl(t){const e=this.credential&&this.credential.token;return this._normalizeSSL(e?t+(t.includes("?")?"&":"?")+"token="+e:t)}requestToTypedArray(t,e,r){return this.request(t,e).then(i=>{const n=Im._resultsToTypedArray(r,{portal:this},i);return Promise.all(n.map(s=>typeof s.when=="function"?s.when():i)).then(()=>n,()=>n)})}request(t,e={}){const r={f:"json",...e.query},{authMode:i=this.authMode===Im.AUTH_MODE_ANONYMOUS?"anonymous":"auto",body:n=null,cacheBust:s=!1,method:o="auto",responseType:a="json",signal:l}=e,c={authMode:i,body:n,cacheBust:s,method:o,query:r,responseType:a,timeout:0,signal:l};return kn(this._normalizeSSL(t),c).then(u=>u.data)}toJSON(){throw new Y("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");return new Im({sourceJSON:t})}_getHelperService(t){const e=this.helperServices&&this.helperServices[t];if(!e)throw new Y("portal:service-not-found",`The \`helperServices\` do not include an entry named "${t}"`);return e}async _fetchBasemaps(t,e){const r=new bf;r.query=t||(Jr.apiKey&&D0e(this.url)?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),r.disableExtraQuery=!0;const i=await this.queryGroups(r,e);if(!i.total)return[];const n=i.results[0];r.num=100,r.query='type:"Web Map" -type:"Web Application"',r.sortField=n.sortField||"name",r.sortOrder=n.sortOrder||"desc";const s=await n.queryItems(r,e);return s.total?s.results.filter(o=>o.type==="Web Map").map(o=>new UM({portalItem:o})):[]}async _fetchBasemaps3D(t,e){const r=t||this.basemapGalleryGroupQuery3D;if(!r)return[];const i=new bf({query:r,disableExtraQuery:!0}),n=await this.queryGroups(i,e);if(!n.total)return[];const s=n.results[0];i.num=100,i.query='type:"Web Scene"',i.sortField=s.sortField||"name",i.sortOrder=s.sortOrder||"desc";const o=await s.queryItems(i,e);return o.total?o.results.filter(a=>a.type==="Web Scene").map(a=>new UM({portalItem:a})):[]}_normalizeSSL(t){return t.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(t){if(t){const e=UM.fromJSON(t);return e.portalItem={portal:this},e}return null}static _resultsToTypedArray(t,e,r,i){let n=[];if(r){const s=i!=null?i.signal:null;n=r.listings||r.notifications||r.userInvitations||r.tags||r.items||r.groups||r.comments||r.provisions||r.results||r.relatedItems||r,(t||e)&&(n=n.map(o=>{const a=Object.assign(t?t.fromJSON(o):o,e);return typeof a.load=="function"&&a.load(s),a}))}else n=[];return n}};Pe.AUTH_MODE_ANONYMOUS="anonymous",Pe.AUTH_MODE_AUTO="auto",Pe.AUTH_MODE_IMMEDIATE="immediate",h([f()],Pe.prototype,"access",void 0),h([f()],Pe.prototype,"allSSL",void 0),h([f()],Pe.prototype,"authMode",void 0),h([f()],Pe.prototype,"authorizedCrossOriginDomains",void 0),h([lr("authorizedCrossOriginDomains")],Pe.prototype,"readAuthorizedCrossOriginDomains",null),h([f()],Pe.prototype,"basemapGalleryGroupQuery",void 0),h([f({json:{name:"3DBasemapGalleryGroupQuery"}})],Pe.prototype,"basemapGalleryGroupQuery3D",void 0),h([f()],Pe.prototype,"bingKey",void 0),h([f()],Pe.prototype,"canListApps",void 0),h([f()],Pe.prototype,"canListData",void 0),h([f()],Pe.prototype,"canListPreProvisionedItems",void 0),h([f()],Pe.prototype,"canProvisionDirectPurchase",void 0),h([f()],Pe.prototype,"canSearchPublic",void 0),h([f()],Pe.prototype,"canShareBingPublic",void 0),h([f()],Pe.prototype,"canSharePublic",void 0),h([f()],Pe.prototype,"canSignInArcGIS",void 0),h([f()],Pe.prototype,"canSignInIDP",void 0),h([f()],Pe.prototype,"colorSetsGroupQuery",void 0),h([f()],Pe.prototype,"commentsEnabled",void 0),h([f({type:Date})],Pe.prototype,"created",void 0),h([f()],Pe.prototype,"credential",void 0),h([f()],Pe.prototype,"culture",void 0),h([f()],Pe.prototype,"currentVersion",void 0),h([f()],Pe.prototype,"customBaseUrl",void 0),h([f()],Pe.prototype,"defaultBasemap",void 0),h([lr("defaultBasemap")],Pe.prototype,"readDefaultBasemap",null),h([f()],Pe.prototype,"defaultDevBasemap",void 0),h([lr("defaultDevBasemap")],Pe.prototype,"readDefaultDevBasemap",null),h([f({type:Dr})],Pe.prototype,"defaultExtent",void 0),h([f()],Pe.prototype,"defaultVectorBasemap",void 0),h([lr("defaultVectorBasemap")],Pe.prototype,"readDefaultVectorBasemap",null),h([f()],Pe.prototype,"description",void 0),h([f()],Pe.prototype,"devBasemapGalleryGroupQuery",void 0),h([f()],Pe.prototype,"eueiEnabled",void 0),h([f({readOnly:!0})],Pe.prototype,"extraQuery",null),h([f()],Pe.prototype,"featuredGroups",void 0),h([f()],Pe.prototype,"featuredItemsGroupQuery",void 0),h([f()],Pe.prototype,"galleryTemplatesGroupQuery",void 0),h([f()],Pe.prototype,"livingAtlasGroupQuery",void 0),h([f()],Pe.prototype,"hasCategorySchema",void 0),h([f()],Pe.prototype,"helpBase",void 0),h([f()],Pe.prototype,"helperServices",void 0),h([f()],Pe.prototype,"helpMap",void 0),h([f()],Pe.prototype,"homePageFeaturedContent",void 0),h([f()],Pe.prototype,"homePageFeaturedContentCount",void 0),h([f()],Pe.prototype,"httpPort",void 0),h([f()],Pe.prototype,"httpsPort",void 0),h([f()],Pe.prototype,"id",void 0),h([f()],Pe.prototype,"ipCntryCode",void 0),h([f({readOnly:!0})],Pe.prototype,"isOrganization",null),h([f()],Pe.prototype,"isPortal",void 0),h([f()],Pe.prototype,"isReadOnly",void 0),h([f({readOnly:!0})],Pe.prototype,"itemPageUrl",null),h([f()],Pe.prototype,"layerTemplatesGroupQuery",void 0),h([f()],Pe.prototype,"maxTokenExpirationMinutes",void 0),h([f({type:Date})],Pe.prototype,"modified",void 0),h([f()],Pe.prototype,"name",void 0),h([f()],Pe.prototype,"portalHostname",void 0),h([f()],Pe.prototype,"portalMode",void 0),h([f()],Pe.prototype,"portalProperties",void 0),h([f()],Pe.prototype,"region",void 0),h([f({readOnly:!0})],Pe.prototype,"restUrl",null),h([f()],Pe.prototype,"rotatorPanels",void 0),h([f()],Pe.prototype,"showHomePageDescription",void 0),h([f()],Pe.prototype,"sourceJSON",void 0),h([f()],Pe.prototype,"staticImagesUrl",void 0),h([f({json:{name:"2DStylesGroupQuery"}})],Pe.prototype,"stylesGroupQuery2d",void 0),h([f({json:{name:"stylesGroupQuery"}})],Pe.prototype,"stylesGroupQuery3d",void 0),h([f()],Pe.prototype,"supportsHostedServices",void 0),h([f()],Pe.prototype,"symbolSetsGroupQuery",void 0),h([f()],Pe.prototype,"templatesGroupQuery",void 0),h([f()],Pe.prototype,"thumbnail",void 0),h([f({readOnly:!0})],Pe.prototype,"thumbnailUrl",null),h([f()],Pe.prototype,"units",void 0),h([f()],Pe.prototype,"url",void 0),h([f()],Pe.prototype,"urlKey",void 0),h([lr("urlKey")],Pe.prototype,"readUrlKey",null),h([f()],Pe.prototype,"user",void 0),h([lr("user")],Pe.prototype,"readUser",null),h([f()],Pe.prototype,"use3dBasemaps",void 0),h([f()],Pe.prototype,"useStandardizedQuery",void 0),h([f()],Pe.prototype,"useVectorBasemaps",void 0),h([f()],Pe.prototype,"vectorBasemapGalleryGroupQuery",void 0),Pe=Im=h([N("esri.portal.Portal")],Pe);const Mh=Pe,Yte=new FinalizationRegistry(t=>{t.remove()});function _Fe(t){const e=sn;return()=>{const r=t.deref();r&&e.findCredential(r.restUrl)&&r.signIn().catch(()=>{})}}const vFe=J.getLogger("esri.assets");function bFe(t,e){return kn(Ir(t),e)}function Ir(t){if(!Jr.assetsPath)throw vFe.errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new Y("assets:path-not-set","config.assetsPath is not set");return s6(Jr.assetsPath,t)}let Lm=class extends xe{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e&&e.portalItem&&e.path?{...e,path:this._normalizePath(e.path,e.portalItem)}:e}set path(e){e!=null&&uu(e)?J.getLogger(this).error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return this._normalizePath(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get cdnUrl(){return this.portalItem&&this.path?`${this.portalItem.itemCdnUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",r){const i=this.cdnUrl;if(i==null)throw new Y("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal.request(i,{responseType:e,query:{token:this.portalItem.apiKey},signal:r==null?void 0:r.signal})}async update(e,r){const{addOrUpdateResource:i}=await ce(()=>import("./resourceUtils-b667b05b.js"),[]);return i(this,"update",e,r)}hasPath(){return this.path!=null}_normalizePath(e,r){return e==null?e:(e=e.replace(/^\/+/,""),r!=null&&uu(e)&&(e=n6(e,r.itemUrl)),e==null?void 0:e.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}};h([f()],Lm.prototype,"portalItem",void 0),h([f({type:String,value:null})],Lm.prototype,"path",null),h([_i("path")],Lm.prototype,"_castPath",null),h([f({type:String,readOnly:!0})],Lm.prototype,"url",null),h([f({type:String,readOnly:!0})],Lm.prototype,"cdnUrl",null),h([f({type:String,readOnly:!0})],Lm.prototype,"itemRelativeUrl",null),Lm=h([N("esri.portal.PortalItemResource")],Lm);const wFe=Lm;let c3=class extends xe{constructor(e){super(e),this.created=null,this.rating=null}};h([f()],c3.prototype,"created",void 0),h([f()],c3.prototype,"rating",void 0),c3=h([N("esri.portal.PortalRating")],c3);const ZU=c3;var av;const xFe=new Set(["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","GeoJson","CSV","KML","WFS","WMTS","WMS","Feed"]),TFe=new Set(["KML","GeoJson","CSV"]);let tr=av=class extends fP(Dg){static from(t){return mS(av,t)}constructor(t){super(t),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const t=this.type,e=this.typeKeywords||[];let r=t;return t==="Feature Service"||t==="Feature Collection"?r=e.includes("Table")?"Table":e.includes("Route Layer")?"Route Layer":e.includes("Markup")?"Markup":"Feature Layer":t==="Image Service"?r=e.includes("Elevation 3D Layer")?"Elevation Layer":e.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":t==="Scene Service"?r="Scene Layer":t==="Video Service"?r="Video Layer":t==="Scene Package"?r="Scene Layer Package":t==="Stream Service"?r="Feature Layer":t==="Geoprocessing Service"?r=e.includes("Web Tool")?"Tool":"Geoprocessing Service":t==="Geocoding Service"?r="Locator":t==="Geoenrichment Service"?r="GeoEnrichment Service":t==="Microsoft Powerpoint"?r="Microsoft PowerPoint":t==="GeoJson"?r="GeoJSON":t==="Globe Service"?r="Globe Layer":t==="Vector Tile Service"?r="Tile Layer":t==="netCDF"?r="NetCDF":t==="Map Service"?r=e.includes("Spatiotemporal")||!e.includes("Hosted Service")&&!e.includes("Tiled")||e.includes("Relational")?"Map Image Layer":"Tile Layer":t&&t.toLowerCase().includes("add in")?r=t.replaceAll(/(add in)/gi,"Add-In"):t==="datastore catalog service"?r="Big Data File Share":t==="Compact Tile Package"?r="Tile Package (tpkx)":t==="OGCFeatureServer"?r="OGC Feature Layer":t==="web mapping application"&&e.includes("configurableApp")?r="Instant App":t==="Insights Page"?r="Insights Report":t==="Excalibur Imagery Project"&&(r="Excalibur Project"),r}readExtent(t){return t&&t.length?new Dr(t[0][0],t[0][1],t[1][0],t[1][1]):null}get iconUrl(){const t=this.type&&this.type.toLowerCase()||"",e=this.typeKeywords||[],r="esri/images/portal/",i="16";let n,s=!1,o=!1,a=!1,l=!1,c=!1,u=!1;return t.indexOf("service")>0||t==="feature collection"||t==="kml"||t==="wms"||t==="wmts"||t==="wfs"?(s=e.includes("Hosted Service"),t==="feature service"||t==="feature collection"||t==="kml"||t==="wfs"?(o=e.includes("Table"),a=e.includes("Route Layer"),l=e.includes("Markup"),c=e.includes("Spatiotemporal"),u=e.includes("UtilityNetwork"),n=c&&o?"spatiotemporaltable":o?"table":a?"routelayer":l?"markup":c?"spatiotemporal":s?"featureshosted":u?"utilitynetwork":"features"):n=t==="map service"||t==="wms"||t==="wmts"?s||e.includes("Tiled")||t==="wmts"?"maptiles":"mapimages":t==="scene service"?e.includes("Line")?"sceneweblayerline":e.includes("3DObject")?"sceneweblayermultipatch":e.includes("Point")?"sceneweblayerpoint":e.includes("IntegratedMesh")?"sceneweblayermesh":e.includes("PointCloud")?"sceneweblayerpointcloud":e.includes("Polygon")?"sceneweblayerpolygon":e.includes("Building")?"sceneweblayerbuilding":e.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":t==="image service"?e.includes("Elevation 3D Layer")?"elevationlayer":e.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":t==="stream service"?"streamlayer":t==="video service"?e.includes("Live Stream")?"livestreamvideolayer":"videolayer":t==="vector tile service"?"vectortile":t==="datastore catalog service"?"datastorecollection":t==="geocoding service"?"geocodeservice":t==="geoprocessing service"?e.includes("Web Tool")?"tool":"layers":t==="geodata service"?"geodataservice":"layers"):n=t==="web map"||t==="cityengine web scene"?"maps":t==="web scene"?e.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":t==="web mapping application"&&e.includes("configurableApp")?"instantapps":t==="web mapping application"||t==="mobile application"||t==="application"||t==="operation view"||t==="desktop application"?"apps":t==="map document"||t==="map package"||t==="published map"||t==="scene document"||t==="globe document"||t==="basemap package"||t==="mobile basemap package"||t==="mobile map package"||t==="project package"||t==="project template"||t==="pro map"||t==="layout"||t==="layer"&&e.includes("ArcGIS Pro")||t==="explorer map"&&e.indexOf("Explorer Document")?"mapsgray":t==="service definition"||t==="csv"||t==="shapefile"||t==="cad drawing"||t==="geojson"||t==="netcdf"||t==="administrative report"?"datafiles":t==="explorer add in"||t==="desktop add in"||t==="windows viewer add in"||t==="windows viewer configuration"?"appsgray":t==="360 vr experience"?"360vr":t==="arcgis pro add in"||t==="arcgis pro configuration"?"addindesktop":t==="rule package"||t==="file geodatabase"||t==="sqlite geodatabase"||t==="csv collection"||t==="kml collection"||t==="windows mobile package"||t==="map template"||t==="desktop application template"||t==="gml"||t==="arcpad package"||t==="code sample"||t==="form"||t==="document link"||t==="earth configuration"||t==="operations dashboard add in"||t==="rules package"||t==="image"||t==="workflow manager package"||t==="explorer map"&&e.includes("Explorer Mapping Application")||e.includes("Document")?"datafilesgray":t==="network analysis service"||t==="geoprocessing service"||t==="geodata service"||t==="geometry service"||t==="geoprocessing package"||t==="locator package"||t==="geoprocessing sample"||t==="workflow manager service"?"toolsgray":t==="layer"||t==="layer package"||t==="explorer layer"?"layersgray":t==="scene package"?"scenepackage":t==="mobile scene package"?"mobilescenepackage":t==="tile package"||t==="compact tile package"?"tilepackage":t==="task file"?"taskfile":t==="report template"?"report-template":t==="statistical data collection"?"statisticaldatacollection":t==="insights workbook"?"workbook":t==="insights model"?"insightsmodel":t==="insights page"?"insightspage":t==="insights theme"?"insightstheme":t==="hub initiative"?"hubinitiative":t==="hubpage"?"hubpage":t==="hub event"?"hubevent":t==="hub site application"?"hubsite":t==="hub project"?"hubproject":t==="relational database connection"?"relationaldatabaseconnection":t==="big data file share"?"datastorecollection":t==="image collection"?"imagecollection":t==="style"?"style":t==="desktop style"?"desktopstyle":t==="dashboard"?"dashboard":t==="raster function template"?"rasterprocessingtemplate":t==="vector tile package"?"vectortilepackage":t==="ortho mapping project"?"orthomappingproject":t==="ortho mapping template"?"orthomappingtemplate":t==="solution"?"solutions":t==="geopackage"?"geopackage":t==="deep learning package"?"deeplearningpackage":t==="real time analytic"?"realtimeanalytics":t==="big data analytic"?"bigdataanalytics":t==="feed"?"feed":t==="excalibur imagery project"?"excaliburimageryproject":t==="notebook"?"notebook":t==="storymap"?"storymap":t==="survey123 add in"?"survey123addin":t==="mission"?"mission":t==="mission report"?"missionreport":t==="quickcapture project"?"quickcaptureproject":t==="pro report"?"proreport":t==="pro report template"?"proreporttemplate":t==="urban model"?"urbanmodel":t==="web experience"?"experiencebuilder":t==="web experience template"?"webexperiencetemplate":t==="experience builder widget"?"experiencebuilderwidget":t==="experience builder widget package"?"experiencebuilderwidgetpackage":t==="workflow"?"workflow":t==="insights script"?"insightsscript":t==="kernel gateway connection"?"kernelgatewayconnection":t==="hub initiative template"?"hubinitiativetemplate":t==="storymap theme"?"storymaptheme":t==="knowledge graph"?"knowledgegraph":t==="native application"?"nativeapp":t==="native application installer"?"nativeappinstaller":t==="link chart"?"linkchart":t==="investigation"?"investigation":t==="ogcfeatureserver"?"features":t==="pro project"?"proproject":t==="insights workbook package"?"insightsworkbookpackage":t==="apache parquet"?"apacheparquet":t==="notebook code snippets"||t==="notebook code snippet library"?"notebookcodesnippets":t==="suitability model"?"suitabilitymodel":t==="esri classifier definition"?"classifierdefinition":t==="esri classification schema"?"classificationschema":t==="insights data engineering workbook"?"dataengineeringworkbook":t==="insights data engineering model"?"dataengineeringmodel":t==="deep learning studio project"?"deeplearningproject":t==="discussion"?"discussion":t==="allsource project"?"allsourceproject":t==="api key"?"apikey":t==="data pipeline"?"datapipelines":"maps",n?Ir(r+n+i+".png"):null}get isLayer(){return this.type!=null&&xFe.has(this.type)}get itemCdnUrl(){let t=this.itemUrl;return t&&sn&&!sn.findCredential(t)&&(t=sn._normalizeAGOLorgDomain(t),t=t.replace(/^https?:\/\/www\.arcgis\.com/,"https://cdn.arcgis.com"),t=t.replace(/^https?:\/\/devext\.arcgis\.com/,"https://cdndev.arcgis.com"),t=t.replace(/^https?:\/\/qaext\.arcgis\.com/,"https://cdnqa.arcgis.com")),t}get itemPageUrl(){var e;const t=(e=this.portal)==null?void 0:e.itemPageUrl;return t&&this.id?`${t}?id=${this.id}`:null}get itemUrl(){var e;const t=(e=this.portal)==null?void 0:e.restUrl;return t&&this.id?`${t}/content/items/${this.id}`:null}get thumbnailUrl(){var r;const t=this.itemUrl,e=this.thumbnail;return t&&e?((r=this.portal)==null?void 0:r.normalizeUrl(`${t}/info/${e}?f=json`))??null:null}get userItemUrl(){const t=this.get("portal.restUrl");if(!t)return null;const e=this.owner||this.get("portal.user.username");return e?`${t}/content/users/${this.ownerFolder?`${e}/${this.ownerFolder}`:e}/items/${this.id}`:null}load(t){const e=this.portal??(this.portal=Mh.getDefault()),r=e.load(t).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?e.request(this.itemUrl,{signal:t!=null?t.signal:null,query:{token:this.apiKey}}):{}).then(i=>{this.sourceJSON=i,this.read(i)});return this.addResolvingPromise(r),Promise.resolve(this)}async addRating(t){const e={method:"post",query:{}};return t instanceof ZU&&(t=t.rating),t==null||isNaN(t)||typeof t!="number"||(e.query.rating=t),this.portal?(await this.portal.request(this.itemUrl+"/addRating",e),new ZU({rating:t,created:new Date})):null}clone(){const t={access:this.access,accessInformation:this.accessInformation,applicationProxies:ye(this.applicationProxies),avgRating:this.avgRating,categories:ye(this.categories),created:ye(this.created),culture:this.culture,description:this.description,extent:ye(this.extent),groupCategories:ye(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:ye(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:ye(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:ye(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:ye(this.typeKeywords),url:this.url};this.loaded&&(t.loadStatus="loaded");const e=new av({sourceJSON:this.sourceJSON}).set(t);return e._set("isOrgItem",this.isOrgItem),e}createPostQuery(){var r;const t=this.toJSON();for(const i of["tags","typeKeywords","categories"])t[i]=(r=t[i])==null?void 0:r.join(", ");const{extent:e}=t;return e&&(t.extent=JSON.stringify(e)),t}async deleteRating(){await sc(this.portal).request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(t="json",e){return sc(this.portal).request(this.itemUrl+"/data",{responseType:t,...e,query:{token:this.apiKey}})}async fetchRating(t){const e=await sc(this.portal).request(this.itemUrl+"/rating",{query:{token:this.apiKey},...t});return e.rating!=null?(e.created=new Date(e.created),new ZU(e)):null}fetchRelatedItems(t,e){return sc(this.portal).requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...t,token:this.apiKey},...e},av)}getThumbnailUrl(t){let e=this.thumbnailUrl;return e&&t&&(e+=`&w=${t}`),e}reload(){return sc(this.portal).request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then(t=>(this.sourceJSON=t,this.read(t),this))}update(t){return this.id?this.load().then(()=>sc(this.portal).signIn()).then(()=>{const e=t&&t.data,r={method:"post"};r.query=this.createPostQuery();for(const i in r.query)r.query[i]===null&&(r.query[i]="");return r.query.clearEmptyFields=!0,e!=null&&(typeof e=="string"?r.query.text=e:typeof e=="object"&&(r.query.text=JSON.stringify(e))),this.portal.request(`${this.userItemUrl}/update`,r).then(()=>this.reload())}):Promise.reject(new Y("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(t){if(!this.id)throw new Y("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:e,itemUrl:r}=this;await sc(e).signIn();const{copyResources:i,folder:n,tags:s,title:o}=t||{},a={method:"post",query:{copyPrivateResources:i==="all",folder:typeof n=="string"?n:n==null?void 0:n.id,includeResources:!!i,tags:s==null?void 0:s.join(","),title:o}},{itemId:l}=await e.request(`${r}/copy`,a);return new av({id:l,portal:e})}updateThumbnail(t){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const e=t.thumbnail,r=t.filename,i={method:"post"};if(typeof e=="string")im(e)?i.query={data:e}:i.query={url:iu(e)},r!=null&&(i.query.filename=r);else{const n=new FormData;r!=null?n.append("file",e,r):n.append("file",e),i.body=n}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,i).then(()=>this.reload())}):Promise.reject(new Y("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(t={},e){const{fetchResources:r}=await ce(()=>import("./resourceUtils-b667b05b.js"),[]);return r(this,t,e)}async addResource(t,e,r){const{addOrUpdateResource:i}=await ce(()=>import("./resourceUtils-b667b05b.js"),[]);return t.portalItem=this,i(t,"add",e,r)}async removeResource(t,e){const{removeResource:r}=await ce(()=>import("./resourceUtils-b667b05b.js"),[]);if(t.portalItem&&t.portalItem.itemUrl!==this.itemUrl)throw new Y("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r(this,t,e)}async removeAllResources(t){const{removeAllResources:e}=await ce(()=>import("./resourceUtils-b667b05b.js"),[]);return e(this,t)}resourceFromPath(t){return new wFe({portalItem:this,path:t})}toJSON(){const t=this.extent,e={accessInformation:this.accessInformation,categories:ye(this.categories),created:this.created&&this.created.getTime(),description:this.description,extent:t&&[[t.xmin,t.ymin],[t.xmax,t.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:ye(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:ye(this.typeKeywords),url:this.url};return nge(e)}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");return new av({sourceJSON:t})}_getPostQuery(){const t=this.toJSON();for(const e in t)e==="tags"&&t[e]!==null&&(t[e]=t[e].join(", ")),e==="typeKeywords"&&t[e]!==null&&(t[e]=t[e].join(", ")),e==="extent"&&t[e]&&(t[e]=JSON.stringify(t[e]));return t}};h([f({type:["private","shared","org","public"]})],tr.prototype,"access",void 0),h([f()],tr.prototype,"accessInformation",void 0),h([f({type:String})],tr.prototype,"apiKey",void 0),h([f({json:{read:{source:"appProxies"}}})],tr.prototype,"applicationProxies",void 0),h([f()],tr.prototype,"avgRating",void 0),h([f()],tr.prototype,"categories",void 0),h([f({type:Date})],tr.prototype,"created",void 0),h([f()],tr.prototype,"culture",void 0),h([f()],tr.prototype,"description",void 0),h([f({readOnly:!0})],tr.prototype,"displayName",null),h([f({type:Dr})],tr.prototype,"extent",void 0),h([lr("extent")],tr.prototype,"readExtent",null),h([f()],tr.prototype,"groupCategories",void 0),h([f({readOnly:!0})],tr.prototype,"iconUrl",null),h([f()],tr.prototype,"id",void 0),h([f({readOnly:!0})],tr.prototype,"isLayer",null),h([f({type:Boolean,readOnly:!0})],tr.prototype,"isOrgItem",void 0),h([f()],tr.prototype,"itemControl",void 0),h([f({readOnly:!0})],tr.prototype,"itemPageUrl",null),h([f({readOnly:!0})],tr.prototype,"itemUrl",null),h([f()],tr.prototype,"licenseInfo",void 0),h([f({type:Date})],tr.prototype,"modified",void 0),h([f()],tr.prototype,"name",void 0),h([f()],tr.prototype,"numComments",void 0),h([f()],tr.prototype,"numRatings",void 0),h([f()],tr.prototype,"numViews",void 0),h([f()],tr.prototype,"owner",void 0),h([f()],tr.prototype,"ownerFolder",void 0),h([f({type:Mh})],tr.prototype,"portal",void 0),h([f()],tr.prototype,"screenshots",void 0),h([f()],tr.prototype,"size",void 0),h([f()],tr.prototype,"snippet",void 0),h([f()],tr.prototype,"sourceJSON",void 0),h([f({type:String})],tr.prototype,"sourceUrl",void 0),h([f({type:String})],tr.prototype,"spatialReference",void 0),h([f()],tr.prototype,"tags",void 0),h([f()],tr.prototype,"thumbnail",void 0),h([f({readOnly:!0})],tr.prototype,"thumbnailUrl",null),h([f()],tr.prototype,"title",void 0),h([f()],tr.prototype,"type",void 0),h([f()],tr.prototype,"typeKeywords",void 0),h([f({type:String,json:{read(t,e){var r;if(TFe.has(e.type)){const i=(r=this.portal)==null?void 0:r.restUrl;t||(t=i&&this.id?`${i}/content/items/${this.id}/data`:null)}return t}}})],tr.prototype,"url",void 0),h([f({readOnly:!0})],tr.prototype,"userItemUrl",null),tr=av=h([N("esri.portal.PortalItem")],tr);const W0e=tr,q0e=Object.freeze(Object.defineProperty({__proto__:null,default:W0e},Symbol.toStringTag,{value:"Module"})),Zte=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,SFe={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function Qte(t){return t in SFe}const u3=[],IT=new Map;function Jte(t){for(const e of IT.keys())Y0e(t.pattern,e)&&IT.delete(e)}function EFe(t){return u3.includes(t)||(Jte(t),u3.unshift(t)),{remove(){const e=u3.indexOf(t);e>-1&&(u3.splice(e,1),Jte(t))}}}async function X0e(t){const e=ep();IT.has(t)||IT.set(t,AFe(t,e));const r=IT.get(t);return r&&await OFe.add(r),r}function CFe(t){if(!Zte.test(t))return null;const e=Zte.exec(t);if(e===null)return null;const[,r,i]=e,n=r+(i?"-"+i.toUpperCase():"");return Qte(n)?n:Qte(r)?r:null}async function AFe(t,e){const r=[];for(const i of u3)if(Y0e(i.pattern,t))try{return await i.fetchMessageBundle(t,e)}catch(n){r.push(n)}throw r.length?new Y("intl:message-bundle-error",`Errors occurred while loading "${t}"`,{errors:r}):new Y("intl:no-message-bundle-loader",`No loader found for message bundle "${t}"`)}function Y0e(t,e){return typeof t=="string"?e.startsWith(t):t.test(e)}tY(()=>{IT.clear()});const OFe=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(t){return this._increase(),t.then(()=>this._decrease(),()=>this._decrease()),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=Wo())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&this._numLoading===0&&(this._dfd.resolve(),this._dfd=null)}};async function RFe(t){if(!t)return;const e=t.includes("-vector")?t.slice(0,t.indexOf("-vector")):t,r=await X0e("esri/t9n/basemaps");return r[t]||r[e]}const WV={streets:{id:"streets",classic:!0,deprecated:!0,get thumbnailUrl(){return Ir("esri/images/basemap/streets.jpg")},baseMapLayers:[{id:"streets-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Street Map",showLegend:!1,visibility:!0,opacity:1}]},satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return Ir("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return Ir("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return Ir("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Terrain Base",showLegend:!1,visibility:!0,opacity:1},{id:"terrain-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Reference Overlay",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},topo:{id:"topo",classic:!0,deprecated:!0,get thumbnailUrl(){return Ir("esri/images/basemap/topo.jpg")},baseMapLayers:[{id:"topo-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Topo Map",showLegend:!1,visibility:!0,opacity:1}]},gray:{id:"gray",classic:!0,deprecated:!0,get thumbnailUrl(){return Ir("esri/images/basemap/gray.jpg")},baseMapLayers:[{id:"gray-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Light Gray Base",showLegend:!1,visibility:!0,opacity:1},{id:"gray-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Light Gray Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},"dark-gray":{id:"dark-gray",classic:!0,deprecated:!0,get thumbnailUrl(){return Ir("esri/images/basemap/dark-gray.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Dark Gray Base",showLegend:!1,visibility:!0,opacity:1},{id:"dark-gray-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Dark Gray Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return Ir("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},"national-geographic":{id:"national-geographic",classic:!0,deprecated:!0,get thumbnailUrl(){return Ir("esri/images/basemap/national-geographic.jpg")},baseMapLayers:[{id:"national-geographic-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer",title:"NatGeo World Map",showLegend:!1,layerType:"ArcGISTiledMapServiceLayer",visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return Ir("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return Ir("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return Ir("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return Ir("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return Ir("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return Ir("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return Ir("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return Ir("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"arcgis-imagery":{get thumbnailUrl(){return Ir("esri/images/basemap/hybrid.jpg")},title:"Imagery Hybrid",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-imagery-standard":{get thumbnailUrl(){return Ir("esri/images/basemap/satellite.jpg")},title:"Imagery",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"}]},"arcgis-imagery-labels":{title:"Hybrid [Reference]",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-light-gray":{get thumbnailUrl(){return Ir("esri/images/basemap/gray-vector.jpg")},title:"Light Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Base",title:"Light Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Labels",title:"Light Gray Canvas Labels",isReference:!0}]},"arcgis-dark-gray":{get thumbnailUrl(){return Ir("esri/images/basemap/dark-gray.jpg")},title:"Dark Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Base",title:"Dark Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Labels",title:"Dark Gray Canvas Labels",isReference:!0}]},"arcgis-navigation":{get thumbnailUrl(){return Ir("esri/images/basemap/streets-navigation.jpg")},title:"Navigation",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Navigation",title:"World Navigation Map"}]},"arcgis-navigation-night":{title:"Navigation (Dark Mode)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:NavigationNight",title:"World Navigation Map (Dark Mode)"}]},"arcgis-streets":{get thumbnailUrl(){return Ir("esri/images/basemap/streets-vector.jpg")},title:"Streets",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Streets",title:"World Street Map"}]},"arcgis-streets-night":{get thumbnailUrl(){return Ir("esri/images/basemap/streets-night.jpg")},title:"Streets (Night)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsNight",title:"World Street Map (Night)"}]},"arcgis-streets-relief":{get thumbnailUrl(){return Ir("esri/images/basemap/streets-relief.jpg")},title:"Streets (with Relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsRelief:Base",title:"World Street Map (with Relief)"}]},"arcgis-topographic":{get thumbnailUrl(){return Ir("esri/images/basemap/topo.jpg")},title:"Topographic",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Topographic:Base",title:"World Topographic Map"}]},"arcgis-oceans":{get thumbnailUrl(){return Ir("esri/images/basemap/oceans.jpg")},title:"Oceans",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Ocean Base",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Oceans:Labels",title:"World Ocean Reference",isReference:!0}]},"osm-standard":{title:"OpenStreetMap",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Standard",title:"OpenStreetMap"}]},"osm-standard-relief":{title:"OpenStreetMap (with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StandardRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-streets":{title:"OpenStreetMap (Streets)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Streets",title:"OpenStreetMap (Streets)"}]},"osm-streets-relief":{title:"OpenStreetMap (Streets with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StreetsRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-light-gray":{title:"OpenStreetMap (Light Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Base",title:"OSM (Light Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Labels",title:"OSM (Light Gray Reference)",isReference:!0}]},"osm-dark-gray":{title:"OpenStreetMap (Dark Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Base",title:"OSM (Dark Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Labels",title:"OSM (Dark Gray Reference)",isReference:!0}]},"arcgis-terrain":{title:"Terrain with Labels",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Base",title:"World Terrain Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Detail",title:"World Terrain Reference",isReference:!0}]},"arcgis-community":{title:"Community",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Community",title:"Community"}]},"arcgis-charted-territory":{title:"Charted Territory",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ChartedTerritory:Base",title:"Charted Territory"}]},"arcgis-colored-pencil":{title:"Colored Pencil",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ColoredPencil",title:"Colored Pencil"}]},"arcgis-nova":{title:"Nova",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Nova",title:"Nova"}]},"arcgis-modern-antique":{title:"Modern Antique",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ModernAntique:Base",title:"Modern Antique"}]},"arcgis-midcentury":{title:"Mid-Century",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Midcentury",title:"Mid-Century"}]},"arcgis-newspaper":{title:"Newspaper",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Newspaper",title:"Newspaper"}]},"arcgis-hillshade-light":{title:"Hillshade",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"}]},"arcgis-hillshade-dark":{title:"Hillshade (Dark)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade (Dark)",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade_Dark/MapServer"}]},"arcgis-human-geography":{title:"Human Geography",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Base",title:"Human Geography Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Detail",title:"Human Geography Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Label",title:"Human Geography Label",isReference:!0}]},"arcgis-human-geography-dark":{title:"Human Geography (Dark)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Base",title:"Human Geography Dark Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Detail",title:"Human Geography Dark Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Label",title:"Human Geography Dark Label",isReference:!0}]}};function n3t(t){return t!=null&&typeof t=="object"&&"type"in t&&t.type==="feature"}function jA(t){const e=t==null?void 0:t.type;return e==="base-tile"||e==="tile"||e==="elevation"||e==="imagery-tile"||e==="base-elevation"||e==="open-street-map"||e==="wcs"||e==="web-tile"||e==="wmts"||e==="vector-tile"}function _S(t){return t!=null&&"type"in t&&t.type==="group"}const s3t={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function PFe(t){const e=t==null?void 0:t.type;return e==="building-scene"||e==="integrated-mesh"||e==="point-cloud"||e==="scene"}function Kte(t){return(t==null?void 0:t.type)==="voxel"}function ere(t){return(t==null?void 0:t.type)==="imagery-tile"}function Z0e(t){return t!=null&&t.parent!=null&&"declaredClass"in t.parent&&t.parent.declaredClass==="esri.Basemap"&&t.parent.baseLayers.includes(t)}function rY(t){var e;return(t==null?void 0:t.type)==="feature"&&!t.url&&((e=t.source)==null?void 0:e.type)==="memory"}function o3t(t){var e;return(t==null?void 0:t.type)==="feature"&&((e=t.source)==null?void 0:e.type)==="feature-layer"}function MFe(t){if(t.activeLayer){const e=t.activeLayer.tileMatrixSet;if(e)return e;const r=t.activeLayer.tileMatrixSets;if(r)return r}return null}async function a3t(t,e){const r=sn==null?void 0:sn.findServerInfo(t);if((r==null?void 0:r.currentVersion)!=null)return r.owningSystemUrl||null;const i=t.toLowerCase().indexOf("/rest/services");if(i===-1)return null;const n=`${t.substring(0,i)}/rest/info`,s=e!=null?e.signal:null,{data:o}=await kn(n,{query:{f:"json"},responseType:"json",signal:s});return(o==null?void 0:o.owningSystemUrl)||null}function $Fe(t){if(!("capabilities"in t))return!1;switch(t.type){case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function IFe(t){return $Fe(t)?"effectiveCapabilities"in t?t.effectiveCapabilities:t.capabilities:null}function LFe(t){if(!("editingEnabled"in t))return!1;switch(t.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function DFe(t){return!!LFe(t)&&("effectiveEditingEnabled"in t?t.effectiveEditingEnabled:t.editingEnabled)}const NFe=new Set(["bing-maps","imagery","imagery-tile","map-image","open-street-map","tile","unknown","unsupported","vector-tile","web-tile","wms","wmts"]),FFe=new Set(["csv","feature","geo-rss","geojson","group","imagery","imagery-tile","kml","map-image","map-notes","media","ogc-feature","route","stream","subtype-group","tile","unknown","unsupported","vector-tile","web-tile","wfs","wms","wmts"]);function UFe(t){return t.layerContainerType==="basemap"?NFe:t.layerContainerType==="operational-layers"?FFe:null}function kFe(t,e){if(e.restrictedWebMapWriting){const r=UFe(e);return r==null||r.has(t.type)&&!rY(t)}return!0}function zFe(t,e){if(e)if(rY(t)){const r=uP("featureCollection.layers",e),i=r&&r[0]&&r[0].layerDefinition;i&&tre(t,i)}else t.type!=="group"&&tre(t,e)}function tre(t,e){"maxScale"in t&&(e.maxScale=c4(t.maxScale)??void 0),"minScale"in t&&(e.minScale=c4(t.minScale)??void 0)}function BFe(t,e){if(zFe(t,e),e&&("blendMode"in t&&(e.blendMode=t.blendMode,e.blendMode==="normal"&&delete e.blendMode),e.opacity=c4(t.opacity)??void 0,e.title=t.title||"Layer",e.visibility=t.visible,"legendEnabled"in t&&t.type!=="wmts"))if(rY(t)){const r=e.featureCollection;r&&(r.showLegend=t.legendEnabled)}else e.showLegend=t.legendEnabled}function rre(t,e,r){if(!("write"in t)||!t.write)return r&&r.messages&&r.messages.push(new Y("layer:unsupported",`Layers (${t.title}, ${t.id}) of type '${t.declaredClass}' cannot be persisted`,{layer:t})),null;if(kFe(t,r)){const i={};return t.write(i,r)?i:null}return e!=null&&BFe(t,e=ye(e)),e}var WL;let VFe=0;const Q0e="esri.Basemap";let Bu=WL=class extends fP(Dg){constructor(t){super(t),this.id=null,this.portalItem=null,this.spatialReference=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+VFe++,this.baseLayers=new ir,this.referenceLayers=new ir;const e=i=>{i.parent&&i.parent!==this&&"remove"in i.parent&&i.parent.remove(i),i.parent=this,i.type==="elevation"&&J.getLogger(this).error(`Layer '${i.title}, id:${i.id}' of type '${i.type}' is not supported as a basemap layer and will therefore be ignored.`)},r=i=>{i.parent=null};this.addHandles([this.baseLayers.on("after-add",i=>e(i.item)),this.referenceLayers.on("after-add",i=>e(i.item)),this.baseLayers.on("after-remove",i=>r(i.item)),this.referenceLayers.on("after-remove",i=>r(i.item))])}initialize(){this.when().catch(t=>{J.getLogger(this).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,t)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){var r;const t=this.baseLayers.removeAll();for(const i of t)i.destroy();const e=this.referenceLayers.removeAll();for(const i of e)i.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),(r=this.portalItem)==null||r.destroy(),this.portalItem=null}normalizeCtorArgs(t){return t&&"resourceInfo"in t&&(this._set("resourceInfo",t.resourceInfo),delete(t={...t}).resourceInfo),t}set baseLayers(t){this._set("baseLayers",qb(t,this._get("baseLayers")))}_writeBaseLayers(t,e,r){const i=[];t&&(r={...r,layerContainerType:"basemap"},this.baseLayers.forEach(n=>{const s=rre(n,r.webmap?r.webmap.getLayerJSONFromResourceInfo(n):null,r);s!=null&&i.push(s)}),this.referenceLayers.forEach(n=>{const s=rre(n,r.webmap?r.webmap.getLayerJSONFromResourceInfo(n):null,r);s!=null&&(n.type!=="scene"&&(s.isReference=!0),i.push(s))})),e.baseMapLayers=i}set referenceLayers(t){this._set("referenceLayers",qb(t,this._get("referenceLayers")))}writeTitle(t,e){e.title=t||"Basemap"}load(t){return this.addResolvingPromise(this._loadFromSource(t)),Promise.resolve(this)}loadAll(){return h0e(this,t=>{t(this.baseLayers,this.referenceLayers)})}clone(){const t={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map(e=>YN(e)?e.clone():e),referenceLayers:this.referenceLayers.map(e=>YN(e)?e.clone():e)};return this.loaded&&(t.loadStatus="loaded"),new WL({resourceInfo:this.resourceInfo}).set(t)}read(t,e){this.resourceInfo||this._set("resourceInfo",{data:t,context:e}),super.read(t,e)}write(t,e){return t=t||{},e&&e.origin||(e={origin:"web-map",...e}),super.write(t,e),!this.loaded&&this.resourceInfo&&this.resourceInfo.data.baseMapLayers&&(t.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(r=>{const i=ye(r);return i.url&&Wf(i.url)&&(i.url=`https:${i.url}`),i.templateUrl&&Wf(i.templateUrl)&&(i.templateUrl=`https:${i.templateUrl}`),i})),t}async _loadFromSource(t){const{resourceInfo:e,portalItem:r}=this;Bt(t);const i=[];if(e){const n=e.context?e.context.url:null;if(i.push(this._loadLayersFromJSON(e.data,n,t)),e.data.id&&!e.data.title){const s=e.data.id;i.push(RFe(s).then(o=>{o&&this.read({title:o},e.context)}))}}else r&&i.push(this._loadFromItem(r,t));await Promise.all(i)}async _loadLayersFromJSON(t,e,r){const i=this.resourceInfo&&this.resourceInfo.context,n=this.portalItem&&this.portalItem.portal||i&&i.portal||null,s=jFe[(i==null?void 0:i.origin)||""]??"web-map",{populateOperationalLayers:o}=await ce(()=>import("./layersCreator-738b2d23.js"),["assets/layersCreator-738b2d23.js","assets/lazyLayerLoader-8b31b2e1.js","assets/portalLayers-54553513.js","assets/layersLoader-0106cc6e.js","assets/fetchService-82a8c4d0.js","assets/jsonContext-5f3816dc.js","assets/portalItemUtils-792a27e1.js","assets/styleUtils-25825fd6.js"]),a=[];if(Bt(r),t.baseMapLayers&&Array.isArray(t.baseMapLayers)){const l={context:{origin:s,url:e,portal:n,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},c=p=>s==="web-scene"&&p.layerType==="ArcGISSceneServiceLayer"||p.isReference,u=o(this.baseLayers,t.baseMapLayers.filter(p=>!c(p)),l);a.push(u);const d=o(this.referenceLayers,t.baseMapLayers.filter(c),l);a.push(d)}await o1(a)}async _loadFromItem(t,e){const r=await t.load(e),i=await r.fetchData("json",e),n=Ja(t.itemUrl??"");return this._set("resourceInfo",{data:i.baseMap??{},context:{origin:GFe[t.type||""]??"web-map",portal:t.portal||Mh.getDefault(),url:n}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:i.spatialReference},this.resourceInfo.context),this.read({title:t.title,thumbnailUrl:t.thumbnailUrl},{origin:"portal-item",portal:t.portal||Mh.getDefault(),url:n}),this._loadLayersFromJSON(this.resourceInfo.data,n,e)}static fromId(t){const e=WV[t];if(!e)return null;if(e.deprecated){let r=null;t==="dark-gray"?r="dark-gray-vector":t==="gray"?r="gray-vector":t==="streets"?r="streets-vector":t==="topo"&&(r="topo-vector"),u4(J.getLogger(Q0e),`The ${t} basemap has entered mature support and is no longer being updated.`,{replacement:r,see:"https://arcg.is/1iq8aD",warnOnce:!0})}return WL.fromJSON(e)}};h([f({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(t,e,r,i){this._writeBaseLayers(t,e,i)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:ir}},writer(t,e,r,i){this._writeBaseLayers(t,e,i)}}}}}})],Bu.prototype,"baseLayers",null),h([f({type:String,json:{origins:{"web-scene":{write:!0}}}})],Bu.prototype,"id",void 0),h([f({type:W0e})],Bu.prototype,"portalItem",void 0),h([f()],Bu.prototype,"referenceLayers",null),h([f({readOnly:!0})],Bu.prototype,"resourceInfo",void 0),h([f({type:St})],Bu.prototype,"spatialReference",void 0),h([f()],Bu.prototype,"thumbnailUrl",void 0),h([f({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],Bu.prototype,"title",void 0),h([xr("title")],Bu.prototype,"writeTitle",null),Bu=WL=h([N(Q0e)],Bu);const GFe={"Web Scene":"web-scene","Web Map":"web-map","Link Chart":"link-chart"},jFe={"web-scene":"web-scene","web-map":"web-map","link-chart":"link-chart"},iR=Bu,HFe=Object.freeze(Object.defineProperty({__proto__:null,default:iR},Symbol.toStringTag,{value:"Module"})),_4={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function J0e(t){return!!_4[t]||!!_4[t.toLowerCase()]}function iY(t){return _4[t]??_4[t.toLowerCase()]}function WFe(t){return[...iY(t)]}function QU(t,e,r){r<0&&++r,r>1&&--r;const i=6*r;return i<1?t+(e-t)*i:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function K0e(t,e,r,i=1){const n=(t%360+360)%360/360,s=r<=.5?r*(e+1):r+e-r*e,o=2*r-s;return[Math.round(255*QU(o,s,n+1/3)),Math.round(255*QU(o,s,n)),Math.round(255*QU(o,s,n-1/3)),i]}function qFe(t){const e=t.length>5,r=e?8:4,i=(1<>=r,a[3]=n*l/255),l=o&i,o>>=r,a[2]=n*l,l=o&i,o>>=r,a[1]=n*l,l=o&i,o>>=r,a[0]=n*l,a}function O(){return[0,0,0]}function ki(t){return[t[0],t[1],t[2]]}function Se(t,e,r){return[t,e,r]}function na(t){const e=O(),r=Math.min(3,t.length);for(let i=0;i0&&(s=1/Math.sqrt(s),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s),t}function fe(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ot(t,e,r){const i=e[0],n=e[1],s=e[2],o=r[0],a=r[1],l=r[2];return t[0]=n*l-s*a,t[1]=s*o-i*l,t[2]=i*a-n*o,t}function Lr(t,e,r,i){const n=e[0],s=e[1],o=e[2];return t[0]=n+i*(r[0]-n),t[1]=s+i*(r[1]-s),t[2]=o+i*(r[2]-o),t}function i6e(t,e,r,i,n,s){const o=s*s,a=o*(2*s-3)+1,l=o*(s-2)+s,c=o*(s-1),u=o*(3-2*s);return t[0]=e[0]*a+r[0]*l+i[0]*c+n[0]*u,t[1]=e[1]*a+r[1]*l+i[1]*c+n[1]*u,t[2]=e[2]*a+r[2]*l+i[2]*c+n[2]*u,t}function n6e(t,e,r,i,n,s){const o=1-s,a=o*o,l=s*s,c=a*o,u=3*s*a,d=3*l*o,p=l*s;return t[0]=e[0]*c+r[0]*u+i[0]*d+n[0]*p,t[1]=e[1]*c+r[1]*u+i[1]*d+n[1]*p,t[2]=e[2]*c+r[2]*u+i[2]*d+n[2]*p,t}function s6e(t,e){e=e||1;const r=mP,i=2*r()*Math.PI,n=2*r()-1,s=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(i)*s,t[1]=Math.sin(i)*s,t[2]=n*e,t}function De(t,e,r){const i=e[0],n=e[1],s=e[2];return t[0]=r[0]*i+r[4]*n+r[8]*s+r[12],t[1]=r[1]*i+r[5]*n+r[9]*s+r[13],t[2]=r[2]*i+r[6]*n+r[10]*s+r[14],t}function zo(t,e,r){const i=e[0],n=e[1],s=e[2];return t[0]=i*r[0]+n*r[3]+s*r[6],t[1]=i*r[1]+n*r[4]+s*r[7],t[2]=i*r[2]+n*r[5]+s*r[8],t}function Sh(t,e,r){const i=r[0],n=r[1],s=r[2],o=r[3],a=e[0],l=e[1],c=e[2];let u=n*c-s*l,d=s*a-i*c,p=i*l-n*a,m=n*p-s*d,y=s*u-i*p,_=i*d-n*u;const v=2*o;return u*=v,d*=v,p*=v,m*=2,y*=2,_*=2,t[0]=a+u+m,t[1]=l+d+y,t[2]=c+p+_,t}function o6e(t,e,r,i){const n=[],s=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],s[0]=n[0],s[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),s[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function a6e(t,e,r,i){const n=[],s=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],s[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),s[1]=n[1],s[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function l6e(t,e,r,i){const n=[],s=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],s[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),s[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),s[2]=n[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function lye(t,e){re(kM,t),re(zM,e),me(kM,kM),me(zM,zM);const r=fe(kM,zM);return r>1?0:r<-1?Math.PI:Math.acos(r)}const kM=O(),zM=O();function c6e(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Bo(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function N_(t,e){if(t===e)return!0;const r=t[0],i=t[1],n=t[2],s=e[0],o=e[1],a=e[2],l=tl();return Math.abs(r-s)<=l*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-o)<=l*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(n-a)<=l*Math.max(1,Math.abs(n),Math.abs(a))}function Qg(t,e,r){const i=r[0]-e[0],n=r[1]-e[1],s=r[2]-e[2];let o=i*i+n*n+s*s;return o>0?(o=1/Math.sqrt(o),t[0]=i*o,t[1]=n*o,t[2]=s*o,t):(t[0]=0,t[1]=0,t[2]=0,t)}const Ws=ae,u6e=c6,h6e=v4,gP=ci,u6=wo,rc=Te,qV=la,ire=Object.freeze(Object.defineProperty({__proto__:null,abs:b4,add:oe,angle:lye,bezier:n6e,ceil:KFe,copy:re,cross:ot,direction:Qg,dist:gP,distance:ci,div:h6e,divide:v4,dot:fe,equals:N_,exactEquals:Bo,floor:oye,hermite:i6e,inverse:r6e,len:rc,length:Te,lerp:Lr,max:e6e,min:lY,mul:u6e,multiply:c6,negate:fa,normalize:me,random:s6e,rotateX:o6e,rotateY:a6e,rotateZ:l6e,round:t6e,scale:te,scaleAndAdd:pb,set:ne,sign:aye,sqrDist:u6,sqrLen:qV,squaredDistance:wo,squaredLength:la,str:c6e,sub:Ws,subtract:ae,transformMat3:zo,transformMat4:De,transformQuat:Sh},Symbol.toStringTag,{value:"Module"}));function vh(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function gi(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}function cY(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function cye(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function uye(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function hye(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}function d6e(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function p6e(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function f6e(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}function m6e(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}function g6e(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function ew(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function y6e(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t[3]=e[3]+r[3]*i,t}function dye(t,e){const r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2],s=e[3]-t[3];return Math.sqrt(r*r+i*i+n*n+s*s)}function w4(t,e){const r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2],s=e[3]-t[3];return r*r+i*i+n*n+s*s}function uY(t){const e=t[0],r=t[1],i=t[2],n=t[3];return Math.sqrt(e*e+r*r+i*i+n*n)}function hY(t){const e=t[0],r=t[1],i=t[2],n=t[3];return e*e+r*r+i*i+n*n}function _6e(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function v6e(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function pye(t,e){const r=e[0],i=e[1],n=e[2],s=e[3];let o=r*r+i*i+n*n+s*s;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=i*o,t[2]=n*o,t[3]=s*o),t}function fye(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function dY(t,e,r,i){const n=e[0],s=e[1],o=e[2],a=e[3];return t[0]=n+i*(r[0]-n),t[1]=s+i*(r[1]-s),t[2]=o+i*(r[2]-o),t[3]=a+i*(r[3]-a),t}function b6e(t,e){const r=mP;let i,n,s,o,a,l;e=e||1;do i=2*r()-1,n=2*r()-1,a=i*i+n*n;while(a>=1);do s=2*r()-1,o=2*r()-1,l=s*s+o*o;while(l>=1);const c=Math.sqrt((1-a)/l);return t[0]=e*i,t[1]=e*n,t[2]=e*s*c,t[3]=e*o*c,t}function au(t,e,r){const i=e[0],n=e[1],s=e[2],o=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*s+r[12]*o,t[1]=r[1]*i+r[5]*n+r[9]*s+r[13]*o,t[2]=r[2]*i+r[6]*n+r[10]*s+r[14]*o,t[3]=r[3]*i+r[7]*n+r[11]*s+r[15]*o,t}function w6e(t,e,r){const i=e[0],n=e[1],s=e[2],o=r[0],a=r[1],l=r[2],c=r[3],u=c*i+a*s-l*n,d=c*n+l*i-o*s,p=c*s+o*n-a*i,m=-o*i-a*n-l*s;return t[0]=u*c+m*-o+d*-l-p*-a,t[1]=d*c+m*-a+p*-o-u*-l,t[2]=p*c+m*-l+u*-a-d*-o,t[3]=e[3],t}function x6e(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function LT(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function x4(t,e){const r=t[0],i=t[1],n=t[2],s=t[3],o=e[0],a=e[1],l=e[2],c=e[3],u=tl();return Math.abs(r-o)<=u*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-a)<=u*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(n-l)<=u*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-c)<=u*Math.max(1,Math.abs(s),Math.abs(c))}const T6e=cye,S6e=uye,E6e=hye,C6e=dye,A6e=w4,O6e=uY,R6e=hY,mye=Object.freeze(Object.defineProperty({__proto__:null,add:cY,ceil:d6e,copy:vh,dist:C6e,distance:dye,div:E6e,divide:hye,dot:fye,equals:x4,exactEquals:LT,floor:p6e,inverse:v6e,len:O6e,length:uY,lerp:dY,max:m6e,min:f6e,mul:S6e,multiply:uye,negate:_6e,normalize:pye,random:b6e,round:g6e,scale:ew,scaleAndAdd:y6e,set:gi,sqrDist:A6e,sqrLen:R6e,squaredDistance:w4,squaredLength:hY,str:x6e,sub:T6e,subtract:cye,transformMat4:au,transformQuat:w6e},Symbol.toStringTag,{value:"Module"})),nre=new Float32Array(1);function P6e(t){--t;for(let e=1;e<32;e<<=1)t|=t>>e;return t+1}function ge(t,e,r){return Math.min(Math.max(t,e),r)}function tw(t){return(t&t-1)==0}function l3t(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}function c3t(t){return 10**Math.ceil(Math.LOG10E*Math.log(t))}function wt(t,e,r){return t+(e-t)*r}function It(t){return t*Math.PI/180}function Ka(t){return 180*t/Math.PI}function XV(t,e=1e-6){return(t<0?-1:1)/Math.max(Math.abs(t),e)}function As(t){return Math.acos(ge(t,-1,1))}function $h(t){return Math.asin(ge(t,-1,1))}function DT(t,e,r=1e-6){return t===e?!0:!Number.isFinite(t)||!Number.isFinite(e)?!1:(t>e?t-e:e-t)<=r}const T4=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function YV(t){return T4.setFloat64(0,t),T4.getBigInt64(0)}function M6e(t){return T4.setBigInt64(0,t),T4.getFloat64(0)}const qL=BigInt("1000000"),$6e=gye(1);function gye(t){const e=YV(t=Math.abs(t)),r=M6e(e<=qL?qL:e-qL);return Math.abs(t-r)}function u3t(t,e,r=$6e){if(t===e)return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;if(r!=null&&gye(Math.min(Math.abs(t),Math.abs(e)))qL)}function I6e(t,e,r=1e-6){if(t===e)return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;const i=Math.abs(t-e),n=Math.abs(t),s=Math.abs(e);if(t===0||e===0||n<1e-12&&s<1e-12){if(i>.01*r)return!1}else if(i/(n+s)>r)return!1;return!0}function L6e(t){return yye(Math.max(-ZV,Math.min(t,ZV)))}function yye(t){return nre[0]=t,nre[0]}function nR(t,e,r){const i=ge((r-t)/(e-t),0,1);return i*i*(3-2*i)}function sre(t,e){const r=Te(t),i=$h(t[2]/r),n=Math.atan2(t[1]/r,t[0]/r);return ne(e,r,i,n),e}function h3t(t,e,r){return gi(t,e[0],e[1],e[2],e[3]*r)}function d3t(t){const e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],r=t[3]*t[3]+t[4]*t[4]+t[5]*t[5],i=t[6]*t[6]+t[7]*t[7]+t[8]*t[8];return!(DT(e,1)&&DT(r,1)&&DT(i,1))}const ZV=yye(34028234663852886e22);function BM(t){return ge(RX(t),0,255)}function VM(t,e,r){return t=Number(t),isNaN(t)?r:tr?r:t}let XL=class Jo{static blendColors(e,r,i,n=new Jo){return n.r=Math.round(e.r+(r.r-e.r)*i),n.g=Math.round(e.g+(r.g-e.g)*i),n.b=Math.round(e.b+(r.b-e.b)*i),n.a=e.a+(r.a-e.a)*i,n._sanitize()}static fromRgb(e,r){const i=e.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);if(i){const n=i[2].split(/\s*,\s*/),s=i[1];if(s==="rgb"&&n.length===3||s==="rgba"&&n.length===4){const o=n[0];if(o.charAt(o.length-1)==="%"){const a=n.map(l=>2.56*parseFloat(l));return n.length===4&&(a[3]=parseFloat(n[3])),Jo.fromArray(a,r)}return Jo.fromArray(n.map(a=>parseFloat(a)),r)}if(s==="hsl"&&n.length===3||s==="hsla"&&n.length===4)return Jo.fromArray(K0e(parseFloat(n[0]),parseFloat(n[1])/100,parseFloat(n[2])/100,parseFloat(n[3])),r)}return null}static fromHex(e,r=new Jo){if(e.length!==4&&e.length!==7||e[0]!=="#")return null;const i=e.length===4?4:8,n=(1<{const a=s&n;s>>=i,r[o]=i===4?17*a:a}),r.a=1,r)}static fromArray(e,r=new Jo){return r._set(Number(e[0]),Number(e[1]),Number(e[2]),Number(e[3])),isNaN(r.a)&&(r.a=1),r._sanitize()}static fromString(e,r){const i=J0e(e)?iY(e):null;return i&&Jo.fromArray(i,r)||Jo.fromRgb(e,r)||Jo.fromHex(e,r)}static fromJSON(e){return e&&new Jo([e[0],e[1],e[2],e[3]/255])}static toUnitRGB(e){return e!=null?[e.r/255,e.g/255,e.b/255]:null}static toUnitRGBA(e){return e!=null?[e.r/255,e.g/255,e.b/255,e.a!=null?e.a:1]:null}constructor(e){this.r=255,this.g=255,this.b=255,this.a=1,e&&this.setColor(e)}get isBright(){return .299*this.r+.587*this.g+.114*this.b>=127}setColor(e){return typeof e=="string"?Jo.fromString(e,this):Array.isArray(e)?Jo.fromArray(e,this):(this._set(e.r??0,e.g??0,e.b??0,e.a??1),e instanceof Jo||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(){const e=this.r.toString(16),r=this.g.toString(16),i=this.b.toString(16);return`#${e.length<2?"0"+e:e}${r.length<2?"0"+r:r}${i.length<2?"0"+i:i}`}toCss(e=!1){const r=this.r+", "+this.g+", "+this.b;return e?`rgba(${r}, ${this.a})`:`rgb(${r})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(e=Jo.AlphaMode.ALWAYS){const r=BM(this.r),i=BM(this.g),n=BM(this.b);return e===Jo.AlphaMode.ALWAYS||this.a!==1?[r,i,n,BM(255*this.a)]:[r,i,n]}clone(){return new Jo(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(e){return e!=null&&e.r===this.r&&e.g===this.g&&e.b===this.b&&e.a===this.a}_sanitize(){return this.r=Math.round(VM(this.r,0,255)),this.g=Math.round(VM(this.g,0,255)),this.b=Math.round(VM(this.b,0,255)),this.a=VM(this.a,0,1),this}_set(e,r,i,n){this.r=e,this.g=r,this.b=i,this.a=n}};XL.prototype.declaredClass="esri.Color",function(t){var e;(e=t.AlphaMode||(t.AlphaMode={}))[e.ALWAYS=0]="ALWAYS",e[e.UNLESS_OPAQUE=1]="UNLESS_OPAQUE"}(XL||(XL={}));const it=XL;function p3t(t){}function D6e(t){return()=>t}function Vt(t,e={}){const r=t instanceof zn?t:new zn(t,e),i={type:(e==null?void 0:e.ignoreUnknown)??1?r.apiValues:String,json:{type:r.jsonValues,read:!(e!=null&&e.readOnly)&&{reader:r.read},write:{writer:r.write}}};return(e==null?void 0:e.readOnly)!==void 0&&(i.readOnly=!!e.readOnly),(e==null?void 0:e.default)!==void 0&&(i.json.default=e.default),(e==null?void 0:e.name)!==void 0&&(i.json.name=e.name),(e==null?void 0:e.nonNullable)!==void 0&&(i.nonNullable=e.nonNullable),f(i)}var QV;let YL=QV=class extends ke{constructor(t){super(t),this.type="none"}clone(){return new QV({type:this.type})}};h([Vt({none:"none",stayAbove:"stay-above"})],YL.prototype,"type",void 0),YL=QV=h([N("esri.ground.NavigationConstraint")],YL);function pY(t){const e=RX(100*(1-t));return Math.max(0,Math.min(e,100))}function fY(t){const e=1-t/100;return Math.max(0,Math.min(e,1))}var JV;let Dm=JV=class extends fP(Dg){constructor(t){super(t),this.opacity=1,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new ir;const e=i=>{i.parent&&i.parent!==this&&"remove"in i.parent&&i.parent.remove(i),i.parent=this,i.type!=="elevation"&&i.type!=="base-elevation"&&J.getLogger(this).error(`Layer '${i.title}, id:${i.id}' of type '${i.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},r=i=>{i.parent=null};this.addHandles([this.layers.on("after-add",i=>e(i.item)),this.layers.on("after-remove",i=>r(i.item))])}initialize(){this.when().catch(t=>{Zn(t)||J.getLogger(this).error("#load()","Failed to load ground",t)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const t=this.layers.removeAll();for(const e of t)e.destroy();this.layers.destroy()}normalizeCtorArgs(t){return t&&"resourceInfo"in t&&(this._set("resourceInfo",t.resourceInfo),delete(t={...t}).resourceInfo),t}set layers(t){this._set("layers",qb(t,this._get("layers")))}writeLayers(t,e,r,i){const n=[];t&&(i={...i,layerContainerType:"ground"},t.forEach(s=>{if("write"in s){const o={};D6e(s)().write(o,i)&&n.push(o)}else i&&i.messages&&i.messages.push(new Y("layer:unsupported",`Layers (${s.title}, ${s.id}) of type '${s.declaredClass}' cannot be persisted in the ground`,{layer:s}))})),e.layers=n}load(t){return this.addResolvingPromise(this._loadFromSource(t)),Promise.resolve(this)}loadAll(){return h0e(this,t=>{t(this.layers)})}async queryElevation(t,e){await this.load({signal:e==null?void 0:e.signal});const{ElevationQuery:r}=await ce(()=>import("./ElevationQuery-6f358c3e.js"),[]);Bt(e);const i=new r,n=this.layers.filter(ore).toArray();return i.queryAll(n,t,e)}async createElevationSampler(t,e){await this.load({signal:e==null?void 0:e.signal});const{ElevationQuery:r}=await ce(()=>import("./ElevationQuery-6f358c3e.js"),[]);Bt(e);const i=new r,n=this.layers.filter(ore).toArray();return i.createSamplerAll(n,t,e)}clone(){const t={opacity:this.opacity,surfaceColor:ye(this.surfaceColor),navigationConstraint:ye(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(t.loadStatus="loaded"),new JV({resourceInfo:this.resourceInfo}).set(t)}read(t,e){this.resourceInfo||this._set("resourceInfo",{data:t,context:e}),super.read(t,e)}_loadFromSource(t){const e=this.resourceInfo;return e?this._loadLayersFromJSON(e.data,e.context,t):Promise.resolve()}_loadLayersFromJSON(t,e,r){const i=e&&e.origin||"web-scene",n=e&&e.portal||null,s=e&&e.url||null;return ce(()=>import("./layersCreator-738b2d23.js"),["assets/layersCreator-738b2d23.js","assets/lazyLayerLoader-8b31b2e1.js","assets/portalLayers-54553513.js","assets/layersLoader-0106cc6e.js","assets/fetchService-82a8c4d0.js","assets/jsonContext-5f3816dc.js","assets/portalItemUtils-792a27e1.js","assets/styleUtils-25825fd6.js"]).then(({populateOperationalLayers:o})=>{Bt(r);const a=[];if(t.layers&&Array.isArray(t.layers)){const l={context:{origin:i,url:s,portal:n,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};a.push(o(this.layers,t.layers,l))}return o1(a)}).then(()=>{})}};function N6e(t){return t&&"createElevationSampler"in t}function ore(t){return t.type==="elevation"||N6e(t)}h([f({json:{read:!1}})],Dm.prototype,"layers",null),h([xr("layers")],Dm.prototype,"writeLayers",null),h([f({readOnly:!0})],Dm.prototype,"resourceInfo",void 0),h([f({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:mn,read:{reader:fY,source:"transparency"},write:{writer:(t,e)=>{e.transparency=pY(t)},target:"transparency"}}})],Dm.prototype,"opacity",void 0),h([f({type:it,json:{type:[mn],write:(t,e)=>{e.surfaceColor=t.toJSON().slice(0,3)}}})],Dm.prototype,"surfaceColor",void 0),h([f({type:YL,json:{write:!0}})],Dm.prototype,"navigationConstraint",void 0),Dm=JV=h([N("esri.Ground")],Dm);const S4=Dm;let a2=class extends ir{constructor(e){super(e),this.getCollections=null}initialize(){this.own(Lge(()=>this._refresh()))}destroy(){this.getCollections=null}_refresh(){const e=this.getCollections!=null?this.getCollections():null;if(e==null)return void this.removeAll();let r=0;for(const i of e)i!=null&&(r=this._processCollection(r,i));this.splice(r,this.length)}_createNewInstance(e){return new ir(e)}_processCollection(e,r){if(!r)return e;const i=this.itemFilterFunction??(n=>!!n);for(const n of r)if(n){if(i(n)){const s=this.indexOf(n,e);s>=0?s!==e&&this.reorder(n,e):this.add(n,e),++e}if(this.getChildrenFunction){const s=this.getChildrenFunction(n);if(Array.isArray(s))for(const o of s)e=this._processCollection(e,o);else e=this._processCollection(e,s)}}return e}};h([f()],a2.prototype,"getCollections",void 0),h([f()],a2.prototype,"getChildrenFunction",void 0),h([f()],a2.prototype,"itemFilterFunction",void 0),a2=h([N("esri.core.CollectionFlattener")],a2);const sR=a2,F6e=[["binary","application/octet-stream","bin",""]];function KV(t,e){return gY(k6e(t,e))}function e7(t,e){return gY(z6e(t,e))}function m3t(t,e){return _ye(U6e(t,e))}function mY(t){return[...F6e,...t]}function U6e(t,e){return mY(e).find(r=>gY(r)===t)}function k6e(t,e){return mY(e).find(r=>_ye(r)===t)}function z6e(t,e){const r=t.toLowerCase();return mY(e).find(i=>B6e(i).some(n=>r.endsWith(n)))}function gY(t){return t==null?void 0:t[0]}function _ye(t){return t==null?void 0:t[1]}function B6e(t){return(t==null?void 0:t[2].split(","))??[]}function g3t(t){var e;return(e=t.tables)==null?void 0:e.find(r=>r.role==="assetMaps")}function V6e(t){var e,r;return!(!(t&&typeof t=="object"&&"loaded"in t&&t.loaded&&((r=(e=IFe(t))==null?void 0:e.operations)!=null&&r.supportsEditing)&&"type"in t)||"editingEnabled"in t&&!DFe(t)||t.type==="scene"&&!G6e(t))}function G6e(t){const e=t.infoFor3D;if(!e)return!0;const{supportedFormats:r,queryFormats:i}=e,n=KV("model/gltf-binary",r)??e7("glb",r);return n!=null&&i.includes(n)}const are=J.getLogger("esri.support.basemapUtils");function j6e(){return{}}function H6e(t){for(const e in t){const r=t[e];(r==null?void 0:r.destroyed)===!1&&r.destroy(),delete t[e]}}function W6e(t,e){let r;if(typeof t=="string"){if(!(t in WV)){const i=Object.entries(WV).filter(([n,s])=>Jr.apiKey&&!s.classic||!Jr.apiKey&&s.classic&&!s.deprecated).map(([n])=>`"${n}"`).join(", ");return are.warn(`Unable to find basemap definition for: ${t}. Try one of these: ${i}`),null}e&&(r=e[t]),r||(r=iR.fromId(t),e&&(e[t]=r))}else r=Qa(iR,t);return r!=null&&r.destroyed&&(are.warn("The provided basemap is already destroyed",{basemap:r}),r=null),r}function y3t(t,e){var r,i,n,s;return((i=(r=t.basemap)==null?void 0:r.referenceLayers)==null?void 0:i.some(o=>o.uid===e))||((s=(n=t.basemap)==null?void 0:n.baseLayers)==null?void 0:s.some(o=>o.uid===e))}function q6e(t){return new sR({getCollections:()=>[t.tables,t.layers],getChildrenFunction:e=>{const r=[];return"tables"in e&&r.push(e.tables),"layers"in e&&r.push(e.layers),r},itemFilterFunction:e=>{const r=e.parent;return!!r&&"tables"in r&&r.tables.includes(e)}})}function JU(t){for(const e of t.values())e==null||e.destroy();t.clear()}const lre={"world-elevation":{id:"worldElevation",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"},"world-topobathymetry":{id:"worldTopoBathymetry",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/TopoBathy3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"}};function X6e(t){let e=null;if(typeof t=="string")if(t in lre){const r=lre[t];e=new S4({resourceInfo:{data:{layers:[r]}}})}else J.getLogger("esri.support.groundUtils").warn(`Unable to find ground definition for: ${t}. Try "world-elevation"`);else e=Qa(S4,t);return e}function vS(t,e,r=!1){let{hasM:i,hasZ:n}=t;Array.isArray(e)?e.length!==4||i||n?e.length===3&&r&&!i?(n=!0,i=!1):e.length===3&&i&&n&&(i=!1,n=!1):(i=!0,n=!0):(n=!n&&e.hasZ&&(!i||e.hasM),i=!i&&e.hasM&&(!n||e.hasZ)),t.hasZ=n,t.hasM=i}var t7;function cre(t){return(e,r)=>e==null?r:r==null?e:t(e,r)}function Y6e(t){return t&&(t.declaredClass==="esri.geometry.SpatialReference"||t.wkid!=null)}let ty=t7=class extends Zg{constructor(...t){super(...t),this.points=[],this.type="multipoint"}normalizeCtorArgs(t,e){if(!t&&!e)return{};const r={};Array.isArray(t)?(r.points=t,r.spatialReference=e):Y6e(t)?r.spatialReference=t:(t.points&&(r.points=t.points),t.spatialReference&&(r.spatialReference=t.spatialReference),t.hasZ&&(r.hasZ=t.hasZ),t.hasM&&(r.hasM=t.hasM));const i=r.points&&r.points[0];return i&&(r.hasZ===void 0&&r.hasM===void 0?(r.hasZ=i.length>2,r.hasM=!1):r.hasZ===void 0?r.hasZ=i.length>3:r.hasM===void 0&&(r.hasM=i.length>3)),r}get cache(){return this.commitProperty("points"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const t=this.points;if(!t.length)return null;const e=new Dr,r=this.hasZ,i=this.hasM,n=r?3:2,s=t[0],o=cre(Math.min),a=cre(Math.max);let l,c,u,d,[p,m]=s,[y,_]=s;for(let v=0,b=t.length;v2){const A=x[2];l=o(l,A),u=a(u,A)}if(i&&x.length>n){const A=x[n];c=o(c,A),d=a(d,A)}}return e.xmin=p,e.ymin=m,e.xmax=y,e.ymax=_,e.spatialReference=this.spatialReference,r?(e.zmin=l,e.zmax=u):(e.zmin=void 0,e.zmax=void 0),i?(e.mmin=c,e.mmax=d):(e.mmin=void 0,e.mmax=void 0),e}writePoints(t,e){e.points=ye(this.points)}addPoint(t){return vS(this,t),Array.isArray(t)?this.points.push(t):this.points.push(t.toArray()),this.notifyChange("points"),this}clone(){const t={points:ye(this.points),spatialReference:this.spatialReference};return this.hasZ&&(t.hasZ=!0),this.hasM&&(t.hasM=!0),new t7(t)}getPoint(t){if(!this._validateInputs(t))return null;const e=this.points[t],r={x:e[0],y:e[1],spatialReference:this.spatialReference};let i=2;return this.hasZ&&(r.z=e[2],i=3),this.hasM&&(r.m=e[i]),new ze(r)}removePoint(t){if(!this._validateInputs(t))return null;const e=new ze(this.points.splice(t,1)[0],this.spatialReference);return this.notifyChange("points"),e}setPoint(t,e){return this._validateInputs(t)?(vS(this,e),Array.isArray(e)||(e=e.toArray()),this.points[t]=e,this.notifyChange("points"),this):this}toJSON(t){return this.write({},t)}_validateInputs(t){return t!=null&&t>=0&&t2&&e.length>2){const n=t[2]-e[2];return Math.sqrt(r*r+i*i+n*n)}return Math.sqrt(r*r+i*i)}function vye(t,e,r){const i=t[0]+r*(e[0]-t[0]),n=t[1]+r*(e[1]-t[1]);return t.length>2&&e.length>2?[i,n,t[2]+r*(e[2]-t[2])]:[i,n]}function v3t(t,e,r,i){const[n,s]=e,[o,a]=r[i],[l,c]=r[i+1],u=l-o,d=c-a,p=u*u+d*d,m=(n-o)*u+(s-a)*d,y=Math.min(1,Math.max(0,m/p));return t[0]=o+u*y,t[1]=a+d*y,t}function b3t(t,e,r){let i,n,s,o,a=!1,l=1/0;for(r.reset();r.nextPath();)if(r.nextPoint())for(i=r.x,n=r.y;r.nextPoint();)s=r.x,o=r.y,n>e!=o>e&&t<(s-i)*(e-n)/(o-n)+i&&(a=!a),l=Math.min(l,Q6e(t,e,i,n,s,o)),i=s,n=o;return l===0?0:(a?1:-1)*Math.sqrt(l)}function Q6e(t,e,r,i,n,s){let o=r,a=i,l=n-o,c=s-a;if(l!==0||c!==0){const u=((t-o)*l+(e-a)*c)/(l*l+c*c);u>1?(o=n,a=s):u>0&&(o+=l*u,a+=c*u)}return l=t-o,c=e-a,l*l+c*c}function bye(t,e){return vye(t,e,.5)}function wye(t){const e=t.length;let r=0;for(let i=0;i2&&c.length>2&&r&&(s+=l[0]*c[2]-c[0]*l[2],u=3),l.length>u&&c.length>u&&e&&(o+=l[0]*c[u]-c[0]*l[u])}return n<=0&&s<=0&&o<=0}function J6e(t){const e=t.length;return e>2&&Hf(t[0],t[e-1])}function w3t(t){if("rings"in t)for(const e of t.rings)J6e(e)||e.push(e[0].slice())}function x3t(t){if(!t||t.length<3)return 0;let e=0;const r=t.length-1;for(let i=0;i{let a=s[2]-o[2];return a===0&&e&&(a=s[4]-o[4]),a}),i.length&&(r[0]=i[0][0],r[1]=i[0][1],e&&(r[2]=i[0][3]),(r[0]n[1]||r[1]n[3]||e&&(r[2]n[5]))&&(r.length=0)),!r.length){const s=t[0]&&t[0].length?e8e(t[0],e):null;if(!s)return null;r[0]=s[0],r[1]=s[1],e&&s.length>2&&(r[2]=s[2])}return r}function Cye(t,e,r){let i=0,n=0,s=0,o=0,a=0;const l=t.length?t[0][0]:0,c=t.length?t[0][1]:0,u=t.length&&e?t[0][2]:0;for(let p=0;p2&&y.length>2){const k=b-u,V=C-u,z=x*V-R*k;s+=(k+V)*z,a+=z}_r[1]&&(r[1]=_),vr[3]&&(r[3]=v),e&&(br[5]&&(r[5]=b))}if(o>0&&(o*=-1),a>0&&(a*=-1),!o)return null;o*=.5,a*=.5;const d=[i/(6*o)+l,n/(6*o)+c,o];return e&&(r[4]===r[5]||a===0?(d[3]=(r[4]+r[5])/2,d[4]=0):(d[3]=s/(6*a)+u,d[4]=a)),d}function e8e(t,e){const r=e?[0,0,0]:[0,0],i=e?[0,0,0]:[0,0];let n=0,s=0,o=0,a=0;for(let l=0,c=t.length;l2&&d.length>2&&(r[2]=u[2],i[2]=d[2]);const p=h6(r,i);if(p){n+=p;const m=bye(u,d);s+=p*m[0],o+=p*m[1],e&&m.length>2&&(a+=p*m[2])}}}return n>0?e?[s/n,o/n,a/n]:[s/n,o/n]:t.length?t[0]:null}function t8e(t){const{hasZ:e,numPaths:r}=t;if(r===0)return null;const i=[],n=[],s=e?[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];for(t.reset();t.nextPath();){const o=Cye(Z6e(t),t.hasZ,s);o&&n.push(o)}if(n.sort((o,a)=>{let l=o[2]-a[2];return l===0&&e&&(l=o[4]-a[4]),l}),n.length&&(i[0]=n[0][0],i[1]=n[0][1],e&&(i[2]=n[0][3]),(i[0]s[1]||i[1]s[3]||e&&(i[2]s[5]))&&(i.length=0)),!i.length){t.reset(),t.nextPath();const o=t.numPoints?r8e(t):null;if(!o)return null;i[0]=o[0],i[1]=o[1],e&&o.length>2&&(i[2]=o[2])}return i}function r8e(t){const{hasZ:e}=t,r=e?[0,0,0]:[0,0],i=e?[0,0,0]:[0,0];let n=0,s=0,o=0,a=0;if(t.nextPoint()){let l=t.x,c=t.y,u=t.z;for(;t.nextPoint();){const d=t.x,p=t.y,m=t.z;r[0]=l,r[1]=c,i[0]=d,i[1]=p,e&&(r[2]=u,i[2]=m);const y=h6(r,i);if(y){n+=y;const _=bye(r,i);s+=y*_[0],o+=y*_[1],e&&_.length>2&&(a+=y*_[2])}l=d,c=p,u=m}}return n>0?e?[s/n,o/n,a/n]:[s/n,o/n]:t.numPoints?(t.seekPathStart(),t.nextPoint(),[t.x,t.y]):null}const i8e=1e-6;function S3t(t){let e=0;for(t.reset();t.nextPath();)e+=Sye(t);if(et[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function S_(t,e,r){if(e!=null)if("length"in e)n7(e)?(r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r[2]=Math.max(t[2],e[2]),r[3]=Math.max(t[3],e[3])):e.length!==2&&e.length!==3||(r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r[2]=Math.max(t[2],e[0]),r[3]=Math.max(t[3],e[1]));else switch(e.type){case"extent":r[0]=Math.min(t[0],e.xmin),r[1]=Math.min(t[1],e.ymin),r[2]=Math.max(t[2],e.xmax),r[3]=Math.max(t[3],e.ymax);break;case"point":r[0]=Math.min(t[0],e.x),r[1]=Math.min(t[1],e.y),r[2]=Math.max(t[2],e.x),r[3]=Math.max(t[3],e.y)}else Ug(r,t)}function KU(t,e,r=t){const i=e.length;let n=t[0],s=t[1],o=t[2],a=t[3];for(let l=0;l=t[2]?0:t[2]-t[0]}function lp(t){return t[1]>=t[3]?0:t[3]-t[1]}function Oye(t){return nu(t)*lp(t)}function vY(t,e=[0,0]){return e[0]=(t[0]+t[2])/2,e[1]=(t[1]+t[3])/2,e}function Rye(t,e){return p6(t,e[0],e[1])}function ure(t,e){const r=e[3],i=.5*(t[0]+t[2]),n=Math.abs(e[0]-i),s=.5*(t[2]-t[0]);if(n>r+s)return!1;const o=.5*(t[1]+t[3]),a=.5*(t[3]-t[1]),l=Math.abs(e[1]-o);if(l>r+a)return!1;if(n(u-l)*v+(a-c)*b+(c*l-a*u)<0,p=d(i,o),m=d(s,o),y=d(s,n),_=d(i,n);return!(p===m&&m===y&&y===_&&_===p||as&&c>s||l>o&&u>o||l=t[0]&&r>=t[1]&&e<=t[2]&&r<=t[3]}function o8e(t,e,r){return e[0]>=t[0]-r&&e[1]>=t[1]-r&&e[0]<=t[2]+r&&e[1]<=t[3]+r}function f6(t,e){return Math.max(e[0],t[0])<=Math.min(e[2],t[2])&&Math.max(e[1],t[1])<=Math.min(e[3],t[3])}function hre(t,e){return e[0]>=t[0]&&e[2]<=t[2]&&e[1]>=t[1]&&e[3]<=t[3]}function i7(t,e,r){if(e==null)return Ug(r,t);const i=e[0],n=e[1],s=e[2],o=e[3];return r[0]=ge(t[0],i,s),r[1]=ge(t[1],n,o),r[2]=ge(t[2],i,s),r[3]=ge(t[3],n,o),r}function a8e(t,e){const r=(t[0]+t[2])/2,i=(t[1]+t[3])/2,n=Math.max(Math.abs(e[0]-r)-nu(t)/2,0),s=Math.max(Math.abs(e[1]-i)-lp(t)/2,0);return Math.sqrt(n*n+s*s)}function E4(t,e,r,i=t){return i[0]=t[0]+e,i[1]=t[1]+r,i[2]=t[2]+e,i[3]=t[3]+r,i}function Ih(t){return t?Ug(t,s7):jt(s7)}function n7(t){return t!=null&&t.length===4}function l8e(t){return!(nu(t)!==0&&isFinite(t[0])||lp(t)!==0&&isFinite(t[1]))}function Cb(t,e){return n7(t)&&n7(e)?t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]:t===e}const O3t=[-1/0,-1/0,1/0,1/0],s7=[1/0,1/0,-1/0,-1/0],c8e=[0,0,0,0];function Pye(t){return t.xmin!==void 0&&t.ymin!==void 0&&t.xmax!==void 0&&t.ymax!==void 0}function Mye(t){return t.points!==void 0}function $ye(t){return t.x!==void 0&&t.y!==void 0}function Iye(t){return t.paths!==void 0}function Lye(t){return t.rings!==void 0}function Dye(t){function e(r,i){return r==null?i:i==null?r:t(r,i)}return e}const t_=Dye(Math.min),r_=Dye(Math.max);function R3t(t,e){return Iye(e)?bS(t,e.paths,!1,!1):Lye(e)?bS(t,e.rings,!1,!1):Mye(e)?bY(t,e.points,!1,!1,!1,!1):Pye(e)?Nye(t,e):($ye(e)&&(t[0]=e.x,t[1]=e.y,t[2]=e.x,t[3]=e.y),t)}function P3t(t){let e,r,i,n;for(t.reset(),e=i=1/0,r=n=-1/0;t.nextPath();){const s=u8e(t);e=Math.min(s[0],e),i=Math.min(s[1],i),r=Math.max(s[2],r),n=Math.max(s[3],n)}return jt([e,i,r,n])}function u8e(t){let e,r,i,n;for(e=i=1/0,r=n=-1/0;t.nextPoint();)e=Math.min(t.x,e),i=Math.min(t.y,i),r=Math.max(t.x,r),n=Math.max(t.y,n);return jt([e,i,r,n])}function M3t(t,e){return Iye(e)?bS(t,e.paths,!0,!1):Lye(e)?bS(t,e.rings,!0,!1):Mye(e)?bY(t,e.points,!0,!1,!0,!1):Pye(e)?Nye(t,e,!0,!1,!0,!1):($ye(e)&&(t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.x,t[4]=e.y,t[5]=e.z),t)}function bS(t,e,r,i){const n=r?3:2;if(!e.length||!e[0].length)return null;let s,o,a,l,[c,u]=e[0][0],[d,p]=e[0][0];for(let m=0;m2){const T=v[2];s=t_(s,T),o=r_(o,T)}if(i&&v.length>n){const T=v[n];a=t_(s,T),l=r_(o,T)}}}return r?i?(t[0]=c,t[1]=u,t[2]=s,t[3]=a,t[4]=d,t[5]=p,t[6]=o,t[7]=l,t.length=8,t):(t[0]=c,t[1]=u,t[2]=s,t[3]=d,t[4]=p,t[5]=o,t.length=6,t):i?(t[0]=c,t[1]=u,t[2]=a,t[3]=d,t[4]=p,t[5]=l,t.length=6,t):(t[0]=c,t[1]=u,t[2]=d,t[3]=p,t.length=4,t)}function Nye(t,e,r,i,n,s){const o=e.xmin,a=e.xmax,l=e.ymin,c=e.ymax;let u=e.zmin,d=e.zmax,p=e.mmin,m=e.mmax;return n?(u=u||0,d=d||0,s?(p=p||0,m=m||0,t[0]=o,t[1]=l,t[2]=u,t[3]=p,t[4]=a,t[5]=c,t[6]=d,t[7]=m,t):(t[0]=o,t[1]=l,t[2]=u,t[3]=a,t[4]=c,t[5]=d,t)):s?(p=p||0,m=m||0,t[0]=o,t[1]=l,t[2]=p,t[3]=a,t[4]=c,t[5]=m,t):(t[0]=o,t[1]=l,t[2]=a,t[3]=c,t)}function bY(t,e,r,i,n,s){const o=r?3:2,a=i&&s,l=r&&n;if(!e.length||!e[0].length)return null;let c,u,d,p,[m,y]=e[0],[_,v]=e[0];for(let b=0;b2){const A=x[2];c=t_(c,A),u=r_(u,A)}if(a&&x.length>o){const A=x[o];d=t_(c,A),p=r_(u,A)}}return n?(c=c||0,u=u||0,s?(d=d||0,p=p||0,t[0]=m,t[1]=y,t[2]=c,t[3]=d,t[4]=_,t[5]=v,t[6]=u,t[7]=p,t):(t[0]=m,t[1]=y,t[2]=c,t[3]=_,t[4]=v,t[5]=u,t)):s?(d=d||0,p=p||0,t[0]=m,t[1]=y,t[2]=d,t[3]=_,t[4]=v,t[5]=p,t):(t[0]=m,t[1]=y,t[2]=_,t[3]=v,t)}function h8e(t){return t.xmin!==void 0&&t.ymin!==void 0&&t.xmax!==void 0&&t.ymax!==void 0}function d8e(t){return t.points!==void 0}function p8e(t){return t.x!==void 0&&t.y!==void 0}function f8e(t){return t.paths!==void 0}function m8e(t){return t.rings!==void 0}const wY=[];function Fye(t,e,r,i){return{xmin:t,ymin:e,xmax:r,ymax:i}}function Uye(t,e,r,i,n,s){return{xmin:t,ymin:e,zmin:r,xmax:i,ymax:n,zmax:s}}function kye(t,e,r,i,n,s){return{xmin:t,ymin:e,mmin:r,xmax:i,ymax:n,mmax:s}}function zye(t,e,r,i,n,s,o,a){return{xmin:t,ymin:e,zmin:r,mmin:i,xmax:n,ymax:s,zmax:o,mmax:a}}function xY(t,e=!1,r=!1){return e?r?zye(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]):Uye(t[0],t[1],t[2],t[3],t[4],t[5]):r?kye(t[0],t[1],t[2],t[3],t[4],t[5]):Fye(t[0],t[1],t[2],t[3])}function $3t(t){return t?h8e(t)?t:p8e(t)?y8e(t):m8e(t)?Bye(t):f8e(t)?Vye(t):d8e(t)?g8e(t):null:null}function g8e(t){const{hasZ:e,hasM:r,points:i}=t;return xY(bY(wY,i,e??!1,r??!1),e,r)}function y8e(t){const{x:e,y:r,z:i,m:n}=t,s=n!=null;return i!=null?s?zye(e,r,i,n,e,r,i,n):Uye(e,r,i,e,r,i):s?kye(e,r,n,e,r,n):Fye(e,r,e,r)}function Bye(t){const{hasZ:e,hasM:r,rings:i}=t,n=bS(wY,i,e??!1,r??!1);return n?xY(n,e,r):null}function Vye(t){const{hasZ:e,hasM:r,paths:i}=t,n=bS(wY,i,e??!1,r??!1);return n?xY(n,e,r):null}var ZL;function dre(t){return!Array.isArray(t[0])}let qp=ZL=class extends Zg{static fromExtent(t){const e=t.clone().normalize(),r=t.spatialReference;let i=!1,n=!1;for(const o of e)o.hasZ&&(i=!0),o.hasM&&(n=!0);const s={rings:e.map(o=>{const a=[[o.xmin,o.ymin],[o.xmin,o.ymax],[o.xmax,o.ymax],[o.xmax,o.ymin],[o.xmin,o.ymin]];if(i&&o.hasZ){const l=o.zmin+.5*(o.zmax-o.zmin);for(let c=0;c2,i=s.length>3):r===void 0?r=i?s.length>3:s.length>2:i===void 0&&(i=r?s.length>3:s.length>2)),{rings:n,spatialReference:e,hasZ:r,hasM:i}}get cache(){return this.commitProperty("rings"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get centroid(){const t=K6e(this);if(!t||isNaN(t[0])||isNaN(t[1])||this.hasZ&&isNaN(t[2]))return null;const e=new ze;return e.x=t[0],e.y=t[1],e.spatialReference=this.spatialReference,this.hasZ&&(e.z=t[2]),e}get extent(){const{spatialReference:t}=this,e=Bye(this);if(!e)return null;const r=new Dr(e);return r.spatialReference=t,r}get isSelfIntersecting(){return aFe(this.rings)}writeRings(t,e){e.rings=ye(this.rings)}addRing(t){if(!t)return;const e=this.rings,r=e.length;if(dre(t)){const i=[];for(let n=0,s=t.length;nn===l&&s===c&&(o==null&&u==null||o===u)&&(a==null&&d==null||a===d);for(let n=0;nthis.hasZ?this.hasM?[r.x,r.y,r.z,r.m]:[r.x,r.y,r.z]:[r.x,r.y]):t,Tye(e,this.hasM,this.hasZ)}getPoint(t,e){if(!this._validateInputs(t,e))return null;const r=this.rings[t][e],i=this.hasZ,n=this.hasM;return i&&!n?new ze(r[0],r[1],r[2],void 0,this.spatialReference):n&&!i?new ze(r[0],r[1],void 0,r[2],this.spatialReference):i&&n?new ze(r[0],r[1],r[2],r[3],this.spatialReference):new ze(r[0],r[1],this.spatialReference)}insertPoint(t,e,r){return this._validateInputs(t,e,!0)?(vS(this,r),Array.isArray(r)||(r=r.toArray()),this.rings[t].splice(e,0,r),this.notifyChange("rings"),this):this}removePoint(t,e){if(!this._validateInputs(t,e))return null;const r=new ze(this.rings[t].splice(e,1)[0],this.spatialReference);return this.notifyChange("rings"),r}removeRing(t){if(!this._validateInputs(t,null))return null;const e=this.rings.splice(t,1)[0],r=this.spatialReference,i=e.map(n=>new ze(n,r));return this.notifyChange("rings"),i}setPoint(t,e,r){return this._validateInputs(t,e)?(vS(this,r),Array.isArray(r)||(r=r.toArray()),this.rings[t][e]=r,this.notifyChange("rings"),this):this}_validateInputs(t,e,r=!1){if(t==null||t<0||t>=this.rings.length)return!1;if(e!=null){const i=this.rings[t];if(r&&(e<0||e>i.length)||!r&&(e<0||e>=i.length))return!1}return!0}toJSON(t){return this.write({},t)}};h([f({readOnly:!0})],qp.prototype,"cache",null),h([f({readOnly:!0})],qp.prototype,"centroid",null),h([f({readOnly:!0})],qp.prototype,"extent",null),h([f({readOnly:!0})],qp.prototype,"isSelfIntersecting",null),h([f({type:[[[Number]]],json:{write:{isRequired:!0}}})],qp.prototype,"rings",void 0),h([xr("rings")],qp.prototype,"writeRings",null),qp=ZL=h([N("esri.geometry.Polygon")],qp),qp.prototype.toJSON.isDefaultToJSON=!0;const a1=qp;var o7;function _8e(t){return!Array.isArray(t[0])}let ry=o7=class extends Zg{constructor(...t){super(...t),this.paths=[],this.type="polyline"}normalizeCtorArgs(t,e){let r,i,n=null,s=null;return t&&!Array.isArray(t)?(n=t.paths??null,e||(t.spatialReference?e=t.spatialReference:t.paths||(e=t)),r=t.hasZ,i=t.hasM):n=t,n=n||[],e=e||St.WGS84,n.length&&n[0]&&n[0][0]!=null&&typeof n[0][0]=="number"&&(n=[n]),s=n[0]&&n[0][0],s&&(r===void 0&&i===void 0?(r=s.length>2,i=!1):r===void 0?r=!i&&s.length>3:i===void 0&&(i=!r&&s.length>3)),{paths:n,spatialReference:e,hasZ:r,hasM:i}}get cache(){return this.commitProperty("paths"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const{spatialReference:t}=this,e=Vye(this);if(!e)return null;const r=new Dr(e);return r.spatialReference=t,r}writePaths(t,e){e.paths=ye(this.paths)}addPath(t){if(!t)return;const e=this.paths,r=e.length;if(_8e(t)){const i=[];for(let n=0,s=t.length;nnew ze(n,r));return this.notifyChange("paths"),i}removePoint(t,e){if(!this._validateInputs(t,e))return null;const r=new ze(this.paths[t].splice(e,1)[0],this.spatialReference);return this.notifyChange("paths"),r}setPoint(t,e,r){return this._validateInputs(t,e)?(vS(this,r),Array.isArray(r)||(r=r.toArray()),this.paths[t][e]=r,this.notifyChange("paths"),this):this}_validateInputs(t,e,r=!1){if(t==null||t<0||t>=this.paths.length)return!1;if(e!=null){const i=this.paths[t];if(r&&(e<0||e>i.length)||!r&&(e<0||e>=i.length))return!1}return!0}toJSON(t){return this.write({},t)}};h([f({readOnly:!0})],ry.prototype,"cache",null),h([f({readOnly:!0})],ry.prototype,"extent",null),h([f({type:[[[Number]]],json:{write:{isRequired:!0}}})],ry.prototype,"paths",void 0),h([xr("paths")],ry.prototype,"writePaths",null),ry=o7=h([N("esri.geometry.Polyline")],ry),ry.prototype.toJSON.isDefaultToJSON=!0;const m6=ry,v8e=Oc()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),I3t=Oc()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"});function Gye(t){return t.xmin!==void 0&&t.ymin!==void 0&&t.xmax!==void 0&&t.ymax!==void 0}function TY(t){return t.points!==void 0}function SY(t){return t.x!==void 0&&t.y!==void 0}function EY(t){return t.paths!==void 0}function CY(t){return t.rings!==void 0}function oR(t){return t==null?null:t instanceof Zg?t:SY(t)?ze.fromJSON(t):EY(t)?m6.fromJSON(t):CY(t)?a1.fromJSON(t):TY(t)?yP.fromJSON(t):Gye(t)?Dr.fromJSON(t):null}function AY(t){return t?SY(t)?"esriGeometryPoint":EY(t)?"esriGeometryPolyline":CY(t)?"esriGeometryPolygon":Gye(t)?"esriGeometryEnvelope":TY(t)?"esriGeometryMultipoint":null:null}const b8e={esriGeometryPoint:ze,esriGeometryPolyline:m6,esriGeometryPolygon:a1,esriGeometryEnvelope:Dr,esriGeometryMultipoint:yP};function w8e(t){return t&&b8e[t]||null}const OY={base:Zg,key:"type",typeMap:{extent:Dr,multipoint:yP,point:ze,polyline:m6,polygon:a1}};L_(OY);let jye=0;const RY=t=>{let e=class extends t{constructor(...r){super(...r),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+jye++})}};return e=h([N("esri.core.Identifiable")],e),e},L3t=t=>{let e=class extends t{constructor(...r){super(...r),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:jye++})}};return e=h([N("esri.core.NumericIdentifiable")],e),e};let pre=class extends RY(class{}){};pre=h([N("esri.core.Identifiable")],pre);async function x8e(t){const e="portalItem"in t?t:{portalItem:t},{fromItem:r}=await ce(()=>import("./portalLayers-54553513.js"),["assets/portalLayers-54553513.js","assets/lazyLayerLoader-8b31b2e1.js","assets/layersLoader-0106cc6e.js","assets/fetchService-82a8c4d0.js","assets/jsonContext-5f3816dc.js","assets/portalItemUtils-792a27e1.js","assets/styleUtils-25825fd6.js"]);try{return await r(e)}catch(i){const n=e&&e.portalItem,s=n&&n.id||"unset",o=n&&n.portal&&n.portal.url||Jr.portalUrl;throw J.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+o+"', id: '"+s+"')",i),i}}let T8e=0,lo=class extends Bn.EventedMixin(RY(Dg)){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new Dr(-180,-90,180,90,St.WGS84),this.id=Date.now().toString(16)+"-layer-"+T8e++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=St.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const r=typeof e=="string"?{url:e}:e;return(await ce(()=>import("./arcgisLayers-23a0b701.js"),["assets/arcgisLayers-23a0b701.js","assets/fetchService-82a8c4d0.js","assets/lazyLayerLoader-8b31b2e1.js"])).fromUrl(r)}static fromPortalItem(e){return x8e(e)}initialize(){this.when().catch(e=>{Zn(e)||J.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){if(this.parent){const e=this,r=this.parent;"layers"in r&&r.layers.includes(e)?r.layers.remove(e):"tables"in r&&r.tables.includes(e)?r.tables.remove(e):"baseLayers"in r&&r.baseLayers.includes(e)?r.baseLayers.remove(e):"baseLayers"in r&&r.referenceLayers.includes(e)&&r.referenceLayers.remove(e)}}get hasAttributionData(){return this.attributionDataUrl!=null}get parsedUrl(){return Ja(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await kn(e,{query:{f:"json"},responseType:"json"})).data;throw new Y("layer:no-attribution-data","Layer does not have attribution data")}};h([f({type:String})],lo.prototype,"attributionDataUrl",void 0),h([f({type:Dr})],lo.prototype,"fullExtent",void 0),h([f({readOnly:!0})],lo.prototype,"hasAttributionData",null),h([f({type:String,clonable:!1})],lo.prototype,"id",void 0),h([f({type:Boolean,nonNullable:!0})],lo.prototype,"legendEnabled",void 0),h([f({type:["show","hide","hide-children"]})],lo.prototype,"listMode",void 0),h([f({type:Number,range:{min:0,max:1},nonNullable:!0})],lo.prototype,"opacity",void 0),h([f({clonable:!1})],lo.prototype,"parent",void 0),h([f({readOnly:!0})],lo.prototype,"parsedUrl",null),h([f({type:Boolean})],lo.prototype,"popupEnabled",void 0),h([f({type:Boolean})],lo.prototype,"attributionVisible",void 0),h([f({type:St})],lo.prototype,"spatialReference",void 0),h([f({type:String})],lo.prototype,"title",void 0),h([f({readOnly:!0,json:{read:!1}})],lo.prototype,"type",void 0),h([f()],lo.prototype,"url",void 0),h([f({type:Boolean,nonNullable:!0})],lo.prototype,"visible",void 0),lo=h([N("esri.layers.Layer")],lo);const Hye=lo;function a7(t,e,r){let i,n;if(t)for(let s=0,o=t.length;s{let e=class extends t{constructor(...r){super(...r),this.layers=new ir;const i=o=>{o.parent&&"remove"in o.parent&&o.parent.remove(o)},n=o=>{o.parent=this,this.layerAdded(o),o.type!=="elevation"&&o.type!=="base-elevation"||J.getLogger(this).error(`Layer 'title:${o.title}, id:${o.id}' of type '${o.type}' is not supported as an operational layer and will therefore be ignored.`)},s=o=>{o.parent=null,this.layerRemoved(o)};this.addHandles([this.layers.on("before-add",o=>i(o.item)),this.layers.on("after-add",o=>n(o.item)),this.layers.on("after-remove",o=>s(o.item))])}destroy(){const r=this.layers.toArray();for(const i of r)i.destroy();this.layers.destroy()}set layers(r){this._set("layers",qb(r,this._get("layers")))}add(r,i){const n=this.layers;if(i=n.getNextIndex(i),r instanceof Hye){const s=r;s.parent===this?this.reorder(s,i):n.add(s,i)}else Eu(r)?r.then(s=>{this.destroyed||this.add(s,i)}):J.getLogger(this).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(r,i){const n=this.layers;let s=n.getNextIndex(i);r.slice().forEach(o=>{o.parent!==this?(n.add(o,s),s+=1):this.reorder(o,s)})}findLayerById(r){return a7(this.layers,"id",r)}findLayerByUid(r){return a7(this.layers,"uid",r)}remove(r){return this.layers.remove(r)}removeMany(r){return this.layers.removeMany(r)}removeAll(){return this.layers.removeAll()}reorder(r,i){return this.layers.reorder(r,i)}layerAdded(r){}layerRemoved(r){}};return h([f()],e.prototype,"layers",null),e=h([N("esri.support.LayersMixin")],e),e};function l7(t,e,r){if(t)for(let i=0,n=t.length;i{let e=class extends t{constructor(...r){super(...r),this.tables=new ir,this.addHandles([this.tables.on("after-add",i=>{const n=i.item;n.parent&&n.parent!==this&&"tables"in n.parent&&n.parent.tables.remove(n),n.parent=this,n.type!=="feature"&&J.getLogger(this).error(`Layer 'title:${n.title}, id:${n.id}' of type '${n.type}' is not supported as a table and will therefore be ignored.`)}),this.tables.on("after-remove",i=>{i.item.parent=null})])}destroy(){const r=this.tables.removeAll();for(const i of r)i.destroy();this.tables.destroy()}set tables(r){this._set("tables",qb(r,this._get("tables")))}findTableById(r){return l7(this.tables,"id",r)}findTableByUid(r){return l7(this.tables,"uid",r)}};return h([f()],e.prototype,"tables",null),e=h([N("esri.support.TablesMixin")],e),e};let Xp=class extends E8e(S8e(Bn.EventedMixin(xe))){constructor(e){super(e),this.allLayers=new sR({getCollections:()=>{var r,i,n;return[(r=this.basemap)==null?void 0:r.baseLayers,(i=this.ground)==null?void 0:i.layers,this.layers,(n=this.basemap)==null?void 0:n.referenceLayers]},getChildrenFunction:r=>"layers"in r?r.layers:null}),this.allTables=q6e(this),this.basemap=null,this.editableLayers=new sR({getCollections:()=>[this.allLayers],itemFilterFunction:V6e}),this.ground=new S4,this._basemapCache=j6e()}destroy(){var e,r;this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),(e=this.ground)==null||e.destroy(),(r=this.basemap)==null||r.destroy(),H6e(this._basemapCache),this._basemapCache=null}castBasemap(e){return W6e(e,this._basemapCache)}castGround(e){return X6e(e)??this._get("ground")}findLayerById(e){return this.allLayers.find(r=>r.id===e)}findTableById(e){return this.allTables.find(r=>r.id===e)}};h([f({readOnly:!0,dependsOn:[]})],Xp.prototype,"allLayers",void 0),h([f({readOnly:!0})],Xp.prototype,"allTables",void 0),h([f({type:iR})],Xp.prototype,"basemap",void 0),h([_i("basemap")],Xp.prototype,"castBasemap",null),h([f({readOnly:!0})],Xp.prototype,"editableLayers",void 0),h([f({type:S4,nonNullable:!0})],Xp.prototype,"ground",void 0),h([_i("ground")],Xp.prototype,"castGround",null),Xp=h([N("esri.Map")],Xp);const Wye=Xp,Cu=t=>{let e=class extends t{clone(){var l;const r=sc(I_(this),"unable to clone instance of non-accessor class"),i=r.metadatas,n=r.store,s={},o=new Map;for(const c in i){const u=i[c],d=n==null?void 0:n.originOf(c),p=u.clonable;if(u.readOnly||p===!1||d!==Qr.USER&&d!==Qr.DEFAULTS&&d!==Qr.WEB_MAP&&d!==Qr.WEB_SCENE)continue;const m=this[c];let y=null;y=typeof p=="function"?p(m):p==="reference"?m:mV(m),m!=null&&y==null||(d===Qr.DEFAULTS?o.set(c,y):s[c]=y)}const a=new(Object.getPrototypeOf(this)).constructor(s);if(o.size){const c=(l=I_(a))==null?void 0:l.store;if(c)for(const[u,d]of o)c.set(u,d,Qr.DEFAULTS)}return a}};return e=h([N("esri.core.Clonable")],e),e};let c7=class extends Cu(xe){};c7=h([N("esri.core.Clonable")],c7);let F_=class{constructor(e,r){this.min=e,this.max=r,this.range=r-e}ndiff(e,r=0){return Math.ceil((e-r)/this.range)*this.range+r}_normalize(e,r,i,n=0,s=!1){return(i-=n)r&&(i-=this.ndiff(i-r)),s&&i===r&&(i=e),i+n}normalize(e,r=0,i=!1){return this._normalize(this.min,this.max,e,r,i)}clamp(e,r=0){return ge(e-r,this.min,this.max)+r}monotonic(e,r,i){return ee&&iMY.normalize(Ud(t)))],Nm.prototype,"heading",void 0),h([f({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),_i(t=>ge(Ud(t),-180,180))],Nm.prototype,"tilt",void 0),h([f({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Nm.prototype,"fov",void 0),Nm=h([N("esri.Camera")],Nm);const vu=Nm;var wS;function A8e(t,e){switch(t.type){case"range":{const r="range"in t?t.range[0]:t.minValue,i="range"in t?t.range[1]:t.maxValue;if(r!=null&&+ei)return wS.VALUE_OUT_OF_RANGE;break}case"coded-value":case"codedValue":if(t.codedValues==null||t.codedValues.every(r=>r==null||r.code!==e))return wS.INVALID_CODED_VALUE}return null}(function(t){t.VALUE_OUT_OF_RANGE="domain-validation-error::value-out-of-range",t.INVALID_CODED_VALUE="domain-validation-error::invalid-coded-value"})(wS||(wS={}));const O8e=J.getLogger("esri.support.arcadeOnDemand");let ek;function $Y(){return ek||(ek=(async()=>{const t=await ce(()=>import("./arcadeUtils-b902d678.js").then(e=>e.az),["assets/arcadeUtils-b902d678.js","assets/arcadeTimeUtils-e1438cc8.js","assets/executionError-c92d3b85.js","assets/FieldsIndex-f79a8f26.js","assets/number-e5825aa4.js","assets/hash-6f442295.js"]);return{arcade:t.arcade,arcadeUtils:t,Dictionary:t.Dictionary,Feature:t.arcadeFeature}})()),ek}const R8e=(t,e,r)=>IY.create(t,e,r,null,["$feature"],[]),P8e=(t,e,r)=>IY.create(t,e,r,null,["$feature","$view"],[]),B3t=(t,e,r,i)=>IY.create(t,e,r,i,["$feature","$view"],[]);let IY=class qye{constructor(e,r,i,n,s,o,a){this.services=null,this.script=e,this.evaluate=n;const l=Array.isArray(o)?o:o.fields;this.fields=l,this._syntaxTree=i,this._arcade=r,this._arcadeFeature=s,this._spatialReference=a,this._referencesGeometry=r.scriptTouchesGeometry(this._syntaxTree),this._referencesScale=this._arcade.referencesMember(this._syntaxTree,"scale")}static async create(e,r,i,n,s,o){const{arcade:a,Feature:l,Dictionary:c}=await $Y(),u=St.fromJSON(r);let d;try{d=a.parseScript(e,o)}catch(P){return O8e.error(new Y("arcade-bad-expression","Failed to parse arcade script",{script:e,error:P})),null}const p=s.reduce((P,F)=>({...P,[F]:null}),{});let m=null;n!=null&&(m=new c(n),m.immutable=!0,p.$config=null);const y=a.scriptUsesGeometryEngine(d),_=y&&a.enableGeometrySupport(),v=a.scriptUsesFeatureSet(d)&&a.enableFeatureSetSupport(),b=a.scriptIsAsync(d),x=b&&a.enableAsyncSupport(),T={vars:p,spatialReference:u,useAsync:!!x};await Promise.all([_,v,x]);const S=new Set;await a.loadDependentModules(S,d,null,b,y);const A=new c;A.immutable=!1,A.setField("scale",0);const C=a.compileScript(d,T),R=(P,F)=>("$view"in P&&P.$view&&(A.setField("scale",typeof P.$view=="object"&&"scale"in P.$view?P.$view.scale:void 0),P.$view=A),m&&(P.$config=m),C({vars:P,spatialReference:u,services:F}));return new qye(e,a,d,R,new l,i,u)}repurposeFeature(e){return e.geometry&&!e.geometry.spatialReference&&(e.geometry.spatialReference=this._spatialReference),this._arcadeFeature.repurposeFromGraphicLikeObject(e.geometry,e.attributes,{fields:this.fields}),this._arcadeFeature}referencesGeometry(){return this._referencesGeometry}referencesScale(){return this._referencesScale}};const M8e=/^([0-9_])/,$8e=/[^a-z0-9_\u0080-\uffff]+/gi;function V3t(t){return t==null?null:t.trim().replaceAll($8e,"_").replace(M8e,"F$1")||null}const I8e=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],L8e=["field","normalizationField"];function G3t(t,e){if(t!=null&&e!=null){for(const r of Array.isArray(t)?t:[t])if(fre(I8e,r,e),"visualVariables"in r&&r.visualVariables)for(const i of r.visualVariables)fre(L8e,i,e)}}function fre(t,e,r){if(t)for(const i of t){const n=uP(i,e),s=n&&typeof n!="function"&&r.get(n);s&&Pw(i,s.name,e)}}function j3t(t,e){var r;if(t!=null&&((r=e==null?void 0:e.fields)!=null&&r.length))if("startField"in t){const i=e.get(t.startField),n=e.get(t.endField);t.startField=(i==null?void 0:i.name)??null,t.endField=(n==null?void 0:n.name)??null}else{const i=e.get(t.startTimeField),n=e.get(t.endTimeField);t.startTimeField=(i==null?void 0:i.name)??null,t.endTimeField=(n==null?void 0:n.name)??null}}const tk=new Set;function Xye(t,e){return t&&e?(tk.clear(),aR(tk,t,e),Array.from(tk).sort()):[]}function aR(t,e,r){var i;if(r)if((i=e==null?void 0:e.fields)!=null&&i.length)if(r.includes("*"))for(const{name:n}of e.fields)t.add(n);else for(const n of r)rw(t,e,n);else{if(r.includes("*"))return t.clear(),void t.add("*");for(const n of r)n!=null&&t.add(n)}}function rw(t,e,r){if(typeof r=="string")if(e){const i=e.get(r);i&&t.add(i.name)}else t.add(r)}function H3t(t,e){return e==null||t==null?[]:e.includes("*")?(t.fields??[]).map(r=>r.name):e}async function kg(t,e,r){var s;if(!r)return;const{arcadeUtils:i}=await $Y(),n=i.extractFieldNames(r,(s=e==null?void 0:e.fields)==null?void 0:s.map(o=>o.name));for(const o of n)rw(t,e,o)}async function Yye(t,e,r){if(r&&r!=="1=1"){const{WhereClause:i}=await ce(()=>import("./WhereClause-c86b9974.js").then(s=>s.W),["assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js"]),n=i.create(r,e);if(!n.isStandardized)throw new Y("fieldUtils:collectFilterFields","Where clause is not standardized",{where:r});aR(t,e,n.fieldNames)}}function W3t({displayField:t,fields:e}){return t||(e&&e.length?rk(e,"name-or-title")||rk(e,"unique-identifier")||rk(e,"type-or-category")||D8e(e):null)}function D8e(t){for(const e of t){if(!e||!e.name)continue;const r=e.name.toLowerCase();if(r.includes("name")||r.includes("title"))return e.name}return null}function rk(t,e){for(const r of t)if(r&&r.valueType&&r.valueType===e)return r.name;return null}async function q3t(t,e){var i;if(!e)return;const r=(i=e.elevationInfo)==null?void 0:i.featureExpressionInfo;return r?r.collectRequiredFields(t,e.fieldsIndex):void 0}function N8e(t,e,r){r.onStatisticExpression?kg(t,e,r.onStatisticExpression.expression):t.add(r.onStatisticField)}async function X3t(t,e,r){if(!e||!r||!("fields"in r))return;const i=[],n=r.popupTemplate;i.push(F8e(t,e,n)),r.fields&&i.push(...r.fields.map(async s=>N8e(t,e.fieldsIndex,s))),await Promise.all(i)}async function F8e(t,e,r){const i=[];r!=null&&r.expressionInfos&&i.push(...r.expressionInfos.map(s=>kg(t,e.fieldsIndex,s.expression)));const n=r==null?void 0:r.content;if(Array.isArray(n))for(const s of n)s.type==="expression"&&s.expressionInfo&&i.push(kg(t,e.fieldsIndex,s.expressionInfo.expression));await Promise.all(i)}async function Y3t(t,e,r){e&&(e.timeInfo&&r!=null&&r.timeExtent&&aR(t,e.fieldsIndex,[e.timeInfo.startField,e.timeInfo.endField]),e.floorInfo&&aR(t,e.fieldsIndex,[e.floorInfo.floorField]),r!=null&&r.where!=null&&await Yye(t,e.fieldsIndex,r.where))}async function Z3t(t,e,r){e&&r&&await Promise.all(r.map(i=>U8e(t,e,i)))}async function U8e(t,e,r){e&&r&&(r.valueExpression?await kg(t,e.fieldsIndex,r.valueExpression):r.field&&rw(t,e.fieldsIndex,r.field))}function Q3t(t){return t?Xye(t.fieldsIndex,Zye(t)):[]}function k8e(t){if(!t)return[];const e=t.geometryFieldsInfo;return e?Xye(t.fieldsIndex,[e.shapeAreaField,e.shapeLengthField]):[]}const z8e=["oid","global-id","guid"],B8e=["oid","global-id"],V8e=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/shape/i,/perimeter/i,/objectid/i,/_i$/i];function G8e(t){const e=new Set;Qye(t).forEach(i=>e.add(i)),k8e(t).forEach(i=>e.add(i.toLowerCase()));const r=t&&"infoFor3D"in t?t.infoFor3D:void 0;return r&&(Object.values(r.assetMapFieldRoles).forEach(i=>e.add(i.toLowerCase())),Object.values(r.transformFieldRoles).forEach(i=>e.add(i.toLowerCase()))),Array.from(e)}function Zye(t){if(!t)return[];const e="editFieldsInfo"in t&&t.editFieldsInfo;if(!e)return[];const{creationDateField:r,creatorField:i,editDateField:n,editorField:s}=e;return[r,i,n,s].filter(Boolean)}function Qye(t){return Zye(t).map(e=>e.toLowerCase())}function J3t(t,e){var r;return t.editable&&!z8e.includes(t.type)&&!Qye(e).includes(((r=t.name)==null?void 0:r.toLowerCase())??"")}function K3t(t,e){var i;const r=((i=t.name)==null?void 0:i.toLowerCase())??"";return!((e==null?void 0:e.objectIdField)!=null&&r===e.objectIdField.toLowerCase()||(e==null?void 0:e.globalIdField)!=null&&r===e.globalIdField.toLowerCase()||G8e(e).includes(r)||B8e.includes(t.type)||V8e.some(n=>n.test(r)))}async function eAt(t,e){const{labelingInfo:r,fieldsIndex:i}=e;r&&r.length&&await Promise.all(r.map(n=>j8e(t,i,n)))}async function j8e(t,e,r){if(!r)return;const i=r.getLabelExpression(),n=r.where;if(i.type==="arcade")await kg(t,e,i.expression);else{const s=i.expression.match(/{[^}]*}/g);s&&s.forEach(o=>{rw(t,e,o.slice(1,-1))})}await Yye(t,e,n)}function tAt(t){const e=t.defaultValue;return e!==void 0&&e_e(t,e)?e:t.nullable?null:void 0}function Jye(t){return typeof t=="number"&&!isNaN(t)&&isFinite(t)}function H8e(t){return t===null||Jye(t)}const LY="isInteger"in Number?Number.isInteger:t=>typeof t=="number"&&isFinite(t)&&Math.floor(t)===t;function W8e(t){return t===null||LY(t)}function Kye(t){return t!=null&&typeof t=="string"}function q8e(t){return t===null||Kye(t)}function X8e(){return!0}function e_e(t,e){let r;switch(t.type){case"date":case"integer":case"long":case"small-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":r=t.nullable?W8e:LY;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":r=t.nullable?H8e:Jye;break;case"string":case"esriFieldTypeString":r=t.nullable?q8e:Kye;break;default:r=X8e}return arguments.length===1?r:r(e)}const Y8e=["integer","small-integer","single","double"],Z8e=new Set([...Y8e,"esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble"]),Q8e=["date","date-only","time-only","timestamp-offset"],J8e=new Set([...Q8e,"esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function t_e(t){return t!=null&&Z8e.has(t.type)}function rAt(t){return t!=null&&(t.type==="string"||t.type==="esriFieldTypeString")}function iAt(t){return t!=null&&J8e.has(t.type)}var C4,A4;function nAt(t){return t==null||typeof t=="number"&&isNaN(t)?null:t}function sAt(t,e){return t==null||t.nullable&&e===null?null:t_e(t)&&!K8e(t.type,Number(e))?C4.OUT_OF_RANGE:e_e(t,e)?t.domain?A8e(t.domain,e):null:A4.INVALID_TYPE}function K8e(t,e){const r=typeof t=="string"?r_e(t):t;if(!r)return!1;const i=r.min,n=r.max;return r.isInteger?LY(e)&&e>=i&&e<=n:e>=i&&e<=n}function r_e(t){switch(t){case"esriFieldTypeSmallInteger":case"small-integer":return eUe;case"esriFieldTypeInteger":case"integer":return tUe;case"esriFieldTypeBigInteger":case"big-integer":return rUe;case"esriFieldTypeSingle":case"single":return iUe;case"esriFieldTypeDouble":case"double":return nUe}}(function(t){t.OUT_OF_RANGE="numeric-range-validation-error::out-of-range"})(C4||(C4={})),function(t){t.INVALID_TYPE="type-validation-error::invalid-type"}(A4||(A4={}));const eUe={min:-32768,max:32767,isInteger:!0},tUe={min:-2147483648,max:2147483647,isInteger:!0},rUe={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0},iUe={min:-34e37,max:12e37,isInteger:!1},nUe={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1};function oAt(t,e,r){switch(t){case wS.INVALID_CODED_VALUE:return`Value ${r} is not in the coded domain - field: ${e.name}, domain: ${JSON.stringify(e.domain)}`;case wS.VALUE_OUT_OF_RANGE:return`Value ${r} is out of the range of valid values - field: ${e.name}, domain: ${JSON.stringify(e.domain)}`;case A4.INVALID_TYPE:return`Value ${r} is not a valid value for the field type - field: ${e.name}, type: ${e.type}, nullable: ${e.nullable}`;case C4.OUT_OF_RANGE:{const{min:i,max:n}=r_e(e.type);return`Value ${r} is out of range for the number type - field: ${e.name}, type: ${e.type}, value range is ${i} to ${n}`}}}function aAt(t,e){return!sUe(t,e,null)}function sUe(t,e,r){if(!e||!e.attributes||!t){if(r!=null)for(const s of t??[])r.add(s);return!0}const i=e.attributes;let n=!1;for(const s of t)if(!(s in i)){if(n=!0,r==null)break;r.add(s)}return n}function lAt(t){return!!t&&["raster.itempixelvalue","raster.servicepixelvalue"].some(e=>t.toLowerCase().startsWith(e))}let QL=class extends ke{constructor(e){super(e),this.type=null}};h([f({type:["attachments","custom","fields","media","text","expression","relationship"],readOnly:!0,json:{read:!1,write:!0}})],QL.prototype,"type",void 0),QL=h([N("esri.popup.content.Content")],QL);const l1=QL;var u7;let lv=u7=class extends l1{constructor(t){super(t),this.description=null,this.displayType="auto",this.title=null,this.type="attachments"}clone(){return new u7({description:this.description,displayType:this.displayType,title:this.title})}};h([f({type:String,json:{write:!0}})],lv.prototype,"description",void 0),h([f({type:["auto","preview","list"],json:{write:!0}})],lv.prototype,"displayType",void 0),h([f({type:String,json:{write:!0}})],lv.prototype,"title",void 0),h([f({type:["attachments"],readOnly:!0,json:{read:!1,write:!0}})],lv.prototype,"type",void 0),lv=u7=h([N("esri.popup.content.AttachmentsContent")],lv);const O4=lv;var h7;let cv=h7=class extends l1{constructor(t){super(t),this.creator=null,this.destroyer=null,this.outFields=null,this.type="custom"}clone(){return new h7({creator:this.creator,destroyer:this.destroyer,outFields:Array.isArray(this.outFields)?ye(this.outFields):null})}};h([f()],cv.prototype,"creator",void 0),h([f()],cv.prototype,"destroyer",void 0),h([f()],cv.prototype,"outFields",void 0),h([f({type:["custom"],readOnly:!0})],cv.prototype,"type",void 0),cv=h7=h([N("esri.popup.content.CustomContent")],cv);const oUe=cv;var d7;let l2=d7=class extends ke{constructor(t){super(t),this.title=null,this.expression=null,this.returnType="dictionary"}clone(){return new d7({title:this.title,expression:this.expression})}};h([f({type:String,json:{write:!0}})],l2.prototype,"title",void 0),h([f({type:String,json:{write:!0}})],l2.prototype,"expression",void 0),h([f({type:["dictionary"],readOnly:!0,json:{read:!1,write:!0}})],l2.prototype,"returnType",void 0),l2=d7=h([N("esri.popup.ElementExpressionInfo")],l2);const aUe=l2;var p7;let h3=p7=class extends l1{constructor(t){super(t),this.expressionInfo=null,this.type="expression"}clone(){var t;return new p7({expressionInfo:(t=this.expressionInfo)==null?void 0:t.clone()})}};h([f({type:aUe,json:{write:!0}})],h3.prototype,"expressionInfo",void 0),h([f({type:["expression"],readOnly:!0,json:{read:!1,write:!0}})],h3.prototype,"type",void 0),h3=p7=h([N("esri.popup.content.ExpressionContent")],h3);const DY=h3;class Iw extends Error{}class lUe extends Iw{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class cUe extends Iw{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class uUe extends Iw{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class d3 extends Iw{}class i_e extends Iw{constructor(e){super(`Invalid unit ${e}`)}}class ah extends Iw{}class x0 extends Iw{constructor(){super("Zone is an abstract class")}}const je="numeric",cp="short",hu="long",R4={year:je,month:je,day:je},n_e={year:je,month:cp,day:je},hUe={year:je,month:cp,day:je,weekday:cp},s_e={year:je,month:hu,day:je},o_e={year:je,month:hu,day:je,weekday:hu},a_e={hour:je,minute:je},l_e={hour:je,minute:je,second:je},c_e={hour:je,minute:je,second:je,timeZoneName:cp},u_e={hour:je,minute:je,second:je,timeZoneName:hu},h_e={hour:je,minute:je,hourCycle:"h23"},d_e={hour:je,minute:je,second:je,hourCycle:"h23"},p_e={hour:je,minute:je,second:je,hourCycle:"h23",timeZoneName:cp},f_e={hour:je,minute:je,second:je,hourCycle:"h23",timeZoneName:hu},m_e={year:je,month:je,day:je,hour:je,minute:je},g_e={year:je,month:je,day:je,hour:je,minute:je,second:je},y_e={year:je,month:cp,day:je,hour:je,minute:je},__e={year:je,month:cp,day:je,hour:je,minute:je,second:je},dUe={year:je,month:cp,day:je,weekday:cp,hour:je,minute:je},v_e={year:je,month:hu,day:je,hour:je,minute:je,timeZoneName:cp},b_e={year:je,month:hu,day:je,hour:je,minute:je,second:je,timeZoneName:cp},w_e={year:je,month:hu,day:je,weekday:hu,hour:je,minute:je,timeZoneName:hu},x_e={year:je,month:hu,day:je,weekday:hu,hour:je,minute:je,second:je,timeZoneName:hu};class _P{get type(){throw new x0}get name(){throw new x0}get ianaName(){return this.name}get isUniversal(){throw new x0}offsetName(e,r){throw new x0}formatOffset(e,r){throw new x0}offset(e){throw new x0}equals(e){throw new x0}get isValid(){throw new x0}}let ik=null;class g6 extends _P{static get instance(){return ik===null&&(ik=new g6),ik}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:r,locale:i}){return S_e(e,r,i)}formatOffset(e,r){return WA(this.offset(e),r)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let JL={};function pUe(t){return JL[t]||(JL[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),JL[t]}const fUe={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function mUe(t,e){const r=t.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,n,s,o,a,l,c,u]=i;return[o,n,s,a,l,c,u]}function gUe(t,e){const r=t.formatToParts(e),i=[];for(let n=0;n=0?y:1e3+y,(p-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let mre={};function yUe(t,e={}){const r=JSON.stringify([t,e]);let i=mre[r];return i||(i=new Intl.ListFormat(t,e),mre[r]=i),i}let f7={};function m7(t,e={}){const r=JSON.stringify([t,e]);let i=f7[r];return i||(i=new Intl.DateTimeFormat(t,e),f7[r]=i),i}let g7={};function _Ue(t,e={}){const r=JSON.stringify([t,e]);let i=g7[r];return i||(i=new Intl.NumberFormat(t,e),g7[r]=i),i}let y7={};function vUe(t,e={}){const{base:r,...i}=e,n=JSON.stringify([t,i]);let s=y7[n];return s||(s=new Intl.RelativeTimeFormat(t,e),y7[n]=s),s}let p3=null;function bUe(){return p3||(p3=new Intl.DateTimeFormat().resolvedOptions().locale,p3)}function wUe(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const r=t.indexOf("-u-");if(r===-1)return[t];{let i,n;try{i=m7(t).resolvedOptions(),n=t}catch{const l=t.substring(0,r);i=m7(l).resolvedOptions(),n=l}const{numberingSystem:s,calendar:o}=i;return[n,s,o]}}function xUe(t,e,r){return(r||e)&&(t.includes("-u-")||(t+="-u"),r&&(t+=`-ca-${r}`),e&&(t+=`-nu-${e}`)),t}function TUe(t){const e=[];for(let r=1;r<=12;r++){const i=dr.utc(2016,r,1);e.push(t(i))}return e}function SUe(t){const e=[];for(let r=1;r<=7;r++){const i=dr.utc(2016,11,13+r);e.push(t(i))}return e}function jM(t,e,r,i,n){const s=t.listingMode(r);return s==="error"?null:s==="en"?i(e):n(e)}function EUe(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class CUe{constructor(e,r,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:n,floor:s,...o}=i;if(!r||Object.keys(o).length>0){const a={useGrouping:!1,...i};i.padTo>0&&(a.minimumIntegerDigits=i.padTo),this.inf=_Ue(e,a)}}format(e){if(this.inf){const r=this.floor?Math.floor(e):e;return this.inf.format(r)}else{const r=this.floor?Math.floor(e):FY(e,3);return Gs(r,this.padTo)}}}class AUe{constructor(e,r,i){this.opts=i,this.originalZone=void 0;let n;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),a=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&zg.create(a).valid?(n=a,this.dt=e):(n="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||n,this.dtf=m7(r,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(r=>{if(r.type==="timeZoneName"){const i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:i}}else return r}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class OUe{constructor(e,r,i){this.opts={style:"long",...i},!r&&T_e()&&(this.rtf=vUe(e,i))}format(e,r){return this.rtf?this.rtf.format(e,r):HUe(r,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,r){return this.rtf?this.rtf.formatToParts(e,r):[]}}class En{static fromOpts(e){return En.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,r,i,n=!1){const s=e||zs.defaultLocale,o=s||(n?"en-US":bUe()),a=r||zs.defaultNumberingSystem,l=i||zs.defaultOutputCalendar;return new En(o,a,l,s)}static resetCache(){p3=null,f7={},g7={},y7={}}static fromObject({locale:e,numberingSystem:r,outputCalendar:i}={}){return En.create(e,r,i)}constructor(e,r,i,n){const[s,o,a]=wUe(e);this.locale=s,this.numberingSystem=r||o||null,this.outputCalendar=i||a||null,this.intl=xUe(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=EUe(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&r?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:En.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,r=!1,i=!0){return jM(this,e,i,A_e,()=>{const n=r?{month:e,day:"numeric"}:{month:e},s=r?"format":"standalone";return this.monthsCache[s][e]||(this.monthsCache[s][e]=TUe(o=>this.extract(o,n,"month"))),this.monthsCache[s][e]})}weekdays(e,r=!1,i=!0){return jM(this,e,i,P_e,()=>{const n=r?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=r?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=SUe(o=>this.extract(o,n,"weekday"))),this.weekdaysCache[s][e]})}meridiems(e=!0){return jM(this,void 0,e,()=>M_e,()=>{if(!this.meridiemCache){const r={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[dr.utc(2016,11,13,9),dr.utc(2016,11,13,19)].map(i=>this.extract(i,r,"dayperiod"))}return this.meridiemCache})}eras(e,r=!0){return jM(this,e,r,$_e,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[dr.utc(-40,1,1),dr.utc(2017,1,1)].map(n=>this.extract(n,i,"era"))),this.eraCache[e]})}extract(e,r,i){const n=this.dtFormatter(e,r),s=n.formatToParts(),o=s.find(a=>a.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new CUe(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,r={}){return new AUe(e,this.intl,r)}relFormatter(e={}){return new OUe(this.intl,this.isEnglish(),e)}listFormatter(e={}){return yUe(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let nk=null;class Xa extends _P{static get utcInstance(){return nk===null&&(nk=new Xa(0)),nk}static instance(e){return e===0?Xa.utcInstance:new Xa(e)}static parseSpecifier(e){if(e){const r=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new Xa(_6(r[1],r[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${WA(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${WA(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,r){return WA(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class RUe extends _P{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function By(t,e){if(Zr(t)||t===null)return e;if(t instanceof _P)return t;if(PUe(t)){const r=t.toLowerCase();return r==="default"?e:r==="local"||r==="system"?g6.instance:r==="utc"||r==="gmt"?Xa.utcInstance:Xa.parseSpecifier(r)||zg.create(t)}else return Ab(t)?Xa.instance(t):typeof t=="object"&&t.offset&&typeof t.offset=="number"?t:new RUe(t)}let gre=()=>Date.now(),yre="system",_re=null,vre=null,bre=null,wre=60,xre;class zs{static get now(){return gre}static set now(e){gre=e}static set defaultZone(e){yre=e}static get defaultZone(){return By(yre,g6.instance)}static get defaultLocale(){return _re}static set defaultLocale(e){_re=e}static get defaultNumberingSystem(){return vre}static set defaultNumberingSystem(e){vre=e}static get defaultOutputCalendar(){return bre}static set defaultOutputCalendar(e){bre=e}static get twoDigitCutoffYear(){return wre}static set twoDigitCutoffYear(e){wre=e%100}static get throwOnInvalid(){return xre}static set throwOnInvalid(e){xre=e}static resetCaches(){En.resetCache(),zg.resetCache()}}function Zr(t){return typeof t>"u"}function Ab(t){return typeof t=="number"}function y6(t){return typeof t=="number"&&t%1===0}function PUe(t){return typeof t=="string"}function MUe(t){return Object.prototype.toString.call(t)==="[object Date]"}function T_e(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function $Ue(t){return Array.isArray(t)?t:[t]}function Tre(t,e,r){if(t.length!==0)return t.reduce((i,n)=>{const s=[e(n),n];return i&&r(i[0],s[0])===i[0]?i:s},null)[1]}function IUe(t,e){return e.reduce((r,i)=>(r[i]=t[i],r),{})}function xS(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function fg(t,e,r){return y6(t)&&t>=e&&t<=r}function LUe(t,e){return t-e*Math.floor(t/e)}function Gs(t,e=2){const r=t<0;let i;return r?i="-"+(""+-t).padStart(e,"0"):i=(""+t).padStart(e,"0"),i}function Ry(t){if(!(Zr(t)||t===null||t===""))return parseInt(t,10)}function T1(t){if(!(Zr(t)||t===null||t===""))return parseFloat(t)}function NY(t){if(!(Zr(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function FY(t,e,r=!1){const i=10**e;return(r?Math.trunc:Math.round)(t*i)/i}function vP(t){return t%4===0&&(t%100!==0||t%400===0)}function HA(t){return vP(t)?366:365}function P4(t,e){const r=LUe(e-1,12)+1,i=t+(e-r)/12;return r===2?vP(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function UY(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function M4(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,r=t-1,i=(r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400))%7;return e===4||i===3?53:52}function _7(t){return t>99?t:t>zs.twoDigitCutoffYear?1900+t:2e3+t}function S_e(t,e,r,i=null){const n=new Date(t),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},a=new Intl.DateTimeFormat(r,o).formatToParts(n).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function _6(t,e){let r=parseInt(t,10);Number.isNaN(r)&&(r=0);const i=parseInt(e,10)||0,n=r<0||Object.is(r,-0)?-i:i;return r*60+n}function E_e(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new ah(`Invalid unit value ${t}`);return e}function $4(t,e){const r={};for(const i in t)if(xS(t,i)){const n=t[i];if(n==null)continue;r[e(i)]=E_e(n)}return r}function WA(t,e){const r=Math.trunc(Math.abs(t/60)),i=Math.trunc(Math.abs(t%60)),n=t>=0?"+":"-";switch(e){case"short":return`${n}${Gs(r,2)}:${Gs(i,2)}`;case"narrow":return`${n}${r}${i>0?`:${i}`:""}`;case"techie":return`${n}${Gs(r,2)}${Gs(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function v6(t){return IUe(t,["hour","minute","second","millisecond"])}const DUe=["January","February","March","April","May","June","July","August","September","October","November","December"],C_e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],NUe=["J","F","M","A","M","J","J","A","S","O","N","D"];function A_e(t){switch(t){case"narrow":return[...NUe];case"short":return[...C_e];case"long":return[...DUe];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const O_e=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],R_e=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],FUe=["M","T","W","T","F","S","S"];function P_e(t){switch(t){case"narrow":return[...FUe];case"short":return[...R_e];case"long":return[...O_e];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const M_e=["AM","PM"],UUe=["Before Christ","Anno Domini"],kUe=["BC","AD"],zUe=["B","A"];function $_e(t){switch(t){case"narrow":return[...zUe];case"short":return[...kUe];case"long":return[...UUe];default:return null}}function BUe(t){return M_e[t.hour<12?0:1]}function VUe(t,e){return P_e(e)[t.weekday-1]}function GUe(t,e){return A_e(e)[t.month-1]}function jUe(t,e){return $_e(e)[t.year<0?0:1]}function HUe(t,e,r="always",i=!1){const n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(t)===-1;if(r==="auto"&&s){const d=t==="days";switch(e){case 1:return d?"tomorrow":`next ${n[t][0]}`;case-1:return d?"yesterday":`last ${n[t][0]}`;case 0:return d?"today":`this ${n[t][0]}`}}const o=Object.is(e,-0)||e<0,a=Math.abs(e),l=a===1,c=n[t],u=i?l?c[1]:c[2]||c[1]:l?n[t][0]:t;return o?`${a} ${u} ago`:`in ${a} ${u}`}function Sre(t,e){let r="";for(const i of t)i.literal?r+=i.val:r+=e(i.val);return r}const WUe={D:R4,DD:n_e,DDD:s_e,DDDD:o_e,t:a_e,tt:l_e,ttt:c_e,tttt:u_e,T:h_e,TT:d_e,TTT:p_e,TTTT:f_e,f:m_e,ff:y_e,fff:v_e,ffff:w_e,F:g_e,FF:__e,FFF:b_e,FFFF:x_e};class Ha{static create(e,r={}){return new Ha(e,r)}static parseFormat(e){let r=null,i="",n=!1;const s=[];for(let o=0;o0&&s.push({literal:n||/^\s+$/.test(i),val:i}),r=null,i="",n=!n):n||a===r?i+=a:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=a,r=a)}return i.length>0&&s.push({literal:n||/^\s+$/.test(i),val:i}),s}static macroTokenToFormatOpts(e){return WUe[e]}constructor(e,r){this.opts=r,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...r}).format()}formatDateTime(e,r={}){return this.loc.dtFormatter(e,{...this.opts,...r}).format()}formatDateTimeParts(e,r={}){return this.loc.dtFormatter(e,{...this.opts,...r}).formatToParts()}formatInterval(e,r={}){return this.loc.dtFormatter(e.start,{...this.opts,...r}).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,r={}){return this.loc.dtFormatter(e,{...this.opts,...r}).resolvedOptions()}num(e,r=0){if(this.opts.forceSimple)return Gs(e,r);const i={...this.opts};return r>0&&(i.padTo=r),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,r){const i=this.loc.listingMode()==="en",n=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,y)=>this.loc.extract(e,m,y),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",a=()=>i?BUe(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(m,y)=>i?GUe(e,m):s(y?{month:m}:{month:m,day:"numeric"},"month"),c=(m,y)=>i?VUe(e,m):s(y?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),u=m=>{const y=Ha.macroTokenToFormatOpts(m);return y?this.formatWithSystemDefault(e,y):m},d=m=>i?jUe(e,m):s({era:m},"era"),p=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return a();case"d":return n?s({day:"numeric"},"day"):this.num(e.day);case"dd":return n?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return n?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return n?s({month:"numeric"},"month"):this.num(e.month);case"MM":return n?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return n?s({year:"numeric"},"year"):this.num(e.year);case"yy":return n?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(m)}};return Sre(Ha.parseFormat(r),p)}formatDurationFromString(e,r){const i=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=l=>c=>{const u=i(c);return u?this.num(l.get(u),c.length):c},s=Ha.parseFormat(r),o=s.reduce((l,{literal:c,val:u})=>c?l:l.concat(u),[]),a=e.shiftTo(...o.map(i).filter(l=>l));return Sre(s,n(a))}}class Gd{constructor(e,r){this.reason=e,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const I_e=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function pE(...t){const e=t.reduce((r,i)=>r+i.source,"");return RegExp(`^${e}$`)}function fE(...t){return e=>t.reduce(([r,i,n],s)=>{const[o,a,l]=s(e,n);return[{...r,...o},a||i,l]},[{},null,1]).slice(0,2)}function mE(t,...e){if(t==null)return[null,null];for(const[r,i]of e){const n=r.exec(t);if(n)return i(n)}return[null,null]}function L_e(...t){return(e,r)=>{const i={};let n;for(n=0;nm!==void 0&&(y||m&&u)?-m:m;return[{years:p(T1(r)),months:p(T1(i)),weeks:p(T1(n)),days:p(T1(s)),hours:p(T1(o)),minutes:p(T1(a)),seconds:p(T1(l),l==="-0"),milliseconds:p(NY(c),d)}]}const ske={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function BY(t,e,r,i,n,s,o){const a={year:e.length===2?_7(Ry(e)):Ry(e),month:C_e.indexOf(r)+1,day:Ry(i),hour:Ry(n),minute:Ry(s)};return o&&(a.second=Ry(o)),t&&(a.weekday=t.length>3?O_e.indexOf(t)+1:R_e.indexOf(t)+1),a}const oke=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ake(t){const[,e,r,i,n,s,o,a,l,c,u,d]=t,p=BY(e,n,i,r,s,o,a);let m;return l?m=ske[l]:c?m=0:m=_6(u,d),[p,new Xa(m)]}function lke(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const cke=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,uke=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,hke=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Ere(t){const[,e,r,i,n,s,o,a]=t;return[BY(e,n,i,r,s,o,a),Xa.utcInstance]}function dke(t){const[,e,r,i,n,s,o,a]=t;return[BY(e,a,r,i,n,s,o),Xa.utcInstance]}const pke=pE(XUe,zY),fke=pE(YUe,zY),mke=pE(ZUe,zY),gke=pE(N_e),U_e=fE(tke,gE,bP,wP),yke=fE(QUe,gE,bP,wP),_ke=fE(JUe,gE,bP,wP),vke=fE(gE,bP,wP);function bke(t){return mE(t,[pke,U_e],[fke,yke],[mke,_ke],[gke,vke])}function wke(t){return mE(lke(t),[oke,ake])}function xke(t){return mE(t,[cke,Ere],[uke,Ere],[hke,dke])}function Tke(t){return mE(t,[ike,nke])}const Ske=fE(gE);function Eke(t){return mE(t,[rke,Ske])}const Cke=pE(KUe,eke),Ake=pE(F_e),Oke=fE(gE,bP,wP);function Rke(t){return mE(t,[Cke,U_e],[Ake,Oke])}const Pke="Invalid Duration",k_e={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Mke={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...k_e},Ru=146097/400,Zw=146097/4800,$ke={years:{quarters:4,months:12,weeks:Ru/7,days:Ru,hours:Ru*24,minutes:Ru*24*60,seconds:Ru*24*60*60,milliseconds:Ru*24*60*60*1e3},quarters:{months:3,weeks:Ru/28,days:Ru/4,hours:Ru*24/4,minutes:Ru*24*60/4,seconds:Ru*24*60*60/4,milliseconds:Ru*24*60*60*1e3/4},months:{weeks:Zw/7,days:Zw,hours:Zw*24,minutes:Zw*24*60,seconds:Zw*24*60*60,milliseconds:Zw*24*60*60*1e3},...k_e},uv=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Ike=uv.slice(0).reverse();function T0(t,e,r=!1){const i={values:r?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new ni(i)}function Lke(t){return t<0?Math.floor(t):Math.ceil(t)}function z_e(t,e,r,i,n){const s=t[n][r],o=e[r]/s,a=Math.sign(o)===Math.sign(i[n]),l=!a&&i[n]!==0&&Math.abs(o)<=1?Lke(o):Math.trunc(o);i[n]+=l,e[r]-=l*s}function Dke(t,e){Ike.reduce((r,i)=>Zr(e[i])?r:(r&&z_e(t,e,r,e,i),i),null)}function Nke(t){const e={};for(const[r,i]of Object.entries(t))i!==0&&(e[r]=i);return e}class ni{constructor(e){const r=e.conversionAccuracy==="longterm"||!1;let i=r?$ke:Mke;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||En.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,r){return ni.fromObject({milliseconds:e},r)}static fromObject(e,r={}){if(e==null||typeof e!="object")throw new ah(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ni({values:$4(e,ni.normalizeUnit),loc:En.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(e){if(Ab(e))return ni.fromMillis(e);if(ni.isDuration(e))return e;if(typeof e=="object")return ni.fromObject(e);throw new ah(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,r){const[i]=Tke(e);return i?ni.fromObject(i,r):ni.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,r){const[i]=Eke(e);return i?ni.fromObject(i,r):ni.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,r=null){if(!e)throw new ah("need to specify a reason the Duration is invalid");const i=e instanceof Gd?e:new Gd(e,r);if(zs.throwOnInvalid)throw new uUe(i);return new ni({invalid:i})}static normalizeUnit(e){const r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!r)throw new i_e(e);return r}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,r={}){const i={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?Ha.create(this.loc,i).formatDurationFromString(this,e):Pke}toHuman(e={}){const r=uv.map(i=>{const n=this.values[i];return Zr(n)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(n)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=FY(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const r=this.toMillis();if(r<0||r>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let n=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(n+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(n+=".SSS"));let s=i.toFormat(n);return e.includePrefix&&(s="T"+s),s}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const r=ni.fromDurationLike(e),i={};for(const n of uv)(xS(r.values,n)||xS(this.values,n))&&(i[n]=r.get(n)+this.get(n));return T0(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const r=ni.fromDurationLike(e);return this.plus(r.negate())}mapUnits(e){if(!this.isValid)return this;const r={};for(const i of Object.keys(this.values))r[i]=E_e(e(this.values[i],i));return T0(this,{values:r},!0)}get(e){return this[ni.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const r={...this.values,...$4(e,ni.normalizeUnit)};return T0(this,{values:r})}reconfigure({locale:e,numberingSystem:r,conversionAccuracy:i,matrix:n}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:r}),matrix:n,conversionAccuracy:i};return T0(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Dke(this.matrix,e),T0(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=Nke(this.normalize().shiftToAll().toObject());return T0(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>ni.normalizeUnit(o));const r={},i={},n=this.toObject();let s;for(const o of uv)if(e.indexOf(o)>=0){s=o;let a=0;for(const c in i)a+=this.matrix[c][o]*i[c],i[c]=0;Ab(n[o])&&(a+=n[o]);const l=Math.trunc(a);r[o]=l,i[o]=(a*1e3-l*1e3)/1e3;for(const c in n)uv.indexOf(c)>uv.indexOf(o)&&z_e(this.matrix,n,c,r,o)}else Ab(n[o])&&(i[o]=n[o]);for(const o in i)i[o]!==0&&(r[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return T0(this,{values:r},!0).normalize()}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const r of Object.keys(this.values))e[r]=this.values[r]===0?0:-this.values[r];return T0(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function r(i,n){return i===void 0||i===0?n===void 0||n===0:i===n}for(const i of uv)if(!r(this.values[i],e.values[i]))return!1;return!0}}const Qw="Invalid Interval";function Fke(t,e){return!t||!t.isValid?Kn.invalid("missing or invalid start"):!e||!e.isValid?Kn.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:r}={}){return this.isValid?Kn.fromDateTimes(e||this.s,r||this.e):this}splitAt(...e){if(!this.isValid)return[];const r=e.map(eC).filter(o=>this.contains(o)).sort(),i=[];let{s:n}=this,s=0;for(;n+this.e?this.e:o;i.push(Kn.fromDateTimes(n,a)),n=a,s+=1}return i}splitBy(e){const r=ni.fromDurationLike(e);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:i}=this,n=1,s;const o=[];for(;il*n));s=+a>+this.e?this.e:a,o.push(Kn.fromDateTimes(i,s)),i=s,n+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const r=this.s>e.s?this.s:e.s,i=this.e=i?null:Kn.fromDateTimes(r,i)}union(e){if(!this.isValid)return this;const r=this.se.e?this.e:e.e;return Kn.fromDateTimes(r,i)}static merge(e){const[r,i]=e.sort((n,s)=>n.s-s.s).reduce(([n,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[n,s.union(o)]:[n.concat([s]),o]:[n,o],[[],null]);return i&&r.push(i),r}static xor(e){let r=null,i=0;const n=[],s=e.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...s),a=o.sort((l,c)=>l.time-c.time);for(const l of a)i+=l.type==="s"?1:-1,i===1?r=l.time:(r&&+r!=+l.time&&n.push(Kn.fromDateTimes(r,l.time)),r=null);return Kn.merge(n)}difference(...e){return Kn.xor([this].concat(e)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Qw}toLocaleString(e=R4,r={}){return this.isValid?Ha.create(this.s.loc.clone(r),e).formatInterval(this):Qw}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Qw}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Qw}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Qw}toFormat(e,{separator:r=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${r}${this.e.toFormat(e)}`:Qw}toDuration(e,r){return this.isValid?this.e.diff(this.s,e,r):ni.invalid(this.invalidReason)}mapEndpoints(e){return Kn.fromDateTimes(e(this.s),e(this.e))}}class HM{static hasDST(e=zs.defaultZone){const r=dr.now().setZone(e).set({month:12});return!e.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(e){return zg.isValidZone(e)}static normalizeZone(e){return By(e,zs.defaultZone)}static months(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||En.create(r,i,s)).months(e)}static monthsFormat(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||En.create(r,i,s)).months(e,!0)}static weekdays(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null}={}){return(n||En.create(r,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:r=null,numberingSystem:i=null,locObj:n=null}={}){return(n||En.create(r,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return En.create(e).meridiems()}static eras(e="short",{locale:r=null}={}){return En.create(r,null,"gregory").eras(e)}static features(){return{relative:T_e()}}}function Cre(t,e){const r=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=r(e)-r(t);return Math.floor(ni.fromMillis(i).as("days"))}function Uke(t,e,r){const i=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{const u=Cre(l,c);return(u-u%7)/7}],["days",Cre]],n={},s=t;let o,a;for(const[l,c]of i)r.indexOf(l)>=0&&(o=l,n[l]=c(t,e),a=s.plus(n),a>e?(n[l]--,t=s.plus(n)):t=a);return[t,n,a,o]}function kke(t,e,r,i){let[n,s,o,a]=Uke(t,e,r);const l=e-n,c=r.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);c.length===0&&(o0?ni.fromMillis(l,i).shiftTo(...c).plus(u):u}const VY={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Are={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},zke=VY.hanidec.replace(/[\[|\]]/g,"").split("");function Bke(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let r=0;r=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}function Qh({numberingSystem:t},e=""){return new RegExp(`${VY[t||"latn"]}${e}`)}const Vke="missing Intl.DateTimeFormat.formatToParts support";function Ti(t,e=r=>r){return{regex:t,deser:([r])=>e(Bke(r))}}const Gke=String.fromCharCode(160),B_e=`[ ${Gke}]`,V_e=new RegExp(B_e,"g");function jke(t){return t.replace(/\./g,"\\.?").replace(V_e,B_e)}function Ore(t){return t.replace(/\./g,"").replace(V_e," ").toLowerCase()}function Jh(t,e){return t===null?null:{regex:RegExp(t.map(jke).join("|")),deser:([r])=>t.findIndex(i=>Ore(r)===Ore(i))+e}}function Rre(t,e){return{regex:t,deser:([,r,i])=>_6(r,i),groups:e}}function WM(t){return{regex:t,deser:([e])=>e}}function Hke(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Wke(t,e){const r=Qh(e),i=Qh(e,"{2}"),n=Qh(e,"{3}"),s=Qh(e,"{4}"),o=Qh(e,"{6}"),a=Qh(e,"{1,2}"),l=Qh(e,"{1,3}"),c=Qh(e,"{1,6}"),u=Qh(e,"{1,9}"),d=Qh(e,"{2,4}"),p=Qh(e,"{4,6}"),m=v=>({regex:RegExp(Hke(v.val)),deser:([b])=>b,literal:!0}),_=(v=>{if(t.literal)return m(v);switch(v.val){case"G":return Jh(e.eras("short",!1),0);case"GG":return Jh(e.eras("long",!1),0);case"y":return Ti(c);case"yy":return Ti(d,_7);case"yyyy":return Ti(s);case"yyyyy":return Ti(p);case"yyyyyy":return Ti(o);case"M":return Ti(a);case"MM":return Ti(i);case"MMM":return Jh(e.months("short",!0,!1),1);case"MMMM":return Jh(e.months("long",!0,!1),1);case"L":return Ti(a);case"LL":return Ti(i);case"LLL":return Jh(e.months("short",!1,!1),1);case"LLLL":return Jh(e.months("long",!1,!1),1);case"d":return Ti(a);case"dd":return Ti(i);case"o":return Ti(l);case"ooo":return Ti(n);case"HH":return Ti(i);case"H":return Ti(a);case"hh":return Ti(i);case"h":return Ti(a);case"mm":return Ti(i);case"m":return Ti(a);case"q":return Ti(a);case"qq":return Ti(i);case"s":return Ti(a);case"ss":return Ti(i);case"S":return Ti(l);case"SSS":return Ti(n);case"u":return WM(u);case"uu":return WM(a);case"uuu":return Ti(r);case"a":return Jh(e.meridiems(),0);case"kkkk":return Ti(s);case"kk":return Ti(d,_7);case"W":return Ti(a);case"WW":return Ti(i);case"E":case"c":return Ti(r);case"EEE":return Jh(e.weekdays("short",!1,!1),1);case"EEEE":return Jh(e.weekdays("long",!1,!1),1);case"ccc":return Jh(e.weekdays("short",!0,!1),1);case"cccc":return Jh(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Rre(new RegExp(`([+-]${a.source})(?::(${i.source}))?`),2);case"ZZZ":return Rre(new RegExp(`([+-]${a.source})(${i.source})?`),2);case"z":return WM(/[a-z_+-/]{1,256}?/i);case" ":return WM(/[^\S\n\r]/);default:return m(v)}})(t)||{invalidReason:Vke};return _.token=t,_}const qke={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Xke(t,e){const{type:r,value:i}=t;if(r==="literal"){const o=/^\s+$/.test(i);return{literal:!o,val:o?" ":i}}const n=e[r];let s=qke[r];if(typeof s=="object"&&(s=s[n]),s)return{literal:!1,val:s}}function Yke(t){return[`^${t.map(r=>r.regex).reduce((r,i)=>`${r}(${i.source})`,"")}$`,t]}function Zke(t,e,r){const i=t.match(e);if(i){const n={};let s=1;for(const o in r)if(xS(r,o)){const a=r[o],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(n[a.token.val[0]]=a.deser(i.slice(s,s+l))),s+=l}return[i,n]}else return[i,{}]}function Qke(t){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let r=null,i;return Zr(t.z)||(r=zg.create(t.z)),Zr(t.Z)||(r||(r=new Xa(t.Z)),i=t.Z),Zr(t.q)||(t.M=(t.q-1)*3+1),Zr(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),Zr(t.u)||(t.S=NY(t.u)),[Object.keys(t).reduce((s,o)=>{const a=e(o);return a&&(s[a]=t[o]),s},{}),r,i]}let sk=null;function Jke(){return sk||(sk=dr.fromMillis(1555555555555)),sk}function Kke(t,e){if(t.literal)return t;const r=Ha.macroTokenToFormatOpts(t.val),i=H_e(r,e);return i==null||i.includes(void 0)?t:i}function G_e(t,e){return Array.prototype.concat(...t.map(r=>Kke(r,e)))}function j_e(t,e,r){const i=G_e(Ha.parseFormat(r),t),n=i.map(o=>Wke(o,t)),s=n.find(o=>o.invalidReason);if(s)return{input:e,tokens:i,invalidReason:s.invalidReason};{const[o,a]=Yke(n),l=RegExp(o,"i"),[c,u]=Zke(e,l,a),[d,p,m]=u?Qke(u):[null,null,void 0];if(xS(u,"a")&&xS(u,"H"))throw new d3("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:l,rawMatches:c,matches:u,result:d,zone:p,specificOffset:m}}}function e9e(t,e,r){const{result:i,zone:n,specificOffset:s,invalidReason:o}=j_e(t,e,r);return[i,n,s,o]}function H_e(t,e){return t?Ha.create(e,t).formatDateTimeParts(Jke()).map(n=>Xke(n,t)):null}const W_e=[0,31,59,90,120,151,181,212,243,273,304,334],q_e=[0,31,60,91,121,152,182,213,244,274,305,335];function bh(t,e){return new Gd("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function X_e(t,e,r){const i=new Date(Date.UTC(t,e-1,r));t<100&&t>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const n=i.getUTCDay();return n===0?7:n}function Y_e(t,e,r){return r+(vP(t)?q_e:W_e)[e-1]}function Z_e(t,e){const r=vP(t)?q_e:W_e,i=r.findIndex(s=>sM4(e)?(a=e+1,o=1):a=e,{weekYear:a,weekNumber:o,weekday:s,...v6(t)}}function Pre(t){const{weekYear:e,weekNumber:r,weekday:i}=t,n=X_e(e,1,4),s=HA(e);let o=r*7+i-n-3,a;o<1?(a=e-1,o+=HA(a)):o>s?(a=e+1,o-=HA(e)):a=e;const{month:l,day:c}=Z_e(a,o);return{year:a,month:l,day:c,...v6(t)}}function ok(t){const{year:e,month:r,day:i}=t,n=Y_e(e,r,i);return{year:e,ordinal:n,...v6(t)}}function Mre(t){const{year:e,ordinal:r}=t,{month:i,day:n}=Z_e(e,r);return{year:e,month:i,day:n,...v6(t)}}function t9e(t){const e=y6(t.weekYear),r=fg(t.weekNumber,1,M4(t.weekYear)),i=fg(t.weekday,1,7);return e?r?i?!1:bh("weekday",t.weekday):bh("week",t.week):bh("weekYear",t.weekYear)}function r9e(t){const e=y6(t.year),r=fg(t.ordinal,1,HA(t.year));return e?r?!1:bh("ordinal",t.ordinal):bh("year",t.year)}function Q_e(t){const e=y6(t.year),r=fg(t.month,1,12),i=fg(t.day,1,P4(t.year,t.month));return e?r?i?!1:bh("day",t.day):bh("month",t.month):bh("year",t.year)}function J_e(t){const{hour:e,minute:r,second:i,millisecond:n}=t,s=fg(e,0,23)||e===24&&r===0&&i===0&&n===0,o=fg(r,0,59),a=fg(i,0,59),l=fg(n,0,999);return s?o?a?l?!1:bh("millisecond",n):bh("second",i):bh("minute",r):bh("hour",e)}const ak="Invalid DateTime",$re=864e13;function qM(t){return new Gd("unsupported zone",`the zone "${t.name}" is not supported`)}function lk(t){return t.weekData===null&&(t.weekData=v7(t.c)),t.weekData}function JE(t,e){const r={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new dr({...r,...e,old:r})}function K_e(t,e,r){let i=t-e*60*1e3;const n=r.offset(i);if(e===n)return[i,e];i-=(n-e)*60*1e3;const s=r.offset(i);return n===s?[i,n]:[t-Math.min(n,s)*60*1e3,Math.max(n,s)]}function Ire(t,e){t+=e*60*1e3;const r=new Date(t);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function KL(t,e,r){return K_e(UY(t),e,r)}function Lre(t,e){const r=t.o,i=t.c.year+Math.trunc(e.years),n=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...t.c,year:i,month:n,day:Math.min(t.c.day,P4(i,n))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ni.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),a=UY(s);let[l,c]=K_e(a,r,t.zone);return o!==0&&(l+=o,c=t.zone.offset(l)),{ts:l,o:c}}function KE(t,e,r,i,n,s){const{setZone:o,zone:a}=r;if(t&&Object.keys(t).length!==0||e){const l=e||a,c=dr.fromObject(t,{...r,zone:l,specificOffset:s});return o?c:c.setZone(a)}else return dr.invalid(new Gd("unparsable",`the input "${n}" can't be parsed as ${i}`))}function XM(t,e,r=!0){return t.isValid?Ha.create(En.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(t,e):null}function ck(t,e){const r=t.c.year>9999||t.c.year<0;let i="";return r&&t.c.year>=0&&(i+="+"),i+=Gs(t.c.year,r?6:4),e?(i+="-",i+=Gs(t.c.month),i+="-",i+=Gs(t.c.day)):(i+=Gs(t.c.month),i+=Gs(t.c.day)),i}function Dre(t,e,r,i,n,s){let o=Gs(t.c.hour);return e?(o+=":",o+=Gs(t.c.minute),(t.c.second!==0||!r)&&(o+=":")):o+=Gs(t.c.minute),(t.c.second!==0||!r)&&(o+=Gs(t.c.second),(t.c.millisecond!==0||!i)&&(o+=".",o+=Gs(t.c.millisecond,3))),n&&(t.isOffsetFixed&&t.offset===0&&!s?o+="Z":t.o<0?(o+="-",o+=Gs(Math.trunc(-t.o/60)),o+=":",o+=Gs(Math.trunc(-t.o%60))):(o+="+",o+=Gs(Math.trunc(t.o/60)),o+=":",o+=Gs(Math.trunc(t.o%60)))),s&&(o+="["+t.zone.ianaName+"]"),o}const e1e={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},i9e={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},n9e={ordinal:1,hour:0,minute:0,second:0,millisecond:0},t1e=["year","month","day","hour","minute","second","millisecond"],s9e=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],o9e=["year","ordinal","hour","minute","second","millisecond"];function Nre(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new i_e(t);return e}function Fre(t,e){const r=By(e.zone,zs.defaultZone),i=En.fromObject(e),n=zs.now();let s,o;if(Zr(t.year))s=n;else{for(const c of t1e)Zr(t[c])&&(t[c]=e1e[c]);const a=Q_e(t)||J_e(t);if(a)return dr.invalid(a);const l=r.offset(n);[s,o]=KL(t,l,r)}return new dr({ts:s,zone:r,loc:i,o})}function Ure(t,e,r){const i=Zr(r.round)?!0:r.round,n=(o,a)=>(o=FY(o,i||r.calendary?0:2,!0),e.loc.clone(r).relFormatter(r).format(o,a)),s=o=>r.calendary?e.hasSame(t,o)?0:e.startOf(o).diff(t.startOf(o),o).get(o):e.diff(t,o).get(o);if(r.unit)return n(s(r.unit),r.unit);for(const o of r.units){const a=s(o);if(Math.abs(a)>=1)return n(a,o)}return n(t>e?-0:0,r.units[r.units.length-1])}function kre(t){let e={},r;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],r=Array.from(t).slice(0,t.length-1)):r=Array.from(t),[e,r]}class dr{constructor(e){const r=e.zone||zs.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Gd("invalid input"):null)||(r.isValid?null:qM(r));this.ts=Zr(e.ts)?zs.now():e.ts;let n=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(r))[n,s]=[e.old.c,e.old.o];else{const a=r.offset(this.ts);n=Ire(this.ts,a),i=Number.isNaN(n.year)?new Gd("invalid input"):null,n=i?null:n,s=i?null:a}this._zone=r,this.loc=e.loc||En.create(),this.invalid=i,this.weekData=null,this.c=n,this.o=s,this.isLuxonDateTime=!0}static now(){return new dr({})}static local(){const[e,r]=kre(arguments),[i,n,s,o,a,l,c]=r;return Fre({year:i,month:n,day:s,hour:o,minute:a,second:l,millisecond:c},e)}static utc(){const[e,r]=kre(arguments),[i,n,s,o,a,l,c]=r;return e.zone=Xa.utcInstance,Fre({year:i,month:n,day:s,hour:o,minute:a,second:l,millisecond:c},e)}static fromJSDate(e,r={}){const i=MUe(e)?e.valueOf():NaN;if(Number.isNaN(i))return dr.invalid("invalid input");const n=By(r.zone,zs.defaultZone);return n.isValid?new dr({ts:i,zone:n,loc:En.fromObject(r)}):dr.invalid(qM(n))}static fromMillis(e,r={}){if(Ab(e))return e<-$re||e>$re?dr.invalid("Timestamp out of range"):new dr({ts:e,zone:By(r.zone,zs.defaultZone),loc:En.fromObject(r)});throw new ah(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,r={}){if(Ab(e))return new dr({ts:e*1e3,zone:By(r.zone,zs.defaultZone),loc:En.fromObject(r)});throw new ah("fromSeconds requires a numerical input")}static fromObject(e,r={}){e=e||{};const i=By(r.zone,zs.defaultZone);if(!i.isValid)return dr.invalid(qM(i));const n=zs.now(),s=Zr(r.specificOffset)?i.offset(n):r.specificOffset,o=$4(e,Nre),a=!Zr(o.ordinal),l=!Zr(o.year),c=!Zr(o.month)||!Zr(o.day),u=l||c,d=o.weekYear||o.weekNumber,p=En.fromObject(r);if((u||a)&&d)throw new d3("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new d3("Can't mix ordinal dates with month/day");const m=d||o.weekday&&!u;let y,_,v=Ire(n,s);m?(y=s9e,_=i9e,v=v7(v)):a?(y=o9e,_=n9e,v=ok(v)):(y=t1e,_=e1e);let b=!1;for(const P of y){const F=o[P];Zr(F)?b?o[P]=_[P]:o[P]=v[P]:b=!0}const x=m?t9e(o):a?r9e(o):Q_e(o),T=x||J_e(o);if(T)return dr.invalid(T);const S=m?Pre(o):a?Mre(o):o,[A,C]=KL(S,s,i),R=new dr({ts:A,zone:i,o:C,loc:p});return o.weekday&&u&&e.weekday!==R.weekday?dr.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${R.toISO()}`):R}static fromISO(e,r={}){const[i,n]=bke(e);return KE(i,n,r,"ISO 8601",e)}static fromRFC2822(e,r={}){const[i,n]=wke(e);return KE(i,n,r,"RFC 2822",e)}static fromHTTP(e,r={}){const[i,n]=xke(e);return KE(i,n,r,"HTTP",r)}static fromFormat(e,r,i={}){if(Zr(e)||Zr(r))throw new ah("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:s=null}=i,o=En.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0}),[a,l,c,u]=e9e(o,e,r);return u?dr.invalid(u):KE(a,l,i,`format ${r}`,e,c)}static fromString(e,r,i={}){return dr.fromFormat(e,r,i)}static fromSQL(e,r={}){const[i,n]=Rke(e);return KE(i,n,r,"SQL",e)}static invalid(e,r=null){if(!e)throw new ah("need to specify a reason the DateTime is invalid");const i=e instanceof Gd?e:new Gd(e,r);if(zs.throwOnInvalid)throw new lUe(i);return new dr({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,r={}){const i=H_e(e,En.fromObject(r));return i?i.map(n=>n?n.val:null).join(""):null}static expandFormat(e,r={}){return G_e(Ha.parseFormat(e),En.fromObject(r)).map(n=>n.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?lk(this).weekYear:NaN}get weekNumber(){return this.isValid?lk(this).weekNumber:NaN}get weekday(){return this.isValid?lk(this).weekday:NaN}get ordinal(){return this.isValid?ok(this.c).ordinal:NaN}get monthShort(){return this.isValid?HM.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?HM.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?HM.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?HM.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return vP(this.year)}get daysInMonth(){return P4(this.year,this.month)}get daysInYear(){return this.isValid?HA(this.year):NaN}get weeksInWeekYear(){return this.isValid?M4(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:r,numberingSystem:i,calendar:n}=Ha.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:r,numberingSystem:i,outputCalendar:n}}toUTC(e=0,r={}){return this.setZone(Xa.instance(e),r)}toLocal(){return this.setZone(zs.defaultZone)}setZone(e,{keepLocalTime:r=!1,keepCalendarTime:i=!1}={}){if(e=By(e,zs.defaultZone),e.equals(this.zone))return this;if(e.isValid){let n=this.ts;if(r||i){const s=e.offset(this.ts),o=this.toObject();[n]=KL(o,s,e)}return JE(this,{ts:n,zone:e})}else return dr.invalid(qM(e))}reconfigure({locale:e,numberingSystem:r,outputCalendar:i}={}){const n=this.loc.clone({locale:e,numberingSystem:r,outputCalendar:i});return JE(this,{loc:n})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const r=$4(e,Nre),i=!Zr(r.weekYear)||!Zr(r.weekNumber)||!Zr(r.weekday),n=!Zr(r.ordinal),s=!Zr(r.year),o=!Zr(r.month)||!Zr(r.day),a=s||o,l=r.weekYear||r.weekNumber;if((a||n)&&l)throw new d3("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&n)throw new d3("Can't mix ordinal dates with month/day");let c;i?c=Pre({...v7(this.c),...r}):Zr(r.ordinal)?(c={...this.toObject(),...r},Zr(r.day)&&(c.day=Math.min(P4(c.year,c.month),c.day))):c=Mre({...ok(this.c),...r});const[u,d]=KL(c,this.o,this.zone);return JE(this,{ts:u,o:d})}plus(e){if(!this.isValid)return this;const r=ni.fromDurationLike(e);return JE(this,Lre(this,r))}minus(e){if(!this.isValid)return this;const r=ni.fromDurationLike(e).negate();return JE(this,Lre(this,r))}startOf(e){if(!this.isValid)return this;const r={},i=ni.normalizeUnit(e);switch(i){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(i==="weeks"&&(r.weekday=1),i==="quarters"){const n=Math.ceil(this.month/3);r.month=(n-1)*3+1}return this.set(r)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,r={}){return this.isValid?Ha.create(this.loc.redefaultToEN(r)).formatDateTimeFromString(this,e):ak}toLocaleString(e=R4,r={}){return this.isValid?Ha.create(this.loc.clone(r),e).formatDateTime(this):ak}toLocaleParts(e={}){return this.isValid?Ha.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:r=!1,suppressMilliseconds:i=!1,includeOffset:n=!0,extendedZone:s=!1}={}){if(!this.isValid)return null;const o=e==="extended";let a=ck(this,o);return a+="T",a+=Dre(this,o,r,i,n,s),a}toISODate({format:e="extended"}={}){return this.isValid?ck(this,e==="extended"):null}toISOWeekDate(){return XM(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:r=!1,includeOffset:i=!0,includePrefix:n=!1,extendedZone:s=!1,format:o="extended"}={}){return this.isValid?(n?"T":"")+Dre(this,o==="extended",r,e,i,s):null}toRFC2822(){return XM(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return XM(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ck(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:r=!1,includeOffsetSpace:i=!0}={}){let n="HH:mm:ss.SSS";return(r||e)&&(i&&(n+=" "),r?n+="z":e&&(n+="ZZ")),XM(this,n,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ak}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const r={...this.c};return e.includeConfig&&(r.outputCalendar=this.outputCalendar,r.numberingSystem=this.loc.numberingSystem,r.locale=this.loc.locale),r}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,r="milliseconds",i={}){if(!this.isValid||!e.isValid)return ni.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...i},s=$Ue(r).map(ni.normalizeUnit),o=e.valueOf()>this.valueOf(),a=o?this:e,l=o?e:this,c=kke(a,l,s,n);return o?c.negate():c}diffNow(e="milliseconds",r={}){return this.diff(dr.now(),e,r)}until(e){return this.isValid?Kn.fromDateTimes(this,e):this}hasSame(e,r){if(!this.isValid)return!1;const i=e.valueOf(),n=this.setZone(e.zone,{keepLocalTime:!0});return n.startOf(r)<=i&&i<=n.endOf(r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const r=e.base||dr.fromObject({},{zone:this.zone}),i=e.padding?thisr.valueOf(),Math.min)}static max(...e){if(!e.every(dr.isDateTime))throw new ah("max requires all arguments be DateTimes");return Tre(e,r=>r.valueOf(),Math.max)}static fromFormatExplain(e,r,i={}){const{locale:n=null,numberingSystem:s=null}=i,o=En.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0});return j_e(o,e,r)}static fromStringExplain(e,r,i={}){return dr.fromFormatExplain(e,r,i)}static get DATE_SHORT(){return R4}static get DATE_MED(){return n_e}static get DATE_MED_WITH_WEEKDAY(){return hUe}static get DATE_FULL(){return s_e}static get DATE_HUGE(){return o_e}static get TIME_SIMPLE(){return a_e}static get TIME_WITH_SECONDS(){return l_e}static get TIME_WITH_SHORT_OFFSET(){return c_e}static get TIME_WITH_LONG_OFFSET(){return u_e}static get TIME_24_SIMPLE(){return h_e}static get TIME_24_WITH_SECONDS(){return d_e}static get TIME_24_WITH_SHORT_OFFSET(){return p_e}static get TIME_24_WITH_LONG_OFFSET(){return f_e}static get DATETIME_SHORT(){return m_e}static get DATETIME_SHORT_WITH_SECONDS(){return g_e}static get DATETIME_MED(){return y_e}static get DATETIME_MED_WITH_SECONDS(){return __e}static get DATETIME_MED_WITH_WEEKDAY(){return dUe}static get DATETIME_FULL(){return v_e}static get DATETIME_FULL_WITH_SECONDS(){return b_e}static get DATETIME_HUGE(){return w_e}static get DATETIME_HUGE_WITH_SECONDS(){return x_e}}function eC(t){if(dr.isDateTime(t))return t;if(t&&t.valueOf&&Ab(t.valueOf()))return dr.fromJSDate(t);if(t&&typeof t=="object")return dr.fromObject(t);throw new ah(`Unknown datetime argument: ${t}, of type ${typeof t}`)}const a9e={year:void 0,month:void 0,day:void 0,weekday:void 0},l9e={hour:void 0,minute:void 0,second:void 0},c9e={timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},GY={timeZone:"Etc/UTC"},Cp={year:"numeric",month:"numeric",day:"numeric"},tC={year:"numeric",month:"long",day:"numeric"},rC={year:"numeric",month:"short",day:"numeric"},iC={year:"numeric",month:"long",weekday:"long",day:"numeric"},Vu={hour:"numeric",minute:"numeric"},Kh={...Vu,second:"numeric"},yE={"short-date":Cp,"short-date-short-time":{...Cp,...Vu},"short-date-short-time-24":{...Cp,...Vu,hour12:!1},"short-date-long-time":{...Cp,...Kh},"short-date-long-time-24":{...Cp,...Kh,hour12:!1},"short-date-le":Cp,"short-date-le-short-time":{...Cp,...Vu},"short-date-le-short-time-24":{...Cp,...Vu,hour12:!1},"short-date-le-long-time":{...Cp,...Kh},"short-date-le-long-time-24":{...Cp,...Kh,hour12:!1},"long-month-day-year":tC,"long-month-day-year-short-time":{...tC,...Vu},"long-month-day-year-short-time-24":{...tC,...Vu,hour12:!1},"long-month-day-year-long-time":{...tC,...Kh},"long-month-day-year-long-time-24":{...tC,...Kh,hour12:!1},"day-short-month-year":rC,"day-short-month-year-short-time":{...rC,...Vu},"day-short-month-year-short-time-24":{...rC,...Vu,hour12:!1},"day-short-month-year-long-time":{...rC,...Kh},"day-short-month-year-long-time-24":{...rC,...Kh,hour12:!1},"long-date":iC,"long-date-short-time":{...iC,...Vu},"long-date-short-time-24":{...iC,...Vu,hour12:!1},"long-date-long-time":{...iC,...Kh},"long-date-long-time-24":{...iC,...Kh,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":Vu,"long-time":Kh},u9e=Oc()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),r1e={ar:"ar-u-nu-latn-ca-gregory"};let b7=new WeakMap,i1e=yE["short-date-short-time"];function h9e(t){const e=t||i1e;let r=b7.get(e);if(!r){const i=ep(),n=r1e[i]||i;r=new Intl.DateTimeFormat(n,e),b7.set(e,r)}return r}function f3(t){return yE[t]}function k_(t,e){return h9e(e).format(t)}function d9e(t,e=yE["short-date"]){return k_(new Date(t),{...e,...GY,...l9e})}function p9e(t,e=yE["short-time"]){return k_(new Date(`1970-01-01T${t}Z`),{...e,...GY,...a9e})}function f9e(t,e=yE["short-date-short-time"]){const r=dr.fromISO(t,{setZone:!0}),i=ep(),n=r1e[i]??i;return r.toLocaleString({...c9e,...e},{locale:n})}tY(()=>{b7=new WeakMap,i1e=yE["short-date-short-time"]});const m9e={ar:"ar-u-nu-latn"};let eD=new WeakMap,n1e={};function g9e(t){const e=t||n1e;if(!eD.has(e)){const r=ep(),i=m9e[ep()]||r;eD.set(e,new Intl.NumberFormat(i,t))}return eD.get(e)}function y9e(t={}){const e={};return t.digitSeparator!=null&&(e.useGrouping=t.digitSeparator),t.places!=null&&(e.minimumFractionDigits=e.maximumFractionDigits=t.places),e}function TS(t,e){return Object.is(t,-0)&&(t=0),g9e(e).format(t)}tY(()=>{eD=new WeakMap,n1e={}});let c2=class extends Cu(ke){constructor(e){super(e),this.dateFormat=null,this.digitSeparator=!1,this.places=null}formatNumber(e){return TS(e,y9e(this))}formatDate(e,r=!1){return this.dateFormat?k_(e,{...f3(this.dateFormat),...r&&GY}):this.formatNumber(e)}formatDateOnly(e){const r=(this.dateFormat&&f3(this.dateFormat))??void 0;return d9e(e,r)}formatTimeOnly(e){const r=(this.dateFormat&&f3(this.dateFormat))??void 0;return p9e(e,r)}formatTimestamp(e){const r=(this.dateFormat&&f3(this.dateFormat))??void 0;return f9e(e,r)}formatRasterPixelValue(e){return e.includes("-")?e:e.trim().includes(",")?this._formatDelimitedString(e,",",", "):e.trim().includes(";")?this._formatDelimitedString(e,";","; "):e.trim().includes(" ")?this._formatDelimitedString(e," "," "):this.formatNumber(Number(e))}_formatDelimitedString(e,r,i){return e&&r&&i?e.trim().split(r).map(n=>this.formatNumber(Number(n))).join(i):e}};h([Vt(u9e)],c2.prototype,"dateFormat",void 0),h([f({type:Boolean,json:{write:!0}})],c2.prototype,"digitSeparator",void 0),h([f({type:mn,json:{write:!0}})],c2.prototype,"places",void 0),c2=h([N("esri.popup.support.FieldInfoFormat")],c2);const _9e=c2;var w7;let ud=w7=class extends ke{constructor(t){super(t),this.fieldName=null,this.format=null,this.isEditable=!0,this.label=null,this.stringFieldOption="text-box",this.statisticType=null,this.tooltip=null,this.visible=!0}clone(){return new w7({fieldName:this.fieldName,format:this.format?ye(this.format):null,isEditable:this.isEditable,label:this.label,stringFieldOption:this.stringFieldOption,statisticType:this.statisticType,tooltip:this.tooltip,visible:this.visible})}};h([f({type:String,json:{write:!0}})],ud.prototype,"fieldName",void 0),h([f({type:_9e,json:{write:!0}})],ud.prototype,"format",void 0),h([f({type:Boolean,json:{write:{alwaysWriteDefaults:!0},default:!0}})],ud.prototype,"isEditable",void 0),h([f({type:String,json:{write:!0}})],ud.prototype,"label",void 0),h([Vt(new zn({richtext:"rich-text",textarea:"text-area",textbox:"text-box"}),{default:"text-box"})],ud.prototype,"stringFieldOption",void 0),h([f({type:["count","sum","min","max","avg","stddev","var"],json:{write:!0}})],ud.prototype,"statisticType",void 0),h([f({type:String,json:{write:!0}})],ud.prototype,"tooltip",void 0),h([f({type:Boolean,json:{write:!0}})],ud.prototype,"visible",void 0),ud=w7=h([N("esri.popup.FieldInfo")],ud);const s1e=ud;var x7;let Fm=x7=class extends l1{constructor(t){super(t),this.attributes=null,this.description=null,this.fieldInfos=null,this.title=null,this.type="fields"}writeFieldInfos(t,e){e.fieldInfos=t&&t.map(r=>r.toJSON())}clone(){return new x7(ye({attributes:this.attributes,description:this.description,fieldInfos:this.fieldInfos,title:this.title}))}};h([f({type:Object,json:{write:!0}})],Fm.prototype,"attributes",void 0),h([f({type:String,json:{write:!0}})],Fm.prototype,"description",void 0),h([f({type:[s1e]})],Fm.prototype,"fieldInfos",void 0),h([xr("fieldInfos")],Fm.prototype,"writeFieldInfos",null),h([f({type:String,json:{write:!0}})],Fm.prototype,"title",void 0),h([f({type:["fields"],readOnly:!0,json:{read:!1,write:!0}})],Fm.prototype,"type",void 0),Fm=x7=h([N("esri.popup.content.FieldsContent")],Fm);const I4=Fm;let hv=class extends ke{constructor(e){super(e),this.altText=null,this.caption="",this.title="",this.type=null}};h([f({type:String,json:{write:!0}})],hv.prototype,"altText",void 0),h([f({type:String,json:{write:!0}})],hv.prototype,"caption",void 0),h([f({type:String,json:{write:!0}})],hv.prototype,"title",void 0),h([f({type:["image","bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],hv.prototype,"type",void 0),hv=h([N("esri.popup.content.mixins.MediaInfo")],hv);const jY=hv;var T7;let u2=T7=class extends xe{constructor(t){super(t),this.fieldName=null,this.tooltip=null,this.value=null}clone(){return new T7({fieldName:this.fieldName,tooltip:this.tooltip,value:this.value})}};h([f()],u2.prototype,"fieldName",void 0),h([f()],u2.prototype,"tooltip",void 0),h([f()],u2.prototype,"value",void 0),u2=T7=h([N("esri.popup.content.support.ChartMediaInfoValueSeries")],u2);const v9e=u2;var S7;let dv=S7=class extends ke{constructor(t){super(t),this.fields=[],this.normalizeField=null,this.series=[],this.tooltipField=null}clone(){return new S7({fields:ye(this.fields),normalizeField:this.normalizeField,tooltipField:this.tooltipField})}};h([f({type:[String],json:{write:!0}})],dv.prototype,"fields",void 0),h([f({type:String,json:{write:!0}})],dv.prototype,"normalizeField",void 0),h([f({type:[v9e],json:{read:!1}})],dv.prototype,"series",void 0),h([f({type:String,json:{write:!0}})],dv.prototype,"tooltipField",void 0),dv=S7=h([N("esri.popup.content.support.ChartMediaInfoValue")],dv);const b9e=dv;let m3=class extends jY{constructor(e){super(e),this.type=null,this.value=null}};h([f({type:["bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],m3.prototype,"type",void 0),h([f({type:b9e,json:{write:!0}})],m3.prototype,"value",void 0),m3=h([N("esri.popup.content.mixins.ChartMediaInfo")],m3);const b6=m3,w6=Oc()({barchart:"bar-chart",columnchart:"column-chart",linechart:"line-chart",piechart:"pie-chart"});var E7;let tD=E7=class extends b6{constructor(t){super(t),this.type="bar-chart"}clone(){return new E7({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};h([f({type:["bar-chart"],readOnly:!0,json:{type:["barchart"],read:!1,write:w6.write}})],tD.prototype,"type",void 0),tD=E7=h([N("esri.popup.content.BarChartMediaInfo")],tD);const o1e=tD;var C7;let rD=C7=class extends b6{constructor(t){super(t),this.type="column-chart"}clone(){return new C7({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};h([f({type:["column-chart"],readOnly:!0,json:{type:["columnchart"],read:!1,write:w6.write}})],rD.prototype,"type",void 0),rD=C7=h([N("esri.popup.content.ColumnChartMediaInfo")],rD);const a1e=rD;var A7;let g3=A7=class extends ke{constructor(t){super(t),this.linkURL=null,this.sourceURL=null}clone(){return new A7({linkURL:this.linkURL,sourceURL:this.sourceURL})}};h([f({type:String,json:{write:!0}})],g3.prototype,"linkURL",void 0),h([f({type:String,json:{write:!0}})],g3.prototype,"sourceURL",void 0),g3=A7=h([N("esri.popup.content.support.ImageMediaInfoValue")],g3);const w9e=g3;var O7;let h2=O7=class extends jY{constructor(t){super(t),this.refreshInterval=null,this.type="image",this.value=null}clone(){return new O7({altText:this.altText,title:this.title,caption:this.caption,refreshInterval:this.refreshInterval,value:this.value?this.value.clone():null})}};h([f({type:Number,json:{write:!0}})],h2.prototype,"refreshInterval",void 0),h([f({type:["image"],readOnly:!0,json:{read:!1,write:!0}})],h2.prototype,"type",void 0),h([f({type:w9e,json:{write:!0}})],h2.prototype,"value",void 0),h2=O7=h([N("esri.popup.content.ImageMediaInfo")],h2);const l1e=h2;var R7;let iD=R7=class extends b6{constructor(t){super(t),this.type="line-chart"}clone(){return new R7({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};h([f({type:["line-chart"],readOnly:!0,json:{type:["linechart"],read:!1,write:w6.write}})],iD.prototype,"type",void 0),iD=R7=h([N("esri.popup.content.LineChartMediaInfo")],iD);const c1e=iD;var P7;let nD=P7=class extends b6{constructor(t){super(t),this.type="pie-chart"}clone(){return new P7({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};h([f({type:["pie-chart"],readOnly:!0,json:{type:["piechart"],read:!1,write:w6.write}})],nD.prototype,"type",void 0),nD=P7=h([N("esri.popup.content.PieChartMediaInfo")],nD);const u1e=nD,h1e={base:jY,key:"type",defaultKeyValue:"image",typeMap:{"bar-chart":o1e,"column-chart":a1e,"line-chart":c1e,"pie-chart":u1e,image:l1e}};var M7;let hd=M7=class extends l1{constructor(t){super(t),this.activeMediaInfoIndex=null,this.attributes=null,this.description=null,this.mediaInfos=null,this.title=null,this.type="media"}readMediaInfos(t){return t&&t.map(e=>e.type==="image"?l1e.fromJSON(e):e.type==="barchart"?o1e.fromJSON(e):e.type==="columnchart"?a1e.fromJSON(e):e.type==="linechart"?c1e.fromJSON(e):e.type==="piechart"?u1e.fromJSON(e):void 0).filter(Boolean)}writeMediaInfos(t,e){e.mediaInfos=t&&t.map(r=>r.toJSON())}clone(){return new M7(ye({activeMediaInfoIndex:this.activeMediaInfoIndex,attributes:this.attributes,description:this.description,mediaInfos:this.mediaInfos,title:this.title}))}};h([f()],hd.prototype,"activeMediaInfoIndex",void 0),h([f({type:Object,json:{write:!0}})],hd.prototype,"attributes",void 0),h([f({type:String,json:{write:!0}})],hd.prototype,"description",void 0),h([f({types:[h1e]})],hd.prototype,"mediaInfos",void 0),h([lr("mediaInfos")],hd.prototype,"readMediaInfos",null),h([xr("mediaInfos")],hd.prototype,"writeMediaInfos",null),h([f({type:String,json:{write:!0}})],hd.prototype,"title",void 0),h([f({type:["media"],readOnly:!0,json:{read:!1,write:!0}})],hd.prototype,"type",void 0),hd=M7=h([N("esri.popup.content.MediaContent")],hd);const L4=hd;var $7;let y3=$7=class extends ke{constructor(t){super(t),this.field=null,this.order=null}clone(){return new $7({field:this.field,order:this.order})}};h([f({type:String,json:{write:!0}})],y3.prototype,"field",void 0),h([f({type:["asc","desc"],json:{write:!0}})],y3.prototype,"order",void 0),y3=$7=h([N("esri.popup.support.RelatedRecordsInfoFieldOrder")],y3);const d1e=y3;let Yp=class extends Cu(l1){constructor(e){super(e),this.description=null,this.displayCount=null,this.displayType="list",this.orderByFields=null,this.relationshipId=null,this.title=null,this.type="relationship"}};h([f({type:String,json:{write:!0}})],Yp.prototype,"description",void 0),h([f({type:Number,json:{type:mn,write:!0}})],Yp.prototype,"displayCount",void 0),h([f({type:["list"],json:{write:!0}})],Yp.prototype,"displayType",void 0),h([f({type:[d1e],json:{write:!0}})],Yp.prototype,"orderByFields",void 0),h([f({type:Number,json:{type:mn,write:!0}})],Yp.prototype,"relationshipId",void 0),h([f({type:String,json:{write:!0}})],Yp.prototype,"title",void 0),h([f({type:["relationship"],readOnly:!0,json:{read:!1,write:!0}})],Yp.prototype,"type",void 0),Yp=h([N("esri.popup.content.RelationshipContent")],Yp);const D4=Yp;var I7;let _3=I7=class extends l1{constructor(t){super(t),this.text=null,this.type="text"}clone(){return new I7({text:this.text})}};h([f({type:String,json:{write:!0}})],_3.prototype,"text",void 0),h([f({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],_3.prototype,"type",void 0),_3=I7=h([N("esri.popup.content.TextContent")],_3);const N4=_3,x9e={base:null,key:"type",typeMap:{attachment:O4,media:L4,text:N4,expression:DY,field:I4,relationship:D4}};var L7;let pv=L7=class extends ke{constructor(t){super(t),this.name=null,this.title=null,this.expression=null,this.returnType=null}clone(){return new L7({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};h([f({type:String,json:{write:!0}})],pv.prototype,"name",void 0),h([f({type:String,json:{write:!0}})],pv.prototype,"title",void 0),h([f({type:String,json:{write:!0}})],pv.prototype,"expression",void 0),h([f({type:["string","number"],json:{write:!0}})],pv.prototype,"returnType",void 0),pv=L7=h([N("esri.popup.ExpressionInfo")],pv);const T9e=pv;var D7;let v3=D7=class extends ke{constructor(t){super(t),this.returnTopmostRaster=null,this.showNoDataRecords=null}clone(){return new D7({showNoDataRecords:this.showNoDataRecords,returnTopmostRaster:this.returnTopmostRaster})}};h([f({type:Boolean,json:{write:!0}})],v3.prototype,"returnTopmostRaster",void 0),h([f({type:Boolean,json:{write:!0}})],v3.prototype,"showNoDataRecords",void 0),v3=D7=h([N("esri.popup.LayerOptions")],v3);const S9e=v3;var N7;let b3=N7=class extends ke{constructor(t){super(t),this.showRelatedRecords=null,this.orderByFields=null}clone(){return new N7({showRelatedRecords:this.showRelatedRecords,orderByFields:this.orderByFields?ye(this.orderByFields):null})}};h([f({type:Boolean,json:{write:!0}})],b3.prototype,"showRelatedRecords",void 0),h([f({type:[d1e],json:{write:!0}})],b3.prototype,"orderByFields",void 0),b3=N7=h([N("esri.popup.RelatedRecordsInfo")],b3);const E9e=b3;var F7;let Gu=F7=class extends RY(xe){constructor(t){super(t),this.active=!1,this.className=null,this.disabled=!1,this.icon=null,this.id=null,this.indicator=!1,this.title=null,this.type=null,this.visible=!0}clone(){return new F7({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible})}};h([f()],Gu.prototype,"active",void 0),h([f()],Gu.prototype,"className",void 0),h([f()],Gu.prototype,"disabled",void 0),h([f()],Gu.prototype,"icon",void 0),h([f()],Gu.prototype,"id",void 0),h([f()],Gu.prototype,"indicator",void 0),h([f()],Gu.prototype,"title",void 0),h([f()],Gu.prototype,"type",void 0),h([f()],Gu.prototype,"visible",void 0),Gu=F7=h([N("esri.support.actions.ActionBase")],Gu);const HY=Gu;var U7;let sD=U7=class extends HY{constructor(t){super(t),this.image=null,this.type="button"}clone(){return new U7({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image})}};h([f()],sD.prototype,"image",void 0),sD=U7=h([N("esri.support.Action.ActionButton")],sD);const C9e=sD;var k7;let w3=k7=class extends HY{constructor(t){super(t),this.image=null,this.type="toggle",this.value=!1}clone(){return new k7({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image,value:this.value})}};h([f()],w3.prototype,"image",void 0),h([f()],w3.prototype,"value",void 0),w3=k7=h([N("esri.support.Action.ActionToggle")],w3);const A9e=w3,O9e="esri.PopupTemplate",R9e=J.getLogger(O9e),nC="relationships/",zre="expression/",P9e=ir.ofType({key:"type",defaultKeyValue:"button",base:HY,typeMap:{button:C9e,toggle:A9e}}),M9e={base:l1,key:"type",typeMap:{media:L4,custom:oUe,text:N4,attachments:O4,fields:I4,expression:DY,relationship:D4}},$9e=["attachments","fields","media","text","expression","relationship"];let co=class extends Cu(ke){constructor(){super(...arguments),this.actions=null,this.content="",this.expressionInfos=null,this.fieldInfos=null,this.layerOptions=null,this.lastEditInfoEnabled=!0,this.outFields=null,this.overwriteActions=!1,this.returnGeometry=!1,this.title=""}castContent(e){return Array.isArray(e)?e.map(r=>L_(M9e,r)):typeof e=="string"||typeof e=="function"||e instanceof HTMLElement||Eu(e)?e:(R9e.error("content error","unsupported content value",{value:e}),null)}readContent(e,r){const{popupElements:i}=r;return Array.isArray(i)&&i.length>0?this._readPopupInfoElements(r.description,r.mediaInfos,i):this._readPopupInfo(r)}writeContent(e,r,i,n){typeof e!="string"?Array.isArray(e)&&(r.popupElements=e.filter(s=>$9e.includes(s.type)).map(s=>s&&s.toJSON(n)),r.popupElements.forEach(s=>{s.type==="attachments"?this._writeAttachmentContent(r):s.type==="media"?this._writeMediaContent(s,r):s.type==="text"?this._writeTextContent(s,r):s.type==="relationship"&&this._writeRelationshipContent(s,r)})):r.description=e}writeFieldInfos(e,r,i,n){const{content:s}=this,o=Array.isArray(s)?s:null;if(e){const a=o?o.filter(c=>c.type==="fields"):[],l=a.length&&a.every(c=>{var u;return(u=c.fieldInfos)==null?void 0:u.length});r.fieldInfos=e.filter(Boolean).map(c=>{const u=c.toJSON(n);return l&&(u.visible=!1),u})}if(o)for(const a of o)a.type==="fields"&&this._writeFieldsContent(a,r)}writeLayerOptions(e,r,i,n){r[i]=!e||e.showNoDataRecords===null&&e.returnTopmostRaster===null?null:e.toJSON(n)}writeTitle(e,r){r.title=e||""}async collectRequiredFields(e,r){const i=this.expressionInfos||[];await this._collectExpressionInfoFields(e,r,[...i,...this._getContentExpressionInfos(this.content,i)]),aR(e,r,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(e){const r=new Set;return await this.collectRequiredFields(r,e),[...r].sort()}_writeFieldsContent(e,r){if(!Array.isArray(e.fieldInfos)||!e.fieldInfos.length)return;const i=ye(e.fieldInfos);Array.isArray(r.fieldInfos)?i.forEach(n=>{const s=r.fieldInfos.find(o=>o.fieldName.toLowerCase()===n.fieldName.toLowerCase());s?s.visible=!0:r.fieldInfos.push(n)}):r.fieldInfos=i}_writeAttachmentContent(e){e.showAttachments||(e.showAttachments=!0)}_writeRelationshipContent(e,r){var s,o;const i=((s=e.orderByFields)==null?void 0:s.map(a=>this._toFieldOrderJSON(a,e.relationshipId)))||[],n=[...((o=r.relatedRecordsInfo)==null?void 0:o.orderByFields)||[],...i];r.relatedRecordsInfo={showRelatedRecords:!0,...(n==null?void 0:n.length)&&{orderByFields:n}}}_writeTextContent(e,r){!r.description&&e.text&&(r.description=e.text)}_writeMediaContent(e,r){if(!Array.isArray(e.mediaInfos)||!e.mediaInfos.length)return;const i=ye(e.mediaInfos);Array.isArray(r.mediaInfos)?r.mediaInfos=[...r.mediaInfos,...i]:r.mediaInfos=i}_readPopupInfoElements(e,r,i){const n={description:!1,mediaInfos:!1};return i.map(s=>s.type==="media"?(s.mediaInfos||!r||n.mediaInfos||(s.mediaInfos=r,n.mediaInfos=!0),L4.fromJSON(s)):s.type==="text"?(s.text||!e||n.description||(s.text=e,n.description=!0),N4.fromJSON(s)):s.type==="attachments"?O4.fromJSON(s):s.type==="fields"?I4.fromJSON(s):s.type==="expression"?DY.fromJSON(s):s.type==="relationship"?D4.fromJSON(s):void 0).filter(Boolean)}_toRelationshipContent(e){const{field:r,order:i}=e;if(!(r!=null&&r.startsWith(nC)))return null;const n=r.replace(nC,"").split("/");if(n.length!==2)return null;const s=parseInt(n[0],10),o=n[1];return typeof s=="number"&&o?D4.fromJSON({relationshipId:s,orderByFields:[{field:o,order:i}]}):null}_toFieldOrderJSON(e,r){const{order:i,field:n}=e;return{field:`${nC}${r}/${n}`,order:i}}_readPopupInfo({description:e,mediaInfos:r,showAttachments:i,relatedRecordsInfo:n={showRelatedRecords:!1}}){const s=[];e?s.push(new N4({text:e})):s.push(new I4),Array.isArray(r)&&r.length&&s.push(L4.fromJSON({mediaInfos:r})),i&&s.push(O4.fromJSON({displayType:"auto"}));const{showRelatedRecords:o,orderByFields:a}=n;return o&&(a!=null&&a.length)&&a.forEach(l=>{const c=this._toRelationshipContent(l);c&&s.push(c)}),s.length?s:e}_getContentElementFields(e){const r=e==null?void 0:e.type;if(r==="attachments")return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description)];if(r==="custom")return e.outFields||[];if(r==="fields")return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description),...this._getFieldInfoFields(e.fieldInfos??this.fieldInfos)];if(r==="media"){const i=e.mediaInfos||[];return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description),...i.reduce((n,s)=>[...n,...this._getMediaInfoFields(s)],[])]}return r==="text"?this._extractFieldNames(e.text):[]}_getMediaInfoFields(e){const{caption:r,title:i,value:n}=e,s=n||{},{fields:o,normalizeField:a,tooltipField:l,sourceURL:c,linkURL:u}=s,d=[...this._extractFieldNames(i),...this._extractFieldNames(r),...this._extractFieldNames(c),...this._extractFieldNames(u),...o??[]];return a&&d.push(a),l&&d.push(l),d}_getContentExpressionInfos(e,r){return Array.isArray(e)?e.reduce((i,n)=>[...i,...n.type==="expression"&&n.expressionInfo?[n.expressionInfo]:[]],r):[]}_getContentFields(e){return typeof e=="string"?this._extractFieldNames(e):Array.isArray(e)?e.reduce((r,i)=>[...r,...this._getContentElementFields(i)],[]):[]}async _collectExpressionInfoFields(e,r,i){i&&await Promise.all(i.map(n=>kg(e,r,n.expression)))}_getFieldInfoFields(e){return e?e.filter(r=>r.visible===void 0||!!r.visible).map(r=>r.fieldName).filter(r=>!r.startsWith(nC)&&!r.startsWith(zre)):[]}_getActionsFields(e){return e?e.toArray().reduce((r,i)=>[...r,...this._getActionFields(i)],[]):[]}_getActionFields(e){const{className:r,title:i,type:n}=e,s=n==="button"||n==="toggle"?e.image:"";return[...this._extractFieldNames(i),...this._extractFieldNames(r),...this._extractFieldNames(s)]}_getTitleFields(e){return typeof e=="string"?this._extractFieldNames(e):[]}_extractFieldNames(e){if(!e||typeof e!="string")return[];const r=/{[^}]*}/g,i=e.match(r);if(!i)return[];const n=/\{(\w+):.+\}/,s=i.filter(o=>!(o.indexOf(`{${nC}`)===0||o.indexOf(`{${zre}`)===0)).map(o=>o.replace(n,"{$1}"));return s?s.map(o=>o.slice(1,-1)):[]}};h([f({type:P9e})],co.prototype,"actions",void 0),h([f()],co.prototype,"content",void 0),h([_i("content")],co.prototype,"castContent",null),h([lr("content",["description","fieldInfos","popupElements","mediaInfos","showAttachments","relatedRecordsInfo"])],co.prototype,"readContent",null),h([xr("content",{popupElements:{type:ir.ofType(x9e)},showAttachments:{type:Boolean},mediaInfos:{type:ir.ofType(h1e)},description:{type:String},relatedRecordsInfo:{type:E9e}})],co.prototype,"writeContent",null),h([f({type:[T9e],json:{write:!0}})],co.prototype,"expressionInfos",void 0),h([f({type:[s1e]})],co.prototype,"fieldInfos",void 0),h([xr("fieldInfos")],co.prototype,"writeFieldInfos",null),h([f({type:S9e})],co.prototype,"layerOptions",void 0),h([xr("layerOptions")],co.prototype,"writeLayerOptions",null),h([f({type:Boolean,json:{read:{source:"showLastEditInfo"},write:{target:"showLastEditInfo"},default:!0}})],co.prototype,"lastEditInfoEnabled",void 0),h([f()],co.prototype,"outFields",void 0),h([f()],co.prototype,"overwriteActions",void 0),h([f()],co.prototype,"returnGeometry",void 0),h([f({json:{type:String}})],co.prototype,"title",void 0),h([xr("title")],co.prototype,"writeTitle",null),co=h([N("esri.PopupTemplate")],co);const I9e=co,Bre=new zn({esriSMS:"simple-marker",esriPMS:"picture-marker",esriSLS:"simple-line",esriSFS:"simple-fill",esriPFS:"picture-fill",esriTS:"text",esriSHD:"shield-label-symbol",PointSymbol3D:"point-3d",LineSymbol3D:"line-3d",PolygonSymbol3D:"polygon-3d",WebStyleSymbol:"web-style",MeshSymbol3D:"mesh-3d",LabelSymbol3D:"label-3d",CIMSymbolReference:"cim"});let L9e=0,d2=class extends ke{constructor(e){super(e),this.id="sym"+L9e++,this.type=null,this.color=new it([0,0,0,1])}readColor(e){return e&&e[0]!=null?[e[0],e[1],e[2],e[3]/255]:e}async collectRequiredFields(e,r){}hash(){return JSON.stringify(this.toJSON())}clone(){}};h([f({type:Bre.apiValues,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:Bre.write}}})],d2.prototype,"type",void 0),h([f({type:it,json:{write:{allowNull:!0}}})],d2.prototype,"color",void 0),h([lr("color")],d2.prototype,"readColor",null),d2=h([N("esri.symbols.Symbol")],d2);const Rc=d2;var z7;let iy=z7=class extends Rc{constructor(t){super(t),this.data=null,this.type="cim"}readData(t,e){return e}writeData(t,e){Object.assign(e,t)}async collectRequiredFields(t,e){var r;if(((r=this.data)==null?void 0:r.type)==="CIMSymbolReference"){const i=this.data.primitiveOverrides;if(i){const n=i.map(s=>{const o=s.valueExpressionInfo;return kg(t,e,o.expression)});await Promise.all(n)}}}clone(){return new z7({data:ye(this.data)})}hash(){return mge(JSON.stringify(this.data)).toString()}};h([f({json:{write:!1}})],iy.prototype,"color",void 0),h([f({json:{write:!0}})],iy.prototype,"data",void 0),h([lr("data",["symbol"])],iy.prototype,"readData",null),h([xr("data",{})],iy.prototype,"writeData",null),h([Vt({CIMSymbolReference:"cim"},{readOnly:!0})],iy.prototype,"type",void 0),iy=z7=h([N("esri.symbols.CIMSymbol")],iy);const xP=iy;let p2=class extends ke{constructor(e){super(e),this.enabled=!0,this.type=null,this.ignoreDrivers=!1}writeEnabled(e,r,i){e||(r[i]=e)}};h([f({type:Boolean,json:{read:{source:"enable"},write:{target:"enable"}}})],p2.prototype,"enabled",void 0),h([xr("enabled")],p2.prototype,"writeEnabled",null),h([f({type:["icon","object","line","path","fill","water","extrude","text"],readOnly:!0})],p2.prototype,"type",void 0),p2=h([N("esri.symbols.Symbol3DLayer")],p2);const om=p2,D9e=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i,N9e="screenUtils.toPt: input not recognized!",p1e=96;function ha(t){return t?t/72*p1e:0}function up(t){return t?72*t/p1e:0}function gn(t){if(typeof t=="string"){const e=t.match(D9e);if(e){const r=Number(e[1]),i=e[3]&&e[3].toLowerCase(),n=t.charAt(0)==="-",s=i==="px"?up(r):r;return n?-s:s}return console.warn(N9e),null}return t}function Lh(t=0,e=0){return{x:t,y:e}}function Xi(t=0,e=0){return[t,e]}function f1e(t=0,e=0){return[t,e]}function Vo(t=0,e=0,r=0){return[t,e,r]}function yAt(t){return t}function _At(t){return t}function vAt(t){return t}function wf(t,e){return e?(e[0]=t.x,e[1]=t.y,e.length>2&&(e[2]=0),e):[t.x,t.y]}function F9e(t,e){const r=e.transparency!=null?fY(e.transparency):1,i=e.color;return i&&Array.isArray(i)?new it([i[0]||0,i[1]||0,i[2]||0,r]):null}function U9e(t,e){e.color=t.toJSON().slice(0,3);const r=pY(t.a);r!==0&&(e.transparency=r)}const Jg={type:it,json:{type:[mn],default:null,read:{source:["color","transparency"],reader:F9e},write:{target:{color:{type:[mn]},transparency:{type:mn}},writer:U9e}}},qf={type:Number,cast:gn,json:{write:!0}};let fv=class extends ke{constructor(e){super(e),this.color=new it([0,0,0,1]),this.extensionLength=0,this.size=up(1)}clone(){}cloneProperties(){return{color:ye(this.color),size:this.size,extensionLength:this.extensionLength}}};h([f({type:["solid","sketch"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],fv.prototype,"type",void 0),h([f(Jg)],fv.prototype,"color",void 0),h([f({...qf,json:{write:{overridePolicy:t=>({enabled:!!t})}}})],fv.prototype,"extensionLength",void 0),h([f(qf)],fv.prototype,"size",void 0),fv=h([N("esri.symbols.edges.Edges3D")],fv);const WY=fv;var B7;let oD=B7=class extends WY{constructor(t){super(t),this.type="sketch"}clone(){return new B7(this.cloneProperties())}};h([Vt({sketch:"sketch"},{readOnly:!0})],oD.prototype,"type",void 0),oD=B7=h([N("esri.symbols.edges.SketchEdges3D")],oD);const qY=oD;var V7;let aD=V7=class extends WY{constructor(t){super(t),this.type="solid"}clone(){return new V7(this.cloneProperties())}};h([Vt({solid:"solid"},{readOnly:!0})],aD.prototype,"type",void 0),aD=V7=h([N("esri.symbols.support.SolidEdges3D")],aD);const m1e=aD,g1e={types:{key:"type",base:WY,typeMap:{solid:m1e,sketch:qY}},json:{write:!0}};var G7;let du=G7=class extends ke{constructor(t){super(t),this.color=null}clone(){const t={color:this.color!=null?this.color.clone():null};return new G7(t)}};h([f(Jg)],du.prototype,"color",void 0),du=G7=h([N("esri.symbols.support.Symbol3DMaterial")],du);var j7;let ny=j7=class extends om{constructor(t){super(t),this.type="extrude",this.size=1,this.material=null,this.castShadows=!0,this.edges=null}clone(){return new j7({edges:this.edges&&this.edges.clone(),enabled:this.enabled,material:this.material!=null?this.material.clone():null,castShadows:this.castShadows,size:this.size})}};h([Vt({Extrude:"extrude"},{readOnly:!0})],ny.prototype,"type",void 0),h([f({type:Number,json:{write:{enabled:!0,isRequired:!0}},nonNullable:!0})],ny.prototype,"size",void 0),h([f({type:du,json:{write:!0}})],ny.prototype,"material",void 0),h([f({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],ny.prototype,"castShadows",void 0),h([f(g1e)],ny.prototype,"edges",void 0),ny=j7=h([N("esri.symbols.ExtrudeSymbol3DLayer")],ny);const y1e=ny;let x3=class extends Rc{constructor(e){super(e),this.type="simple-line",this.width=.75}hash(){return`${this.type}.${this.width}`}};h([Vt({esriSLS:"simple-line"},{readOnly:!0})],x3.prototype,"type",void 0),h([f({type:Number,cast:gn,json:{write:!0}})],x3.prototype,"width",void 0),x3=h([N("esri.symbols.LineSymbol")],x3);const k9e=x3,z9e=["begin","end","begin-end"],_1e=["arrow","circle","square","diamond","cross","x"];var H7;let Zp=H7=class extends ke{constructor(t){super(t),this.placement="begin-end",this.type="line-marker",this.style="arrow"}writeStyle(t,e,r,i){e[r]=(i==null?void 0:i.origin)==="web-map"?"arrow":t}set color(t){this._set("color",t)}readColor(t){return t&&t[0]!=null?[t[0],t[1],t[2],t[3]/255]:t}writeColor(t,e,r,i){(i==null?void 0:i.origin)==="web-map"||(e[r]=t)}clone(){return new H7({color:ye(this.color),placement:this.placement,style:this.style})}hash(){var t;return`${this.placement}.${(t=this.color)==null?void 0:t.hash()}.${this.style}`}};h([f({type:["begin","end","begin-end"],json:{write:!0}})],Zp.prototype,"placement",void 0),h([Vt({"line-marker":"line-marker"},{readOnly:!0}),f({json:{origins:{"web-map":{write:!1}}}})],Zp.prototype,"type",void 0),h([f({type:_1e})],Zp.prototype,"style",void 0),h([xr("style")],Zp.prototype,"writeStyle",null),h([f({type:it,value:null,json:{write:{allowNull:!0}}})],Zp.prototype,"color",null),h([lr("color")],Zp.prototype,"readColor",null),h([xr("color")],Zp.prototype,"writeColor",null),Zp=H7=h([N("esri.symbols.LineSymbolMarker")],Zp);const B9e=Zp;var W7;const uk=new zn({esriSLSSolid:"solid",esriSLSDash:"dash",esriSLSDot:"dot",esriSLSDashDot:"dash-dot",esriSLSDashDotDot:"long-dash-dot-dot",esriSLSNull:"none",esriSLSInsideFrame:"inside-frame",esriSLSShortDash:"short-dash",esriSLSShortDot:"short-dot",esriSLSShortDashDot:"short-dash-dot",esriSLSShortDashDotDot:"short-dash-dot-dot",esriSLSLongDash:"long-dash",esriSLSLongDashDot:"long-dash-dot"});let Um=W7=class extends k9e{constructor(...t){super(...t),this.type="simple-line",this.style="solid",this.cap="round",this.join="round",this.marker=null,this.miterLimit=2}normalizeCtorArgs(t,e,r,i,n,s){if(t&&typeof t!="string")return t;const o={};return t!=null&&(o.style=t),e!=null&&(o.color=e),r!=null&&(o.width=gn(r)),i!=null&&(o.cap=i),n!=null&&(o.join=n),s!=null&&(o.miterLimit=gn(s)),o}clone(){var t;return new W7({color:ye(this.color),style:this.style,width:this.width,cap:this.cap,join:this.join,miterLimit:this.miterLimit,marker:(t=this.marker)==null?void 0:t.clone()})}hash(){var t,e;return`${super.hash()}.${(t=this.color)==null?void 0:t.hash()}.${this.style}.${this.cap}.${this.join}.${this.miterLimit}.${(e=this.marker)==null?void 0:e.hash()}`}};h([Vt({esriSLS:"simple-line"},{readOnly:!0})],Um.prototype,"type",void 0),h([f({type:uk.apiValues,json:{read:uk.read,write:uk.write}})],Um.prototype,"style",void 0),h([f({type:["butt","round","square"],json:{write:{overridePolicy:(t,e,r)=>({enabled:t!=="round"&&(r==null||r.origin==null)})}}})],Um.prototype,"cap",void 0),h([f({type:["miter","round","bevel"],json:{write:{overridePolicy:(t,e,r)=>({enabled:t!=="round"&&(r==null||r.origin==null)})}}})],Um.prototype,"join",void 0),h([f({types:{key:"type",base:null,defaultKeyValue:"line-marker",typeMap:{"line-marker":B9e}},json:{write:!0,origins:{"web-scene":{write:!1}}}})],Um.prototype,"marker",void 0),h([f({type:Number,json:{read:!1,write:!1}})],Um.prototype,"miterLimit",void 0),Um=W7=h([N("esri.symbols.SimpleLineSymbol")],Um);const Lw=Um;let T3=class extends Rc{constructor(e){super(e),this.outline=null,this.type=null}hash(){return`${this.type}.${this.outline&&this.outline.hash()}`}};h([f({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":Lw}},json:{default:null,write:!0}})],T3.prototype,"outline",void 0),h([f({type:["simple-fill","picture-fill"],readOnly:!0})],T3.prototype,"type",void 0),T3=h([N("esri.symbols.FillSymbol")],T3);const v1e=T3;let lD=class extends ke{constructor(e){super(e)}clone(){}};h([f({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],lD.prototype,"type",void 0),lD=h([N("esri.symbols.patterns.LinePattern3D")],lD);const b1e=lD,V9e=["dash","dash-dot","dot","long-dash","long-dash-dot","long-dash-dot-dot","none","short-dash","short-dash-dot","short-dash-dot-dot","short-dot","solid"];var q7;const G9e=Oc()({dash:"dash","dash-dot":"dash-dot","dash-dot-dot":"long-dash-dot-dot",dot:"dot","long-dash":"long-dash","long-dash-dot":"long-dash-dot",null:"none","short-dash":"short-dash","short-dash-dot":"short-dash-dot","short-dash-dot-dot":"short-dash-dot-dot","short-dot":"short-dot",solid:"solid"});let S3=q7=class extends b1e{constructor(t){super(t),this.type="style",this.style="solid"}clone(){const t={style:this.style};return new q7(t)}};h([f({type:["style"]})],S3.prototype,"type",void 0),h([Vt(G9e),f({type:V9e})],S3.prototype,"style",void 0),S3=q7=h([N("esri.symbols.patterns.LineStylePattern3D")],S3);const XY=S3;let cD=class extends ke{constructor(e){super(e)}clone(){}};h([f({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],cD.prototype,"type",void 0),cD=h([N("esri.symbols.patterns.Pattern3D")],cD);const w1e=cD,j9e=["backward-diagonal","cross","diagonal-cross","forward-diagonal","horizontal","none","solid","vertical"];var X7;let E3=X7=class extends w1e{constructor(t){super(t),this.type="style",this.style="solid"}clone(){const t={style:this.style};return new X7(t)}};h([f({type:["style"]})],E3.prototype,"type",void 0),h([f({type:j9e,json:{read:!0,write:!0}})],E3.prototype,"style",void 0),E3=X7=h([N("esri.symbols.patterns.StylePattern3D")],E3);const x1e=E3,H9e={types:{key:"type",base:w1e,typeMap:{style:x1e}},json:{write:!0}},T1e={types:{key:"type",base:b1e,typeMap:{style:XY}},json:{write:!0}},qA=new it("white");new it("black");const W9e=new it([255,255,255,0]);function q9e(t){return t.r===0&&t.g===0&&t.b===0}var Y7;let XA=Y7=class extends du{constructor(t){super(t),this.colorMixMode=null}clone(){const t={color:this.color!=null?this.color.clone():null,colorMixMode:this.colorMixMode};return new Y7(t)}};h([Vt({multiply:"multiply",replace:"replace",tint:"tint"})],XA.prototype,"colorMixMode",void 0),XA=Y7=h([N("esri.symbols.support.Symbol3DFillMaterial")],XA);function ps(t=O1e){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function iw(t,e,r,i,n,s,o=ps()){return o[0]=t,o[1]=e,o[2]=r,o[3]=i,o[4]=n,o[5]=s,o}function EAt(t,e){const r=isFinite(t[2])||isFinite(t[5]);return new Dr(r?{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],zmin:t[2],zmax:t[5],spatialReference:e}:{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],spatialReference:e})}function SS(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2]),t[3]=Math.max(t[3],e[3]),t[4]=Math.max(t[4],e[4]),t[5]=Math.max(t[5],e[5])}function X9e(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[3]=Math.max(t[3],e[2]),t[4]=Math.max(t[4],e[3])}function Xf(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2]),t[3]=Math.max(t[3],e[0]),t[4]=Math.max(t[4],e[1]),t[5]=Math.max(t[5],e[2])}function lu(t,e,r=0,i=e.length/3){let n=t[0],s=t[1],o=t[2],a=t[3],l=t[4],c=t[5];for(let u=0;u=t[3]?0:t[3]-t[0]}function Nw(t){return t[1]>=t[4]?0:t[4]-t[1]}function c1(t){return t[2]>=t[5]?0:t[5]-t[2]}function S1e(t){const e=Dw(t),r=c1(t),i=Nw(t);return Math.sqrt(e*e+r*r+i*i)}function jd(t,e=[0,0,0]){return e[0]=t[0]+Dw(t)/2,e[1]=t[1]+Nw(t)/2,e[2]=t[2]+c1(t)/2,e}function YM(t,e=[0,0,0]){return e[0]=Dw(t),e[1]=Nw(t),e[2]=c1(t),e}function YY(t,e){return e[0]>=t[0]&&e[1]>=t[1]&&e[2]>=t[2]&&e[0]<=t[3]&&e[1]<=t[4]&&e[2]<=t[5]}function CAt(t,e){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]}function Z9e(t,e){return Math.max(e[0],t[0])<=Math.min(e[3],t[3])&&Math.max(e[1],t[1])<=Math.min(e[4],t[4])&&Math.max(e[2],t[2])<=Math.min(e[5],t[5])}function Hd(t,e){return e==null||Z9e(t,e)}function E1e(t,e,r,i,n=t){return n[0]=t[0]+e,n[1]=t[1]+r,n[2]=t[2]+i,n[3]=t[3]+e,n[4]=t[4]+r,n[5]=t[5]+i,n}function AAt(t,e,r=t){const i=t[0]+Dw(t)/2,n=t[1]+Nw(t)/2,s=t[2]+c1(t)/2;return r[0]=i+(t[0]-i)*e,r[1]=n+(t[1]-n)*e,r[2]=s+(t[2]-s)*e,r[3]=i+(t[3]-i)*e,r[4]=n+(t[4]-n)*e,r[5]=s+(t[5]-s)*e,r}function C1e(t,e,r=t){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r!==t&&(r[3]=t[3],r[4]=t[4],r[5]=t[5]),r}function A1e(t,e,r=t){return r[3]=e[0],r[4]=e[1],r[5]=e[2],r!==t&&(r[0]=t[0],r[1]=t[1],r[2]=t[2]),t}function x6(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function vi(t){return t?x6(t,Vre):ps(Vre)}function ZY(t,e){return e||(e=jt()),e[0]=t[0],e[1]=t[1],e[2]=t[3],e[3]=t[4],e}function OAt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=Number.NEGATIVE_INFINITY,t[3]=e[2],t[4]=e[3],t[5]=Number.POSITIVE_INFINITY,t}function Q9e(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=Number.NEGATIVE_INFINITY,t[3]=i,t[4]=n,t[5]=Number.POSITIVE_INFINITY,t}function Z7(t){return t.length===6}function QY(t){return Dw(t)===0&&Nw(t)===0&&c1(t)===0}function RAt(t,e,r){if(t==null||e==null)return t===e;if(!Z7(t)||!Z7(e))return!1;if(r){for(let i=0;i{const e=Ud(t);return e===0?1:ge(e,.1,4)},nonNullable:!0},lze=["left","right","center"],cze=["baseline","top","middle","bottom"],M1e={type:lze,nonNullable:!0},$1e={type:cze,nonNullable:!0},MAt=8;var J7;let zm=J7=class extends ke{constructor(t){super(t),this.decoration="none",this.family="sans-serif",this.size=9,this.style="normal",this.weight="normal"}castSize(t){return gn(t)}clone(){return new J7({decoration:this.decoration,family:this.family,size:this.size,style:this.style,weight:this.weight})}hash(){return`${this.decoration}.${this.family}.${this.size}.${this.style}.${this.weight}`}};h([f({type:sze,json:{default:"none",write:!0}})],zm.prototype,"decoration",void 0),h([f({type:String,json:{write:!0}})],zm.prototype,"family",void 0),h([f({type:Number,json:{write:{overridePolicy:(t,e,r)=>({enabled:!r||!r.textSymbol3D})}}})],zm.prototype,"size",void 0),h([_i("size")],zm.prototype,"castSize",null),h([f({type:oze,json:{default:"normal",write:!0}})],zm.prototype,"style",void 0),h([f({type:aze,json:{default:"normal",write:!0}})],zm.prototype,"weight",void 0),zm=J7=h([N("esri.symbols.Font")],zm);const T6=zm;function nw(t,e){const r=e&&e.url&&e.url.path;if(t&&r&&(t=iu(t,r,{preserveProtocolRelative:!0}),e.portalItem&&e.readResourcePaths)){const i=n6(t,e.portalItem.itemUrl);i!=null&&uze.test(i)&&e.readResourcePaths.push(e.portalItem.resourceFromPath(i).path)}return K7(t,e&&e.portal)}function ES(t,e,r=lR.YES){if(t==null)return t;!uu(t)&&e&&e.blockedRelativeUrls&&e.blockedRelativeUrls.push(t);let i=iu(t);if(e){const n=e.verifyItemRelativeUrls&&e.verifyItemRelativeUrls.rootPath||e.url&&e.url.path;if(n){const s=K7(n,e.portal),o=K7(i,e.portal);i=n6(o,s,s),i!=null&&i!==o&&i!==t&&e.verifyItemRelativeUrls&&e.verifyItemRelativeUrls.writtenUrls.push(i)}}return i=L1e(i,e==null?void 0:e.portal),uu(i)&&(i=_g(i)),e!=null&&e.resources&&(e!=null&&e.portalItem)&&!uu(i)&&!im(i)&&r===lR.YES&&e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(i),compress:!1}),i}function KY(t,e,r){return nw(t,r)}function sw(t,e,r,i){const n=ES(t,i);n!==void 0&&(e[r]=n)}const I1e=/\/items\/([^\/]+)\/resources\/(.*)/,uze=/^\.\/resources\//;function hze(t){const e=(t==null?void 0:t.match(I1e))??null;return(e==null?void 0:e[1])??null}function dze(t){const e=(t==null?void 0:t.match(I1e))??null;if(e==null)return null;const r=e[2],i=r.lastIndexOf("/");if(i===-1){const{path:o,extension:a}=Dte(r);return{prefix:null,filename:o,extension:a}}const{path:n,extension:s}=Dte(r.slice(i+1));return{prefix:r.slice(0,i),filename:n,extension:s}}function L1e(t,e){return e&&!e.isPortal&&e.urlKey&&e.customBaseUrl?LV(t,`${e.urlKey}.${e.customBaseUrl}`,e.portalHostname):t}function K7(t,e){if(!e||e.isPortal||!e.urlKey||!e.customBaseUrl)return t;const r=`${e.urlKey}.${e.customBaseUrl}`,i=FX();return gS(i,`${i.scheme}://${r}`)?LV(t,e.portalHostname,r):LV(t,r,e.portalHostname)}var lR;(function(t){t[t.YES=0]="YES",t[t.NO=1]="NO"})(lR||(lR={}));const $At=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return lR},ensureMainOnlineDomain:L1e,fromJSON:nw,itemIdFromResourceUrl:hze,prefixAndFilenameFromResourceUrl:dze,read:KY,toJSON:ES,write:sw},Symbol.toStringTag,{value:"Module"}));var eG;const pze=Oc()({circle:"circle",square:"square",cross:"cross",x:"x",kite:"kite",triangle:"triangle"});let gv=eG=class extends ke{constructor(t){super(t)}readHref(t,e,r){return t?nw(t,r):e.dataURI}writeHref(t,e,r,i){t&&(im(t)?e.dataURI=t:(e.href=ES(t,i),uu(e.href)&&(e.href=_g(e.href))))}clone(){return new eG({href:this.href,primitive:this.primitive})}};h([f({type:String,json:{write:!0,read:{source:["href","dataURI"]}}})],gv.prototype,"href",void 0),h([lr("href")],gv.prototype,"readHref",null),h([xr("href",{href:{type:String},dataURI:{type:String}})],gv.prototype,"writeHref",null),h([Vt(pze)],gv.prototype,"primitive",void 0),gv=eG=h([N("esri.symbols.support.IconSymbol3DLayerResource")],gv);const fze="circle";var tG;let nT=tG=class extends xe{constructor(){super(...arguments),this.x=0,this.y=0}clone(){return new tG({x:this.x,y:this.y})}};h([f({type:Number})],nT.prototype,"x",void 0),h([f({type:Number})],nT.prototype,"y",void 0),nT=tG=h([N("esri.symbols.support.Symbol3DAnchorPosition2D")],nT);var rG;let C3=rG=class extends ke{constructor(t){super(t),this.color=new it([0,0,0,1]),this.size=up(1)}clone(){const t={color:this.color!=null?this.color.clone():null,size:this.size};return new rG(t)}};h([f(Jg)],C3.prototype,"color",void 0),h([f(qf)],C3.prototype,"size",void 0),C3=rG=h([N("esri.symbols.support.Symbol3DIconOutline")],C3);var f2;const D1e="esri.symbols.IconSymbol3DLayer";let Qp=f2=class extends om{constructor(t){super(t),this.material=null,this.resource=null,this.type="icon",this.size=12,this.anchor="center",this.anchorPosition=null,this.outline=null}clone(){return new f2({anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),enabled:this.enabled,material:this.material!=null?this.material.clone():null,outline:this.outline!=null?this.outline.clone():null,resource:this.resource&&this.resource.clone(),size:this.size})}static fromSimpleMarkerSymbol(t){const e=t.color||qA,r=Gre(t),i=t.outline&&t.outline.width>0?{size:t.outline.width,color:(t.outline.color||qA).clone()}:null;return new f2({size:t.size,resource:{primitive:gze(t.style)},material:{color:e},outline:i,anchor:r?"relative":void 0,anchorPosition:r})}static fromPictureMarkerSymbol(t){const e=!t.color||q9e(t.color)?qA:t.color,r=Gre(t);return new f2({size:t.width<=t.height?t.height:t.width,resource:{href:t.url},material:{color:e.clone()},anchor:r?"relative":void 0,anchorPosition:r})}static fromCIMSymbol(t){return new f2({resource:{href:g0e({mediaType:"application/json",data:JSON.stringify(t.data)})}})}};function Gre(t){const e="width"in t?t.width:t.size,r="height"in t?t.height:t.size,i=jre(t.xoffset),n=jre(t.yoffset);return(i||n)&&e&&r?{x:-i/e,y:n/r}:null}function jre(t){return isFinite(t)?t:0}h([f({type:du,json:{write:!0}})],Qp.prototype,"material",void 0),h([f({type:gv,json:{write:!0}})],Qp.prototype,"resource",void 0),h([Vt({Icon:"icon"},{readOnly:!0})],Qp.prototype,"type",void 0),h([f(qf)],Qp.prototype,"size",void 0),h([Vt({center:"center",left:"left",right:"right",top:"top",bottom:"bottom",topLeft:"top-left",topRight:"top-right",bottomLeft:"bottom-left",bottomRight:"bottom-right",relative:"relative"}),f({json:{default:"center"}})],Qp.prototype,"anchor",void 0),h([f({type:nT,json:{type:[Number],read:{reader:t=>new nT({x:t[0],y:t[1]})},write:{writer:(t,e)=>{e.anchorPosition=[t.x,t.y]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],Qp.prototype,"anchorPosition",void 0),h([f({type:C3,json:{write:!0}})],Qp.prototype,"outline",void 0),Qp=f2=h([N(D1e)],Qp);const mze={circle:"circle",cross:"cross",diamond:"kite",square:"square",x:"x",triangle:"triangle",path:null};function gze(t){return mze[t]||(J.getLogger(D1e).warn(`${t} cannot be mapped to Icon symbol. Fallback to "circle"`),"circle")}const i_=Qp;let yv=class extends Cu(ke){constructor(e){super(e),this.type="style",this.placement="begin-end",this.style="arrow",this.color=null}equals(e){return e!=null&&e.placement===this.placement&&e.style===this.style&&(this.color==null&&e.color==null||this.color!=null&&e.color!=null&&this.color.toJSON()===e.color.toJSON())}};h([f({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],yv.prototype,"type",void 0),h([f({type:z9e,json:{default:"begin-end",write:!0}})],yv.prototype,"placement",void 0),h([f({type:_1e,json:{default:"arrow",write:!0}})],yv.prototype,"style",void 0),h([f({type:it,json:{type:[mn],default:null,write:!0}})],yv.prototype,"color",void 0),yv=h([N("esri.symbols.LineStyleMarker3D")],yv);const iG=yv;var hD;let Jp=hD=class extends om{constructor(t){super(t),this.material=null,this.type="line",this.join="miter",this.cap="butt",this.size=up(1),this.pattern=null,this.marker=null}clone(){const t={enabled:this.enabled,material:this.material!=null?this.material.clone():null,size:this.size,join:this.join,cap:this.cap,pattern:this.pattern!=null?this.pattern.clone():null,marker:this.marker!=null?this.marker.clone():null};return new hD(t)}static fromSimpleLineSymbol(t){var r;const e={enabled:!0,size:t.width??up(1),cap:t.cap||"butt",join:t.join||"miter",pattern:t.style&&t.style!=="inside-frame"?new XY({style:t.style}):null,material:new du({color:(t.color||qA).clone()}),marker:t.marker?new iG({placement:t.marker.placement,style:t.marker.style,color:((r=t.marker.color)==null?void 0:r.clone())??null}):null};return new hD(e)}};h([f({type:du,json:{write:!0}})],Jp.prototype,"material",void 0),h([Vt({Line:"line"},{readOnly:!0})],Jp.prototype,"type",void 0),h([f({type:R1e,json:{write:!0,default:"miter"}})],Jp.prototype,"join",void 0),h([f({type:JY,json:{write:!0,default:"butt"}})],Jp.prototype,"cap",void 0),h([f(qf)],Jp.prototype,"size",void 0),h([f(T1e)],Jp.prototype,"pattern",void 0),h([f({types:{key:"type",base:iG,typeMap:{style:iG}},json:{write:!0}})],Jp.prototype,"marker",void 0),Jp=hD=h([N("esri.symbols.LineSymbol3DLayer")],Jp);const TP=Jp;var nG;const yze=Oc()({sphere:"sphere",cylinder:"cylinder",cube:"cube",cone:"cone",diamond:"diamond",tetrahedron:"tetrahedron",invertedCone:"inverted-cone"});let A3=nG=class extends ke{clone(){return new nG({href:this.href,primitive:this.primitive})}};h([f({type:String,json:{read:KY,write:sw}})],A3.prototype,"href",void 0),h([Vt(yze)],A3.prototype,"primitive",void 0),A3=nG=h([N("esri.symbols.support.ObjectSymbol3DLayerResource")],A3);const N1e="sphere";var sG;let Zv=sG=class extends xe{constructor(){super(...arguments),this.x=0,this.y=0,this.z=0}clone(){return new sG({x:this.x,y:this.y,z:this.z})}};h([f({type:Number})],Zv.prototype,"x",void 0),h([f({type:Number})],Zv.prototype,"y",void 0),h([f({type:Number})],Zv.prototype,"z",void 0),Zv=sG=h([N("esri.symbols.support.Symbol3DAnchorPosition3D")],Zv);var oG;let Ra=oG=class extends om{constructor(t){super(t),this.material=null,this.castShadows=!0,this.resource=null,this.type="object",this.width=void 0,this.height=void 0,this.depth=void 0,this.anchor=void 0,this.anchorPosition=void 0,this.heading=void 0,this.tilt=void 0,this.roll=void 0}clone(){return new oG({heading:this.heading,tilt:this.tilt,roll:this.roll,anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),depth:this.depth,enabled:this.enabled,height:this.height,material:this.material!=null?this.material.clone():null,castShadows:this.castShadows,resource:this.resource&&this.resource.clone(),width:this.width})}get isPrimitive(){return!this.resource||typeof this.resource.href!="string"}};h([f({type:du,json:{write:!0}})],Ra.prototype,"material",void 0),h([f({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],Ra.prototype,"castShadows",void 0),h([f({type:A3,json:{write:!0}})],Ra.prototype,"resource",void 0),h([Vt({Object:"object"},{readOnly:!0})],Ra.prototype,"type",void 0),h([f({type:Number,json:{write:!0}})],Ra.prototype,"width",void 0),h([f({type:Number,json:{write:!0}})],Ra.prototype,"height",void 0),h([f({type:Number,json:{write:!0}})],Ra.prototype,"depth",void 0),h([Vt({center:"center",top:"top",bottom:"bottom",origin:"origin",relative:"relative"}),f({json:{default:"origin"}})],Ra.prototype,"anchor",void 0),h([f({type:Zv,json:{type:[Number],read:{reader:t=>new Zv({x:t[0],y:t[1],z:t[2]})},write:{writer:(t,e)=>{e.anchorPosition=[t.x,t.y,t.z]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],Ra.prototype,"anchorPosition",void 0),h([f({type:Number,json:{write:!0}})],Ra.prototype,"heading",void 0),h([f({type:Number,json:{write:!0}})],Ra.prototype,"tilt",void 0),h([f({type:Number,json:{write:!0}})],Ra.prototype,"roll",void 0),h([f({readOnly:!0})],Ra.prototype,"isPrimitive",null),Ra=oG=h([N("esri.symbols.ObjectSymbol3DLayer")],Ra);const eZ=Ra;var aG;let dl=aG=class extends om{constructor(t){super(t),this.material=null,this.castShadows=!0,this.type="path",this.profile="circle",this.join="miter",this.cap="butt",this.width=void 0,this.height=void 0,this.anchor="center",this.profileRotation="all"}readWidth(t,e){return t??(e.height==null&&e.size!=null?e.size:void 0)}readHeight(t,e){return t??(e.width==null&&e.size!=null?e.size:void 0)}clone(){return new aG({enabled:this.enabled,material:this.material!=null?this.material.clone():null,castShadows:this.castShadows,profile:this.profile,join:this.join,cap:this.cap,width:this.width,height:this.height,profileRotation:this.profileRotation,anchor:this.anchor})}};h([f({type:du,json:{write:!0}})],dl.prototype,"material",void 0),h([f({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],dl.prototype,"castShadows",void 0),h([Vt({Path:"path"},{readOnly:!0})],dl.prototype,"type",void 0),h([f({type:["circle","quad"],json:{write:!0,default:"circle"}})],dl.prototype,"profile",void 0),h([f({type:R1e,json:{write:!0,default:"miter"}})],dl.prototype,"join",void 0),h([f({type:nze,json:{write:!0,default:"butt"}})],dl.prototype,"cap",void 0),h([f({type:Number,json:{write:{enabled:!0,target:{width:{type:Number},size:{type:Number}}}}})],dl.prototype,"width",void 0),h([lr("width",["width","size","height"])],dl.prototype,"readWidth",null),h([f({type:Number,json:{write:!0}})],dl.prototype,"height",void 0),h([lr("height",["height","size","width"])],dl.prototype,"readHeight",null),h([f({type:["center","bottom","top"],json:{write:!0,default:"center"}})],dl.prototype,"anchor",void 0),h([f({type:["heading","all"],json:{write:!0,default:"all"}})],dl.prototype,"profileRotation",void 0),dl=aG=h([N("esri.symbols.PathSymbol3DLayer")],dl);const tZ=dl;var lG;let sT=lG=class extends ke{constructor(){super(...arguments),this.color=new it([0,0,0,1]),this.size=0}clone(){const t={color:ye(this.color),size:this.size};return new lG(t)}};h([f(Jg)],sT.prototype,"color",void 0),h([f(qf)],sT.prototype,"size",void 0),sT=lG=h([N("esri.symbols.support.Symbol3DHalo")],sT);let YA=class extends Cu(ke){constructor(e){super(e),this.color=null}};h([f(Jg)],YA.prototype,"color",void 0),YA=h([N("esri.symbols.support.Symbol3DTextBackground")],YA);var dD;let Wl=dD=class extends om{constructor(t){super(t),this._userSize=void 0,this.halo=null,this.horizontalAlignment="center",this.lineHeight=1,this.material=null,this.background=null,this.text=null,this.type="text",this.verticalAlignment="baseline"}get font(){return this._get("font")||null}set font(t){t!=null&&this._userSize!=null&&(t.size=this._userSize),this._set("font",t)}writeFont(t,e,r,i){const n={...i,textSymbol3D:!0};e.font=t.write({},n),delete e.font.size}get size(){return this._userSize!=null?this._userSize:this.font!=null&&this.font.size!=null?this.font.size:9}set size(t){this._userSize=t,this.font!=null&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){const t=new dD({enabled:this.enabled,font:this.font&&ye(this.font),halo:this.halo&&ye(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:this.material!=null?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:ye(this.background)});return t._userSize=this._userSize,t}static fromTextSymbol(t){return new dD({font:t.font!=null?t.font.clone():new T6,halo:_ze(t.haloColor,t.haloSize),horizontalAlignment:t.horizontalAlignment,lineHeight:t.lineHeight,material:t.color?new du({color:t.color.clone()}):null,text:t.text,verticalAlignment:t.verticalAlignment,background:t.backgroundColor?new YA({color:t.backgroundColor.clone()}):null})}};function _ze(t,e){return t&&e!=null&&e>0?new sT({color:ye(t),size:e}):null}h([f({type:T6,json:{write:!0}})],Wl.prototype,"font",null),h([xr("font")],Wl.prototype,"writeFont",null),h([f({type:sT,json:{write:!0}})],Wl.prototype,"halo",void 0),h([f({...M1e,json:{default:"center",write:!0}})],Wl.prototype,"horizontalAlignment",void 0),h([f({...P1e,json:{default:1,write:!0}})],Wl.prototype,"lineHeight",void 0),h([f({type:du,json:{write:!0}})],Wl.prototype,"material",void 0),h([f({type:YA,json:{write:!0}})],Wl.prototype,"background",void 0),h([f(qf)],Wl.prototype,"size",null),h([f({type:String,json:{write:!0}})],Wl.prototype,"text",void 0),h([Vt({Text:"text"},{readOnly:!0})],Wl.prototype,"type",void 0),h([f({...$1e,json:{default:"baseline",write:!0}})],Wl.prototype,"verticalAlignment",void 0),Wl=dD=h([N("esri.symbols.TextSymbol3DLayer")],Wl);const Uw=Wl;var cG;let sy=cG=class extends om{constructor(t){super(t),this.color=uG.clone(),this.type="water",this.waterbodySize="medium",this.waveDirection=null,this.waveStrength="moderate"}clone(){return new cG({color:ye(this.color),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};h([f({type:it,nonNullable:!0,json:{type:[mn],write:(t,e,r)=>e[r]=t.toArray(it.AlphaMode.UNLESS_OPAQUE),default:()=>uG.clone(),defaultEquals:t=>t.toCss(!0)===uG.toCss(!0)}})],sy.prototype,"color",void 0),h([Vt({Water:"water"},{readOnly:!0})],sy.prototype,"type",void 0),h([f({type:["small","medium","large"],json:{write:!0,default:"medium"}})],sy.prototype,"waterbodySize",void 0),h([f({type:Number,json:{write:!0,default:null}})],sy.prototype,"waveDirection",void 0),h([f({type:["calm","rippled","slight","moderate"],json:{write:!0,default:"moderate"}})],sy.prototype,"waveStrength",void 0),sy=cG=h([N("esri.symbols.WaterSymbol3DLayer")],sy);const uG=new it([0,119,190]),F1e=sy;var hG;let _v=hG=class extends xe{constructor(t){super(t),this.name=null,this.styleUrl=null,this.styleName=null,this.portal=null}clone(){return new hG({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}};h([f({type:String})],_v.prototype,"name",void 0),h([f({type:String})],_v.prototype,"styleUrl",void 0),h([f({type:String})],_v.prototype,"styleName",void 0),h([f({type:Mh})],_v.prototype,"portal",void 0),_v=hG=h([N("esri.symbols.support.StyleOrigin")],_v);const cR=_v;var dG;let Ob=dG=class extends xe{constructor(){super(...arguments),this.url=""}clone(){return new dG({url:this.url})}};h([f({type:String})],Ob.prototype,"url",void 0),Ob=dG=h([N("esri.symbols.support.Thumbnail")],Ob);const U1e={icon:i_,object:eZ,line:TP,path:tZ,fill:Fw,extrude:y1e,text:Uw,water:F1e},vze=ir.ofType({base:om,key:"type",typeMap:U1e,errorContext:"symbol-layer"});let Kp=class extends Rc{constructor(e){super(e),this.styleOrigin=null,this.thumbnail=null,this.type=null;const r=this.__accessor__&&this.__accessor__.metadatas&&this.__accessor__.metadatas.symbolLayers,i=r&&r.type||ir;this._set("symbolLayers",new i)}get color(){return null}set color(e){this.constructed&&J.getLogger(this).error("Symbol3D does not support colors on the symbol level. Colors may be set on individual symbol layer materials instead.")}set symbolLayers(e){qb(e,this._get("symbolLayers"))}readStyleOrigin(e,r,i){if(e.styleUrl&&e.name){const n=nw(e.styleUrl,i);return new cR({styleUrl:n,name:e.name})}if(e.styleName&&e.name)return new cR({portal:i&&i.portal||Mh.getDefault(),styleName:e.styleName,name:e.name});i&&i.messages&&i.messages.push(new D_("symbol3d:incomplete-style-origin","Style origin requires either a 'styleUrl' or 'styleName' and a 'name' property",{context:i,definition:e}))}writeStyleOrigin(e,r,i,n){if(e.styleUrl&&e.name){let s=ES(e.styleUrl,n);uu(s)&&(s=_g(s)),r.styleOrigin={styleUrl:s,name:e.name}}else e.styleName&&e.name&&(e.portal&&n&&n.portal&&!U4e(e.portal.restUrl,n.portal.restUrl)?n&&n.messages&&n.messages.push(new D_("symbol:cross-portal","The symbol style origin cannot be persisted because it refers to an item on a different portal than the one being saved to.",{symbol:this})):r.styleOrigin={styleName:e.styleName,name:e.name})}normalizeCtorArgs(e){return e instanceof om||e&&U1e[e.type]?{symbolLayers:[e]}:Array.isArray(e)?{symbolLayers:e}:e}};h([f({json:{read:!1,write:!1}})],Kp.prototype,"color",null),h([f({type:vze,nonNullable:!0,json:{write:!0}}),_i(o0e)],Kp.prototype,"symbolLayers",null),h([f({type:cR})],Kp.prototype,"styleOrigin",void 0),h([lr("styleOrigin")],Kp.prototype,"readStyleOrigin",null),h([xr("styleOrigin",{"styleOrigin.styleUrl":{type:String},"styleOrigin.styleName":{type:String},"styleOrigin.name":{type:String}})],Kp.prototype,"writeStyleOrigin",null),h([f({type:Ob,json:{read:!1}})],Kp.prototype,"thumbnail",void 0),h([f({type:["point-3d","line-3d","polygon-3d","mesh-3d","label-3d"],readOnly:!0})],Kp.prototype,"type",void 0),Kp=h([N("esri.symbols.Symbol3D")],Kp);const _E=Kp;let O3=class extends ke{constructor(e){super(e),this.visible=!0}clone(){}};h([f({type:["line"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],O3.prototype,"type",void 0),h([f({readOnly:!0})],O3.prototype,"visible",void 0),O3=h([N("esri.symbols.callouts.Callout3D")],O3);const k1e=O3;var pG;let pD=pG=class extends ke{constructor(){super(...arguments),this.color=new it("white")}clone(){return new pG({color:ye(this.color)})}};h([f(Jg)],pD.prototype,"color",void 0),pD=pG=h([N("esri.symbols.callouts.LineCallout3DBorder")],pD);const z1e=pD;Object.freeze(Object.defineProperty({__proto__:null,default:z1e},Symbol.toStringTag,{value:"Module"}));var fG;let oy=fG=class extends k1e{constructor(t){super(t),this.type="line",this.color=new it([0,0,0,1]),this.size=up(1),this.border=null}get visible(){return this.size>0&&this.color!=null&&this.color.a>0}clone(){return new fG({color:ye(this.color),size:this.size,border:ye(this.border)})}};h([Vt({line:"line"},{readOnly:!0})],oy.prototype,"type",void 0),h([f(Jg)],oy.prototype,"color",void 0),h([f(qf)],oy.prototype,"size",void 0),h([f({type:z1e,json:{write:!0}})],oy.prototype,"border",void 0),h([f({readOnly:!0})],oy.prototype,"visible",null),oy=fG=h([N("esri.symbols.callouts.LineCallout3D")],oy);const bze=oy;function rZ(t){if(!t)return!1;const e=t.verticalOffset;return!!e&&!(e.screenLength<=0||e.maxWorldLength!=null&&e.maxWorldLength<=0)}function B1e(t){if(!t||!t.supportsCallout||!t.supportsCallout())return!1;const e=t.callout;return!!e&&!!e.visible&&!!rZ(t)}function iZ(t){return t.type==="point-3d"||t.type==="label-3d"}function V1e(t){return t.horizontalAlignment==="center"}const G1e={types:{key:"type",base:k1e,typeMap:{line:bze}},json:{write:!0}};var mG;let m2=mG=class extends ke{constructor(t){super(t),this.screenLength=0,this.minWorldLength=0,this.maxWorldLength=null}clone(){return new mG({screenLength:this.screenLength,minWorldLength:this.minWorldLength,maxWorldLength:this.maxWorldLength})}};h([f(qf)],m2.prototype,"screenLength",void 0),h([f({type:Number,nonNullable:!0,json:{write:!0,default:0}})],m2.prototype,"minWorldLength",void 0),h([f({type:Number,json:{write:!0}})],m2.prototype,"maxWorldLength",void 0),m2=mG=h([N("esri.symbols.support.Symbol3DVerticalOffset")],m2);const j1e=m2;var fD;const H1e=ir.ofType({base:null,key:"type",typeMap:{text:Uw}});let ay=fD=class extends _E{constructor(t){super(t),this.verticalOffset=null,this.callout=null,this.styleOrigin=null,this.symbolLayers=new H1e,this.type="label-3d"}supportsCallout(){return!0}hasVisibleCallout(){return B1e(this)}hasVisibleVerticalOffset(){return rZ(this)}clone(){return new fD({styleOrigin:ye(this.styleOrigin),symbolLayers:ye(this.symbolLayers),thumbnail:ye(this.thumbnail),callout:ye(this.callout),verticalOffset:ye(this.verticalOffset)})}static fromTextSymbol(t){return new fD({symbolLayers:[Uw.fromTextSymbol(t)]})}};h([f({type:j1e,json:{write:!0}})],ay.prototype,"verticalOffset",void 0),h([f(G1e)],ay.prototype,"callout",void 0),h([f({json:{read:!1,write:!1}})],ay.prototype,"styleOrigin",void 0),h([f({type:H1e})],ay.prototype,"symbolLayers",void 0),h([Vt({LabelSymbol3D:"label-3d"},{readOnly:!0})],ay.prototype,"type",void 0),ay=fD=h([N("esri.symbols.LabelSymbol3D")],ay);const S6=ay;var mD;const W1e=ir.ofType({base:null,key:"type",typeMap:{line:TP,path:tZ}}),wze=ir.ofType({base:null,key:"type",typeMap:{line:TP,path:tZ}});let R3=mD=class extends _E{constructor(t){super(t),this.symbolLayers=new W1e,this.type="line-3d"}clone(){return new mD({styleOrigin:ye(this.styleOrigin),symbolLayers:ye(this.symbolLayers),thumbnail:ye(this.thumbnail)})}static fromSimpleLineSymbol(t){return new mD({symbolLayers:[TP.fromSimpleLineSymbol(t)]})}};h([f({type:W1e,json:{type:wze}})],R3.prototype,"symbolLayers",void 0),h([Vt({LineSymbol3D:"line-3d"},{readOnly:!0})],R3.prototype,"type",void 0),R3=mD=h([N("esri.symbols.LineSymbol3D")],R3);const E6=R3;let ly=class extends Rc{constructor(e){super(e),this.angle=0,this.type=null,this.xoffset=0,this.yoffset=0,this.size=9}hash(){return`${this.type}.${this.angle}.${this.size}.${this.xoffset}.${this.yoffset}`}};h([f({type:Number,json:{read:t=>t&&-1*t,write:(t,e)=>e.angle=t&&-1*t}})],ly.prototype,"angle",void 0),h([f({type:["simple-marker","picture-marker"],readOnly:!0})],ly.prototype,"type",void 0),h([f({type:Number,cast:gn,json:{write:!0}})],ly.prototype,"xoffset",void 0),h([f({type:Number,cast:gn,json:{write:!0}})],ly.prototype,"yoffset",void 0),h([f({type:Number,cast:t=>t==="auto"?t:gn(t),json:{write:!0}})],ly.prototype,"size",void 0),ly=h([N("esri.symbols.MarkerSymbol")],ly);const q1e=ly;var gD;const X1e=ir.ofType({base:null,key:"type",typeMap:{fill:Fw}});let P3=gD=class extends _E{constructor(t){super(t),this.symbolLayers=new X1e,this.type="mesh-3d"}clone(){return new gD({styleOrigin:ye(this.styleOrigin),symbolLayers:ye(this.symbolLayers),thumbnail:ye(this.thumbnail)})}static fromSimpleFillSymbol(t){return new gD({symbolLayers:[Fw.fromSimpleFillSymbol(t)]})}};h([f({type:X1e})],P3.prototype,"symbolLayers",void 0),h([Vt({MeshSymbol3D:"mesh-3d"},{readOnly:!0})],P3.prototype,"type",void 0),P3=gD=h([N("esri.symbols.MeshSymbol3D")],P3);const vE=P3;function xze(t,e,r){return e.imageData?g0e({mediaType:e.contentType||"image/png",isBase64:!0,data:e.imageData}):Y1e(e.url,r)}function Y1e(t,e){var r;return Sze(e)&&!uu(t)&&((r=e==null?void 0:e.layer)!=null&&r.parsedUrl)?s6(e.layer.parsedUrl.path,"images",t):nw(t,e)}function Tze(t,e,r,i){if(im(t)){const n=Xb(t);if(!n)return;e.contentType=n.mediaType,e.imageData=n.data,r&&r.imageData===e.imageData&&r.url&&sw(r.url,e,"url",i)}else sw(t,e,"url",i)}const Z1e={json:{read:{source:["imageData","url"],reader:xze},write:{writer(t,e,r,i){Tze(t,e,this.source,i)}}}},Q1e={readOnly:!0,json:{read:{source:["imageData","url"],reader(t,e,r){const i={};return e.imageData&&(i.imageData=e.imageData),e.contentType&&(i.contentType=e.contentType),e.url&&(i.url=Y1e(e.url,r)),i}}}};function Sze(t){var e,r;return!(t==null||t.origin!=="service"&&t.origin!=="portal-item"||((e=t.layer)==null?void 0:e.type)!=="feature"&&((r=t.layer)==null?void 0:r.type)!=="stream")}var gG;let ju=gG=class extends v1e{constructor(...t){super(...t),this.type="picture-fill",this.url=null,this.xscale=1,this.yscale=1,this.width=12,this.height=12,this.xoffset=0,this.yoffset=0,this.source=null}normalizeCtorArgs(t,e,r,i){if(t&&typeof t!="string"&&t.imageData==null)return t;const n={};return t&&(n.url=t),e&&(n.outline=e),r!=null&&(n.width=gn(r)),i!=null&&(n.height=gn(i)),n}clone(){const t=new gG({color:ye(this.color),height:this.height,outline:this.outline&&this.outline.clone(),url:this.url,width:this.width,xoffset:this.xoffset,xscale:this.xscale,yoffset:this.yoffset,yscale:this.yscale});return t._set("source",ye(this.source)),t}hash(){var t;return`${super.hash()}.${(t=this.color)==null?void 0:t.hash()}.${this.height}.${this.url}.${this.width}.${this.xoffset}.${this.xscale}.${this.yoffset}.${this.yscale}`}};h([Vt({esriPFS:"picture-fill"},{readOnly:!0})],ju.prototype,"type",void 0),h([f(Z1e)],ju.prototype,"url",void 0),h([f({type:Number,json:{write:!0}})],ju.prototype,"xscale",void 0),h([f({type:Number,json:{write:!0}})],ju.prototype,"yscale",void 0),h([f({type:Number,cast:gn,json:{write:!0}})],ju.prototype,"width",void 0),h([f({type:Number,cast:gn,json:{write:!0}})],ju.prototype,"height",void 0),h([f({type:Number,cast:gn,json:{write:!0}})],ju.prototype,"xoffset",void 0),h([f({type:Number,cast:gn,json:{write:!0}})],ju.prototype,"yoffset",void 0),h([f(Q1e)],ju.prototype,"source",void 0),ju=gG=h([N("esri.symbols.PictureFillSymbol")],ju);const J1e=ju;var yG;let dd=yG=class extends q1e{constructor(...t){super(...t),this.color=null,this.type="picture-marker",this.url=null,this.source=null,this.height=12,this.width=12,this.size=null}normalizeCtorArgs(t,e,r){if(t&&typeof t!="string"&&t.imageData==null)return t;const i={};return t&&(i.url=t),e!=null&&(i.width=gn(e)),r!=null&&(i.height=gn(r)),i}readHeight(t,e){return e.size||t}readWidth(t,e){return e.size||t}clone(){const t=new yG({angle:this.angle,height:this.height,url:this.url,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset});return t._set("source",ye(this.source)),t}hash(){return`${super.hash()}.${this.height}.${this.url}.${this.width}`}};h([f({json:{write:!1}})],dd.prototype,"color",void 0),h([Vt({esriPMS:"picture-marker"},{readOnly:!0})],dd.prototype,"type",void 0),h([f(Z1e)],dd.prototype,"url",void 0),h([f(Q1e)],dd.prototype,"source",void 0),h([f({type:Number,cast:gn,json:{write:!0}})],dd.prototype,"height",void 0),h([lr("height",["height","size"])],dd.prototype,"readHeight",null),h([f({type:Number,cast:gn,json:{write:!0}})],dd.prototype,"width",void 0),h([f({json:{write:!1}})],dd.prototype,"size",void 0),dd=yG=h([N("esri.symbols.PictureMarkerSymbol")],dd);const C6=dd;var vv;const K1e=ir.ofType({base:null,key:"type",typeMap:{icon:i_,object:eZ,text:Uw}});let bv=vv=class extends _E{constructor(t){super(t),this.verticalOffset=null,this.callout=null,this.symbolLayers=new K1e,this.type="point-3d"}supportsCallout(){if((this.symbolLayers?this.symbolLayers.length:0)<1)return!1;for(const t of this.symbolLayers.items)switch(t.type){case"icon":case"text":case"object":continue;default:return!1}return!0}hasVisibleCallout(){return B1e(this)}hasVisibleVerticalOffset(){return rZ(this)}clone(){return new vv({verticalOffset:ye(this.verticalOffset),callout:ye(this.callout),styleOrigin:ye(this.styleOrigin),symbolLayers:ye(this.symbolLayers),thumbnail:ye(this.thumbnail)})}static fromSimpleMarkerSymbol(t){return new vv({symbolLayers:[i_.fromSimpleMarkerSymbol(t)]})}static fromPictureMarkerSymbol(t){return new vv({symbolLayers:[i_.fromPictureMarkerSymbol(t)]})}static fromCIMSymbol(t){var i,n;if(((n=(i=t.data)==null?void 0:i.symbol)==null?void 0:n.type)!=="CIMPointSymbol")return null;const r=t.data.symbol;return new vv(r!=null&&r.callout?{symbolLayers:[i_.fromCIMSymbol(t)],callout:{type:"line",size:.5,color:[0,0,0]},verticalOffset:{screenLength:40}}:{symbolLayers:[i_.fromCIMSymbol(t)]})}static fromTextSymbol(t){return new vv({symbolLayers:[Uw.fromTextSymbol(t)]})}};h([f({type:j1e,json:{write:!0}})],bv.prototype,"verticalOffset",void 0),h([f(G1e)],bv.prototype,"callout",void 0),h([f({type:K1e,json:{origins:{"web-scene":{write:!0}}}})],bv.prototype,"symbolLayers",void 0),h([Vt({PointSymbol3D:"point-3d"},{readOnly:!0})],bv.prototype,"type",void 0),bv=vv=h([N("esri.symbols.PointSymbol3D")],bv);const n_=bv;var M3;const eve=ir.ofType({base:null,key:"type",typeMap:{extrude:y1e,fill:Fw,icon:i_,line:TP,object:eZ,text:Uw,water:F1e}});let $3=M3=class extends _E{constructor(t){super(t),this.symbolLayers=new eve,this.type="polygon-3d"}clone(){return new M3({styleOrigin:ye(this.styleOrigin),symbolLayers:ye(this.symbolLayers),thumbnail:ye(this.thumbnail)})}static fromJSON(t){const e=new M3;if(e.read(t),e.symbolLayers.length===2&&e.symbolLayers.at(0).type==="fill"&&e.symbolLayers.at(1).type==="line"){const r=e.symbolLayers.at(0),i=e.symbolLayers.at(1);!i.enabled||t.symbolLayers&&t.symbolLayers[1]&&t.symbolLayers[1].enable===!1||(r.outline={size:i.size,color:i.material!=null?i.material.color:null}),e.symbolLayers.removeAt(1)}return e}static fromSimpleFillSymbol(t){return new M3({symbolLayers:[Fw.fromSimpleFillSymbol(t)]})}};h([f({type:eve,json:{write:!0}})],$3.prototype,"symbolLayers",void 0),h([Vt({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],$3.prototype,"type",void 0),$3=M3=h([N("esri.symbols.PolygonSymbol3D")],$3);const SP=$3;var _G;const pk=new zn({esriSFSSolid:"solid",esriSFSNull:"none",esriSFSHorizontal:"horizontal",esriSFSVertical:"vertical",esriSFSForwardDiagonal:"forward-diagonal",esriSFSBackwardDiagonal:"backward-diagonal",esriSFSCross:"cross",esriSFSDiagonalCross:"diagonal-cross"});let wv=_G=class extends v1e{constructor(...t){super(...t),this.color=new it([0,0,0,.25]),this.outline=new Lw,this.type="simple-fill",this.style="solid"}normalizeCtorArgs(t,e,r){if(t&&typeof t!="string")return t;const i={};return t&&(i.style=t),e&&(i.outline=e),r&&(i.color=r),i}clone(){return new _G({color:ye(this.color),outline:this.outline&&this.outline.clone(),style:this.style})}hash(){return`${super.hash()}${this.style}.${this.color&&this.color.hash()}`}};h([f()],wv.prototype,"color",void 0),h([f()],wv.prototype,"outline",void 0),h([Vt({esriSFS:"simple-fill"},{readOnly:!0})],wv.prototype,"type",void 0),h([f({type:pk.apiValues,json:{read:pk.read,write:pk.write}})],wv.prototype,"style",void 0),wv=_G=h([N("esri.symbols.SimpleFillSymbol")],wv);const nZ=wv;var vG;const fk=new zn({esriSMSCircle:"circle",esriSMSSquare:"square",esriSMSCross:"cross",esriSMSX:"x",esriSMSDiamond:"diamond",esriSMSTriangle:"triangle",esriSMSPath:"path"});let ef=vG=class extends q1e{constructor(...t){super(...t),this.color=new it([255,255,255,.25]),this.type="simple-marker",this.size=12,this.style="circle",this.outline=new Lw}normalizeCtorArgs(t,e,r,i){if(t&&typeof t!="string")return t;const n={};return t&&(n.style=t),e!=null&&(n.size=gn(e)),r&&(n.outline=r),i&&(n.color=i),n}writeColor(t,e){t&&this.style!=="x"&&this.style!=="cross"&&(e.color=t.toJSON()),t===null&&(e.color=null)}set path(t){this.style="path",this._set("path",t)}clone(){return new vG({angle:this.angle,color:ye(this.color),outline:this.outline&&this.outline.clone(),path:this.path,size:this.size,style:this.style,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){var t;return`${super.hash()}.${this.color&&this.color.hash()}.${this.path}.${this.style}.${(t=this.outline)==null?void 0:t.hash()}`}};h([f()],ef.prototype,"color",void 0),h([xr("color")],ef.prototype,"writeColor",null),h([Vt({esriSMS:"simple-marker"},{readOnly:!0})],ef.prototype,"type",void 0),h([f()],ef.prototype,"size",void 0),h([f({type:fk.apiValues,json:{read:fk.read,write:fk.write}})],ef.prototype,"style",void 0),h([f({type:String,json:{write:!0}})],ef.prototype,"path",null),h([f({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":Lw}},json:{default:null,write:!0}})],ef.prototype,"outline",void 0),ef=vG=h([N("esri.symbols.SimpleMarkerSymbol")],ef);const A6=ef;var bG;let wn=bG=class extends Rc{constructor(...t){super(...t),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new T6,this.horizontalAlignment="center",this.kerning=!0,this.haloColor=null,this.haloSize=null,this.rightToLeft=null,this.rotated=!1,this.text="",this.type="text",this.verticalAlignment="baseline",this.xoffset=0,this.yoffset=0,this.angle=0,this.width=null,this.lineWidth=192,this.lineHeight=1}normalizeCtorArgs(t,e,r){if(t&&typeof t!="string")return t;const i={};return t&&(i.text=t),e&&(i.font=e),r&&(i.color=r),i}writeLineWidth(t,e,r,i){i&&typeof i!="string"?i.origin:e[r]=t}castLineWidth(t){return gn(t)}writeLineHeight(t,e,r,i){i&&typeof i!="string"?i.origin:e[r]=t}clone(){return new bG({angle:this.angle,backgroundColor:ye(this.backgroundColor),borderLineColor:ye(this.borderLineColor),borderLineSize:this.borderLineSize,color:ye(this.color),font:this.font&&this.font.clone(),haloColor:ye(this.haloColor),haloSize:this.haloSize,horizontalAlignment:this.horizontalAlignment,kerning:this.kerning,lineHeight:this.lineHeight,lineWidth:this.lineWidth,rightToLeft:this.rightToLeft,rotated:this.rotated,text:this.text,verticalAlignment:this.verticalAlignment,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){var t;return`${this.backgroundColor&&this.backgroundColor.hash()}.${this.borderLineColor}.${this.borderLineSize}.${(t=this.color)==null?void 0:t.hash()}.${this.font&&this.font.hash()}.${this.haloColor&&this.haloColor.hash()}.${this.haloSize}.${this.horizontalAlignment}.${this.kerning}.${this.rightToLeft}.${this.rotated}.${this.text}.${this.verticalAlignment}.${this.width}.${this.xoffset}.${this.yoffset}.${this.lineHeight}.${this.lineWidth}.${this.angle}`}};h([f({type:it,json:{write:!0}})],wn.prototype,"backgroundColor",void 0),h([f({type:it,json:{write:!0}})],wn.prototype,"borderLineColor",void 0),h([f({type:Number,json:{write:!0},cast:gn})],wn.prototype,"borderLineSize",void 0),h([f({type:T6,json:{write:!0}})],wn.prototype,"font",void 0),h([f({...M1e,json:{write:!0}})],wn.prototype,"horizontalAlignment",void 0),h([f({type:Boolean,json:{write:!0}})],wn.prototype,"kerning",void 0),h([f({type:it,json:{write:!0}})],wn.prototype,"haloColor",void 0),h([f({type:Number,cast:gn,json:{write:!0}})],wn.prototype,"haloSize",void 0),h([f({type:Boolean,json:{write:!0}})],wn.prototype,"rightToLeft",void 0),h([f({type:Boolean,json:{write:!0}})],wn.prototype,"rotated",void 0),h([f({type:String,json:{write:!0}})],wn.prototype,"text",void 0),h([Vt({esriTS:"text"},{readOnly:!0})],wn.prototype,"type",void 0),h([f({...$1e,json:{write:!0}})],wn.prototype,"verticalAlignment",void 0),h([f({type:Number,cast:gn,json:{write:!0}})],wn.prototype,"xoffset",void 0),h([f({type:Number,cast:gn,json:{write:!0}})],wn.prototype,"yoffset",void 0),h([f({type:Number,json:{read:t=>t&&-1*t,write:(t,e)=>e.angle=t&&-1*t}})],wn.prototype,"angle",void 0),h([f({type:Number,json:{write:!0}})],wn.prototype,"width",void 0),h([f({type:Number})],wn.prototype,"lineWidth",void 0),h([xr("lineWidth")],wn.prototype,"writeLineWidth",null),h([_i("lineWidth")],wn.prototype,"castLineWidth",null),h([f(P1e)],wn.prototype,"lineHeight",void 0),h([xr("lineHeight")],wn.prototype,"writeLineHeight",null),wn=bG=h([N("esri.symbols.TextSymbol")],wn);const EP=wn;var wG;let pd=wG=class extends Rc{constructor(t){super(t),this.styleName=null,this.portal=null,this.styleUrl=null,this.thumbnail=null,this.name=null,this.type="web-style"}get _fetchCacheKey(){const t=this.portal!=null?this.portal:Mh.getDefault(),e=t.user?t.user.username:null;return`${this.styleName}:${this.styleUrl}:${this.name}:${e}:${t.url}`}read(t,e){this.portal=e==null?void 0:e.portal,super.read(t,e)}clone(){return new wG({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}fetchSymbol(t){return this._fetchSymbol("webRef",t)}fetchCIMSymbol(t){return this._fetchSymbol("cimRef",t)}async _fetchSymbol(t,e){const r=e!=null?e.cache:null,i=r?this._fetchCacheKey:null;if(r!=null){const a=i&&r.get(i);if(a)return a.clone()}const{resolveWebStyleSymbol:n}=await ce(()=>Promise.resolve().then(()=>cht),void 0);Bt(e);const s=n(this,{portal:this.portal},t,e);s.catch(a=>{J.getLogger(this).error("#fetchSymbol()","Failed to create symbol from style",a)});const o=await s;return t==="webRef"&&o.type==="point-3d"||t==="cimRef"&&o.type==="cim"?(r!=null&&r.set(i,o.clone()),o):null}};h([f({json:{write:!1}})],pd.prototype,"color",void 0),h([f({type:String,json:{write:!0}})],pd.prototype,"styleName",void 0),h([f({type:Mh,json:{write:!1}})],pd.prototype,"portal",void 0),h([f({type:String,json:{read:KY,write:sw}})],pd.prototype,"styleUrl",void 0),h([f({type:Ob,json:{read:!1}})],pd.prototype,"thumbnail",void 0),h([f({type:String,json:{write:!0}})],pd.prototype,"name",void 0),h([Vt({styleSymbolReference:"web-style"},{readOnly:!0})],pd.prototype,"type",void 0),h([f()],pd.prototype,"_fetchCacheKey",null),pd=wG=h([N("esri.symbols.WebStyleSymbol")],pd);const bE=pd;function O6(t){if(!t)return!1;switch(t.type){case"picture-fill":case"picture-marker":case"simple-fill":case"simple-line":case"simple-marker":case"text":case"cim":return!0;default:return!1}}function ow(t){if(!t)return!1;switch(t.type){case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":return!0;default:return!1}}const FT={base:Rc,key:"type",typeMap:{"simple-fill":nZ,"picture-fill":J1e,"picture-marker":C6,"simple-line":Lw,"simple-marker":A6,text:EP,"label-3d":S6,"line-3d":E6,"mesh-3d":vE,"point-3d":n_,"polygon-3d":SP,"web-style":bE,cim:xP},errorContext:"symbol"},UAt={base:Rc,key:"type",typeMap:{"picture-marker":C6,"simple-marker":A6,text:EP,"web-style":bE,cim:xP},errorContext:"symbol"},Eze=PX({types:FT}),Cze={base:Rc,key:"type",typeMap:{"simple-fill":nZ,"picture-fill":J1e,"picture-marker":C6,"simple-line":Lw,"simple-marker":A6,text:EP,"line-3d":E6,"mesh-3d":vE,"point-3d":n_,"polygon-3d":SP,"web-style":bE,cim:xP},errorContext:"symbol"},kAt={base:Rc,key:"type",typeMap:{text:EP,"label-3d":S6},errorContext:"symbol"},Hre={base:Rc,key:"type",typeMap:{"line-3d":E6,"mesh-3d":vE,"point-3d":n_,"polygon-3d":SP,"web-style":bE,cim:xP},errorContext:"symbol"},zAt={base:Rc,key:"type",typeMap:{"label-3d":S6},errorContext:"symbol"},BAt=L_(FT);var xG;function Aze(t){if(!t)return null;const e={};for(const r in t){const i=oR(t[r]);i&&(e[r]=i)}return Object.keys(e).length!==0?e:null}function Oze(t){if(t==null)return null;const e={};for(const r in t){const i=t[r];i&&(e[r]=i.toJSON())}return Object.keys(e).length!==0?e:null}let ql=xG=class extends Cu(ke){constructor(...t){super(...t),this.isAggregate=!1,this.layer=null,this.popupTemplate=null,this.sourceLayer=null,Object.defineProperty(this,"uid",{value:wc(),configurable:!0})}normalizeCtorArgs(t,e,r,i){return t&&!t.declaredClass?t:{geometry:t,symbol:e,attributes:r,popupTemplate:i}}set aggregateGeometries(t){const e=this._get("aggregateGeometries");JSON.stringify(e)!==JSON.stringify(t)&&this._set("aggregateGeometries",t)}set attributes(t){const e=this._get("attributes");e!==t&&(this._set("attributes",t),this._notifyLayer("attributes",e,t))}set geometry(t){const e=this._get("geometry");e!==t&&(this._set("geometry",t),this._notifyLayer("geometry",e,t))}set symbol(t){const e=this._get("symbol");e!==t&&(this._set("symbol",t),this._notifyLayer("symbol",e,t))}set visible(t){const e=this._get("visible");e!==t&&(this._set("visible",t),this._notifyLayer("visible",e,t))}cloneShallow(){return new xG({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible})}getEffectivePopupTemplate(t=!1){if(this.popupTemplate)return this.popupTemplate;for(const e of[this.sourceLayer,this.layer])if(e){if("popupTemplate"in e&&e.popupTemplate)return e.popupTemplate;if(t&&"defaultPopupTemplate"in e&&e.defaultPopupTemplate!=null)return e.defaultPopupTemplate}return null}getAttribute(t){var e;return(e=this.attributes)==null?void 0:e[t]}setAttribute(t,e){if(this.attributes){const r=this.getAttribute(t);this.attributes[t]=e,this._notifyLayer("attributes",r,e,t)}else this.attributes={[t]:e},this._notifyLayer("attributes",void 0,e,t)}getObjectId(){return this.sourceLayer&&"objectIdField"in this.sourceLayer&&this.sourceLayer.objectIdField?this.getAttribute(this.sourceLayer.objectIdField):null}toJSON(){return{aggregateGeometries:Oze(this.aggregateGeometries),geometry:this.geometry!=null?this.geometry.toJSON():null,symbol:this.symbol!=null?this.symbol.toJSON():null,attributes:{...this.attributes},popupTemplate:this.popupTemplate&&this.popupTemplate.toJSON()}}notifyGeometryChanged(){this._notifyLayer("geometry",this.geometry,this.geometry)}notifyMeshTransformChanged(t={}){const{geometry:e}=this;if((e==null?void 0:e.type)==="mesh"){const r={origin:e.origin,transform:e.transform};this._notifyLayer("origin-transform",r,r,t.action)}}_notifyLayer(t,e,r,i){if(!this.layer||!("graphicChanged"in this.layer))return;const n={graphic:this,property:t,oldValue:e,newValue:r};t==="origin-transform"&&(n.action=i),t==="attributes"&&(n.attributeName=i),this.layer.graphicChanged(n)}};h([f({value:null,json:{read:Aze}})],ql.prototype,"aggregateGeometries",null),h([f({value:null})],ql.prototype,"attributes",null),h([f({value:null,types:OY,json:{read:oR}})],ql.prototype,"geometry",null),h([f({type:Boolean})],ql.prototype,"isAggregate",void 0),h([f({clonable:"reference"})],ql.prototype,"layer",void 0),h([f({type:I9e})],ql.prototype,"popupTemplate",void 0),h([f({clonable:"reference"})],ql.prototype,"sourceLayer",void 0),h([f({value:null,types:FT})],ql.prototype,"symbol",null),h([f({type:Boolean,value:!0})],ql.prototype,"visible",null),ql=xG=h([N("esri.Graphic")],ql),function(t){t.generateUID=wc}(ql||(ql={}));const z_=ql;var TG;let cy=TG=class extends ke{constructor(t){super(t),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(t){return(t%=360)<0&&(t+=360),t}clone(){return new TG({rotation:this.rotation,scale:this.scale,targetGeometry:this.targetGeometry!=null?this.targetGeometry.clone():null,camera:this.camera!=null?this.camera.clone():null})}};function mk(){return{enabled:!this.camera}}h([f({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:mk}}}}})],cy.prototype,"rotation",void 0),h([_i("rotation")],cy.prototype,"castRotation",null),h([f({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:mk}}}}})],cy.prototype,"scale",void 0),h([f({types:OY,json:{read:oR,write:!0,origins:{"web-scene":{read:oR,write:{overridePolicy:mk}}}}})],cy.prototype,"targetGeometry",void 0),h([f({type:vu,json:{write:!0}})],cy.prototype,"camera",void 0),cy=TG=h([N("esri.Viewpoint")],cy);const hp=cy;function R6(t){return typeof t=="string"?document.getElementById(t):t??null}function tve(t){for(;t.hasChildNodes();)t.removeChild(t.firstChild)}function Wre(t,e){const r=e.parentNode;r&&r.insertBefore(t,e)}function qre(t,e){for(;;){const r=t.firstChild;if(!r)break;e.appendChild(r)}}function ue(t,e,r={}){return sZ(t,e,r,rve)}function Dh(t,e,r={}){return sZ(t,e,r,ive)}function sZ(t,e,r={},i){let n=null;const s=r.once?(o,a)=>{i(o)&&(Pi(n),e(o,a))}:(o,a)=>{i(o)&&e(o,a)};if(n=_Ne(t,s,r.sync,r.equals),r.initial){const o=t();s(o,o)}return n}function Ol(t,e,r,i={}){let n=null,s=null,o=null;function a(){var u;n&&s&&(s.remove(),(u=i.onListenerRemove)==null||u.call(i,n),n=null,s=null)}function l(u){i.once&&i.once&&Pi(o),r(u)}const c=ue(t,(u,d)=>{var p;a(),ZF(u)&&(n=u,s=dP(u,e,l),(p=i.onListenerAdd)==null||p.call(i,u))},{sync:i.sync,initial:!0});return o=Za(()=>{c.remove(),a()}),o}function uR(t,e){return Rze(t,ive,e)}function Rze(t,e,r){if(ss(r))return Promise.reject(wr());const i=t();if(e!=null&&e(i))return Promise.resolve(i);let n=null;function s(){n=Pi(n)}return new Promise((o,a)=>{n=dS([pa(r,()=>{s(),a(wr())}),sZ(t,l=>{s(),o(l)},{sync:!1,once:!0},e??rve)])})}function rve(t){return!0}function ive(t){return!!t}const Br={sync:!0},Pr={initial:!0},An={sync:!0,initial:!0};let SG=class{constructor(e=r=>r.values().next().value){this._peeker=e,this._observable=new e6,this._items=new Set}get length(){return Ht(this._observable),this._items.size}clear(){this.length!==0&&(this._items.clear(),this._observable.notify())}last(){if(this.length===0)return;let e;for(e of this._items);return e}peek(){if(this.length!==0)return this._peeker(this._items)}push(e){this.contains(e)||(this._items.add(e),this._observable.notify())}contains(e){return Ht(this._observable),this._items.has(e)}pop(){if(this.length===0)return;const e=this.peek();return this._items.delete(e),this._observable.notify(),e}popLast(){if(this.length===0)return;const e=this.last();return this._items.delete(e),this._observable.notify(),e}remove(e){this.contains(e)&&(this._items.delete(e),this._observable.notify())}filter(e){const r=this.length;return this._items.forEach(i=>{e(i)||this._items.delete(i)}),r!==this._items.size&&this._observable.notify(),this}*[Symbol.iterator](){Ht(this._observable),yield*this._items}};const Pze={statsWorker:()=>ce(()=>import("./statsWorker-99ee7c16.js"),["assets/statsWorker-99ee7c16.js","assets/heatmapUtils-327ef4c5.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js"]),geometryEngineWorker:()=>ce(()=>import("./geometryEngineWorker-f6bc8d39.js"),["assets/geometryEngineWorker-f6bc8d39.js","assets/geometryEngineJSON-b173802a.js","assets/geometryEngineBase-324c1c81.js","assets/json-48e3ea08.js"]),CSVSourceWorker:()=>ce(()=>import("./CSVSourceWorker-51c044a2.js"),["assets/CSVSourceWorker-51c044a2.js","assets/json-48e3ea08.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FieldsIndex-f79a8f26.js","assets/number-e5825aa4.js","assets/clientSideDefaults-ab04bd90.js","assets/defaultsJSON-59981e75.js"]),EdgeProcessingWorker:()=>ce(()=>import("./EdgeProcessingWorker-615066a5.js"),[]),ElevationSamplerWorker:()=>ce(()=>import("./ElevationSamplerWorker-d53250c9.js"),["assets/ElevationSamplerWorker-d53250c9.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js"]),FeatureServiceSnappingSourceWorker:()=>ce(()=>import("./FeatureServiceSnappingSourceWorker-19fe862a.js"),["assets/FeatureServiceSnappingSourceWorker-19fe862a.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FieldsIndex-f79a8f26.js","assets/Query-1c961d4c.js","assets/symbologySnappingCandidates-816beafe.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/query-93c6e211.js","assets/queryZScale-8f9616ff.js"]),GeoJSONSourceWorker:()=>ce(()=>import("./GeoJSONSourceWorker-555763c3.js"),["assets/GeoJSONSourceWorker-555763c3.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FieldsIndex-f79a8f26.js","assets/geojson-077f67ec.js","assets/clientSideDefaults-ab04bd90.js","assets/defaultsJSON-59981e75.js","assets/sourceUtils-e3b344c8.js"]),LercWorker:()=>ce(()=>import("./LercWorker-aac3e5c8.js"),[]),MemorySourceWorker:()=>ce(()=>import("./MemorySourceWorker-31156e3d.js"),["assets/MemorySourceWorker-31156e3d.js","assets/objectIdUtils-789e911a.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FieldsIndex-f79a8f26.js","assets/clientSideDefaults-ab04bd90.js","assets/defaultsJSON-59981e75.js","assets/sourceUtils-e3b344c8.js"]),PBFDecoderWorker:()=>ce(()=>import("./PBFDecoderWorker-113e9c75.js"),["assets/PBFDecoderWorker-113e9c75.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js"]),Pipeline:()=>ce(()=>import("./Pipeline-98b9d349.js").then(t=>t.P),["assets/Pipeline-98b9d349.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FieldsIndex-f79a8f26.js","assets/StreamFeatureManager-4b8ac3ac.js","assets/quickselect-e80674f5.js","assets/diffUtils-590c9088.js","assets/arcadeTimeUtils-e1438cc8.js","assets/centroid-8e8cfa47.js","assets/ogcFeatureUtils-1ccf1f8d.js","assets/geojson-077f67ec.js","assets/clientSideDefaults-ab04bd90.js","assets/defaultsJSON-59981e75.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/Query-1c961d4c.js","assets/createConnection-4b117798.js","assets/definitions-0bc08d4c.js","assets/TileInfoView-346e56d0.js","assets/number-e491b09e.js","assets/geohashUtils-77d8429b.js"]),PointCloudWorker:()=>ce(()=>import("./PointCloudWorker-68a2e657.js"),["assets/PointCloudWorker-68a2e657.js","assets/PointCloudWorkerUtil-ec4f2005.js","assets/PointCloudUniqueValueRenderer-df78a172.js","assets/I3SBinaryReader-2b8e30f7.js"]),RasterWorker:()=>ce(()=>import("./RasterWorker-cd959d79.js"),["assets/RasterWorker-cd959d79.js","assets/dataUtils-69946c3c.js","assets/colorUtils-c0f43caf.js","assets/utils-12672bd4.js","assets/rasterProjectionHelper-072edec4.js"]),SceneLayerSnappingSourceWorker:()=>ce(()=>import("./SceneLayerSnappingSourceWorker-3df2f794.js"),[]),SceneLayerWorker:()=>ce(()=>import("./SceneLayerWorker-e92c2264.js").then(t=>t.a),["assets/SceneLayerWorker-e92c2264.js","assets/I3SNode-2025159f.js"]),WFSSourceWorker:()=>ce(()=>import("./WFSSourceWorker-1db6d954.js"),["assets/WFSSourceWorker-1db6d954.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FieldsIndex-f79a8f26.js","assets/geojson-077f67ec.js","assets/sourceUtils-e3b344c8.js","assets/wfsUtils-372b3e59.js","assets/xmlUtils-444cb4c0.js"]),WorkerTileHandler:()=>ce(()=>import("./WorkerTileHandler-fcaca023.js"),["assets/WorkerTileHandler-fcaca023.js","assets/TileClipper-ae6eca9e.js","assets/StyleRepository-2362164f.js","assets/colorUtils-c0f43caf.js","assets/definitions-0bc08d4c.js","assets/Rect-98da58d6.js","assets/pbf-d9aa3914.js","assets/TurboLine-aac2edf4.js","assets/BidiEngine-9a40f2f4.js"])};var Lo;(function(t){t[t.HANDSHAKE=0]="HANDSHAKE",t[t.OPEN=1]="OPEN",t[t.OPENED=2]="OPENED",t[t.RESPONSE=3]="RESPONSE",t[t.INVOKE=4]="INVOKE",t[t.ABORT=5]="ABORT",t[t.CLOSE=6]="CLOSE",t[t.OPEN_PORT=7]="OPEN_PORT",t[t.ON=8]="ON"})(Lo||(Lo={}));let Mze=0;function nve(){return Mze++}function $ze(t){return t&&typeof t=="object"&&("result"in t||"transferList"in t)}function hR(t){return t?typeof t=="string"?JSON.stringify({name:"message",message:t}):t.toJSON?JSON.stringify(t):JSON.stringify({name:t.name,message:t.message,details:t.details||{stack:t.stack}}):null}function oZ(t,e,r,i){if(e.type===Lo.OPEN_PORT)return void t.postMessage(e,[e.port]);if(e.type!==Lo.INVOKE&&e.type!==Lo.RESPONSE)return void t.postMessage(e);let n;if($ze(r)?(n=Xre(r.transferList),e.data=r.result):(n=Xre(i),e.data=r),n){if(se("ff")){for(const s of n)if("byteLength"in s&&s.byteLength>267386880){const o="Worker call with large ArrayBuffer would crash Firefox";switch(e.type){case Lo.INVOKE:throw o;case Lo.RESPONSE:return void oZ(t,{type:Lo.RESPONSE,jobId:e.jobId,error:hR(o)})}}}t.postMessage(e,n)}else t.postMessage(e)}function dR(t){if(!t)return null;const e=t.data;return e?typeof e=="string"?JSON.parse(e):e:null}function Xre(t){if(!t||!t.length)return null;if(se("esri-workers-arraybuffer-transfer"))return t;const e=t.filter(r=>!Ize(r));return e.length?e:null}function Ize(t){var e;return t instanceof ArrayBuffer||((e=t==null?void 0:t.constructor)==null?void 0:e.name)==="ArrayBuffer"}const{CLOSE:Yre,ABORT:Zre,INVOKE:Qre,RESPONSE:sC,OPEN_PORT:Jre,ON:Lze}=Lo,Dze=2;let Nze=class{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===Lo.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),this._timer===null&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}},B_=class g2{static connect(e){const r=new MessageChannel;let i;i=typeof e=="function"?new e:"default"in e&&typeof e.default=="function"?new e.default:e;const n=new g2(r.port1,{channel:r,client:i},()=>null);return typeof i=="object"&&"remoteClient"in i&&(i.remoteClient=n),g2.clients.set(n,i),r.port2}static loadWorker(e){const r=Pze[e];return r?r():Promise.resolve(null)}constructor(e,r,i){this._port=e,this._getNextJob=i,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new Nze(n=>this._onInvokeMessage(n)),this._client=r.client,this._onMessage=this._onMessage.bind(this),this._channel=r.channel,this._schedule=r.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:Yre}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,r,i){const n=i==null?void 0:i.signal,s=i==null?void 0:i.transferList;if(!this._port)return Promise.reject(new Y("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:r}));const o=nve();return new Promise((a,l)=>{if(ss(n))return this._processWork(),void l(wr());const c=pa(n,()=>{const d=this._outJobs.get(o);d&&(this._outJobs.delete(o),this._processWork(),Pi(d.abortHandle),this._post({type:Zre,jobId:o}),l(wr()))}),u={resolve:a,reject:l,abortHandle:c,debugInfo:e};this._outJobs.set(o,u),this._post({type:Qre,jobId:o,methodName:e,abortable:n!=null},r,s)})}on(e,r){const i=new MessageChannel;function n(s){r(s.data)}return this._port.postMessage({type:Lo.ON,eventType:e,port:i.port2},[i.port2]),i.port1.addEventListener("message",n),i.port1.start(),{remove(){i.port1.postMessage({type:Lo.CLOSE}),i.port1.close(),i.port1.removeEventListener("message",n)}}}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:Jre,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=Dze)return;const e=this._getNextJob();if(!e)return;const{methodName:r,data:i,invokeOptions:n,resolver:s}=e;this.invoke(r,i,n).then(o=>s.resolve(o)).catch(o=>s.reject(o))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach(e=>{Pi(e.abortHandle),e.reject(wr(`Worker closing, aborting job calling '${e.debugInfo}'`))}),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=null,this._client=null,this._schedule=null}_onMessage(e){this._schedule!=null?this._schedule(()=>this._processMessage(e)):this._processMessage(e)}_processMessage(e){const r=dR(e);if(r)switch(r.type){case sC:this._onResponseMessage(r);break;case Qre:this._invokeQueue.push(r);break;case Zre:this._onAbortMessage(r);break;case Yre:this._onCloseMessage();break;case Jre:this._onOpenPortMessage(r);break;case Lze:this._onOnMessage(r)}}_onAbortMessage(e){const r=this._inJobs,i=e.jobId,n=r.get(i);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),r.delete(i))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&g2.clients.get(this)===e&&e.destroy(),g2.clients.delete(this),e!=null&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:r,jobId:i,data:n,abortable:s}=e,o=s?new AbortController:null,a=this._inJobs;let l,c=this._client,u=c[r];try{if(!u&&r&&r.includes(".")){const d=r.split(".");for(let p=0;p{a.has(i)&&(a.delete(i),this._post({type:sC,jobId:i},d))},d=>{a.has(i)&&(a.delete(i),Zn(d)||this._post({type:sC,jobId:i,error:hR(d||{message:`Error encountered at method ${r}`})}))})):this._post({type:sC,jobId:i},l)}_onOpenPortMessage(e){new g2(e.port,{client:this._client},()=>null)}_onOnMessage(e){const{port:r}=e,i=this._client.on(e.eventType,s=>{r.postMessage(s)}),n=dP(e.port,"message",s=>{const o=dR(s);(o==null?void 0:o.type)===Lo.CLOSE&&(n.remove(),i.remove(),r.close())})}_onResponseMessage(e){const{jobId:r,error:i,data:n}=e,s=this._outJobs;if(!s.has(r))return;const o=s.get(r);s.delete(r),this._processWork(),Pi(o.abortHandle),i?o.reject(Y.fromJSON(JSON.parse(i))):o.resolve(n)}_post(e,r,i){return oZ(this._port,e,r,i)}};B_.kernelInfo={buildDate:I0e,fullVersion:JX,revision:L0e},B_.clients=new Map;let Fze=class{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new SG}destroy(){this.close()}get closed(){return!this._clients||!this._clients.length}open(e,r){return new Promise((i,n)=>{let s=!0;const o=a=>{Bt(r.signal),s&&(s=!1,a())};this._clients.length=e.length,this._clientPromises.length=e.length,this._inUseClients.length=e.length;for(let a=0;a(this._clients[a]=new B_(c,r,()=>this._ongoingJobsQueue.pop()??null),o(i),this._clients[a]),()=>(o(n),null)):(this._clients[a]=new B_(l,r,()=>this._ongoingJobsQueue.pop()??null),this._clientPromises[a]=Promise.resolve(this._clients[a]),o(i))}})}broadcast(e,r,i){const n=new Array(this._clientPromises.length);for(let s=0;sa==null?void 0:a.invoke(e,r,i))}return n}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.resolver.reject(wr(`Worker closing, aborting job calling '${e.methodName}'`));for(const r of this._clientPromises)r.then(i=>i==null?void 0:i.close());this._clients.length=0,this._clientPromises.length=0,this._inUseClients.length=0}invoke(e,r,i){let n;Array.isArray(i)?(J.getLogger("esri.core.workers.Connection").warn("invoke()","The transferList parameter is deprecated, use the options object instead"),n={transferList:i}):n=i;const s=Wo();this._ongoingJobsQueue.push({methodName:e,data:r,invokeOptions:n,resolver:s});for(let o=0;ol==null?void 0:l.jobAdded())}return s.promise}on(e,r){return Promise.all(this._clientPromises).then(()=>dS(this._clients.map(i=>i.on(e,r))))}openPorts(){return new Promise(e=>{const r=new Array(this._clientPromises.length);let i=r.length;for(let n=0;n{s&&(r[n]=s.openPort()),--i==0&&e(r)})})}get test(){return{numClients:this._clients.length}}};const sve=J.getLogger("esri.intl.substitute");function HAt(t,e,r={}){const{format:i={}}=r;return YF(t,n=>Uze(n,e,i))}function Uze(t,e,r){let i,n;const s=t.indexOf(":");if(s===-1?i=t.trim():(i=t.slice(0,s).trim(),n=t.slice(s+1).trim()),!i)return"";const o=uP(i,e);if(o==null)return"";const a=(n?r==null?void 0:r[n]:null)??(r==null?void 0:r[i]);return a?kze(o,a):n?zze(o,n):aZ(o)}function kze(t,e){switch(e.type){case"date":return k_(t,e.intlOptions);case"number":return TS(t,e.intlOptions);default:return sve.warn("missing format descriptor for key {key}"),aZ(t)}}function zze(t,e){switch(e.toLowerCase()){case"dateformat":return k_(t);case"numberformat":return TS(t);default:return sve.warn(`inline format is unsupported since 4.12: ${e}`),/^(dateformat|datestring)/i.test(e)?k_(t):/^numberformat/i.test(e)?TS(t):aZ(t)}}function aZ(t){switch(typeof t){case"string":return t;case"number":return TS(t);case"boolean":return""+t;default:return t instanceof Date?k_(t):""}}async function Bze(t,e,r,i){const n=e.exec(r);if(!n)throw new Y("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${e}"`);const s=n[1]?`${n[1]}/`:"",o=n[2],a=CFe(i),l=`${s}${o}.json`,c=a?`${s}${o}_${a}.json`:l;let u;try{u=await Kre(t(c))}catch(d){if(c===l)throw new Y("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:d});try{u=await Kre(t(l))}catch(p){throw new Y("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:p})}}return u}async function Kre(t){if(eie.fetchBundleAsset!=null)return eie.fetchBundleAsset(t);const e=await kn(t,{responseType:"text"});return JSON.parse(e.data)}let Vze=class{constructor({base:e="",pattern:r,location:i=new URL(window.location.href)}){let n;n=typeof i=="string"?s=>new URL(s,new URL(i,window.location.href)).href:i instanceof URL?s=>new URL(s,i).href:i,this.pattern=typeof r=="string"?new RegExp(`^${r}`):r,this.getAssetUrl=n,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,r){return Bze(this.getAssetUrl,this.matcher,e,r)}};function Gze(t){return new Vze(t)}const eie={};EFe(Gze({pattern:"esri/",location:Ir}));const jze={};function Hze(t){const e={async:t.async,isDebug:t.isDebug,locale:t.locale,baseUrl:t.baseUrl,has:{...t.has},map:{...t.map},packages:t.packages&&t.packages.concat()||[],paths:{...t.paths}};return t.hasOwnProperty("async")||(e.async=!0),t.hasOwnProperty("isDebug")||(e.isDebug=!1),t.baseUrl||(e.baseUrl=jze.baseUrl),e}let Wze=class{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach(r=>{this[r]=(...i)=>e[r](...i)})}},yD=class{constructor(){this._dispatcher=new Wze,this._workerPostMessage({type:Lo.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){pS(()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))})}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,r,i){this._dispatcher.addEventListener(e,r,i)}removeEventListener(e,r,i){this._dispatcher.removeEventListener(e,r,i)}_workerPostMessage(e){pS(()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))})}async _workerMessageHandler(e){const r=dR(e);if(r&&r.type===Lo.OPEN){const{modulePath:i,jobId:n}=r;let s=await B_.loadWorker(i);s||(s=await ce(()=>import(i),[]));const o=B_.connect(s);this._workerPostMessage({type:Lo.OPENED,jobId:n,data:o})}}};const EG=J.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:qze}=Lo,Xze='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,s)=>{if(t){if(t.aborted)return s(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:ABORT,jobId:n}),s(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:s}),self.postMessage({type:INVOKE,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,fullVersion:r}=configuration.kernelInfo,{revision:t,fullVersion:n,version:s}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS Maps SDK for JavaScript modules and assets. For more information visit https://bit.ly/3QnsuSo.\\nModules version: ${r}\\nAssets version: ${n??s}\\nAssets path: ${esriConfig.assetsPath}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case OPEN:let n;function t(e){const o=n.connect(e);self.postMessage({type:OPENED,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],(e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((e=>(n=e.default,checkWorkerRevision(n),n.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),n=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(t));break;case RESPONSE:if(outgoing.has(r)){const s=outgoing.get(r);outgoing.delete(r),o.error?s.reject(JSON.parse(o.error)):s.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});';let ZM,QM;const tie="Failed to create Worker. Fallback to execute module in main thread";async function Yze(){if(!se("esri-workers")||(se("mozilla"),0))return rie(new yD);if(!ZM&&!QM)try{const e=Xze.split('"{CONFIGURATION}"').join(`'${Zze()}'`);ZM=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){QM=e||{}}let t;if(ZM)try{t=new Worker(ZM,{name:"esri-worker-"+Qze++})}catch{EG.warn(tie,QM),t=new yD}else EG.warn(tie,QM),t=new yD;return rie(t)}async function rie(t){return new Promise(e=>{function r(n){const s=dR(n);s&&s.type===qze&&(t.removeEventListener("message",r),t.removeEventListener("error",i),e(t))}function i(n){n.preventDefault(),t.removeEventListener("message",r),t.removeEventListener("error",i),EG.warn("Failed to create Worker. Fallback to execute module in main thread",n),(t=new yD).addEventListener("message",r),t.addEventListener("error",i)}t.addEventListener("message",r),t.addEventListener("error",i)})}function Zze(){let t;if(Jr.default!=null){const n={...Jr};delete n.default,t=JSON.parse(JSON.stringify(n))}else t=JSON.parse(JSON.stringify(Jr));t.assetsPath=iu(t.assetsPath),t.defaultAssetsPath=t.defaultAssetsPath?iu(t.defaultAssetsPath):void 0,t.request.interceptors=[],t.log.interceptors=[],t.locale=ep(),t.has={"esri-csp-restrictions":se("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":se("esri-2d-update-debug"),"esri-2d-log-updating":se("esri-2d-log-updating"),"featurelayer-pbf":se("featurelayer-pbf"),"featurelayer-simplify-thresholds":se("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":se("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":se("featurelayer-simplify-mobile-factor"),"esri-atomics":se("esri-atomics"),"esri-shared-array-buffer":se("esri-shared-array-buffer"),"esri-tiles-debug":se("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":se("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":se("feature-polyline-generalization-factor"),"host-webworker":1,"polylabel-placement-enabled":se("polylabel-placement-enabled")},t.workers.loaderUrl&&(t.workers.loaderUrl=iu(t.workers.loaderUrl)),t.workers.workerPath?t.workers.workerPath=iu(t.workers.workerPath):t.workers.workerPath=iu(Ir("esri/core/workers/RemoteClient.js")),t.workers.useDynamicImport=!1;const e=Jr.workers.loaderConfig,r=Hze({baseUrl:e==null?void 0:e.baseUrl,locale:ep(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...e==null?void 0:e.has},map:{...e==null?void 0:e.map},paths:{...e==null?void 0:e.paths},packages:(e==null?void 0:e.packages)||[]});return JSON.stringify({esriConfig:t,loaderConfig:r,kernelInfo:{buildDate:I0e,fullVersion:JX,revision:L0e}})}let Qze=0;const{ABORT:iie,INVOKE:Jze,OPEN:Kze,OPENED:eBe,RESPONSE:oC}=Lo;let tBe=class ove{static async create(e){const r=await Yze();return new ove(r,e)}constructor(e,r){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=r,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",i=>{i.preventDefault(),J.getLogger("esri.core.workers.WorkerOwner").error(i)})}terminate(){this.worker.terminate()}async open(e,r={}){const{signal:i}=r,n=nve();return new Promise((s,o)=>{const a={resolve:s,reject:o,abortHandle:CX(i,()=>{this._outJobs.delete(n),this._post({type:iie,jobId:n})})};this._outJobs.set(n,a),this._post({type:Kze,jobId:n,modulePath:e})})}_onMessage(e){const r=dR(e);if(r)switch(r.type){case eBe:this._onOpenedMessage(r);break;case oC:this._onResponseMessage(r);break;case iie:this._onAbortMessage(r);break;case Jze:this._onInvokeMessage(r)}}_onAbortMessage(e){const r=this._inJobs,i=e.jobId,n=r.get(i);n&&(n.controller&&n.controller.abort(),r.delete(i))}_onInvokeMessage(e){const{methodName:r,jobId:i,data:n,abortable:s}=e,o=s?new AbortController:null,a=this._inJobs,l=S5e[r];let c;try{if(typeof l!="function")throw new TypeError(`${r} is not a function`);c=l.call(null,n,{signal:o?o.signal:null})}catch(u){return void this._post({type:oC,jobId:i,error:hR(u)})}Eu(c)?(a.set(i,{controller:o,promise:c}),c.then(u=>{a.has(i)&&(a.delete(i),this._post({type:oC,jobId:i},u))},u=>{a.has(i)&&(a.delete(i),u||(u={message:"Error encountered at method"+r}),Zn(u)||this._post({type:oC,jobId:i,error:hR(u||{message:`Error encountered at method ${r}`})}))})):this._post({type:oC,jobId:i},c)}_onOpenedMessage(e){const{jobId:r,data:i}=e,n=this._outJobs.get(r);n&&(this._outJobs.delete(r),Pi(n.abortHandle),n.resolve(i))}_onResponseMessage(e){const{jobId:r,error:i,data:n}=e,s=this._outJobs.get(r);s&&(this._outJobs.delete(r),Pi(s.abortHandle),i?s.reject(Y.fromJSON(JSON.parse(i))):s.resolve(n))}_post(e,r,i){return oZ(this.worker,e,r,i)}};const nie=se("host-browser")?Math.min(navigator.hardwareConcurrency-1,se("workers-pool-size")):0;let fb=se("esri-mobile")?Math.min(nie,3):nie;fb||(fb=se("safari")&&se("mac")?7:2);let sie=0;const _D=[];function rBe(){ave()}async function JM(t,e){const r=new Fze;return await r.open(t,e),r}async function iBe(t,e={}){if(typeof t!="string")throw new Y("workers:undefined-module","modulePath is missing");let r=e.strategy||"distributed";if(se("host-webworker")&&!se("esri-workers")&&(r="local"),r==="local"){let i=await B_.loadWorker(t);i||(i=await ce(()=>import(t),[])),Bt(e.signal);const n=e.client||i;return JM([B_.connect(i)],{...e,client:n})}if(await ave(),Bt(e.signal),r==="dedicated"){const i=sie++%fb;return JM([await _D[i].open(t,e)],e)}if(e.maxNumWorkers&&e.maxNumWorkers>0){const i=Math.min(e.maxNumWorkers,fb);if(ii.open(t,e)),e)}let KM=null;async function ave(){if(KM)return KM;new AbortController;const t=[];for(let e=0;e(_D[e]=i,i));t.push(r)}return KM=Promise.all(t),KM}let Df=class extends xe{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._handles=new Vi,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll(),this._handles.destroy()}add(e,r,i={}){return this._installWatch(e,r,i,ue)}addWhen(e,r,i={}){return this._installWatch(e,r,i,Dh)}addOnCollectionChange(e,r,{initial:i=!1,final:n=!1}={}){const s=++this._handleId;return this._handles.add([Ol(e,"after-changes",this._createSyncUpdatingCallback(),Br),Ol(e,"change",r,{onListenerAdd:i?o=>r({added:o.toArray(),removed:[]}):void 0,onListenerRemove:n?o=>r({added:[],removed:o.toArray()}):void 0})],s),Za(()=>this._handles.remove(s))}addPromise(e){if(e==null)return e;const r=++this._handleId;this._handles.add({remove:()=>{this._pendingPromises.delete(e)&&(this._pendingPromises.size!==0||this._handles.has(e$)||this._set("updating",!1))}},r),this._pendingPromises.add(e),this._set("updating",!0);const i=()=>this._handles.remove(r);return e.then(i,i),e}removeAll(){this._pendingPromises.clear(),this._handles.removeAll(),this._set("updating",!1)}_installWatch(e,r,i={},n){const s=++this._handleId;i.sync||this._installSyncUpdatingWatch(e,s);const o=n(e,r,i);return this._handles.add(o,s),Za(()=>this._handles.remove(s))}_installSyncUpdatingWatch(e,r){const i=this._createSyncUpdatingCallback(),n=ue(e,i,{sync:!0,equals:()=>!1});return this._handles.add(n,r),n}_createSyncUpdatingCallback(){return()=>{this._handles.remove(e$),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this._handles.add(pP(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this._handles.remove(e$))}),e$)}}};h([f({readOnly:!0})],Df.prototype,"updating",void 0),Df=h([N("esri.core.support.WatchUpdatingTracking")],Df);const e$=-42,P6=t=>{let e=class extends t{constructor(){super(...arguments),this._handles=new Vi,this._updatingHandles=new Df}destroy(){this.destroyed||(this._handles.destroy(),this._updatingHandles.destroy())}get handles(){return this._handles}get updatingHandles(){return this._updatingHandles}};return h([f({readOnly:!0})],e.prototype,"handles",null),h([f({readOnly:!0})],e.prototype,"updatingHandles",null),e=h([N("esri.core.HandleOwner")],e),e};let pR=class extends P6(xe){};pR=h([N("esri.core.HandleOwner")],pR);let ZA=class extends P6(ir){constructor(e){super(e),this.handles.add([this.on("before-add",r=>{r.item==null&&r.preventDefault()}),this.on("after-add",r=>this._own(r.item)),this.on("after-remove",r=>this._release(r.item))])}get owner(){return this._get("owner")}set owner(e){e!==this._get("owner")&&(this._releaseAll(),this._set("owner",e),this._ownAll())}_ownAll(){for(const e of this.items)this._own(e)}_releaseAll(){for(const e of this.items)this._release(e)}_createNewInstance(e){return this.itemType?new(ir.ofType(this.itemType.Type))(e):new ir(e)}};function F4(t,e){return{type:t,cast:o0e,set(r){const i=qb(r,this._get(e),t);i.owner=this,this._set(e,i)}}}h([f()],ZA.prototype,"owner",null),ZA=h([N("esri.core.support.OwningCollection")],ZA);var I3;const U4=Oc()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),lve=U4.jsonValues.slice();qO(lve,"orthometric");const QA=Oc()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let fd=I3=class extends ke{constructor(t){super(t),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(t,e,r){return U4.write(t,e,r)}readHeightModel(t,e,r){return U4.read(t)||(r&&r.messages&&r.messages.push(nBe(t,{context:r})),null)}readHeightUnit(t,e,r){return QA.read(t)||(r&&r.messages&&r.messages.push(oie(t,{context:r})),null)}readHeightUnitService(t,e,r){return R0e(t)||QA.read(t)||(r&&r.messages&&r.messages.push(oie(t,{context:r})),null)}readVertCRS(t,e){return e.vertCRS||e.ellipsoid||e.geoid}clone(){return new I3({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(t){return!!t&&(this===t||this.heightModel===t.heightModel&&this.heightUnit===t.heightUnit&&this.vertCRS===t.vertCRS)}static deriveUnitFromSR(t,e){const r=g5e(e);return new I3({heightModel:t.heightModel,heightUnit:r,vertCRS:t.vertCRS})}write(t,e){return e={origin:"web-scene",...e},super.write(t,e)}static fromJSON(t){if(!t)return null;const e=new I3;return e.read(t,{origin:"web-scene"}),e}};function oie(t,e){return new D_("height-unit:unsupported",`Height unit of value '${t}' is not supported`,e)}function nBe(t,e){return new D_("height-model:unsupported",`Height model of value '${t}' is not supported`,e)}h([f({type:U4.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:lve,default:"ellipsoidal"}}}})],fd.prototype,"heightModel",void 0),h([xr("web-scene","heightModel")],fd.prototype,"writeHeightModel",null),h([lr(["web-scene","service"],"heightModel")],fd.prototype,"readHeightModel",null),h([f({type:QA.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:QA.jsonValues,write:QA.write}}}})],fd.prototype,"heightUnit",void 0),h([lr("web-scene","heightUnit")],fd.prototype,"readHeightUnit",null),h([lr("service","heightUnit")],fd.prototype,"readHeightUnitService",null),h([f({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],fd.prototype,"vertCRS",void 0),h([lr("service","vertCRS",["vertCRS","ellipsoid","geoid"])],fd.prototype,"readVertCRS",null),fd=I3=h([N("esri.geometry.HeightModelInfo")],fd);const CP=fd;function In(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function am(t,e,r,i,n,s,o,a,l,c,u,d,p,m,y,_,v){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t[4]=s,t[5]=o,t[6]=a,t[7]=l,t[8]=c,t[9]=u,t[10]=d,t[11]=p,t[12]=m,t[13]=y,t[14]=_,t[15]=v,t}function Nh(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Sc(t,e){if(t===e){const r=e[1],i=e[2],n=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=s,t[11]=e[14],t[12]=n,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function wE(t,e){return us(t,e)||Nh(t),t}function us(t,e){const r=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],m=e[11],y=e[12],_=e[13],v=e[14],b=e[15],x=r*a-i*o,T=r*l-n*o,S=r*c-s*o,A=i*l-n*a,C=i*c-s*a,R=n*c-s*l,P=u*_-d*y,F=u*v-p*y,k=u*b-m*y,V=d*v-p*_,z=d*b-m*_,X=p*b-m*v;let q=x*X-T*z+S*V+A*k-C*F+R*P;return q?(q=1/q,t[0]=(a*X-l*z+c*V)*q,t[1]=(n*z-i*X-s*V)*q,t[2]=(_*R-v*C+b*A)*q,t[3]=(p*C-d*R-m*A)*q,t[4]=(l*k-o*X-c*F)*q,t[5]=(r*X-n*k+s*F)*q,t[6]=(v*S-y*R-b*T)*q,t[7]=(u*R-p*S+m*T)*q,t[8]=(o*z-a*k+c*P)*q,t[9]=(i*k-r*z-s*P)*q,t[10]=(y*C-_*S+b*x)*q,t[11]=(d*S-u*C-m*x)*q,t[12]=(a*F-o*V-l*P)*q,t[13]=(r*V-i*F+n*P)*q,t[14]=(_*T-y*A-v*x)*q,t[15]=(u*A-d*T+p*x)*q,t):null}function sBe(t,e){const r=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],m=e[11],y=e[12],_=e[13],v=e[14],b=e[15];return t[0]=a*(p*b-m*v)-d*(l*b-c*v)+_*(l*m-c*p),t[1]=-(i*(p*b-m*v)-d*(n*b-s*v)+_*(n*m-s*p)),t[2]=i*(l*b-c*v)-a*(n*b-s*v)+_*(n*c-s*l),t[3]=-(i*(l*m-c*p)-a*(n*m-s*p)+d*(n*c-s*l)),t[4]=-(o*(p*b-m*v)-u*(l*b-c*v)+y*(l*m-c*p)),t[5]=r*(p*b-m*v)-u*(n*b-s*v)+y*(n*m-s*p),t[6]=-(r*(l*b-c*v)-o*(n*b-s*v)+y*(n*c-s*l)),t[7]=r*(l*m-c*p)-o*(n*m-s*p)+u*(n*c-s*l),t[8]=o*(d*b-m*_)-u*(a*b-c*_)+y*(a*m-c*d),t[9]=-(r*(d*b-m*_)-u*(i*b-s*_)+y*(i*m-s*d)),t[10]=r*(a*b-c*_)-o*(i*b-s*_)+y*(i*c-s*a),t[11]=-(r*(a*m-c*d)-o*(i*m-s*d)+u*(i*c-s*a)),t[12]=-(o*(d*v-p*_)-u*(a*v-l*_)+y*(a*p-l*d)),t[13]=r*(d*v-p*_)-u*(i*v-n*_)+y*(i*p-n*d),t[14]=-(r*(a*v-l*_)-o*(i*v-n*_)+y*(i*l-n*a)),t[15]=r*(a*p-l*d)-o*(i*p-n*d)+u*(i*l-n*a),t}function oBe(t){const e=t[0],r=t[1],i=t[2],n=t[3],s=t[4],o=t[5],a=t[6],l=t[7],c=t[8],u=t[9],d=t[10],p=t[11],m=t[12],y=t[13],_=t[14],v=t[15];return(e*o-r*s)*(d*v-p*_)-(e*a-i*s)*(u*v-p*y)+(e*l-n*s)*(u*_-d*y)+(r*a-i*o)*(c*v-p*m)-(r*l-n*o)*(c*_-d*m)+(i*l-n*a)*(c*y-u*m)}function Vr(t,e,r){const i=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],u=e[7],d=e[8],p=e[9],m=e[10],y=e[11],_=e[12],v=e[13],b=e[14],x=e[15];let T=r[0],S=r[1],A=r[2],C=r[3];return t[0]=T*i+S*a+A*d+C*_,t[1]=T*n+S*l+A*p+C*v,t[2]=T*s+S*c+A*m+C*b,t[3]=T*o+S*u+A*y+C*x,T=r[4],S=r[5],A=r[6],C=r[7],t[4]=T*i+S*a+A*d+C*_,t[5]=T*n+S*l+A*p+C*v,t[6]=T*s+S*c+A*m+C*b,t[7]=T*o+S*u+A*y+C*x,T=r[8],S=r[9],A=r[10],C=r[11],t[8]=T*i+S*a+A*d+C*_,t[9]=T*n+S*l+A*p+C*v,t[10]=T*s+S*c+A*m+C*b,t[11]=T*o+S*u+A*y+C*x,T=r[12],S=r[13],A=r[14],C=r[15],t[12]=T*i+S*a+A*d+C*_,t[13]=T*n+S*l+A*p+C*v,t[14]=T*s+S*c+A*m+C*b,t[15]=T*o+S*u+A*y+C*x,t}function Ml(t,e,r){const i=r[0],n=r[1],s=r[2];if(e===t)t[12]=e[0]*i+e[4]*n+e[8]*s+e[12],t[13]=e[1]*i+e[5]*n+e[9]*s+e[13],t[14]=e[2]*i+e[6]*n+e[10]*s+e[14],t[15]=e[3]*i+e[7]*n+e[11]*s+e[15];else{const o=e[0],a=e[1],l=e[2],c=e[3],u=e[4],d=e[5],p=e[6],m=e[7],y=e[8],_=e[9],v=e[10],b=e[11];t[0]=o,t[1]=a,t[2]=l,t[3]=c,t[4]=u,t[5]=d,t[6]=p,t[7]=m,t[8]=y,t[9]=_,t[10]=v,t[11]=b,t[12]=o*i+u*n+y*s+e[12],t[13]=a*i+d*n+_*s+e[13],t[14]=l*i+p*n+v*s+e[14],t[15]=c*i+m*n+b*s+e[15]}return t}function AP(t,e,r){const i=r[0],n=r[1],s=r[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function mc(t,e,r,i){let n,s,o,a,l,c,u,d,p,m,y,_,v,b,x,T,S,A,C,R,P,F,k,V,z=i[0],X=i[1],q=i[2],G=Math.sqrt(z*z+X*X+q*q);return G0?(r[0]=2*(a*o+u*i+l*s-c*n)/d,r[1]=2*(l*o+u*n+c*i-a*s)/d,r[2]=2*(c*o+u*s+a*n-l*i)/d):(r[0]=2*(a*o+u*i+l*s-c*n),r[1]=2*(l*o+u*n+c*i-a*s),r[2]=2*(c*o+u*s+a*n-l*i)),hve(t,e,r),t}const uBe=O();function CG(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function dve(t,e){const r=e[0],i=e[1],n=e[2],s=e[4],o=e[5],a=e[6],l=e[8],c=e[9],u=e[10];return t[0]=Math.sqrt(r*r+i*i+n*n),t[1]=Math.sqrt(s*s+o*o+a*a),t[2]=Math.sqrt(l*l+c*c+u*u),t}function hBe(t,e){const r=e[0]+e[5]+e[10];let i=0;return r>0?(i=2*Math.sqrt(r+1),t[3]=.25*i,t[0]=(e[6]-e[9])/i,t[1]=(e[8]-e[2])/i,t[2]=(e[1]-e[4])/i):e[0]>e[5]&&e[0]>e[10]?(i=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/i,t[0]=.25*i,t[1]=(e[1]+e[4])/i,t[2]=(e[8]+e[2])/i):e[5]>e[10]?(i=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/i,t[0]=(e[1]+e[4])/i,t[1]=.25*i,t[2]=(e[6]+e[9])/i):(i=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/i,t[0]=(e[8]+e[2])/i,t[1]=(e[6]+e[9])/i,t[2]=.25*i),t}function pve(t,e,r,i){const n=e[0],s=e[1],o=e[2],a=e[3],l=n+n,c=s+s,u=o+o,d=n*l,p=n*c,m=n*u,y=s*c,_=s*u,v=o*u,b=a*l,x=a*c,T=a*u,S=i[0],A=i[1],C=i[2];return t[0]=(1-(y+v))*S,t[1]=(p+T)*S,t[2]=(m-x)*S,t[3]=0,t[4]=(p-T)*A,t[5]=(1-(d+v))*A,t[6]=(_+b)*A,t[7]=0,t[8]=(m+x)*C,t[9]=(_-b)*C,t[10]=(1-(d+y))*C,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function dBe(t,e,r,i,n){const s=e[0],o=e[1],a=e[2],l=e[3],c=s+s,u=o+o,d=a+a,p=s*c,m=s*u,y=s*d,_=o*u,v=o*d,b=a*d,x=l*c,T=l*u,S=l*d,A=i[0],C=i[1],R=i[2],P=n[0],F=n[1],k=n[2],V=(1-(_+b))*A,z=(m+S)*A,X=(y-T)*A,q=(m-S)*C,G=(1-(p+b))*C,Q=(v+x)*C,M=(y+T)*R,I=(v-x)*R,L=(1-(p+_))*R;return t[0]=V,t[1]=z,t[2]=X,t[3]=0,t[4]=q,t[5]=G,t[6]=Q,t[7]=0,t[8]=M,t[9]=I,t[10]=L,t[11]=0,t[12]=r[0]+P-(V*P+q*F+M*k),t[13]=r[1]+F-(z*P+G*F+I*k),t[14]=r[2]+k-(X*P+Q*F+L*k),t[15]=1,t}function pBe(t,e){const r=e[0],i=e[1],n=e[2],s=e[3],o=r+r,a=i+i,l=n+n,c=r*o,u=i*o,d=i*a,p=n*o,m=n*a,y=n*l,_=s*o,v=s*a,b=s*l;return t[0]=1-d-y,t[1]=u+b,t[2]=p-v,t[3]=0,t[4]=u-b,t[5]=1-c-y,t[6]=m+_,t[7]=0,t[8]=p+v,t[9]=m-_,t[10]=1-c-d,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function fve(t,e,r,i,n,s,o){const a=1/(r-e),l=1/(n-i),c=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*l,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(n+i)*l,t[10]=(o+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*c,t[15]=0,t}function fBe(t,e,r,i,n){const s=1/Math.tan(e/2);let o;return t[0]=s/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,n!=null&&n!==1/0?(o=1/(i-n),t[10]=(n+i)*o,t[14]=2*n*i*o):(t[10]=-1,t[14]=-2*i),t}function mBe(t,e,r,i){const n=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+a),c=2/(n+s);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-a)*l*.5,t[9]=(n-s)*c*.5,t[10]=i/(r-i),t[11]=-1,t[12]=0,t[13]=0,t[14]=i*r/(r-i),t[15]=0,t}function mve(t,e,r,i,n,s,o){const a=1/(e-r),l=1/(i-n),c=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*a,t[13]=(n+i)*l,t[14]=(o+s)*c,t[15]=1,t}function $6(t,e,r,i){const n=e[0],s=e[1],o=e[2];let a=n-r[0],l=s-r[1],c=o-r[2];const u=tl();if(Math.abs(a)0&&(m=1/Math.sqrt(m),u*=m,d*=m,p*=m);let y=l*p-c*d,_=c*u-a*p,v=a*d-l*u;return m=y*y+_*_+v*v,m>0&&(m=1/Math.sqrt(m),y*=m,_*=m,v*=m),t[0]=y,t[1]=_,t[2]=v,t[3]=0,t[4]=d*v-p*_,t[5]=p*y-u*v,t[6]=u*_-d*y,t[7]=0,t[8]=u,t[9]=d,t[10]=p,t[11]=0,t[12]=n,t[13]=s,t[14]=o,t[15]=1,t}function gBe(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function yBe(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2+t[9]**2+t[10]**2+t[11]**2+t[12]**2+t[13]**2+t[14]**2+t[15]**2)}function _Be(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function yve(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function vBe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function bBe(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t[3]=e[3]+r[3]*i,t[4]=e[4]+r[4]*i,t[5]=e[5]+r[5]*i,t[6]=e[6]+r[6]*i,t[7]=e[7]+r[7]*i,t[8]=e[8]+r[8]*i,t[9]=e[9]+r[9]*i,t[10]=e[10]+r[10]*i,t[11]=e[11]+r[11]*i,t[12]=e[12]+r[12]*i,t[13]=e[13]+r[13]*i,t[14]=e[14]+r[14]*i,t[15]=e[15]+r[15]*i,t}function lZ(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function I6(t,e){if(t===e)return!0;const r=t[0],i=t[1],n=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=t[9],p=t[10],m=t[11],y=t[12],_=t[13],v=t[14],b=t[15],x=e[0],T=e[1],S=e[2],A=e[3],C=e[4],R=e[5],P=e[6],F=e[7],k=e[8],V=e[9],z=e[10],X=e[11],q=e[12],G=e[13],Q=e[14],M=e[15],I=tl();return Math.abs(r-x)<=I*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(i-T)<=I*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(n-S)<=I*Math.max(1,Math.abs(n),Math.abs(S))&&Math.abs(s-A)<=I*Math.max(1,Math.abs(s),Math.abs(A))&&Math.abs(o-C)<=I*Math.max(1,Math.abs(o),Math.abs(C))&&Math.abs(a-R)<=I*Math.max(1,Math.abs(a),Math.abs(R))&&Math.abs(l-P)<=I*Math.max(1,Math.abs(l),Math.abs(P))&&Math.abs(c-F)<=I*Math.max(1,Math.abs(c),Math.abs(F))&&Math.abs(u-k)<=I*Math.max(1,Math.abs(u),Math.abs(k))&&Math.abs(d-V)<=I*Math.max(1,Math.abs(d),Math.abs(V))&&Math.abs(p-z)<=I*Math.max(1,Math.abs(p),Math.abs(z))&&Math.abs(m-X)<=I*Math.max(1,Math.abs(m),Math.abs(X))&&Math.abs(y-q)<=I*Math.max(1,Math.abs(y),Math.abs(q))&&Math.abs(_-G)<=I*Math.max(1,Math.abs(_),Math.abs(G))&&Math.abs(v-Q)<=I*Math.max(1,Math.abs(v),Math.abs(Q))&&Math.abs(b-M)<=I*Math.max(1,Math.abs(b),Math.abs(M))}function cZ(t){const e=tl(),r=t[0],i=t[1],n=t[2],s=t[4],o=t[5],a=t[6],l=t[8],c=t[9],u=t[10];return Math.abs(1-(r*r+s*s+l*l))<=e&&Math.abs(1-(i*i+o*o+c*c))<=e&&Math.abs(1-(n*n+a*a+u*u))<=e}function L6(t){return t[0]===1&&t[1]===0&&t[2]===0&&t[4]===0&&t[5]===1&&t[6]===0&&t[8]===0&&t[9]===0&&t[10]===1}const wBe=Vr,xBe=yve;Object.freeze(Object.defineProperty({__proto__:null,add:_Be,adjoint:sBe,copy:In,determinant:oBe,equals:I6,exactEquals:lZ,frob:yBe,fromQuat:pBe,fromQuat2:cBe,fromRotation:Ec,fromRotationTranslation:hve,fromRotationTranslationScale:pve,fromRotationTranslationScaleOrigin:dBe,fromScaling:aBe,fromTranslation:OP,fromXRotation:cve,fromYRotation:lBe,fromZRotation:uve,frustum:fve,getRotation:hBe,getScaling:dve,getTranslation:CG,hasIdentityRotation:L6,identity:Nh,invert:us,invertOrIdentity:wE,isOrthoNormal:cZ,lookAt:$6,mul:wBe,multiply:Vr,multiplyScalar:vBe,multiplyScalarAndAdd:bBe,ortho:mve,perspective:fBe,perspectiveFromFieldOfView:mBe,rotate:mc,rotateX:CS,rotateY:M6,rotateZ:AS,scale:AP,set:am,str:gBe,sub:xBe,subtract:yve,targetTo:gve,translate:Ml,transpose:Sc},Symbol.toStringTag,{value:"Module"}));let gk,ee=null;function _ve(){return!!ee}function TBe(){return!!se("esri-wasm")}function vve(){return gk||(gk=ce(()=>import("./pe-wasm-5a7d91fb.js"),[]).then(t=>t.p).then(({default:t})=>t({locateFile:e=>Ir(`esri/geometry/support/${e}`)})).then(t=>{wve(t)}),gk)}var AG,Sn,OG;(function(t){function e(s,o,a){ee.ensureCache.prepare();const l=Qv(a),c=a===l,u=ee.ensureFloat64(l),d=ee._pe_geog_to_proj(ee.getPointer(s),o,u);return d&&Vy(a,o,u,c),d}function r(s,o,a,l){switch(l){case Sn.PE_TRANSFORM_P_TO_G:return i(s,o,a);case Sn.PE_TRANSFORM_G_TO_P:return e(s,o,a)}return 0}function i(s,o,a){return n(s,o,a,0)}function n(s,o,a,l){ee.ensureCache.prepare();const c=Qv(a),u=a===c,d=ee.ensureFloat64(c),p=ee._pe_proj_to_geog_center(ee.getPointer(s),o,d,l);return p&&Vy(a,o,d,u),p}t.geogToProj=e,t.projGeog=r,t.projToGeog=i,t.projToGeogCenter=n})(AG||(AG={})),function(t){function e(){t.PE_BUFFER_MAX=ee.PeDefs.prototype.PE_BUFFER_MAX,t.PE_NAME_MAX=ee.PeDefs.prototype.PE_NAME_MAX,t.PE_MGRS_MAX=ee.PeDefs.prototype.PE_MGRS_MAX,t.PE_USNG_MAX=ee.PeDefs.prototype.PE_USNG_MAX,t.PE_DD_MAX=ee.PeDefs.prototype.PE_DD_MAX,t.PE_DDM_MAX=ee.PeDefs.prototype.PE_DDM_MAX,t.PE_DMS_MAX=ee.PeDefs.prototype.PE_DMS_MAX,t.PE_UTM_MAX=ee.PeDefs.prototype.PE_UTM_MAX,t.PE_PARM_MAX=ee.PeDefs.prototype.PE_PARM_MAX,t.PE_TYPE_NONE=ee.PeDefs.prototype.PE_TYPE_NONE,t.PE_TYPE_GEOGCS=ee.PeDefs.prototype.PE_TYPE_GEOGCS,t.PE_TYPE_PROJCS=ee.PeDefs.prototype.PE_TYPE_PROJCS,t.PE_TYPE_GEOGTRAN=ee.PeDefs.prototype.PE_TYPE_GEOGTRAN,t.PE_TYPE_COORDSYS=ee.PeDefs.prototype.PE_TYPE_COORDSYS,t.PE_TYPE_UNIT=ee.PeDefs.prototype.PE_TYPE_UNIT,t.PE_TYPE_LINUNIT=ee.PeDefs.prototype.PE_TYPE_LINUNIT,t.PE_STR_OPTS_NONE=ee.PeDefs.prototype.PE_STR_OPTS_NONE,t.PE_STR_AUTH_NONE=ee.PeDefs.prototype.PE_STR_AUTH_NONE,t.PE_STR_AUTH_TOP=ee.PeDefs.prototype.PE_STR_AUTH_TOP,t.PE_STR_NAME_CANON=ee.PeDefs.prototype.PE_STR_NAME_CANON,t.PE_PARM_X0=ee.PeDefs.prototype.PE_PARM_X0,t.PE_PARM_ND=ee.PeDefs.prototype.PE_PARM_ND,t.PE_TRANSFORM_1_TO_2=ee.PeDefs.prototype.PE_TRANSFORM_1_TO_2,t.PE_TRANSFORM_2_TO_1=ee.PeDefs.prototype.PE_TRANSFORM_2_TO_1,t.PE_TRANSFORM_P_TO_G=ee.PeDefs.prototype.PE_TRANSFORM_P_TO_G,t.PE_TRANSFORM_G_TO_P=ee.PeDefs.prototype.PE_TRANSFORM_G_TO_P,t.PE_HORIZON_RECT=ee.PeDefs.prototype.PE_HORIZON_RECT,t.PE_HORIZON_POLY=ee.PeDefs.prototype.PE_HORIZON_POLY,t.PE_HORIZON_LINE=ee.PeDefs.prototype.PE_HORIZON_LINE,t.PE_HORIZON_DELTA=ee.PeDefs.prototype.PE_HORIZON_DELTA}t.init=e}(Sn||(Sn={})),function(t){const e={},r={},i=m=>{if(m){const y=m.getType();switch(y){case Sn.PE_TYPE_GEOGCS:m=ee.castObject(m,ee.PeGeogcs);break;case Sn.PE_TYPE_PROJCS:m=ee.castObject(m,ee.PeProjcs);break;case Sn.PE_TYPE_GEOGTRAN:m=ee.castObject(m,ee.PeGeogtran);break;default:y&Sn.PE_TYPE_UNIT&&(m=ee.castObject(m,ee.PeUnit))}}return m};function n(){ee.PeFactory.prototype.initialize(null)}function s(m){return o(Sn.PE_TYPE_COORDSYS,m)}function o(m,y){let _=null,v=e[m];if(v||(v={},e[m]=v),v.hasOwnProperty(String(y)))_=v[y];else{const b=ee.PeFactory.prototype.factoryByType(m,y);ee.compare(b,ee.NULL)||(_=b,v[y]=_)}return _=i(_),_}function a(m,y){let _=null,v=r[m];if(v||(v={},r[m]=v),v.hasOwnProperty(y))_=v[y];else{const b=ee.PeFactory.prototype.fromString(m,y);ee.compare(b,ee.NULL)||(_=b,v[y]=_)}return _=i(_),_}function l(m){return o(Sn.PE_TYPE_GEOGCS,m)}function c(m){return o(Sn.PE_TYPE_GEOGTRAN,m)}function u(m){return ee.PeFactory.prototype.getCode(m)}function d(m){return o(Sn.PE_TYPE_PROJCS,m)}function p(m){return o(Sn.PE_TYPE_UNIT,m)}t.initialize=n,t.coordsys=s,t.factoryByType=o,t.fromString=a,t.geogcs=l,t.geogtran=c,t.getCode=u,t.projcs=d,t.unit=p}(OG||(OG={}));let bve=null;var k4,RG,PG,MG,z4,$G,B4,V4,IG;function wve(t){function e(s,o,a){s[o]=a(s[o])}ee=t,Sn.init(),k4.init(),z4.init(),B4.init(),V4.init(),bve=class extends ee.PeGCSExtent{destroy(){ee.destroy(this)}};const r=[ee.PeDatum,ee.PeGeogcs,ee.PeGeogtran,ee.PeObject,ee.PeParameter,ee.PePrimem,ee.PeProjcs,ee.PeSpheroid,ee.PeUnit];for(const s of r)e(s.prototype,"getName",o=>function(){return o.call(this,new Array(Sn.PE_NAME_MAX))});for(const s of[ee.PeGeogtran,ee.PeProjcs])e(s.prototype,"getParameters",o=>function(){const a=new Array(Sn.PE_PARM_MAX);let l=o.call(this);for(let c=0;cfunction(){const o=this.getSize();if(!o)return null;const a=[];return Vy(a,o,s.call(this)),a}),e(ee.PeGTlistExtendedEntry.prototype,"getEntries",s=>{const o=ee._pe_getPeGTlistExtendedGTsSize();return function(){let a=null;const l=s.call(this);if(!ee.compare(l,ee.NULL)){a=[l];const c=this.getSteps();if(c>1){const u=ee.getPointer(l);for(let d=1;dfunction(){let o=this._cache;if(o||(o=new Map,this._cache=o),o.has(s))return o.get(s);let a=null;const l=s.call(this);if(!ee.compare(l,ee.NULL)){a=[l];const c=l.getNump();if(c>1){const u=ee.getPointer(l);for(let d=1;d{e.push(r[0],r[1])})):e=t,e}function Vy(t,e,r,i=!1){if(i)for(let n=0;n<2*e;n++)t[n]=ee.getValue(r+n*Float64Array.BYTES_PER_ELEMENT,"double");else{const n=t.length===0;for(let s=0;s1)){const m=ee.getPointer(p);for(let y=1;y{fm(n);const s=n.getGeogtran();fm(s),s.getParameters().forEach(fm),[s.getGeogcs1(),s.getGeogcs2()].forEach(o=>{fm(o);const a=o.getDatum();fm(a),fm(a.getSpheroid()),fm(o.getPrimem()),fm(o.getUnit())})});ee.PeGTlistExtendedEntry.prototype.Delete(r[0])}}t.destroy=e}(RG||(RG={})),function(t){function e(r,i,n,s,o){ee.ensureCache.prepare();const a=Qv(n),l=n===a,c=ee.ensureFloat64(a);let u=0;s&&(u=ee.ensureFloat64(s));const d=ee._pe_geog_to_geog(ee.getPointer(r),i,c,u,o);return d&&Vy(n,i,c,l),d}t.geogToGeog=e}(PG||(PG={})),function(t){const e=(c,u,d,p,m,y)=>{let _,v;switch(ee.ensureCache.prepare(),c){case"dd":_=ee._pe_geog_to_dd,v=Sn.PE_DD_MAX;break;case"ddm":_=ee._pe_geog_to_ddm,v=Sn.PE_DDM_MAX;break;case"dms":_=ee._pe_geog_to_dms,v=Sn.PE_DMS_MAX}let b=0;u&&(b=ee.getPointer(u));const x=Qv(p),T=ee.ensureFloat64(x),S=t$(d,v),A=_(b,d,T,m,ee.ensureInt32(S));if(A)for(let C=0;C{let y;switch(ee.ensureCache.prepare(),c){case"dd":y=ee._pe_dd_to_geog;break;case"ddm":y=ee._pe_ddm_to_geog;break;case"dms":y=ee._pe_dms_to_geog}let _=0;u&&(_=ee.getPointer(u));const v=p.map(S=>ee.ensureString(S)),b=ee.ensureInt32(v),x=ee.ensureFloat64(new Array(2*d)),T=y(_,d,b,x);return T&&Vy(m,d,x),T};function i(c,u,d,p,m){return e("dms",c,u,d,p,m)}function n(c,u,d,p){return r("dms",c,u,d,p)}function s(c,u,d,p,m){return e("ddm",c,u,d,p,m)}function o(c,u,d,p){return r("ddm",c,u,d,p)}function a(c,u,d,p,m){return e("dd",c,u,d,p,m)}function l(c,u,d,p){return r("dd",c,u,d,p)}t.geogToDms=i,t.dmsToGeog=n,t.geogToDdm=s,t.ddmToGeog=o,t.geogToDd=a,t.ddToGeog=l}(MG||(MG={})),function(t){function e(){t.PE_MGRS_STYLE_NEW=ee.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW,t.PE_MGRS_STYLE_OLD=ee.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD,t.PE_MGRS_STYLE_AUTO=ee.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO,t.PE_MGRS_180_ZONE_1_PLUS=ee.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS,t.PE_MGRS_ADD_SPACES=ee.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES}function r(n,s,o,a,l,c,u){ee.ensureCache.prepare();let d=0;n&&(d=ee.getPointer(n));const p=Qv(o),m=ee.ensureFloat64(p),y=t$(s,Sn.PE_MGRS_MAX),_=ee.ensureInt32(y),v=ee._pe_geog_to_mgrs_extended(d,s,m,a,l,c,_);if(v)for(let b=0;bee.ensureString(y)),d=ee.ensureInt32(u),p=ee.ensureFloat64(new Array(2*s)),m=ee._pe_mgrs_to_geog_extended(c,s,d,a,p);return m&&Vy(l,s,p),m}t.init=e,t.geogToMgrsExtended=r,t.mgrsToGeogExtended=i}(z4||(z4={})),function(t){function e(i,n,s,o,a,l,c){ee.ensureCache.prepare();let u=0;i&&(u=ee.getPointer(i));const d=Qv(s),p=ee.ensureFloat64(d),m=t$(n,Sn.PE_MGRS_MAX),y=ee.ensureInt32(m),_=ee._pe_geog_to_usng(u,n,p,o,a,l,y);if(_)for(let v=0;vee.ensureString(p)),c=ee.ensureInt32(l),u=ee.ensureFloat64(new Array(2*n)),d=ee._pe_usng_to_geog(a,n,c,u);return d&&Vy(o,n,u),d}t.geogToUsng=e,t.usngToGeog=r}($G||($G={})),function(t){function e(){t.PE_UTM_OPTS_NONE=ee.PeNotationUtm.prototype.PE_UTM_OPTS_NONE,t.PE_UTM_OPTS_ADD_SPACES=ee.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES,t.PE_UTM_OPTS_NS=ee.PeNotationUtm.prototype.PE_UTM_OPTS_NS}function r(n,s,o,a,l){ee.ensureCache.prepare();let c=0;n&&(c=ee.getPointer(n));const u=Qv(o),d=ee.ensureFloat64(u),p=t$(s,Sn.PE_UTM_MAX),m=ee.ensureInt32(p),y=ee._pe_geog_to_utm(c,s,d,a,m);if(y)for(let _=0;_ee.ensureString(y)),d=ee.ensureInt32(u),p=ee.ensureFloat64(new Array(2*s)),m=ee._pe_utm_to_geog(c,s,d,a,p);return m&&Vy(l,s,p),m}t.init=e,t.geogToUtm=r,t.utmToGeog=i}(B4||(B4={})),function(t){const e=new Map;function r(){t.PE_PCSINFO_OPTION_NONE=ee.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE,t.PE_PCSINFO_OPTION_DOMAIN=ee.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN,t.PE_POLE_OUTSIDE_BOUNDARY=ee.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY,t.PE_POLE_POINT=ee.PePCSInfo.prototype.PE_POLE_POINT}function i(n,s=t.PE_PCSINFO_OPTION_DOMAIN){let o=null,a=null;return e.has(n)&&(a=e.get(n),a[s]&&(o=a[s])),o||(o=ee.PePCSInfo.prototype.generate(n,s),a||(a=[],e.set(n,a)),a[s]=o),o}t.init=r,t.generate=i}(V4||(V4={})),function(t){function e(){return ee.PeVersion.prototype.version_string()}t.versionString=e}(IG||(IG={}));const SBe=Object.freeze(Object.defineProperty({__proto__:null,get PeCSTransformations(){return AG},get PeDefs(){return Sn},get PeFactory(){return OG},get PeGCSExtent(){return bve},get PeGTTransformations(){return PG},get PeGTlistExtended(){return k4},get PeGTlistExtendedEntry(){return RG},get PeNotationDms(){return MG},get PeNotationMgrs(){return z4},get PeNotationUsng(){return $G},get PeNotationUtm(){return B4},get PePCSInfo(){return V4},get PeVersion(){return IG},_init:wve,get _pe(){return ee},isLoaded:_ve,isSupported:TBe,load:vve},Symbol.toStringTag,{value:"Module"})),JAt=Math.PI/180,KAt=/SPHEROID\[([^\]]+)]/i,S0=Kt.radius,ed=Kt.eccentricitySquared,EBe={a1:S0*ed,a2:S0*ed*S0*ed,a3:S0*ed*ed/2,a4:S0*ed*S0*ed*2.5,a5:S0*ed+S0*ed*ed/2,a6:1-ed},eOt={4267:{a:63782064e-1,f:1/294.9786982},4269:{a:6378137,f:1/298.257222101},4326:{a:Kt.radius,f:Kt.flattening},104900:{a:2439700,f:0},104901:{a:6051e3,f:0},104902:{a:6051800,f:0},104903:{a:Fg.radius,f:Fg.flattening},104904:{a:3393400,f:1/192.0430107526882},104905:{a:If.radius,f:If.flattening},104906:{a:6200,f:0},104907:{a:11100,f:0},104908:{a:71492e3,f:.06487439154031222},104909:{a:8200,f:0},104910:{a:83500,f:0},104911:{a:1e4,f:0},104912:{a:2409300,f:0},104913:{a:15e3,f:0},104914:{a:4e4,f:0},104915:{a:1562090,f:0},104916:{a:2632345,f:0},104917:{a:85e3,f:0},104918:{a:1821460,f:0},104919:{a:5e3,f:0},104920:{a:12e3,f:0},104921:{a:3e4,f:3},104922:{a:18e3,f:0},104923:{a:14e3,f:0},104924:{a:49300,f:0},104925:{a:60268e3,f:1/10.2079945799458},104926:{a:16e3,f:0},104927:{a:9500,f:0},104928:{a:56e4,f:0},104929:{a:249400,f:0},104930:{a:59500,f:0},104931:{a:16e3,f:0},104932:{a:133e3,f:0},104933:{a:718e3,f:0},104934:{a:888e3,f:0},104935:{a:1986300,f:0},104936:{a:1e4,f:0},104937:{a:41900,f:0},104938:{a:11e4,f:0},104939:{a:50100,f:0},104940:{a:764e3,f:0},104941:{a:11e3,f:0},104942:{a:529800,f:0},104943:{a:2575e3,f:0},104944:{a:25559e3,f:1/43.61604095563141},104945:{a:578900,f:0},104946:{a:33e3,f:0},104947:{a:21e3,f:0},104948:{a:13e3,f:0},104949:{a:31e3,f:0},104950:{a:27e3,f:0},104951:{a:42e3,f:0},104952:{a:235800,f:0},104953:{a:761400,f:0},104954:{a:15e3,f:0},104955:{a:54e3,f:0},104956:{a:77e3,f:0},104957:{a:27e3,f:0},104958:{a:788900,f:0},104959:{a:584700,f:0},104960:{a:24764e3,f:.01708124697141011},104961:{a:74e3,f:0},104962:{a:79e3,f:0},104963:{a:104e3,f:.14423076923076922},104964:{a:29e3,f:0},104965:{a:17e4,f:0},104966:{a:208e3,f:0},104967:{a:4e4,f:0},104968:{a:1352600,f:0},104969:{a:1195e3,f:0},104970:{a:593e3,f:0},104971:{a:If.radius,f:0},104972:{a:47e4,f:0},104973:{a:255e3,f:0},104974:{a:2439400,f:0}};let r$=0,yk=class LG{static fromGE(e){const r=new LG;return r._wkt=e.wkt,r._wkid=e.wkid,r._isInverse=e.isInverse,r}constructor(e){this.uid=r$++,e?(this._wkt=e.wkt!=null?e.wkt:null,this._wkid=e.wkid!=null?e.wkid:-1,this._isInverse=e.isInverse!=null&&e.isInverse===!0):(this._wkt=null,this._wkid=-1,this._isInverse=!1)}get wkt(){return this._wkt}set wkt(e){this._wkt=e,this.uid=r$++}get wkid(){return this._wkid}set wkid(e){this._wkid=e,this.uid=r$++}get isInverse(){return this._isInverse}set isInverse(e){this._isInverse=e,this.uid=r$++}getInverse(){const e=new LG;return e._wkt=this.wkt,e._wkid=this._wkid,e._isInverse=!this.isInverse,e}},G4=class L3{static cacheKey(e,r){return[e.wkid!==void 0&&e.wkid!==null?e.wkid.toString():"-1",e.wkt!==void 0&&e.wkt!==null?e.wkt.toString():"",r.wkid!==void 0&&r.wkid!==null?r.wkid.toString():"-1",r.wkt!==void 0&&r.wkt!==null?r.wkt.toString():""].join(",")}static fromGE(e){const r=new L3;let i="";for(const n of e.steps){const s=yk.fromGE(n);r.steps.push(s),i+=s.uid.toString()+","}return r._cachedProjection={},r._gtlistentry=null,r._chain=i,r}constructor(e){if(this.steps=[],this._cachedProjection={},this._chain="",this._gtlistentry=null,e&&e.steps)for(const r of e.steps)r instanceof yk?this.steps.push(r):this.steps.push(new yk({wkid:r.wkid,wkt:r.wkt,isInverse:r.isInverse}))}getInverse(){const e=new L3;e.steps=[];for(let r=this.steps.length-1;r>=0;r--){const i=this.steps[r];e.steps.push(i.getInverse())}return e}getGTListEntry(){let e="";for(const r of this.steps)e+=r.uid.toString()+",";return e!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=e),this._gtlistentry}assignCachedGe(e,r,i){this._cachedProjection[L3.cacheKey(e,r)]=i}getCachedGeTransformation(e,r){let i="";for(const s of this.steps)i+=s.uid.toString()+",";i!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=i);const n=this._cachedProjection[L3.cacheKey(e,r)];return n===void 0?null:n}};function CBe(t,e,r){if(e==null||r==null||r.vcsWkid||Js(e,r))return null;const i=FV(e)/FV(r);if(i===1)return null;switch(t){case"point":case"esriGeometryPoint":return n=>ABe(n,i);case"polyline":case"esriGeometryPolyline":return n=>RBe(n,i);case"polygon":case"esriGeometryPolygon":return n=>OBe(n,i);case"multipoint":case"esriGeometryMultipoint":return n=>PBe(n,i);case"extent":case"esriGeometryEnvelope":return n=>MBe(n,i);default:return null}}function ABe(t,e){t&&t.z!=null&&(t.z*=e)}function OBe(t,e){if(t)for(const r of t.rings)for(const i of r)i.length>2&&(i[2]*=e)}function RBe(t,e){if(t)for(const r of t.paths)for(const i of r)i.length>2&&(i[2]*=e)}function PBe(t,e){if(t)for(const r of t.points)r.length>2&&(r[2]*=e)}function MBe(t,e){t&&t.zmin!=null&&t.zmax!=null&&(t.zmin*=e,t.zmax*=e)}let tp=null,V_=null,JA=null,vD={};const xve=new e6;function D6(){return!!tp&&_ve()}function fR(t){return JA==null&&(JA=Promise.all([vve(),ce(()=>import("./geometryEngineBase-324c1c81.js"),[]).then(e=>e.g),ce(()=>import("./hydrated-c10ab4a5.js"),[])])),JA.then(([,e,{hydratedAdapter:r}])=>{Bt(t),V_=r,tp=e.default,tp._enableProjection(SBe),xve.notify()})}function xE(t,e,r=null,i=null){return Array.isArray(t)?t.length===0?[]:DG(V_,t,t[0].spatialReference,e,r,i):DG(V_,[t],t.spatialReference,e,r,i)[0]}function DG(t,e,r,i,n=null,s=null){if(r==null||i==null)return e;if(Bg(r,i,n))return e.map(o=>uZ(o,r,i));if(n==null){const o=G4.cacheKey(r,i);vD[o]!==void 0?n=vD[o]:((n=Sve(r,i,void 0))==null&&(n=new G4),vD[o]=n)}if(tp==null||t==null)throw new N6;return s!=null?tp._project(t,e,r,i,n,s):tp._project(t,e,r,i,n)}function $Be(t,e){const r=Tve([t],e);return r.pending!=null?{pending:r.pending,geometry:null}:r.geometries!=null?{pending:null,geometry:r.geometries[0]}:{pending:null,geometry:null}}function Tve(t,e){if(!D6()){for(const r of t)if(r!=null&&!Js(r.spatialReference,e)&&ua(r.spatialReference)&&ua(e)&&!Bg(r.spatialReference,e))return Ht(xve),{pending:fR(),geometries:null}}return{pending:null,geometries:t.map(r=>r==null?null:Js(r.spatialReference,e)?r:ua(r.spatialReference)&&ua(e)?Eve(r,e):null)}}function Sve(t,e,r=null){if(t==null||e==null)return null;if(tp==null||V_==null)throw new N6;const i=tp._getTransformation(V_,t,e,r,r==null?void 0:r.spatialReference);return i!==null?G4.fromGE(i):null}function IBe(t,e,r=null){if(tp==null||V_==null)throw new N6;const i=tp._getTransformationBySuitability(V_,t,e,r,r==null?void 0:r.spatialReference);if(i!==null){const n=[];for(const s of i)n.push(G4.fromGE(s));return n}return[]}class N6 extends Y{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}var W;function LBe(){tp=null,V_=null,JA=null,vD={}}(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.SPHERICAL_ECEF=1]="SPHERICAL_ECEF",t[t.WGS84=2]="WGS84",t[t.WEB_MERCATOR=3]="WEB_MERCATOR",t[t.WGS84_ECEF=4]="WGS84_ECEF",t[t.CGCS2000=5]="CGCS2000",t[t.WGS84_COMPARABLE_LON_LAT=6]="WGS84_COMPARABLE_LON_LAT",t[t.SPHERICAL_MARS_PCPF=7]="SPHERICAL_MARS_PCPF",t[t.GCSMARS2000=8]="GCSMARS2000",t[t.SPHERICAL_MOON_PCPF=9]="SPHERICAL_MOON_PCPF",t[t.GCSMOON2000=10]="GCSMOON2000",t[t.LON_LAT=11]="LON_LAT",t[t.PLATE_CARREE=12]="PLATE_CARREE"})(W||(W={}));const DBe={get loadPromise(){return JA}};function Eve(t,e){try{const r=xE(t,e);if(r==null)return null;"xmin"in t&&"xmin"in r&&(r.zmin=t.zmin,r.zmax=t.zmax);const i=CBe(r.type,t.spatialReference,e);return i!=null&&i(r),r}catch(r){if(!(r instanceof N6))throw r;return null}}function Bg(t,e,r){return!r&&(!!Js(t,e)||ua(t)&&ua(e)&&!!fZ(t,e,gZ))}async function NBe(t,e,r,i){if(D6())return vte(i);if(Array.isArray(t)){for(const{source:n,dest:s,geographicTransformation:o}of t)if(!Bg(n,s,o))return fR(i)}else if(!Bg(t,e,r))return fR(i);return vte(i)}function FBe(t,e){switch(fZ(t,e,gZ)){case Si:return"copy3";case o_:return"wgs84ToSphericalECEF";case aw:return"wgs84ToWebMercator";case s_:return"wgs84ToPlateCarree";case l_:return"wgs84ToWGS84ECEF";case Rb:return"webMercatorToWGS84";case Nve:return"webMercatorToSphericalECEF";case Fve:return"webMercatorToWGS84ECEF";case Uve:return"webMercatorToPlateCarree";case c_:return"wgs84ECEFToWGS84";case Vve:return"wgs84ECEFToSphericalECEF";case Gve:return"wgs84ECEFToWebMercator";case a_:return"sphericalECEFToWGS84";case zve:return"sphericalECEFToWebMercator";case zG:return"sphericalMarsPCPFToMars2000";case kG:return"sphericalMoonPCPFToMoon2000";case Bve:return"sphericalECEFToWGS84ECEF";case UG:return"mars2000ToSphericalPCPF";case FG:return"moon2000ToSphericalPCPF";default:return null}}function uZ(t,e,r){return t?"x"in t?Ave(t,e,new ze,r,0):"xmin"in t?Mve(t,e,new Dr,r,0):"rings"in t?Pve(t,e,new a1,r,0):"paths"in t?Rve(t,e,new m6,r,0):"points"in t?Ove(t,e,new yP,r,0):null:null}function Cve(t,e,r=e.spatialReference,i=0){return r!=null&&t.spatialReference!=null&&Ave(t,t.spatialReference,e,r,i)!=null}function Ave(t,e,r,i,n){Or[0]=t.x,Or[1]=t.y;const s=t.z;return Or[2]=s!==void 0?s:n,$i(Or,e,0,Or,i,0,1)?(r.x=Or[0],r.y=Or[1],r.spatialReference=i,s===void 0?(r.z=void 0,r.hasZ=!1):(r.z=Or[2],r.hasZ=!0),t.m===void 0?(r.m=void 0,r.hasM=!1):(r.m=t.m,r.hasM=!0),r):null}function UBe(t,e,r=e.spatialReference,i=0){return t.spatialReference!=null&&r!=null&&Ove(t,t.spatialReference,e,r,i)!=null}function Ove(t,e,r,i,n){const{points:s,hasZ:o,hasM:a}=t,l=[],c=s.length,u=[];for(const d of s)u.push(d[0],d[1],o?d[2]:n);if(!$i(u,e,0,u,i,0,c))return null;for(let d=0;dl:l=>ne(Or,l[0],l[1],n);for(const l of r){const c=[];for(const u of l){const d=[0,0,n];o(a(u),0,d,0),c.push(d)}i.push(c)}return!0}function BBe({hasZ:t,spatialReference:e,rings:r},i,n=0){const s=Yf(e,TE),o=wh[s][W.WGS84_COMPARABLE_LON_LAT];if(o==null)return!1;const a=t?l=>l:l=>ne(Or,l[0],l[1],n);for(const l of r){const c=[];for(const u of l){const d=[0,0,n];o(a(u),0,d,0),c.push(d)}i.push(c)}return!0}function VBe(t,e,r=e.spatialReference,i=0){return t.spatialReference!=null&&r!=null&&Pve(t,t.spatialReference,e,r,i)!=null}function Pve(t,e,r,i,n){const{rings:s,hasZ:o,hasM:a}=t,l=[];return Lve(s,o??!1,a??!1,e,l,i,n)?(r.rings=l,r.spatialReference=i,r.hasZ=o,r.hasM=a,r):null}function GBe(t,e,r=e.spatialReference,i=0){return t.spatialReference!=null&&r!=null&&Mve(t,t.spatialReference,e,r,i)!=null}function Mve(t,e,r,i,n){const{xmin:s,ymin:o,xmax:a,ymax:l,hasZ:c,hasM:u}=t;return NG(s,o,c?t.zmin:n,e,Or,i)?(r.xmin=Or[0],r.ymin=Or[1],c&&(r.zmin=Or[2]),NG(a,l,c?t.zmax:n,e,Or,i)?(r.xmax=Or[0],r.ymax=Or[1],c&&(r.zmax=Or[2]),u&&(r.mmin=t.mmin,r.mmax=t.mmax),r.spatialReference=i,r):null):null}function Vg(t,e,r){if(e==null||r==null)return null;const i=new ze({spatialReference:r});return $i(t,e,0,Or,r,0,1)?(i.x=Or[0],i.y=Or[1],i.z=Or[2],i):null}function hZ(t,e,r){return $i(t,e,0,Or,r.spatialReference,0,1)?(r.x=Or[0],r.y=Or[1],r.z=Or[2],r):null}function Bi(t,e,r,i=0){Or[0]=t.x,Or[1]=t.y;const n=t.z;return Or[2]=n!==void 0?n:i,$i(Or,t.spatialReference,0,e,r,0,1)}function NG(t,e,r,i,n,s){return en[0]=t,en[1]=e,en[2]=r,$i(en,i,0,n,s,0,1)}function Cs(t,e,r,i){return!(e==null||i==null||t.length<2)&&(t.length===2&&(en[0]=t[0],en[1]=t[1],en[2]=0,t=en),$i(t,e,0,r,i,0,1))}function $ve(t,e){Or[0]=t.x,Or[1]=t.y;const r=t.z;return Or[2]=r!==void 0?r:0,Ive(Or,t.spatialReference,e)}function Ive(t,e,r){return jBe(t,e,r)}function jBe(t,e,r){if(e==null)return!1;const i=Yf(e,TE),n=wh[i][W.WGS84_COMPARABLE_LON_LAT];return n!=null&&(n(t,0,en,0),r!==en&&(r[0]=en[0],r[1]=en[1],r.length>2&&(r[2]=en[2])),!0)}function $i(t,e,r,i,n,s,o=1){const a=fZ(e,n,gZ);if(a==null)return!1;if(a===Si){if(t===i&&r===s)return!0;const c=r+3*o;for(let u=r,d=s;un)return Number.MAX_VALUE;const s=Math.abs(Wd*t)+Math.asin(r/n);return s>=Math.PI/2?Number.MAX_VALUE:r/Math.cos(s)}function RP(t,e,r,i){return t!=null&&(Js(e,i)?(Ug(r,t),!0):(en[0]=t[0],en[1]=t[1],en[2]=0,!!$i(en,e,0,en,i,0,1)&&(r[0]=en[0],r[1]=en[1],en[0]=t[2],en[1]=t[3],en[2]=0,!!$i(en,e,0,en,i,0,1)&&(r[2]=en[0],r[3]=en[1],!0))))}function qBe(t,e,r,i){if(e==null||i==null)return!1;const n=Yf(e,TE),s=Yf(i,Hve);if(n===s&&n!==W.UNKNOWN||Js(e,i))return r[0]=1,r[1]=1,r[2]=1,!0;if(n===W.SPHERICAL_ECEF){const o=Te(t),a=o/Math.sqrt(t[0]*t[0]+t[1]*t[1]),l=o/Kt.radius;if(s===W.WEB_MERCATOR)return r[0]=a*l,r[1]=a*l,r[2]=1,!0;if(s===W.WGS84||s===W.CGCS2000){const c=KA;return r[0]=c*a*l,r[1]=c*l,r[2]=1,!0}}else if(n===W.PLATE_CARREE){if(s===W.WGS84||s===W.CGCS2000)return r[0]=KA,r[1]=KA,r[2]=1,!0;if(s===W.WEB_MERCATOR){const o=t[1]/Kt.radius;return r[0]=1,r[1]=1/Math.cos(o),r[2]=1,!0}}return!1}function ma(t,e,r,i){if(t==null||i==null)return!1;const n=Yf(t,TE),s=Yf(i,Hve);if(n===s&&!lie(s)&&(n!==W.UNKNOWN||Js(t,i)))return OP(r,e),!0;if(lie(s)){const o=wh[n][W.LON_LAT],a=wh[W.LON_LAT][s];return o!=null&&a!=null&&(o(e,0,Pd,0),a(Pd,0,E0,0),dZ(Wd*Pd[0],Wd*Pd[1],r),r[12]=E0[0],r[13]=E0[1],r[14]=E0[2],!0)}if((s===W.WEB_MERCATOR||s===W.PLATE_CARREE)&&(n===W.WGS84||n===W.CGCS2000&&s===W.PLATE_CARREE||n===W.SPHERICAL_ECEF||n===W.WEB_MERCATOR)){const o=wh[n][W.LON_LAT],a=wh[W.LON_LAT][s];return o!=null&&a!=null&&(o(e,0,Pd,0),a(Pd,0,E0,0),n===W.SPHERICAL_ECEF?Dve(Wd*Pd[0],Wd*Pd[1],r):Nh(r),r[12]=E0[0],r[13]=E0[1],r[14]=E0[2],!0)}return!1}function lie(t){return t===W.SPHERICAL_ECEF||t===W.SPHERICAL_MARS_PCPF||t===W.SPHERICAL_MOON_PCPF}function dZ(t,e,r){const i=Math.sin(t),n=Math.cos(t),s=Math.sin(e),o=Math.cos(e),a=r;return a[0]=-i,a[4]=-s*n,a[8]=o*n,a[12]=0,a[1]=n,a[5]=-s*i,a[9]=o*i,a[13]=0,a[2]=0,a[6]=o,a[10]=s,a[14]=0,a[3]=0,a[7]=0,a[11]=0,a[15]=1,a}function Dve(t,e,r){return dZ(t,e,r),Sc(r,r),r}function Yf(t,e){return t?e.spatialReference===t?e.spatialReferenceId:(e.spatialReference=t,"metersPerUnit"in e&&(e.metersPerUnit=el(t,1)),t.wkt===E0e.wkt?e.spatialReferenceId=W.SPHERICAL_ECEF:tR(t)?e.spatialReferenceId=W.WGS84:Yb(t)?e.spatialReferenceId=W.WEB_MERCATOR:HX(t)?e.spatialReferenceId=W.PLATE_CARREE:t.wkt===C0e.wkt?e.spatialReferenceId=W.WGS84_ECEF:t.wkid===fh.CGCS2000?e.spatialReferenceId=W.CGCS2000:t.wkt===YX.wkt?e.spatialReferenceId=W.SPHERICAL_MARS_PCPF:t.wkt===ZX.wkt?e.spatialReferenceId=W.SPHERICAL_MOON_PCPF:nm(t)?e.spatialReferenceId=W.GCSMARS2000:sm(t)?e.spatialReferenceId=W.GCSMOON2000:e.spatialReferenceId=W.UNKNOWN):W.UNKNOWN}function Si(t,e,r,i){t!==r&&(r[i++]=t[e++],r[i++]=t[e++],r[i]=t[e])}function Rb(t,e,r,i){r[i++]=OS*(t[e++]/Kt.radius),r[i++]=OS*(Math.PI/2-2*Math.atan(Math.exp(-t[e++]/Kt.radius))),r[i]=t[e]}function Nve(t,e,r,i){Rb(t,e,r,i),o_(r,i,r,i)}function Fve(t,e,r,i){Rb(t,e,r,i),l_(r,i,r,i)}function F6(t,e,r,i,n){const s=.4999999*Math.PI,o=ge(Wd*t[e+1],-s,s),a=Math.sin(o);r[i++]=Wd*t[e]*n.radius,r[i++]=n.halfSemiMajorAxis*Math.log((1+a)/(1-a)),r[i]=t[e+2]}function aw(t,e,r,i){F6(t,e,r,i,Kt)}const cie=Kt.radius*Math.PI/180,KA=180/(Kt.radius*Math.PI);function s_(t,e,r,i){r[i]=t[e]*cie,r[i+1]=t[e+1]*cie,r[i+2]=t[e+2]}function mb(t,e,r,i){r[i]=t[e]*KA,r[i+1]=t[e+1]*KA,r[i+2]=t[e+2]}function Uve(t,e,r,i){Rb(t,e,r,i),s_(r,i,r,i)}function XBe(t,e,r,i){c_(t,e,r,i),s_(r,i,r,i)}function YBe(t,e,r,i){a_(t,e,r,i),s_(r,i,r,i)}function ZBe(t,e,r,i){mb(t,e,r,i),o_(r,i,r,i)}function QBe(t,e,r,i){mb(t,e,r,i),aw(r,i,r,i)}function JBe(t,e,r,i){mb(t,e,r,i),l_(r,i,r,i)}function G_(t){if(t==null)return!1;const e=Yf(t,TE);return!!wh[e][W.WGS84_COMPARABLE_LON_LAT]}function kve(t,e,r,i){const n=Math.cos(r);t[0]=Math.cos(e)*n*i,t[1]=Math.sin(e)*n*i,t[2]=Math.sin(r)*i}function pZ(t,e,r,i,n){const s=n+t[e+2],o=Wd*t[e+1],a=Wd*t[e],l=Math.cos(o);r[i++]=Math.cos(a)*l*s,r[i++]=Math.sin(a)*l*s,r[i]=Math.sin(o)*s}function FG(t,e,r,i){pZ(t,e,r,i,Fg.radius)}function UG(t,e,r,i){pZ(t,e,r,i,If.radius)}function o_(t,e,r,i){pZ(t,e,r,i,Kt.radius)}function U6(t,e,r,i,n){const s=t[e],o=t[e+1],a=t[e+2],l=Math.sqrt(s*s+o*o+a*a),c=$h(a/(l===0?1:l)),u=Math.atan2(o,s);r[i++]=OS*u,r[i++]=OS*c,r[i]=l-n}function kG(t,e,r,i){U6(t,e,r,i,Fg.radius)}function zG(t,e,r,i){U6(t,e,r,i,If.radius)}function a_(t,e,r,i){U6(t,e,r,i,Kt.radius)}function zve(t,e,r,i){a_(t,e,r,i),aw(r,i,r,i)}function Bve(t,e,r,i){a_(t,e,r,i),l_(r,i,r,i)}function KBe(t,e,r,i,n){const s=Wd*t[e],o=Wd*t[e+1],a=t[e+2],l=Math.sin(o),c=Math.cos(o),u=n.radius/Math.sqrt(1-n.eccentricitySquared*l*l);r[i++]=(u+a)*c*Math.cos(s),r[i++]=(u+a)*c*Math.sin(s),r[i++]=(u*(1-n.eccentricitySquared)+a)*l}function l_(t,e,r,i){KBe(t,e,r,i,Kt)}function c_(t,e,r,i){const n=EBe,s=t[e],o=t[e+1],a=t[e+2];let l,c,u,d,p,m,y,_,v,b,x,T,S,A,C,R,P,F,k,V,z;l=Math.abs(a),c=s*s+o*o,u=Math.sqrt(c),d=c+a*a,p=Math.sqrt(d),V=Math.atan2(o,s),m=a*a/d,y=c/d,A=n.a2/p,C=n.a3-n.a4/p,y>.3?(_=l/p*(1+y*(n.a1+A+m*C)/p),k=Math.asin(_),b=_*_,v=Math.sqrt(1-b)):(v=u/p*(1-m*(n.a5-A-y*C)/p),k=Math.acos(v),b=1-v*v,_=Math.sqrt(b)),x=1-Kt.eccentricitySquared*b,T=Kt.radius/Math.sqrt(x),S=n.a6*T,A=u-T*v,C=l-S*_,P=v*A+_*C,R=v*C-_*A,F=R/(S/x+P),k+=F,z=P+R*F/2,a<0&&(k=-k),r[i++]=OS*V,r[i++]=OS*k,r[i]=z}function Vve(t,e,r,i){c_(t,e,r,i),o_(r,i,r,i)}function Gve(t,e,r,i){c_(t,e,r,i),aw(r,i,r,i)}const wh={[W.WGS84]:{[W.CGCS2000]:null,[W.GCSMARS2000]:null,[W.GCSMOON2000]:null,[W.LON_LAT]:Si,[W.WGS84_COMPARABLE_LON_LAT]:Si,[W.SPHERICAL_ECEF]:o_,[W.SPHERICAL_MARS_PCPF]:null,[W.SPHERICAL_MOON_PCPF]:null,[W.UNKNOWN]:null,[W.WEB_MERCATOR]:aw,[W.PLATE_CARREE]:s_,[W.WGS84]:Si,[W.WGS84_ECEF]:l_},[W.CGCS2000]:{[W.CGCS2000]:Si,[W.GCSMARS2000]:null,[W.GCSMOON2000]:null,[W.LON_LAT]:Si,[W.WGS84_COMPARABLE_LON_LAT]:Si,[W.SPHERICAL_ECEF]:o_,[W.SPHERICAL_MARS_PCPF]:null,[W.SPHERICAL_MOON_PCPF]:null,[W.UNKNOWN]:null,[W.WEB_MERCATOR]:null,[W.PLATE_CARREE]:s_,[W.WGS84]:null,[W.WGS84_ECEF]:l_},[W.GCSMARS2000]:{[W.CGCS2000]:null,[W.GCSMARS2000]:Si,[W.GCSMOON2000]:null,[W.LON_LAT]:Si,[W.WGS84_COMPARABLE_LON_LAT]:null,[W.SPHERICAL_ECEF]:null,[W.SPHERICAL_MARS_PCPF]:UG,[W.SPHERICAL_MOON_PCPF]:null,[W.UNKNOWN]:null,[W.WEB_MERCATOR]:null,[W.PLATE_CARREE]:null,[W.WGS84]:null,[W.WGS84_ECEF]:null},[W.GCSMOON2000]:{[W.CGCS2000]:null,[W.GCSMARS2000]:null,[W.GCSMOON2000]:Si,[W.LON_LAT]:Si,[W.WGS84_COMPARABLE_LON_LAT]:null,[W.SPHERICAL_ECEF]:null,[W.SPHERICAL_MARS_PCPF]:null,[W.SPHERICAL_MOON_PCPF]:FG,[W.UNKNOWN]:null,[W.WEB_MERCATOR]:null,[W.PLATE_CARREE]:null,[W.WGS84]:null,[W.WGS84_ECEF]:null},[W.WEB_MERCATOR]:{[W.CGCS2000]:null,[W.GCSMARS2000]:null,[W.GCSMOON2000]:null,[W.LON_LAT]:Rb,[W.WGS84_COMPARABLE_LON_LAT]:Rb,[W.SPHERICAL_ECEF]:Nve,[W.SPHERICAL_MARS_PCPF]:null,[W.SPHERICAL_MOON_PCPF]:null,[W.UNKNOWN]:null,[W.WEB_MERCATOR]:Si,[W.PLATE_CARREE]:Uve,[W.WGS84]:Rb,[W.WGS84_ECEF]:Fve},[W.WGS84_ECEF]:{[W.CGCS2000]:c_,[W.GCSMARS2000]:null,[W.GCSMOON2000]:null,[W.LON_LAT]:c_,[W.WGS84_COMPARABLE_LON_LAT]:c_,[W.SPHERICAL_ECEF]:Vve,[W.SPHERICAL_MARS_PCPF]:null,[W.SPHERICAL_MOON_PCPF]:null,[W.UNKNOWN]:null,[W.WEB_MERCATOR]:Gve,[W.PLATE_CARREE]:XBe,[W.WGS84]:c_,[W.WGS84_ECEF]:Si},[W.SPHERICAL_ECEF]:{[W.CGCS2000]:a_,[W.GCSMARS2000]:null,[W.GCSMOON2000]:null,[W.LON_LAT]:a_,[W.WGS84_COMPARABLE_LON_LAT]:a_,[W.SPHERICAL_ECEF]:Si,[W.SPHERICAL_MARS_PCPF]:null,[W.SPHERICAL_MOON_PCPF]:null,[W.UNKNOWN]:null,[W.WEB_MERCATOR]:zve,[W.PLATE_CARREE]:YBe,[W.WGS84]:a_,[W.WGS84_ECEF]:Bve},[W.SPHERICAL_MARS_PCPF]:{[W.CGCS2000]:null,[W.GCSMARS2000]:zG,[W.GCSMOON2000]:null,[W.LON_LAT]:zG,[W.WGS84_COMPARABLE_LON_LAT]:null,[W.SPHERICAL_ECEF]:null,[W.SPHERICAL_MARS_PCPF]:Si,[W.SPHERICAL_MOON_PCPF]:null,[W.UNKNOWN]:null,[W.WEB_MERCATOR]:null,[W.PLATE_CARREE]:null,[W.WGS84]:null,[W.WGS84_ECEF]:null},[W.SPHERICAL_MOON_PCPF]:{[W.CGCS2000]:null,[W.GCSMARS2000]:null,[W.GCSMOON2000]:kG,[W.LON_LAT]:kG,[W.WGS84_COMPARABLE_LON_LAT]:null,[W.SPHERICAL_ECEF]:null,[W.SPHERICAL_MARS_PCPF]:null,[W.SPHERICAL_MOON_PCPF]:Si,[W.UNKNOWN]:null,[W.WEB_MERCATOR]:null,[W.PLATE_CARREE]:null,[W.WGS84]:null,[W.WGS84_ECEF]:null},[W.UNKNOWN]:{[W.CGCS2000]:null,[W.GCSMARS2000]:null,[W.GCSMOON2000]:null,[W.LON_LAT]:null,[W.WGS84_COMPARABLE_LON_LAT]:null,[W.SPHERICAL_ECEF]:null,[W.SPHERICAL_MARS_PCPF]:null,[W.SPHERICAL_MOON_PCPF]:null,[W.UNKNOWN]:Si,[W.WEB_MERCATOR]:null,[W.PLATE_CARREE]:null,[W.WGS84]:null,[W.WGS84_ECEF]:null},[W.LON_LAT]:{[W.CGCS2000]:Si,[W.GCSMARS2000]:Si,[W.GCSMOON2000]:Si,[W.LON_LAT]:Si,[W.WGS84_COMPARABLE_LON_LAT]:Si,[W.SPHERICAL_ECEF]:o_,[W.SPHERICAL_MARS_PCPF]:UG,[W.SPHERICAL_MOON_PCPF]:FG,[W.UNKNOWN]:null,[W.WEB_MERCATOR]:aw,[W.PLATE_CARREE]:s_,[W.WGS84]:Si,[W.WGS84_ECEF]:l_},[W.WGS84_COMPARABLE_LON_LAT]:{[W.CGCS2000]:null,[W.GCSMARS2000]:null,[W.GCSMOON2000]:null,[W.LON_LAT]:Si,[W.WGS84_COMPARABLE_LON_LAT]:Si,[W.SPHERICAL_ECEF]:o_,[W.SPHERICAL_MARS_PCPF]:null,[W.SPHERICAL_MOON_PCPF]:null,[W.UNKNOWN]:null,[W.WEB_MERCATOR]:null,[W.PLATE_CARREE]:s_,[W.WGS84]:Si,[W.WGS84_ECEF]:l_},[W.PLATE_CARREE]:{[W.CGCS2000]:mb,[W.GCSMARS2000]:null,[W.GCSMOON2000]:null,[W.LON_LAT]:mb,[W.WGS84_COMPARABLE_LON_LAT]:mb,[W.SPHERICAL_ECEF]:ZBe,[W.SPHERICAL_MARS_PCPF]:null,[W.SPHERICAL_MOON_PCPF]:null,[W.UNKNOWN]:null,[W.WEB_MERCATOR]:QBe,[W.PLATE_CARREE]:Si,[W.WGS84]:mb,[W.WGS84_ECEF]:JBe}};function fZ(t,e,r=mZ()){return t==null||e==null?null:jve(t,e,r).projector}function jve(t,e,r){if(t==null||e==null||r.source.spatialReference===t&&r.dest.spatialReference===e)return r;const i=Yf(t,r.source),n=Yf(e,r.dest);return i===W.UNKNOWN&&n===W.UNKNOWN?Js(t,e)?r.projector=Si:r.projector=null:r.projector=wh[i][n],r}function mZ(){return{source:{spatialReference:null,spatialReferenceId:W.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:W.UNKNOWN,metersPerUnit:1},projector:Si}}const TE={spatialReference:null,spatialReferenceId:W.UNKNOWN},Hve={spatialReference:null,spatialReferenceId:W.UNKNOWN},gZ=mZ(),eVe=mZ(),Wd=It(1),OS=Ka(1),en=O(),Pd=O(),E0=O(),Or=O(),i$=O(),tOt=Object.freeze(Object.defineProperty({__proto__:null,canProjectToWGS84ComparableLonLat:G_,canProjectWithoutEngine:Bg,computeENUToSphericalPCPFLocalRotation:dZ,computeSphericalPCPFToENULocalRotation:Dve,computeTranslationToOriginAndRotation:ma,getProjectorName:FBe,getTransformation:Sve,getTransformations:IBe,initializeProjection:NBe,isLoaded:D6,load:fR,localLinearScaleFactors:qBe,lonLatToSphericalPCPF:kve,lonLatToWebMercatorComparable:F6,project:xE,projectBoundingRect:RP,projectBoundingSphere:WBe,projectBuffer:$i,projectDirection:HBe,projectExtent:GBe,projectMany:DG,projectMultipoint:UBe,projectOrLoad:$Be,projectOrLoadMany:Tve,projectPoint:Cve,projectPointToVector:Bi,projectPointToWGS84ComparableLonLat:$ve,projectPolygon:VBe,projectPolygonToWGS84ComparableLonLat:BBe,projectPolyline:kBe,projectPolylineToWGS84ComparableLonLat:zBe,projectVectorToDehydratedPoint:hZ,projectVectorToPoint:Vg,projectVectorToVector:Cs,projectVectorToWGS84ComparableLonLat:Ive,projectWithoutEngine:uZ,projectXYZToVector:NG,sphericalPCPFtoLonLatElevation:U6,test:DBe,tryProjectWithZConversion:Eve,unload:LBe},Symbol.toStringTag,{value:"Module"}));let Kg=class{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return this._itemsPtr===0&&pS(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*uie);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;ethis._reset());const e=Math.floor(this._itemsPtr/this._itemsPerBuffer);for(;this._buffers.length<=e;){const r=new ArrayBuffer(this._itemsPerBuffer*this._itemByteSize);for(let i=0;ie;)this._buffers.pop(),this._items.length=this._buffers.length*this._itemsPerBuffer;this._itemsPtr=0}static createVec2f64(e=Jw){return new xv(16,Qve,e)}static createVec3f64(e=Jw){return new xv(24,nY,e)}static createVec4f64(e=Jw){return new xv(32,ibe,e)}static createMat3f64(e=Jw){return new xv(72,Xve,e)}static createMat4f64(e=Jw){return new xv(128,Wve,e)}static createQuatf64(e=Jw){return new xv(32,Yve,e)}get test(){return{size:this._buffers.length*this._itemsPerBuffer*this._itemByteSize}}};const Jw=4*j4.KILOBYTES,iOt=SE.createVec2f64(),Ie=SE.createVec3f64(),vZ=SE.createVec4f64();SE.createMat3f64();const bZ=SE.createMat4f64(),nOt=SE.createQuatf64();function _p(t){return t?{origin:ki(t.origin),vector:ki(t.vector)}:{origin:O(),vector:O()}}function hVe(t,e){const r=pVe.get();return r.origin=t,r.vector=e,r}function sOt(t,e=_p()){return dVe(t.origin,t.vector,e)}function dVe(t,e,r=_p()){return re(r.origin,t),re(r.vector,e),r}function Pb(t,e,r=_p()){return re(r.origin,t),ae(r.vector,e,t),r}function wZ(t,e){const r=ae(Ie.get(),e,t.origin),i=fe(t.vector,r),n=fe(t.vector,t.vector),s=ge(i/n,0,1),o=ae(Ie.get(),te(Ie.get(),t.vector,s),r);return fe(o,o)}function oOt(t,e,r){return BG(t,e,0,1,r)}function aOt(t,e,r){return oe(r,t.origin,te(r,t.vector,e))}function BG(t,e,r,i,n){const{vector:s,origin:o}=t,a=ae(Ie.get(),e,o),l=fe(s,a)/la(s);return te(n,s,ge(l,r,i)),oe(n,n,t.origin)}function lOt(t,e){if(hbe(t,hVe(e.origin,e.direction),!1,H4)){const{tA:r,pB:i,distance2:n}=H4;if(r>=0&&r<=1)return n;if(r<0)return wo(t.origin,i);if(r>1)return wo(oe(Ie.get(),t.origin,t.vector),i)}return null}function ube(t,e,r){return!!hbe(t,e,!0,H4)&&(re(r,H4.pA),!0)}function hbe(t,e,r,i){const s=t.origin,o=oe(Ie.get(),s,t.vector),a=e.origin,l=oe(Ie.get(),a,e.vector),c=Ie.get(),u=Ie.get();if(c[0]=s[0]-a[0],c[1]=s[1]-a[1],c[2]=s[2]-a[2],u[0]=l[0]-a[0],u[1]=l[1]-a[1],u[2]=l[2]-a[2],Math.abs(u[0])<1e-6&&Math.abs(u[1])<1e-6&&Math.abs(u[2])<1e-6)return!1;const d=Ie.get();if(d[0]=o[0]-s[0],d[1]=o[1]-s[1],d[2]=o[2]-s[2],Math.abs(d[0])<1e-6&&Math.abs(d[1])<1e-6&&Math.abs(d[2])<1e-6)return!1;const p=c[0]*u[0]+c[1]*u[1]+c[2]*u[2],m=u[0]*d[0]+u[1]*d[1]+u[2]*d[2],y=c[0]*d[0]+c[1]*d[1]+c[2]*d[2],_=u[0]*u[0]+u[1]*u[1]+u[2]*u[2],v=(d[0]*d[0]+d[1]*d[1]+d[2]*d[2])*_-m*m;if(Math.abs(v)<1e-6)return!1;let b=(p*m-y*_)/v,x=(p+m*b)/_;r&&(b=ge(b,0,1),x=ge(x,0,1));const T=Ie.get(),S=Ie.get();return T[0]=s[0]+b*d[0],T[1]=s[1]+b*d[1],T[2]=s[2]+b*d[2],S[0]=a[0]+x*u[0],S[1]=a[1]+x*u[1],S[2]=a[2]+x*u[2],i.tA=b,i.tB=x,i.pA=T,i.pB=S,i.distance2=wo(T,S),!0}const H4={tA:0,tB:0,pA:O(),pB:O(),distance2:0},pVe=new Kg(()=>_p());function qs(t){return t?hie(ki(t.origin),ki(t.direction)):hie(O(),O())}function hie(t,e){return{origin:t,direction:e}}function cOt(t,e){return Hf(t.origin,e.origin)&&Hf(t.direction,e.direction)}function bu(t,e){const r=yVe.get();return r.origin=t,r.direction=e,r}function W4(t,e=qs()){return dbe(t.origin,t.direction,e)}function fVe(t,e,r=qs()){return re(r.origin,t),ae(r.direction,e,t),r}function dbe(t,e,r=qs()){return re(r.origin,t),re(r.direction,e),r}function mVe(t,e){const r=ot(Ie.get(),me(Ie.get(),t.direction),ae(Ie.get(),e,t.origin));return fe(r,r)}function gVe(t,e,r){const i=fe(t.direction,ae(r,e,t.origin));return oe(r,t.origin,te(r,t.direction,i)),r}const yVe=new Kg(()=>qs());function eO(t,e){return fe(t,e)/Te(t)}function k6(t,e){const r=fe(t,e)/(Te(t)*Te(e));return-As(r)}function pbe(t,e,r){me(n$,t),me(_k,e);const i=fe(n$,_k),n=As(i),s=ot(n$,n$,_k);return fe(s,r)<0?2*Math.PI-n:n}const n$=O(),_k=O(),fbe=vn();function vn(){return Qt()}function PS(t,e=vn()){return vh(e,t)}function mbe(t,e){return $t(t[0],t[1],t[2],e)}function _Ve(t){return t}function vVe(t){t[0]=t[1]=t[2]=t[3]=0}function z6(t,e){return t[0]=t[1]=t[2]=0,t[3]=e,t}function vg(t){return t[3]}function bVe(t){return t}function gbe(t,e,r,i){return $t(t,e,r,i)}function wVe(t,e,r){return t!==r&&re(r,t),r[3]=t[3]+e,r}function xVe(t,e,r){return J.getLogger("esri.geometry.support.sphere").error("sphere.setExtent is not yet supported"),t===r?r:PS(t,r)}function u1(t,e,r){if(e==null)return!1;const{origin:i,direction:n}=e,s=TVe;s[0]=i[0]-t[0],s[1]=i[1]-t[1],s[2]=i[2]-t[2];const o=n[0]*n[0]+n[1]*n[1]+n[2]*n[2];if(o===0)return!1;const a=2*(n[0]*s[0]+n[1]*s[1]+n[2]*s[2]),l=a*a-4*o*(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]-t[3]*t[3]);if(l<0)return!1;const c=Math.sqrt(l);let u=(-a-c)/(2*o);const d=(-a+c)/(2*o);return(u<0||d0)&&(u=d),!(u<0)&&(r&&(r[0]=i[0]+n[0]*u,r[1]=i[1]+n[1]*u,r[2]=i[2]+n[2]*u),!0)}const TVe=O();function VG(t,e){return u1(t,e,null)}function SVe(t,e,r){if(u1(t,e,r))return r;const i=EE(t,e,Ie.get());return oe(r,e.origin,te(Ie.get(),e.direction,ci(e.origin,i)/Te(e.direction))),r}function EE(t,e,r){const i=Ie.get(),n=bZ.get();ot(i,e.origin,e.direction);const s=vg(t);ot(r,i,e.origin),te(r,r,1/Te(r)*s);const o=vbe(t,e.origin),a=k6(e.origin,r);return Ec(n,a+o,i),De(r,r,n),r}function EVe(t,e,r){return u1(t,e,r)?r:(gVe(e,t,r),ybe(t,r,r))}function ybe(t,e,r){const i=ae(Ie.get(),e,t),n=te(Ie.get(),i,t[3]/Te(i));return oe(r,n,t)}function _be(t,e){const r=ae(Ie.get(),e,t),i=la(r),n=t[3]*t[3];return Math.sqrt(Math.abs(i-n))}function vbe(t,e){const r=ae(Ie.get(),e,t),i=Te(r),n=vg(t),s=n+Math.abs(n-i);return As(n/s)}const vk=O();function bbe(t,e,r,i){const n=ae(vk,e,t);switch(r){case gc.X:{const s=sre(n,vk)[2];return ne(i,-Math.sin(s),Math.cos(s),0)}case gc.Y:{const s=sre(n,vk),o=s[1],a=s[2],l=Math.sin(o);return ne(i,-l*Math.cos(a),-l*Math.sin(a),Math.cos(o))}case gc.Z:return me(i,n);default:return}}function wbe(t,e){const r=ae(GG,e,t);return Te(r)-t[3]}function CVe(t,e,r,i){const n=wbe(t,e),s=bbe(t,e,gc.Z,GG),o=te(GG,s,r-n);return oe(i,e,o)}function AVe(t,e){const r=wo(t,e),i=vg(t);return r<=i*i}function OVe(t,e,r=vn()){const i=ci(t,e),n=t[3],s=e[3];return i+sMath.abs(t[1])?ne(e,0,1,0):ne(e,1,0,0),ot(r,t,e),me(e,e),ot(e,r,t),me(r,r)}function s$(t,e,r,i,n,s){const o=t+(e-t)*n;return o+(r+(i-r)*n-o)*s}function MVe(t,e,r,i=O()){const n=Te(t),s=Te(e),o=fe(t,e)/(n*s);if(o<.9999999999999999){const a=Math.acos(o),l=((1-r)*n+r*s)/Math.sin(a),c=l/n*Math.sin((1-r)*a),u=l/s*Math.sin(r*a);return te(gb,t,c),te(yb,e,u),oe(i,gb,yb)}return Lr(i,t,e,r)}function dOt(t,e,r,i=O(),n=O()){const s=Te(t),o=Te(e),a=fe(t,e)/(s*o);if(a<.9999999999999999){const l=Math.acos(a),c=Math.sin(l),u=Math.sin(r*l),d=Math.sin((1-r)*l),p=(1-r)*s+r*o;{const m=p/c,y=m/o*u;te(gb,t,m/s*d),te(yb,e,y),oe(i,gb,yb)}{const m=1/s*(-Math.cos((1-r)*l)*l*p+d*(-s+o));te(gb,t,m);const y=1/o*(Math.cos(r*l)*l*p+u*(-s+o));te(yb,e,y),oe(n,gb,yb),te(n,n,1/c)}return n}return Lr(i,t,e,r),ae(n,e,t),me(n,n),n}function bD(t,e,r){t=me(gb,t),e=me(yb,e);const i=As(fe(t,e));if(r){const n=ot($Ve,t,e);if(fe(n,r)<0)return-i}return i}function wD(t){const e=t.length;return r=>{if(r<=t[0][0])return t[0][1];if(r>=t[e-1][0])return t[e-1][1];let i=1;for(;r>t[i][0];)i++;const n=t[i-1][0],s=t[i][0],o=(s-r)/(s-n);return o*t[i-1][1]+(1-o)*t[i][1]}}function pOt(t,e,r,i){ae(die,e,t),ae(pie,r,t),ot(i,die,pie),me(i,i),i[3]=-fe(t,i)}const die=O(),pie=O(),$Ve=O(),gb=O(),yb=O();function Er(t=N3){return[t[0],t[1],t[2],t[3]]}function IVe(t=N3[0],e=N3[1],r=N3[2],i=N3[3]){return xZ(t,e,r,i,vZ.get())}function V6(t,e){return xZ(e[0],e[1],e[2],e[3],t)}function xZ(t,e,r,i,n=Er()){return n[0]=t,n[1]=e,n[2]=r,n[3]=i,n}function xbe(t,e,r){return re(r,t),r[3]=e,r}function MP(t,e,r){const i=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=Math.abs(i-1)>1e-5&&i>1e-12?1/Math.sqrt(i):1;return r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2]),r}function oa(t,e,r,i=Er()){const n=r[0]-e[0],s=r[1]-e[1],o=r[2]-e[2],a=t[0]-e[0],l=t[1]-e[1],c=t[2]-e[2],u=s*c-o*l,d=o*a-n*c,p=n*l-s*a,m=u*u+d*d+p*p,y=Math.abs(m-1)>1e-5&&m>1e-12?1/Math.sqrt(m):1;return i[0]=u*y,i[1]=d*y,i[2]=p*y,i[3]=-(i[0]*t[0]+i[1]*t[1]+i[2]*t[2]),i}function Tbe(t,e,r,i,n){const s=t.length/3;if(s<3)return!1;ne(aC,t[3*r],t[3*r+1],t[3*r+2]);let o=i,a=!1;for(;o=0}function FVe(t,e){const r=fe(t,e.ray.direction),i=-oi(t,e.ray.origin);if(i<0&&r>=0)return!1;if(r>-1e-6&&r<1e-6)return i>0;if((i<0||r<0)&&!(i<0&&r<0))return!0;const n=i/r;return r>0?ne.c0&&(e.c0=n),e.c0<=e.c1}function UVe(t,e){const r=fe(t,e.ray.direction),i=-oi(t,e.ray.origin);if(r>-1e-6&&r<1e-6)return i>0;const n=i/r;return r>0?ne.c0&&(e.c0=n),e.c0<=e.c1}function kVe(t,e,r){const i=te(Ie.get(),t,-t[3]),n=WG(t,ae(Ie.get(),e,i),Ie.get());return oe(r,n,i),r}function WG(t,e,r){const i=te(Ie.get(),t,fe(t,e));return ae(r,e,i),r}function oi(t,e){return fe(t,e)+t[3]}function G6(t,e,r,i,n){const s=fe(t,r);if(s===0)return!1;let o=-(fe(t,e)+t[3])/s;return i&Ff.CLAMP&&(o=ge(o,0,1)),!(!(i&Ff.INFINITE_MIN)&&o<0||!(i&Ff.INFINITE_MAX)&&o>1)&&(oe(n,e,te(n,r,o)),!0)}function mOt(t){return t}const N3=[0,0,1,0];var Ff;(function(t){t[t.NONE=0]="NONE",t[t.CLAMP=1]="CLAMP",t[t.INFINITE_MIN=4]="INFINITE_MIN",t[t.INFINITE_MAX=8]="INFINITE_MAX"})(Ff||(Ff={}));const zVe=Ff.INFINITE_MIN|Ff.INFINITE_MAX,BVe=Ff.INFINITE_MAX,bk=J.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");let VVe=class{constructor(){this.plane=Er(),this.origin=O(),this.basis1=O(),this.basis2=O()}};const Ebe=VVe;function e0(t=Nbe){return{plane:Er(t.plane),origin:ki(t.origin),basis1:ki(t.basis1),basis2:ki(t.basis2)}}function GVe(t,e,r){const i=t7e.get();return i.origin=t,i.basis1=e,i.basis2=r,i.plane=IVe(0,0,0,0),j6(i),i}function zw(t,e=e0()){return TZ(t.origin,t.basis1,t.basis2,e)}function jVe(t,e){re(e.origin,t.origin),re(e.basis1,t.basis1),re(e.basis2,t.basis2),V6(e.plane,t.plane)}function TZ(t,e,r,i=e0()){return re(i.origin,t),re(i.basis1,e),re(i.basis2,r),j6(i),KVe(i,"fromValues()"),i}function j6(t){mR(t.basis2,t.basis1,t.origin,t.plane)}function Cbe(t,e,r){t!==r&&zw(t,r);const i=te(Ie.get(),Gg(t),e);return oe(r.origin,r.origin,i),r.plane[3]-=e,r}function HVe(t,e,r){return Abe(e,r),Cbe(r,AZ(t,t.origin),r),r}function Abe(t,e=e0()){const r=(t[2]-t[0])/2,i=(t[3]-t[1])/2;return ne(e.origin,t[0]+r,t[1]+i,0),ne(e.basis1,r,0,0),ne(e.basis2,0,i,0),xZ(0,0,1,0,e.plane),e}function SZ(t,e,r){return!!kw(t.plane,e,r)&&Lbe(t,r)}function WVe(t,e,r){if(SZ(t,e,r))return r;const i=Obe(t,e,Ie.get());return oe(r,e.origin,te(Ie.get(),e.direction,ci(e.origin,i)/Te(e.direction))),r}function Obe(t,e,r){const i=q4.get();Dbe(t,e,i,q4.get());let n=Number.POSITIVE_INFINITY;for(const s of RZ){const o=OZ(t,s,H6.get()),a=Ie.get();if(DVe(i,o,a)){const l=Qg(Ie.get(),e.origin,a),c=Math.abs(As(fe(e.direction,l)));cr&&(r=s)}return Math.sqrt(r)}function CZ(t,e){return Sbe(t.plane,e)&&Lbe(t,e)}function YVe(t,e,r,i){return JVe(t,r,i)}function AZ(t,e){const r=-t.plane[3];return eO(Gg(t),e)-r}function ZVe(t,e,r,i){const n=AZ(t,e),s=te(e7e,Gg(t),r-n);return oe(i,e,s),i}function $be(t,e){return Bo(t.basis1,e.basis1)&&Bo(t.basis2,e.basis2)&&Bo(t.origin,e.origin)}function Ibe(t,e,r){return t!==r&&zw(t,r),us(ex,e),Sc(ex,ex),De(r.basis1,t.basis1,ex),De(r.basis2,t.basis2,ex),De(r.plane,t.plane,ex),De(r.origin,t.origin,e),jG(r.plane,r.plane,r.origin),r}function QVe(t,e,r,i){return t!==i&&zw(t,i),Ec(wk,e,r),De(i.basis1,t.basis1,wk),De(i.basis2,t.basis2,wk),j6(i),i}function Gg(t){return t.plane}function JVe(t,e,r){switch(e){case gc.X:re(r,t.basis1),me(r,r);break;case gc.Y:re(r,t.basis2),me(r,r);break;case gc.Z:re(r,Gg(t))}return r}function Lbe(t,e){const r=ae(Ie.get(),e,t.origin),i=la(t.basis1),n=la(t.basis2),s=fe(t.basis1,r),o=fe(t.basis2,r);return-s-i<0&&s-i<0&&-o-n<0&&o-n<0}function fie(t,e){const r=H6.get();return re(r.origin,t.origin),re(r.vector,e),r}function OZ(t,e,r){const{basis1:i,basis2:n,origin:s}=t,o=te(Ie.get(),i,e.origin[0]),a=te(Ie.get(),n,e.origin[1]);oe(r.origin,o,a),oe(r.origin,r.origin,s);const l=te(Ie.get(),i,e.direction[0]),c=te(Ie.get(),n,e.direction[1]);return te(r.vector,oe(l,l,c),2),r}function KVe(t,e){Math.abs(fe(t.basis1,t.basis2)/(Te(t.basis1)*Te(t.basis2)))>1e-6&&bk.warn(e,"Provided basis vectors are not perpendicular"),Math.abs(fe(t.basis1,Gg(t)))>1e-6&&bk.warn(e,"Basis vectors and plane normal are not perpendicular"),Math.abs(-fe(Gg(t),t.origin)-t.plane[3])>1e-6&&bk.warn(e,"Plane offset is not consistent with plane origin")}function Dbe(t,e,r,i){const n=Gg(t);mR(n,e.direction,e.origin,r),mR(r,n,e.origin,i)}const Nbe={plane:Er(),origin:Se(0,0,0),basis1:Se(1,0,0),basis2:Se(0,1,0)},q4=new Kg(Er),H6=new Kg(_p),e7e=O(),t7e=new Kg(()=>e0()),RZ=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],ex=_e(),wk=_e(),r7e=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:Ebe,UP:Nbe,altitudeAt:AZ,axisAt:YVe,closestPoint:Rbe,closestPointOnSilhouette:Obe,copy:zw,copyWithoutVerify:jVe,create:e0,distance:qVe,distance2:EZ,distanceToSilhouette:XVe,elevate:Cbe,equals:$be,extrusionContainsPoint:CZ,fromAABoundingRect:Abe,fromValues:TZ,intersectRay:SZ,intersectRayClosestSilhouette:WVe,normal:Gg,projectPoint:Pbe,projectPointLocal:Mbe,rotate:QVe,setAltitudeAt:ZVe,setExtent:HVe,transform:Ibe,updateUnboundedPlane:j6,wrap:GVe},Symbol.toStringTag,{value:"Module"})),i7e=new St(E0e),mie=new St(YX),gie=new St(ZX),yOt=new St(C0e);function t0(t){return t&&(nm(t)||Js(t,mie))?mie:t&&(sm(t)||Js(t,gie))?gie:i7e}function n7e(t){const{value:e,operations:r}=t;return{operations:r,value:r.create(e)}}function s7e(t,e,r){return t.operations.setExtent(t.value,e,r.value),r}function o7e(t){return{operations:t,value:t.create()}}function Fbe(t,e,r=o7e(t)){return r.operations=t,t.copy(e,r.value),r}function a7e(t){return Fbe(RVe,gbe(0,0,0,Mr(t).radius))}const yie=2**50;function l7e(){return Fbe(r7e,TZ([0,0,0],[yie,0,0],[0,yie,0]))}function c7e(t,e,r){return t.operations.axisAt(t.value,e,gc.Z,r)}function u7e(t,e,r,i){return t.operations.axisAt(t.value,e,r,i)}function h7e(t,e,r){return t.operations.intersectRay(t.value,e,r)}function d7e(t,e,r){return t.operations.intersectRayClosestSilhouette(t.value,e,r)}function p7e(t,e){return t.operations.altitudeAt(t.value,e)}function Ube(t,e,r,i){return t.operations.setAltitudeAt(t.value,e,r,i)}function f7e(t,e,r,i){return e!==i&&In(i,e),ne(tx,i[12],i[13],i[14]),Ube(t,tx,r,tx),i[12]=tx[0],i[13]=tx[1],i[14]=tx[2],i}function xk(t,e,r){return t.operations.elevate(t.value,e,r.value)}const tx=O();function _ie(t,e,r,i,n){return n[0]=fe(t,e),n[1]=fe(t,r),n[2]=fe(t,i),n}function qG(t,e,r,i,n){re(r,t),re(l$,e),me(l$,l$),ot(i,l$,r),ot(n,i,r)}function m7e(t,e){return t?t0(e):e.isGeographic?St.PlateCarree:e}const l$=O(),PZ=96;function _Ot(t,e){const r=e||t.extent,i=t.width,n=el(r&&r.spatialReference);return r&&i?r.width/i*n*QX*PZ:0}function g7e(t,e){return t/(el(e)*QX*PZ)}function y7e(t){return t/(QX*PZ)}const _7e="OBJECTID";let $S=class extends ZA{constructor(e){super(e),this.handles.add(this.on("before-add",r=>{r.item!=null&&r.item.parent===this.owner&&(J.getLogger(this).warn("Analysis inside the collection must be unique. Not adding this element again."),r.preventDefault())}))}_own(e){e.parent=this.owner}_release(e){e.parent=null}};$S=h([N("esri.support.AnalysesCollection")],$S);const xD={widthBreakpoint:{getValue(t){const e=t.viewSize[0],r=t.breakpoints,i=this.values;return e<=r.xsmall?i.xsmall:e<=r.small?i.small:e<=r.medium?i.medium:e<=r.large?i.large:i.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(t){const e=t.viewSize[1],r=t.breakpoints,i=this.values;return e<=r.xsmall?i.xsmall:e<=r.small?i.small:e<=r.medium?i.medium:e<=r.large?i.large:i.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(t){const e=t.viewSize,r=e[0],i=e[1],n=this.values;return i>=r?n.portrait:n.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},Tk={xsmall:544,small:768,medium:992,large:1200};function v7e(t){const e=t;return e&&e.xsmall{let e=class extends t{constructor(...r){super(...r),this._breakpointsHandles=new Vi,this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=Tk}initialize(){this._breakpointsHandles.add(ue(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),Pr))}destroy(){this.destroyed||(this._removeActiveClassNames(),this._breakpointsHandles=Me(this._breakpointsHandles))}set breakpoints(r){if(r===this._get("breakpoints"))return;const i=v7e(r);if(!i){const n=JSON.stringify(Tk,null,2);console.warn("provided breakpoints are not valid, using defaults:"+n)}r=i?r:Tk,this._set("breakpoints",{...r})}_updateClassNames(){if(!this.container)return;const r=uc.acquire(),i=uc.acquire();let n,s=!1;for(n in xD){const o=this[n],a=xD[n].getValue({viewSize:this.size,breakpoints:this.breakpoints});o!==a&&(s=!0,this[n]=a,Sk(n,o).forEach(l=>i.push(l)),Sk(n,a).forEach(l=>r.push(l)))}s&&(this._applyClassNameChanges(r,i),uc.release(r),uc.release(i))}_applyClassNameChanges(r,i){const n=this.container;n&&(i.forEach(s=>n.classList.remove(s)),r.forEach(s=>n.classList.add(s)))}_removeActiveClassNames(){const r=this.container;if(!r)return;let i;for(i in xD)Sk(i,this[i]).forEach(n=>r.classList.remove(n))}};return h([f()],e.prototype,"breakpoints",null),h([f()],e.prototype,"orientation",void 0),h([f()],e.prototype,"widthBreakpoint",void 0),h([f()],e.prototype,"heightBreakpoint",void 0),e=h([N("esri.views.BreakpointsOwner")],e),e};/*! + * @esri/arcgis-html-sanitizer - v3.0.1 - Tue Nov 15 2022 09:46:54 GMT-0800 (Pacific Standard Time) + * Copyright (c) 2022 - Environmental Systems Research Institute, Inc. + * Apache-2.0 + * + * js-xss + * Copyright (c) 2012-2018 Zongmin Lei(雷宗民) + * http://ucdok.com + * MIT License, see https://github.com/leizongmin/js-xss/blob/master/LICENSE for details + */var w7e=function(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},Kv={exports:{}},Qn={},gR={exports:{}},Bw={};function kbe(){var t={};return t["align-content"]=!1,t["align-items"]=!1,t["align-self"]=!1,t["alignment-adjust"]=!1,t["alignment-baseline"]=!1,t.all=!1,t["anchor-point"]=!1,t.animation=!1,t["animation-delay"]=!1,t["animation-direction"]=!1,t["animation-duration"]=!1,t["animation-fill-mode"]=!1,t["animation-iteration-count"]=!1,t["animation-name"]=!1,t["animation-play-state"]=!1,t["animation-timing-function"]=!1,t.azimuth=!1,t["backface-visibility"]=!1,t.background=!0,t["background-attachment"]=!0,t["background-clip"]=!0,t["background-color"]=!0,t["background-image"]=!0,t["background-origin"]=!0,t["background-position"]=!0,t["background-repeat"]=!0,t["background-size"]=!0,t["baseline-shift"]=!1,t.binding=!1,t.bleed=!1,t["bookmark-label"]=!1,t["bookmark-level"]=!1,t["bookmark-state"]=!1,t.border=!0,t["border-bottom"]=!0,t["border-bottom-color"]=!0,t["border-bottom-left-radius"]=!0,t["border-bottom-right-radius"]=!0,t["border-bottom-style"]=!0,t["border-bottom-width"]=!0,t["border-collapse"]=!0,t["border-color"]=!0,t["border-image"]=!0,t["border-image-outset"]=!0,t["border-image-repeat"]=!0,t["border-image-slice"]=!0,t["border-image-source"]=!0,t["border-image-width"]=!0,t["border-left"]=!0,t["border-left-color"]=!0,t["border-left-style"]=!0,t["border-left-width"]=!0,t["border-radius"]=!0,t["border-right"]=!0,t["border-right-color"]=!0,t["border-right-style"]=!0,t["border-right-width"]=!0,t["border-spacing"]=!0,t["border-style"]=!0,t["border-top"]=!0,t["border-top-color"]=!0,t["border-top-left-radius"]=!0,t["border-top-right-radius"]=!0,t["border-top-style"]=!0,t["border-top-width"]=!0,t["border-width"]=!0,t.bottom=!1,t["box-decoration-break"]=!0,t["box-shadow"]=!0,t["box-sizing"]=!0,t["box-snap"]=!0,t["box-suppress"]=!0,t["break-after"]=!0,t["break-before"]=!0,t["break-inside"]=!0,t["caption-side"]=!1,t.chains=!1,t.clear=!0,t.clip=!1,t["clip-path"]=!1,t["clip-rule"]=!1,t.color=!0,t["color-interpolation-filters"]=!0,t["column-count"]=!1,t["column-fill"]=!1,t["column-gap"]=!1,t["column-rule"]=!1,t["column-rule-color"]=!1,t["column-rule-style"]=!1,t["column-rule-width"]=!1,t["column-span"]=!1,t["column-width"]=!1,t.columns=!1,t.contain=!1,t.content=!1,t["counter-increment"]=!1,t["counter-reset"]=!1,t["counter-set"]=!1,t.crop=!1,t.cue=!1,t["cue-after"]=!1,t["cue-before"]=!1,t.cursor=!1,t.direction=!1,t.display=!0,t["display-inside"]=!0,t["display-list"]=!0,t["display-outside"]=!0,t["dominant-baseline"]=!1,t.elevation=!1,t["empty-cells"]=!1,t.filter=!1,t.flex=!1,t["flex-basis"]=!1,t["flex-direction"]=!1,t["flex-flow"]=!1,t["flex-grow"]=!1,t["flex-shrink"]=!1,t["flex-wrap"]=!1,t.float=!1,t["float-offset"]=!1,t["flood-color"]=!1,t["flood-opacity"]=!1,t["flow-from"]=!1,t["flow-into"]=!1,t.font=!0,t["font-family"]=!0,t["font-feature-settings"]=!0,t["font-kerning"]=!0,t["font-language-override"]=!0,t["font-size"]=!0,t["font-size-adjust"]=!0,t["font-stretch"]=!0,t["font-style"]=!0,t["font-synthesis"]=!0,t["font-variant"]=!0,t["font-variant-alternates"]=!0,t["font-variant-caps"]=!0,t["font-variant-east-asian"]=!0,t["font-variant-ligatures"]=!0,t["font-variant-numeric"]=!0,t["font-variant-position"]=!0,t["font-weight"]=!0,t.grid=!1,t["grid-area"]=!1,t["grid-auto-columns"]=!1,t["grid-auto-flow"]=!1,t["grid-auto-rows"]=!1,t["grid-column"]=!1,t["grid-column-end"]=!1,t["grid-column-start"]=!1,t["grid-row"]=!1,t["grid-row-end"]=!1,t["grid-row-start"]=!1,t["grid-template"]=!1,t["grid-template-areas"]=!1,t["grid-template-columns"]=!1,t["grid-template-rows"]=!1,t["hanging-punctuation"]=!1,t.height=!0,t.hyphens=!1,t.icon=!1,t["image-orientation"]=!1,t["image-resolution"]=!1,t["ime-mode"]=!1,t["initial-letters"]=!1,t["inline-box-align"]=!1,t["justify-content"]=!1,t["justify-items"]=!1,t["justify-self"]=!1,t.left=!1,t["letter-spacing"]=!0,t["lighting-color"]=!0,t["line-box-contain"]=!1,t["line-break"]=!1,t["line-grid"]=!1,t["line-height"]=!1,t["line-snap"]=!1,t["line-stacking"]=!1,t["line-stacking-ruby"]=!1,t["line-stacking-shift"]=!1,t["line-stacking-strategy"]=!1,t["list-style"]=!0,t["list-style-image"]=!0,t["list-style-position"]=!0,t["list-style-type"]=!0,t.margin=!0,t["margin-bottom"]=!0,t["margin-left"]=!0,t["margin-right"]=!0,t["margin-top"]=!0,t["marker-offset"]=!1,t["marker-side"]=!1,t.marks=!1,t.mask=!1,t["mask-box"]=!1,t["mask-box-outset"]=!1,t["mask-box-repeat"]=!1,t["mask-box-slice"]=!1,t["mask-box-source"]=!1,t["mask-box-width"]=!1,t["mask-clip"]=!1,t["mask-image"]=!1,t["mask-origin"]=!1,t["mask-position"]=!1,t["mask-repeat"]=!1,t["mask-size"]=!1,t["mask-source-type"]=!1,t["mask-type"]=!1,t["max-height"]=!0,t["max-lines"]=!1,t["max-width"]=!0,t["min-height"]=!0,t["min-width"]=!0,t["move-to"]=!1,t["nav-down"]=!1,t["nav-index"]=!1,t["nav-left"]=!1,t["nav-right"]=!1,t["nav-up"]=!1,t["object-fit"]=!1,t["object-position"]=!1,t.opacity=!1,t.order=!1,t.orphans=!1,t.outline=!1,t["outline-color"]=!1,t["outline-offset"]=!1,t["outline-style"]=!1,t["outline-width"]=!1,t.overflow=!1,t["overflow-wrap"]=!1,t["overflow-x"]=!1,t["overflow-y"]=!1,t.padding=!0,t["padding-bottom"]=!0,t["padding-left"]=!0,t["padding-right"]=!0,t["padding-top"]=!0,t.page=!1,t["page-break-after"]=!1,t["page-break-before"]=!1,t["page-break-inside"]=!1,t["page-policy"]=!1,t.pause=!1,t["pause-after"]=!1,t["pause-before"]=!1,t.perspective=!1,t["perspective-origin"]=!1,t.pitch=!1,t["pitch-range"]=!1,t["play-during"]=!1,t.position=!1,t["presentation-level"]=!1,t.quotes=!1,t["region-fragment"]=!1,t.resize=!1,t.rest=!1,t["rest-after"]=!1,t["rest-before"]=!1,t.richness=!1,t.right=!1,t.rotation=!1,t["rotation-point"]=!1,t["ruby-align"]=!1,t["ruby-merge"]=!1,t["ruby-position"]=!1,t["shape-image-threshold"]=!1,t["shape-outside"]=!1,t["shape-margin"]=!1,t.size=!1,t.speak=!1,t["speak-as"]=!1,t["speak-header"]=!1,t["speak-numeral"]=!1,t["speak-punctuation"]=!1,t["speech-rate"]=!1,t.stress=!1,t["string-set"]=!1,t["tab-size"]=!1,t["table-layout"]=!1,t["text-align"]=!0,t["text-align-last"]=!0,t["text-combine-upright"]=!0,t["text-decoration"]=!0,t["text-decoration-color"]=!0,t["text-decoration-line"]=!0,t["text-decoration-skip"]=!0,t["text-decoration-style"]=!0,t["text-emphasis"]=!0,t["text-emphasis-color"]=!0,t["text-emphasis-position"]=!0,t["text-emphasis-style"]=!0,t["text-height"]=!0,t["text-indent"]=!0,t["text-justify"]=!0,t["text-orientation"]=!0,t["text-overflow"]=!0,t["text-shadow"]=!0,t["text-space-collapse"]=!0,t["text-transform"]=!0,t["text-underline-position"]=!0,t["text-wrap"]=!0,t.top=!1,t.transform=!1,t["transform-origin"]=!1,t["transform-style"]=!1,t.transition=!1,t["transition-delay"]=!1,t["transition-duration"]=!1,t["transition-property"]=!1,t["transition-timing-function"]=!1,t["unicode-bidi"]=!1,t["vertical-align"]=!1,t.visibility=!1,t["voice-balance"]=!1,t["voice-duration"]=!1,t["voice-family"]=!1,t["voice-pitch"]=!1,t["voice-range"]=!1,t["voice-rate"]=!1,t["voice-stress"]=!1,t["voice-volume"]=!1,t.volume=!1,t["white-space"]=!1,t.widows=!1,t.width=!0,t["will-change"]=!1,t["word-break"]=!0,t["word-spacing"]=!0,t["word-wrap"]=!0,t["wrap-flow"]=!1,t["wrap-through"]=!1,t["writing-mode"]=!1,t["z-index"]=!1,t}function x7e(t,e,r){}function T7e(t,e,r){}var S7e=/javascript\s*\:/img;function E7e(t,e){return S7e.test(e)?"":e}Bw.whiteList=kbe();Bw.getDefaultWhiteList=kbe;Bw.onAttr=x7e;Bw.onIgnoreAttr=T7e;Bw.safeAttrValue=E7e;var C7e={indexOf:function(t,e){var r,i;if(Array.prototype.indexOf)return t.indexOf(e);for(r=0,i=t.length;r/g,B7e=/"/g,V7e=/"/g,G7e=/&#([a-zA-Z0-9]*);?/gim,j7e=/:?/gim,H7e=/&newline;?/gim,u$=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,bie=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,wie=/u\s*r\s*l\s*\(.*/gi;function jbe(t){return t.replace(B7e,""")}function Hbe(t){return t.replace(V7e,'"')}function Wbe(t){return t.replace(G7e,function(r,i){return i[0]==="x"||i[0]==="X"?String.fromCharCode(parseInt(i.substr(1),16)):String.fromCharCode(parseInt(i,10))})}function qbe(t){return t.replace(j7e,":").replace(H7e," ")}function Xbe(t){for(var e="",r=0,i=t.length;r",i);if(n===-1)break;r=n+3}return e}function Y7e(t){var e=t.split("");return e=e.filter(function(r){var i=r.charCodeAt(0);return i===127?!1:i<=31?i===10||i===13:!0}),e.join("")}Qn.whiteList=Bbe();Qn.getDefaultWhiteList=Bbe;Qn.onTag=L7e;Qn.onIgnoreTag=D7e;Qn.onTagAttr=N7e;Qn.onIgnoreTagAttr=F7e;Qn.safeAttrValue=U7e;Qn.escapeHtml=Gbe;Qn.escapeQuote=jbe;Qn.unescapeQuote=Hbe;Qn.escapeHtmlEntities=Wbe;Qn.escapeDangerHtml5Entities=qbe;Qn.clearNonPrintableCharacter=Xbe;Qn.friendlyAttrValue=Ybe;Qn.escapeAttrValue=Zbe;Qn.onIgnoreTagStripAll=W7e;Qn.StripTagBody=q7e;Qn.stripCommentTag=X7e;Qn.stripBlankChar=Y7e;Qn.cssFilter=Vbe;Qn.getDefaultCSSWhiteList=I7e;var W6={},Py=MZ;function Z7e(t){var e=Py.spaceIndex(t),r;return e===-1?r=t.slice(1,-1):r=t.slice(1,e+1),r=Py.trim(r).toLowerCase(),r.slice(0,1)==="/"&&(r=r.slice(1)),r.slice(-1)==="/"&&(r=r.slice(0,-1)),r}function Q7e(t){return t.slice(0,2)===""){i+=r(t.slice(n,s)),u=t.slice(s,a+1),c=Z7e(u),i+=e(s,i.length,c,u,Q7e(u)),n=a+1,s=!1;continue}if(d==='"'||d==="'")for(var p=1,m=t.charAt(a-p);m.trim()===""||m==="=";){if(m==="="){o=d;continue e}m=t.charAt(a-++p)}}else if(d===o){o=!1;continue}}return n0;e--){var r=t[e];if(r!==" ")return r==="="?e:-1}}function nGe(t){return t[0]==='"'&&t[t.length-1]==='"'||t[0]==="'"&&t[t.length-1]==="'"}function xie(t){return nGe(t)?t.substr(1,t.length-2):t}W6.parseTag=J7e;W6.parseAttr=eGe;var sGe=gR.exports.FilterCSS,Md=Qn,Qbe=W6,oGe=Qbe.parseTag,aGe=Qbe.parseAttr,TD=MZ;function h$(t){return t==null}function lGe(t){var e=TD.spaceIndex(t);if(e===-1)return{html:"",closing:t[t.length-2]==="/"};t=TD.trim(t.slice(e+1,-1));var r=t[t.length-1]==="/";return r&&(t=TD.trim(t.slice(0,-1))),{html:t,closing:r}}function cGe(t){var e={};for(var r in t)e[r]=t[r];return e}function uGe(t){var e={};for(var r in t)Array.isArray(t[r])?e[r.toLowerCase()]=t[r].map(function(i){return i.toLowerCase()}):e[r.toLowerCase()]=t[r];return e}function Jbe(t){t=cGe(t||{}),t.stripIgnoreTag&&(t.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),t.onIgnoreTag=Md.onIgnoreTagStripAll),t.whiteList||t.allowList?t.whiteList=uGe(t.whiteList||t.allowList):t.whiteList=Md.whiteList,t.onTag=t.onTag||Md.onTag,t.onTagAttr=t.onTagAttr||Md.onTagAttr,t.onIgnoreTag=t.onIgnoreTag||Md.onIgnoreTag,t.onIgnoreTagAttr=t.onIgnoreTagAttr||Md.onIgnoreTagAttr,t.safeAttrValue=t.safeAttrValue||Md.safeAttrValue,t.escapeHtml=t.escapeHtml||Md.escapeHtml,this.options=t,t.css===!1?this.cssFilter=!1:(t.css=t.css||{},this.cssFilter=new sGe(t.css))}Jbe.prototype.process=function(t){if(t=t||"",t=t.toString(),!t)return"";var e=this,r=e.options,i=r.whiteList,n=r.onTag,s=r.onIgnoreTag,o=r.onTagAttr,a=r.onIgnoreTagAttr,l=r.safeAttrValue,c=r.escapeHtml,u=e.cssFilter;r.stripBlankChar&&(t=Md.stripBlankChar(t)),r.allowCommentTag||(t=Md.stripCommentTag(t));var d=!1;r.stripIgnoreTagBody&&(d=Md.StripTagBody(r.stripIgnoreTagBody,s),s=d.onIgnoreTag);var p=oGe(t,function(m,y,_,v,b){var x={sourcePosition:m,position:y,isClosing:b,isWhite:Object.prototype.hasOwnProperty.call(i,_)},T=n(_,v,x);if(!h$(T))return T;if(x.isWhite){if(x.isClosing)return"";var S=lGe(v),A=i[_],C=aGe(S.html,function(R,P){var F=TD.indexOf(A,R)!==-1,k=o(_,R,P,F);return h$(k)?F?(P=l(_,R,P,u),P?R+'="'+P+'"':R):(k=a(_,R,P,F),h$(k)?void 0:k):k});return v="<"+_,C&&(v+=" "+C),S.closing&&(v+=" /"),v+=">",v}else return T=s(_,v,x),h$(T)?c(v):T},c);return d&&(p=d.remove(p)),p};var hGe=Jbe;(function(t,e){var r=Qn,i=W6,n=hGe;function s(a,l){var c=new n(l);return c.process(a)}e=t.exports=s,e.filterXSS=s,e.FilterXSS=n,function(){for(var a in r)e[a]=r[a];for(var l in i)e[l]=i[l]}();function o(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}o()&&(self.filterXSS=t.exports)})(Kv,Kv.exports);var dGe=function(){function t(e,r){var i=this;this.arcgisWhiteList={a:["href","style","target"],abbr:["title"],audio:["autoplay","controls","loop","muted","preload"],b:[],br:[],dd:["style"],div:["align","style"],dl:["style"],dt:["style"],em:[],figcaption:["style"],figure:["style"],font:["color","face","size","style"],h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],hr:[],i:[],img:["alt","border","height","src","style","width"],li:[],ol:[],p:["style"],source:["media","src","type"],span:["style"],strong:[],sub:["style"],sup:["style"],table:["border","cellpadding","cellspacing","height","style","width"],tbody:[],tr:["align","height","style","valign"],td:["align","colspan","height","nowrap","rowspan","style","valign","width"],th:["align","colspan","height","nowrap","rowspan","style","valign","width"],u:[],ul:[],video:["autoplay","controls","height","loop","muted","poster","preload","width"]},this.allowedProtocols=["http","https","mailto","iform","tel","flow","lfmobile","arcgis-navigator","arcgis-appstudio-player","arcgis-survey123","arcgis-collector","arcgis-workforce","arcgis-explorer","arcgis-trek2there","arcgis-quickcapture","mspbi","comgooglemaps","pdfefile","pdfehttp","pdfehttps","boxapp","boxemm","awb","awbs","gropen","radarscope"],this.arcgisFilterOptions={allowCommentTag:!0,safeAttrValue:function(s,o,a,l){return s==="a"&&o==="href"||(s==="img"||s==="source")&&o==="src"?i.sanitizeUrl(a):Kv.exports.safeAttrValue(s,o,a,l)}},this._entityMap={"&":"8","<":"<",">":">",'"':""","'":"'","/":"/"};var n;e&&!r?n=e:e&&r?(n=Object.create(this.arcgisFilterOptions),Object.keys(e).forEach(function(s){s==="whiteList"?n.whiteList=i._extendObjectOfArrays([i.arcgisWhiteList,e.whiteList||{}]):n[s]=e[s]})):(n=Object.create(this.arcgisFilterOptions),n.whiteList=this.arcgisWhiteList),this.xssFilterOptions=n,this._xssFilter=new Kv.exports.FilterXSS(n)}return t.prototype.sanitize=function(e,r){switch(r===void 0&&(r={}),typeof e){case"number":return isNaN(e)||!isFinite(e)?null:e;case"boolean":return e;case"string":return this._xssFilter.process(e);case"object":return this._iterateOverObject(e,r);default:return r.allowUndefined&&typeof e>"u"?void 0:null}},t.prototype.sanitizeUrl=function(e,r){var i=(r??{}).isProtocolRequired,n=i===void 0?!0:i,s=this._trim(e.substring(0,e.indexOf(":"))),o=e==="/",a=/^#/.test(e),l=s&&this.allowedProtocols.indexOf(s.toLowerCase())>-1;return o||a||l?Kv.exports.escapeAttrValue(e):!s&&!n?Kv.exports.escapeAttrValue("https://".concat(e)):""},t.prototype.sanitizeHTMLAttribute=function(e,r,i,n){return typeof this.xssFilterOptions.safeAttrValue=="function"?this.xssFilterOptions.safeAttrValue(e,r,i,n):Kv.exports.safeAttrValue(e,r,i,n)},t.prototype.validate=function(e,r){r===void 0&&(r={});var i=this.sanitize(e,r);return{isValid:e===i,sanitized:i}},t.prototype.encodeHTML=function(e){var r=this;return String(e).replace(/[&<>"'\/]/g,function(i){return r._entityMap[i]})},t.prototype.encodeAttrValue=function(e){var r=/^[a-zA-Z0-9]$/;return String(e).replace(/[\x00-\xFF]/g,function(i,n){return r.test(i)?i:"&#x".concat(Number(e.charCodeAt(n)).toString(16),";")})},t.prototype._extendObjectOfArrays=function(e){var r={};return e.forEach(function(i){Object.keys(i).forEach(function(n){Array.isArray(i[n])&&Array.isArray(r[n])?r[n]=r[n].concat(i[n]):r[n]=i[n]})}),r},t.prototype._iterateOverObject=function(e,r){var i=this;r===void 0&&(r={});try{var n=!1,s=void 0;if(Array.isArray(e))s=e.reduce(function(a,l){var c=i.validate(l,r);return c.isValid?a.concat([l]):(n=!0,a.concat([c.sanitized]))},[]);else if(w7e(e)){var o=Object.keys(e);s=o.reduce(function(a,l){var c=e[l],u=i.validate(c,r);return u.isValid?a[l]=c:(n=!0,a[l]=u.sanitized),a},{})}else return r.allowUndefined&&typeof e>"u"?void 0:null;return n?s:e}catch{return null}},t.prototype._trim=function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},t}();const q6=new Map;function Kbe(){q6.clear()}function pGe(t){return q6.get(t)}function fGe(t,e){q6.set(t,e)}function Ek(t){q6.delete(t)}var lw,IS,mGe=function(t){if("WebkitTransition"in t.style)lw="webkitTransitionEnd",IS="webkitAnimationEnd";else{if(!("transition"in t.style))throw new Error("Your browser is not supported!");lw="transitionend",IS="animationend"}},ewe=function(t){lw||mGe(t)},gGe=function(t,e){return e===void 0&&(e=t+"-active"),function(r){ewe(r);var i=!1,n=function(s){i||(i=!0,r.removeEventListener(lw,n),r.removeEventListener(IS,n),r.classList.remove(t),r.classList.remove(e))};r.classList.add(t),r.addEventListener(lw,n),r.addEventListener(IS,n),requestAnimationFrame(function(){r.classList.add(e)})}},yGe=function(t,e){return e===void 0&&(e=t+"-active"),function(r,i){ewe(r);var n=!1,s=function(o){n||(n=!0,r.removeEventListener(lw,s),r.removeEventListener(IS,s),i())};r.classList.add(t),r.addEventListener(lw,s),r.addEventListener(IS,s),requestAnimationFrame(function(){r.classList.add(e)})}};const _Ge=J.getLogger("esri.widgets.support.widgetUtils");function vGe(t){const e=uc.acquire();for(let i=0;i{const t=new Map,e=new ResizeObserver(i=>{var n;Kbe();for(const s of i)(n=t.get(s.target))==null||n(s)}),r=(i,n,s)=>(t.has(i)&&_Ge.error("Already observing element",i),t.set(i,n),e.observe(i,s),Za(()=>{e.unobserve(i),t.delete(i)}));return(i,n,s)=>{let o=null;return ue(()=>typeof i=="function"?i():i,a=>{o==null||o.remove(),a&&(o=r(a,n,s))},An)}})();function bGe(t){const e=t==null?void 0:t.closest("[dir]");return e!==null&&e instanceof HTMLElement&&e.dir==="rtl"||document.dir==="rtl"}function bOt(t){const e="data-node-ref";this[t.getAttribute(e)]=null}function wOt(t){const e="data-node-ref";this[t.getAttribute(e)]=t}function xOt(t,e){return(t==="enter"?gGe:yGe)(e)}const wGe=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"],xGe=wGe.reduce((t,e)=>(t[e]=[],t),{}),TGe=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],twe=new dGe({whiteList:xGe,onTagAttr:(t,e,r)=>{const i=`${e}="${r}"`;if(TGe.includes(e))return i},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0);function SGe(t){return t==="Enter"||t===" "}const rwe="http://www.w3.org/",X6=`${rwe}2000/svg`,iwe=`${rwe}1999/xlink`;let Tie=[],$Z=(t,e)=>{let r={};return Object.keys(t).forEach(i=>{r[i]=t[i]}),e&&Object.keys(e).forEach(i=>{r[i]=e[i]}),r},IZ=(t,e)=>t.vnodeSelector===e.vnodeSelector&&(t.properties&&e.properties?t.properties.key===e.properties.key&&t.properties.bind===e.properties.bind:!t.properties&&!e.properties),nwe=t=>{if(typeof t!="string")throw new Error("Style values must be strings")},EGe=(t,e,r)=>{if(e.vnodeSelector!==""){for(let i=r;i{let n=t[e];if(n.vnodeSelector==="")return;let s=n.properties;if(!(s&&(s.key===void 0?s.bind:s.key))){for(let o=0;o{if(t.properties){let e=t.properties.enterAnimation;e&&e(t.domNode,t.properties)}},XG=[],YG=!1,swe=t=>{(t.children||[]).forEach(swe),t.properties&&t.properties.afterRemoved&&t.properties.afterRemoved.apply(t.properties.bind||t.properties,[t.domNode])},Sie=()=>{YG=!1,XG.forEach(swe),XG.length=0},Eie=t=>{XG.push(t),YG||(YG=!0,typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(Sie,{timeout:16}):setTimeout(Sie,16))},Cie=t=>{let e=t.domNode;if(t.properties){let r=t.properties.exitAnimation;if(r)return e.style.pointerEvents="none",void r(e,()=>{e.parentNode&&(e.parentNode.removeChild(e),Eie(t))},t.properties)}e.parentNode&&(e.parentNode.removeChild(e),Eie(t))},AGe=(t,e,r)=>{if(!e)return;let i=r.eventHandlerInterceptor,n=Object.keys(e),s=n.length;for(let o=0;o{if(e)for(let i of e)oT(i,t,void 0,r)},awe=(t,e,r)=>{OGe(t,e.children,r),e.text&&(t.textContent=e.text),AGe(t,e.properties,r),e.properties&&e.properties.afterCreate&&e.properties.afterCreate.apply(e.properties.bind||e.properties,[t,r,e.vnodeSelector,e.properties,e.children])},oT=(t,e,r,i)=>{let n,s=0,o=t.vnodeSelector,a=e.ownerDocument;if(o==="")n=t.domNode=a.createTextNode(t.text),r!==void 0?e.insertBefore(n,r):e.appendChild(n);else{for(let l=0;l<=o.length;++l){let c=o.charAt(l);if(l===o.length||c==="."||c==="#"){let u=o.charAt(s-1),d=o.slice(s,l);u==="."?n.classList.add(d):u==="#"?n.id=d:(d==="svg"&&(i=$Z(i,{namespace:X6})),i.namespace!==void 0?n=t.domNode=a.createElementNS(i.namespace,d):(n=t.domNode=t.domNode||a.createElement(d),d==="input"&&t.properties&&t.properties.type!==void 0&&n.setAttribute("type",t.properties.type)),r!==void 0?e.insertBefore(n,r):n.parentNode!==e&&e.appendChild(n)),s=l+1}}awe(n,t,i)}},ZG=(t,e,r)=>{e&&e.split(" ").forEach(i=>{i&&t.classList.toggle(i,r)})},RGe=(t,e,r,i)=>{if(!r)return;let n=!1,s=Object.keys(r),o=s.length;for(let a=0;a{if(r===i)return!1;i=i||Tie;let s,o=(r=r||Tie).length,a=i.length,l=0,c=0,u=!1;for(;c=0){for(s=l;sl)for(s=l;s{let i=t.domNode,n=!1;if(t===e)return!1;let s=!1;if(e.vnodeSelector===""){if(e.text!==t.text){let o=i.ownerDocument.createTextNode(e.text);return i.parentNode.replaceChild(o,i),e.domNode=o,n=!0,n}e.domNode=i}else e.vnodeSelector.lastIndexOf("svg",0)===0&&(r=$Z(r,{namespace:X6})),t.text!==e.text&&(s=!0,e.text===void 0?i.removeChild(i.firstChild):i.textContent=e.text),e.domNode=i,s=PGe(e,i,t.children,e.children,r)||s,s=RGe(i,t.properties,e.properties,r)||s,e.properties&&e.properties.afterUpdate&&e.properties.afterUpdate.apply(e.properties.bind||e.properties,[i,r,e.vnodeSelector,e.properties,e.children]);return s&&e.properties&&e.properties.updateAnimation&&e.properties.updateAnimation(i,e.properties,t.properties),n};let cC=(t,e)=>({getLastRender:()=>t,update:r=>{if(t.vnodeSelector!==r.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let i=t;t=r,Y4(i,r,e)},domNode:t.domNode});const MGe={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(t,e,r)=>{e.charAt(0)==="-"?t.style.setProperty(e,r):t.style[e]=r}};let y2=t=>$Z(MGe,t),u_={create:(t,e)=>(e=y2(e),oT(t,document.createElement("div"),void 0,e),cC(t,e)),append:(t,e,r)=>(r=y2(r),oT(e,t,void 0,r),cC(e,r)),insertBefore:(t,e,r)=>(r=y2(r),oT(e,t.parentNode,t,r),cC(e,r)),merge:(t,e,r)=>(r=y2(r),e.domNode=t,awe(t,e,r),cC(e,r)),replace:(t,e,r)=>(r=y2(r),oT(e,t.parentNode,t,r),t.parentNode.removeChild(t),cC(e,r))},lwe,$Ge=(t,e)=>{let r=[];for(;t&&t!==e;)r.push(t),t=t.parentNode;return r};lwe=Array.prototype.find?(t,e)=>t.find(e):(t,e)=>t.filter(e)[0];let IGe=(t,e)=>{let r=t;return e.forEach(i=>{r=r&&r.children?lwe(r.children,n=>n.domNode===i):void 0}),r},LGe=(t,e,r)=>{let i=function(n){r("domEvent",n);let s=e(),o=$Ge(n.currentTarget,s.domNode);o.reverse();let a,l=IGe(s.getLastRender(),o);return t.scheduleRender(),l&&(a=l.properties[`on${n.type}`].apply(l.properties.bind||this,arguments)),r("domEventProcessed",n),a};return(n,s,o,a)=>i},Aie=t=>{let e,r,i=y2(t),n=i.performanceLogger,s=!0,o=!1,a=[],l=[],c=(d,p,m)=>{let y,_=()=>y;i.eventHandlerInterceptor=LGe(e,_,n),y=d(p,m(),i),a.push(y),l.push(m)},u=()=>{if(r=void 0,s){s=!1,n("renderStart",void 0);for(let d=0;d{r||o||(r=requestAnimationFrame(u))},stop:()=>{r&&(cancelAnimationFrame(r),r=void 0),o=!0},resume:()=>{o=!1,s=!0,e.scheduleRender()},append:(d,p)=>{c(u_.append,d,p)},insertBefore:(d,p)=>{c(u_.insertBefore,d,p)},merge:(d,p)=>{c(u_.merge,d,p)},replace:(d,p)=>{c(u_.replace,d,p)},detach:d=>{for(let p=0;p0}get updating(){var e;return((e=this._watchUpdatingTracking)==null?void 0:e.updating)??!1}initialize(){const e=document.createElement("div");e.className="esri-overlay-surface",this._set("surface",e),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),e.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange(()=>this.items,r=>{for(const i of r.added){const n=()=>i.render();this._callbacks.set(i,n),this._projector.append(this.surface,n)}for(const i of r.removed){const n=this._projector.detach(this._callbacks.get(i));this.surface.removeChild(n.domNode),this._callbacks.delete(i)}})}addItem(e){this.items.add(e)}removeItem(e){this.items.remove(e)}destroy(){this.items.removeAll(),this._callbacks.forEach(e=>this._projector.detach(e)),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(e){const r=this._hiddenSurface,i=this._hiddenProjector;let n;const s=()=>(n=e.render(),n);i.append(r,s),i.renderNow();const o={left:0,top:0,right:0,bottom:0};if(n&&n.domNode){const a=n.domNode.getBoundingClientRect();o.left=a.left,o.top=a.top,o.right=a.right,o.bottom=a.bottom}for(i.detach(s);r.firstChild;)r.removeChild(r.firstChild);return o}overlaps(e,r){const i=this.computeBoundingRect(e),n=this.computeBoundingRect(r);return Math.max(i.left,n.left)<=Math.min(i.right,n.right)&&Math.max(i.top,n.top)<=Math.min(i.bottom,n.bottom)}get hasVisibleItems(){return this.items.some(e=>e.visible)}async prepare(){await document.fonts.load(this._fontString()).catch(()=>{})}renderCanvas(e){if(!this.items.some(i=>i.visible))return;const r=e.getContext("2d");r.save(),r.font=this._fontString(),this.items.forEach(i=>{r.save(),i.renderCanvas(r),r.restore()}),r.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};h([f({readOnly:!0})],uy.prototype,"surface",void 0),h([f({readOnly:!0})],uy.prototype,"items",void 0),h([f({readOnly:!0})],uy.prototype,"needsRender",null),h([f({readOnly:!0})],uy.prototype,"_watchUpdatingTracking",void 0),h([f({readOnly:!0})],uy.prototype,"updating",null),uy=h([N("esri.views.overlay.ViewOverlay")],uy);const Oie=uy,Ak=[0,0];function DGe(t){const e=(t.ownerDocument||window.document).defaultView,r=t.getBoundingClientRect();return Ak[0]=r.left+((e==null?void 0:e.pageXOffset)??0),Ak[1]=r.top+((e==null?void 0:e.pageYOffset)??0),Ak}function Rie(t){t&&(tve(t),t.parentNode&&t.parentNode.removeChild(t))}function NGe(t){const e=document.createElement("div");return t.appendChild(e),e}const uC=16,d$=750,FGe=512,UGe=2,kGe=t=>{let e=class extends t{constructor(...r){super(...r),this._freqInfo={freq:uC,time:d$},this._overlayRenderTaskHandle=null,this.height=0,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([ue(()=>this.cursor,i=>{const{surface:n}=this;n&&n.setAttribute("data-cursor",i)}),ue(()=>this.navigating,i=>{const{surface:n}=this;n&&n.setAttribute("data-navigating",i.toString())})])}initialize(){this.addHandles([ue(()=>this.ui,(r,i)=>this._handleUIChange(r,i),Pr),this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui=Me(this.ui),this.container=null)}get container(){return this._get("container")??null}set container(r){const i=this._get("container"),n=R6(r);if(n||typeof r!="string"||J.getLogger(this).error("#container",`element with id '${r}' not found`),i===n)return;if(this._stopMeasuring(),i&&(i.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(Rie(this.root),this._set("root",null)),this.userContent&&(qre(this.userContent,i),Rie(this.userContent),this._set("userContent",null))),!n)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);n.classList.add("esri-view");const s=document.createElement("div");s.className="esri-view-user-storage",qre(n,s),n.appendChild(s),this._set("userContent",s);const o=document.createElement("div");o.className="esri-view-root",n.insertBefore(o,n.firstChild),this._set("root",o);const a=document.createElement("div");a.className="esri-view-surface",a.setAttribute("role","application"),a.tabIndex=0,o.appendChild(a),this._set("surface",a);const l=new Oie;o.appendChild(l.surface),this._set("overlay",l),this.addHandles(ue(()=>l.needsRender,c=>{c&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=fS({render:()=>{var u;return(u=this.overlay)==null?void 0:u.render()}}):this._overlayRenderTaskHandle=Pi(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",n),this._startMeasuring()}get focused(){const r=document.activeElement===this.surface;return document.hasFocus()&&r}get size(){return[this.width,this.height]}blur(){var r;(r=this.surface)==null||r.blur()}focus(){var r;(r=this.surface)==null||r.focus()}pageToContainer(r,i,n){const s=this.position;return r-=s?s[0]:0,i-=s?s[1]:0,n?(n[0]=r,n[1]=i):n=[r,i],n}containerToPage(r,i,n){const s=this.position;return r+=s?s[0]:0,i+=s?s[1]:0,n?(n[0]=r,n[1]=i):n=[r,i],n}_handleUIChange(r,i){this.removeHandles("ui"),i&&i!==r&&i.destroy(),r&&(r.view=this,this.addHandles(ue(()=>this.root,n=>{r.container=n?NGe(n):null},Pr),"ui")),this._set("ui",r)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const r=this._freqInfo;r.freq=uC,r.time=d$,this.addHandles([(()=>{const i=()=>{r.freq=uC,r.time=d$};return window.addEventListener("resize",i),{remove(){window.removeEventListener("resize",i)}}})(),fS({prepare:i=>{const n=this._measure(),s=this._freqInfo;if(s.time+=i.deltaTime,n&&(s.freq=uC,this._get("resizing")||this._set("resizing",!0)),s.time=FGe&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const r=this.container,i=r?r.clientWidth:0,n=r?r.clientHeight:0;if(i===0||n===0)return this.suspended||this._set("suspended",!0),!1;const s=this.width,o=this.height;return i===s&&n===o?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",i),this._set("height",n),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:s,oldHeight:o,width:i,height:n}),!0)}_position(){const r=this.container,i=this.position,n=r&&DGe(r);return!!n&&(!i||n[0]!==i[0]||n[1]!==i[1])&&(this._set("position",[n[0],n[1]]),!0)}forceDOMReadyCycle(){}};return h([f()],e.prototype,"container",null),h([f({readOnly:!0})],e.prototype,"focused",null),h([f({readOnly:!0})],e.prototype,"height",void 0),h([f({type:Oie})],e.prototype,"overlay",void 0),h([f({readOnly:!0})],e.prototype,"position",void 0),h([f({readOnly:!0})],e.prototype,"resizing",void 0),h([f({readOnly:!0})],e.prototype,"root",void 0),h([f({value:null,readOnly:!0})],e.prototype,"size",null),h([f({readOnly:!0})],e.prototype,"surface",void 0),h([f({readOnly:!0})],e.prototype,"suspended",void 0),h([f()],e.prototype,"ui",void 0),h([f({readOnly:!0})],e.prototype,"userContent",void 0),h([f({readOnly:!0})],e.prototype,"width",void 0),h([f()],e.prototype,"widthBreakpoint",void 0),e=h([N("esri.views.DOMContainer")],e),e},LZ=J.getLogger("esri.layers.support.ElevationSampler");let cwe=class{queryElevation(e){return uwe(e.clone(),this)}on(){return jGe}projectIfRequired(e,r){return hwe(e,r)}},zGe=class extends cwe{get spatialReference(){return this.extent.spatialReference}constructor(e,r,i){super(),this.tile=e,this.noDataValue=i;const n=e.tile.extent;this.extent=d6(n,r.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=n;const s=el(r.spatialReference),o=r.lodAt(e.tile.level).resolution*s;this.demResolution={min:o,max:o}}contains(e){const r=this.projectIfRequired(e,this.spatialReference);return r!=null&&this.containsAt(r.x,r.y)}containsAt(e,r){return p6(this._aaExtent,e,r)}elevationAt(e,r){if(!this.containsAt(e,r)){const i=this.extent,n=`${i.xmin}, ${i.ymin}, ${i.xmax}, ${i.ymax}`;return LZ.warn("#elevationAt()",`Point used to sample elevation (${e}, ${r}) is outside of the sampler extent (${n})`),this.noDataValue}return this.tile.sample(e,r)??this.noDataValue}},COt=class extends cwe{get spatialReference(){return this.extent.spatialReference}constructor(e,r,i){let n;super(),typeof r=="number"?(this.noDataValue=r,n=null):(n=r,this.noDataValue=i),this.samplers=n?e.map(o=>new zGe(o,n,this.noDataValue)):e;const s=this.samplers[0];if(s){this.extent=s.extent.clone();const{min:o,max:a}=s.demResolution;this.demResolution={min:o,max:a};for(let l=1;l=0;m--)d.unshift(new kd({level:m,scale:p,resolution:p})),p*=2}return new hy({dpi:96,lods:d,origin:new ze(0,0,n),size:[i,i],spatialReference:n})}const o=Sb(n),a=t.origin?new ze({x:t.origin.x,y:t.origin.y,spatialReference:n}):new ze(o?{x:o.origin[0],y:o.origin[1],spatialReference:n}:{x:0,y:0,spatialReference:n}),l=96,c=1/(el(n)*39.37*l),u=[];if(r)for(let d=0;d{i.push(s.scale),e=s.scale>e?s.scale:e,r=s.scale=e.length-1)return e[e.length-1];const r=Math.floor(t),i=r+1;return e[r]/(e[r]/e[i])**(t-r)}scaleToZoom(t){const e=this.scales,r=e.length-1;let i=0;for(;it&&s=e?this.zoomToScale(Math.ceil(r)):this.zoomToScale(Math.floor(r))}tileAt(t,e,r,i){const n=this.lodAt(t);if(!n)return null;let s,o;if(typeof e=="number")s=e,o=r;else if(Js(e.spatialReference,this.spatialReference))s=e.x,o=e.y,i=r;else{const c=$w(e,this.spatialReference);if(c==null)return null;s=c.x,o=c.y,i=r}const a=n.resolution*this.size[0],l=n.resolution*this.size[1];return i||(i=new HGe(null,0,0,0,jt())),i.level=t,i.row=Math.floor((this.origin.y-o)/l+.001),i.col=Math.floor((s-this.origin.x)/a+.001),this.updateTileInfo(i),i}updateTileInfo(t,e=hy.ExtrapolateOptions.NONE){let r=this.lodAt(t.level);if(!r&&e===hy.ExtrapolateOptions.POWER_OF_TWO){const o=this.lods[this.lods.length-1];o.levelArray.isArray(t)?t:typeof t=="number"?[t,t]:[256,256]})],Ko.prototype,"size",void 0),h([lr("size",["rows","cols"])],Ko.prototype,"readSize",null),h([xr("size",{cols:{type:mn},rows:{type:mn}})],Ko.prototype,"writeSize",null),h([f({type:St,json:{write:!0}})],Ko.prototype,"spatialReference",void 0),Ko=hy=h([N("esri.layers.support.TileInfo")],Ko),function(t){var e;(e=t.ExtrapolateOptions||(t.ExtrapolateOptions={}))[e.NONE=0]="NONE",e[e.POWER_OF_TWO=1]="POWER_OF_TWO"}(Ko||(Ko={}));const SD=Ko,WGe=12;let hc=class pl{constructor(e){const r=pl.checkUnsupported(e);if(r!=null)throw r;const i=e;this.spatialReference=i.spatialReference,this._isWebMercator=this.spatialReference.isWebMercator,this._isGCS=G_(this.spatialReference)||nm(this.spatialReference)||sm(this.spatialReference),this.origin=[i.origin.x,i.origin.y],this.pixelSize=i.size[0],this.dpi=i.dpi;const n=i.lods.reduce((c,u,d)=>(u.levelnew kd({level:r,scale:e.scale,resolution:e.resolution}))})}getExtent(e,r,i,n){const s=this.levels[e],o=s.tileSize[0],a=s.tileSize[1];n[0]=this.origin[0]+i*o,n[2]=this.origin[0]+(i+1)*o,n[3]=this.origin[1]-r*a,n[1]=this.origin[1]-(r+1)*a}convertExtentToRadians(e,r){this._isWebMercator?(r[0]=Hte(e[0]),r[1]=g4(e[1]),r[2]=Hte(e[2]),r[3]=g4(e[3])):this._isGCS&&(r[0]=It(e[0]),r[1]=It(e[1]),r[2]=It(e[2]),r[3]=It(e[3]))}getExtentGeometry(e,r,i,n=new Dr){return this.getExtent(e,r,i,Ap),n.spatialReference=this.spatialReference,n.xmin=Ap[0],n.ymin=Ap[1],n.xmax=Ap[2],n.ymax=Ap[3],n.zmin=void 0,n.zmax=void 0,n}ensureMaxLod(e){if(e==null)return!1;let r=!1;for(;this.levels.length<=e;){const i=this.levels[this.levels.length-1],n=i.resolution/2;this.levels.push({resolution:n,scale:i.scale/2,tileSize:[n*this.pixelSize,n*this.pixelSize]}),r=!0}return r}capMaxLod(e){this.levels.length>e+1&&(this.levels.length=e+1)}getMaxLod(){return this.levels.length-1}scaleAtLevel(e){return this.levels[0].scale/2**e}levelAtScale(e){const r=this.levels[0].scale;return e>=r?0:Math.log(r/e)*Math.LOG2E}resolutionAtLevel(e){return this.levels[0].resolution/2**e}compatibleWith(e){if(!(e instanceof pl)){if(pl.checkUnsupported(e))return!1;e=new pl(e)}if(!e.spatialReference.equals(this.spatialReference)||e.pixelSize!==this.pixelSize)return!1;const r=Math.min(this.levels.length,e.levels.length)-1,i=this.levels[r].resolution;let n=.5*i;return!DT(e.origin[0],this.origin[0],n)||!DT(e.origin[1],this.origin[1],n)?!1:(n=.5*i/2**r/this.pixelSize*WGe,DT(i,e.levels[r].resolution,n))}rootTilesInExtent(e,r=null,i=1/0){const n=new Array,s=this.levels[0].tileSize;if(e==null||s[0]===0||s[1]===0)return n;pl.computeRowColExtent(e,s,this.origin,Ap);let o=Ap[1],a=Ap[3],l=Ap[0],c=Ap[2];const u=c-l,d=a-o;if(u*d>i){const p=Math.floor(Math.sqrt(i));d>p&&(o=o+Math.floor(.5*d)-Math.floor(.5*p),a=o+p),u>p&&(l=l+Math.floor(.5*u)-Math.floor(.5*p),c=l+p)}for(let p=o;p!I6e(n.resolution,i/2**n.level))}static hasGapInLevels(e){const r=e.lods.map(i=>i.level);r.sort((i,n)=>i-n);for(let i=1;i=128&&r<=512}static hasOriginPerLODs(e){const r=e.origin;return e.lods.some(i=>i.origin!=null&&(i.origin[0]!==r.x||i.origin[1]!==r.y))}static getMissingTileInfoError(){return new Y("tilingscheme:tile-info-missing","Tiling scheme must have tiling information")}static checkUnsupported(e){return e==null?DZ():e.lods.length<1?new Y("tilingscheme:generic","Tiling scheme must have at least one level"):pl.isPowerOfTwo(e)?pl.hasGapInLevels(e)?new Y("tilingscheme:gaps","Tiling scheme levels must not have gaps between min and max level"):pl.tileSizeSupported(e)?pl.hasOriginPerLODs(e)?new Y("tilingscheme:multiple-origin","Tiling scheme levels must not have their own origin"):null:new Y("tilingscheme:tile-size","Tiles must be square and size must be one of [128, 256, 512]"):new Y("tilingscheme:power-of-two","Tiling scheme must be power of two")}static fromExtent(e,r){const i=e[2]-e[0],n=e[3]-e[1],s=el(r),o=1.2*Math.max(i,n),a=256,l=96,c=.0254,u=new pl(new SD({size:[a,a],origin:new ze({x:e[0]-.5*(o-i),y:e[3]+.5*(o-n)}),lods:[new kd({level:0,resolution:o/a,scale:1/(a/l*c/(o*s))})],spatialReference:r}));return u.ensureMaxLod(20),u}static makeWebMercatorAuxiliarySphere(e){const r=new pl(pl.WebMercatorAuxiliarySphereTileInfo);return r.ensureMaxLod(e),r}static makeGCSWithTileSize(e,r=256,i=16){const n=256/r,s=new pl(new SD({size:[r,r],origin:new ze({x:-180,y:90,spatialReference:e}),spatialReference:e,lods:[new kd({level:0,resolution:.703125*n,scale:295497598570834e-6*n})]}));return s.ensureMaxLod(i),s}get test(){return{isWebMercator:this._isWebMercator,isGCS:this._isGCS}}};function DZ(){return new Y("tilingscheme:tile-info-missing","Tiling scheme must have tiling information")}hc.WebMercatorAuxiliarySphereTileInfo=new SD({size:[256,256],origin:new ze({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:St.WebMercator}),spatialReference:St.WebMercator,lods:[new kd({level:0,resolution:156543.03392800014,scale:591657527591555e-6})]}),hc.WebMercatorAuxiliarySphere=hc.makeWebMercatorAuxiliarySphere(19);const Ap=jt(),aT=64,F3=512,qGe=2.5,yR=L6e(ZV/10),dwe=2,pwe=jt();hc.WebMercatorAuxiliarySphere.getExtent(0,0,0,pwe);const XGe=jt([-180,-90,180,90]),YGe="Cannot extend surface to encompass all layers because it would result in too many root tiles.",ZGe="Surface extent is too large for tile resolution at level 0.",QGe=3;let JGe=QGe;function JG(t){return t<4?3:JGe}let dy=class extends Bn.EventedAccessor{constructor(e){super(e),this.demResolution={min:-1,max:-1},this.noDataValue=yR}initialize(){this.view.basemapTerrain.on("elevation-change",()=>this.emit("changed",{}))}get extent(){const e=this.view.basemapTerrain;if(e==null||e.extent==null||e.spatialReference==null)return null;const r=d6(e.extent,e.spatialReference);return r.zmin=e.visibleElevationBounds.min,r.zmax=e.visibleElevationBounds.max,r}get spatialReference(){var e;return((e=this.view.basemapTerrain)==null?void 0:e.spatialReference)??St.WGS84}elevationAt(e,r){var i;if(this.extent==null||!Fa(this.extent,e,r)){const n=this.extent!=null?`${this.extent.xmin}, ${this.extent.ymin}, ${this.extent.xmax}, ${this.extent.ymax}`:null;return J.getLogger(this).warn("#elevationAt()",`Point used to sample elevation (${e}, ${r}) is outside of the sampler extent (${n})`),this.noDataValue}return((i=this.view.elevationProvider)==null?void 0:i.getElevation(e,r,0,this.spatialReference,"ground"))??this.noDataValue}queryElevation(e){return uwe(e.clone(),this)}};h([f({readOnly:!0})],dy.prototype,"demResolution",void 0),h([f({readOnly:!0})],dy.prototype,"extent",null),h([f({readOnly:!0})],dy.prototype,"noDataValue",void 0),h([f()],dy.prototype,"spatialReference",null),h([f({constructOnly:!0})],dy.prototype,"view",void 0),dy=h([N("esri.views.support.GroundViewElevationSampler")],dy);const KGe=dy;let py=class extends xe{constructor(e){super(e),this.view=null,this.layerViews=new ir}initialize(){this.addHandles(Dh(()=>{var e,r;return(r=(e=this.view)==null?void 0:e.map)==null?void 0:r.ground},e=>e.load())),this.addHandles(this.layerViews.on("after-changes",()=>this._layerViewsAfterChangesHandler()))}destroy(){this.removeAllHandles(),this._set("view",null);for(const e of this.layerViews)e.destroy();this.layerViews.length=0}get elevationSampler(){return this.view?this.view.type==="2d"?null:this.view.ready&&this.view.basemapTerrain&&this.view.basemapTerrain.ready?new KGe({view:this.view}):null:null}get updating(){return!this.suspended&&this.layerViews.some(e=>e.updating)}get suspended(){return!this.view||this.view.suspended}_layerViewsAfterChangesHandler(){this.removeHandles("updating"),this.addHandles(this.layerViews.map(e=>ue(()=>e.updating,()=>this._updateUpdating(),Br)).toArray(),"updating"),this._updateUpdating()}_updateUpdating(){this.notifyChange("updating")}};h([f({readOnly:!0})],py.prototype,"elevationSampler",null),h([f({type:Boolean,readOnly:!0})],py.prototype,"updating",null),h([f({constructOnly:!0})],py.prototype,"view",void 0),h([f({type:ir,readOnly:!0})],py.prototype,"layerViews",void 0),h([f({readOnly:!0})],py.prototype,"suspended",null),py=h([N("esri.views.GroundView")],py);const eje=py;let jg=class{constructor(e,r){this._owner=r,this._properties={},this._afterDispatchHandle=null;for(const i in e){const n=e[i],s=new Ege(n,void 0,void 0,2,2);this._properties[i]={pool:s,acquired:[]}}this._afterDispatchHandle=Fge(()=>this._release())}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const e in this._properties){const r=this._properties[e];for(const i of r.acquired)wte(i)||r.pool.release(i);r.pool.destroy(),r.pool=null,r.acquired=null}this._properties=null,this._owner=null}get(e){const r=this._owner._get(e),i=this._properties[e];let n=i.pool.acquire();for(i.acquired.push(n);n===r;)i.acquired.push(n),n=i.pool.acquire();return n}_release(){for(const e in this._properties){const r=this._properties[e];let i=0;for(const n of r.acquired)wte(n)?r.acquired[i++]=n:r.pool.release(n);r.acquired.length=i}}};const tje=se("mac")?"Meta":"Ctrl",Y6={8:"Backspace",9:"Tab",13:"Enter",27:"Escape",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete"};for(let t=48;t<58;t++)Y6[t]=String.fromCharCode(t);for(let t=1;t<25;t++)Y6[111+t]=`F${t}`;for(let t=65;t<91;t++)Y6[t]=[String.fromCharCode(t+32),String.fromCharCode(t)];function rje(t){if(t.key!==void 0)return YDe(t);const e=Y6[t.keyCode];return Array.isArray(e)?t.shiftKey?e[1]:e[0]:e}function ije(t){switch(t){case"Ctrl":case"Alt":case"Shift":case"Meta":case"Primary":return!0}return!1}let nje=class{constructor(e,r=[]){this.eventType=e,this.keyModifiers=r}matches(e){if(e.type!==this.eventType)return!1;if(this.keyModifiers.length===0)return!0;const r=e.modifiers;for(const i of this.keyModifiers)if(!r.has(i))return!1;return!0}};const Mie=J.getLogger("esri.views.input.InputHandler");let Eo=class{constructor(e){this._manager=null,this._incoming={},this._outgoing={},this._incomingEventMatches=null,this._incomingEventTypes=null,this._outgoingEventTypes=null,this._hasSideEffects=e}get incomingEventMatches(){if(!this._incomingEventMatches){this._incomingEventMatches=[];for(const e in this._incoming){const r=this._incoming[e];for(const i of r)this._incomingEventMatches.push(i.match)}}return this._incomingEventMatches}get incomingEventTypes(){return this._incomingEventTypes||(this._incomingEventTypes=this.incomingEventMatches.map(e=>e.eventType)),this._incomingEventTypes}get outgoingEventTypes(){return this._outgoingEventTypes||(this._outgoingEventTypes=Object.keys(this._outgoing)),this._outgoingEventTypes}get hasSideEffects(){return this._hasSideEffects}get hasPendingInputs(){return!1}onInstall(e){this._manager?Mie.error("This InputHandler has already been registered with an InputManager"):(e.setEventCallback(r=>this._handleEvent(r)),e.setUninstallCallback(()=>this._onUninstall()),this._manager=e)}onUninstall(){}registerIncoming(e,r,i){let n;typeof r=="function"?(i=r,n=[]):n=r||[];const s=typeof e=="string"?new nje(e,n):e,o=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},a=u=>{const d=this._incoming[u.match.eventType];if(d){const p=d.indexOf(u);d.splice(p,1),o(),this._manager&&this._manager.updateDependencies()}},l=new sje(s,i,{onPause:a,onRemove:a,onResume:u=>{const d=this._incoming[u.match.eventType];d&&!d.includes(u)&&(d.push(u),o(),this._manager&&this._manager.updateDependencies())}});let c=this._incoming[s.eventType];return c||(c=[],this._incoming[s.eventType]=c),c.push(l),o(),this._manager&&this._manager.updateDependencies(),l}registerOutgoing(e){if(this._outgoing[e])throw new Error("There is already a callback registered for this outgoing InputEvent: "+e);const r=new oje(e,{onEmit:(i,n,s,o)=>{var a;(a=this._manager)==null||a.emit(i.eventType,n,s,o)},onRemove:i=>{var n;delete this._outgoing[i.eventType],(n=this._manager)==null||n.updateDependencies()}});return this._outgoing[e]=r,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),r}startCapturingPointer(e){var r;(r=this._manager)==null||r.setPointerCapture(e,!0)}stopCapturingPointer(e){var r;(r=this._manager)==null||r.setPointerCapture(e,!1)}refreshHasPendingInputs(){var e;(e=this._manager)==null||e.refreshHasPendingInputs()}_onUninstall(){this._manager?(this.onUninstall(),this._manager=null):Mie.error("This InputHandler is not registered with an InputManager")}_handleEvent(e){var i;const r=this._incoming[e.type];if(r){for(const n of r)if(n.match.matches(e)&&((i=n.callback)==null||i.call(n,e),e.shouldStopPropagation()))break}}},sje=class{constructor(e,r,i){this.match=e,this._callback=r,this._handler=i}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}},oje=class{constructor(e,r){this.eventType=e,this._removed=!1,this._handler=r}emit(e,r,i){this._removed||this._handler.onEmit(this,e,r,i)}remove(){this._removed=!0,this._handler.onRemove(this)}},aje=class extends Eo{constructor(e){super(!0),this._onChange=e,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",r=>{this._update(r.data)})}_update(e){const r=e.native.pointerType==="touch"?"touch":"mouse",{x:i,y:n}=e;r===this._value&&this._x===i&&this._y===n||(this._value=r,this._x=i,this._y=n,this._onChange(r,i,n))}},lje=class{constructor(e,r){this._observable=new e6,this._value=e,this._equalityFunction=r}get value(){return Ht(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}};function _R(t,e=lge){return new lje(t,e)}let cje=class extends Eo{get multiTouchActive(){return this._multiTouchActive.value}constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=_R(!1),this._onPointerAdd=({data:e})=>{e.pointerType==="touch"&&(this._activeTouchPointerIds.add(e.native.pointerId),this._update())},this._onPointerRemove=({data:e})=>{e.pointerType==="touch"&&(this._activeTouchPointerIds.delete(e.native.pointerId),this._update())},this.registerIncoming("pointer-down",this._onPointerAdd),this.registerIncoming("pointer-up",this._onPointerRemove),this.registerIncoming("pointer-capture-lost",this._onPointerRemove),this.registerIncoming("pointer-cancel",this._onPointerRemove)}_update(){this._multiTouchActive.value=this._activeTouchPointerIds.size>1}},Hu=class extends xe{constructor(e){super(e),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=tje,this._latestPointerType="mouse",this._propertiesPool=new jg({latestPointerLocation:dje},this),this.latestPointerLocation=null,this._paused=!1,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const e=Object.keys(this._nameToGroup);for(const r of e)this.uninstallHandlers(r);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(e=>e.handler.hasPendingInputs)}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get updating(){return this.hasPendingInputs||this._paused}installHandlers(e,r,i=E_.INTERNAL){if(this._nameToGroup[e])return void J.getLogger(this).error("There is already an InputHandler group registered under the name `"+e+"`");if(r.length===0)return void J.getLogger(this).error("Can't register a group of zero handlers");const n={name:e,handlers:r.map(s=>({handler:s,active:!0,removed:!1,priorityIndex:0,groupPriority:i,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[e]=n;for(let s=n.handlers.length-1;s>=0;s--){const o=n.handlers[s];this._handlers.push(o),o.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(a,l,c,u,d)=>{this._emitInputEvent(o.priorityIndex+1,a,l,c,d,u)},setPointerCapture:(a,l)=>{this._setPointerCapture(n,o,a,l)},setEventCallback:a=>{o.eventCallback=a},setUninstallCallback:a=>{o.uninstallCallback=a},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(e){const r=this._nameToGroup[e];r?(r.handlers.forEach(i=>{var n;i.removed=!0,(n=i.uninstallCallback)==null||n.call(i)}),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):J.getLogger(this).error("There is no InputHandler group registered under the name `"+e+"`")}hasHandlers(e){return this._nameToGroup[e]!==void 0}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const e=new Set,r=new Set;this._handlersPriority=[];for(let i=this._handlers.length-1;i>=0;i--){const n=this._handlers[i];n.priorityIndex=i,this._handlersPriority.push(n)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let i=this._handlersPriority.length-1;i>=0;i--){const n=this._handlersPriority[i];n.priorityIndex=i;let s=n.handler.hasSideEffects;if(!s){for(const o of n.handler.outgoingEventTypes)if(e.has(o)){s=!0;break}}if(s)for(const o of n.handler.incomingEventMatches){e.add(o.eventType);for(const a of o.keyModifiers)ije(a)||r.add(a)}n.active=s}this._sourceEvents=e,this._keyModifiers=r,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(e,r,i){this._latestPointerType=e;const n=this._get("latestPointerLocation");if(n==null||n.x!==r||n.y!==i){const s=this._propertiesPool.get("latestPointerLocation");s.x=r,s.y=i,this._set("latestPointerLocation",s)}}_onEventReceived(e,r){if(e==="pointer-capture-lost"){const s=r;this._pointerCaptures.delete(s.native.pointerId)}this._updateKeyModifiers(e,r);const i=this.test.timestamp!=null?this.test.timestamp:r.native?r.native.timestamp:void 0,n=r.native?r.native.cancelable:void 0;this._emitInputEventFromSource(e,r,i,n)}_updateKeyModifiers(e,r){if(!r)return;let i=!1;const n=()=>{if(!i){const a=new Set;this._activeKeyModifiers.forEach(l=>{a.add(l)}),this._activeKeyModifiers=a,i=!0}},s=(a,l)=>{l&&!this._activeKeyModifiers.has(a)?(n(),this._activeKeyModifiers.add(a)):!l&&this._activeKeyModifiers.has(a)&&(n(),this._activeKeyModifiers.delete(a))};if(e==="key-down"||e==="key-up"){const a=r.key;this._keyModifiers.has(a)&&s(a,e==="key-down")}const o=r.native;s("Alt",!(!o||!o.altKey)),s("Ctrl",!(!o||!o.ctrlKey)),s("Shift",!(!o||!o.shiftKey)),s("Meta",!(!o||!o.metaKey)),s("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new aje((e,r,i)=>this._setLatestPointer(e,r,i)),this._multiTouchHandler=new cje,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],E_.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,E_.INTERNAL)}_setPointerCapture(e,r,i,n){const s=e.name+"-"+r.priorityIndex,o=this._pointerCaptures.get(i.pointerId)||new Set;this._pointerCaptures.set(i.pointerId,o),n?(o.add(s),o.size===1&&this.eventSource&&this.eventSource.setPointerCapture(i,!0)):o.has(s)&&(o.delete(s),o.size===0&&(this._pointerCaptures.delete(i.pointerId),this.eventSource&&this.eventSource.setPointerCapture(i,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(e=>!e.removed),this.updateDependencies()}_emitInputEventFromSource(e,r,i,n){this._emitInputEvent(0,e,r,i,n)}_emitInputEvent(e,r,i,n,s,o){const a=n!==void 0?n:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),l=s!==void 0&&s,c={event:new uje(r,i,a,o||this._activeKeyModifiers,l),priorityIndex:e};this._currentPropagation?this._currentPropagation.events.push(c):this._doNewPropagation(c)}_doNewPropagation(e){this._currentPropagation={events:new SG,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){var r,i;this._paused=!1;const e=this._currentPropagation;if(e){for(;e.events.length>0;){const{event:n,priorityIndex:s}=e.events.pop(),o=n.data&&n.data.eventId;if(!(o!=null&&this._stoppedPropagationEventIds.has(o)))for(e.currentHandler=this._handlersPriority[s];e.currentHandler;){if(e.currentHandler.removed)e.needsHandlerGarbageCollect=!0;else{if(e.currentHandler.active&&!n.shouldStopPropagation()&&((i=(r=e.currentHandler).eventCallback)==null||i.call(r,n)),n.shouldStopPropagation()){o!=null&&this._stoppedPropagationEventIds.add(o);break}if(n.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:n,priorityIndex:e.currentHandler.priorityIndex+1})}e.currentHandler=this._handlersPriority[e.currentHandler.priorityIndex+1]}}e.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(e){const r=new SG;r.push(e);const i=this._currentPropagation;if(i){for(;i.events.length;)r.push(i.events.pop());i.events=r,i.currentHandler=null,this._paused=!0}}_compareHandlerPriority(e,r){if(e.handler.hasSideEffects!==r.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==r.groupPriority)return e.groupPriority>r.groupPriority?-1:1;for(const i of e.handler.incomingEventMatches)for(const n of r.handler.incomingEventMatches){if(i.eventType!==n.eventType)continue;const s=i.keyModifiers.filter(o=>n.keyModifiers.includes(o));if(s.length===i.keyModifiers.length!=(s.length===n.keyModifiers.length))return i.keyModifiers.length>n.keyModifiers.length?-1:1}return e.priorityIndex>r.priorityIndex?-1:1}_sortHandlersPriority(e){const r=[];for(const i of e){let n=0;for(;n=0;)n++;r.splice(n,0,i)}return r}get debug(){const e=r=>{const i=this._setPointerCapture;this._setPointerCapture=()=>{},r(),this._setPointerCapture=i};return{injectEvent:(r,i)=>{e(()=>{this._onEventReceived(r,i)})},disablePointerCapture:e}}};h([f({readOnly:!0})],Hu.prototype,"hasPendingInputs",null),h([f({constructOnly:!0})],Hu.prototype,"eventSource",void 0),h([f({constructOnly:!0})],Hu.prototype,"recognizers",void 0),h([f()],Hu.prototype,"_latestPointerType",void 0),h([f()],Hu.prototype,"latestPointerType",null),h([f()],Hu.prototype,"multiTouchActive",null),h([f({readOnly:!0})],Hu.prototype,"latestPointerLocation",void 0),h([f()],Hu.prototype,"_paused",void 0),h([f({readOnly:!0})],Hu.prototype,"updating",null),Hu=h([N("esri.views.input.InputManager")],Hu);let uje=class{constructor(e,r,i,n,s){this.type=e,this.data=r,this.timestamp=i,this.modifiers=n,this.cancelable=s,this._propagationState=My.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=My.STOPPED}shouldStopPropagation(){return(this._propagationState&My.STOPPED)!=0}async(e){this._propagationState|=My.PAUSED;const r=(i,n)=>{this._propagationState&=~My.PAUSED;const s=this._resumeCallback;if(this._resumeCallback=null,s&&s(),n)throw i;return i};return(typeof e=="function"?e():e).then(i=>r(i,!1),i=>r(i,!0))}shouldPausePropagation(e){return!!(this._propagationState&My.PAUSED)&&(this._resumeCallback=e,!0)}preventDefault(){this.data.native.preventDefault()}};var My;(function(t){t[t.NONE=0]="NONE",t[t.STOPPED=1]="STOPPED",t[t.PAUSED=2]="PAUSED"})(My||(My={}));const E_={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};let hje=class{};const dje=hje;function Op(t){return t!=null&&"open"in t&&"declaredClass"in t}function $ie(t){return t!=null&&"declaredClass"in t&&"dockOptions"in t}const pje=t=>{let e=class extends t{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([ue(()=>[this.ui,this.popup],([r,i],n)=>{const s="popup",o="manual";if(n){const[a,l]=n;a&&Op(l)&&(l.view=null,$ie(l)&&a.remove(l,s))}r&&Op(i)&&(i.view=this,$ie(i)&&r.add(i,{key:s,position:o,internal:!0}))},Pr),this.on("click",r=>{this.popup&&this.popupEnabled&&(r.pointerType!=="mouse"||r.button===0)&&(!Op(this.popup)&&"autoOpenEnabled"in this.popup&&this.popup.autoOpenEnabled===!1||(Op(this.popup)?this.popup.viewModel.handleViewClick(r):r.async(async()=>{await this.setupPopup(),Op(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(r)})))},E_.WIDGET)]),uR(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>{ce(()=>import("./Popup-db207f4c.js").then(r=>r.a0),["assets/Popup-db207f4c.js","assets/unitFormatUtils-b70a7bff.js","assets/AttachmentInfo-cb670dd0.js","assets/AttachmentQuery-972bbd60.js","assets/widget-78e8b6fe.js","assets/jsonUtils-f73b3833.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/Query-1c961d4c.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/RelationshipQuery-39c07195.js","assets/TopFeaturesQuery-e44d05be.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/popupUtils-82ea8abb.js"])})}destroy(){this.destroyed||this.closePopup()}async openPopup(r){Op(this.popup)&&this.popup.open(r);try{if(await this.setupPopup(),!this.popup)return void J.getLogger(this).error(new Y("view:null-popup","Popup is null and can't be opened"));this.popup.open(r)}catch{}}closePopup(){var r;(r=this._popupSetupTask)==null||r.abort(),Op(this.popup)&&this.popup.close()}async fetchPopupFeatures(r,i){await this.when();const{location:n,queryArea:s,layerViewsAndGraphics:o,clientOnlyGraphics:a}=await this._prepareFetchPopupFeatures(r,i),l=Promise.resolve(a),c=this._queryLayerPopupFeatures(s,o,i),u=c.map(d=>d.promise);return{location:n,clientOnlyGraphics:a,allGraphicsPromise:e4([l,...u]).then(d=>Array.from(new Set(d.flat()))),promisesPerLayerView:c}}async setupPopup(){var r;if((r=this._popupSetupTask)==null||r.abort(),this.popup&&!Op(this.popup))return this._popupSetupTask=hE(async i=>{const{default:n}=await ce(()=>import("./Popup-db207f4c.js").then(o=>o.a0),["assets/Popup-db207f4c.js","assets/unitFormatUtils-b70a7bff.js","assets/AttachmentInfo-cb670dd0.js","assets/AttachmentQuery-972bbd60.js","assets/widget-78e8b6fe.js","assets/jsonUtils-f73b3833.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/Query-1c961d4c.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/RelationshipQuery-39c07195.js","assets/TopFeaturesQuery-e44d05be.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/popupUtils-82ea8abb.js"]);if(Bt(i),!this.popup||Op(this.popup))return;const s=this.popup;delete s.open,delete s.close,this.popup=new n(s)}),this._popupSetupTask.promise}_queryLayerPopupFeatures(r,i,n){return i.map(({layerView:s,graphics:o})=>{const a={clientGraphics:o,event:n!=null?n.event:void 0,signal:n!=null?n.signal:void 0,defaultPopupTemplateEnabled:n!=null&&!!n.defaultPopupTemplateEnabled},l=s.fetchPopupFeatures(r,a);return{layerView:s,promise:l}})}_isValidPopupGraphic(r,i){return r&&!!r.getEffectivePopupTemplate(i!=null&&i.defaultPopupTemplateEnabled)}async _prepareFetchPopupFeatures(r,i){const{clientGraphics:n,queryArea:s,location:o}=await this._popupHitTestGraphics(r,i),a=this._getFetchPopupLayerViews(),{layerViewsAndGraphics:l,clientOnlyGraphics:c}=this._graphicsPerFetchPopupLayerView(n,a);return{clientOnlyGraphics:c,layerViewsAndGraphics:l,queryArea:s,location:o}}async _popupHitTestGraphics(r,i){const n=await this.popupHitTest(r),s=n.results,o=n.mapPoint,a=s.filter(c=>c.type==="graphic"&&this._isValidPopupGraphic(c.graphic,i)),l=a.length?a[0].mapPoint:null;return{clientGraphics:a.map(c=>c.graphic),queryArea:o,location:o||l}}_getFetchPopupLayerViews(){const r=[];return this.allLayerViews.forEach(i=>{this._isValidPopupLayerView(i)&&r.push(i)}),this.graphicsView!=null&&this._isValidPopupLayerView(this.graphicsView)&&r.push(this.graphicsView),r.reverse()}_isValidPopupLayerView(r){return r!=null&&(!("layer"in r)||!r.suspended)&&"fetchPopupFeatures"in r}_graphicsPerFetchPopupLayerView(r,i){const n=[],s=new Map,o=i.map(a=>{const l=[];return"layer"in a?s.set(a.layer,l):s.set(a.graphics,l),{layerView:a,graphics:l}});for(const a of r){const l=s.get(a.layer)||s.get(a.sourceLayer)||null;l?l.push(a):n.push(a)}return{layerViewsAndGraphics:o,clientOnlyGraphics:n}}};return h([f({cast(r){return!r||Op(r)||typeof r=="object"&&(r.open=i=>(u4(J.getLogger(this),"view.popup is no longer created by default. view.popup.open() will stop working when the popup isn't created",{replacement:"Use view.openPopup() instead.",version:"4.27"}),this.openPopup(i)),r.close=()=>(u4(J.getLogger(this),"view.popup is no longer created by default. view.popup.close() will stop working when the popup isn't created",{replacement:"Use view.closePopup() instead.",version:"4.27"}),this.closePopup())),r}})],e.prototype,"popup",void 0),h([f()],e.prototype,"popupEnabled",void 0),e=h([N("esri.views.PopupView")],e),e},Iie={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},fje={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function mje(t,e){const r=new Date(t,e+1,1);return r.setDate(0),r.getDate()}function Ok(t,e,r){const i=new Date(t.getTime());if(e&&r){const n=fje[r],{getter:s,setter:o,multiplier:a}=n;if(r==="months"){const l=mje(i.getFullYear(),i.getMonth()+e);i.getDate()>l&&i.setDate(l)}i[o](i[s]()+e*a)}return i}function Lie(t,e){switch(e){case"milliseconds":return new Date(t.getTime());case"seconds":return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());case"minutes":return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes());case"hours":return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours());case"days":return new Date(t.getFullYear(),t.getMonth(),t.getDate());case"weeks":return new Date(t.getFullYear(),t.getMonth(),t.getDate()-t.getDay());case"months":return new Date(t.getFullYear(),t.getMonth(),1);case"years":return new Date(t.getFullYear(),0,1);case"decades":return new Date(t.getFullYear()-t.getFullYear()%10,0,1);case"centuries":return new Date(t.getFullYear()-t.getFullYear()%100,0,1);default:return new Date}}function VOt(t,e,r){return t===0?0:t*Iie[e]/Iie[r]}var md;let Wc=md=class extends ke{static get allTime(){return Die}static get empty(){return gje}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return e.end!=null?new Date(e.end):null}writeEnd(t,e){e.end=t?t.getTime():null}get isAllTime(){return this.equals(md.allTime)}get isEmpty(){return this.equals(md.empty)}readStart(t,e){return e.start!=null?new Date(e.start):null}writeStart(t,e){e.start=t?t.getTime():null}clone(){return new md({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=this.start!=null?this.start.getTime():this.start,r=this.end!=null?this.end.getTime():this.end,i=t.start!=null?t.start.getTime():t.start,n=t.end!=null?t.end.getTime():t.end;return e===i&&r===n}expandTo(t){if(this.isEmpty||this.isAllTime)return this.clone();const e=_h(this.start,i=>Lie(i,t)),r=_h(this.end,i=>{const n=Lie(i,t);return i.getTime()===n.getTime()?n:Ok(n,1,t)});return new md({start:e,end:r})}intersection(t){var a,l,c,u;if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return md.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=((a=this.start)==null?void 0:a.getTime())??-1/0,r=((l=this.end)==null?void 0:l.getTime())??1/0,i=((c=t.start)==null?void 0:c.getTime())??-1/0,n=((u=t.end)==null?void 0:u.getTime())??1/0;let s,o;if(i>=e&&i<=r?s=i:e>=i&&e<=n&&(s=e),r>=i&&r<=n?o=r:n>=e&&n<=r&&(o=n),s!=null&&o!=null&&!isNaN(s)&&!isNaN(o)){const d=new md;return d.start=s===-1/0?null:new Date(s),d.end=o===1/0?null:new Date(o),d}return md.empty}offset(t,e){if(this.isEmpty||this.isAllTime)return this.clone();const r=new md,{start:i,end:n}=this;return i!=null&&(r.start=Ok(i,t,e)),n!=null&&(r.end=Ok(n,t,e)),r}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return Die.clone();const e=this.start!=null&&t.start!=null?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,r=this.end!=null&&t.end!=null?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new md({start:e,end:r})}};h([f({type:Date,json:{write:{allowNull:!0}}})],Wc.prototype,"end",void 0),h([lr("end")],Wc.prototype,"readEnd",null),h([xr("end")],Wc.prototype,"writeEnd",null),h([f({readOnly:!0,json:{read:!1}})],Wc.prototype,"isAllTime",null),h([f({readOnly:!0,json:{read:!1}})],Wc.prototype,"isEmpty",null),h([f({type:Date,json:{write:{allowNull:!0}}})],Wc.prototype,"start",void 0),h([lr("start")],Wc.prototype,"readStart",null),h([xr("start")],Wc.prototype,"writeStart",null),Wc=md=h([N("esri.TimeExtent")],Wc);const Die=new Wc,gje=new Wc({start:void 0,end:void 0}),yje=Wc;let Mb=class extends ZA{_own(e){e.layer&&"remove"in e.layer&&e.layer!==this.owner&&e.layer.remove(e),e.layer=this.owner}_release(e){e.layer===this.owner&&(e.layer=null)}};h([n0e({Type:z_,ensureType:Qa(z_)})],Mb.prototype,"itemType",void 0),Mb=h([N("esri.support.GraphicsCollection")],Mb);const Nie=new Map([["AUS Central Standard Time","Australia/Darwin"],["AUS Eastern Standard Time","Australia/Sydney"],["Afghanistan Standard Time","Asia/Kabul"],["Alaskan Standard Time","America/Anchorage"],["Aleutian Standard Time","America/Adak"],["Altai Standard Time","Asia/Barnaul"],["Arab Standard Time","Asia/Riyadh"],["Arabian Standard Time","Asia/Dubai"],["Arabic Standard Time","Asia/Baghdad"],["Argentina Standard Time","America/Buenos_Aires"],["Astrakhan Standard Time","Europe/Astrakhan"],["Atlantic Standard Time","America/Halifax"],["Aus Central W. Standard Time","Australia/Eucla"],["Azerbaijan Standard Time","Asia/Baku"],["Azores Standard Time","Atlantic/Azores"],["Bahia Standard Time","America/Bahia"],["Bangladesh Standard Time","Asia/Dhaka"],["Belarus Standard Time","Europe/Minsk"],["Bougainville Standard Time","Pacific/Bougainville"],["Canada Central Standard Time","America/Regina"],["Cape Verde Standard Time","Atlantic/Cape_Verde"],["Caucasus Standard Time","Asia/Yerevan"],["Cen. Australia Standard Time","Australia/Adelaide"],["Central America Standard Time","America/Guatemala"],["Central Asia Standard Time","Asia/Almaty"],["Central Brazilian Standard Time","America/Cuiaba"],["Central Europe Standard Time","Europe/Budapest"],["Central European Standard Time","Europe/Warsaw"],["Central Pacific Standard Time","Pacific/Guadalcanal"],["Central Standard Time","America/Chicago"],["Central Standard Time (Mexico)","America/Mexico_City"],["Chatham Islands Standard Time","Pacific/Chatham"],["China Standard Time","Asia/Shanghai"],["Cuba Standard Time","America/Havana"],["Dateline Standard Time","Etc/GMT+12"],["E. Africa Standard Time","Africa/Nairobi"],["E. Australia Standard Time","Australia/Brisbane"],["E. Europe Standard Time","Europe/Chisinau"],["E. South America Standard Time","America/Sao_Paulo"],["Easter Island Standard Time","Pacific/Easter"],["Eastern Standard Time","America/New_York"],["Eastern Standard Time (Mexico)","America/Cancun"],["Egypt Standard Time","Africa/Cairo"],["Ekaterinburg Standard Time","Asia/Yekaterinburg"],["FLE Standard Time","Europe/Kiev"],["Fiji Standard Time","Pacific/Fiji"],["GMT Standard Time","Europe/London"],["GTB Standard Time","Europe/Bucharest"],["Georgian Standard Time","Asia/Tbilisi"],["Greenland Standard Time","America/Godthab"],["Greenwich Standard Time","Atlantic/Reykjavik"],["Haiti Standard Time","America/Port-au-Prince"],["Hawaiian Standard Time","Pacific/Honolulu"],["India Standard Time","Asia/Calcutta"],["Iran Standard Time","Asia/Tehran"],["Israel Standard Time","Asia/Jerusalem"],["Jordan Standard Time","Asia/Amman"],["Kaliningrad Standard Time","Europe/Kaliningrad"],["Korea Standard Time","Asia/Seoul"],["Libya Standard Time","Africa/Tripoli"],["Line Islands Standard Time","Pacific/Kiritimati"],["Lord Howe Standard Time","Australia/Lord_Howe"],["Magadan Standard Time","Asia/Magadan"],["Magallanes Standard Time","America/Punta_Arenas"],["Marquesas Standard Time","Pacific/Marquesas"],["Mauritius Standard Time","Indian/Mauritius"],["Middle East Standard Time","Asia/Beirut"],["Montevideo Standard Time","America/Montevideo"],["Morocco Standard Time","Africa/Casablanca"],["Mountain Standard Time","America/Denver"],["Mountain Standard Time (Mexico)","America/Mazatlan"],["Myanmar Standard Time","Asia/Rangoon"],["N. Central Asia Standard Time","Asia/Novosibirsk"],["Namibia Standard Time","Africa/Windhoek"],["Nepal Standard Time","Asia/Katmandu"],["New Zealand Standard Time","Pacific/Auckland"],["Newfoundland Standard Time","America/St_Johns"],["Norfolk Standard Time","Pacific/Norfolk"],["North Asia East Standard Time","Asia/Irkutsk"],["North Asia Standard Time","Asia/Krasnoyarsk"],["North Korea Standard Time","Asia/Pyongyang"],["Omsk Standard Time","Asia/Omsk"],["Pacific SA Standard Time","America/Santiago"],["Pacific Standard Time","America/Los_Angeles"],["Pacific Standard Time (Mexico)","America/Tijuana"],["Pakistan Standard Time","Asia/Karachi"],["Paraguay Standard Time","America/Asuncion"],["Qyzylorda Standard Time","Asia/Qyzylorda"],["Romance Standard Time","Europe/Paris"],["Russia Time Zone 10","Asia/Srednekolymsk"],["Russia Time Zone 11","Asia/Kamchatka"],["Russia Time Zone 3","Europe/Samara"],["Russian Standard Time","Europe/Moscow"],["SA Eastern Standard Time","America/Cayenne"],["SA Pacific Standard Time","America/Bogota"],["SA Western Standard Time","America/La_Paz"],["SE Asia Standard Time","Asia/Bangkok"],["Saint Pierre Standard Time","America/Miquelon"],["Sakhalin Standard Time","Asia/Sakhalin"],["Samoa Standard Time","Pacific/Apia"],["Sao Tome Standard Time","Africa/Sao_Tome"],["Saratov Standard Time","Europe/Saratov"],["Singapore Standard Time","Asia/Singapore"],["South Africa Standard Time","Africa/Johannesburg"],["South Sudan Standard Time","Africa/Juba"],["Sri Lanka Standard Time","Asia/Colombo"],["Sudan Standard Time","Africa/Khartoum"],["Syria Standard Time","Asia/Damascus"],["Taipei Standard Time","Asia/Taipei"],["Tasmania Standard Time","Australia/Hobart"],["Tocantins Standard Time","America/Araguaina"],["Tokyo Standard Time","Asia/Tokyo"],["Tomsk Standard Time","Asia/Tomsk"],["Tonga Standard Time","Pacific/Tongatapu"],["Transbaikal Standard Time","Asia/Chita"],["Turkey Standard Time","Europe/Istanbul"],["Turks And Caicos Standard Time","America/Grand_Turk"],["US Eastern Standard Time","America/Indianapolis"],["US Mountain Standard Time","America/Phoenix"],["UTC","Etc/GMT"],["UTC+01","Etc/GMT-1"],["UTC+02","Etc/GMT-2"],["UTC+03","Etc/GMT-3"],["UTC+04","Etc/GMT-4"],["UTC+05","Etc/GMT-5"],["UTC+06","Etc/GMT-6"],["UTC+07","Etc/GMT-7"],["UTC+08","Etc/GMT-8"],["UTC+09","Etc/GMT-9"],["UTC+10","Etc/GMT-10"],["UTC+11","Etc/GMT-11"],["UTC+12","Etc/GMT-12"],["UTC+13","Etc/GMT-13"],["UTC+14","Etc/GMT-14"],["UTC-01","Etc/GMT+1"],["UTC-02","Etc/GMT+2"],["UTC-03","Etc/GMT+3"],["UTC-04","Etc/GMT+4"],["UTC-05","Etc/GMT+5"],["UTC-06","Etc/GMT+6"],["UTC-07","Etc/GMT+7"],["UTC-08","Etc/GMT+8"],["UTC-09","Etc/GMT+9"],["UTC-10","Etc/GMT+10"],["UTC-11","Etc/GMT+11"],["UTC-12","Etc/GMT+12"],["Ulaanbaatar Standard Time","Asia/Ulaanbaatar"],["Venezuela Standard Time","America/Caracas"],["Vladivostok Standard Time","Asia/Vladivostok"],["Volgograd Standard Time","Europe/Volgograd"],["W. Australia Standard Time","Australia/Perth"],["W. Central Africa Standard Time","Africa/Lagos"],["W. Europe Standard Time","Europe/Berlin"],["W. Mongolia Standard Time","Asia/Hovd"],["West Asia Standard Time","Asia/Tashkent"],["West Bank Standard Time","Asia/Hebron"],["West Pacific Standard Time","Pacific/Port_Moresby"],["Yakutsk Standard Time","Asia/Yakutsk"],["Yukon Standard Time","America/Whitehorse"]]);function _je(t,e="system"){if(!t||!Nie.has(t.timeZone))return e;const r=Nie.get(t.timeZone);return bje(t.timeZone)||t.respectsDaylightSaving?r:vje(r)}function vje(t){const e=dr.local().setZone(t),r=Math.min(e.set({month:1,day:1}).offset,e.set({month:5}).offset);return r===0?"Etc/UTC":`Etc/GMT${Xa.instance(-r).formatOffset(0,"narrow")}`}function bje(t){return t.startsWith("UTC")}let fy=class extends Cu(ke){constructor(e){super(e),this.legacy=null,this.timeZone="system"}readLegacy(e,r){const{timeZone:i,respectsDaylightSaving:n}=r;return{timeZone:i,respectsDaylightSaving:n}}readTimeZone(e,r){return"timeZoneIANA"in r?r.timeZoneIANA:_je(r)}writeTimeZone(e,r){r.timeZoneIANA=e}equals(e){return e!=null&&this.timeZone!=null&&e.timeZone!=null&&this.timeZone===e.timeZone}};h([f()],fy.prototype,"legacy",void 0),h([lr("legacy",["timeZone"])],fy.prototype,"readLegacy",null),h([f({type:String,nonNullable:!0})],fy.prototype,"timeZone",void 0),h([lr("timeZone",["timeZone","timeZoneIANA","respectsDaylightSaving"])],fy.prototype,"readTimeZone",null),h([xr("timeZone")],fy.prototype,"writeTimeZone",null),fy=h([N("esri.time.TimeReference")],fy);const fwe=fy;let my=class extends xe{constructor(e){super(e),this.view=null,this.baseLayerViews=new ir,this.referenceLayerViews=new ir,this._loadingHandle=ue(()=>{var r,i;return(i=(r=this.view)==null?void 0:r.map)==null?void 0:i.basemap},r=>{r&&r.load().catch(()=>{})},Pr)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null);for(const e of this.baseLayerViews)e.destroy();this.baseLayerViews.length=0;for(const e of this.referenceLayerViews)e.destroy();this.referenceLayerViews.length=0}get suspended(){return!this.view||this.view.suspended}get updating(){var r,i;if(this.view&&this.view.suspended)return!1;const e=(i=(r=this.view)==null?void 0:r.map)==null?void 0:i.basemap;return!!e&&!!e.loaded&&(this.baseLayerViews.some(n=>n.updating)||this.referenceLayerViews.some(n=>n.updating))}};h([f({constructOnly:!0})],my.prototype,"view",void 0),h([f({readOnly:!0})],my.prototype,"baseLayerViews",void 0),h([f({readOnly:!0})],my.prototype,"referenceLayerViews",void 0),h([f({readOnly:!0})],my.prototype,"suspended",null),h([f({type:Boolean,readOnly:!0})],my.prototype,"updating",null),my=h([N("esri.views.BasemapView")],my);function wje(t){return"tryRecycleWith"in t}let xje=class{constructor(e,r,i){this.layer=e,this.view=r,this.layerViewImporter=i,this._controller=new AbortController,this._deferred=Wo(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,pa(this._controller.signal,()=>{const n=new Y("cancelled:layerview-create","layerview creation cancelled",{layer:e});this._deferred.reject(n)})}tryRecycle(e){if(!this.done||!this.layerView||!wje(this.layerView))return null;const r=this.layer.type,i=this._controller.signal;for(let n=0;n(Bt(this._controller.signal),s.emit("layerview-destroy",{view:l,layerView:a}),l.emit("layerview-destroy",{view:l,layerView:a}),s.emit("layerview-create",{view:l,layerView:a}),l.emit("layerview-create",{view:l,layerView:a}),a)),new Promise((c,u)=>pa(this._controller.signal,()=>u(wr())))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:e}=this;if(e){const{layer:r,view:i}=this;r.emit("layerview-destroy",{view:i,layerView:e}),i.emit("layerview-destroy",{layer:r,layerView:e})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null}async start(){var n,s,o;if(this._started)return;this._started=!0;const{_controller:{signal:e},layer:r,view:i}=this;this._map=i.map;try{let a,l;if(await r.load({signal:e}),"prefetchResources"in r&&await((n=r.prefetchResources)==null?void 0:n.call(r,{signal:e})),Sje(r))a=await r.createLayerView(i,{signal:e});else{if(!this.layerViewImporter.hasLayerViewModule(r))throw new Y("layer:view-not-supported","No layerview implementation was found");const d=await this.layerViewImporter.importLayerView(r);Bt(e),a="default"in d?new d.default({layer:r,view:i}):new d({layer:r,view:i})}const c=()=>{l=Pi(l),a.destroyed||a.destroy(),a.layer=null,a.parent=null,a.view=null,this.done=!0};l=pa(e,c),Bt(e);try{await a.when()}catch(d){throw c(),d}if(!((o=(s=this._map)==null?void 0:s.allLayers)==null?void 0:o.includes(r)))return c(),void this._deferred.reject(new Y("view:no-layerview-for-layer","The layer has been removed from the map",{layer:r}));this.layerView=a,r.emit("layerview-create",{view:i,layerView:a}),i.emit("layerview-create",{layer:r,layerView:a}),this.done=!0,this._deferred.resolve(a)}catch(a){r.emit("layerview-create-error",{view:i,error:a}),i.emit("layerview-create-error",{layer:r,error:a}),this.done=!0,this._deferred.reject(new Y("layerview:create-error","layerview creation failed",{layer:r,error:a}))}}},Wu=class extends xe{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new Df,this.supportsGround=!0,this._preloadLayerViewModules=()=>{var i;const r=(i=this.view.map)==null?void 0:i.allLayers;if(r)for(const n of r)this.layerViewImporter.hasLayerViewModule(n)&&this.layerViewImporter.importLayerView(n)},this._reschedule=()=>this.destroyed?Promise.reject():(this._workPromise==null&&(this._workPromise=Wo(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(pP(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{var l,c,u;if(this.destroyed)return;const r=this.view.map;if(this._map!==r&&(this.clear(),this._map=r),this._workPromise==null)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const i=new Set,n=[],s=this.view.ready,o=d=>{if(d!=null){for(const p of d)if(p){i.add(p);const m=this._layerLayerViewInfoMap.get(p);m&&s?m.start():m||this._recyclingInfoMap.has(p)||n.push(p),"layers"in p&&p.layers&&o(p.layers)}}};for(const d of this._rootCollectionNames)o(this.get(d));for(const[d,p]of this._layerLayerViewInfoMap)if(!i.has(d)){this._layerLayerViewInfoMap.delete(p.layer);const m=p.tryRecycle(n);m?(this.notifyChange("updating"),this._recyclingInfoMap.set(p.layer,p),m.then(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(p.layer),this._layerLayerViewInfoMap.set(p.layer,p),this._reschedule()}).catch(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(p.layer),p.destroy(),this._reschedule()})):p.destroy()}for(const[d,p]of this._recyclingInfoMap)i.has(d)||(this.notifyChange("updating"),this._recyclingInfoMap.delete(p.layer),p.destroy());for(const d of n)this._createLayerView(d);this._refreshCollections();const a=[(l=r==null?void 0:r.ground)==null?void 0:l.layers,(c=r==null?void 0:r.basemap)==null?void 0:c.baseLayers,(u=r==null?void 0:r.basemap)==null?void 0:u.referenceLayers,r==null?void 0:r.layers].filter(d=>!!d);i.forEach(d=>"layers"in d&&a.push(d.layers)),this.addHandles(a.map(d=>this._watchUpdatingTracking.addOnCollectionChange(()=>d,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.own([Ol(()=>{var e,r;return(r=(e=this.view)==null?void 0:e.map)==null?void 0:r.allLayers},"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),ue(()=>{const e=this.view,r=e==null?void 0:e.map;return[r==null?void 0:r.basemap,r==null?void 0:r.ground,r==null?void 0:r.layers,e==null?void 0:e.ready]},()=>this._reschedule(),An)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),JU(this._recyclingInfoMap),JU(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,this._workPromise!=null&&(this._workPromise.reject(wr()),this._workPromise=null)}get _layersToLayerViews(){const e=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&e.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return this._workPromise!=null||this._watchUpdatingTracking.updating||Do(this._layerLayerViewInfoMap,e=>!e.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let e=0;for(const r of this._layerLayerViewInfoMap.values())r.done||++e;return e}clear(){this.destroyed||(JU(this._layerLayerViewInfoMap),this._refreshCollections())}async whenLayerView(e){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(e)){if(this._recyclingInfoMap.has(e))return this._recyclingInfoMap.get(e).promise;throw new Y("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e})}return this._layerLayerViewInfoMap.get(e).promise}_refreshCollections(){for(const[e,r]of this._layersToLayerViews)this._populateLayerViewsOwners(this.get(e),this.get(r),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(e,r,i){if(!e||!r)return void(r&&r.removeAll());let n=0;for(const s of e){const o=this._layerLayerViewInfoMap.get(s);if(!o||!o.layerView)continue;const a=o.layerView;a.layer=s,a.parent=i,r.at(n)!==a&&r.splice(n,0,a),s.layers&&this._populateLayerViewsOwners(s.layers,a.layerViews,a),n+=1}n{}),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const r=new xje(e,this.view,this.layerViewImporter);r.promise.then(()=>this._refreshCollections(),i=>{i&&(Zn(i)||i.name==="cancelled:layerview-create")||J.getLogger(this).error(`Failed to create layerview for layer title:'${e.title??"no title"}', id:'${e.id??"no id"}' of type '${e.type}'.`,{layer:e,error:i}),this._refreshCollections()}),this._layerLayerViewInfoMap.set(e,r),this.view.ready&&r.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};h([f()],Wu.prototype,"_workPromise",void 0),h([f({readOnly:!0})],Wu.prototype,"_watchUpdatingTracking",void 0),h([f({readOnly:!0})],Wu.prototype,"_layersToLayerViews",null),h([f({readOnly:!0})],Wu.prototype,"_rootCollectionNames",null),h([f()],Wu.prototype,"layerViewImporter",void 0),h([f()],Wu.prototype,"supportsGround",void 0),h([f({readOnly:!0})],Wu.prototype,"updating",null),h([f({readOnly:!0})],Wu.prototype,"updatingRemaining",null),h([f({constructOnly:!0})],Wu.prototype,"view",void 0),Wu=h([N("esri.views.LayerViewManager")],Wu);const Tje=Wu;function Sje(t){return"createLayerView"in t&&t.createLayerView!=null}let zc=class extends xe{constructor(e){super(e),this.factor=1.5,this.offset=Lh(0,0),this.position=null,this.size=120,this.maskUrl=null,this.maskEnabled=!0,this.overlayUrl=null,this.overlayEnabled=!0,this.visible=!0}get version(){return this.commitProperty("factor"),this.commitProperty("offset"),this.commitProperty("position"),this.commitProperty("visible"),this.commitProperty("size"),this.commitProperty("maskUrl"),this.commitProperty("maskEnabled"),this.commitProperty("overlayUrl"),this.commitProperty("overlayEnabled"),(this._get("version")||0)+1}};h([f({type:Number})],zc.prototype,"factor",void 0),h([f({nonNullable:!0})],zc.prototype,"offset",void 0),h([f()],zc.prototype,"position",void 0),h([f({type:Number,range:{min:0}})],zc.prototype,"size",void 0),h([f()],zc.prototype,"maskUrl",void 0),h([f()],zc.prototype,"maskEnabled",void 0),h([f()],zc.prototype,"overlayUrl",void 0),h([f()],zc.prototype,"overlayEnabled",void 0),h([f({readOnly:!0})],zc.prototype,"version",null),h([f({type:Boolean})],zc.prototype,"visible",void 0),zc=h([N("esri.views.Magnifier")],zc);const mwe=zc;let Eje=class{constructor(){this._tasks=new Array,this._running=_R(!1)}get length(){return this._tasks.length}get running(){return this._running.value}destroy(){this.cancelAll()}runTask(e){for(;!e.done&&this._process(e);)e.madeProgress()}push(e,r,i){return this._running.value=!0,new Promise((n,s)=>this._tasks.push(new Fie(n,s,e,r,i)))}unshift(e,r,i){return this._running.value=!0,new Promise((n,s)=>this._tasks.unshift(new Fie(n,s,e,r,i)))}_process(e){var i;if(this._tasks.length===0)return!1;const r=this._tasks.shift();try{const n=ss(r.signal);if(n&&!r.abortCallback)r.reject(wr());else{const s=n?(i=r.abortCallback)==null?void 0:i.call(r,wr()):r.callback(e);Eu(s)?s.then(r.resolve,r.reject):r.resolve(s)}}catch(n){r.reject(n)}return this._running.value=this._tasks.length>0,!0}cancelAll(){const e=wr();for(const r of this._tasks)if(r.abortCallback){const i=r.abortCallback(e);r.resolve(i)}else r.reject(e);this._tasks.length=0,this._running.value=!1}},Fie=class{constructor(e,r,i,n=void 0,s=void 0){this.resolve=e,this.reject=r,this.callback=i,this.signal=n,this.abortCallback=s}},U3=class extends xe{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};h([f()],U3.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),h([f()],U3.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),U3=h([N("esri.views.support.DebugFlags")],U3);const Cje=new U3;var Cr;(function(t){t[t.ANIMATING=0]="ANIMATING",t[t.INTERACTING=1]="INTERACTING",t[t.IDLE=2]="IDLE"})(Cr||(Cr={}));function Aje(){return new Z4.Scheduler}var Ho,dt;(function(t){t[t.YIELD=1]="YIELD"})(Ho||(Ho={})),function(t){t.RESOURCE_CONTROLLER_IMMEDIATE="immediate",t.RESOURCE_CONTROLLER="schedule",t.SLIDE="slide",t.STREAM_DATA_LOADER="stream loader",t.ELEVATION_QUERY="elevation query",t.TERRAIN_SURFACE="terrain",t.SURFACE_GEOMETRY_UPDATES="surface geometry updates",t.LOD_RENDERER="LoD renderer",t.GRAPHICS_CORE="Graphics3D",t.I3S_CONTROLLER="I3S",t.POINT_CLOUD_LAYER="point cloud",t.FEATURE_TILE_FETCHER="feature fetcher",t.OVERLAY="overlay",t.STAGE="stage",t.GRAPHICS_DECONFLICTOR="graphics deconflictor",t.FILTER_VISIBILITY="Graphics3D filter visibility",t.SCALE_VISIBILITY="Graphics3D scale visibility",t.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",t.POINT_OF_INTEREST_FREQUENT="POI frequent",t.POINT_OF_INTEREST_INFREQUENT="POI infrequent",t.LABELER="labeler",t.FEATURE_QUERY_ENGINE="feature query",t.FEATURE_TILE_TREE="feature tile tree",t.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",t.ELEVATION_ALIGNMENT="elevation alignment",t.TEXT_TEXTURE_ATLAS="text texture atlas",t.TEXTURE_UNLOAD="texture unload",t.LINE_OF_SIGHT_TOOL="line of sight tool",t.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",t.ELEVATION_PROFILE="elevation profile",t.SNAPPING="snapping",t.SHADOW_ACCUMULATOR="shadow accumulator",t.CLOUDS_GENERATOR="clouds generator",t[t.NONE=0]="NONE",t[t.TEST_PRIO=1]="TEST_PRIO"}(dt||(dt={}));const gf=0,Uie=new Map([[dt.RESOURCE_CONTROLLER_IMMEDIATE,gf],[dt.RESOURCE_CONTROLLER,4],[dt.SLIDE,gf],[dt.STREAM_DATA_LOADER,gf],[dt.ELEVATION_QUERY,gf],[dt.TERRAIN_SURFACE,1],[dt.SURFACE_GEOMETRY_UPDATES,1],[dt.LOD_RENDERER,2],[dt.GRAPHICS_CORE,2],[dt.I3S_CONTROLLER,2],[dt.POINT_CLOUD_LAYER,2],[dt.FEATURE_TILE_FETCHER,2],[dt.OVERLAY,4],[dt.STAGE,4],[dt.GRAPHICS_DECONFLICTOR,4],[dt.FILTER_VISIBILITY,4],[dt.SCALE_VISIBILITY,4],[dt.FRUSTUM_VISIBILITY,4],[dt.CLOUDS_GENERATOR,4],[dt.POINT_OF_INTEREST_FREQUENT,6],[dt.POINT_OF_INTEREST_INFREQUENT,30],[dt.LABELER,8],[dt.FEATURE_QUERY_ENGINE,8],[dt.FEATURE_TILE_TREE,16],[dt.FEATURE_TILE_TREE_ACTIVE,gf],[dt.ELEVATION_ALIGNMENT,12],[dt.TEXT_TEXTURE_ATLAS,12],[dt.TEXTURE_UNLOAD,12],[dt.LINE_OF_SIGHT_TOOL,16],[dt.LINE_OF_SIGHT_TOOL_INTERACTIVE,gf],[dt.SNAPPING,gf],[dt.SHADOW_ACCUMULATOR,30]]);function kie(t){return Uie.has(t)?Uie.get(t):typeof t=="number"?t:1}const zie=6.5,Bie=1,Oje=30,Vie=1e3/30,Gie=100,jie=.9;var Z4,S1;(function(t){class e{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(s=>s.needsUpdate)}constructor(){this._updating=_R(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new dg("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new i,this._state=Cr.INTERACTING,this._tasks=new Nt,this._runQueue=new Nt,this._load=0,this._idleStateCallbacks=new Nt,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=ue(()=>Cje.SCHEDULER_LOG_SLOW_TASKS,o=>this._debug=o,Pr);for(const o of Object.keys(dt))this.performanceInfo.tasks.set(dt[o],new dg(dt[o]));const s=this;this._test={FRAME_SAFETY_BUDGET:zie,INTERACTING_BUDGET:Vie,IDLE_BUDGET:Gie,get availableBudget(){return s._budget.budget},usedBudget:0,getBudget:()=>s._budget,setBudget:o=>s._budget=o,updateTask:o=>this._updateTask(o),getState:o=>this._getState(o),getRuntime:o=>this._getRuntime(o),frameTaskTimes:this._frameTaskTimes,resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()}}destroy(){this._tasks.toArray().forEach(s=>s.remove()),this._tasks.clear(),Pi(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(s){this._updatingChanged(),s&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())}))}registerTask(s,o){const a=kie(s),l=new r(this,s,o,a);return this._tasks.push(l),this._updatingChanged(),this.performanceInfo.tasks.has(s)||this.performanceInfo.tasks.set(s,new dg(s)),l}registerIdleStateCallbacks(s,o){const a={idleBegin:s,idleEnd:o};this._idleStateCallbacks.push(a),this.state===Cr.IDLE&&this._idleUpdatesStartFired&&a.idleBegin();const l=this;return{remove:()=>this._removeIdleStateCallbacks(a),set idleBegin(c){l._idleUpdatesStartFired&&(a.idleEnd(),l._state===Cr.IDLE&&c()),a.idleBegin=c},set idleEnd(c){a.idleEnd=c}}}get load(){return this._load}set state(s){this._state!==s&&(this._state=s,this.state!==Cr.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(o=>o.idleEnd())))}get state(){return this._state}updateBudget(s){this._test.usedBudget=0,++this._frameNumber;let o=zie,a=s.frameDuration,l=Bie;switch(this.state){case Cr.IDLE:o=0,a=Math.max(Gie,s.frameDuration),l=Oje;break;case Cr.INTERACTING:a=Math.max(Vie,s.frameDuration);case Cr.ANIMATING:}return a=a-s.elapsedFrameTime-o,this.state!==Cr.IDLE&&as.idleBegin())),this._runIdle();break;case Cr.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test.usedBudget=this._budget.elapsed}stopFrame(){this._budget.reset(0,this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(s){this._idleUpdatesStartFired&&s.idleEnd(),this._idleStateCallbacks.removeUnordered(s)}removeTask(s){this._tasks.removeUnordered(s),this._runQueue.removeUnordered(s),this._updatingChanged()}_updateTask(s){this._tasks.forAll(o=>{o.name===s&&o.setPriority(s)})}_getState(s){if(this._runQueue.some(a=>a.name===s))return S1.SCHEDULED;let o=S1.IDLE;return this._tasks.forAll(a=>{a.name===s&&a.needsUpdate&&(a.schedulePriority<=1?o=S1.READY:o!==S1.READY&&(o=S1.WAITING))}),o}_getRuntime(s){let o=0;return this._tasks.forAll(a=>{a.name===s&&(o+=a.runtime)}),o}_resetRuntimes(){this._tasks.forAll(s=>s.runtime=0)}_getRunning(){const s=new Map;if(this._tasks.forAll(a=>{a.needsUpdate&&s.set(a.name,(s.get(a.name)||0)+1)}),s.size===0)return null;let o="";return s.forEach((a,l)=>{o+=a>1?` ${a}x ${l}`:` ${l}`}),o}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const s=this._tasks.reduce((o,a)=>a.needsUpdate?++o:o,0);this._load=this._load*jie+s*(1-jie)}_schedule(){for(this._runQueue.filterInPlace(s=>!!s.needsUpdate||(s.schedulePriority=s.basePriority,!1)),this._tasks.forAll(s=>{s.basePriority===gf&&s.needsUpdate&&!this._runQueue.includes(s)&&s.blockFrame!==this._frameNumber&&this._runQueue.unshift(s)});this._runQueue.length===0;){let s=!1,o=0;if(this._tasks.forAll(a=>{a.needsUpdate&&a.schedulePriority!==0&&a.basePriority!==gf&&a.blockFrame!==this._frameNumber&&(s=!0,o=Math.max(o,a.basePriority),a.schedulePriority===1?(a.schedulePriority=0,this._runQueue.push(a)):--a.schedulePriority)}),!s)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const s=this._budget.now();this._startFrameTaskTimes();do for(;this._runQueue.length>0;){const o=this._budget.now(),a=this._runQueue.pop();this._budget.resetProgress();try{a.task.runTask(this._budget)===Ho.YIELD&&(a.blockFrame=this._frameNumber)}catch(c){J.getLogger("esri.views.support.Scheduler").error(`Exception in task "${a.name}"`,c)}!this._budget.hasProgressed&&a.blockFrame!==this._frameNumber&&a.needsUpdate&&(a.name,dt.I3S_CONTROLLER,a.blockFrame=this._frameNumber),a.schedulePriority=a.basePriority;const l=this._budget.now()-o;if(a.runtime+=l,this._frameTaskTimes.set(a.priority,this._frameTaskTimes.get(a.priority)+l),this._debug&&l>2*this._budget.budget&&console.log("Task",a.name,"used",l,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-s)}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-s)}_startFrameTaskTimes(){for(const s of Object.keys(dt))this._frameTaskTimes.set(dt[s],0)}_recordFrameTaskTimes(s){this._frameTaskTimes.forEach((o,a)=>this.performanceInfo.tasks.get(a).record(o)),this.performanceInfo.total.record(s)}get test(){return this._test}}t.Scheduler=e;class r{get task(){return this._task.value}get updating(){return this._queue.running}constructor(s,o,a,l){this._scheduler=s,this.name=o,this._basePriority=l,this.blockFrame=0,this.runtime=0,this._queue=new Eje,this._handles=new Vi,this.schedulePriority=this._basePriority,this._task=_R(a??this._queue),this._handles.add(Dh(()=>this.task.running,c=>s.taskRunningChanged(c)))}remove(){this.processQueue(Wa),this._scheduler.removeTask(this),this.schedule=LS.schedule,this.reschedule=LS.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(s){this.name=s;const o=kie(s);this._basePriority!==gf&&this.schedulePriority===0||(this.schedulePriority=o),this._basePriority=o}get priority(){return this.name}set priority(s){this.setPriority(s)}get needsUpdate(){return this.updating||this.task.running}schedule(s,o,a){return this._queue.push(s,o,a)}reschedule(s,o,a){return this._queue.unshift(s,o,a)}processQueue(s){this._queue.runTask(s)}}class i{constructor(){this._begin=typeof performance<"u"?performance.now():0,this._budget=0,this._state=Cr.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(s){return!this.done&&(s()===!0&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(s){this._enabled=s}reset(s,o){this._begin=this.now(),this._budget=s,this._state=o,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return performance.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}t.Budget=i})(Z4||(Z4={})),function(t){t.SCHEDULED="s",t.READY="r",t.WAITING="w",t.IDLE="i"}(S1||(S1={}));const Wa=(()=>{const t=new Z4.Budget;return t.enabled=!1,t})();let Rje=class{remove(){}processQueue(){}schedule(e,r,i){try{if(ss(r)){const n=wr();return i?Promise.resolve(i(n)):Promise.reject(n)}return vV(e(Wa))}catch(n){return Promise.reject(n)}}reschedule(e,r,i){return this.schedule(e,r,i)}};const LS=new Rje;let lT=class extends xe{constructor(e,r){super({}),this._stage=e,this._textureRequests=new Map,this._frameTask=(r==null?void 0:r.registerTask(dt.TEXTURE_UNLOAD))??LS}normalizeCtorArgs(){return{}}destroy(){var e,r,i;super.destroy(),(e=this._frameTask)==null||e.remove(),(r=this._textureRequests)==null||r.forEach(n=>this._releaseTextureRequest(n)),(i=this._textureRequests)==null||i.clear()}get updating(){return this._frameTask.updating}fromData(e,r,i){var o,a;const n=this.makeUid(e);let s=this._textureRequests.get(n);if(!s){const l=new gwe(i);l.texture=r(),(o=this._stage)==null||o.add(l.texture),(a=this._stage)==null||a.loadImmediate(l.texture),this._textureRequests.set(n,l),s=l}return s.referenceCount++,{uid:n,texture:s.texture,release:()=>this._release(n)}}_release(e){const r=this._textureRequests.get(e);r?(r.referenceCount<1&&console.warn("TextureCollection: reference count is < 1 for "+e),r.referenceCount--,r.referenceCount<1&&this._frameTask.schedule(()=>this._releaseNow(e))):console.warn(`TextureCollection: texture doesn't exist: '${e}'`)}get test(){return{textureRequests:this._textureRequests}}_releaseNow(e){if(!this._textureRequests)return;const r=this._textureRequests.get(e);!r||r.referenceCount>0||(this._releaseTextureRequest(r),this._textureRequests.delete(e))}_releaseTextureRequest(e){var r;e.onRemove&&e.onRemove(),e.texture?(r=this._stage)==null||r.remove(e.texture):e.abortController&&(e.abortController.abort(),e.abortController=null)}makeUid(e,r=null){return r!=null?`${e}.${r}px`:e}};h([f()],lT.prototype,"_frameTask",void 0),h([f()],lT.prototype,"updating",null),lT=h([N("esri.views.3d.support.TextureCollection")],lT);let gwe=class{constructor(e){this.onRemove=e,this.referenceCount=0}};var Hie;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right"})(Hie||(Hie={}));const ywe=["click","double-click","immediate-click","immediate-double-click","hold","drag","key-down","key-up","pointer-down","pointer-move","pointer-up","pointer-drag","mouse-wheel","pointer-enter","pointer-leave","gamepad","focus","blur"],_we={};function vwe(t){return!!_we[t]}function Pje(t){for(const e of t)if(!vwe(e))return!1;return!0}ywe.forEach(t=>{_we[t]=!0});let Mje=class{constructor(e){this._handlers=new Map,this._counter=0,this._handlerCounts=new Map,this.view=e,this.inputManager=null}connect(e){e&&this.disconnect(),this.inputManager=e,this._handlers.forEach(({handler:r,priority:i},n)=>{var s;return(s=this.inputManager)==null?void 0:s.installHandlers(n,[r],i)})}disconnect(){this.inputManager&&this._handlers.forEach((e,r)=>{var i;return(i=this.inputManager)==null?void 0:i.uninstallHandlers(r)}),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(e,r,i,n){const s=Array.isArray(e)?e:e.split(",");if(!Pje(s))return s.some(vwe)&&console.error("Error: registering input events and other events on the view at the same time is not supported."),null;let o,a;Array.isArray(r)?a=r:(o=r,a=[]),typeof i=="function"?o=i:n=i,n=n??E_.DEFAULT;const l=this._createUniqueGroupName(),c=new $je(this.view,s,a,o);this._handlers.set(l,{handler:c,priority:n});for(const u of s){const d=this._handlerCounts.get(u)||0;this._handlerCounts.set(u,d+1)}return this.inputManager&&this.inputManager.installHandlers(l,[c],n),{remove:()=>this._removeHandler(l,s)}}hasHandler(e){return!!this._handlerCounts.get(e)}_removeHandler(e,r){if(this._handlers.has(e)){this._handlers.delete(e);for(const i of r){const n=this._handlerCounts.get(i);n===void 0?console.error("Trying to remove handler for event that has no handlers registered: ",i):n===1?this._handlerCounts.delete(i):this._handlerCounts.set(i,n-1)}}this.inputManager&&this.inputManager.uninstallHandlers(e)}_createUniqueGroupName(){return this._counter+=1,`viewEvents_${this._counter}`}},$je=class extends Eo{constructor(e,r,i,n){super(!0),this._latestDragStart=void 0,this.view=e;for(const s of r)switch(s){case"click":this.registerIncoming("click",i,o=>n(this._wrapClick(o)));break;case"double-click":this.registerIncoming("double-click",i,o=>n(this._wrapDoubleClick(o)));break;case"immediate-click":this.registerIncoming("immediate-click",i,o=>n(this._wrapImmediateClick(o)));break;case"immediate-double-click":this.registerIncoming("immediate-double-click",i,o=>n(this._wrapImmediateDoubleClick(o)));break;case"hold":this.registerIncoming("hold",i,o=>n(this._wrapHold(o)));break;case"drag":this.registerIncoming("drag",i,o=>{const a=this._wrapDrag(o);a&&n(a)});break;case"key-down":this.registerIncoming("key-down",i,o=>n(this._wrapKeyDown(o)));break;case"key-up":this.registerIncoming("key-up",i,o=>n(this._wrapKeyUp(o)));break;case"pointer-down":this.registerIncoming("pointer-down",i,o=>n(this._wrapPointer(o,"pointer-down")));break;case"pointer-move":this.registerIncoming("pointer-move",i,o=>n(this._wrapPointer(o,"pointer-move")));break;case"pointer-up":this.registerIncoming("pointer-up",i,o=>n(this._wrapPointer(o,"pointer-up")));break;case"pointer-drag":this.registerIncoming("pointer-drag",i,o=>n(this._wrapPointerDrag(o)));break;case"mouse-wheel":this.registerIncoming("mouse-wheel",i,o=>n(this._wrapMouseWheel(o)));break;case"pointer-enter":this.registerIncoming("pointer-enter",i,o=>n(this._wrapPointer(o,"pointer-enter")));break;case"pointer-leave":this.registerIncoming("pointer-leave",i,o=>n(this._wrapPointer(o,"pointer-leave")));break;case"gamepad":this.registerIncoming("gamepad",i,o=>{n(this._wrapGamepad(o))});break;case"focus":this.registerIncoming("focus",i,o=>{n(this._wrapFocus(o))});break;case"blur":this.registerIncoming("blur",i,o=>{n(this._wrapBlur(o))})}}_wrapFocus(e){return{type:"focus",timestamp:e.timestamp,native:e.data.native,cancelable:e.cancelable,stopPropagation:()=>e.stopPropagation(),async:r=>e.async(r),preventDefault:()=>e.preventDefault()}}_wrapBlur(e){return{type:"blur",timestamp:e.timestamp,native:e.data.native,cancelable:e.cancelable,stopPropagation:()=>e.stopPropagation(),async:r=>e.async(r),preventDefault:()=>e.preventDefault()}}_wrapClick(e){const{pointerType:r,button:i,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,{cancelable:c,timestamp:u}=e;return{type:"click",pointerType:r,button:i,buttons:n,x:s,y:o,native:a,timestamp:u,screenPoint:Lh(s,o),mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:c,stopPropagation:()=>e.stopPropagation(),async:d=>e.async(d),preventDefault:()=>e.preventDefault()}}_wrapDoubleClick(e){const{pointerType:r,button:i,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,{cancelable:c,timestamp:u}=e;return{type:"double-click",pointerType:r,button:i,buttons:n,x:s,y:o,native:a,timestamp:u,mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:c,stopPropagation:()=>e.stopPropagation(),async:d=>e.async(d),preventDefault:()=>e.preventDefault()}}_wrapImmediateClick(e){const{pointerType:r,button:i,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,c=a.pointerId,{cancelable:u,timestamp:d}=e;return{type:"immediate-click",pointerId:c,pointerType:r,button:i,buttons:n,x:s,y:o,native:a,timestamp:d,mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:u,stopPropagation:()=>e.stopPropagation(),async:p=>e.async(p),preventDefault:()=>e.preventDefault()}}_wrapImmediateDoubleClick(e){const{pointerType:r,button:i,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,c=a.pointerId,{cancelable:u,timestamp:d}=e;return{type:"immediate-double-click",pointerId:c,pointerType:r,button:i,buttons:n,x:s,y:o,native:a,timestamp:d,mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:u,stopPropagation:()=>e.stopPropagation(),async:p=>e.async(p),preventDefault:()=>e.preventDefault()}}_wrapHold(e){const{pointerType:r,button:i,buttons:n,x:s,y:o,native:a}=e.data,{cancelable:l,timestamp:c}=e;return{type:"hold",pointerType:r,button:i,buttons:n,x:s,y:o,native:a,timestamp:c,mapPoint:this._getMapPoint(s,o),cancelable:l,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}_getMapPoint(e,r){return this.view.toMap(Lh(e,r),{exclude:[]})}_wrapDrag(e){const r=e.data,{x:i,y:n}=r.center,{action:s,pointerType:o,button:a}=r;if(s==="start"&&(this._latestDragStart=r),!this._latestDragStart)return;const l=r.pointer.native,c=r.buttons,{cancelable:u,timestamp:d}=e,p={x:this._latestDragStart.center.x,y:this._latestDragStart.center.y};return s==="end"&&(this._latestDragStart=void 0),{type:"drag",action:s,x:i,y:n,origin:p,pointerType:o,button:a,buttons:c,radius:r.radius,angle:Ka(r.angle),native:l,timestamp:d,cancelable:u,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}_wrapKeyDown(e){const{key:r,repeat:i,native:n}=e.data,{cancelable:s,timestamp:o}=e;return{type:"key-down",key:r,repeat:i,native:n,timestamp:o,cancelable:s,stopPropagation:()=>e.stopPropagation(),async:a=>e.async(a),preventDefault:()=>e.preventDefault()}}_wrapKeyUp(e){const{key:r,native:i}=e.data,{cancelable:n,timestamp:s}=e;return{type:"key-up",key:r,native:i,timestamp:s,cancelable:n,stopPropagation:()=>e.stopPropagation(),async:o=>e.async(o),preventDefault:()=>e.preventDefault()}}_wrapPointer(e,r){const{x:i,y:n,button:s,buttons:o,native:a,eventId:l}=e.data,c=a.pointerId,u=a.pointerType,{cancelable:d,timestamp:p}=e;return{type:r,x:i,y:n,pointerId:c,pointerType:u,button:s,buttons:o,native:a,timestamp:p,eventId:l,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}_wrapPointerDrag(e){const{x:r,y:i,buttons:n,native:s,eventId:o}=e.data.currentEvent,{button:a}=e.data.startEvent,l=e.data.startEvent.native.pointerId,c=e.data.startEvent.native.pointerType,u=e.data.action,d={x:e.data.startEvent.x,y:e.data.startEvent.y},{cancelable:p,timestamp:m}=e;return{type:"pointer-drag",x:r,y:i,pointerId:l,pointerType:c,button:a,buttons:n,action:u,origin:d,native:s,timestamp:m,eventId:o,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:y=>e.async(y),preventDefault:()=>e.preventDefault()}}_wrapMouseWheel(e){const{cancelable:r,data:i,timestamp:n}=e,{x:s,y:o,deltaY:a,native:l}=i;return{type:"mouse-wheel",x:s,y:o,deltaY:a,native:l,timestamp:n,cancelable:r,stopPropagation:()=>e.stopPropagation(),async:c=>e.async(c),preventDefault:()=>e.preventDefault()}}_wrapGamepad(e){const{action:r,state:i,device:n}=e.data,{cancelable:s,timestamp:o}=e,{buttons:a,axes:l}=i;return{type:"gamepad",device:n,timestamp:o,action:r,buttons:a,axes:l,cancelable:s,stopPropagation:()=>e.stopPropagation(),async:c=>e.async(c),preventDefault:()=>e.preventDefault()}}};var vR,Wie,qie;(function(t){t[t.USER=0]="USER",t[t.MANAGER=1]="MANAGER"})(vR||(vR={})),function(t){t[t.None=0]="None",t[t.Unfocused=1]="Unfocused",t[t.Focused=2]="Focused",t[t.Unselected=4]="Unselected",t[t.Selected=8]="Selected",t[t.All=15]="All"}(Wie||(Wie={})),function(t){t[t.None=0]="None",t[t.Custom1=16]="Custom1",t[t.Custom2=32]="Custom2",t[t.Custom3=64]="Custom3",t[t.Custom4=128]="Custom4",t[t.Custom5=256]="Custom5",t[t.Custom6=512]="Custom6",t[t.Custom7=1024]="Custom7",t[t.Custom8=2048]="Custom8",t[t.Custom9=4096]="Custom9",t[t.Custom10=8192]="Custom10",t[t.Custom11=16384]="Custom11",t[t.Custom12=32768]="Custom12",t[t.All=65520]="All"}(qie||(qie={}));function Ije(t){return[t.on("before-add",e=>{const r=e.item;if(r==null||t.includes(r))return J.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void e.preventDefault();r.onAdd()}),t.on("after-remove",e=>{const r=e.item;r.active&&(r.view.activeTool=null),r.destroy()})]}function KG(t){return t.visible&&t.getEditableFlag!=null&&t.getEditableFlag(vR.USER)&&t.getEditableFlag(vR.MANAGER)}function rf(t){return Lh(t.x,t.y)}function iRt(t){return Xi(t.x,t.y)}function bwe(t,e){var i;const r=(i=t instanceof HTMLElement?t:t.surface)==null?void 0:i.getBoundingClientRect();return r?Lh(e.clientX-r.left,e.clientY-r.top):Lh(0,0)}function Xie(t,e){return e instanceof Event?bwe(t,e):rf(e)}function Yie(t){if(t instanceof Event)return!0;if(typeof t=="object"&&"type"in t)switch(t.type){case"click":case"double-click":case"pointer-down":case"pointer-drag":case"pointer-enter":case"pointer-leave":case"pointer-up":case"pointer-move":case"immediate-click":case"immediate-double-click":case"hold":case"drag":case"mouse-wheel":return!0;default:return!1}return!1}let Lje=class{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}hasFocusedManipulators(){return this._grabbedManipulators.size>0||this._draggedManipulators.size>0}handleInputEvent(e,r){const i=()=>e.stopPropagation();switch(e.type){case"pointer-move":Zie(e.pointerType)&&this._pointerLocations.set(e.pointerId,{x:e.x,y:e.y,pointerType:e.pointerType});break;case"drag":this._grabbedManipulators.size>0&&(this._stopDrag=!0),this._stopDrag&&(i(),e.action==="end"&&(this._stopDrag=!1));break;case"pointer-down":{if(!Qie(e))break;const n=rf(e),s=this._intersect(n,e.pointerType,r.forEachTool);if(s==null)break;const o=s.manipulator,a=s.tool;o==null||a==null||!o.interactive||o.grabbable&&o.grabbableForEvent(e)||!o.grabbing||o.dragging||this._ungrabManipulatorBeforeDragging(o,e,r),o!=null&&a!=null&&o.interactive&&o.grabbable&&o.grabbableForEvent(e)&&!o.grabbing&&(this._grabbedManipulators.set(e.pointerId,{manipulator:o,tool:a,start:n,pointerType:e.pointerType}),this._grabbedManipulators.size===1&&r.activeTool==null&&(this._revertToNullActiveTool=!0,r.setActiveTool(s.tool)),o.grabbing=!0,o.events.emit("grab-changed",{action:"start",pointerType:e.pointerType,screenPoint:n}),i());break}case"pointer-up":this._draggedManipulators.has(e.pointerId)||this._handlePointerEnd(e,r);break;case"pointer-drag":{if(!Qie(e))break;const n=this._grabbedManipulators.get(e.pointerId),s=_h(n,({manipulator:u})=>u),o=_h(n,({tool:u})=>u);if(s==null||o==null)break;const a=rf(e);a.x=ge(a.x,0,r.view.width),a.y=ge(a.y,0,r.view.height);const l=n.start,c=this._draggedManipulators.get(e.pointerId);switch(e.action){case"start":case"update":e.action!=="update"&&this._grabbedManipulators.size!==1||(s.dragging=!0,c?s.events.emit("drag",{action:"update",start:l,screenPoint:a}):s.events.emit("drag",{action:"start",start:l,screenPoint:a,pointerType:e.pointerType}),this._draggedManipulators.set(e.pointerId,{tool:o,manipulator:s,start:l}));break;case"end":s.dragging=!1,c&&s.events.emit("drag",{action:"end",start:l,screenPoint:a}),this._draggedManipulators.delete(e.pointerId),this._handlePointerEnd(e,r)}i();break}case"immediate-click":{const n=rf(e),s=this._intersect(n,e.pointerType,r.forEachTool);if(Dje(e)||r.forEachTool(c=>{if((s==null||s.tool!==c||c.automaticManipulatorSelection)&&c.manipulators){let u=!1;c.manipulators.forEach(({manipulator:d})=>{d.selected&&(d.selected=!1,u=!0)}),u&&c.onManipulatorSelectionChanged&&c.onManipulatorSelectionChanged()}}),s==null)break;const{manipulator:o,tool:a}=s;if(!o.interactive)break;o.selectable&&a.automaticManipulatorSelection&&(o.selected=!o.selected,a.onManipulatorSelectionChanged&&a.onManipulatorSelectionChanged());const l=e.native.shiftKey;o.events.emit("immediate-click",{screenPoint:n,button:e.button,pointerType:e.pointerType,shiftKey:l,stopPropagation:i});break}case"click":{const n=rf(e),s=this._intersect(n,e.pointerType,r.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=e.native.shiftKey;o.events.emit(e.type,{screenPoint:n,button:e.button,pointerType:e.pointerType,shiftKey:a}),i();break}case"double-click":{const n=rf(e),s=this._intersect(n,e.pointerType,r.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=e.native.shiftKey;o.events.emit("double-click",{screenPoint:n,button:e.button,pointerType:e.pointerType,shiftKey:a,stopPropagation:i});break}case"immediate-double-click":{const n=rf(e),s=this._intersect(n,e.pointerType,r.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=e.native.shiftKey;o.events.emit("immediate-double-click",{screenPoint:n,button:e.button,pointerType:e.pointerType,shiftKey:a,stopPropagation:i});break}}this._onFocusChange(r.forEachTool)}_ungrabManipulatorBeforeDragging(e,r,i){e.grabbing=!1,e.events.emit("grab-changed",{action:"end",pointerType:r.pointerType,screenPoint:rf(r)}),this._grabbedManipulators.forEach(({manipulator:n},s)=>{n===e&&this._grabbedManipulators.delete(s)}),this._afterManipulatorUngrab(i.setActiveTool)}_handlePointerEnd(e,r){const i=_h(this._grabbedManipulators.get(e.pointerId),({manipulator:n})=>n);i!=null&&i.grabbing&&(i.grabbing=!1,i.events.emit("grab-changed",{action:"end",pointerType:e.pointerType,screenPoint:rf(e)}),this._grabbedManipulators.delete(e.pointerId),this._afterManipulatorUngrab(r.setActiveTool))}_cursorFromMap(e){let r=null;return Do(e,({manipulator:i})=>!(i==null||!i.interactive)&&(i.grabbing&&i.grabCursor?(r=i.grabCursor,!0):!!i.cursor&&(r=i.cursor,!0))),r}_onFocusChange(e){this._updateCursor(),this._updateFocusedManipulatorTools(e)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=this._cursorFromMap(this._grabbedManipulators)||"grabbing":this._hoveredManipulators.size>0?this._cursor=this._cursorFromMap(this._hoveredManipulators)||"pointer":this._cursor=null}_updateFocusedManipulatorTools(e){const r=new Set,i=new Set;this._grabbedManipulators.forEach(({tool:n})=>{r.add(n)}),this._hoveredManipulators.forEach(({tool:n})=>{i.add(n)}),e(n=>{n.hasGrabbedManipulators=r.has(n),n.hasHoveredManipulators=i.has(n);const s=this._grabbedManipulators.values(),o=iDe(s,({tool:a})=>a===n);n.firstGrabbedManipulator=o!=null?o.manipulator:null})}clearPointers(e,{forEachTool:r,setActiveTool:i},n=!0,s){const o=(a,l)=>a===e&&(s==null||s===l);this._grabbedManipulators.forEach(({tool:a,manipulator:l,pointerType:c},u)=>{o(a,l)&&(this._grabbedManipulators.delete(u),l.grabbing=!1,l.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:c}))}),this._draggedManipulators.forEach(({tool:a,manipulator:l},c)=>{o(a,l)&&(this._draggedManipulators.delete(c),l.dragging=!1,l.events.emit("drag",{action:"cancel"}))}),n&&this._hoveredManipulators.forEach(({tool:a,manipulator:l},c)=>{o(a,l)&&(this._hoveredManipulators.delete(c),l.hovering=!1)}),this._afterManipulatorUngrab(i),this._onFocusChange(r)}_intersect(e,r,i){let n=null;return i(s=>{if(s.manipulators==null||!KG(s))return!1;const o=s.manipulators.intersect(e,r);return o!=null&&(n={tool:s,manipulator:o},!0)}),n}updateHoveredStateFromKnownPointers(e){this._pointerLocations.forEach((r,i)=>{this._updateHoveredStateForPointerAtScreenPosition(Lh(r.x,r.y),i,r.pointerType,e)})}handleHoverEvent(e,r){e.type!=="pointer-up"&&e.type!=="immediate-click"&&e.type!=="pointer-move"||!Zie(e.pointerType)||this._updateHoveredStateForPointerAtScreenPosition(rf(e),e.pointerId,e.pointerType,r)}_updateHoveredStateForPointerAtScreenPosition(e,r,i,n){let s=this._intersect(e,i,n);const o=_h(this._hoveredManipulators.get(r),({manipulator:a})=>a);s==null||s.manipulator.interactive||(s=null),s!=null&&o===s.manipulator||(o!=null&&(o.hovering=!1),s!=null?(s.manipulator.hovering=!0,this._hoveredManipulators.set(r,s)):this._hoveredManipulators.delete(r),this._onFocusChange(n))}_afterManipulatorUngrab(e){this._grabbedManipulators.size===0&&this._revertToNullActiveTool&&(e(null),this._revertToNullActiveTool=!1)}};function Zie(t){return t==="mouse"}function Qie(t){return t.pointerType!=="mouse"||t.button===0}function Dje(t){return!!t.native.shiftKey}const Jie="attached",Rk="tools",Nje=1e3;let gd=class extends pR{constructor(e){super(e),this._clock=hP,this._manipulatorState=new Lje,this.tools=new ir,this.cursor=null,this._interacting=!1,this._interactingTimeout=null,this._forEachTool=r=>{for(const i of this.tools.items)if(r(i))return}}initialize(){this.handles.add([this.view.on(ywe,e=>{this._handleInputEvent(e)},E_.TOOL),...Ije(this.tools),this.tools.on("before-add",({item:e})=>{this._updateToolEditableFlag(e)}),this.tools.on("before-remove",({item:e})=>{this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs),this._updateCursor()}),this.tools.on("change",()=>{this._refreshToolWatchers()})])}destroy(){this.detach(),this.handles.removeAll()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:e=>{this.activeTool=e},view:this.view}}set activeTool(e){if(e!=null&&!this.view.ready)return void J.getLogger(this).error("Cannot set active tool while view is not ready.");if(e===this.activeTool)return;const r=this.activeTool;this._set("activeTool",e),r!=null&&r.deactivate(),e!=null&&e.activate(),this._removeIncompleteTools(e);for(const i of this.tools){this._updateToolEditableFlag(i);const n=KG(i);this.activeTool!=null&&n||this._manipulatorState.clearPointers(i,this._manipulatorStateEventArgs,!n)}this._updateCursor()}get updating(){var e;return this.updatingHandles.updating||this.tools.some(r=>r.updating)||(((e=this.textures)==null?void 0:e.updating)??!1)}get interacting(){return this._interacting}_clearInteractingTimeout(){this._interactingTimeout=Pi(this._interactingTimeout)}_startInteractingTimeout(){this._clearInteractingTimeout(),this._interactingTimeout=this._clock.setTimeout(()=>this._interacting=!1,Nje)}attach(){var e;this.view.type==="3d"?(this._set("textures",new lT(this.view._stage,this.view.resourceController.scheduler)),this.handles.add([ue(()=>{const{state:r}=this.view;return"camera"in r&&r.camera},()=>this._forEachManipulator(r=>r.onViewChange())),(e=this.view.elevationProvider)==null?void 0:e.on("elevation-change",r=>this._forEachManipulator(i=>i.onElevationChange(r))),Za(()=>this._set("textures",Me(this.textures)))],Jie)):this.handles.add(ue(()=>this.view.extent,()=>this._forEachManipulator(r=>r.onViewChange())))}detach(){this.activeTool=null,this.tools.removeAll(),this.handles.remove(Jie),this._clearInteractingTimeout(),this._interacting=!1}_forEachManipulator(e){this._forEachTool(r=>{r.manipulators&&r.manipulators.forEach(({manipulator:i})=>e(i,r))})}_handleInputEvent(e){let r=!1;const i={...e,stopPropagation:()=>{r=!0,e.stopPropagation()}};this.activeTool!=null?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(i):this._forEachTool(n=>{!r&&n.visible&&n.handleInputEvent(i)}),!r&&e.type==="key-down"&&e.key==="Escape"&&this.activeTool&&(e.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(i,this._manipulatorStateEventArgs),r||this.activeTool==null||this.activeTool.handleInputEventAfter(i),this._manipulatorState.handleHoverEvent(i,this._forEachTool),this._updateCursor(),e.type==="pointer-move"&&(this._manipulatorState.hasFocusedManipulators()||this.activeTool)&&(this._interacting=!0,this._startInteractingTimeout())}_refreshToolWatchers(){this.handles.remove(Rk),this._forEachTool(e=>{if(e instanceof xe){const r=ue(()=>[e.cursor,e.visible,e.editable],()=>{KG(e)||this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs),this._updateCursor()});this.handles.add(r,Rk)}e.manipulators&&this.handles.add([e.manipulators.on("after-remove",r=>{this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs,!0,r.item.manipulator)}),e.manipulators.on("change",()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})],Rk)}),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(e){var r;(r=e.setEditableFlag)==null||r.call(e,vR.MANAGER,this.activeTool==null||e===this.activeTool)}_updateCursor(){let e=this._manipulatorState.cursor;e==null&&this._forEachTool(r=>!(r.cursor==null||!r.visible)&&(e=r.cursor,!0)),this._get("cursor")!==e&&this._set("cursor",e)}_removeIncompleteTools(e){this.tools.filter(r=>(e==null||r!==e)&&!r.created&&r.removeIncompleteOnCancel).forEach(r=>{this.tools.remove(r)})}get test(){return{setClock:e=>this._clock=e}}};h([f({constructOnly:!0,nonNullable:!0})],gd.prototype,"view",void 0),h([f({readOnly:!0,nonNullable:!0})],gd.prototype,"textures",void 0),h([f({value:null})],gd.prototype,"activeTool",null),h([f({readOnly:!0,type:ir})],gd.prototype,"tools",void 0),h([f({readOnly:!0})],gd.prototype,"cursor",void 0),h([f({readOnly:!0})],gd.prototype,"updating",null),h([f()],gd.prototype,"_interacting",void 0),h([f({readOnly:!0})],gd.prototype,"interacting",null),gd=h([N("esri.views.ToolViewManager")],gd);let _2=class extends xe{constructor(e){super(),this.nativeIndex=null,this._detectedDeviceType="unknown",e.mapping==="standard"?this._detectedDeviceType="standard":Fje.test(e.id)?this._detectedDeviceType="spacemouse":this._detectedDeviceType="unknown",this.nativeIndex=e.index}get native(){const e=navigator.getGamepads?navigator.getGamepads():[];return this.nativeIndex!=null&&this.nativeIndexPromise.resolve().then(()=>wft),void 0).then(e=>ej=e)),await Mk,Bt(t)}async function $we(t,e,r,i){if(!t)return null;const n=t.spatialReference;return D6()||Bg(n,e)?xE(t,e):ej?ej.projectGeometry(t,e,r,i):(await Promise.race([Xje(i),fR(i)]),$we(t,e,r,i))}let Di=class extends xe{constructor(e){super(e),this.required={tileInfo:!1,heightModelInfo:!1,extent:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.suspended=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=yu(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return this.userSpatialReference!=null?this.userSpatialReference:this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get vcsWkid(){return this._heightModelInfoTask.vcsWkid}get latestVcsWkid(){return this._heightModelInfoTask.latestVcsWkid}get viewingMode(){return this.userSpatialReference==null||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){var i,n,s,o;const e=(i=this.map)==null?void 0:i.call(this),r=[];return this.priorityCollection!=null&&r.push(this.priorityCollection),r.push({parent:e==null?void 0:e.basemap,layers:(n=e==null?void 0:e.basemap)==null?void 0:n.baseLayers},{layers:e==null?void 0:e.layers},{parent:e==null?void 0:e.ground,layers:(s=e==null?void 0:e.ground)==null?void 0:s.layers},{parent:e==null?void 0:e.basemap,layers:(o=e==null?void 0:e.basemap)==null?void 0:o.referenceLayers}),r}get _allLayers(){return this._collectLayers(this.mapCollections)}get _spatialReferenceTask(){if(this.suspended)return this._get("_spatialReferenceTask")??{updating:!1};const{layers:e,updating:r}=this._allLayers;let i=null;for(const s of e){const o=this._getSupportedSpatialReferences(s);if(o.length>0){const a=this._narrowDownSpatialReferenceCandidates(i,o);a!=null&&(i=a)}if(i!=null&&i.length===1)break}if(r&&(i==null||i.length!==1))return{updating:!0};const n=this._pickSpatialReferenceCandidate(i);return{spatialReference:n!=null?n.spatialReference:null,viewingMode:n!=null?n.viewingMode:null,updating:!1}}get _tileInfoTask(){var i,n,s,o,a,l,c;if(!this.required.tileInfo)return this._get("_tileInfoTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const{layers:e,updating:r}=this._collectLayers([{parent:(n=(i=this.map)==null?void 0:i.call(this))==null?void 0:n.basemap,layers:(a=(o=(s=this.map)==null?void 0:s.call(this))==null?void 0:o.basemap)==null?void 0:a.baseLayers},{layers:(c=(l=this.map)==null?void 0:l.call(this))==null?void 0:c.layers}]);if(e&&e.length>0&&"tileInfo"in e[0]){const u=e[0].tileInfo;return{tileInfo:u&&u.spatialReference.equals(this.spatialReference)?u:null,updating:!1}}return{updating:r}}get _heightModelInfoTask(){var i,n,s;if(!this.required.heightModelInfo||this.suspended&&((i=this._get("_heightModelInfoTask"))!=null&&i.heightModelInfo))return this._get("_heightModelInfoTask")??{updating:!1};const{layers:e,updating:r}=this._allLayers;for(const o of e)if(Wje(o)){const a=Awe(o);if(a)return{heightModelInfo:a,vcsWkid:(n=o.spatialReference)==null?void 0:n.vcsWkid,latestVcsWkid:(s=o.spatialReference)==null?void 0:s.latestVcsWkid,updating:!1}}return{updating:r}}get _extentCandidatesTask(){if(this.suspended||!this.required.extent)return this._get("_extentCandidatesTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const e=this._allLayers,r=e.updating,i=[];for(const n of e.layers){const s="fullExtents"in n&&n.fullExtents||(n.fullExtent!=null?[n.fullExtent]:[]),o=this.requiresExtentInSpatialReference?null:s[0],a=s.find(l=>l.spatialReference.equals(this.spatialReference))??o;if(a)return{candidates:[{extent:a,layer:n}],updating:!1};if(this._getSupportedSpatialReferences(n).length>0)for(const l of s)i.push({extent:l,layer:n})}return{candidates:i,updating:r}}get _extentTask(){const{candidates:e,updating:r}=this._extentCandidatesTask;if(r)return{updating:r};if(e==null||e.length===0)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const i=this._pickExtentCandidate(e),n=this.spatialReference;return i.extent.equals(this._projectExtentTask.input)&&n.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:this._projectExtentTask.task!=null&&!this._projectExtentTask.task.finished}:(this._projectExtentTask.task!=null&&(this._projectExtentTask.task=yu(this._projectExtentTask.task)),this._projectExtentTask={input:i.extent.clone(),output:null,spatialReference:n.clone(),task:hE(async s=>{try{const o=await $we(i.extent,n,"portalItem"in i.layer?i.layer.portalItem:void 0,s);this._projectExtentTask={...this._projectExtentTask,task:null,output:o}}catch{if(ss(s))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(e,r){if(e==null)return r;const i=[],n=(s,o)=>s!=null?o!=null?s===o&&s:s:o;for(const s of e)for(const o of r){if(!s.spatialReference.equals(o.spatialReference))continue;const a=n(s.viewingMode,o.viewingMode);if(a!==!1){i.push({spatialReference:s.spatialReference,viewingMode:a});break}}return i.length>0?i:null}_pickSpatialReferenceCandidate(e){const r=this.defaultSpatialReference;return e==null||e.length<1?r!=null?{spatialReference:r,viewingMode:null}:null:(r!=null&&e.length>1&&e.some(({spatialReference:i})=>i.equals(r))&&(e=e.filter(({spatialReference:i})=>i.equals(r))),e.length>1&&e.some(({viewingMode:i})=>i!==$e.Local)&&(e=e.filter(({viewingMode:i})=>i!==$e.Local)),e[0])}_getSupportedSpatialReferences(e){const r="supportedSpatialReferences"in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(r.length===0)return[];const i=[];for(const n of r){const s=this.getSpatialReferenceSupport({spatialReference:n,layer:e});if(s!=null){const o=s.constraints!=null?s.constraints:[{spatialReference:n,viewingMode:null}];for(const{spatialReference:a,viewingMode:l}of o)this.requiresExtentInSpatialReference&&this.userSpatialReference!=null&&!a.equals(this.userSpatialReference)||i.push({spatialReference:a,viewingMode:l})}}return i}_pickExtentCandidate(e){const r=this.spatialReference;return e.find(({extent:i})=>r.equals(i.spatialReference))||e[0]}_collectLayers(e){var i;if(this._loadMaybe((i=this.map)==null?void 0:i.call(this))!=="loaded")return{layers:[],updating:!0};const r=new Yje;for(const n of e)if(this._collectCollection(n,r),r.preloading===this.sourcePreloadCount)break;return{layers:r.layers,updating:r.updating}}_collectCollection(e,r){if(e.layers){switch(this._loadMaybe(e.parent)){case"loading":return r.updating=!0,void++r.preloading;case"failed":return}for(const i of e.layers){switch(this._loadMaybe(i)){case"failed":continue;case"loading":r.updating=!0,++r.preloading;break;case"loaded":r.updating||r.layers.push(i),"layers"in i&&this._collectCollection({layers:i.layers},r)}if(r.preloading===this.sourcePreloadCount)break}}}_loadMaybe(e){return e&&"loadStatus"in e&&e.loadStatus!=null?e.loadStatus==="not-loaded"?(e.load().catch(r=>{Zn(r)||console.log(r)}),"loading"):e.loadStatus:"loaded"}};h([f()],Di.prototype,"required",void 0),h([f({constructOnly:!0})],Di.prototype,"map",void 0),h([f({constructOnly:!0})],Di.prototype,"getSpatialReferenceSupport",void 0),h([f()],Di.prototype,"defaultSpatialReference",void 0),h([f()],Di.prototype,"userSpatialReference",void 0),h([f()],Di.prototype,"sourcePreloadCount",void 0),h([f()],Di.prototype,"priorityCollection",void 0),h([f()],Di.prototype,"requiresExtentInSpatialReference",void 0),h([f()],Di.prototype,"suspended",void 0),h([f({readOnly:!0})],Di.prototype,"ready",null),h([f({readOnly:!0})],Di.prototype,"heightModelInfoReady",null),h([f({readOnly:!0})],Di.prototype,"spatialReference",null),h([f({readOnly:!0})],Di.prototype,"extent",null),h([f({readOnly:!0})],Di.prototype,"heightModelInfo",null),h([f({readOnly:!0})],Di.prototype,"vcsWkid",null),h([f({readOnly:!0})],Di.prototype,"latestVcsWkid",null),h([f({readOnly:!0})],Di.prototype,"viewingMode",null),h([f({readOnly:!0})],Di.prototype,"tileInfo",null),h([f({readOnly:!0})],Di.prototype,"mapCollections",null),h([f({readOnly:!0})],Di.prototype,"_allLayers",null),h([f({readOnly:!0})],Di.prototype,"_spatialReferenceTask",null),h([f({readOnly:!0})],Di.prototype,"_tileInfoTask",null),h([f({readOnly:!0})],Di.prototype,"_heightModelInfoTask",null),h([f({readOnly:!0})],Di.prototype,"_extentCandidatesTask",null),h([f()],Di.prototype,"_extentTask",null),h([f()],Di.prototype,"_projectExtentTask",void 0),Di=h([N("esri.views.support.DefaultsFromMap")],Di);let Yje=class{constructor(){this.layers=new Array,this.preloading=-1,this.updating=!1}};var z3;let Rt=z3=class extends P6(Bn.EventedMixin(t6(xe))){constructor(t){super(t),this._userSpatialReference=null,this._cursor=null,this.allLayerViews=new sR({getCollections:()=>{var e,r,i;return[(e=this.basemapView)==null?void 0:e.baseLayerViews,(r=this.groundView)==null?void 0:r.layerViews,this.layerViews,(i=this.basemapView)==null?void 0:i.referenceLayerViews]},getChildrenFunction:Qje}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new Mb,this.analyses=new $S,this.typeSpecificPreconditionsReady=!0,this.layerViews=new ir,this.magnifier=new mwe,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.timeReference=new fwe,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new zje,this.navigation=new xwe,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new Mje(this),this.persistableViewModels=new ir,this._isValid=!1,this._readyCycleForced=!1,this._currentSpatialReference=null,this.handles.add(ue(()=>this.preconditionsReady,e=>{var r,i;e?(this._currentSpatialReference=this.spatialReference,z3.views.add(this)):(this._currentSpatialReference=null,z3.views.remove(this)),this.notifyChange("spatialReference"),!e&&this.ready?((r=this.toolViewManager)==null||r.detach(),this.analysisViewManager!=null&&this.analysisViewManager.detach(),(i=this.layerViewManager)==null||i.clear(),this._teardown()):e&&!this.ready&&(this._startup(),this.analysisViewManager!=null&&this.analysisViewManager.attach(),this.toolViewManager.attach())},Br))}initialize(){this.addResolvingPromise(this.validate().then(()=>(this._isValid=!0,uR(()=>this.ready)))),this.basemapView=new my({view:this}),this.layerViewManager=new Tje({view:this,layerViewImporter:{importLayerView:t=>this.importLayerView(t),hasLayerViewModule:t=>this.hasLayerViewModule(t)},supportsGround:this.supportsGround}),this.toolViewManager=new gd({view:this}),this._setupSpatialReferenceLogger(),this.handles.add([ue(()=>this.initialExtentRequired,t=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:t},{sync:!0,initial:!0}),ue(()=>this.ready,t=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=t,this.defaultsFromMap.userSpatialReference=t?this.spatialReference:this._userSpatialReference)},{sync:!0}),ue(()=>this._userSpatialReference,t=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=t)},{sync:!0,initial:!0})])}_setupSpatialReferenceLogger(){let t=null;this.handles.add([ue(()=>{var e;return(e=this.defaultsFromMap)==null?void 0:e.ready},e=>{var i;const r=((i=this.map)==null?void 0:i.allLayers.length)>0;if(e&&!this.spatialReference&&r){if(t!=null)return;const n=Za(()=>t=yu(t));t=hE(async s=>{try{await XO(this.spatialReferenceWarningDelay,null,s)}catch{return}finally{t=null}J.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),this.handles.add(n,"spatial-reference-logger-task")}else this.handles.remove("spatial-reference-logger-task")},{sync:!0})])}destroy(){var t,e;this.destroyed||(z3.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=Me(this.graphics),this.analyses=Me(this.analyses),this.handles.remove("defaultsFromMap"),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),Me(this.analysisViewManager),this.toolViewManager=Me(this.toolViewManager),this.layerViewManager=Me(this.layerViewManager),this.basemapView=Me(this.basemapView),(t=this.groundView)==null||t.destroy(),(e=this.layerViews)==null||e.forEach(r=>r.destroy()),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.removeAll(),this.map=Me(this.map))}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return J.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){var t;return(t=this.toolViewManager)==null?void 0:t.activeTool}set activeTool(t){this.toolViewManager&&(this.toolViewManager.activeTool=t)}get animation(){return this._get("animation")}set animation(t){this._set("animation",t)}get center(){return null}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new Di({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:t=>this.getSpatialReferenceSupport(t),...this._defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(t){this._set("extent",t)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){var t;return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||Dg.isLoadable(this.map)&&!this.map.loaded||this.width===0||this.height===0||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._currentSpatialReference&&!((t=this.defaultsFromMap)!=null&&t.ready)||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(t){t!==this._get("map")&&(t!=null&&t.destroyed&&(J.getLogger(this).warn("#map","The provided map is already destroyed",{map:t}),t=null),Dg.isLoadable(t)&&t.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._currentSpatialReference=null),this._set("map",t))}get spatialReference(){var e,r;let t=this._userSpatialReference||this._currentSpatialReference||this.getDefaultSpatialReference()||null;return t&&((r=(e=this.defaultsFromMap)==null?void 0:e.required)!=null&&r.heightModelInfo)&&(t=t.clone(),t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid),t}set spatialReference(t){const e=!Js(t,this._get("spatialReference"));this._set("_userSpatialReference",t),e&&(this._set("spatialReference",t),this._spatialReferenceChanged(t))}_spatialReferenceChanged(t){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get tools(){var t;return(t=this.toolViewManager)==null?void 0:t.tools}get initialExtent(){var t;return(t=this.defaultsFromMap)==null?void 0:t.extent}get cursor(){const t=this.toolViewManager?this.toolViewManager.cursor:null;return t??(this._cursor||"default")}set cursor(t){this._cursor=t,this.notifyChange("cursor")}get size(){return[this.width,this.height]}whenLayerView(t){var e;return((e=this.layerViewManager)==null?void 0:e.whenLayerView(t))??Promise.reject()}getDefaultSpatialReference(){var t;return(t=this.defaultsFromMap)==null?void 0:t.spatialReference}getDefaultHeightModelInfo(){var t;return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??((t=this.defaultsFromMap)==null?void 0:t.heightModelInfo)??null}importLayerView(t){throw new Y("importLayerView() not implemented")}hasLayerViewModule(t){return!1}async validate(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(t){return this.getSpatialReferenceSupport({spatialReference:t})!=null}when(t,e){return this.isResolved()&&!this.ready&&J.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(t,e)}forceReadyCycle(){this.ready&&(Dh(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(t){this.toolViewManager.tools.add(t),this.activeTool=t}tryFatalErrorRecovery(){this.fatalError=null}};Rt.views=new ir,h([f()],Rt.prototype,"_userSpatialReference",void 0),h([f()],Rt.prototype,"activeTool",null),h([f({readOnly:!0})],Rt.prototype,"allLayerViews",void 0),h([f()],Rt.prototype,"groundView",void 0),h([f()],Rt.prototype,"animation",null),h([f()],Rt.prototype,"basemapView",void 0),h([f()],Rt.prototype,"center",null),h([f({readOnly:!0})],Rt.prototype,"_defaultsFromMapSettings",null),h([f()],Rt.prototype,"defaultsFromMap",null),h([f()],Rt.prototype,"fatalError",void 0),h([f({type:Dr})],Rt.prototype,"extent",null),h([f(F4(Mb,"graphics"))],Rt.prototype,"graphics",void 0),h([f(F4($S,"analyses"))],Rt.prototype,"analyses",void 0),h([f({readOnly:!0,type:CP})],Rt.prototype,"heightModelInfo",null),h([f({readOnly:!0})],Rt.prototype,"interacting",null),h([f({readOnly:!0})],Rt.prototype,"navigating",null),h([f({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_currentSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],Rt.prototype,"preconditionsReady",null),h([f({readOnly:!0})],Rt.prototype,"typeSpecificPreconditionsReady",void 0),h([f({type:ir,readOnly:!0})],Rt.prototype,"layerViews",void 0),h([f()],Rt.prototype,"resolution",null),h([f({type:mwe})],Rt.prototype,"magnifier",void 0),h([f({value:null,type:Wye})],Rt.prototype,"map",null),h([f()],Rt.prototype,"padding",void 0),h([f({readOnly:!0})],Rt.prototype,"ready",void 0),h([f({type:St})],Rt.prototype,"spatialReference",null),h([f()],Rt.prototype,"spatialReferenceWarningDelay",void 0),h([f()],Rt.prototype,"stationary",null),h([f({readOnly:!0})],Rt.prototype,"supportsGround",void 0),h([f({type:yje})],Rt.prototype,"timeExtent",void 0),h([f({type:fwe,nonNullable:!0})],Rt.prototype,"timeReference",void 0),h([f()],Rt.prototype,"tools",null),h([f()],Rt.prototype,"toolViewManager",void 0),h([f({readOnly:!0})],Rt.prototype,"type",void 0),h([f({type:Number})],Rt.prototype,"scale",void 0),h([f({readOnly:!0})],Rt.prototype,"updating",void 0),h([f({readOnly:!0})],Rt.prototype,"initialExtentRequired",void 0),h([f({readOnly:!0})],Rt.prototype,"initialExtent",null),h([f()],Rt.prototype,"cursor",null),h([f({readOnly:!0})],Rt.prototype,"input",void 0),h([f({type:xwe,nonNullable:!0})],Rt.prototype,"navigation",void 0),h([f()],Rt.prototype,"layerViewManager",void 0),h([f()],Rt.prototype,"analysisViewManager",void 0),h([f()],Rt.prototype,"width",void 0),h([f()],Rt.prototype,"height",void 0),h([f({readOnly:!0})],Rt.prototype,"resizing",void 0),h([f({value:null,readOnly:!0})],Rt.prototype,"size",null),h([f({readOnly:!0})],Rt.prototype,"suspended",void 0),h([f({readOnly:!0})],Rt.prototype,"viewEvents",void 0),h([f({readOnly:!0})],Rt.prototype,"persistableViewModels",void 0),h([f()],Rt.prototype,"_isValid",void 0),h([f()],Rt.prototype,"_readyCycleForced",void 0),h([f()],Rt.prototype,"_currentSpatialReference",void 0),Rt=z3=h([N("esri.views.View")],Rt);const Zje=Rt;function Qje(t){return t.layerViews}let yy=class extends h4{constructor(e){super(e),this.state="running",this.target=null,this._resolver=null}initialize(){this._resolver=Wo(),this.addResolvingPromise(this._resolver.promise)}get done(){return this.state==="finished"||this.state==="stopped"}stop(){var e;this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","stopped"),(e=this._resolver)==null||e.reject(new Y("ViewAnimation stopped")))}finish(){var e;this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","finished"),(e=this._resolver)==null||e.resolve())}update(e,r){r||(r=Eu(e)?"waiting-for-target":"running"),this._set("target",e),this._set("state",r)}};h([f({readOnly:!0})],yy.prototype,"done",null),h([f({readOnly:!0,type:String})],yy.prototype,"state",void 0),h([f()],yy.prototype,"target",void 0),yy=h([N("esri.views.ViewAnimation")],yy),function(t){t.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(yy||(yy={}));const DS=yy,hC=()=>ce(()=>import("./TileLayerView3D-844ae299.js"),["assets/TileLayerView3D-844ae299.js","assets/LayerView3D-ffd35809.js","assets/TiledLayerView3D-a11f8026.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js","assets/MapServiceLayerViewHelper-fdadc63a.js","assets/floorFilterUtils-080a7cd2.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/sql-734ecbc5.js","assets/sublayerUtils-1269bca6.js","assets/popupUtils-f04ec9a9.js","assets/drapedUtils-909caa2b.js"]),tne=()=>ce(()=>import("./ElevationLayerView3D-eeaaa8c4.js"),["assets/ElevationLayerView3D-eeaaa8c4.js","assets/LayerView3D-ffd35809.js","assets/TiledLayerView3D-a11f8026.js","assets/LayerView-448bc5ea.js"]),rne={"base-dynamic":()=>ce(()=>import("./BaseDynamicLayerView3D-83fabc6e.js"),["assets/BaseDynamicLayerView3D-83fabc6e.js","assets/DynamicLayerView3D-b48678f2.js","assets/LayerView3D-ffd35809.js","assets/projectExtentUtils-efa4cddd.js","assets/ImageMaterial-5c48df66.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js"]),"base-elevation":tne,"base-tile":hC,"bing-maps":hC,"building-scene":()=>ce(()=>import("./BuildingSceneLayerView3D-15511316.js"),["assets/BuildingSceneLayerView3D-15511316.js","assets/BuildingGroupSublayer-d6113346.js","assets/BuildingComponentSublayer-5d49e5f9.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/AttachmentQuery-972bbd60.js","assets/Query-1c961d4c.js","assets/RelationshipQuery-39c07195.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/TopFeaturesQuery-e44d05be.js","assets/popupUtils-82ea8abb.js","assets/capabilities-5d185925.js","assets/I3SIndexInfo-445e6968.js","assets/I3SLayerDefinitions-ffdb3821.js","assets/I3SUtil-2c288808.js","assets/I3SBinaryReader-2b8e30f7.js","assets/popupUtils-f04ec9a9.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/I3SMeshView3D-86f2c945.js","assets/I3SOverrides-96f73e2b.js","assets/I3SNode-2025159f.js","assets/meshFeatureSet-8442b8e6.js","assets/FeatureLayerView3D-7e7e2653.js","assets/FeatureLayerViewBase3D-8474587e.js","assets/FeatureLikeLayerView3D-2e3185ce.js","assets/dehydratedFeatureComparison-a3375a3e.js","assets/queryForSymbologySnapping-0264f2b5.js","assets/elevationInfoUtils-4fd79d95.js","assets/hash-6f442295.js","assets/Graphics3DObjectStates-bb2a6162.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/floorFilterUtils-080a7cd2.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/projectExtentUtils-efa4cddd.js","assets/LayerView3D-ffd35809.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/EventedSet-d13fada5.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js","assets/SceneModification-2715f58a.js","assets/persistable-ca976a2c.js","assets/multiOriginJSONSupportUtils-c978f4c3.js","assets/resourceExtension-91e7c3ce.js","assets/SceneLayerWorker-e92c2264.js","assets/I3SQueryFeatureStore-0cfa6ebc.js","assets/DefinitionExpressionSceneLayerView-66b62d34.js"]),csv:()=>ce(()=>import("./CSVLayerView3D-f68a6513.js"),["assets/CSVLayerView3D-f68a6513.js","assets/FeatureLayerViewBase3D-8474587e.js","assets/FeatureLikeLayerView3D-2e3185ce.js","assets/Query-1c961d4c.js","assets/dehydratedFeatureComparison-a3375a3e.js","assets/queryForSymbologySnapping-0264f2b5.js","assets/elevationInfoUtils-4fd79d95.js","assets/hash-6f442295.js","assets/diffUtils-590c9088.js","assets/Graphics3DObjectStates-bb2a6162.js","assets/UniqueValueRenderer-fef4204d.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/popupUtils-f04ec9a9.js","assets/FeatureFilter-00f4be05.js","assets/floorFilterUtils-080a7cd2.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FeatureSet-111cb247.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/projectExtentUtils-efa4cddd.js","assets/LayerView3D-ffd35809.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/EventedSet-d13fada5.js","assets/commonProperties-30089b06.js","assets/FeatureEffect-86735d98.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js"]),dimension:()=>ce(()=>import("./DimensionLayerView3D-9f833e6e.js"),["assets/DimensionLayerView3D-9f833e6e.js","assets/LayerView3D-ffd35809.js","assets/LayerView-448bc5ea.js"]),elevation:tne,feature:()=>ce(()=>import("./FeatureLayerView3D-7e7e2653.js"),["assets/FeatureLayerView3D-7e7e2653.js","assets/FeatureLayerViewBase3D-8474587e.js","assets/FeatureLikeLayerView3D-2e3185ce.js","assets/Query-1c961d4c.js","assets/dehydratedFeatureComparison-a3375a3e.js","assets/queryForSymbologySnapping-0264f2b5.js","assets/elevationInfoUtils-4fd79d95.js","assets/hash-6f442295.js","assets/diffUtils-590c9088.js","assets/Graphics3DObjectStates-bb2a6162.js","assets/UniqueValueRenderer-fef4204d.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/popupUtils-f04ec9a9.js","assets/FeatureFilter-00f4be05.js","assets/floorFilterUtils-080a7cd2.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FeatureSet-111cb247.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/projectExtentUtils-efa4cddd.js","assets/LayerView3D-ffd35809.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/EventedSet-d13fada5.js","assets/commonProperties-30089b06.js","assets/FeatureEffect-86735d98.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js"]),geojson:()=>ce(()=>import("./GeoJSONLayerView3D-be497a18.js"),["assets/GeoJSONLayerView3D-be497a18.js","assets/FeatureLayerViewBase3D-8474587e.js","assets/FeatureLikeLayerView3D-2e3185ce.js","assets/Query-1c961d4c.js","assets/dehydratedFeatureComparison-a3375a3e.js","assets/queryForSymbologySnapping-0264f2b5.js","assets/elevationInfoUtils-4fd79d95.js","assets/hash-6f442295.js","assets/diffUtils-590c9088.js","assets/Graphics3DObjectStates-bb2a6162.js","assets/UniqueValueRenderer-fef4204d.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/popupUtils-f04ec9a9.js","assets/FeatureFilter-00f4be05.js","assets/floorFilterUtils-080a7cd2.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FeatureSet-111cb247.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/projectExtentUtils-efa4cddd.js","assets/LayerView3D-ffd35809.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/EventedSet-d13fada5.js","assets/commonProperties-30089b06.js","assets/FeatureEffect-86735d98.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js"]),graphics:()=>ce(()=>import("./GraphicsLayerView3D-f93de954.js"),["assets/GraphicsLayerView3D-f93de954.js","assets/LayerView3D-ffd35809.js","assets/queryForSymbologySnapping-0264f2b5.js","assets/elevationInfoUtils-4fd79d95.js","assets/GraphicsProcessor-750d4e2b.js","assets/diffUtils-590c9088.js","assets/Query-1c961d4c.js","assets/Graphics3DObjectStates-bb2a6162.js","assets/UniqueValueRenderer-fef4204d.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/popupUtils-f04ec9a9.js","assets/projectExtentUtils-efa4cddd.js","assets/LayerView-448bc5ea.js"]),group:()=>ce(()=>import("./GroupLayerView-c93dbf5e.js"),["assets/GroupLayerView-c93dbf5e.js","assets/LayerView-448bc5ea.js"]),imagery:()=>ce(()=>import("./ImageryLayerView3D-b65487bb.js"),["assets/ImageryLayerView3D-b65487bb.js","assets/DynamicLayerView3D-b48678f2.js","assets/LayerView3D-ffd35809.js","assets/projectExtentUtils-efa4cddd.js","assets/ImageMaterial-5c48df66.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js","assets/commonProperties-30089b06.js","assets/Query-1c961d4c.js","assets/popupUtils-f04ec9a9.js"]),"integrated-mesh":()=>ce(()=>import("./IntegratedMeshLayerView3D-9c474b52.js"),["assets/IntegratedMeshLayerView3D-9c474b52.js","assets/I3SMeshView3D-86f2c945.js","assets/I3SOverrides-96f73e2b.js","assets/I3SNode-2025159f.js","assets/I3SUtil-2c288808.js","assets/Query-1c961d4c.js","assets/I3SBinaryReader-2b8e30f7.js","assets/meshFeatureSet-8442b8e6.js","assets/FeatureSet-111cb247.js","assets/FeatureLayerView3D-7e7e2653.js","assets/FeatureLayerViewBase3D-8474587e.js","assets/FeatureLikeLayerView3D-2e3185ce.js","assets/dehydratedFeatureComparison-a3375a3e.js","assets/queryForSymbologySnapping-0264f2b5.js","assets/elevationInfoUtils-4fd79d95.js","assets/hash-6f442295.js","assets/diffUtils-590c9088.js","assets/Graphics3DObjectStates-bb2a6162.js","assets/UniqueValueRenderer-fef4204d.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/popupUtils-f04ec9a9.js","assets/FeatureFilter-00f4be05.js","assets/floorFilterUtils-080a7cd2.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/projectExtentUtils-efa4cddd.js","assets/LayerView3D-ffd35809.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/EventedSet-d13fada5.js","assets/commonProperties-30089b06.js","assets/FeatureEffect-86735d98.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js","assets/SceneModification-2715f58a.js","assets/persistable-ca976a2c.js","assets/multiOriginJSONSupportUtils-c978f4c3.js","assets/resourceExtension-91e7c3ce.js","assets/SceneLayerWorker-e92c2264.js"]),"line-of-sight":()=>ce(()=>import("./LineOfSightLayerView3D-75d7761d.js"),["assets/LineOfSightLayerView3D-75d7761d.js","assets/LayerView3D-ffd35809.js","assets/LayerView-448bc5ea.js"]),"map-image":()=>ce(()=>import("./MapImageLayerView3D-5536e520.js"),["assets/MapImageLayerView3D-5536e520.js","assets/DynamicLayerView3D-b48678f2.js","assets/LayerView3D-ffd35809.js","assets/projectExtentUtils-efa4cddd.js","assets/ImageMaterial-5c48df66.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js","assets/commonProperties-30089b06.js","assets/ExportImageParameters-649a2637.js","assets/sql-734ecbc5.js","assets/floorFilterUtils-080a7cd2.js","assets/sublayerUtils-1269bca6.js","assets/MapServiceLayerViewHelper-fdadc63a.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/popupUtils-f04ec9a9.js","assets/drapedUtils-909caa2b.js"]),media:()=>ce(()=>import("./MediaLayerView3D-69d89f9a.js"),["assets/MediaLayerView3D-69d89f9a.js","assets/MediaElementView-dc36bc9f.js","assets/normalizeUtilsSync-6be8435f.js","assets/normalizeUtilsCommon-500064b3.js","assets/LayerView3D-ffd35809.js","assets/ImageMaterial-5c48df66.js","assets/LayerView-448bc5ea.js"]),"ogc-feature":()=>ce(()=>import("./OGCFeatureLayerView3D-dbd9812b.js"),["assets/OGCFeatureLayerView3D-dbd9812b.js","assets/FeatureLayerViewBase3D-8474587e.js","assets/FeatureLikeLayerView3D-2e3185ce.js","assets/Query-1c961d4c.js","assets/dehydratedFeatureComparison-a3375a3e.js","assets/queryForSymbologySnapping-0264f2b5.js","assets/elevationInfoUtils-4fd79d95.js","assets/hash-6f442295.js","assets/diffUtils-590c9088.js","assets/Graphics3DObjectStates-bb2a6162.js","assets/UniqueValueRenderer-fef4204d.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/popupUtils-f04ec9a9.js","assets/FeatureFilter-00f4be05.js","assets/floorFilterUtils-080a7cd2.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FeatureSet-111cb247.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/projectExtentUtils-efa4cddd.js","assets/LayerView3D-ffd35809.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/EventedSet-d13fada5.js","assets/commonProperties-30089b06.js","assets/FeatureEffect-86735d98.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js"]),"open-street-map":hC,"oriented-imagery":()=>ce(()=>import("./FeatureLayerView3D-7e7e2653.js"),["assets/FeatureLayerView3D-7e7e2653.js","assets/FeatureLayerViewBase3D-8474587e.js","assets/FeatureLikeLayerView3D-2e3185ce.js","assets/Query-1c961d4c.js","assets/dehydratedFeatureComparison-a3375a3e.js","assets/queryForSymbologySnapping-0264f2b5.js","assets/elevationInfoUtils-4fd79d95.js","assets/hash-6f442295.js","assets/diffUtils-590c9088.js","assets/Graphics3DObjectStates-bb2a6162.js","assets/UniqueValueRenderer-fef4204d.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/popupUtils-f04ec9a9.js","assets/FeatureFilter-00f4be05.js","assets/floorFilterUtils-080a7cd2.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FeatureSet-111cb247.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/projectExtentUtils-efa4cddd.js","assets/LayerView3D-ffd35809.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/EventedSet-d13fada5.js","assets/commonProperties-30089b06.js","assets/FeatureEffect-86735d98.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js"]),"point-cloud":()=>ce(()=>import("./PointCloudLayerView3D-35572558.js").then(t=>t.P),["assets/PointCloudLayerView3D-35572558.js","assets/LayerView3D-ffd35809.js","assets/I3SUtil-2c288808.js","assets/Query-1c961d4c.js","assets/I3SBinaryReader-2b8e30f7.js","assets/PointCloudWorkerUtil-ec4f2005.js","assets/PointCloudUniqueValueRenderer-df78a172.js","assets/PopupSceneLayerView-c49dd096.js","assets/popupUtils-f04ec9a9.js","assets/LayerView-448bc5ea.js"]),voxel:()=>ce(()=>import("./VoxelLayerView3D-a9ee300f.js"),["assets/VoxelLayerView3D-a9ee300f.js","assets/LayerView3D-ffd35809.js","assets/PopupSceneLayerView-c49dd096.js","assets/popupUtils-f04ec9a9.js","assets/LayerView-448bc5ea.js"]),route:()=>ce(()=>import("./RouteLayerView3D-0557987b.js"),["assets/RouteLayerView3D-0557987b.js","assets/Stop-9d81fe58.js","assets/LayerView3D-ffd35809.js","assets/GraphicsProcessor-750d4e2b.js","assets/diffUtils-590c9088.js","assets/Query-1c961d4c.js","assets/Graphics3DObjectStates-bb2a6162.js","assets/UniqueValueRenderer-fef4204d.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/popupUtils-f04ec9a9.js","assets/projectExtentUtils-efa4cddd.js","assets/EventedSet-d13fada5.js","assets/LayerView-448bc5ea.js"]),scene:t=>t.profile==null||t.profile==="mesh-pyramids"?ce(()=>import("./SceneLayerView3D-ef96402b.js"),["assets/SceneLayerView3D-ef96402b.js","assets/I3SOverrides-96f73e2b.js","assets/I3SNode-2025159f.js","assets/I3SUtil-2c288808.js","assets/Query-1c961d4c.js","assets/I3SBinaryReader-2b8e30f7.js","assets/meshFeatureSet-8442b8e6.js","assets/FeatureSet-111cb247.js","assets/FeatureLayerView3D-7e7e2653.js","assets/FeatureLayerViewBase3D-8474587e.js","assets/FeatureLikeLayerView3D-2e3185ce.js","assets/dehydratedFeatureComparison-a3375a3e.js","assets/queryForSymbologySnapping-0264f2b5.js","assets/elevationInfoUtils-4fd79d95.js","assets/hash-6f442295.js","assets/diffUtils-590c9088.js","assets/Graphics3DObjectStates-bb2a6162.js","assets/UniqueValueRenderer-fef4204d.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/popupUtils-f04ec9a9.js","assets/FeatureFilter-00f4be05.js","assets/floorFilterUtils-080a7cd2.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/projectExtentUtils-efa4cddd.js","assets/LayerView3D-ffd35809.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/EventedSet-d13fada5.js","assets/commonProperties-30089b06.js","assets/FeatureEffect-86735d98.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js","assets/I3SMeshView3D-86f2c945.js","assets/SceneModification-2715f58a.js","assets/persistable-ca976a2c.js","assets/multiOriginJSONSupportUtils-c978f4c3.js","assets/resourceExtension-91e7c3ce.js","assets/SceneLayerWorker-e92c2264.js","assets/SceneLayerView-b7d3fe23.js","assets/DefinitionExpressionSceneLayerView-66b62d34.js","assets/I3SQueryFeatureStore-0cfa6ebc.js","assets/PopupSceneLayerView-c49dd096.js"]):ce(()=>import("./SceneLayerGraphicsView3D-8d7d0182.js"),["assets/SceneLayerGraphicsView3D-8d7d0182.js","assets/I3SOverrides-96f73e2b.js","assets/I3SNode-2025159f.js","assets/I3SUtil-2c288808.js","assets/Query-1c961d4c.js","assets/I3SBinaryReader-2b8e30f7.js","assets/meshFeatureSet-8442b8e6.js","assets/FeatureSet-111cb247.js","assets/FeatureLayerView3D-7e7e2653.js","assets/FeatureLayerViewBase3D-8474587e.js","assets/FeatureLikeLayerView3D-2e3185ce.js","assets/dehydratedFeatureComparison-a3375a3e.js","assets/queryForSymbologySnapping-0264f2b5.js","assets/elevationInfoUtils-4fd79d95.js","assets/hash-6f442295.js","assets/diffUtils-590c9088.js","assets/Graphics3DObjectStates-bb2a6162.js","assets/UniqueValueRenderer-fef4204d.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/popupUtils-f04ec9a9.js","assets/FeatureFilter-00f4be05.js","assets/floorFilterUtils-080a7cd2.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/projectExtentUtils-efa4cddd.js","assets/LayerView3D-ffd35809.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/EventedSet-d13fada5.js","assets/commonProperties-30089b06.js","assets/FeatureEffect-86735d98.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js","assets/SceneLayerView-b7d3fe23.js","assets/DefinitionExpressionSceneLayerView-66b62d34.js","assets/PopupSceneLayerView-c49dd096.js"]),stream:()=>ce(()=>import("./StreamLayerView3D-9f3bc35d.js"),["assets/StreamLayerView3D-9f3bc35d.js","assets/StreamFeatureManager-4b8ac3ac.js","assets/createConnection-4b117798.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/Query-1c961d4c.js","assets/EventedSet-d13fada5.js","assets/FeatureLikeLayerView3D-2e3185ce.js","assets/dehydratedFeatureComparison-a3375a3e.js","assets/queryForSymbologySnapping-0264f2b5.js","assets/elevationInfoUtils-4fd79d95.js","assets/hash-6f442295.js","assets/diffUtils-590c9088.js","assets/Graphics3DObjectStates-bb2a6162.js","assets/UniqueValueRenderer-fef4204d.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/popupUtils-f04ec9a9.js","assets/FeatureFilter-00f4be05.js","assets/floorFilterUtils-080a7cd2.js","assets/QueryEngine-19eda5ff.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FeatureSet-111cb247.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/projectExtentUtils-efa4cddd.js","assets/LayerView3D-ffd35809.js","assets/LayerView-448bc5ea.js"]),tile:hC,"imagery-tile":()=>ce(()=>import("./ImageryTileLayerView3D-7bc4c9c1.js"),["assets/ImageryTileLayerView3D-7bc4c9c1.js","assets/LayerView3D-ffd35809.js","assets/TiledLayerView3D-a11f8026.js","assets/commonProperties-30089b06.js","assets/rasterProjectionHelper-072edec4.js","assets/popupUtils-f04ec9a9.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js","assets/drapedUtils-909caa2b.js"]),"vector-tile":()=>ce(()=>import("./VectorTileLayerView3D-617343b6.js"),["assets/VectorTileLayerView3D-617343b6.js","assets/Rect-98da58d6.js","assets/pbf-d9aa3914.js","assets/rasterizingUtils-4df93c6e.js","assets/TileInfoView-346e56d0.js","assets/definitions-0bc08d4c.js","assets/number-e491b09e.js","assets/GeometryUtils-0258f920.js","assets/StyleRepository-2362164f.js","assets/colorUtils-c0f43caf.js","assets/TileClipper-ae6eca9e.js","assets/LayerView3D-ffd35809.js","assets/TiledLayerView3D-a11f8026.js","assets/LayerView-448bc5ea.js"]),wcs:()=>ce(()=>import("./ImageryTileLayerView3D-7bc4c9c1.js"),["assets/ImageryTileLayerView3D-7bc4c9c1.js","assets/LayerView3D-ffd35809.js","assets/TiledLayerView3D-a11f8026.js","assets/commonProperties-30089b06.js","assets/rasterProjectionHelper-072edec4.js","assets/popupUtils-f04ec9a9.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js","assets/drapedUtils-909caa2b.js"]),"web-tile":hC,wfs:()=>ce(()=>import("./WFSLayerView3D-37f84843.js"),["assets/WFSLayerView3D-37f84843.js","assets/FeatureLayerViewBase3D-8474587e.js","assets/FeatureLikeLayerView3D-2e3185ce.js","assets/Query-1c961d4c.js","assets/dehydratedFeatureComparison-a3375a3e.js","assets/queryForSymbologySnapping-0264f2b5.js","assets/elevationInfoUtils-4fd79d95.js","assets/hash-6f442295.js","assets/diffUtils-590c9088.js","assets/Graphics3DObjectStates-bb2a6162.js","assets/UniqueValueRenderer-fef4204d.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/popupUtils-f04ec9a9.js","assets/FeatureFilter-00f4be05.js","assets/floorFilterUtils-080a7cd2.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/FeatureSet-111cb247.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/projectExtentUtils-efa4cddd.js","assets/LayerView3D-ffd35809.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/EventedSet-d13fada5.js","assets/commonProperties-30089b06.js","assets/FeatureEffect-86735d98.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js"]),wms:()=>ce(()=>import("./WMSLayerView3D-4330be5d.js"),["assets/WMSLayerView3D-4330be5d.js","assets/DynamicLayerView3D-b48678f2.js","assets/LayerView3D-ffd35809.js","assets/projectExtentUtils-efa4cddd.js","assets/ImageMaterial-5c48df66.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js","assets/commonProperties-30089b06.js","assets/ExportWMSImageParameters-d63354ac.js"]),wmts:()=>ce(()=>import("./WMTSLayerView3D-b2043cf0.js"),["assets/WMTSLayerView3D-b2043cf0.js","assets/LayerView3D-ffd35809.js","assets/TiledLayerView3D-a11f8026.js","assets/LayerView-448bc5ea.js","assets/RefreshableLayerView-915e7f53.js"]),"geo-rss":null,kml:null,"knowledge-graph":null,"link-chart":null,"knowledge-graph-sublayer":null,"map-notes":null,"subtype-group":null,unknown:null,unsupported:null,video:null};function Jje(t){const e=t.declaredClass?t.declaredClass.slice(t.declaredClass.lastIndexOf(".")+1):"Unknown",r=e.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new Y(`${r}:view-not-supported`,`${e} is not supported in 3D`)}const ine={hasLayerViewModule:t=>rne[t.type]!=null,importLayerView:t=>{const e=rne[t.type];if(e==null)throw Jje(t);return e(t)}},nne="analyses-owner-handles";var cT,eb;(function(t){t[t.PENDING=0]="PENDING",t[t.CREATED=1]="CREATED"})(cT||(cT={})),function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED"}(eb||(eb={}));let Sv=class extends pR{constructor(e){super(e),this._allAnalysisViews=new ir,this._creatingViewCount=0,this._items=new Map,this._scheduledUpdateHandle=null,this._attachedToViewResolver=sne(),this._analysisModules={"area-measurement":{module:null},dimension:{module:null},"direct-line-measurement":{module:null},"line-of-sight":{module:null},slice:{module:null}}}destroy(){this._disconnectOwners(),this._attachedToViewResolver.reject(wr("AnalysisViewManager was destroyed"))}attach(){this._connectOwners(),this._attachedToViewResolver.resolve()}detach(){this._disconnectOwners(),this._attachedToViewResolver.reject(wr()),this._attachedToViewResolver=sne()}get updating(){return!this.view.ready||this._creatingViewCount!==0||this._allAnalysisViews.some(e=>e.updating)}get testInfo(){return{allAnalysisViews:this._allAnalysisViews}}async whenAnalysisView(e){await this._attachedToViewResolver.promise;const r=this._items.get(e);if(r==null||r.state.list===eb.REMOVED)throw new Y("AnalysisViewManager:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});return r.createAnalysisViewTask.promise}_connectOwners(){this.handles.add(this._connectAnalysesCollection(this.view.analyses),nne)}_disconnectOwners(){this.handles.remove(nne),this._update(),this._creatingViewCount=0}_connectAnalysesCollection(e){for(const n of e)this._addAnalysis(n);const r=e.on("after-add",n=>this._addAnalysis(n.item)),i=e.on("after-remove",n=>this._removeAnalysis(n.item));return{remove:()=>{r.remove(),i.remove();for(const n of e)this._removeAnalysis(n)}}}_addAnalysis(e){const r=this._items.get(e);if(r==null){const i={state:{view:cT.PENDING,list:eb.ADDED},analysis:e,view:null,createAnalysisViewTask:null};this._items.set(e,i),i.createAnalysisViewTask=hE(n=>this._createAnalysisViewPromise(i,n))}else r.state.list=eb.ADDED}_removeAnalysis(e){const r=this._items.get(e);r!=null?(r.state.list=eb.REMOVED,this._scheduleUpdate()):J.getLogger(this).error("Trying to remove analysis which was not added")}_scheduleUpdate(){this._scheduledUpdateHandle==null&&(this._scheduledUpdateHandle=pP(()=>this._update()))}_update(){this._scheduledUpdateHandle=Pi(this._scheduledUpdateHandle),this._items.forEach(e=>{if(e.state.list===eb.REMOVED)switch(this._items.delete(e.analysis),e.state.view){case cT.PENDING:e.createAnalysisViewTask=yu(e.createAnalysisViewTask);break;case cT.CREATED:e.view!=null&&(this._allAnalysisViews.remove(e.view),e.view=Me(e.view),e.createAnalysisViewTask=null)}})}async _createAnalysisViewPromise(e,r){const i=e.analysis,n=i.type,s=this._analysisModules[n];if(this._creatingViewCount+=1,s.module==null)try{s.module=await this._loadAnalysisModule(n)}catch(a){throw this._creatingViewCount-=1,a}if(ss(r))throw this._creatingViewCount-=1,wr("AnalysisView creation aborted");const o=new s.module.default({analysis:i,view:this.view});try{await o.when()}catch(a){throw this._creatingViewCount-=1,a}if(ss(r))throw this._creatingViewCount-=1,o.destroy(),wr("AnalysisView creation aborted");return e.view=o,e.state.view=cT.CREATED,this._allAnalysisViews.add(o),this._creatingViewCount-=1,o}_loadAnalysisModule(e){switch(e){case"area-measurement":return ce(()=>import("./AreaMeasurementAnalysisView3D-26f7cb40.js").then(r=>r.A),["assets/AreaMeasurementAnalysisView3D-26f7cb40.js","assets/UnitNormalizer-818a6664.js","assets/Segment-50129b50.js","assets/unitFormatUtils-b70a7bff.js","assets/LineVisualElement-b605d10c.js","assets/elevationInfoUtils-4fd79d95.js","assets/geometryEngine-5a631b21.js","assets/geometryEngineBase-324c1c81.js","assets/hydrated-c10ab4a5.js","assets/EditGeometryOperations-0ec3f5b5.js"]);case"dimension":return ce(()=>import("./DimensionAnalysisView3D-4f55aca1.js").then(r=>r.D),["assets/DimensionAnalysisView3D-4f55aca1.js","assets/LineVisualElement-b605d10c.js","assets/LengthDimension-92faee98.js","assets/Segment-50129b50.js","assets/unitFormatUtils-b70a7bff.js","assets/elevationInfoUtils-4fd79d95.js","assets/analysisViewUtils-68ab721d.js","assets/ImageMaterial-5c48df66.js","assets/Factory-8e329f4b.js","assets/RightAngleQuadVisualElement-8daf0594.js","assets/VisualElementResources-e52972a5.js","assets/PointVisualElement-2a56e55d.js","assets/EditGeometryOperations-0ec3f5b5.js","assets/dehydratedFeatureComparison-a3375a3e.js"]);case"direct-line-measurement":return ce(()=>import("./DirectLineMeasurementAnalysisView3D-f383b6d8.js").then(r=>r.D),["assets/DirectLineMeasurementAnalysisView3D-f383b6d8.js","assets/UnitNormalizer-818a6664.js","assets/Segment-50129b50.js","assets/unitFormatUtils-b70a7bff.js","assets/LineVisualElement-b605d10c.js","assets/elevationInfoUtils-4fd79d95.js","assets/geometryEngine-5a631b21.js","assets/geometryEngineBase-324c1c81.js","assets/hydrated-c10ab4a5.js","assets/RightAngleQuadVisualElement-8daf0594.js","assets/VisualElementResources-e52972a5.js"]);case"line-of-sight":return ce(()=>import("./LineOfSightAnalysisView3D-ccdd2ae5.js"),["assets/LineOfSightAnalysisView3D-ccdd2ae5.js","assets/LineVisualElement-b605d10c.js","assets/LineOfSightAnalysisTarget-7f5e80d1.js","assets/persistable-ca976a2c.js","assets/multiOriginJSONSupportUtils-c978f4c3.js","assets/resourceExtension-91e7c3ce.js","assets/elevationInfoUtils-4fd79d95.js","assets/analysisViewUtils-68ab721d.js","assets/ImageMaterial-5c48df66.js","assets/PointVisualElement-2a56e55d.js","assets/VisualElementResources-e52972a5.js"]);case"slice":return ce(()=>import("./SliceAnalysisView3D-63c25320.js").then(r=>r.S),["assets/SliceAnalysisView3D-63c25320.js","assets/LineVisualElement-b605d10c.js","assets/persistable-ca976a2c.js","assets/multiOriginJSONSupportUtils-c978f4c3.js","assets/resourceExtension-91e7c3ce.js","assets/BuildingComponentSublayer-5d49e5f9.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/FeatureLayer-5c6d2c3b.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/AttachmentQuery-972bbd60.js","assets/Query-1c961d4c.js","assets/RelationshipQuery-39c07195.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/TopFeaturesQuery-e44d05be.js","assets/popupUtils-82ea8abb.js","assets/capabilities-5d185925.js","assets/I3SIndexInfo-445e6968.js","assets/I3SLayerDefinitions-ffdb3821.js","assets/I3SUtil-2c288808.js","assets/I3SBinaryReader-2b8e30f7.js","assets/popupUtils-f04ec9a9.js","assets/analysisViewUtils-68ab721d.js","assets/ImageMaterial-5c48df66.js","assets/Factory-8e329f4b.js"])}}};function sne(){const t=Wo();return t.promise.catch(()=>{}),t}h([f()],Sv.prototype,"updating",null),h([f({constructOnly:!0})],Sv.prototype,"view",void 0),h([f()],Sv.prototype,"_allAnalysisViews",void 0),h([f()],Sv.prototype,"_creatingViewCount",void 0),Sv=h([N("esri.views.3d.analysis.AnalysisViewManager3D")],Sv);const Kje=Sv;let Bm=class extends xe{constructor(e){super(e),this.collision=new B3,this.distance=1/0,this.minimumPoiDistance=4,this.tilt=null}get altitude(){return this.mode===$e.Local?null:this._get("altitude")||null}set altitude(e){this.mode!==$e.Local?this._set("altitude",e):J.getLogger(this).warn("Altitude constraint is ignored in local scenes")}clampAltitude(e){return this.altitude?ge(e,this.altitude.min,this.altitude.max):e}clampTilt(e,r){if(!this.tilt)return r;const i=this.tilt(e);return ge(r,i.min,i.max)}clampDistance(e){return Math.min(e,this.distance)}createDefaultTilt(){return this.mode===$e.Local?this._createDefaultTiltLocal():this._createDefaultTiltGlobal()}createConstantMaxTilt(e){return(r,i=$k)=>(i.min=$o.min,i.max=e,i)}_createDefaultTiltLocal(){const e=this.collision.enabled?wD([[4e3,$o.max],[1e4,It(88)],[6e6,It(88)]]):()=>$o.max;return(r,i=$k)=>(i.min=$o.min,i.max=e(r),i)}_createDefaultTiltGlobal(){const e=this.collision.enabled?wD([[4e3,$o.max],[5e4,It(88)],[6e6,It(88)],[2e7,$o.min]]):wD([[3e5,$o.max],[3e6,It(88)],[6e6,It(88)],[2e7,$o.min]]);return(r,i=$k)=>(i.min=$o.min,i.max=e(r),i)}};function eHe(t){return{min:-2e5,max:4*t.radius}}h([f()],Bm.prototype,"altitude",null),h([f({readOnly:!0})],Bm.prototype,"collision",void 0),h([f()],Bm.prototype,"distance",void 0),h([f({readOnly:!0})],Bm.prototype,"minimumPoiDistance",void 0),h([f()],Bm.prototype,"tilt",void 0),h([f({constructOnly:!0})],Bm.prototype,"mode",void 0),Bm=h([N("esri.views.3d.state.Constraints")],Bm);const one=eHe(Kt),$o={min:It(.5),max:It(179.5)},$k={min:0,max:0};let B3=class extends xe{constructor(){super(...arguments),this.enabled=!0,this.elevationMargin=5}};h([f({type:Boolean})],B3.prototype,"enabled",void 0),h([f({type:Number})],B3.prototype,"elevationMargin",void 0),B3=h([N("esri.views.3d.state.Constraints.CollisionConstraint")],B3);let uT=class extends xe{constructor(){super(...arguments),this.min=one.min,this.max=one.max}};h([f({type:Number})],uT.prototype,"min",void 0),h([f({type:Number})],uT.prototype,"max",void 0),uT=h([N("esri.views.3d.constraints.AltitudeConstraint")],uT);let eg=class extends xe{constructor(){super(...arguments),this.mode="auto"}get near(){return this._get("near")}set near(e){this._set("near",e),e>=this._get("far")&&(this.far=e+1e-9),this.mode="manual"}castNear(e){return Math.max(1e-8,e)}get far(){return this._get("far")}set far(e){this._set("far",e),e<=this._get("near")&&(this.near=e-1e-9),this.mode="manual"}castFar(e){return Math.max(1e-8,e)}autoUpdate(e,r){this.mode==="auto"&&(this._get("near")!==e&&this._set("near",e),this._get("far")!==r&&this._set("far",r))}};h([f({type:Number,value:1e-8})],eg.prototype,"near",null),h([_i("near")],eg.prototype,"castNear",null),h([f({type:Number,value:1e-8})],eg.prototype,"far",null),h([_i("far")],eg.prototype,"castFar",null),h([f({type:["auto","manual"]})],eg.prototype,"mode",void 0),eg=h([N("esri.views.3d.constraints.ClipDistanceConstraint")],eg);const tj={min:Ka($o.min),max:Ka($o.max)};let tb=class extends xe{constructor(){super(...arguments),this.mode="auto"}get max(){return this._get("max")}set max(e){this._set("max",e),this.mode="manual"}castMax(e){return ge(e,tj.min,tj.max)}autoUpdate(e){this.mode==="auto"&&this._get("max")!==e&&this._set("max",e)}};h([f({type:["auto","manual"]})],tb.prototype,"mode",void 0),h([f({type:Number,value:tj.max})],tb.prototype,"max",null),h([_i("max")],tb.prototype,"castMax",null),tb=h([N("esri.views.3d.constraints.TiltConstraint")],tb);let rb=class extends xe{constructor(){super(...arguments),this.tilt=new tb,this.altitude=new uT,this.clipDistance=new eg}};h([f({type:tb})],rb.prototype,"tilt",void 0),h([f({type:uT})],rb.prototype,"altitude",void 0),h([f({type:eg})],rb.prototype,"clipDistance",void 0),rb=h([N("esri.views.3d.constraints.Constraints")],rb);var rj;let qu=rj=class extends ke{constructor(t){super(t),this.type="sun",this.date=null,this.directShadowsEnabled=!1,this.displayUTCOffset=null}readDate(t,e){return e.datetime!=null&&new Date(e.datetime)||null}writeDate(t,e,r){e[r]=t.getTime()}readDirectShadowsEnabled(t,e){return!!e.directShadows}writedirectShadowsEnabled(t,e,r){t&&(e[r]=t)}writeDisplayUTCOffset(t,e){t!=null&&(e.displayUTCOffset=t)}clone(){return new rj(this.cloneConstructProperties())}cloneConstructProperties(){const t={directShadowsEnabled:this.directShadowsEnabled,displayUTCOffset:this.displayUTCOffset!=null?this.displayUTCOffset:null};return this.date!=null&&(t.date=new Date(this.date.getTime())),t}};h([f({readOnly:!0,type:["sun"],json:{write:!0}})],qu.prototype,"type",void 0),h([f({type:Date,json:{type:Number,write:{target:"datetime"}}})],qu.prototype,"date",void 0),h([lr("date",["datetime"])],qu.prototype,"readDate",null),h([xr("date")],qu.prototype,"writeDate",null),h([f({type:Boolean,json:{default:!1,write:{target:"directShadows"}}})],qu.prototype,"directShadowsEnabled",void 0),h([lr("directShadowsEnabled",["directShadows"])],qu.prototype,"readDirectShadowsEnabled",null),h([xr("directShadowsEnabled")],qu.prototype,"writedirectShadowsEnabled",null),h([f({type:Number,json:{write:!0}})],qu.prototype,"displayUTCOffset",void 0),h([xr("displayUTCOffset")],qu.prototype,"writeDisplayUTCOffset",null),qu=rj=h([N("esri.webscene.SunLighting")],qu);const bR=qu;var v2;const Iwe="esri.views.3d.environment.SunLighting",p$=J.getLogger(Iwe);let nf=v2=class extends Bn.EventedMixin(bR){constructor(t){super(t),this.cameraTrackingEnabled=!0,this.positionTimezoneInfo={hours:0,minutes:0,seconds:0,autoUpdated:!0};const e=new Date().getFullYear(),r=new Date("March 15, "+e+" 12:00:00 UTC");this._set("defaultDate",r),this._set("date",r)}get ambientOcclusionEnabled(){return e_(p$,"ambientOcclusionEnabled",{replacement:"ambient occlusion is automatically shown and this property has no effect",version:"4.27"}),this._get("ambientOcclusionEnabled")??!1}set ambientOcclusionEnabled(t){e_(p$,"ambientOcclusionEnabled",{replacement:"ambient occlusion is automatically shown and this property has no effect",version:"4.27"}),this._set("ambientOcclusionEnabled",t)}get waterReflectionEnabled(){return e_(p$,"waterReflectionEnabled",{replacement:"reflections are automatically shown and this property has no effect",version:"4.27"}),this._get("waterReflectionEnabled")??!1}set waterReflectionEnabled(t){e_(p$,"waterReflectionEnabled",{replacement:"reflections are automatically shown and this property has no effect",version:"4.27"}),this._set("waterReflectionEnabled",t)}get defaultDate(){return new Date(this._get("defaultDate").getTime())}static fromWebsceneLighting(t){return new v2(t.cloneConstructProperties())}set defaultDate(t){const e=this._get("date")===this._get("defaultDate");t=new Date(t.getTime()),this._set("defaultDate",t),e&&this._set("date",t)}set date(t){t!=null&&(this.positionTimezoneInfo.autoUpdated=!1,this._set("date",new Date(t.getTime())))}autoUpdate(t,e){const r=v2.calculateTimezoneOffset(this.positionTimezoneInfo);this.positionTimezoneInfo.hours=e.hours,this.positionTimezoneInfo.minutes=e.minutes,this.positionTimezoneInfo.seconds=e.seconds;let i=null;t!=null&&(this.positionTimezoneInfo.autoUpdated=!0,isNaN(t.getTime())?(i=this.defaultDate.getTime(),this._set("date",this.defaultDate)):(i=this.date&&this.date.getTime(),this._set("date",new Date(t.getTime()))));const n=v2.calculateTimezoneOffset(this.positionTimezoneInfo);if(r!==n&&(f$.target=this,f$.timezoneOffset=n,this.emit("timezone-will-change",f$),f$.target=null),t!=null)return isNaN(t.getTime())||i!==t.getTime()}clone(){const t=this._get("date")===this._get("defaultDate"),e=new v2({...this.cloneConstructProperties(),defaultDate:this.defaultDate,cameraTrackingEnabled:this.cameraTrackingEnabled});return t&&e._set("date",e._get("defaultDate")),e.positionTimezoneInfo.autoUpdated=this.positionTimezoneInfo.autoUpdated,e.positionTimezoneInfo.hours=this.positionTimezoneInfo.hours,e.positionTimezoneInfo.minutes=this.positionTimezoneInfo.minutes,e.positionTimezoneInfo.seconds=this.positionTimezoneInfo.seconds,e}cloneWithWebsceneLighting(t){const e=this.clone();return t.date!=null&&(e.date=t.date),e.directShadowsEnabled=t.directShadowsEnabled,e.displayUTCOffset=t.displayUTCOffset,e}cloneNonPersistentConstructProperties(){return{cameraTrackingEnabled:this.cameraTrackingEnabled}}};h([f({type:Boolean})],nf.prototype,"cameraTrackingEnabled",void 0),h([f({type:Boolean})],nf.prototype,"ambientOcclusionEnabled",null),h([f({type:Boolean})],nf.prototype,"waterReflectionEnabled",null),h([f({type:Date})],nf.prototype,"defaultDate",null),h([f({type:Date})],nf.prototype,"date",null),nf=v2=h([N(Iwe)],nf),function(t){function e({hours:r,minutes:i,seconds:n}){return Math.round(r+i/60+n/3600)}t.calculateTimezoneOffset=e}(nf||(nf={}));const f$={target:null,timezoneOffset:0},_y=nf;var ij;let V3=ij=class extends ke{constructor(t){super(t),this.type="virtual",this.directShadowsEnabled=!1}clone(){return new ij(this.cloneConstructProperties())}cloneConstructProperties(){return{directShadowsEnabled:this.directShadowsEnabled}}};h([f({readOnly:!0,type:["virtual"],json:{write:!0}})],V3.prototype,"type",void 0),h([f({type:Boolean,json:{default:!1,name:"directShadows",write:!0}})],V3.prototype,"directShadowsEnabled",void 0),V3=ij=h([N("esri.webscene.VirtualLighting")],V3);const Z6=V3;var CD;const Lwe="esri.views.3d.environment.VirtualLighting",m$=J.getLogger(Lwe);let b2=CD=class extends Bn.EventedMixin(Z6){constructor(t){super(t),this.cameraTrackingEnabled=!0}get ambientOcclusionEnabled(){return e_(m$,"ambientOcclusionEnabled",{replacement:"ambient occlusion is automatically shown and this property has no effect",version:"4.27"}),this._get("ambientOcclusionEnabled")??!1}set ambientOcclusionEnabled(t){e_(m$,"ambientOcclusionEnabled",{replacement:"ambient occlusion is automatically shown and this property has no effect",version:"4.27"}),this._set("ambientOcclusionEnabled",t)}get waterReflectionEnabled(){return e_(m$,"waterReflectionEnabled",{replacement:"water reflections are automatically shown and this property has no effect",version:"4.27"}),this._get("waterReflectionEnabled")??!1}set waterReflectionEnabled(t){e_(m$,"waterReflectionEnabled",{replacement:"water reflections are automatically shown and this property has no effect",version:"4.27"}),this._set("waterReflectionEnabled",t)}clone(){return new CD({...this.cloneConstructProperties(),cameraTrackingEnabled:this.cameraTrackingEnabled})}static fromWebsceneLighting(t){return new CD(t.cloneConstructProperties())}cloneWithWebsceneLighting(t){const e=this.clone();return e.directShadowsEnabled=t.directShadowsEnabled,e}cloneNonPersistentConstructProperties(){return{cameraTrackingEnabled:this.cameraTrackingEnabled}}};h([f({type:Boolean})],b2.prototype,"ambientOcclusionEnabled",null),h([f({type:Boolean})],b2.prototype,"waterReflectionEnabled",null),h([f({type:Boolean})],b2.prototype,"cameraTrackingEnabled",void 0),b2=CD=h([N(Lwe)],b2);const G3=b2,tHe={key:"type",defaultKeyValue:"sun",base:null,typeMap:{sun:_y,virtual:G3}};var nj;let tO=nj=class extends xe{set quality(t){["low","high"].includes(t)&&this._set("quality",t)}clone(){return new nj({quality:this.quality})}};h([f({type:["low","high"],value:"low"})],tO.prototype,"quality",null),tO=nj=h([N("esri.views.3d.environment.SceneViewAtmosphere")],tO);var sj;let j3=sj=class extends ke{constructor(t){super(t),this.type="sunny",this.cloudCover=.5}clone(){return new sj({cloudCover:this.cloudCover})}};h([Vt({sunny:"sunny"})],j3.prototype,"type",void 0),h([f({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],j3.prototype,"cloudCover",void 0),j3=sj=h([N("esri.views.3d.environment.SunnyWeather")],j3);const Q4=j3;var oj;let H3=oj=class extends ke{constructor(t){super(t),this.type="cloudy",this.cloudCover=.5}clone(){return new oj({cloudCover:this.cloudCover})}};h([Vt({cloudy:"cloudy"})],H3.prototype,"type",void 0),h([f({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],H3.prototype,"cloudCover",void 0),H3=oj=h([N("esri.views.3d.environment.CloudyWeather")],H3);const Dwe=H3;var aj;let W3=aj=class extends ke{constructor(t){super(t),this.type="foggy",this.fogStrength=.5}clone(){return new aj({fogStrength:this.fogStrength})}};h([Vt({foggy:"foggy"})],W3.prototype,"type",void 0),h([f({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],W3.prototype,"fogStrength",void 0),W3=aj=h([N("esri.views.3d.environment.FoggyWeather")],W3);const Nwe=W3;var lj;let w2=lj=class extends ke{constructor(t){super(t),this.type="rainy",this.cloudCover=.5,this.precipitation=.5}clone(){return new lj({cloudCover:this.cloudCover,precipitation:this.precipitation})}};h([Vt({rainy:"rainy"})],w2.prototype,"type",void 0),h([f({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],w2.prototype,"cloudCover",void 0),h([f({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],w2.prototype,"precipitation",void 0),w2=lj=h([N("esri.views.3d.environment.RainyWeather")],w2);const Fwe=w2;var cj;let Ev=cj=class extends ke{constructor(t){super(t),this.type="snowy",this.cloudCover=.5,this.precipitation=.5,this.snowCover="disabled"}clone(){return new cj({cloudCover:this.cloudCover,precipitation:this.precipitation,snowCover:this.snowCover})}};h([Vt({snowy:"snowy"})],Ev.prototype,"type",void 0),h([f({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Ev.prototype,"cloudCover",void 0),h([f({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Ev.prototype,"precipitation",void 0),h([f({type:["enabled","disabled"],nonNullable:!0,json:{write:!0}})],Ev.prototype,"snowCover",void 0),Ev=cj=h([N("esri.views.3d.environment.SnowyWeather")],Ev);const Uwe=Ev,kwe={key:"type",base:Q4,typeMap:{sunny:Q4,cloudy:Dwe,rainy:Fwe,snowy:Uwe,foggy:Nwe}},rHe=Object.keys(kwe.typeMap);function iHe(t,e){return!!rHe.includes(t)||(e.error(`"${t}" is not a valid weather type`),!1)}const yf=1e4,nHe={key:"type",defaultKeyValue:"sun",base:null,typeMap:{sun:bR,virtual:Z6}};let AD=class extends ke{constructor(e){super(e)}clone(){}};h([f({readOnly:!0,json:{read:!1}})],AD.prototype,"type",void 0),AD=h([N("esri.webscene.background.Background")],AD);const zwe=AD;var uj;const sHe={...Jg,nonNullable:!0};let q3=uj=class extends zwe{constructor(t){super(t),this.type="color",this.color=new it([0,0,0,1])}clone(){return new uj(this.cloneProperties())}cloneProperties(){return{color:this.color.clone()}}};h([Vt({color:"color"},{readOnly:!0})],q3.prototype,"type",void 0),h([f(sHe)],q3.prototype,"color",void 0),q3=uj=h([N("esri.webscene.background.ColorBackground")],q3);const Bwe=q3,ane={base:zwe,key:"type",typeMap:{color:Bwe}};function oHe(t){return(e,r,i)=>{if(!e)return e;for(const n in t.typeMap)if(e.type===n){const s=new t.typeMap[n];return s.read(e,i),s}}}const aHe={types:ane,json:{read:oHe(ane),write:{overridePolicy:(t,e,r)=>({enabled:!r||!r.isPresentation})}}};var hj;const Vwe="esri.webscene.Environment",lHe=J.getLogger(Vwe),lne=(t,e,r)=>({enabled:!r||!r.isPresentation});let vy=hj=class extends ke{constructor(t){super(t),this.lighting=new bR,this.background=null,this.atmosphereEnabled=!0,this.starsEnabled=!0}set weather(t){iHe(t==null?void 0:t.type,lHe)&&this._set("weather",t)}clone(){return new hj(this.cloneConstructProperties())}cloneConstructProperties(){return{lighting:this.lighting&&this.lighting.type==="virtual"?Z6.prototype.clone.call(this.lighting):bR.prototype.clone.call(this.lighting),background:ye(this.background),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,weather:this.weather.clone()}}};h([f({types:nHe,nonNullable:!0,json:{write:!0}})],vy.prototype,"lighting",void 0),h([f(aHe)],vy.prototype,"background",void 0),h([f({type:Boolean,nonNullable:!0,json:{write:{overridePolicy:lne}}})],vy.prototype,"atmosphereEnabled",void 0),h([f({type:Boolean,nonNullable:!0,json:{write:{overridePolicy:lne}}})],vy.prototype,"starsEnabled",void 0),h([f({types:kwe,nonNullable:!0,json:{write:!0},value:new Q4})],vy.prototype,"weather",null),vy=hj=h([N(Vwe)],vy);const Gwe=vy;var X3;let x2=X3=class extends Gwe{constructor(t){super(t),this.atmosphere=new tO,this.lighting=new _y,this.cachedCameraTrackingEnabled=null}static fromWebsceneEnvironment(t){const e=t.cloneConstructProperties();return new X3({...e,lighting:e.lighting?e.lighting.type==="virtual"?G3.fromWebsceneLighting(e.lighting):_y.fromWebsceneLighting(e.lighting):void 0})}castLighting(t){return this._convertLighting(t)}applyLighting(t){this.lighting=this._convertLighting(t)}_convertLighting(t){var e,r;return t?t instanceof _y||t instanceof G3?t:t instanceof bR?this.lighting&&this.lighting.type!=="virtual"?this.lighting.cloneWithWebsceneLighting(t):new _y({...t.cloneConstructProperties(),...(e=this.lighting)==null?void 0:e.cloneNonPersistentConstructProperties()}):t instanceof Z6?this.lighting&&this.lighting.type==="virtual"?this.lighting.cloneWithWebsceneLighting(t):new G3({...t.cloneConstructProperties(),...(r=this.lighting)==null?void 0:r.cloneNonPersistentConstructProperties()}):L_(tHe,t):new _y}clone(){return new X3({lighting:this.lighting.clone(),atmosphere:this.atmosphere.clone(),weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:ye(this.background)})}cloneWithWebsceneEnvironment(t){return new X3({atmosphere:this.atmosphere.clone(),weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:ye(this.background),...t.cloneConstructProperties(),lighting:this._getLighting(t)})}_getLighting(t){switch(t.lighting.type){case"sun":return this.lighting&&this.lighting.type==="sun"?this.lighting.cloneWithWebsceneLighting(t.lighting):_y.fromWebsceneLighting(t.lighting);case"virtual":return this.lighting&&this.lighting.type==="virtual"?this.lighting.cloneWithWebsceneLighting(t.lighting):G3.fromWebsceneLighting(t.lighting);default:return t.lighting,_y.fromWebsceneLighting(t.lighting)}}};h([f({type:tO,json:{read:!1},nonNullable:!0})],x2.prototype,"atmosphere",void 0),h([f({nonNullable:!0})],x2.prototype,"lighting",void 0),h([_i("lighting")],x2.prototype,"castLighting",null),x2=X3=h([N("esri.views.3d.environment.SceneViewEnvironment")],x2);const T2=x2;var ra;(function(t){t[t.Realistic=0]="Realistic",t[t.Local=1]="Local",t[t.Mars=2]="Mars",t[t.None=3]="None"})(ra||(ra={}));function fs(t,e){return t[0]=e[0],t[1]=e[1],t}function er(t,e,r){return t[0]=e,t[1]=r,t}function Ld(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function Tf(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function UZ(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function jwe(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function cHe(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function uHe(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function hHe(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function dHe(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function pHe(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function dc(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function fHe(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t}function cw(t,e){const r=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(r*r+i*i)}function J4(t,e){const r=e[0]-t[0],i=e[1]-t[1];return r*r+i*i}function kZ(t){const e=t[0],r=t[1];return Math.sqrt(e*e+r*r)}function Hwe(t){const e=t[0],r=t[1];return e*e+r*r}function zZ(t,e){return t[0]=-e[0],t[1]=-e[1],t}function Wwe(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function wR(t,e){const r=e[0],i=e[1];let n=r*r+i*i;return n>0&&(n=1/Math.sqrt(n),t[0]=e[0]*n,t[1]=e[1]*n),t}function es(t,e){return t[0]*e[0]+t[1]*e[1]}function mHe(t,e,r){const i=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=i,t}function lh(t,e,r,i){const n=e[0],s=e[1];return t[0]=n+i*(r[0]-n),t[1]=s+i*(r[1]-s),t}function gHe(t,e){e=e||1;const r=2*mP()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function qwe(t,e,r){const i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n,t[1]=r[1]*i+r[3]*n,t}function Cv(t,e,r){const i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n+r[4],t[1]=r[1]*i+r[3]*n+r[5],t}function yHe(t,e,r){const i=e[0],n=e[1];return t[0]=r[0]*i+r[3]*n+r[6],t[1]=r[1]*i+r[4]*n+r[7],t}function _He(t,e,r){const i=e[0],n=e[1];return t[0]=r[0]*i+r[4]*n+r[12],t[1]=r[1]*i+r[5]*n+r[13],t}function vHe(t,e,r,i){const n=e[0]-r[0],s=e[1]-r[1],o=Math.sin(i),a=Math.cos(i);return t[0]=n*a-s*o+r[0],t[1]=n*o+s*a+r[1],t}function bHe(t,e){const r=t[0],i=t[1],n=e[0],s=e[1];let o=r*r+i*i;o>0&&(o=1/Math.sqrt(o));let a=n*n+s*s;a>0&&(a=1/Math.sqrt(a));const l=(r*n+i*s)*o*a;return l>1?0:l<-1?Math.PI:Math.acos(l)}function wHe(t){return"vec2("+t[0]+", "+t[1]+")"}function Xwe(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ywe(t,e){const r=t[0],i=t[1],n=e[0],s=e[1],o=tl();return Math.abs(r-n)<=o*Math.max(1,Math.abs(r),Math.abs(n))&&Math.abs(i-s)<=o*Math.max(1,Math.abs(i),Math.abs(s))}function xHe(t,e,r,i,n){let s=e[0]-r[0],o=e[1]-r[1];const a=(i[0]*s+i[1]*o)*(n-1);return s=i[0]*a,o=i[1]*a,t[0]=e[0]+s,t[1]=e[1]+o,t}const THe=kZ,Zwe=Tf,SHe=UZ,EHe=jwe,Qwe=cw,CHe=J4,AHe=Hwe;Object.freeze(Object.defineProperty({__proto__:null,add:Ld,angle:bHe,ceil:cHe,copy:fs,cross:mHe,dist:Qwe,distance:cw,div:EHe,divide:jwe,dot:es,equals:Ywe,exactEquals:Xwe,floor:uHe,inverse:Wwe,len:THe,length:kZ,lerp:lh,max:dHe,min:hHe,mul:SHe,multiply:UZ,negate:zZ,normalize:wR,projectAndScale:xHe,random:gHe,rotate:vHe,round:pHe,scale:dc,scaleAndAdd:fHe,set:er,sqrDist:CHe,sqrLen:AHe,squaredDistance:J4,squaredLength:Hwe,str:wHe,sub:Zwe,subtract:Tf,transformMat2:qwe,transformMat2d:Cv,transformMat3:yHe,transformMat4:_He},Symbol.toStringTag,{value:"Module"}));function BZ(t){return ge((t-1e5)/(1e6-1e5),0,1)}const dj=1e4,OHe=.085,$y=1e5;let RHe=class{};const Wr=RHe;function w(t,...e){let r="";for(let i=0;ii.setUniform3fv(e,r(n,s)))}};function r0(t){t.uniforms.add(new Lt("mainLightDirection",(e,r)=>r.lighting.mainLight.direction))}function lm(t){t.uniforms.add(new Lt("mainLightIntensity",(e,r)=>r.lighting.mainLight.intensity))}function K4(t){r0(t.fragment),lm(t.fragment),t.fragment.code.add(w`vec3 evaluateMainLighting(vec3 normal_global, float shadowing) { +float dotVal = clamp(dot(normal_global, mainLightDirection), 0.0, 1.0); +return mainLightIntensity * ((1.0 - shadowing) * dotVal); +}`)}let yr=class extends ln{constructor(e,r){super(e,"vec2",jr.Pass,(i,n,s)=>i.setUniform2fv(e,r(n,s)))}},Jt=class extends ln{constructor(e,r){super(e,"vec4",jr.Pass,(i,n,s)=>i.setUniform4fv(e,r(n,s)))}},Ce=class extends ln{constructor(e,r){super(e,"float",jr.Pass,(i,n,s)=>i.setUniform1f(e,r(n,s)))}},Mi=class extends ln{constructor(e,r){super(e,"mat4",jr.Pass,(i,n,s)=>i.setUniformMatrix4fv(e,r(n,s)))}};const Ea=Qt();let PHe=class{constructor(e){this.message=e}toString(){return`AssertException: ${this.message}`}};function Je(t,e){if(!t){e=e||"Assertion";const r=new Error(e).stack;throw new PHe(`${e} at ${r}`)}}function rx(t,e){t||(e=e||"",console.warn("Verify failed: "+e+` +`+new Error("verify").stack))}function cne(t,e,r,i){let n,s=(r[0]-t[0])/e[0],o=(i[0]-t[0])/e[0];s>o&&(n=s,s=o,o=n);let a=(r[1]-t[1])/e[1],l=(i[1]-t[1])/e[1];if(a>l&&(n=a,a=l,l=n),s>l||a>o)return!1;a>s&&(s=a),lu&&(n=c,c=u,u=n),!(s>u||c>o)&&(u2&&(n[2]=-Ea[2]),au(Ea,Ea,r),Je(Ea[3]!==0),n[0]=Ea[0]/Ea[3],n[1]=Ea[1]/Ea[3],n[2]=Ea[2]/Ea[3],n[0]=(.5*n[0]+.5)*i[2]+i[0],n[1]=(.5*n[1]+.5)*i[3]+i[1]}function MHe(t,e){return Math.log(t)/Math.log(e)}function $He(t,e,r,i){t[12]=e,t[13]=r,t[14]=i}function Jwe(t){return t[0]===1&&t[1]===0&&t[2]===0&&t[3]===0&&t[4]===0&&t[5]===1&&t[6]===0&&t[7]===0&&t[8]===0&&t[9]===0&&t[10]===1&&t[11]===0&&t[15]===1}const Kwe=J.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");let exe=class{constructor(){this._includedModules=new Map}include(e,r){if(this._includedModules.has(e)){const i=this._includedModules.get(e);if(i!==r){Kwe.error("Trying to include shader module multiple times with different sets of options.");const n=new Set;for(const s of Object.keys(i))i[s]!==e[s]&&n.add(s);for(const s of Object.keys(e))i[s]!==e[s]&&n.add(s);n.forEach(s=>console.error(` ${s}: current ${i[s]} new ${e[s]}`))}}else this._includedModules.set(e,r),e(this.builder,r)}},mr=class extends exe{constructor(){super(...arguments),this.vertex=new hne,this.fragment=new hne,this.attributes=new DHe,this.varyings=new NHe,this.extensions=new pj,this.constants=new txe}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const r=this.extensions.generateSource(e),i=this.attributes.generateSource(e),n=this.varyings.generateSource(e),s=e==="vertex"?this.vertex:this.fragment,o=s.uniforms.generateSource(),a=s.code.generateSource(),l=e==="vertex"?UHe:FHe,c=this.constants.generateSource().concat(s.constants.generateSource());return`#version 300 es +${r.join(` +`)} + +${l} + +${c.join(` +`)} + +${o.join(` +`)} + +${i.join(` +`)} + +${n.join(` +`)} + +${a.join(` +`)}`}generateBind(e,r){const i=new Map;this.vertex.uniforms.entries.forEach(o=>{const a=o.bind[e];a!=null&&i.set(o.name,a)}),this.fragment.uniforms.entries.forEach(o=>{const a=o.bind[e];a!=null&&i.set(o.name,a)});const n=Array.from(i.values()),s=n.length;return(o,a,l)=>{for(let c=0;ce.arraySize!=null?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`)}get entries(){return Array.from(this._entries.values())}},LHe=class{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}},hne=class extends exe{constructor(){super(...arguments),this.uniforms=new IHe,this.code=new LHe,this.constants=new txe}get builder(){return this}},DHe=class{constructor(){this._entries=new Array}add(e,r){this._entries.push([e,r])}generateSource(e){return e==="fragment"?[]:this._entries.map(r=>`in ${r[1]} ${r[0]};`)}},NHe=class{constructor(){this._entries=new Map}add(e,r){this._entries.has(e)&&Je(this._entries.get(e)===r),this._entries.set(e,r)}generateSource(e){const r=new Array;return this._entries.forEach((i,n)=>r.push(e==="vertex"?`out ${i} ${n};`:`in ${i} ${n};`)),r}},pj=class fj{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const r=e==="vertex"?fj.ALLOWLIST_VERTEX:fj.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(i=>r.includes(i)).map(i=>`#extension ${i} : enable`)}};pj.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],pj.ALLOWLIST_VERTEX=[];let txe=class Jn{constructor(){this._entries=new Set}add(e,r,i){let n="ERROR_CONSTRUCTOR_STRING";switch(r){case"float":n=Jn._numberToFloatStr(i);break;case"int":n=Jn._numberToIntStr(i);break;case"bool":n=i.toString();break;case"vec2":n=`vec2(${Jn._numberToFloatStr(i[0])}, ${Jn._numberToFloatStr(i[1])})`;break;case"vec3":n=`vec3(${Jn._numberToFloatStr(i[0])}, ${Jn._numberToFloatStr(i[1])}, ${Jn._numberToFloatStr(i[2])})`;break;case"vec4":n=`vec4(${Jn._numberToFloatStr(i[0])}, ${Jn._numberToFloatStr(i[1])}, ${Jn._numberToFloatStr(i[2])}, ${Jn._numberToFloatStr(i[3])})`;break;case"ivec2":n=`ivec2(${Jn._numberToIntStr(i[0])}, ${Jn._numberToIntStr(i[1])})`;break;case"ivec3":n=`ivec3(${Jn._numberToIntStr(i[0])}, ${Jn._numberToIntStr(i[1])}, ${Jn._numberToIntStr(i[2])})`;break;case"ivec4":n=`ivec4(${Jn._numberToIntStr(i[0])}, ${Jn._numberToIntStr(i[1])}, ${Jn._numberToIntStr(i[2])}, ${Jn._numberToIntStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":n=`${r}(${Array.prototype.map.call(i,s=>Jn._numberToFloatStr(s)).join(", ")})`}return this._entries.add(`const ${r} ${e} = ${n};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}};const FHe=`#ifdef GL_FRAGMENT_PRECISION_HIGH + precision highp float; + precision highp sampler2D; +#else + precision mediump float; + precision mediump sampler2D; +#endif + +out vec4 fragColor;`,UHe=`precision highp float; +precision highp sampler2D;`;let Ye=class extends ln{constructor(e,r){super(e,"sampler2D",jr.Pass,(i,n,s)=>i.bindTexture(e,r(n,s)))}};const rO=Se(parseFloat(5802e-9.toFixed(6)),parseFloat(13558e-9.toFixed(6)),parseFloat(331e-7.toFixed(6))),Ik=3,Lk=Se(Ik*parseFloat(65e-8.toFixed(6)),Ik*parseFloat(1881e-9.toFixed(6)),Ik*parseFloat(85e-9.toFixed(6))),kHe=3996e-9,zHe=Se(parseFloat(Number(rO[0]+Lk[0]).toFixed(6)),parseFloat(Number(rO[1]+Lk[1]).toFixed(6)),parseFloat(Number(rO[2]+Lk[2]).toFixed(6)));function BHe(t){const e=new mr;e.attributes.add(E.POSITION,"vec2"),e.include(Uf,{textureCoordinateType:Pn.Default}),e.varyings.add("worldRay","vec3"),e.varyings.add("eyeDir","vec3");const{vertex:r,fragment:i}=e;return r.uniforms.add(new Mi("inverseProjectionMatrix",(n,s)=>s.camera.inverseProjectionMatrix),new Mi("inverseViewMatrix",(n,s)=>wE(VHe,s.camera.viewMatrix))),r.code.add(w`void main(void) { +vec3 posViewNear = (inverseProjectionMatrix * vec4(position, -1, 1)).xyz; +eyeDir = posViewNear; +worldRay = (inverseViewMatrix * vec4(posViewNear, 0)).xyz; +forwardTextureCoordinates(); +gl_Position = vec4(position, 1, 1); +}`),i.uniforms.add(new Lt("backgroundColor",n=>n.backgroundColor),new yr("radii",n=>n.radii),new Lt("cameraPosition",(n,s)=>s.camera.eye),new Jt("heightParameters",n=>n.heightParameters),new Ce("innerFadeDistance",n=>n.innerFadeDistance),new Ce("altitudeFade",n=>n.altitudeFade),new Ye("depthTexture",n=>n.depthTexture),new Ce("hazeStrength",n=>n.hazeStrength)),i.constants.add("betaRayleigh","vec3",rO),i.constants.add("betaCombined","vec3",zHe),i.constants.add("betaMie","float",kHe),i.constants.add("scaleHeight","float",OHe*$y),r0(i),e.include(Q6),t.haze&&(i.include(wu),i.uniforms.add(new yr("nearFar",(n,s)=>s.camera.nearFar))),i.code.add(w`vec2 sphereIntersect(vec3 start, vec3 dir, float radius, bool planet) { +float a = dot(dir, dir); +float b = 2.0 * dot(dir, start); +float c = planet ? heightParameters[1] - radius * radius : heightParameters[2]; +float d = (b * b) - 4.0 * a * c; +if (d < 0.0) { +return vec2(1e5, -1e5); +} +return vec2((-b - sqrt(d)) / (2.0 * a), (-b + sqrt(d)) / (2.0 * a)); +}`),i.code.add(w`float chapmanApproximation(float X, float h, float cosZenith) { +float c = sqrt(X + h); +float cExpH = c * exp(-h); +if (cosZenith >= 0.0) { +return cExpH / (c * cosZenith + 1.0); +} else { +float x0 = sqrt(1.0 - cosZenith * cosZenith) * (X + h); +float c0 = sqrt(x0); +return 2.0 * c0 * exp(X - x0) - cExpH / (1.0 - c * cosZenith); +} +}`),i.code.add(w`float getOpticalDepth(vec3 position, vec3 dir, float h) { +return scaleHeight * chapmanApproximation(radii[0] / scaleHeight, h, dot(normalize(position), dir)); +}`),i.code.add(w` + const int STEPS = 6; + + vec3 getAtmosphereColour(vec3 cameraPos, vec3 rayDir, vec3 lightDir, float terrainDepth) { + float reducedPlanetRadius = radii[0] - 20000.0; + vec2 rayPlanetIntersect = sphereIntersect(cameraPos, rayDir, reducedPlanetRadius, true); + vec2 rayAtmosphereIntersect = sphereIntersect(cameraPos, rayDir, radii[1], false); + bool hitsAtmosphere = (rayAtmosphereIntersect.x <= rayAtmosphereIntersect.y) && rayAtmosphereIntersect.x > 0.0; + bool insideAtmosphere = heightParameters[0] < radii[1]; + + if (!(hitsAtmosphere || insideAtmosphere)) { + return vec3(0); + } + + bool hitsPlanet = (rayPlanetIntersect.x <= rayPlanetIntersect.y) && rayPlanetIntersect.x > 0.0; + + float start = insideAtmosphere ? 0.0 : rayAtmosphereIntersect.x; + + if (heightParameters[0] < reducedPlanetRadius) { + // Long light rays from the night side of the planet lead to numerical instability + // Do not render the atmosphere in such cases + if (dot(rayDir, normalize(cameraPos)) < -0.025) { + return vec3(0); + } + start = rayPlanetIntersect.y; + } + + float end = hitsPlanet ? rayPlanetIntersect.x : rayAtmosphereIntersect.y; + float maxEnd = end; + + ${t.haze?w`if (terrainDepth != -1.0) { end = terrainDepth; }`:""} + + vec3 samplePoint = cameraPos + rayDir * end; + float multiplier = hitsPlanet ? -1.0 : 1.0; + + vec3 scattering = vec3(0); + float scaleFract = (length(samplePoint) - radii[0]) / scaleHeight; + float lastOpticalDepth = getOpticalDepth(samplePoint, rayDir, scaleFract); + float stepSize = (end - start) / float(STEPS); + for (int i = 0; i < STEPS; i++) { + samplePoint -= stepSize * rayDir; + scaleFract = (length(samplePoint) - radii[0]) / scaleHeight; + float opticalDepth = multiplier * getOpticalDepth(samplePoint, rayDir * multiplier, scaleFract); + + if (i > 0) { + scattering *= ${t.haze?"":w`mix(2.5, 1.0, clamp((length(cameraPos) - radii[0]) / 50e3, 0.0, 1.0)) * `} exp(-(mix(betaCombined, betaRayleigh, 0.5) + betaMie) * max(0.0, (opticalDepth - lastOpticalDepth))); + } + + if (dot(normalize(samplePoint), lightDir) > -0.3) { + + float scale = exp(-scaleFract); + float lightDepth = getOpticalDepth(samplePoint, lightDir, scaleFract); + + scattering += scale * exp(-(betaCombined + betaMie) * lightDepth); + ${t.haze?"":w`scattering += scale * exp(-(0.25 * betaCombined ) * lightDepth);`} + } + + lastOpticalDepth = opticalDepth; + + } + + float mu = dot(rayDir, lightDir); + float mumu = 1.0 + mu * mu; + + float phaseRayleigh = 0.0596831 * mumu; + + ${t.haze?w`return 3.0 * scattering * stepSize * phaseRayleigh * betaRayleigh;`:w` + const float g = 0.8; + const float gg = g * g; + float phaseMie = end == maxEnd ? 0.1193662 * ((1.0 - gg) * mumu) / (pow(1.0 + gg - 2.0 * mu * g, 1.5) * (2.0 + gg)) : 0.0; + phaseMie = clamp(phaseMie, 0.0, 128.0); + return 3.0 * scattering * stepSize * (phaseRayleigh * betaRayleigh + 0.025 * phaseMie * betaMie);`} + } + + ${t.haze?"":w` + vec4 applyUndergroundAtmosphere(vec3 rayDir, vec3 lightDirection, vec4 fragColor) { + vec2 rayPlanetIntersect = sphereIntersect(cameraPosition, rayDir, radii[0], true); + if (!((rayPlanetIntersect.x <= rayPlanetIntersect.y) && rayPlanetIntersect.y > 0.0)) { + return fragColor; + } + + float lightAngle = dot(lightDirection, normalize(cameraPosition + rayDir * max(0.0, rayPlanetIntersect.x))); + vec4 surfaceColor = vec4(vec3(max(0.0, (smoothstep(-1.0, 0.8, 2.0 * lightAngle)))), 1.0 - altitudeFade); + float relDist = (rayPlanetIntersect.y - max(0.0, rayPlanetIntersect.x)) / innerFadeDistance; + if (relDist > 1.0) { + return surfaceColor; + } + + return mix(fragColor, surfaceColor, smoothstep(0.0, 1.0, relDist * relDist)); + } + + float getGlow(float dist, float radius, float intensity) { + return pow(radius / max(dist, 1e-6), intensity); + } + + vec3 getSun(vec3 cameraPos, vec3 rayDir, vec3 lightDir){ + + // Get the amount of atmosphere between camera and the Sun along the view ray + float scaleFract = (length(cameraPos) - radii[0]) / scaleHeight; + float sunOpticalDepth = getOpticalDepth(cameraPos, rayDir, max(scaleFract, 0.0)); + + // Find the amount of light that remains after travelling through the atmosphere from the Sun along the view ray + // This will make the colour of the Sun reddish on the horizon and white from space + vec3 sunTransmittance = exp(-(mix(betaCombined, betaRayleigh, 0.5)) * max(0.0, sunOpticalDepth)); + + // Alignment of light direction and view ray + float mu = clamp(dot(rayDir, lightDir), 0.0, 1.0); + // Draw the Sun as a bright disc + float sunDisc = 256.0 * smoothstep(0.0, 128.0, clamp(getGlow(1.0 - mu, 3e-5, 3.0), 0.0, 128.0)); + + return normalize(sunTransmittance) * sunDisc; + }`} + + ${t.haze&&t.reduced?w` + float getDepth(vec2 uv){ + return linearDepthFromTexture(depthTexture, uv, nearFar); + } + + float textureBilinear(vec2 uv) { + // Information about the high-resolution depth texture + vec2 depthTextureSize = vec2(textureSize(depthTexture, 0)); + vec2 texelSize = 1.0 / depthTextureSize; + + // The uv inside the upper right pixel - of the tile of 4 pixels - + // that the atmosphere uv maps to in the depth texture + vec2 depthUV = (uv * depthTextureSize) - vec2(0.5); + + // Relative distance of the uv coordinates inside the depth texture pixel + vec2 f = fract(depthUV); + + // Snap to the centre of the depth texture pixel + vec2 snapUV = (floor(depthUV) + vec2(0.5)) / depthTextureSize; + + // Read the depth texture pixel and its three neighbours + float d0 = getDepth(snapUV); + float d1 = getDepth(snapUV + vec2(texelSize.x, 0.0)); + float d2 = getDepth(snapUV + vec2(0.0, texelSize.y)); + float d3 = getDepth(snapUV + texelSize); + + // Return the bilinearly interpolated value of the neighbouring pixels based + // on the sample position in the depth texture pixel + return mix(mix(d0, d1, f.x), mix(d2, d3, f.x), f.y); + } + `:""} + + vec3 tonemapACES(vec3 x) { + return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0); + } + + void main() { + vec3 rayDir = normalize(worldRay); + float terrainDepth = -1.0; + ${t.haze?w` + vec4 depthSample = texture(depthTexture, vuv0).rgba; + if (depthSample != vec4(0)) { + vec3 cameraSpaceRay = normalize(eyeDir); + cameraSpaceRay /= cameraSpaceRay.z; + + ${t.reduced?w`cameraSpaceRay *= -textureBilinear(vuv0);`:w`cameraSpaceRay *= -linearDepthFromTexture(depthTexture, vuv0, nearFar);`} + + terrainDepth = max(0.0, length(cameraSpaceRay)); + }else{ + discard; + } + `:w`${t.reduced?"":w` + float depthSample = texture(depthTexture, vuv0).r; + if (depthSample != 1.0) { + fragColor = vec4(0); + return; + }`}`} + + ${t.haze?w` + vec3 col = vec3(0); + float fadeOut = smoothstep(-10000.0, -15000.0, heightParameters[0] - radii[0]); + if(depthSample != vec4(0)){ + col = (1.0 - fadeOut) * hazeStrength * getAtmosphereColour(cameraPosition, rayDir, mainLightDirection, terrainDepth); + } + // Alpha is ignored for haze blending + float alpha = 1.0; + `:w` + vec3 col = linearizeGamma(backgroundColor); + col += getAtmosphereColour(cameraPosition, rayDir, mainLightDirection, terrainDepth); + col += getSun(cameraPosition, rayDir, mainLightDirection); + float alpha = smoothstep(0.0, mix(0.15, 0.01, heightParameters[3]), length(col));`} + + col = tonemapACES(col); + fragColor = delinearizeGamma(vec4(col, alpha)); + ${t.haze?"":w`fragColor = applyUndergroundAtmosphere(rayDir, mainLightDirection, fragColor);`} + } + `),e}const VHe=_e(),GHe=Object.freeze(Object.defineProperty({__proto__:null,betaRayleigh:rO,build:BHe},Symbol.toStringTag,{value:"Module"}));let _r=class{constructor(e,r){this._module=e,this._loadModule=r}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}};var yi,Et,ve,Zf,bt,qd,NS,Qe,Hr,_n,At,Pt,nn,Tt,qe,Un,jn,gr,tu,mo;(function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT"})(yi||(yi={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(Et||(Et={})),function(t){t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"}(ve||(ve={})),function(t){t[t.ADD=32774]="ADD",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX",t[t.SUBTRACT=32778]="SUBTRACT",t[t.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"}(Zf||(Zf={})),function(t){t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER"}(bt||(bt={})),function(t){t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(qd||(qd={})),function(t){t[t.CW=2304]="CW",t[t.CCW=2305]="CCW"}(NS||(NS={})),function(t){t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT"}(Qe||(Qe={})),function(t){t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS"}(Hr||(Hr={})),function(t){t[t.ZERO=0]="ZERO",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP"}(_n||(_n={})),function(t){t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(At||(At={})),function(t){t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(Pt||(Pt={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"}(nn||(nn={})),function(t){t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.RED=6403]="RED",t[t.RG=33319]="RG",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER"}(Tt||(Tt={})),function(t){t[t.RGBA4=32854]="RGBA4",t[t.R16F=33325]="R16F",t[t.RG16F=33327]="RG16F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.R32F=33326]="R32F",t[t.RG32F=33328]="RG32F",t[t.RGBA32F=34836]="RGBA32F",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB5_A1=32855]="RGB5_A1",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.RGB16F=34843]="RGB16F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.RGB565=36194]="RGB565",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2=32857]="RGB10_A2",t[t.RGB10_A2UI=36975]="RGB10_A2UI"}(qe||(qe={})),function(t){t[t.FLOAT=5126]="FLOAT",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.INT=5124]="INT",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"}(Un||(Un={})),function(t){t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(jn||(jn={})),function(t){t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_READ=35045]="STATIC_READ",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.STREAM_COPY=35042]="STREAM_COPY"}(gr||(gr={})),function(t){t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER"}(tu||(tu={})),function(t){t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"}(mo||(mo={}));const Dk=33984;var Es,qc;(function(t){t[t.Texture=0]="Texture",t[t.BufferObject=1]="BufferObject",t[t.VertexArrayObject=2]="VertexArrayObject",t[t.Shader=3]="Shader",t[t.Program=4]="Program",t[t.FramebufferObject=5]="FramebufferObject",t[t.Renderbuffer=6]="Renderbuffer",t[t.Sync=7]="Sync",t[t.COUNT=8]="COUNT"})(Es||(Es={})),function(t){t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15"}(qc||(qc={}));const dne=33306;var un,pne,fne,mne,e5,mj,gne;(function(t){t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"})(un||(un={})),function(t){t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT=5124]="INT",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"}(pne||(pne={})),function(t){t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS"}(fne||(fne={})),function(t){t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED"}(mne||(mne={})),function(t){t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED"}(e5||(e5={})),function(t){t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"}(mj||(mj={})),function(t){t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"}(gne||(gne={}));let Tr=class{constructor(e,r,i){this.release=i,this.initializeConfiguration(e,r),this._configuration=r.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}destroy(){this._program=Le(this._program),this._pipeline=this._configuration=null}reload(e){Le(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}bindPipelineState(e,r=null,i){e.setPipelineState(this.getPipelineState(r,i))}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return Et.TRIANGLES}getPipelineState(e,r){return this._pipeline}initializeConfiguration(e,r){}};const fr=new Map([[E.POSITION,0],[E.NORMAL,1],[E.NORMALCOMPRESSED,1],[E.UV0,2],[E.COLOR,3],[E.COLORFEATUREATTRIBUTE,3],[E.SIZE,4],[E.TANGENT,4],[E.AUXPOS1,5],[E.SYMBOLCOLOR,5],[E.AUXPOS2,6],[E.FEATUREATTRIBUTE,6],[E.INSTANCEFEATUREATTRIBUTE,6],[E.INSTANCECOLOR,7],[E.OBJECTANDLAYERIDCOLOR,7],[E.INSTANCEOBJECTANDLAYERIDCOLOR,7],[E.MODEL,8],[E.MODELNORMAL,12],[E.MODELORIGINHI,11],[E.MODELORIGINLO,15]]),jHe=J.getLogger("esri.views.webgl.checkWebGLError");function HHe(t,e){switch(e){case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const rxe=!!se("enable-feature:webgl-debug");function eh(){return rxe}function gj(){return rxe}function Gy(t){if(eh()){const e=t.getError();if(e){const r=HHe(t,e),i=new Error().stack;jHe.error(new Y("webgl-error","WebGL error occured",{message:r,stack:i}))}}}let vr=class{constructor(e,r,i){this._context=e,this._locations=i,this._textures=new Map,this._freeTextureUnits=new Nt({deallocator:null}),this._glProgram=e.programCache.acquire(r.generate("vertex"),r.generate("fragment"),i),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=r.generateBind(jr.Pass,this),this.bindDraw=r.generateBind(jr.Draw,this),this._fragmentUniforms=eh()?r.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get compiled(){return this._glProgram.compiled}setUniform1b(e,r){this._glProgram.setUniform1i(e,r?1:0)}setUniform1i(e,r){this._glProgram.setUniform1i(e,r)}setUniform1f(e,r){this._glProgram.setUniform1f(e,r)}setUniform2fv(e,r){this._glProgram.setUniform2fv(e,r)}setUniform3fv(e,r){this._glProgram.setUniform3fv(e,r)}setUniform4fv(e,r){this._glProgram.setUniform4fv(e,r)}setUniformMatrix3fv(e,r){this._glProgram.setUniformMatrix3fv(e,r)}setUniformMatrix4fv(e,r){this._glProgram.setUniformMatrix4fv(e,r)}setUniform1fv(e,r){this._glProgram.setUniform1fv(e,r)}setUniform1iv(e,r){this._glProgram.setUniform1iv(e,r)}setUniform2iv(e,r){this._glProgram.setUniform3iv(e,r)}setUniform3iv(e,r){this._glProgram.setUniform3iv(e,r)}setUniform4iv(e,r){this._glProgram.setUniform4iv(e,r)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,r){if(r==null||r.glName==null){const n=this._textures.get(e);return n&&(this._context.bindTexture(null,n.unit),this._freeTextureUnit(n),this._textures.delete(e)),null}let i=this._textures.get(e);return i==null?(i=this._allocTextureUnit(r),this._textures.set(e,i)):i.texture=r,this._context.useProgram(this),this.setUniform1i(e,i.unit),this._context.bindTexture(r,i.unit),i.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach((e,r)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(r,e.unit)}),this._fragmentUniforms!=null&&this._fragmentUniforms.forEach(e=>{e.type!=="sampler2D"&&e.type!=="samplerCube"||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)})}_allocTextureUnit(e){return{texture:e,unit:this._freeTextureUnits.length===0?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}};var ui,uw,dn,bg,Rl,Hg,FS,Gr,hw,wg;(function(t){t[t.None=0]="None",t[t.Front=1]="Front",t[t.Back=2]="Back",t[t.COUNT=3]="COUNT"})(ui||(ui={})),function(t){t[t.Less=0]="Less",t[t.Lequal=1]="Lequal",t[t.COUNT=2]="COUNT"}(uw||(uw={})),function(t){t[t.BACKGROUND=0]="BACKGROUND",t[t.UPDATE=1]="UPDATE"}(dn||(dn={})),function(t){t[t.NOT_LOADED=0]="NOT_LOADED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED"}(bg||(bg={})),function(t){t[t.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",t[t.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(Rl||(Rl={})),function(t){t[t.Highlight=0]="Highlight",t[t.MaskOccludee=1]="MaskOccludee",t[t.COUNT=2]="COUNT"}(Hg||(Hg={})),function(t){t[t.CHANGED=0]="CHANGED",t[t.UNCHANGED=1]="UNCHANGED"}(FS||(FS={})),function(t){t[t.Blend=0]="Blend",t[t.Opaque=1]="Opaque",t[t.Mask=2]="Mask",t[t.MaskBlend=3]="MaskBlend",t[t.COUNT=4]="COUNT"}(Gr||(Gr={})),function(t){t[t.OFF=0]="OFF",t[t.ON=1]="ON"}(hw||(hw={})),function(t){t.DDS_ENCODING="image/vnd-ms.dds",t.KTX2_ENCODING="image/ktx2",t.BASIS_ENCODING="image/x.basis"}(wg||(wg={}));function Cc(t,e,r=Zf.ADD,i=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function So(t,e,r,i,n=Zf.ADD,s=Zf.ADD,o=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:s,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}const VZ={face:qd.BACK,mode:NS.CCW},ixe={face:qd.FRONT,mode:NS.CCW},J6=t=>t===ui.Back?VZ:t===ui.Front?ixe:null,$l={zNear:0,zFar:1},Ft={r:!0,g:!0,b:!0,a:!0};function WHe(t){return eWe.intern(t)}function qHe(t){return tWe.intern(t)}function XHe(t){return rWe.intern(t)}function YHe(t){return iWe.intern(t)}function ZHe(t){return nWe.intern(t)}function QHe(t){return sWe.intern(t)}function JHe(t){return oWe.intern(t)}function KHe(t){return aWe.intern(t)}function Ot(t){return lWe.intern(t)}let i0=class{constructor(e,r){this._makeKey=e,this._makeRef=r,this._interns=new Map}intern(e){if(!e)return null;const r=this._makeKey(e),i=this._interns;return i.has(r)||i.set(r,this._makeRef(e)),i.get(r)??null}};function n0(t){return"["+t.join(",")+"]"}const eWe=new i0(nxe,t=>({__tag:"Blending",...t}));function nxe(t){return t?n0([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const tWe=new i0(sxe,t=>({__tag:"Culling",...t}));function sxe(t){return t?n0([t.face,t.mode]):null}const rWe=new i0(oxe,t=>({__tag:"PolygonOffset",...t}));function oxe(t){return t?n0([t.factor,t.units]):null}const iWe=new i0(axe,t=>({__tag:"DepthTest",...t}));function axe(t){return t?n0([t.func]):null}const nWe=new i0(lxe,t=>({__tag:"StencilTest",...t}));function lxe(t){return t?n0([t.function.func,t.function.ref,t.function.mask,t.operation.fail,t.operation.zFail,t.operation.zPass]):null}const sWe=new i0(cxe,t=>({__tag:"DepthWrite",...t}));function cxe(t){return t?n0([t.zNear,t.zFar]):null}const oWe=new i0(uxe,t=>({__tag:"ColorWrite",...t}));function uxe(t){return t?n0([t.r,t.g,t.b,t.a]):null}const aWe=new i0(hxe,t=>({__tag:"StencilWrite",...t}));function hxe(t){return t?n0([t.mask]):null}const lWe=new i0(cWe,t=>({blending:WHe(t.blending),culling:qHe(t.culling),polygonOffset:XHe(t.polygonOffset),depthTest:YHe(t.depthTest),stencilTest:ZHe(t.stencilTest),depthWrite:QHe(t.depthWrite),colorWrite:JHe(t.colorWrite),stencilWrite:KHe(t.stencilWrite)}));function cWe(t){return t?n0([nxe(t.blending),sxe(t.culling),oxe(t.polygonOffset),axe(t.depthTest),lxe(t.stencilTest),cxe(t.depthWrite),uxe(t.colorWrite),hxe(t.stencilWrite)]):null}let uWe=class{constructor(e){this._pipelineInvalid=!0,this._blendingInvalid=!0,this._cullingInvalid=!0,this._polygonOffsetInvalid=!0,this._depthTestInvalid=!0,this._stencilTestInvalid=!0,this._depthWriteInvalid=!0,this._colorWriteInvalid=!0,this._stencilWriteInvalid=!0,this._stateSetters=e}setPipeline(e){(this._pipelineInvalid||e!==this._pipeline)&&(this._setBlending(e.blending),this._setCulling(e.culling),this._setPolygonOffset(e.polygonOffset),this._setDepthTest(e.depthTest),this._setStencilTest(e.stencilTest),this._setDepthWrite(e.depthWrite),this._setColorWrite(e.colorWrite),this._setStencilWrite(e.stencilWrite),this._pipeline=e),this._pipelineInvalid=!1}invalidateBlending(){this._blendingInvalid=!0,this._pipelineInvalid=!0}invalidateCulling(){this._cullingInvalid=!0,this._pipelineInvalid=!0}invalidatePolygonOffset(){this._polygonOffsetInvalid=!0,this._pipelineInvalid=!0}invalidateDepthTest(){this._depthTestInvalid=!0,this._pipelineInvalid=!0}invalidateStencilTest(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDepthWrite(){this._depthWriteInvalid=!0,this._pipelineInvalid=!0}invalidateColorWrite(){this._colorWriteInvalid=!0,this._pipelineInvalid=!0}invalidateStencilWrite(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}_setBlending(e){this._blending=this._setSubState(e,this._blending,this._blendingInvalid,this._stateSetters.setBlending),this._blendingInvalid=!1}_setCulling(e){this._culling=this._setSubState(e,this._culling,this._cullingInvalid,this._stateSetters.setCulling),this._cullingInvalid=!1}_setPolygonOffset(e){this._polygonOffset=this._setSubState(e,this._polygonOffset,this._polygonOffsetInvalid,this._stateSetters.setPolygonOffset),this._polygonOffsetInvalid=!1}_setDepthTest(e){this._depthTest=this._setSubState(e,this._depthTest,this._depthTestInvalid,this._stateSetters.setDepthTest),this._depthTestInvalid=!1}_setStencilTest(e){this._stencilTest=this._setSubState(e,this._stencilTest,this._stencilTestInvalid,this._stateSetters.setStencilTest),this._stencilTestInvalid=!1}_setDepthWrite(e){this._depthWrite=this._setSubState(e,this._depthWrite,this._depthWriteInvalid,this._stateSetters.setDepthWrite),this._depthWriteInvalid=!1}_setColorWrite(e){this._colorWrite=this._setSubState(e,this._colorWrite,this._colorWriteInvalid,this._stateSetters.setColorWrite),this._colorWriteInvalid=!1}_setStencilWrite(e){this._stencilWrite=this._setSubState(e,this._stencilWrite,this._stencilWriteInvalid,this._stateSetters.setStencilWrite),this._stencilTestInvalid=!1}_setSubState(e,r,i,n){return(i||e!==r)&&(n(e),this._pipelineInvalid=!0),e}},hWe=class extends Wr{constructor(){super(...arguments),this.heightParameters=Qt(),this.radii=Ne(),this.innerFadeDistance=0,this.altitudeFade=0,this.hazeStrength=1,this.renderScale=Ne(),this.backgroundColor=O()}},Y3=class dxe extends Tr{initializeProgram(e){return new vr(e.rctx,dxe.shader.get().build(this.configuration),fr)}initializePipeline(){return this.configuration.reduced?Ot({blending:Cc(ve.ONE,ve.ZERO),depthTest:{func:Hr.ALWAYS},colorWrite:Ft}):this.configuration.haze?Ot({blending:So(ve.ONE,ve.ZERO,ve.ONE_MINUS_SRC_COLOR,ve.ONE),colorWrite:Ft}):Ot({blending:Cc(ve.SRC_ALPHA,ve.ONE_MINUS_SRC_ALPHA),depthTest:{func:Hr.LEQUAL},colorWrite:Ft})}};Y3.shader=new _r(GHe,()=>ce(()=>import("./ChapmanAtmosphere.glsl-badaea29.js"),[]));let va=class extends Wr{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map(()=>0):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,r={key:this.key};for(const i of e)r[i]=this[i];return r}};function U(t={}){return(e,r)=>{if(e._parameterNames=e._parameterNames??[],e._parameterNames.push(r),t.constValue!=null)Object.defineProperty(e,r,{get:()=>t.constValue});else{const i=e._parameterNames.length-1,n=t.count||2,s=Math.ceil(Math.log2(n)),o=e._parameterBits??[0];let a=0;for(;o[a]+s>16;)a++,a>=o.length&&o.push(0);e._parameterBits=o;const l=o[a],c=(1<0&&o&&o.vertexAttribDivisor(l,a.divisor);else if(a.count===9)for(let u=0;u<3;u++)s.vertexAttribPointer(l+u,3,a.type,a.normalized,a.stride,a.offset+12*u+c),s.enableVertexAttribArray(l+u),a.divisor>0&&o&&o.vertexAttribDivisor(l+u,a.divisor);else if(a.count===16)for(let u=0;u<4;u++)s.vertexAttribPointer(l+u,4,a.type,a.normalized,a.stride,a.offset+16*u+c),s.enableVertexAttribArray(l+u),a.divisor>0&&o&&o.vertexAttribDivisor(l+u,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count)}}function HZ(t,e,r,i){const n=t.gl,s=t.capabilities.instancing;t.bindBuffer(r);for(const o of i){const a=e.get(o.name);if(o.count<=4)n.disableVertexAttribArray(a),o.divisor&&o.divisor>0&&s&&s.vertexAttribDivisor(a,0);else if(o.count===9)for(let l=0;l<3;l++)n.disableVertexAttribArray(a+l),o.divisor&&o.divisor>0&&s&&s.vertexAttribDivisor(a+l,0);else if(o.count===16)for(let l=0;l<4;l++)n.disableVertexAttribArray(a+l),o.divisor&&o.divisor>0&&s&&s.vertexAttribDivisor(a+l,0);else console.error("Unsupported vertex attribute element count: "+o.count)}t.unbindBuffer(bt.ARRAY_BUFFER)}function WZ(t){switch(t){case Tt.ALPHA:case Tt.LUMINANCE:case Tt.RED:case Tt.RED_INTEGER:case qe.R8:case qe.R8I:case qe.R8UI:case qe.R8_SNORM:case jn.STENCIL_INDEX8:return 1;case Tt.LUMINANCE_ALPHA:case Tt.RG:case Tt.RG_INTEGER:case qe.RGBA4:case qe.R16F:case qe.R16I:case qe.R16UI:case qe.RG8:case qe.RG8I:case qe.RG8UI:case qe.RG8_SNORM:case qe.RGB565:case qe.RGB5_A1:case jn.DEPTH_COMPONENT16:return 2;case Tt.DEPTH_COMPONENT:case Tt.RGB:case Tt.RGB_INTEGER:case qe.RGB8:case qe.RGB8I:case qe.RGB8UI:case qe.RGB8_SNORM:case qe.SRGB8:case jn.DEPTH_COMPONENT24:return 3;case Tt.DEPTH_STENCIL:case Tt.DEPTH24_STENCIL8:case Tt.RGBA:case Tt.RGBA_INTEGER:case qe.RGBA8:case qe.R32F:case qe.R11F_G11F_B10F:case qe.RG16F:case qe.R32I:case qe.R32UI:case qe.RG16I:case qe.RG16UI:case qe.RGBA8I:case qe.RGBA8UI:case qe.RGBA8_SNORM:case qe.SRGB8_ALPHA8:case qe.RGB9_E5:case qe.RGB10_A2UI:case qe.RGB10_A2:case jn.DEPTH_STENCIL:case jn.DEPTH_COMPONENT32F:case jn.DEPTH24_STENCIL8:return 4;case jn.DEPTH32F_STENCIL8:return 5;case qe.RGB16F:case qe.RGB16I:case qe.RGB16UI:return 6;case qe.RG32F:case qe.RG32I:case qe.RG32UI:case qe.RGBA16F:case qe.RGBA16I:case qe.RGBA16UI:return 8;case qe.RGB32F:case qe.RGB32I:case qe.RGB32UI:return 12;case qe.RGBA32F:case qe.RGBA32I:case qe.RGBA32UI:return 16;case un.COMPRESSED_RGB_S3TC_DXT1_EXT:case un.COMPRESSED_RGBA_S3TC_DXT1_EXT:return .5;case un.COMPRESSED_RGBA_S3TC_DXT3_EXT:case un.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case un.COMPRESSED_R11_EAC:case un.COMPRESSED_SIGNED_R11_EAC:case un.COMPRESSED_RGB8_ETC2:case un.COMPRESSED_SRGB8_ETC2:case un.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case un.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return .5;case un.COMPRESSED_RG11_EAC:case un.COMPRESSED_SIGNED_RG11_EAC:case un.COMPRESSED_RGBA8_ETC2_EAC:case un.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}const ix=J.getLogger("esri.views.webgl.VertexArrayObject");let Fh=class{constructor(e,r,i,n,s=null){this._context=e,this._locations=r,this._layout=i,this._buffers=n,this._indexBuffer=s,this._glName=null,this._initialized=!1,e.instanceCounter.increment(Es.VertexArrayObject,this)}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Object.keys(this._buffers).reduce((e,r)=>e+this._buffers[r].byteLength,this._indexBuffer!=null?this._indexBuffer.byteLength:0)}get layout(){return this._layout}get locations(){return this._locations}get memoryEstimate(){return this.byteSize+(Object.keys(this._buffers).length+(this._indexBuffer?1:0))*ige}dispose(){var e;if(this._context){this._context.getBoundVAO()===this&&this._context.bindVAO(null);for(const r in this._buffers)(e=this._buffers[r])==null||e.dispose(),delete this._buffers[r];this._indexBuffer=Le(this._indexBuffer),this.disposeVAOOnly()}else(this._glName||Object.getOwnPropertyNames(this._buffers).length>0)&&ix.warn("Leaked WebGL VAO")}disposeVAOOnly(){var e,r;this._glName&&(((r=(e=this._context)==null?void 0:e.capabilities)==null?void 0:r.vao).deleteVertexArray(this._glName),this._glName=null),this._context.instanceCounter.decrement(Es.VertexArrayObject,this),this._context=lE(this._context)}initialize(){if(this._initialized)return;const e=this._context.capabilities.vao;if(e){const r=e.createVertexArray();e.bindVertexArray(r),this._bindLayout(),e.bindVertexArray(null),this._glName=r}this._initialized=!0}bind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:e,_layout:r,_indexBuffer:i}=this;e||ix.error("Vertex buffer dictionary is empty!");const n=this._context.gl;for(const s in e){const o=e[s];o||ix.error("Vertex buffer is uninitialized!");const a=r[s];a||ix.error("Vertex element descriptor is empty!"),jZ(this._context,this._locations,o,a)}i!=null&&(this._context.capabilities.vao?n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,i.glName):this._context.bindBuffer(i))}unbind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:e,_layout:r}=this;e||ix.error("Vertex buffer dictionary is empty!");for(const i in e){const n=e[i];n||ix.error("Vertex buffer is uninitialized!");const s=r[i];HZ(this._context,this._locations,n,s)}this._indexBuffer!=null&&this._context.unbindBuffer(this._indexBuffer.bufferType)}},vp=class extends Fh{};var rr;function yj(t,e,r={}){const i=e===rr.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];for(const n of i){const s=t.getContext(n,r);if(s)return s}return null}function pWe(t,e,r={}){const i=pxe(t);for(const n of i){const s=yj(e,n,r);if(s)return s}return null}function pxe(t){if(t==="3d")return[rr.WEBGL2];const e=se("esri-force-webgl");return e===rr.WEBGL1||e===rr.WEBGL2?[e]:se("mac")&&se("chrome")?[rr.WEBGL1,rr.WEBGL2]:[rr.WEBGL2,rr.WEBGL1]}(function(t){t[t.WEBGL1=1]="WEBGL1",t[t.WEBGL2=2]="WEBGL2"})(rr||(rr={}));const Rp=J.getLogger("esri.views.webgl.BufferObject");let Ar=class S2{static createIndex(e,r,i){return new S2(e,bt.ELEMENT_ARRAY_BUFFER,r,i)}static createVertex(e,r,i){return new S2(e,bt.ARRAY_BUFFER,r,i)}static createUniform(e,r,i){if(e.type!==rr.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new S2(e,bt.UNIFORM_BUFFER,r,i)}static createPixelPack(e,r=gr.STREAM_READ,i){if(e.type!==rr.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const n=new S2(e,bt.PIXEL_PACK_BUFFER,r);return i&&n.setSize(i),n}static createPixelUnpack(e,r=gr.STREAM_DRAW,i){if(e.type!==rr.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new S2(e,bt.PIXEL_UNPACK_BUFFER,r,i)}constructor(e,r,i,n){this._context=e,this.bufferType=r,this.usage=i,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(Es.BufferObject,this),this._glName=this._context.gl.createBuffer(),Gy(this._context.gl),n&&this.setData(n)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteLength(){return this.bufferType===bt.ELEMENT_ARRAY_BUFFER?this._indexType===Qe.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===bt.ELEMENT_ARRAY_BUFFER||this.bufferType===bt.ARRAY_BUFFER}dispose(){var e;(e=this._context)!=null&&e.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(Es.BufferObject,this),this._context=lE(this._context)):this._glName&&Rp.warn("Leaked WebGL buffer object")}setSize(e,r=null){if(e<=0&&Rp.error("Buffer size needs to be positive!"),this.bufferType===bt.ELEMENT_ARRAY_BUFFER&&r!=null)switch(this._indexType=r,r){case Qe.UNSIGNED_SHORT:e*=2;break;case Qe.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let r=e.byteLength;this.bufferType===bt.ELEMENT_ARRAY_BUFFER&&(WF(e)&&(r/=2,this._indexType=Qe.UNSIGNED_SHORT),qF(e)&&(r/=4,this._indexType=Qe.UNSIGNED_INT)),this._setBufferData(r,e)}_setBufferData(e,r=null){this._size=e;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;r!=null?n.bufferData(this.bufferType,r,this.usage):n.bufferData(this.bufferType,e,this.usage),Gy(n),this._isVAOAware&&this._context.bindVAO(i)}setSubData(e,r,i,n){if(!e)return;(r<0||r*e.BYTES_PER_ELEMENT>=this.byteLength)&&Rp.error("offset is out of range!"),i>=n&&Rp.error("end must be bigger than start!"),(r+(n-i))*e.BYTES_PER_ELEMENT>this.byteLength&&Rp.error("An attempt to write beyond the end of the buffer!");const s=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const o=this._context.gl;if(this._context.type===rr.WEBGL2)o.bufferSubData(this.bufferType,r*e.BYTES_PER_ELEMENT,e,i,n-i);else{const a=i===0&&n===e.length?e:e.subarray(i,n);o.bufferSubData(this.bufferType,r*e.BYTES_PER_ELEMENT,a)}Gy(o),this._isVAOAware&&this._context.bindVAO(s)}getSubData(e,r=0,i,n){if(this._context.type!==rr.WEBGL2)return void Rp.error("Get buffer subdata is supported in WebGL2 only!");if(i<0||n<0)return void Rp.error("Problem getting subdata: offset and length were less than zero!");const s=fWe(e)?e.BYTES_PER_ELEMENT:1;if(s*((i??0)+(n??0))>e.byteLength)return void Rp.error("Problem getting subdata: offset and length exceeded destination size!");r+s*(n??0)>this.byteLength&&Rp.warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;this._context.bindBuffer(this,bt.COPY_READ_BUFFER),o.getBufferSubData(bt.COPY_READ_BUFFER,r,e,i,n),this._context.unbindBuffer(bt.COPY_READ_BUFFER)}async getSubDataAsync(e,r=0,i,n){this._context.type===rr.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,r,i,n)):Rp.error("Get buffer subdata is supported in WebGL2 only!")}};function fWe(t){return lDe(t)}var j_;(function(t){t[t.Texture=0]="Texture",t[t.RenderBuffer=1]="RenderBuffer"})(j_||(j_={}));let pr=class{constructor(e=0,r=e){this.width=e,this.height=r,this.target=nn.TEXTURE_2D,this.pixelFormat=Tt.RGBA,this.dataType=Un.UNSIGNED_BYTE,this.samplingMode=At.LINEAR,this.wrapMode=Pt.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}};function mWe(t){return t.width<=0||t.height<=0||t.internalFormat==null?0:t.width*t.height*(t.hasMipmap?4/3:1)*WZ(t.internalFormat)}let gWe=class fxe extends pr{constructor(e,r){switch(super(),this.context=e,Object.assign(this,r),this.internalFormat){case qe.R16F:case qe.R16I:case qe.R16UI:case qe.R32F:case qe.R32I:case qe.R32UI:case qe.R8_SNORM:case qe.R8:case qe.R8I:case qe.R8UI:this.pixelFormat=Tt.RED}}static validate(e,r){return new fxe(e,r)}};const _ne=4;let Ct=class{constructor(e,r=null,i=null){if(this.type=j_.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,i=r;else{const n=gWe.validate(e,r);if(!n)throw new Y("Texture descriptor invalid");this._descriptor=n}if(this._descriptor.context.instanceCounter.increment(Es.Texture,this),this._descriptor.context.type!==rr.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),Av(this._descriptor.target)))throw new Y("3D and array textures are not supported in WebGL1");this._descriptor.target===nn.TEXTURE_CUBE_MAP?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get gpuMemoryUsage(){return wWe.delete(this),mWe(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor.context.instanceCounter.decrement(Es.Texture,this))}release(){this.dispose()}resize(e,r){const i=this._descriptor;if(i.width!==e||i.height!==r){if(this._wasImmutablyAllocated)throw new Y("Immutable textures can't be resized!");i.width=e,i.height=r,this._descriptor.target===nn.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let r=nn.TEXTURE_CUBE_MAP_POSITIVE_X;r<=nn.TEXTURE_CUBE_MAP_NEGATIVE_Z;r++)this._setData(e,r)}setData(e){this._setData(e)}_setData(e,r){if(!this._descriptor.context||!this._descriptor.context.gl)return;const i=this._descriptor.context.gl;Gy(i),this._glName||(this._glName=i.createTexture()),e===void 0&&(e=null);const n=this._descriptor,s=r??n.target,o=Av(s);e===null&&(n.width=n.width||_ne,n.height=n.height||_ne,o&&(n.depth=n.depth??1));const a=this._descriptor.context.bindTexture(this,Ct.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(Ct.TEXTURE_UNIT_FOR_UPDATES),Nk(this._descriptor.context,n),this._configurePixelStorage(),Gy(i);const l=this._deriveInternalFormat();if(Fk(e)){let c=e.width,u=e.height;const d=1;e instanceof HTMLVideoElement&&(c=e.videoWidth,u=e.videoHeight),n.width&&n.height,o&&n.depth,n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,l,n.hasMipmap,c,u,d),this._texImage(s,0,l,c,u,d,e),Gy(i),n.hasMipmap&&this.generateMipmap(),n.width||(n.width=c),n.height||(n.height=u),o&&!n.depth&&(n.depth=d)}else{const{width:c,height:u,depth:d}=n;if(c==null||u==null)throw new Y("Width and height must be specified!");if(o&&d==null)throw new Y("Depth must be specified!");if(n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,l,n.hasMipmap,c,u,d),OD(e)){const p=e.levels,m=wne(s,c,u,d),y=Math.min(m-1,p.length-1);this._descriptor.context.gl2!=null?i.texParameteri(n.target,this._descriptor.context.gl2.TEXTURE_MAX_LEVEL,y):n.hasMipmap=n.hasMipmap&&m===p.length;const _=l;if(!vWe(_))throw new Y("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel((v,b,x,T)=>{const S=p[Math.min(v,p.length-1)];this._compressedTexImage(s,v,_,b,x,T,S)},y)}else this._texImage(s,0,l,c,u,d,e),Gy(i),n.hasMipmap&&this.generateMipmap()}vne(i,this._descriptor),bne(i,this._descriptor),yWe(this._descriptor.context,this._descriptor),Gy(i),this._descriptor.context.bindTexture(a,Ct.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,r,i,n,s,o,a=0){o||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const l=this._descriptor.context.gl,c=this._descriptor.context.gl2,u=this._descriptor,d=this._deriveInternalFormat(),{pixelFormat:p,dataType:m,target:y,isImmutable:_}=u;if(_&&!this._wasImmutablyAllocated)throw new Y("Cannot update immutable texture before allocation!");const v=this._descriptor.context.bindTexture(this,Ct.TEXTURE_UNIT_FOR_UPDATES,!0);if((r<0||i<0||n>u.width||s>u.height||r+n>u.width||i+s>u.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),a){if(!c)return void console.error("Webgl2 must be enabled to use dataRowOffset!");l.pixelStorei(c.UNPACK_SKIP_ROWS,a)}if(Fk(o)?c?c.texSubImage2D(y,e,r,i,n,s,p,m,o):l.texSubImage2D(y,e,r,i,p,m,o):OD(o)?l.compressedTexSubImage2D(y,e,r,i,n,s,d,o.levels[e]):l.texSubImage2D(y,e,r,i,n,s,p,m,o),a){if(!c)return void console.error("Webgl2 must be enabled to use dataRowOffset!");l.pixelStorei(c.UNPACK_SKIP_ROWS,0)}this._descriptor.context.bindTexture(v,Ct.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,r,i,n,s,o,a,l){l||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const c=this._descriptor.context.gl2;if(c==null)throw new Y("3D textures are not supported in WebGL1");const u=this._descriptor,d=this._deriveInternalFormat(),{pixelFormat:p,dataType:m,isImmutable:y,target:_}=u;if(y&&!this._wasImmutablyAllocated)throw new Y("Cannot update immutable texture before allocation!");Av(_)||console.warn("Attempting to set 3D texture data on a non-3D texture");const v=this._descriptor.context.bindTexture(this,Ct.TEXTURE_UNIT_FOR_UPDATES);if(this._descriptor.context.setActiveTexture(Ct.TEXTURE_UNIT_FOR_UPDATES),(r<0||i<0||n<0||s>u.width||o>u.height||a>u.depth||r+s>u.width||i+o>u.height||n+a>u.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),OD(l))l=l.levels[e],c.compressedTexSubImage3D(_,e,r,i,n,s,o,a,d,l);else{const b=l;c.texSubImage3D(_,e,r,i,n,s,o,a,p,m,b)}this._descriptor.context.bindTexture(v,Ct.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Y("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,Nk(this._descriptor.context,e)}e.samplingMode===At.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=At.LINEAR_MIPMAP_NEAREST):e.samplingMode===At.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=At.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,Ct.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(Ct.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(r,Ct.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,Nk(this._descriptor.context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor.context.gl,r=this._descriptor;this._samplingModeDirty&&(vne(e,r),this._samplingModeDirty=!1),this._wrapModeDirty&&(bne(e,r),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(this._descriptor.context.type===rr.WEBGL1)return this._descriptor.internalFormat=this._descriptor.pixelFormat;if(this._descriptor.internalFormat!=null)return this._descriptor.internalFormat===Tt.DEPTH_STENCIL&&(this._descriptor.internalFormat=Tt.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case Un.FLOAT:switch(this._descriptor.pixelFormat){case Tt.RGBA:return this._descriptor.internalFormat=qe.RGBA32F;case Tt.RGB:return this._descriptor.internalFormat=qe.RGB32F;default:throw new Y("Unable to derive format")}case Un.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case Tt.RGBA:return this._descriptor.internalFormat=qe.RGBA8;case Tt.RGB:return this._descriptor.internalFormat=qe.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===Tt.DEPTH_STENCIL?Tt.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:r,flipped:i,preMultiplyAlpha:n}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,i?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n?1:0)}_texStorage(e,r,i,n,s,o){const a=this._descriptor.context.gl2;if(a==null)throw new Y("Immutable textures are not supported in WebGL1");if(!_We(r))throw new Y("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=i?wne(e,n,s,o):1;if(Av(e)){if(o==null)throw new Y("Missing depth dimension for 3D texture upload");a.texStorage3D(e,l,r,n,s,o)}else a.texStorage2D(e,l,r,n,s);this._wasImmutablyAllocated=!0}_texImage(e,r,i,n,s,o,a){const l=this._descriptor.context.gl,c=Av(e),{isImmutable:u,pixelFormat:d,dataType:p}=this._descriptor,m=this._descriptor.context.type===rr.WEBGL2,y=m?l:null;if(m||!Fk(a))if(u){if(a!=null){const _=a;if(c){if(o==null)throw new Y("Missing depth dimension for 3D texture upload");y.texSubImage3D(e,r,0,0,0,n,s,o,d,p,_)}else l.texSubImage2D(e,r,0,0,n,s,d,p,_)}}else{const _=a;if(c){if(o==null)throw new Y("Missing depth dimension for 3D texture upload");y.texImage3D(e,r,i,n,s,o,0,d,p,_)}else l.texImage2D(e,r,i,n,s,0,d,p,_)}else l.texImage2D(e,0,i,d,p,a)}_compressedTexImage(e,r,i,n,s,o,a){const l=this._descriptor.context.gl;let c=null;const u=Av(e),d=this._descriptor.isImmutable;if(u){if(this._descriptor.context.type!==rr.WEBGL2)throw new Y("3D textures are not supported in WebGL1");c=l}if(d){if(a!=null)if(u){if(o==null)throw new Y("Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,r,0,0,0,n,s,o,i,a)}else l.compressedTexSubImage2D(e,r,0,0,n,s,i,a)}else if(u){if(o==null)throw new Y("Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,r,i,n,s,o,0,a)}else l.compressedTexImage2D(e,r,i,n,s,0,a)}_forEachMipmapLevel(e,r=1/0){let{width:i,height:n,depth:s,hasMipmap:o,target:a}=this._descriptor;const l=a===nn.TEXTURE_3D;if(i==null||n==null||l&&s==null)throw new Y("Missing texture dimensions for mipmap calculation");for(let c=0;e(c,i,n,s),o&&(i!==1||n!==1||l&&s!==1)&&!(c>=r);++c)i=Math.max(1,i>>1),n=Math.max(1,n>>1),l&&(s=Math.max(1,s>>1))}};function Nk(t,e){(e.width!=null&&e.width<0||e.height!=null&&e.height<0||e.depth!=null&&e.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=t.type===rr.WEBGL2;r||!e.isImmutable&&!Av(e.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),!r&&(e.width!=null&&tw(e.width)&&e.height!=null&&tw(e.height)||(typeof e.wrapMode=="number"?e.wrapMode!==Pt.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):e.wrapMode.s===Pt.CLAMP_TO_EDGE&&e.wrapMode.t===Pt.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),e.hasMipmap&&console.error("Mipmapping requires power-of-two textures!")))}function vne(t,e){let r=e.samplingMode,i=e.samplingMode;r===At.LINEAR_MIPMAP_NEAREST||r===At.LINEAR_MIPMAP_LINEAR?(r=At.LINEAR,e.hasMipmap||(i=At.LINEAR)):r!==At.NEAREST_MIPMAP_NEAREST&&r!==At.NEAREST_MIPMAP_LINEAR||(r=At.NEAREST,e.hasMipmap||(i=At.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}function bne(t,e){typeof e.wrapMode=="number"?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}function yWe(t,e){const r=t.capabilities.textureFilterAnisotropic;r&&t.gl.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}function _We(t){return t in qe}function vWe(t){return t in un}function OD(t){return t!=null&&"type"in t&&t.type==="compressed"}function bWe(t){return t!=null&&"byteLength"in t}function Fk(t){return t!=null&&!OD(t)&&!bWe(t)}function Av(t){return t===nn.TEXTURE_3D||t===nn.TEXTURE_2D_ARRAY}function wne(t,e,r,i=1){let n=Math.max(e,r);return t===nn.TEXTURE_3D&&(n=Math.max(n,i)),Math.round(Math.log(n)/Math.LN2)+1}Ct.TEXTURE_UNIT_FOR_UPDATES=0;const wWe=new Map;function Dl(t,e=GZ,r=fr,i=-1,n=1){let s=null;return e===$P?s=new Float32Array([i,i,0,0,n,i,1,0,i,n,0,1,n,n,1,1]):s=new Float32Array([i,i,n,i,i,n,n,n]),new vp(t,r,{geometry:e},{geometry:Ar.createVertex(t,gr.STATIC_DRAW,s)})}function xWe(t,e=GZ,r=fr){const i=new Float32Array([-1,-1,3,-1,-1,3]);return new vp(t,r,{geometry:e},{geometry:Ar.createVertex(t,gr.STATIC_DRAW,i)})}const mxe=4;function gxe(t,e=mxe){const r=new pr;return r.samplingMode=At.NEAREST,r.width=r.height=e,new Ct(t,r)}function TWe(t,e,r=mxe){const i=new Uint8Array(r*r*4);for(let s=0;s{var s,o;return(o=(s=this._view)==null?void 0:s.basemapTerrain)==null?void 0:o.rootTileElevationBounds},()=>{var s;return(s=this._view)!=null&&s.basemapTerrain?this._updateRootTileElevationBounds():null}),ue(()=>{var s,o;return(o=(s=this._view)==null?void 0:s.basemapTerrain)==null?void 0:o.visibleElevationBounds},()=>{var s;return(s=this._view)!=null&&s.basemapTerrain?this._updateVisibleElevationBounds():null})]);const n=new t5;n.haze=!1,this._atmosphereTechnique=r.techniqueRepository.acquire(Y3,n),n.haze=!0,this._atmosphereHazeTechnique=r.techniqueRepository.acquire(Y3,n),n.reduced=!0,n.haze=!1,this._atmosphereReducedTechnique=r.techniqueRepository.acquire(Y3,n),n.haze=!0,this._atmosphereHazeReducedTechnique=r.techniqueRepository.acquire(Y3,n),this._vao=Dl(i,$P)}destroy(){this._handles.destroy(),this._atmosphereTechnique.release(),this._atmosphereHazeTechnique.release(),this._atmosphereReducedTechnique.release(),this._atmosphereHazeReducedTechnique.release(),this._vao.dispose()}render(e,r){this._render(e,r?this._atmosphereTechnique:this._atmosphereReducedTechnique,e.offscreenRenderingHelper.depthTexture,r,!1)}renderHaze(e,r,i){this._fadeHaze=r,this._render(e,i?this._atmosphereHazeTechnique:this._atmosphereHazeReducedTechnique,e.offscreenRenderingHelper.linearDepthTexture,i,!0)}_render(e,r,i,n,s){if(i==null)return;const o=e.offscreenRenderingHelper;this._update(e.bindParameters.camera),this._passParameters.depthTexture=i;const a=o.background.color;ne(this._passParameters.backgroundColor,a[0]*a[3],a[1]*a[3],a[2]*a[3]);const l=e.rctx.bindTechnique(r,this._passParameters,e.bindParameters);if(n)o.renderDepthDetached(()=>this._renderCommon(l,e));else{const c=e.rctx.getViewport(),u=Te(e.bindParameters.camera.eye)-Kt.radius;let d;if(u<$y){const y=Math.min(1,Math.max(0,u/$y));d=s?wt(.4,.5,y):wt(.2,.3,y)}else{const y=Math.min(1,Math.max(0,(u-$y)/(15*$y)));d=s?wt(.5,1,y):wt(.3,.6,y)}const p=Math.floor(d*e.bindParameters.camera.fullViewport[2]),m=Math.floor(d*e.bindParameters.camera.fullViewport[3]);e.rctx.setViewport(0,0,p,m),o.renderToTargets(()=>this._renderCommon(l,e),o.tmpColor,o.tmpDepth,[0,0,0,1],!1,!1),e.rctx.setViewport(c.x,c.y,c.width,c.height),er(this._tmpScale,p/e.bindParameters.camera.fullViewport[2],m/e.bindParameters.camera.fullViewport[3]),o.compositeAtmosphereToMain(e.bindParameters,s,i,this._tmpScale)}}_renderCommon(e,r){this._vao!=null&&(r.rctx.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),r.rctx.drawArrays(Et.TRIANGLE_STRIP,0,4))}_adjustRadiusForTesselation(e){return e*Math.cos(Math.PI/16/16)}_updateRootTileElevationBounds(){const e=this._view.basemapTerrain.rootTileElevationBounds.min;e!==this._rootTileElevationMin&&(this._rootTileElevationMin=e,this._lowerBoundEarthRadius=Kt.radius,this._updateVisibleElevationBounds())}_updateVisibleElevationBounds(){const e=this._adjustRadiusForTesselation(Kt.radius+this._view.basemapTerrain.visibleElevationBounds.min);ei.setUniform3fv(e,r(n,s,o)))}},Eh=class extends ln{constructor(e,r){super(e,"sampler2D",jr.Draw,(i,n,s)=>i.bindTexture(e,r(n,s)))}},h1=class{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}get _markerTextureRepository(){return this._techniqueRepository.constructionContext.markerTextureRepository}ensureTechnique(e,r){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(this._output,r),this._technique),this._technique}ensureResources(e){return bg.LOADED}},XZ=class extends h1{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRep,this._textureId=e.textureId,this._acquire(e.textureId,r=>this._texture=r),this._acquire(e.normalTextureId,r=>this._textureNormal=r),this._acquire(e.emissiveTextureId,r=>this._textureEmissive=r),this._acquire(e.occlusionTextureId,r=>this._textureOcclusion=r),this._acquire(e.metallicRoughnessTextureId,r=>this._textureMetallicRoughness=r)}dispose(){this._texture=Fi(this._texture),this._textureNormal=Fi(this._textureNormal),this._textureEmissive=Fi(this._textureEmissive),this._textureOcclusion=Fi(this._textureOcclusion),this._textureMetallicRoughness=Fi(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return this._numLoading===0?bg.LOADED:bg.LOADING}get textureBindParameters(){return new vxe(this._texture!=null?this._texture.glTexture:null,this._textureNormal!=null?this._textureNormal.glTexture:null,this._textureEmissive!=null?this._textureEmissive.glTexture:null,this._textureOcclusion!=null?this._textureOcclusion.glTexture:null,this._textureMetallicRoughness!=null?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){this._texture!=null&&e===this._texture.id||(this._texture=Fi(this._texture),this._textureId=e,this._acquire(this._textureId,r=>this._texture=r))}_acquire(e,r){if(e==null)return void r(null);const i=this._textureRepository.acquire(e);if(Eu(i))return++this._numLoading,void i.then(n=>{if(this._disposed)return Fi(n),void r(null);r(n)}).finally(()=>--this._numLoading);r(i)}},vxe=class extends Wr{constructor(e=null,r=null,i=null,n=null,s=null){super(),this.texture=e,this.textureNormal=r,this.textureEmissive=i,this.textureOcclusion=n,this.textureMetallicRoughness=s}};var et;(function(t){t[t.Disabled=0]="Disabled",t[t.Normal=1]="Normal",t[t.Schematic=2]="Schematic",t[t.Water=3]="Water",t[t.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",t[t.Terrain=5]="Terrain",t[t.TerrainWithWater=6]="TerrainWithWater",t[t.COUNT=7]="COUNT"})(et||(et={}));function YZ(t,e){const r=t.fragment,i=e.hasMetallicRoughnessTexture||e.hasEmissionTexture||e.hasOcclusionTexture;if(e.pbrMode===et.Normal&&i&&t.include(qZ,e),e.pbrMode!==et.Schematic)if(e.pbrMode!==et.Disabled){if(e.pbrMode===et.Normal){r.code.add(w`vec3 mrr; +vec3 emission; +float occlusion;`);const n=e.pbrTextureBindType;e.hasMetallicRoughnessTexture&&(r.uniforms.add(n===jr.Pass?new Ye("texMetallicRoughness",s=>s.textureMetallicRoughness):new Eh("texMetallicRoughness",s=>s.textureMetallicRoughness)),r.code.add(w`void applyMetallnessAndRoughness(vec2 uv) { +vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb; +mrr[0] *= metallicRoughness.b; +mrr[1] *= metallicRoughness.g; +}`)),e.hasEmissionTexture&&(r.uniforms.add(n===jr.Pass?new Ye("texEmission",s=>s.textureEmissive):new Eh("texEmission",s=>s.textureEmissive)),r.code.add(w`void applyEmission(vec2 uv) { +emission *= textureLookup(texEmission, uv).rgb; +}`)),e.hasOcclusionTexture?(r.uniforms.add(n===jr.Pass?new Ye("texOcclusion",s=>s.textureOcclusion):new Eh("texOcclusion",s=>s.textureOcclusion)),r.code.add(w`void applyOcclusion(vec2 uv) { +occlusion *= textureLookup(texOcclusion, uv).r; +} +float getBakedOcclusion() { +return occlusion; +}`)):r.code.add(w`float getBakedOcclusion() { return 1.0; }`),n===jr.Pass?r.uniforms.add(new Lt("emissionFactor",s=>s.emissiveFactor),new Lt("mrrFactors",s=>s.mrrFactors)):r.uniforms.add(new pu("emissionFactor",s=>s.emissiveFactor),new pu("mrrFactors",s=>s.mrrFactors)),r.code.add(w` + void applyPBRFactors() { + mrr = mrrFactors; + emission = emissionFactor; + occlusion = 1.0; + + ${e.hasMetallicRoughnessTexture?w`applyMetallnessAndRoughness(${e.hasMetallicRoughnessTextureTransform?w`metallicRoughnessUV`:"vuv0"});`:""} + + ${e.hasEmissionTexture?w`applyEmission(${e.hasEmissiveTextureTransform?w`emissiveUV`:"vuv0"});`:""} + + ${e.hasOcclusionTexture?w`applyOcclusion(${e.hasOcclusionTextureTransform?w`occlusionUV`:"vuv0"});`:""} + } + `)}}else r.code.add(w`float getBakedOcclusion() { return 1.0; }`);else r.code.add(w`vec3 mrr = vec3(0.0, 0.6, 0.2); +vec3 emission = vec3(0.0); +float occlusion = 1.0; +void applyPBRFactors() {} +float getBakedOcclusion() { return 1.0; }`)}function ZZ(t,e){const r=t.fragment,i=e.lightingSphericalHarmonicsOrder!==void 0?e.lightingSphericalHarmonicsOrder:2;i===0?(r.uniforms.add(new Lt("lightingAmbientSH0",(n,s)=>ne(Tne,s.lighting.sh.r[0],s.lighting.sh.g[0],s.lighting.sh.b[0]))),r.code.add(w`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { +vec3 ambientLight = 0.282095 * lightingAmbientSH0; +return ambientLight * (1.0 - ambientOcclusion); +}`)):i===1?(r.uniforms.add(new Jt("lightingAmbientSH_R",(n,s)=>gi(mm,s.lighting.sh.r[0],s.lighting.sh.r[1],s.lighting.sh.r[2],s.lighting.sh.r[3])),new Jt("lightingAmbientSH_G",(n,s)=>gi(mm,s.lighting.sh.g[0],s.lighting.sh.g[1],s.lighting.sh.g[2],s.lighting.sh.g[3])),new Jt("lightingAmbientSH_B",(n,s)=>gi(mm,s.lighting.sh.b[0],s.lighting.sh.b[1],s.lighting.sh.b[2],s.lighting.sh.b[3]))),r.code.add(w`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { +vec4 sh0 = vec4( +0.282095, +0.488603 * normal.x, +0.488603 * normal.z, +0.488603 * normal.y +); +vec3 ambientLight = vec3( +dot(lightingAmbientSH_R, sh0), +dot(lightingAmbientSH_G, sh0), +dot(lightingAmbientSH_B, sh0) +); +return ambientLight * (1.0 - ambientOcclusion); +}`)):i===2&&(r.uniforms.add(new Lt("lightingAmbientSH0",(n,s)=>ne(Tne,s.lighting.sh.r[0],s.lighting.sh.g[0],s.lighting.sh.b[0])),new Jt("lightingAmbientSH_R1",(n,s)=>gi(mm,s.lighting.sh.r[1],s.lighting.sh.r[2],s.lighting.sh.r[3],s.lighting.sh.r[4])),new Jt("lightingAmbientSH_G1",(n,s)=>gi(mm,s.lighting.sh.g[1],s.lighting.sh.g[2],s.lighting.sh.g[3],s.lighting.sh.g[4])),new Jt("lightingAmbientSH_B1",(n,s)=>gi(mm,s.lighting.sh.b[1],s.lighting.sh.b[2],s.lighting.sh.b[3],s.lighting.sh.b[4])),new Jt("lightingAmbientSH_R2",(n,s)=>gi(mm,s.lighting.sh.r[5],s.lighting.sh.r[6],s.lighting.sh.r[7],s.lighting.sh.r[8])),new Jt("lightingAmbientSH_G2",(n,s)=>gi(mm,s.lighting.sh.g[5],s.lighting.sh.g[6],s.lighting.sh.g[7],s.lighting.sh.g[8])),new Jt("lightingAmbientSH_B2",(n,s)=>gi(mm,s.lighting.sh.b[5],s.lighting.sh.b[6],s.lighting.sh.b[7],s.lighting.sh.b[8]))),r.code.add(w`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { +vec3 ambientLight = 0.282095 * lightingAmbientSH0; +vec4 sh1 = vec4( +0.488603 * normal.x, +0.488603 * normal.z, +0.488603 * normal.y, +1.092548 * normal.x * normal.y +); +vec4 sh2 = vec4( +1.092548 * normal.y * normal.z, +0.315392 * (3.0 * normal.z * normal.z - 1.0), +1.092548 * normal.x * normal.z, +0.546274 * (normal.x * normal.x - normal.y * normal.y) +); +ambientLight += vec3( +dot(lightingAmbientSH_R1, sh1), +dot(lightingAmbientSH_G1, sh1), +dot(lightingAmbientSH_B1, sh1) +); +ambientLight += vec3( +dot(lightingAmbientSH_R2, sh2), +dot(lightingAmbientSH_G2, sh2), +dot(lightingAmbientSH_B2, sh2) +); +return ambientLight * (1.0 - ambientOcclusion); +}`),e.pbrMode!==et.Normal&&e.pbrMode!==et.Schematic||r.code.add(w`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0); +vec3 calculateAmbientRadiance(float ambientOcclusion) +{ +vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2; +return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance; +}`))}const Tne=O(),mm=Qt();function IP(t){t.vertex.code.add(w`const float PI = 3.141592653589793;`),t.fragment.code.add(w`const float PI = 3.141592653589793; +const float LIGHT_NORMALIZATION = 1.0 / PI; +const float INV_PI = 0.3183098861837907; +const float HALF_PI = 1.570796326794897;`)}var On,dw;function SWe(t){return(t==null?void 0:t.cubeMap)!=null}function QZ(t){return t!=null&&!t.running}(function(t){t[t.RENDERING=0]="RENDERING",t[t.FINISHED_RENDERING=1]="FINISHED_RENDERING",t[t.FADING_TEXTURE_CHANNELS=2]="FADING_TEXTURE_CHANNELS",t[t.SWITCH_CHANNELS=3]="SWITCH_CHANNELS",t[t.FINISHED=4]="FINISHED"})(On||(On={})),function(t){t[t.RG=0]="RG",t[t.BA=1]="BA"}(dw||(dw={}));let EWe=class{constructor(){this.readChannels=dw.RG,this.renderingStage=On.FINISHED,this.startTime=0,this.startTimeHeightFade=0,this.cameraPositionLastFrame=O(),this.isCameraPositionFinal=!0,this.parallax=new Sne,this.parallaxNew=new Sne,this.crossFade={enabled:!1,factor:1,distanceThresholdFactor:.3},this.fadeInOut={stage:ys.FINISHED,factor:1,distanceThresholdFactor:.6},this.fadeIn={stage:oc.FINISHED,factor:1,distanceThresholdFactor:2},this.fadeInOutHeight={stage:H_.FINISHED,factor:-1}}get isFading(){return this.fadeInOut.stage===ys.FADE_OUT||this.fadeInOut.stage===ys.FADE_IN||this.fadeIn.stage===oc.FADE_IN||this.fadeInOutHeight.stage!==H_.FINISHED||this.renderingStage===On.FADING_TEXTURE_CHANNELS}};var oc,ys,H_;(function(t){t[t.FINISHED=0]="FINISHED",t[t.CHANGE_ANCHOR=1]="CHANGE_ANCHOR",t[t.FADE_IN=2]="FADE_IN"})(oc||(oc={})),function(t){t[t.FINISHED=0]="FINISHED",t[t.FADE_OUT=1]="FADE_OUT",t[t.SWITCH=2]="SWITCH",t[t.FADE_IN=3]="FADE_IN"}(ys||(ys={})),function(t){t[t.FINISHED=0]="FINISHED",t[t.HEIGHT_FADE=1]="HEIGHT_FADE"}(H_||(H_={}));let Sne=class{constructor(){this.anchorPointClouds=O(),this.cloudsHeight=1e5,this.radiusCurvatureCorrectionFactor=0,this.transform=_e()}},kf=class extends ln{constructor(e,r){super(e,"bool",jr.Pass,(i,n,s)=>i.setUniform1b(e,r(n,s)))}},CWe=class extends ln{constructor(e,r){super(e,"samplerCube",jr.Pass,(i,n,s)=>i.bindTexture(e,r(n,s)))}};function bxe(t){const e=t.fragment;e.uniforms.add(new Mi("rotationMatrixClouds",(r,i)=>i.cloudsFade.parallax.transform),new Mi("rotationMatrixCloudsCrossFade",(r,i)=>i.cloudsFade.parallaxNew.transform),new Lt("anchorPosition",(r,i)=>i.cloudsFade.parallax.anchorPointClouds),new Lt("anchorPositionCrossFade",(r,i)=>i.cloudsFade.parallaxNew.anchorPointClouds),new Ce("cloudsHeight",(r,i)=>i.cloudsFade.parallax.cloudsHeight),new Ce("radiusCurvatureCorrectionFactor",(r,i)=>i.cloudsFade.parallax.radiusCurvatureCorrectionFactor),new Ce("totalFadeInOut",(r,i)=>i.cloudsFade.fadeInOut.stage===ys.FINISHED?i.cloudsFade.fadeInOutHeight.factor+1-i.cloudsFade.fadeIn.factor:i.cloudsFade.fadeInOutHeight.factor+1-i.cloudsFade.fadeInOut.factor),new Ce("crossFadeAnchorFactor",(r,i)=>ge(i.cloudsFade.crossFade.factor,0,1)),new CWe("cubeMap",(r,i)=>{var n;return(n=i.cloudsFade.data)!=null&&n.cubeMap?i.cloudsFade.data.cubeMap.colorTexture:null}),new kf("crossFade",(r,i)=>i.cloudsFade.crossFade.enabled),new kf("readChannelsRG",(r,i)=>i.cloudsFade.readChannels===dw.RG),new kf("fadeTextureChannels",(r,i)=>i.cloudsFade.renderingStage===On.FADING_TEXTURE_CHANNELS)),e.constants.add("planetRadius","float",Kt.radius),e.code.add(w`vec3 intersectWithCloudLayer(vec3 dir, vec3 cameraPosition, vec3 spherePos) +{ +float radiusClouds = planetRadius + cloudsHeight; +float B = 2.0 * dot(cameraPosition, dir); +float C = dot(cameraPosition, cameraPosition) - radiusClouds * radiusClouds; +float det = B * B - 4.0 * C; +float pointIntDist = max(0.0, 0.5 *(-B + sqrt(det))); +vec3 intersectionPont = cameraPosition + dir * pointIntDist; +intersectionPont = intersectionPont - spherePos; +return intersectionPont; +}`),e.code.add(w`vec3 correctForPlanetCurvature(vec3 dir) +{ +dir.z = dir.z*(1.-radiusCurvatureCorrectionFactor) + radiusCurvatureCorrectionFactor; +return dir; +}`),e.code.add(w`vec3 rotateDirectionToAnchorPoint(mat4 rotMat, vec3 inVec) +{ +return (rotMat * vec4(inVec, 0.0)).xyz; +}`),r0(e),lm(e),e.code.add(w`const float SUNSET_TRANSITION_FACTOR = 0.3; +const vec3 RIM_COLOR = vec3(0.28, 0.175, 0.035); +const float RIM_SCATTERING_FACTOR = 140.0; +const float BACKLIGHT_FACTOR = 0.2; +const float BACKLIGHT_SCATTERING_FACTOR = 10.0; +const float BACKLIGHT_TRANSITION_FACTOR = 0.3; +vec3 calculateCloudColor(vec3 cameraPosition, vec3 worldSpaceRay, vec4 clouds) +{ +float upDotLight = dot(normalize(cameraPosition), normalize(mainLightDirection)); +float dirDotLight = max(dot(normalize(-worldSpaceRay), normalize(mainLightDirection)), 0.0); +float sunsetTransition = clamp(pow(max(upDotLight, 0.0), SUNSET_TRANSITION_FACTOR), 0.0, 1.0); +vec3 ambientLight = calculateAmbientIrradiance(normalize(cameraPosition), 0.0); +vec3 mainLight = evaluateMainLighting(normalize(cameraPosition), 0.0); +vec3 combinedLight = clamp((mainLightIntensity + ambientLight )/PI, vec3(0.0), vec3(1.0)); +vec3 baseCloudColor = pow(combinedLight * pow(clouds.xyz, vec3(GAMMA)), vec3(INV_GAMMA)); +float scatteringMod = max(clouds.a < 0.5 ? clouds.a / 0.5 : - clouds.a / 0.5 + 2.0, 0.0); +float rimLightIntensity = 0.5 + 0.5 *pow(max(upDotLight, 0.0), 0.35); +vec3 directSunScattering = RIM_COLOR * rimLightIntensity * (pow(dirDotLight, RIM_SCATTERING_FACTOR)) * scatteringMod; +float additionalLight = BACKLIGHT_FACTOR * pow(dirDotLight, BACKLIGHT_SCATTERING_FACTOR) * (1. - pow(sunsetTransition, BACKLIGHT_TRANSITION_FACTOR)) ; +return vec3(baseCloudColor * (1. + additionalLight) + directSunScattering); +}`),e.code.add(w`vec4 getCloudData(vec3 rayDir, bool readOtherChannel) +{ +vec4 cloudData = texture(cubeMap, rayDir); +float mu = dot(rayDir, vec3(0, 0, 1)); +bool readChannels = readChannelsRG ^^ readOtherChannel; +if (readChannels) { +cloudData = vec4(vec3(cloudData.r), cloudData.g); +} else { +cloudData = vec4(vec3(cloudData.b), cloudData.a); +} +if (length(cloudData) == 0.0) { +return vec4(cloudData.rgb, 1.0); +} +return cloudData; +}`),e.code.add(w`vec4 renderCloudsNoFade(vec3 worldRay, vec3 cameraPosition) +{ +vec3 intersectionPoint = intersectWithCloudLayer(normalize(worldRay), cameraPosition, anchorPosition); +vec3 worldRayRotated = rotateDirectionToAnchorPoint(rotationMatrixClouds, normalize(intersectionPoint)); +vec3 worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated); +vec4 cloudData = getCloudData(worldRayRotatedCorrected, false); +float totalTransmittance = clamp(cloudData.a * (1.0 - totalFadeInOut) + totalFadeInOut, 0.0 , 1.0); +if (length(cloudData.rgb) == 0.0) { +totalTransmittance = 1.0; +} +return vec4(calculateCloudColor(cameraPosition, normalize(-worldRay), cloudData), totalTransmittance); +}`),e.code.add(w`vec4 renderCloudsCrossFade(vec3 worldRay, vec3 cameraPosition) +{ +vec3 intersectionPoint = intersectWithCloudLayer(normalize(worldRay), cameraPosition, anchorPosition); +vec3 worldRayRotated = rotateDirectionToAnchorPoint(rotationMatrixClouds, normalize(intersectionPoint)); +vec3 worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated); +vec4 cloudData = getCloudData(worldRayRotatedCorrected, false); +vec4 cloudColor = vec4(calculateCloudColor(cameraPosition, normalize(-worldRay), cloudData), cloudData.a); +intersectionPoint = intersectWithCloudLayer(normalize(worldRay), cameraPosition, anchorPositionCrossFade); +worldRayRotated = rotateDirectionToAnchorPoint(rotationMatrixCloudsCrossFade, normalize(intersectionPoint)); +worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated); +cloudData = getCloudData(worldRayRotatedCorrected, fadeTextureChannels); +vec4 cloudColorCrossFade = vec4(calculateCloudColor(cameraPosition, normalize(-worldRay), cloudData), cloudData.a); +cloudColor = mix(cloudColor, cloudColorCrossFade, crossFadeAnchorFactor); +float totalTransmittance = clamp(cloudColor.a * (1.0 - totalFadeInOut) + totalFadeInOut, 0.0 , 1.0); +if (length(cloudColor.rgb) == 0.0) { +totalTransmittance = 1.0; +} +return vec4(cloudColor.rgb, totalTransmittance); +}`),e.code.add(w`vec4 renderClouds(vec3 worldRay, vec3 cameraPosition) +{ +return crossFade ? renderCloudsCrossFade(worldRay, cameraPosition) : renderCloudsNoFade(worldRay, cameraPosition); +}`)}function cm(t){t.code.add(w`vec4 premultiplyAlpha(vec4 v) { +return vec4(v.rgb * v.a, v.a); +} +vec3 rgb2hsv(vec3 c) { +vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); +vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); +vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); +float d = q.x - min(q.w, q.y); +float e = 1.0e-10; +return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x); +} +vec3 hsv2rgb(vec3 c) { +vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); +vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); +return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); +} +float rgb2v(vec3 c) { +return max(c.x, max(c.y, c.z)); +}`)}function AWe(){const t=new mr;t.attributes.add(E.POSITION,"vec2"),t.varyings.add("worldRay","vec3");const{vertex:e,fragment:r}=t;return e.uniforms.add(new Mi("inverseProjectionMatrix",(i,n)=>n.camera.inverseProjectionMatrix),new Mi("inverseViewMatrix",(i,n)=>wE(OWe,n.camera.viewMatrix))),e.code.add(w`void main(void) { +vec3 posViewNear = (inverseProjectionMatrix * vec4(position, -1.0, 1.0)).xyz; +worldRay = (inverseViewMatrix * vec4(posViewNear, 0.0)).xyz; +gl_Position = vec4(position, 1.0, 1.0); +}`),r.include(cm),r.include(Pc),t.include(ZZ,{pbrMode:et.Disabled,lightingSphericalHarmonicsOrder:2}),t.include(IP),t.include(Q6),t.include(K4),t.include(bxe,{instancedDoublePrecision:!1}),r.uniforms.add(new Lt("cameraPosition",(i,n)=>n.camera.eye)),r.code.add(w`void main() { +vec4 cloudsColor = renderClouds(normalize(worldRay), cameraPosition); +fragColor = vec4((1.0 - totalFadeInOut) * cloudsColor.rgb, cloudsColor.a); +}`),t}const OWe=_e(),RWe=Object.freeze(Object.defineProperty({__proto__:null,build:AWe},Symbol.toStringTag,{value:"Module"}));let wxe=class xxe extends Tr{constructor(e){super(e,new va,()=>this.destroy())}initializeProgram(e){return new vr(e.rctx,xxe.shader.get().build(),fr)}initializePipeline(){return Ot({blending:So(ve.ONE,ve.ZERO,ve.SRC_ALPHA,ve.ONE),depthTest:{func:Hr.LEQUAL},colorWrite:Ft})}};wxe.shader=new _r(RWe,()=>ce(()=>import("./CloudsComposition.glsl-e9072d6f.js"),[]));let Ov=class extends xe{constructor(e){super(e),this._technique=new wxe(e),this._vao=Dl(e.rctx)}destroy(){this._technique=Fi(this._technique),this._vao=Le(this._vao)}render(e){const r=e.bindParameters.cloudsFade;if(this._vao==null||r.data==null)return;if(!this._technique.compiled)return void this.requestRender();const i=e.rctx.bindTechnique(this._technique,PWe,e.bindParameters);e.rctx.bindVAO(this._vao),i.assertCompatibleVertexAttributeLocations(this._vao),e.rctx.drawArrays(Et.TRIANGLE_STRIP,0,4)}};h([f({constructOnly:!0})],Ov.prototype,"rctx",void 0),h([f({constructOnly:!0})],Ov.prototype,"viewingMode",void 0),h([f({constructOnly:!0})],Ov.prototype,"planetRadius",void 0),h([f({constructOnly:!0})],Ov.prototype,"requestRender",void 0),Ov=h([N("esri.views.3d.environment.CloudsComposition")],Ov);const PWe=new Wr;function Ac(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function MWe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function JZ(t,e,r,i,n,s,o,a,l,c){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t[4]=s,t[5]=o,t[6]=a,t[7]=l,t[8]=c,t}function KZ(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Uh(t,e){if(t===e){const r=e[1],i=e[2],n=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=i,t[7]=n}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Vw(t,e){const r=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=u*o-a*c,p=-u*s+a*l,m=c*s-o*l;let y=r*d+i*p+n*m;return y?(y=1/y,t[0]=d*y,t[1]=(-u*i+n*c)*y,t[2]=(a*i-n*o)*y,t[3]=p*y,t[4]=(u*r-n*l)*y,t[5]=(-a*r+n*s)*y,t[6]=m*y,t[7]=(-c*r+i*l)*y,t[8]=(o*r-i*s)*y,t):null}function $We(t,e){const r=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t[0]=o*u-a*c,t[1]=n*c-i*u,t[2]=i*a-n*o,t[3]=a*l-s*u,t[4]=r*u-n*l,t[5]=n*s-r*a,t[6]=s*c-o*l,t[7]=i*l-r*c,t[8]=r*o-i*s,t}function IWe(t){const e=t[0],r=t[1],i=t[2],n=t[3],s=t[4],o=t[5],a=t[6],l=t[7],c=t[8];return e*(c*s-o*l)+r*(-c*n+o*a)+i*(l*n-s*a)}function US(t,e,r){const i=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],u=e[7],d=e[8],p=r[0],m=r[1],y=r[2],_=r[3],v=r[4],b=r[5],x=r[6],T=r[7],S=r[8];return t[0]=p*i+m*o+y*c,t[1]=p*n+m*a+y*u,t[2]=p*s+m*l+y*d,t[3]=_*i+v*o+b*c,t[4]=_*n+v*a+b*u,t[5]=_*s+v*l+b*d,t[6]=x*i+T*o+S*c,t[7]=x*n+T*a+S*u,t[8]=x*s+T*l+S*d,t}function r5(t,e,r){const i=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],u=e[7],d=e[8],p=r[0],m=r[1];return t[0]=i,t[1]=n,t[2]=s,t[3]=o,t[4]=a,t[5]=l,t[6]=p*i+m*o+c,t[7]=p*n+m*a+u,t[8]=p*s+m*l+d,t}function eQ(t,e,r){const i=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],u=e[7],d=e[8],p=Math.sin(r),m=Math.cos(r);return t[0]=m*i+p*o,t[1]=m*n+p*a,t[2]=m*s+p*l,t[3]=m*o-p*i,t[4]=m*a-p*n,t[5]=m*l-p*s,t[6]=c,t[7]=u,t[8]=d,t}function tQ(t,e,r){const i=r[0],n=r[1],s=r[2];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t[6]=s*e[6],t[7]=s*e[7],t[8]=s*e[8],t}function LWe(t,e,r){const i=r[0],n=r[1];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t}function DWe(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function NWe(t,e){const r=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=r,t[2]=0,t[3]=-r,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function FWe(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function UWe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function rQ(t,e){const r=e[0],i=e[1],n=e[2],s=e[3],o=r+r,a=i+i,l=n+n,c=r*o,u=i*o,d=i*a,p=n*o,m=n*a,y=n*l,_=s*o,v=s*a,b=s*l;return t[0]=1-d-y,t[3]=u-b,t[6]=p+v,t[1]=u+b,t[4]=1-c-y,t[7]=m-_,t[2]=p-v,t[5]=m+_,t[8]=1-c-d,t}function Txe(t,e){const r=e[0],i=e[1],n=e[2],s=e[4],o=e[5],a=e[6],l=e[8],c=e[9],u=e[10],d=u*o-a*c,p=-u*s+a*l,m=c*s-o*l,y=r*d+i*p+n*m;if(!y)return null;const _=1/y;return t[0]=d*_,t[1]=(-u*i+n*c)*_,t[2]=(a*i-n*o)*_,t[3]=p*_,t[4]=(u*r-n*l)*_,t[5]=(-a*r+n*s)*_,t[6]=m*_,t[7]=(-c*r+i*l)*_,t[8]=(o*r-i*s)*_,t}function Qf(t,e){const r=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],m=e[11],y=e[12],_=e[13],v=e[14],b=e[15],x=r*a-i*o,T=r*l-n*o,S=r*c-s*o,A=i*l-n*a,C=i*c-s*a,R=n*c-s*l,P=u*_-d*y,F=u*v-p*y,k=u*b-m*y,V=d*v-p*_,z=d*b-m*_,X=p*b-m*v;let q=x*X-T*z+S*V+A*k-C*F+R*P;return q?(q=1/q,t[0]=(a*X-l*z+c*V)*q,t[1]=(l*k-o*X-c*F)*q,t[2]=(o*z-a*k+c*P)*q,t[3]=(n*z-i*X-s*V)*q,t[4]=(r*X-n*k+s*F)*q,t[5]=(i*k-r*z-s*P)*q,t[6]=(_*R-v*C+b*A)*q,t[7]=(v*S-y*R-b*T)*q,t[8]=(y*C-_*S+b*x)*q,t):null}function kWe(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function zWe(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function BWe(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)}function VWe(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Sxe(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function GWe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function jWe(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t[3]=e[3]+r[3]*i,t[4]=e[4]+r[4]*i,t[5]=e[5]+r[5]*i,t[6]=e[6]+r[6]*i,t[7]=e[7]+r[7]*i,t[8]=e[8]+r[8]*i,t}function HWe(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function WWe(t,e){const r=t[0],i=t[1],n=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=e[0],p=e[1],m=e[2],y=e[3],_=e[4],v=e[5],b=e[6],x=e[7],T=e[8],S=tl();return Math.abs(r-d)<=S*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(i-p)<=S*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(n-m)<=S*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(s-y)<=S*Math.max(1,Math.abs(s),Math.abs(y))&&Math.abs(o-_)<=S*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(a-v)<=S*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(l-b)<=S*Math.max(1,Math.abs(l),Math.abs(b))&&Math.abs(c-x)<=S*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(u-T)<=S*Math.max(1,Math.abs(u),Math.abs(T))}function iQ(t){const e=tl(),r=t[0],i=t[1],n=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return Math.abs(1-(r*r+s*s+l*l))<=e&&Math.abs(1-(i*i+o*o+c*c))<=e&&Math.abs(1-(n*n+a*a+u*u))<=e}const qWe=US,XWe=Sxe;Object.freeze(Object.defineProperty({__proto__:null,add:VWe,adjoint:$We,copy:MWe,determinant:IWe,equals:WWe,exactEquals:HWe,frob:BWe,fromMat2d:UWe,fromMat4:Ac,fromQuat:rQ,fromRotation:NWe,fromScaling:FWe,fromTranslation:DWe,identity:KZ,invert:Vw,isOrthoNormal:iQ,mul:qWe,multiply:US,multiplyScalar:GWe,multiplyScalarAndAdd:jWe,normalFromMat4:Qf,normalFromMat4Legacy:Txe,projection:kWe,rotate:eQ,scale:tQ,scaleByVec2:LWe,set:JZ,str:zWe,sub:XWe,subtract:Sxe,translate:r5,transpose:Uh},Symbol.toStringTag,{value:"Module"}));function rn(){return new Float32Array(3)}function i5(t){const e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function zr(t,e,r){const i=new Float32Array(3);return i[0]=t,i[1]=e,i[2]=r,i}function Exe(t,e){return new Float32Array(t,e,3)}function nQ(){return rn()}function Cxe(){return zr(1,1,1)}function Axe(){return zr(1,0,0)}function Oxe(){return zr(0,1,0)}function Rxe(){return zr(0,0,1)}const YWe=nQ(),ZWe=Cxe(),QWe=Axe(),JWe=Oxe(),KWe=Rxe();Object.freeze(Object.defineProperty({__proto__:null,ONES:ZWe,UNIT_X:QWe,UNIT_Y:JWe,UNIT_Z:KWe,ZEROS:YWe,clone:i5,create:rn,createView:Exe,fromValues:zr,ones:Cxe,unitX:Axe,unitY:Oxe,unitZ:Rxe,zeros:nQ},Symbol.toStringTag,{value:"Module"}));var El;(function(t){t[t.SIXTEEN=0]="SIXTEEN",t[t.HUNDRED=1]="HUNDRED",t[t.TWOHUNDRED=2]="TWOHUNDRED",t[t.COUNT=3]="COUNT"})(El||(El={}));let RD=class extends va{constructor(){super(...arguments),this.steps=El.SIXTEEN,this.writeTextureChannels=dw.RG}};h([U({count:El.COUNT})],RD.prototype,"steps",void 0),h([U({constValue:se("esri-mobile")?1024:2048})],RD.prototype,"cubeMapSize",void 0),h([U()],RD.prototype,"writeTextureChannels",void 0);let Z3=class{constructor(e,r,i,n,s,o,a,l,c=.5){this.coverage=e,this.density=r,this.absorption=i,this.cloudSize=n,this.detailSize=s,this.smoothness=o,this.cloudHeight=a,this.raymarchingSteps=l,this.median=c}};const Ene=new Z3([0,.6],[.03,.03],[0,0],[.9,.9],[.8,.8],[.7,.7],[.05,.05],El.SIXTEEN),ea={sunny:Ene,cloudy:new Z3([.3,.65],[.2,.4],[0,0],[.85,.85],[.75,.75],[.3,.4],[1,1],El.TWOHUNDRED,.6),rainy:new Z3([.6,.8],[.5,.8],[.1,.5],[.9,.9],[.75,.75],[.5,.5],[1,1],El.TWOHUNDRED,.4),snowy:new Z3([.25,.75],[.3,.3],[0,0],[.95,.95],[.7,.7],[.69,.75],[.3,1],El.HUNDRED,.65),foggy:new Z3([.8,.8],[.5,.5],[0,0],[.95,.95],[.9,.9],[.55,.55],[.3,.3],El.SIXTEEN),default:Ene},nh=se("esri-mobile")?64:128,eqe=nh/128,Ad=Math.ceil(Math.sqrt(nh)),C_=(nh+2)*Ad,tqe=1e5,Uk=128,rqe=C_/1560;function Vh(t,e=!0){t.attributes.add(E.POSITION,"vec2"),e&&t.varyings.add("uv","vec2"),t.vertex.code.add(w` + void main(void) { + gl_Position = vec4(position, 0.0, 1.0); + ${e?w`uv = position * 0.5 + vec2(0.5);`:""} + } + `)}let xR=class extends ln{constructor(e,r){super(e,"mat3",jr.Draw,(i,n,s)=>i.setUniformMatrix3fv(e,r(n,s)))}},Pxe=class extends Wr{constructor(){super(...arguments),this.cloudRadius=0,this.cloudSize=0,this.detailSize=0,this.absorption=0,this.density=0,this.smoothness=0,this.cloudHeight=0,this.coverage=0,this.raymarchingSteps=ea.default.raymarchingSteps,this.weatherTile=Ne()}},Mxe=class extends Wr{constructor(){super(...arguments),this.viewMatrix=hi()}};function iqe(t){const e=new mr;e.include(Vh,!1);const r=e.fragment;return r.uniforms.add(new Ce("cloudRadius",i=>i.cloudRadius),new Ce("power",i=>wt(35,120,i.absorption)),new Ce("sigmaE",i=>1+i.absorption),new Ce("density",i=>wt(0,.3,i.density)),new Ce("cloudSize",i=>wt(0,.02,Math.max(.01,1-i.cloudSize))),new Ce("detailSize",i=>wt(0,.2,Math.max(.01,1-i.detailSize))),new Ce("smoothness",i=>wt(0,.5,1-i.smoothness)),new Ce("cloudHeight",i=>wt(0,1500,i.cloudHeight)),new Ce("coverage",i=>i.coverage),new xR("view",i=>i.viewMatrix),new Ye("cloudShapeTexture",i=>i.noiseTexture!=null?i.noiseTexture.textureAtlas:null),new yr("cloudVariables",i=>er(nqe,i.coverage,i.absorption))),r.constants.add("halfCubeMapSize","float",.5*t.cubeMapSize),r.code.add(w` + const int STEPS = ${t.steps===El.SIXTEEN?w`16`:t.steps===El.HUNDRED?w`100`:w`200`}; + const int STEPS_LIGHT = 6; + const float stepL = 300.0 / float(STEPS_LIGHT); + const float cloudStart = 1500.0; + + vec3 rayDirection(vec2 fragCoord) { + vec2 xy = fragCoord - halfCubeMapSize; + return normalize(vec3(-xy, -halfCubeMapSize)); + } + + float remap(float x, float low1, float high1, float low2, float high2) { + return low2 + (x - low1) * (high2 - low2) / (high1 - low1); + } + + float saturate(float x) { + return clamp(x, 0.0, 1.0); + }`),r.code.add(w` + float getCloudShape(vec3 pos, float pOffset) { + const float textureWidth = ${w.float(C_)}; + const float dataWidth = ${w.float(C_)}; + const float tileRows = ${w.float(Ad)}; + const vec3 atlasDimensions = vec3(${w.float(nh)}, ${w.float(nh)}, tileRows * tileRows); + + //Change from Y being height to Z being height + vec3 p = float(${w.float(eqe)}) * pos.xzy; + + //Pixel coordinates of point in the 3D data + vec3 coord = vec3(mod(p - pOffset * atlasDimensions, atlasDimensions)); + float f = fract(coord.z); + float level = floor(coord.z); + float tileY = floor(level / tileRows); + float tileX = level - tileY * tileRows; + + //The data coordinates are offset by the x and y tile, the two boundary cells between each tile pair and the initial boundary cell on the first row/column + vec2 offset = atlasDimensions.x * vec2(tileX, tileY) + 2.0 * vec2(tileX, tileY) + 1.0; + vec2 pixel = coord.xy + offset; + vec2 data = texture(cloudShapeTexture, mod(pixel, dataWidth) / textureWidth).xy; + + return 1.0 - mix(data.x, data.y, f); + } + + float getCloudMap(vec2 p){ + // Shift the texture center to origin to avoid seam artifacts + vec2 uv = (${w.float(rqe)} * p) / ${w.float(C_)} + 0.5; + + return texture(cloudShapeTexture, uv).a; + } + `),r.code.add(w`float clouds(vec3 p) { +float cloud = saturate(0.5 * mix(0.0, 1.0, min(2.0 * coverage, 1.0))); +if (cloud <= 0.0) { +return 0.0; +} +float cloudMap = getCloudMap(cloudSize * p.xy); +cloud = mix(cloud, min(2.0 * (coverage), 1.0) * cloudMap, min(2.0 * (1.0 - coverage), 1.0)); +if (cloud <= 0.0) { +return 0.0; +} +float shape = getCloudShape(8.0 * cloudSize * p, 0.0); +cloud = saturate(remap(cloud, smoothness * shape, 1.0, 0.0, 1.0)); +if (cloud <= 0.0) { +return 0.0; +} +float heightFraction = saturate((length(p) - cloudRadius - cloudStart) / cloudHeight); +cloud *= saturate(remap(heightFraction, 0.0, 0.25, 0.0, 1.0)) * smoothstep(1.0, 0.25, heightFraction); +if (cloud <= 0.0) { +return 0.0; +} +return density * saturate(remap(cloud, 0.35 * smoothness * getCloudShape(detailSize * p, 0.0), 1.0, 0.0, 1.0)); +}`),r.code.add(w`vec2 sphereIntersections(vec3 start, vec3 dir, float radius) { +float a = dot(dir, dir); +float b = 2.0 * dot(dir, start); +float c = dot(start, start) - (radius * radius); +float d = (b * b) - 4.0 * a * c; +if (d < 0.0) { +return vec2(1e5, -1e5); +} +return vec2((-b - sqrt(d)) / (2.0 * a), (-b + sqrt(d)) / (2.0 * a)); +} +float HenyeyGreenstein(float g, float costh) { +return (1.0 / (4.0 * 3.1415)) * ((1.0 - g * g) / pow(1.0 + g * g - 2.0 * g * costh, 1.5)); +}`),r.code.add(` + float multipleOctaves(float extinction, float mu, float stepL) { + float attenuation = 1.0; + float contribution = 1.0; + float phaseAttenuation = 1.0; + float luminance = 0.0; + + for (int i = 0; i < 4; i++) { + float phase = mix(HenyeyGreenstein(0.0, mu), HenyeyGreenstein(0.3 * phaseAttenuation, mu), 0.7); + luminance += contribution * phase * exp(-stepL * extinction * sigmaE * attenuation); + attenuation *= 0.2; + contribution *= 0.6; + phaseAttenuation *= 0.5; + } + + return luminance; + }`),r.code.add(w`float lightRay(vec3 org, vec3 p, float phaseFunction, float mu, vec3 sunDirection) { +float lightRayDensity = clouds(p); +lightRayDensity += clouds(p + sunDirection * 1.0 * stepL); +lightRayDensity += clouds(p + sunDirection * 2.0 * stepL); +lightRayDensity += clouds(p + sunDirection * 3.0 * stepL); +lightRayDensity += clouds(p + sunDirection * 4.0 * stepL); +lightRayDensity += clouds(p + sunDirection * 5.0 * stepL); +float beersLaw = multipleOctaves(lightRayDensity, mu, stepL); +return mix(beersLaw * 2.0 * (1.0 - (exp(-stepL * lightRayDensity * 2.0 * sigmaE ))), beersLaw, 0.5 + 0.5 * mu); +}`),r.code.add(w`float mainRay(vec3 org, vec3 dir, vec3 sunDirection, float distToStart, float totalDistance, out float totalTransmittance) { +if (dir.z < 0.0) { +return 0.0; +} +totalTransmittance = 1.0; +float stepS = totalDistance / float(STEPS); +float cameraHeight = length(org); +float mu = 0.5 + 0.5 * dot(sunDirection, dir); +float phaseFunction = mix(HenyeyGreenstein(-0.3, mu), HenyeyGreenstein(0.3, mu), 0.7); +vec3 p = org + distToStart * dir; +float dist = distToStart; +float shading = 0.0; +for (int i = 0; i < STEPS; i++) { +float sampleDensity = clouds(p); +float sampleSigmaE = sampleDensity * sigmaE; +if (sampleDensity > 0.0 ) { +float ambient = mix((1.2), (1.6), saturate((length(p) - cloudRadius - cloudStart) / cloudHeight)); +float luminance = sampleDensity * (ambient + power * phaseFunction * lightRay(org, p, phaseFunction, mu, sunDirection)); +float transmittance = exp(-sampleSigmaE * stepS); +shading += totalTransmittance * (luminance - luminance * transmittance) / sampleSigmaE; +totalTransmittance *= transmittance; +if (totalTransmittance <= 0.001) { +totalTransmittance = 0.0; +break; +} +} +dist += stepS; +p = org + dir * dist; +} +return shading; +}`),r.code.add(w`void main() { +if (coverage == 0.0) { +fragColor = vec4(0.0, 1.0, 0.0, 1.0); +return; +} +vec3 rayDir = rayDirection(gl_FragCoord.xy); +rayDir = normalize(view * rayDir); +vec3 viewPos = vec3(0, 0, cloudRadius + 1.0); +bool hitsPlanet = rayDir.z < 0.0; +float hazeFactor = smoothstep(-0.01, mix(0.0, 0.075, cloudVariables.x), abs(dot(rayDir, vec3(0, 0, 1)))); +float totalTransmittance = 1.0; +float shading = 0.0; +if (hitsPlanet) { +shading = clamp(1.0 - cloudVariables.y, 0.6, 1.0) * (1.0 - hazeFactor); +totalTransmittance = hazeFactor; +fragColor = vec4(shading, totalTransmittance, shading, totalTransmittance); +return; +} +vec2 rayStartIntersect = sphereIntersections(viewPos, rayDir, cloudRadius + cloudStart); +vec2 rayEndIntersect = sphereIntersections(viewPos, rayDir, cloudRadius + cloudStart + cloudHeight); +float distToStart = rayStartIntersect.y; +float totalDistance = rayEndIntersect.y - distToStart; +vec3 sunDirection = normalize(vec3(0, 0, 1)); +shading = 0.5 * mainRay(viewPos, rayDir, sunDirection, distToStart, totalDistance, totalTransmittance); +shading = mix(clamp(1.0 - cloudVariables.y, 0.6, 1.0), shading, hazeFactor); +totalTransmittance = mix(0.0, totalTransmittance, hazeFactor); +fragColor = vec4(shading, totalTransmittance, shading, totalTransmittance); +}`),e}const nqe=Ne(),sqe=Object.freeze(Object.defineProperty({__proto__:null,CloudsDrawParameters:Mxe,CloudsPassParameters:Pxe,build:iqe},Symbol.toStringTag,{value:"Module"}));let $xe=class Ixe extends Tr{constructor(e,r){super(e,r,()=>this.destroy())}initializeProgram(e){return new vr(e.rctx,Ixe.shader.get().build(this.configuration),fr)}initializePipeline(){return Ot({blending:Cc(ve.CONSTANT_COLOR,ve.ONE_MINUS_CONSTANT_COLOR,Zf.ADD,this.configuration.writeTextureChannels===dw.RG?[1,1,0,0]:[0,0,1,1]),depthTest:{func:Hr.LEQUAL},colorWrite:Ft})}};$xe.shader=new _r(sqe,()=>ce(()=>import("./Clouds.glsl-918fa9c8.js"),[]));var su;(function(t){t[t.Full=0]="Full",t[t.WeatherMap=1]="WeatherMap",t[t.COUNT=2]="COUNT"})(su||(su={}));let _j=class extends va{constructor(){super(...arguments),this.mode=su.Full}};h([U({count:su.COUNT})],_j.prototype,"mode",void 0);let Lxe=class extends Wr{constructor(){super(...arguments),this.weatherTile=or(0,0)}};function oqe(t){const e=new mr;return e.include(Vh,!1),e.fragment.code.add(w`float remap(float x, float low1, float high1, float low2, float high2) { +return low2 + (x - low1) * (high2 - low2) / (high1 - low1); +}`),t.mode===su.Full&&e.fragment.code.add(w` + float saturate(float x) { + return clamp(x, 0.0, 1.0); + } + + // Safer modulo for positive and negative values + vec3 modulo(vec3 m, float n){ + return mod(mod(m, n) + n, n); + } + + vec3 hash(vec3 p3, float frequency){ + p3 = modulo(p3, frequency); + p3 = fract(p3 * vec3(0.1031, 0.1030, 0.0973)); + p3 += dot(p3, p3.yxz + 33.33); + return -1.0 + 2.0 * fract((p3.xxy + p3.yxx) * p3.zyx); + } + + // 5th order polynomial interpolation + vec3 fade(vec3 t){ + return (t * t * t) * (t * (t * 6.0 - 15.0) + 10.0); + } + + float gradientNoise(vec3 p, float frequency){ + // Cell point is in + vec3 i = floor(p); + + // Position in the cell in [0, 1] + vec3 f = fract(p); + + // Interpolation value for gradient mixing + vec3 u = fade(f); + + // Trilinear interpolation of gradients at cube vertices around point + return mix( mix( mix( dot( hash( i + vec3(0.0,0.0,0.0), frequency), f - vec3(0.0,0.0,0.0) ), + dot( hash( i + vec3(1.0,0.0,0.0), frequency), f - vec3(1.0,0.0,0.0) ), u.x), + mix( dot( hash( i + vec3(0.0,1.0,0.0), frequency), f - vec3(0.0,1.0,0.0) ), + dot( hash( i + vec3(1.0,1.0,0.0), frequency), f - vec3(1.0,1.0,0.0) ), u.x), u.y), + mix( mix( dot( hash( i + vec3(0.0,0.0,1.0), frequency), f - vec3(0.0,0.0,1.0) ), + dot( hash( i + vec3(1.0,0.0,1.0), frequency), f - vec3(1.0,0.0,1.0) ), u.x), + mix( dot( hash( i + vec3(0.0,1.0,1.0), frequency), f - vec3(0.0,1.0,1.0) ), + dot( hash( i + vec3(1.0,1.0,1.0), frequency), f - vec3(1.0,1.0,1.0) ), u.x), u.y), u.z ); + } + + float getPerlinNoise(vec3 pos, float frequency) { + float octaveFrequencyFactor = 2.0; + float sum = 0.0; + float weightSum = 0.0; + float weight = 1.0; + + for (int oct = 0; oct < 3; oct++) { + vec3 p = pos * frequency; + float val = 0.5 + 0.5 * gradientNoise(p, frequency); + sum += val * weight; + weightSum += weight; + weight *= 0.5; + frequency *= octaveFrequencyFactor; + } + + float noise = (sum / weightSum); + noise = saturate(noise); + return noise; + } + + float worley(vec3 pos, float numCells) { + vec3 p = pos * numCells; + float d = 1.0e10; + + for (int x = -1; x <= 1; x++) { + for (int y = -1; y <= 1; y++) { + for (int z = -1; z <= 1; z++) { + vec3 tp = floor(p) + vec3(x, y, z); + tp = p - tp - (hash(tp, numCells) * 0.5 + 0.5); + d = min(d, dot(tp, tp)); + } + } + } + + return 1.0 - clamp(d, 0.0, 1.0); + } + + vec3 get3Dfrom2D(vec2 uv) { + vec2 tile = floor(uv); + float z = floor(${w.float(Ad)} * tile.y + tile.x); + return vec3(fract(uv), z); + } + + float getTextureForPointPerlinWorley(vec3 p) { + float perlinNoise = getPerlinNoise(p, ${w.float(8)}); + + float worley0 = worley(p, ${w.float(2)} * 2.0); + float worley1 = worley(p, ${w.float(2)} * 8.0); + float worley2 = worley(p, ${w.float(2)} * 14.0); + + float worleyFBM = worley0 * 0.625 + worley1 * 0.25 + worley2 * 0.125; + return remap(perlinNoise, 0.0, 1.0, worleyFBM, 1.0); + } + + float getTextureForPointWorley(vec3 p) { + float worley0 = worley(p, ${w.float(2)}); + float worley1 = worley(p, ${w.float(2)} * 2.0); + float worley2 = worley(p, ${w.float(2)} * 4.0); + float worley3 = worley(p, ${w.float(2)} * 8.0); + + float FBM0 = worley0 * 0.625 + worley1 * 0.25 + worley2 * 0.125; + float FBM1 = worley1 * 0.625 + worley2 * 0.25 + worley3 * 0.125; + float FBM2 = worley2 * 0.75 + worley3 * 0.25; + + return FBM0 * 0.625 + FBM1 * 0.25 + FBM2 * 0.125; + } + `),e.fragment.uniforms.add(new yr("weatherTile",r=>r.weatherTile)),e.fragment.code.add(w` + vec2 modulo(vec2 m, float n){ + return mod(mod(m, n) + n, n); + } + + vec2 hash(vec2 p){ + // Get position of p in weather tile + p = modulo(p, ${w.float(Uk)}); + + // Get global coordinates of p + p += weatherTile * ${w.float(Uk)}; + + // Limit position to avoid numerical instability + p = modulo(p, ${w.float(tqe)}); + + vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973)); + p3 += dot(p3, p3.yzx + 33.33); + return 2.0 * fract((p3.xx + p3.yz) * p3.zy) - 1.0; + } + + vec2 fade(vec2 t){ + return (t * t * t) * (t * (t * 6.0 - 15.0) + 10.0); + } + + float gradientNoise(vec2 p){ + vec2 i = floor( p ); + vec2 f = fract( p ); + + vec2 u = fade(f); + + // Bilinear interpolation of gradients at cell vertices around point + return mix( + mix(dot( hash( i + vec2(0.0,0.0) ), f - vec2(0.0,0.0) ), + dot( hash( i + vec2(1.0,0.0) ), f - vec2(1.0,0.0) ), u.x), + mix(dot( hash( i + vec2(0.0,1.0) ), f - vec2(0.0,1.0) ), + dot( hash( i + vec2(1.0,1.0) ), f - vec2(1.0,1.0) ), u.x), + u.y); + } + + float worley(vec2 p){ + float d = 1.0e10; + for (int x = -1; x <= 1; x++){ + for (int y = -1; y <= 1; y++){ + vec2 tp = floor(p) + vec2(x, y); + tp = p - tp - (0.5 + 0.5 * hash(tp)); + d = min(d, dot(tp, tp)); + } + } + return 1.0 - clamp(d, 0.0, 1.0); + } + `),e.fragment.code.add(w`void main() {`),t.mode===su.Full&&e.fragment.code.add(w` + float padWidth = 1.0; + float paddedSize = ${w.float(nh)} + 2.0 * padWidth; + float tileCount = ${w.float(Ad)} * ${w.float(Ad)}; + vec2 tile = floor((gl_FragCoord.xy - 0.5) / paddedSize); + + bool padCell = false; + if (mod(gl_FragCoord.x, paddedSize) == 0.5 || mod(gl_FragCoord.x, paddedSize) == paddedSize - 0.5) { + padCell = true; + } + + if (mod(gl_FragCoord.y, paddedSize) == 0.5 || mod(gl_FragCoord.y, paddedSize) == paddedSize - 0.5) { + padCell = true; + } + + bool startPadX = false; + bool startPadY = false; + bool endPadX = false; + bool endPadY = false; + + if (gl_FragCoord.x == tile.x * paddedSize + 0.5) { + startPadX = true; + } + + if (gl_FragCoord.y == tile.y * paddedSize + 0.5) { + startPadY = true; + } + + if (gl_FragCoord.x == (tile.x + 1.0) * paddedSize - 0.5) { + endPadX = true; + } + + if (gl_FragCoord.y == (tile.y + 1.0) * paddedSize - 0.5) { + endPadY = true; + } + + vec2 padding = vec2(2.0 * padWidth) * tile; + vec2 uv; + + if (padCell) { + vec2 pixel = gl_FragCoord.xy - padWidth - padding; + + if (startPadX) { + pixel.x += ${w.float(nh)}; + } + + if (startPadY) { + pixel.y += ${w.float(nh)}; + } + + if (endPadX) { + pixel.x -= ${w.float(nh)}; + } + + if (endPadY) { + pixel.y -= ${w.float(nh)}; + } + + uv = vec2(pixel.xy / ${w.float(nh)}); + } else { + vec2 pixel = gl_FragCoord.xy - padWidth - padding; + uv = vec2(pixel.xy / ${w.float(nh)}); + } + + vec3 p_ = get3Dfrom2D(uv); + vec3 p = p_; + p.z /= (${w.float(Ad)} * ${w.float(Ad)}); + + float worleyPerlinNoise = getTextureForPointPerlinWorley(p); + float worleyNoise = getTextureForPointWorley(p); + + fragColor.r = saturate(remap(worleyPerlinNoise, worleyNoise, 1.0, 0.0, 1.0)); + + p_ = mod(p_ + 1.0, ${w.float(Ad)} * ${w.float(Ad)}); + p = p_; + p.z /= (${w.float(Ad)} * ${w.float(Ad)}); + + worleyPerlinNoise = getTextureForPointPerlinWorley(p); + worleyNoise = getTextureForPointWorley(p); + + fragColor.g = saturate(remap(worleyPerlinNoise, worleyNoise, 1.0, 0.0, 1.0)); + `),e.fragment.code.add(w` + vec2 mapUV = ${w.float(Uk)} * (gl_FragCoord.xy / ${w.float(C_)}); + float map = abs(gradientNoise(mapUV)); + map = remap(map, 0.25 * (1.0 - worley(8.0 * mapUV)), 1.0, 0.0, 1.0); + + ${t.mode===su.Full?w`fragColor.ba = vec2(0.0, map);`:w`fragColor = vec4(map);`}; + } + `),e}const aqe=Object.freeze(Object.defineProperty({__proto__:null,NoiseTextureAtlasPassParameters:Lxe,build:oqe},Symbol.toStringTag,{value:"Module"}));let vj=class Dxe extends Tr{initializeProgram(e){return new vr(e.rctx,Dxe.shader.get().build(this.configuration),fr)}initializePipeline(){return Ot({blending:this.configuration.mode===su.Full?Cc(ve.ONE,ve.ZERO):So(ve.ZERO,ve.ONE,ve.ONE,ve.ZERO),depthTest:{func:Hr.ALWAYS},colorWrite:Ft})}};vj.shader=new _r(aqe,()=>ce(()=>import("./NoiseTextureAtlas.glsl-655df1b4.js"),[]));let n5=class{constructor(e,r,i=r){this.internalFormat=e,this.width=r,this.height=i,this.multisampled=!1,this.samples=1}};function lqe(t){return t.width<=0||t.height<=0||t.internalFormat==null?0:t.width*t.height*WZ(t.internalFormat)}let cqe=class{constructor(e,r){this._context=e,this._descriptor=r,this.type=j_.RenderBuffer,this._context.instanceCounter.increment(Es.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:n,height:s,internalFormat:o,multisampled:a}=r;if(a){if(this._context.type!==rr.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,o,n,s)}else i.renderbufferStorage(i.RENDERBUFFER,o,n,s)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,r=this._context.parameters.maxSamples;return e?Math.min(e,r):r}get gpuMemoryUsage(){return lqe(this._descriptor)}resize(e,r){const i=this._descriptor;if(i.width===e&&i.height===r)return;i.width=e,i.height=r;const n=this._context.gl;this._context.bindRenderbuffer(this),i.multisampled?n.renderbufferStorageMultisample(n.RENDERBUFFER,this.samples,i.internalFormat,i.width,i.height):n.renderbufferStorage(n.RENDERBUFFER,i.internalFormat,i.width,i.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(Es.Renderbuffer,this),this._context=lE(this._context))}};const uqe=J.getLogger("esri.views.webgl.FramebufferObject");let hs=class E2{constructor(e,r,i=null){this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthBuffer=null,this._stencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(Es.FramebufferObject,this);const n=PD(r)?r:new Ct(this._context,r);if(this._colorAttachments.set(qc.COLOR_ATTACHMENT0,n),this._validateTextureDescriptor(n.descriptor),this._validateColorAttachmentPoint(qc.COLOR_ATTACHMENT0),i!=null)if(dqe(i))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=PD(i)?i:new Ct(this._context,i),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const s=hqe(i)?i:new cqe(this._context,i),o=s.descriptor;o.internalFormat===jn.STENCIL_INDEX8?this._stencilBuffer=s:this._depthBuffer=s,this._validateRenderBufferDescriptor(o)}}dispose(){var r,i;if(this._colorAttachments.size===0&&!this._glName)return;const e=this._context.getBoundFramebufferObject();this._colorAttachments.forEach((n,s)=>{var o;return(o=this.detachColorTexture(s))==null?void 0:o.dispose()}),(r=this.detachDepthStencilBuffer())==null||r.dispose(),(i=this.detachDepthStencilTexture())==null||i.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(Es.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(qc.COLOR_ATTACHMENT0)}get depthStencilAttachment(){return this._depthStencilTexture||this._depthBuffer||this._stencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){var r;const e=this._colorAttachments.get(qc.COLOR_ATTACHMENT0);return((r=e==null?void 0:e.descriptor)==null?void 0:r.width)??0}get height(){var r;const e=this._colorAttachments.get(qc.COLOR_ATTACHMENT0);return((r=e==null?void 0:e.descriptor)==null?void 0:r.height)??0}get gpuMemoryUsage(){var e;return[...this._colorAttachments].reduce((r,[i,n])=>r+n.gpuMemoryUsage,((e=this.depthStencilAttachment)==null?void 0:e.gpuMemoryUsage)??0)}getColorTexture(e){const r=this._colorAttachments.get(e);return r&&PD(r)?r:null}attachColorTexture(e,r=qc.COLOR_ATTACHMENT0){var n;if(!e)return;this._validateColorAttachmentPoint(r);const i=e.descriptor;this._validateTextureDescriptor(i),(n=this.detachColorTexture(r))==null||n.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,r)),this._colorAttachments.set(r,e)}detachColorTexture(e=qc.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(e);if(r)return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),r}setColorTextureTarget(e,r=qc.COLOR_ATTACHMENT0){const i=this._colorAttachments.get(r);i&&this._framebufferTexture2D(i.glName,r,e)}attachDepthStencil(e){if(e)switch(e.type){case j_.Texture:return this._attachDepthStencilTexture(e);case j_.RenderBuffer:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){var i;if(e==null)return;const r=e.descriptor;r.pixelFormat!==Tt.DEPTH_STENCIL&&r.pixelFormat!==Tt.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),r.dataType!==Un.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(r),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,dne)),(i=this._depthStencilTexture)==null||i.dispose(),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,dne)),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){var i;if(e==null)return;const r=e.descriptor;if(r.internalFormat!==jn.DEPTH_STENCIL&&r.internalFormat!==jn.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),this._validateRenderBufferDescriptor(r),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const n=this._context.gl,s=this._getGLAttachmentPoint(r);n.framebufferRenderbuffer(mo.FRAMEBUFFER,s,n.RENDERBUFFER,e.glName)}(i=this._depthBuffer)==null||i.dispose(),this._depthBuffer=e}detachDepthStencilBuffer(){const e=this._depthBuffer;if(e&&this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,i=this._getGLAttachmentPoint(e.descriptor);r.framebufferRenderbuffer(mo.FRAMEBUFFER,i,r.RENDERBUFFER,null),e.dispose()}return this._depthBuffer=null,e}copyToTexture(e,r,i,n,s,o,a){(e<0||r<0||s<0||o<0)&&console.error("Offsets cannot be negative!"),(i<=0||n<=0)&&console.error("Copy width and height must be greater than zero!");const l=a.descriptor;a.descriptor.target!==nn.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),((l==null?void 0:l.width)==null||(l==null?void 0:l.height)==null||e+i>this.width||r+n>this.height||s+i>l.width||o+n>l.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,u=c.bindTexture(a,Ct.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(Ct.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(nn.TEXTURE_2D,0,s,o,e,r,i,n),c.bindTexture(u,Ct.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,r,i,n,s,o,a){(i<=0||n<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,r,i,n,s,o,a)}async readPixelsAsync(e,r,i,n,s,o,a){if(this._context.type!==rr.WEBGL2)return eh()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,r,i,n,s,o,a);const l=this._context.gl,c=Ar.createPixelPack(this._context,gr.STREAM_READ,a.byteLength);this._context.bindBuffer(c),this._context.bindFramebuffer(this),l.readPixels(e,r,i,n,s,o,0),this._context.unbindBuffer(bt.PIXEL_PACK_BUFFER),await c.getSubDataAsync(a),c.dispose()}resize(e,r){var n,s,o;if(this.width===e&&this.height===r)return;const i={width:e,height:r};_b(i,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(a=>a.resize(i.width,i.height)),(n=this._depthStencilTexture)==null||n.resize(i.width,i.height),this._initialized&&(_b(i,this._context.parameters.maxRenderbufferSize),(s=this._depthBuffer)==null||s.resize(i.width,i.height),(o=this._stencilBuffer)==null||o.resize(i.width,i.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(e=mo.FRAMEBUFFER){const r=this._context.gl;if(this._initialized)return void r.bindFramebuffer(e,this.glName);this._glName&&r.deleteFramebuffer(this._glName);const i=r.createFramebuffer();r.bindFramebuffer(e,i),this._colorAttachments.forEach((s,o)=>this._framebufferTexture2D(s.glName,o,Cne(s),e));const n=this._depthBuffer||this._stencilBuffer;if(n){const s=this._getGLAttachmentPoint(n.descriptor);r.framebufferRenderbuffer(e,s,r.RENDERBUFFER,n.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,r.DEPTH_STENCIL_ATTACHMENT,Cne(this._depthStencilTexture),e);eh()&&r.checkFramebufferStatus(e)!==r.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=i,this._initialized=!0}_framebufferTexture2D(e,r=qc.COLOR_ATTACHMENT0,i=nn.TEXTURE_2D,n=mo.FRAMEBUFFER,s=0){this._context.gl.framebufferTexture2D(n,r,i,e,s)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthBuffer){if(this._initialized){this._context.bindFramebuffer(this);const r=this._getGLAttachmentPoint(this._depthBuffer.descriptor);e.framebufferRenderbuffer(mo.FRAMEBUFFER,r,e.RENDERBUFFER,null)}this._depthBuffer=Le(this._depthBuffer)}this._stencilBuffer&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(mo.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,null)),this._stencilBuffer=Le(this._stencilBuffer)),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=Le(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==nn.TEXTURE_2D&&e.target!==nn.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),_b(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderBufferDescriptor(e){_b(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case jn.DEPTH_COMPONENT16:case jn.DEPTH_COMPONENT24:case jn.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case jn.DEPTH24_STENCIL8:case jn.DEPTH32F_STENCIL8:case jn.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case jn.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(E2._MAX_COLOR_ATTACHMENTS===-1){const i=this._context.capabilities.drawBuffers;if(i){const n=this._context.gl;E2._MAX_COLOR_ATTACHMENTS=n.getParameter(i.MAX_COLOR_ATTACHMENTS)}else E2._MAX_COLOR_ATTACHMENTS=1}const r=e-qc.COLOR_ATTACHMENT0;r+1>E2._MAX_COLOR_ATTACHMENTS&&J.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${r+1}. Implementation supports up to ${E2._MAX_COLOR_ATTACHMENTS} color attachments`)}};function PD(t){return t!=null&&"type"in t&&t.type===j_.Texture}function hqe(t){return t!=null&&"type"in t&&t.type===j_.RenderBuffer}function dqe(t){return PD(t)||t!=null&&"pixelFormat"in t}function _b(t,e){const r=Math.max(t.width,t.height);if(r>e){uqe.warn(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const i=e/r;return t.width=Math.round(t.width*i),t.height=Math.round(t.height*i),!1}return!0}function Cne(t){return t.descriptor.target===nn.TEXTURE_CUBE_MAP?nn.TEXTURE_CUBE_MAP_POSITIVE_X:nn.TEXTURE_2D}hs._MAX_COLOR_ATTACHMENTS=-1;let Q3=class extends xe{constructor(e){super(e),this._needsRender=!0,this._passParameters=new Lxe,this._frameBuffer=new hs(e.context.renderContext.rctx,new pr(C_)),this._vao=Dl(e.context.renderContext.rctx)}get _techniqueRepository(){return this.context.techniqueRepository}get textureAtlas(){return this._texture!=null?this._weatherMapTechnique!=null&&this._weatherMapTechnique.compiled&&this._needsRender&&(this._texture=this._render(su.WeatherMap)):this._fullTechnique!=null&&this._fullTechnique.compiled&&(this._texture=this._render(su.Full)),this._texture}_setDirty(){this._needsRender=!0}updateWeatherMap(e){this._passParameters.weatherTile[0]===e[0]&&this._passParameters.weatherTile[1]===e[1]||(fs(this._passParameters.weatherTile,e),this._setDirty())}destroy(){this._fullTechniqueCached=Fi(this._fullTechniqueCached),this._weatherMapTechniqueCached=Fi(this._weatherMapTechniqueCached),this._frameBuffer=Le(this._frameBuffer),this._vao=Le(this._vao)}get _fullTechnique(){if(this._fullTechniqueCached==null){const e=new _j;e.mode=su.Full,this._fullTechniqueCached=this._techniqueRepository.acquire(vj,e)}return this._fullTechniqueCached}get _weatherMapTechnique(){if(this._weatherMapTechniqueCached==null){const e=new _j;e.mode=su.WeatherMap,this._weatherMapTechniqueCached=this._techniqueRepository.acquire(vj,e)}return this._weatherMapTechniqueCached}_render(e){if(this._vao==null||this._frameBuffer==null)return null;const r=e===su.Full?this._fullTechnique:this._weatherMapTechnique,i=this.context.renderContext.rctx,n=i.getViewport();i.setViewport(0,0,C_,C_),i.bindFramebuffer(this._frameBuffer);const s=i.bindTechnique(r,this._passParameters,null);return i.bindVAO(this._vao),s.assertCompatibleVertexAttributeLocations(this._vao),i.gl.drawArrays(i.gl.TRIANGLE_STRIP,0,4),i.setViewport(n.x,n.y,n.width,n.height),this._needsRender=!1,this._frameBuffer.colorTexture}};h([f({constructOnly:!0})],Q3.prototype,"context",void 0),h([f({readOnly:!0})],Q3.prototype,"_techniqueRepository",null),Q3=h([N("esri.views.3d.environment.NoiseTextureAtlas")],Q3);function Nxe(t){t.include(wu),t.uniforms.add(new Ye("geometryDepthTexture",(e,r)=>r.multipassGeometry.linearDepthTexture),new yr("nearFar",(e,r)=>r.camera.nearFar)),t.code.add(w`bool geometryDepthTest(vec2 pos, float elementDepth) { +float geometryDepth = linearDepthFromTexture(geometryDepthTexture, pos, nearFar); +return (elementDepth < (geometryDepth - 1.0)); +}`)}let pqe=class{constructor(){this.enabled=!1}};function xu(t,e){e.hasMultipassTerrain&&(t.fragment.include(wu),t.fragment.uniforms.add(new Ye("terrainDepthTexture",(r,i)=>i.multipassTerrain.linearDepthTexture)),t.fragment.uniforms.add(new yr("nearFar",(r,i)=>i.camera.nearFar)),t.fragment.uniforms.add(new yr("inverseViewport",(r,i)=>i.inverseViewport)),t.fragment.code.add(w` + void terrainDepthTest(vec4 fragCoord, float fragmentDepth){ + float terrainDepth = linearDepthFromTexture(terrainDepthTexture, fragCoord.xy * inverseViewport, nearFar); + if(fragmentDepth ${e.cullAboveGround?">":"<="} terrainDepth){ + discard; + } + } + `))}let fqe=class{constructor(){this.enabled=!1,this.cullAboveGround=!1}};function mqe(t,e){const r=t.fragment;r.include(wu),r.uniforms.add(new yr("nearFar",(i,n)=>n.camera.nearFar)),r.uniforms.add(new Ye("depthMap",(i,n)=>n.linearDepthTexture)),r.uniforms.add(new Mi("proj",(i,n)=>n.ssr.camera.projectionMatrix)),r.uniforms.add(new Ce("invResolutionHeight",(i,n)=>1/n.ssr.camera.height)),r.uniforms.add(new Mi("reprojectionMatrix",(i,n)=>n.ssr.reprojectionMatrix)),r.code.add(w` + vec2 reprojectionCoordinate(vec3 projectionCoordinate) + { + vec4 zw = proj * vec4(0.0, 0.0, -projectionCoordinate.z, 1.0); + vec4 reprojectedCoord = reprojectionMatrix * vec4(zw.w * (projectionCoordinate.xy * 2.0 - 1.0), zw.z, zw.w); + reprojectedCoord.xy /= reprojectedCoord.w; + return reprojectedCoord.xy * 0.5 + 0.5; + } + + const int maxSteps = ${e.highStepCount?"150":"75"}; + + vec4 applyProjectionMat(mat4 projectionMat, vec3 x) + { + vec4 projectedCoord = projectionMat * vec4(x, 1.0); + projectedCoord.xy /= projectedCoord.w; + projectedCoord.xy = projectedCoord.xy*0.5 + 0.5; + return projectedCoord; + } + + vec3 screenSpaceIntersection(vec3 dir, vec3 startPosition, vec3 viewDir, vec3 normal) + { + vec3 viewPos = startPosition; + vec3 viewPosEnd = startPosition; + + // Project the start position to the screen + vec4 projectedCoordStart = applyProjectionMat(proj, viewPos); + vec3 Q0 = viewPos / projectedCoordStart.w; // homogeneous camera space + float k0 = 1.0/ projectedCoordStart.w; + + // advance the position in the direction of the reflection + viewPos += dir; + + vec4 projectedCoordVanishingPoint = applyProjectionMat(proj, dir); + + // Project the advanced position to the screen + vec4 projectedCoordEnd = applyProjectionMat(proj, viewPos); + vec3 Q1 = viewPos / projectedCoordEnd.w; // homogeneous camera space + float k1 = 1.0/ projectedCoordEnd.w; + + // calculate the reflection direction in the screen space + vec2 projectedCoordDir = (projectedCoordEnd.xy - projectedCoordStart.xy); + vec2 projectedCoordDistVanishingPoint = (projectedCoordVanishingPoint.xy - projectedCoordStart.xy); + + float yMod = min(abs(projectedCoordDistVanishingPoint.y), 1.0); + + float projectedCoordDirLength = length(projectedCoordDir); + float maxSt = float(maxSteps); + + // normalize the projection direction depending on maximum steps + // this determines how blocky the reflection looks + vec2 dP = yMod * (projectedCoordDir)/(maxSt * projectedCoordDirLength); + + // Normalize the homogeneous camera space coordinates + vec3 dQ = yMod * (Q1 - Q0)/(maxSt * projectedCoordDirLength); + float dk = yMod * (k1 - k0)/(maxSt * projectedCoordDirLength); + + // initialize the variables for ray marching + vec2 P = projectedCoordStart.xy; + vec3 Q = Q0; + float k = k0; + float rayStartZ = -startPosition.z; // estimated ray start depth value + float rayEndZ = -startPosition.z; // estimated ray end depth value + float prevEstimateZ = -startPosition.z; + float rayDiffZ = 0.0; + float dDepth; + float depth; + float rayDiffZOld = 0.0; + + // early outs + if (dot(normal, dir) < 0.0 || dot(-viewDir, normal) < 0.0) + return vec3(P, 0.0); + + for(int i = 0; i < maxSteps-1; i++) + { + depth = -linearDepthFromTexture(depthMap, P, nearFar); // get linear depth from the depth buffer + + // estimate depth of the marching ray + rayStartZ = prevEstimateZ; + dDepth = -rayStartZ - depth; + rayEndZ = (dQ.z * 0.5 + Q.z)/ ((dk * 0.5 + k)); + rayDiffZ = rayEndZ- rayStartZ; + prevEstimateZ = rayEndZ; + + if(-rayEndZ > nearFar[1] || -rayEndZ < nearFar[0] || P.y < 0.0 || P.y > 1.0 ) + { + return vec3(P, 0.); + } + + // If we detect a hit - return the intersection point, two conditions: + // - dDepth > 0.0 - sampled point depth is in front of estimated depth + // - if difference between dDepth and rayDiffZOld is not too large + // - if difference between dDepth and 0.025/abs(k) is not too large + // - if the sampled depth is not behind far plane or in front of near plane + + if((dDepth) < 0.025/abs(k) + abs(rayDiffZ) && dDepth > 0.0 && depth > nearFar[0] && depth < nearFar[1] && abs(P.y - projectedCoordStart.y) > invResolutionHeight) + { + return vec3(P, depth); + } + + // continue with ray marching + P += dP; + Q.z += dQ.z; + k += dk; + rayDiffZOld = rayDiffZ; + } + return vec3(P, 0.0); + } + `)}let gqe=class{constructor(){this.enabled=!1,this.fadeFactor=1,this.reprojectionMatrix=_e()}};function K6(t){return t?{ray:qs(t.ray),c0:t.c0,c1:t.c1}:{ray:qs(),c0:0,c1:Number.MAX_VALUE}}function yqe(t,e=K6()){return W4(t,e.ray),e.c0=0,e.c1=Number.MAX_VALUE,e}function _qe(t,e,r=K6()){const i=Te(t.vector);return dbe(t.origin,e,r.ray),r.c0=0,r.c1=i,r}function RPt(t,e){return Fxe(t,t.c0,e)}function PPt(t,e){return Fxe(t,t.c1,e)}function Fxe(t,e,r){return oe(r,t.ray.origin,te(r,t.ray.direction,e))}new Kg(()=>K6());function TR(t){return t?[Er(t[0]),Er(t[1]),Er(t[2]),Er(t[3]),Er(t[4]),Er(t[5])]:[Er(),Er(),Er(),Er(),Er(),Er()]}function Uxe(){return[O(),O(),O(),O(),O(),O(),O(),O()]}function s5(t,e){for(let r=0;r=e[3])return!1}return!0}function vqe(t,e){return Vxe(t,yqe(e,Gxe.get()))}function MPt(t,e){for(let r=0;r0)return!1;return!0}function Vxe(t,e){for(let r=0;r0?t:1}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return ae(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){In(this._viewMatrix,t),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),this._viewForward}get viewUp(){return this._ensureViewClean(),this._viewUp}get viewRight(){return this._ensureViewClean(),this._viewRight}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(this.pixelRatio===1)return this._viewport;const t=ew(Qt(),this._viewport,1/this.pixelRatio),e=this._get("screenViewport");return e&&x4(t,e)?e:t}get screenPadding(){if(this.pixelRatio===1)return this._padding;const t=ew(Qt(),this._padding,1/this.pixelRatio),e=this._get("screenPadding");return e&&x4(t,e)?e:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[Yt.LEFT],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[Yt.BOTTOM],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[Yt.RIGHT]+this._padding[Yt.LEFT]}set fullWidth(t){this.width=t-(this._padding[Yt.RIGHT]+this._padding[Yt.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[Yt.TOP]+this._padding[Yt.BOTTOM]}set fullHeight(t){this.height=t-(this._padding[Yt.TOP]+this._padding[Yt.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[Yt.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[Yt.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){LT(this._padding,t)||(this._viewport[0]+=t[Yt.LEFT]-this._padding[Yt.LEFT],this._viewport[1]+=t[Yt.BOTTOM]-this._padding[Yt.BOTTOM],this._viewport[2]-=t[Yt.RIGHT]+t[Yt.LEFT]-(this._padding[Yt.RIGHT]+this._padding[Yt.LEFT]),this._viewport[3]-=t[Yt.TOP]+t[Yt.BOTTOM]-(this._padding[Yt.TOP]+this._padding[Yt.BOTTOM]),vh(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&(Vr(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){const t=this.width,e=this.height,r=this.near*Math.tan(this.fovY/2),i=r*this._aspect,n=fve(_e(),-i*(1+2*this._padding[Yt.LEFT]/t),i*(1+2*this._padding[Yt.RIGHT]/t),-r*(1+2*this._padding[Yt.BOTTOM]/e),r*(1+2*this._padding[Yt.TOP]/e),this.near,this.far),s=this._get("projectionMatrix");return s&&I6(s,n)?s:n}get inverseProjectionMatrix(){return us(_e(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||_e()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return Aqe(this._fov,this.width,this.height)}set fovX(t){this._fov=Eqe(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return Oqe(this._fov,this.width,this.height)}set fovY(t){this._fov=Cqe(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return ci(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(us(this._viewInverseTransposeMatrix,this.viewMatrix),Sc(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const e=2*t-1;return 2*this.near*this.far/(this.far+this.near-e*(this.far-this.near))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return this.relativeElevation!=null&&this.relativeElevation>=0}copyFrom(t){re(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,vh(this._viewport,t.viewport),this.notifyChange("_viewport"),vh(this._padding,t.padding),this.notifyChange("_padding"),fs(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.relativeElevation=t.relativeElevation;const e=t;return this._viewDirty=e._viewDirty,this._viewDirty||(In(this._viewMatrix,t.viewMatrix),re(this._viewRight,t.viewRight),re(this._viewUp,t.viewUp),re(this._viewForward,t.viewForward)),this._viewProjectionDirty=!0,this._frustumDirty=e._frustumDirty,this._frustumDirty||(s5(this._frustum,t.frustum),this._frustumDirty=!1),e._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(In(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),vh(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up}clone(){return new bj().copyFrom(this)}equals(t){return Bo(this.eye,t.eye)&&Bo(this.center,t.center)&&Bo(this.up,t.up)&<(this._viewport,t.viewport)&<(this._padding,t.padding)&&Xwe(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation}almostEquals(t){if(Math.abs(t.fov-this._fov)>=.001||w4(t.screenPadding,this.screenPadding)>=1||w4(this.screenViewport,t.screenViewport)>=1)return!1;Ws(Xo,t.eye,t.center),Ws(kk,this.eye,this.center);const e=fe(Xo,kk),r=qV(Xo),i=qV(kk),n=5e-4;return e*e>=(1-1e-10)*r*i&&u6(t.eye,this.eye)2&&(e[2]=.5*(Xt[2]+1))),e}unprojectFromScreen(t,e){return this.unprojectFromRenderScreen(this.screenToRender(t,zk),e)}unprojectFromRenderScreen(t,e){if(Vr(y$,this.projectionMatrix,this.viewMatrix),!us(y$,y$))return null;const r=this.fullViewport;return Xt[0]=2*(t[0]-r[0])/r[2]-1,Xt[1]=2*(t[1]-r[1])/r[3]-1,Xt[2]=2*t[2]-1,Xt[3]=1,au(Xt,Xt,y$),Xt[3]===0?null:(e[0]=Xt[0]/Xt[3],e[1]=Xt[1]/Xt[3],e[2]=Xt[2]/Xt[3],e)}constrainWindowSize(t,e,r,i){const n=t*this.pixelRatio,s=e*this.pixelRatio,o=Math.max(n-r/2,0),a=Math.max(this.fullHeight-s-i/2,0),l=-Math.min(n-r/2,0),c=-Math.min(this.fullHeight-s-i/2,0);return[o,a,r-l- -Math.min(this.fullWidth-n-r/2,0),i-c- -Math.min(s-i/2,0)]}computeUp(t){t===$e.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,e){const r=t[0]*this.pixelRatio,i=this.fullHeight-t[1]*this.pixelRatio;return e[0]=r,e[1]=i,e}renderToScreen(t,e){const r=t[0]/this.pixelRatio,i=(this.fullHeight-t[1])/this.pixelRatio;e[0]=r,e[1]=i}_computeUpGlobal(){ae(Xo,this.center,this.eye);const t=Te(this.center);t<1?(ne(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs(fe(Xo,this.center))>.9999*Te(Xo)*t||(ot(this._up,Xo,this.center),ot(this._up,this._up,Xo),me(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){Qg(Xo,this.eye,this.center),Math.abs(Xo[2])<=.9999&&(te(Xo,Xo,Xo[2]),ne(this._up,-Xo[0],-Xo[1],1-Xo[2]),me(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(t,e,r=""){typeof t[0]=="number"&&isFinite(t[0])&&typeof t[1]=="number"&&isFinite(t[1])&&typeof t[2]=="number"&&isFinite(t[2])?Bo(t,e)||(re(e,t),this._markViewDirty(),r.length&&this.notifyChange(r)):J.getLogger("esri.views.3d.webgl-engine.lib.Camera").warn("Camera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(kxe(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&($6(this._viewMatrix,this.eye,this.center,this.up),ne(this._viewForward,-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10]),ne(this._viewUp,this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9]),ne(this._viewRight,this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8]),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};h([f()],lt.prototype,"_center",void 0),h([f()],lt.prototype,"_up",void 0),h([f()],lt.prototype,"_viewport",void 0),h([f()],lt.prototype,"_padding",void 0),h([f()],lt.prototype,"_fov",void 0),h([f()],lt.prototype,"_nearFar",void 0),h([f()],lt.prototype,"_pixelRatio",void 0),h([f()],lt.prototype,"pixelRatio",null),h([f()],lt.prototype,"eye",null),h([f()],lt.prototype,"center",null),h([f()],lt.prototype,"up",null),h([f({readOnly:!0})],lt.prototype,"nearFar",null),h([f()],lt.prototype,"near",null),h([f()],lt.prototype,"far",null),h([f()],lt.prototype,"viewport",null),h([f({readOnly:!0})],lt.prototype,"screenViewport",null),h([f({readOnly:!0})],lt.prototype,"screenPadding",null),h([f()],lt.prototype,"x",null),h([f()],lt.prototype,"y",null),h([f()],lt.prototype,"width",null),h([f()],lt.prototype,"height",null),h([f()],lt.prototype,"fullWidth",null),h([f()],lt.prototype,"fullHeight",null),h([f({readOnly:!0})],lt.prototype,"_aspect",null),h([f()],lt.prototype,"padding",null),h([f({readOnly:!0})],lt.prototype,"projectionMatrix",null),h([f({readOnly:!0})],lt.prototype,"inverseProjectionMatrix",null),h([f()],lt.prototype,"fov",null),h([f()],lt.prototype,"fovX",null),h([f()],lt.prototype,"fovY",null),lt=bj=h([N("esri.views.3d.webgl-engine.lib.Camera")],lt);const Xt=Qt(),y$=_e(),Xo=O(),kk=O(),zk=Vo();var Yt;(function(t){t[t.TOP=0]="TOP",t[t.RIGHT=1]="RIGHT",t[t.BOTTOM=2]="BOTTOM",t[t.LEFT=3]="LEFT"})(Yt||(Yt={}));var le;(function(t){t[t.INTEGRATED_MESH=0]="INTEGRATED_MESH",t[t.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",t[t.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",t[t.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",t[t.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",t[t.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",t[t.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",t[t.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",t[t.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",t[t.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",t[t.POSTPROCESSING_ENVIRONMENT_OPAQUE=10]="POSTPROCESSING_ENVIRONMENT_OPAQUE",t[t.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=11]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",t[t.LASERLINES=12]="LASERLINES",t[t.LASERLINES_CONTRAST_CONTROL=13]="LASERLINES_CONTRAST_CONTROL",t[t.HUD_MATERIAL=14]="HUD_MATERIAL",t[t.LABEL_MATERIAL=15]="LABEL_MATERIAL",t[t.LINE_CALLOUTS=16]="LINE_CALLOUTS",t[t.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",t[t.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",t[t.DRAPED_WATER=19]="DRAPED_WATER",t[t.VOXEL=20]="VOXEL",t[t.MAX_SLOTS=21]="MAX_SLOTS"})(le||(le={}));var rt;(function(t){t[t.Color=0]="Color",t[t.Alpha=1]="Alpha",t[t.FrontFace=2]="FrontFace",t[t.NONE=3]="NONE",t[t.COUNT=4]="COUNT"})(rt||(rt={}));let sQ=class{constructor(e=O()){this.intensity=e}},jxe=class{constructor(e=O(),r=Se(.57735,.57735,.57735)){this.intensity=e,this.direction=r}},o5=class{constructor(e=O(),r=Se(.57735,.57735,.57735),i=!0,n=1,s=1){this.intensity=e,this.direction=r,this.castShadows=i,this.specularStrength=n,this.environmentStrength=s}},Hxe=class{constructor(){this.r=[0],this.g=[0],this.b=[0]}};function Rqe(t,e,r){(r=r||t).length=t.length;for(let i=0;i=0&&(o[0]=.28209479177),e>=1&&(o[1]=.4886025119*i,o[2]=.4886025119*s,o[3]=.4886025119*n),e>=2&&(o[4]=1.09254843059*i*n,o[5]=1.09254843059*n*s,o[6]=.31539156525*(3*s*s-1),o[7]=1.09254843059*i*s,o[8]=.54627421529*(i*i-n*n)),o}function Mqe(t,e){const r=Wxe(t),i=e||{r:[],g:[],b:[]};i.r.length=i.g.length=i.b.length=r;for(let n=0;n=1?this._lighting=i:(this._fadedLighting.lerpLighting(r,i,e),this._lighting=this._fadedLighting)}},fl=class extends xe{constructor(e){super(e),this._handles=new Vi,this._techniques=new Array,this._techniqueConfiguration=new RD,this._bindParameters=new e8(null,null,null),this._passParameters=new Pxe,this._drawParameters=new Mxe,this._weatherTile=Ne(),this._weatherTileCount=128,this._faceIndex=0,this._tileIndex=0,this.coverage=wt(ea.default.coverage[0],ea.default.coverage[1],.5),this.density=wt(ea.default.density[0],ea.default.density[1],.5),this.absorption=wt(ea.default.absorption[0],ea.default.absorption[1],.5),this.cloudSize=wt(ea.default.cloudSize[0],ea.default.cloudSize[1],.5),this.detailSize=wt(ea.default.detailSize[0],ea.default.detailSize[1],.5),this.smoothness=wt(ea.default.smoothness[0],ea.default.smoothness[1],.5),this.cloudHeight=wt(ea.default.cloudHeight[0],ea.default.cloudHeight[1],.5),this.raymarchingSteps=ea.default.raymarchingSteps,this._viewMatrix=_e(),this._dirty=!1,this.running=!1,this._vao=Dl(e.context.renderContext.rctx)}_getTechnique(e){const r=1-this.context.renderContext.bindParameters.cloudsFade.readChannels,i=r===dw.RG?2*e:2*e+1;return this._techniques[i]||(this._techniqueConfiguration.writeTextureChannels=r,this._techniqueConfiguration.steps=e,this._techniques[i]=new $xe({rctx:this.context.renderContext.rctx,viewingMode:this.view.state.viewingMode},this._techniqueConfiguration),this._techniques[i])}updateWeatherTile(){const e=this.view.camera.position.latitude,r=this.view.camera.position.longitude;if(e==null||r==null)return;er(this._weatherTile,(e+90)/180,(r+180)/360);const i=Math.floor(this._weatherTileCount*Math.abs(2*this._weatherTile[0]-1));this._weatherTile[0]=Math.floor(2*this._weatherTileCount*this._weatherTile[0]),this._weatherTile[1]=Math.floor(4*(this._weatherTileCount-i)*this._weatherTile[1]);let n=0,s=0;if(this.view.environment!=null&&this.view.environment.lighting.type!=="virtual"&&this.view.environment.lighting.date!=null){const o=new Date(this.view.environment.lighting.date);o.setUTCHours(this.view.environment.lighting.date.getUTCHours()+(this.view.environment.lighting.displayUTCOffset??0)),n=31*o.getUTCMonth()+o.getUTCDate(),s=o.getUTCFullYear()}this._weatherTile[0]=(this._weatherTile[0]+n)%(2*this._weatherTileCount),this._weatherTile[1]=(this._weatherTile[1]+s%100)%(4*this._weatherTileCount),Ywe(this._passParameters.weatherTile,this._weatherTile)||this.setDirty()}initialize(){const e=Mr(this.view.spatialReference);this._passParameters.cloudRadius=.5*e.radius,this.setDirty(),this.updateWeatherTile(),this._handles.add([this.view.resourceController.scheduler.registerTask(dt.CLOUDS_GENERATOR,this),ue(()=>[this.coverage,this.density,this.absorption,this.cloudSize,this.detailSize,this.smoothness,this.cloudHeight,this.raymarchingSteps],()=>this.setDirty(),Pr)])}destroy(){this._handles.destroy(),this._techniques.forEach(e=>Fi(e)),this._frameBufferCube=Le(this._frameBufferCube),this._techniques.length=0,this._vao.dispose(),this._passParameters.noiseTexture=Me(this._passParameters.noiseTexture)}get _tilesPerFace(){switch(this._techniqueConfiguration.steps){case El.SIXTEEN:return 1;case El.HUNDRED:return 4;case El.COUNT:case El.TWOHUNDRED:return 8}}_ensureNoiseTexture(){if(this._passParameters.noiseTexture!=null)this._passParameters.noiseTexture.updateWeatherMap(this._passParameters.weatherTile);else{const e=this.context;this._passParameters.noiseTexture=new Q3({context:e}),this._passParameters.noiseTexture.updateWeatherMap(this._passParameters.weatherTile)}return this._passParameters.noiseTexture.textureAtlas!=null}_ensureFrameBufferCube(e){if(this._frameBufferCube==null){const r=new pr(e);r.target=nn.TEXTURE_CUBE_MAP,r.wrapMode=Pt.CLAMP_TO_EDGE,this._frameBufferCube=new hs(this.context.renderContext.rctx,r)}return this._frameBufferCube}get cubeMap(){return this._frameBufferCube}destroyFrameBufferCube(){this._frameBufferCube=Le(this._frameBufferCube)}applyPreset(e,r){const i=e.median,n=s=>{const o=wt(s[0],s[1],i);return r<.5?wt(s[0],o,2*r):wt(o,s[1],2*(r-.5))};this.coverage=n(e.coverage),this.density=n(e.density),this.absorption=n(e.absorption),this.cloudSize=n(e.cloudSize),this.detailSize=n(e.detailSize),this.smoothness=n(e.smoothness),this.cloudHeight=n(e.cloudHeight),this.raymarchingSteps=e.raymarchingSteps}setDirty(){this._dirty=this.running=!0}runTask(e){this._faceIndex===0&&this._tileIndex===0&&(this._passParameters.raymarchingSteps=this.raymarchingSteps,this.updateWeatherTile(),fs(this._passParameters.weatherTile,this._weatherTile));const r=this._getTechnique(this._passParameters.raymarchingSteps);if(!r.compiled||!this.context.renderContext.bindParameters.cloudsFade.isCameraPositionFinal||this.context.renderContext.bindParameters.cloudsFade.isFading||!this._ensureNoiseTexture())return Ho.YIELD;this._faceIndex===0&&this._tileIndex===0&&(this.context.renderContext.bindParameters.cloudsFade.renderingStage=On.RENDERING,this._passParameters.absorption=this.absorption,this._passParameters.density=this.density,this._passParameters.cloudSize=this.cloudSize,this._passParameters.detailSize=this.detailSize,this._passParameters.smoothness=this.smoothness,this._passParameters.cloudHeight=this.cloudHeight,this._passParameters.coverage=this.coverage,this._dirty=!1);const i=this.context.renderContext.rctx,n=i.bindTechnique(r,this._passParameters,this._bindParameters);i.bindVAO(this._vao),n.assertCompatibleVertexAttributeLocations(this._vao);const s=i.getViewport(),o=r.configuration.cubeMapSize,a=o/this._tilesPerFace,l=this._tileIndex*a;i.setViewport(0,l,o,a);const c=this._ensureFrameBufferCube(o);i.bindFramebuffer(c);const u=kqe[this._faceIndex],d=zqe[this._faceIndex];gve(this._viewMatrix,Bqe,u,d),Ac(this._drawParameters.viewMatrix,this._viewMatrix);const p=nn.TEXTURE_CUBE_MAP_POSITIVE_X+this._faceIndex;return c.setColorTextureTarget(p),n.bindDraw(this._drawParameters,this._bindParameters,this._passParameters),i.gl.drawArrays(i.gl.TRIANGLE_STRIP,0,4),i.gl.flush(),i.setViewport(s.x,s.y,s.width,s.height),this.requestRender(),++this._tileIndex,this._faceIndex===4&&this._tileIndex===this._tilesPerFace?(this.running=this._dirty,this._faceIndex=0,this._tileIndex=0,this.context.renderContext.bindParameters.cloudsFade.renderingStage=On.FINISHED_RENDERING):this._tileIndex===this._tilesPerFace&&(++this._faceIndex,this._tileIndex=0),e.madeProgress(),Ho.YIELD}};h([f({constructOnly:!0})],fl.prototype,"context",void 0),h([f({constructOnly:!0})],fl.prototype,"view",void 0),h([f({constructOnly:!0})],fl.prototype,"requestRender",void 0),h([f()],fl.prototype,"coverage",void 0),h([f()],fl.prototype,"density",void 0),h([f()],fl.prototype,"absorption",void 0),h([f()],fl.prototype,"cloudSize",void 0),h([f()],fl.prototype,"detailSize",void 0),h([f()],fl.prototype,"smoothness",void 0),h([f()],fl.prototype,"cloudHeight",void 0),h([f()],fl.prototype,"raymarchingSteps",void 0),h([f()],fl.prototype,"running",void 0),fl=h([N("esri.views.3d.environment.CloudsGenerator")],fl);const kqe=[zr(1,0,0),zr(-1,0,0),zr(0,1,0),zr(0,-1,0),zr(0,0,1)],zqe=[zr(0,1,0),zr(0,1,0),zr(0,0,-1),zr(0,0,1),zr(0,1,0)],Bqe=nQ();let Yxe=class extends Wr{constructor(){super(...arguments),this.fogColor=O(),this.fogStrength=4e-6,this.atmosphereC=1,this.fogAmount=0}};function Vqe(){const t=new mr;t.attributes.add(E.POSITION,"vec2"),t.include(Uf,{textureCoordinateType:Pn.Default}),t.varyings.add("worldRay","vec3"),t.varyings.add("eyeDir","vec3");const{vertex:e,fragment:r}=t;return e.uniforms.add(new Mi("inverseProjectionMatrix",(i,n)=>n.camera.inverseProjectionMatrix),new Mi("inverseViewMatrix",(i,n)=>wE(Gqe,n.camera.viewMatrix))),e.code.add(w`void main(void) { +vec3 posViewNear = (inverseProjectionMatrix * vec4(position, -1, 1)).xyz; +eyeDir = posViewNear; +worldRay = (inverseViewMatrix * vec4(posViewNear, 0)).xyz; +forwardTextureCoordinates(); +gl_Position = vec4(position, 1, 1); +}`),r.uniforms.add(new Ce("atmosphereC",i=>i.atmosphereC),new Lt("cameraPosition",(i,n)=>n.camera.eye),new yr("nearFar",(i,n)=>n.camera.nearFar),new Ye("depthTexture",i=>i.depthTexture),new Ce("fogStrength",i=>i.fogStrength),new Ce("fogAmount",i=>i.fogAmount),new Lt("fogColor",i=>i.fogColor)),t.include(Q6),r.include(wu),r.code.add(w`vec2 sphereIntersect(vec3 start, vec3 dir) { +float a = dot(dir, dir); +float b = 2.0 * dot(dir, start); +float d = (b * b) - 4.0 * a * atmosphereC; +if (d < 0.0) { +return vec2(1e5, -1e5); +} +return vec2((-b - sqrt(d)) / (2.0 * a), (-b + sqrt(d)) / (2.0 * a)); +}`),r.code.add(w`vec4 applyFog(float dist, vec3 rayDir){ +if(dist == -1.0){ +vec2 rayAtmosphereIntersect = sphereIntersect(cameraPosition, rayDir); +dist = 0.055 * rayAtmosphereIntersect.y; +} +float fogAmount = fogAmount * (1.0 - exp(-dist * fogStrength)); +return vec4(fogAmount * fogColor, fogAmount); +}`),r.code.add(w`vec3 tonemapACES(vec3 x) { +return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0); +} +void main() { +vec3 rayDir = normalize(worldRay); +float terrainDepth = -1.0; +float depthSample = texture(depthTexture, vuv0).r; +float zNorm = 2.0 * depthSample - 1.0; +float linDepth = 2.0 * nearFar[0] * nearFar[1] / (nearFar[1] + nearFar[0] - zNorm * (nearFar[1] - nearFar[0])); +if(depthSample < 1.0 && depthSample > 0.0){ +vec3 cameraSpaceRay = normalize(eyeDir); +cameraSpaceRay /= cameraSpaceRay.z; +cameraSpaceRay *= linDepth; +terrainDepth = max(0.0, length(cameraSpaceRay)); +} +vec4 fog = applyFog(terrainDepth, rayDir); +fragColor = delinearizeGamma(vec4(tonemapACES(fog.rgb), fog.a)); +}`),t}const Gqe=_e(),jqe=Object.freeze(Object.defineProperty({__proto__:null,FogPassParameters:Yxe,build:Vqe},Symbol.toStringTag,{value:"Module"}));let Zxe=class Qxe extends Tr{constructor(e){super(e,new va,()=>this.destroy())}initializeProgram(e){return new vr(e.rctx,Qxe.shader.get().build(),fr)}initializePipeline(){return Ot({blending:So(ve.SRC_ALPHA,ve.ZERO,ve.ONE_MINUS_SRC_ALPHA,ve.ONE),colorWrite:Ft})}};Zxe.shader=new _r(jqe,()=>ce(()=>import("./Fog.glsl-332cff80.js"),[]));const Hqe=.95,Wqe=1;let Rv=class extends xe{constructor(e){super(e),this._passParameters=new Yxe;const r=e.context.renderContext.rctx;this._vao=Dl(r,$P),this._technique=new Zxe(e);const i=Mr(e.view.spatialReference);this._planetRadius=i.radius,this._atmosphereRadius=i.radius+$y}destroy(){this._technique.release(),this._vao.dispose()}set strength(e){this._passParameters.fogStrength=e}get strength(){return this._passParameters.fogStrength}render(e,r){if(this._update(e,r),this._passParameters.fogAmount<=0)return;const i=this._technique;if(!i.compiled)return void this.context.requestRender();const n=e.offscreenRenderingHelper;n.renderDepthDetached(()=>{this._passParameters.depthTexture=n.depthTexture;const s=e.rctx.bindTechnique(i,this._passParameters,e.bindParameters);this._renderFog(s,e)})}_renderFog(e,r){const i=r.rctx;i.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),i.drawArrays(Et.TRIANGLE_STRIP,0,4)}_update(e,r){const i=e.bindParameters.camera;me(One,i.eye);const n=Math.max(0,fe(One,e.bindParameters.lighting.mainLight.direction)),s=r.color;te(Rne,s,.1),Lr(this._passParameters.fogColor,Rne,s,n);const o=Te(i.eye),a=o*o;this._passParameters.atmosphereC=a-this._atmosphereRadius*this._atmosphereRadius,this._passParameters.fogAmount=(1-nR(Hqe*yf,Wqe*yf,Math.abs(o-this._planetRadius)))*r.amount,this._passParameters.fogStrength=r.strength}static isSupported(e){return e.capabilities.depthTexture}};h([f({constructOnly:!0})],Rv.prototype,"context",void 0),h([f({constructOnly:!0})],Rv.prototype,"view",void 0),h([f({constructOnly:!0})],Rv.prototype,"rctx",void 0),h([f({constructOnly:!0})],Rv.prototype,"viewingMode",void 0),Rv=h([N("esri.views.3d.environment.Fog")],Rv);let qqe=class{constructor(){this.color=O(),this.strength=0,this.amount=0}};const One=O(),Rne=O();let Fo=class extends va{};h([U({constValue:!0})],Fo.prototype,"hasSliceHighlight",void 0),h([U({constValue:!1})],Fo.prototype,"hasSliceInVertexProgram",void 0),h([U({constValue:!1})],Fo.prototype,"instancedDoublePrecision",void 0),h([U({constValue:!1})],Fo.prototype,"hasModelTransformation",void 0),h([U({constValue:jr.Pass})],Fo.prototype,"pbrTextureBindType",void 0);var Jf;(function(t){t[t.Cone=0]="Cone",t[t.Cylinder=1]="Cylinder",t[t.Underground=2]="Underground",t[t.COUNT=3]="COUNT"})(Jf||(Jf={}));let oQ=class extends Fo{constructor(){super(...arguments),this.geometry=Jf.Cone}};h([U({count:Jf.COUNT})],oQ.prototype,"geometry",void 0);var D;(function(t){t[t.Color=0]="Color",t[t.Depth=1]="Depth",t[t.Normal=2]="Normal",t[t.Shadow=3]="Shadow",t[t.ShadowHighlight=4]="ShadowHighlight",t[t.ShadowExcludeHighlight=5]="ShadowExcludeHighlight",t[t.Highlight=6]="Highlight",t[t.Alpha=7]="Alpha",t[t.ObjectAndLayerIdColor=8]="ObjectAndLayerIdColor",t[t.COUNT=9]="COUNT"})(D||(D={}));function LP(t){t.attributes.add(E.POSITION,"vec3"),t.vertex.code.add(w`vec3 positionModel() { return position; }`)}function a5({code:t},e){e.doublePrecisionRequiresObfuscation?t.add(w`vec3 dpPlusFrc(vec3 a, vec3 b) { +return mix(a, a + b, vec3(notEqual(b, vec3(0)))); +} +vec3 dpMinusFrc(vec3 a, vec3 b) { +return mix(vec3(0), a - b, vec3(notEqual(a, b))); +} +vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { +vec3 t1 = dpPlusFrc(hiA, hiB); +vec3 e = dpMinusFrc(t1, hiA); +vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB; +return t1 + t2; +}`):t.add(w`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { +vec3 t1 = hiA + hiB; +vec3 e = t1 - hiA; +vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB; +return t1 + t2; +}`)}let Gh=class extends ln{constructor(e,r){super(e,"mat3",jr.Pass,(i,n,s)=>i.setUniformMatrix3fv(e,r(n,s)))}};function kT(t,e){t.include(LP);const r=t.vertex;r.include(a5,e),t.varyings.add("vPositionWorldCameraRelative","vec3"),t.varyings.add("vPosition_view","vec3"),r.uniforms.add(new Lt("transformWorldFromViewTH",i=>i.transformWorldFromViewTH),new Lt("transformWorldFromViewTL",i=>i.transformWorldFromViewTL),new Gh("transformViewFromCameraRelativeRS",i=>i.transformViewFromCameraRelativeRS),new Mi("transformProjFromView",i=>i.transformProjFromView),new xR("transformWorldFromModelRS",i=>i.transformWorldFromModelRS),new pu("transformWorldFromModelTH",i=>i.transformWorldFromModelTH),new pu("transformWorldFromModelTL",i=>i.transformWorldFromModelTL)),r.code.add(w`vec3 positionWorldCameraRelative() { +vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel(); +vec3 transform_CameraRelativeFromModel = dpAdd( +transformWorldFromModelTL, +transformWorldFromModelTH, +-transformWorldFromViewTL, +-transformWorldFromViewTH +); +return transform_CameraRelativeFromModel + rotatedModelPosition; +}`),r.code.add(w` + void forwardPosition(float fOffset) { + vPositionWorldCameraRelative = positionWorldCameraRelative(); + if (fOffset != 0.0) { + vPositionWorldCameraRelative += fOffset * ${e.spherical?w`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:w`vec3(0.0, 0.0, 1.0)`}; + } + + vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative; + gl_Position = transformProjFromView * vec4(vPosition_view, 1.0); + } + `),t.fragment.uniforms.add(new Lt("transformWorldFromViewTL",i=>i.transformWorldFromViewTL)),r.code.add(w`vec3 positionWorld() { +return transformWorldFromViewTL + vPositionWorldCameraRelative; +}`),t.fragment.code.add(w`vec3 positionWorld() { +return transformWorldFromViewTL + vPositionWorldCameraRelative; +}`)}let Jxe=class extends Wr{constructor(){super(...arguments),this.transformWorldFromViewTH=O(),this.transformWorldFromViewTL=O(),this.transformViewFromCameraRelativeRS=hi(),this.transformProjFromView=_e()}},Kxe=class extends Wr{constructor(){super(...arguments),this.transformWorldFromModelRS=hi(),this.transformWorldFromModelTH=O(),this.transformWorldFromModelTL=O()}};function W_(t){t.varyings.add("linearDepth","float")}function pw(t){t.vertex.uniforms.add(new yr("nearFar",(e,r)=>r.camera.nearFar))}function t8(t){t.vertex.code.add(w`float calculateLinearDepth(vec2 nearFar,float z) { +return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]); +}`)}function AE(t,e){const{vertex:r}=t;switch(e.output){case D.Color:if(e.receiveShadows)return W_(t),void r.code.add(w`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case D.Depth:case D.Shadow:case D.ShadowHighlight:case D.ShadowExcludeHighlight:return t.include(kT,e),W_(t),pw(t),t8(t),void r.code.add(w`void forwardLinearDepth() { +linearDepth = calculateLinearDepth(nearFar, vPosition_view.z); +}`)}r.code.add(w`void forwardLinearDepth() {}`)}function Cl(t){t8(t),t.vertex.code.add(w`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) { +vec4 eye = view * vec4(pos, 1.0); +depth = calculateLinearDepth(nearFar,eye.z); +return proj * eye; +}`),t.vertex.code.add(w`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) { +return proj * (view * vec4(pos, 1.0)); +}`)}let aQ=class extends Wr{constructor(){super(...arguments),this.texV=Ne(),this.altitudeFade=0,this.innerScale=0,this.undergroundFadeAlpha=0,this.silhouette=new e2e}},e2e=class{constructor(){this.center=O(),this.v1=O(),this.v2=O()}};function Xqe(t){const e=new mr,{vertex:r,fragment:i}=e;if(r0(r),t.geometry===Jf.Underground)e.attributes.add(E.POSITION,"vec2"),e.varyings.add("color","vec4"),r.uniforms.add(new Lt("cameraPosition",(n,s)=>s.camera.eye),new Ce("undergroundFadeAlpha",n=>n.undergroundFadeAlpha)),r.code.add(w`void main(void) { +float ndotl = dot(normalize(cameraPosition), mainLightDirection); +float lighting = max(0.0, smoothstep(-1.0, 0.8, 2.0 * ndotl)); +color = vec4(vec3(lighting), undergroundFadeAlpha); +gl_Position = vec4(position.xy, 1.0, 1.0); +}`),i.code.add(w`void main() { +fragColor = color; +}`);else{e.include(Cl,t),e.attributes.add(E.POSITION,"vec3"),e.varyings.add("vtc","vec2"),e.varyings.add("falloff","float");const n=t.geometry===Jf.Cylinder;r.uniforms.add(new Mi("proj",(a,l)=>l.camera.projectionMatrix),new Mi("view",(a,l)=>l.camera.viewMatrix)),n||(e.varyings.add("innerFactor","float"),r.uniforms.add(new Lt("silCircleCenter",a=>a.silhouette.center)),r.uniforms.add(new Lt("silCircleV1",a=>a.silhouette.v1)),r.uniforms.add(new Lt("silCircleV2",a=>a.silhouette.v2)),r.uniforms.add(new yr("texV",a=>a.texV)),r.uniforms.add(new Ce("innerScale",a=>a.innerScale)));const s=6.2831853,o=1/128;r.code.add(w` + void main(void) { + ${n?w` + vec3 pos = position; + float ndotl = mainLightDirection.z; + vtc = vec2(0.0, position.z + 0.05);`:w` + innerFactor = clamp(-position.z, 0.0, 1.0); + float scale = position.y * (1.0 + innerFactor * innerScale); + float phi = position.x * ${w.float(s*o)} + 1.0; + vec3 pos = (silCircleCenter + sin(phi) * silCircleV1 + cos(phi) * silCircleV2) * scale; + float ndotl = dot(normalize(position.y > 0.0 ? pos: silCircleCenter), mainLightDirection); + vtc.x = position.x * ${w.float(o)}; + vtc.y = texV.x * (1.0 - position.z) + texV.y * position.z; + `} + falloff = max(0.0, smoothstep(-1.0, 0.8, 2.0 * ndotl)); + + gl_Position = transformPosition(proj, view, pos); + gl_Position.z = gl_Position.w; // project atmosphere onto the far plane + } + `),i.uniforms.add(new Ye("tex",a=>a.texture)),n||i.uniforms.add(new Ce("altitudeFade",a=>a.altitudeFade)),i.code.add(w` + void main() { + vec4 atmosphereColor = texture(tex, vtc) * falloff; + ${n?w`fragColor = atmosphereColor;`:w` + vec4 innerColor = vec4(atmosphereColor.rgb, 1.0 - altitudeFade); + fragColor = mix(atmosphereColor, innerColor, smoothstep(0.0, 1.0, innerFactor)); + `} + }`)}return e}const Yqe=Object.freeze(Object.defineProperty({__proto__:null,SilhouetteCircle:e2e,SimpleAtmospherePassParameters:aQ,build:Xqe},Symbol.toStringTag,{value:"Module"}));let l5=class t2e extends Tr{initializeProgram(e){return new vr(e.rctx,t2e.shader.get().build(this.configuration),fr)}initializePipeline(){return this.configuration.geometry===Jf.Cylinder?Ot({blending:So(ve.SRC_ALPHA,ve.ONE,ve.ONE_MINUS_SRC_ALPHA,ve.ONE_MINUS_SRC_ALPHA),culling:VZ,depthTest:{func:Hr.LEQUAL},colorWrite:Ft}):Ot({blending:So(ve.SRC_ALPHA,ve.ONE,ve.ONE_MINUS_SRC_ALPHA,ve.ONE_MINUS_SRC_ALPHA),depthTest:{func:Hr.LEQUAL},colorWrite:Ft})}};l5.shader=new _r(Yqe,()=>ce(()=>import("./SimpleAtmosphere.glsl-137a19b0.js"),[]));const Zqe=new Uint8ClampedArray([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,9,0,0,0,9,0,0,0,9,0,0,0,9,0,0,0,9,0,0,0,10,0,0,0,10,0,0,0,10,0,0,0,10,0,0,0,11,0,0,0,11,0,0,0,11,0,0,0,11,0,0,0,11,0,0,0,12,0,0,0,12,0,0,0,12,0,0,0,12,0,0,0,13,0,0,0,13,0,0,0,13,0,0,0,13,0,0,0,14,0,0,0,14,0,0,0,14,0,0,0,14,0,0,0,15,0,0,0,15,0,0,0,15,0,0,0,15,0,0,0,15,16,0,0,16,16,0,0,16,16,0,0,16,16,0,0,16,15,0,0,17,15,0,0,17,15,0,0,17,15,0,0,17,14,0,0,18,14,0,0,18,14,0,0,18,13,0,0,19,13,0,0,19,13,0,0,19,13,0,0,19,13,0,0,20,13,0,0,20,13,0,0,20,13,0,0,20,12,0,0,21,12,0,0,21,12,0,0,21,12,0,0,21,12,0,0,22,12,0,0,22,12,0,0,22,12,0,0,22,11,0,0,23,11,0,0,23,11,0,0,23,11,0,0,24,11,0,0,24,11,0,0,24,11,0,0,24,10,0,0,25,10,0,0,25,10,0,0,25,10,0,0,26,10,0,0,26,10,0,0,26,10,0,0,26,9,0,0,27,9,0,0,27,9,0,0,27,18,0,0,28,18,0,0,28,18,0,0,28,18,0,0,28,18,0,0,29,18,0,0,29,18,0,0,29,17,0,0,30,17,0,0,30,17,0,0,30,17,0,0,30,16,0,0,31,16,0,0,31,16,0,0,31,16,0,0,32,16,0,0,32,16,0,0,32,15,0,0,33,15,0,0,33,15,0,0,33,15,0,0,34,15,8,0,34,15,8,0,34,15,8,0,34,15,7,0,35,15,7,0,35,15,7,0,35,21,7,0,36,21,7,0,36,21,7,0,36,21,7,0,37,21,7,0,37,21,7,0,37,20,7,0,38,20,7,0,38,20,7,0,38,20,7,0,39,20,7,0,39,20,7,0,39,20,7,0,39,19,6,0,40,19,6,0,40,19,6,0,40,19,6,0,41,19,6,0,41,19,6,0,41,18,6,0,42,18,6,0,42,18,6,0,42,24,6,0,43,24,6,0,43,24,6,0,43,23,6,0,44,23,6,0,44,23,6,0,44,23,6,0,45,23,6,0,45,23,6,0,45,22,6,0,46,22,6,0,46,22,6,0,46,22,5,0,47,22,5,0,47,22,5,0,47,21,5,0,48,21,5,0,48,21,5,0,48,21,5,0,49,21,5,0,49,26,5,0,49,25,5,0,50,25,5,0,50,25,5,0,50,25,5,0,51,25,5,0,51,25,5,0,51,25,5,0,52,25,5,0,52,25,5,0,52,24,5,0,53,24,5,0,53,24,5,0,53,24,9,0,54,28,9,0,54,28,9,0,54,28,9,0,55,28,9,0,55,27,9,0,56,27,9,0,56,27,9,0,56,27,9,4,57,27,9,4,57,27,9,4,57,26,9,4,58,26,9,4,58,26,9,4,58,26,9,4,59,26,9,4,59,26,9,4,59,26,8,4,60,30,8,4,60,30,8,4,60,29,8,4,61,29,8,4,61,29,8,4,62,29,8,4,62,29,8,4,62,28,8,4,63,28,8,4,63,28,8,4,63,28,12,4,64,28,12,4,64,28,12,4,64,27,12,4,65,27,12,8,65,27,12,8,65,31,12,8,66,31,12,8,66,30,11,8,67,30,11,8,67,30,11,8,67,30,11,8,68,30,11,8,68,30,11,8,68,30,15,7,69,30,15,7,69,30,15,7,69,33,15,11,70,33,15,11,70,32,14,11,71,32,14,11,71,32,14,11,71,32,18,14,72,32,18,14,72,32,18,14,72,31,17,14,73,35,17,14,73,34,17,17,74,34,21,17,74,34,21,17,74,34,20,17,75,34,20,20,75,34,20,20,75,34,23,20,76,34,23,20,76,36,23,23,77,36,23,23,77,36,23,23,77,36,23,23,78,36,26,26,78,36,26,26,78,36,26,26,79,36,26,29,79,38,26,29,80,38,29,29,80,38,29,29,80,38,28,31,81,38,28,31,81,38,31,31,81,37,31,34,82,37,31,34,82,37,31,37,83,40,34,37,83,40,34,37,83,39,33,39,84,39,33,39,84,39,36,42,84,39,36,42,85,39,36,42,85,39,36,42,85,39,39,44,86,39,39,44,86,41,38,47,87,41,41,47,87,41,41,50,87,41,41,49,88,41,41,52,88,40,43,52,89,43,43,52,89,43,43,54,89,42,45,54,90,42,45,57,90,42,45,57,90,42,45,59,91,42,48,59,91,44,47,61,92,44,47,61,92,44,50,61,92,44,49,63,93,44,49,63,93,44,52,66,93,43,52,65,94,46,54,68,94,46,54,70,95,46,54,70,95,46,54,70,95,45,56,72,96,45,56,72,96,45,58,74,97,47,58,76,97,47,58,76,97,47,60,78,98,47,60,78,98,47,60,81,98,49,62,80,99,49,62,82,99,48,61,84,100,48,64,84,100,48,64,84,100,50,63,86,101,50,66,86,101,50,66,88,101,50,65,90,102,52,67,89,103,51,69,91,104,51,68,92,105,52,69,93,107,52,71,94,108,54,70,96,109,53,71,96,111,52,73,98,112,54,72,98,114,53,73,100,115,54,72,100,117,54,73,102,118,55,74,104,120,55,76,105,121,56,77,106,123,56,76,107,124,57,79,107,126,58,78,110,128,57,79,111,129,56,80,113,131,58,79,112,132,57,82,114,134,58,81,116,136,60,82,117,137,59,83,117,139,60,83,119,141,59,84,120,142,60,85,122,144,59,86,122,146,60,86,126,148,62,87,127,149,61,88,127,151,62,88,128,153,63,89,130,155,62,90,131,156,63,90,132,158,64,91,134,160,65,91,135,162,64,92,136,163,63,93,138,165,66,95,139,167,65,95,140,169,66,95,142,171,67,96,142,172,66,97,144,174,67,99,145,176,67,97,148,178,67,99,147,180,68,100,149,181,68,100,150,183,69,101,152,185,70,102,153,187,71,103,155,188,70,103,156,190,70,104,157,192,71,105,158,194,71,106,160,195,72,106,161,197,72,108,161,199,73,108,163,200,73,109,164,202,74,109,165,204,74,110,167,206,75,111,168,207,74,112,170,209,75,112,170,210,76,113,171,212,76,114,173,214,77,115,174,215,78,115,175,217,78,116,175,218,78,117,177,220,78,118,178,221,79,118,180,223,80,120,180,224,81,120,181,226,81,120,182,227,82,121,184,229,82,122,185,230,84,123,186,232,83,123,187,233,84,124,189,234,84,125,188,235,85,126,189,237,86,126,190,238,86,127,191,239,87,127,192,240,87,129,193,242,88,129,194,243,89,130,195,244,90,131,196,245,90,132,197,246,91,132,197,247,92,133,198,248,92,134,199,249,93,135,200,250,94,136,201,251,95,137,202,252,96,138,203,253,97,140,204,254,98,141,205,254,99,142,206,255,101,143,207,255,102,144,208,255,103,146,209,255,104,147,209,255,106,148,210,255,107,149,211,255,108,151,212,255,110,152,213,255,111,153,213,255,112,154,214,255,114,156,215,255,115,157,215,255,117,158,216,255,118,160,217,255,120,161,217,255,121,162,218,255,123,164,218,255,124,165,219,255,125,166,219,255,127,167,220,255,129,169,220,255,130,170,221,255,132,171,221,255,133,173,222,255,134,174,222,255,136,175,223,255,139,178,224,255,142,180,224,255,144,182,225,255,147,185,226,255,150,187,226,255,153,189,227,255,155,191,228,255,158,194,228,255,160,196,229,255,163,198,229,255,165,200,230,255,168,202,231,255,170,203,231,255,172,205,232,255,174,207,232,255,176,209,233,255,178,210,234,255,180,212,234,255,182,214,235,255,184,215,236,255,186,217,237,255,188,219,238,255,190,220,238,255,192,221,239,255,193,222,240,255,194,224,240,255,196,225,241,255,197,226,241,255,198,226,242,255,199,227,242,255,200,228,242,255,201,228,243,255,202,229,243,255,203,230,243,255,204,230,244,255,205,231,244,255,207,232,244,255,208,233,245,255,209,233,245,255,211,234,246,255,213,235,246,255,217,238,247,255,222,240,248,255,226,242,249,255,231,245,250,255,236,247,251,255,241,249,252,255,245,251,253,255,249,252,254,255,255,255,255,255]);function Mc(t,e=0){const r=t.stride;return Array.from(t.fields.keys()).filter(i=>{var s;const n=(s=t.fields.get(i))==null?void 0:s.optional;return!(n&&n.glPadding)}).map(i=>{const n=t.fields.get(i),s=n.constructor.ElementCount,o=Qqe(n.constructor.ElementType),a=n.offset,l=!(!n.optional||!n.optional.glNormalized);return new xo(i,s,o,a,r,l,e)})}function Qqe(t){const e=Jqe[t];if(e)return e;throw new Error("BufferType not supported in WebGL")}const Jqe={u8:Qe.UNSIGNED_BYTE,u16:Qe.UNSIGNED_SHORT,u32:Qe.UNSIGNED_INT,i8:Qe.BYTE,i16:Qe.SHORT,i32:Qe.INT,f32:Qe.FLOAT};let lQ=class{constructor(e,r,i=0,n,s){this.TypedArrayConstructor=e,this.elementCount=9;const o=this.TypedArrayConstructor;n===void 0&&(n=9*o.BYTES_PER_ELEMENT);const a=r.byteLength===0?0:i;this.typedBuffer=s==null?new o(r,a):new o(r,a,(s-i)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,r,i=this.count-r){const n=this.typedBuffer.byteOffset+r*this.stride;return new e(this.buffer,n,this.stride,n+i*this.stride)}getMat(e,r){let i=e*this.typedBufferStride;for(let n=0;n<9;n++)r[n]=this.typedBuffer[i++];return r}setMat(e,r){let i=e*this.typedBufferStride;for(let n=0;n<9;n++)this.typedBuffer[i++]=r[n]}get(e,r){return this.typedBuffer[e*this.typedBufferStride+r]}set(e,r,i){this.typedBuffer[e*this.typedBufferStride+r]=i}copyFrom(e,r,i){const n=this.typedBuffer,s=r.typedBuffer;let o=e*this.typedBufferStride,a=i*r.typedBufferStride;for(let l=0;l<9;++l)n[o++]=s[a++]}get buffer(){return this.typedBuffer.buffer}};lQ.ElementCount=9;let cQ=class{constructor(e,r,i=0,n,s){this.TypedArrayConstructor=e,this.elementCount=16;const o=this.TypedArrayConstructor;n===void 0&&(n=16*o.BYTES_PER_ELEMENT);const a=r.byteLength===0?0:i;this.typedBuffer=s==null?new o(r,a):new o(r,a,(s-i)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,r,i=this.count-r){const n=this.typedBuffer.byteOffset+r*this.stride;return new e(this.buffer,n,this.stride,n+i*this.stride)}getMat(e,r){let i=e*this.typedBufferStride;for(let n=0;n<16;n++)r[n]=this.typedBuffer[i++];return r}setMat(e,r){let i=e*this.typedBufferStride;for(let n=0;n<16;n++)this.typedBuffer[i++]=r[n]}get(e,r){return this.typedBuffer[e*this.typedBufferStride+r]}set(e,r,i){this.typedBuffer[e*this.typedBufferStride+r]=i}copyFrom(e,r,i){const n=this.typedBuffer,s=r.typedBuffer;let o=e*this.typedBufferStride,a=i*r.typedBufferStride;for(let l=0;l<16;++l)n[o++]=s[a++]}get buffer(){return this.typedBuffer.buffer}};cQ.ElementCount=16;let s0=class{constructor(e,r,i=0,n,s){this.TypedArrayConstructor=e,this.elementCount=1;const o=this.TypedArrayConstructor;n===void 0&&(n=o.BYTES_PER_ELEMENT);const a=r.byteLength===0?0:i;this.typedBuffer=s==null?new o(r,a):new o(r,a,(s-i)/o.BYTES_PER_ELEMENT),this.stride=n,this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,r,i=this.count-r){const n=this.typedBuffer.byteOffset+r*this.stride;return new e(this.buffer,n,this.stride,n+i*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,r){this.typedBuffer[e*this.typedBufferStride]=r}get buffer(){return this.typedBuffer.buffer}};s0.ElementCount=1;let o0=class{constructor(e,r,i=0,n,s){this.TypedArrayConstructor=e,this.elementCount=2;const o=this.TypedArrayConstructor;n===void 0&&(n=2*o.BYTES_PER_ELEMENT);const a=r.byteLength===0?0:i;this.typedBuffer=s==null?new o(r,a):new o(r,a,(s-i)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,r,i=this.count-r){const n=this.typedBuffer.byteOffset+r*this.stride;return new e(this.buffer,n,this.stride,n+i*this.stride)}getVec(e,r){return e*=this.typedBufferStride,er(r,this.typedBuffer[e],this.typedBuffer[e+1])}setVec(e,r){e*=this.typedBufferStride,this.typedBuffer[e++]=r[0],this.typedBuffer[e]=r[1]}get(e,r){return this.typedBuffer[e*this.typedBufferStride+r]}set(e,r,i){this.typedBuffer[e*this.typedBufferStride+r]=i}setValues(e,r,i){e*=this.typedBufferStride,this.typedBuffer[e++]=r,this.typedBuffer[e]=i}copyFrom(e,r,i){const n=this.typedBuffer,s=r.typedBuffer;let o=e*this.typedBufferStride,a=i*r.typedBufferStride;n[o++]=s[a++],n[o]=s[a]}get buffer(){return this.typedBuffer.buffer}};o0.ElementCount=2;let a0=class{constructor(e,r,i=0,n,s){this.TypedArrayConstructor=e,this.elementCount=3;const o=this.TypedArrayConstructor;n===void 0&&(n=3*o.BYTES_PER_ELEMENT);const a=r.byteLength===0?0:i;this.typedBuffer=s==null?new o(r,a):new o(r,a,(s-i)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,r,i=this.count-r){const n=this.typedBuffer.byteOffset+r*this.stride;return new e(this.buffer,n,this.stride,n+i*this.stride)}getVec(e,r){return e*=this.typedBufferStride,ne(r,this.typedBuffer[e],this.typedBuffer[e+1],this.typedBuffer[e+2])}setVec(e,r){e*=this.typedBufferStride,this.typedBuffer[e++]=r[0],this.typedBuffer[e++]=r[1],this.typedBuffer[e]=r[2]}get(e,r){return this.typedBuffer[e*this.typedBufferStride+r]}set(e,r,i){this.typedBuffer[e*this.typedBufferStride+r]=i}setValues(e,r,i,n){e*=this.typedBufferStride,this.typedBuffer[e++]=r,this.typedBuffer[e++]=i,this.typedBuffer[e]=n}copyFrom(e,r,i){const n=this.typedBuffer,s=r.typedBuffer;let o=e*this.typedBufferStride,a=i*r.typedBufferStride;n[o++]=s[a++],n[o++]=s[a++],n[o]=s[a]}get buffer(){return this.typedBuffer.buffer}};a0.ElementCount=3;let l0=class{constructor(e,r,i=0,n,s){this.TypedArrayConstructor=e,this.start=i,this.elementCount=4;const o=this.TypedArrayConstructor;n===void 0&&(n=4*o.BYTES_PER_ELEMENT);const a=r.byteLength===0?0:i;this.typedBuffer=s==null?new o(r,a):new o(r,a,(s-i)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,r,i=this.count-r){const n=this.typedBuffer.byteOffset+r*this.stride;return new e(this.buffer,n,this.stride,n+i*this.stride)}getVec(e,r){return e*=this.typedBufferStride,gi(r,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,r){e*=this.typedBufferStride,this.typedBuffer[e++]=r[0],this.typedBuffer[e++]=r[1],this.typedBuffer[e++]=r[2],this.typedBuffer[e]=r[3]}get(e,r){return this.typedBuffer[e*this.typedBufferStride+r]}set(e,r,i){this.typedBuffer[e*this.typedBufferStride+r]=i}setValues(e,r,i,n,s){e*=this.typedBufferStride,this.typedBuffer[e++]=r,this.typedBuffer[e++]=i,this.typedBuffer[e++]=n,this.typedBuffer[e]=s}copyFrom(e,r,i){const n=this.typedBuffer,s=r.typedBuffer;let o=e*this.typedBufferStride,a=i*r.typedBufferStride;n[o++]=s[a++],n[o++]=s[a++],n[o++]=s[a++],n[o]=s[a]}get buffer(){return this.typedBuffer.buffer}};l0.ElementCount=4;let r8=class r2e extends s0{constructor(e,r=0,i,n){super(Float32Array,e,r,i,n),this.elementType="f32"}static fromTypedArray(e,r){return new r2e(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};r8.ElementType="f32";let d1=class xj extends o0{constructor(e,r=0,i,n){super(Float32Array,e,r,i,n),this.elementType="f32"}slice(e,r){return this.sliceBuffer(xj,e,r)}static fromTypedArray(e,r){return new xj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};d1.ElementType="f32";let ds=class Tj extends a0{constructor(e,r=0,i,n){super(Float32Array,e,r,i,n),this.elementType="f32"}slice(e,r){return this.sliceBuffer(Tj,e,r)}static fromTypedArray(e,r){return new Tj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};ds.ElementType="f32";let pp=class Sj extends l0{constructor(e,r=0,i,n){super(Float32Array,e,r,i,n),this.elementType="f32"}slice(e,r){return this.sliceBuffer(Sj,e,r)}static fromTypedArray(e,r){return new Sj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};pp.ElementType="f32";let q_=class Ej extends lQ{constructor(e,r=0,i,n){super(Float32Array,e,r,i,n),this.elementType="f32"}slice(e,r){return this.sliceBuffer(Ej,e,r)}static fromTypedArray(e,r){return new Ej(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};q_.ElementType="f32";let uQ=class Cj extends lQ{constructor(e,r=0,i,n){super(Float64Array,e,r,i,n),this.elementType="f64"}slice(e,r){return this.sliceBuffer(Cj,e,r)}static fromTypedArray(e,r){return new Cj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};uQ.ElementType="f64";let hQ=class Aj extends cQ{constructor(e,r=0,i,n){super(Float32Array,e,r,i,n),this.elementType="f32"}slice(e,r){return this.sliceBuffer(Aj,e,r)}static fromTypedArray(e,r){return new Aj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};hQ.ElementType="f32";let SR=class Oj extends cQ{constructor(e,r=0,i,n){super(Float64Array,e,r,i,n),this.elementType="f64"}slice(e,r){return this.sliceBuffer(Oj,e,r)}static fromTypedArray(e,r){return new Oj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};SR.ElementType="f64";let dQ=class Rj extends s0{constructor(e,r=0,i,n){super(Float64Array,e,r,i,n),this.elementType="f64"}slice(e,r){return this.sliceBuffer(Rj,e,r)}static fromTypedArray(e,r){return new Rj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};dQ.ElementType="f64";let pQ=class Pj extends o0{constructor(e,r=0,i,n){super(Float64Array,e,r,i,n),this.elementType="f64"}slice(e,r){return this.sliceBuffer(Pj,e,r)}static fromTypedArray(e,r){return new Pj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};pQ.ElementType="f64";let kh=class Mj extends a0{constructor(e,r=0,i,n){super(Float64Array,e,r,i,n),this.elementType="f64"}slice(e,r){return this.sliceBuffer(Mj,e,r)}static fromTypedArray(e,r){return new Mj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};kh.ElementType="f64";let i8=class $j extends l0{constructor(e,r=0,i,n){super(Float64Array,e,r,i,n),this.elementType="f64"}slice(e,r){return this.sliceBuffer($j,e,r)}static fromTypedArray(e,r){return new $j(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};i8.ElementType="f64";let kS=class Ij extends s0{constructor(e,r=0,i,n){super(Uint8Array,e,r,i,n),this.elementType="u8"}slice(e,r){return this.sliceBuffer(Ij,e,r)}static fromTypedArray(e,r){return new Ij(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};kS.ElementType="u8";let n8=class Lj extends o0{constructor(e,r=0,i,n){super(Uint8Array,e,r,i,n),this.elementType="u8"}slice(e,r){return this.sliceBuffer(Lj,e,r)}static fromTypedArray(e,r){return new Lj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};n8.ElementType="u8";let s8=class Dj extends a0{constructor(e,r=0,i,n){super(Uint8Array,e,r,i,n),this.elementType="u8"}slice(e,r){return this.sliceBuffer(Dj,e,r)}static fromTypedArray(e,r){return new Dj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};s8.ElementType="u8";let ya=class Nj extends l0{constructor(e,r=0,i,n){super(Uint8Array,e,r,i,n),this.elementType="u8"}slice(e,r){return this.sliceBuffer(Nj,e,r)}static fromTypedArray(e,r){return new Nj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};ya.ElementType="u8";let o8=class Fj extends s0{constructor(e,r=0,i,n){super(Uint16Array,e,r,i,n),this.elementType="u16"}slice(e,r){return this.sliceBuffer(Fj,e,r)}static fromTypedArray(e,r){return new Fj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};o8.ElementType="u16";let fQ=class Uj extends o0{constructor(e,r=0,i,n){super(Uint16Array,e,r,i,n),this.elementType="u16"}slice(e,r){return this.sliceBuffer(Uj,e,r)}static fromTypedArray(e,r){return new Uj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};fQ.ElementType="u16";let a8=class kj extends a0{constructor(e,r=0,i,n){super(Uint16Array,e,r,i,n),this.elementType="u16"}slice(e,r){return this.sliceBuffer(kj,e,r)}static fromTypedArray(e,r){return new kj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};a8.ElementType="u16";let DP=class zj extends l0{constructor(e,r=0,i,n){super(Uint16Array,e,r,i,n),this.elementType="u16"}slice(e,r){return this.sliceBuffer(zj,e,r)}static fromTypedArray(e,r){return new zj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};DP.ElementType="u16";let l8=class Bj extends s0{constructor(e,r=0,i,n){super(Uint32Array,e,r,i,n),this.elementType="u32"}slice(e,r){return this.sliceBuffer(Bj,e,r)}static fromTypedArray(e,r){return new Bj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};l8.ElementType="u32";let mQ=class Vj extends o0{constructor(e,r=0,i,n){super(Uint32Array,e,r,i,n),this.elementType="u32"}slice(e,r){return this.sliceBuffer(Vj,e,r)}static fromTypedArray(e,r){return new Vj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};mQ.ElementType="u32";let i2e=class Gj extends a0{constructor(e,r=0,i,n){super(Uint32Array,e,r,i,n),this.elementType="u32"}slice(e,r){return this.sliceBuffer(Gj,e,r)}static fromTypedArray(e,r){return new Gj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};i2e.ElementType="u32";let n2e=class jj extends l0{constructor(e,r=0,i,n){super(Uint32Array,e,r,i,n),this.elementType="u32"}slice(e,r){return this.sliceBuffer(jj,e,r)}static fromTypedArray(e,r){return new jj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};n2e.ElementType="u32";let gQ=class Hj extends s0{constructor(e,r=0,i,n){super(Int8Array,e,r,i,n),this.elementType="i8"}slice(e,r){return this.sliceBuffer(Hj,e,r)}static fromTypedArray(e,r){return new Hj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};gQ.ElementType="i8";let c8=class Wj extends o0{constructor(e,r=0,i,n){super(Int8Array,e,r,i,n),this.elementType="i8"}slice(e,r){return this.sliceBuffer(Wj,e,r)}static fromTypedArray(e,r){return new Wj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};c8.ElementType="i8";let s2e=class qj extends a0{constructor(e,r=0,i,n){super(Int8Array,e,r,i,n),this.elementType="i8"}slice(e,r){return this.sliceBuffer(qj,e,r)}static fromTypedArray(e,r){return new qj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};s2e.ElementType="i8";let o2e=class Xj extends l0{constructor(e,r=0,i,n){super(Int8Array,e,r,i,n),this.elementType="i8"}slice(e,r){return this.sliceBuffer(Xj,e,r)}static fromTypedArray(e,r){return new Xj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};o2e.ElementType="i8";let a2e=class Yj extends s0{constructor(e,r=0,i,n){super(Int16Array,e,r,i,n),this.elementType="i16"}slice(e,r){return this.sliceBuffer(Yj,e,r)}static fromTypedArray(e,r){return new Yj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};a2e.ElementType="i16";let NP=class Zj extends o0{constructor(e,r=0,i,n){super(Int16Array,e,r,i,n),this.elementType="i16"}slice(e,r){return this.sliceBuffer(Zj,e,r)}static fromTypedArray(e,r){return new Zj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};NP.ElementType="i16";let l2e=class Qj extends a0{constructor(e,r=0,i,n){super(Int16Array,e,r,i,n),this.elementType="i16"}slice(e,r){return this.sliceBuffer(Qj,e,r)}static fromTypedArray(e,r){return new Qj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};l2e.ElementType="i16";let c2e=class Jj extends l0{constructor(e,r=0,i,n){super(Int16Array,e,r,i,n),this.elementType="i16"}slice(e,r){return this.sliceBuffer(Jj,e,r)}static fromTypedArray(e,r){return new Jj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};c2e.ElementType="i16";let u2e=class Kj extends s0{constructor(e,r=0,i,n){super(Int32Array,e,r,i,n),this.elementType="i32"}slice(e,r){return this.sliceBuffer(Kj,e,r)}static fromTypedArray(e,r){return new Kj(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};u2e.ElementType="i32";let h2e=class eH extends o0{constructor(e,r=0,i,n){super(Int32Array,e,r,i,n),this.elementType="i32"}slice(e,r){return this.sliceBuffer(eH,e,r)}static fromTypedArray(e,r){return new eH(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};h2e.ElementType="i32";let d2e=class tH extends a0{constructor(e,r=0,i,n){super(Int32Array,e,r,i,n),this.elementType="i32"}slice(e,r){return this.sliceBuffer(tH,e,r)}static fromTypedArray(e,r){return new tH(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};d2e.ElementType="i32";let p2e=class rH extends l0{constructor(e,r=0,i,n){super(Int32Array,e,r,i,n),this.elementType="i32"}slice(e,r){return this.sliceBuffer(rH,e,r)}static fromTypedArray(e,r){return new rH(e.buffer,e.byteOffset,r,e.byteOffset+e.byteLength)}};p2e.ElementType="i32";function Pne(t){switch(t){case"u8":case"i8":return 1;case"u16":case"i16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}let Mne=class f2e{constructor(e,r){this.layout=e,this.buffer=typeof r=="number"?new ArrayBuffer(r*e.stride):r;for(const i of e.fields.keys()){const n=e.fields.get(i);this[i]=new n.constructor(this.buffer,n.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,r){const i=this[e];return i&&i.elementCount===r.ElementCount&&i.elementType===r.ElementType?i:null}slice(e,r){return new f2e(this.layout,this.buffer.slice(e*this.stride,r*this.stride))}copyFrom(e,r=0,i=0,n=e.count){const s=this.stride;if(s%4==0){const o=new Uint32Array(e.buffer,r*s,n*s/4);new Uint32Array(this.buffer,i*s,n*s/4).set(o)}else{const o=new Uint8Array(e.buffer,r*s,n*s);new Uint8Array(this.buffer,i*s,n*s).set(o)}return this}},m2e=class g2e{constructor(e=null){this._stride=0,this._lastAligned=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach(r=>this._fields.set(r[0],{...r[1],constructor:tXe(r[1].constructor)})))}vec2f(e,r){return this._appendField(e,d1,r),this}vec2f64(e,r){return this._appendField(e,pQ,r),this}vec3f(e,r){return this._appendField(e,ds,r),this}vec3f64(e,r){return this._appendField(e,kh,r),this}vec4f(e,r){return this._appendField(e,pp,r),this}vec4f64(e,r){return this._appendField(e,i8,r),this}mat3f(e,r){return this._appendField(e,q_,r),this}mat3f64(e,r){return this._appendField(e,uQ,r),this}mat4f(e,r){return this._appendField(e,hQ,r),this}mat4f64(e,r){return this._appendField(e,SR,r),this}vec4u8(e,r){return this._appendField(e,ya,r),this}f32(e,r){return this._appendField(e,r8,r),this}f64(e,r){return this._appendField(e,dQ,r),this}u8(e,r){return this._appendField(e,kS,r),this}u16(e,r){return this._appendField(e,o8,r),this}i8(e,r){return this._appendField(e,gQ,r),this}vec2i8(e,r){return this._appendField(e,c8,r),this}vec2i16(e,r){return this._appendField(e,NP,r),this}vec2u8(e,r){return this._appendField(e,n8,r),this}vec4u16(e,r){return this._appendField(e,DP,r),this}u32(e,r){return this._appendField(e,l8,r),this}_appendField(e,r,i){if(this._fields.has(e))return void Je(!1,`${e} already added to vertex buffer layout`);const n=r.ElementCount*Pne(r.ElementType),s=this._stride;this._stride+=n,this._fields.set(e,{size:n,constructor:r,offset:s,optional:i})}createBuffer(e){return new Mne(this,e)}createView(e){return new Mne(this,e)}clone(){const e=new g2e;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((r,i)=>e._fields.set(i,r)),e.BufferType=this.BufferType,e}get stride(){if(this._lastAligned!==this._fields.size){let e=1;this._fields.forEach(r=>e=Math.max(e,Pne(r.constructor.ElementType))),this._stride=Math.floor((this._stride+e-1)/e)*e,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}};function Gi(){return new m2e}let Kqe=class{constructor(e){this.fields=new Array,e.fields.forEach((r,i)=>{const n={...r,constructor:y2e(r.constructor)};this.fields.push([i,n])}),this.stride=e.stride}};const eXe=[r8,d1,ds,pp,q_,hQ,dQ,pQ,kh,i8,uQ,SR,kS,n8,s8,ya,o8,fQ,a8,DP,l8,mQ,i2e,n2e,gQ,c8,s2e,o2e,a2e,NP,l2e,c2e,u2e,h2e,d2e,p2e];function y2e(t){return`${t.ElementType}_${t.ElementCount}`}function tXe(t){return _2e.get(t)}const _2e=new Map;eXe.forEach(t=>_2e.set(y2e(t),t));function Ys(t,e=!1){return t<=_u?e?new Array(t).fill(0):new Array(t):new Float64Array(t)}function v2e(t){return(ap(t)?t.length:t.byteLength/8)<=_u?Array.from(t):new Float64Array(t)}function Ch(t,e,r){return Array.isArray(t)?t.slice(e,e+r):t.subarray(e,e+r)}function rXe(t,e){for(let r=0;r=65536)return ap(t)?new Uint32Array(t):t;r>=256&&(e=!1)}return e?new Uint8Array(t):new Uint16Array(t)}function u5(t){return t<=_u?new Array(t):t<=65536?new Uint16Array(t):new Uint32Array(t)}function iXe(t){return t<=_u?new Array(t):new Uint32Array(t)}let sx=(()=>{const t=new Uint32Array(131072);for(let e=0;e{const t=new Uint16Array(65536);for(let e=0;esx.length){const e=Math.max(2*sx.length,t);sx=new Uint32Array(e);for(let r=0;rv$.length){const e=Math.max(2*v$.length,t);v$=new Uint8Array(e)}return new Uint8Array(v$.buffer,0,t)}let Ue=class{constructor(e,r,i=!1,n=r){this.data=e,this.size=r,this.exclusive=i,this.stride=n}};var iH;(function(t){function e(o,a){const l=o[a],c=o[a+1],u=o[a+2];return Math.sqrt(l*l+c*c+u*u)}function r(o,a){const l=o[a],c=o[a+1],u=o[a+2],d=1/Math.sqrt(l*l+c*c+u*u);o[a]*=d,o[a+1]*=d,o[a+2]*=d}function i(o,a,l){o[a]*=l,o[a+1]*=l,o[a+2]*=l}function n(o,a,l,c,u,d=a){(u=u||o)[d]=o[a]+l[c],u[d+1]=o[a+1]+l[c+1],u[d+2]=o[a+2]+l[c+2]}function s(o,a,l,c,u,d=a){(u=u||o)[d]=o[a]-l[c],u[d+1]=o[a+1]-l[c+1],u[d+2]=o[a+2]-l[c+2]}t.length=e,t.normalize=r,t.scale=i,t.add=n,t.subtract=s})(iH||(iH={}));var on;(function(t){t[t.Layer=0]="Layer",t[t.Object=1]="Object",t[t.Mesh=2]="Mesh",t[t.Line=3]="Line",t[t.Point=4]="Point",t[t.Material=5]="Material",t[t.Texture=6]="Texture",t[t.COUNT=7]="COUNT"})(on||(on={}));function nXe(t){if(t.length<_u)return Array.from(t);if(ap(t))return Float64Array.from(t);if(!("BYTES_PER_ELEMENT"in t))return Array.from(t);switch(t.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(t);case 2:return WF(t)?Uint16Array.from(t):Int16Array.from(t);case 4:return Float32Array.from(t);default:return Float64Array.from(t)}}let w2e=class x2e{constructor(e,r,i,n){this.primitiveIndices=e,this._numIndexPerPrimitive=r,this.indices=i,this.position=n,this._children=void 0,Je(e.length>=1),Je(i.length%this._numIndexPerPrimitive==0),Je(i.length>=e.length*this._numIndexPerPrimitive),Je(n.size===3||n.size===4);const{data:s,size:o}=n,a=e.length;let l=o*i[this._numIndexPerPrimitive*e[0]];E1.clear(),E1.push(l);const c=Se(s[l],s[l+1],s[l+2]),u=ki(c);for(let m=0;m0&&++a;if(a<2)return;const l=new Array(8);for(let c=0;c<8;++c)l[c]=n[c]>0?new Uint32Array(n[c]):void 0;for(let c=0;c<8;++c)n[c]=0;for(let c=0;csXe());const jk=O(),Dne=O();function aXe(t,e,r){if(!t||!e)return!1;const{size:i,data:n}=t;ne(r,0,0,0),ne(th,0,0,0);let s=0,o=0;for(let a=0;a1&&te(r,r,1/o),o>0}function cXe(t,e,r,i){if(!t)return!1;ne(i,0,0,0),ne(th,0,0,0);let n=0,s=0;const{size:o,data:a}=t,l=e?e.length-1:a.length/o-1,c=l+(r?2:0);for(let u=0;u0?(oe(i,i,te(Bs,Bs,_)),n+=_):n===0&&(oe(th,th,Bs),s++)}return n!==0?(te(i,i,1/n),!0):s!==0&&(te(i,th,1/s),!0)}const Bs=O(),cg=O(),b$=O(),th=O();let h5=class{constructor(e){this.channel=e,this.id=wc()}};function nH(t,e,r){for(let i=0;ii!==e);return r.length===0?null:r}function dXe(t,e,r,i,n){w$[0]=t.get(e,0),w$[1]=t.get(e,1),w$[2]=t.get(e,2),nH(w$,C1,3),r.set(n,0,C1[0]),i.set(n,0,C1[1]),r.set(n,1,C1[2]),i.set(n,1,C1[3]),r.set(n,2,C1[4]),i.set(n,2,C1[5])}const w$=O(),C1=new Float32Array(6);let Xn=class T2e extends FP{constructor(e,r,i=[],n=null,s=on.Mesh,o=null,a=-1){super(),this.material=e,this.mapPositions=n,this.type=s,this.objectAndLayerIdColor=o,this.edgeIndicesLength=a,this.visible=!0,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[l,c]of r)c&&this._vertexAttributes.set(l,{...c});if(i==null||i.length===0){const l=pXe(this._vertexAttributes),c=zS(l);this.edgeIndicesLength=this.edgeIndicesLength<0?l:this.edgeIndicesLength;for(const u of this._vertexAttributes.keys())this._indices.set(u,c)}else for(const[l,c]of i)c&&(this._indices.set(l,zf(c)),l===E.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(l).length:this.edgeIndicesLength))}instantiate(e={}){const r=new T2e(e.material||this.material,[],void 0,this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._vertexAttributes.forEach((i,n)=>{i.exclusive=!1,r._vertexAttributes.set(n,i)}),this._indices.forEach((i,n)=>r._indices.set(n,i)),r._boundingInfo=this._boundingInfo,r.transformation=e.transformation||this.transformation,r}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){let r=this._vertexAttributes.get(e);return r&&!r.exclusive&&(r={...r,exclusive:!0,data:nXe(r.data)},this._vertexAttributes.set(e,r)),r}setAttributeData(e,r){const i=this._vertexAttributes.get(e);i&&this._vertexAttributes.set(e,{...i,exclusive:!0,data:r})}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo==null&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===on.Mesh?this._computeAttachmentOriginTriangles(e):this.type===on.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(this._transformation!=null&&De(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){const r=this.indices.get(E.POSITION),i=this.vertexAttributes.get(E.POSITION);return aXe(i,r,e)}_computeAttachmentOriginLines(e){const r=this.vertexAttributes.get(E.POSITION),i=this.indices.get(E.POSITION);return cXe(r,i,i&&fXe(this.material.parameters,r,i),e)}_computeAttachmentOriginPoints(e){const r=this.indices.get(E.POSITION),i=this.vertexAttributes.get(E.POSITION);return lXe(i,r,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(E.POSITION),r=this.vertexAttributes.get(E.POSITION);if(!e||e.length===0||!r)return null;const i=this.type===on.Mesh?3:1;Je(e.length%i==0,"Indexing error: "+e.length+" not divisible by "+i);const n=zS(e.length/i);return new w2e(n,i,e,r)}get transformation(){return this._transformation??yn}set transformation(e){this._transformation=e&&e!==yn?RS(e):null}get shaderTransformation(){return this._shaderTransformer!=null?this._shaderTransformer(this.transformation):this.transformation}get shaderTransformer(){return this._shaderTransformer}set shaderTransformer(e){this._shaderTransformer=e}get hasVolatileTransformation(){return this._shaderTransformer!=null}addHighlight(){const e=new h5(Hg.Highlight);return this.highlights=sH(this.highlights,e),e}removeHighlight(e){this.highlights=oH(this.highlights,e)}};function pXe(t){const e=t.values().next().value;return e==null?0:e.data.length/e.size}function fXe(t,e,r){return!(!("isClosed"in t)||!t.isClosed)&&(r?r.length>2:e.data.length>6)}const ox=iH,Hk=[[-.5,-.5,.5],[.5,-.5,.5],[.5,.5,.5],[-.5,.5,.5],[-.5,-.5,-.5],[.5,-.5,-.5],[.5,.5,-.5],[-.5,.5,-.5]],mXe=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],gXe=[0,0,1,0,1,1,0,1],yXe=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],S2e=new Array(36);for(let t=0;t<6;t++)for(let e=0;e<6;e++)S2e[6*t+e]=t;const Pv=new Array(36);for(let t=0;t<6;t++)Pv[6*t]=0,Pv[6*t+1]=1,Pv[6*t+2]=2,Pv[6*t+3]=2,Pv[6*t+4]=3,Pv[6*t+5]=0;function _Xe(t,e){Array.isArray(e)||(e=[e,e,e]);const r=new Array(24);for(let i=0;i<8;i++)r[3*i]=Hk[i][0]*e[0],r[3*i+1]=Hk[i][1]*e[1],r[3*i+2]=Hk[i][2]*e[2];return new Xn(t,[[E.POSITION,new Ue(r,3,!0)],[E.NORMAL,new Ue(mXe,3)],[E.UV0,new Ue(gXe,2)]],[[E.POSITION,yXe],[E.NORMAL,S2e],[E.UV0,Pv]])}const Wk=[[-.5,0,-.5],[.5,0,-.5],[.5,0,.5],[-.5,0,.5],[0,-.5,0],[0,.5,0]],vXe=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],bXe=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,4,3,0],wXe=[0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];function xXe(t,e){Array.isArray(e)||(e=[e,e,e]);const r=new Array(18);for(let i=0;i<6;i++)r[3*i]=Wk[i][0]*e[0],r[3*i+1]=Wk[i][1]*e[1],r[3*i+2]=Wk[i][2]*e[2];return new Xn(t,[[E.POSITION,new Ue(r,3,!0)],[E.NORMAL,new Ue(vXe,3)]],[[E.POSITION,bXe],[E.NORMAL,wXe]])}const $D=zr(-.5,0,-.5),ID=zr(.5,0,-.5),LD=zr(0,0,.5),DD=zr(0,.5,0),ax=rn(),lx=rn(),zT=rn(),BT=rn(),VT=rn();ae(ax,$D,DD),ae(lx,$D,ID),ot(zT,ax,lx),me(zT,zT),ae(ax,ID,DD),ae(lx,ID,LD),ot(BT,ax,lx),me(BT,BT),ae(ax,LD,DD),ae(lx,LD,$D),ot(VT,ax,lx),me(VT,VT);const qk=[$D,ID,LD,DD],TXe=[0,-1,0,zT[0],zT[1],zT[2],BT[0],BT[1],BT[2],VT[0],VT[1],VT[2]],SXe=[0,1,2,3,1,0,3,2,1,3,0,2],EXe=[0,0,0,1,1,1,2,2,2,3,3,3];function CXe(t,e){Array.isArray(e)||(e=[e,e,e]);const r=new Array(12);for(let i=0;i<4;i++)r[3*i]=qk[i][0]*e[0],r[3*i+1]=qk[i][1]*e[1],r[3*i+2]=qk[i][2]*e[2];return new Xn(t,[[E.POSITION,new Ue(r,3,!0)],[E.NORMAL,new Ue(TXe,3)]],[[E.POSITION,SXe],[E.NORMAL,EXe]])}function cMt(t,e,r,i,n={uv:!0}){const s=-Math.PI,o=2*Math.PI,a=-Math.PI/2,l=Math.PI,c=Math.max(3,Math.floor(r)),u=Math.max(2,Math.floor(i)),d=(c+1)*(u+1),p=Yi(3*d),m=Yi(3*d),y=Yi(2*d),_=[];let v=0;for(let S=0;S<=u;S++){const A=[],C=S/u,R=a+C*l,P=Math.cos(R);for(let F=0;F<=c;F++){const k=F/c,V=s+k*o,z=Math.cos(V)*P,X=Math.sin(R),q=-Math.sin(V)*P;p[3*v]=z*e,p[3*v+1]=X*e,p[3*v+2]=q*e,m[3*v]=z,m[3*v+1]=X,m[3*v+2]=q,y[2*v]=k,y[2*v+1]=C,A.push(v),++v}_.push(A)}const b=new Array;for(let S=0;Sd&&([u,d]=[d,u]);const p=u.toString()+"."+d.toString();if(o[p])return o[p];let m=n.length;return n.length+=3,ox.add(n,3*u,n,3*d,n,m),ox.scale(n,m,t/ox.length(n,m)),m/=3,o[p]=m,m}for(let u=0;u3?255*i[3]:255]:[255,255,255,255],p=n!=null&&n.length===2?n:[1,1],m=[[E.POSITION,new Ue(c,3,!0)],[E.NORMAL,new Ue(u,3,!0)],[E.UV0,new Ue(o,o.length)],[E.COLOR,new Ue(d,4,!0)],[E.SIZE,new Ue(p,2)]];if(s!=null){const y=[s[0],s[1],s[2],s[3]];m.push([E.AUXPOS1,new Ue(y,4)])}if(a!=null){const y=[a[0],a[1],a[2],a[3]];m.push([E.AUXPOS2,new Ue(y,4)])}return new Xn(t,m,null,null,on.Point,l)}const OXe=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0]];function uMt(t,e=OXe){const r=new Array(12);for(let u=0;u<4;u++)for(let d=0;d<3;d++)r[3*u+d]=e[u][d];const i=[0,1,2,2,3,0],n=[0,0,1],s=[0,0,0,0,0,0],o=[0,0,1,0,1,1,0,1],a=[255,255,255,255],l=[[E.POSITION,i],[E.NORMAL,s],[E.UV0,i],[E.COLOR,s]],c=[[E.POSITION,new Ue(r,3,!0)],[E.NORMAL,new Ue(n,3,!0)],[E.UV0,new Ue(o,2,!0)],[E.COLOR,new Ue(a,4,!0)]];return new Xn(t,c,l)}function Nne(t,e,r,i,n,s=!0,o=!0){let a=0;const l=r,c=e;let u=zr(0,a,0),d=zr(0,a+c,0),p=zr(0,-1,0),m=zr(0,1,0);n&&(a=c,d=zr(0,0,0),u=zr(0,a,0),p=zr(0,1,0),m=zr(0,-1,0));const y=[d,u],_=[p,m],v=i+2,b=Math.sqrt(c*c+l*l);if(n)for(let P=i-1;P>=0;P--){const F=P*(2*Math.PI/i),k=zr(Math.cos(F)*l,a,Math.sin(F)*l);y.push(k);const V=zr(c*Math.cos(F)/b,-l/b,c*Math.sin(F)/b);_.push(V)}else for(let P=0;P{T[V]=z,S[V]=X};let C=0;const R=rn(),P=rn();for(let V=0;V0?n[L][0]:-n[L][0]-1+i.length),u.push(n[L][1]>0?n[L][1]:-n[L][1]-1+i.length),u.push(n[L][2]>0?n[L][2]:-n[L][2]-1+i.length),d.push(0),d.push(0),d.push(0);let z=i.length;const X=i.length-1;for(let L=0;L0&&(re(y,_),L=0?z+n[L][0]:-n[L][0]-1+Q),u.push(n[L][2]>=0?z+n[L][2]:-n[L][2]-1+Q),u.push(n[L][1]>=0?z+n[L][1]:-n[L][1]-1+Q),d.push(G),d.push(G),d.push(G);const M=[[E.POSITION,u],[E.NORMAL,d]],I=[[E.POSITION,new Ue(l,3,!0)],[E.NORMAL,new Ue(c,3,!0)]];return new Xn(t,I,M)}function dMt(t,e,r,i){Je(e.length>1,"createPolylineGeometry(): polyline needs at least 2 points"),Je(e[0].length===3,"createPolylineGeometry(): malformed vertex"),Je(r==null||r.length===e.length,"createPolylineGeometry: need same number of points and normals"),Je(r==null||r[0].length===3,"createPolylineGeometry(): malformed normal");const n=Ys(3*e.length),s=new Array(2*(e.length-1));let o=0,a=0;for(let u=0;u0&&(s[a++]=u-1,s[a++]=u)}const l=[],c=[];if(l.push([E.POSITION,s]),c.push([E.POSITION,new Ue(n,3,!0)]),r){const u=Yi(3*r.length);let d=0;for(let p=0;pn)&&(ot(r,t,e),me(r,r),ot(i,r,t),me(i,i),!0)}function d5(t,e,r,i,n,s,o){return Xk(t,e,n,s,o)||Xk(t,r,n,s,o)||Xk(t,i,n,s,o)}const Fne=.99619469809;let MXe=class{constructor(e,r){this.type=ra.Local,this._configuration=new oQ,this._passParameters=new aQ,this._configuration.geometry=Jf.Cylinder,this._technique=r.techniqueRepository.acquire(l5,this._configuration);const i=r.renderContext.rctx;this._vao=this._createVertexArrayObject(i),this._vaoCount=No(this._vao,"geometry");const n=new pr;n.wrapMode=Pt.CLAMP_TO_EDGE,n.flipped=!0,n.width=1,n.height=512,this._passParameters.texture=new Ct(i,n,Zqe)}destroy(){this._passParameters.texture=Le(this._passParameters.texture),this._vao.dispose(),this._technique.release()}render(e){const r=e.rctx,i=r.bindTechnique(this._technique,this._passParameters,e.bindParameters);$Xe(Une,e.bindParameters.camera.viewMatrix),i.setUniformMatrix4fv("view",Une),r.bindVAO(this._vao),i.assertCompatibleVertexAttributeLocations(this._vao),r.drawArrays(Et.TRIANGLES,0,this._vaoCount)}renderHaze(){return!1}_createVertexArrayObject(e){const r=E2e(1,2,!1),i=r.indices[0][1],n=r.vertexAttributes[0][1];for(let l=0;l1-511/512,DXe=wD([[50,.1015625],[500,.21875],[5e3,1-250/512],[5e4,.4140625]]);let NXe=class{constructor(e,r){this.view=e,this.type=ra.Mars,this._passParameters=new aQ,this._vaoCount=0,this._texV1=1;const i=Mr(e.spatialReference);this._planetRadius=i.radius,this._outerRimWidth=i.outerAtmosphereRimWidth,this._innerRimFactor=(this._planetRadius+zne)/this._planetRadius,this._middleRimFactor=(this._planetRadius+Bne)/this._planetRadius,this._outerRimFactor=(this._planetRadius+this._outerRimWidth)/this._planetRadius,this._texV0=Bne/this._outerRimWidth,this._texVScale=this._texV1-this._texV0,this._techniqueRepository=r.techniqueRepository;const n=r.renderContext.rctx;this._cameraChangeHandle=ue(()=>{var a;return(a=this.view.state)==null?void 0:a.camera},()=>r.requestRender(),An),this._vao=this._createRibbon(n),this._vaoCount=No(this._vao,"geometry"),this._fadeVao=Dl(n),this._fadeVaoCount=No(this._fadeVao,"geometry");const s=new pr;s.wrapMode=Pt.CLAMP_TO_EDGE,s.flipped=!0,s.width=1,s.height=512,this._passParameters.texture=new Ct(n,s,IXe);const o=new oQ;o.geometry=Jf.Cone,this._coneTechnique=this._techniqueRepository.acquire(l5,o),o.geometry=Jf.Underground,this._undergroundTechnique=this._techniqueRepository.acquire(l5,o)}destroy(){this._coneTechnique.release(),this._undergroundTechnique.release(),this._cameraChangeHandle.remove(),this._passParameters.texture=Le(this._passParameters.texture),this._fadeVao.dispose(),this._vao.dispose()}render(e){const r=e.bindParameters.camera;this._update(r);const i=e.rctx;this._passParameters.undergroundFadeAlpha<1&&(i.bindTechnique(this._coneTechnique,this._passParameters,e.bindParameters),i.bindVAO(this._vao),i.drawArrays(Et.TRIANGLES,0,this._vaoCount)),this._passParameters.undergroundFadeAlpha>0&&(i.bindTechnique(this._undergroundTechnique,this._passParameters,e.bindParameters),i.bindVAO(this._fadeVao),i.drawArrays(Et.TRIANGLE_STRIP,0,this._fadeVaoCount))}renderHaze(){}_update(e){const r=O(),i=this._planetRadius,n=Te(e.eye),s=n-i;if(s<0){const m=Math.min(-s/5e3,1);this._passParameters.undergroundFadeAlpha=m}else this._passParameters.undergroundFadeAlpha=0;const o=Math.max(Yk,s),a=i+zne;this._passParameters.innerScale=FXe(i+o,i,a)-1,this._passParameters.altitudeFade=BZ(s),te(r,e.eye,(i+Yk)/n),Vne(r,e.center,e.up,i,this._passParameters.silhouette);const l=this._computeScreenRimWidth(e,r,e.up,this._passParameters.silhouette),c=LXe(),u=DXe(s);let d=this._texV0+c*this._texVScale,p=this._texV0+l*u*this._texVScale;if(s>Yk){Vne(e.eye,e.center,e.up,i,this._passParameters.silhouette);const m=this._computeScreenRimWidth(e,e.eye,e.up,this._passParameters.silhouette),y=ge((m-1.5)/(l-1.5),0,1);d=this._texV0+y*c*this._texVScale,p=this._texV0+wt(this._texV1,l*u,y)*this._texVScale}er(this._passParameters.texV,d,p)}_createRibbon(e){const r=Yi(3+3*x$*3),i=new Uint32Array(3*x$*5);r[0]=0,r[1]=0,r[2]=-1;for(let o=0;oi.camera.eye)),e.vertex.uniforms.add(new Lt("offset",(r,i)=>kXe(r,i))),e.vertex.uniforms.add(new Ce("width",r=>r.width)),e.vertex.uniforms.add(new Mi("proj",(r,i)=>i.camera.projectionMatrix)),e.vertex.uniforms.add(new Mi("view",(r,i)=>i.camera.viewMatrix)),e.vertex.uniforms.add(new Ce("time",r=>r.time)),e.varyings.add("vUv","vec2"),e.vertex.code.add(w` + vec3 hash31(float p){ + vec3 p3 = fract(vec3(p) * vec3(0.1031, 0.1030, 0.0973)); + p3 += dot(p3, p3.yzx + 33.33); + return fract((p3.xxy + p3.yzz) * p3.zyx); + } + + float hash11(float p){ + p = fract(p * 0.1031); + p *= p + 33.33; + p *= p + p; + return fract(p); + } + + //https://www.geeks3d.com/20141201/how-to-rotate-a-vertex-by-a-quaternion-in-glsl/ + vec3 rotateVectorByQuaternion(vec3 v, vec4 q){ + return 2.0 * cross(q.xyz, v * q.w + cross(q.xyz, v)) + v; + } + + void main(void) { + + vUv = position.xz; + + vec3 rand = hash31(instanceFeatureAttribute); + + // Set random position for all particles + // The hash function space is not high resolution so offset particles by an additional random value + // This creates grids of 1000 particles which are shifted by random hundreths of the tile width + // overlaying multiple identical but offset grids + vec3 randomPosition = 2.0 * (rand + (0.01 + 0.01 * rand) * floor(0.001 * instanceFeatureAttribute)) - 1.0; + + // Random orientation of rain drops + float angle = 3.1415 * hash11(instanceFeatureAttribute); + + vec3 up = vec3(0, 0, 1); + + // Gravity and wind direction + vec3 direction = normalize(cameraPosition); + + vec3 tangent = normalize(cross(direction, up)); + + // Gravity + vec3 animatedPos = randomPosition + direction * -time; + + // Rain particles fall straight down and are randomly oriented + // Snow particles have random sinusoid trajectories and are rotated to face the camera + ${t.type===Wg.Rain?w` + // Random rotation for particle + vec3 rotationAxis = up; + vec4 quat = vec4(rotationAxis * sin(angle), cos(angle)); + vec3 transformedPos = rotateVectorByQuaternion(vec3(0.2, 0.2, 4.0) * (position - vec3(0.5, 0.0, 0.5)), quat); + + // Rotate particle to planetary position + rotationAxis = tangent; + angle = 0.5 * -acos(dot(direction, up)); + quat = vec4(rotationAxis * sin(angle), cos(angle)); + transformedPos = rotateVectorByQuaternion(transformedPos, quat); + + vec4 pos = mat4(mat3(view)) * vec4(transformedPos + (mod(width * animatedPos - offset, width) - 0.5 * width), 1.0); + gl_Position = proj * pos; + `:w` + vec3 rotationAxis = direction; + vec4 quat = vec4(rotationAxis * sin(angle), cos(angle)); + + tangent = rotateVectorByQuaternion(tangent, quat); + // Random sinusoid from friction + animatedPos += tangent * 0.25 * sin(dot(animatedPos, direction)); + vec4 pos = mat4(mat3(view)) * vec4((mod(width * animatedPos - offset, width) - 0.5 * width), 1.0); + gl_Position = proj * (0.5 * vec4(position.xzy, 0.0) + pos); + `} + } + `),e.fragment.uniforms.add(new Ce("opacity",r=>r.opacity),new Lt("particleColor",(r,i)=>zXe(i,t))),e.fragment.code.add(w` + void main() { + + // Cut off corners of the triangle + if(vUv.x < 0.0 || vUv.y < 0.0){ + discard; + } + + float d = length(vUv - vec2(0.5)); + + ${t.type===Wg.Rain?w`d = 0.35 * smoothstep(0.5, 0.0, d);`:w`d = smoothstep(0.5, 0.1, d);`} + fragColor = opacity * vec4(particleColor * d, d); + } + `),e}function kXe(t,e){const r=e.camera.eye,i=.5*t.width,n=1/t.width,s=oye(cH,ne(cH,(r[0]+i)*n,(r[1]+i)*n,(r[2]+i)*n));return Ws(s,r,te(s,s,t.width))}function zXe(t,e){const r=e.type===Wg.Rain?VXe:BXe,i=te(cH,r,GXe),n=t.camera.eye;me(jne,n);const s=Math.max(0,fe(jne,t.lighting.mainLight.direction));return Lr(i,i,r,s)}const cH=O(),jne=O(),BXe=Se(1,1,1),VXe=Se(.85,.85,.85),GXe=.7,jXe=Object.freeze(Object.defineProperty({__proto__:null,build:UXe},Symbol.toStringTag,{value:"Module"}));let HXe=class extends Wr{constructor(){super(...arguments),this.time=0,this.radius=1,this.width=500,this.opacity=1}},uH=class C2e extends Tr{initializeProgram(e){return new vr(e.rctx,C2e.shader.get().build(this.configuration),ND)}initializePipeline(){return Ot({blending:So(ve.ONE,ve.ONE,ve.ONE_MINUS_SRC_ALPHA,ve.ONE_MINUS_SRC_ALPHA),depthTest:{func:Hr.LEQUAL},colorWrite:Ft})}};uH.shader=new _r(jXe,()=>ce(()=>import("./Precipitation.glsl-5b05b6be.js"),[]));const ND=new Map([[E.POSITION,0],[E.INSTANCEFEATUREATTRIBUTE,1]]);let A2e=class{constructor(){this.enabled=!0,this._time=0}get time(){return this._time}advance({deltaTime:e,fixedTime:r}){return r!=null?this._time!==r&&(this._time=r,!0):(this._time=this._time+e,e!==0)}},WXe=class{constructor(e,r){this.deltaTime=e,this.fixedTime=r}},Mv=class extends xe{constructor(e){super(e),this._numParticles=25e4,this._rainSpeed=.1,this._snowSpeed=.01,this._passParameters=new HXe,this._animation=new A2e,this._updatingTracking=new Df,this._passParameters.time=0,this._passParameters.radius=Mr(e.view.spatialReference).radius,this._techniqueRepository=e.context.techniqueRepository}destroy(){this._updatingTracking.destroy(),this._numParticles=0,this._snowTechniqueCached=Fi(this._snowTechniqueCached),this._rainTechniqueCached=Fi(this._rainTechniqueCached),this._vao=Le(this._vao),this._instanceIdBuffer=Le(this._instanceIdBuffer)}get updating(){return this._updatingTracking.updating}get _rainTechnique(){if(this._rainTechniqueCached==null){const e=new lH;e.type=Wg.Rain,this._rainTechniqueCached=this._techniqueRepository.acquire(uH,e)}return this._rainTechniqueCached}get _snowTechnique(){if(this._snowTechniqueCached==null){const e=new lH;e.type=Wg.Snow,this._snowTechniqueCached=this._techniqueRepository.acquire(uH,e)}return this._snowTechniqueCached}update(e){return this._animation.advance(e)}render(e,r,i){var l;const n=i==="rainy"?this._rainTechnique:this._snowTechnique;if(!n.compiled)return void this.context.requestRender();const s=e.rctx;if(this._ensureResources(s),n==null||this._vao==null||this._instanceIdBuffer==null||(e.bindParameters.cloudsFade.data!=null&&(this._passParameters.opacity=1-e.bindParameters.cloudsFade.fadeInOutHeight.factor),this._passParameters.opacity<=0))return;const o=.35;r=r<.5?wt(0,o,2*r):wt(o,1,2*(r-.5)),this._passParameters.time=(i==="rainy"?this._rainSpeed:this._snowSpeed)*OX(this._animation.time)%1e5;const a=s.bindTechnique(n,this._passParameters,e.bindParameters);s.bindVAO(this._vao),a.assertCompatibleVertexAttributeLocations(this._vao),jZ(s,ND,this._instanceIdBuffer,Hne,0),(l=s.capabilities.instancing)==null||l.drawArraysInstanced(Et.TRIANGLES,0,3,this._numParticles*r),HZ(s,ND,this._instanceIdBuffer,Hne)}_ensureResources(e){this._vao==null&&(this._vao=this._createVertexArrayObject(e)),this._instanceIdBuffer==null&&(this._instanceIdBuffer=this._createInstanceIndices(e))}_createInstanceIndices(e){const r=[];for(let i=0;iYXe(e,r)),new Jt("viewport",(e,r)=>r.camera.fullViewport),new Ce("pixelRatio",(e,r)=>r.camera.pixelRatio)),t.vertex.code.add(w`void main(void) { +gl_Position = transform * vec4(position, 0); +vcolor = color / 1.2; +vsize = size * 5.0 * pixelRatio; +gl_PointSize = vsize; +}`),t.fragment.code.add(w`void main() { +float cap = 0.7; +float scale = 1.0 / cap; +float helper = clamp(length(abs(gl_PointCoord - vec2(0.5))), 0.0, cap); +float alpha = clamp((cap - helper) * scale, 0.0, 1.0); +float intensity = alpha * alpha * alpha; +if (vsize < 3.0) { +intensity *= 0.5; +} +fragColor = vec4(vcolor.xyz, intensity); +}`),t}function YXe(t,e){return In(C0,e.camera.projectionMatrix),C0[10]=24e-8-1,C0[11]=-1,C0[14]=(24e-8-2)*e.camera.near,Vr(C0,C0,e.camera.viewMatrix),Vr(C0,C0,t.modelMatrix)}const C0=_e(),ZXe=Object.freeze(Object.defineProperty({__proto__:null,build:XXe},Symbol.toStringTag,{value:"Module"}));let QXe=class extends Wr{constructor(){super(...arguments),this.modelMatrix=_e()}},O2e=class R2e extends Tr{constructor(e){super(e,new va,()=>this.destroy())}initializeProgram(e){return new vr(e.rctx,R2e.shader.get().build(),fr)}initializePipeline(){return Ot({blending:So(ve.SRC_ALPHA,ve.ONE,ve.ONE_MINUS_SRC_ALPHA,ve.ONE_MINUS_SRC_ALPHA),depthTest:{func:Hr.LEQUAL},colorWrite:Ft})}};O2e.shader=new _r(ZXe,()=>ce(()=>import("./Stars.glsl-0c573990.js"),[]));let by=class extends xe{get updating(){return this._updatingTracking.updating||this.loading}get loading(){return this._loadDataTask!=null&&!this._loadDataTask.finished}constructor(e){super(e),this._loadDataTask=null,this._numPoints=0,this._renderParameter=new QXe,this._updatingTracking=new Df}initialize(){this._loadDataTask=this._createLoadDataTask()}destroy(){this._loadDataTask=yu(this._loadDataTask),this._updatingTracking.destroy(),this._numPoints=0,this._technique=Fi(this._technique),this._vao=Le(this._vao),A1=null}render(e){const{rctx:r}=e;if(this._ensureResources(r),this._technique==null||this._vao==null)return;if(!this._technique.compiled)return void this.requestRender();const i=r.bindTechnique(this._technique,this._renderParameter,e.bindParameters);r.bindVAO(this._vao),i.assertCompatibleVertexAttributeLocations(this._vao),r.drawArrays(Et.POINTS,0,this._numPoints)}_ensureResources(e){if(this._technique!=null||A1==null)return;this._technique=new O2e({rctx:e,viewingMode:this.view.state.viewingMode}),this._numPoints=A1.byteLength/Wne;const r=new Float32Array(A1,0,2*this._numPoints),i=new Uint8Array(A1,2*this._numPoints*4,this._numPoints);this._vao=this._createVertexArrayObject(e,r,i,this._numPoints),this._updatingTracking.add(()=>this.view.environment.lighting.type!=="virtual"?this.view.environment.lighting.date:null,n=>this._update(n),Pr)}_computeDayDuration(e){const r=e,i=new Date(e.getFullYear(),0,1,11,58,56);return(+r-+i)/(+new Date(e.getFullYear()+1,0,1,11,58,55)-+i)}_update(e){if(!e)return;const r=(e.getHours()/12+e.getMinutes()/60*(2/24)+e.getSeconds()/60*(2/1440)-.9972222)%2,i=2*this._computeDayDuration(e),n=In(this._renderParameter.modelMatrix,eYe);AS(n,n,-i*Math.PI),Vr(n,KXe,n),AS(n,n,-r*Math.PI),this.requestRender()}_hexToRGB(e){return[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]}_unpackUint8Attributes(e){return e>=192?[2.9,e-192]:e>=160?[2.5,e-160]:e>=128?[2,e-128]:e>=96?[1.5,e-96]:e>=64?[1,e-64]:e>=32?[.7,e-32]:[.4,e]}_createVertexArrayObject(e,r,i,n){const s=qne.createBuffer(n),o=s.position,a=s.color,l=s.size;for(let c=0;c{const{data:i}=await bFe("esri/views/3d/environment/resources/stars.wsv",{responseType:"array-buffer",signal:r});this._verifyStarData(i),A1=i});return e.promise.catch(r=>{Zn(r)||J.getLogger(this).error(r)}).then(()=>{this.destroyed||(this.requestRender(),this.notifyChange("updating"))}),e}_verifyStarData(e){if(!e)throw new Y("stars:no-data-received","Failed to create stars because star catalogue is missing");const r=e.byteLength/Wne;if(r%1!=0||r>5e4||r<5e3)throw new Y("stars:invalid-data","Failed to create stars because star catalogue data is invalid")}};h([f({constructOnly:!0})],by.prototype,"view",void 0),h([f({constructOnly:!0})],by.prototype,"requestRender",void 0),h([f({readOnly:!0})],by.prototype,"updating",null),h([f()],by.prototype,"_loadDataTask",void 0),h([f()],by.prototype,"_updatingTracking",void 0),by=h([N("esri.views.3d.environment.Stars")],by);const JXe=["9bb2ff","9eb5ff","aabfff","bbccff","ccd8ff ","dae2ff","e4e9ff","eeefff","f8f6ff","fff9fb","fff5ef","fff1e5","ffeddb","ffe9d2","ffe6ca","ffe3c3","ffe0bb","ffddb4","ffdaad","ffd6a5","ffd29c","ffcc8f","ffc178","ffa94b","ff7b00"],KXe=yZ(1,0,0,0,0,.9174771405229186,.39778850739794974,0,0,-.39778850739794974,.9174771405229186,0,0,0,0,1),eYe=yZ(1,0,0,0,0,.9174771405229186,-.39778850739794974,0,0,.39778850739794974,.9174771405229186,0,0,0,0,1),Wne=9,qne=Gi().vec3f(E.POSITION).vec4u8(E.COLOR).f32(E.SIZE);let A1=null;function tYe(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function ER(t,e,r){r*=.5;const i=Math.sin(r);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(r),t}function yQ(t,e){const r=2*Math.acos(e[3]),i=Math.sin(r/2);return i>tl()?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=1,t[1]=0,t[2]=0),r}function _Q(t,e,r){const i=e[0],n=e[1],s=e[2],o=e[3],a=r[0],l=r[1],c=r[2],u=r[3];return t[0]=i*u+o*a+n*c-s*l,t[1]=n*u+o*l+s*a-i*c,t[2]=s*u+o*c+i*l-n*a,t[3]=o*u-i*a-n*l-s*c,t}function rYe(t,e,r){r*=.5;const i=e[0],n=e[1],s=e[2],o=e[3],a=Math.sin(r),l=Math.cos(r);return t[0]=i*l+o*a,t[1]=n*l+s*a,t[2]=s*l-n*a,t[3]=o*l-i*a,t}function iYe(t,e,r){r*=.5;const i=e[0],n=e[1],s=e[2],o=e[3],a=Math.sin(r),l=Math.cos(r);return t[0]=i*l-s*a,t[1]=n*l+o*a,t[2]=s*l+i*a,t[3]=o*l-n*a,t}function nYe(t,e,r){r*=.5;const i=e[0],n=e[1],s=e[2],o=e[3],a=Math.sin(r),l=Math.cos(r);return t[0]=i*l+n*a,t[1]=n*l-i*a,t[2]=s*l+o*a,t[3]=o*l-s*a,t}function sYe(t,e){const r=e[0],i=e[1],n=e[2];return t[0]=r,t[1]=i,t[2]=n,t[3]=Math.sqrt(Math.abs(1-r*r-i*i-n*n)),t}function FD(t,e,r,i){const n=e[0],s=e[1],o=e[2],a=e[3];let l,c,u,d,p,m=r[0],y=r[1],_=r[2],v=r[3];return c=n*m+s*y+o*_+a*v,c<0&&(c=-c,m=-m,y=-y,_=-_,v=-v),1-c>tl()?(l=Math.acos(c),u=Math.sin(l),d=Math.sin((1-i)*l)/u,p=Math.sin(i*l)/u):(d=1-i,p=i),t[0]=d*n+p*m,t[1]=d*s+p*y,t[2]=d*o+p*_,t[3]=d*a+p*v,t}function oYe(t){const e=mP,r=e(),i=e(),n=e(),s=Math.sqrt(1-r),o=Math.sqrt(r);return t[0]=s*Math.sin(2*Math.PI*i),t[1]=s*Math.cos(2*Math.PI*i),t[2]=o*Math.sin(2*Math.PI*n),t[3]=o*Math.cos(2*Math.PI*n),t}function aYe(t,e){const r=e[0],i=e[1],n=e[2],s=e[3],o=r*r+i*i+n*n+s*s,a=o?1/o:0;return t[0]=-r*a,t[1]=-i*a,t[2]=-n*a,t[3]=s*a,t}function X_(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function P2e(t,e){const r=e[0]+e[4]+e[8];let i;if(r>0)i=Math.sqrt(r+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{let n=0;e[4]>e[0]&&(n=1),e[8]>e[3*n+n]&&(n=2);const s=(n+1)%3,o=(n+2)%3;i=Math.sqrt(e[3*n+n]-e[3*s+s]-e[3*o+o]+1),t[n]=.5*i,i=.5/i,t[3]=(e[3*s+o]-e[3*o+s])*i,t[s]=(e[3*s+n]+e[3*n+s])*i,t[o]=(e[3*o+n]+e[3*n+o])*i}return t}function lYe(t,e,r,i){const n=.5*Math.PI/180;e*=n,r*=n,i*=n;const s=Math.sin(e),o=Math.cos(e),a=Math.sin(r),l=Math.cos(r),c=Math.sin(i),u=Math.cos(i);return t[0]=s*l*u-o*a*c,t[1]=o*a*u+s*l*c,t[2]=o*l*c-s*a*u,t[3]=o*l*u+s*a*c,t}function cYe(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}const vQ=vh,uYe=gi,hYe=cY,dYe=_Q,pYe=ew,fYe=fye,mYe=dY,M2e=uY,gYe=M2e,$2e=hY,yYe=$2e,bQ=pye,_Ye=LT,vYe=x4;function bYe(t,e,r){const i=fe(e,r);return i<-.999999?(ot(Pp,wYe,e),rc(Pp)<1e-6&&ot(Pp,xYe,e),me(Pp,Pp),ER(t,Pp,Math.PI),t):i>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(ot(Pp,e,r),t[0]=Pp[0],t[1]=Pp[1],t[2]=Pp[2],t[3]=1+i,bQ(t,t))}const Pp=O(),wYe=Se(1,0,0),xYe=Se(0,1,0);function TYe(t,e,r,i,n,s){return FD(Xne,e,n,s),FD(Yne,r,i,s),FD(t,Xne,Yne,2*s*(1-s)),t}const Xne=Au(),Yne=Au();function SYe(t,e,r,i){const n=EYe;return n[0]=r[0],n[3]=r[1],n[6]=r[2],n[1]=i[0],n[4]=i[1],n[7]=i[2],n[2]=-e[0],n[5]=-e[1],n[8]=-e[2],bQ(t,P2e(t,n))}const EYe=hi();Object.freeze(Object.defineProperty({__proto__:null,add:hYe,calculateW:sYe,conjugate:X_,copy:vQ,dot:fYe,equals:vYe,exactEquals:_Ye,fromEuler:lYe,fromMat3:P2e,getAxisAngle:yQ,identity:tYe,invert:aYe,len:gYe,length:M2e,lerp:mYe,mul:dYe,multiply:_Q,normalize:bQ,random:oYe,rotateX:rYe,rotateY:iYe,rotateZ:nYe,rotationTo:bYe,scale:pYe,set:uYe,setAxes:SYe,setAxisAngle:ER,slerp:FD,sqlerp:TYe,sqrLen:yYe,squaredLength:$2e,str:cYe},Symbol.toStringTag,{value:"Module"}));function jh(t=I2e){return[t[0],t[1],t[2],t[3]]}function UD(t,e,r=jh()){return re(r,t),r[3]=e,r}function Zne(t,e,r=jh()){return ot(r,t,e),me(r,r),r[3]=-lye(t,e),r}function hH(t,e,r=jh()){return ER(S$,t,p5(t)),ER(Qne,e,p5(e)),_Q(S$,Qne,S$),OYe(r,Ka(yQ(r,S$)))}function CYe(t,e,r,i=jh()){return UD(nye,t,E$),UD(sye,e,Jne),UD(oY,r,Kne),hH(E$,Jne,E$),hH(E$,Kne,i),i}function AYe(t){return t[3]}function p5(t){return It(t[3])}function OYe(t,e){return t[3]=e,t}const I2e=[0,0,1,0],S$=Au(),Qne=Au();jh();const E$=jh(),Jne=jh(),Kne=jh();function RYe(t,e,r){const i=t.parallax.anchorPointClouds;t.fadeIn.stage===oc.FINISHED&&(t.fadeIn.factor=0,re(i,Sf),t.fadeIn.stage=oc.CHANGE_ANCHOR,t.crossFade.enabled=!1,t.fadeInOut.stage=ys.FINISHED),t.fadeIn.stage===oc.CHANGE_ANCHOR&&t.isCameraPositionFinal&&(QZ(t.data)&&t.renderingStage!==On.RENDERING||t.renderingStage===On.FADING_TEXTURE_CHANNELS)&&(re(i,Sf),t.fadeIn.stage=oc.FADE_IN,t.startTime=e,t.renderingStage===On.FADING_TEXTURE_CHANNELS&&(t.renderingStage=On.SWITCH_CHANNELS)),t.fadeIn.factor<1&&t.fadeIn.stage===oc.FADE_IN?t.fadeIn.factor=r?ge((e-t.startTime)/(L2e*r),0,1):1:t.fadeIn.factor>=1&&t.fadeIn.stage===oc.FADE_IN&&(t.fadeIn.stage=oc.FINISHED,t.fadeIn.factor=1)}function PYe(t,e,r){const{fadeInOut:i,crossFade:n}=t;i.stage===ys.FINISHED&&(t.startTime=e,i.factor=1,i.stage=ys.FADE_OUT),i.factor>0&&i.stage===ys.FADE_OUT?i.factor=r?1-ge((e-t.startTime)/(DYe*r),0,1):0:(i.factor<=0&&i.stage===ys.FADE_OUT&&(i.factor=0,re(t.parallax.anchorPointClouds,Sf)),i.factor<=0&&i.stage===ys.FADE_OUT&&t.isCameraPositionFinal&&(i.factor=0,i.stage=ys.SWITCH,t.crossFade.enabled=!1,n.factor=1),i.stage===ys.SWITCH&&(QZ(t.data)&&t.renderingStage!==On.RENDERING||t.renderingStage===On.FADING_TEXTURE_CHANNELS)&&(t.startTime=e,i.factor=0,i.stage=ys.FADE_IN,re(t.parallax.anchorPointClouds,Sf),t.crossFade.enabled=!1,n.factor=1,t.renderingStage===On.FADING_TEXTURE_CHANNELS&&(t.renderingStage=On.SWITCH_CHANNELS)),i.factor<1&&i.stage===ys.FADE_IN?i.factor=r?ge((e-t.startTime)/(L2e*r),0,1):1:i.factor>=1&&i.stage===ys.FADE_IN&&(i.stage=ys.FINISHED,i.factor=1))}function MYe(t,e,r,i){const{crossFade:n}=t,s=t.parallax.anchorPointClouds;t.crossFade.enabled&&!i||(re(t.parallaxNew.anchorPointClouds,Sf),t.startTime=e,n.factor=0,t.crossFade.enabled=!0),n.factor<1&&t.crossFade.enabled?n.factor=r?ge((e-t.startTime)/(NYe*r),0,1):1:n.factor>=1&&t.crossFade.enabled&&(t.crossFade.enabled=!1,n.factor=1,re(s,t.parallaxNew.anchorPointClouds),t.renderingStage===On.FADING_TEXTURE_CHANNELS&&(t.renderingStage=On.SWITCH_CHANNELS))}function ese(t,e,r,i){const n=t.fadeInOutHeight,s=n.stage===H_.FINISHED?r:t.startTimeHeightFade;if(i!==0){const o=(r-s)/(FYe*i);n.factor+=e?-o:o}else n.factor=e?0:1;t.startTimeHeightFade=r,n.factor=ge(n.factor,0,1),n.stage=H_.HEIGHT_FADE}function $Ye(t,e,r,i,n){t.renderingStage===On.FINISHED_RENDERING&&(t.renderingStage=On.FADING_TEXTURE_CHANNELS);const s=Te(e.eye);t.fadeInOutHeight.factor<0&&(t.fadeInOutHeight.factor=s-Kt.radius>yf?1:0),t.isCameraPositionFinal=N_(t.cameraPositionLastFrame,e.eye),me(Sf,e.eye),te(Sf,Sf,Kt.radius);const o=t.parallax;o.anchorPointClouds[0]===0&&o.anchorPointClouds[1]===0&&o.anchorPointClouds[2]===0&&re(o.anchorPointClouds,Sf);const a=Te(ae(LYe,o.anchorPointClouds,Sf));let l=!0;a>t.fadeIn.distanceThresholdFactor*o.cloudsHeight||t.fadeIn.stage!==oc.FINISHED?RYe(t,i,n):a>t.fadeInOut.distanceThresholdFactor*o.cloudsHeight||t.fadeInOut.stage!==ys.FINISHED?PYe(t,i,n):a>t.crossFade.distanceThresholdFactor*o.cloudsHeight||t.crossFade.enabled||t.renderingStage===On.FADING_TEXTURE_CHANNELS?MYe(t,i,n,(r!==Cr.IDLE||!QZ(t.data))&&t.renderingStage!==On.FADING_TEXTURE_CHANNELS):l=!1;const c=s-Kt.radius;if((c>1.7*yf||c<-yf)&&t.fadeInOutHeight.factor<1?t.fadeInOutHeight.factor=1:(c>yf||c<-.35*yf)&&t.fadeInOutHeight.factor<1?ese(t,!1,i,n):c-.35*yf&&t.fadeInOutHeight.factor>0?ese(t,!0,i,n):t.fadeInOutHeight.stage=H_.FINISHED,t.renderingStage===On.SWITCH_CHANNELS&&(t.readChannels=1-t.readChannels,t.renderingStage=On.FINISHED),o.radiusCurvatureCorrectionFactor=.84*Math.sqrt(Math.max(s*s-Kt.radius*Kt.radius,0))/s,Zne(tse,o.anchorPointClouds,ux),mc(o.transform,yn,ux[3],ux),l){const{parallaxNew:u}=t;Zne(tse,u.anchorPointClouds,ux),mc(u.transform,yn,ux[3],ux)}re(t.cameraPositionLastFrame,e.eye)}function IYe(t){return t.crossFade.enabled||t.fadeInOut.stage!==ys.FINISHED||t.fadeIn.stage!==oc.FINISHED||t.fadeInOutHeight.stage!==H_.FINISHED||t.renderingStage!==On.FINISHED}const tse=Se(0,0,1),ux=jh(),Sf=O(),LYe=O(),L2e=1,DYe=.5,NYe=1.3,FYe=1;let RE=class{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return this._outer.size===0}get(e,r){var i;return(i=this._outer.get(e))==null?void 0:i.get(r)}set(e,r,i){const n=this._outer.get(e);n?n.set(r,i):this._outer.set(e,new Map([[r,i]]))}delete(e,r){const i=this._outer.get(e);i&&(i.delete(r),i.size===0&&this._outer.delete(e))}forEach(e){this._outer.forEach((r,i)=>e(r,i))}};var Hn;function rse(t=!se("disable-feature:high-quality-idle"),e=null){const r=new RE;return t?(r.set(Cr.IDLE,Hn.Antialiasing,e!=="low"),r.set(Cr.IDLE,Hn.HighResolutionAtmosphere,e!=="low"),r.set(Cr.IDLE,Hn.HighQualityTransparency,!0),r.set(Cr.IDLE,Hn.SSAO,!0),r.set(Cr.IDLE,Hn.WaterReflection,!0),r.set(Cr.IDLE,Hn.PhysicalPixelRendering,!se("esri-mobile"))):(r.set(Cr.ANIMATING,Hn.HighResolutionShadows,!0),r.set(Cr.INTERACTING,Hn.HighResolutionShadows,!0)),r.set(Cr.IDLE,Hn.HighResolutionShadows,!0),r.set(Cr.IDLE,Hn.HighResolutionVoxel,!0),r}(function(t){t[t.Antialiasing=0]="Antialiasing",t[t.HighQualityTransparency=1]="HighQualityTransparency",t[t.HighResolutionVoxel=2]="HighResolutionVoxel",t[t.HighResolutionAtmosphere=3]="HighResolutionAtmosphere",t[t.SSAO=4]="SSAO",t[t.WaterReflection=5]="WaterReflection",t[t.HighResolutionShadows=6]="HighResolutionShadows",t[t.PhysicalPixelRendering=7]="PhysicalPixelRendering"})(Hn||(Hn={}));var GT;(function(t){t[t.Immediate=0]="Immediate",t[t.Faded=1]="Faded"})(GT||(GT={}));var J3;const UYe=[le.POSTPROCESSING_ENVIRONMENT_OPAQUE,le.POSTPROCESSING_ENVIRONMENT_TRANSPARENT];let Oo=J3=class extends xe{constructor(t){super(t),this._context=null,this._atmosphere=null,this._oldWeatherParameters=new Qk,this._newWeatherParameters=new Qk,this._fadedWeatherParameters=new Qk,this._weatherParameters=this._newWeatherParameters}initialize(){this.view._stage.addRenderPlugin(UYe,this)}destroy(){var t;this.removeHandles(),this.uninitializeRenderContext(),((t=this.view)==null?void 0:t._stage)!=null&&this.view._stage.removeRenderPlugin(this),this._set("view",null)}get atmosphere(){return this._atmosphere}get _atmosphereType(){return this.atmosphere!=null?this.atmosphere.type:ra.None}get canRender(){return!(this._atmosphere===null&&this._stars===null)}get needsLinearDepth(){return this._atmosphereType===ra.Realistic}updateAnimation(t){return this._precipitation!=null&&this._precipitation.update(t)}get updating(){return this._stars!=null&&this._stars.updating||this._clouds!=null&&this._clouds.running}get weatherVisible(){return Te(this.view.state.camera.eye)-Mr(this.view.spatialReference).radius<=yf}get _stars(){var i;const t=this.view,e=((i=t.environment)==null?void 0:i.starsEnabled)??!1,r=this._get("_stars");return e&&this._context!=null?r??new by({view:t,requestRender:()=>this._setNeedsRender()}):(Me(r),null)}get _precipitation(){const t=this._get("_precipitation");if(!this._precipitationEnabled||this._context==null)return Me(t),null;const e=this.view,r=this._context;return t!=null&&t.context===r?t:(Me(t),new Mv({context:r,view:e}))}get _clouds(){const t=this._get("_clouds");if(!this.weatherEnabled||this._context==null)return Me(t),null;if(t!=null)return t;const e=this.view,r=this._context;return Me(t),new fl({context:r,view:e,requestRender:()=>this._setNeedsRender()})}get _cloudsComposition(){const t=this._get("_cloudsComposition");if(!this.weatherEnabled||this._context==null)return Me(t),null;const e=this.view.state.viewingMode,r=this._context.renderContext.rctx,i=Mr(this.view.spatialReference).radius;return t!=null&&t.viewingMode===e&&t.planetRadius===i?t:(Me(t),new Ov({rctx:r,viewingMode:e,planetRadius:i,requestRender:()=>this._setNeedsRender()}))}get _fog(){const t=this._get("_fog");if(!this.weatherEnabled||this._context==null)return Me(t),null;if(t!=null)return t;const e=this.view,r=this._context,i=this._context.renderContext.rctx,n=this.view.state.viewingMode;return new Rv({context:r,view:e,rctx:i,viewingMode:n})}get weatherEnabled(){var t,e;return!!((e=(t=this.view)==null?void 0:t.environmentManager)!=null&&e.weatherEnabled)}get _precipitationEnabled(){return this.weatherEnabled&&(this.view.environment.weather.type==="rainy"||this.view.environment.weather.type==="snowy")}initializeRenderContext(t=null){this._context=t;const e=()=>this._setNeedsRender();this.addHandles([ue(()=>({viewingMode:this.view.state.viewingMode,enabled:this.view.environment.atmosphereEnabled}),r=>this._updateAtmosphere(r),An),ue(()=>this._stars,e),ue(()=>this._precipitation,e),ue(()=>this._clouds,()=>this._updateWeather(),Pr),ue(()=>this._fog,()=>this._updateFogHaze(),Pr),ue(()=>this.view.state.mode,()=>{this._setNeedsRender()},Br),ue(()=>this._weatherUpdateParameters,()=>{this._updateWeather(),this._updateFogHaze()},An)])}uninitializeRenderContext(){this._context=null,this._atmosphere=Me(this._atmosphere),this._set("_stars",Me(this._stars)),this._set("_precipitation",Me(this._precipitation)),this._set("_clouds",Me(this._clouds)),this._set("_cloudsComposition",Me(this._cloudsComposition)),this._set("_fog",Me(this._fog))}prepareRender(t){var e;t.bindParameters.cloudsFade.data=SWe(this._clouds)?this._clouds:null,this.view.viewingMode!=="local"&&((e=t.bindParameters.cloudsFade.data)==null?void 0:e.cubeMap)!=null&&($Ye(t.bindParameters.cloudsFade,t.bindParameters.camera,this.view.state.mode,t.time,this.view.qualitySettings.fadeDuration),this._updateWeatherFading(t.bindParameters),t.bindParameters.cloudsFade.renderingStage===On.FINISHED&&this._clouds!=null&&this._clouds.coverage===0&&this._clouds.running===!1&&(this._clouds.destroyFrameBufferCube(),t.bindParameters.cloudsFade.data=null))}render(t){var e,r,i,n,s,o,a,l,c;if(t.output===D.Color)switch(t.bindParameters.slot){case le.POSTPROCESSING_ENVIRONMENT_OPAQUE:this._stars!=null&&this._stars.render(t),this.atmosphere!=null&&(this.atmosphere.render(t,((e=this.view)==null?void 0:e.qualitySettings.highResolutionAtmosphere)||((n=(i=(r=this.view)==null?void 0:r._stage)==null?void 0:i.renderer)==null?void 0:n.isFeatureEnabled(Hn.HighResolutionAtmosphere))),this._cloudsComposition!=null&&t.bindParameters.cloudsFade.data!=null&&(this.weatherVisible&&this._clouds!=null&&this._clouds.updateWeatherTile(),this._cloudsComposition.render(t)),IYe(t.bindParameters.cloudsFade)&&this._context!=null&&((s=t.bindParameters.cloudsFade.data)==null?void 0:s.cubeMap)!=null&&this._context.requestRender());break;case le.POSTPROCESSING_ENVIRONMENT_TRANSPARENT:if(this.atmosphere!=null&&(this.atmosphere.renderHaze(t,this._weatherParameters.hazeAmount,((o=this.view)==null?void 0:o.qualitySettings.highResolutionAtmosphere)||((c=(l=(a=this.view)==null?void 0:a._stage)==null?void 0:l.renderer)==null?void 0:c.isFeatureEnabled(Hn.HighResolutionAtmosphere))),this._weatherParameters.fog.amount>0&&this._fog!=null&&this._fog.render(t,this._weatherParameters.fog),this._precipitation!=null)){const u=this.view.environment.weather;u.type!=="rainy"&&u.type!=="snowy"||this._precipitation.render(t,u.precipitation,u.type)}}}updateLightSources(t,e,r,i){if(this._context!=null){const n=this._context.renderContext;n.bindParameters.oldLighting.copyFrom(n.bindParameters.lighting),n.bindParameters.newLighting.noonFactor=e,n.bindParameters.newLighting.globalFactor=r,n.bindParameters.newLighting.set(t),i===GT.Faded||n.bindParameters.weatherFading?n.bindParameters.fadeLighting(0):n.bindParameters.fadeLighting(1),this._context.requestRender()}}get _weatherUpdateParameters(){const t=this.weatherEnabled?this.view.environment.weather:null;return t==null?null:t.type==="rainy"||t.type==="snowy"?{type:t.type,weatherAdjustment:t.cloudCover,effect:t.precipitation}:{type:t.type,weatherAdjustment:t.type==="foggy"?t.fogStrength:t.cloudCover}}_updateWeatherFading(t){if(!t.weatherFading)return;const e=t.cloudsFade;return e.fadeIn.stage===oc.FADE_IN?(t.fadeLighting(e.fadeIn.factor),void this._fadeWeather(e.fadeIn.factor)):e.fadeInOut.stage===ys.FADE_IN?(t.fadeLighting(e.fadeInOut.factor),void this._fadeWeather(e.fadeInOut.factor)):e.crossFade.enabled?(t.fadeLighting(e.crossFade.factor),void this._fadeWeather(e.crossFade.factor)):(t.fadeLighting(0),void this._fadeWeather(0))}_fadeWeather(t){const{_newWeatherParameters:e,_oldWeatherParameters:r}=this;t>=1?this._weatherParameters=e:(this._fadedWeatherParameters.lerp(r,e,t),this._weatherParameters=this._fadedWeatherParameters)}_updateWeather(){const t=this._weatherUpdateParameters;t!=null&&this._clouds!=null&&(this._clouds.applyPreset(ea[t.type],t.weatherAdjustment),this._setNeedsRender())}_setNeedsRender(){this._context!=null&&this._context.requestRender()}_updateFogHaze(){const t=this._weatherUpdateParameters;if(this._fog==null||t==null||this._context==null)return;const e=this._context.renderContext.bindParameters;switch(this._oldWeatherParameters.copyFrom(this._weatherParameters),t.type){case"foggy":this._newWeatherParameters.fog.strength=wt(3e-5,.005,t.weatherAdjustment**3),re(this._newWeatherParameters.fog.color,ise),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender();break;case"rainy":this._newWeatherParameters.fog.strength=wt(4e-6,2e-4,(t.effect??0)**3),re(this._newWeatherParameters.fog.color,kYe),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=0,this._setNeedsRender();break;case"snowy":this._newWeatherParameters.fog.strength=wt(4e-6,2e-4,(t.effect??0)**3),re(this._newWeatherParameters.fog.color,ise),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender();break;default:this._newWeatherParameters.fog.strength=0,this._newWeatherParameters.fog.amount=0,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender()}e.weatherFading?this._fadeWeather(0):this._fadeWeather(1)}_updateAtmosphere(t){const e=this._selectAtmosphereType(t);if(e!==ra.None&&this._context){if(!this._atmosphere||this._atmosphere.type!==e){this._atmosphere=Me(this._atmosphere);const r=this._getAtmosphereClass(e);r&&(this._atmosphere=new r(this.view,this._context))}}else this._atmosphere=Me(this._atmosphere);this._setNeedsRender()}_getAtmosphereClass(t){switch(t){case ra.Realistic:return xne;case ra.Local:return MXe;case ra.Mars:return NXe;default:case ra.None:return null}}_selectAtmosphereType(t){const{enabled:e,viewingMode:r}=t;return!e||sm(this.view.spatialReference)?ra.None:r===$e.Local?ra.Local:this._context!=null&&xne.isSupported(this._context)&&eR(this.view.spatialReference)?ra.Realistic:nm(this.view.spatialReference)?ra.Mars:ra.None}get test(){return{atmosphere:this._atmosphere,clouds:this._clouds,selectAtmosphereType:()=>this._selectAtmosphereType({viewingMode:this.view.state.viewingMode,enabled:this.view.environment.atmosphereEnabled}),stubGetAtmosphereClass:t=>{nse=J3.prototype._getAtmosphereClass,J3.prototype._getAtmosphereClass=t},restoreGetAtmosphereClass:()=>{J3.prototype._getAtmosphereClass=nse}}}};h([f({constructOnly:!0})],Oo.prototype,"view",void 0),h([f({readOnly:!0})],Oo.prototype,"atmosphere",null),h([f({readOnly:!0})],Oo.prototype,"_atmosphereType",null),h([f({type:Boolean,readOnly:!0})],Oo.prototype,"updating",null),h([f({readOnly:!0})],Oo.prototype,"weatherVisible",null),h([f()],Oo.prototype,"_context",void 0),h([f()],Oo.prototype,"_atmosphere",void 0),h([f({readOnly:!0})],Oo.prototype,"_stars",null),h([f({readOnly:!0})],Oo.prototype,"_precipitation",null),h([f({readOnly:!0})],Oo.prototype,"_clouds",null),h([f({readOnly:!0})],Oo.prototype,"_cloudsComposition",null),h([f({readOnly:!0})],Oo.prototype,"_fog",null),h([f({readOnly:!0})],Oo.prototype,"weatherEnabled",null),h([f({readOnly:!0})],Oo.prototype,"_precipitationEnabled",null),h([f({readOnly:!0})],Oo.prototype,"_weatherUpdateParameters",null),Oo=J3=h([N("esri.views.3d.environment.EnvironmentRenderer")],Oo);let Qk=class{constructor(){this.fog=new qqe,this.hazeAmount=1}copyFrom(e){this.fog.amount=e.fog.amount,this.hazeAmount=e.hazeAmount,this.fog.strength=e.fog.strength,re(this.fog.color,e.fog.color)}lerp(e,r,i){this.fog.amount=wt(e.fog.amount,r.fog.amount,i),this.hazeAmount=wt(e.hazeAmount,r.hazeAmount,i),this.fog.strength=wt(e.fog.strength,r.fog.strength,i),Lr(this.fog.color,e.fog.color,r.fog.color,i)}};const kYe=Se(.5,.5,.5),ise=Se(1.5,1.5,1.5);let nse;function sse(t,e,r){if(e.longitude==null||e.latitude==null||r.longitude==null||r.latitude==null)throw new Error("Invalid points: no lon/lat");return zYe(t,e.longitude,e.latitude,r.longitude,r.latitude)}function zYe(t,e,r,i,n){const s=It(r),o=It(n),a=s-o,l=It(e)-It(i),c=Math.sin(a/2),u=Math.sin(l/2),d=2*$h(Math.sqrt(c*c+Math.cos(s)*Math.cos(o)*u*u))*t;return Math.round(1e4*d)/1e4}function BYe(t,e,r){const i=e.spatialReference,n=Mr(i),s=new ze(e.x,t.y,i),o=new ze(r.x,t.y,i),a=new ze(t.x,e.y,i),l=new ze(t.x,r.y,i);return{lon:sse(n.radius,s,o),lat:sse(n.radius,a,l)}}function VYe(t,e,r){const i=e/r,n=It(t),s=Math.sin(i/2),o=Math.cos(n),a=2*$h(Math.sqrt(s*s/(o*o)));return Ka(a)}function GYe(t,e){let r=t/15;return e||(r=Math.round(r)),r}function ose(t,e){const r=t==null?void 0:t[0];if(r==null)return null;e||(e={hours:0,minutes:0,seconds:0}),e.hours=GYe(r,!0);const i=e.hours%1;e.hours-=i,e.minutes=60*i;const n=e.minutes%1;return e.minutes-=n,e.seconds=Math.round(60*n),e}var SMt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function UP(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ase,lse,cse,dH={exports:{}};dH.exports,ase=dH,lse=function(){var t=Math.PI,e=Math.sin,r=Math.cos,i=Math.tan,n=Math.asin,s=Math.atan2,o=Math.acos,a=t/180,l=864e5,c=2440588,u=2451545,d={dec:0,ra:0};function p(M){return M.valueOf()/l-.5+c}function m(M){return new Date((M+.5-c)*l)}function y(M){return p(M)-u}var _=23.4397*a;function v(M,I){return s(e(M)*r(_)-i(I)*e(_),r(M))}function b(M,I){return n(e(I)*r(_)+r(I)*e(_)*e(M))}function x(M,I,L){return s(e(M),r(M)*e(I)-i(L)*r(I))}function T(M,I,L){return n(e(I)*e(L)+r(I)*r(L)*r(M))}function S(M,I){return a*(280.16+360.9856235*M)-I}function A(M){return a*(357.5291+.98560028*M)}function C(M){return a*(1.9148*e(M)+.02*e(2*M)+3e-4*e(3*M))}function R(M,I){return M+I+102.9372*a+t}function P(M,I){var L=A(M),B=R(L,C(L));return I||(I={dec:0,ra:0}),I.dec=b(B,0),I.ra=v(B,0),I}var F={PolarException:{NORMAL:0,MIDNIGHT_SUN:1,POLAR_NIGHT:2},getPosition:function(M,I,L,B){var H=a*-L,Z=a*I,K=y(M),de=P(K,d),Re=S(K,H)-de.ra;return B||(B={azimuth:0,altitude:0}),B.azimuth=x(Re,Z,de.dec),B.altitude=T(Re,Z,de.dec),B}},k=[[-.83,"sunrise","sunset"]];F.addTime=function(M,I,L){k.push([M,I,L])};var V=9e-4;function z(M,I){return Math.round(M-V-I/(2*t))}function X(M,I,L){return V+(M+I)/(2*t)+L}function q(M,I,L){return u+M+.0053*e(I)-.0069*e(2*L)}function G(M,I,L){return o((e(M)-e(I)*e(L))/(r(I)*r(L)))}function Q(M){var I=a*(134.963+13.064993*M),L=a*(93.272+13.22935*M),B=a*(218.316+13.176396*M)+6.289*a*e(I),H=5.128*a*e(L),Z=385001-20905*r(I);return{ra:v(B,H),dec:b(B,H),dist:Z}}return F.getTimes=function(M,I,L){var B=a*-L,H=a*I,Z=z(y(M),B),K=X(0,B,Z),de=A(K),Re=C(de),Ke=R(de,Re),_t=b(Ke,0),at=q(K,de,Ke);function yt(pt){return q(X(G(pt,H,_t),B,Z),de,Ke)}function Fe(pt){var ut=(e(pt)-e(H)*e(_t))/(r(H)*r(_t));return ut<-1?F.PolarException.MIDNIGHT_SUN:ut>1?F.PolarException.POLAR_NIGHT:F.PolarException.NORMAL}var pe,xt,vt,Ee,Be,Ve={solarNoon:m(at),nadir:m(at-.5),polarException:F.PolarException.NORMAL};for(pe=0,xt=k.length;pe_)fs(v,e9),re(b,Jk),re(x,Kk),T="night";else if(i0&&(use(b,S),use(x,S));const A=F2e(r);return{direct:{intensity:v[0]*A.direct,color:b},ambient:{intensity:v[1]*A.ambient,color:x},timeOfDay:T}}const bse=_e(),t9=O(),r9=O(),JYe=O(),i9=.25,KYe=.2;let yd=class extends Bn.EventedAccessor{constructor(){super(),this._referencePointUpdateDelay=200,this._referencePointUpdateInterval=3e3,this._referencePointUpdateDistThreshold=1e6,this._referencePosUpdateQuery=null,this._referencePosMapCoordsRequested=null,this._viewHandles=new Vi,this._preserveAbsoluteDateTime=!1,this._trackingEnabled=!1,this._referencePosResetPreserveAbsoluteTime=!1,this._referencePosUpdateTimer=null,this._referencePosMapCoords=null,this._mainLight=new o5,this._ambientLight=new sQ,this._moonLight=new jxe,this.disableQueries=!1,this._disableWeather=!1,this._renderer=null,this._referencePosWGS84Comparable=null,this._resetReferencePosition()}destroy(){this.disconnectView(),this._viewHandles.destroy()}get _view(){var e;return(e=this._renderer)==null?void 0:e.view}get updating(){var e;return!((this.disableQueries||!this._referencePosUpdateQuery&&!this._referencePosMapCoordsRequested)&&!((e=this._renderer)!=null&&e.updating))}get weatherEnabled(){var e,r,i;return((e=this._view)==null?void 0:e.environment.atmosphereEnabled)&&!this._disableWeather&&((i=(r=this._view)==null?void 0:r.state)==null?void 0:i.viewingMode)===$e.Global&&eR(this._view.spatialReference)}get weatherVisible(){var e;return this.weatherEnabled&&((e=this._renderer)==null?void 0:e.weatherVisible)}get referencePositionWGS84Comparable(){return this._referencePosWGS84Comparable}connectView(e){if(this._renderer)return;this._renderer=new Oo({view:e});const r=()=>this._updateRenderParameters(),i=()=>this._cameraHandler();this._viewHandles.add([ue(()=>e.environment.lighting,n=>this._updateLightingHandler(n),Br),ue(()=>e.environment.lighting.type!=="virtual"?e.environment.lighting.date:null,n=>this._lightingDateHandler(n),Br),ue(()=>e.stationary,()=>this._interactingStationaryHandler()),ue(()=>e.environment.lighting.directShadowsEnabled,r,Br),ue(()=>e.qualitySettings.ambientOcclusion,r,Br),ue(()=>e.qualitySettings.reflections,r,Br),ue(()=>{var n;return(n=e.environment.background)==null?void 0:n.color},r,Br),ue(()=>e.spatialReference,()=>this._resetReferencePosition(!0),Br),ue(()=>e.environment.weather.type,()=>this._updateLighting(null,GT.Faded),Br),ue(()=>this.weatherEnabled,()=>this._updateLighting(null,GT.Faded),Br),ue(()=>e.viewingMode,()=>this._resetReferencePosition(!0),An),ue(()=>e.environment.lighting.type!=="virtual"&&e.environment.lighting.cameraTrackingEnabled,n=>this._updateCameraTracking(n),An),ue(()=>e.state.camera,i,An),ue(()=>this.disableQueries,i)]),this._updateRenderParameters(),this._updateLighting(),this._cameraHandler(),this.notifyChange("updating")}disconnectView(){this._viewHandles.removeAll(),this._resetReferencePosition(),this._renderer=Me(this._renderer)}_updateLightingHandler(e){this._updateCameraTracking(e.type!=="virtual"&&e.cameraTrackingEnabled),this._lightingDateHandler(e.type!=="virtual"?e.date:null),this._updateRenderParameters()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{const r=this._view.environment.lighting;(r==null?void 0:r.type)!=="virtual"&&(r.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){const r=this._view.environment.lighting;if((r==null?void 0:r.type)!=="virtual"){if(e){if(!r.positionTimezoneInfo.autoUpdated){this._preserveAbsoluteDateTime=!0;const i=this._view.spatialReference;if(!G_(i)){const n=this._view.camera.position;if(!this._referencePosMapCoords||!this._referencePosMapCoords.equals(n))return void this._requestReferencePositionUpdate(n)}if(this._preupdateTracking(e),this._referencePosWGS84Comparable!=null){const n=ose(this._referencePosWGS84Comparable,wse);n!=null&&(r.autoUpdate(null,n),this._trackingEnabled&&(r.positionTimezoneInfo.autoUpdated=!0))}}this._updateLighting(e)}}else this._updateLighting()}_preupdateTracking(e){!this._trackingEnabled&&this._view.environment.lighting.type!=="virtual"&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){const r=this._view;if(!r.ready)return;const i=r.stateManager.camera;i&&(this._cameraHandlerClientSide(i,e)||this._cameraHandlerServerSide(i))}_cameraHandlerClientSide(e,r){const i=eR(this._view.spatialReference);if(i&&!G_(this._view.spatialReference))return this._view.environment.lighting.type==="virtual"&&this._updateLighting(),!1;const n=e.position;return this._referencePosWGS84Comparable==null&&(this._referencePosWGS84Comparable=O()),i?$ve(n,this._referencePosWGS84Comparable):ne(this._referencePosWGS84Comparable,n.longitude??0,n.latitude??0,n.z??0),this.notifyChange("referencePositionWGS84Comparable"),this._autoUpdateTimezone(this._referencePosWGS84Comparable,r)||this._updateLighting(r),!0}_cameraHandlerServerSide(e){const r=e.position;(!this._referencePosMapCoords||this._referencePosMapCoordsRequested||this._exceedsReferencePosDistThreshold(r))&&this._requestReferencePositionUpdate(r,!0),this._view.mapCoordsHelper&&this._referencePosWGS84Comparable&&(this._referencePosWGS84Comparable[2]=(r.z??0)*this._view.mapCoordsHelper.unitInMeters,this._referencePosChanged())}_interactingStationaryHandler(){this._view.stationary&&this._executePendingReferencePositionUpdate()}_updateLighting(e,r=GT.Immediate){const i=this._view;e=e||(i.environment.lighting.type==="virtual"?null:i.environment.lighting.date);const n=this._referencePosWGS84Comparable,s=n!=null?eZe:tZe,o=this.weatherVisible?i.environment.weather.type:"disabled";n!=null?jYe(e,n,i.state.viewingMode,o,i.state.camera,s):i.environment.lighting.type==="virtual"&&D2e(i.state.camera,i.state.viewingMode,s.direct.directionToLightSource);const a=this._mainLight,l=s.direct;te(a.intensity,l.color,l.intensity*Math.PI),re(a.direction,l.directionToLightSource),a.specularStrength=s.specularStrength,a.environmentStrength=s.environmentStrength;const c=this._ambientLight;te(c.intensity,s.ambient.color,s.ambient.intensity);const u=this._moonLight;Lr(u.intensity,iZe,nZe,s.globalFactor);const d=(1-.5*s.globalFactor)*(1-.4*s.noonFactor*(1-s.globalFactor));te(u.intensity,u.intensity,d),re(u.direction,l.directionToLightSource),this._renderer.updateLightSources([a,c,u],s.noonFactor,s.globalFactor,r),this._updateRenderParameters()}_autoUpdateTimezone(e,r=null){if(this._view.environment.lighting.type==="virtual"||!this._view.environment.lighting.cameraTrackingEnabled||e==null)return!1;const i=rZe;i.setTime((r||this._view.environment.lighting.date).getTime());const n=ose(e,wse);if(n==null)return!1;let s=this._view.environment.lighting.positionTimezoneInfo;if(s.autoUpdated){if(s.hours===n.hours&&s.minutes===n.minutes&&s.seconds===n.seconds)return!1}else s=n;const o=i.getUTCHours()-(n.hours-s.hours),a=i.getUTCMinutes()-(n.minutes-s.minutes),l=i.getUTCSeconds()-(n.seconds-s.seconds);return i.setUTCHours(o),i.setUTCMinutes(a),i.setUTCSeconds(l),!r&&this._view.environment.lighting.autoUpdate(i,n)}_updateRenderParameters(){const e=this._view._stage;if(!e)return;const r=this._referencePosWGS84Comparable==null||WYe(this._referencePosWGS84Comparable[2],this._view.state.viewingMode),i=this._view.environment.background,n=i instanceof Bwe?{type:"color",color:_Z(it.toUnitRGBA(i.color))}:{type:"color",color:$t(0,0,0,1)};e.renderer.setParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&r,background:n,environment:this._view.environment,weatherVisible:this._view.environmentManager.weatherVisible,qualitySettings:this._view.qualitySettings})}_resetReferencePosition(e=!1){this._cancelReferencePosUpdates(),this._referencePosMapCoords=null,this._referencePosMapCoordsRequested=null,this._referencePosResetPreserveAbsoluteTime=null,this._referencePosWGS84Comparable=null,this.notifyChange("updating"),e&&this._cameraHandler()}_requestReferencePositionUpdate(e,r=!1){if(!this.disableQueries&&(this._referencePosMapCoordsRequested?this._referencePosMapCoordsRequested.copy(e):this._referencePosMapCoordsRequested=e.clone(),this._referencePosResetPreserveAbsoluteTime=!!r,!this._referencePosUpdateQuery&&!this._referencePosUpdateTimer&&this._view.stationary)){const i=this._referencePosUpdateQuery=XO(this._referencePointUpdateDelay).then(()=>{if(this._referencePosUpdateQuery===i){const s=()=>this._referencePosUpdateQuery!==i;return this._doReferencePositionUpdateQuery(s)}}).catch(s=>{s.name==="mapcoordshelper:missing-geometry-service"&&(this.disableQueries=!0)}).then(()=>{this._referencePosUpdateQuery===i&&(this._referencePosUpdateQuery=null,this._referencePosUpdateTimer||this._executePendingReferencePositionUpdate(),this.notifyChange("updating"))}),n=this._referencePosUpdateTimer=XO(this._referencePointUpdateInterval).then(()=>{this._referencePosUpdateTimer===n&&(this._referencePosUpdateTimer=null,this._referencePosUpdateQuery||this._executePendingReferencePositionUpdate())});this.notifyChange("updating")}}async _doReferencePositionUpdateQuery(e){this._referencePosResetPreserveAbsoluteTime&&(this._preserveAbsoluteDateTime=!1),this._referencePosMapCoords?this._referencePosMapCoords.copy(this._referencePosMapCoordsRequested):this._referencePosMapCoords=this._referencePosMapCoordsRequested.clone(),this._referencePosResetPreserveAbsoluteTime=null,this._referencePosMapCoordsRequested=null;const r=await this._view.mapCoordsHelper.toGeographic(this._referencePosMapCoords);if(!e()&&!isNaN(r[0])&&!isNaN(r[1])){const i=(this._referencePosMapCoords.z??0)*this._view.mapCoordsHelper.unitInMeters;this._referencePosWGS84Comparable?(this._referencePosWGS84Comparable[0]=r[0],this._referencePosWGS84Comparable[1]=r[1],this._referencePosWGS84Comparable[2]=i):this._referencePosWGS84Comparable=[r[0],r[1],i],this._referencePosChanged()}}_executePendingReferencePositionUpdate(){const e=this._referencePosMapCoordsRequested;e&&this._requestReferencePositionUpdate(e,this._referencePosResetPreserveAbsoluteTime)}_referencePosChanged(){this._preserveAbsoluteDateTime?this._updateLighting():this._autoUpdateTimezone(this._referencePosWGS84Comparable)||this._updateLighting(),this.notifyChange("referencePositionWGS84Comparable")}_exceedsReferencePosDistThreshold(e){if(this._referencePosMapCoords){let r=this._referencePosMapCoords.distance(e);return this._view.mapCoordsHelper&&(r*=this._view.mapCoordsHelper.unitInMeters),r>this._referencePointUpdateDistThreshold}return!0}_cancelReferencePosUpdates(){const e=!!this._referencePosUpdateQuery;return this._referencePosUpdateQuery=null,this._referencePosUpdateTimer=null,e}get test(){const e=this;return{get renderer(){return e._renderer},set referencePointUpdateInterval(r){e._referencePointUpdateInterval=r},set referencePointUpdateDistThreshold(r){e._referencePointUpdateDistThreshold=r},set referencePosUpdateTimer(r){e._referencePosUpdateTimer=r},set referencePointUpdateDelay(r){e._referencePointUpdateDelay=r},set disableWeather(r){e._disableWeather=r}}}};h([f({type:Boolean,readOnly:!0})],yd.prototype,"updating",null),h([f()],yd.prototype,"disableQueries",void 0),h([f()],yd.prototype,"_disableWeather",void 0),h([f()],yd.prototype,"weatherEnabled",null),h([f()],yd.prototype,"weatherVisible",null),h([f()],yd.prototype,"referencePositionWGS84Comparable",null),h([f()],yd.prototype,"_renderer",void 0),h([f()],yd.prototype,"_referencePosWGS84Comparable",void 0),yd=h([N("esri.views.3d.environment.SceneViewEnvironmentManager")],yd);const eZe=new N2e,tZe=new N2e,rZe=new Date,wse={hours:0,minutes:0,seconds:0},iZe=Se(.22,.22,.33),nZe=Se(.22,.22,.22);var Ci;(function(t){t[t.NONE=0]="NONE",t[t.TILT=1]="TILT",t[t.ALTITUDE=2]="ALTITUDE",t[t.DISTANCE=4]="DISTANCE",t[t.COLLISION=8]="COLLISION",t[t.ALL=15]="ALL",t[t.ALL_EXCEPT_COLLISION=7]="ALL_EXCEPT_COLLISION"})(Ci||(Ci={}));var Wt;(function(t){t[t.NONE=0]="NONE",t[t.ZOOM=1]="ZOOM",t[t.TUMBLE=2]="TUMBLE",t[t.LOOK_AROUND=3]="LOOK_AROUND",t[t.PAN=4]="PAN",t[t.ASCEND=5]="ASCEND"})(Wt||(Wt={}));var Qs;(function(t){t[t.TUMBLE=0]="TUMBLE",t[t.LOOK_AROUND=1]="LOOK_AROUND"})(Qs||(Qs={}));function CR(t,e){return(t&e)!=0}function f5(t,e,r,i,n,s){t!==0&&(r?(s.min=Math.min(s.min,e),s.max=Math.max(s.max,e)):i!=null?(s.min-=Math.max(0,(e-s.min)*(1-i)),s.max+=Math.max(0,(e-s.max)*(1-i))):n&&(s.min-=Math.max(0,e-s.min-n),s.max+=Math.max(0,e-s.max-n)))}const Y_={selection:Ci.NONE,interactionType:Wt.NONE,interactionFactor:0,interactionStartCamera:null,interactionDirection:null,tiltMode:Qs.TUMBLE};function U2e(t,e,r,i){return e=e||t.viewForward,re(i,e),te(i,i,Math.sign(fe(e,r))),i}function sZe(t,e,r,i){return uZe(t,e,r,lZe(i,e,r,!0))}function oZe(t,e,r,i){const n=fe(r,ae(t,i,e));return oe(t,e,te(t,r,n))}const aZe={dir:O(),len:0,clip:Ne()};function lZe(t,e,r,i){const n=aZe;return t?(r&&i&&(n.len=ci(e,r)),re(n.dir,t)):i?(n.len=ci(e,r),ae(n.dir,r,e),te(n.dir,n.dir,1/n.len)):(ae(n.dir,r,e),me(n.dir,n.dir)),n}function cZe(t,e,r){const i=fe(t,r.dir),n=-oi(t,e);if(n<0&&i>=0)return!1;if(i>-1e-6&&i<1e-6)return n>0;if((n<0||i<0)&&!(n<0&&i<0))return!0;const s=n/i;return i>0?sr.clip[0]&&(r.clip[0]=s),r.clip[0]<=r.clip[1]}function uZe(t,e,r,i){i.clip[0]=0,i.clip[1]=r?i.len:Number.MAX_VALUE;for(let n=0;n=-1e-6?0:s}function bZe(t,e,r=Y_){const i=xQ(t,e,r);if(i===0)return!1;const n=t.pointsOfInterest.surfaceOrigin;if(!n.renderLocation)return!1;const s=TQ(t,e)+i,o=re(TZe,e.eye),a=U2e(e,r.interactionDirection,xZe(e,n.renderLocation,CZe),EZe);if(!u1(mbe(n.renderLocation,s),bu(e.eye,a),O$))return!1;e.eye=O$;const l=ae(SZe,e.eye,o);e.center=oe(O$,e.center,l);const c=t.renderCoordsHelper.getAltitude(e.center),u=t.renderCoordsHelper.intersectInfiniteManifold(e.ray,c,O$);return u!=null&&(e.center=u),!0}function wZe(t,e,r){const i=e.interactionType;if(i===Wt.NONE)return;const{min:n,max:s}=r,{interactionStartCamera:o,interactionFactor:a}=e;if(!o)return;const l=i===Wt.ZOOM||i===Wt.PAN,c=xQ(t,o),u=c===0?0:TQ(t,o);r.min=n,r.max=s,f5(c,u,l,a,.05*u,r)}function TQ(t,e){const r=t.pointsOfInterest.surfaceOrigin;return r.renderLocation?ci(e.eye,r.renderLocation):0}function xZe(t,e,r){return Qg(r,t.eye,e)}const A$={min:0,max:0},TZe=O(),SZe=O(),EZe=O(),CZe=O(),O$=O();var Ui,To;(function(t){t[t.OBJECT=0]="OBJECT",t[t.HUD=1]="HUD",t[t.TERRAIN=2]="TERRAIN",t[t.OVERLAY=3]="OVERLAY",t[t.I3S=4]="I3S",t[t.PCL=5]="PCL",t[t.LOD=6]="LOD",t[t.VOXEL=7]="VOXEL"})(Ui||(Ui={}));let AZe=class{constructor(){this.verticalOffset=0,this.selectionMode=!1,this.hud=!0,this.selectOpaqueTerrainOnly=!0,this.invisibleTerrain=!1,this.backfacesTerrain=!0,this.isFiltered=!1,this.filteredLayerUids=[],this.store=To.ALL}};(function(t){t[t.MIN=0]="MIN",t[t.MINMAX=1]="MINMAX",t[t.ALL=2]="ALL"})(To||(To={}));let OZe=class{constructor(e,r,i){this.object=e,this.geometryId=r,this.triangleNr=i}},RZe=class extends OZe{constructor(e,r,i,n){super(e,r,i),this.center=n!=null?ki(n):null}},k2e=class{constructor(e){this.layerUid=e}},u8=class extends k2e{constructor(e,r){super(e),this.graphicUid=r}};function bp(t){return t!=null&&t.dist!=null}function xse(t){return(e,r,i)=>(Lr(Tse,e,r,i),!CZ(t,Tse))}function h8(t){return bp(t)&&t.intersector===Ui.OBJECT&&!!t.target}function d8(t){return bp(t)&&t.intersector===Ui.HUD&&!!t.target&&"center"in t.target&&t.target.center!=null}const Tse=O();let PZe=class{constructor(){this._transform=_e(),this._transformInverse=new R$({value:this._transform},us,_e),this._transformInverseTranspose=new R$(this._transformInverse,Sc,_e),this._transformTranspose=new R$({value:this._transform},Sc,_e),this._transformInverseRotation=new R$({value:this._transform},Txe,hi)}_invalidateLazyTransforms(){this._transformInverse.invalidate(),this._transformInverseTranspose.invalidate(),this._transformTranspose.invalidate(),this._transformInverseRotation.invalidate()}get transform(){return this._transform}get inverse(){return this._transformInverse.value}get inverseTranspose(){return this._transformInverseTranspose.value}get inverseRotation(){return this._transformInverseRotation.value}get transpose(){return this._transformTranspose.value}setTransformMatrix(e){In(this._transform,e)}multiplyTransform(e){Vr(this._transform,this._transform,e)}set(e){In(this._transform,e),this._invalidateLazyTransforms()}setAndInvalidateLazyTransforms(e,r){this.setTransformMatrix(e),this.multiplyTransform(r),this._invalidateLazyTransforms()}},R$=class{constructor(e,r,i){this._original=e,this._update=r,this._dirty=!0,this._transform=i()}invalidate(){this._dirty=!0}get value(){return this._dirty&&(this._update(this._transform,this._original.value),this._dirty=!1),this._transform}},MZe=class{constructor(e=0){this.offset=e,this.tmpVertex=O()}applyToVertex(e,r,i){const n=e+this.localOrigin[0],s=r+this.localOrigin[1],o=i+this.localOrigin[2],a=this.offset/Math.sqrt(n*n+s*s+o*o);return this.tmpVertex[0]=e+n*a,this.tmpVertex[1]=r+s*a,this.tmpVertex[2]=i+o*a,this.tmpVertex}applyToAabb(e){for(let s=0;s<3;++s)A0[s]=e[0+s]+this.localOrigin[s],P$[s]=e[3+s]+this.localOrigin[s],dC[s]=A0[s];const r=this.applyToVertex(A0[0],A0[1],A0[2]);for(let s=0;s<3;++s)e[s]=r[s],e[s+3]=r[s];const i=s=>{const o=this.applyToVertex(s[0],s[1],s[2]);for(let a=0;a<3;++a)e[a]=Math.min(e[a],o[a]),e[a+3]=Math.max(e[a+3],o[a])};for(let s=1;s<8;++s){for(let o=0;o<3;++o)dC[o]=s&1<0?this._totalOffset:0,e[4]+=o>0?this._totalOffset:0,e[5]+=a>0?this._totalOffset:0,e;const p=Math.max(Math.abs(r),Math.abs(s)),m=Math.max(Math.abs(i),Math.abs(o)),y=Math.max(Math.abs(n),Math.abs(a)),_=Math.sqrt(p*p+m*m+y*y),v=this._totalOffset/_,b=this._totalOffset/d;return e[0]+=r*(r>0?v:b),e[1]+=i*(i>0?v:b),e[2]+=n*(n>0?v:b),e[3]+=s*(s<0?v:b),e[4]+=o*(o<0?v:b),e[5]+=a*(a<0?v:b),e}applyToMbs(e){const r=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),i=this._totalOffset/r;return this._mbs[0]=e[0]+e[0]*i,this._mbs[1]=e[1]+e[1]*i,this._mbs[2]=e[2]+e[2]*i,this._mbs[3]=e[3]+e[3]*this._totalOffset/r,this._mbs}applyToObb(e){const r=e.center,i=this._totalOffset/Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);this._obb.center[0]=r[0]+r[0]*i,this._obb.center[1]=r[1]+r[1]*i,this._obb.center[2]=r[2]+r[2]*i,Sh(this._obb.halfSize,e.halfSize,e.quaternion),oe(this._obb.halfSize,this._obb.halfSize,e.center);const n=this._totalOffset/Math.sqrt(this._obb.halfSize[0]*this._obb.halfSize[0]+this._obb.halfSize[1]*this._obb.halfSize[1]+this._obb.halfSize[2]*this._obb.halfSize[2]);return this._obb.halfSize[0]+=this._obb.halfSize[0]*n,this._obb.halfSize[1]+=this._obb.halfSize[1]*n,this._obb.halfSize[2]+=this._obb.halfSize[2]*n,ae(this._obb.halfSize,this._obb.halfSize,e.center),X_(Ase,e.quaternion),Sh(this._obb.halfSize,this._obb.halfSize,Ase),this._obb.halfSize[0]*=this._obb.halfSize[0]<0?-1:1,this._obb.halfSize[1]*=this._obb.halfSize[1]<0?-1:1,this._obb.halfSize[2]*=this._obb.halfSize[2]<0?-1:1,this._obb.quaternion=e.quaternion,this._obb}},IZe=class{constructor(e=0){this.offset=e,this.sphere=vn(),this.tmpVertex=O()}applyToVertex(e,r,i){const n=this.objectTransform.transform;let s=n[0]*e+n[4]*r+n[8]*i+n[12],o=n[1]*e+n[5]*r+n[9]*i+n[13],a=n[2]*e+n[6]*r+n[10]*i+n[14];const l=this.offset/Math.sqrt(s*s+o*o+a*a);s+=s*l,o+=o*l,a+=a*l;const c=this.objectTransform.inverse;return this.tmpVertex[0]=c[0]*s+c[4]*o+c[8]*a+c[12],this.tmpVertex[1]=c[1]*s+c[5]*o+c[9]*a+c[13],this.tmpVertex[2]=c[2]*s+c[6]*o+c[10]*a+c[14],this.tmpVertex}applyToMinMax(e,r){const i=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*i,e[1]+=e[1]*i,e[2]+=e[2]*i;const n=this.offset/Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);r[0]+=r[0]*n,r[1]+=r[1]*n,r[2]+=r[2]*n}applyToAabb(e){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*i,e[4]+=e[4]*i,e[5]+=e[5]*i,e}applyToBoundingSphere(e){const r=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),i=this.offset/r;return this.sphere[0]=e[0]+e[0]*i,this.sphere[1]=e[1]+e[1]*i,this.sphere[2]=e[2]+e[2]*i,this.sphere[3]=e[3]+e[3]*this.offset/r,this.sphere}};const Sse=new IZe;function vH(t){return t!=null?(Sse.offset=t,Sse):null}const Ese=new $Ze;function LZe(t){return t!=null?(Ese.offset=t,Ese):null}const Cse=new MZe;function DZe(t){return t!=null?(Cse.offset=t,Cse):null}const jy="terrain",Ase=Au(),BS=1e-5;let NZe=class{constructor(e){this.options=new AZe,this._results=new FZe,this.transform=new PZe,this.tolerance=BS,this.verticalOffset=null,this._ray=qs(),this._rayEnd=O(),this._rayBeginTransformed=O(),this._rayEndTransformed=O(),this.viewingMode=e??$e.Global}get results(){return this._results}get ray(){return this._ray}get rayBegin(){return this._ray.origin}get rayEnd(){return this._rayEnd}reset(e,r,i){this.resetWithRay(fVe(e,r,this._ray),i)}resetWithRay(e,r){this.camera=r,e!==this._ray&&W4(e,this._ray),this.options.verticalOffset!==0?this.viewingMode===$e.Local?this._ray.origin[2]-=this.options.verticalOffset:this.verticalOffset=this.options.verticalOffset:this.verticalOffset=null,oe(this._rayEnd,this._ray.origin,this._ray.direction),this._results.init(this._ray)}intersect(e=null,r,i,n,s){this.point=r,this.filterPredicate=n,this.tolerance=i??BS;const o=vH(this.verticalOffset);if(e&&e.length>0){const a=s?l=>{s(l)&&this.intersectObject(l)}:l=>{this.intersectObject(l)};for(const l of e){const c=l.getSpatialQueryAccelerator&&l.getSpatialQueryAccelerator();c!=null?(o!=null?c.forEachAlongRayWithVerticalOffset(this._ray.origin,this._ray.direction,a,o):c.forEachAlongRay(this._ray.origin,this._ray.direction,a),this.options.selectionMode&&this.options.hud&&c.forEachDegenerateObject(a)):l.objects.forAll(u=>a(u))}}this.sortResults()}intersectObject(e){const r=e.geometries;if(!r)return;const i=e.shaderTransformation,n=vH(this.verticalOffset);for(const s of r){if(!s.visible)continue;const{material:o,id:a}=s;this.transform.setAndInvalidateLazyTransforms(i,s.shaderTransformation),De(this._rayBeginTransformed,this.rayBegin,this.transform.inverse),De(this._rayEndTransformed,this.rayEnd,this.transform.inverse);const l=this.transform.transform;n!=null&&(n.objectTransform=this.transform),o.intersect(s,this.transform.transform,this,this._rayBeginTransformed,this._rayEndTransformed,(c,u,d,p,m,y)=>{if(c>=0){if(this.filterPredicate!=null&&!this.filterPredicate(this._ray.origin,this._rayEnd,c))return;const _=p?this._results.hud:this._results,v=p?b=>{const x=new RZe(e,a,d,y);b.set(Ui.HUD,x,c,u,yn,m)}:b=>b.set(Ui.OBJECT,{object:e,geometryId:a,triangleNr:d},c,u,l,m);if((_.min.drapedLayerOrder==null||m>=_.min.drapedLayerOrder)&&(_.min.dist==null||c<_.min.dist)&&v(_.min),this.options.store!==To.MIN&&(_.max.drapedLayerOrder==null||m<_.max.drapedLayerOrder)&&(_.max.dist==null||c>_.max.dist)&&v(_.max),this.options.store===To.ALL)if(p){const b=new bH(this._ray);v(b),this._results.hud.all.push(b)}else{const b=new jT(this._ray);v(b),this._results.all.push(b)}}})}}sortResults(e=this._results.all){e.sort((r,i)=>r.dist!==i.dist?(r.dist??0)-(i.dist??0):r.drapedLayerOrder!==i.drapedLayerOrder?(r.drapedLayerOrder??Number.MAX_VALUE)-(i.drapedLayerOrder??Number.MAX_VALUE):(i.drapedLayerGraphicOrder??Number.MIN_VALUE)-(r.drapedLayerGraphicOrder??Number.MIN_VALUE))}};function zh(t){return new NZe(t)}let FZe=class{constructor(){this.min=new jT(qs()),this.max=new jT(qs()),this.hud={min:new bH(qs()),max:new bH(qs()),all:new Array},this.ground=new jT(qs()),this.all=[]}init(e){this.min.init(e),this.max.init(e),this.ground.init(e),this.all.length=0,this.hud.min.init(e),this.hud.max.init(e),this.hud.all.length=0}},jT=class{get ray(){return this._ray}get distanceInRenderSpace(){return this.dist!=null?(te(M$,this.ray.direction,this.dist),Te(M$)):null}getIntersectionPoint(e){return!!bp(this)&&(te(M$,this.ray.direction,this.dist),oe(e,this.ray.origin,M$),!0)}getTransformedNormal(e){return re(pC,this.normal),pC[3]=0,au(pC,pC,this.transformation),re(e,pC),me(e,e)}constructor(e){this.intersector=Ui.OBJECT,this.normal=O(),this.transformation=_e(),this._ray=qs(),this.init(e)}init(e){this.dist=null,this.target=null,this.drapedLayerOrder=null,this.drapedLayerGraphicOrder=null,this.intersector=Ui.OBJECT,W4(e,this._ray)}set(e,r,i,n,s,o,a){this.intersector=e,this.dist=i,re(this.normal,n??oY),In(this.transformation,s??yn),this.target=r,this.drapedLayerOrder=o,this.drapedLayerGraphicOrder=a}copy(e){W4(e.ray,this._ray),this.intersector=e.intersector,this.dist=e.dist,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.drapedLayerGraphicOrder=e.drapedLayerGraphicOrder,re(this.normal,e.normal),In(this.transformation,e.transformation)}},bH=class extends jT{constructor(){super(...arguments),this.intersector=Ui.HUD}};function SQ(t){return new jT(t)}const M$=O(),pC=Qt();function z2e(t,e,r,i){return t.renderCoordsHelper.fromRenderCoords(e.eye,m5,i)!=null&&Rye(r,m5)}function p8(t,e){return t.elevationProvider?t.elevationProvider.getElevation(e[0],e[1],e[2],t.renderCoordsHelper.spatialReference,"ground")??0:0}function Gw(t,e,r,i){const n=t.state.camera.clone();e&&r&&i&&(n.eye=e,n.center=r,n.up=i),UZe(t,n.ray,O0)||re(O0,n.center);const s=t.state.constraints,o=s.minimumPoiDistance;if(wo(n.eye,O0)o}function UZe(t,e,r){let i=Rse[t.viewingMode];i||(i=zh(t.state.viewingMode),i.options.backfacesTerrain=!t.state.isGlobal,i.options.invisibleTerrain=!0,Rse[t.viewingMode]=i);const{isGlobal:n}=t.state;return!(!t.sceneIntersectionHelper.intersectRay(e,i,r)||Ose(t,e.origin,r))||!(!t.renderCoordsHelper.intersectManifold(e,0,r)||Ose(t,e.origin,r))||!!n&&kZe(e,r,Mr(t.spatialReference).radius)}function kZe(t,e,r){const i=fe(t.origin,t.origin)-r*r,n=i>0?Math.sqrt(i)/3:1;return te(e,t.direction,n/Te(t.direction)),oe(e,e,t.origin),!0}const Rse={},m5=O(),O0=O(),O1=O(),zZe={near:0,far:0};function PE(t,e,r=xh.EYE){const i=t.state.constraints;if(!i.collision.enabled)return!1;const n=p8(t,e.eye),s=t.renderCoordsHelper.getAltitude(e.eye),o=n+i.collision.elevationMargin;if(s>=o)return!1;const a=Te(e.eye);if(ae($$,e.center,e.eye),e.eye=t.renderCoordsHelper.setAltitude(BZe,o,e.eye),r===xh.EYE_AND_CENTER)e.center=oe($$,e.eye,$$);else if(r===xh.EYE_AND_CENTER_SCALE){const l=(a-s+o)/a;e.center=te($$,e.center,l)}return!0}var xh;(function(t){t[t.EYE=0]="EYE",t[t.EYE_AND_CENTER=1]="EYE_AND_CENTER",t[t.EYE_AND_CENTER_SCALE=2]="EYE_AND_CENTER_SCALE"})(xh||(xh={}));const $$=O(),BZe=O();function Z_(t,e,r){t.worldUpAtPosition(e,Pse),ae(s9,r,e);const i=Te(s9);return i===0?0:As(fe(s9,Pse)/i)}const Pse=O(),s9=O();function B2e(t,e,r=Y_,i=!0){fC.eyeCenterDistance=0,fC.requiresTwoSteps=!1;const n=EQ(t,e,r,void 0,fC);if(n===0)return!1;switch(Ec(I$,-n,e.viewRight),r.tiltMode){case Qs.LOOK_AROUND:De(R0,e.viewForward,I$),te(R0,R0,fC.eyeCenterDistance),e.center=oe(Hy,e.eye,R0);break;case Qs.TUMBLE:ae(R0,e.center,e.eye),De(R0,R0,I$),e.eye=ae(Hy,e.center,R0);break;default:r.tiltMode}return e.up=De(Hy,e.up,I$),!fC.requiresTwoSteps||!i||B2e(t,e,r,!1)}function EQ(t,e,r=Y_,i=Y_,n){if(!t.state.constraints.tilt)return 0;const s=e.distance,o=t.state.constraints.tilt(s,QZe);return ZZe(t,r,o),i.interactionType===Wt.TUMBLE&&CR(i.selection,Ci.ALTITUDE)&&V2e(t,i.interactionStartCamera,o),r.tiltMode===Qs.LOOK_AROUND||i.tiltMode===Qs.LOOK_AROUND?GZe(t,e,o,n):VZe(t,e,o)}function VZe(t,e,r){const i=Z_(t.renderCoordsHelper,e.center,e.eye),n=i-ge(i,r.min,r.max);return AR(n)?n:0}function GZe(t,e,r,i){switch(i&&(i.requiresTwoSteps=!1),t.viewingMode){case"global":return HZe(t,e,r,i);case"local":return jZe(t,e,r,i)}}function jZe(t,e,r,i){const n=Z_(t.renderCoordsHelper,e.center,e.eye),s=ge(n,r.min,r.max),o=n-s;if(!AR(o))return 0;if(i){const a=t.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,l=t.renderCoordsHelper.getAltitude(e.eye)-a,c=Math.cos(s);Math.abs(c)>1e-4?i.eyeCenterDistance=l/c:i.eyeCenterDistance=e.distance}return o}function HZe(t,e,r,i){const n=WZe(t,e,JZe),s=ge(n.tiltAtCenter,r.min,r.max);if(!AR(n.tiltAtCenter-s))return 0;let o,a;return n.centerIsOnSurface?(o=qZe(n),a=XZe(n,o)):(o=n.constraints.clampTilt(n.eyeCenterDistance,n.tiltAtCenter),i&&o1e-9}function qZe(t){const{constraints:e,eyeCenterDistance:r,tiltAtCenter:i}=t;let n=i,s=e.clampTilt(r,i);const o=wH(t,s);if(e.clampTilt(o,i)===s)return s;let a=0;for(;a<10&&AR(s-n);){const l=(n+s)/2,c=wH(t,l);AR(e.clampTilt(c,l)-l)?n=l:s=l,a++}return s}function wH(t,e){if(!t.centerIsOnSurface)return t.eyeCenterDistance;const r=Math.PI-ge(e,0,Math.PI),i=$h(t.radius/t.eyeRadius*Math.sin(r)),n=Math.PI-r-i,s=Math.sin(n)/Math.sin(r);if(t.eyeRadius1){const o=Math.PI-i,a=Math.PI-r-o;return Math.sin(a)/Math.sin(r)*t.eyeRadius}return s*t.eyeRadius}function XZe(t,e){const r=$h(t.radius/t.eyeRadius*Math.sin(t.tiltAtCenter)),i=$h(t.radius/t.eyeRadius*Math.sin(e));return t.eyeRadius>t.radius?r-i:i-r}function YZe(t,e){return t.tiltAtCenter-Math.PI/2-(e-Math.PI/2)}function ZZe(t,e,r){if(e.interactionType===Wt.NONE)return;const{interactionStartCamera:i,interactionFactor:n}=e;if(!i)return;const{min:s,max:o}=r,a=EQ(t,i,Y_,e),l=a===0?0:Z_(t.renderCoordsHelper,i.center,i.eye);r.min=s,r.max=o,e.interactionType===Wt.TUMBLE?(CR(e.selection,Ci.ALTITUDE)&&V2e(t,i,r),f5(a,l,!0,n,Mse,r)):f5(a,l,!1,n,Mse,r)}function V2e(t,e,r){const i=t.state.constraints;if(t.state.isLocal||!i.altitude||!e)return;const n=la(e.center),s=Math.sqrt(n),o=e.distance,a=Mr(t.spatialReference).radius,l=i.altitude.min+a,c=i.altitude.max+a,u=(l*l-o*o-n)/(-2*s*o),d=(c*c-o*o-n)/(-2*s*o);r.min=Math.max(r.min,Math.min(Math.PI-As(d),r.max)),r.max=Math.min(r.max,Math.PI-As(u))}const R0=O(),I$=_e(),Hy=O(),Mse=It(5),QZe={min:0,max:0},JZe={constraints:null,radius:0,eyeRadius:0,centerIsOnSurface:!0,eyeCenterDistance:0,tiltAtCenter:0},fC={eyeCenterDistance:0,requiresTwoSteps:!1};function KZe(t){return t}const f8=t=>t*t,CQ=t=>1-f8(1-t),eQe=t=>t<.5?f8(2*t)/2:(CQ(2*(t-.5))+1)/2,AQ=t=>t*t*t,G2e=t=>1-AQ(1-t),j2e=t=>t<.5?AQ(2*t)/2:(G2e(2*(t-.5))+1)/2,OQ=t=>t*t*t*t,H2e=t=>1-OQ(1-t),tQe=t=>t<.5?OQ(2*t)/2:(H2e(2*(t-.5))+1)/2,RQ=t=>t*t*t*t*t,W2e=t=>1-RQ(1-t),rQe=t=>t<.5?RQ(2*t)/2:(W2e(2*(t-.5))+1)/2,PQ=t=>1-Math.cos(t*Math.PI/2),q2e=t=>1-PQ(1-t),iQe=t=>t<.5?PQ(2*t)/2:(q2e(2*(t-.5))+1)/2,MQ=t=>2**(10*(t-1)),kP=t=>1-MQ(1-t),nQe=t=>t<.5?MQ(2*t)/2:(kP(2*(t-.5))+1)/2,$Q=t=>-(Math.sqrt(1-t*t)-1),X2e=t=>1-$Q(1-t),sQe=t=>t<.5?$Q(2*t)/2:(X2e(2*(t-.5))+1)/2;function Hh(t){const e=2*(t-Math.sqrt((t-1)*t)),r=e/2/t;return i=>ir=Math.PI&&(i=2*Math.PI-i);const n=Math.abs(e.pitch-this.pitch);return r.rotate=Math.max(i,n),r.sourceZoom=this.distance,r.targetZoom=e.distance,r}interpolate(e,r,i){this.viewingMode===$e.Global?MVe(e.center,r.center,i.pan,this.center):Lr(this.center,e.center,r.center,i.pan),this.distance=isFinite(r.distance)?wt(e.distance,r.distance,i.zoom):e.distance,this.pitch=wt(e.pitch,r.pitch,i.rotate);let n=e.yaw;const s=r.yaw;Math.abs(s-n)>=Math.PI&&(n+=2*(n0&&te(i,i,-1)):re(i,e),ot(Ul,i,Ic.upward),me(Ul,Ul),bD(Ic.sideway,Ul,Ic.upward)}};const g5={desiredScreenFlow:2,minDuration:500,maxDuration:8e3};let SQe=class Z2e{constructor(e){this._createCamera=e,this.compared={sourceZoom:0,targetZoom:0,pan:0,rotate:0},this.settings={desiredScreenFlow:g5.desiredScreenFlow},this.source=e(),this.target=e()}clone(){const e=new Z2e(this._createCamera);return e.copyFrom(this),e}copyFrom(e){this.update(e.source,e.target,e.settings)}update(e,r,i){this.source!==e&&this.source.copyFrom(e),this.target!==r&&this.target.copyFrom(r),this.compared=this.source.compareTo(this.target,this.compared),this.settings.desiredScreenFlow=i.desiredScreenFlow!=null?i.desiredScreenFlow:g5.desiredScreenFlow,this.desiredPixelFlow=this.settings.desiredScreenFlow*this.target.size,this.halfWindowSize=this.target.size/2}halfWindowPanAtZoom(e){const r=this.target.pixelsPerPanAtZoom(e);return this.halfWindowSize/r}get hasZoom(){return Math.abs(this.compared.sourceZoom-this.compared.targetZoom)>1e-5}get hasPan(){return this.compared.pan>1e-9}get hasRotate(){return this.compared.rotate>1e-9}},EQe=class{constructor(){this.segments=[]}get time(){return this.segments.reduce((e,r)=>e+r.time,0)}interpolateComponentsAt(e,r){e=Math.min(Math.max(e,0),1),e*=this.time;let i=0,n=0;const s=this.definition;for(let o=0;on?1:-1,this._panPixelsAtSource=r.pan*e.source.pixelsPerPanAtZoom(i);const s=(e.source.pixelsPerRotateAtZoom(i)+e.target.pixelsPerRotateAtZoom(n))/2;this._rotatePixels=r.rotate*s}_updatePixelFlow(){const e=this.definition.compared.sourceZoom,r=this.definition.compared.targetZoom,{hasZoom:i,hasPan:n,hasRotate:s}=this.definition;let o=0,a=0;i&&(n&&(o=(r/e-1)/(-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2*this._panPixelsAtSource)),s&&(a=this._zoomSign*(Math.log(e/r)/Math.LN2)*this.definition.halfWindowSize/this._rotatePixels)),this._zoomPixelFlow=0,this._panPixelFlow=0,this._rotatePixelFlow=0;const l=this.definition.desiredPixelFlow;if(i&&n&&s){const c=o+a+o*a;this._zoomPixelFlow=o*a/c*l,this._panPixelFlow=a/c*l,this._rotatePixelFlow=o/c*l}else if(i&&n){const c=1+o;this._zoomPixelFlow=o/c*l,this._panPixelFlow=1/c*l}else if(i&&s){const c=1+a;this._zoomPixelFlow=a/c*l,this._rotatePixelFlow=1/c*l}else if(n&&s){const c=this._panPixelsAtSource/this._rotatePixels,u=1+c;this._panPixelFlow=c/u*l,this._rotatePixelFlow=1/u*l}else n?this._panPixelFlow=l:i?this._zoomPixelFlow=l:s&&(this._rotatePixelFlow=l);this._time=s?this.rotateTime:i?this.zoomTime:n?this.panTime:0}get rotateTime(){return this.definition.hasRotate?this._rotatePixels/this._rotatePixelFlow:0}get zoomTime(){return this.definition.hasZoom?this._zoomSign*(Math.log(this.definition.compared.sourceZoom/this.definition.compared.targetZoom)/Math.LN2)*this.definition.halfWindowSize/this._zoomPixelFlow:0}get panTime(){if(this.definition.hasPan){if(this.definition.hasZoom){const e=-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2,r=e*this._panPixelsAtSource;return Math.log(r*(this._zoomPixelFlow/this._panPixelFlow)+1)/(e*this._zoomPixelFlow)}return this._panPixelsAtSource/this._panPixelFlow}return 0}_interpolateComponentsZoom(e){if(e===0||e===1)return e;if(this.definition.hasZoom){const r=this.definition.compared.sourceZoom,i=this.definition.compared.targetZoom;return(r*(r/i)**-e-r)/(i-r)}return e}_interpolateComponentsPan(e){if(e===0||e===1)return e;if(this.definition.hasPan&&this.definition.hasZoom){const r=-1/(this._zoomSign*this.definition.halfWindowSize)*this._zoomPixelFlow;return 1/this._panPixelsAtSource*(this._panPixelFlow*(2**(r*e*this._time)-1))/(r*Math.LN2)}return e}_interpolateComponentsRotate(e){return e}interpolateComponentsAt(e,r){e=Math.min(Math.max(e,0),1);const i=this._interpolateComponentsZoom(e),n=this._interpolateComponentsPan(e),s=this._interpolateComponentsRotate(e);return r?(r.zoom=i,r.pan=n,r.rotate=s):r={zoom:i,pan:n,rotate:s},r}};function CQe(t,e,r){const i=e-t.compared.sourceZoom,n=t.halfWindowPanAtZoom(i);return-t.halfWindowSize*(r.ascensionFactor*Math.LN2*t.compared.pan+n)*Math.log(t.compared.sourceZoom/e)/(t.desiredPixelFlow*Math.LN2*n)}function AQe(t,e,r){const i=1/e,n=Math.log(t.compared.sourceZoom*i),s=1/t.desiredPixelFlow,o=1/Math.LN2,a=e-t.compared.sourceZoom,l=1/a,c=(r.ascensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(a))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*i*s*o*l*c-t.halfWindowSize*n*s*o*l+t.halfWindowSize*n*s*o*c/(a*a)}function OQe(t,e,r){const i=e-t.compared.sourceZoom,n=1/i,s=1/e,o=Math.log(t.compared.sourceZoom*s),a=(r.ascensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(i))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*n*(-2*n*s*a+2*n*o+2*s-2*o*a/(i*i)-a/(e*e))/(t.desiredPixelFlow*Math.LN2)}function RQe(t,e){return-t.halfWindowSize*Math.log(t.compared.sourceZoom/e)/(t.desiredPixelFlow*Math.LN2)}function PQe(t,e){return t.halfWindowSize/(e*t.desiredPixelFlow*Math.LN2)}function MQe(t,e){return-t.halfWindowSize/(e*e*t.desiredPixelFlow*Math.LN2)}function $Qe(t,e,r){return-t.compared.pan*t.halfWindowSize*(r.ascensionFactor+r.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e))}function IQe(t,e,r){return t.compared.pan*t.halfWindowSize*(r.ascensionFactor+r.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e*e))}function LQe(t,e,r){return-2*t.compared.pan*t.halfWindowSize*(r.ascensionFactor+r.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e*e*e))}function DQe(t,e,r){return t.halfWindowSize*(-t.halfWindowPanAtZoom(e)-r.descensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(t.compared.targetZoom))*Math.log(e/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2*t.halfWindowPanAtZoom(-e+t.compared.targetZoom))}function NQe(t,e,r){const i=Math.log(e/t.compared.targetZoom),n=1/t.desiredPixelFlow,s=1/Math.LN2,o=-e+t.compared.targetZoom,a=1/o,l=(-t.halfWindowPanAtZoom(e)-r.descensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(t.compared.targetZoom))/t.halfWindowPanAtZoom(1);return-t.halfWindowSize*i*n*s*a+t.halfWindowSize*i*n*s*l/(o*o)+t.halfWindowSize*n*s*a*l/e}function FQe(t,e,r){const i=e-t.compared.targetZoom,n=1/i,s=1/e,o=Math.log(e/t.compared.targetZoom),a=(t.halfWindowPanAtZoom(e)+r.descensionFactor*Math.LN2*t.compared.pan-t.halfWindowPanAtZoom(t.compared.targetZoom))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*n*(-2*n*s*a-2*n*o+2*s+2*o*a/(i*i)-a/(e*e))/(t.desiredPixelFlow*Math.LN2)}function UQe(t,e){return t.halfWindowSize*Math.log(e/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2)}function kQe(t,e){return t.halfWindowSize/(e*t.desiredPixelFlow*Math.LN2)}function zQe(t,e){return-t.halfWindowSize/(e*e*t.desiredPixelFlow*Math.LN2)}function BQe(t){const e=Math.LN2*t.compared.pan,r=t.compared.sourceZoom-t.compared.targetZoom,i=t.halfWindowPanAtZoom(r),n=t.halfWindowSize*Math.log(t.compared.sourceZoom/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2*i);return t.compared.sourceZoom<=t.compared.targetZoom?n*(e-i):n*(e+i)}function VQe(t,e){let r=GQe(t,e);const i={ascensionFactor:e.ascensionFactor!=null?e.ascensionFactor:.5,descensionFactor:e.descensionFactor!=null?e.descensionFactor:.5},n=i.ascensionFactor===0,s=i.descensionFactor===0,o=n?RQe:CQe,a=n?PQe:AQe,l=n?MQe:OQe,c=s?UQe:DQe,u=s?kQe:NQe,d=s?zQe:FQe,p=S=>o(t,S,i)+$Qe(t,S,i)+c(t,S,i),m=S=>a(t,S,i)+IQe(t,S,i)+u(t,S,i),y=S=>l(t,S,i)+LQe(t,S,i)+d(t,S,i);let _=p(r);const v=BQe(t);let b;const x=e.maximumIterations||20,T=e.maximumDistance!=null?e.maximumDistance:1/0;for(b=0;b=T&&A<0){if(!isFinite(T))return null;r=T,_=p(r);break}if(r-=A,rv*(1-.3)||r0&&(n.definition?n.definition.copyFrom(this.definition):n.definition=this.definition.clone(),n.definition.copyFrom(this.definition),n.definition.compared.sourceZoom=e,n.definition.compared.targetZoom=e,n.definition.compared.pan=this.definition.compared.pan*l,n.definition.compared.rotate=this.definition.compared.rotate*l,n.update(),this.segments.push(n)),s.definition?s.definition.copyFrom(this.definition):s.definition=this.definition.clone(),s.definition.compared.sourceZoom=e,s.definition.compared.pan=this.definition.compared.pan*a,s.definition.compared.rotate=this.definition.compared.rotate*a,s.update(),this._descensionSegment=s,this.segments.push(s)}_updateWithoutApex(){const[e]=this._preallocSegments;e.update(this.definition),this.segments.push(e)}};const HQe={zoom:0,pan:0,rotate:0};let WQe=class{get time(){return this._time}constructor(e){this._createCamera=e,this._time=0,this.definition=new SQe(e),this.path=new jQe}update(e,r,i){this.definition.update(e,r,i),this.path.update(this.definition,i),this._time=this._applyTimeSettings(Oge(isFinite(this.path.time)?this.path.time:0),i),this._easing=i.easing??(this._time>=1e3?Y2e:kP)}cameraAt(e,r){r=r||this._createCamera(),e=Math.min(Math.max(0,e),1),e=this._normalizedEasing(e);const i=this.path.interpolateComponentsAt(e,HQe);return r.interpolate(this.definition.source,this.definition.target,i),r}_normalizedEasing(e){const r=this._easing(0,this._time),i=this._easing(1,this._time);return(this._easing(e,this._time)-r)/(i-r)}_applyTimeSettings(e,r){const i=r.speedFactor!=null?r.speedFactor:1;r.duration!=null?e=r.duration:r.speedFactor!=null&&(e=e/i);const n=r.minDuration!=null?r.minDuration:g5.minDuration/i,s=r.maxDuration!=null?r.maxDuration:g5.maxDuration/i;return Math.min(Math.max(n,e),s)}};const qQe=O();let XQe=class{get finished(){return this.currentTime>=this._animation.time}get time(){return this._animation.time}constructor(e){this.currentTime=0,this._animation=new WQe(()=>new Ise(e)),this._current=new Ise(e)}update(e,r,i){const n=this._animation.definition.source,s=this._animation.definition.target,o=ae(qQe,r.center,e.center),a=Te(o);a>=1e-5?(o[0]/=a,o[1]/=a,o[2]/=a):(o[0]=0,o[1]=1,o[0]=0),re(n.lookAtDirection,o),re(s.lookAtDirection,o),n.copyFromRenderCamera(e),s.copyFromRenderCamera(r),this._current.copyFrom(n),this._animation.update(n,s,i),this.currentTime=0,e.almostEquals(r)&&(this.currentTime=this._animation.time)}cameraAt(e,r){return this._animation.cameraAt(e,this._current),r=r||new lt,this._current.copyToRenderCamera(r),r}step(e,r){return this.finished||(this.currentTime=this.currentTime+Oge(e),this.currentTime>=this.time&&(this.currentTime=this.time)),this.cameraAt(this.currentTime/this.time,r)}};var Wi;(function(t){t.Ready="ready",t.Rejected="rejected",t.Running="running",t.Stopped="stopped",t.Finished="finished"})(Wi||(Wi={}));let sg=class extends xe{constructor(e){super(e),this.state=Wi.Ready}get active(){return this.state===Wi.Running}get isInteractive(){return!1}get canStop(){return!1}stopController(){return!!this.canStop&&(this.state=Wi.Stopped,!0)}finishController(){this.state=Wi.Finished}get steppingFinished(){return!1}};h([f({constructOnly:!0})],sg.prototype,"view",void 0),h([f({readOnly:!0})],sg.prototype,"active",null),h([f()],sg.prototype,"state",void 0),h([f({readOnly:!0})],sg.prototype,"isInteractive",null),sg=h([N("esri.views.3d.state.controllers.CameraController")],sg);let OR=class extends sg{constructor(){super(...arguments),this._asyncResult=null}get canStop(){return!0}set asyncResult(e){this._asyncResult&&(this._asyncResult.reject(wr()),this._asyncResult=null),this.state===Wi.Finished||this.state===Wi.Stopped?(GF(e),this.state===Wi.Finished?e.resolve():e.reject(wr())):this._asyncResult=e}get asyncResult(){return this._asyncResult}onControllerStart(){this.state=Wi.Running,this.viewAnimation!=null&&this.viewAnimation.when(()=>this.updateStateFromViewAnimation(),()=>this.updateStateFromViewAnimation())}updateStateFromViewAnimation(){this.viewAnimation==null||this.state!==Wi.Ready&&this.state!==Wi.Running||(this.viewAnimation.state===DS.State.FINISHED?this.finish():this.viewAnimation.state===DS.State.STOPPED&&(this.state=Wi.Stopped))}onControllerEnd(){this.viewAnimation==null||this.viewAnimation.done||(this.state===Wi.Finished?this.viewAnimation.finish():this.state===Wi.Stopped&&this.viewAnimation.stop()),this._asyncResult&&(this.state===Wi.Finished?this._asyncResult.resolve():this._asyncResult.reject(wr()))}finish(){this.finishController()}};OR=h([N("esri.views.3d.state.controllers.AnimationController")],OR);let mg=class extends OR{get intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(e){super(e),this.mode="interaction",this._hasTarget=!1}initialize(){this.animation=new XQe(this.view.state.viewingMode),this.viewAnimation=this.mode==="interaction"?null:new DS}get isInteractive(){return this.mode==="interaction"}begin(e,r){this._hasTarget=!0;const i=this.animationSettings(r);L$.copyFrom(this.view.state.camera);const n=zh(this.view.state.viewingMode);this.intersectionHelper.intersectRay(L$.ray,n,Lse)&&(L$.center=Lse),this.animation.update(L$,e,i),this.animation.finished&&this.finish()}finish(){this.animation.currentTime=this.animation.time,super.finish()}get steppingFinished(){return this._hasTarget&&this.animation.finished}stepController(e,r){this._hasTarget&&this.animation.step(e,r)}onControllerEnd(e){this._hasTarget&&(this.animation.cameraAt(this.animation.currentTime/this.animation.time,e),this.animation.currentTime=this.animation.time),super.onControllerEnd(e)}animationSettings(e={}){return{apex:{maximumDistance:this.view.state.constraints.clampAltitude(1/0)/6,ascensionFactor:void 0,descensionFactor:void 0},...e,easing:typeof e.easing=="string"?yQe[e.easing]:e.easing}}};h([f({constructOnly:!0})],mg.prototype,"mode",void 0),h([f({readOnly:!0})],mg.prototype,"isInteractive",null),mg=h([N("esri.views.3d.state.controllers.PointToPointAnimationController")],mg);const L$=new lt,Lse=O();function m8(t=ZQe){return[t[0],t[1],t[2],t[3]]}function RR(t,e){return YQe(t[0],t[1],t[2],e,vZ.get())}function YQe(t,e,r,i,n=m8()){return n[0]=t,n[1]=e,n[2]=r,n[3]=i,n}function IQ(t,e,r){return ot(r,t,e),me(r,r),r[3]=k6(t,e),r}const ZQe=[0,0,1,0];function Q2e(t,e,r){return QQe(t,t.screenToRender(e,Ie.get()),r)}function QQe(t,e,r){const i=fs(Ie.get(),e);if(i[2]=0,!t.unprojectFromRenderScreen(i,r.origin))return null;const n=fs(Ie.get(),e);n[2]=1;const s=t.unprojectFromRenderScreen(n,Ie.get());return s==null?null:(ae(r.direction,s,r.origin),r)}function ME(t,e,r){return LQ(t,t.screenToRender(e,Ie.get()),r)}function LQ(t,e,r){re(r.origin,t.eye);const i=ne(Ie.get(),e[0],e[1],1),n=t.unprojectFromRenderScreen(i,Ie.get());return n==null?null:(ae(r.direction,n,r.origin),r)}function DQ(t,e,r,i){const n=ME(e,r,JQe);return u1(t,n,i)}const JQe=qs();var VS;(function(t){t[t.Ellipsoid=0]="Ellipsoid",t[t.Silhouette=1]="Silhouette"})(VS||(VS={}));const J2e=30,y5=[1,3e8],g8=80,K2e=8,eTe=200,tTe=1508e5,rTe=5,iTe=50,KQe=5,eJe=10,a9=90,jw={exclude:new Set([jy])};function $b(t,e,r){return r[0]=e[0]/(t.fullWidth/t.pixelRatio),r[1]=e[1]/(t.fullHeight/t.pixelRatio),r}function xH(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function Q_(t,e,r){const i=Ec(bZ.get(),r[3],r);i==null||lZ(i,yn)||(ae(kr,t.eye,e),De(kr,kr,i),t.eye=oe(kr,kr,e),ae(kr,t.center,e),De(kr,kr,i),t.center=oe(kr,kr,e),t.up=De(kr,t.up,i))}function tJe(t,e,r,i){return kw(t,Q2e(e,r,UQ),i)}function TH(t,e,r,i){return kw(t,ME(e,r,UQ),i)}function NQ(t,e,r,i){const n=Ie.get();let s=1-r;ae(n,e,t.eye);const o=Te(n);let a=o*(1-s);s>=0&&aFse.Elevation?Xs.Horizontal:(ME(t,e,Hse),-Math.sign(t.relativeElevation)*(.5*Math.PI+k6(t.eye,Hse.direction))r?-(e-r)/(o*r):e<-r?Math.PI-(e+r)/(o*r):As(e/r),s=t>r?-(t-r)/(o*r):t<-r?Math.PI-(t+r)/(o*r):As(t/r),(s-n)*r}function rJe(t,e,r,i,n,s,o,a,l,c){const u=zse(t[2],e[2],s[3],a),d=l?zse(t[0],e[0],s[3],180):e[0]-t[0],p=Math.sin(o)*d-Math.cos(o)*u,m=Math.cos(o)*d+Math.sin(o)*u;me(kr,n);const y=l?p/Math.sqrt(Math.abs(s[3]**2-fe(r,kr)**2)):p/s[3],_=m/Math.sqrt(Math.abs(s[3]**2-fe(r,i)**2));er(c,y,_)}function cTe(t,e,r,i,n,s,o,a,l,c){ot(b5,t,e),qG(s.up,s.eye,F$,U$,k$),qG([0,0,1],s.eye,xg,A_,pTe),re(r,A_),re(i,xg),me(r,r),te(r,r,Te(b5)),_ie(t,me(U$,U$),me(k$,k$),me(F$,F$),Bse),_ie(e,U$,k$,F$,Vse),rJe(Bse,Vse,t,xg,A_,o,a,l,c,n)}function iJe(t,e,r,i,n,s,o){Ec(_5,n,i),Ec(v5,o,s),Vr(dT,_5,v5),ae(e,t,r),De(e,e,dT),oe(e,e,r)}function uTe(t,e,r,i,n,s){Ec(_5,i,r),Ec(v5,s,n),Vr(dT,_5,v5),ae(kr,t.eye,e),De(kr,kr,dT),t.eye=oe(kr,kr,e),ae(kr,t.center,e),De(kr,kr,dT),t.center=oe(kr,kr,e),ae(kr,t.up,e),De(kr,kr,dT),t.up=oe(kr,kr,e)}function FQ(t,e,r,i,n,s){return(Math.abs(i)>Math.PI-D$.Angle||Math.abs(i)r)&&s.aboveGround&&nl&&(c=wo(r,P1),cTe(r,P1,A_,xg,mC,B$,t,n,s,o),uTe(B$,t,xg,mC[1],A_,mC[0]),iJe(P1,P1,t,xg,mC[1],A_,mC[0]),u=wo(r,P1),u0,o=!0),this._tmpCamera.copyFrom(i.camera),s?this.intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter):this.intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:re(this._zoomLocation,this._tmpCamera.center),this._updateCamera(this._tmpCamera,e,this._zoomLocation,r,o),this.begin(this._tmpCamera)}animationSettings(){return{duration:600,easing:kP}}_updateCamera(e,r,i,n,s){const o=Mr(this.view.spatialReference),a=y8(e,n,o),l=Math.abs(this.view.camera.position.z);me(G$,e.eye),te(G$,G$,-1),ME(e,n,this._tmpRayDir),me(this._tmpRayDir.direction,this._tmpRayDir.direction);const c=ge(Math.min(K2e,1/Math.abs(fe(G$,this._tmpRayDir.direction)))*l,eTe,tTe);if(a===Xs.Horizontal){let u=Wse**r;this._sphere[3]=Te(i),ae(this._tmpViewDir,e.center,e.eye);const d=Math.min(Te(this._tmpViewDir),c);let p=d*u;if(u<=1&&p1e-12&&DQ(this._sphere,e,n,this._targetOnSphere)&&nJe(this._sphere,e,i,this._targetOnSphere,this.view.camera.heading,this.view.camera.tilt,!0)}else{let u=Wse**Math.abs(r);const d=r>0?1:-1;ae(this._tmpViewDir,i,e.eye);const p=Te(this._tmpViewDir),m=this.view._stage.renderView.getMinimalDepthForArea(null,n[0],n[1],this.view.state.camera,lJe);let y=m??c;y=s&&r>0?Math.min(y,p):y,te(this._tmpRayDir.direction,this._tmpRayDir.direction,y),oe(i,this._tmpRayDir.origin,this._tmpRayDir.direction);let _=y*u;const v=Math.max(u9,1.01*e.nearFar[0]);if(r>0&&_0?(o=this.intersectionHelper.intersectScreenFreePointFallback(r,this._zoomLocation,this.view.map.ground.opacity===0?jw:{}),this.intersectionHelper.intersectRay(this._tmpCamera.ray,s,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter)):this.intersectionHelper.intersectRay(this._tmpCamera.ray,s,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:re(this._zoomLocation,this._tmpCamera.center);const a=cJe**e;let l=this.view._stage.renderView.getMinimalDepthForArea(this.view.voxelWasm,r[0],r[1],this.view.state.camera,hJe);ae(j$,this._tmpCamera.eye,this._zoomLocation),me(j$,j$);const c=ge(Math.min(K2e,1/Math.abs(fe(dJe,j$)))*Math.abs(this.view.camera.position.z),eTe,tTe);if(l=l??c,l){const u=O();ae(u,this._zoomLocation,this._tmpCamera.eye),(lthis._handleDoubleClick(i))}_handleDoubleClick(e){const r=e.data;if(pJe(r,"primary")){const i=this._view.state.isGlobal?new w5({view:this._view,mode:"animation"}):new x5({view:this._view,mode:"animation"});this._view.state.switchCameraController(i),i.zoomStep(Math.log(.5)/Math.log(.6),Xi(r.x,r.y)),e.stopPropagation()}}};function mJe(t,e,r){return t===$e.Global?new yJe(r):new gJe(e,r)}let gJe=class{constructor(e,r){this._elevationProvider=e,this._referenceEllipsoid=Mr(r),this._unitInMeters=el(r,this._referenceEllipsoid.metersPerDegree)}compute(e,r,i,n,s){var T;s||(s={near:0,far:0});let o=e[2]*this._unitInMeters;const a=o,l=o-n,c=(T=this._elevationProvider)==null?void 0:T.visibleElevationBounds;c&&(o=l>=0?a-this._unitInMeters*c.min:this._unitInMeters*c.max-a);const u={x:(i=i??new Dr({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0})).xmax-i.xmin,y:i.ymax-i.ymin,z:4*Math.max(i.xmax-i.xmin,i.ymax-i.ymin)},d=Math.max(u.x,u.y,u.z);ae(M1,r,e),dx[0]=M1[0]>0?i.xmax:i.xmin,dx[1]=M1[1]>0?i.ymax:i.ymin,dx[2]=M1[2]>0?d/2:-d/2,ae(dx,dx,e),me(M1,M1);const p=1.1*fe(dx,M1)*this._unitInMeters,m=Math.sqrt(o*(o+2*this._referenceEllipsoid.radius)),y=Math.max(i.xmax-i.xmin,i.ymax-i.ymin),_=y*bJe*this._unitInMeters,v=y*wJe*this._unitInMeters,b=ge((o-v)/(_-v),0,1)**3,x=Math.min(wt(m,p,b),m)*Math.max(Math.log(Math.abs(l)),1);return fTe(Math.min(x,Math.max(34064e4,d))/this._unitInMeters,_Je,this._unitInMeters,s)}},yJe=class{constructor(e){this._referenceEllipsoid=Mr(e)}compute(e,r,i,n,s){s||(s={near:0,far:0});const o=Te(e),a=o-this._referenceEllipsoid.radius,l=this._referenceEllipsoid.radius+Math.min(0,n),c=Math.abs(a-n),u=Math.max(c,Math.abs(a)),d=Math.sqrt(u*(u+2*l)),p=o+this._referenceEllipsoid.radius;return fTe(1.2*wt(d,p,BZ(u)),ge(2e4-(Math.log(u)-7.983)/9.011*19e3,1e3,2e4),1,s)}};function fTe(t,e,r,i){const n=vJe/r;return t/e>n?(i.far=t,i.near=i.far/e):(i.near=n,i.far=i.near*e),i}const _Je=2e4,vJe=2,bJe=.001,wJe=1e-4,dx=O(),M1=O();let zD=class extends xe{constructor(e){super(e)}initialize(){this.addHandles(this.view.basemapTerrain.on("elevation-change",e=>this._handleElevationChangeEvent(e)))}_handleElevationChangeEvent(e){if(this.view.state.cameraController)return;const r=this.view.state.camera;e.spatialReference!=null&&z2e(this.view,r,e.extent,e.spatialReference)&&this._applyToCurrentCamera()}_applyToCurrentCamera(){this.view.state.updateCamera(e=>PE(this.view,e,xh.EYE_AND_CENTER))}};h([f({constructOnly:!0})],zD.prototype,"view",void 0),zD=h([N("esri.views.3d.state.ElevationCollisionConstraint")],zD);let K3=class extends xe{constructor(e){super(e),this.nearFarHeuristic=mJe(e.view.state.viewingMode,e.view.basemapTerrain,e.view.renderCoordsHelper.spatialReference)}initialize(){this.addHandles([ue(()=>{var e,r,i,n;return[(r=(e=this.view.constraints)==null?void 0:e.clipDistance)==null?void 0:r.near,(n=(i=this.view.constraints)==null?void 0:i.clipDistance)==null?void 0:n.far]},()=>this._clipDistanceNearFarChanged()),ue(()=>{var e,r;return(r=(e=this.view.constraints)==null?void 0:e.clipDistance)==null?void 0:r.mode},()=>this._updateNearFar()),this.view.state.events.on("before-camera-change",e=>this._updateCameraNearFar(e)),ue(()=>this.view.renderDataExtent,()=>this._updateNearFar(),Br),ue(()=>{var e,r,i,n;return[(r=(e=this.view.constraints)==null?void 0:e.altitude)==null?void 0:r.min,(n=(i=this.view.constraints)==null?void 0:i.altitude)==null?void 0:n.max]},()=>this._updateAltitude(),Br),ue(()=>{var e,r;return(r=(e=this.view.constraints)==null?void 0:e.tilt)==null?void 0:r.max},()=>this._updateTiltMax(),Br),ue(()=>{var e,r;return(r=(e=this.view.constraints)==null?void 0:e.tilt)==null?void 0:r.mode},()=>this._updateTilt(),Br),ue(()=>{var e;return(e=this.view.state)==null?void 0:e.camera},()=>this._updateTiltAutoMax(),Br),ue(()=>{var e,r,i,n,s,o;return[(i=(r=(e=this.view.map)==null?void 0:e.ground)==null?void 0:r.navigationConstraint)==null?void 0:i.type,(o=(s=(n=this.view.state)==null?void 0:n.constraints)==null?void 0:s.collision)==null?void 0:o.enabled]},()=>this._updateCollision(),Br)]),this.view.state.isLocal&&this.addHandles(ue(()=>this.view.renderDataExtent,e=>this._updateLocalSurfaceDistance(e),Pr)),this._updateNearFar(),this.view.state.viewingMode!==$e.Local&&this._updateAltitude(),this._updateTilt(),this._updateCollision(),this._set("surfaceCollisionConstraint",new zD({view:this.view}))}destroy(){this.surfaceCollisionConstraint&&(this.surfaceCollisionConstraint.destroy(),this._set("surfaceCollisionConstraint",null))}_clipDistanceNearFarChanged(){var r;const e=(r=this.view.constraints)==null?void 0:r.clipDistance;e&&e.mode!=="auto"&&this.view.state.updateCamera(i=>this._updateCameraNearFarManual(i,e))}_updateNearFar(){this.view.state.updateCamera(e=>this._updateCameraNearFar(e))}_updateCameraNearFar(e){const r=this.view.constraints&&this.view.constraints.clipDistance;(r?r.mode:"auto")==="manual"?this._updateCameraNearFarManual(e,r):this._updateCameraNearFarAuto(e,r)}_updateCameraNearFarAuto(e,r){this.nearFarHeuristic.compute(e.eye,e.center,this.view.renderDataExtent,p8(this.view,e.eye),e),r&&r.autoUpdate(e.near,e.far)}_updateCameraNearFarManual(e,r){r&&(e.near=r.near,e.far=r.far)}_updateCollision(){var n,s,o;const e=(o=(s=(n=this.view.map)==null?void 0:n.ground)==null?void 0:s.navigationConstraint)==null?void 0:o.type,r=!e||e==="stay-above",i=this.view.state.constraints.collision;if(r!==i.enabled){i.enabled=r,r&&this._reapplyConstraints(Ci.COLLISION);const a=this.view.constraints&&this.view.constraints.tilt;a&&a.mode!=="auto"||this._updateTiltAuto()}}_updateAltitude(){const e=this.view.constraints&&this.view.constraints.altitude;e&&this.view.state.viewingMode!==$e.Local?this.view.state.constraints.altitude={min:e.min,max:e.max}:this.view.state.constraints.altitude=null,this._reapplyConstraints()}_updateTiltMax(){const e=this.view.constraints&&this.view.constraints.tilt;e&&e.mode!=="auto"&&(this._updateTiltManual(e),this._reapplyConstraints())}_updateTilt(){const e=this.view.constraints&&this.view.constraints.tilt;(e?e.mode:"auto")==="manual"?this._updateTiltManual(e):this._updateTiltAuto(),this._reapplyConstraints()}_updateTiltManual(e){const r=this.view.state.constraints;r.tilt=r.createConstantMaxTilt(It(e.max))}_updateTiltAuto(){const e=this.view.state.constraints;e.tilt=e.createDefaultTilt(),this._updateTiltAutoMax()}_updateTiltAutoMax(){const e=this.view.constraints&&this.view.constraints.tilt;if(!e||e.mode!=="auto")return;const r=this.view.state.constraints;if(r.tilt){const i=r.tilt(this.view.state.camera.distance).max;e.autoUpdate(Ka(i))}}_updateLocalSurfaceDistance(e){if(e==null)return;let r=Math.max(e.width,e.height);if(r<=0)return;e.zmax!=null&&e.zmin!=null&&(r=Math.max(r,e.zmax-e.zmin));const i=this.view.state,n=3*r/Math.atan(i.camera.fov/2);n!==i.constraints.distance&&(i.constraints.distance=n)}_reapplyConstraints(e=Ci.ALL){this.view.state.updateCamera(r=>Rn(this.view,r,{selection:e,interactionType:Wt.NONE,interactionFactor:null,interactionStartCamera:null,interactionDirection:null,tiltMode:Qs.TUMBLE}))}};h([f({constructOnly:!0})],K3.prototype,"view",void 0),h([f({readOnly:!0})],K3.prototype,"surfaceCollisionConstraint",void 0),K3=h([N("esri.views.3d.state.ConstraintsManager")],K3);let Wy=class{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}constructor(e){this.renderCoordsHelper=e,this.frustum=TR(),this._points=Uxe(),this.lines=new Array(12),this._origin=O(),this._direction=O(),this._altitude=null;for(let r=0;r<12;r++)this.lines[r]={origin:null,direction:O(),endpoint:null}}update(e){kxe(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),re(this._origin,e.eye),re(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines()}updatePoints(e){for(let r=0;rthis._handleElevationChangeEvent(e))),this._applyCorrection()}onControllerEnd(){this.removeAllHandles()}stepController(){}_handleElevationChangeEvent(e){(e.spatialReference==null||z2e(this.view,this.desiredCamera,e.extent,e.spatialReference))&&this._applyCorrection()}_applyCorrection(){this.view.state.updateCamera(e=>{e.copyViewFrom(this.desiredCamera),PE(this.view,e,xh.EYE_AND_CENTER)||this.constraintEnabled||(this.state=Wi.Stopped)})}};h([f({constructOnly:!0})],iO.prototype,"desiredCamera",null),iO=h([N("esri.views.3d.state.controllers.SurfaceCollisionCorrectionController")],iO);const xJe=O(),H$=O();function zQ(){return{direction:O(),up:O()}}function mTe(t,e,r,i,n){let s=me(xJe,t),o=fe(s,i);const a=o>0;o=Math.abs(o),o>.99&&(o=Math.abs(fe(e,i)),o<.99?(re(s,e),a&&te(s,s,-1)):s=null);let l=0;if(s){te(H$,i,fe(i,s)),ae(s,s,H$);const u=fe(s,n)/(Te(s)*Te(n));ot(H$,s,n),l=(fe(H$,i)>0?1:-1)*Ka(As(u))}const c=Ka(As(-fe(i,t)/Te(t)));return r?(r.heading=l,r.tilt=c,r):{heading:l,tilt:c}}const gTe=Se(0,1,0),yTe=Se(0,0,1),gC=_e(),gm=O(),ym=O();function _Te(t,e,r,i=zQ()){const{direction:n,up:s}=i;return uve(gC,-It(e)),CS(gC,gC,It(r)),De(n,yTe,gC),te(n,n,-1),De(s,gTe,gC),i}function TJe(t,e,r,i){return mTe(e,r,i,yTe,gTe)}function SJe(t,e,r,i){const n=_Te(t,r,i),s=O();return te(s,n.direction,-e),oe(s,s,t),{up:n.up,eye:s,heading:r,tilt:i}}function EJe(t){return Ka(t)}function CJe(t){return It(t)}function vTe(t,e,r,i,n){const s=t.renderSpatialReference,o=t.map&&t.spatialReference||e.spatialReference;return Bi(e,gm,s),Bi(e,ym,s),gm[0]-=r/2,ym[0]+=r/2,gm[1]-=i/2,ym[1]+=i/2,Cs(gm,s,gm,o),Cs(ym,s,ym,o),n?(n.xmin=gm[0],n.ymin=gm[1],n.xmax=ym[0],n.ymax=ym[1],n.spatialReference=o):n=new Dr(gm[0],gm[1],ym[0],ym[1],o),n}const AJe=Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:TJe,eyeForCenterWithHeadingTilt:SJe,eyeTiltToLookAtTilt:CJe,headingTiltToDirectionUp:_Te,lookAtTiltToEyeTilt:EJe,toExtent:vTe},Symbol.toStringTag,{value:"Module"})),bTe=Se(0,0,1),wTe=me(O(),Se(1,1,1)),OJe=new F_(-180,180),yC=_e(),Iy=O(),px=O();function xTe(t,e,r,i=zQ()){ot(Iy,t,bTe),fe(Iy,Iy)===0&&ot(Iy,t,wTe),Ec(yC,-It(e),t),mc(yC,yC,-It(r),Iy);const{up:n,direction:s}=i;return ot(n,Iy,t),me(n,n),De(n,n,yC),me(s,t),fa(s,s),De(s,s,yC),i}function RJe(t,e,r,i){const n=Iy,s=px;return me(n,t),ot(px,n,bTe),fe(px,px)===0&&ot(px,n,wTe),ot(s,px,n),mTe(e,r,i,n,s)}function PJe(t,e,r,i){const n={eye:O(),up:null,tilt:i,heading:r},s=Iy;s[0]=t[0],s[1]=t[2],s[2]=-t[1];const o=e,a=It(r),l=It(i),c=Math.sin(a),u=Math.cos(a),d=Math.sin(l),p=Math.cos(l),m=Te(s);let y;if(Math.abs(l)<1e-8)y=o+m;else{const Q=m/d,M=$h(o/Q),I=Math.PI-l-M;y=Q*Math.sin(I)}const _=p*o,v=o*o*(d*d),b=u*u*v,x=y-_,T=x*x,S=b*(b+T-s[1]*s[1]);if(S<0)return te(n.eye,s,y/m),n.tilt=0,W$(n,t);const A=Math.sqrt(S),C=s[1]*x,R=b+T;let P;if(P=u>0?-A+C:A+C,Math.abs(R)<1e-8)return m<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=o):te(n.eye,s,y/m),n.tilt=0,d9(n.eye),W$(n,t);n.eye[1]=P/R;const F=c*c*v,k=d*o,V=u*k*n.eye[1],z=n.eye[1]*n.eye[1],X=1-z,q=Math.sqrt(X),G=b*z+F-2*V*q*x+X*T;return Math.abs(G)<1e-8?(te(n.eye,s,y/m),n.tilt=0,d9(n.eye),W$(n,t)):(n.eye[0]=(X*(y*s[0]-_*s[0])-k*q*(s[0]*n.eye[1]*u+s[2]*c))/G,n.eye[2]=(X*(y*s[2]-_*s[2])-k*q*(s[2]*n.eye[1]*u-s[0]*c))/G,te(n.eye,n.eye,y),d9(n.eye),W$(n,t))}function d9(t){const e=t[1];t[1]=-t[2],t[2]=e}function W$(t,e){const r=xTe(e,t.heading,t.tilt);return t.up=r.up,t}function MJe(t,e,r){const i=Te(e),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-t)),s=$h(r/(n/Math.sin(t)));return Ka(t-s)}function $Je(t,e,r){const i=It(t),n=Te(e);return $h(r/(n/Math.sin(i)))+i}function TTe(t,e,r,i,n){let s,o,a,l;const c=e.latitude,u=Mr(t.spatialReference).radius,d=e.longitude,p=VYe(c,r,u)/2;s=d-p,o=d+p;const m=It(c),y=(1+Math.sin(m))/(1-Math.sin(m)),_=(y+1)*Math.tan(i/u/2),v=_*_;function b(T){const S=Math.PI/2;return(T=C8e.normalize(T,-S))>S&&(T=Math.PI-T),T}if(a=1.5*Math.PI-2*Math.atan(.5*(_+Math.sqrt(4*y+v))),l=a+i/u,a=b(a),l=b(l),l180){const T=(o-s-180)/2;s+=T,o-=T}const x=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:St.WGS84;return n?(n.xmin=s,n.ymin=a,n.xmax=o,n.ymax=l,n.spatialReference=x):n=new Dr(s,a,o,l,x),t.spatialReference&&t.spatialReference.isWebMercator&&BA(n,!1,n),n}const IJe=Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:RJe,eyeForCenterWithHeadingTilt:PJe,eyeTiltToLookAtTilt:$Je,headingTiltToDirectionUp:xTe,lookAtTiltToEyeTilt:MJe,toExtent:TTe},Symbol.toStringTag,{value:"Module"}));function T5(t){return t.type==="point"}let BQ=class{constructor(e,r=null,i=0){this.array=e,this.spatialReference=r,this.offset=i}};function STe(t){return"array"in t}function Af(t,e,r="ground"){if(T5(e))return t.getElevation(e.x,e.y,e.z||0,e.spatialReference,r);if(STe(e)){let i=e.offset;return t.getElevation(e.array[i++],e.array[i++],e.array[i]||0,e.spatialReference??t.spatialReference,r)}return t.getElevation(e[0],e[1],e[2]||0,t.spatialReference,r)}function SH(t,e){return t!=null&&(e==null||(e===$e.Local?!t.isGeographic||t.isWGS84||t.wkid===fh.CGCS2000:t.isWebMercator||t.isWGS84||t.wkid===fh.CGCS2000||t.wkid===fh.GCSMARS2000||t.wkid===fh.GCSMARS2000_SPHERE||t.wkid===fh.GCSMOON2000))}const ETe=J.getLogger("esri.views.3d.support.cameraUtils"),CTe=39.37,ATe=96,EH=1,LJe=8,DJe=5,OTe=1,Xse=O(),NJe={heading:0,tilt:0},qy=new ze,FJe=new F_(-20037508342788905e-9,20037508342788905e-9),UJe=new F_(-180,180);var Go;function zP(t){return t.spatialReference||St.WGS84}function $E(t){return t.viewingMode==="global"?IJe:AJe}function kJe(t,e,r,i,n){return $E(t).headingTiltToDirectionUp(e,r,i,n)}function tg(t,e){if(e==null)return null;const r=t.renderSpatialReference,i=$E(t).headingTiltToDirectionUp,n=O();if(!Bi(e.position,n,r))return null;const s=i(n,e.heading,e.tilt);te(s.direction,s.direction,t.state.camera.distance),oe(s.direction,s.direction,n);const o=Gw(t,n,s.direction,s.up);return o.fov=It(e.fov),o}(function(t){t[t.LOCKED=0]="LOCKED",t[t.ADJUST=1]="ADJUST"})(Go||(Go={}));const fx=O();function GS(t,e,r){const i=t.renderSpatialReference,n=_8(t,e.eye,e.viewForward,e.up,NJe);let s=zP(t);return Cs(e.eye,i,fx,s)||(s=St.WGS84,Cs(e.eye,i,fx,s)),r==null?new vu(new ze(fx,s),n.heading,n.tilt,Ka(e.fov)):(r.position.x=fx[0],r.position.y=fx[1],r.position.z=fx[2],r.position.spatialReference=s,r.heading=n.heading,r.tilt=n.tilt,r.fov=Ka(e.fov),r)}function VQ(t,e,r){const i=t.state.camera,n=i.width/2/i.pixelRatio;return t.renderCoordsHelper.viewingMode===$e.Global&&r!=null&&(e*=Math.cos(It(r))),e/=t.renderCoordsHelper.unitInMeters,n/(ATe*CTe/e)/Math.tan(i.fovX/2)}function mw(t,e,r){const i=t.state.camera,n=e*Math.tan(i.fovX/2),s=i.width/2/i.pixelRatio;let o=ATe*CTe/(s/n);return t.renderCoordsHelper.viewingMode===$e.Global&&r!=null&&(o/=Math.cos(It(r))),o*t.renderCoordsHelper.unitInMeters}function RTe(t,e,r,i,n,s){return PTe(t,e,VQ(t,r,e.latitude),i,n,s)}function PTe(t,e,r,i,n,s){if(Ib(s)){const a=new IE(s.signal);return MR(t,i.heading,i.tilt,e,r,n,a),void a.resolver.promise.then(l=>{const c=E5(t,l,i.fov);if(c!=null)return s.resolver.resolve(c);s.resolver.reject()},l=>s.resolver.reject(l))}const o=MR(t,i.heading,i.tilt,e,r,n);return E5(t,o,i.fov,s)}function _8(t,e,r,i,n){return $E(t).directionToHeadingTilt(e,r,i,n)}function zJe(t,e){return!!(t.basemapTerrain&&t.renderCoordsHelper.fromRenderCoords(e,qy,t.spatialReference)&&t.elevationProvider&&(Af(t.elevationProvider,qy)??0)>(qy.z??0)-OTe)}async function BJe(t,e,r){if(!t.renderCoordsHelper.fromRenderCoords(e,qy,t.spatialReference)||!t.elevationProvider)return!1;const i=qy.z??0;return(await t.elevationProvider.queryElevation(qy.x,qy.y,i,qy.spatialReference,"ground",r)??0)>i-OTe}async function VJe(t,e,r){const i=O();if(e)if(e instanceof ze){if(Bi(e,i,t.renderSpatialReference),e.z==null&&t.basemapTerrain!=null&&t.elevationProvider!=null){const n=await t.elevationProvider.queryElevation(e.x,e.y,e.z??0,e.spatialReference,"ground",r);return n!=null&&t.renderCoordsHelper.setAltitude(i,n),i}}else re(i,e);else re(i,t.state.camera.center);return i}function GJe(t,e){const r=O();if(e&&e instanceof ze){if(Bi(e,r,t.renderSpatialReference),e.z==null&&t.basemapTerrain!=null&&t.elevationProvider!=null){const i=Af(t.elevationProvider,e);i!=null&&t.renderCoordsHelper.setAltitude(r,i)}}else re(r,e||t.state.camera.center);return r}function MR(t,e,r,i,n,s,o){const a=i&&i instanceof ze?i:null;if(Ib(o))return VJe(t,i,o.signal).then(c=>{CH(t,e,r,a,c,n,s,o)},c=>o.resolver.reject(c)),null;const l=GJe(t,i);return CH(t,e,r,a,l,n,s,o)}function CH(t,e,r,i,n,s,o,a){if(i==null){const d=t.renderSpatialReference;if((i=Vg(n,d,zP(t)))==null)return null}s=Math.max(s,t.state.constraints.minimumPoiDistance);const l=WJe(t,e,r,n,s,o),c=(0,$E(t).eyeForCenterWithHeadingTilt)(n,s,l.heading,l.tilt);if(o===Go.ADJUST&&t.viewingMode==="global"&&r>0){const d=()=>{const m=MTe(t,n,s,XJe(t,s,r,n));return o=r-m<1?Go.LOCKED:Go.ADJUST,CH(t,e,m,i,n,s,o,a)},p=t.map.ground.navigationConstraint;if(!p||p.type==="stay-above"){if(zJe(t,c.eye))return d();if(Ib(a))return BJe(t,c.eye,a.signal).then(m=>m?d():(a.resolver.resolve({eye:c.eye,up:c.up,center:ki(n),heading:c.heading,tilt:c.tilt}),null)),null}}const u=!a||Ib(a)?{center:O(),eye:O(),up:O(),tilt:0,heading:0}:a;return u.eye=c.eye,u.up=c.up,u.center=ki(n),u.heading=c.heading,u.tilt=c.tilt,Ib(a)&&a.resolver.resolve(u),u}function nO(t,e,r,i,n,s=null){let o,a,l;if(t.state.isGlobal){if(!SH(e.spatialReference,$e.Global))return Ib(s)&&s.resolver.reject(),null;const v=new ze(e.xmin,e.ymin,e.spatialReference),b=new ze(e.xmax,e.ymax,e.spatialReference),x=e.spatialReference.isGeographic?UJe:FJe;o=new ze({x:x.center(v.x,b.x),y:(b.y+v.y)/2,z:e.zmax!=null&&e.zmin!=null?(e.zmax+e.zmin)/2:void 0,spatialReference:e.spatialReference});const T=Mr(e.spatialReference),S=BYe(o,v,b);a=S.lon,l=S.lat,x.diff(v.x,b.x)>x.range/2&&(a+=T.halfCircumference),a=Math.min(a,T.halfCircumference),l=Math.min(l,T.halfCircumference)}else{const v=t.renderSpatialReference??e.spatialReference;v.equals(e.spatialReference)||(e=xE(e,v)),a=e.xmax-e.xmin,l=e.ymax-e.ymin;const b=e.zmax!=null&&e.zmin!=null?(e.zmax+e.zmin)/2:void 0;o=new ze({x:e.xmin+.5*a,y:e.ymin+.5*l,z:b,spatialReference:v})}const c=e.zmax!=null&&e.zmin!=null?e.zmax-e.zmin:0,u=t.state.camera,d=1/Math.tan(u.fovX/2),p=1/Math.tan(u.fovY/2),m=1/Math.tan(u.fov/2),y=Math.max(.5*a*d,.5*l*p,.5*c*m)/EH;if(Ib(s)){const v=new IE(s.signal);return MR(t,r,i,o,y,n,v),void v.resolver.promise.then(b=>{const x=E5(t,b,t.camera.fov);if(x!=null)return s.resolver.resolve(x);s.resolver.reject()},b=>s.resolver.reject(b))}const _=MR(t,r,i,o,y,n);return E5(t,_,t.camera.fov,s)}function jJe(t,e,r){const i=t.renderSpatialReference,n=Vg(r,i,zP(t));if(n==null)return null;const s=Math.tan(e.fovX/2),o=Math.tan(e.fovY/2),a=gP(e.eye,r),l=2*a*s*EH,c=2*a*o*EH;return t.viewingMode==="global"?TTe(t,n,l,c):vTe(t,n,l,c)}function HJe(t,e,r){const i=t.pointsOfInterest.centerOnSurfaceFrequent.distance;if(Math.log(r/i)/Math.LN2>LJe)return!0;const n=t.renderSpatialReference,s=zP(t),o=Vg(e,n,s),a=Vg(t.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,n,s);if(o==null||a==null)return!1;const l=Math.tan(.5*t.state.camera.fov)*i;return a.distance(o)/l>DJe}function WJe(t,e,r,i,n,s){let o=0;return s===Go.ADJUST&&HJe(t,i,n)?(e=0,o=qJe(t,n,r,i)):o=GQ(t,i,n,r),o=t.state.constraints.clampTilt(n,o),{heading:e,tilt:r=MTe(t,i,n,o)}}const S5=.7;function qJe(t,e,r,i){const n=GQ(t,i,e,r);if(!t.state.constraints.tilt)return n;const s=t.state.constraints.tilt(e);s.max=Math.min(s.max,.5*Math.PI);const o=s.min*(1-S5)+s.max*S5;return Math.min(n,o)}function XJe(t,e,r,i){let n=GQ(t,i,e,r);if(!t.state.constraints.tilt)return n;const s=t.state.constraints.tilt(e);return n=Math.min(n,.5*Math.PI),s.min*(1-S5)+n*S5}function MTe(t,e,r,i){return $E(t).lookAtTiltToEyeTilt(i,e,r)}function GQ(t,e,r,i){return $E(t).eyeTiltToLookAtTilt(i,e,r)}function E5(t,e,r,i){if(e==null)return null;const n=t.renderSpatialReference,s=Vg(e.eye,n,zP(t));return s==null?null:i!=null?(i.position=s,i.heading=e.heading,i.tilt=e.tilt,i.fov=r,i):new vu(s,e.heading,e.tilt,r)}function YJe(t,e){var i;const r=(i=t.basemapTerrain)==null?void 0:i.tilingScheme;if(r)return r.levelAtScale(e);ETe.error("#scaleToZoom()","Cannot compute zoom from scale without a tiling scheme")}function $Te(t,e){var i;const r=(i=t.basemapTerrain)==null?void 0:i.tilingScheme;if(r)return r.scaleAtLevel(e);ETe.error("#zoomToScale()","Cannot compute scale from zoom without a tiling scheme")}function ITe(t,e){return Cs(e.center,t.renderSpatialReference,Xse,St.WGS84),mw(t,e.distance,Xse[1])}let IE=class{constructor(e){this.signal=e,this.resolver=Wo()}};function Ib(t){return t&&"resolver"in t}const ZJe=.66;function LTe(t){return 360-MY.normalize(t)}function v8(t){return MY.normalize(360-t)}function _C(t){return t!=null&&t.resolver&&t.resolver.reject(),null}function QJe(t,e){return t!=null&&t.resolver&&t.resolver.resolve(e),e}function DTe(t,e,r,i=null){if(!e)return _C(i);const n=t.spatialReference||St.WGS84;if(e.camera!=null){const c=$w(e.camera.position,n);if(c==null)return _C(i);const u=e.camera.clone();return u.position=c.clone(),QJe(i,u)}if(e.targetGeometry==null)return _C(i);const s=e.get("targetGeometry.spatialReference");if(s&&!T_(s,n))return _C(i);const o=GS(t,t.state.camera);let a=Go.ADJUST;if(e.rotation!=null&&(o.heading=LTe(e.rotation),a=Go.LOCKED),r!=null&&(o.tilt=r),e.targetGeometry.type==="point"){const c=e.targetGeometry;let u;const d=e.targetGeometry.clone();return u=e.scale!=null?VQ(t,e.scale,c.latitude):t.state.camera.distance,PTe(t,d,u,o,a,i)}const l=e.targetGeometry.extent;return l?nO(t,l,o.heading,o.tilt,a,i):_C(i)}function JJe(t,e,r=null){return r==null&&(r=new hp),WQ(t,null,e.clone(),r)}async function KJe(t,e,r){const i=cKe(t,e);if(!i)throw new Y("viewpointutils-create:no-target","Missing target for creating viewpoint");const n=new vu({fov:t.camera.fov}),s=new hp({camera:n});if(i.target instanceof hp)return $1(await rKe(t,i.target,i,r,s));if(i.target instanceof vu)return $1(FTe(t,i.target,s));const o=i.scale!=null||i.zoom!=null;if(i.target instanceof Dr){const c=i.target.xmin===i.target.xmax||i.target.ymin===i.target.ymax;return $1(o||c?await AH(t,i,i.target.center,n,r,s):await oKe(t,i,i.target,n,r,s))}const a={boundingBox:vi(),hasZ:!1,screenSpaceObjects:[]},l=o?eKe(t,i):void 0;if(await NTe(t,i.target,l,a),isFinite(a.boundingBox[0])){let c;if(jd(a.boundingBox,Cn),Yc.x=Cn[0],Yc.y=Cn[1],Yc.z=Cn[2],Yc.spatialReference=t.spatialReference,isFinite(Yc.z)&&a.hasZ?c=QY(a.boundingBox):(Yc.z=void 0,c=l8e(ZY(a.boundingBox,hKe))),o||c)return $1(await AH(t,i,Yc,n,r,s));const u=uKe(t,a.screenSpaceObjects);return $1(await lKe(t,i,Yc,a.boundingBox,u,n,r,s))}return i.position?$1(nKe(t,i,n,s)):$1(await sKe(t,i,n,r,s))}function jQ(t,e){return e.scale==null&&e.zoom!=null?$Te(t,e.zoom):e.scale}function eKe(t,e){const r=jQ(t,e);return r?y7e(r):void 0}function HQ(t,e){let r=!1;return e.heading!=null?(t.heading=e.heading,r=!0):e.rotation!=null&&(t.heading=LTe(e.rotation),r=!0),e.tilt!=null&&(t.tilt=e.tilt,r=!0),e.fov!=null&&(t.fov=e.fov),r}function WQ(t,e,r,i){const n=t.spatialReference||St.WGS84;return(e=e??tg(t,r))==null||(i.targetGeometry=Vg(e.center,t.renderSpatialReference,n),i.scale=ITe(t,e),i.rotation=v8(r.heading),i.camera=r),i}function C5(t,e,r){var a,l;const i=()=>new Y("viewpointutils:invalid-geometry","The target is missing a valid geometry");if(!e)throw i();if(!T_(e.spatialReference,t.spatialReference))throw new Y("viewpointutils:incompatible-spatialreference",`Spatial reference (${e.spatialReference?e.spatialReference.wkid:"unknown"}) is incompatible with the view (${(a=t.spatialReference)==null?void 0:a.wkid})`,{geometry:e});const n=[];if(!e.hasZ&&t.basemapTerrain){let c;switch(e.type){case"point":c=e;break;case"multipoint":case"polyline":c=(l=e.extent)==null?void 0:l.center;break;case"mesh":c=e.origin;break;case"extent":c=e.center;break;case"polygon":c=e.centroid}c&&t.basemapTerrain.spatialReference!=null&&T_(c,t.basemapTerrain.spatialReference)&&t.elevationProvider?Cn[2]=Af(t.elevationProvider,c)??0:Cn[2]=0}(0,dKe[e.type])(e,c=>{n.push(c[0],c[1],c[2])},Cn);const s=n.length/3;if(s===0)throw i();const o=new Array(n.length);if($i(n,e.spatialReference,0,o,t.spatialReference,0,s)){e.hasZ&&(r.hasZ=!0);for(let c=0;c{i.screenSpaceObjects.push(c)}),isFinite(l[2])&&(i.hasZ=!0)}async function NTe(t,e,r,i){var n;if(Array.isArray(e)&&e.length===2){const s=e[0],o=e[1];if(typeof s=="number"&&typeof o=="number")return Yc.x=s,Yc.y=o,Yc.z=void 0,Yc.spatialReference=(n=t.spatialReference)!=null&&n.isGeographic?t.spatialReference:St.WGS84,void C5(t,Yc,i)}e&&"map"in e&&typeof e.map=="function"?await o1(e.map(s=>NTe(t,s,r,i))):e instanceof Zg?C5(t,e,i):e instanceof z_&&await tKe(t,e,r,i)}async function rKe(t,e,r,i,n){if(e.camera!=null)return FTe(t,e.camera,n);n.scale=e.scale,n.rotation=e.rotation,n.targetGeometry=e.targetGeometry!=null?e.targetGeometry.clone():null,n.camera=null,r.heading!=null?n.rotation=v8(r.heading):r.rotation!=null&&(n.rotation=r.rotation);const s=jQ(t,r);s!=null&&(n.scale=s);const o=new IE(i);return DTe(t,n,r.tilt,o),n.camera=await o.resolver.promise,n}function FTe(t,e,r){const i=t.spatialReference,n=$w(e.position,i);return n==null?null:((e=e.clone()).fov=t.camera.fov,e.position=n,WQ(t,null,e,r))}function iKe(t,e,r,i,n,s){const o=t.renderSpatialReference;return Bi(r,X$,o),Bi(e,p9,o),s.targetGeometry=new ze(e),n.position=new ze(r),ae(A5,p9,X$),_8(t,X$,A5,i.up,n),s.scale=mw(t,ci(X$,p9),s.targetGeometry.latitude),s.rotation=v8(n.heading),s.camera=n,s}async function AH(t,e,r,i,n,s){if(r==null)throw new Y("createfromcenter","invalid point");s.targetGeometry=r.clone();const o=Gw(t);if(e.position)return iKe(t,s.targetGeometry,e.position,o,i,s);if(e.zoomFactor){const l=o.distance/e.zoomFactor,c=te(Cn,o.viewForward,-l);o.eye=oe(Cn,o.center,c),s.scale=mw(t,l,r.latitude)}GS(t,o,i);const a=HQ(i,e)?Go.LOCKED:Go.ADJUST;if(!e.zoomFactor){const l=jQ(t,e);l==null?(Bi(r,Cn,t.renderSpatialReference),Bxe(o.frustum,Cn)?s.scale=mw(t,ci(o.eye,Cn),r.latitude):s.scale=ITe(t,o)):s.scale=l;const c=new IE(n);RTe(t,s.targetGeometry,s.scale,i,a,c),s.camera=await c.resolver.promise}return s}function nKe(t,e,r,i){const n=Gw(t);return re(A5,n.viewForward),_8(t,n.eye,A5,n.up,f9),r.position=new ze(e.position),r.heading=e.heading!=null?e.heading:f9.heading,r.tilt=e.tilt!=null?e.tilt:f9.tilt,WQ(t,null,r,i)}async function sKe(t,e,r,i,n){const s=Gw(t);return AH(t,e,Vg(s.center,t.renderSpatialReference,t.spatialReference),r,i,n)}async function oKe(t,e,r,i,n,s){s.targetGeometry=r.clone();const o=Gw(t);GS(t,o,i);const a=HQ(i,e)?Go.LOCKED:Go.ADJUST,l=new IE(n);return nO(t,r,i.heading,i.tilt,a,l),s.camera=await l.resolver.promise,s}function aKe(t,e,r,i,n){let s=0;r.z!=null?s=r.z:t.basemapTerrain&&t.elevationProvider&&(s=Af(t.elevationProvider,r)),ne(Cn,r.x,r.y,s),ma(t.spatialReference,Cn,Yse,t.renderSpatialReference),Ac(q$,Yse),Uh(q$,q$),vi(vC);const o=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(let y=0;y{this._resolveCallback=n,this._rejectCallback=s;const o=new AbortController;this.options.signal!=null&&pa(this.options.signal,()=>{this.abort()}),this._abortController=o,this.waitForReady()})}then(e,r){return this._promise.then(e,r)}catch(e){return this._promise.catch(e)}resolve(e){if(this.state!=="finished")return this.state="finished",this._resolveCallback(e)}reject(e){if(this.state!=="finished")return this.state="finished",this._rejectCallback(e)}abort(e=!1){this._abortController.abort(),this.state==="wait-for-animation-finish"&&!e&&this._animationController!=null&&this.view.state.cameraController===this._animationController&&this._animationController.active&&this._animationController.stopController(),this.reject(wr())}async waitForReady(){if(this.state="wait-for-ready",!this.view.ready)try{await uR(()=>this.view.ready,this._abortController.signal)}catch(e){return this.reject(e)}this.createViewPoint()}createViewPoint(){this.state!=="finished"&&(this.state="wait-for-viewpoint",this._animationController=this.options.animate?this._getAnimationController():null,KJe(this.view,this.target,this._abortController.signal).then(e=>{if(this.state==="finished")return;const r=e?this._getCameraFromViewpoint(e):null;if(r!=null)if(this.options.animate){if(this._animationController==null)return;this.startAnimation(r,this._animationController)}else this.view.stateManager.setStateCamera(r.camera,{applyConstraints:!r.isFullySpecified,positionAndOrientationOnly:!0,doNotCancelGoToOperation:!0}),this.resolve()},e=>{this.reject(e)}))}_getCameraFromViewpoint(e){var s;const r=!!(this.target instanceof hp&&this.target.camera||this.target instanceof vu),i=e.camera;if(i==null)return null;if(!this.view.stateManager.isCompatible(i)){const o=i.position,a=o&&o.spatialReference,l=a?a.wkid:"none",c=(s=this.view.spatialReference)==null?void 0:s.wkid;return this.reject(new Y("GotoAnimation:incompatible-spatialreference",`Resulting camera has an incompatible spatial reference (camera: ${l}, view: ${c})`,{camera:i})),null}const n=tg(this.view,i);return n==null?(this.reject(new Y("GotoAnimation:invalid-camera","Resulting camera is invalid")),null):{viewpoint:e,camera:n,isFullySpecified:r}}startAnimation(e,r){this.state="wait-for-animation-finish";const i=r.viewAnimation;if(i==null)return void this.reject(new Y("GotoAnimation:missing-animation","Unreachable code in view.stateManager"));if(i.update(e.viewpoint,"running"),!r.active||r.viewAnimation==null||r.viewAnimation.target!==e.viewpoint||this.view.state.cameraController!==r)return this.abort();let n;e.isFullySpecified?(n=new iO({view:this.view,desiredCamera:e.camera}),PE(this.view,e.camera,xh.EYE_AND_CENTER)):Rn(this.view,e.camera),r.begin(e.camera,this.options);const s=()=>{const a=this.view.state.cameraController;n&&(a&&a.active?a instanceof mg&&a.viewAnimation!=null&&a.viewAnimation.target===e.viewpoint&&(this.view.state.cameraController=n):r.viewAnimation!=null&&r.viewAnimation.target===e.viewpoint&&r.state==="finished"&&(this.view.state.cameraController=n))},o=a=>{if(this.view.state!=null)switch(r.state){case Wi.Finished:switch(this.state){case"pending":case"wait-for-ready":case"wait-for-viewpoint":case"wait-for-animation-finish":this.resolve()}break;case Wi.Ready:case Wi.Rejected:case Wi.Running:case Wi.Stopped:switch(this.state){case"pending":case"wait-for-ready":case"wait-for-viewpoint":case"wait-for-animation-finish":this.reject(a)}}};i.when(s,a=>o(a)),r.asyncResult={resolve:()=>o(),reject:a=>o(a)}}_getAnimationController(){let e=null,r=null;const i=this.view.state.cameraController;return i instanceof mg&&(i.updateStateFromViewAnimation(),i.active&&(e=i,r=e.viewAnimation)),e!=null||(e=new mg({view:this.view,mode:"animation"}),r=e.viewAnimation,this.view.state.switchCameraController(e))?e:(r!=null&&r.stop(),this.reject(new Y("GotoAnimation:goto-cannot-interrupt","Cannot start an animation while interacting")),null)}},gs=class extends xe{get camera(){const e=this._get("camera");if(!this.ready)return e;const r=GS(this.view,this.view.state.camera,m9);return r&&e&&r.equals(e)?e:r.clone()}set camera(e){var r,i;this._updatePropertyBeforeReady("camera",e)||((r=this.view.elevationProvider)==null||r.enableElevationCache(!0),this.setStateCamera(tg(this.view,e),{applyConstraints:!1})||J.getLogger(this).error("#camera=","Invalid camera",e),(i=this.view.elevationProvider)==null||i.enableElevationCache(!1))}get contentCamera(){const e=this._get("contentCamera");if(!this.ready)return e;const r=GS(this.view,this.view.state.contentCamera,m9);return r&&e&&r.equals(e)?e:r.clone()}set contentCamera(e){if(this._updatePropertyBeforeReady("contentCamera",e))return;const r=tg(this.view,e);r!=null?(this._updateElevation(r),this.view.state.contentCamera=r):this.view.state.contentCamera=null}installContentCameraReset(e){if(this.removeHandles(g9),this.test.contentCameraResetState.clear(),!this.view.state.fixedContentCamera)return!1;const r=this.zoom,i=this.view.state.camera.distance**2,n=na(this.view.state.camera.center),s=e.sticky?this.contentCamera.clone():null;return this.addHandles([ue(()=>this.contentCamera,()=>{e.sticky||(this.removeHandles(g9),this.test.contentCameraResetState.clear())}),ue(()=>this.zoom,o=>{o!==void 0&&r!==void 0&&(this.test.contentCameraResetState.set("view.zoom",Math.abs(o-r)/2),Math.abs(o-r)>2?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=s))}),ue(()=>this.view.state.camera,o=>{const a=wo(n,o.center);this.test.contentCameraResetState.set("camera.center",a/i),a>i?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=s)})],g9),!0}get center(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")}set center(e){var r;this._updatePropertyBeforeReady("center",e)||(e?this.isCompatible(e)?this.setStateCamera(this._centerToCamera(e),{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.runTask():J.getLogger(this).error("#center=","Invalid center",e):J.getLogger(this).error("#center=","Center has an incompatible spatial reference (center: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+((r=this.view.spatialReference)==null?void 0:r.wkid)+")",e):J.getLogger(this).error("#center=","Center may not be null or undefined"))}get extent(){if(!this.ready)return this._get("extent");const e=this.view,r=jJe(e,e.state.camera,e.pointsOfInterest.centerOnContent.renderLocation);return r??this._get("extent")}set extent(e){var r;this._updatePropertyBeforeReady("extent",e)||(e?this.isCompatible(e)?this.setStateCamera(this._extentToCamera(e),{applyConstraints:!0})||J.getLogger(this).error("#extent=","Invalid extent",e):J.getLogger(this).error("#extent=","Extent has an incompatible spatial reference (extent: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+((r=this.view.spatialReference)==null?void 0:r.wkid)+")",e):J.getLogger(this).error("#extent=","Extent may not be null or undefined"))}get frustum(){const e=this._propertiesPool.get("frustum");return e.renderCoordsHelper=this.view.renderCoordsHelper,e.update(this.view.state.camera),e}get hasInitialView(){return!!this.view.get("map.initialViewProperties.viewpoint")}get scale(){if(this.ready){const e=this.view.pointsOfInterest.centerOnContent;return mw(this.view,e.distance,e.location.latitude)}return this._get("scale")}set scale(e){this._updatePropertyBeforeReady("scale",e)||this.setStateCamera(this._scaleToCamera(e),{applyConstraints:!0})||J.getLogger(this).error("#scale=","Invalid scale",e)}get padding(){if(!this.ready)return this._get("padding");const e=this.view.state.camera,r=e.padding,i=e.pixelRatio,n=this._get("padding"),s=Math.round(r[Yt.TOP]/i),o=Math.round(r[Yt.RIGHT]/i),a=Math.round(r[Yt.BOTTOM]/i),l=Math.round(r[Yt.LEFT]/i);return n!=null&&n.top===s&&n.right===o&&n.bottom===a&&n.left===l?n:{top:s,right:o,bottom:a,left:l}}set padding(e){this._updatePropertyBeforeReady("padding",e)||(this._paddingToArray(e,this.view.state.camera.pixelRatio,Y$),this.view.state.updateCamera(r=>r.padding=Y$))}_paddingToArray(e,r,i){e?gi(i,e.top||0,e.right||0,e.bottom||0,e.left||0):gi(i,0,0,0,0);for(let n=0;n<4;n++)i[n]=Math.round(i[n]*r)}get screenCenter(){const e=this.padding;return Lh((this.view.width-(e.left+e.right))/2+e.left,(this.view.height-(e.top+e.bottom))/2+e.top)}get viewpoint(){return this.ready?JJe(this.view,this.camera):this._get("viewpoint")}set viewpoint(e){var r;if(!this._updatePropertyBeforeReady("viewpoint",e))if(e)if(this.isCompatible(e))this.setStateCamera(this._viewpointToCamera(e),{applyConstraints:!e.camera})||J.getLogger(this).error("#viewpoint=","Invalid viewpoint",e);else{const i=e.camera!=null?e.camera.position:e.targetGeometry,n=i!=null&&i.spatialReference;J.getLogger(this).error("#viewpoint=","Viewpoint has an incompatible spatial reference (viewpoint: "+(n?n.wkid:"none")+", view: "+((r=this.view.spatialReference)==null?void 0:r.wkid)+")",e)}else J.getLogger(this).error("#viewpoint=","Viewpoint may not be null or undefined")}get zoom(){return this.ready?YJe(this.view,this.scale):this._get("zoom")}set zoom(e){this._updatePropertyBeforeReady("zoom",e)||e===void 0||this.setStateCamera(this._zoomToCamera(e),{applyConstraints:!0})||J.getLogger(this).error("#zoom=","Invalid zoom",e)}_computeCanvasSize(){if(this._devicePixelRatioOverride)return this.view.state.contentPixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*this._devicePixelRatioOverride),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*this._devicePixelRatioOverride),this._tmpCanvasSize.pixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize;const e=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio),r=this._usePhysicalPixelRendering?this._windowDevicePixelRatio:e;this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*r),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*r);const i=this.view._stage.renderView.renderingContext.parameters.maxTextureSize;return _b(this._tmpCanvasSize,i)?this._tmpCanvasSize.pixelRatio=r:this._tmpCanvasSize.pixelRatio=this._tmpCanvasSize.width>0?this._tmpCanvasSize.width/this.view.surface.clientWidth:r,this.view.state&&(this.view.state.contentPixelRatio=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)),this._tmpCanvasSize}get _rasterPixelRatio(){return this._devicePixelRatioOverride!=null?this._devicePixelRatioOverride:this._usePhysicalPixelRenderingAny?this._windowDevicePixelRatio:Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)}get _usePhysicalPixelRendering(){var e,r;return((r=(e=this.view)==null?void 0:e._stage)==null?void 0:r.renderer.isFeatureEnabled(Hn.PhysicalPixelRendering))??!1}get _usePhysicalPixelRenderingAny(){var r,i;const e=(i=(r=this.view)==null?void 0:r._stage)==null?void 0:i.renderer;return e&&(e.isFeatureEnabled(Hn.PhysicalPixelRendering,Cr.IDLE)||e.isFeatureEnabled(Hn.PhysicalPixelRendering,Cr.INTERACTING)||e.isFeatureEnabled(Hn.PhysicalPixelRendering,Cr.ANIMATING))}constructor(e){super(e),this.constraintsManager=null,this.ready=!1,this._windowDevicePixelRatio=1,this._devicePixelRatioOverride=null,this._updatingIgnoreRenderState=!1,this.test={viewStateManager:this,contentCameraResetState:new Map,setDevicePixelRatio:r=>this._devicePixelRatioOverride=r,renderState:null,get maximumPixelRatio(){return this.viewStateManager.view.qualitySettings.maximumPixelRatio},set updatingIgnoreRenderState(r){this.viewStateManager._updatingIgnoreRenderState=r},get updatingIgnoreRenderState(){return this.viewStateManager._updatingIgnoreRenderState||this.renderState!=null}},this._propertiesPool=new jg({frustum:Wy},this),this._cameraSetByUser=!1,this._gotoOperation=null,this._cameraChangeTime=0,this._tmpCanvasSize=new fKe}initialize(){this._cameraChangeTime=performance.now(),this.addHandles([Ol(()=>this.view.state.events,"before-camera-change",e=>e&&this._updateElevation(e)),ue(()=>{var e;return(e=this.view.state)==null?void 0:e.camera},(e,r)=>this._cameraChangedHandler(e,r),Br)]),Dh(()=>{var e;return(e=this.view.state)==null?void 0:e.camera},e=>this._updateElevation(e),{once:!0,sync:!0}),this.addHandles([fS({prepare:()=>this._prepareFrame()}),ue(()=>this.view.state.cameraController,()=>{this._cameraSetByUser=!0,this.removeHandles(Z$)}),Ol(()=>this.view.state.events,"camera-projection-changed",()=>this.notifyChange("scale"))])}destroy(){this.exit(),this._propertiesPool=Me(this._propertiesPool)}init(){this.constraintsManager=new K3({view:this.view}),this._prepareFrame();const e=this._getInitialProperties();this._cameraSetByUser=!1,this._set("ready",!0);for(const r of e)this.set(r.name,r.value);if(!this._cameraSetByUser){const r=this.view.get("map.initialViewProperties.viewpoint")||this.view.initialExtent;r&&this.isCompatible(r)?this._setInitialView(r):this.view.state.viewingMode===$e.Local&&this.addHandles(Dh(()=>this.view.basemapTerrain.ready,()=>{this.removeHandles(Z$),this._setInitialView(this.view.dataExtent)},{once:!0,initial:!0}),Z$)}}exit(){this._cancelGoToOperation(),this.ready&&(this._override("padding",this.padding),this._set("ready",!1),this._clearOverride("hasInitialView"),this._cameraSetByUser=!1,this.removeHandles(Z$),this.constraintsManager=Me(this.constraintsManager))}async goTo(e,r){const i={animate:!0,...r};return this._gotoOperation!=null&&this._gotoOperation.abort(i.animate),this._gotoOperation=new pKe(e,i,this.view),this.view.resourceController.scheduler.stopFrame(),this._gotoOperation}debugSetCameraOnContent(){this.setStateCamera(Gw(this.view),{applyConstraints:!1})}step(e){const r=this.view.state,i=r==null?void 0:r.cameraController;i&&(r.updateCamera(n=>i.stepController(e,n)),i.steppingFinished&&i.finishController())}_cancelGoToOperation(){this._gotoOperation!=null&&(this._gotoOperation.abort(),this._gotoOperation=null)}_getInitialProperties(){const e=new Set,r=[];for(const{propertyName:i,overrides:n}of gKe){const s=e.has(i),o=this._isOverridden(i);!s&&o&&r.push({name:i,value:this._get(i)}),this._clearOverride(i),(s||o)&&n.forEach(a=>e.add(a))}return r}_setInitialView(e){if(e==null||this._cameraSetByUser)return;if(e instanceof vu)return void this.setStateCamera(tg(this.view,e),{applyConstraints:!1});if(e instanceof hp){if(e.targetGeometry instanceof Dr){const s=nO(this.view,e.targetGeometry,0,.5,Go.LOCKED);return void(s!=null&&this.setStateCamera(tg(this.view,s),{applyConstraints:!0}))}const i={applyConstraints:!e.camera},n=this._viewpointToCamera(e);return void this.setStateCamera(n,i)}const r=nO(this.view,e,0,.5,Go.LOCKED);r!=null&&this.setStateCamera(tg(this.view,r),{applyConstraints:!0})}_updatePropertyBeforeReady(e,r){return!this.ready&&(this._override(e,r),r&&mKe.includes(e)&&this._override("hasInitialView",!0),!0)}isCompatible(e){return e!=null&&(e instanceof hp?e.camera?this.isCompatible(e.camera):this.isCompatible(e.targetGeometry):e instanceof vu?this.isCompatible(e.position):e.spatialReference&&T_(e.spatialReference,this.view.spatialReference))}_getPreservingHeadingTilt(e=yKe){return this._cameraSetByUser?(e.heading=this.camera.heading,e.tilt=this.camera.tilt):(e.heading=0,e.tilt=.5),e}_centerPointAtDistanceToCamera(e,r,i=M0){const{heading:n,tilt:s}=this._getPreservingHeadingTilt(),o=MR(this.view,n,s,e,r,Go.ADJUST);return o==null?null:(i.copyFrom(this.view.state.camera),i.eye=o.eye,i.center=o.center,i.up=o.up,i)}_centerToCamera(e){const r=this.view.pointsOfInterest.centerOnContent;r.runTask();const i=r.distance;return this._centerPointAtDistanceToCamera(e,i)}_extentToCamera(e){const{heading:r,tilt:i}=this._getPreservingHeadingTilt(),n=nO(this.view,e,r,i,Go.ADJUST,m9);return n?tg(this.view,n):null}_scaleToCamera(e){if(e==null)return null;const r=this.view.pointsOfInterest.centerOnContent;r.runTask();const i=r.renderLocation,n=r.location.latitude;if(n==null)return null;const s=VQ(this.view,e,n);return this._centerPointAtDistanceToCamera(i,s)}_zoomToCamera(e){return this._scaleToCamera($Te(this.view,e))}_viewpointToCamera(e){return tg(this.view,DTe(this.view,e))}setStateCamera(e,r){return!(e==null||!this.view.state.stopActiveCameraController())&&(this._cameraSetByUser=!0,r.doNotCancelGoToOperation||this._cancelGoToOperation(),this.view.state.updateCamera(i=>{r.positionAndOrientationOnly?(i.eye=e.eye,i.center=e.center,i.up=e.up):i.copyFrom(e),r.applyConstraints&&Rn(this.view,i)}),r.applyConstraints||(this.view.state.cameraController=new iO({view:this.view,desiredCamera:e})),!0)}_prepareFrame(){const{surface:e,canvas:r}=this.view;if(!e||!r)return;this._windowDevicePixelRatio=window.devicePixelRatio;const i=this._computeCanvasSize();if(i.width!==0&&i.height!==0&&(r.width===i.width&&r.height===i.height||(r.width=i.width,r.height=i.height),this.view.state)){const n=this.view.state.camera;n.fullWidth===i.width&&n.fullHeight===i.height&&n.pixelRatio===i.pixelRatio||(M0.copyFrom(n),M0.pixelRatio!==i.pixelRatio&&(this._paddingToArray(this.padding,i.pixelRatio,Y$),M0.padding=Y$),M0.fullWidth=i.width,M0.fullHeight=i.height,M0.pixelRatio=i.pixelRatio,this.view.state.camera=M0),this._updateViewState()}}_updateElevation(e){var s;const r=this.view.basemapTerrain&&this.view.basemapTerrain.spatialReference,i=((s=this.view.renderCoordsHelper)==null?void 0:s.getAltitude(e.eye))??0,n=r?p8(this.view,e.eye):0;e.relativeElevation=i-n}_updateViewState(){this.test.renderState!=null?this.view.state.mode=this.test.renderState:this.view.animation?this.view.state.mode=Cr.ANIMATING:this.view.interacting?this.view.state.mode=Cr.INTERACTING:(this.view.state.mode===Cr.ANIMATING&&(this._cameraChangeTime=0),performance.now()-this._cameraChangeTime<=_Ke?this.view.state.mode=Cr.INTERACTING:this.view.state.mode=Cr.IDLE),this.view.state.rasterPixelRatio=this._rasterPixelRatio}_cameraChangedHandler(e,r){e&&r&&e.almostEquals(r)||(this._cameraChangeTime=performance.now(),this._updateViewState())}};h([f({type:vu,dependsOn:["view.state.camera","ready"]})],gs.prototype,"camera",null),h([f({type:vu,dependsOn:["view.state.contentCamera","ready"]})],gs.prototype,"contentCamera",null),h([f({type:ze})],gs.prototype,"center",null),h([f({type:Dr})],gs.prototype,"extent",null),h([f({readOnly:!0})],gs.prototype,"frustum",null),h([f({readOnly:!0})],gs.prototype,"hasInitialView",null),h([f({readOnly:!0,type:Boolean})],gs.prototype,"ready",void 0),h([f({type:Number})],gs.prototype,"scale",null),h([f()],gs.prototype,"padding",null),h([f({readOnly:!0})],gs.prototype,"screenCenter",null),h([f({constructOnly:!0})],gs.prototype,"view",void 0),h([f({type:hp})],gs.prototype,"viewpoint",null),h([f({type:Number})],gs.prototype,"zoom",null),h([f({readOnly:!0})],gs.prototype,"_rasterPixelRatio",null),h([f({readOnly:!0})],gs.prototype,"_usePhysicalPixelRendering",null),h([f({readOnly:!0})],gs.prototype,"_usePhysicalPixelRenderingAny",null),h([f()],gs.prototype,"_windowDevicePixelRatio",void 0),h([f()],gs.prototype,"_devicePixelRatioOverride",void 0),gs=h([N("esri.views.3d.state.ViewStateManager")],gs);let fKe=class{constructor(){this.width=0,this.height=0,this.pixelRatio=1}};const mKe=["camera","viewpoint","extent","scale","center","zoom"],gKe=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"center",overrides:[]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],yKe={heading:0,tilt:0},m9=new vu,M0=new lt,Y$=Qt(),Z$="pending-initial-view",g9="content-camera-reset",_Ke=300,Zse=100;let Of=class extends sg{constructor(){super(...arguments),this.startCamera=new lt,this.currentCamera=new lt,this._lastInteraction=0}get isInteractive(){return performance.now()-this._lastInteractionthis.notifyChange("isInteractive"),Zse),this.view.state.updateCamera(e=>this.stepController(0,e)),this.steppingFinished&&this.finishController()}};h([f({readOnly:!0})],Of.prototype,"isInteractive",null),h([f()],Of.prototype,"_lastInteraction",void 0),Of=h([N("esri.views.3d.state.controllers.InteractiveController")],Of);var nc;(function(t){t[t.CENTER=0]="CENTER",t[t.EYE=1]="EYE"})(nc||(nc={}));let sO=class extends Of{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(e){super(e),this.pivot=nc.CENTER,this._rotScale=0,this._lastPoint=Ne(),this._tmpWorldUp=O(),this._tmpViewDir=O(),this._tmpRotCurPoint=Ne(),this._tmpTransf=_e(),this._tmpAxis=O(),this._tmpPivotPoint=O(),this._pivotPos=O(),this._constraintOptions={selection:Ci.ALL,interactionType:Wt.TUMBLE,interactionFactor:0,interactionStartCamera:null,interactionDirection:null,tiltMode:Qs.TUMBLE}}initialize(){this._rotScale=this.pivot===nc.CENTER?3:1.5}begin(e){if(this.active){switch(this.pivot){case nc.EYE:re(this._pivotPos,this.startCamera.eye),this._constraintOptions.interactionType=Wt.LOOK_AROUND,this._constraintOptions.tiltMode=Qs.LOOK_AROUND,this._constraintOptions.selection=Ci.NONE;break;case nc.CENTER:{const r=this._intersectionHelper.intersectRayFreePointFallback(this.startCamera.ray,this._pivotPos,this.view.map.ground.opacity===0?jw:{});r||re(this._pivotPos,this.startCamera.center),this._constrainPivotPoint(e,r),this.startCamera.center=this._pivotPos,this._constraintOptions.interactionType=Wt.TUMBLE,this._constraintOptions.tiltMode=Qs.TUMBLE,this._constraintOptions.selection=Ci.ALL&~Ci.DISTANCE;break}}this._constraintOptions.interactionStartCamera=this.startCamera,$b(this.startCamera,e,this._lastPoint)}}_constrainPivotPoint(e,r){const i=this.startCamera,n=O();ae(n,this._pivotPos,i.eye);const s=Te(n),o=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(i.eye,Qse);let a=Math.max(Math.min(KQe,1/Math.abs(fe(Qse,i.viewForward)))*o,eJe);r&&(a=Math.min(s,a));const l=Mr(this.view.spatialReference),c=Xi(i.width/i.pixelRatio*.5,i.height/i.pixelRatio*.5),u=y8(this.startCamera,c,l);let d=this.view._stage.renderView.getMinimalDepthForArea(this.view.voxelWasm,i.fullWidth/i.pixelRatio*.5,i.fullHeight/i.pixelRatio*.5,i,2.5*a9,a9),p=this.view._stage.renderView.getMinimalDepthForArea(this.view.voxelWasm,e[0],e[1],i,a9);d==null&&p==null||(d=d??p??0,p=p==null||u===Xs.Horizontal?d:p,a=d>p?p:d,a=r?Math.min(a,s):a),me(n,n),re(this._pivotPos,oe(this._tmpPivotPoint,i.eye,te(this._tmpPivotPoint,n,a)))}update(e){if(this.active){switch(this.pivot){case nc.EYE:this.currentCamera.center=this._applyRotation(this.currentCamera,e,this.currentCamera.center,this._pivotPos);break;case nc.CENTER:this.currentCamera.center=this._pivotPos,this.currentCamera.eye=this._applyRotation(this.currentCamera,e,this.currentCamera.eye,this._pivotPos)}Rn(this.view,this.currentCamera,this._constraintOptions),this.commitCamera()}}end(){this.active&&this.finishController()}_applyRotation(e,r,i,n){this.view.renderCoordsHelper.worldUpAtPosition(n,this._tmpWorldUp),$b(e,r,this._tmpRotCurPoint);let s=(this._lastPoint[1]-this._tmpRotCurPoint[1])*this._rotScale,o=(this._tmpRotCurPoint[0]-this._lastPoint[0])*this._rotScale;ae(this._tmpViewDir,i,n);const a=Te(this._tmpViewDir),l=As(fe(this._tmpViewDir,this._tmpWorldUp)/a);if(this.pivot===nc.EYE){s*=-.5;const c=.5*Math.PI-l,u=.5*Math.PI*.99;s=c-Math.max(-u,Math.min(u,c+s))}return s=ge(s+l,$o.min,$o.max)-l,ot(this._tmpAxis,e.up,this._tmpViewDir),this.pivot===nc.CENTER&&(o=-o),Ec(this._tmpTransf,o,this._tmpWorldUp),mc(this._tmpTransf,this._tmpTransf,s,this._tmpAxis),De(this._tmpViewDir,this._tmpViewDir,this._tmpTransf),e.up=De(y9,e.up,this._tmpTransf),oe(y9,n,this._tmpViewDir),fs(this._lastPoint,this._tmpRotCurPoint),y9}};h([f()],sO.prototype,"pivot",void 0),sO=h([N("esri.views.3d.state.controllers.RotateController")],sO);const y9=O(),Qse=O();let _9=class extends Eo{constructor(e,r,i,n){super(!0),this._view=e,this.pointerAction=r,this._pivot=i,this.registerIncoming("drag",n,s=>this._handleDrag(s))}_handleDrag(e){const r=e.data;if(r.pointers.size>1||!kQ(e.data,this.pointerAction))return;const i=Xi(r.center.x,r.center.y);switch(r.action){case"start":this._cameraController&&(this._cameraController.end(),this._cameraController=null),this._cameraController=new sO({view:this._view,pivot:this._pivot}),this._view.state.switchCameraController(this._cameraController),this._cameraController.begin(i);break;case"update":this._cameraController&&this._cameraController.update(i);break;case"end":this._cameraController&&(this._cameraController.end(),this._cameraController=null)}e.stopPropagation()}},OH=class extends Of{constructor(){super(...arguments),this._pickPoint=O(),this._tmpP0=Ne(),this._panAxisAngle=m8(),this._tmpRayDir=O(),this._tmpRayDirPick=O(),this._targetOnSphere=O(),this._navMode=Xs.Horizontal,this._tmpRay={origin:O(),direction:O()},this.dragBeginPoint=Xi(),this._normalizedAnchorPoint=Ne(),this._constraintOptions={selection:Ci.ALL_EXCEPT_COLLISION,interactionType:Wt.ZOOM,interactionFactor:0,interactionStartCamera:null,interactionDirection:null,tiltMode:Qs.TUMBLE},this._sphere=vn(),this._hasPickPoint=!1}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(e){if(!this.active)return;fs(this.dragBeginPoint,e),$b(this.startCamera,e,this._normalizedAnchorPoint);const r=Mr(this.view.spatialReference),i=oTe(this._intersectionHelper,this.startCamera,e,r,VS.Ellipsoid,this.view.map.ground.opacity===0?jw:{});if(this._navMode=y8(this.startCamera,e,r),this._navMode===Xs.Horizontal)this._hasPickPoint=!!i.scenePickPoint,this._pickPoint=i.scenePickPoint??this._pickPoint,this._sphere=i.sphere;else{let n;ME(this.startCamera,e,this._tmpRay),me(this._tmpRay.direction,this._tmpRay.direction),i.scenePickPoint!=null&&(ae(this._tmpRayDirPick,this.startCamera.eye,i.scenePickPoint),n=Te(this._tmpRayDirPick));const s=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,Jse);let o=ge(Math.min(J2e,1/Math.abs(fe(Jse,this._tmpRay.direction)))*s,y5[0],y5[1]);const a=this.view._stage.renderView.getMinimalDepthForArea(null,e[0],e[1],this.view.state.camera,g8);o=a??o,o=n!=null?Math.min(o,n):o,this._hasPickPoint=!0,te(this._tmpRay.direction,this._tmpRay.direction,o),oe(this._pickPoint,this._tmpRay.origin,this._tmpRay.direction)}this._constraintOptions.interactionStartCamera=this.startCamera}update(e){if(this.active){if(this.currentCamera.eye=this.startCamera.eye,this.currentCamera.center=this.startCamera.center,this.currentCamera.up=this.startCamera.up,this._navMode===Xs.Horizontal){ae(this._tmpRayDir,this.currentCamera.center,this.currentCamera.eye);const r=Te(this._tmpRayDir);$b(this.currentCamera,e,this._tmpP0);const i=12*(this._normalizedAnchorPoint[1]-this._tmpP0[1]);let n=r*2**i;const s=this.view.state.constraints.minimumPoiDistance;if(i<0&&n=0&&nthis.startCamera.center[2]?I1[2]=Math.max(this.startCamera.center[2],I1[2]):I1[2]=Math.min(this.startCamera.center[2],I1[2]),this.currentCamera.center=I1,this._constraintOptions.interactionFactor=zd(cw(this.dragBeginPoint,e)),Rn(this.view,this.currentCamera,this._constraintOptions),this.commitCamera())}end(){this.active&&this.finishController()}};RH=h([N("esri.views.3d.state.controllers.local.ZoomController")],RH);const I1=O(),vKe=Se(0,0,1);let bKe=class extends Eo{constructor(e,r,i){super(!0),this._view=e,this.pointerAction=r,this.registerIncoming("drag",i,n=>this._handleDrag(n))}_handleDrag(e){const r=e.data;if(r.pointers.size>1||!kQ(e.data,this.pointerAction))return;const i=Xi(r.center.x,r.center.y);switch(r.action){case"start":this._cameraController&&(this._cameraController.end(),this._cameraController=null),this._view.state.isGlobal?this._cameraController=new OH({view:this._view}):this._cameraController=new RH({view:this._view}),this._view.state.switchCameraController(this._cameraController),this._cameraController.begin(i);break;case"update":this._cameraController&&this._cameraController.update(i);break;case"end":this._cameraController&&(this._cameraController.end(),this._cameraController=null)}e.stopPropagation()}};function td(t){let e=t*t;return t<0&&(e*=-1),e}function Kse(t,e,r){const i=r,n=t.state,s=t.device,o=e.tiltDirection==="forward-down"?1:-1,a=1;return s.deviceType==="standard"?(i.translation[0]=td(n.axes[0]),i.translation[1]=td(n.axes[1]),i.translation[2]=td(n.buttons[7])-td(n.buttons[6]),i.heading=td(n.axes[2]),i.tilt=td(n.axes[3])):s.deviceType==="spacemouse"&&(i.translation[0]=1.2*td(n.axes[0]),i.translation[1]=1.2*td(n.axes[1]),i.translation[2]=2*-td(n.axes[2]),i.heading=1.2*td(n.axes[5]),i.tilt=1.2*td(n.axes[3])),i.tilt*=o,te(i.translation,i.translation,a),i}function eoe(t,e){const r=e;return r.translation[0]=t[1]-t[0],r.translation[1]=t[3]-t[2],r.translation[2]=t[4]-t[5],r.heading=t[7]-t[6],r.tilt=t[8]-t[9],r.zoom=t[10]-t[11],r}function v9(t){return t.translation[0]===0&&t.translation[1]===0&&t.translation[2]===0&&t.heading===0&&t.tilt===0&&t.zoom===0}let vb=class extends Of{constructor(e){super(e),this._filteredSurfaceElevation=0,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._keysButtonState=[0,0,0,0,0,0,0,0,0,0,0,0],this._tmpCamera=new lt,this._headingStart=0,this._constraintOptions={selection:Ci.ALL,interactionType:Wt.NONE,interactionStartCamera:new lt,interactionFactor:0,interactionDirection:null,tiltMode:Qs.LOOK_AROUND}}handleEventGamepad(e){const r=Kse(e,this.view.navigation.gamepad,this._transformation);(e.action==="end"||v9(r))&&this.finishController()}activateDirection(e){this._keysButtonState[e]=1,eoe(this._keysButtonState,this._transformation)}deactivateDirection(e){this._keysButtonState[e]=0;const r=eoe(this._keysButtonState,this._transformation);v9(r)&&this.finishController()}onControllerStart(e){this._filteredSurfaceElevation=this.view.pointsOfInterest.cameraOnSurface.location.z,this._headingStart=this.view.camera.heading,super.onControllerStart(e)}_updateFilteredSurfaceElevation(e){const r=this.view.pointsOfInterest.cameraOnSurface.location.z,i=1;this._filteredSurfaceElevation+=i*(r-this._filteredSurfaceElevation)*e}stepController(e,r){var i;this._updateStartHeading(),this._updateFilteredSurfaceElevation(e),this.currentCamera.copyViewFrom(r),this._updateCameraCenter(),(i=this._constraintOptions.interactionStartCamera)==null||i.copyFrom(this.currentCamera),this._calculateControlTransformation(e,this.currentCamera,L1),this._applyDisabledMovementTypes(L1),this._applyPan(L1.pan),this._applyRotate(L1.rotate),this._applyZoom(L1.zoom),this._applyAscend(L1.ascend),this._constraintOptions.interactionType=Wt.NONE,this._constraintOptions.selection=Ci.COLLISION,Rn(this.view,this.currentCamera,this._constraintOptions),super.stepController(e,r)}_updateStartHeading(){this._transformation.heading!==0&&(this._headingStart=this.view.camera.heading)}_applyRotate(e){if(!e.enabled)return;const r=this.currentCamera;ae(nl,r.center,r.eye),De(nl,nl,e.matrix),r.center=oe(nl,nl,r.eye),r.up=De(nl,r.up,e.matrix),this._constraintOptions.interactionType=Wt.LOOK_AROUND,this._constraintOptions.selection=Ci.ALL_EXCEPT_COLLISION,Rn(this.view,r,this._constraintOptions)}_applyPan(e,r=this.currentCamera){e.enabled&&(r.eye=De(nl,r.eye,e.matrix),r.center=De(nl,r.center,e.matrix),this.view.state.isGlobal&&(r.up=De(nl,r.up,e.matrix)),this._constraintOptions.interactionType=Wt.PAN,this._constraintOptions.selection=Ci.ALL,Rn(this.view,r,this._constraintOptions))}_applyZoom(e){if(!e)return;const r=this.currentCamera.viewForward;this.currentCamera.eye=oe(nl,this.currentCamera.eye,te(Ie.get(),r,e)),re(bC,r),fa(bC,bC),this._constraintOptions.interactionDirection=bC,this._constraintOptions.interactionType=Wt.ZOOM,this._constraintOptions.selection=Ci.ALL_EXCEPT_COLLISION,Rn(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null}_applyAscend(e){if(!e)return;const r=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,Ie.get());if(this._constraintOptions.interactionDirection=re(bC,r),this.view.state.isGlobal){const i=Te(this.currentCamera.eye),n=(i+e)/i;this.currentCamera.eye=te(nl,this.currentCamera.eye,n),this.currentCamera.center=te(nl,this.currentCamera.center,n)}else{const i=te(Ie.get(),r,e);this.currentCamera.eye=oe(nl,this.currentCamera.eye,i),this.currentCamera.center=oe(nl,this.currentCamera.center,i)}this._updateCameraCenter(),this._constraintOptions.interactionType=Wt.ASCEND,this._constraintOptions.selection=Ci.COLLISION,Rn(this.view,this.currentCamera,this._constraintOptions)&&this._updateCameraCenter(),this._constraintOptions.selection=Ci.ALL_EXCEPT_COLLISION,Rn(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null}_calculateControlTransformation(e,r,i){AKe(i);const n=this._computeVelocities(e);this.view.state.isLocal?this._calculateControlTransformationLocal(n,r,i):this._calculateControlTransformationGlobal(n,r,i)}_updateCameraCenter(){const e=this.view.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,r=this.view.renderCoordsHelper,i=this.currentCamera.ray;this.currentCamera.center=r.intersectManifoldClosestSilhouette(i,e,nl)}_calculateControlTransformationLocal(e,r,i){const{viewRight:n,viewForward:s}=r,o=this._transformation,a=this.view.navigation.gamepad,l=ne(Ie.get(),s[0],s[1],0);me(l,l);const c=o.translation[0]*e.pan;if(c!==0){const _=te(Ie.get(),n,c);Ml(i.pan.matrix,i.pan.matrix,_),i.pan.enabled=!0}switch(a.mode){case"pan":{const _=-o.translation[1]*e.pan;if(_!==0){const v=te(Ie.get(),l,_);Ml(i.pan.matrix,i.pan.matrix,v),i.pan.enabled=!0}i.zoom=o.zoom*e.zoom;break}case"zoom":i.zoom=(-o.translation[1]+o.zoom)*e.zoom;break;default:a.mode}const u=o.translation[2]*e.ascend;i.ascend=u;const d=-o.heading*e.rotate;d!==0&&(mc(i.rotate.matrix,i.rotate.matrix,d,this.view.renderCoordsHelper.worldUpAtPosition(r.eye,Ie.get())),i.rotate.enabled=!0);const p=o.tilt*e.rotate,m=Z_(this.view.renderCoordsHelper,r.center,r.eye),y=ge(m+p,$o.min,$o.max)-m;y&&(mc(i.rotate.matrix,i.rotate.matrix,y,n),i.rotate.enabled=!0)}_calculateControlTransformationGlobal(e,r,i){const{eye:n,viewRight:s}=r,o=this._transformation,a=this.view.navigation.gamepad,l=ot(Ie.get(),s,n);me(l,l),fa(l,l),aJe(this.startCamera,r,o,e,this.view.camera.heading,this._headingStart,this.view.camera.tilt,i,a),this._tmpCamera.copyFrom(this.currentCamera),this._applyPan(L1.pan,this._tmpCamera);const c=this.view.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,u=o.translation[2]*e.ascend;i.ascend=u;const d=-o.heading*e.rotate;d!==0&&(mc(i.rotate.matrix,i.rotate.matrix,d,this._tmpCamera.eye),i.rotate.enabled=!0);const p=o.tilt*e.rotate,m=this._clampTiltDeltaGlobalToValidRange(p,r.ray,c);m!==0&&(mc(i.rotate.matrix,i.rotate.matrix,m,this._tmpCamera.viewRight),i.rotate.enabled=!0),i.zoom+=o.zoom*e.zoom}_clampTiltDeltaGlobalToValidRange(e,r,i){const n=Mr(this.view.spatialReference),s=kD($o.min,r.origin,i,n);let o=0,a=0;const l=Ie.get();if(this.view.renderCoordsHelper.intersectManifold(r,i,l)){const c=Z_(this.view.renderCoordsHelper,l,r.origin);o=kD(c,r.origin,i,n),a=kD($o.max,r.origin,i,n)}else{EE(z6(B6,i+n.radius),r,l);const c=Math.PI+k6(r.direction,l);o=Nse(c,r.origin,i,n),a=Nse($o.max,r.origin,i,n)}return ge(o+e,s,a)-o}_getPointAbsoluteSurfaceElevation(e,r,i){const{renderCoordsHelper:n}=this.view,s=n.getAltitude(e),o=r+Math.abs(s-r);return n.setAltitude(i,o,e),o}_clampedDistanceToSurface(e,r){const{renderCoordsHelper:i}=this.view,{camera:n}=this.view.state,{direction:s}=kJe(this.view,r,0,UTe,CKe),o=i.intersectManifoldClosestSilhouette(bu(r,s),e,Ie.get()),a=ci(r,o),l=i.intersectManifoldClosestSilhouette(bu(r,Qg(Ie.get(),r,n.center)),e,Ie.get()),c=ci(r,l);return Math.min(a,c)}_computeHeadingRotateRadius(e){const{renderCoordsHelper:r,state:i}=this.view,{camera:n,isGlobal:s}=i,o=r.intersectManifoldClosestSilhouette(n.ray,this._filteredSurfaceElevation,Ie.get());if(s){const a=ae(Ie.get(),e,o),l=Te(a);te(a,a,1/l);const c=me(Ie.get(),e),u=As(fe(c,a));return l*Math.sin(Math.min(xKe,u))}{const a=re(Ie.get(),e);return r.setAltitude(a,this._filteredSurfaceElevation),ci(o,a)}}_minimumAscendVelocity(){return this.view.state.constraints.collision.enabled?0:TKe}_computeVelocities(e){const r=this._filteredSurfaceElevation,i=r+Mr(this.view.spatialReference).radius,{camera:n,isGlobal:s}=this.view.state,o=Ie.get(),a=this._getPointAbsoluteSurfaceElevation(n.eye,r,o),l=this._clampedDistanceToSurface(r,o),c=n.width/2,u=toe*n.width,d=toe*n.width,p=l*Math.tan(.5*n.fovX)/c,m=p/i,y=p/this._computeHeadingRotateRadius(o),_=a-r;return{pan:(s?m:p)*u*e,ascend:Math.max(this._minimumAscendVelocity()*e,2**(u*e/c)*_-_),zoom:2**(u*e/c)*l-l,rotate:ge(y*d,SKe,EKe)*e}}_applyDisabledMovementTypes(e){this.disableMovements==null||this.disableMovements.mode!==void 0&&this.view.state.viewingMode!==this.disableMovements.mode||(e.zoom=this.disableMovements.zoom?0:e.zoom,e.ascend=this.disableMovements.ascend?0:e.ascend,e.pan.enabled=!this.disableMovements.pan,this.disableMovements.pan&&Nh(e.pan.matrix),e.rotate.enabled=!this.disableMovements.rotate,this.disableMovements.rotate&&Nh(e.rotate.matrix))}static activatesFor(e,r){const i=Kse(r,e.navigation.gamepad,wKe);return!(r.action==="end"||v9(i))}};h([f({constructOnly:!0})],vb.prototype,"gamepadDevice",void 0),h([f({constructOnly:!0})],vb.prototype,"disableMovements",void 0),vb=h([N("esri.views.3d.state.controllers.GamepadKeyboardController")],vb);const wKe={translation:[0,0,0],heading:0,tilt:0,zoom:0},UTe=80,xKe=It(UTe),toe=.75,TKe=5,SKe=It(30),EKe=It(80),L1={zoom:0,ascend:0,pan:{enabled:!1,matrix:_e()},rotate:{enabled:!1,matrix:_e()}},nl=O(),bC=O(),CKe=zQ();function AKe(t){t.zoom=0,t.ascend=0,t.pan.enabled=!1,Nh(t.pan.matrix),t.rotate.enabled=!1,Nh(t.rotate.matrix)}let OKe=class extends Eo{constructor(e){super(!0),this._view=e,this._watchHandles=new Vi,this._handle=this.registerIncoming("gamepad",r=>this._handleEventGamepad(r)),this._handle.pause()}onInstall(e){super.onInstall(e),this._watchHandles.add([ue(()=>this._view.navigation.gamepad.enabled,r=>{r?this._handle.resume():(this._handle.pause(),this._cameraControllerGamepad&&(this._cameraControllerGamepad.finishController(),this._cameraControllerGamepad=null))},Pr),ue(()=>this._view.navigation.gamepad.device,r=>{this._cameraControllerGamepad&&r&&this._cameraControllerGamepad.gamepadDevice!==r&&(this._cameraControllerGamepad.finishController(),this._cameraControllerGamepad=null)})])}onUninstall(){this._watchHandles.removeAll(),super.onUninstall()}_handleEventGamepad(e){const r=this._view.navigation.gamepad.device;if(r&&e.data.device!==r)return;const i=this._cameraControllerGamepad&&this._cameraControllerGamepad.active;if(i||vb.activatesFor(this._view,e.data)){if(!i){const n=new vb({view:this._view,gamepadDevice:e.data.device});this._view.state.switchCameraController(n)&&(this._cameraControllerGamepad=n)}this._cameraControllerGamepad&&this._cameraControllerGamepad.active&&this._cameraControllerGamepad.gamepadDevice===e.data.device&&this._cameraControllerGamepad.handleEventGamepad(e.data)}}};var Ql;(function(t){t[t.LEFT=0]="LEFT",t[t.RIGHT=1]="RIGHT",t[t.FORWARD=2]="FORWARD",t[t.BACKWARD=3]="BACKWARD",t[t.UP=4]="UP",t[t.DOWN=5]="DOWN",t[t.HEADINGLEFT=6]="HEADINGLEFT",t[t.HEADINGRIGHT=7]="HEADINGRIGHT",t[t.TILTUP=8]="TILTUP",t[t.TILTDOWN=9]="TILTDOWN",t[t.ZOOMIN=10]="ZOOMIN",t[t.ZOOMOUT=11]="ZOOMOUT"})(Ql||(Ql={}));let RKe=class extends Eo{constructor(e,r){super(!0),this._view=e,this._disableMovements={pan:!0,zoom:!1,ascend:!0,rotate:!1,mode:$e.Local},this._keyToNumber={[r.left]:Ql.LEFT,[r.right]:Ql.RIGHT,[r.forward]:Ql.FORWARD,[r.backward]:Ql.BACKWARD,[r.up]:Ql.UP,[r.down]:Ql.DOWN,[r.headingLeft]:Ql.HEADINGLEFT,[r.headingRight]:Ql.HEADINGRIGHT,[r.tiltUp]:Ql.TILTUP,[r.tiltDown]:Ql.TILTDOWN,[r.zoomIn]:Ql.ZOOMIN,[r.zoomOut]:Ql.ZOOMOUT},this.registerIncoming("key-down",null,i=>this._handleKeyDown(i)),this.registerIncoming("key-up",null,i=>this._handleKeyUp(i)),this.registerIncoming("blur",null,()=>this._handleBlur())}_handleKeyDown(e){if(e.data.native.ctrlKey||e.data.native.metaKey)return;const r=this._keyToNumber[e.data.key];r!=null&&(this._cameraControllerKeyboard&&this._cameraControllerKeyboard.active||(this._cameraControllerKeyboard=new vb({view:this._view,disableMovements:this._disableMovements}),this._view.state.switchCameraController(this._cameraControllerKeyboard)),this._cameraControllerKeyboard.active&&(this._cameraControllerKeyboard.activateDirection(r),e.stopPropagation()))}_handleBlur(){this._cameraControllerKeyboard&&this._cameraControllerKeyboard.active&&(this._cameraControllerKeyboard.finishController(),this._cameraControllerKeyboard=null)}_handleKeyUp(e){if(e.data.native.ctrlKey||e.data.native.metaKey)return;const r=this._keyToNumber[e.data.key];r!=null&&this._cameraControllerKeyboard&&this._cameraControllerKeyboard.active&&(this._cameraControllerKeyboard.deactivateDirection(r),e.stopPropagation())}},PKe=class extends Eo{constructor(e,r){super(!0),this._view=e,this.registerIncoming("mouse-wheel",r,i=>this._handleMouseWheel(i))}_handleMouseWheel(e){if(!this._view.navigation.mouseWheelZoomEnabled)return;const r=e.data;this._cameraController&&this._cameraController.active||(this._cameraController=this._view.state.isGlobal?new w5({view:this._view,mode:"interaction"}):new x5({view:this._view,mode:"interaction"}),this._view.state.switchCameraController(this._cameraController)),this._cameraController.zoomStep(-1/60*r.deltaY,Xi(r.x,r.y)),e.preventDefault(),e.stopPropagation()}},O5=class{constructor(e){this._gain=e}reset(e){this._value=e}set gain(e){this._gain=e}get value(){return this._value===void 0?0:this._value}update(e){this._value===void 0?this._value=e:this._value=this._gain*e+(1-this._gain)*this._value}},gw=class extends OR{constructor(){super(...arguments),this._beginCamera=new lt,this._elapsedTimeSec=0,this.constraintOptions={selection:Ci.ALL,interactionType:Wt.PAN,interactionFactor:0,interactionStartCamera:new lt,interactionDirection:null,tiltMode:Qs.TUMBLE}}initialize(){this.constraintOptions.interactionType=this.interactionType,this.viewAnimation=new DS}get steppingFinished(){return this.momentum.isFinished(this._elapsedTimeSec)}onControllerStart(e){this._beginCamera.copyFrom(e),this.constraintOptions.interactionStartCamera=this._beginCamera,super.onControllerStart(e)}stepController(e,r){r.copyViewFrom(this._beginCamera),this._elapsedTimeSec+=e,this.momentumStep(this._elapsedTimeSec,r),Rn(this.view,r,this.constraintOptions)}};gw=h([N("esri.views.3d.state.controllers.momentum.MomentumController")],gw);let oO=class extends gw{constructor(e){super(e),this.interactionType=Wt.PAN,this._tmpPan=O()}momentumStep(e,r){const i=this.momentum.value(e);te(this._tmpPan,this.momentum.direction,i),r.eye=ae(roe,r.eye,this._tmpPan),r.center=ae(roe,r.center,this._tmpPan),this.constraintOptions.interactionDirection=this._tmpPan}};h([f({constructOnly:!0})],oO.prototype,"momentum",void 0),oO=h([N("esri.views.3d.state.controllers.momentum.PanPlanarMomentumController")],oO);const roe=O(),MKe=O(),J$=O();let BD=class extends gw{constructor(e){super(e),this.interactionType=Wt.PAN}momentumStep(e,r){const i=this.momentum.value1(e),n=this.momentum.value2(e);re(J$,r.eye),me(J$,J$),ot(this.momentum.axis2,J$,this.momentum.axis1),uTe(r,MKe,this.momentum.axis1,i,this.momentum.axis2,n)}};h([f({constructOnly:!0})],BD.prototype,"momentum",void 0),BD=h([N("esri.views.3d.state.controllers.momentum.PanSphericalMomentumController")],BD);let ib=class extends gw{set center(e){this._set("center",ki(e))}set axis(e){this._set("axis",ki(e))}constructor(e){super(e),this.interactionType=Wt.TUMBLE}momentumStep(e,r){const i=this.momentum.value(e);Q_(r,this.center,RR(this.axis,i))}};h([f({constructOnly:!0})],ib.prototype,"momentum",void 0),h([f({constructOnly:!0})],ib.prototype,"center",null),h([f({constructOnly:!0})],ib.prototype,"axis",null),ib=h([N("esri.views.3d.state.controllers.momentum.MomentumController")],ib);let pT=class extends gw{set zoomCenter(e){this._set("zoomCenter",ki(e))}constructor(e){super(e),this.interactionType=Wt.ZOOM,this.constraintOptions.interactionDirection=O()}momentumStep(e,r){const{interactionDirection:i}=this.constraintOptions;if(!i)return;re(i,r.eye);const n=this.momentum.valueDelta(0,e);NQ(r,this.zoomCenter,n,this.view.state.constraints.minimumPoiDistance),Qg(i,r.eye,i)}};h([f({constructOnly:!0})],pT.prototype,"momentum",void 0),h([f({constructOnly:!0})],pT.prototype,"zoomCenter",null),pT=h([N("esri.views.3d.state.controllers.momentum.ZoomPlanarMomentumController")],pT);let $v=class extends gw{set screenCenter(e){this._set("screenCenter",Xi(e[0],e[1]))}set sceneCenter(e){this._set("sceneCenter",ki(e))}constructor(e){super(e),this.interactionType=Wt.ZOOM,this.radius=0,this._tmpSceneCenter=O(),this._tmpZoomAxisAngle=m8(),this._sphere=vn()}initialize(){this._sphere[3]=this.radius}momentumStep(e,r){const i=this.momentum.valueDelta(0,e);nTe(this._sphere,r,i),this.constraintOptions.interactionType=Wt.ZOOM,Rn(this.view,r,this.constraintOptions),PR(this._sphere,r,this.screenCenter,this._tmpSceneCenter),IQ(this.sceneCenter,this._tmpSceneCenter,this._tmpZoomAxisAngle),Q_(r,this._sphere,this._tmpZoomAxisAngle),this.constraintOptions.interactionType=Wt.PAN}};h([f({constructOnly:!0})],$v.prototype,"momentum",void 0),h([f({constructOnly:!0})],$v.prototype,"screenCenter",null),h([f({constructOnly:!0})],$v.prototype,"sceneCenter",null),h([f({constructOnly:!0})],$v.prototype,"radius",void 0),$v=h([N("esri.views.3d.state.controllers.momentum.ZoomSphericalMomentumController")],$v);let Bd=class{constructor(e){this._gain=e,this.lastValue=void 0,this.filteredDelta=void 0}update(e){if(this.hasLastValue()){const r=this.computeDelta(e);this._updateDelta(r)}this.lastValue=e}reset(){this.lastValue=void 0,this.filteredDelta=void 0}hasLastValue(){return this.lastValue!==void 0}hasFilteredDelta(){return this.filteredDelta!==void 0}computeDelta(e){return this.lastValue===void 0?NaN:e-this.lastValue}_updateDelta(e){this.filteredDelta!==void 0?this.filteredDelta=(1-this._gain)*this.filteredDelta+this._gain*e:this.filteredDelta=e}},b8=class{constructor(e,r,i){this._initialVelocity=e,this._stopVelocity=r,this._friction=i,this._duration=Math.abs(Math.log(Math.abs(this._initialVelocity)/this._stopVelocity)/Math.log(1-this._friction))}get duration(){return this._duration}isFinished(e){return e>this.duration}get friction(){return this._friction}value(e){return this.valueFromInitialVelocity(this._initialVelocity,e)}valueDelta(e,r){const i=this.value(e);return this.value(e+r)-i}valueFromInitialVelocity(e,r){r=Math.min(r,this.duration);const i=1-this.friction;return e*(i**r-1)/Math.log(i)}},$Ke=class extends b8{constructor(e,r,i,n,s){super(e,r,i),this._sceneVelocity=n,this.direction=s}value(e){return super.valueFromInitialVelocity(this._sceneVelocity,e)}},kTe=class{constructor(e=300,r=12,i=.84){this._minimumInitialVelocity=e,this._stopVelocity=r,this._friction=i,this.enabled=!0,this._time=new Bd(.6),this._screen=[new Bd(.4),new Bd(.4)],this._scene=[new Bd(.6),new Bd(.6),new Bd(.6)],this._tmpDirection=O()}add(e,r,i){if(this.enabled){if(this._time.hasLastValue()&&this._time.computeDelta(i)<.015)return;this._screen[0].update(e[0]),this._screen[1].update(e[1]),this._scene[0].update(r[0]),this._scene[1].update(r[1]),this._scene[2].update(r[2]),this._time.update(i)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._scene[0].reset(),this._scene[1].reset(),this._scene[2].reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta()||!this._time.hasFilteredDelta())return null;const e=this._screen[0].filteredDelta,r=this._screen[1].filteredDelta,i=e==null||r==null?0:Math.sqrt(e*e+r*r),n=this._time.filteredDelta,s=n==null||i==null?0:i/n;return Math.abs(s)0&&te(this._tmpDirection,this._tmpDirection,1/n);const s=this._time.filteredDelta;return new $Ke(e,r,i,s==null?0:n/s,this._tmpDirection)}},ioe=class{constructor(e){this._gain=e}update(e){this.filteredValue!==void 0?this.filteredValue=(1-this._gain)*this.filteredValue+this._gain*e:this.filteredValue=e}reset(){this.filteredValue=void 0}get hasFilteredValue(){return this.filteredValue!==void 0}};const noe=1e-5;let IKe=class extends b8{constructor(e,r,i,n,s,o=0,a){super(e,r,i),this._angularVelocity1=n,this.axis1=s,this.angularVelocity2=o,this.axis2=a}value1(e){return super.valueFromInitialVelocity(this._angularVelocity1,e)}value2(e){return super.valueFromInitialVelocity(this.angularVelocity2,e)}},LKe=class{constructor(e=300,r=12,i=.84){this._minimumInitialVelocity=e,this._stopVelocity=r,this._friction=i,this.enabled=!0,this._tmpAxis1=O(),this._tmpAxis2=O(),this._tmpAngles=Ne(),this._time=new Bd(.3),this._screen=[new Bd(.4),new Bd(.4)],this._angle1=new ioe(.6),this._angle2=new ioe(.6),this._axis1=O(),this._axis2=O(),this._lastScene=O()}addMomentumDirectRotation(e,r,i,n,s,o){if(this.enabled){if(this._time.hasLastValue()){if(this._time.computeDelta(i)<.01)return;let a=lTe(this._lastScene,r,this._tmpAxis2,n,s,o);this._angle2.update(0),la(this._tmpAxis2)Math.PI;)n-=2*Math.PI;for(;n<-Math.PI;)n+=2*Math.PI;e=i+n}super.add(e,r)}},DKe=class extends b8{constructor(e,r,i){super(e,r,i)}value(e){const r=super.value(e);return Math.exp(r)}valueDelta(e,r){const i=super.value(e),n=super.value(e+r)-i;return Math.exp(n)}},VTe=class extends zTe{constructor(e=2.5,r=.01,i=.95,n=12){super(e,r,i,n)}add(e,r){super.add(Math.log(e),r)}createMomentum(e,r,i){return new DKe(e,r,i)}},PH=class extends Of{constructor(){super(...arguments),this._smoothRotation=new O5(.05),this._rotationAxis=O(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=Er(),this._beginRadius=0,this._smoothScaling=new O5(.05),this._zoomCenterScreen=Xi(),this._zoomMomentumEstimator=new VTe,this._rotationMomentumEstimator=new BTe,this._panSphericalMomentumEstimator=new LKe,this._panPlanarMomentumEstimator=new kTe,this._adjustedSphere=vn(),this._tmp3d=O(),this._tmpScreenPointArray=Xi(),this._beginScreenPoint=Xi(),this._beginScenePoint=O(),this._screenPickPoint=Xi(),this._scenePickPoint=O(),this._mode=Xs.Horizontal,this._sphere=vn(),this._pointerCount=0,this._tmpInteractionDirection=O(),this._constraintOptions={selection:Ci.ALL,interactionType:Wt.NONE,interactionFactor:0,interactionStartCamera:new lt,interactionDirection:null,tiltMode:Qs.TUMBLE}}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(e){var s;if(!this.active)return;const r=this.view.navigation.momentumEnabled;this._zoomMomentumEstimator.enabled=r,this._rotationMomentumEstimator.enabled=r,this._panPlanarMomentumEstimator.enabled=r,this._panSphericalMomentumEstimator.enabled=r,this._beginHeading=-U_.normalize(It(this.view.camera.heading)),this._beginRadius=e.radius,this._pointerCount=e.pointers.size,this._beginAngle=e.angle,this._smoothRotation.reset(),wf(e.center,this._screenPickPoint),fs(this._beginScreenPoint,this._screenPickPoint);const i=Mr(this.view.spatialReference),n=oTe(this._intersectionHelper,this.startCamera,this._screenPickPoint,i,VS.Silhouette,this.view.map.ground.opacity===0?jw:{});n.scenePickPoint!=null&&(this._scenePickPoint=n.scenePickPoint,this._sphere=n.sphere,re(this._beginScenePoint,this._scenePickPoint),this._mode=y8(this.startCamera,this._screenPickPoint,i),this._mode===Xs.Vertical&&this._preparePlanarPanMode(e,n.hasGeometryIntersection),(s=this._constraintOptions.interactionStartCamera)==null||s.copyFrom(this.startCamera))}update(e){if(!this.active)return;this.currentCamera.copyFrom(this.startCamera);const r=e.pointers.size>1;this._mode===Xs.Horizontal?(r&&this._zoomSpherical(e),this._panningSpherical(e),r&&this._rotateSpherical(e)):(r&&this._zoomPlanar(e),this._panningPlanar(e),r&&this._rotatePlanar(e)),this.commitCamera()}end(e){e.pointers.size===this._pointerCount&&this.update(e),this.finishController();const r=this._zoomMomentumEstimator.evaluateMomentum();if(r)return this._mode===Xs.Horizontal?new $v({view:this.view,momentum:r,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere[3]}):new pT({view:this.view,momentum:r,zoomCenter:this._beginScenePoint});const i=this._rotationMomentumEstimator.evaluateMomentum();if(i)return new ib({view:this.view,momentum:i,center:this._sphere,axis:this._rotationAxis});if(this._mode===Xs.Horizontal){const n=this._panSphericalMomentumEstimator.evaluateMomentum();if(n)return new BD({view:this.view,momentum:n})}else{const n=this._panPlanarMomentumEstimator.evaluateMomentum();if(n)return new oO({view:this.view,momentum:n})}return null}_preparePlanarPanMode(e,r){const i=fa(this._tmp3d,this.startCamera.viewForward);MP(this._scenePickPoint,i,this._panningPlane);const n=Xi(this._screenPickPoint[0],0),s=O(),o=Te(this.startCamera.eye);this._adjustedSphere[3]=o=NKe.ANGLE_THRESHOLD?Xs.Horizontal:Xs.Vertical;const c=Math.min(rTe,1/Math.abs(fe(o,this.startCamera.viewForward)))*Math.max(Math.abs(this.view.camera.position.z),iTe);jG(this._planeHorizontal,this._planeHorizontal,i),this.startCamera.aboveGround||HG(this._planeHorizontal,this._planeHorizontal);const u=O(),d=O(),p=O();ae(u,i,this.currentCamera.eye);const m=Te(u);if(me(u,u),this._panMode===Xs.Vertical){te(o,o,a),ae(this._planeVertical,s,o),me(this._planeVertical,this._planeVertical),jG(this._planeVertical,this._planeVertical,i);const _=this.view._stage.renderView.getMinimalDepthForArea(this.view.voxelWasm,this._beginCenterScreen[0],this._beginCenterScreen[1],this.view.state.camera,g8);let v=_??c;v=n?Math.min(v,m):v,re(p,oe(d,this.currentCamera.eye,te(d,u,v))),this._planeVertical[3]=-fe(this._planeVertical,p),this._computePlanePoints(e.pointers,this._planeVertical,this.startCamera,this._tmpPoints),l9(this._tmpPoints,this._beginCenter)}else{const _=n?m:c;re(p,oe(d,this.currentCamera.eye,te(d,u,_))),this._planeHorizontal[3]=-fe(this._planeHorizontal,p),this._computePlanePoints(e.pointers,this._planeHorizontal,this.startCamera,this._tmpPoints),l9(this._tmpPoints,this._beginCenter)}(y=this._constraintOptions.interactionStartCamera)==null||y.copyFrom(this.startCamera)}update(e){if(!this.active)return;this.currentCamera.copyFrom(this.startCamera);const r=e.pointers.size>1,i=this._panMode===Xs.Horizontal?this._planeHorizontal:this._planeVertical,n=this._beginCenter;if(r){const s=this._beginRadius/e.radius,o=.001875*Math.min(Math.max(e.radius,40),120);this._scalingValueSmooth.gain=o,this._scalingValueSmooth.update(s),NQ(this.currentCamera,n,this._scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this._zoomMomentumEstimator.add(this._scalingValueSmooth.value,.001*e.timestamp),this._constraintOptions.interactionType=Wt.ZOOM,this._constraintOptions.interactionFactor=zd(Math.abs(e.radius-this._beginRadius)),Rn(this.view,this.currentCamera,this._constraintOptions)}if(this._computePlanePoints(e.pointers,i,this.currentCamera,this._tmpPoints),l9(this._tmpPoints,this._tmpCentroid3d),wf(e.center,this._tmpCentroid2d),aTe(this.currentCamera,n,this._tmpCentroid3d),this._panMomentumEstimator.add(this._tmpCentroid2d,this._tmpCentroid3d,.001*e.timestamp),this._constraintOptions.interactionType=Wt.PAN,this._constraintOptions.interactionFactor=zd(cw(this._beginCenterScreen,this._tmpCentroid2d)),Rn(this.view,this.currentCamera,this._constraintOptions),r){const s=this._planeHorizontal,o=n,a=this._rotationValueSmooth.value,l=a+xH(e.angle-a),c=.00125*Math.min(Math.max(e.radius,40),120);this._rotationValueSmooth.gain=c,this._rotationValueSmooth.update(l);const u=this._rotationValueSmooth.value-this._beginAngle;this._rotationMomentumEstimator.add(u,.001*e.timestamp),Q_(this.currentCamera,o,RR(s,u)),this._constraintOptions.interactionType=Wt.TUMBLE,this._constraintOptions.interactionFactor=zd(Math.abs(e.radius*u)),Rn(this.view,this.currentCamera,this._constraintOptions)}this.commitCamera()}end(e){e.pointers.size===this._pointerCount&&this.update(e),this.finishController();const r=this._zoomMomentumEstimator.evaluateMomentum();if(r)return new pT({view:this.view,momentum:r,zoomCenter:this._beginCenter});const i=this._rotationMomentumEstimator.evaluateMomentum();if(i)return new ib({view:this.view,momentum:i,center:this._beginCenter,axis:this._planeHorizontal});const n=this._panMomentumEstimator.evaluateMomentum();return n?new oO({view:this.view,momentum:n}):null}_computePlanePoints(e,r,i,n){n.length=e.size;const s=this._tmp2d;let o=0;return e.forEach(a=>{s[0]=a.x,s[1]=a.y,n[o]===void 0&&(n[o]=O()),TH(r,i,s,n[o]),o+=1}),n}get _intersectionHelper(){return this.view.sceneIntersectionHelper}};MH=h([N("esri.views.3d.state.controllers.local.PinchAndPanController")],MH);let ooe=class extends Eo{constructor(e,r,i){super(!0),this._view=e,this.pointerAction=r,this._lastEndTimestamp=0,this._lastTimestamp=0,this.registerIncoming("drag",i,n=>this._handleDrag(n))}_handleDrag(e){if(e.data.pointerType==="mouse"&&!kQ(e.data,this.pointerAction))return;const r=e.timestamp-this._lastEndTimestamp,i=40,n=this._momentum&&this._momentum.active&&r2&&(this._controller.update(e.data),this._lastTimestamp=e.timestamp):this._startController(e);break;case"end":case"removed":this._endController(e,!0);break;case"added":this._endController(e,!1),this._startController(e)}e.stopPropagation()}_endController(e,r){if(this._controller&&this._controller.active){this._lastEndTimestamp=e.timestamp;const i=this._controller.end(e.data);r&&i&&(this._momentum=i,this._view.state.switchCameraController(this._momentum))}this._controller=null}_startController(e){this._controller=this._createController(),this._view.state.switchCameraController(this._controller),this._controller.begin(e.data),this._lastTimestamp=e.timestamp}_createController(){return this._view.state.isGlobal?new PH({view:this._view}):new MH({view:this._view})}},FKe=class extends Eo{constructor(e,r){super(!0),this.view=e,this.registerIncoming("pointer-down",r,()=>this.view.state.stopActiveCameraController())}},GTe=class extends Eo{constructor(e,r){super(!0),this.key=e,this.registerIncoming("key-down",r,i=>this._handleKeyDown(i))}_handleKeyDown(e){e.data.key===this.key&&(this.activate(),e.stopPropagation())}},UKe=class extends GTe{constructor(e,r,i){super(r,i),this.view=e}activate(){this.view.goTo({heading:0}).catch(()=>{})}},kKe=class extends GTe{constructor(e,r,i){super(r,i),this.view=e}activate(){this.view.goTo({tilt:0}).catch(()=>{})}},zKe=class extends Eo{constructor(e,r=!1){super(!0),this._view=e,this._invert=r,this.registerIncoming("vertical-two-finger-drag",i=>this._handleTwoFinger(i))}_handleTwoFinger(e){var n,s,o;const r=this._invert?-1:1,i=Xi(0,e.data.delta*r);switch(e.data.action){case"begin":(n=this._cameraController)==null||n.end(),this._cameraController=new sO({view:this._view,pivot:nc.CENTER}),this._view.state.switchCameraController(this._cameraController),this._cameraController.begin(i);break;case"update":(s=this._cameraController)==null||s.update(i);break;case"end":(o=this._cameraController)==null||o.end(),this._cameraController=null}}};function aoe(t){const e=t.native;return e?{buttons:e.buttons.map(r=>r.pressed?r.value||1:0),axes:e.axes.map(r=>GKe(r,t.axisThreshold))}:{buttons:[],axes:[]}}function BKe(t,e){if(t.axes.length!==e.axes.length||t.buttons.length!==e.buttons.length)return!1;for(let r=0;r{this._connectGamepad(s.gamepad)},this._onDisconnectGamepad=s=>{const o=s.gamepad,a=o.index,l=this._inputDevices[a];l&&(this._emitGamepadEvent(o,aoe(l),!1),this._inputDevices.splice(a,1),this._latestUpdate.splice(a,1),this._input.gamepad.devices.remove(l),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const i="getGamepads"in window.navigator,n=window.isSecureContext;this.supported=i&&n,this.supported&&(this._forEachGamepad(s=>this._connectGamepad(s)),window.addEventListener("gamepadconnected",this._onConnectGamepad),window.addEventListener("gamepaddisconnected",this._onDisconnectGamepad),this.ensurePollingState())}destroy(){this.hasEventListeners=!1,this.supported&&(window.removeEventListener("gamepadconnected",this._onConnectGamepad),window.removeEventListener("gamepaddisconnected",this._onDisconnectGamepad))}set hasEventListeners(e){this._hasEventListeners!==e&&(this._hasEventListeners=e,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&this._inputDevices.length>0&&this._hasEventListeners}set onEvent(e){this._callback=e}_connectGamepad(e){const r=new NZ(e);r.deviceType!=="unknown"&&(this._inputDevices[e.index]=r,this._input.gamepad.devices.add(r)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){this._frameTask==null&&(this._frameTask=fS({update:()=>this._readGamepadState()}))}_stopPolling(){this._frameTask!=null&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const e=document.hasFocus(),r=this._element.contains(document.activeElement),i=this._input.gamepad.enabledFocusMode==="document"&&!e||this._input.gamepad.enabledFocusMode==="view"&&!r;this._forEachGamepad(n=>{const s=this._inputDevices[n.index];if(!s)return;const o=this._latestUpdate[n.index],a=aoe(s),l=i||VKe(a);o&&(o.timestamp===n.timestamp||!o.active&&l||BKe(o.state,a))||this._emitGamepadEvent(n,a,!l)})}_forEachGamepad(e){const r=window.navigator.getGamepads();for(let i=0;i{},this._activePointerCaptures=new Set,this._keyDownState=new Set,this._eventId=1,this._browserTouchPanningEnabled=!1,this._element=e,e.getAttribute("tabindex")||e.setAttribute("tabindex","0"),this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost},this._updateTouchAction(),this._element.addEventListener("keydown",this._preventAltKeyDefault),this._gamepadSource=new jKe(e,this._input),this._gamepadSource.onEvent=i=>this._callback("gamepad",i)}destroy(){this._callback=()=>{},this.activeEvents=null,this._activePointerCaptures.forEach(e=>{this._releasePointerCaptureSafe(e)}),this._gamepadSource=Me(this._gamepadSource),this._activePointerCaptures=null,this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(e){this._browserTouchPanningEnabled=e,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(e){this._callback=e}set activeEvents(e){for(const r in this._active)if(!e||!e.has(r)){const i=this._active[r];this._element.removeEventListener(b9[r],i),delete this._active[r]}e&&e.forEach(r=>{if(!this._active[r]&&b9[r]){const i=(this._eventHandlers[r]||this._handleDefault).bind(this,r);this._element.addEventListener(b9[r],i),this._active[r]=i}}),this._gamepadSource.hasEventListeners=(e==null?void 0:e.has("gamepad"))??!1}setPointerCapture(e,r){r?this._setPointerCatpureSafe(e.pointerId):(this._releasePointerCaptureSafe(e.pointerId),this._activePointerCaptures.delete(e.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?mx.touchNone:mx.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?mx.touchPan:mx.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(mx.touchNone),this._element.classList.remove(mx.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_setPointerCatpureSafe(e){try{this._element.setPointerCapture(e),this._activePointerCaptures.add(e)}catch{}}_releasePointerCaptureSafe(e){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(e))return;this._element.releasePointerCapture(e)}catch{}}_updateNormalizedPointerLikeEvent(e,r){const i=bwe(this._element,e);return HTe.test.disableSubpixelCoordinates&&(i.x=Math.round(i.x),i.y=Math.round(i.y)),r.x=i.x,r.y=i.y,r}_handleKey(e,r){const i=rje(r);i&&e==="key-up"&&this._keyDownState.delete(i);const n={native:r,key:i,repeat:!!i&&this._keyDownState.has(i)};i&&e==="key-down"&&this._keyDownState.add(n.key),this._callback(e,n)}_handlePointer(e,r){const i=this._updateNormalizedPointerLikeEvent(r,{native:r,x:0,y:0,pointerType:r.pointerType,button:r.button,buttons:r.buttons,eventId:this._eventId++});this._callback(e,i)}_handlePointerPreventDefault(e,r){const i=this._updateNormalizedPointerLikeEvent(r,{native:r,x:0,y:0,pointerType:r.pointerType,button:r.button,buttons:r.buttons,eventId:this._eventId++});r.preventDefault(),this._callback(e,i)}_handleMouseWheel(e,r){let i=r.deltaY;switch(r.deltaMode){case 0:loe&&(i=i/document.documentElement.clientHeight*600);break;case 1:i*=30;break;case 2:i*=900}loe?i*=.7:HKe||qKe?i*=.6:WKe&&(i*=1.375);const n=100,s=Math.abs(i);s>n&&(i=i/s*200/(1+Math.exp(-.02*(s-n))));const o=this._updateNormalizedPointerLikeEvent(r,{native:r,x:0,y:0,deltaY:i});this._callback(e,o)}_handlePointerCaptureLost(e,r){this._activePointerCaptures.delete(r.pointerId),this._handleDefault(e,r)}_handleDefault(e,r){const i={native:r};r.preventDefault(),this._callback(e,i)}_preventAltKeyDefault(e){e.key==="Alt"&&e.preventDefault()}_preventMultiTouchPanning(e){e.touches.length>1&&e.preventDefault()}};jTe.test={disableSubpixelCoordinates:!1};const b9={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","pointer-enter":"pointerenter","pointer-leave":"pointerleave","pointer-cancel":"pointercancel",focus:"focus",blur:"blur"};let XKe=class extends Eo{constructor(){super(!0),this.registerIncoming("context-menu",e=>{e.data.native.preventDefault()})}};function WTe(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)}function YKe(t,e){const r=e.x-t.x,i=e.y-t.y;return Math.sqrt(r*r+i*i)}function ZKe(t,e){if(e?(e.radius=0,e.center.x=0,e.center.y=0):e={radius:0,center:Lh()},t.length===0)return e;if(t.length===1)return e.center.x=t[0].x,e.center.y=t[0].y,e;if(t.length===2){const[T,S]=t,[A,C]=[S.x-T.x,S.y-T.y];return e.radius=Math.sqrt(A*A+C*C)/2,e.center.x=(T.x+S.x)/2,e.center.y=(T.y+S.y)/2,e}let r=0,i=0;for(let T=0;TT.x-r),s=t.map(T=>T.y-i);let o=0,a=0,l=0,c=0,u=0,d=0,p=0;for(let T=0;T{i.initialAngle=VD(i,r)-e,i.lastAngle=VD(i,r)-e})}_emitEvent(e,r,i){const n=K$(this._activePointerMap);this._drag.emit(this._createPayload(e,r,n,i),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(e){const r=e.data.native.pointerId,i=e.timestamp;this._activePointerMap.get(r)&&(this._activePointerMap.size===1?(this._updatePointer(e.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",e.data,i),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(r)):(this._removePointer(r),this._emitEvent("removed",e.data,e.timestamp)))}_handlePointerDrag(e){const r=e.data,i=r.currentEvent,n=e.timestamp;switch(r.action){case"start":case"update":this._isDragging?this._activePointerMap.has(i.native.pointerId)?(this._updatePointer(i),!this._isCurrentDragSuppressed&&this._emitEvent("update",i,n)):(this._addPointer(i),this._emitEvent("added",i,n),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(i),this._pointerType=e.data.startEvent.pointerType,this._mouseButton=e.data.startEvent.button,this._startStateModifiers=e.modifiers,this._isDragging=!0,this._isCurrentDragSuppressed=this._isSuppressed,!this._isCurrentDragSuppressed&&this._emitEvent("start",i,n))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&this._pointerType==="touch"&&this._activePointerMap.size===1}};function qTe(t){const e=[];return t.forEach(r=>{e.push(Lh(r.event.x,r.event.y))}),ZKe(e)}function K$(t){const e=qTe(t);let r=0;return t.forEach(i=>{let n=VD(i,e),s=n-i.lastAngle;for(;s>Math.PI;)s-=2*Math.PI;for(;s<-Math.PI;)s+=2*Math.PI;n=i.lastAngle+s,i.lastAngle=n;const o=n-i.initialAngle;r+=o}),r/=t.size||1,{angle:r,radius:e.radius,center:e.center}}function JKe(t){const e=new Map;return t.forEach((r,i)=>e.set(i,r.event)),e}function VD(t,e){const r=t.event,i=r.x-e.center.x,n=r.y-e.center.y;return Math.atan2(n,i)}var uoe;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right",t[t.Back=3]="Back",t[t.Forward=4]="Forward",t[t.Undefined=-1]="Undefined"})(uoe||(uoe={}));const d_={maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};let KKe=class extends Eo{constructor(e=d_.maximumDoubleClickDelay,r=d_.maximumDoubleClickDistance,i=d_.maximumDoubleTouchDelay,n=d_.maximumDoubleTouchDistance,s=hP){super(!1),this._maximumDoubleClickDelay=e,this._maximumDoubleClickDistance=r,this._maximumDoubleTouchDelay=i,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._click=this.registerOutgoing("click"),this._doubleClick=this.registerOutgoing("double-click"),this.registerIncoming("immediate-click",this._handleImmediateClick.bind(this)),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this))}onUninstall(){this._pointerState.forEach(e=>e.doubleClickTimer=Pi(e.doubleClickTimer))}get hasPendingInputs(){return Do(this._pointerState,e=>e.doubleClickTimer!=null)}_clearDoubleClickTimer(e,r){const i=this._pointerState.get(e);i&&(i.doubleClickTimer=Pi(i.doubleClickTimer),r&&this._click.emit(i.event.data,void 0,i.event.modifiers),this._pointerState.delete(e),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(e){const r=this._pointerState.get(e);r.pointerDownCount===1&&this._click.emit(r.event.data,void 0,r.event.modifiers),r.doubleClickTimer=null,this._pointerState.delete(e),this.refreshHasPendingInputs()}_getPointerId(e){const{pointerId:r,pointerType:i,button:n}=e.native;return i==="mouse"?`${r}:${n}`:`${i}`}_handleImmediateClick(e){const r=e.data,{pointerType:i}=r.native,n=this._getPointerId(r);if(!this._pointerState.has(n))return void this._startClick(e);const s=this._pointerState.get(n),{data:o,modifiers:a}=s.event,l=i==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;WTe(o,r)>l?(this._clearDoubleClickTimer(n,!0),this._startClick(e)):(this._clearDoubleClickTimer(n,!1),s.pointerDownCount===2&&this._doubleClick.emit(o,void 0,a))}_handlePointerDown(e){const r=aO(e.data),i=this._pointerState.get(r);i&&(i.pointerDownCount+=1)}_startClick(e){const{data:r}=e,{native:{pointerType:i}}=r,n=aO(r),s=i==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._doubleClickTimeoutExceeded(n),s),a=1;this._pointerState.set(n,{event:e,doubleClickTimer:o,pointerDownCount:a}),this.refreshHasPendingInputs()}},eet=class extends Eo{constructor(e=d_.maximumDoubleClickDelay,r=d_.maximumDoubleClickDistance,i=d_.maximumDoubleTouchDelay,n=d_.maximumDoubleTouchDistance,s=hP){super(!1),this._maximumDoubleClickDelay=e,this._maximumDoubleClickDistance=r,this._maximumDoubleTouchDelay=i,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._immediateDoubleClick=this.registerOutgoing("immediate-double-click"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUp.bind(this))}onUninstall(){this._pointerState.forEach(e=>{e.immediateDoubleClick&&e.immediateDoubleClick.timeoutHandle.remove()}),super.onUninstall()}_handlePointerDown(e){const r=e.data,i=aO(r);if(!this._pointerState.has(i)){const n={downButton:r.native.button,immediateDoubleClick:null};this._pointerState.set(i,n),this.startCapturingPointer(r.native)}}_handlePointerUp(e){const r=e.data,i=aO(r),n=this._pointerState.get(i);if(n&&n.downButton===r.native.button){const s=n.immediateDoubleClick;if(s){s.timeoutHandle.remove();const o=e.data.native.pointerType==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;WTe(s,e.data)>o?this._startImmediateDoubleClick(e,n):(this._immediateDoubleClick.emit(e.data,void 0,s.modifiers),this._removeState(r))}else this._startImmediateDoubleClick(e,n)}}_startImmediateDoubleClick(e,r){const i=e.data.native.pointerType==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;r.immediateDoubleClick={x:e.data.x,y:e.data.y,modifiers:e.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(e.data),i)}}_removeState(e){const r=aO(e);this._pointerState.delete(r),this.stopCapturingPointer(e.native),this.refreshHasPendingInputs()}};const wC={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500};let tet=class extends Eo{constructor(e=wC.maximumClickDelay,r=wC.movementUntilMouseDrag,i=wC.movementUntilPenDrag,n=wC.movementUntilTouchDrag,s=wC.holdDelay,o=hP){super(!1),this._maximumClickDelay=e,this._movementUntilMouseDrag=r,this._movementUntilPenDrag=i,this._movementUntilTouchDrag=n,this._holdDelay=s,this._clock=o,this._pointerState=new Map,this._pointerDrag=this.registerOutgoing("pointer-drag"),this._immediateClick=this.registerOutgoing("immediate-click"),this._pointerHold=this.registerOutgoing("hold"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",a=>{this._handlePointerLoss(a,"pointer-up")}),this.registerIncoming("pointer-capture-lost",a=>{this._handlePointerLoss(a,"pointer-capture-lost")}),this.registerIncoming("pointer-cancel",a=>{this._handlePointerLoss(a,"pointer-cancel")}),this._moveHandle=this.registerIncoming("pointer-move",this._handlePointerMove.bind(this)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach(e=>{e.holdTimeout=Pi(e.holdTimeout)}),super.onUninstall()}_handlePointerDown(e){const r=e.data,i=r.native.pointerId;let n=null;this._pointerState.size===0&&(n=this._clock.setTimeout(()=>{const o=this._pointerState.get(i);if(o){if(!o.isDragging){const a=o.previousEvent;this._pointerHold.emit(a,void 0,e.modifiers),o.holdEmitted=!0}o.holdTimeout=null}},this._holdDelay));const s={startEvent:r,previousEvent:r,startTimestamp:e.timestamp,isDragging:!1,downButton:r.native.button,holdTimeout:n,modifiers:new Set};this._pointerState.set(i,s),this.startCapturingPointer(r.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(e)}_createPointerDragData(e,r,i){return{action:e,startEvent:r.startEvent,previousEvent:r.previousEvent,currentEvent:i}}_handlePointerMove(e){const r=e.data,i=r.native.pointerId,n=this._pointerState.get(i);n&&(n.isDragging?this._pointerDrag.emit(this._createPointerDragData("update",n,r),void 0,n.modifiers):YKe(r,n.startEvent)>this._getDragThreshold(r.native.pointerType)&&this._startDragging(e),n.previousEvent=r)}_getDragThreshold(e){switch(e){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(e){const r=e.data,i=r.native.pointerId;this._pointerState.forEach(n=>{n.holdTimeout!=null&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging||(n.modifiers=e.modifiers,n.isDragging=!0,i===n.startEvent.native.pointerId?this._pointerDrag.emit(this._createPointerDragData("start",n,r)):this._pointerDrag.emit(this._createPointerDragData("start",n,n.previousEvent),e.timestamp))})}_handlePointerLoss(e,r){const i=e.data,n=i.native.pointerId,s=this._pointerState.get(n);s&&(s.holdTimeout!=null&&(s.holdTimeout.remove(),s.holdTimeout=null),s.isDragging?this._pointerDrag.emit(this._createPointerDragData("end",s,r==="pointer-up"?i:s.previousEvent),void 0,s.modifiers):r==="pointer-up"&&s.downButton===i.native.button&&e.timestamp-s.startTimestamp<=this._maximumClickDelay&&!s.holdEmitted&&this._immediateClick.emit(i),this._pointerState.delete(n),this.stopCapturingPointer(i.native),this._pointerState.size===0&&this._moveHandle.pause())}},ret=class{constructor(e){this._callbacks=e,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(e){const r=e.data,i=r.pointers.size;switch(r.action){case"start":this._currentCount=i,this._emitStart(e);break;case"added":this._emitEnd(this._previousEvent),this._currentCount=i,this._emitStart(e);break;case"update":this._emitUpdate(e);break;case"removed":this._startEvent&&this._emitEnd(this._previousEvent),this._currentCount=i,this._emitStart(e);break;case"end":this._emitEnd(e),this._currentCount=0}this._previousEvent=e}_emitStart(e){var r,i;this._startEvent=e,(i=(r=this._callbacks).condition)!=null&&i.call(r,this._currentCount,e)&&this._callbacks.start(this._currentCount,e,this._startEvent)}_emitUpdate(e){var r,i;(i=(r=this._callbacks).condition)!=null&&i.call(r,this._currentCount,e)&&this._callbacks.update(this._currentCount,e,this._startEvent)}_emitEnd(e){var r,i;(i=(r=this._callbacks).condition)!=null&&i.call(r,this._currentCount,e)&&this._callbacks.end(this._currentCount,e,this._startEvent),this._startEvent=null}},iet=class extends Eo{constructor(e=20,r=40){super(!1),this._threshold=e,this._maxDelta=r,this._state="ready",this._emittedArtificalEnd2=!1,this._vertical=this.registerOutgoing("vertical-two-finger-drag"),this._artificalDrag=this.registerOutgoing("drag"),this._dragEventSeparator=new ret({start:(i,n)=>this._observeStart(i,n),update:(i,n,s)=>this._observeUpdate(i,n,s),end:(i,n)=>this._observeEnd(n)}),this.registerIncoming("drag",i=>this._dragEventSeparator.handle(i))}get failed(){return this._state==="failed"}_observeStart(e,r){e===1&&this._emittedArtificalEnd2&&(this._emittedArtificalEnd2=!1,this._artificalDrag.emit({action:"start",button:r.data.button,buttons:r.data.buttons,pointerType:r.data.pointerType,timestamp:r.data.timestamp,pointers:r.data.pointers,pointer:r.data.pointer,angle:r.data.angle,radius:r.data.radius,center:r.data.center}),r.stopPropagation()),this._state=e===2?"ready":"failed"}_observeUpdate(e,r,i){if(this._state!=="failed"&&e===2)return this._state==="active"?(this._vertical.emit({delta:r.data.center.y-this._thresholdReachedCenter.y,action:"update"}),void r.stopPropagation()):void(this._checkMovementWithinLimits(r.data,i.data)?this._checkVerticalThresholdReached(r.data,i.data)&&(this._state="active",this._emittedArtificalEnd2=!0,this._thresholdReachedCenter=r.data.center,this._artificalDrag.emit({action:"end",button:r.data.button,buttons:r.data.buttons,pointerType:r.data.pointerType,timestamp:r.data.timestamp,pointers:r.data.pointers,pointer:r.data.pointer,angle:r.data.angle,radius:r.data.radius,center:r.data.center}),this._vertical.emit({delta:r.data.center.y-this._thresholdReachedCenter.y,action:"begin"}),r.stopPropagation()):this._state="failed")}_observeEnd(e){this._state==="active"&&(this._vertical.emit({delta:e.data.center.y-this._thresholdReachedCenter.y,action:"end"}),this._state="ready",e.stopPropagation())}_checkMovementWithinLimits(e,r){let i=-1/0,n=1/0,s=-1/0,o=1/0;for(const{x:_,y:v}of r.pointers.values())i=Math.max(i,_),n=Math.min(n,_),s=Math.max(s,v),o=Math.min(o,v);let a=-1/0,l=1/0,c=-1/0,u=1/0;for(const{x:_,y:v}of e.pointers.values())a=Math.max(a,_),l=Math.min(l,_),c=Math.max(c,v),u=Math.min(u,v);const d=i-n,p=s-o,m=a-l,y=c-u;return Math.abs(e.center.x-r.center.x){const o=r.pointers.get(s);i=Math.min(i,Math.abs(n.y-o.y))}),i>=this._threshold}},_d=class extends xe{constructor(){super(...arguments),this._handles=new Vi}destroy(){this._handles=Me(this._handles),this.disconnect()}get primaryDragAction(){return this._get("primaryDragAction")}set primaryDragAction(e){e!=="pan"&&e!=="rotate"||e===this._get("primaryDragAction")||(this._set("primaryDragAction",e),this._updateMode())}get mode(){return this._get("mode")}set mode(e){e!=="default"&&e!=="pro"||e===this._get("mode")||(this._set("mode",e),this._updateMode())}get updating(){var e;return!!((e=this._inputManager)!=null&&e.updating)}get latestPointerType(){var e;return(e=this._inputManager)==null?void 0:e.latestPointerType}get latestPointerLocation(){var e;return(e=this._inputManager)==null?void 0:e.latestPointerLocation}get multiTouchActive(){var e;return((e=this._inputManager)==null?void 0:e.multiTouchActive)??!1}disconnect(){this.view.viewEvents.disconnect(),this._inputManager=Me(this._inputManager)}connect(){const e=this.view;this._source=new jTe(this.view.surface,e.input);const r=[new eet,new tet,new KKe,new QKe(this.view.navigation),new iet],i=new Hu({eventSource:this._source,recognizers:r});this._inputManager=i,i.installHandlers("prevent-context-menu",[new XKe],E_.INTERNAL),this._modeDragPan=new ooe(e,"primary"),this._modeDragRotate=new _9(e,"secondary",nc.CENTER),this._modeDragZoom=new bKe(e,"tertiary");const n={lookAround:"b",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:"u",down:"j",headingLeft:"a",headingRight:"d",tiltUp:"w",tiltDown:"s",zoomIn:"+",zoomOut:"-"},resetHeading:"n",resetTilt:"p"};i.installHandlers("navigation",[new FKe(e),new fJe(e),new OKe(e),new RKe(e,n.pan),new PKe(e),new kKe(e,n.resetTilt),new UKe(e,n.resetHeading),new _9(e,"primary",nc.EYE,[n.lookAround]),new _9(e,"secondary",nc.CENTER,[n.lookAround]),new ooe(e,"tertiary",[n.lookAround]),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,new zKe(e)],E_.INTERNAL),this.view.viewEvents.connect(i),this._updateMode(),this._handles.add(ue(()=>{var s;return(s=this.view.navigation)==null?void 0:s.browserTouchPanEnabled},s=>{this._source.browserTouchPanningEnabled=!s},Pr))}_updateMode(){var n;const e=this.mode,r=this.primaryDragAction,i=(n=$H.get(e))==null?void 0:n.get(r);i&&(this._modeDragPan&&(this._modeDragPan.pointerAction=i.pan),this._modeDragRotate&&(this._modeDragRotate.pointerAction=i.rotate),this._modeDragZoom&&(this._modeDragZoom.pointerAction=i.zoom))}get test(){return{inputManager:this._inputManager,modeDragPan:this._modeDragPan,modeDragRotate:this._modeDragRotate,modeDragZoom:this._modeDragZoom}}};h([f()],_d.prototype,"view",void 0),h([f({value:"pan"})],_d.prototype,"primaryDragAction",null),h([f({value:"default"})],_d.prototype,"mode",null),h([f({readOnly:!0})],_d.prototype,"updating",null),h([f()],_d.prototype,"latestPointerType",null),h([f()],_d.prototype,"latestPointerLocation",null),h([f()],_d.prototype,"multiTouchActive",null),h([f()],_d.prototype,"_inputManager",void 0),_d=h([N("esri.views.3d.input.SceneInputManager")],_d);const $H=new Map,w9=new Map,x9=new Map;w9.set("pan",{pan:"primary",rotate:"secondary",zoom:"tertiary"}),w9.set("rotate",{pan:"secondary",rotate:"primary",zoom:"tertiary"}),x9.set("pan",{pan:"primary",rotate:"tertiary",zoom:"secondary"}),x9.set("rotate",{pan:"tertiary",rotate:"primary",zoom:"secondary"}),$H.set("default",w9),$H.set("pro",x9);const net=_d;let xn=class extends xe{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1}};h([f()],xn.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),h([f()],xn.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),h([f()],xn.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),h([f()],xn.prototype,"DECONFLICTOR_SHOW_GRID",void 0),h([f()],xn.prototype,"LABELS_SHOW_BORDER",void 0),h([f()],xn.prototype,"TEXT_SHOW_BASELINE",void 0),h([f()],xn.prototype,"TEXT_SHOW_BORDER",void 0),h([f()],xn.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),h([f()],xn.prototype,"OVERLAY_SHOW_CENTER",void 0),h([f()],xn.prototype,"SHOW_POI",void 0),h([f()],xn.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),h([f()],xn.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),h([f()],xn.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),h([f()],xn.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),h([f()],xn.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),h([f()],xn.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),h([f()],xn.prototype,"I3S_TREE_SHOW_TILES",void 0),h([f()],xn.prototype,"I3S_SHOW_MODIFICATIONS",void 0),h([f()],xn.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),h([f()],xn.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),h([f()],xn.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),h([f()],xn.prototype,"LINE_WIREFRAMES",void 0),xn=h([N("esri.views.3d.support.DebugFlags")],xn);const Kr=new xn;let Zc,HT,IH=!1,LH=!1,DH=!1,NH=!1,lO=null;function set(t,e){if(!LH||!HT)return;XTe();const r=HT;let i=0;for(let n=0;naet(t):Zc&&(Zc.parentElement.removeChild(Zc),Zc=null)}function XTe(){lO&&(lO(),lO=null)}function aet(t){Zc==null&&(Zc=document.createElement("canvas"),Zc.setAttribute("id","debugCanvas2d"),t.surface.parentElement.style.position="relative",t.surface.parentElement.appendChild(Zc));const{state:e}=t,{camera:r,pixelRatio:i}=e,{width:n,height:s}=r,o=n*i,a=s*i;Zc.setAttribute("width",`${o}px`),Zc.setAttribute("height",`${a}px`),Zc.setAttribute("style",`position:absolute;left:0px;top:0px;display:block;pointer-events:none;width:${n}px;height:${s}px`),HT=Zc.getContext("2d"),HT.clearRect(0,0,n,s),HT.font="12px Arial"}function YTe(t,e,r,i,n){XTe();const s=Zc.height,o=HT;o.beginPath(),o.lineWidth=1,o.strokeStyle=n,o.moveTo(t,s-r),o.lineTo(e,s-r),o.stroke(),o.lineTo(e,s-i),o.stroke(),o.lineTo(e,s-r),o.stroke(),o.lineTo(t,s-r),o.stroke(),o.lineTo(t,s-r),o.stroke(),o.closePath()}function cet(t,e){IH&&(e&&DH||!e&&NH)&&YTe(t.aabr[0],t.aabr[2],t.aabr[1],t.aabr[3],e?"green":"red")}var Uo,js;(function(t){t[t.USER=1]="USER",t[t.SCALE_RANGE=2]="SCALE_RANGE",t[t.FILTER=4]="FILTER",t[t.DECONFLICTION=8]="DECONFLICTION",t[t.ALL_GRAPHIC=15]="ALL_GRAPHIC",t[t.ALL_LABEL=255]="ALL_LABEL"})(Uo||(Uo={})),function(t){t[t.GRAPHIC=1]="GRAPHIC",t[t.LABEL=16]="LABEL"}(js||(js={}));function ZTe(t,e){return new eSe(t,rSe,e)}function uet(t,e){const{curvatureDependent:r,scaleStart:i,scaleFallOffRange:n}=rSe;return new eSe(t,{curvatureDependent:{min:{curvature:r.min.curvature,tiltAngle:r.min.tiltAngle,scaleFallOffFactor:T9.curvatureDependent.min.scaleFallOffFactor},max:{curvature:r.max.curvature,tiltAngle:r.max.tiltAngle,scaleFallOffFactor:T9.curvatureDependent.max.scaleFallOffFactor}},scaleStart:i,scaleFallOffRange:n,minPixelSize:T9.minPixelSize},e)}function het(t){return Math.abs(t*t*t)}function QTe(t,e,r){const i=r.parameters,n=r.paddingPixelsOverride;return xC.scale=Math.min(i.divisor/(e-i.offset),1),xC.factor=het(t),xC.minPixelSize=i.minPixelSize,xC.paddingPixels=n,xC}function JTe(t,e){return t===0?e.minPixelSize:e.minPixelSize*(1+2*e.paddingPixels/t)}function qQ(t,e){return Math.max(wt(t*e.scale,t,e.factor),JTe(t,e))}function det(t,e,r){const i=QTe(t,e,r);return i.minPixelSize=0,i.paddingPixels=0,qQ(1,i)}function hoe(t,e,r,i){i.scale=det(t,e,r),i.factor=0,i.minPixelSize=r.parameters.minPixelSize,i.paddingPixels=r.paddingPixelsOverride}function KTe(t,e,r=[0,0]){const i=Math.min(Math.max(e.scale,JTe(t[1],e)/Math.max(1e-5,t[1])),1);return r[0]=t[0]*i,r[1]=t[1]*i,r}function pet(t,e,r,i){return qQ(t,QTe(e,r,i))}let eSe=class tSe{get paddingPixelsOverride(){return this._paddingPixelsOverride||this.parameters.paddingPixels}constructor(e,r,i,n=fet(),s){this._viewingMode=e,this._description=r,this._ellipsoidRadius=i,this.parameters=n,this._paddingPixelsOverride=s,this._viewingMode===$e.Local?(this._coverageCompensation=this._surfaceCoverageCompensationLocal,this._calculateCurvatureDependentParameters=this._calculateCurvatureDependentParametersLocal):(this._coverageCompensation=this._surfaceCoverageCompensationGlobal,this._calculateCurvatureDependentParameters=this._calculateCurvatureDependentParametersGlobal)}update(e){return(!this.parameters||this.parameters.camera.fovY!==e.fovY||this.parameters.camera.distance!==e.distance)&&(this._calculateParameters(e,this._ellipsoidRadius,this.parameters),!0)}overridePadding(e){return e!==this.paddingPixelsOverride?new tSe(this._viewingMode,this._description,this._ellipsoidRadius,this.parameters,e):this}_calculateParameters(e,r,i){const{scaleStart:n,scaleFallOffRange:s,minPixelSize:o}=this._description,{fovY:a,distance:l}=e,c=this._calculateCurvatureDependentParameters(e,r),u=this._coverageCompensation(e,r,c),{tiltAngle:d,scaleFallOffFactor:p}=c,m=Math.sin(d)*l,y=.5*Math.PI-d-a*(.5-n*u),_=m/Math.cos(y),v=y+a*s*u,b=(_-p*(m/Math.cos(v)))/(1-p);return i.camera.fovY=e.fovY,i.camera.distance=e.distance,i.offset=b,i.divisor=_-b,i.minPixelSize=o,i}_calculateCurvatureDependentParametersLocal(e,r,i=doe){return i.tiltAngle=this._description.curvatureDependent.min.tiltAngle,i.scaleFallOffFactor=this._description.curvatureDependent.min.scaleFallOffFactor,i}_calculateCurvatureDependentParametersGlobal(e,r,i=doe){const n=this._description.curvatureDependent,s=1+e.distance/r,o=Math.sqrt(s*s-1),[a,l]=[n.min.curvature,n.max.curvature],c=ge((o-a)/(l-a),0,1),[u,d]=[n.min,n.max];return i.tiltAngle=wt(u.tiltAngle,d.tiltAngle,c),i.scaleFallOffFactor=wt(u.scaleFallOffFactor,d.scaleFallOffFactor,c),i}_surfaceCoverageCompensationLocal(e,r,i){return(e.fovY-i.tiltAngle)/e.fovY}_surfaceCoverageCompensationGlobal(e,r,i){const n=r*r,s=i.tiltAngle+.5*Math.PI,{fovY:o,distance:a}=e,l=a*a+n-2*Math.cos(s)*a*r,c=Math.sqrt(l),u=Math.sqrt(l-n);return(Math.acos(u/c)-Math.asin(r/(c/Math.sin(s)))+.5*o)/o}};const rSe={curvatureDependent:{min:{curvature:It(10),tiltAngle:It(12),scaleFallOffFactor:.5},max:{curvature:It(70),tiltAngle:It(40),scaleFallOffFactor:.8}},scaleStart:.3,scaleFallOffRange:.65,minPixelSize:0},T9={curvatureDependent:{min:{scaleFallOffFactor:.7},max:{scaleFallOffFactor:.95}},minPixelSize:14};function fet(){return{camera:{distance:0,fovY:0},divisor:0,offset:0,minPixelSize:0,paddingPixels:0}}const xC={scale:0,factor:0,minPixelSize:0,paddingPixels:0},doe={tiltAngle:0,scaleFallOffFactor:0};function met(t){return t instanceof Float32Array&&t.length>=16}function get(t){return Array.isArray(t)&&t.length>=16}function yet(t){return met(t)||get(t)}function XQ(t){t.vertex.code.add(w`float screenSizePerspectiveMinSize(float size, vec4 factor) { +float nonZeroSize = 1.0 - step(size, 0.0); +return ( +factor.z * ( +1.0 + +nonZeroSize * +2.0 * factor.w / ( +size + (1.0 - nonZeroSize) +) +) +); +}`),t.vertex.code.add(w`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) { +return absCosAngle * absCosAngle * absCosAngle; +}`),t.vertex.code.add(w`vec4 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec4 params) { +return vec4( +min(params.x / (distanceToCamera - params.y), 1.0), +screenSizePerspectiveViewAngleDependentFactor(absCosAngle), +params.z, +params.w +); +}`),t.vertex.code.add(w`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec4 factor) { +return max(mix(size * factor.x, size, factor.y), screenSizePerspectiveMinSize(size, factor)); +}`),t.vertex.code.add(w`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec4 params) { +return applyScreenSizePerspectiveScaleFactorFloat( +size, +screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params) +); +}`),t.vertex.code.add(w`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec4 factor) { +return mix(size * clamp(factor.x, screenSizePerspectiveMinSize(size.y, factor) / max(1e-5, size.y), 1.0), size, factor.y); +}`),t.vertex.code.add(w`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec4 params) { +return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)); +}`)}function _et(t){t.uniforms.add(new Jt("screenSizePerspective",e=>iSe(e.screenSizePerspective)))}function w8(t){t.uniforms.add(new Jt("screenSizePerspectiveAlignment",e=>iSe(e.screenSizePerspectiveAlignment||e.screenSizePerspective)))}function iSe(t){return gi(vet,t.parameters.divisor,t.parameters.offset,t.parameters.minPixelSize,t.paddingPixelsOverride)}const vet=Qt();var Oi,ch,cO,tn,ns;(function(t){t[t.INNER=0]="INNER",t[t.OUTER=1]="OUTER"})(Oi||(Oi={})),function(t){t[t.REGULAR=0]="REGULAR",t[t.HAS_NORTH_POLE=1]="HAS_NORTH_POLE",t[t.HAS_SOUTH_POLE=2]="HAS_SOUTH_POLE",t[t.HAS_BOTH_POLES=3]="HAS_BOTH_POLES"}(ch||(ch={})),function(t){t[t.OFF=0]="OFF",t[t.ON=1]="ON"}(cO||(cO={})),function(t){t[t.Color=0]="Color",t[t.ColorNoRasterImage=1]="ColorNoRasterImage",t[t.Highlight=2]="Highlight",t[t.Water=3]="Water",t[t.Occluded=4]="Occluded",t[t.ObjectAndLayerIdColor=5]="ObjectAndLayerIdColor"}(tn||(tn={})),function(t){t[t.FADING=0]="FADING",t[t.IMMEDIATE=1]="IMMEDIATE",t[t.UNFADED=2]="UNFADED"}(ns||(ns={}));let bet=class{constructor(e,r){this.vec3=e,this.id=r}};function R5(t,e,r,i){return new bet(Se(t,e,r),i)}var za;(function(t){t[t.None=0]="None",t[t.ColorAndWater=1]="ColorAndWater",t[t.Highlight=2]="Highlight",t[t.Occluded=3]="Occluded",t[t.ObjectAndLayerIdColor=4]="ObjectAndLayerIdColor"})(za||(za={}));const YQ=1.3;let poe=class{get extent(){return this._extent}constructor(e,r){this.index=e,this.renderTargets=r,this._extent=jt(),this.resolution=0,this.renderLocalOrigin=R5(0,0,0,"O"),this.pixelRatio=1,this.mapUnitsPerPixel=1,this.canvasGeometries=new wet,this.hasDrapedFeatureSource=!1,this.hasDrapedRasterSource=!1,this.hasTargetWithoutRasterImage=!1,this.index=e,this.validTargets=new Array(r.renderTargets.length).fill(!1)}getValidTexture(e){return this.validTargets[e]?this.renderTargets.getTarget(e).getTexture():null}get _needsColorWithoutRasterImage(){return this.hasDrapedRasterSource&&this.hasDrapedFeatureSource&&this.hasTargetWithoutRasterImage}getColorTexture(e){const r=e===za.ColorAndWater?this.renderTargets.getTarget(tn.Color):e===za.Highlight?this.renderTargets.getTarget(tn.Highlight):e===za.ObjectAndLayerIdColor?this.renderTargets.getTarget(tn.ObjectAndLayerIdColor):this.renderTargets.getTarget(tn.Occluded);return r?r.getTexture():null}getColorTextureNoRasterImage(){return this._needsColorWithoutRasterImage?this.getValidTexture(tn.ColorNoRasterImage):this.hasDrapedFeatureSource?this.getValidTexture(tn.Color):null}getNormalTexture(e){const r=e===za.ColorAndWater?this.renderTargets.getTarget(tn.Water):null;return r?r.getTexture():null}draw(e,r){const i=this.computeRenderTargetValidityBitfield();for(const n of this.renderTargets.renderTargets)n.type!==tn.ColorNoRasterImage||this._needsColorWithoutRasterImage?this.validTargets[n.type]=e.drawTarget(this,n,r):this.validTargets[n.type]=!1;return i^this.computeRenderTargetValidityBitfield()?FS.CHANGED:FS.UNCHANGED}computeRenderTargetValidityBitfield(){const e=this.validTargets;return+e[tn.Color]|+e[tn.ColorNoRasterImage]<<1|+e[tn.Highlight]<<2|+e[tn.Water]<<3|+e[tn.Occluded]<<4}setupGeometryViewsCyclical(e){this.setupGeometryViewsDirect();const r=.001*e.range;if(this._extent[0]-r<=e.min){const i=this.canvasGeometries.extents[this.canvasGeometries.numViews++];E4(this._extent,e.range,0,i)}if(this._extent[2]+r>=e.max){const i=this.canvasGeometries.extents[this.canvasGeometries.numViews++];E4(this._extent,-e.range,0,i)}}setupGeometryViewsDirect(){this.canvasGeometries.numViews=1,Ug(this.canvasGeometries.extents[0],this._extent)}hasSomeSizedView(){for(let e=0;ei.setUniformMatrix4fv(e,r(n,s)))}};function fp(t,e){e.instancedDoublePrecision?t.constants.add("cameraPosition","vec3",Zs):t.uniforms.add(new pu("cameraPosition",(r,i)=>ne(sSe,i.camera.viewInverseTransposeMatrix[3]-r.origin[0],i.camera.viewInverseTransposeMatrix[7]-r.origin[1],i.camera.viewInverseTransposeMatrix[11]-r.origin[2])))}function xc(t,e){if(!e.instancedDoublePrecision)return void t.uniforms.add(new Mi("proj",(i,n)=>n.camera.projectionMatrix),new nSe("view",(i,n)=>Ml(foe,n.camera.viewMatrix,i.origin)),new pu("localOrigin",i=>i.origin));const r=i=>ne(sSe,i.camera.viewInverseTransposeMatrix[3],i.camera.viewInverseTransposeMatrix[7],i.camera.viewInverseTransposeMatrix[11]);t.uniforms.add(new Mi("proj",(i,n)=>n.camera.projectionMatrix),new Mi("view",(i,n)=>Ml(foe,n.camera.viewMatrix,r(n))),new Lt("localOrigin",(i,n)=>r(n)))}const foe=_e(),sSe=O();function jS(t){t.uniforms.add(new Mi("viewNormal",(e,r)=>r.camera.viewInverseTransposeMatrix))}function LE(t,e){t.uniforms.add(new Ce("pixelRatio",(r,i)=>i.camera.pixelRatio/(e.draped?YQ:1)))}function oSe(t,e){const r=t.vertex;e.hasVerticalOffset?(aSe(r),e.hasScreenSizePerspective&&(t.include(XQ),w8(r),fp(t.vertex,e)),r.code.add(w` + vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) { + float viewDistance = length((view * vec4(worldPos, 1.0)).xyz); + ${e.spherical?w`vec3 worldNormal = normalize(worldPos + localOrigin);`:w`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`} + ${e.hasScreenSizePerspective?w` + float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition)); + float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:w` + float verticalOffsetScreenHeight = verticalOffset.x;`} + // Screen sized offset in world space, used for example for line callouts + float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w); + return worldNormal * worldOffset; + } + + vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { + return worldPos + calculateVerticalOffset(worldPos, localOrigin); + } + `)):r.code.add(w`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const xet=Qt();function aSe(t){t.uniforms.add(new Jt("verticalOffset",(e,r)=>{const{minWorldLength:i,maxWorldLength:n,screenLength:s}=e.verticalOffset,o=Math.tan(.5*r.camera.fovY)/(.5*r.camera.fullViewport[3]),a=r.camera.pixelRatio||1;return gi(xet,s*a,o,i,n)}))}function x8(t){t.uniforms.add(new kf("alignPixelEnabled",(e,r)=>r.alignPixelEnabled)),t.code.add(w`vec4 alignToPixelCenter(vec4 clipCoord, vec2 widthHeight) { +if (!alignPixelEnabled) +return clipCoord; +vec2 xy = vec2(0.500123) + 0.5 * clipCoord.xy / clipCoord.w; +vec2 pixelSz = vec2(1.0) / widthHeight; +vec2 ij = (floor(xy * widthHeight) + vec2(0.5)) * pixelSz; +vec2 result = (ij * 2.0 - vec2(1.0)) * clipCoord.w; +return vec4(result, clipCoord.zw); +}`),t.code.add(w`vec4 alignToPixelOrigin(vec4 clipCoord, vec2 widthHeight) { +if (!alignPixelEnabled) +return clipCoord; +vec2 xy = vec2(0.5) + 0.5 * clipCoord.xy / clipCoord.w; +vec2 pixelSz = vec2(1.0) / widthHeight; +vec2 ij = floor((xy + 0.5 * pixelSz) * widthHeight) * pixelSz; +vec2 result = (ij * 2.0 - vec2(1.0)) * clipCoord.w; +return vec4(result, clipCoord.zw); +}`)}var tc;(function(t){t[t.Occluded=0]="Occluded",t[t.NotOccluded=1]="NotOccluded",t[t.Both=2]="Both",t[t.COUNT=3]="COUNT"})(tc||(tc={}));var Tl;function lSe(t,e){t.include(XQ),t.attributes.add(E.POSITION,"vec3"),t.attributes.add(E.NORMAL,"vec3"),t.attributes.add(E.AUXPOS1,"vec4");const r=t.vertex;xc(r,e),fp(r,e),r.uniforms.add(new Jt("viewport",(i,n)=>n.camera.fullViewport),new Ce("polygonOffset",i=>i.shaderPolygonOffset),new Ce("cameraGroundRelative",(i,n)=>n.camera.aboveGround?1:-1),new Ce("renderTransparentlyOccludedHUD",(i,n)=>n.renderTransparentlyOccludedHUD===tc.Occluded?1:n.renderTransparentlyOccludedHUD===tc.NotOccluded?0:.75),new Ye("hudVisibilityTexture",(i,n)=>n.hudVisibilityTexture)),e.hasVerticalOffset&&aSe(r),r.constants.add("smallOffsetAngle","float",.984807753012208),r.code.add(w`struct ProjectHUDAux { +vec3 posModel; +vec3 posView; +vec3 vnormal; +float distanceToCamera; +float absCosAngle; +};`),r.code.add(w`float applyHUDViewDependentPolygonOffset(float pointGroundDistance, float absCosAngle, inout vec3 posView) { +float pointGroundSign = sign(pointGroundDistance); +if (pointGroundSign == 0.0) { +pointGroundSign = cameraGroundRelative; +} +float groundRelative = cameraGroundRelative * pointGroundSign; +if (polygonOffset > .0) { +float cosAlpha = clamp(absCosAngle, 0.01, 1.0); +float tanAlpha = sqrt(1.0 - cosAlpha * cosAlpha) / cosAlpha; +float factor = (1.0 - tanAlpha / viewport[2]); +if (groundRelative > 0.0) { +posView *= factor; +} +else { +posView /= factor; +} +} +return groundRelative; +}`),e.draped&&!e.hasVerticalOffset||jS(r),e.draped||(r.uniforms.add(new Ce("perDistancePixelRatio",(i,n)=>Math.tan(n.camera.fovY/2)/(n.camera.fullViewport[2]/2))),r.code.add(w`void applyHUDVerticalGroundOffset(vec3 normalModel, inout vec3 posModel, inout vec3 posView) { +float distanceToCamera = length(posView); +float pixelOffset = distanceToCamera * perDistancePixelRatio * 0.5; +vec3 modelOffset = normalModel * cameraGroundRelative * pixelOffset; +vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz; +posModel += modelOffset; +posView += viewOffset; +}`)),e.screenCenterOffsetUnitsEnabled===Tl.Screen&&LE(r,e),e.hasScreenSizePerspective&&w8(r),r.code.add(w` + vec4 projectPositionHUD(out ProjectHUDAux aux) { + // centerOffset is in view space and is used to implement world size offsetting + // of labels with respect to objects. It also pulls the label towards the viewer + // so that the label is visible in front of the object. + vec3 centerOffset = auxpos1.xyz; + + // The pointGroundDistance is the distance of the geometry to the ground and is + // negative if the point is below the ground, or positive if the point is above + // ground. + float pointGroundDistance = auxpos1.w; + + aux.posModel = position; + aux.posView = (view * vec4(aux.posModel, 1.0)).xyz; + aux.vnormal = normal; + ${e.draped?"":"applyHUDVerticalGroundOffset(aux.vnormal, aux.posModel, aux.posView);"} + + // Screen sized offset in world space, used for example for line callouts + // Note: keep this implementation in sync with the CPU implementation, see + // - MaterialUtil.verticalOffsetAtDistance + // - HUDMaterial.applyVerticalOffsetTransformation + + aux.distanceToCamera = length(aux.posView); + + vec3 viewDirObjSpace = normalize(cameraPosition - aux.posModel); + float cosAngle = dot(aux.vnormal, viewDirObjSpace); + + aux.absCosAngle = abs(cosAngle); + + ${e.hasScreenSizePerspective&&(e.hasVerticalOffset||e.screenCenterOffsetUnitsEnabled===Tl.Screen)?"vec4 perspectiveFactor = screenSizePerspectiveScaleFactor(aux.absCosAngle, aux.distanceToCamera, screenSizePerspectiveAlignment);":""} + + ${e.hasVerticalOffset?e.hasScreenSizePerspective?"float verticalOffsetScreenHeight = applyScreenSizePerspectiveScaleFactorFloat(verticalOffset.x, perspectiveFactor);":"float verticalOffsetScreenHeight = verticalOffset.x;":""} + + ${e.hasVerticalOffset?w` + float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * aux.distanceToCamera, verticalOffset.z, verticalOffset.w); + vec3 modelOffset = aux.vnormal * worldOffset; + aux.posModel += modelOffset; + vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz; + aux.posView += viewOffset; + // Since we elevate the object, we need to take that into account + // in the distance to ground + pointGroundDistance += worldOffset;`:""} + + float groundRelative = applyHUDViewDependentPolygonOffset(pointGroundDistance, aux.absCosAngle, aux.posView); + + ${e.screenCenterOffsetUnitsEnabled!==Tl.Screen?w` + // Apply x/y in view space, but z in screen space (i.e. along posView direction) + aux.posView += vec3(centerOffset.x, centerOffset.y, 0.0); + + // Same material all have same z != 0.0 condition so should not lead to + // branch fragmentation and will save a normalization if it's not needed + if (centerOffset.z != 0.0) { + aux.posView -= normalize(aux.posView) * centerOffset.z; + } + `:""} + + vec4 posProj = proj * vec4(aux.posView, 1.0); + + ${e.screenCenterOffsetUnitsEnabled===Tl.Screen?e.hasScreenSizePerspective?"float centerOffsetY = applyScreenSizePerspectiveScaleFactorFloat(centerOffset.y, perspectiveFactor);":"float centerOffsetY = centerOffset.y;":""} + + ${e.screenCenterOffsetUnitsEnabled===Tl.Screen?"posProj.xy += vec2(centerOffset.x, centerOffsetY) * pixelRatio * 2.0 / viewport.zw * posProj.w;":""} + + // constant part of polygon offset emulation + posProj.z -= groundRelative * polygonOffset * posProj.w; + return posProj; + } + `),r.include(x8),r.code.add(w`bool testVisibilityHUD(vec4 posProj) { +vec4 posProjCenter = alignToPixelCenter(posProj, viewport.zw); +vec4 occlusionPixel = texture(hudVisibilityTexture, .5 + .5 * posProjCenter.xy / posProjCenter.w); +if (renderTransparentlyOccludedHUD > 0.5) { +return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g * renderTransparentlyOccludedHUD < 1.0; +} +return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g == 1.0; +}`)}(function(t){t[t.World=0]="World",t[t.Screen=1]="Screen",t[t.COUNT=2]="COUNT"})(Tl||(Tl={}));const eI=ps();function cSe(t,e,r,i,n,s){if(t.visible)if(t.boundingInfo){Je(t.type===on.Mesh);const o=e.tolerance;uSe(t.boundingInfo,r,i,o,n,s)}else{const o=t.indices.get(E.POSITION),a=t.vertexAttributes.get(E.POSITION);BP(r,i,0,o.length/3,o,a,void 0,n,s)}}const Tet=O();function uSe(t,e,r,i,n,s){if(t==null)return;const o=dSe(e,r,Tet);if(C1e(eI,t.bbMin),A1e(eI,t.bbMax),n!=null&&n.applyToAabb(eI),QQ(eI,e,o,i)){const{primitiveIndices:a,indices:l,position:c}=t,u=a?a.length:l.length/3;if(u>Oet){const d=t.getChildren();if(d!==void 0){for(const p of d)uSe(p,e,r,i,n,s);return}}BP(e,r,0,u,l,c,a,n,s)}}const hSe=O();function BP(t,e,r,i,n,s,o,a,l){if(o)return Eet(t,e,r,i,n,s,o,a,l);const{data:c,stride:u}=s,d=t[0],p=t[1],m=t[2],y=e[0]-d,_=e[1]-p,v=e[2]-m;for(let b=r,x=3*r;b0){if(Ke<0||Ke>Z)continue}else if(Ke>0||Ke0){if(Fe<0||Ke+Fe>Z)continue}else if(Fe>0||Ke+Fe=0&&l(pe,ZQ(X,q,G,Q,M,I,hSe),b,!1)}}function Eet(t,e,r,i,n,s,o,a,l){const{data:c,stride:u}=s,d=t[0],p=t[1],m=t[2],y=e[0]-d,_=e[1]-p,v=e[2]-m;for(let b=r;b0){if(_t<0||_t>K)continue}else if(_t>0||_t0){if(pe<0||_t+pe>K)continue}else if(pe>0||_t+pe=0&&l(xt,ZQ(q,G,Q,M,I,L,hSe),x,!1)}}const moe=O(),goe=O();function ZQ(t,e,r,i,n,s,o){return ne(moe,t,e,r),ne(goe,i,n,s),ot(o,moe,goe),me(o,o),o}function dSe(t,e,r){return ne(r,1/(e[0]-t[0]),1/(e[1]-t[1]),1/(e[2]-t[2]))}function QQ(t,e,r,i){return JQ(t,e,r,i,1/0)}function JQ(t,e,r,i,n){const s=(t[0]-i-e[0])*r[0],o=(t[3]+i-e[0])*r[0];let a=Math.min(s,o),l=Math.max(s,o);const c=(t[1]-i-e[1])*r[1],u=(t[4]+i-e[1])*r[1];if(l=Math.min(l,Math.max(c,u)),l<0||(a=Math.max(a,Math.min(c,u)),a>l))return!1;const d=(t[2]-i-e[2])*r[2],p=(t[5]+i-e[2])*r[2];return l=Math.min(l,Math.max(d,p)),!(l<0)&&(a=Math.max(a,Math.min(d,p)),!(a>l)&&ae.push(r)),e}const mSe={multiply:1,ignore:2,replace:3,tint:4},Oet=1e3;let p1=class extends FP{constructor(e,r){super(),this.type=on.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=fr,this._pp0=Se(0,0,1),this._pp1=Se(0,0,0),this._parameters=fSe(e,r),this.validateParameters(this._parameters)}dispose(){}get parameters(){return this._parameters}update(e){return!1}setParameters(e,r=!0){Cet(this._parameters,e)&&(this.validateParameters(this._parameters),r&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&(this.renderOccluded&e.renderOccludedMask)!=0}isVisibleForOutput(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){this.repository!=null&&this.repository.materialChanged(this)}intersectDraped(e,r,i,n,s,o){return this._pp0[0]=this._pp1[0]=n[0],this._pp0[1]=this._pp1[1]=n[1],this.intersect(e,r,i,this._pp0,this._pp1,s)}},gSe=class extends WXe{constructor(e,r,i){super(r,i),this.camera=e}};var Ri;(function(t){t[t.None=0]="None",t[t.Occlude=1]="Occlude",t[t.Transparent=2]="Transparent",t[t.OccludeAndTransparent=4]="OccludeAndTransparent",t[t.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",t[t.Opaque=16]="Opaque"})(Ri||(Ri={}));let KQ=class extends Wr{constructor(){super(...arguments),this.renderOccluded=Ri.Occlude}},ySe=class{constructor(){this.factor=new yoe,this.factorAlignment=new yoe}},yoe=class{constructor(){this.scale=0,this.factor=0,this.minPixelSize=0,this.paddingPixels=0}};function dIt(t,e,r,i,n=1){const s=r.typedBuffer,o=r.typedBufferStride,a=t.length;if(i*=o,n===1)for(let l=0;l{A=e[F]+x,C=e[F+1]+T,R=e[F+2]+S}:F=>{const k=e[F],V=e[F+1],z=e[F+2];A=c*k+p*V+_*z+x,C=u*k+m*V+v*z+T,R=d*k+y*V+b*z+S};if(s===1)for(let F=0;F{C=e[k],R=e[k+1],P=e[k+2]}:k=>{const V=e[k],z=e[k+1],X=e[k+2];C=u*V+m*z+v*X,R=d*V+y*z+b*X,P=p*V+_*z+x*X};if(s===1)if(T)for(let k=0;kS){const z=1/Math.sqrt(V);a[n]=C*z,a[n+1]=R*z,a[n+2]=P*z}else a[n]=C,a[n+1]=R,a[n+2]=P;n+=l}else for(let k=0;kS){const z=1/Math.sqrt(V);C*=z,R*=z,P*=z}}for(let V=0;VS){const Q=1/Math.sqrt(G);z*=Q,X*=Q,q*=Q}}a[n]=z,a[n+1]=X,a[n+2]=q,a[n+3]=V,n+=l}else for(let C=0;CS){const Q=1/Math.sqrt(G);z*=Q,X*=Q,q*=Q}}for(let G=0;GIr(`esri/libs/basisu/${e}`);S9=ce(()=>import("./basis_transcoder-bff818ce.js"),[]).then(e=>e.b).then(({default:e})=>e({locateFile:t}).then(r=>(r.initializeBasis(),delete r.then,r)))}return S9}let S9;var nb;(function(t){t[t.ETC1_RGB=0]="ETC1_RGB",t[t.ETC2_RGBA=1]="ETC2_RGBA",t[t.BC1_RGB=2]="BC1_RGB",t[t.BC3_RGBA=3]="BC3_RGBA",t[t.BC4_R=4]="BC4_R",t[t.BC5_RG=5]="BC5_RG",t[t.BC7_M6_RGB=6]="BC7_M6_RGB",t[t.BC7_M5_RGBA=7]="BC7_M5_RGBA",t[t.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",t[t.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",t[t.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",t[t.ATC_RGB=11]="ATC_RGB",t[t.ATC_RGBA=12]="ATC_RGBA",t[t.FXT1_RGB=17]="FXT1_RGB",t[t.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",t[t.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",t[t.ETC2_EAC_R11=20]="ETC2_EAC_R11",t[t.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",t[t.RGBA32=13]="RGBA32",t[t.RGB565=14]="RGB565",t[t.BGR565=15]="BGR565",t[t.RGBA4444=16]="RGBA4444"})(nb||(nb={}));let rp=null,tI=null;async function TSe(){return tI==null&&(tI=Det(),rp=await tI),tI}function Net(t,e){if(rp==null)return t.byteLength;const r=new rp.BasisFile(new Uint8Array(t)),i=ESe(r)?SSe(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),e):0;return r.close(),r.delete(),i}function Fet(t,e){if(rp==null)return t.byteLength;const r=new rp.KTX2File(new Uint8Array(t)),i=CSe(r)?SSe(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),e):0;return r.close(),r.delete(),i}function SSe(t,e,r,i,n){const s=WZ(e?un.COMPRESSED_RGBA8_ETC2_EAC:un.COMPRESSED_RGB8_ETC2),o=n&&t>1?(4**t-1)/(3*4**(t-1)):1;return Math.ceil(r*i*s*o)}function ESe(t){return t.getNumImages()>=1&&!t.isUASTC()}function CSe(t){return t.getFaces()>=1&&t.isETC1S()}async function Uet(t,e,r){rp==null&&(rp=await TSe());const i=new rp.BasisFile(new Uint8Array(r));if(!ESe(i))return null;i.startTranscoding();const n=ASe(t,e,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(s,o)=>i.getImageTranscodedSizeInBytes(0,s,o),(s,o,a)=>i.transcodeImage(a,0,s,o,0,0));return i.close(),i.delete(),n}async function ket(t,e,r){rp==null&&(rp=await TSe());const i=new rp.KTX2File(new Uint8Array(r));if(!CSe(i))return null;i.startTranscoding();const n=ASe(t,e,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(s,o)=>i.getImageTranscodedSizeInBytes(s,0,0,o),(s,o,a)=>i.transcodeImage(a,s,0,0,o,0,-1,-1));return i.close(),i.delete(),n}function ASe(t,e,r,i,n,s,o,a){const{compressedTextureETC:l,compressedTextureS3TC:c}=t.capabilities,[u,d]=l?i?[nb.ETC2_RGBA,un.COMPRESSED_RGBA8_ETC2_EAC]:[nb.ETC1_RGB,un.COMPRESSED_RGB8_ETC2]:c?i?[nb.BC3_RGBA,un.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[nb.BC1_RGB,un.COMPRESSED_RGB_S3TC_DXT1_EXT]:[nb.RGBA32,Tt.RGBA],p=e.hasMipmap?r:Math.min(1,r),m=[];for(let y=0;y1,e.samplingMode=e.hasMipmap?At.LINEAR_MIPMAP_LINEAR:At.LINEAR,e.width=n,e.height=s,new Ct(t,e,{type:"compressed",levels:m})}const rI=J.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil"),zet=542327876,Bet=131072,Vet=4;function iJ(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}function Get(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)}const jet=iJ("DXT1"),Het=iJ("DXT3"),Wet=iJ("DXT5"),qet=31,Xet=0,Yet=1,Zet=2,Qet=3,Jet=4,Ket=7,ett=20,ttt=21;function rtt(t,e,r){const i=itt(r,e.hasMipmap??!1);if(i==null)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:s,width:o,height:a}=i;return e.samplingMode=n.levels.length>1?At.LINEAR_MIPMAP_LINEAR:At.LINEAR,e.hasMipmap=n.levels.length>1,e.internalFormat=s,e.width=o,e.height=a,new Ct(t,e,n)}function itt(t,e){const r=new Int32Array(t,0,qet);if(r[Xet]!==zet)return rI.error("Invalid magic number in DDS header"),null;if(!(r[ett]&Vet))return rI.error("Unsupported format, must contain a FourCC code"),null;const i=r[ttt];let n,s;switch(i){case jet:n=8,s=un.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Het:n=16,s=un.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Wet:n=16,s=un.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return rI.error("Unsupported FourCC code:",Get(i)),null}let o=1,a=r[Jet],l=r[Qet];!(3&a)&&!(3&l)||(rI.warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,l=l+3&-4);const c=a,u=l;let d,p;r[Zet]&Bet&&e!==!1&&(o=Math.max(1,r[Ket]));let m=r[Yet]+4;const y=[];for(let _=0;_>2)*(l+3>>2)*n,d=new Uint8Array(t,m,p),y.push(d),m+=p,a=Math.max(1,a>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:y},internalFormat:s,width:c,height:u}}let Hw=class extends FP{constructor(e,r){super(),this._data=e,this.type=on.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new Bn,this.parameters=r||{},this.parameters.mipmap=this.parameters.mipmap!==!1,this.parameters.noUnpackFlip=this.parameters.noUnpackFlip||!1,this.parameters.preMultiplyAlpha=this.parameters.preMultiplyAlpha||!1,this.parameters.wrap=this.parameters.wrap||{s:Pt.REPEAT,t:Pt.REPEAT},this._startPreload(e)}_startPreload(e){e!=null&&(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!(KO(e.src)||e.preload==="auto"&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const r=!e.paused;if(e.src=e.src,r&&e.autoplay){const i=()=>{e.removeEventListener("canplay",i),e.play()};e.addEventListener("canplay",i)}}}_startPreloadImageElement(e){im(e.src)||KO(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}dispose(){this._data=void 0}_createDescriptor(e){const r=new pr;return r.wrapMode=this.parameters.wrap??Pt.REPEAT,r.flipped=!this.parameters.noUnpackFlip,r.samplingMode=this.parameters.mipmap?At.LINEAR_MIPMAP_LINEAR:At.LINEAR,r.hasMipmap=!!this.parameters.mipmap,r.preMultiplyAlpha=!!this.parameters.preMultiplyAlpha,r.maxAnisotropy=this.parameters.maxAnisotropy??(this.parameters.mipmap?e.parameters.maxMaxAnisotropy:1),r}get glTexture(){return this._glTexture}get memoryEstimate(){var e;return((e=this._glTexture)==null?void 0:e.gpuMemoryUsage)||ntt(this._data,this.parameters)}load(e){if(this._glTexture!=null)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const r=this._data;return r==null?(this._glTexture=new Ct(e,this._createDescriptor(e),null),this._glTexture):typeof r=="string"?this._loadFromURL(e,r):r instanceof Image?this._loadFromImageElement(e,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(e,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(e,r):(o3(r)||Jy(r))&&this.parameters.encoding===wg.DDS_ENCODING?(this._data=void 0,this._loadFromDDSData(e,r)):(o3(r)||Jy(r))&&this.parameters.encoding===wg.KTX2_ENCODING?(this._data=void 0,this._loadFromKTX2(e,r)):(o3(r)||Jy(r))&&this.parameters.encoding===wg.BASIS_ENCODING?(this._data=void 0,this._loadFromBasis(e,r)):Jy(r)?this._loadFromPixelData(e,r):o3(r)?this._loadFromPixelData(e,new Uint8Array(r)):null}get requiresFrameUpdates(){return this._data instanceof HTMLVideoElement}frameUpdate(e){return this._data instanceof HTMLVideoElement&&this._glTexture!=null?this._data.readyStateket(e,this._createDescriptor(e),r).then(i=>(this._glTexture=i,i)))}_loadFromBasis(e,r){return this._loadAsync(()=>Uet(e,this._createDescriptor(e),r).then(i=>(this._glTexture=i,i)))}_loadFromPixelData(e,r){Je(this.parameters.width>0&&this.parameters.height>0);const i=this._createDescriptor(e);return i.pixelFormat=this.parameters.components===1?Tt.LUMINANCE:this.parameters.components===3?Tt.RGB:Tt.RGBA,i.width=this.parameters.width??0,i.height=this.parameters.height??0,this._glTexture=new Ct(e,i,r),this._glTexture}_loadFromURL(e,r){return this._loadAsync(async i=>{const n=await qg(r,{signal:i});return Bt(i),this._loadFromImage(e,n)})}_loadFromImageElement(e,r){return r.complete?this._loadFromImage(e,r):this._loadAsync(async i=>{const n=await N0e(r,r.src,!1,i);return Bt(i),this._loadFromImage(e,n)})}_loadFromVideoElement(e,r){return r.readyState>=uO.HAVE_CURRENT_DATA?this._loadFromImage(e,r):this._loadFromVideoElementAsync(e,r)}_loadFromVideoElementAsync(e,r){return this._loadAsync(i=>new Promise((n,s)=>{const o=()=>{r.removeEventListener("loadeddata",a),r.removeEventListener("error",l),Pi(c)},a=()=>{r.readyState>=uO.HAVE_CURRENT_DATA&&(o(),n(this._loadFromImage(e,r)))},l=u=>{o(),s(u||new Y("Failed to load video"))};r.addEventListener("loadeddata",a),r.addEventListener("error",l);const c=pa(i,()=>l(wr()))}))}_loadFromImage(e,r){const i=OSe(r);this.parameters.width=i.width,this.parameters.height=i.height;const n=this._createDescriptor(e);return n.pixelFormat=this.parameters.components===3?Tt.RGB:Tt.RGBA,n.width=i.width,n.height=i.height,this._glTexture=new Ct(e,n,r),this._glTexture}_loadAsync(e){const r=new AbortController;this._loadingController=r;const i=e(r.signal);this._loadingPromise=i;const n=()=>{this._loadingController===r&&(this._loadingController=null),this._loadingPromise===i&&(this._loadingPromise=null)};return i.then(n,n),i}unload(){if(this._glTexture=Le(this._glTexture),this._loadingController!=null){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}};function ntt(t,e){if(t==null)return 0;if(o3(t)||Jy(t))return e.encoding===wg.KTX2_ENCODING?Fet(t,!!e.mipmap):e.encoding===wg.BASIS_ENCODING?Net(t,!!e.mipmap):t.byteLength;const{width:r,height:i}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?OSe(t):e;return(e.mipmap?4/3:1)*r*i*(e.components||4)||0}function OSe(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}var uO;(function(t){t[t.HAVE_NOTHING=0]="HAVE_NOTHING",t[t.HAVE_METADATA=1]="HAVE_METADATA",t[t.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",t[t.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",t[t.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"})(uO||(uO={}));const IR=128,nJ=.5;function stt(t,e=IR,r=e*nJ,i=0){const n=RSe(t,e,r,i);return new Hw(n,{mipmap:!1,wrap:{s:Pt.CLAMP_TO_EDGE,t:Pt.CLAMP_TO_EDGE},width:e,height:e,components:4,noUnpackFlip:!0})}function RSe(t,e=IR,r=e*nJ,i=0){switch(t){case"circle":default:return ott(e,r);case"square":return att(e,r);case"cross":return ctt(e,r,i);case"x":return utt(e,r,i);case"kite":return ltt(e,r);case"triangle":return htt(e,r);case"arrow":return dtt(e,r)}}function ott(t,e){const r=t/2-.5;return VP(t,$Se(r,r,e/2))}function att(t,e){return PSe(t,e,!1)}function ltt(t,e){return PSe(t,e,!0)}function ctt(t,e,r=0){return MSe(t,e,!1,r)}function utt(t,e,r=0){return MSe(t,e,!0,r)}function htt(t,e){return VP(t,ISe(t/2,e,e/2))}function dtt(t,e){const r=e,i=e/2,n=t/2,s=.8*r,o=$Se(n,(t-e)/2-s,Math.sqrt(s*s+i*i)),a=ISe(n,r,i);return VP(t,(l,c)=>Math.max(a(l,c),-o(l,c)))}function PSe(t,e,r){return r&&(e/=Math.SQRT2),VP(t,(i,n)=>{let s=i-.5*t+.25,o=.5*t-n-.75;if(r){const a=(s+o)/Math.SQRT2;o=(o-s)/Math.SQRT2,s=a}return Math.max(Math.abs(s),Math.abs(o))-.5*e})}function MSe(t,e,r,i=0){e-=i,r&&(e*=Math.SQRT2);const n=.5*e;return VP(t,(s,o)=>{let a,l=s-.5*t,c=.5*t-o-1;if(r){const u=(l+c)/Math.SQRT2;c=(c-l)/Math.SQRT2,l=u}return l=Math.abs(l),c=Math.abs(c),a=l>c?l>n?Math.sqrt((l-n)*(l-n)+c*c):c:c>n?Math.sqrt(l*l+(c-n)*(c-n)):l,a-=i/2,a})}function $Se(t,e,r){return(i,n)=>{const s=i-t,o=n-e;return Math.sqrt(s*s+o*o)-r}}function ISe(t,e,r){const i=Math.sqrt(e*e+r*r);return(n,s)=>{const o=Math.abs(n-t)-r,a=s-t+e/2+.75,l=(e*o+r*a)/i,c=-a;return Math.max(l,c)}}function VP(t,e){const r=new Uint8Array(4*t*t);for(let i=0;iUSe(e,r,i)),new Lt("slicePlaneBasis1",(r,i)=>{var n;return P5(e,r,i,(n=i.slicePlane)==null?void 0:n.basis1)}),new Lt("slicePlaneBasis2",(r,i)=>{var n;return P5(e,r,i,(n=i.slicePlane)==null?void 0:n.basis2)}))}function fn(t,e){LSe(t,e,new pu("slicePlaneOrigin",(r,i)=>USe(e,r,i)),new pu("slicePlaneBasis1",(r,i)=>{var n;return P5(e,r,i,(n=i.slicePlane)==null?void 0:n.basis1)}),new pu("slicePlaneBasis2",(r,i)=>{var n;return P5(e,r,i,(n=i.slicePlane)==null?void 0:n.basis2)}))}function LSe(t,e,...r){if(!e.hasSlicePlane){const o=w`#define rejectBySlice(_pos_) false +#define discardBySlice(_pos_) {} +#define highlightSlice(_color_, _pos_) (_color_)`;return e.hasSliceInVertexProgram&&t.vertex.code.add(o),void t.fragment.code.add(o)}e.hasSliceInVertexProgram&&t.vertex.uniforms.add(...r),t.fragment.uniforms.add(...r);const i=w`struct SliceFactors { +float front; +float side0; +float side1; +float side2; +float side3; +}; +SliceFactors calculateSliceFactors(vec3 pos) { +vec3 rel = pos - slicePlaneOrigin; +vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2); +float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin); +float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1); +float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2); +float basis1Dot = dot(slicePlaneBasis1, rel); +float basis2Dot = dot(slicePlaneBasis2, rel); +return SliceFactors( +dot(slicePlaneNormal, pos) + slicePlaneW, +-basis1Dot - basis1Len2, +basis1Dot - basis1Len2, +-basis2Dot - basis2Len2, +basis2Dot - basis2Len2 +); +} +bool sliceByFactors(SliceFactors factors) { +return factors.front < 0.0 +&& factors.side0 < 0.0 +&& factors.side1 < 0.0 +&& factors.side2 < 0.0 +&& factors.side3 < 0.0; +} +bool sliceEnabled() { +return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0; +} +bool sliceByPlane(vec3 pos) { +return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos)); +} +#define rejectBySlice(_pos_) sliceByPlane(_pos_) +#define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`,n=w`vec4 applySliceHighlight(vec4 color, vec3 pos) { +SliceFactors factors = calculateSliceFactors(pos); +const float HIGHLIGHT_WIDTH = 1.0; +const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3); +factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front); +factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0); +factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1); +factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2); +factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3); +if (sliceByFactors(factors)) { +return color; +} +float highlightFactor = (1.0 - step(0.5, factors.front)) +* (1.0 - step(0.5, factors.side0)) +* (1.0 - step(0.5, factors.side1)) +* (1.0 - step(0.5, factors.side2)) +* (1.0 - step(0.5, factors.side3)); +return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a); +}`,s=e.hasSliceHighlight?w` + ${n} + #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_)) + `:w`#define highlightSlice(_color_, _pos_) (_color_)`;e.hasSliceInVertexProgram&&t.vertex.code.add(i),t.fragment.code.add(i),t.fragment.code.add(s)}function DSe(t,e,r){return t.instancedDoublePrecision?ne(ftt,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):e.slicePlaneLocalOrigin}function NSe(t,e){return t!=null?ae(M5,e.origin,t):e.origin}function FSe(t,e,r){return t.hasSliceTranslatedView?e!=null?Ml(mtt,r.camera.viewMatrix,e):r.camera.viewMatrix:null}function USe(t,e,r){if(r.slicePlane==null)return Zs;const i=DSe(t,e,r),n=NSe(i,r.slicePlane),s=FSe(t,i,r);return s!=null?De(M5,n,s):n}function P5(t,e,r,i){if(i==null||r.slicePlane==null)return Zs;const n=DSe(t,e,r),s=NSe(n,r.slicePlane),o=FSe(t,n,r);return o!=null?(oe(TC,i,s),De(M5,s,o),De(TC,TC,o),ae(TC,TC,M5)):i}const ftt=O(),M5=O(),TC=O(),mtt=_e();function GP(t,e){const r=e.output===D.ObjectAndLayerIdColor,i=e.objectAndLayerIdColorInstanced;r&&(t.varyings.add("objectAndLayerIdColorVarying","vec4"),i?t.attributes.add(E.INSTANCEOBJECTANDLAYERIDCOLOR,"vec4"):t.attributes.add(E.OBJECTANDLAYERIDCOLOR,"vec4")),t.vertex.code.add(w` + void forwardObjectAndLayerIdColor() { + ${r?i?w`objectAndLayerIdColorVarying = instanceObjectAndLayerIdColor * 0.003921568627451;`:w`objectAndLayerIdColorVarying = objectAndLayerIdColor * 0.003921568627451;`:w``} }`),t.fragment.code.add(w` + void outputObjectAndLayerIdColor() { + ${r?w`fragColor = objectAndLayerIdColorVarying;`:w``} }`)}function gtt(t,e){const{vertex:r,fragment:i}=t;r.include(x8),e.hasMultipassGeometry&&r.include(Nxe),e.hasMultipassTerrain&&t.varyings.add("depth","float"),r.code.add(w` + void main(void) { + vec4 posProjCenter; + if (dot(position, position) > 0.0) { + // Render single point to center of the pixel to avoid subpixel + // filtering to affect the marker color + ProjectHUDAux projectAux; + vec4 posProj = projectPositionHUD(projectAux); + posProjCenter = alignToPixelCenter(posProj, viewport.zw); + + ${e.hasMultipassGeometry?w` + // Don't draw vertices behind geometry + if(geometryDepthTest(.5 + .5 * posProjCenter.xy / posProjCenter.w, projectAux.posView.z)){ + posProjCenter = vec4(1e038, 1e038, 1e038, 1.0); + }`:""} + + ${e.hasMultipassTerrain?"depth = projectAux.posView.z;":""} + vec3 vpos = projectAux.posModel; + if (rejectBySlice(vpos)) { + // Project out of clip space + posProjCenter = vec4(1e038, 1e038, 1e038, 1.0); + } + + } else { + // Project out of clip space + posProjCenter = vec4(1e038, 1e038, 1e038, 1.0); + } + + gl_Position = posProjCenter; + gl_PointSize = 1.0; + } + `),e.hasMultipassTerrain&&i.include(wu),e.hasMultipassTerrain&&i.uniforms.add(new Ye("terrainDepthTexture",(n,s)=>s.multipassTerrain.linearDepthTexture),new yr("nearFar",(n,s)=>s.camera.nearFar)),i.include(Pc),i.code.add(w` + void main() { + fragColor = vec4(1); + ${e.hasMultipassTerrain?w` + // Read the rgba data from the texture linear depth + vec4 terrainDepthData = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0); + + float terrainDepth = linearDepthFromFloat(rgba2float(terrainDepthData), nearFar); + + // If HUD vertex is behind terrain and the terrain depth is not the initialize value (e.g. we are not looking at the sky) + // Mark the HUD vertex as occluded by transparent terrain + if(depth < terrainDepth && terrainDepthData != vec4(0,0,0,1)){ + fragColor.g = 0.5; + }`:""} + } + `)}const ytt=$t(1,1,0,1),kSe=$t(1,0,1,1);function c0(t){t.fragment.uniforms.add(new Ye("depthTexture",(e,r)=>r.highlightDepthTexture)),t.fragment.constants.add("occludedHighlightFlag","vec4",ytt).add("unoccludedHighlightFlag","vec4",kSe),t.fragment.code.add(w`void outputHighlight() { +float sceneDepth = float(texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x); +if (gl_FragCoord.z > sceneDepth + 5e-7) { +fragColor = occludedHighlightFlag; +} else { +fragColor = unoccludedHighlightFlag; +} +}`)}let zSe=class extends ln{constructor(e,r,i){super(e,"vec4",jr.Pass,(n,s,o)=>n.setUniform4fv(e,r(s,o)),i)}},Sl=class extends ln{constructor(e,r,i){super(e,"float",jr.Pass,(n,s,o)=>n.setUniform1fv(e,r(s,o)),i)}};const WS={unknown:1,inches:fo(1,"meters","inches"),feet:fo(1,"meters","feet"),"us-feet":fo(1,"meters","us-feet"),yards:fo(1,"meters","yards"),miles:fo(1,"meters","miles"),"nautical-miles":fo(1,"meters","nautical-miles"),millimeters:fo(1,"meters","millimeters"),centimeters:fo(1,"meters","centimeters"),decimeters:fo(1,"meters","decimeters"),meters:fo(1,"meters","meters"),kilometers:fo(1,"meters","kilometers"),"decimal-degrees":1/m5e(1,"meters",Kt.radius)};var aa,boe;(function(t){t[t.Undefined=0]="Undefined",t[t.DefinedSize=1]="DefinedSize",t[t.DefinedScale=2]="DefinedScale"})(aa||(aa={})),function(t){t[t.Undefined=0]="Undefined",t[t.DefinedAngle=1]="DefinedAngle"}(boe||(boe={}));let sJ=class{constructor(e){this.field=e}},_tt=class extends sJ{constructor(e){super(e),this.minSize=[0,0,0],this.maxSize=[0,0,0],this.offset=[0,0,0],this.factor=[0,0,0],this.type=[aa.Undefined,aa.Undefined,aa.Undefined]}},vtt=class extends sJ{constructor(e){super(e),this.colors=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.values=[0,0,0,0,0,0,0,0]}},btt=class extends sJ{constructor(e){super(e),this.values=[0,0,0,0,0,0,0,0],this.opacityValues=[0,0,0,0,0,0,0,0]}},wtt=class{};function SC(t){return t!=null}function gx(t){return typeof t=="number"}function T8(t){return typeof t=="string"}function xtt(t){return t==null||T8(t)}function os(t,e){t&&t.push(e)}function Ttt(t,e,r,i=_e()){const n=t||0,s=e||0,o=r||0;return n!==0&&AS(i,i,-n/180*Math.PI),s!==0&&CS(i,i,s/180*Math.PI),o!==0&&M6(i,i,o/180*Math.PI),i}function $0(t,e,r,i,n){const s=t.minSize,o=t.maxSize;if(t.expression)return os(n,"Could not convert size info: expression not supported"),!1;if(t.useSymbolValue){const a=i.symbolSize[r];return e.minSize[r]=a,e.maxSize[r]=a,e.offset[r]=e.minSize[r],e.factor[r]=0,e.type[r]=aa.DefinedSize,!0}if(SC(t.field))return SC(t.stops)?t.stops.length===2&&gx(t.stops[0].size)&&gx(t.stops[1].size)?(woe(t.stops[0].size,t.stops[1].size,t.stops[0].value,t.stops[1].value,e,r),e.type[r]=aa.DefinedSize,!0):(os(n,"Could not convert size info: stops only supported with 2 elements"),!1):gx(s)&&gx(o)&&SC(t.minDataValue)&&SC(t.maxDataValue)?(woe(s,o,t.minDataValue,t.maxDataValue,e,r),e.type[r]=aa.DefinedSize,!0):t.valueUnit==="unknown"?(os(n,"Could not convert size info: proportional size not supported"),!1):WS[t.valueUnit]!=null?(e.minSize[r]=-1/0,e.maxSize[r]=1/0,e.offset[r]=0,e.factor[r]=1/WS[t.valueUnit],e.type[r]=aa.DefinedSize,!0):(os(n,"Could not convert size info: scale-dependent size not supported"),!1);if(!SC(t.field)){if(t.stops&&t.stops[0]&&gx(t.stops[0].size))return e.minSize[r]=t.stops[0].size,e.maxSize[r]=t.stops[0].size,e.offset[r]=e.minSize[r],e.factor[r]=0,e.type[r]=aa.DefinedSize,!0;if(gx(s))return e.minSize[r]=s,e.maxSize[r]=s,e.offset[r]=s,e.factor[r]=0,e.type[r]=aa.DefinedSize,!0}return os(n,"Could not convert size info: unsupported variant of sizeInfo"),!1}function woe(t,e,r,i,n,s){const o=Math.abs(i-r)>0?(e-t)/(i-r):0;n.minSize[s]=o>0?t:e,n.maxSize[s]=o>0?e:t,n.offset[s]=t-r*o,n.factor[s]=o}function Stt(t,e,r,i){if(t.normalizationField||t.valueRepresentation)return os(i,"Could not convert size info: unsupported property"),null;if(!xtt(t.field))return os(i,"Could not convert size info: field is not a string"),null;if(e.size){if(t.field)if(e.size.field){if(t.field!==e.size.field)return os(i,"Could not convert size info: multiple fields in use"),null}else e.size.field=t.field}else e.size=new _tt(t.field);let n;switch(t.axis){case"width":return n=$0(t,e.size,0,r,i),n?e:null;case"height":return n=$0(t,e.size,2,r,i),n?e:null;case"depth":return n=$0(t,e.size,1,r,i),n?e:null;case"width-and-depth":return n=$0(t,e.size,0,r,i),n&&$0(t,e.size,1,r,i),n?e:null;case null:case void 0:case"all":return n=$0(t,e.size,0,r,i),n=n&&$0(t,e.size,1,r,i),n=n&&$0(t,e.size,2,r,i),n?e:null;default:return os(i,`Could not convert size info: unknown axis "${t.axis}""`),null}}function Ett(t,e,r){for(let n=0;n<3;++n){let s=e.unitInMeters;t.type[n]===aa.DefinedSize&&(s*=e.modelSize[n],t.type[n]=aa.DefinedScale),t.minSize[n]=t.minSize[n]/s,t.maxSize[n]=t.maxSize[n]/s,t.offset[n]=t.offset[n]/s,t.factor[n]=t.factor[n]/s}let i;if(t.type[0]!==aa.Undefined)i=0;else if(t.type[1]!==aa.Undefined)i=1;else{if(t.type[2]===aa.Undefined)return os(r,"No size axis contains a valid size or scale"),!1;i=2}for(let n=0;n<3;++n)t.type[n]===aa.Undefined&&(t.minSize[n]=t.minSize[i],t.maxSize[n]=t.maxSize[i],t.offset[n]=t.offset[i],t.factor[n]=t.factor[i],t.type[n]=t.type[i]);return!0}function xoe(t,e,r){t[4*e]=r.r/255,t[4*e+1]=r.g/255,t[4*e+2]=r.b/255,t[4*e+3]=r.a}function Ctt(t,e,r){if(t.normalizationField)return os(r,"Could not convert color info: unsupported property"),null;if(T8(t.field)){if(!t.stops)return os(r,"Could not convert color info: missing stops or colors"),null;{if(t.stops.length>8)return os(r,"Could not convert color info: too many color stops"),null;e.color=new vtt(t.field);const i=t.stops;for(let n=0;n<8;++n){const s=i[Math.min(n,i.length-1)];e.color.values[n]=s.value,xoe(e.color.colors,n,s.color)}}}else{if(!(t.stops&&t.stops.length>=0))return os(r,"Could not convert color info: no field and no colors/stops"),null;{const i=t.stops&&t.stops.length>=0&&t.stops[0].color;e.color={field:null,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};for(let n=0;n<8;n++)e.color.values[n]=1/0,xoe(e.color.colors,n,i)}}return e}function Att(t,e,r){if(t.normalizationField)return os(r,"Could not convert opacity info: unsupported property"),null;if(T8(t.field)){if(!t.stops)return os(r,"Could not convert opacity info: missing stops or opacities"),null;{if(t.stops.length>8)return os(r,"Could not convert opacity info: too many opacity stops"),null;e.opacity=new btt(t.field);const i=t.stops;for(let n=0;n<8;++n){const s=i[Math.min(n,i.length-1)];e.opacity.values[n]=s.value,e.opacity.opacityValues[n]=s.opacity}}}else{if(!(t.stops&&t.stops.length>=0))return os(r,"Could not convert opacity info: no field and no opacities/stops"),null;{const i=t.stops&&t.stops.length>=0?t.stops[0].opacity:0;e.opacity={field:null,values:[0,0,0,0,0,0,0,0],opacityValues:[0,0,0,0,0,0,0,0]};for(let n=0;n<8;n++)e.opacity.values[n]=1/0,e.opacity.opacityValues[n]=i}}return e}function E9(t,e,r){const i=r===2&&t.rotationType==="arithmetic";e.offset[r]=i?90:0,e.factor[r]=i?-1:1,e.type[r]=1}function Ott(t,e,r){if(!T8(t.field))return os(r,"Could not convert rotation info: field is not a string"),null;if(e.rotation){if(t.field)if(e.rotation.field){if(t.field!==e.rotation.field)return os(r,"Could not convert rotation info: multiple fields in use"),null}else e.rotation.field=t.field}else e.rotation={field:t.field,offset:[0,0,0],factor:[1,1,1],type:[0,0,0]};switch(t.axis){case"tilt":return E9(t,e.rotation,0),e;case"roll":return E9(t,e.rotation,1),e;case null:case void 0:case"heading":return E9(t,e.rotation,2),e;default:return os(r,`Could not convert rotation info: unknown axis "${t.axis}""`),null}}let jP=class{constructor(e,r=[1,1,1],i=[1,1,1],n=1,s=[0,0,0],o=[1,1,1],a=[0,0,0]){this.supports=e,this.modelSize=r,this.symbolSize=i,this.unitInMeters=n,this.anchor=s,this.scale=o,this.rotation=a}};function BSe(t,e,r){if(!t)return null;const i=t.reduce((n,s)=>{if(!n)return n;if(s.valueExpression)return os(r,"Could not convert visual variables: arcade expressions not supported"),null;switch(s.type){case"size":return e.supports.size?Stt(s,n,e,r):n;case"color":return e.supports.color?Ctt(s,n,r):n;case"opacity":return e.supports.opacity?Att(s,n,r):null;case"rotation":return e.supports.rotation?Ott(s,n,r):n;default:return null}},new wtt);return!(t.length>0&&i)||i.size||i.color||i.opacity||i.rotation?i&&i.size&&!Ett(i.size,e,r)?null:i:null}let Rtt=class{constructor(e,r,i){this.visualVariables=e,this.materialParameters=r,this.requiresShaderTransformation=i}};function qS(t,e){if(!t||Kr.TESTS_DISABLE_FAST_UPDATES)return null;const r=BSe(t.visualVariables,e);return r?new Rtt(r,GSe(r,e),!!r.size):null}function XS(t,e,r){if(!e||!t)return!1;const i=t.visualVariables,n=BSe(e.visualVariables,r);return!!n&&!!(iI(i.size,n.size,"size")&&iI(i.color,n.color,"color")&&iI(i.rotation,n.rotation,"rotation")&&iI(i.opacity,n.opacity,"opacity"))&&(t.visualVariables=n,t.materialParameters=GSe(n,r),t.requiresShaderTransformation=!!n.size,!0)}function iI(t,e,r){if(!!t!=!!e||t&&t.field!==(e==null?void 0:e.field))return!1;if(t&&r==="rotation"){const i=t,n=e;for(let s=0;s<3;s++)if(i.type[s]!==n.type[s]||i.offset[s]!==n.offset[s]||i.factor[s]!==n.factor[s])return!1}return!0}let VSe=class extends Wr{constructor(e){super(),this.vvSize=(e==null?void 0:e.size)??null,this.vvColor=(e==null?void 0:e.color)??null,this.vvOpacity=(e==null?void 0:e.opacity)??null}};function GSe(t,e){const r=new VSe(t);return r.vvSize&&(r.vvSymbolAnchor=e.anchor,Nh(hO),Ttt(e.rotation[2],e.rotation[0],e.rotation[1],hO),r.vvSymbolRotationMatrix=r.vvSymbolRotationMatrix||hi(),Ac(r.vvSymbolRotationMatrix,hO)),r}function FH(t,e,r){if(!t.vvSize)return r;In(I0,r);const i=t.vvSymbolRotationMatrix;am(hO,i[0],i[1],i[2],0,i[3],i[4],i[5],0,i[6],i[7],i[8],0,0,0,0,1),Vr(I0,I0,hO);for(let n=0;n<3;++n){const s=t.vvSize.offset[n]+e[0]*t.vvSize.factor[n];Toe[n]=ge(s,t.vvSize.minSize[n],t.vvSize.maxSize[n])}return AP(I0,I0,Toe),Ml(I0,I0,t.vvSymbolAnchor),I0}function Ptt(t,e,r){if(e.vvSize)for(let i=0;i<3;++i){const n=e.vvSize.offset[i]+r[0]*e.vvSize.factor[i];t[i]=ge(n,e.vvSize.minSize[i],e.vvSize.maxSize[i])}else ne(t,1,1,1)}function ip(t,e){const r=t==null?0:e.attributes[t];return typeof r=="number"&&isFinite(r)?r:0}const I0=_e(),Toe=O(),hO=_e();let HP=class extends VSe{constructor(){super(...arguments),this.renderOccluded=Ri.Occlude}};const WT=8;function Tg(t,e){const{vertex:r,attributes:i}=t;e.hasVvInstancing&&(e.vvSize||e.vvColor)&&i.add(E.INSTANCEFEATUREATTRIBUTE,"vec4"),e.vvSize?(r.uniforms.add(new Lt("vvSizeMinSize",n=>n.vvSize.minSize)),r.uniforms.add(new Lt("vvSizeMaxSize",n=>n.vvSize.maxSize)),r.uniforms.add(new Lt("vvSizeOffset",n=>n.vvSize.offset)),r.uniforms.add(new Lt("vvSizeFactor",n=>n.vvSize.factor)),r.uniforms.add(new Gh("vvSymbolRotationMatrix",n=>n.vvSymbolRotationMatrix)),r.uniforms.add(new Lt("vvSymbolAnchor",n=>n.vvSymbolAnchor)),r.code.add(w`vec3 vvScale(vec4 _featureAttribute) { +return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize); +} +vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) { +return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0); +}`),r.code.add(w` + const float eps = 1.192092896e-07; + vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) { + vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize); + return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0); + } + + ${e.hasVvInstancing?w` + vec4 vvLocalNormal(vec3 _normal) { + return vvTransformNormal(_normal, instanceFeatureAttribute); + } + + vec4 localPosition() { + return vvTransformPosition(position, instanceFeatureAttribute); + }`:""} + `)):r.code.add(w`vec4 localPosition() { return vec4(position, 1.0); } +vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),e.vvColor?(r.constants.add("vvColorNumber","int",WT),r.uniforms.add(new Sl("vvColorValues",n=>n.vvColor.values,WT),new zSe("vvColorColors",n=>n.vvColor.colors,WT)),r.code.add(w` + vec4 interpolateVVColor(float value) { + if (value <= vvColorValues[0]) { + return vvColorColors[0]; + } + + for (int i = 1; i < vvColorNumber; ++i) { + if (vvColorValues[i] >= value) { + float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]); + return mix(vvColorColors[i-1], vvColorColors[i], f); + } + } + return vvColorColors[vvColorNumber - 1]; + } + + vec4 vvGetColor(vec4 featureAttribute) { + return interpolateVVColor(featureAttribute.y); + } + + ${e.hasVvInstancing?w` + vec4 vvColor() { + return vvGetColor(instanceFeatureAttribute); + }`:"vec4 vvColor() { return vec4(1.0); }"} + `)):r.code.add(w`vec4 vvColor() { return vec4(1.0); }`)}const $5=.1,vo=.001;function Mtt(t){const e=new mr,r=t.signedDistanceFieldEnabled;if(e.include(lSe,t),e.include(fn,t),t.occlusionPass)return e.include(gtt,t),e;const{vertex:i,fragment:n}=e;e.include(XQ),n.include(Pc),n.include(cm),e.include(Tg,t),e.include(GP,t),e.varyings.add("vcolor","vec4"),e.varyings.add("vtc","vec2"),e.varyings.add("vsize","vec2"),t.binaryHighlightOcclusionEnabled&&e.varyings.add("voccluded","float"),i.uniforms.add(new Jt("viewport",(c,u)=>u.camera.fullViewport),new yr("screenOffset",(c,u)=>er(jSe,2*c.screenOffset[0]*u.camera.pixelRatio,2*c.screenOffset[1]*u.camera.pixelRatio)),new yr("anchorPosition",c=>I5(c)),new Jt("materialColor",c=>c.color)),LE(i,t),r&&(i.uniforms.add(new Jt("outlineColor",c=>c.outlineColor)),n.uniforms.add(new Jt("outlineColor",c=>Soe(c)?c.outlineColor:Nf),new Ce("outlineSize",c=>Soe(c)?c.outlineSize:0))),t.hasScreenSizePerspective&&(_et(i),w8(i)),(t.debugDrawLabelBorder||t.binaryHighlightOcclusionEnabled)&&e.varyings.add("debugBorderCoords","vec4"),e.attributes.add(E.UV0,"vec2"),e.attributes.add(E.COLOR,"vec4"),e.attributes.add(E.SIZE,"vec2"),e.attributes.add(E.AUXPOS2,"vec4"),i.code.add(w` + void main(void) { + ProjectHUDAux projectAux; + vec4 posProj = projectPositionHUD(projectAux); + forwardObjectAndLayerIdColor(); + + if (rejectBySlice(projectAux.posModel)) { + // Project outside of clip plane + gl_Position = vec4(1e038, 1e038, 1e038, 1.0); + return; + } + vec2 inputSize; + ${t.hasScreenSizePerspective?w` + inputSize = screenSizePerspectiveScaleVec2(size, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspective); + vec2 screenOffsetScaled = screenSizePerspectiveScaleVec2(screenOffset, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment); + `:w` + inputSize = size; + vec2 screenOffsetScaled = screenOffset;`} + + ${t.vvSize?"inputSize *= vvScale(auxpos2).xx;":""} + + vec2 combinedSize = inputSize * pixelRatio; + vec4 quadOffset = vec4(0.0); + + ${t.occlusionTestEnabled||t.binaryHighlightOcclusionEnabled?"bool visible = testVisibilityHUD(posProj);":""} + + ${t.binaryHighlightOcclusionEnabled?"voccluded = visible ? 0.0 : 1.0;":""} + `);const s=w`vec2 uv01 = floor(uv0); +vec2 uv = uv0 - uv01; +quadOffset.xy = ((uv01 - anchorPosition) * 2.0 * combinedSize + screenOffsetScaled) / viewport.zw * posProj.w;`;t.pixelSnappingEnabled&&i.include(x8);const o=t.pixelSnappingEnabled?r?w`posProj = alignToPixelOrigin(posProj, viewport.zw) + quadOffset;`:w`posProj += quadOffset; +if (inputSize.x == size.x) { +posProj = alignToPixelOrigin(posProj, viewport.zw); +}`:w`posProj += quadOffset;`;i.code.add(w` + ${t.occlusionTestEnabled?"if (visible) {":""} + ${s} + ${t.vvColor?"vcolor = interpolateVVColor(auxpos2.y) * materialColor;":"vcolor = color / 255.0 * materialColor;"} + + ${t.output===D.ObjectAndLayerIdColor?w`vcolor.a = 1.0;`:""} + + bool alphaDiscard = vcolor.a < ${w.float(vo)}; + ${r?`alphaDiscard = alphaDiscard && outlineColor.a < ${w.float(vo)};`:""} + if (alphaDiscard) { + // "early discard" if both symbol color (= fill) and outline color (if applicable) are transparent + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } else { + ${o} + gl_Position = posProj; + } + + vtc = uv; + + ${t.debugDrawLabelBorder?"debugBorderCoords = vec4(uv01, 1.5 / combinedSize);":""} + vsize = inputSize; + ${t.occlusionTestEnabled?w`} else { vtc = vec2(0.0); + ${t.debugDrawLabelBorder?"debugBorderCoords = vec4(0.5, 0.5, 1.5 / combinedSize);}":"}"}`:""} + } + `),n.uniforms.add(new Ye("tex",c=>c.texture));const a=t.debugDrawLabelBorder?w`(isBorder > 0.0 ? 0.0 : ${w.float($5)})`:w.float($5),l=w` + ${t.debugDrawLabelBorder?w` + float isBorder = float(any(lessThan(debugBorderCoords.xy, debugBorderCoords.zw)) || any(greaterThan(debugBorderCoords.xy, 1.0 - debugBorderCoords.zw)));`:""} + + ${r?w` + vec4 fillPixelColor = vcolor; + + // Attempt to sample texel centers to avoid that thin cross outlines + // disappear with large symbol sizes. + // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/7058#issuecomment-603041 + const float txSize = ${w.float(IR)}; + const float texelSize = 1.0 / txSize; + // Calculate how much we have to add/subtract to/from each texel to reach the size of an onscreen pixel + vec2 scaleFactor = (vsize - txSize) * texelSize; + vec2 samplePos = vtc + (vec2(1.0, -1.0) * texelSize) * scaleFactor; + + // Get distance and map it into [-0.5, 0.5] + float d = rgba2float(texture(tex, samplePos)) - 0.5; + + // Distance in output units (i.e. pixels) + float dist = d * vsize.x; + + // Create smooth transition from the icon into its outline + float fillAlphaFactor = clamp(0.5 - dist, 0.0, 1.0); + fillPixelColor.a *= fillAlphaFactor; + + if (outlineSize > 0.25) { + vec4 outlinePixelColor = outlineColor; + float clampedOutlineSize = min(outlineSize, 0.5*vsize.x); + + // Create smooth transition around outline + float outlineAlphaFactor = clamp(0.5 - (abs(dist) - 0.5*clampedOutlineSize), 0.0, 1.0); + outlinePixelColor.a *= outlineAlphaFactor; + + if ( + outlineAlphaFactor + fillAlphaFactor < ${a} || + fillPixelColor.a + outlinePixelColor.a < ${w.float(vo)} + ) { + discard; + } + + // perform un-premultiplied over operator (see https://en.wikipedia.org/wiki/Alpha_compositing#Description) + float compositeAlpha = outlinePixelColor.a + fillPixelColor.a * (1.0 - outlinePixelColor.a); + vec3 compositeColor = vec3(outlinePixelColor) * outlinePixelColor.a + + vec3(fillPixelColor) * fillPixelColor.a * (1.0 - outlinePixelColor.a); + + fragColor = vec4(compositeColor, compositeAlpha); + } else { + if (fillAlphaFactor < ${a}) { + discard; + } + + fragColor = premultiplyAlpha(fillPixelColor); + } + + // visualize SDF: + // fragColor = vec4(clamp(-dist/vsize.x*2.0, 0.0, 1.0), clamp(dist/vsize.x*2.0, 0.0, 1.0), 0.0, 1.0); + `:w` + vec4 texColor = texture(tex, vtc, -0.5); + if (texColor.a < ${a}) { + discard; + } + fragColor = texColor * premultiplyAlpha(vcolor); + `} + + // Draw debug border with transparency, so that original texels along border are still partially visible + ${t.debugDrawLabelBorder?w`fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), isBorder * 0.5);`:""} + `;return t.output===D.Alpha&&n.code.add(w` + void main() { + ${l} + fragColor = vec4(fragColor.a); + } + `),t.output===D.ObjectAndLayerIdColor&&n.code.add(w` + void main() { + ${l} + outputObjectAndLayerIdColor(); + } + `),t.output===D.Color&&n.code.add(w` + void main() { + ${l} + ${t.transparencyPassType===rt.FrontFace?"fragColor.rgb /= fragColor.a;":""} + } + `),t.output===D.Highlight&&(e.include(c0,t),n.code.add(w` + void main() { + ${l} + ${t.binaryHighlightOcclusionEnabled?w` + if (voccluded == 1.0) { + fragColor = vec4(1.0, 1.0, 0.0, 1.0); + } else { + fragColor = vec4(1.0, 0.0, 1.0, 1.0); + }`:"outputHighlight();"} + } + `)),e}function Soe(t){return t.outlineColor[3]>0&&t.outlineSize>0}function I5(t,e=jSe){return t.textureIsSignedDistanceField?$tt(t.anchorPosition,t.distanceFieldBoundingBox,e):fs(e,t.anchorPosition),e}function $tt(t,e,r){e!=null?er(r,t[0]*(e[2]-e[0])+e[0],t[1]*(e[3]-e[1])+e[1]):er(r,0,0)}const jSe=Ne(),Itt=Object.freeze(Object.defineProperty({__proto__:null,build:Mtt,calculateAnchorPosForRendering:I5},Symbol.toStringTag,{value:"Module"})),fu=So(ve.SRC_ALPHA,ve.ONE,ve.ONE_MINUS_SRC_ALPHA,ve.ONE_MINUS_SRC_ALPHA),Ltt=Cc(ve.ONE,ve.ONE),HSe=Cc(ve.ZERO,ve.ONE_MINUS_SRC_ALPHA);function u0(t){return t===rt.FrontFace?null:t===rt.Alpha?HSe:Ltt}function S8(t){return t===rt.FrontFace?$l:null}const E8=5e5,C8={factor:-1,units:-2};function A8(t){return t?C8:null}function f1(t,e=Hr.LESS){return t===rt.NONE||t===rt.FrontFace?e:Hr.LEQUAL}let WSe=class qSe extends Tr{initializeConfiguration(e,r){r.spherical=e.viewingMode===$e.Global}initializeProgram(e){return new vr(e.rctx,qSe.shader.get().build(this.configuration),fr)}_setPipelineState(e){const r=this.configuration,i=e===rt.NONE,n=e===rt.FrontFace,s=this.configuration.hasPolygonOffset?Dtt:null,o=(i||n)&&r.output!==D.Highlight&&(r.depthEnabled||r.occlusionPass)?$l:null;return Ot({blending:r.output===D.Color||r.output===D.Alpha||r.output===D.Highlight?i?Ntt:u0(e):null,depthTest:{func:Hr.LEQUAL},depthWrite:o,colorWrite:Ft,polygonOffset:s})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}get primitiveType(){return this.configuration.occlusionPass?Et.POINTS:Et.TRIANGLES}};WSe.shader=new _r(Itt,()=>ce(()=>import("./HUDMaterial.glsl-6c800f3a.js"),[]));const Dtt={factor:0,units:-4},Ntt=Cc(ve.ONE,ve.ONE_MINUS_SRC_ALPHA);let Tn=class extends Fo{constructor(){super(...arguments),this.output=D.Color,this.screenCenterOffsetUnitsEnabled=Tl.World,this.transparencyPassType=rt.NONE,this.spherical=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.debugDrawLabelBorder=!1,this.binaryHighlightOcclusionEnabled=!0,this.hasSlicePlane=!1,this.hasPolygonOffset=!1,this.depthEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.hasMultipassGeometry=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.occlusionPass=!1,this.objectAndLayerIdColorInstanced=!1}};h([U({count:D.COUNT})],Tn.prototype,"output",void 0),h([U({count:Tl.COUNT})],Tn.prototype,"screenCenterOffsetUnitsEnabled",void 0),h([U({count:rt.COUNT})],Tn.prototype,"transparencyPassType",void 0),h([U()],Tn.prototype,"spherical",void 0),h([U()],Tn.prototype,"occlusionTestEnabled",void 0),h([U()],Tn.prototype,"signedDistanceFieldEnabled",void 0),h([U()],Tn.prototype,"vvSize",void 0),h([U()],Tn.prototype,"vvColor",void 0),h([U()],Tn.prototype,"hasVerticalOffset",void 0),h([U()],Tn.prototype,"hasScreenSizePerspective",void 0),h([U()],Tn.prototype,"debugDrawLabelBorder",void 0),h([U()],Tn.prototype,"binaryHighlightOcclusionEnabled",void 0),h([U()],Tn.prototype,"hasSlicePlane",void 0),h([U()],Tn.prototype,"hasPolygonOffset",void 0),h([U()],Tn.prototype,"depthEnabled",void 0),h([U()],Tn.prototype,"pixelSnappingEnabled",void 0),h([U()],Tn.prototype,"draped",void 0),h([U()],Tn.prototype,"hasMultipassGeometry",void 0),h([U()],Tn.prototype,"hasMultipassTerrain",void 0),h([U()],Tn.prototype,"cullAboveGround",void 0),h([U()],Tn.prototype,"occlusionPass",void 0),h([U()],Tn.prototype,"objectAndLayerIdColorInstanced",void 0),h([U({constValue:!0})],Tn.prototype,"hasSliceInVertexProgram",void 0),h([U({constValue:!1})],Tn.prototype,"hasVvInstancing",void 0);let YS=class extends p1{constructor(e){super(e,new Wtt),this._configuration=new Tn}getConfiguration(e,r){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled=this.parameters.centerOffsetUnits==="screen"?Tl.Screen:Tl.World,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.isDraped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=r.slot===le.OCCLUSION_PIXELS&&this.parameters.occlusionTest&&(e===D.Color||e===D.Alpha),e===D.Color&&(this._configuration.debugDrawLabelBorder=!!Kr.LABELS_SHOW_BORDER),e===D.Highlight&&(this._configuration.binaryHighlightOcclusionEnabled=this.parameters.binaryHighlightOcclusion),this._configuration.depthEnabled=this.parameters.depthEnabled,this._configuration.transparencyPassType=r.transparencyPassType,this._configuration.hasMultipassGeometry=r.multipassGeometry.enabled,this._configuration.hasMultipassTerrain=r.multipassTerrain.enabled,this._configuration.cullAboveGround=r.multipassTerrain.cullAboveGround,this._configuration}intersect(e,r,i,n,s,o){if(!i.options.selectionMode||!i.options.hud||!e.visible)return;const a=this.parameters;let l=1,c=1;if(Ac(A9,r),e.shaderTransformer!=null){const x=e.shaderTransformer(Aoe);l=x[0],c=x[5],ktt(A9)}const u=e.vertexAttributes.get(E.POSITION),d=e.vertexAttributes.get(E.SIZE),p=e.vertexAttributes.get(E.NORMAL),m=e.vertexAttributes.get(E.AUXPOS1);Je(u.size>=3);const y=i.point,_=i.camera,v=I5(a);l*=_.pixelRatio,c*=_.pixelRatio;const b=this.parameters.centerOffsetUnits==="screen";for(let x=0;x-1){Ca[0]=Math.floor(Ca[0]),Ca[1]=Math.floor(Ca[1]),b&&(Lc[0]||Lc[1])&&(Ca[0]+=Lc[0],Lc[1]!==0&&(Ca[1]+=qQ(Lc[1],C9.factorAlignment)),_.unapplyProjection(Ca,Zo)),Ca[0]+=this.parameters.screenOffset[0],Ca[1]+=this.parameters.screenOffset[1],KTe(L0,C9.factor,L0);const R=Gtt*_.pixelRatio;let P=0;if(a.textureIsSignedDistanceField&&(P=a.outlineSize*_.pixelRatio/2),y&&Eoe(y,Ca[0],Ca[1],L0,R,P,a,v)){const F=i.ray;if(De(Coe,Zo,us(Vtt,_.viewMatrix)),Ca[0]=y[0],Ca[1]=y[1],_.unprojectFromRenderScreen(Ca,Zo)){const k=O();re(k,F.direction);const V=1/Te(k);te(k,k,V),o(ci(F.origin,Zo)*V,k,-1,!0,1,Coe)}}}}}intersectDraped(e,r,i,n,s,o){const a=e.vertexAttributes.get(E.POSITION),l=e.vertexAttributes.get(E.SIZE),c=this.parameters,u=I5(c);let d=1,p=1;if(e.shaderTransformer!=null){const y=e.shaderTransformer(Aoe);d=y[0],p=y[5]}d*=e.screenToWorldRatio,p*=e.screenToWorldRatio;const m=jtt*e.screenToWorldRatio;for(let y=0;y0?u:1/u),s}_applyVerticalGroundOffsetView(e,r,i,n){const s=Te(e),o=i.aboveGround?1:-1,a=.5*i.computeRenderPixelSizeAtDist(s),l=te(Zo,r.normal,o*a);return oe(n,e,l),n}_applyVerticalOffsetTransformationView(e,r,i,n){const s=this.parameters;if(!s.verticalOffset||!s.verticalOffset.screenLength){if(s.screenSizePerspective||s.screenSizePerspectiveAlignment){const c=Te(e);this._updateScaleInfo(n,c,r.cosAngle)}else n.factor.scale=1,n.factorAlignment.scale=1;return e}const o=Te(e),a=s.screenSizePerspectiveAlignment??s.screenSizePerspective,l=pSe(i,o,s.verticalOffset,r.cosAngle,a);return this._updateScaleInfo(n,o,r.cosAngle),te(r.normal,r.normal,l),oe(e,e,r.normal)}_applyCenterOffsetView(e,r,i){const n=this.parameters.centerOffsetUnits!=="screen";return i!==e&&re(i,e),n&&(i[0]+=r[0],i[1]+=r[1],r[2]&&(me(EC,i),oe(i,i,te(EC,EC,r[2])))),i}_applyCenterOffsetNDC(e,r,i,n){const s=this.parameters.centerOffsetUnits!=="screen";return n!==e&&re(n,e),s||(n[0]+=r[0]/i.fullWidth*2,n[1]+=r[1]/i.fullHeight*2),n}_applyPolygonOffsetNDC(e,r,i,n){const s=this.parameters.shaderPolygonOffset;if(e!==n&&re(n,e),s){const o=i.aboveGround?1:-1,a=o*Math.sign(r[3]);n[2]-=(a||o)*s}return n}requiresSlot(e,r){if(r===D.Color||r===D.Alpha||r===D.Highlight||r===D.ObjectAndLayerIdColor){if(e===le.DRAPED_MATERIAL)return!0;const{drawInSecondSlot:i,occlusionTest:n}=this.parameters;return e===(i?le.LABEL_MATERIAL:le.HUD_MATERIAL)||n&&e===le.OCCLUSION_PIXELS}return!1}createGLMaterial(e){return new Ftt(e)}calculateRelativeScreenBounds(e,r,i=jt()){return Utt(this.parameters,e,r,i),i[2]=i[0]+e[0],i[3]=i[1]+e[1],i}},Ftt=class extends XZ{constructor(e){super({...e,...e.material.parameters})}selectProgram(e){return this.ensureTechnique(WSe,e)}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.selectProgram(e)}};function Utt(t,e,r,i=ztt){return fs(i,t.anchorPosition),i[0]*=-e[0],i[1]*=-e[1],i[0]+=t.screenOffset[0]*r,i[1]+=t.screenOffset[1]*r,i}function ktt(t){const e=t[0],r=t[1],i=t[2],n=t[3],s=t[4],o=t[5],a=t[6],l=t[7],c=t[8],u=1/Math.sqrt(e*e+r*r+i*i),d=1/Math.sqrt(n*n+s*s+o*o),p=1/Math.sqrt(a*a+l*l+c*c);return t[0]=e*u,t[1]=r*u,t[2]=i*u,t[3]=n*d,t[4]=s*d,t[5]=o*d,t[6]=a*p,t[7]=l*p,t[8]=c*p,t}function Eoe(t,e,r,i,n,s,o,a){let l=e-n-(a[0]>0?i[0]*a[0]:0),c=l+i[0]+2*n,u=r-n-(a[1]>0?i[1]*a[1]:0),d=u+i[1]+2*n;const p=o.distanceFieldBoundingBox;return o.textureIsSignedDistanceField&&p!=null&&(l+=i[0]*p[0],u+=i[1]*p[1],c-=i[0]*(1-p[2]),d-=i[1]*(1-p[3]),l-=s,c+=s,u-=s,d+=s),t[0]>l&&t[0]u&&t[1]0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return this._state!==ec.Idle||this._dirty}get updatingProgress(){if(!this.updating)return 1;const t=this._state/ec.NumStates;return this._dirty?.5*t:t}get running(){return this.view.ready&&this.view.state!=null&&this.updating}runTask(t){switch(this._state){case ec.Idle:this._startUpdate(),t.madeProgress();case ec.Process:if(this._state=ec.Process,!this._processActiveGraphics(t))return;case ec.Sort:if(this._state=ec.Sort,!this._sortVisibleGraphics(t))return;case ec.Deconflict:if(this._state=ec.Deconflict,!this._deconflictVisibleGraphics(t))return;default:set(this,this._visible),this._state=ec.Idle,this.notifyChange("updating")}}modifyGraphics(t,e){e?t.forEach(r=>this.addToActiveGraphics(r)):t.forEach(r=>this.removeFromActiveGraphics(r)),this.setDirty()}layerSupportsDeconfliction(t){if(t==null||t.type!=="object3d")return!1;const e=t.stageObject;if((e?e.geometries.length:0)!==1)return!1;const r=e==null?void 0:e.geometries[0];return(r==null?void 0:r.material)instanceof YS}_startUpdate(){oet(this.view),this._dirty=!1,this._runningViewState.copyFrom(this.viewState);const{fullWidth:t,fullHeight:e}=this._runningViewState.camera;this._initBins(t,e),this._resetIterators()}addToActiveGraphics(t){t.info[this.visibilityGroup]=new Ktt,this._active.set(t.graphics3DGraphic.graphic.uid,t),this.setDirty()}removeFromActiveGraphics(t){this._visible.delete(t.graphics3DGraphic.graphic.uid),trt(t,this.visibilityGroup),delete t.info[this.visibilityGroup],this._active.delete(t.graphics3DGraphic.graphic.uid),this.setDirty()}_processActiveGraphics(t){const e=this._ensureActiveGraphicsIterator(),r=wE(Ytt,this._runningViewState.camera.projectionMatrix),i=this.view.viewingMode==="global"&&this.view.map.ground.opacity===1&&this._runningViewState.camera.relativeElevation>0?Ztt:null;let n=0;for(i!=null&&(De(i,Zs,this._runningViewState.camera.viewMatrix),i[3]=Mr(this.view.spatialReference).radius,n=_be(i,Zs));!t.done;){t.madeProgress();const s=e.next();if(s.done===!0)return this._resetActiveGraphicsIterator(),!0;const o=s.value,a=o&&o.info[this.visibilityGroup];a&&(this._collectGraphics3DGraphics(o,r,i,n),a.culled?this._visible.delete(o.graphics3DGraphic.graphic.uid):this._visible.set(o.graphics3DGraphic.graphic.uid,o))}return!1}_sortVisibleGraphics(t){const e=this._ensureSortGraphicsIterator();for(;!t.done;){const r=e.next();if(t.madeProgress(),r.done===!0)return this._resetSortGraphicsIterator(),!0}return!1}_deconflictVisibleGraphics(t){const e=this._ensureVisibleGraphicsIterator(),r=this.visibilityGroup===js.LABEL;for(;!t.done;){t.madeProgress();const i=e.next();if(i.done===!0)return this._resetVisibleGraphicsIterator(),!0;const n=i.value,s=n.info[this.visibilityGroup];if(!s||s.culled)continue;const o=n.graphics3DGraphic,a=!r||o.isVisible();s.visible=a&&!this._isConflicted(n),s.visible&&this._addToBins(n),this._setGraphicVisibility(n,s.visible),cet(s,s.visible)}return!1}_resetIterators(){this._iterators.active=null,this._iterators.visible=null,this._iterators.sort=null}_ensureActiveGraphicsIterator(){return this._iterators.active||(this._iterators.active=Ooe(this._active)),this._iterators.active}_resetActiveGraphicsIterator(){this._iterators.active=null}_ensureVisibleGraphicsIterator(){return this._iterators.visible||(this._iterators.visible=Ooe(this._visible)),this._iterators.visible}_resetVisibleGraphicsIterator(){this._iterators.visible=null}_ensureSortGraphicsIterator(){return this._iterators.sort||(this._iterators.sort=rrt(this._visible,this._iterators.sortArray,this.visibilityGroup)),this._iterators.sort}_resetSortGraphicsIterator(){this._iterators.sort=null}_collectGraphics3DGraphics(t,e,r,i){const n=t.graphics3DGraphic;if(n.destroyed)return;const s=t.info[this.visibilityGroup];if(!n.isVisible(js.GRAPHIC,Uo.DECONFLICTION))return void(s.culled=!0);const o=this.getGraphicsLayers(n);Ih(s.aabr);let a=null;for(const l of o){if(!this.layerSupportsDeconfliction(l))continue;const c=l.stageObject.geometries[0].material;if(a==null&&(a=art,this._getProjectionInfo(l,e,a),a.isOutsideScreen||this._isCulledBySlice(t,Mp)||r!=null&&this._isCulledByHorizon(a,r,i)))return void(s.culled=!0);this._expandBoundingRect(s,l,c,a)}a==null?s.culled=!0:(s.distance=a.distance,s.culled=!1)}_getProjectionInfo(t,e,r){const i=this._runningViewState.camera,n=t.stageObject,s=n.geometries[0],o=s.material,a=n.boundingVolumeWorldSpace.bounds;De(Mp,a,i.viewMatrix);const l=s.vertexAttributes,c=l.get(E.NORMAL).data,u=l.get(E.AUXPOS1).data;o.applyShaderOffsetsView(Mp,c,n.transformation,u,i,r.scaleInfo,Mp),gi(yx,Mp[0],Mp[1],Mp[2],1),au(CC,yx,i.projectionMatrix),te(r.positionNDC,CC,1/CC[3]),o.applyShaderOffsetsNDC(r.positionNDC,u,i,r.positionNDC,R9),r.distanceWithoutPolygonOffset=i.depthNDCToWorld(R9[2]),r.distance=R9[2]===r.positionNDC[2]?r.distanceWithoutPolygonOffset:i.depthNDCToWorld(r.positionNDC[2]),gi(CC,r.positionNDC[0],r.positionNDC[1],r.positionNDC[2],1),au(yx,CC,e),ew(yx,yx,1/yx[3]),ne(r.positionView,Mp[0],Mp[1],Mp[2])}_isCulledByHorizon(t,e,r){return re(P9.direction,t.positionView),ne(P9.origin,0,0,0),!!u1(e,P9,Qtt)&&t.distanceWithoutPolygonOffset>r}_isCulledBySlice(t,e){return t.slicePlaneEnabled&&this._runningViewState.slicePlaneEnabled&&CZ(this._runningViewState.slicePlane,e)}_expandBoundingRect(t,e,r,{positionNDC:i,scaleInfo:n}){const s=this._runningViewState.camera,o=e.getScreenSize(srt);KTe(o,n.factor,o),o[0]*=s.pixelRatio,o[1]*=s.pixelRatio;const a=E4(r.calculateRelativeScreenBounds(o,n.factorAlignment.scale,Jtt),wt(0,s.fullWidth,.5+.5*i[0]),wt(0,s.fullHeight,.5+.5*i[1])),l=this.iconMarginFactor;if(l!==0){const c=l*Math.min(nu(a),lp(a));a[0]-=c,a[1]-=c,a[2]+=c,a[3]+=c}S_(t.aabr,a,t.aabr)}_isConflicted(t){const e=t.graphics3DGraphic.graphic.uid,r=t.info[this.visibilityGroup];for(let i=Math.floor(r.aabr[0]/this._accBinsSizeX);i<=Math.floor(r.aabr[2]/this._accBinsSizeX);i++)if(!(i<0||i>=this._accBinsNumX))for(let n=Math.floor(r.aabr[1]/this._accBinsSizeY);n<=Math.floor(r.aabr[3]/this._accBinsSizeY);n++){if(n<0||n>=this._accBinsNumY)continue;const s=this._accBins[i][n];for(let o=0;o=this._accBinsNumX))for(let a=n;a<=s;a++)a<0||a>=this._accBinsNumY||this._accBins[o][a].push(t)}_setGraphicVisibility(t,e){const r=t.graphics3DGraphic;r.destroyed||(r.setVisibilityFlag(this.visibilityGroup,Uo.DECONFLICTION,e),this.visibilityGroup===js.LABEL&&this.view.labeler.setLabelGraphicVisibility(r,e))}};function trt(t,e){const r=t.graphics3DGraphic;r.destroyed||r.setVisibilityFlag(e,Uo.DECONFLICTION,!0)}function*Ooe(t){if(Map.prototype.entries){const e=t.entries();for(let r=e.next();!r.done;r=e.next())yield r.value[1]}else yield*t.values()}function*rrt(t,e,r){e.clear(),t.forEach((n,s)=>{const o=e.pushNew();o.id=s,o.visible=n.graphics3DGraphic.getVisibilityFlag(r,Uo.DECONFLICTION);const a=n.info&&n.info[r];o.prio=n.graphics3DGraphic.deconflictionPriority,o.distance=a?a.distance:Number.MAX_VALUE}),yield;const i=e.iterableSort((n,s)=>n.prio!==s.prio?s.prio-n.prio:n.distance!==s.distance?n.distance-s.distance:n.visible!==s.visible?n.visible?-1:1:n.id-s.id);for(let n=i.next();!n.done;n=i.next())yield;e.forAll(n=>{const s=t.get(n.id);s&&(t.delete(n.id),t.set(n.id,s))}),e.clear()}h([f({constructOnly:!0})],fT.prototype,"view",void 0),h([f({type:Boolean,readOnly:!0})],fT.prototype,"updating",null),fT=h([N("esri.views.3d.layers.graphics.Deconflictor")],fT);class irt{constructor(){this.id=0,this.visible=!1,this.prio=0,this.distance=0}}class nrt{constructor(e=null,r=null,i=null){this.active=e,this.visible=r,this.sort=i,this.sortArray=new Nt({allocator:n=>n||new irt})}}const srt=Ne();class ort{constructor(){this.positionView=O(),this.positionNDC=O(),this.distance=0,this.distanceWithoutPolygonOffset=0,this.scaleInfo=new ySe}get isOutsideScreen(){const e=this.positionNDC;return e[0]<-1||e[1]<-1||e[2]<-1||e[0]>=1||e[1]>=1}}const art=new ort,lrt=2e3;let GD=class extends fT{constructor(e){super(e),this.visibilityGroup=js.LABEL,this.iconMarginFactor=0,this._lastDeconfliction=0}get viewState(){return this.parent.viewState}runTask(e){if(this.parent.running)return Ho.YIELD;const r=performance.now();if(e.state!==Cr.IDLE&&r-this._lastDeconfliction{var e,r;return(r=(e=this.view)==null?void 0:e.state)==null?void 0:r.camera},()=>{this._updateViewState(),this.setDirty()}),ue(()=>{var e,r,i;return(i=(r=(e=this.view)==null?void 0:e.map)==null?void 0:r.ground)==null?void 0:i.opacity},(e,r)=>{e!==1&&r!==1||this.setDirty()}),ue(()=>{var e;return(e=this.view)==null?void 0:e.slicePlane},()=>{this._updateSlicePlane(),this._slicePlaneChanged()},Pr)]),this._frameTask=this.view.resourceController.scheduler.registerTask(dt.GRAPHICS_DECONFLICTOR,this),this._labels=new GD({view:this.view,parent:this})}destroy(){this._labels.destroy(),this._labels=null,this._handles.destroy(),this._handles=null,this._frameTask&&(this._frameTask.remove(),this._frameTask=null)}get iconMarginFactor(){return this._iconMarginFactor}set iconMarginFactor(e){this._iconMarginFactor=e,this.setDirty()}setDirty(){this._contexts.size>0&&(super.setDirty(),this._labels.setDirty())}runTask(e){super.runTask(e),this.running||this._labels.setDirty()}setInitialIconVisibilityFlag(e,r){const i=!(this._graphicSupportsDeconfliction(r)&&M9(e));r.setVisibilityFlag(js.GRAPHIC,Uo.DECONFLICTION,i)}_updateViewState(){this.view&&this.view.state&&(this._viewState.camera.copyFrom(this.view.state.camera),this._updateSlicePlane())}_updateSlicePlane(){const e=this.view?this.view.slicePlane:null;e!=null&&Ibe(e,this._viewState.camera.viewMatrix,this._viewState.slicePlane),this._viewState.slicePlaneEnabled=e!=null}_slicePlaneChanged(){Do(this._contexts,(e,r)=>r.symbolCreationContext.slicePlaneEnabled)&&this.setDirty()}addGraphicsOwner(e){const r=this._getGraphicsContext(e);return{addGraphic:i=>this._addGraphic(e,r,i),removeGraphic:i=>this._removeGraphic(r,i),labelingInfoChange:()=>this._labels.enabledChanged(e,r),featureReductionChange:()=>this.enabledChanged(e,r),slicePlaneEnabledChange:()=>this._slicePlaneEnabledChanged(e,r),clear:()=>r.forEach(i=>this._removeGraphic(r,i.graphics3DGraphic))}}removeGraphicsOwner(e){const r=this._contexts.get(e);r&&(r.forEach(i=>this._removeGraphic(r,i.graphics3DGraphic)),this._contexts.delete(e),this.setDirty())}_addGraphic(e,r,i){const n=i.graphic.uid,s=new ert(i,e.symbolCreationContext.slicePlaneEnabled);r.set(n,s),M9(e)&&this.addToActiveGraphics(s),e.labelsEnabled&&this._labels.addToActiveGraphics(s)}_removeGraphic(e,r){const i=r.graphic.uid,n=e.get(i);n&&(this.removeFromActiveGraphics(n),this._labels.removeFromActiveGraphics(n),e.delete(i),this.setDirty())}enabledChanged(e,r){const i=M9(e);i||crt(e),this.modifyGraphics(r,i)}_slicePlaneEnabledChanged(e,r){const i=e.symbolCreationContext.slicePlaneEnabled;r.forEach(n=>n.slicePlaneEnabled=i),this.setDirty()}getGraphicsLayers(e){return e.layers}_graphicSupportsDeconfliction(e){if(e.isDraped)return!1;const r=e.layers;if(!r||!r.length)return!1;for(const i of r)if(this.layerSupportsDeconfliction(i))return!0;return!1}_getGraphicsContext(e){const r=this._contexts.get(e);if(r)return r;const i=new Map;return this._contexts.set(e,i),this.setDirty(),i}};function M9(t){const e=t.layer;return!(!e||!e.featureReduction||e.featureReduction.type!=="selection")}function crt(t){const e=t.graphics3DGraphics;e&&e.forEach(r=>r.setVisibilityFlag(js.GRAPHIC,Uo.DECONFLICTION,!0))}UH=h([N("esri.views.3d.layers.graphics.GraphicsDeconflictor")],UH);function QSe(t){return 32+t.length}function JSe(t){return 16}function KSe(t){if(!t)return 0;let e=rEe;for(const r in t)if(t.hasOwnProperty(r)){const i=t[r];switch(typeof i){case"string":e+=QSe(i);break;case"number":e+=JSe();break;case"boolean":e+=4}}return e}function eEe(t){if(!t)return 0;if(Array.isArray(t))return urt(t);let e=rEe;for(const r in t)t.hasOwnProperty(r)&&(e+=tEe(t[r]));return e}function urt(t){const e=t.length;if(e===0||typeof t[0]=="number")return 32+8*e;let r=iEe;for(let i=0;i[e,r],ZS=(t,e,r)=>[e,r,t[2]],aJ=(t,e,r)=>[e,r,t[2],t[3]];function DIt(t){return t?{originPosition:t.originPosition==="upper-left"?"upperLeft":t.originPosition==="lower-left"?"lowerLeft":t.originPosition,scale:t.tolerance?[t.tolerance,t.tolerance]:[1,1],translate:t.extent!=null?[t.extent.xmin,t.extent.ymax]:[0,0]}:null}function hrt({scale:t,translate:e},r){return Math.round((r-e[0])/t[0])}function drt({scale:t,translate:e},r){return Math.round((e[1]-r)/t[1])}function nEe({scale:t,translate:e},r){return r*t[0]+e[0]}function sEe({scale:t,translate:e},r){return e[1]-r*t[1]}function oEe(t,e,r){const i=new Array(r.length);if(!r.length)return i;const[n,s]=t.scale;let o=nEe(t,r[0][0]),a=sEe(t,r[0][1]);i[0]=e(r[0],o,a);for(let l=1;l(String(i.code)===r&&(e=i.name),!!e))}return e}clone(){return new zH({codedValues:ye(this.codedValues),name:this.name})}};h([f({type:[eA],json:{write:!0}})],rA.prototype,"codedValues",void 0),h([Vt({codedValue:"coded-value"})],rA.prototype,"type",void 0),rA=zH=h([N("esri.layers.support.CodedValueDomain")],rA);const dEe=rA;var BH;let jD=BH=class extends O8{constructor(t){super(t),this.type="inherited"}clone(){return new BH}};h([Vt({inherited:"inherited"})],jD.prototype,"type",void 0),jD=BH=h([N("esri.layers.support.InheritedDomain")],jD);const pEe=jD;var VH;let C2=VH=class extends O8{constructor(t){super(t),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new VH({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};h([f({type:Number,json:{type:[Number],read:{source:"range",reader:(t,e)=>e.range&&e.range[1]},write:{enabled:!1,overridePolicy(){return{enabled:this.maxValue!=null&&this.minValue==null}},target:"range",writer(t,e,r){e[r]=[this.minValue||0,t]}}}})],C2.prototype,"maxValue",void 0),h([f({type:Number,json:{type:[Number],read:{source:"range",reader:(t,e)=>e.range&&e.range[0]},write:{target:"range",writer(t,e,r){e[r]=[t,this.maxValue||0]}}}})],C2.prototype,"minValue",void 0),h([Vt({range:"range"})],C2.prototype,"type",void 0),C2=VH=h([N("esri.layers.support.RangeDomain")],C2);const fEe=C2,yrt={key:"type",base:O8,typeMap:{range:fEe,"coded-value":dEe,inherited:pEe}};function _rt(t){if(!t||!t.type)return null;switch(t.type){case"range":return fEe.fromJSON(t);case"codedValue":return dEe.fromJSON(t);case"inherited":return pEe.fromJSON(t)}return null}const vrt=new zn({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"});var GH;const brt=new zn({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let Pa=GH=class extends ke{constructor(t){super(t),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=-1,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(t,{description:e}){let r=null;try{r=e?JSON.parse(e):null}catch{}return(r==null?void 0:r.value)??null}readValueType(t,{description:e}){let r=null;try{r=e?JSON.parse(e):null}catch{}return r?brt.fromJSON(r.fieldValueType):null}clone(){return new GH({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain&&this.domain.clone()||null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};h([f({type:String,json:{write:!0}})],Pa.prototype,"alias",void 0),h([f({type:[String,Number],json:{write:{allowNull:!0}}})],Pa.prototype,"defaultValue",void 0),h([f()],Pa.prototype,"description",void 0),h([lr("description")],Pa.prototype,"readDescription",null),h([f({types:yrt,json:{read:{reader:_rt},write:!0}})],Pa.prototype,"domain",void 0),h([f({type:Boolean,json:{write:!0}})],Pa.prototype,"editable",void 0),h([f({type:mn,json:{write:!0}})],Pa.prototype,"length",void 0),h([f({type:String,json:{write:!0}})],Pa.prototype,"name",void 0),h([f({type:Boolean,json:{write:!0}})],Pa.prototype,"nullable",void 0),h([Vt(vrt)],Pa.prototype,"type",void 0),h([f()],Pa.prototype,"valueType",void 0),h([lr("valueType",["description"])],Pa.prototype,"readValueType",null),h([f({type:Boolean,json:{read:!1}})],Pa.prototype,"visible",void 0),Pa=GH=h([N("esri.layers.support.Field")],Pa);const wrt=Pa;let UIt=class{constructor(e,r,i){this.uid=e,this.geometry=r,this.attributes=i,this.visible=!0,this.objectId=null,this.centroid=null}};function zIt(t){return t.geometry!=null}let BIt=class{constructor(){this.exceededTransferLimit=!1,this.features=[],this.fields=[],this.hasM=!1,this.hasZ=!1,this.geometryType=null,this.objectIdFieldName=null,this.globalIdFieldName=null,this.geometryProperties=null,this.geohashFieldName=null,this.spatialReference=null,this.transform=null}};function GIt(t){var s;const e=v8e.fromJSON(t.geometryType),r=St.fromJSON(t.spatialReference),i=t.transform,n=t.features.map(o=>{const a=xrt(o,e,r,t.objectIdFieldName),l=a.geometry;if(l!=null&&i)switch(l.type){case"point":a.geometry=cEe(i,l,l,l.hasZ,l.hasM);break;case"multipoint":a.geometry=lEe(i,l,l,!!l.hasZ,!!l.hasM);break;case"polygon":a.geometry=uEe(i,l,l,!!l.hasZ,!!l.hasM);break;case"polyline":a.geometry=hEe(i,l,l,!!l.hasZ,!!l.hasM);break;case"extent":case"mesh":a.geometry=l}return a});return{geometryType:e,features:n,spatialReference:r,fields:((s=t.fields)==null?void 0:s.map(o=>wrt.fromJSON(o)))??[],objectIdFieldName:t.objectIdFieldName,globalIdFieldName:t.globalIdFieldName,geohashFieldName:t.geohashFieldName,geometryProperties:t.geometryProperties,hasZ:t.hasZ,hasM:t.hasM,exceededTransferLimit:t.exceededTransferLimit,transform:null}}function xrt(t,e,r,i){return{uid:wc(),objectId:i&&t.attributes?t.attributes[i]:null,attributes:t.attributes,geometry:Trt(t.geometry,e,r),visible:!0}}function Trt(t,e,r){if(t==null)return null;switch(e){case"point":{const i=t;return{x:i.x,y:i.y,z:i.z,m:i.m,hasZ:i.z!=null,hasM:i.m!=null,type:"point",spatialReference:r}}case"polyline":{const i=t;return{paths:i.paths,hasZ:!!i.hasZ,hasM:!!i.hasM,type:"polyline",spatialReference:r}}case"polygon":{const i=t;return{rings:i.rings,hasZ:!!i.hasZ,hasM:!!i.hasM,type:"polygon",spatialReference:r}}case"multipoint":{const i=t;return{points:i.points,hasZ:!!i.hasZ,hasM:!!i.hasM,type:"multipoint",spatialReference:r}}}}function Ww(t,e,r,i){return{x:t,y:e,z:r,hasZ:r!=null,hasM:!1,spatialReference:i,type:"point"}}function Srt(t){if(t==null)return 0;let e=32;switch(t.type){case"point":e+=42;break;case"polyline":case"polygon":{let r=0;const i=2+(t.hasZ?1:0)+(t.hasM?1:0),n=t.type==="polyline"?t.paths:t.rings;for(const s of n)r+=s.length;e+=8*r*i+64,e+=128*r,e+=34,e+=32*(n.length+1);break}case"multipoint":{const r=2+(t.hasZ?1:0)+(t.hasM?1:0),i=t.points.length;e+=8*i*r+64,e+=128*i,e+=34,e+=32;break}case"extent":e+=98,t.hasM&&(e+=32),t.hasZ&&(e+=32);break;case"mesh":e+=Ky(t.vertexAttributes.position),e+=Ky(t.vertexAttributes.normal),e+=Ky(t.vertexAttributes.uv),e+=Ky(t.vertexAttributes.tangent)}return e}function jIt(t){let e=32;return e+=KSe(t.attributes),e+=3,e+=8+Srt(t.geometry),e}function Ert(t){if(t==null)return 0;switch(t.type){case"point":return 1;case"polyline":{let e=0;for(const r of t.paths)e+=r.length;return e}case"polygon":{let e=0;for(const r of t.rings)e+=r.length;return e}case"multipoint":return t.points.length;case"extent":return 2;case"mesh":{const e=t.vertexAttributes&&t.vertexAttributes.position;return e?e.length/3:0}default:return}}function HIt(t){if(t==null)return!1;switch(t.type){case"extent":case"point":return!0;case"polyline":for(const e of t.paths)if(e.length>0)return!0;return!1;case"polygon":for(const e of t.rings)if(e.length>0)return!0;return!1;case"multipoint":return t.points.length>0;case"mesh":return!t.loaded||t.vertexAttributes.position.length>0}}function WIt(t,e){switch(vi(e),t.type==="mesh"&&(t=t.extent),t.type){case"point":e[0]=e[3]=t.x,e[1]=e[4]=t.y,t.hasZ&&(e[2]=e[5]=t.z);break;case"polyline":for(let r=0;ryEe(e)):t}function yEe(t){return t.map(e=>Array.from(e))}function Prt(t){for(const e of t)if(e.length!==0)return _Ee(e);return!1}function _Ee(t){return t.length>0&&(cE(t[0])||uE(t[0]))}function Mrt(t,e){if(!t)return null;let r;if(Roe(t)){if(e==null)return t.clone();if(Roe(e))return e.copy(t)}return e!=null?(r=e,r.x=t.x,r.y=t.y,r.spatialReference=t.spatialReference,t.hasZ?(r.z=t.z,r.hasZ=t.hasZ):(r.z=void 0,r.hasZ=!1),t.hasM?(r.m=t.m,r.hasM=!0):(r.m=void 0,r.hasM=!1)):(r=Ww(t.x,t.y,t.z,t.spatialReference),t.hasM&&(r.m=t.m,r.hasM=!0)),r}function XIt(t){const{wkid:e,wkt:r,latestWkid:i}=t,n={wkid:e,wkt:r,latestWkid:i};return St.fromJSON(n)}const lJ="__begin__",cJ="__end__",$rt=new RegExp(lJ,"ig"),Irt=new RegExp(cJ,"ig"),Moe=new RegExp("^"+lJ,"i"),$oe=new RegExp(cJ+"$","i"),L5='"',Lrt=L5+" + ",Drt=" + "+L5;function Nrt(t){return t.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function YIt(t){return t.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function uJ(t){const e={expression:"",type:"none"};return t.labelExpressionInfo?t.labelExpressionInfo.value?(e.expression=t.labelExpressionInfo.value,e.type="conventional"):t.labelExpressionInfo.expression&&(e.expression=t.labelExpressionInfo.expression,e.type="arcade"):t.labelExpression!=null&&(e.expression=Nrt(t.labelExpression),e.type="conventional"),e}function ZIt(t){const e=uJ(t);if(!e)return null;switch(e.type){case"conventional":return Frt(e.expression);case"arcade":return e.expression}return null}function QIt(t){const e=uJ(t);if(!e)return null;switch(e.type){case"conventional":return krt(e.expression);case"arcade":return vEe(e.expression)}return null}function Frt(t){let e;return t?(e=YF(t,r=>lJ+'$feature["'+r+'"]'+cJ),e=Moe.test(e)?e.replace(Moe,""):L5+e,e=$oe.test(e)?e.replace($oe,""):e+L5,e=e.replaceAll($rt,Lrt).replaceAll(Irt,Drt)):e='""',e}const Urt=/^\s*\{([^}]+)\}\s*$/i;function krt(t){const e=t==null?void 0:t.match(Urt);return e&&e[1].trim()||null}const zrt=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*$/i,Brt=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,Vrt=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])([\w\s]+)(\1)\s*\));?\s*$/i;function vEe(t){if(!t)return null;let e=zrt.exec(t)||Brt.exec(t);return e?e[1]||e[3]:(e=Vrt.exec(t),e?e[2]:null)}const $9=J.getLogger("esri.layers.support.labelFormatUtils"),I9={type:"simple",evaluate:()=>null},Grt={getAttribute:(t,e)=>t.field(e)};async function bEe(t,e,r){if(!t||!t.symbol||!e)return I9;const i=t.where,n=uJ(t),s=i?await ce(()=>import("./WhereClause-c86b9974.js").then(a=>a.W),["assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js"]):null;let o;if(n.type==="arcade"){const a=await R8e(n.expression,r,e);if(a==null)return I9;o={type:"arcade",evaluate(l){try{const c=a.evaluate({$feature:"attributes"in l?a.repurposeFeature(l):l},a.services);if(c!=null)return c.toString()}catch(c){$9.error(new Y("arcade-expression-error","Encountered an error when evaluating label expression for feature",{error:c,feature:l,expression:n}))}return null},needsHydrationToEvaluate:()=>vEe(n.expression)==null}}else o={type:"simple",evaluate:a=>n.expression.replaceAll(/{[^}]*}/g,l=>{const c=l.slice(1,-1),u=e.get(c);if(!u)return l;let d=null;return"attributes"in a?a&&a.attributes&&(d=a.attributes[u.name]):d=a.field(u.name),d==null?"":wEe(d,u)})};if(i){let a;try{a=s.WhereClause.create(i,e)}catch(c){return $9.error(new Y("bad-where-clause","Encountered an error when evaluating where clause, ignoring",{where:i,error:c})),I9}const l=o.evaluate;o.evaluate=c=>{const u="attributes"in c?void 0:Grt;try{if(a.testFeature(c,u))return l(c)}catch(d){$9.error(new Y("bad-where-clause","Encountered an error when evaluating where clause for feature",{where:i,feature:c,error:d}))}return null}}return o}function wEe(t,e){if(t==null)return"";const r=e.domain;if(r){if(r.type==="codedValue"||r.type==="coded-value"){const n=t;for(const s of r.codedValues)if(s.code===n)return s.name}else if(r.type==="range"){const n=+t,s="range"in r?r.range[0]:r.minValue,o="range"in r?r.range[1]:r.maxValue;if(s<=n&&n<=o)return r.name}}let i=t;return e.type==="date"||e.type==="esriFieldTypeDate"?i=k_(i,f3("short-date")):t_e(e)&&(i=TS(+i)),i||""}const JIt=Object.freeze(Object.defineProperty({__proto__:null,createLabelFunction:bEe,formatField:wEe},Symbol.toStringTag,{value:"Module"}));let xEe=class{constructor(e=null,r="center",i="center",n=null,s=[0,0,0],o=0,a=[0,0,0,1],l=[0,0],c="world",u=0,d=0){this.verticalOffset=e,this.horizontalPlacement=r,this.verticalPlacement=i,this.text=n,this.translation=s,this.elevationOffset=o,this.centerOffset=a,this.screenOffset=l,this.centerOffsetUnits=c,this.displayWidth=u,this.displayHeight=d}};function hJ(t,e){if(t.type==="point")return D0(t,e,!1);if(mEe(t))switch(t.type){case"extent":return D0(t.center,e,!1);case"polygon":return D0(t.centroid,e,!1);case"polyline":return D0(Ioe(t),e,!0);case"mesh":return D0(t.origin,e,!1)}else switch(t.type){case"extent":return D0(jrt(t),e,!0);case"polygon":return D0(Hrt(t),e,!0);case"polyline":return D0(Ioe(t),e,!0)}}function Ioe(t){const e=t.paths[0];if(!e||e.length===0)return null;const r=xye(e,wye(e)/2);return Ww(r[0],r[1],r[2],t.spatialReference)}function jrt(t){return Ww(.5*(t.xmax+t.xmin),.5*(t.ymax+t.ymin),t.zmin!=null&&t.zmax!=null&&isFinite(t.zmin)&&isFinite(t.zmax)?.5*(t.zmax+t.zmin):void 0,t.spatialReference)}function Hrt(t){const e=t.rings[0];if(!e||e.length===0)return null;const r=Eye(t.rings,!!t.hasZ);return Ww(r[0],r[1],r[2],t.spatialReference)}function D0(t,e,r){const i=r?t:Mrt(t);return e&&t?Cve(t,i,e)?i:null:i}function eLt(t,e,r,i=0){if(t){e||(e=jt());const n=t;let s=.5*n.width*(r-1),o=.5*n.height*(r-1);return n.width<1e-7*n.height?s+=o/20:n.height<1e-7*n.width&&(o+=s/20),gi(e,n.xmin-s-i,n.ymin-o-i,n.xmax+s+i,n.ymax+o+i),e}return null}function TEe(t,e){for(let r=0;r3&&(i[3]=t[3]),r&&(i[0]*=r,i[1]*=r,i[2]*=r,i[3]*=r),i}function tLt(t,e,r,i,n,s=[0,0,0,0]){for(let o=0;o<3;++o)t!=null&&t[o]!=null?s[o]=t[o]:r!=null&&r[o]!=null?s[o]=r[o]:s[o]=n[o];return s[3]=e??i??n[3],s}function Loe(t=pg,e,r,i=1){const n=new Array(3);if(e==null||r==null)n[0]=1,n[1]=1,n[2]=1;else{let s,o=0;for(let a=2;a>=0;a--){const l=t[a];let c;const u=l!=null,d=a===0&&!s&&!u,p=r[a];l==="symbol-value"||d?c=p!==0?e[a]/p:1:u&&l!=="proportional"&&isFinite(l)&&(c=p!==0?l/p:1),c!=null&&(n[a]=c,s=c,o=Math.max(o,Math.abs(c)))}for(let a=2;a>=0;a--)n[a]==null?n[a]=s:n[a]===0&&(n[a]=.001*o)}for(let s=2;s>=0;s--)n[s]/=i;return na(n)}function Wrt(t){return t.isPrimitive!=null}function R8(t){return jH(Wrt(t)?[t.width,t.depth,t.height]:t)?null:"Symbol sizes may not be negative values"}function jH(t){const e=r=>r==null||r>=0;return Array.isArray(t)?t.every(e):e(t)}function qrt(t,e,r,i=_e()){return t&&AS(i,i,-t/180*Math.PI),e&&CS(i,i,e/180*Math.PI),r&&M6(i,i,r/180*Math.PI),i}function dJ(t,e,r){if(r.minDemResolution!=null)return r.minDemResolution;const i=el(e),n=Dw(t)*i,s=Nw(t)*i,o=c1(t)*(e.isGeographic?1:i);return n===0&&s===0&&o===0?r.minDemResolutionForPoints:.01*Math.max(n,s,o)}function SEe(t,e,r,i,n,s,o,a,l,c,u){const d=tit[u.mode];let p,m,y=0;if($i(t,e,r,i,l.spatialReference,n,a))return d.requiresAlignment(u)?(y=d.applyElevationAlignmentBuffer(i,n,s,o,a,l,c,u),p=s,m=o):(p=i,m=n),$i(p,l.spatialReference,m,s,c.spatialReference,o,a)?y:void 0}function J_(t,e,r,i,n){const s=(T5(t)?t.z:STe(t)?t.array[t.offset+2]:t[2])||0;switch(r.mode){case"on-the-ground":{const o=Af(e,t,"ground")??0;return n.verticalDistanceToGround=0,n.sampledElevation=o,void(n.z=o)}case"relative-to-ground":{const o=Af(e,t,"ground")??0,a=r.geometryZWithOffset(s,i);return n.verticalDistanceToGround=a,n.sampledElevation=o,void(n.z=a+o)}case"relative-to-scene":{const o=Af(e,t,"scene")??0,a=r.geometryZWithOffset(s,i);return n.verticalDistanceToGround=a,n.sampledElevation=o,void(n.z=a+o)}case"absolute-height":{const o=r.geometryZWithOffset(s,i),a=Af(e,t,"ground")??0;return n.verticalDistanceToGround=o-a,n.sampledElevation=a,void(n.z=o)}default:return void(n.z=0)}}function Xrt(t,e,r,i){return J_(t,e,r,i,mT),mT.z}function WP(t,e,r){return e==null||r==null?t.definedChanged:e==="on-the-ground"&&r==="on-the-ground"?t.staysOnTheGround:e===r||e!=="on-the-ground"&&r!=="on-the-ground"?an.UPDATE:t.onTheGroundChanged}function Bh(t){return t==="relative-to-ground"||t==="relative-to-scene"}function K_(t){return t!=="absolute-height"}function Yrt(t,e,r,i,n){J_(e,r,n,i,mT),TEe(t,mT.verticalDistanceToGround);const s=mT.sampledElevation,o=In(rit,t.transformation);return nI[0]=e.x,nI[1]=e.y,nI[2]=mT.z,ma(e.spatialReference,nI,o,i.spatialReference)?t.transformation=o:console.warn("Could not locate symbol object properly, it might be misplaced"),s}function Zrt(t,e,r,i,n,s){let o=0;const a=s.spatialReference;e*=3,i*=3;for(let l=0;l!0},"relative-to-ground":{applyElevationAlignmentBuffer:Qrt,requiresAlignment:()=>!0},"relative-to-scene":{applyElevationAlignmentBuffer:Jrt,requiresAlignment:()=>!0}},rit=_e(),mT=new qP,nI=O();function pJ(t){return t.mapPositions!=null}function EEe(t,e,r,i,n){const s=t.stageObject,o=s.geometries;let a=0;for(const l of o){if(!pJ(l))continue;const{update:c,averageGeometrySampledElevation:u}=AEe(l,e,r,i,n);a+=u,c&&s.geometryVertexAttrsUpdated(l)}return a/o.length}function Lb(t,e,r,i,n,s){const o=t.stageObject,a=e.centerPointInElevationSR;let l=0;o.usesVerticalDistanceToGround?(i(a,xl),TEe(o,xl.verticalDistanceToGround),l=xl.sampledElevation):(i(a,xl),e.mode!=="absolute-height"&&(l=xl.sampledElevation));const c=In(iit,s??o.transformation),u=ne(CEe,c[12],c[13],c[14]);Kr.TESTS_DISABLE_OPTIMIZATIONS?(wl[0]=a.x,wl[1]=a.y,wl[2]=xl.z,ma(a.spatialReference,wl,c,n.spatialReference)&&(s?In(s,c):o.transformation=c)):n.setAltitudeOfTransformation(xl.z,c);const d=fJ/n.unitInMeters;return(Math.abs(c[12]-u[0])>=d||Math.abs(c[13]-u[1])>=d||Math.abs(c[14]-u[2])>=d)&&(s?In(s,c):o.transformation=c),l}const iit=_e();function nit(t,e,r,i,n){const s=t.graphics3DSymbolLayer.lodRenderer;if(s==null)return 0;const o=e.centerPointInElevationSR;i(o,xl);const a=e.mode!=="absolute-height"?xl.sampledElevation:0,l=s.instanceData,c=t.instanceIndex,u=oit;l.getGlobalTransform(c,u);const d=ne(CEe,u[12],u[13],u[14]);Kr.TESTS_DISABLE_OPTIMIZATIONS?(wl[0]=o.x,wl[1]=o.y,wl[2]=xl.z,ma(o.spatialReference,wl,u,n.spatialReference)&&l.setGlobalTransform(c,u)):n.setAltitudeOfTransformation(xl.z,u);const p=fJ/n.unitInMeters;return(Kr.TESTS_DISABLE_OPTIMIZATIONS||Math.abs(u[12]-d[0])>=p||Math.abs(u[13]-d[1])>=p||Math.abs(u[14]-d[2])>=p)&&l.setGlobalTransform(c,u),a}function sit(t,e,r,i,n){const s=t.stageObject,o=s.geometries;if(o.length===0)return 0;let a=0,l=null,c=0,u=!1;for(const d of o){if(!pJ(d))continue;const p=d.vertexAttributes.get(E.POSITION);if(p!==l){const{update:m,averageGeometrySampledElevation:y}=AEe(d,e,r,i,n);c=y,l=p,u=m}u&&s.geometryVertexAttrsUpdated(d),a+=c}return a/o.length}const fJ=.01,wl=O(),Pu=O(),_x=O(),oit=_e(),CEe=O(),xl=new qP;function AEe(t,e,r,i,n){let s=!1;const o=t.shaderTransformation,a=e.requiresSampledElevationInfo;Pu[0]=o[12],Pu[1]=o[13],Pu[2]=o[14],t.invalidateBoundingInfo();const l=t.getMutableAttribute(E.POSITION),c=l.data,u=l.size,d=c.length/u,p=new BQ(t.mapPositions,r);let m=0,y=0;for(let _=0;_=v||Math.abs(_x[1]-c[m+1])>=v||Math.abs(_x[2]-c[m+2])>=v)&&(s=!0)}m+=u,p.offset+=3}return y/=d,{update:s,averageGeometrySampledElevation:y}}function ait(t){return!!t&&WS[t]!=null}function lit(t){return 1/(WS[t]||1)}function cit(){const t=Object.keys(WS);return t.sort(),t}const uit=cit(),hit=J.getLogger("esri.views.3d.layers.graphics.featureExpressionInfoUtils");function dit(t){return{cachedResult:t.cachedResult,arcade:t.arcade?{func:t.arcade.func,context:t.arcade.modules.arcadeUtils.createExecContext(null,{sr:t.arcade.context.spatialReference}),modules:t.arcade.modules}:null}}function iLt(t){const e=t&&t.expression;if(typeof e=="string"){const r=PEe(e);if(r!=null)return{cachedResult:r}}return null}async function nLt(t,e,r,i){const n=t&&t.expression;if(typeof n!="string")return null;const s=PEe(n);if(s!=null)return{cachedResult:s};const o=await $Y();Bt(r);const a=o.arcadeUtils,l=a.createSyntaxTree(n);return a.dependsOnView(l)?(i!=null&&i.error("Expressions containing '$view' are not supported on ElevationInfo"),{cachedResult:0}):{arcade:{func:a.createFunction(l),context:a.createExecContext(null,{sr:e}),modules:o}}}function OEe(t,e,r){return t.arcadeUtils.createFeature(e.attributes,e.geometry,r)}function P8(t,e){if(t!=null&&!REe(t)){if(!e||!t.arcade)return void hit.errorOncePerTick("Arcade support required but not provided");const r=e;r._geometry&&(r._geometry=gEe(r._geometry)),t.arcade.modules.arcadeUtils.updateExecContext(t.arcade.context,e)}}function pit(t){if(t!=null){if(REe(t))return t.cachedResult;const e=t.arcade;let r=e==null?void 0:e.modules.arcadeUtils.executeFunction(e.func,e.context);return typeof r!="number"&&(t.cachedResult=0,r=0),r}return 0}function sLt(t,e=!1){let r=t&&t.featureExpressionInfo;const i=r&&r.expression;return e||i==="0"||(r=null),r??null}const fit={cachedResult:0};function REe(t){return t.cachedResult!=null}function PEe(t){return t==="0"?0:null}let wp=class MEe{constructor(){this._meterUnitOffset=0,this._renderUnitOffset=0,this._unit="meters",this._metersPerElevationInfoUnit=1,this._featureExpressionInfoContext=null,this.centerPointInElevationSR=null,this.mode=null}get featureExpressionInfoContext(){return this._featureExpressionInfoContext}get meterUnitOffset(){return this._meterUnitOffset}get unit(){return this._unit}set unit(e){this._unit=e,this._metersPerElevationInfoUnit=lit(e)}get requiresSampledElevationInfo(){return this.mode!=="absolute-height"}reset(){this.mode=null,this._meterUnitOffset=0,this._renderUnitOffset=0,this._featureExpressionInfoContext=null,this.unit="meters"}set offsetMeters(e){this._meterUnitOffset=e,this._renderUnitOffset=0}set offsetElevationInfoUnits(e){this._meterUnitOffset=e*this._metersPerElevationInfoUnit,this._renderUnitOffset=0}addOffsetRenderUnits(e){this._renderUnitOffset+=e}geometryZWithOffset(e,r){const i=this.calculateOffsetRenderUnits(r);return this.featureExpressionInfoContext!=null?i:e+i}calculateOffsetRenderUnits(e){let r=this._meterUnitOffset;const i=this.featureExpressionInfoContext;return i!=null&&(r+=pit(i)*this._metersPerElevationInfoUnit),r/e.unitInMeters+this._renderUnitOffset}setFromElevationInfo(e){this.mode=e.mode,this.unit=ait(e.unit)?e.unit:"meters",this.offsetElevationInfoUnits=e.offset??0}updateFeatureExpressionInfoContext(e,r,i){if(e==null)return void(this._featureExpressionInfoContext=null);const n=e&&e.arcade;n&&r!=null&&i!=null?(this._featureExpressionInfoContext=dit(e),P8(this._featureExpressionInfoContext,OEe(n.modules,r,i))):this._featureExpressionInfoContext=e}static fromElevationInfo(e){const r=new MEe;return e!=null&&r.setFromElevationInfo(e),r}},mit=class{constructor(e,r,i){this.graphic=e,this.renderingInfo=r,this.layer=i}};var zt;(function(t){t[t.INVISIBLE=0]="INVISIBLE",t[t.TRANSPARENT=1]="TRANSPARENT",t[t.OPAQUE=2]="OPAQUE"})(zt||(zt={}));let git=class{constructor(e,r,i){this.baseMaterial=e,this.edgeMaterials=r,this.properties=i}},um=class{get isElevationSource(){return!!this.stageObject.lastValidElevationBB}constructor(e,r,i,n,s,o,a,l=null){this.graphics3DSymbolLayer=e,this.stageObject=r,this._uniqueGeometries=i,this._uniqueMaterials=n,this._sharedResource=s,this.elevationAligner=o,this.elevationContext=a,this._edgeState=l,this.type="object3d",this._stageLayer=null,this._visible=!1,this._addedToStage=!1,this.alignedSampledElevation=0,this.needsElevationUpdates=!1,this.useObjectOriginAsAttachmentOrigin=!1}initialize(e){this._stageLayer=e;const r=e.stage;r.addMany(this._uniqueMaterials),r.addMany(this._uniqueGeometries),r.add(this.stageObject)}destroy(){if(!this._stageLayer)return;const e=this._stageLayer.stage;e.removeMany(this._uniqueMaterials),e.removeMany(this._uniqueGeometries),e.remove(this.stageObject),this._addedToStage&&(this._stageLayer.remove(this.stageObject),this._addedToStage=!1);const r=e.renderer.ensureEdgeView();r.hasObject(this.stageObject)&&r.removeObject(this.stageObject),this.stageObject.dispose(),this._sharedResource!=null&&this._sharedResource.release(),this._visible=!1,this._stageLayer=null}layerOpacityChanged(e,r){if(this._edgeState==null)return;const i=Doe(this._edgeState.baseMaterial);let n=!1;for(const s of this._edgeState.edgeMaterials)s.objectTransparency!==i&&(s.objectTransparency=i,n=!0);n&&this.resetEdgeObject(r),this._stageLayer.stage.renderer.ensureEdgeView().updateAllComponentOpacities(this.stageObject,[e])}slicePlaneEnabledChanged(e,r){this._edgeState!=null&&(this._stageLayer.stage.renderer.ensureEdgeView().updateAllComponentMaterials(this.stageObject,this._edgeState.edgeMaterials,{hasSlicePlane:e},!r),this._edgeState.properties.hasSlicePlane=e)}setVisibility(e){if(this._stageLayer!=null&&this._visible!==e&&(this._visible=e,this.stageObject.visible=e,this._visible&&!this._addedToStage&&(this._stageLayer.add(this.stageObject),this._addedToStage=!0),this._edgeState)){const r=this._stageLayer.stage.renderer.ensureEdgeView();r.hasObject(this.stageObject)?r.updateObjectVisibility(this.stageObject,e):e&&this._addOrUpdateEdgeObject(r,!1)}}get visible(){return this._visible}alignWithElevation(e,r,i,n){if(this.elevationAligner==null)return;i!=null&&P8(this.elevationContext.featureExpressionInfoContext,i);const s=(o,a)=>J_(o,e,this.elevationContext,r,a);this.alignedSampledElevation=this.elevationAligner(this,this.elevationContext,e.spatialReference,s,r),this.resetEdgeObject(n)}alignWithAbsoluteElevation(e,r,i){const n=(s,o)=>{o.sampledElevation=e,o.verticalDistanceToGround=0,o.z=e};this.alignedSampledElevation=this.elevationAligner(this,this.elevationContext,null,n,r),this.resetEdgeObject(i)}getCenterObjectSpace(e=O()){return re(e,this.stageObject.boundingVolumeObjectSpace.bounds)}getBoundingBoxObjectSpace(e=ps()){const r=this.stageObject.boundingVolumeObjectSpace;return C1e(e,r.min),A1e(e,r.max),e}computeAttachmentOrigin(e){if(this.useObjectOriginAsAttachmentOrigin){const r=this.stageObject.shaderTransformation;e.render.origin[0]+=r[12],e.render.origin[1]+=r[13],e.render.origin[2]+=r[14],e.render.num++}else for(const r of this.stageObject.geometries)r.computeAttachmentOrigin(_m)&&(De(_m,_m,this.stageObject.shaderTransformation),oe(e.render.origin,e.render.origin,_m),e.render.num++)}async getProjectedBoundingBox(e,r,i,n,s){const o=this.getBoundingBoxObjectSpace(s),a=yit,l=QY(o)?1:a.length;for(let u=0;u{var s;return(s=this._stageLayer)==null?void 0:s.sync()})}};function Doe(t){return t.isVisible()?t.parameters.transparent?zt.TRANSPARENT:zt.OPAQUE:zt.INVISIBLE}const D1=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],N0=O(),_m=O(),yit=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];let $Ee=class{constructor(e,r=null){this.labelText=r,this.elevationOffset=e??0}};var $n;(function(t){t[t.RecreateSymbol=0]="RecreateSymbol",t[t.RecreateGraphics=1]="RecreateGraphics",t[t.FastUpdate=2]="FastUpdate"})($n||($n={}));let mJ=class{constructor(e){this.schedule=e,this._abortController=null,this._loadStatus=eu.LOADING,this._loadError=null,this._loader=null,this.logger=null}destroy(){this.abortLoad()}get loadStatus(){return this._loadStatus}load(e,r){return this._loadStatus===eu.LOADED?(e&&e(),this._loader??Promise.resolve()):this._loadStatus===eu.FAILED?(r&&r(this._loadError),this._loader??Promise.resolve()):(this._loader==null&&(this._abortController=new AbortController,this._loader=this.doLoad(this._abortController.signal).then(()=>{this._abortController=null,this._loadStatus=eu.LOADED},i=>{throw this._loadError=i,this._abortController=null,this._loadStatus=eu.FAILED,!Zn(i)&&this.logger&&i.message&&this.logger.warn(i.message),i})),this._loader.then(e,r).catch(()=>{}),this._loader)}abortLoad(){this._abortController!=null?this._abortController=yu(this._abortController):this._loadStatus===eu.LOADING&&(this._loadStatus=eu.FAILED),this._loader=null}};var eu;(function(t){t[t.LOADING=0]="LOADING",t[t.LOADED=1]="LOADED",t[t.FAILED=2]="FAILED"})(eu||(eu={}));const IEe=3,HH=3,LEe=10;let DEe=class{constructor(e,r=null){this.geometry=e,this.textures=r}};function sI(t){const e=[];return t.levels.forEach(r=>r.components.forEach(i=>e.push(i.geometry.material))),HF(e)}function Noe(t){const e=new Array;return t.levels.forEach(r=>{r.components.forEach(i=>{i.textures!=null&&e.push(...i.textures)})}),HF(e)}function NEe(t){const e=t.components.map(r=>r.geometry);return HF(e)}function Foe(t){const e=[];return t.levels.forEach(r=>{r.components.forEach(i=>{e.push(i.geometry)})}),HF(e)}function _it(t){switch(t){case"sphere":case"cube":case"diamond":case"cylinder":case"cone":case"inverted-cone":case"tetrahedron":return!0}return!1}function FEe(t,e){const r=(i,n,s=!1)=>({levels:i.map(o=>{const a=n(o.tesselation);return s&&PXe(a),{components:[new DEe(a)],faceCount:a.indexCount/3,minScreenSpaceRadius:o.minScreenSpaceRadius}})});switch(t){case"sphere":return r([{tesselation:0,minScreenSpaceRadius:0},{tesselation:1,minScreenSpaceRadius:8},{tesselation:2,minScreenSpaceRadius:16},{tesselation:3,minScreenSpaceRadius:50},{tesselation:4,minScreenSpaceRadius:250}],i=>AXe(e,.5,i,!0));case"cube":return r([{tesselation:0,minScreenSpaceRadius:0}],()=>_Xe(e,1));case"cone":return r(L9,i=>Nne(e,1,.5,i,!1),!0);case"inverted-cone":return r(L9,i=>Nne(e,1,.5,i,!0),!0);case"cylinder":return r(L9,i=>RXe(e,1,.5,i,[0,0,1],[0,0,.5]));case"tetrahedron":return r([{tesselation:0,minScreenSpaceRadius:0}],()=>CXe(e,1),!0);case"diamond":return r([{tesselation:0,minScreenSpaceRadius:0}],()=>xXe(e,1),!0);default:return}}const L9=[{tesselation:6,minScreenSpaceRadius:0},{tesselation:18,minScreenSpaceRadius:7},{tesselation:64,minScreenSpaceRadius:65}];function vit(t){return t.type==="fill"}function bit(t){return t.type==="extrude"}function wit(t){return t&&t.enabled&&(bit(t)||vit(t))&&t.edges!=null}function xit(t){return t&&t.enabled&&t.edges||null}function UEe(t,e){return Tit(xit(t),e)}function Tit(t,e){if(t==null)return null;const r=t.color!=null?_Z(it.toUnitRGBA(t.color)):$t(0,0,0,0),i=ha(t.size),n=ha(t.extensionLength);switch(t.type){case"solid":return Sit({color:r,size:i,extensionLength:n,...e});case"sketch":return Eit({color:r,size:i,extensionLength:n,...e});default:return}}function Sit(t){return{...Cit,...t,type:"solid"}}function Eit(t){return{...Ait,...t,type:"sketch"}}const Cit={color:$t(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:zt.OPAQUE,hasSlicePlane:!1},Ait={color:$t(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:zt.OPAQUE,hasSlicePlane:!1},gJ={primitivesPerFeature:0,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!0,memory:{bytesPerFeature:0,bytesPerCoordinate:0,bytesPerFeatureLabel:0,resourceBytes:0,draped:{bytesPerFeature:0,bytesPerFeatureLabel:0,bytesPerCoordinate:0}}};function dLt(t){return t.type==="web-style"?gJ:yJ(t.symbolLayers.toArray().map(e=>kEe(t,e)))}function yJ(t){let e=0,r=0,i=0,n=!1,s=0;const o={bytesPerFeature:0,bytesPerFeatureLabel:0,bytesPerCoordinate:0,resourceBytes:0,draped:{bytesPerFeature:0,bytesPerFeatureLabel:0,bytesPerCoordinate:0}};for(const a of t)a!=null&&(e+=a.primitivesPerFeature,r+=a.primitivesPerCoordinate,i+=a.drawCallsPerFeature,o.bytesPerFeature+=a.memory.bytesPerFeature,o.bytesPerFeatureLabel+=a.memory.bytesPerFeatureLabel,o.bytesPerCoordinate+=a.memory.bytesPerCoordinate,o.resourceBytes+=a.memory.resourceBytes,o.draped.bytesPerFeature+=a.memory.bytesPerFeature,o.draped.bytesPerFeatureLabel+=a.memory.bytesPerFeatureLabel,o.draped.bytesPerCoordinate+=a.memory.bytesPerCoordinate,n=n||a.estimated,++s);return{primitivesPerFeature:e,primitivesPerCoordinate:r,drawCallsPerFeature:i,estimated:n,memory:o,numComplexities:s}}function pLt(t){const e=yJ(t);return e.numComplexities>0&&(e.primitivesPerFeature/=e.numComplexities,e.primitivesPerCoordinate/=e.numComplexities,e.drawCallsPerFeature/=e.numComplexities,e.memory.bytesPerFeature/=e.numComplexities,e.memory.bytesPerFeatureLabel/=e.numComplexities,e.memory.bytesPerCoordinate/=e.numComplexities,e.memory.resourceBytes/=e.numComplexities,e.memory.draped.bytesPerFeature/=e.numComplexities,e.memory.draped.bytesPerFeatureLabel/=e.numComplexities,e.memory.draped.bytesPerCoordinate/=e.numComplexities),e}const Uoe={};function kEe(t,e){var n;const r=zEe(t,e),i=wit(e)?2:0;switch(e.type){case"extrude":return{primitivesPerFeature:-4,primitivesPerCoordinate:4,drawCallsPerFeature:i,estimated:!1,memory:r};case"fill":return t.type==="mesh-3d"?{primitivesPerFeature:0,primitivesPerCoordinate:0,drawCallsPerFeature:i,estimated:!1,memory:r}:e.outline!=null&&e.outline.size>0?{primitivesPerFeature:-4,primitivesPerCoordinate:3,drawCallsPerFeature:0,estimated:!1,memory:r}:{primitivesPerFeature:-2,primitivesPerCoordinate:1,drawCallsPerFeature:0,estimated:!1,memory:r};case"water":return{primitivesPerFeature:-2,primitivesPerCoordinate:1,drawCallsPerFeature:0,estimated:!1,memory:r};case"line":return{primitivesPerFeature:-2,primitivesPerCoordinate:2,drawCallsPerFeature:0,estimated:!1,memory:r};case"object":return(n=e.resource)!=null&&n.href?{primitivesPerFeature:16,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!0,memory:r}:{...Oit(e.resource&&e.resource.primitive||N1e),memory:r};case"path":{let s=0,o=0;switch(e.profile){case"circle":s=LEe;break;case"quad":s=4;break;default:return void(e.profile,void 0)}switch(e.join??"simple"){case"round":o=IEe;break;case"miter":case"bevel":o=1;break;default:return}const a=2*s,l=s*o*2;let c=-2*l-a;switch(e.cap){case"none":break;case"butt":case"square":c+=2*(s-1);break;case"round":c+=2*(s*(HH-1)*2+s);break;default:return}return{primitivesPerFeature:c,primitivesPerCoordinate:l+a,drawCallsPerFeature:0,estimated:!1,memory:r}}case"text":case"icon":return{primitivesPerFeature:2,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!1,memory:r};default:return}}function zEe(t,e){const r=t.type==="point-3d";switch(e.type){case"extrude":return e.edges&&e.edges.size>0?sl.EXTRUDE_EDGES:sl.EXTRUDE;case"fill":return e.outline!=null&&e.outline.size>0?sl.FILL_OUTLINE:sl.FILL;case"water":return sl.FILL;case"line":return e.join==="round"?sl.LINE_ROUND:sl.LINE_MITER;case"path":switch(e.join){case"round":switch(e.profile){case"circle":return sl.PATH_ROUND_CIRCLE;case"quad":return sl.PATH_ROUND_QUAD;default:return void(e.profile,void 0)}case"miter":case"bevel":switch(e.profile){case"circle":return sl.PATH_MITER_CIRCLE;case"quad":return sl.PATH_MITER_QUAD;default:return void(e.profile,void 0)}default:return}case"object":return r?sl.OBJECT_POINT:sl.OBJECT_POLYGON;case"icon":case"text":return r?sl.ICON_POINT:sl.ICON_POLYGON;default:return}}function Oit(t){let e=Uoe[t];if(e)return e;const r=FEe(t,null);return e={primitivesPerFeature:NEe(r.levels[0]).reduce((i,n)=>i+n.indices.get(E.POSITION).length/3,0),primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!1},Uoe[t]=e,e}const sl={ICON_POINT:{bytesPerFeature:2321.5204640676384,bytesPerFeatureLabel:990.45722,bytesPerCoordinate:0,resourceBytes:0,draped:{bytesPerFeature:2169.5155951150787,bytesPerFeatureLabel:999.2598599999999,bytesPerCoordinate:0}},ICON_POLYGON:{bytesPerFeature:3822.4566594216512,bytesPerFeatureLabel:1004.4288266666666,bytesPerCoordinate:3.8232947206245864,resourceBytes:0,draped:{bytesPerFeature:3656.161389156324,bytesPerFeatureLabel:994.9227800000001,bytesPerCoordinate:3.836714603517761}},OBJECT_POINT:{bytesPerFeature:1286.2669145138564,bytesPerFeatureLabel:1011.4901900000001,bytesPerCoordinate:0,resourceBytes:0,draped:{bytesPerFeature:1286.2669145138564,bytesPerFeatureLabel:1011.4901900000001,bytesPerCoordinate:0}},OBJECT_POLYGON:{bytesPerFeature:2796.828455517831,bytesPerFeatureLabel:1012.9951500000002,bytesPerCoordinate:4.051546356517487,resourceBytes:0,draped:{bytesPerFeature:2796.828455517831,bytesPerFeatureLabel:1012.9951500000002,bytesPerCoordinate:4.051546356517487}},LINE_MITER:{bytesPerFeature:4906.045480276492,bytesPerFeatureLabel:1002.8815266666666,bytesPerCoordinate:24.04850207798191,resourceBytes:0,draped:{bytesPerFeature:4315.785832179941,bytesPerFeatureLabel:998.7028333333334,bytesPerCoordinate:19.457038722015074}},LINE_ROUND:{bytesPerFeature:4893.576398024015,bytesPerFeatureLabel:1015.8812866666666,bytesPerCoordinate:24.039686621147293,resourceBytes:0,draped:{bytesPerFeature:4321.076505943878,bytesPerFeatureLabel:1008.7058400000001,bytesPerCoordinate:19.522527447599565}},PATH_MITER_CIRCLE:{bytesPerFeature:27475.37385725739,bytesPerFeatureLabel:945.1915,bytesPerCoordinate:1936.190695268645,resourceBytes:0,draped:{bytesPerFeature:27475.37385725739,bytesPerFeatureLabel:945.1915,bytesPerCoordinate:1936.190695268645}},PATH_ROUND_CIRCLE:{bytesPerFeature:13432.532036888486,bytesPerFeatureLabel:949.8167000000001,bytesPerCoordinate:4250.913048917402,resourceBytes:0,draped:{bytesPerFeature:13432.532036888486,bytesPerFeatureLabel:949.8167000000001,bytesPerCoordinate:4250.913048917402}},PATH_MITER_QUAD:{bytesPerFeature:17083.041162790672,bytesPerFeatureLabel:1006.4104,bytesPerCoordinate:1543.9135284683243,resourceBytes:0,draped:{bytesPerFeature:17083.041162790672,bytesPerFeatureLabel:1006.4104,bytesPerCoordinate:1543.9135284683243}},PATH_ROUND_QUAD:{bytesPerFeature:24054.406240577355,bytesPerFeatureLabel:976.0122999999999,bytesPerCoordinate:2683.863857257418,resourceBytes:0,draped:{bytesPerFeature:24054.406240577355,bytesPerFeatureLabel:976.0122999999999,bytesPerCoordinate:2683.863857257418}},FILL:{bytesPerFeature:5336.950602511737,bytesPerFeatureLabel:993.6785799999999,bytesPerCoordinate:9.558162275921951,resourceBytes:0,draped:{bytesPerFeature:4643.732435264264,bytesPerFeatureLabel:1003.6394400000001,bytesPerCoordinate:8.123952159573538}},FILL_OUTLINE:{bytesPerFeature:8210.8457089066,bytesPerFeatureLabel:1006.2871066666667,bytesPerCoordinate:14.496686428135353,resourceBytes:0,draped:{bytesPerFeature:6982.149803527473,bytesPerFeatureLabel:1005.1158800000001,bytesPerCoordinate:11.034666572000932}},EXTRUDE:{bytesPerFeature:16336.386002724352,bytesPerFeatureLabel:1013.2957066666665,bytesPerCoordinate:40.50904192903909,resourceBytes:0,draped:{bytesPerFeature:16336.386002724352,bytesPerFeatureLabel:1013.2957066666665,bytesPerCoordinate:40.50904192903909}},EXTRUDE_EDGES:{bytesPerFeature:18251.260762353977,bytesPerFeatureLabel:1044.1864133333333,bytesPerCoordinate:40.594518397678755,resourceBytes:0,draped:{bytesPerFeature:18251.260762353977,bytesPerFeatureLabel:1044.1864133333333,bytesPerCoordinate:40.594518397678755}}},vx=J.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayer");let hm=class extends mJ{constructor(e,r,i,n){super(i.schedule),this.symbol=e,this.symbolLayer=r,this._context=i,this._elevationInfoOverride=null,this.ignoreDrivers=!1,this._drivenProperties={color:!1,opacity:!1,opacityAlwaysOpaque:!0,size:!1},this.complexity=null,this.logger=vx,this._elevationOptions={supportsOffsetAdjustment:!1,supportsOnTheGround:!0},this.skipHighSymbolLodsChanged=!0,this._renderPriority=n.renderPriority,this._renderPriorityStep=n.renderPriorityStep,this._elevationContext=new wp,this.complexity=this.computeComplexity(),this.ignoreDrivers=n.ignoreDrivers,this.ignoreDrivers||(this._drivenProperties=koe(this._context.renderer)),this._updateElevationContext()}getCachedSize(){return null}get extentPadding(){return 0}_drivenPropertiesChanged(e){if(this.ignoreDrivers)return!1;const r=this._drivenProperties,i=koe(e);return i.color!==r.color||i.opacity!==r.opacity||i.opacityAlwaysOpaque!==r.opacityAlwaysOpaque||i.size!==r.size}get needsDrivenTransparentPass(){return this._drivenProperties.opacity&&!this._drivenProperties.opacityAlwaysOpaque}_logGeometryCreationWarnings(e,r,i,n){const s=e.projectionSuccess,o="polygons"in e?e.polygons:null,a=`${n} geometry failed to be created`;let l=null;s?!this._logGeometryValidationWarnings(r,i,n)&&o&&o.length===0&&i==="rings"&&r.length>0&&r[0].length>2&&(l=`${a} (filled rings should use clockwise winding - try reversing the order of vertices)`):l=`${a} (failed to project geometry to view spatial reference)`,l&&vx.warnOncePerTick(l)}_logGeometryValidationWarnings(e,r,i){const n=`${i} geometry failed to be created`;return!e.length||e.length===1&&!e[0].length?(vx.warnOncePerTick(`${n} (no ${r} were defined)`),!0):(!Array.isArray(e)||!Array.isArray(e[0]))&&(vx.warnOncePerTick(`${n} (${r} should be defined as a 2D array)`),!0)}_validateGeometry(e,r=null,i=null){if(r!=null&&!r.includes(e.type))return this.logger.warn("unsupported geometry type for "+i+` symbol: ${e.type}`),!1;if(e.type==="point"){const n=e;if(!isFinite(n.x)||!isFinite(n.y))return vx.warn("point coordinate is not a valid number, graphic skipped"),!1}return!0}_defaultElevationInfoNoZ(){return Rit}_defaultElevationInfoZ(){return Pit}_updateElevationContext(){this._elevationInfoOverride!=null?(this._elevationContext.setFromElevationInfo(this._elevationInfoOverride),this._elevationContext.updateFeatureExpressionInfoContext(null)):this._context.layer.elevationInfo?(this._elevationContext.setFromElevationInfo(this._context.layer.elevationInfo),this._elevationContext.updateFeatureExpressionInfoContext(this._context.featureExpressionInfoContext)):this._elevationContext.reset()}getDefaultElevationInfo(e){return e.hasZ?this._defaultElevationInfoZ():this._defaultElevationInfoNoZ()}getGeometryElevationMode(e,r=this.getDefaultElevationInfo(e)){return this._elevationContext.mode||r.mode}setElevationInfoOverride(e){this._elevationInfoOverride=e,this._updateElevationContext()}setGraphicElevationContext(e,r){const i=e.geometry,n=this.getDefaultElevationInfo(i);r.unit=this._elevationContext.unit!=null?this._elevationContext.unit:n.unit,r.mode=this.getGeometryElevationMode(i,n),r.offsetMeters=this._elevationContext.meterUnitOffset??n.offset??0;const s=!this._elevationOptions.supportsOnTheGround&&r.mode==="on-the-ground";s&&(r.mode="relative-to-ground",r.offsetMeters=0);const o=s?fit:this._elevationContext.featureExpressionInfoContext;return r.updateFeatureExpressionInfoContext(o,e,this._context.layer),r}prepareSymbolLayerPatch(e){}updateGeometry(e,r){return!1}updateTransform(e,r,i,n){return!1}onRemoveGraphic(e){}_getLayerOpacity(){return this._context.graphicsCoreOwner&&"fullOpacity"in this._context.graphicsCoreOwner?this._context.graphicsCoreOwner.fullOpacity??0:this._context.layer.opacity??1}_getCombinedOpacity(e,r=zoe){let i=1;return this.draped||(i*=this._getLayerOpacity()),this._drivenProperties.opacity||(e!=null?i*=e.a:r.hasIntrinsicColor||(i=0)),i}_getCombinedOpacityAndColor(e,r=zoe){const i=this._getCombinedOpacity(e,r);if(this._drivenProperties.color)return dO(null,i);const n=e!=null?it.toUnitRGB(e):pg;return dO(n,i)}_getVertexOpacityAndColor(e,r=null){const i=this._drivenProperties.color?e.color:null,n=this._drivenProperties.opacity?e.opacity:null,s=dO(i,n);return r&&(s[0]*=r,s[1]*=r,s[2]*=r,s[3]*=r),s}isFastUpdatesEnabled(){return this._fastUpdates!=null}computeComplexity(){return kEe(this.symbol,this.symbolLayer)}globalPropertyChanged(e,r,i){switch(e){case"opacity":return this.layerOpacityChanged(r,i),!0;case"elevationInfo":{const n=this._elevationContext.mode;return this._updateElevationContext(),this.layerElevationInfoChanged(r,i,n)!==an.RECREATE}case"slicePlaneEnabled":return this.slicePlaneEnabledChanged(r,i);case"physicalBasedRenderingEnabled":return this.physicalBasedRenderingChanged();case"pixelRatio":return this.pixelRatioChanged;case"skipHighSymbolLods":return this.skipHighSymbolLodsChanged;default:return!1}}get pixelRatioChanged(){return!0}updateGraphics3DGraphicElevationInfo(e,r,i){let n=an.UPDATE;return e.forEach(s=>{const o=r(s);if(o!=null){const a=s.graphic;this.setGraphicElevationContext(a,o.elevationContext),o.needsElevationUpdates=i(o.elevationContext.mode)}else n=an.RECREATE}),n}applyRendererDiff(e,r){return $n.RecreateSymbol}getFastUpdateAttrValues(e){if(!this._fastUpdates)return null;const r=this._fastUpdates.visualVariables,i=r.size?ip(r.size.field,e):0,n=r.color?ip(r.color.field,e):0,s=r.opacity?ip(r.opacity.field,e):0;return $t(i,n,s,0)}get draped(){return this._draped}ensureDrapedStatus(e){return this._draped==null?(this._draped=e,!0):(e!==this.draped&&vx.warnOnce("A symbol can only produce either draped or non-draped visualizations. Use two separate symbol instances for draped and non-draped graphics if necessary."),!1)}test(){const e=()=>{var r,i,n,s,o,a,l,c;return{size:((i=(r=this._fastUpdates)==null?void 0:r.visualVariables.size)==null?void 0:i.field)??null,color:((s=(n=this._fastUpdates)==null?void 0:n.visualVariables.color)==null?void 0:s.field)??null,opacity:((a=(o=this._fastUpdates)==null?void 0:o.visualVariables.opacity)==null?void 0:a.field)??null,rotation:((c=(l=this._fastUpdates)==null?void 0:l.visualVariables.rotation)==null?void 0:c.field)??null}};return{drivenProperties:this._drivenProperties,getVisVarFields:e}}};function koe(t){const e={color:!1,opacity:!1,opacityAlwaysOpaque:!0,size:!1};return t&&"visualVariables"in t&&t.visualVariables&&t.visualVariables.forEach(r=>{switch(r.type){case"color":if(e.color=!0,r.stops)for(let i=0;i0;)this.removeGeometry(0)}geometryVertexAttrsUpdated(e){this._emit("objectGeometryUpdated",{object:this,geometry:e}),this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(e){if(this._visible!==e){this._visible=e;for(const r of this._geometries)r.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const e=new h5(Hg.MaskOccludee);for(const r of this._geometries)r.occludees=sH(r.occludees,e);return this._emit("occlusionChanged",this),e}removeOcclude(e){for(const r of this._geometries)r.occludees=oH(r.occludees,e);this._emit("occlusionChanged",this)}highlight(){const e=new h5(Hg.Highlight);for(const r of this._geometries)r.highlights=sH(r.highlights,e);return this._emit("highlightChanged",this),e}removeHighlight(e){for(const r of this._geometries)r.highlights=oH(r.highlights,e);this._emit("highlightChanged",this)}getCombinedStaticTransformation(e,r){return Vr(r,this.transformation,e.transformation)}getCombinedShaderTransformation(e,r=_e()){return Vr(r,this.shaderTransformation,e.shaderTransformation)}hasVolativeTransformation(){return this._hasVolatileTransformation}get boundingVolumeWorldSpace(){return this._bvWorldSpace&&!this._hasVolatileTransformation||(this._bvWorldSpace=this._bvWorldSpace||new Boe,this._validateBoundingVolume(this._bvWorldSpace,pO.WorldSpace)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace&&!this._hasVolatileTransformation||(this._bvObjectSpace=this._bvObjectSpace||new Boe,this._validateBoundingVolume(this._bvObjectSpace,pO.ObjectSpace)),this._bvObjectSpace}_validateBoundingVolume(e,r){const i=r===pO.ObjectSpace;for(const n of this._geometries){const s=n.boundingInfo;s&&Mit(s,e,i?n.shaderTransformation:this.getCombinedShaderTransformation(n))}Lr(e.bounds,e.min,e.max,.5);for(const n of this._geometries){const s=n.boundingInfo;if(s==null)continue;const o=i?n.shaderTransformation:this.getCombinedShaderTransformation(n),a=MS(o);De(Voe,s.center,o);const l=ci(Voe,e.bounds),c=s.radius*a;e.bounds[3]=Math.max(e.bounds[3],l+c)}}_invalidateBoundingVolume(){var r;const e=(r=this._bvWorldSpace)==null?void 0:r.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this._parentLayer&&e&&this._parentLayer.notifyObjectBBChanged(this,e)}_emit(e,r){this._parentLayer&&this._parentLayer.events.emit(e,r)}get test(){const e=this;return{hasGeometry:r=>e._geometries.includes(r),getGeometryIndex:r=>e._geometries.indexOf(r)}}},BEe=class{constructor(){this.min=Se(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.max=Se(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)}isEmpty(){return this.max[0]s.camera.fullViewport),new Ce("lineSize",(n,s)=>n.size>0?Math.max(1,n.size)*s.camera.pixelRatio:0),new yr("pixelToNDC",(n,s)=>er(joe,2/s.camera.fullViewport[2],2/s.camera.fullViewport[3])),new Ce("borderSize",(n,s)=>n.borderColor!=null?s.camera.pixelRatio:0),new yr("screenOffset",(n,s)=>er(joe,n.screenOffset[0]*s.camera.pixelRatio,n.screenOffset[1]*s.camera.pixelRatio))),e.varyings.add("coverageSampling","vec4"),e.varyings.add("lineSizes","vec2"),t.hasMultipassGeometry&&e.varyings.add("depth","float"),t.hasScreenSizePerspective&&w8(r),r.code.add(w` + void main(void) { + ProjectHUDAux projectAux; + vec4 endPoint = projectPositionHUD(projectAux); + + vec3 vpos = projectAux.posModel; + if (rejectBySlice(vpos)) { + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } + ${t.occlusionTestEnabled?w` + if (!testVisibilityHUD(endPoint)) { + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + }`:""} + + ${t.hasScreenSizePerspective?w` + vec4 perspectiveFactor = screenSizePerspectiveScaleFactor(projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment); + vec2 screenOffsetScaled = applyScreenSizePerspectiveScaleFactorVec2(screenOffset, perspectiveFactor); + `:w`vec2 screenOffsetScaled = screenOffset;`} + // Add view dependent polygon offset to get exact same original starting point. This is mostly used to get the + // correct depth value + vec3 posView = (view * vec4(position, 1.0)).xyz; + ${t.hasMultipassGeometry?"depth = posView.z;":""} + + applyHUDViewDependentPolygonOffset(auxpos1.w, projectAux.absCosAngle, posView); + vec4 startPoint = proj * vec4(posView, 1.0); + // Apply screen offset to both start and end point + vec2 screenOffsetNorm = screenOffsetScaled * 2.0 / viewport.zw; + startPoint.xy += screenOffsetNorm * startPoint.w; + endPoint.xy += screenOffsetNorm * endPoint.w; + // Align start and end to pixel origin + vec4 startAligned = alignToPixelOrigin(startPoint, viewport.zw); + vec4 endAligned = alignToPixelOrigin(endPoint, viewport.zw); + ${t.depthHudEnabled?t.depthHudAlignStartEnabled?w`endAligned = vec4(endAligned.xy / endAligned.w * startAligned.w, startAligned.zw);`:w`startAligned = vec4(startAligned.xy / startAligned.w * endAligned.w, endAligned.zw);`:""} + vec4 projectedPosition = mix(startAligned, endAligned, uv0.y); + // The direction of the line in screen space + vec2 screenSpaceDirection = normalize(endAligned.xy / endAligned.w - startAligned.xy / startAligned.w); + vec2 perpendicularScreenSpaceDirection = vec2(screenSpaceDirection.y, -screenSpaceDirection.x); + ${t.hasScreenSizePerspective?w` + float lineSizeScaled = applyScreenSizePerspectiveScaleFactorFloat(lineSize, perspectiveFactor); + float borderSizeScaled = applyScreenSizePerspectiveScaleFactorFloat(borderSize, perspectiveFactor); + `:w` + float lineSizeScaled = lineSize; + float borderSizeScaled = borderSize; + `} + float halfPixelSize = lineSizeScaled * 0.5; + + // Compute full ndc offset, adding 1px padding for doing anti-aliasing and the border size + float padding = 1.0 + borderSizeScaled; + vec2 ndcOffset = (-halfPixelSize - padding + uv0.x * (lineSizeScaled + padding + padding)) * pixelToNDC; + + // Offset x/y from the center of the line in screen space + projectedPosition.xy += perpendicularScreenSpaceDirection * ndcOffset * projectedPosition.w; + + // Compute a coverage varying which we can use in the fragment shader to determine + // how much a pixel is actually covered by the line (i.e. to anti alias the line). + // This works by computing two coordinates that can be linearly interpolated and then + // subtracted to find out how far away from the line edge we are. + float edgeDirection = (uv0.x * 2.0 - 1.0); + + float halfBorderSize = 0.5 * borderSizeScaled; + float halfPixelSizeAndBorder = halfPixelSize + halfBorderSize; + float outerEdgeCoverageSampler = edgeDirection * (halfPixelSizeAndBorder + halfBorderSize + 1.0); + + float isOneSided = float(lineSizeScaled < 2.0 && borderSize < 2.0); + + coverageSampling = vec4( + // Edge coordinate + outerEdgeCoverageSampler, + + // Border edge coordinate + outerEdgeCoverageSampler - halfPixelSizeAndBorder * isOneSided, + + // Line offset + halfPixelSize - 0.5, + + // Border offset + halfBorderSize - 0.5 + halfPixelSizeAndBorder * (1.0 - isOneSided) + ); + + lineSizes = vec2(lineSizeScaled, borderSizeScaled); + + gl_Position = projectedPosition; + } + `),i.uniforms.add(new Jt("uColor",n=>Goe(n.color)),new Jt("borderColor",n=>Goe(n.borderColor))),t.hasMultipassGeometry&&(i.include(Nxe,t),i.uniforms.add(new yr("inverseViewport",(n,s)=>s.inverseViewport))),i.code.add(w` + void main() { + ${t.hasMultipassGeometry?"if( geometryDepthTest(gl_FragCoord.xy * inverseViewport, depth) ){ discard; }":""} + + // Mix between line and border coverage offsets depending on whether we need + // a border (based on the sidedness). + vec2 coverage = min(1.0 - clamp(abs(coverageSampling.xy) - coverageSampling.zw, 0.0, 1.0), lineSizes); + + // Mix between border and line color based on the line coverage (conceptually the line blends on top of the + // border background). + // + // Anti-alias by blending final result using the full (including optional border) coverage and the color alpha + float borderAlpha = uColor.a * borderColor.a * coverage.y; + float colorAlpha = uColor.a * coverage.x; + + float finalAlpha = mix(borderAlpha, 1.0, colorAlpha); + + ${t.depthHudEnabled?w` + if (finalAlpha < 0.01) { + discard; + } + `:w` + vec3 finalRgb = mix(borderColor.rgb * borderAlpha, uColor.rgb, colorAlpha); + fragColor = vec4(finalRgb, finalAlpha); + `} + } + `),e}function Goe(t){return t??Nf}const joe=Ne(),Uit=Object.freeze(Object.defineProperty({__proto__:null,build:Fit},Symbol.toStringTag,{value:"Module"}));let YEe=class ZEe extends Tr{initializeConfiguration(e,r){r.spherical=e.viewingMode===$e.Global}initializeProgram(e){return new vr(e.rctx,ZEe.shader.get().build(this.configuration),fr)}setPipelineState(e){const r=e?Hr.ALWAYS:Hr.LESS;return this.configuration.depthHudEnabled?Ot({depthTest:{func:r},depthWrite:$l}):Ot({blending:So(ve.ONE,ve.SRC_ALPHA,ve.ONE_MINUS_SRC_ALPHA,ve.ONE_MINUS_SRC_ALPHA),depthTest:{func:r},colorWrite:Ft})}initializePipeline(){return this.setPipelineState(this.configuration.hasMultipassGeometry)}};YEe.shader=new _r(Uit,()=>ce(()=>import("./LineCallout.glsl-cb1ab83b.js"),[]));let Xu=class extends Fo{constructor(){super(...arguments),this.screenCenterOffsetUnitsEnabled=Tl.World,this.spherical=!1,this.occlusionTestEnabled=!0,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.depthHudEnabled=!1,this.depthHudAlignStartEnabled=!1,this.hasSlicePlane=!1,this.hasMultipassGeometry=!1}};h([U({count:Tl.COUNT})],Xu.prototype,"screenCenterOffsetUnitsEnabled",void 0),h([U()],Xu.prototype,"spherical",void 0),h([U()],Xu.prototype,"occlusionTestEnabled",void 0),h([U()],Xu.prototype,"hasVerticalOffset",void 0),h([U()],Xu.prototype,"hasScreenSizePerspective",void 0),h([U()],Xu.prototype,"depthHudEnabled",void 0),h([U()],Xu.prototype,"depthHudAlignStartEnabled",void 0),h([U()],Xu.prototype,"hasSlicePlane",void 0),h([U()],Xu.prototype,"hasMultipassGeometry",void 0),h([U({constValue:!0})],Xu.prototype,"hasSliceInVertexProgram",void 0),h([U({constValue:!1})],Xu.prototype,"draped",void 0);let oI=class WH extends p1{get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}constructor(e){super(e,new QEe),this._configuration=new Xu,this._uniqueMaterialIdentifier=WH.uniqueMaterialIdentifier(this.parameters)}getPassParameters(){return this.parameters}getConfiguration(e,r){const i=(r==null?void 0:r.slot)!==le.LINE_CALLOUTS;return this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.hasVerticalOffset=this.parameters.verticalOffset!=null,this._configuration.hasScreenSizePerspective=this.parameters.screenSizePerspective!=null,this._configuration.depthHudEnabled=i,this._configuration.depthHudAlignStartEnabled=!!this.parameters.depthHUDAlignStart,this._configuration.screenCenterOffsetUnitsEnabled=this.parameters.centerOffsetUnits==="screen"?Tl.Screen:Tl.World,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasMultipassGeometry=r.multipassGeometry.enabled,this._configuration}intersect(){}requiresSlot(e,r){if(r===D.Color)switch(e){case le.LINE_CALLOUTS:case le.LINE_CALLOUTS_HUD_DEPTH:return!0}return!1}createGLMaterial(e){return new kit(e)}createBufferWriter(){return new Bit}validateParameters(e){const r=WH.uniqueMaterialIdentifier(e);r!==this._uniqueMaterialIdentifier&&(this._uniqueMaterialIdentifier=r)}static uniqueMaterialIdentifier(e){return JSON.stringify({screenOffset:e.screenOffset||[0,0],centerOffsetUnits:e.centerOffsetUnits||"world"})}},kit=class extends h1{beginSlot(e){return this.ensureTechnique(YEe,e)}},QEe=class extends KQ{constructor(){super(...arguments),this.screenOffset=dp,this.color=[0,0,0,1],this.size=1,this.occlusionTest=!1,this.shaderPolygonOffset=1e-5,this.depthHUDAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}};const zit=Gi().vec3f(E.POSITION).vec3f(E.NORMAL).vec2f(E.UV0).vec4f(E.AUXPOS1),Hoe=[uh(0,0),uh(1,0),uh(0,1),uh(1,0),uh(1,1),uh(0,1)];let Bit=class{constructor(){this.vertexBufferLayout=zit}elementCount(e){return 6*e.indices.get(E.POSITION).length}write(e,r,i,n,s){eJ(i.indices.get(E.POSITION),i.vertexAttributes.get(E.POSITION).data,e,n.position,s,6),tJ(i.indices.get(E.NORMAL),i.vertexAttributes.get(E.NORMAL).data,r,n.normal,s,6),HS(i.indices.get(E.AUXPOS1),i.vertexAttributes.get(E.AUXPOS1).data,n.auxpos1,s,6);for(let o=0;ol.type==="object"||l.type==="text"));if(s.type!=="label-3d"&&o||s.type==="point-3d"&&s.symbolLayers.every(l=>l.type==="text"&&!V1e(l)))return null;const a=hJ(i.geometry);return a==null?null:this._createAs3DShape(a,n,r,i.uid)}layerOpacityChanged(){var e;(e=this._material)==null||e.setParameters(this._materialParameters)}layerElevationInfoChanged(e,r,i){const n=this._elevationContext.mode,s=WP(KEe.elevationModeChangeTypes,i,n);return s!==an.UPDATE||e.forEach(o=>{const a=r(o);a!=null&&this.updateGraphicElevationContext(o.graphic,a)}),s}slicePlaneEnabledChanged(){var e;return(e=this._material)==null||e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return!0}setGraphicElevationContext(e,r,i=0){const n=super.setGraphicElevationContext(e,r);return n.addOffsetRenderUnits(i),n}updateGraphicElevationContext(e,r){this.setGraphicElevationContext(e,r.elevationContext,r.metadata!=null?r.metadata.elevationOffset:0),r.needsElevationUpdates=Bh(r.elevationContext.mode)}computeComplexity(){return{primitivesPerFeature:2,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!1,memory:gJ.memory}}_createVertexData(e){const{translation:r,centerOffset:i}=e,n=new Ue(r?[r[0],r[1],r[2]]:[0,0,0],3,!0),s=new Ue(i?[i[0],i[1],i[2],i[3]]:[0,0,0,1],4,!0);return[[E.POSITION,n],[E.NORMAL,new Ue([0,0,1],3,!0)],[E.AUXPOS1,s]]}_getOrCreateMaterial(e){const r=this._perInstanceMaterialParameters(e),i=oI.uniqueMaterialIdentifier(r);if(this._material&&i===this._material.uniqueMaterialIdentifier)return{material:this._material,isUnique:!1};if(e.materialCollection!=null){let n=e.materialCollection.get(i);return n==null&&(n=new oI(r),e.materialCollection.add(i,n)),{material:n,isUnique:!1}}return{material:new oI(r),isUnique:!0}}_createAs3DShape(e,r,i,n){const s=this._context.layer.uid,o=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:n,layerUid:s}),a=this._getOrCreateMaterial(i),l=new Xn(a.material,this._createVertexData(i),Vit,null,on.Point,o),c=_J(this._context,e,l,r,n);if(c==null)return null;const u=new um(this,c.object,[l],a.isUnique?[a.material]:null,null,Lb,r);return u.metadata=new $Ee(i.elevationOffset),u.alignedSampledElevation=c.sampledElevation,u.needsElevationUpdates=Bh(r.mode),LR(u,e,this._context.elevationProvider),u}};JEe.elevationModeChangeTypes={definedChanged:an.UPDATE,staysOnTheGround:an.UPDATE,onTheGroundChanged:an.RECREATE};const D9=[0],Vit=[[E.POSITION,D9],[E.NORMAL,D9],[E.AUXPOS1,D9]],Git={mode:"relative-to-ground",offset:0},jit={ignoreDrivers:!0,renderPriority:0,renderPriorityStep:1};let Hit=class{constructor(e,r,i=O(),n=Qt(),s=Ne(),o="world",a=0,l=null){this.renderer=e,this.symbol=r,this.translation=i,this.centerOffset=n,this.screenOffset=s,this.centerOffsetUnits=o,this.elevationOffset=a,this.materialCollection=l}},Wit=class extends mit{};const Woe=J.getLogger("esri.views.3d.layers.graphics.Graphics3DCalloutSymbolLayerFactory");function qit(t,e){if(!iZ(t))return Woe.error("Graphics3DCalloutSymbolLayerFactory#make",`symbol of type '${t.type}' does not support callouts`),null;if(!t.callout)return null;const r=Xit[t.callout.type];return r?new r(t,e):(Woe.error("Graphics3DCalloutSymbolLayerFactory#make",`unknown or unsupported callout type ${t.callout.type}`),null)}const Xit={line:JEe};let yw=class eCe{constructor(e=null,r={},i,n){this.geometry=e,this.attributes=r,this.centroid=i,this.objectId=n,this.displayId=0,this.geohashX=0,this.geohashY=0}weakClone(){const e=new eCe(this.geometry,this.attributes,this.centroid,this.objectId);return e.displayId=this.displayId,e.geohashX=this.geohashX,e.geohashY=this.geohashY,e}};function SLt(t){return!(t.geometry==null||!t.geometry.coords||!t.geometry.coords.length)}let ELt=class extends yw{},Yit=class tCe{constructor(){this.objectIdFieldName=null,this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){const e=new tCe;return e.objectIdFieldName=this.objectIdFieldName,e.globalIdFieldName=this.globalIdFieldName,e.geohashFieldName=this.geohashFieldName,e.geometryProperties=this.geometryProperties,e.geometryType=this.geometryType,e.spatialReference=this.spatialReference,e.hasZ=this.hasZ,e.hasM=this.hasM,e.features=this.features,e.fields=this.fields,e.transform=this.transform,e.exceededTransferLimit=this.exceededTransferLimit,e.uniqueIdField=this.uniqueIdField,e.queryGeometry=this.queryGeometry,e.queryGeometryType=this.queryGeometryType,e}},e1=class HD{constructor(e=[],r=[],i=!1){this.lengths=e??[],this.coords=r??[],this.hasIndeterminateRingOrder=i}static fromRect(e){const[r,i,n,s]=e,o=n-r,a=s-i;return new HD([5],[r,i,o,0,0,a,-o,0,0,-a])}get isPoint(){return this.lengths.length===0}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce((e,r)=>e+r)}forEachVertex(e){let r=0;this.lengths.length||e(this.coords[0],this.coords[1]);for(let i=0;i{t[r]=n,t[r+1]=s},qoe=(t,e,r,i,n,s)=>{t[r]=n,t[r+1]=s,t[r+2]=e[i+2]},Qit=(t,e,r,i,n,s)=>{t[r]=n,t[r+1]=s,t[r+2]=e[i+3]},Jit=(t,e,r,i,n,s)=>{t[r]=n,t[r+1]=s,t[r+2]=e[i+2],t[r+3]=e[i+3]};function vJ(t,e,r,i){if(t){if(r)return e&&i?Jit:qoe;if(e&&i)return Qit}else if(e&&i)return qoe;return Zit}function N9({scale:t,translate:e},r){return Math.round((r-e[0])/t[0])}function F9({scale:t,translate:e},r){return Math.round((e[1]-r)/t[1])}function U9({scale:t,translate:e},r,i){return r*t[i]+e[i]}function ALt(t,e,r){return t?e?r?xJ(t):bJ(t):r?wJ(t):M8(t):null}function M8(t){const e=t.coords;return{x:e[0],y:e[1]}}function iCe(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t}function bJ(t){const e=t.coords;return{x:e[0],y:e[1],z:e[2]}}function Kit(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.z,t}function wJ(t){const e=t.coords;return{x:e[0],y:e[1],m:e[2]}}function ent(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.m,t}function xJ(t){const e=t.coords;return{x:e[0],y:e[1],z:e[2],m:e[3]}}function tnt(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.z,t.coords[3]=e.m,t}function rnt(t,e,r,i){let n=M8;r&&i?n=xJ:r?n=bJ:i&&(n=wJ);for(const s of e){const{geometry:o,attributes:a}=s,l=o!=null?n(o):null;t.push({attributes:a,geometry:l})}return t}function TJ(t,e){return t&&e?tnt:t?Kit:e?ent:iCe}function int(t,e,r,i,n){const s=TJ(r,i);for(const{geometry:o,attributes:a}of e){const l=o!=null?s(new e1,o):null;t.push(new yw(l,a,null,n?a[n]:void 0))}return t}function OLt(t,e,r=TJ(e.z!=null,e.m!=null)){return r(t,e)}function nnt(t,e,r,i){for(const{geometry:n,attributes:s}of e)t.push({attributes:s,geometry:n!=null?nCe(n,r,i):null});return t}function nCe(t,e,r){if(t==null)return null;const i=_a(e,r),n=[];for(let s=0;s=l&&(t.lengths.push(C),S=T)}return mp(t.coords,S),t.coords.length?t:null}function DLt(t,e,r,i,n,s,o=r,a=i){if(Sg(t),!e||!e.coords.length)return null;const l=rCe[n],{coords:c,lengths:u}=e,d=_a(r,i),p=_a(r&&o,i&&a),m=vJ(r,i,o,a);if(!u.length)return m(t.coords,c,0,0,c[0],c[1]),Sg(t,d,0),t;let y=0;const _=s*s;for(const v of u){if(v=l?t.lengths.push(S):mp(t.coords,b*p),y+=v*d}return t.coords.length?t:null}function fnt(t,e,r,i){const n=t[e],s=t[e+1],o=t[r],a=t[r+1],l=t[i],c=t[i+1];let u=o,d=a,p=l-u,m=c-d;if(p!==0||m!==0){const y=((n-u)*p+(s-d)*m)/(p*p+m*m);y>1?(u=l,d=c):y>0&&(u+=p*y,d+=m*y)}return p=n-u,m=s-d,p*p+m*m}function qH(t,e,r,i,n,s,o){let a,l=i,c=0;for(let u=s+r;ul&&(c=u,l=a);l>i&&(c-s>r&&qH(t,e,r,i,n,s,c),n(t,e,t.length,c,e[c],e[c+1]),o-c>r&&qH(t,e,r,i,n,c,o))}function NLt(t,e,r,i){if(e==null||!e.coords||!e.coords.length)return null;const n=_a(r,i);let s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;if(e&&e.coords){const c=e.coords;for(let u=0;ux6(t,O1e),null,10,5),ynt=jt();let _nt=class{get labelLayers(){return this._labelLayers||mDe}get extent(){return this._extent}get isElevationSource(){return this.layers.some(e=>e==null?void 0:e.isElevationSource)}constructor(e,r,i,n,s){this.graphic=e,this.graphics3DSymbol=r,this.layers=i,this._visibleFlags=Uo.ALL_LABEL,this.deconflictionPriority=0,++r.referenced,this._featureExpressionFeature=s?OEe(s,e,n):null}initialize(e){this._layer=e,this._forEachSymbolLayerGraphic(r=>{r.initialize(e),r.setVisibility(this.isVisible())})}destroy(){this._forEachSymbolLayerGraphic(e=>e.destroy()),this._calloutLayer=null,--this.graphics3DSymbol.referenced,this.graphics3DSymbol=null}get destroyed(){return this.layers==null}clearLabelGraphics(){this._forEachLabelGraphic(e=>e.destroy()),this._labelLayers=null}addLabelGraphic(e,r){this._labelLayers||(this._labelLayers=new Array),this._labelLayers.push(e),e.initialize(r),e.setVisibility(this.isVisible(js.LABEL))}setCalloutGraphic(e){this._calloutLayer=e,this._layer&&(e.initialize(this._layer),e.setVisibility(this.isVisible()))}get calloutLayer(){return this._calloutLayer}get isDraped(){let e=!1;return this._forEachSymbolLayerGraphic(r=>{r.type==="draped"&&(e=!0)}),e}isVisible(e=js.GRAPHIC,r){const i=r?this._visibleFlags|r|js.LABEL*r:this._visibleFlags;return e===js.GRAPHIC?(i&Uo.ALL_GRAPHIC)===Uo.ALL_GRAPHIC:(i&Uo.ALL_LABEL)===Uo.ALL_LABEL}setVisibilityFlag(e,r,i){const n=this.isVisible(e);i?this._visibleFlags|=e*r:this._visibleFlags&=~(e*r);const s=this.isVisible(e);if(n===s)return!1;if(e===js.LABEL)this._forEachLabelGraphic(o=>o.setVisibility(s));else{this._forEachSymbolLayerGraphic(a=>a.setVisibility(s));const o=this.isVisible(js.LABEL);this._forEachLabelGraphic(a=>a.setVisibility(o))}return!0}getVisibilityFlag(e,r){return(this._visibleFlags&e*r)!=0}computeExtent(e){if(!this._extent){const r=this.graphic.geometry;if(r==null)return!1;this._extent=jt(),Crt(r,this._extent);const i=r.spatialReference;if(!Js(i,e)&&!RP(this._extent,i,this._extent,e))return this._extent=null,!1}return!0}getAsOptimizedGeometry(e,r){return this._optimizedGeometry||(this._optimizedGeometry=this._convertGraphicToOptimizedGeometry(this.graphic,e,r)),this._optimizedGeometry}_convertGraphicToOptimizedGeometry(e,r,i){let n=e.geometry;return n.type!=="mesh"&&n.type!=="extent"||(n=a1.fromExtent(n.type==="mesh"?n.extent:n)),hnt(n,r,i)}get usedMemory(){let e=KSe(this.graphic.attributes);return this._forEachSymbolLayerGraphic(r=>{const i=r.graphics3DSymbolLayer.complexity;if(i==null)return;const n=r.type==="draped"?i.memory.draped:i.memory;e+=n.bytesPerFeature,n.bytesPerCoordinate&&(e+=Ert(this.graphic.geometry)*n.bytesPerCoordinate)}),e}computeAttachmentOrigin(){const e={render:{origin:O(),num:0},draped:{origin:Ne(),num:0}};for(const r of this.layers)r!=null&&r.computeAttachmentOrigin(e);return e.render.num>1&&te(e.render.origin,e.render.origin,1/e.render.num),e.draped.num>1&&dc(e.draped.origin,e.draped.origin,1/e.draped.num),e}async getProjectedBoundingBox(e,r,i,n,s){return s||(s={boundingBox:null,requiresDrapedElevation:!1,screenSpaceObjects:[]}),s.boundingBox?vi(s.boundingBox):s.boundingBox=vi(),s.requiresDrapedElevation=!1,await r6(this.layers,async o=>{if(o==null)return;const a=o.type==="draped"?r:e,l=Zoe.acquire(),c=await o.getProjectedBoundingBox(a,i,s.screenSpaceObjects,n,l);isFinite(c[2])&&isFinite(c[5])||(s.requiresDrapedElevation=!0),c&&SS(s.boundingBox,l),Zoe.release(l)}),Y9e(s.boundingBox)||r7(ZY(s.boundingBox,ynt))?s:null}needsElevationUpdates(){var e;for(const r of this.layers)if(r!=null&&(r.type==="object3d"||r.type==="lod-instance")&&r.needsElevationUpdates)return!0;return((e=this._labelLayers)==null?void 0:e.some(r=>(r==null?void 0:r.needsElevationUpdates)??!1))??!1}alignWithElevation(e,r,i){this._forEachRenderedGraphic(n=>{n.type!=="object3d"&&n.type!=="lod-instance"||n.alignWithElevation(e,r,this._featureExpressionFeature,i)})}alignWithAbsoluteElevation(e,r,i){this._forEachRenderedGraphic(n=>{n.type==="object3d"&&n.alignWithAbsoluteElevation(e,r,i)})}addObjectStateSet(e,r){this._forEachSymbolLayerGraphic(i=>i.addObjectState(e,r))}removeObjectState(e){this._forEachSymbolLayerGraphic(r=>r.removeObjectState(e))}_forEachGraphicList(e,r){e==null||e.forEach(i=>i&&r(i))}_forEachSymbolLayerGraphic(e){this._forEachGraphicList(this.layers,e),this._calloutLayer&&e(this._calloutLayer)}_forEachLabelGraphic(e){this._forEachGraphicList(this._labelLayers,e)}_forEachRenderedGraphic(e){this._forEachSymbolLayerGraphic(e),this._forEachLabelGraphic(e)}get test(){const e=this;return{addLabelLayer:r=>{e._labelLayers||(e._labelLayers=new Array),e._labelLayers.push(r)}}}},zLt=class{constructor(e,r){this.scheduler=e,this.schedule=r,this.sharedResources=null,this.streamDataRequester=null,this.elevationProvider=null,this.renderer=null,this.stage=null,this.clippingExtent=null,this.renderCoordsHelper=null,this.overlaySR=null,this.layer=null,this.drapeSourceRenderer=null,this.graphicsCoreOwner=null,this.localOriginFactory=null,this.featureExpressionInfoContext=null,this.screenSizePerspectiveEnabled=!0,this.slicePlaneEnabled=!1,this.physicalBasedRenderingEnabled=!1,this.skipHighSymbolLods=!1,this.isAsync=!1}},vnt=class{constructor(){this.renderPriority=0,this.renderPriorityStep=1,this.ignoreDrivers=!1}};var Qoe,Joe,Koe,XH={exports:{}};XH.exports,Qoe=XH,Joe=function(){function t(M,I,L){L=L||2;var B,H,Z,K,de,Re,Ke,_t=I&&I.length,at=_t?I[0]*L:M.length,yt=e(M,0,at,L,!0),Fe=[];if(!yt||yt.next===yt.prev)return Fe;if(_t&&(yt=l(M,I,yt,L)),M.length>80*L){B=Z=M[0],H=K=M[1];for(var pe=L;peZ&&(Z=de),Re>K&&(K=Re);Ke=(Ke=Math.max(Z-B,K-H))!==0?1/Ke:0}return i(yt,Fe,L,B,H,Ke),Fe}function e(M,I,L,B,H){var Z,K;if(H===Q(M,I,L,B)>0)for(Z=I;Z=I;Z-=B)K=X(Z,M[Z],M[Z+1],K);if(K&&A(K,K.next)){var de=K.next;q(K),K=de}return K}function r(M,I){if(!M)return M;I||(I=M);var L,B=M;do if(L=!1,B.steiner||!A(B,B.next)&&S(B.prev,B,B.next)!==0)B=B.next;else{var H=B.prev;if(q(B),(B=I=H)===B.next)break;L=!0}while(L||B!==I);return I}function i(M,I,L,B,H,Z,K){if(M){!K&&Z&&y(M,B,H,Z);for(var de,Re,Ke=M;M.prev!==M.next;)if(de=M.prev,Re=M.next,Z?s(M,B,H,Z):n(M))I.push(de.i/L),I.push(M.i/L),I.push(Re.i/L),q(M),M=Re.next,Ke=Re.next;else if((M=Re)===Ke){K?K===1?i(M=o(r(M),I,L),I,L,B,H,Z,2):K===2&&a(M,I,L,B,H,Z):i(r(M),I,L,B,H,Z,1);break}}}function n(M){var I=M.prev,L=M,B=M.next;if(S(I,L,B)>=0)return!1;for(var H=M.next.next;H!==M.prev;){if(x(I.x,I.y,L.x,L.y,B.x,B.y,H.x,H.y)&&S(H.prev,H,H.next)>=0)return!1;H=H.next}return!0}function s(M,I,L,B){var H=M.prev,Z=M,K=M.next;if(S(H,Z,K)>=0)return!1;for(var de=H.xZ.x?H.x>K.x?H.x:K.x:Z.x>K.x?Z.x:K.x,_t=H.y>Z.y?H.y>K.y?H.y:K.y:Z.y>K.y?Z.y:K.y,at=v(de,Re,I,L,B),yt=v(Ke,_t,I,L,B),Fe=M.prevZ,pe=M.nextZ;Fe&&Fe.z>=at&&pe&&pe.z<=yt;){if(Fe!==M.prev&&Fe!==M.next&&x(H.x,H.y,Z.x,Z.y,K.x,K.y,Fe.x,Fe.y)&&S(Fe.prev,Fe,Fe.next)>=0||(Fe=Fe.prevZ,pe!==M.prev&&pe!==M.next&&x(H.x,H.y,Z.x,Z.y,K.x,K.y,pe.x,pe.y)&&S(pe.prev,pe,pe.next)>=0))return!1;pe=pe.nextZ}for(;Fe&&Fe.z>=at;){if(Fe!==M.prev&&Fe!==M.next&&x(H.x,H.y,Z.x,Z.y,K.x,K.y,Fe.x,Fe.y)&&S(Fe.prev,Fe,Fe.next)>=0)return!1;Fe=Fe.prevZ}for(;pe&&pe.z<=yt;){if(pe!==M.prev&&pe!==M.next&&x(H.x,H.y,Z.x,Z.y,K.x,K.y,pe.x,pe.y)&&S(pe.prev,pe,pe.next)>=0)return!1;pe=pe.nextZ}return!0}function o(M,I,L){var B=M;do{var H=B.prev,Z=B.next.next;!A(H,Z)&&C(H,B,B.next,Z)&&k(H,Z)&&k(Z,H)&&(I.push(H.i/L),I.push(B.i/L),I.push(Z.i/L),q(B),q(B.next),B=M=Z),B=B.next}while(B!==M);return r(B)}function a(M,I,L,B,H,Z){var K=M;do{for(var de=K.next.next;de!==K.prev;){if(K.i!==de.i&&T(K,de)){var Re=z(K,de);return K=r(K,K.next),Re=r(Re,Re.next),i(K,I,L,B,H,Z),void i(Re,I,L,B,H,Z)}de=de.next}K=K.next}while(K!==M)}function l(M,I,L,B){var H,Z,K,de=[];for(H=0,Z=I.length;H=B.next.y&&B.next.y!==B.y){var de=B.x+(Z-B.y)*(B.next.x-B.x)/(B.next.y-B.y);if(de<=H&&de>K){if(K=de,de===H){if(Z===B.y)return B;if(Z===B.next.y)return B.next}L=B.x=B.x&&B.x>=_t&&H!==B.x&&x(ZL.x||B.x===L.x&&m(L,B)))&&(L=B,yt=Re)),B=B.next;while(B!==Ke);return L}function m(M,I){return S(M.prev,M,I.prev)<0&&S(I.next,M,M.next)<0}function y(M,I,L,B){var H=M;do H.z===null&&(H.z=v(H.x,H.y,I,L,B)),H.prevZ=H.prev,H.nextZ=H.next,H=H.next;while(H!==M);H.prevZ.nextZ=null,H.prevZ=null,_(H)}function _(M){var I,L,B,H,Z,K,de,Re,Ke=1;do{for(L=M,M=null,Z=null,K=0;L;){for(K++,B=L,de=0,I=0;I0||Re>0&&B;)de!==0&&(Re===0||!B||L.z<=B.z)?(H=L,L=L.nextZ,de--):(H=B,B=B.nextZ,Re--),Z?Z.nextZ=H:M=H,H.prevZ=Z,Z=H;L=B}Z.nextZ=null,Ke*=2}while(K>1);return M}function v(M,I,L,B,H){return(M=1431655765&((M=858993459&((M=252645135&((M=16711935&((M=32767*(M-L)*H)|M<<8))|M<<4))|M<<2))|M<<1))|(I=1431655765&((I=858993459&((I=252645135&((I=16711935&((I=32767*(I-B)*H)|I<<8))|I<<4))|I<<2))|I<<1))<<1}function b(M){var I=M,L=M;do(I.x=0&&(M-K)*(B-de)-(L-K)*(I-de)>=0&&(L-K)*(Z-de)-(H-K)*(B-de)>=0}function T(M,I){return M.next.i!==I.i&&M.prev.i!==I.i&&!F(M,I)&&(k(M,I)&&k(I,M)&&V(M,I)&&(S(M.prev,M,I.prev)||S(M,I.prev,I))||A(M,I)&&S(M.prev,M,M.next)>0&&S(I.prev,I,I.next)>0)}function S(M,I,L){return(I.y-M.y)*(L.x-I.x)-(I.x-M.x)*(L.y-I.y)}function A(M,I){return M.x===I.x&&M.y===I.y}function C(M,I,L,B){var H=P(S(M,I,L)),Z=P(S(M,I,B)),K=P(S(L,B,M)),de=P(S(L,B,I));return H!==Z&&K!==de||!(H!==0||!R(M,L,I))||!(Z!==0||!R(M,B,I))||!(K!==0||!R(L,M,B))||!(de!==0||!R(L,I,B))}function R(M,I,L){return I.x<=Math.max(M.x,L.x)&&I.x>=Math.min(M.x,L.x)&&I.y<=Math.max(M.y,L.y)&&I.y>=Math.min(M.y,L.y)}function P(M){return M>0?1:M<0?-1:0}function F(M,I){var L=M;do{if(L.i!==M.i&&L.next.i!==M.i&&L.i!==I.i&&L.next.i!==I.i&&C(L,L.next,M,I))return!0;L=L.next}while(L!==M);return!1}function k(M,I){return S(M.prev,M,M.next)<0?S(M,I,M.next)>=0&&S(M,M.prev,I)>=0:S(M,I,M.prev)<0||S(M,M.next,I)<0}function V(M,I){var L=M,B=!1,H=(M.x+I.x)/2,Z=(M.y+I.y)/2;do L.y>Z!=L.next.y>Z&&L.next.y!==L.y&&H<(L.next.x-L.x)*(Z-L.y)/(L.next.y-L.y)+L.x&&(B=!B),L=L.next;while(L!==M);return B}function z(M,I){var L=new G(M.i,M.x,M.y),B=new G(I.i,I.x,I.y),H=M.next,Z=I.prev;return M.next=I,I.prev=M,L.next=H,H.prev=L,B.next=L,L.prev=B,Z.next=B,B.prev=Z,B}function X(M,I,L,B){var H=new G(M,I,L);return B?(H.next=B.next,H.prev=B,B.next.prev=H,B.next=H):(H.prev=H,H.next=H),H}function q(M){M.next.prev=M.prev,M.prev.next=M.next,M.prevZ&&(M.prevZ.nextZ=M.nextZ),M.nextZ&&(M.nextZ.prevZ=M.prevZ)}function G(M,I,L){this.i=M,this.x=I,this.y=L,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Q(M,I,L,B){for(var H=0,Z=I,K=L-B;Z0&&(B+=M[H-1].length,L.holes.push(B))}return L},t},(Koe=Joe())!==void 0&&(Qoe.exports=Koe);const QS=UP(XH.exports),$8=J.getLogger("esri.views.3d.support.buffer.math");function bnt(t,e,r){gp(t.typedBuffer,e.typedBuffer,r,t.typedBufferStride,e.typedBufferStride)}function gp(t,e,r,i=3,n=i){if(t.length/i!==Math.ceil(e.length/n))return $8.error("source and destination buffers need to have the same number of elements"),t;const s=t.length/i,o=r[0],a=r[1],l=r[2],c=r[4],u=r[5],d=r[6],p=r[8],m=r[9],y=r[10],_=r[12],v=r[13],b=r[14];let x=0,T=0;for(let S=0;S0){const p=1/Math.sqrt(d);t[o]=p*l,t[o+1]=p*c,t[o+2]=p*u}s+=i,o+=r}}function Tnt(t,e,r){const i=Math.min(t.count,e.count),n=t.typedBuffer,s=t.typedBufferStride,o=e.typedBuffer,a=e.typedBufferStride;let l=0,c=0;for(let u=0;u>r,n[c+1]=o[l+1]>>r,n[c+2]=o[l+2]>>r,l+=a,c+=s}Object.freeze(Object.defineProperty({__proto__:null,normalize:I8,normalizeView:xnt,scale:D5,scaleView:wnt,shiftRight:Tnt,transformMat3:yp,transformMat3View:dCe,transformMat4:gp,transformMat4View:bnt},Symbol.toStringTag,{value:"Module"}));function Snt(t,e,r){return{objectId:t,target:e,distance:r,type:"vertex"}}function eae(t,e,r,i,n,s=!1){return{objectId:t,target:e,distance:r,type:"edge",start:i,end:n,draped:s}}var Eg,yo;function gT(t){return t&&t.declaredClass==="esri.renderers.visualVariables.SizeVariable"}function NR(t){return t!=null&&!isNaN(t)&&isFinite(t)}function pCe(t){return t.valueExpression?Eg.Expression:t.field&&typeof t.field=="string"?Eg.Field:Eg.Unknown}function Ent(t,e){const r=e||pCe(t),i=t.valueUnit||"unknown";return r===Eg.Unknown?yo.Constant:t.stops?yo.Stops:t.minSize!=null&&t.maxSize!=null&&t.minDataValue!=null&&t.maxDataValue!=null?yo.ClampedLinear:i==="unknown"?t.minSize!=null&&t.minDataValue!=null?t.minSize&&t.minDataValue?yo.Proportional:yo.Additive:yo.Identity:yo.RealWorldSize}(function(t){t.Unknown="unknown",t.Expression="expression",t.Field="field"})(Eg||(Eg={})),function(t){t.Unknown="unknown",t.Stops="stops",t.ClampedLinear="clamped-linear",t.Proportional="proportional",t.Additive="additive",t.Constant="constant",t.Identity="identity",t.RealWorldSize="real-world-size"}(yo||(yo={}));const t1=J.getLogger("esri.renderers.visualVariables.support.visualVariableUtils"),tae=new z_,WD=Math.PI,fCe=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;function mCe(t,e,r){const i="visualVariables"in t&&t.visualVariables?t.visualVariables.find(y=>y.type==="color"):t;if(!i)return;if(i.declaredClass!=="esri.renderers.visualVariables.ColorVariable")return void t1.warn("The visualVariable should be an instance of esri.renderers.visualVariables.ColorVariable");const n=typeof e=="number",s=n?null:e,o=s&&s.attributes;let a=n?e:null;const l=i.field,{ipData:c,hasExpression:u}=i.cache;let d=i.cache.compiledFunc;if(!l&&!u){const y=i.stops;return y&&y[0]&&y[0].color}if(typeof a!="number")if(u){if(r==null||r.arcade==null)return void t1.error("Use of arcade expressions requires an arcade context");const y={viewingMode:r.viewingMode,scale:r.scale,spatialReference:r.spatialReference},_=r.arcade.arcadeUtils,v=_.getViewInfo(y),b=_.createExecContext(s,v);if(!d){const x=_.createSyntaxTree(i.valueExpression);d=_.createFunction(x),i.cache.compiledFunc=d}a=_.executeFunction(d,b)}else o&&(a=o[l]);const p=i.normalizationField,m=o!=null&&p!=null?parseFloat(o[p]):void 0;if(a!=null&&(!p||n||!isNaN(m)&&m!==0)){isNaN(m)||n||(a/=m);const y=EJ(a,c);if(y){const _=y[0],v=y[1],b=_===v?i.stops[_].color:it.blendColors(i.stops[_].color,i.stops[v].color,y[2],r!=null?r.color:void 0);return new it(b)}}}function gCe(t,e,r){const i="visualVariables"in t&&t.visualVariables?t.visualVariables.find(y=>y.type==="opacity"):t;if(!i)return;if(i.declaredClass!=="esri.renderers.visualVariables.OpacityVariable")return void t1.warn("The visualVariable should be an instance of esri.renderers.visualVariables.OpacityVariable");const n=typeof e=="number",s=n?null:e,o=s&&s.attributes;let a=n?e:null;const l=i.field,{ipData:c,hasExpression:u}=i.cache;let d=i.cache.compiledFunc;if(!l&&!u){const y=i.stops;return y&&y[0]&&y[0].opacity}if(typeof a!="number")if(u){if(r==null||r.arcade==null)return void t1.error("Use of arcade expressions requires an arcade context");const y={viewingMode:r.viewingMode,scale:r.scale,spatialReference:r.spatialReference},_=r.arcade.arcadeUtils,v=_.getViewInfo(y),b=_.createExecContext(s,v);if(!d){const x=_.createSyntaxTree(i.valueExpression);d=_.createFunction(x),i.cache.compiledFunc=d}a=_.executeFunction(d,b)}else o&&(a=o[l]);const p=i.normalizationField,m=o!=null&&p!=null?parseFloat(o[p]):void 0;if(a!=null&&(!p||n||!isNaN(m)&&m!==0)){isNaN(m)||n||(a/=m);const y=EJ(a,c);if(y){const _=y[0],v=y[1];if(_===v)return i.stops[_].opacity;{const b=i.stops[_].opacity;return b+(i.stops[v].opacity-b)*y[2]}}}}function yCe(t,e,r){const i="visualVariables"in t&&t.visualVariables?t.visualVariables.find(m=>m.type==="rotation"):t;if(!i)return;if(i.declaredClass!=="esri.renderers.visualVariables.RotationVariable")return void t1.warn("The visualVariable should be an instance of esri.renderers.visualVariables.RotationVariable");const n=i.axis||"heading",s=n==="heading"&&i.rotationType==="arithmetic"?90:0,o=n==="heading"&&i.rotationType==="arithmetic"?-1:1,a=typeof e=="number"?null:e,l=a&&a.attributes,c=i.field,{hasExpression:u}=i.cache;let d=i.cache.compiledFunc,p=0;if(!c&&!u)return p;if(u){if(r==null||r.arcade==null)return void t1.error("Use of arcade expressions requires an arcade context");const m={viewingMode:r.viewingMode,scale:r.scale,spatialReference:r.spatialReference},y=r.arcade.arcadeUtils,_=y.getViewInfo(m),v=y.createExecContext(a,_);if(!d){const b=y.createSyntaxTree(i.valueExpression);d=y.createFunction(b),i.cache.compiledFunc=d}p=y.executeFunction(d,v)}else l&&(p=l[c]||0);return p=typeof p!="number"||isNaN(p)?null:s+o*p,p}function Cnt(t,e,r){const i=typeof e=="number",n=i?null:e,s=n&&n.attributes;let o=i?e:null;const{isScaleDriven:a}=t.cache;let l=t.cache.compiledFunc;if(a){const u=r!=null?r.scale:void 0,d=r!=null?r.view:void 0;o=u==null||d==="3d"?Ant(t):u}else if(!i)switch(t.inputValueType){case Eg.Expression:{if(r==null||r.arcade==null)return void t1.error("Use of arcade expressions requires an arcade context");const u={viewingMode:r.viewingMode,scale:r.scale,spatialReference:r.spatialReference},d=r.arcade.arcadeUtils,p=d.getViewInfo(u),m=d.createExecContext(n,p);if(!l){const y=d.createSyntaxTree(t.valueExpression);l=d.createFunction(y),t.cache.compiledFunc=l}o=d.executeFunction(l,m);break}case Eg.Field:s&&(o=s[t.field]);break;case Eg.Unknown:o=null}if(!NR(o))return null;if(i||!t.normalizationField)return o;const c=s?parseFloat(s[t.normalizationField]):null;return NR(c)&&c!==0?o/c:null}function Ant(t){let e=null,r=null;const i=t.stops;return i?(e=i[0].value,r=i[i.length-1].value):(e=t.minDataValue||0,r=t.maxDataValue||0),(e+r)/2}function L8(t,e,r){const i="visualVariables"in t&&t.visualVariables?t.visualVariables.find(s=>s.type==="size"):t;if(!i)return;if(i.declaredClass!=="esri.renderers.visualVariables.SizeVariable")return void t1.warn("The visualVariable should be an instance of esri.renderers.visualVariables.SizeVariable");const n=vCe(Cnt(i,e,r),i,e,r,i.cache.ipData);return n==null||isNaN(n)?0:n}function Tc(t,e,r){return t==null?null:gT(t)?L8(t,e,r):NR(t)?t:null}function _Ce(t,e,r){return NR(r)&&t>r?r:NR(e)&&t=e.maxDataValue)return o;if(s==null||o==null)return null;if(e.scaleBy==="area"&&a){const l=a==="circle",c=l?WD*(s/2)**2:s*s,u=c+n*((l?WD*(o/2)**2:o*o)-c);return l?2*Math.sqrt(u/WD):Math.sqrt(u)}return s+n*(o-s)}function Mnt(t,e,r,i){const n=i!=null?i.shape:void 0,s=t/e.minDataValue,o=Tc(e.minSize,r,i),a=Tc(e.maxSize,r,i);let l=null;return l=n==="circle"?2*Math.sqrt(s*(o/2)**2):n==="square"||n==="diamond"||n==="image"?Math.sqrt(s*o**2):s*o,_Ce(l,o,a)}function $nt(t,e,r,i,n){var l,c,u;const[s,o,a]=EJ(t,n);if(s===o)return Tc((l=e.stops)==null?void 0:l[s].size,r,i);{const d=Tc((c=e.stops)==null?void 0:c[s].size,r,i);return d+(Tc((u=e.stops)==null?void 0:u[o].size,r,i)-d)*a}}function Int(t,e,r,i){const n=(i!=null&&i.resolution?i.resolution:1)*WS[e.valueUnit],s=Tc(e.minSize,r,i),o=Tc(e.maxSize,r,i),{valueRepresentation:a}=e;let l=null;return l=a==="area"?2*Math.sqrt(t/WD)/n:a==="radius"||a==="distance"?2*t/n:t/n,_Ce(l,s,o)}function vCe(t,e,r,i,n){switch(e.transformationType){case yo.Additive:return Ont(t,e,r,i);case yo.Constant:return Rnt(e,r,i);case yo.ClampedLinear:return Pnt(t,e,r,i);case yo.Proportional:return Mnt(t,e,r,i);case yo.Stops:return $nt(t,e,r,i,n);case yo.RealWorldSize:return Int(t,e,r,i);case yo.Identity:return t;case yo.Unknown:return null}}function Lnt(t,e,r){const{isScaleDriven:i}=t.cache;if(!(i&&r==="3d"||e))return null;const n={scale:e,view:r};let s=Tc(t.minSize,tae,n),o=Tc(t.maxSize,tae,n);if(s!=null||o!=null){if(s>o){const a=o;o=s,s=a}return{minSize:s,maxSize:o}}}function SJ(t,e,r){if(!t.visualVariables)return;const i=[],n=[],s=[],o=[],a=[];for(const l of t.visualVariables)switch(l.type){case"color":n.push(l);break;case"opacity":s.push(l);break;case"rotation":a.push(l);break;case"size":o.push(l)}return n.forEach(l=>{const c=mCe(l,e,r);i.push({variable:l,value:c})}),s.forEach(l=>{const c=gCe(l,e,r);i.push({variable:l,value:c})}),a.forEach(l=>{const c=yCe(l,e,r);i.push({variable:l,value:c})}),o.forEach(l=>{const c=L8(l,e,r);i.push({variable:l,value:c})}),i.filter(l=>l.value!=null)}function EJ(t,e){if(!e)return;let r=0,i=e.length-1;return e.some((n,s)=>tu&&(u=R)}else u=n;const d=Math.floor(1.1*u)+1;($p==null||$p.length<2*d)&&($p=new Uint32Array(P6e(2*d)));for(let C=0;C<2*d;C++)$p[C]=0;let p=0;const m=!!c&&!!a,y=m?l:n;let _=u5(n);const v=new Uint32Array(l),b=1.96;let x=o!==0?Math.ceil(4*b*b/(o*o)*o*(1-o)):y,T=1,S=c?c[1]:y;for(let C=0;C=d&&(k-=d)}V===p&&($p[2*k]=F,$p[2*k+1]=R+1,p++),_[R]=V}if(o!==0&&1-p/n>>2)|0;return i>>>0}let $p=null;function Gnt(t){const e=YP(t.rings,t.hasZ,Kf.CCW_IS_HOLE),r=new Array;let i=0,n=0;for(const a of e.polygons){const l=a.count,c=a.index,u=Ch(e.position,3*c,3*l),d=a.holeIndices.map(m=>m-c),p=zf(QS(u,d,3));r.push({position:u,faces:p}),i+=u.length,n+=p.length}const s=jnt(r,i,n),o=Array.isArray(s.position)?YH(s.position,3,{originalIndices:s.faces}):YH(s.position.buffer,6,{originalIndices:s.faces});return s.position=v2e(new Float64Array(o.buffer)),s.faces=o.indices,s}function jnt(t,e,r){if(t.length===1)return t[0];const i=Ys(e),n=new Array(r);let s=0,o=0,a=0;for(const l of t){for(let c=0;c=0;m--){const y=t[m],_=r===Kf.CCW_IS_HOLE&&Hnt(y);if(_&&i!==1)n[a++]=y;else{let v=y.length;for(let x=0;x0&&(o[c++]={index:p,count:y.length}),p=_?aI(y,y.length-1,-1,d,p,y.length,e):aI(y,0,1,d,p,y.length,e);for(let x=0;x0&&(o[c++]={index:p,count:T.length}),p=aI(T,0,1,d,p,T.length,e)}a=0,b.count>0&&(s[l++]=b)}}for(let m=0;m0&&(o[c++]={index:p,count:y.length}),p=aI(y,0,1,d,p,y.length,e)}return s.length=l,o.length=c,{position:d,polygons:s,outlines:o}}function aI(t,e,r,i,n,s,o){n*=3;for(let a=0;aqnt?(r.fbo.disposeRenderTargetMemory(),r.lastUsed=1/0,!1):r.lastUsed<1/0}get gpuMemoryUsage(){return this.renderTargets.reduce((e,r)=>e+r.fbo.gpuMemoryUsage,0)}};const qnt=1e3;let wCe=class extends Wr{constructor(){super(...arguments),this.color=$t(1,1,1,1)}};function Xnt(){const t=new mr;return t.include(Vh),t.fragment.uniforms.add(new Ye("tex",e=>e.texture),new Jt("uColor",e=>e.color)),t.fragment.code.add(w`void main() { +vec4 texColor = texture(tex, uv); +fragColor = texColor * uColor; +}`),t}const Ynt=Object.freeze(Object.defineProperty({__proto__:null,TextureOnlyPassParameters:wCe,build:Xnt},Symbol.toStringTag,{value:"Module"}));let xCe=class{constructor(e){this._context=e,this._perConstructorInstances=new RE,this._frameCounter=0,this._keepAliveFrameCount=nae}get viewingMode(){return this._context.viewingMode}get constructionContext(){return this._context}destroy(){this._perConstructorInstances.forEach(e=>e.forEach(r=>r.technique.destroy())),this._perConstructorInstances.clear()}acquire(e,r=Qnt){const i=r.key;let n=this._perConstructorInstances.get(e,i);if(n==null){const s=new e(this._context,r,()=>this.release(s));n=new Znt(s),this._perConstructorInstances.set(e,i,n)}return++n.refCount,n.technique}releaseAndAcquire(e,r,i){if(i!=null){if(r.key===i.key)return i;this.release(i)}return this.acquire(e,r)}release(e){if(e==null||this._perConstructorInstances.empty)return;const r=this._perConstructorInstances.get(e.constructor,e.key);r!=null&&(--r.refCount,r.refCount===0&&(r.refZeroFrame=this._frameCounter))}frameUpdate(){this._frameCounter++,this._keepAliveFrameCount!==nae&&this._perConstructorInstances.forEach((e,r)=>{e.forEach((i,n)=>{i.refCount===0&&i.refZeroFrame+this._keepAliveFrameCount{const n=async(s,o)=>{const a=o.shader;a&&(await a.reload(),s.forEach(l=>l.technique.reload(this._context)))};e.push(n(r,i))}),await Promise.all(e)}},Znt=class{constructor(e){this.technique=e,this.refCount=0,this.refZeroFrame=0}};const nae=-1,Qnt=new va;let TCe=class{constructor(e,r,i,n){this._textureRepository=e,this._techniqueRepository=r,this.materialChanged=i,this.requestRender=n,this._id2glMaterialRef=new RE}dispose(){this._textureRepository.destroy()}acquire(e,r,i){if(this._ownMaterial(e),!e.requiresSlot(r,i))return null;let n=this._id2glMaterialRef.get(i,e.id);if(n==null){const s=e.createGLMaterial({material:e,techniqueRep:this._techniqueRepository,textureRep:this._textureRepository,output:i});n=new Jnt(s),this._id2glMaterialRef.set(i,e.id,n)}return n.ref(),n.glMaterial}release(e,r){const i=this._id2glMaterialRef.get(r,e.id);i!=null&&(i.unref(),i.referenced||(Le(i.glMaterial),this._id2glMaterialRef.delete(r,e.id)))}_ownMaterial(e){e.repository!=null&&e.repository!==this&&J.getLogger("esri.views.3d.webgl-engine.lib.GLMaterialRepository").error("Material is already owned by a different material repository"),e.repository=this}},Jnt=class{constructor(e){this.glMaterial=e,this._refCnt=0}ref(){++this._refCnt}unref(){--this._refCnt,Je(this._refCnt>=0)}get referenced(){return this._refCnt>0}};const Knt={orderedRepackingEnabled:!1},est=["layerObjectAdded","layerObjectRemoved","layerObjectsAdded","layerObjectsRemoved","shaderTransformationChanged","objectTransformation","visibilityChanged","occlusionChanged","highlightChanged","objectGeometryAdded","objectGeometryRemoved","objectGeometryUpdated"];let QH=class qD{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(e,r){this.objectToBoundingSphere=e,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new Us,this._objectCount=0,r&&(r.maximumObjectsPerNode!==void 0&&(this._maximumObjectsPerNode=r.maximumObjectsPerNode),r.maximumDepth!==void 0&&(this._maximumDepth=r.maximumDepth))}destroy(){this._degenerateObjects.clear(),Us.clearPool(),JH[0]=null,N1.prune(),Iv.prune()}add(e,r=e.length){this._objectCount+=r,this._grow(e,r);const i=Us.acquire();for(let n=0;n{if(!this._intersectsNode(n,s))return!1;const o=s.node;return o.terminals.forAll(a=>{this._intersectsObject(n,a)&&i(a)}),o.residents!==null&&o.residents.forAll(a=>{this._intersectsObject(n,a)&&i(a)}),!0})}forEachAlongRayWithVerticalOffset(e,r,i,n){const s=bu(e,r);this._forEachNode(this._root,o=>{if(!this._intersectsNodeWithOffset(s,o,n))return!1;const a=o.node;return a.terminals.forAll(l=>{this._intersectsObjectWithOffset(s,l,n)&&i(l)}),a.residents!==null&&a.residents.forAll(l=>{this._intersectsObjectWithOffset(s,l,n)&&i(l)}),!0})}forEach(e){this._forEachNode(this._root,r=>{const i=r.node;return i.terminals.forAll(e),i.residents!==null&&i.residents.forAll(e),!0}),this._degenerateObjects.forEach(e)}forEachDegenerateObject(e){this._degenerateObjects.forEach(e)}findClosest(e,r,i,n=()=>!0,s=1/0){let o=1/0,a=1/0,l=null;const c=k9(e,r),u=d=>{if(--s,!n(d))return;const p=this.objectToBoundingSphere(d);if(!h_(i,p))return;const m=Ly(e,r,p),y=m-p[3],_=m+p[3];y{if(s<=0||!h_(i,d.bounds)||(te(Mu,c,d.halfSize),oe(Mu,Mu,d.bounds),Ly(e,r,Mu)>a))return!1;const p=d.node;return p.terminals.forAll(m=>u(m)),p.residents!==null&&p.residents.forAll(m=>u(m)),!0},e,r),l}forEachInDepthRange(e,r,i,n,s,o,a){let l=-1/0,c=1/0;const u={setRange:_=>{i===qD.DepthOrder.FRONT_TO_BACK?(l=Math.max(l,_.near),c=Math.min(c,_.far)):(l=Math.max(l,-_.far),c=Math.min(c,-_.near))}};u.setRange(n);const d=Ly(r,i,e),p=k9(r,i),m=k9(r,-i),y=_=>{if(!a(_))return;const v=this.objectToBoundingSphere(_),b=v,x=Ly(r,i,b)-d,T=x-v[3],S=x+v[3];T>c||S{if(!h_(o,_.bounds)||(te(Mu,p,_.halfSize),oe(Mu,Mu,_.bounds),Ly(r,i,Mu)-d>c)||(te(Mu,m,_.halfSize),oe(Mu,Mu,_.bounds),Ly(r,i,Mu)-dy(b)),v.residents!==null&&v.residents.forAll(b=>y(b)),!0},r,i)}forEachNode(e){this._forEachNode(this._root,r=>e(r.node,r.bounds,r.halfSize,r.depth))}forEachNeighbor(e,r){const i=vg(r),n=r,s=l=>{const c=this.objectToBoundingSphere(l),u=vg(c),d=i+u;return!(wo(c,n)-d*d<=0)||e(l)};let o=!0;const a=l=>{o&&(o=s(l))};this._forEachNode(this._root,l=>{const c=vg(l.bounds),u=i+c;if(wo(l.bounds,n)-u*u>0)return!1;const d=l.node;return d.terminals.forAll(a),o&&d.residents!==null&&d.residents.forAll(a),o}),o&&this.forEachDegenerateObject(a)}_intersectsNode(e,r){return lI(r.bounds,2*-r.halfSize,Qc),lI(r.bounds,2*r.halfSize,Jc),cne(e.origin,e.direction,Qc,Jc)}_intersectsNodeWithOffset(e,r,i){return lI(r.bounds,2*-r.halfSize,Qc),lI(r.bounds,2*r.halfSize,Jc),i.applyToMinMax(Qc,Jc),cne(e.origin,e.direction,Qc,Jc)}_intersectsObject(e,r){const i=this.objectToBoundingSphere(r);return!(i[3]>0)||VG(i,e)}_intersectsObjectWithOffset(e,r,i){const n=this.objectToBoundingSphere(r);return!(n[3]>0)||VG(i.applyToBoundingSphere(n),e)}_forEachNode(e,r){let i=Us.acquire().init(e);const n=[i];for(;n.length!==0;){if(i=n.pop(),r(i)&&!i.isLeaf())for(let s=0;s=0;--a){const l=aae[a];s.node.children[l]&&o.push(Us.acquire().init(s).advance(l))}Us.release(s)}}_remove(e,r,i){N1.clear();const n=i.advanceTo(r,(s,o)=>{N1.push(s.node),N1.push(o)})?i.node.terminals:i.node.residents;if(n.removeUnordered(e),n.length===0)for(let s=N1.length-2;s>=0;s-=2){const o=N1.data[s],a=N1.data[s+1];if(!this._purge(o,a))break}}_nodeIsEmpty(e){if(e.terminals.length!==0)return!1;if(e.residents!==null)return e.residents.length===0;for(let r=0;r=0&&(e.children[r]=null),!!this._nodeIsEmpty(e)&&(e.residents===null&&(e.residents=new Nt({shrink:!0})),!0)}_add(e,r){r.advanceTo(this.objectToBoundingSphere(e))?r.node.terminals.push(e):(r.node.residents.push(e),r.node.residents.length>this._maximumObjectsPerNode&&r.depththis.objectToBoundingSphere(i),vm),iA(vm[3])&&!this._fitsInsideTree(vm)))if(this._nodeIsEmpty(this._root.node))PS(vm,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const i=this._rootBoundsForRootAsSubNode(vm);this._placingRootViolatesMaxDepth(i)?this._rebuildTree(vm,i):this._growRootAsSubNode(i),Us.release(i)}}_rebuildTree(e,r){re(B9,r.bounds),B9[3]=r.halfSize,sae([e,B9],2,n=>n,V9);const i=Us.acquire().init(this._root);this._root.initFrom(null,V9,V9[3]),this._root.increaseHalfSize(1.25),this._forEachNode(i,n=>(this.add(n.node.terminals.data,n.node.terminals.length),n.node.residents!==null&&this.add(n.node.residents.data,n.node.residents.length),!0)),Us.release(i)}_placingRootViolatesMaxDepth(e){const r=Math.log(e.halfSize/this._root.halfSize)*Math.LOG2E;let i=0;return this._forEachNode(this._root,n=>(i=Math.max(i,n.depth),i+r<=this._maximumDepth)),i+r>this._maximumDepth}_rootBoundsForRootAsSubNode(e){const r=e[3],i=e;let n=-1/0;const s=this._root.bounds,o=this._root.halfSize;for(let l=0;l<3;l++){const c=s[l]-o-(i[l]-r),u=i[l]+r-(s[l]+o),d=Math.max(0,Math.ceil(c/(2*o))),p=Math.max(0,Math.ceil(u/(2*o)))+1,m=2**Math.ceil(Math.log(d+p)*Math.LOG2E);n=Math.max(n,m),cI[l].min=d,cI[l].max=p}for(let l=0;l<3;l++){let c=cI[l].min,u=cI[l].max;const d=(n-(c+u))/2;c+=Math.ceil(d),u+=Math.floor(d);const p=s[l]-o-c*o*2;z9[l]=p+(u+c)*o}const a=n*o;return z9[3]=a*ECe,Us.acquire().initFrom(null,z9,a,0)}_growRootAsSubNode(e){const r=this._root.node;re(vm,this._root.bounds),vm[3]=this._root.halfSize,this._root.init(e),e.advanceTo(vm,null,!0),e.node.children=r.children,e.node.residents=r.residents,e.node.terminals=r.terminals}_shrink(){for(;;){const e=this._findShrinkIndex();if(e===-1)break;this._root.advance(e),this._root.depth=0}}_findShrinkIndex(){if(this._root.node.terminals.length!==0||this._root.isLeaf())return-1;let e=null;const r=this._root.node.children;let i=0,n=0;for(;n=r[0]-i&&e[0]<=r[0]+i&&e[1]>=r[1]-i&&e[1]<=r[1]+i&&e[2]>=r[2]-i&&e[2]<=r[2]+i}toJSON(){const{maximumDepth:e,maximumObjectsPerNode:r,_objectCount:i}=this,n=this._nodeToJSON(this._root.node);return{maximumDepth:e,maximumObjectsPerNode:r,objectCount:i,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:n}}}_nodeToJSON(e){var s,o;const r=e.children.map(a=>a?this._nodeToJSON(a):null),i=(s=e.residents)==null?void 0:s.map(a=>this.objectToBoundingSphere(a)),n=(o=e.terminals)==null?void 0:o.map(a=>this.objectToBoundingSphere(a));return{children:r,residents:i,terminals:n}}static fromJSON(e){const r=new qD(i=>i,{maximumDepth:e.maximumDepth,maximumObjectsPerNode:e.maximumObjectsPerNode});return r._objectCount=e.objectCount,r._root.initFrom(e.root.node,e.root.bounds,e.root.halfSize,e.root.depth),r}},Us=class A2{constructor(){this.bounds=vn(),this.halfSize=0,this.initFrom(null,null,0,0)}init(e){return this.initFrom(e.node,e.bounds,e.halfSize,e.depth)}initFrom(e,r,i,n=this.depth){return this.node=e??A2.createEmptyNode(),r!=null&&PS(r,this.bounds),this.halfSize=i,this.depth=n,this}increaseHalfSize(e){this.halfSize*=e,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*ECe}advance(e){let r=this.node.children[e];r||(r=A2.createEmptyNode(),this.node.children[e]=r),this.node=r,this.halfSize/=2,this.depth++;const i=SCe[e];return this.bounds[0]+=i[0]*this.halfSize,this.bounds[1]+=i[1]*this.halfSize,this.bounds[2]+=i[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(e,r,i=!1){for(;;){if(this.isTerminalFor(e))return r&&r(this,-1),!0;if(this.isLeaf()){if(!i)return r&&r(this,-1),!1;this.node.residents=null}const n=this._childIndex(e);r&&r(this,n),this.advance(n)}}isLeaf(){return this.node.residents!=null}isTerminalFor(e){return e[3]>this.halfSize/2}_childIndex(e){const r=this.bounds;return(r[0]i.distance-n.distance);for(let i=0;i<8;++i)r[i]=Iv.data[i].index}function k9(t,e){let r,i=1/0;for(let n=0;n<8;++n){const s=Ly(t,e,oae[n]);s0}Us._pool=new ko(Us),function(t){var e;(e=t.DepthOrder||(t.DepthOrder={}))[e.FRONT_TO_BACK=1]="FRONT_TO_BACK",e[e.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(QH||(QH={}));const SCe=[Se(-1,-1,-1),Se(1,-1,-1),Se(-1,1,-1),Se(1,1,-1),Se(-1,-1,1),Se(1,-1,1),Se(-1,1,1),Se(1,1,1)],oae=[Se(-1,-1,-1),Se(-1,-1,1),Se(-1,1,-1),Se(-1,1,1),Se(1,-1,-1),Se(1,-1,1),Se(1,1,-1),Se(1,1,1)],ECe=Math.sqrt(3),JH=[null];function nst(t){return JH[0]=t,JH}const z9=vn(),Mu=O(),Qc=O(),Jc=O(),N1=new Nt,sst=vn(),vm=vn(),B9=vn(),V9=vn(),cI=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],Iv=new Nt,aae=[0,0,0,0,0,0,0,0],Xd=QH;var O_;(function(t){t[t.ASYNC=0]="ASYNC",t[t.SYNC=1]="SYNC"})(O_||(O_={}));let CCe=class extends FP{get objects(){return this._objects}constructor(e,r,i=""){super(),this.stage=e,this.apiLayerUid=i,this.type=on.Layer,this.events=new Bn,this.sliceable=!1,this._objects=new Nt,this._objectsAdded=new Nt,this._handles=new Vi,this.apiLayerUid=i,this.visible=(r==null?void 0:r.visible)??!0,this.pickable=(r==null?void 0:r.pickable)??!0,this.updatePolicy=(r==null?void 0:r.updatePolicy)??O_.ASYNC,this._disableOctree=(r==null?void 0:r.disableOctree)??!1,e.add(this);for(const n of est)this._handles.add(this.events.on(n,s=>e.handleEvent(n,s)))}destroy(){this._handles.size&&(this._handles.destroy(),this.stage.remove(this),this.invalidateSpatialQueryAccelerator())}add(e){this._objects.push(e),e.parentLayer=this,this.events.emit("layerObjectAdded",{layer:this,object:e}),this._octree!=null&&this._objectsAdded.push(e)}remove(e){this._objects.removeUnordered(e)&&(e.parentLayer=null,this.events.emit("layerObjectRemoved",{layer:this,object:e}),this._octree!=null&&(this._objectsAdded.removeUnordered(e)||this._octree.remove([e])))}addMany(e){this._objects.pushArray(e);for(const r of e)r.parentLayer=this;this.events.emit("layerObjectsAdded",{layer:this,objects:e}),this._octree!=null&&this._objectsAdded.pushArray(e)}removeMany(e){const r=new Array;if(this._objects.removeUnorderedMany(e,e.length,r),r.length!==0){for(const i of r)i.parentLayer=null;if(this.events.emit("layerObjectsRemoved",{layer:this,objects:r}),this._octree!=null){for(let i=0;i50&&!this._disableOctree?(this._octree=new Xd(e=>e.boundingVolumeWorldSpace.bounds),this._octree.add(this._objects.data,this._objects.length)):this._octree!=null&&this._objectsAdded.length>0&&(this._octree.add(this._objectsAdded.data,this._objectsAdded.length),this._objectsAdded.clear()),this._octree}shaderTransformationChanged(){this.invalidateSpatialQueryAccelerator(),this.events.emit("shaderTransformationChanged",this)}invalidateSpatialQueryAccelerator(){this._octree=Me(this._octree),this._objectsAdded.clear()}};function F5(t){return t!=null&&t.type===on.Layer}var mu,_w;(function(t){t[t.Draped=0]="Draped",t[t.Screen=1]="Screen",t[t.World=2]="World",t[t.COUNT=3]="COUNT"})(mu||(mu={})),function(t){t[t.Center=0]="Center",t[t.Tip=1]="Tip",t[t.COUNT=2]="COUNT"}(_w||(_w={}));let uo=class extends Fo{constructor(){super(...arguments),this.output=D.Color,this.transparencyPassType=rt.NONE,this.occluder=!1,this.hasSlicePlane=!1,this.writeDepth=!1,this.space=mu.Screen,this.hideOnShortSegments=!1,this.hasCap=!1,this.anchor=_w.Center,this.hasTip=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1}get draped(){return this.space===mu.Draped}};h([U({count:D.COUNT})],uo.prototype,"output",void 0),h([U({count:rt.COUNT})],uo.prototype,"transparencyPassType",void 0),h([U()],uo.prototype,"occluder",void 0),h([U()],uo.prototype,"hasSlicePlane",void 0),h([U()],uo.prototype,"writeDepth",void 0),h([U({count:mu.COUNT})],uo.prototype,"space",void 0),h([U()],uo.prototype,"hideOnShortSegments",void 0),h([U()],uo.prototype,"hasCap",void 0),h([U({count:_w.COUNT})],uo.prototype,"anchor",void 0),h([U()],uo.prototype,"hasTip",void 0),h([U()],uo.prototype,"vvSize",void 0),h([U()],uo.prototype,"vvColor",void 0),h([U()],uo.prototype,"vvOpacity",void 0),h([U()],uo.prototype,"hasOccludees",void 0),h([U()],uo.prototype,"hasMultipassTerrain",void 0),h([U()],uo.prototype,"cullAboveGround",void 0),h([U({constValue:!0})],uo.prototype,"hasVvInstancing",void 0),h([U({constValue:!0})],uo.prototype,"hasSliceTranslatedView",void 0);const lae=8;function ACe(t,e){const r=t.vertex;r.uniforms.add(new Ce("intrinsicWidth",i=>i.width)),e.vvSize?(t.attributes.add(E.SIZEFEATUREATTRIBUTE,"float"),r.uniforms.add(new Lt("vvSizeMinSize",i=>i.vvSize.minSize),new Lt("vvSizeMaxSize",i=>i.vvSize.maxSize),new Lt("vvSizeOffset",i=>i.vvSize.offset),new Lt("vvSizeFactor",i=>i.vvSize.factor)),r.code.add(w`float getSize() { +return intrinsicWidth * clamp(vvSizeOffset + sizeFeatureAttribute * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).x; +}`)):(t.attributes.add(E.SIZE,"float"),r.code.add(w`float getSize(){ +return intrinsicWidth * size; +}`)),e.vvOpacity?(t.attributes.add(E.OPACITYFEATUREATTRIBUTE,"float"),r.constants.add("vvOpacityNumber","int",8),r.uniforms.add(new Sl("vvOpacityValues",i=>i.vvOpacity.values,lae),new Sl("vvOpacityOpacities",i=>i.vvOpacity.opacityValues,lae)),r.code.add(w`float interpolateOpacity( float value ){ +if (value <= vvOpacityValues[0]) { +return vvOpacityOpacities[0]; +} +for (int i = 1; i < vvOpacityNumber; ++i) { +if (vvOpacityValues[i] >= value) { +float f = (value - vvOpacityValues[i-1]) / (vvOpacityValues[i] - vvOpacityValues[i-1]); +return mix(vvOpacityOpacities[i-1], vvOpacityOpacities[i], f); +} +} +return vvOpacityOpacities[vvOpacityNumber - 1]; +} +vec4 applyOpacity( vec4 color ){ +return vec4(color.xyz, interpolateOpacity(opacityFeatureAttribute)); +}`)):r.code.add(w`vec4 applyOpacity( vec4 color ){ +return color; +}`),e.vvColor?(t.include(Tg,e),t.attributes.add(E.COLORFEATUREATTRIBUTE,"float"),r.code.add(w`vec4 getColor(){ +return applyOpacity(interpolateVVColor(colorFeatureAttribute)); +}`)):(t.attributes.add(E.COLOR,"vec4"),r.code.add(w`vec4 getColor(){ +return applyOpacity(color); +}`))}function Xg(t,e){switch(t.fragment.include(Pc),e.output){case D.Shadow:case D.ShadowHighlight:case D.ShadowExcludeHighlight:t.fragment.code.add(w`float _calculateFragDepth(const in float depth) { +const float SLOPE_SCALE = 2.0; +const float BIAS = 20.0 * .000015259; +float m = max(abs(dFdx(depth)), abs(dFdy(depth))); +float result = depth + SLOPE_SCALE * m + BIAS; +return clamp(result, .0, .999999); +} +void outputDepth(float _linearDepth) { +fragColor = float2rgba(_calculateFragDepth(_linearDepth)); +}`);break;case D.Depth:t.fragment.code.add(w`void outputDepth(float _linearDepth) { +fragColor = float2rgba(_linearDepth); +}`)}}let OCe=class{constructor(e,r,i){this._createTexture=e,this._parametersKey=r,this._repository=new Map,this._orphanCache=i.newCache(`procedural-texture-repository:${wc()}`,n=>n.dispose())}destroy(){for(const[e,{texture:r}]of this._repository)r.dispose();this._repository.clear(),this._orphanCache.destroy()}swap(e,r=null){const i=this._acquire(e);return this.release(r),i}release(e){if(e==null)return;const r=this._parametersKey(e),i=this._repository.get(r);if(i&&(i.refCount--,i.refCount===0)){this._repository.delete(r);const{texture:n}=i,s=n.gpuMemoryUsage;this._orphanCache.put(r,n,s)}}_acquire(e){if(e==null)return null;const r=this._parametersKey(e),i=this._repository.get(r);if(i)return i.refCount++,i.texture;const n=this._orphanCache.pop(r)??this._createTexture(e),s=new ost(n);return this._repository.set(r,s),n}},ost=class{constructor(e){this.texture=e,this.refCount=1}};function ast(t,e){return new OCe(r=>{const{encodedData:i,paddedPixels:n}=lst(r),s=new pr;return s.internalFormat=Tt.RGBA,s.width=n,s.height=1,s.wrapMode=Pt.CLAMP_TO_EDGE,new Ct(t,s,i)},r=>`${r.pattern.join(",")}-r${r.pixelRatio}`,e)}function lst(t){const e=CJ(t),r=1/t.pixelRatio,i=RCe(t),n=PCe(t),s=(Math.floor(.5*(n-1))+.5)*r,o=[];let a=1;for(const m of e){for(let y=0;yMath.round(e*t.pixelRatio))}function RCe(t){if(t==null)return 1;const e=CJ(t);return Math.floor(e.reduce((r,i)=>r+i))}function PCe(t){return CJ(t).reduce((e,r)=>Math.max(e,r))}const MCe=2;function cst(t){return t==null?Nf:t.length===4?t:gi(ust,t[0],t[1],t[2],1)}const ust=Qt();function $Ce(t,e){t.constants.add("stippleAlphaColorDiscard","float",.001),t.constants.add("stippleAlphaHighlightDiscard","float",.5),e.stippleEnabled?hst(t,e):dst(t)}function hst(t,e){const r=!(e.draped&&e.stipplePreferContinuous),{vertex:i,fragment:n}=t;n.include(Pc),e.draped||(fp(i,e),i.uniforms.add(new Ce("worldToScreenPerDistanceRatio",(s,o)=>1/o.camera.perScreenPixelRatio)),i.code.add(w`float computeWorldToScreenRatio(vec3 segmentCenter) { +float segmentDistanceToCamera = length(segmentCenter - cameraPosition); +return worldToScreenPerDistanceRatio / segmentDistanceToCamera; +}`)),t.varyings.add("vStippleDistance","float"),e.stippleRequiresClamp&&t.varyings.add("vStippleDistanceLimits","vec2"),e.stippleRequiresStretchMeasure&&t.varyings.add("vStipplePatternStretch","float"),i.code.add(w` + float discretizeWorldToScreenRatio(float worldToScreenRatio) { + float step = ${fst}; + + float discreteWorldToScreenRatio = log(worldToScreenRatio); + discreteWorldToScreenRatio = ceil(discreteWorldToScreenRatio / step) * step; + discreteWorldToScreenRatio = exp(discreteWorldToScreenRatio); + return discreteWorldToScreenRatio; + } + `),i.code.add(w`vec2 computeStippleDistanceLimits(float startPseudoScreen, float segmentLengthPseudoScreen, float segmentLengthScreen, float patternLength) {`),i.code.add(w` + if (segmentLengthPseudoScreen >= ${r?"patternLength":"1e4"}) { + `),LE(i,e),i.code.add(w` + // Round the screen length to get an integer number of pattern repetitions (minimum 1). + float repetitions = segmentLengthScreen / (patternLength * pixelRatio); + float flooredRepetitions = max(1.0, floor(repetitions + 0.5)); + float segmentLengthScreenRounded = flooredRepetitions * patternLength; + + ${e.stippleRequiresStretchMeasure?w` + float stretch = repetitions / flooredRepetitions; + + // We need to impose a lower bound on the stretch factor to prevent the dots from merging together when there is only 1 repetition. + // 0.75 is the lowest possible stretch value for flooredRepetitions > 1, so it makes sense as lower bound. + vStipplePatternStretch = max(0.75, stretch);`:""} + + return vec2(0.0, segmentLengthScreenRounded); + } + return vec2(startPseudoScreen, startPseudoScreen + segmentLengthPseudoScreen); + } + `),n.constants.add("stippleTexturePadding","float",MCe),n.uniforms.add(new Ye("stipplePatternTexture",s=>s.stippleTexture),new Ce("stipplePatternSDFNormalizer",s=>pst(s.stipplePattern)),new Ce("stipplePatternPixelSizeInv",s=>1/AJ(s))),n.code.add(w`float padStippleTexture(float u) { +float paddedTextureSize = float(textureSize(stipplePatternTexture, 0).x); +float unpaddedTextureSize = paddedTextureSize - stippleTexturePadding; +return (u * unpaddedTextureSize + stippleTexturePadding * 0.5) / paddedTextureSize; +}`),n.code.add(w` + float getStippleSDF(out bool isClamped) { + ${e.stippleRequiresClamp?w` + float stippleDistanceClamped = clamp(vStippleDistance, vStippleDistanceLimits.x, vStippleDistanceLimits.y); + vec2 aaCorrectedLimits = vStippleDistanceLimits + vec2(1.0, -1.0) / gl_FragCoord.w; + isClamped = vStippleDistance < aaCorrectedLimits.x || vStippleDistance > aaCorrectedLimits.y;`:w` + float stippleDistanceClamped = vStippleDistance; + isClamped = false;`} + + float u = stippleDistanceClamped * gl_FragCoord.w * stipplePatternPixelSizeInv; + ${e.stippleScaleWithLineWidth?w`u *= vLineSizeInv;`:""} + u = padStippleTexture(fract(u)); + + float encodedSDF = rgba2float(texture(stipplePatternTexture, vec2(u, 0.5))); + float sdf = (encodedSDF * 2.0 - 1.0) * stipplePatternSDFNormalizer; + + ${e.stippleRequiresStretchMeasure?w`return (sdf - 0.5) * vStipplePatternStretch + 0.5;`:w`return sdf;`} + } + + float getStippleSDF() { + bool ignored; + return getStippleSDF(ignored); + } + + float getStippleAlpha() { + bool isClamped; + float stippleSDF = getStippleSDF(isClamped); + + float antiAliasedResult = ${e.stippleScaleWithLineWidth?w`clamp(stippleSDF * vLineWidth + 0.5, 0.0, 1.0);`:w`clamp(stippleSDF + 0.5, 0.0, 1.0);`} + + return isClamped ? floor(antiAliasedResult + 0.5) : antiAliasedResult; + } + `),e.stippleOffColorEnabled?(n.uniforms.add(new Jt("stippleOffColor",s=>cst(s.stippleOffColor))),n.code.add(w`#define discardByStippleAlpha(stippleAlpha, threshold) {} +#define blendStipple(color, stippleAlpha) mix(color, stippleOffColor, stippleAlpha)`)):n.code.add(w`#define discardByStippleAlpha(stippleAlpha, threshold) if (stippleAlpha < threshold) { discard; } +#define blendStipple(color, stippleAlpha) vec4(color.rgb, color.a * stippleAlpha)`)}function dst(t){t.fragment.code.add(w`float getStippleAlpha() { return 1.0; } +#define discardByStippleAlpha(_stippleAlpha_, _threshold_) {} +#define blendStipple(color, _stippleAlpha_) color`)}function pst(t){return t?(Math.floor(.5*(PCe(t)-1))+.5)/t.pixelRatio:1}function AJ(t){const e=t.stipplePattern;return e?RCe(t.stipplePattern)/e.pixelRatio:1}const fst=w.float(.4),Db=64,OJ=Db/2,ICe=OJ/5,mst=Db/ICe,gst=.25;function yst(t,e){const r=RSe(t,Db,OJ,ICe),i=new pr;return i.internalFormat=Tt.RGBA,i.width=Db,i.height=Db,i.wrapMode=Pt.CLAMP_TO_EDGE,new Ct(e,i,r)}function LCe(t,e){const{vertex:r,constants:i}=t;i.add("markerSizePerLineWidth","float",mst),LE(r,e),r.uniforms.get("markerScale")==null&&r.constants.add("markerScale","float",1),r.code.add(w`float getLineWidth() { +return max(getSize(), 1.0) * pixelRatio; +} +float getScreenMarkerSize() { +return markerSizePerLineWidth * markerScale * getLineWidth(); +}`),e.space===mu.World&&(r.constants.add("maxSegmentLengthFraction","float",.45),r.uniforms.add(new Ce("perRenderPixelRatio",(n,s)=>s.camera.perRenderPixelRatio)),r.code.add(w`bool areWorldMarkersHidden(vec4 pos, vec4 other) { +vec3 midPoint = mix(pos.xyz, other.xyz, 0.5); +float distanceToCamera = length(midPoint); +float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5; +float worldMarkerSize = getScreenMarkerSize() * screenToWorldRatio; +float segmentLen = length(pos.xyz - other.xyz); +return worldMarkerSize > maxSegmentLengthFraction * segmentLen; +} +float getWorldMarkerSize(vec4 pos) { +float distanceToCamera = length(pos.xyz); +float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5; +return getScreenMarkerSize() * screenToWorldRatio; +}`))}var Ah;(function(t){t[t.BUTT=0]="BUTT",t[t.SQUARE=1]="SQUARE",t[t.ROUND=2]="ROUND",t[t.COUNT=3]="COUNT"})(Ah||(Ah={}));let Ni=class extends Fo{constructor(){super(...arguments),this.output=D.Color,this.capType=Ah.BUTT,this.transparencyPassType=rt.NONE,this.occluder=!1,this.hasSlicePlane=!1,this.hasPolygonOffset=!1,this.writeDepth=!1,this.draped=!1,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stippleScaleWithLineWidth=!1,this.stipplePreferContinuous=!0,this.roundJoins=!1,this.applyMarkerOffset=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.wireframe=!1,this.objectAndLayerIdColorInstanced=!1}};h([U({count:D.COUNT})],Ni.prototype,"output",void 0),h([U({count:Ah.COUNT})],Ni.prototype,"capType",void 0),h([U({count:rt.COUNT})],Ni.prototype,"transparencyPassType",void 0),h([U()],Ni.prototype,"occluder",void 0),h([U()],Ni.prototype,"hasSlicePlane",void 0),h([U()],Ni.prototype,"hasPolygonOffset",void 0),h([U()],Ni.prototype,"writeDepth",void 0),h([U()],Ni.prototype,"draped",void 0),h([U()],Ni.prototype,"stippleEnabled",void 0),h([U()],Ni.prototype,"stippleOffColorEnabled",void 0),h([U()],Ni.prototype,"stippleScaleWithLineWidth",void 0),h([U()],Ni.prototype,"stipplePreferContinuous",void 0),h([U()],Ni.prototype,"roundJoins",void 0),h([U()],Ni.prototype,"applyMarkerOffset",void 0),h([U()],Ni.prototype,"vvSize",void 0),h([U()],Ni.prototype,"vvColor",void 0),h([U()],Ni.prototype,"vvOpacity",void 0),h([U()],Ni.prototype,"falloffEnabled",void 0),h([U()],Ni.prototype,"innerColorEnabled",void 0),h([U()],Ni.prototype,"hasOccludees",void 0),h([U()],Ni.prototype,"hasMultipassTerrain",void 0),h([U()],Ni.prototype,"cullAboveGround",void 0),h([U()],Ni.prototype,"wireframe",void 0),h([U({constValue:!0})],Ni.prototype,"stippleRequiresClamp",void 0),h([U({constValue:!0})],Ni.prototype,"stippleRequiresStretchMeasure",void 0),h([U({constValue:!0})],Ni.prototype,"hasVvInstancing",void 0),h([U({constValue:!0})],Ni.prototype,"hasSliceTranslatedView",void 0),h([U()],Ni.prototype,"objectAndLayerIdColorInstanced",void 0);const U5=1;function _st(t){const e=new mr,{vertex:r,fragment:i}=e,n=t.hasMultipassTerrain&&(t.output===D.Color||t.output===D.Alpha);e.include(IP),e.include(ACe,t),e.include($Ce,t);const s=t.applyMarkerOffset&&!t.draped;s&&(r.uniforms.add(new Ce("markerScale",m=>m.markerScale)),e.include(LCe,{space:mu.World,draped:!1})),t.output===D.Depth&&e.include(Xg,t),e.include(GP,t),xc(r,t),r.uniforms.add(new Mi("inverseProjectionMatrix",(m,y)=>y.camera.inverseProjectionMatrix),new yr("nearFar",(m,y)=>y.camera.nearFar),new Ce("miterLimit",m=>m.join!=="miter"?0:m.miterLimit),new Jt("viewport",(m,y)=>y.camera.fullViewport)),r.constants.add("LARGE_HALF_FLOAT","float",65500),e.attributes.add(E.POSITION,"vec3"),e.attributes.add(E.SUBDIVISIONFACTOR,"float"),e.attributes.add(E.UV0,"vec2"),e.attributes.add(E.AUXPOS1,"vec3"),e.attributes.add(E.AUXPOS2,"vec3"),e.varyings.add("vColor","vec4"),e.varyings.add("vpos","vec3"),W_(e),n&&e.varyings.add("depth","float");const o=t.stippleEnabled&&t.stippleScaleWithLineWidth;o&&e.varyings.add("vLineSizeInv","float");const a=t.capType===Ah.ROUND,l=o||a;l&&e.varyings.add("vLineWidth","float");const c=t.innerColorEnabled||a;c&&e.varyings.add("vLineDistance","float");const u=t.stippleEnabled&&a,d=t.falloffEnabled||u;d&&e.varyings.add("vLineDistanceNorm","float"),a&&(e.varyings.add("vSegmentSDF","float"),e.varyings.add("vReverseSegmentSDF","float")),r.code.add(w`#define PERPENDICULAR(v) vec2(v.y, -v.x); +float interp(float ncp, vec4 a, vec4 b) { +return (-ncp - a.z) / (b.z - a.z); +} +vec2 rotate(vec2 v, float a) { +float s = sin(a); +float c = cos(a); +mat2 m = mat2(c, -s, s, c); +return m * v; +}`),r.code.add(w`vec4 projectAndScale(vec4 pos) { +vec4 posNdc = proj * pos; +posNdc.xy *= viewport.zw / posNdc.w; +return posNdc; +}`),t8(e),r.code.add(w` + void clipAndTransform(inout vec4 pos, inout vec4 prev, inout vec4 next, in bool isStartVertex) { + float vnp = nearFar[0] * 0.99; + + if(pos.z > -nearFar[0]) { + //current pos behind ncp --> we need to clip + if (!isStartVertex) { + if(prev.z < -nearFar[0]) { + //previous in front of ncp + pos = mix(prev, pos, interp(vnp, prev, pos)); + next = pos; + } else { + pos = vec4(0.0, 0.0, 0.0, 1.0); + } + } else { + if(next.z < -nearFar[0]) { + //next in front of ncp + pos = mix(pos, next, interp(vnp, pos, next)); + prev = pos; + } else { + pos = vec4(0.0, 0.0, 0.0, 1.0); + } + } + } else { + //current position visible + if (prev.z > -nearFar[0]) { + //previous behind ncp + prev = mix(pos, prev, interp(vnp, pos, prev)); + } + if (next.z > -nearFar[0]) { + //next behind ncp + next = mix(next, pos, interp(vnp, next, pos)); + } + } + + ${n?"depth = pos.z;":""} + linearDepth = calculateLinearDepth(nearFar,pos.z); + + pos = projectAndScale(pos); + next = projectAndScale(next); + prev = projectAndScale(prev); + } + `),LE(r,t),r.code.add(w` + void main(void) { + // unpack values from uv0.y + bool isStartVertex = abs(abs(uv0.y)-3.0) == 1.0; + + float coverage = 1.0; + + // Check for special value of uv0.y which is used by the Renderer when graphics + // are removed before the VBO is recompacted. If this is the case, then we just + // project outside of clip space. + if (uv0.y == 0.0) { + // Project out of clip space + gl_Position = vec4(1e038, 1e038, 1e038, 1.0); + } + else { + bool isJoin = abs(uv0.y) < 3.0; + + float lineSize = getSize(); + float lineWidth = lineSize * pixelRatio; + + ${l?w`vLineWidth = lineWidth;`:""} + ${o?w`vLineSizeInv = 1.0 / lineSize;`:""} + + // convert sub-pixel coverage to alpha + if (lineWidth < 1.0) { + coverage = lineWidth; + lineWidth = 1.0; + }else{ + // Ribbon lines cannot properly render non-integer sizes. Round width to integer size if + // larger than one for better quality. Note that we do render < 1 pixels more or less correctly + // so we only really care to round anything larger than 1. + lineWidth = floor(lineWidth + 0.5); + } + + vec4 pos = view * vec4(position.xyz, 1.0); + vec4 prev = view * vec4(auxpos1.xyz, 1.0); + vec4 next = view * vec4(auxpos2.xyz, 1.0); + `),s&&r.code.add(w`vec4 other = isStartVertex ? next : prev; +bool markersHidden = areWorldMarkersHidden(pos, other); +if(!isJoin && !markersHidden) { +pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos) * 0.5; +}`),r.code.add(w`clipAndTransform(pos, prev, next, isStartVertex); +vec2 left = (pos.xy - prev.xy); +vec2 right = (next.xy - pos.xy); +float leftLen = length(left); +float rightLen = length(right);`),(t.stippleEnabled||a)&&r.code.add(w` + float isEndVertex = float(!isStartVertex); + vec2 segmentOrigin = mix(pos.xy, prev.xy, isEndVertex); + vec2 segment = mix(right, left, isEndVertex); + ${a?w`vec2 segmentEnd = mix(next.xy, pos.xy, isEndVertex);`:""} + `),r.code.add(w`left = (leftLen > 0.001) ? left/leftLen : vec2(0.0, 0.0); +right = (rightLen > 0.001) ? right/rightLen : vec2(0.0, 0.0); +vec2 capDisplacementDir = vec2(0, 0); +vec2 joinDisplacementDir = vec2(0, 0); +float displacementLen = lineWidth; +if (isJoin) { +bool isOutside = (left.x * right.y - left.y * right.x) * uv0.y > 0.0; +joinDisplacementDir = normalize(left + right); +joinDisplacementDir = PERPENDICULAR(joinDisplacementDir); +if (leftLen > 0.001 && rightLen > 0.001) { +float nDotSeg = dot(joinDisplacementDir, left); +displacementLen /= length(nDotSeg * left - joinDisplacementDir); +if (!isOutside) { +displacementLen = min(displacementLen, min(leftLen, rightLen)/abs(nDotSeg)); +} +} +if (isOutside && (displacementLen > miterLimit * lineWidth)) {`),t.roundJoins?r.code.add(w` + vec2 startDir = leftLen < 0.001 ? right : left; + startDir = PERPENDICULAR(startDir); + + vec2 endDir = rightLen < 0.001 ? left : right; + endDir = PERPENDICULAR(endDir); + + float factor = ${t.stippleEnabled?w`min(1.0, subdivisionFactor * ${w.float((U5+2)/(U5+1))})`:w`subdivisionFactor`}; + + float rotationAngle = acos(clamp(dot(startDir, endDir), -1.0, 1.0)); + joinDisplacementDir = rotate(startDir, -sign(uv0.y) * factor * rotationAngle); + `):r.code.add(w`if (leftLen < 0.001) { +joinDisplacementDir = right; +} +else if (rightLen < 0.001) { +joinDisplacementDir = left; +} +else { +joinDisplacementDir = (isStartVertex || subdivisionFactor > 0.0) ? right : left; +} +joinDisplacementDir = PERPENDICULAR(joinDisplacementDir);`);const p=t.capType!==Ah.BUTT;return r.code.add(w` + displacementLen = lineWidth; + } + } else { + // CAP handling --------------------------------------------------- + joinDisplacementDir = isStartVertex ? right : left; + joinDisplacementDir = PERPENDICULAR(joinDisplacementDir); + + ${p?w`capDisplacementDir = isStartVertex ? -right : left;`:""} + } + `),r.code.add(w` + // Displacement (in pixels) caused by join/or cap + vec2 dpos = joinDisplacementDir * sign(uv0.y) * displacementLen + capDisplacementDir * displacementLen; + + ${d||c?w`float lineDistNorm = sign(uv0.y) * pos.w;`:""} + + ${c?w`vLineDistance = lineWidth * lineDistNorm;`:""} + ${d?w`vLineDistanceNorm = lineDistNorm;`:""} + + pos.xy += dpos; + `),a&&r.code.add(w`vec2 segmentDir = normalize(segment); +vSegmentSDF = (isJoin && isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentOrigin, segmentDir) * pos.w) ; +vReverseSegmentSDF = (isJoin && !isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentEnd, -segmentDir) * pos.w);`),t.stippleEnabled&&(t.draped?r.uniforms.add(new Ce("worldToScreenRatio",(m,y)=>1/y.screenToPCSRatio)):r.code.add(w`vec3 segmentCenter = mix((auxpos2 + position) * 0.5, (position + auxpos1) * 0.5, isEndVertex); +float worldToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),r.code.add(w`float segmentLengthScreenDouble = length(segment); +float segmentLengthScreen = segmentLengthScreenDouble * 0.5; +float discreteWorldToScreenRatio = discretizeWorldToScreenRatio(worldToScreenRatio); +float segmentLengthRender = length(mix(auxpos2 - position, position - auxpos1, isEndVertex)); +vStipplePatternStretch = worldToScreenRatio / discreteWorldToScreenRatio;`),t.draped?r.code.add(w`float segmentLengthPseudoScreen = segmentLengthScreen / pixelRatio * discreteWorldToScreenRatio / worldToScreenRatio; +float startPseudoScreen = uv0.x * discreteWorldToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):r.code.add(w`float startPseudoScreen = mix(uv0.x, uv0.x - segmentLengthRender, isEndVertex) * discreteWorldToScreenRatio; +float segmentLengthPseudoScreen = segmentLengthRender * discreteWorldToScreenRatio;`),r.uniforms.add(new Ce("stipplePatternPixelSize",m=>AJ(m))),r.code.add(w` + float patternLength = ${t.stippleScaleWithLineWidth?"lineSize * ":""} stipplePatternPixelSize; + + // Compute the coordinates at both start and end of the line segment, because we need both to clamp to in the fragment shader + vStippleDistanceLimits = computeStippleDistanceLimits(startPseudoScreen, segmentLengthPseudoScreen, segmentLengthScreen, patternLength); + + vStippleDistance = mix(vStippleDistanceLimits.x, vStippleDistanceLimits.y, isEndVertex); + + // Adjust the coordinate to the displaced position (the pattern is shortened/overextended on the in/outside of joins) + if (segmentLengthScreenDouble >= 0.001) { + // Project the actual vertex position onto the line segment. Note that the resulting factor is within [0..1] at the + // original vertex positions, and slightly outside of that range at the displaced positions + vec2 stippleDisplacement = pos.xy - segmentOrigin; + float stippleDisplacementFactor = dot(segment, stippleDisplacement) / (segmentLengthScreenDouble * segmentLengthScreenDouble); + + // Apply this offset to the actual vertex coordinate (can be screen or pseudo-screen space) + vStippleDistance += (stippleDisplacementFactor - isEndVertex) * (vStippleDistanceLimits.y - vStippleDistanceLimits.x); + } + + // Cancel out perspective correct interpolation because we want this length the really represent the screen distance + vStippleDistanceLimits *= pos.w; + vStippleDistance *= pos.w; + + // Disable stipple distance limits on caps + vStippleDistanceLimits = isJoin ? + vStippleDistanceLimits : + isStartVertex ? + vec2(-1e038, vStippleDistanceLimits.y) : + vec2(vStippleDistanceLimits.x, 1e038); + `)),r.code.add(w` + // Convert back into NDC + pos.xy = (pos.xy / viewport.zw) * pos.w; + + vColor = getColor(); + vColor.a *= coverage; + + ${t.wireframe&&!t.draped?"pos.z -= 0.001 * pos.w;":""} + + // transform final position to camera space for slicing + vpos = (inverseProjectionMatrix * pos).xyz; + gl_Position = pos; + forwardObjectAndLayerIdColor(); + } + } + `),n&&e.include(xu,t),e.include(fn,t),i.include(cm),i.code.add(w` + void main() { + discardBySlice(vpos); + ${n?"terrainDepthTest(gl_FragCoord, depth);":""} + `),t.wireframe?i.code.add(w`vec4 finalColor = vec4(1.0, 0.0, 1.0, 1.0);`):(a&&i.code.add(w` + float sdf = min(vSegmentSDF, vReverseSegmentSDF); + vec2 fragmentPosition = vec2( + min(sdf, 0.0), + vLineDistance + ) * gl_FragCoord.w; + + float fragmentRadius = length(fragmentPosition); + float fragmentCapSDF = (fragmentRadius - vLineWidth) * 0.5; // Divide by 2 to transform from double pixel scale + float capCoverage = clamp(0.5 - fragmentCapSDF, 0.0, 1.0); + + if (capCoverage < ${w.float(vo)}) { + discard; + } + `),u?i.code.add(w` + vec2 stipplePosition = vec2( + min(getStippleSDF() * 2.0 - 1.0, 0.0), + vLineDistanceNorm * gl_FragCoord.w + ); + float stippleRadius = length(stipplePosition * vLineWidth); + float stippleCapSDF = (stippleRadius - vLineWidth) * 0.5; // Divide by 2 to transform from double pixel scale + float stippleCoverage = clamp(0.5 - stippleCapSDF, 0.0, 1.0); + float stippleAlpha = step(${w.float(vo)}, stippleCoverage); + `):i.code.add(w`float stippleAlpha = getStippleAlpha();`),i.uniforms.add(new Jt("intrinsicColor",m=>m.color)),t.output!==D.ObjectAndLayerIdColor&&i.code.add(w`discardByStippleAlpha(stippleAlpha, stippleAlphaColorDiscard);`),i.code.add(w`vec4 color = intrinsicColor * vColor;`),t.innerColorEnabled&&(i.uniforms.add(new Jt("innerColor",m=>m.innerColor??m.color),new Ce("innerWidth",(m,y)=>m.innerWidth*y.camera.pixelRatio)),i.code.add(w`float distToInner = abs(vLineDistance * gl_FragCoord.w) - innerWidth; +float innerAA = clamp(0.5 - distToInner, 0.0, 1.0); +float innerAlpha = innerColor.a + color.a * (1.0 - innerColor.a); +color = mix(color, vec4(innerColor.rgb, innerAlpha), innerAA);`)),i.code.add(w`vec4 finalColor = blendStipple(color, stippleAlpha);`),t.falloffEnabled&&(i.uniforms.add(new Ce("falloff",m=>m.falloff)),i.code.add(w`finalColor.a *= pow(max(0.0, 1.0 - abs(vLineDistanceNorm * gl_FragCoord.w)), falloff);`))),i.code.add(w` + ${t.output===D.ObjectAndLayerIdColor?w`finalColor.a = 1.0;`:""} + + if (finalColor.a < ${w.float(vo)}) { + discard; + } + + ${t.output===D.Alpha?w`fragColor = vec4(finalColor.a);`:""} + ${t.output===D.Color?w`fragColor = highlightSlice(finalColor, vpos);`:""} + ${t.output===D.Color&&t.transparencyPassType===rt.Color?"fragColor = premultiplyAlpha(fragColor);":""} + ${t.output===D.Highlight?w`fragColor = vec4(1.0);`:""} + ${t.output===D.Depth?w`outputDepth(linearDepth);`:""} + ${t.output===D.ObjectAndLayerIdColor?w`outputObjectAndLayerIdColor();`:""} + } + `),e}const vst=Object.freeze(Object.defineProperty({__proto__:null,RIBBONLINE_NUM_ROUND_JOIN_SUBDIVISIONS:U5,build:_st},Symbol.toStringTag,{value:"Module"})),RJ={func:Hr.LESS},k5={func:Hr.ALWAYS},em={mask:255},DCe={mask:0},bst=t=>({function:{func:Hr.NOTEQUAL,ref:t,mask:t},operation:{fail:_n.KEEP,zFail:_n.KEEP,zPass:_n.KEEP}}),wst=t=>({function:{func:Hr.ALWAYS,ref:t,mask:t},operation:{fail:_n.KEEP,zFail:_n.KEEP,zPass:_n.REPLACE}}),m1={function:{func:Hr.ALWAYS,ref:Rl.OutlineVisualElementMask,mask:Rl.OutlineVisualElementMask},operation:{fail:_n.KEEP,zFail:_n.KEEP,zPass:_n.ZERO}},r1={function:{func:Hr.ALWAYS,ref:Rl.OutlineVisualElementMask,mask:Rl.OutlineVisualElementMask},operation:{fail:_n.KEEP,zFail:_n.KEEP,zPass:_n.REPLACE}},NCe={function:{func:Hr.EQUAL,ref:Rl.OutlineVisualElementMask,mask:Rl.OutlineVisualElementMask},operation:{fail:_n.KEEP,zFail:_n.KEEP,zPass:_n.KEEP}},FCe={function:{func:Hr.NOTEQUAL,ref:Rl.OutlineVisualElementMask,mask:Rl.OutlineVisualElementMask},operation:{fail:_n.KEEP,zFail:_n.KEEP,zPass:_n.KEEP}},UCe=new Map([[E.POSITION,0],[E.SUBDIVISIONFACTOR,1],[E.UV0,2],[E.AUXPOS1,3],[E.AUXPOS2,4],[E.COLOR,5],[E.COLORFEATUREATTRIBUTE,5],[E.SIZE,6],[E.SIZEFEATUREATTRIBUTE,6],[E.OPACITYFEATUREATTRIBUTE,7],[E.OBJECTANDLAYERIDCOLOR,8]]);let kCe=class zCe extends Tr{initializeProgram(e){return new vr(e.rctx,zCe.shader.get().build(this.configuration),UCe)}_makePipelineState(e,r){const i=this.configuration,n=e===rt.NONE,s=e===rt.FrontFace;return Ot({blending:i.output===D.Color||i.output===D.Alpha?n?fu:u0(e):null,depthTest:{func:f1(e)},depthWrite:n?i.writeDepth?$l:null:S8(e),colorWrite:Ft,stencilWrite:i.hasOccludees?em:null,stencilTest:i.hasOccludees?r?r1:m1:null,polygonOffset:n||s?i.hasPolygonOffset?cae:null:C8})}initializePipeline(){const e=this.configuration;if(e.occluder){const r=e.hasPolygonOffset?cae:null;this._occluderPipelineTransparent=Ot({blending:fu,polygonOffset:r,depthTest:k5,depthWrite:null,colorWrite:Ft,stencilWrite:null,stencilTest:FCe}),this._occluderPipelineOpaque=Ot({blending:fu,polygonOffset:r,depthTest:k5,depthWrite:null,colorWrite:Ft,stencilWrite:DCe,stencilTest:NCe}),this._occluderPipelineMaskWrite=Ot({blending:null,polygonOffset:r,depthTest:RJ,depthWrite:null,colorWrite:null,stencilWrite:em,stencilTest:r1})}return this._occludeePipelineState=this._makePipelineState(this.configuration.transparencyPassType,!0),this._makePipelineState(this.configuration.transparencyPassType,!1)}get primitiveType(){return this.configuration.wireframe?Et.LINES:Et.TRIANGLE_STRIP}getPipelineState(e,r){return r?this._occludeePipelineState:this.configuration.occluder?e===le.TRANSPARENT_OCCLUDER_MATERIAL?this._occluderPipelineTransparent:e===le.OCCLUDER_MATERIAL?this._occluderPipelineOpaque:this._occluderPipelineMaskWrite:super.getPipelineState(e,r)}};kCe.shader=new _r(vst,()=>ce(()=>import("./RibbonLine.glsl-0c86e4e2.js"),[]));const cae={factor:0,units:-4};var Jl;(function(t){t[t.LEFT_JOIN_START=-2]="LEFT_JOIN_START",t[t.LEFT_JOIN_END=-1]="LEFT_JOIN_END",t[t.LEFT_CAP_START=-4]="LEFT_CAP_START",t[t.LEFT_CAP_END=-5]="LEFT_CAP_END",t[t.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",t[t.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",t[t.RIGHT_CAP_START=4]="RIGHT_CAP_START",t[t.RIGHT_CAP_END=5]="RIGHT_CAP_END"})(Jl||(Jl={}));let yT=class extends p1{constructor(e){super(e,new Tst),this._configuration=new Ni,this._vertexAttributeLocations=UCe}isClosed(e,r){return VCe(this.parameters,e,r)}getConfiguration(e,r){this._configuration.output=e,this._configuration.draped=r.slot===le.DRAPED_MATERIAL;const i=this.parameters.stipplePattern!=null&&e!==D.Highlight;return this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&this.parameters.stippleOffColor!=null,this._configuration.stippleScaleWithLineWidth=i&&this.parameters.stippleScaleWithLineWidth,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins=this.parameters.join==="round",this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&Est(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.occluder=this.parameters.renderOccluded===Ri.OccludeAndTransparentStencil,this._configuration.transparencyPassType=r.transparencyPassType,this._configuration.hasMultipassTerrain=r.multipassTerrain.enabled,this._configuration.cullAboveGround=r.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}intersectDraped(e,r,i,n,s,o){if(!i.options.selectionMode)return;const a=e.vertexAttributes.get(E.POSITION).data,l=e.vertexAttributes.get(E.SIZE);let c=this.parameters.width;if(this.parameters.vvSize){const _=e.vertexAttributes.get(E.SIZEFEATUREATTRIBUTE).data[0];c*=ge(this.parameters.vvSize.offset[0]+_*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(c*=l.data[0]);const u=n[0],d=n[1],p=(c/2+4)*e.screenToWorldRatio;let m=Number.MAX_VALUE,y=0;for(let _=0;_0){ae(Ip,ol,al);const A=u.frustum,C=-oi(A[si.NEAR],ol)/fe(Ip,A[si.NEAR]);te(Ip,Ip,C),oe(ol,ol,Ip),u.projectToRenderScreen(ol,U1)}else if(U1[2]>0&&k1[2]<0){ae(Ip,al,ol);const A=u.frustum,C=-oi(A[si.NEAR],al)/fe(Ip,A[si.NEAR]);te(Ip,Ip,C),oe(al,al,Ip),u.projectToRenderScreen(al,k1)}else if(U1[2]<0&&k1[2]<0)continue;U1[2]=0,k1[2]=0;const S=wZ(Pb(U1,k1,dae),d);SP=d[I]:(Q,M,I)=>P+=ci(Q,M),k=se("enable-feature:objectAndLayerId-rendering"),V=(Q,M,I,L,B,H,Z)=>{if(T[C++]=M[0],T[C++]=M[1],T[C++]=M[2],T[C++]=L,T[C++]=Z,T[C++]=B,T[C++]=Q[0],T[C++]=Q[1],T[C++]=Q[2],T[C++]=I[0],T[C++]=I[1],T[C++]=I[2],T[C++]=this._parameters.vvSize?m:p,this._parameters.vvColor)T[C++]=_;else{const K=Math.min(4*H,y.length-4);T[C++]=y[K],T[C++]=y[K+1],T[C++]=y[K+2],T[C++]=y[K+3]}this._parameters.vvOpacity&&(T[C++]=b),k&&(v!=null&&(S[4*C]=v[0],S[4*C+1]=v[1],S[4*C+2]=v[2],S[4*C+3]=v[3]),C++)};C+=A,ne(a,c[0],c[1],c[2]),e&&De(a,a,e);const z=this._isClosed(i);if(z){const Q=c.length-3;ne(o,c[Q],c[Q+1],c[Q+2]),e&&De(o,o,e)}else ne(l,c[3],c[4],c[5]),e&&De(l,l,e),V(a,a,l,1,Jl.LEFT_CAP_START,0,0),V(a,a,l,1,Jl.RIGHT_CAP_START,0,0),re(o,a),re(a,l);const X=z?0:1,q=z?x:x-1;for(let Q=X;Qa=G9(o,c,s,a,n);for(let c=0;c2:e.length>6)}function Est(t){return t.anchor===_w.Tip&&t.hideOnShortSegments&&t.placement==="begin-end"&&t.worldSpace}const ol=O(),al=O(),Ip=O(),F1=O(),Cst=O(),U1=Vo(),k1=Vo(),uae=O(),hae=O(),dae=_p(),Ast=_p(),Ost=O(),Rst=O(),Pst=O(),AC=[Vo(),Vo(),Vo(),Vo()],bm=[O(),O(),O(),O()],j9=Er(),H9=Er(),W9=Er(),q9=Er();let PJ=class{constructor(e){this._originSR=e,this._origins=new Map,this._objects=new Map,this._gridSize=5e5,this._rootOriginId="root/"+wc()}getOrigin(e){const r=this._origins.get(this._rootOriginId);if(r==null){const u=R5(e[0]+Math.random()-.5,e[1]+Math.random()-.5,e[2]+Math.random()-.5,this._rootOriginId);return this._origins.set(this._rootOriginId,u),u}const i=this._gridSize,n=Math.round(e[0]/i),s=Math.round(e[1]/i),o=Math.round(e[2]/i),a=`${n}/${s}/${o}`;let l=this._origins.get(a);const c=.5*i;if(ae(io,e,r.vec3),io[0]=Math.abs(io[0]),io[1]=Math.abs(io[1]),io[2]=Math.abs(io[2]),io[0]0&&u.push(m-1,m);$i(c,this._originSR,0,c,i.renderSpatialReference,0,l);const p=new Xn(this._material,[[E.POSITION,new Ue(c,3,!0)]],[[E.POSITION,u]],null,on.Line);n.add(p),o.addGeometry(p)}get test(){const e=this;return{set gridSize(r){e._gridSize=r}}}};const io=O();let GCe=class{constructor(e,r,i,n=null){this.rctx=e,this.sliceHelper=n,this.lastFrameCamera=new lt,this.output=D.Color,this.renderOccludedMask=pae,this.bindParameters=new e8(r,i,n!=null?n.plane:null),this.bindParameters.alignPixelEnabled=!0}resetRenderOccludedMask(){this.renderOccludedMask=pae}},Mst=class extends GCe{constructor(e,r,i,n,s){super(e,i,n,s),this.offscreenRenderingHelper=r,this.sliceHelper=s,this.time=0}};const pae=Ri.Occlude|Ri.OccludeAndTransparent|Ri.OccludeAndTransparentStencil;let nA=class extends lt{constructor(){super(...arguments),this._projectionMatrix=_e()}get projectionMatrix(){return this._projectionMatrix}};h([f()],nA.prototype,"_projectionMatrix",void 0),h([f({readOnly:!0})],nA.prototype,"projectionMatrix",null),nA=h([N("esri.views.3d.webgl-engine.lib.CascadeCamera")],nA);const fae=16;function MJ(t){return Math.ceil(t/fae)*fae}var JS;(function(t){t[t.Highlight=0]="Highlight",t[t.Default=1]="Default"})(JS||(JS={}));let uI=class{constructor(){this.camera=new nA,this.lightMat=_e()}},$st=class{constructor(){this.maxNumCascadesHighQuality=4,this.maxNumCascadesLowQuality=4,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.splitSchemeLambda=0}},$J=class{get depthTexture(){var e;return(e=this._fbo)==null?void 0:e.colorTexture}get textureSize(){return this._textureSize}get numCascades(){return this._numCascades}get cascadeDistances(){return gi(this._usedCascadeDistances,this._cascadeDistances[0],this._numCascades>1?this._cascadeDistances[1]:1/0,this._numCascades>2?this._cascadeDistances[2]:1/0,this._numCascades>3?this._cascadeDistances[3]:1/0)}constructor(e,r){this._rctx=e,this._viewingMode=r,this._enabled=!1,this._snapshots=new Array,this._textureSize=0,this._numCascades=1,this.settings=new $st,this._projectionView=_e(),this._projectionViewInverse=_e(),this._modelViewLight=_e(),this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=Qt(),this._cascades=[new uI,new uI,new uI,new uI],this._lastOrigin=null,this._maxTextureSize=Math.min(se("esri-mobile")?2048:8192,this._rctx.parameters.maxTextureSize)}dispose(){this.enabled=!1,this.disposeOffscreenBuffers()}disposeOffscreenBuffers(){this._fbo=Le(this._fbo),this._discardAllSnapshots()}set maxCascades(e){this.settings.maxNumCascadesHighQuality=ge(Math.floor(e),1,4)}get maxCascades(){return this.settings.maxNumCascadesHighQuality}set enabled(e){this._enabled=e,e||this.disposeOffscreenBuffers()}get enabled(){return this._enabled}get ready(){return this._enabled&&this.depthTexture!=null}getSnapshot(e){return this.enabled?this._snapshots[e]:null}get cascades(){for(let e=0;e=i&&(r=2,i=4),{near:r,far:i}}_computeCascadeDistances(e,r,i){const n=i?this.settings.maxNumCascadesHighQuality:this.settings.maxNumCascadesLowQuality;this._numCascades=Math.min(1+Math.floor(MHe(e/r,4)),n);const s=(e-r)/this._numCascades,o=(e/r)**(1/this._numCascades);let a=r,l=r;for(let c=0;cr+((i==null?void 0:i.gpuMemoryUsage)??0),((e=this._fbo)==null?void 0:e.gpuMemoryUsage)??0)}get test(){return{cascades:this._cascades,textureSize:this._textureSize}}};const Ist=_e(),mae=Qt(),rh=[];for(let t=0;t<8;++t)rh.push(Qt());const gae=Ne(),yae=Ne(),Lst=Ne(),_ae=Ne(),vae=Ne(),X9=O(),Y9=[],bae=_e(),wae=new Array(64),Nc=Ne(),wx=Ne(),z1=[Ne(),Ne(),Ne(),Ne()],ms=Ne(),Z9=Ne(),F0=Ne(),OC=Ne(),xx=Ne(),Tx=Ne(),hI=Ne();function Dst(t,e,r,i,n,s,o,a){er(Nc,0,0);for(let A=0;A<4;++A)Ld(Nc,Nc,t[A]);dc(Nc,Nc,.25),er(wx,0,0);for(let A=4;A<8;++A)Ld(wx,wx,t[A]);dc(wx,wx,.25),lh(z1[0],t[4],t[5],.5),lh(z1[1],t[5],t[6],.5),lh(z1[2],t[6],t[7],.5),lh(z1[3],t[7],t[4],.5);let l=0,c=J4(z1[0],Nc);for(let A=1;A<4;++A){const C=J4(z1[A],Nc);Cp&&(p=C)}fs(i,Nc),dc(F0,ms,d-e),Ld(i,i,F0);let m=-1,y=1,_=0,v=0;for(let A=0;A<8;++A){Tf(OC,t[A],i),wR(OC,OC);const C=ms[0]*OC[1]-ms[1]*OC[0];C>0?C>m&&(m=C,_=A):C0,"leftArea"),rx(y<0,"rightArea"),dc(xx,ms,d),Ld(xx,xx,Nc),dc(Tx,ms,p),Ld(Tx,Tx,Nc),hI[0]=-ms[1],hI[1]=ms[0];const b=g$(i,t[v],Tx,Ld(F0,Tx,hI),1,n),x=g$(i,t[_],Tx,F0,1,s),T=g$(i,t[_],xx,Ld(F0,xx,hI),1,o),S=g$(i,t[v],xx,F0,1,a);rx(b,"rayRay"),rx(x,"rayRay"),rx(T,"rayRay"),rx(S,"rayRay")}function hr(t,e){return 3*e+t}const xae=Ne();function kl(t,e){return er(xae,t[e],t[e+3]),xae}const ll=Ne(),He=hi();function Nst(t,e,r,i,n){Tf(ll,r,i),dc(ll,ll,.5),He[0]=ll[0],He[1]=ll[1],He[2]=0,He[3]=ll[1],He[4]=-ll[0],He[5]=0,He[6]=ll[0]*ll[0]+ll[1]*ll[1],He[7]=ll[0]*ll[1]-ll[1]*ll[0],He[8]=1,He[hr(0,2)]=-es(kl(He,0),t),He[hr(1,2)]=-es(kl(He,1),t);let s=es(kl(He,0),r)+He[hr(0,2)],o=es(kl(He,1),r)+He[hr(1,2)],a=es(kl(He,0),i)+He[hr(0,2)],l=es(kl(He,1),i)+He[hr(1,2)];s=-(s+a)/(o+l),He[hr(0,0)]+=He[hr(1,0)]*s,He[hr(0,1)]+=He[hr(1,1)]*s,He[hr(0,2)]+=He[hr(1,2)]*s,s=1/(es(kl(He,0),r)+He[hr(0,2)]),o=1/(es(kl(He,1),r)+He[hr(1,2)]),He[hr(0,0)]*=s,He[hr(0,1)]*=s,He[hr(0,2)]*=s,He[hr(1,0)]*=o,He[hr(1,1)]*=o,He[hr(1,2)]*=o,He[hr(2,0)]=He[hr(1,0)],He[hr(2,1)]=He[hr(1,1)],He[hr(2,2)]=He[hr(1,2)],He[hr(1,2)]+=1,s=es(kl(He,1),e)+He[hr(1,2)],o=es(kl(He,2),e)+He[hr(2,2)],a=es(kl(He,1),r)+He[hr(1,2)],l=es(kl(He,2),r)+He[hr(2,2)],s=-.5*(s/o+a/l),He[hr(1,0)]+=He[hr(2,0)]*s,He[hr(1,1)]+=He[hr(2,1)]*s,He[hr(1,2)]+=He[hr(2,2)]*s,s=es(kl(He,1),e)+He[hr(1,2)],o=es(kl(He,2),e)+He[hr(2,2)],a=-o/s,He[hr(1,0)]*=a,He[hr(1,1)]*=a,He[hr(1,2)]*=a,n[0]=He[0],n[1]=He[1],n[2]=0,n[3]=He[2],n[4]=He[3],n[5]=He[4],n[6]=0,n[7]=He[5],n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=He[6],n[13]=He[7],n[14]=0,n[15]=He[8]}function Fst(t,e,r,i,n){const s=1/rh[0][3],o=1/rh[4][3];Je(se||new zst,deallocator:e=>(e.renderGeometry=null,e)})}clear(){this.adds.clear(),this.removes.clear(),this.updates.clear()}prune(){this.adds.prune(),this.removes.prune(),this.updates.prune()}get empty(){return this.adds.length===0&&this.removes.length===0&&this.updates.length===0}},zst=class{},Bst=class{constructor(){this.adds=new Array,this.removes=new Array,this.updates=new Array}};var Hi,bs;(function(t){t[t.ADD=0]="ADD",t[t.UPDATE=1]="UPDATE",t[t.REMOVE=2]="REMOVE"})(Hi||(Hi={})),function(t){t[t.NONE=0]="NONE",t[t.VISIBILITY=1]="VISIBILITY",t[t.GEOMETRY=2]="GEOMETRY",t[t.TRANSFORMATION=4]="TRANSFORMATION",t[t.HIGHLIGHT=8]="HIGHLIGHT",t[t.OCCLUDEE=16]="OCCLUDEE"}(bs||(bs={}));function HCe(t){const e=new Map,r=i=>{let n=e.get(i);return n||(n=new Bst,e.set(i,n)),n};return t.removes.forAll(i=>{Q9(i)&&r(i.material).removes.push(i)}),t.adds.forAll(i=>{Q9(i)&&r(i.material).adds.push(i)}),t.updates.forAll(i=>{Q9(i.renderGeometry)&&r(i.renderGeometry.material).updates.push(i)}),e}function Q9(t){return t.geometry.indexCount>=1}let WCe=class{constructor(e,r){this._material=e,this._repository=r,this._map=new Map}destroy(){this._map.forEach((e,r)=>{e!=null&&this._repository.release(this._material,r)})}load(e,r,i){if(!this._material.requiresSlot(r,i))return null;this._map.has(i)||this._map.set(i,this._repository.acquire(this._material,r,i));const n=this._map.get(i);if(n!=null){if(n.ensureResources(e)===bg.LOADED)return n;this._repository.requestRender()}return null}};function ZP(t,e){switch(e.normalType){case br.Compressed:t.attributes.add(E.NORMALCOMPRESSED,"vec2"),t.vertex.code.add(w`vec3 normalModel() { +float z = 1.0 - abs(normalCompressed.x) - abs(normalCompressed.y); +return vec3(normalCompressed + sign(normalCompressed) * min(z, 0.0), z); +}`);break;case br.Attribute:t.attributes.add(E.NORMAL,"vec3"),t.vertex.code.add(w`vec3 normalModel() { +return normal; +}`);break;case br.ScreenDerivative:t.fragment.code.add(w`vec3 screenDerivativeNormal(vec3 positionView) { +return normalize(cross(dFdx(positionView), dFdy(positionView))); +}`);break;default:e.normalType;case br.COUNT:case br.Ground:}}var br;(function(t){t[t.Attribute=0]="Attribute",t[t.Compressed=1]="Compressed",t[t.Ground=2]="Ground",t[t.ScreenDerivative=3]="ScreenDerivative",t[t.COUNT=4]="COUNT"})(br||(br={}));function F8(t,e){switch(e.normalType){case br.Attribute:case br.Compressed:t.include(ZP,e),t.varyings.add("vNormalWorld","vec3"),t.varyings.add("vNormalView","vec3"),t.vertex.uniforms.add(new xR("transformNormalGlobalFromModel",r=>r.transformNormalGlobalFromModel),new Gh("transformNormalViewFromGlobal",r=>r.transformNormalViewFromGlobal)),t.vertex.code.add(w`void forwardNormal() { +vNormalWorld = transformNormalGlobalFromModel * normalModel(); +vNormalView = transformNormalViewFromGlobal * vNormalWorld; +}`);break;case br.Ground:t.include(kT,e),t.varyings.add("vNormalWorld","vec3"),t.vertex.code.add(w` + void forwardNormal() { + vNormalWorld = ${e.spherical?w`normalize(vPositionWorldCameraRelative);`:w`vec3(0.0, 0.0, 1.0);`} + } + `);break;case br.ScreenDerivative:t.vertex.code.add(w`void forwardNormal() {}`);break;default:e.normalType;case br.COUNT:}}let qCe=class extends Jxe{constructor(){super(...arguments),this.transformNormalViewFromGlobal=hi()}},XCe=class extends Kxe{constructor(){super(...arguments),this.transformNormalGlobalFromModel=hi(),this.toMapSpace=Qt()}},eW=class extends XCe{constructor(e=O()){super(),this.origin=e,this.slicePlaneLocalOrigin=this.origin}},DE=class{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.indices.get(E.POSITION).length}write(e,r,i,n,s){wSe(i,this.vertexBufferLayout,e,r,n,s)}};const Vst=Gi().vec3f(E.POSITION),Gst=Gi().vec3f(E.POSITION).vec2f(E.UV0),jst=Gi().vec3f(E.POSITION).vec4u8(E.COLOR);Gi().vec3f(E.POSITION).vec4u8(E.OBJECTANDLAYERIDCOLOR);const Hst=Gi().vec3f(E.POSITION).vec2f(E.UV0).vec4u8(E.OBJECTANDLAYERIDCOLOR);Gi().vec3f(E.POSITION).vec4u8(E.COLOR).vec4u8(E.OBJECTANDLAYERIDCOLOR);let IJ=class extends p1{intersect(e,r,i,n,s,o){return cSe(e,i,n,s,void 0,o)}};function Wst(t){t.fragment.code.add(w`float normals2FoamIntensity(vec3 n, float waveStrength){ +float normalizationFactor = max(0.015, waveStrength); +return max((n.x + n.y)*0.3303545/normalizationFactor + 0.3303545, 0.0); +}`)}function qst(t){t.fragment.code.add(w`vec3 foamIntensity2FoamColor(float foamIntensityExternal, float foamPixelIntensity, vec3 skyZenitColor, float dayMod){ +return foamIntensityExternal * (0.075 * skyZenitColor * pow(foamPixelIntensity, 4.) + 50.* pow(foamPixelIntensity, 23.0)) * dayMod; +}`)}let QP=class extends ln{constructor(e,r){super(e,"int",jr.Pass,(i,n,s)=>i.setUniform1i(e,r(n,s)))}},Xst=class extends ln{constructor(e,r,i){super(e,"mat4",jr.Draw,(n,s,o,a)=>n.setUniformMatrix4fv(e,r(s,o,a)),i)}},Yst=class extends ln{constructor(e,r,i){super(e,"mat4",jr.Pass,(n,s,o)=>n.setUniformMatrix4fv(e,r(s,o)),i)}},Zst=class extends Wr{constructor(){super(...arguments),this.origin=O()}},Qst=class extends Zst{},Jst=class extends Wr{constructor(){super(...arguments),this.modelTransformation=yn}},LJ=class extends Jst{constructor(){super(...arguments),this.origin=O()}};function U8(t,e){e.receiveShadows&&(t.fragment.uniforms.add(new Yst("shadowMapMatrix",(r,i)=>i.shadowMap.getShadowMapMatrices(r.origin),4)),YCe(t))}function vw(t,e){e.receiveShadows&&(t.fragment.uniforms.add(new Xst("shadowMapMatrix",(r,i)=>i.shadowMap.getShadowMapMatrices(r.origin),4)),YCe(t))}function YCe(t){const e=t.fragment;e.include(Pc),e.uniforms.add(new Ye("shadowMapTex",(r,i)=>i.shadowMap.depthTexture),new QP("numCascades",(r,i)=>i.shadowMap.numCascades),new Jt("cascadeDistances",(r,i)=>i.shadowMap.cascadeDistances)),e.code.add(w`int chooseCascade(float depth, out mat4 mat) { +vec4 distance = cascadeDistances; +int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3; +mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3]; +return i; +} +vec3 lightSpacePosition(vec3 _vpos, mat4 mat) { +vec4 lv = mat * vec4(_vpos, 1.0); +lv.xy /= lv.w; +return 0.5 * lv.xyz + vec3(0.5); +} +vec2 cascadeCoordinates(int i, vec3 lvpos) { +return vec2(float(i - 2 * (i / 2)) * 0.5, float(i / 2) * 0.5) + (numCascades == 1 ? 1.0 : 0.5) * lvpos.xy; +} +float readShadowMapDepth(vec2 uv, sampler2D _depthTex) { +return rgba2float(texture(_depthTex, uv)); +} +float posIsInShadow(vec2 uv, vec3 lvpos, sampler2D _depthTex) { +return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0; +} +float filterShadow(vec2 uv, vec3 lvpos, float texSize, sampler2D _depthTex) { +float halfPixelSize = 0.5 / texSize; +vec2 st = fract((vec2(halfPixelSize) + uv) * texSize); +float s00 = posIsInShadow(uv + vec2(-halfPixelSize, -halfPixelSize), lvpos, _depthTex); +float s10 = posIsInShadow(uv + vec2(halfPixelSize, -halfPixelSize), lvpos, _depthTex); +float s11 = posIsInShadow(uv + vec2(halfPixelSize, halfPixelSize), lvpos, _depthTex); +float s01 = posIsInShadow(uv + vec2(-halfPixelSize, halfPixelSize), lvpos, _depthTex); +return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y); +} +float readShadowMap(const in vec3 _vpos, float _linearDepth) { +mat4 mat; +int i = chooseCascade(_linearDepth, mat); +if (i >= numCascades) { return 0.0; } +vec3 lvpos = lightSpacePosition(_vpos, mat); +if (lvpos.z >= 1.0) { return 0.0; } +if (lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; } +vec2 uv = cascadeCoordinates(i, lvpos); +return filterShadow(uv, lvpos, float(textureSize(shadowMapTex, 0).x), shadowMapTex); +}`)}function Tae(t){t.fragment.uniforms.add(new Ye("texWaveNormal",e=>e.waveNormal),new Ye("texWavePerturbation",e=>e.wavePertubation),new Jt("waveParams",e=>gi(Kst,e.waveStrength,e.waveTextureRepeat,e.flowStrength,e.flowOffset)),new yr("waveDirection",e=>er(eot,e.waveDirection[0]*e.waveVelocity,e.waveDirection[1]*e.waveVelocity))),t.include(Wst),t.fragment.code.add(w`const vec2 FLOW_JUMP = vec2(6.0/25.0, 5.0/24.0); +vec2 textureDenormalized2D(sampler2D _tex, vec2 _uv) { +return 2.0 * texture(_tex, _uv).rg - 1.0; +} +float sampleNoiseTexture(vec2 _uv) { +return texture(texWavePerturbation, _uv).b; +} +vec3 textureDenormalized3D(sampler2D _tex, vec2 _uv) { +return 2.0 * texture(_tex, _uv).rgb - 1.0; +} +float computeProgress(vec2 uv, float time) { +return fract(time); +} +float computeWeight(vec2 uv, float time) { +float progress = computeProgress(uv, time); +return 1.0 - abs(1.0 - 2.0 * progress); +} +vec3 computeUVPerturbedWeigth(sampler2D texFlow, vec2 uv, float time, float phaseOffset) { +float flowStrength = waveParams[2]; +float flowOffset = waveParams[3]; +vec2 flowVector = textureDenormalized2D(texFlow, uv) * flowStrength; +float progress = computeProgress(uv, time + phaseOffset); +float weight = computeWeight(uv, time + phaseOffset); +vec2 result = uv; +result -= flowVector * (progress + flowOffset); +result += phaseOffset; +result += (time - progress) * FLOW_JUMP; +return vec3(result, weight); +} +const float TIME_NOISE_TEXTURE_REPEAT = 0.3737; +const float TIME_NOISE_STRENGTH = 7.77; +vec3 getWaveLayer(sampler2D _texNormal, sampler2D _dudv, vec2 _uv, vec2 _waveDir, float time) { +float waveStrength = waveParams[0]; +vec2 waveMovement = time * -_waveDir; +float timeNoise = sampleNoiseTexture(_uv * TIME_NOISE_TEXTURE_REPEAT) * TIME_NOISE_STRENGTH; +vec3 uv_A = computeUVPerturbedWeigth(_dudv, _uv + waveMovement, time + timeNoise, 0.0); +vec3 uv_B = computeUVPerturbedWeigth(_dudv, _uv + waveMovement, time + timeNoise, 0.5); +vec3 normal_A = textureDenormalized3D(_texNormal, uv_A.xy) * uv_A.z; +vec3 normal_B = textureDenormalized3D(_texNormal, uv_B.xy) * uv_B.z; +vec3 mixNormal = normalize(normal_A + normal_B); +mixNormal.xy *= waveStrength; +mixNormal.z = sqrt(1.0 - dot(mixNormal.xy, mixNormal.xy)); +return mixNormal; +} +vec4 getSurfaceNormalAndFoam(vec2 _uv, float _time) { +float waveTextureRepeat = waveParams[1]; +vec3 normal = getWaveLayer(texWaveNormal, texWavePerturbation, _uv * waveTextureRepeat, waveDirection, _time); +float foam = normals2FoamIntensity(normal, waveParams[0]); +return vec4(normal, foam); +}`)}const Kst=Qt(),eot=Ne();function UR(t,e){e.spherical?t.vertex.code.add(w`vec3 getLocalUp(in vec3 pos, in vec3 origin) { +return normalize(pos + origin); +}`):t.vertex.code.add(w`vec3 getLocalUp(in vec3 pos, in vec3 origin) { +return vec3(0.0, 0.0, 1.0); +}`),e.spherical?t.vertex.code.add(w`mat3 getTBNMatrix(in vec3 n) { +vec3 t = normalize(cross(vec3(0.0, 0.0, 1.0), n)); +vec3 b = normalize(cross(n, t)); +return mat3(t, b, n); +}`):t.vertex.code.add(w`mat3 getTBNMatrix(in vec3 n) { +vec3 t = vec3(1.0, 0.0, 0.0); +vec3 b = normalize(cross(n, t)); +return mat3(t, b, n); +}`)}function tot(t){const e=t.fragment.code;e.add(w`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) +{ +return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5; +}`),e.add(w`float integratedRadiance(float cosTheta2, float roughness) +{ +return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0); +}`),e.add(w`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness) +{ +float cosTheta2 = 1.0 - RdotNG * RdotNG; +float intRadTheta = integratedRadiance(cosTheta2, roughness); +float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta; +float sky = 2.0 - ground; +return (ground * ambientGround + sky * ambientSky) * 0.5; +}`)}function DJ(t,e){const r=t.fragment.code;t.include(IP),e.pbrMode!==et.Normal&&e.pbrMode!==et.Schematic&&e.pbrMode!==et.Terrain&&e.pbrMode!==et.TerrainWithWater||(r.add(w`float normalDistribution(float NdotH, float roughness) +{ +float a = NdotH * roughness; +float b = roughness / (1.0 - NdotH * NdotH + a * a); +return b * b * INV_PI; +}`),r.add(w`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022); +const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040); +const vec2 c2 = vec2(-1.04, 1.04); +vec2 prefilteredDFGAnalytical(float roughness, float NdotV) { +vec4 r = roughness * c0 + c1; +float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y; +return c2 * a004 + r.zw; +}`)),e.pbrMode!==et.Normal&&e.pbrMode!==et.Schematic||(t.include(tot),r.add(w`struct PBRShadingInfo +{ +float NdotL; +float NdotV; +float NdotH; +float VdotH; +float LdotH; +float NdotNG; +float RdotNG; +float NdotAmbDir; +float NdotH_Horizon; +vec3 skyRadianceToSurface; +vec3 groundRadianceToSurface; +vec3 skyIrradianceToSurface; +vec3 groundIrradianceToSurface; +float averageAmbientRadiance; +float ssao; +vec3 albedoLinear; +vec3 f0; +vec3 f90; +vec3 diffuseColor; +float metalness; +float roughness; +};`),r.add(w`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) { +vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG); +vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness); +vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI; +vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV); +vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y; +vec3 specularComponent = specularColor * indirectSpecular; +return (diffuseComponent + specularComponent); +}`),r.add(w`float gamutMapChanel(float x, vec2 p){ +return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) ); +}`),r.add(w`vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){ +vec3 outColor; +vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance)); +outColor.x = gamutMapChanel(inColor.x, p) ; +outColor.y = gamutMapChanel(inColor.y, p) ; +outColor.z = gamutMapChanel(inColor.z, p) ; +return outColor; +}`))}function rot(t,e){const r=t.fragment.code;t.include(IP),r.add(w` + struct PBRShadingWater + { + float NdotL; // cos angle between normal and light direction + float NdotV; // cos angle between normal and view direction + float NdotH; // cos angle between normal and half vector + float VdotH; // cos angle between view direction and half vector + float LdotH; // cos angle between light direction and half vector + float VdotN; // cos angle between view direction and normal vector + }; + + float dtrExponent = ${e.useCustomDTRExponentForWater?"2.2":"2.0"}; + `),r.add(w`vec3 fresnelReflection(float angle, vec3 f0, float f90) { +return f0 + (f90 - f0) * pow(1.0 - angle, 5.0); +}`),r.add(w`float normalDistributionWater(float NdotH, float roughness) +{ +float r2 = roughness * roughness; +float NdotH2 = NdotH * NdotH; +float denom = pow((NdotH2 * (r2 - 1.0) + 1.0), dtrExponent) * PI; +return r2 / denom; +}`),r.add(w`float geometricOcclusionKelemen(float LoH) +{ +return 0.25 / (LoH * LoH); +}`),r.add(w`vec3 brdfSpecularWater(in PBRShadingWater props, float roughness, vec3 F0, float F0Max) +{ +vec3 F = fresnelReflection(props.VdotH, F0, F0Max); +float dSun = normalDistributionWater(props.NdotH, roughness); +float V = geometricOcclusionKelemen(props.LdotH); +float diffusionSunHaze = mix(roughness + 0.045, roughness + 0.385, 1.0 - props.VdotH); +float strengthSunHaze = 1.2; +float dSunHaze = normalDistributionWater(props.NdotH, diffusionSunHaze)*strengthSunHaze; +return ((dSun + dSunHaze) * V) * F; +} +vec3 tonemapACES(const vec3 x) { +return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14); +}`)}function ZCe(t,e){t.include(rot,e),t.include(Q6),t.include(qst),e.hasCloudsReflections&&t.include(bxe,e),e.hasScreenSpaceReflections&&t.include(mqe,e);const r=t.fragment;r.constants.add("fresnelSky","vec3",[.02,1,15]).add("fresnelMaterial","vec2",[.02,.1]).add("roughness","float",.015).add("foamIntensityExternal","float",1.7).add("ssrIntensity","float",.65).add("ssrHeightFadeStart","float",3e5).add("ssrHeightFadeEnd","float",5e5).add("waterDiffusion","float",.92).add("waterSeaColorMod","float",.8).add("correctionViewingPowerFactor","float",.4).add("skyZenitColor","vec3",[.52,.68,.9]).add("skyColor","vec3",[.67,.79,.9]).add("cloudFresnelModifier","vec2",[1.2,.01]),r.code.add(w`PBRShadingWater shadingInfo; +vec3 getSkyGradientColor(in float cosTheta, in vec3 horizon, in vec3 zenit) { +float exponent = pow((1.0 - cosTheta), fresnelSky[2]); +return mix(zenit, horizon, exponent); +}`),r.uniforms.add(new Ce("lightingSpecularStrength",(i,n)=>n.lighting.mainLight.specularStrength),new Ce("lightingEnvironmentStrength",(i,n)=>n.lighting.mainLight.environmentStrength)),r.code.add(w`vec3 getSeaColor(in vec3 n, in vec3 v, in vec3 l, vec3 color, in vec3 lightIntensity, in vec3 localUp, in float shadow, float foamIntensity, vec3 viewPosition, vec3 position) { +float reflectionHit = 0.0; +float reflectionHitDiffused = 0.0; +vec3 seaWaterColor = linearizeGamma(color); +vec3 h = normalize(l + v); +shadingInfo.NdotL = clamp(dot(n, l), 0.0, 1.0); +shadingInfo.NdotV = clamp(dot(n, v), 0.001, 1.0); +shadingInfo.VdotN = clamp(dot(v, n), 0.001, 1.0); +shadingInfo.NdotH = clamp(dot(n, h), 0.0, 1.0); +shadingInfo.VdotH = clamp(dot(v, h), 0.0, 1.0); +shadingInfo.LdotH = clamp(dot(l, h), 0.0, 1.0); +float upDotV = max(dot(localUp,v), 0.0); +vec3 skyHorizon = linearizeGamma(skyColor); +vec3 skyZenit = linearizeGamma(skyZenitColor); +vec3 skyColor = getSkyGradientColor(upDotV, skyHorizon, skyZenit ); +float upDotL = max(dot(localUp,l),0.0); +float daytimeMod = 0.1 + upDotL * 0.9; +skyColor *= daytimeMod; +float shadowModifier = clamp(shadow, 0.8, 1.0); +vec3 fresnelModifier = fresnelReflection(shadingInfo.VdotN, vec3(fresnelSky[0]), fresnelSky[1]); +vec3 reflSky = lightingEnvironmentStrength * fresnelModifier * skyColor * shadowModifier; +vec3 reflSea = seaWaterColor * mix(skyColor, upDotL * lightIntensity * LIGHT_NORMALIZATION, 2.0 / 3.0) * shadowModifier; +vec3 specular = vec3(0.0); +if(upDotV > 0.0 && upDotL > 0.0) { +vec3 specularSun = brdfSpecularWater(shadingInfo, roughness, vec3(fresnelMaterial[0]), fresnelMaterial[1]); +vec3 incidentLight = lightIntensity * LIGHT_NORMALIZATION * shadow; +specular = lightingSpecularStrength * shadingInfo.NdotL * incidentLight * specularSun; +} +vec3 foam = vec3(0.0); +if(upDotV > 0.0) { +foam = foamIntensity2FoamColor(foamIntensityExternal, foamIntensity, skyZenitColor, daytimeMod); +} +float correctionViewingFactor = pow(max(dot(v, localUp), 0.0), correctionViewingPowerFactor); +vec3 normalCorrectedClouds = mix(localUp, n, correctionViewingFactor); +vec3 reflectedWorld = normalize(reflect(-v, normalCorrectedClouds));`),e.hasCloudsReflections&&r.code.add(w`vec4 cloudsColor = renderClouds(reflectedWorld, position); +cloudsColor.a = 1.0 - cloudsColor.a; +cloudsColor = pow(cloudsColor, vec4(GAMMA)); +cloudsColor *= clamp(fresnelModifier.y * cloudFresnelModifier[0] - cloudFresnelModifier[1], 0.0, 1.0) * clamp((1.0 - totalFadeInOut), 0.0, 1.0);`),e.hasScreenSpaceReflections?(r.uniforms.add(new Mi("view",(i,n)=>n.ssr.camera.viewMatrix),new Ye("lastFrameColorTexture",(i,n)=>n.ssr.lastFrameColorTexture),new Ce("fadeFactorSSR",(i,n)=>n.ssr.fadeFactor)),r.code.add(w`vec3 viewDir = normalize(viewPosition); +vec4 viewNormalVectorCoordinate = view *vec4(n, 0.0); +vec3 viewNormal = normalize(viewNormalVectorCoordinate.xyz); +vec4 viewUp = view * vec4(localUp, 0.0); +vec3 viewNormalCorrectedSSR = mix(viewUp.xyz, viewNormal, correctionViewingFactor); +vec3 reflected = normalize(reflect(viewDir, viewNormalCorrectedSSR)); +vec3 hitCoordinate = screenSpaceIntersection(reflected, viewPosition, viewDir, viewUp.xyz); +vec3 reflectedColor = vec3(0.0); +if (hitCoordinate.z > 0.0) +{ +vec2 reprojectedCoordinate = reprojectionCoordinate(hitCoordinate); +vec2 dCoords = smoothstep(0.3, 0.6, abs(vec2(0.5, 0.5) - hitCoordinate.xy)); +float heightMod = smoothstep(ssrHeightFadeEnd, ssrHeightFadeStart, -viewPosition.z); +reflectionHit = clamp(1.0 - (1.3 * dCoords.y), 0.0, 1.0) * heightMod * fadeFactorSSR; +reflectionHitDiffused = waterDiffusion * reflectionHit; +reflectedColor = linearizeGamma(texture(lastFrameColorTexture, reprojectedCoordinate).xyz) * +reflectionHitDiffused * fresnelModifier.y * ssrIntensity; +} +float seaColorMod = mix(waterSeaColorMod, waterSeaColorMod * 0.5, reflectionHitDiffused); +vec3 waterRenderedColor = tonemapACES((1.0 - reflectionHitDiffused) * reflSky + reflectedColor + +reflSea * seaColorMod + specular + foam);`)):r.code.add(w`vec3 waterRenderedColor = tonemapACES(reflSky + reflSea * waterSeaColorMod + specular + foam);`),e.hasCloudsReflections?e.hasScreenSpaceReflections?r.code.add(w`return waterRenderedColor * (1.0 - (1.0 - reflectionHit) * cloudsColor.a) + (1.0 - reflectionHit) * cloudsColor.xyz; +}`):r.code.add(w`return waterRenderedColor * (1.0 - cloudsColor.a) + cloudsColor.xyz; +}`):r.code.add(w`return waterRenderedColor; +}`)}function iot(t){const e=new mr,{vertex:r,fragment:i}=e;xc(r,t),e.include(Cl,t),e.attributes.add(E.POSITION,"vec3"),e.attributes.add(E.UV0,"vec2");const n=new Jt("waterColor",s=>s.color);if(t.output===D.Color&&t.isDraped)return e.varyings.add("vpos","vec3"),r.uniforms.add(n),r.code.add(w` + void main(void) { + if (waterColor.a < ${w.float(vo)}) { + // Discard this vertex + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } + + vpos = position; + gl_Position = transformPosition(proj, view, vpos); + } + `),i.uniforms.add(n),i.code.add(w`void main() { +fragColor = waterColor; +}`),e;switch(t.output!==D.Color&&t.output!==D.Alpha||(e.include(UR,t),e.include(AE,t),e.varyings.add("vuv","vec2"),e.varyings.add("vpos","vec3"),e.varyings.add("vnormal","vec3"),e.varyings.add("vtbnMatrix","mat3"),t.hasMultipassTerrain&&e.varyings.add("depth","float"),r.uniforms.add(n),r.code.add(w` + void main(void) { + if (waterColor.a < ${w.float(vo)}) { + // Discard this vertex + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } + + vuv = uv0; + vpos = position; + + vnormal = getLocalUp(vpos, localOrigin); + vtbnMatrix = getTBNMatrix(vnormal); + + ${t.hasMultipassTerrain?"depth = (view * vec4(vpos, 1.0)).z;":""} + + gl_Position = transformPosition(proj, view, vpos); + ${t.output===D.Color?"forwardLinearDepth();":""} + } + `)),e.include(xu,t),t.output){case D.Alpha:e.include(fn,t),i.uniforms.add(n),i.code.add(w` + void main() { + discardBySlice(vpos); + ${t.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""} + + fragColor = vec4(waterColor.a); + } + `);break;case D.Color:e.include(K4),e.include(ZZ,{pbrMode:et.Disabled,lightingSphericalHarmonicsOrder:2}),e.include(Tae),e.include(fn,t),e.include(vw,t),e.include(ZCe,t),i.uniforms.add(n,new Ce("timeElapsed",s=>s.timeElapsed),r.uniforms.get("view"),r.uniforms.get("localOrigin")),fp(i,t),i.include(cm),r0(i),lm(i),i.code.add(w` + void main() { + discardBySlice(vpos); + ${t.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""} + vec3 localUp = vnormal; + // the created normal is in tangent space + vec4 tangentNormalFoam = getSurfaceNormalAndFoam(vuv, timeElapsed); + + // we rotate the normal according to the tangent-bitangent-normal-Matrix + vec3 n = normalize(vtbnMatrix * tangentNormalFoam.xyz); + vec3 v = -normalize(vpos - cameraPosition); + float shadow = ${t.receiveShadows?w`1.0 - readShadowMap(vpos, linearDepth)`:"1.0"}; + vec4 vPosView = view * vec4(vpos, 1.0); + vec4 final = vec4(getSeaColor(n, v, mainLightDirection, waterColor.rgb, mainLightIntensity, localUp, shadow, tangentNormalFoam.w, vPosView.xyz, vpos + localOrigin), waterColor.w); + + // gamma correction + fragColor = delinearizeGamma(final); + fragColor = highlightSlice(fragColor, vpos); + ${t.transparencyPassType===rt.Color?"fragColor = premultiplyAlpha(fragColor);":""} + } + `);break;case D.Normal:e.include(UR,t),e.include(Tae,t),e.include(fn,t),e.varyings.add("vpos","vec3"),e.varyings.add("vuv","vec2"),r.uniforms.add(n),r.code.add(w` + void main(void) { + if (waterColor.a < ${w.float(vo)}) { + // Discard this vertex + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } + + vuv = uv0; + vpos = position; + + gl_Position = transformPosition(proj, view, vpos); + } + `),i.uniforms.add(new Ce("timeElapsed",s=>s.timeElapsed)),i.code.add(w`void main() { +discardBySlice(vpos); +vec4 tangentNormalFoam = getSurfaceNormalAndFoam(vuv, timeElapsed); +tangentNormalFoam.xyz = normalize(tangentNormalFoam.xyz); +fragColor = vec4((tangentNormalFoam.xyz + vec3(1.0)) * 0.5, tangentNormalFoam.w); +}`);break;case D.Highlight:e.include(c0,t),e.varyings.add("vpos","vec3"),r.uniforms.add(n),r.code.add(w` + void main(void) { + if (waterColor.a < ${w.float(vo)}) { + // Discard this vertex + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } + + vpos = position; + gl_Position = transformPosition(proj, view, vpos); + } + `),e.include(fn,t),i.code.add(w`void main() { +discardBySlice(vpos); +outputHighlight(); +}`);break;case D.ObjectAndLayerIdColor:e.include(GP,t),e.varyings.add("vpos","vec3"),r.uniforms.add(n),r.code.add(w` + void main(void) { + if (waterColor.a < ${w.float(vo)}) { + // Discard this vertex + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } + + vpos = position; + gl_Position = transformPosition(proj, view, vpos); + forwardObjectAndLayerIdColor(); + } + `),e.include(fn,t),i.code.add(w`void main() { +discardBySlice(vpos); +outputObjectAndLayerIdColor(); +}`)}return e}const not=Object.freeze(Object.defineProperty({__proto__:null,build:iot},Symbol.toStringTag,{value:"Module"}));let QCe=class JCe extends Tr{initializeConfiguration(e,r){r.spherical=e.viewingMode===$e.Global,r.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result}initializeProgram(e){return new vr(e.rctx,JCe.shader.get().build(this.configuration),fr)}_setPipelineState(e){const r=this.configuration,i=e===rt.NONE,n=e===rt.FrontFace;return Ot({blending:r.output!==D.Normal&&r.output!==D.Highlight&&r.output!==D.ObjectAndLayerIdColor&&r.transparent?i?fu:u0(e):null,depthTest:{func:f1(e)},depthWrite:i?r.writeDepth?$l:null:S8(e),colorWrite:Ft,polygonOffset:i||n?null:A8(r.enableOffset)})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}};QCe.shader=new _r(not,()=>ce(()=>import("./WaterSurface.glsl-a424eae6.js"),[]));let $s=class extends Fo{constructor(){super(...arguments),this.output=D.Color,this.transparencyPassType=rt.NONE,this.spherical=!1,this.receiveShadows=!1,this.hasSlicePlane=!1,this.transparent=!1,this.enableOffset=!0,this.writeDepth=!1,this.hasScreenSpaceReflections=!1,this.doublePrecisionRequiresObfuscation=!1,this.hasCloudsReflections=!1,this.objectAndLayerIdColorInstanced=!1,this.isDraped=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1}};h([U({count:D.COUNT})],$s.prototype,"output",void 0),h([U({count:rt.COUNT})],$s.prototype,"transparencyPassType",void 0),h([U()],$s.prototype,"spherical",void 0),h([U()],$s.prototype,"receiveShadows",void 0),h([U()],$s.prototype,"hasSlicePlane",void 0),h([U()],$s.prototype,"transparent",void 0),h([U()],$s.prototype,"enableOffset",void 0),h([U()],$s.prototype,"writeDepth",void 0),h([U()],$s.prototype,"hasScreenSpaceReflections",void 0),h([U()],$s.prototype,"doublePrecisionRequiresObfuscation",void 0),h([U()],$s.prototype,"hasCloudsReflections",void 0),h([U()],$s.prototype,"objectAndLayerIdColorInstanced",void 0),h([U()],$s.prototype,"isDraped",void 0),h([U()],$s.prototype,"hasMultipassTerrain",void 0),h([U()],$s.prototype,"cullAboveGround",void 0),h([U({constValue:et.Water})],$s.prototype,"pbrMode",void 0),h([U({constValue:!0})],$s.prototype,"useCustomDTRExponentForWater",void 0),h([U({constValue:!0})],$s.prototype,"highStepCount",void 0),h([U({constValue:!1})],$s.prototype,"useFillLights",void 0);let sot=class extends h1{_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.receiveShadows&&this._material.setParameters({receiveShadows:e.shadowMap.enabled})}_updateSSRState(e){e.ssr.enabled!==this._material.parameters.hasScreenSpaceReflections&&this._material.setParameters({hasScreenSpaceReflections:e.ssr.enabled})}_updateCloudsReflectionState(e){const r=e.cloudsFade.data!=null;r!==this._material.parameters.hasCloudsReflections&&this._material.setParameters({hasCloudsReflections:r})}ensureResources(e){return this._techniqueRepository.constructionContext.waterTextureRepository.ensureResources(e)}beginSlot(e){return this._output===D.Color&&(this._updateShadowState(e),this._updateSSRState(e),this._updateCloudsReflectionState(e)),this._material.setParameters(this._techniqueRepository.constructionContext.waterTextureRepository.passParameters),this.ensureTechnique(QCe,e)}},KCe=class extends IJ{constructor(e){super(e,new e3e),this._configuration=new $s,this.animation=new A2e}getConfiguration(e,r){return this._configuration.output=e,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.receiveShadows=this.parameters.receiveShadows,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.hasScreenSpaceReflections=this.parameters.hasScreenSpaceReflections,this._configuration.hasCloudsReflections=this.parameters.hasCloudsReflections,this._configuration.isDraped=this.parameters.isDraped,this._configuration.transparencyPassType=r.transparencyPassType,this._configuration.enableOffset=r.camera.relativeElevatione.set(i.from,i));let r=!0;for(;r;)r=!1,t.forEach(i=>{const n=e.get(i.to);n&&(i.to=n.to,e.delete(n.from),t.removeUnordered(n),r=!0)})}let Eae=class extends NJ{constructor(e,r,i){super(r,i),this.geometry=e}get isVisible(){return this.geometry.visible}get hasHighlights(){return this.geometry.highlights!=null&&this.isVisible}get hasOccludees(){return this.geometry.occludees!=null}},aot=class{constructor(){this.first=0,this.count=0}},lot=class{constructor(){this._numElements=0,this._instances=new Map,this.holes=new Nt({allocator:e=>e||new NJ,deallocator:null}),this.hasHiddenInstances=!1,this.hasHighlights=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.drawCommandsDefault=dI(),this.drawCommandsHighlight=dI(),this.drawCommandsOccludees=dI(),this.drawCommandsShadowHighlightRest=dI()}get numElements(){return this._numElements}get instances(){return this._instances}addInstance(e,r){this.deleteInstance(e),this._instances.set(e,r),this._numElements+=r.numElements}deleteInstance(e){const r=this._instances.get(e);r&&(this._numElements-=r.numElements,this._instances.delete(e))}updateInstance(e,r,i){const n=this._instances.get(e);n&&(this._numElements-=n.numElements,n.from=r,n.to=i,this._numElements+=n.numElements)}updateDrawState(e){e.isVisible?(e.hasHighlights&&(this.hasHighlights=!0),e.hasOccludees&&(this.hasOccludees=!0)):this.hasHiddenInstances=!0}updateDrawCommands(e){if(this.drawCommandsDefault.clear(),this.drawCommandsHighlight.clear(),this.drawCommandsOccludees.clear(),this.drawCommandsShadowHighlightRest.clear(),this.drawCommandsDirty=!1,this._instances.size===0)return;if(!this.needsMultipleCommands()){const i=this.drawCommandsDefault.pushNew(),n=this.holes.front();return this.vao!=null&&this.holes.length===1&&n.to===Math.floor(this.vao.byteSize/e)?(i.first=0,void(i.count=n.from)):(i.first=1/0,i.count=0,this._instances.forEach(s=>{i.first=Math.min(i.first,s.from),i.count=Math.max(i.count,s.to)}),void(i.count-=i.first))}const r=Array.from(this._instances.values()).sort((i,n)=>i.from===n.from?i.to-n.to:i.from-n.from);for(const i of r)i.isVisible&&(Cae(i.hasOccludees?this.drawCommandsOccludees:this.drawCommandsDefault,i),Cae(i.hasHighlights?this.drawCommandsHighlight:this.drawCommandsShadowHighlightRest,i))}needsMultipleCommands(){return this.hasOccludees||this.hasHighlights||this.hasHiddenInstances}};function cot(t){return t.vao!=null}function dI(){return new Nt({allocator:t=>t||new aot,deallocator:t=>t})}function Cae(t,e){const r=t.back();if(r==null){const i=t.pushNew();return i.first=e.from,void(i.count=e.numElements)}if(uot(r,e)){const i=e.from-r.first+e.numElements;r.count=i}else{const i=t.pushNew();i.first=e.from,i.count=e.numElements}}function uot(t,e){return t.first+t.count>=e.from}let hot=class{constructor(e){this.origin=e,this.buffers=new Array}dispose(){this.buffers.forEach(e=>e.vao.dispose()),this.buffers.length=0}findBuffer(e){return this.buffers.find(r=>r.instances.has(e))}};const XD=-3;var og;(function(t){t[t.ALL=0]="ALL",t[t.SOME=1]="SOME"})(og||(og={}));let dot=class{constructor(e,r,i){this.name=e,this._storage=r,this.id=pot+++":",this.size=0,this.maxSize=0,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),i&&(this._storage.registerRemoveFunc(this.id,i),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get sizeAll(){return this._storage.size}resetHitRate(){this._hit=this._miss=0}put(e,r,i,n=0){this._storage.put(this,e,r,i,n)}get(e){const r=this._storage.get(this,e);return r===void 0?++this._miss:++this._hit,r}pop(e){const r=this._storage.pop(this,e);return r===void 0?++this._miss:++this._hit,r}updateSize(e,r,i){this._storage.updateSize(this,e,r,i)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}},t3e=class{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new Nt,this._users=new Nt}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,r){this._removeFuncs.push([e,r])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace(r=>r[0]!==e)}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,0),this._checkSizeLimits()}put(e,r,i,n,s){r=e.id+r;const o=this._db.get(r);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(r),o.entry!==i&&this._notifyRemove(r,o.entry,og.ALL)),n>this._maxSize)return void this._notifyRemove(r,i,og.ALL);if(i===void 0)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return void console.warn("Refusing to cache entry with invalid size "+n);const a=1+Math.max(s,XD)-XD;this._db.set(r,{entry:i,size:n,lifetime:a,lives:a}),this._size+=n,e.size+=n,this._checkSizeLimits()}updateSize(e,r,i,n){r=e.id+r;const s=this._db.get(r);if(s&&s.entry===i){for(this._size-=s.size,e.size-=s.size;n>this._maxSize;){const o=this._notifyRemove(r,i,og.SOME);if(!(o!=null&&o>0))return void this._db.delete(r);n=o}s.size=n,this._size+=n,e.size+=n,this._checkSizeLimits()}}pop(e,r){r=e.id+r;const i=this._db.get(r);if(i)return this._size-=i.size,e.size-=i.size,this._db.delete(r),++this._hit,i.entry;++this._miss}get(e,r){r=e.id+r;const i=this._db.get(r);if(i!==void 0)return this._db.delete(r),i.lives=i.lifetime,this._db.set(r,i),++this._hit,i.entry;++this._miss}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},r={},i=new Array;this._db.forEach((o,a)=>{const l=o.lifetime;i[l]=(i[l]||0)+o.size,this._users.forAll(c=>{const{id:u,name:d}=c;if(a.startsWith(u)){const p=r[d]||0;r[d]=p+o.size}})});const n={};this._users.forAll(o=>{const a=o.name;if("hitRate"in o&&typeof o.hitRate=="number"&&!isNaN(o.hitRate)&&o.hitRate>0){const l=r[a]||0;r[a]=l,n[a]=Math.round(100*o.hitRate)+"%"}else n[a]="0%"});const s=Object.keys(r);s.sort((o,a)=>r[a]-r[o]),s.forEach(o=>e[o]=Math.round(r[o]/2**20)+"MB / "+n[o]);for(let o=i.length-1;o>=0;--o){const a=i[o];a&&(e["Priority "+(o+XD-1)]=Math.round(a/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll(e=>e.resetHitRate())}clear(e){const r=e.id;this._db.forEach((i,n)=>{n.startsWith(r)&&(this._size-=i.size,this._db.delete(n),this._notifyRemove(n,i.entry,og.ALL))}),e.size=0}clearAll(){this._db.forEach((e,r)=>this._notifyRemove(r,e.entry,og.ALL)),this._users.forEach(e=>e.size=0),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,r,i){let n;return this._removeFuncs.some(s=>{if(e.startsWith(s[0])){const o=s[1](r,i);return typeof o=="number"&&(n=o),!0}return!1}),n}_checkSizeLimits(){if(this._size>this._maxSize){for(const[e,r]of this._db)if(this._purgeItem(e,r),this._size<=.9*this.maxSize)return}this._users.forEach(e=>{if(e.maxSize>0&&e.size>e.maxSize){for(const[r,i]of this._db)if(r.startsWith(e.id)&&(this._purgeItem(r,i,e),e.size<=.9*e.maxSize))return}})}_purgeItem(e,r,i=this._users.find(n=>e.startsWith(n.id))){if(this._db.delete(e),r.lives<=1){this._size-=r.size,i&&(i.size-=r.size);const n=this._notifyRemove(e,r.entry,og.SOME);n!=null&&n>0&&(this._size+=n,i&&(i.size+=n),r.lives=r.lifetime,r.size=n,this._db.set(e,r))}else--r.lives,this._db.set(e,r)}},pot=0;const fot=XD+1;let mot=class{constructor(e,r,i){this._rctx=e,this._locations=r,this._layout=i,this._cache=e.newCache("VaoCache",got)}dispose(){this._cache.destroy()}newVao(e){const r=e.toString(),i=this._cache.pop(r);if(i!=null){const s=i.pop();return i.length>0&&this._cache.put(r,i,e*i.length,fot),s}const n=new vp(this._rctx,this._locations,{geometry:this._layout},{geometry:Ar.createVertex(this._rctx,gr.STATIC_DRAW)});return n.vertexBuffers.geometry.setSize(e),n}deleteVao(e){if(e==null)return null;const r=e.byteSize,i=r.toString(),n=this._cache.pop(i);return n!=null?(n.push(e),this._cache.put(i,n,r*n.length,-1)):this._cache.put(i,[e],r,-1),null}};function got(t,e){if(e===og.ALL)return void t.forEach(n=>n.dispose());const r=t.pop(),i=t.length*r.byteSize;return r.dispose(),i}let r3e=class{constructor(e,r,i){this._rctx=e,this._materialRepository=r,this.material=i,this._dataByOrigin=new Map,this._hasHighlights=!1,this._hasOccludees=!1,this._glMaterials=new WCe(this.material,this._materialRepository),this._bufferWriter=i.createBufferWriter(),this._vaoCache=new mot(e,i.vertexAttributeLocations,Mc(this._bufferWriter.vertexBufferLayout))}dispose(){this._glMaterials.destroy(),this._dataByOrigin.forEach(e=>e.dispose()),this._dataByOrigin.clear(),this._vaoCache.dispose()}get isEmpty(){return this._dataByOrigin.size===0}get hasHighlights(){return this._hasHighlights}get hasOccludees(){return this._hasOccludees}get hasWater(){return!this.isEmpty&&this.material instanceof KCe}get rendersOccluded(){return!this.isEmpty&&this.material.renderOccluded!==Ri.Occlude}get numGeometries(){let e=0;return this._dataByOrigin.forEach(r=>e+=r.buffers.reduce((i,n)=>i+n.instances.size,0)),e}forEachGeometry(e){this._dataByOrigin.forEach(r=>r.buffers.forEach(i=>i.instances.forEach(n=>e(n.geometry))))}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateDrawCommands()}_updateGeometries(e){const r=this._bufferWriter,i=r.vertexBufferLayout.stride/4;for(const n of e){const s=n.renderGeometry,o=this._dataByOrigin.get(s.localOrigin.id),a=o==null?void 0:o.findBuffer(s.id);if(a==null)return;const l=a.instances.get(s.id);if(n.updateType&(bs.GEOMETRY|bs.TRANSFORMATION)){const c=gI(r.elementCount(l.geometry.geometry)*i),u=r.vertexBufferLayout.createView(c.buffer);this._writeGeometry(s,u,0),a.vao.vertexBuffers.geometry.setSubData(c,l.from*i,0,l.numElements*i),yI()}n.updateType&(bs.HIGHLIGHT|bs.OCCLUDEE|bs.VISIBILITY)&&(a.drawCommandsDirty=!0)}}_computeDeltas(e,r){const i=new RE;for(const n of e){const s=n.localOrigin;if(s==null)continue;let o=i.get(s.id,null);o==null&&(o=new Aae(s.vec3),i.set(s.id,null,o)),o.changes.push(n)}for(const n of r){const s=n.localOrigin;if(s==null)continue;const o=this._dataByOrigin.get(s.id),a=o==null?void 0:o.findBuffer(n.id);if(a==null)continue;let l=i.get(s.id,a);l==null&&(l=new Aae(s.vec3),i.set(s.id,a,l)),l.changes.push(n)}return i}_addAndRemoveGeometries(e,r){const{_bufferWriter:i,_dataByOrigin:n}=this,s=i.vertexBufferLayout.stride/4,o=this._computeDeltas(e,r);o.forEach((a,l)=>{const c=a.get(null),u=c!=null?c.changes:[];o.delete(l,null);let d=n.get(l);if(a.forEach((p,m)=>{if(o.delete(l,m),m==null)return void Je(!1,"No VAO for removed geometries");if(m.instances.size===p.changes.length)return this._vaoCache.deleteVao(m.vao),qO(d.buffers,m),void(d.buffers.length===0&&u.length===0&&n.delete(l));const y=m.numElements,_=m.vao.byteSize/4,v=u.reduce((S,A)=>S+i.elementCount(A.geometry),0),b=p.changes.reduce((S,A)=>S+i.elementCount(A.geometry),0),x=Math.min((y+v-b)*s,mI),T=x>_;x>z5&&x<_/2?(p.changes.forEach(({id:S})=>m.deleteInstance(S)),m.instances.forEach(({geometry:S})=>u.push(S)),this._vaoCache.deleteVao(m.vao),qO(d.buffers,m)):T?this._applyAndRebuild(m,u,p):this._applyRemoves(m,p)}),u.length>0)for(d==null&&(d=new hot(c.origin),n.set(l,d)),d.buffers.forEach(p=>this._applyAdds(p,u));u.length>0;)d.buffers.push(this._applyAndRebuild(new lot,u,null))})}_updateDrawCommands(){this._hasHighlights=!1,this._hasOccludees=!1,this._dataByOrigin.forEach(e=>{e.buffers.forEach(r=>{r.drawCommandsDirty&&(r.hasHiddenInstances=!1,r.hasHighlights=!1,r.hasOccludees=!1,Do(r.instances,i=>(r.updateDrawState(i),r.hasHiddenInstances&&r.hasHighlights&&r.hasOccludees)),r.updateDrawCommands(this._bufferWriter.vertexBufferLayout.stride)),this._hasHighlights=this._hasHighlights||r.hasHighlights,this._hasOccludees=this._hasOccludees||r.hasOccludees})})}_applyAndRebuild(e,r,i){if(i!=null)for(const y of i.changes)e.deleteInstance(y.id);const n=this._bufferWriter,s=n.vertexBufferLayout.stride,o=s/4,a=Math.floor(mI/o);let l=e.numElements;for(;r.length>0;){const y=r.pop(),_=n.elementCount(y.geometry);if(l+_>a&&l>0){r.push(y);break}l+=_;const v=new Eae(y,0,0);Je(e.instances.get(y.id)==null),e.addInstance(y.id,v)}const c=l*o,u=gI(c),d=n.vertexBufferLayout.createView(u.buffer);let p=0;e.hasHiddenInstances=!1,e.hasHighlights=!1,e.hasOccludees=!1,e.instances.forEach((y,_)=>{this._writeGeometry(y.geometry,d,p);const v=p;p+=n.elementCount(y.geometry.geometry),e.updateInstance(_,v,p),e.updateDrawState(y)}),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(Pae(c)),e.vao.vertexBuffers.geometry.setSubData(u,0,0,p*o),yI(),e.holes.clear();const m=e.holes.pushNew();return m.from=p,m.to=Math.floor(e.vao.byteSize/s),e.updateDrawCommands(s),e}_applyRemoves(e,r){if(r.changes.length===0)return;for(const a of r.changes){const l=a.id,c=e.instances.get(l);if(!c)continue;e.deleteInstance(l);const u=Lp.back();if(u){if(u.to===c.from){u.to=c.to;continue}if(u.from===c.to){u.from=c.from;continue}}const d=Lp.pushNew();d.from=c.from,d.to=c.to}Sae(Lp);const i=this._bufferWriter.vertexBufferLayout.stride/4,n=Lp.reduce((a,l)=>Math.max(a,l.numElements),0)*i,s=gI(n);s.fill(0,0,n);const o=e.vao.vertexBuffers.geometry;Lp.forAll(a=>o.setSubData(s,a.from*i,0,a.numElements*i)),yI(),e.holes.pushArray(Lp.data,Lp.length),Lp.forAll((a,l)=>Lp.data[l]=null),Lp.clear(),e.drawCommandsDirty=!0}_applyAdds(e,r){if(r.length===0)return;if(!cot(e))return void this._applyAndRebuild(e,r,null);const i=this._bufferWriter,n=i.vertexBufferLayout.stride/4,s=e.numElements,o=r.reduce((b,x)=>b+i.elementCount(x.geometry),0),a=Math.min((s+o)*n,mI),l=4*a;if(e.vao.byteSizee.vao.byteSize)return void this._applyAndRebuild(e,r,null);Sae(e.holes);const c=new Array;for(const b of r){const x=i.elementCount(b.geometry),T=yot(e.holes,x);c.push(T)}const u=e.vao.vertexBuffers.geometry;let d=0,p=0,m=0;const y=gI(a),_=i.vertexBufferLayout.createView(y.buffer);r.forEach((b,x)=>{const T=c[x];if(T==null)return;if(m!==T){const C=m-p;C>0&&u.setSubData(y,p*n,0,C*n),p=T,d=0}const S=i.elementCount(b.geometry);this._writeGeometry(b,_,d),d+=S,m=T+S;const A=new Eae(b,T,T+S);Je(e.instances.get(b.id)==null),e.addInstance(b.id,A),e.drawCommandsDirty=!0});const v=m-p;v>0&&u.setSubData(y,p*n,0,v*n),pDe(r,(b,x)=>c[x]==null),yI()}_writeGeometry(e,r,i){const n=e.localOrigin.vec3;$He(Oae,-n[0],-n[1],-n[2]);const s=Vr(_ot,Oae,e.transformation);us(pI,s),Sc(pI,pI),this._bufferWriter.write(s,pI,e.geometry,r,i)}updateAnimation(e){return this.material.update(e)}requiresSlot(e,r){return this.material.requiresSlot(e,r)}prepareTechnique(e){const{output:r,bindParameters:i}=e;if(!this.requiresSlot(i.slot,r))return null;const n=r===D.Highlight||r===D.ShadowHighlight;if(n&&!this._hasHighlights)return null;const s=r===D.ShadowExcludeHighlight,o=!(n||s);for(const a of this._dataByOrigin.values())for(const l of a.buffers){if(n&&!l.hasHighlights)continue;const c=(n?l.drawCommandsHighlight:s&&l.needsMultipleCommands()?l.drawCommandsShadowHighlightRest:l.drawCommandsDefault)||null,u=o&&l.drawCommandsOccludees||null;if(c!=null&&c.length||u!=null&&u.length){const d=this._glMaterials.load(e.rctx,i.slot,r),p=d!=null?d.beginSlot(i):null;if(p!=null)return p}}return null}render(e,r){var c;const{output:i,bindParameters:n}=e,s=i===D.Highlight||i===D.ShadowHighlight,o=i===D.ShadowExcludeHighlight,a=!(s||o),l=this._rctx;(c=l.appleAmdDriverHelper)==null||c.resetIndicesType(),l.bindTechnique(r,this.material.parameters,n);for(const u of this._dataByOrigin.values())for(const d of u.buffers){if(s&&!d.hasHighlights)continue;const p=(s?d.drawCommandsHighlight:o&&d.needsMultipleCommands()?d.drawCommandsShadowHighlightRest:d.drawCommandsDefault)||null,m=a&&d.drawCommandsOccludees||null;(p!=null&&p.length||m!=null&&m.length)&&(r.program.bindDraw(new eW(u.origin),n,this.material.parameters),r.ensureAttributeLocations(d.vao),l.bindVAO(d.vao),p!=null&&p.length&&(r.bindPipelineState(l,n.slot,!1),p.forAll(y=>l.drawArrays(r.primitiveType,y.first,y.count))),m!=null&&m.length&&(r.bindPipelineState(l,n.slot,!0),m.forAll(y=>l.drawArrays(r.primitiveType,y.first,y.count))))}}get test(){return{material:this.material,glMaterials:this._glMaterials,dataByOrigin:this._dataByOrigin}}},Aae=class{constructor(e){this.origin=e,this.changes=new Array}};function yot(t,e){let r;if(!t.some(n=>!(n.numElements=r.to&&t.removeUnordered(r),i}const Oae=_e(),_ot=_e(),pI=_e(),Lp=new Nt({allocator:t=>t||new NJ,deallocator:null}),z5=65536,fI=4*z5,Rae=1024,i3e=16777216,mI=i3e/4;let YD=new Float32Array(z5);function gI(t){return YD.lengthe.dispose()),this._materialRenderers.clear(),this._sortedMaterialRenderers.clear(),this._geometries.clear(),this._pending.clear()}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _materialRepository(){return this.rendererContext.materialRepository}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}get hasWater(){return this._hasWater}get rendersOccluded(){return Do(this._materialRenderers,e=>e.rendersOccluded)}get isEmpty(){return!this.updating&&this._materialRenderers.size===0&&this._geometries.size===0}commitChanges(){if(!this.updating)return!1;this._processAddsRemoves();const e=HCe(this._changes);let r=!1,i=!1,n=!1;return e.forEach((s,o)=>{let a=this._materialRenderers.get(o);if(!a&&s.adds.length>0&&(a=new r3e(this.rctx,this._materialRepository,o),this._materialRenderers.set(o,a),r=!0,i=!0,n=!0),!a)return;const l=i||a.hasHighlights,c=n||a.hasWater;a.modify(s),i=i||l!==a.hasHighlights,n=n||c!==a.hasWater,a.isEmpty&&(this._materialRenderers.delete(o),a.dispose(),r=!0)}),this._changes.clear(),r&&this._updateSortedMaterialRenderers(),i&&(this._hasHighlights=Do(this._materialRenderers,s=>s.hasHighlights)),n&&(this._hasWater=Do(this._materialRenderers,s=>s.hasWater)),this.notifyChange("updating"),!0}addGeometries(e,r){if(e.length===0)return;const i=this._validateRenderGeometries(e);for(const s of i)this._geometries.set(s.id,s);const n=this._pending.empty;for(const s of i)this._pending.adds.add(s);n&&this.notifyChange("updating"),r===Hi.UPDATE&&this._notifyGraphicGeometryChanged(e)}removeGeometries(e,r){const i=this._pending.empty,n=this._pending.adds;for(const s of e)n.has(s)?(this._pending.removed.add(s),n.delete(s)):this._pending.removed.has(s)||this._pending.removes.add(s),this._geometries.delete(s.id);i&&!this._pending.empty&&this.notifyChange("updating"),r===Hi.UPDATE&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const i=this._changes.updates.length===0;for(const n of e){const s=this._changes.updates.pushNew();s.renderGeometry=this._validateRenderGeometry(n),s.updateType=r}switch(i&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case bs.TRANSFORMATION:case bs.GEOMETRY:return this._notifyGraphicGeometryChanged(e);case bs.VISIBILITY:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedMaterialRenderers.forAll(i=>r=i.updateAnimation(e)||r),r}render(e){this._sortedMaterialRenderers.forAll(r=>{if(r.material.shouldRender(e)){const i=r.prepareTechnique(e);i!=null&&r.render(e,i)}})}intersect(e,r,i,n,s){return this._geometries.forEach(o=>{if(n&&!n(o))return;this._intersectRenderGeometry(o,i,r,0,e,s);const a=this.rendererContext.longitudeCyclical;a&&(o.boundingSphere[0]-o.boundingSphere[3]a.max&&this._intersectRenderGeometry(o,i,r,-a.range,e,s)),s++}),s}_updateSortedMaterialRenderers(){this._sortedMaterialRenderers.clear();let e=0;this._materialRenderers.forEach((r,i)=>{i.insertOrder=e++,this._sortedMaterialRenderers.push(r)}),this._sortedMaterialRenderers.sort((r,i)=>{const n=i.material.renderPriority-r.material.renderPriority;return n!==0?n:r.material.insertOrder-i.material.insertOrder})}_processAddsRemoves(){this._changes.adds.clear(),this._changes.removes.clear(),this._changes.adds.pushArray(Array.from(this._pending.adds)),this._changes.removes.pushArray(Array.from(this._pending.removes));for(let e=0;e{bot(r,u,e.material.renderPriority,o,s,e.layerUid,e.graphicUid)},r)}_notifyGraphicGeometryChanged(e){if(this.drapeSource.notifyGraphicGeometryChanged==null)return;let r;for(const i of e){const n=i.graphicUid;n!=null&&n!==r&&(this.drapeSource.notifyGraphicGeometryChanged(n),r=n)}}_notifyGraphicVisibilityChanged(e){if(this.drapeSource.notifyGraphicVisibilityChanged==null)return;let r;for(const i of e){const n=i.graphicUid;n!=null&&n!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(n),r=n)}}_validateRenderGeometries(e){for(const r of e)this._validateRenderGeometry(r);return e}_validateRenderGeometry(e){return e.localOrigin==null&&(e.localOrigin=this._localOriginFactory.getOrigin(e.boundingSphere)),e}get test(){return{sortedMaterialRenderers:this._sortedMaterialRenderers}}};h([f()],Hc.prototype,"drapeSource",void 0),h([f()],Hc.prototype,"updating",null),h([f()],Hc.prototype,"rctx",null),h([f()],Hc.prototype,"rendererContext",void 0),h([f()],Hc.prototype,"_materialRepository",null),h([f()],Hc.prototype,"_localOriginFactory",null),h([f({readOnly:!0})],Hc.prototype,"isEmpty",null),h([f()],Hc.prototype,"_materialRenderers",void 0),h([f()],Hc.prototype,"_geometries",void 0),Hc=h([N("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],Hc);let vot=class{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return this.adds.size===0&&this.removes.size===0&&this.removed.size===0}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}};function bot(t,e,r,i,n,s,o){const a=new kst(s,o,e),l=c=>{c.set(Ui.OVERLAY,a,t.dist,t.normal,t.transformation,r,i)};if((n.results.min.drapedLayerOrder==null||r>=n.results.min.drapedLayerOrder)&&(n.results.min.dist==null||n.results.ground.dist<=n.results.min.dist)&&l(n.results.min),n.options.store!==To.MIN&&(n.results.max.drapedLayerOrder==null||rn.results.max.dist)&&l(n.results.max),n.options.store===To.ALL){const c=SQ(n.ray);l(c),n.results.all.push(c)}}const J9=Ne();let FJ=class extends ln{constructor(e,r){super(e,"vec2",jr.Draw,(i,n,s,o)=>i.setUniform2fv(e,r(n,s,o)))}};const K9=4;function wot(){const t=new mr,e=t.fragment;t.include(Vh);const r=(K9+1)/2,i=1/(2*r*r);return e.include(wu),e.uniforms.add(new Ye("depthMap",n=>n.depthTexture),new Eh("tex",n=>n.colorTexture),new FJ("blurSize",n=>n.blurSize),new Ce("projScale",(n,s)=>{const o=ci(s.camera.eye,s.camera.center);return o>5e4?Math.max(0,n.projScale-(o-5e4)):n.projScale}),new yr("nearFar",(n,s)=>s.camera.nearFar)),e.code.add(w` + void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) { + float c = texture(tex, uv).r; + float d = linearDepthFromTexture(depthMap, uv, nearFar); + + float ddiff = d - center_d; + + float w = exp(-r * r * ${w.float(i)} - ddiff * ddiff * sharpness); + wTotal += w; + bTotal += w * c; + } + `),e.code.add(w` + void main(void) { + float b = 0.0; + float w_total = 0.0; + + float center_d = linearDepthFromTexture(depthMap, uv, nearFar); + + float sharpness = -0.05 * projScale / center_d; + for (int r = -${w.int(K9)}; r <= ${w.int(K9)}; ++r) { + float rf = float(r); + vec2 uvOffset = uv + rf * blurSize; + blurFunction(uvOffset, rf, center_d, sharpness, w_total, b); + } + + fragColor = vec4(b / w_total); + } + `),t}const xot=Object.freeze(Object.defineProperty({__proto__:null,build:wot},Symbol.toStringTag,{value:"Module"}));let n3e=class s3e extends Tr{initializeProgram(e){return new vr(e.rctx,s3e.shader.get().build(),fr)}initializePipeline(){return Ot({colorWrite:Ft})}};n3e.shader=new _r(xot,()=>ce(()=>import("./SSAOBlur.glsl-1cf88496.js"),[]));const Tot="eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM";function k8(t){t.fragment.uniforms.add(new Jt("projInfo",(e,r)=>Sot(r))),t.fragment.uniforms.add(new yr("zScale",(e,r)=>o3e(r))),t.fragment.code.add(w`vec3 reconstructPosition(vec2 fragCoord, float depth) { +return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth); +}`)}function Sot(t){const e=t.camera.projectionMatrix;return e[11]===0?gi(Mae,2/(t.camera.fullWidth*e[0]),2/(t.camera.fullHeight*e[5]),(1+e[12])/e[0],(1+e[13])/e[5]):gi(Mae,-2/(t.camera.fullWidth*e[0]),-2/(t.camera.fullHeight*e[5]),(1-e[8])/e[0],(1-e[9])/e[5])}const Mae=Qt();function o3e(t){return t.camera.projectionMatrix[11]===0?er($ae,0,1):er($ae,1,0)}const $ae=Ne(),Iae=16;function Eot(){const t=new mr,e=t.fragment;return t.include(Vh),e.include(wu),t.include(k8),e.uniforms.add(new Ce("radius",(r,i)=>UJ(i.camera))),e.code.add(w`vec3 sphere[16]; +void fillSphere() { +sphere[0] = vec3(0.186937, 0.0, 0.0); +sphere[1] = vec3(0.700542, 0.0, 0.0); +sphere[2] = vec3(-0.864858, -0.481795, -0.111713); +sphere[3] = vec3(-0.624773, 0.102853, -0.730153); +sphere[4] = vec3(-0.387172, 0.260319, 0.007229); +sphere[5] = vec3(-0.222367, -0.642631, -0.707697); +sphere[6] = vec3(-0.01336, -0.014956, 0.169662); +sphere[7] = vec3(0.122575, 0.1544, -0.456944); +sphere[8] = vec3(-0.177141, 0.85997, -0.42346); +sphere[9] = vec3(-0.131631, 0.814545, 0.524355); +sphere[10] = vec3(-0.779469, 0.007991, 0.624833); +sphere[11] = vec3(0.308092, 0.209288,0.35969); +sphere[12] = vec3(0.359331, -0.184533, -0.377458); +sphere[13] = vec3(0.192633, -0.482999, -0.065284); +sphere[14] = vec3(0.233538, 0.293706, -0.055139); +sphere[15] = vec3(0.417709, -0.386701, 0.442449); +} +float fallOffFunction(float vv, float vn, float bias) { +float f = max(radius * radius - vv, 0.0); +return f * f * f * max(vn - bias, 0.0); +}`),e.code.add(w`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) { +vec3 v = Q - C; +float vv = dot(v, v); +float vn = dot(normalize(v), n_C); +return fallOffFunction(vv, vn, 0.1); +}`),e.uniforms.add(new yr("nearFar",(r,i)=>i.camera.nearFar),new Ye("normalMap",r=>r.normalTexture),new Ye("depthMap",r=>r.depthTexture),new yr("zScale",(r,i)=>o3e(i)),new Ce("projScale",r=>r.projScale),new Ye("rnm",r=>r.noiseTexture),new yr("rnmScale",(r,i)=>er(Lae,i.camera.fullWidth/r.noiseTexture.descriptor.width,i.camera.fullHeight/r.noiseTexture.descriptor.height)),new Ce("intensity",r=>r.intensity),new yr("screenSize",(r,i)=>er(Lae,i.camera.fullWidth,i.camera.fullHeight))),e.code.add(w` + void main(void) { + fillSphere(); + vec3 fres = normalize(2.0 * texture(rnm, uv * rnmScale).xyz - 1.0); + float currentPixelDepth = linearDepthFromTexture(depthMap, uv, nearFar); + + if (-currentPixelDepth>nearFar.y || -currentPixelDepth screenSize.x || tc.y > screenSize.y) continue; + vec2 tcTap = tc / screenSize; + float occluderFragmentDepth = linearDepthFromTexture(depthMap, tcTap, nearFar); + + if (isTerrain) { + if (texture(normalMap, tcTap).w < 0.5) { + continue; + } + } + + tapPixelPos = reconstructPosition(tc, occluderFragmentDepth); + + sum+= aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos); + } + + // output the result + float A = max(1.0 - sum * intensity / float(${w.int(Iae)}), 0.0); + + // Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2 + A = (pow(A, 0.2) + 1.2 * A*A*A*A) / 2.2; + fragColor = vec4(A); + } + `),t}function UJ(t){return Math.max(10,20*t.computeScreenPixelSizeAtDist(Math.abs(4*t.relativeElevation)))}const Lae=Ne(),Cot=Object.freeze(Object.defineProperty({__proto__:null,build:Eot,getRadius:UJ},Symbol.toStringTag,{value:"Module"}));let a3e=class l3e extends Tr{initializeProgram(e){return new vr(e.rctx,l3e.shader.get().build(),fr)}initializePipeline(){return Ot({colorWrite:Ft})}};a3e.shader=new _r(Cot,()=>ce(()=>import("./SSAO.glsl-8e275b51.js"),[]));let Aot=class extends Wr{constructor(){super(...arguments),this.projScale=1}},Oot=class extends Aot{constructor(){super(...arguments),this.intensity=1}},Rot=class extends Wr{},Pot=class extends Rot{constructor(){super(...arguments),this.blurSize=Ne()}};const sA=2;let c3e=class{constructor(e,r,i,n){this._view=e,this._techniqueRepository=r,this._rctx=i,this._requestRender=n,this._quadVAO=null,this._passParameters=new Oot,this._drawParameters=new Pot}dispose(){this.enabled=!1,this._quadVAO=Le(this._quadVAO)}destroy(){this.dispose()}disposeOffscreenBuffers(){var e,r;(e=this._ssaoFBO)==null||e.resize(0,0),(r=this._blurFBO)==null||r.resize(0,0)}set enabled(e){e?this._enable():this._disable()}get enabled(){return this._enableTime!=null}get active(){return this.enabled&&this._ssaoTechnique.compiled&&this._blurTechnique.compiled}get colorTexture(){var e;return(e=this._ssaoFBO)==null?void 0:e.colorTexture}render(e,r,i,n){if(this._enableTime==null||i==null||n==null||this._ssaoFBO==null||this._blurFBO==null)return;if(!this.active)return this._enableTime=r,void this._requestRender();this._enableTime===0&&(this._enableTime=r);const s=this._rctx,o=e.camera,a=this._view.qualitySettings.fadeDuration,l=a>0?Math.min(a,r-this._enableTime)/a:1;this._passParameters.normalTexture=n,this._passParameters.depthTexture=i,this._passParameters.projScale=1/o.computeRenderPixelSizeAtDist(1),this._passParameters.intensity=4*Mot/UJ(o)**6*l;const c=o.fullViewport,u=c[2],d=c[3],p=u/sA,m=d/sA;this._ssaoFBO.resize(u,d),this._blurFBO.resize(p,m),this._quadVAO==null&&(this._quadVAO=Dl(this._rctx)),s.bindFramebuffer(this._ssaoFBO),s.setViewport(0,0,u,d),s.bindTechnique(this._ssaoTechnique,this._passParameters,e).bindDraw(this._drawParameters,e,this._passParameters),s.bindVAO(this._quadVAO);const y=No(this._quadVAO,"geometry");s.drawArrays(Et.TRIANGLE_STRIP,0,y);const _=s.bindTechnique(this._blurTechnique,this._passParameters,e);s.setViewport(0,0,p,m),s.bindFramebuffer(this._blurFBO),this._drawParameters.colorTexture=this._ssaoFBO.colorTexture,er(this._drawParameters.blurSize,0,sA/d),_.bindDraw(this._drawParameters,e,this._passParameters),s.setViewport(0,0,p,m),s.drawArrays(Et.TRIANGLE_STRIP,0,y),s.bindFramebuffer(this._ssaoFBO),s.setViewport(0,0,u,d),s.setClearColor(1,1,1,0),s.clear(yi.COLOR_BUFFER_BIT),s.setViewport(0,0,p,m),this._drawParameters.colorTexture=this._blurFBO.colorTexture,er(this._drawParameters.blurSize,sA/u,0),_.bindDraw(this._drawParameters,e,this._passParameters),s.drawArrays(Et.TRIANGLE_STRIP,0,y),s.setViewport(c[0],c[1],c[2],c[3]),l<1&&this._requestRender()}_enable(){if(this._enableTime!=null)return;const e=new pr;e.wrapMode=Pt.CLAMP_TO_EDGE,this._ssaoFBO=new hs(this._rctx,e),this._blurFBO=new hs(this._rctx,e);const r=Uint8Array.from(atob(Tot),i=>i.charCodeAt(0));e.pixelFormat=Tt.RGB,e.wrapMode=Pt.REPEAT,e.hasMipmap=!0,e.width=32,e.height=32,this._passParameters.noiseTexture=new Ct(this._rctx,e,r),this._ssaoTechnique==null&&(this._ssaoTechnique=this._techniqueRepository.acquire(a3e)),this._blurTechnique==null&&(this._blurTechnique=this._techniqueRepository.acquire(n3e)),this._enableTime=0,this._requestRender()}_disable(){this._enableTime=null,this._passParameters.noiseTexture=Le(this._passParameters.noiseTexture),this._blurFBO=Le(this._blurFBO),this._ssaoFBO=Le(this._ssaoFBO)}get gpuMemoryUsage(){var e,r;return(((e=this._blurFBO)==null?void 0:e.gpuMemoryUsage)??0)+(((r=this._ssaoFBO)==null?void 0:r.gpuMemoryUsage)??0)}};const Mot=.5;let kJ=class u3e extends Tr{initializeProgram(e){return new vr(e.rctx,u3e.shader.get().build(),fr)}initializePipeline(){return this.configuration.hasAlpha?Ot({blending:So(ve.SRC_ALPHA,ve.ONE,ve.ONE_MINUS_SRC_ALPHA,ve.ONE_MINUS_SRC_ALPHA),colorWrite:Ft}):Ot({colorWrite:Ft})}};kJ.shader=new _r(Ynt,()=>ce(()=>import("./TextureOnly.glsl-41ddb8a9.js"),[]));let zJ=class extends va{constructor(){super(...arguments),this.hasAlpha=!1}};h([U()],zJ.prototype,"hasAlpha",void 0);let sf=class extends xe{get _bindParameters(){return this._renderContext.bindParameters}get _rctx(){return this.view._stage.renderView.renderingContext}get rctx(){return this._rctx}get materialRepository(){return this._materialRepository}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}constructor(e){super(e),this._overlays=null,this._overlayRenderTarget=null,this._hasHighlights=!1,this._rendersOccluded=!1,this._hasWater=!1,this._handles=new Vi,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new Nt,this._passParameters=new wCe,this._materialRepository=null,this._screenToWorldRatio=1,this._localOriginFactory=null,this._camera=new lt,this.worldToPCSRatio=1,this.events=new Bn,this.longitudeCyclical=null}initialize(){const e=this.view._stage.renderView,{waterTextureRepository:r,stippleTextureRepository:i,markerTextureRepository:n}=e;this._shaderTechniqueRepository=new xCe({rctx:this._rctx,viewingMode:$e.Local,stippleTextureRepository:i,markerTextureRepository:n,waterTextureRepository:r}),this._renderContext=new GCe(this._rctx,new $J(this._rctx,this.view.state.viewingMode),new c3e(this.view,this._shaderTechniqueRepository,this._rctx,()=>{})),this._handles.add([ue(()=>r.updating,()=>this.events.emit("content-changed"),An),ue(()=>this.spatialReference,s=>this._localOriginFactory=new PJ(s),An),Ol(()=>this.view.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0)]),this._materialRepository=new TCe(e.textureRepository,this._shaderTechniqueRepository,s=>{(s.renderOccluded&B5)>0!==this._rendersOccluded&&this._updateRendersOccluded(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")},()=>this.events.emit("content-changed")),this._bindParameters.slot=le.DRAPED_MATERIAL,this._bindParameters.highlightDepthTexture=yxe(this._rctx),this._camera.near=1,this._camera.far=1e4,this._camera.relativeElevation=null,this._bindParameters.camera=this._camera,this._bindParameters.transparencyPassType=rt.NONE,this._bindParameters.newLighting.noonFactor=0,this._bindParameters.newLighting.globalFactor=0,this._bindParameters.newLighting.set([new sQ(Se(1,1,1))]),this._handles.add(this.view.resourceController.scheduler.registerTask(dt.STAGE,this))}destroy(){this._handles.destroy(),this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._debugTextureTechnique=Fi(this._debugTextureTechnique),this._passParameters.texture=Le(this._passParameters.texture),this._bindParameters.highlightDepthTexture=Le(this._bindParameters.highlightDepthTexture),this._shaderTechniqueRepository=Me(this._shaderTechniqueRepository),this._temporaryFBO=Le(this._temporaryFBO),this._quadVAO=Le(this._quadVAO),this.disposeOverlays()}get updating(){return this._sortedDrapeSourceRenderersDirty||Do(this._renderers,e=>e.updating)}get hasOverlays(){return this._overlays!=null&&this._overlayRenderTarget!=null}get gpuMemoryUsage(){return this._overlayRenderTarget!=null?this._overlayRenderTarget.gpuMemoryUsage:0}createGeometryDrapeSourceRenderer(e){return this.createDrapeSourceRenderer(e,Hc)}createDrapeSourceRenderer(e,r,i){const n=this._renderers.get(e);n!=null&&n.destroy();const s=new r({...i,rendererContext:this,drapeSource:e});return this._renderers.set(e,s),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this._handles.add(ue(()=>e.fullOpacity,()=>this.events.emit("content-changed")),e),s}removeDrapeSourceRenderer(e){if(e==null)return;const r=this._renderers.get(e);r!=null&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this._handles.remove(e),r.destroy())}collectUnusedRenderTargetMemory(){let e=!1;const r=ZDe();if(this._overlayRenderTarget!=null)for(const i of this._overlayRenderTarget.renderTargets){const n=this.overlays[Oi.INNER].validTargets[i.type];e=this._overlayRenderTarget.validateUsageForTarget(n,i,r)||e}return e}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._overlays!=null&&this._overlays.forEach(r=>r.hasTargetWithoutRasterImage=VL(e,i=>i.drapeTargetType===ZH.WithoutRasterImage))}ensureDrapeSources(e){this._overlays!=null&&this._overlays.forEach(r=>{r.hasDrapedFeatureSource=VL(e,i=>i.drapeSourceType===mO.Features),r.hasDrapedRasterSource=VL(e,i=>i.drapeSourceType===mO.RasterImage)})}ensureOverlays(e,r){this._overlays==null&&(this._overlayRenderTarget=new Wnt(this._rctx),this._overlays=[new poe(Oi.INNER,this._overlayRenderTarget),new poe(Oi.OUTER,this._overlayRenderTarget)]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r)}disposeOverlays(){this._overlays=null,this._overlayRenderTarget=Le(this._overlayRenderTarget),this.events.emit("textures-disposed")}get running(){return this.updating}runTask(e){this._processDrapeSources(e,()=>!0)}_processDrapeSources(e,r){let i=!1;for(const[n,s]of this._renderers){if(e.done)break;(n.destroyed||r(n))&&s.commitChanges()&&(i=!0,e.madeProgress())}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,i=!0,this._updateSortedDrapeSourceRenderers()),i&&(this._overlays!=null&&this._renderers.size===0&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this.events.emit("content-changed"),this._updateHasHighlights(),this._updateRendersOccluded(),this._updateHasWater())}processSyncDrapeSources(){this._processDrapeSources(Wa,e=>e.updatePolicy===O_.SYNC)}get isEmpty(){return!Kr.OVERLAY_DRAW_DEBUG_TEXTURE&&!Do(this._renderers,e=>!e.isEmpty)}get hasHighlights(){return this._hasHighlights}get hasWater(){return this._hasWater}get rendersOccluded(){return this._rendersOccluded}updateAnimation(e){let r=!1;return this._renderers.forEach(i=>r=i.updateAnimation(e)||r),r}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}drawTarget(e,r,i){const n=e.canvasGeometries;if(n.numViews===0)return!1;const{alignPixelEnabled:s,contentPixelRatio:o}=i;this._screenToWorldRatio=o*e.mapUnitsPerPixel/YQ;const a=r.output;if(this.isEmpty||a===D.Highlight&&!this.hasHighlights||a===D.Normal&&!this.hasWater||!e.hasSomeSizedView())return!1;const l=r.fbo;if(!l.isValid())return!1;const c=2*e.resolution,u=e.resolution;l.resize(c,u);const d=this._rctx;if(this._camera.pixelRatio=e.pixelRatio*o,this._renderContext.output=a,this._bindParameters.alignPixelEnabled=s,this._bindParameters.screenToWorldRatio=this._screenToWorldRatio,this._bindParameters.screenToPCSRatio=this._screenToWorldRatio*this.worldToPCSRatio,this._bindParameters.slot=a===D.Normal?le.DRAPED_WATER:le.DRAPED_MATERIAL,e.applyViewport(this._rctx),l.bind(d),e.index===Oi.INNER&&(d.setClearColor(0,0,0,0),d.clearSafe(yi.COLOR_BUFFER_BIT)),r.type===tn.Occluded&&(this._renderContext.renderOccludedMask=B5),Kr.OVERLAY_DRAW_DEBUG_TEXTURE&&r.type!==tn.Occluded)for(let p=0;p0&&this._sortedRenderers.forAll(({drapeSource:p,renderer:m})=>{if(r.type===tn.ColorNoRasterImage&&p.drapeSourceType===mO.RasterImage)return;const{fullOpacity:y}=p,_=y!=null&&y<1&&a===D.Color;_&&(this.bindTemporaryFramebuffer(this._rctx,c,u),d.clearSafe(yi.COLOR_BUFFER_BIT));for(let v=0;v{const n=e.indexOf(i.layer),s=n>=0,o=this._renderers.size*(i.renderGroup??(s?N5.MapLayer:N5.ViewLayer))+(s?n:0);this._sortedRenderers.push(new $ot(i,r,o))}),this._sortedRenderers.sort((r,i)=>r.index-i.index)}_setViewParameters(e,r){const i=this._camera;i.viewport=[0,0,r.resolution,r.resolution],mve(i.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],i.near,i.far),OP(i.viewMatrix,[-e[0],-e[1],0])}_updateHasWater(){const e=Do(this._renderers,r=>r.hasWater);e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water",e))}_updateHasHighlights(){const e=Do(this._renderers,r=>r.hasHighlights);e!==this._hasHighlights&&(this._hasHighlights=e,this.events.emit("has-highlights",e))}_updateRendersOccluded(){const e=Do(this._renderers,r=>r.rendersOccluded);e!==this._rendersOccluded&&(this._rendersOccluded=e,this.events.emit("renders-occluded",e))}_drawDebugTexture(e,r){this._ensureDebugPatternResources(e,r);const i=this._rctx;i.bindTechnique(this._debugTextureTechnique,this._passParameters,null),i.bindVAO(this._quadVAO),i.drawArrays(Et.TRIANGLE_STRIP,0,No(this._quadVAO,"geometry"))}_ensureDebugPatternResources(e,r){if(ne(this._passParameters.color,r[0],r[1],r[2]),this._passParameters.texture)return;const i=new Uint8Array(e*e*4);let n=0;for(let a=0;ae-20||10*u>e-20?(i[n++]=255,i[n++]=255,i[n++]=255,i[n++]=255):(i[n++]=255,i[n++]=255,i[n++]=255,i[n++]=1&c&&1&u?1&l^1&a?0:255:1&c^1&u?0:128)}const s=new pr(e);s.samplingMode=At.NEAREST,this._passParameters.texture=new Ct(this._rctx,s,i);const o=new zJ;o.hasAlpha=!0,this._debugTextureTechnique=this._shaderTechniqueRepository.acquire(kJ,o),this._quadVAO=Dl(this._rctx)}get test(){return{drapedRenderers:Array.from(this._renderers.values()),getDrapeSourceRenderer:e=>this._renderers.get(e)}}};h([f()],sf.prototype,"_sortedDrapeSourceRenderersDirty",void 0),h([f({autoDestroy:!0})],sf.prototype,"_shaderTechniqueRepository",void 0),h([f({constructOnly:!0})],sf.prototype,"view",void 0),h([f()],sf.prototype,"worldToPCSRatio",void 0),h([f()],sf.prototype,"spatialReference",void 0),h([f({type:Boolean,readOnly:!0})],sf.prototype,"updating",null),h([f()],sf.prototype,"isEmpty",null),sf=h([N("esri.views.3d.terrain.OverlayRenderer")],sf);let $ot=class{constructor(e,r,i){this.drapeSource=e,this.renderer=r,this.index=i}};const Iot=[[1,.5,.5],[.5,.5,1]],BJ=-2,B5=Ri.OccludeAndTransparent;function VJ(t,e,r,i){const n=YP(t.rings,!!t.hasZ,Kf.CCW_IS_HOLE),s=Ys(n.position.length),o=SEe(n.position,t.spatialReference,0,s,0,n.position,0,n.position.length/3,e,r,i),a=o!=null;return new Not(n.position,s,p3e(n.polygons,n.position,s),d3e(n.outlines,n.position,s),a,o)}function h3e(t,e){const r=YP(t.rings,!1,Kf.CCW_IS_HOLE),i=$i(r.position,t.spatialReference,0,r.position,e,0,r.position.length/3);for(let n=2;ni>1).map(({index:i,count:n})=>{const s=3*i,o=3*n;return r!=null?new f3e(i,n,Ch(e,s,o),Ch(r,s,o)):new GJ(i,n,Ch(e,s,o))})}function p3e(t,e,r=null){const i=new Array;for(const{index:n,count:s,holeIndices:o,pathLengths:a}of t){if(s<=1)continue;const l=3*n,c=3*s,u=o.map(p=>p-n),d=r!=null?new Lot(n,s,Ch(e,3*n,3*s),Ch(r,l,c),u,a):new Dot(n,s,Ch(e,3*n,3*s),u,a);i.push(d)}return i}let GJ=class{constructor(e,r,i){this.index=e,this.count=r,this.position=i}},f3e=class extends GJ{constructor(e,r,i,n){super(e,r,i),this.mapPositions=n}},Lot=class extends f3e{constructor(e,r,i,n,s,o){super(e,r,i,n),this.holeIndices=s,this.pathLengths=o}},Dot=class extends GJ{constructor(e,r,i,n,s){super(e,r,i),this.holeIndices=n,this.pathLengths=s}},Not=class{constructor(e,r,i,n,s,o){this.position=e,this.mapPositions=r,this.polygons=i,this.outlines=n,this.projectionSuccess=s,this.sampledElevation=o}};function bw(t,e,r,i,n,s=2){const o=1/(Math.abs(r)+Math.abs(i)+Math.abs(n)),a=r*o,l=i*o,c=n<=0?(a>=0?1:-1)*(1-Math.abs(l)):a,u=n<=0?(l>=0?1:-1)*(1-Math.abs(a)):l,d=e*s;t[d]=Dae(c),t[d+1]=Dae(u)}function Fot(t){const e=t.length/3,r=new Int16Array(2*e);let i=0;for(let n=0;n=0?1:-1)*(1-Math.abs(o)),t[1]=(o>=0?1:-1)*(1-Math.abs(s))):(t[0]=s,t[1]=o),me(t,t)}function Dae(t){return ge(Math.round(32767*t),-32767,32767)}function Nae(t){return ge(t/32767,-1,1)}function m3e(t,e){const r=t.fragment;switch(r.code.add(w`struct ShadingNormalParameters { +vec3 normalView; +vec3 viewDirection; +} shadingParams;`),e.doubleSidedMode){case Zi.None:r.code.add(w`vec3 shadingNormal(ShadingNormalParameters params) { +return normalize(params.normalView); +}`);break;case Zi.View:r.code.add(w`vec3 shadingNormal(ShadingNormalParameters params) { +return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView); +}`);break;case Zi.WindingOrder:r.code.add(w`vec3 shadingNormal(ShadingNormalParameters params) { +return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView); +}`);break;default:e.doubleSidedMode;case Zi.COUNT:}}var Zi;(function(t){t[t.None=0]="None",t[t.View=1]="View",t[t.WindingOrder=2]="WindingOrder",t[t.COUNT=3]="COUNT"})(Zi||(Zi={}));function g3e({normalTexture:t,metallicRoughnessTexture:e,metallicFactor:r,roughnessFactor:i,emissiveTexture:n,emissiveFactor:s,occlusionTexture:o}){return t==null&&e==null&&n==null&&(s==null||Bo(s,Zs))&&o==null&&(i==null||i===1)&&(r==null||r===1||r===0)}const z8=[1,1,.5],jJ=[0,.6,.2],kot=[0,1,.2];function y3e(t){t.vertex.code.add(w`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) { +vec3 camToVert = posWorld - camPosWorld; +bool isBackface = dot(camToVert, normalWorld) > 0.0; +if (isBackface) { +posClip.z += 0.0000003 * posClip.w; +} +return posClip; +}`)}let zot=class extends va{constructor(){super(...arguments),this.instancedDoublePrecision=!1}};function _3e(t,e){e.instanced&&e.instancedDoublePrecision&&(t.attributes.add(E.MODELORIGINHI,"vec3"),t.attributes.add(E.MODELORIGINLO,"vec3"),t.attributes.add(E.MODEL,"mat3"),t.attributes.add(E.MODELNORMAL,"mat3"));const r=t.vertex;e.instancedDoublePrecision&&(r.include(a5,e),r.uniforms.add(new pu("viewOriginHi",(i,n)=>uXe(ne(_I,n.camera.viewInverseTransposeMatrix[3],n.camera.viewInverseTransposeMatrix[7],n.camera.viewInverseTransposeMatrix[11]),_I)),new pu("viewOriginLo",(i,n)=>hXe(ne(_I,n.camera.viewInverseTransposeMatrix[3],n.camera.viewInverseTransposeMatrix[7],n.camera.viewInverseTransposeMatrix[11]),_I)))),r.code.add(w` + vec3 calculateVPos() { + ${e.instancedDoublePrecision?"return model * localPosition().xyz;":"return localPosition().xyz;"} + } + `),r.code.add(w` + vec3 subtractOrigin(vec3 _pos) { + ${e.instancedDoublePrecision?w` + vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -modelOriginHi, -modelOriginLo); + return _pos - originDelta;`:"return vpos;"} + } + `),r.code.add(w` + vec3 dpNormal(vec4 _normal) { + ${e.instancedDoublePrecision?"return normalize(modelNormal * _normal.xyz);":"return normalize(_normal.xyz);"} + } + `),e.output===D.Normal&&(jS(r),r.code.add(w` + vec3 dpNormalView(vec4 _normal) { + ${e.instancedDoublePrecision?"return normalize((viewNormal * vec4(modelNormal * _normal.xyz, 1.0)).xyz);":"return normalize((viewNormal * _normal).xyz);"} + } + `)),e.hasVertexTangents&&r.code.add(w` + vec4 dpTransformVertexTangent(vec4 _tangent) { + ${e.instancedDoublePrecision?"return vec4(modelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"} + + } + `)}h([U()],zot.prototype,"instancedDoublePrecision",void 0);const _I=O();var as;function Bot(t){switch(t){case"multiply":default:return as.Multiply;case"ignore":return as.Ignore;case"replace":return as.Replace;case"tint":return as.Tint}}function v3e(t,e,r){if(t==null||e===as.Ignore)return r[0]=255,r[1]=255,r[2]=255,void(r[3]=255);const i=ge(Math.round(t[3]*V5),0,V5),n=i===0||e===as.Tint?0:e===as.Replace?Vot:Got;r[0]=ge(Math.round(t[0]*Sx),0,Sx),r[1]=ge(Math.round(t[1]*Sx),0,Sx),r[2]=ge(Math.round(t[2]*Sx),0,Sx),r[3]=i+n}(function(t){t[t.Multiply=1]="Multiply",t[t.Ignore=2]="Ignore",t[t.Replace=3]="Replace",t[t.Tint=4]="Tint"})(as||(as={}));const Sx=255,V5=85,Vot=V5,Got=2*V5;function b3e(t){t.vertex.code.add(w` + vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) { + float symbolAlpha = 0.0; + + const float maxTint = 85.0; + const float maxReplace = 170.0; + const float scaleAlpha = 3.0; + + if (symbolColor.a > maxReplace) { + colorMixMode = ${w.int(as.Multiply)}; + symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace); + } else if (symbolColor.a > maxTint) { + colorMixMode = ${w.int(as.Replace)}; + symbolAlpha = scaleAlpha * (symbolColor.a - maxTint); + } else if (symbolColor.a > 0.0) { + colorMixMode = ${w.int(as.Tint)}; + symbolAlpha = scaleAlpha * symbolColor.a; + } else { + colorMixMode = ${w.int(as.Multiply)}; + symbolAlpha = 0.0; + } + + return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha); + } + `)}function w3e(t,e){e.hasSymbolColors?(t.include(b3e),t.attributes.add(E.SYMBOLCOLOR,"vec4"),t.varyings.add("colorMixMode","mediump float"),t.vertex.code.add(w`int symbolColorMixMode; +vec4 getSymbolColor() { +return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451; +} +void forwardColorMixMode() { +colorMixMode = float(symbolColorMixMode) + 0.5; +}`)):(t.fragment.uniforms.add(new QP("colorMixMode",r=>mSe[r.colorMixMode])),t.vertex.code.add(w`vec4 getSymbolColor() { return vec4(1.0); } +void forwardColorMixMode() {}`))}function qw(t,e){e.hasVertexColors?(t.attributes.add(E.COLOR,"vec4"),t.varyings.add("vColor","vec4"),t.vertex.code.add(w`void forwardVertexColor() { vColor = color; }`),t.vertex.code.add(w`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):t.vertex.code.add(w`void forwardVertexColor() {} +void forwardNormalizedVertexColor() {}`)}function jot(t){t.fragment.code.add(w` + #define discardOrAdjustAlpha(color) { if (color.a < ${w.float(vo)}) { discard; } } + `)}let Nb=class extends ln{constructor(e,r){super(e,"float",jr.Draw,(i,n,s)=>i.setUniform1f(e,r(n,s)))}};function Fb(t,e){x3e(t,e,new Ce("textureAlphaCutoff",r=>r.textureAlphaCutoff))}function Hot(t,e){x3e(t,e,new Nb("textureAlphaCutoff",r=>r.textureAlphaCutoff))}function x3e(t,e,r){const i=t.fragment;switch(e.alphaDiscardMode!==Gr.Mask&&e.alphaDiscardMode!==Gr.MaskBlend||i.uniforms.add(r),e.alphaDiscardMode){case Gr.Blend:return t.include(jot);case Gr.Opaque:i.code.add(w`void discardOrAdjustAlpha(inout vec4 color) { +color.a = 1.0; +}`);break;case Gr.Mask:i.code.add(w`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);break;case Gr.MaskBlend:t.fragment.code.add(w`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`)}}function T3e(t,e){const{vertex:r,fragment:i}=t,n=e.hasModelTransformation;if(n){const o=hi();r.uniforms.add(new Mi("model",a=>a.modelTransformation??yn)),r.uniforms.add(new Gh("normalTransform",a=>(Qf(o,a.modelTransformation??yn),o)))}const s=e.hasColorTexture&&e.alphaDiscardMode!==Gr.Opaque;switch(e.output){case D.Depth:case D.Shadow:case D.ShadowHighlight:case D.ShadowExcludeHighlight:case D.ObjectAndLayerIdColor:xc(r,e),t.include(Cl,e),t.include(Uf,e),t.include(Tg,e),t.include(Xg,e),t.include(fn,e),t.include(GP,e),pw(t),t.varyings.add("depth","float"),s&&i.uniforms.add(new Ye("tex",o=>o.texture)),r.code.add(w` + void main(void) { + vpos = calculateVPos(); + ${n?"vpos = (model * vec4(vpos, 1.0)).xyz;":""} + vpos = subtractOrigin(vpos); + vpos = addVerticalOffset(vpos, localOrigin); + gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth); + forwardTextureCoordinates(); + forwardObjectAndLayerIdColor(); + } + `),t.include(Fb,e),i.code.add(w` + void main(void) { + discardBySlice(vpos); + ${s?w` + vec4 texColor = texture(tex, ${e.hasColorTextureTransform?w`colorUV`:w`vuv0`}); + discardOrAdjustAlpha(texColor);`:""} + ${e.output===D.ObjectAndLayerIdColor?w`outputObjectAndLayerIdColor();`:w`outputDepth(depth);`} + } + `);break;case D.Normal:{xc(r,e),t.include(Cl,e),t.include(ZP,e),t.include(F8,e),t.include(Uf,e),t.include(Tg,e),s&&i.uniforms.add(new Ye("tex",a=>a.texture)),e.normalType===br.ScreenDerivative&&t.varyings.add("vPositionView","vec3");const o=e.normalType===br.Attribute||e.normalType===br.Compressed;r.code.add(w` + void main(void) { + vpos = calculateVPos(); + ${n?"vpos = (model * vec4(vpos, 1.0)).xyz;":""} + + ${o?w`vNormalWorld = ${n?"normalize(normalTransform * dpNormal(vvLocalNormal(normalModel())))":"dpNormalView(vvLocalNormal(normalModel()))"};`:w` + // Get vertex position in camera space for screen-space derivative normals + vPositionView = (view * vec4(vpos, 1.0)).xyz; + `} + vpos = subtractOrigin(vpos); + vpos = addVerticalOffset(vpos, localOrigin); + gl_Position = transformPosition(proj, view, vpos); + forwardTextureCoordinates(); + } + `),t.include(fn,e),t.include(Fb,e),i.code.add(w` + void main() { + discardBySlice(vpos); + ${s?w` + vec4 texColor = texture(tex, ${e.hasColorTextureTransform?w`colorUV`:w`vuv0`}); + discardOrAdjustAlpha(texColor);`:""} + + ${e.normalType===br.ScreenDerivative?w`vec3 normal = screenDerivativeNormal(vPositionView);`:w` + vec3 normal = normalize(vNormalWorld); + if (gl_FrontFacing == false){ + normal = -normal; + }`} + fragColor = vec4(0.5 + 0.5 * normal, 1.0); + } + `);break}case D.Highlight:xc(r,e),t.include(Cl,e),t.include(Uf,e),t.include(Tg,e),s&&i.uniforms.add(new Ye("tex",o=>o.texture)),r.code.add(w` + void main(void) { + vpos = calculateVPos(); + ${n?"vpos = (model * vec4(vpos, 1.0)).xyz;":""} + vpos = subtractOrigin(vpos); + vpos = addVerticalOffset(vpos, localOrigin); + gl_Position = transformPosition(proj, view, vpos); + forwardTextureCoordinates(); + } + `),t.include(fn,e),t.include(Fb,e),t.include(c0,e),i.code.add(w` + void main() { + discardBySlice(vpos); + ${s?w` + vec4 texColor = texture(tex, ${e.hasColorTextureTransform?w`colorUV`:w`vuv0`}); + discardOrAdjustAlpha(texColor);`:""} + outputHighlight(); + } + `)}}function S3e(t,e){const r=t.fragment;e.hasVertexTangents?(t.attributes.add(E.TANGENT,"vec4"),t.varyings.add("vTangent","vec4"),e.doubleSidedMode===Zi.WindingOrder?r.code.add(w`mat3 computeTangentSpace(vec3 normal) { +float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w; +vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz); +vec3 bitangent = cross(normal, tangent) * tangentHeadedness; +return mat3(tangent, bitangent, normal); +}`):r.code.add(w`mat3 computeTangentSpace(vec3 normal) { +float tangentHeadedness = vTangent.w; +vec3 tangent = normalize(vTangent.xyz); +vec3 bitangent = cross(normal, tangent) * tangentHeadedness; +return mat3(tangent, bitangent, normal); +}`)):r.code.add(w`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) { +vec3 Q1 = dFdx(pos); +vec3 Q2 = dFdy(pos); +vec2 stx = dFdx(st); +vec2 sty = dFdy(st); +float det = stx.t * sty.s - sty.t * stx.s; +vec3 T = stx.t * Q2 - sty.t * Q1; +T = T - normal * dot(normal, T); +T *= inversesqrt(max(dot(T,T), 1.e-10)); +vec3 B = sign(det) * cross(normal, T); +return mat3(T, B, normal); +}`),e.textureCoordinateType!==Pn.None&&(t.include(qZ,e),r.uniforms.add(e.pbrTextureBindType===jr.Pass?new Ye("normalTexture",i=>i.textureNormal):new Eh("normalTexture",i=>i.textureNormal)),r.code.add(w`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) { +vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0; +return tangentSpace * rawNormal; +}`))}function JP(t,e){const r=t.fragment;e.receiveAmbientOcclusion?(r.uniforms.add(new Ye("ssaoTex",(i,n)=>n.ssaoHelper.colorTexture)),r.constants.add("blurSizePixelsInverse","float",1/sA),r.code.add(w`float evaluateAmbientOcclusionInverse() { +vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0)); +return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).a; +} +float evaluateAmbientOcclusion() { +return 1.0 - evaluateAmbientOcclusionInverse(); +}`)):r.code.add(w`float evaluateAmbientOcclusionInverse() { return 1.0; } +float evaluateAmbientOcclusion() { return 0.0; }`)}function KP(t){t.constants.add("ambientBoostFactor","float",Xxe)}function NE(t){t.uniforms.add(new Ce("lightingGlobalFactor",(e,r)=>r.lighting.globalFactor))}function ww(t,e){const r=t.fragment;switch(t.include(JP,e),e.pbrMode!==et.Disabled&&t.include(DJ,e),t.include(ZZ,e),t.include(IP),r.code.add(w` + const float GAMMA_SRGB = 2.1; + const float INV_GAMMA_SRGB = 0.4761904; + ${e.pbrMode===et.Disabled?"":"const vec3 GROUND_REFLECTANCE = vec3(0.2);"} + `),KP(r),NE(r),r0(r),r.code.add(w` + float additionalDirectedAmbientLight(vec3 vPosWorld) { + float vndl = dot(${e.spherical?w`normalize(vPosWorld)`:w`vec3(0.0, 0.0, 1.0)`}, mainLightDirection); + return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0)); + } + `),lm(r),r.code.add(w`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) { +float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld); +return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity; +}`),e.pbrMode){case et.Disabled:case et.WaterOnIntegratedMesh:case et.Water:t.include(K4),r.code.add(w`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight) +{ +vec3 mainLighting = evaluateMainLighting(normalWorld, shadow); +vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao); +vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB)); +vec3 totalLight = mainLighting + ambientLighting + additionalLight; +totalLight = min(totalLight, vec3(PI)); +vec3 outColor = vec3((albedoLinear / PI) * totalLight); +return pow(outColor, vec3(INV_GAMMA_SRGB)); +}`);break;case et.Normal:case et.Schematic:r.code.add(w`const float fillLightIntensity = 0.25; +const float horizonLightDiffusion = 0.4; +const float additionalAmbientIrradianceFactor = 0.02; +vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec3 _emission, float additionalAmbientIrradiance) +{ +vec3 viewDirection = -viewDir; +vec3 h = normalize(viewDirection + mainLightDirection); +PBRShadingInfo inputs; +inputs.NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0); +inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0); +inputs.NdotH = clamp(dot(normal, h), 0.0, 1.0); +inputs.VdotH = clamp(dot(viewDirection, h), 0.0, 1.0); +inputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0); +vec3 reflectedView = normalize(reflect(viewDirection, normal)); +inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0); +inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB)); +inputs.ssao = ssao; +inputs.metalness = mrr[0]; +inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),r.code.add(w`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness; +inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0)); +inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),e.useFillLights?r.uniforms.add(new kf("hasFillLights",(i,n)=>n.enableFillLights)):r.constants.add("hasFillLights","bool",!1),r.code.add(w`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]); +ambientDir = ambientDir != vec3(0.0)? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0)); +inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0; +vec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * mainLightIntensity; +vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity; +vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight; +inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ; +inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),r.uniforms.add(new Ce("lightingSpecularStrength",(i,n)=>n.lighting.mainLight.specularStrength),new Ce("lightingEnvironmentStrength",(i,n)=>n.lighting.mainLight.environmentStrength)),r.code.add(w`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView; +vec3 horizonRingH = normalize(viewDirection + horizonRingDir); +inputs.NdotH_Horizon = dot(normal, horizonRingH); +vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(inputs.NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow); +vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity; +vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight; +inputs.skyRadianceToSurface = ambientLightRadianceComponent + mainLightRadianceComponent + horizonLightRadianceComponent; +inputs.groundRadianceToSurface = GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) + mainLightRadianceComponent; +inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),r.code.add(w` + vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs); + vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance; + vec3 emissionComponent = pow(_emission, vec3(GAMMA_SRGB)); + vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent; + ${e.pbrMode===et.Schematic?w`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`:w`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`} + return outColor; + } + `);break;case et.Terrain:case et.TerrainWithWater:t.include(K4),r.code.add(w`const float roughnessTerrain = 0.5; +const float specularityTerrain = 0.5; +const vec3 fresnelReflectionTerrain = vec3(0.04); +vec3 evaluateTerrainLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) { +vec3 viewDirection = -vd; +vec3 h = normalize(viewDirection + mainLightDirection); +float NdotL = clamp(dot(n, mainLightDirection), 0.001, 1.0); +float NdotV = clamp(abs(dot(n, viewDirection)), 0.001, 1.0); +float NdotH = clamp(dot(n, h), 0.0, 1.0); +float NdotNG = clamp(dot(n, nup), -1.0, 1.0); +vec3 albedoLinear = pow(c, vec3(GAMMA_SRGB)); +float lightness = 0.3 * albedoLinear[0] + 0.5 * albedoLinear[1] + 0.2 * albedoLinear[2]; +vec3 f0 = (0.85 * lightness + 0.15) * fresnelReflectionTerrain; +vec3 f90 = vec3(clamp(dot(f0, vec3(50.0 * 0.33)), 0.0, 1.0)); +vec3 mainLightIrradianceComponent = (1. - shadow) * NdotL * mainLightIntensity; +vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(n, ssao) + al; +vec3 ambientSky = ambientLightIrradianceComponent + mainLightIrradianceComponent; +vec3 indirectDiffuse = ((1.0 - NdotNG) * mainLightIrradianceComponent + (1.0 + NdotNG ) * ambientSky) * 0.5; +vec3 outDiffColor = albedoLinear * (1.0 - f0) * indirectDiffuse / PI; +vec3 mainLightRadianceComponent = normalDistribution(NdotH, roughnessTerrain) * mainLightIntensity; +vec2 dfg = prefilteredDFGAnalytical(roughnessTerrain, NdotV); +vec3 specularColor = f0 * dfg.x + f90 * dfg.y; +vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceComponent; +vec3 outColorLinear = outDiffColor + specularComponent; +vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB)); +return outColor; +}`);break;default:e.pbrMode;case et.COUNT:}}function Pl(){const t=new Float32Array(9);return t[0]=1,t[4]=1,t[8]=1,t}function E3e(t){const e=new Float32Array(9);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[6]=t[6],e[7]=t[7],e[8]=t[8],e}function ZD(t,e,r,i,n,s,o,a,l){const c=new Float32Array(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=i,c[4]=n,c[5]=s,c[6]=o,c[7]=a,c[8]=l,c}function Wot(t,e){return new Float32Array(t,e,9)}Object.freeze(Object.defineProperty({__proto__:null,clone:E3e,create:Pl,createView:Wot,fromValues:ZD},Symbol.toStringTag,{value:"Module"}));function qot(t){t.vertex.uniforms.add(new Gh("colorTextureTransformMatrix",e=>e.colorTextureTransformMatrix!=null?e.colorTextureTransformMatrix:Pl())),t.varyings.add("colorUV","vec2"),t.vertex.code.add(w`void forwardColorUV(){ +colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)}function Xot(t){t.vertex.uniforms.add(new Gh("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix!=null?e.normalTextureTransformMatrix:Pl())),t.varyings.add("normalUV","vec2"),t.vertex.code.add(w`void forwardNormalUV(){ +normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)}function Yot(t){t.vertex.uniforms.add(new Gh("emissiveTextureTransformMatrix",e=>e.emissiveTextureTransformMatrix!=null?e.emissiveTextureTransformMatrix:Pl())),t.varyings.add("emissiveUV","vec2"),t.vertex.code.add(w`void forwardEmissiveUV(){ +emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)}function Zot(t){t.vertex.uniforms.add(new Gh("occlusionTextureTransformMatrix",e=>e.occlusionTextureTransformMatrix!=null?e.occlusionTextureTransformMatrix:Pl())),t.varyings.add("occlusionUV","vec2"),t.vertex.code.add(w`void forwardOcclusionUV(){ +occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)}function Qot(t){t.vertex.uniforms.add(new Gh("metallicRoughnessTextureTransformMatrix",e=>e.metallicRoughnessTextureTransformMatrix!=null?e.metallicRoughnessTextureTransformMatrix:Pl())),t.varyings.add("metallicRoughnessUV","vec2"),t.vertex.code.add(w`void forwardMetallicRoughnessUV(){ +metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)}function kR(t){t.include(cm),t.code.add(w` + vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) { + // workaround for artifacts in OSX using Intel Iris Pro + // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475 + vec3 internalMixed = internalColor * textureColor; + vec3 allMixed = internalMixed * externalColor; + + if (mode == ${w.int(as.Multiply)}) { + return allMixed; + } + if (mode == ${w.int(as.Ignore)}) { + return internalMixed; + } + if (mode == ${w.int(as.Replace)}) { + return externalColor; + } + + // tint (or something invalid) + float vIn = rgb2v(internalMixed); + vec3 hsvTint = rgb2hsv(externalColor); + vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z); + return hsv2rgb(hsvOut); + } + + float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) { + // workaround for artifacts in OSX using Intel Iris Pro + // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475 + float internalMixed = internalOpacity * textureOpacity; + float allMixed = internalMixed * externalOpacity; + + if (mode == ${w.int(as.Ignore)}) { + return internalMixed; + } + if (mode == ${w.int(as.Replace)}) { + return externalOpacity; + } + + // multiply or tint (or something invalid) + return allMixed; + } + `)}function Jot(t){const e=new mr,{vertex:r,fragment:i,varyings:n}=e;if(xc(r,t),e.include(LP),n.add("vpos","vec3"),e.include(Tg,t),e.include(_3e,t),e.include(oSe,t),t.hasColorTextureTransform&&e.include(qot),t.output===D.Color||t.output===D.Alpha){t.hasNormalTextureTransform&&e.include(Xot),t.hasEmissionTextureTransform&&e.include(Yot),t.hasOcclusionTextureTransform&&e.include(Zot),t.hasMetallicRoughnessTextureTransform&&e.include(Qot),fp(r,t),e.include(ZP,t),e.include(Cl,t);const s=t.normalType===br.Attribute||t.normalType===br.Compressed;s&&t.offsetBackfaces&&e.include(y3e),e.include(S3e,t),e.include(F8,t),t.instancedColor&&e.attributes.add(E.INSTANCECOLOR,"vec4"),n.add("vPositionLocal","vec3"),e.include(Uf,t),e.include(AE,t),e.include(w3e,t),e.include(qw,t),r.uniforms.add(new Jt("externalColor",a=>a.externalColor)),n.add("vcolorExt","vec4"),t.hasMultipassTerrain&&n.add("depth","float");const o=t.hasModelTransformation;if(o){const a=hi();r.uniforms.add(new Mi("model",l=>l.modelTransformation??yn)),r.uniforms.add(new Gh("normalTransform",l=>(Qf(a,l.modelTransformation??yn),a)))}r.code.add(w` + void main(void) { + forwardNormalizedVertexColor(); + vcolorExt = externalColor; + ${t.instancedColor?"vcolorExt *= instanceColor * 0.003921568627451;":""} + vcolorExt *= vvColor(); + vcolorExt *= getSymbolColor(); + forwardColorMixMode(); + + if (vcolorExt.a < ${w.float(vo)}) { + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + } else { + vpos = calculateVPos(); + ${o?"vpos = (model * vec4(vpos, 1.0)).xyz;":""} + vPositionLocal = vpos - view[3].xyz; + vpos = subtractOrigin(vpos); + ${s?w`vNormalWorld = ${o?"normalize(normalTransform * dpNormal(vvLocalNormal(normalModel())))":"dpNormal(vvLocalNormal(normalModel()))"};`:""} + vpos = addVerticalOffset(vpos, localOrigin); + ${t.hasVertexTangents?"vTangent = dpTransformVertexTangent(tangent);":""} + gl_Position = transformPosition(proj, view, vpos); + ${s&&t.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""} + } + + ${t.hasMultipassTerrain?"depth = (view * vec4(vpos, 1.0)).z;":""} + forwardLinearDepth(); + forwardTextureCoordinates(); + ${t.hasColorTextureTransform?w`forwardColorUV();`:""} + ${t.hasNormalTextureTransform?w`forwardNormalUV();`:""} + ${t.hasEmissionTextureTransform?w`forwardEmissiveUV();`:""} + ${t.hasOcclusionTextureTransform?w`forwardOcclusionUV();`:""} + ${t.hasMetallicRoughnessTextureTransform?w`forwardMetallicRoughnessUV();`:""} + } + `)}switch(t.output){case D.Alpha:e.include(fn,t),e.include(Fb,t),e.include(xu,t),i.uniforms.add(new Ce("opacity",s=>s.opacity),new Ce("layerOpacity",s=>s.layerOpacity)),t.hasColorTexture&&i.uniforms.add(new Ye("tex",s=>s.texture)),i.include(kR),i.code.add(w` + void main() { + discardBySlice(vpos); + ${t.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""} + ${t.hasColorTexture?w` + vec4 texColor = texture(tex, ${t.hasColorTextureTransform?w`colorUV`:w`vuv0`}); + ${t.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""} + discardOrAdjustAlpha(texColor);`:w`vec4 texColor = vec4(1.0);`} + ${t.hasVertexColors?w`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:w`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`} + fragColor = vec4(opacity_); + } + `);break;case D.Color:e.include(fn,t),e.include(ww,t),e.include(JP,t),e.include(Fb,t),e.include(t.instancedDoublePrecision?U8:vw,t),e.include(xu,t),fp(i,t),i.uniforms.add(r.uniforms.get("localOrigin"),new Lt("ambient",s=>s.ambient),new Lt("diffuse",s=>s.diffuse),new Ce("opacity",s=>s.opacity),new Ce("layerOpacity",s=>s.layerOpacity)),t.hasColorTexture&&i.uniforms.add(new Ye("tex",s=>s.texture)),e.include(YZ,t),e.include(DJ,t),i.include(kR),e.include(m3e,t),KP(i),NE(i),lm(i),i.code.add(w` + void main() { + discardBySlice(vpos); + ${t.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""} + ${t.hasColorTexture?w` + vec4 texColor = texture(tex, ${t.hasColorTextureTransform?w`colorUV`:w`vuv0`}); + ${t.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""} + discardOrAdjustAlpha(texColor);`:w`vec4 texColor = vec4(1.0);`} + shadingParams.viewDirection = normalize(vpos - cameraPosition); + ${t.normalType===br.ScreenDerivative?w` + vec3 normal = screenDerivativeNormal(vPositionLocal);`:w` + shadingParams.normalView = vNormalWorld; + vec3 normal = shadingNormal(shadingParams);`} + ${t.pbrMode===et.Normal?"applyPBRFactors();":""} + float ssao = evaluateAmbientOcclusionInverse(); + ssao *= getBakedOcclusion(); + + vec3 posWorld = vpos + localOrigin; + + float additionalAmbientScale = additionalDirectedAmbientLight(posWorld); + float shadow = ${t.receiveShadows?"readShadowMap(vpos, linearDepth)":t.spherical?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"}; + + vec3 matColor = max(ambient, diffuse); + ${t.hasVertexColors?w` + vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); + float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:w` + vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); + float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`} + ${t.hasNormalTexture?w` + mat3 tangentSpace = ${t.hasVertexTangents?"computeTangentSpace(normal);":"computeTangentSpace(normal, vpos, vuv0);"} + vec3 shadingNormal = computeTextureNormal(tangentSpace, ${t.hasNormalTextureTransform?w`normalUV`:"vuv0"});`:w`vec3 shadingNormal = normal;`} + vec3 normalGround = ${t.spherical?w`normalize(posWorld);`:w`vec3(0.0, 0.0, 1.0);`} + + ${t.snowCover?w` + float snow = smoothstep(0.5, 0.55, dot(normal, normalGround)); + albedo = mix(albedo, vec3(1), snow); + shadingNormal = mix(shadingNormal, normal, snow); + ssao = mix(ssao, 1.0, snow);`:""} + + vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; + + ${t.pbrMode===et.Normal||t.pbrMode===et.Schematic?w` + float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2]; + ${t.snowCover?w` + mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow); + emission = mix(emission, vec3(0.0), snow);`:""} + + vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:w`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`} + fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos); + ${t.transparencyPassType===rt.Color?w`fragColor = premultiplyAlpha(fragColor);`:""} + } + `)}return e.include(T3e,t),e}const Kot=Object.freeze(Object.defineProperty({__proto__:null,build:Jot},Symbol.toStringTag,{value:"Module"}));let eat=class extends qCe{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=na(z8),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=ui.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=Se(0,0,0),this.instancedDoublePrecision=!1,this.normalType=br.Attribute,this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=Se(.2,.2,.2),this.diffuse=Se(.8,.8,.8),this.externalColor=$t(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=O(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=uw.Less,this.textureAlphaMode=Gr.Blend,this.textureAlphaCutoff=$5,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Ri.Occlude}},tat=class extends XCe{constructor(){super(...arguments),this.origin=O(),this.slicePlaneLocalOrigin=this.origin}},HJ=class C3e extends Tr{initializeConfiguration(e,r){r.spherical=e.viewingMode===$e.Global,r.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,r.textureCoordinateType=r.hasColorTexture||r.hasMetallicRoughnessTexture||r.hasEmissionTexture||r.hasOcclusionTexture||r.hasNormalTexture?Pn.Default:Pn.None,r.objectAndLayerIdColorInstanced=r.instanced}initializeProgram(e){return this._initializeProgram(e,C3e.shader)}_initializeProgram(e,r){return new vr(e.rctx,r.get().build(this.configuration),fr)}_convertDepthTestFunction(e){return e===uw.Lequal?Hr.LEQUAL:Hr.LESS}_makePipeline(e,r){const i=this.configuration,n=e===rt.NONE,s=e===rt.FrontFace;return Ot({blending:i.output!==D.Color&&i.output!==D.Alpha||!i.transparent?null:n?fu:u0(e),culling:rat(i)?J6(i.cullFace):null,depthTest:{func:f1(e,this._convertDepthTestFunction(i.customDepthTest))},depthWrite:(n||s)&&i.writeDepth?$l:null,colorWrite:Ft,stencilWrite:i.hasOccludees?em:null,stencilTest:i.hasOccludees?r?r1:m1:null,polygonOffset:n||s?null:A8(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,r){return r?this._occludeePipelineState:super.getPipelineState(e,r)}};function rat(t){return t.cullFace!==ui.None||!t.hasSlicePlane&&!t.transparent&&!t.doubleSidedMode}HJ.shader=new _r(Kot,()=>ce(()=>import("./DefaultMaterial.glsl-ab417bbf.js"),[]));let kt=class extends Fo{constructor(){super(...arguments),this.output=D.Color,this.alphaDiscardMode=Gr.Opaque,this.doubleSidedMode=Zi.None,this.pbrMode=et.Disabled,this.cullFace=ui.None,this.transparencyPassType=rt.NONE,this.normalType=br.Attribute,this.textureCoordinateType=Pn.None,this.customDepthTest=uw.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}};h([U({count:D.COUNT})],kt.prototype,"output",void 0),h([U({count:Gr.COUNT})],kt.prototype,"alphaDiscardMode",void 0),h([U({count:Zi.COUNT})],kt.prototype,"doubleSidedMode",void 0),h([U({count:et.COUNT})],kt.prototype,"pbrMode",void 0),h([U({count:ui.COUNT})],kt.prototype,"cullFace",void 0),h([U({count:rt.COUNT})],kt.prototype,"transparencyPassType",void 0),h([U({count:br.COUNT})],kt.prototype,"normalType",void 0),h([U({count:Pn.COUNT})],kt.prototype,"textureCoordinateType",void 0),h([U({count:uw.COUNT})],kt.prototype,"customDepthTest",void 0),h([U()],kt.prototype,"spherical",void 0),h([U()],kt.prototype,"hasVertexColors",void 0),h([U()],kt.prototype,"hasSymbolColors",void 0),h([U()],kt.prototype,"hasVerticalOffset",void 0),h([U()],kt.prototype,"hasSlicePlane",void 0),h([U()],kt.prototype,"hasSliceHighlight",void 0),h([U()],kt.prototype,"hasColorTexture",void 0),h([U()],kt.prototype,"hasMetallicRoughnessTexture",void 0),h([U()],kt.prototype,"hasEmissionTexture",void 0),h([U()],kt.prototype,"hasOcclusionTexture",void 0),h([U()],kt.prototype,"hasNormalTexture",void 0),h([U()],kt.prototype,"hasScreenSizePerspective",void 0),h([U()],kt.prototype,"hasVertexTangents",void 0),h([U()],kt.prototype,"hasOccludees",void 0),h([U()],kt.prototype,"hasMultipassTerrain",void 0),h([U()],kt.prototype,"hasModelTransformation",void 0),h([U()],kt.prototype,"offsetBackfaces",void 0),h([U()],kt.prototype,"vvSize",void 0),h([U()],kt.prototype,"vvColor",void 0),h([U()],kt.prototype,"receiveShadows",void 0),h([U()],kt.prototype,"receiveAmbientOcclusion",void 0),h([U()],kt.prototype,"textureAlphaPremultiplied",void 0),h([U()],kt.prototype,"instanced",void 0),h([U()],kt.prototype,"instancedColor",void 0),h([U()],kt.prototype,"objectAndLayerIdColorInstanced",void 0),h([U()],kt.prototype,"instancedDoublePrecision",void 0),h([U()],kt.prototype,"doublePrecisionRequiresObfuscation",void 0),h([U()],kt.prototype,"writeDepth",void 0),h([U()],kt.prototype,"transparent",void 0),h([U()],kt.prototype,"enableOffset",void 0),h([U()],kt.prototype,"cullAboveGround",void 0),h([U()],kt.prototype,"snowCover",void 0),h([U()],kt.prototype,"hasColorTextureTransform",void 0),h([U()],kt.prototype,"hasEmissionTextureTransform",void 0),h([U()],kt.prototype,"hasNormalTextureTransform",void 0),h([U()],kt.prototype,"hasOcclusionTextureTransform",void 0),h([U()],kt.prototype,"hasMetallicRoughnessTextureTransform",void 0),h([U({constValue:!0})],kt.prototype,"hasVvInstancing",void 0),h([U({constValue:!1})],kt.prototype,"useCustomDTRExponentForWater",void 0),h([U({constValue:!1})],kt.prototype,"supportsTextureAtlas",void 0),h([U({constValue:!0})],kt.prototype,"useFillLights",void 0);function iat(t){const e=new mr,{vertex:r,fragment:i,varyings:n}=e;return xc(r,t),e.include(LP),n.add("vpos","vec3"),e.include(Tg,t),e.include(_3e,t),e.include(oSe,t),t.output!==D.Color&&t.output!==D.Alpha||(fp(e.vertex,t),e.include(ZP,t),e.include(Cl,t),t.offsetBackfaces&&e.include(y3e),t.instancedColor&&e.attributes.add(E.INSTANCECOLOR,"vec4"),n.add("vNormalWorld","vec3"),n.add("localvpos","vec3"),t.hasMultipassTerrain&&n.add("depth","float"),e.include(Uf,t),e.include(AE,t),e.include(w3e,t),e.include(qw,t),r.uniforms.add(new Jt("externalColor",s=>s.externalColor)),n.add("vcolorExt","vec4"),r.code.add(w` + void main(void) { + forwardNormalizedVertexColor(); + vcolorExt = externalColor; + ${t.instancedColor?"vcolorExt *= instanceColor * 0.003921568627451;":""} + vcolorExt *= vvColor(); + vcolorExt *= getSymbolColor(); + forwardColorMixMode(); + + if (vcolorExt.a < ${w.float(vo)}) { + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + } else { + vpos = calculateVPos(); + localvpos = vpos - view[3].xyz; + vpos = subtractOrigin(vpos); + vNormalWorld = dpNormal(vvLocalNormal(normalModel())); + vpos = addVerticalOffset(vpos, localOrigin); + gl_Position = transformPosition(proj, view, vpos); + ${t.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""} + } + ${t.hasMultipassTerrain?w`depth = (view * vec4(vpos, 1.0)).z;`:""} + forwardLinearDepth(); + forwardTextureCoordinates(); + } + `)),t.output===D.Alpha&&(e.include(fn,t),e.include(Fb,t),e.include(xu,t),i.uniforms.add(new Ce("opacity",s=>s.opacity),new Ce("layerOpacity",s=>s.layerOpacity)),t.hasColorTexture&&i.uniforms.add(new Ye("tex",s=>s.texture)),i.include(kR),i.code.add(w` + void main() { + discardBySlice(vpos); + ${t.hasMultipassTerrain?w`terrainDepthTest(gl_FragCoord, depth);`:""} + ${t.hasColorTexture?w` + vec4 texColor = texture(tex, ${t.hasColorTextureTransform?w`colorUV`:w`vuv0`}); + ${t.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""} + discardOrAdjustAlpha(texColor);`:w`vec4 texColor = vec4(1.0);`} + ${t.hasVertexColors?w`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:w`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`} + + fragColor = vec4(opacity_); + } + `)),t.output===D.Color&&(e.include(fn,t),e.include(ww,t),e.include(JP,t),e.include(Fb,t),e.include(t.instancedDoublePrecision?U8:vw,t),e.include(xu,t),fp(e.fragment,t),r0(i),KP(i),NE(i),i.uniforms.add(r.uniforms.get("localOrigin"),r.uniforms.get("view"),new Lt("ambient",s=>s.ambient),new Lt("diffuse",s=>s.diffuse),new Ce("opacity",s=>s.opacity),new Ce("layerOpacity",s=>s.layerOpacity)),t.hasColorTexture&&i.uniforms.add(new Ye("tex",s=>s.texture)),e.include(YZ,t),e.include(DJ,t),i.include(kR),lm(i),i.code.add(w` + void main() { + discardBySlice(vpos); + ${t.hasMultipassTerrain?w`terrainDepthTest(gl_FragCoord, depth);`:""} + ${t.hasColorTexture?w` + vec4 texColor = texture(tex, ${t.hasColorTextureTransform?w`colorUV`:w`vuv0`}); + ${t.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""} + discardOrAdjustAlpha(texColor);`:w`vec4 texColor = vec4(1.0);`} + vec3 viewDirection = normalize(vpos - cameraPosition); + ${t.pbrMode===et.Normal?"applyPBRFactors();":""} + float ssao = evaluateAmbientOcclusionInverse(); + ssao *= getBakedOcclusion(); + + float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin); + vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; + ${t.receiveShadows?"float shadow = readShadowMap(vpos, linearDepth);":t.spherical?"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);":"float shadow = 0.0;"} + vec3 matColor = max(ambient, diffuse); + ${t.hasVertexColors?w` + vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); + float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:w` + vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); + float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`} + ${t.snowCover?w`albedo = mix(albedo, vec3(1), 0.9);`:w``} + ${w` + vec3 shadingNormal = normalize(vNormalWorld); + albedo *= 1.2; + vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]); + float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0); + float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0); + float treeRadialFalloff = vColor.r; + float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow); + additionalLight += backLightFactor * mainLightIntensity;`} + ${t.pbrMode===et.Normal||t.pbrMode===et.Schematic?t.spherical?w`vec3 normalGround = normalize(vpos + localOrigin);`:w`vec3 normalGround = vec3(0.0, 0.0, 1.0);`:w``} + ${t.pbrMode===et.Normal||t.pbrMode===et.Schematic?w` + float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2]; + ${t.snowCover?w` + mrr = vec3(0.0, 1.0, 0.04); + emission = vec3(0.0);`:""} + + vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:w`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`} + fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos); + ${t.transparencyPassType===rt.Color?w`fragColor = premultiplyAlpha(fragColor);`:w``} + } + `)),e.include(T3e,t),e}const nat=Object.freeze(Object.defineProperty({__proto__:null,build:iat},Symbol.toStringTag,{value:"Module"}));let A3e=class O3e extends HJ{initializeConfiguration(e,r){super.initializeConfiguration(e,r),r.hasMetallicRoughnessTexture=!1,r.hasEmissionTexture=!1,r.hasOcclusionTexture=!1,r.hasNormalTexture=!1,r.hasModelTransformation=!1,r.normalType=br.Attribute,r.doubleSidedMode=Zi.WindingOrder,r.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,O3e.shader)}};A3e.shader=new _r(nat,()=>ce(()=>import("./RealisticTree.glsl-2623185f.js"),[]));let tm=class extends p1{constructor(e){super(e,aat),this.supportsEdges=!0,this._configuration=new kt,this._vertexBufferLayout=lat(this.parameters)}isVisibleForOutput(e){return e!==D.Shadow&&e!==D.ShadowExcludeHighlight&&e!==D.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||e.layerOpacity===0)return!1;const{hasInstancedColor:r,hasVertexColors:i,hasSymbolColors:n,vvColor:s}=e,o=e.colorMixMode==="replace",a=e.opacity>0,l=e.externalColor&&e.externalColor[3]>0,c=r||s||n;return i&&c?o||a:i?o?l:a:c?o||a:o?l:a}getConfiguration(e,r){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=this.parameters.verticalOffset!=null,this._configuration.hasScreenSizePerspective=this.parameters.screenSizePerspective!=null,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this.parameters.customDepthTest!=null&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?ui.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=r.multipassTerrain.enabled,this._configuration.cullAboveGround=r.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=this.parameters.modelTransformation!=null,e!==D.Color&&e!==D.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Zi.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&this.parameters.doubleSidedType==="normal"?Zi.View:this.parameters.doubleSided&&this.parameters.doubleSidedType==="winding-order"?Zi.WindingOrder:Zi.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!r.ssaoHelper.active&&this.parameters.receiveSSAO,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?et.Schematic:et.Normal:et.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=r.transparencyPassType,this._configuration.enableOffset=r.camera.relativeElevation{const u=r(c);u!=null&&u.layerOpacityChanged(o,this._context.isAsync)})}layerElevationInfoChanged(e,r){return this.updateGraphics3DGraphicElevationInfo(e,r,K_)}slicePlaneEnabledChanged(e,r){return this._material.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._bottomMaterial.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),e.forEach(i=>{const n=r(i);n!=null&&n.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){return this._material.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),this._bottomMaterial.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}_getExtrusionSize(e){let r;return r=e.size&&this._drivenProperties.size?Unt(e.size,2)??0:this._getSymbolSize(),r/=this._context.renderCoordsHelper.unitInMeters,r}applyRendererDiff(e,r){return this._drivenPropertiesChanged(r)?$n.RecreateSymbol:$n.RecreateGraphics}async queryForSnapping(e,r,i,n){const s=this._getExtrusionSize(i)*this._context.renderCoordsHelper.unitInMeters/FV(r),{objectId:o,target:a}=e,l=ye(a);switch(l.z=(l.z??0)+s,e.type){case"edge":{const{start:c,end:u}=e,d=ye(c),p=ye(u);return d.z=(d.z??0)+s,p.z=(p.z??0)+s,[eae(o,l,1/0,d,p)]}case"vertex":return[Snt(o,l,1/0),eae(o,a,1/0,a,l)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(e,r,i,n,s){const o=FR(e.geometry);if(o==null)return null;if(o.rings.length===0||!o.rings.some(P=>P.length>0))return this._logGeometryValidationWarnings(o.rings,"rings","ExtrudeSymbol3DLayer"),null;const a=VJ(o,this._context.elevationProvider,this._context.renderCoordsHelper,n);this._logGeometryCreationWarnings(a,o.rings,"rings","ExtrudeSymbol3DLayer");const l=hJ(o);if(l==null)return null;const c=new Array,u=new Array,d=ps(),p=_e(),m=O(),y=this._context.renderCoordsHelper.viewingMode===$e.Global;y||this._context.renderCoordsHelper.worldUpAtPosition(null,m),ma(o.spatialReference,[l.x,l.y,0],p,this._context.renderCoordsHelper.spatialReference);const _=_e();us(_,p);const v=hi();Qf(v,_);const{polygons:b,mapPositions:x,position:T}=a;for(const P of b){const F=P.count;if(this._context.clippingExtent&&(vi(d),lu(d,P.mapPositions),!Hd(d,this._context.clippingExtent)))continue;const k=QS(P.mapPositions,P.holeIndices,3);if(k.length===0)continue;const V=k.length,z=6*F,X=u5(z+V),q=u5(V),G=Ys(3*z),Q=Ys(3*z),M=Ys(3*z),I=Ys(z);mat(T,x,k,P,G,M,Q,I,X,q,this._getExtrusionSize(r),m,y),gp(G,G,_);const L=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:s,layerUid:this._context.layer.uid}),B=new bat(G,M,Fot(Q),I);c.push(Uae(this._material,X,X.length-q.length,B,i,L),Uae(this._bottomMaterial,q,0,B,i,L)),u.push(B.heights)}if(c.length===0)return null;const S=new h0({geometries:c,layerUid:this._context.layer.uid,graphicUid:s,isElevationSource:!0});S.transformation=p;const A=UEe(this.symbolLayer,{opacity:this._getLayerOpacity()}),C=A!=null?{baseMaterial:this._material,edgeMaterials:[A],properties:{mergeGeometries:!0,hasSlicePlane:this._context.slicePlaneEnabled}}:null,R=new um(this,S,c,null,null,(P,F,k,V,z)=>_at(P,F,k,V,z,u),n,C);return R.alignedSampledElevation=a.sampledElevation,R.needsElevationUpdates=K_(n.mode),R}};function Uae(t,e,r,i,n,s){const o=OE(e.length),a=[[E.POSITION,new Ue(i.positions,3,!0)],[E.NORMALCOMPRESSED,new Ue(i.normals,2,!0)],[E.COLOR,new Ue(n,4,!0)]],l=[[E.POSITION,e],[E.NORMALCOMPRESSED,e],[E.COLOR,o]];return new Xn(t,a,l,i.elevation,on.Mesh,s,r)}function mat(t,e,r,i,n,s,o,a,l,c,u,d,p){const m=r.length/3;let y=0,_=2*i.count;gat(t,e,i.index,i.count,r,0,m,n,s,o,a,l,c,_,u,d,p);let v=2*i.count;_=0,kae(n,s,a,o,y,i.pathLengths[0],i.count,v,l,_,u),v+=4*i.pathLengths[0],_+=2*i.pathLengths[0],y+=i.pathLengths[0];for(let b=1;b0?1:-1;let x=3*r,T=0,S=3*T,A=i,C=3*A;for(let F=0;F0?(p=n,y=n+o):(p=n,d=n+o)),yat(t,d,p,m,RC),vI(t,e,i,r,RC,_,d),vI(t,e,i,r,RC,v,p),vI(t,e,i,r,RC,b,m),vI(t,e,i,r,RC,x,y),l[c++]=_,l[c++]=b,l[c++]=x,l[c++]=_,l[c++]=x,l[c++]=v,d++,p++,m++,y++,_+=2,v+=2,b+=2,x+=2}const rz=O(),zae=O(),Bae=O(),Vae=O(),Gae=O();function yat(t,e,r,i,n){e*=3,r*=3,i*=3,ne(rz,t[e++],t[e++],t[e++]),ne(zae,t[r++],t[r++],t[r++]),ne(Bae,t[i++],t[i++],t[i++]),ae(Vae,zae,rz),ae(Gae,Bae,rz),ot(n,Gae,Vae),me(n,n)}const Ex=O();function _at(t,e,r,i,n,s){const o=t.stageObject,a=o.geometries,l=a.length,c=e.mode!=="absolute-height";let u=0;const d=o.transformation,p=wE(_e(),d);for(let m=0;m=R||Math.abs(Ex[1]-_[T+1])>=R||Math.abs(Ex[2]-_[T+2])>=R)&&(S=!0),b.offset+=3,T+=3}S&&(y.invalidateBoundingInfo(),o.geometryVertexAttrsUpdated(a[m]),a[m+1].invalidateBoundingInfo(),o.geometryVertexAttrsUpdated(a[m+1])),u+=A/x}return u/l}const zl=O(),cl=O(),bI=new qP,jae=[0,2,1],Hae=[0,1,2],vat=.01;let bat=class{constructor(e,r,i,n){this.positions=e,this.elevation=r,this.normals=i,this.heights=n}};function B8(){const t=new Float32Array(16);return t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function wat(t){const e=new Float32Array(16);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[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function xat(t,e,r,i,n,s,o,a,l,c,u,d,p,m,y,_){const v=new Float32Array(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=i,v[4]=n,v[5]=s,v[6]=o,v[7]=a,v[8]=l,v[9]=c,v[10]=u,v[11]=d,v[12]=p,v[13]=m,v[14]=y,v[15]=_,v}function Tat(t,e){return new Float32Array(t,e,16)}const Sat=B8();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:Sat,clone:wat,create:B8,createView:Tat,fromValues:xat},Symbol.toStringTag,{value:"Module"}));const Eat=(t,e)=>{const r=am(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1);return Sc(r,r)},Cat=(t,e)=>{const r=am(t,e,0,0,.5-.5*e,0,e,0,.5-.5*e,0,0,e,.5-.5*e,0,0,0,1);return Sc(r,r)},Aat=(t,e)=>{const r=1-e,i=am(t,.2126+.7874*r,.7152-.7152*r,.0722-.0722*r,0,.2126-.2126*r,.7152+.2848*r,.0722-.0722*r,0,.2126-.2126*r,.7152-.7152*r,.0722+.9278*r,0,0,0,0,1);return Sc(i,i)},Oat=(t,e)=>{const r=Math.sin(e*Math.PI/180),i=Math.cos(e*Math.PI/180),n=am(t,.213+.787*i-.213*r,.715-.715*i-.715*r,.072-.072*i+.928*r,0,.213-.213*i+.143*r,.715+.285*i+.14*r,.072-.072*i-.283*r,0,.213-.213*i-.787*r,.715-.715*i+.715*r,.072+.928*i+.072*r,0,0,0,0,1);return Sc(n,n)},Rat=(t,e)=>{const r=1-2*e,i=am(t,r,0,0,e,0,r,0,e,0,0,r,e,0,0,0,1);return Sc(i,i)},Pat=(t,e)=>{const r=am(t,.213+.787*e,.715-.715*e,.072-.072*e,0,.213-.213*e,.715+.285*e,.072-.072*e,0,.213-.213*e,.715-.715*e,.072+.928*e,0,0,0,0,1);return Sc(r,r)},Mat=(t,e)=>{const r=1-e,i=am(t,.393+.607*r,.769-.769*r,.189-.189*r,0,.349-.349*r,.686+.314*r,.168-.168*r,0,.272-.272*r,.534-.534*r,.131+.869*r,0,0,0,0,1);return Sc(i,i)};let R3e=class P3e{constructor(e,r,i){this.strength=e,this.radius=r,this.threshold=i,this.type="bloom"}interpolate(e,r,i){this.strength=ac(e.strength,r.strength,i),this.radius=ac(e.radius,r.radius,i),this.threshold=ac(e.threshold,r.threshold,i)}clone(){return new P3e(this.strength,this.radius,this.threshold)}toJSON(){return{type:"bloom",radius:gO(this.radius),strength:this.strength,threshold:this.threshold}}},M3e=class $3e{constructor(e){this.radius=e,this.type="blur"}interpolate(e,r,i){this.radius=Math.round(ac(e.radius,r.radius,i))}clone(){return new $3e(this.radius)}toJSON(){return{type:"blur",radius:gO(this.radius)}}},tW=class I3e{constructor(e,r){this.type=e,this.amount=r,this.type!=="invert"&&this.type!=="grayscale"&&this.type!=="sepia"||(this.amount=Math.min(this.amount,1))}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(e,r,i){this.amount=ac(e.amount,r.amount,i),this._updateMatrix()}clone(){return new I3e(this.type,this.amount)}toJSON(){return{type:this.type,amount:this.amount}}_updateMatrix(){const e=this._colorMatrix||B8();switch(this.type){case"brightness":this._colorMatrix=Eat(e,this.amount);break;case"contrast":this._colorMatrix=Cat(e,this.amount);break;case"grayscale":this._colorMatrix=Aat(e,this.amount);break;case"invert":this._colorMatrix=Rat(e,this.amount);break;case"saturate":this._colorMatrix=Pat(e,this.amount);break;case"sepia":this._colorMatrix=Mat(e,this.amount)}}},L3e=class D3e{constructor(e,r,i,n){this.offsetX=e,this.offsetY=r,this.blurRadius=i,this.color=n,this.type="drop-shadow"}interpolate(e,r,i){this.offsetX=ac(e.offsetX,r.offsetX,i),this.offsetY=ac(e.offsetY,r.offsetY,i),this.blurRadius=ac(e.blurRadius,r.blurRadius,i),this.color[0]=Math.round(ac(e.color[0],r.color[0],i)),this.color[1]=Math.round(ac(e.color[1],r.color[1],i)),this.color[2]=Math.round(ac(e.color[2],r.color[2],i)),this.color[3]=ac(e.color[3],r.color[3],i)}clone(){return new D3e(this.offsetX,this.offsetY,this.blurRadius,[...this.color])}toJSON(){const e=[...this.color];return e[3]*=255,{type:"drop-shadow",xoffset:gO(this.offsetX),yoffset:gO(this.offsetY),blurRadius:gO(this.blurRadius),color:e}}},N3e=class F3e{constructor(e){this.angle=e,this.type="hue-rotate"}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(e,r,i){this.angle=ac(e.angle,r.angle,i),this._updateMatrix()}clone(){return new F3e(this.angle)}toJSON(){return{type:"hue-rotate",angle:this.angle}}_updateMatrix(){const e=this._colorMatrix||B8();this._colorMatrix=Oat(e,this.angle)}},U3e=class k3e{constructor(e){this.amount=e,this.type="opacity",this.amount=Math.min(this.amount,1)}interpolate(e,r,i){this.amount=ac(e.amount,r.amount,i)}clone(){return new k3e(this.amount)}toJSON(){return{type:"opacity",amount:this.amount}}};function ac(t,e,r){return t+(e-t)*r}function gO(t){return Math.round(1e3*up(t))/1e3}function $at(t){switch(t.type){case"grayscale":case"sepia":case"invert":return new tW(t.type,0);case"saturate":case"brightness":case"contrast":return new tW(t.type,1);case"opacity":return new U3e(1);case"hue-rotate":return new N3e(0);case"blur":return new M3e(0);case"drop-shadow":return new L3e(0,0,0,[...iY("transparent")]);case"bloom":return new R3e(0,0,1)}}function Iat(t,e){const r=t.length>e.length?t:e;return(t.length>e.length?e:t).every((i,n)=>i.type===r[n].type)}function Lat(t,e){const r=t.length>e.length?t:e,i=t.length>e.length?e:t;for(let n=i.length;ns?n:(s-=n.length,n+(o+=o.repeat(s)).slice(0,s))}function i(n,s){var o,a={},l=(s=s!==void 0?s:{}).grammarSource,c={start:pm},u=pm,d="none",p=")",m=",",y="(",_="%",v="px",b="cm",x="mm",T="in",S="pt",A="pc",C="deg",R="rad",P="grad",F="turn",k="#",V=".",z="e",X=/^[ \t\n\r]/,q=/^[a-z\-]/,G=/^[0-9a-fA-F]/,Q=/^[+\-]/,M=/^[0-9]/,I=rl("none"),L=Ps("none",!1),B=Ps(")",!1),H=Ps(",",!1),Z=rl("whitespace"),K=g1([" "," ",` +`,"\r"],!1,!1),de=rl("function"),Re=Ps("(",!1),Ke=rl("identifier"),_t=g1([["a","z"],"-"],!1,!1),at=rl("percentage"),yt=Ps("%",!1),Fe=rl("length"),pe=Ps("px",!1),xt=Ps("cm",!1),vt=Ps("mm",!1),Ee=Ps("in",!1),Be=Ps("pt",!1),Ve=Ps("pc",!1),pt=rl("angle"),ut=Ps("deg",!1),ar=Ps("rad",!1),Ge=Ps("grad",!1),ft=Ps("turn",!1),cr=rl("number"),nt=rl("color"),ht=Ps("#",!1),mt=g1([["0","9"],["a","f"],["A","F"]],!1,!1),Mt=g1(["+","-"],!1,!1),Ut=g1([["0","9"]],!1,!1),bi=Ps(".",!1),Fr=Ps("e",!1),di=function(){return[]},Dt=function(j,he){return{type:"function",name:j,parameters:he||[]}},ei=function(j,he){return he.length>0?zE(j,he,3):[j]},Rr=function(j){return{type:"quantity",value:j.value,unit:j.unit}},qr=function(j){return{type:"color",colorType:j.type,value:j.value}},Sr=function(j){return j},wi=function(){return Nl()},$r=function(j){return{value:j,unit:"%"}},ti=function(j){return{value:j,unit:"px"}},Xr=function(j){return{value:j,unit:"cm"}},ur=function(j){return{value:j,unit:"mm"}},ri=function(j){return{value:j,unit:"in"}},Ii=function(j){return{value:j,unit:"pt"}},Ks=function(j){return{value:j,unit:"pc"}},eo=function(j){return{value:j,unit:"deg"}},to=function(j){return{value:j,unit:"rad"}},ro=function(j){return{value:j,unit:"grad"}},ji=function(j){return{value:j,unit:"turn"}},Li=function(j){return{value:j,unit:null}},Ur=function(){return{type:"hex",value:Nl()}},Os=function(j){return{type:"function",value:j}},Co=function(){return{type:"named",value:Nl()}},ba=function(){return parseFloat(Nl())},ie=0,xi=0,qh=[{line:1,column:1}],Rs=0,Xh=[],Ze=0;if("startRule"in s){if(!(s.startRule in c))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');u=c[s.startRule]}function Nl(){return n.substring(xi,ie)}function Ps(j,he){return{type:"literal",text:j,ignoreCase:he}}function g1(j,he,we){return{type:"class",parts:j,inverted:he,ignoreCase:we}}function y1(){return{type:"end"}}function rl(j){return{type:"other",description:j}}function dm(j){var he,we=qh[j];if(we)return we;for(he=j-1;!qh[he];)he--;for(we={line:(we=qh[he]).line,column:we.column};heRs&&(Rs=ie,Xh=[]),Xh.push(j))}function d0(j,he,we){return new e(e.buildMessage(j,he),j,he,we)}function pm(){var j;return(j=p0())===a&&(j=wa()),j}function p0(){var j,he;return Ze++,j=ie,Qi(),n.substr(ie,4)===d?(he=d,ie+=4):(he=a,Ze===0&&qt(L)),he!==a?(Qi(),xi=j,j=di()):(ie=j,j=a),Ze--,j===a&&Ze===0&&qt(I),j}function wa(){var j,he;if(j=[],(he=Fl())!==a)for(;he!==a;)j.push(he),he=Fl();else j=a;return j}function Fl(){var j,he,we,nr;return j=ie,Qi(),(he=f0())!==a?(Qi(),(we=Tp())===a&&(we=null),Qi(),n.charCodeAt(ie)===41?(nr=p,ie++):(nr=a,Ze===0&&qt(B)),nr!==a?(Qi(),xi=j,j=Dt(he,we)):(ie=j,j=a)):(ie=j,j=a),j}function Tp(){var j,he,we,nr,Vn,pi,xa,x1;if(j=ie,(he=Ms())!==a){for(we=[],nr=ie,Vn=Qi(),n.charCodeAt(ie)===44?(pi=m,ie++):(pi=a,Ze===0&&qt(H)),pi===a&&(pi=null),xa=Qi(),(x1=Ms())!==a?nr=Vn=[Vn,pi,xa,x1]:(ie=nr,nr=a);nr!==a;)we.push(nr),nr=ie,Vn=Qi(),n.charCodeAt(ie)===44?(pi=m,ie++):(pi=a,Ze===0&&qt(H)),pi===a&&(pi=null),xa=Qi(),(x1=Ms())!==a?nr=Vn=[Vn,pi,xa,x1]:(ie=nr,nr=a);xi=j,j=ei(he,we)}else ie=j,j=a;return j}function Ms(){var j,he;return j=ie,(he=b1())===a&&(he=Xw())===a&&(he=w1())===a&&(he=m0()),he!==a&&(xi=j,he=Rr(he)),(j=he)===a&&(j=ie,(he=hM())!==a&&(xi=j,he=qr(he)),j=he),j}function Qi(){var j,he;for(Ze++,j=[],X.test(n.charAt(ie))?(he=n.charAt(ie),ie++):(he=a,Ze===0&&qt(K));he!==a;)j.push(he),X.test(n.charAt(ie))?(he=n.charAt(ie),ie++):(he=a,Ze===0&&qt(K));return Ze--,he=a,Ze===0&&qt(Z),j}function f0(){var j,he,we;return Ze++,j=ie,(he=v1())!==a?(n.charCodeAt(ie)===40?(we=y,ie++):(we=a,Ze===0&&qt(Re)),we!==a?(xi=j,j=Sr(he)):(ie=j,j=a)):(ie=j,j=a),Ze--,j===a&&(he=a,Ze===0&&qt(de)),j}function v1(){var j,he,we;if(Ze++,j=ie,he=[],q.test(n.charAt(ie))?(we=n.charAt(ie),ie++):(we=a,Ze===0&&qt(_t)),we!==a)for(;we!==a;)he.push(we),q.test(n.charAt(ie))?(we=n.charAt(ie),ie++):(we=a,Ze===0&&qt(_t));else he=a;return he!==a&&(xi=j,he=wi()),Ze--,(j=he)===a&&(he=a,Ze===0&&qt(Ke)),j}function b1(){var j,he,we;return Ze++,j=ie,Qi(),(he=il())!==a?(n.charCodeAt(ie)===37?(we=_,ie++):(we=a,Ze===0&&qt(yt)),we!==a?(xi=j,j=$r(he)):(ie=j,j=a)):(ie=j,j=a),Ze--,j===a&&Ze===0&&qt(at),j}function Xw(){var j,he,we;return Ze++,j=ie,Qi(),(he=il())!==a?(n.substr(ie,2)===v?(we=v,ie+=2):(we=a,Ze===0&&qt(pe)),we!==a?(xi=j,j=ti(he)):(ie=j,j=a)):(ie=j,j=a),j===a&&(j=ie,Qi(),(he=il())!==a?(n.substr(ie,2)===b?(we=b,ie+=2):(we=a,Ze===0&&qt(xt)),we!==a?(xi=j,j=Xr(he)):(ie=j,j=a)):(ie=j,j=a),j===a&&(j=ie,Qi(),(he=il())!==a?(n.substr(ie,2)===x?(we=x,ie+=2):(we=a,Ze===0&&qt(vt)),we!==a?(xi=j,j=ur(he)):(ie=j,j=a)):(ie=j,j=a),j===a&&(j=ie,Qi(),(he=il())!==a?(n.substr(ie,2)===T?(we=T,ie+=2):(we=a,Ze===0&&qt(Ee)),we!==a?(xi=j,j=ri(he)):(ie=j,j=a)):(ie=j,j=a),j===a&&(j=ie,Qi(),(he=il())!==a?(n.substr(ie,2)===S?(we=S,ie+=2):(we=a,Ze===0&&qt(Be)),we!==a?(xi=j,j=Ii(he)):(ie=j,j=a)):(ie=j,j=a),j===a&&(j=ie,Qi(),(he=il())!==a?(n.substr(ie,2)===A?(we=A,ie+=2):(we=a,Ze===0&&qt(Ve)),we!==a?(xi=j,j=Ks(he)):(ie=j,j=a)):(ie=j,j=a)))))),Ze--,j===a&&Ze===0&&qt(Fe),j}function w1(){var j,he,we;return Ze++,j=ie,(he=il())!==a?(n.substr(ie,3)===C?(we=C,ie+=3):(we=a,Ze===0&&qt(ut)),we!==a?(xi=j,j=eo(he)):(ie=j,j=a)):(ie=j,j=a),j===a&&(j=ie,(he=il())!==a?(n.substr(ie,3)===R?(we=R,ie+=3):(we=a,Ze===0&&qt(ar)),we!==a?(xi=j,j=to(he)):(ie=j,j=a)):(ie=j,j=a),j===a&&(j=ie,(he=il())!==a?(n.substr(ie,4)===P?(we=P,ie+=4):(we=a,Ze===0&&qt(Ge)),we!==a?(xi=j,j=ro(he)):(ie=j,j=a)):(ie=j,j=a),j===a&&(j=ie,(he=il())!==a?(n.substr(ie,4)===F?(we=F,ie+=4):(we=a,Ze===0&&qt(ft)),we!==a?(xi=j,j=ji(he)):(ie=j,j=a)):(ie=j,j=a)))),Ze--,j===a&&(he=a,Ze===0&&qt(pt)),j}function m0(){var j,he;return Ze++,j=ie,Qi(),(he=il())!==a?(xi=j,j=Li(he)):(ie=j,j=a),Ze--,j===a&&Ze===0&&qt(cr),j}function hM(){var j,he,we,nr;if(Ze++,j=ie,n.charCodeAt(ie)===35?(he=k,ie++):(he=a,Ze===0&&qt(ht)),he!==a){if(we=[],G.test(n.charAt(ie))?(nr=n.charAt(ie),ie++):(nr=a,Ze===0&&qt(mt)),nr!==a)for(;nr!==a;)we.push(nr),G.test(n.charAt(ie))?(nr=n.charAt(ie),ie++):(nr=a,Ze===0&&qt(mt));else we=a;we!==a?(xi=j,j=Ur()):(ie=j,j=a)}else ie=j,j=a;return j===a&&(j=ie,(he=Fl())!==a&&(xi=j,he=Os(he)),(j=he)===a&&(j=ie,(he=v1())!==a&&(xi=j,he=Co()),j=he)),Ze--,j===a&&(he=a,Ze===0&&qt(nt)),j}function il(){var j,he,we,nr,Vn,pi,xa;for(j=ie,Q.test(n.charAt(ie))?(n.charAt(ie),ie++):Ze===0&&qt(Mt),he=ie,we=[],M.test(n.charAt(ie))?(nr=n.charAt(ie),ie++):(nr=a,Ze===0&&qt(Ut));nr!==a;)we.push(nr),M.test(n.charAt(ie))?(nr=n.charAt(ie),ie++):(nr=a,Ze===0&&qt(Ut));if(n.charCodeAt(ie)===46?(nr=V,ie++):(nr=a,Ze===0&&qt(bi)),nr!==a){if(Vn=[],M.test(n.charAt(ie))?(pi=n.charAt(ie),ie++):(pi=a,Ze===0&&qt(Ut)),pi!==a)for(;pi!==a;)Vn.push(pi),M.test(n.charAt(ie))?(pi=n.charAt(ie),ie++):(pi=a,Ze===0&&qt(Ut));else Vn=a;Vn!==a?he=we=[we,nr,Vn]:(ie=he,he=a)}else ie=he,he=a;if(he===a)if(he=[],M.test(n.charAt(ie))?(we=n.charAt(ie),ie++):(we=a,Ze===0&&qt(Ut)),we!==a)for(;we!==a;)he.push(we),M.test(n.charAt(ie))?(we=n.charAt(ie),ie++):(we=a,Ze===0&&qt(Ut));else he=a;if(he!==a){if(we=ie,n.charCodeAt(ie)===101?(nr=z,ie++):(nr=a,Ze===0&&qt(Fr)),nr!==a){if(Q.test(n.charAt(ie))?(Vn=n.charAt(ie),ie++):(Vn=a,Ze===0&&qt(Mt)),Vn===a&&(Vn=null),pi=[],M.test(n.charAt(ie))?(xa=n.charAt(ie),ie++):(xa=a,Ze===0&&qt(Ut)),xa!==a)for(;xa!==a;)pi.push(xa),M.test(n.charAt(ie))?(xa=n.charAt(ie),ie++):(xa=a,Ze===0&&qt(Ut));else pi=a;pi!==a?we=nr=[nr,Vn,pi]:(ie=we,we=a)}else ie=we,we=a;we===a&&(we=null),xi=j,j=ba()}else ie=j,j=a;return j}function kE(j,he){return j.map(function(we){return we[he]})}function zE(j,he,we){return[j].concat(kE(he,we))}if((o=u())!==a&&ie===n.length)return o;throw o!==a&&ie `+u+` +`+p+` | +`+c.line+" | "+m+` +`+p+" | "+r("",l.column-1," ")+r("",y,"^")}else s+=` + at `+u}return s},e.buildMessage=function(n,s){var o={literal:function(m){return'"'+l(m.text)+'"'},class:function(m){var y=m.parts.map(function(_){return Array.isArray(_)?c(_[0])+"-"+c(_[1]):c(_)});return"["+(m.inverted?"^":"")+y.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(m){return m.description}};function a(m){return m.charCodeAt(0).toString(16).toUpperCase()}function l(m){return m.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(y){return"\\x0"+a(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+a(y)})}function c(m){return m.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(y){return"\\x0"+a(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+a(y)})}function u(m){return o[m.type](m)}function d(m){var y,_,v=m.map(u);if(v.sort(),v.length>0){for(y=1,_=1;y{if(!Number.isFinite(r.scale)||r.scale<=0)throw new Y("effect:invalid-scale","scale must be finite and greater than 0",{stop:r});return{scale:r.scale,effects:Xae(r.value)}});e.sort((r,i)=>i.effects.length-r.effects.length);for(let r=0;ri.scale-r.scale),e}function Xae(t){let e;if(!t)return[];try{e=Nat.parse(t)}catch(r){throw new Y("effect:invalid-syntax","Invalid effect syntax",{value:t,error:r})}return e.map(r=>Fat(r))}function Fat(t){try{switch(t.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return Uat(t);case"opacity":return kat(t);case"hue-rotate":return zat(t);case"blur":return Bat(t);case"drop-shadow":return Vat(t);case"bloom":return Gat(t)}}catch(e){throw e.details.filter=t,e}throw new Y("effect:unknown-effect",`Effect '${t.name}' is not supported`,{effect:t})}function Uat(t){let e=1;return FE(t.parameters,1),t.parameters.length===1&&(e=Dd(t.parameters[0])),new tW(t.name,e)}function kat(t){let e=1;return FE(t.parameters,1),t.parameters.length===1&&(e=Dd(t.parameters[0])),new U3e(e)}function zat(t){let e=0;return FE(t.parameters,1),t.parameters.length===1&&(e=Yat(t.parameters[0])),new N3e(e)}function Bat(t){let e=0;return FE(t.parameters,1),t.parameters.length===1&&(e=XJ(t.parameters[0]),eM(e,t.parameters[0])),new M3e(e)}function Vat(t){const e=[];let r=null;for(const i of t.parameters)if(i.type==="color"){if(e.length&&Object.freeze(e),r)throw new Y("effect:type-error","Accepts only one color",{});r=Zat(i)}else{const n=XJ(i);if(Object.isFrozen(e))throw new Y("effect:type-error"," parameters not consecutive",{lengths:e});e.push(n),e.length===3&&eM(n,i)}if(e.length<2||e.length>3)throw new Y("effect:type-error",`Expected {2,3}, Actual: {${e.length}}`,{lengths:e});return new L3e(e[0],e[1],e[2]||0,r||B3e("black"))}function Gat(t){let e=1,r=0,i=0;return FE(t.parameters,3),t.parameters[0]&&(e=Dd(t.parameters[0])),t.parameters[1]&&(r=XJ(t.parameters[1]),eM(r,t.parameters[1])),t.parameters[2]&&(i=Dd(t.parameters[2])),new R3e(e,r,i)}function FE(t,e){if(t.length>e)throw new Y("effect:type-error",`Function supports up to ${e} parameters, Actual: ${t.length}`,{parameters:t})}function V8(t){if(t.type==="color")return"";if(t.unit){if(t.unit in qJ)return"";if(t.unit in WJ)return"";if(t.unit==="%")return""}return""}function eM(t,e){if(t<0)throw new Y("effect:type-error",`Negative values are not allowed, Actual: ${t}`,{term:e})}function jat(t){if(t.type!=="quantity"||t.unit!==null)throw new Y("effect:type-error",`Expected , Actual: ${V8(t)}`,{term:t})}function Hat(t){if(t.type!=="quantity"||t.unit!==null&&t.unit!=="%")throw new Y("effect:type-error",`Expected or , Actual: ${V8(t)}`,{term:t})}const WJ={deg:1,grad:.9,rad:180/Math.PI,turn:360};function Wat(t){if(t.type!=="quantity"||!(t.value===0&&t.unit===null||t.unit&&WJ[t.unit]!=null))throw new Y("effect:type-error",`Expected , Actual: ${V8(t)}`,{term:t})}const qJ={px:1,cm:96/2.54,mm:96/2.54/10,in:96,pc:16,pt:96/72};function qat(t){if(t.type!=="quantity"||!(t.value===0&&t.unit===null||t.unit&&qJ[t.unit]!=null))throw new Y("effect:type-error",`Expected , Actual: ${V8(t)}`,{term:t})}function Dd(t){Hat(t);const e=t.value;return eM(e,t),t.unit==="%"?.01*e:e}function Xat(t){return jat(t),eM(t.value,t),t.value}function Yat(t){return Wat(t),t.value*WJ[t.unit]||0}function XJ(t){return qat(t),t.value*qJ[t.unit]||0}function Zat(t){switch(t.colorType){case"hex":return qFe(t.value);case"named":return B3e(t.value);case"function":return Kat(t.value)}}function B3e(t){if(!J0e(t))throw new Y("effect:unknown-color",`color '${t}' isn't valid`,{namedColor:t});return WFe(t)}const Qat=/^rgba?/i,Jat=/^hsla?/i;function Kat(t){if(FE(t.parameters,4),Qat.test(t.name))return[Dd(t.parameters[0]),Dd(t.parameters[1]),Dd(t.parameters[2]),t.parameters[3]?Dd(t.parameters[3]):1];if(Jat.test(t.name))return K0e(Xat(t.parameters[0]),Dd(t.parameters[1]),Dd(t.parameters[2]),t.parameters[3]?Dd(t.parameters[3]):1);throw new Y("effect:syntax-error",`Invalid color function '${t.name}'`,{colorFunction:t})}function elt(t,e,r){var i;try{return ilt(t)}catch(n){(i=r==null?void 0:r.messages)==null||i.push(n)}return null}function tlt(t,e,r,i){try{const n=rlt(t);Pw(r,n,e)}catch(n){i.messages&&i.messages.push(n)}}function rlt(t){const e=z3e(t);return e?Dat(e)?e.map(r=>r.toJSON()):e.map(({scale:r,effects:i})=>({scale:r,value:i.map(n=>n.toJSON())})):null}function ilt(t){if(!t||t.length===0)return null;if(nlt(t)){const e=[];for(const r of t)e.push({scale:r.scale,value:Yae(r.value)});return e}return Yae(t)}function nlt(t){const e=t[0];return!!e&&"scale"in e}function Yae(t){if(!t||!t.length)return"";const e=[];for(const r of t){let i=[];switch(r.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":i=[wm(r,"amount")];break;case"blur":i=[wm(r,"radius","pt")];break;case"hue-rotate":i=[wm(r,"angle","deg")];break;case"drop-shadow":i=[wm(r,"xoffset","pt"),wm(r,"yoffset","pt"),wm(r,"blurRadius","pt"),slt(r,"color")];break;case"bloom":i=[wm(r,"strength"),wm(r,"radius","pt"),wm(r,"threshold")]}const n=`${r.type}(${i.filter(Boolean).join(" ")})`;z3e(n),e.push(n)}return e.join(" ")}function wm(t,e,r){if(t[e]==null)throw new Y("effect:missing-parameter",`Missing parameter '${e}' in ${t.type} effect`,{effect:t});return r?t[e]+r:""+t[e]}function slt(t,e){if(t[e]==null)throw new Y("effect:missing-parameter",`Missing parameter '${e}' in ${t.type} effect`,{effect:t});const r=t[e];return`rgba(${r[0]||0}, ${r[1]||0}, ${r[2]||0}, ${r[3]/255||0})`}function olt(t){return typeof t=="function"}function bNt(t,e,r,i){return olt(t)?t(e,r,i):t}function wNt(t){return[t.r,t.g,t.b,t.a]}const alt=` /-, +`;function Zae(t){let e=t.length;for(;e--;)if(!alt.includes(t.charAt(e)))return!1;return!0}function llt(t,e){const r=[];let i=0,n=-1;do if(n=t.indexOf("[",i),n>=i){if(n>i){const s=t.substr(i,n-i);r.push([s,null,Zae(s)])}if(i=n+1,n=t.indexOf("]",i),n>=i){if(n>i){const s=e[t.substr(i,n-i)];s&&r.push([null,s,!1])}i=n+1}}while(n!==-1);if(iclt(n,i,r)}function ult(t,e){switch(typeof t!="string"&&(t=String(t)),e){case"LowerCase":return t.toLowerCase();case"Allcaps":return t.toUpperCase();default:return t}}function TNt(t,e,r,i,n,s,o=!0){const a=e/n,l=r/s,c=Math.ceil(a/2),u=Math.ceil(l/2);for(let d=0;d=-1&&z<=1&&(y=2*z*z*z-3*z*z+1,y>0&&(V=4*(k+C*e),S+=y*t[V+3],v+=y,t[V+3]<255&&(y=y*t[V+3]/250),b+=y*t[V],x+=y*t[V+1],T+=y*t[V+2],_+=y))}}i[m]=b/_,i[m+1]=x/_,i[m+2]=T/_,i[m+3]=S/v}}function V3e(t){return t?{r:t[0],g:t[1],b:t[2],a:t[3]/255}:{r:0,g:0,b:0,a:0}}function hlt(t){var e;return((e=t.data)==null?void 0:e.symbol)??null}function dlt(t){return t.type==="CIMVectorMarker"||t.type==="CIMPictureMarker"||t.type==="CIMBarChartMarker"||t.type==="CIMCharacterMarker"||t.type==="CIMPieChartMarker"||t.type==="CIMStackedBarChartMarker"}function plt(t){return t.type==="CIMGradientStroke"||t.type==="CIMPictureStroke"||t.type==="CIMSolidStroke"}function G3e(t){return t!=null&&(t.type==="CIMMarkerPlacementAlongLineRandomSize"||t.type==="CIMMarkerPlacementAlongLineSameSize"||t.type==="CIMMarkerPlacementAlongLineVariableSize"||t.type==="CIMMarkerPlacementAtExtremities"||t.type==="CIMMarkerPlacementAtMeasuredUnits"||t.type==="CIMMarkerPlacementAtRatioPositions"||t.type==="CIMMarkerPlacementOnLine"||t.type==="CIMMarkerPlacementOnVertices")}const SNt=(t,e=0)=>t==null||isNaN(t)?e:t,ENt=t=>t.tintColor?V3e(t.tintColor):{r:255,g:255,b:255,a:1},CNt=t=>{if(!t)return!1;for(const e of t)switch(e.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectOffset":case"CIMGeometricEffectDonut":return!0}return!1};function ANt(){return ce(()=>import("./geometryEngineJSON-c939b27e.js"),["assets/geometryEngineJSON-c939b27e.js","assets/geometryEngineBase-324c1c81.js","assets/geometryEngineJSON-b173802a.js","assets/json-48e3ea08.js"])}function ONt(t){if(!t)return"normal";switch(t.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function RNt(t){if(!t)return"normal";switch(t.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function PNt(t){let e="normal",r="normal";if(t){const i=t.toLowerCase();i.includes("italic")?e="italic":i.includes("oblique")&&(e="oblique"),i.includes("bold")?r="bold":i.includes("light")&&(r="lighter")}return{style:e,weight:r}}function MNt(t){return t.underline?"underline":t.strikethrough?"line-through":"none"}function Qae(t){if(!t)return null;switch(t.type){case"CIMPolygonSymbol":if(t.symbolLayers)for(const e of t.symbolLayers){const r=Qae(e);if(r!=null)return r}break;case"CIMTextSymbol":return Qae(t.symbol);case"CIMSolidFill":return t.color}}function Jae(t){if(t)switch(t.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const e=t.symbolLayers;if(e)for(const r of e){const i=Jae(r);if(i!=null)return i}break}case"CIMTextSymbol":return Jae(t.symbol);case"CIMSolidStroke":return t.color}}function Kae(t){if(t)switch(t.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(t.symbolLayers)for(const e of t.symbolLayers){const r=Kae(e);if(r!==void 0)return r}break;case"CIMTextSymbol":return Kae(t.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return t.width}}function $Nt(t){switch(t){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function INt(t){switch(t){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function LNt(t){return(t?Object.keys(t):[]).map(e=>({name:e,alias:e,type:typeof t[e]=="string"?"esriFieldTypeString":"esriFieldTypeDouble"}))}const DNt=t=>t.includes("data:image/svg+xml");function NNt(t){if(!t)return null;switch(t.type){case"CIMPointSymbol":case"CIMTextSymbol":return"esriGeometryPoint";case"CIMLineSymbol":return"esriGeometryPolyline";case"CIMPolygonSymbol":return"esriGeometryPolygon";default:return null}}function j3e(t,e,r,i){if(t)if(t.type!=="CIMTextSymbol"){if(r&&t.effects)for(const n of t.effects)glt(n,e);if(t.symbolLayers)for(const n of t.symbolLayers)switch(n.type){case"CIMPictureMarker":case"CIMVectorMarker":flt(n,e,i);break;case"CIMPictureStroke":case"CIMSolidStroke":!(i!=null&&i.preserveOutlineWidth)&&n.width&&(n.width*=e);break;case"CIMPictureFill":n.height&&(n.height*=e),n.offsetX&&(n.offsetX*=e),n.offsetY&&(n.offsetY*=e);break;case"CIMHatchFill":j3e(n.lineSymbol,e,!0,{...i,preserveOutlineWidth:!1}),n.offsetX&&(n.offsetX*=e),n.offsetY&&(n.offsetY*=e),n.separation&&(n.separation*=e)}}else t.height!=null&&(t.height*=e)}function flt(t,e,r){if(t&&(t.markerPlacement&&mlt(t.markerPlacement,e),t.offsetX&&(t.offsetX*=e),t.offsetY&&(t.offsetY*=e),t.anchorPoint&&t.anchorPointUnits==="Absolute"&&(t.anchorPoint={x:t.anchorPoint.x*e,y:t.anchorPoint.y*e}),t.size=t.size!=null?t.size*e:0,t.type==="CIMVectorMarker"&&t.markerGraphics))for(const i of t.markerGraphics)t.scaleSymbolsProportionally||j3e(i.symbol,e,!0,r)}function mlt(t,e){switch(G3e(t)&&t.offset&&(t.offset*=e),t.type){case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineSameSize":if(t.customEndingOffset&&(t.customEndingOffset*=e),t.offsetAlongLine&&(t.offsetAlongLine*=e),t.placementTemplate&&t.placementTemplate.length){const r=t.placementTemplate.map(i=>i*e);t.placementTemplate=r}break;case"CIMMarkerPlacementAlongLineVariableSize":if(t.maxRandomOffset&&(t.maxRandomOffset*=e),t.placementTemplate&&t.placementTemplate.length){const r=t.placementTemplate.map(i=>i*e);t.placementTemplate=r}break;case"CIMMarkerPlacementOnLine":t.startPointOffset&&(t.startPointOffset*=e);break;case"CIMMarkerPlacementAtExtremities":t.offsetAlongLine&&(t.offsetAlongLine*=e);break;case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementOnVertices":break;case"CIMMarkerPlacementAtRatioPositions":t.beginPosition&&(t.beginPosition*=e),t.endPosition&&(t.endPosition*=e);break;case"CIMMarkerPlacementPolygonCenter":t.offsetX&&(t.offsetX*=e),t.offsetY&&(t.offsetY*=e);break;case"CIMMarkerPlacementInsidePolygon":t.offsetX&&(t.offsetX*=e),t.offsetY&&(t.offsetY*=e),t.stepX&&(t.stepX*=e),t.stepY&&(t.stepY*=e)}}function glt(t,e){switch(t.type){case"CIMGeometricEffectArrow":case"CIMGeometricEffectDonut":t.width&&(t.width*=e);break;case"CIMGeometricEffectBuffer":t.size&&(t.size*=e);break;case"CIMGeometricEffectCut":t.beginCut&&(t.beginCut*=e),t.endCut&&(t.endCut*=e),t.middleCut&&(t.middleCut*=e);break;case"CIMGeometricEffectDashes":if(t.customEndingOffset&&(t.customEndingOffset*=e),t.offsetAlongLine&&(t.offsetAlongLine*=e),t.dashTemplate&&t.dashTemplate.length){const r=t.dashTemplate.map(i=>i*e);t.dashTemplate=r}break;case"CIMGeometricEffectExtension":case"CIMGeometricEffectJog":case"CIMGeometricEffectRadial":t.length&&(t.length*=e);break;case"CIMGeometricEffectMove":t.offsetX&&(t.offsetX*=e),t.offsetY&&(t.offsetY*=e);break;case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":t.offset&&(t.offset*=e);break;case"CIMGeometricEffectRegularPolygon":t.radius&&(t.radius*=e);break;case"CIMGeometricEffectTaperedPolygon":t.fromWidth&&(t.fromWidth*=e),t.length&&(t.length*=e),t.toWidth&&(t.toWidth*=e);break;case"CIMGeometricEffectWave":t.amplitude&&(t.amplitude*=e),t.period&&(t.period*=e)}}function ylt(t){const e=[];return iW(hlt(t),e),e.length?new it(V3e(e[0])):null}function iW(t,e){var n;if(!t)return;let r;r=t.type==="CIMTextSymbol"?t.symbol:t;const i=t.type==="CIMPolygonSymbol";if(r!=null&&r.symbolLayers){for(const s of r.symbolLayers)if(!(s.colorLocked||i&&(plt(s)||dlt(s)&&s.markerPlacement&&G3e(s.markerPlacement))))switch(s.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":s.tintColor&&ele(e,s.tintColor);break;case"CIMVectorMarker":(n=s.markerGraphics)==null||n.forEach(o=>{iW(o.symbol,e)});break;case"CIMSolidStroke":case"CIMSolidFill":ele(e,s.color);break;case"CIMHatchFill":iW(s.lineSymbol,e)}}}function ele(t,e){for(const r of t)if(r.join(".")===e.join("."))return;t.push(e)}let _lt=class{constructor(e,r){this._storage=new t3e,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),r&&this._storage.registerRemoveFunc("",r)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,r,i=1){this._storage.put(this,e,r,i,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}};new _lt(1e3);new it([128,128,128]);const vlt=new it("white");function blt(t){return sc(t.resource).href}function UNt(t,e){if(!t)return null;let r=null;return ow(t)?r=wlt(t):O6(t)&&(r=t.type==="cim"?ylt(t):t.color?new it(t.color):null),r?zR(r,e):null}function wlt(t){const e=t.symbolLayers;if(!e)return null;let r=null;return e.forEach(i=>{var n;i.type==="object"&&((n=i.resource)!=null&&n.href)||(r=i.type==="water"?i.color:i.material?i.material.color:null)}),r?new it(r):null}function zR(t,e){if(e==null||t==null)return t;const r=t.toRgba();return r[3]=r[3]*e,new it(r)}function xlt(t,e,r){const i=t.symbolLayers;if(!i)return;const n=s=>zR(e=e??s??(r!=null?vlt:null),r);i.forEach(s=>{var o;if(s.type!=="object"||!((o=s.resource)!=null&&o.href)||e)if(s.type==="water")s.color=n(s.color);else{const a=s.material!=null?s.material.color:null,l=n(a);s.material==null?s.material=new du({color:l}):s.material.color=l,r!=null&&"outline"in s&&s.outline!=null&&s.outline.color!=null&&(s.outline.color=zR(s.outline.color,r))}})}function Tlt(t,e,r){(e=e??t.color)&&(t.color=zR(e,r)),r!=null&&"outline"in t&&t.outline&&t.outline.color&&(t.outline.color=zR(t.outline.color,r))}function kNt(t,e,r){t&&(e||r!=null)&&(e&&(e=new it(e)),ow(t)?xlt(t,e,r):O6(t)&&Tlt(t,e,r))}async function Slt(t,e){const r=t.symbolLayers;r&&await r6(r,async i=>Elt(i,e))}async function Elt(t,e){switch(t.type){case"extrude":Alt(t,e);break;case"icon":case"line":case"text":Clt(t,e);break;case"path":Rlt(t,e);break;case"object":await Olt(t,e)}}function Clt(t,e){const r=H3e(e);r!=null&&(t.size=r)}function H3e(t){for(const e of t)if(typeof e=="number")return e;return null}function Alt(t,e){t.size=typeof e[2]=="number"?e[2]:0}async function Olt(t,e){const{resourceSize:r,symbolSize:i}=await Plt(t),n=W3e(e,r,i);t.width=yO(e[0],i[0],r[0],n),t.depth=yO(e[1],i[1],r[1],n),t.height=yO(e[2],i[2],r[2],n)}function Rlt(t,e){const r=W3e(e,pg,[t.width,void 0,t.height]);t.width=yO(e[0],t.width,1,r),t.height=yO(e[2],t.height,1,r)}function W3e(t,e,r){for(let i=0;i<3;i++){const n=t[i];switch(n){case"symbol-value":{const s=r[i];return s!=null?s/e[i]:1}case"proportional":break;default:if(n&&e[i])return n/e[i]}}return 1}async function Plt(t){const{computeObjectLayerResourceSize:e}=await ce(()=>import("./symbolLayerUtils-16974b32.js"),[]),r=await e(t,10),{width:i,height:n,depth:s}=t,o=[i,s,n];let a=1;for(let l=0;l<3;l++){const c=o[l];if(c!=null){a=c/r[l];break}}for(let l=0;l<3;l++)o[l]==null&&(o[l]=r[l]*a);return{resourceSize:r,symbolSize:o}}function yO(t,e,r,i){switch(t){case"proportional":return r*i;case"symbol-value":return e??r;default:return t}}function Mlt(t,e){const r=H3e(e);if(r!=null)switch(t.type){case"simple-marker":t.size=r;break;case"picture-marker":{const i=t.width/t.height;i>1?(t.width=r,t.height=r*i):(t.width=r*i,t.height=r);break}case"simple-line":t.width=r;break;case"text":t.font.size=r}}async function zNt(t,e){if(t&&e)return ow(t)?Slt(t,e):void(O6(t)&&Mlt(t,e))}function BNt(t,e,r){if(t&&e!=null)if(ow(t)){const i=t.symbolLayers;i&&i.forEach(n=>{if(n&&n.type==="object")switch(r){case"tilt":n.tilt=e;break;case"roll":n.roll=e;break;default:n.heading=e}})}else O6(t)&&(t.type!=="simple-marker"&&t.type!=="picture-marker"&&t.type!=="text"||(t.angle=e))}function VNt(t){return t!=null&&t.type==="polygon-3d"&&t.symbolLayers.some(e=>e.type==="extrude")}async function GNt(t,e){return await t.fetchSymbol(e)||t.fetchCIMSymbol(e)}function $lt(t,e,r,i,n){if(t==null)return null;const s=t.referencesGeometry()&&n?Ilt(e,i,n):e,o=t.repurposeFeature(s);try{return t.evaluate({...r,$feature:o},t.services)}catch(a){return J.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",a),null}}const iz=new Map;function Ilt(t,e,r){const{transform:i,hasZ:n,hasM:s}=r;iz.has(e)||iz.set(e,Llt(e));const o=iz.get(e)(t.geometry,i,n,s);return{...t,geometry:o}}function Llt(t){const e={};switch(t){case"esriGeometryPoint":return(r,i,n,s)=>cEe(i,e,r,n,s);case"esriGeometryPolygon":return(r,i,n,s)=>uEe(i,e,r,n,s);case"esriGeometryPolyline":return(r,i,n,s)=>hEe(i,e,r,n,s);case"esriGeometryMultipoint":return(r,i,n,s)=>lEe(i,e,r,n,s);default:return J.getLogger("esri.views.2d.support.arcadeOnDemand").error(new Y("mapview-arcade",`Unable to handle geometryType: ${t}`)),r=>r}}const jNt=1.2,Dlt=Nf;let G8=class{constructor(e,r,i,n){this.graphics3DSymbolLayer=e,this.renderGeometries=r,this.boundingBox=i,this._drapeSourceRenderer=n,this.type="draped",this.stage=null,this._visible=!1,this._addedToStage=!1,this.isElevationSource=!1}initialize(e){this.stage=e.stage}setVisibility(e){if(this.stage!=null&&this._visible!==e){if(this._visible=e,e&&!this._addedToStage)return this._addedToStage=!0,void this._drapeSourceRenderer.addGeometries(this.renderGeometries,Hi.ADD);if(e||this._addedToStage){for(const r of this.renderGeometries)r.visible=this._visible;this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,bs.VISIBILITY)}}}destroy(){this.stage&&this._addedToStage&&this._drapeSourceRenderer.removeGeometries(this.renderGeometries,Hi.REMOVE),this._addedToStage=!1,this._visible=!1,this.stage=null}getCenterObjectSpace(e=O()){return ne(e,0,0,0)}getBoundingBoxObjectSpace(e=ps()){return vi(e)}addObjectState(e,r){e===Hg.Highlight&&(this.renderGeometries.forEach(i=>{const n=i.geometry.addHighlight();r.addRenderGeometry(i,n,this)}),this._addedToStage&&this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,bs.HIGHLIGHT))}removeObjectState(e){this.renderGeometries.forEach(r=>{e.removeRenderGeometry(r)})}removeRenderGeometryObjectState(e,r){e.geometry.removeHighlight(r),this._addedToStage&&this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,bs.HIGHLIGHT)}computeAttachmentOrigin(e){for(const r of this.renderGeometries)r.geometry.computeAttachmentOrigin(Cx)&&(e.draped.origin[0]+=Cx[0],e.draped.origin[1]+=Cx[1],e.draped.num++)}async getProjectedBoundingBox(e,r,i,n,s){vi(s);for(let o=0;o{const v=e.measureText(y),b=v.width,x=b+r;this._textWidths.push(b),this._lineWidths.push(x),o=Math.max(o,x),a=Math.max(a,v.actualBoundingBoxAscent),l=Math.max(l,v.actualBoundingBoxDescent),_===0&&(n=v),_===this._lines.length-1&&(s=v)});const c=e.font;let u=nle.get(c);if(!u){const y=e.measureText(Flt);u=new klt(y.actualBoundingBoxAscent,y.actualBoundingBoxDescent),nle.set(c,u)}a=Math.max(a,u.actualBoundingBoxAscent),l=Math.max(l,u.actualBoundingBoxDescent);const d=a+l,p=this._hasBackground?n.actualBoundingBoxAscent:a,m=this._hasBackground?s.actualBoundingBoxDescent:l;this._metricsCached=new Ult(a-p,l-m,d,o,a)}return this._metricsCached}get _lineSpacing(){return(this._lineHeight+this._linePadding)*this._parameters.definition.lineSpacingFactor}get _lineHeight(){return this._metrics.lineHeight}get _linePadding(){return this._lineHeight*Nlt}get _baselinePosition(){return this._metrics.baselinePosition}get _renderedFontSize(){return this._toRenderUnit(this._fontSize)}get _fontSize(){return this._parameters.definition.size}get _renderedHaloSize(){return this._toRenderUnit(this._haloSize)}get _haloSize(){return this._parameters.haloSize}get _backgroundHorizontalPadding(){return this._hasBackground?this._parameters.definition.background.padding[0]:0}get _backgroundVerticalPadding(){return this._hasBackground?this._parameters.definition.background.padding[1]:0}get _backgroundTopPadding(){return Math.max(0,this._backgroundVerticalPadding-this._metrics.paddingTop)}get _backgroundBottomPadding(){return Math.max(0,this._backgroundVerticalPadding-this._metrics.paddingBottom)}get _hasBackground(){return!!this._parameters.backgroundStyle}get renderPixelRatio(){if(this._renderPixelRatio==null){const e=this._parameters.definition.pixelRatio;this._maxSize>0?this._renderPixelRatio=Math.min(e,Math.min(this._maxSize/this.displayWidth,this._maxSize/this.displayHeight)):this._renderPixelRatio=e}return this._renderPixelRatio}_getLineXOffset(e){switch(this._alignment){case R_.Left:return this._backgroundHorizontalPadding;case R_.Center:return(this.displayWidth-this._lineWidths[e])/2;case R_.Right:return this.displayWidth-this._backgroundHorizontalPadding-this._lineWidths[e]}}render(e,r=0,i=0){e.save();const n=r/=this.renderPixelRatio,s=i/=this.renderPixelRatio,o=this._haloSize,a=this._firstLineYOffset;r+=o,i+=a+this._baselinePosition;const l=this._haloSize>0;l&&this._renderHalo(e,n,s,o,a),this._setFontProperties(e,this._renderedFontSize);for(let c=0;c{let t="";for(let e=32;e<127;e++)t+=String.fromCharCode(e);return t})();let Ult=class{constructor(e,r,i,n,s){this.paddingTop=e,this.paddingBottom=r,this.lineHeight=i,this.displayWidth=n,this.baselinePosition=s}},klt=class{constructor(e,r){this.actualBoundingBoxAscent=e,this.actualBoundingBoxDescent=r}};const nle=new Map,zlt=Object.freeze({left:0,center:.5,right:1}),QD=Object.freeze({"bottom-left":or(0,0),bottom:or(.5,0),"bottom-right":or(1,0),left:or(0,.5),center:or(.5,.5),right:or(1,.5),"top-left":or(0,1),top:or(.5,1),"top-right":or(1,1)});function Y3e(t){switch(t){case"left":return R_.Left;case"right":return R_.Right;default:return R_.Center}}function sle(t){switch(t){case"bottom-left":case"left":case"top-left":return"left";case"bottom":case"center":case"top":return"center";case"bottom-right":case"right":case"top-right":return"right"}}function Blt(t){switch(t){case"bottom-left":case"bottom":case"bottom-right":return"bottom";case"left":case"center":case"right":return"center";case"top-left":case"top":case"top-right":return"top"}}function Vlt(t,e){switch(e){case"bottom":return t==="left"?"bottom-left":t==="right"?"bottom-right":"bottom";case"center":return t;case"top":return t==="left"?"top-left":t==="right"?"top-right":"top"}}function Glt(t){return t==="middle"?"center":t}let KS=class{constructor(e,r={}){this.geometry=e,this.screenToWorldRatio=1,this._transformation=_e(),this._shaderTransformation=null,this._boundingSphere=null,this.id=wc(),this.layerUid=r.layerUid,this.graphicUid=r.graphicUid,this.shaderTransformer=r.shaderTransformer,this.castShadow=r.castShadow??!1}get transformation(){return this._transformation}get boundingInfo(){return this.geometry.boundingInfo}updateTransformation(e){e(this._transformation),this._shaderTransformation=this._boundingSphere=null}shaderTransformationChanged(){this._shaderTransformation=null}get boundingSphere(){return this._boundingSphere?this._boundingSphere:this.boundingInfo?(this._boundingSphere=De(vn(),this.boundingInfo.center,this.shaderTransformation),this._boundingSphere[3]=this.boundingInfo.radius*MS(this.shaderTransformation),this._boundingSphere):fbe}get hasShaderTransformation(){return this.shaderTransformer!=null}get material(){return this.geometry.material}get type(){return this.geometry.type}get shaderTransformation(){return this.shaderTransformer==null?this.transformation:(this._shaderTransformation||(this._shaderTransformation=In(_e(),this.shaderTransformer(this.transformation))),this._shaderTransformation)}get indices(){return this.geometry.indices}get vertexAttributes(){return this.geometry.vertexAttributes}get highlights(){return this.geometry.highlights}get occludees(){return this.geometry.occludees}get visible(){return this.geometry.visible}set visible(e){this.geometry.visible=e}};const jlt=_e(),ole=Se(0,0,1),Hlt=16,Wlt=1.5,bb=nJ,qlt=[bb/2,bb/2,1-bb/2,1-bb/2],Xlt=[IR*bb,IR*bb];let sW=class Z3e extends hm{getCachedSize(){return{size:this._getIconSize()}}constructor(e,r,i,n){super(e,r,i,n),this._cimLayers=null,this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._cimRequiredFields=null,this._cimScaleFactorOrFunction=null,this._size=null,this._symbolTextureRatio=1,this._outlineSize=0,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0}}async doLoad(e){this._validateOrThrow();const r=this._prepareMaterialParameters(),i=this._getPrimitive();if(i!=null)this._prepareResourcesPrimitive(r,i);else{const n=blt(this.symbolLayer),s=Xb(n);s&&s.mediaType==="application/json"?await this._prepareResourcesCIM(r,JSON.parse(s.data),e):await this._prepareResourcesHref(r,n,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=R8(this._getIconSize());if(e)throw new Y("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,r=Math.round(e.size!=null?ha(e.size):Hlt);return this._drivenProperties.size?Math.max(r,64):r}_generateTextureCIM(e){const r=this._getGraphicHash(e);let i=r===""?null:this._cimSymbolTextures.get(r);if(!i){const n={scaleFactor:this._cimScaleFactorOrFunction},s=this._context.sharedResources.cimSymbolRasterizer.rasterizeCIMSymbol3D(this._cimLayers,e,"esriGeometryPoint",n,void 0,void 0);this._cimMaterialParametersInfo.anchorPosition=this._getAnchorPos("relative",s.anchorPosition);const o={width:s.imageData.width,height:s.imageData.height};i=new Hw(s.imageData,o),this._cimSymbolTextures.set(r,i),this._context.stage.add(i)}return i}_prepareMaterialParameters(){const e={anchorPosition:this._getAnchorPos(this.symbolLayer.anchor,this.symbolLayer.anchorPosition)},r=this.symbol;if(Ylt(r)){const{screenLength:i,minWorldLength:n,maxWorldLength:s}=r.verticalOffset;e.verticalOffset={screenLength:ha(i),minWorldLength:n||0,maxWorldLength:s??1/0}}return this._context.screenSizePerspectiveEnabled&&(e.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),e.occlusionTest=!0,e.hasSlicePlane=this._context.slicePlaneEnabled,e}_prepareResourcesPrimitive(e,r){const i=this._getOutlineSize();if(nz(r)&&i===0)throw new Error("Nothing to render");if(this._outlineSize=i,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,this._context.sharedResources.textures!=null){const s=this._context.sharedResources.textures.fromData(`${r}-icon`,()=>stt(r));this._texture=s.texture,this._releaseTexture=s,e.textureId=this._texture.id}e.textureIsSignedDistanceField=!0,e.distanceFieldBoundingBox=qlt;const n=this._getIconSize();this._size=[n,n],this._symbolTextureRatio=1/bb,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesHref(e,r,i){this._outlineSize=this._getOutlineSize(),e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,e.textureIsSignedDistanceField=!1;const n=this._getIconSize(),s=n*this._context.graphicsCoreOwner.view.state.rasterPixelRatio;if(this._context.sharedResources.textures!=null){const o=await Ng(this._context.sharedResources.textures.fromUrl(r,s,{signal:i}));if(o.ok===!1)throw Mw(o.error),new Y("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${r})`);this._releaseTexture=o.value;const a=o.value.texture,l=a.parameters.width/a.parameters.height;this._size=l>1?[n,Math.round(n/l)]:[Math.round(n*l),n],e.textureId=a.id}this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesCIM(e,r,i){const n=new xP({data:r});if(!this._context.sharedResources.cimSymbolRasterizer){const u=(await ce(()=>import("./CIMSymbolRasterizer-1692cd3f.js"),["assets/CIMSymbolRasterizer-1692cd3f.js","assets/cimAnalyzer-01879161.js","assets/TileClipper-ae6eca9e.js","assets/definitions-0bc08d4c.js","assets/number-e491b09e.js","assets/BidiEngine-9a40f2f4.js","assets/imageutils-51a204ba.js","assets/rasterizingUtils-4df93c6e.js"])).CIMSymbolRasterizer;Bt(i),this._context.sharedResources.cimSymbolRasterizer||(this._context.sharedResources.cimSymbolRasterizer=new u(this._context.renderCoordsHelper.spatialReference,!0))}const s=this._context.layer.fields?this._context.layer.fields.map(u=>u.toJSON()):null;let o,a;if(this._cimLayers=await this._context.sharedResources.cimSymbolRasterizer.analyzeCIMSymbol3D(n,s,this._context.renderer&&this._context.renderer.type==="dictionary"?this._context.renderer.fieldMap:null,"esriGeometryPoint",{signal:i}),this._context.renderer&&this._context.renderer.type==="dictionary"&&this._context.renderer.scaleExpression){const u=this._context.renderer;if(isNaN(u.scaleExpression)){const d=u.scaleExpression,p=await P8e(d,this._context.layer.spatialReference,s);a=(m,y,_)=>{const v=$lt(p,m,{$view:_},"esriGeometryPoint",y);return v!==null?v:1}}else o=Number(u.scaleExpression)}this._cimScaleFactorOrFunction=o||a||1;const l=this._context.renderer?await this._context.renderer.getRequiredFields(this._context.layer.fieldsIndex):[];Bt(i);const c=this._context.layer.fieldsIndex;this._cimRequiredFields=l.map(u=>c.get(u).name),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return this.symbolLayer.resource&&this.symbolLayer.resource.href?null:this.symbolLayer.resource&&this.symbolLayer.resource.primitive||fze}_getOutlineSize(){let e=0;const r=this.symbolLayer;return r.outline!=null&&r.outline.size!=null?Math.max(ha(r.outline.size),0):(e=nz(this._getPrimitive())?Wlt:0,Math.max(e,0))}_getOutlineColor(){var n;const e=this._getLayerOpacity(),r=this.symbolLayer,i=(n=r==null?void 0:r.outline)==null?void 0:n.color;if(i!=null){const s=it.toUnitRGB(i),o=i.a*e;return[s[0],s[1],s[2],o]}return[0,0,0,0]}_getFillColor(){var i,n;if(nz(this._getPrimitive()))return Dlt;const e=this._getPrimitive()==null,r=(n=(i=this.symbolLayer)==null?void 0:i.material)==null?void 0:n.color;return this._getCombinedOpacityAndColor(r,{hasIntrinsicColor:e})}_getAnchorPos(e,r){return e==="relative"?or((r.x||0)+.5,.5-(r.y||0)):e in QD?QD[e]:QD.center}_createMaterialAndAddToStage(e,r){if(this._cimLayers){this._fastUpdates=null;let i=e.textureId?this._cimSymbolMaterials.get(e.textureId):null;return i||(i=new YS(e),this._cimSymbolMaterials.set(e.textureId??0,i),r.add(i)),i}return this._fastUpdates=qS(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates&&(e={...e,...this._fastUpdates.materialParameters}),this._material=new YS(e),r.add(this._material),this._material}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial(e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,occlusionTest:!1,hasSlicePlane:!1,shaderPolygonOffset:0,isDraped:this.draped})}),this.layerOpacityChanged())}destroy(){super.destroy(),this._forEachMaterial(e=>this._context.stage.remove(e)),this._material=null,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach(e=>this._context.stage.remove(e)),this._cimSymbolTextures.clear(),this._releaseTexture=Fi(this._releaseTexture)}_getScaleFactor(e,r){if(this._drivenProperties.size&&e.size){for(let i=0;i<3;i++){const n=e.size[i];n&&n!=="symbol-value"&&n!=="proportional"&&(e.size[i]=ha(n))}if(e.size[0]==="symbol-value")return 1;if(isFinite(+e.size[0]))return+e.size[0]/r;if(isFinite(+e.size[2]))return+e.size[2]/r}return 1}createGraphics3DGraphic(e){var d;const r=e.graphic;if(!this._validateGeometry(r.geometry))return null;let i,n=[0,0];if(this._cimLayers){if(!this._cimLayers.length)return null;const p=this._generateTextureCIM(r),m={textureId:p.id,...this._cimMaterialParametersInfo};i=this._createMaterialAndAddToStage(m,this._context.stage),n=[p.parameters.width,p.parameters.height]}else n=this._size,i=this._material;const s=DR(r.geometry);if(s==null)return this.logger.warn(`unsupported geometry type for icon symbol: ${r.geometry.type}`),null;const o=e.renderingInfo,a=this._getVertexOpacityAndColor(o);let l=1;if(!((d=this._fastUpdates)!=null&&d.visualVariables.size)){const p=n[0]>n[1]?n[0]:n[1];l=this._getScaleFactor(o,p)}l*=this._symbolTextureRatio;const c=or(n[0]*l,n[1]*l),u=this.setGraphicElevationContext(r,new wp);return this.ensureDrapedStatus(u.mode==="on-the-ground")&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(r,s,i,a,c,e.layer.uid):this._createAs3DShape(r,s,i,a,c,u,r.uid)}layerOpacityChanged(){const e=this._getFillColor(),r=this._getOutlineColor();this._forEachMaterial(i=>{i.setParameters({color:e}),i.setParameters({outlineColor:r})})}layerElevationInfoChanged(e,r,i){const n=this._elevationContext.mode,s=WP(Z3e.elevationModeChangeTypes,i,n);if(s!==an.UPDATE)return s;const o=Bh(n)||n==="absolute-height";return this.updateGraphics3DGraphicElevationInfo(e,r,()=>o)}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial(e=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return this._getPrimitive()!=null}applyRendererDiff(e,r){for(const i in e.diff){if(i!=="visualVariables"||!XS(this._fastUpdates,r,this._fastVisualVariableConvertOptions()))return $n.RecreateSymbol;this._material!=null&&this._material.setParameters(this._fastUpdates.materialParameters)}return $n.FastUpdate}_defaultElevationInfoNoZ(){return Zlt}_createAs3DShape(e,r,i,n,s,o,a){const l=this.getFastUpdateAttrValues(e),c=l&&this._fastUpdates?_=>FH(this._fastUpdates.materialParameters,l,_):void 0,u=this._context.layer.uid,d=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:a,layerUid:u}),p=aH(i,ole,null,n,s,Qlt,null,l,d),m=_J(this._context,r,p,o,a,c);if(m==null)return null;const y=new um(this,m.object,[p],null,null,Lb,o);return y.alignedSampledElevation=m.sampledElevation,y.needsElevationUpdates=Bh(o.mode)||o.mode==="absolute-height",y.getScreenSize=this._createScreenSizeGetter(s,c),y.calculateRelativeScreenBounds=_=>i.calculateRelativeScreenBounds(y.getScreenSize(),1,_),LR(y,r,this._context.elevationProvider),y}_createAsOverlay(e,r,i,n,s,o){i.renderPriority=this._renderPriority;const a=Qt();Bi(r,a,this._context.overlaySR),a[2]=BJ;const l=this._context.clippingExtent;if(l!=null&&!YY(l,a))return null;const c=this.getFastUpdateAttrValues(e),u=c&&this._fastUpdates?_=>FH(this._fastUpdates.materialParameters,c,_):void 0,d=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:e.uid,layerUid:this._context.layer.uid}),p=aH(i,ole,a,n,s,null,null,c,d),m=new KS(p,{layerUid:o,graphicUid:e.uid,shaderTransformer:u}),y=new G8(this,[m],null,this._context.drapeSourceRenderer);return y.getScreenSize=this._createScreenSizeGetter(s,u),y.calculateRelativeScreenBounds=_=>i.calculateRelativeScreenBounds(y.getScreenSize(),1,_),y}_createScreenSizeGetter(e,r){const i=this._outlineSize+2;if(this._fastUpdates&&r){const n=e[0]/this._symbolTextureRatio,s=e[1]/this._symbolTextureRatio;return(o=Ne())=>{const a=r(jlt);return o[0]=a[0]*n+i,o[1]=a[5]*s+i,o}}{const n=e[0]/this._symbolTextureRatio+i,s=e[1]/this._symbolTextureRatio+i;return(o=Ne())=>(o[0]=n,o[1]=s,o)}}_fastVisualVariableConvertOptions(){const e=Math.max(this._size[0],this._size[1]),r=Se(e,e,e),i=up(1),n=e*i,s=Se(n,n,n);return new jP({size:!0,color:!0,rotation:!0,opacity:!1},r,s,i)}_getGraphicHash(e){let r="";for(const i of this._cimRequiredFields)r+=i+e.attributes[i];return r}_forEachMaterial(e){this._material!=null&&e(this._material),this._cimSymbolMaterials.forEach(e)}test(){return{...super.test(),material:this._material}}};function Ylt(t){return t&&t.type==="point-3d"&&t.hasVisibleVerticalOffset()}function nz(t){return t!=null&&(t==="cross"||t==="x")}sW.PRIMITIVE_SIZE=Xlt,sW.elevationModeChangeTypes={definedChanged:an.UPDATE,staysOnTheGround:an.NONE,onTheGroundChanged:an.RECREATE};const Zlt={mode:"relative-to-ground",offset:0},Qlt=$t(0,0,0,1);function oW(t){switch(t){case"butt":return Ah.BUTT;case"square":return Ah.SQUARE;case"round":return Ah.ROUND;default:return null}}function ale(t){return t==="diamond"?"kite":t}function aW(t,e,r=null){const i=[],n=[],s=e.mapPositions;Jlt(e,n,i);const o=n[0][1].data,a=i[0][1].length,l=OE(a);return Klt(e,n,i,l),rct(e,n,i,l),ect(e,n,i,l),tct(e,n,i,l),ict(e,n,i,l),nct(e,n,i,l),sct(e,n,i,o),new Xn(t,n,i,s,on.Line,r)}function Jlt(t,e,r){const{attributeData:{position:i},removeDuplicateStartEnd:n}=t,s=oct(i)&&n,o=i.length/3-(s?1:0),a=new Array(2*(o-1)),l=s?i.slice(0,i.length-3):i;let c=0;for(let u=0;u{const n=i.length,s=Ys(3*n);i.forEach((a,l)=>{s[3*l]=a[0],s[3*l+1]=a[1],s[3*l+2]=a[2]});const o={attributeData:{position:s,normal:e},removeDuplicateStartEnd:!1};r.push(o)}),r}function cct(t,e,r,i){const n=t.type==="polygon"?Kf.CCW_IS_HOLE:Kf.NONE,s=t.type==="polygon"?t.rings:t.paths,{position:o,outlines:a}=YP(s,!!t.hasZ,n),l=Ys(o.length),c=SEe(o,t.spatialReference,0,l,0,o,0,o.length/3,e,r,i),u=c!=null;return{lines:u?Q3e(a,o,l):[],projectionSuccess:u,sampledElevation:c}}function uct(t,e){const r=t.type==="polygon"?Kf.CCW_IS_HOLE:Kf.NONE,i=t.type==="polygon"?t.rings:t.paths,{position:n,outlines:s}=YP(i,!1,r),o=$i(n,t.spatialReference,0,n,e,0,n.length/3);for(let a=2;aa.camera.nearFar),new Jt("viewport",(o,a)=>a.camera.fullViewport)),n.code.add(w`vec4 projectAndScale(vec4 pos) { +vec4 posNdc = proj * pos; +posNdc.xy *= viewport.zw / posNdc.w; +return posNdc; +}`),n.code.add(w`void clip(vec4 pos, inout vec4 prev) { +float vnp = nearFar[0] * 0.99; +if (prev.z > -nearFar[0]) { +float interpolation = (-vnp - pos.z) / (prev.z - pos.z); +prev = mix(pos, prev, interpolation); +} +}`),i?(e.attributes.add(E.NORMAL,"vec3"),jS(n),n.constants.add("tiltThreshold","float",.7),n.code.add(w`vec3 perpendicular(vec3 v) { +vec3 n = (viewNormal * vec4(normal.xyz, 1.0)).xyz; +vec3 n2 = cross(v, n); +vec3 forward = vec3(0.0, 0.0, 1.0); +float tiltDot = dot(forward, n); +return abs(tiltDot) < tiltThreshold ? n : n2; +}`)):n.code.add(w`vec2 perpendicular(vec2 v) { +return vec2(v.y, -v.x); +}`),n.code.add(w` + #define vecN ${i?"vec3":"vec2"} + + vecN normalizedSegment(vecN pos, vecN prev) { + vecN segment = pos - prev; + float segmentLen = length(segment); + + // normalize or zero if too short + return (segmentLen > 0.001) ? segment / segmentLen : ${i?"vec3(0.0, 0.0, 0.0)":"vec2(0.0, 0.0)"}; + } + + vecN displace(vecN pos, vecN prev, float displacementLen) { + vecN segment = normalizedSegment(pos, prev); + + vecN displacementDirU = perpendicular(segment); + vecN displacementDirV = segment; + + ${t.anchor===_w.Tip?"pos -= 0.5 * displacementLen * displacementDirV;":""} + + return pos + displacementLen * (uv0.x * displacementDirU + uv0.y * displacementDirV); + } + `),t.space===mu.Screen&&(n.uniforms.add(new Mi("inverseProjectionMatrix",(o,a)=>a.camera.inverseProjectionMatrix)),n.code.add(w`vec3 inverseProject(vec4 posScreen) { +posScreen.xy = (posScreen.xy / viewport.zw) * posScreen.w; +return (inverseProjectionMatrix * posScreen).xyz; +}`),n.code.add(w`bool rayIntersectPlane(vec3 rayDir, vec3 planeOrigin, vec3 planeNormal, out vec3 intersection) { +float cos = dot(rayDir, planeNormal); +float t = dot(planeOrigin, planeNormal) / cos; +intersection = t * rayDir; +return abs(cos) > 0.001 && t > 0.0; +}`),n.uniforms.add(new Ce("perScreenPixelRatio",(o,a)=>a.camera.perScreenPixelRatio)),n.code.add(w` + vec4 toFront(vec4 displacedPosScreen, vec3 posLeft, vec3 posRight, vec3 prev, float lineWidth) { + // Project displaced position back to camera space + vec3 displacedPos = inverseProject(displacedPosScreen); + + // Calculate the plane that we want the marker to lie in. Note that this will always be an approximation since ribbon lines are generally + // not planar and we do not know the actual position of the displaced prev vertices (they are offset in screen space, too). + vec3 planeNormal = normalize(cross(posLeft - posRight, posLeft - prev)); + vec3 planeOrigin = posLeft; + + ${t.hasCap?` + if(prev.z > posLeft.z) { + vec2 diff = posLeft.xy - posRight.xy; + planeOrigin.xy += perpendicular(diff) / 2.0; + } + `:""}; + + // Move the plane towards the camera by a margin dependent on the line width (approximated in world space). This tolerance corrects for the + // non-planarity in most cases, but sharp joins can place the prev vertices at arbitrary positions so markers can still clip. + float offset = lineWidth * perScreenPixelRatio; + planeOrigin *= (1.0 - offset); + + // Intersect camera ray with the plane and make sure it is within clip space + vec3 rayDir = normalize(displacedPos); + vec3 intersection; + if (rayIntersectPlane(rayDir, planeOrigin, planeNormal, intersection) && intersection.z < -nearFar[0] && intersection.z > -nearFar[1]) { + return vec4(intersection.xyz, 1.0); + } + + // Fallback: use depth of pos or prev, whichever is closer to the camera + float minDepth = planeOrigin.z > prev.z ? length(planeOrigin) : length(prev); + displacedPos *= minDepth / length(displacedPos); + return vec4(displacedPos.xyz, 1.0); + } + `)),LE(n,t),t8(e),n.code.add(w`void main(void) { +if (uv0.y == 0.0) { +gl_Position = vec4(1e038, 1e038, 1e038, 1.0); +} +else { +float lineWidth = getLineWidth(); +float screenMarkerSize = getScreenMarkerSize(); +vec4 pos = view * vec4(position.xyz, 1.0); +vec4 prev = view * vec4(auxpos1.xyz, 1.0); +clip(pos, prev);`),i?(t.hideOnShortSegments&&n.code.add(w`if (areWorldMarkersHidden(pos, prev)) { +gl_Position = vec4(1e038, 1e038, 1e038, 1.0); +return; +}`),n.code.add(w`pos.xyz = displace(pos.xyz, prev.xyz, getWorldMarkerSize(pos)); +vec4 displacedPosScreen = projectAndScale(pos);`)):(n.code.add(w`vec4 posScreen = projectAndScale(pos); +vec4 prevScreen = projectAndScale(prev); +vec4 displacedPosScreen = posScreen; +displacedPosScreen.xy = displace(posScreen.xy, prevScreen.xy, screenMarkerSize);`),t.space===mu.Screen&&n.code.add(w`vec2 displacementDirU = perpendicular(normalizedSegment(posScreen.xy, prevScreen.xy)); +vec3 lineRight = inverseProject(posScreen + lineWidth * vec4(displacementDirU.xy, 0.0, 0.0)); +vec3 lineLeft = pos.xyz + (pos.xyz - lineRight); +pos = toFront(displacedPosScreen, lineLeft, lineRight, prev.xyz, lineWidth); +displacedPosScreen = projectAndScale(pos);`)),n.code.add(w` + ${r?"depth = pos.z;":""} + linearDepth = calculateLinearDepth(nearFar,pos.z); + + // Convert back into NDC + displacedPosScreen.xy = (displacedPosScreen.xy / viewport.zw) * displacedPosScreen.w; + + // Convert texture coordinate into [0,1] + vUV = (uv0 + 1.0) / 2.0; + + ${i?"":"vUV *= displacedPosScreen.w;"} + + ${t.hasTip?"vLineWidth = lineWidth;":""} + + vSize = screenMarkerSize; + vColor = getColor(); + + // Use camera space for slicing + vpos = pos.xyz; + + gl_Position = displacedPosScreen; + } + } + `),r&&e.include(xu,t),e.include(fn,t),s.uniforms.add(new Jt("intrinsicColor",o=>o.color),new Ye("tex",o=>o.markerTexture)),s.include(cm),e.constants.add("texelSize","float",1/Db),s.code.add(w`float markerAlpha(vec2 samplePos) { +samplePos += vec2(0.5, -0.5) * texelSize; +float sdf = rgba2float(texture(tex, samplePos)) - 0.5; +float distance = sdf * vSize; +distance -= 0.5; +return clamp(0.5 - distance, 0.0, 1.0); +}`),t.hasTip&&(e.constants.add("relativeMarkerSize","float",OJ/Db),e.constants.add("relativeTipLineWidth","float",gst),s.code.add(w` + float tipAlpha(vec2 samplePos) { + // Convert coordinates s.t. they are in pixels and relative to the tip of an arrow marker + samplePos -= vec2(0.5, 0.5 + 0.5 * relativeMarkerSize); + samplePos *= vSize; + + float halfMarkerSize = 0.5 * relativeMarkerSize * vSize; + float halfTipLineWidth = 0.5 * max(1.0, relativeTipLineWidth * vLineWidth); + + ${i?"halfTipLineWidth *= fwidth(samplePos.y);":""} + + float distance = max(abs(samplePos.x) - halfMarkerSize, abs(samplePos.y) - halfTipLineWidth); + return clamp(0.5 - distance, 0.0, 1.0); + } + `)),e.constants.add("symbolAlphaCutoff","float",vo),s.code.add(w` + void main() { + discardBySlice(vpos); + ${r?"terrainDepthTest(gl_FragCoord, depth);":""} + + vec4 finalColor = intrinsicColor * vColor; + + ${i?"vec2 samplePos = vUV;":"vec2 samplePos = vUV * gl_FragCoord.w;"} + + ${t.hasTip?"finalColor.a *= max(markerAlpha(samplePos), tipAlpha(samplePos));":"finalColor.a *= markerAlpha(samplePos);"} + + ${t.output===D.ObjectAndLayerIdColor?w`finalColor.a = 1.0;`:""} + + if (finalColor.a < symbolAlphaCutoff) { + discard; + } + + ${t.output===D.Alpha?w`fragColor = vec4(finalColor.a);`:""} + ${t.output===D.Color?w`fragColor = highlightSlice(finalColor, vpos);`:""} + ${t.output===D.Color&&t.transparencyPassType===rt.Color?"fragColor = premultiplyAlpha(fragColor);":""} + ${t.output===D.Highlight?w`fragColor = vec4(1.0);`:""} + ${t.output===D.Depth?w`outputDepth(linearDepth);`:""} + } + `),e}const dct=Object.freeze(Object.defineProperty({__proto__:null,build:hct},Symbol.toStringTag,{value:"Module"})),J3e=new Map([[E.POSITION,0],[E.UV0,2],[E.AUXPOS1,3],[E.NORMAL,4],[E.COLOR,5],[E.COLORFEATUREATTRIBUTE,5],[E.SIZE,6],[E.SIZEFEATUREATTRIBUTE,6],[E.OPACITYFEATUREATTRIBUTE,7]]);let K3e=class eAe extends Tr{initializeProgram(e){return new vr(e.rctx,eAe.shader.get().build(this.configuration),J3e)}_makePipelineState(e,r){const i=this.configuration,n=e===rt.NONE;return Ot({blending:i.output===D.Color||i.output===D.Alpha?n?fu:u0(e):null,depthTest:{func:f1(e)},depthWrite:n?i.writeDepth?$l:null:S8(e),colorWrite:Ft,stencilWrite:i.hasOccludees?em:null,stencilTest:i.hasOccludees?r?r1:m1:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(){return this.configuration.occluder&&(this._occluderPipelineTransparent=Ot({blending:fu,depthTest:k5,depthWrite:null,colorWrite:Ft,stencilWrite:null,stencilTest:FCe}),this._occluderPipelineOpaque=Ot({blending:fu,depthTest:k5,depthWrite:null,colorWrite:Ft,stencilWrite:DCe,stencilTest:NCe}),this._occluderPipelineMaskWrite=Ot({blending:null,depthTest:RJ,depthWrite:null,colorWrite:null,stencilWrite:em,stencilTest:r1})),this._occludeePipelineState=this._makePipelineState(this.configuration.transparencyPassType,!0),this._makePipelineState(this.configuration.transparencyPassType,!1)}getPipelineState(e,r){return r?this._occludeePipelineState:this.configuration.occluder?e===le.TRANSPARENT_OCCLUDER_MATERIAL?this._occluderPipelineTransparent:e===le.OCCLUDER_MATERIAL?this._occluderPipelineOpaque:this._occluderPipelineMaskWrite:super.getPipelineState(e,r)}};K3e.shader=new _r(dct,()=>ce(()=>import("./LineMarker.glsl-c22f9f73.js"),[]));let pct=class extends p1{constructor(e){super(e,new mct),this._vertexAttributeLocations=J3e,this._configuration=new uo,this._layout=this.createLayout()}dispose(){}getConfiguration(e,r){return this._configuration.output=e,this._configuration.space=r.slot===le.DRAPED_MATERIAL?mu.Draped:this.parameters.worldSpace?mu.World:mu.Screen,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=this.parameters.cap!==Ah.BUTT,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.occluder=this.parameters.renderOccluded===Ri.OccludeAndTransparentStencil,this._configuration.transparencyPassType=r.transparencyPassType,this._configuration.hasMultipassTerrain=r.multipassTerrain.enabled,this._configuration.cullAboveGround=r.multipassTerrain.cullAboveGround,this._configuration}intersect(){}createLayout(){const e=Gi().vec3f(E.POSITION).vec2f(E.UV0).vec3f(E.AUXPOS1);return this.parameters.worldSpace&&e.vec3f(E.NORMAL),this.parameters.vvSize?e.f32(E.SIZEFEATUREATTRIBUTE):e.f32(E.SIZE),this.parameters.vvColor?e.f32(E.COLORFEATUREATTRIBUTE):e.vec4f(E.COLOR),this.parameters.vvOpacity&&e.f32(E.OPACITYFEATUREATTRIBUTE),e}createBufferWriter(){return new gct(this._layout,this.parameters)}requiresSlot(e,r){return r===D.Color||r===D.Alpha||r===D.Highlight||r===D.Depth?e===le.DRAPED_MATERIAL?!0:this.parameters.renderOccluded===Ri.OccludeAndTransparentStencil?e===le.OPAQUE_MATERIAL||e===le.OCCLUDER_MATERIAL||e===le.TRANSPARENT_OCCLUDER_MATERIAL:r===D.Color||r===D.Alpha?e===(this.parameters.writeDepth?le.TRANSPARENT_MATERIAL:le.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL):e===le.OPAQUE_MATERIAL:!1}createGLMaterial(e){return new fct(e)}},fct=class extends XZ{constructor(){super(...arguments),this._markerPrimitive=null}dispose(){super.dispose(),this._markerTextureRepository.release(this._markerPrimitive),this._markerPrimitive=null}_updateParameters(e){const r=this._material.parameters.markerPrimitive;return r!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextureRepository.swap(r,this._markerPrimitive)}),this._markerPrimitive=r),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(K3e,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==D.Color&&this._output!==D.Alpha||this._updateOccludeeState(e),this._updateParameters(e)}},mct=class extends HP{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=Ah.BUTT,this.anchor=_w.Center,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.hasOccludees=!1,this.markerTexture=null}},gct=class{constructor(e,r){this.vertexBufferLayout=e,this._parameters=r}elementCount(){return this._parameters.placement==="begin-end"?12:6}write(e,r,i,n,s){const o=i.vertexAttributes.get(E.POSITION).data,a=o.length/3;let l=[1,0,0];const c=i.vertexAttributes.get(E.NORMAL);this._parameters.worldSpace&&c!=null&&(l=c.data);let u=1,d=0;this._parameters.vvSize?d=i.vertexAttributes.get(E.SIZEFEATUREATTRIBUTE).data[0]:i.vertexAttributes.has(E.SIZE)&&(u=i.vertexAttributes.get(E.SIZE).data[0]);let p=[1,1,1,1],m=0;this._parameters.vvColor?m=i.vertexAttributes.get(E.COLORFEATUREATTRIBUTE).data[0]:i.vertexAttributes.has(E.COLOR)&&(p=i.vertexAttributes.get(E.COLOR).data);let y=0;this._parameters.vvOpacity&&(y=i.vertexAttributes.get(E.OPACITYFEATUREATTRIBUTE).data[0]);const _=new Float32Array(n.buffer);let v=s*(this.vertexBufferLayout.stride/4);const b=(A,C,R,P)=>{if(_[v++]=A[0],_[v++]=A[1],_[v++]=A[2],_[v++]=R[0],_[v++]=R[1],_[v++]=C[0],_[v++]=C[1],_[v++]=C[2],this._parameters.worldSpace&&(_[v++]=l[0],_[v++]=l[1],_[v++]=l[2]),this._parameters.vvSize?_[v++]=d:_[v++]=u,this._parameters.vvColor)_[v++]=m;else{const F=Math.min(4*P,p.length-4);_[v++]=p[F],_[v++]=p[F+1],_[v++]=p[F+2],_[v++]=p[F+3]}this._parameters.vvOpacity&&(_[v++]=y)};let x;(function(A){A[A.ASCENDING=1]="ASCENDING",A[A.DESCENDING=-1]="DESCENDING"})(x||(x={}));const T=(A,C)=>{const R=ne(yct,o[3*A],o[3*A+1],o[3*A+2]),P=_ct;let F=A+C;do ne(P,o[3*F],o[3*F+1],o[3*F+2]),F+=C;while(N_(R,P)&&F>=0&&Fthis._context.stage.remove(e)),this._lineMaterialCached=null,this._ringMaterialCached=null,this._wireframeLineMaterialCached=null,this._wireframeRingMaterialCached=null,this._markerMaterialCached=null}_getDrivenSize(e){return this._drivenProperties.size&&e.size?ha(knt(e.size)):1}_getDrivenColor(e){const r=$t(1,1,1,1);return this._drivenProperties.color&&e.color&&(r[0]=e.color[0],r[1]=e.color[1],r[2]=e.color[2],e.color.length>0&&(r[3]=e.color[3])),this._drivenProperties.opacity&&e.opacity&&(r[3]=e.opacity),r}createGraphics3DGraphic(e){const r=e.graphic;if(!this._validateGeometry(r.geometry,Tct,this.symbolLayer.type))return null;const i=this.setGraphicElevationContext(r,new wp);return this.ensureDrapedStatus(i.mode==="on-the-ground"),this.draped?this._createAsOverlay(e,this._context.layer.uid):this._createAs3DShape(e,i,r.uid)}applyRendererDiff(e,r){for(const i in e.diff){if(i!=="visualVariables")return $n.RecreateSymbol;{const n=this._fastUpdates;if(!XS(n,r,lle))return $n.RecreateSymbol;this._forEachMaterial(s=>s.setParameters(n.materialParameters))}}return $n.FastUpdate}prepareSymbolLayerPatch(e){var s,o;if(e.diff.type!=="partial")return;const r=e.diff.diff,i={};((s=r.size)==null?void 0:s.type)==="complete"&&(i.width=this._computeMaterialWidth(r.size.newValue),delete r.size),((o=r.cap)==null?void 0:o.type)==="complete"&&(i.cap=oW(r.cap.newValue??"butt"),delete r.cap);const n=this._prepareMarkerPatch(e,r);this._prepareMaterialPatch(e,r,n),e.symbolLayerStatePatches.push(()=>this._forEachMaterial(a=>a.setParameters(i)))}layerOpacityChanged(){this._forEachMaterial((e,r)=>this._updateMaterialLayerOpacity(e,r))}_forEachMaterial(e){this._lineMaterialCached!=null&&e(this._lineMaterialCached),this._ringMaterialCached!=null&&e(this._ringMaterialCached),this._wireframeLineMaterialCached!=null&&e(this._wireframeLineMaterialCached),this._wireframeRingMaterialCached!=null&&e(this._wireframeRingMaterialCached),this._markerMaterialCached!=null&&e(this._markerMaterialCached,!0)}_updateMaterialLayerOpacity(e,r=!1){var a,l;const i=e.parameters.color,n=(l=(a=this.symbolLayer)==null?void 0:a.material)==null?void 0:l.color,s=this._patternHidesLine&&!r?0:this._getCombinedOpacity(n),o=$t(i[0],i[1],i[2],s);e.setParameters({color:o})}layerElevationInfoChanged(e,r,i){const n=this._elevationContext.mode,s=WP(iAe.elevationModeChangeTypes,i,n);if(s!==an.UPDATE)return s;const o=Bh(n);return this.updateGraphics3DGraphicElevationInfo(e,r,()=>o)}slicePlaneEnabledChanged(){const e={hasSlicePlane:this._context.slicePlaneEnabled};return this._forEachMaterial(r=>r.setParameters(e)),!0}physicalBasedRenderingChanged(){return!0}_getGeometryAsPolygonOrPolyline(e){switch(e.type){case"extent":if(e instanceof Dr)return a1.fromExtent(e);break;case"polygon":case"polyline":return e}return null}_createAs3DShape(e,r,i){const n=e.graphic,s=this._getGeometryAsPolygonOrPolyline(n.geometry),o=s.type==="polygon"?s.rings:s.paths,a=new Array,l=ps(),c=cct(s,this._context.elevationProvider,this._context.renderCoordsHelper,r),u=s.type==="polygon"?"rings":"paths";this._logGeometryCreationWarnings(c,o,u,"LineSymbol3DLayer");for(let m=0;m{const b=this._createGeometry(v,e,y.position,void 0,n.type,_O.DRAPED,i.uid),x=new KS(b,{layerUid:r,graphicUid:i.uid});c.push(x)};if(l!=null){_(l);const v=this.symbolLayer.marker.placement;v!=="begin"&&v!=="begin-end"||lu(u,y.position,0,1),v!=="end"&&v!=="begin-end"||lu(u,y.position,y.position.length-3,1)}_(o),Kr.LINE_WIREFRAMES&&_(a)}return new G8(this,c,d,this._context.drapeSourceRenderer)}get _patternHidesLine(){const e=this.symbolLayer.pattern;return e!=null&&e.type==="style"&&e.style==="none"}_computeMaterialWidth(e){var r;return e=e??up(1),this._drivenProperties.size?(r=this._fastUpdates)!=null&&r.visualVariables.size?ha(1):1:ha(e)}_prepareMaterialPatch(e,r,i){var a,l;const n=r.material;if(n==null)return void(i.changed&&i.useMaterialColor&&this._patchMaterialColor(this._getCombinedOpacityAndColor(this._materialColor),this._markerMaterialCached,e));if(n.type==="collection")return;const s=n.type==="complete"?(a=n.newValue)==null?void 0:a.color:((l=n.diff.color)==null?void 0:l.type)==="complete"?n.diff.color.newValue:null,o=this._getCombinedOpacityAndColor(s);i.useMaterialColor&&this._patchMaterialColor(PP(o),this._markerMaterialCached,e),this._patternHidesLine&&(o[3]=0),this._patchMaterialColor(o,this._lineMaterialCached,e),delete r.material}_prepareMarkerPatch(e,r){var u;const i=r.marker,n=this._markerMaterial;if(i==null||i.type!=="partial"||i.diff==null||i.diff.placement!=null||i.diff.style!=null&&i.diff.style.type!=="complete"||i.diff.color!=null&&i.diff.color.type!=="complete"||n==null)return{changed:!1,useMaterialColor:this._markerColor==null};const s=i.diff.color,o=s!=null,a=o?s.newValue:null,l=a==null&&this._markerColor==null;a&&this._patchMaterialColor(this._getCombinedOpacityAndColor(a),n,e);const c=(u=i.diff.style)==null?void 0:u.newValue;return c&&e.symbolLayerStatePatches.push(()=>n.setParameters({markerPrimitive:ale(c)})),delete r.marker,{changed:o,useMaterialColor:l}}_patchMaterialColor(e,r,i){r!=null&&i.symbolLayerStatePatches.push(()=>r.setParameters({color:e}))}};var _O;rAe.elevationModeChangeTypes={definedChanged:an.RECREATE,staysOnTheGround:an.NONE,onTheGroundChanged:an.RECREATE},function(t){t[t.DRAPED=0]="DRAPED",t[t.ELEVATED=1]="ELEVATED"}(_O||(_O={}));let PC=null,G5=!0;function sz(t,e,r){if(!t||!e)throw new Error("Cannot construct image data without dimensions");if(G5)try{return new ImageData(t,e)}catch{G5=!1}return nAe(t,e,r)}function Sct(t,e,r,i){if(!e||!r)throw new Error("Cannot construct image data without dimensions");if(G5)try{return new ImageData(t,e,r)}catch{G5=!1}const n=nAe(e,r,i);return n.data.set(t,0),n}function Ect(){return PC||(PC=document.createElement("canvas"),PC.width=1,PC.height=1),PC}function nAe(t,e,r){return r||(r=Ect()),r.getContext("2d").createImageData(t,e)}var O2;const oz=new WeakMap;let Cct=0,of=O2=class extends ke{constructor(t){super(t),this.wrap="repeat"}get url(){return this._get("url")||null}set url(t){this._set("url",t),t&&this._set("data",null)}get data(){return this._get("data")||null}set data(t){this._set("data",t),t&&this._set("url",null)}writeData(t,e,r,i){if(t instanceof HTMLImageElement){const n={type:"image-element",src:ES(t.src,i),crossOrigin:t.crossOrigin};e[r]=n}else if(t instanceof HTMLCanvasElement){const n=t.getContext("2d").getImageData(0,0,t.width,t.height),s={type:"canvas-element",imageData:this._encodeImageData(n)};e[r]=s}else if(t instanceof HTMLVideoElement){const n={type:"video-element",src:ES(t.src,i),autoplay:t.autoplay,loop:t.loop,muted:t.muted,crossOrigin:t.crossOrigin,preload:t.preload};e[r]=n}else if(t instanceof ImageData){const n={type:"image-data",imageData:this._encodeImageData(t)};e[r]=n}}readData(t){switch(t.type){case"image-element":{const e=new Image;return e.src=t.src,e.crossOrigin=t.crossOrigin,e}case"canvas-element":{const e=this._decodeImageData(t.imageData),r=document.createElement("canvas");return r.width=e.width,r.height=e.height,r.getContext("2d").putImageData(e,0,0),r}case"image-data":return this._decodeImageData(t.imageData);case"video-element":{const e=document.createElement("video");return e.src=t.src,e.crossOrigin=t.crossOrigin,e.autoplay=t.autoplay,e.loop=t.loop,e.muted=t.muted,e.preload=t.preload,e}default:return}}get transparent(){const t=this.data,e=this.url;if(t instanceof HTMLCanvasElement)return this._imageDataContainsTransparent(t.getContext("2d").getImageData(0,0,t.width,t.height));if(t instanceof ImageData)return this._imageDataContainsTransparent(t);if(e){const r=e.substr(e.length-4,4).toLowerCase(),i=e.substr(0,15).toLocaleLowerCase();if(r===".png"||i==="data:image/png;")return!0}return!1}set transparent(t){this._overrideIfSome("transparent",t)}get contentHash(){const t=typeof this.wrap=="string"?this.wrap:typeof this.wrap=="object"?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",e=(r="")=>`d:${r},t:${this.transparent},w:${t}`;return this.url!=null?e(this.url):this.data!=null?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?e(this.data.src):(oz.has(this.data)||oz.set(this.data,++Cct),e(oz.get(this.data))):e()}get memoryUsage(){let t=0;if(t+=this.url!=null?this.url.length:0,this.data!=null){const e=this.data;"data"in e?t+=e.data.byteLength:e instanceof HTMLImageElement?t+=e.naturalWidth*e.naturalHeight*3:e instanceof HTMLCanvasElement&&(t+=e.width*e.height*3)}return t}clone(){const t={url:this.url,data:this.data,wrap:this._cloneWrap()};return new O2(t)}cloneWithDeduplication(t){const e=t.get(this);if(e)return e;const r=this.clone();return t.set(this,r),r}_cloneWrap(){return typeof this.wrap=="string"?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}_encodeImageData(t){let e="";for(let r=0;r{const i=new Blob([t]),n=new FileReader;n.onload=()=>{const s=n.result;e(JSON.parse(s))},n.onerror=s=>{r(s)},n.readAsText(i)})}async function Mct(t,e){return e===wg.KTX2_ENCODING?new hAe(t):new Promise((r,i)=>{const n=new Blob([t],{type:e}),s=URL.createObjectURL(n),o=new Image,a=()=>{URL.revokeObjectURL(s),"decode"in o?o.decode().then(()=>r(o),()=>r(o)).then(c):(r(o),c())},l=u=>{URL.revokeObjectURL(s),i(u),c()},c=()=>{o.removeEventListener("load",a),o.removeEventListener("error",l)};o.addEventListener("load",a),o.addEventListener("error",l),o.src=s})}function Ef(t){if(t==null)return null;const e=t.offset!=null?t.offset:qEe,r=t.rotation!=null?t.rotation:0,i=t.scale!=null?t.scale:XEe,n=ZD(1,0,0,0,1,0,e[0],e[1],1),s=ZD(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),o=ZD(i[0],0,0,0,i[1],0,0,0,1),a=Pl();return US(a,s,o),US(a,n,a),a}J.getLogger("esri.views.3d.layers.graphics.Graphics3DMeshObject3DGraphicLayer");let $ct=class extends um{constructor(){super(...arguments),this._originalGeometries=[],this._fastTransformUpdatesEnabled=!1}get fastTransformUpdatesEnabled(){return this._fastTransformUpdatesEnabled}enableFastTransformUpdates(e,r){if(this._fastTransformUpdatesEnabled)return;this._fastTransformUpdatesEnabled=!0;const{stageObject:i}=this,n=i.geometries.slice();i.removeAllGeometries();const s=CG(lz,i.transformation),o=r.getOrigin(s);for(const a of n){const l=e(a.material),c=a.instantiate({material:l});c.localOrigin=o,i.addGeometry(c)}this._originalGeometries=n}disableFastTransformUpdates(e){if(!this._fastTransformUpdatesEnabled)return;this._fastTransformUpdatesEnabled=!1;const{stageObject:r}=this,i=r.geometries.map(n=>e(n.material));r.removeAllGeometries();for(let n=0;n{c.transformation=l,c.localOrigin=a})}updateTransform(e,r,i){const{stageObject:n}=this,s=(r==null?void 0:r.localMatrix)??yn;if(!this._fastTransformUpdatesEnabled)return n.clearShaderTransformation(),n.transformation=e,n.geometries.forEach(m=>{m.transformation=s}),void this.resetEdgeObject(i);const o=n.transformation,a=n.geometries[0].transformation,l=e,c=s,u=Vr(cle,o,a),d=Vr(ule,l,c);n.shaderTransformation=l,this._setFastMaterialTransformation({matA:u,matB:d});const p=()=>c;for(const m of n.geometries)m.shaderTransformer=p;this.resetEdgeObject(i)}alignWithElevation(e,r,i,n){if(!this._fastTransformUpdatesEnabled)return void super.alignWithElevation(e,r,i,n);i!=null&&P8(this.elevationContext.featureExpressionInfoContext,i);const s=(m,y)=>J_(m,e,this.elevationContext,r,y),{stageObject:o}=this;if(!o.geometries[0].material.parameters.modelTransformation)return;const a=o.transformation,l=o.geometries[0].transformation,c=Vr(cle,a,l),u=In(Ict,o.shaderTransformation);this.alignedSampledElevation=Lb(this,this.elevationContext,e.spatialReference,s,r,u),o.shaderTransformation=u;const d=o.geometries[0].shaderTransformation,p=Vr(ule,u,d);this._setFastMaterialTransformation({matA:c,matB:p}),this.resetEdgeObject(n)}_setFastMaterialTransformation({matA:e,matB:r}){const{stageObject:i}=this;if(i.geometries.length===0)return;const n=i.geometries[0].localOrigin,s=OP(Lct,te(lz,n.vec3,-1)),o=Vr(hle,s,e),a=Vr(dle,s,r),l=us(hle,o),c=Vr(dle,a,l);for(const u of i.geometries)u.material.setParameters({modelTransformation:c})}};const lz=O(),cle=_e(),ule=_e(),Ict=_e(),hle=_e(),dle=_e(),Lct=_e();let Dct=class{constructor(){this._fastTransformOriginalMaterials=new Map,this._fastTransformClonedMaterials=new Map,this._graphicReferenceCount=0}enable(e,r,i){e.enableFastTransformUpdates(n=>{if(this._graphicReferenceCount<=1){if(this._fastTransformOriginalMaterials.has(n))return n;const o=r.byMaterial(n);return this._fastTransformOriginalMaterials.set(n,o),r.delete(n),n}const s=new tm(n.parameters);return i.stage.add(s),this._fastTransformClonedMaterials.set(s,n),s},i.localOriginFactory)}disable(e,r,i){const n=new Set,s=new Set;e.disableFastTransformUpdates(o=>{if(!this._fastTransformClonedMaterials.has(o)){const c=o,u=this._fastTransformOriginalMaterials.get(c);return r.has(u.uid)?(n.add(c),r.byUid(u.uid).material):(s.add(c),u.material)}const a=o,l=this._fastTransformClonedMaterials.get(a);return this._fastTransformClonedMaterials.delete(a),i.stage.remove(a),a.dispose(),l});for(const o of n)this._fastTransformOriginalMaterials.delete(o),i.stage.remove(o),o.dispose();for(const o of s){const a=this._fastTransformOriginalMaterials.get(o);this._fastTransformOriginalMaterials.delete(o),r.set(a.uid,a)}}onAddGraphic(){this._graphicReferenceCount++}onRemoveGraphic(e,r,i){this._graphicReferenceCount--,this.disable(e,r,i)}forEachMaterialInfo(e){this._fastTransformOriginalMaterials.forEach(e)}forEachClonedMaterial(e){this._fastTransformClonedMaterials.forEach(e)}destroy(e){e.removeMany(Array.from(this._fastTransformClonedMaterials.keys())),e.removeMany(Array.from(this._fastTransformOriginalMaterials.values(),({material:r})=>r)),this._fastTransformClonedMaterials.clear(),this._fastTransformOriginalMaterials.clear()}},Nct=class{constructor(){this._byUid=new Map,this._byMaterial=new Map}get materials(){return Array.from(this._byUid.values(),e=>e.material)}byUid(e){return this._byUid.get(e)}byMaterial(e){return this._byMaterial.get(e)}set(e,r){this._byUid.set(e,r),this._byMaterial.set(r.material,r)}delete(e){var i;const r=(i=this._byMaterial.get(e))==null?void 0:i.uid;r&&(this._byUid.delete(r),this._byMaterial.delete(e))}has(e){return this._byUid.has(e)}forEachMaterialInfo(e){this._byUid.forEach(e)}clear(){this._byUid.clear(),this._byMaterial.clear()}};function Fct(t){const e=new mr,{vertex:r,fragment:i}=e;return e.include(Cl,t),e.include(qw,t),e.include($Ce,t),xc(r,t),t.stippleEnabled&&(e.attributes.add(E.UV0,"vec2"),e.attributes.add(E.AUXPOS1,"vec3"),r.uniforms.add(new Jt("viewport",(n,s)=>s.camera.fullViewport))),e.attributes.add(E.POSITION,"vec3"),e.varyings.add("vpos","vec3"),r.code.add(w`void main(void) { +vpos = position; +forwardNormalizedVertexColor(); +gl_Position = transformPosition(proj, view, vpos);`),t.stippleEnabled&&(r.code.add(w`vec4 vpos2 = transformPosition(proj, view, auxpos1); +vec2 ndcToPixel = viewport.zw * 0.5; +float lineSegmentPixelSize = length((vpos2.xy / vpos2.w - gl_Position.xy / gl_Position.w) * ndcToPixel);`),t.draped?r.uniforms.add(new Ce("worldToScreenRatio",(n,s)=>1/s.screenToPCSRatio)):r.code.add(w`vec3 segmentCenter = (position + auxpos1) * 0.5; +float worldToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),r.code.add(w`float discreteWorldToScreenRatio = discretizeWorldToScreenRatio(worldToScreenRatio);`),t.draped?r.code.add(w`float startPseudoScreen = uv0.y * discreteWorldToScreenRatio - mix(0.0, lineSegmentPixelSize, uv0.x); +float segmentLengthPseudoScreen = lineSegmentPixelSize;`):r.code.add(w`float segmentLengthRender = length(position - auxpos1); +float startPseudoScreen = mix(uv0.y, uv0.y - segmentLengthRender, uv0.x) * discreteWorldToScreenRatio; +float segmentLengthPseudoScreen = segmentLengthRender * discreteWorldToScreenRatio;`),r.uniforms.add(new Ce("stipplePatternPixelSize",n=>AJ(n))),r.code.add(w`vec2 stippleDistanceLimits = computeStippleDistanceLimits(startPseudoScreen, segmentLengthPseudoScreen, lineSegmentPixelSize, stipplePatternPixelSize); +vStippleDistance = mix(stippleDistanceLimits.x, stippleDistanceLimits.y, uv0.x); +vStippleDistance *= gl_Position.w;`)),r.code.add(w`}`),t.output===D.Highlight&&e.include(c0,t),e.include(fn,t),i.uniforms.add(new Ce("alphaCoverage",(n,s)=>Math.min(1,n.width*s.camera.pixelRatio))),t.hasVertexColors||i.uniforms.add(new Jt("constantColor",n=>n.color)),i.code.add(w` + void main() { + discardBySlice(vpos); + + vec4 color = ${t.hasVertexColors?"vColor":"constantColor"}; + + float stippleAlpha = getStippleAlpha(); + discardByStippleAlpha(stippleAlpha, stippleAlphaColorDiscard); + + vec4 finalColor = blendStipple(vec4(color.rgb, color.a * alphaCoverage), stippleAlpha); + + ${t.output===D.ObjectAndLayerIdColor?w`finalColor.a = 1.0;`:""} + + if (finalColor.a < ${w.float(vo)}) { + discard; + } + + ${t.output===D.Color?w`fragColor = highlightSlice(finalColor, vpos);`:""} + ${t.output===D.Highlight?w`outputHighlight();`:""} + } + `),e}const Uct=Object.freeze(Object.defineProperty({__proto__:null,build:Fct},Symbol.toStringTag,{value:"Module"}));let dAe=class pAe extends Tr{get _stippleEnabled(){return this.configuration.stippleEnabled&&this.configuration.output!==D.Highlight}initializeProgram(e){return new vr(e.rctx,pAe.shader.get().build(this.configuration),fr)}initializePipeline(){const e=this.configuration,r=So(ve.SRC_ALPHA,ve.ONE,ve.ONE_MINUS_SRC_ALPHA,ve.ONE_MINUS_SRC_ALPHA),i=(n,s=null,o=null)=>Ot({blending:s,depthTest:RJ,depthWrite:o,colorWrite:Ft,stencilWrite:e.hasOccludees?em:null,stencilTest:e.hasOccludees?n?r1:m1:null});return e.output===D.Color?(this._occludeePipelineState=i(!0,e.transparent||this._stippleEnabled?r:null,$l),i(!1,e.transparent||this._stippleEnabled?r:null,$l)):i(!1)}get primitiveType(){return Et.LINES}getPipelineState(e,r){return r?this._occludeePipelineState:super.getPipelineState(e,r)}};dAe.shader=new _r(Uct,()=>ce(()=>import("./NativeLine.glsl-1fd72627.js"),[]));let Bc=class extends Fo{constructor(){super(...arguments),this.output=D.Color,this.hasSlicePlane=!1,this.hasVertexColors=!1,this.transparent=!1,this.draped=!1,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stipplePreferContinuous=!0,this.hasOccludees=!1}};h([U({count:D.COUNT})],Bc.prototype,"output",void 0),h([U()],Bc.prototype,"hasSlicePlane",void 0),h([U()],Bc.prototype,"hasVertexColors",void 0),h([U()],Bc.prototype,"transparent",void 0),h([U()],Bc.prototype,"draped",void 0),h([U()],Bc.prototype,"stippleEnabled",void 0),h([U()],Bc.prototype,"stippleOffColorEnabled",void 0),h([U()],Bc.prototype,"stipplePreferContinuous",void 0),h([U()],Bc.prototype,"hasOccludees",void 0),h([U({constValue:!1})],Bc.prototype,"stippleRequiresClamp",void 0),h([U({constValue:!1})],Bc.prototype,"stippleScaleWithLineWidth",void 0),h([U({constValue:!1})],Bc.prototype,"stippleRequiresStretchMeasure",void 0);var j5;(function(t){t[t.START=0]="START",t[t.END=1]="END"})(j5||(j5={}));let ple=class extends p1{constructor(e){super(e,new Bct),this._configuration=new Bc}getConfiguration(e,r){this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.draped=r.slot===le.DRAPED_MATERIAL;const i=this.parameters.stipplePattern!=null;return this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&this.parameters.stippleOffColor!=null,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.stipplePreferContinuous=this.parameters.stipplePreferContinuous,this._configuration}intersect(e,r,i,n,s,o){if(!i.options.selectionMode||!e.visible)return;if(!Jwe(r))return void J.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const a=e.vertexAttributes.get(E.POSITION).data,l=i.camera,c=Gct;fs(c,i.point);const u=2;ne($C[0],c[0]-u,c[1]+u,0),ne($C[1],c[0]+u,c[1]+u,0),ne($C[2],c[0]+u,c[1]-u,0),ne($C[3],c[0]-u,c[1]-u,0);for(let _=0;_<4;_++)if(!l.unprojectFromRenderScreen($C[_],xm[_]))return;oa(l.eye,xm[0],xm[1],cz),oa(l.eye,xm[1],xm[2],uz),oa(l.eye,xm[2],xm[3],hz),oa(l.eye,xm[3],xm[0],dz);let d=Number.MAX_VALUE,p=0;for(let _=0;_0){ae(Fp,Ma,$a);const b=l.frustum,x=-oi(b[si.NEAR],Ma)/fe(Fp,b[si.NEAR]);te(Fp,Fp,x),oe(Ma,Ma,Fp),l.projectToRenderScreen(Ma,V1)}else if(V1[2]>0&&G1[2]<0){ae(Fp,$a,Ma);const b=l.frustum,x=-oi(b[si.NEAR],$a)/fe(Fp,b[si.NEAR]);te(Fp,Fp,x),oe($a,$a,Fp),l.projectToRenderScreen($a,G1)}else if(V1[2]<0&&G1[2]<0)continue;V1[2]=0,G1[2]=0;const v=wZ(Pb(V1,G1,gle),c);vd=l[C]:(S,A,C)=>d+=ci(S,A);for(let S=1;S<_;S+=2){const A=3*o[S];ne(y,a[A],a[A+1],a[A+2]),e&&De(y,y,e),b(m,y,v++);for(let C=0;C<2;++C)u[n]=1-C,u[n+1]=d,n+=c;re(m,y)}const x=3*o[_];ne(y,a[x],a[x+1],a[x+2]),e&&De(y,y,e),b(m,y,v),u[n]=j5.END,u[n+1]=d}},Bct=class extends KQ{constructor(){super(...arguments),this.color=mh,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1,this.stipplePreferContinuous=!0,this.hasOccludees=!1,this.stippleTexture=null}};const Ma=O(),$a=O(),Fp=O(),B1=O(),V1=Vo(),G1=Vo(),fle=O(),mle=O(),gle=_p(),Vct=_p(),Gct=O(),$C=[Vo(),Vo(),Vo(),Vo()],xm=[O(),O(),O(),O()],cz=Er(),uz=Er(),hz=Er(),dz=Er(),jct=["mesh"];let Hct=class extends hm{constructor(e,r,i,n){super(e,r,i,n),this._materialInfoCache=new Nct,this._fastUpdateProcessor=new Dct,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){Kr.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new ple({color:[1,0,1,1]}),this._debugFaceNormalMaterial=new ple({color:[0,1,1,1]}))}destroy(){super.destroy(),this._context.stage.removeMany(this._materialInfoCache.materials),this._context.stage.removeMany(Array.from(this._textures.values())),this._materialInfoCache.clear(),this._textures.clear(),this._fastUpdateProcessor.destroy(this._context.stage)}createGraphics3DGraphic(e){const r=e.graphic;if(!this._validateGeometry(r.geometry,jct,"fill on mesh-3d"))return null;const i=this.setGraphicElevationContext(r,new wp),n=e.renderingInfo;return this._createAs3DShape(r,n,i,r.uid)}onRemoveGraphic(e){this._fastUpdateProcessor.onRemoveGraphic(e,this._materialInfoCache,this._context)}layerOpacityChanged(e,r){const i=this._getLayerOpacity();this._updateMaterialParameters(n=>{n.material.setParameters({layerOpacity:i});const s=n.material.parameters;this._setMaterialTransparentParameter(s,n),n.material.setParameters({transparent:s.transparent})}),e.forEach(n=>{const s=r(n);s!=null&&s.layerOpacityChanged(i,this._context.isAsync)})}layerElevationInfoChanged(e,r){return this.updateGraphics3DGraphicElevationInfo(e,r,K_)}slicePlaneEnabledChanged(e,r){return this._updateMaterialParameters(({material:i})=>{i.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),e.forEach(i=>{const n=r(i);n!=null&&n.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._updateMaterialParameters(({material:r})=>r.setParameters({usePBR:e})),!0}updateTransform(e,r,i,n){const s=this._context.renderCoordsHelper.spatialReference,o=Wct,{origin:a,transform:l}=i;switch(ma(r,ne(no,a.x,a.y,a.z??0),o,s),n){case bO.EnableFastUpdates:this._fastUpdateProcessor.enable(e,this._materialInfoCache,this._context);break;case bO.DisableFastUpdates:this._fastUpdateProcessor.disable(e,this._materialInfoCache,this._context);break;case bO.UpdateFastLocalOrigin:e.updateFastLocalOrigin(o,l,this._context.localOriginFactory)}const{elevationContext:c}=e;c.centerPointInElevationSR=this._getCenterPointInElevationSR(o);const{elevationProvider:u,renderCoordsHelper:d}=this._context,p=(m,y)=>J_(m,u,c,d,y);return e.alignedSampledElevation=Lb(e,c,u.spatialReference,p,d,o),e.updateTransform(o,l,this._context.isAsync),!0}_requiresSymbolVertexColors(){return this._drivenProperties.color||this._drivenProperties.opacity}_colorOrTextureUid(e){return e==null?"-":e instanceof it?e.toHex():e.contentHash}_materialPropertiesDefault(e,r){const i=this._requiresSymbolVertexColors(),n=!!e.vertexAttributes.color,s=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:i,hasVertexColors:n,hasVertexTangents:s,uid:`vc:${n},vt:${s},vct${r},svc:${i}`}}_textureTransformUid(e){const{offset:r,scale:i,rotation:n}=e??Xct;return`${r[0]},${r[1]},${n},${i[0]},${i[1]}`}_materialProperties(e,r,i){const n=this._materialPropertiesDefault(e,i);if(!r.material)return n;const{color:s,colorTexture:o,colorTextureTransform:a,normalTexture:l,normalTextureTransform:c,doubleSided:u,alphaCutoff:d,alphaMode:p}=r.material,m=this._colorOrTextureUid(s),y=this._colorOrTextureUid(o),_=this._textureTransformUid(a),v=this._colorOrTextureUid(l),b=this._textureTransformUid(c);if(n.color=s,n.colorTexture=o,n.normalTexture=l,n.uid=`${n.uid},cmuid:${m},ctmuid:${y},cttuid:${_},ntmuid:${v},nttuid:${b},ds:${u},ac:${d},am:${p}`,r.material instanceof sAe){const{metallic:x,roughness:T,metallicRoughnessTexture:S,metallicRoughnessTextureTransform:A,emissiveColor:C,emissiveTexture:R,emissiveTextureTransform:P,occlusionTexture:F,occlusionTextureTransform:k}=r.material,V=this._colorOrTextureUid(S),z=this._textureTransformUid(A),X=this._colorOrTextureUid(C),q=this._colorOrTextureUid(R),G=this._textureTransformUid(P),Q=this._colorOrTextureUid(F),M=this._textureTransformUid(k);n.metallic=x,n.roughness=T,n.metallicRoughnessTexture=S,n.emissiveColor=C,n.emissiveTexture=R,n.occlusionTexture=F,n.colorTextureTransform=this._convertTextureTransform(a),n.normalTextureTransform=this._convertTextureTransform(c),n.emissiveTextureTransform=this._convertTextureTransform(P),n.occlusionTextureTransform=this._convertTextureTransform(k),n.metallicRoughnessTextureTransform=this._convertTextureTransform(A),n.uid=`${n.uid},mrm:${x},mrr:${T},mrt:${V},mrtt:${z},emuid:${X},etmuid:${q},ett:${G},otmuid:${Q},ott:${M}`}return n}_convertTextureTransform(e){if(!e)return null;const{scale:r,offset:i,rotation:n}=e;return{scale:r,offset:i,rotation:It(n)}}_setInternalColorValueParameters(e,r){r.diffuse=it.toUnitRGB(e),r.opacity=e.a}_getLoadableTextureResource(e){return e.data?e.data:e.url}_getInternalTextureId(e){const r=this._getInternalTexture(e,Gr.Opaque);return r!=null?r.id:null}_getInternalTexture(e,r){const i=this._getLoadableTextureResource(e);if(!i)return null;const n=`${e.contentHash}/${r}`;let s=this._textures.get(n);return s||(s=new Hw(Ub(i)?i.data:i,{mipmap:!0,wrap:this._castTextureWrap(e.wrap),noUnpackFlip:!0,preMultiplyAlpha:!Ub(i)&&r!==Gr.Opaque,encoding:Ub(i)&&i.encoding!=null?i.encoding:void 0}),this._textures.set(n,s),this._context.stage.add(s),this._context.stage.loadImmediate(s)),s}_castTextureWrap(e="repeat"){if(typeof e=="string"){const r=this._castTextureWrapIndividual(e);return{s:r,t:r}}return{s:this._castTextureWrapIndividual(e.horizontal),t:this._castTextureWrapIndividual(e.vertical)}}_castTextureWrapIndividual(e){switch(e){case"clamp":return Pt.CLAMP_TO_EDGE;case"mirror":return Pt.MIRRORED_REPEAT;default:return Pt.REPEAT}}_setInternalMaterialParameters(e,r){if(e.color!=null&&this._setInternalColorValueParameters(e.color,r),e.colorTexture!=null){const i=this._getInternalTexture(e.colorTexture,r.textureAlphaMode);i!=null?(r.textureId=i.id,r.textureAlphaPremultiplied=!!i.parameters.preMultiplyAlpha):r.textureId=void 0}e.normalTexture!=null&&(r.normalTextureId=this._getInternalTextureId(e.normalTexture)),e.emissiveColor!=null&&(r.emissiveFactor=it.toUnitRGB(e.emissiveColor)),e.emissiveTexture!=null&&(r.emissiveTextureId=this._getInternalTextureId(e.emissiveTexture)),e.occlusionTexture!=null&&(r.occlusionTextureId=this._getInternalTextureId(e.occlusionTexture)),e.metallicRoughnessTexture!=null&&(r.metallicRoughnessTextureId=this._getInternalTextureId(e.metallicRoughnessTexture)),r.colorTextureTransformMatrix=Ef(e.colorTextureTransform),r.normalTextureTransformMatrix=Ef(e.normalTextureTransform),r.occlusionTextureTransformMatrix=Ef(e.occlusionTextureTransform),r.emissiveTextureTransformMatrix=Ef(e.emissiveTextureTransform),r.metallicRoughnessTextureTransformMatrix=Ef(e.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(e){const r=this._drivenProperties.color;let i=this.symbolLayer.material!=null?this.symbolLayer.material.colorMixMode:null;if(r)e.externalColor=mh;else{const n=this.symbolLayer.material!=null?this.symbolLayer.material.color:null;n!=null?e.externalColor=it.toUnitRGBA(n):(i=null,e.externalColor=mh)}i&&(e.colorMixMode=i),e.castShadows=!!this.symbolLayer.castShadows}_hasTransparentVertexColors(e){const r=e.vertexAttributes.color;if(r==null)return!1;for(let i=3;iJ_(v,m,i,y,b);return p.alignedSampledElevation=Lb(p,i,m.spatialReference,_,y),p}_getCenterPointInElevationSR(e){const r=Ww(0,0,0,this._context.elevationProvider.spatialReference!=null?this._context.elevationProvider.spatialReference:null);return hZ([e[12],e[13],e[14]],this._context.renderCoordsHelper.spatialReference,r),r}_createComponentNormals(e,r,i,n){switch(i.shading||"flat"){default:case"source":return this._createComponentNormalsSource(e,r,i,n);case"flat":return this._createComponentNormalsFlat(e,n);case"smooth":return this._createComponentNormalsSmooth(e,n)}}_createComponentNormalsSource(e,r,i,n){if(r==null)return this._createComponentNormalsFlat(e,n);let s=!1;if(!i.trustSourceNormals)for(let o=0;os&&(s=a)}if(i<=s)return this.logger.warn(`Vertex index ${s} is out of bounds of the mesh position buffer`),!1}else if(i%3!=0)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0}_getOrCreateFaces(e,r){return r.faces??zS(e.vertexAttributes.position.length/3)}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const r=e.vertexAttributes&&e.vertexAttributes.position;if(!r)return!1;const i=this._context.elevationProvider.spatialReference;let n;const s=r.length/3;return i==null||e.spatialReference.equals(i)?n=r:(n=new Float64Array(r.length),$i(e.vertexAttributes.position,e.spatialReference,0,n,i,0,s)),vi(fz),lu(fz,n,0,s),!Hd(fz,this._context.clippingExtent)}_createGeometryInfo(e,r,i){if(!Bg(e.spatialReference,this._context.graphicsCoreOwner.view.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(this._isOutsideClippingArea(e))return null;const n=this._createBuffers(e,r);if(n==null)return null;const{positionBuffer:s,uvBuffer:o,colorBuffer:a,symbolColorBuffer:l,normalBuffer:c,tangentBuffer:u,objectTransformation:d,geometryTransformation:p}=n,m=this._getOrCreateComponents(e),y=new Array;let _=!1;for(const v of m){if(!this._validateFaces(e,v))return null;const b=this._getOrCreateFaces(e,v);if(b.length===0)continue;const x=this._createComponentNormals(s,c,v,b);x.didFlipNormals&&(_=!0);const T=[[E.POSITION,new Ue(s,3,!0)],[E.NORMAL,new Ue(x.normals,3,!0)]],S=[[E.POSITION,b],[E.NORMAL,x.indices]];a!=null&&(T.push([E.COLOR,new Ue(a,4,!0)]),S.push([E.COLOR,b])),l!=null&&(T.push([E.SYMBOLCOLOR,new Ue(l,4,!0)]),S.push([E.SYMBOLCOLOR,OE(b.length)])),o!=null&&(T.push([E.UV0,new Ue(o,2,!0)]),S.push([E.UV0,b])),u!=null&&(T.push([E.TANGENT,new Ue(u,4,!0)]),S.push([E.TANGENT,b]));const A=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:i,layerUid:this._context.layer.uid}),C=this._getOrCreateMaterial(e,v),R=new Xn(C,T,S,null,on.Mesh,A);R.transformation=p,y.push(R)}return _&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:y,objectTransformation:d}}_updateMaterialParameters(e){this._materialInfoCache.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachClonedMaterial((r,i)=>{i.setParameters(r.parameters)})}test(){return{...super.test(),materials:this._materialInfoCache.materials}}};class pz{constructor(e,r,i){this.normals=e,this.indices=r,this.didFlipNormals=i}}const SI=O(),no=O(),Ox=O(),Rx=O(),Px=O(),yle=_e(),IC=hi(),Wct=_e(),fz=ps(),qct=[new xw],Xct=new XT;var Kl;(function(t){t[t.NONE=0]="NONE",t[t.ECEF=1]="ECEF"})(Kl||(Kl={}));let Yct=class{constructor(e,r,i,n){this.graphics3DSymbolLayer=e,this.instanceIndex=r,this.elevationAligner=i,this.elevationContext=n,this.type="lod-instance",this._highlights=new Set,this.alignedSampledElevation=0,this.isElevationSource=!1,this.needsElevationUpdates=!1}initialize(){}setVisibility(e){const r=this._lodRenderer.instanceData;e!==r.getVisible(this.instanceIndex)&&r.setVisible(this.instanceIndex,e)}destroy(){this.instanceIndex!=null&&(this._lodRenderer.instanceData.removeInstance(this.instanceIndex),this.graphics3DSymbolLayer.notifyDestroyGraphicLayer(this))}alignWithElevation(e,r,i){if(this.elevationAligner){P8(this.elevationContext.featureExpressionInfoContext,i);const n=(o,a)=>J_(o,e,this.elevationContext,r,a),s=this.elevationAligner(this,this.elevationContext,e.spatialReference,n,r);s!=null&&(this.alignedSampledElevation=s)}}getCenterObjectSpace(e=O()){return this._lodRenderer.instanceData.getCombinedLocalTransform(this.instanceIndex,Up),De(e,this._lodRenderer.baseBoundingSphere.center,Up)}getBoundingBoxObjectSpace(e=ps()){this._lodRenderer.instanceData.getCombinedLocalTransform(this.instanceIndex,Up);const r=this._lodRenderer.baseBoundingBox;vi(e);for(let i=0;i<8;++i)ne($u,1&i?r[3]:r[0],2&i?r[4]:r[1],4&i?r[5]:r[2]),De($u,$u,Up),Xf(e,$u);return e}computeAttachmentOrigin(e){this._lodRenderer.instanceData.getGlobalTransform(this.instanceIndex,Up),e.render.origin[0]+=Up[12],e.render.origin[1]+=Up[13],e.render.origin[2]+=Up[14],e.render.num++}async getProjectedBoundingBox(e,r,i,n,s){const o=this.getBoundingBoxObjectSpace(s),a=Zct,l=QY(o)?1:a.length;this._lodRenderer.instanceData.getGlobalTransform(this.instanceIndex,Up);for(let u=0;u{this._removeHighlightId(n)},i)}}removeObjectState(e){this._highlights.forEach(r=>e.remove(r))}_addHighlightId(e){this._highlights.add(e),this._lodRenderer.instanceData.setHighlight(this.instanceIndex,!0)}_removeHighlightId(e){this._highlights.delete(e),this._lodRenderer.instanceData.setHighlight(this.instanceIndex,this._highlights.size>0)}get _lodRenderer(){return this.graphics3DSymbolLayer.lodRenderer}};const j1=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],$u=O(),mz=O(),Zct=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]],Up=_e();function Qct(t){const e=new Array;return t.stageResources.geometries.forEach(r=>{const i=t.stageResources.textures;e.push(new DEe(r,i))}),{components:e,minScreenSpaceRadius:t.lodThreshold??0,pivotOffset:t.pivotOffset}}function Jct(t){return{levels:t.map(e=>Qct(e))}}function Kct(t){return t=t||globalThis.location.hostname,eut.some(e=>(t==null?void 0:t.match(e))!=null)}function uW(t,e){return t&&(e=e||globalThis.location.hostname)?e.match(fAe)!=null||e.match(gAe)!=null?t.replace("static.arcgis.com","staticdev.arcgis.com"):e.match(mAe)!=null||e.match(yAe)!=null?t.replace("static.arcgis.com","staticqa.arcgis.com"):t:t}const fAe=/^devext.arcgis.com$/,mAe=/^qaext.arcgis.com$/,gAe=/^[\w-]*\.mapsdevext.arcgis.com$/,yAe=/^[\w-]*\.mapsqa.arcgis.com$/,eut=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,fAe,mAe,/^jsapps.esri.com$/,gAe,yAe];function tut(t,e,r){if(t.count!==e.count)return void $8.error("source and destination buffers need to have the same number of elements");const i=t.count,n=r[0],s=r[1],o=r[2],a=r[3],l=r[4],c=r[5],u=r[6],d=r[7],p=r[8],m=r[9],y=r[10],_=r[11],v=r[12],b=r[13],x=r[14],T=r[15],S=t.typedBuffer,A=t.typedBufferStride,C=e.typedBuffer,R=e.typedBufferStride;for(let P=0;P0){const y=1/Math.sqrt(m);i[l]=y*u,i[l+1]=y*d,i[l+2]=y*p}}}function nut(t,e,r){H5(t.typedBuffer,e,r,t.typedBufferStride)}function H5(t,e,r,i=4){const n=Math.min(t.length/i,e.count),s=e.typedBuffer,o=e.typedBufferStride;let a=0,l=0;for(let c=0;c{const e={...vAe,...t.pbrMetallicRoughness},r=gut({...mut,...t.extras});return{...fut,...t,pbrMetallicRoughness:e,extras:r}};function gut(t){switch(t.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:t.ESRI_externalColorMixMode,t.ESRI_externalColorMixMode="tint"}return t}const yut={magFilter:At.LINEAR,minFilter:At.LINEAR_MIPMAP_LINEAR,wrapS:Pt.REPEAT,wrapT:Pt.REPEAT},_ut=t=>({...yut,...t});function vut(t){let e,r;return t.replace(/^(.*\/)?([^/]*)$/,(i,n,s)=>(e=n||"",r=s||"","")),{dirPart:e,filePart:r}}const EI={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};let but=class wy{constructor(e,r,i,n){if(this._context=e,this.uri=r,this.json=i,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu"],this._baseUri=vut(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),i.scenes==null)throw new Y("gltf-loader-unsupported-feature","Scenes must be defined.");if(i.meshes==null)throw new Y("gltf-loader-unsupported-feature","Meshes must be defined");if(i.nodes==null)throw new Y("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(e,r,i){if(im(r)){const o=Xb(r);if(o&&o.mediaType!=="model/gltf-binary")try{const l=JSON.parse(o.isBase64?atob(o.data):o.data);return new wy(e,r,l)}catch{}const a=BX(r);if(wy._isGLBData(a))return this._fromGLBData(e,r,a)}if(r.endsWith(".gltf")){const o=await e.loadJSON(r,i);return new wy(e,r,o)}const n=await e.loadBinary(r,i);if(wy._isGLBData(n))return this._fromGLBData(e,r,n);const s=await e.loadJSON(r,i);return new wy(e,r,s)}static _isGLBData(e){if(e==null)return!1;const r=new _le(e);return r.remainingBytes()>=4&&r.readUint32()===EI.MAGIC}static async _fromGLBData(e,r,i){const n=await wy._parseGLBData(i);return new wy(e,r,n.json,n.binaryData)}static async _parseGLBData(e){const r=new _le(e);if(r.remainingBytes()<12)throw new Y("gltf-loader-error","GLB binary data is insufficiently large.");const i=r.readUint32(),n=r.readUint32(),s=r.readUint32();if(i!==EI.MAGIC)throw new Y("gltf-loader-error","Magic first 4 bytes do not fit to expected GLB value.");if(e.byteLength=8;){const c=r.readUint32(),u=r.readUint32();if(l===0){if(u!==EI.CHUNK_TYPE_JSON)throw new Y("gltf-loader-error","First GLB chunk must be JSON.");if(c<0)throw new Y("gltf-loader-error","No JSON data found.");o=await Pct(r.readUint8Array(c))}else if(l===1){if(u!==EI.CHUNK_TYPE_BIN)throw new Y("gltf-loader-unsupported-feature","Second GLB chunk expected to be BIN.");a=r.readUint8Array(c)}else J.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 GLB chunks detected. Skipping.");l+=1}if(!o)throw new Y("gltf-loader-error","No GLB JSON chunk detected.");return{json:o,binaryData:a}}async getBuffer(e,r){const i=this.json.buffers[e];if(i.uri==null){if(this._glbBuffer==null)throw new Y("gltf-loader-error","GLB buffer not present");return this._glbBuffer}const n=await this._getBufferLoader(e,r);if(n.byteLength!==i.byteLength)throw new Y("gltf-loader-error","Buffer byte lengths should match.");return n}async _getBufferLoader(e,r){const i=this._bufferLoaders.get(e);if(i)return i;const n=this.json.buffers[e].uri,s=this._context.loadBinary(this._resolveUri(n),r).then(o=>new Uint8Array(o));return this._bufferLoaders.set(e,s),s}async getAccessor(e,r){if(!this.json.accessors)throw new Y("gltf-loader-unsupported-feature","Accessors missing.");const i=this.json.accessors[e];if((i==null?void 0:i.bufferView)==null)throw new Y("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");if(i.type in[wO.MAT2,wO.MAT3,wO.MAT4])throw new Y("gltf-loader-unsupported-feature",`AttributeType ${i.type} is not supported`);const n=this.json.bufferViews[i.bufferView],s=await this.getBuffer(n.buffer,r),o=Tut[i.type],a=Sut[i.componentType],l=o*a,c=n.byteStride||l;return{raw:s.buffer,byteStride:c,byteOffset:s.byteOffset+(n.byteOffset||0)+(i.byteOffset||0),entryCount:i.count,isDenselyPacked:c===l,componentCount:o,componentByteSize:a,componentType:i.componentType,min:i.min,max:i.max,normalized:!!i.normalized}}async getIndexData(e,r){if(e.indices==null)return;const i=await this.getAccessor(e.indices,r);if(i.isDenselyPacked)switch(i.componentType){case Qe.UNSIGNED_BYTE:return new Uint8Array(i.raw,i.byteOffset,i.entryCount);case Qe.UNSIGNED_SHORT:return new Uint16Array(i.raw,i.byteOffset,i.entryCount);case Qe.UNSIGNED_INT:return new Uint32Array(i.raw,i.byteOffset,i.entryCount)}else switch(i.componentType){case Qe.UNSIGNED_BYTE:return KD(this._wrapAccessor(kS,i));case Qe.UNSIGNED_SHORT:return KD(this._wrapAccessor(o8,i));case Qe.UNSIGNED_INT:return KD(this._wrapAccessor(l8,i))}}async getPositionData(e,r){if(e.attributes.POSITION==null)throw new Y("gltf-loader-unsupported-feature","No POSITION vertex data found.");const i=await this.getAccessor(e.attributes.POSITION,r);if(i.componentType!==Qe.FLOAT)throw new Y("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+Qe[i.componentType]);if(i.componentCount!==3)throw new Y("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+i.componentCount.toFixed());return this._wrapAccessor(ds,i)}async getNormalData(e,r){if(e.attributes.NORMAL==null)throw new Y("gltf-loader-error","No NORMAL vertex data found.");const i=await this.getAccessor(e.attributes.NORMAL,r);if(i.componentType!==Qe.FLOAT)throw new Y("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+Qe[i.componentType]);if(i.componentCount!==3)throw new Y("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+i.componentCount.toFixed());return this._wrapAccessor(ds,i)}async getTangentData(e,r){if(e.attributes.TANGENT==null)throw new Y("gltf-loader-error","No TANGENT vertex data found.");const i=await this.getAccessor(e.attributes.TANGENT,r);if(i.componentType!==Qe.FLOAT)throw new Y("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+Qe[i.componentType]);if(i.componentCount!==4)throw new Y("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+i.componentCount.toFixed());return new pp(i.raw,i.byteOffset,i.byteStride,i.byteOffset+i.byteStride*i.entryCount)}async getTextureCoordinates(e,r){if(e.attributes.TEXCOORD_0==null)throw new Y("gltf-loader-error","No TEXCOORD_0 vertex data found.");const i=await this.getAccessor(e.attributes.TEXCOORD_0,r);if(i.componentCount!==2)throw new Y("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+i.componentCount.toFixed());if(i.componentType===Qe.FLOAT)return this._wrapAccessor(d1,i);if(!i.normalized)throw new Y("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return Eut(i)}async getVertexColors(e,r){if(e.attributes.COLOR_0==null)throw new Y("gltf-loader-error","No COLOR_0 vertex data found.");const i=await this.getAccessor(e.attributes.COLOR_0,r);if(i.componentCount!==4&&i.componentCount!==3)throw new Y("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+i.componentCount.toFixed());if(i.componentCount===4){if(i.componentType===Qe.FLOAT)return this._wrapAccessor(pp,i);if(i.componentType===Qe.UNSIGNED_BYTE)return this._wrapAccessor(ya,i);if(i.componentType===Qe.UNSIGNED_SHORT)return this._wrapAccessor(DP,i)}else if(i.componentCount===3){if(i.componentType===Qe.FLOAT)return this._wrapAccessor(ds,i);if(i.componentType===Qe.UNSIGNED_BYTE)return this._wrapAccessor(s8,i);if(i.componentType===Qe.UNSIGNED_SHORT)return this._wrapAccessor(a8,i)}throw new Y("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+Qe[i.componentType])}hasPositions(e){return e.attributes.POSITION!==void 0}hasNormals(e){return e.attributes.NORMAL!==void 0}hasVertexColors(e){return e.attributes.COLOR_0!==void 0}hasTextureCoordinates(e){return e.attributes.TEXCOORD_0!==void 0}hasTangents(e){return e.attributes.TANGENT!==void 0}async getMaterial(e,r,i){var s,o,a,l,c,u,d,p,m,y;let n=e.material?this._materialCache.get(e.material):void 0;if(!n){const _=e.material!=null?ble(this.json.materials[e.material]):ble(),v=_.pbrMetallicRoughness,b=this.hasVertexColors(e),x=this.getTexture(v.baseColorTexture,r),T=this.getTexture(_.normalTexture,r),S=i?this.getTexture(_.occlusionTexture,r):void 0,A=i?this.getTexture(_.emissiveTexture,r):void 0,C=i?this.getTexture(v.metallicRoughnessTexture,r):void 0,R=e.material!=null?e.material:-1;n={alphaMode:_.alphaMode,alphaCutoff:_.alphaCutoff,color:v.baseColorFactor,doubleSided:!!_.doubleSided,colorTexture:await x,normalTexture:await T,name:_.name,id:R,occlusionTexture:await S,emissiveTexture:await A,emissiveFactor:_.emissiveFactor,metallicFactor:v.metallicFactor,roughnessFactor:v.roughnessFactor,metallicRoughnessTexture:await C,hasVertexColors:b,ESRI_externalColorMixMode:_.extras.ESRI_externalColorMixMode,colorTextureTransform:(o=(s=v==null?void 0:v.baseColorTexture)==null?void 0:s.extensions)==null?void 0:o.KHR_texture_transform,normalTextureTransform:(l=(a=_.normalTexture)==null?void 0:a.extensions)==null?void 0:l.KHR_texture_transform,occlusionTextureTransform:(u=(c=_.occlusionTexture)==null?void 0:c.extensions)==null?void 0:u.KHR_texture_transform,emissiveTextureTransform:(p=(d=_.emissiveTexture)==null?void 0:d.extensions)==null?void 0:p.KHR_texture_transform,metallicRoughnessTextureTransform:(y=(m=v==null?void 0:v.metallicRoughnessTexture)==null?void 0:m.extensions)==null?void 0:y.KHR_texture_transform}}return n}async getTexture(e,r){if(!e)return;if((e.texCoord||0)!==0)throw new Y("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const i=e.index,n=this.json.textures[i],s=_ut(n.sampler!=null?this.json.samplers[n.sampler]:{}),o=this._getTextureSourceId(n),a=this.json.images[o],l=await this._loadTextureImageData(i,n,r);return Uge(this._textureCache,i,()=>{const c=d=>d===33071||d===33648||d===10497,u=d=>{throw new Y("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${d}`)};return{data:l,wrapS:c(s.wrapS)?s.wrapS:u(s.wrapS),wrapT:c(s.wrapT)?s.wrapT:u(s.wrapT),minFilter:s.minFilter,name:a.name,id:i}})}getNodeTransform(e){if(e===void 0)return wut;let r=this._nodeTransformCache.get(e);if(!r){const i=this.getNodeTransform(this._getNodeParent(e)),n=this.json.nodes[e];n.matrix?r=Vr(_e(),i,n.matrix):n.translation||n.rotation||n.scale?(r=RS(i),n.translation&&Ml(r,r,n.translation),n.rotation&&(CI[3]=yQ(CI,n.rotation),mc(r,r,CI[3],CI)),n.scale&&AP(r,r,n.scale)):r=RS(i),this._nodeTransformCache.set(e,r)}return r}_wrapAccessor(e,r){return new e(r.raw,r.byteOffset,r.byteStride,r.byteOffset+r.byteStride*(r.entryCount-1)+r.componentByteSize*r.componentCount)}_resolveUri(e){return iu(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=eE.parse(this.json.asset.version,"glTF");xut.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json;if(e.extensionsRequired&&!e.extensionsRequired.every(r=>this._supportedExtensions.includes(r)))throw new Y("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach((e,r)=>{e.children&&e.children.forEach(i=>{this._nodeParentMap.set(i,r)})})}async _loadTextureImageData(e,r,i){const n=this._textureLoaders.get(e);if(n)return n;const s=this._createTextureLoader(r,i);return this._textureLoaders.set(e,s),s}_getTextureSourceId(e){if(e.extensions!==void 0&&e.extensions.KHR_texture_basisu!==null)return e.extensions.KHR_texture_basisu.source;if(e.source!==null)return e.source;throw new Y("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}async _createTextureLoader(e,r){const i=this._getTextureSourceId(e),n=this.json.images[i];if(n.uri){if(n.uri.endsWith(".ktx2")){const l=await this._context.loadBinary(this._resolveUri(n.uri),r);return new hAe(new Uint8Array(l))}return this._context.loadImage(this._resolveUri(n.uri),r)}if(n.bufferView==null)throw new Y("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(n.mimeType==null)throw new Y("gltf-loader-unsupported-feature","Image mimeType must be defined.");const s=this.json.bufferViews[n.bufferView],o=await this.getBuffer(s.buffer,r);if(s.byteStride!=null)throw new Y("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const a=o.byteOffset+(s.byteOffset||0);return Mct(new Uint8Array(o.buffer,a,s.byteLength),n.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await e4(Array.from(this._bufferLoaders.values())),r=await e4(Array.from(this._textureLoaders.values()));return e.reduce((i,n)=>i+((n==null?void 0:n.byteLength)??0),0)+r.reduce((i,n)=>i+(n?Ub(n)?n.data.byteLength:n.width*n.height*4:0),0)}};const wut=cve(_e(),Math.PI/2),xut=new eE(2,0,"glTF"),CI=Au(),Tut={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Sut={[Qe.BYTE]:1,[Qe.UNSIGNED_BYTE]:1,[Qe.SHORT]:2,[Qe.UNSIGNED_SHORT]:2,[Qe.FLOAT]:4,[Qe.INT]:4,[Qe.UNSIGNED_INT]:4};function Eut(t){switch(t.componentType){case Qe.BYTE:return new c8(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount);case Qe.UNSIGNED_BYTE:return new n8(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount);case Qe.SHORT:return new NP(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount);case Qe.UNSIGNED_SHORT:return new fQ(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount);case Qe.UNSIGNED_INT:return new mQ(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount);case Qe.FLOAT:return new d1(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount)}}let Cut=0;async function bAe(t,e,r={},i=!0){const n=await but.load(t,e,r),s="gltf_"+Cut++,o={lods:[],materials:new Map,textures:new Map,meta:Aut(n)},a=!(!n.json.asset.extras||n.json.asset.extras.ESRI_type!=="symbolResource"),l=new Map;await Out(n,async(u,d,p,m)=>{const y=l.get(p)??0;l.set(p,y+1);const _=u.mode!==void 0?u.mode:Et.TRIANGLES,v=_===Et.TRIANGLES||_===Et.TRIANGLE_STRIP||_===Et.TRIANGLE_FAN?_:null;if(v==null)return void J.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+Et[_]+"). Skipping primitive.");if(!n.hasPositions(u))return void J.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const b=n.getPositionData(u,r),x=n.getMaterial(u,r,i),T=n.hasNormals(u)?n.getNormalData(u,r):null,S=n.hasTangents(u)?n.getTangentData(u,r):null,A=n.hasTextureCoordinates(u)?n.getTextureCoordinates(u,r):null,C=n.hasVertexColors(u)?n.getVertexColors(u,r):null,R=n.getIndexData(u,r),P={transform:RS(d),attributes:{position:await b,normal:T?await T:null,texCoord0:A?await A:null,color:C?await C:null,tangent:S?await S:null},indices:await R,primitiveType:v,material:Put(o,await x,s)};let F=null;o.meta!=null&&o.meta.ESRI_lod!=null&&o.meta.ESRI_lod.metric==="screenSpaceRadius"&&(F=o.meta.ESRI_lod.thresholds[p]),o.lods[p]=o.lods[p]||{parts:[],name:m,lodThreshold:F},o.lods[p].parts[y]=P});for(const u of o.lods)u.parts=u.parts.filter(d=>!!d);const c=await n.getLoadedBuffersSize();return{model:o,meta:{isEsriSymbolResource:a,uri:n.uri},customMeta:{},size:c}}function Aut(t){const e=t.json;let r=null;return e.nodes.forEach(i=>{const n=i.extras;n!=null&&(n.ESRI_proxyEllipsoid||n.ESRI_lod)&&(r=n)}),r}async function Out(t,e){const r=t.json,i=r.scenes[r.scene||0].nodes,n=i.length>1,s=[];for(const a of i){const l=r.nodes[a];s.push(o(a,0)),Rut(l)&&!n&&l.extensions.MSFT_lod.ids.forEach((c,u)=>o(c,u+1))}async function o(a,l){const c=r.nodes[a],u=t.getNodeTransform(a);if(c.weights!=null&&J.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),c.mesh!=null){const d=r.meshes[c.mesh];for(const p of d.primitives)s.push(e(p,u,l,d.name))}for(const d of c.children||[])s.push(o(d,l))}await Promise.all(s)}function Rut(t){return t.extensions&&t.extensions.MSFT_lod&&Array.isArray(t.extensions.MSFT_lod.ids)}function Put(t,e,r){const i=s=>{const o=`${r}_tex_${s&&s.id}${s&&s.name?"_"+s.name:""}`;if(s&&!t.textures.has(o)){const a=put(s.data,{wrap:{s:s.wrapS,t:s.wrapT},mipmap:Mut.includes(s.minFilter),noUnpackFlip:!0});t.textures.set(o,a)}return o},n=`${r}_mat_${e.id}_${e.name}`;if(!t.materials.has(n)){const s=dut({color:[e.color[0],e.color[1],e.color[2]],opacity:e.color[3],alphaMode:e.alphaMode,alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,colorMixMode:e.ESRI_externalColorMixMode,textureColor:e.colorTexture?i(e.colorTexture):void 0,textureNormal:e.normalTexture?i(e.normalTexture):void 0,textureOcclusion:e.occlusionTexture?i(e.occlusionTexture):void 0,textureEmissive:e.emissiveTexture?i(e.emissiveTexture):void 0,textureMetallicRoughness:e.metallicRoughnessTexture?i(e.metallicRoughnessTexture):void 0,emissiveFactor:[e.emissiveFactor[0],e.emissiveFactor[1],e.emissiveFactor[2]],colorTextureTransform:e.colorTextureTransform,normalTextureTransform:e.normalTextureTransform,occlusionTextureTransform:e.occlusionTextureTransform,emissiveTextureTransform:e.emissiveTextureTransform,metallicRoughnessTextureTransform:e.metallicRoughnessTextureTransform,metallicFactor:e.metallicFactor,roughnessFactor:e.roughnessFactor});t.materials.set(n,s)}return n}const Mut=[At.LINEAR_MIPMAP_LINEAR,At.LINEAR_MIPMAP_NEAREST];function $ut(t,e){switch(e){case Et.TRIANGLES:return Iut(t);case Et.TRIANGLE_STRIP:return Lut(t);case Et.TRIANGLE_FAN:return Dut(t)}}function Iut(t){return typeof t=="number"?zS(t):Jy(t)?new Uint16Array(t):t}function Lut(t){const e=typeof t=="number"?t:t.length;if(e<3)return[];const r=e-2,i=u5(3*r);if(typeof t=="number"){let n=0;for(let s=0;s0||X==="transparency"||X==="maskAndTransparency",G=C?TAe(C.alphaChannelUsage):void 0,Q={ambient:na(z.diffuse),diffuse:na(z.diffuse),opacity:1-(z.transparency||0),transparent:q,textureAlphaMode:G,textureAlphaCutoff:.33,textureId:P,initTextureTransparent:!0,doubleSided:!0,cullFace:ui.None,colorMixMode:z.externalColorMixMode||"tint",textureAlphaPremultiplied:(C==null?void 0:C.parameters.preMultiplyAlpha)??!1};e!=null&&e.materialParamsMixin&&Object.assign(Q,e.materialParamsMixin),k=new tm(Q),s.set(F,A,k)}n.push(k);const V=new Xn(k,T,S);p+=((y=S.find(z=>z[0]===E.POSITION))==null?void 0:y[1].length)??0,r.push(V)}return{engineResources:[{name:l,stageResources:{textures:i,materials:n,geometries:r},pivotOffset:o.model.pivotOffset,numberOfVertices:p,lodThreshold:null}],referenceBoundingBox:Vut(r)}}function Vut(t){const e=vi();return t.forEach(r=>{const i=r.boundingInfo;i!=null&&(Xf(e,i.bbMin),Xf(e,i.bbMax))}),e}async function Gut(t,e){const r=new Array;for(const s in t){const o=t[s],a=o.images[0].data;if(!a){Gm.warn("Externally referenced texture data is not yet supported");continue}const l=o.encoding+";base64,"+a,c="/textureDefinitions/"+s,u=o.channels==="rgba"?o.alphaChannelUsage||"transparency":"none",d={noUnpackFlip:!0,wrap:{s:Pt.REPEAT,t:Pt.REPEAT},preMultiplyAlpha:TAe(u)!==Gr.Opaque},p=e!=null&&e.disableTextures?Promise.resolve(null):qg(l,e);r.push(p.then(m=>({refId:c,image:m,parameters:d,alphaChannelUsage:u})))}const i=await Promise.all(r),n={};for(const s of i)n[s.refId]=s;return n}function TAe(t){switch(t){case"mask":return Gr.Mask;case"maskAndTransparency":return Gr.MaskBlend;case"none":return Gr.Opaque;default:return Gr.Blend}}function jut(t){const e=t.params;return{id:1,material:e.material,texture:e.texture,region:e.texture}}const Hut=new eE(1,2,"wosr"),Mx=2.1;async function SAe(t,e){var d;const r=EAe(uW(t));if(r.fileType==="wosr"){const p=await(e.cache?e.cache.loadWOSR(r.url,e):wAe(r.url,e)),{engineResources:m,referenceBoundingBox:y}=But(p,e);return{lods:m,referenceBoundingBox:y,isEsriSymbolResource:!1,isWosr:!0}}const i=await(e.cache?e.cache.loadGLTF(r.url,e,!!e.usePBR):bAe(new _Ae(e.streamDataRequester),r.url,e,e.usePBR)),n=(d=i.model.meta)==null?void 0:d.ESRI_proxyEllipsoid,s=i.meta.isEsriSymbolResource&&n!=null&&i.meta.uri.includes("/RealisticTrees/");s&&!i.customMeta.esriTreeRendering&&(i.customMeta.esriTreeRendering=!0,Yut(i,n));const o=!!e.usePBR,a=i.meta.isEsriSymbolResource?{usePBR:o,isSchematic:!1,treeRendering:s,mrrFactors:[...kot]}:{usePBR:o,isSchematic:!1,treeRendering:!1,mrrFactors:[...z8]},l={...e.materialParamsMixin,treeRendering:s},{engineResources:c,referenceBoundingBox:u}=CAe(i,a,l,e.skipHighLods&&r.specifiedLodIndex==null?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:c,referenceBoundingBox:u,isEsriSymbolResource:i.meta.isEsriSymbolResource,isWosr:!1}}function EAe(t){const e=t.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return e?{fileType:"gltf",url:e[1],specifiedLodIndex:e[4]!=null?Number(e[4]):null}:t.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:t,specifiedLodIndex:null}:{fileType:"unknown",url:t,specifiedLodIndex:null}}function CAe(t,e,r,i){const n=t.model,s=new Array,o=new Map,a=new Map,l=n.lods.length,c=vi();return n.lods.forEach((u,d)=>{const p=i.skipHighLods===!0&&(l>1&&d===0||l>3&&d===1)||i.skipHighLods===!1&&i.singleLodIndex!=null&&d!==i.singleLodIndex;if(p&&d!==0)return;const m=new Fut(u.name,u.lodThreshold,[0,0,0]);u.parts.forEach(y=>{const _=p?new tm({}):Wut(n,y,m,e,r,o,a),{geometry:v,vertexCount:b}=qut(y,_??new tm({})),x=v.boundingInfo;x!=null&&d===0&&(Xf(c,x.bbMin),Xf(c,x.bbMax)),_!=null&&(m.stageResources.geometries.push(v),m.numberOfVertices+=b)}),p||s.push(m)}),{engineResources:s,referenceBoundingBox:c}}function Wut(t,e,r,i,n,s,o){const a=e.material+(e.attributes.normal?"_normal":"")+(e.attributes.color?"_color":"")+(e.attributes.texCoord0?"_texCoord0":"")+(e.attributes.tangent?"_tangent":""),l=t.materials.get(e.material),c=e.attributes.texCoord0!=null,u=e.attributes.normal!=null;if(l==null)return null;const d=Xut(l.alphaMode);if(!s.has(a)){if(c){const A=(C,R=!1)=>{if(C!=null&&!o.has(C)){const P=t.textures.get(C);if(P!=null){const F=P.data;o.set(C,new Hw(Ub(F)?F.data:F,{...P.parameters,preMultiplyAlpha:!Ub(F)&&R,encoding:Ub(F)&&F.encoding!=null?F.encoding:void 0}))}}};A(l.textureColor,d!==Gr.Opaque),A(l.textureNormal),A(l.textureOcclusion),A(l.textureEmissive),A(l.textureMetallicRoughness)}const m=l.color[0]**(1/Mx),y=l.color[1]**(1/Mx),_=l.color[2]**(1/Mx),v=l.emissiveFactor[0]**(1/Mx),b=l.emissiveFactor[1]**(1/Mx),x=l.emissiveFactor[2]**(1/Mx),T=l.textureColor!=null&&c?o.get(l.textureColor):null,S=g3e({normalTexture:l.textureNormal,metallicRoughnessTexture:l.textureMetallicRoughness,metallicFactor:l.metallicFactor,roughnessFactor:l.roughnessFactor,emissiveTexture:l.textureEmissive,emissiveFactor:l.emissiveFactor,occlusionTexture:l.textureOcclusion});s.set(a,new tm({...i,transparent:d===Gr.Blend,customDepthTest:uw.Lequal,textureAlphaMode:d,textureAlphaCutoff:l.alphaCutoff,diffuse:[m,y,_],ambient:[m,y,_],opacity:l.opacity,doubleSided:l.doubleSided,doubleSidedType:"winding-order",cullFace:l.doubleSided?ui.None:ui.Back,hasVertexColors:!!e.attributes.color,hasVertexTangents:!!e.attributes.tangent,normalType:u?br.Attribute:br.ScreenDerivative,castShadows:!0,receiveSSAO:!0,textureId:T!=null?T.id:void 0,colorMixMode:l.colorMixMode,normalTextureId:l.textureNormal!=null&&c?o.get(l.textureNormal).id:void 0,textureAlphaPremultiplied:T!=null&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:l.textureOcclusion!=null&&c?o.get(l.textureOcclusion).id:void 0,emissiveTextureId:l.textureEmissive!=null&&c?o.get(l.textureEmissive).id:void 0,metallicRoughnessTextureId:l.textureMetallicRoughness!=null&&c?o.get(l.textureMetallicRoughness).id:void 0,emissiveFactor:[v,b,x],mrrFactors:S?[...jJ]:[l.metallicFactor,l.roughnessFactor,i.mrrFactors[2]],isSchematic:S,colorTextureTransformMatrix:Ef(l.colorTextureTransform),normalTextureTransformMatrix:Ef(l.normalTextureTransform),occlusionTextureTransformMatrix:Ef(l.occlusionTextureTransform),emissiveTextureTransformMatrix:Ef(l.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:Ef(l.metallicRoughnessTextureTransform),...n}))}const p=s.get(a);if(r.stageResources.materials.push(p),c){const m=y=>{y!=null&&r.stageResources.textures.push(o.get(y))};m(l.textureColor),m(l.textureNormal),m(l.textureOcclusion),m(l.textureEmissive),m(l.textureMetallicRoughness)}return p}function qut(t,e){const r=t.attributes.position.count,i=$ut(t.indices||r,t.primitiveType),n=Yi(3*r),{typedBuffer:s,typedBufferStride:o}=t.attributes.position;gp(n,s,t.transform,3,o);const a=[[E.POSITION,new Ue(n,3,!0)]],l=[[E.POSITION,i]];if(t.attributes.normal!=null){const c=Yi(3*r),{typedBuffer:u,typedBufferStride:d}=t.attributes.normal;Qf(AI,t.transform),yp(c,u,AI,3,d),a.push([E.NORMAL,new Ue(c,3,!0)]),l.push([E.NORMAL,i])}if(t.attributes.tangent!=null){const c=Yi(4*r),{typedBuffer:u,typedBufferStride:d}=t.attributes.tangent;Qf(AI,t.transform),ZJ(c,u,AI,4,d),a.push([E.TANGENT,new Ue(c,4,!0)]),l.push([E.TANGENT,i])}if(t.attributes.texCoord0!=null){const c=Yi(2*r),{typedBuffer:u,typedBufferStride:d}=t.attributes.texCoord0;QJ(c,u,2,d),a.push([E.UV0,new Ue(c,2,!0)]),l.push([E.UV0,i])}if(t.attributes.color!=null){const c=new Uint8Array(4*r);t.attributes.color.elementCount===4?t.attributes.color instanceof pp?H5(c,t.attributes.color,255):t.attributes.color instanceof ya?JJ(c,t.attributes.color):t.attributes.color instanceof DP&&H5(c,t.attributes.color,1/256):(c.fill(255),t.attributes.color instanceof ds?D5(c,t.attributes.color,255,4):t.attributes.color instanceof s8?iM(c,t.attributes.color.typedBuffer,4,t.attributes.color.typedBufferStride):t.attributes.color instanceof a8&&D5(c,t.attributes.color,1/256,4)),a.push([E.COLOR,new Ue(c,4,!0)]),l.push([E.COLOR,i])}return{geometry:new Xn(e,a,l),vertexCount:r}}const AI=hi();function Xut(t){switch(t){case"BLEND":return Gr.Blend;case"MASK":return Gr.Mask;case"OPAQUE":case null:case void 0:return Gr.Opaque}}function Yut(t,e){for(let r=0;r1&&Lr(u,u,l,b>-1?.2:Math.min(-4*b-3.8,1)),p[y]=u[0],p[y+1]=u[1],p[y+2]=u[2],y+=3,d[_]=255*T,d[_+1]=255*T,d[_+2]=255*T,d[_+3]=255,_+=4}n.attributes.normal=new ds(p),n.attributes.color=new ya(d)}}}const v4t=Object.freeze(Object.defineProperty({__proto__:null,fetch:SAe,gltfToEngineResources:CAe,parseUrl:EAe},Symbol.toStringTag,{value:"Module"})),Zut=()=>!!se("enable-feature:force-wosr"),b4t=()=>!!se("enable-feature:direct-3d-object-feature-layer-display"),Qut=()=>se.add("enable-feature:direct-3d-object-feature-layer-display",!0,!0,!0),Jut=()=>se.add("enable-feature:direct-3d-object-feature-layer-display",!1,!0,!0),w4t=()=>!!se("enable-i3s-patching"),Kut=()=>se.add("enable-i3s-patching",!0,!0,!0),eht=()=>se.add("enable-i3s-patching",!1,!0,!0),x4t=()=>!!se("enable-feature:SceneLayer-editing"),tht=(t="i3s-patching")=>{switch(eht(),Jut(),se.add("enable-feature:SceneLayer-editing",!0,!0,!0),t){case"feature-layer-view":Qut();break;case"i3s-patching":Kut()}};tht("i3s-patching");let gz={};async function rht(t,e){try{return{data:(await KJ(t,e)).data,baseUrl:o6(t),styleUrl:t}}catch(r){return Mw(r),null}}function iht(t,e,r){const i=e.portal!=null?e.portal:Mh.getDefault();let n;const s=`${i.url} - ${i.user&&i.user.username} - ${t}`;return gz[s]||(gz[s]=nht(t,i,r).then(o=>(n=o,o.fetchData())).then(o=>({data:o,baseUrl:n.itemUrl??"",styleName:t}))),gz[s]}function nht(t,e,r){return e.load(r).then(()=>{const i=new bf({disableExtraQuery:!0,query:`owner:${wle} AND type:${xle} AND typekeywords:"${t}"`});return e.queryItems(i,r)}).then(({results:i})=>{var o;let n=null;const s=t.toLowerCase();if(i&&Array.isArray(i)){for(const a of i)if(((o=a.typeKeywords)==null?void 0:o.some(c=>c.toLowerCase()===s))&&a.type===xle&&a.owner===wle){n=a;break}}if(!n)throw new Y("symbolstyleutils:style-not-found",`The style '${t}' could not be found`,{styleName:t});return n.load(r)})}function AAe(t,e,r){return t&&t.styleUrl!=null?rht(t.styleUrl,r):t&&t.styleName!=null?iht(t.styleName,e,r):Promise.reject(new Y("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function OAe(t){return t===null||t.type==="CIMSymbolReference"?t:{type:"CIMSymbolReference",symbol:t}}function RAe(t,e,r=["gltf"]){if(e==="cimRef")return t.cimRef;if(t.formatInfos&&!Zut())for(const i of r){const n=t.formatInfos.find(s=>s.type===i);if(n)return n.href}return t.webRef}function KJ(t,e){const r={responseType:"json",query:{f:"json"},...e};return kn(_g(t),r)}const wle="esri_en",xle="Style",sht="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json",LC={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};function oht(t,e=LC){var a,l;if(!t)return{symbol:null};const{retainId:r=LC.retainId,ignoreDrivers:i=LC.ignoreDrivers,hasLabelingContext:n=LC.hasLabelingContext,retainCIM:s=LC.retainCIM}=e;let o=null;if(ow(t)||t instanceof bE)o=t.clone();else if(t.type==="cim"){const c=(l=(a=t.data)==null?void 0:a.symbol)==null?void 0:l.type;if(c!=="CIMPointSymbol")return{error:new Y("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${c||"unknown"}' is unsupported in 3D`,{symbol:t})};o=s?t.clone():n_.fromCIMSymbol(t)}else if(t instanceof Lw)o=E6.fromSimpleLineSymbol(t);else if(t instanceof A6)o=n_.fromSimpleMarkerSymbol(t);else if(t instanceof C6)o=n_.fromPictureMarkerSymbol(t);else if(t instanceof nZ)o=e.geometryType&&e.geometryType==="mesh"?vE.fromSimpleFillSymbol(t):SP.fromSimpleFillSymbol(t);else{if(!(t instanceof EP))return{error:new Y("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${t.type||t.declaredClass}' is unsupported in 3D`,{symbol:t})};o=n?S6.fromTextSymbol(t):n_.fromTextSymbol(t)}return r&&o&&o.type!=="cim"&&(o.id=t.id),i&&ow(o)&&o.symbolLayers.forEach(c=>c.ignoreDrivers=!0),{symbol:o}}function W5(t,e,r,i){const n=PAe(t,{},{context:i,isLabelSymbol:!1});n!=null&&(e[r]=n)}function T4t(t,e,r,i){const n=PAe(t,{},{context:i,isLabelSymbol:!0});n!=null&&(e[r]=n)}function Tle(t){return t instanceof _E||t instanceof bE}function PAe(t,e,r){if(t==null)return null;const{context:i,isLabelSymbol:n}=r,s=i==null?void 0:i.origin,o=i==null?void 0:i.messages;if(s==="web-scene"&&!Tle(t)){const a=oht(t,{retainCIM:!0,hasLabelingContext:n});return a.symbol!=null?a.symbol.write(e,i):(o==null||o.push(new Y("symbol:unsupported",`Symbols of type '${t.declaredClass}' are not supported in scenes. Use 3D symbology instead when working with WebScene and SceneView`,{symbol:t,context:i,error:a.error})),null)}return(s==="web-map"||s==="portal-item"&&!PFe(i==null?void 0:i.layer))&&Tle(t)?(o==null||o.push(new Y("symbol:unsupported",`Symbols of type '${t.declaredClass}' are not supported in web maps and portal items. Use 2D symbology and CIMSymbol instead when working with MapView`,{symbol:t,context:i})),null):t.write(e,i)}function MAe(t,e){return Eze(t,null,e)}function aht(t,e,r,i){const n=t.name;return n==null?Promise.reject(new Y("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference")):t.styleName&&t.styleName==="Esri2DPointSymbolsStyle"?lht(n,e,i):AAe(t,e,i).then(s=>tK(sc(s),n,e,r,RAe,i))}function eK(t,e){return e.items.find(r=>r.name===t)}function tK(t,e,r,i,n,s){var m;const o=r&&r.portal!=null?r.portal:Mh.getDefault(),a={portal:o,url:Ja(t.baseUrl),origin:"portal-item"},l=eK(e,t.data);if(!l){const y=`The symbol name '${e}' could not be found`;return Promise.reject(new Y("symbolstyleutils:symbol-name-not-found",y,{symbolName:e}))}let c=nw(n(l,i),a),u=((m=l.thumbnail)==null?void 0:m.href)??null;const d=l.thumbnail&&l.thumbnail.imageData;Kct()&&(c=uW(c)??"",u=uW(u));const p={portal:o,url:Ja(o6(c)),origin:"portal-item"};return KJ(c,s).then(y=>{const _=i==="cimRef"?OAe(y.data):y.data,v=MAe(_,p);if(v&&ow(v)){if(u){const b=nw(u,a);v.thumbnail=new Ob({url:b})}else d&&(v.thumbnail=new Ob({url:`data:image/png;base64,${d}`}));t.styleUrl?v.styleOrigin=new cR({portal:r.portal,styleUrl:t.styleUrl,name:e}):t.styleName&&(v.styleOrigin=new cR({portal:r.portal,styleName:t.styleName,name:e}))}return v})}function lht(t,e,r){const i=sht.replaceAll(/\{SymbolName\}/gi,t),n=e.portal!=null?e.portal:Mh.getDefault();return KJ(i,r).then(s=>{const o=OAe(s.data);return MAe(o,{portal:n,url:Ja(o6(i)),origin:"portal-item"})})}const cht=Object.freeze(Object.defineProperty({__proto__:null,fetchSymbolFromStyle:tK,getStyleItemFromStyle:eK,resolveWebStyleSymbol:aht},Symbol.toStringTag,{value:"Module"}));async function uht(t){var a;if(t===null||t.styleName==null&&t.styleUrl==null)return null;const e=t.name;if(e==null)throw new Y("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference");const r={portal:t.portal},i=await AAe(t,r).catch(()=>null);if(i===null)return null;const n=eK(e,i.data);if(n&&!((a=n.formatInfos)!=null&&a.some(l=>l.type==="gltf_basisu")))return null;const s=await tK(i,e,r,"webRef",(l,c)=>RAe(l,c,["gltf_basisu","gltf"])).catch(()=>null);if(s===null||s.type!=="point-3d")return null;const o=s.symbolLayers.items[0];return o.type==="object"?o.resource:null}let hht=class{constructor(e,r,i){this._elementSize=r,this._buffer=Ar.createVertex(e,gr.STATIC_DRAW),this.resize(i)}destroy(){this._buffer.dispose()}get elementSize(){return this._elementSize}get capacity(){return this._capacity}get array(){return this._array}get buffer(){return this._buffer}get memoryUsage(){return{cpu:this._capacity*this._elementSize,gpu:this._capacity*this._elementSize}}copyRange(e,r,i,n=0){const s=new Uint8Array(this.array,e*this.elementSize,(r-e)*this.elementSize);new Uint8Array(i.array,n*this.elementSize).set(s)}transferAll(){this._buffer.setData(this._array)}transferRange(e,r){const i=e*this._elementSize,n=r*this._elementSize;this._buffer.setSubData(new Uint8Array(this._array),i,i,n)}resize(e){const r=e*this._elementSize,i=new ArrayBuffer(r);this._array&&(e>=this._capacity?new Uint8Array(i).set(new Uint8Array(this._array)):new Uint8Array(i).set(new Uint8Array(this._array).subarray(0,e*this._elementSize))),this._array=i,this._buffer.setSize(r),this._capacity=e}},dht=class{constructor(e){this.modelOriginHi=e.getField(E.MODELORIGINHI,ds),this.modelOriginLo=e.getField(E.MODELORIGINLO,ds),this.model=e.getField(E.MODEL,q_),this.modelNormal=e.getField(E.MODELNORMAL,q_),this.featureAttribute=e.getField(E.INSTANCEFEATUREATTRIBUTE,pp),this.color=e.getField(E.INSTANCECOLOR,ya),this.objectAndLayerIdColor=e.getField(E.INSTANCEOBJECTANDLAYERIDCOLOR,ya)}},Sle=class{constructor(e,r){this._headIndex=0,this._tailIndex=0,this._firstIndex=null,this._captureFirstIndex=!0,this._updating=!1,this._prevHeadIndex=0,this._resized=!1,this._rctx=e,this._instanceBufferLayout=r,this._elementSize=r.stride,this._capacity=1}destroy(){this._buffer&&this._buffer.destroy()}get buffer(){return this._buffer.buffer}get view(){return this._view}get capacity(){return this._capacity}get size(){const e=this._headIndex,r=this._tailIndex;return e>=r?e-r:e+this._capacity-r}get isEmpty(){return this._headIndex===this._tailIndex}get isFull(){return this._tailIndex===(this._headIndex+1)%this._capacity}get headIndex(){return this._headIndex}get tailIndex(){return this._tailIndex}get firstIndex(){return this._firstIndex}get memoryUsage(){return this._buffer?this._buffer.memoryUsage:{cpu:0,gpu:0}}reset(){this._headIndex=0,this._tailIndex=0,this._firstIndex=null}startUpdateCycle(){this._captureFirstIndex=!0}beginUpdate(){Je(!this._updating,"already updating"),this._updating=!0,this._prevHeadIndex=this._headIndex}endUpdate(){Je(this._updating,"not updating"),this.size0,"invalid size");const e=this._tailIndex===this._firstIndex;this._incrementTail(),e&&(this._firstIndex=this._tailIndex)}_grow(){const e=Math.max(q5,Math.floor(this._capacity*jF));this._resize(e)}_shrink(){const e=Math.max(q5,Math.floor(this._capacity*sDe));this._resize(e)}_resize(e){if(Je(this._updating,"not updating"),e===this._capacity)return;const r=new hht(this._rctx,this._elementSize,e);if(this._buffer){this._firstIndex&&(this._firstIndex=(this._firstIndex+this._capacity-this._tailIndex)%this._capacity);const i=this.size,n=this._compactInstances(r);Je(n===i,"invalid compaction"),this._buffer.destroy(),this._tailIndex=0,this._headIndex=n,this._prevHeadIndex=0}this._resized=!0,this._capacity=e,this._buffer=r,this._view=new dht(this._instanceBufferLayout.createView(this._buffer.array))}_compactInstances(e){const r=this._headIndex,i=this._tailIndex;return ir?(this._buffer.copyRange(i,this._capacity,e),r>0&&this._buffer.copyRange(0,r,e,this._capacity-i),r+(this._capacity-i)):0}_incrementHead(e=1){this._headIndex=(this._headIndex+e)%this._capacity}_incrementTail(e=1){this._tailIndex=(this._tailIndex+e)%this._capacity}_transferRange(e,r){er&&(r>0&&this._buffer.transferRange(0,r),this._buffer.transferRange(e,this._capacity))}};const q5=64;var Ai;function pht(t){let e=Gi().mat4f64(E.LOCALTRANSFORM).mat4f64(E.GLOBALTRANSFORM).vec4f64(E.BOUNDINGSPHERE).vec3f64(E.MODELORIGIN).mat3f(E.MODEL).mat3f(E.MODELNORMAL).vec2f(E.MODELSCALEFACTORS);return t.includes(E.FEATUREATTRIBUTE)&&(e=e.vec4f(E.FEATUREATTRIBUTE)),t.includes(E.COLOR)&&(e=e.vec4u8(E.COLOR)),t.includes(E.OBJECTANDLAYERIDCOLOR)&&(e=e.vec4u8(E.OBJECTANDLAYERIDCOLOR)),e=e.u8(E.STATE).u8(E.LODLEVEL),e}(function(t){t[t.ALLOCATED=1]="ALLOCATED",t[t.DEFAULT_ACTIVE=2]="DEFAULT_ACTIVE",t[t.VISIBLE=4]="VISIBLE",t[t.HIGHLIGHT=8]="HIGHLIGHT",t[t.HIGHLIGHT_ACTIVE=16]="HIGHLIGHT_ACTIVE",t[t.REMOVE=32]="REMOVE",t[t.TRANSFORM_CHANGED=64]="TRANSFORM_CHANGED",t[t.ACTIVE=18]="ACTIVE"})(Ai||(Ai={}));let Ele=class{constructor(e){this.localTransform=e.getField(E.LOCALTRANSFORM,SR),this.globalTransform=e.getField(E.GLOBALTRANSFORM,SR),this.modelOrigin=e.getField(E.MODELORIGIN,kh),this.model=e.getField(E.MODEL,q_),this.modelNormal=e.getField(E.MODELNORMAL,q_),this.modelScaleFactors=e.getField(E.MODELSCALEFACTORS,d1),this.boundingSphere=e.getField(E.BOUNDINGSPHERE,i8),this.featureAttribute=e.getField(E.FEATUREATTRIBUTE,pp),this.color=e.getField(E.COLOR,ya),this.objectAndLayerIdColor=e.getField(E.OBJECTANDLAYERIDCOLOR,ya),this.state=e.getField(E.STATE,kS),this.lodLevel=e.getField(E.LODLEVEL,kS)}},M2=class extends xe{constructor(e,r){super(e),this.events=new Bn,this._capacity=0,this._size=0,this._next=0,this._layout=pht(r),this._capacity=q5,this._buffer=this._layout.createBuffer(this._capacity),this._view=new Ele(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,Ai.ALLOCATED),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const r=this._view.state;Je(e>=0&&e=0&&ethis._instanceData.view.boundingSphere.getVec(i,this._tmpSphere),{maximumDepth:25}),this._instanceData=e,this._boundingSphere=r,this._tmpSphere=vn(),this._tmpMat4=_e()}addInstance(e){const r=this._instanceData.view.boundingSphere,i=this._instanceData.getCombinedModelTransform(e,this._tmpMat4);De(this._tmpSphere,this._boundingSphere.center,i),this._tmpSphere[3]=this._boundingSphere.radius*MS(i),r.setVec(e,this._tmpSphere),this.add([e])}removeInstance(e){this.remove([e])}},ght=class{constructor(e,r){this._worldSpaceRadius=e,this._minScreenSpaceRadii=r}selectLevel(e,r,i){const n=i.computeScreenPixelSizeAt(e),s=this._worldSpaceRadius*r/n;let o=0;for(let a=1;a=this._minScreenSpaceRadii[a]&&(o=a);return o}},yht=class extends u8{constructor(e,r,i,n,s,o){super(e,r),this.layerUid=e,this.graphicUid=r,this.geometryId=i,this.triangleNr=n,this.baseBoundingSphere=s,this.numLodLevels=o}};function rK(t){return bp(t)&&t.intersector===Ui.LOD&&!!t.target}let _ht=class{constructor(e,r){const i=e.renderContext.rctx,n=r.geometry;this._materialRepository=e.materialRepository,n.material.setParameters({instancedDoublePrecision:!0});const s=n.material.createBufferWriter(),o=s.vertexBufferLayout,a=s.elementCount(n),l=o.createBuffer(a);s.write(null,null,n,l,0),this.geometry=n,this.material=n.material,this.glMaterials=new WCe(n.material,this._materialRepository),this.vertexBufferLayout=o,this.vbo=Ar.createVertex(i,gr.STATIC_DRAW,l.buffer),this.vao=new vp(i,fr,{geometry:Mc(o)},{geometry:this.vbo}),this.vertexCount=a}destroy(){this.glMaterials.destroy(),this.vbo.dispose(),this.vao.dispose()}get boundingInfo(){return this.geometry.boundingInfo}get triangleCount(){return this.vertexCount/3}intersect(e,r,i,n,s,o,a,l){const c=this.geometry.id;this.material.intersect(this.geometry,e.transform.transform,e,i,n,(u,d,p,m,y)=>{if(u>=0){if(r!=null&&!r(e.rayBegin,e.rayEnd,u))return;const _=new yht(o.layerUid,o.graphicUid(s),c,p,a,l);if((e.results.min.drapedLayerOrder==null||y>=e.results.min.drapedLayerOrder)&&(e.results.min.dist==null||u=e.results.max.drapedLayerOrder)&&(e.results.max.dist==null||u>e.results.max.dist)&&e.results.max.set(Ui.LOD,_,u,d,e.transform.transform,y),e.options.store===To.ALL){const v=SQ(e.results.min.ray);v.set(Ui.LOD,_,u,d,e.transform.transform,y),e.results.all.push(v)}}})}},vht=class $Ae{static async create(e,r,i){const n=await Promise.allSettled(r.components.map(o=>e.controller.schedule(()=>new _ht(e,o),i))),s=n.map(o=>o.status==="fulfilled"?o.value:null).filter(aP);if(ss(i)||s.length!==n.length){s.forEach(o=>o.destroy()),Bt(i);for(const o of n)if(o.status==="rejected")throw o.reason}return new $Ae(r.minScreenSpaceRadius,s)}constructor(e,r){this.minScreenSpaceRadius=e,this.components=r}destroy(){this.components.forEach(e=>e.destroy())}intersect(e,r,i,n,s,o,a){this.components.forEach(l=>l.intersect(e,r,i,n,s,o,this.boundingSphere,a))}get boundingBox(){if(this._boundingBox==null){const e=vi();this.components.forEach(r=>{r.boundingInfo!=null&&(Xf(e,r.boundingInfo.bbMin),Xf(e,r.boundingInfo.bbMax))}),this._boundingBox=e}return this._boundingBox}get boundingSphere(){if(this._boundingSphere==null){const e=this.boundingBox,r=O();jd(e,r),this._boundingSphere={center:r,radius:.5*S1e(e)}}return this._boundingSphere}get triangleCount(){return this.components.reduce((e,r)=>e+r.triangleCount,0)}};const bht=t=>{const e=t.baseBoundingSphere.radius,r=t.levels.map(i=>i.minScreenSpaceRadius);return new ght(e,r)};let Zu=class extends xe{constructor(e,r){super(e),this.type=Ui.LOD,this.isGround=!1,this._handles=new Vi,this._levels=[],this._defaultRenderInstanceData=[new Array],this._highlightRenderInstanceData=[new Array],this._allRenderInstanceData=[this._defaultRenderInstanceData[0],this._highlightRenderInstanceData[0]],this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new lt,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.slots=[le.OPAQUE_MATERIAL,le.TRANSPARENT_MATERIAL],this.canRender=!0,this._instanceData=new M2({shaderTransformation:e.shaderTransformation},e.optionalFields),this._handles.add(r.registerTask(dt.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=xht(this.optionalFields),this._glInstanceBufferLayout=Mc(this._instanceBufferLayout,1),this._handles.add([this._instanceData.events.on("instances-changed",()=>this._requestUpdateCycle()),this._instanceData.events.on("instance-transform-changed",({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)}),this._instanceData.events.on("instance-visibility-changed",({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)}),this._instanceData.events.on("instance-highlight-changed",()=>this._requestUpdateCycle(!0))])}destroy(){this._handles.destroy()}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerUid(){return this.metadata.layerUid}get instanceData(){return this._instanceData}get memoryUsage(){const e={cpu:0,gpu:0};return this._allRenderInstanceData.forEach(r=>r.forEach(i=>{e.cpu+=i.memoryUsage.cpu,e.gpu+=i.memoryUsage.gpu})),e}get renderStats(){const e=this._instanceData.size,r=[];return this._levels.forEach((i,n)=>{const s=this._allRenderInstanceData[0][n].size+this._allRenderInstanceData[1][n].size,o=i.triangleCount;r.push({renderedInstances:s,renderedTriangles:s*o,trianglesPerInstance:o})}),{totalInstances:e,renderedInstances:r.reduce((i,n)=>i+n.renderedInstances,0),renderedTriangles:r.reduce((i,n)=>i+n.renderedTriangles,0),levels:r}}async initializeRenderContext(e,r){this._context=e;const i=e.renderContext.rctx,n=await Promise.allSettled(this.symbol.levels.map(o=>(this._defaultRenderInstanceData[0].push(new Sle(i,this._instanceBufferLayout)),this._highlightRenderInstanceData[0].push(new Sle(i,this._instanceBufferLayout)),vht.create(e,o,r)))),s=n.map(o=>o.status==="fulfilled"?o.value:null).filter(aP);if(ss(r)||s.length!==n.length){s.forEach(o=>o.destroy()),Bt(r);for(const o of n)if(o.status==="rejected")throw o.reason}this._levels=s,this._levelSelector=bht(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach(e=>e.destroy()),this._defaultRenderInstanceData[0].forEach(e=>e.destroy()),this._highlightRenderInstanceData[0].forEach(e=>e.destroy())}get needsTransparentPass(){return this._levels.some(e=>e.components.some(r=>r.material.requiresSlot(le.TRANSPARENT_MATERIAL,D.Color)))}get needsHighlight(){return this._highlightRenderInstanceData[0].some(e=>e.size>0)}prepareRender(e){if(!Kr.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const r=e.bindParameters.contentCamera.equals(this._camera);this._camera.copyFrom(e.bindParameters.contentCamera),r||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(Wa),this._needFullCycle=!1)}}prepareTechniques(e){if(!this.baseMaterial.isVisible()||!this.baseMaterial.isVisibleForOutput(e.output))return null;const r=this._getInstanceDatas(e.output);if(!r)return null;const i=new Array;return r.forEach(n=>this.levels.forEach((s,o)=>{s.components.forEach(a=>i.push(this._beginComponent(e,n[o],a)))})),i}render(e,r){const i=this._getInstanceDatas(e.output);if(!i)return;let n=0;e.rctx.bindVAO(),i.forEach(s=>this.levels.forEach((o,a)=>{o.components.forEach(l=>this._renderComponent(e,r[n++],s[a],l,a))}))}_getInstanceDatas(e){const r=e!==D.Highlight&&e!==D.ShadowHighlight,i=e!==D.ShadowExcludeHighlight;return r&&i?this._allRenderInstanceData:r?this._defaultRenderInstanceData:i?this._highlightRenderInstanceData:null}intersect(e,r,i,n){if(!this.baseMaterial.isVisible()||this._octree==null)return;const s=O();ae(s,n,i);const o=a=>{this._instanceData.getCombinedModelTransform(a,Rle),e.transform.set(Rle),De(Ple,i,e.transform.inverse),De(Mle,n,e.transform.inverse);const l=this._instanceData.getState(a),c=this._instanceData.getLodLevel(a),u=this._levels.length;Je((l&Ai.ACTIVE)!=0,"invalid instance state"),Je(c>=0&&ce.forEach(r=>r.startUpdateCycle()))}get running(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){const{_enableLevelSelection:r,_camera:i,_levelSelector:n}=this;this._allRenderInstanceData.forEach(u=>u.forEach(d=>d.beginUpdate()));const s=this._instanceData,o=s.view;let a=s.size;const l=s.capacity;let c=this._instanceIndex;for(let u=0;u=0&&(d&Ai.HIGHLIGHT?(Ale(this._highlightRenderInstanceData[0][y],o,c),p|=Ai.HIGHLIGHT_ACTIVE):(Ale(this._defaultRenderInstanceData[0][y],o,c),p|=Ai.DEFAULT_ACTIVE)),o.state.set(c,p),o.lodLevel.set(c,y)}else p=d&~(Ai.ACTIVE|Ai.TRANSFORM_CHANGED),o.state.set(c,p);if(this._octreeCached!=null){const y=!!(d&Ai.ACTIVE),_=!!(p&Ai.ACTIVE);!y&&_?this._octreeCached.addInstance(c):y&&!_?this._octreeCached.removeInstance(c):y&&_&&d&Ai.TRANSFORM_CHANGED&&(this._octreeCached.removeInstance(c),this._octreeCached.addInstance(c))}c=c+1===l?0:c+1,e.madeProgress()}this._instanceIndex=c,this._allRenderInstanceData.forEach(u=>u.forEach(d=>d.endUpdate())),this._context.requestRender()}_beginComponent(e,r,i){const{bindParameters:n,rctx:s,output:o}=e;if(r.size===0||!i.material.requiresSlot(n.slot,e.output))return null;const a=i.glMaterials.load(s,n.slot,o);return a!=null?a.beginSlot(n):null}_renderComponent(e,r,i,n,s){var v;if(!r)return;const{bindParameters:o,rctx:a}=e;(v=a.appleAmdDriverHelper)==null||v.resetIndicesType();const l=a.bindTechnique(r,n.material.parameters,o);a.bindVAO(n.vao),r.ensureAttributeLocations(n.vao),l.bindDraw(Tht,o,n.material.parameters),Kr.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&e.output===D.Color&&(l.setUniform4fv("externalColor",$le[Math.min(s,$le.length-1)]),l.setUniform1i("colorMixMode",mSe.replace));const c=a.capabilities.instancing,u=i.capacity,d=i.headIndex,p=i.tailIndex,m=i.firstIndex,y=this._glInstanceBufferLayout,_=(b,x)=>{jZ(a,fr,i.buffer,y,b),c.drawArraysInstanced(r.primitiveType,0,n.vertexCount,x-b),HZ(a,fr,i.buffer,y)};n.material.parameters.transparent&&m!=null?d>p?(Je(m>=p&&m<=d,"invalid firstIndex"),_(m,d),_(p,m)):d=0&&m<=d,"invalid firstIndex"),_(m,d),_(p,u),_(0,m)):(Je(m>=p&&m<=u,"invalid firstIndex"),_(m,u),_(0,d),_(p,m))):d>p?_(p,d):d(n=(i=>(i=this.symbolLayer)==null?void 0:i.material)())==null?void 0:n.color)()){const s=this._getCombinedOpacity(r),o=s<1||this.needsDrivenTransparentPass;return e.transparent=o,e.opacity=s,e.cullFace=o?ui.None:ui.Back,e}async _createResourcesForPrimitive(e,r){const i=this.symbolLayer,n=ps(ize(e)),s=na(YM(n)),o=na(dk(s,i)),a=Te(o),l=!1,c=!1,u={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,mrrFactors:[...jJ],ambient:pg,diffuse:pg,hasSlicePlane:this._context.slicePlaneEnabled,hasSliceHighlight:!1,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!this.symbolLayer.isPrimitive},d=!!u.usePBR;this._setMaterialTransparencyParams(u);const p=this.symbol;if(p.type==="point-3d"&&p.verticalOffset){const{screenLength:x,minWorldLength:T,maxWorldLength:S}=p.verticalOffset;u.verticalOffset={screenLength:ha(x),minWorldLength:T||0,maxWorldLength:S??1/0},u.castShadows=!1}if(this._context.screenSizePerspectiveEnabled&&(u.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),this._drivenProperties.color)u.externalColor=mh;else{const x=i.material!=null?i.material.color:null,T=x!=null?it.toUnitRGBA(x):mh;u.externalColor=T}this._fastUpdates=qS(this._context.renderer,this._fastVisualVariableConvertOptions(n,o,s,null)),u.isInstanced=!0,this._fastUpdates?(Object.assign(u,this._fastUpdates.materialParameters),this._optionalFields.push(E.FEATUREATTRIBUTE)):this._hasPerInstanceColor()&&(u.hasInstancedColor=!0,this._optionalFields.push(E.COLOR)),se("enable-feature:objectAndLayerId-rendering")&&this._optionalFields.push(E.OBJECTANDLAYERIDCOLOR);const m=new tm(u),y=FEe(e,m);if(!y)throw new Error(`Unknown object symbol primitive: ${e}`);const _=sI(y).map(x=>({opacity:1,transparent:x.parameters.transparent})),v=await this._createStageResources(y,d,r),b=await this._createLodRenderer(y,r);return new Ile(y,b,v,_,s,l,c,n,o,a,d,null)}async _createResourcesForUrl(e,r){var k,V;const i={materialParamsMixin:{isInstanced:!0,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows},streamDataRequester:this._context.streamDataRequester,cache:this._context.sharedResources.objectResourceCache};this._fastUpdates=qS(this._context.renderer,this._fastVisualVariableConvertOptions(null,null,null,null)),this._fastUpdates?(Object.assign(i.materialParamsMixin,this._fastUpdates.materialParameters),this._optionalFields.push(E.FEATUREATTRIBUTE)):this._hasPerInstanceColor()&&(i.materialParamsMixin.hasInstancedColor=!0,this._optionalFields.push(E.COLOR)),se("enable-feature:objectAndLayerId-rendering")&&this._optionalFields.push(E.OBJECTANDLAYERIDCOLOR);const n=this.symbol;if(n.type==="point-3d"&&n.verticalOffset){const{screenLength:z,minWorldLength:X,maxWorldLength:q}=n.verticalOffset;i.materialParamsMixin.verticalOffset={screenLength:ha(z),minWorldLength:X||0,maxWorldLength:q??1/0},i.materialParamsMixin.castShadows=!1}i.signal=r,i.usePBR=this._context.physicalBasedRenderingEnabled,i.skipHighLods=this._context.skipHighSymbolLods;const s=i.usePBR,o=await SAe(e,i),a=o.isEsriSymbolResource,l=o.isWosr,c=Jct(o.lods);c.levels.sort((z,X)=>z.minScreenSpaceRadius-X.minScreenSpaceRadius);const u=this._context,d=this.symbolLayer.material,p=this._getExternalColorParameters(d),m=(V=(k=this.symbolLayer)==null?void 0:k.material)==null?void 0:V.color,y=this._getCombinedOpacity(m,{hasIntrinsicColor:!0}),_=this.needsDrivenTransparentPass,v=sI(c),b=sI(c).map(z=>({opacity:z.parameters.opacity||1,transparent:z.parameters.transparent}));v.forEach(z=>{const X=z.parameters;z.setParameters(p);const q=X.opacity*y,G=q<1||_||X.transparent;z.setParameters({opacity:q,transparent:G}),u.screenSizePerspectiveEnabled&&z.setParameters({screenSizePerspective:u.sharedResources.screenSizePerspectiveSettings})});const x=o.referenceBoundingBox,T=na(YM(x)),S=na(c.levels[0].pivotOffset),A=na(dk(T,this.symbolLayer)),C=Te(A),R=this._fastUpdates;XS(R,this._context.renderer,this._fastVisualVariableConvertOptions(x,A,T,S))&&v.forEach(z=>z.setParameters(R.materialParameters));const P=await this._createStageResources(c,s,r),F=await this._createLodRenderer(c,r);return new Ile(c,F,P,b,T,a,l,x,A,C,s,S)}_addDisposeResource(e){this._disposeResourceHandles.push(e)}async _createStageResources(e,r,i){const n=this._context.stage,s=sI(e);r!==this._context.physicalBasedRenderingEnabled&&this.physicalBasedRenderingChanged(),n.addMany(s),this._addDisposeResource(()=>n.removeMany(s));const o=Noe(e);n.addMany(o),this._addDisposeResource(()=>n.removeMany(o)),await n.load(o,i),Bt(i);const a=Foe(e);return n.addMany(a),this._addDisposeResource(()=>n.removeMany(a)),{materials:s,textures:o,geometries:a}}async _createLodRenderer(e,r){const i=this._context.stage,n={layerUid:this._context.layer.uid,graphicUid:l=>this._instanceIndexToGraphicUid.get(l),notifyGraphicGeometryChanged:l=>this._context.notifyGraphicGeometryChanged(this._instanceIndexToGraphicUid.get(l)),notifyGraphicVisibilityChanged:l=>this._context.notifyGraphicVisibilityChanged(this._instanceIndexToGraphicUid.get(l))},s=this._fastUpdates,o=s?{applyTransform:(l,c,u)=>{l.getFeatureAttribute(c,OI),In(u,FH(s.materialParameters,OI,u))},scaleFactor:(l,c,u)=>{c.getFeatureAttribute(u,OI),Ptt(l,s.materialParameters,OI)}}:null,a=new Zu({symbol:e,optionalFields:this._optionalFields,metadata:n,shaderTransformation:o},this._context.scheduler);return a.slicePlaneEnabled=this._context.slicePlaneEnabled,this._addDisposeResource(()=>{i.removeRenderPlugin(a),a.destroy()}),await i.addRenderPlugin(a.slots,a,r),a}_getExternalColorParameters(e){const r={};return this._drivenProperties.color?r.externalColor=mh:e!=null&&e.color!=null?r.externalColor=it.toUnitRGBA(e.color):(r.externalColor=mh,r.colorMixMode="ignore"),r}destroy(){super.destroy(),this._cleanupResources()}_cleanupResources(){this._disposeResourceHandles.forEach(e=>e()),this._disposeResourceHandles.length=0,this._resources=null}createGraphics3DGraphic(e){const r=e.graphic;if(!this._validateGeometry(r.geometry))return null;const i=DR(r.geometry);if(i==null)return this.logger.warn(`unsupported geometry type for icon symbol: ${r.geometry.type}`),null;const n=this.setGraphicElevationContext(r,new wp),s=e.renderingInfo;return this._createAs3DShape(r,i,s,n,r.uid,e.layer.uid)}notifyDestroyGraphicLayer(e){this._instanceIndexToGraphicUid.delete(e.instanceIndex)}graphicLayerToGraphicId(){return 0}layerOpacityChanged(){var s,o;if(this._resources==null)return;const e=this._drivenProperties.opacity,r=!this._isPrimitive,i=this._resources.stageResources.materials,n=this._resources.originalMaterialParameters;for(let a=0;as+o.indices.get(E.POSITION).length,0)/3,i=s=>Array.from(s.vertexAttributes.values()).reduce((o,a)=>o+Ky(a.data),0)+Array.from(s.indices.values()).reduce((o,a)=>o+Ky(a),0),n=Noe(e).reduce((s,o)=>s+(o.parameters.encoding&&o.parameters.encoding==="image/ktx2"?o.memoryEstimate:o.memoryEstimate/4),0)+Foe(e).reduce((s,o)=>s+i(o),0);return{primitivesPerFeature:r,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!1,memory:{...zEe(this.symbol,this.symbolLayer),resourceBytes:n}}}_hasLodRenderer(){return this._resources!=null}_createAs3DShape(e,r,i,n,s,o){if(!this._hasLodRenderer()||this._resources==null)return null;const a=this.getFastUpdateAttrValues(e),l=this._context.clippingExtent;if(Bi(r,$x,this._context.elevationProvider.spatialReference),l!=null&&!YY(l,$x))return null;const c=this._requiresTerrainElevation(n),u=this._computeGlobalTransform(r,n,_z,RI),d=this._computeLocalTransform(this._resources,this.symbolLayer,i,Lle),p=this._resources.lodRenderer.instanceData,m=p.addInstance();this._instanceIndexToGraphicUid.set(m,s),p.setLocalTransform(m,d,!1),p.setGlobalTransform(m,u),a&&p.setFeatureAttribute(m,a),this._fastUpdates==null&&this._hasPerInstanceColor()&&p.setColor(m,dO(i.color,i.opacity,255)),this._context.stage.renderView.objectAndLayerIdRenderHelper!=null&&p.setObjectAndLayerIdColor(m,this._context.stage.renderView.objectAndLayerIdRenderHelper.getObjectAndLayerIdColor({graphicUid:s,layerUid:o}));const y=new Yct(this,m,nit,n);return c&&(y.alignedSampledElevation=RI.sampledElevation),y.needsElevationUpdates=K_(n.mode),LR(y,r,this._context.elevationProvider),y}_computeGlobalTransform(e,r,i,n){return J_(e,this._context.elevationProvider,r,this._context.renderCoordsHelper,n),$x[0]=e.x,$x[1]=e.y,$x[2]=n.z,ma(e.spatialReference,$x,i,this._context.renderCoordsHelper.spatialReference),i}_computeLocalTransform(e,r,i,n){return Nh(n),this._applyObjectRotation(i,!1,n),this._applyObjectRotation(r,!0,n),this._applyObjectScale(e,i,n),this._applyAnchor(e,r,n),n}_applyObjectScale(e,r,i){var o;if((o=this._fastUpdates)!=null&&o.requiresShaderTransformation)return;const n=this._drivenProperties.size&&r.size?r.size:e.symbolSize,s=Loe(n,e.symbolSize,e.resourceSize,this._context.renderCoordsHelper.unitInMeters);s[0]===1&&s[1]===1&&s[2]===1||AP(i,i,s)}prepareSymbolLayerPatch(e){if(e.diff.type!=="partial")return;const r=e.diff.diff;this._preparePatchTransform(e,r),this._preparePatchColor(e,r)}updateGeometry(e,r){if(this._resources==null)return!0;const i=r&&DR(r);if(i==null)return!1;const n=this.getGeometryElevationMode(r);return e.elevationContext.mode===n&&(this._computeGlobalTransform(i,e.elevationContext,_z,RI),this._requiresTerrainElevation(e.elevationContext)&&(e.alignedSampledElevation=RI.sampledElevation),this._resources.lodRenderer.instanceData.setGlobalTransform(e.instanceIndex,_z,!0),LR(e,i,this._context.elevationProvider),!0)}_preparePatchTransform(e,r){if(!(r.heading||r.tilt||r.roll||r.width||r.height||r.depth||r.anchor||r.anchorPosition)||this._resources==null)return;const i=(y,_,v)=>(y!=null&&y.type==="complete"?y.newValue:_)??v,n=i(r.heading,this.symbolLayer.heading,0),s=i(r.tilt,this.symbolLayer.tilt,0),o=i(r.roll,this.symbolLayer.roll,0),a=i(r.width,this.symbolLayer.width,void 0),l=i(r.height,this.symbolLayer.height,void 0),c=i(r.depth,this.symbolLayer.depth,void 0),u=i(r.anchor,this.symbolLayer.anchor,void 0),d=i(r.anchorPosition,this.symbolLayer.anchorPosition,void 0);delete r.heading,delete r.tilt,delete r.roll,delete r.width,delete r.height,delete r.depth,delete r.anchor,delete r.anchorPosition;const p={heading:n,tilt:s,roll:o,anchor:u,anchorPosition:d},m=this._resources;this.loadStatus===eu.LOADED&&e.symbolLayerStatePatches.push(()=>{m.symbolSize=na(dk(m.resourceSize,{width:a,height:l,depth:c,isPrimitive:this.symbolLayer.isPrimitive}))}),e.graphics3DGraphicPatches.push((y,_)=>{const v=this._computeLocalTransform(m,p,_,Lle),b=y.instanceIndex;m.lodRenderer.instanceData.setLocalTransform(b,v,!0)})}_preparePatchColor(e,r){if(!r.material||r.material.type!=="partial")return;const i=r.material.diff;if(!i.color||i.color.type!=="complete"||i.color.newValue==null||i.color.oldValue==null)return;const n=i.color.newValue,s=n!=null?it.toUnitRGBA(n):mh;delete i.color;const o=this._resources;o!=null&&e.graphics3DGraphicPatches.push(a=>{let l;this._hasPerInstanceColor()?(o.lodRenderer.instanceData.setColor(a.instanceIndex,s),l=this._setMaterialTransparencyParams({},n)):l=this._setMaterialTransparencyParams({externalColor:s},n);for(const c of o.stageResources.materials)c.setParameters(l)})}_requiresTerrainElevation(e){return e.mode!=="absolute-height"}_applyObjectRotation(e,r,i){var n;if(!((n=this._fastUpdates)!=null&&n.requiresShaderTransformation)||!r)return qrt(e.heading,e.tilt,e.roll,i)}_computeAnchor(e,r,i){const n=O();switch(i.anchor){case"center":re(n,jd(e)),fa(n,n);break;case"top":{const s=jd(e);ne(n,-s[0],-s[1],-e[5]);break}case"bottom":{const s=jd(e);ne(n,-s[0],-s[1],-e[2]);break}case"relative":{const s=jd(e),o=YM(e),a=i.anchorPosition,l=a?Se(a.x,a.y,a.z):Zs;c6(n,o,l),oe(n,n,s),fa(n,n);break}default:r!=null?fa(n,r):re(n,Zs)}return n}_applyAnchor(e,r,i){var s;if((s=this._fastUpdates)!=null&&s.requiresShaderTransformation)return;const n=this._computeAnchor(e.resourceBoundingBox,e.pivotOffset,r);n&&Ml(i,i,n)}_hasPerInstanceColor(){return this._drivenProperties.color||this._drivenProperties.opacity}_fastVisualVariableConvertOptions(e,r,i,n){const s=e!=null?na(YM(e)):pg,o=e!=null?this._computeAnchor(e,n,this.symbolLayer):Zs,a=this._context.renderCoordsHelper.unitInMeters,l=Loe(r??void 0,r,i,a),c=Se(this.symbolLayer.tilt||0,this.symbolLayer.roll||0,this.symbolLayer.heading||0);return new jP({size:!0,color:!0,rotation:!0,opacity:!1},s,r??pg,a,o,l,c)}};const $x=O(),Lle=_e(),_z=_e(),OI=Qt(),RI=new qP;let Eht=class{constructor(e,r,i,n){this.vertices=e,this.positionsES=r,this.offset=n;const s=e.length,o=Math.floor(s/2),a=this.offset+3*o,l=i[a],c=i[a+1],u=i[a+2];this.origin=Se(l,c,u),this.positions=Yi(3*s);const d=this.offset+3*s;for(let p=this.offset;pthis.emitCapVertex(n,a,l,c,u,d),o=(a,l,c,u)=>this.emitVertex(n,a,l,c,u);for(this.startCap.rebuildConnectingProfileGeometry(i[n],this.profile,s),n=1;n{s.push(c),s.push(u),s.push(d),o.push(c),o.push(u),o.push(d),a.push(this.pathVertexData[c]),a.push(this.pathVertexData[u]),a.push(this.pathVertexData[d])};for(let c=0;c=this.cutoffAngle){const l=e.rotationFrameUp;for(let c=0;c=0?i(n,r.vertices[u],r.normals[u],!1):i(a,e.applyMiterStretch(Fle,r.vertices[u]),r.normals[u],!0)}}else for(let l=0;l=0;i(a,e.applyMiterStretch(Fle,r.vertices[c]),r.normals[c],!u)}}},LAe=class{constructor(){this.up=O(),this.right=O()}};function Rht(t,e,r){De(t.up,e.up,r),De(t.right,e.right,r)}const Fle=Ne(),Ule=_e(),Pht=new LAe;let Mht=class extends Xn{constructor(e,r,i,n,s,o,a){super(e,r,i,null,on.Mesh,a),this.path=n,this.geometrySR=s,this.stencilWidth=o}};var Bf;function DAe(t){return"path"in t}(function(t){t[t.World=0]="World",t[t.Path=1]="Path"})(Bf||(Bf={}));let NAe=class{constructor(e){this.builder=e}onPathChanged(e){this.builder.onPathChanged()}},FAe=class extends NAe{constructor(e){super(e),this.vertexAttributeColor=$t(255,255,255,255),this.size=new Array,this.vertexAttributePosition=Yi(3*this.builder.numVerticesTotal),this.vertexAttributeNormal=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(e){this.vertexAttributeColor[0]=255*e[0],this.vertexAttributeColor[1]=255*e[1],this.vertexAttributeColor[2]=255*e[2],this.vertexAttributeColor[3]=255*(e.length>3?e[3]:1)}bake(e){this.size=e;const{numVerticesTotal:r,pathVertexData:i,path:n,positions:s,profileRightAxes:o,profileUpAxes:a,profileVertexAndNormals:l}=this.builder;for(let c=0;cP){er(R,-C[1],C[0]);const k=es(x,R);dc(C,C,P*Math.sign(F)),dc(R,R,k),Ld(x,C,R)}ne(p,0,0,0)}const T=ne(Dht,v[0]*x[0]+b[0]*x[1],v[1]*x[0]+b[1]*x[1],v[2]*x[0]+b[2]*x[1]),S=3*c;this.vertexAttributePosition[S]=s[u]+T[0]+p[0]*m,this.vertexAttributePosition[S+1]=s[u+1]+T[1]+p[1]*m,this.vertexAttributePosition[S+2]=s[u+2]+T[2]+p[2]*m;const A=er(kle,l[_+2],l[_+3]);bw(this.vertexAttributeNormal,c,v[0]*A[0]+b[0]*A[1]+p[0]*y,v[1]*A[0]+b[1]*A[1]+p[1]*y,v[2]*A[0]+b[2]*A[1]+p[2]*y)}}createGeometryData(){const e=this.builder.vertexIndices.length;return new UAe([[E.POSITION,new Ue(this.vertexAttributePosition,3,!0)],[E.NORMALCOMPRESSED,new Ue(this.vertexAttributeNormal,2,!0)],[E.COLOR,new Ue(this.vertexAttributeColor,4)]],[[E.POSITION,this.builder.vertexIndices],[E.NORMALCOMPRESSED,this.builder.normalIndices],[E.COLOR,OE(e)]])}onPathChanged(e){super.onPathChanged(e),this.bake(this.size)}intersect(e,r,i){const n=this.builder.vertexIndices,s=new Ue(this.vertexAttributePosition,3),o=n.length/3;BP(e,r,0,o,n,s,void 0,void 0,i)}},$ht=class extends NAe{constructor(e,r,i,n){super(e),this.sizeAttributeValue=r,this.colorAttributeValue=i,this.opacityAttributeValue=n,this.vvData=null,this.baked=new FAe(e),this.vvData=Yi(4*this.builder.path.vertices.length);for(let s=0;s0?(v=1/Math.sqrt(v),c[0]=c[0]*v,c[1]=c[1]*v,c[2]=c[2]*v):(c[0]=p.vRight[0],c[1]=p.vRight[1],c[2]=p.vRight[2]),u[0]=m[y]+r.frame.up[0],u[1]=m[y+1]+r.frame.up[1],u[2]=m[y+2]+r.frame.up[2],y+=3;const b=ne(zht,m[y],m[y+1],m[y+2]);MP(b,c,d),kw(d,bu(u,p.vLeft),l)?(l[0]-=m[y],l[1]-=m[y+1],l[2]-=m[y+2],me(o,l),ot(a,c,o),me(a,a)):d5(c,r.frame.up,r.frame.right,s,a,o,n),re(p.frame.up,o),re(p.frame.right,a),r=p}}const zht=O();let kAe=class{constructor(){this.vertices=new Array,this.normals=new Array,this.indices=new Array,this.poles=new Array,this.poleIndices=new Array}addVertex(e,r){return this.vertices.push(D3(e)),this.normals.push(D3(r)),this.vertices.length-1}addPole(e,r=null){return this.poles.push({position:D3(e),normal:r?D3(r):null}),this.poles.length-1}addSegment(e,r=null){this.indices.push(e.v0),this.indices.push(e.v1),r&&(this.poleIndices.push(r.v0),this.poleIndices.push(r.v1))}get numSegments(){return this.indices.length/2}translate(e,r){for(const i of this.vertices)i[0]+=e,i[1]+=r;for(const i of this.poles)i.position[0]+=e,i.position[1]+=r}};const zAe={top:[0,-.5],bottom:[0,.5]};function bz(t){const r=LEe,i=new kAe,n={v0:0,v1:0};i.addPole(or(0,0));for(let o=0;on.size)),e.vvSize?(i.uniforms.add(new Lt("vvSizeMinSize",n=>n.vvSize.minSize),new Lt("vvSizeMaxSize",n=>n.vvSize.maxSize),new Lt("vvSizeOffset",n=>n.vvSize.offset),new Lt("vvSizeFactor",n=>n.vvSize.factor)),i.code.add(w` + vec2 getSize() { + return size * clamp(vvSizeOffset + ${r}.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).xz; + } + `)):i.code.add(w`vec2 getSize(){ +return size; +}`),e.vvOpacity?(i.constants.add("vvOpacityNumber","int",xz),i.uniforms.add(new Sl("vvOpacityValues",n=>n.vvOpacity.values,xz),new Sl("vvOpacityOpacities",n=>n.vvOpacity.opacityValues,xz)),i.code.add(w` + vec4 applyOpacity(vec4 color) { + float value = ${r}.z; + if (value <= vvOpacityValues[0]) { + return vec4( color.xyz, vvOpacityOpacities[0]); + } + + for (int i = 1; i < vvOpacityNumber; ++i) { + if (vvOpacityValues[i] >= value) { + float f = (value - vvOpacityValues[i-1]) / (vvOpacityValues[i] - vvOpacityValues[i-1]); + return vec4( color.xyz, mix(vvOpacityOpacities[i-1], vvOpacityOpacities[i], f)); + } + } + + return vec4( color.xyz, vvOpacityOpacities[vvOpacityNumber - 1]); + } + `)):i.code.add(w`vec4 applyOpacity(vec4 color){ +return color; +}`),e.vvColor?(i.constants.add("vvColorNumber","int",WT),i.uniforms.add(new Sl("vvColorValues",n=>n.vvColor.values,WT),new zSe("vvColorColors",n=>n.vvColor.colors,WT)),i.code.add(w` + vec4 getColor() { + float value = ${r}.y; + if (value <= vvColorValues[0]) { + return applyOpacity(vvColorColors[0]); + } + + for (int i = 1; i < vvColorNumber; ++i) { + if (vvColorValues[i] >= value) { + float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]); + return applyOpacity(mix(vvColorColors[i-1], vvColorColors[i], f)); + } + } + + return applyOpacity(vvColorColors[vvColorNumber - 1]); + } + `)):i.code.add(w`vec4 getColor(){ +return applyOpacity(vec4(1, 1, 1, 1)); +}`),t.include(LP),t.attributes.add(E.PROFILERIGHT,"vec4"),t.attributes.add(E.PROFILEUP,"vec4"),t.attributes.add(E.PROFILEVERTEXANDNORMAL,"vec4"),i.code.add(w`vec3 calculateVPos() { +vec2 size = getSize(); +vec3 origin = position; +vec3 right = profileRight.xyz; +vec3 up = profileUp.xyz; +vec3 forward = cross(up, right); +vec2 profileVertex = profileVertexAndNormal.xy * size; +vec2 profileNormal = profileVertexAndNormal.zw; +float positionOffsetAlongProfilePlaneNormal = 0.0; +float normalOffsetAlongProfilePlaneNormal = 0.0;`),i.code.add(w`if(!isCapVertex()) { +vec2 rotationRight = vec2(profileRight.w, profileUp.w); +float maxDistance = length(rotationRight);`),i.code.add(w`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0); +float rx = dot(profileVertex, rotationRight); +if (abs(rx) > maxDistance) { +vec2 rotationUp = vec2(-rotationRight.y, rotationRight.x); +float ry = dot(profileVertex, rotationUp); +profileVertex = rotationRight * maxDistance * sign(rx) + rotationUp * ry; +} +}else{ +positionOffsetAlongProfilePlaneNormal = profileRight.w * size[0]; +normalOffsetAlongProfilePlaneNormal = profileUp.w; +} +vec3 offset = right * profileVertex.x + up * profileVertex.y + forward * positionOffsetAlongProfilePlaneNormal; +return origin + offset; +}`),i.code.add(w`vec3 localNormal() { +vec3 right = profileRight.xyz; +vec3 up = profileUp.xyz; +vec3 forward = cross(up, right); +vec2 profileNormal = profileVertexAndNormal.zw; +vec3 normal = right * profileNormal.x + up * profileNormal.y; +if(isCapVertex()) { +normal += forward * profileUp.w; +} +return normal; +}`)}let _dt=class extends HP{constructor(){super(...arguments),this.size=or(1,1)}};function vdt(t){const e=new mr,{vertex:r,fragment:i}=e;switch(xc(r,t),e.varyings.add("vpos","vec3"),e.include(ydt,t),t.output!==D.Color&&t.output!==D.Alpha||(e.include(Cl,t),e.include(vw,t),e.include(AE,t),e.varyings.add("vnormal","vec3"),e.varyings.add("vcolor","vec4"),t.hasMultipassTerrain&&e.varyings.add("depth","float"),r.code.add(w` + void main() { + vpos = calculateVPos(); + vnormal = normalize(localNormal()); + + ${t.hasMultipassTerrain?"depth = (view * vec4(vpos, 1.0)).z;":""} + gl_Position = transformPosition(proj, view, vpos); + + ${t.output===D.Color?"forwardLinearDepth();":""} + + vcolor = getColor(); + } + `)),e.include(xu,t),t.output){case D.Alpha:e.include(fn,t),i.uniforms.add(new Ce("opacity",n=>n.opacity)),i.code.add(w` + void main() { + discardBySlice(vpos); + ${t.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""} + float combinedOpacity = vcolor.a * opacity; + fragColor = vec4(combinedOpacity); + } + `);break;case D.Color:e.include(fn,t),e.include(ww,t),e.include(JP,t),e.include(vw,t),e.include(m3e,t),fp(i,t),KP(i),NE(i),i.uniforms.add(r.uniforms.get("localOrigin"),new Lt("ambient",n=>n.ambient),new Lt("diffuse",n=>n.diffuse),new Lt("specular",n=>n.specular),new Ce("opacity",n=>n.opacity)),i.include(cm),lm(i),i.code.add(w` + void main() { + discardBySlice(vpos); + ${t.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""} + + shadingParams.viewDirection = normalize(vpos - cameraPosition); + shadingParams.normalView = vnormal; + vec3 normal = shadingNormal(shadingParams); + float ssao = evaluateAmbientOcclusionInverse(); + + float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin); + vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; + ${t.receiveShadows?"float shadow = readShadowMap(vpos, linearDepth);":t.spherical?"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);":"float shadow = 0.0;"} + vec3 albedo = vcolor.rgb * max(ambient, diffuse); // combine the old material parameters into a single one + float combinedOpacity = vcolor.a * opacity; + albedo += 0.25 * specular; // don't completely ignore specular for now + + vec3 shadedColor = evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight); + fragColor = vec4(shadedColor, combinedOpacity); + fragColor = highlightSlice(fragColor, vpos); + ${t.transparencyPassType===rt.Color?"fragColor = premultiplyAlpha(fragColor);":""} + } + `);break;case D.Depth:case D.Shadow:case D.ShadowHighlight:case D.ShadowExcludeHighlight:e.include(Cl,t),pw(e),e.varyings.add("depth","float"),r.code.add(w`void main() { +vpos = calculateVPos(); +gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth); +}`),e.include(fn,t),e.include(Xg,t),i.code.add(w`void main() { +discardBySlice(vpos); +outputDepth(depth); +}`);break;case D.Normal:e.include(Cl,t),e.include(UR,t),jS(r),e.varyings.add("vnormal","vec3"),r.code.add(w`void main(void) { +vpos = calculateVPos(); +vnormal = normalize((viewNormal * vec4(localNormal(), 1.0)).xyz); +gl_Position = transformPosition(proj, view, vpos); +}`),e.include(fn,t),i.code.add(w`void main() { +discardBySlice(vpos); +vec3 normal = normalize(vnormal); +if (gl_FrontFacing == false) normal = -normal; +fragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0); +}`);break;case D.Highlight:e.include(Cl,t),e.include(UR,t),e.varyings.add("vnormal","vec3"),r.code.add(w`void main(void) { +vpos = calculateVPos(); +gl_Position = transformPosition(proj, view, vpos); +}`),e.include(fn,t),e.include(c0,t),i.code.add(w`void main() { +discardBySlice(vpos); +outputHighlight(); +}`)}return e}const bdt=Object.freeze(Object.defineProperty({__proto__:null,build:vdt},Symbol.toStringTag,{value:"Module"})),WAe=new Map([[E.POSITION,0],[E.PROFILERIGHT,1],[E.PROFILEUP,2],[E.PROFILEVERTEXANDNORMAL,3],[E.FEATUREVALUE,4]]);let wdt=class extends _dt{constructor(){super(...arguments),this.ambient=Se(.2,.2,.2),this.diffuse=Se(.8,.8,.8),this.specular=Se(0,0,0),this.opacity=1,this.origin=O(),this.modelTransformation=null}},qAe=class XAe extends Tr{initializeConfiguration(e,r){r.spherical=e.viewingMode===$e.Global,r.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result}initializeProgram(e){return new vr(e.rctx,XAe.shader.get().build(this.configuration),WAe)}initializePipeline(){const e=this.configuration.transparencyPassType,r=this.configuration,i=e===rt.NONE,n=e===rt.FrontFace;return Ot({blending:r.output!==D.Color&&r.output!==D.Alpha||!r.transparent?null:i?fu:u0(e),culling:r.hasSlicePlane&&!r.transparent&&r.doubleSidedMode!==Zi.None?ixe:null,depthTest:{func:f1(e)},depthWrite:i||n?$l:null,colorWrite:Ft,stencilWrite:r.hasOccludees?em:null,stencilTest:r.hasOccludees?m1:null,polygonOffset:i||n?null:C8})}};qAe.shader=new _r(bdt,()=>ce(()=>import("./Path.glsl-bb1cac2d.js"),[]));let Is=class extends Fo{constructor(){super(...arguments),this.output=D.Color,this.doubleSidedMode=Zi.None,this.transparencyPassType=rt.NONE,this.spherical=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.hasSlicePlane=!1,this.transparent=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.doublePrecisionRequiresObfuscation=!1}};h([U({count:D.COUNT})],Is.prototype,"output",void 0),h([U({count:Zi.COUNT})],Is.prototype,"doubleSidedMode",void 0),h([U({count:rt.COUNT})],Is.prototype,"transparencyPassType",void 0),h([U()],Is.prototype,"spherical",void 0),h([U()],Is.prototype,"receiveShadows",void 0),h([U()],Is.prototype,"receiveAmbientOcclusion",void 0),h([U()],Is.prototype,"vvSize",void 0),h([U()],Is.prototype,"vvColor",void 0),h([U()],Is.prototype,"vvOpacity",void 0),h([U()],Is.prototype,"hasSlicePlane",void 0),h([U()],Is.prototype,"transparent",void 0),h([U()],Is.prototype,"hasOccludees",void 0),h([U()],Is.prototype,"hasMultipassTerrain",void 0),h([U()],Is.prototype,"cullAboveGround",void 0),h([U()],Is.prototype,"doublePrecisionRequiresObfuscation",void 0),h([U({constValue:et.Disabled})],Is.prototype,"pbrMode",void 0),h([U({constValue:!0})],Is.prototype,"hasVvInstancing",void 0),h([U({constValue:!1})],Is.prototype,"useCustomDTRExponentForWater",void 0),h([U({constValue:!1})],Is.prototype,"useFillLights",void 0);let xdt=class YAe extends p1{constructor(e){super(e,new Sdt),this.supportsEdges=!0,this._vertexAttributeLocations=WAe,this._configuration=new Is,this._vertexBufferLayout=YAe.getVertexBufferLayout()}getConfiguration(e,r){return this._configuration.output=e,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.hasOccludees=this.parameters.hasOccludees,e!==D.Color&&e!==D.Alpha||(this._configuration.doubleSidedMode=this.parameters.doubleSided&&this.parameters.doubleSidedType==="normal"?Zi.View:this.parameters.doubleSided&&this.parameters.doubleSidedType==="winding-order"?Zi.WindingOrder:Zi.None,this._configuration.receiveShadows=this.parameters.receiveShadows,this._configuration.receiveAmbientOcclusion=!!r.ssaoHelper.active&&this.parameters.receiveSSAO),this._configuration.transparencyPassType=r.transparencyPassType,this._configuration.hasMultipassTerrain=r.multipassTerrain.enabled,this._configuration.cullAboveGround=r.multipassTerrain.cullAboveGround,this._configuration}isVisibleForOutput(e){return e!==D.Shadow&&e!==D.ShadowExcludeHighlight&&e!==D.ShadowHighlight||this.parameters.castShadows}isVisible(){return super.isVisible()&&this.parameters.opacity>0}intersect(e,r,i,n,s,o){const a=e;if(!DAe(a))return;const l=a.path,c=[this.parameters.size[0],this.parameters.size[1]];if(this.parameters.vvSize){const{offset:v,factor:b,minSize:x,maxSize:T}=this.parameters.vvSize,S=l.sizeAttributeValue;c[0]*=ge(v[0]+S*b[0],x[0],T[0]),c[1]*=ge(v[2]+S*b[2],x[2],T[2])}const u=Math.max(c[0],c[1]),d=e.boundingInfo;if(d==null)return void this._intersectTriangles(l,c,n,s,o);const p=iw(d.bbMin[0]-u,d.bbMin[1]-u,d.bbMin[2]-u,d.bbMax[0]+u,d.bbMax[1]+u,d.bbMax[2]+u),m=[s[0]-n[0],s[1]-n[1],s[2]-n[2]],y=Math.sqrt(m[0]*m[0]+m[1]*m[1]+m[2]*m[2]),_=[y/m[0],y/m[1],y/m[2]];QQ(p,n,_,i.tolerance)&&this._intersectTriangles(l,c,n,s,o)}_intersectTriangles(e,r,i,n,s){e.baked.size&&e.baked.size[0]===r[0]&&e.baked.size[1]===r[1]||e.baked.bake(r),e.baked.intersect(i,n,s)}createBufferWriter(){return new DE(this._vertexBufferLayout)}requiresSlot(e,r){switch(r){case D.Shadow:case D.ShadowHighlight:case D.ShadowExcludeHighlight:if(!this.parameters.castShadows)return!1;case D.Color:case D.Alpha:case D.Depth:case D.Normal:case D.Highlight:case D.ObjectAndLayerIdColor:return e===(this.parameters.transparent?le.TRANSPARENT_MATERIAL:le.OPAQUE_MATERIAL)||e===le.DRAPED_MATERIAL;default:return!1}}createGLMaterial(e){return new Tdt(e)}static getVertexBufferLayout(){return Gi().vec3f(E.POSITION).vec4f(E.PROFILERIGHT).vec4f(E.PROFILEUP).vec4f(E.PROFILEVERTEXANDNORMAL).vec4f(E.FEATUREVALUE)}},Tdt=class extends h1{_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}_updateShadowState(e){this.technique!=null&&e.shadowMap.enabled===this.technique.configuration.receiveShadows||this._material.setParameters({receiveShadows:e.shadowMap.enabled})}beginSlot(e){return this._output!==D.Color&&this._output!==D.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e)),this.ensureTechnique(qAe,e)}},Sdt=class extends wdt{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.receiveSSAO=!0,this.receiveShadows=!1,this.castShadows=!0,this.hasSlicePlane=!1,this.transparent=!1,this.hasOccludees=!1}};const Edt=["polyline"];let Cdt=class extends hm{constructor(e,r,i,n){super(e,r,i,n),this._intrinsicSize=or(1,1),this._upVectorAlignment=Bf.Path,this._stencilWidth=.1,this.ensureDrapedStatus(!1)}async doLoad(){var p,m,y,_;const e=this.symbolLayer.width!=null?this.symbolLayer.width:this.symbolLayer.height,r=this.symbolLayer.height!=null?this.symbolLayer.height:e;this._vvConvertOptions=new jP({size:!0,color:!0,rotation:!1,opacity:!0},[1,1,1],[e,1,r],this._context.renderCoordsHelper.unitInMeters),this._fastUpdates=((m=(p=this._context.renderer)==null?void 0:p.visualVariables)==null?void 0:m.length)>0?qS(this._context.renderer,this._vvConvertOptions):null;const i=this.symbolLayer.anchor||"center";this._upVectorAlignment=this.symbolLayer.profileRotation==="heading"?Bf.World:Bf.Path;const n=this.symbolLayer.profile||"circle";switch(n){default:case"circle":this._profile=Bht[i];break;case"quad":this._profile=Vht[i]}switch(this.symbolLayer.join){case"round":this._extruder=new vz(0,IEe);break;case"bevel":this._extruder=new vz(0,1);break;case"miter":this._extruder=new vz(.8*Math.PI,1);break;default:this._extruder=new Oht}const s=this.symbolLayer.cap||"butt";switch(s){case"none":this._startCap=new Dle,this._endCap=new Dle;break;case"butt":default:this._startCap=new PI(this._profile,0),this._endCap=new PI(this._profile,0,!0);break;case"square":this._startCap=new PI(this._profile,-.5),this._endCap=new PI(this._profile,.5,!0);break;case"round":{const v=n==="quad";this._startCap=new Nle({profile:this._profile,flip:!1,breakNormals:v,subdivisions:HH}),this._endCap=new Nle({profile:this._profile,flip:!0,breakNormals:v,subdivisions:HH});break}}const o=(_=(y=this.symbolLayer)==null?void 0:y.material)==null?void 0:_.color,a=this._getCombinedOpacityAndColor(o),l=na(a),c=a[3],u=c<1||this.needsDrivenTransparentPass,d={diffuse:l,ambient:l,opacity:c,transparent:u,hasVertexColors:!1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,cullFace:u||s==="none"?ui.None:ui.Back,offsetTransparentBackfaces:!0};if(!this._drivenProperties.size&&(er(this._intrinsicSize,e,r),!jH(this._intrinsicSize[0])||!jH(this._intrinsicSize[1])))throw new Y("graphics3dpathsymbollayer:invalid-size","Symbol sizes may not be negative values");if(this._fastUpdates&&this._fastUpdates.visualVariables.size||dc(this._intrinsicSize,this._intrinsicSize,1/this._context.renderCoordsHelper.unitInMeters),this._fastUpdates){const v={...d,...this._fastUpdates.materialParameters,size:Zve(this._intrinsicSize)};this._material=new xdt(v)}else d.hasVertexColors=this._drivenProperties.color||this._drivenProperties.opacity,d.normalType=br.Compressed,this._material=new tm(d);this._material.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),this._context.stage.add(this._material)}destroy(){super.destroy(),this._context.stage.remove(this._material),this._material=null}createGraphics3DGraphic(e){const r=e.graphic;if(!this._validateGeometry(r.geometry,Edt,this.symbolLayer.type))return null;const i=this.setGraphicElevationContext(r,new wp),n=e.renderingInfo;return this._createAs3DShape(r,n,i,r.uid)}layerOpacityChanged(){var n,s;const e=(s=(n=this.symbolLayer)==null?void 0:n.material)==null?void 0:s.color,r=this._getCombinedOpacity(e),i=r<1||this.needsDrivenTransparentPass;this._material.setParameters({opacity:r,transparent:i})}layerElevationInfoChanged(e,r){return this.updateGraphics3DGraphicElevationInfo(e,r,K_)}slicePlaneEnabledChanged(){return this._material.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return this._material.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}applyRendererDiff(e,r){for(const i in e.diff){if(i!=="visualVariables"||!XS(this._fastUpdates,r,this._vvConvertOptions))return $n.RecreateSymbol;this._material.setParameters(this._fastUpdates.materialParameters)}return $n.FastUpdate}_getVertexData(e){let r=0;const i=e.paths,n=[],s=e.spatialReference,o=this._context.elevationProvider.spatialReference,a=this._context.renderCoordsHelper.spatialReference;for(const d of i)r+=d.length;const l=Ys(3*r);let c,u=0;for(const d of i){n.push({offset:u,numVertices:d.length});for(const p of d)l[u++]=p[0],l[u++]=p[1],l[u++]=e.hasZ?p[2]:0}return o==null||s.equals(o)||$i(l,s,0,l,o,0,r)?(o==null||o.equals(a)?c=v2e(l):(c=Ys(3*r),$i(l,o,0,c,a,0,r)),{pathVertexDataInfos:n,vertexDataES:l,vertexDataRS:c}):null}_createAs3DShape(e,r,i,n){var y,_,v;const s=e.geometry,o=this._getVertexData(s);if(o==null)return this.logger.warn("PathSymbol3DLayer geometry failed to be created (failed to project geometry to view spatial reference)"),null;if(o.pathVertexDataInfos.length===0)return s.paths.length!==0&&s.paths.some(b=>b.length>0)||this.logger.warn("PathSymbol3DLayer geometry failed to be created (no paths were defined)"),null;const a=new Array,l=s.spatialReference,c=ps(),u=this._context.renderCoordsHelper,d=new BQ(o.vertexDataES);for(const b of o.pathVertexDataInfos){const x=b.numVertices;if(x<2)continue;const T=b.offset;if(this._context.clippingExtent!=null&&(vi(c),lu(c,o.vertexDataES,T,x),!Hd(c,this._context.clippingExtent)))continue;const S=new Array,A=T+3*x;for(let X=T;XOdt(b,x,S,A,this._upVectorAlignment),i);return m.alignedSampledElevation=0,m.needsElevationUpdates=K_(i.mode),m}};function ZAe(t,e,r){const{origin:i,positions:n}=t;let s=t.offset;switch(e){default:case Bf.World:for(const o of t.vertices)hn[0]=n[s++]+i[0],hn[1]=n[s++]+i[1],hn[2]=n[s++]+i[2],r.worldUpAtPosition(hn,hn),o.setFrameFromUpVector(hn);break;case Bf.Path:hn[0]=n[s]+i[0],hn[1]=n[s+1]+i[1],hn[2]=n[s+2]+i[2],r.worldUpAtPosition(hn,hn),kht(t,hn)}}function Gle(t,e,r){switch(t){case"symbol-value":return r;case"proportional":return e;default:return t}}function Adt(t,e,r,i){let n=0;const{origin:s,vertices:o,positions:a,positionsES:l}=t,c=t.offset+3*o.length;for(let u=t.offset;uc.color));const a=t.output===D.Depth;a&&(e.include(Xg,t),pw(e),W_(e)),r.code.add(w` + void main(void) { + vpos = position; + forwardNormalizedVertexColor(); + forwardObjectAndLayerIdColor(); + + ${t.hasVertexColors?"vColor *= eColor;":t.vvColor?"vColor = eColor * interpolateVVColor(colorFeatureAttribute);":"vColor = eColor;"} + ${o?"depth = (view * vec4(vpos, 1.0)).z;":""} + gl_Position = ${a?w`transformPositionWithDepth(proj, view, vpos, nearFar, linearDepth);`:w`transformPosition(proj, view, vpos);`} + } + `),e.include(fn,t),o&&e.include(xu,t),i.include(cm);const l=t.output===D.Highlight;return l&&e.include(c0,t),i.code.add(w` + void main() { + discardBySlice(vpos); + ${o?"terrainDepthTest(gl_FragCoord, depth);":""} + vec4 fColor = vColor; + + ${t.output===D.ObjectAndLayerIdColor?w`fColor.a = 1.0;`:""} + + if (fColor.a < ${w.float(vo)}) { + discard; + } + + ${t.output===D.Alpha?w`fragColor = vec4(fColor.a);`:""} + + ${t.output===D.Color?w`fragColor = highlightSlice(fColor, vpos); ${t.transparencyPassType===rt.Color?"fragColor = premultiplyAlpha(fragColor);":""}`:""} + ${l?w`outputHighlight();`:""}; + ${t.output===D.Depth?w`outputDepth(linearDepth);`:""}; + ${t.output===D.ObjectAndLayerIdColor?w`outputObjectAndLayerIdColor();`:""} + } + `),e}const Ldt=Object.freeze(Object.defineProperty({__proto__:null,build:Idt},Symbol.toStringTag,{value:"Module"}));let JAe=class KAe extends Tr{initializeProgram(e){return new vr(e.rctx,KAe.shader.get().build(this.configuration),fr)}_createPipeline(e,r){const i=this.configuration,n=e===rt.NONE,s=e===rt.FrontFace;return Ot({blending:i.output!==D.Color&&i.output!==D.Alpha||!i.transparent?null:n?fu:u0(e),culling:J6(i.cullFace),depthTest:{func:f1(e)},depthWrite:(n||s)&&i.writeDepth?$l:null,colorWrite:Ft,stencilWrite:i.hasOccludees?em:null,stencilTest:i.hasOccludees?r?r1:m1:null,polygonOffset:n||s?i.polygonOffset?Ddt:null:A8(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._createPipeline(this.configuration.transparencyPassType,!0),this._createPipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,r){return r?this._occludeePipelineState:super.getPipelineState(e,r)}};JAe.shader=new _r(Ldt,()=>ce(()=>import("./ColorMaterial.glsl-c349707a.js"),[]));const Ddt={factor:1,units:1};let Ro=class extends Fo{constructor(){super(...arguments),this.output=D.Color,this.cullFace=ui.None,this.transparencyPassType=rt.NONE,this.hasSlicePlane=!1,this.hasVertexColors=!1,this.transparent=!1,this.polygonOffset=!1,this.enableOffset=!0,this.writeDepth=!0,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.objectAndLayerIdColorInstanced=!1,this.vvColor=!1}};h([U({count:D.COUNT})],Ro.prototype,"output",void 0),h([U({count:ui.COUNT})],Ro.prototype,"cullFace",void 0),h([U({count:rt.COUNT})],Ro.prototype,"transparencyPassType",void 0),h([U()],Ro.prototype,"hasSlicePlane",void 0),h([U()],Ro.prototype,"hasVertexColors",void 0),h([U()],Ro.prototype,"transparent",void 0),h([U()],Ro.prototype,"polygonOffset",void 0),h([U()],Ro.prototype,"enableOffset",void 0),h([U()],Ro.prototype,"writeDepth",void 0),h([U()],Ro.prototype,"hasOccludees",void 0),h([U()],Ro.prototype,"hasMultipassTerrain",void 0),h([U()],Ro.prototype,"cullAboveGround",void 0),h([U()],Ro.prototype,"objectAndLayerIdColorInstanced",void 0),h([U()],Ro.prototype,"vvColor",void 0),h([U({constValue:!0})],Ro.prototype,"hasVvInstancing",void 0),h([U({constValue:!1})],Ro.prototype,"vvSize",void 0),h([U({constValue:!1})],Ro.prototype,"vvOpacity",void 0);let Hle=class extends IJ{constructor(e){super(e,new Fdt),this.supportsEdges=!0,this._configuration=new Ro}getConfiguration(e,r){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.transparencyPassType=r.transparencyPassType,this._configuration.enableOffset=r.camera.relativeElevation1/u.screenToPCSRatio)):s.add(E.BOUNDINGRECT,"mat3"),s.add(E.POSITION,"vec3"),s.add(E.UVMAPSPACE,"vec4"),t.vvColor&&s.add(E.COLORFEATUREATTRIBUTE,"float"),o.add("vColor","vec4"),o.add("vpos","vec3"),o.add("vuv","vec2"),r&&o.add("depth","float"),i.uniforms.add(new Jt("uColor",c=>c.color));const a=t.style===_o.ForwardDiagonal||t.style===_o.BackwardDiagonal||t.style===_o.DiagonalCross;a&&i.code.add(w` + const mat2 rotate45 = mat2(${w.float(hW)}, ${w.float(-Wle)}, + ${w.float(Wle)}, ${w.float(hW)}); + `),t.draped||(fp(i,t),i.uniforms.add(new Ce("worldToScreenPerDistanceRatio",(c,u)=>1/u.camera.perScreenPixelRatio)),i.code.add(w`vec3 projectPointToLineSegment(vec3 center, vec3 halfVector, vec3 point) { +float projectedLength = dot(halfVector, point - center) / dot(halfVector, halfVector); +return center + halfVector * clamp(projectedLength, -1.0, 1.0); +}`),i.code.add(w`vec3 intersectRayPlane(vec3 rayDir, vec3 rayOrigin, vec3 planeNormal, vec3 planePoint) { +float d = dot(planeNormal, planePoint); +float t = (d - dot(planeNormal, rayOrigin)) / dot(planeNormal, rayDir); +return rayOrigin + t * rayDir; +}`),i.code.add(w` + float boundingRectDistanceToCamera() { + vec3 center = vec3(boundingRect[0][0], boundingRect[0][1], boundingRect[0][2]); + vec3 halfU = vec3(boundingRect[1][0], boundingRect[1][1], boundingRect[1][2]); + vec3 halfV = vec3(boundingRect[2][0], boundingRect[2][1], boundingRect[2][2]); + vec3 n = normalize(cross(halfU, halfV)); + + vec3 viewDir = - vec3(view[0][2], view[1][2], view[2][2]); + + float viewAngle = dot(viewDir, n); + float minViewAngle = ${w.float(Udt)}; + + if (abs(viewAngle) < minViewAngle) { + // view direction is (almost) parallel to plane -> clamp it to min angle + float normalComponent = sign(viewAngle) * minViewAngle - viewAngle; + viewDir = normalize(viewDir + normalComponent * n); + } + + // intersect view direction with infinite plane that contains bounding rect + vec3 planeProjected = intersectRayPlane(viewDir, cameraPosition, n, center); + + // clip to bounds by projecting to u and v line segments individually + vec3 uProjected = projectPointToLineSegment(center, halfU, planeProjected); + vec3 vProjected = projectPointToLineSegment(center, halfV, planeProjected); + + // use to calculate the closest point to camera on bounding rect + vec3 closestPoint = uProjected + vProjected - center; + + return length(closestPoint - cameraPosition); + } + `)),i.code.add(w` + vec2 scaledUV() { + vec2 uv = uvMapSpace.xy ${a?" * rotate45":""}; + vec2 uvCellOrigin = uvMapSpace.zw ${a?" * rotate45":""}; + + ${t.draped?"":w` + float distanceToCamera = boundingRectDistanceToCamera(); + float worldToScreenRatio = worldToScreenPerDistanceRatio / distanceToCamera; + `} + + // Logarithmically discretize ratio to avoid jittering + float step = 0.1; + float discreteWorldToScreenRatio = log(worldToScreenRatio); + discreteWorldToScreenRatio = ceil(discreteWorldToScreenRatio / step) * step; + discreteWorldToScreenRatio = exp(discreteWorldToScreenRatio); + + vec2 uvOffset = mod(uvCellOrigin * discreteWorldToScreenRatio, ${w.float(t.patternSpacing)}); + return uvOffset + (uv * discreteWorldToScreenRatio); + } + `);const l=t.output===D.Depth;return l&&(e.include(Xg,t),pw(e),W_(e)),i.code.add(w` + void main(void) { + vuv = scaledUV(); + vpos = position; + ${r?"depth = (view * vec4(vpos, 1.0)).z;":""} + forwardNormalizedVertexColor(); + ${t.hasVertexColors?"vColor *= uColor;":t.vvColor?"vColor = uColor * interpolateVVColor(colorFeatureAttribute);":"vColor = uColor;"} + gl_Position = ${l?w`transformPositionWithDepth(proj, view, vpos, nearFar, linearDepth);`:w`transformPosition(proj, view, vpos);`} + } + `),e.include(fn,t),n.include(cm),t.draped&&n.uniforms.add(new Ce("texelSize",(c,u)=>1/u.camera.pixelRatio)),t.output===D.Highlight&&e.include(c0,t),r&&e.include(xu,t),t.output!==D.Highlight&&(n.code.add(w` + const float lineWidth = ${w.float(t.lineWidth)}; + const float spacing = ${w.float(t.patternSpacing)}; + const float spacingINV = ${w.float(1/t.patternSpacing)}; + + float coverage(float p, float txlSize) { + p = mod(p, spacing); + + float halfTxlSize = txlSize / 2.0; + + float start = p - halfTxlSize; + float end = p + halfTxlSize; + + float coverage = (ceil(end * spacingINV) - floor(start * spacingINV)) * lineWidth; + coverage -= min(lineWidth, mod(start, spacing)); + coverage -= max(lineWidth - mod(end, spacing), 0.0); + + return coverage / txlSize; + } + `),t.draped||n.code.add(w`const int maxSamples = 5; +float sampleAA(float p) { +vec2 dxdy = abs(vec2(dFdx(p), dFdy(p))); +float fwidth = dxdy.x + dxdy.y; +ivec2 samples = 1 + ivec2(clamp(dxdy, 0.0, float(maxSamples - 1))); +vec2 invSamples = 1.0 / vec2(samples); +float accumulator = 0.0; +for (int j = 0; j < maxSamples; j++) { +if(j >= samples.y) { +break; +} +for (int i = 0; i < maxSamples; i++) { +if(i >= samples.x) { +break; +} +vec2 step = vec2(i,j) * invSamples - 0.5; +accumulator += coverage(p + step.x * dxdy.x + step.y * dxdy.y, fwidth); +} +} +accumulator /= float(samples.x * samples.y); +return accumulator; +}`)),n.code.add(w` + void main() { + discardBySlice(vpos); + ${r?"terrainDepthTest(gl_FragCoord, depth);":""} + vec4 color = vColor; + color = highlightSlice(color, vpos); + + ${t.output!==D.Highlight?w`color.a *= ${zdt(t)};`:""} + + ${t.output===D.ObjectAndLayerIdColor?w`color.a = 1.0;`:""} + + if (color.a < ${w.float(vo)}) { + discard; + } + + ${t.output===D.Alpha?w`fragColor = vec4(color.a);`:""} + + ${t.output===D.Color?w`fragColor = color; ${t.transparencyPassType===rt.Color?"fragColor = premultiplyAlpha(fragColor);":""}`:""} + ${t.output===D.Highlight?w`outputHighlight();`:""} + ${t.output===D.Depth?w`outputDepth(linearDepth);`:""}; + } + `),e}function zdt(t){function e(r){return t.draped?w`coverage(vuv.${r}, texelSize)`:w`sampleAA(vuv.${r})`}switch(t.style){case _o.ForwardDiagonal:case _o.Horizontal:return e("y");case _o.BackwardDiagonal:case _o.Vertical:return e("x");case _o.DiagonalCross:case _o.Cross:return w` + 1.0 - (1.0 - ${e("x")}) * (1.0 - ${e("y")}) + `;default:return"0.0"}}const Bdt=Object.freeze(Object.defineProperty({__proto__:null,build:kdt},Symbol.toStringTag,{value:"Module"}));let eOe=class tOe extends Tr{initializeProgram(e){return new vr(e.rctx,tOe.shader.get().build(this.configuration),rOe)}_setPipelineState(e,r){const i=this.configuration,n=e===rt.NONE,s=e===rt.FrontFace;return Ot({blending:i.output===D.Color||i.output===D.Alpha?n?fu:u0(e):null,culling:J6(i.cullFace),depthTest:{func:f1(e)},depthWrite:n?i.writeDepth?$l:null:S8(e),colorWrite:Ft,stencilWrite:i.hasOccludees?em:null,stencilTest:i.hasOccludees?r?r1:m1:null,polygonOffset:n||s?i.polygonOffset?Vdt:null:A8(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._setPipelineState(this.configuration.transparencyPassType,!0),this._setPipelineState(this.configuration.transparencyPassType,!1)}getPipelineState(e,r){return r?this._occludeePipelineState:super.getPipelineState(e,r)}};eOe.shader=new _r(Bdt,()=>ce(()=>import("./Pattern.glsl-2fa8b945.js"),[]));const Vdt={factor:1,units:1};let Ls=class extends Fo{constructor(){super(...arguments),this.output=D.Color,this.cullFace=ui.None,this.transparencyPassType=rt.NONE,this.hasSlicePlane=!1,this.hasVertexColors=!1,this.polygonOffset=!1,this.writeDepth=!0,this.hasOccludees=!1,this.enableOffset=!0,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.vvColor=!1}};h([U({count:D.COUNT})],Ls.prototype,"output",void 0),h([U({count:ui.COUNT})],Ls.prototype,"cullFace",void 0),h([U({count:_o.COUNT})],Ls.prototype,"style",void 0),h([U({count:rt.COUNT})],Ls.prototype,"transparencyPassType",void 0),h([U()],Ls.prototype,"hasSlicePlane",void 0),h([U()],Ls.prototype,"hasVertexColors",void 0),h([U()],Ls.prototype,"polygonOffset",void 0),h([U()],Ls.prototype,"writeDepth",void 0),h([U()],Ls.prototype,"hasOccludees",void 0),h([U()],Ls.prototype,"patternSpacing",void 0),h([U()],Ls.prototype,"lineWidth",void 0),h([U()],Ls.prototype,"enableOffset",void 0),h([U()],Ls.prototype,"draped",void 0),h([U()],Ls.prototype,"hasMultipassTerrain",void 0),h([U()],Ls.prototype,"cullAboveGround",void 0),h([U()],Ls.prototype,"vvColor",void 0),h([U({constValue:!1})],Ls.prototype,"hasVvInstancing",void 0),h([U({constValue:!1})],Ls.prototype,"vvSize",void 0),h([U({constValue:!1})],Ls.prototype,"vvOpacity",void 0);const rOe=new Map([[E.POSITION,0],[E.COLOR,3],[E.UVMAPSPACE,4],[E.COLORFEATUREATTRIBUTE,5],[E.BOUNDINGRECT,6]]);let nK=class extends IJ{constructor(e){super(e,new Hdt),this.supportsEdges=!0,this._vertexAttributeLocations=rOe,this._configuration=new Ls}getConfiguration(e,r){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.style=this.parameters.style,this._configuration.patternSpacing=this.parameters.patternSpacing,this._configuration.lineWidth=this.parameters.lineWidth,this._configuration.draped=this.parameters.draped,this._configuration.transparencyPassType=r.transparencyPassType,this._configuration.enableOffset=r.camera.relativeElevation{const n=tAe(e.pattern);return new yT({width:i,color:this._getOutlineColor(),hasPolygonOffset:!0,hasSlicePlane:this._context.slicePlaneEnabled,isClosed:!0,stipplePattern:n,stippleScaleWithLineWidth:!0,cap:oW(e.patternCap||"butt")})};this._outlineMaterial=r(ha(e.size)),this._context.stage.add(this._outlineMaterial)}_isValidOutline(e){return e!=null&&e.size!=null&&e.size>0&&e.color!=null&&(e.pattern==null||e.pattern.type!=="style"||e.pattern.style!=="none")}destroy(){super.destroy(),this._context.stage.remove(this._material),this._material=null,this._context.stage.remove(this._outlineMaterial),this._outlineMaterial=null}createGraphics3DGraphic(e){const r=e.graphic;if(!this._validateGeometry(r.geometry,Qdt,this.symbolLayer.type))return null;const i=this._getVertexOpacityAndColor(e.renderingInfo,255),n=this.setGraphicElevationContext(r,new wp);return this.ensureDrapedStatus(n.mode==="on-the-ground"),this._ensureMaterials(),this.draped?this._createAsOverlay(r,i):this._createAs3DShape(r,i,n)}applyRendererDiff(e,r){for(const i in e.diff){if(i!=="visualVariables"||!XS(this._fastUpdates,r,qle))return $n.RecreateSymbol;this._material&&this._material.setParameters(this._fastUpdates.materialParameters)}return $n.FastUpdate}layerOpacityChanged(){var e,r;if(this._material!=null){const i=this._material.parameters.color,n=(r=(e=this.symbolLayer)==null?void 0:e.material)==null?void 0:r.color,s=this._getCombinedOpacity(n);this._material.setParameters({color:[i[0],i[1],i[2],s],transparent:s<1||this.needsDrivenTransparentPass})}if(this._outlineMaterial!=null){const i=this._outlineMaterial.parameters.color;this._outlineMaterial.setParameters({color:[i[0],i[1],i[2],this._getOutlineOpacity()]})}}layerElevationInfoChanged(e,r,i){const n=this._elevationContext.mode,s=WP(nOe.elevationModeChangeTypes,i,n);if(s!==an.UPDATE)return s;const o=Bh(n);return this.updateGraphics3DGraphicElevationInfo(e,r,()=>o)}slicePlaneEnabledChanged(){if(this._material&&this._material.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._outlineMaterial){const e={hasSlicePlane:this._context.slicePlaneEnabled};this._outlineMaterial.setParameters(e)}return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,r,i){var u;const n=FR(e.geometry);if(!n)return null;const s=VJ(n,this._context.elevationProvider,this._context.renderCoordsHelper,i),o=new Jdt(s,r,this._context.layer.uid,e.uid),a=o.renderData.position.length/3;if(this._needsUV&&(o.uvMapSpace=Yi(4*a,!0),o.boundingRect=Ys(9*a,!0),QAe(o.uvMapSpace,o.boundingRect,o.renderData.position,this._context.renderCoordsHelper)),o.objectAndLayerIdColor=(u=this._context.stage.renderView)==null?void 0:u.getObjectAndLayerIdColor(o),this._createAs3DShapeFill(e,o),this._hasOutline&&this._createAs3DShapeOutline(o),this._logGeometryCreationWarnings(o.renderData,n.rings,"rings","FillSymbol3DLayer"),o.outGeometries.length===0)return null;const l=new h0({geometries:o.outGeometries,castShadow:!1,layerUid:this._context.layer.uid,graphicUid:e.uid}),c=new um(this,l,o.outGeometries,null,null,Zdt,i);return c.alignedSampledElevation=o.renderData.sampledElevation,c.needsElevationUpdates=Bh(i.mode),c}_createAs3DShapeFill(e,r){var n;const i=r.renderData.polygons;for(const{position:s,mapPositions:o,holeIndices:a,index:l,count:c}of i){if(this._context.clippingExtent!=null&&(vi(nd),lu(nd,o),!Hd(nd,this._context.clippingExtent)))continue;const u=QS(o,a,3);if(u.length===0)continue;const d=(n=this._fastUpdates)==null?void 0:n.visualVariables.color,p=rae({material:this._material,indices:u,mapPositions:o,attributeData:{position:s,color:d?null:r.color,colorFeature:d?ip(d.field,e):null,uvMapSpace:this._needsUV?c5(r.uvMapSpace,4*l,4*c):null,boundingRect:this._needsUV?Ch(r.boundingRect,9*l,9*c):null,objectAndLayerIdColor:r.objectAndLayerIdColor}});r.outGeometries.push(p)}}_createAs3DShapeOutline(e){if(!this._hasOutline)return;const r=e.renderData.outlines;for(let i=0;ithis._createAsOverlay(e,r),createAs3DShape:(e,r,i)=>this._createAs3DShape(e,r,i)}}};iOe.elevationModeChangeTypes={definedChanged:an.RECREATE,staysOnTheGround:an.NONE,onTheGroundChanged:an.RECREATE};const nd=ps();let Jdt=class extends N8{constructor(e,r,i,n){super(e,i,n),this.color=r}},Kdt=class extends N8{constructor(e,r,i,n){super(e,i,n),this.color=r}};const ept="arial-unicode-ms",Xle="woff2",Yle=new Map,sOe=new Set;let tpt=class{constructor(e,r){this.fontFace=e,this.promise=r}};async function rpt(t){const e=spt(t),r=Yle.get(e);if(r)return r.promise;const i=new FontFace(t.family,`url('${Jr.fontsUrl}/woff2/${e}.${Xle}') format('${Xle}')`,{style:t.style,weight:t.weight}),n=document.fonts;if(n.has(i)&&i.status==="loading")return i.loaded;const s=i.load().then(()=>(n.add(i),i));return Yle.set(e,new tpt(i,s)),sOe.add(i),s}function ipt(t){return sOe.has(t)}function npt(t){if(!t)return ept;const e=t.toLowerCase().split(" ").join("-");switch(e){case"serif":return"noto-serif";case"sans-serif":return"arial-unicode-ms";case"monospace":return"ubuntu-mono";case"fantasy":return"cabin-sketch";case"cursive":return"redressed";default:return e}}function spt(t){const e=opt(t)+apt(t);return npt(t.family)+(e.length>0?e:"-regular")}function opt(t){if(!t.weight)return"";switch(t.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function apt(t){if(!t.style)return"";switch(t.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}let oOe=class aOe{constructor(e){this.definition=e,this.key=JSON.stringify(e),this.haloSize=Math.round(e.halo.size),this.textStyle=this._colorToRGBA(e.color),this.haloStyle=this._colorToRGB(e.halo.color),this.backgroundStyle=e.background.color[3]!==0?this._colorToRGBA(e.background.color):null}fontString(e){const r=this.definition.font;return`${r.style} ${r.weight} ${e}px ${r.family}, sans-serif`}_colorToRGB(e){return`rgb(${e.slice(0,3).map(r=>Math.floor(255*r)).toString()})`}_colorToRGBA(e){return`rgba(${e.slice(0,3).map(r=>Math.floor(255*r)).toString()},${e[3]})`}static async fromSymbol(e,r){var p,m,y,_,v;const i=(p=e==null?void 0:e.material)==null?void 0:p.color,n=it.toUnitRGBA(i)??Nf,s=e.size!=null?ha(e.size):12,o=e.lineHeight,a=e.background!=null?it.toUnitRGBA(e.background.color):Nf,l={family:((m=e.font)==null?void 0:m.family)??"sans-serif",decoration:((y=e.font)==null?void 0:y.decoration)??"none",weight:((_=e.font)==null?void 0:_.weight)??"normal",style:((v=e.font)==null?void 0:v.style)??"normal"},c=e.halo,u=c!=null&&c.color!=null&&c.size>0?{size:ha(c.size),color:it.toUnitRGBA(c.color)}:{size:0,color:Nf},d=new aOe({color:n,size:s,background:{color:a,padding:e.background!=null?[.65*s,.5*s]:[0,0],borderRadius:e.background!=null?s*(6/16):0},lineSpacingFactor:o,font:l,halo:u,pixelRatio:r});if(e.font){let b=!1;const x=d.fontString(s);try{b=(await document.fonts.load(x)).some(T=>!ipt(T))}catch{J.getLogger("esri.views.3d.webgl-engine.lib.TextRenderParameters").warnOnce(`Failed to preload font '${x}'. Some text symbology may be rendered using the default browser font.`)}if(!b&&!lpt.has(e.font.family))try{await rpt(e.font)}catch{}}return d}};const lpt=new Set(["Arial","Times New Roman","Courier New","serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong"]);let cpt=class{constructor(e,r,i){this._renderer=new q3e(e,r,i)}get key(){return this._renderer.key}get baselineAnchorY(){return 1-this._renderer.firstRenderedBaselinePosition/this._renderer.renderedHeight}get displayWidth(){return this._renderer.displayWidth}get displayHeight(){return this._renderer.displayHeight}create(){const e=nW(upt,this._renderer.renderedWidth,this._renderer.renderedHeight),r=e.getContext("2d");return r.save(),this._renderer.render(r,0,0),r.restore(),new Hw(e,{wrap:{s:Pt.CLAMP_TO_EDGE,t:Pt.CLAMP_TO_EDGE},noUnpackFlip:!1,mipmap:!0,preMultiplyAlpha:!0})}};const upt={canvas:null},hpt=[0,0,1];let dpt=class extends hm{constructor(e,r,i,n){super(e,r,i,n),this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1},this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){const e=R8(this.symbolLayer.size);if(e)throw new Y("graphics3dtextsymbollayer:invalid-size",e)}await this._createTextRenderParameters()}async _createTextRenderParameters(){const e=this._context.graphicsCoreOwner.view.state.rasterPixelRatio;this._textRenderParameters=await oOe.fromSymbol(this.symbolLayer,e)}destroy(){super.destroy()}createGraphics3DGraphic(e){const r=e.graphic,i=DR(r.geometry);if(i==null)return this.logger.warn(`unsupported geometry type for text symbol: ${r.geometry.type}`),null;const n=this.symbolLayer.text;if(n==null||n==="")return null;const s=iZ(this.symbol)&&this.symbol.hasVisibleVerticalOffset()?this.symbol.verticalOffset:null;if(s!=null&&!V1e(this.symbolLayer))return this.logger.errorOncePerTick(`Callouts and vertical offset on text symbols are currently only supported with 'center' horizontal alignment (not with '${this.symbolLayer.horizontalAlignment}' alignment)`),null;const o=new xEe(s,this.symbolLayer.horizontalAlignment,Glt(this.symbolLayer.verticalAlignment));return this._createAs3DShape(r,i,n,o)}createLabel(e,r,i,n){const s=e.graphic,o=DR(s.geometry);if(o==null)return this.logger.warn(`unsupported geometry type for label: ${s.geometry.type}`),null;const a=r.text;return!a||/^\s+$/.test(a)?null:this._createAs3DShape(s,o,a,r,i,n)}setGraphicElevationContext(e,r,i=0){const n=super.setGraphicElevationContext(e,r);return n.addOffsetRenderUnits(i),n}layerOpacityChanged(){return this.logger.warn("layer opacity change not yet implemented in Graphics3DTextSymbolLayer"),!1}layerElevationInfoChanged(e,r){return Zle(e,r,(i,n)=>{this.updateGraphicElevationContext(n,i)}),an.UPDATE}slicePlaneEnabledChanged(e,r){return Zle(e,r,i=>{for(const n of i.stageObject.geometries)n.material.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return!1}updateGraphicElevationContext(e,r){const i=r.elevationContext;this.setGraphicElevationContext(e,i,r.metadata!=null?r.metadata.elevationOffset:0),r.needsElevationUpdates=Bh(i.mode)||i.mode==="absolute-height"}_defaultElevationInfoNoZ(){return fpt}_createAs3DShape(e,r,i,n,s,o){var P;const a=this.setGraphicElevationContext(e,new wp,n.elevationOffset),l=((P=e.geometry)==null?void 0:P.type)==="polyline",c=e.uid;let u=null,d=null;if(o==null){const F=Y3e(n.horizontalPlacement);u=new cpt(i,F,this._textRenderParameters);let k=null;if(this._context.sharedResources.textures!=null){d=this._context.sharedResources.textures.fromData(u.key,()=>u.create(),()=>{k!=null&&k.release()});const V=this._context.stage.renderView.textureRepository.acquire(d.texture.id);if(V==null||Eu(V))return d.release(),null;k=V}}const p=ppt(u,n),m={occlusionTest:!0,screenOffset:n.screenOffset,anchorPosition:p,polygonOffset:!0,color:[1,1,1,1],centerOffsetUnits:n.centerOffsetUnits,drawInSecondSlot:!0};if(o!=null?m.textureId=o.id:d!=null&&(m.textureId=d.texture.id),n.verticalOffset!=null){const{screenLength:F,minWorldLength:k,maxWorldLength:V}=n.verticalOffset;m.verticalOffset={screenLength:ha(F),minWorldLength:k||0,maxWorldLength:V??1/0}}if(this._context.screenSizePerspectiveEnabled){const{screenSizePerspectiveSettings:F,screenSizePerspectiveSettingsLabels:k}=this._context.sharedResources;m.screenSizePerspective=k.overridePadding(this._textRenderParameters.haloSize+this._textRenderParameters.definition.background.padding[0]),m.screenSizePerspectiveAlignment=F}let y;if(l&&(m.shaderPolygonOffset=1e-4),m.hasSlicePlane=this._context.slicePlaneEnabled,s!=null){const F=JSON.stringify(m);y=s.get(F),y==null&&(y=new YS(m),s.add(F,y))}else y=new YS(m);const _=n.translation,v=u?or(u.displayWidth,u.displayHeight):dp,b=n.centerOffset,x=aH(y,hpt,_,null,v,b,[0,0],null),T=_J(this._context,r,x,a,c);if(T==null)return null;const S=new um(this,T.object,[x],s==null?[y]:null,d,Lb,a);S.alignedSampledElevation=T.sampledElevation,S.needsElevationUpdates=Bh(a.mode)||a.mode==="absolute-height";const{displayWidth:A,displayHeight:C}=u??n;S.getScreenSize=(F=Ne())=>(F[0]=A,F[1]=C,F);const R=new $Ee(n.elevationOffset,i);return S.metadata=R,LR(S,r,this._context.elevationProvider),S}};function Zle(t,e,r){t&&t.forEach(i=>{const n=e(i);n!=null&&r(n,i.graphic)})}function ppt(t,e){if(e.verticalPlacement==="baseline"){const i=zlt[e.horizontalPlacement],n=t!=null?t.baselineAnchorY:0;return or(i,n)}const r=Vlt(e.horizontalPlacement,e.verticalPlacement);return QD[r]}const fpt={mode:"relative-to-ground",offset:0},mpt={"calm-small":{waveStrength:.005,perturbationStrength:.02,textureRepeat:12,waveVelocity:.01},"rippled-small":{waveStrength:.02,perturbationStrength:.09,textureRepeat:32,waveVelocity:.07},"slight-small":{waveStrength:.05,perturbationStrength:.07,textureRepeat:28,waveVelocity:.1},"moderate-small":{waveStrength:.075,perturbationStrength:.07,textureRepeat:24,waveVelocity:.1},"calm-medium":{waveStrength:.003125,perturbationStrength:.01,textureRepeat:8,waveVelocity:.02},"rippled-medium":{waveStrength:.035,perturbationStrength:.015,textureRepeat:12,waveVelocity:.07},"slight-medium":{waveStrength:.06,perturbationStrength:.015,textureRepeat:8,waveVelocity:.12},"moderate-medium":{waveStrength:.09,perturbationStrength:.03,textureRepeat:4,waveVelocity:.12},"calm-large":{waveStrength:.01,perturbationStrength:0,textureRepeat:4,waveVelocity:.05},"rippled-large":{waveStrength:.025,perturbationStrength:.01,textureRepeat:8,waveVelocity:.11},"slight-large":{waveStrength:.06,perturbationStrength:.02,textureRepeat:3,waveVelocity:.13},"moderate-large":{waveStrength:.14,perturbationStrength:.03,textureRepeat:2,waveVelocity:.15}},gpt=["polyline","polygon","extent"];let dW=class Lv extends hm{constructor(e,r,i,n){super(e,r,i,n)}async doLoad(){}destroy(){super.destroy(),this._context.stage.remove(this._material),this._material=null}createGraphics3DGraphic(e){const r=e.graphic;if(!this._validateGeometry(r.geometry,gpt,this.symbolLayer.type))return null;const i=this.setGraphicElevationContext(r,new wp);return this.ensureDrapedStatus(i.mode==="on-the-ground"),this.ensureMaterial(),this.draped?this._createAsOverlay(r):this._createAs3DShape(r,i,r.uid)}ensureMaterial(){if(this._material!=null)return;const e=new e3e,r=this.symbolLayer.color;r!=null&&(e.color=it.toUnitRGBA(r));const i=this._getCombinedOpacity(r,{hasIntrinsicColor:!0});e.color=[e.color[0],e.color[1],e.color[2],i],e.transparent=i<1||this.needsDrivenTransparentPass,e.waveDirection=this.symbolLayer.waveDirection!=null?Lv.headingVectorFromAngle(this.symbolLayer.waveDirection):or(0,0);const n=this.symbolLayer.waveStrength+"-"+this.symbolLayer.waterbodySize,s=mpt[n];e.waveStrength=s.waveStrength,e.waveTextureRepeat=s.textureRepeat,e.waveVelocity=s.waveVelocity,e.flowStrength=s.perturbationStrength,e.hasSlicePlane=this._context.slicePlaneEnabled,e.isDraped=this.draped,this._material=new KCe(e),this._context.stage.add(this._material)}layerOpacityChanged(){if(this._material==null)return;const e=this._material.parameters.color,r=this._getCombinedOpacity(this.symbolLayer.color,{hasIntrinsicColor:!0}),i=r<1||this.needsDrivenTransparentPass;this._material.setParameters({color:[e[0],e[1],e[2],r],transparent:i})}layerElevationInfoChanged(e,r,i){const n=this._elevationContext.mode,s=WP(Lv.elevationModeChangeTypes,i,n);if(s!==an.UPDATE)return s;const o=Bh(n);return this.updateGraphics3DGraphicElevationInfo(e,r,()=>o)}slicePlaneEnabledChanged(){return this._material!=null&&this._material.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,r,i){var d;const n=FR(e.geometry);if(n==null)return null;const s=VJ(n,this._context.elevationProvider,this._context.renderCoordsHelper,r),o=s.position.length/3,a=Ys(2*o);this._createUVCoordsFromVertices(a,s.mapPositions,o,this._context.elevationProvider.spatialReference);const l=new ypt(s,a,this._context.layer.uid,e.uid);if(l.objectAndLayerIdColor=(d=this._context.stage.renderView)==null?void 0:d.getObjectAndLayerIdColor(l),this._create3DShapeGeometries(l),this._logGeometryCreationWarnings(l.renderData,n.rings,"rings","WaterSymbol3DLayer"),l.outGeometries.length===0)return null;const c=new h0({geometries:l.outGeometries,castShadow:!1,layerUid:this._context.layer.uid,graphicUid:i}),u=new um(this,c,l.outGeometries,null,null,EEe,r);return u.alignedSampledElevation=l.renderData.sampledElevation,u.needsElevationUpdates=Bh(r.mode),u}_createUVCoordsFromVertices(e,r,i,n){const s=el(n);Ih(z0);for(let l=0;lthis._createAs3DShape(e.graphic,e.elevationContext,e.graphicUid),ensureMaterial:()=>this.ensureMaterial()}}};dW.unitSizeOfTexture=100,dW.elevationModeChangeTypes={definedChanged:an.RECREATE,staysOnTheGround:an.NONE,onTheGroundChanged:an.RECREATE};const LI=Ne(),z0=jt(),Qle=Ne(),Z1=ps();let ypt=class extends N8{constructor(e,r,i,n){super(e,i,n),this.uvCoords=r}},_pt=class extends N8{constructor(e,r,i,n){super(e,i,n),this.uvCoords=r}};function vpt(t,e,r,i){var s;const n=((s=wpt[t.type])==null?void 0:s[e.type])||bpt[e.type];return n?new n(t,e,r,i):(J.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayerFactory").error("GraphicsLayerFactory#make",`unknown symbol type ${e.type}`),null)}const bpt={icon:sW,object:Sht,line:rAe,path:Cdt,fill:iOe,extrude:fat,text:dpt,water:dW},wpt={"mesh-3d":{fill:Hct}};let xpt=class extends mJ{set symbol(e){this._symbol=e,e.symbolLayers.forEach((r,i)=>{const n=this.symbolLayers[i];n!=null&&(n.symbol=e,n.symbolLayer=r)})}get symbol(){return this._symbol}constructor(e,r,i){super(r.schedule),this._symbol=e,this._context=r,this._backgroundLayers=i,this._destroyed=!1,this.symbolLayers=new Array,this.referenced=0,this._extentPadding=0}async doLoad(e){let r=this._symbol.symbolLayers;this._extentPadding=0,this._backgroundLayers&&(r=this._backgroundLayers.concat(r));const i=r.length;for(;this.symbolLayers.length{this.symbolLayers[s]=null,a.destroy()});l&&n.push(l),this.symbolLayers[s]=a}if(await r6(this.symbolLayers,async(s,o)=>{if(s!=null)try{await s.load(),this._extentPadding+=Math.max(this._extentPadding,s.extentPadding)}catch{this.symbolLayers[o]=null}}),n.forEach(s=>s.remove()),Bt(e),this.symbolLayers.length&&!this.symbolLayers.some(s=>!!s))throw new Error}getSymbolLayerSize(e){const r=this.symbolLayers[e];return r!=null?r.getCachedSize():null}get extentPadding(){return this._extentPadding}get symbologySnappingSupported(){return this.symbolLayers.some(e=>e!=null&&e.queryForSnapping)}createGraphics3DGraphic(e,r){const i=e.graphic,n=this.symbolLayers.map(o=>(o==null?void 0:o.createGraphics3DGraphic(e))??null),s=this._context.arcade||this._context.featureExpressionInfoContext&&this._context.featureExpressionInfoContext.arcade&&this._context.featureExpressionInfoContext.arcade.modules||null;return new _nt(i,r||this,n,e.layer,s)}get complexity(){return yJ(this.symbolLayers.map(e=>e!=null?e.complexity:null))}globalPropertyChanged(e,r){const i=this.symbolLayers.length;for(let n=0;n{const l=a.layers[n];return l instanceof um?l:null};if(s!=null&&!s.globalPropertyChanged(e,r,o))return!1}return!0}applyRendererDiff(e,r){return this.loadStatus!==eu.LOADED?$n.RecreateSymbol:this.symbolLayers.reduce((i,n)=>i!==$n.RecreateSymbol&&n!=null?Math.min(i,n.applyRendererDiff(e,r)):i,$n.FastUpdate)}prepareSymbolPatch(e){if(this.loadStatus===eu.FAILED||e.diff.type!=="partial")return;const r=e.diff.diff;if(!r.symbolLayers||r.symbolLayers.type!=="partial")return;const i=r.symbolLayers.diff;this.symbolLayers.forEach((n,s)=>{if(n==null)return;const o=i[s];if(o){const a={diff:o,graphics3DGraphicPatches:[],symbolLayerStatePatches:[]};n.prepareSymbolLayerPatch(a),e.symbolStatePatches.push(...a.symbolLayerStatePatches),a.graphics3DGraphicPatches.length&&e.graphics3DGraphicPatches.push((l,c)=>{const u=l.layers[s];u!=null&&a.graphics3DGraphicPatches.forEach(d=>d(u,c))})}})}updateGeometry(e,r){return this._updateGeometryOrTransform(e,(i,n)=>i.updateGeometry(n,r))}updateTransform(e,r,i,n){return this._updateGeometryOrTransform(e,(s,o)=>s.updateTransform(o,r,i,n))}_updateGeometryOrTransform(e,r){for(let i=0;i{n!=null&&(n.loadStatus===eu.LOADING?e++:n.isFastUpdatesEnabled()?i++:r++)}),{loading:e,slow:r,fast:i}}async queryForSnapping(e,r,i,n){const s=this.symbolLayers.filter(aP).filter(a=>a.queryForSnapping!=null).map(a=>a.queryForSnapping(e,r,i,n)),o=await Promise.all(s);return Bt(n),o.flat()}destroy(){if(this.destroyed)console.error("Graphics3DSymbol.destroy called when already destroyed!");else{super.destroy();for(const e of this.symbolLayers)e!=null&&e.destroy();this.symbolLayers.length=0,this._destroyed=!0}}get destroyed(){return this._destroyed}};const DI=new vnt;let Tpt=class extends mJ{constructor(e,r,i){super(r),this.symbol=e,this._convert=i,this.symbologySnappingSupported=!1,this.graphics3DSymbol=null,this.referenced=0}getSymbolLayerSize(e){return this.graphics3DSymbol!=null?this.graphics3DSymbol.getSymbolLayerSize(e):null}get symbolLayers(){return this.graphics3DSymbol!=null?this.graphics3DSymbol.symbolLayers:[]}get extentPadding(){return this.graphics3DSymbol!=null?this.graphics3DSymbol.extentPadding:0}async doLoad(e){const r=await this.symbol.fetchSymbol({signal:e});r.id=this.symbol.id,this.graphics3DSymbol=this._convert(r),this.graphics3DSymbol!=null&&await this.graphics3DSymbol.load()}createGraphics3DGraphic(e){return this.graphics3DSymbol!=null?this.graphics3DSymbol.createGraphics3DGraphic(e,this):null}get complexity(){return this.graphics3DSymbol!=null?this.graphics3DSymbol.complexity:gJ}globalPropertyChanged(e,r){return this.graphics3DSymbol!=null&&this.graphics3DSymbol.globalPropertyChanged(e,r)}applyRendererDiff(e,r){return this.graphics3DSymbol!=null?this.graphics3DSymbol.applyRendererDiff(e,r):$n.RecreateSymbol}prepareSymbolPatch(e){this.graphics3DSymbol!=null&&this.graphics3DSymbol.prepareSymbolPatch(e)}updateGeometry(e,r){return this.graphics3DSymbol!=null&&this.graphics3DSymbol.updateGeometry(e,r)}updateTransform(e,r,i,n){var s;return((s=this.graphics3DSymbol)==null?void 0:s.updateTransform(e,r,i,n))??!1}onRemoveGraphic(){}getFastUpdateStatus(){return this.graphics3DSymbol!=null?this.graphics3DSymbol.getFastUpdateStatus():{loading:1,fast:0,slow:0}}destroy(){this.graphics3DSymbol!=null&&this.graphics3DSymbol.destroy(),this.graphics3DSymbol=void 0,super.destroy()}get destroyed(){return this.graphics3DSymbol===void 0}};function sK(t){return t instanceof Tpt?t.graphics3DSymbol:t instanceof xpt?t:null}const BR=J.getLogger("esri.views.3d.layers.graphics.labelPlacement");function Spt(t){const e=Ipt(t);if(e==null)return null;const r=Ept(t,e);if(r==null)return null;const i=r.anchor,n=!!e.hasLabelVerticalOffset;return Apt({anchor:i,verticalOffset:e.verticalOffset,screenOffset:Ne(),centerOffset:$t(0,0,0,-1),centerOffsetUnits:"world",translation:O(),elevationOffset:0,hasLabelVerticalOffset:n},r,t)}function Ept(t,e){if(e.anchor)return e;const r=t.labelClass.labelPlacement,i=Yd[r],n=i||Y5(t);return r&&!i&&BR.warnOncePerTick(`the requested label placement '${r}' is currently unsupported in SceneView.`),Cpt(n,t)}function oK(t){const e=t.graphics3DGraphic.graphics3DSymbol,r=sK(e);return r!=null?r.symbol.symbolLayers.at(0):null}function Cpt(t,e){const r=e.graphics3DGraphic.graphic.geometry;if(r==null)return null;if(e.disablePlacement!=null)return e.labelClass.labelPlacement?(BR.warnOncePerTick(Jle(t==null?void 0:t.placement,e.disablePlacement.logEntityDescription)),Y5(e)):t;const i=r.type;switch(i){case"polyline":case"polygon":case"extent":case"multipoint":if(e.labelClass.labelPlacement)return BR.warnOncePerTick(Jle(t==null?void 0:t.placement,`'${i}' geometries`)),Y5(e);break;case"point":case"mesh":return t}return t}function Jle(t,e){return`the requested label placement '${t}' is currently unsupported for ${e} in SceneView.`}function Y5(t){const e=t.graphics3DGraphic.graphic.geometry;if(e==null)return null;switch(e.type){case"polyline":case"extent":case"multipoint":return{placement:"center-center",normalizedOffset:null,anchor:"center"};case"polygon":{const r=oK(t);return r!=null&&r.type==="extrude"?Yd["above-center"]:{placement:"center-center",normalizedOffset:null,anchor:"center"}}case"point":case"mesh":return Yd["above-center"];default:return}}function Apt(t,e,r){const i=r.graphics3DGraphic.graphic.geometry;if(i==null)return null;switch(i.type){case"point":Rpt(t,e,r);break;case"polygon":Opt(t,e,r);break;case"mesh":aK(t,e,r.graphics3DGraphic.layers[0])}return t}function Opt(t,e,r){const i=oK(r);if(i!=null)switch(i.type){case"extrude":{const n=r.graphics3DGraphic.layers[0];n!=null?(n.getBoundingBoxObjectSpace(xO),jd(xO,t.translation),t.translation[2]=c1(xO)/2):ne(t.translation,0,0,0),aK(t,e,n);break}}}function Rpt(t,e,r){const i=oK(r);if(i==null)return;const n=r.graphics3DGraphic.layers[0];switch(n!=null?n.getCenterObjectSpace(t.translation):ne(t.translation,0,0,0),i.type){case"icon":case"text":Ppt(t,e,r,n);break;case"object":aK(t,e,n)}}function Ppt(t,e,r,i){const{graphics3DGraphic:n}=r,s=i!=null?i.getScreenSize():null;if(n.isDraped||s==null)t.hasLabelVerticalOffset||t.anchor==="center"||(Yd[r.labelClass.labelPlacement]&&BR.warnOncePerTick(`the requested placement '${e.placement}' is currently unsupported for draped graphics`),t.anchor="center");else{const o=Mpt(r);t.screenOffset[0]=s[0]/2*(e.normalizedOffset[0]-o[0]);const a=s[1]/2*(e.normalizedOffset[1]-o[1]);t.hasLabelVerticalOffset?(t.centerOffset[1]=a,t.centerOffsetUnits="screen"):t.screenOffset[1]=a}}function Mpt(t,e=Lpt){const{graphics3DGraphic:r}=t,i=r.layers[0],n=i!=null?i.stageObject.geometries[0].material:null;if(n&&n instanceof YS){const s=n.parameters.anchorPosition;e[0]=2*(s[0]-.5),e[1]=2*(s[1]-.5)}else e[0]=0,e[1]=0;return e}function aK(t,e,r){const i=r!=null?r.getBoundingBoxObjectSpace(xO):xO,n=Se(i[3]-i[0],i[4]-i[1],i[5]-i[2]),s=Math.sqrt(n[0]*n[0]+n[1]*n[1]);t.centerOffset[0]=s/2*e.normalizedOffset[0];const o=t.translation[2],a=n[2]/2*e.normalizedOffset[1];t.translation[2]=0,t.elevationOffset=o+a;const l=Te(n);t.centerOffset[2]=l/2*e.normalizedOffset[2]}function $pt(t){return t==="above-center"}function Ipt(t){const e=t.labelClass.labelPlacement,{labelSymbol:r,graphics3DGraphic:i}=t,n=sK(i.graphics3DSymbol),s=_h(n,a=>a.symbol.type==="point-3d"?a.symbol:null),o=Yd[e]||Y5(t);return s!=null&&s.supportsCallout()&&s.hasVisibleVerticalOffset()&&!i.isDraped?{placement:null,hasLabelVerticalOffset:!1,verticalOffset:Kle(s.verticalOffset),anchor:null,normalizedOffset:null}:!r||!r.hasVisibleVerticalOffset()||s!=null&&s.supportsCallout()&&s.verticalOffset&&!i.isDraped?{placement:null,verticalOffset:null,anchor:null,normalizedOffset:null,hasLabelVerticalOffset:!1}:o&&$pt(o.placement)?{placement:"above-center",verticalOffset:Kle(r.verticalOffset),anchor:"bottom",normalizedOffset:[0,o.normalizedOffset[1],0],hasLabelVerticalOffset:!0}:(BR.errorOncePerTick("Callouts and vertical offset on labels are currently only supported with 'above-center' label placement (not with "+e+" placement)"),null)}function Kle(t){const{screenLength:e,minWorldLength:r,maxWorldLength:i}=t;return{screenLength:e,minWorldLength:r,maxWorldLength:i}}const Yd={"above-center":{placement:"above-center",normalizedOffset:[0,1,0],anchor:"bottom"},"above-left":{placement:"above-left",normalizedOffset:[-1,1,0],anchor:"bottom-right"},"above-right":{placement:"above-right",normalizedOffset:[1,1,0],anchor:"bottom-left"},"below-center":{placement:"below-center",normalizedOffset:[0,-1,2],anchor:"top"},"below-left":{placement:"below-left",normalizedOffset:[-1,-1,0],anchor:"top-right"},"below-right":{placement:"below-right",normalizedOffset:[1,-1,0],anchor:"top-left"},"center-center":{placement:"center-center",normalizedOffset:[0,0,1],anchor:"center"},"center-left":{placement:"center-left",normalizedOffset:[-1,0,0],anchor:"right"},"center-right":{placement:"center-right",normalizedOffset:[1,0,0],anchor:"left"}},ece={"above-center":["default","esriServerPointLabelPlacementAboveCenter"],"above-left":["esriServerPointLabelPlacementAboveLeft"],"above-right":["esriServerPointLabelPlacementAboveRight"],"below-center":["esriServerPointLabelPlacementBelowCenter"],"below-left":["esriServerPointLabelPlacementBelowLeft"],"below-right":["esriServerPointLabelPlacementBelowRight"],"center-center":["esriServerPointLabelPlacementCenterCenter"],"center-left":["esriServerPointLabelPlacementCenterLeft"],"center-right":["esriServerPointLabelPlacementCenterRight"]};for(const t in ece){const e=ece[t],r=Yd[t];e.forEach(i=>{Yd[i]=r})}Object.freeze&&(Object.freeze(Yd),Object.keys(Yd).forEach(t=>{var e;Object.freeze(Yd[t]),Object.freeze((e=Yd[t])==null?void 0:e.normalizedOffset)}));const Lpt=[0,0],xO=ps();let tce=class{constructor(e){this._stage=e,this._materials=new Map}get(e){return this._materials.get(e)}add(e,r){this._materials.set(e,r),this._stage.add(r)}dispose(){this._stage.removeMany(Array.from(this._materials.values())),this._materials.clear()}};const NI=4096;let Dpt=class{constructor(){this.offset={x:0,y:0},this.uvMinMax=Qt()}},Npt=class{constructor(e,r){this.textId=e,this.textRenderer=r,this.placement=new Dpt,this.rendered=!1}},Fpt=class{constructor(e,r,i){this.size=e,this.cursor=r,this.lineHeight=i}resize(e){this.size.height=e}resetCursor(){this.cursor.x=TO,this.cursor.y=TO+lOe,this.lineHeight=0}getUsage(){return(this.cursor.x+this.cursor.y*this.size.width)/(this.size.width*this.size.height)}},aA=class extends xe{constructor(e){super(e),this.type=on.Texture,this.id=wc(),this.events=new Bn,this._glTexture=null,this._needsClear=!1,this._elementsToAddOrUpdate=new Map,this._elementsToRemove=new Map,this._elementsToRender=new Map,this._elements=new Map,this._stageObjects=new Map,this.updating=!1}initialize(){this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id","textAtlasCanvas"),this._canvas.setAttribute("style","display:none"),this._ctx=this._canvas.getContext("2d"),this._stage=this.view._stage,this._stage.add(this),this._atlas=new Fpt({width:NI,height:256},{x:0,y:0},0),this._updateCanvasElementSize(this._atlas),this._resetAtlasCursor()}unload(){this._glTexture=Le(this._glTexture),this.updating=!1,this.events.emit("unloaded")}get requiresFrameUpdates(){return!1}_createDescriptor(e){const r=new pr;return r.wrapMode=Pt.CLAMP_TO_EDGE,r.flipped=!0,r.samplingMode=At.LINEAR_MIPMAP_LINEAR,r.hasMipmap=!0,r.preMultiplyAlpha=!0,r.maxAnisotropy=e.parameters.maxMaxAnisotropy,r}get glTexture(){return this._glTexture}load(e){return this._glTexture!=null||(this._glTexture=new Ct(e,this._createDescriptor(e),this._canvas),this._frameWorker=this.view.resourceController.scheduler.registerTask(dt.TEXT_TEXTURE_ATLAS,this),this.setDirty()),this._glTexture}dispose(){this._elements=null,this._elementsToAddOrUpdate=null,this._elementsToRemove=null,this._elementsToRender=null,this._frameWorker=Pi(this._frameWorker),this._glTexture&&(this._stage.remove(this),this._glTexture=Le(this._glTexture)),this._canvas.width=0,this._canvas.height=0,this._canvas=null,this._ctx=null}_updateCanvasElementSize(e){this._canvas.setAttribute("width",e.size.width.toString()),this._canvas.setAttribute("height",e.size.height.toString())}_resizeAtlas(e){this._atlas.resize(e),this._glTexture!=null&&this._glTexture.resize(this._atlas.size.width,e),this._updateCanvasElementSize(this._atlas)}_resetAtlasCursor(){this._atlas.resetCursor(),this._needsClear=!0}_addAtlasElement(e,r,i,n){const s=this._atlas,{renderedWidth:o,renderedHeight:a}=e.textRenderer;e.placement.offset.x=s.cursor.x,e.placement.offset.y=s.cursor.y,gi(e.placement.uvMinMax,e.placement.offset.x/s.size.width,1-(e.placement.offset.y+a)/s.size.height,(e.placement.offset.x+o)/s.size.width,1-e.placement.offset.y/s.size.height),s.cursor.x+=i,s.lineHeight=Math.max(s.lineHeight,n),this._elements.set(r,e)}_removeAtlasElement(e){if(e&&this._elements.has(e.textId)){const r=e.placement.offset;this._ctx.clearRect(r.x,r.y,e.textRenderer.renderedWidth,e.textRenderer.renderedHeight),this._elements.delete(e.textId)}}_ensureStageObjects(e){const r=this._stageObjects.get(e);if(r)return r;const i=new Set;return this._stageObjects.set(e,i),i}_addStageObject(e,r){this._ensureStageObjects(e).add(r)}_removeStageObject(e,r){const i=this._stageObjects.get(e);i&&i.delete(r)&&(r.geometries[0].setAttributeData(E.SIZE,[0,0]),r.geometryVertexAttrsUpdated(r.geometries[0]))}_processAddition(e,r){const i=this._atlas,n=e.textId,s=e.textRenderer.renderedWidth,o=e.textRenderer.renderedHeight,a=s+TO,l=o+TO+lOe;if(i.cursor.x+a{const i=this._stageObjects.get(r);i&&i.size!==0||this._removeAtlasElement(e),i&&i.size===0&&this._stageObjects.delete(r)}),this._elementsToRemove.clear()}_repack(){this._processRemovals(),this._elements.forEach((e,r)=>{e.rendered=!1,this._elementsToAddOrUpdate.set(r,e)}),this._elements.clear(),this._resetAtlasCursor(),this._elementsToRender.clear()}_processRenderingRequest(e){this._ctx.clearRect(e.placement.offset.x,e.placement.offset.y,e.textRenderer.renderedWidth,e.textRenderer.renderedHeight),e.textRenderer.render(this._ctx,e.placement.offset.x,e.placement.offset.y);const r=this._stageObjects.get(e.textId);r&&r.forEach(i=>{i.geometries[0].setAttributeData(E.UV0,e.placement.uvMinMax),i.geometries[0].setAttributeData(E.SIZE,[e.textRenderer.displayWidth,e.textRenderer.displayHeight]),i.geometryVertexAttrsUpdated(i.geometries[0])}),e.rendered=!0}get running(){return this.updating}runTask(e,r=!0){if(this._glTexture==null)return Ho.YIELD;let i=!1;if(Do(this._elementsToAddOrUpdate,(s,o)=>{const a=this._elements.get(o);if(a!=null&&a.rendered){const l=this._stageObjects.get(o);return l&&l.forEach(c=>{const u=c.geometries[0],d=this._elements.get(o);u.setAttributeData(E.UV0,d.placement.uvMinMax),u.setAttributeData(E.SIZE,[d.textRenderer.displayWidth,d.textRenderer.displayHeight]),c.geometryVertexAttrsUpdated(c.geometries[0])}),this._elementsToAddOrUpdate.delete(o),e.madeProgress(),!1}return this._processAddition(this._elementsToAddOrUpdate.get(o),r)===_T.REPACK&&(i=!0,!0)}),i)return this.runTask(Wa,!1),void e.madeProgress();let n=!1;this._elementsToRender.size>0&&this._needsClear&&(this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._needsClear=!1),Do(this._elementsToRender,(s,o)=>(this._processRenderingRequest(s),this._elementsToRender.delete(o),n=!0,e.madeProgress(),e.done)),n&&this._glTexture.setData(this._canvas),this.updating=this._elementsToRender.size>0,!this.updating&&Knt.orderedRepackingEnabled&&(this.repackOrdered(),e.madeProgress())}addTextTexture(e,r){const i=e.key;this._elementsToAddOrUpdate.has(i)||this._elementsToAddOrUpdate.set(i,new Npt(i,e)),this._addStageObject(i,r),this._elementsToRemove.delete(i),this.setDirty()}removeTextTexture(e,r){const i=e.key;this._elementsToRemove.set(i,this._elements.get(i)),this._removeStageObject(i,r)}setDirty(){this._glTexture&&(this.updating=!0)}repackOrdered(){if(this._elements.size===0)return;const e=[];this._elements.forEach((i,n)=>e.push({element:i,key:n}));let r=!0;for(let i=0;i0){r=!1;break}if(!r||this._elementsToRemove.size){e.sort((i,n)=>i.key.localeCompare(n.key)),this._elements.clear();for(const{element:i,key:n}of e)this._elements.set(n,i);this._repack(),this.setDirty()}}get test(){const{_elements:e,_stageObjects:r,_elementsToRemove:i,_atlas:n}=this,s=this;return{elements:e,stageObjects:r,elementsToRemove:i,atlas:n,resizeAtlas:o=>s._resizeAtlas(o),run:(o,a)=>s.runTask(o,a)}}};h([f({constructOnly:!0})],aA.prototype,"view",void 0),h([f({type:Boolean})],aA.prototype,"updating",void 0),aA=h([N("esri.views.3d.webgl-engine.lib.TextTextureAtlas")],aA);const TO=2,lOe=2;var _T;(function(t){t[t.OK=0]="OK",t[t.REPACK=1]="REPACK"})(_T||(_T={}));let rce=class{constructor(e,r){this.labelingContext=e,this.graphics3DGraphic=r,this.hasGraphics3DResources=!1,this.visible=!1,this.rendered=!1,this.textInitialized=!1,this.textRenderers=new Array,this.textLabelPlacements=new Array}},Upt=class{constructor(e,r,i,n,s){this.labelClass=e,this.graphics3DSymbol=r,this.graphics3DCalloutSymbolLayer=i,this.textRenderParameters=n,this.labelFunction=s,this.calloutSymbolLayerIndex=0}},kpt=class{constructor(e,r,i,n,s,o,a,l){this.layer=r,this.graphics3DCore=i,this.scaleVisibility=n,this.emptySymbolLabelSupported=s,this.elevationInfoOverride=o,this.disablePlacement=a,this.active=l,this.labelClassAbortController=new AbortController,this.labelClassContexts=new Array,this.graphics=new Map,this.labelsToInitialize=new Map,this.stageLayer=new CCe(e,{pickable:!0,disableOctree:!0},r.uid)}destroy(){this.stageLayer.destroy()}},Dv=class extends xe{constructor(e){super(e),this._dirty=!1,this._labels=new Map,this._labelsToAdd=new Map,this._labelsToRemove=new Map,this._labelingContexts=new Array}setup(){this.dispose(),this._handles=new Vi,this._handles.add([ue(()=>{var e;return(e=this.view.state)==null?void 0:e.camera},()=>this.setDirty()),ue(()=>{var e;return(e=this.view.state)==null?void 0:e.rasterPixelRatio},()=>this._resetAllLabels()),this.view.resourceController.scheduler.registerTask(dt.LABELER,this)]),this._textTextureAtlas=new aA({view:this.view}),this._hudMaterialCollection=new tce(this.view._stage),this._calloutMaterialCollection=new tce(this.view._stage)}dispose(){this._handles=Me(this._handles),this._textTextureAtlas=Le(this._textTextureAtlas),this._hudMaterialCollection=Le(this._hudMaterialCollection),this._calloutMaterialCollection=Le(this._calloutMaterialCollection),this._labelingContexts.length=0,this._labels.clear(),this._labelsToAdd.clear(),this._labelsToRemove.clear()}destroy(){this.dispose(),sd.graphic=null,sd.renderingInfo=null,sd.layer=null}_activateLabelingContext(e){e.graphics.forEach((r,i)=>{const n=new rce(e,r);this._labels.set(i,n),e.labelsToInitialize.set(i,n),r.setVisibilityFlag(js.LABEL,Uo.USER,!0)}),e.active=!0}_deactivateLabelingContext(e){e.graphics.forEach((r,i)=>{r.setVisibilityFlag(js.LABEL,Uo.USER,!1),this.setLabelGraphicVisibility(r,!1),this._labels.delete(i)}),e.active=!1}_addLabelTextureToAtlas(e){for(const r of e.graphics3DGraphic.labelLayers){if(!r._labelClass)continue;const i=e.textRenderers[r._labelIndex];i&&this._textTextureAtlas.addTextTexture(i,r.stageObject)}e.rendered=!0}_removeLabelTextureFromAtlas(e){for(const r of e.graphics3DGraphic.labelLayers){if(!r._labelClass)continue;const i=e.textRenderers[r._labelIndex];i!=null&&this._textTextureAtlas.removeTextTexture(i,r.stageObject)}e.rendered=!1}get running(){return this.view.ready&&(this._dirty||this.deconflictor.running)}runTask(e){return this._updateLabels(e),!this._dirty&&this.deconflictor.running&&this.deconflictor.runTask(e),Ho.YIELD}_updateLabels(e){if(this._dirty){this._dirty=!1;for(const r of this._labelingContexts)if(r.active){if(!ice(r)){if(zpt(r)){this._deactivateLabelingContext(r);continue}if(this._createLabelClassContext(r),Az(r)){this._dirty=!0;continue}if(!ice(r))continue}Do(r.labelsToInitialize,(i,n)=>(this._ensureGraphics3DResources(i)&&(this._labels.set(n,i),this.deconflictor.setDirty(),e.madeProgress()),(i.visible&&i.textInitialized||!i.visible&&i.hasGraphics3DResources)&&(r.labelsToInitialize.delete(n),e.madeProgress()),e.done))&&(this._dirty=!0)}this._labelsToRemove.forEach(r=>this._removeLabelTextureFromAtlas(r)),this._labelsToAdd.forEach(r=>this._addLabelTextureToAtlas(r)),this._labelsToRemove.clear(),this._labelsToAdd.clear(),this._dirty||this.notifyChange("updating")}}async _createLabelClassContextAsync(e){var o,a,l;const r=(o=e.labelClassAbortController)==null?void 0:o.signal;await((l=(a=e.layer).when)==null?void 0:l.call(a)),Bt(r),e.scaleVisibility&&e.scaleVisibility.updateScaleRangeActive();const i=e.graphics3DCore,n=i.layer,s=n.labelingInfo&&n.labelingInfo.filter(c=>!!c.symbol);!s||s.length===0||(await r6(s,async(c,u)=>{const d=c.symbol,p=sK(i.getOrCreateGraphics3DSymbol(d));if(p==null)return void J.getLogger(this).error("Failed to create Graphics3DSymbol for label");await p.load(),Bt(r);let m=null;iZ(d)&&d.hasVisibleCallout()&&(m=qit(d,i.symbolCreationContext),await m.load(),Bt(r));const y=await Ng(bEe(c,e.layer.fieldsIndex,this.view.spatialReference));if(Bt(r),y.ok===!0){const _=await this._createTextRenderParameters(p.symbol);Bt(r),e.labelClassContexts[u]=new Upt(c,p,m,_,y.value)}else J.getLogger(this).error(`Label expression failed to evaluate: ${y.error}`)}),Bt(r))}async _createLabelClassContext(e){return e.labelClassPromise==null&&(e.labelClassPromise=this._createLabelClassContextAsync(e).catch(r=>{if(Zn(r))throw r;e.labelClassContexts.length=0}).then(()=>{e.labelClassAbortController=null,this.notifyChange("updating")}).catch(()=>{}),this.notifyChange("updating")),e.labelClassPromise}async _createTextRenderParameters(e){const r=e.symbolLayers.at(0);return(r==null?void 0:r.type)!=="text"?null:oOe.fromSymbol(r,this.view.state.rasterPixelRatio)}_destroyLabelClassContext(e){for(const i of e.labelClassContexts)--i.graphics3DSymbol.referenced;const r=e.labelClassAbortController;e.labelClassAbortController=new AbortController,yu(r),e.labelClassContexts.length=0,e.labelClassPromise=null,this.notifyChange("updating")}_createTextSymbolGraphic(e,r,i,n,s){const o=new xEe(i.verticalOffset,sle(i.anchor),Blt(i.anchor),e.text,i.translation,i.elevationOffset,i.centerOffset,i.screenOffset,i.centerOffsetUnits,e.displayWidth,e.displayHeight);return sd.graphic=r,sd.renderingInfo=null,sd.layer=n,s.createLabel(sd,o,this._hudMaterialCollection,this._textTextureAtlas)}_createLineCalloutGraphic(e,r,i,n,s){return sd.graphic=e,sd.layer=s,sd.renderingInfo=new Hit(null,r,n.translation,n.centerOffset,n.screenOffset,n.centerOffsetUnits,n.elevationOffset,this._calloutMaterialCollection),i.createGraphics3DGraphic(sd)}_ensureGraphics3DResources(e){var c;if(e.hasGraphics3DResources)return!1;const r=e.graphics3DGraphic;if(r.destroyed)return!1;this._ensureTextTextureResources(e);const i=e.labelingContext,n=i.labelClassContexts;if(!n||n.length===0||!i.emptySymbolLabelSupported&&r.layers.length===0)return!1;let s=!1;const o=r.graphic,a=i.layer,l=FI(i.layer);for(let u=0;un.set(o.graphic.uid,o));const s=o=>o.labelLayers[0];if(i.graphics3DSymbol.symbolLayers[0].globalPropertyChanged(e,n,s),i.graphics3DCalloutSymbolLayer){const o=a=>a.labelLayers[i.calloutSymbolLayerIndex];i.graphics3DCalloutSymbolLayer.globalPropertyChanged(e,n,o)}}}_visibilityInfoChange(e){const r=FI(e.layer);r&&!e.active&&this._activateLabelingContext(e),!r&&e.active&&this._deactivateLabelingContext(e),this.setDirty()}_resetAllLabels(){for(const e of this._labelingContexts)this._resetLabels(e)}_resetLabels(e){e.graphics.forEach((r,i)=>{const n=this._labels.get(i);n&&(this._destroyGraphic(n,i),n.visible=!1,n.rendered=!1,e.labelsToInitialize.set(i,n))}),this._destroyLabelClassContext(e),this.setDirty(),this.deconflictor.setDirty()}_findLabelingContext(e){for(const r of this._labelingContexts)if(r.graphics3DCore===e)return r;return null}addGraphicsOwner(e,r,i){const n=i&&i.emptySymbolLabelSupported||!1,s=i&&i.elevationInfoOverride||null,o=i&&i.disablePlacement||null;if(this._findLabelingContext(e))return;const a=e.layer,l=new kpt(this.view._stage,a,e,r,n,s,o,FI(a));return this._labelingContexts.push(l),this.setDirty(),{addGraphic:c=>this._addGraphic(l,c),removeGraphic:c=>this._removeGraphic(l,c),featureReductionChange:()=>{},layerLabelsEnabled:()=>FI(l.layer),labelingInfoChange:c=>this._labelingInfoChange(l,c),elevationInfoChange:()=>this._globalPropertyChanged("elevationInfo",l),slicePlaneEnabledChange:()=>this._globalPropertyChanged("slicePlaneEnabled",l),visibilityInfoChange:()=>this._visibilityInfoChange(l),reset:()=>this._resetLabels(l),clear:()=>{}}}removeGraphicsOwner(e){const r=this._findLabelingContext(e);if(!r)return;const i=this._labelingContexts.indexOf(r);this._labelingContexts.splice(i,1),r.graphics.forEach(n=>this._removeGraphic(r,n)),r.destroy(),this.setDirty()}setLabelGraphicVisibility(e,r){const i=e.graphic.uid,n=this._labels.get(i);n&&n.visible!==r&&(r&&!n.rendered?(this._labelsToAdd.set(i,n),this._labelsToRemove.delete(i),n.textInitialized||n.labelingContext.labelsToInitialize.set(i,n)):!r&&n.rendered&&(this._labelsToRemove.set(i,n),this._labelsToAdd.delete(i)),n.visible=r,this.setDirty())}setDirty(){!this._dirty&&this._labelingContexts.length>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){var e;return this._dirty||((e=this._textTextureAtlas)==null?void 0:e.updating)||this.deconflictor.updating||this._labelingContexts.some(r=>Az(r))}get updatingProgress(){if(!this.updating||!this._textTextureAtlas)return 1;const e=this._labelingContexts.length>0?this._labelingContexts.reduce((r,i)=>r+(Az(i)?0:1),0)/this._labelingContexts.length:1;return(this._dirty?0:.3)+(this._textTextureAtlas.updating?0:.1)+.1*e+.5*this.deconflictor.updatingProgress}get test(){return{textTextureAtlas:this._textTextureAtlas,resetAllLabels:()=>this._resetAllLabels()}}};function Az(t){return!!t.labelClassPromise&&!!t.labelClassAbortController}function ice(t){return t.labelClassContexts&&t.labelClassContexts.length}function zpt(t){return t.labelClassContexts===null}function FI(t){var e;return t.labelsVisible===!0&&!!((e=t.labelingInfo)!=null&&e.some(r=>!!r.symbol))}h([f({constructOnly:!0})],Dv.prototype,"view",void 0),h([f({constructOnly:!0})],Dv.prototype,"deconflictor",void 0),h([f()],Dv.prototype,"_textTextureAtlas",void 0),h([f({type:Boolean,readOnly:!0})],Dv.prototype,"updating",null),Dv=h([N("esri.views.3d.layers.graphics.Labeler")],Dv);const sd=new Wit(null,null,null);let lA=class $2{constructor(e,r,i,n=null){this.lij=[0,0,0],this.extent=jt(),this.resolution=0,this.loadPriority=0,this.measures={visibility:ia.VISIBLE_ON_SURFACE,screenRect:jt(),distance:0,shouldSplit:!1},this.used=!1,n&&this.acquire(e,r,i,n)}acquire(e,r,i,n){this.tilingScheme=n,this.id=$2.id(e,r,i),this.lij[0]=e,this.lij[1]=r,this.lij[2]=i,n.getExtent(e,r,i,this.extent),this.resolution=n.resolutionAtLevel(e)}release(){this.tilingScheme=null}getChildren(e){const r=this.lij[0]+1,i=2*this.lij[1],n=2*this.lij[2];return e?(e[0].acquire(r,i,n,this.tilingScheme),e[1].acquire(r,i+1,n,this.tilingScheme),e[2].acquire(r,i,n+1,this.tilingScheme),e[3].acquire(r,i+1,n+1,this.tilingScheme),e):[new $2(r,i,n,this.tilingScheme),new $2(r,i+1,n,this.tilingScheme),new $2(r,i,n+1,this.tilingScheme),new $2(r,i+1,n+1,this.tilingScheme)]}copyMeasurementsFrom(e){this.measures.visibility=e.measures.visibility,this.measures.shouldSplit=e.measures.shouldSplit,this.measures.distance=e.measures.distance,Ug(e.measures.screenRect,this.measures.screenRect)}static id(e,r,i){return`${e}/${r}/${i}`}};var ia;(function(t){t[t.INVISIBLE=0]="INVISIBLE",t[t.VISIBLE_WHEN_EXTENDED=1]="VISIBLE_WHEN_EXTENDED",t[t.VISIBLE_ON_SURFACE=2]="VISIBLE_ON_SURFACE"})(ia||(ia={}));const cOe=.5*Math.PI,Bpt=cOe/Math.PI*180;let Vpt=class{constructor(e){this._renderCoordsHelper=e.renderCoordsHelper,this._extent=new Array(4),this._planes=new Array(6),this._maxSpan=0,this._center={origin:O(),direction:O()};for(let r=0;r<4;r++)this._extent[r]={origin:O(),direction:O(),cap:{next:null,direction:O()}},this._planes[r]=Er();this._planes[si.NEAR]=Er(),this._planes[si.FAR]=Er(),this._planesWithoutFar=this._planes.slice(0,5)}update(e,r,i,n=!0){const s=this._extent;this._toRenderBoundingExtent(e,r,i),oe(this._center.origin,s[0].origin,s[2].origin),te(this._center.origin,this._center.origin,.5),this._renderCoordsHelper.worldUpAtPosition(this._center.origin,this._center.direction),n||te(this._center.direction,this._center.direction,-1);for(let o=0;o<4;o++){const a=s[o];this._renderCoordsHelper.worldUpAtPosition(a.origin,a.direction);const l=s[o===3?0:o+1];a.cap.next=l.origin,Qg(a.cap.direction,a.origin,l.origin),mR(a.direction,a.cap.direction,a.origin,this._planes[o]),n||te(a.direction,a.direction,-1)}mR(s[0].cap.direction,s[1].cap.direction,s[0].origin,this._planes[si.NEAR]),n?HG(this._planes[si.NEAR],this._planes[si.FAR]):(V6(this._planes[si.FAR],this._planes[si.NEAR]),HG(this._planes[si.NEAR],this._planes[si.NEAR])),this._maxSpan=Math.max(Math.abs(e[0]-e[2]),Math.abs(e[1]-e[3])),this._maxSpanSpatialReference=r,this._minGlobalAltitude=.9*Mr(this._maxSpanSpatialReference).radius}isVisibleInFrustum(e,r,i=!1){if(e==null)return!1;if(this._renderCoordsHelper.viewingMode===$e.Global){const s=this._maxSpanSpatialReference.isGeographic?Bpt:cOe*r;if(this._maxSpan>s)return!0;if(e.altitude!=null&&e.altitude>=this._minGlobalAltitude)return this._isVisibleInFrustumGlobal(e)}if(this._maxSpan===0){const s=this._extent[0];return!(i||!e.intersectsRay(bu(s.origin,s.direction)))}for(let s=0;sr,this._frustum.update(e),this._shortenFrustumFarPlane(this._frustum),this._updateExtendedFrustum(e)}end(){this._cache.clear()}calculate(e){if(this._allTilesInvisible)return ia.INVISIBLE;const r=this._renderCoordsHelper.viewingMode===$e.Global&&e.lij[0]>=Wpt&&e.lij[0](Math.PI+e.fovY)/2,this._allTilesInvisible||(this._hasExtendedFrustum=i>e.fovY/2,!this._hasExtendedFrustum))return;const n=this._extendedFrustumParameters(),s=this._extendedFrustum.mutablePoints;for(let o=0;o<4;o++){const a=n.pointIndices[o],l=s[a],c=this._renderCoordsHelper.getAltitude(l);if(n.needsAltitudeAdjustment(c)){switch(this._renderCoordsHelper.worldUpAtPosition(l,Fc),a){case Xe.FAR_BOTTOM_LEFT:case Xe.FAR_TOP_LEFT:case Xe.NEAR_BOTTOM_LEFT:case Xe.NEAR_TOP_LEFT:WG(this._extendedFrustum.planes[si.LEFT],Fc,Fc);break;case Xe.FAR_BOTTOM_RIGHT:case Xe.FAR_TOP_RIGHT:case Xe.NEAR_BOTTOM_RIGHT:case Xe.NEAR_TOP_RIGHT:WG(this._extendedFrustum.planes[si.RIGHT],Fc,Fc)}te(Fc,Fc,n.direction),this._renderCoordsHelper.intersectInfiniteManifold(bu(l,Fc),n.zWithMargin,l)}}if(this._extendedFrustum.updatePoints(s),oa(s[Xe.NEAR_BOTTOM_LEFT],s[Xe.NEAR_BOTTOM_RIGHT],s[Xe.NEAR_TOP_RIGHT],oce),oa(s[Xe.NEAR_BOTTOM_RIGHT],s[Xe.NEAR_TOP_RIGHT],s[Xe.NEAR_TOP_LEFT],ace),fe(oce,ace)<0){const o=this._extendedFrustum.mutablePoints;this._aboveGround?[o[Xe.NEAR_BOTTOM_LEFT],o[Xe.NEAR_BOTTOM_RIGHT]]=[o[Xe.NEAR_BOTTOM_RIGHT],o[Xe.NEAR_BOTTOM_LEFT]]:[o[Xe.NEAR_TOP_LEFT],o[Xe.NEAR_TOP_RIGHT]]=[o[Xe.NEAR_TOP_RIGHT],o[Xe.NEAR_TOP_LEFT]],this._extendedFrustum.updatePoints(o)}}_extendedFrustumParameters(){return this._aboveGround?this._extendedFrustumParametersAboveSurface():this._extendedFrustumParametersBelowSurface()}_extendedFrustumParametersAboveSurface(){const e=this._surfaceElevation-sce;return{zWithMargin:e,pointIndices:Wy.planePointIndices.bottom,direction:-1,needsAltitudeAdjustment:r=>r>e}}_extendedFrustumParametersBelowSurface(){const e=this._surfaceElevation+sce;return{zWithMargin:e,pointIndices:Wy.planePointIndices.top,direction:1,needsAltitudeAdjustment:r=>r{t.length!==4&&(t[0]=new lA,t[1]=new lA,t[2]=new lA,t[3]=new lA)},t=>{t[0].release(),t[1].release(),t[2].release(),t[3].release()});let Zpt=class{constructor(e){this._camera=new lt,this._focusOnMap=[0,0],this._screenRect=jt(),this._tileSize=e.tileSize,this._renderCoordsHelper=e.renderCoordsHelper,this._tilingScheme=e.tilingScheme,this._visibility=new Hpt(e.renderCoordsHelper)}begin(e,r,i){this._camera.copyFrom(e),this._surfaceElevation=i,this._focusOnMap[0]=r.x,this._focusOnMap[1]=r.y,yY(0,0,e.fullWidth,e.fullHeight,this._screenRect),this._visibility.begin(this._camera,i)}end(){this._visibility.end()}updateTile(e){e.measures.visibility=this._visibility.calculate(e),e.measures.distance=a8e(e.extent,this._focusOnMap),e.measures.visibility!==ia.INVISIBLE&&this._updateScreenMeasure(e)}_updateScreenMeasure(e){const r=Qpt,i=1<u)return void(e.measures.shouldSplit=!0);e.measures.shouldSplit=!1}_tileSizeWithBias(e){return e.measures.visibility===ia.VISIBLE_WHEN_EXTENDED?this._tileSize*Jpt:this._tileSize}_computeScreenArea(e,r,i,n,s){const o=e.measures.visibility===ia.VISIBLE_WHEN_EXTENDED;this._projectToScreen(r,i,n,o,B0),Ih(Rz);for(let a=0;a<4;a++)_Y(Rz,B0[a]);return S_(s,Rz,s),Lne(B0[0],B0[1],B0[2])+Lne(B0[0],B0[2],B0[3])}_projectToScreen(e,r,i,n,s){this._tilingScheme.ensureMaxLod(e),this._tilingScheme.getExtent(e,r,i,UC),this._toRenderCoords(UC,0,3,V0[0]),this._toRenderCoords(UC,2,3,V0[1]),this._toRenderCoords(UC,2,1,V0[2]),this._toRenderCoords(UC,0,1,V0[3]),n&&(this._projectToPlane(V0,this._camera.frustum[si.NEAR]),this._projectToPlane(V0,this._camera.frustum[si.TOP]),this._projectToPlane(V0,this._camera.frustum[si.BOTTOM]));for(let o=0;o<4;o++)this._camera.projectToRenderScreen(V0[o],cce),this._camera.renderToScreen(cce,s[o])}_projectToPlane(e,r){for(let n=0;n<4;n++)zC[n]=oi(r,e[n]);const i=Math.max(zC[0],zC[1],zC[2],zC[3]);if(i>0){const n=te(kC,r,-i);for(let s=0;s<4;s++)oe(e[s],e[s],n)}}_toRenderCoords(e,r,i,n){return kC[0]=e[r],kC[1]=e[i],kC[2]=this._surfaceElevation,this._renderCoordsHelper.toRenderCoords(kC,this._tilingScheme.spatialReference,n),n}};const Rz=jt(),Qpt=2,Jpt=5,B0=[Xi(),Xi(),Xi(),Xi()],UC=jt(),kC=O(),V0=[O(),O(),O(),O()],zC=[0,0,0,0],cce=Vo();function N5t(t,e,r){if(t==null||r==null)return!1;let i=!0;return ts[0]=t.xmin!=null?t.xmin:0,ts[1]=t.ymin!=null?t.ymin:0,ts[2]=t.zmin!=null?t.zmin:0,i=i&&$i(ts,t.spatialReference,0,e,r,0,1),ts[0]=t.xmax!=null?t.xmax:0,ts[1]=t.ymax!=null?t.ymax:0,ts[2]=t.zmax!=null?t.zmax:0,i=i&&$i(ts,t.spatialReference,0,e,r,3,1),t.xmin==null&&(e[0]=-1/0),t.ymin==null&&(e[1]=-1/0),t.zmin==null&&(e[2]=-1/0),t.xmax==null&&(e[3]=1/0),t.ymax==null&&(e[4]=1/0),t.zmax==null&&(e[5]=1/0),i}function uOe(t,e,r){if(t==null||r==null)return!1;let i=!0;return ts[0]=t.xmin!=null?t.xmin:0,ts[1]=t.ymin!=null?t.ymin:0,ts[2]=t.zmin!=null?t.zmin:0,i=i&&$i(ts,t.spatialReference,0,ts,r,0,1),e[0]=ts[0],e[1]=ts[1],ts[0]=t.xmax!=null?t.xmax:0,ts[1]=t.ymax!=null?t.ymax:0,ts[2]=t.zmax!=null?t.zmax:0,i=i&&$i(ts,t.spatialReference,0,ts,r,0,1),e[2]=ts[0],e[3]=ts[1],t.xmin==null&&(e[0]=-1/0),t.ymin==null&&(e[1]=-1/0),t.xmax==null&&(e[2]=1/0),t.ymax==null&&(e[3]=1/0),i}const ts=O();let ho=class extends xe{get tilingScheme(){const e=this.tilingSchemeOwner.tilingScheme;return e?e.clone():null}set filterExtent(e){if(e!=null&&!e.spatialReference.equals(this.viewState.spatialReference))return void J.getLogger(this).error("#extent","extent spatial reference needs to be in the same spatial reference as the view");const r=this._get("filterExtent");if(r===e||r!=null&&e&&r.equals(e))return;const i=e!=null?e.clone():null;this._set("filterExtent",i),this._setDirty()}get _filterExtentRect(){if(this.filterExtent==null)return null;const e=jt();return uOe(this.filterExtent,e,this.tilingScheme.spatialReference),e}get _rootTileIds(){const{tilingScheme:e}=this;return this._filterExtentRect&&e?e.rootTilesInExtent(this._filterExtentRect):[[0,0,0]]}set suspended(e){e!==this._get("suspended")&&(this._set("suspended",e),this._setDirty())}get updating(){return this._dirty||!!this._pendingTiles}constructor(e){super(e),this.tiles=new ir,this.tileSize=512,this._idToTile=new Map,this._handles=new Vi,this._clients=new Set,this._dirty=!1,this._pendingTiles=null,this._newTiles=new Nt}initialize(){this._handles.add([ue(()=>[this.tilingScheme,this.tileSize],()=>this._reset(),Br),ue(()=>{var e,r,i;return[this.tileSize,(e=this.cameraOnSurface)==null?void 0:e.location,this.tilingScheme,(r=this.viewState)==null?void 0:r.contentCamera,(i=this.focus)==null?void 0:i.location]},()=>this._setDirty(),An)]),this.scheduler&&(this._frameWorker=this.scheduler.registerTask(dt.FEATURE_TILE_TREE,this))}destroy(){this._frameWorker=Pi(this._frameWorker),this._handles=Me(this._handles)}addClient(){const e=eft();return this._clients.add(e),this._clients.size===1&&this._setDirty(),Za(()=>this._removeClient(e))}_removeClient(e){this._clients.delete(e),this._hasClients||this._clear()}get _hasClients(){return this._clients.size>0}_setDirty(){!this._hasClients||this.suspended||this._dirty||(this._frameWorker?(this._dirty=!0,this.notifyChange("updating")):this.runTask(Wa))}_clear(){this.tiles.removeAll(),this._idToTile.clear(),this._reset(),this._dirty=!1,this.notifyChange("updating")}get running(){return this.updating}runTask(e){this._dirty=!1,this._pendingTiles||(this._startUpdate(),this._frameWorker!=null&&(this._frameWorker.priority=dt.FEATURE_TILE_TREE_ACTIVE)),this._subdivideTilesForView(e),this._pendingTiles||this._frameWorker==null||(this._frameWorker.priority=dt.FEATURE_TILE_TREE),this.notifyChange("updating")}_startUpdate(){if(this.suspended)return;if(!this.tilingScheme)return void this._clear();this._tileMeasurements||(this._tileMeasurements=new Zpt({renderCoordsHelper:this.renderCoordsHelper,tilingScheme:this.tilingScheme,tileSize:this.tileSize}));const e=this.viewState.contentCamera;this._tileMeasurements.begin(e,this.focus.location,this.cameraOnSurface.location.z??0),this._pendingTiles=this._getRootTiles()}_reset(){this._newTiles.clear(),this._tileMeasurements=null,this._pendingTiles=null,this._setDirty()}_getRootTiles(){const{tilingScheme:e}=this;return this._rootTileIds.map(r=>new lA(r[0],r[1],r[2],e))}_purgeHorizonTiles(e){e.sort((r,i)=>{const n=r.measures.screenRect,s=i.measures.screenRect;return n[1]+n[3]-(s[1]+s[3])}),Ih(UI);for(let r=0;rtft)return e.data.slice(r,e.length);return[]}_subdivideTilesForView(e){if(!this._pendingTiles)return;const{tilingScheme:r}=this;for(;this._pendingTiles.length>0&&!e.done;){const i=this._pendingTiles.pop();e.madeProgress(),this._filterExtentRect&&!f6(this._filterExtentRect,i.extent)||(this._tileMeasurements.updateTile(i),i.measures.visibility!==ia.INVISIBLE&&(i.measures.shouldSplit?(r.ensureMaxLod(i.lij[0]+1),this._pendingTiles.push(...i.getChildren())):this._newTiles.push(i)))}this._pendingTiles.length===0&&(this._updateTiles(this._purgeHorizonTiles(this._newTiles)),this._newTiles.clear(),this._tileMeasurements.end(),this._pendingTiles=null)}_updateTiles(e){for(const n of this.tiles.items)n.used=!1;const r=e.filter(n=>{const s=this._idToTile.get(n.id);return s?(s.copyMeasurementsFrom(n),s.used=!0):this._idToTile.set(n.id,n),!s}),i=this.tiles.items.filter(n=>!n.used&&(this._idToTile.delete(n.id),!0));this.tiles.removeMany(i),this.tiles.addMany(r),this._sortTiles()}_sortTiles(){this.viewState.fixedContentCamera||this.tiles.sort((e,r)=>e.measures.visibility!==r.measures.visibility?e.measures.visibility===ia.VISIBLE_ON_SURFACE?-1:1:e.measures.distance-r.measures.distance),this.tiles.forEach((e,r)=>e.loadPriority=r)}};h([f({constructOnly:!0})],ho.prototype,"scheduler",void 0),h([f({constructOnly:!0})],ho.prototype,"renderCoordsHelper",void 0),h([f({constructOnly:!0})],ho.prototype,"tilingSchemeOwner",void 0),h([f({constructOnly:!0})],ho.prototype,"cameraOnSurface",void 0),h([f({constructOnly:!0})],ho.prototype,"focus",void 0),h([f({constructOnly:!0})],ho.prototype,"viewState",void 0),h([f({constructOnly:!0})],ho.prototype,"terrain",void 0),h([f()],ho.prototype,"tiles",void 0),h([f()],ho.prototype,"tileSize",void 0),h([f({readOnly:!0})],ho.prototype,"tilingScheme",null),h([f()],ho.prototype,"filterExtent",null),h([f({readOnly:!0})],ho.prototype,"_filterExtentRect",null),h([f({readOnly:!0})],ho.prototype,"_rootTileIds",null),h([f({value:!1})],ho.prototype,"suspended",null),h([f({readOnly:!0})],ho.prototype,"updating",null),ho=h([N("esri.views.3d.layers.support.FeatureTileTree3D")],ho);let Kpt=0;function eft(){return Kpt++}const UI=jt(),tft=10;let Ji=class extends xe{constructor(){super(...arguments),this._propertiesPool=new jg({camera:lt},this),this._lastSeenCameraProjectionValues=new lt,this.mode=Cr.ANIMATING,this._cssCamera=new lt,this._camera=new lt,this.rasterPixelRatio=1,this.contentPixelRatio=1,this.events=new Bn,this.viewingMode=$e.Global,this._cameraChanged=!1,this._updateQueue=new Array,this._processingUpdates=!1}init(e,r){this._set("viewingMode",e),this._set("spatialReference",r),this._set("constraints",new Bm({mode:this.viewingMode}))}exit(){var e;(e=this.cameraController)==null||e.destroy(),this.cameraController=null,this._propertiesPool.destroy(),this._propertiesPool=new jg({camera:lt},this)}destroy(){var e,r;(e=this.cameraController)==null||e.destroy(),this.cameraController=null,(r=this._propertiesPool)==null||r.destroy(),this._propertiesPool=null}createInitialCamera(){if(this.viewingMode===$e.Global){const e=Mr(this.spatialReference).radius;this.camera=new lt({eye:Se(4*e,0,0),center:Se(e,0,0),up:Se(0,0,1)})}else this.camera=new lt({eye:Se(0,0,100),center:Se(0,0,0),up:Se(0,1,0)})}get animation(){return this.cameraController instanceof OR&&this.cameraController.viewAnimation!=null?this.cameraController.viewAnimation:null}get camera(){return this._camera}get cssCamera(){const e=this._cssCamera.copyFrom(this.camera),{height:r,width:i,pixelRatio:n}=this.camera;return e.pixelRatio=1,e.height=Math.round(r/n),e.width=Math.round(i/n),e}set camera(e){e!==Iu&&Iu.copyFrom(e),Iu.computeUp(this.viewingMode),this.events.emit("before-camera-change",Iu);const r=this._camera;if(this._cameraProjectionChanged(this._lastSeenCameraProjectionValues,Iu)&&(this._lastSeenCameraProjectionValues.copyFrom(Iu),this.events.emit("camera-projection-changed",this._lastSeenCameraProjectionValues)),!r.equals(Iu)&&(this._camera=this._propertiesPool.get("camera").copyFrom(Iu),this._cameraChanged=!r.almostEquals(Iu),this._cameraChanged)){const i=Fge(()=>{this._cameraChanged=!1,i.remove()})}}get pixelRatio(){return this.camera.pixelRatio}get alignPixelEnabled(){return this.pixelRatio===this.rasterPixelRatio&&this.mode===Cr.IDLE}get updating(){return!this.alignPixelEnabled}get contentCamera(){return this._contentCamera??this.camera}set contentCamera(e){this._contentCamera=e!=null?e.clone():null}get fixedContentCamera(){return this._contentCamera!=null}get isGlobal(){return this.viewingMode===$e.Global}get isLocal(){return this.viewingMode===$e.Local}get navigating(){return!(!this.cameraController||!this.cameraController.isInteractive)}get stationary(){return!this._cameraChanged&&!this.navigating}get cameraController(){return this._get("cameraController")}set cameraController(e){var r;this.stopActiveCameraController()?((r=this.cameraController)==null||r.destroy(),e&&(this.removeHandles(uce),this.addHandles(Dh(()=>e.state===Wi.Finished||e.state===Wi.Stopped,()=>{this._set("cameraController",null),this.updateCamera(i=>e.onControllerEnd(i))},{sync:!0,once:!0}),uce),e.onControllerStart(this.camera)),this._set("cameraController",e)):e&&(e.state=Wi.Rejected)}switchCameraController(e){return this.cameraController=e,e.state!==Wi.Rejected}stopActiveCameraController(){return!(this.cameraController&&!this.cameraController.stopController())}updateCamera(e){this._updateQueue.push(e),this._processUpdateQueue()}_processUpdateQueue(){if(this._updateQueue.length===0||this._processingUpdates)return;this._processingUpdates=!0;const e=this._updateQueue.shift();Iu.copyFrom(this._get("camera")),e(Iu),this.camera=Iu,this._processingUpdates=!1,this._processUpdateQueue()}_cameraProjectionChanged(e,r){return e.fov!==r.fov||e.fullViewport[0]!==r.fullViewport[0]||e.fullViewport[1]!==r.fullViewport[1]||e.fullViewport[2]!==r.fullViewport[2]||e.fullViewport[3]!==r.fullViewport[3]||e.padding[Yt.TOP]!==r.padding[Yt.TOP]||e.padding[Yt.RIGHT]!==r.padding[Yt.RIGHT]||e.padding[Yt.BOTTOM]!==r.padding[Yt.BOTTOM]||e.padding[Yt.LEFT]!==r.padding[Yt.LEFT]}};h([f()],Ji.prototype,"mode",void 0),h([f({readOnly:!0,type:DS})],Ji.prototype,"animation",null),h([f({type:lt})],Ji.prototype,"camera",null),h([f({type:lt})],Ji.prototype,"cssCamera",null),h([f()],Ji.prototype,"_cssCamera",void 0),h([f()],Ji.prototype,"_camera",void 0),h([f({readOnly:!0})],Ji.prototype,"pixelRatio",null),h([f()],Ji.prototype,"rasterPixelRatio",void 0),h([f()],Ji.prototype,"contentPixelRatio",void 0),h([f({readOnly:!0})],Ji.prototype,"alignPixelEnabled",null),h([f({readOnly:!0})],Ji.prototype,"updating",null),h([f({})],Ji.prototype,"_contentCamera",void 0),h([f({type:lt})],Ji.prototype,"contentCamera",null),h([f({readOnly:!0})],Ji.prototype,"fixedContentCamera",null),h([f({readOnly:!0})],Ji.prototype,"constraints",void 0),h([f({readOnly:!0})],Ji.prototype,"events",void 0),h([f({readOnly:!0})],Ji.prototype,"isGlobal",null),h([f({readOnly:!0})],Ji.prototype,"isLocal",null),h([f({readOnly:!0})],Ji.prototype,"viewingMode",void 0),h([f({readOnly:!0})],Ji.prototype,"spatialReference",void 0),h([f()],Ji.prototype,"navigating",null),h([f()],Ji.prototype,"stationary",null),h([f()],Ji.prototype,"_cameraChanged",void 0),h([f()],Ji.prototype,"cameraController",null),Ji=h([N("esri.views.3d.state.ViewState")],Ji);const rft=Ji,Iu=new lt,uce="ViewStateHandles";let ift=class{constructor(e,r,i){this.viewingMode=e,this._forEachLayer=r,this._view=i,this._externalIntersectionHandlers=new Nt,this._tolerance=BS,this._tmpRay=qs(),this._tmpRegion=jt(),this._validateHUDIntersector=zh(this.viewingMode),this._validateHUDIntersector.options.hud=!1}intersectScreen(e,r,i){return this.intersectRay(this._getPickRay(e,this._tmpRay),hce(this.viewingMode),r,i)}intersectScreenFreePointFallback(e,r,i){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),r,i)}intersectRayFreePointFallback(e,r,i){return this.intersectRay(e,hce(this.viewingMode),r,i)||this._intersectRayFreePointLocal(e,r)}intersectRay(e,r,i,n){return r.options.selectionMode=!1,r.options.store=To.MIN,this.computeIntersection(e,r,n),!!r.results.min&&r.results.min.getIntersectionPoint(i)}getCenterRayWithSubpixelOffset(e,r,i=.5,n=.5){return e.getRenderCenter(BI,i,n),BI[0]+=.0466,BI[1]-=.0123,LQ(e,BI,r)}intersectIntersectorScreen(e,r,i){this.computeIntersection(this._getPickRay(e,this._tmpRay),r,i)}intersectToolIntersectorScreen(e,r,i){const n=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(n,r,i)}intersectToolIntersectorRay(e,r,i){r.options.selectionMode=!0,this.computeIntersection(e,r,i);const n=r.results.min;this._view.basemapTerrain&&this._view.basemapTerrain.opaque||bp(n)&&n.intersector!==Ui.TERRAIN||(r.options.selectionMode=!1,this.computeIntersection(e,r,i))}setTolerance(e=BS){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((r,i)=>r.type===Ui.TERRAIN?1:i.type===Ui.TERRAIN?-1:0)}removeIntersectionHandler(e){this._externalIntersectionHandlers.removeUnordered(e)!=null&&this._externalIntersectionHandlers.sort((r,i)=>r.type===Ui.TERRAIN?1:i.type===Ui.TERRAIN?-1:0)}_getPickRay(e,r){const i=this._view.state.camera;return Q2e(i,e,r)}_intersectRayFreePointLocal(e,r){return this.viewingMode!==$e.Local||e==null||oe(r,e.origin,me(Ie.get(),e.direction)),!1}intersectElevationFromScreen(e,r,i=0,n=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),r,i,n)}_intersectElevation(e,r,i=0,n=null){if(e==null)return null;const s=r!=null?r.mode:"absolute-height",o=(r==null?void 0:r.offset)??0,a=s!=="on-the-ground"?o+i:0,l=a/this._view.renderCoordsHelper.unitInMeters;if(s==="absolute-height"){if(this._view.renderCoordsHelper.intersectInfiniteManifold(e,a,zI)){const x=this._view.computeMapPointFromVec3d(zI);return x.z??(x.z=0),x.z-=o,x}return null}const c=this._view.state.camera,u=Ie.get();c.projectToRenderScreen(e.origin,u);const d=new dce(null,this._forEachLayer),p=this._view.slicePlane,m=p!=null?xse(p):null,y=zh(this.viewingMode);y.options.store=To.MIN,y.options.verticalOffset=l;const _=e.origin,v=oe(Ie.get(),_,e.direction);y.reset(_,v,c),y.point=u;const b=n?"type"in n&&n.type==="graphics"?x=>x.layerUid!==n.uid:x=>x.graphicUid!==n.uid:null;switch(s){case"relative-to-scene":{const x=T=>(!b||b(T))&&!!T.lastValidElevationBB;y.intersect(d.layers,u,this._tolerance,null,x),this._externalIntersectionHandlers.forAll(T=>{if(T.type===Ui.I3S||T.type===Ui.TERRAIN){const S=T.slicePlaneEnabled?m:null;T.intersect(y,S,y.rayBegin,y.rayEnd,u)}});break}case"on-the-ground":case"relative-to-ground":this._externalIntersectionHandlers.forAll(x=>{if(x.isGround){const T=x.slicePlaneEnabled?m:null;x.intersect(y,T,y.rayBegin,y.rayEnd,u)}})}if(y.results.min.getIntersectionPoint(zI)){const x=this._view.computeMapPointFromVec3d(zI);return x.z=i,x}return null}computeIntersection(e,r,i){var y;if(e==null)return;const n=this._view.state.camera,s=Ie.get();n.projectToRenderScreen(e.origin,s);const o=new dce(i,this._forEachLayer);r.options.selectOpaqueTerrainOnly=!i||!("include"in i||"exclude"in i);const a=e.origin,l=oe(Ie.get(),e.origin,e.direction);r.reset(a,l,n),r.intersect(o.layers,s,this._tolerance);const c=this._view.slicePlane,u=c!=null?xse(c):null;r.intersect(o.sliceableLayers,s,this._tolerance,u);const d=i&&(i.requiresGroundFeedback||i.enableDraped);this._externalIntersectionHandlers.forAll(_=>{const v=_.layerUid,b=Array.isArray(v),x=b?v:[v];b&&(r.options.filteredLayerUids=[]);let T=!1;for(const S of x)o.filterLayerUid(S)?T=!0:b&&r.options.filteredLayerUids.push(S);if(r.options.isFiltered=!T,_.isGround&&d||!r.options.isFiltered){const S=_.slicePlaneEnabled?u:null;_.intersect(r,S,a,l,s)}});const p=Ie.get(),m=this._view.basemapTerrain;if(i&&i.enableDraped&&m.spatialReference!=null&&r.results.ground.getIntersectionPoint(p)){const _=m.overlayManager.renderer,v=this._view.renderCoordsHelper.spatialReference,b=Ie.get();this._view.renderCoordsHelper.fromRenderCoords(p,b,m.spatialReference),b[2]=((y=this._view.elevationProvider)==null?void 0:y.getElevation(p[0],p[1],p[2],v,"ground"))??0,_.intersect(r,b,r.results.ground,x=>o.filterRenderGeometry(x))}r.sortResults(),this._processHUDResults(r)}_processHUDResults(e){const r=e.results.hud;Ug(this._tmpRegion,s7);const i=this._view.state.camera,n=[],s=this._tmpRegion,o=b=>{const x=new sft(b);i.projectToRenderScreen(b.target.center,x.screenPoint),x.screenPoint[0]=Math.floor(x.screenPoint[0]),x.screenPoint[1]=Math.floor(x.screenPoint[1]),n.push(x),_Y(s,x.screenPoint)};e.sortResults(r.all),r.min.dist!=null&&o(r.min);for(const b of r.all)r.min.target.object!==b.target.object&&r.max.target.object!==b.target.object&&o(b);if(r.max.dist!=null&&r.max.target.object!==r.min.target.object&&o(r.max),!n.length)return;s[0]===s[2]&&(s[2]+=1),s[1]===s[3]&&(s[3]+=1);const a=i.fullWidth,l=i.fullHeight,c=Math.max(0,s[0]-cA),u=Math.max(0,s[1]-cA),d=Math.min(nu(s)+2*cA,a-c),p=Math.min(lp(s)+2*cA,l-u),m=new Uint8Array(d*p*4);this._view._stage.renderer.readHUDVisibility(c,u,d,p,m);let y=!0;const _=e.results.max.dist==null;let v=0;for(const b of n)for(const x of nft)if(m[4*(Math.min(b.screenPoint[0]+x[0],a)-s[0]+(Math.min(b.screenPoint[1]+x[1],l)-s[1])*d)]){y&&(e.results.min.copy(b.result),y=!1),_&&e.results.max.copy(b.result),e.options.store===To.ALL&&e.results.all.splice(v++,0,b.result);break}}};const cA=1,nft=(()=>{const t=[],e=cA;for(let r=-e;r<=e;r++)for(let i=-e;i<=e;i++)t.push([i+e,r+e]);return t})();let sft=class{constructor(e){this.result=e,this.screenPoint=Vo()}},kI;function hce(t){return kI&&kI.viewingMode===t||(kI=zh(t)),kI}let dce=class{constructor(e,r){this.layers=new Array,this.sliceableLayers=new Array,this.include=e==null?void 0:e.include,this.exclude=e==null?void 0:e.exclude,r(i=>{i.pickable&&this.filterLayerUid(i.apiLayerUid)&&(i.sliceable?this.sliceableLayers:this.layers).push(i)})}filterLayerUid(e){const{include:r,exclude:i}=this;return e==null?r==null&&i==null:(r==null||r.has(e))&&(i==null||!i.has(e))}filterRenderGeometry(e){return this.filterLayerUid(e.layerUid)}};function pce(t){return typeof t=="object"&&"intersect"in t}const zI=O(),BI=Vo();let V5t=class{constructor(e,r){this.spatialReference=e,this._view=r}getElevation(e,r,i){return this._view.elevationProvider.getElevation(e,r,0,this.spatialReference,i)}async queryElevation(e,r,i,n,s){return this._view.elevationProvider.queryElevation(e,r,0,this.spatialReference,s,i,n)}},oft=class{constructor(e,r,i,n){this.spatialReference=r,this._getElevationQueryProvider=i,this._queries=new Array,this._queryOptions={...n,ignoreInvisibleLayers:!0},this._frameTask=e.registerTask(dt.ELEVATION_QUERY,this)}destroy(){this._frameTask.remove()}queryElevation(e,r,i,n=0){const s=Wo(),o={x:e,y:r,minDemResolution:n,result:s,signal:i};return this._queries.push(o),pa(i,()=>{vX(this._queries,o),s.reject(wr())}),s.promise}get running(){return this._queries.length>0}runTask(e){const r=this._queries;this._queries=[];const i=this._getElevationQueryProvider();if(!i)return r.forEach(u=>u.result.reject()),void e.madeProgress();const n=r.map(u=>[u.x,u.y]),s=r.reduce((u,d)=>Math.min(u,d.minDemResolution),1/0),o=new yP({points:n,spatialReference:this.spatialReference}),a=r.length>1&&r.some(u=>!!u.signal)?new AbortController:null,l=a!=null?a.signal:r[0].signal;if(a!=null){let u=0;r.forEach(d=>pa(d.signal,()=>{u++,d.result.reject(wr()),u===r.length&&a.abort()}))}const c={...this._queryOptions,minDemResolution:s,signal:l};i.queryElevation(o,c).then(u=>{r.forEach((d,p)=>{d.signal!=null&&d.signal.aborted?d.result.reject(wr()):d.result.resolve(u.geometry.points[p][2])})}).catch(u=>{r.forEach(d=>d.result.reject(u))}),e.madeProgress()}get test(){const e=this;return{update:()=>e._queries.length>0&&e.runTask(Wa)}}},uA=class extends Bn.EventedMixin(xe){get spatialReference(){var e,r;return(r=(e=this.view)==null?void 0:e.basemapTerrain)==null?void 0:r.spatialReference}constructor(e){super(e),this._im=new Array,this._ground=new Array,this._scene=new Array,this._handles=new Map,this.lastElevationQuery=null,this.elevationCacheEnabled=!1}destroy(){this._elevationQueryCached=Me(this._elevationQueryCached)}get _elevationQuery(){return this._elevationQueryCached==null&&(this._elevationQueryCached=new oft(this.view.resourceController.scheduler,this.view.spatialReference,()=>this.view.map&&this.view.map.ground,{maximumAutoTileRequests:4})),this._elevationQueryCached}enableElevationCache(e){e||(this.lastElevationQuery=null),this.elevationCacheEnabled=e}getElevation(e,r,i,n,s){if(this.elevationCacheEnabled&&this.lastElevationQuery!=null){const a=this.lastElevationQuery;if(e===a.x&&r===a.y&&i===a.z&&Js(n,a.spatialReference)&&s===a.queryContext)return a.result}let o=null;return o=VI(o,this._im,e,r,i,n,s),o==null&&(o=VI(o,this._ground,e,r,i,n,s)),s==="scene"&&(o=VI(o,this._scene,e,r,i,n,s)),this.elevationCacheEnabled&&(this.lastElevationQuery={x:e,y:r,z:i,spatialReference:n,queryContext:s,result:o}),o}getSphereElevationBounds(e,r){let i=1/0,n=-1/0;for(const s of[this._im,this._ground,this._scene])s.forEach(o=>{if(o.getSphereElevationBounds){const a=o.getSphereElevationBounds(e,r);a!=null&&(i=Math.min(i,a.min),n=Math.max(n,a.max))}});return{min:i,max:n}}queryElevation(e,r,i,n,s,o=null,a=0){const l=Wo();return this._elevationQuery.queryElevation(e,r,o,a).then(c=>{s==="scene"&&(c=VI(c,this._scene,e,r,i,n,s)),l.resolve(c)}).catch(c=>{Zn(c)?l.reject(c):l.resolve(this.getElevation(e,r,i,n,s))}),l.promise}register(e,r){this._handles.set(r,r.on("elevation-change",i=>this.emit("elevation-change",i))),this._providersFromContext(e).push(r)}unregister(e){var r;this._handles.has(e)&&((r=this._handles.get(e))==null||r.remove(),this._handles.delete(e));for(const i of[this._im,this._ground,this._scene]){const n=i.indexOf(e);n>-1&&i.splice(n,1)}}_providersFromContext(e){switch(e){case"ground":return this._ground;case"im":return this._im;case"scene":return this._scene}}};function VI(t,e,r,i,n,s,o){for(const a of e){const l=a.getElevation(r,i,n,s,o);l!=null&&(t=t!=null?Math.max(l,t):l)}return t}h([f({constructOnly:!0})],uA.prototype,"view",void 0),h([f()],uA.prototype,"spatialReference",null),uA=h([N("esri.views.3d.support.CombinedElevationProvider")],uA);let hA=class pW{static isValidProfile(e){return e in pW.profiles}static getDefaultProfile(){return se("esri-iPhone")?"low":"medium"}static apply(e,r){const i=pW.profiles[e];r.graphics3D.maxTotalNumberOfFeatures=i.graphics3D.maxTotalNumberOfFeatures,r.graphics3D.maxTotalNumberOfPrimitives=i.graphics3D.maxTotalNumberOfPrimitives,r.graphics3D.polygonLodFactor=i.graphics3D.polygonLodFactor,r.graphics3D.polylineLodFactor=i.graphics3D.polylineLodFactor,r.graphics3D.snapshotAvailable=i.graphics3D.snapshotAvailable,r.graphics3D.skipHighSymbolLods=i.graphics3D.skipHighSymbolLods;const n=r.sceneService.object,s=i.sceneService.object;n.lodFactor=s.lodFactor,n.lodCrossfadeinDuration=s.lodCrossfadeinDuration,n.lodCrossfadeoutDuration=s.lodCrossfadeoutDuration,n.lodCrossfadeUncoveredDuration=s.lodCrossfadeUncoveredDuration,r.sceneService.point.lodFactor=i.sceneService.point.lodFactor,r.sceneService.integratedMesh.lodFactor=i.sceneService.integratedMesh.lodFactor,r.sceneService.pointCloud.lodFactor=i.sceneService.pointCloud.lodFactor,r.sceneService.uncompressedTextureDownsamplingEnabled=i.sceneService.uncompressedTextureDownsamplingEnabled,r.tiledSurface.lodBias=i.tiledSurface.lodBias,r.tiledSurface.angledSplitBias=i.tiledSurface.angledSplitBias,r.tiledSurface.reduceTileLevelDifferences=i.tiledSurface.reduceTileLevelDifferences,r.tiledSurface.textureFadeDuration=i.tiledSurface.textureFadeDuration,r.heatmap.pixelRatio=i.heatmap.pixelRatio,r.heatmap.maxTotalNumberOfFeatures=i.heatmap.maxTotalNumberOfFeatures,r.fadeDuration=i.fadeDuration,r.antialiasingEnabled=i.antialiasingEnabled,r.physicallyBasedRenderingEnabled=i.physicalBasedRenderingEnabled,r.highQualityTransparency=i.highQualityTransparency,r.highResolutionAtmosphere=i.highResolutionAtmosphere,r.reflections=i.reflections,r.ambientOcclusion=i.ambientOcclusion,r.memoryLimit=i.memoryLimit,r.additionalCacheMemory=i.additionalCacheMemory,r.frameRate=i.frameRate,r.maximumPixelRatio=i.maximumPixelRatio}};function fce(){const t=!!se("esri-mobile"),e=!!se("ios"),r=400;return{low:{graphics3D:{maxTotalNumberOfFeatures:25e3,maxTotalNumberOfPrimitives:85e4,polygonLodFactor:.5,polylineLodFactor:1,snapshotAvailable:!1,skipHighSymbolLods:!0},heatmap:{pixelRatio:.125,maxTotalNumberOfFeatures:25e3},sceneService:{object:{lodFactor:.2,lodCrossfadeinDuration:0,lodCrossfadeoutDuration:0,lodCrossfadeUncoveredDuration:0},point:{lodFactor:1},integratedMesh:{lodFactor:.6},pointCloud:{lodFactor:.5},uncompressedTextureDownsamplingEnabled:!0},tiledSurface:{lodBias:-1,angledSplitBias:.5,reduceTileLevelDifferences:!1,textureFadeDuration:0},fadeDuration:0,antialiasingEnabled:!1,physicalBasedRenderingEnabled:!1,highQualityTransparency:!1,highResolutionAtmosphere:!1,reflections:!1,ambientOcclusion:!1,memoryLimit:200,additionalCacheMemory:0,frameRate:0,maximumPixelRatio:1},medium:{graphics3D:{maxTotalNumberOfFeatures:5e4,maxTotalNumberOfPrimitives:17e5,polygonLodFactor:t?.8:1,polylineLodFactor:t?1.2:1.5,snapshotAvailable:!e,skipHighSymbolLods:!1},heatmap:{pixelRatio:.25,maxTotalNumberOfFeatures:5e4},sceneService:{object:{lodFactor:1,lodCrossfadeinDuration:0,lodCrossfadeoutDuration:0,lodCrossfadeUncoveredDuration:r},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1},uncompressedTextureDownsamplingEnabled:t},tiledSurface:{lodBias:0,angledSplitBias:1,reduceTileLevelDifferences:!se("disable-feature:reduce-map-tile-levels"),textureFadeDuration:r},fadeDuration:r,antialiasingEnabled:!0,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!1,reflections:!1,ambientOcclusion:!1,memoryLimit:t?600:750,additionalCacheMemory:t?-100:150,frameRate:0,maximumPixelRatio:1},high:{graphics3D:{maxTotalNumberOfFeatures:5e4,maxTotalNumberOfPrimitives:17e5,polygonLodFactor:t?1.2:2,polylineLodFactor:t?1.2:2,snapshotAvailable:!e,skipHighSymbolLods:!1},heatmap:{pixelRatio:.5,maxTotalNumberOfFeatures:5e4},sceneService:{object:{lodFactor:1,lodCrossfadeinDuration:0,lodCrossfadeoutDuration:0,lodCrossfadeUncoveredDuration:r},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1},uncompressedTextureDownsamplingEnabled:!1},tiledSurface:{lodBias:0,angledSplitBias:1,reduceTileLevelDifferences:!se("disable-feature:reduce-map-tile-levels"),textureFadeDuration:r},fadeDuration:r,antialiasingEnabled:!0,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!0,reflections:!0,ambientOcclusion:!0,memoryLimit:t?900:1500,additionalCacheMemory:t?-150:0,frameRate:0,maximumPixelRatio:t?1:1/0}}}hA.test={reset(){const t=fce();for(const e of Object.keys(t))hA.profiles[e]=t[e]}},function(t){t.profiles=fce()}(hA||(hA={}));const eN=hA;function hOe(){return new Float32Array(4)}function aft(t){const e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function rm(t,e,r,i){const n=new Float32Array(4);return n[0]=t,n[1]=e,n[2]=r,n[3]=i,n}function lft(t,e){return new Float32Array(t,e,4)}function dOe(){return hOe()}function pOe(){return rm(1,1,1,1)}function fOe(){return rm(1,0,0,0)}function mOe(){return rm(0,1,0,0)}function gOe(){return rm(0,0,1,0)}function yOe(){return rm(0,0,0,1)}const cft=dOe(),uft=pOe(),hft=fOe(),dft=mOe(),pft=gOe(),fft=yOe();Object.freeze(Object.defineProperty({__proto__:null,ONES:uft,UNIT_W:fft,UNIT_X:hft,UNIT_Y:dft,UNIT_Z:pft,ZEROS:cft,clone:aft,create:hOe,createView:lft,fromValues:rm,ones:pOe,unitW:yOe,unitX:fOe,unitY:mOe,unitZ:gOe,zeros:dOe},Symbol.toStringTag,{value:"Module"}));const mce=new it([0,255,255]),gce=new it([0,0,0]),yce=1,_ce=.25,vce=.4,bce=.2;let af=class extends xe{constructor(){super(...arguments),this.color=mce.clone(),this.haloColor=null,this.haloOpacity=yce,this.fillOpacity=_ce,this.shadowOpacity=vce,this.shadowColor=gce.clone(),this.shadowDifference=bce}static toEngineOptions(e){const r=it.toUnitRGBA(e.color??mce),i=e.haloColor!=null?it.toUnitRGBA(e.haloColor):r,n=it.toUnitRGBA(e.shadowColor??gce),s=e.haloOpacity??yce,o=e.fillOpacity??_ce,a=e.shadowOpacity??vce,l=e.shadowDifference??bce;return{color:rm(r[0],r[1],r[2],r[3]),haloColor:rm(i[0],i[1],i[2],i[3]),haloOpacity:s,haloOpacityOccluded:.25*s,fillOpacity:o,fillOpacityOccluded:.25*o,shadowOpacity:a,shadowColor:$t(n[0],n[1],n[2],n[3]),occludedShadowOpacity:a*(1-l)}}};h([f({type:it})],af.prototype,"color",void 0),h([f({type:it})],af.prototype,"haloColor",void 0),h([f()],af.prototype,"haloOpacity",void 0),h([f()],af.prototype,"fillOpacity",void 0),h([f()],af.prototype,"shadowOpacity",void 0),h([f({type:it})],af.prototype,"shadowColor",void 0),h([f()],af.prototype,"shadowDifference",void 0),af=h([N("esri.views.3d.support.HighlightOptions")],af);const fW=af;function mft(t,e){return e?{...e,query:{...t??{},...e.query}}:{query:t}}function gft(t){return typeof t=="string"?Ja(t):ye(t)}function yft(t,e,r){const i={};for(const n in t){if(n==="declaredClass")continue;const s=t[n];if(s!=null&&typeof s!="function")if(Array.isArray(s)){i[n]=[];for(let o=0;oe.toJSON())}}function _ft(t,e,r){const i=w8e(e);return t.map(n=>{const s=i.fromJSON(n);return s.spatialReference=r,s})}let Nv=class extends ke{constructor(e){super(e),this.geometries=[],this.outSpatialReference=null,this.transformation=null,this.transformForward=null}toJSON(){const e=this.geometries.map(n=>n.toJSON()),r=this.geometries[0],i={};return i.outSR=this.outSpatialReference.wkid||JSON.stringify(this.outSpatialReference.toJSON()),i.inSR=r.spatialReference.wkid||JSON.stringify(r.spatialReference.toJSON()),i.geometries=JSON.stringify({geometryType:AY(r),geometries:e}),this.transformation&&(i.transformation=this.transformation.wkid||JSON.stringify(this.transformation)),this.transformForward!=null&&(i.transformForward=this.transformForward),i}};h([f()],Nv.prototype,"geometries",void 0),h([f({json:{read:{source:"outSR"}}})],Nv.prototype,"outSpatialReference",void 0),h([f()],Nv.prototype,"transformation",void 0),h([f()],Nv.prototype,"transformForward",void 0),Nv=h([N("esri.rest.support.ProjectParameters")],Nv);const lK=Nv,vft=Qa(lK);async function _Oe(t,e,r){e=vft(e);const i=gft(t),n={...i.query,f:"json",...e.toJSON()},s=e.outSpatialReference,o=AY(e.geometries[0]),a=mft(n,r);return kn(i.path+"/project",a).then(({data:{geometries:l}})=>_ft(l,o,s))}async function cK(t=null,e){var n,s;if(Jr.geometryServiceUrl)return Jr.geometryServiceUrl;if(!t)throw new Y("internal:geometry-service-url-not-configured");let r;r="portal"in t?t.portal||Mh.getDefault():t,await r.load({signal:e});const i=(s=(n=r.helperServices)==null?void 0:n.geometry)==null?void 0:s.url;if(!i)throw new Y("internal:geometry-service-url-not-configured");return i}async function bft(t,e,r=null,i){const n=await cK(r,i),s=new lK;s.geometries=[t],s.outSpatialReference=e;const o=await _Oe(n,s,{signal:i});if(o&&Array.isArray(o)&&o.length===1)return o[0];throw new Y("internal:geometry-service-projection-failed")}const wft=Object.freeze(Object.defineProperty({__proto__:null,getGeometryServiceURL:cK,projectGeometry:bft},Symbol.toStringTag,{value:"Module"}));let xft=class{constructor(e,r){this.spatialReference=r,this.unitInMeters=el(this.spatialReference,Mr(this.spatialReference).metersPerDegree),this._geometryServiceURLPromise=cK(e&&e.get("portalItem")).catch(()=>{throw new Y("mapcoordshelper:missing-geometry-service","Must specify geometryService in esri/config")})}async toGeographic(e){const r=await this._geometryServiceURLPromise;let i,n=!0;Array.isArray(e[0])&&typeof e[0]!="number"?i=e:(i=[e],n=!1);const s=i.map(l=>l instanceof ze?l:new ze(l,this.spatialReference)),o=new lK({geometries:s,outSpatialReference:St.WGS84}),a=(await _Oe(r,o)).map(l=>l.type==="point"?[l.x,l.y]:void 0).filter(l=>!!l);return n?a:a[0]}},Od=class extends xe{constructor(){super(...arguments),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxTotalNumberOfPrimitives=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};h([f()],Od.prototype,"minTotalNumberOfFeatures",void 0),h([f()],Od.prototype,"maxTotalNumberOfFeatures",void 0),h([f()],Od.prototype,"maxTotalNumberOfPrimitives",void 0),h([f()],Od.prototype,"snapshotAvailable",void 0),h([f()],Od.prototype,"polygonLodFactor",void 0),h([f()],Od.prototype,"polylineLodFactor",void 0),h([f()],Od.prototype,"skipHighSymbolLods",void 0),Od=h([N("esri.views.3d.support.QualitySettings.Graphics3DSettings")],Od);let Vf=class extends xe{constructor(){super(...arguments),this.lodFactor=1}};h([f()],Vf.prototype,"lodFactor",void 0),Vf=h([N("esri.views.3d.support.QualitySettings.LoDFactorSettings")],Vf);let Z5=class extends Vf{constructor(){super(...arguments),this.lodCrossfadeinDuration=0,this.lodCrossfadeoutDuration=0,this.lodCrossfadeUncoveredDuration=0}};Z5=h([N("esri.views.3d.support.QualitySettings.LoDFactor3DObjectSettings")],Z5);let rg=class extends xe{constructor(){super(...arguments),this.object=new Z5,this.point=new Vf,this.integratedMesh=new Vf,this.pointCloud=new Vf,this.uncompressedTextureDownsamplingEnabled=!1}};h([f({type:Z5})],rg.prototype,"object",void 0),h([f({type:Vf})],rg.prototype,"point",void 0),h([f({type:Vf})],rg.prototype,"integratedMesh",void 0),h([f({type:Vf})],rg.prototype,"pointCloud",void 0),h([f()],rg.prototype,"uncompressedTextureDownsamplingEnabled",void 0),rg=h([N("esri.views.3d.support.QualitySettings.SceneServiceSettings")],rg);let Dy=class extends xe{constructor(){super(...arguments),this.lodBias=0,this.angledSplitBias=1,this.reduceTileLevelDifferences=!0,this.textureFadeDuration=400}};h([f()],Dy.prototype,"lodBias",void 0),h([f()],Dy.prototype,"angledSplitBias",void 0),h([f()],Dy.prototype,"reduceTileLevelDifferences",void 0),h([f()],Dy.prototype,"textureFadeDuration",void 0),Dy=h([N("esri.views.3d.support.QualitySettings.TiledSurfaceSettings")],Dy);let vT=class extends xe{constructor(){super(...arguments),this.pixelRatio=1,this.maxTotalNumberOfFeatures=5e4}};h([f()],vT.prototype,"pixelRatio",void 0),h([f()],vT.prototype,"maxTotalNumberOfFeatures",void 0),vT=h([N("esri.views.3d.support.QualitySettings.HeatmapSettings")],vT);let Po=class extends xe{constructor(){super(...arguments),this.graphics3D=new Od,this.sceneService=new rg,this.tiledSurface=new Dy,this.heatmap=new vT,this.fadeDuration=400,this.antialiasingEnabled=!0,this.physicallyBasedRenderingEnabled=!1,this.highQualityTransparency=!0,this.highResolutionAtmosphere=!1,this.reflections=!1,this.ambientOcclusion=!1,this.memoryLimit=750,this.additionalCacheMemory=0,this.frameRate=void 0,this.maximumPixelRatio=1/0}};h([f({type:Od})],Po.prototype,"graphics3D",void 0),h([f({type:rg})],Po.prototype,"sceneService",void 0),h([f({type:Dy})],Po.prototype,"tiledSurface",void 0),h([f({type:vT})],Po.prototype,"heatmap",void 0),h([f()],Po.prototype,"fadeDuration",void 0),h([f()],Po.prototype,"antialiasingEnabled",void 0),h([f()],Po.prototype,"physicallyBasedRenderingEnabled",void 0),h([f()],Po.prototype,"highQualityTransparency",void 0),h([f()],Po.prototype,"highResolutionAtmosphere",void 0),h([f()],Po.prototype,"reflections",void 0),h([f()],Po.prototype,"ambientOcclusion",void 0),h([f()],Po.prototype,"memoryLimit",void 0),h([f()],Po.prototype,"additionalCacheMemory",void 0),h([f()],Po.prototype,"frameRate",void 0),h([f()],Po.prototype,"maximumPixelRatio",void 0),Po=h([N("esri.views.3d.support.QualitySettings.QualitySettings")],Po);const wce=Po;function Tft(t){return cE(t)&&t.length>=3}function Sft(t){return(uE(t)||Array.isArray(t))&&t.length>=3}function Eft(t){return Tft(t)||Sft(t)}let Cft=class mW{constructor(e,r,i,n){this.viewingMode=e,this.spatialReference=r,this.unitInMeters=i,this._coordinateSystem=n,this._tmpCoordinateSystem=n7e(n)}set extent(e){e&&s7e(this._coordinateSystem,e,this._coordinateSystem)}getAltitude(e){return p7e(this._coordinateSystem,e)}setAltitude(e,r,i=e){return Ube(this._coordinateSystem,i,r,e)}setAltitudeOfTransformation(e,r){f7e(this._coordinateSystem,r,e,r)}worldUpAtPosition(e,r){return c7e(this._coordinateSystem,e,r)}worldBasisAtPosition(e,r,i){return u7e(this._coordinateSystem,e,r,i)}basisMatrixAtPosition(e,r){const i=this.worldBasisAtPosition(e,gc.X,Ie.get()),n=this.worldBasisAtPosition(e,gc.Y,Ie.get()),s=this.worldBasisAtPosition(e,gc.Z,Ie.get());return am(r,i[0],i[1],i[2],0,n[0],n[1],n[2],0,s[0],s[1],s[2],0,0,0,0,1),r}headingAtPosition(e,r){const i=this.worldUpAtPosition(e,Ie.get()),n=this.worldBasisAtPosition(e,gc.Y,Ie.get()),s=pbe(r,n,i);return Ka(s)}intersectManifoldClosestSilhouette(e,r,i){return xk(this._coordinateSystem,r,this._tmpCoordinateSystem),d7e(this._tmpCoordinateSystem,e,i),i}intersectManifold(e,r,i){xk(this._coordinateSystem,r,this._tmpCoordinateSystem);const n=Ie.get();return h7e(this._tmpCoordinateSystem,e,n)?re(i,n):null}intersectInfiniteManifold(e,r,i){if(this.viewingMode===$e.Global)return this.intersectManifold(e,r,i);xk(this._coordinateSystem,r,this._tmpCoordinateSystem);const n=this._tmpCoordinateSystem.value,s=Ie.get();return kw(n.plane,e,s)?re(i,s):null}toRenderCoords(e,r,i){return T5(e)?Bi(e,r,this.spatialReference):Cs(e,r,i,this.spatialReference)}fromRenderCoords(e,r,i=null){return T5(r)?(i!=null&&(r.spatialReference=i),hZ(e,this.spatialReference,r)):Eft(r)?Cs(e,this.spatialReference,r,i)?r:null:Vg(e,this.spatialReference,r)}static create(e,r){switch(e){case $e.Local:return new mW($e.Local,r,el(r),l7e());case $e.Global:return new mW($e.Global,r,1,a7e(r))}}static renderUnitScaleFactor(e,r){return UV(e)/UV(r)}};var Cf;(function(t){t[t.ELEVATION=0]="ELEVATION",t[t.BASEMAP=1]="BASEMAP",t[t.I3S_INDEX=2]="I3S_INDEX",t[t.I3S_DATA=3]="I3S_DATA",t[t.SYMBOLOGY=4]="SYMBOLOGY"})(Cf||(Cf={}));const Aft=(()=>{const t=new Array;return t[Cf.ELEVATION]=10,t[Cf.BASEMAP]=10,t[Cf.I3S_INDEX]=10,t[Cf.I3S_DATA]=10,t[Cf.SYMBOLOGY]=5,t})(),Oft=30;function vOe(t){return"usedMemory"in t&&"unloadedMemory"in t&&"ignoresMemoryFactor"in t}function Rft(t){return new ml({view:t})}const GI=1,Pz=1,Pft=.75,Mft=.6,xce=1.3;let ml=class extends xe{constructor(e){super(e),this._quality=1,this._usedMemory=0,this._updating=!1,this.minQuality=.1,this._stableQuality=0,this._downscaleMemoryUsed=0,this._canFastRecover=!1,this._memoryPredicted=0,this._cacheStorage=new t3e,this._warnMemoryUsage=null,this._numQualityChanges=0,this._maxMemory=750,this._additionalCacheMemory=0}destroy(){this._cacheStorage.destroy()}set maxMemory(e){e==null||e<=0||(this._stableQuality=0,this._canFastRecover=!1,this._maxMemory1.1*Pz||this._usedMemory>Pz)&&(this._stableQuality>0?(this._downscaleMemoryUsed=0,this._updateQuality(this._stableQuality)):this._quality>this.minQuality&&this._downscaleMemoryUsedPz)this._stableQuality=0,this._canFastRecover=!1,e=this._updateQuality(this._quality/xce),this._downscaleMemoryUsed=this._memoryPredicted;else if(this._stableQuality!==this._quality)if(this._usedMemory!!e.updating)}_updateMemory(){var a,l;if(!this.view)return;let e=0;this.view.basemapTerrain&&(e+=this.view.basemapTerrain.usedMemory);const r=((a=this.view)==null?void 0:a._stage)&&this.view._stage.renderView&&((l=this.view._stage.renderer)==null?void 0:l.edgeView);r!=null&&(e+=r.usedMemory);let i=0;this.view.allLayerViews&&this.view.allLayerViews.forEach(c=>{if(vOe(c)){const u=c.ignoresMemoryFactor?this._quality:1;e+=c.usedMemory*u,i+=c.unloadedMemory*u}});const n=this._warnMemoryUsage==null||Math.round(10*e)!==Math.round(10*this._warnMemoryUsage),s=1048576*this.maxMemory;if(e>s&&n){this._warnMemoryUsage=e;const c=d=>(d/1048576).toLocaleString(void 0,{maximumFractionDigits:1})+" MB",u=Math.round(100*this._quality);J.getLogger(this).warn(`Memory Limit exceeded! Limit: ${c(s)} Current: ${c(e)} Projected: ${c(e+i)} Quality: ${u}%`)}this._usedMemory=e/s,this._memoryPredicted=(e+i)/s;const o=s-e;this._cacheStorage.maxSize=Math.max(0,o+1048576*this.additionalCacheMemory)}get test(){const e=this;return{cacheStorage:this._cacheStorage,resetQualityChanges:()=>{const r=e._numQualityChanges;return e._numQualityChanges=0,r}}}};h([f({constructOnly:!0})],ml.prototype,"view",void 0),h([f()],ml.prototype,"maxMemory",null),h([f()],ml.prototype,"additionalCacheMemory",null),h([f()],ml.prototype,"memoryFactor",null),h([f()],ml.prototype,"updating",null),h([f()],ml.prototype,"usedMemory",null),h([f()],ml.prototype,"_quality",void 0),h([f()],ml.prototype,"_usedMemory",void 0),h([f()],ml.prototype,"_updating",void 0),h([f()],ml.prototype,"_stableQuality",void 0),h([f()],ml.prototype,"_maxMemory",void 0),h([f()],ml.prototype,"_additionalCacheMemory",void 0),ml=h([N("esri.views.3d.support.MemoryController")],ml);let $ft=class{constructor(e){this.client=e,this._cancelled=!1,this.size=0,this.duration=0}},Ift=class{constructor(e){this.typeWorkerQuota=e,this.tasks=new Array,this.numWorkers=0,this.statistics=new Lft}},Lft=class{constructor(){this.requests=0,this.size=0,this.duration=0,this.speed=0}},Dft=class{constructor(e,r,i,n){this._workerFunc=e,this._callbackFunc=r,this._maxTotalNumWorkers=i,this._totalNumWorkers=0,this._clients=n.map(s=>new Ift(s))}destroy(){this._clients.length=0}hasQuota(e){const r=this._clients[e];return!!r&&(this._totalNumWorkersthis._taskCallback(i,n))):r.tasks.push(e))}cancel(e){this._taskFinished(e),e._cancelled=!0}_taskFinished(e){const r=this._clients[e.client];this._totalNumWorkers--,r&&(r.numWorkers--,r.statistics.requests++,r.statistics.size+=e.size||0,r.statistics.duration+=e.duration||0,r.statistics.speed=r.statistics.duration>0?r.statistics.size/r.statistics.duration:0,Je(r.numWorkers>=0)),this._next()}_next(){for(const e of this._clients)if(e&&e.numWorkers0;)if(this._workerFunc(e.tasks.shift(),(r,i)=>this._taskCallback(r,i)))return e.numWorkers++,this._totalNumWorkers++,!0;return!1}_taskCallback(e,r){e._cancelled||(this._callbackFunc(e,r),this._taskFinished(e))}getStatsForType(e){const r=this._clients[e];return r?{quota:r.typeWorkerQuota,workers:r.numWorkers,queueSize:r.tasks.length,requestStats:r.statistics}:null}get test(){const e=this;return{set workerFunc(r){e._workerFunc=r}}}},tN=class extends xe{constructor(){super(...arguments),this._tasks=new Map,this._onLoadQueue=new Array,this._doneQueue=new Array,this.updating=!1}setup(e,r,i){this._loadQueue=new Dft((n,s)=>this._startLoading(n,s),(n,s)=>this._doneLoadingCB(n,s),e,r),i&&(this._frameTask=i.registerTask(dt.STREAM_DATA_LOADER,this))}destroy(){this._frameTask=Pi(this._frameTask),this._tasks.forEach(e=>yu(e.abortController)),this._loadQueue=Me(this._loadQueue),this._onLoadQueue=null,this._doneQueue=null,this._tasks=null}hasDownloadSlots(e){return this._loadQueue.hasQuota(e)}request(e,r,i,n={}){const s=Wo();s.__signal=n!=null?n.signal:null;const o=this._createOrUpdateTask(e,r,i,n,s);return pa(n,()=>this._cancelRequest(o,s)),s.promise}_createTask(e,r,i,n,s,o){const a=new Uft(e,r,i,n,s);return this._updateTask(a,o),this._tasks.set(s,a),this._tasks.size===1&&this._set("updating",!0),this._loadQueue.push(a),a}_cancelRequest(e,r){var i;qO(e.resolvers,r),r.reject(wr()),e.resolvers.length===0&&(e.status===Ju.DOWNLOADING&&(e.status=Ju.CANCELLED,this._loadQueue.cancel(e),(i=e.abortController)==null||i.abort(),e.request=null,e.abortController=null),e.status=Ju.CANCELLED,this._tasks.delete(e.key),this._tasks.size===0&&this._set("updating",!1))}_updateTask(e,r){e.resolvers.push(r)}_createOrUpdateTask(e,r,i,n,s){const o=kft(n!=null&&n.uid||e,r,i),a=this._tasks.get(o);return a?(this._updateTask(a,s),a):this._createTask(e,n,r,i,o,s)}_doneLoadingCB(e,r){this._loadQueue&&(Je(e.status===Ju.DOWNLOADING),e.status=Ju.DOWNLOADED,this._frameTask?this._doneQueue.push({task:e,err:r}):this._doneLoading(e,r))}get running(){return this._doneQueue.length>0||this._onLoadQueue.length>0}runTask(e){for(;!e.done&&this._onLoadQueue.length>0;){const r=this._onLoadQueue.shift();Bt(r.task.abortController),r.task.abortController=null,r.callback(r.task),e.madeProgress()}for(;!e.done&&this._doneQueue.length>0;){const r=this._doneQueue.shift();r.task.status!==Ju.DOWNLOADED&&(r.err=r.err||wr()),this._doneLoading(r.task,r.err),e.madeProgress()}}_doneLoading(e,r){if(r&&!Zn(r)&&e.numRetries>0)return--e.numRetries,void this._loadQueue.push(e);let i=e.result instanceof HTMLImageElement?0:e.resolvers.length;for(const n of e.resolvers)if(r)Zn(r)?n.reject(r):n.reject(new Y("stream-data-loader:request-error",`Failed to request resource at '${e.url}'. ${r}`,{url:e.url,error:r}));else{--i;const s=i<=0?e.result:ye(e.result);n.resolve(s)}this._tasks.delete(e.key),this._tasks.size===0&&this._set("updating",!1)}_startLoading(e,r){if(e.status===Ju.CANCELLED)return!1;let i,n;switch(e.startTime=performance.now(),e.status=Ju.DOWNLOADING,e.docType){case"binary":n="array-buffer",i=0;break;case"image":n="image";break;case"image+type":n="array-buffer";break;default:n="json"}e.abortController=new AbortController;const s=e.abortController.signal;e.request=kn(e.url,{...e.options,responseType:n,timeout:i,signal:s});let o=()=>{};const a=c=>{e.duration=performance.now()-e.startTime,e.size=c instanceof ArrayBuffer?c.byteLength:e.size||0,e.result=c,this._frameTask?this._onLoadQueue.push({callback:r,task:e}):(e.abortController=null,r(e))},l=c=>{e.status===Ju.DOWNLOADING&&r(e,c),o()};return e.docType!=="image+type"?(e.request.then(c=>a(c.data),l),!0):(e.request.then(c=>{const u=c.data,d=Fft(u);if(n="image",e.size=u.byteLength,d==="unknown")return e.request=kn(e.url,{responseType:n,timeout:i,signal:s}),void e.request.then(y=>a(y.data),l);const p=new Blob([u],{type:d}),m=window.URL.createObjectURL(p);o=()=>window.URL.revokeObjectURL(m),e.request=kn(m,{responseType:n,timeout:i,signal:s}),e.request.then(y=>a(new Q8(y.data,d,o)),l)},l),!0)}get test(){return{loadQueue:this._loadQueue}}};h([f({readOnly:!0})],tN.prototype,"updating",void 0),tN=h([N("esri.views.3d.support.StreamDataLoader")],tN);const Nft={numRetries:0};function Fft(t){if(t.byteLength<2)return"unknown";const e=new Uint8Array(t,0,t.byteLength);return e[0]===137&&e[1]===80?"image/png":e[0]===71&&e[1]===73?"image/gif":e[0]===66&&e[1]===77?"image/bmp":e[0]===255&&e[1]===216?"image/jpeg":"unknown"}let Q8=class{constructor(e,r,i){this.image=e,this.type=r,this.release=i}get isOpaque(){return this.type==="image/jpeg"}},Uft=class extends $ft{constructor(e,r,i,n,s){super(n),this.url=e,this.options=r,this.docType=i,this.key=s,this.result=null,this.status=Ju.QUEUED,this.request=null,this.abortController=null,this.resolvers=new Array,this.startTime=0,this.numRetries=Nft.numRetries}};function kft(t,e,r){return`${t}:${e}:${r}`}var Ju;(function(t){t[t.QUEUED=1]="QUEUED",t[t.DOWNLOADING=2]="DOWNLOADING",t[t.DOWNLOADED=3]="DOWNLOADED",t[t.CANCELLED=4]="CANCELLED"})(Ju||(Ju={}));let rN=class extends xe{constructor(){super(...arguments),this.updating=!1}};function zft(t){return new bd({view:t})}h([f({readOnly:!0})],rN.prototype,"updating",void 0),rN=h([N("esri.views.3d.support.ResourceControllerMain")],rN);let bd=class extends rN{constructor(){super(...arguments),this._immediateTask=LS,this._normalTask=LS,this._updatingObjects=_R([]),this._frameTask=null}get immediate(){return this._immediateTask}get normal(){return this._normalTask}initialize(){this._scheduler=Aje(),this._memoryController=Rft(this.view),this._streamDataLoader=new tN,this._streamDataLoader.setup(Oft,Aft,this._scheduler),this.addHandles([ue(()=>{var e;return(e=this.view.state)==null?void 0:e.mode},e=>{e!=null&&(this._scheduler.state=e)},Br),ue(()=>this.view.stationary,()=>this._stationaryChangedHandler())]),this._frameTask=fS({update:e=>this._frame(e)}),this._immediateTask=this._scheduler.registerTask(dt.RESOURCE_CONTROLLER_IMMEDIATE),this._normalTask=this._scheduler.registerTask(dt.RESOURCE_CONTROLLER)}destroy(){this._immediateTask.remove(),this._normalTask.remove(),this._frameTask=Pi(this._frameTask),this._streamDataLoader=Me(this._streamDataLoader),this._memoryController=Me(this._memoryController),this._scheduler=Me(this._scheduler),this.view=null}get updating(){var e,r,i,n;return!!((e=this._memoryController)!=null&&e.updating||(r=this._streamDataLoader)!=null&&r.updating||(i=this._immediateTask)!=null&&i.updating)||((n=this._updatingObjects)==null?void 0:n.value.some(s=>s.updating))}get scheduler(){return this._scheduler}get memoryController(){return this._memoryController}createStreamDataRequester(e){const r=this._streamDataLoader;return{request:(i,n,s)=>r.request(i,n,e,s),get busy(){return!r.hasDownloadSlots(e)}}}addUpdatingObject(e){const r=this._updatingObjects;return r.value=[...r.value,e],Za(()=>{r.value=r.value.filter(i=>i!==e)})}_frame(e){this.view.suspended||this.view.stateManager&&(this.view.stateManager.step(OX(e.deltaTime)),!this._scheduler)||(this._scheduler.updateBudget(e)?(this._memoryController.update(),this._scheduler.frame()):this._memoryController.updating&&this._memoryController.update())}_stationaryChangedHandler(){this.memoryController.resetStableQuality()}get test(){return{getQueueStats:e=>this._streamDataLoader.test.loadQueue.getStatsForType(e)}}};h([f()],bd.prototype,"view",void 0),h([f()],bd.prototype,"_scheduler",void 0),h([f()],bd.prototype,"_memoryController",void 0),h([f()],bd.prototype,"_streamDataLoader",void 0),h([f()],bd.prototype,"_immediateTask",void 0),h([f()],bd.prototype,"_normalTask",void 0),h([f()],bd.prototype,"_updatingObjects",void 0),h([f({readOnly:!0})],bd.prototype,"updating",null),bd=h([N("esri.views.3d.support.ResourceControllerImpl")],bd);function Bft(t){return vOe(t)}function Vft(t){return"performanceInfo"in t}var sa,tt;(function(t){t[t.INSIDE=0]="INSIDE",t[t.INTERSECTS=1]="INTERSECTS",t[t.OUTSIDE=2]="OUTSIDE"})(sa||(sa={})),function(t){t[t.NORTH=0]="NORTH",t[t.NORTH_EAST=1]="NORTH_EAST",t[t.EAST=2]="EAST",t[t.SOUTH_EAST=3]="SOUTH_EAST",t[t.SOUTH=4]="SOUTH",t[t.SOUTH_WEST=5]="SOUTH_WEST",t[t.WEST=6]="WEST",t[t.NORTH_WEST=7]="NORTH_WEST"}(tt||(tt={}));const Fx=O(),Gft=O(),Sm=O(),Em=O();function jft(t,e,r=0){const i=t.extent;if(i==null)return!1;if(r===0)return Rye(i,e);const n=Math.min(i[2]-i[0],i[3]-i[1]);return o8e(i,e,r*n)}function jI(t,e,r,i){re(Fx,r),Fx[i]=e[i];const n=ae(Fx,Fx,e),s=ae(Gft,t,e),o=fe(s,n),a=fe(n,n);let l;l=o<=0?e:a<=o?r:oe(Fx,e,te(n,n,o/a));const c=ae(Fx,t,l);return Math.PI/2-Math.atan(c[2]/Math.sqrt(c[0]*c[0]+c[1]*c[1]))}function Hft(t,e,r){const i=t.extent;if(i==null)return 0;Sm[0]=i[0],Sm[1]=i[1],Sm[2]=r,Em[0]=i[2],Em[1]=i[3],Em[2]=r;let n=1/0,s=1/0;return e[0]Em[0]&&(n=jI(e,Em,Sm,0)),e[1]Em[1]&&(s=jI(e,Em,Sm,1)),Math.min(n,s)}function Wft(t,e,r){if(t==null)return DZ();if(t.spatialReference.isGeographic&&!G_(t.spatialReference))return new Y("tilingscheme:local-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in local scenes");const i=hc.checkUnsupported(t);if(i!=null)return i;if(r==null)return new Y("tilingscheme:extent-not-exist","The layer does not provide a layer extent.");const n=qft(t,r);if(n)return n;const s=t.spatialReference;return e==null||s.equals(e)||e.isWGS84&&s.isWebMercator?null:new Y("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the local scene")}function qft(t,e){const r=t.lods,i=r[0].resolution*2**r[0].level,n=[i*t.size[0],i*t.size[1]],s=[t.origin.x,t.origin.y],o=Aye(e),a=jt();hc.computeRowColExtent(o,n,s,a);const l=(a[2]-a[0])*(a[3]-a[1]);if(l>aT){const c=r[0].scale*2**r[0].level;let u=Math.max((o[3]-o[1])/t.size[1],(o[2]-o[0])/t.size[0])*c/i;const d=Math.floor(Math.log(u)/Math.log(10));return u=Math.ceil(u/10**d)*10**d,new Y("tilingscheme:too-many-root-tiles","Scale of level 0 of the tiling scheme (1:"+Math.floor(c).toLocaleString()+") is too large for the layer's extent. Suggested scale: 1:"+u.toLocaleString()+".",{level0Scale:c,suggestedLevel0Scale:u,requiredNumRootTiles:l,allowedNumRootTiles:aT})}return null}const Xft=Object.freeze(Object.defineProperty({__proto__:null,checkIfTileInfoSupportedForViewSR:Wft,isInsideExtent:jft,tiltToExtentEdge:Hft},Symbol.toStringTag,{value:"Module"}));function Yft(){return!0}function Zft(){return 0}function Qft(t,e){if(t==null)return DZ();const r=t.lods.length-1,i=t.spatialReference,n=G_(i)||nm(i)||sm(i);if(i.isWebMercator){if(!hc.makeWebMercatorAuxiliarySphere(r).compatibleWith(t))return new Y("tilingscheme:incompatible-global-web-mercator","The tiling scheme is not compatible with the ArcGIS Online Web Mercator tiling scheme")}else{if(!n)return new Y("tilingscheme:global-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in global scenes");if(!hc.makeGCSWithTileSize(t.spatialReference,t.size[0],r).compatibleWith(t))return t.spatialReference.isWGS84?new Y("tilingscheme:incompatible-global-wgs84","The tiling scheme is not compatible with the ArcGIS Online WGS84 tiling scheme"):new Y("tilingscheme:incompatible-global","The tiling scheme is not compatible with the ArcGIS Online tiling scheme")}return e==null||t.spatialReference.equals(e)?void 0:new Y("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the global scene")}const Jft=Object.freeze(Object.defineProperty({__proto__:null,checkIfTileInfoSupportedForViewSR:Qft,isInsideExtent:Yft,tiltToExtentEdge:Zft},Symbol.toStringTag,{value:"Module"})),Kft={[$e.Global]:Jft,[$e.Local]:Xft};function _f(t,e){t||console.warn("Terrain: "+e)}let cs=!1,Q5=!1;function emt(t){Q5=t,cs=cs||t}function tmt(t){cs=t}function be(t,e){var r;if(cs&&!t){const i=(r=new Error().stack)==null?void 0:r.slice(5);throw console.warn("Terrain internal: "+(e??"")+" at "+i),new Error("Assertion failed"+(e?": "+e:""))}}function gW(t){return J8(t)?{fullExtent:t.fullExtent,minScale:t.layer.minScale,maxScale:t.layer.maxScale,tilemapCache:null}:t.layer}function J5(t){return(t==null?void 0:t.type)==="imagery-tile"||(t==null?void 0:t.type)==="wcs"}function J8(t){return(t==null?void 0:t.type)==="imagery-tile-3d"}function uK(t){return(t==null?void 0:t.type)==="tile-3d"}function VR(t){return(t==null?void 0:t.type)==="vector-tile-3d"}function bOe(t){return(t==null?void 0:t.type)==="wmts-3d"}function yW(t){return(t==null?void 0:t.type)==="elevation-3d"}function BC(t){return(t==null?void 0:t.type)==="group"}function K5(t){return t&&(uK(t)||bOe(t)||J8(t)||VR(t))}function _W(t){return t&&(uK(t)||J8(t)||VR(t)||bOe(t))}function GR(t){return _W(t)||yW(t)}function rmt(t){var r;const e=(r=t==null?void 0:t.sourceLayerInfo)==null?void 0:r.data;return e!=null&&"type"in e&&e.type==="raster-tile"}function wOe(t){return xOe(t==null?void 0:t.sourceLayerInfo)}function imt(t){var r;const e=(r=t==null?void 0:t.sourceLayerInfo)==null?void 0:r.data;return e!=null&&"type"in e&&e.type==="tile-texture"}function nmt(t){var r;const e=(r=t==null?void 0:t.sourceLayerInfo)==null?void 0:r.data;return e instanceof HTMLImageElement||e instanceof Q8||e instanceof HTMLCanvasElement||e instanceof ImageData}function xOe(t){return(t==null?void 0:t.data)!=null&&"type"in t.data&&t.data.type==="vector-tile"}function YT(t){return t!=null&&"release"in t&&t.release(),null}function Tce(t){return t.fetchTile&&t.hasOverriddenFetchTile!==!1}function hK(t,e,r,i){return Kft[i].checkIfTileInfoSupportedForViewSR(t,r,e)}function K8(t,e,r){let i=null,n=null;if((t==null?void 0:t.type)==="wmts"){const s=smt(t,e,r);i=s.tileInfo,n=s.fullExtent}else{n=J5(t)?t.getCompatibleFullExtent(e):t.fullExtent;const s=r===$e.Local;if(J5(t))i=t.getCompatibleTileInfo(e,n,s);else if((t==null?void 0:t.type)==="vector-tile"){const o=s&&!omt(e)||amt.force512VTL,a=t.tileInfo.spatialReference.isGeographic;i=o?t.tileInfo:t.tileInfo.getOrCreateCompatible(256,a?1:2)}else i=t.tileInfo}return i!=null&&n!=null&&hK(i,n,e,r)==null?{tileInfo:i,fullExtent:n}:null}function smt(t,e,r){const i=MFe(t);if(i!=null){if(!ir.isCollection(i))return{tileInfo:i.tileInfo,fullExtent:i.fullExtent};{const n=i.find(s=>hK(s.tileInfo,s.fullExtent,e,r)==null);if(n)return{tileInfo:n.tileInfo,fullExtent:n.fullExtent}}}return{tileInfo:null,fullExtent:null}}function omt(t){return t.isWGS84||t.isWebMercator||S0e(t)||!eR(t)}const amt={force512VTL:!1};function Sce(t){return"["+t[0]+","+t[1]+","+t[2]+"]"}function Cm(t){return"("+t[0]+","+t[1]+","+t[2]+")"}function hh(t,e,r=umt){return Math.abs(t-e){(Bft(n)||GR(n))&&this.layerPerformanceInfos.push(new hmt(n,e))}),this.layerPerformanceInfos.sort((n,s)=>s.memory-n.memory)}},pmt=class{constructor(e){this._gltfLoading=new Map,this._wosrLoading=new Map,this._gltfMemCache=e("gltf-resources",()=>{}),this._wosrMemCache=e("wosr-resources",()=>{})}destroy(){this._gltfLoading.forEach(e=>e.abortController.abort()),this._wosrLoading.forEach(e=>e.abortController.abort()),this._gltfMemCache.destroy(),this._wosrMemCache.destroy()}loadGLTF(e,r,i){const n=i?`gltfPBR:${e}`:`gltf:${e}`,s=this._gltfMemCache.get(n);return s!=null?Promise.resolve(s):this._loadOnce(this._gltfLoading,this._gltfMemCache,n,o=>bAe(new _Ae(o.streamDataRequester),e,o,i),r)}loadWOSR(e,r){const i=`wosr:${e}:${r.disableTextures}`,n=this._wosrMemCache.get(i);return n!=null?Promise.resolve(n):this._loadOnce(this._wosrLoading,this._wosrMemCache,i,s=>wAe(e,s),r)}async _loadOnce(e,r,i,n,s){Bt(s);const o=pa(s,()=>this._abortLoad(e,i));let a=e.get(i);if(a)a.refCount++;else{const l=new AbortController;a={refCount:1,abortController:l,promise:n({...s,signal:l.signal})},e.set(i,a)}try{const l=await a.promise;return r.put(i,l,l.size),e.delete(i),Bt(s),l}finally{Pi(o)}}_abortLoad(e,r){const i=e.get(r);i!=null&&--i.refCount>0||(e.delete(r),i!=null&&i.abortController.abort())}},fmt=class extends lT{constructor(e,r,i){super(r,i),this._streamDataRequester=e}async fromUrl(e,r,i){Bt(i);const n=i!=null?i.signal:null,s=this.makeUid(e,r);let o=this._textureRequests.get(s);if(!o){const a=new AbortController,l=this._streamDataRequester.request(e,"image",{uid:s,signal:a.signal});o=new gwe,o.abortController=a;const c=o;this._textureRequests.set(s,o),o.textureAsync=l.then(async u=>{const d=this._createTexture(e,u,r);return c.texture=d,c.abortController=null,this._stage.add(d),await this._stage.load(d),{uid:s,texture:d,release:()=>this._release(s)}},u=>{throw c.abortController=null,u})}o.referenceCount++;try{return await AX(o.textureAsync,n)}catch(a){throw this._release(s),a}}_createTexture(e,r,i){var s;const n={width:r.width,height:r.height,wrap:{s:Pt.CLAMP_TO_EDGE,t:Pt.CLAMP_TO_EDGE},preMultiplyAlpha:!0};if(_0e(e)){if(i||r.width===0&&r.height===0){const o=r.width?r.height/r.width:1;i=i||64,o>1?(r.width=Math.round(i/o),r.height=i):(r.width=i,r.height=Math.round(i*o))}(s=this._stage.renderView)!=null&&s.renderingContext.driverTest.svgPremultipliesAlpha.result&&(n.preMultiplyAlpha=!1)}return new Hw(r,n)}},mmt=class{constructor(e){this.streamDataRequester=null,this._graphicsOwners=[],this._screenSizePerspectiveHandles=null,this.cimSymbolRasterizer=null,this._viewState=e.viewState,this._view=e.view,this._pointsOfInterest=e.pointsOfInterest,this.streamDataRequester=e.resourceController.createStreamDataRequester(Cf.SYMBOLOGY),this.objectResourceCache=new pmt((i,n)=>e.resourceController.memoryController.newCache(i,n)),this.textures=new fmt(this.streamDataRequester,e.view._stage,e.resourceController.scheduler);const r=Mr(this._view.spatialReference).radius;this.screenSizePerspectiveSettings=ZTe(e.viewingMode,r),this.screenSizePerspectiveSettingsLabels=uet(e.viewingMode,r)}destroy(){this.textures.destroy(),this.streamDataRequester=null}addGraphicsOwner(e){if(!e)return Za();this._graphicsOwners.push(e);const r=ue(()=>{var i;return(i=e.layer)==null?void 0:i.screenSizePerspectiveEnabled},()=>this._updateScreenSizePerspectiveEnabled());return this._updateScreenSizePerspectiveEnabled(),Za(()=>{r.remove(),qO(this._graphicsOwners,e),this._updateScreenSizePerspectiveEnabled()})}_updateScreenSizePerspectiveEnabled(){const e=this._graphicsOwners.some(r=>{var i;return((i=r.layer)==null?void 0:i.screenSizePerspectiveEnabled)===!0});if(e&&!this._screenSizePerspectiveHandles){this._screenSizePerspectiveHandles=new Vi;const r=()=>this._updateScreenSizePerspectiveSettings();this._screenSizePerspectiveHandles.add([ue(()=>this._pointsOfInterest.centerOnSurfaceInfrequent.distance,r,Br),this._viewState.events.on("camera-projection-changed",r)]),this._updateScreenSizePerspectiveSettings()}else e||(this._screenSizePerspectiveHandles=Me(this._screenSizePerspectiveHandles))}_updateScreenSizePerspectiveSettings(){const e=this._pointsOfInterest;HI.distance=e.centerOnSurfaceInfrequent.distance,HI.fovY=this._viewState.camera.fovY,this.screenSizePerspectiveSettings.update(HI),this.screenSizePerspectiveSettingsLabels.update(HI),this._view._stage.renderView.requestRender()}get test(){return{screenSizePerspectiveHandles:this._screenSizePerspectiveHandles}}};const HI={distance:0,fovY:0};let I2=class{constructor(e,r,i=""){this.graphics=e,this._symbol=new n_({symbolLayers:[new i_({material:{color:r},outline:{color:[255,255,255],size:1},resource:{primitive:"circle"}}),new Uw({text:i,halo:{color:"white",size:1/.75},material:{color:r},size:12})]})}show(e,r){if(r==null)return;this.hide();const i=new ze({x:e[0],y:e[1],z:e[2],spatialReference:r});this._graphic=new z_({geometry:i,symbol:this._symbol}),this.graphics.add(this._graphic)}hide(){this._graphic!=null&&(this.graphics.remove(this._graphic),this._graphic=null)}},Xy=class extends xe{constructor(e){super(e),this.handles=new Vi}destroy(){this.handles.destroy()}};h([f({constructOnly:!0})],Xy.prototype,"renderCoordsHelper",void 0),h([f({constructOnly:!0})],Xy.prototype,"surface",void 0),h([f({constructOnly:!0})],Xy.prototype,"state",void 0),Xy=h([N("esri.views.3d.support.PointOfInterest")],Xy);const gmt=Array;let wd=class extends Xy{constructor(e){super(e),this._dirty=!1,this._propertiesPool=new jg({location:ze,renderLocation:gmt},this),this._estimatedSurfaceAltitude=0,this._pendingElevationQueryController=null,this.renderLocation=O(),this._tmpPoint=new ze}initialize(){if(this.scheduler&&this.handles.add(this.scheduler.registerTask(this.task,this)),this.runTask(),this.map){const e=()=>this._setDirty();this.handles.add(Ol(()=>{var r,i;return(i=(r=this.map)==null?void 0:r.ground)==null?void 0:i.layers},"change",e,{onListenerAdd:e,onListenerRemove:e}))}this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=Me(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const e=this._propertiesPool.get("location");return this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e,this.state.spatialReference),e}get scale(){const e=this._camera,r=ci(e.eye,this.renderLocation),i={renderCoordsHelper:this.renderCoordsHelper,state:{camera:e}};return mw(i,r,0)}get updating(){return this._dirty||this._pendingElevationQueryController!=null}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0,this.notifyChange("updating"))}_cancelPendingRequest(){const e=this._pendingElevationQueryController;e&&(this._pendingElevationQueryController=null,e.abort(),this.notifyChange("updating"))}get running(){return!this._pendingElevationQueryController&&this._dirty}runTask(){if(this._cancelPendingRequest(),this._dirty=!1,this.notifyChange("updating"),!this.map||!this.map.ground)return this._updateSurfaceAltitude(0),Ho.YIELD;const e=this.state.spatialReference;this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint,e);const r=(this._tmpPoint.z??0)>ymt&&this.renderCoordsHelper.viewingMode===$e.Global&&(e.isWGS84||e.isWebMercator);let i=new AbortController;return this.map.ground.queryElevation(this._tmpPoint,{signal:i.signal,cache:this.cache,minDemResolution:r?_mt:0}).then(n=>this._updateSurfaceAltitude(n.geometry.z??0)).catch(n=>{Zn(n)||this._updateSurfaceAltitude(0)}).catch(()=>{}).then(()=>{this._pendingElevationQueryController===i&&(this._pendingElevationQueryController=null,this.notifyChange("updating")),i=null}),this._pendingElevationQueryController=i,Ho.YIELD}_updateSurfaceAltitude(e){this._estimatedSurfaceAltitude!==e&&(this._estimatedSurfaceAltitude=e,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(Mz,this._estimatedSurfaceAltitude,this._camera.eye),Bo(this._get("renderLocation"),Mz)||(this._set("renderLocation",re(this._propertiesPool.get("renderLocation"),Mz)),this.notifyChange("renderLocation"))}};h([f({constructOnly:!0})],wd.prototype,"scheduler",void 0),h([f({constructOnly:!0})],wd.prototype,"cache",void 0),h([f({constructOnly:!0})],wd.prototype,"task",void 0),h([f({readOnly:!0})],wd.prototype,"location",null),h([f({constructOnly:!0})],wd.prototype,"map",void 0),h([f({readOnly:!0})],wd.prototype,"renderLocation",void 0),h([f({readOnly:!0})],wd.prototype,"scale",null),h([f({readOnly:!0})],wd.prototype,"updating",null),wd=h([N("esri.views.3d.support.CameraOnSurface")],wd);const Mz=O(),ymt=1e5,_mt=1e6,vmt=Array;let Ku=class extends Xy{constructor(e){super(e),this._propertiesPool=new jg({location:ze,renderLocation:vmt},this),this._currentSurfaceAltitude=0,this._latestSurfaceAltitude=0,this.distance=0,this.renderLocation=O(),this.updating=!1}initialize(){this._frameWorker=this.scheduler.registerTask(this.task,this),this.runTask()}destroy(){this._frameWorker=Pi(this._frameWorker),this._propertiesPool=Me(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const e=this._propertiesPool.get("location");return this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e,this.state.spatialReference),e}updateRenderLocation(){this.updating=!0,this._updateRenderLocation()}get estimatedSurfaceAltitude(){return this._latestSurfaceAltitude}get running(){return this.updating}runTask(){return this._latestSurfaceAltitude=this.estimateSurfaceAltitudeAtCenter(),this._updateRenderLocation(),this.updating=!1,Ho.YIELD}_updateRenderLocation(){const e=wmt;let r=this._calculateSurfaceIntersection(this._currentSurfaceAltitude,e);const i=this._currentSurfaceAltitude!==this._latestSurfaceAltitude;!r&&i&&(r=this._calculateSurfaceIntersection(this._latestSurfaceAltitude,e),r&&(this._currentSurfaceAltitude=this._latestSurfaceAltitude));const n=xmt;r&&this._latestSurfaceAltitudeChangesDistanceSignificantly(e,n)&&(re(e,n),this._currentSurfaceAltitude=this._latestSurfaceAltitude),r?this.distance=ci(this._camera.eye,e):(te(e,this._camera.viewForward,this._get("distance")),oe(e,e,this._camera.eye)),Bo(this._get("renderLocation"),e)||this._set("renderLocation",re(this._propertiesPool.get("renderLocation"),e))}_calculateSurfaceIntersection(e,r){var n,s;const i=this._camera;if(!this.renderCoordsHelper.intersectManifold(i.ray,e,r))return!1;if(this.state.isGlobal){const o=Mr(this.renderCoordsHelper.spatialReference).radius,a=o+e,l=la(i.eye),c=lo/4){const d=a-Math.sqrt(l);return te(r,i.viewForward,d),oe(r,r,i.eye),!0}}else{const o=(n=this.surface)!=null&&n.ready?this.surface.extent:null;o!=null&&RP(o,(s=this.surface)==null?void 0:s.spatialReference,VC,this.renderCoordsHelper.spatialReference)&&(r[0]=ge(r[0],VC[0],VC[2]),r[1]=ge(r[1],VC[1],VC[3]))}return!0}_latestSurfaceAltitudeChangesDistanceSignificantly(e,r){if(this._latestSurfaceAltitude===this._currentSurfaceAltitude||e==null)return!1;if(this._calculateSurfaceIntersection(this._latestSurfaceAltitude,r)){if(Kr.TESTS_DISABLE_OPTIMIZATIONS)return!0;const i=this._camera.eye,n=ci(i,e),s=ci(i,r);if(Math.abs(s-n)/n>bmt)return!0}return!1}};h([f({constructOnly:!0})],Ku.prototype,"scheduler",void 0),h([f({constructOnly:!0})],Ku.prototype,"task",void 0),h([f()],Ku.prototype,"distance",void 0),h([f({constructOnly:!0})],Ku.prototype,"estimateSurfaceAltitudeAtCenter",void 0),h([f({readOnly:!0})],Ku.prototype,"location",null),h([f({readOnly:!0})],Ku.prototype,"renderLocation",void 0),h([f()],Ku.prototype,"updating",void 0),Ku=h([N("esri.views.3d.support.CenterOnSurface")],Ku);const bmt=.05,wmt=O(),xmt=O(),VC=jt();let Tmt=class{constructor(e){this._handles=new Vi,this.events=new Bn,this._contentLayerViews=e.contentLayerViews,this._handles.add(this._contentLayerViews.on("change",r=>this._layerViewsChanged(r))),this._layerViewsChanged({added:this._contentLayerViews.toArray(),removed:[],moved:[],target:this._contentLayerViews})}destroy(){this._handles=Me(this._handles),this._contentLayerViews.destroy()}_layerViewsChanged(e){e.added.forEach(r=>{r.declaredClass==="esri.views.3d.layers.SceneLayerView3D"&&this._handles.add(r.on("visible-geometry-changed",()=>this._contentChanged()),r.uid)}),e.removed.forEach(r=>this._handles.remove(r.uid))}_contentChanged(){this.events.emit("request-update",Smt)}};const Smt={},Emt=Array;let lf=class extends Xy{constructor(e){super(e),this._propertiesPool=new jg({location:ze,renderLocation:Emt},this),this._dirty=!0,this.renderLocation=this._propertiesPool.get("renderLocation")}initialize(){this.handles.add([ue(()=>this.centerOnSurface.renderLocation,()=>this.updateRenderLocation()),ue(()=>this.state.contentCamera,()=>this.updateRenderLocation())]),this.scheduler&&this.handles.add(this.scheduler.registerTask(dt.POINT_OF_INTEREST_FREQUENT,this))}destroy(){this._propertiesPool=Me(this._propertiesPool)}get updating(){return this._dirty||this.centerOnSurface.updating}get location(){const e=this._propertiesPool.get("location");return this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e,this.state.spatialReference),e}get running(){return this._dirty}runTask(){const e=this._get("renderLocation"),r=this.centerOnSurface.renderLocation,i=this.renderCoordsHelper,n=this.state.contentCamera;this._dirty=!1,i.worldUpAtPosition(r,Rce);const s=Math.max(0,(Math.acos(fe(Rce,n.viewForward))-.5*Math.PI)*(n.aboveGround?1:-1));if(Number.isNaN(s)){if(!e||!N_(e,r)){const c=this._propertiesPool.get("renderLocation");re(c,r),this._set("renderLocation",c)}return Ho.YIELD}const o=1-ge(s/(.5*Math.PI),0,1),a=o*o*o;this._calculateScreenHorizontalEdgeOnSurface(Pce);const l=this._propertiesPool.get("renderLocation");return Lr(l,r,Pce,a),e&&N_(e,l)||this._set("renderLocation",l),Ho.YIELD}_calculateScreenHorizontalEdgeOnSurface(e){const r=this.state.contentCamera,i=r.getRenderCenter(Vo());if(i[1]=r.aboveGround?r.padding[Yt.BOTTOM]:r.fullHeight-r.padding[Yt.TOP],this.estimateSurfaceIntersectionAtRenderPoint(i,e))return e;const n=this.renderCoordsHelper.getAltitude(this.centerOnSurface.renderLocation);if(r.unprojectFromRenderScreen(i,GC)){ae(GC,GC,r.eye);const s=me(GC,GC);if(this.renderCoordsHelper.intersectManifold(bu(r.eye,s),n,e))return e}return this.renderCoordsHelper.setAltitude(e,n,r.eye)}updateRenderLocation(){this._dirty=!0}};h([f()],lf.prototype,"_dirty",void 0),h([f({constructOnly:!0})],lf.prototype,"scheduler",void 0),h([f({constructOnly:!0})],lf.prototype,"centerOnSurface",void 0),h([f({constructOnly:!0})],lf.prototype,"estimateSurfaceIntersectionAtRenderPoint",void 0),h([f({readOnly:!0})],lf.prototype,"updating",null),h([f({readOnly:!0})],lf.prototype,"location",null),h([f({readOnly:!0})],lf.prototype,"renderLocation",void 0),lf=h([N("esri.views.3d.support.pointsOfInterest.Focus")],lf);const Rce=O(),GC=O(),Pce=O();let jm=class extends xe{get surface(){var e;return(e=this.view.map)==null?void 0:e.ground}get surfaceView(){return this.view.basemapTerrain}get renderLocation(){if(!this.location)return null;const e=O();return this.view.renderCoordsHelper.toRenderCoords(this.location,e),e}constructor(e){super(e),this.location=null,this._updateController=null,this._handles=new Vi}initialize(){this.view.state.isLocal&&(this._handles.add([ue(()=>{var e,r;return[(e=this.surfaceView)==null?void 0:e.spatialReference,(r=this.surfaceView)==null?void 0:r.extent]},()=>this._update()),Ol(()=>{var e;return(e=this.surface)==null?void 0:e.layers},"change",()=>this._update())]),this._update())}destroy(){this._handles.destroy()}_update(){if(this._updateController&&(this._updateController.abort(),this._updateController=null),!this.surfaceView||this.surfaceView.extent==null||this.surfaceView.spatialReference==null)return void this._set("location",null);const e=vY(this.surfaceView.extent),r=new ze({x:e[0],y:e[1],z:0,spatialReference:this.surfaceView.spatialReference});this.surface&&this.surface.layers.length>0?(this._set("location",null),this._updateController=new AbortController,this.surface.queryElevation(r,{noDataValue:0,signal:this._updateController.signal,cache:this.cache}).then(i=>{this._updateController=null,this._set("location",i.geometry)}).catch(i=>{Zn(i)||i&&i.name==="elevation-query:invalid-layer"||console.error("StableSurfaceCenter failed to update: ",i)})):this._set("location",r)}};h([f({constructOnly:!0})],jm.prototype,"view",void 0),h([f({constructOnly:!0})],jm.prototype,"cache",void 0),h([f()],jm.prototype,"surface",null),h([f()],jm.prototype,"surfaceView",null),h([f({readOnly:!0})],jm.prototype,"location",void 0),h([f({readOnly:!0})],jm.prototype,"renderLocation",null),jm=h([N("esri.views.3d.terrain.StableSurfaceCenter")],jm);let Hm=class extends xe{constructor(e){super(e),this._tileGeometryUpdateExtent=Ih(),this._tileGeometryUpdateSpatialReference=null,this.events=new Bn,this.updating=!1}initialize(){this.addHandles([this.surface.on("elevation-change",e=>this._tileGeometryChanged(e)),this.scheduler.registerTask(dt.SURFACE_GEOMETRY_UPDATES,this)])}get running(){return this.updating}runTask(){return this.updating&&(this._tileGeometryUpdateSpatialReference&&this._centerIntersectsExtent(this._tileGeometryUpdateExtent,this._tileGeometryUpdateSpatialReference)&&this.events.emit("request-update",Cmt),Ih(this._tileGeometryUpdateExtent),this._set("updating",!1)),Ho.YIELD}_tileGeometryChanged(e){this._tileGeometryUpdateSpatialReference=e.spatialReference,S_(this._tileGeometryUpdateExtent,e.extent,this._tileGeometryUpdateExtent),this._set("updating",!0)}_furthestCenterOnSurface(){let e=this.centerOnSurfaces[0];for(let r=1;re.distance&&(e=i)}return e}_centerIntersectsExtent(e,r){const i=this.state.contentCamera.eye,n=Amt,s=this._furthestCenterOnSurface();return this.renderCoordsHelper.fromRenderCoords(i,Q1,r),this.renderCoordsHelper.fromRenderCoords(s.renderLocation,J1,r),Q1[0]this._estimateSurfaceAltitudeAtCenter(),o=this.view.resourceController.scheduler,a=(u=this.view.basemapTerrain)==null?void 0:u.elevationQueryCache,l={state:e,scheduler:o,surface:r,renderCoordsHelper:i};this._set("centerOnSurfaceInfrequent",new Ku({...l,task:dt.POINT_OF_INTEREST_INFREQUENT,estimateSurfaceAltitudeAtCenter:s})),this._set("centerOnSurfaceFrequent",new Ku({...l,task:dt.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:s})),this._set("centerOnContent",new Ku({...l,task:dt.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:()=>this._estimateContentAltitudeAtCenter()})),this._set("cameraOnSurface",new wd({...l,cache:a,task:dt.POINT_OF_INTEREST_INFREQUENT,map:n})),this._set("surfaceGeometryUpdates",new Hm({...l,centerOnSurfaces:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]})),this._set("contentGeometryUpdates",new Tmt({contentLayerViews:this.view.allLayerViews,renderCoordsHelper:i})),this._set("surfaceOrigin",new jm({cache:a,view:this.view})),this._set("focus",new lf({state:e,scheduler:o,surface:r,renderCoordsHelper:i,centerOnSurface:this.centerOnSurfaceFrequent,estimateSurfaceIntersectionAtRenderPoint:(d,p)=>this._estimateSurfaceIntersectionAtRenderPoint(d,this.view.state.contentCamera,p)})),this._pois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.cameraOnSurface,this.focus);const c=this.view.graphics;this._debugCenters.set(this.centerOnContent,new I2(c,"red","CenterOnContent")),this._debugCenters.set(this.centerOnSurfaceFrequent,new I2(c,"red","CenterOnSurface")),this._debugCenters.set(this.centerOnSurfaceInfrequent,new I2(c,"red","CenterOnSurface")),this._debugCenters.set(this.cameraOnSurface,new I2(c,"blue","CameraOnSurface")),this._debugCenters.set(this.focus,new I2(c,"green","Focus")),this._handles.add([ue(()=>e.contentCamera,d=>this._cameraChanged(d),Br),ue(()=>r.extent,()=>this._updateCenterPointsOfInterest()),Dh(()=>!r.updating,()=>this._updateCenterPointsOfInterest(),Br),Ol(()=>this.surfaceGeometryUpdates.events,"request-update",()=>this._updateCenterPointsOfInterest()),Ol(()=>this.contentGeometryUpdates.events,"request-update",()=>this._updateCenterOnContent()),Dh(()=>Kr.SHOW_POI,d=>this._setDebug(d),Pr)]),this._cameraChanged(this.view.state.contentCamera);for(const d of this._pois)d.runTask()}destroy(){this._setDebug(!1),this._handles.destroy(),this._propertiesPool.destroy();for(const e of this._pois)e.destroy();this.surfaceOrigin.destroy()}get updating(){var e;return!(!((e=this.surfaceGeometryUpdates)!=null&&e.updating)&&!this._pois.some(r=>r.updating))}get _centerRay(){return this._centerRayDirty&&(this._centerRayCached=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(this.view.state.contentCamera,this._tmpRay),this._centerRayDirty=!1),this._centerRayCached}_estimateContentAltitudeAtCenter(){if(!this._contentAltitudeAtCenterDirty)return this._contentAltitudeAtCenter;this._contentAltitudeAtCenterDirty=!1;const e=this._centerRay;return e==null||(this.view.sceneIntersectionHelper.intersectRay(e,this._contentIntersector,Ux,Pmt)?this._contentAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(Ux):this._contentAltitudeAtCenter=this._estimateSurfaceAltitudeAtCenter()),this._contentAltitudeAtCenter}_estimateSurfaceAltitudeAtCenter(){if(!this.view.basemapTerrain)return 0;if(!this._surfaceAltitudeAtCenterDirty)return this._surfaceAltitudeAtCenter;this._surfaceAltitudeAtCenterDirty=!1;const e=this._centerRay;if(e==null)return this._surfaceAltitudeAtCenter;const r=e.origin,i=oe(Ux,e.origin,e.direction);return this._surfaceIntersector.resetWithRay(e,this.view.state.contentCamera),this.view.basemapTerrain.intersect(this._surfaceIntersector,null,r,i),this._surfaceIntersector.results.min.getIntersectionPoint(Ux)&&(this._surfaceAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(Ux)),this._surfaceAltitudeAtCenter}_estimateSurfaceIntersectionAtRenderPoint(e,r,i){const n=LQ(r,e,Rmt);if(n==null)return null;const s=n.origin,o=oe(Ux,n.origin,n.direction);return this._surfaceIntersector.resetWithRay(n,r),this.view.basemapTerrain.intersect(this._surfaceIntersector,null,s,o),this._surfaceIntersector.results.min.getIntersectionPoint(i)?i:null}_cameraChanged(e){this._updateCenterPointsOfInterest();const r=e.eye;Bo(this.renderPointOfView,r)||this._set("renderPointOfView",re(this._propertiesPool.get("renderPointOfView"),r))}_updateCenterPointsOfInterest(){this._centerRayDirty=!0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenterDirty=!0;for(const e of this._pois)e.updateRenderLocation()}_updateCenterOnContent(){this._contentAltitudeAtCenterDirty=!0,this.centerOnContent.updateRenderLocation()}_setDebug(e){if(!e)return this._debugCenters.forEach(r=>r.hide()),void this._handles.remove("debug");for(const r of this._pois)this._handles.add(ue(()=>r.renderLocation,i=>{var n;return(n=this._debugCenters.get(r))==null?void 0:n.show(i,r.renderCoordsHelper.spatialReference)},Pr),"debug")}get test(){return{update:()=>{this.surfaceGeometryUpdates.runTask();for(const e of this._pois)e.runTask()},surfaceGeometryUpdates:this.surfaceGeometryUpdates}}};h([f({readOnly:!0})],yl.prototype,"centerOnContent",void 0),h([f({readOnly:!0})],yl.prototype,"centerOnSurfaceFrequent",void 0),h([f({readOnly:!0})],yl.prototype,"centerOnSurfaceInfrequent",void 0),h([f({readOnly:!0})],yl.prototype,"cameraOnSurface",void 0),h([f({readOnly:!0})],yl.prototype,"focus",void 0),h([f({readOnly:!0})],yl.prototype,"renderPointOfView",void 0),h([f({readOnly:!0})],yl.prototype,"surfaceOrigin",void 0),h([f({readOnly:!0})],yl.prototype,"contentGeometryUpdates",void 0),h([f({readOnly:!0})],yl.prototype,"surfaceGeometryUpdates",void 0),h([f({constructOnly:!0})],yl.prototype,"view",void 0),h([f({readOnly:!0})],yl.prototype,"updating",null),yl=h([N("esri.views.3d.support.PointsOfInterest")],yl);const Omt=Array,Ux=O(),Rmt=qs(),Pmt={exclude:new Set([jy])},HR=new ir,SO=new WeakMap;function Mmt(t){TOe(t)&&HR.push(t)}function $mt(t){TOe(t)&&HR.includes(t)&&HR.remove(t)}function TOe(t){return t!=null&&typeof t=="object"&&"refreshInterval"in t&&"refresh"in t}function SOe(t,e){return Number.isFinite(t)&&Number.isFinite(e)?e<=0?t:SOe(e,t%e):0}let $z=0,WI=0;function Imt(){const t=Date.now();for(const e of HR)e.refreshInterval&&t-(SO.get(e)??0)+5>=6e4*e.refreshInterval&&(SO.set(e,t),e.refresh(t))}Lge(()=>{const t=Date.now();let e=0;for(const r of HR)e=SOe(Math.round(6e4*r.refreshInterval),e),r.refreshInterval?SO.get(r)||SO.set(r,t):SO.delete(r);if(e!==WI){if(WI=e,clearInterval($z),WI===0)return void($z=0);$z=setInterval(Imt,WI)}});function Lmt(t){return t!=null&&typeof t=="object"&&"refreshTimestamp"in t&&"refresh"in t}const AFt=t=>{let e=class extends t{constructor(...r){super(...r),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=Age(()=>this.hasDataChanged()),this.when().then(()=>{this.destroyed||Mmt(this)},()=>{})}destroy(){$mt(this)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(r=Date.now()){_V(this._debounceHasDataChanged()).then(i=>{i&&this._set("refreshTimestamp",r),this.emit("refresh",{dataChanged:i})},i=>{J.getLogger(this).error(i),this.emit("refresh",{dataChanged:!1,error:i})})}async hasDataChanged(){return!0}};return h([f({type:Number,cast:r=>r>=.1?r:r<=0?0:.1,json:{write:!0}})],e.prototype,"refreshInterval",void 0),h([f({readOnly:!0})],e.prototype,"refreshTimestamp",void 0),h([f()],e.prototype,"refreshParameters",null),e=h([N("esri.layers.mixins.RefreshableLayer")],e),e};let Dmt=class{constructor(e){this._store=e}destroy(){this._store.destroy()}get(e){return this._store.get(e)}put(e,r){this._store.put(e,r,r.values.byteLength+256)}},Nmt=class{constructor(e,r,i,n){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in e?(this.values=e.pixelData,this.width=e.width,this.height=e.height,this.noDataValue=e.noDataValue):(this.values=e,this.width=r,this.height=i,this.noDataValue=n)}get hasNoDataValues(){if(this._hasNoDataValues==null){const e=this.noDataValue;this._hasNoDataValues=this.values.includes(e)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}_ensureBounds(){if(this._minValue!=null)return;const{noDataValue:e,values:r}=this;let i=1/0,n=-1/0,s=!0;for(const o of r)o===e?this._hasNoDataValues=!0:(i=on?o:n,s=!1);s?(this._minValue=0,this._maxValue=0):(this._minValue=i,this._maxValue=n>-3e38?n:0)}},EOe=class{constructor(e,r,i,n,s={}){this._mainMethod=r,this._transferLists=i,this._listeners=[],this._promise=iBe(e,{...s,schedule:n}).then(o=>{if(this._thread===void 0){this._thread=o,this._promise=null,s.hasInitialize&&this.broadcast({},"initialize");for(const a of this._listeners)this._connectListener(a)}else o.close()}),this._promise.catch(o=>J.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${o}`))}on(e,r){const i={removed:!1,eventName:e,callback:r,threadHandle:null};return this._listeners.push(i),this._connectListener(i),Za(()=>{i.removed=!0,vX(this._listeners,i),this._thread&&i.threadHandle!=null&&i.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null,this._listeners.length=0,this._transferLists={}}invoke(e,r){return this.invokeMethod(this._mainMethod,e,r)}invokeMethod(e,r,i){if(this._thread){const n=this._transferLists[e],s=n?n(r):[];return this._thread.invoke(e,r,{transferList:s,signal:i})}return this._promise?this._promise.then(()=>(Bt(i),this.invokeMethod(e,r,i))):Promise.reject(null)}broadcast(e,r){return this._thread?Promise.all(this._thread.broadcast(r,e)).then(()=>{}):this._promise?this._promise.then(()=>this.broadcast(e,r)):Promise.reject()}get promise(){return this._promise}_connectListener(e){this._thread&&this._thread.on(e.eventName,e.callback).then(r=>{e.removed||(e.threadHandle=r)})}},Mce=class extends EOe{constructor(e=null){super("LercWorker","_decode",{_decode:r=>[r.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,r,i){return e&&e.byteLength!==0?this.invoke({buffer:e,options:r},i):Promise.resolve(null)}release(){--this.ref<=0&&(EO.forEach((e,r)=>{e===this&&EO.delete(r)}),this.destroy())}};const EO=new Map;function Fmt(t=null){let e=EO.get(t);return e||(t!=null?(e=new Mce(r=>t.immediate.schedule(r)),EO.set(t,e)):(e=new Mce,EO.set(null,e))),++e.ref,e}var lc,$ce,Ice;(function(t){t[t.FILL=1]="FILL",t[t.LINE=2]="LINE",t[t.SYMBOL=3]="SYMBOL",t[t.CIRCLE=4]="CIRCLE"})(lc||(lc={})),function(t){t[t.BACKGROUND=0]="BACKGROUND",t[t.FILL=1]="FILL",t[t.OUTLINE=2]="OUTLINE",t[t.LINE=3]="LINE",t[t.ICON=4]="ICON",t[t.CIRCLE=5]="CIRCLE",t[t.TEXT=6]="TEXT",t[t.TILEINFO=7]="TILEINFO"}($ce||($ce={})),function(t){t[t.PAINTER_CHANGED=0]="PAINTER_CHANGED",t[t.LAYOUT_CHANGED=1]="LAYOUT_CHANGED",t[t.LAYER_CHANGED=2]="LAYER_CHANGED",t[t.LAYER_REMOVED=3]="LAYER_REMOVED",t[t.SPRITES_CHANGED=4]="SPRITES_CHANGED"}(Ice||(Ice={}));let Umt=class{constructor(e){this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=e}},IFt=class{constructor(){this.tileSymbols=[],this.parts=[{startTime:0,startOpacity:0,targetOpacity:0,show:!1},{startTime:0,startOpacity:0,targetOpacity:0,show:!1}],this.show=!1}};function DFt(t,e,r,i,n,s){const o=r-n;if(o>=0)return(e>>o)+(i-(s<>o);const a=-o;return e-(s-(i<>a)<0){this.patternMap=new Map;for(let o=0;o0}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=Le(this.vao)}doPrepareForRendering(e,r,i){const n=new Uint32Array(r),s=new Int32Array(n.buffer),o=n[i++],a=Ar.createVertex(e,gr.STATIC_DRAW,new Int32Array(s.buffer,4*i,o));i+=o;const l=n[i++],c=Ar.createIndex(e,gr.STATIC_DRAW,new Uint32Array(n.buffer,4*i,l));i+=l;const u=this.layer.lineMaterial;this.vao=new Fh(e,u.getAttributeLocations(),u.getLayoutInfo(),{geometry:a},c)}},Vmt=class extends eU{constructor(e,r){super(e,r),this.type=lc.FILL,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const i=new Uint32Array(e);let n=this.bufferDataOffset;this.fillIndexStart=i[n++],this.fillIndexCount=i[n++],this.outlineIndexStart=i[n++],this.outlineIndexCount=i[n++];const s=i[n++];if(s>0){this.patternMap=new Map;for(let o=0;o0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){this.fillVAO=Le(this.fillVAO),this.outlineVAO=Le(this.outlineVAO)}doPrepareForRendering(e,r,i){const n=new Uint32Array(r),s=new Int32Array(n.buffer),o=n[i++],a=Ar.createVertex(e,gr.STATIC_DRAW,new Int32Array(s.buffer,4*i,o));i+=o;const l=n[i++],c=Ar.createIndex(e,gr.STATIC_DRAW,new Uint32Array(n.buffer,4*i,l));i+=l;const u=n[i++],d=Ar.createVertex(e,gr.STATIC_DRAW,new Int32Array(s.buffer,4*i,u));i+=u;const p=n[i++],m=Ar.createIndex(e,gr.STATIC_DRAW,new Uint32Array(n.buffer,4*i,p));i+=p;const y=this.layer,_=y.fillMaterial,v=y.outlineMaterial;this.fillVAO=new Fh(e,_.getAttributeLocations(),_.getLayoutInfo(),{geometry:a},c),this.outlineVAO=new Fh(e,v.getAttributeLocations(),v.getLayoutInfo(),{geometry:d},m)}},Gmt=class extends eU{constructor(e,r,i){super(e,r),this.type=lc.SYMBOL,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const n=new Uint32Array(e),s=new Int32Array(e),o=new Float32Array(e);let a=this.bufferDataOffset;this.isIconSDF=!!n[a++];const l=n[a++];for(let p=0;p0||this.glyphPerPageElementsMap.size>0}triangleCount(){let e=0;for(const[r,i]of this.iconPerPageElementsMap)e+=i[1];for(const[r,i]of this.glyphPerPageElementsMap)e+=i[1];return e/3}doDestroy(){this.iconVAO=Le(this.iconVAO),this.textVAO=Le(this.textVAO)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const e=this.iconOpacity,r=this.iconVAO.vertexBuffers.opacity;e.length>0&&e.byteLength===r.byteLength&&r.setSubData(e,0,0,e.length);const i=this.textOpacity,n=this.textVAO.vertexBuffers.opacity;i.length>0&&i.byteLength===n.byteLength&&n.setSubData(i,0,0,i.length)}doPrepareForRendering(e,r,i){const n=new Uint32Array(r),s=new Int32Array(n.buffer),o=n[i++],a=Ar.createVertex(e,gr.STATIC_DRAW,new Int32Array(s.buffer,4*i,o));i+=o;const l=n[i++],c=Ar.createIndex(e,gr.STATIC_DRAW,new Uint32Array(n.buffer,4*i,l));i+=l;const u=n[i++],d=Ar.createVertex(e,gr.STATIC_DRAW,new Int32Array(s.buffer,4*i,u));i+=u;const p=n[i++],m=Ar.createIndex(e,gr.STATIC_DRAW,new Uint32Array(n.buffer,4*i,p));i+=p;const y=Ar.createVertex(e,gr.STATIC_DRAW,this.iconOpacity.buffer),_=Ar.createVertex(e,gr.STATIC_DRAW,this.textOpacity.buffer),v=this.layer,b=v.iconMaterial,x=v.textMaterial;this.iconVAO=new Fh(e,b.getAttributeLocations(),b.getLayoutInfo(),{geometry:a,opacity:y},c),this.textVAO=new Fh(e,x.getAttributeLocations(),x.getLayoutInfo(),{geometry:d,opacity:_},m)}},jmt=class extends eU{constructor(e,r){super(e,r),this.type=lc.CIRCLE,this.circleIndexStart=0,this.circleIndexCount=0;const i=new Uint32Array(e);let n=this.bufferDataOffset;this.circleIndexStart=i[n++],this.circleIndexCount=i[n++],this.bufferDataOffset=n}get memoryUsed(){var e,r;return(((e=this.data)==null?void 0:e.byteLength)??0)+(((r=this.vao)==null?void 0:r.memoryEstimate)??0)}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){this.vao=Le(this.vao)}doPrepareForRendering(e,r,i){const n=new Uint32Array(r),s=new Int32Array(n.buffer),o=n[i++],a=Ar.createVertex(e,gr.STATIC_DRAW,new Int32Array(s.buffer,4*i,o));i+=o;const l=n[i++],c=Ar.createIndex(e,gr.STATIC_DRAW,new Uint32Array(n.buffer,4*i,l));i+=l;const u=this.layer.circleMaterial;this.vao=new Fh(e,u.getAttributeLocations(),u.getLayoutInfo(),{geometry:a},c)}};const jFt=!0,HFt=32,Lce=200,Hmt=1/se("mapview-transitions-duration");let Wmt=class extends Bn{constructor(){super(...arguments),this._fadeOutResolver=null,this._fadeInResolver=null,this._clips=null,this.computedVisible=!0,this.computedOpacity=1,this.fadeTransitionEnabled=!1,this.inFadeTransition=!1,this._isReady=!1,this._opacity=1,this.parent=null,this._stage=null,this._visible=!0}get clips(){return this._clips}set clips(e){this._clips=e,this.requestRender()}get isReady(){return this._isReady}get opacity(){return this._opacity}set opacity(e){this._opacity!==e&&(this._opacity=Math.min(1,Math.max(e,0)),this.requestRender())}get stage(){return this._stage}set stage(e){var i;if(this._stage===e)return;const r=this._stage;this._stage=e,e?(i=this._stage)!=null&&i.untrashDisplayObject(this)||(this.onAttach(),this.emit("attach")):r==null||r.trashDisplayObject(this)}get transforms(){return this._getTransforms()}_getTransforms(){return this._transforms==null&&(this._transforms=this._createTransforms()),this._transforms}get visible(){return this._visible}set visible(e){this._visible!==e&&(this._visible=e,this.requestRender())}fadeIn(){return this._fadeInResolver||(this._fadeOutResolver&&(this._fadeOutResolver(),this._fadeOutResolver=null),this.opacity=1,this.computedOpacity=0,this.fadeTransitionEnabled=!0,this._fadeInResolver=Wo(),this.requestRender()),this._fadeInResolver.promise}fadeOut(){return this._fadeOutResolver||(this.opacity=0,this._fadeInResolver&&(this._fadeInResolver(),this._fadeInResolver=null),this.fadeTransitionEnabled=!0,this._fadeOutResolver=Wo(),this.requestRender()),this._fadeOutResolver.promise}endTransitions(){var e,r;(e=this._fadeInResolver)==null||e.call(this),this._fadeInResolver=null,(r=this._fadeOutResolver)==null||r.call(this),this._fadeOutResolver=null,this.computedOpacity=this.visible?this.opacity:0,this.requestRender()}beforeRender(e){this.updateTransitionProperties(e.deltaTime,e.state.scale)}afterRender(e){this._fadeInResolver&&this.computedOpacity===this.opacity?(this._fadeInResolver(),this._fadeInResolver=null):this._fadeOutResolver&&this.computedOpacity===0&&(this._fadeOutResolver(),this._fadeOutResolver=null)}remove(){var e;(e=this.parent)==null||e.removeChild(this)}setTransform(e){}processRender(e){this.stage&&this.computedVisible&&this.doRender(e)}requestRender(){this.stage&&this.stage.requestRender()}processDetach(){this._fadeInResolver&&(this._fadeInResolver(),this._fadeInResolver=null),this._fadeOutResolver&&(this._fadeOutResolver(),this._fadeOutResolver=null),this.onDetach(),this.emit("detach")}updateTransitionProperties(e,r){if(this.fadeTransitionEnabled){const i=this._fadeOutResolver||!this.visible?0:this.opacity,n=this.computedOpacity;if(n===i)this.computedVisible=this.visible;else{const s=e*Hmt;this.computedOpacity=n>i?Math.max(i,n-s):Math.min(i,n+s),this.computedVisible=this.computedOpacity>0;const o=i===this.computedOpacity;this.inFadeTransition=!o,o||this.requestRender()}}else this.computedOpacity=this.opacity,this.computedVisible=this.visible}onAttach(){}onDetach(){}doRender(e){}ready(){this._isReady||(this._isReady=!0,this.emit("isReady"),this.requestRender())}},vW=class Fv{static getId(e,r,i,n){return typeof e=="object"?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${r}/${i}/${n}`}constructor(e,r,i,n){this.set(e,r,i,n)}get key(){return this}get id(){return this.toString()}set id(e){this.set(e)}get hash(){const e=4095&this.row,r=4095&this.col,i=63&this.level;return(3&this.world)<<30|r<<22|e<<8|i}acquire(e,r,i,n){this.set(e,r,i,n)}contains(e){const r=e.level-this.level;return r>=0&&this.row===e.row>>r&&this.col===e.col>>r&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new Fv(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,r,i,n){if(e==null)this.level=0,this.row=0,this.col=0,this.world=0;else if(typeof e=="object")this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if(typeof e=="string"){const[s,o,a,l]=e.split("/");this.level=parseFloat(s),this.row=parseFloat(o),this.col=parseFloat(a),this.world=parseFloat(l)}else this.level=+e,this.row=+r,this.col=+i,this.world=+n||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new Fv(this.level-1,this.row>>1,this.col>>1,this.world)}getChildKeys(){const e=this.level+1,r=this.row<<1,i=this.col<<1,n=this.world;return[new Fv(e,r,i,n),new Fv(e,r,i+1,n),new Fv(e,r+1,i,n),new Fv(e,r+1,i+1,n)]}compareRowMajor(e){return this.rowe.row?1:this.cole.col?1:0}};vW.pool=new ko(vW,null,null,25,50);let qmt=class extends Wmt{constructor(e,r,i,n,s,o,a=s,l=o){super(),this.triangleCountReportedInDebug=0,this.triangleCount=0,this.texture=null,this.key=new vW(e),this.resolution=r,this.x=i,this.y=n,this.width=s,this.height=o,this.rangeX=a,this.rangeY=l}destroy(){this.texture&&(this.texture.dispose(),this.texture=null)}setTransform(e){const r=this.resolution/(e.resolution*e.pixelRatio),i=this.transforms.tileMat3,[n,s]=e.toScreenNoRotation([0,0],[this.x,this.y]),o=this.width/this.rangeX*r,a=this.height/this.rangeY*r;JZ(i,o,0,0,0,a,0,n,s,1),US(this.transforms.dvs,e.displayViewMat3,i)}},Iz=class COe extends qmt{constructor(e,r,i,n,s,o,a,l=null){super(e,r,i,n,s,o,4096,4096),this.styleRepository=a,this._memCache=l,this.type="vector-tile",this._referenced=0,this._hasSymbolBuckets=!1,this._memoryUsedByLayerData=0,this.layerData=new Map,this.layerCount=0,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.invalidating=!1,this.parentTile=null,this.childrenTiles=new Set,this._processed=!1,this._referenced=1,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate0}dispose(){this.status!=="unloaded"&&(AOe.delete(this),COe._destroyRenderBuckets(this.layerData),this.layerData=null,this.layerCount=0,this._memoryUsedByLayerData=0,this.destroy(),this.status="unloaded")}release(){return--this._referenced==0&&(this.dispose(),this.stage=null,!0)}retain(){++this._referenced}get referenced(){return this._referenced}get memoryUsed(){return this._memoryUsedByLayerData+256}changeDataImpl(e){var i;let r=!1;if(e){const{bucketsWithData:n,emptyBuckets:s}=e,o=this._createRenderBuckets(n);if(s&&s.byteLength>0){const a=new Uint32Array(s);for(const l of a)this._deleteLayerData(l)}for(const[a,l]of o)this._deleteLayerData(a),l.type===lc.SYMBOL&&(this.symbols.set(a,l.symbols),r=!0),this._memoryUsedByLayerData+=l.memoryUsed,this.layerData.set(a,l),this.layerCount++;(i=this._memCache)==null||i.updateSize(this.key.id,this,this.memoryUsed)}this._hasSymbolBuckets=!1;for(const[n,s]of this.layerData)s.type===lc.SYMBOL&&(this._hasSymbolBuckets=!0);r&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(r){r.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const r=this.resolution/(e.resolution*e.pixelRatio),i=this.width/this.rangeX*r,n=this.height/this.rangeY*r,s=[0,0];e.toScreen(s,[this.x,this.y]);const o=this.transforms.tileUnitsToPixels;KZ(o),r5(o,o,s),eQ(o,o,Math.PI*e.rotation/180),tQ(o,o,[i,n,1])}_createTransforms(){return{dvs:Pl(),tileMat3:Pl(),tileUnitsToPixels:Pl()}}static _destroyRenderBuckets(e){if(!e)return;const r=new Set;e.forEach(i=>{r.has(i)||(i.destroy(),r.add(i))}),e.clear()}_createRenderBuckets(e){const r=new Map,i=new Map;for(const n of e){const s=this._deserializeBucket(n,i);for(const o of s.layerUIDs)r.set(o,s)}return r}_deserializeBucket(e,r){let i=r.get(e);if(i)return i;switch(new Uint32Array(e)[0]){case lc.FILL:i=new Vmt(e,this.styleRepository);break;case lc.LINE:i=new Bmt(e,this.styleRepository);break;case lc.SYMBOL:i=new Gmt(e,this.styleRepository,this);break;case lc.CIRCLE:i=new jmt(e,this.styleRepository)}return r.set(e,i),i}_deleteLayerData(e){if(!this.layerData.has(e))return;const r=this.layerData.get(e);this._memoryUsedByLayerData-=r.memoryUsed,r.destroy(),this.layerData.delete(e),this.layerCount--}};const AOe=new Map;function Xmt(){AOe.forEach((t,e)=>{console.log(` +${e.key}:`),t[0].forEach(r=>console.log(r)),console.log("========"),t[1].forEach(r=>console.log(r))})}const XFt={value:.5,readOnly:!0},Ymt={readOnly:!0,value:.5,get(){return this.updating?this.updatingProgressValue:1}};let bT=class{constructor(e=0,r=0){this.min=e,this.max=r,this.level=0,this.hasNoDataValues=!1}copyFrom(e){this.min=e.min,this.max=e.max,this.level=e.level,this.hasNoDataValues=e.hasNoDataValues}},Zmt=class{constructor(e,r){this.data=e,this.safeWidth=.99999999*(e.width-1),this.dx=(e.width-1)/(r[2]-r[0]),this.dy=(e.width-1)/(r[3]-r[1]),this.x0=r[0],this.y1=r[3]}},Qmt=class{constructor(e,r,i){this.type="elevation",this.level=e[0],this.i=e[1],this.j=e[2],this.extent=r,this.samplerData=new Zmt(i,r)}computeMinMaxValue(e,r,i,n){n.min=1/0,n.max=-1/0,n.hasNoDataValues=!1;const s=e-this.level;if(s<=0)return n;const o=2**s;if(!(Math.floor(r/o)===this.i&&Math.floor(i/o)===this.j))return n;let a=1/0,l=-1/0;const c=this.samplerData.data.width,u=this.samplerData.data.values,d=.5*yR;let p=(c-1)/o,m=(i-this.j*o)*p,y=(r-this.i*o)*p;if(p<1){const _=Math.floor(m),v=Math.floor(y),b=_+v*c,x=u[b],T=u[b+1],S=u[b+c],A=u[b+c+1];if(x+T+S+Athis.notifyChange("stencilEnabledExtents"))])}destroy(){}get layerViewsExtent(){return this._computeLayerViewsExtent()}get tiledLayersExtent(){return this._computeTiledLayersExtent()}get stencilEnabledExtents(){return this._computeStencilEnabledExtents()}_computeStencilEnabledExtents(){const e=[];return this.layerViews.forEach(r=>{const i=r.layer;if(i.operationalLayerType==="IntegratedMeshLayer"&&this.viewSpatialReference!=null){const n=OOe(i.fullExtent,this.viewSpatialReference);n!=null&&e.push(Aye(n))}}),e}};function Kmt(t,e){return t===$e.Global?new bW(e):new wW(e)}h([f({readOnly:!0})],Qu.prototype,"layerViewsExtent",null),h([f({readOnly:!0})],Qu.prototype,"tiledLayersExtent",null),h([f({readOnly:!0})],Qu.prototype,"stencilEnabledExtents",null),h([f()],Qu.prototype,"viewSpatialReference",void 0),h([f()],Qu.prototype,"tilingScheme",void 0),h([f()],Qu.prototype,"defaultTiledLayersExtent",void 0),h([f({constructOnly:!0})],Qu.prototype,"layers",void 0),h([f({constructOnly:!0})],Qu.prototype,"layerViews",void 0),Qu=h([N("esri.views.3d.terrain.ExtentHelper")],Qu);let bW=class extends Qu{_computeLayerViewsExtent(){return this._globalExtent}_computeTiledLayersExtent(){return this._globalExtent}get _globalExtent(){return this.viewSpatialReference.isWebMercator?pwe:XGe}};bW=h([N("esri.views.3d.terrain.ExtentHelperGlobal")],bW);let wW=class extends Qu{_computeLayerViewsExtent(){const e=Ih(),r=this.viewSpatialReference;this.layerViews.forEach(s=>{const o=s.layer;if(s.isResolved()&&(o.type!=="graphics"||!o.internal)){const a=OOe("fullExtentInLocalViewSpatialReference"in s&&s.fullExtentInLocalViewSpatialReference||s.layer.fullExtent,r);S_(e,a,e)}});const i=r7(e)?e:null,n=this._get("layerViewsExtent");return Cb(i,n)?n:i}_computeTiledLayersExtent(){const e=this.tilingScheme;if(!e)return null;const r=this.viewSpatialReference,i=Ih();this.layers.forEach(o=>{if(o.loaded&&jA(o)){const a=K8(o,r,$e.Local);if(a==null)return;const{tileInfo:l,fullExtent:c}=a;l!=null&&c!=null&&(J5(o)||e.compatibleWith(l)&&c.spatialReference.equals(e.spatialReference))&&S_(i,c,i)}}),S_(i,this.defaultTiledLayersExtent,i);const n=r7(i)?i:null,s=this._get("tiledLayersExtent");return Cb(n,s)?s:n}};function OOe(t,e){return t==null||t.spatialReference.equals(e)?t:uZ(t,t.spatialReference,e)}wW=h([N("esri.views.3d.terrain.ExtentHelperLocal")],wW);var Zt;(function(t){t[t.ELEVATION=0]="ELEVATION",t[t.MAP=1]="MAP"})(Zt||(Zt={}));const Uv=[Zt.ELEVATION,Zt.MAP];function ROe(){var e;const t=(e=globalThis.require)==null?void 0:e.modules;if(t){const r=Object.keys(t);for(const i of r)i.search(".glsl")!==-1&&delete t[i]}}const egt=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let G0,Ia=class extends xe{get running(){return this._placementDirty&&(this._drapeSources.size>0||this.view.graphics.length>0||Kr.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&!this.suspended&&this.surface.ready}get _isSpherical(){return this.view.state.isGlobal}get _worldToPCSRatio(){return this._spatialReference!=null&&this._spatialReference.isGeographic&&!this.view.state.isLocal?Mr(this._spatialReference).metersPerDegree:1}get suspended(){return this.surface.suspended}get updating(){return this.running||this.renderer.updating||this._contentUpdated}get hasHighlights(){return this.renderer.hasHighlights}get rendersOccluded(){return this.renderer.rendersOccluded}constructor(e){super(e),this._handles=new Vi,this._spatialReference=null,this._renderSR=null,this._overlaySREqualsRenderSR=!0,this._drapeSources=new Set,this._drapeTargets=new Set,this._placementDirty=!1,this._contentUpdated=!1,this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1,this._hasUnusedRenderTargets=!1,this._longitudeCyclical=null,this._latestOriginId=0,this._maxResolution=se("esri-mobile")?2048:4096,this._animationTimeLast=0,this._removeRenderOverlayCallback=()=>{}}initialize(){var n;const e=this.view;this.renderer=new sf({view:e,worldToPCSRatio:this._worldToPCSRatio,spatialReference:this._spatialReference});const r=()=>this.setDrawTexturesDirty();this._groundIntersector=zh(this.view.state.viewingMode),this._groundIntersector.options.backfacesTerrain=!0,this._groundIntersector.options.invisibleTerrain=!0,this._groundIntersector.options.hud=!1,this._handles.add([this.renderer.events.on("has-highlights",()=>{r(),this.notifyChange("hasHighlights")}),this.renderer.events.on("has-water",s=>{var o;return(o=e._stage)==null?void 0:o.renderer.setParameters({hasOverlayWater:s})}),this.renderer.events.on("renders-occluded",()=>{r(),this.notifyChange("rendersOccluded")}),this.renderer.events.on("content-changed",r),ue(()=>e.state.camera.pixelRatio,r),ue(()=>e.state.alignPixelEnabled,r),this.renderer.events.on("textures-disposed",()=>this.updateOverlayResult()),ue(()=>{var s,o,a;return[(s=e.pointsOfInterest)==null?void 0:s.renderPointOfView,(a=(o=e.pointsOfInterest)==null?void 0:o.centerOnSurfaceFrequent)==null?void 0:a.location]},()=>this.setPlacementDirty()),ue(()=>{var s,o;return[(s=e.state)==null?void 0:s.pixelRatio,(o=e.state)==null?void 0:o.contentPixelRatio]},()=>this.setPlacementDirty(),Br),this.surface.on("elevation-change",()=>this.setPlacementDirty()),e.on("resize",()=>this.setPlacementDirty()),e.resourceController.scheduler.registerTask(dt.OVERLAY,this),e._stage.renderView.events.on("force-camera-for-screenshot",s=>{this._updateOverlays(Wa,s.camera,dn.BACKGROUND),this.renderer.hasOverlays&&this._drawOverlayTextures(this.renderer.overlays,dn.BACKGROUND,s)})]);let i=s=>this._renderOverlayCallback(s);this._removeRenderOverlayCallback=()=>{i=()=>{}},(n=e._stage)==null||n.renderer.setParameters({renderOverlay:s=>i(s)})}_renderOverlayCallback(e){this._contentUpdated=!1;const r=this.renderer;r.processSyncDrapeSources(),r.hasOverlays&&(this._dispatchAnimationUpdate(e),this._drawOverlayTextures(r.overlays,dn.UPDATE,this.view.state)),this._hasUnusedRenderTargets&&this._collectUnusedRenderTargetMemory()}destroy(){var e,r;this._handles=Me(this._handles),this._removeRenderOverlayCallback(),(r=(e=this.view)==null?void 0:e._stage)==null||r.renderer.setParameters({renderOverlay:()=>{}}),G0!=null&&(G0.hide(),G0=null)}get hasOverlays(){return this.renderer.hasOverlays}setSpatialReference(e){this._spatialReference=e,this.renderer.spatialReference=e,this._longitudeCyclical=null;const r=this.view.renderSpatialReference;e!=null&&r!=null?(this._renderSR=r,this._overlaySREqualsRenderSR=e.equals(this._renderSR),this._isSpherical&&(this._longitudeCyclical=e.isWebMercator?new F_(-20037508342787e-6,20037508342787e-6):new F_(-180,180),this.renderer.longitudeCyclical=this._longitudeCyclical),this.renderer&&(this.renderer.worldToPCSRatio=this._worldToPCSRatio)):this.renderer.disposeOverlays()}get gpuMemoryUsage(){return this.renderer.gpuMemoryUsage}registerDrapeSource(e,r,i){this._drapeSources.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources);const n=this.renderer.createDrapeSourceRenderer(e,r,i);return this._updateDrapeSourceExtent(e),this._setContentDirty(),this.notifyChange("running"),n}registerGeometryDrapeSource(e){return this.registerDrapeSource(e,Hc)}_updateDrapeSourceExtent(e){this.renderer.overlays.length===2&&e.setDrapingExtent!=null&&this._spatialReference!=null&&e.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(e){this._drapeSources.has(e)&&(this._drapeSources.delete(e),this.renderer.removeDrapeSourceRenderer(e),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),this.notifyChange("running"))}registerDrapeTarget(e){this._drapeTargets.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}updateOverlayResult(){var e;(e=this.view._stage)==null||e.renderer.setParameters({overlays:this.renderer.overlays})}unregisterDrapeTarget(e){this._drapeTargets.delete(e),this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty(),this.setDrawTexturesDirty()}setPlacementDirty(){this._placementDirty=!0}runTask(e){return this._updateOverlays(e,this.view.state.contentCamera,dn.UPDATE)}_updateOverlays(e,r,i){if(!this._spatialReference)return Ho.YIELD;const n=this._computeOverlayResolution(r);this._computeOverlayExtents(r,n,Am);const s=nu(Am.inner)/nu(Am.outer);this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources);const o=this._updateOverlay(Oi.INNER,Am.inner,n,1*Am.pixelRatioAdjustment,Am.mapUnitsPerPixel),a=this._updateOverlay(Oi.OUTER,Am.outer,n,s*Am.pixelRatioAdjustment,Am.mapUnitsPerPixel);o!==mf.EXTENT&&a!==mf.EXTENT||(this._drapeSources.forEach(l=>this._updateDrapeSourceExtent(l)),this.surface.updateTileOverlayParams(i)),o===mf.NONE&&a===mf.NONE||this.setDrawTexturesDirty(),this._placementDirty=!1,e.madeProgress()}_computeOverlayResolution(e){const r=this.view.state.contentPixelRatio,i=e.fullWidth/e.pixelRatio*r,n=e.fullHeight/e.pixelRatio*r,s=Math.ceil(1.5*Math.max(i,n));return Math.min(MJ(s),this._maxResolution)}_updateOverlay(e,r,i,n,s){if(this.renderer.overlays.length===0)return mf.NONE;const o=this.renderer.overlays[e],a=o.mapUnitsPerPixel;if(o.mapUnitsPerPixel=s,o.pixelRatio=n,tgt(r,o.extent)&&i===o.resolution)return a===s?mf.NONE:mf.RERENDER_ONLY;Ug(o.extent,r),o.resolution=i;const l=vY(o.extent);return o.renderLocalOrigin=R5(l[0],l[1],0,"OV_"+this._latestOriginId++),mf.EXTENT}setTileParameters(e){const r=e.renderData.overlay;if(this.renderer.overlays.length>0){const i=this.renderer.overlays[Oi.INNER],n=this.renderer.overlays[Oi.OUTER],s=e.extent;this._rectInsideRect(i.extent,s)||this._rectanglesOverlap(s,i.extent)||this._rectanglesOverlap(s,n.extent)?(this._setTileOverlayData(s,Oi.INNER,r),this._setTileOverlayData(s,Oi.OUTER,r)):(this._clearTileOverlayData(Oi.INNER,r),this._clearTileOverlayData(Oi.OUTER,r))}else this._clearTileOverlayData(Oi.INNER,r),this._clearTileOverlayData(Oi.OUTER,r)}overlayPixelSizeInMapUnits(e){if(this.renderer.overlays.length===0)return 0;const r=this.renderer.overlays[Oi.INNER],i=this.renderer.overlays[Oi.OUTER],n=this._pointIsInExtent(e,r.extent)?r:i;return(n.extent[2]-n.extent[0])/n.resolution}_setTileOverlayData(e,r,i){if(this.renderer.overlays.length===0)return;const n=this.renderer.overlays[r].extent,s=nu(n),o=lp(n);let a=e[0];if(this._longitudeCyclical){a=this._longitudeCyclical.minimalMonotonic(n[0],a);const l=this._longitudeCyclical.minimalMonotonic(n[0],e[2]);a>l&&(a=l-(e[2]-e[0]))}i.setScale(r,nu(e)/s,lp(e)/o),i.setOffset(r,(a-n[0])/s,(e[1]-n[1])/o)}_clearTileOverlayData(e,r){r.setScale(e,-1,-1),r.setOffset(e,-1,-1)}async reloadShaders(){ROe(),await this.renderer.reloadShaders(),this.setDrawTexturesDirty(),this.runTask(Wa)}_dispatchAnimationUpdate(e){const r=e-this._animationTimeLast;if(r>=this.surface.view._stage.renderer.animationTimestep||this.view.state.forcedAnimationTime!=null||this._drawTexturesDirty||this._drawTexturesAnimateDirty){const i=r/this.surface.view._stage.renderer.animationTimeDilation,n=new gSe(this.view.state.camera,i,this.view.state.forcedAnimationTime);this.renderer.updateAnimation(n)&&(this._drawTexturesAnimateDirty=!0),this._animationTimeLast=e}}setDrawTexturesDirty(){this.renderer.hasOverlays?(this._contentUpdated=!0,this._drawTexturesDirty=!0,this.view._stage.renderView.requestRender()):this.setPlacementDirty()}_intersectGroundFromView(e,r,i,n){const s=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(e,ngt,r,i);if(s==null)return!1;const o=s.origin,a=oe(qI,s.origin,s.direction);return this._groundIntersector.reset(o,a,e),this._groundIntersector.intersect([]),this.view.basemapTerrain.intersect(this._groundIntersector,null,o,a),this._groundIntersector.results.min.getIntersectionPoint(n)}_findHorizonBasedPointOfInterest(e,r){let i=.5;const n=.55,s=this.view.renderCoordsHelper.getAltitude(e.eye),o=this.view.pointsOfInterest.centerOnSurfaceFrequent,a=1e-5,l=ge(o.estimatedSurfaceAltitude,e.aboveGround?-1/0:s+a,e.aboveGround?s-a:1/0),c=e.aboveGround;if(this.view.viewingMode==="global"){const u=qI;EE(z6(B6,Mr(this.view.spatialReference).radius+l),bu(e.eye,e.viewForward),u),ae(u,u,e.eye);const d=U_.normalize(pbe(e.viewForward,u,e.viewRight))/e.fovY+.5,p=d<=0||d>=1?.5:n;i=c?p*d:d+p*(1-d)}else{const u=.5*Math.PI-Math.acos(-e.viewForward[2]),d=Math.tan(u),p=$t(0,d,1,0),m=au(p,p,e.projectionMatrix)[1],y=ge(.5+.5*m,0,1);i=y===1||y===0?.5:c?y*n:1-(1-y)*n}return!!this._intersectGroundFromView(e,.5,i,r)&&u6(r,e.eye)=_&&(m=_,s[1]=0,this._spatialReference.isWebMercator&&(s[0]=0)));let v=1;y&&(v=1/Math.max(.2,Math.cos(Math.abs(It(s[1])))),m*v>180&&(v=180/m),i.mapUnitsPerPixel*=v);const b=Math.log(2)/12;m=Math.exp(Math.round(Math.log(m)/b)*b);const x=m*v,T=32,S=.5*r/(T*x),A=.5*r/(T*m);s[0]=Math.round(s[0]*S)/S,s[1]=Math.round(s[1]*A)/A;const C=i.inner;C[0]=s[0]-x,C[1]=s[1]-m,C[2]=s[0]+x,C[3]=s[1]+m,this._isSpherical&&this._shiftExtentToFitBounds(C,1/0,_);const R=i.outer;if(6*x>nu(l))Ug(R,l);else if(Math.PI/2-Math.abs(a-Math.PI/2)<=.25*Math.PI)R[0]=C[0]-x,R[1]=C[1]-m,R[2]=C[2]+x,R[3]=C[3]+m;else{Cs(e.eye,this._renderSR,qI,this._spatialReference),Tf(K1,s,qI);let F=-Math.atan2(K1[1],K1[0])+.125*Math.PI;F<0&&(F+=2*Math.PI);const k=Math.floor(F/(.25*Math.PI));ew(K1,egt[k],2*m),K1[0]*=v,K1[2]*=v,cY(R,C,K1)}if(this._isSpherical)R[0]=this._longitudeCyclical.clamp(R[0]),R[2]=this._longitudeCyclical.clamp(R[2]),R[1]=Math.max(R[1],-_),R[3]=Math.min(R[3],_);else{const F=i7(C,l,rgt),k=i7(R,l,igt);hre(F,k)&&(R[2]=R[0],R[3]=R[1])}const P=Math.abs(C[2]-C[0])/r;i.mapUnitsPerPixel=Math.max(i.mapUnitsPerPixel,P),i.pixelRatioAdjustment=i.mapUnitsPerPixel/P}_drawOverlayTextures(e,r,i){if(e.length===0||!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return;const n=this._drawTexturesDirty;this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1;const s=this._drawOverlay(e[Oi.INNER],i),o=this._drawOverlay(e[Oi.OUTER],i);s!==FS.CHANGED&&o!==FS.CHANGED||this.surface.updateTileOverlayParams(dn.UPDATE),this._collectUnusedRenderTargetMemory(),this.updateOverlayResult(),n?(this.surface.requestRender(r),r===dn.UPDATE&&this.surface.requestUpdate()):this.surface.requestRender(dn.BACKGROUND)}_drawOverlay(e,r){return this._longitudeCyclical?e.setupGeometryViewsCyclical(this._longitudeCyclical):e.setupGeometryViewsDirect(),e.draw(this.renderer,r)}_collectUnusedRenderTargetMemory(){this._hasUnusedRenderTargets=!1,this.renderer.hasOverlays&&(this._hasUnusedRenderTargets=this.renderer.collectUnusedRenderTargetMemory())}_rectanglesOverlap(e,r){return e!=null&&(this._longitudeCyclical?(this._longitudeCyclical.contains(r[0],r[2],e[0])||this._longitudeCyclical.contains(r[0],r[2],e[2])||this._longitudeCyclical.contains(e[0],e[2],r[0]))&&!(e[1]>r[3]||e[3]e[1]&&r[3]=r[1]&&e.y<=r[3];const i=e.x,n=e.y;return i>r[0]&&ir[1]&&nr&&(n=r-e[2]),e[1]<-i?s=e[1]+i:e[3]>i&&(s=i-e[3]),E4(e,n,s)}get test(){return{renderer:this.renderer,update:()=>this.runTask(Wa)}}};function tgt(t,e){const i=Kr.TESTS_DISABLE_OPTIMIZATIONS?0:1e-5*Math.max(t[2]-t[0],t[3]-t[1],e[2]-e[0],e[3]-e[1]);return Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i}h([f()],Ia.prototype,"_spatialReference",void 0),h([f({readOnly:!0})],Ia.prototype,"running",null),h([f()],Ia.prototype,"_placementDirty",void 0),h([f()],Ia.prototype,"_contentUpdated",void 0),h([f()],Ia.prototype,"_isSpherical",null),h([f()],Ia.prototype,"_worldToPCSRatio",null),h([f({autoDestroy:!0})],Ia.prototype,"renderer",void 0),h([f({constructOnly:!0})],Ia.prototype,"view",void 0),h([f({constructOnly:!0})],Ia.prototype,"surface",void 0),h([f()],Ia.prototype,"suspended",null),h([f()],Ia.prototype,"updating",null),h([f({type:Boolean})],Ia.prototype,"hasHighlights",null),h([f({type:Boolean})],Ia.prototype,"rendersOccluded",null),Ia=h([N("esri.views.3d.terrain.OverlayManager")],Ia);const K1=Qt(),qI=O(),Am={inner:jt(),outer:jt(),mapUnitsPerPixel:0,pixelRatioAdjustment:1},rgt=jt(),igt=jt(),ngt=qs();var mf;(function(t){t[t.NONE=0]="NONE",t[t.EXTENT=1]="EXTENT",t[t.RERENDER_ONLY=2]="RERENDER_ONLY"})(mf||(mf={}));let POe=class xW{constructor(e,r){this._factoryCallback=e,this._lengthCallback=r,this._pool=new Map}acquire(e){if(!xW.test.disabled){const r=this._pool.get(e);if(r&&r.length!==0)return r.pop()}try{return this._factoryCallback(e)}catch(r){const i=window.performance&&window.performance.memory;let n="";throw i&&(n=` + totalJSHeapSize: ${i.totalJSHeapSize}, usedJSHeapSize: ${i.usedJSHeapSize}, jsHeapSizeLimit: ${i.jsHeapSizeLimit}`),console.log("Array allocation of size "+e+" failed: "+r+n),r}}release(e){if(xW.test.disabled)return;const r=this._lengthCallback(e);let i=this._pool.get(r);i||(i=new Nt({shrink:!0}),this._pool.set(r,i)),i.push(e)}clear(){this._pool.clear()}get test(){return{size:this._pool.size}}};POe.test={disabled:!1};let sgt=class{constructor(){this.indices=null,this.vertexAttributes=null,this.boundingBox=vi(),this.indexCount=0,this.numVerticesPerSide=0,this.uvRange=[0,0,1,1],this.outerEdges=[null,null,null,null],this.innerEdges=[null,null,null,null]}},Dce=class{constructor(e,r,i,n,s){this.attributes=e,this.localOrigin=r,this.index0=i,this.stride=n,this.count=s}getVertexIndex(e){return this.getAttributeIndex(e)}getAttributeIndex(e){return be(0<=e&&eogt.createBuffer(t),t=>t.count);function agt(){dK.clear()}function MOe(t){return dK.acquire(t)}function lgt(t){dK.release(t.vertexAttributes),t.vertexAttributes=null,t.indices=null}const Nce=16384;function np(t,e,r,i){t.setValues(e,r*Nce,i*Nce)}function Oh(t,e,r,i){ti[3]&&(i[3]=t),ei[4]&&(i[4]=e),ri[5]&&(i[5]=r)}let cgt=class{constructor(){this.sinLonLUT=new Array(F3+1),this.cosLonLUT=new Array(F3+1),this.sinLatLUT=new Array(F3+1),this.cosLatLUT=new Array(F3+1)}update(e,r,i){const n=r[0],s=r[2];for(let o=0;o<=e;o++){const a=o/e,l=n*(1-a)+s*a;this.sinLonLUT[o]=Math.sin(l),this.cosLonLUT[o]=Math.cos(l);const c=i(a);this.sinLatLUT[o]=Math.sin(c),this.cosLatLUT[o]=Math.cos(c)}}},XI=class{constructor(){this.cornerTiles=[null,null,null,null],this.cornerTileSamplerVersions=[-1,-1,-1,-1]}},ugt=class{constructor(){this.cornerNeighborData=[new XI,new XI,new XI,new XI],this.edgeResolutions=[-1,-1,-1,-1],this.edgePeerNeighbors=[null,null,null,null],this.edgePeerNeighborSamplerVersions=[-1,-1,-1,-1],this.cornerPeerNeighbors=[null,null,null,null]}},hgt=class{constructor(){this.numVerticesPerSide=0,this.samplerData=null,this.clippingArea=null,this.wireframe=!1,this.samplerDataVersion=0,this.neighborData=new ugt}},$Oe=class iN{constructor(e){this._getFadeDuration=e,this._fadeStart=0,this._delayedTime=0}clear(){this._current=Me(this._current),this._next=Me(this._next),this._waiting=Me(this._waiting),this._delayed=Me(this._delayed)}get current(){if(this._current==null)return null;if(!this._isFadingEnabled){const r=this._delayed||this._waiting||this._next||this._current;r!==this._current&&(this._current=null,this.clear(),this._current=r)}let e=iN.test.fadeMoment;if(this._delayed!=null&&(e=e||performance.now(),e>=this._delayedTime&&(this._push(this._delayed,Ag.Immediate),this._delayed=null)),this._next!=null){e=e||performance.now();const r=this._fadeDuration,i=this._current!=null&&this._next.texture===this._current.texture,n=this._next.type!==ns.FADING,s=e-this._fadeStart>=r;(i||n||s)&&(Me(this._current),this._current=this._next,this._next=this._waiting,this._waiting=null,this._fadeStart=this._alignFadeStart(e))}return this._current}get next(){return this._next}get fadeFactor(){if(this._next==null)return 1;const e=iN.test.fadeMoment||performance.now(),r=Math.max(0,e-this._fadeStart),i=this._fadeDuration;return r>i?0:1-r/i}get isFading(){return this._next!=null||this._delayed!=null}push(e,r=Ag.Immediate){this._delayed=Me(this._delayed),this._push(e,r)}_push(e,r){if(this._isFadingEnabled||this.clear(),this._current==null)return void(this._current=e);const i=iN.test.fadeMoment||performance.now();return r!==Ag.Immediate?(this._delayed=e,void(this._delayedTime=i+r)):this._next==null?(this._next=e,void(this._fadeStart=this._alignFadeStart(i))):void(e!=null&&(Me(this._waiting),this._waiting=e))}get _fadeDuration(){return this._waiting==null?this._getFadeDuration():.5*this._getFadeDuration()}_alignFadeStart(e){const r=this._getFadeDuration();return e+r-e%r}get _isFadingEnabled(){return this._getFadeDuration()>0}};var Ag;$Oe.test={fadeMoment:0},function(t){t[t.Immediate=0]="Immediate",t[t.Delayed=5e3]="Delayed"}(Ag||(Ag={}));var tE;(function(t){t[t.BACK_TO_FRONT=-1]="BACK_TO_FRONT",t[t.NONE=0]="NONE",t[t.FRONT_TO_BACK=1]="FRONT_TO_BACK"})(tE||(tE={}));let IOe=class{constructor(){this._queue=new Nt,this.remove=()=>{}}get done(){return this._queue.length===0&&(!this._last||this._last.isLeaf)}resetOne(e){this._queue.clear(),this._queue.push(e),this._last=void 0}reset(e=null){this._queue.clear(),e!=null&&this._queue.pushArray(e),this._last=void 0}skipSubtree(){this._last=void 0}next(){var r;const e=(r=this._last)==null?void 0:r.children;return e&&e[0]&&this._queue.pushArray(e),this._last=this._queue.pop(),this._last}},dgt=class{constructor(){this._q=new Nt}get done(){return this._q.length===0}reset(e){if(this._q.clear(),e!=null){this._q.pushArray(e);for(let r=0;ri.xmax||n[3]>i.ymax)return!1}else if(i.xmin>n[2]||i.ymin>n[3]||i.xmax0&&s>1.00000001*o)return!1;const a=e.maxScale;return!(a>0&&s<.99999999*a)}function Og(t,e){const r=t.lij,i=e.lij;return r[0]-i[0]||r[1]-i[1]||r[2]-i[2]}function LOe(t,e,r=null){r==null||r.length===0?t===tE.BACK_TO_FRONT?e.sort(pgt):e.sort(fgt):e.sort((i,n)=>mgt(i,n,t,r))}function pgt(t,e){const r=e.screenDepth-t.screenDepth;if(r!==0)return r;const i=t.lij,n=e.lij;return i[0]-n[0]||i[1]-n[1]||i[2]-n[2]}function fgt(t,e){const r=t.screenDepth-e.screenDepth;if(r!==0)return r;const i=t.lij,n=e.lij;return i[0]-n[0]||i[1]-n[1]||i[2]-n[2]}function DOe(t,e,r){const i=t.screenDepth,n=e.screenDepth;return in?r:Og(t,e)}function mgt(t,e,r,i){return Fce(t,i)===Fce(e,i)?DOe(t,e,r):t?r:-r}function Fce(t,e){for(const r of e)if(t.intersectsExtent(r))return!0;return!1}function ggt(t,e){const r=t.distanceToPOI-e.distanceToPOI;if(r!==0)return r;const i=t.lij,n=e.lij;return i[0]-n[0]||i[1]-n[1]||i[2]-n[2]}function ygt(t,e){const r=t.length;for(let i=0;i!0;let u=this.tile;const d=u.level;let p;const m=this._tileLayerInfo.upsampleInfo,y=m!=null?m.tile.level:-1,_=m!=null&&y-d>=a,v=n==null?void 0:n.tilemapCache,b=i.type==="vector-tile-3d"?i.schemaHelper:null;for(;u&&c(u,n,!1)&&u.level>=s;){const x=u.level,T=d-x,S=u.layerInfo[r][e];if(S.data&&T>=a){(!_||x>y)&&this._setUpsampleTile(u),S.dataInvalidated&&(p=u);break}const A=(b==null?void 0:b.getLevelRowColumn(u.lij))??u.lij;if((v==null?void 0:v.getAvailability(A[0],A[1],u.lij[2]))!=="unavailable"&&x<=o&&!S.data&&!S.dataMissing&&((!p||u.level===s||x%dwe==0||d-p.level=l))break;u=u.parent}if(p!=null&&d-p.level=r)return n;i=n}return i}_setUpsampleTile(e,r){this._tileLayerInfo.setUpsampleInfo(this.tile,e),this.tile.updateRenderData(this._layerClass,ns.FADING,r)}get test(){return{findNextDownload:()=>this._findNextDownload(),tileLayerInfo:this._tileLayerInfo}}},bgt=class extends pK{get _desiredMinLevelDelta(){throw Uce}get _progressiveLevelModulo(){throw Uce}dispose(){}};const Uce=new Error("Abstract method called on TileAgent"),Gl=new bgt;let NOe=class extends pK{constructor(){super(...arguments),this._scaleRangeEnabled=!1}get _desiredMinLevelDelta(){return JG(this.tile.level)-(this.tile.elevationLevel-this.tile.level)}get _progressiveLevelModulo(){return 0}},FOe=class extends pK{constructor(){super(),this._scaleRangeEnabled=!0}get _desiredMinLevelDelta(){return 0}get _progressiveLevelModulo(){return dwe}};var kb,Tw;(function(t){t[t.Stretch=0]="Stretch",t[t.Lut=1]="Lut",t[t.Hillshade=2]="Hillshade",t[t.COUNT=3]="COUNT"})(kb||(kb={})),function(t){t[t.Noop=0]="Noop",t[t.PerBand=1]="PerBand",t[t.COUNT=2]="COUNT"}(Tw||(Tw={}));function wgt(t){t.fragment.uniforms.add(new Ye("u_colormap",e=>e.u_colormap),new Ce("u_colormapOffset",e=>e.colormap.u_colormapOffset),new Ce("u_colormapMaxIndex",e=>e.colormap.u_colormapMaxIndex),new Ce("u_opacity",e=>e.common.u_opacity)),t.fragment.code.add(w`vec4 colormap(vec4 currentPixel, bool isFloat) { +float colorIndex = isFloat ? currentPixel.r - u_colormapOffset : currentPixel.r * 255.0 - u_colormapOffset; +vec4 result; +if (currentPixel.a == 0.0 || colorIndex > u_colormapMaxIndex) { +result = vec4(0.0, 0.0, 0.0, 0.0); +} else { +vec2 texelCoordinates = vec2((colorIndex + 0.5), 0.5); +result = texelFetch(u_colormap, ivec2(texelCoordinates), 0); +} +return result; +}`)}function xgt(t){t.fragment.uniforms.add(new Ye("u_transformGrid",e=>e.u_transformGrid),new yr("u_transformSpacing",e=>e.common.u_transformSpacing),new yr("u_targetImageSize",e=>e.common.u_targetImageSize)),t.fragment.code.add(w`vec2 projectPixelLocation(vec2 coords) { +vec2 index_image = floor(coords * u_targetImageSize); +vec2 oneTransformPixel = vec2(4.0, 1.0); +vec2 index_transform = floor(index_image / u_transformSpacing) * oneTransformPixel; +vec2 pos = fract((index_image + 0.5) / u_transformSpacing); +vec2 transform_location = index_transform + 0.5; +vec2 srcLocation; +if (pos.s <= pos.t) { +vec3 ll_abc = texelFetch(u_transformGrid, ivec2(transform_location), 0).rgb; +vec3 ll_def = texelFetch(u_transformGrid, ivec2(transform_location.s + 1.0, transform_location.t), 0).rgb; +srcLocation.s = dot(ll_abc, vec3(pos, 1.0)); +srcLocation.t = dot(ll_def, vec3(pos, 1.0)); +} else { +vec3 ur_abc = texelFetch(u_transformGrid, ivec2(transform_location.s + 2.0, transform_location.t), 0).rgb; +vec3 ur_def = texelFetch(u_transformGrid, ivec2(transform_location.s + 3.0, transform_location.t), 0).rgb; +srcLocation.s = dot(ur_abc, vec3(pos, 1.0)); +srcLocation.t = dot(ur_def, vec3(pos, 1.0)); +} +return srcLocation; +}`)}let UOe=class extends Wr{constructor(){super(...arguments),this.scale=1,this.offset=dp}};function kOe(t){t.attributes.add(E.POSITION,"vec2"),t.attributes.add(E.UV0,"vec2"),t.vertex.uniforms.add(new Ce("scale",e=>e.scale)),t.vertex.uniforms.add(new yr("offset",e=>e.offset)),t.varyings.add("uv","vec2"),t.varyings.add("vuv","vec2"),t.vertex.code.add(w`void main(void) { +gl_Position = vec4(position, 0.0, 1.0); +uv = uv0 * scale + offset; +vuv = uv0; +}`)}let Tgt=class extends UOe{constructor(e,r,i){super(),this.common=e,this.u_image=r,this.u_transformGrid=i}};function Sgt(t,e){t.include(xgt),t.fragment.uniforms.add(new Ye("u_image",i=>i.u_image),new kf("u_flipY",i=>i.common.u_flipY),new kf("u_applyTransform",i=>i.common.u_applyTransform));const{requireBilinearWithNN:r}=e;r&&t.fragment.uniforms.add(new yr("u_srcImageSize",i=>i.common.u_srcImageSize)),t.fragment.code.add(w`vec2 getPixelLocation(vec2 coords) { +vec2 targetLocation = u_flipY ? vec2(coords.s, 1.0 - coords.t) : coords; +if (!u_applyTransform) { +return targetLocation; +} +return projectPixelLocation(targetLocation); +} +bool isOutside(vec2 coords){ +if (coords.t>1.00001 ||coords.t<-0.00001 || coords.s>1.00001 ||coords.s<-0.00001) { +return true; +} else { +return false; +} +}`),r?t.fragment.code.add(w`vec4 sampleBilinear(sampler2D sampler, vec2 coords, vec2 texSize) { +vec2 texelStart = floor(coords * texSize); +vec2 coord0 = texelStart / texSize; +vec2 coord1 = (texelStart + vec2(1.0, 0.0)) / texSize; +vec2 coord2 = (texelStart + vec2(0.0, 1.0)) / texSize; +vec2 coord3 = (texelStart + vec2(1.0, 1.0)) / texSize; +vec4 color0 = texture(sampler, coord0); +vec4 color1 = texture(sampler, coord1); +vec4 color2 = texture(sampler, coord2); +vec4 color3 = texture(sampler, coord3); +vec2 blend = fract(coords * texSize); +vec4 color01 = mix(color0, color1, blend.x); +vec4 color23 = mix(color2, color3, blend.x); +vec4 color = mix(color01, color23, blend.y); +float alpha = floor(color0.a * color1.a * color2.a * color3.a + 0.5); +color = color * alpha + (1.0 - alpha) * texture(sampler, coords); +return color; +} +vec4 getPixel(vec2 pixelLocation) { +return sampleBilinear(u_image, pixelLocation, u_srcImageSize); +}`):t.fragment.code.add(w`vec4 getPixel(vec2 pixelLocation) { +return texture(u_image, pixelLocation); +}`)}var Ae;(function(t){t[t.Normal=0]="Normal",t[t.Average=1]="Average",t[t.Lighten=2]="Lighten",t[t.Lighter=3]="Lighter",t[t.Plus=4]="Plus",t[t.Screen=5]="Screen",t[t.ColorDodge=6]="ColorDodge",t[t.Darken=7]="Darken",t[t.Multiply=8]="Multiply",t[t.ColorBurn=9]="ColorBurn",t[t.Overlay=10]="Overlay",t[t.SoftLight=11]="SoftLight",t[t.HardLight=12]="HardLight",t[t.VividLight=13]="VividLight",t[t.Hue=14]="Hue",t[t.Saturation=15]="Saturation",t[t.Luminosity=16]="Luminosity",t[t.Color=17]="Color",t[t.DestinationOver=18]="DestinationOver",t[t.DestinationAtop=19]="DestinationAtop",t[t.DestinationIn=20]="DestinationIn",t[t.DestinationOut=21]="DestinationOut",t[t.SourceAtop=22]="SourceAtop",t[t.SourceIn=23]="SourceIn",t[t.SourceOut=24]="SourceOut",t[t.Xor=25]="Xor",t[t.Difference=26]="Difference",t[t.Exclusion=27]="Exclusion",t[t.Minus=28]="Minus",t[t.Invert=29]="Invert",t[t.Reflect=30]="Reflect",t[t.COUNT=31]="COUNT"})(Ae||(Ae={}));const TW={normal:Ae.Normal,average:Ae.Average,lighten:Ae.Lighten,lighter:Ae.Lighter,screen:Ae.Screen,plus:Ae.Plus,"color-dodge":Ae.ColorDodge,darken:Ae.Darken,multiply:Ae.Multiply,"color-burn":Ae.ColorBurn,overlay:Ae.Overlay,"soft-light":Ae.SoftLight,"hard-light":Ae.HardLight,"vivid-light":Ae.VividLight,hue:Ae.Hue,saturation:Ae.Saturation,luminosity:Ae.Luminosity,color:Ae.Color,difference:Ae.Difference,exclusion:Ae.Exclusion,minus:Ae.Minus,invert:Ae.Invert,reflect:Ae.Reflect,"destination-over":Ae.DestinationOver,"destination-atop":Ae.DestinationAtop,"destination-in":Ae.DestinationIn,"destination-out":Ae.DestinationOut,"source-atop":Ae.SourceAtop,"source-in":Ae.SourceIn,"source-out":Ae.SourceOut,xor:Ae.Xor};function Egt(t){return t===Ae.DestinationOver||t===Ae.DestinationAtop||t===Ae.DestinationIn||t===Ae.DestinationOut||t===Ae.SourceAtop||t===Ae.SourceIn||t===Ae.SourceOut||t===Ae.Xor}function fK(t){t.code.add(w` + float lineFactorAtPosition(float value) { + float pos = value * ${w.float(257)}; + if(pos < 0.5 || pos > ${w.float(257-.5)}) { + return 1.0; + } + + pos = pos + 0.5; + float modulo = mod(pos, 16.0); + return modulo <= 2.0 ? 1.0 - abs(modulo - 1.0) : 0.0; + } + + float lineFactorAtUV(vec2 uv) { + return max(lineFactorAtPosition(uv.x), lineFactorAtPosition(uv.y)); + } + + float lineFactor(vec2 uv) { + vec2 offset = fwidth(uv) * 0.25; + return (lineFactorAtUV(vec2(uv.x + offset.x, uv.y + offset.y)) + + lineFactorAtUV(vec2(uv.x - offset.x, uv.y + offset.y)) + + lineFactorAtUV(vec2(uv.x + offset.x, uv.y - offset.y)) + + lineFactorAtUV(vec2(uv.x - offset.x, uv.y - offset.y))) / 4.0; + } + + vec3 gridColor(vec2 uv) { + float line = lineFactor(uv) * 0.1 + 0.9; + return vec3(1.0, 0.972, 0.918) * line; + }`)}function Cgt(t,e){const r=e.blendMode;r!==Ae.Normal&&(r===Ae.Reflect&&t.code.add(w`float reflectBlend(in float cb, in float cl) { +return (cl == 1.0) ? cl : min(cb * cb / (1.0 - cl), 1.0); +}`),r!==Ae.ColorDodge&&r!==Ae.VividLight||t.code.add(w`float colorDodge(in float cb, in float cl) { +return (cb == 0.0) ? 0.0 : (cl == 1.0) ? 1.0 : min(1.0, cb / (1.0 - cl)); +}`),r!==Ae.ColorBurn&&r!==Ae.VividLight||t.code.add(w`float colorBurn(in float cb, in float cl) { +return (cb == 1.0) ? 1.0 : (cl == 0.0) ? 0.0 : 1.0 - min(1.0, (1.0 - cb) / cl); +}`),r===Ae.Overlay&&t.code.add(w`float overlay(in float cb, in float cl) { +return (1.0 - step(0.5, cl)) * (1.0 - 2.0 * (1.0 - cl ) * (1.0 - cb)) + step(0.5, cl) * (2.0 * cl * cb); +}`),r===Ae.HardLight&&t.code.add(w`float hardLight(in float cb, in float cl) { +return (1.0 - step(0.5, cl)) * (2.0 * cl * cb) + step(0.5, cl) * (1.0 - 2.0 * (1.0 - cl) * (1.0 - cb)); +}`),r===Ae.SoftLight&&t.code.add(w`float softLight(in float cb, in float cl) { +if (cl <= 0.5) { +return cb - (1.0 - 2.0 * cl) * cb * (1.0 - cb); +} +if (cb <= 0.25) { +return cb + (2.0 * cl - 1.0) * cb * ((16.0 * cb - 12.0) * cb + 3.0); +} +return cb + (2.0 * cl - 1.0) * (sqrt(cb) - cb); +}`),r===Ae.VividLight&&t.code.add(w`float vividLight(in float cb, in float cl) { +return (1.0 - step(0.5, cl)) * colorBurn(cb, 2.0 * cl) + step(0.5, cl) * colorDodge(cb, (2.0 * (cl - 0.5))); +}`),r!==Ae.Hue&&r!==Ae.Saturation&&r!==Ae.Color&&r!==Ae.Luminosity||(t.code.add(w`float minv3(in vec3 c) { +return min(min(c.r, c.g), c.b); +} +float maxv3(in vec3 c) { +return max(max(c.r, c.g), c.b); +} +float lumv3(in vec3 c) { +return dot(c, vec3(0.3, 0.59, 0.11)); +} +vec3 clipColor(vec3 color) { +float lum = lumv3(color); +float mincol = minv3(color); +float maxcol = maxv3(color); +if (mincol < 0.0) { +color = lum + ((color - lum) * lum) / (lum - mincol); +} +if (maxcol > 1.0) { +color = lum + ((color - lum) * (1.0 - lum)) / (maxcol - lum); +} +return color; +} +vec3 setLum(vec3 cbase, vec3 clum) { +return clipColor(cbase + vec3(lumv3(clum) - lumv3(cbase))); +}`),r!==Ae.Hue&&r!==Ae.Saturation||t.code.add(w`float satv3(vec3 c) { +return maxv3(c) - minv3(c); +} +vec3 setLumSat(vec3 cbase, vec3 csat, vec3 clum) +{ +float minbase = minv3(cbase); +float sbase = satv3(cbase); +float ssat = satv3(csat); +return setLum(sbase > 0.0 ? (cbase - minbase) * ssat / sbase : vec3(0.0), clum); +}`)),t.code.add(w` + vec4 applyBlendMode(vec3 cl, float ol, vec3 cb, float ob) { + ${r===Ae.Multiply?w`return vec4(cl * ol * cb * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.Average?w`return vec4((cb + cl) * 0.5 * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.Lighten?w`return vec4(max(cb, cl) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.Darken?w`return vec4(min(cl, cb) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.Lighter?w`return vec4(cl * ol + cb * ob, ol + ob);`:r===Ae.Plus?w`return clamp(vec4(cl.rgb + cb.rgb, ol + ob), 0.0, 1.0);`:r===Ae.Minus?w`return vec4(clamp(vec3(cb.rgb - cl.rgb), 0.0, 1.0), ob * ol);`:r===Ae.Screen?w`return vec4((cl + cb - cl * cb) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.Difference?w`return vec4(abs(cb - cl) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.Invert?w`return vec4((1.0 - cb) * ol * ob + cb * ob * (1.0 - ol), ob);`:r===Ae.DestinationOver?w`return vec4(cl * ol * (1.0 - ob) + cb * ob, ol + ob - ol * ob);`:r===Ae.DestinationAtop?w`return vec4(cl * ol * (1.0 - ob) + cb * ob * ol, ol);`:r===Ae.DestinationOut?w`return vec4(cb * ob * (1.0 - ol), ob * (1.0 - ol));`:r===Ae.SourceAtop?w`return vec4(cl * ol * ob + cb * ob * (1.0 - ol), ob);`:r===Ae.SourceOut?w`return vec4(cl * ol * (1.0 - ob), ol * (1.0 - ob));`:r===Ae.Xor?w`return vec4(cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), ol * (1.0 - ob) + ob * (1.0 - ol));`:r===Ae.DestinationIn?w`return vec4(cb * ob * ol, ol * ob);`:r===Ae.SourceIn?w`return vec4(cl * ol * ob, ol * ob);`:r===Ae.Hue?w` + vec3 f = setLumSat(cl, cb, cb); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.Saturation?w` + vec3 f = setLumSat(cb, cl, cb); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.Color?w` + vec3 f = setLum(cl, cb); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.Luminosity?w` + vec3 f = setLum(cb, cl); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.Exclusion?w` + vec3 f = cl + cb - 2.0 * cl * cb; + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.Reflect?w` + vec3 f = vec3(reflectBlend(cb.r, cl.r), reflectBlend(cb.g, cl.g), reflectBlend(cb.b, cl.b)); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.ColorDodge?w` + vec3 f = vec3(colorDodge(cb.r, cl.r), colorDodge(cb.g, cl.g), colorDodge(cb.b, cl.b)); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.ColorBurn?w` + vec3 f = vec3(colorBurn(cb.r, cl.r), colorBurn(cb.g, cl.g), colorBurn(cb.b, cl.b)); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.Overlay?w` + vec3 f = vec3(overlay(cb.r, cl.r), overlay(cb.g, cl.g), overlay(cb.b, cl.b)); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.SoftLight?w` + vec3 f = vec3(softLight(cb.r, cl.r), softLight(cb.g, cl.g), softLight(cb.b, cl.b)); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.HardLight?w` + vec3 f = vec3(hardLight(cb.r, cl.r), hardLight(cb.g, cl.g), hardLight(cb.b, cl.b)); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:r===Ae.VividLight?w` + vec3 f = vec3(vividLight(cb.r, cl.r), vividLight(cb.g, cl.g), vividLight(cb.b, cl.b)); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:w``} + } + `))}var ws,Zd,Nd;(function(t){t[t.Composite=0]="Composite",t[t.ColorComposite=1]="ColorComposite",t[t.GridComposite=2]="GridComposite",t[t.GroupBackgroundComposite=3]="GroupBackgroundComposite",t[t.COUNT=4]="COUNT"})(ws||(ws={})),function(t){t[t.NotRequired=0]="NotRequired",t[t.Required=1]="Required",t[t.COUNT=2]="COUNT"}(Zd||(Zd={})),function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.COUNT=2]="COUNT"}(Nd||(Nd={}));function zOe(t,e){const r=e.output===ws.GridComposite,i=e.output===ws.ColorComposite,n=e.output===ws.GroupBackgroundComposite,s=e.output===ws.Composite;r&&t.fragment.include(fK),i&&t.fragment.uniforms.add(new Lt("backgroundColor",c=>c.backgroundColor));const o=e.baseOpacityMode===Zd.Required;o&&t.fragment.uniforms.add(new Ce("baseOpacity",c=>c.baseOpacity)),s&&t.fragment.uniforms.add(new Ye("fboColor",c=>c.fboTexture));const a=e.blendMode!==Ae.Normal,l=e.premultipliedSource===Nd.On;t.fragment.include(Cgt,e),t.fragment.code.add(w` + vec4 getBackground(vec2 uv) { + return ${o?w`baseOpacity *`:""} ${n?w`vec4(0.0, 0.0, 0.0, 0.0)`:i?w`vec4(backgroundColor, 1.0)`:r?w`vec4(gridColor(uv), 1.0)`:w`texelFetch(fboColor, ivec2(gl_FragCoord.xy), 0)`}; + } + + vec4 blendLayers(vec4 bgColor, vec4 colorLayer, float opacity) { + ${a?w` + vec3 cl = colorLayer.a == 0.0 ? colorLayer.rgb : colorLayer.rgb / colorLayer.a; + vec3 cb = bgColor.a == 0.0 ? bgColor.rgb : bgColor.rgb / bgColor.a; + return applyBlendMode(clamp(cl, vec3(0.0), vec3(1.0)), colorLayer.a * opacity, cb, bgColor.a);`:w` + float composeAlpha = colorLayer.a * opacity; + return ${!l&&(s&&!o||n)?w`colorLayer * opacity;`:w`bgColor * (1.0 - composeAlpha) + colorLayer * opacity;`}`} + }`)}let tU=class extends Tgt{constructor(e,r,i,n,s,o){super(e,n,s),this.colormap=r,this.symbolizer=i,this.u_colormap=o,this.backgroundColor=Zs,this.fboTexture=null,this.baseOpacity=1}},Agt=class extends tU{},Ogt=class extends tU{};function Rgt(t){const e=new mr;return e.include(kOe),e.include(Sgt,t),e.include(wgt,t),e.include(zOe,t),e.fragment.code.add(w`vec4 applyBackgroundBlend(vec4 layerColor) { +vec4 bgColor = getBackground(vuv); +return blendLayers(bgColor, layerColor, u_opacity); +}`),t.colorizerType===kb.Stretch?Mgt(e,t):t.colorizerType===kb.Lut?Pgt(e):t.colorizerType===kb.Hillshade&&$gt(e,t),e}function Pgt(t){t.fragment.code.add(w`void main() { +vec2 pixelLocation = getPixelLocation(uv); +if (isOutside(pixelLocation)) { +fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0)); +return; +} +vec4 currentPixel = getPixel(pixelLocation); +fragColor = applyBackgroundBlend(colormap(currentPixel, true)); +}`)}function Mgt(t,e){t.fragment.uniforms.add(new QP("u_bandCount",i=>i.symbolizer.u_bandCount),new Sl("u_minCutOff",i=>i.symbolizer.u_minCutOff,3),new Sl("u_maxCutOff",i=>i.symbolizer.u_maxCutOff,3),new Sl("u_factor",i=>i.symbolizer.u_factor,3),new Ce("u_minOutput",i=>i.symbolizer.u_minOutput),new Ce("u_maxOutput",i=>i.symbolizer.u_maxOutput),new kf("u_useGamma",i=>i.symbolizer.u_useGamma),new Sl("u_gamma",i=>i.symbolizer.u_gamma,3),new Sl("u_gammaCorrection",i=>i.symbolizer.u_gammaCorrection,3),new Ce("u_opacity",i=>i.common.u_opacity)),t.fragment.code.add(w`float stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, bool useGamma, float gamma, float gammaCorrection) { +if (val >= maxCutOff) { +return maxOutput; +} else if (val <= minCutOff) { +return minOutput; +} +float stretchedVal; +if (useGamma) { +float tempf = 1.0; +float outRange = maxOutput - minOutput; +float relativeVal = (val - minCutOff) / (maxCutOff - minCutOff); +if (gamma > 1.0) { +tempf -= pow(1.0 / outRange, relativeVal * gammaCorrection); +} +stretchedVal = (tempf * outRange * pow(relativeVal, 1.0 / gamma) + minOutput) / 255.0; +} else { +stretchedVal = minOutput + (val - minCutOff) * factor; +} +return stretchedVal; +}`);const r=e.applyColormap?w`fragColor = applyBackgroundBlend(colormap(vec4(grayVal, grayVal, grayVal, currentPixel.a), !u_useGamma));`:w`fragColor = applyBackgroundBlend(vec4(grayVal, grayVal, grayVal, currentPixel.a));`;t.fragment.code.add(w` + void main() { + vec2 pixelLocation = getPixelLocation(uv); + if (isOutside(pixelLocation)) { + fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0)); + return; + } + + vec4 currentPixel = getPixel(pixelLocation); + ${e.stretchType===Tw.Noop?w` + fragColor = applyBackgroundBlend(currentPixel);`:w` + if (currentPixel.a == 0.0) { + fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0)); + return; + } + if (u_bandCount == 1) { + float grayVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]); + ${r} + } else { + float redVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]); + float greenVal = stretchOneValue(currentPixel.g, u_minCutOff[1], u_maxCutOff[1], u_minOutput, u_maxOutput, u_factor[1], u_useGamma, u_gamma[1], u_gammaCorrection[1]); + float blueVal = stretchOneValue(currentPixel.b, u_minCutOff[2], u_maxCutOff[2], u_minOutput, u_maxOutput, u_factor[2], u_useGamma, u_gamma[2], u_gammaCorrection[2]); + fragColor = applyBackgroundBlend(vec4(redVal, greenVal, blueVal, currentPixel.a)); + }`} + }`)}function $gt(t,e){const r=t.fragment;r.uniforms.add(new Ye("u_image",n=>n.u_image),new QP("u_hillshadeType",n=>n.symbolizer.u_hillshadeType),new Sl("u_sinZcosAs",n=>n.symbolizer.u_sinZcosAs,6),new Sl("u_sinZsinAs",n=>n.symbolizer.u_sinZsinAs,6),new Sl("u_cosZs",n=>n.symbolizer.u_cosZs,6),new Sl("u_weights",n=>n.symbolizer.u_weights,6),new yr("u_factor",n=>n.symbolizer.u_factor),new Ce("u_minValue",n=>n.symbolizer.u_minValue),new Ce("u_maxValue",n=>n.symbolizer.u_maxValue),new yr("u_srcImageSize",n=>n.common.u_srcImageSize)),r.include(cm),r.code.add(w`vec4 overlay(float val, float minValue, float maxValue, float hillshade, float alpha) { +val = clamp((val - minValue) / (maxValue - minValue), 0.0, 1.0); +vec4 color = colormap(vec4(val, val, val, 1.0), false); +vec3 hsv = rgb2hsv(color.rgb); +hsv.z = hillshade; +return vec4(hsv2rgb(hsv), 1.0) * alpha * color.a; +}`),r.code.add(w`float getNeighborHoodAlpha(float a, float b, float c, float d, float e, float f, float g, float h, float i){ +if (a == 0.0 || a == 0.0 || a==0.0 || a == 0.0 || a == 0.0 || a==0.0 || a == 0.0 || a == 0.0 || a==0.0) { +return 0.0; +} else { +return e; +} +}`);const i=e.applyColormap?w`fragColor = applyBackgroundBlend(overlay(ve.r, u_minValue, u_maxValue, hillshade, alpha));`:w`hillshade *= alpha; +fragColor = applyBackgroundBlend(vec4(hillshade, hillshade, hillshade, alpha));`;r.code.add(w` + void main() { + vec2 pixelLocation = getPixelLocation(uv); + if (isOutside(pixelLocation)) { + fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0)); + return; + } + + vec4 currentPixel = getPixel(pixelLocation); + if (currentPixel.a == 0.0) { + fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0)); + return; + } + + //mirror edge pixels + vec2 axy = vec2(-1.0, -1.0); + vec2 bxy = vec2(0.0, -1.0); + vec2 cxy = vec2(1.0, -1.0); + vec2 dxy = vec2(-1.0, 0.0); + vec2 fxy = vec2(1.0, 0.0); + vec2 gxy = vec2(-1.0, 1.0); + vec2 hxy = vec2(0.0, 1.0); + vec2 ixy = vec2(1.0, 1.0); + vec2 onePixel = 1.0 / u_srcImageSize; + if (pixelLocation.s < onePixel.s) { + axy[0] = 1.0; + dxy[0] = 1.0; + gxy[0] = 1.0; + } + if (pixelLocation.t < onePixel.t) { + axy[1] = 1.0; + bxy[1] = 1.0; + cxy[1] = 1.0; + } + if (pixelLocation.s > 1.0 - onePixel.s) { + cxy[0] = -1.0; + fxy[0] = -1.0; + ixy[0] = -1.0; + } + if (pixelLocation.t > 1.0 - onePixel.t) { + gxy[1] = -1.0; + hxy[1] = -1.0; + ixy[1] = -1.0; + } + + // calculate hillshade + vec4 va = texture(u_image, pixelLocation + onePixel * axy); + vec4 vb = texture(u_image, pixelLocation + onePixel * bxy); + vec4 vc = texture(u_image, pixelLocation + onePixel * cxy); + vec4 vd = texture(u_image, pixelLocation + onePixel * dxy); + vec4 ve = texture(u_image, pixelLocation); + vec4 vf = texture(u_image, pixelLocation + onePixel * fxy); + vec4 vg = texture(u_image, pixelLocation + onePixel * gxy); + vec4 vh = texture(u_image, pixelLocation + onePixel * hxy); + vec4 vi = texture(u_image, pixelLocation + onePixel * ixy); + + // calculate the rate of z change along the x, y, and diagonal direction + float dzx = (vc + 2.0 * vf + vi - va - 2.0 * vd - vg).r * u_factor.s; + float dzy = (vg + 2.0 * vh + vi - va - 2.0 * vb - vc).r * u_factor.t; + float dzd = sqrt(1.0 + dzx * dzx + dzy * dzy); + float hillshade = 0.0; + + // traditional single light source + if (u_hillshadeType == 0){ + float cosDelta = u_sinZsinAs[0] * dzy - u_sinZcosAs[0] * dzx; + float z = (u_cosZs[0] + cosDelta) / dzd; + if (z < 0.0) z = 0.0; + hillshade = z; + } else { + // multi-directional with 6 light sources + for (int k = 0; k < 6; k++) { + float cosDelta = u_sinZsinAs[k] * dzy - u_sinZcosAs[k] * dzx; + float z = (u_cosZs[k] + cosDelta) / dzd; + if (z < 0.0) z = 0.0; + hillshade = hillshade + z * u_weights[k]; + if (k == 5) break; + } + } + + // set color + float alpha = getNeighborHoodAlpha(va.a, vb.a, vc.a, vd.a, ve.a, vf.a, vg.a, vh.a, vi.a); + alpha *= u_opacity; + ${i} + } + `)}const Igt=Object.freeze(Object.defineProperty({__proto__:null,ColorizerHillshadeUniforms:Ogt,ColorizerStretchUniforms:Agt,ColorizerUniforms:tU,build:Rgt},Symbol.toStringTag,{value:"Module"}));function Lgt(t,e,r="nearest",i=!1){var c;const n=!(i&&e.pixelType==="u8"),s=n?Un.FLOAT:Un.UNSIGNED_BYTE,o=e.pixels==null||e.pixels.length===0?null:n?e.getAsRGBAFloat():e.getAsRGBA(),a=(c=t.capabilities.textureFloat)==null?void 0:c.textureFloatLinear,l=new pr;return l.width=e.width,l.height=e.height,l.internalFormat=t.type===rr.WEBGL2&&n?qe.RGBA32F:Tt.RGBA,l.samplingMode=!a||r!=="bilinear"&&r!=="cubic"?At.NEAREST:At.LINEAR,l.dataType=s,l.wrapMode=Pt.CLAMP_TO_EDGE,new Ct(t,l,o)}function Dgt(t,e){const{spacing:r,offsets:i,coefficients:n,size:[s,o]}=e,a=r[0]>1,l=new pr;l.width=a?4*s:s,l.height=o,l.internalFormat=t.type===rr.WEBGL2?qe.RGBA32F:Tt.RGBA,l.dataType=Un.FLOAT,l.samplingMode=At.NEAREST,l.wrapMode=Pt.CLAMP_TO_EDGE;const c=new Float32Array(a?s*o*16:2*i.length);if(a&&n!=null)for(let u=0,d=0;u0?this._bandIds&&e.every((r,i)=>{var n;return!!((n=this._bandIds)!=null&&n[i])&&r===this._bandIds[i]})||(this._bandIds=e,this._dirty=!0):this._bandIds=null}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){if(this._interpolation=e,this._rasterTexture!=null){const r=this._getRasterTextureInterpolation(e);this._rasterTexture.setSamplingMode(r==="bilinear"?At.LINEAR:At.NEAREST)}}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid=e,this._transformGridTexture=Le(this._transformGridTexture),this._memoryUsed=null}bind(e){return!!(this.source&&this.source.pixels&&this.source.pixels.length>0)&&((this._rasterTexture==null||this._dirty)&&this._updateRasterTexture(e,this.bandIds),this._rasterTexture!=null&&(this._updateColormapTexture(e),this.transformGrid&&this._transformGridTexture==null&&(this._transformGridTexture=Dgt(e,this.transformGrid))),!0)}getUniforms(){const{symbolizerParameters:e,transformGrid:r,width:i,height:n,opacity:s}=this,o=Ngt(r,[i,n],[this.source.width,this.source.height],s),a=Fgt(e.colormap,e.colormapOffset),l=this.symbolizerParameters.type==="stretch"?Ugt(this.symbolizerParameters):null,c=this.symbolizerParameters.type==="hillshade"?kgt(this.symbolizerParameters):null;return new tU(o,a,l||c,this._rasterTexture,this._transformGridTexture,this._colormapTexture)}get isBilinearWithStretchColorRamp(){const{symbolizerParameters:e}=this;return this.interpolation==="bilinear"&&e.colormap!=null&&e.type==="stretch"}get memoryUsage(){if(this._memoryUsed==null){const e=[this._rasterTexture,this._transformGridTexture,this._colormapTexture];this._memoryUsed=e.map(r=>r!=null?r.descriptor.width*r.descriptor.height*4:0).reduce((r,i)=>r+i,0)}return this._memoryUsed}release(){return this._rasterTexture=Le(this._rasterTexture),this._transformGridTexture=Le(this._transformGridTexture),this._colormapTexture=Le(this._colormapTexture),this.source=null,this.transformGrid=null,this.rawPixelData=null,!0}_updateRasterTexture(e,r){const i=this.source?this.source.extractBands(r):null;if(!(i&&i.pixels&&i.pixels.length>0))return void(this._rasterTexture=Le(this._rasterTexture));const n=r==null&&this.bandIds==null||r!=null&&this.bandIds!=null&&r.join("")===this.bandIds.join("");if(this._rasterTexture!=null&&n)return;this._rasterTexture=Le(this._rasterTexture);const s=this._getRasterTextureInterpolation(this.interpolation);this._rasterTexture=Lgt(e,i,s,this.isRendereredSource||this.hasStretchTypeNone())}hasStretchTypeNone(){return"stretchType"in this.symbolizerParameters&&this.symbolizerParameters.stretchType==="none"&&!this.symbolizerParameters.useGamma&&this.source.pixelType==="u8"}_getRasterTextureInterpolation(e){return this.symbolizerParameters.type==="lut"||e==="nearest"||e==="majority"||this.isBilinearWithStretchColorRamp?"nearest":"bilinear"}_updateColormapTexture(e){const r=this._colormap,i=this.symbolizerParameters.colormap;return i?r?i.length!==r.length||i.some((n,s)=>n!==r[s])?(this._colormapTexture=Le(this._colormapTexture),this._colormapTexture=kce(e,i),void(this._colormap=i)):void 0:(this._colormapTexture=kce(e,i),void(this._colormap=i)):(this._colormapTexture=Le(this._colormapTexture),void(this._colormap=null))}},nN=class{constructor(){this.waitingAgents=new Nt,this._upsampleInfo=null,this.loadingAgent=null,this.requestPromise=null,this.requestAbort=null,this.pendingUpdates=0}static acquire(e){const r=Lz.acquire();return r._init(e),r}release(){this.dispose(),sN.delete(this),Lz.release(this)}dispose(){this.loadingAgent=Le(this.loadingAgent),this.abortRequest(),this._unsetUpsampleInfo(),this.pendingUpdates=0,this._data=YT(this._data)}static prune(){Lz.prune(0)}_init(e){this.waitingAgents.clear(),this._data=YT(this._data),this.dataMissing=!1,this.dataInvalidated=!1,this._unsetUpsampleInfo(),this.abortRequest(),this.loadingAgent=null,this.pendingUpdates=0,this._pool=e,this.elevationBounds=null}invalidateSourceData(){this.dataInvalidated=!0,this.dataMissing=!1,this._unsetUpsampleInfo()}abortRequest(){this.requestAbort=yu(this.requestAbort),this.requestPromise=null}get upsampleInfo(){return this._upsampleInfo}_unsetUpsampleInfo(){this._upsampleInfo!=null&&(this._upsampleInfo.tile.unrefMapData(),this._pool.release(this._upsampleInfo),this._upsampleInfo=null)}setUpsampleInfo(e,r){if(e!==r&&r!=null){if(this._upsampleInfo==null)this._upsampleInfo=this._pool.acquire();else{if(this._upsampleInfo.tile===r)return;this._upsampleInfo.tile.unrefMapData()}r.refMapData(),_gt(e,r,this._upsampleInfo)}else this._unsetUpsampleInfo()}get data(){return this._data}set data(e){YT(this._data),this._data=e}};const Lz=new ko(nN,null,()=>{}),sN=new Map;function Bgt(){sN.size>0&&(console.log(`${sN.size} live TilePerLayerInfo allocations:`),sN.forEach(t=>console.log(t,` +`)))}let L2=class{constructor(e){this._texture=e,this.type="tile-texture",this._refCount=1}retain(){++this._refCount}release(){--this._refCount,this._refCount===0&&this._texture.dispose()}get texture(){return this._texture}generateMipmap(){this._texture.generateMipmap()}get descriptor(){return this._texture.descriptor}get gpuMemoryUsage(){return this._texture.gpuMemoryUsage}};var gt;(function(t){t[t.NONE=0]="NONE",t[t.SPLIT=1]="SPLIT",t[t.ELEVATION=2]="ELEVATION",t[t.MERGE=4]="MERGE",t[t.RENDERDATA=8]="RENDERDATA",t[t.GEOMETRY=16]="GEOMETRY",t[t.TEXTURE_NOFADING=32]="TEXTURE_NOFADING",t[t.TEXTURE_FADING=64]="TEXTURE_FADING"})(gt||(gt={}));const Vgt=.1;let mK=class{constructor(){this.lij=[0,0,0],this._children=[null,null,null,null],this._pendingUpdates=0,this.renderData=null,this._dirty=!0,this._previouslyRendered=!1,this.extent=jt(),this._elevationBounds=Ne(),this.layerInfo=[[],[]],this.extentInRadians=jt(),this.centerAtSeaLevel=O(),this._center=[O(),vn(),O()],this.up=sY(),this._isWithinClippingArea=!0,this._intersectsClippingArea=!0,this._maxTesselation=0,this._usedMemory=null,this._mapTileMemoryInternal=0,this._mapDataRefCount=0,this.screenDepth=0,this.renderOrder=0,this._edgeLen=0,this._edgeLen2=0,this._curvatureHeight=0,this.extentMidX=0,this.extentMidY=0,this.distanceToPOI=-1,this._lastPOI=O()}static prune(){gK.prune(0),yK.prune(0),nN.prune()}get _isCached(){return!this.shouldLoad&&this._mapDataRefCount<=0}get maxTesselation(){return this._maxTesselation}get isWithinClippingArea(){return this._isWithinClippingArea}get intersectsClippingArea(){return this._intersectsClippingArea}get clippingArea(){return this._clippingArea}get parent(){return this._parent}get children(){return this._children}get surface(){return this._surface}get elevationBounds(){return this._elevationBounds}get level(){return this.lij[0]}get key(){return`${this.lij[0]}/${this.lij[1]}/${this.lij[2]}`}get edgeLen(){return this._edgeLen}get radius(){return this._center[Dn.MIDDLE][3]}get visible(){return this._dirty&&this.computeVisibility(),this._visible}get frustumVisibility(){return this._dirty&&this.computeVisibility(),this._frustumVisibility}computeVisibility(){this._dirty=!1;const e=this.parent,r=(e==null?void 0:e.frustumVisibility)??sa.INTERSECTS;this._frustumVisibility=r===sa.INSIDE?sa.INSIDE:r===sa.OUTSIDE?sa.OUTSIDE:this._calculateFrustumVisibilityStatus(this.surface.frustum);const i=this._frustumVisibility!==sa.OUTSIDE&&this._intersectsClippingArea;i!==this._visible&&(this._visible=i,this._surface.emit("tiles-visibility-changed"),this._surface.renderer.setDirty(),this.updateAgentSuspension())}get loadable(){return this.visible||this._surface.view.state.fixedContentCamera}get rendered(){const e=!!this.renderData;return e!==this._previouslyRendered&&(this._surface.emit("tiles-visibility-changed"),this._previouslyRendered=e,this._surface.renderer.setDirty()),e}get shouldLoad(){return this.isLeaf}init(e,r,i){this.lij[0]=e[0],this.lij[1]=e[1],this.lij[2]=e[2],this.ellipsoid=Mr(i.tilingScheme.spatialReference),i.tilingScheme.getExtent(e[0],e[1],e[2],this.extent),i.tilingScheme.convertExtentToRadians(this.extent,this.extentInRadians),this.extentMidX=.5*(this.extent[0]+this.extent[2]),this.extentMidY=.5*(this.extent[1]+this.extent[3]),this._isWithinClippingArea=!0,this._intersectsClippingArea=!0,this._clippingArea=null,this._mapDataRefCount=0,i.upsampleMapCache.pop(this.key),this._edgeLen=0,this._edgeLen2=0,this._center[Dn.MIDDLE][3]=0,this.elevationLevel=e?e[0]:0,r&&r.elevationBounds?fs(this._elevationBounds,r.elevationBounds):er(this._elevationBounds,0,0),this._pendingUpdates=0,this.renderData=null,this.screenDepth=0,this._visible=!1,this._previouslyRendered=!1,this._parent=r,this.unsetChildren(),this._surface=i,this.updateVisibility();for(const n of Uv){const s=i.numLayers(n),o=this.layerInfo[n];for(const a of o)a.release();o.length=s;for(let a=0;a0&&this._surface.upsampleMapCache.put(this.key,this,e)}}setMemoryDirty(){this._usedMemory=null}get usedMemory(){return this._ensureUsedMemory()+(this._isCached?0:this._mapTileMemoryInternal)}get _cachedMemory(){return this._isCached?this._mapTileMemory:0}get _mapTileMemory(){return this._ensureUsedMemory(),this.layerInfo[Zt.MAP].reduce((e,r)=>e+(r instanceof Iz?r.memoryUsed/r.referenced:0),this._mapTileMemoryInternal)}get _cpuImageMemorySize(){const r=this._surface.tilingScheme.pixelSize;return r*r*4}_ensureUsedMemory(){var i;if(this._usedMemory!=null)return this._usedMemory;this._usedMemory=0,this._mapTileMemoryInternal=0;let e=0;for(const{data:n}of this.layerInfo[Zt.MAP])n instanceof Iz?e+=this._getTerrainDataMemory(n):this._mapTileMemoryInternal+=this._getTerrainDataMemory(n);const r=this._cpuImageMemorySize;for(const n of this.layerInfo[Zt.ELEVATION])this._usedMemory+=n.data?r:0;return this.renderData&&(this._usedMemory+=this.renderData.estimatedGeometryMemoryUsage,this._mapTileMemoryInternal+=((i=this.renderData.texture)==null?void 0:i.gpuMemoryUsage)??0),this._isCached&&this._surface.upsampleMapCache.updateSize(this.key,this,this._mapTileMemoryInternal+e),this._usedMemory}getUsedMemoryForLayer(e,r){const i=this.layerInfo[e][r];return i!=null&&i.data?e===Zt.MAP?this._isCached?0:this._getTerrainDataMemory(i.data):e===Zt.ELEVATION?this._cpuImageMemorySize:0:0}_getTerrainDataMemory(e){return e instanceof L2?e.texture.gpuMemoryUsage:e instanceof HTMLImageElement||e instanceof Q8?this._cpuImageMemorySize:e instanceof zgt?e.memoryUsage:e instanceof Iz?e.memoryUsed/e.referenced:0}updateScreenDepth(e){const r=this._center[Dn.MIDDLE],i=e,n=r[0],s=r[1],o=r[2],a=i[2]*n+i[6]*s+i[10]*o+i[14];this.screenDepth=a<0?0:a/(i[3]*n+i[7]*s+i[11]*o+i[15])}shouldSplit(e,r,i){if(!this.visible||e.frustum!=null&&(!this._intersectsClippingArea||this._calculateFrustumVisibilityStatus(e.frustum)===sa.OUTSIDE))return gt.NONE;const n=this.level;ae(ZI,this._center[Dn.MIDDLE],r);let s=la(ZI),o=ZI,a=Dn.MIDDLE;ae(Dz,this._center[Dn.TOP],r);const l=la(Dz);ls&&n{if(n0&&b<.001&&_/d-Math.sin(this._curvatureHeight/(this.edgeLen*Math.SQRT1_2)*Math.PI)-b>0)return gt.NONE;const x=i!=null?3-Math.min(u,2):1;if(m*x=e.maxLod)return y();if(n<7)return gt.SPLIT;te(so,this.up,_),ae(so,so,o);const T=la(so);if(T<=this.radius*this.radius)return gt.SPLIT;te(so,so,this.radius/Math.sqrt(T)),oe(so,so,this._center[a]),ae(so,r,so);const S=Math.min(1,(Math.abs(fe(so,this.up))+.5*v+this._curvatureHeight)/Te(so)),A=Vgt/e.angledSplitBias,C=e.fovY*d*2;return S*(this._edgeLen/C*x){n.requestPromise===s&&(n.requestPromise=null,n.requestAbort=null)};return n.requestPromise=s,s.then(o,o),!0}get isLeaf(){return this._children[0]==null}hasLij(e){return this.lij[0]===e[0]&&this.lij[1]===e[1]&&this.lij[2]===e[2]}findByLij(e){if(this.hasLij(e))return this;const r=this._children;return r[0]?r[0].findByLij(e)||r[1].findByLij(e)||r[2].findByLij(e)||r[3].findByLij(e):null}distanceToSquared(e){return la(ae(so,this._center[Dn.MIDDLE],e))}containsPoint(e){const r=this.extent;return e[0]>=r[0]&&e[1]>=r[1]&&e[0]<=r[2]&&e[1]<=r[3]}containsPointXY(e,r){const i=this.extent;return e>=i[0]&&r>=i[1]&&e<=i[2]&&r<=i[3]}unrequestLayerData(e,r,i){const n=this.layerInfo[r][e],s=n.waitingAgents,o=s.removeUnordered(i)!=null;_f(o,"agent has not requested this piece of map data"),s.length<1&&(n.abortRequest(),this.setMemoryDirty())}dataArrived(e,r,i){const n=i!=null&&"type"in i&&i.type==="vector-tile",s=this.layerInfo[r][e];s.data=i,s.dataInvalidated=!1,s.waitingAgents.forAll(o=>o.dataArrived(this,n)),s.waitingAgents.clear(),this.setMemoryDirty()}dataMissing(e,r,i){i.notInTilemap||console.error(`Tile ${this.lij.toString()} layer ${r}/${e} error ${i}`);const n=this.layerInfo[r][e];n.dataMissing=!0,n.waitingAgents.forAll(s=>s.dataMissing()),n.waitingAgents.clear(),this.setMemoryDirty()}updateRenderData(e,r,i){switch(i&&this.forEachLoadedNeighbor(n=>n.updateRenderData(e,r)),e){case Zt.MAP:return this._updateTexture(r);case Zt.ELEVATION:return this._updateGeometry()}}_updateTexture(e){this.renderData&&(this.resetPendingUpdate(e===ns.FADING?gt.TEXTURE_NOFADING:gt.TEXTURE_FADING),this.setPendingUpdate(e===ns.FADING?gt.TEXTURE_FADING:gt.TEXTURE_NOFADING))}_updateGeometry(){this.setPendingUpdate(gt.GEOMETRY);for(const e of this.layerInfo[Zt.ELEVATION])e.pendingUpdates|=gt.GEOMETRY}invalidateLayerData(e,r){this.layerInfo[r][e].invalidateSourceData(),this.restartAgents(r)}computeElevationBounds(){const e=this._elevationBounds,r=e[0],i=e[1];er(e,1/0,-1/0);const n=this.layerInfo[Zt.ELEVATION];let s=!0;for(const o of n)o.elevationBounds!=null&&(e[0]=Math.min(e[0],o.elevationBounds.min),e[1]=Math.max(e[1],o.elevationBounds.max),o.elevationBounds.hasNoDataValues||(s=!1));s&&(e[0]=Math.min(e[0],0),e[1]=Math.max(e[1],0)),r===e[0]&&i===e[1]||(this.updateRadiusAndCenter(),this._surface.setTileTreeDirty())}_updateCenter(){const e=this._elevationBounds,r=.5*(e[0]+e[1]),i=this._center;te(so,this.up,r),oe(i[Dn.MIDDLE],this.centerAtSeaLevel,so),te(so,this.up,e[0]),oe(i[Dn.TOP],this.centerAtSeaLevel,so),te(so,this.up,e[1]),oe(i[Dn.BOTTOM],this.centerAtSeaLevel,so)}findElevationBoundsForLayer(e,r){const i=this.layerInfo[Zt.ELEVATION][e],n=JG(this.level),s=Math.max(this.elevationLevel-n,0),o=i.elevationBounds;if(o!=null&&o.level>=r&&o.level<=s)return;const a=this._surface.layerViewByIndex(e,Zt.ELEVATION),l=gW(a);if(!CO(this,l,!1))return;const c=jgt;let u=!1;const d=i.data;if(d&&d.level<=s){const p=i.data;c.min=p.samplerData.data.minValue,c.max=p.samplerData.data.maxValue,c.hasNoDataValues=p.samplerData.data.hasNoDataValues,c.level=this.level,u=!0}else{let p,m,y=0;for(let _=this._parent;_&&(!m||y-1?s[l]:nN.acquire(this._surface.upsampleInfoPool)}this.setMemoryDirty()}restartAgents(e){this.renderData&&(this._createOrUpdateAgents(0,e),this.updateRenderData(e,ns.FADING))}updateAgents(e){if(this.renderData){const r=this.layerInfo[e];for(const i of r)i.loadingAgent===Gl&&(i.loadingAgent=null);this._createOrUpdateAgents(0,e)}}updateAgentSuspension(){for(const e of Uv){const r=this._isSuspended(e);for(const i of this.layerInfo[e])i.loadingAgent&&i.loadingAgent!==Gl&&(i.loadingAgent.setSuspension(r),i.loadingAgent===Gl&&this.updateRenderData(e,ns.FADING))}}removeLayerAgent(e,r){const i=this.layerInfo[r][e];i.loadingAgent&&i.loadingAgent!==Gl&&i.loadingAgent.dispose(),i.loadingAgent=null}agentDone(e,r){const i=this.layerInfo[r][e];i.loadingAgent=Gl,i.data||i.upsampleInfo!=null||this._createOrUpdateAgents(e+1,r)}_hasBlendableAncestor(e){return e.blendMode!=="normal"||_S(e.parent)&&this._hasBlendableAncestor(e.parent)}_hasBlendModes(e,r,i){var n,s,o;for(let a=e;a=e[0]&&e[2]>=r[2]&&r[1]>=e[1]&&e[3]>=r[3]}intersectsExtent(e){const r=this.extent;return r[2]>=e[0]&&e[2]>=r[0]&&r[3]>=e[1]&&e[3]>=r[1]}getElevationVerticesPerSide(e){const r=this.elevationLevel-this.level,i=Math.max(this.level-e,JG(this.level)-r),n=ge(1+(this.maxTesselation>>i),2,this.maxTesselation+1),s=this.getDefaultVerticesPerSide();return Math.max(n,s)}get test(){return{cachedMemory:this._cachedMemory}}_findLIJ(e,r){if(!e)return null;const i=this.surface.rootTiles;if(i!=null){for(const n of i)if(Hgt(n,e)){let s=n,o=e[0]-s.level-1;for(;o>=0&&!s.isLeaf&&!r(s);){const a=e[1]>>o&1,l=e[2]>>o&1;s=s.children[2*a+l],o--}return r(s)?s:null}}return null}findNeighborTile(e,r){const i=this.lij,n=this.getNeighborLIJ(i,e);return n?Wgt(i,n)?r(this)?this:null:this._findLIJ(n,r):null}findCorner(e,r){const i=e===tt.NORTH_EAST?1:e===tt.NORTH_WEST?0:e===tt.SOUTH_WEST?2:3;let n=this;for(;n.children[0]&&(!r||!r(n));)n=n.children[i];return n}findNeighborCornerTileExact(e,r){var i;return((i=this.findNeighborTile(e,n=>r(n)||n.level===this.level))==null?void 0:i.findCorner(eF(e),r))||null}forAllSubtreeOnSide(e,r){const i=e===tt.NORTH?[0,1]:e===tt.NORTH_EAST?[1]:e===tt.EAST?[1,3]:e===tt.SOUTH_EAST?[3]:e===tt.SOUTH?[2,3]:e===tt.SOUTH_WEST?[2]:e===tt.WEST?[0,2]:[0],n=s=>{const o=s.children;!r(s)&&o[0]&&i.forEach(a=>n(o[a]))};n(this)}forallNeighbors(e){jR.forEach(r=>this.findNeighborCornerTileExact(r,e)),Rf.forEach(r=>{var i;return(i=this.findNeighborTile(r,n=>n.level===this.level||e(n)))==null?void 0:i.forAllSubtreeOnSide(tF(r),e)})}getNeighborEdgeStartVertexIndex(e,r){if(!r)return 0;const i=this.level-r.level;if(be(!cs||i>=0),i===0)return 0;const n=2**i,s=(1&e)==1,o=s?0:1,a=r.lij[o+1]*n,l=this.lij[o+1],c=l-a,u=s?n-1-c:c;return cs&&(be(a<=l&&ln.level===r||n.isLoaded;Rf.forEach(n=>{const s=this.findNeighborTile(n,i);s!=null&&s!==this&&s.forAllSubtreeOnSide(tF(n),o=>!!o.isLoaded&&(e(o,n),!0))}),jR.forEach(n=>{var o;const s=(o=this.findNeighborTile(n,i))==null?void 0:o.findCorner(eF(n),a=>a.isLoaded);be(!s||SW(this,s,n)),s!=null&&s.isLoaded&&e(s,n)})}getNeighborLIJ(e,r){const i=Oce(r)?-1:Ace(r)?1:0,n=Ece(r)?-1:Cce(r)?1:0,s=[e[0],e[1]+i,e[2]+n];return s[1]<0?null:this.surface.isGlobal?this.wrapLIJ(s):s[2]<0?null:s}wrapLIJ(e){return!e||e[1]<0||e[1]>=2**e[0]?null:this.surface.wrapEastWest(e)}get westNeighborWestExtent(){return this.extent[0]*(this.isWestEnd?-1:1)}get eastNeighborEastExtent(){return this.extent[2]*(this.isEastEnd?-1:1)}get isEastEnd(){return this.lij[2]===this.surface.lijEastEnd(this.level)-1}get isWestEnd(){return this.lij[2]===0}get isNorthEnd(){return this.lij[1]===0}get isSouthEnd(){const e=this.surface.extent,r=(e==null?void 0:e[1])??null;return r!=null&&this.extent[1]+tl()>=r}checkGeometryWaterproofness(){var e;Q5&&(be(this.isLoaded),(e=this.renderData)==null||e.checkGeometryWaterproofness())}shouldHaveNeighbor(e){const r=this.extent,i=this.surface.rootTilesExtent,n=.25*(r[2]-r[0]);if(Oce(e)&&r[3]+n>=i[3]||Ace(e)&&r[1]-n<=i[1])return!1;const s=this.surface.isGlobal;return!(!s&&Ece(e)&&r[0]-n<=i[0])&&!(!s&&Cce(e)&&r[2]+n>=i[2])}updateDistanceToPOI(e){const r=this._lastPOI;if(this.distanceToPOI>=0&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2])return;re(this._lastPOI,e);const i=this._center[Dn.MIDDLE],n=e[0]-i[0],s=e[1]-i[1],o=e[2]-i[2];this.distanceToPOI=n*n+s*s+o*o}};function Ggt(t,e,r,i){const n=r===Zt.ELEVATION?yK.acquire():gK.acquire();return n.init(t,e,r,i),n}function YI(t){t.dispose(),t instanceof NOe?yK.release(t):t instanceof FOe&&gK.release(t)}const gK=new ko(FOe),yK=new ko(NOe),jgt=new bT;var Dn;function Hgt(t,e){const r=t.level,i=e[0];if(r>i)return!1;const n=i-r,s=Math.floor(e[1]/2**n),o=Math.floor(e[2]/2**n);return s===t.lij[1]&&o===t.lij[2]}function Wgt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function qgt(t,e,r){if(t==null||e==null)return!1;if(t.level===0&&e.level===0&&(t.isEastEnd&&e.isWestEnd&&r===tt.EAST||t.isWestEnd&&e.isEastEnd&&r===tt.WEST))return!0;const i=Math.max(1e-6*(t.extent[2]-t.extent[0]),1);switch(r){case tt.NORTH:return hh(t.extent[3],e.extent[1],i);case tt.SOUTH:return hh(t.extent[1],e.extent[3],i);case tt.EAST:return hh(t.extent[2],e.extent[0],i)||hh(t.extent[2],-e.extent[0],i);case tt.WEST:return hh(t.extent[0],e.extent[2],i)||hh(t.extent[0],-e.extent[2],i)}}function SW(t,e,r){return t!=null&&e!=null&&e!==t&&(t.level>=e.level?Bce(t,e,r):Bce(e,t,eF(r)))}function Bce(t,e,r){be(t.level>=e.level);const i=lmt(r),n=cmt(r),s=t.extent,o=e.extent,a=[i?s[0]:s[2],n?s[3]:s[1]],l=[i?o[2]:o[0],n?o[1]:o[3]],c=1e-5*(s[2]-s[0]),u=hh(a[0],l[0],c)||t.surface.isGlobal&&hh(a[0],-l[0],c),d=hh(a[1],l[1],c);if(u&&d)return!0;if(t.level===e.level||!u&&!d)return be(!1),!1;const p=u?Vce(o[1],o[3],s[1],s[3],c):Vce(o[0],o[2],s[0],s[2],c);return be(p),p}function Vce(t,e,r,i,n){return t-n<=r&&r<=i&&i<=e+n}(function(t){t[t.TOP=0]="TOP",t[t.MIDDLE=1]="MIDDLE",t[t.BOTTOM=2]="BOTTOM"})(Dn||(Dn={}));const ZI=O(),Dz=O(),Nz=O(),so=O();let Xgt=class{constructor(){this._scales=$t(-1,-1,-1,-1),this._offsets=$t(-1,-1,-1,-1)}clear(){this._scales[0]=this._scales[1]=this._scales[2]=this._scales[3]=-1,this._offsets[0]=this._offsets[1]=this._offsets[2]=this._offsets[3]=-1}setScale(e,r,i){this._scales[2*e]=r,this._scales[2*e+1]=i}setOffset(e,r,i){this._offsets[2*e]=r,this._offsets[2*e+1]=i}get scales(){return this._scales}get offsets(){return this._offsets}};function Ygt(t,e){t.varyings.add("tbnTangent","vec3"),t.varyings.add("tbnBiTangent","vec3"),e.spherical?t.vertex.code.add(w`void forwardVertexTangent(vec3 n) { +tbnTangent = normalize(cross(vec3(0.0, 0.0, 1.0), n)); +tbnBiTangent = normalize(cross(n, tbnTangent)); +}`):t.vertex.code.add(w`void forwardVertexTangent(vec3 n) { +tbnTangent = vec3(1.0, 0.0, 0.0); +tbnBiTangent = normalize(cross(n, tbnTangent)); +}`),t.fragment.code.add(w`mat3 getTBNMatrix(vec3 n) { +return mat3(tbnTangent, tbnBiTangent, n); +}`)}let _K=class extends qCe{constructor(){super(...arguments),this.slicePlaneLocalOrigin=O(),this.origin=this.slicePlaneLocalOrigin,this.modelTransformation=null}};var pc;(function(t){t[t.Material=0]="Material",t[t.ShadowMap=1]="ShadowMap",t[t.Highlight=2]="Highlight"})(pc||(pc={}));let Zgt=class extends _K{constructor(){super(...arguments),this.identifier=pc.Material,this.output=D.Color,this.transparent=!1,this.integratedMesh=!1}},Qgt=class extends _K{constructor(){super(...arguments),this.identifier=pc.ShadowMap}},Jgt=class extends _K{constructor(){super(...arguments),this.identifier=pc.Highlight}},rF=class extends ln{constructor(e,r){super(e,"vec4",jr.Draw,(i,n,s)=>i.setUniform4fv(e,r(n,s)))}};var Rg;function Kgt(t,e){const{vertex:r,fragment:i}=t;r.uniforms.add(new rF("overlayTexOffset",(n,s)=>e0t(n,s)),new rF("overlayTexScale",(n,s)=>t0t(n,s))),i.constants.add("overlayOpacity","float",1),i.uniforms.add(new Ye("ovColorTex",(n,s)=>EW(n,s))),BOe(t,e)}function BOe(t,e){e.pbrMode!==et.Water&&e.pbrMode!==et.WaterOnIntegratedMesh&&e.pbrMode!==et.TerrainWithWater||t.include(ZCe,e);const{vertex:r,fragment:i}=t;t.varyings.add("vtcOverlay","vec4"),r.code.add(w`void setOverlayVTC(in vec2 uv) { +vtcOverlay = vec4(uv, uv) * overlayTexScale + overlayTexOffset; +}`),i.code.add(w`bool isValid(vec2 uv, vec2 dxdy) { +return (uv.x >= 0.0 + dxdy.x) && (uv.x <= 1.0 - dxdy.x) && (uv.y >= 0.0 + dxdy.y) && (uv.y <= 1.0 - dxdy.y); +} +vec4 getOverlayColor(sampler2D ov0Tex, vec4 texCoords) { +vec4 color0 = texture(ov0Tex, vec2(texCoords.x * 0.5, texCoords.y)); +vec4 color1 = texture(ov0Tex, vec2(texCoords.z * 0.5 + 0.5, texCoords.w)); +bool isValid0 = isValid(texCoords.xy, fwidth(texCoords.xy)); +bool isValid1 = isValid(texCoords.zw, vec2(0.0, 0.0)); +return mix(color1 * float(isValid1), color0, float(isValid0)); +}`),i.code.add(w`vec4 getCombinedOverlayColor() { +return overlayOpacity * getOverlayColor(ovColorTex, vtcOverlay); +}`),i.code.add(w`vec4 getOverlayColorTexel(vec4 texCoords) { +vec2 texDim = vec2(textureSize(ovColorTex, 0)); +vec4 color0 = texelFetch(ovColorTex, ivec2(vec2(texCoords.x * 0.5, texCoords.y)*texDim), 0); +vec4 color1 = texelFetch(ovColorTex, ivec2(vec2(texCoords.z * 0.5 + 0.5, texCoords.w)*texDim), 0); +bool isValid0 = isValid(texCoords.xy, fwidth(texCoords.xy)); +bool isValid1 = isValid(texCoords.zw, vec2(0.0, 0.0)); +return mix(color1 * float(isValid1), color0, float(isValid0)); +}`),e.pbrMode!==et.Water&&e.pbrMode!==et.WaterOnIntegratedMesh&&e.pbrMode!==et.TerrainWithWater||(r0(i),lm(i),i.code.add(w`vec4 getOverlayWaterColor(vec4 maskInput, vec4 colorInput, vec3 vposEyeDir, +float shadow, vec3 localUp, mat3 tbn, vec3 position, vec3 positionWorld) { +vec3 n = normalize(tbn * (2.0 * maskInput.rgb - vec3(1.0))); +vec3 v = vposEyeDir; +vec3 final = getSeaColor(n, v, mainLightDirection, colorInput.rgb, mainLightIntensity, localUp, 1.0 - shadow, maskInput.w, position, positionWorld); +return vec4(final, colorInput.w); +}`))}function EW(t,e){return e.overlays.length===0?null:t.identifier===pc.Material&&t.output===D.Color?e.overlays[Oi.INNER].getColorTextureNoRasterImage():t.identifier===pc.Material&&t.output===D.ObjectAndLayerIdColor?e.overlays[Oi.INNER].getColorTexture(za.ObjectAndLayerIdColor):t.identifier===pc.Highlight?e.overlays[Oi.INNER].getValidTexture(tn.Highlight):null}function e0t(t,e){for(const r of e.overlays){const{index:i,extent:n}=r;Oye(n)>0&&(ZT[2*i]=t.toMapSpace[0]/nu(n)-n[0]/nu(n),ZT[2*i+1]=t.toMapSpace[1]/lp(n)-n[1]/lp(n))}return ZT}function t0t(t,e){for(const r of e.overlays){const{index:i,extent:n}=r;Oye(n)>0&&(ZT[2*i]=t.toMapSpace[2]/nu(n),ZT[2*i+1]=t.toMapSpace[3]/lp(n))}return ZT}(function(t){t[t.Disabled=0]="Disabled",t[t.Enabled=1]="Enabled",t[t.EnabledWithWater=2]="EnabledWithWater",t[t.COUNT=3]="COUNT"})(Rg||(Rg={}));const ZT=Qt();var Pf;(function(t){t[t.LayerOnly=0]="LayerOnly",t[t.ColorComposite=1]="ColorComposite",t[t.GridComposite=2]="GridComposite",t[t.COUNT=3]="COUNT"})(Pf||(Pf={}));let r0t=class extends LJ{constructor(){super(...arguments),this.overlayOpacity=1,this.overlaySource=za.None}};function jC(t,e){t.vertex.uniforms.add(new iF("overlayTexOffset"),new iF("overlayTexScale")),t.fragment.uniforms.add(new Ce("overlayOpacity",r=>r.overlayOpacity),new Ye("ovColorTex",(r,i)=>i.overlays.length===0?null:i.overlays[Oi.INNER].getColorTexture(r.overlaySource))),BOe(t,e)}function i0t(t,e){const{vertex:r,fragment:i,varyings:n}=t;n.add("vtc","vec2"),r.uniforms.add(new iF("texOffsetAndScale")),i.uniforms.add(new Gce("tex")),i.uniforms.add(new Fz("textureOpacities"));const s=e.textureFadingEnabled&&!e.renderOccluded;s&&(r.uniforms.add(new iF("nextTexOffsetAndScale")),n.add("nvtc","vec2"),i.uniforms.add(new Gce("texNext")),i.uniforms.add(new Fz("nextTexOpacities")),i.uniforms.add(new n0t("fadeFactor")));const o=e.tileBlendInput===Pf.ColorComposite,a=e.tileBlendInput===Pf.GridComposite;a&&i.include(fK),o&&i.uniforms.add(new Fz("backgroundColor")),r.code.add(w` + void forwardTextureCoordinatesWithTransform(in vec2 uv) { + vtc = uv * texOffsetAndScale.zw + texOffsetAndScale.xy; + ${s?w`nvtc = uv * nextTexOffsetAndScale.zw + nextTexOffsetAndScale.xy;`:w``} + }`),i.code.add(w` + vec4 getColor(vec4 color, vec2 uv, vec3 opacities) { + ${a||o?w` + if (opacities.y <= 0.0) { + return color * opacities.z * opacities.x; + } + vec4 bg = vec4(${o?w`backgroundColor`:w`gridColor(uv)`} * opacities.y, opacities.y); + vec4 layer = color * opacities.z; + return (bg * (1.0 - layer.a) + layer) * opacities.x;`:w`return color;`} + }`),s?i.code.add(w`vec4 getTileColor() { +vec4 color = getColor(texture(tex, vtc), vtc, textureOpacities); +if (fadeFactor >= 1.0) { +return color; +} +vec4 nextColor = getColor(texture(texNext, nvtc), nvtc, nextTexOpacities); +return mix(nextColor, color, fadeFactor); +}`):i.code.add(w`vec4 getTileColor() { +return getColor(texture(tex, vtc), vtc, textureOpacities); +}`)}let n0t=class extends ln{constructor(e){super(e,"float")}},Fz=class extends ln{constructor(e){super(e,"vec3")}},iF=class extends ln{constructor(e){super(e,"vec4")}},Gce=class extends ln{constructor(e){super(e,"sampler2D")}},VOe=class extends r0t{};function s0t(t){const e=new mr,{vertex:r,fragment:i,varyings:n}=e;e.include(LP),e.include(ZP,t),e.include(Uf,t);const s=()=>{e.include(UR,t),r.code.add(w`vec3 getNormal() { +float z = 1.0 - abs(normalCompressed.x) - abs(normalCompressed.y); +vec3 n = vec3(normalCompressed + vec2(normalCompressed.x >= 0.0 ? 1.0 : -1.0, +normalCompressed.y >= 0.0 ? 1.0 : -1.0) * min(z, 0.0), z); +return normalize(n); +}`)};xc(r,t),e.include(Cl,t);const o=t.overlayMode!==Rg.Disabled,a=o&&t.invisible;switch(t.output){case D.Color:{e.include(i0t,t),e.include(ww,t),o&&e.include(jC,{...t,pbrMode:t.pbrMode===et.Terrain?et.TerrainWithWater:et.Water});const l=t.overlayMode===Rg.EnabledWithWater;l&&e.include(Ygt,t),n.add("vnormal","vec3"),n.add("vpos","vec3"),n.add("vup","vec3"),s(),t.screenSizePerspective&&jS(r);const c=t.receiveShadows&&!t.renderOccluded;c&&e.include(AE,t),t.screenSizePerspective&&(n.add("screenSizeDistanceToCamera","float"),n.add("screenSizeCosAngle","float")),r.code.add(w` + void main(void) { + //Position + vpos = position; + vec3 positionWorld = position + localOrigin; + gl_Position = transformPosition(proj, view, vpos); + + //Normal + vnormal = getNormal(); + + //Up + vup = getLocalUp(position, localOrigin); + + ${l?w`forwardVertexTangent(vnormal);`:w``} + + //Texture UV + vec2 uv = getUV0(); + forwardTextureCoordinatesWithTransform(uv); + ${o?w`setOverlayVTC(uv);`:""} + ${t.tileBorders?w`forwardTextureCoordinates();`:""} + + ${t.screenSizePerspective?w` + vec3 viewPos = (view * vec4(vpos, 1.0)).xyz; + screenSizeDistanceToCamera = length(viewPos); + vec3 viewSpaceNormal = (viewNormal * vec4(normalize(positionWorld), 1.0)).xyz; + screenSizeCosAngle = abs(viewSpaceNormal.z);`:""} + + ${c?w`forwardLinearDepth();`:""} + + } + `),e.include(fn,t),e.include(ww,t),e.include(JP,t),e.include(vw,t),fp(i,t),KP(i),NE(i),i.uniforms.add(r.uniforms.get("localOrigin"),new Lt("viewDirection",(u,d)=>me(jce,ne(jce,d.camera.viewMatrix[12],d.camera.viewMatrix[13],d.camera.viewMatrix[14])))),l&&i.uniforms.add(new Ye("ovWaterTex",(u,d)=>d.overlays.length===0?null:d.overlays[Oi.INNER].getNormalTexture(u.overlaySource)),new nSe("view",(u,d)=>Ml(o0t,d.camera.viewMatrix,u.origin))),i.code.add(w`const float sliceOpacity = 0.2; +float lum(vec3 c) { +return (min(min(c.r, c.g), c.b) + max(max(c.r, c.g), c.b)) * 0.5; +}`),r0(i),lm(i),i.code.add(w` + void main() { + vec3 normal = normalize(vnormal); + float vndl = dot(normal, mainLightDirection); + + float additionalAmbientScale = smoothstep(0.0, 1.0, clamp(vndl*2.5, 0.0, 1.0)); + float shadow = ${t.receiveShadows&&!t.renderOccluded?"readShadowMap(vpos, linearDepth)":t.spherical?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"}; + + float ssao = evaluateAmbientOcclusionInverse(); + vec4 tileColor = getTileColor(); + + ${o?w` + vec4 overlayColorOpaque = getOverlayColor(ovColorTex, vtcOverlay); + vec4 overlayColor = overlayOpacity * overlayColorOpaque; + ${t.invisible?w`if (overlayColor.a == 0.0) { discard; }`:""} + vec4 groundColor = tileColor; + tileColor = tileColor * (1.0 - overlayColor.a) + overlayColor;`:""} + + // If combined alpha is 0 we can discard pixel. The performance impact by having a discard here + // is neglectable because terrain typically renders first into the framebuffer. + if(tileColor.a <= 0.0) { + discard; + } + + bool sliced = rejectBySlice(vpos); + if (sliced) { + tileColor *= sliceOpacity; + } + + vec3 albedo = tileColor.rgb; + + // heuristic shading function used in the old terrain, now used to add ambient lighting + + vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; + + ${t.pbrMode===et.Terrain||t.pbrMode===et.TerrainWithWater?w`fragColor = vec4(evaluateTerrainLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight, normalize(vpos - cameraPosition), vup), tileColor.a);`:w`fragColor = vec4(evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight), tileColor.a);`} + ${l?w` + vec4 overlayWaterMask = getOverlayColor(ovWaterTex, vtcOverlay); + float waterNormalLength = length(overlayWaterMask); + if (waterNormalLength > 0.95) { + mat3 tbnMatrix = mat3(tbnTangent, tbnBiTangent, vnormal); + vec4 waterOverlayColor = vec4(overlayColor.w > 0.0 ? overlayColorOpaque.xyz/overlayColor.w : vec3(1.0), overlayColor.w); + vec4 viewPosition = view*vec4(vpos, 1.0); + vec4 waterColorLinear = getOverlayWaterColor(overlayWaterMask, waterOverlayColor, -normalize(vpos - cameraPosition), shadow, vnormal, tbnMatrix, viewPosition.xyz, vpos + localOrigin); + vec4 waterColorNonLinear = delinearizeGamma(vec4(waterColorLinear.xyz, 1.0)); + float opacity = sliced ? sliceOpacity : 1.0; + // un-gamma the ground color to mix in linear space + fragColor = mix(groundColor, waterColorNonLinear, waterColorLinear.w) * opacity; + }`:""} + ${t.screenSizePerspective?w` + float perspectiveScale = screenSizePerspectiveScaleFloat(1.0, screenSizeCosAngle, screenSizeDistanceToCamera, vec4(0.0, 0.0, 0.0, 0.0)); + if (perspectiveScale <= 0.25) { + fragColor = mix(fragColor, vec4(1.0, 0.0, 0.0, 1.0), perspectiveScale * 4.0); + } + else if (perspectiveScale <= 0.5) { + fragColor = mix(fragColor, vec4(0.0, 0.0, 1.0, 1.0), (perspectiveScale - 0.25) * 4.0); + } + else if (perspectiveScale >= 0.99) { + fragColor = mix(fragColor, vec4(0.0, 1.0, 0.0, 1.0), 0.2); + } + else { + fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), (perspectiveScale - 0.5) * 2.0); + }`:""} + ${t.visualizeNormals?t.spherical?w` + vec3 localUp = normalize(vpos + localOrigin); + vec3 right = normalize(cross(vec3(0.0, 0.0, 1.0), localUp)); + vec3 forward = normalize(cross(localUp, right)); + mat3 tbn = mat3(right, forward, localUp); + vec3 tNormal = normalize(normal * tbn); + fragColor = vec4(vec3(0.5) + 0.5 * tNormal, 0.0); + `:w` + vec3 tNormal = normalize(normal); + fragColor = vec4(vec3(0.5) + 0.5 * tNormal, 0.0); + `:""} + ${t.tileBorders?w` + vec2 dVuv = fwidth(vuv0); + vec2 edgeFactors = smoothstep(vec2(0.0), 1.5 * dVuv, min(vuv0, 1.0 - vuv0)); + float edgeFactor = 1.0 - min(edgeFactors.x, edgeFactors.y); + fragColor = mix(fragColor, vec4(1.0, 0.0, 0.0, 1.0), edgeFactor);`:""} + fragColor = highlightSlice(fragColor, vpos); + } + `)}break;case D.Depth:a&&e.include(jC,t),e.include(Xg,t),W_(e),pw(e),r.code.add(w` + void main(void) { + ${a?w`setOverlayVTC(getUV0());`:""} + gl_Position = transformPositionWithDepth(proj, view, position, nearFar, linearDepth); + } + `),i.code.add(w` + void main() { + ${a?w`if (getCombinedOverlayColor().a == 0.0) { discard; }`:""} + outputDepth(linearDepth); + } + `);break;case D.Shadow:case D.ShadowHighlight:case D.ShadowExcludeHighlight:e.include(Xg,t),W_(e),pw(e),r.code.add(w`void main(void) { +gl_Position = transformPositionWithDepth(proj, view, position, nearFar, linearDepth); +}`),i.code.add(w`void main() { +outputDepth(linearDepth); +}`);break;case D.Normal:a&&e.include(jC,t),n.add("vnormal","vec3"),jS(r),s(),r.code.add(w` + void main(void) { + ${a?w`setOverlayVTC(getUV0());`:""} + gl_Position = transformPosition(proj, view, position); + vnormal = normalize((viewNormal * vec4(getNormal(), 1.0)).xyz); + } + `),i.code.add(w` + void main() { + ${a?w`if (getCombinedOverlayColor().a == 0.0) { discard; }`:""} + vec3 normal = normalize(vnormal); + if (gl_FrontFacing == false) { + normal = -normal; + } + fragColor = vec4(vec3(0.5) + 0.5 * normal, 0.0); + } + `);break;case D.Highlight:o&&e.include(jC,t),r.code.add(w` + void main() { + ${o?w`setOverlayVTC(getUV0());`:""} + gl_Position = transformPosition(proj, view, position); + } + `),e.include(c0,t),i.code.add(w` + void main() { + ${o?w`if (getCombinedOverlayColor().a == 0.0) { discard; }`:""} + outputHighlight(); + } + `)}return t.output===D.ObjectAndLayerIdColor&&(e.include(jC,{...t,pbrMode:et.Disabled}),r.code.add(w`void main(void) { +gl_Position = transformPosition(proj, view, position); +setOverlayVTC(getUV0()); +}`),i.code.add(w`void main() { +fragColor = getOverlayColorTexel(vtcOverlay); +}`)),e}const o0t=_e(),jce=O(),a0t=Object.freeze(Object.defineProperty({__proto__:null,TerrainPassParameters:VOe,build:s0t},Symbol.toStringTag,{value:"Module"}));let GOe=class jOe extends Tr{constructor(){super(...arguments),this.useStencil=!1}initializeConfiguration(e,r){r.spherical=e.viewingMode===$e.Global}initializeProgram(e){return new vr(e.rctx,jOe.shader.get().build(this.configuration),HOe)}initializePipeline(){return this._stencilPipelineState=this._createPipeline(!0),this._createPipeline(!1)}_createPipeline(e){const r=this.configuration,i=r.backfaceCullingEnabled&&!r.renderOccluded;return Ot({blending:r.renderOccluded?Cc(ve.ONE,ve.ONE_MINUS_SRC_ALPHA):null,culling:i?VZ:null,depthTest:r.renderOccluded?null:{func:Hr.LESS},depthWrite:r.renderOccluded?null:$l,colorWrite:Ft,stencilTest:e?bst(Rl.IntegratedMeshMaskExcluded):null})}getPipelineState(e,r){return this.useStencil?this._stencilPipelineState:super.getPipelineState(e,r)}};GOe.shader=new _r(a0t,()=>ce(()=>import("./Terrain.glsl-84e9c4a7.js"),[]));const HOe=new Map([[E.POSITION,0],[E.UV0,1],[E.NORMALCOMPRESSED,2]]);let l0t=class{constructor(){this.geometry=new sgt,this.intersectionData=null,this.geometryState=null,this._textureRef=new $Oe(()=>this.tile.surface.textureFadeDuration),this.overlay=new Xgt,this._geometryStateChangedSinceLastUpdate=!0,this._hasGeometry=!1,this._numVerticesPerSideChanged=!1,this._samplerDataChanged=!1,this._clippingAreaChanged=!1,this._wireframeChanged=!1,this._dirtyEdgeResolutions=15,this._dirtyEdges=15,this._dirtyCorners=15}get tile(){return this._tile}init(e){this.clear(),this._tile=e;const r=this.geometry;r.indices=null,r.vertexAttributes=null,vi(r.boundingBox),r.indexCount=0,r.numVerticesPerSide=0,this.intersectionData=null,this.geometryState=new hgt,this.localOrigin=null,this.overlay.clear()}clear(){this.releaseGeometry(),this.releaseTexture(),this._textureRef.clear(),this._tile=null,this.intersectionData=null,this.geometryState=null}updateGeometryIfNeeded(e){if((!this._vao||this._geometryStateChangedSinceLastUpdate||this._wireframeChanged||this._clippingAreaChanged||this._samplerDataChanged||this._numVerticesPerSideChanged||this._dirtyCorners||this._dirtyEdgeResolutions||this._dirtyEdges)&&(this._updateGeometry(e),this._geometryStateChangedSinceLastUpdate=!1),cs&&this.tile.intersectsClippingArea)for(let r=0;r<4;++r)be(this.geometry.outerEdges[r].count===this.geometryState.neighborData.edgeResolutions[r]+1)}_calculateEdgeResolution(e,r){var l;const i=this.tile,n=this.geometryState.numVerticesPerSide-1;if(!i.surface.isGlobal){const c=i.surface.extent;if(c!=null&&(e===0&&i.extent[3]>c[3]||e===1&&i.extent[2]>c[2]||e===2&&i.extent[1]=0),d===0){const y=u.numVerticesPerSide-1;return Math.max(y,n)}const p=2**d,m=u.neighborData.edgeResolutions[(e+2)%4]/p;return Math.max(1,m)}be(!r.isLeaf);let a=n;return r.forAllSubtreeOnSide(tF(o),c=>c===i||(c.isLoaded?(a=Math.max(a,2**(c.level-s)),!0):(be(!c.isLeaf),!1))),a}updateNeighborData(){var a;const e=this.tile;if(!e.intersectsClippingArea)return;const r=e.renderData.geometryState.neighborData,i=l=>(l.isLoaded||l.level===e.level)&&(l==null?void 0:l.intersectsClippingArea),n=r.edgePeerNeighbors,s=r.edgePeerNeighborSamplerVersions;for(let l=0;l<4;++l){const c=e.findNeighborTile(Rf[l],i),u=sb(e,c),d=((a=u==null?void 0:u.renderData)==null?void 0:a.geometryState.samplerDataVersion)??-1,p=n[l],m=u!==sb(e,p),y=s[l]!==d;n[l]=c,(m||y)&&(s[l]=d,this._markEdgeDirty(l));const _=r.edgeResolutions[l],v=this._calculateEdgeResolution(l,c);be(tw(v)),be(v>=1),r.edgeResolutions[l]=v,_!==v&&this._markEdgeResolutionDirty(l)}const o=r.cornerPeerNeighbors;for(let l=0;l<4;++l){const c=e.findNeighborTile(jR[l],i);o[l]=c;const u=sb(e,n[l]),d=sb(e,n[(l+1)%4]),p=sb(e,c);ad[l]=p,ad[(l+1)%4]=d,ad[(l+2)%4]=e,ad[(l+3)%4]=u,be(ad.some(v=>(v==null?void 0:v.isLoaded)||v===e));const m=ad.reduce((v,b)=>Math.min(v,(b==null?void 0:b.level)??1/0),1/0);ad.forEach((v,b)=>{v&&(v==null?void 0:v.level)>m&&(ad[b]=null)}),be(ad.some(v=>(v==null?void 0:v.isLoaded)||v===e));const y=r.cornerNeighborData[l].cornerTiles,_=r.cornerNeighborData[l].cornerTileSamplerVersions;for(let v=0;v<4;++v){const b=ad[v],x=(b==null?void 0:b.renderData.geometryState.samplerDataVersion)??-1,T=y[v]!==b,S=!T&&_[v]!==x;(T||S)&&(y[v]=b,_[v]=x,this._markCornerDirty(l))}be(y.some(v=>(v==null?void 0:v.isLoaded)||v===e))}cs&&be(this.geometryState.neighborData.edgeResolutions.every(l=>l>0));for(let l=0;l<4;++l)ad[l]=null}_updateGeometry(e){if(!this.tile.intersectsClippingArea)return;cs&&be(!this.tile.intersectsClippingArea||this.geometryState.neighborData.edgeResolutions.every(l=>l>0)),this.intersectionData=null;const r=this.tile,i=this._vao,n=this.geometry.vertexAttributes,s=!i||!n||this._wireframeChanged||this._numVerticesPerSideChanged||this._samplerDataChanged||this._clippingAreaChanged||this._dirtyEdgeResolutions,o=!s&&(this._dirtyEdges!==0||this._dirtyEdgeResolutions!==0),a=!o&&this._dirtyCorners!==0;s?(this.releaseGeometry(),this._createGeometry(e)):o||a?r.updateEdgeElevations():a?r.updateCornerElevations():console.warn("Update for no reason?"),this._numVerticesPerSideChanged=!1,this._samplerDataChanged=!1,this._dirtyEdgeResolutions=0,this._dirtyEdges=0,this._dirtyCorners=0,this._clippingAreaChanged=!1,this._wireframeChanged=!1}get hasGeometry(){return this._hasGeometry}releaseGeometry(){return this._hasGeometry=!1,this.intersectionData=null,!!this._vao&&(this._vao.dispose(),this._vao=null,lgt(this.geometry),!0)}ensureTexture(e,r){return this._texture!=null&&this._texture.descriptor.width!==e&&this.releaseTexture(),this._texture==null&&(this._texture=r(),this.tile.setMemoryDirty()),this._texture}releaseTexture(){this._texture!=null&&(this._texture.release(),this._texture=null,this.tile.setMemoryDirty())}_markCornerDirty(e){const r=1<0,c=l?n:null;return l&&(n.length=s),{changed:a,samplerData:c,maxTileLevel:o}}get estimatedGeometryMemoryUsage(){var r,i,n;const e=((r=this.intersectionData)==null?void 0:r.estimatedMemoryUsage)??0;return(((i=this.geometry.indices)==null?void 0:i.byteLength)??0)+(((n=this.geometry.vertexAttributes)==null?void 0:n.byteLength)??0)+e}get texture(){return this._texture}get test(){return{hasTexture:this._texture!=null}}checkGeometryWaterproofness(){if(!cs)return;const e=this.tile;if(!e.isLoaded||!e.intersectsClippingArea||e.level===0)return void be(e==null?void 0:e.isLoaded);const r=e.surface.extent;if(r!=null&&!e.intersectsExtent(r))return;const i=Rf.map((a,l)=>r!=null&&(l<2?-1:1)*(e.extent[3-l]-r[3-l])<0),n=e.level;be(this._dirtyCorners===0),be(this._dirtyEdges===0),be(this._dirtyEdgeResolutions===0),be(!this._numVerticesPerSideChanged),be(!this._samplerDataChanged),be(!this._clippingAreaChanged),be(!this._wireframeChanged);const s=jR.map(a=>e.findNeighborCornerTileExact(a,l=>!l.intersectsClippingArea||l.isLoaded||l.level===e.level)??null).map(a=>a!=null&&a.intersectsClippingArea?a:null),o=this.geometryState.neighborData;for(let a=0;a<4;++a){const l=o.cornerPeerNeighbors[a],c=s[a];be(c===l,`Tile[${e.lij}].corner[${a}] out of date: cur=[${l==null?void 0:l.lij}] exp=[${c==null?void 0:c.lij}]`)}Rf.forEach((a,l)=>{if(i[l])return;const c=e.findNeighborTile(a,L=>(L.level===n||(L==null?void 0:L.isLoaded))&&(L==null?void 0:L.intersectsClippingArea));if(!c){const L=!e.surface.updatingRootTiles&&e.surface.rootTiles!=null&&e.surface.rootTiles.length>0&&e.shouldHaveNeighbor(a);return void be(!L)}be(c.isLoaded||c.level===e.level),be(c===this.geometryState.neighborData.edgePeerNeighbors[l]);const u=n-c.level;if(!c.isLoaded)return be(!c.isLeaf),void be(u===0);const d=c.renderData;be(qgt(e,c,a)),be(u>=0);const p=2**u;if(u<0)return void be(!1);const m=e.renderData,y=m.geometry,_=y.outerEdges[l],v=y.numVerticesPerSide-1,b=d.geometry;if(!b)return void be(!1);const x=this.geometryState.neighborData.edgePeerNeighbors[l];if(x!=null&&x.isLoaded){const L=x.renderData;be(x==x),be(m.geometryState.neighborData.edgePeerNeighborSamplerVersions[l]===L.geometryState.samplerDataVersion),be(this.geometryState.neighborData.edgePeerNeighborSamplerVersions[l]===L.geometryState.samplerDataVersion)}const T=(l+2)%4,S=b.outerEdges[T],A=_.count-1,C=S.count-1;be(A*p===C,`Tile[${e.lij}]:e${l},res=${A} edgeRes mismatch with Neighbor[${c.lij}]:e${T},res=${C} (expected:${A*p})`);const R=e.extent,P=a===tt.NORTH||a===tt.SOUTH,F=S.count-1,k=F/2**u,V=_.count-1;if(k<1)return void be(V===1);be(k===V),be(tw(k));const z=b.numVerticesPerSide-1;be(u>0||k===Math.max(z,v));const X=e.getNeighborEdgeStartVertexIndex(l,c);be(0<=X&&X0&&console.warn(` localOrigins: ${m.localOrigin} vs ${d.localOrigin} d=${rc(Fe)} [${Fe}]`),(()=>{const pe=ki(Bp),xt=ki(Vp);e.updateEdgeElevations(),c.updateEdgeElevations(),_.getVertexPos(Bp,G),S.getVertexPos(Vp,Q);const vt=O();Ws(vt,Bp,pe),rc(vt)>0&&console.warn(` XXX Tile[${e.lij}] edge out of date: ${pe} vs ${Bp} d=${rc(vt)} [${vt}]`),Ws(vt,Vp,xt),rc(vt)>0&&console.warn(` XXX Neighbor[${c.lij}] edge out of date: ${xt} vs ${Vp} d=${rc(vt)} [${vt}]`)})(),be(_t,`Mismatch in tile [${e.lij}].edge[${l}][${G}/${_.count}] vs neighbor [${c.lij}].edge[${T}][${Q}/${S.count}] ${Cm(Bp)} vs ${Cm(Vp)} dist=${de} h(t|n|d)=${Re}|${Ke}|${Ke-Re}`)}_.getNormal(kx,G),S.getNormal(zx,Q),me(Hce,kx),me(Wce,zx);const at=fe(Hce,Wce),yt=1-at<.01||!1||e===c;if(!yt){const Fe=O();Ws(Fe,kx,zx);const pe=()=>`Mismatch in tile edge normal ${Sce(e.lij)} (${G}/${_.count-1}) edge ${l} vs neighbor ${Sce(c.lij)} (${Q}/${S.count-1}) nedge ${T} :${Cm(kx)} vs ${Cm(zx)} dot = ${at} : ${Cm(Fe)}`;console.warn("Mismatch in tile edge normal: ",pe());{e.updateEdgeElevations(),c.updateEdgeElevations();const xt=O(),vt=O();_.getNormal(xt,G),S.getNormal(vt,Q),N_(kx,xt)||console.warn("Missing update in tile normal: ",Cm(kx)," => ",Cm(xt)),N_(zx,vt)||console.warn("Missing update in neighbor normal: ",Cm(zx)," => ",Cm(vt))}be(yt,pe())}}G+=1,Q+=1}})}};const Bp=O(),Vp=O(),kx=O(),zx=O(),Hce=O(),Wce=O(),c0t=1,ad=[null,null,null,null];function sb(t,e){return e!=null&&e.isLoaded||e===t?e:null}const u0t=65536;function h0t(t,e){const r=t.tile,{extent:i,extentInRadians:n,surface:s}=r,o=t.localOrigin,a=t.geometryState,l=s.isWebMercator,c=a.numVerticesPerSide,u=c-1,d=(c-2)**2,p=l&&(e===ch.HAS_SOUTH_POLE||e===ch.HAS_BOTH_POLES),m=l&&(e===ch.HAS_NORTH_POLE||e===ch.HAS_BOTH_POLES),y=6,_=((p?1:0)+(m?1:0))*y*(u+1),v=a.neighborData,b=v.edgeResolutions.reduce((R,P)=>R+P+1,0),x=MOe(d+_+b),T=t.geometry;T.numVerticesPerSide=a.numVerticesPerSide,T.vertexAttributes=x;const S=T.boundingBox;vi(S);const A=vK(t);po.update(u,n,A),d0t(t),tRe(t,d),WOe(t);const C=[];if((()=>{let R=d+b;const P=o[0],F=o[1],k=o[2],V=r.ellipsoid.radius,z=i[1],X=i[3],q=(G,Q)=>{const M=Q*c;Oh(-P,-F,G*V-k,S),C.push({connectedRowOffset:M,connectedOuterEdgeOffset:G===1?0:2,rowOffset:R,latitudeResolution:y});const I=YOe(G===-1?z:X,V),L=G*Math.PI/2-I,B=.99*(G===1?1:-1),H=V+0,Z=x.position,K=x.uv0,{typedBuffer:de,typedBufferStride:Re}=x.normalCompressed;for(let Ke=1;Ke<=y;++Ke){const _t=I+L*(Ke/y),at=Math.cos(_t),yt=Math.sin(_t);for(let Fe=0;Fe<=u;Fe++){const pe=Fe/u,xt=po.sinLonLUT[Fe],vt=po.cosLonLUT[Fe]*at,Ee=xt*at,Be=yt,Ve=vt*H-P,pt=Ee*H-F,ut=Be*H-k;Oh(Ve,pt,ut,S),Z.setValues(R,Ve,pt,ut),np(K,R,pe,B),bw(de,R,vt,Ee,Be,Re),++R}}};p&&q(-1,0),m&&q(1,u)})(),eRe(T,a.numVerticesPerSide,C,[0,c-1],[0,c-1],a.wireframe),t.intersectionData=null,cs)for(let R=0;R<4;++R)be(T.outerEdges[R].count===v.edgeResolutions[R]+1)}function d0t(t){const e=t.tile;if(!e.intersectsClippingArea)return;const r=t.geometryState,i=r.numVerticesPerSide,n=i-2,s=i-1,o=t.geometry,a=o.vertexAttributes,l=a.position,c=a.uv0,{typedBuffer:u,typedBufferStride:d}=a.normalCompressed,p=e.extent,m=p[0],y=p[2],_=p[1],v=p[3],b=e.ellipsoid.radius,x=r.samplerData,T=t.localOrigin,S=T[0],A=T[1],C=T[2],R=l.typedBuffer,P=l.typedBufferStride,F=1/s,k=o.boundingBox;let V=0;if(1<=n){const z=F,X=_*(1-z)+v*z,q=po.sinLatLUT[1],G=po.cosLatLUT[1];for(let Q=1;Q<=n;Q++){const M=Q*F,I=m*(1-M)+y*M,L=po.sinLonLUT[Q],B=po.cosLonLUT[Q],H=b+qi(I,X,x),Z=H*B*G-S,K=H*L*G-A,de=H*q-C;Oh(Z,K,de,k);const Re=(Q-1)*P;R[Re]=Z,R[Re+1]=K,R[Re+2]=de,np(c,Q-1,M,z)}}for(let z=1;z<=n;z++){const X=z*F,q=_*(1-X)+v*X,G=po.sinLatLUT[z],Q=po.cosLatLUT[z],M=z+1,I=M*F,L=_*(1-I)+v*I,B=po.sinLatLUT[M],H=po.cosLatLUT[M],Z=po.sinLonLUT[0],K=po.cosLonLUT[0],de=b+qi(m,q,x);let Re=K*Q*de-S,Ke=Z*Q*de-A,_t=G*de-C;const at=V*P;let yt=R[at],Fe=R[at+1],pe=R[at+2];for(let xt=1;xt<=n;xt++){const vt=xt*F,Ee=m*(1-vt)+y*vt,Be=po.sinLonLUT[xt],Ve=po.cosLonLUT[xt];let pt=0,ut=0,ar=0;if(xt1){const ur=(V-n)*P;Mt=R[ur],Ut=R[ur+1],bi=R[ur+2]}else{const ur=po.sinLatLUT[0],ri=po.cosLatLUT[0],Ii=b+qi(Ee,_,x);Mt=Ve*ri*Ii-S,Ut=Be*ri*Ii-A,bi=ur*Ii-C}const Fr=b+qi(Ee,L,x),di=Ve*H*Fr-S,Dt=Be*H*Fr-A,ei=B*Fr-C;if(zMt.isLoaded||Mt.isLeaf||Mt.level===s.level);mt?mt.intersectsClippingArea&&(be(!mt.isLoaded),be(!mt.isLeaf),be(mt.level===o)):be((nt==null?void 0:nt.rootTiles)==null||!s.shouldHaveNeighbor(ht))}}const Z=q===1?a[2]:a[0],K=I==null?void 0:I.extent,de=K&&G?q===1?K[0]:K[2]:Z,Re=q===0?a[3]:a[1],Ke=q===1?1:0,_t=q===0?1:0,at=q===1?d:u,yt=q===0?m:p,Fe=Math.sin(at),pe=Math.cos(at),xt=Math.sin(yt),vt=Math.cos(yt),Ee=H==null?void 0:H.samplerData,Be=L?(nt,ht,mt)=>.5*(qi(nt,ht,y)+qi(mt,ht,Ee)):(nt,ht,mt)=>qi(nt,ht,y),Ve=i.outerEdges[q],pt=e&&M>3?M-3:1,ut=y!=null&&y.some(nt=>nt!=null),ar=Ee!=null&&Ee.some(nt=>nt!=null),Ge=ut||ar,ft=1/Q,cr=Ve.index0;be(!K||hh(K[2]-K[0],a[2]-a[0])),(()=>{const nt=q===1?-1:q===3?1:0,ht=q===0?-1:q===2?1:0,mt=(a[2]-a[0])*ft,Mt=nt*mt,Ut=ht*mt,bi=G?nt*((d-u)*ft):0,Fr=G?0:ht*ft,di=_t,Dt=G?at+bi:at,ei=G?Math.sin(Dt):Fe,Rr=G?Math.cos(Dt):pe,qr=G?at-bi:at,Sr=G?Math.sin(qr):Fe,wi=G?Math.cos(qr):pe,$r=G?yt:T(di+Fr),ti=G?xt:Math.sin($r),Xr=G?vt:Math.cos($r),ur=G?yt:T(di-Fr),ri=G?xt:Math.sin(ur),Ii=G?vt:Math.cos(ur);let Ks=0,eo=0,to=0;{const Ur=0*ft,Os=G?Z:_*(1-Ur)+v*Ur,Co=G?de:Os,ba=G?b*(1-Ur)+x*Ur:Re,ie=G?at:u*(1-Ur)+d*Ur,xi=G?Fe:Math.sin(ie),qh=G?pe:Math.cos(ie),Rs=G?T(Ur):yt,Xh=G?Math.sin(Rs):xt,Ze=G?Math.cos(Rs):vt,Nl=l+Be(Os,ba,Co);Ks=qh*Ze*Nl,eo=xi*Ze*Nl,to=Xh*Nl}let ro=0,ji=0,Li=0;{const Ur=1*ft,Os=G?Z:_*(1-Ur)+v*Ur,Co=G?de:Os,ba=G?b*(1-Ur)+x*Ur:Re,ie=G?at:u*(1-Ur)+d*Ur,xi=G?Fe:Math.sin(ie),qh=G?pe:Math.cos(ie),Rs=G?T(Ur):yt,Xh=G?Math.sin(Rs):xt,Ze=G?Math.cos(Rs):vt,Nl=l+Be(Os,ba,Co);ro=qh*Ze*Nl,ji=xi*Ze*Nl,Li=Xh*Nl}for(let Ur=1;Urm0t(i[1],i[3],n,s)}const r=e.extentInRadians;return i=>g0t(r[1],r[3],i)}function y0t(t,e){const r=t.tile.extent,i=t.geometryState,n=r[0],s=r[1],o=r[2]-n,a=r[3]-s,l=i.clippingArea,c=l!=null?Math.max(0,(l[0]-n)/o):0,u=l!=null?Math.max(0,(l[1]-s)/a):0,d=l!=null?Math.min(1,(l[2]-n)/o):1,p=l!=null?Math.min(1,(l[3]-s)/a):1,m=i.numVerticesPerSide,y=(m-2)**2,_=i.neighborData.edgeResolutions.reduce((T,S)=>T+S+1,0),v=MOe(y+_),b=t.geometry,x=b.boundingBox;vi(x),b.numVerticesPerSide=i.numVerticesPerSide,b.vertexAttributes=v,gi(b.uvRange,c,u,d,p),_0t(t),tRe(t,y),ZOe(t),eRe(b,i.numVerticesPerSide,[],[0,m-1],[0,m-1],i.wireframe),t.intersectionData=null}function _0t(t){const e=t.tile;if(!e.intersectsClippingArea)return;const r=e.surface,i=t.geometryState,n=i.samplerData,s=t.localOrigin,o=r.isWebMercatorOnPlateeCarree,a=i.clippingArea,l=a??bK,c=e.extent,u=c[0],d=c[1],p=c[2],m=c[3],y=Math.max(u,l[0]),_=Math.min(p,l[2]),v=Math.max(d,l[1]),b=Math.min(m,l[3]),x=e.ellipsoid.radius,T=e.horizontalScale,S=i.numVerticesPerSide,A=S-1,C=S-2,R=t.geometry,P=R.vertexAttributes,F=P.position,k=P.uv0,{typedBuffer:V,typedBufferStride:z}=P.normalCompressed,X=R.uvRange,q=X[0],G=X[1],Q=X[2],M=X[3],I=R.boundingBox,L=s[0],B=s[1],H=s[2],Z=F.typedBuffer,K=F.typedBufferStride;let de=0;const Re=ge(d,v,b),Ke=o?(Math.PI/2-2*Math.atan(Math.exp(-Re/x)))*x:Re*T,_t=1/A,at=ge(d*(1-_t)+m*_t,v,b);let yt=Ke,Fe=o?(Math.PI/2-2*Math.atan(Math.exp(-at/x)))*x:at*T;for(let pe=1;pe<=C;pe++){const xt=pe/A,vt=ge(d*(1-xt)+m*xt,v,b),Ee=ge(xt,G,M),Be=Fe,Ve=(pe-1)/A,pt=ge(d*(1-Ve)+m*Ve,v,b),ut=yt,ar=(pe+1)/A,Ge=ge(d*(1-ar)+m*ar,v,b),ft=o?(Math.PI/2-2*Math.atan(Math.exp(-Ge/x)))*x:Ge*T,cr=ge(ar,G,M);yt=Fe,Fe=ft;const nt=ge(u,y,_);let ht=nt*T,mt=qi(nt,vt,n);const Mt=1/A,Ut=ge(Mt,q,Q),bi=ge(u*(1-Ut)+p*Ut,y,_);let Fr=Ut,di=bi,Dt=bi*T,ei=qi(bi,vt,n);if(pe===1){const Rr=Dt-L,qr=yt-B,Sr=ei-H,wi=0*K;Z[wi]=Rr,Z[wi+1]=qr,Z[wi+2]=Sr,Oh(Rr,qr,Sr,I);const $r=ge(Mt,q,Q);np(k,de,$r,Ee)}for(let Rr=1;Rr<=C;Rr++){const qr=Dt,Sr=ei,wi=(Rr+1)/A,$r=ge(wi,q,Q),ti=ge(u*(1-wi)+p*wi,y,_),Xr=di;di=ti;{const ji=de+1,Li=ji*K;if(pe===1||Rr===C){const Ur=ti*T,Os=qi(ti,vt,n);if(pe===1&&Rrl[3],u>l[2],dmt.isLoaded||mt.isLeaf||mt.level===n.level);s.updatingRootTiles||(ht?ht.intersectsClippingArea&&(be(!ht.isLoaded),be(!ht.isLeaf),be(ht.level===n.level)):be((s==null?void 0:s.rootTiles)==null||!n.shouldHaveNeighbor(nt)))}const de=ge(G===1?u:c,C,R),Re=ge(G===0?p:d,P,F),Ke=K==null?void 0:K.samplerData,_t=y.outerEdges[G],at=e&&I>3?I-3:1,yt=ge(G===1?1:0,x,S),Fe=ge(G===0?1:0,T,A),pe=H?(nt,ht)=>.5*(qi(nt,ht,Ke)+qi(nt,ht,q)):(nt,ht)=>qi(nt,ht,q),xt=(u-c)/M,vt=Q?G===1?xt:-xt:0,Ee=Q?0:G===0?xt:-xt,Be=-vt,Ve=-Ee;let pt=0,ut=0,ar=0;{const nt=0/M,ht=Q?de:ge(c*(1-nt)+u*nt,C,R),mt=Q?ge(d*(1-nt)+p*nt,P,F):Re,Mt=pe(ht,mt);pt=ht*_,ut=v(mt),ar=Mt}let Ge=0,ft=0,cr=0;{const nt=1/M,ht=Q?de:ge(c*(1-nt)+u*nt,C,R),mt=Q?ge(d*(1-nt)+p*nt,P,F):Re,Mt=pe(ht,mt);Ge=ht*_,ft=v(mt),cr=Mt}for(let nt=1;ntw0t(i,e):i=>x0t(i,r)}function eRe(t,e,r,i,n,s){const o=e-1,a=t.vertexAttributes.count,l=2*(Math.min(e-2,i[1])-Math.max(1,i[0]))*(Math.min(e-2,n[1])-Math.max(1,n[0])),c=Rf.map((T,S)=>S===0&&n[1]1||S===3&&i[0]>1),u=t.outerEdges.reduce((T,S,A)=>T+(c[A]?0:o-2+S.count-1),0),d=r.reduce((T,S)=>T+o*(2*(S.latitudeResolution-1)+1),0),p=s?2:1,m=3*(l+u+d)*p,y=a>=u0t?new Uint32Array(m):new Uint16Array(m);let _=0;const v=e-2,b=o-2;be(b>=0);const x=(T,S,A,C,R,P)=>{const F=T*R,k=P[F],V=P[F+1],z=P[F+2],X=S*R,q=P[X],G=P[X+1],Q=P[X+2],M=A*R,I=P[M],L=P[M+1],B=P[M+2],H=C*R,Z=P[H],K=P[H+1],de=P[H+2];return(q-Z)*(q-Z)+(G-K)*(G-K)+(Q-de)*(Q-de)>(k-I)*(k-I)+(V-L)*(V-L)+(z-B)*(z-B)};if(s){const T=(A,C,R)=>{y[_++]=A,y[_++]=C,y[_++]=C,y[_++]=R,y[_++]=R,y[_++]=A,cs&&(be(A{for(let A=Math.max(n[0],1)-1;A{for(let A=0;A<4;++A){const C=_;if(c[A])continue;const R=t.outerEdges[A],P=t.innerEdges[A];let F=0,k=0;const V=R.count,z=P.count;be(z===o-1);let X=0;const q=A===1||A===2?(G,Q,M)=>T(G,Q,M):(G,Q,M)=>T(G,M,Q);for(;F{const C=t.outerEdges[A.connectedOuterEdgeOffset];let R=C.getVertexIndex(0),P=C.stride;for(let F=0;F{const S=Math.max(n[0],1)-1,A=Math.min(n[1],e-2)-1,C=Math.max(i[0],1)-1,R=Math.min(i[1],e-2)-1;for(let P=S;P{for(let S=0;S<4;++S){if(c[S])continue;const A=t.outerEdges[S],C=t.innerEdges[S];let R=0,P=0;const F=A.count,k=C.count;be(k===o-1);const V=S===1||S===2,z=V?1:2,X=V?2:1,q=A.index0,G=A.stride,Q=C.index0,M=C.stride;for(;R{const A=t.outerEdges[S.connectedOuterEdgeOffset];let C=A.getVertexIndex(0),R=A.stride;for(let P=0;P{const Ee=d[xt===0?1:3],Be=d[pe===0?0:2],Ve=Math.cos(Ee),pt=Math.sin(Ee),ut=Math.sin(Be),ar=Math.cos(Be),Ge=u+vt;m=ar*Ve*Ge,y=ut*Ve*Ge,_=pt*Ge},b=c?(()=>{const pe=t.geometryState.clippingArea,xt=l.extent,vt=pe!=null&&(xt[3]>pe[3]||xt[2]>pe[2]||xt[1]{const ut=Be===0?X[0]:X[2],ar=Ve===0?X[1]:X[3],Ge=vt?ge(ut,pe[0],pe[2]):ut,ft=vt?ge(ar,pe[1],pe[3]):ar,cr=pt;m=Ge*p,y=Ee(ft),_=cr}})():v;let x=0,T=0,S=0,A=0,C=0,R=0,P=0,F=0,k=0;const V=c&&t.tile.surface.isWebMercatorOnPlateeCarree,z=(pe,xt,vt,Ee,Be)=>{let Ve=0,pt=0,ut=0;if(c){const ar=xt*p,Ge=V?(Math.PI/2-2*Math.atan(Math.exp(-vt/u)))*u:vt*p;Ve=ar-m,pt=Ge-y,ut=Ee-_}else{const ar=vK(pe),Ge=pe.tile,ft=Ge.extent,cr=Ge.extentInRadians,nt=(xt-ft[0])/(ft[2]-ft[0]),ht=(vt-ft[1])/(ft[3]-ft[1]),mt=cr[0]*(1-nt)+cr[2]*nt,Mt=ar(ht),Ut=Math.cos(Mt),bi=Math.sin(Mt),Fr=Math.sin(mt),di=Math.cos(mt),Dt=u+Ee;Ve=di*Ut*Dt-m,pt=Fr*Ut*Dt-y,ut=bi*Dt-_}switch(Be){case 0:P+=Ve,F+=pt,k+=ut;break;case 1:A-=Ve,C-=pt,R-=ut;break;case 2:P-=Ve,F-=pt,k-=ut;break;case 3:A+=Ve,C+=pt,R+=ut}},X=l.extent,q=e.clippingArea,G=q??bK,Q=X[0],M=X[2],I=X[1],L=X[3],B=[L>G[3],M>G[2],I{var ar;const xt=n[pe].cornerTiles;x=0,T=0,S=1,A=0,C=0,R=0,P=0,F=0,k=0;let vt=1/0;for(let Ge=0;Ge<4;++Ge)vt=Math.min(vt,((ar=xt[Ge])==null?void 0:ar.level)??1/0);for(let Ge=0;Ge<4;++Ge){const ft=xt[Ge];HC[Ge]=(ft==null?void 0:ft.level)===vt?ft:null}let Ee=1,Be=0;for(let Ge=0;Ge<4;++Ge){const ft=HC[Ge];ft&&(Ee=Math.max(Ee,ft==null?void 0:ft.renderData.geometryState.numVerticesPerSide),Be=ft.extent[2]-ft.extent[0])}const Ve=Be,pt=Ee;be(pt>1);const ut=Ve/pt;for(let Ge=0;Ge<4;++Ge){const ft=HC[(Ge+3)%4],cr=HC[Ge%4];if(!ft&&!cr)continue;const nt=Ge===0?1:Ge===1?2:Ge===2?3:0,ht=Ge===0?2:Ge===1?3:Ge===2?0:1;if(ft&&cr){const mt=Uz[Ge][0]*ut,Mt=Uz[Ge][1]*ut,Ut=ft.extent,bi=Ut[nt===0||nt===1?2:0]+mt,Fr=Ut[nt===0||nt===3?3:1]+Mt,di=cr.extent,Dt=di[ht===0||ht===1?2:0]+mt,ei=di[ht===0||ht===3?3:1]+Mt,Rr=ft.renderData,qr=cr.renderData,Sr=qi(bi,Fr,Rr.geometryState.samplerData),wi=qi(Dt,ei,qr.geometryState.samplerData);z(Rr,bi,Fr,.5*(Sr+wi),Ge)}else{const mt=ft??cr,Mt=ft?nt:ht,Ut=mt.extent,bi=Uz[Ge],Fr=Ut[Mt===0||Mt===1?2:0]+bi[0]*ut,di=Ut[Mt===0||Mt===3?3:1]+bi[1]*ut,Dt=mt.renderData,ei=qi(Fr,di,Dt.geometryState.samplerData);z(Dt,Fr,di,ei,Ge)}}if(!c){const Ge=Math.sqrt(m*m+y*y+_*_);x=m/Ge,T=y/Ge,S=_/Ge}if(c||S*S<.999){const Ge=Math.sqrt(A*A+C*C+R*R);A/=Ge,C/=Ge,R/=Ge;const ft=Math.sqrt(P*P+F*F+k*k);P/=ft,F/=ft,k/=ft,x=R*F-C*k,T=A*k-R*P,S=C*P-A*F;const cr=1/Math.sqrt(x*x+T*T+S*S);x*=cr,T*=cr,S*=cr}};for(let pe=0;pe<4;++pe){const xt=pe,vt=(pe+1)%4,Ee=pe===0||pe===1?1:0,Be=pe===0||pe===3?1:0,Ve=ge(Ee,Re,_t),pt=ge(Be,Ke,at),ut=o[xt],ar=pe===0||pe===3?ut.count-1:0,Ge=o[vt],ft=pe===0||pe===1?Ge.count-1:0,cr=n[pe].cornerTiles;let nt=-1;for(let Mt=0;Mt<4;++Mt){const Ut=cr[Mt];Ut&&(nt===-1||Og(cr[nt],Ut)>0)&&(nt=Mt)}const ht=nt,mt=cr[ht];if(mt!==l){const Mt=l.level-mt.level,Ut=2**Mt,bi=[mt.lij[0]+Mt,mt.lij[1]*Ut,mt.lij[2]*Ut],Fr=[bi[1]+Ut===l.lij[1],pe===0&&(ht===1||ht===0&&mt!==cr[3])||pe===1&&(ht===0||ht===1&&mt!==cr[2]),bi[1]===l.lij[1]+1,pe===2&&(ht===3||ht===2&&mt!==cr[1])||pe===3&&(ht===2||ht===3&&mt!==cr[0])],di=Fr.reduce((Sr,wi)=>Sr+(wi?1:0),0);be(di===1||di===2);let Dt=-1,ei=-1;const Rr=mt.renderData;if(di===1){const Sr=Fr.findIndex($r=>$r);be(0<=Sr&&Sr<=3),Dt=(Sr+2)%4;const wi=t.geometryState.neighborData.edgeResolutions[Sr];ei=l.getNeighborEdgeStartVertexIndex(Sr,mt)*wi+wi*(Sr===0&&pe===0||Sr===1&&pe===0||Sr===2&&pe===1||Sr===3&&pe===3?1:0)}else{be(Fr[1]||Fr[3]),Dt=Fr[1]?3:1;const Sr=Rr.geometryState.neighborData.edgeResolutions[Dt];ei=pe===0||pe===3?0:Sr}const qr=Rr.geometry.outerEdges[Dt];{const Sr=ut.index0+ar*ut.stride,wi=Ge.index0+ft*Ge.stride,$r=qr.index0+ei*qr.stride;{const ti=qr.attributes.position,Xr=ti.typedBuffer,ur=$r*ti.typedBufferStride,ri=t.localOrigin,Ii=qr.localOrigin,Ks=Xr[ur]+Ii[0]-ri[0],eo=Xr[ur+1]+Ii[1]-ri[1],to=Xr[ur+2]+Ii[2]-ri[2];Oh(Ks,eo,to,a);{const ro=ut.attributes.position,ji=ro.typedBuffer,Li=Sr*ro.typedBufferStride;ji[Li]=Ks,ji[Li+1]=eo,ji[Li+2]=to}{const ro=Ge.attributes.position,ji=ro.typedBuffer,Li=wi*ro.typedBufferStride;ji[Li]=Ks,ji[Li+1]=eo,ji[Li+2]=to}}np(ut.attributes.uv0,Sr,Ve,pt),np(Ge.attributes.uv0,wi,Ve,pt);{const ti=qr.attributes.normalCompressed.typedBuffer,Xr=$r*qr.attributes.normalCompressed.typedBufferStride;{const ur=ut.attributes.normalCompressed,ri=ur.typedBuffer,Ii=Sr*ur.typedBufferStride;ri[Ii]=ti[Xr],ri[Ii+1]=ti[Xr+1]}{const ur=Ge.attributes.normalCompressed,ri=ur.typedBuffer,Ii=wi*ur.typedBufferStride;ri[Ii]=ti[Xr],ri[Ii+1]=ti[Xr+1]}}}}else{const Mt=B[xt],Ut=B[vt];let bi;if(Mt||Ut){const ei=ge(Q*(1-Ee)+M*Ee,H,Z),Rr=ge(I*(1-Be)+L*Be,K,de),qr=e.samplerData;bi=qi(ei,Rr,qr)}else bi=T0t(cr);b(Ee,Be,bi),yt(pe);const Fr=m-i[0],di=y-i[1],Dt=_-i[2];Oh(Fr,di,Dt,a),ut.setVertexFromValuesRawPositionUVNormal(ar,Fr,di,Dt,Ve,pt,x,T,S),Ge.setVertexFromValuesRawPositionUVNormal(ft,Fr,di,Dt,Ve,pt,x,T,S)}}for(let pe=0;pe<4;++pe)HC[pe]=null}function T0t(t){var s,o;const e=t.reduce((a,l)=>Math.min(a,(l==null?void 0:l.level)??1/0),1/0);cs&&(be(!t[0]||!t[2]||SW(t[0],t[2],tt.SOUTH_WEST)),be(!t[1]||!t[3]||SW(t[1],t[3],tt.NORTH_WEST)));let r=0,i=0;for(let a=0;a<4;++a){const l=t[a];if(l&&l.level===e){const c=a===0||a===1,u=a===0||a===3,d=l.extent,p=d[c?0:2],m=d[u?1:3],y=(o=(s=l.renderData)==null?void 0:s.geometryState)==null?void 0:o.samplerData;i+=qi(p,m,y),r++}}const n=r?i/r:0;return be(n!=null),n}function rU(t){const e=t.vao,r=t.geometry.vertexAttributes.position.typedBuffer;e.vertexBuffers.geometry.setSubData(r,0,0,r.length)}const Uz=[[0,1],[1,0],[0,-1],[-1,0]],po=new cgt,bK=yY(-1/0,-1/0,1/0,1/0),HC=[null,null,null,null];function nRe(t,e,r){if(!e)return!1;const i=Og(t,e);return i>0||i===0&&r>=2}let S0t=class extends mK{get horizontalScale(){return this._horizontalScaleFactor}constructor(e,r,i){super(),this._horizontalScaleFactor=1,this._extentInRenderSR=jt(),e!==void 0&&this.init(e,r,i)}init(e,r,i){super.init(e,r,i);const n=i.view.renderSpatialReference,s=i.spatialReference,o=n!=null&&HX(n)&&s!=null&&s.isGeographic?this.ellipsoid.radius*Math.PI/180:1;this._horizontalScaleFactor=o;const a=this.surface.isWebMercatorOnPlateeCarree,l=this._extentInRenderSR,c=this.extent;if(a){const u=Se(c[0],c[1],0);Cs(u,St.WebMercator,u,St.PlateCarree);const d=Se(c[2],c[3],0);Cs(d,St.WebMercator,d,St.PlateCarree),l[0]=u[0],l[1]=u[1],l[2]=d[0],l[3]=d[1]}else for(let u=0;u<4;++u)l[u]=c[u]*o;this.centerAtSeaLevel[0]=.5*(l[0]+l[2]),this.centerAtSeaLevel[1]=.5*(l[1]+l[3]),this.centerAtSeaLevel[2]=0,this._edgeLen=Math.max(l[2]-l[0],l[3]-l[1]),this._edgeLen2=this._edgeLen*this._edgeLen,this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateCenter();const e=this._extentInRenderSR,r=.5*(e[2]-e[0]),i=.5*(e[3]-e[1]),n=Math.sqrt(r*r+i*i),s=.5*(this.elevationBounds[0]-this.elevationBounds[1]),o=Math.max(n,s);this._center[Dn.MIDDLE][3]=o}_calculateFrustumVisibilityStatus(e){const r=this._aabb(),i=r[0],n=r[1],s=r[2],o=r[3],a=r[4],l=r[5];let c=!0;for(let u=0;u<6;u++){const d=e[u],p=d[0],m=d[1],y=d[2],_=d[3];if(p*(p>0?i:o)+m*(m>0?n:a)+y*(y>0?s:l)+_>=0)return sa.OUTSIDE;c=c&&p*(p<0?i:o)+m*(m<0?n:a)+y*(y<0?s:l)+_<=0}return c?sa.INSIDE:sa.INTERSECTS}_aabb(){const e=this._extentInRenderSR;return J9e(e[0],e[1],this.elevationBounds[0],e[2],e[3],this.elevationBounds[1])}intersectsRay(e,r,i,n){return QI[0]=1/r[0],QI[1]=1/r[1],QI[2]=1/r[2],JQ(this._aabb(),e,QI,i,n)}createGeometry(){y0t(this.renderData,this._horizontalScaleFactor),this.setMemoryDirty()}getDefaultVerticesPerSide(){return this.level<9?3:2}updateCornerElevations(){v0t(this.renderData,this._horizontalScaleFactor)}updateEdgeElevations(){b0t(this.renderData,this._horizontalScaleFactor)}};const QI=O();let E0t=class{constructor(){this.extent=Qt(),this.minLevel=0,this.maxLevel=0,this.callback=null}},oN=class extends xe{constructor(){super(...arguments),this._queries=new Nt({initialSize:10}),this._queriesInvPtr=0,this._queryQueue=new Nt({initialSize:30}),this._queryPool=new ko(E0t)}queryVisibleLevelRange(e,r,i,n){const s=this._queryPool.acquire();vh(s.extent,e),s.minLevel=r??-Number.MAX_VALUE,s.maxLevel=i??Number.MAX_VALUE,s.callback=n,this._queryQueue.push(s),this.notifyChange("updating")}get updating(){return this._queryQueue.length!==0}prepare(){for(;this._queries.length0;){const e=this._queryQueue.pop();this._queries.push(e)}this._queriesInvPtr=this._queries.length}process(){for(let e=0;e=this._queriesInvPtr),r.callback=null}this._queries.clear(),this.notifyChange("updating")}queriesForTile(e){const r=e.level;let i=0;for(;i=n.minLevel&&r<=n.maxLevel&&s[0]<=e.extent[2]&&s[2]>=e.extent[0]&&s[1]<=e.extent[3]&&s[3]>=e.extent[1]?(this._queries.swapElements(i,this._queriesInvPtr-1),this._queriesInvPtr--):i++}}};h([f()],oN.prototype,"updating",null),oN=h([N("esri.views.3d.terrain.ScaleRangeQueries")],oN);let C0t=class extends mK{get convexHull(){return this._convexHull}constructor(e,r,i){super(),this._convexHull=new Array(24),this._boundingSphere=vn(),e!==void 0&&this.init(e,r,i)}init(e,r,i){super.init(e,r,i);const n=this.ellipsoid.radius,s=this.extentInRadians[0],o=this.extentInRadians[1],a=this.extentInRadians[2],l=this.extentInRadians[3],c=e[0],u=wt(o,l,.5),d=wt(s,a,.5),p=c===0?0:Math.min(Math.abs(o),Math.abs(l));this._edgeLen=(a-s)*Math.cos(p)*n,this._edgeLen2=this._edgeLen*this._edgeLen,this._curvatureHeight=n-Math.sqrt(n*n-this._edgeLen2/4),kve(this.centerAtSeaLevel,d,u,this.ellipsoid.radius),me(this.up,this.centerAtSeaLevel),this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateBoundingVolumes();const e=this._center;if(this.lij[0]===0)ne(e[Dn.MIDDLE],0,0,0),ne(e[Dn.TOP],0,0,0),ne(e[Dn.BOTTOM],0,0,0),e[Dn.MIDDLE][3]=this.ellipsoid.radius+this.elevationBounds[1];else{this._updateCenter();const r=e[Dn.MIDDLE],i=this.convexHull;let n=0;for(let s=0;s<8;++s)n=Math.max(n,A0t(r,i,3*s));e[Dn.MIDDLE][3]=Math.sqrt(n)}}_calculateFrustumVisibilityStatus(e){if(!h_(e,this._boundingSphere))return sa.OUTSIDE;if(this.lij[0]<10)return sa.INTERSECTS;const r=this.convexHull,i=this.surface.view.state.camera.near;let n=!0;for(let s=0;s{const b=_[0]-d[3*v],x=_[1]-d[3*v+1],T=_[2]-d[3*v+2];return Math.sqrt(b*b+x*x+T*T)};for(let _=0;_<8;++_){const v=m(r,_);p=Math.max(p,v)}const y=p;e[3]=y+2}}_updateConvexHull(){const e=this.extentInRadians,r=this.ellipsoid.radius;if(this.level===0)return;const i=this.elevationBounds,n=this._getPatchType(),s=this.surface.isWebMercator,o=s&&n===ch.HAS_NORTH_POLE,a=s&&n===ch.HAS_SOUTH_POLE,l=a||o,c=Math.PI/2,u=e[0],d=e[2],p=a?-c:e[1],m=o?c:e[3],y=.5*(u+d),_=i[0],v=r+(l?Math.min(0,_-1):_),b=(Q,M,I)=>ev(Q,M,I,v),x=O(),T=O(),S=O(),A=O();b(x,u,p),b(T,u,m),b(S,d,m),b(A,d,p);const C=(Q,M)=>{for(let I=0;I<3;++I)this._convexHull[3*M+I]=Q[I]};C(x,0),C(T,1),C(S,2),C(A,3);const R=i[1],P=r+(l?Math.max(0,R+1):R),F=O(),k=O(),V=O();ev(k,y,m,v),ev(V,y,p,v),oe(F,k,V),me(F,F);const z=O(),X=O(),q=(Q,M)=>{Ws(X,Q,M),me(X,X);const I=-fe(Q,z)/fe(X,z);be(I>=0),te(X,X,I),oe(Q,Q,X)};if(2**this.lij[0]>2*this.lij[1]){const Q=V,M=O();ot(M,Xce,Q),me(M,M),ot(z,Q,M),me(z,z),be(hh(fe(z,Q)/rc(Q),0)),q(x,T),q(A,S),C(x,0),C(A,3)}else if(2**this.lij[0]!==2*this.lij[1]){const Q=k,M=O();ot(M,Xce,Q),me(M,M),ot(z,M,Q),me(z,z),q(T,x),q(S,A),C(T,1),C(S,2)}const G=(Q,M)=>{const I=P/fe(M,F);for(let L=0;L<3;++L)this._convexHull[3*Q+L]=M[L]*I};G(4,x),G(5,T),G(6,S),G(7,A)}_getPatchType(){const e=this.lij[1],r=e===0,i=e===(1<{for(let Ve=0;Ve<3;++Ve)Ee[Ve]=d[3*Be+Ve]};{const Ee=O(),Be=O(),Ve=O(),pt=O(),ut=O(),ar=(Ge,ft,cr,nt)=>{p(Be,Ge),p(Ve,ft),p(pt,cr),Ws(Be,Be,Ve),Ws(pt,pt,Ve),ot(Ee,Be,pt),me(Ee,Ee);const ht=fe(Ee,Ve);p(ut,nt);const mt=fe(Ee,ut),Mt=Math.abs(mt-ht);be(hh(Mt,0),`Non coplanar ${Ge},${ft},${cr},${nt} diff = ${Mt}`)};ar(0,1,2,3),ar(4,5,6,7),ar(0,1,4,5),ar(1,2,5,6),ar(2,3,6,7),ar(3,0,7,4)}const m=Ys(24),y=(Ee,Be,Ve)=>{const pt=4*Ee;for(let ut=0;ut<3;++ut)m[pt+ut]=Be[ut];m[pt+3]=Ve},_=O(),v=O(),b=O(),x=O(),T=(Ee,Be,Ve,pt)=>{p(_,Be),p(v,Ve),p(b,pt),Ws(_,_,v),me(_,_),Ws(b,b,v),me(b,b),ot(x,_,b),me(x,x);const ut=fe(x,v);y(Ee,x,ut)};T(0,0,1,2),T(1,1,0,4),T(2,1,5,2),T(3,3,2,6),T(4,4,0,3),T(5,4,6,5);const S=1,A=(Ee,Be,Ve,pt)=>{const ut=4*Ee;return m[ut]*Be+m[ut+1]*Ve+m[ut+2]*pt-m[ut+3]},C=(Ee,Be,Ve,pt)=>A(Ee,Be,Ve,pt)>=-S,R=(Ee,Be)=>C(Ee,Be[0],Be[1],Be[2]),P=2**this.lij[0]>2*this.lij[1],F=(Ee,Be,Ve)=>Math.sqrt(sRe(Ee,Be,Ve,i[0],i[1],i[2]))F(Ee[0],Ee[1],Ee[2]),V=(Ee,Be)=>F(Ee[Be],Ee[Be+1],Ee[Be+2]),z=this.extentInRadians,X=.5*(z[0]+z[2]),q=z[1],G=z[3],Q=O(),M=O();ev(Q,X,G,a),ev(M,X,q,a);const I=P?"Upper":"Lower";let L=!0;for(let Ee=0;Ee<6;++Ee){for(let Be=0;Be<8;++Be){const Ve=3*Be,pt=C(Ee,d[Ve],d[Ve+1],d[Ve+2]);L&&(L=pt),be(pt,`Tile[${this.lij}] Convex hull point ${Be} outside of plane ${Ee}`)}be(R(Ee,M),`Tile[${this.lij}] (${I}) bottom mid outside of plane ${Ee}`),be(R(Ee,Q),`Tile[${this.lij}] (${I}) top mid outside of plane ${Ee}`)}be(L,"Not all convex hull points are inside convex hull polyhedron"),be(k(M),`Tile[${this.lij}] (${I}) bottom mid outside of bounding sphere`),be(k(Q),`Tile[${this.lij}] (${I}) top mid outside of bounding sphere`);for(let Ee=0;Ee<8;++Ee){const Be=V(d,3*Ee);be(Be,`Tile[${this.lij}] Convex hull point ${Ee} outside of bounding sphere`)}for(let Ee=0;Ee<6;++Ee)for(let Be=0;Be<8;++Be){const Ve=3*Be;C(Ee,d[Ve],d[Ve+1],d[Ve+2])||console.error(`Tile[${this.lij}] Convex hull point ${Be} outside of plane ${Ee}`)}const B=this.extentInRadians,H=Math.max(B[2]-B[0],B[3]-B[1]),Z=Math.round(H*s),K=this.renderData;if(!K)return;const{geometry:de,localOrigin:Re}=K,Ke=(vt=de.vertexAttributes)==null?void 0:vt.position;if(!Ke)return;const _t=Ke.count,at=O(),yt=de.numVerticesPerSide-2,Fe=yt*yt,pe=K.geometryState.neighborData,xt=pe.edgeResolutions.reduce((Ee,Be)=>Ee+Be+1,0);for(let Ee=0;Ee<_t;++Ee){const Be=Ee0;Ke.getVec(Ee,n),oe(at,n,Re);const ft=rc(at)-s;let cr=0,nt=!1;const ht=o[0]-ft,mt=ft-o[1],Mt=ht>l,Ut=mt>l,bi=Mt||Ut,Fr=()=>{const Dt=Be?"internal":Ve&&!pt?"edge":pt?"corner":"pole";return`Tile[${this.lij}].vertex[${Ee}]:${Dt}`+(Mt?"(below)":Ut?"(above)":"")+(Ge?"(Neighbor)":"")},di=gP(at,i);if(di>=r+c){const Dt=di-r;bi||(console.error(`${Fr()} is out of the bounding sphere by ${Dt.toFixed(0)} / ${r.toFixed(0)}[tol=${c}] h=${ft.toFixed(0)} / [${o[0].toFixed(0)}..${o[1].toFixed(0)}] (${(Dt/r).toFixed(0)})`),nt=!0)}for(let Dt=0;Dt<6;++Dt)if(!C(Dt,at[0],at[1],at[2])){const ei=A(Dt,at[0],at[1],at[2]),Rr=Ee%yt,qr=(Ee-Rr)/yt;Dt===0&&ht||Dt===5&&mt||(console.error(`${Fr()} (${Rr},${qr})|${yt}] is out of the bounding trapezoid plane ${Dt} h=${Math.round(ft)} / [${Math.round(o[0])}..${Math.round(o[1])}] dist=${Math.round(ei)} radii = ${Math.round(r)}/${Math.round(u)}} : maxL = ${Z}`),++cr)}if(nt||cr>0)break}}};const qce=[128,64,64,32,16,8,8,4];function A0t(t,e,r){return sRe(t[0],t[1],t[2],e[r],e[r+1],e[r+2])}function sRe(t,e,r,i,n,s){const o=i-t,a=n-e,l=s-r;return o*o+a*a+l*l}const ev=(t,e,r,i)=>{const n=Math.cos(e),s=Math.sin(e),o=Math.cos(r),a=Math.sin(r);t[0]=i*o*n,t[1]=i*o*s,t[2]=i*a},Xce=[0,0,1],Yce=O(),Zce=O();let xd=class extends xe{constructor(){super(...arguments),this.fovX=0,this.fovY=0,this.relativeWidthLimit=0,this.relativeHeightLimit=0,this.maxLod=0,this.angledSplitBias=0,this.aboveGround=!0}};h([f()],xd.prototype,"fovX",void 0),h([f()],xd.prototype,"fovY",void 0),h([f()],xd.prototype,"relativeWidthLimit",void 0),h([f()],xd.prototype,"relativeHeightLimit",void 0),h([f()],xd.prototype,"maxLod",void 0),h([f()],xd.prototype,"angledSplitBias",void 0),h([f()],xd.prototype,"aboveGround",void 0),h([f()],xd.prototype,"frustum",void 0),xd=h([N("esri.views.3d.terrain.SplitLimits")],xd);let oRe=class extends va{constructor(){super(...arguments),this.blendMode=Ae.Normal}};h([U({count:Ae.COUNT})],oRe.prototype,"blendMode",void 0);let AO=class extends oRe{constructor(){super(...arguments),this.output=ws.Composite,this.baseOpacityMode=Zd.NotRequired,this.premultipliedSource=Nd.Off}};h([U({count:ws.COUNT})],AO.prototype,"output",void 0),h([U({count:Zd.COUNT})],AO.prototype,"baseOpacityMode",void 0),h([U()],AO.prototype,"premultipliedSource",void 0);var Sw;function O0t(t){const e=new mr;if(e.include(kOe),t.background===Sw.Only){const r=t.output===ws.ColorComposite;return r?e.fragment.uniforms.add(new Lt("backgroundColor",i=>i.backgroundColor)):e.fragment.include(fK),e.fragment.code.add(w` + void main() { + fragColor = vec4(${r?w`backgroundColor`:w`gridColor(uv)`}, 1.0); + } + `),e}return e.include(zOe,t),e.fragment.uniforms.add(new Ye("tex",r=>r.texture)),e.fragment.uniforms.add(new Ce("opacity",r=>r.opacity)),e.fragment.code.add(w`void main() { +vec4 bgColor = getBackground(uv); +fragColor = blendLayers(bgColor, texture(tex, uv), opacity); +}`),e}(function(t){t[t.BelowLayer=0]="BelowLayer",t[t.Only=1]="Only",t[t.COUNT=2]="COUNT"})(Sw||(Sw={}));const R0t=Object.freeze(Object.defineProperty({__proto__:null,get BackgroundMode(){return Sw},build:O0t},Symbol.toStringTag,{value:"Module"}));let P0t=class extends UOe{constructor(){super(...arguments),this.opacity=1,this.baseOpacity=1,this.texture=null,this.fboTexture=null,this.backgroundColor=Zs}},aRe=class lRe extends Tr{initializeProgram(e){return new vr(e.rctx,lRe.shader.get().build(this.configuration),fr)}initializePipeline(){return Ot({blending:Cc(ve.ONE,ve.ONE_MINUS_SRC_ALPHA),colorWrite:Ft})}};aRe.shader=new _r(R0t,()=>ce(()=>import("./BlendLayers.glsl-79ff1735.js"),[]));let cRe=class extends AO{constructor(){super(...arguments),this.background=Sw.BelowLayer}};h([U()],cRe.prototype,"background",void 0);let kz=class{constructor(e,r,i,n,s,o){this.texture=e,this.type=r,e.retain(),this.offsetAndScale=$t(i.offset[0],i.offset[1],i.scale,i.scale),this.opacities=Se(n,s,o)}destroy(){this.texture.release()}};function M0t(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function $0t(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function I0t(t,e,r,i,n,s,o){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t[4]=s,t[5]=o,t}function uRe(t,e){const r=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5];let l=r*s-i*n;return l?(l=1/l,t[0]=s*l,t[1]=-i*l,t[2]=-n*l,t[3]=r*l,t[4]=(n*a-s*o)*l,t[5]=(i*o-r*a)*l,t):null}function L0t(t){return t[0]*t[3]-t[1]*t[2]}function hRe(t,e,r){const i=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=r[0],u=r[1],d=r[2],p=r[3],m=r[4],y=r[5];return t[0]=i*c+s*u,t[1]=n*c+o*u,t[2]=i*d+s*p,t[3]=n*d+o*p,t[4]=i*m+s*y+a,t[5]=n*m+o*y+l,t}function wK(t,e,r){const i=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=Math.sin(r),u=Math.cos(r);return t[0]=i*u+s*c,t[1]=n*u+o*c,t[2]=i*-c+s*u,t[3]=n*-c+o*u,t[4]=a,t[5]=l,t}function dRe(t,e,r){const i=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=r[0],u=r[1];return t[0]=i*c,t[1]=n*c,t[2]=s*u,t[3]=o*u,t[4]=a,t[5]=l,t}function xK(t,e,r){const i=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=r[0],u=r[1];return t[0]=i,t[1]=n,t[2]=s,t[3]=o,t[4]=i*c+s*u+a,t[5]=n*c+o*u+l,t}function D0t(t,e){const r=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=r,t[2]=-r,t[3]=i,t[4]=0,t[5]=0,t}function N0t(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function TK(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function F0t(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function U0t(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+1)}function k0t(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function pRe(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function z0t(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function B0t(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t[3]=e[3]+r[3]*i,t[4]=e[4]+r[4]*i,t[5]=e[5]+r[5]*i,t}function V0t(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function G0t(t,e){const r=t[0],i=t[1],n=t[2],s=t[3],o=t[4],a=t[5],l=e[0],c=e[1],u=e[2],d=e[3],p=e[4],m=e[5],y=tl();return Math.abs(r-l)<=y*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-c)<=y*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(n-u)<=y*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(s-d)<=y*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(o-p)<=y*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=y*Math.max(1,Math.abs(a),Math.abs(m))}const j0t=hRe,H0t=pRe;Object.freeze(Object.defineProperty({__proto__:null,add:k0t,copy:M0t,determinant:L0t,equals:G0t,exactEquals:V0t,frob:U0t,fromRotation:D0t,fromScaling:N0t,fromTranslation:TK,identity:$0t,invert:uRe,mul:j0t,multiply:hRe,multiplyScalar:z0t,multiplyScalarAndAdd:B0t,rotate:wK,scale:dRe,set:I0t,str:F0t,sub:H0t,subtract:pRe,translate:xK},Symbol.toStringTag,{value:"Module"}));function fRe(){const t=new Float32Array(6);return t[0]=1,t[3]=1,t}function W0t(t){const e=new Float32Array(6);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 q0t(t,e,r,i,n,s){const o=new Float32Array(6);return o[0]=t,o[1]=e,o[2]=r,o[3]=i,o[4]=n,o[5]=s,o}function X0t(t,e){return new Float32Array(t,e,6)}function mRe(t,e,r,i){const n=e[i],s=e[i+1];t[i]=r[0]*n+r[2]*s+r[4],t[i+1]=r[1]*n+r[3]*s+r[5]}function Y0t(t,e,r,i=0,n=0,s=2){const o=n||e.length/s;for(let a=i;a=2}function eyt(t){return Array.isArray(t)&&t.length>=2}function zz(t){return K0t(t)||eyt(t)}const tyt=96,ryt=39.37;function SK(t,e){return e.type?er(t,e.x,e.y):fs(t,e)}function iyt(t){return el(t)}function nyt(t,e){const r=t.targetGeometry,i=e.targetGeometry;return r.x=i.x,r.y=i.y,r.spatialReference=i.spatialReference,t.scale=e.scale,t.rotation=e.rotation,t}const syt=function(){const t=Ne();return function(e,r,i){const n=r.targetGeometry;SK(t,n);const s=.5*iU(r);return e.xmin=t[0]-s*i[0],e.ymin=t[1]-s*i[1],e.xmax=t[0]+s*i[0],e.ymax=t[1]+s*i[1],e.spatialReference=n.spatialReference,e}}();function iU(t){return t.scale*oyt(t.targetGeometry)}function oyt(t){return t!=null&&ua(t.spatialReference)?1/(iyt(t.spatialReference)*ryt*tyt):1}function ayt(t){return l6(t.rotation)||0}const EK=function(){const t=Ne(),e=Ne(),r=Ne();return function(i,n,s,o,a,l){return zZ(t,n),dc(e,s,.5*l),er(r,1/o*l,-1/o*l),TK(i,e),a&&wK(i,i,a),dRe(i,i,r),xK(i,i,t),i}}(),lyt=function(){const t=Ne();return function(e,r,i,n){const s=iU(r),o=ayt(r);return SK(t,r.targetGeometry),EK(e,t,i,s,o,n)}}(),cyt=function(){const t=Ne();return function(e,r,i,n){const s=iU(r);return SK(t,r.targetGeometry),EK(e,t,i,s,0,n)}}();function uyt(t){const e=Sb(t);return e?e.valid[1]-e.valid[0]:0}function hyt(t,e){return Math.round(uyt(t)/e)}var CW;const Om=[0,0];let xy=CW=class extends ke{constructor(t){super(t),this._viewpoint2D={center:Ne(),rotation:0,scale:0,spatialReference:void 0},this.center=[0,0],this.extent=new Dr,this.id=0,this.inverseTransform=aN(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=aN(),this.transformNoRotation=aN(),this.displayMat3=Pl(),this.displayViewMat3=Pl(),this.viewMat3=Pl(),this.viewMat2d=fRe(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(t){this._set("pixelRatio",t),this._update()}set size(t){this._set("size",t),this._update()}set viewpoint(t){if(t){const e=this._viewpoint2D,r=t.targetGeometry;e.center[0]=r.x,e.center[1]=r.y,e.rotation=t.rotation,e.scale=t.scale,e.spatialReference=r.spatialReference}this._update()}copy(t){const e=this.size,r=this.viewpoint;return r&&e?(this.viewpoint=nyt(r,t.viewpoint),this._set("size",fs(e,t.size))):(this.viewpoint=t.viewpoint.clone(),this._set("size",[t.size[0],t.size[1]])),this._set("pixelRatio",t.pixelRatio),this}clone(){return new CW({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(t,e,r){return zz(e)?Cv(t,e,this.inverseTransform):(Om[0]=e,Om[1]=r,Cv(t,Om,this.inverseTransform))}toScreen(t,e,r){return zz(e)?Cv(t,e,this.transform):(Om[0]=e,Om[1]=r,Cv(t,Om,this.transform))}toScreenNoRotation(t,e,r){return zz(e)?Cv(t,e,this.transformNoRotation):(Om[0]=e,Om[1]=r,Cv(t,Om,this.transformNoRotation))}getScreenTransform(t,e){const{center:r}=this._viewpoint2D,i=this._get("pixelRatio")||1,n=this._get("size");return EK(t,r,n,e,0,i),t}_update(){const{center:t,spatialReference:e,scale:r,rotation:i}=this._viewpoint2D,n=this._get("pixelRatio")||1,s=this._get("size"),o=new hp({targetGeometry:new ze(t[0],t[1],e),scale:r,rotation:i});if(this._set("viewpoint",o),!s||!e||!r)return;this.resolution=iU(o),this.rotation=i,this.scale=r,this.spatialReference=e,fs(this.center,t);const a=s[0]!==0?2/s[0]:0,l=s[1]!==0?-2/s[1]:0;JZ(this.displayMat3,a,0,0,0,l,0,-1,1,1);const c=KZ(this.viewMat3),u=uh(s[0]/2,s[1]/2),d=uh(-s[0]/2,-s[1]/2),p=l6(i);r5(c,c,u),eQ(c,c,p),r5(c,c,d),US(this.displayViewMat3,this.displayMat3,c);const m=TK(this.viewMat2d,u);return wK(m,m,p),xK(m,m,d),syt(this.extent,o,s),lyt(this.transform,o,s,n),uRe(this.inverseTransform,this.transform),cyt(this.transformNoRotation,o,s,n),this.worldScreenWidth=hyt(this.spatialReference,this.resolution),this._set("id",this.id+1),this}};h([f({readOnly:!0})],xy.prototype,"id",void 0),h([f({value:1,json:{write:!0}})],xy.prototype,"pixelRatio",null),h([f({json:{write:!0}})],xy.prototype,"size",null),h([f()],xy.prototype,"spatialReference",void 0),h([f({type:hp,json:{write:!0}})],xy.prototype,"viewpoint",null),xy=CW=h([N("esri.views.2d.ViewState")],xy);const dyt=xy;var AW,OW,Qce,Jce,Kce,eue,tue,rue,iue,nue,sue,oue,aue,lue,cue,uue,hue,due,pue,fue,mue,gue,yue,_ue,vue,bue,wue,xue,Tue,Sue,Eue,Cue,Aue,Oue,Rue,Pue,Mue,$ue,Iue,Lue,Due,Nue,Fue,Uue,kue,zue,Bue,Vue,Gue,jue,Hue,Wue,que,Xue,Yue,Zue,Que,Jue,Kue,ehe,the;(function(t){t[t.BUTT=0]="BUTT",t[t.ROUND=1]="ROUND",t[t.SQUARE=2]="SQUARE",t[t.UNKNOWN=4]="UNKNOWN"})(AW||(AW={})),function(t){t[t.BEVEL=0]="BEVEL",t[t.ROUND=1]="ROUND",t[t.MITER=2]="MITER",t[t.UNKNOWN=4]="UNKNOWN"}(OW||(OW={})),function(t){t[t.SCREEN=0]="SCREEN",t[t.MAP=1]="MAP"}(Qce||(Qce={})),function(t){t[t.Tint=0]="Tint",t[t.Ignore=1]="Ignore",t[t.Multiply=99]="Multiply"}(Jce||(Jce={})),function(t){t.Both="Both",t.JustBegin="JustBegin",t.JustEnd="JustEnd",t.None="None"}(Kce||(Kce={})),function(t){t[t.Mosaic=0]="Mosaic",t[t.Centered=1]="Centered"}(eue||(eue={})),function(t){t[t.Normal=0]="Normal",t[t.Superscript=1]="Superscript",t[t.Subscript=2]="Subscript"}(tue||(tue={})),function(t){t[t.MSSymbol=0]="MSSymbol",t[t.Unicode=1]="Unicode"}(rue||(rue={})),function(t){t[t.Unspecified=0]="Unspecified",t[t.TrueType=1]="TrueType",t[t.PSOpenType=2]="PSOpenType",t[t.TTOpenType=3]="TTOpenType",t[t.Type1=4]="Type1"}(iue||(iue={})),function(t){t[t.Display=0]="Display",t[t.Map=1]="Map"}(nue||(nue={})),function(t){t.None="None",t.Loop="Loop",t.Oscillate="Oscillate"}(sue||(sue={})),function(t){t[t.Z=0]="Z",t[t.X=1]="X",t[t.Y=2]="Y"}(oue||(oue={})),function(t){t[t.XYZ=0]="XYZ",t[t.ZXY=1]="ZXY",t[t.YXZ=2]="YXZ"}(aue||(aue={})),function(t){t[t.Rectangle=0]="Rectangle",t[t.RoundedRectangle=1]="RoundedRectangle",t[t.Oval=2]="Oval"}(lue||(lue={})),function(t){t[t.None=0]="None",t[t.Alpha=1]="Alpha",t[t.Screen=2]="Screen",t[t.Multiply=3]="Multiply",t[t.Add=4]="Add"}(cue||(cue={})),function(t){t[t.TTB=0]="TTB",t[t.RTL=1]="RTL",t[t.BTT=2]="BTT"}(uue||(uue={})),function(t){t[t.None=0]="None",t[t.SignPost=1]="SignPost",t[t.FaceNearPlane=2]="FaceNearPlane"}(hue||(hue={})),function(t){t[t.Float=0]="Float",t[t.String=1]="String",t[t.Boolean=2]="Boolean"}(due||(due={})),function(t){t[t.Intersect=0]="Intersect",t[t.Subtract=1]="Subtract"}(pue||(pue={})),function(t){t.OpenEnded="OpenEnded",t.Block="Block",t.Crossed="Crossed"}(fue||(fue={})),function(t){t.FullGeometry="FullGeometry",t.PerpendicularFromFirstSegment="PerpendicularFromFirstSegment",t.ReversedFirstSegment="ReversedFirstSegment",t.PerpendicularToSecondSegment="PerpendicularToSecondSegment",t.SecondSegmentWithTicks="SecondSegmentWithTicks",t.DoublePerpendicular="DoublePerpendicular",t.OppositeToFirstSegment="OppositeToFirstSegment",t.TriplePerpendicular="TriplePerpendicular",t.HalfCircleFirstSegment="HalfCircleFirstSegment",t.HalfCircleSecondSegment="HalfCircleSecondSegment",t.HalfCircleExtended="HalfCircleExtended",t.OpenCircle="OpenCircle",t.CoverageEdgesWithTicks="CoverageEdgesWithTicks",t.GapExtentWithDoubleTicks="GapExtentWithDoubleTicks",t.GapExtentMidline="GapExtentMidline",t.Chevron="Chevron",t.PerpendicularWithArc="PerpendicularWithArc",t.ClosedHalfCircle="ClosedHalfCircle",t.TripleParallelExtended="TripleParallelExtended",t.ParallelWithTicks="ParallelWithTicks",t.Parallel="Parallel",t.PerpendicularToFirstSegment="PerpendicularToFirstSegment",t.ParallelOffset="ParallelOffset",t.OffsetOpposite="OffsetOpposite",t.OffsetSame="OffsetSame",t.CircleWithArc="CircleWithArc",t.DoubleJog="DoubleJog",t.PerpendicularOffset="PerpendicularOffset",t.LineExcludingLastSegment="LineExcludingLastSegment",t.MultivertexArrow="MultivertexArrow",t.CrossedArrow="CrossedArrow",t.ChevronArrow="ChevronArrow",t.ChevronArrowOffset="ChevronArrowOffset",t.PartialFirstSegment="PartialFirstSegment",t.Arch="Arch",t.CurvedParallelTicks="CurvedParallelTicks",t.Arc90Degrees="Arc90Degrees"}(mue||(mue={})),function(t){t.Mitered="Mitered",t.Bevelled="Bevelled",t.Rounded="Rounded",t.Square="Square",t.TrueBuffer="TrueBuffer"}(gue||(gue={})),function(t){t.ClosePath="ClosePath",t.ConvexHull="ConvexHull",t.RectangularBox="RectangularBox"}(yue||(yue={})),function(t){t.BeginningOfLine="BeginningOfLine",t.EndOfLine="EndOfLine"}(_ue||(_ue={})),function(t){t.Mitered="Mitered",t.Bevelled="Bevelled",t.Rounded="Rounded",t.Square="Square"}(vue||(vue={})),function(t){t.Fast="Fast",t.Accurate="Accurate"}(bue||(bue={})),function(t){t.BeginningOfLine="BeginningOfLine",t.EndOfLine="EndOfLine"}(wue||(wue={})),function(t){t.Sinus="Sinus",t.Square="Square",t.Triangle="Triangle",t.Random="Random"}(xue||(xue={})),function(t){t[t.None=0]="None",t[t.Default=1]="Default",t[t.Force=2]="Force"}(Tue||(Tue={})),function(t){t[t.Buffered=0]="Buffered",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.AlongLine=3]="AlongLine"}(Sue||(Sue={})),function(t){t[t.Linear=0]="Linear",t[t.Rectangular=1]="Rectangular",t[t.Circular=2]="Circular",t[t.Buffered=3]="Buffered"}(Eue||(Eue={})),function(t){t[t.Discrete=0]="Discrete",t[t.Continuous=1]="Continuous"}(Cue||(Cue={})),function(t){t[t.AcrossLine=0]="AcrossLine",t[t.AloneLine=1]="AloneLine"}(Aue||(Aue={})),function(t){t[t.Left=0]="Left",t[t.Right=1]="Right",t[t.Center=2]="Center",t[t.Justify=3]="Justify"}(Oue||(Oue={})),function(t){t[t.Base=0]="Base",t[t.MidPoint=1]="MidPoint",t[t.ThreePoint=2]="ThreePoint",t[t.FourPoint=3]="FourPoint",t[t.Underline=4]="Underline",t[t.CircularCW=5]="CircularCW",t[t.CircularCCW=6]="CircularCCW"}(Rue||(Rue={})),function(t){t.Butt="Butt",t.Round="Round",t.Square="Square"}(Pue||(Pue={})),function(t){t.NoConstraint="NoConstraint",t.HalfPattern="HalfPattern",t.HalfGap="HalfGap",t.FullPattern="FullPattern",t.FullGap="FullGap",t.Custom="Custom"}(Mue||(Mue={})),function(t){t[t.None=-1]="None",t[t.Custom=0]="Custom",t[t.Circle=1]="Circle",t[t.OpenArrow=2]="OpenArrow",t[t.ClosedArrow=3]="ClosedArrow",t[t.Diamond=4]="Diamond"}($ue||($ue={})),function(t){t[t.ExtraLeading=0]="ExtraLeading",t[t.Multiple=1]="Multiple",t[t.Exact=2]="Exact"}(Iue||(Iue={})),function(t){t.Bevel="Bevel",t.Round="Round",t.Miter="Miter"}(Lue||(Lue={})),function(t){t[t.Default=0]="Default",t[t.String=1]="String",t[t.Numeric=2]="Numeric"}(Due||(Due={})),function(t){t[t.InsidePolygon=0]="InsidePolygon",t[t.PolygonCenter=1]="PolygonCenter",t[t.RandomlyInsidePolygon=2]="RandomlyInsidePolygon"}(Nue||(Nue={})),function(t){t[t.Tint=0]="Tint",t[t.Replace=1]="Replace",t[t.Multiply=2]="Multiply"}(Fue||(Fue={})),function(t){t[t.ClipAtBoundary=0]="ClipAtBoundary",t[t.RemoveIfCenterOutsideBoundary=1]="RemoveIfCenterOutsideBoundary",t[t.DoNotTouchBoundary=2]="DoNotTouchBoundary",t[t.DoNotClip=3]="DoNotClip"}(Uue||(Uue={})),function(t){t.NoConstraint="NoConstraint",t.WithMarkers="WithMarkers",t.WithFullGap="WithFullGap",t.WithHalfGap="WithHalfGap",t.Custom="Custom"}(kue||(kue={})),function(t){t.Fixed="Fixed",t.Random="Random",t.RandomFixedQuantity="RandomFixedQuantity"}(zue||(zue={})),function(t){t.LineMiddle="LineMiddle",t.LineBeginning="LineBeginning",t.LineEnd="LineEnd",t.SegmentMidpoint="SegmentMidpoint"}(Bue||(Bue={})),function(t){t.OnPolygon="OnPolygon",t.CenterOfMass="CenterOfMass",t.BoundingBoxCenter="BoundingBoxCenter"}(Vue||(Vue={})),function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"}(Gue||(Gue={})),function(t){t[t.MarkerCenter=0]="MarkerCenter",t[t.MarkerBounds=1]="MarkerBounds"}(jue||(jue={})),function(t){t[t.None=0]="None",t[t.PropUniform=1]="PropUniform",t[t.PropNonuniform=2]="PropNonuniform",t[t.DifUniform=3]="DifUniform",t[t.DifNonuniform=4]="DifNonuniform"}(Hue||(Hue={})),function(t){t.Tube="Tube",t.Strip="Strip",t.Wall="Wall"}(Wue||(Wue={})),function(t){t[t.Random=0]="Random",t[t.Increasing=1]="Increasing",t[t.Decreasing=2]="Decreasing",t[t.IncreasingThenDecreasing=3]="IncreasingThenDecreasing"}(que||(que={})),function(t){t[t.Relative=0]="Relative",t[t.Absolute=1]="Absolute"}(Xue||(Xue={})),function(t){t[t.Normal=0]="Normal",t[t.LowerCase=1]="LowerCase",t[t.Allcaps=2]="Allcaps"}(Yue||(Yue={})),function(t){t[t.LTR=0]="LTR",t[t.RTL=1]="RTL"}(Zue||(Zue={})),function(t){t.Draft="Draft",t.Picture="Picture",t.Text="Text"}(Que||(Que={})),function(t){t[t.Top=0]="Top",t[t.Center=1]="Center",t[t.Baseline=2]="Baseline",t[t.Bottom=3]="Bottom"}(Jue||(Jue={})),function(t){t[t.Right=0]="Right",t[t.Upright=1]="Upright"}(Kue||(Kue={})),function(t){t[t.Small=0]="Small",t[t.Medium=1]="Medium",t[t.Large=2]="Large"}(ehe||(ehe={})),function(t){t[t.Calm=0]="Calm",t[t.Rippled=1]="Rippled",t[t.Slight=2]="Slight",t[t.Moderate=3]="Moderate"}(the||(the={}));var RW,ob,PW,nF,MW,sF,$W,ab,IW;(function(t){t[t.BACKGROUND=0]="BACKGROUND",t[t.FILL=1]="FILL",t[t.LINE=2]="LINE",t[t.SYMBOL=3]="SYMBOL",t[t.CIRCLE=4]="CIRCLE"})(RW||(RW={})),function(t){t[t.VISIBLE=0]="VISIBLE",t[t.NONE=1]="NONE"}(ob||(ob={})),function(t){t[t.POINT=0]="POINT",t[t.LINE=1]="LINE",t[t.LINE_CENTER=2]="LINE_CENTER"}(PW||(PW={})),function(t){t[t.MAP=0]="MAP",t[t.VIEWPORT=1]="VIEWPORT",t[t.AUTO=2]="AUTO"}(nF||(nF={})),function(t){t[t.AUTO=0]="AUTO",t[t.LEFT=1]="LEFT",t[t.CENTER=2]="CENTER",t[t.RIGHT=3]="RIGHT"}(MW||(MW={})),function(t){t[t.CENTER=0]="CENTER",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.TOP=3]="TOP",t[t.BOTTOM=4]="BOTTOM",t[t.TOP_LEFT=5]="TOP_LEFT",t[t.TOP_RIGHT=6]="TOP_RIGHT",t[t.BOTTOM_LEFT=7]="BOTTOM_LEFT",t[t.BOTTOM_RIGHT=8]="BOTTOM_RIGHT"}(sF||(sF={})),function(t){t[t.NONE=0]="NONE",t[t.UPPERCASE=1]="UPPERCASE",t[t.LOWERCASE=2]="LOWERCASE"}($W||($W={})),function(t){t[t.MAP=0]="MAP",t[t.VIEWPORT=1]="VIEWPORT"}(ab||(ab={})),function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(IW||(IW={}));let ld=class{};ld.backgroundLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:ob.VISIBLE}},ld.fillLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:ob.VISIBLE}},ld.lineLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:ob.VISIBLE},"line-cap":{type:"enum",values:["butt","round","square"],default:AW.BUTT},"line-join":{type:"enum",values:["bevel","round","miter"],default:OW.MITER},"line-miter-limit":{type:"number",default:2},"line-round-limit":{type:"number",default:1.05}},ld.symbolLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:ob.VISIBLE},"symbol-avoid-edges":{type:"boolean",default:!1},"symbol-placement":{type:"enum",values:["point","line","line-center"],default:PW.POINT},"symbol-sort-key":{type:"number",default:-1},"symbol-spacing":{type:"number",minimum:1,default:250},"icon-allow-overlap":{type:"boolean",default:!1},"icon-anchor":{type:"enum",values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:sF.CENTER},"icon-ignore-placement":{type:"boolean",default:!1},"icon-image":{type:"string"},"icon-keep-upright":{type:"boolean",default:!1},"icon-offset":{type:"array",value:"number",length:2,default:[0,0]},"icon-optional":{type:"boolean",default:!1},"icon-padding":{type:"number",minimum:0,default:2},"icon-rotate":{type:"number",default:0},"icon-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:nF.AUTO},"icon-size":{type:"number",minimum:0,default:1},"text-allow-overlap":{type:"boolean",default:!1},"text-anchor":{type:"enum",values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:sF.CENTER},"text-field":{type:"string"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"]},"text-ignore-placement":{type:"boolean",default:!1},"text-justify":{type:"enum",values:["auto","left","center","right"],default:MW.CENTER},"text-keep-upright":{type:"boolean",default:!0},"text-letter-spacing":{type:"number",default:0},"text-line-height":{type:"number",default:1.2},"text-max-angle":{type:"number",minimum:0,default:45},"text-max-width":{type:"number",minimum:0,default:10},"text-offset":{type:"array",value:"number",length:2,default:[0,0]},"text-optional":{type:"boolean",default:!1},"text-padding":{type:"number",minimum:0,default:2},"text-rotate":{type:"number",default:0},"text-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:nF.AUTO},"text-size":{type:"number",minimum:0,default:16},"text-transform":{type:"enum",values:["none","uppercase","lowercase"],default:$W.NONE},"text-writing-mode":{type:"array",value:"enum",values:["horizontal","vertical"],default:[IW.HORIZONTAL]}},ld.circleLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:ob.VISIBLE}},ld.backgroundPaintDefinition={"background-color":{type:"color",default:[0,0,0,1]},"background-opacity":{type:"number",minimum:0,maximum:1,default:1},"background-pattern":{type:"string"}},ld.fillPaintDefinition={"fill-antialias":{type:"boolean",default:!0},"fill-color":{type:"color",default:[0,0,0,1]},"fill-opacity":{type:"number",minimum:0,maximum:1,default:1},"fill-outline-color":{type:"color",default:[0,0,0,0]},"fill-pattern":{type:"string"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0]},"fill-translate-anchor":{type:"enum",values:["map","viewport"],default:ab.MAP}},ld.linePaintDefinition={"line-blur":{type:"number",minimum:0,default:0},"line-color":{type:"color",default:[0,0,0,1]},"line-dasharray":{type:"array",value:"number",default:[]},"line-gap-width":{type:"number",minimum:0,default:0},"line-offset":{type:"number",default:0},"line-opacity":{type:"number",minimum:0,maximum:1,default:1},"line-pattern":{type:"string"},"line-translate":{type:"array",value:"number",length:2,default:[0,0]},"line-translate-anchor":{type:"enum",values:["map","viewport"],default:ab.MAP},"line-width":{type:"number",minimum:0,default:1}},ld.symbolPaintDefinition={"icon-color":{type:"color",default:[0,0,0,1]},"icon-halo-blur":{type:"number",minimum:0,default:0},"icon-halo-color":{type:"color",default:[0,0,0,0]},"icon-halo-width":{type:"number",minimum:0,default:0},"icon-opacity":{type:"number",minimum:0,maximum:1,default:1},"icon-translate":{type:"array",value:"number",length:2,default:[0,0]},"icon-translate-anchor":{type:"enum",values:["map","viewport"],default:ab.MAP},"text-color":{type:"color",default:[0,0,0,1]},"text-halo-blur":{type:"number",minimum:0,default:0},"text-halo-color":{type:"color",default:[0,0,0,0]},"text-halo-width":{type:"number",minimum:0,default:0},"text-opacity":{type:"number",minimum:0,maximum:1,default:1},"text-translate":{type:"array",value:"number",length:2,default:[0,0]},"text-translate-anchor":{type:"enum",values:["map","viewport"],default:ab.MAP}},ld.rasterPaintDefinition={"raster-opacity":{type:"number",minimum:0,maximum:1,default:1},"raster-hue-rotate":{type:"number",default:0},"raster-brightness-min":{type:"number",minimum:0,maximum:1,default:0},"raster-brightness-max":{type:"number",minimum:0,maximum:1,default:1},"raster-saturation":{type:"number",minimum:-1,maximum:1,default:0},"raster-contrast":{type:"number",minimum:-1,maximum:1,default:0},"raster-fade-duration":{type:"number",minimum:0,default:300}},ld.circlePaintDefinition={"circle-blur":{type:"number",minimum:0,default:0},"circle-color":{type:"color",default:[0,0,0,1]},"circle-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-radius":{type:"number",minimum:0,default:5},"circle-stroke-color":{type:"color",default:[0,0,0,1]},"circle-stroke-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-stroke-width":{type:"number",minimum:0,default:0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0]},"circle-translate-anchor":{type:"enum",values:["map","viewport"],default:ab.MAP}};const pyt=.125;let fyt=class{constructor(){this._renderParams={context:null,drawPhase:1,state:new dyt({viewpoint:new hp({targetGeometry:new ze(0,0),scale:1,rotation:0}),size:[256,256]}),stationary:!0,pixelRatio:1,displayLevel:-1,requiredLevel:-1,globalOpacity:1,renderPass:"background",styleLayer:null,styleLayerUID:-1,painter:null,glyphMosaic:null,spriteMosaic:null,profiler:null,renderingOptions:null,requestRender:null,allowDelayedRender:!1,deltaTime:-1,timeline:null,time:0,hasClipping:!1,blendMode:null,dataUploadCounter:0,effects:null,inFadeTransition:!1,requireFBO:!1,highlightGradient:null}}dispose(){this._renderParams=null}render(e,r,i,n,s,o,a,l,c,u,d){this._render(e,r,i,n,s,o,a,l,c,u,d)}renderSymbols(e,r,i,n,s,o,a,l,c,u,d){this._render(e,r,i,n,s,o,a,l,c,u,d,RW.SYMBOL)}_render(e,r,i,n,s,o,a,l,c,u,d,p){const m=r[0]-o.getLevelShift(r[0]),y=this._renderParams;y.context=e,y.painter=n,y.glyphMosaic=n.glyphMosaic,y.spriteMosaic=n.spriteMosaic,y.pixelRatio=u*d,y.displayLevel=m,y.requiredLevel=m;const _=o.getScale(r[0]),[v,b]=o.getOffset(r,a*_),x=pyt*a*_/c,T=i.transforms.dvs;T[0]=x,T[4]=-x,T[6]=-1-v-l[0]*a*2,T[7]=1+b+(1-l[1])*a*2-2,y.state.size[0]=c/d,y.state.size[1]=c/d,y.state.pixelRatio=d,i.stage||i.attachWithContext(e),i.triangleCount=0,n.drawTile(y,i,s,p)}},gRe=class yRe extends Tr{initializeProgram(e){return new vr(e.rctx,yRe.shader.get().build(this.configuration),fr)}initializePipeline(){return Ot({blending:Cc(ve.ONE,ve.ONE_MINUS_SRC_ALPHA),colorWrite:Ft})}};gRe.shader=new _r(Igt,()=>ce(()=>import("./RasterColorizer.glsl-724b79fe.js"),[]));let dA=class extends AO{constructor(){super(...arguments),this.colorizerType=kb.Stretch,this.stretchType=Tw.Noop,this.applyColormap=!0,this.requireBilinearWithNN=!1}};h([U({count:kb.COUNT})],dA.prototype,"colorizerType",void 0),h([U({count:Tw.COUNT})],dA.prototype,"stretchType",void 0),h([U()],dA.prototype,"applyColormap",void 0),h([U()],dA.prototype,"requireBilinearWithNN",void 0);let rhe=class{constructor(e){this._rctx=e,this._fbos=new Map}get(e){return this._getPool(e)}dispose(){this._fbos.forEach(e=>e.dispose()),this._fbos.clear()}_getPool(e){const r=this._fbos.get(e);if(r)return r;const i=new hs(this._rctx,new pr(e),new n5(jn.DEPTH_COMPONENT16,e));return this._fbos.set(e,i),i}};const myt=J.getLogger("esri.views.3d.terrain");let gyt=class{constructor(e,r){this._rctx=e,this._techniqueRepository=r,this._fbos=[],this._vectorTileHelper=new fyt,this._bindParameters=new e8(null,null,null),this._blendLayersTechniqueConfig=new cRe,this._current=0,this._lastUsedIds=new Array,this._lastCreatedBufferId=0,this._onHoldIds=new Array,this._vaoQuad=Dl(this._rctx,$P)}dispose(){this._fbos.forEach(Le),this._fbos=null,this._vtFBO=Le(this._vtFBO),this._vaoQuad=Le(this._vaoQuad),this._vectorTileHelper=Le(this._vectorTileHelper),this._backgroundTechnique=Fi(this._backgroundTechnique),this._applyOpacityTechnique=Fi(this._applyOpacityTechnique),this._blendLayersTechnique=Fi(this._blendLayersTechnique)}_getBlendLayersTechnique(e,r,i,n=Nd.Off,s=Sw.BelowLayer){return this._blendLayersTechniqueConfig.output=r,this._blendLayersTechniqueConfig.blendMode=e,this._blendLayersTechniqueConfig.baseOpacityMode=i,this._blendLayersTechniqueConfig.premultipliedSource=n,this._blendLayersTechniqueConfig.background=s,this._blendLayersTechnique=this._techniqueRepository.releaseAndAcquire(aRe,this._blendLayersTechniqueConfig,this._blendLayersTechnique),this._blendLayersTechnique}drawBackground(e,r){const i=this._getBlendLayersTechnique(Ae.Normal,r?ws.ColorComposite:ws.GridComposite,Zd.NotRequired,Nd.Off,Sw.Only),n=this._rctx.bindTechnique(i,e,this._bindParameters);this._render(n)}_render(e){this._rctx.bindVAO(this._vaoQuad),e.assertCompatibleVertexAttributeLocations(this._vaoQuad),this._rctx.drawArrays(Et.TRIANGLE_STRIP,0,No(this._vaoQuad,"geometry"))}drawGroup(e,r,i,n,s,o=Nd.On){r===ws.Composite&&(e.fboTexture=this._fbos[this.getLastOnHoldId()].get(i).colorTexture),e.texture=this.currentFBO(i).colorTexture,this.closeGroup(i);const a=this._getBlendLayersTechnique(n,r,s,o),l=this._rctx.bindTechnique(a,e,this._bindParameters);this._render(l)}drawRasterData(e,r,i,n,s,o=Nd.Off){if(e.texture==null)return;e.fboTexture=r===ws.GroupBackgroundComposite||n===Ae.Normal&&s===Zd.NotRequired&&o===Nd.Off?null:this.switch(i).colorTexture;const a=this._getBlendLayersTechnique(n,r,s,o),l=this._rctx.bindTechnique(a,e,this._bindParameters);this._render(l)}drawImageryTileData(e,r,i,n,s,o){const a=o.sourceLayerInfo.data;if(!a.source||(o.tile.surface.layerViewByIndex(o.layerIndex,Zt.MAP).ensureSymbolizerParameters(a),!a.bind(this._rctx)))return;e.fboTexture=n===Ae.Normal&&s===Zd.NotRequired?null:this.switch(i).colorTexture;const l=this._getRasterColorizerTechnique(a,r,n,s);a.opacity=e.opacity;const c=a.getUniforms();c.scale=o.scale,c.offset=o.offset,c.backgroundColor=e.backgroundColor,c.fboTexture=e.fboTexture,c.baseOpacity=e.baseOpacity;const u=this._rctx.bindTechnique(l,c,null);this._render(u)}_getRasterColorizerTechnique(e,r,i,n){const s=e.symbolizerParameters,o=["stretch","lut","hillshade"].indexOf(s.type);return this._rasterColorizerConfig==null&&(this._rasterColorizerConfig=new dA,this._rctx.gl.getExtension("WEBGL_color_buffer_float"),this._rctx.gl.getExtension("OES_texture_float")),this._rasterColorizerConfig.output=r,this._rasterColorizerConfig.blendMode=i,this._rasterColorizerConfig.baseOpacityMode=n,this._rasterColorizerConfig.colorizerType=o,this._rasterColorizerConfig.applyColormap=!!s.colormap,this._rasterColorizerConfig.requireBilinearWithNN=e.isBilinearWithStretchColorRamp,this._rasterColorizerConfig.stretchType=e.hasStretchTypeNone()?Tw.Noop:Tw.PerBand,this._rasterColorizerTechnique=this._techniqueRepository.releaseAndAcquire(gRe,this._rasterColorizerConfig,this._rasterColorizerTechnique),this._rasterColorizerTechnique}drawVectorData(e,r,i,n,s,o,a,l,c){const u=this._rctx,d=o.sourceLayerInfo.data,p=o.tile.surface.layerViewByIndex(o.layerIndex,Zt.MAP),m=s===Zd.Required||e.opacity<1||n!==Ae.Normal||r!==ws.Composite,y=m?Nd.On:Nd.Off;this._getBlendLayersTechnique(n,r,s,y).bindPipelineState(u);let _=null,v=null;m?(v=this.currentFBO(i),this._vtFBO==null&&(this._vtFBO=new rhe(this._rctx)),_=this._vtFBO.get(i),u.bindFramebuffer(_),this._clearCurrentFBO()):c&&u.clearSafe(yi.DEPTH_BUFFER_BIT);try{this._vectorTileHelper.render(u,o.sourceLod,d,p.painter,p.layer.styleRepository,p.schemaHelper,Math.round(1/o.scale),o.offset,l,a,p.contentZoom),o.vtlNeighborInfos.forAll(b=>this._vectorTileHelper.renderSymbols(u,b.sourceLod,b.sourceLayerInfo.data,p.painter,p.layer.styleRepository,p.schemaHelper,1,b.offset,l,a,p.contentZoom))}catch(b){myt.warnOnce("A render call containing vector tiles did not resolve correctly.",b)}return _==null||(u.bindFramebuffer(v),e.texture=_.colorTexture,e.offset=dp,e.scale=1,this.drawRasterData(e,r,i,n,s,y),c)}copyFBOToTexture(e){const r=this._rctx,i=r.bindTexture(e.texture,Ct.TEXTURE_UNIT_FOR_UPDATES),n=e.descriptor;r.gl.copyTexImage2D(nn.TEXTURE_2D,0,n.pixelFormat,0,0,n.width,n.height,0),e.generateMipmap(),r.bindTexture(i,Ct.TEXTURE_UNIT_FOR_UPDATES)}_clearCurrentFBO(){this._rctx.setClearColor(0,0,0,0),this._rctx.setClearDepth(1),this._rctx.clearSafe(yi.COLOR_BUFFER_BIT|yi.DEPTH_BUFFER_BIT)}_initFBO(e,r,i){this._rctx.bindFramebuffer(e),i&&(this._rctx.setViewport(0,0,r,r),this._clearCurrentFBO())}ensureBuffer(e){this._lastUsedIds.length=0,this._lastUsedIds.push(1),this._lastCreatedBufferId=1,this._onHoldIds.length=0,this.bind(e)}bind(e,r=0,i=!0){if(this._current=r,r>=this._fbos.length)for(let n=this._fbos.length;n<=r;n++)this._fbos.push(new rhe(this._rctx));this._initFBO(this._fbos[r].get(e),e,i)}_bindNextFreeBuffer(e){this._lastUsedIds.length>0?this.bind(e,this._lastUsedIds.pop()):(this._lastCreatedBufferId++,this.bind(e,this._lastCreatedBufferId))}openGroup(e){this._onHoldIds.push(this._current),this._bindNextFreeBuffer(e)}switch(e){const r=this.currentFBO(e),i=this._current;return this._bindNextFreeBuffer(e),this._lastUsedIds.push(i),r}getLastOnHoldId(){return this._onHoldIds[this._onHoldIds.length-1]}closeGroup(e){const r=this._current;this._bindNextFreeBuffer(e),this._lastUsedIds.push(r),this._lastUsedIds.push(this._onHoldIds.pop())}unbind(){this._rctx.bindFramebuffer(null)}currentFBO(e){return this._fbos[this._current].get(e)}},yyt=class{constructor(){this.sourceLod=[0,0,0],this.offset=[0,0],this.scale=1,this.layerIndex=0,this.vtlNeighborInfos=new Nt({allocator:e=>e||new _yt})}},_yt=class{constructor(){this.sourceLayerInfo=null,this.sourceLod=[0,0,0],this.offset=[-1,0]}},vyt=class{constructor(e,r,i,n){this.start=e,this.end=r,this.blendMode=i,this.opacity=n}},byt=class{constructor(e,r,i){this._rctx=e,this.tileSize=r,this._techniqueRepository=i,this._passParameters=new P0t,this._backgroundTexture=null,this._backgroundColor=null,this._backgroundDirty=!1,this._blackTex=null,this._maxAnisotropy=this._rctx.parameters.maxMaxAnisotropy,this._composition=new gyt(this._rctx,this._techniqueRepository),this._blackTex=new L2(TWe(this._rctx,[0,0,0,1])),this._ensureBackgroundTexture(this.tileSize)}dispose(){this._composition=Le(this._composition),this._backgroundTexture=Fi(this._backgroundTexture),this._blackTex=Fi(this._blackTex)}get backgroundIsGrid(){return this._backgroundColor==null}get backgroundColor(){return this._backgroundColor}updateTileTexture(e,r){if(!e.renderData)return;const i=e.surface,n=i.baseOpacity;let s=0,o=0,a=this.tileSize,l=!1;const c=i.view.state.contentPixelRatio;let u=!1;oF.clear(),Bx.length=0;const d=e.layerInfo[Zt.MAP];let p=d.length,m=0,y=null;for(;m=d.length&&(p=m),K5(v)){she[m]=v.layer.blendMode;let S=v.layer.blendMode!=="normal";if(_S(v.layer.parent)){const A=LW(v.layer.parent);A!=null&&A!==""&&(S=_Re(v.layer.parent)||S)}S&&(u=S,l=!1)}if(b===0&&!u){d[m].pendingUpdates&=~(gt.TEXTURE_NOFADING>.TEXTURE_FADING);continue}++o;const T=Bz(e,m);if(T){if(d[m].pendingUpdates&=~(gt.TEXTURE_NOFADING>.TEXTURE_FADING),_S(v.layer.parent)){const S=LW(v.layer.parent);S!=null&&S!==""&&vRe(v.layer.parent,m)}VR(v)?a=Math.max(a,this.tileSize*c):n===1&&x===1&&(v.isOpaque||this._dataToTexture(T)&&T.sourceLayerInfo.data.descriptor.isOpaque)&&(l=!0),++s,y===null&&(y=m)}}const _=a/this.tileSize;this._ensureBackgroundTexture(this.tileSize),s!==0&&y!==null?s===1&&!u&&this._useLayerTexture(e,y,p,nhe[y])||this._composeMapLayers(e,r,m-1,p,ihe,she,a,_,!l||u,oF,u):this._useBackgroundTexture(e,o)}_ensureBackgroundTexture(e){this._backgroundTexture==null&&(this._backgroundTexture=this._buildTexture(e),this._backgroundDirty=!0),this._backgroundDirty&&(this._composition.bind(e),this._passParameters.offset=dp,this._passParameters.scale=1,this._passParameters.opacity=1,this.backgroundColor!=null&&(this._passParameters.backgroundColor=this.backgroundColor),this._composition.drawBackground(this._passParameters,this.backgroundColor!=null),this._composition.copyFBOToTexture(this._backgroundTexture),this._composition.unbind(),this._backgroundDirty=!1)}_useBackgroundTexture(e,r){let i=Ag.Immediate;(e.surface.view.layerViewManager.updating||r>0)&&(i=Ag.Delayed);const n=e.renderData;this._backgroundTexture&&n.textureReference==null&&(i=Ag.Immediate),n.setTextureReference(this._backgroundTexture!=null?new kz(this._backgroundTexture,ns.FADING,ohe,e.surface.baseOpacity,0,1):null,i)}_useLayerTexture(e,r,i,n){const s=r=0;T--){const S=Bz(e,T);if(!S||s[T]===0&&!d)continue;const A=T{V.start===T&&(Bx.push(V),this._composition.openGroup(a),R=!0)});const P=v===0,F=R?ws.GroupBackgroundComposite:c&&P?this.backgroundIsGrid?ws.GridComposite:ws.ColorComposite:ws.Composite,k=TW[o[T]];for(wOe(S)?(this._passParameters.opacity=s[T],_=this._composition.drawVectorData(this._passParameters,F,a,k,C,S,l,this.tileSize,_)):rmt(S)?(this._passParameters.opacity=s[T],this._composition.drawImageryTileData(this._passParameters,F,a,k,C,S),this._hasNearestInterpolation(S)&&(y=At.NEAREST)):this._dataToTexture(S)&&(this._passParameters.texture=S.sourceLayerInfo.data.texture,this._passParameters.offset=S.offset,this._passParameters.scale=S.scale,this._passParameters.opacity=s[T],this._composition.drawRasterData(this._passParameters,F,a,k,C));Bx.length>0&&Bx[Bx.length-1].end===T;){const V=Bx.pop();this._passParameters.opacity=V.opacity,this._passParameters.offset=dp,this._passParameters.scale=1;const z=c&&P?this.backgroundIsGrid?ws.GridComposite:ws.ColorComposite:ws.Composite;this._composition.drawGroup(this._passParameters,z,a,TW[V.blendMode],C)}v++}const b=e.renderData,x=b.ensureTexture(a,()=>this._buildTexture(a,y));this._composition.copyFBOToTexture(x),this._composition.unbind(),b.setTextureReference(new kz(x,r,ohe,m?1:p,0,1))}_hasNearestInterpolation(e){const r=e.sourceLayerInfo.data;return!!r.source&&r.interpolation==="nearest"}_dataToTexture(e){if(nmt(e)){const r=e.sourceLayerInfo;r.data=this._buildTexture(r.data),e.tile.setMemoryDirty()}return imt(e)}setBackground(e){this._backgroundColor!==e&&(this._backgroundColor=e,this._backgroundDirty=!0)}_buildTexture(e,r=At.LINEAR_MIPMAP_LINEAR){if(e==null)return null;const i=new pr;i.wrapMode=Pt.CLAMP_TO_EDGE,i.samplingMode=r,i.maxAnisotropy=this._maxAnisotropy,i.preMultiplyAlpha=!0,i.flipped=!0,i.hasMipmap=!0;const n=this._rctx;let s;if(typeof e=="number")i.width=i.height=e,s=new L2(new Ct(n,i));else if(e instanceof Q8)i.isOpaque=e.isOpaque,s=new L2(new Ct(n,i,e.image)),e.release();else try{i.width=e.width,i.height=e.height,s=new L2(new Ct(n,i,e))}catch{s=new L2(gxe(n)),console.warn("TileRenderer: failed to execute 'texImage2D', cross-origin image may not be loaded.")}const o=n.bindTexture(s.texture,Ct.TEXTURE_UNIT_FOR_UPDATES);return s.generateMipmap(),n.bindTexture(o,Ct.TEXTURE_UNIT_FOR_UPDATES),s}get test(){return{backgroundTexture:this._backgroundTexture}}};function Bz(t,e){Aa.layerIndex=e,Aa.vtlNeighborInfos.clear();const r=t.layerInfo[Zt.MAP][e];if(r.data)return er(Aa.offset,0,0),Aa.tile=t,Aa.scale=1,Aa.sourceLod=t.lij,Aa.sourceLayerInfo=r,wOe(Aa)&&t.forEachLoadedNeighbor((n,s)=>{if(n.level!==t.level)return;const o=n.layerInfo[Zt.MAP][e];if(!xOe(o)||r.data===o.data)return;const a=Aa.vtlNeighborInfos.pushNew();a.offset=Wm[s],a.sourceLod=n.lij,a.sourceLayerInfo=o}),Aa;const i=r.upsampleInfo;if(i){const n=i.tile.layerInfo[Zt.MAP][e];return Aa.tile=i.tile,fs(Aa.offset,i.offset),Aa.scale=i.scale,Aa.sourceLod=i.tile.lij,Aa.sourceLayerInfo=n,Aa}return null}function LW(t){return t.get("uid")}function _Re(t){let e=t.blendMode!=="normal";return _S(t.parent)&&(e=_Re(t.parent)||e),e}function vRe(t,e){_S(t.parent)&&vRe(t.parent,e);const r=LW(t);if(r!=null&&r!==""){const i=oF.get(r);i?i.start=e:oF.set(r,new vyt(e,e,t.blendMode,t.opacity))}}const ihe=new Array,nhe=new Array,she=new Array,oF=new Map,Bx=new Array,Aa=new yyt,ohe={offset:[0,0],scale:1},Wm=new Array;Wm[tt.NORTH]=[0,-1],Wm[tt.NORTH_EAST]=[-1,-1],Wm[tt.EAST]=[-1,0],Wm[tt.SOUTH_EAST]=[-1,1],Wm[tt.SOUTH]=[0,1],Wm[tt.SOUTH_WEST]=[1,1],Wm[tt.WEST]=[1,0],Wm[tt.NORTH_WEST]=[1,-1];const bRe=200,Vz=40,wyt=.8,xyt=10,pA=1e-6;function Tyt(t,e,r){const i=e,n=r;let s=0,o=1/0;for(let a=0;a<3;++a){{const l=t[a];if(i[a]o)return!1}{const l=t[a+3];if(i[a]>l){if(n[a]>=-pA)return!1;const c=(l-i[a])/n[a];s=Math.max(s,c)}else if(n[a]>=pA){const c=(l-i[a])/n[a];o=Math.min(o,c)}if(s>o)return!1}}return!0}let ahe=class{constructor(e,r,i,n,s){this.aabb=e,this.axis=r,this.d=i,this.midStartIndex=n,this.rightStartIndex=s}},CK=class DW{constructor(e,r,i,n){this.globalTriangleVertexIndices=e,this.firstTriangleIndex=r,this.positionAttribute=n,this._rayDirection=O(),this.bspNodeTree=new Array;const s=i-r,o=s<=wRe?new Uint16Array(s):new Uint32Array(s);this.indices=o;for(let a=0;a{const m=Cyt(o,a,u,d),y=d-u;if(y<=Vz){const S=new ahe(m,void 0,0,u,d);return this.bspNodeTree.push(S),S}const{axis:_,midValue:v}=Ayt(m),b=Eyt(o,a,u,d,_,v),x=(S,A)=>{if(p>l)return;const C=A-S;return C=wyt*y?void 0:c(S,A,p+1)},T=new ahe(m,_,v,b.next,b.mid);return this.bspNodeTree.push(T),T.leftNode=x(u,b.next),T.rightNode=x(b.mid,d),T};c(0,s,0),this.triangleVertexIndices=Ryt(o,e,r,i)}}intersectRayTriangleRange(e,r){{if(e>=r)return;const i=this.triangleVertexIndices,n=this.positionAttribute.data,s=this.positionAttribute.stride,o=this._rayOrigin,a=o[0],l=o[1],c=o[2],u=this._rayDirection,d=u[0],p=u[1],m=u[2];for(let y=e,_=3*e;y0){if(B<0||B>Q)continue}else if(B>0||B0){if(de<0||B+de>Q)continue}else if(de>0||B+de=0){const Ke=this.indices[y]+this.firstTriangleIndex,_t=ZQ(R,P,F,k,V,z,Syt);this._callback(Re,_t,Ke,!1)}}}DW.numFacesTested+=r-e}intersectRay(e,r){DW.numFacesTested=0;const i=Se(e.r0[0],e.r0[1],e.r0[2]),n=Se(e.r1[0],e.r1[1],e.r1[2]),s=n[0]-i[0],o=n[1]-i[1],a=n[2]-i[2];if(s*s+o*o+a*aa||s[o]>0){const l=e.rightStartIndex,c=i;if(l=s?--a:(t[a-1]=t[l],t[l]=c,++l)}return{next:o,mid:l}}function Cyt(t,e,r,i){if(i<=r)return iw(NaN,NaN,NaN,NaN,NaN,NaN);{const n=6*t[r];for(let s=0;s<3;++s)Vx[s]=e[n+0+s],Gx[s]=e[n+3+s]}for(let n=r+1;nr?e>i?0:r>i?1:2:r>i?1:i>e?2:0;return{axis:n,midValue:(t[n]+t[n+3])/2}}function Oyt(t,e,r,i,n){const s=r-e,o=new Float32Array(6*s);for(let a=0;ai;)e=e.parent;return e.centerAtSeaLevel}setVisibility(e){this._visible=e,this.setDirty()}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.setNeedsRender())}setDirty(e=dn.UPDATE){this._patchGroupsDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=dn.UPDATE){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=dn.UPDATE){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._rctx=e.renderContext.rctx,this._techniqueRepository=e.techniqueRepository,this._tileRenderer=new byt(this._rctx,this._tileSize,this._techniqueRepository),this.updateTileBackground(),this._emptyTex=gxe(this._rctx)}uninitializeRenderContext(){this._emptyTex=Le(this._emptyTex),this._tileRenderer=Le(this._tileRenderer)}intersect(e,r,i,n){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==_s.Opaque)return;const s=Myt,o=$yt;ae(s,n,i),ne(o,1/s[0],1/s[1],1/s[2]);const a=e.results.min,l=e.results.max,c=e.results.ground,u=e.options.store===To.MIN,d=!!e.results.ground.target,p=DZe(e.verticalOffset),m=e.tolerance;let y,_=u&&a.dist!=null?a.dist:1/0;const v=x=>{const T=x.renderData;if(!(T!=null&&T.vao))return;const S=T.geometry;x6(jz,S.boundingBox);const A=T.localOrigin;p!=null&&(p.localOrigin=A,p.applyToAabb(jz));const C=jz;if(jx[0]=i[0]-A[0],jx[1]=i[1]-A[1],jx[2]=i[2]-A[2],!JQ(C,jx,o,m,_))return;const R=(G,Q,M)=>{G.set(this.type,x,Q,M,yn),_=u&&a.dist!=null?a.dist:1/0},P=(G,Q)=>{if(Q!=null&&G>=0&&(e.options.backfacesTerrain||fe(Q,s)<0)&&(e.options.invisibleTerrain||!e.options.selectionMode||r==null||r(i,n,G))){if((c.dist==null||Gl.dist)&&R(l,G,Q)}},F=Iyt;ae(F,n,A);const k=S.indices,V=S.vertexAttributes,z=V.getField(E.POSITION,ds),X=new Ue(z.typedBuffer,3,!1,V.stride/4),q=S.indexCount/3;if(!p&&q>bRe){const G=x.renderData;G.intersectionData==null&&(G.intersectionData=new CK(k,0,q,X)),G.intersectionData.intersectRay({r0:jx,r1:F},P)}else BP(jx,F,0,q,k,X,null,p,P)},b=this._rootTiles;b!=null&&(()=>{const x=this._tileIterator;x.reset(b);const T=e.options.invisibleTerrain;for(let S=x.next();S;S=x.next())!(S.visible||T&&S.intersectsClippingArea)||p==null&&!S.intersectsRay(i,s,m,_)||d&&this._useStencilForTile(S)?x.skipSubtree():v(S)})()}processScaleRangeQueries(e,r){var i;if(!r.done)for(this._updatePatchGroups();e.updating&&!r.done;){e.prepare();for(const n of this._patchGroups.values())for(const s of n)((i=s.renderData)==null?void 0:i.textureReference)!=null&&e.queriesForTile(s);e.process(),r.madeProgress()}}prepareTechnique(e){if(e.bindParameters.slot===le.OCCLUDED_TERRAIN){if(!(e.renderOccludedMask&B5))return null}else{const r=this.transparency===_s.Opaque?le.OPAQUE_TERRAIN:le.TRANSPARENT_TERRAIN;if(e.bindParameters.slot!==r)return null}switch(e.output){case D.Color:return this.transparency===_s.Empty?null:(this._techniqueConfiguration.hasScreenSpaceReflections=e.bindParameters.ssr.enabled,this._techniqueConfiguration.hasCloudsReflections=e.bindParameters.cloudsFade.data!=null,this._techniqueConfiguration.receiveShadows=e.bindParameters.shadowMap.ready,this._techniqueConfiguration.receiveAmbientOcclusion=e.bindParameters.ssaoHelper.active,this._techniqueConfiguration.overlayMode=this._overlayRenderer.isEmpty?Rg.Disabled:this._overlayRenderer.hasWater?Rg.EnabledWithWater:Rg.Enabled,this._updateTechnique(D.Color,e.bindParameters.slot===le.OCCLUDED_TERRAIN));case D.Shadow:case D.ShadowExcludeHighlight:return this._castShadows&&e.bindParameters.lighting.globalFactor===1?(this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(D.Shadow,!1)):null;case D.Depth:return this.transparency===_s.Empty?null:(this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(D.Depth,!1));case D.Normal:return this.transparency===_s.Empty?null:(this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(D.Normal,!1));case D.ObjectAndLayerIdColor:return this.transparency===_s.Empty?null:this._updateTechnique(D.ObjectAndLayerIdColor,!1);case D.Highlight:return this.transparency!==_s.Empty&&this.needsHighlight?(this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(D.Highlight,!1)):null}return null}render(e,r){const i=e.bindParameters.lighting.globalFactor===1;switch(this._updatePatchGroups(),r.useStencil=!1,e.output){case D.Color:{const n=e.bindParameters.slot===le.OCCLUDED_TERRAIN?za.Occluded:za.ColorAndWater;this.transparency===_s.Opaque?this._renderMaterialPass(e,r,n):e.offscreenRenderingHelper.renderToTargets(()=>this._renderMaterialPass(e,r,n),e.offscreenRenderingHelper.tmpColor,e.offscreenRenderingHelper.mainDepth,[0,0,0,0]);break}case D.Depth:case D.Normal:this._renderAuxiliaryPass(e,r,za.ColorAndWater);break;case D.Highlight:this.needsHighlight&&this._renderAuxiliaryPass(e,r,za.Highlight);break;case D.Shadow:case D.ShadowExcludeHighlight:this._castShadows&&i&&this._renderAuxiliaryPass(e,r,za.None);break;case D.ObjectAndLayerIdColor:this._renderAuxiliaryPass(e,r,za.ObjectAndLayerIdColor)}}_renderMaterialPass(e,r,i){const{rctx:n}=e;this._passParameters.overlaySource=i,n.bindTechnique(r,this._passParameters,e.bindParameters),this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this._renderPatchGroups(e,r,i)}_renderAuxiliaryPass(e,r,i){const n=e.rctx;this._passParameters.overlaySource=i,n.bindTechnique(r,this._passParameters,e.bindParameters),this._renderPatchGroupsAuxiliary(e,r,i)}updateTileBackground(e=null){if(this._tileRenderer==null)return;const r=this._tileRenderer;let i=null;if(e!=null){const n=it.toUnitRGBA(e);i=Se(n[0]||0,n[1]||0,n[2]||0)}r.setBackground(i),this._allTiles.forAll(n=>r.updateTileTexture(n,ns.FADING)),this._techniqueConfiguration.tileBlendInput=r.backgroundIsGrid?Pf.GridComposite:r.backgroundColor!=null?Pf.ColorComposite:Pf.LayerOnly,this.setNeedsRender()}_updatePatchGroups(){if(this._patchGroupsDirty&&(this._highestVisibleLODTile=null,this._rebuildPatchGroups(),this._patchGroupsDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty&&this.renderOrder!==tE.NONE){const e=Array.from(this._patchGroups.values()),r=this._stencilEnabledLayerExtents;for(const i of e)LOe(this.renderOrder,i,r);e.sort((i,n)=>DOe(i[0],n[0],this.renderOrder)),this._patchGroups=new Map(e.map(i=>[i[0].renderData.localOrigin,i])),this._patchSortingDirty=!1}}_rebuildPatchGroups(){var r;const e=this._rootTiles;if(e!=null){(r=e[0])==null||r.surface.checkAllTilesWaterproofness(),this._patchGroups.clear();for(const i of e)this._rebuildPatchGroupsForRootTile(i)}}_rebuildPatchGroupsForRootTile(e){const r=this._tileIterator;for(r.resetOne(e);!r.done;){const i=r.next(),n=i.renderData;if(!n){this._numTilesCulled++;continue}if(!i.visible){this._numTilesCulled++,r.skipSubtree();continue}const s=n.localOrigin;let o=this._patchGroups.get(s);o||(o=new Array,this._patchGroups.set(s,o)),o.push(i),(!this._highestVisibleLODTile||i.elevationLevel>this._highestVisibleLODTile.elevationLevel)&&(this._highestVisibleLODTile=i),r.skipSubtree()}}_useStencilForTile(e){for(const r of this._stencilEnabledLayerExtents)if(e.intersectsExtent(r))return!0;return!1}_renderPatchGroupsAuxiliary(e,r,i){const n=this._stencilEnabledLayerExtents.length>0;this._patchGroups.forEach(s=>{const o=s[0].renderData.localOrigin;r.program.bindDraw(new eW(o),e.bindParameters,this._passParameters);for(let a=0;a0,a=i===za.Occluded;a&&(s.bindTexture("tex",this._emptyTex),s.setUniform3fv("textureOpacities",Zs),s.setUniform4fv("texOffsetAndScale",Nf));const l=this._tileRenderer!=null&&this._tileRenderer.backgroundColor!=null?this._tileRenderer.backgroundColor:Zs;this._techniqueConfiguration.tileBlendInput===Pf.ColorComposite&&s.setUniform3fv("backgroundColor",l);const c=this.wireframe?Et.LINES:Et.TRIANGLES;this._techniqueConfiguration.textureFadingEnabled&&s.bindTexture("texNext",this._emptyTex);const u=this._patchGroups;for(const d of u.values()){const p=d[0].renderData.localOrigin;r.program.bindDraw(new eW(p),e.bindParameters,this._passParameters),this._numOriginsRendered++;for(const m of d){const y=m.renderData,_=y.textureReference;if(_!=null){if(!a){s.setUniform4fv("texOffsetAndScale",_.offsetAndScale),s.bindTexture("tex",_.texture.texture);const v=y.textureFadeFactor,b=v<1?y.nextTextureReference:null;this._techniqueConfiguration.textureFadingEnabled&&b!=null&&v<1?(s.setUniform1f("fadeFactor",v),s.setUniform4fv("nextTexOffsetAndScale",b.offsetAndScale),s.setUniform3fv("nextTexOpacities",b.opacities),s.bindTexture("texNext",b.texture.texture)):s.setUniform1f("fadeFactor",1),y.textureIsFading&&this.setNeedsRender(),s.setUniform3fv("textureOpacities",_.opacities)}this._renderPatch(e,r,m,c,o,i),m.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}e.rctx.bindVAO(null)}_renderPatch(e,r,i,n,s,o){const a=i.renderData,l=a.vao,c=l.indexBuffer;if(c==null)return void(cs&&console.error("Rendered tile with no indices: ",i.lij," : ",a));const u=r.program;o===za.None||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(u,a.overlay),s&&(r.useStencil=this._useStencilForTile(i),r.bindPipelineState(e.rctx,e.bindParameters.slot));const d=a.geometry.indexCount;e.rctx.bindVAO(l),u.assertCompatibleVertexAttributeLocations(l),e.rctx.drawElements(n,d,c.indexType,0)}_bindOverlayPatchData(e,r){e.setUniform4fv("overlayTexOffset",r.offsets),e.setUniform4fv("overlayTexScale",r.scales)}_updateTechnique(e,r){return this._techniqueConfiguration.output=e,this._techniqueConfiguration.renderOccluded=r,this._shaderTechnique=this._techniqueRepository.releaseAndAcquire(GOe,this._techniqueConfiguration,this._shaderTechnique),this._shaderTechnique}get test(){return{tileRenderer:this._tileRenderer}}};h([f({constructOnly:!0})],Xl.prototype,"_overlayRenderer",void 0),h([f({constructOnly:!0})],Xl.prototype,"_stage",void 0),h([f({readOnly:!0})],Xl.prototype,"_isGlobal",null),h([f({constructOnly:!0})],Xl.prototype,"_allTiles",void 0),h([f({constructOnly:!0})],Xl.prototype,"_ellipsoidRadius",void 0),h([f({value:!1})],Xl.prototype,"renderingDisabled",null),h([f()],Xl.prototype,"renderPatchBorders",null),h([f()],Xl.prototype,"visualizeNormals",null),h([f()],Xl.prototype,"cullBackFaces",null),h([f({value:tE.FRONT_TO_BACK})],Xl.prototype,"renderOrder",null),h([f()],Xl.prototype,"wireframe",null),Xl=h([N("esri.views.3d.terrain.TerrainRenderer")],Xl);const Myt=O(),$yt=O(),jx=O(),Iyt=O();let Lyt=class{constructor(){this.numNodes=0,this.numLeaves=0,this.numVisible=0,this.numRendered=0,this.numSplit=0,this.numMerged=0,this.numRenderedPerLevel=new Array,this.numLoadedPerLevel=new Array}},cf=class extends xe{constructor(e){super(e),this._handles=new Vi}initialize(){this._handles.add(this.layers.on("change",()=>this._update())),this._handles.add(ue(()=>this.extentHelper.layerViewsExtent,()=>this._setAdHocTilingScheme())),this._update(),this.tilingSchemeLocked||this._setAdHocTilingScheme()}destroy(){this._handles=Me(this._handles),this._waitTask=null,this.layers.destroy()}_update(){if(this._waitTask=null,this.tilingSchemeLocked)return;let e;if(this.layers.some(r=>!(!jA(r)||r.isRejected())&&!(r.isFulfilled()&&!Dyt(r,this.viewSpatialReference,this.viewingMode))&&(e=r,!((r==null?void 0:r.type)==="vector-tile"||J5(r)))),e)if(e.isResolved()){const r=K8(e,this.viewSpatialReference,this.viewingMode);if(r!=null){const i=new hc(r.tileInfo);this._lockTilingScheme(i)}}else this._updateWhen(e)}_updateWhen(e){const r=e.when().catch(()=>{}).then(()=>{r!==this._waitTask||this.destroyed||this._update()});this._waitTask=r}_lockTilingScheme(e){if(this.viewingMode===$e.Global){const r=e.levels.length-1;e.spatialReference.isWebMercator?e=hc.makeWebMercatorAuxiliarySphere(r):G_(e.spatialReference)&&(e=hc.makeGCSWithTileSize(e.spatialReference,e.pixelSize,r))}this.tilingSchemeLocked=!0,this.tilingScheme=e,this.extentHelper.tilingScheme=this.tilingScheme,this._updateTiledLayerExtent(),this._handles.removeAll(),this._handles.add(ue(()=>this.extentHelper.tiledLayersExtent,()=>this._updateTiledLayerExtent()))}_updateTiledLayerExtent(){this._set("extent",this.extentHelper.tiledLayersExtent)}_setAdHocTilingScheme(){if(this.viewingMode===$e.Global){const e=this.extentHelper.viewSpatialReference,r=G_(e)||nm(e)||sm(e);e.isWebMercator?this.tilingScheme=hc.WebMercatorAuxiliarySphere:r&&(this.tilingScheme=hc.makeGCSWithTileSize(e,256)),this._set("extent",this.extentHelper.layerViewsExtent)}else{const e=this.extentHelper.layerViewsExtent;e==null||Cb(e,this.extent)||(this.tilingScheme=hc.fromExtent(e,this.extentHelper.viewSpatialReference),this._set("extent",e))}}get test(){return{lockTilingScheme:e=>this._lockTilingScheme(e),done:!this._waitTask}}};function Dyt(t,e,r){return K8(t,e,r)!=null}h([f()],cf.prototype,"tilingScheme",void 0),h([f({readOnly:!0})],cf.prototype,"extent",void 0),h([f({value:!1})],cf.prototype,"tilingSchemeLocked",void 0),h([f({constructOnly:!0})],cf.prototype,"viewSpatialReference",void 0),h([f({constructOnly:!0})],cf.prototype,"layers",void 0),h([f({constructOnly:!0})],cf.prototype,"extentHelper",void 0),h([f({constructOnly:!0})],cf.prototype,"viewingMode",void 0),cf=h([N("esri.views.3d.terrain.TilingSchemeLogic")],cf);let Nyt=class{constructor(){this.offset=Ne(),this.scale=0,this.tile=null}init(e,r,i,n){this.tile=e,this.offset[0]=r,this.offset[1]=i,this.scale=n}dispose(){this.tile=null,this.offset[0]=0,this.offset[1]=0,this.scale=0}},Gt=class extends Bn.EventedMixin(xe){constructor(e){var r,i;super(e),this._scaleRangeQueries=new oN,this._iteratorPool=new ko(IOe,n=>n.remove=()=>this._iteratorPool.release(n)),this._postorderIterator=new dgt,this._hasPendingUpdates=!1,this._pendingUpdates=0,this._asyncWorkItems=0,this._allTilesDirty=!0,this._allTilesSorted=!0,this._visibleCached=!1,this._usedMemory=null,this._performanceInfo=new Lyt,this._viewChanged=!1,this._inFrameTask=!1,this._viewChangeUpdateDirty=!1,this._eyePosRenderSR=O(),this._eyePosSurfaceSR=O(),this._splitLimits=new xd,this._frustum=TR(),this._viewProjectionMatrix=_e(),this._layerViews=[new Array,new Array],this._layerIndexByUid=[new Map,new Map],this._basemapLayerViewHandles=new Map,this._handles=new Vi,this._watchUpdatingTracking=new Df,this._frameTask=LS,this._allTiles=new Nt,this._upsampleInfoPool=new ko(Nyt),this._rootTilesExtent=jt(),this.updatingProgress=.5,this._maxNumUpdating=1,this.maxTextureScale=1.2,this._spatialReference=St.WebMercator,this.visibleElevationBounds=new bT(1/0,-1/0),this.rootTileElevationBounds=new bT(1/0,-1/0),this._updatingRootTiles=!1,this._pendingTilesForElevationUpdateEvent=new Set,this._pendingTilesToUpdate=new Set,this.totalGeometryUpdates=0,this.totalTileUpdates=0,this.oneBatchPerFrameTask=!0,this._layerViewsDirty=!1,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._isWebMercator=!1,this._isWebMercatorOnPlateeCarree=!1,this.overlayManager=new Ia({...e,surface:this}),this._isGlobal=!((i=(r=e.view)==null?void 0:r.state)!=null&&i.isLocal)}initialize(){this._lercDecoder=Fmt(this.view.resourceController),this._tilePool=this.view.state.isLocal?new ko(S0t):new ko(C0t);const e=this.view.resourceController.memoryController;this._upsampleMapCache=e.newCache("terrain-upsample",o=>o.unloadMapData()),this._elevationQueryCache=new Dmt(e.newCache("elevation-query")),this._handles.add([ue(()=>this.overlayManager.hasHighlights,o=>this._renderer.setNeedsHighlight(o)),ue(()=>this.overlayManager.rendersOccluded,o=>this._renderer.setRenderOccludedOverlay(o)),ue(()=>this.overlayManager.renderer.isEmpty,()=>this._evaluateTransparency())],"overlayManager"),this._renderer=new Xl({_overlayRenderer:this.overlayManager.renderer,_ellipsoidRadius:Mr(this.view.spatialReference).radius,_stage:this.view._stage,_allTiles:this._allTiles}),this._handles.add([ue(()=>this.baseOpacity,()=>{this._handleLayerViewChanges(),this._updateTileTextures(this._evaluateTransparency()?ns.UNFADED:ns.IMMEDIATE)},An),ue(()=>this.hasCompositeBlendMode,()=>this._updateTileTextures(this._evaluateTransparency()?ns.UNFADED:ns.IMMEDIATE),An),ue(()=>this.renderingDisabled,()=>{var o,a;return(a=(o=this.view)==null?void 0:o._stage)==null?void 0:a.renderer.setParameters({terrainRenderingEnabled:!this.renderingDisabled})},Br),ue(()=>this.backgroundColor,o=>{this._handleLayerViewChanges(),this._renderer.updateTileBackground(o)},An),ue(()=>this.snapLevel,()=>this._viewChanged=!0,Br),ue(()=>this.view.pointsOfInterest,o=>{this._renderer.pointsOfInterest=o,this._watchUpdatingTracking.removeAll(),o&&this._watchUpdatingTracking.add(()=>o.focus.renderLocation,()=>this._allTilesSorted=!1)}),ue(()=>Kr.TERRAIN_TILE_TREE_SHOW_TILES,o=>{o&&!this._treeDebugger?ce(()=>import("./TerrainTileTree3DDebugger-33a28731.js"),["assets/TerrainTileTree3DDebugger-33a28731.js","assets/TileTreeDebugger-142b9f39.js"]).then(({TerrainTileTree3DDebugger:a})=>{!this._treeDebugger&&Kr.TERRAIN_TILE_TREE_SHOW_TILES&&(this._treeDebugger=new a({view:this.view}))}):o||(this._treeDebugger=Me(this._treeDebugger))},Pr)]);const{spatialReference:r}=this.view;this._extentHelper=Kmt(this.viewingMode,{layers:this.view.map.allLayers,layerViews:this.view.allLayerViews,viewSpatialReference:r});const i=new sR({getCollections:()=>{var o,a,l;return(l=(a=(o=this.view)==null?void 0:o.defaultsFromMap)==null?void 0:a.mapCollections)==null?void 0:l.map(({layers:c})=>c)},getChildrenFunction:o=>o&&"layers"in o?o.layers:null}),n=new cf({layers:i,extentHelper:this._extentHelper,viewingMode:this.viewingMode,viewSpatialReference:r});this._set("tilingSchemeLogic",n),this._updateTilingScheme(),this._elevationDataRequester=this.view.resourceController.createStreamDataRequester(Cf.ELEVATION),this._mapDataRequester=this.view.resourceController.createStreamDataRequester(Cf.BASEMAP);const s=this.view.resourceController.scheduler;this._frameTask=s.registerTask(dt.TERRAIN_SURFACE,this),this._handles.add([ue(()=>this._extentHelper.stencilEnabledExtents,o=>this._renderer.setStencilEnabledLayerExtents(o),Pr),ue(()=>this.tilingSchemeLogic.tilingScheme,()=>this._updateTilingScheme(),Br),ue(()=>this.extent,()=>this._updateRootTiles(),Pr),this.view.on("resize",()=>this._viewChangeUpdate()),ue(()=>{var l,c;const o=this.view,a=o.state;return[this._lodBias,this.lodSnapping,(c=(l=o.resourceController)==null?void 0:l.memoryController)==null?void 0:c.memoryFactor,a.camera,a.contentCamera,a.fixedContentCamera]},()=>this._viewChangeUpdate(),An),ue(()=>{var o,a;return(a=(o=this.view.qualitySettings)==null?void 0:o.tiledSurface)==null?void 0:a.textureFadeDuration},o=>this._renderer.textureFadingEnabled=o>0,Pr),ue(()=>{var o;return(o=this.view.qualitySettings)==null?void 0:o.physicallyBasedRenderingEnabled},o=>this._renderer.pbrMode=o?et.Terrain:et.Disabled,Pr),ue(()=>this._userClippingExtent,()=>this._updateClippingExtent(),Br)]),this._handles.add(this.view.allLayerViews.on("after-changes",()=>this._layerViewsDirty=!0)),this._layerViewsDirty=!0,this._handleLayerViewChanges()}destroy(){this._frameTask.remove(),this._handles.destroy(),this._watchUpdatingTracking.destroy(),this._lercDecoder=Fi(this._lercDecoder),this._removeAllTiles(),this._upsampleMapCache=Me(this._upsampleMapCache),this._elevationQueryCache=Me(this._elevationQueryCache),this._set("tilingSchemeLogic",Me(this.tilingSchemeLogic)),this._basemapLayerViewHandles.forEach((e,r)=>this._unregisterTiledLayerView(r)),this._elevationDataRequester=null,this._mapDataRequester=null,this._set("overlayManager",Me(this.overlayManager)),this._tilePool=Me(this._tilePool),mK.prune(),this._treeDebugger=Me(this._treeDebugger),this._renderer=Me(this._renderer),this._iteratorPool=Me(this._iteratorPool),this._set("view",null),this._extentHelper=Me(this._extentHelper),this._upsampleInfoPool=Me(this._upsampleInfoPool),Xmt(),Bgt()}get renderer(){return this._renderer}get frustum(){return this._frustum}get snapLevel(){var e,r;if(this.lodSnapping===cO.ON){const i=this.view,n=this.tilingScheme,s=(r=(e=i.pointsOfInterest)==null?void 0:e.cameraOnSurface)==null?void 0:r.scale;if(n&&s){const o=i.state.contentCamera;let a=_8(i,o.eye,o.viewForward,o.up).tilt;a>90&&(a=180-a);const l=2*(a/90)**2,c=n.levelAtScale(s)-l,u=Math.min(c,this._splitLimits.maxLod||1/0);return u<=0?null:u}}return null}get lodSnapping(){return this.view.qualitySettings.tiledSurface.reduceTileLevelDifferences?cO.ON:cO.OFF}get upsampleInfoPool(){return this._upsampleInfoPool}get upsampleMapCache(){return this._upsampleMapCache}get elevationQueryCache(){return this._elevationQueryCache}get mapTileRequester(){return this._mapDataRequester}get _userClippingExtent(){const{spatialReference:e}=this,{clippingArea:r}=this.view;if(r==null||e==null)return null;const i=jt(),n=uOe(r,i,e)?i:null,s=this._get("extent");return Cb(n,s)?s:n}get rootTilesExtent(){return this._rootTilesExtent}get extent(){const e=i7(this.groundExtent,this._userClippingExtent,jt()),r=this._get("extent");return Cb(e,r)?r:e}get groundExtent(){return this._tilingSchemeExtent!=null?this._tilingSchemeExtent:this._rootTilesExtent}get _tilingSchemeExtent(){var e;return(e=this.tilingSchemeLogic)==null?void 0:e.extent}get updating(){var e,r;return this._hasPendingUpdates||(this._maxNumUpdating=1),!!((this.running||(e=this._watchUpdatingTracking)!=null&&e.updating||this._asyncWorkItems>0)&&this.ready&&!this.suspended||(r=this.overlayManager)!=null&&r.updating)}get running(){return(this._hasPendingUpdates||this._viewChanged||this._allTilesDirty||!this._allTilesSorted||this._layerViewsDirty||this._scaleRangeQueries.updating||this._frameTask.updating)&&this.ready&&!this.suspended}get updatingProgressValue(){return this._maxNumUpdating=Math.max(this._pendingUpdates,this._maxNumUpdating),1-this._pendingUpdates/this._maxNumUpdating}get baseOpacity(){var e,r,i;return((i=(r=(e=this.view)==null?void 0:e.map)==null?void 0:r.ground)==null?void 0:i.opacity)??1}set baseOpacity(e){this.view.map.ground.opacity=e}get viewingMode(){return this.view.state.viewingMode}get ready(){return this._rootTiles!=null}set renderOrder(e){this._renderer.renderOrder=e,this._set("renderOrder",e)}get rootTiles(){return this._rootTiles}get spatialReference(){var e;return((e=this.tilingScheme)==null?void 0:e.spatialReference)??null}get backgroundColor(){return this.view.map.ground.surfaceColor}set backgroundColor(e){this.view.map.ground.surfaceColor=e}set slicePlaneEnabled(e){this._renderer.slicePlaneEnabled=e,this._set("slicePlaneEnabled",e),this._evaluateTransparency()}get tilingSchemeLocked(){var e;return((e=this.tilingSchemeLogic)==null?void 0:e.tilingSchemeLocked)??!1}get wireframe(){var e;return(e=this._renderer)==null?void 0:e.wireframe}set wireframe(e){e!==this._renderer.wireframe&&(this._renderer.wireframe=e,this._updateAllTileGeometries())}set _visible(e){e!==this._visibleCached&&(this._visibleCached=e,this._renderer.setVisibility(e),this.suspended=!e)}get opaque(){return this._renderer.transparency===_s.Opaque}set suspended(e){this._set("suspended",e),this._viewChangeUpdate()}get textureFadeDuration(){return this.view.qualitySettings.tiledSurface.textureFadeDuration??0}intersect(e,r,i,n){this._renderer.intersect(e,r,i,n)}getElevation(e,r,i,n){const s=this._rootTiles;if(s==null||!s.length||s[0].layerInfo[Zt.ELEVATION].length===0)return null;const o=ul;return o[0]=e,o[1]=r,o[2]=i,Cs(o,n,o,this._spatialReference)?che(s,o[0],o[1]):(J.getLogger(this).error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),null)}getElevations(e,r,i){const n=this._rootTiles,s=n?n[0].layerInfo[Zt.ELEVATION].length:0;if(n!=null&&n.length&&s!==0)for(let o=0;os[2]&&(o+=1),ul[1]{if(l&&ure(l.extent,ul))if(l.isLeaf||l.rendered)i=Math.min(i,l.elevationBounds[0]),n=Math.max(n,l.elevationBounds[1]);else for(const c of l.children)s(c)},o=this._rootTiles;if(o!=null)for(const l of o)s(l);return{min:i,max:n}}getSphereScale(e,r){if(!this.tilingScheme)return null;if(!Bi(e,ul,this.spatialReference))return J.getLogger(this).error("TerrainSurface.getSphereScale(): could not project given point to tiling scheme coordinate system"),null;ul[3]=r;let i=null;const n=o=>{if(o&&ure(o.extent,ul)){const a=o.children;if(a[0]&&!o.rendered)for(const l of a)n(l);else{const l=this._getLodBiasCorrectedScale(o.level);i=i==null?l:Math.min(i,l)}}},s=this._rootTiles;if(s!=null)for(const o of s)n(o);return i}queryVisibleScaleRange(e,r,i,n){const s=r?this.tilingScheme.levelAtScale(r):0,o=i?this.tilingScheme.levelAtScale(i):1/0,a=this._lodBias;this._scaleRangeQueries.queryVisibleLevelRange(e,s+a,o+a,n)}_evaluateTransparency(){var o,a;const e=this.baseOpacity,r=this.overlayManager.renderer.isEmpty,i=this._renderer.transparency,n=this._allSurfaceLayersTransparent()?r?_s.Empty:_s.TransparentWithDraped:e>=1&&!this.hasCompositeBlendMode&&!this._renderer.slicePlaneEnabled?_s.Opaque:_s.Semitransparent,s=i!==n;return s&&(this._renderer.transparency=n,(a=(o=this.view)==null?void 0:o._stage)==null||a.renderer.setParameters({terrainTransparency:this._renderer.transparency})),s}_updateTilingScheme(){var i,n,s;const e=this.tilingSchemeLogic.tilingScheme;if(e===this.tilingScheme)return;_f(!!e,"tiling scheme cannot be reset to undefined"),this._isGlobal=!((n=(i=this.view)==null?void 0:i.state)!=null&&n.isLocal),this.tilingScheme&&this._removeAllTiles();const r=(e==null?void 0:e.spatialReference)??St.WebMercator;this._spatialReference=r,this._isWebMercator=!!(r!=null&&r.isWebMercator),this._isWebMercatorOnPlateeCarree=this._isWebMercator&&HX((s=this.view)==null?void 0:s.renderSpatialReference),this._set("tilingScheme",e),this._updateClippingExtent(),e&&(this._updateTiledLayers(),this._renderer.setTileSize(e.pixelSize),this.overlayManager.setSpatialReference(e.spatialReference),this._updateRootTiles())}_acquireTile(e,r,i,n){const s=this._tilePool.acquire();return JI[0]=e,JI[1]=r,JI[2]=i,s.init(JI,n,this),s}get updatingRootTiles(){return this._updatingRootTiles}_updateRootTiles(){const{extent:e,tilingScheme:r}=this;if(!r)return;const i=kyt;let n=r.rootTilesInExtent(e,i,5*aT);if(this._rootTiles!=null){if(n.length>aT)return void J.getLogger(this).warn(YGe);const s=this._rootTiles.map(a=>a.lij),o=aDe(s,n,lhe);if(this._updatingRootTiles=!0,o.removed.length>0||o.added.length>0){const a=this._rootTiles.filter(l=>!(o.removed.findIndex(c=>lhe(c,l.lij))>-1)||(this._purgeTile(l),!1));o.added.forEach(l=>a.push(this._newRootTile(l))),this._setRootTiles(a)}}else this._updatingRootTiles=!0,n.length>aT&&(J.getLogger(this).warn(ZGe),n=r.rootTilesInExtent(e,i,aT)),this._setRootTiles(n.map(s=>this._newRootTile(s)));Cb(i,this._rootTilesExtent)||(this._rootTilesExtent=jt(i)),this._visible=!0,this._viewChangeUpdate(),this.overlayManager.setPlacementDirty(),this.notifyChange("ready"),this._updateAllTileGeometries(),this._updatingRootTiles=!1,this.checkAllTilesWaterproofness()}_updateAllTileGeometries(){const e=this._allTiles.filter(r=>r.isLoaded&&r.intersectsClippingArea);e.forEach(r=>this._renderer.updateTileGeometryState(r)),e.forEach(r=>r.renderData.updateNeighborData()),this._updateTilesGeometries(e),this._pendingTilesToUpdate.clear()}_updateTilesGeometries(e){if(e.length===0)return;e.sort(Og);const r=this.renderer;e.forEach(i=>r.updateGeometryIfNeeded(i)),e.forEach(i=>this._pendingTilesForElevationUpdateEvent.add(i))}_shouldSplit(e){return e.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.snapLevel)===gt.SPLIT}_newRootTile(e){const r=this._acquireTile(0,e[1],e[2],null);return this._shouldSplit(r)&&r.setPendingUpdate(gt.SPLIT),this._loadTile(r),this._markTileToUpdate(r),this._updateRootTileElevationBounds(),r}_setRootTiles(e){if(this._rootTiles=e,this._allTiles.clear(),e!=null){const r=this._iteratorPool.acquire();for(r.reset(e);!r.done;)this._allTiles.push(r.next());r.remove()}this._renderer.setRootTiles(this._rootTiles),this._updateTilesVisibility(e)}_runViewChangeUpdateIfDirty(){this._viewChangeUpdateDirty&&(this._viewChangeUpdateDirty=!1,this._viewChangeUpdate())}_viewChangeUpdate(){this.view&&!this.suspended&&this.tilingScheme&&this._visibleCached&&(this._inFrameTask?this._viewChangeUpdateDirty=!0:(this._viewChangeUpdateDirty=!1,this._updateViewDependentParameters(),this._updateTilesVisibility(this._rootTiles)))}_updateClippingStatus(e){e.updateClippingStatus(this.extent)&&e.resetPendingUpdate(gt.GEOMETRY)&&this._updateTileGeometryState(e)}_updateTilesVisibility(e){if(e==null)return;const r=vgt(e),i=this.visibleElevationBounds;let n=r?i.min:1/0,s=r?i.max:-1/0;const o=this.extent,a=this._viewProjectionMatrix;this.setTileTreeDirty();const l=this._iteratorPool.acquire();for(l.reset(e);!l.done;){const c=l.next();c.updateClippingStatus(o)&&c.resetPendingUpdate(gt.GEOMETRY)&&this._updateTileGeometryState(c),c.setPendingUpdate(gt.RENDERDATA),c.computeVisibility(),c.updateScreenDepth(a),c.renderData&&(n=Math.min(c.elevationBounds[0],n),s=Math.max(c.elevationBounds[1],s))}l.remove(),this._viewChanged=!0,this._allTilesDirty=!0,this._batchUpdatePendingTileGeometries(),isFinite(n)&&isFinite(s)&&(i.min!==n||i.max!==s)&&(this.visibleElevationBounds=new bT(n,s))}_updateRootTileElevationBounds(){let e=1/0,r=-1/0;const i=this._rootTiles;i!=null&&i.forEach(({elevationBounds:s})=>{e=Math.min(e,s[0]),r=Math.max(r,s[1])});const n=this.rootTileElevationBounds;n.min===e&&n.max===r||(this.rootTileElevationBounds=new bT(e,r))}_updateViewDependentParameters(){const{camera:e,contentCamera:r}=this.view.state,i=Math.tan(.5*r.fovX),n=Math.tan(.5*r.fovY),s=this.tilingScheme.pixelSize,o=2**-this._lodBias*e.pixelRatio;this._splitLimits.aboveGround=e.aboveGround,this._splitLimits.fovX=i,this._splitLimits.fovY=n,this._splitLimits.relativeWidthLimit=s/e.width*this.maxTextureScale*o,this._splitLimits.relativeHeightLimit=s/e.height*this.maxTextureScale*o,this._splitLimits.maxLod=this.tilingScheme.getMaxLod(),this._splitLimits.angledSplitBias=this.view.qualitySettings.tiledSurface.angledSplitBias,this.view.state.fixedContentCamera?(this._splitLimits.frustum==null&&(this._splitLimits.frustum=TR()),s5(this._splitLimits.frustum,r.frustum)):this._splitLimits.frustum=null,s5(this._frustum,e.frustum),Vr(this._viewProjectionMatrix,r.projectionMatrix,r.viewMatrix),re(this._eyePosRenderSR,r.eye),Cs(e.eye,this.view.renderSpatialReference,this._eyePosSurfaceSR,this.spatialReference)}_updateRenderData(e){e.rendered&&!e.shouldLoad&&(xRe(e)?this._loadChildren(e):Uyt(e)&&this._loadParent(e))}_updateTileGeometryState(e){e.updateVisibility(),this._renderer.updateTileGeometryState(e)&&this._markTileToUpdate(e),this._usedMemory=null}_markAllTileNeighborsForGeometryUpdate(e){const r=this._pendingTilesToUpdate;e.forEachLoadedNeighbor(i=>{r.add(i)})}_updateTileTexture(e,r){const i=e.resetPendingUpdate(gt.TEXTURE_FADING)?gt.TEXTURE_FADING:!!e.resetPendingUpdate(gt.TEXTURE_NOFADING)&>.TEXTURE_NOFADING;i&&(this._renderer.updateTileTexture(e,i),this._usedMemory=null,r.madeProgress())}_emitElevationUpdateEventForTiles(){const e=Wz.extent;Ih(e),this._pendingTilesForElevationUpdateEvent.forEach(r=>S_(e,r.extent,e)),this._pendingTilesForElevationUpdateEvent.clear(),Wz.spatialReference=this.spatialReference,this.emit("elevation-change",Wz)}runTask(e){this._handleLayerViewChanges(e),this._frameTask.processQueue(e),this.renderer.processScaleRangeQueries(this._scaleRangeQueries,e),this._inFrameTask=!0,this._pendingUpdates=0,this._hasPendingUpdates=!1,this._updateAllTilesStatus(e),this._sortTiles(e);const r=!this.view.state.fixedContentCamera;this._mergeAndSplit(e,r),this._updateElevation(e),this._updateTextures(e),r||this._mergeAndSplit(e,!0),this._inFrameTask=!1,this._runViewChangeUpdateIfDirty(),this._batchUpdatePendingTileGeometries(),this._emitElevationUpdateEventForTiles(),e.done&&e.hasProgressed&&this.requestUpdate(),this.notifyChange("updatingProgressValue")}_updateAllTilesStatus(e){if(!this._viewChanged||!this._rootTiles||e.done)return;this._viewChanged=!1;const r=this._iteratorPool.acquire();r.reset(this._rootTiles);const i=this.snapLevel,n=this._splitLimits,s=this._eyePosRenderSR;for(;!r.done;){const o=r.next(),a=o.shouldSplit(n,s,i);if(a!==gt.SPLIT){if(o.resetPendingUpdate(gt.SPLIT)&&o.updateAgentSuspension(),a===gt.ELEVATION&&o.updateAgents(Zt.ELEVATION),r.skipSubtree(),!o.isLeaf){o.setPendingUpdate(gt.MERGE),o.resetPendingUpdate(gt.SPLIT);const l=this._iteratorPool.acquire();l.resetOne(o);const c=this._viewProjectionMatrix;for(let u=l.next();!l.done;u=l.next())this._updateClippingStatus(u),u.updateVisibility(),u.updateScreenDepth(c);l.remove()}}else o.resetPendingUpdate(gt.MERGE),o.isLeaf&&(o.setPendingUpdate(gt.SPLIT),r.skipSubtree()),o.rendered&&o.setPendingUpdate(gt.RENDERDATA)}r.remove(),this.requestUpdate(),(this.shortBatches||!this.oneBatchPerFrameTask)&&this._batchUpdatePendingTileGeometries(),e.madeProgress()}_sortTiles(e){e.done||this._allTilesSorted||(ygt(this._allTiles,this.view.pointsOfInterest.focus.renderLocation),this._allTilesSorted=!0,this._treeDebugger&&this._treeDebugger.update(),e.madeProgress())}_markTileToUpdate(e){be(e.isLoaded),e.intersectsClippingArea&&(this._pendingTilesToUpdate.add(e),this._markAllTileNeighborsForGeometryUpdate(e))}_batchUpdatePendingTileGeometries(){const e=this._pendingTilesToUpdate;if(e.size===0)return;const r=Array.from(this._pendingTilesToUpdate.keys()).filter(s=>s.isLoaded&&s.intersectsClippingArea),i=(s,o)=>{!(o!=null&&o.isLoaded)||!o.intersectsClippingArea||o.level{var m;const p=jR[d];i(o,(m=c[d])==null?void 0:m.findCorner(eF(p),y=>y.isLoaded))};for(let d=0;d<4;++d)if(l&1<=o.level&&p.forAllSubtreeOnSide(tF(Rf[d]),m=>!(!m.isLoaded||!m.intersectsClippingArea)&&(be(e.has(m)||Og(o,m)<0),i(o,m),!0)),u((d+1)%4),u(d)}}e.clear(),this._updateTilesGeometries(r),cs&&Q5&&this.checkAllTilesWaterproofness()}_mergeAndSplit(e,r){if(this.suspended||e.done||!this._allTilesDirty)return;this._allTilesDirty=!1,this.requestUpdate();let i=!1;const n=this.view.state.fixedContentCamera;let s=!1;for(;!e.done;){s=!0;let o=!1;const a=!this._allTiles.some(l=>{var u;if(!i&&!n&&!l.visible)return e.done;let c=l;if(l.resetPendingUpdate(gt.MERGE)){if(!r)return l.setPendingUpdate(gt.MERGE),e.done;for(;(u=c.parent)!=null&&u.resetPendingUpdate(gt.MERGE);)c=c.parent;this._mergeTile(c),o=!0,e.madeProgress()}else l.resetPendingUpdate(gt.SPLIT)&&(this._splitTile(l),o=!0,e.madeProgress());return!e.done&&c===l&&l.resetPendingUpdate(gt.RENDERDATA)&&(this._updateRenderData(l),e.madeProgress()),e.done});if(o&&(this._allTilesSorted=!1,this._allTilesDirty=!0),a){if(!i){i=!0;continue}if(!o)break}else this._allTilesDirty=!0}s?e.madeProgress():this._allTilesDirty=!0,!this.oneBatchPerFrameTask&&this._batchUpdatePendingTileGeometries(),this._sortTiles(e)}_updateElevation(e){e.done||(this._allTiles.some(r=>(r.resetPendingUpdate(gt.GEOMETRY)&&(this._updateTileGeometryState(r),this._updateTileTexture(r,e),this.shortBatches&&this._batchUpdatePendingTileGeometries(),e.madeProgress()),e.done)),!this.oneBatchPerFrameTask&&this._batchUpdatePendingTileGeometries())}_updateTextures(e){e.done||this._allTiles.some(r=>(this._updateTileTexture(r,e),e.done))}_updateClippingExtent(){this.spatialReference&&(this.updateTileOverlayParams(dn.UPDATE),this.overlayManager.setPlacementDirty(),this._updateRootTiles())}get _lodBias(){const e=this.view.resourceController.memoryController.memoryFactor;return this.view.qualitySettings.tiledSurface.lodBias-(1-e)*qGe}_getLodBiasCorrectedScale(e){const r=this.tilingScheme.levels,i=ge(e-this._lodBias,0,r.length-1),n=i-Math.floor(i);return r[Math.floor(i)].scale*(1-n)+r[Math.ceil(i)].scale*n}_removeAllTiles(){this._rootTiles!=null&&(this._rootTiles.forEach(e=>this._purgeTile(e)),this._setRootTiles(null),this.notifyChange("ready")),this._allTiles.clear(),this._visible=!1}_purgeDescendantTiles(e){if(!e.children[0])return!1;let r=!1;for(let i=0;i<4;++i)r=this._purgeTile(e.children[i])||r;return e.unsetChildren(),r}_purgeTile(e){const r=this._purgeDescendantTiles(e)||e.rendered;return this._allTiles.removeUnordered(e),this._unloadTile(e),this._tilePool.release(e),r}_unloadTile(e){this._pendingTilesToUpdate.delete(e),this._pendingTilesForElevationUpdateEvent.delete(e),e.unload(this._renderer)}_splitTile(e){_f(e.isLeaf,"tile that is already split should not be split again!");const r=e.level+1,i=2*e.lij[1],n=2*e.lij[2];e.setChildren(this._createTile(r,i,n,e),this._createTile(r,i,n+1,e),this._createTile(r,i+1,n,e),this._createTile(r,i+1,n+1,e)),e.setPendingUpdate(gt.RENDERDATA),e.updateAgentSuspension(),this._allTiles.pushArray(e.children),this._allTilesDirty=!0,++this._performanceInfo.numSplit}_emitTileScaleChange(e,r=e.level){KI.spatialReference=this.spatialReference,KI.extent=e.extent,KI.scale=this._getLodBiasCorrectedScale(r),this.emit("scale-change",KI)}_createTile(e,r,i,n){_f(!!n,"_createTile sanity check");const s=this._acquireTile(e,r,i,n);return s.updateClippingStatus(this.extent),s.updateScreenDepth(this._viewProjectionMatrix),this._shouldSplit(s)&&s.setPendingUpdate(gt.SPLIT),s}get shortBatches(){return this.view.state.mode!==Cr.IDLE}_mergeTile(e){_f(!e.hasPendingUpdate(gt.SPLIT),"_mergeTile sanity check"),this._purgeDescendantTiles(e)&&(_f(!e.renderData,"_mergeTile sanity check"),this._loadTile(e),this._markTileToUpdate(e),this._emitTileScaleChange(e),this.shortBatches&&this._batchUpdatePendingTileGeometries()),this._allTilesDirty=!0,++this._performanceInfo.numMerged}_loadChildren(e){_f(e.rendered,"parent should be rendered"),this._unloadTile(e);const r=e.children;r.forEach(i=>this._loadTile(i)),r.forEach(i=>this._pendingTilesToUpdate.add(i)),this._markAllTileNeighborsForGeometryUpdate(e),this._emitTileScaleChange(e,e.level+1),this.shortBatches&&this._batchUpdatePendingTileGeometries()}_loadParent(e){const r=e.parent;this._unloadChildren(r),this._loadTile(r),this._markTileToUpdate(r),this._emitTileScaleChange(r,r.level),this.shortBatches&&this._batchUpdatePendingTileGeometries()}_unloadChildren(e){const r=e.children;if(r[0])for(let i=0;i<4;++i){const n=r[i];this._unloadChildren(n),this._unloadTile(n)}}_loadTile(e){e.load(),e.setPendingUpdate(gt.RENDERDATA),this.requestUpdate(),this._allTilesDirty=!0,this.overlayManager&&this.overlayManager.hasOverlays&&this.overlayManager.setTileParameters(e)}_elevationDataArrived(e,r,i){const n=new Qmt(e.lij,e.extent,i);e.dataArrived(r,Zt.ELEVATION,n);const s=[e],o=e.level,a=this._iteratorPool.acquire();for(a.reset(s);!a.done;){const l=a.next();l.findElevationBoundsForLayer(r,o),l.computeElevationBounds()}o===0&&this._updateRootTileElevationBounds(),a.remove(),this._updateTilesVisibility(s)}_handleLayerViewChanges(e=Wa){if(!this._layerViewsDirty)return;this._layerViewsDirty=!1;let r=!1;const i=new Set;let n=-1;for(const s of this.view.allLayerViews.items)if(i.add(s.uid),GR(s)||BC(s))if(this._basemapLayerViewHandles.has(s.uid)&&!BC(s)){const o=this._layerClassFromLayerView(s),a=this._getLayerIdxByUID(o,s.uid);a!=null&&((a{i.has(o)||(this._unregisterTiledLayerView(o),r=!0)}),r&&this._updateTiledLayers(),this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._evaluateTransparency(),e.madeProgress()}_allSurfaceLayersTransparent(){var r,i;let e=((i=(r=this.view.map)==null?void 0:r.ground)==null?void 0:i.opacity)===0;for(const n of this.view.allLayerViews.items)if(_W(n)&&!Z0e(n.layer)&&n.fullOpacity!==0)return e=!1,e;return e}_hasCompositeBlendMode(){for(const e of this.view.allLayerViews.items)if((K5(e)||BC(e))&&Egt(TW[e.layer.blendMode]))return!0;return!1}_layerClassFromLayerView(e){return yW(e)?Zt.ELEVATION:Zt.MAP}_registerTiledLayerView(e){const r=[];if((K5(e)||BC(e))&&r.push(ue(()=>e.layer.blendMode,()=>{this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._updateTileTextures(ns.UNFADED)})),!BC(e)){const i=this._layerClassFromLayerView(e);r.push(ue(()=>e.suspended,()=>this._updateTiledLayers())),r.push(ue(()=>e.fullOpacity,()=>this._updateTileTextures(ns.UNFADED))),r.push(ue(()=>"effectiveScaleRange"in e.layer?e.layer.effectiveScaleRange:null,()=>this._restartAllAgents(i))),r.push(e.on("data-changed",()=>{const n=this._getLayerIdxByUID(i,e.uid);n!=null&&this._invalidateLayerData(n,i)}))}this._unregisterTiledLayerView(e.uid),this._basemapLayerViewHandles.set(e.uid,r)}_unregisterTiledLayerView(e){const r=this._basemapLayerViewHandles.get(e);if(r){for(const i of r)i.remove();this._basemapLayerViewHandles.delete(e)}}_updateTiledLayers(){if(!this.tilingScheme||this.view.suspended)return;const e=this.view.allLayerViews,r=[[],[]];let i=null;e.forEach(n=>{if(!n.layer||n.suspended||!GR(n)||!n.fullExtent)return;const s=this._layerClassFromLayerView(n);if(s===Zt.MAP){const o=n.displayLevelRange.maxLevel;o!==1/0&&(i===null||o>i)&&(i=o)}r[s].push(n)});for(const n of Uv){const s=this._layerViews[n],o=r[n];o.reverse();const a=o.length;let l=s.length!==a;const c=new Array(a),u=new Array(s.length);this._layerIndexByUid[n].clear();for(let d=0;d-1&&(u[m]=d)}if(l){const d=this._postorderIterator;for(d.reset(this._rootTiles);!d.done;)d.next().modifyLayers(u,c,n);this._layerViews[n]=o,this._restartAllAgents(n),this._updateTilesVisibility(this._rootTiles)}}this.tilingScheme.ensureMaxLod(i)&&this._viewChangeUpdate()}_restartAllAgents(e){const r=this._postorderIterator;for(r.reset(this._rootTiles);!r.done;){const i=r.next();i.restartAgents(e),e===Zt.ELEVATION&&i.computeElevationBounds()}this._updateRootTileElevationBounds()}layerViewByIndex(e,r){return this._layerViews[r][e]}numLayers(e){return this._layerViews[e].length}_updateTileTextures(e){this._allTiles.forAll(r=>{r.updateAgents(Zt.MAP),e===ns.IMMEDIATE?this.renderer.updateTileTexture(r,gt.TEXTURE_NOFADING):r.updateRenderData(Zt.MAP,e)}),this._evaluateTransparency()}_invalidateLayerData(e,r){this._allTiles.forAll(i=>i.removeLayerAgent(e,r)),this._allTiles.forAll(i=>i.invalidateLayerData(e,r))}setTileTreeDirty(){this._allTilesDirty=!0}requestRender(e=dn.UPDATE){this.renderer.setNeedsRender(e)}requestUpdate(){++this._pendingUpdates==1&&(this._hasPendingUpdates=!0)}requestTileData(e,r,i,n){const s=this.layerViewByIndex(r,i),o=s.layer;return!o.tilemapCache||VR(s)?this._requestTileData(e,i,s,n):(++this._asyncWorkItems,o.tilemapCache.fetchAvailability(e.lij[0],e.lij[1],e.lij[2],{...n,timeout:6e3}).then(()=>--this._asyncWorkItems).catch(a=>{throw--this._asyncWorkItems,Bt(n),Zn(a)||this._dataMissing(e,i,s,{notInTilemap:!0}),a}).then(()=>this._frameTask.schedule(()=>this._requestTileData(e,i,s,n),n.signal)))}_requestTileData(e,r,i,n){return r===Zt.ELEVATION?yW(i)?this._requestElevationTileData(e,i,n):Promise.reject():_W(i)?this._requestMapTileData(e,i,n):Promise.reject()}_requestElevationTileData(e,r,i){++this._asyncWorkItems;const n=a=>{if(ss(i))return;const l=this._layerIndexByUid[Zt.ELEVATION].get(r.uid);l!=null?(this._usedMemory=null,this.requestUpdate(),this._elevationDataArrived(e,l,a)):J.getLogger(this).warn("TerrainSurface: received data from unknown layer %d %s",Zt.ELEVATION,e.lij.toString())},s=a=>{Zn(a)||(this._dataMissing(e,Zt.ELEVATION,r,a),this.requestUpdate())};if(Tce(r.layer))return r.layer.fetchTile(e.lij[0],e.lij[1],e.lij[2],{noDataValue:yR,signal:i.signal}).then(a=>{if(!ss(i))return this._frameTask.schedule(()=>n(a),i.signal,s);J.getLogger(this).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true.")},s).finally(()=>{--this._asyncWorkItems});const o=r.getTileUrl(e.lij[0],e.lij[1],e.lij[2]);return this._elevationDataRequester.request(o,"binary",i).then(a=>this._lercDecoder.decode(a,{noDataValue:yR},i.signal)).then(a=>{a?n(new Nmt(a)):s(new Error("LERC decoding failed"))},s).finally(()=>{--this._asyncWorkItems})}_requestMapTileData(e,r,i){++this._asyncWorkItems;const n=(u,d)=>{--this._asyncWorkItems,YT(d),ss(i)||(this._dataMissing(e,Zt.MAP,r,u),this.requestUpdate())},s=u=>d=>n(d,u),o=u=>this._frameTask.schedule(()=>{--this._asyncWorkItems,this.requestUpdate(),ss(i)?YT(u):this._mapTileDataArrived(e,r,u)},i.signal,s(u)).catch(s(u)),a=(u,d=null)=>this._frameTask.schedule(()=>n(u,d));if(VR(r)){const u=r.schemaHelper.getLevelRowColumn(e.lij);return r.fetchTile(u[0],u[1],u[2],i).then(o,a)}if(J8(r))return r.fetchTile(e.lij[0],e.lij[1],e.lij[2],i).then(o,a);if(uK(r)&&Tce(r.layer))return r.layer.fetchTile(e.lij[0],e.lij[1],e.lij[2],i).then(u=>{if(ss(i))return J.getLogger(this).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true."),void a(wr());o(u)},a);let l=r.getTileUrl(e.lij[0],e.lij[1],e.lij[2]);Lmt(r.layer)&&r.layer.refreshTimestamp&&(l+=`${l.includes("?")?"&":"?"}_ts=${r.layer.refreshTimestamp}`);const c=r.hasMixedImageFormats?"image+type":"image";return this._mapDataRequester.request(l,c,i).then(o,a)}_mapTileDataArrived(e,r,i){const n=this._getLayerIdxByUID(Zt.MAP,r.uid);n!=null?e.dataArrived(n,Zt.MAP,i):(YT(i),J.getLogger(this).warn("TerrainSurface: received data from unknown layer"))}_getLayerIdxByUID(e,r){return this._layerIndexByUid[e].get(r)}_dataMissing(e,r,i,n){const s=this._getLayerIdxByUID(r,i.uid);s!=null?e.dataMissing(s,r,n):J.getLogger(this).warn("TerrainSurface: received data from unknown layer")}updateTileOverlayParams(e){this._rootTiles&&this.overlayManager&&(this._allTiles.forAll(r=>{r.renderData&&this.overlayManager.setTileParameters(r)}),this._renderer.setNeedsRender(e))}get performanceInfo(){const e=this._performanceInfo;return e.numNodes=this._allTiles.length,e.numLeaves=e.numVisible=e.numRendered=e.numLoadedPerLevel.length=e.numRenderedPerLevel.length=0,this._allTiles.forAll(r=>{r.isLeaf&&e.numLeaves++;const i=r.level;r.renderData&&(e.numLoadedPerLevel[i]=(e.numLoadedPerLevel[i]||0)+1),r.visible&&(e.numVisible++,r.rendered&&(e.numRenderedPerLevel[i]=(e.numRenderedPerLevel[i]||0)+1,e.numRendered++))}),e}get usedMemory(){return this.tilingScheme?(this._usedMemory==null&&(this._usedMemory=this._recalculateUsedMemory()),this._usedMemory!=null?this._usedMemory:0):0}_recalculateUsedMemory(){return this.tilingScheme?this._allTiles.reduce((e,r)=>e+r.usedMemory,0):null}getUsedMemoryForLayerView(e){let r=this.overlayManager.gpuMemoryUsage;const i=this._layerClassFromLayerView(e),n=this._getLayerIdxByUID(i,e.uid);return n!=null&&this._allTiles.forAll(s=>r+=s.getUsedMemoryForLayer(i,n)),r}getTile(e){if(e==null||this._rootTiles==null)return null;const r=e.split("/").map(a=>+a);if(r[0]===0)return this._rootTiles.find(a=>a.lij[1]===r[1]&&a.lij[2]===r[2]);const i=2**r[0],n=Math.floor(r[1]/i),s=Math.floor(r[2]/i);let o;if(this._rootTiles.some(a=>a.lij[1]===n&&a.lij[2]===s&&(o=a,!0)),o){let a=1<0&&l++,!o.children[l])return null;o=o.children[l],a>>=1}return _f(o.lij[0]===r[0]&&o.lij[1]===r[1]&&o.lij[2]===r[2],"not the right tile?"),o}return null}get renderPatchBorders(){return this._renderer.renderPatchBorders}set renderPatchBorders(e){this._renderer.renderPatchBorders=e}get visualizeNormals(){return this._renderer.visualizeNormals}set visualizeNormals(e){this._renderer.visualizeNormals=e}get renderingDisabled(){return this._renderer.renderingDisabled}set renderingDisabled(e){this._renderer.renderingDisabled=e}get test(){const e=this;return{renderer:e._renderer,lercDecoder:e._lercDecoder,forceReload:()=>{e._rootTiles!=null&&e._rootTiles.length>0&&(e._mergeTile(e._rootTiles[0]),e._viewChangeUpdate())},getTiles:()=>e._allTiles.toArray(),getRenderedTiles(){Hz.clear(),e._allTiles.forAll(i=>{i.visible&&i.rendered&&Hz.push(i)});const r=Hz.toArray();return LOe(e.renderOrder,r),r},lockTilingScheme(r,i){e._extentHelper.defaultTiledLayersExtent=i,e.tilingSchemeLogic.test.lockTilingScheme(r)}}}checkAllTilesWaterproofness(){if(!Q5)return;const e=this._rootTiles;if(e==null)return;const r=o=>{var a,l,c;return((c=(l=(a=o==null?void 0:o.renderData)==null?void 0:a.geometry)==null?void 0:l.indices)==null?void 0:c.length)>0},i=(o,a)=>{r(o)&&console.error("Tile[",o.lij,"] has geometry although parent[",a.lij,"] has geom")},n=o=>{var a,l;if(o.intersectsClippingArea)if(o.renderData&&!o.renderData.geometryState&&console.error("Tile[",o.lij,"] has renderData but not geometryState"),o.renderData&&!o.renderData.geometry&&console.error("Tile[",o.lij,"] has renderData but not geometryInfo"),!((a=o.renderData)!=null&&a.geometry)||(((l=o.renderData.geometry.indices)==null?void 0:l.length)??0)>0||console.error("Tile[",o.lij,"] has renderData but no indices - geometryInfo: ",o.renderData.geometry),r(o)){o.checkGeometryWaterproofness();for(const c of o.children)i(c,o)}else if(o.isLeaf)console.error("Tile[",o.lij,"] has no geometry and no children, from root to leaf");else for(const c of o.children)n(c)},s=o=>{var u;const a=((u=o.parent)==null?void 0:u.visible)??!0,l=o.visible;o.computeVisibility();const c=o.visible;if(l!==c&&a&&console.error(" Tile[",o.lij,"] has out of date visibility: ",l," instead of ",c),!o.isLeaf)for(const d of o.children)s(d)};for(const o of e)n(o),s(o)}get isGlobal(){return this._isGlobal}get isWebMercator(){return this._isWebMercator}get isWebMercatorOnPlateeCarree(){return this._isWebMercatorOnPlateeCarree}isEastEndWrap(e){return this.isGlobal&&e[2]===this.lijEastEnd(e[0])-1}isWestEndWrap(e){return this.isGlobal&&e[2]===0}lijEastEnd(e){return 2**(e+(this.spatialReference!=null&&this.spatialReference.isGeographic?1:0))}wrapEastWest(e){const r=this.lijEastEnd(e[0]),i=e[2];if(0<=i&&is.extentMidX?1:0)+(r{const o=this._ensureGeomRecord(e,s);n.forEach(({geometry:a,operation:l,states:c},u)=>{let d=!1;if(l===Hi.UPDATE){const p=o.get(u);if(p){if(c&bs.TRANSFORMATION){const m=this.model.getObject(s);this.model.updateRenderGeometryTransformation(m,a,p)&&(d=!0)}d||r.updates.push({renderGeometry:p,updateType:c})}else Je(!1,"ModelDirtySet.getAddRemoveListFilteredByLayers: invalid update")}if(l===Hi.REMOVE||d){const p=o.get(u);p?(r.removes.push(p),o.delete(u)):l===Hi.REMOVE&&Je(!1,"ModelDirtySet.getAddRemoveListFilteredByLayers: invalid remove")}if(l===Hi.ADD||d){const p=this.model.getObject(s);if(p!=null){const m=this.model.getRenderGeometry(p,a);r.adds.push(m),o.set(u,m)}}}),o.size===0&&this._residentGeomRecords.get(e).delete(s)}),this._residentGeomRecords.get(e).size===0&&this._residentGeomRecords.delete(e),this._dirtyGeomRecords.delete(e),this.dirty=this._hasDirtyGeometryRecords)}getResidentRenderGeometries(e,r){const i=this._residentGeomRecords.get(e);i&&i.forEach(n=>n.forEach(s=>r.push(s)))}_objectStateChanged(e,r){for(const i of r.geometries)this._updateOrCreateDirtyRecord(r,i,null,Hi.UPDATE,e)}visibilityChanged(e){this._objectStateChanged(bs.VISIBILITY,e)}highlightChanged(e){this._objectStateChanged(bs.HIGHLIGHT,e)}occlusionChanged(e){this._objectStateChanged(bs.OCCLUDEE,e)}objectGeometryUpdated(e){this._updateOrCreateDirtyRecord(e.object,e.geometry,null,Hi.UPDATE,bs.GEOMETRY)}layerAdded(e){e.objects.forAll(r=>this._layerObjectAdded(e,r))}layerRemoved(e){e.objects.forAll(r=>this._layerObjectRemoved(e,r))}layerObjectAdded(e){this._layerObjectAdded(e.layer,e.object)}_layerObjectAdded(e,r){const i=e.id;for(const n of r.geometries)this._objectGeometryAdded(r,n,i)}layerObjectRemoved(e){this._layerObjectRemoved(e.layer,e.object)}layerObjectsAdded(e){for(const r of e.objects)this._layerObjectAdded(e.layer,r)}layerObjectsRemoved(e){for(const r of e.objects)this._layerObjectRemoved(e.layer,r)}_layerObjectRemoved(e,r){const i=e.id;for(const n of r.geometries)this._objectGeometryRemoved(r,n,i)}shaderTransformationChanged(e){const r=this._residentGeomRecords.get(e.id);r&&r.forEach((i,n)=>{const s=this.model.getObject(n);s&&s.hasVolativeTransformation()&&i.forEach(o=>o.shaderTransformationChanged())})}objectTransformation(e){const r=this._getParentLayerId(e),i=e.id;this._ensureGeomRecord(r,i).forEach(n=>{this._updateOrCreateDirtyRecord(e,n.geometry,r,Hi.UPDATE,bs.TRANSFORMATION)})}objectShaderTransformation(){}objectGeometryAdded(e){this._objectGeometryAdded(e.object,e.geometry)}_objectGeometryAdded(e,r,i=null){this._updateOrCreateDirtyRecord(e,r,i,Hi.ADD)}objectGeometryRemoved(e){this._objectGeometryRemoved(e.object,e.geometry)}_objectGeometryRemoved(e,r,i=null){this._updateOrCreateDirtyRecord(e,r,i,Hi.REMOVE)}_updateOrCreateDirtyRecord(e,r,i,n,s=bs.NONE){i=i??this._getParentLayerId(e);const o=e.id,a=r.id,l=this._ensureDirtyRecord(i,o),c=l.get(a);if(c){const u=c.operation;u===Hi.REMOVE&&n===Hi.ADD&&c.states!==bs.NONE?c.operation=Hi.UPDATE:u===Hi.REMOVE&&n===Hi.ADD||u===Hi.ADD&&n===Hi.REMOVE?l.delete(a):u!==Hi.UPDATE||n!==Hi.REMOVE&&n!==Hi.UPDATE?(Je((u===Hi.REMOVE||u===Hi.ADD)&&n===Hi.UPDATE,"ModelDirtySet.objectGeometryAdded: inconsistent state"),c.states|=s):(c.operation=n,c.states|=s)}else l.set(a,new zyt(n,r,s));this.dirty=this._hasDirtyGeometryRecords}_ensureGeomRecord(e,r){let i=this._residentGeomRecords.get(e);i||(i=new Map,this._residentGeomRecords.set(e,i));let n=i.get(r);return n||(n=new Map,i.set(r,n)),n}get _hasDirtyGeometryRecords(){return Do(this._dirtyGeomRecords,e=>Do(e,r=>r&&r.size>0))}_ensureDirtyRecord(e,r){let i=this._dirtyGeomRecords.get(e);i||(i=new Map,this._dirtyGeomRecords.set(e,i));let n=i.get(r);return n||(n=new Map,i.set(r,n)),n}_getParentLayerId(e){return e.parentLayer?e.parentLayer.id:oNe}formatDebugInfo(){const e=["ADD","UPD",void 0,"REM"];let r="";return this._dirtyGeomRecords.forEach((i,n)=>{i.forEach((s,o)=>{r.length>0&&(r+=` +`),r+=n+"."+o;const a=[];s.forEach(l=>{const c=l.operation;a[c]||(a[c]=[]),a[c].push(l.geometry.id)});for(let l=0;lr+i.size,0)},commit:r=>e._dirtyGeomRecords.forEach((i,n)=>e.commitLayer(n,r))}}};h([f({constructOnly:!0})],fA.prototype,"model",void 0),h([f()],fA.prototype,"dirty",void 0),fA=h([N("esri.views.3d.webgl-engine.lib.ModelDirtySet")],fA);const Byt=fA;let lN=class extends xe{constructor(){super(...arguments),this.dirtySet=new Byt({model:this}),this._content=new Map,this._originFactory=new PJ(null)}getObject(e){return this._content.get(e)}add(e){const r=e.id;Je(!this._content.has(r),"Model/Stage already contains object to be added"),this._content.set(r,e),F5(e)&&this.dirtySet.layerAdded(e)}remove(e){Je(this._content.has(e.id),"Model/Stage doesn't contain object to be removed"),this._content.delete(e.id),e.unload(),F5(e)&&this.dirtySet.layerRemoved(e)}addMany(e){for(const r of e)r!=null&&(Je(!this._content.has(r.id),"Model/Stage already contains object to be added"),this._content.set(r.id,r))}removeMany(e){for(const r of e)Je(this._content.has(r.id),"Model/Stage doesn't contain object to be removed"),this._content.delete(r.id),r.unload()}has(e){return this._content.has(e.id)}forEachOfType(e,r){this._content.forEach(i=>{i.type===e&&r(i)})}getRenderGeometry(e,r){const{shaderTransformer:i,localOrigin:n}=r,s=new KS(r,{shaderTransformer:i,castShadow:e.castShadow});return s.updateTransformation(o=>e.getCombinedStaticTransformation(r,o)),s.localOrigin=n??this._originFactory.getOrigin(s.boundingSphere),s}updateRenderGeometryTransformation(e,r,i){if(e==null)return!1;i.updateTransformation(s=>e.getCombinedStaticTransformation(r,s));const n=this._originFactory.getOrigin(i.boundingSphere);return i.localOrigin!==n}getStats(){const e={},r=Array.from(this._content.values());for(let i=0;in.type===i).length;return{contentTypes:e,dirtySet:this.dirtySet.formatDebugInfo()}}get test(){return{content:Array.from(this._content.values())}}};h([f({constructOnly:!0})],lN.prototype,"dirtySet",void 0),lN=h([N("esri.views.3d.webgl-engine.parts.Model")],lN);function Vyt(){const t=new Float32Array(4);return t[3]=1,t}function TRe(t){const e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function Gyt(t,e,r,i){const n=new Float32Array(4);return n[0]=t,n[1]=e,n[2]=r,n[3]=i,n}function SRe(t,e){return new Float32Array(t,e,4)}Object.freeze(Object.defineProperty({__proto__:null,clone:TRe,create:Vyt,createView:SRe,fromValues:Gyt},Symbol.toStringTag,{value:"Module"}));const rE=1e-6,WC=[0,0,0],eL=[0,0,0];function jyt(t,e){const{data:r,size:i}=t,n=r.length/i;if(n<=0)return;const s=new Kyt(t);cN(WC,s.minProj,s.maxProj),lb(WC,WC,.5),dh(eL,s.maxProj,s.minProj);const o=NW(eL),a=new e_t;a.quality=o,n<14&&(t=new Ue(new Float64Array(s.buffer,112,42),3));const l=[0,0,0],c=[0,0,0],u=[0,0,0],d=[0,0,0],p=[0,0,0],m=[0,0,0],y=[0,0,0];switch(Hyt(s,t,y,l,c,u,d,p,m,a)){case 1:return void phe(WC,eL,e);case 2:return void Jyt(t,d,e)}Wyt(t,y,l,c,u,d,p,m,a),ERe(t,a.b0,a.b1,a.b2,JT,KT);const _=[0,0,0];dh(_,KT,JT),a.quality=NW(_),a.qualityi&&(i=o,n=s)}yc(e,t.minVert[n]),yc(r,t.maxVert[n])}const Fu=[0,0,0];function Xyt(t,e,r,i){const{data:n,size:s}=t;let o=Number.NEGATIVE_INFINITY,a=0;for(let l=0;lo&&(o=d,a=l)}return yc(i,n,a),o}const vs=[0,0];function Yyt(t,e,r,i,n){Qyt(t,e,vs,n,i);const s=ORe(r,e);vs[1]-rE<=s&&(i[0]=void 0),vs[0]+rE>=s&&(n[0]=void 0)}const uhe=[0,0,0],hhe=[0,0,0],dhe=[0,0,0],Hx=[0,0,0],Wx=[0,0,0],tL=[0,0,0];function kv(t,e,r,i,n,s){if(ARe(e)r[1]&&(r[1]=l,yc(n,s,a))}}function phe(t,e,r){yc(r.center,t),lb(r.halfSize,e,.5),r.quaternion[0]=0,r.quaternion[1]=0,r.quaternion[2]=0,r.quaternion[3]=1}const Rm=[0,0,0],qx=[0,0,0],YC=[0,0,0],JT=[0,0,0],KT=[0,0,0],fhe=[0,0,0];function Jyt(t,e,r){yc(Rm,e),Math.abs(e[0])>Math.abs(e[1])&&Math.abs(e[0])>Math.abs(e[2])?Rm[0]=0:Math.abs(e[1])>Math.abs(e[2])?Rm[1]=0:Rm[2]=0,ARe(Rm)this.maxProj[0]&&(this.maxProj[0]=c,s[0]=l),c=o[l+1],cthis.maxProj[1]&&(this.maxProj[1]=c,s[1]=l),c=o[l+2],cthis.maxProj[2]&&(this.maxProj[2]=c,s[2]=l),c=o[l]+o[l+1]+o[l+2],cthis.maxProj[3]&&(this.maxProj[3]=c,s[3]=l),c=o[l]+o[l+1]-o[l+2],cthis.maxProj[4]&&(this.maxProj[4]=c,s[4]=l),c=o[l]-o[l+1]+o[l+2],cthis.maxProj[5]&&(this.maxProj[5]=c,s[5]=l),c=o[l]-o[l+1]-o[l+2],cthis.maxProj[6]&&(this.maxProj[6]=c,s[6]=l)}for(let l=0;l0){const i=1/Math.sqrt(r);t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i}}function ARe(t){return t[0]*t[0]+t[1]*t[1]+t[2]*t[2]}function FW(t,e){const r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2];return r*r+i*i+n*n}function ORe(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function t_t(t,e){const r=e[0]+e[4]+e[8];if(r>0){let i=Math.sqrt(r+1);t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i}else{let i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);const n=(i+1)%3,s=(i+2)%3;let o=Math.sqrt(e[3*i+i]-e[3*n+n]-e[3*s+s]+1);t[i]=.5*o,o=.5/o,t[3]=(e[3*n+s]-e[3*s+n])*o,t[n]=(e[3*n+i]+e[3*i+n])*o,t[s]=(e[3*s+i]+e[3*i+s])*o}}const zb=Au(),ka=O(),UW=O(),r_t=hi();let f8t=class{constructor(e){const o=e*56;this.buffer=new ArrayBuffer(o),this.obbs=new Array(e);for(let a=0;ai?1:r<-i?-1:0}function _8t(t,e){return ka[0]=t.center[0]-e[0],ka[1]=t.center[1]-e[1],ka[2]=t.center[2]-e[2],X_(zb,t.quaternion),Sh(ka,ka,zb),b4(ka,ka),lY(UW,ka,t.halfSize),u6(UW,ka)1e-6){const c=(i+t.halfSize[l]-n[l])/s[l],u=(-i-t.halfSize[l]-n[l])/s[l];o=Math.max(o,Math.min(c,u)),a=Math.min(a,Math.max(c,u))}else if(n[l]>t.halfSize[l]+i||n[l]<-t.halfSize[l]-i)return!1;return o<=a}(()=>{const t=new Int8Array(162);let e=0;const r=i=>{for(let n=0;n0?1+e/o:1,l=s>0?1+r/s:1,c=(l+a)/2,u=(l-a)/2;te(n.halfSize,Yx,u),pb(n.halfSize,n.halfSize,t.halfSize,c),te(n.center,Yx,c),pb(n.center,n.center,t.halfSize,u),aye(q0,q0),c6(n.center,n.center,q0),Sh(n.center,n.center,n.quaternion)}}else{const s=ne(q0,0,0,1);pb(n.center,t.center,s,(r+e)/2),X_(iL,t.quaternion),Sh(s,s,iL),b4(s,s),pb(n.halfSize,t.halfSize,s,(r-e)/2)}return n}const q0=O(),Yx=O(),Zx=O(),iL=Au();let s_t=class{constructor(e){this._totalCount=e,this._indexRanges=[0,e]}allVisible(){return this.componentCount()===this._totalCount}allInvisible(){return this._indexRanges.length===0}componentCount(){const e=this._indexRanges;let r=0;for(let i=0;i(t[a]>0?(s!==a-1&&(i.length&&i.push(r[s+1]-i[i.length-1]),i.push(r[a])),s=a):(o!==a-1&&(n.length&&n.push(r[o+1]-n[n.length-1]),n.push(r[a])),o=a),!0)),i.length&&i.push(r[s+1]-i[i.length-1]),n.length&&n.push(r[o+1]-n[n.length-1]),{highlightRanges:i,defaultRanges:n}}let mA=class extends xe{constructor(){super(...arguments),this.visible=eS.Hidden}};var eS;h([f({autoDestroy:!0})],mA.prototype,"renderable",void 0),h([f({autoDestroy:!0})],mA.prototype,"components",void 0),mA=h([N("esri.views.3d.webgl-engine.collections.Component.ComponentObject")],mA),function(t){t[t.Hidden=0]="Hidden",t[t.Visible=1]="Visible"}(eS||(eS={}));function c_t(t,e,r,i){if(r>=e)return t;t==null&&(t=u_t());const n=t.isVisibleBit;let s=t.data;const o=MRe(s),a=r/o|0,l=r-o*a,c=(e-1)/o|0,u=s,d=i===n;if(!(r{if(!PRe(this._components.pickability,y))return!0;const _=this.getComponentAabb(y,g_t);if(o!=null){const T=o[y];s!=null?s.componentOffset=T:(e[2]=p-T,r[2]=m-T)}if(s!=null&&s.applyToAabb(_),!QQ(_,e,d,i))return!0;const v=u[y]/3,b=u[y+1]/3,x=(T,S,A)=>a(y,T,zo(S,S,n),A);return s==null&&b-v>bRe?(this._componentIntersectionData[y]==null&&(this._componentIntersectionData[y]=new CK(this._indices,v,b,l)),this._componentIntersectionData[y].intersectRay({r0:e,r1:r},x)):BP(e,r,v,b,c,l,void 0,s,x),!0})}_computePerComponentAabbs(){const e=this._components.count,r=Yi(6*e),i=this._indices,n=this._positions,s=this._components.offsets;let o=0;for(let a=0;a{const a=o.offsetObb!=null?o.offsetObb:o.obb,l=fe(Ws(Vc,a.center,i),s),c=nU(a,s);if(nL(r,l-c)&&nL(r,l+c))return;const u=C_t(a,n);if(u===-1)return;if(u===0)return Pm.far=l+c,Pm.near=l-c,void iE(r,Pm);const d=sL.pushNew();d.near=l-c,d.far=l+c,d.mask=u,d.object=o});for(let o=0;o{let u=T_t;for(let d=0;d<$Re&&c.length>0;d++){if(!(a.mask&1<t||{near:1/0,far:-1/0,mask:0,object:null},deallocator:t=>(t.object=lE(t.object),t)}),Pm=nM(),_l=O(),tv=O(),x_t=new Nt({deallocator:null}),T_t=new Nt({deallocator:null});function S_t(t,e,r){r.length=0;const i=e.length-3;qz(_l,e,i);const n=oi(t,_l);n<=0&&(r.push(_l[0]),r.push(_l[1]),r.push(_l[2]));let s=0,o=n;for(;st.halfSize[0]?1:0)+3*(Vc[1]<-t.halfSize[1]?-1:Vc[1]>t.halfSize[1]?1:0)+9*(Vc[2]<-t.halfSize[2]?-1:Vc[2]>t.halfSize[2]?1:0)+13),s=ghe[n];if(s===0)return s;rQ(oL,t.quaternion),tQ(oL,oL,t.halfSize);const o=(a,l)=>{const c=ghe[n+l+1];return ne(a,((1&c)<<1)-1,(2&c)-1,((4&c)>>1)-1),zo(a,a,oL),oe(a,t.center,a)};return r.length=0,vl(r,o(Xz,0)),vl(r,o(_he,1)),vl(r,o(Vc,2)),vl(r,o(vhe,3)),i(r),s===1||(r.length=0,vl(r,Xz),vl(r,vhe),vl(r,o(Vc,4)),vl(r,o(bhe,5)),i(r),s===2||(r.length=0,vl(r,Xz),vl(r,bhe),vl(r,o(Vc,6)),vl(r,_he),i(r))),s}const ghe=(()=>{const t=new Array(216);let e=0;const r=i=>{for(let n=0;n0)return-1;n===0&&(r|=1<i.renderable.material.submit(e,r,i))}queryShadowCasterDepthRange(e){return this._objects.visibleObjects.length?w_t(e,this._objects.visibleObjects):null}};function O_t(t){const e=Gi().vec3f(E.POSITION);return t.normals&&e.vec2i16(E.NORMALCOMPRESSED,{glNormalized:!0}),t.textureCoordinates===Pn.Default?e.vec2f(E.UV0):t.textureCoordinates===Pn.Atlas&&(e.vec2f(E.UV0),e.vec4u16(E.UVREGION,{glNormalized:!0})),t.colors&&e.vec4u8(E.COLOR,{glNormalized:!0}),e}let R_t=class{constructor(){this.externalColor=Qt(),this.externalColorMixMode=as.Multiply,this.castShadows=!0,this.pickable=!0,this.elevationOffset=0}},P_t=class extends ln{constructor(e,r){super(e,"int",jr.Draw,(i,n,s)=>i.setUniform1i(e,r(n,s)))}};var Gf;(function(t){t[t.Uniform=0]="Uniform",t[t.Varying=1]="Varying",t[t.COUNT=2]="COUNT"})(Gf||(Gf={}));const AK=429496.7296;function IRe(t,e){$R(t/AK*.5+.5,e)}function M_t(t,e){switch(e.componentData){case Gf.Varying:return $_t(t,e);case Gf.Uniform:return I_t(t);case Gf.COUNT:return;default:e.componentData}}function $_t(t,e){const{vertex:r,fragment:i}=t;r.include(Pc),r.uniforms.add(new Eh("componentColorTex",s=>s.componentParameters.texture.texture)),t.attributes.add(E.COMPONENTINDEX,"float"),t.varyings.add("vExternalColorMixMode","mediump float"),t.varyings.add("vExternalColor","vec4");const n=e.output===D.ObjectAndLayerIdColor;n&&t.varyings.add("vObjectAndLayerIdColor","vec4"),t.include(b3e),r.constants.add("elevationScale","float",2*AK),r.constants.add("stride","float",se("enable-feature:objectAndLayerId-rendering")?3:2),r.code.add(w`vec2 getComponentTextureCoordinates(float componentIndex, float typeOffset) { +float index = componentIndex * stride + typeOffset; +float texSize = float(textureSize(componentColorTex, 0).x); +float coordX = mod(index, texSize); +float coordY = floor(index / texSize); +return vec2(coordX, coordY) + 0.5; +}`),r.code.add(w` + vec4 _readComponentColor() { + vec2 textureCoordinates = getComponentTextureCoordinates(componentIndex, 0.0); + + return texelFetch(componentColorTex, ivec2(textureCoordinates), 0); + } + + float readElevationOffset() { + vec2 textureCoordinates = getComponentTextureCoordinates(componentIndex, 1.0); + + vec4 encodedElevation = texelFetch(componentColorTex, ivec2(textureCoordinates), 0); + return (rgba2float(encodedElevation) - 0.5) * elevationScale; + } + + ${n?w` + void forwardObjectAndLayerIdColor() { + vec2 textureCoordinates = getComponentTextureCoordinates(componentIndex, 2.0); + + vObjectAndLayerIdColor = texelFetch(componentColorTex, ivec2(textureCoordinates), 0); + }`:w`void forwardObjectAndLayerIdColor() {}`} + + vec4 forwardExternalColor(out bool castShadows) { + vec4 componentColor = _readComponentColor() * 255.0; + + float shadowFlag = mod(componentColor.b * 255.0, 2.0); + componentColor.b -= shadowFlag; + castShadows = shadowFlag >= 1.0; + + int decodedColorMixMode; + vExternalColor = decodeSymbolColor(componentColor, decodedColorMixMode) * 0.003921568627451; // = 1/255; + vExternalColorMixMode = float(decodedColorMixMode) + 0.5; // add 0.5 to avoid interpolation artifacts + + return vExternalColor; + } +`),i.code.add(w` + void readExternalColor(out vec4 externalColor, out int externalColorMixMode) { + externalColor = vExternalColor; + externalColorMixMode = int(vExternalColorMixMode); + } + + void outputObjectAndLayerIdColor() { + ${n?w`fragColor = vObjectAndLayerIdColor;`:""} + } +`)}function I_t(t){const{vertex:e,fragment:r}=t;e.uniforms.add(new rF("externalColor",i=>i.componentParameters.externalColor)),r.uniforms.add(new P_t("externalColorMixMode",i=>i.componentParameters.externalColorMixMode)),t.varyings.add("vExternalColor","vec4"),e.code.add(w`float readElevationOffset() { +return 0.0; +} +void forwardObjectAndLayerIdColor() { +} +vec4 forwardExternalColor(out bool castShadows) { +vExternalColor = externalColor; +castShadows = true; +return externalColor; +}`),r.code.add(w`void readExternalColor(out vec4 color, out int colorMixMode) { +color = vExternalColor; +colorMixMode = externalColorMixMode; +} +void outputObjectAndLayerIdColor() { +fragColor = vec4(1.0,0.0,0.0,0.0); +}`)}var gh;function L_t(t,e){const r=t.vertex;switch(r.code.add(w`#define VERTEX_DISCARD_CUTOFF (1.0 - 1.0 / 255.0)`),e.vertexDiscardMode){case gh.None:r.code.add(w`#define vertexDiscardByOpacity(_opacity_) {}`);break;case gh.Opaque:r.code.add(w`#define vertexDiscardByOpacity(_opacity_) { if (_opacity_ > VERTEX_DISCARD_CUTOFF) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } }`);break;case gh.Transparent:r.code.add(w`#define vertexDiscardByOpacity(_opacity_) { if (_opacity_ <= VERTEX_DISCARD_CUTOFF) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } }`)}}(function(t){t[t.None=0]="None",t[t.Transparent=1]="Transparent",t[t.Opaque=2]="Opaque",t[t.COUNT=3]="COUNT"})(gh||(gh={}));var jf;function D8t(t){return t&&nm(t)?jf.Mars:t&&sm(t)?jf.Moon:jf.Earth}(function(t){t[t.Earth=1]="Earth",t[t.Mars=2]="Mars",t[t.Moon=3]="Moon",t[t.COUNT=4]="COUNT"})(jf||(jf={}));var ru;(function(t){t[t.None=0]="None",t[t.NoOverlay=1]="NoOverlay",t[t.ColorOverlay=2]="ColorOverlay",t[t.ColorOverlayWithWater=3]="ColorOverlayWithWater",t[t.COUNT=4]="COUNT"})(ru||(ru={}));let sr=class extends va{constructor(){super(...arguments),this.output=D.Color,this.textureCoordinateType=Pn.None,this.componentData=Gf.Uniform,this.cullFace=ui.Back,this.vertexDiscardMode=gh.None,this.doubleSidedMode=Zi.WindingOrder,this.alphaDiscardMode=Gr.Opaque,this.integratedMeshMode=ru.None,this.transparencyPassType=rt.NONE,this.ellipsoidMode=jf.Earth,this.pbrMode=et.Disabled,this.normalType=br.Attribute,this.spherical=!1,this.doublePrecisionRequiresObfuscation=!1,this.hasVertexColors=!1,this.hasNormals=!1,this.hasSlicePlane=!1,this.hasBaseColorTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.hasScreenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.hasCloudsReflections=!0,this.snowCover=!1,this.objectAndLayerIdColor=!1}};h([U({count:D.COUNT})],sr.prototype,"output",void 0),h([U({count:Pn.COUNT})],sr.prototype,"textureCoordinateType",void 0),h([U({count:Gf.COUNT})],sr.prototype,"componentData",void 0),h([U({count:ui.COUNT})],sr.prototype,"cullFace",void 0),h([U({count:gh.COUNT})],sr.prototype,"vertexDiscardMode",void 0),h([U({count:Zi.COUNT})],sr.prototype,"doubleSidedMode",void 0),h([U({count:Gr.COUNT})],sr.prototype,"alphaDiscardMode",void 0),h([U({count:ru.COUNT})],sr.prototype,"integratedMeshMode",void 0),h([U({count:rt.COUNT})],sr.prototype,"transparencyPassType",void 0),h([U({count:jf.COUNT})],sr.prototype,"ellipsoidMode",void 0),h([U({count:et.COUNT})],sr.prototype,"pbrMode",void 0),h([U({count:br.COUNT})],sr.prototype,"normalType",void 0),h([U()],sr.prototype,"spherical",void 0),h([U()],sr.prototype,"doublePrecisionRequiresObfuscation",void 0),h([U()],sr.prototype,"hasVertexColors",void 0),h([U()],sr.prototype,"hasNormals",void 0),h([U()],sr.prototype,"hasSlicePlane",void 0),h([U()],sr.prototype,"hasBaseColorTexture",void 0),h([U()],sr.prototype,"receiveAmbientOcclusion",void 0),h([U()],sr.prototype,"receiveShadows",void 0),h([U()],sr.prototype,"blendingEnabled",void 0),h([U()],sr.prototype,"hasScreenSpaceReflections",void 0),h([U()],sr.prototype,"hasPolygonOffset",void 0),h([U()],sr.prototype,"hasMetallicRoughnessTexture",void 0),h([U()],sr.prototype,"hasEmissionTexture",void 0),h([U()],sr.prototype,"hasOcclusionTexture",void 0),h([U()],sr.prototype,"hasNormalTexture",void 0),h([U()],sr.prototype,"hasOccludees",void 0),h([U()],sr.prototype,"hasMultipassTerrain",void 0),h([U()],sr.prototype,"cullAboveGround",void 0),h([U()],sr.prototype,"hasCloudsReflections",void 0),h([U()],sr.prototype,"snowCover",void 0),h([U()],sr.prototype,"objectAndLayerIdColor",void 0),h([U({constValue:jr.Draw})],sr.prototype,"pbrTextureBindType",void 0),h([U({constValue:!0})],sr.prototype,"hasSliceHighlight",void 0),h([U({constValue:!1})],sr.prototype,"hasSliceInVertexProgram",void 0),h([U({constValue:!1})],sr.prototype,"useCustomDTRExponentForWater",void 0),h([U({constValue:!1})],sr.prototype,"hasVertexTangents",void 0),h([U({constValue:!0})],sr.prototype,"supportsTextureAtlas",void 0),h([U({constValue:!1})],sr.prototype,"highStepCount",void 0),h([U({constValue:!1})],sr.prototype,"instancedDoublePrecision",void 0),h([U({constValue:!0})],sr.prototype,"useFillLights",void 0),h([U({constValue:!1})],sr.prototype,"objectAndLayerIdColorInstanced",void 0);function whe(t,e){t.include(qw,e),t.fragment.include(kR);const r=t.fragment;r.uniforms.add(new rF("baseColor",i=>i.baseColor)),r.uniforms.add(new Nb("objectOpacity",i=>i.objectOpacity)),e.hasVertexColors?r.code.add(w`vec3 _baseColor() { +return baseColor.rgb * vColor.rgb; +} +float _baseOpacity() { +return baseColor.a * vColor.a; +}`):r.code.add(w`vec3 _baseColor() { +return baseColor.rgb; +} +float _baseOpacity() { +return baseColor.a; +}`),r.code.add(w`vec4 computeMaterialColor(vec4 textureColor, vec4 externalColor, int externalColorMixMode) { +vec3 baseColor = _baseColor(); +float baseOpacity = _baseOpacity(); +vec3 color = mixExternalColor( +baseColor, +textureColor.rgb, +externalColor.rgb, +externalColorMixMode +); +float opacity = objectOpacity * mixExternalOpacity( +baseOpacity, +textureColor.a, +externalColor.a, +externalColorMixMode +); +return vec4(color, opacity); +}`)}function xhe(t,e){const r=t.fragment;switch(e.doubleSidedMode){case Zi.None:r.code.add(w`vec3 _adjustDoublesided(vec3 normal) { +return normal; +}`);break;case Zi.View:t.include(kT,e),r.code.add(w`vec3 _adjustDoublesided(vec3 normal) { +return dot(normal, vPositionWorldCameraRelative) > 0.0 ? -normal : normal; +}`);break;case Zi.WindingOrder:r.code.add(w`vec3 _adjustDoublesided(vec3 normal) { +return gl_FrontFacing ? normal : -normal; +}`);break;default:e.doubleSidedMode;case Zi.COUNT:}switch(e.normalType){case br.Attribute:case br.Compressed:t.include(F8,e),r.code.add(w`vec3 shadingNormalWorld() { +return _adjustDoublesided(normalize(vNormalWorld)); +} +vec3 shadingNormal_view() { +vec3 normal = normalize(vNormalView); +return gl_FrontFacing ? normal : -normal; +}`);break;case br.ScreenDerivative:t.include(kT,e),r.code.add(w`vec3 shadingNormalWorld() { +return normalize(cross( +dFdx(vPositionWorldCameraRelative), +dFdy(vPositionWorldCameraRelative) +)); +} +vec3 shadingNormal_view() { +return normalize(cross(dFdx(vPosition_view),dFdy(vPosition_view))); +}`);break;case br.Ground:e.spherical?(t.include(kT,e),r.code.add(w`vec3 shadingNormalWorld() { +return normalize(positionWorld()); +}`)):r.code.add(w`vec3 shadingNormalWorld() { +return vec3(0.0, 0.0, 1.0); +}`),r.code.add(w`vec3 shadingNormal_view() { +return normalize(cross(dFdx(vPosition_view),dFdy(vPosition_view))).xyz; +}`);break;default:e.normalType;case br.COUNT:}}function D_t(t,e){const r=t.fragment;if(e.hasBaseColorTexture&&(e.output===D.Color||e.alphaDiscardMode!==Gr.Opaque)){t.include(qZ,e);const i=e.textureCoordinateType===Pn.Atlas;r.uniforms.add(new Eh("baseColorTexture",n=>n.texture)),i?(t.include(_xe),r.code.add(w`vec4 readBaseColorTexture() { +return textureAtlasLookup(baseColorTexture, vuv0, vuvRegion); +}`)):r.code.add(w`vec4 readBaseColorTexture() { +return texture(baseColorTexture, vuv0); +}`)}else r.code.add(w`vec4 readBaseColorTexture() { return vec4(1.0); }`)}function N_t(t){const e=new mr;e.include(kT,t),e.include(F8,t),e.include(qw,t),e.include(Uf,t),e.include(AE,t),e.include(M_t,t),e.include(Hot,t),e.include(ptt,t),e.include(D_t,t),e.include(L_t,t);const{vertex:r,fragment:i}=e;t.pbrMode!==et.Normal&&t.pbrMode!==et.Schematic||(e.include(YZ,t),t.hasNormalTexture&&e.include(S3e,t));const n=t.output===D.Shadow||t.output===D.ShadowHighlight||t.output===D.ShadowExcludeHighlight;n&&t.componentData===Gf.Varying?r.code.add(w`#define discardShadows(castShadows) { if(!castShadows) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } }`):r.code.add(w`#define discardShadows(castShadows) {}`);const s=t.integratedMeshMode===ru.ColorOverlay||t.integratedMeshMode===ru.ColorOverlayWithWater,o=s&&t.output===D.Color&&t.pbrMode===et.WaterOnIntegratedMesh;return s&&(e.include(ww,t),e.include(Kgt,t),t.spherical?r.code.add(w` + const float invEllipsoidRadius = ${w.float(1/(t.ellipsoidMode===jf.Earth?Kt.radius:t.ellipsoidMode===jf.Mars?If.radius:Fg.radius))}; + vec2 projectOverlay(vec3 pos) { + return pos.xy / (1.0 + invEllipsoidRadius * pos.z); + } + `):r.code.add(w`vec2 projectOverlay(vec3 pos) { return pos.xy; }`)),o&&(e.varyings.add("tbnTangent","vec3"),e.varyings.add("tbnBiTangent","vec3"),e.varyings.add("groundNormal","vec3")),r.code.add(w` + void main() { + bool castShadows; + vec4 externalColor = forwardExternalColor(castShadows); + discardShadows(castShadows); + + vertexDiscardByOpacity(externalColor.a); + + ${t.output===D.ObjectAndLayerIdColor?w`externalColor.a = 1.0;`:""} + + if (externalColor.a < ${w.float(vo)}) { + // Discard this vertex + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } + + forwardPosition(readElevationOffset()); + forwardNormal(); + forwardTextureCoordinates(); + forwardVertexColor(); + forwardLinearDepth(); + ${t.output===D.ObjectAndLayerIdColor?w`forwardObjectAndLayerIdColor();`:""} + ${o?t.spherical?w` + groundNormal = normalize(positionWorld()); + tbnTangent = normalize(cross(vec3(0.0, 0.0, 1.0), groundNormal)); + tbnBiTangent = normalize(cross(groundNormal, tbnTangent));`:w` + groundNormal = vec3(0.0, 0.0, 1.0); + tbnTangent = vec3(1.0, 0.0, 0.0); + tbnBiTangent = vec3(0.0, 1.0, 0.0);`:""} + ${s?w`setOverlayVTC(projectOverlay(position));`:""} + } + `),t.output===D.Alpha&&(i.include(wu),e.include(xu,t),e.include(whe,t),s&&i.uniforms.add(new Ye("ovColorTex",(a,l)=>EW(a,l))),i.code.add(w` + void main() { + discardBySlice(vPositionWorldCameraRelative); + ${t.hasMultipassTerrain?w`terrainDepthTest(gl_FragCoord, vPosition_view.z);`:""} + + vec4 textureColor = readBaseColorTexture(); + discardOrAdjustAlpha(textureColor); + + vec4 externalColor; + int externalColorMixMode; + readExternalColor(externalColor, externalColorMixMode); + + vec4 materialColor = computeMaterialColor( + textureColor, + externalColor, + externalColorMixMode + ); + ${s?w` + vec4 overlayColor = getOverlayColor(ovColorTex, vtcOverlay); + materialColor = materialColor * (1.0 - overlayColor.a) + overlayColor;`:""} + + fragColor = vec4(materialColor.a); + } + `)),t.output===D.Color&&(i.include(wu),e.include(xu,t),e.include(whe,t),e.include(xhe,t),e.include(ww,t),t.receiveShadows?(e.include(U8,t),i.code.add(w`float evaluateShadow() { +return readShadowMap(vPositionWorldCameraRelative, linearDepth); +}`)):i.code.add(w`float evaluateShadow() { return 0.0; }`),s&&i.uniforms.add(new Ye("ovColorTex",(a,l)=>EW(a,l))),i.code.add(w` + void main() { + discardBySlice(vPositionWorldCameraRelative); + ${t.hasMultipassTerrain?w`terrainDepthTest(gl_FragCoord, vPosition_view.z);`:""} + + vec4 textureColor = readBaseColorTexture(); + discardOrAdjustAlpha(textureColor); + + vec4 externalColor; + int externalColorMixMode; + readExternalColor(externalColor, externalColorMixMode); + + vec4 materialColor = computeMaterialColor( + textureColor, + externalColor, + externalColorMixMode + ); + ${s?w`vec4 overlayColor = getOverlayColor(ovColorTex, vtcOverlay);`:""} + `),t.pbrMode===et.Normal||t.pbrMode===et.Schematic?(lm(i),i.code.add(w` + ${t.pbrMode===et.Normal?w` + applyPBRFactors(); + if (int(externalColorMixMode) == 3) { + mrr = vec3(0.0, 0.6, 0.2); + }`:""} + vec3 normalVertex = shadingNormalWorld(); + float additionalIrradiance = 0.02 * mainLightIntensity[2]; + `),t.hasNormalTexture?i.code.add(w`mat3 tangentSpace = computeTangentSpace(normalVertex, vPositionWorldCameraRelative, vuv0); +vec3 shadingNormal = computeTextureNormal(tangentSpace, vuv0);`):i.code.add(w`vec3 shadingNormal = normalVertex;`),i.code.add(w`${t.spherical?w`vec3 normalGround = normalize(positionWorld());`:w`vec3 normalGround = vec3(0.0, 0.0, 1.0);`} + `),i.code.add(w` + vec3 viewDir = normalize(vPositionWorldCameraRelative); + float ssao = 1.0 - occlusion * (1.0 - evaluateAmbientOcclusion()); + + ${t.snowCover?w` + vec3 surfaceNormal = normalize(shadingNormalWorld()); + float snow = smoothstep(0.5, 0.55, dot(surfaceNormal, normalize(positionWorld()))); + materialColor.rgb = mix(materialColor.rgb, vec3(1), snow); + + shadingNormal = mix(shadingNormal, surfaceNormal, snow); + ssao = mix(ssao, 0.0, snow); + mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow); + emission = mix(emission, vec3(0.0), snow);`:""} + + ${s?w` materialColor = materialColor * (1.0 - overlayColor.a) + overlayColor;`:""} + + vec3 additionalLight = evaluateAdditionalLighting(ssao, positionWorld()); + vec4 shadedColor = vec4(evaluateSceneLightingPBR(shadingNormal, materialColor.rgb, evaluateShadow(), ssao, additionalLight, viewDir, normalGround, mrr, emission, additionalIrradiance), materialColor.a); + `)):(t.receiveShadows?i.code.add(w`float shadow = evaluateShadow();`):t.spherical?(NE(i),i.code.add(w`float additionalAmbientScale = additionalDirectedAmbientLight(positionWorld()); +float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);`)):i.code.add(w`float shadow = 0.0;`),o&&i.uniforms.add(new Ye("ovNormalTex",(a,l)=>OK(l))),t.snowCover&&i.code.add(w`vec3 surfaceNormal = normalize(cross(dFdx(vPositionWorldCameraRelative), dFdy(vPositionWorldCameraRelative))); +float snow = smoothstep(0.5, 0.55, dot(surfaceNormal, normalize(positionWorld()))); +materialColor.rgb = mix(materialColor.rgb, vec3(1), snow);`),i.code.add(w` + float ambientOcclusion = evaluateAmbientOcclusion(); + vec3 additionalLight = evaluateAdditionalLighting(ambientOcclusion, positionWorld()); + + ${s?w` materialColor = materialColor * (1.0 - overlayColor.a) + overlayColor;`:""} + + vec4 shadedColor = vec4(evaluateSceneLighting(shadingNormalWorld(), materialColor.rgb, shadow, ambientOcclusion, additionalLight), materialColor.a); + ${o?w` + vec4 overlayWaterMask = getOverlayColor(ovNormalTex, vtcOverlay); + float waterNormalLength = length(overlayWaterMask); + if (waterNormalLength > 0.95) { + mat3 tbnMatrix = mat3(tbnTangent, tbnBiTangent, groundNormal); + vec4 waterColorLinear = getOverlayWaterColor(overlayWaterMask, overlayColor, -normalize(vPositionWorldCameraRelative), shadow, groundNormal, tbnMatrix, vPosition_view, positionWorld()); + vec4 waterColorNonLinear = delinearizeGamma(vec4(waterColorLinear.xyz, 1.0)); + // un-gamma the ground color to mix in linear space + shadedColor = mix(shadedColor, waterColorNonLinear, waterColorLinear.w); + }`:""} + `)),i.code.add(w` + fragColor = highlightSlice(shadedColor, vPositionWorldCameraRelative); + ${t.transparencyPassType===rt.Color?"fragColor = premultiplyAlpha(fragColor);":""} + } + `)),(t.output===D.Depth||n)&&(e.include(Xg,t),i.code.add(w`void main() { +discardBySlice(vPositionWorldCameraRelative); +vec4 textureColor = readBaseColorTexture(); +discardOrAdjustAlpha(textureColor); +outputDepth(linearDepth); +}`)),t.output===D.Normal&&(e.include(xhe,t),i.code.add(w` + void main() { + discardBySlice(vPositionWorldCameraRelative); + + vec4 textureColor = readBaseColorTexture(); + discardOrAdjustAlpha(textureColor); + + // note: the alpha component needs to be 1.0 in order for this material + // to influence ambient occlusion, see the ssao fragment shader + float alpha = ${t.normalType===br.Ground?"0.0":"1.0"}; + fragColor = vec4(vec3(.5) + .5 * shadingNormal_view(), alpha); + } + `)),t.output===D.ObjectAndLayerIdColor&&e.fragment.code.add(w` + void main() { + discardBySlice(vPositionWorldCameraRelative); + + vec4 textureColor = readBaseColorTexture(); + discardOrAdjustAlpha(textureColor); + + ${s?w`fragColor = getOverlayColorTexel(vtcOverlay);`:"outputObjectAndLayerIdColor();"} + } + `),t.output===D.Highlight&&(e.include(c0,t),i.code.add(w` + void main() { + discardBySlice(vPositionWorldCameraRelative); + + vec4 textureColor = readBaseColorTexture(); + discardOrAdjustAlpha(textureColor); + + ${s?w` + vec4 overlayColor = getCombinedOverlayColor(); + if (overlayColor.a == 0.0) { + fragColor = vec4(0.0); + return; + }`:""} + + outputHighlight(); + } + `)),e}function OK(t){return t.overlays.length===0?null:t.overlays[Oi.INNER].getValidTexture(tn.Water)}const F_t=Object.freeze(Object.defineProperty({__proto__:null,build:N_t,getOverlayNormalTexture:OK},Symbol.toStringTag,{value:"Module"}));let LRe=class DRe extends Tr{initializeConfiguration(e,r){r.spherical=e.viewingMode===$e.Global,r.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result}initializeProgram(e){return new vr(e.rctx,DRe.shader.get().build(this.configuration),NRe)}_setPipelineState(e){const r=this.configuration,i=r.integratedMeshMode!==ru.None,n=e===rt.NONE,s=e===rt.FrontFace;return Ot({blending:r.output!==D.Color&&r.output!==D.Alpha||!r.blendingEnabled?null:n?fu:u0(e),culling:J6(r.cullFace),depthTest:{func:f1(e)},depthWrite:n||s?$l:null,colorWrite:Ft,stencilWrite:i||r.hasOccludees?em:null,stencilTest:i?wst(Rl.IntegratedMeshMaskExcluded):r.hasOccludees?m1:null,polygonOffset:n||s?r.hasPolygonOffset?{factor:2,units:2}:null:C8})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}};LRe.shader=new _r(F_t,()=>ce(()=>import("./ComponentShader.glsl-ec5515fa.js"),[]));const NRe=new Map([[E.POSITION,0],[E.NORMAL,1],[E.NORMALCOMPRESSED,1],[E.COLOR,2],[E.UV0,3],[E.UVREGION,4],[E.COMPONENTINDEX,5]]);let U_t=class extends Wr{constructor(){super(...arguments),this._dirty=!0}_setDirty(){this._dirty=!0}_setClean(){if(this._dirty=!1,this._parameterBlocks!=null)for(const e of this._parameterBlocks)this[e]._setClean()}get dirty(){return this._dirty||this._checkParameterBlocksDirty()}_checkParameterBlocksDirty(){if(this._parameterBlocks==null)return!1;for(const e of this._parameterBlocks)if(this[e].dirty)return!0;return!1}},RK=class{constructor(){this._dirty=!0}_setDirty(){this._dirty=!0}_setClean(){this._dirty=!1}get dirty(){return this._dirty}};function Ki(t={}){return(e,r)=>{const i=e._parameterCount??0;if(e._parameterCount=i+1,t.vectorOps){const n=t.vectorOps;Object.defineProperty(e,r,{get(){return this[i]},set(s){const o=this[i];if(o==null)this[i]=s;else{if(n.equals(o,s))return;n.copy(o,s)}this._setDirty()}})}else Object.defineProperty(e,r,{get(){return this[i]},set(n){this[i]!==n&&(t.dispose&&this[i]&&this[i].dispose(),this[i]=n,this._setDirty())}})}}function The(){return(t,e)=>{const r=t._parameterCount??0;t._parameterCount=r+1,t._parameterBlocks=t._parameterBlocks||[],t._parameterBlocks.push(r),Object.defineProperty(t,e,{get(){return this[r]},set(i){this[r]!==i&&(this[r]=i,this._setDirty())}})}}let sU=class{constructor(e){this._low=O(),this._high=O(),e&&this.set(e)}get low(){return this._low}get high(){return this._high}set(e){re(this._low,re(She,e));const r=Ws(She,e,this._low);re(this._high,r)}get(e){return oe(e,this._low,this._high)}getLowScaled(e){return te(e,this._low,1)}};const She=rn();let Ds=class extends U_t{constructor(e,r){super(),this.toMapSpace=r,this.baseColor=$t(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=na(z8),this.emissiveFactor=Se(0,0,0),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null,this.objectOpacity=1,this.commonMaterialParameters=new uN,this.componentParameters=new OO,this.textureAlphaCutoff=$5,this.alphaDiscardMode=Gr.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=jf.Earth,this.hasOccludees=!1,this._techniqueConfiguration=new sr;const i=new sU(e.position),n=E3e(e.rotationScale);Vw(n,n),this.transformNormalGlobalFromModel=qve(Uh(n,n)),this.transformWorldFromModelTL=i.low,this.transformWorldFromModelTH=i.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this._technique=Fi(this._technique),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get texture(){return this.baseColorTexture!=null?this.baseColorTexture.glTexture:null}get textureMetallicRoughness(){return this.metallicRoughnessTexture!=null?this.metallicRoughnessTexture.glTexture:null}get textureEmissive(){return this.emissionTexture!=null?this.emissionTexture.glTexture:null}get textureOcclusion(){return this.occlusionTexture!=null?this.occlusionTexture.glTexture:null}get textureNormal(){return this.normalTexture!=null?this.normalTexture.glTexture:null}prepareTechnique(e,r,i,n){const s=this._techniqueConfiguration;s.hasVertexColors=n.colors,s.hasNormals=n.normals,s.textureCoordinateType=n.textureCoordinates,s.hasMetallicRoughnessTexture=this.metallicRoughnessTexture!=null,s.hasEmissionTexture=this.emissionTexture!=null,s.hasOcclusionTexture=this.occlusionTexture!=null,s.hasNormalTexture=this.normalTexture!=null,s.transparencyPassType=r.identifier===pc.Material&&i.transparencyPassType!=null?i.transparencyPassType:rt.NONE,s.hasMultipassTerrain=r.identifier===pc.Material&&i.multipassTerrain!=null&&i.multipassTerrain.enabled,s.cullAboveGround=r.identifier===pc.Material&&i.multipassTerrain!=null&&i.multipassTerrain.cullAboveGround,s.ellipsoidMode=this.ellipsoidMode,s.componentData=this.componentParameters.type,s.cullFace=this.commonMaterialParameters.cullFace,s.doubleSidedMode=this.commonMaterialParameters.doubleSided?Zi.View:Zi.None,s.hasBaseColorTexture=this.baseColorTexture!=null;const o=this._computeWhichMaterialPass();s.blendingEnabled=o===Na.Transparent||o===Na.OpaqueAndTransparent,s.alphaDiscardMode=this.alphaDiscardMode,s.integratedMeshMode=this.isIntegratedMesh?z_t(i)?OK(i)?ru.ColorOverlayWithWater:ru.ColorOverlay:ru.NoOverlay:ru.None,s.hasPolygonOffset=this.polygonOffsetEnabled;const a=this.hasParametersFromSource&&this.baseColorTexture==null;if(s.pbrMode=s.integratedMeshMode===ru.ColorOverlayWithWater?et.WaterOnIntegratedMesh:this.usePBR?a?et.Schematic:et.Normal:et.Disabled,s.normalType=s.integratedMeshMode===ru.None?s.hasNormals?br.Compressed:br.ScreenDerivative:br.Ground,s.hasSlicePlane=i.slicePlane!=null&&this.commonMaterialParameters.hasSlicePlane,r.identifier===pc.ShadowMap)s.output=D.Shadow,s.vertexDiscardMode=gh.None;else if(r.identifier===pc.Highlight)s.output=D.Highlight,s.vertexDiscardMode=gh.None;else{switch(this._computeWhichMaterialPass()===Na.OpaqueAndTransparent?s.vertexDiscardMode=r.transparent?gh.Opaque:gh.Transparent:s.vertexDiscardMode=gh.None,s.output=r.output,s.receiveAmbientOcclusion=!1,s.receiveShadows=!1,r.output){case D.Color:s.receiveAmbientOcclusion=i.ssaoHelper.active,s.hasOccludees=i.hasOccludees,s.receiveShadows=i.shadowMap.ready,s.hasScreenSpaceReflections=i.ssr.enabled,s.hasCloudsReflections=i.cloudsFade.data!=null;break;case D.Alpha:s.hasOccludees=i.hasOccludees;break;case D.ObjectAndLayerIdColor:s.objectAndLayerIdColor=!0}s.snowCover=this.hasSnowCover(i)}return this._technique=e.releaseAndAcquire(LRe,s,this._technique),this._setClean(),this._technique}hasSnowCover(e){return e.weather!=null&&e.weatherVisible&&e.weather.type==="snowy"&&e.weather.snowCover==="enabled"}submit(e,r,i){if(this.objectOpacity===0)return;const n=i.renderable.geometry,s=i.components,o=i.renderable.meta.cameraDepthSquared,a=s.geometryRanges,l=s.highlightRanges,c=s.defaultShadowMapRanges;switch(this._computeWhichMaterialPass()){case Na.Opaque:e.materialOpaque.submitDraw(this,n,a,o);break;case Na.Transparent:e.materialTransparent.submitDraw(this,n,a,o);break;case Na.OpaqueAndTransparent:e.materialOpaque.submitDraw(this,n,a,o),e.materialTransparent.submitDraw(this,n,a,o);break;case Na.IntegratedMesh:e.materialIntegratedMesh.submitDraw(this,n,a,o),k_t(r)&&e.highlightIntegratedMesh.submitDraw(this,n,a,o)}const u=this.componentParameters.castShadows!==xs.None;u&&e.shadowMap.submitDraw(this,n,a,o),l!=null&&(e.highlight.submitDraw(this,n,l,o),u&&e.highlightShadowMap.submitDraw(this,n,l,o)),u&&c!=null&&e.defaultShadowMap.submitDraw(this,n,c,o)}_computeWhichMaterialPass(){return this.isIntegratedMesh?Na.IntegratedMesh:this.objectOpacity<1?Na.Transparent:this.componentParameters.opaqueOverride===xs.All?Na.Opaque:this.baseColor[3]<1||this.alphaDiscardMode===Gr.Blend||this.alphaDiscardMode===Gr.MaskBlend?Na.Transparent:this.componentParameters.transparent===xs.None?Na.Opaque:this.componentParameters.transparent===xs.All?Na.Transparent:Na.OpaqueAndTransparent}};var Na,xs;h([Ki({vectorOps:mye})],Ds.prototype,"baseColor",void 0),h([Ki()],Ds.prototype,"usePBR",void 0),h([Ki()],Ds.prototype,"hasParametersFromSource",void 0),h([Ki({vectorOps:ire})],Ds.prototype,"mrrFactors",void 0),h([Ki({vectorOps:ire})],Ds.prototype,"emissiveFactor",void 0),h([Ki({dispose:!0})],Ds.prototype,"baseColorTexture",void 0),h([Ki({dispose:!0})],Ds.prototype,"metallicRoughnessTexture",void 0),h([Ki({dispose:!0})],Ds.prototype,"emissionTexture",void 0),h([Ki({dispose:!0})],Ds.prototype,"occlusionTexture",void 0),h([Ki({dispose:!0})],Ds.prototype,"normalTexture",void 0),h([Ki()],Ds.prototype,"objectOpacity",void 0),h([The()],Ds.prototype,"commonMaterialParameters",void 0),h([The()],Ds.prototype,"componentParameters",void 0),h([Ki()],Ds.prototype,"textureAlphaCutoff",void 0),h([Ki()],Ds.prototype,"alphaDiscardMode",void 0),h([Ki()],Ds.prototype,"isIntegratedMesh",void 0),h([Ki()],Ds.prototype,"polygonOffsetEnabled",void 0),h([Ki()],Ds.prototype,"ellipsoidMode",void 0),h([Ki()],Ds.prototype,"hasOccludees",void 0),function(t){t[t.Opaque=0]="Opaque",t[t.Transparent=1]="Transparent",t[t.OpaqueAndTransparent=2]="OpaqueAndTransparent",t[t.IntegratedMesh=3]="IntegratedMesh"}(Na||(Na={}));let uN=class extends RK{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=ui.Back,this.hasSlicePlane=!0}};h([Ki()],uN.prototype,"doubleSided",void 0),h([Ki()],uN.prototype,"cullFace",void 0),h([Ki()],uN.prototype,"hasSlicePlane",void 0);let OO=class extends RK{constructor(){super(...arguments),this.externalColor=$t(1,1,1,1),this.externalColorMixMode=as.Multiply,this.castShadows=xs.All}get transparent(){return this.externalColor[3]<1?xs.All:xs.None}get opaqueOverride(){return this.externalColorMixMode===as.Replace&&this.externalColor[3]===1?xs.All:xs.None}get visible(){return this.externalColor[3]>0?xs.All:xs.None}get type(){return Gf.Uniform}};h([Ki({vectorOps:mye})],OO.prototype,"externalColor",void 0),h([Ki()],OO.prototype,"externalColorMixMode",void 0),h([Ki()],OO.prototype,"castShadows",void 0),function(t){t[t.All=0]="All",t[t.Some=1]="Some",t[t.None=2]="None"}(xs||(xs={}));let gA=class extends RK{constructor(){super(...arguments),this.texture=null,this.transparent=xs.None,this.opaqueOverride=xs.None,this.castShadows=xs.None}get type(){return Gf.Varying}};function k_t(t){return t.overlays.length!==0&&t.overlays[Oi.INNER].getValidTexture(tn.Highlight)!=null}function z_t(t){return t.overlays.length!==0&&t.overlays[Oi.INNER].getColorTextureNoRasterImage()!=null}h([Ki()],gA.prototype,"texture",void 0),h([Ki()],gA.prototype,"transparent",void 0),h([Ki()],gA.prototype,"opaqueOverride",void 0),h([Ki()],gA.prototype,"castShadows",void 0);const aF=Gi().vec3f(E.POSITION).u16(E.COMPONENTINDEX).u16(E.U16PADDING),FRe=Gi().vec2u8(E.SIDENESS),B_t=Mc(FRe),URe=Gi().vec3f(E.POSITION0).vec3f(E.POSITION1).u16(E.COMPONENTINDEX).u8(E.VARIANTOFFSET,{glNormalized:!0}).u8(E.VARIANTSTROKE).u8(E.VARIANTEXTENSION,{glNormalized:!0}).u8(E.U8PADDING,{glPadding:!0}).u16(E.U16PADDING,{glPadding:!0}),zW=URe.clone().vec3f(E.NORMAL),BW=URe.clone().vec3f(E.NORMALA).vec3f(E.NORMALB),kRe=new Map([[E.POSITION0,0],[E.POSITION1,1],[E.COMPONENTINDEX,2],[E.VARIANTOFFSET,3],[E.VARIANTSTROKE,4],[E.VARIANTEXTENSION,5],[E.NORMAL,6],[E.NORMALA,6],[E.NORMALB,7],[E.SIDENESS,8]]);function Ehe(t,e,r){const i=e/3,n=new Uint32Array(r+1),s=new Uint32Array(r+1),o=(b,x)=>{b{if(b{const T=2*b,S=x-b;for(let A=1;A=0&&c[T+2*P]>C;P--)c[T+2*P+2]=c[T+2*P],c[T+2*P+3]=c[T+2*P+1];c[T+2*P+2]=C,c[T+2*P+3]=R}};for(let b=0;bb===t[3*x]?0:b===t[3*x+1]?1:b===t[3*x+2]?2:-1,_=(b,x)=>{const T=y(b,x);m[3*x+T]=-1},v=(b,x,T,S)=>{const A=y(b,x);m[3*x+A]=S;const C=y(T,S);m[3*S+C]=x};for(let b=0;b{n.getVec(v[4*Q],d),n.getVec(v[4*Q+1],p),M[Q]=ci(d,p)}),F.sort((G,Q)=>k[Q]-k[G]);const V=new Array,z=new Array;for(let G=0;Ge}function X_t(t,e){const r=As(t.cosAngle),i=VW.fwd,n=VW.ortho;return Qg(i,t.position1,t.position0),r*(fe(ot(n,t.faceNormal0,t.faceNormal1),i)>0?-1:1)>e}function Y_t(t){const e=t.faces.length/3,r=t.faces,i=t.neighbors;let n=0;for(let a=0;a0?this._recycledIndices.pop():this.availableCount?this._nextIndex++:void 0}release(e){this._recycledIndices.push(e)}},i1t=class{constructor(e,r=1){this._rctx=e,this._fieldCount=r,this.textureWidth=4096,this._dirty=!0;const i=new pr;i.samplingMode=At.NEAREST,i.wrapMode=Pt.CLAMP_TO_EDGE,i.width=this.textureWidth,i.height=1,this._texture=new Ct(this._rctx,i),this._data=new ya(new ArrayBuffer(4*this.textureWidth))}dispose(){this._texture.dispose(),this._texture=void 0,this._data=void 0}setData(e,r,i,n,s,o){const a=e*this._fieldCount+r;this._dirty=!0,this._data.set(a,0,i),this._data.set(a,1,n),this._data.set(a,2,s),this._data.set(a,3,o)}setDataElement(e,r,i,n){const s=e*this._fieldCount+r;this._dirty=!0,this._data.set(s,i,n)}getDataElement(e,r,i){const n=e*this._fieldCount+r;return this._dirty=!0,this._data.get(n,i)}resizeToFit(e){const r=(e+1)*this._fieldCount;if(r>this._data.count){const i=Math.ceil(r/this.textureWidth)*this.textureWidth,n=new ya(new ArrayBuffer(4*i));n.typedBuffer.set(this._data.typedBuffer),this._data=n}}updateTexture(){if(!this._dirty)return;const e=this._texture.descriptor.width,r=this._texture.descriptor.height;this._data.count>e*r&&this._texture.resize(e,this._data.count/e),this._texture.setData(this._data.typedBuffer),this._dirty=!1}get texture(){return this._texture}};const BRe=65536;let n1t=class{constructor(e,r=1){this.textureBuffer=new i1t(e,r),this._indexManager=new r1t(BRe)}dispose(){this.textureBuffer.dispose(),this.textureBuffer=void 0}get availableCount(){return this._indexManager.availableCount}get activeCount(){return this._indexManager.activeCount}acquireIndex(){const e=this._indexManager.acquire();return this.textureBuffer.resizeToFit(e),e}releaseIndex(e){this._indexManager.release(e)}},VRe=class{constructor(e,r=1){this._rctx=e,this._fieldCount=r,this._buffers=[]}garbageCollect(){this._buffers=this._buffers.filter(e=>e.activeCount!==0||(e.dispose(),!1))}destroy(){this._buffers.forEach(e=>e.dispose()),this._buffers=[]}getBuffer(e){for(const i of this._buffers)if(i.availableCount>=e)return i;if(e>BRe)return null;const r=new n1t(this._rctx,this._fieldCount);return this._buffers.push(r),r}updateTextures(){for(const e of this._buffers)e.textureBuffer.updateTexture()}};const Rhe=J.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");let s1t=class{constructor(e,r){this._renderManager=e,this._viewingMode=r,this._objects=[new Nt,new Nt],this._renderSubmit=new A_t(this),this._renderManager.register(this._renderSubmit),this._hasObjectAndLayerId=se("enable-feature:objectAndLayerId-rendering"),this._componentBufferManager=new VRe(e.rctx,2+(this._hasObjectAndLayerId?1:0))}destroy(){Je(this._objects[eS.Hidden].length===0&&this._objects[eS.Visible].length===0,"ObjectCollection should be empty upon disposal"),this._componentBufferManager.destroy();const e=this._objects.flatMap(r=>r.toArray());for(const r of e)r==null||r.destroy()}createObject(e){const r=new mA;return r.toMapSpace=e.toMapSpace,r.transform=e.transform,r.obb=mhe(e.obb),r.components=new a_t(this._componentBufferManager,zf(e.geometry.componentOffsets)),r.renderable=this._createRenderable(e,r.components),r.intersectionGeometry=new f_t(e.geometry.positionData,r.components),this._objects[r.visible].push(r),r}destroyObject(e){const r=e;this._objects[r.visible].removeUnordered(r),r.destroy(),this._notifyDirty()}setObjectVisibility(e,r){const i=e;r!==i.visible&&(this._objects[i.visible].removeUnordered(i),this._objects[r].push(i),i.visible=r,this._notifyDirty())}preSubmit(e){const r=e.camera.eye;this.visibleObjects.forAll(i=>i.renderable.meta.cameraDepthSquared=wo(r,i.obb.center))}getMaterial(e){return e.renderable.material}updateMaterial(e,r){const i=e.renderable.material;r(i),i.dirty&&this._notifyDirty()}setAllComponentVisibilities(e,r){const i=e;i.components.visibility.reset(r),i.components.visibilityDirty(),this._notifyDirty()}forEachVisibleComponent(e,r){return e.components.visibility.forEachComponent(r)}getComponentCount(e){const r=e,i=r.components.visibility.componentCount();return{visible:i,invisible:r.components.count-i}}setComponentData(e,r){const i=e,n=i.renderable.material,s=i.components,o=s.materialDataBuffer,a=s.materialDataIndices,l=new R_t,c=o.textureBuffer,u=new Uint8Array(4),d=new Uint32Array(u.buffer);let p=0,m=0,y=0,_=s.verticalOffsets,v=1/0,b=-1/0,x=!1,T=!1,S=0;for(let A=0;A0&&S!==d[0]),S=d[0],T||(T=l.elevationOffset!==0),T&&_==null&&(_=new Array(A).fill(0)),_!=null&&(_[A]=l.elevationOffset),v=Math.min(v,l.elevationOffset),b=Math.max(b,l.elevationOffset),IRe(l.elevationOffset,u),c.setData(a[A],1,u[0],u[1],u[2],u[3]);const C=l.objectAndLayerIdColor;C!=null&&c.setData(a[A],2,C[0],C[1],C[2],C[3]),l.pickable!==PRe(s.pickability,A)&&(s.pickability=c_t(s.pickability,s.count,A,l.pickable))}s.verticalOffsets=T?_:null,i.offsetObb=T?n_t(i.obb,v,b,this._viewingMode,i.offsetObb!=null?i.offsetObb:mhe(i.obb)):null,x||T||this._hasObjectAndLayerId?(n.componentParameters=new gA,n.componentParameters.castShadows=Zz(y,s.count),n.componentParameters.transparent=Zz(p,s.count),n.componentParameters.opaqueOverride=Zz(m,s.count),n.componentParameters.texture=c,c.updateTexture()):(n.componentParameters=new OO,n.componentParameters.castShadows=l.castShadows?xs.All:xs.None,n.componentParameters.externalColor=l.externalColor,n.componentParameters.externalColorMixMode=l.externalColorMixMode),this._notifyDirty()}getComponentAabb(e,r,i,n=!1){e.intersectionGeometry.getComponentAabb(r,i);const s=e,o=s.components.verticalOffsets;if(n||o==null)return i;const a=o[r];if(this._viewingMode===$e.Local||a===0)return i[2]+=a,i[5]+=a,i;const l=LZe(a);return l.localOrigin=s.transform.position,l.applyToAabb(i)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,r,i){return e.intersectionGeometry.getComponentPositions(r,i)}intersect(e,r,i,n,s,o){const a=e;s!=null&&(s.localOrigin=a.transform.position);const l=Vw(Phe,a.transform.rotationScale);Ws(cL,r,a.transform.position),Ws(uL,i,a.transform.position),zo(cL,cL,l),zo(uL,uL,l);const c=Uh(Phe,l);return a.intersectionGeometry.intersect(cL,uL,n,c,s,a.components.verticalOffsets,o)}addEdges(e,r,i,n){const s=e,{indices:o,positions:a}=s.intersectionGeometry,l=s.components.offsets;return r.addComponentObject(e,s.transform,{center:s.obb.center,radius:i_t(s.obb)},a,o,l,i,n)}async extractEdgeInformation(e,r,i){const n=e,s=n.components.visibility;if(s.allInvisible())return{buffer:t1t.createBuffer(0),origin:[0,0,0]};const{indices:o,positions:a}=n.intersectionGeometry,l=n.components.offsets,c=aF.createBuffer(a.length/3);iM(c.position.typedBuffer,a,c.position.typedBufferStride,3),dCe(c.position,c.position,n.transform.rotationScale),this._setComponentIndices(c.componentIndex,o,l);const u=c.count,d=this._computeVisibilityIndices(o,s,l,u);return{origin:ki(n.transform.position),buffer:await r.extractComponentsEdgeLocations({indices:d,indicesLength:d.length,skipDeduplicate:!0,data:c,writerSettings:{reducedPrecision:!1,variants:0}},i)}}_setComponentIndices(e,r,i){let n=0;for(let s=0;s(s+=i[c]-i[l],!0));const o=ap(e)?new Array(s):(e==null?void 0:e.BYTES_PER_ELEMENT)===2||n<=65536?new Uint16Array(s):new Uint32Array(s);let a=0;return r.forEachComponentRange((l,c)=>{const u=i[l],d=i[c];for(let p=u;p1)return i.highlightCounts[r]=n-1,void(i.highlightCounts[i.count]=s-1);i.highlightCounts[r]=0,i.highlightsDirty(),this._notifyDirty(),s===1?i.highlightCounts=null:i.highlightCounts[i.count]=s-1}else Rhe.warn("Removing non-existing highlight.")}clearHighlights(e){const r=e.components;r.highlightCounts!=null&&(r.highlightCounts=null,r.highlightsDirty(),this._notifyDirty())}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._objects[eS.Visible]}_createRenderable(e,r){const i=this._renderManager.rctx,n=e.geometry,s=n.vertices.layoutParameters,o=Ar.createVertex(i,gr.STATIC_DRAW,n.vertices.data),a=_h(n.indices,_=>Ar.createIndex(i,gr.STATIC_DRAW,_)),l=Mc(O_t(s)),c=new Uint16Array(n.vertices.count);for(let _=0;_i.scale)),e.vertex.code.add(w`void main(void) { +gl_Position = vec4(position, 0.0, 1.0); +uv0 = position * 0.5 + vec2(0.5); +uv1 = (position * 0.5 + vec2(0.5)) * scale; +}`),e.fragment.uniforms.add(new Ye("tex",i=>i.texture),new Ye("depthTexture",i=>i.depthTexture),new yr("scale",i=>i.scale),new yr("clampUV",i=>l1t(i)));const r=t.haze;return e.fragment.code.add(w` + void main() { + ${r?w`vec4`:w`float`} depthSample = texture(depthTexture, uv0) ${r?"":w`.r`}; + if (depthSample ${r?w`== vec4(0)`:w`!= 1.0`} ) { + fragColor = vec4(0); + return; + } + fragColor = texture(tex, min(uv1, clampUV)); + } + `),e}function l1t(t){if(!t.texture)return Mhe;const e=er(Mhe,t.texture.descriptor.width,t.texture.descriptor.height),r=UZ(e,e,t.scale),i=Wwe(r,r);return Zwe(i,t.scale,i)}const Mhe=Ne(),c1t=Object.freeze(Object.defineProperty({__proto__:null,AtmosphereCompositingPassParameters:GRe,build:a1t},Symbol.toStringTag,{value:"Module"}));let jRe=class HRe extends Tr{initializeProgram(e){return new vr(e.rctx,HRe.shader.get().build(this.configuration),fr)}initializePipeline(){return this.configuration.haze?Ot({blending:So(ve.ONE,ve.ZERO,ve.ONE_MINUS_SRC_COLOR,ve.ONE),depthTest:{func:Hr.ALWAYS},colorWrite:Ft}):Ot({blending:Cc(ve.SRC_ALPHA,ve.ONE_MINUS_SRC_ALPHA),depthTest:{func:Hr.ALWAYS},colorWrite:Ft})}};jRe.shader=new _r(c1t,()=>ce(()=>import("./AtmosphereCompositing.glsl-69a14b5e.js"),[]));let WRe=class extends Wr{constructor(){super(...arguments),this.opacity=1}};function u1t(t){const e=new mr;return e.include(Vh),e.fragment.uniforms.add(new Ye("tex",r=>r.texture)),t.hasOpacityFactor&&e.fragment.uniforms.add(new Ce("opacity",r=>r.opacity)),e.fragment.code.add(w` + void main() { + fragColor = texture(tex, uv) ${t.hasOpacityFactor?"* opacity":""}; + }`),e}const h1t=Object.freeze(Object.defineProperty({__proto__:null,CompositingPassParameters:WRe,build:u1t},Symbol.toStringTag,{value:"Module"}));var ca;(function(t){t[t.None=0]="None",t[t.Alpha=1]="Alpha",t[t.PremultipliedAlpha=2]="PremultipliedAlpha",t[t.COUNT=3]="COUNT"})(ca||(ca={}));let GW=class extends va{constructor(){super(...arguments),this.alphaMode=ca.None,this.hasOpacityFactor=!1}};h([U({count:ca.COUNT})],GW.prototype,"alphaMode",void 0),h([U()],GW.prototype,"hasOpacityFactor",void 0);let qRe=class XRe extends Tr{initializeProgram(e){return new vr(e.rctx,XRe.shader.get().build(this.configuration),fr)}initializePipeline(){switch(this.configuration.alphaMode){case ca.None:return Ot({colorWrite:Ft});case ca.Alpha:return Ot({blending:So(ve.SRC_ALPHA,ve.ONE,ve.ONE_MINUS_SRC_ALPHA,ve.ONE_MINUS_SRC_ALPHA),colorWrite:Ft});case ca.PremultipliedAlpha:case ca.COUNT:return Ot({blending:Cc(ve.ONE,ve.ONE_MINUS_SRC_ALPHA),colorWrite:Ft})}}};qRe.shader=new _r(h1t,()=>ce(()=>import("./Compositing.glsl-2c5c8d4d.js"),[]));let YRe=class extends Wr{};function d1t(){const t=new mr;return t.include(Vh),t.fragment.uniforms.add(new Ye("tex",e=>e.texture)),t.fragment.code.add(w`void main() { +fragColor = vec4(1.0 - texture(tex, uv).a); +}`),t}const p1t=Object.freeze(Object.defineProperty({__proto__:null,HUDCompositingPassParameters:YRe,build:d1t},Symbol.toStringTag,{value:"Module"}));let ZRe=class QRe extends Tr{initializeProgram(e){return new vr(e.rctx,QRe.shader.get().build(),fr)}initializePipeline(){return Ot({colorWrite:{r:!1,g:!0,b:!1,a:!1}})}};ZRe.shader=new _r(p1t,()=>ce(()=>import("./HUDCompositing.glsl-67260826.js"),[]));let JRe=class extends Wr{};function f1t(){const t=new mr;return t.include(Vh),t.fragment.uniforms.add(new Ye("colorTexture",e=>e.colorTexture),new Ye("alphaTexture",e=>e.alphaTexture),new Ye("frontFaceTexture",e=>e.frontFaceTexture)),t.fragment.code.add(w`void main() { +vec4 srcColor = texture(colorTexture, uv); +if(srcColor.a <= 1e-5){ +discard; +} +float srcAlpha = texture(alphaTexture, uv).r; +vec4 frontFace = texture(frontFaceTexture, uv); +fragColor = vec4(mix(srcColor.rgb/srcColor.a, frontFace.rgb, frontFace.a), 1.0 - srcAlpha); +}`),t}const m1t=Object.freeze(Object.defineProperty({__proto__:null,OITCompositingPassParameters:JRe,build:f1t},Symbol.toStringTag,{value:"Module"}));let KRe=class ePe extends Tr{initializeProgram(e){return new vr(e.rctx,ePe.shader.get().build(),fr)}initializePipeline(){return Ot({blending:So(ve.SRC_ALPHA,ve.ONE,ve.ONE_MINUS_SRC_ALPHA,ve.ONE_MINUS_SRC_ALPHA),colorWrite:Ft})}};KRe.shader=new _r(m1t,()=>ce(()=>import("./OITCompositing.glsl-858510ff.js"),[]));let tPe=class extends Wr{constructor(){super(...arguments),this.overlayIndex=Oi.INNER,this.opacity=1}};function g1t(){const t=new mr;return t.include(Vh),t.fragment.uniforms.add(new Ye("tex",e=>e.texture)),t.fragment.uniforms.add(new QP("overlayIdx",e=>e.overlayIndex)),t.fragment.uniforms.add(new Ce("opacity",e=>e.opacity)),t.fragment.code.add(w`void main() { +vec2 overlayUV = overlayIdx == 0 ? vec2(uv.x * 0.5, uv.y) : vec2(uv.x * 0.5 + 0.5, uv.y); +fragColor = texture(tex, overlayUV) * opacity; +}`),t}const y1t=Object.freeze(Object.defineProperty({__proto__:null,OverlayCompositingPassParameters:tPe,build:g1t},Symbol.toStringTag,{value:"Module"}));let rPe=class iPe extends Tr{initializeProgram(e){return new vr(e.rctx,iPe.shader.get().build(),fr)}initializePipeline(){return Ot({blending:Cc(ve.ONE,ve.ONE_MINUS_SRC_ALPHA),colorWrite:Ft})}};rPe.shader=new _r(y1t,()=>ce(()=>import("./OverlayCompositing.glsl-cf0d34dd.js"),[]));let _1t=class{constructor(e,r){this._rctx=e,this._techniqueRepository=r,this._configuration=new GW,this._atmosphereConfiguration=new t5,this._passParameters=new WRe,this._atmosphereParameters=new GRe,this._oitParameters=new JRe,this._hudParameters=new YRe,this._overlayParameters=new tPe}destroy(){this._vao=Le(this._vao)}compositeOIT(e,r,i,n){this._oitParameters.colorTexture=r,this._oitParameters.alphaTexture=i,this._oitParameters.frontFaceTexture=n;const s=this._rctx,o=this._techniqueRepository.acquire(KRe);s.bindTechnique(o,this._oitParameters,e);const a=this._ensureVAO();s.bindVAO(a),s.drawArrays(Et.TRIANGLE_STRIP,0,No(a,"geometry")),o.release()}compositeHUD(e,r){this._hudParameters.texture=r;const i=this._rctx,n=this._techniqueRepository.acquire(ZRe);i.bindTechnique(n,this._hudParameters,e);const s=this._ensureVAO();i.bindVAO(s),i.drawArrays(Et.TRIANGLE_STRIP,0,No(s,"geometry")),n.release()}compositeOverlay(e,r,i,n){this._overlayParameters.texture=r,this._overlayParameters.opacity=i,this._overlayParameters.overlayIndex=n;const s=this._rctx,o=this._techniqueRepository.acquire(rPe);s.bindTechnique(o,this._overlayParameters,e);const a=this._ensureVAO();s.bindVAO(a),s.drawArrays(Et.TRIANGLE_STRIP,0,No(a,"geometry")),o.release()}compositeAtmosphere(e,r,i,n,s){const o=this._rctx;this._atmosphereParameters.texture=r,this._atmosphereParameters.depthTexture=i,this._atmosphereParameters.scale=n,this._atmosphereConfiguration.haze=s;const a=this._techniqueRepository.acquire(jRe,this._atmosphereConfiguration);o.bindTechnique(a,this._atmosphereParameters,e);const l=this._ensureVAO();o.bindVAO(l),o.drawArrays(Et.TRIANGLE_STRIP,0,No(l,"geometry")),a.release()}composite(e,r,i=ca.None,n=1){const s=this._rctx;this._configuration.alphaMode=i,this._configuration.hasOpacityFactor=n!==1,this._passParameters.texture=r,this._passParameters.opacity=n;const o=this._techniqueRepository.acquire(qRe,this._configuration);s.bindTechnique(o,this._passParameters,e);const a=this._ensureVAO();s.bindVAO(a),s.drawArrays(Et.TRIANGLE_STRIP,0,No(a,"geometry")),o.release()}_ensureVAO(){return this._vao==null&&(this._vao=Dl(this._rctx)),this._vao}};const v1t=1e4,jW=100,b1t=500,w1t=500,x1t=.1;function T1t(t,e,r){return rJ(e,t)*(r[1]-r[0])+r[0]}function S1t(t,e,r){let i=0;if(!e.some(s=>(i+=s.numGeometries,i>=v1t)))return $1t.compute(t,e);const n=nM();return r.forAll(s=>{s.visible&&iE(n,E1t(t,s))}),n}function E1t(t,e){if(!e.visible)return;const r=nM(),i=e.getSpatialQueryAccelerator();return i!=null?C1t(r,t,i):A1t(r,t,e.objects),r}function C1t(t,e,r){const i=e.eye,n=e.viewForward,s=e.frustum,o=l=>l.visible,a=r.objectCount;if(a{HW(t,e,l),ih.far=t.near,c.setRange(ih)},s,o),WR(ih,Math.max(t.far,e.near),e.far),r.forEachInDepthRange(i,n,Xd.DepthOrder.BACK_TO_FRONT,ih,(l,c)=>{HW(t,e,l),ih.near=t.far,c.setRange(ih)},s,o);else{const l=Math.max(Math.min(a,w1t),Math.ceil(a*x1t)),c=r.findClosest(n,Xd.DepthOrder.FRONT_TO_BACK,s,o,l),u=r.findClosest(n,Xd.DepthOrder.BACK_TO_FRONT,s,o,l);c&&u&&($he(t,e,c.boundingVolumeWorldSpace.bounds),$he(t,e,u.boundingVolumeWorldSpace.bounds))}}function A1t(t,e,r){Jx.clear(),r.forAll(i=>{i.visible&&i.geometries.length!==0&&Jx.add(i)}),Jx.empty||(Jx.sort(e),WR(ih,e.near,Math.min(t.near,e.far)),Jx.forEachInDepthRange(ih,Xd.DepthOrder.FRONT_TO_BACK,(i,n)=>{n{t.far=Math.max(t.far,s)}))}function HW(t,e,r){if(!r.visible||!h_(e.frustum,r.boundingVolumeWorldSpace.bounds))return;const i=r.transformation,n=M1t;r.geometries.forEach(s=>{Vr(n,i,s.shaderTransformation);const o=MS(n);nPe(t,e,s.boundingInfo,n,o)})}function nPe(t,e,r,i,n){if(r==null)return;De(Ba,r.center,i);const{eye:s,viewForward:o}=e,a=o[0]*(Ba[0]-s[0])+o[1]*(Ba[1]-s[1])+o[2]*(Ba[2]-s[2]);if(Ba[3]=r.radius*n,!(a-Ba[3]>t.near&&a+Ba[3]jW&&r.getChildren())for(const l of r.getChildren())nPe(t,e,l,i,n);else WW.unionDepthRangeWithAABB(t,e.viewProjectionMatrix,i,r.bbMin,r.bbMax)}function $he(t,e,r){const i=e.eye,n=e.viewForward,s=(r[0]-i[0])*n[0]+(r[1]-i[1])*n[1]+(r[2]-i[2])*n[2];t.near=Math.min(t.near,s-r[3]),t.far=Math.max(t.far,s+r[3])}let O1t=class{constructor(){this._items=new Nt({allocator:e=>e||{obj:null,distance:0,near:0,far:0},deallocator:e=>(e.obj=null,e.distance=0,e.near=0,e.far=0,e)})}get length(){return this._items.length}get empty(){return this._items.length===0}clear(){this._items.clear()}add(e){this._items.pushNew().obj=e}sort(e){const r=e.eye,i=e.viewForward;this._items.forAll(n=>{const s=n.obj.boundingVolumeWorldSpace.bounds,o=(s[0]-r[0])*i[0]+(s[1]-r[1])*i[1]+(s[2]-r[2])*i[2];n.distance=o,n.near=o-s[3],n.far=o+s[3]}),this._items.sort((n,s)=>n.distance-s.distance)}forEachInDepthRange(e,r,i){if(r===Xd.DepthOrder.FRONT_TO_BACK)for(let n=0;ne.far||i(s.obj,s.near,s.far)}else for(let n=this._items.length-1;n>=0;--n){const s=this._items.data[n];s.fare.far||i(s.obj,s.near,s.far)}}},R1t=class{constructor(){this._view=_e(),this._viewProj=_e(),this._frustum=TR(),this._geometries=new Array,this._near=[],this._far=[],this._nearCandidates=[],this._farCandidates=[],this._looseRange={near:0,far:0}}compute(e,r){this._reset(),In(this._view,e.viewMatrix),Vr(this._viewProj,e.projectionMatrix,this._view),s5(this._frustum,e.frustum);const i=this._view,n=i[2],s=i[6],o=i[10],a=i[14];r.forAll(p=>p.forEachGeometry(m=>{if(!m.visible||!m.castShadow)return;const y=m.boundingSphere,_=n*y[0]+s*y[1]+o*y[2]+a,v=_-y[3],b=_+y[3];this._geometries.push(m),this._near.push(-b),this._far.push(-v)}));const l=new v_t;if(this._geometries.length===0)return l;for(let p=0;pl.far&&(l.far=this._near[p]),this._near[p]>2&&this._far[p]=c.near?l.near=this._near[p]:this._nearCandidates[u++]=p),this._far[p]>l.far&&(this._far[p]<=c.far?l.far=this._far[p]:this._farCandidates[d++]=p);if(this._nearCandidates.length===0&&this._farCandidates.length===0)return l;this._nearCandidates.sort((p,m)=>this._near[p]this._near[m]?1:0),this._farCandidates.sort((p,m)=>this._far[p]this._far[m]?-1:0);for(let p=0;pl.far){const y=this._geometries[m],_=y.boundingInfo;this._includeFarBoundingInfoRec(_,y.shaderTransformation,l)}}return this._reset(),l}_reset(){this._geometries.length=0,this._near.length=0,this._far.length=0,this._nearCandidates.length=0,this._farCandidates.length=0}_includeNearBoundingInfoRec(e,r,i){if(e==null)return;const n=e.center;De(Ba,n,r);const s=MS(r),o=Ba[0],a=Ba[1],l=Ba[2],c=e.radius*s,u=this._frustum;if(u[0][0]*o+u[0][1]*a+u[0][2]*l+u[0][3]>c||u[1][0]*o+u[1][1]*a+u[1][2]*l+u[1][3]>c||u[2][0]*o+u[2][1]*a+u[2][2]*l+u[2][3]>c||u[3][0]*o+u[3][1]*a+u[3][2]*l+u[3][3]>c)return;const d=this._view[2]*o+this._view[6]*a+this._view[10]*l+this._view[14],p=d+c;if(!(-(d-c)<2||-p>=i.near))if(-p>this._looseRange.near)i.near=-p;else{if(c>jW){const m=e.getChildren();if(m!==void 0){for(const y of m)this._includeNearBoundingInfoRec(y,r,i);return}}WW.unionDepthRangeWithAABB(i,this._viewProj,r,e.bbMin,e.bbMax)}}_includeFarBoundingInfoRec(e,r,i){if(e==null)return;let n=e.radius;const s=e.center;De(Ba,s,r);const o=MS(r),a=Ba[0],l=Ba[1],c=Ba[2];n*=o;const u=this._frustum;if(u[0][0]*a+u[0][1]*l+u[0][2]*c+u[0][3]>n||u[1][0]*a+u[1][1]*l+u[1][2]*c+u[1][3]>n||u[2][0]*a+u[2][1]*l+u[2][2]*c+u[2][3]>n||u[3][0]*a+u[3][1]*l+u[3][2]*c+u[3][3]>n)return;const d=this._view[2]*a+this._view[6]*l+this._view[10]*c+this._view[14]-n;if(!(-d<=i.far))if(-djW){const p=e.getChildren();if(p!==void 0){for(const m of p)this._includeFarBoundingInfoRec(m,r,i);return}}WW.unionDepthRangeWithAABB(i,this._viewProj,r,e.bbMin,e.bbMax)}}},P1t=class{constructor(){this._modelViewProj=_e(),this._clipPosition=[Qt(),Qt(),Qt(),Qt(),Qt(),Qt(),Qt(),Qt()]}unionDepthRangeWithAABB(e,r,i,n,s){const o=this._modelViewProj;Vr(o,r,i);let a=!1;for(let l=0;l<8;++l){const c=this._clipPosition[l],u=l===0||l===3||l===4||l===7?n[0]:s[0],d=l===0||l===1||l===4||l===5?n[1]:s[1],p=l<4?n[2]:s[2];c[0]=o[0]*u+o[4]*d+o[8]*p+o[12],c[1]=o[1]*u+o[5]*d+o[9]*p+o[13],c[2]=o[2]*u+o[6]*d+o[10]*p+o[14],c[3]=o[3]*u+o[7]*d+o[11]*p+o[15]}for(let l=0;l<12;++l){const c=this._clipPosition[Qz[l][0]],u=this._clipPosition[Qz[l][1]],d=this._clipPosition[Qz[l][2]],p=this._clipTriangle(c,u,d);let m=!0;for(let y=0;y=2){m=!1;break}if(!m){a=!0;for(let y=0;y=-e[3]:r===1?e[1]>=-e[3]:r===2?e[0]<=e[3]:r===3?e[1]<=e[3]:void Je(!1)}_intersect(e,r,i){let n=0;return i===0?n=(-e[3]-e[0])/(r[0]-e[0]+r[3]-e[3]):i===1?n=(-e[3]-e[1])/(r[1]-e[1]+r[3]-e[3]):i===2?n=(e[3]-e[0])/(r[0]-e[0]-r[3]+e[3]):i===3&&(n=(e[3]-e[1])/(r[1]-e[1]-r[3]+e[3])),dY(Qt(),e,r,n)}_clipTriangle(e,r,i){let n=[e,r,i];for(let s=0;s<4;++s){const o=n;n=[];for(let a=0;aN1t(e,r))),t.varyings.add("vUV","vec2"),t.vertex.code.add(w`void main(void) { +vUV = position; +gl_Position = vec4(drawPosition.xy + vec2(position - 0.5) * drawPosition.zw, 0.0, 1.0); +}`),t.fragment.uniforms.add(new Ye("textureInput",e=>e.textures.input)),t.fragment.uniforms.add(new Ye("textureMask",e=>e.textures.mask)),t.fragment.uniforms.add(new Ye("textureOverlay",e=>e.textures.overlay)),t.fragment.uniforms.add(new kf("maskEnabled",e=>e.magnifier.maskEnabled)),t.fragment.uniforms.add(new kf("overlayEnabled",e=>e.magnifier.overlayEnabled)),t.fragment.code.add(w`const float barrelFactor = 1.1; +vec2 barrel(vec2 uv) { +vec2 uvn = uv * 2.0 - 1.0; +if (uvn.x == 0.0 && uvn.y == 0.0) { +return vec2(0.5, 0.5); +} +float theta = atan(uvn.y, uvn.x); +float r = pow(length(uvn), barrelFactor); +return r * vec2(cos(theta), sin(theta)) * 0.5 + 0.5; +} +void main() { +float mask = maskEnabled ? texture(textureMask, vUV).a : 1.0; +vec4 inputColor = texture(textureInput, barrel(vUV)) * mask; +vec4 overlayColor = overlayEnabled ? texture(textureOverlay, vUV) : vec4(0); +fragColor = overlayColor + (1.0 - overlayColor.a) * inputColor; +}`),t}function N1t(t,e){const r=e.camera.pixelRatio,i=t.magnifier.offset.x*r,n=t.magnifier.offset.y*r;wf(t.magnifier.position,Ihe);const s=e.camera.screenToRender(Ihe,F1t),o=Math.ceil(r*t.magnifier.size),a=e.camera.fullWidth,l=e.camera.fullHeight;return gi(U1t,(s[0]+i)/a*2-1,(s[1]-n)/l*2-1,o/a*2,o/l*2)}const Ihe=Xi(),F1t=f1e(),U1t=Qt();async function k1t(t){const e=ce(()=>import("./mask-svg-023bbc42.js"),[]),r=ce(()=>import("./overlay-svg-d62383f3.js"),[]),i=qg((await e).default,{signal:t}),n=qg((await r).default,{signal:t}),s={mask:await i,overlay:await n};return Bt(t),s}let D2=class extends xe{constructor(){super(...arguments),this._handles=new Vi,this._magnifier=null,this._imageSources=null,this._imageLoadTask=null,this._resources=null,this._passParameters=new L1t,this.events=new Bn,this.attributeLocations=new Map([[E.POSITION,0]]),this._tmpScreenPoint=Xi(),this._tmpRenderPoint=f1e()}get updating(){return this._imageSources==null&&this._imageLoadTask!=null&&!this._imageLoadTask.task.finished}get magnifier(){return this._magnifier}set magnifier(e){if(e===this._magnifier)return;this._handles.removeAll(),this._magnifier=e;const r=()=>{this._updateResourceLoading(),this.events.emit("request-render")};this._magnifier!=null&&this._handles.add(ue(()=>_h(this._magnifier,i=>i.version),r)),r()}get enabled(){return this._validMagnifier!=null}get _validMagnifier(){return this._magnifier!=null&&this._magnifier.visible&&this._magnifier.position!=null&&this._magnifier.size>0?this._magnifier:null}get _factor(){return this._magnifier!=null&&this._magnifier.factor||1}destroy(){this._magnifier=null,this._handles.destroy(),this._imageLoadTask!=null&&(this._imageLoadTask.task.abort(),this._imageLoadTask=null),this._disposeResources()}render(e,r){const i=this._validMagnifier;if(i==null)return;const n=r.camera.pixelRatio,s=Math.ceil(n*i.size);if(this._updateResources(e,s),this._resources==null)return;const o=this._passParameters.textures,a=Math.ceil(1/this._factor*s);o.input.resize(a,a),wf(i.position,this._tmpScreenPoint);const l=r.camera.screenToRender(this._tmpScreenPoint,this._tmpRenderPoint),c=r.camera.fullWidth,u=r.camera.fullHeight,d=.5*a,p=.5*a;l[0]=ge(l[0],d,c-d-1),l[1]=ge(l[1],p,u-p-1);const m=Math.floor(l[0]-d),y=Math.floor(l[1]-p),_=this._resources.program;_.bindTexture("textureInput",o.input),e.gl.copyTexImage2D(o.input.descriptor.target,0,o.input.descriptor.pixelFormat,m,y,a,a,0),this._passParameters.magnifier=i,e.useProgram(_),_.bindPass(this._passParameters,r),e.bindVAO(this._resources.vao),e.setPipelineState(this._resources.pipelineState),e.drawArrays(Et.TRIANGLE_STRIP,0,4)}_updateResourceLoading(){const e=this._validMagnifier;if(e==null)return;const r=e.maskUrl,i=e.overlayUrl;this._imageLoadTask==null||this._imageLoadTask.maskUrl===r&&this._imageLoadTask.overlayUrl===i||(this._imageLoadTask.task.abort(),this._imageLoadTask=null,this._imageSources=null),this._imageSources==null&&this._imageLoadTask==null&&(this._imageLoadTask={maskUrl:r,overlayUrl:i,task:hE(async n=>{const s=r==null||i==null?k1t(n):null,o=r!=null?qg(r,{signal:n}):s.then(l=>l.mask),a=i!=null?qg(i,{signal:n}):s.then(l=>l.overlay);this._imageSources={mask:await o,overlay:await a},this._disposeResources(),this.events.emit("request-render")})},this._imageLoadTask.task.promise.then(()=>this.notifyChange("updating"),()=>this.notifyChange("updating")))}_updateResources(e,r){if(!this.enabled)return void this._disposeResources();if(this._resources!=null){if(this._passParameters.textures.size!==r){const n=this._createTextureResources(e,r);if(n==null)return void this._disposeResources();this._disposeTextureResources(this._passParameters.textures),this._passParameters.textures=n}return}const i=this._createTextureResources(e,r);i!=null&&(this._resources={program:this._createProgram(e),vao:Dl(e,GZ,this.attributeLocations,0,1),pipelineState:Ot({blending:Cc(ve.ONE,ve.ONE_MINUS_SRC_ALPHA),depthTest:null,depthWrite:null,colorWrite:Ft})},this._passParameters.textures=i)}_disposeResources(){this._resources!=null&&(this._disposeTextureResources(this._passParameters.textures),this._resources.program.dispose(),this._resources.vao.dispose(),this._resources=null)}_disposeTextureResources(e){e.mask.dispose(),e.overlay.dispose(),e.input.dispose()}_createTextureResources(e,r){if(this._imageSources==null)return null;this._imageSources.overlay.width=r,this._imageSources.overlay.height=r,this._imageSources.mask.width=r,this._imageSources.mask.height=r;const i=new pr;i.internalFormat=Tt.RGBA,i.wrapMode=Pt.CLAMP_TO_EDGE,i.flipped=!0,i.preMultiplyAlpha=!_0e(this._imageSources.overlay.src)||!e.driverTest.svgPremultipliesAlpha.result;const n=new Ct(e,i,this._imageSources.overlay);i.pixelFormat=i.internalFormat=Tt.ALPHA,i.preMultiplyAlpha=!1;const s=new Ct(e,i,this._imageSources.mask);return i.pixelFormat=i.internalFormat=Tt.RGBA,i.flipped=!1,{input:new Ct(e,i),mask:s,overlay:n,size:r}}_createProgram(e){return new vr(e,D1t(),this.attributeLocations)}};h([f()],D2.prototype,"_imageSources",void 0),h([f()],D2.prototype,"_imageLoadTask",void 0),h([f({readOnly:!0})],D2.prototype,"updating",null),D2=h([N("esri/views/3d/webgl-engine/lib/MagnifierHelper")],D2);let z1t=class{constructor(){this.declaredClass="esri.views.3d.webgl-engine.lib.ObjectAndLayerIdRenderHelper",this.colorZero=new ya(new ArrayBuffer(4)),this._uidToRenderColor=new Map,this._colorToUID=new Map,this._layerUidToGraphicsUidToObjectId=new Map,this._layerUidToId=new Map,this._layerUidToPopupEnabled=new Map}setUidToObjectAndLayerId(e,r,i,n,s,o=null,a=null,l=null){if(!(e&&r&&i&&n)||(this._layerUidToId.set(n,i),this._layerUidToPopupEnabled.set(n,s),!s))return;let c=this._layerUidToGraphicsUidToObjectId.get(n);c||(c=new Map,this._layerUidToGraphicsUidToObjectId.set(n,c)),c.set(r,{objectId:e,attributeNodeId:o,attributeIndex:a,subLayerId:l})}getObjectAndLayerIdColor(e){const r=this.getObjectAndLayerIdColorArray(e);return $t(r.get(0,1),r.get(0,2),r.get(0,3),255)}getObjectAndLayerIdColorArray(e){if(!e.layerUid||!e.graphicUid)return this.colorZero;const r=this._layerUidToPopupEnabled.get(e.layerUid);if(r===void 0)return J.getLogger(this).warn("popupEnabled is undefined for layerUid "+e.layerUid),this.colorZero;if(r===!1)return this.colorZero;let i=this._uidToRenderColor.get(e.layerUid);i||(i=new Map,this._uidToRenderColor.set(e.layerUid,i));let n=i.get(e.graphicUid);if(!n){for(;!n;){const o=Math.floor(16777214*Math.random())+1;this._colorToUID.has(o)||(n=o)}if(n>16777215)throw new Error("Object ID Overflow");i.set(e.graphicUid,n),this._colorToUID.set(n,e)}const s=new ArrayBuffer(4);return new DataView(s).setUint32(0,n,!1),new ya(s)}getColorToObjectAndLayerIdMapping(){const e=new Map;for(const[r,i]of this._colorToUID.entries()){const n=this._layerUidToGraphicsUidToObjectId.get(i.layerUid);let s=null;n?(s=n.get(i.graphicUid),s||J.getLogger(this).warn("getColorMapping: no entry found for graphicsId "+i.graphicUid)):J.getLogger(this).warn("getColorMapping: no entry found for layerUid "+i.layerUid);const o=this._layerUidToId.get(i.layerUid);o||J.getLogger(this).warn("no layerId found for uid "+i.layerUid),s&&o&&e.set(r,s.attributeNodeId?{type:"object-and-layer-and-i3s-id",oid:s.objectId,lid:o,attrId:s.attributeNodeId,attrIdx:s.attributeIndex,subLayerId:s.subLayerId}:{type:"object-and-layer-id",oid:s.objectId,lid:o})}return e}};var qR;(function(t){t[t.FrontToBack=0]="FrontToBack",t[t.BackToFront=1]="BackToFront"})(qR||(qR={}));let X0=class{constructor(e,r,i=qR.FrontToBack){this._rctx=e,this._techniqueRepository=r,this._sorting=i,this._draws=new Nt({initialSize:32,allocator:n=>n||{material:null,geometry:null,geometryRanges:null,bindDrawParams:null,depthSquaredHint:0,indexType:0}}),this._previouslyBoundDraw=new Map}submitDraw(e,r,i,n){const s=this._draws.pushNew();s.geometry=r,s.geometryRanges=i,s.material=e,s.depthSquaredHint=n,s.indexType=(r.indexed?r.vao.indexBuffer.indexType:null)??0}prepare(e,r){return this._draws.map(i=>i.material.prepareTechnique(this._techniqueRepository,e,r,i.geometry.parameters))}dispatch(e,r,i){const n=this._rctx;this._previouslyBoundDraw.clear();let s=null;const o=this._draws.length;for(let a=0;a{const n=e*(r.depthSquaredHint-i.depthSquaredHint);return n!==0?n:r.geometry.vao.byteSize-i.geometry.vao.byteSize})}get count(){return this._draws.length}};const hN=new Map;hN.set(Qe.UNSIGNED_BYTE,1),hN.set(Qe.UNSIGNED_SHORT,2),hN.set(Qe.UNSIGNED_INT,4);let B1t=class{constructor(e,r){this.rctx=e,this.shaderTechniqueRepository=r,this.canRender=!0,this._materialPassParameters=new Zgt,this._shadowPassParameters=new Qgt,this._highlightPassParameters=new Jgt,this._systems=new Set,this._passes={materialOpaque:new X0(e,r),materialTransparent:new X0(e,r,qR.BackToFront),materialIntegratedMesh:new X0(e,r),shadowMap:new X0(e,r),highlight:new X0(e,r),highlightIntegratedMesh:new X0(e,r),highlightShadowMap:new X0(e,r),defaultShadowMap:new X0(e,r)}}destroy(){this._context=null,this._systems.clear()}register(e){this._systems.add(e)}prepareRender(e){if(this._systems.size!==0){for(const r of Object.values(this._passes))r.prepareSubmit();this._systems.forEach(r=>r.submit(this._passes,e.bindParameters));for(const r of Object.values(this._passes))r.finishSubmit();this.shaderTechniqueRepository.frameUpdate()}}prepareTechniques(e){return this._systems.size===0?null:(this._configure(e),this._materialPassParameters.output=e.output,this._invoke(e,(r,i)=>r.prepare(i,e.bindParameters)))}render(e,r){this._invoke(e,(i,n)=>i.dispatch(n,e.bindParameters,r))}_invoke(e,r){switch(e.bindParameters.slot){case le.OPAQUE_MATERIAL:switch(e.output){case D.Color:case D.Depth:case D.Normal:case D.ObjectAndLayerIdColor:return r(this._passes.materialOpaque,this._materialPassParameters);case D.Highlight:return r(this._passes.highlight,this._highlightPassParameters);case D.Shadow:return r(this._passes.shadowMap,this._shadowPassParameters);case D.ShadowHighlight:return r(this._passes.highlightShadowMap,this._shadowPassParameters);case D.ShadowExcludeHighlight:return r(this._passes.defaultShadowMap,this._shadowPassParameters)}break;case le.TRANSPARENT_MATERIAL:switch(e.output){case D.Color:case D.Alpha:case D.Depth:case D.Normal:case D.ObjectAndLayerIdColor:return r(this._passes.materialTransparent,this._materialPassParameters)}break;case le.INTEGRATED_MESH:switch(e.output){case D.Color:case D.Depth:case D.Normal:case D.ObjectAndLayerIdColor:return r(this._passes.materialIntegratedMesh,this._materialPassParameters);case D.Highlight:return r(this._passes.highlightIntegratedMesh,this._highlightPassParameters)}}return null}notifyDirty(){this._context.requestRender()}slots(){return[le.OPAQUE_MATERIAL,le.TRANSPARENT_MATERIAL,le.INTEGRATED_MESH]}initializeRenderContext(e){this._context=e}uninitializeRenderContext(){}queryDepthRange(e){const r={near:1/0,far:-1/0};return this._systems.forEach(i=>{const n=i.queryShadowCasterDepthRange(e);n!=null&&iE(r,n,r)}),r}_configure(e){const r=e.output===D.Shadow||e.output===D.ShadowHighlight||e.output===D.ShadowExcludeHighlight?this._shadowPassParameters:e.output===D.Highlight?this._highlightPassParameters:this._materialPassParameters;this._updateParameters(e,r)}_updateParameters(e,r){const i=e.bindParameters.camera,n=i.viewInverseTransposeMatrix;ne(Jz,n[3],n[7],n[11]),Kz.set(Jz),re(r.transformWorldFromViewTH,Kz.high),re(r.transformWorldFromViewTL,Kz.low),re(r.slicePlaneLocalOrigin,Jz),Ac(r.transformViewFromCameraRelativeRS,i.viewMatrix),In(r.transformProjFromView,i.projectionMatrix),r.identifier===pc.Material&&(this._materialPassParameters.transparent=e.bindParameters.slot===le.TRANSPARENT_MATERIAL,this._materialPassParameters.integratedMesh=e.bindParameters.slot===le.INTEGRATED_MESH,Uh(Lhe,r.transformViewFromCameraRelativeRS),Vw(r.transformNormalViewFromGlobal,Lhe))}get needsHighlight(){return this._passes.highlight.count>0||this._passes.highlightIntegratedMesh.count>0}get needsTransparentPass(){return this._passes.materialTransparent.count>0}};const Jz=O(),Lhe=hi(),Kz=new sU;let V1t=class{constructor(){this._step=Fhe,this._dilation=1,this._firstIdleTime=0}frame(e,r){if(r?this._firstIdleTime===0&&(this._firstIdleTime=performance.now()):this._firstIdleTime=0,se("disable-feature:high-quality-idle"))this._dilation=1;else{const n=r?performance.now()-this._firstIdleTime:0;if(n>=Dhe+j1t)return this._step=1/0,void(this._dilation=1);this._dilation=n>=Dhe?H1t:1}const i=ge(e/G1t,Fhe,q1t);this._step===1/0?this._step=i:this._step=this._step*Nhe+i*(1-Nhe)}get value(){return this._step}get timeDilation(){return this._dilation}clear(){this._step=this._firstIdleTime=0}};const G1t=.5,Dhe=12e4,j1t=1e4,H1t=10,Nhe=.9,W1t=30,Fhe=1e3/1,q1t=1e3/W1t,X1t=8.6,Y1t=.4;function Z1t(){const t=new mr,{vertex:e,fragment:r}=t,i=e.code,n=r.code;return t.attributes.add(E.POSITION,"vec2"),t.varyings.add("uv","vec2"),t.attributes.add(E.UV0,"vec2"),e.uniforms.add(new Ye("coverageTex",s=>s.coverageTexture)),i.add(w`void main() { +vec4 cov = texture(coverageTex, uv0); +if (cov.r == 0.0) { +gl_Position = vec4(0.0); +return; +} +gl_Position = vec4(position, 0.0, 1.0); +uv = position.xy * 0.5 + vec2(0.5); +}`),r.uniforms.add(new Ye("tex",s=>s.blurColorTexture),new Ye("origin",s=>s.highlightColorTexture),new Jt("uColor",s=>s.color),new Jt("haloColor",s=>s.haloColor),new Jt("opacities",s=>gi(Q1t,s.haloOpacity,s.haloOpacityOccluded,s.fillOpacity,s.fillOpacityOccluded))),r.constants.add("outlineSize","float",X1t),r.constants.add("blurSize","float",Y1t),n.add(w`void main() { +vec4 blurredHighlightValue = texture(tex, uv); +float highlightIntensity = blurredHighlightValue.a; +if (highlightIntensity == 0.0) { +discard; +} +vec4 origin_color = texture(origin, uv); +float outlineIntensity; +float fillIntensity; +if (blurredHighlightValue.g > blurredHighlightValue.b) { +outlineIntensity = haloColor.w * opacities[1]; +fillIntensity = uColor.w * opacities[3]; +} +else { +outlineIntensity = haloColor.w * opacities[0]; +fillIntensity = uColor.w * opacities[2]; +} +float inner = 1.0 - outlineSize / 9.0; +float outer = 1.0 - (outlineSize + blurSize) / 9.0; +float outlineFactor = smoothstep(outer, inner, highlightIntensity); +float fillFactor = any(notEqual(origin_color, vec4(0.0, 0.0, 0.0, 0.0))) ? 1.0 : 0.0; +float intensity = outlineIntensity * outlineFactor * (1.0 - fillFactor) + fillIntensity * fillFactor; +fragColor = vec4(mix(haloColor.rgb, uColor.rgb, fillFactor), intensity); +}`),t}const Q1t=Qt(),J1t=Object.freeze(Object.defineProperty({__proto__:null,build:Z1t},Symbol.toStringTag,{value:"Module"}));let sPe=class oPe extends Tr{initializeProgram(e){return new vr(e.rctx,oPe.shader.get().build(),fr)}initializePipeline(){return Ot({blending:So(ve.SRC_ALPHA,ve.ONE,ve.ONE_MINUS_SRC_ALPHA,ve.ONE_MINUS_SRC_ALPHA),colorWrite:Ft})}};sPe.shader=new _r(J1t,()=>ce(()=>import("./HighlightApply.glsl-d2c44603.js"),[]));let aPe=class extends Wr{constructor(){super(...arguments),this.blurSize=Ne()}};function K1t(){const t=new mr,{vertex:e,fragment:r}=t,i=e.code,n=r.code;return t.attributes.add(E.POSITION,"vec2"),t.attributes.add(E.UV0,"vec2"),t.varyings.add("blurCoordinate","vec3"),e.uniforms.add(new Ye("coverageTex",s=>s.coverageTexture)),r.uniforms.add(new FJ("blurSize",s=>s.blurSize)),i.add(w`void main() { +gl_Position = vec4(position, 0.0, 1.0); +vec4 cov = texture(coverageTex, uv0); +if (cov.r == 0.0) { +gl_Position = vec4(0.0); +} +blurCoordinate = vec3(gl_Position.xy * 0.5 + vec2(0.5), max(cov.g, cov.b)); +}`),r.uniforms.add(new Eh("tex",s=>s.blurInputTexture)),n.add(w`void main() { +vec2 uv = blurCoordinate.xy; +vec4 center = texture(tex, uv); +if (blurCoordinate.z == 1.0) { +fragColor = center; +} else { +vec4 sum = vec4(0.0); +sum += center * 0.204164; +sum += texture(tex, uv + blurSize * 1.407333) * 0.304005; +sum += texture(tex, uv - blurSize * 1.407333) * 0.304005; +sum += texture(tex, uv + blurSize * 3.294215) * 0.093913; +sum += texture(tex, uv - blurSize * 3.294215) * 0.093913; +fragColor = sum; +} +}`),t}const evt=Object.freeze(Object.defineProperty({__proto__:null,HighlightBlurDrawParameters:aPe,build:K1t},Symbol.toStringTag,{value:"Module"}));let lPe=class cPe extends Tr{initializeProgram(e){return new vr(e.rctx,cPe.shader.get().build(),fr)}initializePipeline(){return Ot({colorWrite:Ft})}};lPe.shader=new _r(evt,()=>ce(()=>import("./HighlightBlur.glsl-8389b4e8.js"),[]));let uPe=class extends Wr{constructor(){super(...arguments),this.invFramebufferDim=Ne()}};function tvt(){const t=new mr,{vertex:e,fragment:r}=t,i=e.code,n=r.code;return t.attributes.add(E.POSITION,"vec2"),i.add(w`void main() { +gl_Position = vec4(vec2(1.0) - position * 2.0, 0.0, 1.0); +}`),r.uniforms.add(new Eh("tex",s=>s.inputTexture)),r.uniforms.add(new FJ("invFramebufferDim",s=>s.invFramebufferDim)),n.add(w`void main() { +vec2 coord = gl_FragCoord.xy * invFramebufferDim; +vec4 value = texture(tex, coord); +float mx = floor(max(value.g, value.b)); +fragColor = vec4(ceil(value.r), mx, mx, 1.0); +}`),t}const rvt=Object.freeze(Object.defineProperty({__proto__:null,HighlightDownsampleDrawParameters:uPe,build:tvt},Symbol.toStringTag,{value:"Module"}));let hPe=class dPe extends Tr{initializeProgram(e){return new vr(e.rctx,dPe.shader.get().build(),fr)}initializePipeline(){return Ot({colorWrite:Ft})}};hPe.shader=new _r(rvt,()=>ce(()=>import("./HighlightDownsample.glsl-b1b35495.js"),[]));let Uhe=class extends Wr{constructor(){super(...arguments),this.color=rm(1,0,1,1),this.haloColor=rm(1,0,1,1),this.haloOpacity=1,this.haloOpacityOccluded=.25,this.fillOpacity=.2,this.fillOpacityOccluded=.05,this.shadowColor=$t(1,0,1,1),this.shadowOpacity=.15,this.occludedShadowOpacity=.075}};const ivt=32;let nvt=class{constructor(e,r){this._techniqueRep=e,this._rctx=r,this._viewportToRestore=Qt(),this._passParameters=new Uhe,this._downsampleDrawParameters=new uPe,this._blurDrawParameters=new aPe,this._grid={coverageMipmap:null,vao:null,verticalCellCount:0,horizontalCellCount:0,cellPixelSize:0,mipmapLevels:0,viewportWidth:0,viewportHeight:0}}_assertResources(){if(this._quadVAO)return;this._quadVAO=Dl(this._rctx);const e=new pr;e.wrapMode=Pt.CLAMP_TO_EDGE,this._blur0Fbo=new hs(this._rctx,e),this._blur1Fbo=new hs(this._rctx,e),this._blurTechnique=this._techniqueRep.acquire(lPe),this._downsampleTechnique=this._techniqueRep.acquire(hPe),this._applyTechnique=this._techniqueRep.acquire(sPe)}dispose(){if(this._blurTechnique=Fi(this._blurTechnique),this._downsampleTechnique=Fi(this._downsampleTechnique),this._applyTechnique=Fi(this._applyTechnique),this._grid.coverageMipmap)for(let e=1;ee.dispose()),this._depthTextures.clear(),this._colorTextures.forEach(e=>e.dispose()),this._colorTextures.clear(),this._fbos.forEach(e=>e.dispose()),this._fbos.clear(),this._activeTargets.clear()}disposeTargetResource(e){const r=e.id;this._activeTargets.has(r)&&(this._activeTargets.delete(r),this._disposeWithFramebuffers(this._depthTextures,r),this._disposeWithFramebuffers(this._colorTextures,r))}_disposeWithFramebuffers(e,r){const i=e.get(r);i&&(this._fbos.forEach((n,s)=>{n.colorTexture!==i&&n.depthStencilAttachment!==i||(n.detachColorTexture(),n.detachDepthStencilTexture(),n.dispose(),this._fbos.delete(s))}),i.dispose(),e.delete(r))}_getDepthTexture(e,r,i){let n=this._depthTextures.get(e.id);if(!n||n.descriptor.width===r&&n.descriptor.height===i||(n.dispose(),n=null),!n){const s=new pr(r,i);s.pixelFormat=Tt.DEPTH_STENCIL,s.dataType=Un.UNSIGNED_INT_24_8,s.samplingMode=At.NEAREST,s.wrapMode=Pt.CLAMP_TO_EDGE,n=new Ct(this._rctx,s),this._depthTextures.set(e.id,n),this._activeTargets.add(e.id)}return n}getAllocatedDepthTexture(e){return this._depthTextures.get(e.id)}getColorTexture(e,r,i){let n=this._colorTextures.get(e.id);if(n&&(n.descriptor.width===r&&n.descriptor.height===i||(n.dispose(),n=lE())),!n){const s=new pr(r,i);s.internalFormat=e.internalFormat,s.dataType=e.dataType,s.samplingMode=e.samplingMode!=null?e.samplingMode:At.LINEAR,s.wrapMode=Pt.CLAMP_TO_EDGE,n=new Ct(this._rctx,s),this._colorTextures.set(e.id,n),this._activeTargets.add(e.id)}return n}getAllocatedColorTexture(e){return this._colorTextures.get(e.id)}registerDepthTarget(e={}){return{id:wc(),...ovt,...e}}registerColorTarget(e={}){return{id:wc(),...svt,...e}}getFramebuffer(e,r,i,n){const s=this._getKey(i,n);let o=this._fbos.get(s);const a=this.getColorTexture(i,e,r),l=n?this._getDepthTexture(n,e,r):void 0;return o?((o.width!==e||o.height!==r||o.colorTexture!==a||o.depthStencilAttachment!==l)&&(o.detachColorTexture(),o.detachDepthStencilTexture(),o.resize(e,r),o.attachColorTexture(a),o.attachDepthStencil(l)),o):(o=new hs(this._rctx,a,l),this._fbos.set(s,o),o)}_getKey(e,r){return`${e.id}_${r?r.id:"X"}_${e.name}${r?"_"+r.name:""}`}get gpuMemoryUsage(){let e=0;const r=new Set,i=n=>{r.has(n)||(r.add(n),e+=n.gpuMemoryUsage)};return this._colorTextures.forEach(i),this._depthTextures.forEach(i),e}},lvt=class{constructor(e,r){this._rctx=e,this._compositingHelper=r,this._mainColorTarget=0,this.width=4,this.height=4,this._background={type:"color",color:[0,0,0,1]},this._renderTargetHelper=new avt(e);const i=this._renderTargetHelper;this._mainColorTargets=[i.registerColorTarget({name:"mainColorTarget0"}),i.registerColorTarget({name:"mainColorTarget1"})],this.frontFaceTarget=i.registerColorTarget({name:"frontFaceTarget"}),this.colorFloatTarget=i.registerColorTarget({name:"colorFloatTarget",dataType:Un.HALF_FLOAT,internalFormat:qe.RGBA16F,samplingMode:At.NEAREST}),this.alphaFloatTarget=i.registerColorTarget({name:"alphaFloatTarget",dataType:Un.HALF_FLOAT,internalFormat:qe.R16F,samplingMode:At.NEAREST}),this.mainDepth=i.registerDepthTarget({name:"mainDepth"}),this.linearDepth=i.registerColorTarget({name:"linearDepth",samplingMode:At.NEAREST}),this.terrainLinearDepth=i.registerColorTarget({name:"terrainLinearDepth"}),this.geometryLinearDepth=i.registerColorTarget({name:"geometryLinearDepth"}),this.normal=i.registerColorTarget({name:"normal"}),this.highlight=i.registerColorTarget({name:"highlight",internalFormat:qe.RGBA4,dataType:Un.UNSIGNED_SHORT_4_4_4_4}),this.hudVisibility=i.registerColorTarget({name:"hudVisibility",internalFormat:qe.RGBA4,dataType:Un.UNSIGNED_SHORT_4_4_4_4}),this.tmpColor=i.registerColorTarget({name:"tmpColor"}),this.tmpDepth=i.registerDepthTarget({name:"tmpDepth"}),this.hudColor=i.registerColorTarget({name:"hudColor"})}dispose(){this._renderTargetHelper.dispose()}set background(e){this._background=e}get background(){return this._background}get currentColorTarget(){return this._mainColorTargets[this._mainColorTarget]}get previousColorTarget(){return this._mainColorTargets[1-this._mainColorTarget]}get framebuffer(){return this.getFramebuffer(this.currentColorTarget,this.mainDepth)}getFramebuffer(e,r){return this._renderTargetHelper.getFramebuffer(this.width,this.height,e,r)}get colorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.currentColorTarget)}get depthTexture(){return this._renderTargetHelper.getAllocatedDepthTexture(this.mainDepth)}get linearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.linearDepth)}get terrainLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.terrainLinearDepth)}get geometryLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.geometryLinearDepth)}get lastFrameColorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.previousColorTarget)}get normalTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.normal)}get highlightTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.highlight)}get hudVisibilityTexture(){return this._getColorTexture(this.hudVisibility)}get tmpColorTexture(){return this._getColorTexture(this.tmpColor)}get hudColorTexture(){return this._getColorTexture(this.hudColor)}get mainColorTexture(){return this._getColorTexture(this.currentColorTarget)}setupRenderTarget(e){e?this._mainColorTarget=this._mainColorTarget?0:1:(this._mainColorTarget=0,this.disposeTarget(this._mainColorTargets[1]))}initializeFrame(e){const r=this._rctx;this.width=e.fullWidth,this.height=e.fullHeight,_b(this,r.parameters.maxTextureSize),this.bindTarget(this.currentColorTarget,this.mainDepth),r.setClearStencil(0);const i=this._background.color;r.setClearColor(i[0]*i[3],i[1]*i[3],i[2]*i[3],i[3]),r.clearSafe(yi.COLOR_BUFFER_BIT|yi.DEPTH_BUFFER_BIT|yi.STENCIL_BUFFER_BIT)}composite(e){this.colorTexture!=null&&this._compositingHelper.composite(e,this.colorTexture,ca.None)}renderTmpAndCompositeToMain(e,r,i,n=!1){this.renderToTargets(e,this.tmpColor,n?this.tmpDepth:this.mainDepth,cvt),this._compositingHelper.composite(r,this._getColorTexture(this.tmpColor),i)}compositeAtmosphereToMain(e,r,i,n){this.bindTarget(this.currentColorTarget),this._compositingHelper.compositeAtmosphere(e,this._renderTargetHelper.getColorTexture(this.tmpColor,this.width,this.height),i,n,r),this.bindTarget(this.currentColorTarget,this.mainDepth)}renderHUDVisibility(e,r=!1){this.renderToTargets(e,this.hudVisibility,r?this.tmpDepth:this.mainDepth,uvt)}compositeTransparentTerrainOntoHUDVisibility(e){this.renderToTargets(()=>this._compositingHelper.compositeHUD(e,this._getColorTexture(this.tmpColor)),this.hudVisibility,this.tmpDepth)}renderOITPass(e,r,i){let n,s;switch(r){case rt.Color:n=this.colorFloatTarget,s=[0,0,0,0];break;case rt.Alpha:n=this.alphaFloatTarget,s=[1,1,1,1];break;case rt.FrontFace:n=this.frontFaceTarget,s=[0,0,0,0];break;case rt.NONE:case rt.COUNT:return}i?this.renderToTargets(e,n,this.tmpDepth,s,!0,!0):this.renderToTargets(e,n,this.mainDepth,s,!1)}compositeTransparentTerrainOntoMain(e){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),ca.PremultipliedAlpha)}compositeOccludedOntoMain(e,r){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),ca.PremultipliedAlpha,r)}compositeTransparentOntoOpaque(e,r){r?(this.bindTarget(this.hudColor,this.tmpDepth),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clearSafe(yi.COLOR_BUFFER_BIT)):this.bindFramebuffer(),this._compositingHelper.compositeOIT(e,this._getColorTexture(this.colorFloatTarget),this._getColorTexture(this.alphaFloatTarget),this._getColorTexture(this.frontFaceTarget))}bindFramebuffer(){this._rctx.bindFramebuffer(this.framebuffer)}renderDepthDetached(e){this.bindTarget(this.currentColorTarget),e(),this.bindTarget(this.currentColorTarget,this.mainDepth)}disposeTarget(e){this._renderTargetHelper.disposeTargetResource(e)}renderToFBO(e,r,i=!1,n=!1){const s=this._rctx;let o=0;if(r){const l=Math.max(1e-13,r[3]);s.setClearColor(r[0],r[1],r[2],l),o|=yi.COLOR_BUFFER_BIT}i&&(o|=yi.DEPTH_BUFFER_BIT),n===!1?n=0:(n===!0&&(n=255),o|=yi.STENCIL_BUFFER_BIT),o&&s.clearSafe(o,n),e(),s.gl.flush(),this.bindTarget(this.currentColorTarget,this.mainDepth)}renderToTargets(e,r,i,n,s=!1,o=!1){const a=this.bindTarget(r,i);return this.renderToFBO(e,n,s,o),a}bindTarget(e,r){const i=this._renderTargetHelper.getFramebuffer(this.width,this.height,e,r);return this._rctx.bindFramebuffer(i),i}_getColorTexture(e){return this._renderTargetHelper.getColorTexture(e,this.width,this.height)}get gpuMemoryUsage(){let e=0;return this._renderTargetHelper&&(e+=this._renderTargetHelper.gpuMemoryUsage),e}};const cvt=[0,0,0,0],uvt=[0,1,0,1];let yA=class extends xe{constructor(e){super({}),this._context=e,this._renderPlugins=new Nt,this._slots=[];for(let r=0;r{if(i!=null&&i.aborted)throw r.uninitializeRenderContext(),wr();this._renderPlugins.push(r);for(const o of e)this._slots[o].push(r);this._context.requestRender()},s=r.initializeRenderContext(this._context,i);if(Eu(s))return s.then(n);n(),this.notifyChange("_renderPlugins")}remove(e){if(this._renderPlugins.removeUnordered(e)!=null){for(let r=0;ri!==e);e.uninitializeRenderContext(),this._context.requestRender(),this.notifyChange("_renderPlugins")}}prepareRender(){this._renderPlugins.forAll(e=>{e.prepareRender&&e.prepareRender(this._context.renderContext)})}updateAnimation(e){let r=!1;return this._renderPlugins.forAll(i=>{i.updateAnimation&&(r=i.updateAnimation(e)||r)}),r}prepareSlots(e){for(const r of e)this._context.renderContext.bindParameters.slot=r,this._slots[r].filter(i=>{i.canRender&&(khe(i)&&i.prepareTechnique(this._context.renderContext),zhe(i)&&i.prepareTechniques(this._context.renderContext))})}render(){const e=this._slots[this._context.renderContext.bindParameters.slot],r=new Array;e.filter(i=>{if(!i.canRender)return!1;if(khe(i)){const n=i.prepareTechnique(this._context.renderContext);return n!=null&&(r.push(n),!0)}if(zhe(i)){const n=i.prepareTechniques(this._context.renderContext);return n!=null&&(r.push(n),!0)}return r.push(null),!0}).forEach((i,n)=>i.render(this._context.renderContext,r[n]))}queryDepthRange(e){const r=hvt;return r.near=1/0,r.far=-1/0,this._renderPlugins.forAll(i=>{if(i.queryDepthRange){const n=i.queryDepthRange(e);n&&iE(r,n,r)}}),r}get updating(){return this._renderPlugins.some(e=>e.running)}get needsTransparentPass(){return this._renderPlugins.some(e=>e.needsTransparentPass)}get needsHighlight(){return this._renderPlugins.some(e=>e.needsHighlight)}get needsLinearDepth(){return this._renderPlugins.some(e=>e.needsLinearDepth)}get needsLaserlineWithContrastControl(){const e=this._slots[le.LASERLINES_CONTRAST_CONTROL];return!!e&&e.length>0}get renderOccludedFlags(){return this._renderPlugins.reduce((e,r)=>e|r.renderOccludedFlags,Ri.None)}};function khe(t){return"prepareTechnique"in t}function zhe(t){return"prepareTechniques"in t}h([f()],yA.prototype,"_renderPlugins",void 0),h([f({readOnly:!0})],yA.prototype,"updating",null),yA=h([N("esri.views.3d.webgl-engine.lib.RenderPluginManager")],yA);const hvt={near:0,far:0};let pPe=class extends LJ{};const oU=255,dvt=1/oU;function pvt(t){const e=new mr,r=e.fragment;return r.include(Pc),r.include(wu),e.include(k8),e.include(Vh),e.include(U8,t),r.uniforms.add(new Ye("depthMap",i=>i.linearDepthTexture),new Mi("inverseViewMatrix",(i,n)=>us(Bhe,Ml(Bhe,n.camera.viewMatrix,n.camera.center))),new yr("nearFar",(i,n)=>n.camera.nearFar)),r.constants.add("sampleValue","float",dvt),r.code.add(w`void main(void) { +float depth = rgba2float(texture(depthMap, uv)); +if (depth == 0.0) { +discard; +} +float currentPixelDepth = linearDepthFromFloat(depth, nearFar); +if (-currentPixelDepth > nearFar.y || -currentPixelDepth < nearFar.x) { +discard; +} +vec4 currentPixelPos = vec4(reconstructPosition(gl_FragCoord.xy, currentPixelDepth), 1.0); +vec4 worldSpacePos = inverseViewMatrix * currentPixelPos; +mat4 shadowMatrix; +float linearDepth = -currentPixelDepth; +int i = chooseCascade(linearDepth, shadowMatrix); +if (i >= numCascades) { +discard; +} +vec3 lvpos = lightSpacePosition(worldSpacePos.xyz, shadowMatrix); +if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { +discard; +} +vec2 uvShadow = cascadeCoordinates(i, lvpos); +float depthShadow = readShadowMapDepth(uvShadow, shadowMapTex); +bool shadow = depthShadow < lvpos.z; +if (!shadow) { +discard; +} +fragColor = vec4(sampleValue); +}`),e}const Bhe=_e(),fvt=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastAccumulatePassParameters:pPe,ShadowCastMaxSamples:oU,build:pvt},Symbol.toStringTag,{value:"Module"}));var Ew;(function(t){t[t.Gradient=0]="Gradient",t[t.Threshold=1]="Threshold",t[t.COUNT=2]="COUNT"})(Ew||(Ew={}));let qW=class extends va{constructor(){super(...arguments),this.visualization=Ew.Gradient,this.bandsEnabled=!1}};h([U({count:Ew.COUNT})],qW.prototype,"visualization",void 0),h([U()],qW.prototype,"bandsEnabled",void 0);let fPe=class extends Wr{constructor(e){super(),this._data=e,this.sampleScale=0,this.opacityFromElevation=1,this.color=PP(mvt),this.bandSize=.1,this.threshold=.5}get shadowCastMap(){return this._data.shadowCastTexture}};const mvt=$t(.01,0,.25,1);function gvt(t){const e=new mr,r=e.fragment;r.include(Pc),r.include(wu),e.include(k8),e.include(Vh);const{visualization:i,bandsEnabled:n}=t;r.constants.add("inverseSampleValue","float",oU),r.uniforms.add(new Ye("shadowCastMap",a=>a.shadowCastMap),new Ce("sampleScale",a=>a.sampleScale),new Ce("opacityFromElevation",a=>a.opacityFromElevation),new Jt("uColor",a=>a.color));const s=i===Ew.Gradient,o=i===Ew.Threshold;return s&&n?r.uniforms.add(new Ce("bandSize",a=>a.bandSize)):o&&r.uniforms.add(new Ce("threshold",a=>a.threshold)),r.code.add(w` + void main(void) { + vec4 record = texture(shadowCastMap, uv); + float pixelSamples = record.r * inverseSampleValue; + if (pixelSamples < 1.0) { + discard; + } + + float strength = pixelSamples * sampleScale; + + ${o?w` + if (strength <= threshold) { + discard; + }`:""} + + ${s&&n?w`strength = ceil(strength / bandSize) * bandSize;`:""} + + fragColor = vec4(uColor.xyz, uColor.a * opacityFromElevation ${s?w`* strength`:""}); + } + `),e}const yvt=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastVisualizePassParameters:fPe,build:gvt},Symbol.toStringTag,{value:"Module"}));let mPe=class gPe extends Tr{constructor(e,r){super(e,r,()=>this.destroy())}initializeProgram(e){return new vr(e.rctx,gPe.shader.get().build(this.configuration),fr)}initializePipeline(){return Ot({blending:fu,colorWrite:Ft,depthTest:null,depthWrite:null})}get primitiveType(){return Et.TRIANGLE_STRIP}};mPe.shader=new _r(yvt,()=>ce(()=>import("./ShadowCastVisualize.glsl-2c61efe0.js"),[]));const _vt=4e4,vvt=5e4,yPe=1/512;let dN=class extends xe{constructor(e,r,i,n){super({}),this._techniqueRepository=e,this._rctx=r,this._data=i,this._requestRender=n,this._passParameters=new fPe(this._data),this._techniqueConfig=new qW,this._enabled=!1,this._vao=Dl(r),this._techniqueConfig.visualization=Ew.Gradient}normalizeCtorArgs(){return{}}dispose(){this._stop(),this._vao=Le(this._vao),this._techniqueRepository.release(this._technique),this._technique=null}get _visualizeShadowCastTechnique(){return this._technique=this._techniqueRepository.releaseAndAcquire(mPe,this._techniqueConfig,this._technique),this._technique}render(e){if(!this._showVisualization)return;this._passParameters.sampleScale=1/this._data.computedSamples;const r=this._visualizeShadowCastTechnique;this._rctx.bindVAO(this._vao),this._rctx.bindTechnique(r,this._passParameters,e),this._rctx.drawArrays(r.primitiveType,0,No(this._vao,"geometry"))}setOptions(e){e.enabled!==void 0&&this._setEnabled(e.enabled),e.color!==void 0&&this._setColor(e.color),e.threshold!==void 0&&(this._threshold=e.threshold),e.visualization!==void 0&&(this._visualization=e.visualization),e.bandSize!==void 0&&(this._bandSize=e.bandSize),e.bandsEnabled!==void 0&&(this._bandsEnabled=e.bandsEnabled)}get opacityFromElevation(){return this._passParameters.opacityFromElevation}set opacityFromElevation(e){this._passParameters.opacityFromElevation!==e&&(this._passParameters.opacityFromElevation=e,this.notifyChange("opacityFromElevation"))}get _showVisualization(){return this._enabled&&this._data.computedSamples>0&&this.opacityFromElevation>yPe}get _threshold(){return this._passParameters.threshold}set _threshold(e){this._threshold!==e&&(this._passParameters.threshold=e,this._requestRenderIfRunning())}get _visualization(){return this._techniqueConfig.visualization}set _visualization(e){e!==this._visualization&&(this._techniqueConfig.visualization=e,this._techniqueRepository.release(this._technique),this._technique=null,this._requestRenderIfRunning())}get _bandSize(){return this._passParameters.bandSize}set _bandSize(e){e!==this._bandSize&&(this._passParameters.bandSize=e,this._requestRenderIfRunning())}get _bandsEnabled(){return this._techniqueConfig.bandsEnabled}set _bandsEnabled(e){e!==this._bandsEnabled&&(this._techniqueConfig.bandsEnabled=e,this._techniqueRepository.release(this._technique),this._technique=null,this._requestRenderIfRunning())}_setColor(e){const r=this._passParameters.color;LT(e,r)||(vh(this._passParameters.color,e),this._requestRenderIfRunning())}_setEnabled(e){e!==this._enabled&&(e?this._start():this._stop())}_requestRenderIfRunning(){this._enabled&&this._requestRender()}_start(){this._enabled=!0,this._requestRender()}_stop(){this._enabled=!1,this._requestRender()}};h([f()],dN.prototype,"opacityFromElevation",null),dN=h([N("esri.views.3d.webgl-engine.lib.ShadowCastRenderer")],dN);let MK=class extends va{constructor(){super(...arguments),this.receiveShadows=!0}};h([U()],MK.prototype,"receiveShadows",void 0);let _Pe=class vPe extends Tr{constructor(e){super(e,new MK,()=>this.destroy())}initializeProgram(e){return new vr(e.rctx,vPe.shader.get().build(this.configuration),fr)}initializePipeline(){return Ot({blending:So(ve.ONE,ve.ONE,ve.ONE,ve.ONE),colorWrite:Ft,depthTest:null,depthWrite:null})}get primitiveType(){return Et.TRIANGLE_STRIP}};_Pe.shader=new _r(fvt,()=>ce(()=>import("./ShadowCastAccumulate.glsl-15b89038.js"),[]));let gl=class extends xe{constructor(e,r,i,n,s,o){super({}),this._rctx=e,this._stage=i,this._prepareForShadowMapPass=n,this._renderToShadowMap=s,this._requestRender=o,this._progress=0,this._sampleCount=0,this._passParameters=new pPe,this._cachedLightDirections=[],this._depthRange=kW,this._previewing=!1,this._handles=new Vi,this._cameraForcedForScreenshot=!1,this._bindParameters=new e8(new $J(e,i.viewingMode),null,null),this._bindParameters.shadowMap.enabled=!0,this._vao=Dl(e),this._accumulationRenderer=new dN(r,e,this,o);const a=this._stage.view.resourceController.scheduler;this._handles.add([a.registerTask(dt.SHADOW_ACCUMULATOR,this),ue(()=>i.renderView,l=>{this._handles.remove(Vhe),l!=null&&this._handles.add(l.events.on("force-camera-for-screenshot",()=>this._cameraForcedForScreenshot=!0),Vhe)},An),ue(()=>this._previewing,()=>this._requestRenderIfEnabled(),Br)])}normalizeCtorArgs(){return{}}dispose(){this._disable(),this._handles.destroy(),this._accumulationRenderer=Le(this._accumulationRenderer),this._bindParameters.shadowMap.dispose(),this._fbo=Le(this._fbo),this._vao=Le(this._vao),this._accumulationTechniqueCached=Fi(this._accumulationTechniqueCached),this._cachedLightDirections.length=0,this._sampleCount=0}get computedSamples(){return this._progress}get shadowCastTexture(){var e;return(e=this._fbo)==null?void 0:e.colorTexture}get isAccumulating(){return this._isPreviewing||this._isRefining}get _accumulationTechnique(){if(this._accumulationTechniqueCached==null){const e={rctx:this._rctx,viewingMode:this._stage.viewingMode};this._accumulationTechniqueCached=new _Pe(e)}return this._accumulationTechniqueCached}get _isRefining(){return this._isActive&&!this._isDoneAccumulating&&!this._previewing}get _isPreviewing(){return this._isActive&&this._previewing}get _isActive(){return this._fbo!=null&&this._sampleCount>0}get canAccumulate(){return this._passParameters.linearDepthTexture!==null&&this._depthRange!==kW&&this._opacityFromElevation>yPe}get _isDoneAccumulating(){return this._progress>=this._sampleCount}get _lightDirections(){return this._cachedLightDirections}set _lightDirections(e){const r=this._cachedLightDirections;if(Hf(r,e,N_))return;const i=Math.min(oU,e.length);r.length=i,this._sampleCount=i;for(let n=0;n0}runTask(e){for(this._prepareForShadowMapPass(this._bindParameters);!e.done&&!this._isDoneAccumulating;)this._accumulateShadow(),e.madeProgress();this._requestRender()}renderAccumulation(e,r,i,n){if(this._depthRange=r,this._updateCamera(i),this._bindParameters.contentCamera=n,this._passParameters.linearDepthTexture=e,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!this.isAccumulating||!this.canAccumulate)return;(this._previewing||this._progress===0||this._cameraForcedForScreenshot)&&this._clear();const s=this._cameraForcedForScreenshot?this._sampleCount:Math.min(bvt,this._sampleCount-this._progress);for(let o=0;o=this._fbo.width||r<0||r>=this._fbo.height?0:(this._fbo.readPixels(e,r,1,1,Tt.RGBA,Un.UNSIGNED_BYTE,Ghe),Ghe[0]/this._progress)}_enable(){this._progress=0;const e=new pr;e.wrapMode=Pt.CLAMP_TO_EDGE,this._fbo=new hs(this._rctx,e)}_disable(){this._fbo=Le(this._fbo)}_invalidate(){this._progress=0,this._requestRenderIfEnabled()}_clear(){this._rctx.bindFramebuffer(this._fbo),this._rctx.setClearColor(0,0,0,0),this._rctx.clearSafe(yi.COLOR_BUFFER_BIT),this._progress=0}_accumulateShadow(){this._renderToShadowMap(this._bindParameters,this._sampleLightDirection(),this._depthRange);const e=this._accumulationTechnique;this._rctx.bindFramebuffer(this._fbo),this._rctx.bindTechnique(e,this._passParameters,this._bindParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(e.primitiveType,0,No(this._vao,"geometry"))}_sampleLightDirection(){return this._progress++,this._lightDirections[this._progress*wvt%this._lightDirections.length]}_updateCamera(e){!e.equals(this._bindParameters.camera)&&this._fbo&&(this._bindParameters.camera.copyFrom(e),this._fbo.resize(e.fullWidth,e.fullHeight),this._opacityFromElevation=1-nR(_vt,vvt,e.relativeElevation))}_requestRenderIfEnabled(){this._fbo&&this._requestRender()}get test(){const e=this;return{lightDirections:this._lightDirections,get isDone(){return e._isDoneAccumulating},get isActive(){return e._isActive}}}};h([f()],gl.prototype,"_progress",void 0),h([f()],gl.prototype,"_sampleCount",void 0),h([f()],gl.prototype,"_fbo",void 0),h([f()],gl.prototype,"_depthRange",void 0),h([f()],gl.prototype,"_previewing",void 0),h([f()],gl.prototype,"_accumulationRenderer",void 0),h([f()],gl.prototype,"_isRefining",null),h([f()],gl.prototype,"_isActive",null),h([f()],gl.prototype,"canAccumulate",null),h([f()],gl.prototype,"_isDoneAccumulating",null),h([f()],gl.prototype,"_opacityFromElevation",null),h([f()],gl.prototype,"running",null),gl=h([N("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],gl);const bvt=6,Vhe="renderView",wvt=104729,Ghe=new Uint8Array(4),jhe={highlightedThreshold:.99999,selfShadowThreshold:.025};function xvt(t){const e=new mr;e.include(vw,t);const r=e.fragment;return r.include(Pc),r.include(wu),e.include(k8),e.include(Vh),r.uniforms.add(new Ye("defaultDepthTex",(i,n)=>n.shadowMap.getSnapshot(JS.Default)),new Ye("highlightDepthTex",(i,n)=>n.shadowMap.getSnapshot(JS.Highlight)),new Ye("depthMap",(i,n)=>n.linearDepthTexture),new Ye("highlightMap",(i,n)=>n.highlightColorTexture),new Jt("uColor",i=>i.shadowColor),new yr("nearFar",(i,n)=>n.camera.nearFar),new Ce("opacity",i=>i.shadowOpacity),new Ce("occludedOpacity",i=>i.occludedShadowOpacity),new Ce("terminationFactor",i=>i.opacityElevation*i.dayNightTerminator),new Lt("lightingMainDirectionView",(i,n)=>me(Whe,De(Whe,n.lighting.mainLight.direction,n.camera.viewInverseTransposeMatrix))),new yr("texelSize",(i,n)=>n.linearDepthTexture!=null?er(Tvt,1/n.linearDepthTexture.descriptor.width,1/n.linearDepthTexture.descriptor.height):dp),new Mi("inverseViewMatrix",(i,n)=>us(Hhe,Ml(Hhe,n.camera.viewMatrix,n.camera.center)))),r.constants.add("unoccludedHighlightFlag","vec4",kSe).add("highlightedThreshold","float",jhe.highlightedThreshold).add("selfShadowThreshold","float",jhe.selfShadowThreshold),r.code.add(w`vec3 normalFromDepth(vec3 pixelPos, vec2 fragCoord, vec2 uv, vec2 texelSize, sampler2D depthMap, vec2 nearFar) { +float leftPixelDepth = linearDepthFromTexture(depthMap, uv + vec2(-1.0, 0.0) * texelSize, nearFar); +float rightPixelDepth = linearDepthFromTexture(depthMap, uv + vec2(1.0, 0.0) * texelSize, nearFar); +float bottomPixelDepth = linearDepthFromTexture(depthMap, uv + vec2(0.0, -1.0) * texelSize, nearFar); +float topPixelDepth = linearDepthFromTexture(depthMap, uv + vec2(0.0, 1.0) * texelSize, nearFar); +bool pickLeft = abs(pixelPos.z - leftPixelDepth) < abs(pixelPos.z - rightPixelDepth); +bool pickBottom = abs(pixelPos.z - bottomPixelDepth) < abs(pixelPos.z - topPixelDepth); +vec3 fragCoordHorizontal = pickLeft +? vec3(fragCoord + vec2(-1.0, 0.0), leftPixelDepth) +: vec3(fragCoord + vec2(1.0, 0.0), rightPixelDepth); +vec3 fragCoordVertical = pickBottom +? vec3(fragCoord + vec2(0.0, -1.0), bottomPixelDepth) +: vec3(fragCoord + vec2(0.0, 1.0), topPixelDepth); +vec3 verticalPixelPos = reconstructPosition(fragCoordHorizontal.xy, fragCoordHorizontal.z); +vec3 horizontalPixelPos = reconstructPosition(fragCoordVertical.xy, fragCoordVertical.z); +vec3 normal = normalize(cross(verticalPixelPos - pixelPos, horizontalPixelPos - pixelPos)); +return pickLeft == pickBottom ? normal : -normal; +}`),r.code.add(w`void main(void) { +vec4 highlightInfo = texture(highlightMap, uv); +float visiblyHighlighted = (1.0 - clamp(distance(unoccludedHighlightFlag, highlightInfo), 0.0, 1.0)) * highlightInfo.a; +if (visiblyHighlighted > highlightedThreshold) { +discard; +} +float depth = rgba2float(texture(depthMap, uv)); +if (depth == 0.0) { +discard; +} +float currentPixelDepth = linearDepthFromFloat(depth, nearFar); +if (-currentPixelDepth>nearFar.y || -currentPixelDepth= numCascades) { +discard; +} +vec3 lvpos = lightSpacePosition(worldSpacePos.xyz, shadowMatrix); +if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { +discard; +} +vec2 uvShadow = cascadeCoordinates(i, lvpos); +float depthHighlight = readShadowMapDepth(uvShadow, highlightDepthTex); +bool shadowHighlight = depthHighlight < lvpos.z; +if (!shadowHighlight) { +discard; +} +float depthDefault = readShadowMapDepth(uvShadow, defaultDepthTex); +bool shadowDefault = depthDefault < lvpos.z; +vec3 normal = normalFromDepth(currentPixelPos.xyz, gl_FragCoord.xy, uv, texelSize, depthMap, nearFar); +bool shaded = dot(normal, lightingMainDirectionView) < selfShadowThreshold; +float fragOpacity = (shadowDefault || shaded) ? occludedOpacity : opacity; +fragColor = vec4(uColor.rgb, uColor.a * fragOpacity * terminationFactor); +}`),e}const Hhe=_e(),Whe=O(),Tvt=Ne(),Svt=Object.freeze(Object.defineProperty({__proto__:null,build:xvt},Symbol.toStringTag,{value:"Module"}));let Evt=class extends LJ{constructor(){super(...arguments),this.shadowColor=$t(1,0,1,1),this.shadowOpacity=.2,this.occludedShadowOpacity=.1,this.opacityElevation=1,this.dayNightTerminator=1}},bPe=class wPe extends Tr{constructor(e){super(e,new MK,()=>this.destroy())}initializeProgram(e){return new vr(e.rctx,wPe.shader.get().build(this.configuration),fr)}initializePipeline(){return Ot({blending:So(ve.SRC_ALPHA,ve.ONE,ve.ONE_MINUS_SRC_ALPHA,ve.ONE_MINUS_SRC_ALPHA),colorWrite:Ft,depthTest:null,depthWrite:null})}get primitiveType(){return Et.TRIANGLE_STRIP}};bPe.shader=new _r(Svt,()=>ce(()=>import("./ShadowHighlight.glsl-56ab9734.js"),[]));const Cvt=.001953125,Avt=4e4,Ovt=5e4;let Rvt=class{constructor(e,r){this._rctx=e,this._viewingMode=r,this._maxOpacity=1,this._passParameters=new Evt,this._drawParameters=new Qst,this._vao=Dl(this._rctx)}get _technique(){return this._techniqueCached==null&&(this._techniqueCached=new bPe({rctx:this._rctx,viewingMode:this._viewingMode})),this._techniqueCached}render(e,r){if(!e.shadowMap.enabled||!e.linearDepthTexture||!this.isVisible)return;const i=this._technique;this._drawParameters.origin=e.camera.center,this._rctx.bindFramebuffer(r),this._rctx.bindTechnique(i,this._passParameters,e).bindDraw(this._drawParameters,e,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(i.primitiveType,0,No(this._vao,"geometry"))}get gpuMemoryUsage(){var e;return((e=this._vao)==null?void 0:e.memoryEstimate)??0}setDefaultOptions(e){this._passParameters={...this._passParameters,...e},this._updateMaxOpacity()}updateParameters(e,r){this._passParameters.opacityElevation=1-nR(Avt,Ovt,e.relativeElevation);const i=this._viewingMode===$e.Global?me(qhe,e.center):ne(qhe,0,0,1),n=fe(i,r);this._passParameters.dayNightTerminator=nR(0,1,ge(30*n,0,1))}dispose(){this._vao=Le(this._vao),this._techniqueCached=Fi(this._techniqueCached)}get isVisible(){const{opacityElevation:e,dayNightTerminator:r}=this._passParameters;return this._maxOpacity*e*r>=Cvt}_updateMaxOpacity(){const e=Math.max(this._passParameters.shadowOpacity,this._passParameters.occludedShadowOpacity);this._maxOpacity=e*this._passParameters.shadowColor[3]}};const qhe=O(),Xhe=e0();let Pvt=class{constructor(){this._plane=e0()}get isEnabled(){return!$be(this.plane,Xhe)}get plane(){return this._plane}set plane(e){zw(e||Xhe,this._plane)}},Mvt=class extends Wr{};function XR(t){t.uniforms.add(new Jt("resolution",e=>{const{descriptor:r}=e.colorTexture,i=r.width,n=r.height;return gi($vt,1/i,1/n,i,n)}))}const $vt=Qt(),Kx={maxSearchSteps:8,maxDistanceAreaTex:16};function Ivt(){const t=new mr,{attributes:e,varyings:r,vertex:i,fragment:n}=t;return e.add(E.POSITION,"vec2"),r.add("uv","vec2"),r.add("offsets[2]","vec4"),r.add("maxOffset","vec4"),r.add("pixelCoord","vec2"),XR(i),i.code.add(w` + void main() { + uv = position * 0.5 + vec2(0.5); + gl_Position = vec4(position, 0, 1); + + pixelCoord = uv * resolution.zw; + offsets[0] = uv.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 ); + offsets[1] = uv.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 ); + maxOffset = vec4( offsets[0].xz, offsets[1].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( ${w.int(Kx.maxSearchSteps)} ); + } + `),n.uniforms.add(new Ye("edgesTexture",s=>s.edges.colorTexture)),n.uniforms.add(new Ye("areaTexture",s=>s.areaTexture)),n.uniforms.add(new Ye("searchTexture",s=>s.searchTexture)),XR(n),n.code.add(w` + #define SMAA_AREATEX_PIXEL_SIZE ( 1.0 / vec2( 160.0, 560.0 ) ) + #define SMAA_AREATEX_SUBTEX_SIZE ( 1.0 / 7.0 ) + + vec4 sampleLevelZeroOffset(sampler2D tex, vec2 coord, vec2 offset) { + return texture(tex, coord + offset.x * resolution.xy, 0.0); + } + + float searchLength(sampler2D searchTex, vec2 e, float bias, float scale) { + e.r = bias + e.r * scale; + return 255.0 * texture( searchTex, e, 0.0 ).r; + } + + float searchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) { + vec2 e = vec2( 0.0, 1.0 ); + for ( int i = 0; i < ${w.int(Kx.maxSearchSteps)}; i ++ ) { + e = texture( edgesTex, texcoord, 0.0 ).rg; + texcoord -= vec2( 2.0, 0.0 ) * resolution.xy; + if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break; + } + texcoord.x += 0.25 * resolution.x; + texcoord.x += resolution.x; + texcoord.x += 2.0 * resolution.x; + texcoord.x -= resolution.x * searchLength(searchTex, e, 0.0, 0.5); + return texcoord.x; + } + + float searchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) { + vec2 e = vec2( 0.0, 1.0 ); + for ( int i = 0; i < ${w.int(Kx.maxSearchSteps)}; i ++ ) { + e = texture( edgesTex, texcoord, 0.0 ).rg; + texcoord += vec2( 2.0, 0.0 ) * resolution.xy; + if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break; + } + texcoord.x -= 0.25 * resolution.x; + texcoord.x -= resolution.x; + texcoord.x -= 2.0 * resolution.x; + texcoord.x += resolution.x * searchLength( searchTex, e, 0.5, 0.5 ); + return texcoord.x; + } + + float searchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) { + vec2 e = vec2( 1.0, 0.0 ); + for ( int i = 0; i < ${w.int(Kx.maxSearchSteps)}; i ++ ) { + e = texture( edgesTex, texcoord, 0.0 ).rg; + texcoord += vec2( 0.0, 2.0 ) * resolution.xy; + if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break; + } + texcoord.y -= 0.25 * resolution.y; + texcoord.y -= resolution.y; + texcoord.y -= 2.0 * resolution.y; + texcoord.y += resolution.y * searchLength( searchTex, e.gr, 0.0, 0.5 ); + return texcoord.y; + } + + float searchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) { + vec2 e = vec2( 1.0, 0.0 ); + for ( int i = 0; i < ${w.int(Kx.maxSearchSteps)}; i ++ ) { + e = texture( edgesTex, texcoord, 0.0 ).rg; + texcoord -= vec2( 0.0, 2.0 ) * resolution.xy; + if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break; + } + texcoord.y += 0.25 * resolution.y; + texcoord.y += resolution.y; + texcoord.y += 2.0 * resolution.y; + texcoord.y -= resolution.y * searchLength( searchTex, e.gr, 0.5, 0.5 ); + return texcoord.y; + } + + vec2 getArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) { + vec2 texcoord = float( ${w.int(Kx.maxDistanceAreaTex)} ) * round( 4.0 * vec2( e1, e2 ) ) + dist; + texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE ); + texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset; + return texture( areaTex, texcoord, 0.0 ).rg; + } + + void main() { + ivec4 subsampleIndices = ivec4(0.0); + vec4 weights = vec4(0.0); + vec2 e = texture( edgesTexture, uv ).rg; + if ( e.g > 0.0 ) { + vec2 d; + vec2 coords; + coords.x = searchXLeft( edgesTexture, searchTexture, offsets[0].xy, maxOffset.x ); + coords.y = offsets[1].y; + d.x = coords.x; + float e1 = texture( edgesTexture, coords, 0.0 ).r; + coords.x = searchXRight( edgesTexture, searchTexture, offsets[0].zw, maxOffset.y ); + d.y = coords.x; + d = d * resolution.z - pixelCoord.x; + vec2 sqrt_d = sqrt( abs(d) ); + coords.y -= 1.0 * resolution.y; + float e2 = sampleLevelZeroOffset( edgesTexture, coords, vec2( 1.0, 0.0 ) ).r; + weights.rg = getArea( areaTexture, sqrt_d, e1, e2, float( subsampleIndices.y ) ); + } + + if ( e.r > 0.0 ) { + vec2 d; + vec2 coords; + coords.y = searchYUp( edgesTexture, searchTexture, offsets[1].xy, maxOffset.z ); + coords.x = offsets[0].x; + d.x = coords.y; + float e1 = texture( edgesTexture, coords, 0.0 ).g; + coords.y = searchYDown( edgesTexture, searchTexture, offsets[1].zw, maxOffset.w ); + d.y = coords.y; + d = d * resolution.w - pixelCoord.y; + vec2 sqrt_d = sqrt(abs(d)); + coords.y -= 1.0 * resolution.y; + float e2 = sampleLevelZeroOffset( edgesTexture, coords, vec2(0.0, 1.0)).g; + weights.ba = getArea( areaTexture, sqrt_d, e1, e2, float( subsampleIndices.x ) ); + + // for some reason the following lines are necessary to prevent + // texture lookup precision issues on some Intel integrated graphics chips + vec4 dbg = (offsets[0] + offsets[1] + maxOffset + coords.xyyx); + weights.r += 0.00000001 * dot(vec4(0, 1, 0, 1), dbg); + } + fragColor = weights; + } + `),t}const Lvt=Object.freeze(Object.defineProperty({__proto__:null,build:Ivt},Symbol.toStringTag,{value:"Module"}));let xPe=class TPe extends Tr{initializeProgram(e){return new vr(e.rctx,TPe.shader.get().build(),fr)}initializePipeline(){return Ot({colorWrite:Ft})}};xPe.shader=new _r(Lvt,()=>ce(()=>import("./BlendWeights.glsl-79c88ca2.js"),[]));function Dvt(){const t=new mr,{attributes:e,varyings:r,vertex:i,fragment:n}=t;return e.add(E.POSITION,"vec2"),r.add("uv","vec2"),r.add("offsets[2]","vec4"),XR(i),i.code.add(w`void main() { +uv = position * 0.5 + vec2(0.5); +gl_Position = vec4(position, 0, 1); +offsets[0] = uv.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 ); +offsets[1] = uv.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 ); +}`),n.uniforms.add(new Ye("blendWeightsTexture",s=>s.blend.colorTexture),new Ye("colorTexture",s=>s.colorTexture)),XR(n),n.code.add(w`void main() { +vec4 a; +a.rb = texture(blendWeightsTexture, uv).rb; +a.g = texture(blendWeightsTexture, offsets[1].zw).g; +a.a = texture(blendWeightsTexture, offsets[1].xy).a; +if ( dot(a, vec4(1.0)) < 1e-5 ) { +fragColor = texture( colorTexture, uv, 0.0 ); +} else { +vec2 offset; +offset.x = a.a > a.b ? a.a : -a.b; +offset.y = a.g > a.r ? -a.g : a.r; +if ( abs( offset.x ) > abs( offset.y )) { +offset.y = 0.0; +} else { +offset.x = 0.0; +} +vec4 C = texture( colorTexture, uv, 0.0 ); +vec4 Cop = texture( colorTexture, uv + sign( offset ) * resolution.xy, 0.0 ); +float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y ); +fragColor = mix(C, Cop, s); +} +}`),t}const Nvt=Object.freeze(Object.defineProperty({__proto__:null,build:Dvt},Symbol.toStringTag,{value:"Module"}));let SPe=class EPe extends Tr{initializeProgram(e){return new vr(e.rctx,EPe.shader.get().build(),fr)}initializePipeline(){return Ot({colorWrite:Ft})}};SPe.shader=new _r(Nvt,()=>ce(()=>import("./Blur.glsl-2561d33a.js"),[]));const Yhe={threshold:.05,localConstrastAdaption:2};function Fvt(){const t=new mr,{attributes:e,varyings:r,vertex:i,fragment:n}=t;return e.add(E.POSITION,"vec2"),XR(i),r.add("uv","vec2"),r.add("offsets[3]","vec4"),i.code.add(w`void main() { +uv = position * 0.5 + vec2(0.5); +gl_Position = vec4(position, 0, 1); +offsets[0] = uv.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 ); +offsets[1] = uv.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 ); +offsets[2] = uv.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 ); +}`),n.uniforms.add(new Ye("colorTexture",s=>s.colorTexture)),n.code.add(w` + float absMax3(vec3 v) { + vec3 t = abs(v); + return max(max(t.r, t.g), t.b); + } + + void main() { + // Calculate color deltas: + vec4 delta; + vec3 C = texture(colorTexture, uv).rgb; + + vec3 Cleft = texture(colorTexture, offsets[0].xy).rgb; + delta.x = absMax3(C - Cleft); + + vec3 Ctop = texture(colorTexture, offsets[0].zw).rgb; + delta.y = absMax3(C - Ctop); + + vec2 edges = step(vec2(${w.float(Yhe.threshold)}), delta.xy); + + // discard if there is no edge: + if (dot(edges, vec2(1.0)) == 0.0) { + discard; + } + + // Calculate right and bottom deltas: + vec3 Cright = texture(colorTexture, offsets[1].xy).rgb; + delta.z = absMax3(C - Cright); + + vec3 Cbottom = texture(colorTexture, offsets[1].zw).rgb; + delta.w = absMax3(C - Cbottom); + + // Calculate the maximum delta in the direct neighborhood: + float maxDelta = max(max(max(delta.x, delta.y), delta.z), delta.w); + + // Calculate left-left and top-top deltas: + vec3 Cleftleft = texture(colorTexture, offsets[2].xy).rgb; + delta.z = absMax3(C - Cleftleft); + + vec3 Ctoptop = texture(colorTexture, offsets[2].zw).rgb; + delta.w = absMax3(C - Ctoptop); + + // Calculate the final maximum delta: + maxDelta = max(max(maxDelta, delta.z), delta.w); + + // Local contrast adaptation in action: + edges.xy *= step(maxDelta, float(${w.float(Yhe.localConstrastAdaption)}) * delta.xy); + + fragColor = vec4(edges, 0.0, 0.0); + } + `),t}const Uvt=Object.freeze(Object.defineProperty({__proto__:null,build:Fvt},Symbol.toStringTag,{value:"Module"}));let CPe=class APe extends Tr{initializeProgram(e){return new vr(e.rctx,APe.shader.get().build(),fr)}initializePipeline(){return Ot({colorWrite:Ft})}};CPe.shader=new _r(Uvt,()=>ce(()=>import("./EdgeDetect.glsl-43794585.js"),[]));let _A=class extends xe{constructor(e,r){super({}),this._rctx=e,this._techniqueRep=r,this._passParameters=new Mvt,this._isEnabled=!1}normalizeCtorArgs(){return{}}dispose(){this._abortController=yu(this._abortController),this.disable()}_loadResources(e){if(this._abortController!=null)return!1;if(this._passParameters.searchTexture!=null)return!0;this._abortController=new AbortController;const r=this._abortController.signal;return ce(()=>import("./SmaaRenderPassData-660b7d34.js"),[]).then(i=>this._loadTextures(i,r)).then(()=>e()).finally(()=>this._abortController=null),!1}_loadTextures(e,r){return Bt(r),Promise.all([this._loadTextureFromBase64(e.areaTexture,At.LINEAR,Tt.RGB),this._loadTextureFromBase64(e.searchTexure,At.NEAREST,Tt.LUMINANCE)]).then(([i,n])=>{ss(r)?(i.dispose(),n.dispose(),Bt(r)):(this._passParameters.areaTexture=i,this._passParameters.searchTexture=n)})}get updating(){return this._abortController!=null}enable(e){if(this._isEnabled)return!0;if(!this._edgeDetectTechnique||!this._blendWeightsTechnique||!this._blurTechnique){const n=new va;this._edgeDetectTechnique=this._techniqueRep.releaseAndAcquire(CPe,n,this._edgeDetectTechnique),this._blendWeightsTechnique=this._techniqueRep.releaseAndAcquire(xPe,n,this._blendWeightsTechnique),this._blurTechnique=this._techniqueRep.releaseAndAcquire(SPe,n,this._blurTechnique)}if(!this._loadResources(e))return!1;this._vao=xWe(this._rctx);const r=new pr(4,4);r.pixelFormat=Tt.RG,r.internalFormat=qe.RG8,r.wrapMode=Pt.CLAMP_TO_EDGE,this._passParameters.edges=new hs(this._rctx,r);const i=new pr(4,4);return i.pixelFormat=Tt.RGBA,i.wrapMode=Pt.CLAMP_TO_EDGE,this._passParameters.blend=new hs(this._rctx,i),this._isEnabled=!0,!0}disable(){this._isEnabled&&(this._vao=Le(this._vao),this._passParameters.areaTexture=Le(this._passParameters.areaTexture),this._passParameters.searchTexture=Le(this._passParameters.searchTexture),this._passParameters.blend=Le(this._passParameters.blend),this._passParameters.edges=Le(this._passParameters.edges),this._isEnabled=!1)}get _validPassParameters(){return this._isEnabled?this._passParameters:null}render(e){const r=this._validPassParameters;if(r==null)return;r.colorTexture=e;const i=this._rctx,n=i.getBoundFramebufferObject(),s=e.descriptor.width,o=e.descriptor.height;i.bindVAO(this._vao),i.setViewport(0,0,s,o),r.edges.resize(s,o),i.bindFramebuffer(r.edges),i.setClearColor(0,0,0,1),i.clear(yi.COLOR_BUFFER_BIT),i.bindTechnique(this._edgeDetectTechnique,r,null),i.drawArrays(Et.TRIANGLES,0,3),r.blend.resize(s,o),i.bindFramebuffer(r.blend),i.setClearColor(0,0,1,1),i.clear(yi.COLOR_BUFFER_BIT),i.bindTechnique(this._blendWeightsTechnique,r,null),i.drawArrays(Et.TRIANGLES,0,3),i.bindFramebuffer(n),i.setClearColor(0,1,0,1),i.clear(yi.COLOR_BUFFER_BIT),i.bindTechnique(this._blurTechnique,r,null),i.drawArrays(Et.TRIANGLES,0,3)}_loadTextureFromBase64(e,r,i){return qg(e).then(n=>{const s=new pr;return s.pixelFormat=i,s.wrapMode=Pt.CLAMP_TO_EDGE,s.width=n.width,s.height=n.height,s.samplingMode=r,new Ct(this._rctx,s,n)})}};h([f()],_A.prototype,"_abortController",void 0),h([f({readOnly:!0})],_A.prototype,"updating",null),_A=h([N("esri.views.3d.webgl-engine.lib.SmaaRenderPass")],_A);function kvt(t,e){const r=-t[0],i=-t[1],n=-t[2],s=e[3],o=e[7],a=e[11],l=e[15];e[0]+=s*r,e[1]+=s*i,e[2]+=s*n,e[4]+=o*r,e[5]+=o*i,e[6]+=o*n,e[8]+=a*r,e[9]+=a*i,e[10]+=a*n,e[12]+=l*r,e[13]+=l*i,e[14]+=l*n}function zvt(t,e){const r=t[0],i=t[1],n=t[2];e[12]+=r*e[0]+i*e[4]+n*e[8],e[13]+=r*e[1]+i*e[5]+n*e[9],e[14]+=r*e[2]+i*e[6]+n*e[10],e[14]+=r*e[3]+i*e[7]+n*e[11]}let Bvt=class{constructor(e){this._factory=e,this._originData=new Map}acquire(e){return this.register(this._factory.getOrigin(e))}register(e){const r=this._originData.get(e.id)||new Vvt(e);return r.refCount++,this._originData.has(r.origin.id)||this._originData.set(r.origin.id,r),r}release(e){e.refCount--,e.refCount===0&&this._originData.delete(e.origin.id)}updateViewMatrices(e){this._originData.forEach(r=>{In(r.viewMatrix,e),zvt(r.origin.vec3,r.viewMatrix)})}},Vvt=class{constructor(e){this.origin=e,this.refCount=0,this.viewMatrix=_e()}},Gvt=class extends Jxe{constructor(e,r){super(),this.distanceFalloffFactor=e,this.transparency=r,this.transformNormalViewFromGlobal=hi()}},jvt=class extends Kxe{constructor(){super(...arguments),this.transformNormalViewFromGlobal=hi(),this.slicePlaneLocalOrigin=O(),this.transformNormalGlobalFromModel=hi()}};function Hvt(t){const e=w`bool isNaN( float val ) +{ +return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true; +}`;t.code.add(e)}const Wvt=or(.5,-4e-4);function qvt(t,e){const r=t.vertex;r.include(Hvt),r.constants.add("depthBias","vec2",Wvt),r.uniforms.add(new yr("inverseViewport",(i,n)=>n.inverseViewport)),e.legacy?(r.uniforms.add(new Mi("proj",(i,n)=>n.camera.projectionMatrix)),r.code.add(w`vec2 calculateProjectedBiasXY(vec4 projPos, vec3 globalNormal) { +float offsetXY = depthBias.x; +vec4 projNormal = proj * localView * vec4(globalNormal, 0.0); +return offsetXY * projPos.w * 2.0 * inverseViewport * normalize(projNormal.xyz).xy; +}`)):(r.uniforms.add(new Gh("transformNormalViewFromGlobal",i=>i.transformNormalViewFromGlobal),new Mi("transformProjFromView",i=>i.transformProjFromView)),r.code.add(w`vec2 calculateProjectedBiasXY(vec4 projPos, vec3 globalNormal) { +float offsetXY = depthBias.x; +vec4 projNormal = transformProjFromView * vec4(transformNormalViewFromGlobal * globalNormal, 0.0); +return offsetXY * projPos.w * 2.0 * inverseViewport * normalize(projNormal.xyz).xy; +}`)),r.code.add(w`float _calculateProjectedBiasZ(vec4 projPos) { +float offsetZ = depthBias.y; +return sqrt(max(projPos.z,0.0)) * offsetZ; +} +vec4 adjustProjectedPosition(vec4 projPos, vec3 worldNormal, float lineWidth) { +vec2 offsetXY = calculateProjectedBiasXY(projPos, worldNormal); +if (!isNaN(offsetXY.x) && !isNaN(offsetXY.y)) { +projPos.xy += offsetXY; +} +projPos.z += _calculateProjectedBiasZ(projPos); +return projPos; +}`)}function Xvt(t,e){const r=t.fragment;r.constants.add("coverageTestThreshold","float",.01),e.antialiasing?r.code.add(w`#define discardByCoverage(radius, coverage) { if (coverage < coverageTestThreshold) discard; }`):r.code.add(w`#define discardByCoverage(radius, coverage) { float coverageLimit = radius <= 0.5 ? coverageTestThreshold : 0.75; if (coverage < coverageLimit) discard; }`)}function Yvt(t,e){const r=t.vertex;e.silhouette?(r.code.add(w`bool isSilhouetteEdge(vec3 viewDir, vec3 normalA, vec3 normalB) { +float faceAVisible = dot(viewDir, normalA); +float faceBVisible = dot(viewDir, normalB); +return faceAVisible * faceBVisible < 0.0; +}`),e.legacy?r.code.add(w`bool discardNonSilhouetteEdges(vec3 viewPos, vec3 worldPos) { +vec3 viewNormalA = _modelToViewNormal(normalA); +vec3 viewNormalB = _modelToViewNormal(normalB); +vec3 viewDir = -viewPos; +if (isSilhouetteEdge(viewDir, viewNormalA, viewNormalB)) { +return false; +} +gl_Position = vec4(10.0, 10.0, 10.0, 1.0); +return true; +}`):r.code.add(w`bool discardNonSilhouetteEdges(vec3 viewPos, vec3 worldPos) { +vec3 worldNormalA = _modelToWorldNormal(normalA); +vec3 worldNormalB = _modelToWorldNormal(normalB); +vec3 viewDir = -worldPos; +if (isSilhouetteEdge(viewDir, worldNormalA, worldNormalB)) { +return false; +} +gl_Position = vec4(10.0, 10.0, 10.0, 1.0); +return true; +}`)):r.code.add(w`bool discardNonSilhouetteEdges(vec3 viewPos, vec3 worldPos) { +return false; +}`)}function Zvt(t,e){const r=t.vertex;r.include(Pc),r.uniforms.add(new Ce("distanceFalloffFactor",i=>i.distanceFalloffFactor)),r.code.add(w`float distanceBasedPerspectiveFactor(float distance) { +return clamp(sqrt(distanceFalloffFactor / distance), 0.0, 1.0); +}`),r.uniforms.add(new Eh("componentDataTex",i=>i.componentDataTexture)),t.attributes.add(E.COMPONENTINDEX,"float"),r.constants.add("componentColorFieldOffset","float",0),r.constants.add("componentOtherFieldOffset","float",1),r.constants.add("componentVerticalOffsetFieldOffset","float",2),r.constants.add("componentFieldCount","float",3),r.constants.add("lineWidthFractionFactor","float",8),r.constants.add("extensionLengthOffset","float",128),r.constants.add("verticalOffsetScale","float",2*AK),r.code.add(w`vec2 _componentTextureCoords(float componentIndex, float fieldOffset) { +float fieldIndex = componentFieldCount * componentIndex + fieldOffset; +float texSize = float(textureSize(componentDataTex, 0).x); +float colIndex = mod(fieldIndex, texSize); +float rowIndex = floor(fieldIndex / texSize); +return vec2(colIndex, rowIndex) + 0.5; +} +struct ComponentData { +vec4 color; +float lineWidth; +float extensionLength; +float type; +float verticalOffset; +}; +ComponentData readComponentData() { +vec2 colorIndex = _componentTextureCoords(componentIndex, componentColorFieldOffset); +vec2 otherIndex = _componentTextureCoords(componentIndex, componentOtherFieldOffset); +vec2 verticalOffsetIndex = _componentTextureCoords(componentIndex, componentVerticalOffsetFieldOffset); +vec4 colorValue = texelFetch(componentDataTex, ivec2(colorIndex), 0); +vec4 otherValue = texelFetch(componentDataTex, ivec2(otherIndex), 0); +float verticalOffset = (rgba2float(texelFetch(componentDataTex, ivec2(verticalOffsetIndex), 0)) - 0.5) * verticalOffsetScale; +return ComponentData( +vec4(colorValue.rgb, colorValue.a * otherValue.w), +otherValue.x * (255.0 / lineWidthFractionFactor), +otherValue.y * 255.0 - extensionLengthOffset, +-(otherValue.z * 255.0) + 0.5, +verticalOffset +); +}`),e.legacy?r.code.add(w`vec3 _modelToWorldNormal(vec3 normal) { +return (model * vec4(normal, 0.0)).xyz; +} +vec3 _modelToViewNormal(vec3 normal) { +return (localView * model * vec4(normal, 0.0)).xyz; +}`):(r.uniforms.add(new xR("transformNormalGlobalFromModel",i=>i.transformNormalGlobalFromModel)),r.code.add(w`vec3 _modelToWorldNormal(vec3 normal) { +return transformNormalGlobalFromModel * normal; +}`)),e.silhouette?(t.attributes.add(E.NORMALA,"vec3"),t.attributes.add(E.NORMALB,"vec3"),r.code.add(w`vec3 worldNormal() { +return _modelToWorldNormal(normalize(normalA + normalB)); +}`)):(t.attributes.add(E.NORMAL,"vec3"),r.code.add(w`vec3 worldNormal() { +return _modelToWorldNormal(normal); +}`)),e.legacy?r.code.add(w`void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) { +worldPos = (model * vec4(modelPos, 1.0)).xyz; +viewPos = (localView * vec4(worldPos, 1.0)).xyz; +}`):(r.include(a5,e),r.include(a5,e),r.uniforms.add(new Gh("transformViewFromCameraRelativeRS",i=>i.transformViewFromCameraRelativeRS),new xR("transformWorldFromModelRS",i=>i.transformWorldFromModelRS),new pu("transformWorldFromModelTL",i=>i.transformWorldFromModelTL),new pu("transformWorldFromModelTH",i=>i.transformWorldFromModelTH),new Lt("transformWorldFromViewTL",i=>i.transformWorldFromViewTL),new Lt("transformWorldFromViewTH",i=>i.transformWorldFromViewTH)),r.code.add(w` + void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) { + vec3 rotatedModelPosition = transformWorldFromModelRS * modelPos; + + vec3 transformCameraRelativeFromModel = dpAdd( + transformWorldFromModelTL, + transformWorldFromModelTH, + -transformWorldFromViewTL, + -transformWorldFromViewTH + ); + + worldPos = transformCameraRelativeFromModel + rotatedModelPosition; + + if (verticalOffset != 0.0) { + vec3 vUp = ${e.spherical?w`normalize(transformWorldFromModelTL + rotatedModelPosition);`:w`vec3(0.0, 0.0, 1.0);`} + worldPos += verticalOffset * vUp; + } + + viewPos = transformViewFromCameraRelativeRS * worldPos; + } + `)),r.uniforms.add(new Mi("transformProjFromView",(i,n)=>n.camera.projectionMatrix)),r.code.add(w`vec4 projFromViewPosition(vec3 position) { +return transformProjFromView * vec4(position, 1.0); +}`),r.code.add(w`float calculateExtensionLength(float extensionLength, float lineLength) { +return extensionLength / (log2(max(1.0, 256.0 / lineLength)) * 0.2 + 1.0); +}`)}function Qvt(t){return t.mode===ls.SKETCH||t.mode===ls.MIXED}var ls,cb;(function(t){t[t.SOLID=0]="SOLID",t[t.SKETCH=1]="SKETCH",t[t.MIXED=2]="MIXED",t[t.COUNT=3]="COUNT"})(ls||(ls={})),function(t){t[t.REGULAR=0]="REGULAR",t[t.SILHOUETTE=1]="SILHOUETTE"}(cb||(cb={}));function $K(t,e){const r=t.vertex;switch(t.attributes.add(E.SIDENESS,"vec2"),e.mode===ls.MIXED?r.code.add(w`struct UnpackedAttributes { +vec2 sideness; +vec2 sidenessNorm; +float lineWidthPixels; +float extensionLengthPixels; +float type; +};`):r.code.add(w`struct UnpackedAttributes { +vec2 sideness; +vec2 sidenessNorm; +float lineWidthPixels; +float extensionLengthPixels; +};`),e.mode){case ls.MIXED:r.code.add(w`UnpackedAttributes unpackAttributes(ComponentData component) { +vec2 sidenessNorm = sideness; +vec2 sideness = sidenessNorm * 2.0 - 1.0; +float fType = component.type; +float extensionLengthPixels = component.extensionLength; +float lineWidth = component.lineWidth; +if (fType <= 0.0) { +extensionLengthPixels *= variantExtension * 2.0 - 1.0; +} +return UnpackedAttributes(sideness, sidenessNorm, lineWidth, extensionLengthPixels, fType); +}`);break;case ls.SKETCH:r.code.add(w`UnpackedAttributes unpackAttributes(ComponentData component) { +vec2 sidenessNorm = sideness; +vec2 sideness = sidenessNorm * 2.0 - 1.0; +float extensionLengthPixels = component.extensionLength; +extensionLengthPixels *= variantExtension * 2.0 - 1.0; +float lineWidth = component.lineWidth; +return UnpackedAttributes(sideness, sidenessNorm, lineWidth, extensionLengthPixels); +}`);break;case ls.SOLID:r.code.add(w`UnpackedAttributes unpackAttributes(ComponentData component) { +vec2 sidenessNorm = sideness; +vec2 sideness = sidenessNorm * 2.0 - 1.0; +float extensionLengthPixels = component.extensionLength; +float lineWidth = component.lineWidth; +return UnpackedAttributes(sideness, sidenessNorm, lineWidth, extensionLengthPixels); +}`);break;case ls.COUNT:break;default:e.mode}}function Jvt(t,e){const r=t.vertex;switch(t.include($K,e),e.mode){case ls.SOLID:r.code.add(w`float calculateLineAmplitude(UnpackedAttributes unpackedAttributes) { +return 0.0; +}`);break;case ls.SKETCH:r.uniforms.add(new Nb("strokesAmplitude",i=>i.strokesTexture.amplitude)),r.code.add(w`float calculateLineAmplitude(UnpackedAttributes unpackedAttributes) { +return strokesAmplitude; +}`);break;case ls.MIXED:r.uniforms.add(new Nb("strokesAmplitude",i=>i.strokesTexture.amplitude)),r.code.add(w`float calculateLineAmplitude(UnpackedAttributes unpackedAttributes) { +float type = unpackedAttributes.type; +if (type <= 0.0) { +return strokesAmplitude; +} +else { +return 0.0; +} +}`)}}function Kvt(t,e){t.include($K,e);const{vertex:r,fragment:i}=t;switch(Qvt(e)&&(r.uniforms.add(new Eh("strokesTexture",n=>n.strokesTexture.texture)),r.uniforms.add(new Nb("strokesLog2Resolution",n=>Math.log2(n.strokesTexture.resolution)),new Nb("strokeVariants",n=>n.strokesTexture.variants)),t.varyings.add("vStrokeUV","vec2"),i.uniforms.add(new Eh("strokesTexture",n=>n.strokesTexture.texture),new Nb("strokesNormalizationScale",n=>n.strokesTexture.normalizationScale)),r.code.add(w`void calculateStyleOutputsSketch(float lineLength, UnpackedAttributes unpackedAttributes) { +vec2 sidenessNorm = unpackedAttributes.sidenessNorm; +float lineIndex = clamp(ceil(log2(lineLength)), 0.0, strokesLog2Resolution); +vStrokeUV = vec2(exp2(lineIndex) * sidenessNorm.y, lineIndex * strokeVariants + variantStroke + 0.5) / vec2(textureSize(strokesTexture, 0)); +vStrokeUV.x += variantOffset; +}`),t.fragment.include(Pc),i.code.add(w`float calculateLineOffsetSketch() { +float offsetNorm = rgba2float(texture(strokesTexture, vStrokeUV)); +return (offsetNorm - 0.5) * strokesNormalizationScale; +} +float calculateLinePressureSketch() { +return rgba2float(texture(strokesTexture, vStrokeUV + vec2(0.0, 0.5))); +}`)),e.mode){case ls.SOLID:r.code.add(w`void calculateStyleOutputs(UnpackedAttributes unpackedAttributes) {}`),i.code.add(w`float calculateLineOffset() { +return 0.0; +} +float calculateLinePressure() { +return 1.0; +}`);break;case ls.SKETCH:r.code.add(w`void calculateStyleOutputs(UnpackedAttributes unpackedAttributes) +{ +calculateStyleOutputsSketch(vLineLengthPixels, unpackedAttributes); +}`),i.code.add(w`float calculateLineOffset() { +return calculateLineOffsetSketch(); +} +float calculateLinePressure() { +return calculateLinePressureSketch(); +}`);break;case ls.MIXED:t.varyings.add("vType","float"),r.code.add(w`void calculateStyleOutputs(UnpackedAttributes unpackedAttributes) +{ +vType = unpackedAttributes.type; +if (unpackedAttributes.type <= 0.0) { +calculateStyleOutputsSketch(vLineLengthPixels, unpackedAttributes); +} +}`),i.code.add(w`float calculateLineOffset() { +if (vType <= 0.0) { +return calculateLineOffsetSketch(); +} +else { +return 0.0; +} +} +float calculateLinePressure() { +if (vType <= 0.0) { +return calculateLinePressureSketch(); +} +else { +return 1.0; +} +}`)}}function ebt(t){const e=new mr,{vertex:r,fragment:i}=e;return t.legacy&&r.uniforms.add(new Zhe("model"),new Zhe("localView")),e.include(qvt,t),e.include(Zvt,t),e.include(Jvt,t),e.include($K,t),e.include(Kvt,t),e.include(fn,t),e.include(Yvt,t),e.include(Xvt,t),e.include(xu,t),e.varyings.add("vColor","vec4"),e.varyings.add("vRadius","float"),e.varyings.add("vPosition","vec3"),e.varyings.add("vWorldPosition","vec3"),e.varyings.add("vViewPos","vec3"),e.varyings.add("vLineLengthPixels","float"),e.varyings.add("vSizeFalloffFactor","float"),r.uniforms.add(new yr("pixelToNDC",(n,s)=>er(tbt,2/s.camera.fullViewport[2],2/s.camera.fullViewport[3])),new Jt("viewport",(n,s)=>s.camera.fullViewport),new Ce("pixelRatio",(n,s)=>s.camera.pixelRatio)),e.attributes.add(E.POSITION0,"vec3"),e.attributes.add(E.POSITION1,"vec3"),e.attributes.add(E.VARIANTOFFSET,"float"),e.attributes.add(E.VARIANTSTROKE,"float"),e.attributes.add(E.VARIANTEXTENSION,"float"),r.code.add(w` + const float opaqueCutoff = 1.0 / 255.0; + + void calculateGeometricOutputs(vec3 viewPosV0, vec3 viewPosV1, vec3 worldPosV0, vec3 worldPosV1, vec3 worldNormal, UnpackedAttributes unpackedAttributes) { + vec2 sideness = unpackedAttributes.sideness; + vec2 sidenessNorm = unpackedAttributes.sidenessNorm; + + vWorldPosition = mix(worldPosV0, worldPosV1, sidenessNorm.y).xyz; + + vec3 viewPos = mix(viewPosV0, viewPosV1, sidenessNorm.y); + vViewPos = viewPos; + + vec4 projPosV0 = projFromViewPosition(viewPosV0); + vec4 projPosV1 = projFromViewPosition(viewPosV1); + vec4 projPos = projFromViewPosition(viewPos); + + vec3 screenSpaceLineNDC = (projPosV1.xyz / projPosV1.w - projPosV0.xyz / projPosV0.w); + vec2 ndcToPixel = viewport.zw * 0.5; + vec2 screenSpaceLinePixels = screenSpaceLineNDC.xy * ndcToPixel; + float lineLengthPixels = length(screenSpaceLinePixels); + + float dzPerPixel = screenSpaceLineNDC.z / lineLengthPixels; + vec2 screenSpaceDirection = screenSpaceLinePixels / lineLengthPixels; + vec2 perpendicularScreenSpaceDirection = vec2(screenSpaceDirection.y, -screenSpaceDirection.x) * sideness.x; + + float falloffFactor = distanceBasedPerspectiveFactor(-viewPos.z) * pixelRatio; + float lineWidthPixels = unpackedAttributes.lineWidthPixels * falloffFactor; + + float extensionLengthPixels = calculateExtensionLength(unpackedAttributes.extensionLengthPixels, lineLengthPixels) * falloffFactor; + float lineAmplitudePixels = calculateLineAmplitude(unpackedAttributes) * pixelRatio; + + vSizeFalloffFactor = falloffFactor; + + float lineWidthAndAmplitudePixels = lineWidthPixels + lineAmplitudePixels + lineAmplitudePixels; + float extendedLineLengthPixels = lineLengthPixels + extensionLengthPixels + extensionLengthPixels; + + ${t.antialiasing?w` + const float aaPaddingPixels = 1.0; + + // Line size with padding + float halfAAPaddedLineWidthAndAmplitudePixels = lineWidthAndAmplitudePixels * 0.5 + aaPaddingPixels; + float aaPaddedRoundedCapSizePixels = lineWidthPixels * 0.5 + aaPaddingPixels;`:w` + float halfAAPaddedLineWidthAndAmplitudePixels = max(lineWidthAndAmplitudePixels, 1.0) * 0.5; + float aaPaddedRoundedCapSizePixels = max(lineWidthPixels, 1.0) * 0.5;`} + + // Half line width in NDC including padding for anti aliasing + vec2 halfAAPaddedLineWidthAndAmplitudeNDC = halfAAPaddedLineWidthAndAmplitudePixels * pixelToNDC; + vec2 aaPaddedRoundedCapSizeNDC = aaPaddedRoundedCapSizePixels * pixelToNDC; + vec2 extensionLengthNDC = extensionLengthPixels * pixelToNDC; + + // Compute screen space position of vertex, offsetting for line size and end caps + vec2 ndcOffset = ( + screenSpaceDirection * sideness.y * (aaPaddedRoundedCapSizeNDC + extensionLengthNDC) + + perpendicularScreenSpaceDirection * halfAAPaddedLineWidthAndAmplitudeNDC + ); + + projPos.xy += ndcOffset * projPos.w; + projPos.z += (dzPerPixel * (aaPaddedRoundedCapSizePixels + extensionLengthPixels)) * sideness.y * projPos.w; + + projPos = adjustProjectedPosition(projPos, worldNormal, 1.0 + max((lineWidthAndAmplitudePixels - 1.0) * 0.5, 0.0)); + + // Line length with end caps + float aaPaddedLineWithCapsLengthPixels = extendedLineLengthPixels + aaPaddedRoundedCapSizePixels + aaPaddedRoundedCapSizePixels; + + float pixelPositionAlongLine = aaPaddedLineWithCapsLengthPixels * sidenessNorm.y - aaPaddedRoundedCapSizePixels; + + // Position in pixels with origin at first vertex of line segment + vPosition = vec3( + halfAAPaddedLineWidthAndAmplitudePixels * sideness.x, + pixelPositionAlongLine, + pixelPositionAlongLine / extendedLineLengthPixels + ); + + // The line width radius in pixels + vRadius = lineWidthPixels * 0.5; + vLineLengthPixels = extendedLineLengthPixels; + + // discard short edges below a certain length threshold + ${t.mode===ls.SKETCH?w` + if (lineLengthPixels <= 3.0) { + gl_Position = vec4(10.0, 10.0, 10.0, 1.0); + return; + }`:t.mode===ls.MIXED?w` + if (lineLengthPixels <= 3.0 && unpackedAttributes.type <= 0.0) { + gl_Position = vec4(10.0, 10.0, 10.0, 1.0); + return; + }`:""} + gl_Position = projPos; + } + + void main() { + ComponentData component = readComponentData(); + UnpackedAttributes unpackedAttributes = unpackAttributes(component); + + vec3 worldPosV0, worldPosV1, viewPosV0, viewPosV1; + worldAndViewFromModelPosition(position0, component.verticalOffset, worldPosV0, viewPosV0); + worldAndViewFromModelPosition(position1, component.verticalOffset, worldPosV1, viewPosV1); + + // Component color + vColor = component.color; + + // Discard fully transparent edges + if (vColor.a < opaqueCutoff) { + gl_Position = vec4(10.0, 10.0, 10.0, 1.0); + return; + } + + if (discardNonSilhouetteEdges(viewPosV0, worldPosV0)) { + return; + } + + // General geometric computation for all types of edges + calculateGeometricOutputs(viewPosV0, viewPosV1, worldPosV0, worldPosV1, worldNormal(), unpackedAttributes); + + // Specific computation for different edge styles + calculateStyleOutputs(unpackedAttributes); + } + `),i.code.add(w` + vec2 lineWithCapsDistance(float radius, vec2 position, float lineLength) { + float positionX = position.x - calculateLineOffset(); + + if (radius < 1.0) { + float coverageX = clamp(min(radius, positionX + 0.5) - max(-radius, positionX - 0.5), 0.0, 1.0); + float coverageY = clamp(min(lineLength, position.y + 0.5) - max(0.0, position.y - 0.5), 0.0, 1.0); + return vec2(0.5 - min(coverageX, coverageY), 0.0); + } + else { + // Between -radius -> 0 for start cap, 0 for line, 0 -> radius + float positionOnCap = position.y - clamp(position.y, 0.0, lineLength); + + vec2 lineToPosition = vec2(positionX, positionOnCap); + return vec2(length(lineToPosition) - radius, positionOnCap / radius); + } + } + + void main() { + ${t.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, vViewPos.z);":""} + float radius = vRadius * calculateLinePressure(); + + vec2 distance = lineWithCapsDistance(radius, vPosition.xy, vLineLengthPixels); + float coverage = clamp(0.5 - distance.x, 0.0, 1.0); + + discardByCoverage(radius, coverage); + discardBySlice(vWorldPosition); + + fragColor = vec4(vColor.rgb, vColor.a * coverage); + } + `),e}const tbt=Ne();let Zhe=class extends ln{constructor(e){super(e,"mat4")}};const rbt=Object.freeze(Object.defineProperty({__proto__:null,build:ebt},Symbol.toStringTag,{value:"Module"}));let OPe=class RPe extends Tr{initializeProgram(e){return new vr(e.rctx,RPe.shader.get().build(this.configuration),kRe)}initializePipeline(e){return e.blendMinMax?Ot({blending:So(ve.ONE,ve.ONE,ve.ZERO,ve.ONE,Zf.ADD,e.blendMinMax.MAX),depthTest:{func:Hr.LEQUAL},colorWrite:Ft}):Ot({depthTest:{func:Hr.LEQUAL},depthWrite:$l,colorWrite:Ft})}};OPe.shader=new _r(rbt,()=>ce(()=>import("./EdgeShader.glsl-e2d5d7be.js"),[]));let uf=class extends Fo{constructor(){super(...arguments),this.mode=ls.SOLID,this.hasSlicePlane=!1,this.silhouette=!1,this.legacy=!1,this.antialiasing=!1,this.doublePrecisionRequiresObfuscation=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.spherical=!1}};h([U({count:ls.COUNT})],uf.prototype,"mode",void 0),h([U()],uf.prototype,"hasSlicePlane",void 0),h([U()],uf.prototype,"silhouette",void 0),h([U()],uf.prototype,"legacy",void 0),h([U()],uf.prototype,"antialiasing",void 0),h([U()],uf.prototype,"doublePrecisionRequiresObfuscation",void 0),h([U()],uf.prototype,"hasMultipassTerrain",void 0),h([U()],uf.prototype,"cullAboveGround",void 0),h([U()],uf.prototype,"spherical",void 0);const ibt=8,eB=128,nbt={type:"uber",hasSlicePlane:!1,strokesTexture:null,legacy:!0,spherical:!0},sbt={solid:ls.SOLID,sketch:ls.SKETCH,uber:ls.MIXED};let tB=class PPe{constructor(e,r,i){this._rctx=e,this._shaderTechniqueRepository=r,this._configuration=new uf,this.refCount=0,this._renderables=new Set,this._sortedRenderables={[zt.TRANSPARENT]:{[zt.TRANSPARENT]:new Nt,[zt.OPAQUE]:new Nt},[zt.OPAQUE]:{[zt.TRANSPARENT]:new Nt,[zt.OPAQUE]:new Nt}},this._renderablesDirty=!1,this._drawParameters=new jvt,this._settings={...nbt,...i},this.key=PPe.getKey(this._settings.type,this._settings.hasSlicePlane,this._settings.legacy);const n=this._settings.strokesTexture.variants;this.writerSettings={variants:n,reducedPrecision:Kr.TESTS_DISABLE_OPTIMIZATIONS},this._configuration.legacy=this._settings.legacy,this._configuration.mode=sbt[this._settings.type],this._configuration.silhouette=!1,this._configuration.antialiasing=!!this._rctx.capabilities.blendMinMax,this._configuration.hasSlicePlane=this._settings.hasSlicePlane,this._configuration.doublePrecisionRequiresObfuscation=e.driverTest.doublePrecisionRequiresObfuscation.result,this._configuration.spherical=i.spherical}dispose(){this._technique=Fi(this._technique)}addRenderable(e){this._renderables.add(e),this._renderablesDirty=!0}removeRenderable(e){this._renderables.delete(e),this._renderablesDirty=!0}setRenderablesDirty(){this._renderablesDirty=!0}forEachRenderable(e,r){if(this._renderablesDirty&&this._sortRenderables(),r!==zt.INVISIBLE){const i=this._sortedRenderables[r];i[zt.TRANSPARENT].forAll(e),i[zt.OPAQUE].forAll(e)}}updateTechnique(e,r){return this._configuration.hasMultipassTerrain=!!e.multipassTerrain.enabled,this._configuration.cullAboveGround=!!e.multipassTerrain.cullAboveGround,this._configuration.silhouette=r,this._technique=this._shaderTechniqueRepository.releaseAndAcquire(OPe,this._configuration,this._technique),this._technique}bindRegularEdges(e,r){return this._lastOriginId=null,this._rctx.bindTechnique(this.updateTechnique(r,!1),e,r)}bindSilhouetteEdges(e,r){return this._lastOriginId=null,this._rctx.bindTechnique(this.updateTechnique(r,!0),e,r)}renderRegularEdges(e,r,i,n,s){this._render(e,r,r.regular.vao,i,n,s)}renderSilhouetteEdges(e,r,i,n,s){this._render(e,r,r.silhouette.vao,i,n,s)}_render(e,r,i,n,s,o){o>0&&(this._bindDraw(e,r,n,s),this._rctx.bindVAO(i),this._rctx.capabilities.instancing.drawArraysInstanced(Et.TRIANGLE_FAN,0,4,o))}_bindDraw(e,r,i,n){if(this._drawParameters.componentDataTexture=r.components.buffer.textureBuffer.texture,this._drawParameters.strokesTexture=this._settings.strokesTexture,"origin"in r.transform)this._lastOriginId!==r.transform.origin.origin.id&&(e.setUniformMatrix4fv("localView",r.transform.origin.viewMatrix),this._lastOriginId=r.transform.origin.origin.id),e.setUniformMatrix4fv("model",r.transform.modelMatrix),this._drawParameters.slicePlaneLocalOrigin=r.transform.origin.origin.vec3;else{const s=new sU(r.transform.position),o=Uh(Qhe,Vw(Qhe,r.transform.rotationScale));this._drawParameters.transformWorldFromModelTL=s.low,this._drawParameters.transformWorldFromModelTH=s.high,this._drawParameters.transformWorldFromModelRS=r.transform.rotationScale,this._drawParameters.transformNormalGlobalFromModel=o;const a=n.camera.viewInverseTransposeMatrix;ne(this._drawParameters.slicePlaneLocalOrigin,a[3],a[7],a[11])}e.bindDraw(this._drawParameters,n,i)}_sortRenderables(){this._renderablesDirty=!1,this._sortedRenderables[zt.TRANSPARENT][zt.TRANSPARENT].clear(),this._sortedRenderables[zt.TRANSPARENT][zt.OPAQUE].clear(),this._sortedRenderables[zt.OPAQUE][zt.TRANSPARENT].clear(),this._sortedRenderables[zt.OPAQUE][zt.OPAQUE].clear(),this._renderables.forEach(r=>{r.objectTransparency!==zt.INVISIBLE&&r.edgeTransparency!==zt.INVISIBLE&&this._sortedRenderables[r.objectTransparency][r.edgeTransparency].push(r)});const e=(r,i)=>"origin"in r.transform?"origin"in i.transform?r.transform.origin.origin.idi.transform.origin.origin.id?1:0:1:0;this._sortedRenderables[zt.TRANSPARENT][zt.TRANSPARENT].sort(e),this._sortedRenderables[zt.TRANSPARENT][zt.OPAQUE].sort(e),this._sortedRenderables[zt.OPAQUE][zt.TRANSPARENT].sort(e),this._sortedRenderables[zt.OPAQUE][zt.OPAQUE].sort(e)}static getKey(e,r,i){return`edges-t:${e}:${r}:${i}`}};const Qhe=Pl();function BUt(t,e){return e.push(t.buffer),{buffer:t.buffer,layout:new Kqe(t.layout)}}function hL(t){return new m2e(t.layout).createView(t.buffer)}let obt=class extends EOe{constructor(e){super("EdgeProcessingWorker","extract",{extract:r=>[r.dataBuffer],extractComponentsEdgeLocations:r=>[r.dataBuffer],extractEdgeLocations:r=>[r.dataBuffer]},e)}async process(e,r,i){if(i)return J_t(e);const n=await this.invoke(new rB(e),r);return this._unpackOutput(n)}async extractEdgeLocations(e,r){const i=await this.invokeMethod("extractEdgeLocations",new rB(e),r);return hL(i)}async extractComponentsEdgeLocations(e,r){const i=await this.invokeMethod("extractComponentsEdgeLocations",new rB(e),r);return hL(i)}_unpackOutput(e){return{regular:{instancesData:hL(e.regular.instancesData),lodInfo:{lengths:new Float32Array(e.regular.lodInfo.lengths)}},silhouette:{instancesData:hL(e.silhouette.instancesData),lodInfo:{lengths:new Float32Array(e.silhouette.lodInfo.lengths)}},averageEdgeLength:e.averageEdgeLength}}},rB=class{constructor(e){this.dataBuffer=e.data.buffer,this.writerSettings=e.writerSettings,this.skipDeduplicate=e.skipDeduplicate,this.indices=ap(e.indices)?e.indices:e.indices.buffer,this.indicesType=ap(e.indices)?"Array":qF(e.indices)?"Uint32Array":"Uint16Array",this.indicesLength=e.indicesLength}};function abt(t){const r=ZC.resolution,i=r/2,n=new Uint8Array(4*r*r),s=4*r*i,o=ZC.amplitude,a=2*o,l=4*r,c=Math.log2(r)+1,u=ZC.strokes.length;let d=(c-1)*u*l;for(const{distance:y,pressure:_}of ZC.strokes){let v=y,b=_,x=d;for(let T=0;T0}function ubt(t){return t.size*t.color[3]>0}function ide(t,e,r,i){for(let n=0;nthis._discardObjectEntry(t)),this._perObjectData.clear(),this._strokesTexture=Le(this._strokesTexture),this._componentColorManager=Me(this._componentColorManager),this._workerAbort.abort(),this._worker.destroy(),this._verticesBufferObject=Le(this._verticesBufferObject),this._renderers.clear(),this._updatingHandles.destroy(),this._set("schedule",gbt))}get updating(){return this._updatingHandles.updating}get usedMemory(){return this._gpuMemoryUsage}shouldRender(){return this._renderers.size>0}async addComponentObject(t,e,r,i,n,s,o,a){if(this.hasObject(t))return this.getObjectMemoryUsage(t);let l;const c=new sde(new Promise(d=>l=d),r.center,r.radius);this._perObjectData.set(t,c);const u=await this._updatingHandles.addPromise(this._addComponentGeometry(e,c,i,n,s,o,a));return this.setNeedsRender(),l(),u}async addOrUpdateObject3D(t,e,r,i){if(this.destroyed)return void J.getLogger(this).warn("Attempt to add an object to a destroyed instance");const n=this._perObjectData.get(t);let s;(n==null?void 0:n.renderables.length)>0&&this._perObjectDataEvictionCache.add(n);const o=t.boundingVolumeWorldSpace.bounds,a=new sde(new Promise(c=>s=c),o,vg(o));this._perObjectData.set(t,a);const l=new Array;if(r.mergeGeometries&&t.geometries.length>1&&hbt(t))l.push(this._addObjectMergedGeometries(t,a,e,r,i));else for(let c=0;cthis._removeRenderable(e)),this.setNeedsRender()),t.loaded=null)}hasObject(t){return this._perObjectData.has(t)}async updateAllComponentOpacities(t,e){const r=await this._updatingHandles.addPromise(this._getObjectEntry(t));if(r==null)return;const i=e instanceof Array?n=>e[n]:()=>e;r.renderables.forEach(n=>{const s=n.components.meta.length;for(let o=0;or+i.statistics.gpuMemoryUsage,0):0}async updateAllComponentMaterials(t,e,r,i){const n=t instanceof h0,s=!!r.hasSlicePlane,o=ede(e),a=tB.getKey(o,s,n),l=await this._updatingHandles.addPromise(this._getObjectEntry(t));l!=null&&(l.renderables.forEach(c=>{if(a!==c.rendererKey){const u=this._renderers.get(c.rendererKey),d=this._acquireRenderer(o,s,n);u.removeRenderable(c),--u.refCount,c.rendererKey=a,d.addRenderable(c)}for(let u=0;u{const n=i.components.meta;for(let s=0;si.visible=e),this.setNeedsRender())}removeObject(t){const e=this._perObjectData.get(t);e&&(this._perObjectData.delete(t),this._discardObjectEntry(e))}async _getObjectEntry(t){const e=this._perObjectData.get(t);if(!e)throw new Error("no object");return await e.loaded,e.loaded==null?null:e}render(t,e){if(this._componentColorManager==null)return;this._localOrigins.updateViewMatrices(t.camera.viewMatrix);const r=t.camera.viewInverseTransposeMatrix,i=O(),n=new sU;let s=0,o=0;if(this._renderers.forEach(l=>{if(l.refCount===0)this._renderers.delete(l.key),l.dispose();else{let c=!0,u=!0;l.forEachRenderable(d=>{d.visible&&(s+=d.statistics.averageEdgeLength,o++,c&&d.regular&&(l.updateTechnique(t,!1),c=!1),u&&d.silhouette&&(l.updateTechnique(t,!0),u=!1))},e)}}),this._componentColorManager.garbageCollect(),this._componentColorManager.updateTextures(),o===0)return;const a=new Gvt(40*s/o,e);ne(i,r[3],r[7],r[11]),n.set(i),re(a.transformWorldFromViewTH,n.high),re(a.transformWorldFromViewTL,n.low),Ac(a.transformViewFromCameraRelativeRS,t.camera.viewMatrix),Uh(cde,a.transformViewFromCameraRelativeRS),Vw(a.transformNormalViewFromGlobal,cde),a.transformProjFromView=t.camera.projectionMatrix,this._updateObjectCameraDistances(t),this._renderers.forEach(l=>{this._renderRegularEdges(l,t,a),this._renderSilhouetteEdges(l,t,a)})}_updateTransparency(t){const e=tde(t.components.meta),r=rde(t.components.meta);e===t.edgeTransparency&&r===t.objectTransparency||(t.edgeTransparency=e,t.objectTransparency=r,this._renderers.get(t.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(t,e,r){t.getCombinedShaderTransformation(e,r);const i=e.localOrigin!=null?this._localOrigins.register(e.localOrigin):this._localOrigins.acquire(ne(this._tmpModelPosition,r[12],r[13],r[14]));return e.localOrigin=i.origin,kvt(i.origin.vec3,r),i}_updateComponentBuffer(t){const{meta:e,buffer:r}=t,i=new Uint8Array(4);for(let n=0;nthis._verticesBufferObject!=null?new pbt(new vp(this.rctx,kRe,{vertices:B_t,instances:c===cb.REGULAR?cF.glLayout:uF.glLayout},{vertices:this._verticesBufferObject,instances:Ar.createVertex(this.rctx,gr.STATIC_DRAW,c===cb.REGULAR?t.regular.instancesData.buffer:t.silhouette.instancesData.buffer)}),c===cb.REGULAR?t.regular.lodInfo:t.silhouette.lodInfo):null,o=t.regular.lodInfo.lengths.length>0?s(cb.REGULAR):null,a=t.silhouette.lodInfo.lengths.length>0?s(cb.SILHOUETTE):null,l=((o==null?void 0:o.vao.memoryEstimate)??0)+((a==null?void 0:a.vao.memoryEstimate)??0);return new mbt(o,a,{gpuMemoryUsage:l,externalMemoryUsage:n,averageEdgeLength:t.averageEdgeLength},r,tde(e.meta),rde(e.meta),e,i)}async _addGeometry(t,e,r,i,n,s){const o=r.vertexAttributes.get(E.POSITION),a=r.indices.get(E.POSITION),l=_e(),c=this._computeModelTransformWithLocalOrigin(t,r,l),u=new lde(o,a,l,c);return this._addPositionData(e,u,r.edgeIndicesLength,i,n,s)}async _addPositionData(t,e,r,i,n,s=!1){if(t.loaded==null)return;const o=this._createComponentBuffers([i]);if(o==null||r<=0)return;const a=this._acquireRenderer(i.type,!!n.hasSlicePlane,!0),{modelTransform:l,origin:c}=e,u=e.indices,d=e.position,p=d.data.length/d.size,m=aF.createBuffer(p);for(let v=0;v=65536?Uint32Array:Uint16Array,u=o?new c(o):null,d=[];let p=0;for(let b=0;b{Ws(i,s.center,e);const o=fe(i,r),a=s.radius,l=o<-a?1/0:oc.distanceToCamera=l)};this._perObjectData.forEach(n),this._perObjectDataEvictionCache.forEach(n)}_renderRegularEdges(t,e,r){const i=t.bindRegularEdges(r,e),n=r.transparency,s=e.camera.perScreenPixelRatio;t.forEachRenderable(o=>{if(!ode(o)||!o.visible)return;const a=dL(o.regular.lod.lengths,o.distanceToCamera,s);t.renderRegularEdges(i,o,r,e,a)},n)}_renderSilhouetteEdges(t,e,r){const i=t.bindSilhouetteEdges(r,e),n=r.transparency,s=e.camera.perScreenPixelRatio;t.forEachRenderable(o=>{if(!ade(o)||!o.visible)return;const a=dL(o.silhouette.lod.lengths,o.distanceToCamera,s);t.renderSilhouetteEdges(i,o,r,e,a)},n)}get test(){return{hasRenderedPrimitives:t=>{let e=!1;const r=t.perScreenPixelRatio,i=(n,s)=>n.forEachRenderable(o=>{o.visible&&!e&&(ode(o)&&(e=dL(o.regular.lod.lengths,o.distanceToCamera,r)>0),!e&&ade(o)&&(e=dL(o.silhouette.lod.lengths,o.distanceToCamera,r)>0))},s);return this._renderers.forEach(n=>{e||(i(n,zt.OPAQUE),i(n,zt.TRANSPARENT))}),e}}}};function nde(t){t!=null&&(t.vao.vertexBuffers.instances.dispose(),t.vao.disposeVAOOnly(),t.vao=null)}function hbt(t){let e=null,r=null;for(let i=0;i{this.loaded!=null&&(this.loaded=!0)})}}let dbt=class{constructor(e,r){this.buffer=e,this.meta=r}};class pbt{constructor(e,r){this.vao=e,this.lod=r}}class fbt{constructor(e,r){this.modelMatrix=e,this.origin=r}}let mbt=class{constructor(e,r,i,n,s,o,a,l){this.regular=e,this.silhouette=r,this.statistics=i,this.transform=n,this.edgeTransparency=s,this.objectTransparency=o,this.components=a,this.rendererKey=l,this.distanceToCamera=0,this.visible=!0}};function ode(t){return t.regular!=null}function ade(t){return t.silhouette!=null}function dL(t,e,r){const i=e*r,n=hDe(t,i,!0);return n===-1?iPromise.reject();function xp(t){return window.WebGL2RenderingContext&&t instanceof window.WebGL2RenderingContext}let ude=class{constructor(e,r,i,n,s,o,a,l,c){this.createQuery=e,this.deleteQuery=r,this.resultAvailable=i,this.getResult=n,this.disjoint=s,this.beginTimeElapsed=o,this.endTimeElapsed=a,this.createTimestamp=l,this.timestampBits=c}},qm=!1;function ybt(t,e){if(e.disjointTimerQuery)return null;let r=t.getExtension("EXT_disjoint_timer_query_webgl2");return r&&xp(t)?new ude(()=>t.createQuery(),i=>{t.deleteQuery(i),qm=!1},i=>t.getQueryParameter(i,t.QUERY_RESULT_AVAILABLE),i=>t.getQueryParameter(i,t.QUERY_RESULT),()=>t.getParameter(r.GPU_DISJOINT_EXT),i=>{qm||(qm=!0,t.beginQuery(r.TIME_ELAPSED_EXT,i))},()=>{t.endQuery(r.TIME_ELAPSED_EXT),qm=!1},i=>r.queryCounterEXT(i,r.TIMESTAMP_EXT),()=>t.getQuery(r.TIMESTAMP_EXT,r.QUERY_COUNTER_BITS_EXT)):(r=t.getExtension("EXT_disjoint_timer_query"),r?new ude(()=>r.createQueryEXT(),i=>{r.deleteQueryEXT(i),qm=!1},i=>r.getQueryObjectEXT(i,r.QUERY_RESULT_AVAILABLE_EXT),i=>r.getQueryObjectEXT(i,r.QUERY_RESULT_EXT),()=>t.getParameter(r.GPU_DISJOINT_EXT),i=>{qm||(qm=!0,r.beginQueryEXT(r.TIME_ELAPSED_EXT,i))},()=>{r.endQueryEXT(r.TIME_ELAPSED_EXT),qm=!1},i=>r.queryCounterEXT(i,r.TIMESTAMP_EXT),()=>r.getQueryEXT(r.TIMESTAMP_EXT,r.QUERY_COUNTER_BITS_EXT)):null)}function _bt(t,e){const r=t.capabilities.disjointTimerQuery;return r==null?null:new vbt(r,e)}let vbt=class{constructor(e,r){this._timer=e,this._queryPool=new Array,this._queryResults=new Map,this._currentQuery=null,r.forEach(i=>{const n=this._timer.createQuery(),s=this._timer.createQuery();this._queryPool.push(n,s),this._queryResults.set(i,null)})}start(){qm||(this._currentQuery=this._queryPool.pop(),this._currentQuery!=null&&(this._timer.disjoint(),this._timer.beginTimeElapsed(this._currentQuery)))}stop(e){if(this._timer.disjoint()||this._currentQuery==null||!this._queryResults.has(e))return this.abort(),null;this._timer.endTimeElapsed();const r=this._queryResults.get(e);if(r==null)return this._queryResults.set(e,this._currentQuery),this._currentQuery=null,null;if(!this._timer.resultAvailable(r))return this._queryPool.unshift(this._currentQuery),this._currentQuery=null,null;const i=this._timer.getResult(r)/1e6;return this._queryPool.unshift(r),this._queryResults.set(e,this._currentQuery),this._currentQuery=null,i}abort(){this._currentQuery!=null&&(this._timer.deleteQuery(this._currentQuery),this._queryPool.unshift(this._timer.createQuery()),this._currentQuery=null)}dispose(){this._currentQuery!=null&&this._timer.deleteQuery(this._currentQuery),this._queryPool.forEach(e=>{this._timer.deleteQuery(e)}),this._queryResults.forEach(e=>{e!=null&&this._timer.deleteQuery(e)})}};var mi;(function(t){t.OVERLAY="overlay",t.PREPARE="prepare",t.SHADOW_MAP="shadow map",t.LINEAR_DEPTH="linear depth",t.ACCUMULATED_SHADOWS="accumulated shadows",t.NORMALS="normals",t.OBJECT_AND_LAYER_ID_COLOR="object/layer id color",t.SSAO="SSAO",t.OPAQUE="opaque",t.OPAQUE_EDGES="opaque edges",t.VOXEL="voxel",t.TRANSPARENT="transparent",t.TRANSPARENT_EDGES="transparent edges",t.HUD_VISIBILITY="HUD visibility",t.TRANSPARENT_TERRAIN="transparent terrain",t.ENVIRONMENT="environment",t.LASER_LINE="laser line",t.OCCLUDED="occluded",t.ANTIALIASING="antialiasing",t.HIGHLIGHTS="highlights",t.HUD="HUD",t.HUD_OCCLUDED="HUD occluded",t.FINISH="finish"})(mi||(mi={}));const hde="Total";let bbt=class{constructor(e){this._rctx=e,this._startTimeStampCPU=0,this._lastTimeStampCPU=0,this._totalCPUTime=new dg(hde),this._cpuTimeSamplers=new Map(Object.values(mi).map(r=>[r,new dg(r)])),this._enableGPUTimer=0,this._totalGPUTime=new dg("GPU"),this._gpuTimeSamplers=new Map(Object.values(mi).map(r=>[r,new dg(r)])),this._totalTime=0,this._totalFrameCount=0}get totalCPUTimeSampler(){return this._totalCPUTime}get cpuTimeSamplers(){return Array.from(this._cpuTimeSamplers.values())}get totalGPUTimeSampler(){return this._totalGPUTime}get gpuTimeSamplers(){return Array.from(this._gpuTimeSamplers.values())}get gpuSamplingEnabled(){return this._gpuTimerPool!=null}get totalTime(){return this._totalTime}get totalFrameCount(){return this._totalFrameCount}get elapsedTime(){return performance.now()-this._startTimeStampCPU}enableGPUPerformanceInfo(){if(this._gpuTimerPool==null){const e=[...Object.values(mi),hde];this._gpuTimerPool=_bt(this._rctx,e)}return this._gpuTimerPool==null?{hasGPUTimerSupport:!1,remove:()=>{}}:(++this._enableGPUTimer,{hasGPUTimerSupport:!0,remove:SX(()=>{--this._enableGPUTimer,this._enableGPUTimer===0&&(this._gpuTimerPool=Le(this._gpuTimerPool))})})}startFrame(){this._startTimeStampCPU=this._lastTimeStampCPU=performance.now(),this._gpuTimerPool!=null&&this._gpuTimerPool.start()}advance(e){const r=performance.now();if(this._cpuTimeSamplers.get(e).record(r-this._lastTimeStampCPU),this._lastTimeStampCPU=r,this._gpuTimerPool!=null){const i=this._gpuTimerPool.stop(e);this._gpuTimeSamplers.get(e).record(i),this._gpuTimerPool.start()}}finishFrame(){if(this._gpuTimerPool!=null){const r=this._gpuTimerPool.stop(mi.FINISH);this._gpuTimeSamplers.get(mi.FINISH).record(r)}const e=performance.now()-this._startTimeStampCPU;this._totalTime=this._totalTime+e,this._totalCPUTime.record(e),this._gpuTimerPool!=null&&this._totalGPUTime.record(this.gpuTimeSamplers.reduce((r,i)=>r+(i.last||0),0)),++this._totalFrameCount}},Yl=class extends xe{get _bindParameters(){return this._renderContext.bindParameters}updateRenderFeature(t=null,e=!se("disable-feature:high-quality-idle")){this._renderStateFeatures=rse(e,t),this.notifyChange("_renderStateFeatures"),this._requestRender()}isFeatureEnabled(t,e=this._state){var r;return((r=this._renderStateFeatures)==null?void 0:r.get(e,t))??!1}setFeatureEnabled(t,e,r){var i;(i=this._renderStateFeatures)==null||i.set(e,t,r),this.notifyChange("_renderStateFeatures"),this._requestRender()}get _antialiasing(){return this._antialiasingEnabled||this.isFeatureEnabled(Hn.Antialiasing)}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(Hn.HighQualityTransparency)}get hasReflections(){return this.hasWater&&(this._ssrEnabled||this.isFeatureEnabled(Hn.WaterReflection))}get hasWater(){return this._hasWater||this._hasOverlayWater}constructor(t,e,r,i,n,s,o,a){super({}),this._stage=t,this._materialRepository=e,this._techniqueRepository=i,this._rctx=n,this._compositingHelper=s,this._magnifierHelper=o,this._requestRender=a,this._materialRenderers=new Nt,this._needsTransparentPass=!1,this._hasHUDElements=!1,this._hasHighlights=!1,this._hasWater=!1,this._hasOverlayWater=!1,this._renderOverlay=l=>{},this._isRendering=!1,this._fallbackDepthStencilTexture=null,this._sliceHelper=new Pvt,this._state=Cr.IDLE,this._renderStateFeatures=null,this._antialiasingEnabled=!0,this._highQualityTransparencyEnabled=!0,this._terrainRenderingEnabled=!0,this._terrainTransparency=_s.Opaque,this._ssrEnabled=!1,this._ssaoEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new V1t,this._handles=new Vi,this._renderHiddenTransparentEdges=()=>{},this._oitUsed=!1,this.updateRenderFeature(t.view.qualityProfile),this._smaaPass=new _A(this._rctx,i),a(),this._offscreen=new lvt(this._rctx,this._compositingHelper),this.performanceInfo=new bbt(this._rctx),this._shadowMap=new $J(this._rctx,t.viewingMode),this._ssaoHelper=new c3e(t.view,i,this._rctx,a),this._highlight=new nvt(i,this._rctx),this._shadowHighlight=new Rvt(this._rctx,t.viewingMode),this._shadowAccumulator=new gl(this._rctx,i,t,l=>{const c=this.shadowsEnabled;this._shadowMap.enabled=!0,this._prepare(l.camera,l.contentCamera),this._renderPlugins.prepareRender(),this._shadowMap.enabled=c},(l,c,u)=>{l.shadowMap.start(l.camera,c,u,!0,this._stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(D.Shadow,l.shadowMap),l.camera.setGLViewport(this._rctx),this._prepare(l.camera,l.contentCamera)},a),this._renderContext=new Mst(this._rctx,this._offscreen,this._shadowMap,this._ssaoHelper,this._sliceHelper),this._renderPlugins=new yA({renderContext:this._renderContext,techniqueRepository:i,textureRepository:r,materialRepository:this._materialRepository,requestRender:a,controller:t}),this.renderPassManager=new B1t(this._rctx,this._techniqueRepository),this._renderPlugins.add(this.renderPassManager.slots(),this.renderPassManager),this._handles.add([ue(()=>this._stage.view.state.camera,()=>a(),An),ue(()=>Kr.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,l=>{this._renderHiddenTransparentEdges=l?()=>this._renderEdges(zt.TRANSPARENT):()=>{},a()},Pr),ue(()=>this._ssaoEnabled||this.isFeatureEnabled(Hn.SSAO),l=>this._ssaoHelper.enabled=l,An)])}normalizeCtorArgs(){return{}}destroy(){this._handles.destroy(),this._smaaPass.dispose(),this._gpuTimerHandle=Pi(this._gpuTimerHandle),this._materialRenderers.forAll(t=>t.dispose()),this._materialRenderers.clear(),this._offscreen.dispose(),this._fallbackDepthStencilTexture=Le(this._fallbackDepthStencilTexture),this._shadowMap.dispose(),this._ssaoHelper.destroy(),this._highlight.dispose(),this._shadowHighlight.dispose(),this._shadowAccumulator.dispose(),this._edgeView=Me(this._edgeView),this.renderPassManager.destroy(),w2e.prune()}disposeOffscreenBuffers(){this._offscreen.dispose(),this._shadowMap.disposeOffscreenBuffers(),this._smaaPass.disable(),this._ssaoHelper.disposeOffscreenBuffers()}get updating(){return this._antialiasing&&this._smaaPass.updating||this._edgeView!=null&&this._edgeView.updating||this._shadowAccumulator.running||this._renderPlugins.updating||!this.isCameraFinal}ensureEdgeView(){if(this._edgeView==null){const t=this._stage.view.resourceController;this._edgeView=new Td({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniqueRepository:this._techniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:wbt(t)}),this._handles.add(ue(()=>_h(this._edgeView,e=>e.updating),()=>this._requestRender(),Br)),this._requestRender()}return this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return I6(this._bindParameters.ssr.reprojectionMatrix,yn)}set _reprojectionMatrix(t){_X(this._bindParameters.ssr.reprojectionMatrix,t)&&this.notifyChange("isCameraFinal")}get shadowsEnabled(){var t;return!!((t=this._shadowMap)!=null&&t.enabled)}setParameters(t){var i,n;const{_shadowMap:e,_bindParameters:r}=this;if(((i=t.qualitySettings)==null?void 0:i.reflections)!==void 0&&this._ssrEnabled!==t.qualitySettings.reflections&&(this._ssrEnabled=t.qualitySettings.reflections,this._requestRender()),((n=t.qualitySettings)==null?void 0:n.ambientOcclusion)!==void 0&&this._ssaoEnabled!==t.qualitySettings.ambientOcclusion&&(this._ssaoEnabled=t.qualitySettings.ambientOcclusion,this._requestRender()),t.shadowMap!==void 0&&this._shadowMap.enabled!==t.shadowMap&&(this._shadowMap.enabled=t.shadowMap,this._requestRender()),t.shadowMapMaxCascades!==void 0&&e.maxCascades!==t.shadowMapMaxCascades&&(e.maxCascades=t.shadowMapMaxCascades,this._requestRender()),t.environment!=null){t.environment.weather!=null&&(this._bindParameters.weather=t.environment.weather,this._bindParameters.weatherVisible=!!t.weatherVisible);const s=t.environment.lighting.type!=="virtual";r.enableFillLights!==s&&(r.enableFillLights=s,this._requestRender())}t.background&&this._offscreen.background!==t.background&&(this._offscreen.background=t.background,this._requestRender()),t.antialiasingEnabled!==void 0&&this._antialiasingEnabled!==t.antialiasingEnabled&&(this._antialiasingEnabled=t.antialiasingEnabled,this._requestRender()),t.highQualityTransparency!==void 0&&this._highQualityTransparencyEnabled!==t.highQualityTransparency&&(this._highQualityTransparencyEnabled=t.highQualityTransparency,this._requestRender()),t.defaultHighlightOptions!==void 0&&(this._highlight.setDefaultOptions(t.defaultHighlightOptions),this._shadowHighlight.setDefaultOptions(t.defaultHighlightOptions),this._requestRender()),t.overlays!==void 0&&this._bindParameters.overlays!==t.overlays&&(this._bindParameters.overlays=t.overlays,this._requestRender()),t.hasOverlayWater!==void 0&&this._hasOverlayWater!==t.hasOverlayWater&&(this._hasOverlayWater=t.hasOverlayWater,this._requestRender()),t.renderOverlay!==void 0&&this._renderOverlay!==t.renderOverlay&&(this._renderOverlay=t.renderOverlay,this._requestRender()),t.slicePlane!==void 0&&this._sliceHelper.plane!==t.slicePlane&&(this._sliceHelper.plane=t.slicePlane,this._requestRender()),t.terrainRenderingEnabled!==void 0&&this._terrainRenderingEnabled!==t.terrainRenderingEnabled&&(this._terrainRenderingEnabled=t.terrainRenderingEnabled,this._requestRender()),t.terrainTransparency!==void 0&&this._terrainTransparency!==t.terrainTransparency&&(this._terrainTransparency=t.terrainTransparency,this._requestRender()),t.shadowCastOptions!==void 0&&this._shadowAccumulator.setOptions(t.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(t,e){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:i,updates:n}=t;if(r.length===0&&i.length===0&&n.length===0)return;const s=HCe(t);let o=!1;s.forEach((a,l)=>{if(e.done)return;let c=this._materialRenderers.find(u=>u.material===l);c==null&&a.adds.length>0&&(c=new r3e(this._rctx,this._materialRepository,l),this._materialRenderers.push(c)),c&&(c.modify(a),c.isEmpty&&(o=!0)),a.removes.forEach(u=>t.removes.removeUnordered(u)),a.adds.forEach(u=>t.adds.removeUnordered(u)),a.updates.forEach(u=>t.updates.removeUnordered(u)),e.madeProgress()}),o&&this._materialRenderers.filterInPlace(a=>!a.isEmpty||(a.dispose(),!1)),this._hasHighlights=this._materialRenderers.some(a=>a.hasHighlights),this._bindParameters.hasOccludees=this._materialRenderers.some(a=>a.hasOccludees),this._hasWater=this._materialRenderers.some(a=>a.hasWater),this._hasHUDElements=this._materialRenderers.some(a=>a.requiresSlot(le.LINE_CALLOUTS_HUD_DEPTH,D.Color)||a.requiresSlot(le.HUD_MATERIAL,D.Color)||a.requiresSlot(le.LABEL_MATERIAL,D.Color)),this._requestRender()}updateAnimation(t){const e=this._hasAnimations;return this._hasAnimations=!1,this._materialRenderers.forAll(r=>this._hasAnimations=r.updateAnimation(t)||this._hasAnimations),this._hasAnimations=this._renderPlugins.updateAnimation(t)||this._hasAnimations,this._hasAnimations!==e&&(this._gpuTimerHandle=e?Pi(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}render(t,e,r,i,n){this._isRendering=!0,this._oitUsed=!1,this.performanceInfo.startFrame();const{camera:s,contentCamera:o,mode:a,alignPixelEnabled:l}=r;this._state=a,this._renderOverlay(n),this.performanceInfo.advance(mi.OVERLAY),this._renderContext.time=n,this._bindParameters.transparencyPassType=rt.NONE,this._bindParameters.alignPixelEnabled=l;const c=this._offscreen;c.setupRenderTarget(this.hasReflections);const u=e0(this._sliceHelper.plane);i===hw.OFF&&(this._sliceHelper.plane=null),this._rctx.bindFramebuffer(t),s.setGLViewport(this._rctx),this._prepare(s,o),this._renderPlugins.prepareRender(),this.performanceInfo.advance(mi.PREPARE);const d=this._computeDepthRange(s);this._renderShadowMap(t,s,this._bindParameters.lighting.mainLight.direction,d),this.performanceInfo.advance(mi.SHADOW_MAP),c.initializeFrame(s),this._ensureBindParameters(s,o);const p=this._terrainRenderingEnabled&&(this._terrainTransparency===_s.Semitransparent||this._terrainTransparency===_s.TransparentWithDraped),m=this._highQualityTransparency&&p,y=this._needsTransparentPass||this._renderPlugins.needsTransparentPass;this._prepareShaders(m,y),this._renderLinearDepth(),this.performanceInfo.advance(mi.LINEAR_DEPTH),this._accumulateShadows(d,s,o),this.performanceInfo.advance(mi.ACCUMULATED_SHADOWS),this._renderNormal(),this.performanceInfo.advance(mi.NORMALS),this._ensureBindParametersSSR(n),this._renderSSAO(n),this.performanceInfo.advance(mi.SSAO),this._renderContext.output=D.Color,c.bindFramebuffer(),this._renderOpaqueGeometry(),this.performanceInfo.advance(mi.OPAQUE),this._renderTerrainLinearDepth(m),this._setMultipassTerrain(m),this._renderEdges(zt.OPAQUE),this.performanceInfo.advance(mi.OPAQUE_EDGES),this._offscreen.bindTarget(this._offscreen.currentColorTarget,this._offscreen.mainDepth),this._renderSlot(le.VOXEL),this.performanceInfo.advance(mi.VOXEL),this._renderHiddenTransparentEdges(),y&&(this._oitEnabled?this._renderOITPass(wT.Geometry):this._renderTransparentGeometry()),this.performanceInfo.advance(mi.TRANSPARENT),this._renderGeometryLinearDepth(m);const _=this._renderHUDVisibility(m);m||this._renderInternalSlot(le.LINE_CALLOUTS),this.performanceInfo.advance(mi.HUD_VISIBILITY),this._renderObjectAndLayerIdColor(e),this.performanceInfo.advance(mi.OBJECT_AND_LAYER_ID_COLOR),this._renderEdges(zt.TRANSPARENT,m),this.performanceInfo.advance(mi.TRANSPARENT_EDGES),this._renderTransparentTerrain(),p&&_&&(m?this._renderLineCallouts(tc.Occluded):c.compositeTransparentTerrainOntoHUDVisibility(this._bindParameters),this._renderHUD(tc.Occluded,c.framebuffer),this.performanceInfo.advance(mi.HUD_OCCLUDED)),this.performanceInfo.advance(mi.TRANSPARENT_TERRAIN),this._setTerrainCulling(!1),p&&(c.compositeTransparentTerrainOntoMain(this._bindParameters),m&&(this._renderEdges(zt.OPAQUE),this.performanceInfo.advance(mi.OPAQUE_EDGES),y&&(this._oitEnabled?this._renderOITPass(wT.Geometry):this._renderTransparentGeometry()),this.performanceInfo.advance(mi.TRANSPARENT),this._renderEdges(zt.TRANSPARENT),this.performanceInfo.advance(mi.TRANSPARENT_EDGES))),m&&this._renderLineCallouts(tc.NotOccluded),this._setMultipassEnabled(!1),this._shadowAccumulator.render(this._bindParameters),c.renderToTargets(()=>{this._renderInternalSlot(le.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderSlot(le.POSTPROCESSING_ENVIRONMENT_TRANSPARENT),this._renderSlot(le.LASERLINES)},c.currentColorTarget,c.mainDepth),this.performanceInfo.advance(mi.ENVIRONMENT),this._renderPlugins.needsLaserlineWithContrastControl&&c.renderTmpAndCompositeToMain(()=>this._renderSlot(le.LASERLINES_CONTRAST_CONTROL),this._bindParameters,ca.PremultipliedAlpha),this.performanceInfo.advance(mi.LASER_LINE),this._renderOccluded(),this.performanceInfo.advance(mi.OCCLUDED);const v=i===hw.ON&&this._magnifierHelper.enabled,b=v&&t==null?this._offscreen.getFramebuffer(this._offscreen.tmpColor,this._offscreen.tmpDepth):t;this._rctx.bindFramebuffer(b);const x=this._offscreen.colorTexture;this._renderAntiAliasing(x)||x==null||this._compositingHelper.composite(this._bindParameters,x,ca.None),this.performanceInfo.advance(mi.ANTIALIASING),this._renderHUD(tc.NotOccluded,b),this.performanceInfo.advance(mi.HUD),this._renderHighlights(b,this._bindParameters),this.performanceInfo.advance(mi.HIGHLIGHTS),v&&this._magnifierHelper.render(this._rctx,this._bindParameters),b!==t&&(this._rctx.bindFramebuffer(t),this._compositingHelper.composite(this._bindParameters,this._offscreen.tmpColorTexture,ca.None)),this._disposeOITBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this._sliceHelper.plane=u,this._isRendering=!1,this.onPostRender&&this.onPostRender(),this.performanceInfo.finishFrame()}_prepareShaders(t,e){this._renderContext.output=D.Color,this._prepareOpaqueGeometrySlots(),this._setMultipassTerrain(t),this._prepareSlots(le.TRANSPARENT_TERRAIN),this._setMultipassTerrain(!1),t||this._prepareInternalSlots(this._materialRenderers,le.LINE_CALLOUTS),e&&this._prepareTransparencySlots(),this._prepareInternalSlots(this._materialRenderers,le.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._prepareSlots(le.POSTPROCESSING_ENVIRONMENT_TRANSPARENT,le.LASERLINES),this._rctx.gl.flush()}_renderObjectAndLayerIdColor(t){if(t!=null&&se("enable-feature:objectAndLayerId-rendering")){const e=this._renderContext.output;this._rctx.bindFramebuffer(t),this._offscreen.renderToFBO(()=>this._renderGeometryAndTransparentTerrainPass(D.ObjectAndLayerIdColor),[0,0,0,0],!0,!0),this._rctx.bindFramebuffer(t),this._offscreen.renderToFBO(()=>{this._bindParameters.renderTransparentlyOccludedHUD=tc.NotOccluded,this._renderInternalSlot(le.HUD_MATERIAL)},void 0,!0,!0),this._renderContext.output=e}}finish(t){this._hasAnimations||this._animationTimestep.clear();const e=this.performanceInfo.gpuSamplingEnabled,r=t===dn.BACKGROUND;if(r||e){const i=r?this.performanceInfo.elapsedTime:0,n=e?this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.getError(),s=Math.max(i,n);this._animationTimestep.frame(s,r)}}readDepthPixels(t,e,r){const i=this._offscreen.bindTarget(this._offscreen.linearDepth,this._offscreen.tmpDepth);if(!this._needsLinearDepth){this._ensureBindParameters(t,t),this._bindParameters.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const n=yi.COLOR_BUFFER_BIT|yi.DEPTH_BUFFER_BIT|yi.STENCIL_BUFFER_BIT;this._rctx.clearSafe(n),this._renderGeometryAndTransparentTerrainPass(D.Depth)}i.readPixels(e[0],e[1],e[2],e[3],Tt.RGBA,Un.UNSIGNED_BYTE,r)}readHUDVisibility(t,e,r,i,n){this._offscreen.bindTarget(this._offscreen.hudVisibility).readPixels(t,e,r,i,Tt.RGBA,Un.UNSIGNED_BYTE,n)}readAccumulatedShadow(t){return this._shadowAccumulator.readAccumulatedShadow(t[0],t[1])}_setMultipassTerrain(t){this._setMultipassEnabled(t),this._setTerrainCulling(t)}_setMultipassEnabled(t){this._bindParameters.multipassTerrain.enabled=this._bindParameters.multipassGeometry.enabled=t}_setTerrainCulling(t){this._bindParameters.multipassTerrain.cullAboveGround=t}_prepareSlots(...t){this._renderPlugins.prepareSlots(t)}_renderSlot(t){this._bindParameters.slot=t,this._renderPlugins.render()}_renderEdges(t,e=!1){const r=this._edgeView;r!=null&&r.shouldRender()&&this._offscreen.renderTmpAndCompositeToMain(()=>r.render(this._bindParameters,t),this._bindParameters,ca.Alpha,e)}_renderShadowMap(t,e,r,i){const n=this._shadowMap;n.enabled&&(n.start(e,r,i,this.isFeatureEnabled(Hn.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._shadowHighlight.updateParameters(e,r),this._needsShadowHighlight?(this._renderShadowCascades(D.ShadowHighlight,this._shadowMap,s=>n.takeCascadeSnapshotTo(s,JS.Highlight)),n.clear(),this._renderShadowCascades(D.ShadowExcludeHighlight,this._shadowMap,s=>{n.takeCascadeSnapshotTo(s,JS.Default),this._renderGeometryAndTransparentTerrainPass(D.ShadowHighlight)})):this._renderShadowCascades(D.Shadow),n.finish(t),e.setGLViewport(this._rctx))}_renderShadowCascades(t,e=this._shadowMap,r=i=>{}){for(const i of e.cascades)i.camera.setGLViewport(this._rctx),this._prepare(i.camera,i.camera),this._renderGeometryAndTransparentTerrainPass(t),r(i)}get _needsLinearDepth(){return this._ssaoHelper.active||this._renderPlugins.needsLinearDepth||this.hasReflections||this._needsShadowHighlight||this._needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?this._offscreen.renderToTargets(()=>this._renderGeometryAndTransparentTerrainPass(D.Depth),this._offscreen.linearDepth,this._offscreen.tmpDepth,[0,0,0,0],!0,!0):this._offscreen.disposeTarget(this._offscreen.linearDepth),this._bindParameters.linearDepthTexture=this._offscreen.linearDepthTexture}_renderTerrainLinearDepth(t){if(t){const e=this._renderContext.output;this._renderContext.output=D.Depth,this._offscreen.renderToTargets(()=>this._renderTransparentTerrain(),this._offscreen.terrainLinearDepth,this._offscreen.tmpDepth,[-1e10,-1e10,-1e10,1],!0,!0),this._renderContext.output=e}else this._offscreen.disposeTarget(this._offscreen.terrainLinearDepth);this._bindParameters.multipassTerrain.linearDepthTexture=this._offscreen.terrainLinearDepthTexture}_renderGeometryLinearDepth(t){if(t){const e=this._renderContext.output;this._offscreen.renderToTargets(()=>this._renderGeometryPass(D.Depth),this._offscreen.geometryLinearDepth,this._offscreen.tmpDepth,[1,1,1,1],!0,!0),this._renderContext.output=e}else this._offscreen.disposeTarget(this._offscreen.geometryLinearDepth);this._bindParameters.multipassGeometry.linearDepthTexture=this._offscreen.geometryLinearDepthTexture}get _needsNormal(){return this._ssaoHelper.active}_renderNormal(){this._needsNormal?this._offscreen.renderToTargets(()=>{this._renderGeometryAndTransparentTerrainPass(D.Normal)},this._offscreen.normal,this._offscreen.tmpDepth,[0,0,0,0],!0,!0):this._offscreen.disposeTarget(this._offscreen.normal)}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowCast}_computeDepthRange(t){if(!this._needsDepthRange)return kW;const e=S1t(t,this._materialRenderers,this._stage.layers);return iE(e,this.renderPlugins.queryDepthRange(t)),e.near=Math.max(t.near,e.near),e.far=Math.min(t.far,e.far),e}_renderGeometryAndTransparentTerrainPass(t){this._renderContext.output=t,this._prepareSlots(le.TRANSPARENT_TERRAIN),this._renderGeometryPass(t),this._renderTransparentTerrain()}_renderGeometryPass(t){this._renderContext.output=t,this._prepareSlots(le.TRANSPARENT_MATERIAL),this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderSSAO(t){this._ssaoHelper.render(this._bindParameters,t,this._offscreen.linearDepthTexture,this._offscreen.normalTexture)}_prepareOpaqueGeometrySlots(){this._prepareSlots(le.INTEGRATED_MESH,le.OPAQUE_TERRAIN,le.OPAQUE_MATERIAL,le.POSTPROCESSING_ENVIRONMENT_OPAQUE),this._prepareInternalSlots(this._materialRenderers,le.OPAQUE_MATERIAL)}_renderOpaqueGeometry(){this._renderSlot(le.INTEGRATED_MESH),this._renderSlot(le.OPAQUE_TERRAIN),this._renderInternalSlot(le.OPAQUE_MATERIAL),this._renderSlot(le.OPAQUE_MATERIAL),this._renderSlot(le.POSTPROCESSING_ENVIRONMENT_OPAQUE)}_renderTransparentGeometry(){this._renderInternalSlot(le.TRANSPARENT_MATERIAL),this._renderSlot(le.TRANSPARENT_MATERIAL)}_renderTransparentTerrain(){this._renderSlot(le.TRANSPARENT_TERRAIN)}_renderHUDVisibility(t){let e=!1;return this._renderContext.offscreenRenderingHelper&&this._renderContext.offscreenRenderingHelper.renderHUDVisibility(()=>{this._bindParameters.hudVisibilityTexture=this._renderContext.offscreenRenderingHelper.hudVisibilityTexture,e=this._renderInternalSlot(le.OCCLUSION_PIXELS)},t),e}_renderLineCallouts(t){this._bindParameters.renderTransparentlyOccludedHUD=t,t===tc.Occluded?this._offscreen.renderToTargets(()=>this._renderInternalSlot(le.LINE_CALLOUTS),this._offscreen.currentColorTarget,this._offscreen.tmpDepth,void 0,!0,!0):this._renderInternalSlot(le.LINE_CALLOUTS)}_renderHUD(t,e){this._hasHUDElements&&(this._oitEnabled?(this._renderOITPass(wT.HUD,t),this._rctx.bindFramebuffer(e),this._compositingHelper.composite(this._bindParameters,this._offscreen.hudColorTexture,ca.PremultipliedAlpha)):t===tc.Occluded?this._offscreen.renderToTargets(()=>this._renderHUDElements(tc.Occluded),this._offscreen.currentColorTarget,this._offscreen.tmpDepth,void 0,!0,!0):this._renderHUDElements(t))}_renderHUDElements(t){this._bindParameters.renderTransparentlyOccludedHUD=t,this._prepareInternalSlots(this._materialRenderers,le.LINE_CALLOUTS_HUD_DEPTH,le.HUD_MATERIAL,le.LABEL_MATERIAL),this._renderInternalSlot(le.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(le.HUD_MATERIAL),this._renderInternalSlot(le.LABEL_MATERIAL)}get _needsHighlight(){return this._hasHighlights||this._renderPlugins.needsHighlight}get _needsShadowHighlight(){return this._shadowMap.enabled&&this._shadowHighlight.isVisible&&this._needsHighlight}_renderHighlights(t,e){if(!this._needsHighlight)return void this._offscreen.disposeTarget(this._offscreen.highlight);const r=this._highlight,i=this._offscreen.renderToTargets(()=>{this._renderGeometryAndTransparentTerrainPass(D.Highlight),this._rctx.clearSafe(yi.DEPTH_BUFFER_BIT),this._renderHUDElements(tc.Both)},this._offscreen.highlight,this._offscreen.tmpDepth,[0,0,0,0],!0,!0);this._bindParameters.highlightColorTexture=i.colorTexture,this._needsShadowHighlight&&this._shadowHighlight.render(e,t),r.render(this._bindParameters,i,t)}get _needsShadowCast(){return this._shadowAccumulator.isAccumulating}_accumulateShadows(t,e,r){this._needsShadowCast&&this._offscreen.linearDepthTexture!=null&&this._shadowAccumulator.renderAccumulation(this._offscreen.linearDepthTexture,t,e,r)}_prepareTransparencySlots(){this._renderContext.output=D.Alpha,this._bindParameters.transparencyPassType=rt.Alpha,this._prepareInternalSlots(this._materialRenderers,le.TRANSPARENT_MATERIAL),this._prepareSlots(le.TRANSPARENT_MATERIAL),this._renderContext.output=D.Color,this._bindParameters.transparencyPassType=rt.Color,this._prepareInternalSlots(this._materialRenderers,le.TRANSPARENT_MATERIAL),this._prepareSlots(le.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=rt.FrontFace,this._prepareInternalSlots(this._materialRenderers,le.TRANSPARENT_MATERIAL),this._prepareSlots(le.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=rt.NONE}_renderOITPass(t,e=tc.Both){const r=t===wT.HUD,i=r?()=>this._renderHUDElements(e):()=>this._renderTransparentGeometry(),n=o=>{this._bindParameters.transparencyPassType=o,this._offscreen.renderOITPass(i,o,r)},s=this._renderContext.output;this._renderContext.output=D.Alpha,n(rt.Alpha),this._renderContext.output=D.Color,n(rt.Color),n(rt.FrontFace),this._offscreen.compositeTransparentOntoOpaque(this._bindParameters,r),this._bindParameters.transparencyPassType=rt.NONE,this._renderContext.output=s,this._oitUsed=!0}_disposeOITBuffers(){this._oitUsed||(this._offscreen.disposeTarget(this._offscreen.alphaFloatTarget),this._offscreen.disposeTarget(this._offscreen.colorFloatTarget),this._offscreen.disposeTarget(this._offscreen.frontFaceTarget))}_renderOccluded(){let t=0;kc.clear(),this._materialRenderers.forAll(s=>{s.material&&s.material.isVisible()&&s.material.renderOccluded===Ri.OccludeAndTransparentStencil&&(t|=s.material.renderOccluded,kc.push(s))});const e=this._offscreen,r=(s,o,a,l,c)=>{t&o&&(e.renderToTargets(a,e.tmpColor,e.mainDepth,[0,0,0,0],l,c),e.compositeOccludedOntoMain(this._bindParameters,s))};kc.length!==0&&(this._prepareInternalSlots(kc,le.OCCLUDER_MATERIAL,le.TRANSPARENT_OCCLUDER_MATERIAL),this._renderInternalSlot(le.OCCLUDER_MATERIAL,kc),r(.5,Ri.OccludeAndTransparentStencil,()=>this._renderInternalSlot(le.TRANSPARENT_OCCLUDER_MATERIAL,kc),!1,!1)),kc.clear(),this._materialRenderers.forAll(s=>{s.material&&s.material.isVisible()&&(s.material.renderOccluded===Ri.OccludeAndTransparent||s.material.renderOccluded===Ri.Transparent||s.material.renderOccluded===Ri.Opaque)&&(t|=s.material.renderOccluded,kc.push(s))});const i=this._renderPlugins.renderOccludedFlags;if(t|=i,!t)return;const n=s=>{this._renderContext.renderOccludedMask=s,this._prepareInternalSlots(kc,le.OPAQUE_MATERIAL,le.TRANSPARENT_MATERIAL,le.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),i>Ri.Occlude&&this._renderSlot(le.OCCLUDED_TERRAIN),this._renderInternalSlot(le.OPAQUE_MATERIAL,kc),this._renderInternalSlot(le.TRANSPARENT_MATERIAL,kc),this._renderInternalSlot(le.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,kc),this._renderContext.resetRenderOccludedMask()};this._renderContext.output=D.Color,r(.5,Ri.OccludeAndTransparent,()=>n(Ri.OccludeAndTransparent),!0,Rl.OutlineVisualElementMask),r(.5,Ri.Transparent,()=>n(Ri.Transparent),!0,Rl.OutlineVisualElementMask),r(1,Ri.Opaque,()=>n(Ri.Opaque),!0,Rl.OutlineVisualElementMask),kc.clear()}_renderAntiAliasing(t){if(this._antialiasing){if(this._smaaPass.enable(()=>this._requestRender())&&t!=null)return this._smaaPass.render(t),!0}else this._smaaPass.disable();return!1}_prepare(t,e){this._needsTransparentPass=this._materialRenderers.some(r=>r.requiresSlot(le.TRANSPARENT_MATERIAL,D.Color)),this._bindParameters.camera=t,this._bindParameters.contentCamera=e}_ensureBindParameters(t,e){this._bindParameters.camera=t,this._bindParameters.contentCamera=e;const r=this._renderContext.offscreenRenderingHelper;this._bindParameters.hudVisibilityTexture=r.hudVisibilityTexture,this._bindParameters.mainColorTexture=r.mainColorTexture,this._bindParameters.highlightDepthTexture=r.depthTexture??this._getFallbackDepthTexture()}_ensureBindParametersSSR(t){if(this._bindParameters.ssr.enabled=this.hasReflections,this._bindParameters.ssr.enabled){this._ssrEnableTime==null&&(this._ssrEnableTime=t),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=yn:(us(pde,this._bindParameters.camera.viewMatrix),us(dde,this._bindParameters.camera.projectionMatrix),Vr(e2,pde,dde),Vr(e2,this._renderContext.lastFrameCamera.viewMatrix,e2),Vr(e2,this._renderContext.lastFrameCamera.projectionMatrix,e2),this._reprojectionMatrix=e2),this._bindParameters.ssr.lastFrameColorTexture=this._offscreen.lastFrameColorTexture;const e=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=e>0?Math.min(e,t-this._ssrEnableTime)/e:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=yn,this._bindParameters.ssr.lastFrameColorTexture=null,this._ssrEnableTime=null}_prepareInternalSlots(t,...e){for(const r of e)this._bindParameters.slot=r,t.forAll(i=>{i.material.shouldRender(this._renderContext)&&i.prepareTechnique(this._renderContext)})}_renderInternalSlot(t,e=this._materialRenderers){let r=!1;return this._bindParameters.slot=t,e.forAll(i=>{if(i.material.shouldRender(this._renderContext)){const n=i.prepareTechnique(this._renderContext);n!=null&&(i.render(this._renderContext,n),r=!0)}}),r}_getFallbackDepthTexture(){return this._fallbackDepthStencilTexture||(this._fallbackDepthStencilTexture=yxe(this._rctx)),this._fallbackDepthStencilTexture}get gpuMemoryUsage(){var t,e,r,i,n;return{offscreen:((t=this._offscreen)==null?void 0:t.gpuMemoryUsage)??0,highlights:(((e=this._highlight)==null?void 0:e.gpuMemoryUsage)??0)+(((r=this._shadowHighlight)==null?void 0:r.gpuMemoryUsage)??0),shadows:((i=this._shadowMap)==null?void 0:i.gpuMemoryUsage)??0,ssao:((n=this._ssaoHelper)==null?void 0:n.gpuMemoryUsage)??0}}get test(){const t=this;return{offscreen:this._offscreen,shadowMap:this._shadowMap,ssao:this._ssaoHelper,highlight:this._highlight,lighting:this._bindParameters.lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,weatherIsFading:this._bindParameters.cloudsFade.isFading,resetRenderStateFeatures:()=>{t._renderStateFeatures=rse()},getFramebufferTexture:e=>{switch(e){case Ny.Color:return t._offscreen.colorTexture;case Ny.LinearDepth:return t._offscreen.linearDepthTexture;case Ny.Normals:return t._offscreen.normalTexture;case Ny.ShadowMap:return t._shadowMap.depthTexture;case Ny.HudVisibility:return t._offscreen.hudVisibilityTexture;case Ny.Highlight:return t._offscreen.highlightTexture}}}}};var wT,Ny;h([f()],Yl.prototype,"_renderPlugins",void 0),h([f()],Yl.prototype,"_shadowAccumulator",void 0),h([f()],Yl.prototype,"_state",void 0),h([f()],Yl.prototype,"_renderStateFeatures",void 0),h([f()],Yl.prototype,"_antialiasingEnabled",void 0),h([f({readOnly:!0})],Yl.prototype,"_antialiasing",null),h([f()],Yl.prototype,"_ssaoEnabled",void 0),h([f()],Yl.prototype,"_smaaPass",void 0),h([f({autoDestroy:!0})],Yl.prototype,"_edgeView",void 0),h([f()],Yl.prototype,"updating",null),h([f()],Yl.prototype,"isCameraFinal",null),Yl=h([N("esri.views.3d.webgl-engine.lib.Renderer")],Yl),function(t){t[t.Geometry=0]="Geometry",t[t.HUD=1]="HUD"}(wT||(wT={})),function(t){t[t.Color=0]="Color",t[t.LinearDepth=1]="LinearDepth",t[t.Normals=2]="Normals",t[t.ShadowMap=3]="ShadowMap",t[t.HudVisibility=4]="HudVisibility",t[t.Highlight=5]="Highlight"}(Ny||(Ny={}));const kc=new Nt,dde=_e(),pde=_e(),e2=_e();function wbt(t){return e=>t.immediate.schedule(e)}let $Pe=class IPe{constructor(e){this._rctx=e,this._indexBuffer=this._createIndexbuffer(),this._program=this._createHelperProgram()}static getShaderSources(){return{vertex:`#version 300 es + precision highp float; + + void main(void) { + gl_Position = vec4(0.0, 0.0, float(gl_VertexID)-2.0, 1.0); + }`,fragment:`#version 300 es + precision highp float; + + out vec4 fragColor; + + void main(void) { + fragColor = vec4(0.0, 0.0, 0.0, 1.0); + }`}}_createHelperProgram(){const e=IPe.getShaderSources();return this._rctx.programCache.acquire(e.vertex,e.fragment,new Map([]))}_createIndexbuffer(){return Ar.createIndex(this._rctx,gr.STATIC_DRAW,new Uint32Array([0]))}resetIndicesType(){this._program.compiled&&this._indexBuffer&&(this._rctx.bindVAO(null),this._rctx.useProgram(this._program),this._rctx.bindBuffer(this._indexBuffer,bt.ELEMENT_ARRAY_BUFFER),this._rctx.drawElements(Et.POINTS,1,Qe.UNSIGNED_INT,0))}dispose(){this._program.dispose(),this._indexBuffer.dispose()}},fde=class{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:ve.ONE,dstRGB:ve.ZERO,srcAlpha:ve.ONE,dstAlpha:ve.ZERO},this.blendEquation={mode:Zf.ADD,modeAlpha:Zf.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=qd.BACK,this.frontFace=NS.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=Hr.LESS,this.clearDepth=1,this.depthWrite=!0,this.depthRange={zNear:0,zFar:1},this.viewport=null,this.stencilTest=!1,this.polygonOffsetFill=!1,this.polygonOffset=[0,0],this.stencilFunction={face:qd.FRONT_AND_BACK,func:Hr.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:qd.FRONT_AND_BACK,fail:_n.KEEP,zFail:_n.KEEP,zPass:_n.KEEP},this.clearColor={r:0,g:0,b:0,a:0},this.program=null,this.vertexBuffer=null,this.indexBuffer=null,this.uniformBuffer=null,this.pixelPackBuffer=null,this.pixelUnpackBuffer=null,this.copyReadBuffer=null,this.copyWriteBuffer=null,this.uniformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array,this.vertexArrayObject=null}},xbt=class{constructor(e){this._allocations=new Map,e?Error.stackTraceLimit=1/0:(this.add=()=>{},this.remove=()=>{})}add(e){this._allocations.set(e,new Error().stack)}remove(e){this._allocations.delete(e)}get information(){let e="";if(this._allocations.size>0){e+=`${this._allocations.size} live object allocations: +`;const r=new Map;this._allocations.forEach(i=>{r.set(i,(r.get(i)??0)+1)}),r.forEach((i,n)=>{const s=n.split(` +`);s.shift(),s.shift(),e+=`${i}: ${s.shift()} +`,s.forEach(o=>e+=` ${o} +`)})}return e}};const Tbt={RECORD_ALLOCATIONS:!1};let Sbt=class{constructor(){for(this._current=new Array,this._max=new Array,this._allocations=new xbt(Tbt.RECORD_ALLOCATIONS);this._current.lengthe+r,0)}get resourceInformation(){let e="";if(this.total>0){e+=`Live objects: +`;for(let r=0;r0&&(e+=`${Es[r]}: ${i} +`)}}return e+=this._allocations.information,e}},Ebt=class{constructor(e,r,i){const n=r.textureFilterAnisotropic,s=i.maxAnisotropy??1/0;this.versionString=e.getParameter(e.VERSION),this.maxVertexTextureImageUnits=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.maxVertexAttributes=e.getParameter(e.MAX_VERTEX_ATTRIBS),this.maxMaxAnisotropy=n?Math.min(e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY),s):1,this.maxTextureImageUnits=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxRenderbufferSize=e.getParameter(e.MAX_RENDERBUFFER_SIZE),this.maxViewportDims=e.getParameter(e.MAX_VIEWPORT_DIMS),xp(e)?(this.maxUniformBufferBindings=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS),this.maxVertexUniformBlocks=e.getParameter(e.MAX_VERTEX_UNIFORM_BLOCKS),this.maxFragmentUniformBlocks=e.getParameter(e.MAX_FRAGMENT_UNIFORM_BLOCKS),this.maxUniformBlockSize=e.getParameter(e.MAX_UNIFORM_BLOCK_SIZE),this.uniformBufferOffsetAlignment=e.getParameter(e.UNIFORM_BUFFER_OFFSET_ALIGNMENT),this.maxArrayTextureLayers=e.getParameter(e.MAX_ARRAY_TEXTURE_LAYERS),this.maxSamples=e.getParameter(e.MAX_SAMPLES)):(this.maxUniformBufferBindings=0,this.maxVertexUniformBlocks=0,this.maxFragmentUniformBlocks=0,this.maxUniformBlockSize=0,this.uniformBufferOffsetAlignment=1,this.maxArrayTextureLayers=1,this.maxSamples=1)}};const Cbt=["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"];var mde,LPe={exports:{}};(mde=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"])!==void 0&&(LPe.exports=mde);const Abt=UP(LPe.exports);var gde,XW={exports:{}};XW.exports,gde=XW,function(t){var e=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"];e!==void 0&&(gde.exports=e)}();const yde=UP(XW.exports);var DPe={exports:{}};(function(t){(function(e){var r=function(){return["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT","textureSize","texelFetch"]}();r!==void 0&&(t.exports=r)})()})(DPe);const Obt=UP(DPe.exports);var cd=999,_de=9999,iB=0,nB=1,vde=2,bde=3,wde=4,pL=5,Rbt=6,Pbt=7,Mbt=8,xde=9,$bt=10,Tde=11,Ibt=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function Lbt(){var t,e,r,i=0,n=0,s=cd,o=[],a=[],l=1,c=0,u=0,d=!1,p=!1,m="";return function(z){return a=[],z!==null?_(z.replace?z.replace(/\r\n/g,` +`):z):v()};function y(z){z.length&&a.push({type:Ibt[s],data:z,position:u,line:l,column:c})}function _(z){var X;for(i=0,r=(m+=z).length;t=m[i],i0)continue;q=z.slice(0,1).join("")}return y(q),u+=q.length,(o=o.slice(q.length)).length}}function P(){return/[^a-fA-F0-9]/.test(t)?(y(o.join("")),s=cd,i):(o.push(t),e=t,i+1)}function F(){return t==="."||/[eE]/.test(t)?(o.push(t),s=pL,e=t,i+1):t==="x"&&o.length===1&&o[0]==="0"?(s=Tde,o.push(t),e=t,i+1):/[^\d]/.test(t)?(y(o.join("")),s=cd,i):(o.push(t),e=t,i+1)}function k(){return t==="f"&&(o.push(t),e=t,i+=1),/[eE]/.test(t)||t==="-"&&/[eE]/.test(e)?(o.push(t),e=t,i+1):/[^\d]/.test(t)?(y(o.join("")),s=cd,i):(o.push(t),e=t,i+1)}function V(){if(/[^\d\w_]/.test(t)){var z=o.join("");return s=Abt.indexOf(z)>-1?Mbt:Obt.indexOf(z)>-1?Pbt:Rbt,y(o.join("")),s=cd,i}return o.push(t),e=t,i+1}}function Dbt(t){var e=Lbt(),r=[];return r=(r=r.concat(e(t))).concat(e(null))}function Nbt(t){return Dbt(t)}function Fbt(t){return t.map(e=>e.type!=="eof"?e.data:"").join("")}const sB=["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"];function Ubt(t,e="100",r="300 es"){const i=/^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const n of t)if(n.type==="preprocessor"){const s=i.exec(n.data);if(s){const o=s[1].replaceAll(/\s\s+/g," ");if(o===r)return o;if(o===e)return n.data="#version "+r,e;throw new Error("unknown glsl version: "+o)}}return t.splice(0,0,{type:"preprocessor",data:"#version "+r},{type:"whitespace",data:` +`}),null}function kbt(t,e){for(let r=e-1;r>=0;r--){const i=t[r];if(i.type!=="whitespace"&&i.type!=="block-comment"){if(i.type!=="keyword")break;if(i.data==="attribute"||i.data==="in")return!0}}return!1}function vA(t,e,r,i){i=i||r;for(const n of t)if(n.type==="ident"&&n.data===r)return i in e?e[i]++:e[i]=0,vA(t,e,i+"_"+e[i],i);return r}function NPe(t,e,r="afterVersion"){function i(l,c){for(let u=c;ul=0;--a){const l=r[a];if(l.type==="preprocessor"){const c=l.data.match(/\#extension\s+(.*)\:/);if(c&&c[1]&&sB.includes(c[1].trim())){const p=r[a+1];r.splice(a,p&&p.type==="whitespace"?2:1)}const u=l.data.match(/\#ifdef\s+(.*)/);u&&u[1]&&sB.includes(u[1].trim())&&(l.data="#if 1");const d=l.data.match(/\#ifndef\s+(.*)/);d&&d[1]&&sB.includes(d[1].trim())&&(l.data="#if 0")}}return Gbt(t,Fbt(r))}function Gbt(t,e){return e}const jbt=4294967295;let Hbt=class{constructor(e,r,i,n,s=new Map){this._context=e,this._locations=n,this._uniformBlockBindings=s,this._refCount=1,this._compiled=!1,this._nameToUniformLocation={},this._nameToUniform1={},this._nameToUniform1v=new Map,this._nameToUniform2=new Map,this._nameToUniform3=new Map,this._nameToUniform4=new Map,this._nameToUniformMatrix3=new Map,this._nameToUniformMatrix4=new Map,e||console.error("RenderingContext isn't initialized!"),r.length===0&&console.error("Shaders source should not be empty!"),this._context.type===rr.WEBGL2&&(r=Sde(r,tu.VERTEX_SHADER),i=Sde(i,tu.FRAGMENT_SHADER)),this._vShader=Ede(this._context,tu.VERTEX_SHADER,r),this._fShader=Ede(this._context,tu.FRAGMENT_SHADER,i),this._vShader&&this._fShader||console.error("Error loading shaders!"),this._context.instanceCounter.increment(Es.Shader,this),gj()&&(this.vertexShader=r,this.fragmentShader=i);const o=this._context.gl,a=o.createProgram();if(o.attachShader(a,this._vShader),o.attachShader(a,this._fShader),this._locations.forEach((l,c)=>o.bindAttribLocation(a,l,c)),o.linkProgram(a),gj()&&!o.getProgramParameter(a,o.LINK_STATUS)&&console.error(`Could not link shader +validated: ${o.getProgramParameter(a,o.VALIDATE_STATUS)}, gl error ${o.getError()}, vertex: ${o.getShaderParameter(this._vShader,o.COMPILE_STATUS)}, fragment: ${o.getShaderParameter(this._fShader,o.COMPILE_STATUS)}, info log: ${o.getProgramInfoLog(a)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`),this._context.type===rr.WEBGL2){const l=o;for(const[c,u]of this._uniformBlockBindings){const d=l.getUniformBlockIndex(a,c);d0)return;const e=this._context.gl;this._vShader&&(e.deleteShader(this._vShader),this._vShader=null,this._context.instanceCounter.decrement(Es.Shader,this)),this._fShader&&(e.deleteShader(this._fShader),this._fShader=null),this._glName&&(e.deleteProgram(this._glName),this._glName=null,this._context.instanceCounter.decrement(Es.Program,this))}ref(){++this._refCount}_getUniformLocation(e){return this._nameToUniformLocation[e]===void 0&&this.glName!=null&&(this._nameToUniformLocation[e]=this._context.gl.getUniformLocation(this.glName,e)),this._nameToUniformLocation[e]}hasUniform(e){return this._getUniformLocation(e)!==null}setUniform1i(e,r){const i=this._nameToUniform1[e];i!==void 0&&r===i||(this._context.gl.uniform1i(this._getUniformLocation(e),r),this._nameToUniform1[e]=r)}setUniform1iv(e,r){jp(this._nameToUniform1v,e,r)&&this._context.gl.uniform1iv(this._getUniformLocation(e),r)}setUniform2iv(e,r){jp(this._nameToUniform2,e,r)&&this._context.gl.uniform2iv(this._getUniformLocation(e),r)}setUniform3iv(e,r){jp(this._nameToUniform3,e,r)&&this._context.gl.uniform3iv(this._getUniformLocation(e),r)}setUniform4iv(e,r){jp(this._nameToUniform4,e,r)&&this._context.gl.uniform4iv(this._getUniformLocation(e),r)}setUniform1f(e,r){const i=this._nameToUniform1[e];i!==void 0&&r===i||(this._context.gl.uniform1f(this._getUniformLocation(e),r),this._nameToUniform1[e]=r)}setUniform1fv(e,r){jp(this._nameToUniform1v,e,r)&&this._context.gl.uniform1fv(this._getUniformLocation(e),r)}setUniform2f(e,r,i){const n=this._nameToUniform2.get(e);n===void 0?(this._context.gl.uniform2f(this._getUniformLocation(e),r,i),this._nameToUniform2.set(e,[r,i])):r===n[0]&&i===n[1]||(this._context.gl.uniform2f(this._getUniformLocation(e),r,i),n[0]=r,n[1]=i)}setUniform2fv(e,r){jp(this._nameToUniform2,e,r)&&this._context.gl.uniform2fv(this._getUniformLocation(e),r)}setUniform3f(e,r,i,n){const s=this._nameToUniform3.get(e);s===void 0?(this._context.gl.uniform3f(this._getUniformLocation(e),r,i,n),this._nameToUniform3.set(e,[r,i,n])):r===s[0]&&i===s[1]&&n===s[2]||(this._context.gl.uniform3f(this._getUniformLocation(e),r,i,n),s[0]=r,s[1]=i,s[2]=n)}setUniform3fv(e,r){jp(this._nameToUniform3,e,r)&&this._context.gl.uniform3fv(this._getUniformLocation(e),r)}setUniform4f(e,r,i,n,s){const o=this._nameToUniform4.get(e);o===void 0?(this._context.gl.uniform4f(this._getUniformLocation(e),r,i,n,s),this._nameToUniform4.set(e,[r,i,n,s])):o!==void 0&&r===o[0]&&i===o[1]&&n===o[2]&&s===o[3]||(this._context.gl.uniform4f(this._getUniformLocation(e),r,i,n,s),o[0]=r,o[1]=i,o[2]=n,o[3]=s)}setUniform4fv(e,r){jp(this._nameToUniform4,e,r)&&this._context.gl.uniform4fv(this._getUniformLocation(e),r)}setUniformMatrix3fv(e,r,i=!1){jp(this._nameToUniformMatrix3,e,r)&&this._context.gl.uniformMatrix3fv(this._getUniformLocation(e),i,r)}setUniformMatrix4fv(e,r,i=!1){jp(this._nameToUniformMatrix4,e,r)&&this._context.gl.uniformMatrix4fv(this._getUniformLocation(e),i,r)}stop(){}};function Ede(t,e,r){const i=t.gl,n=i.createShader(e);return i.shaderSource(n,r),i.compileShader(n),gj()&&!i.getShaderParameter(n,i.COMPILE_STATUS)&&(console.error("Compile error in ".concat(e===tu.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(i.getShaderInfoLog(n)),console.error(Wbt(r))),n}function Wbt(t){let e=2;return t.replaceAll(` +`,()=>` +`+qbt(e++)+":")}function qbt(t){return t>=1e3?t.toString():(" "+t).slice(-3)}function jp(t,e,r){const i=t.get(e);return i?_X(i,r):(t.set(e,Array.from(r)),!0)}let Xbt=class{constructor(e){this._rctx=e,this._store=new RE}dispose(){this._store.forEach(e=>e.forEach(r=>r.dispose())),this._store.clear()}acquire(e,r,i,n){const s=this._store.get(e,r);if(s!=null)return s.ref(),s;const o=new Hbt(this._rctx,e,r,i,n);return o.ref(),this._store.set(e,r,o),o}get test(){let e=0;return this._store.forEach(r=>r.forEach(i=>e+=i.hasGLName?2:1)),{cachedWebGLObjects:e}}},sM=class{constructor(){this._result=!1}dispose(){this._program=Le(this._program)}get result(){return this._program!=null&&(this._result=this._test(this._program),this.dispose()),this._result}},Ybt=class extends sM{constructor(e){super(),this._rctx=e,this._helperProgram=null,this._rctx.type===rr.WEBGL2&&se("mac")&&se("chrome")&&(this._program=this._prepareProgram(),this._helperProgram=this._prepareHelperProgram())}dispose(){var e;super.dispose(),(e=this._helperProgram)==null||e.dispose(),this._helperProgram=null}_test(e){const r=this._rctx;r.resetState();const i=new pr(1);i.wrapMode=Pt.CLAMP_TO_EDGE,i.samplingMode=At.NEAREST;const n=new hs(r,i),s=Ar.createIndex(this._rctx,gr.STATIC_DRAW,new Uint8Array([0]));r.bindFramebuffer(n),r.setViewport(0,0,1,1),r.useProgram(this._helperProgram),r.bindBuffer(s,bt.ELEMENT_ARRAY_BUFFER),r.drawElements(Et.POINTS,1,Qe.UNSIGNED_BYTE,0),r.useProgram(e),r.bindVAO(null),r.drawArrays(Et.TRIANGLES,0,258);const o=new Uint8Array(4);return n.readPixels(0,0,1,1,Tt.RGBA,Un.UNSIGNED_BYTE,o),n.dispose(),s.dispose(),o[0]===255}_prepareProgram(){const r=`#version 300 es + precision highp float; + + out float triangleId; + + const vec3 triangleVertices[3] = vec3[3](vec3(-0.5, -0.5, 0.0), vec3(0.5, -0.5, 0.0), vec3(0.0, 0.5, 0.0)); + + void main(void) { + triangleId = floor(float(gl_VertexID)/3.0); + + vec3 position = triangleVertices[gl_VertexID % 3]; + float offset = triangleId / ${w.float(85)}; + position.z = 0.5 - offset; + + gl_Position = vec4(position, 1.0); + } + `,i=`#version 300 es + precision highp float; + + in float triangleId; + + out vec4 fragColor; + + void main(void) { + fragColor = triangleId == ${w.float(85)} ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); + } + `;return this._rctx.programCache.acquire(r,i,new Map([]))}_prepareHelperProgram(){const e=$Pe.getShaderSources();return this._rctx.programCache.acquire(e.vertex,e.fragment,new Map([]))}},Zbt=class extends sM{constructor(e){super(),this._rctx=e,this._program=Cde(this._rctx,!1),this._obfuscated=Cde(this._rctx,!0)}dispose(){super.dispose(),this._obfuscated=Le(this._obfuscated)}_test(e){if(se("force-double-precision-obfuscation"))return!0;if(this._obfuscated==null)return!1;const r=this._runProgram(e),i=this._runProgram(this._obfuscated);return r!==0&&(i===0||r/i>5)}_runProgram(e){const r=this._rctx;r.resetState();const i=new pr(1);i.wrapMode=Pt.CLAMP_TO_EDGE,i.samplingMode=At.NEAREST;const n=new hs(r,i),s=Ar.createVertex(r,gr.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),o=new Fh(r,new Map([["position",0]]),{geometry:[new xo("position",2,Qe.UNSIGNED_SHORT,0,4)]},{geometry:s}),a=Se(5633261287538229e-9,2626832878767164e-9,1.4349880495278358e6),l=Se(563327146742708e-8,2.6268736381334523e6,1434963231608387e-9),c=new Float32Array(6);nH(a,c,3);const u=new Float32Array(6);nH(l,u,3),r.useProgram(e),e.setUniform3f("u_highA",c[0],c[2],c[4]),e.setUniform3f("u_lowA",c[1],c[3],c[5]),e.setUniform3f("u_highB",u[0],u[2],u[4]),e.setUniform3f("u_lowB",u[1],u[3],u[5]),r.bindFramebuffer(n),r.setViewport(0,0,1,1),r.bindVAO(o),r.drawArrays(Et.TRIANGLE_STRIP,0,4);const d=new Uint8Array(4);n.readPixels(0,0,1,1,Tt.RGBA,Un.UNSIGNED_BYTE,d),o.dispose(),n.dispose();const p=(a[2]-l[2])/25,m=rJ(d);return Math.abs(p-m)}};function Cde(t,e){const r=` + + precision highp float; + + attribute vec2 position; + + uniform vec3 u_highA; + uniform vec3 u_lowA; + uniform vec3 u_highB; + uniform vec3 u_lowB; + + varying vec4 v_color; + + ${e?"#define DOUBLE_PRECISION_REQUIRES_OBFUSCATION":""} + + #ifdef DOUBLE_PRECISION_REQUIRES_OBFUSCATION + + vec3 dpPlusFrc(vec3 a, vec3 b) { + return mix(a, a + b, vec3(notEqual(b, vec3(0)))); + } + + vec3 dpMinusFrc(vec3 a, vec3 b) { + return mix(vec3(0), a - b, vec3(notEqual(a, b))); + } + + vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { + vec3 t1 = dpPlusFrc(hiA, hiB); + vec3 e = dpMinusFrc(t1, hiA); + vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB; + return t1 + t2; + } + + #else + + vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { + vec3 t1 = hiA + hiB; + vec3 e = t1 - hiA; + vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB; + return t1 + t2; + } + + #endif + + const float MAX_RGBA_FLOAT = + 255.0 / 256.0 + + 255.0 / 256.0 / 256.0 + + 255.0 / 256.0 / 256.0 / 256.0 + + 255.0 / 256.0 / 256.0 / 256.0 / 256.0; + + const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0); + + vec4 float2rgba(const float value) { + // Make sure value is in the domain we can represent + float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT); + + // Decompose value in 32bit fixed point parts represented as + // uint8 rgba components. Decomposition uses the fractional part after multiplying + // by a power of 256 (this removes the bits that are represented in the previous + // component) and then converts the fractional part to 8bits. + vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0); + + // Convert uint8 values (from 0 to 255) to floating point representation for + // the shader + const float toU8AsFloat = 1.0 / 255.0; + + return fixedPointU8 * toU8AsFloat; + } + + void main() { + vec3 val = dpAdd(u_highA, u_lowA, -u_highB, -u_lowB); + + v_color = float2rgba(val.z / 25.0); + + gl_Position = vec4(position * 2.0 - 1.0, 0.0, 1.0); + } + `,i=` + precision highp float; + + varying vec4 v_color; + + void main() { + gl_FragColor = v_color; + } + `;return t.programCache.acquire(r,i,new Map([["position",0]]))}let Qbt=class extends sM{constructor(e){var n,s,o,a,l;if(super(),this._rctx=e,!e.gl)return;if(e.type===rr.WEBGL1)return void(this._result=!(!((n=e.capabilities.textureFloat)!=null&&n.textureFloat)||!((s=e.capabilities.colorBufferFloat)!=null&&s.textureFloat)));if(!((o=e.capabilities.textureFloat)!=null&&o.textureFloat&&((a=e.capabilities.colorBufferFloat)!=null&&a.textureFloat)&&((l=e.capabilities.colorBufferFloat)!=null&&l.floatBlend)))return;const r=` + precision highp float; + attribute vec2 a_pos; + + void main() { + gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0); + } + `,i=` + precision highp float; + + void main() { + gl_FragColor = vec4(0.5, 0.5, 0.5, 0.5); + } + `;this._program=e.programCache.acquire(r,i,new Map([["a_pos",0]]))}_test(e){const r=this._rctx,i=new pr(1);i.wrapMode=Pt.CLAMP_TO_EDGE,i.dataType=Un.FLOAT,i.internalFormat=qe.RGBA32F,i.samplingMode=At.NEAREST;const n=new hs(r,i),s=Ar.createVertex(r,gr.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),o=new Fh(r,new Map([["a_pos",0]]),{geometry:[new xo("a_pos",2,Qe.UNSIGNED_SHORT,0,4)]},{geometry:s});r.useProgram(e);const a=r.getBoundFramebufferObject(),{x:l,y:c,width:u,height:d}=r.getViewport();r.bindFramebuffer(n),r.setViewport(0,0,1,1),r.bindVAO(o),r.drawArrays(Et.TRIANGLE_STRIP,0,4);const p=Ot({blending:HSe});r.setPipelineState(p),r.drawArrays(Et.TRIANGLE_STRIP,0,4);const m=r.gl.getError();return r.setViewport(l,c,u,d),r.bindFramebuffer(a),o.dispose(),n.dispose(),m!==1282||(console.warn("Device claims support for WebGL extension EXT_float_blend but does not support it. Using fall back."),!1)}},Jbt=class extends sM{constructor(e){super(),this._rctx=e;const r=` + precision highp float; + attribute vec2 a_pos; + uniform highp sampler2D u_texture; + varying vec4 v_color; + + float getBit(in float bitset, in int bitIndex) { + float offset = pow(2.0, float(bitIndex)); + return mod(floor(bitset / offset), 2.0); + } + + void main() { + vec4 value = texture2D(u_texture, vec2(0.0)); + float bit = getBit(value.x * 255.0, 1); + + v_color = bit * vec4(1.0); + gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0); + } + `,i=` + precision highp float; + varying vec4 v_color; + + void main() { + gl_FragColor = v_color; + } + `;this._program=e.programCache.acquire(r,i,new Map([["a_pos",0]]))}_test(e){const r=this._rctx,i=new pr(1);i.wrapMode=Pt.CLAMP_TO_EDGE,i.samplingMode=At.NEAREST;const n=new hs(r,i),s=new Uint8Array(4),o=Ar.createVertex(r,gr.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),a=new Fh(r,new Map([["a_position",0]]),{geometry:[new xo("a_position",2,Qe.SHORT,0,4)]},{geometry:o});r.useProgram(e);const l=new Ct(r,i,new Uint8Array([2,255,0,0]));e.setUniform1i("u_texture",0),r.bindTexture(l,0);const c=r.getBoundFramebufferObject();r.bindFramebuffer(n),r.useProgram(e);const{x:u,y:d,width:p,height:m}=r.getViewport();r.setViewport(0,0,1,1),r.bindVAO(a),r.drawArrays(Et.TRIANGLE_STRIP,0,4),r.setViewport(u,d,p,m),n.readPixels(0,0,1,1,Tt.RGBA,Un.UNSIGNED_BYTE,s),a.dispose(),n.dispose();const y=s[0]!==255||s[1]!==255||s[2]!==255||s[3]!==255;return y&&J.getLogger("esri.views.webgl.testSamplerPrecision").warn(`A problem was detected with your graphics driver. Your driver does not appear to honor sampler precision specifiers, which may result in rendering issues due to numerical instability. We recommend ensuring that your drivers have been updated to the latest version. Applying lowp sampler workaround. [${s[0]}.${s[1]}.${s[2]}.${s[3]}]`),r.bindFramebuffer(c),y}};new xo("a_pos",2,Qe.BYTE,0,2);new xo("a_pos",2,Qe.BYTE,0,4),new xo("a_tex",2,Qe.BYTE,2,4);const Kbt={geometry:[new xo("a_pos",2,Qe.UNSIGNED_SHORT,0,4)]};let ewt=class extends sM{constructor(e){super(),this._rctx=e;const r=` + precision highp float; + + attribute vec2 a_pos; + varying vec2 v_uv; + + void main() { + v_uv = a_pos; + gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0); + } + `,i=` + precision highp float; + + varying vec2 v_uv; + + uniform sampler2D u_texture; + + void main() { + gl_FragColor = texture2D(u_texture, v_uv); + } + `;this._program=e.programCache.acquire(r,i,new Map([["a_pos",0]]))}dispose(){super.dispose()}_test(e){const r=this._rctx;if(!r.gl)return e.dispose(),!0;const i=new pr(1);i.wrapMode=Pt.CLAMP_TO_EDGE,i.samplingMode=At.NEAREST;const n=new hs(r,i),s=Ar.createVertex(r,gr.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),o=new Fh(r,new Map([["a_pos",0]]),Kbt,{geometry:s}),a=new pr;a.samplingMode=At.LINEAR,a.wrapMode=Pt.CLAMP_TO_EDGE;const l=new Ct(r,a,bA);r.useProgram(e),r.bindTexture(l,0),e.setUniform1i("u_texture",0);const c=r.getBoundFramebufferObject(),{x:u,y:d,width:p,height:m}=r.getViewport();r.bindFramebuffer(n),r.setViewport(0,0,1,1),r.setClearColor(0,0,0,0),r.setBlendingEnabled(!1),r.clearSafe(yi.COLOR_BUFFER_BIT),r.bindVAO(o),r.drawArrays(Et.TRIANGLE_STRIP,0,4);const y=new Uint8Array(4);return n.readPixels(0,0,1,1,Tt.RGBA,Un.UNSIGNED_BYTE,y),o.dispose(),n.dispose(),l.dispose(),r.setViewport(u,d,p,m),r.bindFramebuffer(c),y[0]!==255}};const bA=new Image;bA.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",bA.width=5,bA.height=5,bA.decode();let twt=class{constructor(e){this.rctx=e,this.floatBufferBlend=new Qbt(e),this.svgPremultipliesAlpha=new ewt(e),this.doublePrecisionRequiresObfuscation=new Zbt(e),this.ignoresSamplerPrecision=new Jbt(e),this.drawArraysRequiresIndicesTypeReset=new Ybt(e)}dispose(){this.ignoresSamplerPrecision.dispose(),this.doublePrecisionRequiresObfuscation.dispose(),this.svgPremultipliesAlpha.dispose(),this.floatBufferBlend.dispose(),this.drawArraysRequiresIndicesTypeReset.dispose()}};function rwt(t,e){if(e.disjointTimerQuery)return null;if(xp(t))return{drawBuffers:t.drawBuffers.bind(t),MAX_DRAW_BUFFERS:t.MAX_DRAW_BUFFERS,MAX_COLOR_ATTACHMENTS:t.MAX_COLOR_ATTACHMENTS};if(e.drawBuffers)return null;const r=t.getExtension("WEBGL_draw_buffers");return r?{drawBuffers:r.drawBuffersWEBGL.bind(r),MAX_DRAW_BUFFERS:r.MAX_DRAW_BUFFERS_WEBGL,MAX_COLOR_ATTACHMENTS:r.MAX_COLOR_ATTACHMENTS_WEBGL}:null}function iwt(t){if(xp(t))return t;const e=t.getExtension("ANGLE_instanced_arrays");return e?{drawArraysInstanced:e.drawArraysInstancedANGLE.bind(e),drawElementsInstanced:e.drawElementsInstancedANGLE.bind(e),vertexAttribDivisor:e.vertexAttribDivisorANGLE.bind(e)}:null}function nwt(t,e){if(e.compressedTextureETC)return null;const r=t.getExtension("WEBGL_compressed_texture_etc");return r?{COMPRESSED_R11_EAC:r.COMPRESSED_R11_EAC,COMPRESSED_SIGNED_R11_EAC:r.COMPRESSED_SIGNED_R11_EAC,COMPRESSED_RG11_EAC:r.COMPRESSED_RG11_EAC,COMPRESSED_SIGNED_RG11_EAC:r.COMPRESSED_SIGNED_RG11_EAC,COMPRESSED_RGB8_ETC2:r.COMPRESSED_RGB8_ETC2,COMPRESSED_SRGB8_ETC2:r.COMPRESSED_SRGB8_ETC2,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:r.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:r.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_RGBA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}:null}function swt(t,e){if(e.compressedTextureS3TC)return null;const r=t.getExtension("WEBGL_compressed_texture_s3tc");return r?{COMPRESSED_RGB_S3TC_DXT1:r.COMPRESSED_RGB_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT1:r.COMPRESSED_RGBA_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT3:r.COMPRESSED_RGBA_S3TC_DXT3_EXT,COMPRESSED_RGBA_S3TC_DXT5:r.COMPRESSED_RGBA_S3TC_DXT5_EXT}:null}function owt(t,e){if(xp(t))return{MIN:t.MIN,MAX:t.MAX};if(e.blendMinMax)return null;{const r=t.getExtension("EXT_blend_minmax");return r?{MIN:r.MIN_EXT,MAX:r.MAX_EXT}:null}}function awt(t,e){if(e.textureFilterAnisotropic)return null;const r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");return r?{MAX_TEXTURE_MAX_ANISOTROPY:r.MAX_TEXTURE_MAX_ANISOTROPY_EXT,TEXTURE_MAX_ANISOTROPY:r.TEXTURE_MAX_ANISOTROPY_EXT}:null}function lwt(t,e){if(xp(t))return{textureFloat:!0,textureFloatLinear:!e.textureFloatLinear&&!!t.getExtension("OES_texture_float_linear"),textureHalfFloat:!0,textureHalfFloatLinear:!0,HALF_FLOAT:t.HALF_FLOAT,R16F:t.R16F,RG16F:t.RG16F,RGBA16F:t.RGBA16F,R32F:t.R32F,RG32F:t.RG32F,RGBA32F:t.RGBA32F,R11F_G11F_B10F:t.R11F_G11F_B10F,RGB16F:t.RGB16F};if(t instanceof WebGLRenderingContext){const r=!e.textureHalfFloat&&t.getExtension("OES_texture_half_float");return{textureFloat:!e.textureFloat&&!!t.getExtension("OES_texture_float"),textureFloatLinear:!e.textureFloatLinear&&!!t.getExtension("OES_texture_float_linear"),textureHalfFloat:!!r,textureHalfFloatLinear:!e.textureHalfFloatLinear&&!!t.getExtension("OES_texture_half_float_linear"),HALF_FLOAT:r?r.HALF_FLOAT_OES:void 0}}return null}function cwt(t,e){if(xp(t)){const r=!e.colorBufferHalfFloat&&t.getExtension("EXT_color_buffer_half_float")||!e.colorBufferFloat&&t.getExtension("EXT_color_buffer_float"),i=!e.colorBufferFloat&&t.getExtension("EXT_color_buffer_float"),n=!e.floatBlend&&!e.colorBufferFloat&&t.getExtension("EXT_float_blend");return r||i||n?{textureFloat:!!i,textureHalfFloat:!!r,floatBlend:!!n,R16F:t.R16F,RG16F:t.RG16F,RGBA16F:t.RGBA16F,R32F:t.R32F,RG32F:t.RG32F,RGBA32F:t.RGBA32F,R11F_G11F_B10F:t.R11F_G11F_B10F,RGB16F:t.RGB16F}:null}if(t instanceof WebGLRenderingContext){const r=!e.colorBufferHalfFloat&&t.getExtension("EXT_color_buffer_half_float"),i=!e.colorBufferFloat&&t.getExtension("WEBGL_color_buffer_float"),n=!e.floatBlend&&!e.colorBufferFloat&&t.getExtension("EXT_float_blend");return r||i||n?{textureFloat:!!i,textureHalfFloat:!!r,floatBlend:!!n,RGBA16F:r?r.RGBA16F_EXT:void 0,RGB16F:r?r.RGB16F_EXT:void 0,RGBA32F:i?i.RGBA32F_EXT:void 0}:null}return null}function Ade(t,e,r,i,n){if(i&&xp(t))return!0;if(e[r])return!1;for(const s of n)if(t.getExtension(s))return!0;return!1}function uwt(t,e){if(!xp(t)||e.textureNorm16)return null;const r=t.getExtension("EXT_texture_norm16");return r?{R16:r.R16_EXT,RG16:r.RG16_EXT,RGB16:r.RGB16_EXT,RGBA16:r.RGBA16_EXT,R16_SNORM:r.R16_SNORM_EXT,RG16_SNORM:r.RG16_SNORM_EXT,RGB16_SNORM:r.RGB16_SNORM_EXT,RGBA16_SNORM:r.RGBA16_SNORM_EXT}:null}function hwt(t,e){const r=e.loseContext&&t.getExtension("WEBGL_lose_context");return r?{loseRenderingContext:()=>r.loseContext()}:null}function dwt(t,e){if(xp(t))return{createVertexArray:t.createVertexArray.bind(t),deleteVertexArray:t.deleteVertexArray.bind(t),bindVertexArray:t.bindVertexArray.bind(t)};if(e.vao)return null;const r=t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object");return r?{createVertexArray:r.createVertexArrayOES.bind(r),deleteVertexArray:r.deleteVertexArrayOES.bind(r),bindVertexArray:r.bindVertexArrayOES.bind(r)}:null}let pwt=class{constructor(e,r){this._gl=e,this._instancing=null,this._vertexArrayObject=null,this._compressedTextureETC=null,this._compressedTextureS3TC=null,this._textureFilterAnisotropic=null,this._textureFloat=null,this._colorBufferFloat=null,this._minMaxBlending=null,this._loseContext=null,this._drawBuffers=null,this._textureNorm16=null,this._depthTexture=null,this._textureFloatLinear=null,this._disabledExtensions=r.disabledExtensions||{},this._debugWebGLExtensions=r.debugWebGLExtensions||{}}get drawBuffers(){return this._drawBuffers||(this._drawBuffers=rwt(this._gl,this._disabledExtensions)),this._drawBuffers}get instancing(){return this._instancing||(this._instancing=iwt(this._gl)),this._instancing}get vao(){return this._vertexArrayObject||(this._vertexArrayObject=dwt(this._gl,this._disabledExtensions)),this._vertexArrayObject}get compressedTextureETC(){return this._compressedTextureETC||(this._compressedTextureETC=nwt(this._gl,this._disabledExtensions)),this._compressedTextureETC}get compressedTextureS3TC(){return this._compressedTextureS3TC||(this._compressedTextureS3TC=swt(this._gl,this._disabledExtensions)),this._compressedTextureS3TC}get textureFilterAnisotropic(){return this._textureFilterAnisotropic||(this._textureFilterAnisotropic=awt(this._gl,this._disabledExtensions)),this._textureFilterAnisotropic}get disjointTimerQuery(){return this._disjointTimerQuery||(this._disjointTimerQuery=ybt(this._gl,this._disabledExtensions)),this._disjointTimerQuery}get textureFloat(){return this._textureFloat||(this._textureFloat=lwt(this._gl,this._disabledExtensions)),this._textureFloat}get colorBufferFloat(){return this._colorBufferFloat||(this._colorBufferFloat=cwt(this._gl,this._disabledExtensions)),this._colorBufferFloat}get blendMinMax(){return this._minMaxBlending||(this._minMaxBlending=owt(this._gl,this._disabledExtensions)),this._minMaxBlending}get depthTexture(){return this._depthTexture===null&&(this._depthTexture=Ade(this._gl,this._disabledExtensions,"depthTexture",!0,["WEBGL_depth_texture","MOZ_WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"])),this._depthTexture}get loseContext(){return this._loseContext||(this._loseContext=hwt(this._gl,this._debugWebGLExtensions)),this._loseContext}get textureNorm16(){return this._textureNorm16||(this._textureNorm16=uwt(this._gl,this._disabledExtensions)),this._textureNorm16}get textureFloatLinear(){return this._textureFloatLinear===null&&(this._textureFloatLinear=Ade(this._gl,this._disabledExtensions,"textureFloatLinear",!1,["OES_texture_float_linear"])),this._textureFloatLinear}enable(e){return this[e]}},fwt=class{constructor(e,r){this.gl=e,this.instanceCounter=new Sbt,this.programCache=new Xbt(this),this._state=new fde,this._numOfDrawCalls=0,this._numOfTriangles=0,this.type=xp(e)?rr.WEBGL2:rr.WEBGL1,this._loadExtensions(),this.configure(r)}get gl2(){return this.type===rr.WEBGL1?null:this.gl}configure(e){this._capabilities=new pwt(this.gl,e),this._parameters=new Ebt(this.gl,this._capabilities,e),Ct.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const r=this.gl.getParameter(this.gl.VIEWPORT);this._state=new fde,this._state.viewport={x:r[0],y:r[1],width:r[2],height:r[3]},this._stateTracker=new uWe({setBlending:i=>{if(i){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(i.opRgb,i.opAlpha),this.setBlendFunctionSeparate(i.srcRgb,i.dstRgb,i.srcAlpha,i.dstAlpha);const n=i.color;this.setBlendColor(n.r,n.g,n.b,n.a)}else this.setBlendingEnabled(!1)},setCulling:i=>{i?(this.setFaceCullingEnabled(!0),this.setCullFace(i.face),this.setFrontFace(i.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:i=>{i?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(i.factor,i.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:i=>{i?(this.setDepthTestEnabled(!0),this.setDepthFunction(i.func)):this.setDepthTestEnabled(!1)},setStencilTest:i=>{if(i){this.setStencilTestEnabled(!0);const n=i.function;this.setStencilFunction(n.func,n.ref,n.mask);const s=i.operation;this.setStencilOp(s.fail,s.zFail,s.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:i=>{i?(this.setDepthWriteEnabled(!0),this.setDepthRange(i.zNear,i.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:i=>{i?this.setColorMask(i.r,i.g,i.b,i.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:i=>{i?this.setStencilWriteMask(i.mask):this.setStencilWriteMask(0)}}),this.enforceState(),Le(this._driverTest),this._driverTest=new twt(this)}dispose(){Le(this._driverTest),this.programCache.dispose(),this.bindVAO(null),this.unbindBuffer(bt.ARRAY_BUFFER),this.unbindBuffer(bt.ELEMENT_ARRAY_BUFFER),this.type===rr.WEBGL2&&(this.unbindBuffer(bt.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(bt.PIXEL_PACK_BUFFER),this.unbindBuffer(bt.PIXEL_UNPACK_BUFFER),this.unbindBuffer(bt.COPY_READ_BUFFER),this.unbindBuffer(bt.COPY_WRITE_BUFFER)),this._state.textureUnitMap.length=0,eh()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}setPipelineState(e){this._stateTracker.setPipeline(e)}setBlendingEnabled(e){this._state.blend!==e&&(e===!0?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=e,this._stateTracker.invalidateBlending())}externalProgramUpdate(){var e;(e=this._state.program)==null||e.stop(),this._state.program=null}externalTextureUnitUpdate(e,r){for(let i=0;i=0&&(this._state.activeTexture=r)}externalVertexArrayObjectUpdate(){const e=this.capabilities.vao;e&&(e.bindVertexArray(null),this._state.vertexArrayObject=null),this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(e,r,i,n){e===this._state.blendColor.r&&r===this._state.blendColor.g&&i===this._state.blendColor.b&&n===this._state.blendColor.a||(this.gl.blendColor(e,r,i,n),this._state.blendColor.r=e,this._state.blendColor.g=r,this._state.blendColor.b=i,this._state.blendColor.a=n,this._stateTracker.invalidateBlending())}setBlendFunction(e,r){e===this._state.blendFunction.srcRGB&&r===this._state.blendFunction.dstRGB||(this.gl.blendFunc(e,r),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=e,this._state.blendFunction.dstRGB=r,this._state.blendFunction.dstAlpha=r,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(e,r,i,n){this._state.blendFunction.srcRGB===e&&this._state.blendFunction.srcAlpha===i&&this._state.blendFunction.dstRGB===r&&this._state.blendFunction.dstAlpha===n||(this.gl.blendFuncSeparate(e,r,i,n),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=i,this._state.blendFunction.dstRGB=r,this._state.blendFunction.dstAlpha=n,this._stateTracker.invalidateBlending())}setBlendEquation(e){this._state.blendEquation.mode!==e&&(this.gl.blendEquation(e),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(e,r){this._state.blendEquation.mode===e&&this._state.blendEquation.modeAlpha===r||(this.gl.blendEquationSeparate(e,r),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=r,this._stateTracker.invalidateBlending())}setColorMask(e,r,i,n){this._state.colorMask.r===e&&this._state.colorMask.g===r&&this._state.colorMask.b===i&&this._state.colorMask.a===n||(this.gl.colorMask(e,r,i,n),this._state.colorMask.r=e,this._state.colorMask.g=r,this._state.colorMask.b=i,this._state.colorMask.a=n,this._stateTracker.invalidateColorWrite())}setClearColor(e,r,i,n){this._state.clearColor.r===e&&this._state.clearColor.g===r&&this._state.clearColor.b===i&&this._state.clearColor.a===n||(this.gl.clearColor(e,r,i,n),this._state.clearColor.r=e,this._state.clearColor.g=r,this._state.clearColor.b=i,this._state.clearColor.a=n)}setFaceCullingEnabled(e){this._state.faceCulling!==e&&(e===!0?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=e,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(e){this._state.polygonOffsetFill!==e&&(e===!0?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=e,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(e,r){this._state.polygonOffset[0]===e&&this._state.polygonOffset[1]===r||(this._state.polygonOffset[0]=e,this._state.polygonOffset[1]=r,this.gl.polygonOffset(e,r),this._stateTracker.invalidatePolygonOffset())}setCullFace(e){this._state.cullFace!==e&&(this.gl.cullFace(e),this._state.cullFace=e,this._stateTracker.invalidateCulling())}setFrontFace(e){this._state.frontFace!==e&&(this.gl.frontFace(e),this._state.frontFace=e,this._stateTracker.invalidateCulling())}setScissorTestEnabled(e){this._state.scissorTest!==e&&(e===!0?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=e)}setScissorRect(e,r,i,n){this._state.scissorRect.x===e&&this._state.scissorRect.y===r&&this._state.scissorRect.width===i&&this._state.scissorRect.height===n||(this.gl.scissor(e,r,i,n),this._state.scissorRect.x=e,this._state.scissorRect.y=r,this._state.scissorRect.width=i,this._state.scissorRect.height=n)}setDepthTestEnabled(e){this._state.depthTest!==e&&(e===!0?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=e,this._stateTracker.invalidateDepthTest())}setClearDepth(e){this._state.clearDepth!==e&&(this.gl.clearDepth(e),this._state.clearDepth=e)}setDepthFunction(e){this._state.depthFunction!==e&&(this.gl.depthFunc(e),this._state.depthFunction=e,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(e){this._state.depthWrite!==e&&(this.gl.depthMask(e),this._state.depthWrite=e,this._stateTracker.invalidateDepthWrite())}setDepthRange(e,r){this._state.depthRange.zNear===e&&this._state.depthRange.zFar===r||(this.gl.depthRange(e,r),this._state.depthRange.zNear=e,this._state.depthRange.zFar=r,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(e){this._state.stencilTest!==e&&(e===!0?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=e,this._stateTracker.invalidateStencilTest())}setClearStencil(e){e!==this._state.clearStencil&&(this.gl.clearStencil(e),this._state.clearStencil=e)}setStencilFunction(e,r,i){this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===r&&this._state.stencilFunction.mask===i||(this.gl.stencilFunc(e,r,i),this._state.stencilFunction.face=qd.FRONT_AND_BACK,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=r,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(e,r,i,n){this._state.stencilFunction.face===e&&this._state.stencilFunction.func===r&&this._state.stencilFunction.ref===i&&this._state.stencilFunction.mask===n||(this.gl.stencilFuncSeparate(e,r,i,n),this._state.stencilFunction.face=e,this._state.stencilFunction.func=r,this._state.stencilFunction.ref=i,this._state.stencilFunction.mask=n,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(e){this._state.stencilWriteMask!==e&&(this.gl.stencilMask(e),this._state.stencilWriteMask=e,this._stateTracker.invalidateStencilWrite())}setStencilOp(e,r,i){this._state.stencilOperation.face===qd.FRONT_AND_BACK&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===r&&this._state.stencilOperation.zPass===i||(this.gl.stencilOp(e,r,i),this._state.stencilOperation.face=qd.FRONT_AND_BACK,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=r,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(e,r,i,n){this._state.stencilOperation.face===e&&this._state.stencilOperation.fail===r&&this._state.stencilOperation.zFail===i&&this._state.stencilOperation.zPass===n||(this.gl.stencilOpSeparate(e,r,i,n),this._state.stencilOperation.face=e,this._state.stencilOperation.fail=r,this._state.stencilOperation.zFail=i,this._state.stencilOperation.zPass=n,this._stateTracker.invalidateStencilTest())}setActiveTexture(e,r=!1){const i=this._state.activeTexture;return e>=0&&(r||e!==this._state.activeTexture)&&(this.gl.activeTexture(Dk+e),this._state.activeTexture=e),i}clear(e){e&&this.gl.clear(e)}clearSafe(e,r=255){e&&(e&yi.COLOR_BUFFER_BIT&&this.setColorMask(!0,!0,!0,!0),e&yi.DEPTH_BUFFER_BIT&&this.setDepthWriteEnabled(!0),e&yi.STENCIL_BUFFER_BIT&&this.setStencilWriteMask(r),this.gl.clear(e))}drawArrays(e,r,i){if(eh()&&(this._numOfDrawCalls++,this._numOfTriangles+=Ode(e,i)),this.gl.drawArrays(e,r,i),eh()){const n=yne(this);n&&console.error("drawArrays:",n)}}drawElements(e,r,i,n){if(eh()&&(this._numOfDrawCalls++,this._numOfTriangles+=Ode(e,r)),this.gl.drawElements(e,r,i,n),eh()){const s=yne(this);if(s){const o=this.getBoundVAO(),a=o==null?void 0:o.indexBuffer,l=o==null?void 0:o.vertexBuffers,c={indexBuffer:a,vertexBuffers:l},u={mode:e,count:r,type:i,offset:n},d=(a==null?void 0:a.size)??0,p=n+r,m=d=this.parameters.maxTextureImageUnits||r<0)&&console.error("Input texture unit is out of range of available units!");const n=this._state.textureUnitMap[r];return e==null||e.glName==null?(n!=null&&(this.setActiveTexture(r,i),this.gl.bindTexture(n.descriptor.target,null)),this._state.textureUnitMap[r]=null,n):i||n!==e?(this.setActiveTexture(r,i),this.gl.bindTexture(e.descriptor.target,e.glName),e.applyChanges(),this._state.textureUnitMap[r]=e,n):(e.isDirty&&(this.setActiveTexture(r,i),e.applyChanges()),n)}unbindTexture(e){if(e!=null)for(let r=0;r=this.parameters.maxUniformBufferBindings||r<0)return console.error("Uniform buffer binding point is out of range!"),null;const i=this._state.uniformBufferBindingPoints;let n=i[r];return n==null&&(n={buffer:null,offset:0,size:0},i[r]=n),n}bindBufferBase(e,r,i){const n=this._getBufferBinding(e,r);n!=null&&(n.buffer===i&&n.offset===0&&n.size===0||(this.gl.bindBufferBase(e,r,i?i.glName:null),n.buffer=i,n.offset=0,n.size=0))}bindBufferRange(e,r,i,n,s){const o=this._getBufferBinding(e,r);if(o!=null&&!(o.buffer===i&&o.offset===n&&o.size===s)){if(n%this._parameters.uniformBufferOffsetAlignment!=0)return void console.error("Uniform buffer binding offset is not a multiple of the context offset alignment");this.gl.bindBufferRange(e,r,i.glName,n,s),o.buffer=i,o.offset=n,o.size=s}}bindUBO(e,r,i,n){r!=null?(eh()&&(n??r.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),r.initialize(),i!==void 0&&n!==void 0?this.bindBufferRange(bt.UNIFORM_BUFFER,e,r.buffer,i,n):this.bindBufferBase(bt.UNIFORM_BUFFER,e,r.buffer)):this.bindBufferBase(bt.UNIFORM_BUFFER,e,null)}unbindUBO(e){for(let r=0,i=this._state.uniformBufferBindingPoints.length;r0||this.dispose()}ref(){++this._refCount}dispose(){var e;super.dispose(),(e=this._appleAmdDriverHelper)==null||e.dispose()}bindTechnique(e,r,i,n){return this.useProgram(e.program),e.bindPipelineState(this,i==null?void 0:i.slot,!!n),e.program.bindPass(r,i),e.program}get appleAmdDriverHelper(){return this.driverTest.drawArraysRequiresIndicesTypeReset.result?(this._appleAmdDriverHelper=this._appleAmdDriverHelper??new $Pe(this),this._appleAmdDriverHelper):null}get test(){return this.programCache.test}},N2=class extends xe{constructor(e,r,i){super({}),this._stage=e,this._techniqueRepository=r,this._rctx=i,this._textures=new Map,this._loadingCount=0,this._frameUpdates=new Map,this.events=new Bn,this._frameTask=e.view.resourceController.scheduler.registerTask(dt.TEXTURE_UNLOAD)}normalizeCtorArgs(){return{}}destroy(){this._frameTask.remove(),this._stage.forEachOfType(on.Texture,e=>e.unload())}get updating(){return this._loadingCount>0||this._frameTask.updating}get textureTechnique(){return this._textureTechnique==null&&(this._textureTechnique=this._techniqueRepository.acquire(kJ,new zJ)),this._textureTechnique}acquire(e){const r=this._textures.get(e);return r?(r.ref(),r.loadingPromise??r):this._createNewRef(e)}update(){let e=!1;this._frameUpdates.forEach(r=>{const i=r.texture.frameUpdate(r.previousToken);i>=0&&i!==r.previousToken&&(r.previousToken=i,e=!0)}),e&&this.events.emit("changed",dn.BACKGROUND)}_createNewRef(e){const r=this._stage.getObject(e);if(r==null)return Je(r!==void 0),null;const i=r.events.on("unloaded",()=>{i.remove(),this._onTextureUnloaded(e)}),n=new gwt(e,()=>{this._frameTask.schedule(()=>{n.isUnreferenced&&r.unload()})});return this._textures.set(e,n),n.ref(),r.glTexture!=null?(this._updateGLTexture(n,r.glTexture),r.requiresFrameUpdates&&this._frameUpdates.set(e,{texture:r,previousToken:-1}),n):(this._loadingCount++,n.loadingPromise=this._stage.schedule(()=>{const s=r.load(this._rctx),o=l=>(this._loadingCount--,n.loadingPromise=null,this._updateGLTexture(n,l),r.requiresFrameUpdates&&this._frameUpdates.set(e,{texture:r,previousToken:-1}),n),a=l=>(this._loadingCount--,n.loadingPromise=null,Zn(l)||J.getLogger(this).error(l),null);return Eu(s)?s.then(o,a):o(s)}),n.loadingPromise)}_updateGLTexture(e,r){e.glTexture=r,this.events.emit("changed",dn.UPDATE)}_onTextureUnloaded(e){this._textures.delete(e),this._frameUpdates.delete(e)}};h([f()],N2.prototype,"_loadingCount",void 0),h([f()],N2.prototype,"_frameTask",void 0),h([f()],N2.prototype,"updating",null),N2=h([N("esri.views.3d.webgl-engine.lib.TextureRepository")],N2);let gwt=class{constructor(e,r){this.id=e,this._release=r,this._refCount=0}get isUnreferenced(){return this._refCount===0}ref(){++this._refCount}release(){--this._refCount,this._refCount>0||(this._refCount!==0?(J.getLogger("esri.views.3d.webgl-engine.lib.TextureRepository.RefCountedTextureImpl").error("Cannot dereference texture that has no references!"),this._refCount=0):this._release())}};function ywt(t,e){return new OCe(r=>yst(r,t),r=>r,e)}let wA=class extends xe{constructor(){super(...arguments),this._passParameters=new _wt,this._loading=0}get passParameters(){return this._passParameters}destroy(){this._passParameters.waveNormal=Le(this._passParameters.waveNormal),this._passParameters.wavePertubation=Le(this._passParameters.wavePertubation)}get updating(){return this._loading>0}ensureResources(e){if(this._loading>0)return bg.LOADING;if(this._passParameters.waveNormal!=null&&this._passParameters.wavePertubation!=null)return bg.LOADED;const r=new pr;return r.samplingMode=At.LINEAR_MIPMAP_LINEAR,r.hasMipmap=!0,r.maxAnisotropy=8,++this._loading,qg(Ir("esri/images/materials/water/normals.jpg")).then(i=>this._passParameters.waveNormal=new Ct(e,{...r,width:i.width,height:i.height},i)).catch(i=>J.getLogger(this).error("Failed to load water material normal texture.",i)).finally(()=>--this._loading),++this._loading,qg(Ir("esri/images/materials/water/perturbation.jpg")).then(i=>this._passParameters.wavePertubation=new Ct(e,{...r,width:i.width,height:i.height},i)).catch(i=>J.getLogger(this).error("Failed to load water material pertubation texture.",i)).finally(()=>--this._loading),bg.LOADING}};h([f()],wA.prototype,"_loading",void 0),h([f({type:Boolean,readOnly:!0})],wA.prototype,"updating",null),wA=h([N("esri.views.3d.webgl-engine.materials.internal.WaterTextureRepository")],wA);let _wt=class extends Wr{};const Rde=2048,vwt=1.5,bwt=8;function wwt(t,e){const{format:r,quality:i,rotation:n,disableDecorations:s}=t||{},o=IK(t,e.padding),a=Owt(t,{width:e.width-o.left-o.right,height:e.height-o.top-o.bottom}),{width:l,height:c}=Awt(t,a),u=Mwt(r),d=Nwt[u];return{format:u,quality:ge(i??d,0,100),area:a,width:l,height:c,rotation:n,disableDecorations:!!s,ignoreBackground:!(!t||!t.ignoreBackground),ignorePadding:!(!t||!t.ignorePadding)}}function xwt(t,e){const r=wwt(t,e),i=r.area,n=r.width/i.width,s=IK(r,e.padding),o=s.left+s.right,a=s.top+s.bottom,l=e.width-o,c=e.height-a,u=Math.floor(l*n+o),d=Math.floor(c*n+a),p=t&&t.layers?t.layers:[],m=r.ignoreBackground,y=r.ignorePadding;return{framebufferWidth:u,framebufferHeight:d,region:{x:Math.floor(i.x*n)+s.left,y:Math.floor(i.y*n)+s.top,width:r.width,height:r.height},format:r.format,quality:r.quality,rotation:r.rotation,pixelRatio:n,layers:p,disableDecorations:r.disableDecorations,ignoreBackground:m,ignorePadding:y,objectAndLayerIdColor:!1}}function oB(t,e,r){const{ctx:i,canvas:n}=FPe(t,r),s=i.getImageData(0,0,t.width,t.height),o=Swt(n,e);return UPe(n),{dataUrl:o,data:s}}function aB(t,e){const{ctx:r,canvas:i}=FPe(t,e),n=r.getImageData(0,0,t.width,t.height);return UPe(i),n}function FPe(t,e){const r=Twt();e.premultipliedAlpha&&Iwt(t),r.width=t.width,r.height=t.height;const i=r.getContext("2d",{willReadFrequently:!0});return i.putImageData(t,0,0),e.flipY&&$wt(i),{ctx:i,canvas:r}}function UPe(t){t.width=0,t.height=0}function Twt(){return lB==null&&(lB=document.createElement("canvas")),lB}let lB=null;function Swt(t,e){const r=Lwt[e.format],i=e.quality/100;return t.toDataURL(r,i)}function Ewt(t,e,r,i=0,n=0,s=t.width-i,o=t.height-n,a=!1){const{data:l}=t,{width:c,height:u,data:d}=e,p=s/c,m=o/u,y=Math.ceil(p/2),_=Math.ceil(m/2),v=t.width;for(let b=0;b=1)continue;let I=2*M*M*M-3*M*M+1;const L=4*(i+G+(n+V)*v);F+=I*l[L+3],A+=I,!r&&l[L+3]<255&&(I=I*l[L+3]/255),C+=I*l[L],R+=I*l[L+1],P+=I*l[L+2],S+=I}}d[T]=C/S,d[T+1]=R/S,d[T+2]=P/S,d[T+3]=F/A}return e}function Cwt(t,e,r){if(!e)return t;const{framebufferWidth:i,framebufferHeight:n,pixelRatio:s,region:o}=t,a=IK(t,r),l=a.left+a.right,c=a.top+a.bottom,u=i-l,d=n-c,p=Math.min(bwt,Math.min((Rde-l)/u,(Rde-c)/d));return ps){const c=Math.floor(n.width/o),u=n.height-c;return{x:n.x,y:Math.floor(n.y+u/2),width:n.width,height:c}}const a=Math.floor(n.height*o),l=n.width-a;return{x:Math.floor(n.x+l/2),y:n.y,width:a,height:n.height}}function Pwt(t,e){if(!e||e.width==null||e.height==null)return t;const r=e.width/e.height,i=t.width/t.height;if(i===r)return t;if(i0){const s=255/n;e[i]=e[i]*s,e[i+1]=e[i+1]*s,e[i+2]=e[i+2]*s}}}const Lwt={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},Pde=98,Dwt="png",Nwt={png:100,jpg:Pde,jpeg:Pde},Fwt={top:0,right:0,bottom:0,left:0};let Uwt=class{constructor(e,r){this.parameters=e,this.frameHasDecorations=r}},kwt=class{constructor(e,r,i,n){this._rctx=e,this._renderFunctions=r,this._forceCameraHook=i,this._disposeOffscreenBuffers=n,this.supersample=!0,this._screenshotQueue=new Array}destroy(){this._rctx=null}async takeScreenshot(e){await this._renderFunctions.prepareOverlay(),this._renderFunctions.requestRenderScene(dn.BACKGROUND);const r=Wo();return this._screenshotQueue.push({settings:e,resolver:r}),r.promise}update(e,r){for(const i of this._screenshotQueue){if(this._rctx==null){i.resolver.reject();continue}const n={...i.settings,pixelRatio:i.settings.pixelRatio*e.parameters.camera.pixelRatio},s=this._renderScreenshot(e,n,r);i.resolver(s)}this._screenshotQueue.length=0}_renderScreenshotOverlay(e,r,i){e.width=r.width,e.height=r.height;const n=e.getContext("2d"),s=i.pixelRatio;return n.save(),n.translate(0,r.height),n.scale(1,-1),i.region&&n.translate(-i.region.x,-i.region.y),n.scale(s,s),r=this._renderFunctions.renderOverlay(e,r),n.restore(),r}_readbackScreenshot(e,r){return e.resample?this._readbackScreenshotResampled({...e,resample:e.resample},r):this._readbackScreenshotImmediate(e,r)}_readbackScreenshotResampled(e,r){const{framebufferWidth:i,framebufferHeight:n,region:s,resample:o}=e,a=this._ensureScreenshotEncodeCanvas();let l=sz(i,n,a);this._rctx.gl.readPixels(0,0,i,n,Tt.RGBA,Qe.UNSIGNED_BYTE,new Uint8Array(l.data.buffer)),r(),l=this._renderScreenshotOverlay(a,l,{...e,region:void 0});const c=sz(s.width,s.height,a);return Ewt(l,c,!0,o.region.x,n-(o.region.y+o.region.height),o.region.width,o.region.height)}_readbackScreenshotImmediate(e,r){const{framebufferHeight:i,region:n}=e,s=this._ensureScreenshotEncodeCanvas(),o=sz(n.width,n.height,s);return this._rctx.gl.readPixels(n.x,i-(n.y+n.height),n.width,n.height,Tt.RGBA,Qe.UNSIGNED_BYTE,new Uint8Array(o.data.buffer)),r(),this._renderScreenshotOverlay(s,o,e)}_renderScreenshot(e,r,i){let n=null;const s=e.parameters.camera,o={width:r.framebufferWidth,height:r.framebufferHeight};_b(o,Math.min(this._rctx.parameters.maxTextureSize,this._rctx.parameters.maxRenderbufferSize));let a=!1;const l=r.disableDecorations&&e.frameHasDecorations,c=o.width!==s.fullWidth||o.height!==s.fullHeight,u=r.ignorePadding&&s.pixelRatio!==r.pixelRatio,d=c||l||u||r.objectAndLayerIdColor,p=r.objectAndLayerIdColor?new hs(this._rctx,new pr(o.width,o.height),new n5(jn.DEPTH_STENCIL,o.width,o.height)):null;if(d){const v=s.clone();if(r.ignorePadding){const A=PP(v.padding);for(let C=0;C<4;C++)A[C]=Math.round(A[C]/v.pixelRatio*r.pixelRatio);v.padding=A}v.fullWidth=o.width,v.fullHeight=o.height,v.pixelRatio=r.pixelRatio;const b=s.fovX-v.fovX,x=s.fovY-v.fovY;b<0&&b{this._rctx.bindFramebuffer(null),Le(n)},y=this._readbackScreenshot(r,m);m();let _=null;if(r.objectAndLayerIdColor){const v=()=>{this._rctx.bindFramebuffer(null),Le(p)};this._rctx.bindFramebuffer(p),_=this._readbackScreenshot(r,v),this._rctx.bindFramebuffer(null),v()}if(d&&!this._rctx.contextAttributes.alpha)for(let v=3;v{var n;return(n=this.waterTextureRepository)==null?void 0:n.updating},()=>this.requestRender(),Pr),ue(()=>e.view.qualityProfile,n=>{var s;return(s=this.renderer)==null?void 0:s.updateRenderFeature(n)},An),this._magnifierHelper.events.on("request-render",()=>this.requestRender())]);const{memoryController:r}=e.view.resourceController;this.stippleTextureRepository=ast(this._rctx,r),this.markerTextureRepository=ywt(this._rctx,r),this._shaderTechniqueRepository=new xCe({rctx:this._rctx,viewingMode:e.viewingMode,stippleTextureRepository:this.stippleTextureRepository,waterTextureRepository:this.waterTextureRepository,markerTextureRepository:this.markerTextureRepository}),this._textureRepository=new N2(e,this._shaderTechniqueRepository,this._rctx),this.addHandles(this._textureRepository.events.on("changed",n=>this.requestRender(n))),this._materialRepository=new TCe(this._textureRepository,this._shaderTechniqueRepository,()=>this.requestRender(),()=>this.requestRender()),this._compositingHelper=new _1t(this._rctx,this._shaderTechniqueRepository),this.renderer=new Yl(e,this._materialRepository,this._textureRepository,this._shaderTechniqueRepository,this._rctx,this._compositingHelper,this._magnifierHelper,n=>this.requestRender(n));const i={renderScene:(n,s,o,a,l)=>this.renderer.render(n,s,o,a,l),requestRenderScene:n=>this.requestRender(n),prepareOverlay:()=>e.options.screenshot.prepareOverlay(),renderOverlay:(n,s)=>e.options.screenshot.renderOverlay(n,s)};this._screenshotManager=new kwt(this._rctx,i,n=>this.events.emit("force-camera-for-screenshot",n),()=>this.renderer.disposeOffscreenBuffers()),this._registerFrameTask(e)}normalizeCtorArgs(){return{}}destroy(){this._container.contains(this._canvas)&&this._container.removeChild(this._canvas),this._frameTask=Pi(this._frameTask),this._shaderTechniqueRepository=Me(this._shaderTechniqueRepository)}requestRender(e=dn.UPDATE){this._needsRender=!0,e===dn.UPDATE&&(this._needsUpdate=!0)}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this._textureRepository.updating||this.waterTextureRepository.updating||this._magnifierHelper.updating}get textureRepository(){return this._textureRepository}get compositingHelper(){return this._compositingHelper}set magnifier(e){this._magnifierHelper.magnifier=e}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(e).then(r=>r[0])}takeScreenshotWithOID(e){return e.objectAndLayerIdColor=!0,this._screenshotManager.takeScreenshot(e)}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,r,i,n,s,o=s){const a=n.constrainWindowSize(r,i,s*n.pixelRatio,o*n.pixelRatio),l=this._ensureDepthBuffer(a);this.renderer.readDepthPixels(n,a,l);let c=Number.MAX_VALUE;for(let u=0;ud&&d!==n.nearFar[0]&&d!==n.nearFar[1]&&(c=d)}if(e!=null){const u=e.pickDepth(r*n.pixelRatio,i*n.pixelRatio,n);u!=null&&c>u&&u!==n.nearFar[0]&&u!==n.nearFar[1]&&(c=u)}return c===Number.MAX_VALUE?void 0:c}_ensureDepthBuffer(e){const r=4*e[2]*e[3];return(this._tmpDepthBuffer==null||this._tmpDepthBuffer.byteLength{i=this.updating,n=this._needsUpdate?dn.UPDATE:dn.BACKGROUND,e.commitSyncLayers();const l=a-this._lastAnimationUpdate;if(l>this.renderer.animationTimestep||r.forcedAnimationTime!=null||i||this._needsRender){const c=l/this.renderer.animationTimeDilation,u=new gSe(r.camera,c,r.forcedAnimationTime);this.renderer.updateAnimation(u)&&this.requestRender(dn.BACKGROUND),this._lastAnimationUpdate=a}},render:({time:a})=>{if((this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&r.camera.fullWidth>0&&r.camera.fullHeight>0){const l=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this.renderer.render(null,null,r,hw.ON,a),s=!0,l&&this.renderer.hasReflections&&(this.requestRender(dn.BACKGROUND),this._needsWaterReflectionUpdate=!0)}},update:({time:a})=>{const l=new Uwt(r,this.renderer.hasSlicePlane||this._magnifierHelper.enabled);this._textureRepository.update(),this._screenshotManager.update(l,a)},finish:()=>{s&&(this.renderer.finish(r.mode===Cr.IDLE?n:dn.UPDATE),s=!1)}};this._frameTask=fS(o)}_initializeContext(e){const r=e.options;this._canvas=r.canvas,this._canvas||(this._canvas=document.createElement("canvas")),this._canvas.setAttribute("style","width: 100%; height:100%; display:block;");const i={alpha:r.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:r.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:r.preserveDrawingBuffer??!1},n=pWe("3d",this._canvas,i);n!=null?(this._rctx=this._newRenderingContext(n,e),this._loadShaderOnlyExtensions(),!r.alpha&&this._rctx.contextAttributes.alpha&&J.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested"),!this._rctx.contextAttributes.alpha&&se("safari")>=11&&(this._container.style.backgroundColor="black"),this._container.appendChild(this._canvas)):J.getLogger(this).error("A WebGL2 context could not be created.")}_newRenderingContext(e,r){const i={disabledExtensions:r.options.deactivatedWebGLExtensions||{},debugWebGLExtensions:r.options.debugWebGLExtensions||{},maxAnisotropy:8},n=(s,o)=>r.view.resourceController.memoryController.newCache(s,o);return new mwt(e,i,n)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloat")}getObjectAndLayerIdColor(e){return this.objectAndLayerIdRenderHelper!=null?this.objectAndLayerIdRenderHelper.getObjectAndLayerIdColor(e):null}get componentObjectCollection(){return this._componentObjectCollection==null&&(this._componentObjectCollection=new s1t(this.renderer.renderPassManager,this._viewingMode)),this._componentObjectCollection}set componentObjectCollection(e){this._componentObjectCollection=e}};h([f({type:Boolean,readOnly:!0})],Ns.prototype,"updating",null),h([f({autoDestroy:!0})],Ns.prototype,"_rctx",void 0),h([f({autoDestroy:!0})],Ns.prototype,"_container",void 0),h([f({autoDestroy:!0})],Ns.prototype,"_canvas",void 0),h([f({autoDestroy:!0})],Ns.prototype,"stippleTextureRepository",void 0),h([f({autoDestroy:!0})],Ns.prototype,"markerTextureRepository",void 0),h([f({autoDestroy:!0})],Ns.prototype,"waterTextureRepository",void 0),h([f({autoDestroy:!0})],Ns.prototype,"_magnifierHelper",void 0),h([f({readOnly:!0})],Ns.prototype,"objectAndLayerIdRenderHelper",void 0),h([f({autoDestroy:!0})],Ns.prototype,"_textureRepository",void 0),h([f({autoDestroy:!0})],Ns.prototype,"_compositingHelper",void 0),h([f({autoDestroy:!0,readOnly:!0})],Ns.prototype,"renderer",void 0),h([f({autoDestroy:!0})],Ns.prototype,"_screenshotManager",void 0),h([f()],Ns.prototype,"componentObjectCollection",null),h([f({autoDestroy:!0})],Ns.prototype,"_componentObjectCollection",void 0),h([f()],Ns.prototype,"_needsUpdate",void 0),h([f()],Ns.prototype,"_needsWaterReflectionUpdate",void 0),Ns=h([N("esri.views.3d.webgl-engine.parts.RenderView")],Ns);let Gc=class extends xe{constructor(e){super(e),this._model=new lN,this._layers=new Nt,this._asyncChangeSet=new KH,this._syncChangeSet=new KH,this._layerSyncSet=new Set}initialize(){this._set("renderView",new Ns(this)),this._frameTask=this.view.resourceController.scheduler.registerTask(dt.STAGE,this),this.addHandles(this._frameTask)}destroy(){this.removeAllHandles()}get viewingMode(){return this.view.state.viewingMode}get updating(){return this.running||this.renderView.updating||this._frameTask.updating}get renderer(){var e;return(e=this.renderView)==null?void 0:e.renderer}add(e){this._model.add(e),F5(e)&&this._addLayer(e),this.renderView.requestRender()}remove(e){e==null||this.destroyed||(this._model.remove(e),F5(e)&&this._removeLayer(e),this.renderView.requestRender())}addMany(e){e!=null&&(this._model.addMany(e),this.renderView.requestRender())}removeMany(e){var r,i;e!=null&&((r=this._model)==null||r.removeMany(e),(i=this.renderView)==null||i.requestRender())}async load(e,r){e!=null&&(Array.isArray(e)||(e=[e]),await Promise.all(e.filter(i=>i.glTexture==null).map(i=>this.schedule(()=>this._model.has(i)?i.load(this.renderView.renderingContext):null),r)))}loadImmediate(e){return e.load(this.renderView.renderingContext)}forEachOfType(e,r){this._model.forEachOfType(e,r)}handleEvent(e,r){this.destroyed||(this._model.dirtySet[e](r),this.renderView.requestRender())}get running(){return this._model.dirtySet.dirty||!this._asyncChangeSet.empty}runTask(e){this._frameTask.processQueue(e),this._commit(e)}_commit(e){const r=this._model.dirtySet;this._asyncChangeSet.empty||e.done||(this.renderer.modify(this._asyncChangeSet,e),this.renderView.requestRender(),e.madeProgress()),this._layers.forAll(i=>{if(e.done)return;const n=this._layerSyncSet.has(i.id)||i.updatePolicy===O_.SYNC,s=n?this._syncChangeSet:this._asyncChangeSet;r.commitLayer(i.id,s),this._layerSyncSet.delete(i.id),s.empty||(this.renderer.modify(s,n?Wa:e),this.renderView.requestRender(),e.madeProgress())}),this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,Wa),this.renderView.requestRender(),e.madeProgress()),this._layers.forAll(i=>{e.done||this._layerSyncSet.has(i.id)||i.updatePolicy!==O_.ASYNC||(r.commitLayer(i.id,this._asyncChangeSet),this._asyncChangeSet.empty||(this.renderer.modify(this._asyncChangeSet,e),this.renderView.requestRender(),e.madeProgress()))}),this._layerSyncSet.clear(),this.notifyChange("running")}commitSyncLayers(){const e=this._model.dirtySet;this._layers.forAll(r=>{(this._layerSyncSet.has(r.id)||r.updatePolicy===O_.SYNC)&&(e.commitLayer(r.id,this._syncChangeSet),this._layerSyncSet.delete(r.id))});for(const r of this._layerSyncSet)e.commitLayer(r,this._syncChangeSet);this._layerSyncSet.clear(),this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,Wa),this.renderView.requestRender())}_commitLayer(e){this._model.dirtySet.commitLayer(e.id,this._syncChangeSet),this._layerSyncSet.delete(e.id),this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,Wa),this.renderView.requestRender())}schedule(e,r){return this._frameTask.schedule(e,r)}reschedule(e,r){return this._frameTask.reschedule(e,r)}syncLayer(e){this._layerSyncSet.add(e),this.renderView.requestRender()}getObject(e){return this._model.getObject(e)}get layers(){return this._layers}_addLayer(e){this._layers.includes(e)||this._layers.push(e)}_removeLayer(e){this._commitLayer(e),this._layers.removeUnordered(e)!=null&&(this._model.dirtySet.getResidentRenderGeometries(e.id,this._syncChangeSet.removes),this.renderer.modify(this._syncChangeSet,Wa))}addRenderPlugin(e,r,i){const n=this.renderer.renderPlugins.add(e,r,i),s=()=>{pce(r)&&this.view.sceneIntersectionHelper.addIntersectionHandler(r)};if(Eu(n))return n.then(s);s()}removeRenderPlugin(e){this.destroyed||(pce(e)&&this.view.sceneIntersectionHelper.removeIntersectionHandler(e),this.renderer.renderPlugins.remove(e))}get performanceInfo(){return{renderer:this.renderer.performanceInfo,model:this._model.getStats()}}get test(){const e=this;return{getCount:r=>e._model.test.content.filter(i=>i.type===r).length,model:e._model}}};Gc.DebugSettings={endFrameContentValidation:!1},h([f({constructOnly:!0})],Gc.prototype,"view",void 0),h([f({constructOnly:!0})],Gc.prototype,"options",void 0),h([f({readOnly:!0})],Gc.prototype,"viewingMode",null),h([f({constructOnly:!0})],Gc.prototype,"container",void 0),h([f({readOnly:!0})],Gc.prototype,"updating",null),h([f({constructOnly:!0})],Gc.prototype,"_model",void 0),h([f({autoDestroy:!0})],Gc.prototype,"renderView",void 0),h([f({readOnly:!0})],Gc.prototype,"renderer",null),h([f({readOnly:!0})],Gc.prototype,"running",null),Gc=h([N("esri.views.3d.webgl-engine.Stage")],Gc);let bkt=class extends u8{constructor(e,r,i,n){super(r,i),this.point=e,this.createGraphic=n}};function kPe(t){return bp(t)&&t.intersector===Ui.PCL&&!!t.target}let xkt=class extends k2e{constructor(e,r,i,n,s){super(e),this.layerUid=e,this.sublayerUid=r,this.nodeIndex=i,this.componentIndex=n,this.triangleNr=s}},Skt=class extends u8{constructor(e,r,i){super(r,null),this.point=e,this.createVoxelGraphic=i}};function aU(t){return bp(t)&&t.intersector===Ui.I3S&&!!t.target}function zPe(t){return bp(t)&&t.intersector===Ui.VOXEL&&!!t.target}function Mde(t,e){var r,i;return h8(t)||d8(t)?ZR((r=t.target)==null?void 0:r.object,e):Ust(t)?(i=e.map)==null?void 0:i.ground:kPe(t)||aU(t)||jCe(t)||zPe(t)?ZR(t.target,e):null}function Ckt(t,e){const r=YW(t,e);return r!=null&&r.type==="graphic"?r.graphic:null}function YW(t,e){var r;if(t==null)return null;if(h8(t)||d8(t))return $de((r=t.target)==null?void 0:r.object,e);if(kPe(t)){const i=t.target.createGraphic();return{type:"graphic",graphic:i,layer:i.layer}}if(zPe(t)){const i=t.target.createVoxelGraphic();return{type:"graphic",graphic:i,layer:i.layer}}return jCe(t)||rK(t)?$de(t.target,e):aU(t)?zwt(t.target,e):null}function $de(t,e){if(t==null||t.graphicUid==null)return null;const r=ZR(t,e);if(r==null)return null;if(r===e.graphics)return e.graphicsView==null||typeof t.graphicUid!="number"?null:e.graphicsView.getHit(t.graphicUid);const i=e.allLayerViews.find(n=>n.layer===r);return!i||i.suspended||t.graphicUid==null?null:"getHit"in i?i.getHit(t.graphicUid):null}function zwt(t,e){const r=ZR(t,e);if(r==null)return null;const i=e.allLayerViews.find(n=>n.layer===r);return i&&!i.suspended&&"getGraphicFromIntersectorTarget"in i?Vwt(i.getGraphicFromIntersectorTarget(t)):null}function Bwt(t,e){const r=ZR(t,e);if(r==null)return null;const i=e.allLayerViews.find(n=>n.layer===r);return i&&!i.suspended&&"getAABBFromIntersectorTarget"in i?i.getAABBFromIntersectorTarget(t):null}function Vwt(t){return t!=null?{type:"graphic",graphic:t,layer:t.layer}:null}function ZR(t,e){return t&&t.layerUid!=null?e.graphicsView!=null&&t.layerUid===e.graphicsView.processor.layer.id?e.graphics:e.map.findLayerByUid(t.layerUid):null}function Akt(t,e){if(h8(t)||d8(t))return vg(t.target.object.boundingVolumeWorldSpace.bounds);if(rK(t)){dve(fL,t.transformation);const r=Math.max(fL[0],fL[1],fL[2]);return t.target.baseBoundingSphere.radius*r}return aU(t)?_h(Bwt(t.target,e),r=>.5*S1e(r)):null}function Okt(t){return!h8(t)&&!d8(t)&&(rK(t)?t.target.numLodLevels>1:!!aU(t))}const fL=O();async function Gwt(t,e){if(t.type==="2d")return t.hitTest(e);const r=await t.hitTest(e);if(r.results.length===0)return r;const i=(r.results[0].distance??0)*(1+jwt),n=r.results.findIndex(s=>(s.distance??0)>i);return n!==-1&&(r.results=r.results.slice(0,n)),r}const jwt=.05;function Rkt(t){return t&&typeof t.highlight=="function"}function Hwt(t){return t&&typeof t.maskOccludee=="function"}function Pkt(t,e,r){return t==null||t>r&&(e===0||t0||e!=null&&e>0}function $kt(t){const e=t.effectiveScaleRange;return{minScale:(e==null?void 0:e.minScale)??0,maxScale:(e==null?void 0:e.maxScale)??0}}let cB,uB;function Wwt(t){const e=pxe(t);for(;e.length>1;){const r=Ide(e.shift());if(r.available)return r}return Ide(e.shift())}function Ide(t){switch(t){case rr.WEBGL1:return qwt();case rr.WEBGL2:return Xwt()}}function qwt(){return cB||(cB=Qwt()),cB}function Xwt(){return uB||(uB=Jwt()),uB}let BPe=class{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsElementIndexUint=!1,this.supportsStandardDerivatives=!1,this.supportsInstancedArrays=!1,this.supportsTextureFloat=!1,this.supportsTextureHalfFloat=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1}},Ywt=class extends BPe{constructor(){super(...arguments),this.type=rr.WEBGL1}},Zwt=class extends BPe{constructor(){super(...arguments),this.type=rr.WEBGL2,this.supportsElementIndexUint=!0,this.supportsStandardDerivatives=!0,this.supportsInstancedArrays=!0,this.supportsTextureFloat=!0,this.supportsTextureHalfFloat=!0}};function VPe(t,e){if(t===rr.WEBGL1&&typeof WebGLRenderingContext>"u"||t===rr.WEBGL2&&typeof WebGL2RenderingContext>"u")return null;const r=document.createElement("canvas");if(!r)return null;let i=yj(r,t,{failIfMajorPerformanceCaveat:!0});if(i==null&&(i=yj(r,t),i!=null&&(e.majorPerformanceCaveat=!0)),i==null)return i;if(t===rr.WEBGL1){const s=i.getParameter(i.VERSION),o=s==null?void 0:s.match(/^WebGL\s+([\d.]*)/);if(o){const a=parseFloat(o[1]);e.available=a>=.94}}else e.available=!0;e.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE),e.supportsVertexShaderSamplers=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const n=i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT);return n&&(e.supportsHighPrecisionFragment=n.precision>0),i}function Qwt(){const t=new Ywt,e=VPe(rr.WEBGL1,t);return e==null||(t.supportsElementIndexUint=e.getExtension("OES_element_index_uint")!==null,t.supportsStandardDerivatives=e.getExtension("OES_standard_derivatives")!==null,t.supportsInstancedArrays=e.getExtension("ANGLE_instanced_arrays")!==null,t.supportsTextureFloat=e.getExtension("OES_texture_float")!==null,t.supportsTextureHalfFloat=e.getExtension("OES_texture_half_float")!==null,t.supportsColorBufferFloat=e.getExtension("WEBGL_color_buffer_float")!==null,t.supportsColorBufferFloatBlend=e.getExtension("EXT_float_blend")!==null,t.supportsColorBufferHalfFloat=e.getExtension("EXT_color_buffer_half_float")!==null),t}function Jwt(){const t=new Zwt,e=VPe(rr.WEBGL2,t);return e==null||(t.supportsColorBufferFloat=e.getExtension("EXT_color_buffer_float")!==null,t.supportsColorBufferFloatBlend=e.getExtension("EXT_float_blend")!==null,t.supportsColorBufferHalfFloat=t.supportsColorBufferFloat||e.getExtension("EXT_color_buffer_half_float")!==null),t}function Kwt(t){const e=Wwt(t);if(!e.available)return new Y("webgl:required",t==="3d"?"WebGL2 is required but not supported.":"WebGL is required but not supported.",new Error().stack);if(t==="3d"&&e.majorPerformanceCaveat)return new Y("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check your browser settings or if your GPU is in a blocklist.");if(!e.supportsHighPrecisionFragment)return new Y("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported.");if(!e.supportsVertexShaderSamplers)return new Y("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported.");if(e.type===rr.WEBGL1){if(!e.supportsElementIndexUint)return new Y("webgl:element-index-uint-required","WebGL support for uint vertex indices is required but not supported.");if(!e.supportsStandardDerivatives)return new Y("webgl:standard-derivatives-required","WebGL support for standard derivatives is required but not supported.");if(!e.supportsInstancedArrays)return new Y("webgl:instanced-arrays-required","WebGL support for instanced rendering is required but not supported.")}return null}function ext(t){return t&&"nodeType"in t}function txt(t){return t&&typeof t.render=="function"}const Lde={component:"esri-component"};let Vv=class extends xe{constructor(){super(...arguments),this.widget=null}destroy(){var e;this.node=null,(e=this.widget)==null||e.destroy()}get id(){return this.get("widget.id")||this.get("node.id")}set node(e){const r=this._get("node");e!==r&&(e&&e.classList.add(Lde.component),r&&r.classList.remove(Lde.component),this._set("node",e))}castNode(e){var r;return(r=this.widget)==null||r.destroy(),e?typeof e=="string"||ext(e)?(this._set("widget",null),R6(e)):(txt(e)&&!e.domNode&&(e.domNode=document.createElement("div")),this._set("widget",e),e.domNode):(this._set("widget",null),null)}};h([f({dependsOn:[]})],Vv.prototype,"id",null),h([f()],Vv.prototype,"node",null),h([_i("node")],Vv.prototype,"castNode",null),h([f({readOnly:!0})],Vv.prototype,"widget",void 0),Vv=h([N("esri.views.ui.Component")],Vv);const pN=Vv,GPe="calcite-mode-";function rxt(){return getComputedStyle(document.body).getPropertyValue("--esri-calcite-mode-name").replaceAll(/\s|'|"/g,"")}function ixt(){return rxt().startsWith("dark")}function nxt(){return`${GPe}${ixt()?"dark":"light"}`}function sxt(t){oxt(t),t.classList.add(nxt())}function oxt(t){Array.from(t.classList).forEach(e=>{e.startsWith(GPe)&&t.classList.remove(e)})}const axt={left:0,top:0,bottom:0,right:0},jPe={bottom:30,top:15,right:15,left:15},Mm="esri-ui",Hl={ui:Mm,corner:`${Mm}-corner`,innerContainer:`${Mm}-inner-container`,manualContainer:`${Mm}-manual-container`,cornerContainer:`${Mm}-corner-container`,topLeft:`${Mm}-top-left`,topRight:`${Mm}-top-right`,bottomLeft:`${Mm}-bottom-left`,bottomRight:`${Mm}-bottom-right`};function lxt(t){return t&&!t._started&&typeof t.postMixInProperties=="function"&&typeof t.buildRendering=="function"&&typeof t.postCreate=="function"&&typeof t.startup=="function"}function mL(t){return t===0?"0":`${t}px`}function hB(t){const e=typeof t=="object"&&t!==null&&Object.getPrototypeOf(t);return(e===null||e===Object.prototype)&&("component"in t||"index"in t||"position"in t)?t:null}function dB(t,{top:e,bottom:r,left:i,right:n}){t.style.top=e,t.style.bottom=r,t.style.left=i,t.style.right=n}let hf=class extends Bn.EventedAccessor{constructor(e){super(e),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentMap=new Map,this._locale=ep(),this.view=null,this._applyViewPadding=()=>{const r=this.container;r&&dB(r,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const r=this._innerContainer;r&&dB(r,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([ue(()=>{var e;return[(e=this.view)==null?void 0:e.padding,this.container]},this._applyViewPadding,Pr),ue(()=>this.padding,this._applyUIPadding,Pr),ue(()=>[this.container,this._locale],([e,r])=>{e&&e.setAttribute("lang",r)},Pr),j0e(e=>{this._locale=e})])}destroy(){this.container=null;for(const e of this._components)e.destroy();this._components.length=0,this._componentMap.clear()}set container(e){const r=this._get("container");e!==r&&(e&&(e.classList.add(Hl.ui),sxt(e),this._attachContainers(e)),r&&(r.classList.remove(Hl.ui),dB(r,{top:"",bottom:"",left:"",right:""}),tve(r)),this._set("container",e))}get height(){var s;const e=((s=this.view)==null?void 0:s.height)??0;if(e===0)return e;const r=this._getViewPadding(),{top:i,bottom:n}=r;return Math.max(e-i-n,0)}get padding(){return this._get("padding")}set padding(e){this._overrideIfSome("padding",e)}castPadding(e){return typeof e=="number"?{bottom:e,top:e,right:e,left:e}:{...jPe,...e}}get width(){var s;const e=((s=this.view)==null?void 0:s.width)??0;if(e===0)return e;const r=this._getViewPadding(),{left:i,right:n}=r;return Math.max(e-i-n,0)}add(e,r){let i,n,s;if(Array.isArray(e))return void e.forEach(a=>this.add(a,r));const o=hB(e);o&&({index:i,position:r,component:e,key:n}=o),r&&typeof r=="object"&&({index:i,key:n,position:r,internal:s}=r),!e||r&&!this._isValidPosition(r)||this._add(e,r,i,n,s)}remove(e,r){var n;if(!e)return;if(Array.isArray(e))return e.map(s=>this.remove(s,r));const i=this._find(e);if(i){if(this._componentMap.has(e)&&((n=this._componentMap.get(e))==null?void 0:n.key)!==r)return;const s=this._components.indexOf(i),o=i.node.parentNode;return o==null||o.removeChild(i.node),this._componentMap.delete(e),this._components.splice(s,1)[0]}}empty(e,r={removeInternal:!1}){if(Array.isArray(e)){for(const s of e)this.empty(s,r);return}const i=this._positionNameToContainerLookup[e??"manual"],n=Array.prototype.slice.call(i.children).map(s=>this._findByNode(s)).filter(s=>{var o;return s==null?!1:!(((o=this._componentMap.get(s))==null?void 0:o.internal)??!1)||r.removeInternal});for(const s of n)this.remove(s)}move(e,r){if(Array.isArray(e)&&e.forEach(o=>this.move(o,r)),!e)return;let i;const n=hB(e)||hB(r);if(n&&(i=n.index,r=n.position,e=n.component||e),r&&!this._isValidPosition(r))return;const s=this.remove(e);s&&this.add(s,{position:r,index:i})}find(e){if(!e)return null;const r=this._findById(e);return r&&(r.widget||r.node)}getComponents(e,r={includeInternal:!1}){return e?Array.isArray(e)?e.map(i=>this._getComponentsAtPosition(i,r)).flat():this._getComponentsAtPosition(e,r):this._components.filter(i=>{var n;return r.includeInternal||!((n=this._componentMap.get(i))!=null&&n.internal)}).map(({widget:i,node:n})=>i??n)}getPosition(e){for(const r in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[r].contains(e))return r;return null}_add(e,r,i,n,s){e instanceof pN||(e=new pN({node:e})),this._place({component:e,position:r,index:i}),this._components.push(e),this._componentMap.set(e,{key:n,internal:s})}_find(e){return e?e instanceof pN?this._findByComponent(e):typeof e=="string"?this._findById(e):this._findByNode(e.domNode||e):null}_getViewPadding(){var e;return((e=this.view)==null?void 0:e.padding)??axt}_attachContainers(e){e.appendChild(this._innerContainer),e.appendChild(this._manualContainer)}_initContainers(){const e=document.createElement("div");e.classList.add(Hl.innerContainer,Hl.cornerContainer);const r=document.createElement("div");r.classList.add(Hl.innerContainer,Hl.manualContainer);const i=document.createElement("div");i.classList.add(Hl.topLeft,Hl.corner),e.appendChild(i);const n=document.createElement("div");n.classList.add(Hl.topRight,Hl.corner),e.appendChild(n);const s=document.createElement("div");s.classList.add(Hl.bottomLeft,Hl.corner),e.appendChild(s);const o=document.createElement("div");o.classList.add(Hl.bottomRight,Hl.corner),e.appendChild(o),this._innerContainer=e,this._manualContainer=r;const a=bGe();this._cornerNameToContainerLookup={"top-left":i,"top-right":n,"bottom-left":s,"bottom-right":o,"top-leading":a?n:i,"top-trailing":a?i:n,"bottom-leading":a?o:s,"bottom-trailing":a?s:o},this._positionNameToContainerLookup={manual:r,...this._cornerNameToContainerLookup}}_isValidPosition(e){return!!this._positionNameToContainerLookup[e]}_place(e){const r=e.position??"manual",{component:i,index:n}=e,s=this._positionNameToContainerLookup[r],o=n!=null&&n>-1;if(lxt(i.widget)&&i.widget.startup(),!o)return void s.appendChild(i.node);const a=Array.from(s.children);if(n===0)return void(s.firstChild?Wre(i.node,s.firstChild):s.appendChild(i.node));n>=a.length?s.appendChild(i.node):Wre(i.node,a[n])}_toPixelPosition(e){return{top:mL(e.top),left:mL(e.left),right:mL(e.right),bottom:mL(e.bottom)}}_findByComponent(e){return this._components.find(r=>r===e)??null}_findById(e){return this._components.find(({id:r})=>r===e)??null}_findByNode(e){return this._components.find(({node:r})=>r===e)??null}_getComponentsAtPosition(e,r){const i=this._positionNameToContainerLookup[e];return Array.prototype.slice.call(i.children).map(n=>this._findByNode(n)).filter(aP).filter(n=>{var s;return r.includeInternal||!((s=this._componentMap.get(n))!=null&&s.internal)}).map(({widget:n,node:s})=>n??s)}};h([f()],hf.prototype,"_locale",void 0),h([f()],hf.prototype,"container",null),h([f()],hf.prototype,"height",null),h([f({value:jPe})],hf.prototype,"padding",null),h([_i("padding")],hf.prototype,"castPadding",null),h([f()],hf.prototype,"view",void 0),h([f()],hf.prototype,"width",null),hf=h([N("esri.views.ui.UI")],hf);const cxt=hf,uxt="randomUUID"in crypto;function HPe(){if(uxt)return crypto.randomUUID();const t=crypto.getRandomValues(new Uint16Array(8));t[3]=4095&t[3]|16384,t[4]=16383&t[4]|32768;const e=r=>t[r].toString(16).padStart(4,"0");return e(0)+e(1)+"-"+e(2)+"-"+e(3)+"-"+e(4)+"-"+e(5)+e(6)+e(7)}function Ukt(){return`{${HPe()}}`}const hxt={handleInterceptedEvent:(t,e,r,i)=>(t.scheduleRender(),e.properties[`on${i.type}`].apply(e.properties.bind||r,[i]))},dxt={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(t,e,r)=>{t.style[e]=r}},pxt=t=>({...dxt,...t}),fxt=(t,e)=>{const r=[];for(;t&&t!==e;)r.push(t),t=t.parentNode;return r},mxt=(t,e)=>t.find(e),Dde=(t,e,r=!1)=>{let i=t;return e.forEach((n,s)=>{const o=i!=null&&i.children?mxt(i.children,a=>a.domNode===n):void 0;r&&!o&&s!==e.length-1||(i=o)}),i},gxt=t=>{let e;const r={...hxt,...t},i=pxt(r),n=i.performanceLogger;let s,o=!0,a=!1;const l=[],c=[],u=(p,m,y)=>{var b;let _;i.eventHandlerInterceptor=(x,T,S,A)=>function(C){let R;n("domEvent",C);const P=fxt(C.currentTarget,_.domNode),F=P.some(V=>{var z;return customElements.get((z=V==null?void 0:V.tagName)==null?void 0:z.toLowerCase())});if(C.eventPhase===Event.CAPTURING_PHASE||!F)P.reverse(),R=Dde(_.getLastRender(),P);else{const V=C.composedPath(),z=V.slice(V.indexOf(C.currentTarget),V.indexOf(_.domNode)).filter(X=>X.getRootNode()===X.ownerDocument).reverse();R=Dde(_.getLastRender(),z,!0)}let k;return R&&(k=r.handleInterceptedEvent(e,R,this,C)),n("domEventProcessed",C),k},(b=r.postProcessProjectionOptions)==null||b.call(r,i);const v=y();_=p(m,v,i),l.push(_),c.push(y),r.afterFirstVNodeRendered&&r.afterFirstVNodeRendered(_,v)};let d=()=>{if(s=void 0,o){o=!1,n("renderStart",void 0);for(let p=0;p{s||a||(s=requestAnimationFrame(d))},stop:()=>{s&&(cancelAnimationFrame(s),s=void 0),a=!0},resume:()=>{a=!1,o=!0,e.scheduleRender()},append:(p,m)=>{u(u_.append,p,m)},insertBefore:(p,m)=>{u(u_.insertBefore,p,m)},merge:(p,m)=>{u(u_.merge,p,m)},replace:(p,m)=>{u(u_.replace,p,m)},detach:p=>{for(let m=0;m{const e=new URL(t,qo.$resourcesUrl$);return e.origin!==lM.location.origin?e.href:e.pathname},_xt=t=>qo.$resourcesUrl$=t,Cw=(t,e="")=>()=>{},Fde="http://www.w3.org/1999/xlink",Ude={},vxt="http://www.w3.org/2000/svg",bxt="http://www.w3.org/1999/xhtml",wxt=t=>t!=null,DK=t=>(t=typeof t,t==="object"||t==="function");function xxt(t){var e,r,i;return(i=(r=(e=t.head)===null||e===void 0?void 0:e.querySelector('meta[name="csp-nonce"]'))===null||r===void 0?void 0:r.getAttribute("content"))!==null&&i!==void 0?i:void 0}const XPe=(t,e,...r)=>{let i=null,n=null,s=null,o=!1,a=!1;const l=[],c=d=>{for(let p=0;pd[p]).join(" "))}}if(typeof t=="function")return t(e===null?{}:e,l,Ext);const u=pF(t,null);return u.$attrs$=e,l.length>0&&(u.$children$=l),u.$key$=n,u.$name$=s,u},pF=(t,e)=>{const r={$flags$:0,$tag$:t,$text$:e,$elm$:null,$children$:null};return r.$attrs$=null,r.$key$=null,r.$name$=null,r},Txt={},Sxt=t=>t&&t.$tag$===Txt,Ext={forEach:(t,e)=>t.map(kde).forEach(e),map:(t,e)=>t.map(kde).map(e).map(Cxt)},kde=t=>({vattrs:t.$attrs$,vchildren:t.$children$,vkey:t.$key$,vname:t.$name$,vtag:t.$tag$,vtext:t.$text$}),Cxt=t=>{if(typeof t.vtag=="function"){const r=Object.assign({},t.vattrs);return t.vkey&&(r.key=t.vkey),t.vname&&(r.name=t.vname),XPe(t.vtag,r,...t.vchildren||[])}const e=pF(t.vtag,t.vtext);return e.$attrs$=t.vattrs,e.$children$=t.vchildren,e.$key$=t.vkey,e.$name$=t.vname,e},Axt=t=>e2t.map(e=>e(t)).find(e=>!!e),Oxt=(t,e)=>t!=null&&!DK(t)?e&4?t==="false"?!1:t===""||!!t:e&2?parseFloat(t):e&1?String(t):t:t,Rxt=t=>t,kkt=(t,e,r)=>{const i=Rxt(t);return{emit:n=>Pxt(i,e,{bubbles:!!(r&4),composed:!!(r&2),cancelable:!!(r&1),detail:n})}},Pxt=(t,e,r)=>{const i=qo.ce(e,r);return t.dispatchEvent(i),i},zde=new WeakMap,Mxt=(t,e,r)=>{let i=mF.get(t);i2t&&r?(i=i||new CSSStyleSheet,typeof i=="string"?i=e:i.replaceSync(e)):i=e,mF.set(t,i)},$xt=(t,e,r,i)=>{var n;let s=YPe(e,r);const o=mF.get(s);if(t=t.nodeType===11?t:sp,o)if(typeof o=="string"){t=t.head||t;let a=zde.get(t),l;if(a||zde.set(t,a=new Set),!a.has(s)){{l=sp.createElement("style"),l.innerHTML=o;const c=(n=qo.$nonce$)!==null&&n!==void 0?n:xxt(sp);c!=null&&l.setAttribute("nonce",c),t.insertBefore(l,t.querySelector("link"))}a&&a.add(s)}}else t.adoptedStyleSheets.includes(o)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,o]);return s},Ixt=t=>{const e=t.$cmpMeta$,r=t.$hostElement$,i=e.$flags$,n=Cw("attachStyles",e.$tagName$),s=$xt(r.shadowRoot?r.shadowRoot:r.getRootNode(),e,t.$modeName$);i&10&&(r["s-sc"]=s,r.classList.add(s+"-h"),i&2&&r.classList.add(s+"-s")),n()},YPe=(t,e)=>"sc-"+(e&&t.$flags$&32?t.$tagName$+"-"+e:t.$tagName$),Bde=(t,e,r,i,n,s)=>{if(r!==i){let o=Hde(t,e),a=e.toLowerCase();if(e==="class"){const l=t.classList,c=Vde(r),u=Vde(i);l.remove(...c.filter(d=>d&&!u.includes(d))),l.add(...u.filter(d=>d&&!c.includes(d)))}else if(e==="style"){for(const l in r)(!i||i[l]==null)&&(l.includes("-")?t.style.removeProperty(l):t.style[l]="");for(const l in i)(!r||i[l]!==r[l])&&(l.includes("-")?t.style.setProperty(l,i[l]):t.style[l]=i[l])}else if(e!=="key")if(e==="ref")i&&i(t);else if(!t.__lookupSetter__(e)&&e[0]==="o"&&e[1]==="n")e[2]==="-"?e=e.slice(3):Hde(lM,a)?e=a.slice(2):e=a[2]+e.slice(3),r&&qo.rel(t,e,r,!1),i&&qo.ael(t,e,i,!1);else{const l=DK(i);if((o||l&&i!==null)&&!n)try{if(t.tagName.includes("-"))t[e]=i;else{const u=i??"";e==="list"?o=!1:(r==null||t[e]!=u)&&(t[e]=u)}}catch{}let c=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(e=a,c=!0),i==null||i===!1?(i!==!1||t.getAttribute(e)==="")&&(c?t.removeAttributeNS(Fde,e):t.removeAttribute(e)):(!o||s&4||n)&&!l&&(i=i===!0?"":i,c?t.setAttributeNS(Fde,e,i):t.setAttribute(e,i))}}},Lxt=/\s/,Vde=t=>t?t.split(Lxt):[],ZPe=(t,e,r,i)=>{const n=e.$elm$.nodeType===11&&e.$elm$.host?e.$elm$.host:e.$elm$,s=t&&t.$attrs$||Ude,o=e.$attrs$||Ude;for(i in s)i in o||Bde(n,i,s[i],void 0,r,e.$flags$);for(i in o)Bde(n,i,s[i],o[i],r,e.$flags$)},fF=(t,e,r,i)=>{const n=e.$children$[r];let s=0,o,a,l;if(qPe||(LK=!0,n.$tag$==="slot"&&(U2&&i.classList.add(U2+"-s"),n.$flags$|=n.$children$?2:1)),n.$text$!==null)o=n.$elm$=sp.createTextNode(n.$text$);else if(n.$flags$&1)o=n.$elm$=sp.createTextNode("");else{if(Kc||(Kc=n.$tag$==="svg"),o=n.$elm$=sp.createElementNS(Kc?vxt:bxt,n.$flags$&2?"slot-fb":n.$tag$),Kc&&n.$tag$==="foreignObject"&&(Kc=!1),ZPe(null,n,Kc),wxt(U2)&&o["s-si"]!==U2&&o.classList.add(o["s-si"]=U2),n.$children$)for(s=0;s{qo.$flags$|=1;const r=t.childNodes;for(let i=r.length-1;i>=0;i--){const n=r[i];n["s-hn"]!==lU&&n["s-ol"]&&(KPe(n).insertBefore(n,NK(n)),n["s-ol"].remove(),n["s-ol"]=void 0,LK=!0),e&&QR(n,e)}qo.$flags$&=-2},QPe=(t,e,r,i,n,s)=>{let o=t["s-cr"]&&t["s-cr"].parentNode||t,a;for(o.shadowRoot&&o.tagName===lU&&(o=o.shadowRoot);n<=s;++n)i[n]&&(a=fF(null,r,n,t),a&&(i[n].$elm$=a,o.insertBefore(a,NK(e))))},JPe=(t,e,r,i,n)=>{for(;e<=r;++e)(i=t[e])&&(n=i.$elm$,rMe(i),dF=!0,n["s-ol"]?n["s-ol"].remove():QR(n,!0),n.remove())},Dxt=(t,e,r,i)=>{let n=0,s=0,o=0,a=0,l=e.length-1,c=e[0],u=e[l],d=i.length-1,p=i[0],m=i[d],y,_;for(;n<=l&&s<=d;)if(c==null)c=e[++n];else if(u==null)u=e[--l];else if(p==null)p=i[++s];else if(m==null)m=i[--d];else if(gL(c,p))k2(c,p),c=e[++n],p=i[++s];else if(gL(u,m))k2(u,m),u=e[--l],m=i[--d];else if(gL(c,m))(c.$tag$==="slot"||m.$tag$==="slot")&&QR(c.$elm$.parentNode,!1),k2(c,m),t.insertBefore(c.$elm$,u.$elm$.nextSibling),c=e[++n],m=i[--d];else if(gL(u,p))(c.$tag$==="slot"||m.$tag$==="slot")&&QR(u.$elm$.parentNode,!1),k2(u,p),t.insertBefore(u.$elm$,c.$elm$),u=e[--l],p=i[++s];else{for(o=-1,a=n;a<=l;++a)if(e[a]&&e[a].$key$!==null&&e[a].$key$===p.$key$){o=a;break}o>=0?(_=e[o],_.$tag$!==p.$tag$?y=fF(e&&e[s],r,o,t):(k2(_,p),e[o]=void 0,y=_.$elm$),p=i[++s]):(y=fF(e&&e[s],r,s,t),p=i[++s]),y&&KPe(c.$elm$).insertBefore(y,NK(c.$elm$))}n>l?QPe(t,i[d+1]==null?null:i[d+1].$elm$,r,i,s,d):s>d&&JPe(e,n,l)},gL=(t,e)=>t.$tag$===e.$tag$?t.$tag$==="slot"?t.$name$===e.$name$:t.$key$===e.$key$:!1,NK=t=>t&&t["s-ol"]||t,KPe=t=>(t["s-ol"]?t["s-ol"]:t).parentNode,k2=(t,e)=>{const r=e.$elm$=t.$elm$,i=t.$children$,n=e.$children$,s=e.$tag$,o=e.$text$;let a;o===null?(Kc=s==="svg"?!0:s==="foreignObject"?!1:Kc,s==="slot"||ZPe(t,e,Kc),i!==null&&n!==null?Dxt(r,i,e,n):n!==null?(t.$text$!==null&&(r.textContent=""),QPe(r,null,e,n,0,n.length-1)):i!==null&&JPe(i,0,i.length-1),Kc&&s==="svg"&&(Kc=!1)):(a=r["s-cr"])?a.parentNode.textContent=o:t.$text$!==o&&(r.data=o)},eMe=t=>{const e=t.childNodes;let r,i,n,s,o,a;for(i=0,n=e.length;i{let e,r,i,n,s,o,a=0;const l=t.childNodes,c=l.length;for(;a=0;o--)r=i[o],!r["s-cn"]&&!r["s-nr"]&&r["s-hn"]!==e["s-hn"]&&(Gde(r,n)?(s=Vd.find(u=>u.$nodeToRelocate$===r),dF=!0,r["s-sn"]=r["s-sn"]||n,s?s.$slotRefNode$=e:Vd.push({$slotRefNode$:e,$nodeToRelocate$:r}),r["s-sr"]&&Vd.map(u=>{Gde(u.$nodeToRelocate$,r["s-sn"])&&(s=Vd.find(d=>d.$nodeToRelocate$===r),s&&!u.$slotRefNode$&&(u.$slotRefNode$=s.$slotRefNode$))})):Vd.some(u=>u.$nodeToRelocate$===r)||Vd.push({$nodeToRelocate$:r}));e.nodeType===1&&tMe(e)}},Gde=(t,e)=>t.nodeType===1?t.getAttribute("slot")===null&&e===""||t.getAttribute("slot")===e:t["s-sn"]===e?!0:e==="",rMe=t=>{t.$attrs$&&t.$attrs$.ref&&t.$attrs$.ref(null),t.$children$&&t.$children$.map(rMe)},Nxt=(t,e)=>{const r=t.$hostElement$,i=t.$cmpMeta$,n=t.$vnode$||pF(null,null),s=Sxt(e)?e:XPe(null,null,e);lU=r.tagName,i.$attrsToReflect$&&(s.$attrs$=s.$attrs$||{},i.$attrsToReflect$.map(([o,a])=>s.$attrs$[a]=r[o])),s.$tag$=null,s.$flags$|=4,t.$vnode$=s,s.$elm$=n.$elm$=r.shadowRoot||r,U2=r["s-sc"],WPe=r["s-cr"],qPe=(i.$flags$&1)!==0,dF=!1,k2(n,s);{if(qo.$flags$|=1,LK){tMe(s.$elm$);let o,a,l,c,u,d,p=0;for(;p{},FK=(t,e)=>(t.$flags$|=16,Fxt(t,t.$ancestorComponent$),s2t(()=>Uxt(t,e))),Uxt=(t,e)=>{const r=t.$hostElement$,i=Cw("scheduleUpdate",t.$cmpMeta$.$tagName$),n=r;let s;return e?s=tS(n,"componentWillLoad"):s=tS(n,"componentWillUpdate"),s=jde(s,()=>tS(n,"componentWillRender")),i(),jde(s,()=>kxt(t,n,e))},kxt=async(t,e,r)=>{const i=t.$hostElement$,n=Cw("update",t.$cmpMeta$.$tagName$);i["s-rc"],r&&Ixt(t);const s=Cw("render",t.$cmpMeta$.$tagName$);zxt(t,e,i),s(),n(),Bxt(t)},zxt=(t,e,r)=>{try{Nde=e,e=e.render&&e.render(),t.$flags$&=-17,t.$flags$|=2,(F2.hasRenderFn||F2.reflect)&&(F2.vdomRender||F2.reflect)&&(F2.hydrateServerSide||Nxt(t,e))}catch(a){aM(a,t.$hostElement$)}return Nde=null,null},Bxt=t=>{const e=t.$cmpMeta$.$tagName$,r=t.$hostElement$,i=Cw("postUpdate",e),n=r;t.$ancestorComponent$,tS(n,"componentDidRender"),t.$flags$&64?(tS(n,"componentDidUpdate"),i()):(t.$flags$|=64,tS(n,"componentDidLoad"),i())},zkt=t=>{{const e=oM(t),r=e.$hostElement$.isConnected;return r&&(e.$flags$&18)===2&&FK(e,!1),r}},tS=(t,e,r)=>{if(t&&t[e])try{return t[e](r)}catch(i){aM(i)}},jde=(t,e)=>t&&t.then?t.then(e):e(),Vxt=(t,e)=>oM(t).$instanceValues$.get(e),Gxt=(t,e,r,i)=>{const n=oM(t),s=t,o=n.$instanceValues$.get(e),a=n.$flags$,l=s;r=Oxt(r,i.$members$[e][0]);const c=Number.isNaN(o)&&Number.isNaN(r);if(r!==o&&!c){n.$instanceValues$.set(e,r);{if(i.$watchers$&&a&128){const d=i.$watchers$[e];d&&d.map(p=>{try{l[p](r,o,e)}catch(m){aM(m,s)}})}if((a&18)===2){if(l.componentShouldUpdate&&l.componentShouldUpdate(r,o,e)===!1)return;FK(n,!1)}}}},jxt=(t,e,r)=>{if(e.$members$){t.watchers&&(e.$watchers$=t.watchers);const i=Object.entries(e.$members$),n=t.prototype;i.map(([s,[o]])=>{(o&31||o&32)&&Object.defineProperty(n,s,{get(){return Vxt(this,s)},set(a){Gxt(this,s,a,e)},configurable:!0,enumerable:!0})});{const s=new Map;n.attributeChangedCallback=function(o,a,l){qo.jmp(()=>{const c=s.get(o);if(this.hasOwnProperty(c))l=this[c],delete this[c];else if(n.hasOwnProperty(c)&&typeof this[c]=="number"&&this[c]==l)return;this[c]=l===null&&typeof this[c]=="boolean"?!1:l})},t.observedAttributes=i.filter(([o,a])=>a[0]&15).map(([o,a])=>{const l=a[1]||o;return s.set(l,o),a[0]&512&&e.$attrsToReflect$.push([o,l]),l})}}return t},Hxt=async(t,e,r,i,n)=>{if(!(e.$flags$&32)&&(n=t.constructor,e.$flags$|=32,customElements.whenDefined(r.$tagName$).then(()=>e.$flags$|=128),n.style)){let o=n.style;typeof o!="string"&&(o=o[e.$modeName$=Axt(t)]);const a=YPe(r,e.$modeName$);if(!mF.has(a)){const l=Cw("registerStyles",r.$tagName$);Mxt(a,o,!!(r.$flags$&1)),l()}}e.$ancestorComponent$,(()=>FK(e,!0))()},Wxt=t=>{},qxt=t=>{if(!(qo.$flags$&1)){const e=oM(t),r=e.$cmpMeta$,i=Cw("connectedCallback",r.$tagName$);e.$flags$&1?(iMe(t,e,r.$listeners$),Wxt(e.$lazyInstance$)):(e.$flags$|=1,r.$flags$&12&&Xxt(t),r.$members$&&Object.entries(r.$members$).map(([n,[s]])=>{if(s&31&&t.hasOwnProperty(n)){const o=t[n];delete t[n],t[n]=o}}),Hxt(t,e,r)),i()}},Xxt=t=>{const e=t["s-cr"]=sp.createComment("");e["s-cn"]=!0,t.insertBefore(e,t.firstChild)},Yxt=t=>{if(!(qo.$flags$&1)){const e=oM(t);e.$rmListeners$&&(e.$rmListeners$.map(r=>r()),e.$rmListeners$=void 0)}},Bkt=(t,e)=>{const r={$flags$:e[0],$tagName$:e[1]};r.$members$=e[2],r.$listeners$=e[3],r.$watchers$=t.$watchers$,r.$attrsToReflect$=[];const i=t.prototype.connectedCallback,n=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__registerHost(){Kxt(this,r)},connectedCallback(){qxt(this),i&&i.call(this)},disconnectedCallback(){Yxt(this),n&&n.call(this)},__attachShadow(){this.attachShadow({mode:"open",delegatesFocus:!!(r.$flags$&16)})}}),t.is=r.$tagName$,jxt(t,r)},Vkt=(t,e)=>e,iMe=(t,e,r,i)=>{r&&r.map(([n,s,o])=>{const a=Qxt(t,n),l=Zxt(e,o),c=Jxt(n);qo.ael(a,s,l,c),(e.$rmListeners$=e.$rmListeners$||[]).push(()=>qo.rel(a,s,l,c))})},Zxt=(t,e)=>r=>{try{F2.lazyLoad||t.$hostElement$[e](r)}catch(i){aM(i)}},Qxt=(t,e)=>e&4?sp:e&8?lM:e&16?sp.body:t,Jxt=t=>t2t?{passive:(t&1)!==0,capture:(t&2)!==0}:(t&2)!==0,nMe=new WeakMap,oM=t=>nMe.get(t),Kxt=(t,e)=>{const r={$flags$:0,$hostElement$:t,$cmpMeta$:e,$instanceValues$:new Map};return iMe(t,r,e.$listeners$),nMe.set(t,r)},Hde=(t,e)=>e in t,aM=(t,e)=>(0,console.error)(t,e),mF=new Map,e2t=[],lM=typeof window<"u"?window:{},sp=lM.document||{head:{}},Gkt=lM.HTMLElement||class{},qo={$flags$:0,$resourcesUrl$:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,r,i)=>t.addEventListener(e,r,i),rel:(t,e,r,i)=>t.removeEventListener(e,r,i),ce:(t,e)=>new CustomEvent(t,e)},t2t=(()=>{let t=!1;try{sp.addEventListener("e",null,Object.defineProperty({},"passive",{get(){t=!0}}))}catch{}return t})(),r2t=t=>Promise.resolve(t),i2t=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replaceSync=="function"}catch{}return!1})(),QW=[],sMe=[],oMe=(t,e)=>r=>{t.push(r),ZW||(ZW=!0,e&&qo.$flags$&4?n2t(JW):qo.raf(JW))},Wde=t=>{for(let e=0;e{Wde(QW),Wde(sMe),(ZW=QW.length>0)&&qo.raf(JW)},n2t=t=>r2t().then(t),jkt=oMe(QW,!1),s2t=oMe(sMe,!0);/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const aMe="calcite-mode-auto",lMe="calcite-mode-dark",o2t="calcite-mode-light",Hkt={autoMode:aMe,darkMode:lMe,lightMode:o2t,rtl:"calcite--rtl",calciteAnimate:"calcite-animate",calciteAnimateIn:"calcite-animate__in",calciteAnimateInUp:"calcite-animate__in-up",calciteAnimateInDown:"calcite-animate__in-down",calciteAnimateInRight:"calcite-animate__in-right",calciteAnimateInLeft:"calcite-animate__in-left",calciteAnimateInScale:"calcite-animate__in-scale"};/*! +* tabbable 6.2.0 +* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE +*/var cMe=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],gF=cMe.join(","),uMe=typeof Element>"u",Aw=uMe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,yF=!uMe&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t==null?void 0:t.ownerDocument},_F=function t(e,r){var i;r===void 0&&(r=!0);var n=e==null||(i=e.getAttribute)===null||i===void 0?void 0:i.call(e,"inert"),s=n===""||n==="true",o=s||r&&e&&t(e.parentNode);return o},a2t=function(e){var r,i=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"contenteditable");return i===""||i==="true"},hMe=function(e,r,i){if(_F(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(gF));return r&&Aw.call(e,gF)&&n.unshift(e),n=n.filter(i),n},dMe=function t(e,r,i){for(var n=[],s=Array.from(e);s.length;){var o=s.shift();if(!_F(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,c=t(l,!0,i);i.flatten?n.push.apply(n,c):n.push({scopeParent:o,candidates:c})}else{var u=Aw.call(o,gF);u&&i.filter(o)&&(r||!e.includes(o))&&n.push(o);var d=o.shadowRoot||typeof i.getShadowRoot=="function"&&i.getShadowRoot(o),p=!_F(d,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(o));if(d&&p){var m=t(d===!0?o.children:d.children,!0,i);i.flatten?n.push.apply(n,m):n.push({scopeParent:o,candidates:m})}else s.unshift.apply(s,o.children)}}return n},pMe=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},fMe=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||a2t(e))&&!pMe(e)?0:e.tabIndex},l2t=function(e,r){var i=fMe(e);return i<0&&r&&!pMe(e)?0:i},c2t=function(e,r){return e.tabIndex===r.tabIndex?e.documentOrder-r.documentOrder:e.tabIndex-r.tabIndex},mMe=function(e){return e.tagName==="INPUT"},u2t=function(e){return mMe(e)&&e.type==="hidden"},h2t=function(e){var r=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(i){return i.tagName==="SUMMARY"});return r},d2t=function(e,r){for(var i=0;isummary:first-of-type"),o=s?e.parentElement:e;if(Aw.call(o,"details:not([open]) *"))return!0;if(!i||i==="full"||i==="legacy-full"){if(typeof n=="function"){for(var a=e;e;){var l=e.parentElement,c=yF(e);if(l&&!l.shadowRoot&&n(l)===!0)return qde(e);e.assignedSlot?e=e.assignedSlot:!l&&c!==e.ownerDocument?e=c.host:e=l}e=a}if(g2t(e))return!e.getClientRects().length;if(i!=="legacy-full")return!0}else if(i==="non-zero-area")return qde(e);return!1},_2t=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var r=e.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var i=0;i=0)},b2t=function t(e){var r=[],i=[];return e.forEach(function(n,s){var o=!!n.scopeParent,a=o?n.scopeParent:n,l=l2t(a,o),c=o?t(n.candidates):a;l===0?o?r.push.apply(r,c):r.push(a):i.push({documentOrder:s,tabIndex:l,item:n,isScope:o,content:c})}),i.sort(c2t).reduce(function(n,s){return s.isScope?n.push.apply(n,s.content):n.push(s.content),n},[]).concat(r)},w2t=function(e,r){r=r||{};var i;return r.getShadowRoot?i=dMe([e],r.includeContainer,{filter:KW.bind(null,r),flatten:!1,getShadowRoot:r.getShadowRoot,shadowRootFilter:v2t}):i=hMe(e,r.includeContainer,KW.bind(null,r)),b2t(i)},Wkt=function(e,r){r=r||{};var i;return r.getShadowRoot?i=dMe([e],r.includeContainer,{filter:vF.bind(null,r),flatten:!0,getShadowRoot:r.getShadowRoot}):i=hMe(e,r.includeContainer,vF.bind(null,r)),i},qkt=function(e,r){if(r=r||{},!e)throw new Error("No node provided");return Aw.call(e,gF)===!1?!1:KW(r,e)},x2t=cMe.concat("iframe").join(","),Xkt=function(e,r){if(r=r||{},!e)throw new Error("No node provided");return Aw.call(e,x2t)===!1?!1:vF(r,e)};const T2t={getShadowRoot:!0};function Ykt(t){const e="dir",r=`[${e}]`,i=S2t(t,r);return i?i.getAttribute(e):"ltr"}function UK(t){return t.getRootNode()}function Zkt(t){const e=UK(t);return"host"in e?e:null}function gMe(t){return t.host||null}function Qkt(t,{selector:e,id:r}){function i(n){if(!n)return null;n.assignedSlot&&(n=n.assignedSlot);const s=UK(n),o=r?"getElementById"in s?s.getElementById(r):null:e?s.querySelector(e):null,a=gMe(s);return o||(a?i(a):null)}return i(t)}function S2t(t,e){function r(i){return i?i.closest(e)||r(gMe(UK(i))):null}return r(t)}function E2t(t,e){return yMe(t,e)}function yMe(t,e){if(!t)return;const r=e(t);if(r!==void 0)return r;const{parentNode:i}=t;return yMe(i instanceof ShadowRoot?i.host:i,e)}function Jkt(t,e){return!!E2t(e,r=>r===t?!0:void 0)}function C2t(t){return typeof(t==null?void 0:t.setFocus)=="function"}async function Kkt(t){if(t)return C2t(t)?t.setFocus():t.focus()}function e9t(t){t&&(w2t(t,T2t)[0]||t).focus()}const JR=":not([slot])";function t9t(t,e,r){e&&!Array.isArray(e)&&typeof e!="string"&&(r=e,e=null);const i=e?Array.isArray(e)?e.map(n=>`[slot="${n}"]`).join(","):`[slot="${e}"]`:JR;return r!=null&&r.all?A2t(t,i,r):O2t(t,i,r)}function _Me(t,e){return t?Array.from(t.children||[]).filter(r=>r==null?void 0:r.matches(e)):[]}function A2t(t,e,r){let i=e===JR?_Me(t,JR):Array.from(t.querySelectorAll(e));i=r&&r.direct===!1?i:i.filter(s=>s.parentElement===t),i=r!=null&&r.matches?i.filter(s=>s==null?void 0:s.matches(r.matches)):i;const n=r==null?void 0:r.selector;return n?i.map(s=>Array.from(s.querySelectorAll(n))).reduce((s,o)=>[...s,...o],[]).filter(s=>!!s):i}function O2t(t,e,r){let i=e===JR?_Me(t,JR)[0]||null:t.querySelector(e);i=r&&r.direct===!1||(i==null?void 0:i.parentElement)===t?i:null,i=r!=null&&r.matches?i!=null&&i.matches(r.matches)?i:null:i;const n=r==null?void 0:r.selector;return n?i==null?void 0:i.querySelector(n):i}function r9t(t,e,r){if(typeof e=="string"&&e!=="")return e;if(e==="")return t[r]}function i9t(t){return(!!t).toString()}function n9t(t){return $2t(t)||P2t(t)}function R2t(t){return M2t(t).filter(e=>e.nodeType===Node.TEXT_NODE).map(e=>e.textContent).join("").trim()}function P2t(t){return!!R2t(t)}function M2t(t){return t.target.assignedNodes({flatten:!0})}function $2t(t){return!!I2t(t).length}function I2t(t){return t.target.assignedElements({flatten:!0})}function s9t(t){return!!(t.isPrimary&&t.button===0)}/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */function Xde(){const{classList:t}=document.body,e=window.matchMedia("(prefers-color-scheme: dark)").matches,r=()=>t.contains(lMe)||t.contains(aMe)&&e?"dark":"light",i=o=>document.body.dispatchEvent(new CustomEvent("calciteModeChange",{bubbles:!0,detail:{mode:o}})),n=o=>{s!==o&&i(o),s=o};let s=r();i(s),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",o=>n(o.matches?"dark":"light")),new MutationObserver(()=>n(r())).observe(document.body,{attributes:!0,attributeFilter:["class"]})}function L2t(){typeof window<"u"&&typeof location<"u"&&typeof document<"u"&&window.location===location&&window.document===document&&(document.readyState==="interactive"?Xde():document.addEventListener("DOMContentLoaded",()=>Xde(),{once:!0}))}const D2t=L2t;D2t();let vMe;function N2t(){try{yxt(".")}catch{_xt(iu(Ir(vMe)))}}function o9t(t){var r;const e=[];for(const i of Object.keys(t))customElements.get(`calcite-${i}`)||e.push((r=t[i])==null?void 0:r.call(t));return Promise.all(e)}vMe="components/assets";const bMe=Symbol("widget"),F2t=Symbol("widget-test-data"),U2t=[],k2t={},bF=new WeakMap;function wMe(t,e){let r=e.children;if(r&&r.length)for(let n=0;nxMe(t)))}function B2t(t,e,r,{widgetProperties:i}){var s;const n=bF.get(t);n&&(n.set(i),(s=n.afterUpdate)==null||s.call(n,n,t))}function xMe(t){var r;const e=bF.get(t);e&&((r=e.afterRemoved)==null||r.call(e,e,t),e.destroy(),bF.delete(t))}function kK(t){return typeof t=="function"&&t[bMe]}const Yde=new Set;function V2t(t){Yde.add(t),t.finally(()=>Yde.delete(t))}var TMe;const G2t="esri.widgets.Widget";let j2t=0;const H2t={widgetIcon:"esri-icon-checkbox-unchecked"};function SMe(t,e){for(const r in e)t[r]!=null&&(typeof t[r]=="object"&&typeof e[r]=="object"?SMe(t[r],e==null?void 0:e[r]):t[r]=e[r]);return t}const W2t=gxt({postProcessProjectionOptions(t){const e=t.eventHandlerInterceptor,r=/capture$/i;t.eventHandlerInterceptor=(i,n,s,o)=>{const a=e==null?void 0:e(i,n,s,o),l=r.test(i);if(!((i=i.replace(r,"")).toLowerCase()in s)||l){const c=i[2].toLowerCase()+i.slice(3),u=m=>a==null?void 0:a.call(s,m);s.addEventListener(c,u,l);const d=()=>s.removeEventListener(c,u,l),p=o.afterRemoved;o.afterRemoved=m=>{p==null||p(m),d()}}return a}},handleInterceptedEvent(t,e,r,i){const{eventPhase:n,type:s}=i,o=n===Event.CAPTURING_PHASE;let a=`on${s}${o?"capture":""}`;const l=e.properties;(l&&a in l||(a=`on${s[0].toUpperCase()}${s.slice(1)}${o?"Capture":""}`,l&&a in l))&&(Kbe(),t.scheduleRender(),l[a].call(l.bind||r,i))}});let pB=!1,Fs=class extends t6(Bn.EventedAccessor){constructor(e,r){super(e,r),this._attached=!1,this._internalHandles=new Vi,this._projector=W2t,this._readyForTrueRender=!1,this.iconClass=H2t.widgetIcon,this.icon=null,this.key=this,this._loadLocale=Age(async()=>{if(this._messageBundleProps&&this._messageBundleProps.length){const o=await o1(this._messageBundleProps.map(async({bundlePath:a,propertyName:l})=>{if(this.destroyed)return;let c=await X0e(a);this.uiStrings&&Object.keys(this.uiStrings)&&(c=SMe(ye(c),this.uiStrings)),this[l]=c}));if(this.destroyed)return;for(const a of o)a.error&&J.getLogger(this).error("widget-intl:locale-error",this.declaredClass,a.error)}await this.loadLocale()}),N2t();const i="esri-widget-uid-"+HPe(),n=this.render.bind(this);this._trackingTarget=new JF(()=>this.scheduleRender());const s=()=>{var u;if(!this._readyForTrueRender||this.destroyed)return null;const o=n();let{properties:a}=o;a||(o.properties=a={});const{key:l}=a;l||(a.key=i),this.visible?a.styles||(a.styles={}):(a.class="",a.styles={display:"none"}),a.styles.display||(a.styles.display="");let c=0;return(u=o.children)==null||u.forEach(d=>{if(kK(d.vnodeSelector))return;let{properties:p}=d;p||(d.properties=p={}),p.key||(p.key=`${this.id}--${c++}`)}),wMe(this,o)};this.render=()=>{if(pB)return s();let o=pGe(this)??null;if(o)return o;this._trackingTarget.clear(),pB=!0;try{o=Lg(this._trackingTarget,s)}catch(a){throw console.error(a),a}finally{pB=!1}return o&&fGe(this,o),o},this.addResolvingPromise(this._resourcesFetch=this.beforeFirstRender().then(()=>{this._readyForTrueRender=!0,this._postInitialize()})),V2t(this._resourcesFetch)}normalizeCtorArgs(e,r){const i={...e};return r&&(i.container=r),i}postInitialize(){}beforeFirstRender(){return Promise.all([this.loadDependencies(),this._loadLocale()]).then(()=>{}).catch(_te)}async loadDependencies(){}async loadLocale(){}destroy(){this.destroyed||(Me(this._trackingTarget),Me(this.viewModel),this._detach(this.container),this._set("container",null),this._internalHandles.destroy(),this._emitter.clear(),this.render=()=>null,this._projector=null,Ek(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return R6(e)}get domNode(){return this.container}set domNode(e){this.container=e}get id(){return this._get("id")||this.get("container.id")||Date.now().toString(16)+"-widget-"+j2t++}set id(e){e&&this._set("id",e)}get label(){return this.declaredClass.split(".").pop()}set label(e){this._overrideIfSome("label",e)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(e){this._set("visible",e)}get[(TMe=bMe,F2t)](){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(Ek(this),this._projector.scheduleRender())}classes(...e){return vGe.apply(this,e)}renderNow(){Ek(this),this._projector.renderNow()}_postInitialize(){var r;if(this.destroyed)return;this.scheduleRender(),(r=this._delegatedEventNames)!=null&&r.length&&this._internalHandles.add(ue(()=>this.viewModel,(i,n)=>{n&&this._internalHandles.remove("delegated-events"),i&&ZF(i)&&this._internalHandles.add(this._delegatedEventNames.map(s=>dP(i,s,o=>{this.emit(s,o)})),"delegated-events")},Pr)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(_te),this.scheduleRender()};this._internalHandles.add([j0e(e),ue(()=>this.uiStrings,e),Dh(()=>this.container,i=>{this.destroyed||this._attach(i)},{initial:!0,once:!0})])}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){var r;this._attached&&(this._projector.detach(this.render),this._attached=!1),(r=e==null?void 0:e.parentNode)==null||r.removeChild(e)}};Fs[TMe]=!0,h([f()],Fs.prototype,"_readyForTrueRender",void 0),h([f({value:null})],Fs.prototype,"container",null),h([_i("container")],Fs.prototype,"castContainer",null),h([f()],Fs.prototype,"iconClass",void 0),h([f()],Fs.prototype,"icon",void 0),h([f()],Fs.prototype,"id",null),h([f()],Fs.prototype,"label",null),h([f()],Fs.prototype,"renderable",null),h([f()],Fs.prototype,"uiStrings",void 0),h([f()],Fs.prototype,"viewModel",void 0),h([f({value:!0})],Fs.prototype,"visible",null),h([f()],Fs.prototype,"key",void 0),h([f()],Fs.prototype,"children",void 0),h([f()],Fs.prototype,"afterCreate",void 0),h([f()],Fs.prototype,"afterUpdate",void 0),h([f()],Fs.prototype,"afterRemoved",void 0),Fs=h([N(G2t)],Fs);const cM=Fs;function Zde(t,e){return t&&"copyright"in t&&(!e||typeof t.originOf=="function"&&t.originOf("copyright")==="user")}function q2t(t,e){return t.length!==e.length||t.some((r,i)=>r.text!==e[i].text)}function yL(t,e,r){!r||!e||t.find(i=>i.layerView===e&&i.text===r)||t.push({text:r,layerView:e})}function X2t(t){return t.type==="bing-maps"}const Y0=[];let z2=class extends pR{constructor(e){super(e),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.handles.remove("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new ir,this.view=null,this._allLayerViewsChange=r=>{this.handles.remove("suspension");const i=this.get("view.allLayerViews");i&&this.handles.add(i.map(n=>ue(()=>{var s;return[n.suspended,(s=n.layer)==null?void 0:s.attributionVisible]},()=>this._updateAttributionItems())),"suspension"),r&&r.removed&&r.removed.forEach(n=>{this._pendingAttributions.delete(n),this._fetchedAttributionData.delete(n)}),this._updateAttributionItems()},this.handles.add([Ol(()=>{var r;return(r=this.view)==null?void 0:r.allLayerViews},"change",r=>this._allLayerViewsChange(r),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),Dh(()=>{var r;return((r=this.view)==null?void 0:r.stationary)===!0},()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){return this.get("view.ready")?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const e=this.view,r=e==null?void 0:e.allLayerViews;Y0.length=0,e&&r?(r.forEach(i=>{var o;if(i.suspended||!((o=i.layer)!=null&&o.attributionVisible))return;const n=i.layer;if(Zde(n,"user"))return void yL(Y0,i,n.copyright);if(n.hasAttributionData){if(this._fetchedAttributionData.has(i)){const a=this._fetchedAttributionData.get(i);return void(a?yL(Y0,i,this._getDynamicAttribution(a,e,n)):Zde(n)&&yL(Y0,i,n.copyright))}return void this._fetchAttributionData(i)}const s=n.get("portalItem.accessInformation");yL(Y0,i,s||n.copyright)}),q2t(this.items,Y0)&&(this.items.removeAll(),this.items.addMany(Y0)),Y0.length=0,this.notifyChange("state")):this._clear()}async _fetchAttributionData(e){if(this._pendingAttributions.has(e))return;this._pendingAttributions.add(e);const r=await Ng(e.layer.fetchAttributionData());if(this._pendingAttributions.has(e)){const i=r.ok?this._createContributionIndex(r.value,X2t(e.layer)):null;this._pendingAttributions.delete(e),this._fetchedAttributionData.set(e,i)}this._updateAttributionItems()}_createContributionIndex(e,r){const i=e.contributors,n={};if(!i)return n;for(let s=0;s{const p=d.id,m=!c.has(p)&&l&&d.extent&&eY(d.extent,l);return m&&c.add(p),m}).sort((d,p)=>p.score-d.score||d.objectId-p.objectId).map(d=>d.attribution).join(", "):""}};h([f({readOnly:!0,type:ir})],z2.prototype,"items",void 0),h([f({readOnly:!0})],z2.prototype,"state",null),h([f()],z2.prototype,"view",void 0),z2=h([N("esri.widgets.Attribution.AttributionViewModel")],z2);const EMe=z2;function cU(){return function(t,e){if(!t[e])throw new TypeError(`Cannot auto bind undefined function '${String(e)}'`);return{value:Z2t(t[e])}}}function Y2t(t){const e=t==null?void 0:t.type;return t instanceof KeyboardEvent||e==="keyup"||e==="keydown"||e==="keypress"}function Z2t(t){return function(e,...r){Y2t(e)?SGe(e.key)&&(e.preventDefault(),e.stopPropagation(),e.target.click()):t.call(this,e,...r)}}function uU(t){return(e,r)=>{e.hasOwnProperty("_messageBundleProps")||(e._messageBundleProps=e._messageBundleProps?e._messageBundleProps.slice():[]),e._messageBundleProps.push({bundlePath:t,propertyName:r})}}var Q2t=function(t){return{vnodeSelector:"",properties:void 0,children:void 0,text:t.toString(),domNode:null}},CMe=function(t,e){for(var r=0,i=t.length;ri.forEach(({target:n})=>this._checkSourceTextOverflow(n))),this.iconClass=Z0.widgetIcon,this.icon=null,this.itemDelimiter=" | ",this.messages=null,this.viewModel=new EMe}initialize(){this.addHandles(Ol(()=>{var e;return(e=this.viewModel)==null?void 0:e.items},"change",()=>this.scheduleRender()))}destroy(){var e;(e=this._resizeObserver)==null||e.disconnect()}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((e,r)=>(e.includes(r.text)||e.push(r.text),e),[]).join(this.itemDelimiter)}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e={[Z0.open]:this._isOpen};return qa("div",{bind:this,class:this.classes(Z0.base,e),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this.renderSourcesNode(),this.renderPoweredBy())}renderPoweredBy(){return qa("div",{class:Z0.poweredBy},"Powered by"," ",qa("a",{class:Z0.link,href:"http://www.esri.com/",target:"_blank",rel:"noreferrer"},"Esri"))}renderSourcesNode(){const e=this._isOpen,r=this._isInteractive,i=r?"0":"",{attributionText:n}=this,s={[Z0.sourcesOpen]:e,[Z0.interactive]:r};return qa("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(Z0.sources,s),innerHTML:n,tabindex:i})}_afterSourcesNodeCreate(e){this._prevSourceNodeHeight=e.clientWidth,this._resizeObserver.observe(e)}_checkSourceTextOverflow(e){let r=!1;const{clientHeight:i,clientWidth:n,scrollWidth:s}=e,o=s>n,a=this._attributionTextOverflowed!==o;if(this._attributionTextOverflowed=o,a&&(r=!0),this._isOpen){const l=i{let e=class extends t{constructor(...r){super(...r),this.goToOverride=null,this.view=null}callGoTo(r){const{view:i}=this;return GF(i),this.goToOverride?this.goToOverride(i,r):i.goTo(r.target,r.options)}};return h([f()],e.prototype,"goToOverride",void 0),h([f()],e.prototype,"view",void 0),e=h([N("esri.widgets.support.GoTo")],e),e},tTt="esri.widgets.CompassViewModel";let Gv=class extends eTt(xe){constructor(e){super(e),this._handles=new Vi,this.orientation={x:0,y:0,z:0},this.view=null,this._updateForCamera=this._updateForCamera.bind(this),this._updateForRotation=this._updateForRotation.bind(this),this._updateRotationWatcher=this._updateRotationWatcher.bind(this)}initialize(){this._handles.add(ue(()=>this.view,this._updateRotationWatcher,Pr))}destroy(){Pi(this._handles),this.view=null}get canShowNorth(){const e=this.get("view.spatialReference");return!(!e||!e.isWebMercator&&!e.isGeographic)}get state(){return this.get("view.ready")?this.canShowNorth?"compass":"rotation":"disabled"}reset(){var r;if(!this.get("view.ready"))return;const e={};((r=this.view)==null?void 0:r.type)==="2d"?e.rotation=0:e.heading=0,this.callGoTo({target:e})}_updateForRotation(e){e!=null&&(this.orientation={z:e})}_updateForCamera(e){if(!e)return;const r=-e.heading;this.orientation={x:0,y:0,z:r}}_updateRotationWatcher(e){this._handles.removeAll(),e&&this._handles.add(e.type==="2d"?ue(()=>e==null?void 0:e.rotation,this._updateForRotation,Pr):ue(()=>e==null?void 0:e.camera,this._updateForCamera,Pr))}};h([f({readOnly:!0})],Gv.prototype,"canShowNorth",null),h([f()],Gv.prototype,"orientation",void 0),h([f({readOnly:!0})],Gv.prototype,"state",null),h([f()],Gv.prototype,"view",void 0),Gv=h([N(tTt)],Gv);const AMe=Gv,Q0={base:"esri-compass esri-widget--button esri-widget",text:"esri-icon-font-fallback-text",icon:"esri-compass__icon",rotationIcon:"esri-icon-dial",northIcon:"esri-icon-compass",widgetIcon:"esri-icon-locate-circled",interactive:"esri-interactive",disabled:"esri-disabled"};let Sd=class extends cM{constructor(e,r){super(e,r),this.iconClass=Q0.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new AMe}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}reset(){return this.viewModel.reset()}render(){const{orientation:e,state:r}=this.viewModel,i=r==="disabled",n=(r==="rotation"?"rotation":"compass")=="compass",s=i?-1:0,o={[Q0.disabled]:i,[Q0.interactive]:!i},a={[Q0.northIcon]:n,[Q0.rotationIcon]:!n},{messages:l}=this;return qa("div",{bind:this,class:this.classes(Q0.base,o),onclick:this._reset,onkeydown:this._reset,role:"button",tabIndex:s,"aria-label":l.reset,title:l.reset},qa("span",{"aria-hidden":"true",class:this.classes(Q0.icon,a),styles:this._toRotationTransform(e)}),qa("span",{class:Q0.text},l.reset))}_reset(){this.viewModel.reset()}_toRotationTransform(e){return{transform:`rotateZ(${e.z}deg)`}}};h([f()],Sd.prototype,"goToOverride",null),h([f()],Sd.prototype,"iconClass",void 0),h([f()],Sd.prototype,"icon",void 0),h([f()],Sd.prototype,"label",null),h([f(),uU("esri/widgets/Compass/t9n/Compass")],Sd.prototype,"messages",void 0),h([f()],Sd.prototype,"view",null),h([f({type:AMe})],Sd.prototype,"viewModel",void 0),h([cU()],Sd.prototype,"_reset",null),Sd=h([N("esri.widgets.Compass")],Sd);const rTt=Sd,r2="esri-navigation-toggle",Uu={base:`${r2} esri-widget`,button:`${r2}__button esri-widget--button`,activeButton:`${r2}__button--active`,panButton:`${r2}__button--pan`,rotateButton:`${r2}__button--rotate`,isLayoutHorizontal:`${r2}--horizontal`,rotationIcon:"esri-icon-rotate",panIcon:"esri-icon-pan",widgetIcon:"esri-icon-pan2",disabled:"esri-disabled"};let B2=class extends xe{constructor(e){super(e),this.navigationMode="pan",this.view=null}initialize(){this.own(Dh(()=>{var e;return(e=this.view)==null?void 0:e.inputManager},()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){var e;return this.get("view.ready")&&((e=this.view)==null?void 0:e.type)==="3d"?"ready":"disabled"}toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate",this._setNavigationMode())}_setNavigationMode(){this.get("view.inputManager").primaryDragAction=this.navigationMode==="pan"?"pan":"rotate"}};h([f({readOnly:!0})],B2.prototype,"state",null),h([f()],B2.prototype,"navigationMode",void 0),h([f()],B2.prototype,"view",void 0),B2=h([N("esri.widgets.NavigationToggleViewModel")],B2);const OMe=B2;let Ed=class extends cM{constructor(e,r){super(e,r),this.iconClass=Uu.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new OMe}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}set layout(e){e!=="horizontal"&&(e="vertical"),this._set("layout",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}toggle(){return this.viewModel.toggle()}render(){const e=this.get("viewModel.state")==="disabled",r=this.get("viewModel.navigationMode")==="pan",i={[Uu.disabled]:e,[Uu.isLayoutHorizontal]:this.layout==="horizontal"},n={[Uu.activeButton]:r},s={[Uu.activeButton]:!r},o=e?-1:0,a=this.messages.toggle;return qa("div",{bind:this,class:this.classes(Uu.base,i),onclick:this._toggle,onkeydown:this._toggle,tabIndex:o,"aria-label":a,title:a},qa("div",{class:this.classes(Uu.button,Uu.panButton,n)},qa("span",{class:Uu.panIcon})),qa("div",{class:this.classes(Uu.button,Uu.rotateButton,s)},qa("span",{class:Uu.rotationIcon})))}_toggle(){this.toggle()}};h([f()],Ed.prototype,"iconClass",void 0),h([f()],Ed.prototype,"icon",void 0),h([f()],Ed.prototype,"label",null),h([f({value:"vertical"})],Ed.prototype,"layout",null),h([f(),uU("esri/widgets/NavigationToggle/t9n/NavigationToggle")],Ed.prototype,"messages",void 0),h([f()],Ed.prototype,"view",null),h([f({type:OMe})],Ed.prototype,"viewModel",void 0),h([cU()],Ed.prototype,"_toggle",null),Ed=h([N("esri.widgets.NavigationToggle")],Ed);const iTt=Ed,QC={button:"esri-widget--button esri-widget",disabled:"esri-disabled",interactive:"esri-interactive",iconText:"esri-icon-font-fallback-text",icon:"esri-icon"};let Xm=class extends cM{constructor(){super(...arguments),this.enabled=!0,this.iconClass=null,this.icon=null,this.title=""}render(){const e=this.enabled?0:-1,r={[QC.disabled]:!this.enabled,[QC.interactive]:this.enabled};return qa("div",{bind:this,class:this.classes(QC.button,r),onclick:this._triggerAction,onkeydown:this._triggerAction,role:"button",tabIndex:e,title:this.title},qa("span",{"aria-hidden":"true",role:"presentation",class:this.classes(QC.icon,this.iconClass??"")}),qa("span",{class:QC.iconText},this.title))}_triggerAction(){this.action.call(this)}};h([f()],Xm.prototype,"action",void 0),h([f()],Xm.prototype,"enabled",void 0),h([f()],Xm.prototype,"iconClass",void 0),h([f()],Xm.prototype,"icon",void 0),h([f()],Xm.prototype,"title",void 0),h([cU()],Xm.prototype,"_triggerAction",null),Xm=h([N("esri.widgets.IconButton")],Xm);const Qde=Xm;let V2=class extends xe{get canZoomIn(){if(!this.get("view.ready"))return!1;const e=this.get("view.animation.target.scale")||this.get("view.scale"),r=this.get("view.constraints.effectiveMaxScale");return r===0||e>r}get canZoomOut(){if(!this.get("view.ready"))return!1;const e=this.get("view.animation.target.scale")||this.get("view.scale"),r=this.get("view.constraints.effectiveMinScale");return r===0||e{this.components.forEach(i=>{const n=this._find(i),s=n==null?void 0:n.widget;aTt(s)&&(s.view=r)})},this._componentsWatcher=(r,i)=>{this._removeComponents(i),this._addComponents(r),this._adjustPadding(r)}}initialize(){this.addHandles([ue(()=>this.components,this._componentsWatcher,Pr),ue(()=>this.view,this._updateViewAwareWidgets,Pr)])}_add(e,r,i,n,s){let o=e;if(typeof e=="string"&&this._defaultPositionLookup[e]){if(this._find(e))return;o=this._createComponent(e)}super._add(o,r,i,n,s)}_removeComponents(e){e.forEach(r=>{const i=this._find(r);i&&(this.remove(i),i.destroy())})}_adjustPadding(e){if(!e.includes("attribution")&&!this._isOverridden("padding")){const{top:r}=this.padding;this.padding=r}}_addComponents(e){this.constructed&&e.forEach(r=>this.add(this._createComponent(r),this._defaultPositionLookup[r]))}_createComponent(e){const r=this._createWidget(e);return new pN({id:e,node:r})}_createWidget(e){const{view:r}=this;switch(e){case"attribution":return new K2t({view:r});case"compass":return new rTt({view:r});case"navigation-toggle":return new iTt({view:r});case"zoom":return new oTt({view:r})}}};h([f()],fN.prototype,"components",void 0),fN=h([N("esri.views.ui.DefaultUI")],fN);const PMe=fN;let mN=class extends PMe{constructor(e){super(e),this.components=["attribution","zoom","navigation-toggle","compass"]}};h([f()],mN.prototype,"components",void 0),mN=h([N("esri.views.ui.3d.DefaultUI3D")],mN);const MMe=mN;let We=class extends b7e(pje(kGe(Zje))){constructor(t){super(t),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._defaults={},this._externallySet={environment:!1},this._createGraphicsViewController=null,this._resolveWhenReady=[],this._propertiesPool=new jg({slicePlane:Ebe},this),this._resourceController=zft(this),this._defaultToMapOptions={include:new Set},this._defaultHitTestOptions={exclude:new Set},this.deconflictor=new UH({view:this}),this.labeler=new Dv({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new $S,this.basemapTerrain=null,this.elevationProvider=null,this.canvas=null,this.constraints=new rb,this.environmentManager=new yd,this.floors=new ir,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Kje({view:this}),this.groundView=null,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new rft,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new MMe,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.highlightOptions=new fW,this.voxelWasm=null,this.voxelWasmPromise=null,rBe(),t&&t.environment||(this._defaults.environment=new T2,this.environment=this._defaults.environment);const e=(r=null)=>{r!=null&&r.type===Yr.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach(async i=>{try{await i.when()}catch{}this._updatingChanged()}))};this.addHandles([Ol(()=>{var r;return(r=this.map)==null?void 0:r.allLayers},"after-changes",r=>e(r),{onListenerAdd:()=>e(),onListenerRemove:()=>e(),sync:!0}),this.allLayerViews.on("after-changes",r=>this._updateUpdatingMonitors(r)),ue(()=>this.map,r=>{r&&"load"in r&&r.load&&r.load().catch(()=>{})})]),this.inputManager=new net({view:this}),this.stateManager=new gs({view:this})}initialize(){this.groundView=new eje({view:this}),this._updateUpdatingMonitors();const t=()=>this._updateDefaultToMapOptions();this.addHandles(Ol(()=>{var e;return(e=this.map)==null?void 0:e.allLayers},"after-changes",t,{onListenerAdd:t,onListenerRemove:t})),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},Pr),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},Pr),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>tNe(e>0?1e3/Math.ceil(e):0),Pr),this.updatingHandles.add(()=>{var e;return(e=this.map)==null?void 0:e.ground},t,An),this.updatingHandles.add(()=>{var e,r;return(r=(e=this.map)==null?void 0:e.ground)==null?void 0:r.opacity},()=>this._updateDefaultHitTestOptions(),An),this.addHandles(ue(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),Br))}destroy(){var t;this.destroyed||(this.updatingHandles.removeAll(),this.removeAllHandles(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=Me(this.sharedSymbolResources),this._set("labeler",Me(this.labeler)),this._set("deconflictor",Me(this.deconflictor)),this._resourceController=Me(this._resourceController),this._set("stateManager",Me(this.stateManager)),this._set("inputManager",Me(this.inputManager)),this.state.destroy(),this._propertiesPool.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",Me(this.environmentManager)),this.groundView=Me(this.groundView),this._exitBasemapTerrain(),(t=this._stage)==null||t.destroy(),this.removeAllHandles(),this.updatingHandles.removeAll(),this.handles.removeAll())}get renderSpatialReference(){return this.renderCoordsHelper&&this.renderCoordsHelper.spatialReference}get basemapSpatialReference(){var t;return(t=this.basemapTerrain)==null?void 0:t.spatialReference}get animation(){var t;return(t=this.state)==null?void 0:t.animation}get camera(){var t;return(t=this.stateManager)==null?void 0:t.camera}set camera(t){this.stateManager&&(this.stateManager.camera=t)}get contentCamera(){var t;return(t=this.stateManager)==null?void 0:t.contentCamera}set contentCamera(t){this.stateManager&&(this.stateManager.contentCamera=t)}installContentCameraReset(t={sticky:!1}){return this.stateManager.installContentCameraReset(t)}get center(){var t;return(t=this.stateManager)==null?void 0:t.center}set center(t){this.stateManager&&(this.stateManager.center=t)}get clippingArea(){var e;if(this.viewingMode==="global")return null;let t=this._userClippingArea||("clippingArea"in this.map?(e=this.map)==null?void 0:e.clippingArea:void 0);return!this._userClippingArea&&!this.get("map.clippingEnabled")||t==null?(this._clippingArea=null,null):t instanceof Dr?this.spatialReference&&(t=_L(t,this.spatialReference),t==null)?(J.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),t.intersection(this._groundAndLayersExtent)==null&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(J.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(t){this.ready&&this.viewingMode==="global"&&t!=null?J.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=t}get renderDataExtent(){if(this.state.viewingMode===$e.Global)return null;const t=this.renderSpatialReference,e=this.dataExtent;return e==null||t==null||e.spatialReference.equals(t)?e:_L(e,t)}get dataExtent(){let t=this._groundAndLayersExtent;const e=this.spatialReference||St.WGS84,r=_L(this.clippingArea,e);r!=null&&(t=t!=null?t.intersection(r):r);const i=this._get("dataExtent");return t!=null&&t.equals(i)?i:t}get _groundAndLayersExtent(){const t=this.spatialReference||St.WGS84;let e;const r=s=>{const o=_L(s,t);o!=null&&(e!=null?e.union(o):e=o.clone())},i=this.basemapTerrain;if(i!=null&&i.spatialReference){const s=i.groundExtent;r(new Dr({xmin:s[0],ymin:s[1],zmin:0,xmax:s[2],ymax:s[3],zmax:0,spatialReference:i.spatialReference}))}if(this.map){const s=o=>{o.fullExtent==null||o.type==="graphics"&&o.internal||r(o.fullExtent)};this.map.allLayers.forEach(o=>s(o))}if(e==null)return null;e.hasZ?(e.zmin=Math.min(0,e.zmin??0),e.zmax=Math.max(0,e.zmax??0)):(e.zmin=0,e.zmax=0);const n=this._get("_groundAndLayersExtent");return e.equals(n)?n:e}set environment(t){t!==this._defaults.environment&&(this._externallySet.environment=!0),this._set("environment",t)}castEnvironment(t){return t?t instanceof T2?t:t instanceof Gwe?this.environment!=null?this.environment.cloneWithWebsceneEnvironment(t):T2.fromWebsceneEnvironment(t):Qa(T2,t):new T2}get extent(){var t;return(t=this.stateManager)==null?void 0:t.extent}set extent(t){this.stateManager&&(this.stateManager.extent=t)}get screenCenter(){var t;return(t=this.stateManager)==null?void 0:t.screenCenter}get frustum(){var t;return(t=this.stateManager)==null?void 0:t.frustum}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get _defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){var t;return this.navigating||(((t=this.toolViewManager)==null?void 0:t.interacting)??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state==null||this.state.stationary)}get navigating(){var t;return((t=this.state)==null?void 0:t.navigating)??!1}get padding(){var t;return(t=this.stateManager)==null?void 0:t.padding}set padding(t){this.stateManager&&(this.stateManager.padding=t)}set qualityProfile(t){eN.isValidProfile(t)&&(eN.apply(t,this.qualitySettings),this._set("qualityProfile",t))}get qualityProfile(){return this._get("qualityProfile")||eN.getDefaultProfile()}set slicePlane(t){if(this._stage!=null&&this._stage.renderer.setParameters({slicePlane:t}),t==null)return void this._set("slicePlane",null);const e=this._propertiesPool.get("slicePlane");zw(t,e),this._set("slicePlane",e)}get typeSpecificPreconditionsReady(){return!!this.viewingMode}get resolution(){return this.spatialReference!=null?g7e(this.scale,this.spatialReference):0}get scale(){var t;return(t=this.stateManager)==null?void 0:t.scale}set scale(t){this.stateManager&&(this.stateManager.scale=t)}get heightModelInfo(){const t=this.getDefaultHeightModelInfo();return t!=null?CP.deriveUnitFromSR(t,this.spatialReference):null}get updating(){var n,s,o;if(this.destroyed)return!1;let t=0,e=this.layerViewManager.updating,r=e?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(a=>{if(a.isFulfilled()){if(a.updating){if(e=!0,a.suspended||GR(a))return;++r,t+=a.updatingProgress}}else++r});for(const a of this._updatingObjects)a!=null&&a.updating&&(r+=.1,t+=.5*.1);for(const a of this._updatingObjectsWithProgress)a!=null&&a.updating&&(++r,t+=a.updatingProgress);const i=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(e=!!(e||r>0||this.updatingHandles.updating||!this.ready||!this.stationary||i||this._createGraphicsViewController||(n=this.inputManager)!=null&&n.updating||(o=(s=this.map)==null?void 0:s.allLayers)!=null&&o.some(a=>!a.isFulfilled())),e?(this._numUpdating=Math.max(r,this._numUpdating),t+=this._numUpdating-r):this._numUpdating=0,this._numUpdating>0?t/=this._numUpdating:t=e?0:1,this._get("updatingProgress")!==t){const a=performance.now();if(t<1){const l=Math.min((a-this._lastUpdateTime)/2e3,1);t=this.updatingProgress*(1-l)+t*l}this._set("updatingProgress",t),this._lastUpdateTime=e&&t<1?a:0}return e}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this._stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){var r;const t=this._predeterminedViewingMode;if(t!=null)return Pk(t);const e=this.spatialReference;return e?((r=this.defaultsFromMap)==null?void 0:r.viewingMode)!=null&&e.equals(this.defaultsFromMap.spatialReference)?Pk(this.defaultsFromMap.viewingMode):SH(e,$e.Global)?"global":"local":"global"}set viewingMode(t){this.ready?J.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",t)}get viewpoint(){var t;return(t=this.stateManager)==null?void 0:t.viewpoint}set viewpoint(t){this.stateManager&&(this.stateManager.viewpoint=t)}get zoom(){return this.stateManager.zoom}set zoom(t){this.stateManager&&(this.stateManager.zoom=t)}get resourceController(){return this._resourceController}get performanceInfo(){return new dmt(this)}on(t,e,r,i){return this.viewEvents.on(t,e,r,i)||super.on(t,e)}hasEventListener(t){return super.hasEventListener(t)||this.viewEvents.hasHandler(t)}toMap(t,e){if(!this.ready)return J.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const r=e?this.externalToInternalIntersectOptions(e):this._defaultToMapOptions,i=r.graphics!=null&&(r.graphics.include!=null||r.graphics.exclude!=null),n=Yie(t)?Xie(this,t):t,s=wf(n);r.enableDraped=r.include&&!r.include.has(jy)||r.exclude&&r.exclude.has(jy);const o=this.sceneIntersectionHelper,a=zh(this.state.viewingMode);if(a.options.selectionMode=!0,a.options.store=i?To.ALL:To.MIN,o.intersectIntersectorScreen(s,a,r),i){for(const l of a.results.all){const c=YW(l,this);if(c==null)return this._intersectResultToMapPoint(l);if(c.type!=="graphic"||this._testGraphicUidFilter(r.graphics,c.graphic))return this._intersectResultToMapPoint(l)}return null}return this._intersectResultToMapPoint(a.results.min)}toScreen(t){if(!this.ready)return J.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;const e=(t.z==null?Af(this.elevationProvider,t):null)??0;return Bi(t,i2,this.renderSpatialReference,e),this.state.camera.projectToScreen(i2,fB),Lh(fB[0],fB[1])}pixelSizeAt(t){return this.ready?t?(Bi(t,i2,this.renderSpatialReference),this.state.camera.computeScreenPixelSizeAt(i2)):0:(J.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null)}overlayPixelSizeInMapUnits(t){const e=this.basemapTerrain.overlayManager;return e?e.overlayPixelSizeInMapUnits(t):1}hitTest(t,e){if(!this.ready)return J.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const r=Yie(t)?Xie(this,t):t,i=Xi(r.x,r.y),n=e?this.externalToInternalIntersectOptions(e):this._defaultHitTestOptions;n.requiresGroundFeedback=!0,n.enableDraped=!0;const s=zh(this.state.viewingMode);s.options.selectionMode=!0,s.options.store=To.ALL,this.sceneIntersectionHelper.intersectIntersectorScreen(i,s,n);const o=this._intersectResultsToHits(s.results.all,n.graphics),a=s.results.ground,l=Mde(a,this),c=l!=null&&"type"in l&&l.type==="integrated-mesh"?l:null,u={screenPoint:r,results:o,ground:{mapPoint:this._intersectResultToMapPoint(a),distance:bp(a)?a.distanceInRenderSpace:0,layer:c}};return Kr.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(u.intersector=s),Promise.resolve(u)}async popupHitTest(t){const{results:e,ground:r}=await Gwt(this,t);let i=null;return!(e.length===0||Math.abs((e[0].distance??0)-r.distance)<1e-5)||r.layer&&r.layer.type==="integrated-mesh"||(i=r.mapPoint),{results:e,screenPoint:t,mapPoint:i}}goTo(t,e){return this.updatingHandles.addPromise(this.stateManager.goTo(t,e))}async whenAnalysisView(t){if(t.parent==null)throw new Y("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:t});switch(t.parent.type){case"line-of-sight":case"dimension":return(await this.whenLayerView(t.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(t)}}whenLayerView(t){return super.whenLayerView(t)}async takeScreenshot(t){const e=this._completeSettings(t);await this.whenReady();const r=await this._stage.renderView.takeScreenshot(e);return oB(r,e,this._pixelFormat())}async _takeScreenshot(t){const e=this._completeSettings(t);await this.whenReady();const r=await this._stage.renderView.takeScreenshot(e);return aB(r,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(t){const e=this._completeSettings(t);await this.whenReady();const r=await this._stage.renderView.takeScreenshotWithOID(e);return[aB(r[0],this._pixelFormat()),aB(r[1],this._pixelFormat())]}_completeSettings(t){const e=xwt(t,this);return e.pixelRatio/=this.state.pixelRatio,Cwt(e,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this._stage.renderView.getAlpha()}}get test(){return{takeScreenshot:t=>this._takeScreenshot(t),takeScreenshotWithObjectAndLayerId:t=>this._takeScreenshotWithObjectAndLayerId(t)}}async takeScreenshotWithObjectAndLayerId(t){if(!se("enable-feature:objectAndLayerId-rendering"))throw new Error("has enable-feature:objectAndLayerId-rendering must be true");const e=this._completeSettings(t);await this.whenReady();const r=await this._stage.renderView.takeScreenshotWithOID(e),i=oB(r[0],e,this._pixelFormat()),n=this._completeSettings(t);return n.format="png",[i,oB(r[1],n,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){if(this._stage.renderView.objectAndLayerIdRenderHelper==null)throw new Error("has enable-feature:objectAndLayerId-rendering must be true");return this._stage.renderView.objectAndLayerIdRenderHelper.getColorToObjectAndLayerIdMapping()}addUpdatingPromise(t){return this.updatingHandles.addPromise(t)}importLayerView(t){return ine.importLayerView(t)}hasLayerViewModule(t){return ine.hasLayerViewModule(t)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){var t,e,r,i;return this.map&&"initialViewProperties"in this.map&&((e=(t=this.map)==null?void 0:t.initialViewProperties)==null?void 0:e.spatialReference)||((r=this.defaultsFromMap)==null?void 0:r.spatialReference)||((i=this.defaultsFromMap)==null?void 0:i.ready)&&this._initialDefaultSpatialReference||null}async validate(){let t=Kwt(this.type);const e=se("safari");if(e&&e<9&&(t=new Y("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:e})),t!=null)throw J.getLogger(this).warn("#validate()",t.message),t}get _predeterminedViewingMode(){var e;const t=this._isOverridden("viewingMode")?this._get("viewingMode"):(this.map&&"initialViewProperties"in this.map?(e=this.map.initialViewProperties)==null?void 0:e.viewingMode:null)??null;return t!=null?ene(t):null}getSpatialReferenceSupport({spatialReference:t,layer:e}){const r=this._predeterminedViewingMode;if(r!=null)return this._validateSpatialReferenceForViewingMode(t,e,r)?{constraints:this._makeSpatialReferenceConstraints(t,e,r)}:null;const i=this._validateSpatialReferenceForViewingMode(t,e,$e.Local),n=this._validateSpatialReferenceForViewingMode(t,e,$e.Global);return i||n?i&&n?{constraints:this._makeSpatialReferenceConstraints(t,e,null)}:i?{constraints:this._makeSpatialReferenceConstraints(t,e,$e.Local)}:{constraints:this._makeSpatialReferenceConstraints(t,e,$e.Global)}:null}_validateSpatialReferenceForViewingMode(t,e,r){return!!SH(t,r)&&(e==null||!!ere(e)||(!jA(e)||K8(e,t,r)!=null)&&(!Kte(e)||r!==$e.Global))}_makeSpatialReferenceConstraints(t,e,r){if(e==null)return[{spatialReference:t,viewingMode:r}];const i=t.isWebMercator,n=t.isWGS84;return ere(e)&&(i||n)?!n||r===$e.Local||hK(e.tileInfo,e.fullExtent,t,$e.Global)===null?[{spatialReference:t,viewingMode:r},{spatialReference:St.WebMercator,viewingMode:r}]:[{spatialReference:i?St.WGS84:St.WebMercator,viewingMode:r}]:jA(e)||Kte(e)||!i&&!n?jA(e)&&i&&r!==$e.Global?[{spatialReference:t,viewingMode:r},{spatialReference:St.WGS84,viewingMode:$e.Local}]:[{spatialReference:t,viewingMode:r}]:[{spatialReference:t,viewingMode:r},{spatialReference:i?St.WGS84:St.WebMercator,viewingMode:r}]}_validateSpatialReference(t){const e=this.getSpatialReferenceSupport({spatialReference:t})!=null,r=this._predeterminedViewingMode;return e||(r!=null?J.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${Pk(r)} viewing mode.`):t.isGeographic&&J.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),e}whenReady(){return new Promise(t=>{this.ready?t(this):this._resolveWhenReady.push(t)})}computeMapPointFromVec3d(t,e){let r=this.spatialReference||St.WGS84;return Cs(t,this.renderSpatialReference,t,r)||(r=St.WGS84,Cs(t,this.renderSpatialReference,t,r)),e?(e.x=t[0],e.y=t[1],e.z=t[2],e.spatialReference=r):e=new ze(t,r),e}trackGraphicState(t){if(!t.graphic)return J.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const e=this.getViewForGraphic(t.graphic);let r=null,i=!1;const n=s=>{var o;!i&&s!=null&&"processor"in s&&((o=s.processor)==null?void 0:o.type)==="graphics-3d"&&s.processor.graphicsCore&&(r=s.processor.graphicsCore.trackGraphicState(t))};return e!=null?n(e):this.whenViewForGraphic(t.graphic,{waitForLayer:!0}).then(s=>n(s),()=>{}).catch(()=>{}),{remove:()=>{i=!0,r!=null&&(r.remove(),r=null)}}}highlight(t){if(Array.isArray(t))return dS(t.map(r=>this.highlight(r)));if(ir.isCollection(t))return dS(t.toArray().map(r=>this.highlight(r)));const e=this.getViewForGraphic(t);return e&&"highlight"in e?e.highlight(t):Za()}maskOccludee(t){if(!t)return J.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const e=this.getViewForGraphic(t);let r=null,i=!1;const n=s=>{!i&&s!=null&&Hwt(s)&&(r=s.maskOccludee(t))};return e!=null?n(e):this.whenViewForGraphic(t,{waitForLayer:!0}).then(s=>n(s),()=>{}).catch(()=>{}),{remove:()=>{i=!0,r!=null&&(r.remove(),r=null)}}}getViewForGraphic(t){return t.layer===this.graphics?this.graphicsView:t.layer?this.allLayerViews.find(e=>e.layer===t.layer):null}graphicChanged(t){this.graphicsView!=null&&this.graphicsView.graphicChanged(t)}async whenViewForGraphic(t,e){if(t.layer===this)return await uR(()=>this.graphicsView),this.graphicsView;if(!t.layer||!this.map)throw new Y("no-view-for-graphic");return e&&e.waitForLayer&&!this.map.allLayers.includes(t.layer)?new Promise((r,i)=>{const n=this.map.allLayers.on("change",s=>{s.added.includes(t.layer)&&(n.remove(),this.whenLayerView(t.layer).then(r,i))})}):this.whenLayerView(t.layer)}externalToInternalIntersectOptions(t){const e=this._externalToInternalRenderItems(t.include,RO.INCLUDE),r=this._externalToInternalRenderItems(t.exclude,RO.EXCLUDE);return{include:e.layerUids,exclude:r.layerUids,graphics:{include:e.graphicUids,exclude:r.graphicUids}}}_intersectResultToMapPoint(t,e){return t.getIntersectionPoint(i2)?(e=this.computeMapPointFromVec3d(i2,e),t.intersector===Ui.TERRAIN&&this.basemapTerrain&&(e.z=Af(this.basemapTerrain,e)??0),e):null}_intersectResultsToHits(t,e){const r=new Array;let i=null;for(let n=0;n{var r;const e=(r=this.basemapTerrain)==null?void 0:r.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const i=this.basemapTerrain.extent!=null&&this.basemapTerrain.spatialReference!=null?xE(d6(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;this.clippingArea!=null?this.featureTiles.filterExtent=this.clippingArea.intersection(i):this.featureTiles.filterExtent=i}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.addHandles([this.updatingHandles.add(()=>Kr.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&this.featureTiles&&!this._featureTreeDebugger?this.updatingHandles.addPromise(ce(()=>import("./FeatureTileTree3DDebugger-3e47616a.js"),["assets/FeatureTileTree3DDebugger-3e47616a.js","assets/TileTreeDebugger-142b9f39.js"])).then(({FeatureTileTree3DDebugger:r})=>{!this._featureTreeDebugger&&Kr.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new r({view:this}))}):e||!this._featureTreeDebugger||Kr.FEATURE_TILE_TREE_SHOW_TILES||(this._featureTreeDebugger.destroy(),this._featureTreeDebugger=null)},An),this.updatingHandles.add(()=>this.clippingArea,t,An),this.updatingHandles.add(()=>this.basemapTerrain.extent,t,An)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.state&&(this.stateManager.exit(),this.removeHandles("render-coords-helper"),this.removeHandles("feature-tiles"),this.featureTiles.destroy(),this._set("featureTiles",null),this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null),this._exitBasemapTerrain(),this.state.exit(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const t=this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(t)||this._set("mapCoordsHelper",new xft(this.map,t));const e=this.state.isGlobal,r=m7e(e,t);r!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Cft.create(this.state.viewingMode,r)),e||this.addHandles(ue(()=>{var i;return(i=this.basemapTerrain)==null?void 0:i.extent},i=>{const n=this.renderCoordsHelper.spatialReference;i==null||i[0]===0&&i[1]===0&&i[2]===0&&i[3]===0||!RP(i,this.basemapTerrain.spatialReference,Jde,n)||(this.renderCoordsHelper.extent=Jde)},Br),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(BS/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper",null),this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.mapCoordsHelper&&(this.removeHandles("render-coords-helper"),this._set("renderCoordsHelper",null),this._set("mapCoordsHelper",null))}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(t=null){t!=null&&t.type===Yr.MOVE||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(ue(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),Br),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(t,e){if(!this.overlay||!this.overlay.hasVisibleItems)return e;const r=t.getContext("2d");return r.putImageData(e,0,0),this.overlay.renderCanvas(t),r.getImageData(0,0,e.width,e.height)}_initStage(){const t={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(n,s)=>this._renderScreenshotOverlay(n,s)}},e=new ift(this.state.viewingMode,n=>this._stage.layers.forAll(n),this);this._set("sceneIntersectionHelper",e);const r=R6(this.surface);this._stage=new Gc({view:this,options:t,container:r}),this._stage.renderer.setParameters({slicePlane:this.slicePlane}),this.addHandles([this.updatingHandles.add(()=>this.qualitySettings.antialiasingEnabled,()=>this._stage.renderer.setParameters({antialiasingEnabled:this.qualitySettings.antialiasingEnabled}),Pr),this.updatingHandles.add(()=>this.qualitySettings.highQualityTransparency,n=>this._stage.renderer.setParameters({highQualityTransparency:n}),Pr),ue(()=>this.magnifier,n=>this._stage.renderView.magnifier=n,An),this.on("pointer-move",()=>{var n;return(n=this._stage)==null?void 0:n.renderer.resetAnimation()}),dP(this._stage.renderView.canvas,"webglcontextlost",n=>this.fatalError=new Y("webgl-context-lost",n.statusMessage))],"stage");const i=()=>{this._stage.renderer.setParameters({defaultHighlightOptions:fW.toEngineOptions(this.highlightOptions)})};this.addHandles(this.updatingHandles.add(()=>[this.highlightOptions.color,this.highlightOptions.haloColor,this.highlightOptions.haloOpacity,this.highlightOptions.fillOpacity,this.highlightOptions.shadowOpacity,this.highlightOptions.shadowColor,this.highlightOptions.shadowDifference],i),"stage"),i(),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(BS/this.renderCoordsHelper.unitInMeters),this._set("canvas",this._stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage=Me(this._stage),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(t){this._exitSurface(),this.state.init(t,this.spatialReference),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new mmt({view:this,viewingMode:t,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController||this.graphics.length===0)return;this.removeHandles("graphics-view"),this._createGraphicsViewController=new AbortController;const t=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(t,t),this._updatingChanged()}async _createGraphicsViewAsync(t){const e=(await ce(()=>import("./GraphicsView3D-1336db36.js"),["assets/GraphicsView3D-1336db36.js","assets/GraphicsProcessor-750d4e2b.js","assets/diffUtils-590c9088.js","assets/Query-1c961d4c.js","assets/Graphics3DObjectStates-bb2a6162.js","assets/UniqueValueRenderer-fef4204d.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/popupUtils-f04ec9a9.js"])).default;Bt(t),await uR(()=>{var r;return(r=this.basemapTerrain)==null?void 0:r.ready},t),this._set("graphicsView",new e({view:this}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.removeHandles("graphics-view"),this.graphicsView!=null&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const t=ene(this.viewingMode);if(t===$e.Global&&(this._clippingArea=null),this._initSurface(t),this._set("ready",!0),this.addHandles(Ol(()=>this.graphics,"after-changes",()=>this._createGraphicsViewIfNeeded()),"graphics-view"),this._createGraphicsViewIfNeeded(),!this._externallySet.environment){const r=this.get("map.initialViewProperties.environment");r&&(this.environment=r)}this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const e=this._resolveWhenReady;this._resolveWhenReady=[],e.forEach(r=>r(this))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this.labeler.dispose(),this._disposeGraphicsView(),this.removeHandles("graphics-view"),this._exitSurface(),this._set("ready",!1)}_updateDefaultToMapOptions(){if(this._defaultToMapOptions.include.clear(),this.map){this.map.ground&&this._defaultToMapOptions.include.add(jy);for(const t of this.map.allLayers.items)t.type==="integrated-mesh"&&this._defaultToMapOptions.include.add(t.uid)}}_updateDefaultHitTestOptions(){if(this._defaultHitTestOptions.exclude.clear(),this.map){this.map.ground&&this.map.ground.opacity<1&&this._defaultHitTestOptions.exclude.add(jy);for(const t of this.map.allLayers.items)t.type==="integrated-mesh"&&t.opacity<1&&this._defaultHitTestOptions.exclude.add(t.uid)}}addVoxelLayerViewToWasm(t){return this.voxelWasm==null?(this.voxelWasmPromise==null&&(this.voxelWasmPromise=ce(()=>import("./VoxelWasmPerSceneView-0fc2c231.js"),[]).then(e=>(this.voxelWasm=new e.default(this),this.voxelWasm))),this.voxelWasmPromise.then(e=>e.addVoxelLayer(t))):this.voxelWasm.addVoxelLayer(t)}removeVoxelLayerViewFromWasm(t){this.voxelWasm!=null&&this.voxelWasm.removeVoxelLayer(t)<1&&(this.voxelWasm=null,this.voxelWasmPromise=null)}};function KC(t,e){t.layerUids||(t.layerUids=new Set),t.layerUids.add(e)}function lTt(t,e){t.graphicUids||(t.graphicUids=new Set),t.graphicUids.add(e)}function _L(t,e){return t!=null&&Bg(t.spatialReference,e)?xE(t,e):null}var RO;We.type="3d",h([f()],We.prototype,"_userClippingArea",void 0),h([f()],We.prototype,"_resourceController",void 0),h([f()],We.prototype,"_stage",void 0),h([f({readOnly:!0})],We.prototype,"deconflictor",void 0),h([f({readOnly:!0})],We.prototype,"labeler",void 0),h([f(F4($S,"analyses"))],We.prototype,"analyses",void 0),h([f({type:DS,readOnly:!0})],We.prototype,"animation",null),h([f({readOnly:!0})],We.prototype,"basemapTerrain",void 0),h([f({readOnly:!0})],We.prototype,"elevationProvider",void 0),h([f()],We.prototype,"camera",null),h([f({type:vu})],We.prototype,"contentCamera",null),h([f({readOnly:!0})],We.prototype,"canvas",void 0),h([f({type:ze})],We.prototype,"center",null),h([f({type:Dr})],We.prototype,"clippingArea",null),h([f({type:rb})],We.prototype,"constraints",void 0),h([f({type:Dr,readOnly:!0})],We.prototype,"renderDataExtent",null),h([f({type:Dr,readOnly:!0})],We.prototype,"dataExtent",null),h([f({type:Dr,readOnly:!0})],We.prototype,"_groundAndLayersExtent",null),h([f({value:null,type:T2})],We.prototype,"environment",null),h([_i("environment")],We.prototype,"castEnvironment",null),h([f({readOnly:!0})],We.prototype,"environmentManager",void 0),h([f({type:Dr})],We.prototype,"extent",null),h([f()],We.prototype,"floors",void 0),h([f()],We.prototype,"screenCenter",null),h([f()],We.prototype,"frustum",null),h([f({type:Number,readOnly:!0})],We.prototype,"fullOpacity",void 0),h([f({readOnly:!0})],We.prototype,"graphicsView",void 0),h([f({readOnly:!0})],We.prototype,"analysisViewManager",void 0),h([f()],We.prototype,"groundView",void 0),h([f({type:Boolean})],We.prototype,"initialExtentRequired",null),h([f()],We.prototype,"_defaultsFromMapSettings",null),h([f()],We.prototype,"interacting",null),h([f()],We.prototype,"stationary",null),h([f()],We.prototype,"navigating",null),h([f()],We.prototype,"map",void 0),h([f({readOnly:!0})],We.prototype,"mapCoordsHelper",void 0),h([f()],We.prototype,"padding",null),h([f({type:yl,readOnly:!0})],We.prototype,"pointsOfInterest",void 0),h([f({type:ho,readOnly:!0})],We.prototype,"featureTiles",void 0),h([f()],We.prototype,"_featureTreeDebugger",void 0),h([f({type:Boolean})],We.prototype,"screenSizePerspectiveEnabled",void 0),h([f({constructOnly:!0})],We.prototype,"deactivatedWebGLExtensions",void 0),h([f({constructOnly:!0})],We.prototype,"debugWebGLExtensions",void 0),h([f({constructOnly:!0})],We.prototype,"renderCanvas",void 0),h([f({constructOnly:!0})],We.prototype,"state",void 0),h([f({readOnly:!0})],We.prototype,"inputManager",void 0),h([f({readOnly:!0})],We.prototype,"stateManager",void 0),h([f({type:["low","medium","high"]})],We.prototype,"qualityProfile",null),h([f({type:wce,get(){let t=this._get("qualitySettings");return t||(t=new wce,eN.apply(this.qualityProfile,t)),t}})],We.prototype,"qualitySettings",void 0),h([f()],We.prototype,"slicePlane",null),h([f({readOnly:!0})],We.prototype,"typeSpecificPreconditionsReady",null),h([f({readOnly:!0})],We.prototype,"renderCoordsHelper",void 0),h([f({readOnly:!0})],We.prototype,"sceneIntersectionHelper",void 0),h([f({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],We.prototype,"resolution",null),h([f({type:Number})],We.prototype,"scale",null),h([f()],We.prototype,"heightModelInfo",null),h([f()],We.prototype,"spatialReference",void 0),h([f({type:Boolean,constructOnly:!0})],We.prototype,"alphaCompositingEnabled",void 0),h([f({constructOnly:!0})],We.prototype,"preserveDrawingBufferEnabled",void 0),h([f({type:Boolean})],We.prototype,"supersampleScreenshotsEnabled",void 0),h([f({readOnly:!0})],We.prototype,"type",void 0),h([f(),_i(t=>t instanceof PMe?t:mS(MMe,t))],We.prototype,"ui",void 0),h([f({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","_stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating"]})],We.prototype,"updating",null),h([f()],We.prototype,"_updatingObjects",null),h([f()],We.prototype,"_updatingObjectsWithProgress",null),h([f({type:Number,readOnly:!0,dependsOn:["updating"]})],We.prototype,"updatingProgress",void 0),h([f({type:["global","local"]})],We.prototype,"viewingMode",null),h([f({type:hp})],We.prototype,"viewpoint",null),h([f({type:Number})],We.prototype,"zoom",null),h([f({type:fW})],We.prototype,"highlightOptions",void 0),We=h([N("esri.views.SceneView")],We),function(t){t[t.INCLUDE=0]="INCLUDE",t[t.EXCLUDE=1]="EXCLUDE"}(RO||(RO={}));const i2=O(),fB=Xi(),Jde=jt(),cTt=We,Kde={read:{reader:elt},write:{allowNull:!0,writer:tlt}},uTt=t=>{let e=class extends t{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return h([f({type:["average","color-burn","color-dodge","color","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","invert","lighten","lighter","luminosity","minus","multiply","normal","overlay","plus","reflect","saturation","screen","soft-light","source-atop","source-in","source-out","vivid-light","xor"],nonNullable:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!0},"portal-item":{read:!0,write:!0}}}})],e.prototype,"blendMode",void 0),h([f({json:{read:!1,write:!1,origins:{"web-map":Kde,"portal-item":Kde}}})],e.prototype,"effect",void 0),e=h([N("esri.layers.mixins.BlendLayer")],e),e},hTt=t=>{let e=class extends t{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const r={minScale:this.minScale,maxScale:this.maxScale},i=this.parent;i&&"effectiveScaleRange"in i&&dTt(r,i.effectiveScaleRange);const n=this._get("effectiveScaleRange");return n&&n.minScale===r.minScale&&n.maxScale===r.maxScale?n:r}};return h([f({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"minScale",void 0),h([f({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"maxScale",void 0),h([f({readOnly:!0})],e.prototype,"effectiveScaleRange",null),e=h([N("esri.layers.mixins.ScaleRangeLayer")],e),e};function dTt(t,e){return t.minScale=t.minScale>0?e.minScale>0?Math.min(t.minScale,e.minScale):t.minScale:e.minScale,t.maxScale=t.maxScale>0?e.maxScale>0?Math.max(t.maxScale,e.maxScale):t.maxScale:e.maxScale,t}var eq;let xA=eq=class extends ke{constructor(t){super(t)}async collectRequiredFields(t,e){return kg(t,e,this.expression)}clone(){return new eq({expression:this.expression,title:this.title})}equals(t){return this.expression===t.expression&&this.title===t.title}};h([f({type:String,json:{write:!0}})],xA.prototype,"expression",void 0),h([f({type:String,json:{write:!0}})],xA.prototype,"title",void 0),xA=eq=h([N("esri.layers.support.FeatureExpressionInfo")],xA);const epe=xA;var tq;const vL=Oc()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),tpe=new zn({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let Ym=tq=class extends ke{constructor(t){super(t),this.offset=null}readFeatureExpressionInfo(t,e){return t??(e.featureExpression&&e.featureExpression.value===0?{expression:"0"}:void 0)}writeFeatureExpressionInfo(t,e,r,i){e[r]=t.write({},i),t.expression==="0"&&(e.featureExpression={value:0})}get mode(){const{offset:t,featureExpressionInfo:e}=this;return this._isOverridden("mode")?this._get("mode"):t!=null||e?"relative-to-ground":"on-the-ground"}set mode(t){this._override("mode",t)}set unit(t){this._set("unit",t)}write(t,e){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(t,e):null}clone(){return new tq({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(t){return this.mode===t.mode&&this.offset===t.offset&&this.unit===t.unit&&nDe(this.featureExpressionInfo,t.featureExpressionInfo)}};h([f({type:epe,json:{write:!0}})],Ym.prototype,"featureExpressionInfo",void 0),h([lr("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],Ym.prototype,"readFeatureExpressionInfo",null),h([xr("featureExpressionInfo",{featureExpressionInfo:{type:epe},"featureExpression.value":{type:[0]}})],Ym.prototype,"writeFeatureExpressionInfo",null),h([f({type:vL.apiValues,nonNullable:!0,json:{type:vL.jsonValues,read:vL.read,write:{writer:vL.write,isRequired:!0}}})],Ym.prototype,"mode",null),h([f({type:Number,json:{write:!0}})],Ym.prototype,"offset",void 0),h([f({type:uit,json:{type:String,read:tpe.read,write:tpe.write}})],Ym.prototype,"unit",null),Ym=tq=h([N("esri.layers.support.ElevationInfo")],Ym);const pTt=Ym;let Zm=class extends uTt(hTt(Hye)){constructor(e){super(e),this.elevationInfo=null,this.graphics=new Mb,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(e){return this.graphics.add(e),this}addMany(e){return this.graphics.addMany(e),this}removeAll(){return this.graphics.removeAll(),this}remove(e){this.graphics.remove(e)}removeMany(e){this.graphics.removeMany(e)}on(e,r){return super.on(e,r)}graphicChanged(e){this.emit("graphic-update",e)}};h([f({type:pTt})],Zm.prototype,"elevationInfo",void 0),h([f(F4(Mb,"graphics"))],Zm.prototype,"graphics",void 0),h([f({type:["show","hide"]})],Zm.prototype,"listMode",void 0),h([f()],Zm.prototype,"screenSizePerspectiveEnabled",void 0),h([f({readOnly:!0})],Zm.prototype,"type",void 0),h([f({constructOnly:!0})],Zm.prototype,"internal",void 0),Zm=h([N("esri.layers.GraphicsLayer")],Zm);const fTt=Zm;let TA=class extends Cu(ke){constructor(e){super(e),this.type="georeferenced-relative",this.isRelative=!0,this.isGeoreferenced=!0,this.origin=O()}getOriginPoint(e){const[r,i,n]=this.origin;return new ze({x:r,y:i,z:n,spatialReference:e})}setOriginFormPoint({x:e,y:r,z:i}){this.origin=Se(e,r,i??0)}};h([Vt({georeferencedRelative:"georeferenced-relative"},{readOnly:!0})],TA.prototype,"type",void 0),h([f({type:[Number],nonNullable:!0,json:{write:!0}})],TA.prototype,"origin",void 0),TA=h([N("esri.geometry.support.MeshGeoreferencedRelativeVertexSpace")],TA);const $Me=TA;let gN=class extends Cu(ke){constructor(){super({}),this.type="georeferenced",this.isRelative=!1,this.isGeoreferenced=!0}};h([Vt({georeferenced:"georeferenced"},{readOnly:!0})],gN.prototype,"type",void 0),gN=h([N("esri.geometry.support.MeshGeoreferencedVertexSpace")],gN);const wF=gN;let SA=class extends Cu(ke){constructor(e){super(e),this.type="local",this.isRelative=!0,this.isGeoreferenced=!1,this.origin=O()}getOriginPoint(e){const[r,i,n]=this.origin;return new ze({x:r,y:i,z:n,spatialReference:e})}setOriginFormPoint({x:e,y:r,z:i}){this.origin=Se(e,r,i??0)}};h([Vt({local:"local"},{readOnly:!0})],SA.prototype,"type",void 0),h([f({type:[Number],nonNullable:!0,json:{write:!0}})],SA.prototype,"origin",void 0),SA=h([N("esri.geometry.support.MeshLocalVertexSpace")],SA);const xF=SA;var rq;let pf=rq=class extends ke{constructor(t){super(t),this.translation=O(),this.rotationAxis=na(I2e),this.rotationAngle=0,this.scale=Se(1,1,1)}get rotation(){return UD(this.rotationAxis,this.rotationAngle)}set rotation(t){this.rotationAxis=ki(t),this.rotationAngle=AYe(t)}get localMatrix(){const t=_e();return ER(rpe,this.rotation,p5(this.rotation)),pve(t,rpe,this.translation,this.scale),t}get localMatrixInverse(){return us(_e(),this.localMatrix)}applyLocal(t,e){return De(e,t,this.localMatrix)}applyLocalInverse(t,e){return De(e,t,this.localMatrixInverse)}equals(t){return this===t||t!=null&&lZ(this.localMatrix,t.localMatrix)}clone(){const t={translation:ki(this.translation),rotationAxis:ki(this.rotationAxis),rotationAngle:this.rotationAngle,scale:ki(this.scale)};return new rq(t)}};h([f({type:[Number],nonNullable:!0,json:{write:!0}})],pf.prototype,"translation",void 0),h([f({type:[Number],nonNullable:!0,json:{write:!0}})],pf.prototype,"rotationAxis",void 0),h([f({type:Number,nonNullable:!0,json:{write:!0}})],pf.prototype,"rotationAngle",void 0),h([f({type:[Number],nonNullable:!0,json:{write:!0}})],pf.prototype,"scale",void 0),h([f()],pf.prototype,"rotation",null),h([f()],pf.prototype,"localMatrix",null),h([f()],pf.prototype,"localMatrixInverse",null),pf=rq=h([N("esri.geometry.support.MeshTransform")],pf);const rpe=Au(),nE=pf;function UE(t,e){return t.isGeographic||t.isWebMercator&&((e==null?void 0:e.geographic)??!0)}function hU(t,e,r){const i=!t.isGeoreferenced;(r==null?void 0:r.geographic)!=null&&r.geographic!==i&&J.getLogger(e).warnOnce(`Specifying the 'geographic' parameter (${r.geographic}) for a Mesh vertex space of type "${t.type}" is not supported. This parameter will be ignored.`)}function dU(t,e,r){return UE(e.spatialReference,r)?yTt(t,e,r):gTt(t,e,r)}function IMe(t,e,r,i){const{position:n,normal:s,tangent:o}=t;if(!e.isRelative)return{position:n,normal:s,tangent:o};const a=(r==null?void 0:r.localMatrix)??yn;return dU({position:gp(new Float64Array(n.length),n,a),normal:s!=null?lAe(s,new Float32Array(s.length),a):null,tangent:o!=null?cAe(o,new Float32Array(o.length),a):null},e.getOriginPoint(i),{geographic:!e.isGeoreferenced})}function LMe(t,e,r){if(r!=null&&r.useTransform){const{position:i,normal:n,tangent:s}=t,{x:o,y:a,z:l}=e,c=Se(o,a,l??0);return{vertexAttributes:{position:i,normal:n,tangent:s},vertexSpace:r.geographic??1?new xF({origin:c}):new $Me({origin:c}),transform:new nE}}return{vertexAttributes:dU(t,e,r),vertexSpace:new wF,transform:null}}function TF(t,e,r){return UE(e.spatialReference,r)?wTt(t,e,r):DMe(t,e,r)}function mTt(t,e,r,i,n){if(!e.isRelative)return TF(t,i,n);const{spatialReference:s}=i,o=IMe(t,e,r,s);return i.equals(e.getOriginPoint(s))?DMe(o,i,n):TF(o,i,n)}function zK({positions:t,transform:e,vertexSpace:r,inSpatialReference:i,outSpatialReference:n,outPositions:s,local:o}){const a=r.isRelative?r.origin:Zs,l=r.isRelative?(e==null?void 0:e.localMatrix)??yn:yn;if(r.isGeoreferenced){const p=s??Ys(t.length);if(I6(l,yn)?rXe(p,t):gp(p,t,l),!Bo(a,Zs)){const[m,y,_]=a;for(let v=0;vimport("./loadGLTFMesh-932e7ee5.js"),[]),r),s=await DTt(i,r);Bt(r);const o=n(new ze({x:0,y:0,z:0,spatialReference:t.spatialReference}),s.url,{resolveFile:LTt(s),useTransform:!0,signal:r==null?void 0:r.signal});o.then(()=>s.dispose(),()=>s.dispose());const{vertexAttributes:a,components:l}=await o;t.vertexAttributes=a,t.components=l}function LTt(t){const e=o6(t.url);return r=>{const i=n6(r,e,e),n=i?i.replace(/^ *\.\//,""):null;return(n?t.files.get(n):null)??r}}async function DTt(t,e){if(Array.isArray(t)){if(!t.length)throw new Y("mesh-load-external:missing-assets","There must be at least one file to load");return t[0]instanceof File?FTt(t):UTt(t,e)}return zMe(t)}async function NTt(t,e){const{parts:r}=t;if(r.length===1)return new SF(r[0].partUrl);const i=await t.toBlob(e);return Bt(e),SF.fromBlob(i)}function zMe(t){return SF.fromBlob(t)}function FTt(t){return BMe(t.map(e=>({name:e.name,mimeType:e.type,source:zMe(e)})))}async function UTt(t,e){const r=await e4(t.map(async i=>{const n=await NTt(i);return Bt(e),{name:i.assetName,mimeType:i.assetMimeType,source:n}}));if(ss(e))throw r.forEach(i=>i.source.dispose()),wr();return BMe(r)}const kTt=/^(model\/gltf\+json)|(model\/gltf-binary)$/,zTt=/\.(gltf|glb)/i;function BMe(t){const e=new Map;let r=null;for(const{name:i,mimeType:n,source:s}of t)(r==null||kTt.test(n)||zTt.test(i))&&(r=s.url),e.set(i,s.url),s.files.forEach((o,a)=>e.set(a,o));if(r==null)throw new Y("mesh-load-external:missing-files","Missing files to load external mesh source");return new SF(r,()=>t.forEach(({source:i})=>i.dispose()),e)}let SF=class VMe{constructor(e,r=()=>{},i=new Map){this.url=e,this.dispose=r,this.files=i}static fromBlob(e){const r=URL.createObjectURL(e);return new VMe(r,()=>URL.revokeObjectURL(r))}},GMe=class{constructor(e,r,i){this.assetName=e,this.assetMimeType=r,this.parts=i}equals(e){return this===e||this.assetName===e.assetName&&this.assetMimeType===e.assetMimeType&&Hf(this.parts,e.parts,(r,i)=>r.equals(i))}isOnService(e){return this.parts.every(r=>r.isOnService(e))}makeHash(){let e="";for(const r of this.parts)e+=r.partHash;return e}async toBlob(e){const{parts:r}=this;if(r.length===1)return r[0].toBlob(e);const i=await Promise.all(r.map(n=>n.toBlob(e)));return Bt(e),new Blob(i)}},A9t=class{constructor(e,r){this.partUrl=e,this.partHash=r}equals(e){return this===e||this.partUrl===e.partUrl&&this.partHash===e.partHash}isOnService(e){return this.partUrl.startsWith(`${e.path}/assets/`)}async toBlob(e){const{data:r}=await kn(this.partUrl,{responseType:"blob"});return Bt(e),r}};function npe(t){return BTt(t==null?void 0:t.source)}function spe(t){return Array.isArray(t)?t.every(e=>e instanceof GMe):!1}const ope=/^(model\/gltf\+json)|(model\/gltf-binary)$/,ape=/\.(gltf|glb)/i;function BTt(t){return t?Array.isArray(t)?t.some(lpe):lpe(t):!1}function lpe(t){if(t instanceof File){const{type:e,name:r}=t;return ope.test(e)||ape.test(r)}return ope.test(t.assetMimeType)||ape.test(t.assetName)}function VTt(t,e){if(!t)return!1;const{source:r}=t;return jTt(r,e)}function GTt(t,e){if(t===e)return!0;const{source:r}=t,{source:i}=e;if(r===i)return!0;if(spe(r)&&spe(i)){if(r.length!==i.length)return!1;const n=(a,l)=>a.assetNamel.assetName?1:0,s=[...r].sort(n),o=[...i].sort(n);for(let a=0;acpe(r,e)):cpe(t,e)}function cpe(t,e){return t instanceof GMe&&t.isOnService(e)}function R9t(t,e){return t instanceof File?e7(t.name,e)??KV(t.type,e):KV(t.assetMimeType,e)??e7(t.assetName,e)}function P9t(t){return Array.isArray(t)?t:[t]}function M9t(t){return!!t.original}let Fy=class extends c7{constructor(){super(),this.externalSources=new ir,this._explicitDisplaySource=null}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(e!=null&&!npe(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(r=>!GTt(r,e))&&this.externalSources.add(e)}clearSources(){this.displaySource=null,this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(r=>VTt(r,e))}get _implicitDisplaySource(){return this.externalSources.find(npe)}};h([f()],Fy.prototype,"externalSources",void 0),h([f()],Fy.prototype,"displaySource",null),h([f()],Fy.prototype,"_implicitDisplaySource",null),h([f()],Fy.prototype,"_explicitDisplaySource",void 0),Fy=h([N("esri.geometry.support.meshUtils.Metadata")],Fy);const HTt="esri.geometry.support.meshUtils.offset";function WTt(t,e,r){if(!t.vertexAttributes||!t.vertexAttributes.position)return;const{vertexSpace:i}=t;i.isRelative?(hU(i,HTt,r),qTt(i,e)):UE(t.spatialReference,r)?XTt(t,e):YTt(t,e)}function qTt(t,e){const r=t.origin;t.origin=oe(O(),r,e)}function XTt(t,e){const r=t.spatialReference,i=t.vertexAttributes.position,n=t.vertexAttributes.normal,s=t.vertexAttributes.tangent,o=new Float64Array(i.length),a=n!=null?new Float32Array(n.length):null,l=s!=null?new Float32Array(s.length):null,c=t.extent.center,u=ZTt;ma(r,[c.x,c.y,c.z],upe,t0(r)),Ac(hpe,upe),zo(u,e,hpe),W8(i,r,o),n!=null&&a!=null&&tM(n,i,o,r,a),s!=null&&l!=null&&rM(s,i,o,r,l),jMe(o,u),q8(o,i,r),n!=null&&a!=null&&H8(a,i,o,r,n),s!=null&&l!=null&&X8(l,i,o,r,s),t.vertexAttributesChanged()}function YTt(t,e){jMe(t.vertexAttributes.position,e),t.vertexAttributesChanged()}function jMe(t,e){if(t)for(let r=0;r=s&&u=5-1,v=m===2||m===4,b=y?r-1:r;for(let x=0;x<=b;x++){const T=x/b*2*Math.PI,S=y?0:.5;Vs[0]=S*Math.sin(T),Vs[1]=S*-Math.cos(T),Vs[2]=m<=2?.5:-.5;for(let A=0;A<3;A++)n[l++]=Vs[A],s[c++]=_?A===2?m<=1?1:-1:0:A===2?0:Vs[A]/S;o[u++]=(x+(y?.5:0))/r,o[u++]=m<=1?1*m/3:m<=3?1*(m-2)/3+1/3:1*(m-4)/3+2/3,v||m===0||x===r||(m!==5&&(a[d++]=p,a[d++]=p+1,a[d++]=p-r),m!==1&&(a[d++]=p,a[d++]=p-r,a[d++]=p-r-1)),p++}}return{position:n,normal:s,uv:o,faces:a}}function tSt(t,e){const r=typeof e=="number"?e:e!=null?e.width:1,i=typeof e=="number"?e:e!=null?e.height:1;switch(t){case"up":case"down":return{width:r,depth:i};case"north":case"south":return{width:r,height:i};case"east":case"west":return{depth:r,height:i}}}function rSt(t){const e=e3.facingAxisOrderSwap[t],r=e3.position,i=e3.normal,n=new Float64Array(r.length),s=new Float32Array(i.length);let o=0;for(let a=0;a<4;a++){const l=o;for(let c=0;c<3;c++){const u=e[c],d=Math.abs(u)-1,p=u>=0?1:-1;n[o]=r[l+d]*p,s[o]=i[l+d]*p,o++}}return{position:n,normal:s,uv:new Float32Array(e3.uv),faces:new Uint32Array(e3.faces),isPlane:!0}}const n2=1,s2=2,o2=3,e3={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[o2,n2,s2],west:[-o2,-n2,s2],north:[-n2,o2,s2],south:[n2,-o2,s2],up:[n2,s2,o2],down:[n2,-s2,-o2]}};function bL(t,e,r){t.isPlane||iSt(t),nSt(t,r==null?void 0:r.size);const{vertexAttributes:i,vertexSpace:n,transform:s}=LMe(t,e,r);return{vertexAttributes:new Ua({...i,uv:t.uv}),vertexSpace:n,transform:s,components:[new xw({faces:t.faces,material:r&&r.material||null})],spatialReference:e.spatialReference}}function iSt(t){for(let e=0;e{this.handles.add(ue(()=>{var t;return{vertexAttributes:this.vertexAttributes,components:(t=this.components)==null?void 0:t.map(e=>e.clone())}},()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){var t;return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):((t=this.metadata.displaySource)==null?void 0:t.extent)!=null}get _transformedExtent(){const{components:t,spatialReference:e,vertexAttributes:r,vertexSpace:i}=this,n=r.position;if(n.length===0||t&&t.length===0)return new Dr({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:e});if(i.type==="local"){const{_untransformedExtent:s,transform:o}=this;return CTt(s,o,i,e)}if(i.type==="georeferenced-relative"){const{transform:s}=this,o=zK({positions:n,transform:s,vertexSpace:i,inSpatialReference:e,outSpatialReference:e,local:!1});return yN(o,e)}return yN(n,e)}get _untransformedExtent(){return yN(this.vertexAttributes.position,this.spatialReference)}get anchor(){const{vertexSpace:t}=this;if(t.isRelative)return t.getOriginPoint(this.spatialReference);const{center:e,zmin:r}=this._transformedExtent;return new ze({x:e.x,y:e.y,z:r,spatialReference:this.spatialReference})}get origin(){const{vertexSpace:t}=this;return t.isRelative?t.getOriginPoint(this.spatialReference):this._transformedExtent.center}get extent(){var t,e;return this.loaded||((e=(t=this.metadata)==null?void 0:t.displaySource)==null?void 0:e.extent)==null?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(t){this.loaded?(this.components||(this.components=[]),this.components.push(xw.from(t)),this.notifyChange("components")):J.getLogger(this).error("addComponent()","Mesh must be loaded before applying operations")}removeComponent(t){if(this.loaded){if(this.components){const e=this.components.indexOf(t);if(e!==-1)return this.components.splice(e,1),void this.notifyChange("components")}J.getLogger(this).error("removeComponent()","Provided component is not part of the list of components")}else J.getLogger(this).error("removeComponent()","Mesh must be loaded before applying operations")}rotate(t,e,r,i){return CYe(t,e,r,gpe),aSt(this,gpe,i),this}offset(t,e,r,i){return this.loaded?(wL[0]=t,wL[1]=e,wL[2]=r,WTt(this,wL,i),this):(J.getLogger(this).error("offset()","Mesh must be loaded before applying operations"),this)}scale(t,e){return this.loaded?(hSt(this,t,e),this):(J.getLogger(this).error("scale()","Mesh must be loaded before applying operations"),this)}centerAt(t,e){return this.loaded?(ATt(this,t,e),this):(J.getLogger(this).error("centerAt()","Mesh must be loaded before applying operations"),this)}load(t){const{metadata:{displaySource:e}}=this;return e&&this.addResolvingPromise(ITt(this,e,t)),Promise.resolve(this)}addExternalSources(t){this.metadata.externalSources.addMany(t)}updateDisplaySource(t){this.metadata.displaySource=t}clone(){return this.cloneWithVertexSpace(this.vertexSpace.clone())}cloneWithVertexSpace(t){var i;let e=null;if(this.components){const n=new Map,s=new Map;e=this.components.map(o=>o.cloneWithDeduplication(n,s))}const r={components:e,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),vertexSpace:t,transform:((i=this.transform)==null?void 0:i.clone())??null,metadata:this.metadata.clone()};return new jc(r)}cloneShallow(){return new jc({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(t){const e=ce(()=>import("./gltfexport-6ef31b0f.js"),["assets/gltfexport-6ef31b0f.js","assets/imageutils-51a204ba.js"]),r=this.load(),i=await Promise.all([e,r]),{toBinaryGLTF:n}=i[0];return n(this,t)}get memoryUsage(){let t=0;if(t+=this.vertexAttributes.memoryUsage,this.components!=null)for(const e of this.components)t+=e.memoryUsage;return t}_clearSources(){this.metadata.clearSources()}static createBox(t,e){if(!(t instanceof ze))return J.getLogger(Qm).error(".createBox()","expected location to be a Point instance"),null;const r=new jc(bL(QTt(),t,e));return e&&e.imageFace&&e.imageFace!=="all"?JTt(r,e.imageFace):r}static createSphere(t,e){return t instanceof ze?new jc(bL(KTt(e&&e.densificationFactor||0),t,e)):(J.getLogger(Qm).error(".createSphere()","expected location to be a Point instance"),null)}static createCylinder(t,e){return t instanceof ze?new jc(bL(eSt(e&&e.densificationFactor||0),t,e)):(J.getLogger(Qm).error(".createCylinder()","expected location to be a Point instance"),null)}static createPlane(t,e){if(!(t instanceof ze))return J.getLogger(Qm).error(".createPlane()","expected location to be a Point instance"),null;const r=(e==null?void 0:e.facing)??"up",i=tSt(r,e==null?void 0:e.size);return new jc(bL(rSt(r),t,{...e,size:i}))}static createFromPolygon(t,e){if(!(t instanceof a1))return J.getLogger(Qm).error(".createFromPolygon()","expected polygon to be a Polygon instance"),null;const r=Gnt(t);return new jc({vertexAttributes:new Ua({position:r.position}),components:[new xw({faces:r.faces,shading:"flat",material:(e==null?void 0:e.material)??null})],spatialReference:t.spatialReference,vertexSpace:new wF})}static async createFromGLTF(t,e,r){if(!(t instanceof ze))throw J.getLogger(Qm).error(".createfromGLTF()","expected location to be a Point instance"),new Y("invalid-input","Expected location to be a Point instance");const{loadGLTFMesh:i}=await AX(ce(()=>import("./loadGLTFMesh-932e7ee5.js"),[]),r);return new jc(await i(t,e,r))}static async createFromFiles(t,e,r){if(!(t instanceof ze)){const o="Expected location to be a Point instance";throw J.getLogger(Qm).error(".createFromFiles()",o),new Y("invalid-input",o)}const i=jc.createWithExternalSource(t,e),n=r==null?void 0:r.layer;if(!n){const o="A layer is needed to convert the files";throw J.getLogger(Qm).error(".createFromFiles()",o),new Y("invalid-input",o)}const[s]=await n.uploadAssets([i],r);return s}static createWithExternalSource(t,e,r){var p;const i=(r==null?void 0:r.extent)??null,{x:n,y:s,z:o,spatialReference:a}=t,l=((p=r==null?void 0:r.transform)==null?void 0:p.clone())??new nE,c=(r==null?void 0:r.vertexSpace)??new xF({origin:[n,s,o??0]}),u={source:e,extent:i},d=new Fy;return d.externalSources.push(u),new jc({metadata:d,transform:l,vertexSpace:c,spatialReference:a})}static createIncomplete(t,e){var c;const{x:r,y:i,z:n,spatialReference:s}=t,o=((c=e==null?void 0:e.transform)==null?void 0:c.clone())??new nE,a=(e==null?void 0:e.vertexSpace)??new xF({origin:[r,i,n??0]}),l=new jc({transform:o,vertexSpace:a,spatialReference:s});return l.addResolvingPromise(Promise.reject(new Y("mesh-incomplete","Mesh resources are not complete"))),l}};h([f({type:[xw],json:{write:!0}})],Da.prototype,"components",void 0),h([f({nonNullable:!0,types:mSt,constructOnly:!0,json:{write:!0}})],Da.prototype,"vertexSpace",void 0),h([f({type:nE,json:{write:!0}})],Da.prototype,"transform",void 0),h([f({constructOnly:!0})],Da.prototype,"metadata",void 0),h([f()],Da.prototype,"hasExtent",null),h([f()],Da.prototype,"_transformedExtent",null),h([f()],Da.prototype,"_untransformedExtent",null),h([f()],Da.prototype,"anchor",null),h([f()],Da.prototype,"origin",null),h([f({readOnly:!0,json:{read:!1}})],Da.prototype,"extent",null),h([f({readOnly:!0,json:{read:!1,write:!0,default:!0}})],Da.prototype,"hasZ",void 0),h([f({readOnly:!0,json:{read:!1,write:!0,default:!1}})],Da.prototype,"hasM",void 0),h([f({type:Ua,nonNullable:!0,json:{write:!0}})],Da.prototype,"vertexAttributes",void 0),Da=jc=h([N(Qm)],Da);const wL=O(),gpe=jh(),gSt=Da,P_=20;function ySt(t,{x:e,y:r}){const i=vSt(_St(t)),n=bSt(i),s=wSt(i,n),o=P_*.75,a=P_*.55;return new ze({x:s.x*e*o+n.x*r*a,y:s.y*e*o+n.y*r*a,z:s.z*e*o+n.z*r*a})}const _St=({centerPoint:t,startPoint:e})=>new ze({x:t.x-e.x,y:t.y-e.y,z:t.z-e.z});function vSt(t){const e=xSt(t);return new ze({x:t.x/e,y:t.y/e,z:t.z/e})}const bSt=t=>new ze({x:0,y:-t.z,z:t.x}),wSt=(t,e)=>new ze({x:t.y*e.z-t.z*e.y,y:t.z*e.x-t.x*e.z,z:t.x*e.y-t.y*e.x}),xSt=t=>Math.sqrt(t.x**2+t.y**2+t.z**2);function ZMe(t,e,r){const i=t.geometry;t.geometry=i.rotate(0,0,e,{origin:r.centerPoint}).clone()}function TSt(t,e,r,i={x:0,y:0}){const n=ySt(r,i),{centerPoint:s}=r,o=r.startPoint.clone(),a=SSt.bind(void 0,r.blockPosition);o.x=a(s.x,r.startPoint.x)-n.x,o.y=a(s.y,r.startPoint.y)-n.y,o.z=a(s.z,r.startPoint.z)-n.z;const l=ESt(o,e,r.sketchEdges);return ZMe(l,r.initialAngle,r),t.add(l),l}const SSt=(t,e,r)=>e*(1-t)+r*t;function ESt(t,e,r=!1){const i=gSt.createBox(t,{size:{width:P_/2,height:P_/2,depth:P_/2}});return new z_({geometry:i,symbol:QMe(e,r)})}function QMe(t,e){const r=new vE({symbolLayers:[new Fw({material:{color:mB(t,.5)},edges:t==="_"?void 0:e?new qY({size:P_*.5,color:mB(t,.9)}):new m1e({size:P_*.15,color:mB(t,.9)})})]});return Object.defineProperty(r,"shape",{value:t}),r}const CSt=100,ASt=40;function mB(t,e=1){const r=oP[t].color[0];return iq(r,CSt,t==="_"?100:ASt,t==="_"?e*.6:e)}const iq=(t,e,r,i=1)=>it.fromRgb(["hsla(",t,", ",e,"%, ",r,"%, ",i,")"].join(""));function OSt(t,e,r){t.symbol.shape!==e&&(t.symbol=QMe(e,r.sketchEdges))}function RSt(t,e,r,i){const n=ai.useMemo(()=>t===void 0?void 0:PSt(t,r),[t,r]),s=r.type==="animated";ai.useEffect(()=>{if(!(n===void 0||!s||i))return n.start(),n.stop},[n,s,i]),ai.useEffect(()=>{n!==void 0&&e.forEach((o,a)=>o.forEach((l,c)=>n.spawnBox(l,c,a)))},[n,e])}function PSt(t,e){const r=new fTt;function i(c,u=c){$Le(Object.values(n).map(d=>Object.values(d??{})).flat()).forEach(d=>ZMe(d,u,e)),e.rotateCamera(t,c)}const n={};function s(c,u=0,d=0){var m;n[d]??(n[d]={}),(m=n[d])[u]??(m[u]=TSt(r,c,e,{x:-(sP/2)+u,y:yX/2-d}));const p=n[d][u];return OSt(p,c,e),p}t.map.add(r);let o;return{start:()=>o=setInterval(()=>i(-.04),ISt),stop:()=>clearInterval(o),spawnBox:s}}const MSt=1e3,$St=60,ISt=MSt/$St,t3=270;function LSt(t){const e=t==="animated",r=new ze({spatialReference:{wkid:102100},x:-8238833+(e?0:-500),y:4969413+(e?0:-500),z:e?250:120}),i=e?2500:800,n=e?t3:t3-30,s=o(n,t3,90);function o(c,u,d){const{x:p,y:m}=DSt(t3-u+c,i),y=r.clone();return y.x+=p,y.y+=m,new vu({position:y,heading:u-c,tilt:d})}const a=(c,u)=>void c.goTo(o(u,c.camera.heading,c.camera.tilt),{animate:!1}),l=o(0,t3,90).position;return{type:t,centerPoint:r,initialCamera:s,rotateCamera:a,sketchEdges:!e,initialAngle:n,startPoint:l,blockPosition:e?.7:.2}}function DSt(t,e){const r=t*Math.PI/180;return{x:e*Math.cos(r),y:e*Math.sin(r)}}var nq;let EA=nq=class extends ke{constructor(t){super(t),this.minValue=0,this.maxValue=0}clone(){return new nq({minValue:this.minValue,maxValue:this.maxValue})}};h([f({type:Number,json:{write:!0}})],EA.prototype,"minValue",void 0),h([f({type:Number,json:{write:!0}})],EA.prototype,"maxValue",void 0),EA=nq=h([N("esri.renderer.support.AuthoringInfoClassBreakInfo")],EA);var sq;let Uy=sq=class extends ke{constructor(t){super(t),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=[]}clone(){return new sq({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:ye(this.classBreakInfos)})}};h([f({type:String,json:{write:!0}})],Uy.prototype,"field",void 0),h([f({type:String,json:{write:!0}})],Uy.prototype,"normalizationField",void 0),h([f({type:String,json:{write:!0}})],Uy.prototype,"label",void 0),h([f({type:[EA],json:{write:!0}})],Uy.prototype,"classBreakInfos",void 0),Uy=sq=h([N("esri.renderers.support.AuthoringInfoFieldInfo")],Uy);var oq;const xL=new zn({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),TL=new zn({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),ype={key:t=>typeof t=="number"?"number":"string",typeMap:{number:Number,string:String},base:null},_pe=["high-to-low","above-and-below","centered-on","extremes"],vpe=[...new Set(["high-to-low","above-and-below","centered-on","extremes","90-10","above","below","high-to-low","above-and-below","90-10","above","below"])],bpe=["seconds","minutes","hours","days","months","years"];let Zl=oq=class extends ke{constructor(t){super(t),this.endTime=null,this.field=null,this.maxSliderValue=null,this.minSliderValue=null,this.startTime=null,this.type=null,this.units=null}castEndTime(t){return typeof t=="string"||typeof t=="number"?t:null}castStartTime(t){return typeof t=="string"||typeof t=="number"?t:null}get style(){return this.type==="color"?this._get("style"):null}set style(t){this._set("style",t)}get theme(){return this.type==="color"||this.type==="size"?this._get("theme")||"high-to-low":null}set theme(t){this._set("theme",t)}clone(){return new oq({endTime:this.endTime,field:this.field,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,startTime:this.startTime,style:this.style,theme:this.theme,type:this.type,units:this.units})}};h([f({types:ype,json:{write:!0}})],Zl.prototype,"endTime",void 0),h([_i("endTime")],Zl.prototype,"castEndTime",null),h([f({type:String,json:{write:!0}})],Zl.prototype,"field",void 0),h([f({type:Number,json:{write:!0}})],Zl.prototype,"maxSliderValue",void 0),h([f({type:Number,json:{write:!0}})],Zl.prototype,"minSliderValue",void 0),h([f({types:ype,json:{write:!0}})],Zl.prototype,"startTime",void 0),h([_i("startTime")],Zl.prototype,"castStartTime",null),h([f({type:xL.apiValues,value:null,json:{type:xL.jsonValues,read:xL.read,write:xL.write}})],Zl.prototype,"style",null),h([f({type:vpe,value:null,json:{type:vpe,origins:{"web-scene":{type:_pe,write:{writer:(t,e)=>{_pe.includes(t)&&(e.theme=t)}}}},write:!0}})],Zl.prototype,"theme",null),h([f({type:TL.apiValues,json:{type:TL.jsonValues,read:TL.read,write:TL.write}})],Zl.prototype,"type",void 0),h([f({type:bpe,json:{type:bpe,write:!0}})],Zl.prototype,"units",void 0),Zl=oq=h([N("esri.renderers.support.AuthoringInfoVisualVariable")],Zl);const NSt=Zl;let _N=class extends ke{constructor(e){super(e),this.type=null}};h([f({readOnly:!0,json:{read:!1,write:!0}})],_N.prototype,"type",void 0),_N=h([N("esri.rest.support.ColorRamp")],_N);const VK=_N;var aq;let jv=aq=class extends VK{constructor(t){super(t),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new aq({fromColor:ye(this.fromColor),toColor:ye(this.toColor),algorithm:this.algorithm})}};h([Vt({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],jv.prototype,"algorithm",void 0),h([f({type:it,json:{type:[mn],write:!0}})],jv.prototype,"fromColor",void 0),h([f({type:it,json:{type:[mn],write:!0}})],jv.prototype,"toColor",void 0),h([f({type:["algorithmic"]})],jv.prototype,"type",void 0),jv=aq=h([N("esri.rest.support.AlgorithmicColorRamp")],jv);const GK=jv;var lq;let CA=lq=class extends VK{constructor(t){super(t),this.colorRamps=null,this.type="multipart"}clone(){return new lq({colorRamps:ye(this.colorRamps)})}};h([f({type:[GK],json:{write:!0}})],CA.prototype,"colorRamps",void 0),h([f({type:["multipart"]})],CA.prototype,"type",void 0),CA=lq=h([N("esri.rest.support.MultipartColorRamp")],CA);const JMe=CA,FSt={key:"type",base:VK,typeMap:{algorithmic:GK,multipart:JMe}};function USt(t){return t&&t.type?t.type==="algorithmic"?GK.fromJSON(t):t.type==="multipart"?JMe.fromJSON(t):null:null}var cq;const rv=new zn({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),SL=new zn({pieChart:"pie-chart",classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),wpe=new zn({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),xpe=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers","decimal-degrees"],kSt=["high-to-low","above-and-below","above","below","90-10"],zSt=["flow-line","wave-front"],BSt=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let Gn=cq=class extends ke{constructor(t){super(t),this.colorRamp=null,this.fadeRatio=null,this.isAutoGenerated=!1,this.lengthUnit=null,this.maxSliderValue=null,this.minSliderValue=null,this.visualVariables=null}get classificationMethod(){const t=this._get("classificationMethod"),e=this.type;return e&&e!=="relationship"?e==="class-breaks-size"||e==="class-breaks-color"?t||"manual":null:t}set classificationMethod(t){this._set("classificationMethod",t)}readColorRamp(t){return t?USt(t):void 0}get fields(){return this.type&&this.type!=="predominance"?null:this._get("fields")}set fields(t){this._set("fields",t)}get field1(){return this.type&&this.type!=="relationship"?null:this._get("field1")}set field1(t){this._set("field1",t)}get field2(){return this.type&&this.type!=="relationship"?null:this._get("field2")}set field2(t){this._set("field2",t)}get flowTheme(){return this.type==="flow"?this._get("flowTheme"):null}set flowTheme(t){this._set("flowTheme",t)}get focus(){return this.type&&this.type!=="relationship"?null:this._get("focus")}set focus(t){this._set("focus",t)}get numClasses(){return this.type&&this.type!=="relationship"?null:this._get("numClasses")}set numClasses(t){this._set("numClasses",t)}get statistics(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("statistics"):null}set statistics(t){this._set("statistics",t)}get standardDeviationInterval(){const t=this.type;return t&&t!=="relationship"&&t!=="class-breaks-size"&&t!=="class-breaks-color"||this.classificationMethod&&this.classificationMethod!=="standard-deviation"?null:this._get("standardDeviationInterval")}set standardDeviationInterval(t){this._set("standardDeviationInterval",t)}get type(){return this._get("type")}set type(t){let e=t;t==="classed-size"?e="class-breaks-size":t==="classed-color"&&(e="class-breaks-color"),this._set("type",e)}get univariateSymbolStyle(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("univariateSymbolStyle"):null}set univariateSymbolStyle(t){this._set("univariateSymbolStyle",t)}get univariateTheme(){return this.type==="univariate-color-size"?this._get("univariateTheme"):null}set univariateTheme(t){this._set("univariateTheme",t)}clone(){return new cq({classificationMethod:this.classificationMethod,colorRamp:ye(this.colorRamp),fadeRatio:ye(this.fadeRatio),fields:this.fields&&this.fields.slice(0),field1:ye(this.field1),field2:ye(this.field2),isAutoGenerated:this.isAutoGenerated,focus:this.focus,numClasses:this.numClasses,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,lengthUnit:this.lengthUnit,statistics:this.statistics,standardDeviationInterval:this.standardDeviationInterval,type:this.type,visualVariables:this.visualVariables&&this.visualVariables.map(t=>t.clone()),univariateSymbolStyle:this.univariateSymbolStyle,univariateTheme:this.univariateTheme,flowTheme:this.flowTheme})}};h([f({type:rv.apiValues,value:null,json:{type:rv.jsonValues,read:rv.read,write:rv.write,origins:{"web-document":{default:"manual",type:rv.jsonValues,read:rv.read,write:rv.write}}}})],Gn.prototype,"classificationMethod",null),h([f({types:FSt,json:{write:!0}})],Gn.prototype,"colorRamp",void 0),h([lr("colorRamp")],Gn.prototype,"readColorRamp",null),h([f({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],Gn.prototype,"fadeRatio",void 0),h([f({type:[String],value:null,json:{write:!0}})],Gn.prototype,"fields",null),h([f({type:Uy,value:null,json:{write:!0}})],Gn.prototype,"field1",null),h([f({type:Uy,value:null,json:{write:!0}})],Gn.prototype,"field2",null),h([f({type:zSt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],Gn.prototype,"flowTheme",null),h([f({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],Gn.prototype,"focus",null),h([f({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],Gn.prototype,"isAutoGenerated",void 0),h([f({type:Number,value:null,json:{type:mn,write:!0}})],Gn.prototype,"numClasses",null),h([f({type:xpe,json:{type:xpe,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],Gn.prototype,"lengthUnit",void 0),h([f({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],Gn.prototype,"maxSliderValue",void 0),h([f({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],Gn.prototype,"minSliderValue",void 0),h([f({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],Gn.prototype,"statistics",null),h([f({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],Gn.prototype,"standardDeviationInterval",null),h([f({type:SL.apiValues,value:null,json:{type:SL.jsonValues,read:SL.read,write:SL.write,origins:{"web-scene":{type:wpe.jsonValues,write:{writer:wpe.write,overridePolicy:t=>({enabled:t!=="flow"})}}}}})],Gn.prototype,"type",null),h([f({type:[NSt],json:{write:!0}})],Gn.prototype,"visualVariables",void 0),h([f({type:BSt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],Gn.prototype,"univariateSymbolStyle",null),h([f({type:kSt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],Gn.prototype,"univariateTheme",null),Gn=cq=h([N("esri.renderers.support.AuthoringInfo")],Gn);const VSt=Gn,gB=new zn({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let AA=class extends ke{constructor(e){super(e),this.authoringInfo=null,this.type=null}async getRequiredFields(e){if(!this.collectRequiredFields)return[];const r=new Set;return await this.collectRequiredFields(r,e),Array.from(r).sort()}getSymbol(e,r){}async getSymbolAsync(e,r){}getSymbols(){return[]}getAttributeHash(){return JSON.stringify(this)}getMeshHash(){return JSON.stringify(this)}};h([f({type:VSt,json:{write:!0}})],AA.prototype,"authoringInfo",void 0),h([f({type:gB.apiValues,readOnly:!0,json:{type:gB.jsonValues,read:!1,write:{writer:gB.write,ignoreOrigin:!0}}})],AA.prototype,"type",void 0),AA=h([N("esri.renderers.Renderer")],AA);const GSt=AA;function jSt(t){var e,r;return((r=(e=t.match(HSt))==null?void 0:e[1])==null?void 0:r.replace(/\\'/g,"'"))??null}const HSt=/^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;var uq;let vN=uq=class extends ke{constructor(){super(...arguments),this.title=null}clone(){return new uq({title:this.title})}};h([f({type:String,json:{write:!0}})],vN.prototype,"title",void 0),vN=uq=h([N("esri.renderers.support.LegendOptions")],vN);var hq;let bN=hq=class extends vN{constructor(){super(...arguments),this.showLegend=null}clone(){return new hq({title:this.title,showLegend:this.showLegend})}};h([f({type:Boolean,json:{write:!0}})],bN.prototype,"showLegend",void 0),bN=hq=h([N("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],bN);const KMe=bN,yB=new zn({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let Cd=class extends ke{constructor(e){super(e),this.index=null,this.type=null,this.field=null,this.valueExpression=null,this.valueExpressionTitle=null,this.legendOptions=null}castField(e){return e==null?e:typeof e=="function"?(J.getLogger(this).error(".field: field must be a string value"),null):kge(e)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};h([f()],Cd.prototype,"index",void 0),h([f({type:yB.apiValues,readOnly:!0,json:{read:yB.read,write:yB.write}})],Cd.prototype,"type",void 0),h([f({type:String,json:{write:!0}})],Cd.prototype,"field",void 0),h([_i("field")],Cd.prototype,"castField",null),h([f({type:String,json:{write:!0}})],Cd.prototype,"valueExpression",void 0),h([f({type:String,json:{write:!0}})],Cd.prototype,"valueExpressionTitle",void 0),h([f({readOnly:!0})],Cd.prototype,"arcadeRequired",null),h([f({type:KMe,json:{write:!0}})],Cd.prototype,"legendOptions",void 0),Cd=h([N("esri.renderers.visualVariables.VisualVariable")],Cd);const uM=Cd;var dq;let Hv=dq=class extends ke{constructor(t){super(t),this.color=null,this.label=null,this.value=null}writeValue(t,e,r){e[r]=t??0}clone(){return new dq({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};h([f({type:it,json:{type:[mn],write:!0}})],Hv.prototype,"color",void 0),h([f({type:String,json:{write:!0}})],Hv.prototype,"label",void 0),h([f({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],Hv.prototype,"value",void 0),h([xr("value")],Hv.prototype,"writeValue",null),Hv=dq=h([N("esri.renderers.visualVariables.support.ColorStop")],Hv);const WSt=Hv;var pq;let Wv=pq=class extends uM{constructor(t){super(t),this.type="color",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(t){t&&Array.isArray(t)&&(t=t.filter(e=>!!e)).sort((e,r)=>e.value-r.value),this._set("stops",t)}clone(){return new pq({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(t=>t.clone()),legendOptions:this.legendOptions&&this.legendOptions.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(t=>t.value||0)}};h([f({readOnly:!0})],Wv.prototype,"cache",null),h([f({type:["color"],json:{type:["colorInfo"]}})],Wv.prototype,"type",void 0),h([f({type:String,json:{write:!0}})],Wv.prototype,"normalizationField",void 0),h([f({type:[WSt],json:{write:!0}})],Wv.prototype,"stops",null),Wv=pq=h([N("esri.renderers.visualVariables.ColorVariable")],Wv);const e$e=Wv;var fq;let Sy=fq=class extends ke{constructor(t){super(t),this.label=null,this.opacity=null,this.value=null}readOpacity(t,e){return fY(e.transparency)}writeOpacity(t,e,r){e[r]=pY(t)}clone(){return new fq({label:this.label,opacity:this.opacity,value:this.value})}};h([f({type:String,json:{write:!0}})],Sy.prototype,"label",void 0),h([f({type:Number,json:{type:mn,write:{target:"transparency"}}})],Sy.prototype,"opacity",void 0),h([lr("opacity",["transparency"])],Sy.prototype,"readOpacity",null),h([xr("opacity")],Sy.prototype,"writeOpacity",null),h([f({type:Number,json:{write:!0}})],Sy.prototype,"value",void 0),Sy=fq=h([N("esri.renderers.visualVariables.support.OpacityStop")],Sy);const qSt=Sy;var mq;let qv=mq=class extends uM{constructor(t){super(t),this.type="opacity",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(t){t&&Array.isArray(t)&&(t=t.filter(e=>!!e)).sort((e,r)=>e.value-r.value),this._set("stops",t)}clone(){return new mq({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(t=>t.clone()),legendOptions:this.legendOptions&&this.legendOptions.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(t=>t.value||0)}};h([f({readOnly:!0})],qv.prototype,"cache",null),h([f({type:["opacity"],json:{type:["transparencyInfo"]}})],qv.prototype,"type",void 0),h([f({type:String,json:{write:!0}})],qv.prototype,"normalizationField",void 0),h([f({type:[qSt],json:{write:!0}})],qv.prototype,"stops",null),qv=mq=h([N("esri.renderers.visualVariables.OpacityVariable")],qv);const t$e=qv;var gq;let Jm=gq=class extends uM{constructor(t){super(t),this.axis=null,this.type="rotation",this.rotationType="geographic",this.valueExpressionTitle=null}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}writeValueExpressionTitleWebScene(t,e,r,i){if(i&&i.messages){const n=`visualVariables[${this.index}]`;i.messages.push(new Y("property:unsupported",this.type+"VisualVariable.valueExpressionTitle is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:n+".valueExpressionTitle",context:i}))}}clone(){return new gq({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:this.legendOptions&&this.legendOptions.clone()})}};h([f({readOnly:!0})],Jm.prototype,"cache",null),h([f({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],Jm.prototype,"axis",void 0),h([f({type:["rotation"],json:{type:["rotationInfo"]}})],Jm.prototype,"type",void 0),h([f({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],Jm.prototype,"rotationType",void 0),h([f({type:String,json:{write:!0}})],Jm.prototype,"valueExpressionTitle",void 0),h([xr("web-scene","valueExpressionTitle")],Jm.prototype,"writeValueExpressionTitleWebScene",null),Jm=gq=h([N("esri.renderers.visualVariables.RotationVariable")],Jm);const r$e=Jm;var yq;let j2=yq=class extends ke{constructor(t){super(t),this.label=null,this.size=null,this.value=null}clone(){return new yq({label:this.label,size:this.size,value:this.value})}};h([f({type:String,json:{write:!0}})],j2.prototype,"label",void 0),h([f({type:Number,cast:gn,json:{write:!0}})],j2.prototype,"size",void 0),h([f({type:Number,json:{write:!0}})],j2.prototype,"value",void 0),j2=yq=h([N("esri.renderers.visualVariables.support.SizeStop")],j2);const XSt=j2;var _q;let wN=_q=class extends KMe{constructor(){super(...arguments),this.customValues=null}clone(){return new _q({title:this.title,showLegend:this.showLegend,customValues:this.customValues&&this.customValues.slice(0)})}};h([f({type:[Number],json:{write:!0}})],wN.prototype,"customValues",void 0),wN=_q=h([N("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],wN);const YSt=wN;var vq;const EL=new zn({width:"width",depth:"depth",height:"height",widthAndDepth:"width-and-depth",all:"all"}),bq=new zn({unknown:"unknown",inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers","decimal-degree":"decimal-degrees"});function Tpe(t){if(t!=null)return typeof t=="string"||typeof t=="number"?gn(t):t.type==="size"?gT(t)?t:(delete(t={...t}).type,new ii(t)):void 0}function Spe(t,e,r){if(typeof t!="object")return t;const i=new ii;return i.read(t,r),i}let ii=vq=class extends uM{constructor(t){super(t),this.axis=null,this.legendOptions=null,this.normalizationField=null,this.scaleBy=null,this.target=null,this.type="size",this.useSymbolValue=null,this.valueExpression=null,this.valueRepresentation=null,this.valueUnit=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null,isScaleDriven:this.valueExpression!=null&&fCe.test(this.valueExpression)}}set expression(t){J.getLogger(this).warn("'expression' is deprecated since version 4.2. Use 'valueExpression' instead. The only supported expression is 'view.scale'."),t==="view.scale"?(this.valueExpression="$view.scale",this._set("expression",t)):this._set("expression",null)}set index(t){gT(this.maxSize)&&(this.maxSize.index=`visualVariables[${t}].maxSize`),gT(this.minSize)&&(this.minSize.index=`visualVariables[${t}].minSize`),this._set("index",t)}get inputValueType(){return pCe(this)}set maxDataValue(t){t&&this.stops&&(J.getLogger(this).warn("cannot set maxDataValue when stops is not null."),t=null),this._set("maxDataValue",t)}set maxSize(t){t&&this.stops&&(J.getLogger(this).warn("cannot set maxSize when stops is not null."),t=null),this._set("maxSize",t)}castMaxSize(t){return Tpe(t)}readMaxSize(t,e,r){return Spe(t,e,r)}set minDataValue(t){t&&this.stops&&(J.getLogger(this).warn("cannot set minDataValue when stops is not null."),t=null),this._set("minDataValue",t)}set minSize(t){t&&this.stops&&(J.getLogger(this).warn("cannot set minSize when stops is not null."),t=null),this._set("minSize",t)}castMinSize(t){return Tpe(t)}readMinSize(t,e,r){return Spe(t,e,r)}get arcadeRequired(){return!!this.valueExpression||this.minSize!=null&&typeof this.minSize=="object"&&this.minSize.arcadeRequired||this.maxSize!=null&&typeof this.maxSize=="object"&&this.maxSize.arcadeRequired}set stops(t){this.minDataValue==null&&this.maxDataValue==null&&this.minSize==null&&this.maxSize==null?t&&Array.isArray(t)&&(t=t.filter(e=>!!e)).sort((e,r)=>e.value-r.value):t&&(J.getLogger(this).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),t=null),this._set("stops",t)}get transformationType(){return Ent(this,this.inputValueType)}readValueExpression(t,e){return t||e.expression&&"$view.scale"}writeValueExpressionWebScene(t,e,r,i){if(t==="$view.scale"){if(i&&i.messages){const n=this.index,s=typeof n=="string"?n:`visualVariables[${n}]`;i.messages.push(new Y("property:unsupported",this.type+"VisualVariable.valueExpression = '$view.scale' is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:s+".valueExpression",context:i}))}}else e[r]=t}readValueUnit(t){return t?bq.read(t):null}clone(){return new vq({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:gT(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:gT(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops&&this.stops.map(t=>t.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions&&this.legendOptions.clone()})}flipSizes(){if(this.transformationType===yo.ClampedLinear){const{minSize:t,maxSize:e}=this;return this.minSize=e,this.maxSize=t,this}if(this.transformationType===yo.Stops){const t=this.stops;if(!t)return this;const e=t.map(i=>i.size).reverse(),r=t.length;for(let i=0;it.value||0)}};h([f({readOnly:!0})],ii.prototype,"cache",null),h([f({type:EL.apiValues,json:{type:EL.jsonValues,origins:{"web-map":{read:!1}},read:EL.read,write:EL.write}})],ii.prototype,"axis",void 0),h([f({type:String,value:null,json:{read:!1}})],ii.prototype,"expression",null),h([f()],ii.prototype,"index",null),h([f({type:String,readOnly:!0})],ii.prototype,"inputValueType",null),h([f({type:YSt,json:{write:!0}})],ii.prototype,"legendOptions",void 0),h([f({type:Number,value:null,json:{write:!0}})],ii.prototype,"maxDataValue",null),h([f({type:Number,value:null,json:{write:!0}})],ii.prototype,"maxSize",null),h([_i("maxSize")],ii.prototype,"castMaxSize",null),h([lr("maxSize")],ii.prototype,"readMaxSize",null),h([f({type:Number,value:null,json:{write:!0}})],ii.prototype,"minDataValue",null),h([f({type:Number,value:null,json:{write:!0}})],ii.prototype,"minSize",null),h([_i("minSize")],ii.prototype,"castMinSize",null),h([lr("minSize")],ii.prototype,"readMinSize",null),h([f({type:String,json:{write:!0}})],ii.prototype,"normalizationField",void 0),h([f({readOnly:!0})],ii.prototype,"arcadeRequired",null),h([f({type:String})],ii.prototype,"scaleBy",void 0),h([f({type:[XSt],value:null,json:{write:!0}})],ii.prototype,"stops",null),h([f({type:["outline"],json:{write:!0}})],ii.prototype,"target",void 0),h([f({type:String,readOnly:!0})],ii.prototype,"transformationType",null),h([f({type:["size"],json:{type:["sizeInfo"]}})],ii.prototype,"type",void 0),h([f({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],ii.prototype,"useSymbolValue",void 0),h([f({type:String,json:{write:!0}})],ii.prototype,"valueExpression",void 0),h([lr("valueExpression",["valueExpression","expression"])],ii.prototype,"readValueExpression",null),h([xr("web-scene","valueExpression")],ii.prototype,"writeValueExpressionWebScene",null),h([f({type:["radius","diameter","area","width","distance"],json:{write:!0}})],ii.prototype,"valueRepresentation",void 0),h([f({type:bq.apiValues,json:{write:bq.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],ii.prototype,"valueUnit",void 0),h([lr("valueUnit")],ii.prototype,"readValueUnit",null),ii=vq=h([N("esri.renderers.visualVariables.SizeVariable")],ii);const i$e=ii,ZSt={color:e$e,size:i$e,opacity:t$e,rotation:r$e},QSt=new zn({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),JSt=/^\[([^\]]+)\]$/i;let xN=class extends xe{constructor(){super(...arguments),this.colorVariables=null,this.opacityVariables=null,this.rotationVariables=null,this.sizeVariables=null}set visualVariables(e){if(this._resetVariables(),(e=e&&e.filter(r=>!!r))&&e.length){for(const r of e)switch(r.type){case"color":this.colorVariables.push(r);break;case"opacity":this.opacityVariables.push(r);break;case"rotation":this.rotationVariables.push(r);break;case"size":this.sizeVariables.push(r)}this.sizeVariables.length&&this.sizeVariables.some(r=>!!r.target)&&e.sort((r,i)=>{let n=null;return n=r.target===i.target?0:r.target?1:-1,n});for(let r=0;r{const c=QSt.read(l.type),u=ZSt[c];u||(J.getLogger(this).warn(`Unknown variable type: ${c}`),i&&i.messages&&i.messages.push(new D_("visual-variable:unsupported",`visualVariable of type '${c}' is not supported`,{definition:l,context:i})));const d=new u;return d.read(l,i),d})}writeVariables(e,r){const i=[];for(const n of e){const s=n.toJSON(r);s&&i.push(s)}return i}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};h([f()],xN.prototype,"visualVariables",null),xN=h([N("esri.renderers.visualVariables.VisualVariableFactory")],xN);const KSt=xN,eEt={base:uM,key:"type",typeMap:{opacity:t$e,color:e$e,rotation:r$e,size:i$e}},tEt=t=>{let e=class extends t{constructor(){super(...arguments),this._vvFactory=new KSt}set visualVariables(r){this._vvFactory.visualVariables=r,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(r,i,n){return this._vvFactory.readVariables(r,i,n)}writeVisualVariables(r,i,n,s){i[n]=this._vvFactory.writeVariables(r,s)}get arcadeRequiredForVisualVariables(){if(!this.visualVariables)return!1;for(const r of this.visualVariables)if(r.arcadeRequired)return!0;return!1}hasVisualVariables(r,i){return r?this.getVisualVariablesForType(r,i).length>0:this.getVisualVariablesForType("size",i).length>0||this.getVisualVariablesForType("color",i).length>0||this.getVisualVariablesForType("opacity",i).length>0||this.getVisualVariablesForType("rotation",i).length>0}getVisualVariablesForType(r,i){const n=this.visualVariables;return n?n.filter(s=>s.type===r&&(typeof i=="string"?s.target===i:i!==!1||!s.target)):[]}async collectVVRequiredFields(r,i){let n=[];this.visualVariables&&(n=n.concat(this.visualVariables));for(const s of n)s&&(s.field&&rw(r,i,s.field),s.normalizationField&&rw(r,i,s.normalizationField),s.valueExpression&&(rEt(s.valueExpression,r,i)||await kg(r,i,s.valueExpression)))}};return h([f({types:[eEt],value:null,json:{write:!0}})],e.prototype,"visualVariables",null),h([lr("visualVariables",["visualVariables","rotationType","rotationExpression"])],e.prototype,"readVisualVariables",null),h([xr("visualVariables")],e.prototype,"writeVisualVariables",null),e=h([N("esri.renderers.mixins.VisualVariablesMixin")],e),e};function rEt(t,e,r){const i=jSt(t);return i!=null&&(rw(e,r,i),!0)}const iEt={types:Cze,json:{write:{writer:W5},origins:{"web-scene":{types:Hre,write:{writer:W5},read:{reader:PX({types:Hre})}}}}},F9t={types:{base:Rc,key:"type",typeMap:{"simple-fill":FT.typeMap["simple-fill"],"picture-fill":FT.typeMap["picture-fill"],"polygon-3d":FT.typeMap["polygon-3d"]}},json:{write:{writer:W5},origins:{"web-scene":{type:SP,write:{writer:W5}}}}},U9t={cast:t=>t==null||typeof t=="string"||typeof t=="number"?t:`${t}`,json:{type:String,write:{writer:(t,e)=>{e.value=t==null?void 0:t.toString()}}}};var wq;let Xv=wq=class extends tEt(GSt){constructor(t){super(t),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(t,e){await Promise.all([this.collectSymbolFields(t,e),this.collectVVRequiredFields(t,e)])}async collectSymbolFields(t,e){await Promise.all(this.getSymbols().map(r=>r.collectRequiredFields(t,e)))}getSymbol(t,e){return this.symbol}async getSymbolAsync(t,e){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((t,e)=>t+e.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((t,e)=>t+JSON.stringify(e),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new wq({description:this.description,label:this.label,symbol:this.symbol&&this.symbol.clone(),visualVariables:ye(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}};h([f({type:String,json:{write:!0}})],Xv.prototype,"description",void 0),h([f({type:String,json:{write:!0}})],Xv.prototype,"label",void 0),h([f(iEt)],Xv.prototype,"symbol",void 0),h([Vt({simple:"simple"})],Xv.prototype,"type",void 0),Xv=wq=h([N("esri.renderers.SimpleRenderer")],Xv);const nEt=Xv;function sEt(t,e){ai.useEffect(()=>{t!==void 0&&oEt(t)},[t,e])}function oEt(t){aEt(t),uEt(t),hEt(t)}function aEt(t){const e=t.map.allLayers.find(({title:r})=>r==="Buildings");e!==void 0&&(e.renderer=lEt())}const lEt=(t=Math.floor(Math.random()*365))=>new nEt({symbol:new vE({symbolLayers:[new Fw({material:{color:iq(t,100,90),colorMixMode:"replace"},edges:new qY({size:P_*.15,color:iq(t,100,90,.3)})})]})}),cEt=VF(Array.from({length:24},(t,e)=>e));function uEt(t){const e=new Date;e.setHours(cEt()),t.environment.lighting.date=e}function hEt(t){t.environment.weather=pEt()()}const dEt=[()=>new Q4({cloudCover:Math.random()}),()=>new Dwe({cloudCover:Math.random()}),()=>new Fwe({cloudCover:Math.random(),precipitation:Math.random()}),()=>new Uwe({cloudCover:Math.random(),precipitation:Math.random()}),()=>new Nwe({fogStrength:Math.min(Math.random(),.9)})],pEt=VF(dEt),n$e=t=>function({isPaused:r,board:i,nextShapes:n,score:s}){const o=ai.useMemo(()=>LSt(t),[t]),[a,l]=ai.useState(null),[c,u]=ai.useState(void 0);ai.useEffect(()=>{if(a===null)return;const y=new Wye({basemap:new iR({portalItem:{id:"0560e29930dc4d5ebeb58c635c0909c9"}})}),_=new cTt({container:a,map:y,environment:{lighting:{directShadowsEnabled:!0}},camera:o.initialCamera,qualityProfile:"high"});return _.ui.remove(_.ui.getComponents()),_.when(()=>{const v=_.map.allLayers.find(({title:b})=>b==="Places and Labels");v&&(v.visible=!1),u(_)}),()=>_.destroy()},[a,o]);const d=ai.useRef(s),p=d.current>s,m=ai.useRef(0);return p&&t==="stationary"&&(m.current+=1),d.current=s,ai.useEffect(()=>{c!==void 0&&(c.camera=o.initialCamera)},[c,o,m.current]),RSt(c,i,o,r),sEt(c,s),st.jsxs(st.Fragment,{children:[st.jsx("div",{className:"w-full h-full",ref:l}),st.jsx("div",{className:"absolute top-0 right-0 drop-shadow-[0_1px_2px_#000]",children:st.jsx(Jme,{score:s,nextShapes:n})})]})},fEt=n$e("animated"),mEt=n$e("stationary"),iS="bg-white hover:bg-gray-200 p-4 rounded text-black",gEt={[Ss.sceneryRenderer]:mEt,[Ss.panoramaRenderer]:fEt,[Ss.gridRenderer]:ZLe};function yEt({onSelect:t}){return st.jsxs("div",{className:"flex flex-col gap-8 h-full p-8",children:[st.jsx("span",{className:"flex-1"}),st.jsxs("div",{className:"flex flex-col gap-8",children:[st.jsx("h1",{className:"text-5xl",children:Ss.title}),st.jsx("div",{className:"flex gap-4",children:Object.entries(gEt).map(([e,r])=>st.jsx("button",{className:iS,type:"button",onClick:()=>t(r),children:e},e))})]}),st.jsx("div",{className:"flex-1 flex justify-end items-end text-end",children:st.jsxs("span",{children:[st.jsx("a",{href:"https://github.com/maxpatiiuk/tetris-react/",className:"text-blue-500",target:"_blank",rel:"noopener",children:Ss.sourceCode}),st.jsx("br",{}),Ss.inspiredBy(e=>st.jsx("a",{href:"https://youtu.be/PFVL6t8IHE8?si=qjVQxbNN9RQQmnud&t=21",className:"text-blue-500",target:"_blank",rel:"noopener",children:e})),st.jsx("br",{}),Ss.instructions]})})]})}function _Et({score:t,onRestart:e,onChangeMap:r}){const[i,n]=Qme(),s=ai.useRef(i).current;return ai.useEffect(()=>n(Math.max(i,t)),[t,i]),st.jsx("div",{className:"absolute inset-0 bg-black/70 flex items-center justify-center text-3xl text-center",children:st.jsxs("span",{className:"flex flex-col gap-4",children:[st.jsx("h1",{className:"pb-4 text-6xl",children:Ss.gameOver}),st.jsxs("h2",{children:[Ss.yourScore," ",t]}),st.jsxs("h2",{children:[Ss.yourBestScore," ",s]}),st.jsxs("div",{className:"flex gap-4",children:[st.jsx("button",{className:iS,type:"button",onClick:e,children:Ss.playAgain}),st.jsx("button",{className:iS,type:"button",onClick:r,children:Ss.changeMap})]})]})})}function vEt({onSave:t,onLoad:e,onChangeMap:r}){return st.jsx("div",{className:"absolute inset-0 flex items-center justify-center w-screen h-screen text-4xl text-center bg-black/70",children:st.jsxs("div",{className:"flex flex-col gap-8",children:[Ss.paused,st.jsx("span",{children:Ss.pressKeyToResume(st.jsx("span",{className:"rounded-xl p-px text-black bg-white",children:Ss.esc}))}),st.jsxs("div",{className:"flex gap-4",children:[st.jsx("button",{className:iS,type:"button",onClick:t,children:Ss.saveGame}),st.jsx("button",{className:iS,type:"button",onClick:e,children:Ss.loadGame}),st.jsx("button",{className:iS,type:"button",onClick:r,children:Ss.changeMap})]})]})})}const bEt=Object.values({1984:"1YjETQrefLDU6gUdVdjkxK","Starlight Infinite ":"3ICMKtmOim2EQWPGZQlJvm","Singularity X ":"3GR0kABoqo4yYwb0E7CRbt","Butterfly Effect ":"38TW4C6Ozqvpc93ay4E1xO","Butterfly Effect - Instrumental Mix":"63unOawz5mnIJLhTNdY0B2","Cycle of Silence ":"0y1KtxudTFGVauom0OAw4a","Awakening ":"0Axjc4z6NuEvnI33yfL2Jd","Midnight Sky (Moon Lounge Mix)":"3ObVJtrHe9m1pD0kQjFlnL","1989, Pt. 2":"2FPOAypb6OTKPcVmjs6Fg7",Deserve:"38us10664RE7LzKuP0fubG","Into the Darkness":"17GpTGIlK1wj9sTHkmEBVf",Roses:"1JtdpEnMkAlRHaqAFZWaiE","Midnight Sky":"35S2ehMIqht4nyMC9trphK",Pusher:"0e9Pc6OTaRYbLzAbQcjwD9","Mind Echoes":"3FJ9a6f0Q0onNzAsB1mbqc","Lion Garden":"2yikQFeZTqEVY3pwvOTdKE","All on You":"2zh9jc1IJtUeJoqxK70rki","Deep Dream":"7c9bKzkJ3VcNtmvbzYRFNC",Hope:"0gJ3TBmlm3uvbg7w1A47p3","Drowning Valley":"1bQGr0Yb814NklGQLwtJkz",Walls:"1ySshlSe4XTK8h9aV7cHlu","Two of Us":"1ebNrHTKWLTacblm1AKjKC","Connected (Yours Forever)":"0QpNG88fUtqBFv3jSPKFzH","World of Colors":"6s6wJWlQOrhutApxBjALcL","Like Never Before":"5rwd85f9zKqEqrLkJy21jl",Here:"5DysxV3wWy5BFDjLyKpwJR",Hometown:"1afYzACckpTdtIcd6a1jWE","'Aumakua":"0ES5svcsn175HeltIe3w2y",Chains:"53YBoGEL4eoqHaiDE2rdFG",Snows:"2mXWsRaFeA6MQk51lS4Wgc","3 Senses":"63wf92i45hD2svEtZFaMXi",Boscage:"6XtFtwIRnkUMnj6skKX0vF",Temptation:"70272Cf8IvttxP4k0dEcI5","New Beginnings":"0a2gqb08h29F854LOcodDi","You and I":"5gbll0kKGZ33zLxS4tP1Ah","Lunar Discourse":"1UguHfmcgaEvZcAXAbPsTI",Flames:"0M6lfckrMvgq8tJm9rAfBd","Spring Field":"5V79CYii3UmXypu0ARb8XF","Bright Shadow":"7Bk8zpZzbM3fKk5IEdxvaT",Joy:"6XJGtJDhnAZJkNUpEpzmRA","Next Chapter":"1ikwQqffDGOvNWZTC6VodQ","Connected (Yours Forever) [In-Game Mix]":"781SaJ3m5CzRWtx7yycM0e","Connected (Yours Forever) [Obvious Sky Mix]":"0SIGIMjkTPT4msCRdEAf8g","Always Been but Never Dreamed":"0T4pRzSKGRCtq7ZqA3RHdV","So They Say":"2oOB6hUcj70AekyncV54sE","World of Colors (In-Game Mix)":"3uc5T2QGpCtsVsFQ8J7Jlm","Look Up":"01YImcxm3FqgmFSTvDagLc",Unfold:"1FzV8n4LhHE06a2lopplyj"}),wEt=VF(bEt,1);function xEt(){return ai.useCallback(()=>`spotify:track:${wEt()}`,[])}const jK=document.createElement("script");jK.src="https://open.spotify.com/embed-podcast/iframe-api/v1";jK.async=!0;document.body.appendChild(jK);Object.defineProperty(window,"onSpotifyIframeApiReady",{configurable:!0,value:t=>{s$e=t,TN==null||TN(t)}});let TN,s$e;function TEt(){const[t,e]=ai.useState(null),[r,i]=ai.useState(s$e),[n,s]=ai.useState(void 0),o=xEt();return TN=i,ai.useEffect(()=>t===null||r===void 0?void 0:r.createController(document.createElement("div"),{uri:o(),theme:"dark"},a=>{t.append(a.iframeElement),a.play(),s(a)}),[t,r,o]),ai.useEffect(()=>{if(n===void 0)return;const a=n.on("playback_update",({data:{position:l,duration:c}})=>{l===0||l!==c||(n.loadUri(o()),n.play())});return()=>{a(),n==null||n.destroy()}},[n]),st.jsx("div",{ref:e,className:` + h-20 z-10 absolute top-0 left-0 w-[min(100%,25rem)] + [&>iframe]:h-full flex flex-row-reverse align-center bg-[#282828] + rounded-tl-none rounded-lg + `,children:st.jsx("button",{title:Ss.nextSong,"aria-label":Ss.nextSong,className:"w-12 h-full p-2 hover:brightness-75",onClick:()=>{n==null||n.loadUri(o()),n==null||n.play()},children:SEt})})}const SEt=st.jsx("svg",{fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:st.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8.688c0-.864.933-1.405 1.683-.977l7.108 4.062a1.125 1.125 0 010 1.953l-7.108 4.062A1.125 1.125 0 013 16.81V8.688zM12.75 8.688c0-.864.933-1.405 1.683-.977l7.108 4.062a1.125 1.125 0 010 1.953l-7.108 4.062a1.125 1.125 0 01-1.683-.977V8.688z"})});function EEt(){const[t,e]=ai.useState(),[r,i]=ai.useState(!1);return st.jsxs(st.Fragment,{children:[t===void 0?st.jsx(yEt,{onSelect:n=>{i(!0),e(()=>n)}}):st.jsx(CEt,{renderer:t,onChangeMap:()=>e(void 0)}),r&&st.jsx(TEt,{})]})}function CEt({renderer:t,onChangeMap:e}){const[r,i]=ai.useState();return st.jsxs(st.Fragment,{children:[st.jsx(AEt,{isGameOver:typeof r=="number",renderer:t,onGameOver:i,onChangeMap:e}),typeof r=="number"&&st.jsx(_Et,{score:r,onChangeMap:e,onRestart:()=>i(void 0)})]})}function AEt({renderer:t,isGameOver:e,onGameOver:r,onChangeMap:i}){const[n,s]=ai.useState(()=>Ay.initial(Array.from({length:5},UL))),o=ai.useRef(n);o.current=n;const[a,l]=YLe(),c=Object.keys(n.currentShapeLocation).length===0,u=ai.useRef(c),d=ai.useRef(0);return c&&!u.current&&(d.current+=1),u.current=c,ai.useEffect(()=>{if(e)return;function p(){const{isGameOver:y=!1,..._}=Ay.gravity(o.current,UL());y&&r(o.current.score),s(_)}p();const m=setInterval(p,ILe/Math.log(3+n.score/Xme));return()=>clearInterval(m)},[d.current,e]),ai.useEffect(()=>{if(e)return;s(Ay.initial(Array.from({length:5},UL))),document.addEventListener("keydown",p,{capture:!0});function p(T){T.key!==m&&clearTimeout(y),T.key in Epe?(_.add(T.key),m!==T.key&&(m=T.key,b()),T.preventDefault(),T.stopPropagation()):(m=void 0,T.key==="Escape"||T.key==="p"?s(Ay.togglePause(o.current)):T.key===" "&&s(Ay.hardDrop(o.current)))}let m,y;const _=new Set,v=100;function b(){m!==void 0&&(s(Ay.move(o.current,Epe[m])),m!=="ArrowUp"&&(y=setTimeout(b,v)))}document.addEventListener("keyup",x,{capture:!0});function x(T){_.delete(T.key),T.key===m&&(m=Array.from(_)[0],clearTimeout(y),b())}return()=>{m=void 0,document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("keyup",x,{capture:!0})}},[e]),st.jsxs("div",{className:"flex items-center justify-center w-screen h-screen text-white bg-black",children:[st.jsx(t,{board:n.board,nextShapes:n.nextShapes,score:n.score,isPaused:n.isPaused||e}),n.isPaused&&st.jsx(vEt,{onLoad:()=>s({...a,isPaused:!1}),onSave:()=>l(n),onChangeMap:i})]})}const Epe={ArrowUp:Nn.UP,ArrowDown:Nn.DOWN,ArrowLeft:Nn.LEFT,ArrowRight:Nn.RIGHT,w:Nn.UP,s:Nn.DOWN,a:Nn.LEFT,d:Nn.RIGHT,k:Nn.UP,j:Nn.DOWN,h:Nn.LEFT,l:Nn.RIGHT};_B.createRoot(document.getElementById("root")).render(st.jsx(ai.StrictMode,{children:st.jsx(EEt,{})}));export{Mtt as $,tPe as A,g1t as B,Lxe as C,I5 as D,oqe as E,iat as F,wot as G,Eot as H,OK as I,UJ as J,Ogt as K,Agt as L,tU as M,Rgt as N,U5 as O,_st as P,Z1t as Q,aPe as R,BHe as S,K1t as T,uPe as U,N_t as V,tvt as W,pPe as X,Jot as Y,oU as Z,VOe as _,Mxe as a,Ue as a$,pvt as a0,xvt as a1,Ivt as a2,Dvt as a3,Fvt as a4,iot as a5,fPe as a6,gvt as a7,ebt as a8,hct as a9,Hye as aA,Bg as aB,Dh as aC,O_ as aD,o0e as aE,ir as aF,ue as aG,Br as aH,qb as aI,ZH as aJ,z_ as aK,Ymt as aL,An as aM,hE as aN,yu as aO,ss as aP,mO as aQ,Age as aR,Za as aS,Ol as aT,d6 as aU,Hi as aV,dS as aW,LEt as aX,Eu as aY,Xn as aZ,E as a_,Fct as aa,vdt as ab,kdt as ac,Idt as ad,Df as ae,Vi as af,Pr as ag,Me as ah,h as ai,f as aj,a1 as ak,N as al,RY as am,pre as an,xe as ao,Fmt as ap,Fi as aq,Y as ar,Mw as as,kn as at,Nmt as au,JO as av,ce as aw,Bt as ax,lr as ay,CP as az,e2e as b,RCt as b$,KS as b0,bs as b1,BJ as b2,Hw as b3,Pt as b4,W0e as b5,s3t as b6,Ng as b7,D_ as b8,Mh as b9,$Y as bA,eE as bB,B3t as bC,xP as bD,up as bE,ha as bF,dY as bG,Qt as bH,ge as bI,A6 as bJ,Lw as bK,yw as bL,e1 as bM,Nt as bN,IEt as bO,fV as bP,ege as bQ,t_e as bR,tAt as bS,V3t as bT,UP as bU,SD as bV,FZ as bW,fRt as bX,xr as bY,Jr as bZ,a3t as b_,hRt as ba,NM as bb,St as bc,NBe as bd,xE as be,Ja as bf,nZ as bg,it as bh,n_ as bi,Uw as bj,EP as bk,wt as bl,pR as bm,Zn as bn,jLt as bo,HLt as bp,Ort as bq,Hg as br,eLt as bs,jNt as bt,I_ as bu,Q3t as bv,Xye as bw,_lt as bx,mge as by,J as bz,Xqe as c,$w as c$,sn as c0,_g as c1,H0e as c2,U4e as c3,vte as c4,s6 as c5,LCt as c6,ze as c7,m6 as c8,yP as c9,_rt as cA,pRt as cB,I9e as cC,s1e as cD,J3t as cE,lAt as cF,_9e as cG,I4 as cH,O4 as cI,W3t as cJ,K3t as cK,FV as cL,Js as cM,CBe as cN,Pw as cO,elt as cP,tlt as cQ,yje as cR,Wje as cS,uR as cT,_Rt as cU,XFt as cV,hK as cW,P6 as cX,t6 as cY,el as cZ,Qr as c_,Dr as ca,j4 as cb,TS as cc,YF as cd,h5e as ce,fo as cf,d5e as cg,p5e as ch,f5e as ci,Qa as cj,ke as ck,ye as cl,gft as cm,se as cn,ko as co,zn as cp,wrt as cq,OY as cr,oR as cs,CY as ct,Bn as cu,Wo as cv,PX as cw,Cze as cx,nEt as cy,Cu as cz,UXe as d,Sn as d$,bft as d0,b4e as d1,Vt as d2,VBe as d3,gbe as d4,Hge as d5,XF as d6,KY as d7,ES as d8,lR as d9,Ih as dA,Aye as dB,$Be as dC,Sb as dD,Yb as dE,SY as dF,TY as dG,Gye as dH,EY as dI,R3t as dJ,w3t as dK,H3t as dL,sUe as dM,vi as dN,Cs as dO,Xf as dP,ot as dQ,me as dR,ne as dS,O as dT,sR as dU,x4t as dV,dt as dW,D6 as dX,fR as dY,aP as dZ,OG as d_,yge as da,uu as db,hze as dc,KO as dd,dze as de,HPe as df,$At as dg,$Me as dh,xF as di,gSt as dj,Se as dk,nE as dl,m3t as dm,Uge as dn,A9t as dp,GMe as dq,b4t as dr,IFe as ds,Yr as dt,VL as du,lit as dv,ps as dw,OAt as dx,NLt as dy,jt as dz,XXe as e,Cb as e$,AG as e0,PG as e1,V4 as e2,Sve as e3,l3t as e4,$R as e5,MFe as e6,on as e7,CCe as e8,h0 as e9,ua as eA,L6e as eB,MLt as eC,Yit as eD,Vyt as eE,o3 as eF,$i as eG,zr as eH,X_ as eI,Sh as eJ,rn as eK,G4 as eL,SMt as eM,YM as eN,ize as eO,fP as eP,uTt as eQ,AFt as eR,hTt as eS,tR as eT,Rc as eU,C6 as eV,_Ot as eW,h0e as eX,fwe as eY,mn as eZ,S_ as e_,Gje as ea,ICt as eb,im as ec,Xb as ed,ep as ee,zEt as ef,J_t as eg,K_t as eh,H_t as ei,BUt as ej,aF as ek,X8t as el,t1t as em,IMe as en,t5e as eo,vrt as ep,hnt as eq,dnt as er,AY as es,uCe as et,PLt as eu,RLt as ev,sAt as ew,oAt as ex,rAt as ey,nAt as ez,Fit as f,ZIt as f$,s7 as f0,fTt as f1,kd as f2,iu as f3,_i as f4,pP as f5,Bkt as f6,Gkt as f7,zkt as f8,XPe as f9,_h as fA,Zg as fB,T5e as fC,iBe as fD,OCt as fE,YCt as fF,Zmt as fG,COt as fH,GF as fI,HGe as fJ,hre as fK,wr as fL,_Ct as fM,yCt as fN,Ok as fO,fY as fP,sw as fQ,pTt as fR,Frt as fS,gn as fT,kAt as fU,zAt as fV,T4t as fW,PFe as fX,YIt as fY,vEe as fZ,uJ as f_,i9t as fa,Txt as fb,Ykt as fc,yxt as fd,n9t as fe,kkt as ff,Qkt as fg,s9t as fh,Zkt as fi,OEt as fj,DFe as fk,KV as fl,e7 as fm,rY as fn,aDe as fo,o1 as fp,o3t as fq,pBe as fr,re as fs,De as ft,_e as fu,AX as fv,e4 as fw,VNt as fx,v8e as fy,qO as fz,aQ as g,_je as g$,QIt as g0,nu as g1,lp as g2,uMt as g3,f6 as g4,Ys as g5,Yi as g6,r6 as g7,Kr as g8,pa as g9,us as gA,_Y as gB,Dg as gC,Ww as gD,sLt as gE,nLt as gF,J_ as gG,wp as gH,qP as gI,zgt as gJ,Wwt as gK,MY as gL,Ud as gM,c7 as gN,e5e as gO,NIt as gP,iT as gQ,DG as gR,BIt as gS,Yoe as gT,p3t as gU,UIt as gV,wc as gW,zg as gX,dr as gY,_P as gZ,Xa as g_,Ug as ga,Oi as gb,Mkt as gc,i7 as gd,ma as ge,Mr as gf,Sit as gg,RRe as gh,wX as gi,xX as gj,hDe as gk,DEt as gl,t0 as gm,HX as gn,vQ as go,rQ as gp,y8t as gq,S8t as gr,_Q as gs,Ws as gt,te as gu,oe as gv,Bot as gw,as as gx,Tit as gy,hi as gz,Vqe as h,l4e as h$,pb as h0,ci as h1,vn as h2,bVe as h3,Xd as h4,_p as h5,Pb as h6,oOt as h7,AVe as h8,ki as h9,DCt as hA,M9t as hB,Ukt as hC,g3t as hD,VTt as hE,R9t as hF,P9t as hG,D as hH,le as hI,Ui as hJ,rr as hK,Hr as hL,qd as hM,_n as hN,Xe as hO,si as hP,Cft as hQ,$e as hR,m7e as hS,Wy as hT,Hn as hU,Pi as hV,To as hW,SQ as hX,Skt as hY,HEt as hZ,i4e as h_,PEt as ha,V4e as hb,gS as hc,GX as hd,iDe as he,Ir as hf,AW as hg,OW as hh,G3t as hi,j3t as hj,E8e as hk,S8e as hl,q6e as hm,rre as hn,nw as ho,iw as hp,EAt as hq,sc as hr,I3t as hs,$T as ht,Wf as hu,$2t as hv,OP as hw,gp as hx,XO as hy,UV as hz,wCe as i,$t as i$,gV as i0,h4e as i1,_u as i2,Ky as i3,NEt as i4,oCt as i5,q5t as i6,_ft as i7,BA as i8,SLt as i9,S8 as iA,Ft as iB,em as iC,r1 as iD,m1 as iE,A8 as iF,Fo as iG,IJ as iH,E8 as iI,DE as iJ,Gst as iK,XZ as iL,KQ as iM,wF as iN,nMt as iO,yp as iP,I8 as iQ,EOe as iR,Do as iS,y3t as iT,v2e as iU,Z5e as iV,yS as iW,jIt as iX,_7e as iY,N5 as iZ,Ri as i_,mr as ia,xc as ib,Cl as ic,w as id,fn as ie,xu as ig,Ye as ih,Ce as ii,$5 as ij,cm as ik,rt as il,_r as im,Cc as io,ve as ip,U as iq,ui as ir,Tr as is,vr as it,fr as iu,Ot as iv,u0 as iw,J6 as ix,f1 as iy,$l as iz,Sw as j,uut as j$,vh as j0,ae as j1,Hle as j2,yT as j3,Bo as j4,Zs as j5,dMt as j6,Ie as j7,AP as j8,In as j9,Oc as jA,VOt as jB,WBe as jC,a6 as jD,yY as jE,KU as jF,Kt as jG,zo as jH,ZY as jI,Pne as jJ,_Ae as jK,bAe as jL,LMe as jM,Ua as jN,vO as jO,Ub as jP,sAe as jQ,$ut as jR,xw as jS,bnt as jT,Qf as jU,dCe as jV,d3t as jW,xnt as jX,lut as jY,rut as jZ,iut as j_,nDe as ja,dRt as jb,Cwe as jc,mRt as jd,gRt as je,Tve as jf,qU as jg,Vre as jh,M3t as ji,SS as jj,RAt as jk,BEt as jl,RX as jm,ow as jn,mS as jo,GSt as jp,yRt as jq,Jkt as jr,S2t as js,jkt as jt,r9t as ju,t9t as jv,obt as jw,n0e as jx,FT as jy,pY as jz,s0t as k,tEt as k$,sut as k0,out as k1,pp as k2,nut as k3,ya as k4,cut as k5,DP as k6,s8 as k7,ds as k8,wnt as k9,wR as kA,Vo as kB,qs as kC,wf as kD,vAt as kE,iOt as kF,Q2e as kG,kw as kH,zh as kI,jy as kJ,Xi as kK,$ as kL,UCt as kM,uP as kN,PP as kO,kEt as kP,yft as kQ,mft as kR,g7e as kS,TCt as kT,Hf as kU,ILt as kV,$Lt as kW,KSe as kX,LIt as kY,Oye as kZ,iEt as k_,aut as ka,a8 as kb,kh as kc,d1 as kd,XT as ke,Ka as kf,Mx as kg,GIt as kh,eAt as ki,q3t as kj,Y3t as kk,X3t as kl,Z3t as km,aR as kn,rw as ko,aAt as kp,gEe as kq,JF as kr,Lg as ks,_te as kt,vW as ku,JAt as kv,T0e as kw,eOt as kx,KAt as ky,Tf as kz,Xnt as l,Lh as l$,kge as l0,BAt as l1,kg as l2,F9t as l3,vN as l4,U9t as l5,AAe as l6,bE as l7,ADe as l8,Eve as l9,Pkt as lA,ia as lB,_V as lC,Cje as lD,_R as lE,Bi as lF,$ve as lG,i7e as lH,yOt as lI,Jt as lJ,fu as lK,Et as lL,Gi as lM,p1 as lN,h1 as lO,h3t as lP,t4t as lQ,j0e as lR,c3t as lS,X0e as lT,es as lU,It as lV,f1e as lW,T9e as lX,L_ as lY,jCt as lZ,NV as l_,Af as la,ZNt as lb,aW as lc,rCt as ld,rpt as le,E4e as lf,TNt as lg,NNt as lh,xNt as li,bNt as lj,nT as lk,flt as ll,wNt as lm,Kkt as ln,T2t as lo,Xkt as lp,w2t as lq,Wkt as lr,qkt as ls,fMe as lt,e9t as lu,Vkt as lv,I2t as lw,e0 as lx,Abe as ly,qVe as lz,O0t as m,xo as m$,Ld as m0,er as m1,dc as m2,zZ as m3,kZ as m4,Lr as m5,dOt as m6,MVe as m7,uU as m8,cM as m9,or as mA,l6 as mB,L3t as mC,MCt as mD,nFe as mE,fe as mF,g8t as mG,v8t as mH,CAt as mI,Z9e as mJ,zv as mK,f8t as mL,h5 as mM,Wr as mN,PAt as mO,fIt as mP,nSe as mQ,Vr as mR,Mi as mS,FJ as mT,yr as mU,pu as mV,ZV as mW,pw as mX,t8 as mY,Pc as mZ,c0 as m_,qa as ma,HAt as mb,wOt as mc,nge as md,UX as me,PCt as mf,dP as mg,S4e as mh,i6 as mi,XCt as mj,rge as mk,y0e as ml,o6 as mm,ACt as mn,$te as mo,L1e as mp,Hkt as mq,Uh as mr,US as ms,$We as mt,JZ as mu,tVe as mv,Vw as mw,vHe as mx,lh as my,Ne as mz,GRe as n,va as n$,Qe as n0,Er as n1,Te as n2,fa as n3,gi as n4,E1e as n5,b8t as n6,w8t as n7,T8t as n8,YY as n9,Xoe as nA,FLt as nB,$3t as nC,ALt as nD,oCe as nE,lCe as nF,nCe as nG,eae as nH,Snt as nI,DIt as nJ,Bye as nK,K6e as nL,T3t as nM,tFe as nN,lFe as nO,cCe as nP,eY as nQ,JCt as nR,t3e as nS,dot as nT,Wa as nU,WSt as nV,wu as nW,k8 as nX,Lt as nY,Ml as nZ,Mc as n_,la as na,fVe as nb,x6 as nc,Le as nd,vp as ne,Ar as nf,gr as ng,bkt as nh,Eje as ni,N5t as nj,Cf as nk,RP as nl,Rye as nm,dEe as nn,eA as no,xbe as np,$kt as nq,i5 as nr,UAt as ns,i$e as nt,gT as nu,VSt as nv,XSt as nw,zA as nx,T_ as ny,DLt as nz,a1t as o,Wie as o$,Vh as o0,au as o1,aOt as o2,MP as o3,K6 as o4,fSe as o5,sOt as o6,Cet as o7,Dl as o8,yqe as o9,QS as oA,G_ as oB,gc as oC,HBe as oD,uOt as oE,hOt as oF,cw as oG,BV as oH,zf as oI,Lne as oJ,So as oK,fs as oL,CG as oM,VCt as oN,BCt as oO,lt as oP,qie as oQ,SX as oR,Mrt as oS,XIt as oT,Ac as oU,wZ as oV,yAt as oW,lOt as oX,J4 as oY,Cve as oZ,A3t as o_,bu as oa,MPt as ob,RPt as oc,PPt as od,dVe as oe,LT as of,stt as og,YS as oh,P6e as oi,lu as oj,Xrt as ok,aH as ol,nJ as om,_Ye as on,nVe as oo,rVe as op,pg as oq,mTt as or,vX as os,Au as ot,lYe as ou,$Ct as ov,e_ as ow,wo as ox,pOt as oy,Ive as oz,WRe as p,xkt as p$,am as p0,U6 as p1,dZ as p2,Nh as p3,fp as p4,jS as p5,vo as p6,C8 as p7,cSe as p8,wSe as p9,AS as pA,_At as pB,QQe as pC,SZ as pD,uve as pE,CS as pF,pbe as pG,QVe as pH,Gg as pI,j6 as pJ,bYe as pK,nOt as pL,Nne as pM,hMt as pN,hP as pO,zw as pP,oi as pQ,mOt as pR,Ec as pS,fS as pT,aBe as pU,Nf as pV,O1e as pW,lge as pX,pDe as pY,u3t as pZ,LZe as p_,Je as pa,eJ as pb,jd as pc,AAt as pd,bZ as pe,ple as pf,cMt as pg,vR as ph,g1e as pi,N_ as pj,cOt as pk,aU as pl,W4 as pm,Ust as pn,Ckt as po,qIt as pp,LS as pq,Okt as pr,Akt as ps,gP as pt,C3t as pu,Hie as pv,rf as pw,na as px,mR as py,TZ as pz,u1t as q,tCt as q$,FI as q0,TSe as q1,O_t as q2,iVe as q3,_8t as q4,FBe as q5,mhe as q6,eS as q7,sMt as q8,RS as q9,Ho as qA,uCt as qB,eu as qC,WIt as qD,NG as qE,zIt as qF,mit as qG,S6 as qH,Tpt as qI,hJ as qJ,$n as qK,Vpt as qL,g3e as qM,hAe as qN,N0e as qO,mbe as qP,XD as qQ,w4t as qR,PS as qS,OVe as qT,wg as qU,jJ as qV,z8 as qW,Gr as qX,D8t as qY,SCt as qZ,CX as q_,qBe as qa,Pn as qb,uOe as qc,_E as qd,zt as qe,mCe as qf,gCe as qg,tLt as qh,oht as qi,LC as qj,E6 as qk,SP as ql,vE as qm,Fw as qn,m1e as qo,xpt as qp,qit as qq,Hit as qr,pLt as qs,dLt as qt,jg as qu,zLt as qv,js as qw,Uo as qx,V5t as qy,PJ as qz,d1t as r,qe as r$,TR as r0,iLt as r1,kxe as r2,n_t as r3,x8t as r4,h_ as r5,_Ve as r6,ene as r7,ure as r8,Oft as r9,eO as rA,V6 as rB,Sbe as rC,fOt as rD,xHe as rE,Ert as rF,O3t as rG,UEt as rH,u6t as rI,E3t as rJ,HIt as rK,hc as rL,eCt as rM,jSt as rN,jot as rO,Hc as rP,pr as rQ,hs as rR,Un as rS,Ct as rT,yi as rU,No as rV,YQ as rW,Zf as rX,dIt as rY,At as rZ,Tt as r_,e6 as ra,Ht as rb,QSe as rc,JSe as rd,ZCt as re,$ce as rf,RW as rg,ld as rh,nF as ri,jFt as rj,sF as rk,lc as rl,uc as rm,$W as rn,PW as ro,IW as rp,MW as rq,Ice as rr,Zve as rs,Ywe as rt,_Z as ru,x4 as rv,fHe as rw,Hwe as rx,Qg as ry,k6 as rz,JRe as s,sht as s$,OLt as s0,FSt as s1,USt as s2,r$e as s3,zNt as s4,Dnt as s5,BNt as s6,yCe as s7,dCt as s8,JMe as s9,omt as sA,amt as sB,FA as sC,P8e as sD,Q9e as sE,ULt as sF,LLt as sG,Fze as sH,SG as sI,N9 as sJ,F9 as sK,MEt as sL,$Et as sM,ELt as sN,B_ as sO,Tye as sP,fRe as sQ,D0t as sR,hRe as sS,Y0t as sT,Cv as sU,xK as sV,wK as sW,Qce as sX,$0t as sY,Kce as sZ,olt as s_,ER as sa,QFe as sb,v4 as sc,c6 as sd,yrt as se,d1e as sf,HCt as sg,WCt as sh,qCt as si,RNe as sj,NFt as sk,HFt as sl,E3e as sm,ab as sn,Lce as so,DFt as sp,UFt as sq,ob as sr,IFt as ss,Iz as st,ZD as su,rm as sv,Pl as sw,Fh as sx,VEe as sy,uh as sz,YRe as t,IY as t$,KJ as t0,OAe as t1,eK as t2,RAe as t3,Kct as t4,uW as t5,$lt as t6,_3t as t7,vue as t8,fue as t9,$Nt as tA,INt as tB,Qae as tC,Kae as tD,Jae as tE,ONt as tF,RNt as tG,uue as tH,tue as tI,rue as tJ,iue as tK,Tue as tL,Zue as tM,Kue as tN,hue as tO,Que as tP,T6 as tQ,G3e as tR,LNt as tS,llt as tT,clt as tU,CNt as tV,ANt as tW,V3e as tX,ENt as tY,npt as tZ,ult as t_,Z6e as ta,mue as tb,Mue as tc,gue as td,P3t as te,xue as tf,kue as tg,zue as th,Bue as ti,x3t as tj,bY as tk,Cye as tl,v3t as tm,u8e as tn,t8e as to,b3t as tp,Vue as tq,S3t as tr,MAt as ts,SNt as tt,DNt as tu,Pue as tv,Lue as tw,MNt as tx,PNt as ty,ept as tz,Yxe as u,k_ as u0,f3 as u1,f9e as u2,p9e as u3,d9e as u4,n3t as u5,y9e as u6,o9t as u7,bOt as u8,bGe as u9,aft as uA,E_ as uB,SEe as uC,Zwe as uD,D3 as uE,DT as uF,qV as uG,tl as uH,pS as uI,TX as uJ,iRt as uK,pct as uL,_w as uM,B5e as uN,tOt as uO,JIt as uP,GLt as uQ,v4t as uR,E9t as uS,vGe as ua,UNt as ub,HF as uc,v9e as ud,ixt as ue,YDe as uf,L4 as ug,N4 as uh,aUe as ui,VEt as uj,iAt as uk,C9e as ul,A9e as um,Aie as un,GNt as uo,kNt as up,HY as uq,eTt as ur,Rkt as us,xOt as ut,cU as uu,GCt as uv,zCt as uw,kCt as ux,u6 as uy,mst as uz,AWe as v,Pxe as w,iqe as x,rO as y,f1t as z}; diff --git a/assets/index-a8e73b5e.css b/assets/index-a8e73b5e.css new file mode 100644 index 0000000..7e62c83 --- /dev/null +++ b/assets/index-a8e73b5e.css @@ -0,0 +1 @@ +@import"https://js.arcgis.com/4.27/@arcgis/core/assets/esri/themes/dark/main.css";*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.absolute{position:absolute}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.col-span-2{grid-column:span 2 / span 2}.flex{display:flex}.grid{display:grid}.h-20{height:5rem}.h-full{height:100%}.h-screen{height:100vh}.w-12{width:3rem}.w-\[min\(100\%\,25rem\)\]{width:min(100%,25rem)}.w-full{width:100%}.w-screen{width:100vw}.flex-1{flex:1 1 0%}.grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.rounded-tl-none{border-top-left-radius:0}.bg-\[\#282828\]{--tw-bg-opacity: 1;background-color:rgb(40 40 40 / var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-black\/70{background-color:#000000b3}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-gradient-to-tr{background-image:linear-gradient(to top right,var(--tw-gradient-stops))}.from-yellow-400{--tw-gradient-from: #facc15 var(--tw-gradient-from-position);--tw-gradient-to: rgb(250 204 21 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-purple-400{--tw-gradient-to: #c084fc var(--tw-gradient-to-position)}.p-2{padding:.5rem}.p-4{padding:1rem}.p-8{padding:2rem}.p-px{padding:1px}.pb-4{padding-bottom:1rem}.pt-2{padding-top:.5rem}.text-center{text-align:center}.text-end{text-align:end}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-6xl{font-size:3.75rem;line-height:1}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.drop-shadow-\[0_1px_2px_\#000\]{--tw-drop-shadow: drop-shadow(0 1px 2px #000);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.hover\:brightness-75:hover{--tw-brightness: brightness(.75);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.\[\&\>iframe\]\:h-full>iframe{height:100%} diff --git a/assets/it_IT2-20a2fdf5.js b/assets/it_IT2-20a2fdf5.js new file mode 100644 index 0000000..8c96335 --- /dev/null +++ b/assets/it_IT2-20a2fdf5.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - dd MMM",_date_hour:"HH:mm",_date_hour_full:"HH:mm - dd MMM",_date_day:"dd MMM",_date_day_full:"dd MMM",_date_week:"ww",_date_week_full:"dd MMM",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"HH:mm:ss SSS",_duration_millisecond_day:"d'g' mm:ss SSS",_duration_millisecond_week:"d'g' mm:ss SSS",_duration_millisecond_month:"M'm' dd'g' mm:ss SSS",_duration_millisecond_year:"y'a' MM'm' dd'g' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'g' hh:mm:ss",_duration_second_week:"d'g' hh:mm:ss",_duration_second_month:"M'm' dd'g' hh:mm:ss",_duration_second_year:"y'a' MM'm' dd'g' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'g' hh:mm",_duration_minute_week:"d'g' hh:mm",_duration_minute_month:"M'm' dd'g' hh:mm",_duration_minute_year:"y'a' MM'm' dd'g' hh:mm",_duration_hour:"hh'o'",_duration_hour_day:"d'g' hh'o'",_duration_hour_week:"d'g' hh'o'",_duration_hour_month:"M'm' dd'g' hh'o'",_duration_hour_year:"y'a' MM'm' dd'g' hh'o'",_duration_day:"d'g'",_duration_day_week:"d'g'",_duration_day_month:"M'm' dd'g'",_duration_day_year:"y'a' MM'm' dd'g'",_duration_week:"w's'",_duration_week_month:"w's'",_duration_week_year:"w's'",_duration_month:"M'm'",_duration_month_year:"y'a' MM'm'",_duration_year:"y'a'",_era_ad:"A.C.",_era_bc:"D.C.",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Gennaio",February:"Febbraio",March:"Marzo",April:"Aprile",May:"Maggio",June:"Giugno",July:"Luglio",August:"Agosto",September:"Settembre",October:"Ottobre",November:"Novembre",December:"Dicembre",Jan:"Gen",Feb:"Feb",Mar:"Mar",Apr:"Apr","May(short)":"Mag",Jun:"Giu",Jul:"Lug",Aug:"Ago",Sep:"Set",Oct:"Ott",Nov:"Nov",Dec:"Dic",Sunday:"Domenica",Monday:"Lunedì",Tuesday:"Martedì",Wednesday:"Mercoledì",Thursday:"Giovedì",Friday:"Venerdì",Saturday:"Sabato",Sun:"Dom",Mon:"Lun",Tue:"Mar",Wed:"Mer",Thu:"Gio",Fri:"Ven",Sat:"Sab",_dateOrd:function(e){return e+"°"},"Zoom Out":"Riduci zoom",Play:"Avvia",Stop:"Ferma",Legend:"Legenda","Press ENTER to toggle":"Clicca, tappa o premi ENTER per attivare",Loading:"Caricamento",Home:"Home",Chart:"Grafico","Serial chart":"Grafico combinato","X/Y chart":"Grafico X/Y","Pie chart":"Grafico a torta","Gauge chart":"Diagramma di livello","Radar chart":"Grafico radar","Sankey diagram":"Diagramma di Sankey","Flow diagram":"Diagramma di flusso","Chord diagram":"Diagramma a corda","TreeMap chart":"Mappa ad albero","Sliced chart":"Grafico a fette",Series:"Serie","Candlestick Series":"Serie a candele","OHLC Series":"Serie OHLC","Column Series":"Serie a colonne","Line Series":"Serie a linee","Pie Slice Series":"Serie a fetta di torta","Funnel Series":"Serie ad imbuto","Pyramid Series":"Serie a piramide","X/Y Series":"Serie X/Y",Map:"Mappa","Press ENTER to zoom in":"Premi ENTER per ingrandire","Press ENTER to zoom out":"Premi ENTER per ridurre","Use arrow keys to zoom in and out":"Usa le frecce per ingrandire e ridurre","Use plus and minus keys on your keyboard to zoom in and out":"Utilizza i tasti più e meno sulla tastiera per ingrandire e ridurre",Export:"Esporta",Image:"Immagine",Data:"Dati",Print:"Stampa","Press ENTER to open":"Clicca, tappa o premi ENTER per aprire","Press ENTER to print.":"Clicca, tappa o premi ENTER per stampare.","Press ENTER to export as %1.":"Clicca, tappa o premi ENTER per esportare come %1.","(Press ESC to close this message)":"(Premere ESC per chiudere questo messaggio)","Image Export Complete":"Esportazione immagine completata","Export operation took longer than expected. Something might have gone wrong.":"L'operazione di esportazione ha richiesto più tempo del previsto. Potrebbe esserci qualche problema.","Saved from":"Salvato da",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Utilizzare TAB per selezionare i punti di ancoraggio o i tasti freccia sinistra e destra per modificare la selezione","Use left and right arrows to move selection":"Utilizzare le frecce sinistra e destra per spostare la selezione","Use left and right arrows to move left selection":"Utilizzare frecce destra e sinistra per spostare la selezione sinistra","Use left and right arrows to move right selection":"Utilizzare frecce destra e sinistra per spostare la selezione destra","Use TAB select grip buttons or up and down arrows to change selection":"Utilizzare TAB per selezionare i punti di ancoraggio o premere le frecce su e giù per modificare la selezione","Use up and down arrows to move selection":"Utilizzare le frecce su e giù per spostare la selezione","Use up and down arrows to move lower selection":"Utilizzare le frecce su e giù per spostare la selezione inferiore","Use up and down arrows to move upper selection":"Utilizzare le frecce su e giù per spostare la selezione superiore","From %1 to %2":"Da %1 a %2","From %1":"Da %1","To %1":"a %1","No parser available for file: %1":"Nessun parser disponibile per il file: %1","Error parsing file: %1":"Errore durante l'analisi del file: %1","Unable to load file: %1":"Impossibile caricare il file: %1","Invalid date":"Data non valida"};export{a as default}; diff --git a/assets/ja_JP2-2f441bec.js b/assets/ja_JP2-2f441bec.js new file mode 100644 index 0000000..5f7dc77 --- /dev/null +++ b/assets/ja_JP2-2f441bec.js @@ -0,0 +1 @@ +const d={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"西暦",_era_bc:"紀元前",A:"午前",P:"午後",AM:"午前",PM:"午後","A.M.":"午前","P.M.":"午後",January:"1月",February:"2月",March:"3月",April:"4月",May:"5月",June:"6月",July:"7月",August:"8月",September:"9月",October:"10月",November:"11月",December:"12月",Jan:"1月",Feb:"2月",Mar:"3月",Apr:"4月","May(short)":"5月",Jun:"6月",Jul:"7月",Aug:"8月",Sep:"9月",Oct:"10月",Nov:"11月",Dec:"12月",Sunday:"日曜日",Monday:"月曜日",Tuesday:"火曜日",Wednesday:"水曜日",Thursday:"木曜日",Friday:"金曜日",Saturday:"土曜日",Sun:"日",Mon:"月",Tue:"火",Wed:"水",Thu:"木",Fri:"金",Sat:"土",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"ズーム",Play:"再生",Stop:"停止",Legend:"凡例","Press ENTER to toggle":"",Loading:"読み込んでいます",Home:"ホーム",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"印刷",Image:"イメージ",Data:"データ",Print:"印刷","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"始点 %1 終点 %2","From %1":"始点 %1","To %1":"終点 %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/assets/json-48e3ea08.js b/assets/json-48e3ea08.js new file mode 100644 index 0000000..14ab849 --- /dev/null +++ b/assets/json-48e3ea08.js @@ -0,0 +1 @@ +const Z={convertToGEGeometry:a,exportPoint:c,exportPolygon:m,exportPolyline:l,exportMultipoint:M,exportExtent:f};function a(i,t){return t==null?null:i.convertJSONToGeometry(t)}class r{constructor(t,s,n){this.x=t,this.y=s,this.spatialReference=n,this.z=void 0,this.m=void 0}}function c(i,t,s){const n=new r(i.getPointX(t),i.getPointY(t),s),e=i.hasZ(t),o=i.hasM(t);return e&&(n.z=i.getPointZ(t)),o&&(n.m=i.getPointM(t)),n}class x{constructor(t,s,n,e){this.rings=t,this.spatialReference=s,this.hasZ=void 0,this.hasM=void 0,n&&(this.hasZ=n),e&&(this.hasM=e)}}function m(i,t,s){return new x(i.exportPaths(t),s,i.hasZ(t),i.hasM(t))}class u{constructor(t,s,n,e){this.paths=t,this.spatialReference=s,this.hasZ=void 0,this.hasM=void 0,n&&(this.hasZ=n),e&&(this.hasM=e)}}function l(i,t,s){return new u(i.exportPaths(t),s,i.hasZ(t),i.hasM(t))}class v{constructor(t,s,n,e){this.points=t,this.spatialReference=s,this.hasZ=void 0,this.hasM=void 0,n&&(this.hasZ=n),e&&(this.hasM=e)}}function M(i,t,s){return new v(i.exportPoints(t),s,i.hasZ(t),i.hasM(t))}class p{constructor(t,s,n,e,o){this.xmin=t,this.ymin=s,this.xmax=n,this.ymax=e,this.spatialReference=o,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}function f(i,t,s){const n=i.hasZ(t),e=i.hasM(t),o=new p(i.getXMin(t),i.getYMin(t),i.getXMax(t),i.getYMax(t),s);if(n){const h=i.getZExtent(t);o.zmin=h.vmin,o.zmax=h.vmax}if(e){const h=i.getMExtent(t);o.mmin=h.vmin,o.mmax=h.vmax}return o}export{Z as t}; diff --git a/assets/jsonContext-5f3816dc.js b/assets/jsonContext-5f3816dc.js new file mode 100644 index 0000000..e40854b --- /dev/null +++ b/assets/jsonContext-5f3816dc.js @@ -0,0 +1 @@ +import{bf as r,b9 as e}from"./index-080e108a.js";function l(t){return{origin:"portal-item",url:r(t.itemUrl),portal:t.portal||e.getDefault(),portalItem:t,readResourcePaths:[]}}function a(t){return{origin:"portal-item",messages:[],writtenProperties:[],url:t.itemUrl?r(t.itemUrl):null,portal:t.portal||e.getDefault(),portalItem:t}}export{l as e,a as o}; diff --git a/assets/jsonUtils-f73b3833.js b/assets/jsonUtils-f73b3833.js new file mode 100644 index 0000000..0ce1d77 --- /dev/null +++ b/assets/jsonUtils-f73b3833.js @@ -0,0 +1 @@ +import{ai as t,aj as i,ck as b,bh as d,eZ as U,al as y,k$ as O,cl as n,l2 as S,bY as T,jp as m,f4 as Z,bz as A,l0 as K,bK as _,bg as C,d2 as N,cz as j,bu as Y,f5 as Q,bJ as H,ko as W,nv as X,fT as k,ow as ee,dZ as te,cy as F,cw as ie,b8 as se}from"./index-080e108a.js";import{A as M,w as q}from"./UniqueValueRenderer-fef4204d.js";import{DictionaryLoader as z}from"./DictionaryLoader-c0729336.js";import{c as re,i as oe,a as ne}from"./heatmapUtils-327ef4c5.js";var $;let w=$=class extends b{constructor(e){super(e),this.color=null,this.ratio=null}clone(){return new $({color:this.color,ratio:this.ratio})}};t([i({type:d,json:{type:[U],default:null,write:!0}})],w.prototype,"color",void 0),t([i({type:Number,json:{write:!0}})],w.prototype,"ratio",void 0),w=$=t([y("esri.renderers.support.HeatmapColorStop")],w);const f=w;var E;let u=E=class extends O(m){constructor(e){super(e),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){return new z(this.url,this.config,this.fieldMap)}writeData(e,s){e&&(s.scalingExpressionInfo={expression:e,returnType:"number"})}writeVisualVariables(e,s,r,a){a!=null&&a.origin||super.writeVisualVariables(e,s,r,a)}clone(){return new E({config:n(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:n(this.fieldMap),url:n(this.url),visualVariables:n(this.visualVariables)})}async getSymbolAsync(e,s){return this._loader.getSymbolAsync(e,s)}async collectRequiredFields(e,s){await this.collectVVRequiredFields(e,s),this.scaleExpression&&await S(e,s,this.scaleExpression);for(const r in this.fieldMap){const a=this.fieldMap[r];s.has(a)&&e.add(a)}}get arcadeRequired(){return!0}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,s)=>e+s.getAttributeHash(),"")}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._loader.getSymbolFields()}};t([i({type:z})],u.prototype,"_loader",null),t([i({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],u.prototype,"config",void 0),t([i({type:Object,json:{write:!0}})],u.prototype,"fieldMap",void 0),t([i({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],u.prototype,"scaleExpression",void 0),t([T("scaleExpression")],u.prototype,"writeData",null),t([i({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(e){return{enabled:!!e&&!!this.scaleExpression}}}}})],u.prototype,"scaleExpressionTitle",void 0),t([i({type:String,json:{write:!0}})],u.prototype,"url",void 0),t([T("visualVariables")],u.prototype,"writeVisualVariables",null),u=E=t([y("esri.renderers.DictionaryRenderer")],u);const le=u;var D;let h=D=class extends b{constructor(e){super(e),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(e){return e==null?e:typeof e=="function"?(A.getLogger(this).error(".field: field must be a string value"),null):K(e)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){return new D({color:this.color&&this.color.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};t([i({type:d,json:{type:[Number],write:!0}})],h.prototype,"color",void 0),t([i({type:String,json:{write:!0}})],h.prototype,"field",void 0),t([Z("field")],h.prototype,"castField",null),t([i({type:String,json:{write:!0}})],h.prototype,"label",void 0),t([i({type:String,json:{write:!0}})],h.prototype,"valueExpression",void 0),t([i({type:String,json:{write:!0}})],h.prototype,"valueExpressionTitle",void 0),h=D=t([y("esri.renderers.support.AttributeColorInfo")],h);const L=h;var I;let v=I=class extends b{constructor(){super(...arguments),this.unit=null}clone(){return new I({unit:this.unit})}};t([i({type:String,json:{write:!0}})],v.prototype,"unit",void 0),v=I=t([y("esri.renderers.support.DotDensityLegendOptions")],v);const ae=v;var V;let l=V=class extends O(m){constructor(e){super(e),this.attributes=null,this.backgroundColor=new d([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new _,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(e){if(this.referenceScale==null)return this.dotValue;const s=e/this.referenceScale*this.dotValue;return s<1?1:s}getSymbol(){return new C({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){var e;return((e=this.attributes)==null?void 0:e.reduce((s,r)=>s+r.getAttributeHash(),""))??""}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new V({attributes:n(this.attributes),backgroundColor:n(this.backgroundColor),dotBlendingEnabled:n(this.dotBlendingEnabled),dotShape:n(this.dotShape),dotSize:n(this.dotSize),dotValue:n(this.dotValue),legendOptions:n(this.legendOptions),outline:n(this.outline),referenceScale:n(this.referenceScale),visualVariables:n(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}getControllerHash(){var s;return`${(s=this.attributes)==null?void 0:s.map(r=>r.field||r.valueExpression||"")}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(e,s){await this.collectVVRequiredFields(e,s);for(const r of this.attributes??[])r.valueExpression&&await S(e,s,r.valueExpression),r.field&&e.add(r.field)}};t([i({type:[L],json:{write:!0}})],l.prototype,"attributes",void 0),t([i({type:d,json:{write:!0}})],l.prototype,"backgroundColor",void 0),t([i({type:Boolean,json:{write:!0}})],l.prototype,"dotBlendingEnabled",void 0),t([i({type:String,json:{write:!1}})],l.prototype,"dotShape",void 0),t([i({type:Number,json:{write:!0}})],l.prototype,"dotSize",void 0),t([i({type:ae,json:{write:!0}})],l.prototype,"legendOptions",void 0),t([i({type:_,json:{default:null,write:!0}})],l.prototype,"outline",void 0),t([i({type:Number,json:{write:!0}})],l.prototype,"dotValue",void 0),t([i({type:Number,json:{write:!0}})],l.prototype,"referenceScale",void 0),t([i({type:Number,json:{write:!0}})],l.prototype,"seed",void 0),t([N({dotDensity:"dot-density"})],l.prototype,"type",void 0),l=V=t([y("esri.renderers.DotDensityRenderer")],l);const pe=l;let g=class extends j(b){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};t([i({type:String,json:{write:!0}})],g.prototype,"minLabel",void 0),t([i({type:String,json:{write:!0}})],g.prototype,"maxLabel",void 0),t([i({type:String,json:{write:!0}})],g.prototype,"title",void 0),g=t([y("esri.renderers.support.HeatmapLegendOptions")],g);var P;const B="esri.renderers.HeatmapRenderer",ue=A.getLogger(B);function R(e){if(e!=null){const{maxDensity:s,minDensity:r,radius:a}=e;if(s!=null||r!=null||a!=null){const{blurRadius:ge,maxPixelIntensity:be,minPixelIntensity:me,...G}=e;return G}}return e}let o=P=class extends m{constructor(e){super(e),this.authoringInfo=null,this.colorStops=[new f({ratio:0,color:new d("rgba(255, 140, 0, 0)")}),new f({ratio:.75,color:new d("rgba(255, 140, 0, 1)")}),new f({ratio:.9,color:new d("rgba(255, 0, 0, 1)")})],this.field=null,this.fieldOffset=0,this.legendOptions=null,this.maxDensity=.04,this.minDensity=0,this.radius=18,this.referenceScale=0,this.type="heatmap",this.valueExpression=null,this.valueExpressionTitle=null,this._warnedProps={blurRadius:!1,maxPixelIntensity:!1,minPixelIntensity:!1}}normalizeCtorArgs(e){return R(e)}get blurRadius(){return re(this.radius)}set blurRadius(e){const s=this.maxPixelIntensity,r=this.minPixelIntensity;this._set("radius",oe(e)),this._warnAboutDeprecatedGaussianBlurProp("blurRadius","radius"),this._set("maxDensity",s*this._pixelIntensityToDensity),this._set("minDensity",r*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(e){this._set("maxDensity",e*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("maxPixelIntensity","maxDensity")}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(e){this._set("minDensity",e*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("minPixelIntensity","minDensity")}get _pixelIntensityToDensity(){return 24/(ne**2*this.blurRadius**4)}_warnAboutDeprecatedGaussianBlurProp(e,s){this._warnedProps[e]||Y(this).getDefaultOrigin()==="user"&&(this._warnedProps[e]=!0,Q(()=>{ee(ue,e,{replacement:`${String(s)} (suggested value: ${this._get(s)})`,version:"4.24"})}))}read(e,s){e=R(e),super.read(e,s)}getSymbol(){return new H}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(e,s){const r=this.field,a=this.valueExpression;r&&typeof r=="string"&&await W(e,s,r),a&&typeof a=="string"&&await S(e,s,a)}getAttributeHash(){return null}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new P({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:n(this.colorStops),field:this.field,legendOptions:n(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};t([i({type:X,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],o.prototype,"authoringInfo",void 0),t([i({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],o.prototype,"blurRadius",null),t([i({type:[f],json:{write:!0}})],o.prototype,"colorStops",void 0),t([i({type:String,json:{write:!0}})],o.prototype,"field",void 0),t([i({type:Number,json:{write:{overridePolicy:(e,s,r)=>({enabled:r==null})},origins:{"web-scene":{write:!1}}}})],o.prototype,"fieldOffset",void 0),t([i({type:g,json:{write:!0}})],o.prototype,"legendOptions",void 0),t([i({type:Number,json:{write:!0}})],o.prototype,"maxDensity",void 0),t([i({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],o.prototype,"maxPixelIntensity",null),t([i({type:Number,json:{write:!0}})],o.prototype,"minDensity",void 0),t([i({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],o.prototype,"minPixelIntensity",null),t([i({type:Number,cast:k,json:{write:!0}})],o.prototype,"radius",void 0),t([i({type:Number,range:{min:0},json:{default:0,write:!0}})],o.prototype,"referenceScale",void 0),t([N({heatmap:"heatmap"})],o.prototype,"type",void 0),t([i({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],o.prototype,"valueExpression",void 0),t([i({type:String})],o.prototype,"valueExpressionTitle",void 0),t([i({readOnly:!0})],o.prototype,"_pixelIntensityToDensity",null),o=P=t([y(B)],o);const J=o;let c=class extends j(b){constructor(){super(...arguments),this.color=new d([0,0,0,0]),this.label=null,this.threshold=0}};t([i({type:d,json:{write:!0}})],c.prototype,"color",void 0),t([i({type:String,json:{write:!0}})],c.prototype,"label",void 0),t([i({type:Number,range:{min:0,max:1},json:{write:!0}})],c.prototype,"threshold",void 0),c=t([y("esri.renderers.support.OthersCategory")],c);let x=class extends j(b){constructor(){super(...arguments),this.title=null}};t([i({type:String,json:{write:!0}})],x.prototype,"title",void 0),x=t([y("esri.renderers.support.PieChartLegendOptions")],x);let p=class extends O(j(m)){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new d([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new c,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart"}getSymbol(){var e;return new H({size:this.size?this.size/2+(((e=this.outline)==null?void 0:e.width)||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(te)}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,s)=>e+s.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((e,s)=>e+JSON.stringify(s),"")}async collectRequiredFields(e,s){await this.collectVVRequiredFields(e,s);for(const r of this.attributes)r.valueExpression&&await S(e,s,r.valueExpression),r.field&&e.add(r.field)}};t([i({type:[L],json:{write:!0}})],p.prototype,"attributes",void 0),t([i({type:C,json:{default:null,write:!0}})],p.prototype,"backgroundFillSymbol",void 0),t([i({type:d,json:{write:!0}})],p.prototype,"defaultColor",void 0),t([i({type:String,json:{write:!0}})],p.prototype,"defaultLabel",void 0),t([i({type:Number,range:{min:0,max:1},json:{write:!0}})],p.prototype,"holePercentage",void 0),t([i({type:c,json:{write:!0}})],p.prototype,"othersCategory",void 0),t([i({type:x,json:{write:!0}})],p.prototype,"legendOptions",void 0),t([i({type:_,json:{default:null,write:!0}})],p.prototype,"outline",void 0),t([i({type:Number,cast:k,json:{write:!0}})],p.prototype,"size",void 0),t([N({pieChart:"pie-chart"})],p.prototype,"type",void 0),p=t([y("esri.renderers.PieChartRenderer")],p);const de=p,ye={key:"type",base:m,typeMap:{heatmap:J,simple:F,"unique-value":M,"class-breaks":q,"dot-density":pe,dictionary:le,"pie-chart":de},errorContext:"renderer"},$e={key:"type",base:m,typeMap:{simple:F,"unique-value":M,"class-breaks":q,heatmap:J},errorContext:"renderer"};function Ee(e,s){return ce(e,null,s)}const he=ie({types:ye});function ce(e,s,r){return e?e&&(e.styleName||e.styleUrl)&&e.type!=="uniqueValue"?(r&&r.messages&&r.messages.push(new se("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):he(e,s,r):null}export{f as a,$e as n,ce as o,ye as p,Ee as t}; diff --git a/assets/ko_KR2-5290e5f8.js b/assets/ko_KR2-5290e5f8.js new file mode 100644 index 0000000..8078b11 --- /dev/null +++ b/assets/ko_KR2-5290e5f8.js @@ -0,0 +1 @@ +const d={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"AM",P:"PM",AM:"AM",PM:"PM","A.M.":"오전","P.M.":"오후",January:"1월",February:"2월",March:"3월",April:"4월",May:"5월",June:"6월",July:"7월",August:"8월",September:"9월",October:"10월",November:"11월",December:"12월",Jan:"1월",Feb:"2월",Mar:"3월",Apr:"4월","May(short)":"5월",Jun:"6월",Jul:"7월",Aug:"8월",Sep:"9월",Oct:"10월",Nov:"11월",Dec:"12월",Sunday:"일요일",Monday:"월요일",Tuesday:"화요일",Wednesday:"수요일",Thursday:"목요일",Friday:"금요일",Saturday:"토요일",Sun:"일",Mon:"월",Tue:"화",Wed:"수",Thu:"목",Fri:"금",Sat:"토",_dateOrd:function(e){let _="일";if(e<11||e>13)switch(e%10){case 1:case 2:case 3:_="일"}return _},"Zoom Out":"축소",Play:"시작",Stop:"정지",Legend:"범례","Press ENTER to toggle":"켜고 끄려면 클릭, 탭 혹은 엔터를 눌러주세요.",Loading:"불러오는 중",Home:"홈",Chart:"차트","Serial chart":"시리얼 차트","X/Y chart":"X/Y 차트","Pie chart":"파이 차트","Gauge chart":"게이지 차트","Radar chart":"레이더 차트","Sankey diagram":"생키 다이어그램","Flow diagram":"플로우 다이어그램","Chord diagram":"코드 다이어그램","TreeMap chart":"트리맵 차트","Force directed tree":"포스 디렉티드 트리","Sliced chart":"슬라이스 차트",Series:"시리즈","Candlestick Series":"캔들스틱 시리즈","OHLC Series":"OHLC 시리즈","Column Series":"컬럼 시리즈","Line Series":"라인 시리즈","Pie Slice Series":"파이 슬라이스 시리즈","Funnel Series":"퍼널 시리즈","Pyramid Series":"피라미드 시리즈","X/Y Series":"X/Y 시리즈",Map:"맵","Press ENTER to zoom in":"확대하려면 엔터를 누르세요.","Press ENTER to zoom out":"축소하려면 엔터를 누르세요.","Use arrow keys to zoom in and out":"확대 혹은 축소하려면 방향키를 이용하세요.","Use plus and minus keys on your keyboard to zoom in and out":"확대 혹은 축소하려면 키보드의 +/- 키를 이용하세요.",Export:"내보내기",Image:"이미지",Data:"데이터",Print:"인쇄","Press ENTER to open":"열려면, 클릭, 탭 또는 엔터를 누르세요.","Press ENTER to print.":"출력하려면, 클릭, 탭 또는 엔터를 누르세요.","Press ENTER to export as %1.":"%1(으)로 내보내려면 클릭, 탭 또는 엔터를 누르세요.","(Press ESC to close this message)":"(이 메시지를 끄려면 ESC를 누르세요.)","Image Export Complete":"이미지 내보내기 완료","Export operation took longer than expected. Something might have gone wrong.":"내보내기가 지연되고 있습니다. 문제가 없는지 확인이 필요합니다.","Saved from":"다음으로부터 저장됨: ",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"선택 범위를 변경하려면 선택 버튼이나 좌우 화살표를 이용하세요.","Use left and right arrows to move selection":"선택 범위를 움직이려면 좌우 화살표를 이용하세요.","Use left and right arrows to move left selection":"왼쪽 선택 범위를 움직이려면 좌우 화살표를 이용하세요.","Use left and right arrows to move right selection":"오른쪽 선택 범위를 움직이려면 좌우 화살표를 이용하세요.","Use TAB select grip buttons or up and down arrows to change selection":"선택 범위를 변경하려면 선택 버튼이나 상하 화살표를 이용하세요.","Use up and down arrows to move selection":"선택 범위를 움직이려면 상하 화살표를 이용하세요.","Use up and down arrows to move lower selection":"하단 선택 범위를 움직이려면 상하 화살표를 이용하세요.","Use up and down arrows to move upper selection":"상단 선택 범위를 움직이려면 상하 화살표를 이용하세요.","From %1 to %2":"%1 부터 %2 까지","From %1":"%1 부터","To %1":"%1 까지","No parser available for file: %1":"파일 파싱 불가능: %1","Error parsing file: %1":"파일 파싱 오류: %1","Unable to load file: %1":"파일 로드 불가능: %1","Invalid date":"날짜 올바르지 않음"};export{d as default}; diff --git a/assets/labelingInfo-144f3d9f.js b/assets/labelingInfo-144f3d9f.js new file mode 100644 index 0000000..c59204b --- /dev/null +++ b/assets/labelingInfo-144f3d9f.js @@ -0,0 +1 @@ +import{bz as a,cl as c,ar as f}from"./index-080e108a.js";import{C as u}from"./LabelClass-2d53c485.js";const l=a.getLogger("esri.layers.support.labelingInfo"),b=/\[([^\[\]]+)\]/gi;function $(t,e,o){return t?t.map(n=>{const r=new u;if(r.read(n,o),r.labelExpression){const i=e.fields||e.layerDefinition&&e.layerDefinition.fields||this.fields;r.labelExpression=r.labelExpression.replaceAll(b,(g,s)=>`[${p(s,i)}]`)}return r}):null}function p(t,e){if(!e)return t;const o=t.toLowerCase();for(let n=0;ny(n,e))?[]:o}function y(t,e){const o=t.labelPlacement,n=m[e];if(!t.symbol)return l.warn("No ILabelClass symbol specified."),!0;if(!n)return l.error(new f("labeling:unsupported-geometry-type",`Unable to create labels for layer, geometry type '${e}' is not supported`)),!0;if(!n.includes(o)){const r=n[0];o&&l.warn(`Found invalid label placement type ${o} for ${e}. Defaulting to ${r}`),t.labelPlacement=r}return!1}export{h as c,$ as i}; diff --git a/assets/layersCreator-738b2d23.js b/assets/layersCreator-738b2d23.js new file mode 100644 index 0000000..2980790 --- /dev/null +++ b/assets/layersCreator-738b2d23.js @@ -0,0 +1 @@ +import{fp as G,b5 as M,aF as A}from"./index-080e108a.js";import{a as L}from"./lazyLayerLoader-8b31b2e1.js";import{selectLayerClassPath as v}from"./portalLayers-54553513.js";import{t as b}from"./styleUtils-25825fd6.js";import"./layersLoader-0106cc6e.js";import"./fetchService-82a8c4d0.js";import"./jsonContext-5f3816dc.js";import"./portalItemUtils-792a27e1.js";function w(e){return S(e,"notes")}function h(e){return S(e,"markup")}function F(e){return S(e,"route")}function S(e,r){return!(!e.layerType||e.layerType!=="ArcGISFeatureLayer")&&e.featureCollectionType===r}async function W(e,r,y){if(!r)return;const t=[];for(const a of r){const i=U(a,y);a.layerType==="GroupLayer"?t.push(N(i,a,y)):t.push(i)}const n=await G(t);for(const a of n)a.value&&e.add(a.value)}const C={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},O={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},V={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",DefaultTileLayer:"TileLayer"},I={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},T={ArcGISFeatureLayer:"FeatureLayer"},m={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"},k={...I,LinkChartLayer:"LinkChartLayer"},B={...T},D={...m};async function U(e,r){return x(await R(e,r),e,r)}async function x(e,r,y){const t=new e;return t.read(r,y.context),t.type==="group"&&f(r)&&await J(t,r,y.context),await b(t,y.context),t}async function R(e,r){var o;const y=r.context,t=E(y);let n=e.layerType||e.type;!n&&r&&r.defaultLayerType&&(n=r.defaultLayerType);const a=t[n];let i=a?L[a]:L.UnknownLayer;if(g(e)){const c=y==null?void 0:y.portal;if(e.itemId){const l=new M({id:e.itemId,portal:c});await l.load();const s=(await v(l)).className||"UnknownLayer";i=L[s]}}else n==="ArcGISFeatureLayer"?w(e)||h(e)?i=L.MapNotesLayer:F(e)?i=L.RouteLayer:f(e)&&(i=L.GroupLayer):e.wmtsInfo&&e.wmtsInfo.url&&e.wmtsInfo.layerIdentifier?i=L.WMTSLayer:n==="WFS"&&((o=e.wfsInfo)==null?void 0:o.version)!=="2.0.0"&&(i=L.UnsupportedLayer);return i()}function f(e){var r,y;return e.layerType!=="ArcGISFeatureLayer"||g(e)?!1:(((y=(r=e.featureCollection)==null?void 0:r.layers)==null?void 0:y.length)??0)>1}function g(e){return e.type==="Feature Collection"}function E(e){let r;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":r=V;break;case"ground":r=O;break;default:r=C}break;case"link-chart":switch(e.layerContainerType){case"basemap":r=D;break;case"tables":r=B;break;default:r=k}break;default:switch(e.layerContainerType){case"basemap":r=m;break;case"tables":r=T;break;default:r=I}}return r}async function N(e,r,y){const t=new A,n=W(t,Array.isArray(r.layers)?r.layers:[],y);try{const a=await e;try{if(await n,a.type==="group")return a.layers.addMany(t),a}catch(i){a.destroy();for(const o of t)o.destroy();throw i}}catch(a){throw a}}async function J(e,r,y){var c;const t=L.FeatureLayer,n=await t(),a=r.featureCollection,i=a==null?void 0:a.showLegend,o=(c=a==null?void 0:a.layers)==null?void 0:c.map((l,s)=>{var d;const p=new n;p.read(l,y);const u={...y,ignoreDefaults:!0};return p.read({id:`${e.id}-sublayer-${s}`,visibility:((d=r.visibleLayers)==null?void 0:d.includes(s))??!0},u),i!=null&&p.read({showLegend:i},u),p});e.layers.addMany(o??[])}export{W as populateOperationalLayers}; diff --git a/assets/layersLoader-0106cc6e.js b/assets/layersLoader-0106cc6e.js new file mode 100644 index 0000000..187ebf1 --- /dev/null +++ b/assets/layersLoader-0106cc6e.js @@ -0,0 +1 @@ +import{ar as p,b9 as S,aA as d,b5 as T,ba as v}from"./index-080e108a.js";import{t as b,r as F}from"./fetchService-82a8c4d0.js";import{e as G}from"./jsonContext-5f3816dc.js";import{s as $}from"./portalItemUtils-792a27e1.js";import{t as D}from"./styleUtils-25825fd6.js";async function H(e,r){const t=e.instance.portalItem;if(t&&t.id)return await t.load(r),M(e),O(e,r)}function M(e){const r=e.instance.portalItem;if(!(r!=null&&r.type)||!e.supportedTypes.includes(r.type))throw new p("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:r==null?void 0:r.type,expectedType:e.supportedTypes.join(", ")})}async function O(e,r){const t=e.instance,a=t.portalItem;if(!a)return;const{url:n,title:l}=a,s=G(a);if(t.type==="group")return t.read({title:l},s),x(t,e);n&&t.read({url:n},s);const o=await g(e,r);return o&&t.read(o,s),t.resourceReferences={portalItem:a,paths:s.readResourcePaths??[]},t.type!=="subtype-group"&&t.read({title:l},s),D(t,s)}async function x(e,r){let t;const{portalItem:a}=e;if(!a)return;const n=a.type,l=r.layerModuleTypeMap,s=$(a,"Oriented Imagery Layer")??!1;switch(n){case"Feature Service":t=s?l.OrientedImageryLayer:l.FeatureLayer;break;case"Stream Service":t=l.StreamLayer;break;case"Scene Service":t=l.SceneLayer;break;case"Feature Collection":t=l.FeatureLayer;break;default:throw new p("portal:unsupported-item-type-as-group",`The item type '${n}' is not supported as a 'IGroupLayer'`)}let[o,i]=await Promise.all([t(),g(r)]),u=()=>o;if(n==="Feature Service"){if(i=a.url?await j(i,a.url):{},h(i).length){const w=l.SubtypeGroupLayer,I=await w();u=L=>L.layerType==="SubtypeGroupLayer"?I:o}return c(e,u,i,await J(a.url))}return y(i)>0?c(e,u,i):P(e,u)}async function P(e,r){var n,l;const{portalItem:t}=e;if(!(t!=null&&t.url))return;const a=await b(t.url);a&&c(e,r,{layers:(n=a.layers)==null?void 0:n.map(f),tables:(l=a.tables)==null?void 0:l.map(f)})}function f(e){return{id:e.id,name:e.name}}function c(e,r,t,a){var s;let n=t.layers||[];const l=t.tables||[];if(((s=e.portalItem)==null?void 0:s.type)==="Feature Collection"&&(n.forEach(o=>{var i;((i=o==null?void 0:o.layerDefinition)==null?void 0:i.type)==="Table"&&l.push(o)}),n=n.filter(o=>{var i;return((i=o==null?void 0:o.layerDefinition)==null?void 0:i.type)!=="Table"})),"coverage"in t){const o=N(t);o&&e.add(o)}n.reverse().forEach(o=>{const i=a==null?void 0:a(o);if(i||!a){const u=m(e,r(o),t,o,i);e.add(u)}}),l.reverse().forEach(o=>{const i=a==null?void 0:a(o);if(i||!a){const u=m(e,r(o),t,o,i);e.tables.add(u)}})}function m(e,r,t,a,n){const l=e.portalItem,s=new r({portalItem:l.clone(),layerId:a.id});if("sourceJSON"in s&&(s.sourceJSON=n),s.type!=="subtype-group"&&(s.sublayerTitleMode="service-name"),l.type==="Feature Collection"){const o={origin:"portal-item",portal:l.portal||S.getDefault()};s.read(a,o);const i=t.showLegend;i!=null&&s.read({showLegend:i},o)}return s}async function g(e,r){if(e.supportsData===!1)return;const t=e.instance,a=t.portalItem;if(!a)return;let n=null;try{n=await a.fetchData("json",r)}catch{}if(E(t)){let l=null,s=!0;if(n&&y(n)>0){if(t.layerId==null){const o=h(n);t.layerId=t.type==="subtype-group"?o==null?void 0:o[0]:k(n)}l=C(n,t),l&&(y(n)===1&&(s=!1),n.showLegend!=null&&(l.showLegend=n.showLegend))}return s&&"sublayerTitleMode"in t&&t.sublayerTitleMode!=="service-name"&&(t.sublayerTitleMode="item-title-and-service-name"),l}return n}async function j(e,r){if((e==null?void 0:e.layers)==null||(e==null?void 0:e.tables)==null){const t=await b(r);(e=e||{}).layers=e.layers||(t==null?void 0:t.layers),e.tables=e.tables||(t==null?void 0:t.tables)}return e}function k(e){const r=e.layers;if(r&&r.length)return r[0].id;const t=e.tables;return t&&t.length?t[0].id:null}function C(e,r){var n,l;const{layerId:t}=r,a=((n=e.layers)==null?void 0:n.find(s=>s.id===t))||((l=e.tables)==null?void 0:l.find(s=>s.id===t));return a&&A(a,r)?a:null}function y(e){var r,t;return(((r=e==null?void 0:e.layers)==null?void 0:r.length)??0)+(((t=e==null?void 0:e.tables)==null?void 0:t.length)??0)}function E(e){return e.type!=="stream"&&e.type!=="oriented-imagery"&&"layerId"in e}function N(e){const{coverage:r}=e;if(!r)return null;const t=new URL(r);if(r.toLowerCase().includes("item.html")){const a=t.searchParams.get("id"),n=t.origin;return d.fromPortalItem({portalItem:new T({id:a,url:n})})}if(v(r))return d.fromArcGISServerUrl({url:r});throw new p("portal:oriented-imagery-layer-coverage","the provided coverage url couldn't be loaded as a layer")}function h(e){var t;const r=[];return(t=e==null?void 0:e.layers)==null||t.forEach(a=>{a.layerType==="SubtypeGroupLayer"&&r.push(a.id)}),r}function A(e,r){return!(r.type==="feature"&&"layerType"in e&&e.layerType==="SubtypeGroupLayer"||r.type==="subtype-group"&&!("layerType"in e))}async function J(e){const{layersJSON:r}=await F(e);if(!r)return null;const t=[...r.layers,...r.tables];return a=>t.find(n=>n.id===a.id)}export{k as getFirstLayerOrTableId,y as getNumLayersAndTables,h as getSubtypeGroupLayerIds,H as load,j as preprocessFSItemData}; diff --git a/assets/lazyLayerLoader-8b31b2e1.js b/assets/lazyLayerLoader-8b31b2e1.js new file mode 100644 index 0000000..720ae8d --- /dev/null +++ b/assets/lazyLayerLoader-8b31b2e1.js @@ -0,0 +1 @@ +import{aw as a}from"./index-080e108a.js";const e={BingMapsLayer:async()=>(await a(()=>import("./BingMapsLayer-358d6de4.js"),["assets/BingMapsLayer-358d6de4.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/imageBitmapUtils-391f7b8f.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js"])).default,BuildingSceneLayer:async()=>(await a(()=>import("./BuildingSceneLayer-f39f2837.js"),["assets/BuildingSceneLayer-f39f2837.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/BuildingComponentSublayer-5d49e5f9.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/FeatureLayer-5c6d2c3b.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/AttachmentQuery-972bbd60.js","assets/Query-1c961d4c.js","assets/RelationshipQuery-39c07195.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/TopFeaturesQuery-e44d05be.js","assets/popupUtils-82ea8abb.js","assets/capabilities-5d185925.js","assets/I3SIndexInfo-445e6968.js","assets/I3SLayerDefinitions-ffdb3821.js","assets/I3SUtil-2c288808.js","assets/I3SBinaryReader-2b8e30f7.js","assets/popupUtils-f04ec9a9.js","assets/BuildingGroupSublayer-d6113346.js","assets/SceneService-6fea113d.js","assets/originUtils-1469eeaf.js","assets/multiOriginJSONSupportUtils-c978f4c3.js","assets/resourceUtils-b667b05b.js","assets/FetchAssociatedFeatureLayer-15c90b75.js"])).default,CSVLayer:async()=>(await a(()=>import("./CSVLayer-5ae17e31.js"),["assets/CSVLayer-5ae17e31.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/FeatureLayer-5c6d2c3b.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/AttachmentQuery-972bbd60.js","assets/Query-1c961d4c.js","assets/RelationshipQuery-39c07195.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/TopFeaturesQuery-e44d05be.js","assets/popupUtils-82ea8abb.js","assets/clientSideDefaults-ab04bd90.js","assets/QueryEngineCapabilities-42e44ded.js"])).default,DimensionLayer:async()=>(await a(()=>import("./DimensionLayer-56b346fa.js"),["assets/DimensionLayer-56b346fa.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/Analysis-932d2cd8.js","assets/LengthDimension-92faee98.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js"])).default,ElevationLayer:async()=>(await a(()=>import("./ElevationLayer-61bc2d81.js"),["assets/ElevationLayer-61bc2d81.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/ArcGISCachedService-344b6262.js","assets/TileInfoTilemapCache-b3f5dda7.js","assets/TilemapCache-67ada3c3.js","assets/ArcGISService-83287338.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js"])).default,FeatureLayer:async()=>(await a(()=>import("./FeatureLayer-5c6d2c3b.js"),["assets/FeatureLayer-5c6d2c3b.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/AttachmentQuery-972bbd60.js","assets/Query-1c961d4c.js","assets/RelationshipQuery-39c07195.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/TopFeaturesQuery-e44d05be.js","assets/popupUtils-82ea8abb.js"])).default,GeoJSONLayer:async()=>(await a(()=>import("./GeoJSONLayer-71b9768b.js"),["assets/GeoJSONLayer-71b9768b.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/clientSideDefaults-ab04bd90.js","assets/QueryEngineCapabilities-42e44ded.js","assets/defaultsJSON-59981e75.js","assets/FeatureSet-111cb247.js","assets/CustomParametersMixin-231c4be8.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/Query-1c961d4c.js","assets/FeatureReductionLayer-4262cf54.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/sql-734ecbc5.js","assets/AttachmentQuery-972bbd60.js","assets/RelationshipQuery-39c07195.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/popupUtils-82ea8abb.js"])).default,GeoRSSLayer:async()=>(await a(()=>import("./GeoRSSLayer-f82698fe.js"),["assets/GeoRSSLayer-f82698fe.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js"])).default,GroupLayer:async()=>(await a(()=>import("./GroupLayer-d83741dd.js"),["assets/GroupLayer-d83741dd.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js"])).default,ImageryLayer:async()=>(await a(()=>import("./ImageryLayer-4aa91771.js"),["assets/ImageryLayer-4aa91771.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/ImageHistogramParameters-84349e1d.js","assets/dataUtils-69946c3c.js","assets/colorUtils-c0f43caf.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/generateRendererUtils-1e52a587.js","assets/FeatureSet-111cb247.js","assets/commonProperties-30089b06.js","assets/FieldsIndex-f79a8f26.js","assets/imageBitmapUtils-391f7b8f.js","assets/Query-1c961d4c.js","assets/executeQueryJSON-7c41ada5.js","assets/query-93c6e211.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/AttachmentInfo-cb670dd0.js","assets/AttachmentQuery-972bbd60.js","assets/executeForIds-5eaf002d.js","assets/RelationshipQuery-39c07195.js","assets/TopFeaturesQuery-e44d05be.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/OperationalLayer-0e8f8b28.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/versionUtils-f17daa93.js","assets/popupUtils-82ea8abb.js"])).default,ImageryTileLayer:async()=>(await a(()=>import("./ImageryTileLayer-19c32ddc.js"),["assets/ImageryTileLayer-19c32ddc.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/ImageHistogramParameters-84349e1d.js","assets/dataUtils-69946c3c.js","assets/colorUtils-c0f43caf.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/generateRendererUtils-1e52a587.js","assets/FeatureSet-111cb247.js","assets/commonProperties-30089b06.js","assets/rasterProjectionHelper-072edec4.js","assets/utils-12672bd4.js","assets/OperationalLayer-0e8f8b28.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/TilemapCache-67ada3c3.js","assets/popupUtils-82ea8abb.js"])).default,IntegratedMeshLayer:async()=>(await a(()=>import("./IntegratedMeshLayer-cad83962.js"),["assets/IntegratedMeshLayer-cad83962.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/persistable-ca976a2c.js","assets/multiOriginJSONSupportUtils-c978f4c3.js","assets/resourceExtension-91e7c3ce.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/SceneService-6fea113d.js","assets/originUtils-1469eeaf.js","assets/I3SIndexInfo-445e6968.js","assets/resourceUtils-b667b05b.js","assets/I3SLayerDefinitions-ffdb3821.js","assets/SceneModification-2715f58a.js"])).default,KMLLayer:async()=>(await a(()=>import("./KMLLayer-1c6bcbfe.js"),["assets/KMLLayer-1c6bcbfe.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/jsonUtils-f73b3833.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/FeatureSet-111cb247.js"])).default,LineOfSightLayer:async()=>(await a(()=>import("./LineOfSightLayer-e674c03f.js"),["assets/LineOfSightLayer-e674c03f.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/Analysis-932d2cd8.js","assets/LineOfSightAnalysisTarget-7f5e80d1.js","assets/persistable-ca976a2c.js","assets/multiOriginJSONSupportUtils-c978f4c3.js","assets/resourceExtension-91e7c3ce.js","assets/elevationInfoUtils-4fd79d95.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js"])).default,LinkChartLayer:async()=>(await a(()=>import("./LinkChartLayer-fed775d8.js"),["assets/LinkChartLayer-fed775d8.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/geohashUtils-77d8429b.js","assets/sql-734ecbc5.js","assets/Query-1c961d4c.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/FeatureStore-f0e312fc.js","assets/BoundsStore-b6bd3c14.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/optimizedFeatureQueryEngineAdapter-58185a60.js","assets/centroid-8e8cfa47.js","assets/QueryEngine-19eda5ff.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/WhereClause-c86b9974.js","assets/executionError-c92d3b85.js","assets/json-48e3ea08.js","assets/QueryEngineCapabilities-42e44ded.js","assets/utils-2fe9d339.js","assets/generateRendererUtils-1e52a587.js","assets/clientSideDefaults-ab04bd90.js","assets/defaultsJSON-59981e75.js","assets/fieldProperties-62c55499.js","assets/FeatureReductionLayer-4262cf54.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/AttachmentQuery-972bbd60.js","assets/RelationshipQuery-39c07195.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/FeatureSet-111cb247.js","assets/popupUtils-82ea8abb.js"])).default,MapImageLayer:async()=>(await a(()=>import("./MapImageLayer-1956b83f.js"),["assets/MapImageLayer-1956b83f.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/APIKeyMixin-878a7aa7.js","assets/SublayersOwner-ee341b5e.js","assets/commonProperties-30089b06.js","assets/portalItemUtils-792a27e1.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/sql-734ecbc5.js","assets/QueryTask-6f808a9e.js","assets/Query-1c961d4c.js","assets/executeForIds-5eaf002d.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/executeQueryJSON-7c41ada5.js","assets/FeatureSet-111cb247.js","assets/executeQueryPBF-0f188593.js","assets/FeatureType-db96032c.js","assets/FeatureTemplate-2a7e96c1.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/labelingInfo-144f3d9f.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/AttachmentQuery-972bbd60.js","assets/popupUtils-82ea8abb.js","assets/sublayerUtils-1269bca6.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/OperationalLayer-0e8f8b28.js","assets/PortalLayer-310c2800.js","assets/TemporalLayer-f17c9161.js","assets/ExportImageParameters-649a2637.js","assets/floorFilterUtils-080a7cd2.js","assets/imageBitmapUtils-391f7b8f.js","assets/versionUtils-f17daa93.js"])).default,MapNotesLayer:async()=>(await a(()=>import("./MapNotesLayer-637d9bd1.js"),["assets/MapNotesLayer-637d9bd1.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/FeatureLayer-5c6d2c3b.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/AttachmentQuery-972bbd60.js","assets/Query-1c961d4c.js","assets/RelationshipQuery-39c07195.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/TopFeaturesQuery-e44d05be.js","assets/popupUtils-82ea8abb.js","assets/objectIdUtils-789e911a.js"])).default,MediaLayer:async()=>(await a(()=>import("./MediaLayer-be2aa899.js"),["assets/MediaLayer-be2aa899.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/resourceExtension-91e7c3ce.js","assets/BoundsStore-b6bd3c14.js","assets/PooledRBush-3cae7682.js","assets/quickselect-e80674f5.js","assets/MediaElementView-dc36bc9f.js","assets/normalizeUtilsSync-6be8435f.js","assets/normalizeUtilsCommon-500064b3.js"])).default,OGCFeatureLayer:async()=>(await a(()=>import("./OGCFeatureLayer-257da298.js"),["assets/OGCFeatureLayer-257da298.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/ogcFeatureUtils-1ccf1f8d.js","assets/geojson-077f67ec.js","assets/clientSideDefaults-ab04bd90.js","assets/QueryEngineCapabilities-42e44ded.js","assets/defaultsJSON-59981e75.js","assets/FeatureSet-111cb247.js","assets/APIKeyMixin-878a7aa7.js","assets/CustomParametersMixin-231c4be8.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/Query-1c961d4c.js","assets/FeatureReductionLayer-4262cf54.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/sql-734ecbc5.js","assets/AttachmentQuery-972bbd60.js","assets/RelationshipQuery-39c07195.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureType-db96032c.js","assets/FeatureTemplate-2a7e96c1.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/popupUtils-82ea8abb.js"])).default,OpenStreetMapLayer:async()=>(await a(()=>import("./OpenStreetMapLayer-3ecd3975.js"),["assets/OpenStreetMapLayer-3ecd3975.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/WebTileLayer-df8c0816.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/imageBitmapUtils-391f7b8f.js"])).default,OrientedImageryLayer:async()=>(await a(()=>import("./OrientedImageryLayer-2b6cc12d.js"),["assets/OrientedImageryLayer-2b6cc12d.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/FeatureLayer-5c6d2c3b.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/AttachmentQuery-972bbd60.js","assets/Query-1c961d4c.js","assets/RelationshipQuery-39c07195.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/FeatureReductionLayer-4262cf54.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/TopFeaturesQuery-e44d05be.js","assets/popupUtils-82ea8abb.js"])).default,PointCloudLayer:async()=>(await a(()=>import("./PointCloudLayer-b4103b13.js"),["assets/PointCloudLayer-b4103b13.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/SceneService-6fea113d.js","assets/originUtils-1469eeaf.js","assets/multiOriginJSONSupportUtils-c978f4c3.js","assets/I3SIndexInfo-445e6968.js","assets/resourceUtils-b667b05b.js","assets/fieldProperties-62c55499.js","assets/FieldsIndex-f79a8f26.js","assets/PointCloudUniqueValueRenderer-df78a172.js","assets/popupUtils-82ea8abb.js"])).default,RouteLayer:async()=>(await a(()=>import("./RouteLayer-fdf5da4e.js"),["assets/RouteLayer-fdf5da4e.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/originUtils-1469eeaf.js","assets/multiOriginJSONSupportUtils-c978f4c3.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/Stop-9d81fe58.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/FeatureSet-111cb247.js"])).default,SceneLayer:async()=>(await a(()=>import("./SceneLayer-fdf1363f.js"),["assets/SceneLayer-fdf1363f.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/EditBusLayer-d71787e9.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/SceneService-6fea113d.js","assets/originUtils-1469eeaf.js","assets/multiOriginJSONSupportUtils-c978f4c3.js","assets/I3SIndexInfo-445e6968.js","assets/resourceUtils-b667b05b.js","assets/capabilities-5d185925.js","assets/FeatureReductionLayer-4262cf54.js","assets/featureLayerUtils-6cf06f83.js","assets/sql-734ecbc5.js","assets/AttachmentQuery-972bbd60.js","assets/Query-1c961d4c.js","assets/RelationshipQuery-39c07195.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/FetchAssociatedFeatureLayer-15c90b75.js","assets/FeatureLayer-5c6d2c3b.js","assets/FeatureLayerBase-7c7dfccb.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/editsZScale-1b5a53a6.js","assets/queryZScale-8f9616ff.js","assets/FeatureSet-111cb247.js","assets/CustomParametersMixin-231c4be8.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/OrderedLayer-68067459.js","assets/TemporalLayer-f17c9161.js","assets/FeatureTemplate-2a7e96c1.js","assets/FeatureType-db96032c.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/versionUtils-f17daa93.js","assets/styleUtils-25825fd6.js","assets/TopFeaturesQuery-e44d05be.js","assets/popupUtils-82ea8abb.js","assets/I3SLayerDefinitions-ffdb3821.js","assets/persistable-ca976a2c.js","assets/resourceExtension-91e7c3ce.js","assets/I3SUtil-2c288808.js","assets/I3SBinaryReader-2b8e30f7.js","assets/popupUtils-f04ec9a9.js"])).default,StreamLayer:async()=>(await a(()=>import("./StreamLayer-bacc7345.js"),["assets/StreamLayer-bacc7345.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/Query-1c961d4c.js","assets/FeatureReductionLayer-4262cf54.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/sql-734ecbc5.js","assets/AttachmentQuery-972bbd60.js","assets/RelationshipQuery-39c07195.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/OperationalLayer-0e8f8b28.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/styleUtils-25825fd6.js","assets/popupUtils-82ea8abb.js"])).default,SubtypeGroupLayer:async()=>(await a(()=>import("./SubtypeGroupLayer-181166ae.js"),["assets/SubtypeGroupLayer-181166ae.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/sql-734ecbc5.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/EditBusLayer-d71787e9.js","assets/FeatureLayerBase-7c7dfccb.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/AttachmentQuery-972bbd60.js","assets/Query-1c961d4c.js","assets/RelationshipQuery-39c07195.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/OperationalLayer-0e8f8b28.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/fieldProperties-62c55499.js","assets/FieldsIndex-f79a8f26.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/heatmapUtils-327ef4c5.js","assets/FeatureTemplate-2a7e96c1.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/labelingInfo-144f3d9f.js","assets/popupUtils-82ea8abb.js","assets/versionUtils-f17daa93.js"])).default,TileLayer:async()=>(await a(()=>import("./TileLayer-30014b67.js"),["assets/TileLayer-30014b67.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISCachedService-344b6262.js","assets/TileInfoTilemapCache-b3f5dda7.js","assets/TilemapCache-67ada3c3.js","assets/SublayersOwner-ee341b5e.js","assets/commonProperties-30089b06.js","assets/portalItemUtils-792a27e1.js","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/sql-734ecbc5.js","assets/QueryTask-6f808a9e.js","assets/Query-1c961d4c.js","assets/executeForIds-5eaf002d.js","assets/query-93c6e211.js","assets/normalizeUtils-cf8b8053.js","assets/normalizeUtilsCommon-500064b3.js","assets/pbfQueryUtils-26a87215.js","assets/pbf-d9aa3914.js","assets/queryZScale-8f9616ff.js","assets/executeQueryJSON-7c41ada5.js","assets/FeatureSet-111cb247.js","assets/executeQueryPBF-0f188593.js","assets/FeatureType-db96032c.js","assets/FeatureTemplate-2a7e96c1.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/defaultsJSON-59981e75.js","assets/labelingInfo-144f3d9f.js","assets/serviceCapabilitiesUtils-959e798a.js","assets/AttachmentQuery-972bbd60.js","assets/popupUtils-82ea8abb.js","assets/sublayerUtils-1269bca6.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/OperationalLayer-0e8f8b28.js","assets/PortalLayer-310c2800.js","assets/imageBitmapUtils-391f7b8f.js"])).default,UnknownLayer:async()=>(await a(()=>import("./UnknownLayer-c61e7207.js"),["assets/UnknownLayer-c61e7207.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js"])).default,UnsupportedLayer:async()=>(await a(()=>import("./UnsupportedLayer-7b99a9d5.js"),["assets/UnsupportedLayer-7b99a9d5.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js"])).default,VectorTileLayer:async()=>(await a(()=>import("./VectorTileLayer-43018d94.js"),["assets/VectorTileLayer-43018d94.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISCachedService-344b6262.js","assets/TileInfoTilemapCache-b3f5dda7.js","assets/TilemapCache-67ada3c3.js","assets/ArcGISService-83287338.js","assets/CustomParametersMixin-231c4be8.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/jsonContext-5f3816dc.js","assets/StyleRepository-2362164f.js","assets/colorUtils-c0f43caf.js","assets/TileClipper-ae6eca9e.js","assets/definitions-0bc08d4c.js"])).default,VoxelLayer:async()=>(await a(()=>import("./VoxelLayer-b454e868.js"),["assets/VoxelLayer-b454e868.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/APIKeyMixin-878a7aa7.js","assets/ArcGISService-83287338.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/SceneService-6fea113d.js","assets/originUtils-1469eeaf.js","assets/multiOriginJSONSupportUtils-c978f4c3.js","assets/I3SIndexInfo-445e6968.js","assets/resourceUtils-b667b05b.js","assets/persistable-ca976a2c.js","assets/resourceExtension-91e7c3ce.js","assets/popupUtils-82ea8abb.js"])).default,WFSLayer:async()=>(await a(()=>import("./WFSLayer-c70988b2.js"),["assets/WFSLayer-c70988b2.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/UniqueValueRenderer-fef4204d.js","assets/diffUtils-590c9088.js","assets/jsonUtils-f73b3833.js","assets/DictionaryLoader-c0729336.js","assets/FieldsIndex-f79a8f26.js","assets/heatmapUtils-327ef4c5.js","assets/MultiOriginJSONSupport-e4912ffd.js","assets/clientSideDefaults-ab04bd90.js","assets/QueryEngineCapabilities-42e44ded.js","assets/defaultsJSON-59981e75.js","assets/wfsUtils-372b3e59.js","assets/geojson-077f67ec.js","assets/xmlUtils-444cb4c0.js","assets/FeatureSet-111cb247.js","assets/CustomParametersMixin-231c4be8.js","assets/FeatureEffectLayer-4160946c.js","assets/FeatureEffect-86735d98.js","assets/FeatureFilter-00f4be05.js","assets/Query-1c961d4c.js","assets/FeatureReductionLayer-4262cf54.js","assets/commonProperties-30089b06.js","assets/featureLayerUtils-6cf06f83.js","assets/sql-734ecbc5.js","assets/AttachmentQuery-972bbd60.js","assets/RelationshipQuery-39c07195.js","assets/LabelClass-2d53c485.js","assets/defaults-34554cbf.js","assets/OperationalLayer-0e8f8b28.js","assets/OrderedLayer-68067459.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/fieldProperties-62c55499.js","assets/labelingInfo-144f3d9f.js","assets/popupUtils-82ea8abb.js"])).default,WMSLayer:async()=>(await a(()=>import("./WMSLayer-a3157ab4.js"),["assets/WMSLayer-a3157ab4.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/TemporalLayer-f17c9161.js","assets/crsUtils-3bab3d8c.js","assets/ExportWMSImageParameters-d63354ac.js","assets/imageBitmapUtils-391f7b8f.js"])).default,WMTSLayer:async()=>(await a(()=>import("./WMTSLayer-d2e84f3b.js"),["assets/WMTSLayer-d2e84f3b.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/WebTileLayer-df8c0816.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/imageBitmapUtils-391f7b8f.js","assets/TileInfoTilemapCache-b3f5dda7.js","assets/crsUtils-3bab3d8c.js","assets/xmlUtils-444cb4c0.js"])).default,WebTileLayer:async()=>(await a(()=>import("./WebTileLayer-df8c0816.js").then(_=>_.W),["assets/WebTileLayer-df8c0816.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/MultiOriginJSONSupport-e4912ffd.js","assets/OperationalLayer-0e8f8b28.js","assets/commonProperties-30089b06.js","assets/PortalLayer-310c2800.js","assets/portalItemUtils-792a27e1.js","assets/imageBitmapUtils-391f7b8f.js"])).default};export{e as a}; diff --git a/assets/lclayout-caec6e62.js b/assets/lclayout-caec6e62.js new file mode 100644 index 0000000..f15f30d --- /dev/null +++ b/assets/lclayout-caec6e62.js @@ -0,0 +1,3 @@ +import{bU as Tr}from"./index-080e108a.js";function Cr(R,Y){for(var x=0;xi[M]})}}}return Object.freeze(Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}))}var Zt,N,$t,it={exports:{}};it.exports,Zt=it,it.exports,N=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(N=N||__filename),$t=function(R){var Y,x,i=(R=R||{})!==void 0?R:{};i.ready=new Promise(function(t,n){Y=t,x=n});var M,D,X,vt=Object.assign({},i),ot="./this.program",_t=typeof window=="object",z=typeof importScripts=="function",at=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",F="";function Qt(t){return i.locateFile?i.locateFile(t,F):F+t}if(at){var wt=require("fs"),ut=require("path");F=z?ut.dirname(F)+"/":__dirname+"/",M=(t,n)=>(t=$(t)?new URL(t):ut.normalize(t),wt.readFileSync(t,n?void 0:"utf8")),X=t=>{var n=M(t,!0);return n.buffer||(n=new Uint8Array(n)),n},D=(t,n,r)=>{t=$(t)?new URL(t):ut.normalize(t),wt.readFile(t,function(e,o){e?r(e):n(o.buffer)})},process.argv.length>1&&(ot=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(t){if(!(t instanceof hn))throw t}),process.on("unhandledRejection",function(t){throw t}),i.inspect=function(){return"[Emscripten Module object]"}}else(_t||z)&&(z?F=self.location.href:typeof document<"u"&&document.currentScript&&(F=document.currentScript.src),N&&(F=N),F=F.indexOf("blob:")!==0?F.substr(0,F.replace(/[?#].*/,"").lastIndexOf("/")+1):"",M=t=>{var n=new XMLHttpRequest;return n.open("GET",t,!1),n.send(null),n.responseText},z&&(X=t=>{var n=new XMLHttpRequest;return n.open("GET",t,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}),D=(t,n,r)=>{var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=()=>{e.status==200||e.status==0&&e.response?n(e.response):r()},e.onerror=r,e.send(null)});i.print||console.log.bind(console);var V,ct,B=i.printErr||console.warn.bind(console);Object.assign(i,vt),vt=null,i.arguments&&i.arguments,i.thisProgram&&(ot=i.thisProgram),i.quit&&i.quit,i.wasmBinary&&(V=i.wasmBinary),i.noExitRuntime,typeof WebAssembly!="object"&&Z("no native wasm support detected");var ft,P,_,k,J,h,g,bt,At,Tt,Ct=!1,Et=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function tn(t,n,r){for(var e=n+r,o=n;t[o]&&!(o>=e);)++o;if(o-n>16&&t.buffer&&Et)return Et.decode(t.subarray(n,o));for(var a="";n>10,56320|1023&p)}}else a+=String.fromCharCode((31&c)<<6|f)}else a+=String.fromCharCode(c)}return a}function st(t,n){return t?tn(_,t,n):""}function Ft(t,n,r,e){if(!(e>0))return 0;for(var o=r,a=r+e-1,c=0;c=55296&&f<=57343&&(f=65536+((1023&f)<<10)|1023&t.charCodeAt(++c)),f<=127){if(r>=a)break;n[r++]=f}else if(f<=2047){if(r+1>=a)break;n[r++]=192|f>>6,n[r++]=128|63&f}else if(f<=65535){if(r+2>=a)break;n[r++]=224|f>>12,n[r++]=128|f>>6&63,n[r++]=128|63&f}else{if(r+3>=a)break;n[r++]=240|f>>18,n[r++]=128|f>>12&63,n[r++]=128|f>>6&63,n[r++]=128|63&f}}return n[r]=0,r-o}function nn(t,n,r){return Ft(t,_,n,r)}function Pt(t){for(var n=0,r=0;r=55296&&e<=57343?(n+=4,++r):n+=3}return n}function St(t){ft=t,i.HEAP8=P=new Int8Array(t),i.HEAP16=k=new Int16Array(t),i.HEAP32=h=new Int32Array(t),i.HEAPU8=_=new Uint8Array(t),i.HEAPU16=J=new Uint16Array(t),i.HEAPU32=g=new Uint32Array(t),i.HEAPF32=bt=new Float32Array(t),i.HEAPF64=At=new Float64Array(t)}i.INITIAL_MEMORY;var Wt=[],Mt=[],jt=[];function rn(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)an(i.preRun.shift());lt(Wt)}function en(){lt(Mt)}function on(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)cn(i.postRun.shift());lt(jt)}function an(t){Wt.unshift(t)}function un(t){Mt.unshift(t)}function cn(t){jt.unshift(t)}var U=0,q=null;function fn(t){U++,i.monitorRunDependencies&&i.monitorRunDependencies(U)}function sn(t){if(U--,i.monitorRunDependencies&&i.monitorRunDependencies(U),U==0&&q){var n=q;q=null,n()}}function Z(t){i.onAbort&&i.onAbort(t),B(t="Aborted("+t+")"),Ct=!0,t+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(t);throw x(n),n}var w,ln="data:application/octet-stream;base64,";function Ot(t){return t.startsWith(ln)}function $(t){return t.startsWith("file://")}function Rt(t){try{if(t==w&&V)return new Uint8Array(V);if(X)return X(t);throw"both async and sync fetching of the wasm failed"}catch(n){Z(n)}}function pn(){if(!V&&(_t||z)){if(typeof fetch=="function"&&!$(w))return fetch(w,{credentials:"same-origin"}).then(function(t){if(!t.ok)throw"failed to load wasm binary file at '"+w+"'";return t.arrayBuffer()}).catch(function(){return Rt(w)});if(D)return new Promise(function(t,n){D(w,function(r){t(new Uint8Array(r))},n)})}return Promise.resolve().then(function(){return Rt(w)})}function dn(){var t={a:br};function n(a,c){var f=a.exports;i.asm=f,St((ct=i.asm.w).buffer),Tt=i.asm.y,un(i.asm.x),sn()}function r(a){n(a.instance)}function e(a){return pn().then(function(c){return WebAssembly.instantiate(c,t)}).then(function(c){return c}).then(a,function(c){B("failed to asynchronously prepare wasm: "+c),Z(c)})}function o(){return V||typeof WebAssembly.instantiateStreaming!="function"||Ot(w)||$(w)||at||typeof fetch!="function"?e(r):fetch(w,{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,t).then(r,function(c){return B("wasm streaming compile failed: "+c),B("falling back to ArrayBuffer instantiation"),e(r)})})}if(fn(),i.instantiateWasm)try{return i.instantiateWasm(t,n)}catch(a){B("Module.instantiateWasm callback failed with error: "+a),x(a)}return o().catch(x),{}}function hn(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function lt(t){for(;t.length>0;)t.shift()(i)}function mn(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(n){g[this.ptr+4>>2]=n},this.get_type=function(){return g[this.ptr+4>>2]},this.set_destructor=function(n){g[this.ptr+8>>2]=n},this.get_destructor=function(){return g[this.ptr+8>>2]},this.set_refcount=function(n){h[this.ptr>>2]=n},this.set_caught=function(n){n=n?1:0,P[this.ptr+12>>0]=n},this.get_caught=function(){return P[this.ptr+12>>0]!=0},this.set_rethrown=function(n){n=n?1:0,P[this.ptr+13>>0]=n},this.get_rethrown=function(){return P[this.ptr+13>>0]!=0},this.init=function(n,r){this.set_adjusted_ptr(0),this.set_type(n),this.set_destructor(r),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var n=h[this.ptr>>2];h[this.ptr>>2]=n+1},this.release_ref=function(){var n=h[this.ptr>>2];return h[this.ptr>>2]=n-1,n===1},this.set_adjusted_ptr=function(n){g[this.ptr+16>>2]=n},this.get_adjusted_ptr=function(){return g[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Xt(this.get_type()))return g[this.excPtr>>2];var n=this.get_adjusted_ptr();return n!==0?n:this.excPtr}}function yn(t,n,r){throw new mn(t).init(n,r),t}function gn(t,n,r,e,o){}function pt(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}function vn(){for(var t=new Array(256),n=0;n<256;++n)t[n]=String.fromCharCode(n);xt=t}Ot(w="lclayout.wasm")||(w=Qt(w));var xt=void 0;function b(t){for(var n="",r=t;_[r];)n+=xt[_[r++]];return n}var I={},H={},K={},_n=48,wn=57;function bn(t){if(t===void 0)return"_unknown";var n=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return n>=_n&&n<=wn?"_"+t:t}function An(t,n){return t=bn(t),function(){return n.apply(this,arguments)}}function dt(t,n){var r=An(n,function(e){this.name=n,this.message=e;var o=new Error(e).stack;o!==void 0&&(this.stack=this.toString()+` +`+o.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},r}var Dt=void 0;function A(t){throw new Dt(t)}var Ut=void 0;function kt(t){throw new Ut(t)}function It(t,n,r){function e(f){var s=r(f);s.length!==t.length&&kt("Mismatched type converter count");for(var p=0;p{H.hasOwnProperty(f)?o[s]=H[f]:(a.push(f),I.hasOwnProperty(f)||(I[f]=[]),I[f].push(()=>{o[s]=H[f],++c===a.length&&e(o)}))}),a.length===0&&e(o)}function j(t,n,r={}){if(!("argPackAdvance"in n))throw new TypeError("registerType registeredInstance requires argPackAdvance");var e=n.name;if(t||A('type "'+e+'" must have a positive integer typeid pointer'),H.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;A("Cannot register type '"+e+"' twice")}if(H[t]=n,delete K[t],I.hasOwnProperty(t)){var o=I[t];delete I[t],o.forEach(a=>a())}}function Tn(t,n,r,e,o){var a=pt(r);j(t,{name:n=b(n),fromWireType:function(c){return!!c},toWireType:function(c,f){return f?e:o},argPackAdvance:8,readValueFromPointer:function(c){var f;if(r===1)f=P;else if(r===2)f=k;else{if(r!==4)throw new TypeError("Unknown boolean type size: "+n);f=h}return this.fromWireType(f[c>>a])},destructorFunction:null})}function Cn(t,n,r){t=b(t),It([],[n],function(e){return e=e[0],i[t]=e.fromWireType(r),[]})}var ht=[],S=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function En(t){t>4&&--S[t].refcount==0&&(S[t]=void 0,ht.push(t))}function Fn(){for(var t=0,n=5;n(t||A("Cannot use deleted val. handle = "+t),S[t].value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var n=ht.length?ht.pop():S.length;return S[n]={refcount:1,value:t},n}}};function mt(t){return this.fromWireType(h[t>>2])}function Wn(t,n){j(t,{name:n=b(n),fromWireType:function(r){var e=Ht.toValue(r);return En(r),e},toWireType:function(r,e){return Ht.toHandle(e)},argPackAdvance:8,readValueFromPointer:mt,destructorFunction:null})}function Mn(t,n){switch(n){case 2:return function(r){return this.fromWireType(bt[r>>2])};case 3:return function(r){return this.fromWireType(At[r>>3])};default:throw new TypeError("Unknown float type: "+t)}}function jn(t,n,r){var e=pt(r);j(t,{name:n=b(n),fromWireType:function(o){return o},toWireType:function(o,a){return a},argPackAdvance:8,readValueFromPointer:Mn(n,e),destructorFunction:null})}function On(t){for(;t.length;){var n=t.pop();t.pop()(n)}}function Rn(t,n,r,e,o){var a=n.length;a<2&&A("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var c=n[1]!==null&&r!==null,f=!1,s=1;s>2]);return r}function kn(t,n,r){i.hasOwnProperty(t)||kt("Replacing nonexistant public symbol"),i[t].overloadTable!==void 0&&r!==void 0?i[t].overloadTable[r]=n:(i[t]=n,i[t].argCount=r)}function In(t,n,r){var e=i["dynCall_"+t];return r&&r.length?e.apply(null,[n].concat(r)):e.call(null,n)}var Q=[];function Yt(t){var n=Q[t];return n||(t>=Q.length&&(Q.length=t+1),Q[t]=n=Tt.get(t)),n}function Hn(t,n,r){return t.includes("j")?In(t,n,r):Yt(n).apply(null,r)}function Yn(t,n){var r=[];return function(){return r.length=0,Object.assign(r,arguments),Hn(t,n,r)}}function zn(t,n){function r(){return t.includes("j")?Yn(t,n):Yt(n)}t=b(t);var e=r();return typeof e!="function"&&A("unknown function pointer with signature "+t+": "+n),e}var zt=void 0;function Vn(t){var n=Nt(t),r=b(n);return O(n),r}function Bn(t,n){var r=[],e={};function o(a){e[a]||H[a]||(K[a]?K[a].forEach(o):(r.push(a),e[a]=!0))}throw n.forEach(o),new zt(t+": "+r.map(Vn).join([", "]))}function qn(t,n,r,e,o,a){var c=Un(n,r);t=b(t),o=zn(e,o),Dn(t,function(){Bn("Cannot call "+t+" due to unbound types",c)},n-1),It([],c,function(f){var s=[f[0],null].concat(f.slice(1));return kn(t,Rn(t,s,null,o,a),n-1),[]})}function Ln(t,n,r){switch(n){case 0:return r?function(e){return P[e]}:function(e){return _[e]};case 1:return r?function(e){return k[e>>1]}:function(e){return J[e>>1]};case 2:return r?function(e){return h[e>>2]}:function(e){return g[e>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function Gn(t,n,r,e,o){n=b(n);var a=pt(r),c=d=>d;if(e===0){var f=32-8*r;c=d=>d<>>f}var s=n.includes("unsigned"),p=(d,m)=>{};j(t,{name:n,fromWireType:c,toWireType:s?function(d,m){return p(m,this.name),m>>>0}:function(d,m){return p(m,this.name),m},argPackAdvance:8,readValueFromPointer:Ln(n,a,e!==0),destructorFunction:null})}function Nn(t,n,r){var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][n];function o(a){var c=g,f=c[a>>=2],s=c[a+1];return new e(ft,s,f)}j(t,{name:r=b(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}function Xn(t,n){var r=(n=b(n))==="std::string";j(t,{name:n,fromWireType:function(e){var o,a=g[e>>2],c=e+4;if(r)for(var f=c,s=0;s<=a;++s){var p=c+s;if(s==a||_[p]==0){var d=st(f,p-f);o===void 0?o=d:(o+=String.fromCharCode(0),o+=d),f=p+1}}else{var m=new Array(a);for(s=0;s>2]=a,r&&c)nn(o,s,a+1);else if(c)for(var p=0;p255&&(O(s),A("String has UTF-16 code units that do not fit in 8 bits")),_[s+p]=d}else for(p=0;p>1,o=e+n/2;!(e>=o)&&J[e];)++e;if((r=e<<1)-t>32&&Vt)return Vt.decode(_.subarray(t,r));for(var a="",c=0;!(c>=n/2);++c){var f=k[t+2*c>>1];if(f==0)break;a+=String.fromCharCode(f)}return a}function Zn(t,n,r){if(r===void 0&&(r=2147483647),r<2)return 0;for(var e=n,o=(r-=2)<2*t.length?r/2:t.length,a=0;a>1]=c,n+=2}return k[n>>1]=0,n-e}function $n(t){return 2*t.length}function Kn(t,n){for(var r=0,e="";!(r>=n/4);){var o=h[t+4*r>>2];if(o==0)break;if(++r,o>=65536){var a=o-65536;e+=String.fromCharCode(55296|a>>10,56320|1023&a)}else e+=String.fromCharCode(o)}return e}function Qn(t,n,r){if(r===void 0&&(r=2147483647),r<4)return 0;for(var e=n,o=e+r-4,a=0;a=55296&&c<=57343&&(c=65536+((1023&c)<<10)|1023&t.charCodeAt(++a)),h[n>>2]=c,(n+=4)+4>o)break}return h[n>>2]=0,n-e}function tr(t){for(var n=0,r=0;r=55296&&e<=57343&&++r,n+=4}return n}function nr(t,n,r){var e,o,a,c,f;r=b(r),n===2?(e=Jn,o=Zn,c=$n,a=()=>J,f=1):n===4&&(e=Kn,o=Qn,c=tr,a=()=>g,f=2),j(t,{name:r,fromWireType:function(s){for(var p,d=g[s>>2],m=a(),y=s+4,T=0;T<=d;++T){var W=s+4+T*n;if(T==d||m[W>>f]==0){var C=e(y,W-y);p===void 0?p=C:(p+=String.fromCharCode(0),p+=C),y=W+n}}return O(s),p},toWireType:function(s,p){typeof p!="string"&&A("Cannot pass non-string to C++ string type "+r);var d=c(p),m=gt(4+d+n);return g[m>>2]=d>>f,o(p,m+4,d+n),s!==null&&s.push(O,m),m},argPackAdvance:8,readValueFromPointer:mt,destructorFunction:function(s){O(s)}})}function rr(t,n){j(t,{isVoid:!0,name:n=b(n),argPackAdvance:0,fromWireType:function(){},toWireType:function(r,e){}})}var Bt,er=!0;function ir(){return er}function or(){Z("")}function ar(){return Date.now()}function qt(){return 2147483648}function ur(){return qt()}function cr(t,n,r){_.copyWithin(t,n,n+r)}function fr(t){try{return ct.grow(t-ft.byteLength+65535>>>16),St(ct.buffer),1}catch{}}function sr(t){var n=_.length;t>>>=0;var r=qt();if(t>r)return!1;let e=(c,f)=>c+(f-c%f)%f;for(var o=1;o<=4;o*=2){var a=n*(1+.2/o);if(a=Math.min(a,t+100663296),fr(Math.min(r,e(Math.max(t,a),65536))))return!0}return!1}Bt=at?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now();var yt={};function lr(){return ot||"./this.program"}function L(){if(!L.strings){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:lr()};for(var n in yt)yt[n]===void 0?delete t[n]:t[n]=yt[n];var r=[];for(var n in t)r.push(n+"="+t[n]);L.strings=r}return L.strings}function pr(t,n,r){for(var e=0;e>0]=t.charCodeAt(e);r||(P[n>>0]=0)}function dr(t,n){var r=0;return L().forEach(function(e,o){var a=n+r;g[t+4*o>>2]=a,pr(e,a),r+=e.length+1}),0}function hr(t,n){var r=L();g[t>>2]=r.length;var e=0;return r.forEach(function(o){e+=o.length+1}),g[n>>2]=e,0}function tt(t){return t%4==0&&(t%100!=0||t%400==0)}function mr(t,n){for(var r=0,e=0;e<=n;r+=t[e++]);return r}var Lt=[31,29,31,30,31,30,31,31,30,31,30,31],Gt=[31,28,31,30,31,30,31,31,30,31,30,31];function yr(t,n){for(var r=new Date(t.getTime());n>0;){var e=tt(r.getFullYear()),o=r.getMonth(),a=(e?Lt:Gt)[o];if(!(n>a-r.getDate()))return r.setDate(r.getDate()+n),r;n-=a-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}function gr(t,n,r){var e=r>0?r:Pt(t)+1,o=new Array(e),a=Ft(t,o,0,o.length);return n&&(o.length=a),o}function vr(t,n){P.set(t,n)}function _r(t,n,r,e){var o=h[e+40>>2],a={tm_sec:h[e>>2],tm_min:h[e+4>>2],tm_hour:h[e+8>>2],tm_mday:h[e+12>>2],tm_mon:h[e+16>>2],tm_year:h[e+20>>2],tm_wday:h[e+24>>2],tm_yday:h[e+28>>2],tm_isdst:h[e+32>>2],tm_gmtoff:h[e+36>>2],tm_zone:o?st(o):""},c=st(r),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var s in f)c=c.replace(new RegExp(s,"g"),f[s]);var p=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],d=["January","February","March","April","May","June","July","August","September","October","November","December"];function m(u,l,E){for(var v=typeof u=="number"?u.toString():u||"";v.length0?1:0}var v;return(v=E(u.getFullYear()-l.getFullYear()))===0&&(v=E(u.getMonth()-l.getMonth()))===0&&(v=E(u.getDate()-l.getDate())),v}function W(u){switch(u.getDay()){case 0:return new Date(u.getFullYear()-1,11,29);case 1:return u;case 2:return new Date(u.getFullYear(),0,3);case 3:return new Date(u.getFullYear(),0,2);case 4:return new Date(u.getFullYear(),0,1);case 5:return new Date(u.getFullYear()-1,11,31);case 6:return new Date(u.getFullYear()-1,11,30)}}function C(u){var l=yr(new Date(u.tm_year+1900,0,1),u.tm_yday),E=new Date(l.getFullYear(),0,4),v=new Date(l.getFullYear()+1,0,4),et=W(E),Ar=W(v);return T(et,l)<=0?T(Ar,l)<=0?l.getFullYear()+1:l.getFullYear():l.getFullYear()-1}var rt={"%a":function(u){return p[u.tm_wday].substring(0,3)},"%A":function(u){return p[u.tm_wday]},"%b":function(u){return d[u.tm_mon].substring(0,3)},"%B":function(u){return d[u.tm_mon]},"%C":function(u){return y((u.tm_year+1900)/100|0,2)},"%d":function(u){return y(u.tm_mday,2)},"%e":function(u){return m(u.tm_mday,2," ")},"%g":function(u){return C(u).toString().substring(2)},"%G":function(u){return C(u)},"%H":function(u){return y(u.tm_hour,2)},"%I":function(u){var l=u.tm_hour;return l==0?l=12:l>12&&(l-=12),y(l,2)},"%j":function(u){return y(u.tm_mday+mr(tt(u.tm_year+1900)?Lt:Gt,u.tm_mon-1),3)},"%m":function(u){return y(u.tm_mon+1,2)},"%M":function(u){return y(u.tm_min,2)},"%n":function(){return` +`},"%p":function(u){return u.tm_hour>=0&&u.tm_hour<12?"AM":"PM"},"%S":function(u){return y(u.tm_sec,2)},"%t":function(){return" "},"%u":function(u){return u.tm_wday||7},"%U":function(u){var l=u.tm_yday+7-u.tm_wday;return y(Math.floor(l/7),2)},"%V":function(u){var l=Math.floor((u.tm_yday+7-(u.tm_wday+6)%7)/7);if((u.tm_wday+371-u.tm_yday-2)%7<=2&&l++,l){if(l==53){var E=(u.tm_wday+371-u.tm_yday)%7;E==4||E==3&&tt(u.tm_year)||(l=1)}}else{l=52;var v=(u.tm_wday+7-u.tm_yday-1)%7;(v==4||v==5&&tt(u.tm_year%400-1))&&l++}return y(l,2)},"%w":function(u){return u.tm_wday},"%W":function(u){var l=u.tm_yday+7-(u.tm_wday+6)%7;return y(Math.floor(l/7),2)},"%y":function(u){return(u.tm_year+1900).toString().substring(2)},"%Y":function(u){return u.tm_year+1900},"%z":function(u){var l=u.tm_gmtoff,E=l>=0;return l=(l=Math.abs(l)/60)/60*100+l%60,(E?"+":"-")+("0000"+l).slice(-4)},"%Z":function(u){return u.tm_zone},"%%":function(){return"%"}};for(var s in c=c.replace(/%%/g,"\0\0"),rt)c.includes(s)&&(c=c.replace(new RegExp(s,"g"),rt[s](a)));var G=gr(c=c.replace(/\0\0/g,"%"),!1);return G.length>n?0:(vr(G,t),G.length-1)}function wr(t,n,r,e,o){return _r(t,n,r,e)}vn(),Dt=i.BindingError=dt(Error,"BindingError"),Ut=i.InternalError=dt(Error,"InternalError"),Sn(),zt=i.UnboundTypeError=dt(Error,"UnboundTypeError");var br={a:yn,m:gn,k:Tn,i:Cn,j:Wn,h:jn,c:qn,d:Gn,b:Nn,g:Xn,e:nr,l:rr,r:ir,f:or,s:ar,n:ur,u:Bt,v:cr,t:sr,p:dr,q:hr,o:wr};dn(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.x).apply(null,arguments)};var Nt=i.___getTypeName=function(){return(Nt=i.___getTypeName=i.asm.z).apply(null,arguments)};i.__embind_initialize_bindings=function(){return(i.__embind_initialize_bindings=i.asm.A).apply(null,arguments)};var nt,gt=i._malloc=function(){return(gt=i._malloc=i.asm.B).apply(null,arguments)},O=i._free=function(){return(O=i._free=i.asm.C).apply(null,arguments)},Xt=i.___cxa_is_pointer_type=function(){return(Xt=i.___cxa_is_pointer_type=i.asm.D).apply(null,arguments)};function Jt(t){function n(){nt||(nt=!0,i.calledRun=!0,Ct||(en(),Y(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),on()))}U>0||(rn(),U>0||(i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),n()},1)):n()))}if(i.dynCall_viijii=function(){return(i.dynCall_viijii=i.asm.E).apply(null,arguments)},i.dynCall_iiiiij=function(){return(i.dynCall_iiiiij=i.asm.F).apply(null,arguments)},i.dynCall_iiiiijj=function(){return(i.dynCall_iiiiijj=i.asm.G).apply(null,arguments)},i.dynCall_iiiiiijj=function(){return(i.dynCall_iiiiiijj=i.asm.H).apply(null,arguments)},q=function t(){nt||Jt(),nt||(q=t)},i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Jt(),R.ready},Zt.exports=$t;var Kt=it.exports;const Fr=Cr({__proto__:null,default:Tr(Kt)},[Kt]);export{Fr as l}; diff --git a/assets/lerc-wasm-acc570d7.js b/assets/lerc-wasm-acc570d7.js new file mode 100644 index 0000000..1d60c48 --- /dev/null +++ b/assets/lerc-wasm-acc570d7.js @@ -0,0 +1 @@ +import{bU as Tn}from"./index-080e108a.js";function Dn(e,g){for(var m=0;mp[f]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var tn,S,rn,T={exports:{}};T.exports,tn=T,T.exports,S=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(S=S||__filename),rn=function(e){var g,m;(e=(e=e||{})!==void 0?e:{}).ready=new Promise(function(n,t){g=n,m=t});var p,f,h,D,P,H,q=Object.assign({},e),C=typeof window=="object",v=typeof importScripts=="function",F=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",c="";function sn(n){return e.locateFile?e.locateFile(n,c):c+n}F?(c=v?require("path").dirname(c)+"/":__dirname+"/",H=()=>{P||(D=require("fs"),P=require("path"))},p=function(n,t){return H(),n=P.normalize(n),D.readFileSync(n,t?void 0:"utf8")},h=n=>{var t=p(n,!0);return t.buffer||(t=new Uint8Array(t)),t},f=(n,t,r)=>{H(),n=P.normalize(n),D.readFile(n,function(o,u){o?r(o):t(u.buffer)})},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(n){if(!(n instanceof jn))throw n}),process.on("unhandledRejection",function(n){throw n}),e.inspect=function(){return"[Emscripten Module object]"}):(C||v)&&(v?c=self.location.href:typeof document<"u"&&document.currentScript&&(c=document.currentScript.src),S&&(c=S),c=c.indexOf("blob:")!==0?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"",p=n=>{var t=new XMLHttpRequest;return t.open("GET",n,!1),t.send(null),t.responseText},v&&(h=n=>{var t=new XMLHttpRequest;return t.open("GET",n,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),f=(n,t,r)=>{var o=new XMLHttpRequest;o.open("GET",n,!0),o.responseType="arraybuffer",o.onload=()=>{o.status==200||o.status==0&&o.response?t(o.response):r()},o.onerror=r,o.send(null)}),e.print||console.log.bind(console);var b,M,w=e.printErr||console.warn.bind(console);Object.assign(e,q),q=null,e.arguments&&e.arguments,e.thisProgram&&e.thisProgram,e.quit&&e.quit,e.wasmBinary&&(b=e.wasmBinary),e.noExitRuntime,typeof WebAssembly!="object"&&x("no native wasm support detected");var B,A,E,y,d,k,z=!1,L=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function un(n,t,r){for(var o=t+r,u=t;n[u]&&!(u>=o);)++u;if(u-t>16&&n.buffer&&L)return L.decode(n.subarray(t,u));for(var s="";t>10,56320|1023&en)}}else s+=String.fromCharCode((31&i)<<6|l)}else s+=String.fromCharCode(i)}return s}function O(n,t){return n?un(E,n,t):""}function G(n){B=n,e.HEAP8=A=new Int8Array(n),e.HEAP16=new Int16Array(n),e.HEAP32=y=new Int32Array(n),e.HEAPU8=E=new Uint8Array(n),e.HEAPU16=new Uint16Array(n),e.HEAPU32=d=new Uint32Array(n),e.HEAPF32=new Float32Array(n),e.HEAPF64=new Float64Array(n)}e.INITIAL_MEMORY;var X=[],N=[],Y=[];function an(){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)pn(e.preRun.shift());U(X)}function cn(){U(N)}function fn(){if(e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;)hn(e.postRun.shift());U(Y)}function pn(n){X.unshift(n)}function ln(n){N.unshift(n)}function hn(n){Y.unshift(n)}var _=0,R=null;function dn(n){_++,e.monitorRunDependencies&&e.monitorRunDependencies(_)}function mn(n){if(_--,e.monitorRunDependencies&&e.monitorRunDependencies(_),_==0&&R){var t=R;R=null,t()}}function x(n){e.onAbort&&e.onAbort(n),w(n="Aborted("+n+")"),z=!0,n+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(n);throw m(t),t}var a,_n="data:application/octet-stream;base64,";function J(n){return n.startsWith(_n)}function K(n){return n.startsWith("file://")}function Q(n){try{if(n==a&&b)return new Uint8Array(b);if(h)return h(n);throw"both async and sync fetching of the wasm failed"}catch(t){x(t)}}function yn(){if(!b&&(C||v)){if(typeof fetch=="function"&&!K(a))return fetch(a,{credentials:"same-origin"}).then(function(n){if(!n.ok)throw"failed to load wasm binary file at '"+a+"'";return n.arrayBuffer()}).catch(function(){return Q(a)});if(f)return new Promise(function(n,t){f(a,function(r){n(new Uint8Array(r))},t)})}return Promise.resolve().then(function(){return Q(a)})}function gn(){var n={a:In};function t(s,i){var l=s.exports;e.asm=l,G((M=e.asm.g).buffer),k=e.asm.m,ln(e.asm.h),mn()}function r(s){t(s.instance)}function o(s){return yn().then(function(i){return WebAssembly.instantiate(i,n)}).then(function(i){return i}).then(s,function(i){w("failed to asynchronously prepare wasm: "+i),x(i)})}function u(){return b||typeof WebAssembly.instantiateStreaming!="function"||J(a)||K(a)||F||typeof fetch!="function"?o(r):fetch(a,{credentials:"same-origin"}).then(function(s){return WebAssembly.instantiateStreaming(s,n).then(r,function(i){return w("wasm streaming compile failed: "+i),w("falling back to ArrayBuffer instantiation"),o(r)})})}if(dn(),e.instantiateWasm)try{return e.instantiateWasm(n,t)}catch(s){return w("Module.instantiateWasm callback failed with error: "+s),!1}return u().catch(m),{}}function U(n){for(;n.length>0;){var t=n.shift();if(typeof t!="function"){var r=t.func;typeof r=="number"?t.arg===void 0?V(r)():V(r)(t.arg):r(t.arg===void 0?null:t.arg)}else t(e)}}J(a="lerc-wasm.wasm")||(a=sn(a));var I=[];function V(n){var t=I[n];return t||(n>=I.length&&(I.length=n+1),I[n]=t=k.get(n)),t}function vn(n,t,r,o){x("Assertion failed: "+O(n)+", at: "+[t?O(t):"unknown filename",r,o?O(o):"unknown function"])}function bn(n){return Z(n+24)+24}function wn(n){this.excPtr=n,this.ptr=n-24,this.set_type=function(t){d[this.ptr+4>>2]=t},this.get_type=function(){return d[this.ptr+4>>2]},this.set_destructor=function(t){d[this.ptr+8>>2]=t},this.get_destructor=function(){return d[this.ptr+8>>2]},this.set_refcount=function(t){y[this.ptr>>2]=t},this.set_caught=function(t){t=t?1:0,A[this.ptr+12>>0]=t},this.get_caught=function(){return A[this.ptr+12>>0]!=0},this.set_rethrown=function(t){t=t?1:0,A[this.ptr+13>>0]=t},this.get_rethrown=function(){return A[this.ptr+13>>0]!=0},this.init=function(t,r){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(r),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var t=y[this.ptr>>2];y[this.ptr>>2]=t+1},this.release_ref=function(){var t=y[this.ptr>>2];return y[this.ptr>>2]=t-1,t===1},this.set_adjusted_ptr=function(t){d[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return d[this.ptr+16>>2]},this.get_exception_ptr=function(){if($(this.get_type()))return d[this.excPtr>>2];var t=this.get_adjusted_ptr();return t!==0?t:this.excPtr}}function An(n,t,r){throw new wn(n).init(t,r),n}function Rn(){x("")}function xn(n,t,r){E.copyWithin(n,t,t+r)}function Sn(){return 2147483648}function Pn(n){try{return M.grow(n-B.byteLength+65535>>>16),G(M.buffer),1}catch{}}function En(n){var t=E.length;n>>>=0;var r=Sn();if(n>r)return!1;let o=(i,l)=>i+(l-i%l)%l;for(var u=1;u<=4;u*=2){var s=t*(1+.2/u);if(s=Math.min(s,n+100663296),Pn(Math.min(r,o(Math.max(n,s),65536))))return!0}return!1}var In={a:vn,c:bn,b:An,d:Rn,f:xn,e:En};gn(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.h).apply(null,arguments)},e._lerc_getBlobInfo=function(){return(e._lerc_getBlobInfo=e.asm.i).apply(null,arguments)},e._lerc_getDataRanges=function(){return(e._lerc_getDataRanges=e.asm.j).apply(null,arguments)},e._lerc_decode=function(){return(e._lerc_decode=e.asm.k).apply(null,arguments)},e._lerc_decode_4D=function(){return(e._lerc_decode_4D=e.asm.l).apply(null,arguments)};var Z=e._malloc=function(){return(Z=e._malloc=e.asm.n).apply(null,arguments)};e._free=function(){return(e._free=e.asm.o).apply(null,arguments)};var j,$=e.___cxa_is_pointer_type=function(){return($=e.___cxa_is_pointer_type=e.asm.p).apply(null,arguments)};function jn(n){this.name="ExitStatus",this.message="Program terminated with exit("+n+")",this.status=n}function W(n){function t(){j||(j=!0,e.calledRun=!0,z||(cn(),g(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),fn()))}_>0||(an(),_>0||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),t()},1)):t()))}if(R=function n(){j||W(),j||(R=n)},e.run=W,e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();return W(),e.ready},tn.exports=rn;var on=T.exports;const Mn=Dn({__proto__:null,default:Tn(on)},[on]);export{Mn as l}; diff --git a/assets/libtess-61f6382d.js b/assets/libtess-61f6382d.js new file mode 100644 index 0000000..7bb7a93 --- /dev/null +++ b/assets/libtess-61f6382d.js @@ -0,0 +1 @@ +import{bU as Zn}from"./index-080e108a.js";function nt(S,O){for(var T=0;Tf[t]})}}}return Object.freeze(Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}))}var $,pn,J={exports:{}};J.exports,$=J,(pn=function(){function S(O){const T=O.locateFile,f={};var t=t!==void 0?t:{};const _=(()=>{let n;return{resolve:e=>n(e),promise:new Promise(e=>n=e)}})(),hn=()=>_.promise;t.locateFile=T,t.onRuntimeInitialized=()=>{_.resolve(f)},f.Module=t,f.whenLoaded=hn;var h,j={};for(h in t)t.hasOwnProperty(h)&&(j[h]=t[h]);var D,U,W,E,R,K=typeof window=="object",x=typeof importScripts=="function",gn=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",p="";function dn(n){return t.locateFile?t.locateFile(n,p):p+n}gn?(p=x?require("path").dirname(p)+"/":__dirname+"/",D=function(n,e){return E||(E=require("fs")),R||(R=require("path")),n=R.normalize(n),E.readFileSync(n,e?null:"utf8")},W=function(n){var e=D(n,!0);return e.buffer||(e=new Uint8Array(e)),bn(e.buffer),e},U=function(n,e,r){E||(E=require("fs")),R||(R=require("path")),n=R.normalize(n),E.readFile(n,function(o,i){o?r(o):e(i.buffer)})},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),$.exports=t,process.on("uncaughtException",function(n){if(!(n instanceof $n))throw n}),process.on("unhandledRejection",q),t.inspect=function(){return"[Emscripten Module object]"}):(K||x)&&(x?p=self.location.href:typeof document<"u"&&document.currentScript&&(p=document.currentScript.src),p=p.indexOf("blob:")!==0?p.substr(0,p.lastIndexOf("/")+1):"",D=function(n){var e=new XMLHttpRequest;return e.open("GET",n,!1),e.send(null),e.responseText},x&&(W=function(n){var e=new XMLHttpRequest;return e.open("GET",n,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),U=function(n,e,r){var o=new XMLHttpRequest;o.open("GET",n,!0),o.responseType="arraybuffer",o.onload=function(){o.status==200||o.status==0&&o.response?e(o.response):r()},o.onerror=r,o.send(null)});var yn=t.print||console.log.bind(console),P=t.printErr||console.warn.bind(console);for(h in j)j.hasOwnProperty(h)&&(t[h]=j[h]);j=null,t.arguments&&t.arguments,t.thisProgram&&t.thisProgram,t.quit&&t.quit;var I,z,Q=0,vn=function(n){Q=n},wn=function(){return Q};t.wasmBinary&&(I=t.wasmBinary),t.noExitRuntime,typeof WebAssembly!="object"&&q("no native wasm support detected");var V=!1;function bn(n,e){n||q("Assertion failed: "+e)}var Z,H,M,m,nn=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function tn(n,e,r){for(var o=e+r,i=e;n[i]&&!(i>=o);)++i;if(i-e>16&&n.subarray&&nn)return nn.decode(n.subarray(e,i));for(var u="";e>10,56320|1023&C)}}else u+=String.fromCharCode((31&a)<<6|l)}else u+=String.fromCharCode(a)}return u}function An(n,e){return n?tn(H,n,e):""}function _n(n,e){return n%e>0&&(n+=e-n%e),n}function en(n){Z=n,t.HEAP8=new Int8Array(n),t.HEAP16=new Int16Array(n),t.HEAP32=M=new Int32Array(n),t.HEAPU8=H=new Uint8Array(n),t.HEAPU16=new Uint16Array(n),t.HEAPU32=new Uint32Array(n),t.HEAPF32=new Float32Array(n),t.HEAPF64=new Float64Array(n)}t.INITIAL_MEMORY;var rn=[],on=[],un=[];function En(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)Sn(t.preRun.shift());N(rn)}function Rn(){N(on)}function Pn(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)jn(t.postRun.shift());N(un)}function Sn(n){rn.unshift(n)}function Tn(n){on.unshift(n)}function jn(n){un.unshift(n)}var y=0,F=null;function xn(n){y++,t.monitorRunDependencies&&t.monitorRunDependencies(y)}function In(n){if(y--,t.monitorRunDependencies&&t.monitorRunDependencies(y),y==0&&F){var e=F;F=null,e()}}function q(n){throw t.onAbort&&t.onAbort(n),P(n+=""),V=!0,n="abort("+n+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(n)}t.preloadedImages={},t.preloadedAudios={};var s,Hn="data:application/octet-stream;base64,";function an(n){return n.startsWith(Hn)}function sn(n){return n.startsWith("file://")}function fn(n){try{if(n==s&&I)return new Uint8Array(I);if(W)return W(n);throw"both async and sync fetching of the wasm failed"}catch(e){q(e)}}function Mn(){if(!I&&(K||x)){if(typeof fetch=="function"&&!sn(s))return fetch(s,{credentials:"same-origin"}).then(function(n){if(!n.ok)throw"failed to load wasm binary file at '"+s+"'";return n.arrayBuffer()}).catch(function(){return fn(s)});if(U)return new Promise(function(n,e){U(s,function(r){n(new Uint8Array(r))},e)})}return Promise.resolve().then(function(){return fn(s)})}function Fn(){var n={a:Bn};function e(u,a){var l=u.exports;t.asm=l,en((z=t.asm.m).buffer),m=t.asm.q,Tn(t.asm.n),In()}function r(u){e(u.instance)}function o(u){return Mn().then(function(a){return WebAssembly.instantiate(a,n)}).then(u,function(a){P("failed to asynchronously prepare wasm: "+a),q(a)})}function i(){return I||typeof WebAssembly.instantiateStreaming!="function"||an(s)||sn(s)||typeof fetch!="function"?o(r):fetch(s,{credentials:"same-origin"}).then(function(u){return WebAssembly.instantiateStreaming(u,n).then(r,function(a){return P("wasm streaming compile failed: "+a),P("falling back to ArrayBuffer instantiation"),o(r)})})}if(xn(),t.instantiateWasm)try{return t.instantiateWasm(n,e)}catch(u){return P("Module.instantiateWasm callback failed with error: "+u),!1}return i(),{}}function N(n){for(;n.length>0;){var e=n.shift();if(typeof e!="function"){var r=e.func;typeof r=="number"?e.arg===void 0?m.get(r)():m.get(r)(e.arg):r(e.arg===void 0?null:e.arg)}else e(t)}}function qn(){throw"longjmp"}function Cn(n,e,r){H.copyWithin(n,e,e+r)}function On(n){try{return z.grow(n-Z.byteLength+65535>>>16),en(z.buffer),1}catch{}}function Un(n){var e=H.length,r=2147483648;if((n>>>=0)>r)return!1;for(var o=1;o<=4;o*=2){var i=e*(1+.2/o);if(i=Math.min(i,n+100663296),On(Math.min(r,_n(Math.max(n,i),65536))))return!0}return!1}an(s="libtess.wasm")||(s=dn(s));var L={mappings:{},buffers:[null,[],[]],printChar:function(n,e){var r=L.buffers[n];e===0||e===10?((n===1?yn:P)(tn(r,0)),r.length=0):r.push(e)},varargs:void 0,get:function(){return L.varargs+=4,M[L.varargs-4>>2]},getStr:function(n){return An(n)},get64:function(n,e){return n}};function Wn(n,e,r,o){for(var i=0,u=0;u>2],l=M[e+(8*u+4)>>2],d=0;d>2]=i,0}function Ln(){return wn()}function kn(n){vn(n)}var Bn={h:qn,l:Cn,g:Un,f:Wn,b:Ln,k:Gn,d:Nn,j:Xn,i:Yn,e:zn,c:Dn,a:kn};Fn(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.n).apply(null,arguments)},t._malloc=function(){return(t._malloc=t.asm.o).apply(null,arguments)},t._free=function(){return(t._free=t.asm.p).apply(null,arguments)},t._triangulate=function(){return(t._triangulate=t.asm.r).apply(null,arguments)};var k,v=t.stackSave=function(){return(v=t.stackSave=t.asm.s).apply(null,arguments)},w=t.stackRestore=function(){return(w=t.stackRestore=t.asm.t).apply(null,arguments)},b=t._setThrew=function(){return(b=t._setThrew=t.asm.u).apply(null,arguments)};function Dn(n,e,r){var o=v();try{m.get(n)(e,r)}catch(i){if(w(o),i!==i+0&&i!=="longjmp")throw i;b(1,0)}}function zn(n,e){var r=v();try{m.get(n)(e)}catch(o){if(w(r),o!==o+0&&o!=="longjmp")throw o;b(1,0)}}function Nn(n,e){var r=v();try{return m.get(n)(e)}catch(o){if(w(r),o!==o+0&&o!=="longjmp")throw o;b(1,0)}}function Gn(n){var e=v();try{return m.get(n)()}catch(r){if(w(e),r!==r+0&&r!=="longjmp")throw r;b(1,0)}}function Xn(n,e,r){var o=v();try{return m.get(n)(e,r)}catch(i){if(w(o),i!==i+0&&i!=="longjmp")throw i;b(1,0)}}function Yn(n,e,r,o){var i=v();try{return m.get(n)(e,r,o)}catch(u){if(w(i),u!==u+0&&u!=="longjmp")throw u;b(1,0)}}function $n(n){this.name="ExitStatus",this.message="Program terminated with exit("+n+")",this.status=n}function G(n){function e(){k||(k=!0,t.calledRun=!0,V||(Rn(),t.onRuntimeInitialized&&t.onRuntimeInitialized(),Pn()))}y>0||(En(),y>0||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),e()},1)):e()))}if(F=function n(){k||G(),k||(F=n)},t.run=G,t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();G();let X=null,g=null,A=null,B=null;const c=f.Module,Jn=2,cn=4e3;let ln=0;const Kn=(n,e,r)=>{X||(X=c._triangulate);let o=c.HEAPF32;const i=c.HEAP32.BYTES_PER_ELEMENT,u=2,a=o.BYTES_PER_ELEMENT;r>ln&&(ln=r,A&&(c._free(A),A=0),g&&(c._free(g),g=0)),A||(A=c._malloc(r*a)),B||(B=c._malloc(cn*i));const l=r*Jn;g||(g=c._malloc(l*a)),o=c.HEAPF32,o.set(n,A/a),c.HEAP32.set(e,B/i);const d=l/u,C=X(A,B,Math.min(e.length,cn),u,g,d),Qn=C*u;o=c.HEAPF32;const Vn=o.slice(g/a,g/a+Qn),Y={};return Y.buffer=Vn,Y.vertexCount=C,Y};return f.triangulate=Kn,f.whenLoaded()}return{load:S}}())!==void 0&&($.exports=pn);var mn=J.exports;const et=nt({__proto__:null,default:Zn(mn)},[mn]);export{et as l}; diff --git a/assets/libtess-asm-990bba69.js b/assets/libtess-asm-990bba69.js new file mode 100644 index 0000000..b3aa7cb --- /dev/null +++ b/assets/libtess-asm-990bba69.js @@ -0,0 +1 @@ +import{bU as K4}from"./index-080e108a.js";function Y4(z2,t0){for(var K2=0;K2u2[C]})}}}return Object.freeze(Object.defineProperty(z2,Symbol.toStringTag,{value:"Module"}))}var D0,I1,_1,H0={exports:{}};H0.exports,D0=H0,I1=function(){function z2(t0){const K2=t0.locateFile,u2={};var C=C!==void 0?C:{};const U2=(()=>{let d;return{resolve:g=>d(g),promise:new Promise(g=>d=g)}})(),x1=()=>U2.promise;C.locateFile=K2,C.onRuntimeInitialized=()=>{U2.resolve(u2)},u2.Module=C,u2.whenLoaded=x1;var w2,Y2={};for(w2 in C)C.hasOwnProperty(w2)&&(Y2[w2]=C[w2]);var d0,e0,o0,F2,O2,Q0=typeof window=="object",N2=typeof importScripts=="function",p0=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",A2="";function L1(d){return C.locateFile?C.locateFile(d,A2):A2+d}p0?(A2=N2?require("path").dirname(A2)+"/":__dirname+"/",d0=function(d,g){var I=Q2(d);return I?g?I:I.toString():(F2||(F2=require("fs")),O2||(O2=require("path")),d=O2.normalize(d),F2.readFileSync(d,g?null:"utf8"))},o0=function(d){var g=d0(d,!0);return g.buffer||(g=new Uint8Array(g)),T1(g.buffer),g},e0=function(d,g,I){var x=Q2(d);x&&g(x),F2||(F2=require("fs")),O2||(O2=require("path")),d=O2.normalize(d),F2.readFile(d,function(S,T){S?I(S):g(T.buffer)})},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),D0.exports=C,process.on("uncaughtException",function(d){if(!(d instanceof k4))throw d}),process.on("unhandledRejection",$2),C.inspect=function(){return"[Emscripten Module object]"}):(Q0||N2)&&(N2?A2=self.location.href:typeof document<"u"&&document.currentScript&&(A2=document.currentScript.src),A2=A2.indexOf("blob:")!==0?A2.substr(0,A2.lastIndexOf("/")+1):"",d0=function(d){try{var g=new XMLHttpRequest;return g.open("GET",d,!1),g.send(null),g.responseText}catch(x){var I=Q2(d);if(I)return $1(I);throw x}},N2&&(o0=function(d){try{var g=new XMLHttpRequest;return g.open("GET",d,!1),g.responseType="arraybuffer",g.send(null),new Uint8Array(g.response)}catch(x){var I=Q2(d);if(I)return I;throw x}}),e0=function(d,g,I){var x=new XMLHttpRequest;x.open("GET",d,!0),x.responseType="arraybuffer",x.onload=function(){if(x.status==200||x.status==0&&x.response)g(x.response);else{var S=Q2(d);S?g(S.buffer):I()}},x.onerror=I,x.send(null)});var P1=C.print||console.log.bind(console),D2=C.printErr||console.warn.bind(console);for(w2 in Y2)Y2.hasOwnProperty(w2)&&(C[w2]=Y2[w2]);Y2=null,C.arguments&&C.arguments,C.thisProgram&&C.thisProgram,C.quit&&C.quit;var H2,W0=0,B1=function(d){W0=d},j1=function(){return W0};C.wasmBinary&&(H2=C.wasmBinary),C.noExitRuntime;var V2,y2={Memory:function(d){this.buffer=new ArrayBuffer(65536*d.initial)},Module:function(d){},Instance:function(d,g){this.exports=function(I){function x(Q){return Q.set=function(c2,N){this[c2]=N},Q.get=function(c2){return this[c2]},Q}for(var S,T=new Uint8Array(123),O=25;O>=0;--O)T[48+O]=52+O,T[65+O]=O,T[97+O]=26+O;function D(Q,c2,N){for(var p,r2,i=0,w=c2,L2=N.length,P2=c2+(3*L2>>2)-(N[L2-2]=="=")-(N[L2-1]=="=");i>4,w>2),w>>0<=244){if(3&(f=(b=i[614])>>>(a=(r=n>>>0<11?16:n+11&-8)>>>3|0)|0)){n=(e=i[2504+(f=(t=a+(1&(-1^f))|0)<<3)>>2])+8|0,(0|(a=i[e+8>>2]))!=(0|(f=f+2496|0))?(i[a+12>>2]=f,i[f+8>>2]=a):(h=2456,m=f2(t)&b,i[h>>2]=m),f=t<<3,i[e+4>>2]=3|f,i[4+(f=f+e|0)>>2]=1|i[f+4>>2];break i}if((A=i[616])>>>0>=r>>>0)break s;if(f){a=n=(f=(0-(n=(0-(n=2<>>12&16,a|=n=(f=f>>>n|0)>>>5&8,a|=n=(f=f>>>n|0)>>>2&4,o=i[2504+(n=(a=((a|=n=(f=f>>>n|0)>>>1&2)|(n=(f=f>>>n|0)>>>1&1))+(f>>>n|0)|0)<<3)>>2],(0|(f=i[o+8>>2]))!=(0|(n=n+2496|0))?(i[f+12>>2]=n,i[n+8>>2]=f):(b=f2(a)&b,i[614]=b),n=o+8|0,i[o+4>>2]=3|r,e=(f=a<<3)-r|0,i[4+(t=o+r|0)>>2]=1|e,i[f+o>>2]=e,A&&(a=2496+((f=A>>>3|0)<<3)|0,o=i[619],(f=1<>2]:(i[614]=f|b,f=a),i[a+8>>2]=o,i[f+12>>2]=o,i[o+12>>2]=a,i[o+8>>2]=f),i[619]=t,i[616]=e;break i}if(!(k=i[615]))break s;for(a=n=(f=(k&0-k)-1|0)>>>12&16,a|=n=(f=f>>>n|0)>>>5&8,a|=n=(f=f>>>n|0)>>>2&4,f=i[2760+(((a|=n=(f=f>>>n|0)>>>1&2)|(n=(f=f>>>n|0)>>>1&1))+(f>>>n|0)<<2)>>2],t=(-8&i[f+4>>2])-r|0,a=f;(n=i[a+16>>2])||(n=i[a+20>>2]);)t=(e=(a=(-8&i[n+4>>2])-r|0)>>>0>>0)?a:t,f=e?n:f,a=n;if((s=f+r|0)>>>0<=f>>>0)break A;if(l=i[f+24>>2],(0|(e=i[f+12>>2]))!=(0|f)){n=i[f+8>>2],i[n+12>>2]=e,i[e+8>>2]=n;break f}if(!(n=i[(a=f+20|0)>>2])){if(!(n=i[f+16>>2]))break o;a=f+16|0}for(;o=a,e=n,(n=i[(a=n+20|0)>>2])||(a=e+16|0,n=i[e+16>>2]););i[o>>2]=0;break f}if(r=-1,!(n>>>0>4294967231)&&(r=-8&(n=n+11|0),s=i[615])){t=0-r|0,b=0,r>>>0<256||(b=31,r>>>0>16777215||(n=n>>>8|0,n<<=o=n+1048320>>>16&8,b=28+((n=((n<<=a=n+520192>>>16&4)<<(f=n+245760>>>16&2)>>>15|0)-(f|a|o)|0)<<1|r>>>n+21&1)|0));k:{r:{if(a=i[2760+(b<<2)>>2])for(n=0,f=r<<((0|b)==31?0:25-(b>>>1|0)|0);;){if(!((o=(-8&i[a+4>>2])-r|0)>>>0>=t>>>0||(e=a,t=o))){t=0,n=a;break r}if(o=i[a+20>>2],a=i[16+((f>>>29&4)+a|0)>>2],n=o?(0|o)==(0|a)?n:o:n,f<<=1,!a)break}else n=0;if(!(n|e)){if(e=0,!(n=(0-(n=2<>>12&16,a|=n=(f=f>>>n|0)>>>5&8,a|=n=(f=f>>>n|0)>>>2&4,n=i[2760+(((a|=n=(f=f>>>n|0)>>>1&2)|(n=(f=f>>>n|0)>>>1&1))+(f>>>n|0)<<2)>>2]}if(!n)break k}for(;t=(a=(f=(-8&i[n+4>>2])-r|0)>>>0>>0)?f:t,e=a?n:e,n=(f=i[n+16>>2])||i[n+20>>2];);}if(!(!e|i[616]-r>>>0<=t>>>0)){if((k=e+r|0)>>>0<=e>>>0)break A;if(b=i[e+24>>2],(0|e)!=(0|(f=i[e+12>>2]))){n=i[e+8>>2],i[n+12>>2]=f,i[f+8>>2]=n;break a}if(!(n=i[(a=e+20|0)>>2])){if(!(n=i[e+16>>2]))break u;a=e+16|0}for(;o=a,f=n,(n=i[(a=n+20|0)>>2])||(a=f+16|0,n=i[f+16>>2]););i[o>>2]=0;break a}}}if((a=i[616])>>>0>=r>>>0){t=i[619],(f=a-r|0)>>>0>=16?(i[616]=f,n=t+r|0,i[619]=n,i[n+4>>2]=1|f,i[a+t>>2]=f,i[t+4>>2]=3|r):(i[619]=0,i[616]=0,i[t+4>>2]=3|a,i[4+(n=a+t|0)>>2]=1|i[n+4>>2]),n=t+8|0;break i}if((k=i[617])>>>0>r>>>0){f=k-r|0,i[617]=f,n=(a=i[620])+r|0,i[620]=n,i[n+4>>2]=1|f,i[a+4>>2]=3|r,n=a+8|0;break i}if(n=0,f=s=r+47|0,i[732]?a=i[734]:(i[735]=-1,i[736]=-1,i[733]=4096,i[734]=4096,i[732]=v+12&-16^1431655768,i[737]=0,i[725]=0,a=4096),(a=(o=f+a|0)&(e=0-a|0))>>>0<=r>>>0||(t=i[724])&&t>>>0<(b=(f=i[722])+a|0)>>>0|f>>>0>=b>>>0)break i;if(4&w[2900])break b;s:{k:{if(t=i[620])for(n=2904;;){if(t>>>0<(f=i[n>>2])+i[n+4>>2]>>>0&&f>>>0<=t>>>0)break k;if(!(n=i[n+8>>2]))break}if((0|(f=T2(0)))==-1||(b=a,(n=(t=i[733])-1|0)&f&&(b=(a-f|0)+(n+f&0-t)|0),b>>>0<=r>>>0|b>>>0>2147483646)||(t=i[724])&&t>>>0<(e=(n=i[722])+b|0)>>>0|n>>>0>=e>>>0)break e;if((0|f)!=(0|(n=T2(b))))break s;break t}if((b=e&o-k)>>>0>2147483646)break e;if((0|(f=T2(b)))==(i[n>>2]+i[n+4>>2]|0))break c;n=f}if(!((0|n)==-1|r+48>>>0<=b>>>0)){if((f=(f=i[734])+(s-b|0)&0-f)>>>0>2147483646){f=n;break t}if((0|T2(f))!=-1){b=f+b|0,f=n;break t}T2(0-b|0);break e}if(f=n,(0|n)!=-1)break t;break e}o2()}e=0;break f}f=0;break a}if((0|f)!=-1)break t}i[725]=4|i[725]}if(a>>>0>2147483646||(0|(f=T2(a)))==-1|(0|(n=T2(0)))==-1|n>>>0<=f>>>0||(b=n-f|0)>>>0<=r+40>>>0)break n}n=i[722]+b|0,i[722]=n,n>>>0>P2[723]&&(i[723]=n);t:{b:{e:{if(o=i[620]){for(n=2904;;){if(((t=i[n>>2])+(a=i[n+4>>2])|0)==(0|f))break e;if(!(n=i[n+8>>2]))break}break b}for((n=i[618])>>>0<=f>>>0&&n||(i[618]=f),n=0,i[727]=b,i[726]=f,i[622]=-1,i[623]=i[732],i[729]=0;a=2496+(t=n<<3)|0,i[t+2504>>2]=a,i[t+2508>>2]=a,(0|(n=n+1|0))!=32;);a=(t=b-40|0)-(n=f+8&7?-8-f&7:0)|0,i[617]=a,n=n+f|0,i[620]=n,i[n+4>>2]=1|a,i[4+(f+t|0)>>2]=40,i[621]=i[736];break t}if(!(8&w[n+12|0]|t>>>0>o>>>0|f>>>0<=o>>>0)){i[n+4>>2]=a+b,a=(n=o+8&7?-8-o&7:0)+o|0,i[620]=a,n=(f=i[617]+b|0)-n|0,i[617]=n,i[a+4>>2]=1|n,i[4+(f+o|0)>>2]=40,i[621]=i[736];break t}}P2[618]>f>>>0&&(i[618]=f),a=f+b|0,n=2904;b:{e:{c:{u:{o:{A:{for(;;){if((0|a)!=i[n>>2]){if(n=i[n+8>>2])continue;break A}break}if(!(8&w[n+12|0]))break o}for(n=2904;;){if((a=i[n>>2])>>>0<=o>>>0&&(e=a+i[n+4>>2]|0)>>>0>o>>>0)break u;n=i[n+8>>2]}}if(i[n>>2]=f,i[n+4>>2]=i[n+4>>2]+b,i[4+(s=(f+8&7?-8-f&7:0)+f|0)>>2]=3|r,a=(b=a+(a+8&7?-8-a&7:0)|0)-(k=r+s|0)|0,(0|o)==(0|b)){i[620]=k,n=i[617]+a|0,i[617]=n,i[k+4>>2]=1|n;break e}if(i[619]==(0|b)){i[619]=k,n=i[616]+a|0,i[616]=n,i[k+4>>2]=1|n,i[n+k>>2]=n;break e}if((3&(n=i[b+4>>2]))==1){o=-8&n;o:if(n>>>0<=255){if(t=i[b+8>>2],n=n>>>3|0,(0|(f=i[b+12>>2]))==(0|t)){h=2456,m=i[614]&f2(n),i[h>>2]=m;break o}i[t+12>>2]=f,i[f+8>>2]=t}else{if(r=i[b+24>>2],(0|b)==(0|(f=i[b+12>>2])))if((t=i[(n=b+20|0)>>2])||(t=i[(n=b+16|0)>>2])){for(;e=n,(t=i[(n=(f=t)+20|0)>>2])||(n=f+16|0,t=i[f+16>>2]););i[e>>2]=0}else f=0;else n=i[b+8>>2],i[n+12>>2]=f,i[f+8>>2]=n;if(r){t=i[b+28>>2];A:{if(i[(n=2760+(t<<2)|0)>>2]==(0|b)){if(i[n>>2]=f,f)break A;h=2460,m=i[615]&f2(t),i[h>>2]=m;break o}if(i[r+(i[r+16>>2]==(0|b)?16:20)>>2]=f,!f)break o}i[f+24>>2]=r,(n=i[b+16>>2])&&(i[f+16>>2]=n,i[n+24>>2]=f),(n=i[b+20>>2])&&(i[f+20>>2]=n,i[n+24>>2]=f)}}b=o+b|0,a=a+o|0}if(i[b+4>>2]=-2&i[b+4>>2],i[k+4>>2]=1|a,i[a+k>>2]=a,a>>>0<=255){f=2496+((n=a>>>3|0)<<3)|0,(a=i[614])&(n=1<>2]:(i[614]=n|a,n=f),i[f+8>>2]=k,i[n+12>>2]=k,i[k+12>>2]=f,i[k+8>>2]=n;break e}if(n=31,a>>>0<=16777215&&(n=a>>>8|0,n<<=e=n+1048320>>>16&8,n=28+((n=((n<<=t=n+520192>>>16&4)<<(f=n+245760>>>16&2)>>>15|0)-(f|t|e)|0)<<1|a>>>n+21&1)|0),i[k+28>>2]=n,i[k+16>>2]=0,i[k+20>>2]=0,e=2760+(n<<2)|0,(t=i[615])&(f=1<>>1|0)|0),f=i[e>>2];;){if(t=f,(-8&i[f+4>>2])==(0|a))break c;if(f=n>>>29|0,n<<=1,!(f=i[16+(e=t+(4&f)|0)>>2]))break}i[e+16>>2]=k,i[k+24>>2]=t}else i[615]=f|t,i[e>>2]=k,i[k+24>>2]=e;i[k+12>>2]=k,i[k+8>>2]=k;break e}for(a=(t=b-40|0)-(n=f+8&7?-8-f&7:0)|0,i[617]=a,n=n+f|0,i[620]=n,i[n+4>>2]=1|a,i[4+(f+t|0)>>2]=40,i[621]=i[736],i[(a=(n=(e+(e-39&7?39-e&7:0)|0)-47|0)>>>0>>0?o:n)+4>>2]=27,n=i[729],i[a+16>>2]=i[728],i[a+20>>2]=n,n=i[727],i[a+8>>2]=i[726],i[a+12>>2]=n,i[728]=a+8,i[727]=b,i[726]=f,i[729]=0,n=a+24|0;i[n+4>>2]=7,f=n+8|0,n=n+4|0,f>>>0>>0;);if((0|a)==(0|o))break t;if(i[a+4>>2]=-2&i[a+4>>2],e=a-o|0,i[o+4>>2]=1|e,i[a>>2]=e,e>>>0<=255){f=2496+((n=e>>>3|0)<<3)|0,(a=i[614])&(n=1<>2]:(i[614]=n|a,n=f),i[f+8>>2]=o,i[n+12>>2]=o,i[o+12>>2]=f,i[o+8>>2]=n;break t}if(n=31,i[o+16>>2]=0,i[o+20>>2]=0,e>>>0<=16777215&&(n=e>>>8|0,n<<=t=n+1048320>>>16&8,n=28+((n=((n<<=a=n+520192>>>16&4)<<(f=n+245760>>>16&2)>>>15|0)-(f|a|t)|0)<<1|e>>>n+21&1)|0),i[o+28>>2]=n,t=2760+(n<<2)|0,(a=i[615])&(f=1<>>1|0)|0),f=i[t>>2];;){if(a=f,(0|e)==(-8&i[f+4>>2]))break b;if(f=n>>>29|0,n<<=1,!(f=i[16+(t=a+(4&f)|0)>>2]))break}i[t+16>>2]=o,i[o+24>>2]=a}else i[615]=f|a,i[t>>2]=o,i[o+24>>2]=t;i[o+12>>2]=o,i[o+8>>2]=o;break t}n=i[t+8>>2],i[n+12>>2]=k,i[t+8>>2]=k,i[k+24>>2]=0,i[k+12>>2]=t,i[k+8>>2]=n}n=s+8|0;break i}n=i[a+8>>2],i[n+12>>2]=o,i[a+8>>2]=o,i[o+24>>2]=0,i[o+12>>2]=a,i[o+8>>2]=n}if(!((n=i[617])>>>0<=r>>>0)){f=n-r|0,i[617]=f,n=(a=i[620])+r|0,i[620]=n,i[n+4>>2]=1|f,i[a+4>>2]=3|r,n=a+8|0;break i}}i[613]=48,n=0;break i}a:if(b){a=i[e+28>>2];n:{if(i[(n=2760+(a<<2)|0)>>2]==(0|e)){if(i[n>>2]=f,f)break n;s=f2(a)&s,i[615]=s;break a}if(i[b+(i[b+16>>2]==(0|e)?16:20)>>2]=f,!f)break a}i[f+24>>2]=b,(n=i[e+16>>2])&&(i[f+16>>2]=n,i[n+24>>2]=f),(n=i[e+20>>2])&&(i[f+20>>2]=n,i[n+24>>2]=f)}a:if(t>>>0<=15)n=t+r|0,i[e+4>>2]=3|n,i[4+(n=n+e|0)>>2]=1|i[n+4>>2];else if(i[e+4>>2]=3|r,i[k+4>>2]=1|t,i[t+k>>2]=t,t>>>0<=255)f=2496+((n=t>>>3|0)<<3)|0,(a=i[614])&(n=1<>2]:(i[614]=n|a,n=f),i[f+8>>2]=k,i[n+12>>2]=k,i[k+12>>2]=f,i[k+8>>2]=n;else{n=31,t>>>0<=16777215&&(n=t>>>8|0,n<<=o=n+1048320>>>16&8,n=28+((n=((n<<=a=n+520192>>>16&4)<<(f=n+245760>>>16&2)>>>15|0)-(f|a|o)|0)<<1|t>>>n+21&1)|0),i[k+28>>2]=n,i[k+16>>2]=0,i[k+20>>2]=0,a=2760+(n<<2)|0;n:{if((f=1<>>1|0)|0),r=i[a>>2];;){if((-8&i[(f=r)+4>>2])==(0|t))break n;if(a=n>>>29|0,n<<=1,!(r=i[16+(a=f+(4&a)|0)>>2]))break}i[a+16>>2]=k,i[k+24>>2]=f}else i[615]=f|s,i[a>>2]=k,i[k+24>>2]=a;i[k+12>>2]=k,i[k+8>>2]=k;break a}n=i[f+8>>2],i[n+12>>2]=k,i[f+8>>2]=k,i[k+24>>2]=0,i[k+12>>2]=f,i[k+8>>2]=n}n=e+8|0;break i}f:if(l){a=i[f+28>>2];a:{if(i[(n=2760+(a<<2)|0)>>2]==(0|f)){if(i[n>>2]=e,e)break a;h=2460,m=f2(a)&k,i[h>>2]=m;break f}if(i[(i[l+16>>2]==(0|f)?16:20)+l>>2]=e,!e)break f}i[e+24>>2]=l,(n=i[f+16>>2])&&(i[e+16>>2]=n,i[n+24>>2]=e),(n=i[f+20>>2])&&(i[e+20>>2]=n,i[n+24>>2]=e)}t>>>0<=15?(n=t+r|0,i[f+4>>2]=3|n,i[4+(n=n+f|0)>>2]=1|i[n+4>>2]):(i[f+4>>2]=3|r,i[s+4>>2]=1|t,i[t+s>>2]=t,A&&(a=2496+((n=A>>>3|0)<<3)|0,e=i[619],(n=1<>2]:(i[614]=n|b,n=a),i[a+8>>2]=e,i[n+12>>2]=e,i[e+12>>2]=a,i[e+8>>2]=n),i[619]=s,i[616]=t),n=f+8|0}return B=v+16|0,0|n}function w4(n,f,a,t,e,b){n|=0,f|=0,a|=0,t|=0,e|=0,b|=0;for(var o=0,k=0,r=0,s=0,A=0,l=u(0),v=0,h=u(0),m=u(0),y=0,E=0,R=0,_=0,L=0,P=0,U=0,F=0;(r=i[2032+(o=k<<2)>>2])&&(i[r>>2]=0),(r=i[2032+(4|o)>>2])&&(i[r>>2]=0),(r=i[2032+(8|o)>>2])&&(i[r>>2]=0),(o=i[2032+(12|o)>>2])&&(i[o>>2]=0),(0|(k=k+4|0))!=100;);if((k=i[608])||(k=H(16),i[608]=k),i[k+8>>2]=b,i[k+4>>2]=0,i[k+12>>2]=t,i[k>>2]=e,(k=i[609])||((e=H(1900))?(i[e+100>>2]=12,i[e+96>>2]=13,i[e+92>>2]=14,i[e+88>>2]=15,r2[e+80>>1]=0,i[e+52>>2]=0,i[e+56>>2]=100130,i[e+16>>2]=0,i[e+20>>2]=0,i[e>>2]=0,i[e+1896>>2]=0,i[e+1736>>2]=8,i[e+1732>>2]=11,i[e+1728>>2]=6,i[e+1724>>2]=5,i[e+1720>>2]=4,i[e+1716>>2]=3,i[e+104>>2]=16,i[e+76>>2]=17,i[e+12>>2]=18,i[e+24>>2]=0):e=0,i[609]=e,W2(e,100107,34),W2(i[609],100100,35),W2(i[609],100102,36),W2(i[609],100105,37),W2(i[609],100103,38),W2(i[609],100104,39),i[i[609]+56>>2]=100130,e=i[609],c[e+16>>2]=0,c[e+24>>2]=1,c[e+20>>2]=0,k=i[609]),e=0,b=i[608],i[k>>2]&&E2(k,0),i[k+112>>2]=0,i[k>>2]=1,p[k+108|0]=0,i[k+1896>>2]=b,i[k+8>>2]=0,(0|a)>0)for(b=0;;){if(y=i[(b<<2)+f>>2],o=i[609],i[o>>2]!=1&&E2(o,1),i[o>>2]=2,i[o+4>>2]=0,i[o+112>>2]>=1&&(p[o+108|0]=1),k=0,(0|y)>0)for(;;){A=E=(W(e+k|0,t)<<2)+n|0,r=i[609],i[r>>2]!=2&&E2(r,2);i:{f:{a:{if(w[r+108|0]){if(o=M0(),i[r+8>>2]=o,!o)break a;if((0|(o=i[r+112>>2]))>=1)for(R=116+(r+(o<<4)|0)|0,s=r+116|0,o=i[r+4>>2];;){F=i[s+12>>2];n:{if(!o){if(!(o=f0(i[r+8>>2])))break a;if(z(o,i[o+4>>2]))break n;break a}if(!n2(o))break a;o=i[o+12>>2]}if(v=i[o+16>>2],i[v+12>>2]=F,c[v+16>>2]=c[s>>2],l=c[s+4>>2],i[v+24>>2]=0,c[v+20>>2]=l,i[o+28>>2]=1,i[i[o+4>>2]+28>>2]=-1,i[r+4>>2]=o,!(R>>>0>(s=s+16|0)>>>0))break}p[r+108|0]=0,i[r+112>>2]=0,i[r+4>>2]=0}s=(L=+(l=(_=+(l=c[A+4>>2]))<-1e37?u(-9999999933815813e21):l))>1e37,v=(U=+(h=(P=+(h=c[A>>2]))<-1e37?u(-9999999933815813e21):h))>1e37,((o=+(m=c[A+8>>2])<-1e37)|(A=+(m=o?u(-9999999933815813e21):m)>1e37)|_<-1e37|L>1e37||U>1e37||P<-1e37)&&((0|(o=i[r+1732>>2]))==11?M[i[r+12>>2]](100155):M[0|o](100155,i[r+1896>>2])),l=s?u(9999999933815813e21):l,h=v?u(9999999933815813e21):h;n:{if(!i[r+8>>2]){if((0|(s=i[r+112>>2]))<=99){c[124+(o=r+(s<<4)|0)>>2]=A?u(9999999933815813e21):m,c[o+120>>2]=l,c[o+116>>2]=h,i[o+128>>2]=E,i[r+112>>2]=s+1;break i}if(o=M0(),i[r+8>>2]=o,!o)break n;if((0|(o=i[r+112>>2]))>=1)for(v=116+(r+(o<<4)|0)|0,s=r+116|0,o=i[r+4>>2];;){R=i[s+12>>2];t:{if(!o){if(!(o=f0(i[r+8>>2])))break n;if(z(o,i[o+4>>2]))break t;break n}if(!n2(o))break n;o=i[o+12>>2]}if(A=i[o+16>>2],i[A+12>>2]=R,c[A+16>>2]=c[s>>2],m=c[s+4>>2],i[A+24>>2]=0,c[A+20>>2]=m,i[o+28>>2]=1,i[i[o+4>>2]+28>>2]=-1,i[r+4>>2]=o,!(v>>>0>(s=s+16|0)>>>0))break}p[r+108|0]=0,i[r+112>>2]=0}t:{b:{if(!(o=i[r+4>>2])){if(!(o=f0(i[r+8>>2])))break t;if(z(o,i[o+4>>2]))break b;break t}if(!n2(o))break t;o=i[o+12>>2]}s=i[o+16>>2],c[s+16>>2]=h,i[s+12>>2]=E,i[s+24>>2]=0,c[s+20>>2]=l,i[o+28>>2]=1,i[i[o+4>>2]+28>>2]=-1,i[r+4>>2]=o;break i}if((0|(o=i[r+1732>>2]))!=11)break f;M[i[r+12>>2]](100902);break i}if((0|(o=i[r+1732>>2]))!=11)break f;M[i[r+12>>2]](100902);break i}if((0|(o=i[r+1732>>2]))==11){M[i[r+12>>2]](100902);break i}}M[0|o](100902,i[r+1896>>2])}if((0|y)==(0|(k=k+1|0)))break}if(o=i[609],i[o>>2]!=2&&E2(o,2),i[o>>2]=1,e=e+y|0,(0|(b=b+1|0))==(0|a))break}a=i[609],n=0,f=H(40),i[f>>2]=0,e=y1(r=a+1740|0,1,f,4),b=0|V();i:{f:{a:{n:{t:{b:for(;;){e:{c:{u:{o:{A:{s:{k:{if(n){if((0|(n=i[a+1732>>2]))!=11){if(f=i[a+1896>>2],i[611]=0,B2(0|n,100902,0|f),n=i[611],i[611]=0,f=-1,!n||!(t=i[612]))break s;if(f=J(i[n>>2],e,b))break k;break t}if(n=i[a+12>>2],i[611]=0,t1(0|n,100902),n=i[611],i[611]=0,f=-1,!n||!(t=i[612]))break o;if(f=J(i[n>>2],e,b))break A;break t}if(i[a>>2]==1)break e;if(i[611]=0,B2(19,0|a,1),n=i[611],i[611]=0,f=-1,!n||!(t=i[612]))break c;if(f=J(i[n>>2],e,b))break u;break t}K(0|t)}if(n=0|V(),(0|f)==1)continue;break i}K(0|t)}if(n=0|V(),(0|f)==1)continue;break i}K(0|t)}if(n=0|V(),(0|f)==1)continue}i[a>>2]=0;e:{c:{u:{if(!i[a+8>>2]){if(!(w[a+80|0]|i[a+104>>2]!=16)){if(i[611]=0,o=0|i0(20,0|a),n=i[611],i[611]=0,f=-1,n&&(t=i[612])){if(!(f=J(i[n>>2],e,b)))break t;K(0|t)}if(n=0|V(),(0|f)==1)continue;if(o){i[a+1896>>2]=0;break i}}if(i[611]=0,t=0|h4(21),n=i[611],i[611]=0,f=-1,n&&(k=i[612])){if(!(f=J(i[n>>2],e,b)))break n;K(0|k)}if(n=0|V(),(0|f)==1)continue;if(i[a+8>>2]=t,!t)break u;if((0|(n=i[a+112>>2]))>=1)for(s=116+(a+(n<<4)|0)|0,t=a+116|0,f=i[a+4>>2];;){y=i[t+12>>2];o:{A:{s:{k:{r:{l:{if(!f){if(n=i[a+8>>2],i[611]=0,f=0|i0(22,0|n),n=i[611],i[611]=0,k=-1,!n||!(o=i[612]))break r;if(k=J(i[n>>2],e,b))break l;break a}if(i[611]=0,A=0|i0(23,0|f),n=i[611],i[611]=0,k=-1,!n||!(o=i[612]))break s;if(k=J(i[n>>2],e,b))break k;break a}K(0|o)}if(n=0|V(),(0|k)!=1)break A;continue b}K(0|o)}if(n=0|V(),(0|k)==1)continue b;if(!A)break u;f=i[f+12>>2];break o}if(!f)break u;if(n=i[f+4>>2],i[611]=0,A=0|p4(24,0|f,0|n),n=i[611],i[611]=0,k=-1,n&&(o=i[612])){if(!(k=J(i[n>>2],e,b)))break a;K(0|o)}if(n=0|V(),(0|k)==1)continue b;if(!A)break u}if(n=i[f+16>>2],i[n+12>>2]=y,c[n+16>>2]=c[t>>2],l=c[t+4>>2],i[n+24>>2]=0,c[n+20>>2]=l,i[f+28>>2]=1,i[i[f+4>>2]+28>>2]=-1,i[a+4>>2]=f,!(s>>>0>(t=t+16|0)>>>0))break}p[a+108|0]=0,i[a+112>>2]=0}if(i[611]=0,b1(a),n=i[611],i[611]=0,f=-1,!n||!(t=i[612]))break e;if(f=J(i[n>>2],e,b))break c;break t}if(i[611]=0,B2(26,0|r,1),f=i[611],i[611]=0,f&&(n=i[612])){if(!J(i[f>>2],e,b))break f;K(0|n)}n=0|V();continue}K(0|t)}if(n=0|V(),(0|f)!=1){if(i[611]=0,o=0|i0(27,0|a),n=i[611],i[611]=0,f=-1,n&&(t=i[612])){if(!(f=J(i[n>>2],e,b)))break t;K(0|t)}if(n=0|V(),(0|f)!=1){e:{c:{u:{o:{A:{s:{k:{r:{l:{v:{d:{if(!o){if(i[611]=0,B2(26,0|r,1),f=i[611],i[611]=0,!f||!(n=i[612]))break v;if(J(i[f>>2],e,b))break d;break f}if(f=i[a+8>>2],w[a+60|0])break s;if(w[a+81|0]){if(i[611]=0,k=0|d4(28,0|f,1,1),n=i[611],i[611]=0,t=-1,!n||!(o=i[612]))break k;if(t=J(i[n>>2],e,b))break l;break a}if(i[611]=0,k=0|i0(29,0|f),n=i[611],i[611]=0,t=-1,!n||!(o=i[612]))break k;if(t=J(i[n>>2],e,b))break r;break a}K(0|n)}n=0|V();continue}K(0|o);break k}K(0|o)}if(n=0|V(),(0|t)==1)continue;k:{r:{l:{v:{d:{p:{h:{if(!k){if(i[611]=0,B2(26,0|r,1),f=i[611],i[611]=0,!f||!(n=i[612]))break p;if(J(i[f>>2],e,b))break h;break f}if(!(i[a+88>>2]!=15|i[a+100>>2]!=12|i[a+96>>2]!=13|i[a+92>>2]!=14||i[a+1716>>2]!=3|i[a+1728>>2]!=6|i[a+1724>>2]!=5||i[a+1720>>2]!=4))break k;if(w[a+81|0]){if(i[611]=0,B2(30,0|a,0|f),n=i[611],i[611]=0,t=-1,!n||!(k=i[612]))break v;if(t=J(i[n>>2],e,b))break d;break n}if(i[611]=0,B2(31,0|a,0|f),n=i[611],i[611]=0,t=-1,!n||!(k=i[612]))break r;if(t=J(i[n>>2],e,b))break l;break n}K(0|n)}n=0|V();continue}K(0|k)}if(n=0|V(),(0|t)==1)continue;break k}K(0|k)}if(n=0|V(),(0|t)==1)continue}if(i[a+104>>2]!=16){if(i[611]=0,r1(f),n=i[611],i[611]=0,t=-1,!n||!(k=i[612]))break o;if(t=J(i[n>>2],e,b))break A;break n}}if(i[611]=0,_0(f),n=i[611],i[611]=0,f=-1,!n||!(t=i[612]))break c;if(f=J(i[n>>2],e,b))break u;break t}K(0|k)}if(n=0|V(),(0|t)!=1)break e;continue}K(0|t)}if(n=0|V(),(0|f)==1)continue;i[a+8>>2]=0,i[a+1896>>2]=0;break i}if(n=i[a+104>>2],i[611]=0,t1(0|n,0|f),n=i[611],i[611]=0,f=-1,n&&(t=i[612])){if(!(f=J(i[n>>2],e,b)))break t;K(0|t)}if(n=0|V(),(0|f)!=1)break}}}i[a+1896>>2]=0,i[a+8>>2]=0;break i}b2(n,t),o2()}b2(n,k),o2()}b2(n,o),o2()}b2(f,n),o2()}return j(e),i[i[608]+4>>2]}function o1(n,f){var a=u(0),t=u(0),e=0,b=u(0),o=u(0),k=0,r=0,s=u(0),A=0,l=0,v=0,h=u(0),m=u(0),y=u(0),E=0,R=0,_=0,L=0,P=0,U=0,F=0,q=0,Y=0,k2=u(0),m2=0,n0=u(0);B=k=B-144|0,Y=i[i[i[f+4>>2]+8>>2]>>2],F=i[Y>>2],_=i[F+16>>2],P=i[i[F+4>>2]+16>>2],U=i[f>>2],L=i[i[U+4>>2]+16>>2],E=i[U+16>>2],G(L,i[n+72>>2],E)>u(0)&&(a=c[L+28>>2],t=c[L+32>>2],e=i[n+72>>2],b=c[e+28>>2],o=c[e+32>>2],s=c[E+28>>2],X[k+40>>3]=c[E+32>>2],X[k+32>>3]=s,X[k+24>>3]=o,X[k+16>>3]=b,X[k+8>>3]=t,X[k>>3]=a,R1(1098,k));i:{f:{a:if((0|E)!=(0|_)&&!((m=(a=c[E+32>>2])<=(t=c[L+32>>2])?a:t)>((t=c[_+32>>2])>=(b=c[P+32>>2])?t:b))){n:{if(!(!(a<=t)|(b=c[E+28>>2])!=(o=c[_+28>>2]))||bu(0)))break n;break a}if(G(L,_,E)>2])<(t=c[E+28>>2])|(c[A+32>>2]<=c[l+32>>2]?a==t:0)?(r=l,l=A):r=A,(a=c[e+28>>2])>(t=c[v+28>>2])|(c[v+32>>2]<=c[e+32>>2]?a==t:0)?(a=t,A=e,e=v):A=v,a>(t=c[l+28>>2])|(c[l+32>>2]<=c[e+32>>2]?a==t:0)?(t=a,v=A,R=e,A=r,e=l):(v=r,R=l),r=k;n:if((o=c[A+28>>2])>t|(c[R+32>>2]<=c[A+32>>2]?t==o:0))if(h=c[v+28>>2],!(c[A+32>>2]<=c[v+32>>2])|o!=h&&!(h>o))if(t=G(e,R,A),a=G(e,v,A),l=u(t-a)>2],s=c[v+28>>2],a=u(u(o+s)*u(.5)),t==u(0))break n;a=u(o+u(u(b/u(b+t))*u(s-o)))}else a=c[v+28>>2],a=u(a+u(u(t/u(b+t))*u(c[R+28>>2]-a)));else{if(a=u(0),s=u(o-t),b=u(t-c[e+28>>2]),(m=u(s+b))>u(0)&&(a=c[((l=b>2],a=u(u(c[R+32>>2]-a)+u(u((l?b:s)/m)*u(a-c[(l?A:e)+32>>2])))),k2=u(-a),m=a,h=u(h-o),(b=u(s+h))>u(0)&&(y=c[((l=s>2],y=u(u(c[A+32>>2]-y)+u(u((l?s:h)/b)*u(y-c[(l?v:R)+32>>2])))),l=u(a+y)>2]=a,(a=c[e+32>>2])<(t=c[A+32>>2])|(c[e+28>>2]<=c[A+28>>2]?a==t:0)?(r=A,A=e):r=e,(t=c[v+32>>2])>(a=c[R+32>>2])|(c[R+28>>2]<=c[v+28>>2]?a==t:0)?(t=a,e=v,v=R):e=R,(a=c[A+32>>2])>2]<=c[v+28>>2]?a==t:0)?(R=e,l=v,e=r,v=A):(R=r,l=A);n:{t:if((o=c[l+32>>2])<(s=c[e+32>>2])|(c[l+28>>2]<=c[e+28>>2]?o==s:0)){if(y=c[R+32>>2],!(!(c[e+28>>2]<=c[R+28>>2])|s!=y)||y>s){if(a=u(0),t=u(0),h=u(s-o),b=u(o-c[v+32>>2]),(m=u(h+b))>u(0)&&(t=c[((r=b>2],t=u(u(c[l+28>>2]-t)+u(u((r?b:h)/m)*u(t-c[(r?e:v)+28>>2])))),n0=u(-t),m=t,y=u(y-s),(b=u(h+y))>u(0)&&(k2=c[e+28>>2],a=c[((e=h>2],a=u(u(k2-a)+u(u((e?h:y)/b)*u(a-c[(e?R:l)+28>>2])))),e=u(t+a)>2]=o+u(h*u(t/u(t+a)));break n}c[k+88>>2]=s+u(u(o-s)*u(a/u(t+a)));break n}if(a=u(0),t=u(0),b=u(s-o),h=c[v+32>>2],m=u(o-h),u(b+m)>u(0)&&(t=c[l+28>>2],t=u(u(m*u(t-c[e+28>>2]))+u(b*u(t-c[v+28>>2])))),m=u(-t),b=t,s=u(s-y),h=u(y-h),u(s+h)>u(0)&&(a=c[R+28>>2],a=u(u(h*u(a-c[e+28>>2]))+u(s*u(a-c[v+28>>2])))),e=u(t-a)>2]=u(o+y)*u(.5);break n}c[k+88>>2]=o+u(u(y-o)*u(t/u(t+a)));break n}c[k+88>>2]=y+u(u(o-y)*u(a/u(t+a)));break n}c[k+88>>2]=u(o+s)*u(.5)}a=c[k+84>>2],r=i[n+72>>2];n:{if(a<(b=c[r+28>>2]))t=c[r+32>>2];else if(a!=b||!((t=c[r+32>>2])>=c[k+88>>2]))break n;c[k+88>>2]=t,c[k+84>>2]=b,a=b}A=e=E,(t=b=c[e+28>>2])<(o=c[_+28>>2])||b==o&&(t=b,A=E,c[e+32>>2]<=c[_+32>>2])||(t=o,A=_),e=A;n:{if(a>t)o=c[e+32>>2];else if(a!=t||!((o=c[e+32>>2])<=c[k+88>>2]))break n;c[k+88>>2]=o,c[k+84>>2]=t,b=c[E+28>>2],a=t}if(c[_+28>>2]!=a|c[k+88>>2]!=c[_+32>>2]&&(c[k+88>>2]!=c[E+32>>2]||a!=b)){n:{a=c[r+28>>2];t:{if(c[L+32>>2]!=c[r+32>>2]||a!=c[L+28>>2]){if(G(L,r,k+56|0)>=u(0))break t;r=i[n+72>>2],a=c[r+28>>2]}if(c[P+32>>2]==c[r+32>>2]&&a==c[P+28>>2]||!(G(P,r,k+56|0)<=u(0)))break n}if((0|(e=i[n+72>>2]))==(0|P)){if(!n2(i[U+4>>2])||!z(i[F+4>>2],U))break i;for(e=i[i[f>>2]+16>>2];f=i[i[i[f+4>>2]+4>>2]>>2],A=i[f>>2],(0|e)==i[A+16>>2];);if(r=f,w[f+15|0]&&(r=0,(e=d2(i[i[i[i[i[f+4>>2]+8>>2]>>2]>>2]+4>>2],i[A+12>>2]))&&$(i[f>>2])&&(i[f>>2]=e,p[f+15|0]=0,i[e+24>>2]=f,r=i[i[i[f+4>>2]+4>>2]>>2])),!r)break i;e=i[i[i[r+4>>2]+8>>2]>>2],f=i[e>>2],a0(n,e,Y),m2=1,j2(n,r,i[i[f+4>>2]+12>>2],f,f,1);break a}if((0|e)==(0|L)){if(!n2(i[F+4>>2])||!z(i[U+12>>2],i[i[F+4>>2]+12>>2]))break i;for(r=i[i[i[f>>2]+4>>2]+16>>2],e=f;e=i[i[i[e+4>>2]+4>>2]>>2],(0|r)==i[i[i[e>>2]+4>>2]+16>>2];);r=i[i[i[i[i[i[e+4>>2]+8>>2]>>2]>>2]+4>>2]+8>>2],i[f>>2]=i[i[F+4>>2]+12>>2],m2=1,j2(n,e,i[a0(n,f,0)+8>>2],i[i[U+4>>2]+8>>2],r,1);break a}if(G(L,e,k+56|0)>=u(0)){if(p[f+14|0]=1,p[i[i[i[f+4>>2]+4>>2]>>2]+14|0]=1,!n2(i[U+4>>2]))break i;r=i[U+16>>2],e=i[n+72>>2],c[r+28>>2]=c[e+28>>2],c[r+32>>2]=c[e+32>>2]}else e=i[n+72>>2];if(!(G(P,e,k+56|0)<=u(0)))break a;if(p[Y+14|0]=1,p[f+14|0]=1,!n2(i[F+4>>2]))break i;f=i[F+16>>2],n=i[n+72>>2],c[f+28>>2]=c[n+28>>2],c[f+32>>2]=c[n+32>>2];break a}if(!n2(i[U+4>>2])||!n2(i[F+4>>2])||!z(i[i[F+4>>2]+12>>2],U))break i;if(e=i[U+16>>2],c[e+28>>2]=c[k+84>>2],c[e+32>>2]=c[k+88>>2],r=s1(i[n+68>>2],e),e=i[U+16>>2],i[e+36>>2]=r,(0|r)==2147483647)break f;i[k+112>>2]=i[E+12>>2],i[k+116>>2]=i[L+12>>2],i[k+120>>2]=i[_+12>>2],i[k+124>>2]=i[P+12>>2],i[e+24>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,a=c[e+28>>2],m=(t=u(c[L+28>>2]-a))>2],b=u(c[L+32>>2]-t),o=u(m+(b>2]-a))>2]-t),s=u(m+(b>2]=b,o=u(.5*+s/q),c[k+100>>2]=o,s=u(u(u(c[E+16>>2]*b)+u(c[L+16>>2]*o))+u(0)),c[e+16>>2]=s,y=u(u(u(c[E+20>>2]*b)+u(c[L+20>>2]*o))+u(0)),c[e+20>>2]=y,o=u(u(u(c[E+24>>2]*b)+u(c[L+24>>2]*o))+u(0)),c[e+24>>2]=o,m=(b=u(c[_+28>>2]-a))>2]-t),b=u(m+(b>2]-a))>2]-t),a=u(m+(a>2]=a,t=u(.5*+b/q),c[k+108>>2]=t,b=u(s+u(u(c[_+16>>2]*a)+u(c[P+16>>2]*t))),c[e+16>>2]=b,s=u(y+u(u(c[_+20>>2]*a)+u(c[P+20>>2]*t))),c[e+20>>2]=s,a=u(o+u(u(c[_+24>>2]*a)+u(c[P+24>>2]*t))),c[e+24>>2]=a,c[k+140>>2]=a,c[k+136>>2]=s,c[k+132>>2]=b,i[e+12>>2]=0,e=e+12|0,(0|(r=i[n+1736>>2]))==8?M[i[n+76>>2]](k+132|0,k+112|0,k+96|0,e):M[0|r](k+132|0,k+112|0,k+96|0,e,i[n+1896>>2]),i[e>>2]|w[n+60|0]||((0|(e=i[n+1732>>2]))==11?M[i[n+12>>2]](100156):M[0|e](100156,i[n+1896>>2]),p[n+60|0]=1),p[Y+14|0]=1,p[f+14|0]=1,p[i[i[i[f+4>>2]+4>>2]>>2]+14|0]=1}else E0(n,f)}return B=k+144|0,m2}L0(i[n+68>>2]),i[n+68>>2]=0}b2(n+1740|0,1),o2()}function y4(n){n|=0;var f=0,a=0,t=0,e=0,b=0,o=0,k=0,r=0,s=u(0),A=u(0),l=0,v=0,h=0,m=0,y=0,E=0,R=0,_=0,L=0,P=0;B=b=B-48|0,p[n+60|0]=0;i:{if(a=i[n+8>>2],(0|(f=i[a+64>>2]))!=(0|(k=a- -64|0)))for(;;){a=i[f+12>>2],e=i[f>>2],o=i[f+16>>2],t=i[i[f+4>>2]+16>>2];f:{if(!(c[o+28>>2]!=c[t+28>>2]|c[o+32>>2]!=c[t+32>>2]|i[a+12>>2]==(0|f))){i[b+24>>2]=0,i[b+28>>2]=0,i[b+16>>2]=0,i[b+20>>2]=0,t=i[287],i[b+8>>2]=i[286],i[b+12>>2]=t,t=i[285],i[b>>2]=i[284],i[b+4>>2]=t,t=i[a+16>>2],i[b+16>>2]=i[t+12>>2],i[b+20>>2]=i[o+12>>2],c[b+36>>2]=c[t+16>>2],c[b+40>>2]=c[t+20>>2],c[b+44>>2]=c[t+24>>2],i[t+12>>2]=0,t=t+12|0,(0|(o=i[n+1736>>2]))==8?M[i[n+76>>2]](b+36|0,b+16|0,b,t):M[0|o](b+36|0,b+16|0,b,t,i[n+1896>>2]),i[t>>2]||(i[t>>2]=i[b+16>>2]);a:{if(z(a,f)){if(!$(f))break a;t=i[a+12>>2];break f}break i}break i}t=a,a=f}if(i[t+12>>2]==(0|a)){if((0|a)!=(0|t)&&(e=i[e+4>>2]!=(0|t)&&(0|t)!=(0|e)?e:i[e>>2],!$(t))||(f=(0|a)==(0|e)|i[e+4>>2]==(0|a)?i[e>>2]:e,!$(a)))break i}else f=e;if((0|f)==(0|k))break}e=n,(f=H(28))?(t=f,(a=H(28))?(i[a+8>>2]=0,i[a+12>>2]=32,o=H(132),i[a>>2]=o,o?(k=H(264),i[a+4>>2]=k,k?(i[a+24>>2]=9,i[a+16>>2]=0,i[a+20>>2]=0,i[o+4>>2]=1,i[k+8>>2]=0):(j(o),j(a),a=0)):(j(a),a=0)):a=0,i[t>>2]=a,a?(t=H(128),i[f+4>>2]=t,t?(i[f+24>>2]=9,i[f+20>>2]=0,i[f+12>>2]=0,i[f+16>>2]=32):(j(i[a+4>>2]),j(i[a>>2]),j(a),j(f),f=0)):(j(f),f=0)):f=0,h=f,i[e+68>>2]=f;f:if(f){a:{a=i[n+8>>2];n:{if((0|(f=i[a>>2]))!=(0|a))for(;;){if(e=s1(h,f),i[f+36>>2]=e,(0|e)==2147483647)break n;if((0|a)==(0|(f=i[f>>2])))break}if(B=E=B-400|0,e=H(4+(f=(y=i[h+12>>2])<<2)|0),i[h+8>>2]=e,B=E+400|0,e){if(!((o=(f+e|0)-4|0)>>>0>>0)){if(a=i[h+4>>2],t=1+((k=(y<<2)-4|0)>>>2|0)&7)for(f=e;i[f>>2]=a,f=f+4|0,a=a+4|0,t=t-1|0;);else f=e;if(!(k>>>0<28))for(;i[f>>2]=a,i[f+28>>2]=a+28,i[f+24>>2]=a+24,i[f+20>>2]=a+20,i[f+16>>2]=a+16,i[f+12>>2]=a+12,i[f+8>>2]=a+8,i[f+4>>2]=a+4,a=a+32|0,o>>>0>=(f=f+32|0)>>>0;);}for(i[E+4>>2]=o,i[E>>2]=e,R=2016473283,r=1;;){if((l=i[((r<<3)+E|0)-4>>2])>>>0>(k=i[(m<<3)+E>>2])+40>>>0)for(;;){for(R=W(R,1539415821)+1|0,L=i[(f=((R>>>0)%(1+(l-k>>2)>>>0)<<2)+k|0)>>2],i[f>>2]=i[k>>2],i[k>>2]=L,t=l+4|0,a=k-4|0;;){e=t,v=i[a+4>>2],o=a,f=a+4|0,t=i[v>>2],s=c[t+28>>2],_=i[L>>2],r=f;t:if(!(s<(A=c[_+28>>2]))){for(;;){if(a=f,r=f,c[t+32>>2]<=c[_+32>>2]&&s==A)break t;if(f=a+4|0,o=a,v=i[a+4>>2],t=i[v>>2],A>(s=c[t+28>>2]))break}r=f}a=r,r=i[(t=e-4|0)>>2],f=i[r>>2];t:if(!(A<(s=c[f+28>>2])))for(;;){if(!(!(c[_+32>>2]<=c[f+32>>2])|s!=A))break t;if(e=t,r=i[(t=t-4|0)>>2],f=i[r>>2],A<(s=c[f+28>>2]))break}if(i[a>>2]=r,i[t>>2]=v,!(a>>>0>>0))break}if(f=i[a>>2],i[a>>2]=v,i[t>>2]=f,(a-k|0)<(l-t|0)?(f=e,t=l,l=o):(f=k,t=o,k=e),i[4+(a=(m<<3)+E|0)>>2]=t,i[a>>2]=f,m=m+1|0,!(k+40>>>0>>0))break}if(r=m,l>>>0>=(e=k+4|0)>>>0)for(;;){t=i[e>>2],a=f=e;t:if(!(k>>>0>=f>>>0))for(;;){if(o=i[t>>2],s=c[o+28>>2],m=i[(a=f-4|0)>>2],v=i[m>>2],s<(A=c[v+28>>2])){a=f;break t}if(!(!(c[o+32>>2]<=c[v+32>>2])|s!=A)){a=f;break t}if(i[f>>2]=m,!(k>>>0<(f=a)>>>0))break}if(i[a>>2]=t,!(l>>>0>=(e=e+4|0)>>>0))break}if(m=r-1|0,!((0|r)>=1))break}if(i[h+20>>2]=1,i[h+16>>2]=y,h=i[h>>2],(0|(e=i[h+8>>2]))>=1)for(l=i[h+4>>2],k=i[h>>2],a=e;;){for(t=a,r=l+((m=i[k+(a<<2)>>2])<<3)|0,f=a;(0|e)<=(0|(a=f<<1))||(v=i[l+(i[k+((o=1|a)<<2)>>2]<<3)>>2],s=c[v+28>>2],y=i[l+(i[k+(a<<2)>>2]<<3)>>2],A=c[y+28>>2],!(c[v+32>>2]<=c[y+32>>2])|s!=A&&!(s(0|e)||(o=i[r>>2],s=c[o+28>>2],v=i[k+(a<<2)>>2],R=i[(y=l+(v<<3)|0)>>2],s<(A=c[R+28>>2])|(c[o+32>>2]<=c[R+32>>2]?s==A:0)));)i[k+(f<<2)>>2]=v,i[y+4>>2]=f,f=a;if(i[k+(f<<2)>>2]=m,i[r+4>>2]=f,a=t-1|0,!((0|t)>1))break}i[h+20>>2]=1,f=1}else f=0;if(f)break a}L0(i[n+68>>2]),i[n+68>>2]=0;break f}if(a=n- -64|0,(f=H(20))?(i[f+16>>2]=10,i[f+12>>2]=n,i[f>>2]=0,i[f+8>>2]=f,i[f+4>>2]=f):f=0,i[a>>2]=f,!f)break i;if(m1(n,u(-3999999973526325e22)),m1(n,u(3999999973526325e22)),a=I0(i[n+68>>2]))for(;;){a:if(f=w1(i[n+68>>2]))for(;;){if(c[f+28>>2]!=c[a+28>>2]|c[f+32>>2]!=c[a+32>>2])break a;if(e=i[I0(i[n+68>>2])+8>>2],t=i[a+8>>2],i[b+24>>2]=0,i[b+28>>2]=0,i[b+16>>2]=0,i[b+20>>2]=0,f=i[287],i[b+8>>2]=i[286],i[b+12>>2]=f,f=i[285],i[b>>2]=i[284],i[b+4>>2]=f,f=i[t+16>>2],i[b+16>>2]=i[f+12>>2],i[b+20>>2]=i[i[e+16>>2]+12>>2],c[b+36>>2]=c[f+16>>2],c[b+40>>2]=c[f+20>>2],c[b+44>>2]=c[f+24>>2],i[f+12>>2]=0,f=f+12|0,(0|(o=i[n+1736>>2]))==8?M[i[n+76>>2]](b+36|0,b+16|0,b,f):M[0|o](b+36|0,b+16|0,b,f,i[n+1896>>2]),i[f>>2]||(i[f>>2]=i[b+16>>2]),!z(t,e))break i;if(!(f=w1(i[n+68>>2])))break}if(A0(n,a),!(a=I0(i[n+68>>2])))break}if(f=i[i[i[(e=n- -64|0)>>2]+4>>2]>>2],a=i[f>>2],i[n+72>>2]=i[a+16>>2],i[a+24>>2]=0,h2(i[f+4>>2]),j(f),a=i[e>>2],f=i[i[a+4>>2]>>2])for(;i[i[f>>2]+24>>2]=0,h2(i[f+4>>2]),j(f),a=i[e>>2],f=i[i[a+4>>2]>>2];);if((0|a)!=(0|(f=i[a+4>>2])))for(;j(f),(0|a)!=(0|(f=i[f+4>>2])););if(j(a),L0(i[n+68>>2]),P=1,n=i[n+8>>2],(0|(a=i[n+40>>2]))!=(0|(e=n+40|0)))for(;;){if(n=i[a+8>>2],a=i[a>>2],(0|n)==i[i[n+12>>2]+12>>2]&&(f=i[n+8>>2],i[f+28>>2]=i[f+28>>2]+i[n+28>>2],f=i[f+4>>2],i[f+28>>2]=i[f+28>>2]+i[i[n+4>>2]+28>>2],!$(n))){P=0;break f}if((0|a)==(0|e))break}}return B=b+48|0,0|P}b2(n+1740|0,1),o2()}function C0(n,f,a,t,e,b){var o=0,k=0,r=0,s=0,A=0,l=0,v=0,h=0,m=0,y=0,E=0,R=0,_=0,L=0,P=0,U=0,F=0;B=k=B-80|0,i[k+76>>2]=f,P=k+55|0,_=k+56|0,f=0;i:{f:for(;;){(0|m)<0||((2147483647-m|0)<(0|f)?(i[613]=61,m=-1):m=f+m|0);a:{n:{t:{if(A=i[k+76>>2],o=w[0|(f=A)])for(;;){b:{e:if(o&=255){if((0|o)!=37)break b;for(o=f;;){if(w[f+1|0]!=37)break e;if(r=f+2|0,i[k+76>>2]=r,o=o+1|0,l=w[f+2|0],f=r,(0|l)!=37)break}}else o=f;if(f=o-A|0,n&&Z(n,A,f),f)continue f;E=-1,o=1,r=k,f=i[k+76>>2],w[f+2|0]!=36|p[i[k+76>>2]+1|0]-48>>>0>=10||(E=p[f+1|0]-48|0,L=1,o=3),f=o+f|0,i[r+76>>2]=f,y=0;e:if((r=(s=p[0|f])-32|0)>>>0>31)o=f;else if(o=f,75913&(r=1<>2]=o,y|=r,(r=(s=p[f+1|0])-32|0)>>>0>=32)break e;if(f=o,!(75913&(r=1<>2]}else{if(r=k,p[o+1|0]-48>>>0>=10||(f=i[k+76>>2],w[f+2|0]!=36)){if(L)break t;L=0,v=0,n&&(f=i[a>>2],i[a>>2]=f+4,v=i[f>>2]),f=i[k+76>>2]+1|0}else i[((p[f+1|0]<<2)+e|0)-192>>2]=10,v=i[((p[f+1|0]<<3)+t|0)-384>>2],L=1,f=f+3|0;if(i[r+76>>2]=f,(0|v)>-1)break e;v=0-v|0,y|=8192}l=-1;e:if(w[0|f]==46)if(w[f+1|0]!=42)i[k+76>>2]=f+1,l=E1(k+76|0),f=i[k+76>>2];else{if(!(p[f+2|0]-48>>>0>=10)&&(f=i[k+76>>2],w[f+3|0]==36)){i[((p[f+2|0]<<2)+e|0)-192>>2]=10,l=i[((p[f+2|0]<<3)+t|0)-384>>2],f=f+4|0,i[k+76>>2]=f;break e}if(L)break t;n?(f=i[a>>2],i[a>>2]=f+4,l=i[f>>2]):l=0,f=i[k+76>>2]+2|0,i[k+76>>2]=f}for(o=0;;){if(R=o,h=-1,p[0|f]-65>>>0>57)break i;if(s=f+1|0,i[k+76>>2]=s,o=p[0|f],f=s,!((o=w[1103+(o+W(R,58)|0)|0])-1>>>0<8))break}e:{c:{if((0|o)!=19){if(!o)break i;if((0|E)>=0){i[(E<<2)+e>>2]=o,o=i[4+(f=(E<<3)+t|0)>>2],i[k+64>>2]=i[f>>2],i[k+68>>2]=o;break c}if(!n)break a;d1(k- -64|0,o,a),s=i[k+76>>2];break e}if((0|E)>-1)break i}if(f=0,!n)continue f}r=-65537&y,o=8192&y?r:y,h=0,E=1024,y=_;e:{c:{u:{o:{A:{s:{k:{r:{l:{v:{d:{p:{h:{m:{w:{switch(f=p[s-1|0],(f=R&&(15&f)==3?-33&f:f)-88|0){case 11:break e;case 9:case 13:case 14:case 15:break c;case 27:break k;case 12:case 17:break v;case 23:break d;case 0:case 32:break p;case 24:break h;case 22:break m;case 29:break w;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 10:case 16:case 18:case 19:case 20:case 21:case 25:case 26:case 28:case 30:case 31:break n}switch(f-65|0){case 0:case 4:case 5:case 6:break c;case 2:break A;case 1:case 3:break n}if((0|f)==83)break s;break n}s=i[k+64>>2],r=i[k+68>>2],E=1024;break l}f=0;m:switch(255&R){case 0:case 1:case 6:i[i[k+64>>2]>>2]=m;continue f;case 2:o=i[k+64>>2],i[o>>2]=m,i[o+4>>2]=m>>31;continue f;case 3:r2[i[k+64>>2]>>1]=m;continue f;case 4:p[i[k+64>>2]]=m;continue f;case 7:break m;default:continue f}o=i[k+64>>2],i[o>>2]=m,i[o+4>>2]=m>>31;continue f}l=l>>>0>8?l:8,o|=8,f=120}if(A=_,U=32&f,(r=R=i[k+68>>2])|(s=i[k+64>>2]))for(;p[0|(A=A-1|0)]=U|w[1632+(15&s)|0],F=!r&s>>>0>15|(0|r)!=0,R=r,r=r>>>4|0,s=(15&R)<<28|s>>>4,F;);if(!(i[k+64>>2]|i[k+68>>2])|!(8&o))break r;E=1024+(f>>>4|0)|0,h=2;break r}if(f=_,(r=A=i[k+68>>2])|(s=i[k+64>>2]))for(;p[0|(f=f-1|0)]=7&s|48,R=!r&s>>>0>7|(0|r)!=0,A=r,r=r>>>3|0,s=(7&A)<<29|s>>>3,R;);if(A=f,!(8&o))break r;l=(0|(f=_-A|0))<(0|l)?l:f+1|0;break r}r=f=i[k+68>>2],s=i[k+64>>2],(0|f)<-1||(0|f)<=-1?(r=0-(r+((0|s)!=0)|0)|0,s=0-s|0,i[k+64>>2]=s,i[k+68>>2]=r,h=1,E=1024):2048&o?(h=1,E=1025):E=(h=1&o)?1026:1024}A=q2(s,r,_)}if(o=(0|l)>-1?-65537&o:o,r=f=i[k+68>>2],!(l|(0|(s=i[k+64>>2]))!=0|(0|f)!=0)){l=0,A=_;break n}l=(0|(f=!(r|s)+(_-A|0)|0))<(0|l)?l:f;break n}y=(0|(f=l))!=0;k:{r:{l:{v:if(!(!(3&(o=A=(o=i[k+64>>2])||1071))|!f))for(;;){if(!w[0|o])break l;if(y=(0|(f=f-1|0))!=0,!(3&(o=o+1|0)))break v;if(!f)break}if(!y)break r}l:if(!(!w[0|o]|f>>>0<4))for(;;){if((-1^(s=i[o>>2]))&s-16843009&-2139062144)break l;if(o=o+4|0,!((f=f-4|0)>>>0>3))break}if(f)for(;;){if(s=o,!w[0|o])break k;if(o=o+1|0,!(f=f-1|0))break}}s=0}y=s||l+A|0,o=r,l=s?s-A|0:l;break n}if(r=i[k+64>>2],l)break o;f=0,i2(n,32,v,0,o);break u}i[k+12>>2]=0,i[k+8>>2]=i[k+64>>2],i[k+64>>2]=k+8,l=-1,r=k+8|0}f=0;o:{for(;;){if(!(A=i[r>>2]))break o;if(!((s=(0|(A=h1(k+4|0,A)))<0)|A>>>0>l-f>>>0)){if(r=r+4|0,l>>>0>(f=f+A|0)>>>0)continue;break o}break}if(h=-1,s)break i}if(i2(n,32,v,f,o),f)for(r=0,s=i[k+64>>2];;){if(!(A=i[s>>2])||(0|(r=(A=h1(k+4|0,A))+r|0))>(0|f))break u;if(Z(n,k+4|0,A),s=s+4|0,!(f>>>0>r>>>0))break}else f=0}i2(n,32,v,f,8192^o),f=(0|f)<(0|v)?v:f;continue f}f=0|M[0|b](n,X[k+64>>3],v,l,o,f);continue f}p[k+55|0]=i[k+64>>2],l=1,A=P,o=r;break n}r=f+1|0,i[k+76>>2]=r,o=w[f+1|0],f=r}if(h=m,n)break i;if(!L)break a;for(f=1;;){if(n=i[(f<<2)+e>>2]){if(d1((f<<3)+t|0,n,a),h=1,(0|(f=f+1|0))!=10)continue;break i}break}if(h=1,f>>>0>=10)break i;for(;;){if(i[(f<<2)+e>>2])break t;if((0|(f=f+1|0))==10)break}break i}h=-1;break i}i2(n,32,f=(0|(r=(l=(0|(s=y-A|0))>(0|l)?s:l)+h|0))>(0|v)?r:v,r,o),Z(n,E,h),i2(n,48,f,r,65536^o),i2(n,48,l,s,0),Z(n,A,s),i2(n,32,f,r,8192^o);continue}break}h=0}return B=k+80|0,h}function g4(n,f,a,t,e,b){n|=0,f=+f,a|=0,t|=0,e|=0,b|=0;var o=0,k=0,r=0,s=0,A=0,l=0,v=0,h=0,m=0,y=0,E=0,R=0,_=0,L=0,P=0,U=0,F=0,q=0,Y=0,k2=0,m2=0;B=s=B-560|0,i[s+44>>2]=0,g0(+f),o=0|l2(1),l2(0),(0|o)<-1||(0|o)<=-1?(P=1,U=1034,g0(+(f=-f)),o=0|l2(1),l2(0)):2048&e?(P=1,U=1037):(U=(P=1&e)?1040:1035,m2=!P);i:if((2146435072&o)!=2146435072){_=s+16|0;f:{a:{n:{if(f=g1(f,s+44|0),(f+=f)!=0){if(o=i[s+44>>2],i[s+44>>2]=o-1,(0|(F=32|b))!=97)break n;break f}if((0|(F=32|b))==97)break f;A=i[s+44>>2],v=(0|t)<0?6:t;break a}A=o-29|0,i[s+44>>2]=A,f*=268435456,v=(0|t)<0?6:t}for(k=E=(0|A)<0?s+48|0:s+336|0;o=f<4294967296&f>=0?~~f>>>0:0,i[(t=k)>>2]=o,k=k+4|0,(f=1e9*(f-+(o>>>0)))!=0;);if((0|A)<1)t=A,o=k,r=E;else for(r=E,t=A;;){if(R=(0|t)<29?t:29,!(r>>>0>(o=k-4|0)>>>0)){for(t=R,m=0;y=o,h=0,Y=m,m=i[o>>2],l=31&t,(63&t)>>>0>=32?(k2=m<>>32-l,l=m<>>0>(m=Y+l|0)>>>0?h+1|0:h,Y=y,y=x0(m=A1(l=m,h,1e9),v2,1e9,0),i[Y>>2]=l-y,r>>>0<=(o=o-4|0)>>>0;);(t=m)&&(i[(r=r-4|0)>>2]=t)}for(;r>>>0<(o=k)>>>0&&!i[(k=o-4|0)>>2];);if(t=i[s+44>>2]-R|0,i[s+44>>2]=t,k=o,!((0|t)>0))break}if(k=(v+25|0)/9|0,(0|t)<=-1)for(R=k+1|0,q=(0|F)==102;;){m=(0|t)<-9?9:0-t|0;a:if(o>>>0>r>>>0){for(y=1e9>>>m|0,l=-1<>2],i[k>>2]=Y+(t>>>m|0),t=W(y,t&l),(k=k+4|0)>>>0>>0;);if(r=i[r>>2]?r:r+4|0,!t)break a;i[o>>2]=t,o=o+4|0}else r=i[r>>2]?r:r+4|0;if(t=i[s+44>>2]+m|0,i[s+44>>2]=t,o=(0|R)>2?k+(R<<2)|0:o,!((0|t)<0))break}if(k=0,!(o>>>0<=r>>>0||(k=W(E-r>>2,9),t=10,(l=i[r>>2])>>>0<10)))for(;k=k+1|0,l>>>0>=(t=W(t,10))>>>0;);if((0|(t=(v-((0|F)==102?0:k)|0)-((0|F)==103&(0|v)!=0)|0))<(W(o-E>>2,9)-9|0)){if(h=(((l=(0|(y=t+9216|0))/9|0)<<2)+((0|A)<0?s+48|4:s+340|0)|0)-4096|0,t=10,(0|(y=y-W(l,9)|0))<=7)for(;t=W(t,10),(0|(y=y+1|0))!=8;);if(R=(y=i[h>>2])-W(t,l=(y>>>0)/(t>>>0)|0)|0,((0|(A=h+4|0))!=(0|o)||R)&&(f=(0|o)==(0|A)?1:1.5,L=(A=t>>>1|0)>>>0>R>>>0?.5:(0|A)==(0|R)?f:1.5,f=1&l?9007199254740994:9007199254740992,w[0|U]!=45|m2||(L=-L,f=-f),A=y-R|0,i[h>>2]=A,f+L!=f)){if(t=t+A|0,i[h>>2]=t,t>>>0>=1e9)for(;i[h>>2]=0,(h=h-4|0)>>>0>>0&&(i[(r=r-4|0)>>2]=0),t=i[h>>2]+1|0,i[h>>2]=t,t>>>0>999999999;);if(k=W(E-r>>2,9),t=10,!((A=i[r>>2])>>>0<10))for(;k=k+1|0,A>>>0>=(t=W(t,10))>>>0;);}o=(t=h+4|0)>>>0>>0?t:o}for(;l=o,!(A=o>>>0<=r>>>0)&&!i[(o=l-4|0)>>2];);if((0|F)==103){if(v=((t=(0|(o=v||1))>(0|k)&(0|k)>-5)?-1^k:-1)+o|0,b=(t?-1:-2)+b|0,!(m=8&e)){if(o=-9,!A&&(A=i[l-4>>2])&&(y=10,o=0,!((A>>>0)%10|0))){for(;t=o,o=o+1|0,!((A>>>0)%((y=W(y,10))>>>0)|0););o=-1^t}t=W(l-E>>2,9),(-33&b)!=70?(m=0,v=(0|(t=(0|(t=((t+k|0)+o|0)-9|0))>0?t:0))>(0|v)?v:t):(m=0,v=(0|(t=(0|(t=(t+o|0)-9|0))>0?t:0))>(0|v)?v:t)}}else m=8&e;if(R=(v|m)!=0,t=n,A=a,(0|(y=-33&b))==70)b=(0|k)>0?k:0;else{if((_-(o=q2((o=k>>31)+k^o,0,_))|0)<=1)for(;p[0|(o=o-1|0)]=48,(_-o|0)<2;);p[0|(q=o-2|0)]=b,p[o-1|0]=(0|k)<0?45:43,b=_-q|0}i2(t,32,A,h=1+(b+(R+(v+P|0)|0)|0)|0,e),Z(n,U,P),i2(n,48,a,h,65536^e);a:{n:{t:{if((0|y)==70){for(t=s+16|8,k=s+16|9,r=b=r>>>0>E>>>0?E:r;;){o=q2(i[r>>2],0,k);b:if((0|b)==(0|r))(0|o)==(0|k)&&(p[s+24|0]=48,o=t);else{if(s+16>>>0>=o>>>0)break b;for(;p[0|(o=o-1|0)]=48,s+16>>>0>>0;);}if(Z(n,o,k-o|0),!(E>>>0>=(r=r+4|0)>>>0))break}if(o=0,!R)break n;if(Z(n,1069,1),(0|v)<1|r>>>0>=l>>>0)break t;for(;;){if((o=q2(i[r>>2],0,k))>>>0>s+16>>>0)for(;p[0|(o=o-1|0)]=48,s+16>>>0>>0;);if(Z(n,o,(0|v)<9?v:9),o=v-9|0,l>>>0<=(r=r+4|0)>>>0)break n;if(t=(0|v)>9,v=o,!t)break}break n}b:if(!((0|v)<0))for(b=r>>>0>>0?l:r+4|0,A=s+16|9,t=s+16|8,k=r;;){(0|A)==(0|(o=q2(i[k>>2],0,A)))&&(p[s+24|0]=48,o=t);e:if((0|k)==(0|r))Z(n,o,1),o=o+1|0,!m&&(0|v)<=0||Z(n,1069,1);else{if(s+16>>>0>=o>>>0)break e;for(;p[0|(o=o-1|0)]=48,s+16>>>0>>0;);}if(Z(n,l=o,(0|(o=A-o|0))<(0|v)?o:v),v=v-o|0,b>>>0<=(k=k+4|0)>>>0)break b;if(!((0|v)>-1))break}i2(n,48,v+18|0,18,0),Z(n,q,_-q|0);break a}o=v}i2(n,48,o+9|0,9,0)}break i}if(E=(A=32&b)?U+9|0:U,!(t>>>0>11)&&(o=12-t|0)){for(L=8;L*=16,o=o-1|0;);f=w[0|E]!=45?f+L-L:-(L+(-f-L))}for((0|_)==(0|(o=q2((k=(o=i[s+44>>2])>>31)^o+k,0,_)))&&(p[s+15|0]=48,o=s+15|0),v=2|P,k=i[s+44>>2],p[0|(l=o-2|0)]=b+15,p[o-1|0]=(0|k)<0?45:43,o=8&e,r=s+16|0;b=r,m=A,k=A4(f)<2147483648?~~f:-2147483648,p[0|r]=m|w[k+1632|0],f=16*(f-+(0|k)),!(o||(0|t)>0|f!=0)|((r=b+1|0)-(s+16|0)|0)!=1||(p[b+1|0]=46,r=b+2|0),f!=0;);i2(b=n,32,o=a,h=(A=!t|((r-s|0)-18|0)>=(0|t)?(_-(l+(s+16|0)|0)|0)+r|0:2+((t+_|0)-l|0)|0)+v|0,e),Z(n,E,v),i2(n,48,a,h,65536^e),Z(n,s+16|0,t=r-(s+16|0)|0),i2(n,48,A-((b=t)+(t=_-l|0)|0)|0,0,0),Z(n,l,t)}else i2(n,32,a,h=P+3|0,-65537&e),Z(n,U,P),t=32&b,Z(n,f!=f?t?1053:1061:t?1057:1065,3);return i2(n,32,a,h,8192^e),B=s+560|0,0|((0|a)>(0|h)?a:h)}function A0(n,f){var a=0,t=0,e=0,b=0,o=0,k=u(0),r=0,s=u(0),A=0,l=0,v=0;B=o=B+-64|0,i[n+72>>2]=f,a=e=i[f+8>>2];i:{f:{a:{for(;;){if(t=i[a+24>>2])break a;if((0|e)==(0|(a=i[a+8>>2])))break}for(i[o>>2]=i[e+4>>2],e=a=i[n- -64>>2];e=i[e+4>>2],(t=i[e>>2])&&!(0|M[i[a+16>>2]](i[a+12>>2],o,t)););if(t=i[e>>2],e=i[i[i[t+4>>2]+8>>2]>>2],r=i[e>>2],b=i[t>>2],G(i[i[b+4>>2]+16>>2],f,i[b+16>>2])==u(0)){if(k=c[f+28>>2],e=i[t>>2],a=i[e+16>>2],!(k!=c[a+28>>2]|c[a+32>>2]!=c[f+32>>2])){if(t=i[f+8>>2],i[o+40>>2]=0,i[o+44>>2]=0,i[o+32>>2]=0,i[o+36>>2]=0,f=i[287],i[o+24>>2]=i[286],i[o+28>>2]=f,f=i[285],i[o+16>>2]=i[284],i[o+20>>2]=f,i[o+32>>2]=i[a+12>>2],i[o+36>>2]=i[i[t+16>>2]+12>>2],c[o+52>>2]=c[a+16>>2],c[o+56>>2]=c[a+20>>2],c[o+60>>2]=c[a+24>>2],i[a+12>>2]=0,f=a+12|0,(0|(a=i[n+1736>>2]))==8?M[i[n+76>>2]](o+52|0,o+32|0,o+16|0,f):M[0|a](o+52|0,o+32|0,o+16|0,f,i[n+1896>>2]),i[f>>2]||(i[f>>2]=i[o+32>>2]),z(e,t))break f;break i}if(b=i[e+4>>2],a=i[b+16>>2],c[a+32>>2]!=c[f+32>>2]||k!=c[a+28>>2]){if(!n2(b))break i;if(w[t+15|0]){if(!$(i[e+8>>2]))break i;p[t+15|0]=0}if(!z(i[f+8>>2],e))break i;A0(n,f);break f}for(;t=i[i[i[t+4>>2]+4>>2]>>2],(0|a)==i[i[i[t>>2]+4>>2]+16>>2];);if(e=i[i[i[t+4>>2]+8>>2]>>2],r=i[e>>2],b=i[r+4>>2],a=i[b+8>>2],w[e+15|0]){if(i[r+24>>2]=0,h2(i[e+4>>2]),j(e),!$(b))break i;b=i[i[a+4>>2]+12>>2]}if(!z(i[f+8>>2],b))break i;A=i[b+8>>2],b=a,f=a,e=i[i[a+4>>2]+16>>2],k=c[e+28>>2],r=i[a+16>>2],k<(s=c[r+28>>2])|(c[e+32>>2]<=c[r+32>>2]?k==s:0)||(f=0),j2(n,t,A,b,f,1);break f}if(l=w[t+12|0],r=i[r+4>>2],A=i[r+16>>2],k=c[A+28>>2],v=i[i[b+4>>2]+16>>2],a=t,k<(s=c[v+28>>2])||k==s&&(a=t,c[A+32>>2]<=c[v+32>>2])||(a=e),w[a+15|0]||l){n:{if((0|a)==(0|t)){if(e=d2(i[i[f+8>>2]+4>>2],i[b+12>>2]))break n;break i}if(!(e=d2(i[i[r+8>>2]+4>>2],i[f+8>>2])))break i;e=i[e+4>>2]}if(w[a+15|0]){if($(i[a>>2])){i[a>>2]=e,p[a+15|0]=0,i[e+24>>2]=a,A0(n,f);break f}break i}if(!(a=H(16))||(i[a>>2]=e,t=S0(i[n- -64>>2],i[t+4>>2],a),i[a+4>>2]=t,!t))break i;p[a+13|0]=0,p[a+14|0]=0,p[a+15|0]=0,i[e+24>>2]=a,b=i[n+56>>2],e=i[i[a>>2]+28>>2]+i[i[i[t+4>>2]>>2]+8>>2]|0,i[a+8>>2]=e;n:{t:switch(b-100130|0){case 0:t=1&e;break n;case 1:t=(0|e)!=0;break n;case 2:t=(0|e)>0;break n;case 3:t=e>>>31|0;break n;case 4:break t;default:break n}t=e+1>>>0>2}p[a+12|0]=t,A0(n,f);break f}j2(a=n,t,n=i[f+8>>2],n,0,1);break f}for(f=i[i[t>>2]+16>>2];t=i[i[i[t+4>>2]+4>>2]>>2],a=i[t>>2],(0|f)==i[a+16>>2];);if(w[t+15|0]&&(!(f=d2(i[i[i[i[i[t+4>>2]+8>>2]>>2]>>2]+4>>2],i[a+12>>2]))||!$(i[t>>2])||(i[t>>2]=f,p[t+15|0]=0,i[f+24>>2]=t,!(t=i[i[i[t+4>>2]+4>>2]>>2]))))break i;if(f=i[i[i[t+4>>2]+8>>2]>>2],a=i[f>>2],f=a0(n,f,0),(0|a)!=(0|(e=i[f+8>>2])))j2(n,t,e,a,a,1);else{if(e=i[t>>2],A=i[i[i[t+4>>2]+8>>2]>>2],r=i[A>>2],i[i[e+4>>2]+16>>2]!=i[i[r+4>>2]+16>>2]&&o1(n,t),v=1,b=i[n+72>>2],k=c[b+28>>2],l=i[e+16>>2],!(k!=c[l+28>>2]|c[l+32>>2]!=c[b+32>>2])){if(!z(i[i[a+4>>2]+12>>2],e))break i;for(a=i[i[t>>2]+16>>2];t=i[i[i[t+4>>2]+4>>2]>>2],b=i[t>>2],(0|a)==i[b+16>>2];);if(w[t+15|0]&&(!(a=d2(i[i[i[i[i[t+4>>2]+8>>2]>>2]>>2]+4>>2],i[b+12>>2]))||!$(i[t>>2])||(i[t>>2]=a,p[t+15|0]=0,i[a+24>>2]=t,!(t=i[i[i[t+4>>2]+4>>2]>>2]))))break i;b=i[i[i[t+4>>2]+8>>2]>>2],a=i[b>>2],a0(n,b,A),b=i[n+72>>2],k=c[b+28>>2],v=0}a:{if(s=k,l=i[r+16>>2],s!=(k=c[l+28>>2])|c[l+32>>2]!=c[b+32>>2]){if(v)break a}else{if(!z(f,i[i[r+4>>2]+12>>2]))break i;f=a0(n,A,0)}j2(n,t,i[f+8>>2],a,a,1);break f}if(a=i[e+16>>2],s=c[a+28>>2],!(c[l+32>>2]<=c[a+32>>2])|k!=s&&!(s>k)||(e=i[i[r+4>>2]+12>>2]),!(f=d2(i[i[f+8>>2]+4>>2],e)))break i;j2(n,t,f,a=i[f+8>>2],a,0),p[i[i[f+4>>2]+24>>2]+15|0]=1,u1(n,t)}}return void(B=o- -64|0)}b2(n+1740|0,1),o2()}function b1(n){n|=0;var f=0,a=0,t=0,e=u(0),b=u(0),o=0,k=0,r=u(0),s=u(0),A=u(0),l=u(0),v=0,h=u(0),m=0,y=u(0),E=u(0),R=u(0),_=u(0),L=u(0),P=u(0),U=u(0),F=0,q=0,Y=u(0),k2=u(0),m2=0,n0=0,B0=0,j0=0,T0=0,U0=0,F0=0,O0=0;m=i[n+8>>2],f=B-80|0,b=c[n+16>>2],c[f+8>>2]=b,E=c[n+20>>2],c[f+12>>2]=E,R=c[n+24>>2],c[f+16>>2]=R;i:if(m2=b==u(0)&E==u(0)&R==u(0)){if(i[f+76>>2]=-42943038,i[f+68>>2]=-42943038,i[f+72>>2]=-42943038,i[f+64>>2]=2104540610,i[f+56>>2]=2104540610,i[f+60>>2]=2104540610,n0=(0|(v=i[m>>2]))==(0|m))y=u(-19999999867631625e21),r=u(19999999867631625e21),s=u(19999999867631625e21),h=u(-19999999867631625e21),A=u(19999999867631625e21),l=u(-19999999867631625e21);else{for(_=u(19999999867631625e21),L=u(-19999999867631625e21),P=u(-19999999867631625e21),U=u(19999999867631625e21),Y=u(-19999999867631625e21),k2=u(19999999867631625e21),y=u(-19999999867631625e21),r=u(19999999867631625e21),l=u(-19999999867631625e21),A=u(19999999867631625e21),h=u(-19999999867631625e21),s=u(19999999867631625e21),a=v;y=(t=(e=c[a+24>>2])>y)?e:y,L=t?e:L,r=(F=e>2])>l)?e:l,P=o?e:P,A=(q=e>2])>h)?e:h,Y=k?e:Y,B0=k?a:B0,s=(k=e>2])););i[f+20>>2]=j0,c[f+56>>2]=k2,c[f+68>>2]=Y,i[f+32>>2]=B0,c[f+60>>2]=U,i[f+24>>2]=O0,c[f+72>>2]=P,i[f+36>>2]=F0,c[f+64>>2]=_,i[f+28>>2]=U0,c[f+76>>2]=L,i[f+40>>2]=T0}if(a=2,t=(o=u(l-A)>u(h-s))<<2,t=u(y-r)>u(c[t+(f+68|0)>>2]-c[t+(f+56|0)>>2])?2:o,c[(o=t<<2)+(f+56|0)>>2]>=c[o+(f+68|0)>>2])i[f+8>>2]=0,i[f+12>>2]=0;else{if(a=i[(t<<=2)+(f+20|0)>>2],t=i[t+(f+32|0)>>2],L=c[t+16>>2],A=u(c[a+16>>2]-L),c[f+44>>2]=A,P=c[t+20>>2],l=u(c[a+20>>2]-P),c[f+48>>2]=l,U=c[t+24>>2],e=u(c[a+24>>2]-U),c[f+52>>2]=e,!n0){for(_=u(0),a=v;r=u(c[a+20>>2]-P),s=u(c[a+16>>2]-L),y=u(u(A*r)-u(l*s)),h=u(c[a+24>>2]-U),r=u(u(l*h)-u(e*r)),s=u(u(e*s)-u(A*h)),(h=u(u(y*y)+u(u(r*r)+u(s*s))))>_&&(R=y,E=s,_=h,b=r),(0|m)!=(0|(a=i[a>>2])););if(c[f+16>>2]=R,c[f+12>>2]=E,c[f+8>>2]=b,!(_<=u(0)))break i}i[f+16>>2]=0,i[f+8>>2]=0,i[f+12>>2]=0,a=(l(A>2],a=(e(b>2]=1065353216,R=c[f+16>>2],b=c[f+8>>2],E=c[f+12>>2]}else v=i[m>>2];if(t=(E(b>2],a=n+28|0,t=(R(b>2]=0,i[(k=(t+1>>>0)%3<<2)+a>>2]=1065353216,i[(t=(t+2>>>0)%3<<2)+a>>2]=0,i[(a=n+40|0)+o>>2]=0,f=c[o+(f+8|0)>>2]>u(0),c[a+k>>2]=u(f?-0:0),c[a+t>>2]=u(f?1:-1),!(t=(0|m)==(0|v)))for(a=v;f=i[a+20>>2],i[a+28>>2]=i[a+16>>2],i[a+32>>2]=f,(0|m)!=(0|(a=i[a>>2])););if(m2&&(0|(f=i[m+40>>2]))!=(0|(o=m+40|0))){for(b=u(0);;){if(k=i[f+8>>2],i[(a=k)+28>>2]>=1)for(;F=i[a+16>>2],q=i[i[a+4>>2]+16>>2],b=u(b+u(u(c[F+28>>2]-c[q+28>>2])*u(c[F+32>>2]+c[q+32>>2]))),(0|k)!=(0|(a=i[a+12>>2])););if((0|o)==(0|(f=i[f>>2])))break}if(b>2]=-c[v+32>>2],(0|(v=i[v>>2]))!=(0|m););c[n+40>>2]=-c[n+40>>2],c[n+44>>2]=-c[n+44>>2],c[n+48>>2]=-c[n+48>>2]}}}function j(n){var f=0,a=0,t=0,e=0,b=0,o=0,k=0,r=0,s=0;i:if(n|=0){b=(t=n-8|0)+(n=-8&(f=i[n-4>>2]))|0;f:if(!(1&f)){if(!(3&f)||(t=t-(f=i[t>>2])|0)>>>0>2]))==3)return i[616]=n,i[b+4>>2]=-2&f,i[t+4>>2]=1|n,void(i[n+t>>2]=n)}else{if(f>>>0<=255){if(e=i[t+8>>2],f=f>>>3|0,(0|(a=i[t+12>>2]))==(0|e)){r=2456,s=i[614]&f2(f),i[r>>2]=s;break f}i[e+12>>2]=a,i[a+8>>2]=e;break f}if(k=i[t+24>>2],(0|t)==(0|(f=i[t+12>>2])))if((a=i[(e=t+20|0)>>2])||(a=i[(e=t+16|0)>>2])){for(;o=e,(a=i[(e=(f=a)+20|0)>>2])||(e=f+16|0,a=i[f+16>>2]););i[o>>2]=0}else f=0;else a=i[t+8>>2],i[a+12>>2]=f,i[f+8>>2]=a;if(!k)break f;e=i[t+28>>2];a:{if(i[(a=2760+(e<<2)|0)>>2]==(0|t)){if(i[a>>2]=f,f)break a;r=2460,s=i[615]&f2(e),i[r>>2]=s;break f}if(i[k+(i[k+16>>2]==(0|t)?16:20)>>2]=f,!f)break f}if(i[f+24>>2]=k,(a=i[t+16>>2])&&(i[f+16>>2]=a,i[a+24>>2]=f),!(a=i[t+20>>2]))break f;i[f+20>>2]=a,i[a+24>>2]=f}}if(!(t>>>0>=b>>>0)&&1&(f=i[b+4>>2])){f:{if(!(2&f)){if(i[620]==(0|b)){if(i[620]=t,n=i[617]+n|0,i[617]=n,i[t+4>>2]=1|n,i[619]!=(0|t))break i;return i[616]=0,void(i[619]=0)}if(i[619]==(0|b))return i[619]=t,n=i[616]+n|0,i[616]=n,i[t+4>>2]=1|n,void(i[n+t>>2]=n);n=(-8&f)+n|0;a:if(f>>>0<=255){if(e=i[b+8>>2],f=f>>>3|0,(0|(a=i[b+12>>2]))==(0|e)){r=2456,s=i[614]&f2(f),i[r>>2]=s;break a}i[e+12>>2]=a,i[a+8>>2]=e}else{if(k=i[b+24>>2],(0|b)==(0|(f=i[b+12>>2])))if((a=i[(e=b+20|0)>>2])||(a=i[(e=b+16|0)>>2])){for(;o=e,(a=i[(e=(f=a)+20|0)>>2])||(e=f+16|0,a=i[f+16>>2]););i[o>>2]=0}else f=0;else a=i[b+8>>2],i[a+12>>2]=f,i[f+8>>2]=a;if(k){e=i[b+28>>2];n:{if(i[(a=2760+(e<<2)|0)>>2]==(0|b)){if(i[a>>2]=f,f)break n;r=2460,s=i[615]&f2(e),i[r>>2]=s;break a}if(i[k+(i[k+16>>2]==(0|b)?16:20)>>2]=f,!f)break a}i[f+24>>2]=k,(a=i[b+16>>2])&&(i[f+16>>2]=a,i[a+24>>2]=f),(a=i[b+20>>2])&&(i[f+20>>2]=a,i[a+24>>2]=f)}}if(i[t+4>>2]=1|n,i[n+t>>2]=n,i[619]!=(0|t))break f;return void(i[616]=n)}i[b+4>>2]=-2&f,i[t+4>>2]=1|n,i[n+t>>2]=n}if(n>>>0<=255)return f=2496+((n=n>>>3|0)<<3)|0,(a=i[614])&(n=1<>2]:(i[614]=n|a,n=f),i[f+8>>2]=t,i[n+12>>2]=t,i[t+12>>2]=f,void(i[t+8>>2]=n);e=31,i[t+16>>2]=0,i[t+20>>2]=0,n>>>0<=16777215&&(f=n>>>8|0,f<<=o=f+1048320>>>16&8,e=28+((f=((f<<=e=f+520192>>>16&4)<<(a=f+245760>>>16&2)>>>15|0)-(a|e|o)|0)<<1|n>>>f+21&1)|0),i[t+28>>2]=e,o=2760+(e<<2)|0;f:{a:{if((a=i[615])&(f=1<>>1|0)|0),f=i[o>>2];;){if(a=f,(-8&i[f+4>>2])==(0|n))break a;if(f=e>>>29|0,e<<=1,!(f=i[16+(o=a+(4&f)|0)>>2]))break}i[o+16>>2]=t,i[t+24>>2]=a}else i[615]=f|a,i[o>>2]=t,i[t+24>>2]=o;i[t+12>>2]=t,i[t+8>>2]=t;break f}n=i[a+8>>2],i[n+12>>2]=t,i[a+8>>2]=t,i[t+24>>2]=0,i[t+12>>2]=a,i[t+8>>2]=n}n=i[622]-1|0,i[622]=n||-1}}}function C4(n,f){f|=0;var a=0,t=0,e=0,b=0,o=0,k=0,r=0,s=0,A=0,l=0,v=0,h=0,m=0,y=0,E=0,R=0,_=0;if(B=k=B-16|0,i[84+(n|=0)>>2]=0,(0|(s=i[f+40>>2]))!=(0|(m=f+40|0)))for(f=s;p[f+20|0]=0,(0|m)!=(0|(f=i[f>>2])););if((0|s)!=(0|m)){for(;;){if(!(w[s+20|0]|!w[s+21|0])){if(o=i[s+8>>2],w[n+80|0])f=1,a=1;else{e=0,t=0,f=0,b=i[(a=o)+20>>2];i:if(w[b+21|0])for(;;){if(w[(f=b)+20|0]){f=t;break i}if(p[f+20|0]=1,i[f+16>>2]=t,e=e+1|0,t=f,a=i[a+8>>2],b=i[a+20>>2],!w[b+21|0])break}t=i[o+4>>2],b=i[t+20>>2];i:{f:if(!w[b+21|0]|w[b+20|0]){if(E=o,!f)break i}else for(a=f;;){if(p[(f=b)+20|0]=1,i[f+16>>2]=a,e=e+1|0,E=i[t+12>>2],t=i[E+4>>2],b=i[t+20>>2],!w[b+21|0])break f;if(a=f,w[b+20|0])break}for(;p[f+20|0]=0,f=i[f+16>>2];);}R=(0|e)>1,b=0,a=0,f=0,v=i[o+12>>2],t=i[(r=v)+20>>2];i:if(w[t+21|0])for(;;){if(w[(f=t)+20|0]){f=a;break i}if(p[f+20|0]=1,i[f+16>>2]=a,b=b+1|0,a=f,r=i[r+8>>2],t=i[r+20>>2],!w[t+21|0])break}y=R?e:1,t=i[v+4>>2],e=i[t+20>>2];i:{f:if(!w[e+21|0]|w[e+20|0]){if(!f)break i}else for(a=f;;){if(p[(f=e)+20|0]=1,i[f+16>>2]=a,b=b+1|0,v=i[t+12>>2],t=i[v+4>>2],e=i[t+20>>2],!w[e+21|0])break f;if(a=f,w[e+20|0])break}for(;p[f+20|0]=0,f=i[f+16>>2];);}_=(0|b)>(0|y),e=0,a=0,f=0,h=i[i[o+8>>2]+4>>2],t=i[(r=h)+20>>2];i:if(w[t+21|0])for(;;){if(w[(f=t)+20|0]){f=a;break i}if(p[f+20|0]=1,i[f+16>>2]=a,e=e+1|0,a=f,r=i[r+8>>2],t=i[r+20>>2],!w[t+21|0])break}A=_?b:y,t=i[h+4>>2],b=i[t+20>>2];i:{f:if(!w[b+21|0]|w[b+20|0]){if(!f)break i}else for(a=f;;){if(p[(f=b)+20|0]=1,i[f+16>>2]=a,e=e+1|0,h=i[t+12>>2],t=i[h+4>>2],b=i[t+20>>2],!w[b+21|0])break f;if(a=f,w[b+20|0])break}for(;p[f+20|0]=0,f=i[f+16>>2];);}R0(k,o),r=i[k+8>>2],y=i[k+4>>2],l=i[k>>2],R0(k,i[o+12>>2]),b=i[k+8>>2],t=i[k+4>>2],a=i[k>>2],R0(k,i[i[o+8>>2]+4>>2]),f=e,(0|(f=(l=(0|(f=(A=(0|(f=(e=(0|e)>(0|A))?f:A))<(0|l))?l:f))<(0|a))?a:f))>=(0|(a=i[k>>2]))?(o=l?t:A?y:e?h:_?v:R?E:o,a=l?b:A?r:e||R|_?2:1):(o=i[k+4>>2],f=a,a=i[k+8>>2])}M[0|a](n,o,f)}if((0|m)==(0|(s=i[s>>2])))break}if(e=i[n+84>>2]){for((0|(f=i[n+1716>>2]))==3?M[i[n+88>>2]](4):M[0|f](4,i[n+1896>>2]),b=-1;;){for(f=i[e+8>>2];w[n+80|0]&&(0|(a=!(o=w[i[i[f+4>>2]+20>>2]+21|0])))!=(0|b)&&((0|(t=i[n+1720>>2]))==4?M[i[n+92>>2]](!o):M[0|t](!o,i[n+1896>>2]),b=a),(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[f+16>>2]+12>>2]):M[0|a](i[i[f+16>>2]+12>>2],i[n+1896>>2]),(0|(f=i[f+12>>2]))!=i[e+8>>2];);if(!(e=i[e+16>>2]))break}(0|(f=i[n+1728>>2]))==6?M[i[n+100>>2]]():M[0|f](i[n+1896>>2]),i[n+84>>2]=0}}B=k+16|0}function k1(n,f){var a=0,t=0,e=0,b=0,o=0,k=0,r=0,s=0;b=n+f|0;i:{f:if(!(1&(a=i[n+4>>2]))){if(!(3&a))break i;f=(a=i[n>>2])+f|0;a:{if((0|(n=n-a|0))!=i[619]){if(a>>>0<=255){if(e=i[n+8>>2],a=a>>>3|0,(0|(t=i[n+12>>2]))!=(0|e))break a;r=2456,s=i[614]&f2(a),i[r>>2]=s;break f}if(k=i[n+24>>2],(0|(a=i[n+12>>2]))==(0|n))if((t=i[(e=n+20|0)>>2])||(t=i[(e=n+16|0)>>2])){for(;o=e,(t=i[(e=(a=t)+20|0)>>2])||(e=a+16|0,t=i[a+16>>2]););i[o>>2]=0}else a=0;else t=i[n+8>>2],i[t+12>>2]=a,i[a+8>>2]=t;if(!k)break f;e=i[n+28>>2];n:{if(i[(t=2760+(e<<2)|0)>>2]==(0|n)){if(i[t>>2]=a,a)break n;r=2460,s=i[615]&f2(e),i[r>>2]=s;break f}if(i[k+(i[k+16>>2]==(0|n)?16:20)>>2]=a,!a)break f}if(i[a+24>>2]=k,(t=i[n+16>>2])&&(i[a+16>>2]=t,i[t+24>>2]=a),!(t=i[n+20>>2]))break f;i[a+20>>2]=t,i[t+24>>2]=a;break f}if((3&(a=i[b+4>>2]))!=3)break f;return i[616]=f,i[b+4>>2]=-2&a,i[n+4>>2]=1|f,void(i[b>>2]=f)}i[e+12>>2]=t,i[t+8>>2]=e}f:{if(!(2&(a=i[b+4>>2]))){if(i[620]==(0|b)){if(i[620]=n,f=i[617]+f|0,i[617]=f,i[n+4>>2]=1|f,i[619]!=(0|n))break i;return i[616]=0,void(i[619]=0)}if(i[619]==(0|b))return i[619]=n,f=i[616]+f|0,i[616]=f,i[n+4>>2]=1|f,void(i[n+f>>2]=f);f=(-8&a)+f|0;a:if(a>>>0<=255){if(e=i[b+8>>2],a=a>>>3|0,(0|(t=i[b+12>>2]))==(0|e)){r=2456,s=i[614]&f2(a),i[r>>2]=s;break a}i[e+12>>2]=t,i[t+8>>2]=e}else{if(k=i[b+24>>2],(0|b)==(0|(a=i[b+12>>2])))if((e=i[(t=b+20|0)>>2])||(e=i[(t=b+16|0)>>2])){for(;o=t,(e=i[(t=(a=e)+20|0)>>2])||(t=a+16|0,e=i[a+16>>2]););i[o>>2]=0}else a=0;else t=i[b+8>>2],i[t+12>>2]=a,i[a+8>>2]=t;if(k){e=i[b+28>>2];n:{if(i[(t=2760+(e<<2)|0)>>2]==(0|b)){if(i[t>>2]=a,a)break n;r=2460,s=i[615]&f2(e),i[r>>2]=s;break a}if(i[k+(i[k+16>>2]==(0|b)?16:20)>>2]=a,!a)break a}i[a+24>>2]=k,(t=i[b+16>>2])&&(i[a+16>>2]=t,i[t+24>>2]=a),(t=i[b+20>>2])&&(i[a+20>>2]=t,i[t+24>>2]=a)}}if(i[n+4>>2]=1|f,i[n+f>>2]=f,i[619]!=(0|n))break f;return void(i[616]=f)}i[b+4>>2]=-2&a,i[n+4>>2]=1|f,i[n+f>>2]=f}if(f>>>0<=255)return a=2496+((f=f>>>3|0)<<3)|0,(t=i[614])&(f=1<>2]:(i[614]=f|t,f=a),i[a+8>>2]=n,i[f+12>>2]=n,i[n+12>>2]=a,void(i[n+8>>2]=f);e=31,i[n+16>>2]=0,i[n+20>>2]=0,f>>>0<=16777215&&(a=f>>>8|0,a<<=o=a+1048320>>>16&8,e=28+((a=((a<<=e=a+520192>>>16&4)<<(t=a+245760>>>16&2)>>>15|0)-(t|e|o)|0)<<1|f>>>a+21&1)|0),i[n+28>>2]=e,o=2760+(e<<2)|0;f:{if((t=i[615])&(a=1<>>1|0)|0),a=i[o>>2];;){if(t=a,(-8&i[a+4>>2])==(0|f))break f;if(a=e>>>29|0,e<<=1,!(a=i[16+(o=t+(4&a)|0)>>2]))break}i[o+16>>2]=n,i[n+24>>2]=t}else i[615]=a|t,i[o>>2]=n,i[n+24>>2]=o;return i[n+12>>2]=n,void(i[n+8>>2]=n)}f=i[t+8>>2],i[f+12>>2]=n,i[t+8>>2]=n,i[n+24>>2]=0,i[n+12>>2]=t,i[n+8>>2]=f}}function E0(n,f){var a=0,t=0,e=0,b=u(0),o=0,k=0,r=u(0),s=0,A=0,l=0,v=0,h=0,m=0,y=0,E=0,R=0,_=0,L=0,P=0,U=0,F=0;B=e=B-48|0;i:{l=i[f>>2],k=i[l+16>>2],r=c[k+28>>2],a=i[i[i[f+4>>2]+8>>2]>>2],h=i[a>>2],t=i[h+16>>2],b=c[t+28>>2];f:{if(!(!(c[k+32>>2]<=c[t+32>>2])|r!=b)||r>2]+16>>2],k,t)>u(0))break f;if(k=i[l+16>>2],t=i[h+16>>2],c[k+32>>2]!=c[t+32>>2]||c[k+28>>2]!=c[t+28>>2]){if(!n2(i[h+4>>2])||!z(l,i[i[h+4>>2]+12>>2]))break i;_=1,p[a+14|0]=1,p[f+14|0]=1;break f}if(_=1,(0|t)==(0|k))break f;if(o=i[n+68>>2],(0|(f=i[k+36>>2]))>=0){if(m=i[o>>2],s=i[m>>2],k=f,A=i[m+4>>2],f=i[4+(L=A+(f<<3)|0)>>2],R=i[m+8>>2],E=i[s+(R<<2)>>2],i[s+(f<<2)>>2]=E,i[4+(P=(E<<3)+A|0)>>2]=f,U=R-1|0,i[m+8>>2]=U,(0|f)<(0|R)){a:{if((0|f)<2||(a=i[(i[s+(f<<1&-4)>>2]<<3)+A>>2],b=c[a+28>>2],y=i[(E<<3)+A>>2],b<(r=c[y+28>>2])||!(!(c[a+32>>2]<=c[y+32>>2])|r!=b)))for(F=(E<<3)+A|0;;){if((0|U)<=(0|(a=f<<1))||(v=i[(i[s+((t=1|a)<<2)>>2]<<3)+A>>2],r=c[v+28>>2],o=i[(i[s+(a<<2)>>2]<<3)+A>>2],b=c[o+28>>2],!(c[v+32>>2]<=c[o+32>>2])|r!=b&&!(r=(0|R)){a=f;break a}if(y=i[F>>2],r=c[y+28>>2],v=i[s+(a<<2)>>2],t=i[(o=(v<<3)+A|0)>>2],r<(b=c[t+28>>2])){a=f;break a}if(!(!(c[y+32>>2]<=c[t+32>>2])|r!=b)){a=f;break a}i[s+(f<<2)>>2]=v,i[o+4>>2]=f,f=a}for(;;){if(v=i[s+((a=f>>1)<<2)>>2],t=i[(o=(v<<3)+A|0)>>2],(b=c[t+28>>2])>2]<=c[y+32>>2])|r!=b)){a=f;break a}if(i[s+(f<<2)>>2]=v,i[o+4>>2]=f,!((f=a)>>>0>1))break}}i[s+(a<<2)>>2]=E,i[P+4>>2]=a}i[L>>2]=0,i[L+4>>2]=i[m+16>>2],i[m+16>>2]=k}else{i[i[o+4>>2]+((-1^f)<<2)>>2]=0;a:if(!((0|(f=i[o+12>>2]))<1))for(k=i[o+8>>2];;){if(i[i[k+((a=f-1|0)<<2)>>2]>>2])break a;if(i[o+12>>2]=a,t=(0|f)>1,f=a,!t)break}}if(a=i[i[h+4>>2]+12>>2],i[e+24>>2]=0,i[e+28>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,f=i[287],i[e+8>>2]=i[286],i[e+12>>2]=f,f=i[285],i[e>>2]=i[284],i[e+4>>2]=f,f=i[a+16>>2],i[e+16>>2]=i[f+12>>2],i[e+20>>2]=i[i[l+16>>2]+12>>2],c[e+36>>2]=c[f+16>>2],c[e+40>>2]=c[f+20>>2],c[e+44>>2]=c[f+24>>2],i[f+12>>2]=0,t=f+12|0,(0|(f=i[n+1736>>2]))==8?M[i[n+76>>2]](e+36|0,e+16|0,e,t):M[0|f](e+36|0,e+16|0,e,t,i[n+1896>>2]),i[t>>2]||(i[t>>2]=i[e+16>>2]),z(a,l))break f;break i}if(!(G(i[i[l+4>>2]+16>>2],t,k)>2]+4>>2]>>2]+14|0]=1,!n2(i[l+4>>2])||!z(i[i[h+4>>2]+12>>2],l)))break i}return B=e+48|0,_}b2(n+1740|0,1),o2()}function E4(n){n|=0;var f=0,a=0,t=u(0),e=u(0),b=u(0),o=u(0),k=u(0),r=u(0),s=0,A=0,l=0,v=u(0),h=u(0),m=0,y=u(0),E=u(0),R=u(0),_=u(0),L=u(0),P=0,U=0,F=u(0),q=u(0),Y=u(0);i:{f:if(!((0|(l=i[n+112>>2]))<3)){if(s=(U=n+116|0)+(l<<4)|0,o=c[n+24>>2],k=c[n+16>>2],r=c[n+20>>2],o!=u(0)||k!=u(0)|r!=u(0))y=c[n+124>>2],b=u(c[n+140>>2]-y),E=c[n+120>>2],v=u(c[n+136>>2]-E),R=c[n+116>>2],h=u(c[n+132>>2]-R);else{for(a=n+148|0,o=u(0),r=u(0),k=u(0),f=n+132|0,R=c[n+116>>2],t=h=u(c[f>>2]-R),E=c[n+120>>2],e=v=u(c[n+136>>2]-E),y=c[n+124>>2],_=b=u(c[n+140>>2]-y);L=u(c[f+20>>2]-E),F=u(c[a>>2]-R),q=u(u(t*L)-u(e*F)),Y=u(c[f+24>>2]-y),e=u(u(e*Y)-u(_*L)),t=u(u(_*F)-u(t*Y)),u(u(o*q)+u(u(k*e)+u(r*t)))>=u(0)?(r=u(r+t),k=u(k+e),o=u(o+q)):(r=u(r-t),k=u(k-e),o=u(o-q)),t=F,e=L,_=Y,s>>>0>(a=(f=a)+16|0)>>>0;);if((0|l)<3)break f}for(a=n+148|0,f=m=n+132|0;;){t=b,b=v,P=f,e=h,v=u(c[f+20>>2]-E),h=u(c[(f=a)>>2]-R),L=u(o*u(u(e*v)-u(b*h))),_=b,b=u(c[P+24>>2]-y);a:if((t=u(L+u(u(k*u(u(_*b)-u(t*v)))+u(r*u(u(t*h)-u(e*b))))))!=u(0)){if(t>u(0)){if(a=0,P=(0|A)<0,A=1,!P)break a;break i}if(a=0,P=(0|A)>0,A=-1,P)break i}if(!(s>>>0>(a=f+16|0)>>>0))break}switch(a=0,0|A){case 2:break i;case 0:break f}a=1;a:{n:switch(i[n+56>>2]-100132|0){case 0:if((0|A)>=0)break a;break f;case 2:break i;case 1:break n;default:break a}if((0|A)>0)break f}(0|(f=i[n+1716>>2]))==3?M[i[n+88>>2]](w[n+81|0]?2:(0|l)<4?4:6):M[0|f](w[n+81|0]?2:(0|l)<4?4:6,i[n+1896>>2]),(0|(f=i[n+1724>>2]))==5?M[i[n+96>>2]](i[n+128>>2]):M[0|f](i[n+128>>2],i[n+1896>>2]);a:if((0|A)<=0){if(U>>>0>=(f=s-16|0)>>>0)break a;for(;(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[s-4>>2]):M[0|a](i[s-4>>2],i[n+1896>>2]),s=f,U>>>0<(f=f-16|0)>>>0;);}else if(!((0|l)<2))for(;(0|(f=i[n+1724>>2]))==5?M[i[n+96>>2]](i[m+12>>2]):M[0|f](i[m+12>>2],i[n+1896>>2]),(m=m+16|0)>>>0>>0;);(0|(f=i[n+1728>>2]))==6?M[i[n+100>>2]]():M[0|f](i[n+1896>>2])}a=1}return 0|a}function l0(n,f){var a=0,t=0,e=0,b=0,o=0,k=0,r=0,s=0,A=0,l=0,v=0,h=0,m=0;if(!n)return H(f);if(f>>>0>=4294967232)return i[613]=48,0;o=f>>>0<11?16:f+11&-8,e=-8&(s=i[4+(b=n-8|0)>>2]);i:if(3&s){k=e+b|0;f:if(e>>>0>=o>>>0){if((t=e-o|0)>>>0<16)break f;i[b+4>>2]=1&s|o|2,i[4+(a=b+o|0)>>2]=3|t,i[k+4>>2]=1|i[k+4>>2],k1(a,t)}else if(i[620]!=(0|k))if(i[619]!=(0|k)){if(2&(t=i[k+4>>2])||(A=e+(-8&t)|0)>>>0>>0)break i;v=A-o|0;a:if(t>>>0<=255){if(e=i[k+8>>2],a=t>>>3|0,(0|(t=i[k+12>>2]))==(0|e)){h=2456,m=i[614]&f2(a),i[h>>2]=m;break a}i[e+12>>2]=t,i[t+8>>2]=e}else{if(l=i[k+24>>2],(0|(r=i[k+12>>2]))==(0|k))if((a=i[(e=k+20|0)>>2])||(a=i[(e=k+16|0)>>2])){for(;t=e,r=a,(a=i[(e=a+20|0)>>2])||(e=r+16|0,a=i[r+16>>2]););i[t>>2]=0}else r=0;else a=i[k+8>>2],i[a+12>>2]=r,i[r+8>>2]=a;if(l){t=i[k+28>>2];n:{if(i[(a=2760+(t<<2)|0)>>2]==(0|k)){if(i[a>>2]=r,r)break n;h=2460,m=i[615]&f2(t),i[h>>2]=m;break a}if(i[(i[l+16>>2]==(0|k)?16:20)+l>>2]=r,!r)break a}i[r+24>>2]=l,(a=i[k+16>>2])&&(i[r+16>>2]=a,i[a+24>>2]=r),(a=i[k+20>>2])&&(i[r+20>>2]=a,i[a+24>>2]=r)}}v>>>0<=15?(i[b+4>>2]=1&s|A|2,i[4+(a=b+A|0)>>2]=1|i[a+4>>2]):(i[b+4>>2]=1&s|o|2,i[4+(t=b+o|0)>>2]=3|v,i[4+(a=b+A|0)>>2]=1|i[a+4>>2],k1(t,v))}else{if((t=e+i[616]|0)>>>0>>0)break i;(a=t-o|0)>>>0>=16?(i[b+4>>2]=1&s|o|2,i[4+(e=b+o|0)>>2]=1|a,i[(t=t+b|0)>>2]=a,i[t+4>>2]=-2&i[t+4>>2]):(i[b+4>>2]=t|1&s|2,i[4+(a=t+b|0)>>2]=1|i[a+4>>2],a=0,e=0),i[619]=e,i[616]=a}else{if((e=e+i[617]|0)>>>0<=o>>>0)break i;i[b+4>>2]=1&s|o|2,a=e-o|0,i[4+(t=b+o|0)>>2]=1|a,i[617]=a,i[620]=t}a=b}else{if(o>>>0<256||e>>>0>=o+4>>>0&&(a=b,e-o>>>0<=i[734]<<1>>>0))break i;a=0}return a?a+8|0:(b=H(f))?(c1(b,n,f>>>0>(a=(3&(a=i[n-4>>2])?-4:-8)+(-8&a)|0)>>>0?a:f),j(n),b):0}function u1(n,f){var a=0,t=0,e=0,b=0,o=0,k=0,r=u(0),s=0,A=u(0);for(t=i[i[i[f+4>>2]+8>>2]>>2];;){i:{if(w[t+14|0])for(;t=i[i[i[(f=t)+4>>2]+8>>2]>>2],w[t+14|0];);f:{a:{n:{t:{if(w[f+14|0])a=f;else if(!(a=i[i[i[f+4>>2]+4>>2]>>2])||(t=f,!w[a+14|0]))break t;p[a+14|0]=0,e=i[a>>2],f=i[i[e+4>>2]+16>>2],o=i[t>>2];b:if((0|f)!=i[i[o+4>>2]+16>>2]){r=c[f+28>>2],s=i[i[i[a+4>>2]+8>>2]>>2],b=i[s>>2],k=i[i[b+4>>2]+16>>2],A=c[k+28>>2];e:{if(!(!(c[f+32>>2]<=c[k+32>>2])|r!=A)||r>2])>2]+4>>2]>>2]+14|0]=1,!(f=n2(e)))break f;if(z(i[b+4>>2],f))break e;break i}if(G(k,f,i[b+16>>2])>u(0)){f=a;break b}if(p[s+14|0]=1,p[a+14|0]=1,!(f=n2(b))||!z(i[e+12>>2],i[b+4>>2]))break i;f=i[f+4>>2]}if(p[i[f+20>>2]+21|0]=w[a+12|0],w[t+15|0]){if(i[i[t>>2]+24>>2]=0,h2(i[t+4>>2]),j(t),!$(o))break i;t=i[i[i[a+4>>2]+8>>2]>>2],o=i[t>>2],f=a}else if(w[a+15|0]){if(i[i[a>>2]+24>>2]=0,h2(i[a+4>>2]),j(a),!$(e))break i;f=i[i[i[t+4>>2]+4>>2]>>2],e=i[f>>2]}else f=a}else f=a;if(i[e+16>>2]==i[o+16>>2])break a;if(a=i[i[e+4>>2]+16>>2],b=i[i[o+4>>2]+16>>2],w[t+15|0]|w[f+15|0]|(0|a)==(0|b)||(k=a,(0|(a=i[n+72>>2]))!=(0|b)&&(0|k)!=(0|a)))break n;if(!o1(n,f))break a}return}E0(n,f)}if(i[e+16>>2]!=i[o+16>>2]||(b=i[e+4>>2],a=i[o+4>>2],i[b+16>>2]!=i[a+16>>2]))continue;if(i[o+28>>2]=i[o+28>>2]+i[e+28>>2],i[a+28>>2]=i[a+28>>2]+i[b+28>>2],i[i[f>>2]+24>>2]=0,h2(i[f+4>>2]),j(f),!$(e))break i;f=i[i[i[t+4>>2]+4>>2]>>2];continue}}break}b2(n+1740|0,1),o2()}function R4(n){n|=0;var f=0,a=0,t=0,e=u(0),b=u(0),o=0,k=0,r=0,s=0;if((0|(f=i[n+40>>2]))!=(0|(r=n+40|0)))for(;;){if(n=i[f>>2],w[f+21|0]){for(f=f+8|0;f=i[f>>2],a=i[i[f+4>>2]+16>>2],e=c[a+28>>2],t=i[f+16>>2],b=c[t+28>>2],!(!(c[a+32>>2]<=c[t+32>>2])|e!=b)||e>2]+4|0;for(;!(!(c[t+32>>2]<=c[a+32>>2])|e!=b)||e>b;)f=i[f+12>>2],t=i[f+16>>2],b=c[t+28>>2],a=i[i[f+4>>2]+16>>2],e=c[a+28>>2];i:{f:if((0|(t=i[i[f+8>>2]+4>>2]))!=i[f+12>>2])for(;;){if(o=i[t+16>>2],b=c[o+28>>2],!(c[a+32>>2]<=c[o+32>>2])|e!=b&&!(b>e)){a:if(i[t+12>>2]!=(0|f))for(;;){if(a=i[i[f+8>>2]+4>>2],o=i[a+16>>2],e=c[o+28>>2],k=i[i[a+4>>2]+16>>2],!(e<(b=c[k+28>>2])|(c[o+32>>2]<=c[k+32>>2]?e==b:0))){if(!(G(i[i[f+4>>2]+16>>2],i[f+16>>2],o)>=u(0)))break a;a=i[i[f+8>>2]+4>>2]}if(f=d2(f,a),a=0,!f)break i;if((0|(f=i[f+4>>2]))==i[t+12>>2])break}f=i[f+12>>2]}else{a:if((0|(a=i[t+12>>2]))!=(0|f))for(o=t+12|0;;){if(k=i[i[a+4>>2]+16>>2],e=c[k+28>>2],s=i[a+16>>2],!(e<(b=c[s+28>>2])|(c[k+32>>2]<=c[s+32>>2]?e==b:0))){if(!(G(i[t+16>>2],i[i[t+4>>2]+16>>2],k)<=u(0)))break a;a=i[o>>2]}if(t=d2(a,t),a=0,!t)break i;if(o=(t=i[t+4>>2])+12|0,(0|(a=i[t+12>>2]))==(0|f))break}t=i[i[t+8>>2]+4>>2]}if(i[f+12>>2]==(0|t))break f;a=i[i[f+4>>2]+16>>2],e=c[a+28>>2]}if(a=i[t+12>>2],i[a+12>>2]!=(0|f))for(;;){if(t=d2(a,t),a=0,!t)break i;if(t=i[t+4>>2],a=i[t+12>>2],i[a+12>>2]==(0|f))break}a=1}if(!a)return 0}if((0|r)==(0|(f=n)))break}return 1}function $(n){var f=0,a=0,t=0,e=0,b=0,o=0;if(e=i[n+4>>2],(0|(o=i[e+20>>2]))!=(0|(a=i[n+20>>2]))){for(f=t=i[a+8>>2];i[f+20>>2]=o,(0|t)!=(0|(f=i[f+12>>2])););f=i[a>>2],t=i[a+4>>2],i[f+4>>2]=t,i[t>>2]=f,j(a)}if((0|(t=i[n+8>>2]))!=(0|n)){if(b=i[n+4>>2],f=i[b+12>>2],i[i[b+20>>2]+8>>2]=f,i[i[n+16>>2]+8>>2]=t,b=i[f+8>>2],i[i[t+4>>2]+12>>2]=f,i[i[b+4>>2]+12>>2]=n,i[n+8>>2]=b,i[f+8>>2]=t,(0|a)==(0|o)){if(!(a=H(24)))return 0;for(f=i[n+20>>2],t=i[f+4>>2],i[a+4>>2]=t,i[t>>2]=a,i[a>>2]=f,i[f+4>>2]=a,i[a+12>>2]=0,i[a+16>>2]=0,i[a+8>>2]=n,p[a+20|0]=0,p[a+21|0]=w[f+21|0],f=n;i[f+20>>2]=a,(0|(f=i[f+12>>2]))!=(0|n););}}else{for(a=i[n+16>>2],f=t=i[a+8>>2];i[f+16>>2]=0,(0|t)!=(0|(f=i[f+8>>2])););f=i[a>>2],t=i[a+4>>2],i[f+4>>2]=t,i[t>>2]=f,j(a)}if((0|(f=i[e+8>>2]))!=(0|e))a=i[i[e+4>>2]+12>>2],i[i[n+20>>2]+8>>2]=a,i[i[e+16>>2]+8>>2]=f,t=i[a+8>>2],i[i[f+4>>2]+12>>2]=a,i[i[t+4>>2]+12>>2]=e,i[e+8>>2]=t,i[a+8>>2]=f;else{for(a=i[e+16>>2],f=t=i[a+8>>2];i[f+16>>2]=0,(0|t)!=(0|(f=i[f+8>>2])););for(f=i[a>>2],t=i[a+4>>2],i[f+4>>2]=t,i[t>>2]=f,j(a),a=i[e+20>>2],f=e=i[a+8>>2];i[f+20>>2]=0,(0|e)!=(0|(f=i[f+12>>2])););f=i[a>>2],e=i[a+4>>2],i[f+4>>2]=e,i[e>>2]=f,j(a)}return f=i[n+4>>2],f=i[(n=n>>>0>f>>>0?f:n)>>2],a=i[i[n+4>>2]>>2],i[i[f+4>>2]>>2]=a,i[i[a+4>>2]>>2]=f,j(n),1}function d2(n,f){var a=0,t=0,e=0,b=0,o=0,k=0,r=0,s=0;if(t=0,a=H(64)){if(k=i[n+4>>2],b=i[(t=n>>>0>k>>>0?k:n)+4>>2],e=i[b>>2],i[a+32>>2]=e,i[i[e+4>>2]>>2]=a,i[a>>2]=t,o=a+32|0,i[b>>2]=o,i[a+16>>2]=0,i[a+20>>2]=0,i[a+12>>2]=o,i[a+4>>2]=o,i[a+24>>2]=0,i[a+28>>2]=0,i[a+48>>2]=0,i[a+52>>2]=0,i[a+44>>2]=a,i[a+40>>2]=o,i[a+36>>2]=a,i[a+56>>2]=0,i[a+60>>2]=0,i[a+8>>2]=a,(0|(r=i[n+20>>2]))!=(0|(b=i[f+20>>2]))){for(t=e=i[b+8>>2];i[t+20>>2]=r,(0|e)!=(0|(t=i[t+12>>2])););t=i[b>>2],e=i[b+4>>2],i[t+4>>2]=e,i[e>>2]=t,j(b),k=i[n+4>>2],e=i[a+8>>2],t=i[n+20>>2]}else e=a,t=b;if(n=i[n+12>>2],s=i[n+8>>2],i[i[e+4>>2]+12>>2]=n,i[i[s+4>>2]+12>>2]=a,i[a+8>>2]=s,i[n+8>>2]=e,n=i[f+8>>2],e=i[a+40>>2],i[i[e+4>>2]+12>>2]=f,i[i[n+4>>2]+12>>2]=o,i[a+40>>2]=n,i[f+8>>2]=e,i[a+16>>2]=i[k+16>>2],f=i[f+16>>2],n=t,i[a+52>>2]=n,i[a+48>>2]=f,i[a+20>>2]=n,i[n+8>>2]=o,t=a,(0|b)==(0|r)&&(t=0,f=H(24))){for(t=i[n+4>>2],i[f+4>>2]=t,i[t>>2]=f,i[f>>2]=n,i[n+4>>2]=f,i[f+12>>2]=0,i[f+16>>2]=0,i[f+8>>2]=a,p[f+20|0]=0,p[f+21|0]=w[n+21|0],t=a;i[t+20>>2]=f,(0|(t=i[t+12>>2]))!=(0|a););t=a}}return t}function c1(n,f,a){var t=0,e=0;if(a>>>0>=512)m4(0|n,0|f,0|a);else{t=n+a|0;i:if(3&(n^f))if(t>>>0<4)a=n;else if((e=t-4|0)>>>0>>0)a=n;else for(a=n;p[0|a]=w[0|f],p[a+1|0]=w[f+1|0],p[a+2|0]=w[f+2|0],p[a+3|0]=w[f+3|0],f=f+4|0,e>>>0>=(a=a+4|0)>>>0;);else{f:if(3&n)if((0|a)<1)a=n;else for(a=n;;){if(p[0|a]=w[0|f],f=f+1|0,!(3&(a=a+1|0)))break f;if(!(a>>>0>>0))break}else a=n;if(!((n=-4&t)>>>0<64||(e=n+-64|0)>>>0>>0))for(;i[a>>2]=i[f>>2],i[a+4>>2]=i[f+4>>2],i[a+8>>2]=i[f+8>>2],i[a+12>>2]=i[f+12>>2],i[a+16>>2]=i[f+16>>2],i[a+20>>2]=i[f+20>>2],i[a+24>>2]=i[f+24>>2],i[a+28>>2]=i[f+28>>2],i[a+32>>2]=i[f+32>>2],i[a+36>>2]=i[f+36>>2],i[a+40>>2]=i[f+40>>2],i[a+44>>2]=i[f+44>>2],i[a+48>>2]=i[f+48>>2],i[a+52>>2]=i[f+52>>2],i[a+56>>2]=i[f+56>>2],i[a+60>>2]=i[f+60>>2],f=f- -64|0,e>>>0>=(a=a- -64|0)>>>0;);if(n>>>0<=a>>>0)break i;for(;i[a>>2]=i[f>>2],f=f+4|0,n>>>0>(a=a+4|0)>>>0;);}if(a>>>0>>0)for(;p[0|a]=w[0|f],f=f+1|0,(0|t)!=(0|(a=a+1|0)););}}function n2(n){var f=0,a=0,t=0,e=0,b=0,o=0;if(b=n|=0,n=0,(f=H(64))&&(t=i[b+4>>2],e=i[(a=t>>>0>>0?t:b)+4>>2],o=i[e>>2],i[f+32>>2]=o,i[i[o+4>>2]>>2]=f,i[f>>2]=a,a=f+32|0,i[e>>2]=a,i[f+16>>2]=0,i[f+20>>2]=0,i[f+12>>2]=a,i[f+4>>2]=a,i[f+24>>2]=0,i[f+28>>2]=0,i[f+48>>2]=0,i[f+52>>2]=0,i[f+40>>2]=a,i[f+36>>2]=f,i[f+56>>2]=0,i[f+60>>2]=0,i[f+8>>2]=f,e=i[b+12>>2],o=i[e+8>>2],i[f+44>>2]=e,i[i[o+4>>2]+12>>2]=f,i[f+8>>2]=o,i[e+8>>2]=f,e=i[t+16>>2],i[f+16>>2]=e,t=H(40))){for(n=i[e+4>>2],i[t+4>>2]=n,i[n>>2]=t,i[t>>2]=e,i[e+4>>2]=t,i[t+12>>2]=0,i[t+8>>2]=a,n=a;i[n+16>>2]=t,(0|a)!=(0|(n=i[n+8>>2])););n=i[b+20>>2],i[f+20>>2]=n,i[f+52>>2]=n,n=f}return n?(f=i[n+4>>2],n=i[b+4>>2],a=i[i[n+4>>2]+12>>2],t=i[a+8>>2],e=i[n+8>>2],i[i[e+4>>2]+12>>2]=a,i[i[t+4>>2]+12>>2]=n,i[n+8>>2]=t,i[a+8>>2]=e,a=i[f+8>>2],t=i[n+8>>2],i[i[t+4>>2]+12>>2]=f,i[i[a+4>>2]+12>>2]=n,i[n+8>>2]=a,i[f+8>>2]=t,i[n+16>>2]=i[f+16>>2],a=i[f+4>>2],i[i[a+16>>2]+8>>2]=a,i[a+20>>2]=i[n+20>>2],i[f+28>>2]=i[b+28>>2],i[a+28>>2]=i[n+28>>2],0|f):0}function j2(n,f,a,t,e,b){var o=0,k=0,r=0,s=0,A=0;s=f+4|0,r=n- -64|0;i:{for(;;){if(k=i[a+4>>2],!(o=H(16))||(i[o>>2]=k,A=S0(i[r>>2],i[f+4>>2],o),i[o+4>>2]=A,!A))break i;if(p[o+13|0]=0,p[o+14|0]=0,p[o+15|0]=0,i[k+24>>2]=o,(0|t)==(0|(a=i[a+8>>2])))break}if(o=i[i[i[f+4>>2]+8>>2]>>2],a=i[i[o>>2]+4>>2],e=e||i[a+8>>2],i[a+16>>2]==i[e+16>>2])for(r=0;;){if(t=f,f=o,(0|(o=e))!=i[(e=a)+8>>2]&&(!z(i[i[e+4>>2]+12>>2],e)||!z(i[i[o+4>>2]+12>>2],e)))break i;k=i[t+8>>2]-i[e+28>>2]|0,i[f+8>>2]=k;f:{a:switch(i[n+56>>2]-100130|0){case 0:a=1&k;break f;case 1:a=(0|k)!=0;break f;case 2:a=(0|k)>0;break f;case 3:a=k>>>31|0;break f;case 4:break a;default:break f}a=k+1>>>0>2}if(p[f+12|0]=a,p[t+14|0]=1,r&&E0(n,t)&&(i[e+28>>2]=i[e+28>>2]+i[o+28>>2],a=i[e+4>>2],i[a+28>>2]=i[a+28>>2]+i[i[o+4>>2]+28>>2],i[i[t>>2]+24>>2]=0,h2(i[s>>2]),j(t),!$(o)))break i;if(s=f+4|0,r=1,o=i[i[i[f+4>>2]+8>>2]>>2],a=i[i[o>>2]+4>>2],i[a+16>>2]!=i[e+16>>2])break}return p[f+14|0]=1,void(b&&u1(n,f))}b2(n+1740|0,1),o2()}function r1(n){var f=0,a=0,t=0,e=0,b=0,o=0,k=0,r=0,s=0;if((0|(e=i[40+(n|=0)>>2]))!=(0|(k=n+40|0)))for(;;){if(s=i[e>>2],!w[e+21|0]){for(r=i[e+8>>2],n=i[r+12>>2];;){if(i[n+20>>2]=0,o=i[n+12>>2],f=i[n+4>>2],!i[f+20>>2]){if(t=i[n+16>>2],(0|(a=i[n+8>>2]))!=(0|n))i[t+8>>2]=a,t=i[f+12>>2],b=i[t+8>>2],i[i[a+4>>2]+12>>2]=t,i[i[b+4>>2]+12>>2]=n,i[n+8>>2]=b,i[t+8>>2]=a;else{for(f=a=i[t+8>>2];i[f+16>>2]=0,(0|a)!=(0|(f=i[f+8>>2])););f=i[t>>2],a=i[t+4>>2],i[f+4>>2]=a,i[a>>2]=f,j(t),f=i[n+4>>2]}if(t=i[f+16>>2],(0|(a=i[f+8>>2]))!=(0|f))i[t+8>>2]=a,t=i[i[f+4>>2]+12>>2],b=i[t+8>>2],i[i[a+4>>2]+12>>2]=t,i[i[b+4>>2]+12>>2]=f,i[f+8>>2]=b,i[t+8>>2]=a;else{for(f=a=i[t+8>>2];i[f+16>>2]=0,(0|a)!=(0|(f=i[f+8>>2])););f=i[t>>2],a=i[t+4>>2],i[f+4>>2]=a,i[a>>2]=f,j(t),f=i[n+4>>2]}t=i[(f=n>>>0>f>>>0?f:n)>>2],a=i[i[f+4>>2]>>2],i[i[t+4>>2]>>2]=a,i[i[a+4>>2]>>2]=t,j(f)}if(f=(0|n)!=(0|r),n=o,!f)break}n=i[e>>2],o=i[e+4>>2],i[n+4>>2]=o,i[o>>2]=n,j(e)}if((0|k)==(0|(e=s)))break}}function z(n,f){var a=0,t=0,e=0,b=0,o=0,k=0;if((0|(n|=0))!=(0|(f|=0))){if((0|(t=i[f+16>>2]))!=(0|(o=i[n+16>>2]))){for(a=e=i[t+8>>2];i[a+16>>2]=o,(0|e)!=(0|(a=i[a+8>>2])););a=i[t>>2],e=i[t+4>>2],i[a+4>>2]=e,i[e>>2]=a,j(t)}if((0|(k=i[n+20>>2]))!=(0|(e=i[f+20>>2]))){for(a=b=i[e+8>>2];i[a+20>>2]=k,(0|b)!=(0|(a=i[a+12>>2])););a=i[e>>2],b=i[e+4>>2],i[a+4>>2]=b,i[b>>2]=a,j(e)}if(a=i[n+8>>2],b=i[f+8>>2],i[i[b+4>>2]+12>>2]=n,i[i[a+4>>2]+12>>2]=f,i[f+8>>2]=a,i[n+8>>2]=b,(0|t)==(0|o)){if(!(t=H(40)))return 0;for(a=i[n+16>>2],o=i[a+4>>2],i[t+4>>2]=o,i[o>>2]=t,i[t>>2]=a,i[a+4>>2]=t,i[t+12>>2]=0,i[t+8>>2]=f,a=f;i[a+16>>2]=t,(0|(a=i[a+8>>2]))!=(0|f););i[i[n+16>>2]+8>>2]=n}if((0|e)==(0|k)){if(!(t=H(24)))return 0;for(a=i[n+20>>2],e=i[a+4>>2],i[t+4>>2]=e,i[e>>2]=t,i[t>>2]=a,i[a+4>>2]=t,i[t+12>>2]=0,i[t+16>>2]=0,i[t+8>>2]=f,p[t+20|0]=0,p[t+21|0]=w[a+21|0],a=f;i[a+20>>2]=t,(0|(a=i[a+12>>2]))!=(0|f););i[i[n+20>>2]+8>>2]=n}}return 1}function s1(n,f){var a=0,t=0,e=0,b=0,o=0,k=0,r=u(0),s=0,A=0,l=u(0);if(i[n+20>>2]){t=f,a=i[n>>2],n=i[a+8>>2]+1|0,i[a+8>>2]=n;i:{if(!((0|(f=i[a+12>>2]))>=n<<1)){if(i[a+12>>2]=f<<1,e=i[a+4>>2],f=l0(b=i[a>>2],f<<3|4),i[a>>2]=f,!f){i[a>>2]=b,e=2147483647;break i}if(f=l0(i[a+4>>2],8+(i[a+12>>2]<<3)|0),i[a+4>>2]=f,!f){i[a+4>>2]=e,e=2147483647;break i}}if(b=i[a+4>>2],e=n,(f=i[a+16>>2])&&(i[a+16>>2]=i[4+(b+(f<<3)|0)>>2],e=f),o=i[a>>2],i[o+(n<<2)>>2]=e,i[(k=b+(e<<3)|0)>>2]=t,i[k+4>>2]=n,i[a+20>>2]){f:if(n>>>0<2)f=n;else for(r=c[t+28>>2];;){if(a=i[((f=n>>1)<<2)+o>>2],A=i[(s=b+(a<<3)|0)>>2],(l=c[A+28>>2])>2]<=c[t+32>>2])|r!=l)){f=n;break f}if(i[(n<<2)+o>>2]=a,i[s+4>>2]=n,!((n=f)>>>0>1))break}i[(f<<2)+o>>2]=e,i[k+4>>2]=f}}return e}if(t=(a=i[n+12>>2])+1|0,i[n+12>>2]=t,e=i[n+4>>2],(0|(b=t))<(0|(t=i[n+16>>2])))t=e;else if(i[n+16>>2]=t<<1,t=l0(e,t<<3),i[n+4>>2]=t,!t)return i[n+4>>2]=e,2147483647;return i[(a<<2)+t>>2]=f,-1^a}function f0(n){n|=0;var f=0,a=0,t=0,e=0,b=0,o=0,k=0;b=H(40),o=H(40);i:{if(!(t=H(24))||!b|!o){if(b&&j(b),o&&j(o),!t)break i;return j(t),0}if(!(f=H(64)))return 0;for(a=i[n+68>>2],e=i[(a=a>>>0<(e=n- -64|0)>>>0?a:e)+4>>2],k=i[e>>2],i[f+32>>2]=k,i[i[k+4>>2]>>2]=f,i[f>>2]=a,a=e,e=f+32|0,i[a>>2]=e,i[f+16>>2]=0,i[f+20>>2]=0,i[f+12>>2]=e,i[f+4>>2]=e,i[f+24>>2]=0,i[f+28>>2]=0,i[f+48>>2]=0,i[f+52>>2]=0,i[f+44>>2]=f,i[f+40>>2]=e,i[f+36>>2]=f,i[f+56>>2]=0,i[f+60>>2]=0,i[f+8>>2]=f,a=i[n+4>>2],i[b+4>>2]=a,i[a>>2]=b,i[b+12>>2]=0,i[b+8>>2]=f,a=f;i[a+16>>2]=b,(0|(a=i[a+8>>2]))!=(0|f););for(i[o+4>>2]=b,i[b>>2]=o,i[o>>2]=n,i[n+4>>2]=o,i[o+12>>2]=0,i[o+8>>2]=e,a=e;i[a+16>>2]=o,(0|e)!=(0|(a=i[a+8>>2])););for(a=i[n+44>>2],i[t+4>>2]=a,i[a>>2]=t,i[t>>2]=n+40,i[n+44>>2]=t,i[t+12>>2]=0,i[t+16>>2]=0,i[t+8>>2]=f,p[t+20|0]=0,p[t+21|0]=w[n+61|0],a=f;i[a+20>>2]=t,(0|(a=i[a+12>>2]))!=(0|f););}return 0|f}function R0(n,f){var a=0,t=0,e=0,b=0,o=0,k=0;i[n+8>>2]=i[283],a=i[282],i[n>>2]=i[281],i[n+4>>2]=a,a=i[f+20>>2];i:if(w[a+21|0]){e=f;f:{a:{for(;;){if(w[a+20|0])break i;if(p[a+20|0]=1,i[a+16>>2]=t,e=i[i[e+12>>2]+4>>2],t=i[e+20>>2],w[t+21|0]){if(w[t+20|0])break a;if(p[t+20|0]=1,i[t+16>>2]=a,b=b+2|0,e=i[e+8>>2],a=i[e+20>>2],w[a+21|0])continue;break i}break}b|=1;break f}b|=1}t=a}else e=f;o=i[f+4>>2],a=i[o+20>>2];i:if(!(!w[a+21|0]|w[a+20|0])){f:{a:{for(;;){if(p[a+20|0]=1,i[a+16>>2]=t,f=i[o+12>>2],o=i[f+4>>2],t=i[o+20>>2],w[t+21|0]){if(w[t+20|0])break a;if(p[t+20|0]=1,i[t+16>>2]=a,k=k+2|0,f=i[i[o+8>>2]+4>>2],o=i[f+4>>2],a=i[o+20>>2],!w[a+21|0])break i;if(!w[a+20|0])continue;break i}break}k|=1;break f}k|=1}t=a}a=b+k|0,i[n>>2]=a;i:{if(1&b){if(!(1&k))break i;i[n>>2]=a-1,f=f+8|0}else f=e+4|0;f=i[f>>2]}if(i[n+4>>2]=f,t)for(;p[t+20|0]=0,t=i[t+16>>2];);}function M4(n,f,a){f|=0,a|=0,(0|(a=i[1716+(n|=0)>>2]))==3?M[i[n+88>>2]](5):M[0|a](5,i[n+1896>>2]),(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[f+16>>2]+12>>2]):M[0|a](i[i[f+16>>2]+12>>2],i[n+1896>>2]),(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[i[f+4>>2]+16>>2]+12>>2]):M[0|a](i[i[i[f+4>>2]+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2];i:if(w[a+21|0])for(;;){if(w[a+20|0]||(p[a+20|0]=1,f=i[i[f+12>>2]+4>>2],(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[f+16>>2]+12>>2]):M[0|a](i[i[f+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2],!w[a+21|0]|w[a+20|0]))break i;if(p[a+20|0]=1,f=i[f+8>>2],(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[i[f+4>>2]+16>>2]+12>>2]):M[0|a](i[i[i[f+4>>2]+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2],!w[a+21|0])break}(0|(f=i[n+1728>>2]))==6?M[i[n+100>>2]]():M[0|f](i[n+1896>>2])}function E2(n,f){f|=0;var a=0;if((0|(a=i[(n|=0)>>2]))!=(0|f))for(;;){i:if(f>>>0>a>>>0){f:switch(0|a){case 0:(0|(a=i[n+1732>>2]))==11?M[i[n+12>>2]](100151):M[0|a](100151,i[n+1896>>2]),i[n>>2]&&E2(n,0),i[n+112>>2]=0,a=1,i[n>>2]=1,p[n+108|0]=0,i[n+1896>>2]=0,i[n+8>>2]=0;break i;case 1:break f;default:break i}if((0|(a=i[n+1732>>2]))==11?M[i[n+12>>2]](100152):M[0|a](100152,i[n+1896>>2]),i[n>>2]!=1&&E2(n,1),i[n>>2]=2,i[n+4>>2]=0,a=2,i[n+112>>2]<1)break i;p[n+108|0]=1}else{f:switch(a-1|0){case 1:(0|(a=i[n+1732>>2]))==11?M[i[n+12>>2]](100154):M[0|a](100154,i[n+1896>>2]),i[n>>2]!=2&&E2(n,2),a=1,i[n>>2]=1;break i;case 0:break f;default:break i}(0|(a=i[n+1732>>2]))==11?M[i[n+12>>2]](100153):M[0|a](100153,i[n+1896>>2]),(a=i[n+8>>2])&&_0(a),a=0,i[n+8>>2]=0,i[n>>2]=0,i[n+4>>2]=0}if((0|f)==(0|a))break}}function A1(n,f,a){var t=0,e=0,b=0,o=0,k=0,r=0,s=0,A=0,l=0;i:{f:{a:{n:{t:{b:{e:{c:{u:{o:{if(e=f,f){if(!(t=a))break o;break u}n=(n>>>0)/(a>>>0)|0,v2=0;break i}if(!n)break c;break e}if(!(t-1&t))break b;r=0-(k=(s0(t)+33|0)-s0(e)|0)|0;break n}n=(e>>>0)/0|0,v2=0;break i}if((t=32-s0(e)|0)>>>0<31)break t;break a}if((0|t)==1)break f;a=31&(t=t?31-s0(t-1^t)|0:32),(63&t)>>>0>=32?(e=0,n=f>>>a|0):(e=f>>>a|0,n=((1<>>a),v2=e;break i}k=t+1|0,r=63-t|0}if(t=f,b=31&(e=63&k),e>>>0>=32?(e=0,b=t>>>b|0):(e=t>>>b|0,b=((1<>>b),t=31&(r&=63),r>>>0>=32?(f=n<>>32-t|f<>>31)-(A=a&(o=r-((e=e<<1|b>>>31)+(t>>>0>>0)|0)>>31))|0,e=e-(s>>>0>>0)|0,f=f<<1|n>>>31,n=l|n<<1,l=o&=1,k=k-1|0;);v2=f<<1|n>>>31,n=o|n<<1;break i}n=0,f=0}v2=f}return n}function I4(n,f,a){f|=0,a|=0;var t=0,e=0,b=0,o=0,k=0,r=0,s=0;B=e=B-32|0,b=i[28+(n|=0)>>2],i[e+16>>2]=b,t=i[n+20>>2],i[e+28>>2]=a,i[e+24>>2]=f,f=t-b|0,i[e+20>>2]=f,b=f+a|0,s=2,f=e+16|0;i:{f:{(t=0|e1(i[n+60>>2],e+16|0,2,e+12|0))?(i[613]=t,t=-1):t=0;a:{if(!t)for(;;){if((0|(t=i[e+12>>2]))==(0|b))break a;if((0|t)<=-1)break f;if(o=t-((k=(o=i[f+4>>2])>>>0>>0)?o:0)|0,i[(r=(k<<3)+f|0)>>2]=o+i[r>>2],i[(r=(k?12:4)+f|0)>>2]=i[r>>2]-o,b=b-t|0,f=k?f+8|0:f,s=s-k|0,(t=0|e1(i[n+60>>2],0|f,0|s,e+12|0))?(i[613]=t,t=-1):t=0,t)break}if((0|b)!=-1)break f}f=i[n+44>>2],i[n+28>>2]=f,i[n+20>>2]=f,i[n+16>>2]=f+i[n+48>>2],n=a;break i}i[n+28>>2]=0,i[n+16>>2]=0,i[n+20>>2]=0,i[n>>2]=32|i[n>>2],n=0,(0|s)!=2&&(n=a-i[f+4>>2]|0)}return B=e+32|0,0|n}function l1(n){var f=0,a=0,t=0,e=0,b=0,o=0,k=u(0),r=0,s=u(0),A=0,l=0,v=0,h=0,m=0,y=0;if(e=i[n+4>>2],a=i[n>>2],t=i[a+4>>2],m=i[(f=e+(t<<3)|0)>>2],!((0|(b=i[n+8>>2]))<1)&&(A=i[(b<<2)+a>>2],i[a+4>>2]=A,i[4+(l=(A<<3)+e|0)>>2]=1,i[f>>2]=0,i[f+4>>2]=i[n+16>>2],v=b-1|0,i[n+8>>2]=v,i[n+16>>2]=t,(0|b)!=1)){for(y=(A<<3)+e|0,f=1;(0|v)<=(0|(n=f<<1))||(o=i[(i[((t=1|n)<<2)+a>>2]<<3)+e>>2],k=c[o+28>>2],r=i[(i[(n<<2)+a>>2]<<3)+e>>2],s=c[r+28>>2],!(c[o+32>>2]<=c[r+32>>2])|k!=s&&!(k=(0|b)||(t=i[y>>2],k=c[t+28>>2],o=i[(n<<2)+a>>2],h=i[(r=(o<<3)+e|0)>>2],k<(s=c[h+28>>2])|(c[t+32>>2]<=c[h+32>>2]?k==s:0)));)i[(f<<2)+a>>2]=o,i[r+4>>2]=f,f=n;i[(f<<2)+a>>2]=A,i[l+4>>2]=f}return m}function _4(n,f,a){f|=0,a|=0,(0|(a=i[1716+(n|=0)>>2]))==3?M[i[n+88>>2]](6):M[0|a](6,i[n+1896>>2]),(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[f+16>>2]+12>>2]):M[0|a](i[i[f+16>>2]+12>>2],i[n+1896>>2]),(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[i[f+4>>2]+16>>2]+12>>2]):M[0|a](i[i[i[f+4>>2]+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2];i:if(w[a+21|0])for(;;){if(w[a+20|0])break i;if(p[a+20|0]=1,f=i[f+8>>2],(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[i[f+4>>2]+16>>2]+12>>2]):M[0|a](i[i[i[f+4>>2]+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2],!w[a+21|0])break}(0|(f=i[n+1728>>2]))==6?M[i[n+100>>2]]():M[0|f](i[n+1896>>2])}function v1(n,f,a){var t=0,e=0;if(a&&(p[(t=n+a|0)-1|0]=f,p[0|n]=f,!(a>>>0<3||(p[t-2|0]=f,p[n+1|0]=f,p[t-3|0]=f,p[n+2|0]=f,a>>>0<7||(p[t-4|0]=f,p[n+3|0]=f,a>>>0<9||(t=(t=n)+(n=0-n&3)|0,e=W(255&f,16843009),i[t>>2]=e,i[(f=(n=a-n&-4)+t|0)-4>>2]=e,n>>>0<9||(i[t+8>>2]=e,i[t+4>>2]=e,i[f-8>>2]=e,i[f-12>>2]=e,n>>>0<25||(i[t+24>>2]=e,i[t+20>>2]=e,i[t+16>>2]=e,i[t+12>>2]=e,i[f-16>>2]=e,i[f-20>>2]=e,i[f-24>>2]=e,i[f-28>>2]=e,(a=n-(f=4&t|24)|0)>>>0<32))))))))for(e=x0(e,0,1,1),n=v2,f=f+t|0;i[f+24>>2]=e,t=n,i[f+28>>2]=t,i[f+16>>2]=e,i[f+20>>2]=t,i[f+8>>2]=e,i[f+12>>2]=t,i[f>>2]=e,i[f+4>>2]=t,f=f+32|0,(a=a-32|0)>>>0>31;);}function d1(n,f,a){i:if(!(f>>>0>20)){f:switch(f-9|0){case 0:return f=i[a>>2],i[a>>2]=f+4,void(i[n>>2]=i[f>>2]);case 1:return f=i[a>>2],i[a>>2]=f+4,f=i[f>>2],i[n>>2]=f,void(i[n+4>>2]=f>>31);case 2:return f=i[a>>2],i[a>>2]=f+4,i[n>>2]=i[f>>2],void(i[n+4>>2]=0);case 3:return f=i[a>>2]+7&-8,i[a>>2]=f+8,a=i[f+4>>2],i[n>>2]=i[f>>2],void(i[n+4>>2]=a);case 4:return f=i[a>>2],i[a>>2]=f+4,f=r2[f>>1],i[n>>2]=f,void(i[n+4>>2]=f>>31);case 5:return f=i[a>>2],i[a>>2]=f+4,i[n>>2]=L2[f>>1],void(i[n+4>>2]=0);case 6:return f=i[a>>2],i[a>>2]=f+4,f=p[0|f],i[n>>2]=f,void(i[n+4>>2]=f>>31);case 7:return f=i[a>>2],i[a>>2]=f+4,i[n>>2]=w[0|f],void(i[n+4>>2]=0);case 8:return f=i[a>>2]+7&-8,i[a>>2]=f+8,void(X[n>>3]=X[f>>3]);case 9:break f;default:break i}M[0](n,a)}}function G(n,f,a){var t=u(0),e=u(0),b=0,o=0,k=u(0),r=u(0),s=0,A=u(0),l=u(0);B=o=B+-64|0,s=(t=c[f+28>>2])>(e=c[n+28>>2]);i:{f:{if(!(!(c[n+32>>2]<=c[f+32>>2])|t!=e)||s){if((k=c[a+28>>2])>t|(c[f+32>>2]<=c[a+32>>2]?t==k:0))break i;if(b=1,s)break f}b=0,t==e&&(b=c[n+32>>2]<=c[f+32>>2])}s=b,b=1,(k=c[a+28>>2])>t||(b=0,t==k&&(b=c[f+32>>2]<=c[a+32>>2])),r=c[n+32>>2],A=c[f+32>>2],l=c[a+32>>2],X[o+40>>3]=k,X[o+24>>3]=t,X[o+48>>3]=l,X[o+32>>3]=A,X[o+16>>3]=r,X[o+8>>3]=e,i[o+4>>2]=b,i[o>>2]=s,R1(1092,o),k=c[a+28>>2],e=c[n+28>>2],t=c[f+28>>2]}return r=u(0),B=o- -64|0,e=u(t-e),t=u(k-t),u(e+t)>u(0)&&(r=e,e=c[f+32>>2],r=u(u(r*u(e-c[a+32>>2]))+u(t*u(e-c[n+32>>2])))),r}function a0(n,f,a){var t=0,e=0,b=0,o=0;t=i[f>>2];i:{if((0|f)!=(0|a))for(;;){if(p[f+15|0]=0,o=i[f+4>>2],b=i[i[o+8>>2]>>2],e=i[b>>2],i[e+16>>2]!=i[t+16>>2]){if(!w[b+15|0])return n=w[f+12|0],a=i[t+20>>2],i[a+8>>2]=t,p[a+21|0]=n,i[t+24>>2]=0,h2(o),j(f),t;if(!(e=d2(i[i[t+8>>2]+4>>2],i[e+4>>2]))||!$(i[b>>2]))break i;i[b>>2]=e,p[b+15|0]=0,i[e+24>>2]=b}if(i[t+8>>2]!=(0|e)&&(!z(i[i[e+4>>2]+12>>2],e)||!z(t,e)))break i;if(e=w[f+12|0],t=i[f>>2],o=i[t+20>>2],i[o+8>>2]=t,p[o+21|0]=e,i[t+24>>2]=0,h2(i[f+4>>2]),j(f),t=i[b>>2],(0|a)==(0|(f=b)))break}return t}b2(n+1740|0,1),o2()}function W2(n,f,a){switch(f-100100|0){case 0:return void(i[n+88>>2]=a||15);case 6:return void(i[n+1716>>2]=a||3);case 4:return p[n+80|0]=(0|a)!=0,void(i[n+92>>2]=a||14);case 10:return p[n+80|0]=(0|a)!=0,void(i[n+1720>>2]=a||4);case 1:return void(i[n+96>>2]=a||13);case 7:return void(i[n+1724>>2]=a||5);case 2:return void(i[n+100>>2]=a||12);case 8:return void(i[n+1728>>2]=a||6);case 3:return void(i[n+12>>2]=a||18);case 9:return void(i[n+1732>>2]=a||11);case 5:return void(i[n+76>>2]=a||17);case 11:return void(i[n+1736>>2]=a||8);case 12:return void(i[n+104>>2]=a||16)}(0|(f=i[n+1732>>2]))==11?M[i[n+12>>2]](100900):M[0|f](100900,i[n+1896>>2])}function Z(n,f,a){var t=0,e=0,b=0;if(!(32&w[0|n]))i:{e=f,t=a;f:{if(!(n=i[(f=n)+16>>2])){if(n=w[f+74|0],p[f+74|0]=n-1|n,8&(n=i[f>>2])?(i[f>>2]=32|n,n=-1):(i[f+4>>2]=0,i[f+8>>2]=0,n=i[f+44>>2],i[f+28>>2]=n,i[f+20>>2]=n,i[f+16>>2]=n+i[f+48>>2],n=0),n)break f;n=i[f+16>>2]}if(n-(b=i[f+20>>2])>>>0>>0){M[i[f+36>>2]](f,e,a);break i}a:if(!(p[f+75|0]<0)){for(n=a;;){if(t=n,!n)break a;if(w[e+(n=t-1|0)|0]==10)break}if(M[i[f+36>>2]](f,e,t)>>>0>>0)break f;e=t+e|0,a=a-t|0,b=i[f+20>>2]}c1(b,e,a),i[f+20>>2]=i[f+20>>2]+a}}}function p1(n,f,a,t){var e=0,b=0;B=e=B-208|0,i[e+204>>2]=a,v1(e+160|0,0,40),i[e+200>>2]=i[e+204>>2],(0|C0(0,f,e+200|0,e+80|0,e+160|0,t))<0||(i[n+76>>2],a=i[n>>2],p[n+74|0]<=0&&(i[n>>2]=-33&a),b=32&a,i[n+48>>2]?C0(n,f,e+200|0,e+80|0,e+160|0,t):(i[n+48>>2]=80,i[n+16>>2]=e+80,i[n+28>>2]=e,i[n+20>>2]=e,a=i[n+44>>2],i[n+44>>2]=e,C0(n,f,e+200|0,e+80|0,e+160|0,t),a&&(M[i[n+36>>2]](n,0,0),i[n+48>>2]=0,i[n+44>>2]=a,i[n+28>>2]=0,i[n+16>>2]=0,i[n+20>>2]=0)),i[n>>2]=i[n>>2]|b),B=e+208|0}function S4(n,f){n|=0;var a=0,t=0,e=0;if((0|(a=i[40+(f|=0)>>2]))!=(0|(t=f+40|0)))for(;;){if(w[a+21|0]){for((0|(f=i[n+1716>>2]))==3?M[i[n+88>>2]](2):M[0|f](2,i[n+1896>>2]),f=i[a+8>>2];(0|(e=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[f+16>>2]+12>>2]):M[0|e](i[i[f+16>>2]+12>>2],i[n+1896>>2]),(0|(f=i[f+12>>2]))!=i[a+8>>2];);(0|(f=i[n+1728>>2]))==6?M[i[n+100>>2]]():M[0|f](i[n+1896>>2])}if((0|t)==(0|(a=i[a>>2])))break}}function h1(n,f){if(!n)return 0;i:{f:{if(n){if(f>>>0<=127)break f;if(i[i[493]>>2]){if(f>>>0<=2047){p[n+1|0]=63&f|128,p[0|n]=f>>>6|192,n=2;break i}if(!((-8192&f)!=57344&&f>>>0>=55296)){p[n+2|0]=63&f|128,p[0|n]=f>>>12|224,p[n+1|0]=f>>>6&63|128,n=3;break i}if(f-65536>>>0<=1048575){p[n+3|0]=63&f|128,p[0|n]=f>>>18|240,p[n+2|0]=f>>>6&63|128,p[n+1|0]=f>>>12&63|128,n=4;break i}}else if((-128&f)==57216)break f;i[613]=25,n=-1}else n=1;break i}p[0|n]=f,n=1}return n}function M0(){var n=0,f=0,a=0;return(n=H(128))?(i[n+8>>2]=0,i[n+12>>2]=0,f=n+40|0,i[n+44>>2]=f,i[n+48>>2]=0,i[n+52>>2]=0,i[n+40>>2]=f,r2[n+54>>1]=0,r2[n+56>>1]=0,r2[n+58>>1]=0,r2[n+60>>1]=0,i[n+72>>2]=0,i[n+76>>2]=0,f=n+96|0,i[n+68>>2]=f,a=n- -64|0,i[n+64>>2]=a,i[n+80>>2]=0,i[n+84>>2]=0,i[n+88>>2]=0,i[n+92>>2]=0,i[n+104>>2]=0,i[n+108>>2]=0,i[n+100>>2]=a,i[n+96>>2]=f,i[n+112>>2]=0,i[n+116>>2]=0,i[n+120>>2]=0,i[n+124>>2]=0,i[n>>2]=n,i[n+4>>2]=n,0|n):0}function x4(n,f,a){n|=0,f|=0,a|=0;var t=0,e=0,b=u(0),o=u(0);return a=i[a>>2],t=i[i[a+4>>2]+16>>2],f=i[f>>2],(0|(e=i[i[f+4>>2]+16>>2]))==(0|(n=i[n+72>>2]))?(0|n)==(0|t)?(f=i[f+16>>2],b=c[f+28>>2],a=i[a+16>>2],o=c[a+28>>2],!(!(c[f+32>>2]<=c[a+32>>2])|b!=o)||b=u(0)|0):G(t,n,i[a+16>>2])<=u(0)|0:(f=i[f+16>>2],(0|n)==(0|t)?G(e,n,f)>=u(0)|0:C1(e,n,f)>=C1(i[i[a+4>>2]+16>>2],n,i[a+16>>2])|0)}function I0(n){var f=0,a=0,t=0,e=0,b=0,o=u(0),k=u(0),r=0;if(!(f=i[n+12>>2]))return l1(i[n>>2]);if(b=i[n+8>>2],t=i[i[(b+(f<<2)|0)-4>>2]>>2],a=i[n>>2],i[a+8>>2]&&(e=i[i[a+4>>2]+(i[i[a>>2]+4>>2]<<3)>>2],o=c[e+28>>2],k=c[t+28>>2],!(!(c[e+32>>2]<=c[t+32>>2])|o!=k)||o>2]=a,t;if(e=f<<2,f=r=f-1|0,i[i[(e+b|0)-8>>2]>>2])break}return i[n+12>>2]=r,t}function L4(n,f,a){f|=0,a|=0;var t=0,e=0,b=0,o=0;b=1;i:if((0|(t=i[64+(n|=0)>>2]))!=(0|(e=n- -64|0))){if(o=0-f|0,!a){for(;;)if(n=w[i[t+20>>2]+21|0],i[t+28>>2]=(0|n)==w[i[i[t+4>>2]+20>>2]+21|0]?0:n?f:o,(0|e)==(0|(t=i[t>>2])))break i}for(;;){if(n=i[t>>2],(0|(a=w[i[t+20>>2]+21|0]))==w[i[i[t+4>>2]+20>>2]+21|0]){if(!$(t)){b=0;break i}}else i[t+28>>2]=a?f:o;if((0|e)==(0|(t=n)))break}}return 0|b}function m1(n,f){var a=0,t=0,e=0;(a=H(16))&&(e=f0(i[n+8>>2]))&&(t=i[e+16>>2],c[t+32>>2]=f,i[t+28>>2]=2112929218,t=i[i[e+4>>2]+16>>2],c[t+32>>2]=f,i[t+28>>2]=-34554430,i[n+72>>2]=t,p[a+15|0]=0,p[a+12|0]=0,i[a+8>>2]=0,i[a>>2]=e,p[a+13|0]=1,p[a+14|0]=0,t=a,a=S0(e=i[n+64>>2],e,a),i[t+4>>2]=a,a)||(b2(n+1740|0,1),o2())}function _0(n){var f=0,a=0,t=0;if((0|(f=i[40+(n|=0)>>2]))!=(0|(a=n+40|0)))for(;t=i[f>>2],j(f),(0|a)!=(0|(f=t)););if((0|(f=i[n>>2]))!=(0|n))for(;t=i[f>>2],j(f),(0|(f=t))!=(0|n););if((0|(f=i[n+64>>2]))!=(0|(a=n- -64|0)))for(;t=i[f>>2],j(f),(0|a)!=(0|(f=t)););j(n)}function w1(n){var f=0,a=u(0),t=u(0);if(!(f=i[n+12>>2]))return n=i[n>>2],i[i[n+4>>2]+(i[i[n>>2]+4>>2]<<3)>>2];f=i[i[(i[n+8>>2]+(f<<2)|0)-4>>2]>>2],n=i[n>>2];i:{if(i[n+8>>2]&&(n=i[i[n+4>>2]+(i[i[n>>2]+4>>2]<<3)>>2],(a=c[n+28>>2])<(t=c[f+28>>2])||a==t&&c[n+32>>2]<=c[f+32>>2]))break i;n=f}return n}function P4(n,f,a,t){n|=0,f|=0,a|=0,t|=0,a=0;i:{if(f=i[520]){if(!((a=i[f>>2])>>>0<100001)){f=H(12);break i}}else f=H(1200008),i[f+4>>2]=12,i[f>>2]=0,i[520]=f;i[f>>2]=a+1,f=8+(W(a,12)+f|0)|0}c[f>>2]=c[n>>2],c[f+4>>2]=c[n+4>>2],c[f+8>>2]=c[n+8>>2],i[t>>2]=f}function q2(n,f,a){var t=0,e=0,b=0;if(f>>>0<1)t=n;else for(;t=A1(n,f,10),b=e=v2,e=x0(t,e,10,0),p[0|(a=a-1|0)]=n-e|48,e=f>>>0>9,n=t,f=b,e;);if(t)for(;n=(t>>>0)/10|0,p[0|(a=a-1|0)]=t-W(n,10)|48,f=t>>>0>9,t=n,f;);return a}function y1(n,f,a,t){var e=0,b=0,o=0;if(b=i[610]+1|0,i[610]=b,i[n>>2]=b,t)for(;;){if(!i[(o=(e<<3)+a|0)>>2])return i[o>>2]=b,i[4+(n=(e<<3)+a|0)>>2]=f,i[n+8>>2]=0,K(0|t),a;if((0|(e=e+1|0))==(0|t))break}return e=n,n=t<<1,f=y1(e,f,l0(a,t<<4|8),n),K(0|n),f}function g1(n,f){var a=0,t=0,e=0;if(g0(+n),a=0|l2(1),t=0|l2(0),e=a,(0|(a=a>>>20&2047))!=2047){if(!a)return a=f,n==0?f=0:(n=g1(18446744073709552e3*n,f),f=i[f>>2]+-64|0),i[a>>2]=f,n;i[f>>2]=a-1022,n1(0,0|t),n1(1,-2146435073&e|1071644672),n=+r4()}return n}function C1(n,f,a){var t=u(0),e=u(0),b=u(0),o=u(0),k=u(0);return t=c[f+28>>2],e=u(t-c[n+28>>2]),t=u(c[a+28>>2]-t),(b=u(e+t))>u(0)?(k=c[f+32>>2],o=c[((f=t>e)?n:a)+32>>2],t=u(u(k-o)+u(u((f?e:t)/b)*u(o-c[(f?a:n)+32>>2])))):t=u(0),t}function S0(n,f,a){for(var t=0;f=i[f+8>>2],(t=i[f>>2])&&!(0|M[i[n+16>>2]](i[n+12>>2],t,a)););return(n=H(12))?(i[n>>2]=a,i[n+4>>2]=i[f+4>>2],i[i[f+4>>2]+8>>2]=n,i[n+8>>2]=f,i[f+4>>2]=n,n):0}function x0(n,f,a,t){var e=0,b=0,o=0,k=0,r=0,s=0;return s=W(e=a>>>16|0,b=n>>>16|0),e=(65535&(b=((r=W(o=65535&a,k=65535&n))>>>16|0)+W(b,o)|0))+W(e,k)|0,v2=(W(f,a)+s|0)+W(n,t)+(b>>>16)+(e>>>16)|0,65535&r|e<<16}function i2(n,f,a,t,e){var b=0;if(B=b=B-256|0,!(73728&e|(0|a)<=(0|t))){if(v1(b,255&f,(t=(a=a-t|0)>>>0<256)?a:256),!t)for(;Z(n,b,256),(a=a-256|0)>>>0>255;);Z(n,b,a)}B=b+256|0}function J(n,f,a){var t=0,e=0;i:if(a)for(;;){if(!(e=i[(t<<3)+f>>2]))break i;if((0|n)==(0|e))return i[4+((t<<3)+f|0)>>2];if((0|(t=t+1|0))==(0|a))break}return 0}function T2(n){var f=0,a=0;return(n=(f=i[412])+(a=n+3&-4)|0)>>>0<=f>>>0&&a||n>>>0>M1()<<16>>>0&&!(0|l4(0|n))?(i[613]=48,-1):(i[412]=n,f)}function E1(n){var f=0,a=0,t=0;if(p[i[n>>2]]-48>>>0<10)for(;f=i[n>>2],t=p[0|f],i[n>>2]=f+1,a=(W(a,10)+t|0)-48|0,p[f+1|0]-48>>>0<10;);return a}function B4(n,f){n|=0;var a=0,t=0;(0|(a=i[4+(f|=0)>>2]))>2]&&(t=i[f>>2]+(W(i[f+12>>2],a)<<2)|0,c[t>>2]=c[n>>2],c[t+4>>2]=c[n+4>>2],i[f+4>>2]=a+1)}function j4(n,f){n|=0,f|=0;var a=u(0),t=u(0);if((a=c[n+28>>2])<(t=c[f+28>>2]))n=1;else{if(a!=t)return 0;n=c[n+32>>2]<=c[f+32>>2]}return 0|n}function L0(n){var f=0;(f=i[n>>2])&&(j(i[f+4>>2]),j(i[f>>2]),j(f)),(f=i[n+8>>2])&&j(f),(f=i[n+4>>2])&&j(f),j(n)}function T4(n){n|=0;var f=0;B=f=B-16|0,i[f>>2]=n,B=n=B-16|0,i[n+12>>2]=f,p1(i[288],1078,f,0),B=n+16|0,B=f+16|0}function U4(n,f,a){n|=0,f=i[20+(f|=0)>>2],i[f+16>>2]=i[n+84>>2],i[n+84>>2]=f,p[f+20|0]=1}function h2(n){var f=0;f=i[n+4>>2],i[f+8>>2]=i[n+8>>2],i[i[n+8>>2]+4>>2]=f,j(n)}function R1(n,f){var a=0;B=a=B-16|0,i[a+12>>2]=f,p1(i[288],n,f,43),B=a+16|0}function f2(n){var f=0;return(-1>>>(f=31&n)&-2)<>>n}function b2(n,f){n|=0,f|=0,i[611]||(i[612]=f,i[611]=n),v4()}function F4(n,f){n|=0,f|=0,i[611]||(i[612]=f,i[611]=n)}function O4(n,f,a,t){return v2=0,0}function D4(n,f,a,t,e){}function H4(n,f,a,t){}function Q4(n){return 0}function v0(n,f){}function W4(){return 0|B}function q4(n){B=n|=0}function R2(n){}function P0(){}S=w,a2();var M=x([null,U4,_4,v0,v0,v0,R2,M4,D4,j4,x4,v0,P0,R2,R2,R2,R2,H4,R2,E2,E4,M0,f0,n2,z,b1,b2,y4,L4,R4,S4,C4,r1,_0,B4,R2,P0,P4,T4,R2,Q4,I4,O4,g4]);function M1(){return N.byteLength/65536|0}function z4(n){n|=0;var f=0|M1(),a=f+n|0;if(f=x);)++S;if(S-g>16&&d.subarray&&z0)return z0.decode(d.subarray(g,S));for(var T="";g>10,56320|1023&t2)}}else T+=String.fromCharCode((31&O)<<6|D)}else T+=String.fromCharCode(O)}return T}function U1(d,g){return d?K0(J2,d,g):""}function F1(d,g){return d%g>0&&(d+=g-d%g),d}function Y0(d){G2=d,C.HEAP8=new Int8Array(d),C.HEAP16=new Int16Array(d),C.HEAP32=Z2=new Int32Array(d),C.HEAPU8=J2=new Uint8Array(d),C.HEAPU16=new Uint16Array(d),C.HEAPU32=new Uint32Array(d),C.HEAPF32=new Float32Array(d),C.HEAPF64=new Float64Array(d)}var p2,N0=C.INITIAL_MEMORY||4194304;(V2=C.wasmMemory?C.wasmMemory:new y2.Memory({initial:N0/65536,maximum:32768}))&&(G2=V2.buffer),N0=G2.byteLength,Y0(G2);var V0=[],G0=[],J0=[];function O1(){if(C.preRun)for(typeof C.preRun=="function"&&(C.preRun=[C.preRun]);C.preRun.length;)Q1(C.preRun.shift());m0(V0)}function D1(){m0(G0)}function H1(){if(C.postRun)for(typeof C.postRun=="function"&&(C.postRun=[C.postRun]);C.postRun.length;)q1(C.postRun.shift());m0(J0)}function Q1(d){V0.unshift(d)}function W1(d){G0.unshift(d)}function q1(d){J0.unshift(d)}var M2=0,X2=null;function z1(d){M2++,C.monitorRunDependencies&&C.monitorRunDependencies(M2)}function K1(d){if(M2--,C.monitorRunDependencies&&C.monitorRunDependencies(M2),M2==0&&X2){var g=X2;X2=null,g()}}function $2(d){throw C.onAbort&&C.onAbort(d),D2(d+=""),q0=!0,d="abort("+d+"). Build with -s ASSERTIONS=1 for more info.",new y2.RuntimeError(d)}C.preloadedImages={},C.preloadedAudios={};var e2,Z0="data:application/octet-stream;base64,";function h0(d){return d.startsWith(Z0)}function X0(d){return d.startsWith("file://")}function $0(d){try{if(d==e2&&H2)return new Uint8Array(H2);var g=Q2(d);if(g)return g;if(o0)return o0(d);throw"both async and sync fetching of the wasm failed"}catch(I){$2(I)}}function Y1(){if(!H2&&(Q0||N2)){if(typeof fetch=="function"&&!X0(e2))return fetch(e2,{credentials:"same-origin"}).then(function(d){if(!d.ok)throw"failed to load wasm binary file at '"+e2+"'";return d.arrayBuffer()}).catch(function(){return $0(e2)});if(e0)return new Promise(function(d,g){e0(e2,function(I){d(new Uint8Array(I))},g)})}return Promise.resolve().then(function(){return $0(e2)})}function N1(){var d={a:i1};function g(T,O){var D=T.exports;C.asm=D,p2=C.asm.q,W1(C.asm.n),K1()}function I(T){g(T.instance)}function x(T){return Y1().then(function(O){return y2.instantiate(O,d)}).then(T,function(O){D2("failed to asynchronously prepare wasm: "+O),$2(O)})}function S(){return H2||typeof y2.instantiateStreaming!="function"||h0(e2)||X0(e2)||typeof fetch!="function"?x(I):fetch(e2,{credentials:"same-origin"}).then(function(T){return y2.instantiateStreaming(T,d).then(I,function(O){return D2("wasm streaming compile failed: "+O),D2("falling back to ArrayBuffer instantiation"),x(I)})})}if(z1(),C.instantiateWasm)try{return C.instantiateWasm(d,g)}catch(T){return D2("Module.instantiateWasm callback failed with error: "+T),!1}return S(),{}}function m0(d){for(;d.length>0;){var g=d.shift();if(typeof g!="function"){var I=g.func;typeof I=="number"?g.arg===void 0?p2.get(I)():p2.get(I)(g.arg):I(g.arg===void 0?null:g.arg)}else g(C)}}function V1(){throw"longjmp"}function G1(d,g,I){J2.copyWithin(d,g,g+I)}function J1(d){try{return V2.grow(d-G2.byteLength+65535>>>16),Y0(V2.buffer),1}catch{}}function Z1(d){var g=J2.length,I=2147483648;if((d>>>=0)>I)return!1;for(var x=1;x<=4;x*=2){var S=g*(1+.2/x);if(S=Math.min(S,d+100663296),J1(Math.min(I,F1(Math.max(d,S),65536))))return!0}return!1}h0(e2="libtess-asm.wasm")||(e2=L1(e2));var b0={mappings:{},buffers:[null,[],[]],printChar:function(d,g){var I=b0.buffers[d];g===0||g===10?((d===1?P1:D2)(K0(I,0)),I.length=0):I.push(g)},varargs:void 0,get:function(){return b0.varargs+=4,Z2[b0.varargs-4>>2]},getStr:function(d){return U1(d)},get64:function(d,g){return d}};function X1(d,g,I,x){for(var S=0,T=0;T>2],D=Z2[g+(8*T+4)>>2],a2=0;a2>2]=S,0}function $1(d){for(var g=[],I=0;I255&&(x&=255),g.push(String.fromCharCode(x))}return g.join("")}var i4=typeof atob=="function"?atob:function(d){var g,I,x,S,T,O,D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a2="",t2=0;d=d.replace(/[^A-Za-z0-9\+\/\=]/g,"");do g=D.indexOf(d.charAt(t2++))<<2|(S=D.indexOf(d.charAt(t2++)))>>4,I=(15&S)<<4|(T=D.indexOf(d.charAt(t2++)))>>2,x=(3&T)<<6|(O=D.indexOf(d.charAt(t2++))),a2+=String.fromCharCode(g),T!==64&&(a2+=String.fromCharCode(I)),O!==64&&(a2+=String.fromCharCode(x));while(t20||(O1(),M2>0||(C.setStatus?(C.setStatus("Running..."),setTimeout(function(){setTimeout(function(){C.setStatus("")},1),g()},1)):g()))}if(X2=function d(){k0||w0(),k0||(X2=d)},C.run=w0,C.preInit)for(typeof C.preInit=="function"&&(C.preInit=[C.preInit]);C.preInit.length>0;)C.preInit.pop()();w0();let y0=null,g2=null,x2=null,u0=null;const s2=u2.Module,u4=2,f1=4e3;let a1=0;const c4=(d,g,I)=>{y0||(y0=s2._triangulate);let x=s2.HEAPF32;const S=s2.HEAP32.BYTES_PER_ELEMENT,T=2,O=x.BYTES_PER_ELEMENT;I>a1&&(a1=I,x2&&(s2._free(x2),x2=0),g2&&(s2._free(g2),g2=0)),x2||(x2=s2._malloc(I*O)),u0||(u0=s2._malloc(f1*S));const D=I*u4;g2||(g2=s2._malloc(D*O)),x=s2.HEAPF32,x.set(d,x2/O),s2.HEAP32.set(g,u0/S);const a2=D/T,t2=y0(x2,u0,Math.min(g.length,f1),T,g2,a2),c0=t2*T;x=s2.HEAPF32;const r0=x.slice(g2/O,g2/O+c0),l2={};return l2.buffer=r0,l2.vertexCount=t2,l2};return u2.triangulate=c4,u2.whenLoaded()}return{load:z2}},(_1=I1())!==void 0&&(D0.exports=_1);var S1=H0.exports;const V4=Y4({__proto__:null,default:K4(S1)},[S1]);export{V4 as l}; diff --git a/assets/loadGLTFMesh-932e7ee5.js b/assets/loadGLTFMesh-932e7ee5.js new file mode 100644 index 0000000..3316af1 --- /dev/null +++ b/assets/loadGLTFMesh-932e7ee5.js @@ -0,0 +1,8 @@ +import{jJ as P,jK as z,jL as F,jM as L,jN as N,at as D,dn as _,jO as q,jP as G,bh as w,jQ as K,jR as Q,jS as U,jT as V,jU as k,jV as J,jW as B,jX as W,jY as X,jZ as Y,j_ as Z,j$ as j,k0 as H,k1 as ee,k2 as I,k3 as S,k4 as R,k5 as te,k6 as ne,k7 as C,k8 as O,k9 as A,ka as oe,kb as re,b4 as v,i$ as se,dk as ae,kc as le,kd as ue,ke as ce,kf as ie,gz as E,kg as fe}from"./index-080e108a.js";function de(e,n,t){const a=e.typedBuffer,s=e.typedBufferStride,r=n.typedBuffer,f=n.typedBufferStride,l=t?t.count:n.count;let u=(t&&t.dstIndex?t.dstIndex:0)*s,i=(t&&t.srcIndex?t.srcIndex:0)*f;for(let c=0;cl.set(h,$e(g))),r.materials.forEach((g,h)=>u.set(h,Te(g,l)));const i=ge(f);for(const g of i.parts)ye(i,g,u);const{position:c,normal:o,tangent:d,color:m,texCoord0:y}=i.vertexAttributes,b={position:c.typedBuffer,normal:o!=null?o.typedBuffer:null,tangent:d!=null?d.typedBuffer:null,uv:y!=null?y.typedBuffer:null,color:m!=null?m.typedBuffer:null},x=L(b,e,a);return{transform:x.transform,vertexSpace:x.vertexSpace,components:i.components,spatialReference:e.spatialReference,vertexAttributes:new N({position:x.vertexAttributes.position,normal:x.vertexAttributes.normal,tangent:x.vertexAttributes.tangent,color:b.color,uv:b.uv})}}function pe(e){const n=e==null?void 0:e.resolveFile;return n?{busy:!1,request:async(t,a,s)=>{const r=n(t);return(await D(r,{responseType:a==="image"?"image":a==="binary"?"array-buffer":"json",signal:s!=null?s.signal:null})).data}}:null}function T(e,n){if(e==null)return"-";const t=e.typedBuffer;return`${_(n,t.buffer,()=>n.size)}/${t.byteOffset}/${t.byteLength}`}function xe(e){return e!=null?e.toString():"-"}function ge(e){let n=0;const t={color:!1,tangent:!1,normal:!1,texCoord0:!1},a=new Map,s=new Map,r=[];for(const f of e.parts){const{attributes:{position:l,normal:u,color:i,tangent:c,texCoord0:o}}=f,d=` + ${T(l,a)}/ + ${T(u,a)}/ + ${T(i,a)}/ + ${T(c,a)}/ + ${T(o,a)}/ + ${xe(f.transform)} + `;let m=!1;const y=_(s,d,()=>(m=!0,{start:n,length:l.count}));m&&(n+=l.count),u&&(t.normal=!0),i&&(t.color=!0),c&&(t.tangent=!0),o&&(t.texCoord0=!0),r.push({gltf:f,writeVertices:m,region:y})}return{vertexAttributes:{position:$(le,n),normal:t.normal?$(O,n):null,tangent:t.tangent?$(I,n):null,color:t.color?$(R,n):null,texCoord0:t.texCoord0?$(ue,n):null},parts:r,components:[]}}function $e(e){return new q({data:(G(e.data),e.data),wrap:je(e.parameters.wrap)})}function Te(e,n){const t=new w(ve(e.color,e.opacity)),a=e.emissiveFactor?new w(we(e.emissiveFactor)):null,s=r=>r?new ce({scale:r.scale?[r.scale[0],r.scale[1]]:[1,1],rotation:ie(r.rotation??0),offset:r.offset?[r.offset[0],r.offset[1]]:[0,0]}):null;return new K({color:t,colorTexture:n.get(e.textureColor),normalTexture:n.get(e.textureNormal),emissiveColor:a,emissiveTexture:n.get(e.textureEmissive),occlusionTexture:n.get(e.textureOcclusion),alphaMode:he(e.alphaMode),alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,metallic:e.metallicFactor,roughness:e.roughnessFactor,metallicRoughnessTexture:n.get(e.textureMetallicRoughness),colorTextureTransform:s(e.colorTextureTransform),normalTextureTransform:s(e.normalTextureTransform),occlusionTextureTransform:s(e.occlusionTextureTransform),emissiveTextureTransform:s(e.emissiveTextureTransform),metallicRoughnessTextureTransform:s(e.metallicRoughnessTextureTransform)})}function ye(e,n,t){n.writeVertices&&be(e,n);const{indices:a,attributes:s,primitiveType:r,material:f}=n.gltf;let l=Q(a||s.position.count,r);const u=n.region.start;if(u){const i=new Uint32Array(l);for(let c=0;co.set(e,n)))}function p(e){o.get(e)()}function s(e){return a.get(e)}async function c(e){return await s(e),t(e),new Promise(n=>requestAnimationFrame(()=>n()))}export{p as a,c,i as s}; diff --git a/assets/loader-2996ba2a.js b/assets/loader-2996ba2a.js new file mode 100644 index 0000000..0434e35 --- /dev/null +++ b/assets/loader-2996ba2a.js @@ -0,0 +1,9 @@ +import{f6 as S,f7 as M,f9 as a,fb as $}from"./index-080e108a.js";import{g as B}from"./guid-114f0fc6.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */function C(){return navigator.userAgentData}function H(){const e=C();return e!=null&&e.brands?e.brands.map(({brand:t,version:r})=>`${t}/${r}`).join(" "):navigator.userAgent}const i=/firefox/i.test(H()),s=i?new WeakMap:null;function P(){const{disabled:e}=this;e||HTMLElement.prototype.click.call(this)}function b(e){const t=e.target;if(i&&!s.get(t))return;const{disabled:r}=t;r&&e.preventDefault()}const p=["mousedown","mouseup","click"];function z(e){if(i&&!s.get(e.target))return;const{disabled:t}=e.target;t&&(e.stopImmediatePropagation(),e.preventDefault())}const o={capture:!0};function G(e,t=!1){if(e.disabled){e.el.setAttribute("tabindex","-1"),e.el.setAttribute("aria-disabled","true"),e.el.contains(document.activeElement)&&document.activeElement.blur(),_(e);return}x(e),typeof t=="function"?e.el.setAttribute("tabindex",t.call(e)?"0":"-1"):t===!0?e.el.setAttribute("tabindex","0"):t===!1&&e.el.removeAttribute("tabindex"),e.el.removeAttribute("aria-disabled")}function _(e){e.el.click=P,U(i?y(e):e.el)}function U(e){e&&(e.addEventListener("pointerdown",b,o),p.forEach(t=>e.addEventListener(t,z,o)))}function y(e){return s.get(e.el)}function x(e){delete e.el.click,W(i?y(e):e.el)}function W(e){e&&(e.removeEventListener("pointerdown",b,o),p.forEach(t=>e.removeEventListener(t,z,o)))}function J(e){if(!e.disabled||!i)return;const t=e.el.parentElement||e.el;s.set(e.el,t),_(e)}function K(e){i&&(s.delete(e.el),x(e))}/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const j='@charset "UTF-8";@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{position:relative;margin-inline:auto;display:none;align-items:center;justify-content:center;opacity:1;min-block-size:var(--calcite-loader-size);font-size:var(--calcite-loader-font-size);stroke:var(--calcite-ui-brand);stroke-width:3;fill:none;transform:scale(1, 1);animation:loader-color-shift calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 2 / var(--calcite-internal-duration-factor)) alternate-reverse infinite linear;padding-block:var(--calcite-loader-padding, 4rem)}:host([scale=s]){--calcite-loader-font-size:var(--calcite-font-size--2);--calcite-loader-size:2rem;--calcite-loader-size-inline:0.75rem}:host([scale=m]){--calcite-loader-font-size:var(--calcite-font-size-0);--calcite-loader-size:4rem;--calcite-loader-size-inline:1rem}:host([scale=l]){--calcite-loader-font-size:var(--calcite-font-size-2);--calcite-loader-size:6rem;--calcite-loader-size-inline:1.5rem}:host([no-padding]){padding-block:0px}:host{display:flex}.loader__text{display:block;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-ui-text-1);margin-block-start:calc(var(--calcite-loader-size) + 1.5rem)}.loader__percentage{position:absolute;display:block;text-align:center;color:var(--calcite-ui-text-1);font-size:var(--calcite-loader-font-size);inline-size:var(--calcite-loader-size);inset-inline-start:50%;margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);line-height:0.25;transform:scale(1, 1)}.loader__svgs{position:absolute;overflow:visible;opacity:1;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);inset-inline-start:50%;margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);transform:scale(1, 1)}.loader__svg{position:absolute;inset-block-start:0px;transform-origin:center;overflow:visible;inset-inline-start:0;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);animation-iteration-count:infinite;animation-timing-function:linear;animation-name:loader-clockwise}@supports (display: grid){.loader__svg--1{animation-name:loader-offset-1}.loader__svg--2{animation-name:loader-offset-2}.loader__svg--3{animation-name:loader-offset-3}}:host([type=determinate]){animation:none;stroke:var(--calcite-ui-border-3)}:host([type=determinate]) .loader__svg--3{animation:none;stroke:var(--calcite-ui-brand);stroke-dasharray:150.79632;transform:rotate(-90deg);transition:all var(--calcite-internal-animation-timing-fast) linear}:host([inline]){position:relative;margin:0px;animation:none;stroke:currentColor;stroke-width:2;padding-block:0px;block-size:var(--calcite-loader-size-inline);min-block-size:var(--calcite-loader-size-inline);inline-size:var(--calcite-loader-size-inline);margin-inline-end:calc(var(--calcite-loader-size-inline) * 0.5);vertical-align:calc(var(--calcite-loader-size-inline) * -1 * 0.2)}:host([inline]) .loader__svgs{inset-block-start:0px;margin:0px;inset-inline-start:0;inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([inline]) .loader__svg{inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([complete]){opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity var(--calcite-internal-animation-timing-medium) linear 1000ms, transform var(--calcite-internal-animation-timing-medium) linear 1000ms}:host([complete]) .loader__svgs{opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms, transform calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms}:host([complete]) .loader__percentage{color:var(--calcite-ui-brand);transform:scale(1.05, 1.05);transform-origin:center;transition:color var(--calcite-internal-animation-timing-medium) linear, transform var(--calcite-internal-animation-timing-medium) linear}.loader__svg--1{stroke-dasharray:27.9252444444% 139.6262222222%;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 2.4 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-1{0%{stroke-dasharray:27.9252444444% 251.3272%;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222% 139.6262222222%;stroke-dashoffset:-83.7757333333%}100%{stroke-dasharray:27.9252444444% 251.3272%;stroke-dashoffset:-279.2524444444%}}.loader__svg--2{stroke-dasharray:55.8504888889% 139.6262222222%;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 3.2 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-2{0%{stroke-dasharray:55.8504888889% 223.4019555556%;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222% 139.6262222222%;stroke-dashoffset:-97.7383555556%}100%{stroke-dasharray:55.8504888889% 223.4019555556%;stroke-dashoffset:-279.2524444444%}}.loader__svg--3{stroke-dasharray:13.9626222222% 139.6262222222%;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 3.867 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-3{0%{stroke-dasharray:13.9626222222% 265.2898222222%;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222% 139.6262222222%;stroke-dashoffset:-76.7944222222%}100%{stroke-dasharray:13.9626222222% 265.2898222222%;stroke-dashoffset:-279.2524444444%}}@keyframes loader-color-shift{0%{stroke:var(--calcite-ui-brand)}33%{stroke:var(--calcite-ui-brand-press)}66%{stroke:var(--calcite-ui-brand-hover)}100%{stroke:var(--calcite-ui-brand)}}@keyframes loader-clockwise{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}:host([hidden]){display:none}[hidden]{display:none}',F=S(class extends M{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.inline=!1,this.label=void 0,this.scale="m",this.type=void 0,this.value=0,this.text=""}render(){const{el:e,inline:t,label:r,scale:u,text:m,type:w,value:l}=this,E=e.id||B(),A=.45,n=t?this.getInlineSize(u):this.getSize(u),v=n*A,c=`0 0 ${n} ${n}`,d=w==="determinate",g=2*v*Math.PI,h=l/100*g,I=g-h,k=Math.floor(l),L={"aria-valuenow":k,"aria-valuemin":0,"aria-valuemax":100,complete:k===100},f={r:v,cx:n/2,cy:n/2},D={"stroke-dasharray":`${h} ${I}`};return a($,{"aria-label":r,id:E,role:"progressbar",...d?L:{}},a("div",{class:"loader__svgs"},a("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--1",viewBox:c},a("circle",{...f})),a("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--2",viewBox:c},a("circle",{...f})),a("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--3",viewBox:c,...d?{style:D}:{}},a("circle",{...f}))),m&&a("div",{class:"loader__text"},m),d&&a("div",{class:"loader__percentage"},l))}getSize(e){return{s:32,m:56,l:80}[e]}getInlineSize(e){return{s:12,m:16,l:20}[e]}get el(){return this}static get style(){return j}},[1,"calcite-loader",{inline:[516],label:[1],scale:[513],type:[513],value:[2],text:[1]}]);function O(){if(typeof customElements>"u")return;["calcite-loader"].forEach(t=>{switch(t){case"calcite-loader":customElements.get(t)||customElements.define(t,F);break}})}O();export{K as a,J as c,O as d,G as u}; diff --git a/assets/lt_LT2-e057464e.js b/assets/lt_LT2-e057464e.js new file mode 100644 index 0000000..3e1ea8c --- /dev/null +++ b/assets/lt_LT2-e057464e.js @@ -0,0 +1 @@ +const i={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - yyyy-MM-dd",_date_hour:"HH:mm",_date_hour_full:"HH:mm - yyyy-MM-dd",_date_day:"MMM dd",_date_day_full:"yyyy-MM-dd",_date_week:"ww",_date_week_full:"yyyy-MM-dd",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"m.e.",_era_bc:"p.m.e.",A:"R",P:"V",AM:"ryto",PM:"vakaro","A.M.":"ryto","P.M.":"vakaro",January:"Sausio",February:"Vasario",March:"Kovo",April:"Balandžio",May:"Gegužės",June:"Birželio",July:"Liepos",August:"Rugpjūčio",September:"Rugsėjo",October:"Spalio",November:"Lapkričio",December:"Gruodžio",Jan:"Sau",Feb:"Vas",Mar:"Kov",Apr:"Bal","May(short)":"Geg",Jun:"Bir",Jul:"Lie",Aug:"Rgp",Sep:"Rgs",Oct:"Spa",Nov:"Lap",Dec:"Gru",Sunday:"sekmadienis",Monday:"pirmadienis",Tuesday:"antradienis",Wednesday:"trečiadienis",Thursday:"ketvirtadienis",Friday:"penktadienis",Saturday:"šeštadienis",Sun:"sekm.",Mon:"pirm.",Tue:"antr.",Wed:"treč.",Thu:"ketv.",Fri:"penk.",Sat:"šešt.",_dateOrd:function(a){return"-a"},"Zoom Out":"Rodyti viską",Play:"Paleisti",Stop:"Sustabdyti",Legend:"Legenda","Press ENTER to toggle":"Spragtelkite, palieskite arba spauskite ENTER, kad perjungtumėte",Loading:"Kraunama",Home:"Pradžia",Chart:"Grafikas","Serial chart":"Serijinis grafikas","X/Y chart":"X/Y grafikas","Pie chart":"Pyrago tipo grafikas","Gauge chart":"Daviklio tipo grafikas","Radar chart":"Radaro tipo grafikas","Sankey diagram":"Sankey diagrama","Chord diagram":"Chord diagrama","Flow diagram":"Flow diagrama","TreeMap chart":"TreeMap grafikas",Series:"Serija","Candlestick Series":'"Candlestick" tipo grafiko serija',"Column Series":"Stulpelinio grafiko serija","Line Series":"Linijinio grafiko serija","Pie Slice Series":"Pyrago tipo serija","X/Y Series":"X/Y serija",Map:"Žemėlapis","Press ENTER to zoom in":"Spauskite ENTER, kad pritrauktumėte vaizdą","Press ENTER to zoom out":"Spauskite ENTER, kad atitolintumėte vaizdą","Use arrow keys to zoom in and out":"Naudokitės royklėmis vaizdo pritraukimui ar atitolinimui","Use plus and minus keys on your keyboard to zoom in and out":"Spauskite pliuso arba minuso klavišus ant klaviatūros, kad pritrautumėte arba atitolintumėte vaizdą",Export:"Eksportuoti",Image:"Vaizdas",Data:"Duomenys",Print:"Spausdinti","Press ENTER to open":"Spragtelkite arba spauskite ENTER, kad atidarytumėte","Press ENTER to print.":"Spragtelkite arba spauskite ENTER, kad spausdintumėte.","Press ENTER to export as %1.":"Spragtelkite arba spauskite ENTER, kad eksportuotumėte kaip %1.","Image Export Complete":"Paveiksliuko eksportas baigtas","Export operation took longer than expected. Something might have gone wrong.":"Eksportas užtruko ilgiau negu turėtų. Greičiausiai įvyko klaida.","Saved from":"Išsaugota iš",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Spauskite TAB klavišą, kad pasirinktumėte žymeklius, arba kairė/dešinė klavišus, kad pakeistumėte pasirinkimą","Use left and right arrows to move selection":"Naudokitės klavišais kairė/dešinė, kad pajudintumėte pasirinkimą","Use left and right arrows to move left selection":"Naudokitės klavišais kairė/dešinė, kad pajudintumėte kairį žymeklį","Use left and right arrows to move right selection":"Naudokitės klavišais kairė/dešinė, kad pajudintumėte dešinį žymeklį","Use TAB select grip buttons or up and down arrows to change selection":"Spauskite TAB klavišą, kad pasirinktumėte žymeklius, arba aukštyn/žemyn klavišus, kad pakeistumėte pasirinkimą","Use up and down arrows to move selection":"Naudokitės klavišais aukštyn/žemyn, kad pajudintumėte pasirinkimą","Use up and down arrows to move lower selection":"Naudokitės klavišais aukštyn/žemyn, kad pajudintumėte apatinį žymeklį","Use up and down arrows to move upper selection":"Naudokitės klavišais aukštyn/žemyn, kad pajudintumėte viršutinį žymeklį","From %1 to %2":"Nuo %1 iki %2","From %1":"Nuo %1","To %1":"Iki %1","No parser available for file: %1":"Failui %1 neturime tinkamo dešifruotojo","Error parsing file: %1":"Skaitant failą %1 įvyko klaida","Unable to load file: %1":"Nepavyko užkrauti failo %1","Invalid date":"Klaidinga data"};export{i as default}; diff --git a/assets/lv_LV2-7a761c7a.js b/assets/lv_LV2-7a761c7a.js new file mode 100644 index 0000000..5a11479 --- /dev/null +++ b/assets/lv_LV2-7a761c7a.js @@ -0,0 +1 @@ +const r={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"m.ē.",_era_bc:"p.m.ē.",A:"priekšp.",P:"pēcp.",AM:"priekšp.",PM:"pēcp.","A.M.":"priekšpusdienā","P.M.":"pēcpusdienā",January:"janvāris",February:"februāris",March:"marts",April:"aprīlis",May:"maijs",June:"jūnijs",July:"jūlijs",August:"augusts",September:"septembris",October:"oktobris",November:"novembris",December:"decembris",Jan:"janv.",Feb:"febr.",Mar:"marts",Apr:"apr.","May(short)":"maijs",Jun:"jūn.",Jul:"jūl.",Aug:"aug.",Sep:"sept.",Oct:"okt.",Nov:"nov.",Dec:"dec.",Sunday:"svētdiena",Monday:"pirmdiena",Tuesday:"otrdiena",Wednesday:"trešdiena",Thursday:"ceturtdiena",Friday:"piektdiena",Saturday:"sestdiena",Sun:"svētd.",Mon:"pirmd.",Tue:"otrd.",Wed:"trešd.",Thu:"ceturtd.",Fri:"piektd.",Sat:"sestd.",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Tālummaiņa",Play:"Darbināt",Stop:"Apturēt",Legend:"Apzīmējumi","Press ENTER to toggle":"",Loading:"Ielādē",Home:"Sākums",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Drukāt",Image:"Attēls",Data:"Dati",Print:"Drukāt","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"No %1 līdz %2","From %1":"No %1","To %1":"Līdz %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{r as default}; diff --git a/assets/mask-svg-023bbc42.js b/assets/mask-svg-023bbc42.js new file mode 100644 index 0000000..33a85c2 --- /dev/null +++ b/assets/mask-svg-023bbc42.js @@ -0,0 +1 @@ +const c="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIyNTYiIGhlaWdodD0iMjU2IiBzdHlsZT0iZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjIiPjxjaXJjbGUgY3g9IjEyOCIgY3k9IjEyOCIgcj0iMTIxIi8+PC9zdmc+";export{c as default}; diff --git a/assets/meshFeatureSet-8442b8e6.js b/assets/meshFeatureSet-8442b8e6.js new file mode 100644 index 0000000..1b87cbd --- /dev/null +++ b/assets/meshFeatureSet-8442b8e6.js @@ -0,0 +1 @@ +import{bc as E,aK as y,ca as S,dh as w,di as M,dj as g,c7 as N,dk as T,dl as D,dm as I,dn as h,dp as P,dq as F,bz as O}from"./index-080e108a.js";import{d as b}from"./FeatureSet-111cb247.js";const d=()=>O.getLogger("esri.rest.support.meshFeatureSet");function J(e,t,r){const n=r.features;r.features=[],delete r.geometryType;const s=b.fromJSON(r);if(s.geometryType="mesh",!r.assetMaps)return s;const a=v(t,r.assetMaps),o=e.sourceSpatialReference??E.WGS84,l=r.globalIdFieldName,{outFields:i}=e,c=i!=null&&i.length>0?x(i.includes("*")?null:new Set(i)):()=>({});for(const f of n){const u=L(f,l,o,t,a);u!=null&&s.features.push(new y({geometry:u,attributes:c(f)}))}return s}function x(e){return({attributes:t})=>{if(!t)return{};if(!e)return t;for(const r in t)e.has(r)||delete t[r];return t}}function L(e,t,r,n,s){const a=e.attributes[t],o=s.get(a);if(o==null)return d().error("mesh-feature-set:asset-not-found","Service returned a feature which was not found in the asset map",e),null;if(!e.geometry)return d().error("mesh-feature-set:no-geometry","Service returned a feature without geometry",e),null;const{originPoint:l,originVector:i}=R(e,r,n),c=S.fromJSON(e.geometry);c.spatialReference=r;const f=A(e.attributes,n),u=o.projectVertices?new w({origin:i}):new M({origin:i}),p=$(o);return p?g.createWithExternalSource(l,p,{extent:c,transform:f,vertexSpace:u}):g.createIncomplete(l,{extent:c,transform:f,vertexSpace:u})}function R({attributes:e},t,{transformFieldRoles:r}){const n=e[r.originX],s=e[r.originY],a=e[r.originZ];return{originPoint:new N({x:n,y:s,z:a,spatialReference:t}),originVector:T(n,s,a)}}function A(e,{transformFieldRoles:t}){return new D({translation:[e[t.translationX],-e[t.translationZ],e[t.translationY]],rotationAxis:[e[t.rotationX],e[t.rotationZ],e[t.rotationY]],rotationAngle:e[t.rotationDeg],scale:[e[t.scaleX],e[t.scaleY],e[t.scaleZ]]})}var m;function v(e,t){const r=new Map;for(const n of t){const s=n.parentGlobalId;if(s==null)continue;const a=n.assetName,o=n.assetType,l=n.assetHash,i=n.assetURL,c=n.conversionStatus,f=n.seqNo,u=I(o,e.supportedFormats);if(!u){d().error("mesh-feature-set:unknown-format",`Service returned an asset of type ${o}, but it does not list it as a supported type`);continue}const p=h(r,s,()=>({projectVertices:V(n.flags).projectVertices,files:new Map}));h(p.files,a,()=>({name:a,type:o,mimeType:u,status:C(c),parts:[]})).parts[f]={hash:l,url:i}}return r}function $(e){const t=Array.from(e.files.values()),r=new Array;for(const n of t){if(n.status!==m.COMPLETED)return null;const s=new Array;for(const a of n.parts){if(!a)return null;s.push(new P(a.url,a.hash))}r.push(new F(n.name,n.mimeType,s))}return r}function C(e){switch(e){case"COMPLETED":case"SUBMITTED":return m.COMPLETED;case"INPROGRESS":return m.PENDING;default:return m.FAILED}}function V(e){return{projectVertices:e.includes("PROJECT_VERTICES")}}(function(e){e[e.FAILED=0]="FAILED",e[e.PENDING=1]="PENDING",e[e.COMPLETED=2]="COMPLETED"})(m||(m={}));export{v as assetMapFromAssetMapsJSON,L as extractMesh,J as meshFeatureSetFromJSON}; diff --git a/assets/multiOriginJSONSupportUtils-c978f4c3.js b/assets/multiOriginJSONSupportUtils-c978f4c3.js new file mode 100644 index 0000000..fe8aa5b --- /dev/null +++ b/assets/multiOriginJSONSupportUtils-c978f4c3.js @@ -0,0 +1 @@ +function i(n){return n&&"getAtOrigin"in n&&"originOf"in n}export{i}; diff --git a/assets/nb_NO2-853c98f6.js b/assets/nb_NO2-853c98f6.js new file mode 100644 index 0000000..46e92af --- /dev/null +++ b/assets/nb_NO2-853c98f6.js @@ -0,0 +1 @@ +const r={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - dd. MMM yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - dd. MMM yyyy",_date_day:"dd. MMM",_date_day_full:"dd. MMM yyyy",_date_week:"ww",_date_week_full:"dd. MMM yyyy",_date_month:"MMM",_date_month_full:"MMM yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"e.Kr.",_era_bc:"f.Kr.",A:"a",P:"p",AM:"a.m.",PM:"p.m.","A.M.":"a.m.","P.M.":"p.m.",January:"januar",February:"februar",March:"mars",April:"april",May:"mai",June:"juni",July:"juli",August:"august",September:"september",October:"oktober",November:"november",December:"desember",Jan:"jan.",Feb:"feb.",Mar:"mar.",Apr:"apr.","May(short)":"mai",Jun:"jun.",Jul:"jul.",Aug:"aug.",Sep:"sep.",Oct:"okt.",Nov:"nov.",Dec:"des.",Sunday:"søndag",Monday:"mandag",Tuesday:"tirsdag",Wednesday:"onsdag",Thursday:"torsdag",Friday:"fredag",Saturday:"lørdag",Sun:"søn.",Mon:"man.",Tue:"tir.",Wed:"ons.",Thu:"tor.",Fri:"fre.",Sat:"lør.",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Zoom",Play:"Spill av",Stop:"Stopp",Legend:"Tegnforklaring","Press ENTER to toggle":"",Loading:"Laster inn",Home:"Hjem",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Skriv ut",Image:"Bilde",Data:"Data",Print:"Skriv ut","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Fra %1 til %2","From %1":"Fra %1","To %1":"Til %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{r as default}; diff --git a/assets/nl_NL2-e2c04ba1.js b/assets/nl_NL2-e2c04ba1.js new file mode 100644 index 0000000..1ad71ab --- /dev/null +++ b/assets/nl_NL2-e2c04ba1.js @@ -0,0 +1 @@ +const r={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - d MMM",_date_hour:"HH:mm",_date_hour_full:"HH:mm - d MMM",_date_day:"d MMM",_date_day_full:"d MMM",_date_week:"ww",_date_week_full:"d MMM",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"AD",_era_bc:"v.C.",A:"A",P:"P",AM:"AM",PM:"PM","A.M.":"a.m.","P.M.":"p.m.",January:"januari",February:"februari",March:"maart",April:"april",May:"mei",June:"juni",July:"juli",August:"augustus",September:"september",October:"oktober",November:"november",December:"december",Jan:"jan",Feb:"feb",Mar:"mrt",Apr:"apr","May(short)":"mei",Jun:"jun",Jul:"jul",Aug:"aug",Sep:"sep",Oct:"okt",Nov:"nov",Dec:"dec",Sunday:"zondag",Monday:"maandag",Tuesday:"dinsdag",Wednesday:"woensdag",Thursday:"donderdag",Friday:"vrijdag",Saturday:"zaterdag",Sun:"Zo",Mon:"Ma",Tue:"Di",Wed:"Wo",Thu:"Do",Fri:"Vr",Sat:"Za",_dateOrd:function(e){let t="de";return(e==1||e==8||e>19)&&(t="ste"),t},"Zoom Out":"Uitzoomen",Play:"Afspelen",Stop:"Stoppen",Legend:"Legenda","Press ENTER to toggle":"Klik, tik of druk op Enter om aan of uit te zetten",Loading:"Laden",Home:"Home",Chart:"Grafiek","Serial chart":"Periodieke grafiek","X/Y chart":"X-Y grafiek","Pie chart":"Taartdiagram","Gauge chart":"Meterdiagram","Radar chart":"Radardiagram","Sankey diagram":"Sankey-diagram","Chord diagram":"Chord-diagram","Flow diagram":"Flow-diagram","TreeMap chart":"Treemap-grafiek",Series:"Reeks","Candlestick Series":"Candlestick-reeks","Column Series":"Kolomreeks","Line Series":"Lijnreeks","Pie Slice Series":"Taartpuntreeks","X/Y Series":"XY reeks",Map:"Kaart","Press ENTER to zoom in":"Druk op Enter om in te zoomen","Press ENTER to zoom out":"Druk op Enter om uit te zoomen","Use arrow keys to zoom in and out":"Zoom in of uit met de pijltjestoetsen","Use plus and minus keys on your keyboard to zoom in and out":"Zoom in of uit met de plus- en minustoetsen",Export:"Exporteren",Image:"Afbeelding",Data:"Data",Print:"Printen","Press ENTER to open":"Klik, tik of druk op Enter om te openen","Press ENTER to print.":"Klik, tik of druk op Enter om te printen","Press ENTER to export as %1.":"Klik, tik of druk op Enter om te exporteren als %1","(Press ESC to close this message)":"(Druk op ESC om dit bericht te sluiten)","Image Export Complete":"Afbeelding exporteren gereed","Export operation took longer than expected. Something might have gone wrong.":"Exportproces duurt langer dan verwacht. Er is misschien iets fout gegaan.","Saved from":"Opgeslagen via:",PNG:"PNG",JPG:"JPG",GIF:"GIF",SVG:"SVG",PDF:"PDF",JSON:"JSON",CSV:"CSV",XLSX:"XLSX",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Gebruik Tab om de hendels te selecteren of linker- en rechterpijltje om de selectie te veranderen","Use left and right arrows to move selection":"Gebruik linker- en rechterpijltje om de selectie te verplaatsen","Use left and right arrows to move left selection":"Gebruik linker- en rechterpijltje om de linkerselectie te verplaatsen","Use left and right arrows to move right selection":"Gebruik linker- en rechterpijltje om de rechterselectie te verplaatsen","Use TAB select grip buttons or up and down arrows to change selection":"Gebruik Tab om de hendels te selecteren of pijltje omhoog en omlaag om de selectie te veranderen","Use up and down arrows to move selection":"Gebruik pijltje omhoog en omlaag om de selectie te verplaatsen","Use up and down arrows to move lower selection":"Gebruik pijltje omhoog en omlaag om de onderste selectie te verplaatsen","Use up and down arrows to move upper selection":"Gebruik pijltje omhoog en omlaag om de bovenste selectie te verplaatsen","From %1 to %2":"Van %1 tot %2","From %1":"Van %1","To %1":"Tot %2","No parser available for file: %1":"Geen data-parser beschikbaar voor dit bestand: %1","Error parsing file: %1":"Fout tijdens parsen van bestand: %1","Unable to load file: %1":"Kan bestand niet laden: %1","Invalid date":"Ongeldige datum"};export{r as default}; diff --git a/assets/normalizeUtils-cf8b8053.js b/assets/normalizeUtils-cf8b8053.js new file mode 100644 index 0000000..424918e --- /dev/null +++ b/assets/normalizeUtils-cf8b8053.js @@ -0,0 +1 @@ +import{cm as T,es as U,at as X,cs as F,bf as W,i6 as Z,i7 as _,bz as B,bZ as E,dD as G,c8 as O,i8 as M,ak as P,bb as H,ar as K}from"./index-080e108a.js";import{r as z,o as A,i as R,s as C}from"./normalizeUtilsCommon-500064b3.js";async function Q(t,s,f,n){const e=T(t),c=s[0].spatialReference,a={...n,query:{...e.query,f:"json",sr:JSON.stringify(c),target:JSON.stringify({geometryType:U(s[0]),geometries:s}),cutter:JSON.stringify(f)}},o=await X(e.path+"/cut",a),{cutIndexes:u,geometries:y=[]}=o.data;return{cutIndexes:u,geometries:y.map(h=>{const x=F(h);return x.spatialReference=c,x})}}async function V(t,s,f){const n=typeof t=="string"?W(t):t,e=s[0].spatialReference,c=U(s[0]),a={...f,query:{...n.query,f:"json",sr:e.wkid??JSON.stringify(e),geometries:JSON.stringify(Z(s))}},{data:o}=await X(n.path+"/simplify",a);return _(o.geometries,c,e)}const D=B.getLogger("esri.geometry.support.normalizeUtils");function Y(t){return t.type==="polygon"}function tt(t){return t[0].type==="polygon"}function et(t){return t[0].type==="polyline"}function st(t,s){if(!(t instanceof O||t instanceof P)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw D.error(e),new K(e)}const f=A(t),n=[];for(const e of f){const c=[];n.push(c),c.push([e[0][0],e[0][1]]);for(let a=0;a1){for(let b=1;b<=p-1;b++){const S=b*s,i=m*S+o,r=l*S+u;c.push([i,r])}const w=(x+Math.floor(p-1)*s)/2,j=m*w+o,I=l*w+u;c.push([j,I])}c.push([y,h])}}return Y(t)?new P({rings:n,spatialReference:t.spatialReference}):new O({paths:n,spatialReference:t.spatialReference})}function k(t,s,f){if(s){const n=st(t,1e6);t=H(n,!0)}return f&&(t=C(t,f)),t}function v(t,s,f){if(Array.isArray(t)){const n=t[0];if(n>s){const e=R(n,s);t[0]=n+e*(-2*s)}else if(ns){const e=R(n,s);t=t.clone().offset(e*(-2*s),0)}else if(n{if(y[0]<180)return!0;{let h=0;for(let l=0;lh?m:h}h=Number(h.toFixed(9));const x=-360*R(h,180);for(let l=0;lv(g,o,u)),p.push(r)}else if(i.type==="extent"){const r=i.clone()._normalize(!1,!1,c);p.push(r.rings?new P(r):r)}else if(i.extent){const r=i.extent,g=R(r.xmin,u)*(2*o);let d=g===0?i.clone():C(i.clone(),g);r.offset(g,0),r.intersects(h)&&r.xmax!==o?(l=r.xmax>l?r.xmax:l,d=k(d,a),m.push(d),p.push("cut")):r.intersects(x)&&r.xmin!==u?(l=r.xmax*(2*o)>l?r.xmax*(2*o):l,d=k(d,a,360),m.push(d),p.push("cut")):p.push(d)}else p.push(i.clone());else p.push(i);else p.push(i);let w=R(l,o),j=-90;const I=w,b=new O;for(;w>0;){const i=360*w-180;b.addPath([[i,j],[i,-1*j]]),j*=-1,w--}if(m.length>0&&I>0){const i=nt(m,await Q(n,m,b,f)),r=[],g=[];for(let $=0;$1&&q.rings.length>=N.rings.length?(r.push(q),g.push("simplify")):g.push(a?M(q):q)}}if(!r.length)return g;const d=await V(n,r,f),J=[];for(let $=0;$T(o,u,_)),t;if(X(t))return G(t,s);if(z(t)||$(t)){const o=D(K,t),r={xmin:o[0],ymin:o[1],xmax:o[2],ymax:o[3]},x=p(r.xmin,_)*(2*u),m=x===0?t:F(t,x);return r.xmin+=x,r.xmax+=x,r.xmax>u?L(m,u,i):r.xmin<_?L(m,_,i):m}return t}function G(e,i){if(!i)return e;const n=H(e,i).map(s=>s.extent);return n.length<2?n[0]||e:n.length>2?(e.xmin=i.valid[0],e.xmax=i.valid[1],e):{rings:n.map(s=>[[s.xmin,s.ymin],[s.xmin,s.ymax],[s.xmax,s.ymax],[s.xmax,s.ymin],[s.xmin,s.ymin]])}}function T(e,i,n){if(Array.isArray(e)){const s=e[0];if(s>i){const t=p(s,i);e[0]=s+t*(-2*i)}else if(si){const t=p(s,i);e.x+=t*(-2*i)}else if(s0;if(_>2*r){const v={xmin:ha||k?n.push(new l({xmin:x,ymin:s,xmax:r,ymax:t},[m]),new l({xmin:o,ymin:s,xmax:a,ymax:t},[c])):n.push(new l({xmin:x,ymin:s,xmax:a,ymax:t},[m]));return n}function w(e,i){const[n,s]=i.valid,t=2*s;let h,u=0;return e>s?(h=Math.ceil(Math.abs(e-s)/t),e-=h*t,u=h):e=e.xmin&&i<=e.xmax&&n>=e.ymin&&n<=e.ymax}function L(e,i,n=!0){const s=!$(e);if(s&&E(e),n)return new R().cut(e,i);const t=s?e.rings:e.paths,h=s?4:2,u=t.length,_=-2*i;for(let o=0;o=h){const x=[];for(const m of r)x.push([m[0]+_,m[1]]);t.push(x)}}return s?e.rings=t:e.paths=t,e}class l{constructor(i,n){this.extent=i,this.frameIds=n}}const K=A();class R{constructor(){this._linesIn=[],this._linesOut=[]}cut(i,n){let s;if(this._xCut=n,i.rings)this._closed=!0,s=i.rings,this._minPts=4;else{if(!i.paths)return null;this._closed=!1,s=i.paths,this._minPts=2}for(const h of s){if(!h||h.length=this._minPts&&s.push(h);const t=-2*this._xCut;for(const h of this._linesOut)if(h&&h.length>=this._minPts){for(const u of h)u[0]+=t;s.push(h)}return this._closed?i.rings=s:i.paths=s,i}moveTo(i){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(i[0]),this._moveTo(i[0],i[1],this._prevSide),this._prevPt=i,this._firstPt=i}lineTo(i){const n=this._side(i[0]);if(n*this._prevSide==-1){const s=this._intersect(this._prevPt,i);this._lineTo(this._xCut,s,0),this._prevSide=0,this._lineTo(i[0],i[1],n)}else this._lineTo(i[0],i[1],n);this._prevSide=n,this._prevPt=i}close(){const i=this._firstPt,n=this._prevPt;i[0]===n[0]&&i[1]===n[1]||this.lineTo(i),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(i,n,s){this._closed?(this._lineIn.push([s<=0?i:this._xCut,n]),this._lineOut.push([s>=0?i:this._xCut,n])):(s<=0&&this._lineIn.push([i,n]),s>=0&&this._lineOut.push([i,n]))}_lineTo(i,n,s){this._closed?(this._addPolyVertex(this._lineIn,s<=0?i:this._xCut,n),this._addPolyVertex(this._lineOut,s>=0?i:this._xCut,n)):s<0?(this._prevSide===0&&this._pushLineOut(),this._lineIn.push([i,n])):s>0?(this._prevSide===0&&this._pushLineIn(),this._lineOut.push([i,n])):this._prevSide<0?(this._lineIn.push([i,n]),this._lineOut.push([i,n])):this._prevSide>0&&(this._lineOut.push([i,n]),this._lineIn.push([i,n]))}_addPolyVertex(i,n,s){const t=i.length;t>1&&i[t-1][0]===n&&i[t-2][0]===n?i[t-1][1]=s:i.push([n,s])}_checkClosingPt(i){const n=i.length;n>3&&i[0][0]===this._xCut&&i[n-2][0]===this._xCut&&i[1][0]===this._xCut&&(i[0][1]=i[n-2][1],i.pop())}_side(i){return ithis._xCut?1:0}_intersect(i,n){const s=(this._xCut-i[0])/(n[0]-i[0]);return i[1]+s*(n[1]-i[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}export{Q as a,B as c}; diff --git a/assets/number-e491b09e.js b/assets/number-e491b09e.js new file mode 100644 index 0000000..01e70b4 --- /dev/null +++ b/assets/number-e491b09e.js @@ -0,0 +1 @@ +const u=new Float32Array(1);new Uint32Array(u.buffer);function o(r){return[255&r,(65280&r)>>>8,(16711680&r)>>>16,(4278190080&r)>>>24]}function f(r,n){return 65535&r|n<<16}function c(r,n,t,e){return 255&r|(255&n)<<8|(255&t)<<16|e<<24}export{o as M,f as w,c as x}; diff --git a/assets/number-e5825aa4.js b/assets/number-e5825aa4.js new file mode 100644 index 0000000..60cd92a --- /dev/null +++ b/assets/number-e5825aa4.js @@ -0,0 +1 @@ +import{ee as E,ef as S}from"./index-080e108a.js";const x={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function w(e=E()){let t=(e=e.toLowerCase())in x;if(!t){const l=e.split("-");l.length>1&&l[0]in x&&(e=l[0],t=!0),t||(e="en")}const[n,r,s="#,##0.###"]=x[e];return{decimal:n,group:r,pattern:s}}function I(e,t){const n=w((t={...t}).locale);t.customs=n;const r=t.pattern||n.pattern;return isNaN(e)||Math.abs(e)===1/0?null:v(e,r,t)}const N=/[#0,]*[#0](?:\.0*#*)?/;function v(e,t,n){const r=(n=n||{}).customs.group,s=n.customs.decimal,l=t.split(";"),o=l[0];if((t=l[e<0?1:0]||"-"+o).includes("%"))e*=100;else if(t.includes("‰"))e*=1e3;else{if(t.includes("¤"))throw new Error("currency notation not supported");if(t.includes("E"))throw new Error("exponential notation not supported")}const d=N,u=o.match(d);if(!u)throw new Error("unable to find a number expression in pattern: "+t);return n.fractional===!1&&(n.places=0),t.replace(d,z(e,u[0],{decimal:s,group:r,places:n.places,round:n.round}))}function z(e,t,n){(n=n||{}).places===!0&&(n.places=0),n.places===1/0&&(n.places=6);const r=t.split("."),s=typeof n.places=="string"&&n.places.indexOf(",");let l=n.places;s?l=n.places.substring(s+1):+l>=0||(l=(r[1]||[]).length),n.round<0||(e=Number(e.toFixed(Number(l))));const o=String(Math.abs(e)).split("."),d=o[1]||"";if(r[1]||n.places){s&&(n.places=n.places.substring(0,s));const i=n.places!==void 0?n.places:r[1]&&r[1].lastIndexOf("0")+1;+i>d.length&&(o[1]=d.padEnd(Number(i),"0")),+lo[0].length&&(o[0]=o[0].padStart(f,"0")),u.includes("#")||(o[0]=o[0].substr(o[0].length-f)));let p,c,a=r[0].lastIndexOf(",");if(a!==-1){p=r[0].length-a-1;const i=r[0].substr(0,a);a=i.lastIndexOf(","),a!==-1&&(c=i.length-a-1)}const g=[];for(let i=o[0];i;){const m=i.length-p;g.push(m>0?i.substr(m):i),i=m>0?i.slice(0,m):"",c&&(p=c,c=void 0)}return o[0]=g.reverse().join(n.group||","),o.join(n.decimal||".")}function O(e){const t=w((e=e||{}).locale),n=e.pattern||t.pattern,r=t.group,s=t.decimal;let l=1;if(n.includes("%"))l/=100;else if(n.includes("‰"))l/=1e3;else if(n.includes("¤"))throw new Error("currency notation not supported");const o=n.split(";");return o.length===1&&o.push("-"+o[0]),{regexp:h(o,u=>(u="(?:"+S(u,".")+")").replace(N,f=>{const p={signed:!1,separator:e.strict?r:[r,""],fractional:e.fractional,decimal:s,exponent:!1},c=f.split(".");let a=e.places;c.length===1&&l!==1&&(c[1]="###"),c.length===1||a===0?p.fractional=!1:(a===void 0&&(a=e.pattern?c[1].lastIndexOf("0")+1:1/0),a&&e.fractional==null&&(p.fractional=!0),!e.places&&+a1&&(p.groupSize=g.pop().length,g.length>1&&(p.groupSize2=g.pop().length)),"("+y(p)+")"}),!0).replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:r,decimal:s,factor:l}}function A(e,t){const n=O(t),r=new RegExp("^"+n.regexp+"$").exec(e);if(!r)return NaN;let s=r[1];if(!r[1]){if(!r[2])return NaN;s=r[2],n.factor*=-1}return s=s.replaceAll(new RegExp("["+n.group+"\\s\\xa0]","g"),"").replace(n.decimal,"."),Number(s)*n.factor}function y(e){"places"in(e=e||{})||(e.places=1/0),typeof e.decimal!="string"&&(e.decimal="."),"fractional"in e&&!/^0/.test(String(e.places))||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const t=b(e),n=h(e.fractional,s=>{let l="";return s&&e.places!==0&&(l="\\"+e.decimal,e.places===1/0?l="(?:"+l+"\\d+)?":l+="\\d{"+e.places+"}"),l},!0);let r=t+n;return n&&(r="(?:(?:"+r+")|(?:"+n+"))"),r+h(e.exponent,s=>s?"([eE]"+b({signed:e.eSigned})+")":"")}function b(e){return"signed"in(e=e||{})||(e.signed=[!0,!1]),"separator"in e?"groupSize"in e||(e.groupSize=3):e.separator="",h(e.signed,t=>t?"[-+]":"",!0)+h(e.separator,t=>{if(!t)return"(?:\\d+)";(t=S(t))===" "?t="\\s":t===" "&&(t="\\s\\xa0");const n=e.groupSize,r=e.groupSize2;if(r){const s="(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+t+"]\\d{"+r+"})*["+t+"]\\d{"+n+"})";return n-r>0?"(?:"+s+"|(?:0|[1-9]\\d{0,"+(n-1)+"}))":s}return"(?:0|[1-9]\\d{0,"+(n-1)+"}(?:["+t+"]\\d{"+n+"})*)"},!0)}const h=(e,t,n)=>{if(!(e instanceof Array))return t(e);const r=[];for(let s=0;s"("+(t?"?:":"")+e+")";export{O as a,A as p,I as s}; diff --git a/assets/objectIdUtils-789e911a.js b/assets/objectIdUtils-789e911a.js new file mode 100644 index 0000000..2831ba1 --- /dev/null +++ b/assets/objectIdUtils-789e911a.js @@ -0,0 +1 @@ +const s=1;function c(e,r){var o;let t=0;for(const i of r){const n=(o=i.attributes)==null?void 0:o[e];typeof n=="number"&&isFinite(n)&&(t=Math.max(t,n))}return t}export{c as n,s as t}; diff --git a/assets/observers-4ce6e1b4.js b/assets/observers-4ce6e1b4.js new file mode 100644 index 0000000..7d840a7 --- /dev/null +++ b/assets/observers-4ce6e1b4.js @@ -0,0 +1,5 @@ +import"./index-080e108a.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */function b(r,n,o){const e=i(r);return new e(n,o)}function i(r){class n extends window.MutationObserver{constructor(e){super(e),this.observedEntry=[],this.callback=e}observe(e,t){return this.observedEntry.push({target:e,options:t}),super.observe(e,t)}unobserve(e){const t=this.observedEntry.filter(s=>s.target!==e);this.observedEntry=[],this.callback(super.takeRecords(),this),this.disconnect(),t.forEach(s=>this.observe(s.target,s.options))}}return function(){return r==="intersection"?window.IntersectionObserver:r==="mutation"?n:window.ResizeObserver}()}export{b as c}; diff --git a/assets/ogcFeatureUtils-1ccf1f8d.js b/assets/ogcFeatureUtils-1ccf1f8d.js new file mode 100644 index 0000000..eaec8b7 --- /dev/null +++ b/assets/ogcFeatureUtils-1ccf1f8d.js @@ -0,0 +1 @@ +import{bz as A,ar as g,at as I,ep as E,bc as F,eC as _,er as B,eq as Q,c$ as O,eo as U,eD as V}from"./index-080e108a.js";import{T as H,L as X,I as Y}from"./geojson-077f67ec.js";import{o as ee}from"./clientSideDefaults-ab04bd90.js";import{r as ne}from"./FieldsIndex-f79a8f26.js";const N=A.getLogger("esri.layers.graphics.sources.ogcfeature"),G="http://www.opengis.net/def/crs/",fe=`${G}OGC/1.3/CRS84`;async function me(n,t,e={},i=5){const{links:r}=n,l=f(r,"items","application/geo+json")||f(r,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(l==null)throw new g("ogc-feature-layer:missing-items-page","Missing items url");const{data:u}=await I(l.href,{signal:e.signal,query:{limit:i,...e.customParameters,token:e.apiKey},headers:{accept:"application/geo+json"}});await H(u);const s=X(u,{geometryType:t.geometryType}),d=t.fields||s.fields||[],j=t.hasZ!=null?t.hasZ:s.hasZ,b=s.geometryType,m=t.objectIdField||s.objectIdFieldName||"OBJECTID";let o=t.timeInfo;const T=d.find(({name:a})=>a===m);if(T)T.editable=!1,T.nullable=!1;else{if(!s.objectIdFieldType)throw new g("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");d.unshift({name:m,alias:m,type:s.objectIdFieldType==="number"?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(m!==s.objectIdFieldName){const a=d.find(({name:c})=>c===s.objectIdFieldName);a&&(a.type="esriFieldTypeInteger")}d===s.fields&&s.unknownFields.length>0&&N.warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:s.unknownFields}});for(const a of d){if(a.name==null&&(a.name=a.alias),a.alias==null&&(a.alias=a.name),a.type!=="esriFieldTypeOID"&&a.type!=="esriFieldTypeGlobalID"&&(a.editable=a.editable==null||!!a.editable,a.nullable=a.nullable==null||!!a.nullable),!a.name)throw new g("ogc-feature-layer:invalid-field-name","field name is missing",{field:a});if(!E.jsonValues.includes(a.type))throw new g("ogc-feature-layer:invalid-field-type",`invalid type for field "${a.name}"`,{field:a})}if(o){const a=new ne(d);if(o.startTimeField){const c=a.get(o.startTimeField);c?(o.startTimeField=c.name,c.type="esriFieldTypeDate"):o.startTimeField=null}if(o.endTimeField){const c=a.get(o.endTimeField);c?(o.endTimeField=c.name,c.type="esriFieldTypeDate"):o.endTimeField=null}if(o.trackIdField){const c=a.get(o.trackIdField);c?o.trackIdField=c.name:(o.trackIdField=null,N.warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:o}}))}o.startTimeField||o.endTimeField||(N.warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:o}}),o=null)}return{drawingInfo:b?ee(b):null,extent:oe(n),geometryType:b,fields:d,hasZ:!!j,objectIdField:m,timeInfo:o}}async function pe(n,t={}){const{links:e}=n,i=f(e,"data","application/json")||f(e,"http://www.opengis.net/def/rel/ogc/1.0/data","application/json");if(i==null)throw new g("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:r,customParameters:l,signal:u}=t,{data:s}=await I(i.href,{signal:u,headers:{accept:"application/json"},query:{...l,token:r}});return s}async function ge(n,t={}){const{links:e}=n,i=f(e,"conformance","application/json")||f(e,"http://www.opengis.net/def/rel/ogc/1.0/conformance","application/json");if(i==null)throw new g("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:r,customParameters:l,signal:u}=t,{data:s}=await I(i.href,{signal:u,headers:{accept:"application/json"},query:{...l,token:r}});return s}async function ye(n,t={}){const{apiKey:e,customParameters:i,signal:r}=t,{data:l}=await I(n,{signal:r,headers:{accept:"application/json"},query:{...i,token:e}});return l}async function we(n,t={}){const e="application/vnd.oai.openapi+json;version=3.0",i=f(n.links,"service-desc",e);if(i==null)return N.warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:r,customParameters:l,signal:u}=t,{data:s}=await I(i.href,{signal:u,headers:{accept:e},query:{...l,token:r}});return s}function be(n){const t=/^http:\/\/www\.opengis.net\/def\/crs\/(?.*)\/(?.*)\/(?.*)$/i.exec(n),e=t==null?void 0:t.groups;if(!e)return null;const{authority:i,code:r}=e;switch(i.toLowerCase()){case"ogc":switch(r.toLowerCase()){case"crs27":return F.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return F.WGS84.wkid;default:return null}case"esri":case"epsg":{const l=Number.parseInt(r,10);return Number.isNaN(l)?null:l}default:return null}}async function he(n,t,e){const i=await te(n,t,e);return _(i)}async function te(n,t,e){const{collection:i,layerDefinition:r,maxRecordCount:l,queryParameters:{apiKey:u,customParameters:s},spatialReference:d,supportedCrs:j}=n,{links:b}=i,m=f(b,"items","application/geo+json")||f(b,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(m==null)throw new g("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:o,num:T,start:a,timeExtent:c,where:W}=t;if(t.objectIds)throw new g("ogc-feature-layer:query-by-objectids-not-supported","Queries with objectids are not supported");const D=F.fromJSON(d),h=t.outSpatialReference??D,k=h.isWGS84?null:R(h,j),P=se(o,j),Z=ae(c),K=re(W),L=T??(a!=null&&a!==void 0?10:l),{data:y}=await I(m.href,{...e,query:{...s,...P,crs:k,datetime:Z,query:K,limit:L,startindex:a,token:u},headers:{accept:"application/geo+json"}});let x=!1;y.links&&(x=!!y.links.find(v=>v.rel==="next")),!x&&Number.isInteger(y.numberMatched)&&Number.isInteger(y.numberReturned)&&(x=y.numberReturnedi.rel===t&&i.type===e)||n.find(i=>i.rel===t&&!i.type)}export{ge as F,ye as I,te as S,we as T,fe as b,me as h,pe as j,be as k,G as w,he as x}; diff --git a/assets/optimizedFeatureQueryEngineAdapter-58185a60.js b/assets/optimizedFeatureQueryEngineAdapter-58185a60.js new file mode 100644 index 0000000..6b1996a --- /dev/null +++ b/assets/optimizedFeatureQueryEngineAdapter-58185a60.js @@ -0,0 +1 @@ +import{t as r}from"./centroid-8e8cfa47.js";import{bL as o,bM as i}from"./index-080e108a.js";const s={getObjectId:t=>t.objectId,getAttributes:t=>t.attributes,getAttribute:(t,e)=>t.attributes[e],cloneWithGeometry:(t,e)=>new o(e,t.attributes,null,t.objectId),getGeometry:t=>t.geometry,getCentroid:(t,e)=>(t.centroid==null&&(t.centroid=r(new i,t.geometry,e.hasZ,e.hasM)),t.centroid)};export{s as o}; diff --git a/assets/originUtils-1469eeaf.js b/assets/originUtils-1469eeaf.js new file mode 100644 index 0000000..44c4591 --- /dev/null +++ b/assets/originUtils-1469eeaf.js @@ -0,0 +1 @@ +import{i as o}from"./multiOriginJSONSupportUtils-c978f4c3.js";function p(r){r&&r.writtenProperties&&r.writtenProperties.forEach(({target:i,propName:e,newOrigin:t})=>{o(i)&&t&&i.originOf(e)!==t&&i.updateOrigin(e,t)})}export{p as i}; diff --git a/assets/overlay-svg-d62383f3.js b/assets/overlay-svg-d62383f3.js new file mode 100644 index 0000000..5057fe9 --- /dev/null +++ b/assets/overlay-svg-d62383f3.js @@ -0,0 +1 @@ +const I="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHN0eWxlPSJmaWxsLXJ1bGU6ZXZlbm9kZDtjbGlwLXJ1bGU6ZXZlbm9kZDtzdHJva2UtbGluZWNhcDpyb3VuZDtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6MS41IiB2aWV3Qm94PSIwIDAgMjU2IDI1NiI+PHBhdGggZD0iTTEyOCA4YzY2LjIzIDAgMTIwIDUzLjc3IDEyMCAxMjAgMCA2Ni4yMy01My43NyAxMjAtMTIwIDEyMEM2MS43NyAyNDggOCAxOTQuMjMgOCAxMjggOCA2MS43NyA2MS43NyA4IDEyOCA4Wm0wIDhjNjEuODE0IDAgMTEyIDUwLjE4NiAxMTIgMTEycy01MC4xODYgMTEyLTExMiAxMTJTMTYgMTg5LjgxNCAxNiAxMjggNjYuMTg2IDE2IDEyOCAxNloiIHN0eWxlPSJmaWxsOnVybCgjYSk7c3Ryb2tlOiMwMDA7c3Ryb2tlLW9wYWNpdHk6LjU7c3Ryb2tlLXdpZHRoOi45NnB4IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtNS4zMzMgLTUuMzMzKSBzY2FsZSgxLjA0MTY3KSIvPjxwYXRoIGQ9Ik0xMjggOGM2Ni4yMyAwIDEyMCA1My43NyAxMjAgMTIwIDAgNjYuMjMtNTMuNzcgMTIwLTEyMCAxMjBDNjEuNzcgMjQ4IDggMTk0LjIzIDggMTI4IDggNjEuNzcgNjEuNzcgOCAxMjggOFptMCA0LjI5OGM2My44NTcgMCAxMTUuNzAyIDUxLjg0NSAxMTUuNzAyIDExNS43MDJTMTkxLjg1NyAyNDMuNzAyIDEyOCAyNDMuNzAyIDEyLjI5OCAxOTEuODU3IDEyLjI5OCAxMjggNjQuMTQzIDEyLjI5OCAxMjggMTIuMjk4WiIgc3R5bGU9ImZpbGw6dXJsKCNiKSIgdHJhbnNmb3JtPSJyb3RhdGUoMTgwIDEyOC41MzQgMTI4LjUzNCkgc2NhbGUoMS4wMDgzNCkiLz48Y2lyY2xlIGN4PSIxMjgiIGN5PSIxMjgiIHI9IjExMiIgc3R5bGU9ImZpbGw6dXJsKCNjKSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTUuMzMzIC01LjMzMykgc2NhbGUoMS4wNDE2NykiLz48cGF0aCBkPSJNMTI4IDIwYzkxLjg4NCAxLjgxMSAxMDcgODggMTA3IDg4cy00NS4xODYtMjgtMTA3LTI4LTEwNyAyOC0xMDcgMjggMjEuMjQ0LTg5LjY5IDEwNy04OFoiIHN0eWxlPSJmaWxsOnVybCgjZCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC01LjMzMyAtNS4zMzMpIHNjYWxlKDEuMDQxNjcpIi8+PHBhdGggZD0iTTEyOCAxMzEuNTZWMTU4IiBzdHlsZT0iZmlsbDpub25lO3N0cm9rZTojMDAwO3N0cm9rZS13aWR0aDouOTZweDtzdHJva2UtbGluZWNhcDpidXR0IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCAxMzMuMDc0IDEyNy43NCkgc2NhbGUoMS4wNDE2NykiLz48cGF0aCBkPSJNMTI4IDEyOS42NHYyNi40NCIgc3R5bGU9ImZpbGw6bm9uZTtzdHJva2U6IzAwMDtzdHJva2Utd2lkdGg6Ljk2cHg7c3Ryb2tlLWxpbmVjYXA6YnV0dCIgdHJhbnNmb3JtPSJyb3RhdGUoOTAgMTUwLjA3NCAxNDQuNzQpIHNjYWxlKDEuMDQxNjcpIi8+PHBhdGggZD0iTTEyOCAxMzEuNTZWMTU4IiBzdHlsZT0iZmlsbDpub25lO3N0cm9rZTojMDAwO3N0cm9rZS13aWR0aDouOTZweDtzdHJva2UtbGluZWNhcDpidXR0IiB0cmFuc2Zvcm09InJvdGF0ZSgxODAgMTMwLjY2OCAxMzAuNDA3KSBzY2FsZSgxLjA0MTY3KSIvPjxwYXRoIGQ9Ik0xMjggMTI5LjY0djI2LjQ0IiBzdHlsZT0iZmlsbDpub25lO3N0cm9rZTojMDAwO3N0cm9rZS13aWR0aDouOTZweDtzdHJva2UtbGluZWNhcDpidXR0IiB0cmFuc2Zvcm09InJvdGF0ZSgxODAgMTMwLjY2OCAxNDcuNDA3KSBzY2FsZSgxLjA0MTY3KSIvPjxkZWZzPjxsaW5lYXJHcmFkaWVudCBpZD0iYSIgeDE9IjAiIHgyPSIxIiB5MT0iMCIgeTI9IjAiIGdyYWRpZW50VHJhbnNmb3JtPSJyb3RhdGUoNDcuNjE3IC0yMS44OCA3NS4xNTYpIHNjYWxlKDIzNy44MzUpIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHN0b3Agb2Zmc2V0PSIwIiBzdHlsZT0ic3RvcC1jb2xvcjp3aGl0ZTtzdG9wLW9wYWNpdHk6MSIvPjxzdG9wIG9mZnNldD0iMSIgc3R5bGU9InN0b3AtY29sb3I6I2RhZGFkYTtzdG9wLW9wYWNpdHk6MSIvPjwvbGluZWFyR3JhZGllbnQ+PGxpbmVhckdyYWRpZW50IGlkPSJiIiB4MT0iMCIgeDI9IjEiIHkxPSIwIiB5Mj0iMCIgZ3JhZGllbnRUcmFuc2Zvcm09InJvdGF0ZSg0Ny42MTcgLTIxLjg4IDc1LjE1Nikgc2NhbGUoMjM3LjgzNSkiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9IjAiIHN0eWxlPSJzdG9wLWNvbG9yOndoaXRlO3N0b3Atb3BhY2l0eToxIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjojOWE5YTlhO3N0b3Atb3BhY2l0eToxIi8+PC9saW5lYXJHcmFkaWVudD48bGluZWFyR3JhZGllbnQgaWQ9ImQiIHgxPSIwIiB4Mj0iMSIgeTE9IjAiIHkyPSIwIiBncmFkaWVudFRyYW5zZm9ybT0icm90YXRlKC05MCAxMDQgLTI0KSBzY2FsZSg2MC4wMjM2KSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIG9mZnNldD0iMCIgc3R5bGU9InN0b3AtY29sb3I6d2hpdGU7c3RvcC1vcGFjaXR5Oi4wNSIvPjxzdG9wIG9mZnNldD0iMSIgc3R5bGU9InN0b3AtY29sb3I6d2hpdGU7c3RvcC1vcGFjaXR5Oi40Ii8+PC9saW5lYXJHcmFkaWVudD48cmFkaWFsR3JhZGllbnQgaWQ9ImMiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRUcmFuc2Zvcm09Im1hdHJpeCgxNjUgLTEgMSAxNjUgMTI4IDIxMSkiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9IjAiIHN0eWxlPSJzdG9wLWNvbG9yOndoaXRlO3N0b3Atb3BhY2l0eTouNDQiLz48c3RvcCBvZmZzZXQ9IjEiIHN0eWxlPSJzdG9wLWNvbG9yOndoaXRlO3N0b3Atb3BhY2l0eTowIi8+PC9yYWRpYWxHcmFkaWVudD48L2RlZnM+PC9zdmc+";export{I as default}; diff --git a/assets/pbf-d9aa3914.js b/assets/pbf-d9aa3914.js new file mode 100644 index 0000000..c75597d --- /dev/null +++ b/assets/pbf-d9aa3914.js @@ -0,0 +1 @@ +import{cn as d,co as g}from"./index-080e108a.js";var h;(function(n){n[n.varint=0]="varint",n[n.fixed64=1]="fixed64",n[n.delimited=2]="delimited",n[n.fixed32=5]="fixed32",n[n.unknown=99]="unknown"})(h||(h={}));const p=4294967296,f=new TextDecoder("utf-8"),u=d("safari")||d("ios")?6:d("ff")?12:32;class o{constructor(t,i,s=0,e=t?t.byteLength:0){this._tag=0,this._dataType=h.unknown,this._init(t,i,s,e)}_init(t,i,s,e){this._data=t,this._dataView=i,this._pos=s,this._end=e}asUnsafe(){return this}clone(){return new o(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(t){this._pos=t}nextTag(t){for(;;){if(this._pos===this._end)return!1;const i=this._decodeVarint();if(this._tag=i>>3,this._dataType=7&i,!t||t===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const t=this._decodeVarint();return this._tag=t>>3,this._dataType=7&t,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let t=4294967295;return t=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128?t:(t=(t|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128?t:void 0))))}getUInt64(){return this._decodeVarint()}getSInt32(){const t=this.getUInt32();if(t!==void 0)return t>>>1^-(1&t)|0}getSInt64(){return this._decodeSVarint()}getBool(){const t=this._data[this._pos]!==0;return this._skip(1),t}getEnum(){return this._decodeVarint()}getFixed64(){const t=this._dataView,i=this._pos,s=t.getUint32(i,!0)+t.getUint32(i+4,!0)*p;return this._skip(8),s}getSFixed64(){const t=this._dataView,i=this._pos,s=t.getUint32(i,!0)+t.getInt32(i+4,!0)*p;return this._skip(8),s}getDouble(){const t=this._dataView.getFloat64(this._pos,!0);return this._skip(8),t}getFixed32(){const t=this._dataView.getUint32(this._pos,!0);return this._skip(4),t}getSFixed32(){const t=this._dataView.getInt32(this._pos,!0);return this._skip(4),t}getFloat(){const t=this._dataView.getFloat32(this._pos,!0);return this._skip(4),t}getString(){const t=this._getLength(),i=this._pos,s=this._toString(this._data,i,i+t);return this._skip(t),s}getBytes(){const t=this._getLength(),i=this._pos,s=this._toBytes(this._data,i,i+t);return this._skip(t),s}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(t,i,s,e){const r=this.getMessage(),a=t(r,i,s,e);return r.release(),a}processMessage(t){const i=this.getMessage(),s=t(i);return i.release(),s}getMessage(){const t=this._getLength(),i=o.pool.acquire();return i._init(this._data,this._dataView,this._pos,this._pos+t),this._skip(t),i}release(){o.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case h.varint:this._decodeVarint();break;case h.fixed64:this._skip(8);break;case h.delimited:this._skip(this._getLength());break;case h.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(t){this._skip(t)}_skip(t){if(this._pos+t>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=t}_decodeVarint(){const t=this._data;let i=this._pos,s=0,e=0;if(this._end-i>=10)do{if(e=t[i++],s|=127&e,(128&e)==0||(e=t[i++],s|=(127&e)<<7,(128&e)==0)||(e=t[i++],s|=(127&e)<<14,(128&e)==0)||(e=t[i++],s|=(127&e)<<21,(128&e)==0)||(e=t[i++],s+=268435456*(127&e),(128&e)==0)||(e=t[i++],s+=34359738368*(127&e),(128&e)==0)||(e=t[i++],s+=4398046511104*(127&e),(128&e)==0)||(e=t[i++],s+=562949953421312*(127&e),(128&e)==0)||(e=t[i++],s+=72057594037927940*(127&e),(128&e)==0)||(e=t[i++],s+=9223372036854776e3*(127&e),(128&e)==0))break;throw new Error("Varint too long!")}while(0);else{let r=1;for(;i!==this._end&&(e=t[i],(128&e)!=0);)++i,s+=(127&e)*r,r*=128;if(i===this._end)throw new Error("Varint overrun!");++i,s+=e*r}return this._pos=i,s}_decodeSVarint(){const t=this._data;let i=this._pos,s=0,e=0;const r=1&t[i];if(this._end-i>=10)do{if(e=t[i++],s|=127&e,(128&e)==0||(e=t[i++],s|=(127&e)<<7,(128&e)==0)||(e=t[i++],s|=(127&e)<<14,(128&e)==0)||(e=t[i++],s|=(127&e)<<21,(128&e)==0)||(e=t[i++],s+=268435456*(127&e),(128&e)==0)||(e=t[i++],s+=34359738368*(127&e),(128&e)==0)||(e=t[i++],s+=4398046511104*(127&e),(128&e)==0)||(e=t[i++],s+=562949953421312*(127&e),(128&e)==0)||(e=t[i++],s+=72057594037927940*(127&e),(128&e)==0)||(e=t[i++],s+=9223372036854776e3*(127&e),(128&e)==0))break;throw new Error("Varint too long!")}while(0);else{let a=1;for(;i!==this._end&&(e=t[i],(128&e)!=0);)++i,s+=(127&e)*a,a*=128;if(i===this._end)throw new Error("Varint overrun!");++i,s+=e*a}return this._pos=i,r?-(s+1)/2:s/2}_getLength(){if(this._dataType!==h.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(t,i,s){if((s=Math.min(this._end,s))-i>u){const a=t.subarray(i,s);return f.decode(a)}let e="",r="";for(let a=i;a{n._data=null,n._dataView=null});export{o as n}; diff --git a/assets/pbfQueryUtils-26a87215.js b/assets/pbfQueryUtils-26a87215.js new file mode 100644 index 0000000..c1e9459 --- /dev/null +++ b/assets/pbfQueryUtils-26a87215.js @@ -0,0 +1 @@ +import{eD as S,cM as w,cL as d,i9 as U,bL as D,bM as y,ar as G}from"./index-080e108a.js";import{n as R}from"./pbf-d9aa3914.js";const F=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];let K=class{constructor(e){this._options=e,this.geometryTypes=F,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new S}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!e||!e.features||!e.hasZ||!this._options.sourceSpatialReference||!e.spatialReference||w(e.spatialReference,this._options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const a=d(this._options.sourceSpatialReference)/d(e.spatialReference);if(a!==1)for(const n of e.features){if(!U(n))continue;const r=n.geometry.coords;for(let s=2;sa+n,0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,a){e.coords[this._coordinatePtr++]=a}addCoordinatePoint(e,a){e.coords.push(a)}addLength(e,a){e.lengths.push(a)}addQueryGeometry(e,a){e.queryGeometry=a.queryGeometry,e.queryGeometryType=a.queryGeometryType}createPointGeometry(){return new y}};const b=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],h=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],k=["upperLeft","lowerLeft"];function m(t){return t>=b.length?null:b[t]}function x(t){return t>=h.length?null:h[t]}function T(t){return t>=k.length?null:k[t]}function q(t,e){return e>=t.geometryTypes.length?null:t.geometryTypes[e]}function M(t,e,a){const r=t.asUnsafe(),s=e.createPointGeometry(a);for(;r.next();)switch(r.tag()){case 3:{const o=r.getUInt32(),i=r.pos()+o;let c=0;for(;r.pos()w[F]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Pr,_e,yr,ue={exports:{}};ue.exports,Pr=ue,ue.exports,_e=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(_e=_e||__filename),yr=function(e){var J,Z;(e=(e=e||{})!==void 0?e:{}).ready=new Promise(function(t,n){J=t,Z=n});var w,F,B,de=Object.assign({},e),ce="./this.program",Ee=typeof window=="object",K=typeof importScripts=="function",be=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Y="";function fr(t){return e.locateFile?e.locateFile(t,Y):Y+t}if(be){var Oe=require("fs"),ge=require("path");Y=K?ge.dirname(Y)+"/":__dirname+"/",w=(t,n)=>(t=ae(t)?new URL(t):ge.normalize(t),Oe.readFileSync(t,n?void 0:"utf8")),B=t=>{var n=w(t,!0);return n.buffer||(n=new Uint8Array(n)),n},F=(t,n,_)=>{t=ae(t)?new URL(t):ge.normalize(t),Oe.readFile(t,function(o,p){o?_(o):n(p.buffer)})},process.argv.length>1&&(ce=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(t){if(!(t instanceof Rr))throw t}),process.on("unhandledRejection",function(t){throw t}),e.inspect=function(){return"[Emscripten Module object]"}}else(Ee||K)&&(K?Y=self.location.href:typeof document<"u"&&document.currentScript&&(Y=document.currentScript.src),_e&&(Y=_e),Y=Y.indexOf("blob:")!==0?Y.substr(0,Y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",w=t=>{var n=new XMLHttpRequest;return n.open("GET",t,!1),n.send(null),n.responseText},K&&(B=t=>{var n=new XMLHttpRequest;return n.open("GET",t,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}),F=(t,n,_)=>{var o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="arraybuffer",o.onload=()=>{o.status==200||o.status==0&&o.response?n(o.response):_()},o.onerror=_,o.send(null)});var $,Pe,lr=e.print||console.log.bind(console),q=e.printErr||console.warn.bind(console);Object.assign(e,de),de=null,e.arguments&&e.arguments,e.thisProgram&&(ce=e.thisProgram),e.quit&&e.quit,e.wasmBinary&&($=e.wasmBinary),e.noExitRuntime,typeof WebAssembly!="object"&&k("no native wasm support detected");var Te=!1;function ye(t,n){t||k(n)}var Se,H,Q,oe,h,G,pe,ie,Ne=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function he(t,n,_){for(var o=n+_,p=n;t[p]&&!(p>=o);)++p;if(p-n>16&&t.buffer&&Ne)return Ne.decode(t.subarray(n,p));for(var i="";n>10,56320|1023&re)}}else i+=String.fromCharCode((31&u)<<6|c)}else i+=String.fromCharCode(u)}return i}function U(t,n){return t?he(Q,t,n):""}function Me(t,n,_,o){if(!(o>0))return 0;for(var p=_,i=_+o-1,u=0;u=55296&&c<=57343&&(c=65536+((1023&c)<<10)|1023&t.charCodeAt(++u)),c<=127){if(_>=i)break;n[_++]=c}else if(c<=2047){if(_+1>=i)break;n[_++]=192|c>>6,n[_++]=128|63&c}else if(c<=65535){if(_+2>=i)break;n[_++]=224|c>>12,n[_++]=128|c>>6&63,n[_++]=128|63&c}else{if(_+3>=i)break;n[_++]=240|c>>18,n[_++]=128|c>>12&63,n[_++]=128|c>>6&63,n[_++]=128|63&c}}return n[_]=0,_-p}function ve(t){for(var n=0,_=0;_=55296&&o<=57343?(n+=4,++_):n+=3}return n}function De(t){Se=t,e.HEAP8=H=new Int8Array(t),e.HEAP16=oe=new Int16Array(t),e.HEAP32=h=new Int32Array(t),e.HEAPU8=Q=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=G=new Uint32Array(t),e.HEAPF32=pe=new Float32Array(t),e.HEAPF64=ie=new Float64Array(t)}e.INITIAL_MEMORY;var Re=[],Ae=[],Ge=[];function dr(){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)Or(e.preRun.shift());me(Re)}function Er(){me(Ae)}function br(){if(e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;)Sr(e.postRun.shift());me(Ge)}function Or(t){Re.unshift(t)}function Tr(t){Ae.unshift(t)}function Sr(t){Ge.unshift(t)}var V=0,ee=null;function Nr(t){V++,e.monitorRunDependencies&&e.monitorRunDependencies(V)}function hr(t){if(V--,e.monitorRunDependencies&&e.monitorRunDependencies(V),V==0&&ee){var n=ee;ee=null,n()}}function k(t){e.onAbort&&e.onAbort(t),q(t="Aborted("+t+")"),Te=!0,t+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(t);throw Z(n),n}var I,Mr="data:application/octet-stream;base64,";function Ce(t){return t.startsWith(Mr)}function ae(t){return t.startsWith("file://")}function Ie(t){try{if(t==I&&$)return new Uint8Array($);if(B)return B(t);throw"both async and sync fetching of the wasm failed"}catch(n){k(n)}}function vr(){if(!$&&(Ee||K)){if(typeof fetch=="function"&&!ae(I))return fetch(I,{credentials:"same-origin"}).then(function(t){if(!t.ok)throw"failed to load wasm binary file at '"+I+"'";return t.arrayBuffer()}).catch(function(){return Ie(I)});if(F)return new Promise(function(t,n){F(I,function(_){t(new Uint8Array(_))},n)})}return Promise.resolve().then(function(){return Ie(I)})}function Dr(){var t={a:a_};function n(i,u){var c=i.exports;e.asm=c,De((Pe=e.asm.t).buffer),e.asm.Yb,Tr(e.asm.u),hr()}function _(i){n(i.instance)}function o(i){return vr().then(function(u){return WebAssembly.instantiate(u,t)}).then(function(u){return u}).then(i,function(u){q("failed to asynchronously prepare wasm: "+u),k(u)})}function p(){return $||typeof WebAssembly.instantiateStreaming!="function"||Ce(I)||ae(I)||be||typeof fetch!="function"?o(_):fetch(I,{credentials:"same-origin"}).then(function(i){return WebAssembly.instantiateStreaming(i,t).then(_,function(u){return q("wasm streaming compile failed: "+u),q("falling back to ArrayBuffer instantiation"),o(_)})})}if(Nr(),e.instantiateWasm)try{return e.instantiateWasm(t,n)}catch(i){q("Module.instantiateWasm callback failed with error: "+i),Z(i)}return p().catch(Z),{}}function Rr(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function me(t){for(;t.length>0;)t.shift()(e)}function Ar(t,n="i8"){switch(n.endsWith("*")&&(n="*"),n){case"i1":case"i8":return H[t>>0];case"i16":return oe[t>>1];case"i32":case"i64":return h[t>>2];case"float":return pe[t>>2];case"double":return ie[t>>3];case"*":return G[t>>2];default:k("invalid type for getValue: "+n)}return null}function Gr(t,n,_){return 0}function Cr(t,n,_){}function Ir(t,n,_){return 0}function jr(t,n,_,o){}function Ur(t){}function Lr(t,n){}function Yr(t,n,_){}function xr(t){return G[t>>2]+4294967296*h[t+4>>2]}function Fr(t){return t%4==0&&(t%100!=0||t%400==0)}Ce(I="pe-wasm.wasm")||(I=fr(I));var wr=[0,31,60,91,121,152,182,213,244,274,305,335],Hr=[0,31,59,90,120,151,181,212,243,273,304,334];function Xr(t){return(Fr(t.getFullYear())?wr:Hr)[t.getMonth()]+t.getDate()-1}function zr(t,n){var _=new Date(1e3*xr(t));h[n>>2]=_.getSeconds(),h[n+4>>2]=_.getMinutes(),h[n+8>>2]=_.getHours(),h[n+12>>2]=_.getDate(),h[n+16>>2]=_.getMonth(),h[n+20>>2]=_.getFullYear()-1900,h[n+24>>2]=_.getDay();var o=0|Xr(_);h[n+28>>2]=o,h[n+36>>2]=-60*_.getTimezoneOffset();var p=new Date(_.getFullYear(),0,1),i=new Date(_.getFullYear(),6,1).getTimezoneOffset(),u=p.getTimezoneOffset(),c=0|(i!=u&&_.getTimezoneOffset()==Math.min(u,i));h[n+32>>2]=c}function je(t){var n=ve(t)+1,_=ar(n);return _&&Me(t,H,_,n),_}function Zr(t,n,_){var o=new Date().getFullYear(),p=new Date(o,0,1),i=new Date(o,6,1),u=p.getTimezoneOffset(),c=i.getTimezoneOffset(),W=Math.max(u,c);function re(b_){var gr=b_.toTimeString().match(/\(([A-Za-z ]+)\)$/);return gr?gr[1]:"GMT"}G[t>>2]=60*W,h[n>>2]=+(u!=c);var d_=re(p),E_=re(i),ur=je(d_),cr=je(E_);c>2]=ur,G[_+4>>2]=cr):(G[_>>2]=cr,G[_+4>>2]=ur)}function Br(){k("")}function Wr(){return Date.now()}function Vr(t,n,_){Q.copyWithin(t,n,n+_)}function qr(){return 2147483648}function kr(t){try{return Pe.grow(t-Se.byteLength+65535>>>16),De(Pe.buffer),1}catch{}}function Jr(t){var n=Q.length;t>>>=0;var _=qr();if(t>_)return!1;let o=(u,c)=>u+(c-u%c)%c;for(var p=1;p<=4;p*=2){var i=n*(1+.2/p);if(i=Math.min(i,t+100663296),kr(Math.min(_,o(Math.max(t,i),65536))))return!0}return!1}var fe={};function Kr(){return ce||"./this.program"}function te(){if(!te.strings){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:Kr()};for(var n in fe)fe[n]===void 0?delete t[n]:t[n]=fe[n];var _=[];for(var n in t)_.push(n+"="+t[n]);te.strings=_}return te.strings}function $r(t,n,_){for(var o=0;o>0]=t.charCodeAt(o);_||(H[n>>0]=0)}function Qr(t,n){var _=0;return te().forEach(function(o,p){var i=n+_;G[t+4*p>>2]=i,$r(o,i),_+=o.length+1}),0}function e_(t,n){var _=te();G[t>>2]=_.length;var o=0;return _.forEach(function(p){o+=p.length+1}),G[n>>2]=o,0}function t_(t){return 52}function n_(t,n,_,o){return 52}function r_(t,n,_,o,p){return 70}var __=[null,[],[]];function o_(t,n){var _=__[t];n===0||n===10?((t===1?lr:q)(he(_,0)),_.length=0):_.push(n)}function p_(t,n,_,o){for(var p=0,i=0;i<_;i++){var u=G[n>>2],c=G[n+4>>2];n+=8;for(var W=0;W>2]=p,0}function i_(t,n,_){var o=_>0?_:ve(t)+1,p=new Array(o),i=Me(t,p,0,p.length);return n&&(p.length=i),p}var a_={c:Gr,p:Cr,f:Ir,d:jr,n:Ur,m:Lr,o:Yr,h:zr,i:Zr,k:Br,g:Wr,s:Vr,l:Jr,q:Qr,r:e_,a:t_,e:n_,j:r_,b:p_};Dr(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.u).apply(null,arguments)};var Ue=e._emscripten_bind_PeObject_getCode_0=function(){return(Ue=e._emscripten_bind_PeObject_getCode_0=e.asm.v).apply(null,arguments)},Le=e._emscripten_bind_PeObject_getName_1=function(){return(Le=e._emscripten_bind_PeObject_getName_1=e.asm.w).apply(null,arguments)},Ye=e._emscripten_bind_PeObject_getType_0=function(){return(Ye=e._emscripten_bind_PeObject_getType_0=e.asm.x).apply(null,arguments)},xe=e._emscripten_bind_PeCoordsys_getCode_0=function(){return(xe=e._emscripten_bind_PeCoordsys_getCode_0=e.asm.y).apply(null,arguments)},Fe=e._emscripten_bind_PeCoordsys_getName_1=function(){return(Fe=e._emscripten_bind_PeCoordsys_getName_1=e.asm.z).apply(null,arguments)},we=e._emscripten_bind_PeCoordsys_getType_0=function(){return(we=e._emscripten_bind_PeCoordsys_getType_0=e.asm.A).apply(null,arguments)},He=e._emscripten_bind_VoidPtr___destroy___0=function(){return(He=e._emscripten_bind_VoidPtr___destroy___0=e.asm.B).apply(null,arguments)},Xe=e._emscripten_bind_PeDatum_getSpheroid_0=function(){return(Xe=e._emscripten_bind_PeDatum_getSpheroid_0=e.asm.C).apply(null,arguments)},ze=e._emscripten_bind_PeDatum_getCode_0=function(){return(ze=e._emscripten_bind_PeDatum_getCode_0=e.asm.D).apply(null,arguments)},Ze=e._emscripten_bind_PeDatum_getName_1=function(){return(Ze=e._emscripten_bind_PeDatum_getName_1=e.asm.E).apply(null,arguments)},Be=e._emscripten_bind_PeDatum_getType_0=function(){return(Be=e._emscripten_bind_PeDatum_getType_0=e.asm.F).apply(null,arguments)},We=e._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=function(){return(We=e._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=e.asm.G).apply(null,arguments)},Ve=e._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=function(){return(Ve=e._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=e.asm.H).apply(null,arguments)},qe=e._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=function(){return(qe=e._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=e.asm.I).apply(null,arguments)},ke=e._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=function(){return(ke=e._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=e.asm.J).apply(null,arguments)},Je=e._emscripten_bind_PeDefs_get_PE_DD_MAX_0=function(){return(Je=e._emscripten_bind_PeDefs_get_PE_DD_MAX_0=e.asm.K).apply(null,arguments)},Ke=e._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=function(){return(Ke=e._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=e.asm.L).apply(null,arguments)},$e=e._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=function(){return($e=e._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=e.asm.M).apply(null,arguments)},Qe=e._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=function(){return(Qe=e._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=e.asm.N).apply(null,arguments)},et=e._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=function(){return(et=e._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=e.asm.O).apply(null,arguments)},tt=e._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=function(){return(tt=e._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=e.asm.P).apply(null,arguments)},nt=e._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=function(){return(nt=e._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=e.asm.Q).apply(null,arguments)},rt=e._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=function(){return(rt=e._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=e.asm.R).apply(null,arguments)},_t=e._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=function(){return(_t=e._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=e.asm.S).apply(null,arguments)},ot=e._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=function(){return(ot=e._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=e.asm.T).apply(null,arguments)},pt=e._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=function(){return(pt=e._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=e.asm.U).apply(null,arguments)},it=e._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=function(){return(it=e._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=e.asm.V).apply(null,arguments)},at=e._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=function(){return(at=e._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=e.asm.W).apply(null,arguments)},st=e._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=function(){return(st=e._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=e.asm.X).apply(null,arguments)},ut=e._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=function(){return(ut=e._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=e.asm.Y).apply(null,arguments)},ct=e._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=function(){return(ct=e._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=e.asm.Z).apply(null,arguments)},gt=e._emscripten_bind_PeDefs_get_PE_PARM_X0_0=function(){return(gt=e._emscripten_bind_PeDefs_get_PE_PARM_X0_0=e.asm._).apply(null,arguments)},Pt=e._emscripten_bind_PeDefs_get_PE_PARM_ND_0=function(){return(Pt=e._emscripten_bind_PeDefs_get_PE_PARM_ND_0=e.asm.$).apply(null,arguments)},yt=e._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=function(){return(yt=e._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=e.asm.aa).apply(null,arguments)},mt=e._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=function(){return(mt=e._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=e.asm.ba).apply(null,arguments)},ft=e._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=function(){return(ft=e._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=e.asm.ca).apply(null,arguments)},lt=e._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=function(){return(lt=e._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=e.asm.da).apply(null,arguments)},dt=e._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=function(){return(dt=e._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=e.asm.ea).apply(null,arguments)},Et=e._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=function(){return(Et=e._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=e.asm.fa).apply(null,arguments)},bt=e._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=function(){return(bt=e._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=e.asm.ga).apply(null,arguments)},Ot=e._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=function(){return(Ot=e._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=e.asm.ha).apply(null,arguments)},Tt=e._emscripten_bind_PeFactory_initialize_1=function(){return(Tt=e._emscripten_bind_PeFactory_initialize_1=e.asm.ia).apply(null,arguments)},St=e._emscripten_bind_PeFactory_factoryByType_2=function(){return(St=e._emscripten_bind_PeFactory_factoryByType_2=e.asm.ja).apply(null,arguments)},Nt=e._emscripten_bind_PeFactory_fromString_2=function(){return(Nt=e._emscripten_bind_PeFactory_fromString_2=e.asm.ka).apply(null,arguments)},ht=e._emscripten_bind_PeFactory_getCode_1=function(){return(ht=e._emscripten_bind_PeFactory_getCode_1=e.asm.la).apply(null,arguments)},Mt=e._emscripten_bind_PeGCSExtent_PeGCSExtent_6=function(){return(Mt=e._emscripten_bind_PeGCSExtent_PeGCSExtent_6=e.asm.ma).apply(null,arguments)},vt=e._emscripten_bind_PeGCSExtent_getLLon_0=function(){return(vt=e._emscripten_bind_PeGCSExtent_getLLon_0=e.asm.na).apply(null,arguments)},Dt=e._emscripten_bind_PeGCSExtent_getSLat_0=function(){return(Dt=e._emscripten_bind_PeGCSExtent_getSLat_0=e.asm.oa).apply(null,arguments)},Rt=e._emscripten_bind_PeGCSExtent_getRLon_0=function(){return(Rt=e._emscripten_bind_PeGCSExtent_getRLon_0=e.asm.pa).apply(null,arguments)},At=e._emscripten_bind_PeGCSExtent_getNLat_0=function(){return(At=e._emscripten_bind_PeGCSExtent_getNLat_0=e.asm.qa).apply(null,arguments)},Gt=e._emscripten_bind_PeGCSExtent___destroy___0=function(){return(Gt=e._emscripten_bind_PeGCSExtent___destroy___0=e.asm.ra).apply(null,arguments)},Ct=e._emscripten_bind_PeGeogcs_getDatum_0=function(){return(Ct=e._emscripten_bind_PeGeogcs_getDatum_0=e.asm.sa).apply(null,arguments)},It=e._emscripten_bind_PeGeogcs_getPrimem_0=function(){return(It=e._emscripten_bind_PeGeogcs_getPrimem_0=e.asm.ta).apply(null,arguments)},jt=e._emscripten_bind_PeGeogcs_getUnit_0=function(){return(jt=e._emscripten_bind_PeGeogcs_getUnit_0=e.asm.ua).apply(null,arguments)},Ut=e._emscripten_bind_PeGeogcs_getCode_0=function(){return(Ut=e._emscripten_bind_PeGeogcs_getCode_0=e.asm.va).apply(null,arguments)},Lt=e._emscripten_bind_PeGeogcs_getName_1=function(){return(Lt=e._emscripten_bind_PeGeogcs_getName_1=e.asm.wa).apply(null,arguments)},Yt=e._emscripten_bind_PeGeogcs_getType_0=function(){return(Yt=e._emscripten_bind_PeGeogcs_getType_0=e.asm.xa).apply(null,arguments)},xt=e._emscripten_bind_PeGeogtran_isEqual_1=function(){return(xt=e._emscripten_bind_PeGeogtran_isEqual_1=e.asm.ya).apply(null,arguments)},Ft=e._emscripten_bind_PeGeogtran_getGeogcs1_0=function(){return(Ft=e._emscripten_bind_PeGeogtran_getGeogcs1_0=e.asm.za).apply(null,arguments)},wt=e._emscripten_bind_PeGeogtran_getGeogcs2_0=function(){return(wt=e._emscripten_bind_PeGeogtran_getGeogcs2_0=e.asm.Aa).apply(null,arguments)},Ht=e._emscripten_bind_PeGeogtran_getParameters_0=function(){return(Ht=e._emscripten_bind_PeGeogtran_getParameters_0=e.asm.Ba).apply(null,arguments)},Xt=e._emscripten_bind_PeGeogtran_loadConstants_0=function(){return(Xt=e._emscripten_bind_PeGeogtran_loadConstants_0=e.asm.Ca).apply(null,arguments)},zt=e._emscripten_bind_PeGeogtran_getCode_0=function(){return(zt=e._emscripten_bind_PeGeogtran_getCode_0=e.asm.Da).apply(null,arguments)},Zt=e._emscripten_bind_PeGeogtran_getName_1=function(){return(Zt=e._emscripten_bind_PeGeogtran_getName_1=e.asm.Ea).apply(null,arguments)},Bt=e._emscripten_bind_PeGeogtran_getType_0=function(){return(Bt=e._emscripten_bind_PeGeogtran_getType_0=e.asm.Fa).apply(null,arguments)},Wt=e._emscripten_bind_PeGTlistExtended_getGTlist_6=function(){return(Wt=e._emscripten_bind_PeGTlistExtended_getGTlist_6=e.asm.Ga).apply(null,arguments)},Vt=e._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=function(){return(Vt=e._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=e.asm.Ha).apply(null,arguments)},qt=e._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=function(){return(qt=e._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=e.asm.Ia).apply(null,arguments)},kt=e._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=function(){return(kt=e._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=e.asm.Ja).apply(null,arguments)},Jt=e._emscripten_bind_PeGTlistExtendedEntry_Delete_1=function(){return(Jt=e._emscripten_bind_PeGTlistExtendedEntry_Delete_1=e.asm.Ka).apply(null,arguments)},Kt=e._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=function(){return(Kt=e._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=e.asm.La).apply(null,arguments)},$t=e._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=function(){return($t=e._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=e.asm.Ma).apply(null,arguments)},Qt=e._emscripten_bind_PeHorizon_getNump_0=function(){return(Qt=e._emscripten_bind_PeHorizon_getNump_0=e.asm.Na).apply(null,arguments)},en=e._emscripten_bind_PeHorizon_getKind_0=function(){return(en=e._emscripten_bind_PeHorizon_getKind_0=e.asm.Oa).apply(null,arguments)},tn=e._emscripten_bind_PeHorizon_getInclusive_0=function(){return(tn=e._emscripten_bind_PeHorizon_getInclusive_0=e.asm.Pa).apply(null,arguments)},nn=e._emscripten_bind_PeHorizon_getSize_0=function(){return(nn=e._emscripten_bind_PeHorizon_getSize_0=e.asm.Qa).apply(null,arguments)},rn=e._emscripten_bind_PeHorizon_getCoord_0=function(){return(rn=e._emscripten_bind_PeHorizon_getCoord_0=e.asm.Ra).apply(null,arguments)},_n=e._emscripten_bind_PeInteger_PeInteger_1=function(){return(_n=e._emscripten_bind_PeInteger_PeInteger_1=e.asm.Sa).apply(null,arguments)},on=e._emscripten_bind_PeInteger_get_val_0=function(){return(on=e._emscripten_bind_PeInteger_get_val_0=e.asm.Ta).apply(null,arguments)},pn=e._emscripten_bind_PeInteger_set_val_1=function(){return(pn=e._emscripten_bind_PeInteger_set_val_1=e.asm.Ua).apply(null,arguments)},an=e._emscripten_bind_PeInteger___destroy___0=function(){return(an=e._emscripten_bind_PeInteger___destroy___0=e.asm.Va).apply(null,arguments)},sn=e._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=function(){return(sn=e._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=e.asm.Wa).apply(null,arguments)},un=e._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=function(){return(un=e._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=e.asm.Xa).apply(null,arguments)},cn=e._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=function(){return(cn=e._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=e.asm.Ya).apply(null,arguments)},gn=e._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=function(){return(gn=e._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=e.asm.Za).apply(null,arguments)},Pn=e._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=function(){return(Pn=e._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=e.asm._a).apply(null,arguments)},yn=e._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=function(){return(yn=e._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=e.asm.$a).apply(null,arguments)},mn=e._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=function(){return(mn=e._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=e.asm.ab).apply(null,arguments)},fn=e._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=function(){return(fn=e._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=e.asm.bb).apply(null,arguments)},ln=e._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=function(){return(ln=e._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=e.asm.cb).apply(null,arguments)},dn=e._emscripten_bind_PeParameter_getValue_0=function(){return(dn=e._emscripten_bind_PeParameter_getValue_0=e.asm.db).apply(null,arguments)},En=e._emscripten_bind_PeParameter_getCode_0=function(){return(En=e._emscripten_bind_PeParameter_getCode_0=e.asm.eb).apply(null,arguments)},bn=e._emscripten_bind_PeParameter_getName_1=function(){return(bn=e._emscripten_bind_PeParameter_getName_1=e.asm.fb).apply(null,arguments)},On=e._emscripten_bind_PeParameter_getType_0=function(){return(On=e._emscripten_bind_PeParameter_getType_0=e.asm.gb).apply(null,arguments)},Tn=e._emscripten_bind_PePCSInfo_getCentralMeridian_0=function(){return(Tn=e._emscripten_bind_PePCSInfo_getCentralMeridian_0=e.asm.hb).apply(null,arguments)},Sn=e._emscripten_bind_PePCSInfo_getDomainMinx_0=function(){return(Sn=e._emscripten_bind_PePCSInfo_getDomainMinx_0=e.asm.ib).apply(null,arguments)},Nn=e._emscripten_bind_PePCSInfo_getDomainMiny_0=function(){return(Nn=e._emscripten_bind_PePCSInfo_getDomainMiny_0=e.asm.jb).apply(null,arguments)},hn=e._emscripten_bind_PePCSInfo_getDomainMaxx_0=function(){return(hn=e._emscripten_bind_PePCSInfo_getDomainMaxx_0=e.asm.kb).apply(null,arguments)},Mn=e._emscripten_bind_PePCSInfo_getDomainMaxy_0=function(){return(Mn=e._emscripten_bind_PePCSInfo_getDomainMaxy_0=e.asm.lb).apply(null,arguments)},vn=e._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=function(){return(vn=e._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=e.asm.mb).apply(null,arguments)},Dn=e._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=function(){return(Dn=e._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=e.asm.nb).apply(null,arguments)},Rn=e._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=function(){return(Rn=e._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=e.asm.ob).apply(null,arguments)},An=e._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=function(){return(An=e._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=e.asm.pb).apply(null,arguments)},Gn=e._emscripten_bind_PePCSInfo_isDensificationNeeded_0=function(){return(Gn=e._emscripten_bind_PePCSInfo_isDensificationNeeded_0=e.asm.qb).apply(null,arguments)},Cn=e._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=function(){return(Cn=e._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=e.asm.rb).apply(null,arguments)},In=e._emscripten_bind_PePCSInfo_isPannableRectangle_0=function(){return(In=e._emscripten_bind_PePCSInfo_isPannableRectangle_0=e.asm.sb).apply(null,arguments)},jn=e._emscripten_bind_PePCSInfo_generate_2=function(){return(jn=e._emscripten_bind_PePCSInfo_generate_2=e.asm.tb).apply(null,arguments)},Un=e._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=function(){return(Un=e._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=e.asm.ub).apply(null,arguments)},Ln=e._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=function(){return(Ln=e._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=e.asm.vb).apply(null,arguments)},Yn=e._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=function(){return(Yn=e._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=e.asm.wb).apply(null,arguments)},xn=e._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=function(){return(xn=e._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=e.asm.xb).apply(null,arguments)},Fn=e._emscripten_bind_PePrimem_getLongitude_0=function(){return(Fn=e._emscripten_bind_PePrimem_getLongitude_0=e.asm.yb).apply(null,arguments)},wn=e._emscripten_bind_PePrimem_getCode_0=function(){return(wn=e._emscripten_bind_PePrimem_getCode_0=e.asm.zb).apply(null,arguments)},Hn=e._emscripten_bind_PePrimem_getName_1=function(){return(Hn=e._emscripten_bind_PePrimem_getName_1=e.asm.Ab).apply(null,arguments)},Xn=e._emscripten_bind_PePrimem_getType_0=function(){return(Xn=e._emscripten_bind_PePrimem_getType_0=e.asm.Bb).apply(null,arguments)},zn=e._emscripten_bind_PeProjcs_getGeogcs_0=function(){return(zn=e._emscripten_bind_PeProjcs_getGeogcs_0=e.asm.Cb).apply(null,arguments)},Zn=e._emscripten_bind_PeProjcs_getParameters_0=function(){return(Zn=e._emscripten_bind_PeProjcs_getParameters_0=e.asm.Db).apply(null,arguments)},Bn=e._emscripten_bind_PeProjcs_getUnit_0=function(){return(Bn=e._emscripten_bind_PeProjcs_getUnit_0=e.asm.Eb).apply(null,arguments)},Wn=e._emscripten_bind_PeProjcs_loadConstants_0=function(){return(Wn=e._emscripten_bind_PeProjcs_loadConstants_0=e.asm.Fb).apply(null,arguments)},Vn=e._emscripten_bind_PeProjcs_horizonGcsGenerate_0=function(){return(Vn=e._emscripten_bind_PeProjcs_horizonGcsGenerate_0=e.asm.Gb).apply(null,arguments)},qn=e._emscripten_bind_PeProjcs_horizonPcsGenerate_0=function(){return(qn=e._emscripten_bind_PeProjcs_horizonPcsGenerate_0=e.asm.Hb).apply(null,arguments)},kn=e._emscripten_bind_PeProjcs_getCode_0=function(){return(kn=e._emscripten_bind_PeProjcs_getCode_0=e.asm.Ib).apply(null,arguments)},Jn=e._emscripten_bind_PeProjcs_getName_1=function(){return(Jn=e._emscripten_bind_PeProjcs_getName_1=e.asm.Jb).apply(null,arguments)},Kn=e._emscripten_bind_PeProjcs_getType_0=function(){return(Kn=e._emscripten_bind_PeProjcs_getType_0=e.asm.Kb).apply(null,arguments)},$n=e._emscripten_bind_PeSpheroid_getAxis_0=function(){return($n=e._emscripten_bind_PeSpheroid_getAxis_0=e.asm.Lb).apply(null,arguments)},Qn=e._emscripten_bind_PeSpheroid_getFlattening_0=function(){return(Qn=e._emscripten_bind_PeSpheroid_getFlattening_0=e.asm.Mb).apply(null,arguments)},er=e._emscripten_bind_PeSpheroid_getCode_0=function(){return(er=e._emscripten_bind_PeSpheroid_getCode_0=e.asm.Nb).apply(null,arguments)},tr=e._emscripten_bind_PeSpheroid_getName_1=function(){return(tr=e._emscripten_bind_PeSpheroid_getName_1=e.asm.Ob).apply(null,arguments)},nr=e._emscripten_bind_PeSpheroid_getType_0=function(){return(nr=e._emscripten_bind_PeSpheroid_getType_0=e.asm.Pb).apply(null,arguments)},rr=e._emscripten_bind_PeUnit_getUnitFactor_0=function(){return(rr=e._emscripten_bind_PeUnit_getUnitFactor_0=e.asm.Qb).apply(null,arguments)},_r=e._emscripten_bind_PeUnit_getCode_0=function(){return(_r=e._emscripten_bind_PeUnit_getCode_0=e.asm.Rb).apply(null,arguments)},or=e._emscripten_bind_PeUnit_getName_1=function(){return(or=e._emscripten_bind_PeUnit_getName_1=e.asm.Sb).apply(null,arguments)},pr=e._emscripten_bind_PeUnit_getType_0=function(){return(pr=e._emscripten_bind_PeUnit_getType_0=e.asm.Tb).apply(null,arguments)},ir=e._emscripten_bind_PeVersion_version_string_0=function(){return(ir=e._emscripten_bind_PeVersion_version_string_0=e.asm.Ub).apply(null,arguments)};e._pe_getPeGTlistExtendedEntrySize=function(){return(e._pe_getPeGTlistExtendedEntrySize=e.asm.Vb).apply(null,arguments)},e._pe_getPeGTlistExtendedGTsSize=function(){return(e._pe_getPeGTlistExtendedGTsSize=e.asm.Wb).apply(null,arguments)},e._pe_getPeHorizonSize=function(){return(e._pe_getPeHorizonSize=e.asm.Xb).apply(null,arguments)},e._pe_geog_to_geog=function(){return(e._pe_geog_to_geog=e.asm.Zb).apply(null,arguments)},e._pe_geog_to_proj=function(){return(e._pe_geog_to_proj=e.asm._b).apply(null,arguments)},e._pe_geog_to_dd=function(){return(e._pe_geog_to_dd=e.asm.$b).apply(null,arguments)},e._pe_dd_to_geog=function(){return(e._pe_dd_to_geog=e.asm.ac).apply(null,arguments)},e._pe_geog_to_ddm=function(){return(e._pe_geog_to_ddm=e.asm.bc).apply(null,arguments)},e._pe_ddm_to_geog=function(){return(e._pe_ddm_to_geog=e.asm.cc).apply(null,arguments)},e._pe_geog_to_dms=function(){return(e._pe_geog_to_dms=e.asm.dc).apply(null,arguments)},e._pe_dms_to_geog=function(){return(e._pe_dms_to_geog=e.asm.ec).apply(null,arguments)},e._pe_geog_to_mgrs_extended=function(){return(e._pe_geog_to_mgrs_extended=e.asm.fc).apply(null,arguments)},e._pe_mgrs_to_geog_extended=function(){return(e._pe_mgrs_to_geog_extended=e.asm.gc).apply(null,arguments)},e._pe_geog_to_usng=function(){return(e._pe_geog_to_usng=e.asm.hc).apply(null,arguments)},e._pe_usng_to_geog=function(){return(e._pe_usng_to_geog=e.asm.ic).apply(null,arguments)},e._pe_geog_to_utm=function(){return(e._pe_geog_to_utm=e.asm.jc).apply(null,arguments)},e._pe_utm_to_geog=function(){return(e._pe_utm_to_geog=e.asm.kc).apply(null,arguments)},e._pe_object_to_string_ext=function(){return(e._pe_object_to_string_ext=e.asm.lc).apply(null,arguments)},e._pe_proj_to_geog_center=function(){return(e._pe_proj_to_geog_center=e.asm.mc).apply(null,arguments)};var se,ar=e._malloc=function(){return(ar=e._malloc=e.asm.nc).apply(null,arguments)};function sr(t){function n(){se||(se=!0,e.calledRun=!0,Te||(Er(),J(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),br()))}V>0||(dr(),V>0||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),n()},1)):n()))}if(e._free=function(){return(e._free=e.asm.oc).apply(null,arguments)},e.___start_em_js=1970140,e.___stop_em_js=1970238,e.UTF8ToString=U,e.getValue=Ar,ee=function t(){se||sr(),se||(ee=t)},e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();function y(){}function ne(t){return(t||y).__cache__}function E(t,n){var _=ne(n),o=_[t];return o||((o=Object.create((n||y).prototype)).ptr=t,_[t]=o)}function s_(t,n){return E(t.ptr,n)}function u_(t){if(!t.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";t.__destroy__(),delete ne(t.__class__)[t.ptr]}function c_(t,n){return t.ptr===n.ptr}function g_(t){return t.ptr}function P_(t){return t.__class__}sr(),y.prototype=Object.create(y.prototype),y.prototype.constructor=y,y.prototype.__class__=y,y.__cache__={},e.WrapperObject=y,e.getCache=ne,e.wrapPointer=E,e.castObject=s_,e.NULL=E(0),e.destroy=u_,e.compare=c_,e.getPointer=g_,e.getClass=P_;var s={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(s.needed){for(var t=0;t=s.size?(ye(p>0),s.needed+=p,_=e._malloc(p),s.temps.push(_)):(_=s.buffer+s.pos,s.pos+=p),_},copy:function(t,n,_){switch(_>>>=0,n.BYTES_PER_ELEMENT){case 2:_>>>=1;break;case 4:_>>>=2;break;case 8:_>>>=3}for(var o=0;o{const s=T(e,t,n);for(const a of o){const i=N(t,a,n);for(const r in s)i[r]=s[r]}}}function T(e,o,t){if((e==null?void 0:e.type)==="resource")return V(e,o,t);switch((e==null?void 0:e.type)??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:n,write:s}=E;return{read:n,write:s}}}}function V(e,o,t){const n=P(o,t);return{type:String,read:(s,a,i)=>{const r=x(s,a,i);return n.type===String?r:typeof n.type=="function"?new n.type({url:r}):void 0},write:{writer(s,a,i,r){if(!r||!r.resources)return typeof s=="string"?void(a[i]=f(s,r)):void(a[i]=s.write({},r));const l=Y(s),p=f(l,{...r,verifyItemRelativeUrls:r&&r.verifyItemRelativeUrls?{writtenUrls:r.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},O.NO),c=n.type!==String&&(!J(this)||r&&r.origin&&this.originIdOf(t)>R(r.origin)),u={object:this,propertyName:t,value:s,targetUrl:p,dest:a,targetPropertyName:i,context:r,params:e};r&&r.portalItem&&p&&!_(p)?c?D(u):K(u):r&&r.portalItem&&(p==null||b(p)!=null||y(p)||c)?g(u):a[i]=p}}}}function g(e){const{targetUrl:o,params:t,value:n,context:s,dest:a,targetPropertyName:i}=e;if(!s.portalItem)return;const r=S(o),l=(r==null?void 0:r.filename)??j(),p=(t==null?void 0:t.prefix)??(r==null?void 0:r.prefix),c=v(n,o,s),u=F(p,l),w=`${u}.${d(c)}`,m=s.portalItem.resourceFromPath(w);y(o)&&s.resources&&s.resources.pendingOperations.push(L(o).then(I=>{m.path=`${u}.${d(I)}`,a[i]=m.itemRelativeUrl}).catch(()=>{}));const U=(t==null?void 0:t.compress)??!1;s.resources&&h({...e,resource:m,content:c,compress:U,updates:s.resources.toAdd}),a[i]=m.itemRelativeUrl}function D(e){const{context:o,targetUrl:t,params:n,value:s,dest:a,targetPropertyName:i}=e;if(!o.portalItem)return;const r=o.portalItem.resourceFromPath(t),l=v(s,t,o),p=d(l),c=A(r.path),u=(n==null?void 0:n.compress)??!1;p===c?(o.resources&&h({...e,resource:r,content:l,compress:u,updates:o.resources.toUpdate}),a[i]=t):g(e)}function K({context:e,targetUrl:o,dest:t,targetPropertyName:n}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(o),compress:!1}),t[n]=o)}function h({object:e,propertyName:o,updates:t,resource:n,content:s,compress:a}){t.push({resource:n,content:s,compress:a,finish:i=>{Z(e,o,i)}})}function v(e,o,t){return typeof e=="string"?{url:o}:new Blob([JSON.stringify(e.toJSON(t))],{type:"application/json"})}async function L(e){const o=(await B(()=>import("./index-080e108a.js").then(n=>n.uN),["assets/index-080e108a.js","assets/index-a8e73b5e.css"])).default,{data:t}=await o(e,{responseType:"blob"});return t}function Y(e){return e==null?null:typeof e=="string"?e:e.url}function Z(e,o,t){typeof e[o]=="string"?e[o]=t.url:e[o].url=t.url}export{C as g}; diff --git a/assets/pieChart-bf6791d4.js b/assets/pieChart-bf6791d4.js new file mode 100644 index 0000000..14676a9 --- /dev/null +++ b/assets/pieChart-bf6791d4.js @@ -0,0 +1 @@ +import{fj as E}from"./index-080e108a.js";import{U as Te,D as Ne,B as Se,V as Ie,k as M}from"./Tick-c7ca49b9.js";import{q as Le,Q as Ce,R as je,G as v,d as Re,a as ae,b as Me,m as F,W as ge,M as me,K as ye,c as A,h as H,o as O,i as ve,e as Oe,J as be,l as re,N as Be,z as we,t as Fe,U as He,f as Xe}from"./Popup-db207f4c.js";import{s as Ye}from"./ColorSet-bb3b0c3c.js";import"./unitFormatUtils-b70a7bff.js";import"./AttachmentInfo-cb670dd0.js";import"./AttachmentQuery-972bbd60.js";import"./widget-78e8b6fe.js";import"./jsonUtils-f73b3833.js";import"./UniqueValueRenderer-fef4204d.js";import"./diffUtils-590c9088.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./Query-1c961d4c.js";import"./executeQueryJSON-7c41ada5.js";import"./query-93c6e211.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./FeatureSet-111cb247.js";import"./RelationshipQuery-39c07195.js";import"./TopFeaturesQuery-e44d05be.js";import"./FeatureLayer-5c6d2c3b.js";import"./MultiOriginJSONSupport-e4912ffd.js";import"./sql-734ecbc5.js";import"./FeatureLayerBase-7c7dfccb.js";import"./commonProperties-30089b06.js";import"./featureLayerUtils-6cf06f83.js";import"./serviceCapabilitiesUtils-959e798a.js";import"./editsZScale-1b5a53a6.js";import"./APIKeyMixin-878a7aa7.js";import"./ArcGISService-83287338.js";import"./CustomParametersMixin-231c4be8.js";import"./EditBusLayer-d71787e9.js";import"./FeatureEffectLayer-4160946c.js";import"./FeatureEffect-86735d98.js";import"./FeatureFilter-00f4be05.js";import"./FeatureReductionLayer-4262cf54.js";import"./LabelClass-2d53c485.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./OperationalLayer-0e8f8b28.js";import"./OrderedLayer-68067459.js";import"./PortalLayer-310c2800.js";import"./portalItemUtils-792a27e1.js";import"./TemporalLayer-f17c9161.js";import"./FeatureTemplate-2a7e96c1.js";import"./FeatureType-db96032c.js";import"./fieldProperties-62c55499.js";import"./labelingInfo-144f3d9f.js";import"./versionUtils-f17daa93.js";import"./styleUtils-25825fd6.js";import"./popupUtils-82ea8abb.js";class te extends Le{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeRadialText("",this.textStyle)})}_afterNew(){super._afterNew()}_beforeChanged(){super._beforeChanged(),this._display.clear(),this.isDirty("textType")&&(this._display.textType=this.get("textType"),this.markDirtyBounds()),this.isDirty("radius")&&(this._display.radius=this.get("radius"),this.markDirtyBounds()),this.isDirty("startAngle")&&(this._display.startAngle=(this.get("startAngle",0)+90)*ve,this.markDirtyBounds()),this.isDirty("inside")&&(this._display.inside=this.get("inside"),this.markDirtyBounds()),this.isDirty("orientation")&&(this._display.orientation=this.get("orientation"),this.markDirtyBounds()),this.isDirty("kerning")&&(this._display.kerning=this.get("kerning"),this.markDirtyBounds())}}Object.defineProperty(te,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialText"}),Object.defineProperty(te,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Le.classNames.concat([te.className])});class ie extends Ce{constructor(){super(...arguments),Object.defineProperty(this,"_flipped",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._textKeys.push("textType","kerning"),super._afterNew()}_makeText(){this._text=this.children.push(te.new(this._root,{}))}baseRadius(){const t=this.getPrivate("radius",0),e=this.getPrivate("innerRadius",0),i=this.get("baseRadius",0);return e+F(i,t-e)}radius(){const t=this.get("inside",!1);return this.baseRadius()+this.get("radius",0)*(t?-1:1)}_updateChildren(){if(super._updateChildren(),this.isDirty("baseRadius")||this.isPrivateDirty("radius")||this.isPrivateDirty("innerRadius")||this.isDirty("labelAngle")||this.isDirty("radius")||this.isDirty("inside")||this.isDirty("orientation")||this.isDirty("textType")){const t=this.get("textType","adjusted"),e=this.get("inside",!1),i=this.get("orientation");let s=Oe(this.get("labelAngle",0));this._text.set("startAngle",this.get("labelAngle",0)),this._text.set("inside",e);const r=O(s),l=H(s);let a=this.baseRadius(),m=this.radius();if(this._display.angle=0,t=="circular")this.setAll({paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}),this._text.set("orientation",i),this._text.set("radius",m);else{a==0&&(s=0,m=0);let o=m*l,n=m*r;t=="radial"?(this.setRaw("x",o),this.setRaw("y",n),s<90||s>270||i!="auto"?(this._display.angle=s,this._flipped=!1):(this._display.angle=s+180,this._flipped=!0),this._dirty.rotation=!1):t=="adjusted"?(this.setRaw("centerX",v),this.setRaw("centerY",v),this.setRaw("x",o),this.setRaw("y",n)):t=="regular"&&(this.setRaw("x",o),this.setRaw("y",n))}this.markDirtyPosition(),this.markDirtyBounds()}}_updatePosition(){const t=this.get("textType","regular"),e=this.get("inside",!1);let i=0,s=0,r=this.get("labelAngle",0),l=this.localBounds(),a=l.right-l.left,m=l.bottom-l.top;if(t=="radial"){if(this._flipped){let o=this.get("centerX");o instanceof ae&&(a*=1-2*o.value),i=a*H(r),s=a*O(r)}}else e||t!="adjusted"||(i=a/2*H(r),s=m/2*O(r));this.setRaw("dx",i),this.setRaw("dy",s),super._updatePosition()}get text(){return this._text}}Object.defineProperty(ie,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialLabel"}),Object.defineProperty(ie,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ce.classNames.concat([ie.className])});const Ae=Math.abs,_=Math.atan2,B=Math.cos,Ve=Math.max,fe=Math.min,C=Math.sin,U=Math.sqrt,x=1e-12,J=Math.PI,ne=J/2,ze=2*J;function We(d){return d>1?0:d<-1?J:Math.acos(d)}function Pe(d){return d>=1?ne:d<=-1?-ne:Math.asin(d)}function Ue(d){return d.innerRadius}function Ke(d){return d.outerRadius}function qe(d){return d.startAngle}function Je(d){return d.endAngle}function Qe(d){return d&&d.padAngle}function Ge(d,t,e,i,s,r,l,a){var m=e-d,o=i-t,n=l-s,p=a-r,h=p*m-n*o;if(!(h*hk*k+V*V&&(S=X,I=Y),{cx:S,cy:I,x01:-n,y01:-p,x11:S*(s/T-1),y11:I*(s/T-1)}}function $e(){var d=Ue,t=Ke,e=M(0),i=null,s=qe,r=Je,l=Qe,a=null,m=Ie(o);function o(){var n,p,h=+d.apply(this,arguments),c=+t.apply(this,arguments),b=s.apply(this,arguments)-ne,f=r.apply(this,arguments)-ne,P=Ae(f-b),y=f>b;if(a||(a=n=m()),cx)if(P>ze-x)a.moveTo(c*B(b),c*C(b)),a.arc(0,0,c,b,f,!y),h>x&&(a.moveTo(h*B(f),h*C(f)),a.arc(0,0,h,f,b,y));else{var u,g,R=b,T=f,w=b,N=f,S=P,I=P,X=l.apply(this,arguments)/2,Y=X>x&&(i?+i.apply(this,arguments):U(h*h+c*c)),L=fe(Ae(c-h)/2,+e.apply(this,arguments)),D=L,k=L;if(Y>x){var V=Pe(Y/h*C(X)),le=Pe(Y/c*C(X));(S-=2*V)>x?(w+=V*=y?1:-1,N-=V):(S=0,w=N=(b+f)/2),(I-=2*le)>x?(R+=le*=y?1:-1,T-=le):(I=0,R=T=(b+f)/2)}var z=c*B(R),W=c*C(R),Q=h*B(N),G=h*C(N);if(L>x){var j,$=c*B(T),Z=c*C(T),oe=h*B(w),ue=h*C(w);if(Px?k>x?(u=ee(oe,ue,z,W,c,k,y),g=ee($,Z,Q,G,c,k,y),a.moveTo(u.cx+u.x01,u.cy+u.y01),kx&&S>x?D>x?(u=ee(Q,G,$,Z,h,-D,y),g=ee(z,W,oe,ue,h,-D,y),a.lineTo(u.cx+u.x01,u.cy+u.y01),D=360&&l==0&&(i=0,s=0),{x:i,y:s}}_beforeChanged(){super._beforeChanged(),(this.isDirty("radius")||this.isDirty("arc")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("dRadius")||this.isDirty("dInnerRadius")||this.isDirty("cornerRadius"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){let t=this.get("startAngle",0),e=this.get("arc",0);const i=this._generator;e<0&&(t+=e,e*=-1),e>.1&&i.cornerRadius(this.get("cornerRadius",0)),i.context(this._display);let s=this.get("radius",0),r=this.get("innerRadius",0);s+=this.get("dRadius",0),r+=this.get("dInnerRadius",0),r<0&&(r=s+r),i({innerRadius:r,outerRadius:s,startAngle:(t+90)*ve,endAngle:(t+e+90)*ve});let l=t+e/2;this.ix=H(l),this.iy=O(l)}if(this.isDirty("shiftRadius")){const t=this.get("shiftRadius",0);this.setRaw("dx",this.ix*t),this.setRaw("dy",this.iy*t),this.markDirtyPosition()}}}Object.defineProperty(se,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Slice"}),Object.defineProperty(se,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:je.classNames.concat([se.className])});class Ze extends Fe{setupDefaultRules(){super.setupDefaultRules();const t=this._root.interfaceColors,e=this.rule.bind(this);e("PercentSeries").setAll({legendLabelText:"{category}",legendValueText:"{valuePercentTotal.formatNumber('0.00p')}",colors:Ye.new(this._root,{}),width:we,height:we}),e("PieChart").setAll({radius:He(80),startAngle:-90,endAngle:270}),e("PieSeries").setAll({alignLabels:!0,startAngle:-90,endAngle:270}),e("PieSeries").states.create("hidden",{endAngle:-90,opacity:0}),e("Slice",["pie"]).setAll({position:"absolute",isMeasured:!1,x:0,y:0,toggleKey:"active",tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}",strokeWidth:1,strokeOpacity:1,role:"figure",lineJoin:"round"}),e("Slice",["pie"]).states.create("active",{shiftRadius:20,scale:1}),e("Slice",["pie"]).states.create("hoverActive",{scale:1.04}),e("Slice",["pie"]).states.create("hover",{scale:1.04}),e("RadialLabel",["pie"]).setAll({textType:"aligned",radius:10,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",paddingTop:5,paddingBottom:5,populateText:!0}),e("Tick",["pie"]).setAll({location:1}),e("SlicedChart").setAll({paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10}),e("FunnelSeries").setAll({startLocation:0,endLocation:1,orientation:"vertical",alignLabels:!0,sequencedInterpolation:!0}),e("FunnelSlice").setAll({interactive:!0,expandDistance:0}),e("FunnelSlice").states.create("hover",{expandDistance:.15}),e("Label",["funnel"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["funnel","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["funnel","vertical"]).setAll({centerY:v,centerX:0}),e("Tick",["funnel"]).setAll({location:1}),e("FunnelSlice",["funnel","link"]).setAll({fillOpacity:.5,strokeOpacity:0,expandDistance:-.1}),e("FunnelSlice",["funnel","link","vertical"]).setAll({height:10}),e("FunnelSlice",["funnel","link","horizontal"]).setAll({width:10}),e("PyramidSeries").setAll({valueIs:"area"}),e("FunnelSlice",["pyramid","link"]).setAll({fillOpacity:.5}),e("FunnelSlice",["pyramid","link","vertical"]).setAll({height:0}),e("FunnelSlice",["pyramid","link","horizontal"]).setAll({width:0}),e("FunnelSlice",["pyramid"]).setAll({interactive:!0,expandDistance:0}),e("FunnelSlice",["pyramid"]).states.create("hover",{expandDistance:.15}),e("Label",["pyramid"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["pyramid","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["pyramid","vertical"]).setAll({centerY:v,centerX:0}),e("Tick",["pyramid"]).setAll({location:1}),e("FunnelSlice",["pictorial"]).setAll({interactive:!0,tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}"}),e("Label",["pictorial"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["pictorial","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["pictorial","vertical"]).setAll({centerY:v,centerX:0}),e("FunnelSlice",["pictorial","link"]).setAll({fillOpacity:.5,width:0,height:0}),e("Tick",["pictorial"]).setAll({location:.5});{const i=e("Graphics",["pictorial","background"]);i.setAll({fillOpacity:.2}),Xe(i,"fill",t,"alternativeBackground")}}}class K extends Te{_afterNew(){this._defaultThemes.push(Ze.new(this._root)),super._afterNew(),this.chartContainer.children.push(this.seriesContainer),this.seriesContainer.children.push(this.bulletsContainer)}_processSeries(t){super._processSeries(t),this.seriesContainer.children.moveValue(this.bulletsContainer,this.seriesContainer.children.length-1)}}Object.defineProperty(K,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentChart"}),Object.defineProperty(K,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Te.classNames.concat([K.className])});class q extends Ne{constructor(){super(...arguments),Object.defineProperty(this,"slicesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(be.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"labelsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(be.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"ticksContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(be.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"_lLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_rLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_hLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:this._makeSlices()}),Object.defineProperty(this,"labels",{enumerable:!0,configurable:!0,writable:!0,value:this._makeLabels()}),Object.defineProperty(this,"ticks",{enumerable:!0,configurable:!0,writable:!0,value:this._makeTicks()})}makeSlice(t){const e=this.slicesContainer.children.push(this.slices.make());return e.on("fill",()=>{this.updateLegendMarker(t)}),e.on("stroke",()=>{this.updateLegendMarker(t)}),e._setDataItem(t),t.set("slice",e),this.slices.push(e),e}makeLabel(t){const e=this.labelsContainer.children.push(this.labels.make());return e._setDataItem(t),t.set("label",e),this.labels.push(e),e}_shouldMakeBullet(t){return t.get("value")!=null}makeTick(t){const e=this.ticksContainer.children.push(this.ticks.make());return e._setDataItem(t),t.set("tick",e),this.ticks.push(e),e}_afterNew(){this.fields.push("category","fill"),super._afterNew()}_onDataClear(){const t=this.get("colors");t&&t.reset()}_prepareChildren(){if(super._prepareChildren(),this._lLabels=[],this._rLabels=[],this._hLabels=[],this._valuesDirty){let t=0,e=0,i=0,s=1/0,r=0;A(this._dataItems,l=>{let a=l.get("valueWorking",0);t+=a,e+=Math.abs(a)}),A(this._dataItems,l=>{let a=l.get("valueWorking",0);a>i&&(i=a),asuper.show}});return E(this,void 0,void 0,function*(){let i=[];i.push(e.show.call(this,t)),i.push(this._sequencedShowHide(!0,t)),yield Promise.all(i)})}hide(t){const e=Object.create(null,{hide:{get:()=>super.hide}});return E(this,void 0,void 0,function*(){let i=[];i.push(e.hide.call(this,t)),i.push(this._sequencedShowHide(!1,t)),yield Promise.all(i)})}_updateChildren(){super._updateChildren(),this._valuesDirty&&A(this._dataItems,t=>{t.get("label").text.markDirtyText()}),(this.isDirty("legendLabelText")||this.isDirty("legendValueText"))&&A(this._dataItems,t=>{this.updateLegendValue(t)}),this._arrange()}_arrange(){this._arrangeDown(this._lLabels),this._arrangeUp(this._lLabels),this._arrangeDown(this._rLabels),this._arrangeUp(this._rLabels),this._arrangeLeft(this._hLabels),this._arrangeRight(this._hLabels),A(this.dataItems,t=>{this._updateTick(t)})}_afterChanged(){super._afterChanged(),this._arrange()}processDataItem(t){if(super.processDataItem(t),t.get("fill")==null){let e=this.get("colors");e&&t.setRaw("fill",e.next())}}showDataItem(t,e){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return E(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,t,e)];re(e)||(e=this.get("stateAnimationDuration",0));const r=this.get("stateAnimationEasing");let l=t.get("value");const a=t.animate({key:"valueWorking",to:l,duration:e,easing:r});a&&s.push(a.waitForStop());const m=t.get("tick");m&&s.push(m.show(e));const o=t.get("label");o&&s.push(o.show(e));const n=t.get("slice");n&&s.push(n.show(e)),n.get("active")&&n.states.applyAnimate("active"),yield Promise.all(s)})}hideDataItem(t,e){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return E(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,t,e)],r=this.states.create("hidden",{});re(e)||(e=r.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));const l=r.get("stateAnimationEasing",this.get("stateAnimationEasing")),a=t.animate({key:"valueWorking",to:0,duration:e,easing:l});a&&s.push(a.waitForStop());const m=t.get("tick");m&&s.push(m.hide(e));const o=t.get("label");o&&s.push(o.hide(e));const n=t.get("slice");n.hideTooltip(),n&&s.push(n.hide(e)),yield Promise.all(s)})}disposeDataItem(t){super.disposeDataItem(t);let e=t.get("label");e&&(this.labels.removeValue(e),e.dispose());let i=t.get("tick");i&&(this.ticks.removeValue(i),i.dispose());let s=t.get("slice");s&&(this.slices.removeValue(s),s.dispose())}hoverDataItem(t){const e=t.get("slice");e&&!e.isHidden()&&e.hover()}unhoverDataItem(t){const e=t.get("slice");e&&e.unhover()}updateLegendMarker(t){const e=t.get("slice");if(e){const i=t.get("legendDataItem");if(i){const s=i.get("markerRectangle");A(Be,r=>{e.get(r)!=null&&s.set(r,e.get(r))})}}}_arrangeDown(t){if(t){let e=this._getNextDown();t.sort((i,s)=>i.y>s.y?1:i.y{const s=i.label.adjustedLocalBounds();let r=s.top;i.y+ri.ys.y?-1:0),A(t,i=>{const s=i.label.adjustedLocalBounds();let r=s.bottom;i.y+r>e&&(i.y=e-r),i.label.set("y",i.y),e=i.y+s.top})}}_arrangeRight(t){if(t){let e=0;t.sort((i,s)=>i.y>s.y?1:i.y{const s=i.label.adjustedLocalBounds();let r=s.left;i.y+ri.ys.y?-1:0),A(t,i=>{const s=i.label.adjustedLocalBounds();let r=s.right;i.y+r>e&&(i.y=e-r),i.label.set("x",i.y),e=i.y+s.left})}}_updateSize(){super._updateSize(),this.markDirty()}_updateTick(t){}_dispose(){super._dispose();const t=this.chart;t&&t.series.removeValue(this)}}Object.defineProperty(q,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentSeries"}),Object.defineProperty(q,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ne.classNames.concat([q.className])});class _e extends K{constructor(){super(...arguments),Object.defineProperty(this,"_maxRadius",{enumerable:!0,configurable:!0,writable:!0,value:1})}_afterNew(){super._afterNew(),this.seriesContainer.setAll({x:v,y:v})}_prepareChildren(){super._prepareChildren();const t=this.chartContainer,e=t.innerWidth(),i=t.innerHeight(),s=this.get("startAngle",0),r=this.get("endAngle",0),l=this.get("innerRadius");let a=Re(0,0,s,r,1);const m=e/(a.right-a.left),o=i/(a.bottom-a.top);let n={left:0,right:0,top:0,bottom:0};if(l instanceof ae){let c=l.value,b=Math.min(m,o);c=Math.max(b*c,b-Math.min(i,e))/b,n=Re(0,0,s,r,c),this.setPrivateRaw("irModifyer",c/l.value)}a=Me([a,n]);const p=this._maxRadius;this._maxRadius=Math.min(m,o);const h=F(this.get("radius",0),this._maxRadius);this.seriesContainer.setAll({dy:-h*(a.bottom+a.top)/2,dx:-h*(a.right+a.left)/2}),(this.isDirty("startAngle")||this.isDirty("endAngle")||p!=this._maxRadius)&&this.series.each(c=>{c._markDirtyKey("startAngle")}),(this.isDirty("innerRadius")||this.isDirty("radius"))&&this.series.each(c=>{c._markDirtyKey("innerRadius")})}radius(t){let e=F(this.get("radius",0),this._maxRadius),i=F(this.get("innerRadius",0),e);if(t){let s=this.series.indexOf(t),r=this.series.length,l=t.get("radius");return l!=null?i+F(l,e-i):i+(e-i)/r*(s+1)}return e}innerRadius(t){const e=this.radius();let i=F(this.get("innerRadius",0),e);if(i<0&&(i=e+i),t){let s=this.series.indexOf(t),r=this.series.length,l=t.get("innerRadius");return l!=null?i+F(l,e-i):i+(e-i)/r*s}return i}}Object.defineProperty(_e,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieChart"}),Object.defineProperty(_e,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:K.classNames.concat([_e.className])});class xe extends q{_makeSlices(){return new ge(me.new({}),()=>se._new(this._root,{themeTags:ye(this.slices.template.get("themeTags",[]),["pie","series"])},[this.slices.template]))}_makeLabels(){return new ge(me.new({}),()=>ie._new(this._root,{themeTags:ye(this.labels.template.get("themeTags",[]),["pie","series"])},[this.labels.template]))}_makeTicks(){return new ge(me.new({}),()=>Se._new(this._root,{themeTags:ye(this.ticks.template.get("themeTags",[]),["pie","series"])},[this.ticks.template]))}processDataItem(t){super.processDataItem(t);const e=this.makeSlice(t);e.on("scale",()=>{this._updateTick(t)}),e.on("shiftRadius",()=>{this._updateTick(t)}),e.events.on("positionchanged",()=>{this._updateTick(t)});const i=this.makeLabel(t);i.events.on("positionchanged",()=>{this._updateTick(t)}),this.makeTick(t),e.events.on("positionchanged",()=>{i.markDirty()})}_getNextUp(){const t=this.chart;return t?t._maxRadius:this.labelsContainer.maxHeight()/2}_getNextDown(){const t=this.chart;return t?-t._maxRadius:-this.labelsContainer.maxHeight()/2}_prepareChildren(){super._prepareChildren();const t=this.chart;if(t){if(this.isDirty("alignLabels")){let e=this.labels.template;if(this.get("alignLabels"))e.set("textType","aligned");else{let i=e.get("textType");i!=null&&i!="aligned"||e.set("textType","adjusted")}}if(this._valuesDirty||this.isDirty("radius")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("endAngle")||this.isDirty("alignLabels")){this.markDirtyBounds();const e=this.get("startAngle",t.get("startAngle",-90)),i=this.get("endAngle",t.get("endAngle",270))-e;let s=e;const r=t.radius(this);this.setPrivateRaw("radius",r);let l=t.innerRadius(this)*t.getPrivate("irModifyer",1);l<0&&(l=r+l),A(this._dataItems,a=>{this.updateLegendValue(a);let m=i*a.get("valuePercentTotal")/100;const o=a.get("slice");if(o){o.set("radius",r),o.set("innerRadius",l),o.set("startAngle",s),o.set("arc",m);const h=a.get("fill");o._setDefault("fill",h),o._setDefault("stroke",h)}let n=Oe(s+m/2);const p=a.get("label");if(p&&(p.setPrivate("radius",r),p.setPrivate("innerRadius",l),p.set("labelAngle",n),p.get("textType")=="aligned")){let h=r+p.get("radius",0),c=r*O(n);n>90&&n<=270?(p.isHidden()||p.isHiding()||this._lLabels.push({label:p,y:c}),h*=-1,h-=this.labelsContainer.get("paddingLeft",0),p.set("centerX",we),p.setPrivateRaw("left",!0)):(p.isHidden()||p.isHiding()||this._rLabels.push({label:p,y:c}),h+=this.labelsContainer.get("paddingRight",0),p.set("centerX",0),p.setPrivateRaw("left",!1)),p.set("x",h),p.set("y",r*O(n))}s+=m,this._updateTick(a)})}}}_updateTick(t){const e=t.get("tick"),i=t.get("label"),s=t.get("slice"),r=e.get("location",1);if(e&&i&&s){const l=(s.get("shiftRadius",0)+s.get("radius",0))*s.get("scale",1)*r,a=i.get("labelAngle",0),m=H(a),o=O(a),n=this.labelsContainer,p=n.get("paddingLeft",0),h=n.get("paddingRight",0);let c=0,b=0;if(c=i.x(),b=i.y(),i.get("textType")=="circular"){const P=i.radius()-i.get("paddingBottom",0),y=i.get("labelAngle",0);c=P*H(y),b=P*O(y)}let f=-h;i.getPrivate("left")&&(f=p),e.set("points",[{x:s.x()+l*m,y:s.y()+l*o},{x:c+f,y:b},{x:c,y:b}])}}_positionBullet(t){const e=t.get("sprite");if(e){const i=e.dataItem.get("slice");if(i){const s=i.get("innerRadius",0),r=i.get("radius",0),l=i.get("startAngle",0)+i.get("arc",0)*t.get("locationX",.5),a=s+(r-s)*t.get("locationY",.5);e.setAll({x:H(l)*a,y:O(l)*a})}}}}Object.defineProperty(xe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieSeries"}),Object.defineProperty(xe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:q.classNames.concat([xe.className])});export{_e as PieChartAm5,xe as PieSeriesAm5}; diff --git a/assets/pl_PL2-8693870b.js b/assets/pl_PL2-8693870b.js new file mode 100644 index 0000000..ffb4fd3 --- /dev/null +++ b/assets/pl_PL2-8693870b.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n.e.",_era_bc:"p.n.e.",A:"a",P:"p",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"stycznia",February:"lutego",March:"marca",April:"kwietnia",May:"maja",June:"czerwca",July:"lipca",August:"sierpnia",September:"września",October:"października",November:"listopada",December:"grudnia",Jan:"sty",Feb:"lut",Mar:"mar",Apr:"kwi","May(short)":"maj",Jun:"cze",Jul:"lip",Aug:"sie",Sep:"wrz",Oct:"paź",Nov:"lis",Dec:"gru",Sunday:"niedziela",Monday:"poniedziałek",Tuesday:"wtorek",Wednesday:"środa",Thursday:"czwartek",Friday:"piątek",Saturday:"sobota",Sun:"niedz.",Mon:"pon.",Tue:"wt.",Wed:"śr.",Thu:"czw.",Fri:"pt.",Sat:"sob.",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Zmiana skali",Play:"Odtwarzanie",Stop:"Zatrzymaj",Legend:"Legenda","Press ENTER to toggle":"",Loading:"Wczytywanie",Home:"Strona główna",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Drukuj",Image:"Obraz",Data:"Dane",Print:"Drukuj","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{a as default}; diff --git a/assets/popupUtils-82ea8abb.js b/assets/popupUtils-82ea8abb.js new file mode 100644 index 0000000..0de2517 --- /dev/null +++ b/assets/popupUtils-82ea8abb.js @@ -0,0 +1 @@ +import{cC as u,cD as f,cE as m,cF as p,cG as s,cH as w,cI as F,cJ as g,cK as b}from"./index-080e108a.js";function j({displayField:e,editFieldsInfo:a,fields:i,objectIdField:t,title:r},o){if(!i)return null;const l=L({editFieldsInfo:a,fields:i,objectIdField:t},o);if(!l.length)return null;const c=N({titleBase:r,fields:i,displayField:e}),d=v();return new u({title:c,content:d,fieldInfos:l})}const y=(e,a)=>a.visibleFieldNames?a.visibleFieldNames.has(e.name):b(e,a);function C(e,a){const i=e;return a&&(e=e.filter(t=>!a.includes(t.type))),e===i&&(e=e.slice()),e.sort(I),e}function I(e,a){return e.type==="oid"?-1:a.type==="oid"?1:n(e)?-1:n(a)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((a.alias||a.name).toLocaleLowerCase())}function L(e,a){const i=a==null?void 0:a.visibleFieldNames;return C(e.fields??[],(a==null?void 0:a.ignoreFieldTypes)||$).map(t=>new f({fieldName:t.name,isEditable:m(t,e),label:t.alias,format:h(t),visible:y(t,{...e,visibleFieldNames:i})}))}function h(e){switch(e.type){case"small-integer":case"integer":case"single":return new s({digitSeparator:!0,places:0});case"double":return new s({digitSeparator:!0,places:2});case"date":return new s({dateFormat:"long-month-day-year"});default:return e.type==="string"&&p(e.name)?new s({digitSeparator:!0,places:0}):null}}function v(){return[new w,new F]}function N(e){const a=g(e),{titleBase:i}=e;return a?`${i}: {${a.trim()}}`:i??""}function n(e){return(e.name&&e.name.toLowerCase())==="name"?!0:(e.alias&&e.alias.toLowerCase())==="name"}const $=["geometry","blob","raster","guid","xml"];export{j as p}; diff --git a/assets/popupUtils-f04ec9a9.js b/assets/popupUtils-f04ec9a9.js new file mode 100644 index 0000000..0b2c853 --- /dev/null +++ b/assets/popupUtils-f04ec9a9.js @@ -0,0 +1 @@ +import{bv as m,bw as I}from"./index-080e108a.js";async function x(e,t=e.popupTemplate){var s,o;if(t==null)return[];const a=await t.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:r}=t,{objectIdField:u,typeIdField:n,globalIdField:d,relationships:i}=e;if(a.includes("*"))return["*"];const c=r?await m(e):[],l=I(e.fieldsIndex,[...a,...c]);return n&&l.push(n),l&&u&&((s=e.fieldsIndex)!=null&&s.has(u))&&!l.includes(u)&&l.push(u),l&&d&&((o=e.fieldsIndex)!=null&&o.has(d))&&!l.includes(d)&&l.push(d),i&&i.forEach(h=>{var f;const{keyField:p}=h;l&&p&&((f=e.fieldsIndex)!=null&&f.has(p))&&!l.includes(p)&&l.push(p)}),l}function b(e,t){return e.popupTemplate?e.popupTemplate:t!=null&&t.defaultPopupTemplateEnabled&&e.defaultPopupTemplate!=null?e.defaultPopupTemplate:null}function E(e,t){return b(e,{defaultPopupTemplateEnabled:t})!=null}export{x as n,b as p,E as t}; diff --git a/assets/portalItemUtils-792a27e1.js b/assets/portalItemUtils-792a27e1.js new file mode 100644 index 0000000..a709779 --- /dev/null +++ b/assets/portalItemUtils-792a27e1.js @@ -0,0 +1 @@ +import{bb as l,bc as f,bd as d,be as E}from"./index-080e108a.js";async function p(t){const n=t.spatialReference;if(n.isWGS84)return t.clone();if(n.isWebMercator)return l(t);const e=f.WGS84;return await d(n,e),E(t,e)}function A(t,n){if(!u(t,n)){const e=t.typeKeywords;e?e.push(n):t.typeKeywords=[n]}}function u(t,n){var e;return!!((e=t.typeKeywords)!=null&&e.includes(n))}function I(t){return u(t,S.HOSTED_SERVICE)}function m(t,n){const e=t.typeKeywords;if(e){const r=e.indexOf(n);r>-1&&e.splice(r,1)}}async function R(t){const n=t.clone().normalize();let e;if(n.length>1)for(const r of n)e?r.width>e.width&&(e=r):e=r;else e=n[0];return p(e)}const S={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service"};function b(t){var a;const{portal:n,isOrgItem:e,itemControl:r}=t,s=(a=n.user)==null?void 0:a.privileges;let i=!s||s.includes("features:user:edit"),c=!!e&&!!(s!=null&&s.includes("features:user:fullEdit"));const o=r==="update"||r==="admin";return o?c=i=!0:c&&(i=!0),{features:{edit:i,fullEdit:c},content:{updateItem:o}}}export{R as a,I as c,b as f,A as i,S as l,u as s,m as u}; diff --git a/assets/portalLayers-54553513.js b/assets/portalLayers-54553513.js new file mode 100644 index 0000000..44316a0 --- /dev/null +++ b/assets/portalLayers-54553513.js @@ -0,0 +1 @@ +import{b5 as L,ar as d,b6 as u}from"./index-080e108a.js";import{a as I}from"./lazyLayerLoader-8b31b2e1.js";import{getNumLayersAndTables as y,preprocessFSItemData as S,getSubtypeGroupLayerIds as g,getFirstLayerOrTableId as T}from"./layersLoader-0106cc6e.js";import{s as i}from"./portalItemUtils-792a27e1.js";import{t as c}from"./fetchService-82a8c4d0.js";import"./jsonContext-5f3816dc.js";import"./styleUtils-25825fd6.js";async function Q(e){!e.portalItem||e.portalItem instanceof L||(e={...e,portalItem:new L(e.portalItem)});const a=await v(e.portalItem);return new a.constructor({portalItem:e.portalItem,...a.properties})}async function v(e){return await e.load(),F(await b(e))}async function b(e){switch(e.type){case"Map Service":return M(e);case"Feature Service":return G(e);case"Feature Collection":return h(e);case"Scene Service":return $(e);case"Image Service":return C(e);case"Stream Service":return V();case"Vector Tile Service":return j();case"GeoJson":return W();case"CSV":return D();case"KML":return K();case"WFS":return O();case"WMTS":return x();case"WMS":return k();case"Feed":return A();default:throw new d("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function F(e){const a=e.className,r=I[a];return{constructor:await r(),properties:e.properties}}async function M(e){return await R(e)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function G(e){if(i(e,"Oriented Imagery Layer"))return J(e);const a=await N(e);if(typeof a=="object"){const r={};return a.id!=null&&(r.layerId=a.id),{className:a.className||"FeatureLayer",properties:r}}return{className:"GroupLayer"}}async function $(e){var r;const a=await N(e);if(typeof a=="object"){const t={};let n;if(a.id!=null?(t.layerId=a.id,n=`${e.url}/layers/${a.id}`):n=e.url,(r=e.typeKeywords)==null?void 0:r.length){for(const o of Object.keys(u))if(e.typeKeywords.includes(o))return{className:u[o]}}const s=await c(n);return{className:u[s==null?void 0:s.layerType]||"SceneLayer",properties:t}}if(a===!1){const t=await c(e.url);return(t==null?void 0:t.layerType)==="Voxel"?{className:"VoxelLayer"}:{className:"GroupLayer"}}return{className:"GroupLayer"}}async function h(e){await e.load();const a=i(e,"Map Notes"),r=i(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if(i(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return y(t)===1?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function C(e){var m,p,f;await e.load();const a=((m=e.typeKeywords)==null?void 0:m.map(w=>w.toLowerCase()))??[];if(a.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(a.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await e.fetchData(),t=r==null?void 0:r.layerType;if(t==="ArcGISTiledImageServiceLayer")return{className:"ImageryTileLayer"};if(t==="ArcGISImageServiceLayer")return{className:"ImageryLayer"};const n=await c(e.url),s=(p=n.cacheType)==null?void 0:p.toLowerCase(),o=(f=n.capabilities)==null?void 0:f.toLowerCase().includes("tilesonly");return s==="map"||o?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function V(){return{className:"StreamLayer"}}function j(){return{className:"VectorTileLayer"}}function W(){return{className:"GeoJSONLayer"}}function D(){return{className:"CSVLayer"}}function K(){return{className:"KMLLayer"}}function O(){return{className:"WFSLayer"}}function k(){return{className:"WMSLayer"}}function x(){return{className:"WMTSLayer"}}function A(){return{className:"StreamLayer"}}async function J(e){return await e.load(),{className:"OrientedImageryLayer",properties:await e.fetchData()}}async function R(e){return(await c(e.url)).tileInfo}async function N(e){const a=e.url;if(!a||/\/\d+$/.test(a))return{};await e.load();const r=await e.fetchData();if(e.type==="Feature Service"){const t=l(await S(r,a));if(typeof t=="object"){const n=g(r);t.className=t.id!=null&&n.includes(t.id)?"SubtypeGroupLayer":"FeatureLayer"}return t}return y(r)>0?l(r):l(await c(a))}function l(e){return y(e)===1&&{id:T(e)}}export{Q as fromItem,b as selectLayerClassPath}; diff --git a/assets/portalUtils-2eff95c6.js b/assets/portalUtils-2eff95c6.js new file mode 100644 index 0000000..58f8fda --- /dev/null +++ b/assets/portalUtils-2eff95c6.js @@ -0,0 +1 @@ +import{b9 as l,c0 as i,at as a}from"./index-080e108a.js";function d(r,e){return r===null?e:new l({url:r.field("url")})}async function y(r,e,t){var o;if(!((o=i)==null?void 0:o.findCredential(r.restUrl)))return null;if(r.loadStatus==="loaded"&&e===""&&r.user&&r.user.sourceJSON&&t===!1)return r.user.sourceJSON;if(e===""){const n=await a(r.restUrl+"/community/self",{responseType:"json",query:{f:"json",...t===!1?{}:{returnUserLicenseTypeExtensions:!0}}});if(n.data){const s=n.data;if(s&&s.username)return s}return null}const u=await a(r.restUrl+"/community/users/"+e,{responseType:"json",query:{f:"json"}});if(u.data){const n=u.data;return n.error?null:n}return null}export{y as s,d as t}; diff --git a/assets/projectExtentUtils-efa4cddd.js b/assets/projectExtentUtils-efa4cddd.js new file mode 100644 index 0000000..a26ab22 --- /dev/null +++ b/assets/projectExtentUtils-efa4cddd.js @@ -0,0 +1 @@ +import{c$ as s,d0 as a}from"./index-080e108a.js";function u(l){const r=l.view.spatialReference,e=l.layer.fullExtent,n=e!=null&&e.spatialReference;if(e==null||!n)return Promise.resolve(null);if(n.equals(r))return Promise.resolve(e.clone());const t=s(e,r);return t!=null?Promise.resolve(t):l.view.state.isLocal?a(e,r,l.layer.portalItem).then(o=>!l.destroyed&&o?o:null).catch(()=>null):Promise.resolve(null)}export{u as l}; diff --git a/assets/pt_BR2-a1cac873.js b/assets/pt_BR2-a1cac873.js new file mode 100644 index 0000000..a22d1ee --- /dev/null +++ b/assets/pt_BR2-a1cac873.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - dd MMM",_date_hour:"HH:mm",_date_hour_full:"HH:mm - dd MMM",_date_day:"dd MMM",_date_day_full:"dd MMM",_date_week:"ww",_date_week_full:"dd MMM",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"DC",_era_bc:"AC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Janeiro",February:"Fevereiro",March:"Março",April:"Abril",May:"Maio",June:"Junho",July:"Julho",August:"Agosto",September:"Setembro",October:"Outubro",November:"Novembro",December:"Dezembro",Jan:"Jan",Feb:"Fev",Mar:"Mar",Apr:"Abr","May(short)":"Mai",Jun:"Jun",Jul:"Jul",Aug:"Ago",Sep:"Set",Oct:"Out",Nov:"Nov",Dec:"Dez",Sunday:"Domingo",Monday:"Segunda-feira",Tuesday:"Terça-feira",Wednesday:"Quarta-feira",Thursday:"Quinta-feira",Friday:"Sexta-feira",Saturday:"Sábado",Sun:"Dom",Mon:"Seg",Tue:"Ter",Wed:"Qua",Thu:"Qui",Fri:"Sex",Sat:"Sáb",_dateOrd:function(e){return"º"},"Zoom Out":"Reduzir Zoom",Play:"Play",Stop:"Parar",Legend:"Legenda","Press ENTER to toggle":"Clique, toque ou pressione ENTER para alternar",Loading:"Carregando",Home:"Início",Chart:"Gráfico","Serial chart":"Gráfico Serial","X/Y chart":"Gráfico XY","Pie chart":"Gráfico de Pizza","Gauge chart":"Gráfico Indicador","Radar chart":"Gráfico de Radar","Sankey diagram":"Diagrama Sankey","Chord diagram":"Diagram Chord","Flow diagram":"Diagrama Flow","TreeMap chart":"Gráfico de Mapa de Árvore",Series:"Séries","Candlestick Series":"Séries do Candlestick","Column Series":"Séries de Colunas","Line Series":"Séries de Linhas","Pie Slice Series":"Séries de Fatias de Pizza","X/Y Series":"Séries de XY",Map:"Mapa","Press ENTER to zoom in":"Pressione ENTER para aumentar o zoom","Press ENTER to zoom out":"Pressione ENTER para diminuir o zoom","Use arrow keys to zoom in and out":"Use as setas para diminuir ou aumentar o zoom","Use plus and minus keys on your keyboard to zoom in and out":"Use as teclas mais ou menos no seu teclado para diminuir ou aumentar o zoom",Export:"Exportar",Image:"Imagem",Data:"Dados",Print:"Imprimir","Press ENTER to open":"Clique, toque ou pressione ENTER para abrir","Press ENTER to print.":"Clique, toque ou pressione ENTER para imprimir","Press ENTER to export as %1.":"Clique, toque ou pressione ENTER para exportar como %1.","(Press ESC to close this message)":"(Pressione ESC para fechar esta mensagem)","Image Export Complete":"A exportação da imagem foi completada","Export operation took longer than expected. Something might have gone wrong.":"A exportação da imagem demorou mais do que o experado. Algo deve ter dado errado.","Saved from":"Salvo de",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Use TAB para selecionar os botões ou setas para a direita ou esquerda para mudar a seleção","Use left and right arrows to move selection":"Use as setas para a esquerda ou direita para mover a seleção","Use left and right arrows to move left selection":"Use as setas para a esquerda ou direita para mover a seleção da esquerda","Use left and right arrows to move right selection":"Use as setas para a esquerda ou direita para mover a seleção da direita","Use TAB select grip buttons or up and down arrows to change selection":"Use TAB para selecionar os botões ou setas para cima ou para baixo para mudar a seleção","Use up and down arrows to move selection":"Use as setas para cima ou para baixo para mover a seleção","Use up and down arrows to move lower selection":"Use as setas para cima ou para baixo para mover a seleção de baixo","Use up and down arrows to move upper selection":"Use as setas para cima ou para baixo para mover a seleção de cima","From %1 to %2":"De %1 até %2","From %1":"De %1","To %1":"Até %1","No parser available for file: %1":"Não há um interpretador para este arquivo: %1","Error parsing file: %1":"Erro analizando o arquivo: %1","Unable to load file: %1":"O arquivo não pôde ser carregado: %1","Invalid date":"Data inválida"};export{a as default}; diff --git a/assets/pt_PT2-e5eb7b28.js b/assets/pt_PT2-e5eb7b28.js new file mode 100644 index 0000000..0177e8f --- /dev/null +++ b/assets/pt_PT2-e5eb7b28.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - dd MMM",_date_hour:"HH:mm",_date_hour_full:"HH:mm - dd MMM",_date_day:"dd MMM",_date_day_full:"dd MMM",_date_week:"ww",_date_week_full:"dd MMM",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"DC",_era_bc:"AC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Janeiro",February:"Fevereiro",March:"Março",April:"Abril",May:"Maio",June:"Junho",July:"Julho",August:"Agosto",September:"Setembro",October:"Outubro",November:"Novembro",December:"Dezembro",Jan:"Jan",Feb:"Fev",Mar:"Mar",Apr:"Abr","May(short)":"Mai",Jun:"Jun",Jul:"Jul",Aug:"Ago",Sep:"Set",Oct:"Out",Nov:"Nov",Dec:"Dez",Sunday:"Domingo",Monday:"Segunda-feira",Tuesday:"Terça-feira",Wednesday:"Quarta-feira",Thursday:"Quinta-feira",Friday:"Sexta-feira",Saturday:"Sábado",Sun:"Dom",Mon:"Seg",Tue:"Ter",Wed:"Qua",Thu:"Qui",Fri:"Sex",Sat:"Sáb",_dateOrd:function(e){return"º"},"Zoom Out":"Reduzir Zoom",Play:"Play",Stop:"Parar",Legend:"Legenda","Press ENTER to toggle":"Clique, toque ou pressione ENTER para alternar",Loading:"Carregando",Home:"Início",Chart:"Gráfico","Serial chart":"Gráfico Serial","X/Y chart":"Gráfico XY","Pie chart":"Gráfico de Pizza","Gauge chart":"Gráfico Indicador","Radar chart":"Gráfico de Radar","Sankey diagram":"Diagrama Sankey","Chord diagram":"Diagram Chord","Flow diagram":"Diagrama Flow","TreeMap chart":"Gráfico de Mapa de Árvore",Series:"Séries","Candlestick Series":"Séries do Candlestick","Column Series":"Séries de Colunas","Line Series":"Séries de Linhas","Pie Slice Series":"Séries de Fatias de Pizza","X/Y Series":"Séries de XY",Map:"Mapa","Press ENTER to zoom in":"Pressione ENTER para aumentar o zoom","Press ENTER to zoom out":"Pressione ENTER para diminuir o zoom","Use arrow keys to zoom in and out":"Use as setas para diminuir ou aumentar o zoom","Use plus and minus keys on your keyboard to zoom in and out":"Use as teclas mais ou menos no seu teclado para diminuir ou aumentar o zoom",Export:"Exportar",Image:"Imagem",Data:"Dados",Print:"Imprimir","Press ENTER to open":"Clique, toque ou pressione ENTER para abrir","Press ENTER to print.":"Clique, toque ou pressione ENTER para imprimir","Press ENTER to export as %1.":"Clique, toque ou pressione ENTER para exportar como %1.","(Press ESC to close this message)":"(Pressione ESC para fechar esta mensagem)","Image Export Complete":"A exportação da imagem foi completada","Export operation took longer than expected. Something might have gone wrong.":"A exportação da imagem demorou mais do que o experado. Algo deve ter dado errado.","Saved from":"Salvo de",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Use TAB para selecionar os botões ou setas para a direita ou esquerda para mudar a seleção","Use left and right arrows to move selection":"Use as setas para a esquerda ou direita para mover a seleção","Use left and right arrows to move left selection":"Use as setas para a esquerda ou direita para mover a seleção da esquerda","Use left and right arrows to move right selection":"Use as setas para a esquerda ou direita para mover a seleção da direita","Use TAB select grip buttons or up and down arrows to change selection":"Use TAB para selecionar os botões ou setas para cima ou para baixo para mudar a seleção","Use up and down arrows to move selection":"Use as setas para cima ou para baixo para mover a seleção","Use up and down arrows to move lower selection":"Use as setas para cima ou para baixo para mover a seleção de baixo","Use up and down arrows to move upper selection":"Use as setas para cima ou para baixo para mover a seleção de cima","From %1 to %2":"De %1 até %2","From %1":"De %1","To %1":"Até %1","No parser available for file: %1":"Nenhum interpretador está disponível para este arquivo: %1","Error parsing file: %1":"Erro ao analizar o arquivo: %1","Unable to load file: %1":"O arquivo não pôde ser carregado: %1","Invalid date":"Data inválida"};export{a as default}; diff --git a/assets/query-93c6e211.js b/assets/query-93c6e211.js new file mode 100644 index 0000000..03bd778 --- /dev/null +++ b/assets/query-93c6e211.js @@ -0,0 +1 @@ +import{bf as m,at as p,c5 as S,es as x}from"./index-080e108a.js";import{b as E}from"./normalizeUtils-cf8b8053.js";import{t as O}from"./pbfQueryUtils-26a87215.js";import{t as g}from"./queryZScale-8f9616ff.js";function d(r){const e={};for(const i in r){if(i==="declaredClass")continue;const t=r[i];if(t!=null&&typeof t!="function")if(Array.isArray(t)){e[i]=[];for(let n=0;no.data.attachmentGroups)}async function z(n,t,e){const{objectIds:a}=t,o=[];for(const s of a)o.push(p(n.path+"/"+s+"/attachments",e));return Promise.all(o).then(s=>a.map((c,r)=>({parentObjectId:c,attachmentInfos:s[r].data.attachmentInfos})))}export{w as executeAttachmentQuery,z as fetchAttachments,k as processAttachmentQueryResult}; diff --git a/assets/queryEngineUtils-342680f6.js b/assets/queryEngineUtils-342680f6.js new file mode 100644 index 0000000..99cca73 --- /dev/null +++ b/assets/queryEngineUtils-342680f6.js @@ -0,0 +1 @@ +import{dk as d}from"./index-080e108a.js";import{s as a,r as i,l as g}from"./DimensionAnalysisView3D-4f55aca1.js";import{r as c}from"./VertexSnappingCandidate-0a987e12.js";function e({x:t,y:r,z:n}){return g(d(t,r,n??0))}function p(t,r){switch(t.type){case"edge":return t.draped?new a({edgeStart:e(t.start),edgeEnd:e(t.end),targetPoint:e(t.target),objectId:t.objectId,getGroundElevation:r}):new i({edgeStart:e(t.start),edgeEnd:e(t.end),targetPoint:e(t.target),objectId:t.objectId,isDraped:!1});case"vertex":return new c({targetPoint:e(t.target),objectId:t.objectId,isDraped:!1})}}function f(t){return t!=null&&t.type==="3d"?(r,n,o)=>t.elevationProvider.getElevation(r,n,o??0,t.spatialReference,"ground"):()=>null}export{p as i,f as o}; diff --git a/assets/queryForSymbologySnapping-0264f2b5.js b/assets/queryForSymbologySnapping-0264f2b5.js new file mode 100644 index 0000000..a19de46 --- /dev/null +++ b/assets/queryForSymbologySnapping-0264f2b5.js @@ -0,0 +1 @@ +import{gD as j,bc as z,gE as C,gF as F,ax as v,gG as G,gH as $,gI as q,bA as E}from"./index-080e108a.js";import{u as O}from"./elevationInfoUtils-4fd79d95.js";async function P(o,d,p,l,r){const{elevationProvider:h,renderCoordsHelper:c,spatialReference:I}=o,{elevationInfo:y}=d,m=C(y,!0),b=await F(m,I,r);v(r);const i=[],u=new Set,f=new Set;for(const{objectId:e,points:t}of l){const n=p(e);if(n==null){for(const s of t)i.push(s.z??0);u.add(e);continue}n.isDraped&&f.add(e);const a=n.graphic.geometry;w.setFromElevationInfo(O(a,y)),w.updateFeatureExpressionInfoContext(b,n.graphic,d),g.spatialReference=o.spatialReference;for(const{x:s,y:x,z:D}of t)g.x=s,g.y=x,g.z=D??0,G(g,h,w,c,R),i.push(R.z)}return{elevations:i,drapedObjectIds:f,failedObjectIds:u}}const w=new $,g=j(0,0,0,z.WGS84),R=new q;async function B(o,d,p){if(o==null||d.candidates.length===0)return S;const l=o.graphics3DGraphicsByObjectID??o.graphics3DGraphics,r=[],h=[],{renderer:c}=o,I=c!=null&&"arcadeRequired"in c&&c.arcadeRequired?E():null,y=async(e,{graphic:t,graphics3DSymbol:n})=>{const a=await I,s=await o.getRenderingInfoAsync(t,c,a,{signal:p});return s==null?[]:n.queryForSnapping(e,b,s,p)},{candidates:m,spatialReference:b}=d;for(let e=0;e{const r=t.data;if(r.hasOwnProperty("extent"))return t;if(r.features)throw new Error(a);if(r.hasOwnProperty("count"))throw new Error(a);return t})}function h(o,e,n){return e.timeExtent!=null&&e.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):d(o,e,"json",n,{returnIdsOnly:!0,returnCountOnly:!0})}function d(o,e,n,t={},r={}){const u=typeof o=="string"?p(o):o,s=e.geometry?[e.geometry]:[];return t.responseType=n==="pbf"?"array-buffer":"json",F(s,null,t).then(y=>{const i=y&&y[0];i!=null&&((e=e.clone()).geometry=i);const l=E({...u.query,f:n,...r,...x(e,r)});return m(c(u.path,"queryTopFeatures"),{...t,query:{...l,...t.query}})})}export{R as d,h as m,b as p,B as y}; diff --git a/assets/queryZScale-8f9616ff.js b/assets/queryZScale-8f9616ff.js new file mode 100644 index 0000000..eba24c3 --- /dev/null +++ b/assets/queryZScale-8f9616ff.js @@ -0,0 +1 @@ +import{cN as r}from"./index-080e108a.js";function s(o,f,e){if(!e||!e.features||!e.hasZ)return;const t=r(e.geometryType,f,o.outSpatialReference);if(t!=null)for(const n of e.features)t(n.geometry)}export{s as t}; diff --git a/assets/quickselect-e80674f5.js b/assets/quickselect-e80674f5.js new file mode 100644 index 0000000..63c715f --- /dev/null +++ b/assets/quickselect-e80674f5.js @@ -0,0 +1 @@ +import{bU as U}from"./index-080e108a.js";var g,b,d,m={exports:{}};m.exports,g=m,b=function(){function q(t,r,n,o,i){p(t,r,n||0,o||t.length-1,i||s)}function p(t,r,n,o,i){for(;o>n;){if(o-n>600){var f=o-n+1,l=r-n+1,u=Math.log(f),v=.5*Math.exp(2*u/3),x=.5*Math.sqrt(u*v*(f-v)/f)*(l-f/2<0?-1:1);p(t,r,Math.max(n,Math.floor(r-l*v/f+x)),Math.min(o,Math.floor(r+(f-l)*v/f+x)),i)}var a=t[r],e=n,h=o;for(c(t,n,r),i(t[o],a)>0&&c(t,n,o);e0;)h--}i(t[n],a)===0?c(t,n,h):c(t,++h,o),h<=r&&(n=h+1),r<=h&&(o=h-1)}}function c(t,r,n){var o=t[r];t[r]=t[n],t[n]=o}function s(t,r){return tr?1:0}return q},(d=b())!==void 0&&(g.exports=d);const j=U(m.exports);export{j as f}; diff --git a/assets/rasterProjectionHelper-072edec4.js b/assets/rasterProjectionHelper-072edec4.js new file mode 100644 index 0000000..c8ddd07 --- /dev/null +++ b/assets/rasterProjectionHelper-072edec4.js @@ -0,0 +1 @@ +import{dX as H,dY as Mn,ca as A,be as v,cZ as W,dZ as Rn,ak as un,c7 as N,aB as bn,ar as Pn,d_ as G,d$ as E,e0 as tn,e1 as Sn,e2 as Nn,bc as En,e3 as en}from"./index-080e108a.js";var Z;function xn(n,e,i){return!bn(n,e,i)}function $(n,e,i){const s=xn(n,e,i);if(s&&!H())throw new Pn("rasterprojectionhelper-project","projection engine is not loaded");return s}(function(n){n[n.None=0]="None",n[n.North=1]="North",n[n.South=2]="South",n[n.Both=3]="Both"})(Z||(Z={}));const on=(n,e,i,s=0)=>{if(i[0]===1)return[0,0];let r=1,t=-1,o=1,f=-1;for(let u=0;un[u]?n[u]:r,t=t>n[u]?t:n[u],o=o>n[u+1]?n[u+1]:o,f=f>n[u+1]?f:n[u+1]);const{cols:c,rows:a}=e,l=(t-r)/c/i[0],d=(f-o)/a/i[1],y=2*s;let x=0,m=!1,h=[0,0];for(let u=0;ux&&(x=M+b,h=[M,b]),y&&x>y){m=!0;break}}if(m)break}return h},Gn={3395:20037508342789244e-9,3410:17334193943686873e-9,3857:20037508342788905e-9,3975:17367530445161372e-9,4087:20037508342789244e-9,4088:20015108787169147e-9,6933:17367530445161372e-9,32662:20037508342789244e-9,53001:2001508679602057e-8,53002:1000754339801029e-8,53003:2001508679602057e-8,53004:2001508679602057e-8,53016:14152803599503474e-9,53017:17333573624304302e-9,53034:2001508679602057e-8,53079:20015114352186374e-9,53080:20015114352186374e-9,54001:20037508342789244e-9,54002:10018754171394624e-9,54003:20037508342789244e-9,54004:20037508342789244e-9,54016:14168658027268292e-9,54017:1736753044516137e-8,54034:20037508342789244e-9,54079:20037508342789244e-9,54080:20037508342789244e-9,54100:20037508342789244e-9,54101:20037508342789244e-9},L=32,B=4,q=B,J=new Map,X=new Map,I=500;async function Ln(){H()||await Mn()}function Bn(n,e,i){return $(n.spatialReference,e),i?en(e,n.spatialReference,n):en(n.spatialReference,e,n)}function In(n,e,i,s=null){const r=n.spatialReference;if(r.equals(e))return n;$(r,e,s);const t=i.center,o=new A({xmin:t.x-n.x/2,xmax:t.x+n.x/2,ymin:t.y-n.y/2,ymax:t.y+n.y/2,spatialReference:r}),f=v(o,e,s),c=k(e);let a;if(f==null||c!=null&&f.width>=c){const l=W(r)/W(e);a={x:n.x*l,y:n.y*l}}else a={x:f.width,y:f.height};return a}function S(n,e=.01){return W(n)?e/W(n):0}function sn(n,e,i=null,s=!0){const r=n.spatialReference;if(r.equals(e))return n;$(r,e,i);const t=v(n,e,i);return s&&t&&mn([n],[t],r,e),t}function mn(n,e,i,s){const r=j(i,!0),t=j(s,!0),o=S(i,I),f=S(s,I);if(o&&r!=null&&t!=null)for(let c=0;c=t[1]-f&&Math.abs(l-r[0])new N(f[0],f[1],i)),o=v(t,s,r);return r&&mn(t,o,i,s),o.map(f=>f?[f.x,f.y]:[NaN,NaN])}function rn(n){const{inSR:e,outSR:i,datumTransformation:s}=n,r=_(e),{points:t,mask:o}=U(n,r);if(!e.isGeographic){const c=e.wkid?G.coordsys(e.wkid):G.fromString(e.isGeographic?E.PE_TYPE_GEOGCS:E.PE_TYPE_PROJCS,e.wkt);tn.projToGeog(c,t.length,t)}if(s!=null&&s.steps.length){let c;if(i.isGeographic&&(c=t.map(([l])=>l>179.9955?1:l<-179.9955?-1:0)),s.steps.forEach(l=>{const d=l.wkid?G.geogtran(l.wkid):G.fromString(E.PE_TYPE_GEOGTRAN,l.wkt);Sn.geogToGeog(d,t.length,t,null,l.isInverse?E.PE_TRANSFORM_2_TO_1:E.PE_TRANSFORM_1_TO_2)}),c)for(let l=0;l179.9955?1:y<-179.9955?-1:0;d&&x&&d!==x&&(t[l][0]=d>0?y+360:y-360)}}if(!i.isGeographic){const c=_(i,!0),a=c!=null&&c.isEnvelope?[c.bbox[1],c.bbox[3]]:[-90,90];_n(t,a);const l=i.wkid?G.coordsys(i.wkid):G.fromString(i.isGeographic?E.PE_TYPE_GEOGCS:E.PE_TYPE_PROJCS,i.wkt);tn.geogToProj(l,t.length,t)}let f=t;if(o&&t.length!==o.length){f=[];for(let c=0,a=0;cu.getInclusive()===1&&u.getKind()===1);if(!o){if(o=r.find(u=>u.getInclusive()===1&&u.getKind()===0),!o)return null;t=!0}const f=i?0:(s.getNorthPoleLocation()===2?1:0)|(s.getSouthPoleLocation()===2?2:0),c=s.isPannableRectangle(),a=o.getCoord();if(t)return{isEnvelope:t,isPannable:c,vertices:a,coef:null,bbox:[a[0][0]-e,a[0][1]-e,a[1][0]+e,a[1][1]+e],poleLocation:f};let l=0;const d=[];let[y,x]=a[0],[m,h]=a[0];for(let u=0,R=a.length;ug?m:g,h=h>p?h:p}return{isEnvelope:!1,isPannable:c,vertices:a,coef:d,bbox:[y,x,m,h],poleLocation:f}}function U(n,e){const i=[],{cols:s,rows:r,xres:t,yres:o,usePixelCenter:f}=n;let{xmin:c,ymax:a}=n;if(f&&(c+=t/2,a-=o/2),e==null){for(let x=0;x=x&&p<=h;for(let M=0;M=m&&b<=u&&(i.push([p,b]),l[g]=1)}}return{points:i,mask:l}}const d=e.coef,y=[];for(let x=0;x=M&&m<=b){const z=p*m+w;h.push(z),u.push(C)}}let R=h;if(h.length>2){let g=u[0]===2?0:u[0],p=h[0];R=[];for(let w=1;ww-M)}else h[0]>h[1]&&(R=[h[1],h[0]]);y.push(R)}for(let x=0,m=0;x=g[0]&&h<=g[1]&&(i.push([h,R]),l[m]=1);else if(g.length>2){let p=!1;for(let w=0;w=g[w]&&h<=g[w+1]){p=!0;break}p&&(i.push([h,R]),l[m]=1)}}}return{points:i,mask:l}}function _n(n,e){const[i,s]=e;for(let r=0;rs)&&(n[r]=[NaN,NaN])}}function hn(n){const e=k(n[0].spatialReference);if(n.length<2||e==null)return n[0];const i=S(n[0].spatialReference);if((n=n.filter(f=>f.width>i)).length===1)return n[0];let{xmin:s,xmax:r,ymin:t,ymax:o}=n[0];for(let f=1;fS(r)){const{xmin:a,xmax:l}=n;for(let d=0;d<=t;d++){const y=d===0?a:-o/2,x=d===t?l-o*d:o/2;c[d]=new A({xmin:y,xmax:x,ymin:n.ymin,ymax:n.ymax,spatialReference:r})}}return hn(c.map(a=>ln(a,e,i,s)).filter(Rn))}function jn(n,e,i){if(n.type==="extent"){const{xmin:s,ymin:r,xmax:t,ymax:o,spatialReference:f}=n;n=new un({rings:[[[s,o],[t,o],[t,r],[s,r],[s,o]]],spatialReference:f})}return n.spatialReference.equals(e)?n:($(n.spatialReference,e,i),v(n,e,i))}function $n(n,e){const i=k(e);if(i==null)return null;let{xmin:s,ymin:r,xmax:t,ymax:o}=n;const f=n.spatialReference,c=new un({spatialReference:f,rings:[[[s,r],[t,r],[t,o],[s,o],[s,r]]]}),a=v(c,e);if(a.rings.length!==2||!a.rings[0].length||!a.rings[1].length)return null;const{rings:l}=a,d=S(f),y=new A({spatialReference:e});for(let x=0;x<2;x++){s=t=l[x][0][0],r=o=l[x][0][1];for(let m=0;ml[x][m][0]?l[x][m][0]:s,t=tl[x][m][1]?l[x][m][1]:r,o=o=o.ymax))return null;if(!s||!o)return o;const f=j(t,!0),c=j(e,!0);if(f==null||c==null)return o;const a=S(t,.001),l=S(t,I),d=S(e,.001);if(Math.abs(o.xmin-c[0])l){o.xmin=c[0];const m=[];m.push(new N(n.xmax,n.ymin,t)),m.push(new N(n.xmax,(n.ymin+n.ymax)/2,t)),m.push(new N(n.xmax,n.ymax,t));const h=m.map(u=>sn(u,e,i)).filter(u=>!isNaN(u==null?void 0:u.x)).map(u=>u.x);o.xmax=Math.max.apply(null,h)}if(xl){o.xmax=c[1];const m=[];m.push(new N(n.xmin,n.ymin,t)),m.push(new N(n.xmin,(n.ymin+n.ymax)/2,t)),m.push(new N(n.xmin,n.ymax,t));const h=m.map(u=>sn(u,e,i)).filter(u=>!isNaN(u==null?void 0:u.x)).map(u=>u.x);o.xmin=Math.min.apply(null,h)}}else{const y=S(e,.001);Math.abs(o.xmin-c[0])0&&s.outofBoundPointCountq)&&(xn(c,a,n.datumTransformation)&&(c.isGeographic||_(c)),i=[B,B],s=K({...n,spacing:i}),r={cols:s.size[0]+1,rows:s.size[1]+1},o=on(s.offsets,r,i,q)),s.error=o,i[0]>1&&(s.coefficients=fn(s.offsets,r,t)),n.includeGCSGrid&&!c.isGeographic&&!c.isWebMercator)if(a.isGeographic)s.gcsGrid={offsets:s.offsets,coefficients:s.coefficients,spacing:i};else{const l=_(c);if(l!=null&&!l.isEnvelope){const d=Wn(c),y=vn(n.projectedExtent,d),{offsets:x}=K({...n,srcBufferExtent:y,spacing:i}),m=fn(x,r,t);s.gcsGrid={offsets:x,coefficients:m,spacing:i}}}return s}function K(n){const{projectedExtent:e,srcBufferExtent:i,pixelSize:s,datumTransformation:r,rasterTransform:t}=n,o=e.spatialReference,f=i.spatialReference,c=$(o,f),{xmin:a,ymin:l,xmax:d,ymax:y}=e,x=k(f),m=x!=null&&(n.hasWrapAround||(t==null?void 0:t.type)==="gcs-shift"),h=n.spacing||[L,L],u=h[0]*s.x,R=h[1]*s.y,g=h[0]===1,p=Math.ceil((d-a)/u-.1/h[0])+(g?0:1),w=Math.ceil((y-l)/R-.1/h[1])+(g?0:1),M=kn({cols:p,rows:w,xmin:a,ymax:y,xres:u,yres:R,inSR:o,outSR:f,datumTransformation:r,preferPE:h[0]<=B,usePixelCenter:g}),b=[];let C,z=0;const D=g?-1:NaN,{xmin:Q,xmax:Y,ymax:pn,width:gn,height:yn}=i,dn=S(f,I),wn=x!=null&&Q>0&&Y>x/2;let V=!1;if(c){const T=_(o);V=T!=null&&T.poleLocation>0}for(let T=0;TY&&P[0]>x/2-dn?P[0]-=x:m&&T===0&&P[0]<0&&wn&&!t&&(P[0]+=x),!P||isNaN(P[0])||isNaN(P[1]))b.push(D),b.push(D),F.push(null),z++;else{if(t){const nn=t.inverseTransform(new N({x:P[0],y:P[1],spatialReference:f}));P=[nn.x,nn.y]}F.push(P),T>0&&m&&C[O]&&P[0]Y&&P[0]>x&&(P[0]-=x)),b.push((P[0]-Q)/gn),b.push((pn-P[1])/yn)}}C=F}return{offsets:b,error:null,coefficients:null,outofBoundPointCount:z,spacing:h,size:g?[p,w]:[p-1,w-1]}}function fn(n,e,i){const{cols:s,rows:r}=e,t=new Float32Array((s-1)*(r-1)*2*6),o=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),f=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let c=0;c=u)t=f.length,o=a/u>8;else{let p,w=R;for(let M=1;M<=f.length;M++){if(p=(f[M-1].x+f[M-1].y)/2,a<=p){a===p?t=M:i==="down"?(t=M-1,o=a/w>8):t=i==="up"||a-w>p-a||a/w>2?M:M-1;break}w=p}}const g=t===0?r:f[t-1];return o&&Math.min(g.x,g.y)*W(e.spatialReference)>19567&&(o=!1),{pyramidLevel:t,pyramidResolution:new N({x:g.x,y:g.y,spatialReference:e.spatialReference}),excessiveReading:o}}const l=Math.log(n.x/r.x)/Math.LN2,d=Math.log(n.y/r.y)/Math.LN2,y=e.storageInfo.maximumPyramidLevel||0;t=i==="down"?Math.floor(Math.min(l,d)):i==="up"?Math.ceil(Math.max(l,d)):Math.round((l+d)/2),t<0?t=0:t>y&&(o=t>y+3,t=y);const x=2**t;return{pyramidLevel:t,pyramidResolution:new N({x:x*e.nativePixelSize.x,y:x*e.nativePixelSize.y,spatialReference:e.spatialReference}),excessiveReading:o}}export{Yn as $,In as C,jn as J,k as K,On as Q,Bn as T,An as V,sn as _,xn as d,qn as i,Ln as k,Fn as n,vn as q}; diff --git a/assets/rasterizingUtils-4df93c6e.js b/assets/rasterizingUtils-4df93c6e.js new file mode 100644 index 0000000..83dbd81 --- /dev/null +++ b/assets/rasterizingUtils-4df93c6e.js @@ -0,0 +1 @@ +import{e4 as x,e5 as u}from"./index-080e108a.js";const C=e=>e==="vertical"||e==="horizontal"||e==="cross"||e==="esriSFSCross"||e==="esriSFSVertical"||e==="esriSFSHorizontal";function k(e,i,T){const F=x(Math.ceil(T)),a=C(i)?8*F:16*F,o=2*F;e.width=a,e.height=a;const t=e.getContext("2d");t.strokeStyle="#FFFFFF",t.lineWidth=F,t.beginPath(),i!=="vertical"&&i!=="cross"&&i!=="esriSFSCross"&&i!=="esriSFSVertical"||(t.moveTo(a/2,-o),t.lineTo(a/2,a+o)),i!=="horizontal"&&i!=="cross"&&i!=="esriSFSCross"&&i!=="esriSFSHorizontal"||(t.moveTo(-o,a/2),t.lineTo(a+o,a/2)),i!=="forward-diagonal"&&i!=="diagonal-cross"&&i!=="esriSFSDiagonalCross"&&i!=="esriSFSForwardDiagonal"||(t.moveTo(-o,-o),t.lineTo(a+o,a+o),t.moveTo(a-o,-o),t.lineTo(a+o,o),t.moveTo(-o,a-o),t.lineTo(o,a+o)),i!=="backward-diagonal"&&i!=="diagonal-cross"&&i!=="esriSFSBackwardDiagonal"&&i!=="esriSFSDiagonalCross"||(t.moveTo(a+o,-o),t.lineTo(-o,a+o),t.moveTo(o,-o),t.lineTo(-o,o),t.moveTo(a+o,a-o),t.lineTo(a-o,a+o)),t.stroke();const d=t.getImageData(0,0,e.width,e.height),s=new Uint8Array(d.data);let l;for(let n=0;n{let l,a,u,o,r;if(t.data)if(t.data instanceof ArrayBuffer){if(!(e!=="json"&&e!=="text"&&e!=="blob"||(l=new Blob([t.data]),e!=="json"&&e!=="text"||(c||(c=new FileReaderSync),o=c.readAsText(l),e!=="json")))){try{a=JSON.parse(o||null)}catch(i){const f={...i,url:n,requestOptions:s};throw new b("request:server",i.message,f)}if(a.error){const i={...a.error,url:n,requestOptions:s};throw new b("request:server",a.error.message,i)}}}else e==="native"&&(t.data.signal=p,u=await fetch(t.data.url,t.data),t.httpStatus=u.status);switch(e){case"blob":r=l;break;case"json":r=a;break;case"native":r=u;break;case"text":r=o;break;default:r=t.data}return{data:r,httpStatus:t.httpStatus,requestOptions:s,ssl:t.ssl,url:n}})}export{h as execute}; diff --git a/assets/resourceExtension-91e7c3ce.js b/assets/resourceExtension-91e7c3ce.js new file mode 100644 index 0000000..1ed1e5a --- /dev/null +++ b/assets/resourceExtension-91e7c3ce.js @@ -0,0 +1 @@ +import{c6 as o}from"./index-080e108a.js";function l(p){return i[e(p)]||c}function e(p){return p instanceof Blob?p.type:g(p.url)}function g(p){const a=o(p);return t[a]||n}const i={},n="text/plain",c=i[n],t={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const p in t)i[t[p]]=p;export{l as t}; diff --git a/assets/resourceUtils-b667b05b.js b/assets/resourceUtils-b667b05b.js new file mode 100644 index 0000000..9d339be --- /dev/null +++ b/assets/resourceUtils-b667b05b.js @@ -0,0 +1 @@ +import{c5 as o,ar as p,c6 as g,at as y}from"./index-080e108a.js";async function P(e,t={},r){await e.load(r);const a=o(e.itemUrl,"resources"),{start:n=1,num:u=10,sortOrder:c="asc",sortField:l="created"}=t,i={query:{start:n,num:u,sortOrder:c,sortField:l,token:e.apiKey},signal:r==null?void 0:r.signal},s=await e.portal.request(a,i);return{total:s.total,nextStart:s.nextStart,resources:s.resources.map(({created:h,size:f,resource:w})=>({created:new Date(h),size:f,resource:e.resourceFromPath(w)}))}}async function b(e,t,r,a){if(!e.hasPath())throw new p(`portal-item-resource-${t}:invalid-path`,"Resource does not have a valid path");const n=e.portalItem;await n.load(a);const u=o(n.userItemUrl,t==="add"?"addResources":"updateResources"),[c,l]=d(e.path),i=await R(r),s=new FormData;return c&&c!=="."&&s.append("resourcesPrefix",c),a!=null&&a.compress&&s.append("compress","true"),s.append("fileName",l),s.append("file",i,l),s.append("f","json"),a!=null&&a.access&&s.append("access",a.access),await n.portal.request(u,{method:"post",body:s,signal:a==null?void 0:a.signal}),e}async function q(e,t,r){if(!t.hasPath())throw new p("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const a=o(e.userItemUrl,"removeResources");await e.portal.request(a,{method:"post",query:{resource:t.path},signal:r==null?void 0:r.signal}),t.portalItem=null}async function x(e,t){await e.load(t);const r=o(e.userItemUrl,"removeResources");return e.portal.request(r,{method:"post",query:{deleteAll:!0},signal:t==null?void 0:t.signal})}function d(e){const t=e.lastIndexOf("/");return t===-1?[".",e]:[e.slice(0,t),e.slice(t+1)]}function m(e){const[t,r]=v(e),[a,n]=d(t);return[a,n,r]}function v(e){const t=g(e);return t==null?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}async function R(e){return e instanceof Blob?e:(await y(e.url,{responseType:"blob"})).data}function F(e,t){if(!e.hasPath())return null;const[r,,a]=m(e.path);return e.portalItem.resourceFromPath(o(r,t+a))}function O(e,t){if(!e.hasPath())return null;const[r,,a]=m(e.path);return e.portalItem.resourceFromPath(o(r,t+a))}export{b as addOrUpdateResource,R as contentToBlob,P as fetchResources,F as getSiblingOfSameType,O as getSiblingOfSameTypeI,x as removeAllResources,q as removeResource,m as splitPrefixFileNameAndExtension}; diff --git a/assets/ro_RO2-554c8802.js b/assets/ro_RO2-554c8802.js new file mode 100644 index 0000000..10941040 --- /dev/null +++ b/assets/ro_RO2-554c8802.js @@ -0,0 +1 @@ +const r={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"d.Hr.",_era_bc:"î.Hr.",A:"a.m.",P:"p.m.",AM:"a.m.",PM:"p.m.","A.M.":"a.m.","P.M.":"p.m.",January:"ianuarie",February:"februarie",March:"martie",April:"aprilie",May:"mai",June:"iunie",July:"iulie",August:"august",September:"septembrie",October:"octombrie",November:"noiembrie",December:"decembrie",Jan:"ian.",Feb:"feb.",Mar:"mar.",Apr:"apr.","May(short)":"mai",Jun:"iun.",Jul:"iul.",Aug:"aug.",Sep:"sept.",Oct:"oct.",Nov:"nov.",Dec:"dec.",Sunday:"duminică",Monday:"luni",Tuesday:"marți",Wednesday:"miercuri",Thursday:"joi",Friday:"vineri",Saturday:"sâmbătă",Sun:"dum.",Mon:"lun.",Tue:"mar.",Wed:"mie.",Thu:"joi",Fri:"vin.",Sat:"sâm.",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Zoom",Play:"Redare",Stop:"Oprire",Legend:"Legendă","Press ENTER to toggle":"",Loading:"Se încarcă",Home:"Pagina principală",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Imprimare",Image:"Imagine",Data:"Date",Print:"Imprimare","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Din %1 la %2","From %1":"Din %1","To %1":"La %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{r as default}; diff --git a/assets/ru_RU2-5b0bfec9.js b/assets/ru_RU2-5b0bfec9.js new file mode 100644 index 0000000..24d49fb --- /dev/null +++ b/assets/ru_RU2-5b0bfec9.js @@ -0,0 +1 @@ +const o={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - dd MMM",_date_hour:"HH:mm",_date_hour_full:"HH:mm - dd MMM",_date_day:"dd MMM",_date_day_full:"dd MMM",_date_week:"ww",_date_week_full:"dd MMM",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"н.э.",_era_bc:"до н.э.",A:"У",P:"В",AM:"утра",PM:"вечера","A.M.":"до полудня","P.M.":"после полудня",January:"января",February:"февраля",March:"марта",April:"апреля",May:"мая",June:"июня",July:"июля",August:"августа",September:"сентября",October:"октября",November:"ноября",December:"декабря",Jan:"янв.",Feb:"февр.",Mar:"март",Apr:"апр.","May(short)":"май",Jun:"июнь",Jul:"июль",Aug:"авг.",Sep:"сент.",Oct:"окт.",Nov:"нояб.",Dec:"дек.",Sunday:"воскресенье",Monday:"понедельник",Tuesday:"вторник",Wednesday:"среда",Thursday:"четверг",Friday:"пятница",Saturday:"суббота",Sun:"вс.",Mon:"пн.",Tue:"вт.",Wed:"ср.",Thu:"чт.",Fri:"пт.",Sat:"сб.",_dateOrd:function(e){return"-ое"},"Zoom Out":"Уменьшить",Play:"Старт",Stop:"Стоп",Legend:"Легенда","Press ENTER to toggle":"Щелкните, коснитесь или нажмите ВВОД, чтобы переключить",Loading:"Идет загрузка",Home:"Начало",Chart:"График","Serial chart":"Серийная диаграмма","X/Y chart":"Диаграмма X/Y","Pie chart":"Круговая диаграмма","Gauge chart":"Датчик-диаграмма","Radar chart":"Лепестковая диаграмма","Sankey diagram":"Диаграмма Сэнки","Chord diagram":"Диаграмма Chord","Flow diagram":"Диаграмма флоу","TreeMap chart":"Иерархическая диаграмма",Series:"Серия","Candlestick Series":"Серия-подсвечник","Column Series":"Столбчатая серия","Line Series":"Линейная серия","Pie Slice Series":"Круговая серия","X/Y Series":"X/Y серия",Map:"Карта","Press ENTER to zoom in":"Нажмите ВВОД чтобу увеличить","Press ENTER to zoom out":"Нажмите ВВОД чтобы уменьшить","Use arrow keys to zoom in and out":"Используйте клавиши-стрелки чтобы увеличить и уменьшить","Use plus and minus keys on your keyboard to zoom in and out":"Используйте клавиши плюс и минус на клавиатуре чтобы увеличить и уменьшить",Export:"Экспортировать",Image:"Изображение",Data:"Данные",Print:"Печатать","Press ENTER to open":"Щелкните, коснитесь или нажмите ВВОД чтобы открыть","Press ENTER to print.":"Щелкните, коснитесь или нажмите ВВОД чтобы распечатать","Press ENTER to export as %1.":"Щелкните, коснитесь или нажмите ВВОД чтобы экспортировать как %1",'To save the image, right-click this link and choose "Save picture as..."':'Чтобы сохранить изображение, щелкните правой кнопкой на ссылке и выберите "Сохранить изображение как..."','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Чтобы сохранить изображение, щелкните правой кнопкой на картинке слева и выберите "Сохранить изображение как..."',"(Press ESC to close this message)":"(Нажмите ESC чтобы закрыть это сообщение)","Image Export Complete":"Экспорт изображения завершен","Export operation took longer than expected. Something might have gone wrong.":"Экспортирование заняло дольше, чем планировалось. Возможно что-то пошло не так.","Saved from":"Сохранено из",PNG:"PNG",JPG:"JPG",GIF:"GIF",SVG:"SVG",PDF:"PDF",JSON:"JSON",CSV:"CSV",XLSX:"XLSX",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Используйте клавишу TAB, чтобы выбрать рукоятки или клавиши стрелок влево и вправо, чтобы изменить выделение","Use left and right arrows to move selection":"Используйте стрелки влево-вправо, чтобы передвинуть выделение","Use left and right arrows to move left selection":"Используйте стрелки влево-вправо, чтобы передвинуть левое выделение","Use left and right arrows to move right selection":"Используйте стрелки влево-вправо, чтобы передвинуть правое выделение","Use TAB select grip buttons or up and down arrows to change selection":"Используйте TAB, чтобы выбрать рукоятки или клавиши вверх-вниз, чтобы изменить выделение","Use up and down arrows to move selection":"Используйте стрелки вверх-вниз, чтобы передвинуть выделение","Use up and down arrows to move lower selection":"Используйте стрелки вверх-вниз, чтобы передвинуть нижнее выделение","Use up and down arrows to move upper selection":"Используйте стрелки вверх-вниз, чтобы передвинуть верхнее выделение","From %1 to %2":"От %1 до %2","From %1":"От %1","To %1":"До %1","No parser available for file: %1":"Нет анализатора для файла: %1","Error parsing file: %1":"Ошибка при разборе файла: %1","Unable to load file: %1":"Не удалось загрузить файл: %1","Invalid date":"Некорректная дата"};export{o as default}; diff --git a/assets/scrim-ffa718f9.js b/assets/scrim-ffa718f9.js new file mode 100644 index 0000000..f62ef67 --- /dev/null +++ b/assets/scrim-ffa718f9.js @@ -0,0 +1,5 @@ +import{f6 as c,f7 as o,fe as l,f9 as t}from"./index-080e108a.js";import{u as r,c as d,a as h,s as m,d as f,b as g}from"./t9n-537805d4.js";import{c as u}from"./observers-4ce6e1b4.js";import{d as p}from"./loader-2996ba2a.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const i={scrim:"scrim",content:"content"},n={s:72,l:480},v=":host{position:absolute;inset:0px;z-index:var(--calcite-app-z-index-overlay);display:flex;block-size:100%;inline-size:100%;flex-direction:column;align-items:stretch}@keyframes calcite-scrim-fade-in{0%{--tw-bg-opacity:0}100%{--tw-text-opacity:1}}.scrim{position:absolute;inset:0px;display:flex;flex-direction:column;align-content:center;align-items:center;justify-content:center;overflow:hidden;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-scrim-background, var(--calcite-scrim-background-internal))}.content{padding:1rem}:host([hidden]){display:none}[hidden]{display:none}",C=c(class extends o{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.resizeObserver=u("resize",()=>this.handleResize()),this.handleDefaultSlotChange=e=>{this.hasContent=l(e)},this.storeLoaderEl=e=>{this.loaderEl=e,this.handleResize()},this.loading=!1,this.messages=void 0,this.messageOverrides=void 0,this.loaderScale=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.hasContent=!1}onMessagesChange(){}effectiveLocaleChange(){r(this,this.effectiveLocale)}connectedCallback(){var e;d(this),h(this),(e=this.resizeObserver)==null||e.observe(this.el)}async componentWillLoad(){await m(this)}disconnectedCallback(){var e;f(this),g(this),(e=this.resizeObserver)==null||e.disconnect()}render(){const{hasContent:e,loading:s,messages:a}=this;return t("div",{class:i.scrim},s?t("calcite-loader",{label:a.loading,ref:this.storeLoaderEl,scale:this.loaderScale}):null,t("div",{class:i.content,hidden:!e},t("slot",{onSlotchange:this.handleDefaultSlotChange})))}getScale(e){return e=n.l?"l":"m"}handleResize(){const{loaderEl:e,el:s}=this;e&&(this.loaderScale=this.getScale(Math.min(s.clientHeight,s.clientWidth)??0))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return v}},[1,"calcite-scrim",{loading:[516],messages:[1040],messageOverrides:[1040],loaderScale:[32],defaultMessages:[32],effectiveLocale:[32],hasContent:[32]}]);function b(){if(typeof customElements>"u")return;["calcite-scrim","calcite-loader"].forEach(s=>{switch(s){case"calcite-scrim":customElements.get(s)||customElements.define(s,C);break;case"calcite-loader":customElements.get(s)||p();break}})}b();export{b as d}; diff --git a/assets/serviceCapabilitiesUtils-959e798a.js b/assets/serviceCapabilitiesUtils-959e798a.js new file mode 100644 index 0000000..831a673 --- /dev/null +++ b/assets/serviceCapabilitiesUtils-959e798a.js @@ -0,0 +1 @@ +import{ai as d,aj as C,al as f,ck as Q,aF as w,bW as R,cn as F,cB as x}from"./index-080e108a.js";var g;let a=g=class extends Q{constructor(s){super(s),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new w}clone(){return new g({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};d([C({type:String,json:{write:!0}})],a.prototype,"floorField",void 0),d([C({json:{read:!1,write:!1}})],a.prototype,"viewAllMode",void 0),d([C({json:{read:!1,write:!1}})],a.prototype,"viewAllLevelIds",void 0),a=g=d([f("esri.layers.support.LayerFloorInfo")],a);const L=a,T={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function t(s,e,r){return!!A(s,e,r)}function y(s,e,r){return A(s,e,r)}function A(s,e,r){return s&&s.hasOwnProperty(e)?s[e]:r}function M(s){var r;const e=(r=s==null?void 0:s.supportedSpatialAggregationStatistics)==null?void 0:r.map(o=>o.toLowerCase());return{envelope:!!(e!=null&&e.includes("envelopeaggregate")),centroid:!!(e!=null&&e.includes("centroidaggregate")),convexHull:!!(e!=null&&e.includes("convexhullaggregate"))}}function c(s,e){var o;const r=(o=s==null?void 0:s.supportedOperationsWithCacheHint)==null?void 0:o.map(p=>p.toLowerCase());return!!(r!=null&&r.includes(e.toLowerCase()))}function U(s,e){return{analytics:E(s),attachment:D(s),data:I(s),metadata:b(s),operations:z(s.capabilities,s,e),query:O(s,e),queryRelated:P(s),queryTopFeatures:q(s),editing:B(s)}}function E(s){return{supportsCacheHint:c(s.advancedQueryCapabilities,"queryAnalytics")}}function D(s){const e=s.attachmentProperties,r={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:c(s.advancedQueryCapabilities,"queryAttachments"),supportsResize:t(s,"supportsAttachmentsResizing",!1)};return e&&Array.isArray(e)&&e.forEach(o=>{const p=T[o.name];p&&(r[p]=!!o.isEnabled)}),r}function I(s){return{isVersioned:t(s,"isDataVersioned",!1),supportsAttachment:t(s,"hasAttachments",!1),supportsM:t(s,"hasM",!1),supportsZ:t(s,"hasZ",!1)}}function b(s){return{supportsAdvancedFieldProperties:t(s,"supportsFieldDescriptionProperty",!1)}}function z(s,e,r){const o=s?s.toLowerCase().split(",").map(S=>S.trim()):[],p=r?R(r):null,h=o.includes(p!=null&&p.serverType==="MapServer"?"data":"query"),u=o.includes("editing")&&!e.datesInUnknownTimezone;let i=u&&o.includes("create"),n=u&&o.includes("delete"),l=u&&o.includes("update");const m=o.includes("changetracking"),v=e.advancedQueryCapabilities;return u&&!(i||n||l)&&(i=n=l=!0),{supportsCalculate:t(e,"supportsCalculate",!1),supportsTruncate:t(e,"supportsTruncate",!1),supportsValidateSql:t(e,"supportsValidateSql",!1),supportsAdd:i,supportsDelete:n,supportsEditing:u,supportsChangeTracking:m,supportsQuery:h,supportsQueryAnalytics:t(v,"supportsQueryAnalytic",!1),supportsQueryAttachments:t(v,"supportsQueryAttachments",!1),supportsQueryTopFeatures:t(v,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:t(e,"supportsAttachmentsResizing",!1),supportsSync:o.includes("sync"),supportsUpdate:l,supportsExceedsLimitStatistics:t(e,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:t(e,"supportsAsyncConvert3D",!1)}}function O(s,e){const r=s.advancedQueryCapabilities,o=s.ownershipBasedAccessControlForFeatures,p=s.archivingInfo,h=s.currentVersion,u=e==null?void 0:e.includes("MapServer"),i=!u||h>=F("mapserver-pbf-version-support"),n=x(e),l=new Set((s.supportedQueryFormats??"").split(",").map(m=>m.toLowerCase().trim()));return{supportsStatistics:t(r,"supportsStatistics",s.supportsStatistics),supportsPercentileStatistics:t(r,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:t(r,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:M(r),supportsCentroid:t(r,"supportsReturningGeometryCentroid",!1),supportsDistance:t(r,"supportsQueryWithDistance",!1),supportsDistinct:t(r,"supportsDistinct",s.supportsAdvancedQueries),supportsExtent:t(r,"supportsReturningQueryExtent",!1),supportsGeometryProperties:t(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:t(r,"supportsHavingClause",!1),supportsOrderBy:t(r,"supportsOrderBy",s.supportsAdvancedQueries),supportsPagination:t(r,"supportsPagination",!1),supportsQuantization:t(s,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:t(s,"supportsQuantizationEditMode",!1),supportsQueryGeometry:t(s,"supportsReturningQueryGeometry",!1),supportsResultType:t(r,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:t(r,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:t(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:t(s,"useStandardizedQueries",!1),supportsTopFeaturesQuery:t(r,"supportsTopFeaturesQuery",!1),supportsQueryByOthers:t(o,"allowOthersToQuery",!0),supportsHistoricMoment:t(p,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:i&&l.has("pbf"),supportsDisjointSpatialRelationship:t(r,"supportsDisjointSpatialRel",!1),supportsCacheHint:t(r,"supportsQueryWithCacheHint",!1)||c(r,"query"),supportsDefaultSpatialReference:t(r,"supportsDefaultSR",!1),supportsCompactGeometry:n,supportsFullTextSearch:t(r,"supportsFullTextSearch",!1),maxRecordCountFactor:y(s,"maxRecordCountFactor",void 0),maxRecordCount:y(s,"maxRecordCount",void 0),standardMaxRecordCount:y(s,"standardMaxRecordCount",void 0),tileMaxRecordCount:y(s,"tileMaxRecordCount",void 0)}}function P(s){const e=s.advancedQueryCapabilities,r=t(e,"supportsAdvancedQueryRelated",!1);return{supportsPagination:t(e,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r,supportsCacheHint:c(e,"queryRelated")}}function q(s){return{supportsCacheHint:c(s.advancedQueryCapabilities,"queryTopFilter")}}function B(s){const e=s.ownershipBasedAccessControlForFeatures,r=s?s.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:t(s,"allowGeometryUpdates",!0),supportsGlobalId:t(s,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:t(s,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:t(s,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:t(s,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:t(s,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:t(e,"allowAnonymousToDelete",!0),supportsDeleteByOthers:t(e,"allowOthersToDelete",!0),supportsUpdateByAnonymous:t(e,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:t(e,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:t(r,"supportsAsyncApplyEdits",!1)}}export{U as n,L as p}; diff --git a/assets/sk_SK2-feee92a1.js b/assets/sk_SK2-feee92a1.js new file mode 100644 index 0000000..e6b2e46 --- /dev/null +++ b/assets/sk_SK2-feee92a1.js @@ -0,0 +1 @@ +const _={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - yyyy-MM-dd",_date_hour:"HH:mm",_date_hour_full:"HH:mm - yyyy-MM-dd",_date_day:"MMM dd",_date_day_full:"yyyy-MM-dd",_date_week:"ww",_date_week_full:"yyyy-MM-dd",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n. l.",_era_bc:"pr. n. l.",A:"dop.",P:"odp.",AM:"dop.",PM:"odp.","A.M.":"dop.","P.M.":"odp.",January:"januára",February:"februára",March:"marca",April:"apríla",May:"mája",June:"júna",July:"júla",August:"augusta",September:"septembra",October:"októbra",November:"novembra",December:"decembra",Jan:"jan",Feb:"feb",Mar:"mar",Apr:"apr","May(short)":"máj",Jun:"jún",Jul:"júl",Aug:"aug",Sep:"sep",Oct:"okt",Nov:"nov",Dec:"dec",Sunday:"nedela",Monday:"pondelok",Tuesday:"utorok",Wednesday:"streda",Thursday:"štvrtok",Friday:"piatok",Saturday:"sobota",Sun:"ne",Mon:"po",Tue:"ut",Wed:"st",Thu:"št",Fri:"pi",Sat:"so",_dateOrd:function(e){return"."},"Zoom Out":"Zväčšenie",Play:"Prehrať",Stop:"Ukončiť iteráciu (Stop)",Legend:"Legenda","Click, tap or press ENTER to toggle":"",Loading:"Načítanie",Home:"Domov",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Export",Image:"Obrázok",Data:"Data",Print:"Tlač","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{_ as default}; diff --git a/assets/sl_SL2-56e581d6.js b/assets/sl_SL2-56e581d6.js new file mode 100644 index 0000000..5baba05 --- /dev/null +++ b/assets/sl_SL2-56e581d6.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n. št.",_era_bc:"pr. n. št.",A:"A",P:"P",AM:"AM",PM:"PM","A.M.":"A.M.","P.M.":"P.M.",January:"Januar",February:"Februar",March:"Marec",April:"April",May:"Maj",June:"Junij",July:"Julij",August:"Avgust",September:"September",October:"Oktober",November:"November",December:"December",Jan:"Jan",Feb:"Feb",Mar:"Mar",Apr:"Apr","May(short)":"Maj",Jun:"Jun",Jul:"Jul",Aug:"Avg",Sep:"Sep",Oct:"Okt",Nov:"Nov",Dec:"Dec",Sunday:"Nedelja",Monday:"Ponedeljek",Tuesday:"Torek",Wednesday:"Sreda",Thursday:"Četrtek",Friday:"Petek",Saturday:"Sobota",Sun:"Ned",Mon:"Pon",Tue:"Tor",Wed:"Sre",Thu:"Čet",Fri:"Pet",Sat:"Sob",_dateOrd:function(e){return"."},"Zoom Out":"Oddalji pogled",Play:"Zaženi",Stop:"Ustavi",Legend:"Legenda","Press ENTER to toggle":"Klikni, tapni ali pritisni ENTER za preklop",Loading:"Nalagam",Home:"Domov",Chart:"Graf","Serial chart":"Serijski graf","X/Y chart":"X/Y graf","Pie chart":"Tortni graf","Gauge chart":"Stevčni graf","Radar chart":"Radar graf","Sankey diagram":"Sankey diagram","Flow diagram":"Prikaz poteka","Chord diagram":"Kolobarni diagram","TreeMap chart":"Drevesi graf","Sliced chart":"Sliced graf",Series:"Serija","Candlestick Series":"Svečna serija","OHLC Series":"OHLC serija","Column Series":"Stolpičasta serija","Line Series":"Črtna serija","Pie Slice Series":"Tortna serija","Funnel Series":"Lijak serija","Pyramid Series":"Piramidna serija","X/Y Series":"X/Y serija",Map:"Mapa","Press ENTER to zoom in":"Pritisni ENTER za približevanje","Press ENTER to zoom out":"Pritisni ENTER za oddaljevanje","Use arrow keys to zoom in and out":"Uporabi smerne tiple za približevanje in oddaljevanje","Use plus and minus keys on your keyboard to zoom in and out":"Uporabi plus in minus tipke na tipkovnici za približevanje in oddaljevanje",Export:"Izvozi",Image:"Slika",Data:"Podatki",Print:"Natisni","Press ENTER to open":"Klikni, tapni ali pritisni ENTER da odpreš.","Press ENTER to print.":"Klikni, tapni ali pritisni ENTER za tiskanje.","Press ENTER to export as %1.":"Klikni, tapni ali pritisni ENTER da izvoziš kot %1.","(Press ESC to close this message)":"(Pritisni ESC da zapreš to sporočilo)","Image Export Complete":"Izvoz slike končan","Export operation took longer than expected. Something might have gone wrong.":"Operacija izvoza je trajala dlje kot pričakovano. Nekaj je šlo narobe.","Saved from":"Shranjeno od",PNG:"PNG",JPG:"JPG",GIF:"GIF",SVG:"SVG",PDF:"PDF",JSON:"JSON",CSV:"CSV",XLSX:"XLSX",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Uporabi TAB za izbiro drsnih gumbov ali levo in desno smerno tipko da spremeniš izbiro","Use left and right arrows to move selection":"Uporabi levo in desno smerno tipko za premik izbranega","Use left and right arrows to move left selection":"Uporabi levo in desno smerno tipko za premik leve izbire","Use left and right arrows to move right selection":"Uporabi levo in desno smerno tipko za premik desne izbire","Use TAB select grip buttons or up and down arrows to change selection":"Uporabi TAB za izbiro drsnih gumbov ali gor in dol smerno tipko da spremeniš izbiro","Use up and down arrows to move selection":"Uporabi gor in dol smerne tipke za premik izbire","Use up and down arrows to move lower selection":"Uporabi gor in dol smerne tipke za premik spodnje izbire","Use up and down arrows to move upper selection":"Uporabi gor in dol smerne tipke za premik zgornje izbire","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"Nobenega parserja ni na voljo za datoteko: %1","Error parsing file: %1":"Napaka pri parsanju datoteke: %1","Unable to load file: %1":"Ni mogoče naložiti datoteke: %1","Invalid date":"Neveljaven datum"};export{a as default}; diff --git a/assets/sourceUtils-e3b344c8.js b/assets/sourceUtils-e3b344c8.js new file mode 100644 index 0000000..a7a7f71 --- /dev/null +++ b/assets/sourceUtils-e3b344c8.js @@ -0,0 +1 @@ +import{ew as m,ex as p,bR as y,ey as g,ez as w,eA as f,aw as _}from"./index-080e108a.js";class b{constructor(){this.code=null,this.description=null}}class I{constructor(n){this.error=new b,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=n}}function d(e){return new I(e)}class v{constructor(n){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=n}}function V(e){return new v(e)}const a=new Set;function j(e,n,i,h=!1,u){a.clear();for(const s in i){const t=e.get(s);if(!t)continue;const l=i[s],r=q(t,l);if(r!==l&&u&&u.push({name:"invalid-value-type",message:"attribute value was converted to match the field type",details:{field:t,originalValue:l,sanitizedValue:r}}),a.add(t.name),t&&(h||t.editable)){const c=m(t,r);if(c)return d(p(c,t,r));n[t.name]=r}}for(const s of(e==null?void 0:e.requiredFields)??[])if(!a.has(s.name))return d(`missing required field "${s.name}"`);return null}function q(e,n){let i=n;return typeof n=="string"&&y(e)?i=parseFloat(n):n!=null&&g(e)&&typeof n!="string"&&(i=String(n)),w(i)}let o;function x(e,n){if(!e||!f(n))return e;if("rings"in e||"paths"in e){if(o==null)throw new TypeError("geometry engine not loaded");return o.simplify(n,e)}return e}async function P(){return o==null&&(o=await _(()=>import("./geometryEngineJSON-c939b27e.js"),["assets/geometryEngineJSON-c939b27e.js","assets/geometryEngineBase-324c1c81.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/geometryEngineJSON-b173802a.js","assets/json-48e3ea08.js"])),o}async function z(e,n){!f(e)||n!=="esriGeometryPolygon"&&n!=="esriGeometryPolyline"||await P()}export{V as c,j as d,x as h,d as u,z as y}; diff --git a/assets/sql-734ecbc5.js b/assets/sql-734ecbc5.js new file mode 100644 index 0000000..7a99e00 --- /dev/null +++ b/assets/sql-734ecbc5.js @@ -0,0 +1 @@ +import{aw as o}from"./index-080e108a.js";async function u(r,t){const{WhereClause:e}=await o(()=>import("./WhereClause-c86b9974.js").then(n=>n.W),["assets/WhereClause-c86b9974.js","assets/index-080e108a.js","assets/index-a8e73b5e.css","assets/executionError-c92d3b85.js"]);return e.create(r,t)}function i(r,t){return r!=null?t!=null?`(${r}) AND (${t})`:r:t}export{u as e,i as n}; diff --git a/assets/sr_RS2-dba2ad75.js b/assets/sr_RS2-dba2ad75.js new file mode 100644 index 0000000..296aa09 --- /dev/null +++ b/assets/sr_RS2-dba2ad75.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"н. е.",_era_bc:"п. н. е.",A:"a",P:"p",AM:"пре подне",PM:"по подне","A.M.":"пре подне","P.M.":"по подне",January:"јануар",February:"фебруар",March:"март",April:"април",May:"мај",June:"јун",July:"јул",August:"август",September:"септембар",October:"октобар",November:"новембар",December:"децембар",Jan:"јан",Feb:"феб",Mar:"мар",Apr:"апр","May(short)":"мај",Jun:"јун",Jul:"јул",Aug:"авг",Sep:"сеп",Oct:"окт",Nov:"нов",Dec:"дец",Sunday:"недеља",Monday:"понедељак",Tuesday:"уторак",Wednesday:"среда",Thursday:"четвртак",Friday:"петак",Saturday:"субота",Sun:"нед",Mon:"пон",Tue:"уто",Wed:"сре",Thu:"чет",Fri:"пет",Sat:"суб",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Zumiranje",Play:"Reprodukuj",Stop:"Zaustavi",Legend:"Legenda","Press ENTER to toggle":"",Loading:"Učitavanje",Home:"Matična stranica",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Štampaj",Image:"Snimak",Data:"Podaci",Print:"Štampaj","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Iz %1 u %2","From %1":"Iz %1","To %1":"U %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{a as default}; diff --git a/assets/statsWorker-99ee7c16.js b/assets/statsWorker-99ee7c16.js new file mode 100644 index 0000000..61d0a35 --- /dev/null +++ b/assets/statsWorker-99ee7c16.js @@ -0,0 +1 @@ +import{gO as N,dD as S,c7 as O,gP as A,bA as G,bc as B,bF as R}from"./index-080e108a.js";import{y as j,m as q}from"./heatmapUtils-327ef4c5.js";import{c as M,z as Y,m as _,f as k,d as L,g as U,x as Z,F as H,D as J,S as K,M as Q}from"./utils-2fe9d339.js";import"./generateRendererUtils-1e52a587.js";let v=null;function W(e,a,l){return e.x<0?e.x+=a:e.x>l&&(e.x-=a),e}function X(e,a,l,o){const n=N(l)?S(l):null,s=n?Math.round((n.valid[1]-n.valid[0])/a.scale[0]):null;return e.map(t=>{const i=new O(t.geometry);return A(a,i,i,i.hasZ,i.hasM),t.geometry=n?W(i,s??0,o[0]):i,t})}function aa(e,a=18,l,o,n,s){const t=new Float64Array(n*s);a=Math.round(R(a));let i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,m=0,f=0,d=0,c=0;const z=j(o,l);for(const{geometry:T,attributes:y}of e){const{x:p,y:u}=T,x=Math.max(0,p-a),F=Math.max(0,u-a),g=Math.min(s,u+a),D=Math.min(n,p+a),E=+z(y);for(let $=F;$r&&(r=m),c++}}if(!c)return{mean:0,stddev:0,min:0,max:0,mid:0,count:0};const I=(r-i)/2;return{mean:f/c,stdDev:Math.sqrt((d-f*f/c)/c),min:i,max:r,mid:I,count:c}}async function w(e,a){if(!a)return[];const{field:l,field2:o,field3:n,fieldDelimiter:s}=e,t=e.valueExpression,i=e.normalizationType,r=e.normalizationField,m=e.normalizationTotal,f=[],d=e.viewInfoParams;let c=null,z=null;if(t){if(!v){const{arcadeUtils:y}=await G();v=y}v.hasGeometryOperations(t)&&await v.enableGeometryOperations(),c=v.createFunction(t),z=d&&v.getViewInfo({viewingMode:d.viewingMode,scale:d.scale,spatialReference:new B(d.spatialReference)})}const I=e.fieldInfos,T=!(a[0]&&"declaredClass"in a[0]&&a[0].declaredClass==="esri.Graphic")&&I?{fields:I}:null;return a.forEach(y=>{const p=y.attributes;let u;if(t){const x=T?{...y,layer:T}:y,F=v.createExecContext(x,z);u=v.executeFunction(c,F)}else p&&(u=p[l],o&&(u=`${M(u)}${s}${M(p[o])}`,n&&(u=`${u}${s}${M(p[n])}`)));if(i&&typeof u=="number"&&isFinite(u)){const x=p&&parseFloat(p[r]);u=Y(u,i,x,m)}f.push(u)}),f}async function oa(e){const{attribute:a,features:l}=e,{normalizationType:o,normalizationField:n,minValue:s,maxValue:t,fieldType:i}=a,r=await w({field:a.field,valueExpression:a.valueExpression,normalizationType:o,normalizationField:n,normalizationTotal:a.normalizationTotal,viewInfoParams:a.viewInfoParams,fieldInfos:a.fieldInfos},l),m=_({normalizationType:o,normalizationField:n,minValue:s,maxValue:t}),f={value:.5,fieldType:i},d=i==="esriFieldTypeString"?k({values:r,supportsNullCount:m,percentileParams:f}):L({values:r,minValue:s,maxValue:t,useSampleStdDev:!o,supportsNullCount:m,percentileParams:f});return U(d,i==="esriFieldTypeDate")}async function la(e){const{attribute:a,features:l}=e,o=await w({field:a.field,field2:a.field2,field3:a.field3,fieldDelimiter:a.fieldDelimiter,valueExpression:a.valueExpression,viewInfoParams:a.viewInfoParams,fieldInfos:a.fieldInfos},l),n=Z(o);return H(n,a.domains,a.returnAllCodedValues,a.fieldDelimiter)}async function sa(e){const{attribute:a,features:l}=e,{field:o,normalizationType:n,normalizationField:s,normalizationTotal:t,classificationMethod:i}=a,r=await w({field:o,valueExpression:a.valueExpression,normalizationType:n,normalizationField:s,normalizationTotal:t,viewInfoParams:a.viewInfoParams,fieldInfos:a.fieldInfos},l),m=J(r,{field:o,normalizationType:n,normalizationField:s,normalizationTotal:t,classificationMethod:i,standardDeviationInterval:a.standardDeviationInterval,numClasses:a.numClasses,minValue:a.minValue,maxValue:a.maxValue});return K(m,i)}async function ra(e){const{attribute:a,features:l}=e,{field:o,normalizationType:n,normalizationField:s,normalizationTotal:t,classificationMethod:i}=a,r=await w({field:o,valueExpression:a.valueExpression,normalizationType:n,normalizationField:s,normalizationTotal:t,viewInfoParams:a.viewInfoParams,fieldInfos:a.fieldInfos},l);return Q(r,{field:o,normalizationType:n,normalizationField:s,normalizationTotal:t,classificationMethod:i,standardDeviationInterval:a.standardDeviationInterval,numBins:a.numBins,minValue:a.minValue,maxValue:a.maxValue})}async function ma(e){const{attribute:a,features:l}=e,{field:o,radius:n,fieldOffset:s,transform:t,spatialReference:i}=a,r=a.size??[0,0],m=X(l??[],t,i,r),{count:f,min:d,max:c,mean:z,stdDev:I}=aa(m,n??void 0,s,o,r[0],r[1]);return{count:f,min:d,max:c,avg:z,stddev:I}}export{sa as classBreaks,ma as heatmapStatistics,ra as histogram,oa as summaryStatistics,la as uniqueValues}; diff --git a/assets/styleUtils-25825fd6.js b/assets/styleUtils-25825fd6.js new file mode 100644 index 0000000..d88ad1b --- /dev/null +++ b/assets/styleUtils-25825fd6.js @@ -0,0 +1 @@ +import{b7 as o,ax as c,b8 as g}from"./index-080e108a.js";async function l(r,e,a){const s=r&&r.getAtOrigin&&r.getAtOrigin("renderer",e.origin);if(s&&s.type==="unique-value"&&s.styleOrigin){const n=await o(s.populateFromStyle());if(c(a),n.ok===!1){const t=n.error;e&&e.messages&&e.messages.push(new g("renderer:style-reference",`Failed to create unique value renderer from style reference: ${t.message}`,{error:t,context:e})),r.clear("renderer",e==null?void 0:e.origin)}}}export{l as t}; diff --git a/assets/sublayerUtils-1269bca6.js b/assets/sublayerUtils-1269bca6.js new file mode 100644 index 0000000..4f4aa3c --- /dev/null +++ b/assets/sublayerUtils-1269bca6.js @@ -0,0 +1 @@ +import{c_ as l}from"./index-080e108a.js";function s(i,r,e){return r.flatten(({sublayers:n})=>n).length!==i.length?!0:!!i.some(n=>n.originIdOf("minScale")>e||n.originIdOf("maxScale")>e||n.originIdOf("renderer")>e||n.originIdOf("labelingInfo")>e||n.originIdOf("opacity")>e||n.originIdOf("labelsVisible")>e||n.originIdOf("source")>e)||!f(i,r)}function g(i,r,e){return!!i.some(o=>{const n=o.source;return!(!n||n.type==="map-layer"&&n.mapLayerId===o.id&&(n.gdbVersion==null||n.gdbVersion===e))||o.originIdOf("renderer")>l.SERVICE||o.originIdOf("labelingInfo")>l.SERVICE||o.originIdOf("opacity")>l.SERVICE||o.originIdOf("labelsVisible")>l.SERVICE})||!f(i,r)}function f(i,r){if(!i||!i.length||r==null)return!0;const e=r.slice().reverse().flatten(({sublayers:t})=>t&&t.toArray().reverse()).map(t=>t.id).toArray();if(i.length>e.length)return!1;let o=0;const n=e.length;for(const{id:t}of i){for(;o=n)return!1}return!0}function u(i){return!!i&&i.some(r=>r.minScale!=null||r.layerDefinition&&r.layerDefinition.minScale!=null)}export{s as e,g as n,u as o}; diff --git a/assets/sv_SE2-e6ae4e09.js b/assets/sv_SE2-e6ae4e09.js new file mode 100644 index 0000000..914da77 --- /dev/null +++ b/assets/sv_SE2-e6ae4e09.js @@ -0,0 +1 @@ +const r={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - yyyy-MM-dd",_date_hour:"HH:mm",_date_hour_full:"HH:mm - yyyy-MM-dd",_date_day:"yyyy-MM-dd",_date_day_full:"yyyy-MM-dd",_date_week:"ww",_date_week_full:"yyyy-MM-dd",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"e.Kr.",_era_bc:"f.Kr.",A:"fm",P:"em",AM:"fm",PM:"em","A.M.":"f.m.","P.M.":"e.m.",January:"januari",February:"februari",March:"mars",April:"april",May:"maj",June:"juni",July:"juli",August:"augusti",September:"september",October:"oktober",November:"november",December:"december",Jan:"jan.",Feb:"feb.",Mar:"mars",Apr:"apr.","May(short)":"maj",Jun:"juni",Jul:"juli",Aug:"aug.",Sep:"sep.",Oct:"okt.",Nov:"nov.",Dec:"dec.",Sunday:"söndag",Monday:"måndag",Tuesday:"tisdag",Wednesday:"onsdag",Thursday:"torsdag",Friday:"fredag",Saturday:"lördag",Sun:"sön",Mon:"mån",Tue:"tis",Wed:"ons",Thu:"tor",Fri:"fre",Sat:"lör",_dateOrd:function(e){return""},"Zoom Out":"Zooma ut",Play:"Spela",Stop:"Stoppa",Legend:"Teckenförklaring","Press ENTER to toggle":"Klicka eller tryck ENTER för att ändra",Loading:"Läser in",Home:"Hem",Chart:"Diagram","Serial chart":"Seriediagram","X/Y chart":"XY-diagram","Pie chart":"Tårtdiagram","Gauge chart":"Instrumentdiagram","Radar chart":"Radardiagram","Sankey diagram":"Sankeydiagram","Chord diagram":"Strängdiagram","Flow diagram":"Flödesschema","TreeMap chart":"Träddiagram ",Series:"Serier","Candlestick Series":"Candlestick-serier","Column Series":"Kolumnserier","Line Series":"Linjeserier","Pie Slice Series":"Tårtserier","X/Y Series":"X/Y-serier",Map:"Karta","Press ENTER to zoom in":"Tryck RETUR för att zooma in","Press ENTER to zoom out":"Tryck RETUR för att zooma ut","Use arrow keys to zoom in and out":"Använd pil-knapparna för att zooma in och ut","Use plus and minus keys on your keyboard to zoom in and out":"Använd plus- och minus-knapparna för att zooma in och ut",Export:"Exportera",Image:"Bild",Data:"Data",Print:"Skriv ut","Press ENTER to open":"Klicka eller tryck ENTER för att öppna","Press ENTER to print.":"Klicka eller tryck ENTER för att skriva ut.","Press ENTER to export as %1.":"Klicka eller tryck ENTER för att exportera till %1.","(Press ESC to close this message)":"(Tryck ESC för att stänga)","Image Export Complete":"Bildexport klar","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"Sparad från",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"Använd vänster och höger pilknappar för att flytta urvalet","Use left and right arrows to move left selection":"Använd vänster och höger pilknappar för att flytta vänsterurval","Use left and right arrows to move right selection":"Använd vänster och höger pilknappar för att flytta högerurval","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"Använd upp och ner pilknappar för att flytta urvalet","Use up and down arrows to move lower selection":"Använd upp och ner pilknappar för att flytta nedre urvalet","Use up and down arrows to move upper selection":"Använd upp och ner pilknappar för att flytta övre urvalet","From %1 to %2":"Från %1 till %2","From %1":"Från %1","To %1":"Till %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"Ogiltigt datum"};export{r as default}; diff --git a/assets/symbolLayerUtils-16974b32.js b/assets/symbolLayerUtils-16974b32.js new file mode 100644 index 0000000..4e48215 --- /dev/null +++ b/assets/symbolLayerUtils-16974b32.js @@ -0,0 +1 @@ +import{bx as v,ar as n,at as y,aw as p,eN as c,dw as w,eO as b,dT as l}from"./index-080e108a.js";let s=f();function f(){return new v(50)}function T(){s=f()}async function x(r,i){var o,t;if((o=r.resource)!=null&&o.href)return _(r.resource.href).then(e=>[e.width,e.height]);if((t=r.resource)!=null&&t.primitive)return i!=null?[i,i]:[256,256];throw new n("symbol3d:invalid-symbol-layer","symbol layers of type Icon must have either an href or a primitive resource")}function _(r){return y(r,{responseType:"image"}).then(i=>i.data)}async function B(r,i=null){var t;if(!r.isPrimitive){const e=r.resource.href;if(!e)throw new n("symbol:invalid-resource","The symbol does not have a valid resource");const a=s.get(e);if(a!==void 0)return a;const{fetch:h}=await p(()=>import("./index-080e108a.js").then(d=>d.uR),["assets/index-080e108a.js","assets/index-a8e73b5e.css"]),m=await h(e,{disableTextures:!0}),u=c(m.referenceBoundingBox,l());return s.put(e,u),u}if(!((t=r.resource)!=null&&t.primitive))throw new n("symbol:invalid-resource","The symbol does not have a valid resource");const o=w(b(r.resource.primitive));if(i!=null)for(let e=0;e="5"),this.isNegative=t.charAt(0)==="-"}getIntegersAndDecimals(){const t=this.value.toString().replace("-","").padStart(i.DECIMALS+1,"0"),s=t.slice(0,-i.DECIMALS),n=t.slice(-i.DECIMALS).replace(T,"");return{integers:s,decimals:n}}toString(){const{integers:t,decimals:s}=this.getIntegersAndDecimals();return`${this.isNegative?"-":""}${t}${s.length?"."+s:""}`}formatToParts(t){const{integers:s,decimals:n}=this.getIntegersAndDecimals(),r=t.numberFormatter.formatToParts(BigInt(s));return this.isNegative&&r.unshift({type:"minusSign",value:t.minusSign}),n.length&&(r.push({type:"decimal",value:t.decimal}),n.split("").forEach(a=>r.push({type:"fraction",value:a}))),r}format(t){const{integers:s,decimals:n}=this.getIntegersAndDecimals(),r=`${this.isNegative?t.minusSign:""}${t.numberFormatter.format(BigInt(s))}`,a=n.length?`${t.decimal}${n.split("").map(l=>t.numberFormatter.format(Number(l))).join("")}`:"";return`${r}${a}`}add(t){return i.fromBigInt(this.value+new i(t).value)}subtract(t){return i.fromBigInt(this.value-new i(t).value)}multiply(t){return i._divRound(this.value*new i(t).value,i.SHIFT)}divide(t){return i._divRound(this.value*i.SHIFT,new i(t).value)}}i.DECIMALS=100;i.ROUNDED=!0;i.SHIFT=BigInt("1"+"0".repeat(i.DECIMALS));i._divRound=(e,t)=>i.fromBigInt(e/t+(i.ROUNDED?e*BigInt(2)/t%BigInt(2):BigInt(0)));i.fromBigInt=e=>Object.assign(Object.create(i.prototype),{value:e,isNegative:e{let s=!1;const n=t.split("").filter((r,a)=>r.match(/\./g)&&!s?(s=!0,!0):r.match(/\-/g)&&a===0?!0:I.includes(r)).reduce((r,a)=>r+a);return $(n)?new i(n).toString():""})}const N=/^([-0])0+(?=\d)/,j=/(?!^\.)\.$/,z=/(?!^-)-/g,k=/^-\b0\b\.?0*$/,P=/0*$/,re=e=>f(e,t=>{const s=t.replace(z,"").replace(j,"").replace(N,"$1");return $(s)?k.test(s)?s:H(s):t});function H(e){const t=e.split(".")[1],s=new i(e).toString(),[n,r]=s.split(".");return t&&r!==t?`${n}.${t}`:s}function f(e,t){if(!e)return e;const s=e.toLowerCase().indexOf("e")+1;return s?e.replace(/[eE]*$/g,"").substring(0,s).concat(e.slice(s).replace(/[eE]/g,"")).split(/[eE]/).map((n,r)=>t(r===1?n.replace(/\./g,""):n)).join("e").replace(/^e/,"1e"):t(e)}function U(e){const t=e.split(/[eE]/);if(t.length===1)return e;const s=+e;if(Number.isSafeInteger(s))return`${s}`;const n=e.charAt(0)==="-",r=+t[1],a=t[0].split("."),l=(n?a[0].substring(1):a[0])||"",S=a[1]||"",M=(c,u)=>{const g=Math.abs(u)-c.length,p=g>0?`${"0".repeat(g)}${c}`:c;return`${p.slice(0,u)}.${p.slice(u)}`},A=(c,u)=>{const g=u>c.length?`${c}${"0".repeat(u-c.length)}`:c;return`${g.slice(0,u)}.${g.slice(u)}`},y=r>0?`${l}${A(S,r)}`:`${M(l,r)}${S}`;return`${n?"-":""}${y.charAt(0)==="."?"0":""}${y.replace(R,"").replace(N,"")}`}function Z(e){return I.some(t=>e.includes(t))}function ie(e,t,s){const n=t.split(".")[1];if(n){const r=n.match(P)[0];if(r&&s.delocalize(e).length!==t.length&&n.indexOf("e")===-1){const a=s.decimal;return e=e.includes(a)?e:`${e}${a}`,e.padEnd(e.length+r.length,s.localize("0"))}}return e}const o="en",G=["ar","bg","bs","ca","cs","da","de","el",o,"es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","no","nl","pl","pt-BR","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],B=["ar","bg","bs","ca","cs","da","de","de-AT","de-CH","el",o,"en-AU","en-CA","en-GB","es","es-MX","et","fi","fr","fr-CH","he","hi","hr","hu","id","it","it-CH","ja","ko","lt","lv","mk","no","nl","pl","pt","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],K=["arab","arabext","bali","beng","deva","fullwide","gujr","guru","hanidec","khmr","knda","laoo","latn","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt"],F=e=>K.includes(e),b=new Intl.NumberFormat().resolvedOptions().numberingSystem,O=b==="arab"||!F(b)?"latn":b,J=e=>F(e)?e:O;function L(e,t="cldr"){const s=t==="cldr"?B:G;return e?s.includes(e)?e:(e=e.toLowerCase(),e==="nb"?"no":t==="t9n"&&e==="pt"?"pt-BR":(e.includes("-")&&(e=e.replace(/(\w+)-(\w+)/,(n,r,a)=>`${r}-${a.toUpperCase()}`),s.includes(e)||(e=e.split("-")[0])),e==="zh"?"zh-CN":s.includes(e)?e:(console.warn(`Translations for the "${e}" locale are not available and will fall back to the default, English (en).`),o))):o}const m=new Set;function ae(e){W(e),m.size===0&&(d==null||d.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})),m.add(e)}function W(e){e.effectiveLocale=X(e)}function ce(e){m.delete(e),m.size===0&&d.disconnect()}const d=x("mutation",e=>{e.forEach(t=>{const s=t.target;m.forEach(n=>{if(!_(s,n.el))return;const a=w(n.el,"[lang]");if(!a){n.effectiveLocale=o;return}const l=a.lang;n.effectiveLocale=a.hasAttribute("lang")&&l===""?o:l})})});function X(e){var t;return e.el.lang||((t=w(e.el,"[lang]"))==null?void 0:t.lang)||document.documentElement.lang||o}class q{constructor(){this.delocalize=t=>this._numberFormatOptions?f(t,s=>s.replace(new RegExp(`[${this._minusSign}]`,"g"),"-").replace(new RegExp(`[${this._group}]`,"g"),"").replace(new RegExp(`[${this._decimal}]`,"g"),".").replace(new RegExp(`[${this._digits.join("")}]`,"g"),this._getDigitIndex)):t,this.localize=t=>this._numberFormatOptions?f(t,s=>$(s.trim())?new i(s.trim()).format(this).replace(new RegExp(`[${this._actualGroup}]`,"g"),this._group):s):t}get group(){return this._group}get decimal(){return this._decimal}get minusSign(){return this._minusSign}get digits(){return this._digits}get numberFormatter(){return this._numberFormatter}get numberFormatOptions(){return this._numberFormatOptions}set numberFormatOptions(t){if(t.locale=L(t==null?void 0:t.locale),t.numberingSystem=J(t==null?void 0:t.numberingSystem),!this._numberFormatOptions&&t.locale===o&&t.numberingSystem===O&&Object.keys(t).length===2||JSON.stringify(this._numberFormatOptions)===JSON.stringify(t))return;this._numberFormatOptions=t,this._numberFormatter=new Intl.NumberFormat(this._numberFormatOptions.locale,this._numberFormatOptions),this._digits=[...new Intl.NumberFormat(this._numberFormatOptions.locale,{useGrouping:!1,numberingSystem:this._numberFormatOptions.numberingSystem}).format(9876543210)].reverse();const s=new Map(this._digits.map((r,a)=>[r,a])),n=new Intl.NumberFormat(this._numberFormatOptions.locale,{numberingSystem:this._numberFormatOptions.numberingSystem}).formatToParts(-123456789e-1);this._actualGroup=n.find(r=>r.type==="group").value,this._group=this._actualGroup.trim().length===0||this._actualGroup==" "?" ":this._actualGroup,this._decimal=n.find(r=>r.type==="decimal").value,this._minusSign=n.find(r=>r.type==="minusSign").value,this._getDigitIndex=r=>s.get(r)}}const ue=new q;/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const h={};async function Q(e,t){const s=`${t}_${e}`;return h[s]||(h[s]=fetch(D(`./assets/${t}/t9n/messages_${e}.json`)).then(n=>(n.ok||E(),n.json())).catch(()=>E())),h[s]}function E(){throw new Error("could not fetch component message bundle")}function v(e){e.messages={...e.defaultMessages,...e.messageOverrides}}async function oe(e){e.defaultMessages=await C(e,e.effectiveLocale),v(e)}async function C(e,t){const{el:s}=e,r=s.tagName.toLowerCase().replace("calcite-","");return Q(L(t,"t9n"),r)}async function le(e,t){e.defaultMessages=await C(e,t),v(e)}function ge(e){e.onMessagesChange=Y}function me(e){e.onMessagesChange=void 0}function Y(){v(this)}export{i as B,ge as a,me as b,ae as c,ce as d,$ as e,re as f,ie as g,I as h,se as i,ue as n,ne as p,oe as s,le as u}; diff --git a/assets/th_TH2-def73602.js b/assets/th_TH2-def73602.js new file mode 100644 index 0000000..753186d --- /dev/null +++ b/assets/th_TH2-def73602.js @@ -0,0 +1 @@ +const d={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"ค.ศ.",_era_bc:"ก่อน ค.ศ.",A:"a",P:"p",AM:"ก่อนเที่ยง",PM:"หลังเที่ยง","A.M.":"ก่อนเที่ยง","P.M.":"หลังเที่ยง",January:"มกราคม",February:"กุมภาพันธ์",March:"มีนาคม",April:"เมษายน",May:"พฤษภาคม",June:"มิถุนายน",July:"กรกฎาคม",August:"สิงหาคม",September:"กันยายน",October:"ตุลาคม",November:"พฤศจิกายน",December:"ธันวาคม",Jan:"ม.ค.",Feb:"ก.พ.",Mar:"มี.ค.",Apr:"เม.ย.","May(short)":"พ.ค.",Jun:"มิ.ย.",Jul:"ก.ค.",Aug:"ส.ค.",Sep:"ก.ย.",Oct:"ต.ค.",Nov:"พ.ย.",Dec:"ธ.ค.",Sunday:"วันอาทิตย์",Monday:"วันจันทร์",Tuesday:"วันอังคาร",Wednesday:"วันพุธ",Thursday:"วันพฤหัสบดี",Friday:"วันศุกร์",Saturday:"วันเสาร์",Sun:"อา.",Mon:"จ.",Tue:"อ.",Wed:"พ.",Thu:"พฤ.",Fri:"ศ.",Sat:"ส.",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"ขยาย",Play:"เล่น",Stop:"หยุด",Legend:"คำอธิบายสัญลักษณ์","Press ENTER to toggle":"",Loading:"กำลังโหลด",Home:"หน้าหลัก",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"พิมพ์",Image:"รูปภาพ",Data:"ข้อมูล",Print:"พิมพ์","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"จาก %1 ถึง %2","From %1":"จาก %1","To %1":"ถึง %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/assets/tileUtils-48cbbab9.js b/assets/tileUtils-48cbbab9.js new file mode 100644 index 0000000..1a363b9 --- /dev/null +++ b/assets/tileUtils-48cbbab9.js @@ -0,0 +1 @@ +import{ai as o,aj as r,al as u,bm as y}from"./index-080e108a.js";let t=class extends y{initialize(){}destroy(){}get supportsTileUpdates(){return!1}get spatialReference(){const l=this.get("tileStore.tileScheme.spatialReference");return l&&l.toJSON()||null}};o([r({readOnly:!0})],t.prototype,"supportsTileUpdates",null),o([r({constructOnly:!0})],t.prototype,"remoteClient",void 0),o([r({constructOnly:!0})],t.prototype,"service",void 0),o([r()],t.prototype,"spatialReference",null),o([r({constructOnly:!0})],t.prototype,"tileInfo",void 0),o([r({constructOnly:!0})],t.prototype,"tileStore",void 0),t=o([u("esri.views.2d.layers.features.processors.BaseProcessor")],t);const f=t;function v(l,p,c,i){const e=l.clone(),n=1<=n?(e.col=s-n,e.world+=1):e.col=s,e.row=a,e}export{v as o,f as p}; diff --git a/assets/tr_TR2-d87d745f.js b/assets/tr_TR2-d87d745f.js new file mode 100644 index 0000000..4d116f6 --- /dev/null +++ b/assets/tr_TR2-d87d745f.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:"%",_percentSuffix:null,_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"MS",_era_bc:"MÖ",A:"öö",P:"ös",AM:"ÖÖ",PM:"ÖS","A.M.":"ÖÖ","P.M.":"ÖS",January:"Ocak",February:"Şubat",March:"Mart",April:"Nisan",May:"Mayıs",June:"Haziran",July:"Temmuz",August:"Ağustos",September:"Eylül",October:"Ekim",November:"Kasım",December:"Aralık",Jan:"Oca",Feb:"Şub",Mar:"Mar",Apr:"Nis","May(short)":"May",Jun:"Haz",Jul:"Tem",Aug:"Ağu",Sep:"Eyl",Oct:"Eki",Nov:"Kas",Dec:"Ara",Sunday:"Pazar",Monday:"Pazartesi",Tuesday:"Salı",Wednesday:"Çarşamba",Thursday:"Perşembe",Friday:"Cuma",Saturday:"Cumartesi",Sun:"Paz",Mon:"Pzt",Tue:"Sal",Wed:"Çar",Thu:"Per",Fri:"Cum",Sat:"Cmt",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Yakınlaştır",Play:"Oynat",Stop:"Durdur",Legend:"Gösterge","Press ENTER to toggle":"",Loading:"Yükleniyor",Home:"Giriş Sayfası",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Yazdır",Image:"Görüntü",Data:"Veri",Print:"Yazdır","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Kaynak %1 hedef %2","From %1":"Kaynak %1","To %1":"Hedef %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{a as default}; diff --git a/assets/uk_UA2-ae6136c6.js b/assets/uk_UA2-ae6136c6.js new file mode 100644 index 0000000..b5fa840 --- /dev/null +++ b/assets/uk_UA2-ae6136c6.js @@ -0,0 +1 @@ +const _={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"н. е.",_era_bc:"до н. е.",A:"дп",P:"пп",AM:"дп",PM:"пп","A.M.":"дп","P.M.":"пп",January:"січня",February:"лютого",March:"березня",April:"квітня",May:"травня",June:"червня",July:"липня",August:"серпня",September:"вересня",October:"жовтня",November:"листопада",December:"грудня",Jan:"січ.",Feb:"лют.",Mar:"бер.",Apr:"квіт.","May(short)":"трав.",Jun:"черв.",Jul:"лип.",Aug:"серп.",Sep:"вер.",Oct:"жовт.",Nov:"лист.",Dec:"груд.",Sunday:"неділя",Monday:"понеділок",Tuesday:"вівторок",Wednesday:"середа",Thursday:"четвер",Friday:"пʼятниця",Saturday:"субота",Sun:"нд",Mon:"пн",Tue:"вт",Wed:"ср",Thu:"чт",Fri:"пт",Sat:"сб",_dateOrd:function(e){return""},"Zoom Out":"Масштабування",Play:"Відтворювати",Stop:"Зупинка",Legend:"Легенда","Press ENTER to toggle":"",Loading:"Завантажується",Home:"Головна сторінка",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"карта","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Друк",Image:"Зображення",Data:"Дані",Print:"Друк","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Від %1 до %2","From %1":"Від %1","To %1":"До %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{_ as default}; diff --git a/assets/unitFormatUtils-b70a7bff.js b/assets/unitFormatUtils-b70a7bff.js new file mode 100644 index 0000000..30de548 --- /dev/null +++ b/assets/unitFormatUtils-b70a7bff.js @@ -0,0 +1 @@ +import{cb as u,cc as b,cd as f,ce as m,cf as s,cg as g,ch as l,ci as B,bI as h}from"./index-080e108a.js";function p(i,t,n){return i.units[t][n]}function a(i,t,n,c=2,r="abbr"){return`${b(t,{minimumFractionDigits:c,maximumFractionDigits:c,signDisplay:t>0?"never":"exceptZero"})} ${p(i,n,r)}`}function $(i,t,n,c=2,r="abbr"){const o=m(t,n);return a(i,s(t,n,o),o,c,r)}function D(i,t,n,c=2,r="abbr"){const o=g(t,n);return a(i,s(t,n,o),o,c,r)}function E(i,t,n,c=2,r="abbr"){const o=l(t,n);return a(i,s(t,n,o),o,c,r)}function F(i,t,n,c=2,r="abbr"){const o=B(t,n);return a(i,s(t,n,o),o,c,r)}const e=["B","kB","MB","GB","TB"];function M(i,t){let n=t===0?0:Math.floor(Math.log(t)/Math.log(u.KILOBYTES));n=h(n,0,e.length-1);const c=b(t/u.KILOBYTES**n,{maximumFractionDigits:2});return f(i.units.bytes[e[n]],{fileSize:c})}export{a as b,F as d,$ as p,M as v,D as x,E as y}; diff --git a/assets/uploadAssets-f5746464.js b/assets/uploadAssets-f5746464.js new file mode 100644 index 0000000..98ffe3e --- /dev/null +++ b/assets/uploadAssets-f5746464.js @@ -0,0 +1 @@ +import{c5 as m,at as y,ax as l,cB as M,ar as c,hE as J,hC as O,hF as G,as as k,bz as V,hA as W,dm as K,dq as x,dp as A,fl as U,hy as Q,fm as X,hG as Y}from"./index-080e108a.js";const N=1e6,D=20*N,Z=2e9,_=3;async function ee({data:e,name:a,description:t},s,r){let o=null;try{const n=m(s,"uploads"),i=m(n,"info"),{data:u}=await y(i,{query:{f:"json"},responseType:"json"});l(r);const p=M(s),d=u.maxUploadFileSize*N,w=p?Z:d,T=p?Math.min(D,d):D;if(e.size>w)throw new Error("Data too large");const P=m(n,"register"),{data:b}=await y(P,{query:{f:"json",itemName:a,description:t},responseType:"json",method:"post"});if(l(r),!b.success)throw new Error("Registration failed");const{itemID:R}=b.item;o=m(n,R);const C=m(o,"uploadPart"),B=Math.ceil(e.size/T),h=new Array;for(let f=0;f{for(;g.length!==0;){const f=h.length-g.length,E=g.pop(),$=new FormData;$.append("f","json"),$.append("file",E),$.append("partId",`${f}`);const{data:H}=await y(C,{timeout:0,body:$,responseType:"json",method:"post"});if(l(r),!H.success)throw new Error("Part upload failed")}};for(let f=0;f<_&&g.length!==0;++f)F.push(L());await Promise.all(F);const z=m(o,"commit"),{data:j}=await y(z,{query:{f:"json",parts:h.map((f,E)=>E).join(",")},responseType:"json",method:"post"});if(l(r),!j.success)throw new Error("Commit failed");return j.item}catch(n){if(o!=null){const i=m(o,"delete");await y(i,{query:{f:"json"},responseType:"json",method:"post"})}throw n}}async function $e(e,a,t){return e.length?Promise.all(e.map(s=>te(s,a,t))):[]}async function te(e,{layer:a,ongoingUploads:t},s){const r=t.get(e);if(r)return r;if(!we(a))throw new c(`${a.type}-layer:upload-failure`,"Layer does not support asset uploads.",new Error);if(ae(e,a))return e;const o=se(e,a,s);t.set(e,o);try{await o}finally{t.delete(e)}return e}function ae(e,a){const{parsedUrl:t}=a;return t!=null&&e.metadata.externalSources.some(s=>J(s,t))}async function se(e,a,t){const{metadata:s}=e,{displaySource:r}=s,o=v(r==null?void 0:r.source,a),n=!!o,i=s.externalSources.length>0,u=n?ne(o,a,t):i?oe(e,a,t):re(e,a,t),p=await u;return l(t),e.addExternalSources([p]),e}async function ne(e,a,t){return{source:await S(e,a,t),original:!0}}async function oe(e,a,t){const s=I(a),{externalSources:r}=e.metadata,o=le(r,a);if(!o)throw new c(`${a.type}-layer:upload-failure`,"Could not find an external source that is supported by the service.",new Error);const n=await S(o,a,t);return e.addExternalSources([{source:n,original:!0}]),{source:await ye(n,a,s)}}async function re(e,a,t){const s=ie(e,a,t);return{source:await q([s],a,t),extent:e.extent.clone(),original:!0}}async function ie(e,a,t){const s=I(a),r=await e.load(t),o=await r.toBinaryGLTF({ignoreLocalTransform:!0});l(t);const n=await o.buffer();return l(t),{blob:new Blob([n.data],{type:n.type}),assetName:`${O()}.glb`,assetType:s}}function le(e,a){for(const t of e){const s=v(t.source,a);if(s)return s}return null}function v(e,a){if(!e)return null;const{infoFor3D:{supportedFormats:t,editFormats:s}}=a,r=Y(e),o=new Array;let n=!1;for(let i=0;ice(s,t)),a,t)}async function q(e,a,t){const s=await Promise.all(e.map(async o=>{const n=pe(await o,a,t);return l(t),n}));l(t);const{uploadResults:r}=await de(s.map(({item:o})=>o),a,t);return l(t),e.map((o,n)=>fe(s[n],r[n],a))}async function ce(e,a){const{asset:t,assetType:s}=e;if(t instanceof File)return{blob:t,assetName:t.name,assetType:s};const r=await t.toBlob(a);return l(a),{blob:r,assetName:t.assetName,assetType:s}}async function pe(e,a,t){const{blob:s,assetType:r,assetName:o}=e;let n=null;try{const i=await ee({data:s,name:o},a.url,t);l(t),n={assetType:r,assetUploadId:i.itemID}}catch(i){k(i),V.getLogger("esri.layers.graphics.sources.support.uploadAssets").warnOnce(`Service ${a.url} does not support the REST Uploads API.`)}if(!n){const i=await W(s);if(l(t),!i.isBase64)throw new c(`${a.type}-layer:uploadAssets-failure`,"Expected gltf data in base64 format after conversion.",new Error);n={assetType:r,assetData:i.data}}if(!n)throw new c(`${a.type}-layer:uploadAssets-failure`,"Unable to prepare uploadAsset request options.",new Error);return{item:n,assetName:o}}async function de(e,a,t){const s=await y(m(a.parsedUrl.path,"uploadAssets"),{timeout:0,query:{f:"json",assets:JSON.stringify(e)},method:"post",responseType:"json"});if(l(t),s.data.uploadResults.length!==e.length)throw new c(`${a.type}-layer:uploadAssets-failure`,`Bad response. Uploaded ${e.length} items and received ${s.data.uploadResults.length} results.`,new Error);return s.data}function fe(e,a,t){const{success:s}=a;if(!s){const{error:p}=a;throw new c(`${t.type}-layer:upload-failure`,`Failed to upload mesh file ${e.assetName}. Error code: ${p.code}. Error message: ${p.messages}`,new Error)}const{assetHash:r}=a,{assetName:o,item:{assetType:n}}=e,{infoFor3D:{supportedFormats:i}}=t,u=K(n,i);if(!u)throw new c(`${t.type}-layer:upload-failure`,`The service allowed us to upload an asset of FormatID ${n}, but it does not list it in its supported formats.`,new Error);return new x(o,u,[new A(`${t.parsedUrl.path}/assets/${r}`,r)])}async function ye(e,a,t){var p;const s=e.map(({assetName:d,parts:w})=>({assetName:d,assetHash:w[0].partHash})),r=(p=a.capabilities)==null?void 0:p.operations.supportsAsyncConvert3D,o={query:{f:"json",assets:JSON.stringify(s),transportType:"esriTransportTypeUrl",targetFormat:t,async:r},responseType:"json",timeout:0},n=m(a.parsedUrl.path,"convert3D"),i=(r?await me(n,o):await y(n,o)).data,{infoFor3D:{supportedFormats:u}}=a;return i.assets.map(d=>{const w=U(d.contentType,u);if(!w)throw new c(`${a.type}-layer:upload-failure`,`The service allowed us to upload an asset of FormatID ${w}, but it does not list it in its supported formats.`,new Error);return new x(d.assetName,d.contentType,[new A(d.assetURL,d.assetHash)])})}async function me(e,a){const t=(await y(e,a)).data.statusUrl;for(;;){const s=(await y(t,{query:{f:"json"},responseType:"json"})).data;switch(s.status){case"Completed":return y(s.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new c("async-convert3D-failed","asynchronous convert3D call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new c("async-convert3D-failed","asynchronous convert3D call failed (undefined response status)")}await Q(he)}}function we(e){return!!e.infoFor3D&&!!e.url}function I(e){const{infoFor3D:a}=e,t=U("model/gltf-binary",a.supportedFormats)??X("glb",a.supportedFormats);if(!t)throw new c(`${e.type}-layer:upload-failure`,"Layer does not support glb.",new Error);return t}const he=1e3;export{$e as uploadAssets}; diff --git a/assets/utils-12672bd4.js b/assets/utils-12672bd4.js new file mode 100644 index 0000000..dcb07fc --- /dev/null +++ b/assets/utils-12672bd4.js @@ -0,0 +1 @@ +import{p as ne}from"./colorUtils-c0f43caf.js";import{ai as c,aj as h,al as w,ck as Zt,f4 as Ie,cp as Ft,d2 as q,cl as S,s1 as ze,ay as ht,s2 as Ve,bY as ft,mW as pt,ar as mt,c7 as re,ca as Ue}from"./index-080e108a.js";import{c as Le,u as d,Q as We,S as qe,V as wt,X as Xe,Y as Te,w as oe,Z as He,_ as Je,M as It,$ as Nt,a0 as Ye,a1 as Ne,a2 as Re,a3 as Ke,a4 as O,a5 as Ze,a6 as Qe,a7 as Ce,a8 as ts,a9 as es,aa as ss,ab as Tt,ac as ns,ad as rs,ae as os}from"./dataUtils-69946c3c.js";let xt=class extends Zt{constructor(){super(...arguments),this.raster=void 0}};c([h({json:{write:!0}})],xt.prototype,"raster",void 0),xt=c([w("esri.layers.support.rasterFunctions.AspectFunctionArguments")],xt);const _=xt;var Rt;let Ct=Rt=class extends _{clone(){return new Rt({raster:this.raster})}};Ct=Rt=c([w("esri.layers.support.rasterFunctions.AspectFunctionArguments")],Ct);const is=Ct,as=new Set(["slope","aspect","curvature","hillshade","shadedrelief"]);let F=class extends Zt{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const e=[t],{parameters:n}=t;let i=n.rasters||n.raster&&[n.raster];for(;i!=null&&i.length;){e.unshift(...i);const s=[];for(let u=0;u=0;s--)e[s].isNoopProcess&&e.splice(s,1);let r=!1;for(let s=0;s1}const a=e.some(({name:s})=>as.has(s.toLowerCase()));return{functions:e,hasBranches:r,hasSurfaceFunction:a}}bind(t,e=!1,n=-1){this.id=n+1;const i=this._getRasterValues();let r=!0;for(let a=0;athis._readRasterValue(i,t));return this._processPixels({...t,pixelBlocks:n})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let e;if(t.length>1){const r=t.map(s=>s.processInputBandIds()[0]);this.rawInputBandIds=r,this.isInputBandIdsSwizzled=this.rawInputBandIds.some((s,u)=>s!==u);const a=t.filter(s=>s.functionName==="ExtractBand");return a.length&&a.forEach((s,u)=>{s.isInputBandIdsSwizzled=!0,s.swizzledBandSelection=[u,u,u]}),this.rawInputBandIds}const n=t[0];if(n){if(e=n.processInputBandIds(),n.isInputBandIdsSwizzled)return this.rawInputBandIds=e,e}else{e=[];const{bandCount:r}=this.sourceRasterInfos[0];for(let a=0;ar!==a),this.rawInputBandIds=i,this.rawInputBandIds}getPrimaryRasters(){const t=[],e=[];return this._getPrimaryRasters(this,t,e),{rasters:t,rasterIds:e}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:e,rasters:n}=this.functionArguments;return n&&Array.isArray(n)&&n.length?(t.rasters=n.map(i=>this._isRasterFunctionValue(i)?i.getWebGLProcessorDefinition():typeof i=="number"?{name:"Constant",parameters:{value:i},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:i},pixelType:"f32",id:-1,isNoopProcess:!1}),t.rasters.some(i=>i!=null)||(t.rasters=null)):this._isRasterFunctionValue(e)&&(t.raster=e.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}_getOutputPixelType(t){return this.outputPixelType==="unknown"?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_isOutputRoundingNeeded(){const{outputPixelType:t}=this;return((t==null?void 0:t.startsWith("u"))||(t==null?void 0:t.startsWith("s")))??!1}_getRasterValues(){const{rasterArgumentNames:t}=this;return t[0]==="rasters"?this.functionArguments.rasters??[]:t.map(e=>this.functionArguments[e]).flat()}_getSourceRasterInfos(t){const e=this._getRasterValues(),{rasterInfos:n,rasterIds:i}=t;if(e.length===0)return n;const r=e.map(s=>s&&typeof s=="object"&&"bind"in s&&s.rasterInfo?s.rasterInfo:typeof s=="string"&&i.includes(s)?n[i.indexOf(s)]:typeof s!="number"?n[0]:void 0),a=r.find(s=>s)??n[0];return r.forEach((s,u)=>{s===void 0&&(r[u]=a)}),r}_getPrimaryRasterId(t){return t==null?void 0:t.url}_getPrimaryRasters(t,e=[],n=[]){for(let i=0;ie?i.slice(0,e):null),r&&r.length!==e&&(t.histograms=r.length>e?r.slice(0,e):null),n.BAND_COUNT&&Number(n.BAND_COUNT)!==e&&(t.keyProperties={...n,BAND_COUNT:typeof n.BAND_COUNT=="string"?String(e):e})}};c([h({json:{write:!0}})],F.prototype,"functionName",void 0),c([h({json:{write:!0}})],F.prototype,"functionArguments",void 0),c([h()],F.prototype,"rasterArgumentNames",void 0),c([h({json:{write:!0}}),Ie(o=>o==null?void 0:o.toLowerCase())],F.prototype,"outputPixelType",void 0),c([h({json:{write:!0}})],F.prototype,"mainPrimaryRasterId",void 0),c([h()],F.prototype,"sourceRasters",void 0),c([h({type:[Le],json:{write:!0}})],F.prototype,"sourceRasterInfos",void 0),c([h({json:{write:!0}})],F.prototype,"rasterInfo",void 0),c([h({json:{write:!0}})],F.prototype,"readingBufferSize",void 0),c([h({json:{write:!0}})],F.prototype,"id",void 0),c([h()],F.prototype,"isNoopProcess",void 0),c([h()],F.prototype,"supportsGPU",null),c([h()],F.prototype,"rawInputBandIds",void 0),c([h()],F.prototype,"isInputBandIdsSwizzled",void 0),c([h()],F.prototype,"swizzledBandSelection",void 0),c([h()],F.prototype,"isBranch",void 0),c([h()],F.prototype,"flatWebGLFunctionChain",null),c([h()],F.prototype,"_bindingResult",void 0),F=c([w("esri.layers.support.rasterFunctions.BaseRasterFunction")],F);const B=F;let X=class extends B{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){var n;const t=this.sourceRasterInfos[0];this.isGCS=((n=t.spatialReference)==null?void 0:n.isGeographic)??!1,this.outputPixelType=this._getOutputPixelType("f32");const e=t.clone();return e.pixelType=this.outputPixelType,e.statistics=[{min:-1,max:360,avg:180,stddev:30}],e.histograms=null,e.colormap=null,e.attributeTable=null,e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){var s;const e=(s=t.pixelBlocks)==null?void 0:s[0];if(e==null)return null;const{extent:n,primaryPixelSizes:i}=t,r=i==null?void 0:i[0],a=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1});return We(e,{resolution:a})}};c([h({json:{write:!0,name:"rasterFunction"}})],X.prototype,"functionName",void 0),c([h({type:is,json:{write:!0,name:"rasterFunctionArguments"}})],X.prototype,"functionArguments",void 0),c([h()],X.prototype,"rasterArgumentNames",void 0),c([h({json:{write:!0}})],X.prototype,"isGCS",void 0),X=c([w("esri.layers.support.rasterFunctions.AspectFunction")],X);const us=X,ls=new Set(["+","-","*","/","(",")"]);function cs(o,t){(o=o.replaceAll(" ","")).startsWith("-")&&(o="0"+o),o.startsWith("+")&&(o=o.slice(1,o.length));const e=o.split(""),n=[],i=[];let r="";for(let a=0;a-1)e>0&&(i+=t+1);else{for(let a=0;a0&&(i+=t+1)}let r=0;for(let a=0;a0;){const{numIndex:a,opIndex:s}=fs(i);if(n=ps(o,i[s],r[a],r[a+1]),i.length===1)break;i=hs(i,s),r.splice(a,2,n)}return[n]}const ds=new Ft({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function gs(o,t){if(!qe(o))return o;const{equation:e,method:n}=t,i=t.bandIndexes.map(p=>p-1),{pixels:r,mask:a}=o;let s;switch(n){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":s=ie(a,r[i[0]],r[i[1]]);break;case"ndwi":s=ie(a,r[i[1]],r[i[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":s=bs(a,r[i[0]],r[i[1]]);break;case"ci-g":case"ci-re":s=vs(a,r[i[0]],r[i[1]]);break;case"savi":s=ws(a,r[i[0]],r[i[1]],i[2]+1);break;case"tsavi":s=xs(a,r[i[0]],r[i[1]],i[2]+1,i[3]+1,i[4]+1);break;case"msavi":s=As(a,r[i[0]],r[i[1]]);break;case"gemi":s=Ps(a,r[i[0]],r[i[1]]);break;case"pvi":s=$s(a,r[i[0]],r[i[1]],i[2]+1,i[3]+1);break;case"gvitm":s=Fs(a,[r[i[0]],r[i[1]],r[i[2]],r[i[3]],r[i[4]],r[i[5]]]);break;case"sultan":s=Is(a,[r[i[0]],r[i[1]],r[i[2]],r[i[3]],r[i[4]],r[i[5]]]);break;case"vari":s=Ts(a,[r[i[0]],r[i[1]],r[i[2]]]);break;case"mtvi2":s=Ns(a,[r[i[0]],r[i[1]],r[i[2]]]);break;case"rtvi-core":s=Rs(a,[r[i[0]],r[i[1]],r[i[2]]]);break;case"evi":s=Cs(a,[r[i[0]],r[i[1]],r[i[2]]]);break;case"wndwi":s=_s(a,[r[i[0]],r[i[1]],r[i[2]]],i[3]?i[3]+1:.5);break;case"bai":s=Bs(a,r[i[0]],r[i[1]]);break;case"custom":s=ms(a,r,e);break;default:return o}const u=a!=null?new Uint8Array(a.length):null;a!=null&&u!=null&&u.set(a);const l=new d({width:o.width,height:o.height,pixelType:"f32",pixels:s,mask:u});return l.updateStatistics(),l}function ys(o,t,e,n){const{mask:i,pixels:r,width:a,height:s}=o,u=r[e],l=r[t],p=l.length,f=n?new Uint8Array(p):new Float32Array(p),m=n?100:1,g=n?100.5:0;for(let v=0;vparseFloat(s));return gs(e,{method:n,bandIndexes:r,equation:i})}_getWebGLParameters(){const t=this.functionArguments.bandIndexes.split(" ").map(s=>parseFloat(s)-1);t.length===2&&t.push(0);const e=this.isInputBandIdsSwizzled?[0,1,2]:t;let n,i;const r=new Float32Array(3),{method:a}=this.functionArguments;switch(a){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":n=T([e[0],e[1],0]),i="ndxi";break;case"ndwi":n=T([e[1],e[0],0]),i="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":n=T([e[0],e[1],0]),i="sr";break;case"ci-g":case"ci-re":n=T([e[0],e[1],0]),i="ci";break;case"savi":n=T([e[0],e[1],0]),i="savi",r[0]=t[2]+1;break;case"tsavi":n=T([e[0],e[1],0]),i="tsavi",r[0]=t[2]+1,r[1]=t[3]+1,r[2]=t[4]+1;break;case"msavi":n=T([e[0],e[1],0]),i="msavi";break;case"gemi":n=T([e[0],e[1],0]),i="gemi";break;case"pvi":n=T([e[0],e[1],0]),i="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":n=T([e[0],e[1],e[2]]),i="vari";break;case"mtvi2":n=T([e[0],e[1],e[2]]),i="mtvi2";break;case"rtvi-core":n=T([e[0],e[1],e[2]]),i="rtvicore";break;case"evi":n=T([e[0],e[1],e[2]]),i="evi";break;case"wndwi":n=T([e[0],e[1],0]),i="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":n=T([e[1],e[0],0]),i="bai";break;default:n=T([0,1,2]),i="custom"}return{bandIndexMat3:n,indexType:i,adjustments:r}}_getInputBandIds(t){if(this.functionArguments.method==="custom")return t;const e=this.functionArguments.bandIndexes.split(" ").map(s=>parseFloat(s)-1),n=t.length,i=e.map(s=>s>=n?n-1:s),r=js.has(this.functionArguments.method)?3:2,a=i.slice(0,r).map(s=>t[s]);return a.length===2&&a.push(0),a}};c([h({json:{write:!0,name:"rasterFunction"}})],nt.prototype,"functionName",void 0),c([h({type:ks,json:{write:!0,name:"rasterFunctionArguments"}})],nt.prototype,"functionArguments",void 0),c([h()],nt.prototype,"rasterArgumentNames",void 0),nt=c([w("esri.layers.support.rasterFunctions.BandArithmeticFunction")],nt);const Ss=nt;var Bt;let D=Bt=class extends _{castColormapName(o){if(!o)return null;const t=o.toLowerCase();return Xe.includes(t)?t:null}readColorRamp(o){return Ve(o)}readColorRampName(o,t){if(!o)return null;const e=wt.jsonValues.find(n=>n.toLowerCase()===o.toLowerCase());return e?wt.fromJSON(e):null}clone(){var o;return new Bt({colormap:S(this.colormap),colormapName:this.colormapName,colorRamp:(o=this.colorRamp)==null?void 0:o.clone(),colorRampName:this.colorRampName})}};c([h({type:[[Number]],json:{write:!0}})],D.prototype,"colormap",void 0),c([h({type:String,json:{write:!0}})],D.prototype,"colormapName",void 0),c([Ie("colormapName")],D.prototype,"castColormapName",null),c([h({types:ze,json:{write:!0}})],D.prototype,"colorRamp",void 0),c([ht("colorRamp")],D.prototype,"readColorRamp",null),c([h({type:wt.apiValues,json:{type:wt.jsonValues,write:wt.write}})],D.prototype,"colorRampName",void 0),c([ht("colorRampName")],D.prototype,"readColorRampName",null),D=Bt=c([w("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],D);const Ms=D,Ds=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],Es=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function Qt(o,t){const e=[],n=[];for(let r=0;r[n,...e]),t):null}let z=class extends B{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:e,colormapName:n,colorRamp:i,colorRampName:r}=this.functionArguments;if(!(e!=null&&e.length))if(i)e=oe(i,{interpolateAlpha:!0});else if(r){const s=He(r);s&&(e=oe(s))}else n&&(e=Ls(n));if(!(e!=null&&e.length))return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};this.outputPixelType=this._getOutputPixelType("u8");const a=t.clone();return a.pixelType=this.outputPixelType,a.colormap=e,a.bandCount=1,this.rasterInfo=a,{success:!0,supportsGPU:!0}}_processPixels(t){var e;return(e=t.pixelBlocks)==null?void 0:e[0]}};c([h({json:{write:!0,name:"rasterFunction"}})],z.prototype,"functionName",void 0),c([h({type:Ms,json:{write:!0,name:"rasterFunctionArguments"}})],z.prototype,"functionArguments",void 0),c([h()],z.prototype,"rasterArgumentNames",void 0),c([h()],z.prototype,"isNoopProcess",void 0),c([h({json:{write:!0}})],z.prototype,"indexedColormap",void 0),z=c([w("esri.layers.support.rasterFunctions.ColormapFunction")],z);const Ws=z;var kt;let yt=kt=class extends _{constructor(){super(...arguments),this.rasters=[]}writeRasters(o,t){t.rasters=o.map(e=>typeof e=="number"||typeof e=="string"?e:e.toJSON())}clone(){return new kt({rasters:S(this.rasters)})}};c([h({json:{write:!0}})],yt.prototype,"rasters",void 0),c([ft("rasters")],yt.prototype,"writeRasters",null),yt=kt=c([w("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],yt);const qs=yt;let rt=class extends B{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();if(n.attributeTable=null,n.colormap=null,n.pixelType=this.outputPixelType,n.bandCount=t.map(({bandCount:r})=>r).reduce((r,a)=>r+a),t.every(({statistics:r})=>r!=null&&r.length)){const r=[];t.forEach(({statistics:a})=>a!=null&&r.push(...a)),n.statistics=r}if(t.every(({histograms:r})=>r!=null&&r.length)){const r=[];t.forEach(({histograms:a})=>a!=null&&r.push(...a)),n.histograms=r}n.bandCount>1&&(n.colormap=null,n.attributeTable=null);const i=t.every(r=>{var a;return(a=r.keyProperties.BandProperties)==null?void 0:a.length})?t.flatMap(r=>r.keyProperties.BandProperties):void 0;return n.keyProperties={...n.keyProperties,BandProperties:i},this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e?(e==null?void 0:e[0])==null?null:Je(e):null}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};c([h({json:{write:!0,name:"rasterFunction"}})],rt.prototype,"functionName",void 0),c([h({type:qs,json:{write:!0,name:"rasterFunctionArguments"}})],rt.prototype,"functionArguments",void 0),c([h()],rt.prototype,"rasterArgumentNames",void 0),rt=c([w("esri.layers.support.rasterFunctions.CompositeBandFunction")],rt);const Xs=rt,x={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},Hs={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65},k={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},M={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},Js={majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75},_e={setNull:50,conditional:78},ae={...Hs,...k,...M,...Js,..._e},P=new Map;function Ys(o){const t=Math.sqrt(o.length),e=o.slice(0,t),n=[1];for(let i=1;iu+l);return a!==0&&a!==1&&(n=n.map(u=>u/a)),tn(e,{kernel:n,rows:i,cols:r,outputPixelType:this.outputPixelType})}_getWebGLParameters(){let{kernel:t}=this.functionArguments;const e=t.reduce((i,r)=>i+r);e!==0&&e!==1&&(t=t.map(i=>i/e));const n=new Float32Array(le);return n.set(t),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:n,clampRange:It(this.outputPixelType)}}};c([h({json:{write:!0,name:"rasterFunction"}})],ot.prototype,"functionName",void 0),c([h({type:en,json:{write:!0,name:"rasterFunctionArguments"}})],ot.prototype,"functionArguments",void 0),c([h()],ot.prototype,"rasterArgumentNames",void 0),ot=c([w("esri.layers.support.rasterFunctions.ConvolutionFunction")],ot);const sn=ot;var St;const ke=new Ft({0:"standard",1:"platform",2:"profile"},{useNumericKeys:!0});let it=St=class extends _{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(o,t){return ke.fromJSON(t.type??t.curvatureType??0)}clone(){return new St({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};c([h({json:{write:{target:"type"}}}),q(ke)],it.prototype,"curvatureType",void 0),c([ht("curvatureType",["type","curvatureType"])],it.prototype,"readCurvatureType",null),c([h({type:Number,json:{write:!0}})],it.prototype,"zFactor",void 0),it=St=c([w("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],it);const nn=it;let J=class extends B{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){var e;this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.bandCount=1,this.rasterInfo=t,this.isGCS=((e=t.spatialReference)==null?void 0:e.isGeographic)??!1,{success:!0,supportsGPU:!0}}_processPixels(t){var p;const e=(p=t.pixelBlocks)==null?void 0:p[0];if(e==null)return null;const{zFactor:n,curvatureType:i}=this.functionArguments,{extent:r,primaryPixelSizes:a}=t,s=a==null?void 0:a[0],u=s??(r?{x:r.width/e.width,y:r.height/e.height}:{x:1,y:1}),l=this.isGCS&&n>=1?n*Nt:n;return Ye(e,{zFactor:l,curvatureType:i,resolution:u})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*Nt:t}}};c([h({json:{write:!0,name:"rasterFunction"}})],J.prototype,"functionName",void 0),c([h({type:nn,json:{write:!0,name:"rasterFunctionArguments"}})],J.prototype,"functionArguments",void 0),c([h()],J.prototype,"rasterArgumentNames",void 0),c([h({json:{write:!0}})],J.prototype,"isGCS",void 0),J=c([w("esri.layers.support.rasterFunctions.CurvatureFunction")],J);const rn=J;var Mt;let G=Mt=class extends _{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=Ne.bestMatch}clone(){return new Mt({bandIds:[...this.bandIds],bandNames:[...this.bandNames],missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};c([h({json:{write:!0}})],G.prototype,"bandIds",void 0),c([h({json:{write:!0}})],G.prototype,"bandNames",void 0),c([h({json:{write:!0}})],G.prototype,"bandWavelengths",void 0),c([q({0:"name",1:"wavelength",2:"id"})],G.prototype,"method",void 0),c([h({json:{write:!0}})],G.prototype,"missingBandAction",void 0),c([h({json:{write:!0}})],G.prototype,"wavelengthMatchTolerance",void 0),G=Mt=c([w("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],G);const on=G;let at=class extends B{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){var dt;const{functionArguments:t,sourceRasterInfos:e}=this,n=e[0],{method:i,bandNames:r,bandWavelengths:a,bandIds:s,missingBandAction:u}=t,l=(r==null?void 0:r.length)&&(i==="name"||i!=="id"&&!(s!=null&&s.length)),p=(a==null?void 0:a.length)&&(i==="wavelength"||i!=="id"&&!(s!=null&&s.length)),f=u===Ne.fail,m=l?this._matchBandNames(n,r):p?this._matchBandWavelengths(n,a,f):this._matchBandIds(n,s,f);if(m==null)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${l?"band names":p?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=m,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const g=n.clone();g.pixelType=this.outputPixelType,g.bandCount=m.length;const{statistics:y,histograms:v}=g;y!=null&&y.length&&(g.statistics=m.map(E=>y[E]||y[y.length-1])),v!=null&&v.length&&(g.histograms=m.map(E=>v[E]||v[v.length-1]));let A=(dt=g.keyProperties)==null?void 0:dt.BandProperties;return A!=null&&A.length&&(A=m.map(E=>E>=A.length?A[A.length-1]:A[E]),g.keyProperties={...g.keyProperties,BandProperties:A}),this.rasterInfo=g,{success:!0,supportsGPU:g.bandCount<=3}}_processPixels(t){var r;const e=(r=t.pixelBlocks)==null?void 0:r[0];if(e==null)return null;const n=e.pixels.length,i=this.functionArguments.bandIds.map(a=>a>=n?n-1:a);return e.extractBands(i)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],t.length===0?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let e=0;e<3;e++)t[e]=Math.min(t[e],2)}return{bandIndexMat3:T(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map(n=>n>=e?e-1:n).map(n=>t[n])}_matchBandNames(t,e){const n=t.bandInfos.map(({name:r})=>r.toLowerCase()),i=[];for(let r=0;ru.startsWith("nearinfrared_1")),s===-1&&(s=n.findIndex(u=>u.startsWith("nearinfrared")))),s===-1)return null;i.push(s)}return i}_matchBandIds(t,e,n){const{bandCount:i}=t;return!(e!=null&&e.length)||n&&e.some(r=>r<0||r>=i)?null:e}_matchBandWavelengths(t,e,n){const{bandInfos:i}=t,r=[];for(let u=0;u=y.minWavelength&&l<=y.maxWavelength,A=Math.abs(l-(y.minWavelength+y.maxWavelength)/2);v?Atypeof e=="number"||typeof e=="string"?e:e.toJSON())}clone(){return new Dt({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:S(this.rasters)})}};c([h({json:{write:!0}})],Y.prototype,"operation",void 0),c([h({json:{write:!0}})],Y.prototype,"rasters",void 0),c([ft("rasters")],Y.prototype,"writeRasters",null),c([h({json:{write:!0}})],Y.prototype,"processAsMultiband",void 0),Y=Dt=c([w("esri.layers.support.rasterFunctions.LocalFunctionArguments")],Y);const un=Y,N=new Map;function ln(o){return N.get(o)}N.set(M.acos,[0,Math.PI]),N.set(M.asin,[-Math.PI/2,Math.PI/2]),N.set(M.atan,[-Math.PI/2,Math.PI/2]),N.set(M.cos,[-1,1]),N.set(M.sin,[-1,1]),N.set(k.booleanAnd,[0,1]),N.set(k.booleanNot,[0,1]),N.set(k.booleanOr,[0,1]),N.set(k.booleanXOr,[0,1]),N.set(k.equalTo,[0,1]),N.set(k.notEqual,[0,1]),N.set(k.greaterThan,[0,1]),N.set(k.greaterThanEqual,[0,1]),N.set(k.lessThan,[0,1]),N.set(k.lessThanEqual,[0,1]),N.set(k.isNull,[0,1]);const ce=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function cn(o,t=!1){const e=o.map(s=>s.mask),n=e.filter(s=>s!=null),i=o[0].pixels[0].length;if(n.length===0)return new Uint8Array(i).fill(255);const r=n[0],a=new Uint8Array(r);if(n.length===1)return a;if(!t){for(let s=1;s=1?t[u]=0:a[u]=Math.atanh(l)}return a}const s=n===M.asin?Math.asin:Math.acos;for(let u=0;u1?t[u]=0:a[u]=s(l)}return a}function vn(o,t,e,n){const[i]=o,r=i.length,a=d.createEmptyBand(e,r);for(let s=0;s>i[s]);return a}function Fn(o,t,e){const[n,i]=o,r=n.length,a=d.createEmptyBand(e,r);for(let s=0;si[s]?1:0);return a}function En(o,t,e){const[n,i]=o,r=n.length,a=d.createEmptyBand(e,r);for(let s=0;s=i[s]?1:0);return a}function Gn(o,t,e){const[n,i]=o,r=n.length,a=d.createEmptyBand(e,r);for(let s=0;sp&&(u=p)}a[s]=u}return a}function de(o,t,e){const n=o.length;if(n<2)return o[0];const[i]=o,r=i.length,a=d.createEmptyBand(e,r);for(let s=0;sf&&(u=f)}a[s]=l-u}return a}function ge(o,t,e){const n=o.length;if(n<2)return o[0];const[i]=o,r=i.length,a=d.createEmptyBand(e,r);for(let s=0;sp&&(p=l,u=f);r[s]=u}return r}function xe(o,t,e){const n=o.length;if(n<=2)return Se(o,t,e);const i=o[0].length,r=d.createEmptyBand(e,i),a=new Map;for(let s=0;sr?t[s]=0:n[s]=a?Math.round(u):u}}function Hn(o,t,e={}){qn();let n=cn(o,t>=66&&t<=75);const{outputPixelType:i="f32"}=e,r=!$.has(t)||e.processAsMultiband,a=r?o[0].pixels.length:1,s=[];for(let l=0;lg.pixels):o.map(g=>g.pixels[l]);let f,m=!0;if(t===_e.setNull){const g=Wn(p,n,i);f=g.band,n=g.mask,m=!1}else b.has(t)?f=b.get(t)(p,n,"f64"):I.has(t)?f=t===M.asin||t===M.acos||t===M.atanh?bn(p,n,"f64",t):vn(p,n,"f64",I.get(t)):$t.has(t)?f=wn(p,n,"f64",$t.get(t)):$.has(t)?f=$.get(t)(p,n,"f64"):(f=p[0],m=!1);if(m&&t!==k.isNull&&!N.has(t)){const g=d.createEmptyBand(i,f.length);n||(n=new Uint8Array(f.length).fill(255)),Xn(f,n,i,g),f=g}s.push(f)}const u=o[0];return new d({width:u.width,height:u.height,pixelType:i,mask:t===k.isNull?null:n,pixels:s})}let ut=class extends B{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:n}=e,{processAsMultiband:i}=this.functionArguments;if(t.some(p=>p.bandCount!==n))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:a}=this.functionArguments,s=ce[r];if(!(s===999||a.length===s||a.length<=1&&s===1))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${s}`};this.outputPixelType=this._getOutputPixelType("f32");const u=e.clone();u.pixelType=this.outputPixelType,u.statistics=null,u.histograms=null,u.colormap=null,u.attributeTable=null,u.bandCount=s!==999||i?n:1;const l=ln(r);if(l){u.statistics=[];for(let p=0;p16)}}_processPixels(t){const{pixelBlocks:e}=t;return e==null||e.some(n=>n==null)?null:Hn(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){var u;const{operation:t}=this.functionArguments,e=ce[t],n=((u=Object.keys(ae).find(l=>ae[l]===t))==null?void 0:u.toLowerCase())??"undefined",i=this.outputPixelType??"f32";let[r,a]=It(i);const s=i.startsWith("u")||i.startsWith("s");return s&&(r-=1e-4,a+=1e-4),{imageCount:e,operationName:n,domainRange:[r,a],isOutputRounded:s}}};c([h({json:{write:!0,name:"rasterFunction"}})],ut.prototype,"functionName",void 0),c([h({type:un,json:{write:!0,name:"rasterFunctionArguments"}})],ut.prototype,"functionArguments",void 0),c([h()],ut.prototype,"rasterArgumentNames",void 0),ut=c([w("esri.layers.support.rasterFunctions.LocalFunction")],ut);const Jn=ut;var Et;let K=Et=class extends _{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=Re.matchAny}get normalizedNoDataValues(){const{noDataValues:o}=this;if(!(o!=null&&o.length))return null;let t=!1;const e=o.map(n=>{if(typeof n=="number")return t=!0,[n];if(typeof n=="string"){const i=n.trim().split(" ").filter(r=>r.trim()!=="").map(r=>Number(r));return t=t||i.length>0,i.length===0?null:i}return null});return t?e:null}clone(){var o,t;return new Et({includedRanges:((o=this.includedRanges)==null?void 0:o.slice())??[],noDataValues:((t=this.noDataValues)==null?void 0:t.slice())??[],noDataInterpretation:this.noDataInterpretation})}};c([h({json:{write:!0}})],K.prototype,"includedRanges",void 0),c([h({json:{write:!0}})],K.prototype,"noDataValues",void 0),c([h()],K.prototype,"normalizedNoDataValues",null),c([h({json:{write:!0}})],K.prototype,"noDataInterpretation",void 0),K=Et=c([w("esri.layers.support.rasterFunctions.MaskFunctionArguments")],K);const Yn=K;let Z=class extends B{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:n,normalizedNoDataValues:i}=this.functionArguments;if(!(n!=null&&n.length)&&!(i!=null&&i.length))return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let r=[];for(let s=0;s{var u;return(s==null?void 0:s.length)===((u=i[0])==null?void 0:u.length)});return{success:!0,supportsGPU:(!n||n.length<=2*O)&&(!i||a&&i[0].length<=O)}}_processPixels(t){var l;const e=(l=t.pixelBlocks)==null?void 0:l[0];if(e==null)return null;const{outputPixelType:n,lookups:i}=this,{includedRanges:r,noDataInterpretation:a,normalizedNoDataValues:s}=this.functionArguments,u=a===Re.matchAll;return Ze(e,{includedRanges:r,noDataValues:s,outputPixelType:n,matchAll:u,lookups:i})}_getWebGLParameters(){var r;const{includedRanges:t,normalizedNoDataValues:e}=this.functionArguments,n=new Float32Array(O);n.fill(pt),(r=e==null?void 0:e[0])!=null&&r.length&&n.set(e[0]);const i=new Float32Array(O);for(let a=0;a=i.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};const a=i.clone();a.pixelType=this.outputPixelType,a.colormap=null,a.histograms=null,a.bandCount=1,a.keyProperties={...a.keyProperties,BandProperties:void 0};const[s,u,l,p]=t?[-1,1,0,.1]:[0,200,100,10];return a.statistics=[{min:s,max:u,avg:l,stddev:p}],this.rasterInfo=a,{success:!0,supportsGPU:!0}}_processPixels(t){var a;const e=(a=t.pixelBlocks)==null?void 0:a[0];if(e==null)return null;const{visibleBandID:n,infraredBandID:i,scientificOutput:r}=this.functionArguments;return ys(e,n,i,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this.functionArguments,i=this.isInputBandIdsSwizzled?[0,1,2]:[e,t,0];return{bandIndexMat3:T(i),scaled:!n}}_getInputBandIds(t){const{visibleBandID:e,infraredBandID:n}=this.functionArguments;return[n,e,0].map(i=>t[i])}};c([h({json:{write:!0,name:"rasterFunction"}})],ct.prototype,"functionName",void 0),c([h({type:Zn,json:{write:!0,name:"rasterFunctionArguments"}})],ct.prototype,"functionArguments",void 0),c([h()],ct.prototype,"rasterArgumentNames",void 0),ct=c([w("esri.layers.support.rasterFunctions.NDVIFunction")],ct);const Qn=ct;var Ot;let V=Ot=class extends _{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new Ot({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};c([h({json:{write:!0}})],V.prototype,"inputRanges",void 0),c([h({json:{write:!0}})],V.prototype,"outputValues",void 0),c([h({json:{write:!0}})],V.prototype,"noDataRanges",void 0),c([h({json:{write:!0}})],V.prototype,"allowUnmatched",void 0),c([h({json:{write:!0}})],V.prototype,"isLastInputRangeInclusive",void 0),V=Ot=c([w("esri.layers.support.rasterFunctions.RemapFunctionArguments")],V);const tr=V;let Q=class extends B{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.colormap=null,t.histograms=null,t.bandCount=1,t.attributeTable=null;const{statistics:n}=t,{allowUnmatched:i,outputValues:r,inputRanges:a,noDataRanges:s,isLastInputRangeInclusive:u}=this.functionArguments;if(n!=null&&n.length&&(r!=null&&r.length))if(i){const l=Math.min.apply(null,[...r,n[0].min]),p=Math.max.apply(null,[...r,n[0].max]);t.statistics=[{...n[0],min:l,max:p}]}else{let l=r[0],p=l;for(let f=0;fr[f]?r[f]:l,p=p>r[f]?p:r[f];t.statistics=[{...n[0],min:l,max:p}]}return this.rasterInfo=t,this.lookup=i?null:Qe({srcPixelType:e,inputRanges:a,outputValues:r,noDataRanges:s,allowUnmatched:i,isLastInputRangeInclusive:u,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!r||r.length<=O)&&(!s||s.length<=O)}}_processPixels(t){var p;const e=(p=t.pixelBlocks)==null?void 0:p[0];if(e==null)return null;const{lookup:n,outputPixelType:i}=this;if(n){const f=Ce(e,{lut:[n.lut],offset:n.offset,outputPixelType:i});return f!=null&&n.mask&&(f.mask=ts(e.pixels[0],e.mask,n.mask,n.offset,"u8")),f}const{inputRanges:r,outputValues:a,noDataRanges:s,allowUnmatched:u,isLastInputRangeInclusive:l}=this.functionArguments;return es(e,{inputRanges:r,outputValues:a,noDataRanges:s,outputPixelType:i,allowUnmatched:u,isLastInputRangeInclusive:l})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:e,isLastInputRangeInclusive:n}=this.functionArguments,i=new Float32Array(3*O),r=1e-5,a=this.functionArguments.inputRanges??[],s=this.functionArguments.outputValues??[],u=s.length;for(let p=0;p0&&(i[3*p]-=r),(p=1?t*Nt:t,slopeType:e,pixelSizeFactor:n??0,pixelSizePower:i??0}}};c([h({json:{write:!0,name:"rasterFunction"}})],tt.prototype,"functionName",void 0),c([h({type:nr,json:{write:!0,name:"rasterFunctionArguments"}})],tt.prototype,"functionArguments",void 0),c([h()],tt.prototype,"rasterArgumentNames",void 0),c([h({json:{write:!0}})],tt.prototype,"isGCS",void 0),tt=c([w("esri.layers.support.rasterFunctions.SlopeFunction")],tt);const rr=tt;var Vt;let et=Vt=class extends _{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(o,t){if(!(o!=null&&o.length))return null;const e=[];return o.forEach(n=>{const i={min:n.min,max:n.max,avg:n.avg??n.mean,stddev:n.stddev??n.standardDeviation};e.push(i)}),e}writeStatistics(o,t,e){if(!(o!=null&&o.length))return;const n=[];o.forEach(i=>{const r={...i,mean:i.avg,standardDeviation:i.stddev};delete r.avg,delete r.stddev,n.push(r)}),t[e]=n}clone(){return new Vt({statistics:S(this.statistics),histograms:S(this.histograms)})}};c([h({json:{write:!0}})],et.prototype,"statistics",void 0),c([ht("statistics")],et.prototype,"readStatistics",null),c([ft("statistics")],et.prototype,"writeStatistics",null),c([h({json:{write:!0}})],et.prototype,"histograms",void 0),et=Vt=c([w("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],et);const or=et;let L=class extends B{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone(),{statistics:n,histograms:i}=this.functionArguments;return i&&(e.histograms=i),n&&(e.statistics=n),this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){var e;return(e=t.pixelBlocks)==null?void 0:e[0]}};c([h({json:{write:!0,name:"rasterFunction"}})],L.prototype,"functionName",void 0),c([h({type:or,json:{write:!0,name:"rasterFunctionArguments"}})],L.prototype,"functionArguments",void 0),c([h()],L.prototype,"rasterArgumentNames",void 0),c([h({json:{write:!0}})],L.prototype,"indexedColormap",void 0),c([h()],L.prototype,"isNoopProcess",void 0),L=c([w("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],L);const ir=L;var Ut;const ar=new Ft({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let R=Ut=class extends _{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(o,t,e){o!=null&&o.length&&(Array.isArray(o[0])||(o=o.map(n=>[n.min,n.max,n.avg,n.stddev])),t[e]=o)}clone(){return new Ut({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:S(this.statistics),gamma:S(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:S(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};c([h({type:Boolean,json:{write:!0}})],R.prototype,"computeGamma",void 0),c([h({type:Boolean,json:{name:"dra",write:!0}})],R.prototype,"dynamicRangeAdjustment",void 0),c([h({type:[Number],json:{write:!0}})],R.prototype,"gamma",void 0),c([h()],R.prototype,"histograms",void 0),c([h({type:Number,json:{write:!0}})],R.prototype,"maxPercent",void 0),c([h({type:Number,json:{write:!0}})],R.prototype,"minPercent",void 0),c([h({type:Number,json:{write:!0}})],R.prototype,"numberOfStandardDeviations",void 0),c([h({type:Number,json:{name:"max",write:!0}})],R.prototype,"outputMax",void 0),c([h({type:Number,json:{name:"min",write:!0}})],R.prototype,"outputMin",void 0),c([h({type:Number,json:{write:!0}})],R.prototype,"sigmoidStrengthLevel",void 0),c([h({json:{type:[[Number]],write:!0}})],R.prototype,"statistics",void 0),c([ft("statistics")],R.prototype,"writeStatistics",null),c([q(ar)],R.prototype,"stretchType",void 0),c([h({type:Boolean,json:{write:!0}})],R.prototype,"useGamma",void 0),R=Ut=c([w("esri.layers.support.rasterFunctions.StretchFunctionArguments")],R);const ur=R;let W=class extends B{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:e}=t,{functionArguments:n}=this,{dynamicRangeAdjustment:i,gamma:r,useGamma:a}=n;if(!i&&["u8","u16","s8","s16"].includes(e)){const u=Tt(n.toJSON(),{rasterInfo:t}),l=this._isOutputRoundingNeeded()?"round":"float";this.lookup=ns({pixelType:e,...u,gamma:a?r:null,rounding:l}),this.cutOffs=u}else i||(this.cutOffs=Tt(n.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(e);const s=t.clone();return s.pixelType=this.outputPixelType,s.statistics=null,s.histograms=null,s.colormap=null,s.attributeTable=null,this.outputPixelType==="u8"&&(s.keyProperties.DataType="processed"),this.rasterInfo=s,{success:!0,supportsGPU:!i}}_processPixels(t){var s;const e=(s=t.pixelBlocks)==null?void 0:s[0];if(e==null)return e;const{lookup:n}=this;if(n)return Ce(e,{...n,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:i}=this,r=this.cutOffs||Tt(i.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:e}),a=i.useGamma?i.gamma:null;return rs(e,{...r,gamma:a,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:t=0,outputMax:e=255,gamma:n,useGamma:i}=this.functionArguments,r=this.rasterInfo.bandCount>=2?3:1,a=i&&n&&n.length?os(r,n):[1,1,1],{minCutOff:s,maxCutOff:u}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};s.length===1&&(s[1]=s[2]=s[0],u[1]=u[2]=u[0]);const l=new Float32Array(r);let p;for(p=0;p1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const n=t.clone();return n.pixelType=this.outputPixelType,n.bandCount=1,n.dataType!=="thematic"&&(n.keyProperties=n.keyProperties?{...n.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=n,{success:!0,supportsGPU:!0}}_processPixels(t){var e;return(e=t.pixelBlocks)==null?void 0:e[0]}};c([h({json:{write:!0,name:"rasterFunction"}})],st.prototype,"functionName",void 0),c([h({type:cr,json:{write:!0,name:"rasterFunctionArguments"}})],st.prototype,"functionArguments",void 0),c([h()],st.prototype,"rasterArgumentNames",void 0),c([h()],st.prototype,"isNoopProcess",void 0),st=c([w("esri.layers.support.rasterFunctions.TableFunction")],st);const pr=st,C=new Map;function hr(o,t){const{rasterFunctionArguments:e}=o;e&&(e.rasters||[e.raster]).forEach(n=>{n&&typeof n!="number"&&(typeof n=="string"?n.startsWith("http")&&(t.includes(n)||t.push(n)):"rasterFunctionArguments"in n&&hr(n,t))})}function Ur(o,t){if(t=t??{},"function"in(o=S(o))&&"arguments"in o&&o.arguments){const e=Ee(o,new Map,t);if(Xt(e),!e.renderingRule)throw new mt("raster-function-helper","Unsupported raster function json.");o=e.renderingRule}if("rasterFunction"in o)return Me(o=Wt(o),t);throw new mt("raster-function-helper","unsupported raster function json.")}function fr(o,t){return t[0]==="rasters"&&Array.isArray(o.rasters)?o.rasters:t.map(e=>o[e])}function Pe(o){return!!(o&&typeof o=="object"&&o.rasterFunction&&o.rasterFunctionArguments)}function Wt(o){var i;const{rasterFunction:t,rasterFunctionArguments:e}=o,n={};for(const r in e){let a=e[r];const s=r.toLowerCase();if(s==="rasters"&&Array.isArray(a))n.rasters=a.map(u=>Pe(u)?Wt(u):u);else switch(Pe(a)&&(a=Wt(a)),s){case"dra":n.dra=a;break;case"pspower":n.psPower=a;break;case"pszfactor":n.psZFactor=a;break;case"bandids":n.bandIds=a;break;default:n[r[0].toLowerCase()+r.slice(1)]=a}}return t!=="Local"||(i=n.rasters)!=null&&i.length||(n.rasters=["$$"]),{...o,rasterFunctionArguments:n}}function Me(o,t){var m,g;const{rasterFunction:e,rasterFunctionArguments:n}=o,i=(m=o.outputPixelType)==null?void 0:m.toLowerCase();if(e==null||!C.has(e))throw new mt("raster-function-helper",`unsupported raster function: ${e}`);const r=C.get(e),a=(typeof r.ctor=="function"?r.ctor:r.ctor.default).fromJSON({...o,outputPixelType:i}),{rasterArgumentNames:s}=a,u=[],l=fr(n,s),p=s[0]==="rasters",f=[];for(let y=0;ytypeof r=="object"&&r.type==="RasterFunctionVariable"?qt(r,t):r);if("value"in e&&["number","string","boolean"].includes(typeof e.value))return e.value;if(o.isDataset&&e.type!=="Scalar")return"$$";if(!("type"in e))return e;let n=e;switch(e.type){case"Scalar":n=e.value;break;case"AlgorithmicColorRamp":n=$e(e);break;case"MultiPartColorRamp":n={type:"multipart",colorRamps:e.ArrayOfColorRamp.map($e)};break;case"ArgumentArray":if((i=e.elements)!=null&&i.length&&e.elements[0].type!=="RasterStatistics"){const r=[];for(let a=0;a{if(typeof s=="object")if(s._object_ref_id!=null){if(!e.has(s._object_ref_id))throw new mt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${r} does not exist`);const l=e.get(a);l&&typeof l=="object"?Object.assign(s,l):r[u]=l}else Xt({renderingRule:s,templates:e})}));else{if(!e.has(a))throw new mt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${a} does not exist`);const s=e.get(a);i!=="_object_ref_id"?n[i]=s:s&&typeof s=="object"&&Object.assign(n,s)}}}function mr(o){var t;(t=o.Statistics)!=null&&t.length&&typeof o.Statistics=="object"&&(o.Statistics=o.Statistics.map(e=>[e.min,e.max,e.mean,e.standardDeviation])),o.NumberOfStandardDeviation!=null&&(o.NumberOfStandardDeviations=o.NumberOfStandardDeviation,delete o.NumberOfStandardDeviation)}function dr(o){var t,e;((e=(t=o.ColorRamp)==null?void 0:t.type)==null?void 0:e.toLowerCase())==="randomcolorramp"&&(delete o.ColorRamp,o.ColormapName="Random"),o.ColorSchemeType===0&&delete o.ColorRamp}function gr(o){o.ConvolutionType!=null&&(o.Type=o.ConvolutionType,delete o.ConvolutionType)}function yr(o){var t;(t=o.NoDataValues)!=null&&t.length&&typeof o.NoDataValues[0]=="string"&&(o.NoDataValues=o.NoDataValues.filter(e=>e!=="").map(e=>Number(e)))}C.set("Aspect",{desc:"Aspect Function",ctor:us,rasterArgumentNames:["raster"]}),C.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:Ss,rasterArgumentNames:["raster"]}),C.set("Colormap",{desc:"Colormap Function",ctor:Ws,rasterArgumentNames:["raster"]}),C.set("CompositeBand",{desc:"CompositeBand Function",ctor:Xs,rasterArgumentNames:["rasters"]}),C.set("Convolution",{desc:"Convolution Function",ctor:sn,rasterArgumentNames:["raster"]}),C.set("ExtractBand",{desc:"ExtractBand Function",ctor:an,rasterArgumentNames:["raster"]}),C.set("Curvature",{desc:"Curvature Function",ctor:rn,rasterArgumentNames:["raster"]}),C.set("Local",{desc:"Local Function",ctor:Jn,rasterArgumentNames:["rasters"]}),C.set("Mask",{desc:"Mask Function",ctor:Kn,rasterArgumentNames:["raster"]}),C.set("NDVI",{desc:"NDVI Function",ctor:Qn,rasterArgumentNames:["raster"]}),C.set("Remap",{desc:"Remap Function",ctor:er,rasterArgumentNames:["raster"]}),C.set("Slope",{desc:"Slope Function",ctor:rr,rasterArgumentNames:["raster"]}),C.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:ir,rasterArgumentNames:["raster"]}),C.set("Stretch",{desc:"Stretch Function",ctor:lr,rasterArgumentNames:["raster"]}),C.set("Table",{desc:"Attribute Table Function",ctor:pr,rasterArgumentNames:["raster"]});let bt=class extends Zt{get affectsPixelSize(){return!1}forwardTransform(o){return o}inverseTransform(o){return o}};c([h()],bt.prototype,"affectsPixelSize",null),c([h({json:{write:!0}})],bt.prototype,"spatialReference",void 0),bt=c([w("esri.layers.support.rasterTransforms.BaseRasterTransform")],bt);const se=bt;var Ht;let vt=Ht=class extends se{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(o){return(o=o.clone()).type==="point"?(o.x>180+this.tolerance&&(o.x-=360),o):(o.xmin>=180-this.tolerance?(o.xmax-=360,o.xmin-=360):o.xmax>180+this.tolerance&&(o.xmin=-180,o.xmax=180),o)}inverseTransform(o){return(o=o.clone()).type==="point"?(o.x<-this.tolerance&&(o.x+=360),o):(o.xmin<-this.tolerance&&(o.xmin+=360,o.xmax+=360),o)}clone(){return new Ht({tolerance:this.tolerance})}};c([q({GCSShiftXform:"gcs-shift"})],vt.prototype,"type",void 0),c([h()],vt.prototype,"tolerance",void 0),vt=Ht=c([w("esri.layers.support.rasterTransforms.GCSShiftTransform")],vt);const br=vt;var Jt;let Pt=Jt=class extends se{constructor(){super(...arguments),this.type="identity"}clone(){return new Jt}};c([q({IdentityXform:"identity"})],Pt.prototype,"type",void 0),Pt=Jt=c([w("esri.layers.support.rasterTransforms.IdentityTransform")],Pt);const vr=Pt;var Yt;function Kt(o,t,e){const{x:n,y:i}=t;if(e<2)return{x:o[0]+n*o[2]+i*o[4],y:o[1]+n*o[3]+i*o[5]};if(e===2){const m=n*n,g=i*i,y=n*i;return{x:o[0]+n*o[2]+i*o[4]+m*o[6]+y*o[8]+g*o[10],y:o[1]+n*o[3]+i*o[5]+m*o[7]+y*o[9]+g*o[11]}}const r=n*n,a=i*i,s=n*i,u=r*n,l=r*i,p=n*a,f=i*a;return{x:o[0]+n*o[2]+i*o[4]+r*o[6]+s*o[8]+a*o[10]+u*o[12]+l*o[14]+p*o[16]+f*o[18],y:o[1]+n*o[3]+i*o[5]+r*o[7]+s*o[9]+a*o[11]+u*o[13]+l*o[15]+p*o[17]+f*o[19]}}function Fe(o,t,e){const{xmin:n,ymin:i,xmax:r,ymax:a,spatialReference:s}=t;let u=[];if(e<2)u.push({x:n,y:a}),u.push({x:r,y:a}),u.push({x:n,y:i}),u.push({x:r,y:i});else{let f=10;for(let m=0;mKt(o,f,e));const l=u.map(f=>f.x),p=u.map(f=>f.y);return new Ue({xmin:Math.min.apply(null,l),xmax:Math.max.apply(null,l),ymin:Math.min.apply(null,p),ymax:Math.max.apply(null,p),spatialReference:s})}function wr(o){const[t,e,n,i,r,a]=o,s=n*a-r*i,u=r*i-n*a;return[(r*e-t*a)/s,(n*e-t*i)/u,a/s,i/u,-r/s,-n/u]}let j=Yt=class extends se{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(o,t){const{coeffX:e,coeffY:n}=t;if(!(e!=null&&e.length)||!(n!=null&&n.length)||e.length!==n.length)return null;const i=[];for(let r=0;r0}forwardTransform(o){if(o.type==="point"){const t=Kt(this.forwardCoefficients,o,this.polynomialOrder);return new re({x:t.x,y:t.y,spatialReference:o.spatialReference})}return Fe(this.forwardCoefficients,o,this.polynomialOrder)}inverseTransform(o){if(o.type==="point"){const t=Kt(this.inverseCoefficients,o,this.polynomialOrder);return new re({x:t.x,y:t.y,spatialReference:o.spatialReference})}return Fe(this.inverseCoefficients,o,this.polynomialOrder)}clone(){return new Yt({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};c([h({json:{write:!0}})],j.prototype,"polynomialOrder",void 0),c([h()],j.prototype,"forwardCoefficients",void 0),c([ht("forwardCoefficients",["coeffX","coeffY"])],j.prototype,"readForwardCoefficients",null),c([ft("forwardCoefficients")],j.prototype,"writeForwardCoefficients",null),c([h({json:{write:!0}})],j.prototype,"inverseCoefficients",null),c([ht("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],j.prototype,"readInverseCoefficients",null),c([ft("inverseCoefficients")],j.prototype,"writeInverseCoefficients",null),c([h()],j.prototype,"affectsPixelSize",null),c([q({PolynomialXform:"polynomial"})],j.prototype,"type",void 0),j=Yt=c([w("esri.layers.support.rasterTransforms.PolynomialTransform")],j);const xr=j,Oe={GCSShiftXform:br,IdentityXform:vr,PolynomialXform:xr},Ar=Object.keys(Oe);function Lr(o){const t=o==null?void 0:o.type;return!o||Ar.includes(t)}function Wr(o){if(!(o==null?void 0:o.type))return null;const e=Oe[o==null?void 0:o.type];if(e){const n=new e;return n.read(o),n}return null}export{Ur as _,Lr as f,hr as h,Wr as i,br as n,xr as y}; diff --git a/assets/utils-2fe9d339.js b/assets/utils-2fe9d339.js new file mode 100644 index 0000000..a1d7a63 --- /dev/null +++ b/assets/utils-2fe9d339.js @@ -0,0 +1 @@ +import{a as F,d as z}from"./generateRendererUtils-1e52a587.js";const D="",I="equal-interval",N=1,S=5,M=10,C=/\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*/gi,T=new Set(["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble"]),k=["min","max","avg","stddev","count","sum","variance","nullcount","median"];function b(t){return t==null||typeof t=="string"&&!t?D:t}function $(t){const e=t.normalizationField!=null||t.normalizationType!=null,l=t.minValue!=null||t.maxValue!=null,n=!!t.sqlExpression&&t.supportsSQLExpression;return!e&&!l&&!n}function Y(t){const e=t.returnDistinct?[...new Set(t.values)]:t.values,l=e.filter(i=>i!=null).sort(),n=l.length,r={count:n,min:l[0],max:l[n-1]};return t.supportsNullCount&&(r.nullcount=e.length-n),t.percentileParams&&(r.median=y(e,t.percentileParams)),r}function w(t){const{values:e,useSampleStdDev:l,supportsNullCount:n}=t;let r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,a=null,o=null,u=null,d=null,c=0;const f=t.minValue==null?-1/0:t.minValue,m=t.maxValue==null?1/0:t.maxValue;for(const s of e)Number.isFinite(s)?s>=f&&s<=m&&(a=a===null?s:a+s,r=Math.min(r,s),i=Math.max(i,s),c++):typeof s=="string"&&c++;if(c&&a!=null){o=a/c;let s=0;for(const v of e)Number.isFinite(v)&&v>=f&&v<=m&&(s+=(v-o)**2);d=l?c>1?s/(c-1):0:c>0?s/c:0,u=Math.sqrt(d)}else r=null,i=null;const p={avg:o,count:c,max:i,min:r,stddev:u,sum:a,variance:d};return n&&(p.nullcount=e.length-c),t.percentileParams&&(p.median=y(e,t.percentileParams)),p}function y(t,e){const{fieldType:l,value:n,orderBy:r,isDiscrete:i}=e,a=E(l,r==="desc");if((t=[...t].filter(p=>p!=null).sort((p,s)=>a(p,s))).length===0)return null;if(n<=0)return t[0];if(n>=1)return t[t.length-1];const o=(t.length-1)*n,u=Math.floor(o),d=u+1,c=o%1,f=t[u],m=t[d];return d>=t.length||i||typeof f=="string"||typeof m=="string"?f:f*(1-c)+m*c}function E(t,e){const l=e?1:-1,n=q(e),r=g(e);if(!(t&&["esriFieldTypeDate","esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...T].includes(t)))return(i,a)=>typeof i=="number"&&typeof a=="number"?n(i,a):typeof i=="string"&&typeof a=="string"?r(i,a):l;if(t==="esriFieldTypeDate")return(i,a)=>{const o=new Date(i).getTime(),u=new Date(a).getTime();return isNaN(o)||isNaN(u)?l:n(o,u)};if(T.has(t))return(i,a)=>n(i,a);if(t==="esriFieldTypeString")return(i,a)=>r(i,a);if(t==="esriFieldTypeGUID"||t==="esriFieldTypeGlobalID"){const i=g(e);return(a,o)=>i(x(a),x(o))}return e?(i,a)=>1:(i,a)=>-1}function V(t,e,l){if(l){if(t==null)return e==null?0:1;if(e==null)return-1}else{if(t==null)return e==null?0:-1;if(e==null)return 1}return null}function g(t){return t?(e,l)=>{const n=V(e,l,!0);return n??((e=e.toUpperCase())>(l=l.toUpperCase())?-1:e{const n=V(e,l,!1);return n??((e=e.toUpperCase())<(l=l.toUpperCase())?-1:e>l?1:0)}}function q(t){return t?(e,l)=>{const n=V(e,l,!0);return n??l-e}:(e,l)=>{const n=V(e,l,!1);return n??e-l}}function x(t){return t.substr(24,12)+t.substr(19,4)+t.substr(16,2)+t.substr(14,2)+t.substr(11,2)+t.substr(9,2)+t.substr(6,2)+t.substr(4,2)+t.substr(2,2)+t.substr(0,2)}function _(t,e){let l;for(l in t)k.includes(l)&&(Number.isFinite(t[l])||(t[l]=null));return e&&["avg","stddev","variance"].forEach(n=>{t[n]!=null&&(t[n]=Math.ceil(t[n]??0))}),t}function Q(t){const e={};for(let l of t)(l==null||typeof l=="string"&&l.trim()==="")&&(l=null),e[l]==null?e[l]={count:1,data:l}:e[l].count++;return{count:e}}function h(t){return(t==null?void 0:t.type)!=="coded-value"?[]:t.codedValues.map(e=>e.code)}function j(t,e,l,n){const r=t.count,i=[];if(l&&e){const a=[],o=h(e[0]);for(const u of o)if(e[1]){const d=h(e[1]);for(const c of d)if(e[2]){const f=h(e[2]);for(const m of f)a.push(`${b(u)}${n}${b(c)}${n}${b(m)}`)}else a.push(`${b(u)}${n}${b(c)}`)}else a.push(u);for(const u of a)r.hasOwnProperty(u)||(r[u]={data:u,count:0})}for(const a in r){const o=r[a];i.push({value:o.data,count:o.count,label:o.label})}return{uniqueValueInfos:i}}function H(t,e,l,n){let r=null;switch(e){case"log":t!==0&&(r=Math.log(t)*Math.LOG10E);break;case"percent-of-total":Number.isFinite(n)&&n!==0&&(r=t/n*100);break;case"field":Number.isFinite(l)&&l!==0&&(r=t/l);break;case"natural-log":t>0&&(r=Math.log(t));break;case"square-root":t>0&&(r=t**.5)}return r}function G(t,e){const l=U({field:e.field,normalizationType:e.normalizationType,normalizationField:e.normalizationField,classificationMethod:e.classificationMethod,standardDeviationInterval:e.standardDeviationInterval,breakCount:e.numClasses||S});return t=P(t,e.minValue,e.maxValue),F({definition:l,values:t,normalizationTotal:e.normalizationTotal})}function P(t,e,l){const n=e??-1/0,r=l??1/0;return t.filter(i=>Number.isFinite(i)&&i>=n&&i<=r)}function U(t){const{breakCount:e,field:l,normalizationField:n,normalizationType:r}=t,i=t.classificationMethod||I,a=i==="standard-deviation"?t.standardDeviationInterval||N:void 0;return new z({breakCount:e,classificationField:l,classificationMethod:i,normalizationField:r==="field"?n:void 0,normalizationType:r,standardDeviationInterval:a})}function J(t,e){var u,d;let l=t.classBreaks;const n=l.length,r=(u=l[0])==null?void 0:u.minValue,i=(d=l[n-1])==null?void 0:d.maxValue,a=e==="standard-deviation",o=C;return l=l.map(c=>{const f=c.label,m={minValue:c.minValue,maxValue:c.maxValue,label:f};if(a&&f){const p=f.match(o),s=(p==null?void 0:p.map(v=>+v.trim()))??[];s.length===2?(m.minStdDev=s[0],m.maxStdDev=s[1],s[0]<0&&s[1]>0&&(m.hasAvg=!0)):s.length===1&&(f.includes("<")?(m.minStdDev=null,m.maxStdDev=s[0]):f.includes(">")&&(m.minStdDev=s[0],m.maxStdDev=null))}return m}),{minValue:r,maxValue:i,classBreakInfos:l,normalizationTotal:t.normalizationTotal}}function K(t,e){const l=B(t,e);if(l.min==null&&l.max==null)return{bins:[],minValue:l.min,maxValue:l.max,normalizationTotal:e.normalizationTotal};const n=l.intervals,r=l.min??0,i=l.max??0,a=n.map((o,u)=>({minValue:n[u][0],maxValue:n[u][1],count:0}));for(const o of t)if(o!=null&&o>=r&&o<=i){const u=O(n,o);u>-1&&a[u].count++}return{bins:a,minValue:r,maxValue:i,normalizationTotal:e.normalizationTotal}}function B(t,e){const{field:l,classificationMethod:n,standardDeviationInterval:r,normalizationType:i,normalizationField:a,normalizationTotal:o,minValue:u,maxValue:d}=e,c=e.numBins||M;let f=null,m=null,p=null;if((!n||n==="equal-interval")&&!i){if(u!=null&&d!=null)f=u,m=d;else{const s=w({values:t,minValue:u,maxValue:d,useSampleStdDev:!i,supportsNullCount:$({normalizationType:i,normalizationField:a,minValue:u,maxValue:d})});f=s.min??null,m=s.max??null}p=A(f??0,m??0,c)}else{const{classBreaks:s}=G(t,{field:l,normalizationType:i,normalizationField:a,normalizationTotal:o,classificationMethod:n,standardDeviationInterval:r,minValue:u,maxValue:d,numClasses:c});f=s[0].minValue,m=s[s.length-1].maxValue,p=s.map(v=>[v.minValue,v.maxValue])}return{min:f,max:m,intervals:p}}function O(t,e){let l=-1;for(let n=t.length-1;n>=0;n--)if(e>=t[n][0]){l=n;break}return l}function A(t,e,l){const n=(e-t)/l,r=[];let i,a=t;for(let o=1;o<=l;o++)i=a+n,i=Number(i.toFixed(16)),r.push([a,o===l?e:i]),a=i;return r}export{G as D,j as F,K as M,J as S,b as c,w as d,Y as f,_ as g,$ as m,y as p,E as v,Q as x,H as z}; diff --git a/assets/utils3-4f0533d1.js b/assets/utils3-4f0533d1.js new file mode 100644 index 0000000..fe15e1b --- /dev/null +++ b/assets/utils3-4f0533d1.js @@ -0,0 +1,5 @@ +import"./index-080e108a.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.6.1 + */const u={container:"container",containerBorderSelected:"container--border-selected",containerBorderUnselected:"container--border-unselected",contentContainer:"content-container",contentContainerSelectable:"content-container--selectable",contentContainerHasCenterContent:"content-container--has-center-content",nestedContainer:"nested-container",nestedContainerHidden:"nested-container--hidden",content:"content",customContent:"custom-content",actionsStart:"actions-start",contentStart:"content-start",label:"label",description:"description",contentEnd:"content-end",actionsEnd:"actions-end",selectionContainer:"selection-container",openContainer:"open-container",dragContainer:"drag-container"},m={actionsStart:"actions-start",contentStart:"content-start",content:"content",contentEnd:"content-end",actionsEnd:"actions-end"},S=0,C={selectedMultiple:"check-circle-f",selectedSingle:"circle-f",unselected:"blank",closedLTR:"caret-right",closedRTL:"caret-left",open:"caret-down",blank:"blank",close:"x"},a="calcite-list",i="calcite-list-item-group",r="calcite-list-item";function p(n){const e=n.assignedElements({flatten:!0}),c=e.filter(t=>t==null?void 0:t.matches(i)).map(t=>Array.from(t.querySelectorAll(r))).reduce((t,o)=>[...t,...o],[]),s=e.filter(t=>t==null?void 0:t.matches(r));return[...e.filter(t=>t==null?void 0:t.matches(a)).map(t=>Array.from(t.querySelectorAll(r))).reduce((t,o)=>[...t,...o],[]),...c,...s]}function h(n){n.forEach(e=>{e.setPosition=n.indexOf(e)+1,e.setSize=n.length})}function f(n,e=!1){const c=e?"ancestor::calcite-list-item | ancestor::calcite-list-item-group":"ancestor::calcite-list-item";return document.evaluate(c,n,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotLength}export{u as C,C as I,S as M,m as S,p as a,f as g,h as u}; diff --git a/assets/versionUtils-f17daa93.js b/assets/versionUtils-f17daa93.js new file mode 100644 index 0000000..ff30954 --- /dev/null +++ b/assets/versionUtils-f17daa93.js @@ -0,0 +1 @@ +import{cB as f}from"./index-080e108a.js";const e=[];function l(d,t){if(f(d.url??""))return!0;const{wkid:o}=t;for(const r of e){if((d.version??0)>=r[0])return!0;if(typeof r[1]=="function"&&(r[1]=r[1]()),r[1].has(o))return!1}return!0}e.push([10.91,()=>{const d=new Set([9709,9716,9741,9761,9766]);for(let t=9712;t<=9713;t++)d.add(t);for(let t=9748;t<=9749;t++)d.add(t);for(let t=20904;t<=20932;t++)d.add(t);for(let t=21004;t<=21032;t++)d.add(t);for(let t=21207;t<=21264;t++)d.add(t);for(let t=21307;t<=21364;t++)d.add(t);for(let t=102759;t<=102760;t++)d.add(t);for(let t=102901;t<=102955;t++)d.add(t);return d}]),e.push([10.9,()=>{const d=new Set([9300,9354,9364,9367,9373,9377,9387,9456,9473,9498,9678,9680,29874,103599,103872,104028]);for(let t=9356;t<=9360;t++)d.add(t);for(let t=9404;t<=9407;t++)d.add(t);for(let t=9476;t<=9482;t++)d.add(t);for(let t=9487;t<=9494;t++)d.add(t);for(let t=9697;t<=9699;t++)d.add(t);return d}]),e.push([10.81,()=>{const d=new Set([9265,9333,103598,103699]);for(let t=9248;t<=9254;t++)d.add(t);for(let t=9271;t<=9273;t++)d.add(t);for(let t=9284;t<=9285;t++)d.add(t);for(let t=21453;t<=21463;t++)d.add(t);return d}]),e.push([10.8,()=>{const d=new Set([8088,8395,8428,8433,8531,8687,8692,8694,8699,8900,9003,9006,9009,9012,9017,9191]);for(let t=8035;t<=8036;t++)d.add(t);for(let t=8455;t<=8456;t++)d.add(t);for(let t=8518;t<=8529;t++)d.add(t);for(let t=8533;t<=8536;t++)d.add(t);for(let t=8538;t<=8540;t++)d.add(t);for(let t=8677;t<=8679;t++)d.add(t);for(let t=8902;t<=8903;t++)d.add(t);for(let t=8907;t<=8910;t++)d.add(t);for(let t=8949;t<=8951;t++)d.add(t);for(let t=8972;t<=8987;t++)d.add(t);for(let t=9039;t<=9040;t++)d.add(t);for(let t=9068;t<=9069;t++)d.add(t);for(let t=9140;t<=9141;t++)d.add(t);for(let t=9148;t<=9150;t++)d.add(t);for(let t=9153;t<=9159;t++)d.add(t);for(let t=9205;t<=9218;t++)d.add(t);for(let t=9221;t<=9222;t++)d.add(t);for(let t=54098;t<=54101;t++)d.add(t);return d}]),e.push([10.71,()=>{const d=new Set([6316]);for(let t=8351;t<=8353;t++)d.add(t);for(let t=9294;t<=9297;t++)d.add(t);for(let t=22619;t<=22621;t++)d.add(t);for(let t=103586;t<=103594;t++)d.add(t);return d}]),e.push([10.7,()=>{const d=new Set([8387,8391,8427,8545,8682,8685,8818,31370,104022,104024,104975]);for(let t=8065;t<=8068;t++)d.add(t);for(let t=8082;t<=8083;t++)d.add(t);for(let t=8379;t<=8385;t++)d.add(t);for(let t=8836;t<=8840;t++)d.add(t);for(let t=8857;t<=8860;t++)d.add(t);for(let t=53035;t<=53037;t++)d.add(t);for(let t=54090;t<=54091;t++)d.add(t);for(let t=102498;t<=102499;t++)d.add(t);return d}]),e.push([10.61,()=>new Set([102497])]),e.push([10.6,()=>{const d=new Set([7803,7805,7887,8086,8232,8237,8240,8246,8249,8252,8255,9019,9391]);for(let t=7755;t<=7787;t++)d.add(t);for(let t=7791;t<=7795;t++)d.add(t);for(let t=7799;t<=7801;t++)d.add(t);for(let t=7825;t<=7831;t++)d.add(t);for(let t=7877;t<=7878;t++)d.add(t);for(let t=7882;t<=7883;t++)d.add(t);for(let t=7991;t<=7992;t++)d.add(t);for(let t=8042;t<=8043;t++)d.add(t);for(let t=8058;t<=8059;t++)d.add(t);for(let t=8311;t<=8348;t++)d.add(t);for(let t=9060;t<=9067;t++)d.add(t);for(let t=102562;t<=102568;t++)d.add(t);for(let t=102799;t<=102900;t++)d.add(t);return d}]),e.push([10.51,()=>{const d=new Set([7683,7881,7886,7899,8888,9e3]);for(let t=8013;t<=8032;t++)d.add(t);for(let t=9053;t<=9057;t++)d.add(t);for(let t=104017;t<=104018;t++)d.add(t);for(let t=104971;t<=104974;t++)d.add(t);return d}]),e.push([10.5,()=>{const d=new Set([6962,7035,7037,7039,7041,7084,7086,7133,7798,102399]);for(let t=4087;t<=4088;t++)d.add(t);for(let t=5896;t<=5899;t++)d.add(t);for(let t=7005;t<=7007;t++)d.add(t);for(let t=7057;t<=7070;t++)d.add(t);for(let t=7073;t<=7082;t++)d.add(t);for(let t=7109;t<=7128;t++)d.add(t);for(let t=7844;t<=7859;t++)d.add(t);return d}]);export{l as e}; diff --git a/assets/vi_VN2-8bff547b.js b/assets/vi_VN2-8bff547b.js new file mode 100644 index 0000000..8ada724 --- /dev/null +++ b/assets/vi_VN2-8bff547b.js @@ -0,0 +1 @@ +const t={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"sau CN",_era_bc:"Trước CN",A:"s",P:"c",AM:"SA",PM:"CH","A.M.":"SA","P.M.":"CH",January:"tháng 1",February:"tháng 2",March:"tháng 3",April:"tháng 4",May:"tháng 5",June:"tháng 6",July:"tháng 7",August:"tháng 8",September:"tháng 9",October:"tháng 10",November:"tháng 11",December:"tháng 12",Jan:"thg 1",Feb:"thg 2",Mar:"thg 3",Apr:"thg 4","May(short)":"thg 5",Jun:"thg 6",Jul:"thg 7",Aug:"thg 8",Sep:"thg 9",Oct:"thg 10",Nov:"thg 11",Dec:"thg 12",Sunday:"Chủ Nhật",Monday:"Thứ Hai",Tuesday:"Thứ Ba",Wednesday:"Thứ Tư",Thursday:"Thứ Năm",Friday:"Thứ Sáu",Saturday:"Thứ Bảy",Sun:"CN",Mon:"Th 2",Tue:"Th 3",Wed:"Th 4",Thu:"Th 5",Fri:"Th 6",Sat:"Th 7",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Thu phóng",Play:"Phát",Stop:"Dừng",Legend:"Chú giải","Press ENTER to toggle":"",Loading:"Đang tải",Home:"Trang chủ",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"In",Image:"Hình ảnh",Data:"Dữ liệu",Print:"In","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Từ %1 đến %2","From %1":"Từ %1","To %1":"Đến %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{t as default}; diff --git a/assets/vxlLayer-78040c8d.js b/assets/vxlLayer-78040c8d.js new file mode 100644 index 0000000..fc19717 --- /dev/null +++ b/assets/vxlLayer-78040c8d.js @@ -0,0 +1,5 @@ +import{bU as Xo}from"./index-080e108a.js";function Qo(G,sr){for(var Q=0;Qs[Z]})}}}return Object.freeze(Object.defineProperty(G,Symbol.toStringTag,{value:"Module"}))}var Ae,zr,Pe,Tr={exports:{}};Tr.exports,Ae=Tr,Tr.exports,zr=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,Pe=function(G){var sr,Q,s=(G=G||{})!==void 0?G:{};s.ready=new Promise(function(r,e){sr=r,Q=e});var Z,tr,Te,Ur=Object.assign({},s),Hr="./this.program",je=!0,Y="";function Be(r){return s.locateFile?s.locateFile(r,Y):Y+r}typeof document<"u"&&document.currentScript&&(Y=document.currentScript.src),zr&&(Y=zr),Y=Y.indexOf("blob:")!==0?Y.substr(0,Y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",Z=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},tr=(r,e,n)=>{var t=new XMLHttpRequest;t.open("GET",r,!0),t.responseType="arraybuffer",t.onload=()=>{t.status==200||t.status==0&&t.response?e(t.response):n()},t.onerror=n,t.send(null)};var cr,jr,Br=s.print||console.log.bind(console),R=s.printErr||console.warn.bind(console);Object.assign(s,Ur),Ur=null,s.arguments&&s.arguments,s.thisProgram&&(Hr=s.thisProgram),s.quit&&s.quit,s.wasmBinary&&(cr=s.wasmBinary),s.noExitRuntime,typeof WebAssembly!="object"&&U("no native wasm support detected");var Vr=!1;function Me(r,e){r||U(e)}var hr,D,P,z,or,v,k,ar,qr,J,Gr=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ir(r,e,n){for(var t=e+n,a=e;r[a]&&!(a>=t);)++a;if(a-e>16&&r.buffer&&Gr)return Gr.decode(r.subarray(e,a));for(var i="";e>10,56320|1023&l)}}else i+=String.fromCharCode((31&u)<<6|c)}else i+=String.fromCharCode(u)}return i}function M(r,e){return r?ir(P,r,e):""}function Mr(r,e,n,t){if(!(t>0))return 0;for(var a=n,i=n+t-1,u=0;u=55296&&c<=57343&&(c=65536+((1023&c)<<10)|1023&r.charCodeAt(++u)),c<=127){if(n>=i)break;e[n++]=c}else if(c<=2047){if(n+1>=i)break;e[n++]=192|c>>6,e[n++]=128|63&c}else if(c<=65535){if(n+2>=i)break;e[n++]=224|c>>12,e[n++]=128|c>>6&63,e[n++]=128|63&c}else{if(n+3>=i)break;e[n++]=240|c>>18,e[n++]=128|c>>12&63,e[n++]=128|c>>6&63,e[n++]=128|63&c}}return e[n]=0,n-a}function Yr(r,e,n){return Mr(r,P,e,n)}function gr(r){for(var e=0,n=0;n=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&r.charCodeAt(++n)),t<=127?++e:e+=t<=2047?2:t<=65535?3:4}return e}function Xr(r){hr=r,s.HEAP8=D=new Int8Array(r),s.HEAP16=z=new Int16Array(r),s.HEAP32=v=new Int32Array(r),s.HEAPU8=P=new Uint8Array(r),s.HEAPU16=or=new Uint16Array(r),s.HEAPU32=k=new Uint32Array(r),s.HEAPF32=ar=new Float32Array(r),s.HEAPF64=qr=new Float64Array(r)}s.INITIAL_MEMORY;var Qr=[],Jr=[],Kr=[];function Ie(){if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)Re(s.preRun.shift());Ir(Qr)}function Ne(){s.noFSInit||o.init.initialized||o.init(),o.ignorePermissions=!1,Ir(Jr)}function Le(){if(s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;)We(s.postRun.shift());Ir(Kr)}function Re(r){Qr.unshift(r)}function Oe(r){Jr.unshift(r)}function We(r){Kr.unshift(r)}var K=0,fr=null;function Jo(r){return r}function _r(r){K++,s.monitorRunDependencies&&s.monitorRunDependencies(K)}function lr(r){if(K--,s.monitorRunDependencies&&s.monitorRunDependencies(K),K==0&&fr){var e=fr;fr=null,e()}}function U(r){s.onAbort&&s.onAbort(r),R(r="Aborted("+r+")"),Vr=!0,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw Q(e),e}var O,C,H,Ze="data:application/octet-stream;base64,";function $r(r){return r.startsWith(Ze)}function re(r){try{if(r==O&&cr)return new Uint8Array(cr);if(!Te)throw"both async and sync fetching of the wasm failed"}catch(e){U(e)}}function ze(){return!cr&&je&&typeof fetch=="function"?fetch(O,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+O+"'";return r.arrayBuffer()}).catch(function(){return re(O)}):Promise.resolve().then(function(){return re(O)})}function Ue(){var r={a:Go};function e(i,u){var c=i.exports;s.asm=c,Xr((jr=s.asm.Za).buffer),J=s.asm.$a,Oe(s.asm._a),lr()}function n(i){e(i.instance)}function t(i){return ze().then(function(u){return WebAssembly.instantiate(u,r)}).then(function(u){return u}).then(i,function(u){R("failed to asynchronously prepare wasm: "+u),U(u)})}function a(){return cr||typeof WebAssembly.instantiateStreaming!="function"||$r(O)||typeof fetch!="function"?t(n):fetch(O,{credentials:"same-origin"}).then(function(i){return WebAssembly.instantiateStreaming(i,r).then(n,function(u){return R("wasm streaming compile failed: "+u),R("falling back to ArrayBuffer instantiation"),t(n)})})}if(_r(),s.instantiateWasm)try{return s.instantiateWasm(r,e)}catch(i){return R("Module.instantiateWasm callback failed with error: "+i),!1}return a().catch(Q),{}}function Ir(r){for(;r.length>0;)r.shift()(s)}function He(r,e){D.set(r,e)}function Ve(r,e,n,t){U("Assertion failed: "+M(r)+", at: "+[e?M(e):"unknown filename",n,t?M(t):"unknown function"])}function qe(r){return Ar(r+24)+24}function Ge(r){this.excPtr=r,this.ptr=r-24,this.set_type=function(e){k[this.ptr+4>>2]=e},this.get_type=function(){return k[this.ptr+4>>2]},this.set_destructor=function(e){k[this.ptr+8>>2]=e},this.get_destructor=function(){return k[this.ptr+8>>2]},this.set_refcount=function(e){v[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,D[this.ptr+12>>0]=e},this.get_caught=function(){return D[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,D[this.ptr+13>>0]=e},this.get_rethrown=function(){return D[this.ptr+13>>0]!=0},this.init=function(e,n){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(n),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=v[this.ptr>>2];v[this.ptr>>2]=e+1},this.release_ref=function(){var e=v[this.ptr>>2];return v[this.ptr>>2]=e-1,e===1},this.set_adjusted_ptr=function(e){k[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return k[this.ptr+16>>2]},this.get_exception_ptr=function(){if(De(this.get_type()))return k[this.excPtr>>2];var e=this.get_adjusted_ptr();return e!==0?e:this.excPtr}}function Ye(r,e,n){throw new Ge(r).init(e,n),r}function Xe(r){return v[Fe()>>2]=r,r}$r(O="vxlLayer.wasm")||(O=Be(O));var x={isAbs:r=>r.charAt(0)==="/",splitPath:r=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1),normalizeArray:(r,e)=>{for(var n=0,t=r.length-1;t>=0;t--){var a=r[t];a==="."?r.splice(t,1):a===".."?(r.splice(t,1),n++):n&&(r.splice(t,1),n--)}if(e)for(;n;n--)r.unshift("..");return r},normalize:r=>{var e=x.isAbs(r),n=r.substr(-1)==="/";return(r=x.normalizeArray(r.split("/").filter(t=>!!t),!e).join("/"))||e||(r="."),r&&n&&(r+="/"),(e?"/":"")+r},dirname:r=>{var e=x.splitPath(r),n=e[0],t=e[1];return n||t?(t&&(t=t.substr(0,t.length-1)),n+t):"."},basename:r=>{if(r==="/")return"/";var e=(r=(r=x.normalize(r)).replace(/\/$/,"")).lastIndexOf("/");return e===-1?r:r.substr(e+1)},join:function(){var r=Array.prototype.slice.call(arguments,0);return x.normalize(r.join("/"))},join2:(r,e)=>x.normalize(r+"/"+e)};function Qe(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var r=new Uint8Array(1);return function(){return crypto.getRandomValues(r),r[0]}}return function(){U("randomDevice")}}var V={resolve:function(){for(var r="",e=!1,n=arguments.length-1;n>=-1&&!e;n--){var t=n>=0?arguments[n]:o.cwd();if(typeof t!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";r=t+"/"+r,e=x.isAbs(t)}return(e?"/":"")+(r=x.normalizeArray(r.split("/").filter(a=>!!a),!e).join("/"))||"."},relative:(r,e)=>{function n(l){for(var h=0;h=0&&l[_]==="";_--);return h>_?[]:l.slice(h,_-h+1)}r=V.resolve(r).substr(1),e=V.resolve(e).substr(1);for(var t=n(r.split("/")),a=n(e.split("/")),i=Math.min(t.length,a.length),u=i,c=0;c0?n:gr(r)+1,a=new Array(t),i=Mr(r,a,0,a.length);return e&&(a.length=i),a}var $={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){$.ttys[r]={input:[],output:[],ops:e},o.registerDevice(r,$.stream_ops)},stream_ops:{open:function(r){var e=$.ttys[r.node.rdev];if(!e)throw new o.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,e,n,t,a){if(!r.tty||!r.tty.ops.get_char)throw new o.ErrnoError(60);for(var i=0,u=0;u0&&(Br(ir(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){e===null||e===10?(R(ir(r.output,0)),r.output=[]):e!=0&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(R(ir(r.output,0)),r.output=[])}}};function ee(r){U()}var y={ops_table:null,mount:function(r){return y.createNode(null,"/",16895,0)},createNode:function(r,e,n,t){if(o.isBlkdev(n)||o.isFIFO(n))throw new o.ErrnoError(63);y.ops_table||(y.ops_table={dir:{node:{getattr:y.node_ops.getattr,setattr:y.node_ops.setattr,lookup:y.node_ops.lookup,mknod:y.node_ops.mknod,rename:y.node_ops.rename,unlink:y.node_ops.unlink,rmdir:y.node_ops.rmdir,readdir:y.node_ops.readdir,symlink:y.node_ops.symlink},stream:{llseek:y.stream_ops.llseek}},file:{node:{getattr:y.node_ops.getattr,setattr:y.node_ops.setattr},stream:{llseek:y.stream_ops.llseek,read:y.stream_ops.read,write:y.stream_ops.write,allocate:y.stream_ops.allocate,mmap:y.stream_ops.mmap,msync:y.stream_ops.msync}},link:{node:{getattr:y.node_ops.getattr,setattr:y.node_ops.setattr,readlink:y.node_ops.readlink},stream:{}},chrdev:{node:{getattr:y.node_ops.getattr,setattr:y.node_ops.setattr},stream:o.chrdev_stream_ops}});var a=o.createNode(r,e,n,t);return o.isDir(a.mode)?(a.node_ops=y.ops_table.dir.node,a.stream_ops=y.ops_table.dir.stream,a.contents={}):o.isFile(a.mode)?(a.node_ops=y.ops_table.file.node,a.stream_ops=y.ops_table.file.stream,a.usedBytes=0,a.contents=null):o.isLink(a.mode)?(a.node_ops=y.ops_table.link.node,a.stream_ops=y.ops_table.link.stream):o.isChrdev(a.mode)&&(a.node_ops=y.ops_table.chrdev.node,a.stream_ops=y.ops_table.chrdev.stream),a.timestamp=Date.now(),r&&(r.contents[e]=a,r.timestamp=a.timestamp),a},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var n=r.contents?r.contents.length:0;if(!(n>=e)){var t=1048576;e=Math.max(e,n*(n>>0),n!=0&&(e=Math.max(e,256));var a=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(a.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(e==0)r.contents=null,r.usedBytes=0;else{var n=r.contents;r.contents=new Uint8Array(e),n&&r.contents.set(n.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=o.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,o.isDir(r.mode)?e.size=4096:o.isFile(r.mode)?e.size=r.usedBytes:o.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){e.mode!==void 0&&(r.mode=e.mode),e.timestamp!==void 0&&(r.timestamp=e.timestamp),e.size!==void 0&&y.resizeFileStorage(r,e.size)},lookup:function(r,e){throw o.genericErrors[44]},mknod:function(r,e,n,t){return y.createNode(r,e,n,t)},rename:function(r,e,n){if(o.isDir(r.mode)){var t;try{t=o.lookupNode(e,n)}catch{}if(t)for(var a in t.contents)throw new o.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=n,e.contents[n]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var n=o.lookupNode(r,e);for(var t in n.contents)throw new o.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[".",".."];for(var n in r.contents)r.contents.hasOwnProperty(n)&&e.push(n);return e},symlink:function(r,e,n){var t=y.createNode(r,e,41471,0);return t.link=n,t},readlink:function(r){if(!o.isLink(r.mode))throw new o.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,n,t,a){var i=r.node.contents;if(a>=r.node.usedBytes)return 0;var u=Math.min(r.node.usedBytes-a,t);if(u>8&&i.subarray)e.set(i.subarray(a,a+u),n);else for(var c=0;c0||n+e{if(!(r=V.resolve(o.cwd(),r)))return{path:"",node:null};var n={follow_mount:!0,recurse_count:0};if((e=Object.assign(n,e)).recurse_count>8)throw new o.ErrnoError(32);for(var t=x.normalizeArray(r.split("/").filter(h=>!!h),!1),a=o.root,i="/",u=0;u40)throw new o.ErrnoError(32)}}return{path:i,node:a}},getPath:r=>{for(var e;;){if(o.isRoot(r)){var n=r.mount.mountpoint;return e?n[n.length-1]!=="/"?n+"/"+e:n+e:n}e=e?r.name+"/"+e:r.name,r=r.parent}},hashName:(r,e)=>{for(var n=0,t=0;t>>0)%o.nameTable.length},hashAddNode:r=>{var e=o.hashName(r.parent.id,r.name);r.name_next=o.nameTable[e],o.nameTable[e]=r},hashRemoveNode:r=>{var e=o.hashName(r.parent.id,r.name);if(o.nameTable[e]===r)o.nameTable[e]=r.name_next;else for(var n=o.nameTable[e];n;){if(n.name_next===r){n.name_next=r.name_next;break}n=n.name_next}},lookupNode:(r,e)=>{var n=o.mayLookup(r);if(n)throw new o.ErrnoError(n,r);for(var t=o.hashName(r.id,e),a=o.nameTable[t];a;a=a.name_next){var i=a.name;if(a.parent.id===r.id&&i===e)return a}return o.lookup(r,e)},createNode:(r,e,n,t)=>{var a=new o.FSNode(r,e,n,t);return o.hashAddNode(a),a},destroyNode:r=>{o.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>(61440&r)==32768,isDir:r=>(61440&r)==16384,isLink:r=>(61440&r)==40960,isChrdev:r=>(61440&r)==8192,isBlkdev:r=>(61440&r)==24576,isFIFO:r=>(61440&r)==4096,isSocket:r=>(49152&r)==49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:r=>{var e=o.flagModes[r];if(e===void 0)throw new Error("Unknown file open mode: "+r);return e},flagsToPermissionString:r=>{var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:(r,e)=>o.ignorePermissions||(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2,mayLookup:r=>{var e=o.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate:(r,e)=>{try{return o.lookupNode(r,e),20}catch{}return o.nodePermissions(r,"wx")},mayDelete:(r,e,n)=>{var t;try{t=o.lookupNode(r,e)}catch(i){return i.errno}var a=o.nodePermissions(r,"wx");if(a)return a;if(n){if(!o.isDir(t.mode))return 54;if(o.isRoot(t)||o.getPath(t)===o.cwd())return 10}else if(o.isDir(t.mode))return 31;return 0},mayOpen:(r,e)=>r?o.isLink(r.mode)?32:o.isDir(r.mode)&&(o.flagsToPermissionString(e)!=="r"||512&e)?31:o.nodePermissions(r,o.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:(r=0,e=o.MAX_OPEN_FDS)=>{for(var n=r;n<=e;n++)if(!o.streams[n])return n;throw new o.ErrnoError(33)},getStream:r=>o.streams[r],createStream:(r,e,n)=>{o.FSStream||(o.FSStream=function(){this.shared={}},o.FSStream.prototype={},Object.defineProperties(o.FSStream.prototype,{object:{get:function(){return this.node},set:function(a){this.node=a}},isRead:{get:function(){return(2097155&this.flags)!=1}},isWrite:{get:function(){return(2097155&this.flags)!=0}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(a){this.shared.flags=a}},position:{get:function(){return this.shared.position},set:function(a){this.shared.position=a}}})),r=Object.assign(new o.FSStream,r);var t=o.nextfd(e,n);return r.fd=t,o.streams[t]=r,r},closeStream:r=>{o.streams[r]=null},chrdev_stream_ops:{open:r=>{var e=o.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:()=>{throw new o.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,e)=>r<<8|e,registerDevice:(r,e)=>{o.devices[r]={stream_ops:e}},getDevice:r=>o.devices[r],getMounts:r=>{for(var e=[],n=[r];n.length;){var t=n.pop();e.push(t),n.push.apply(n,t.mounts)}return e},syncfs:(r,e)=>{typeof r=="function"&&(e=r,r=!1),o.syncFSRequests++,o.syncFSRequests>1&&R("warning: "+o.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var n=o.getMounts(o.root.mount),t=0;function a(u){return o.syncFSRequests--,e(u)}function i(u){if(u)return i.errored?void 0:(i.errored=!0,a(u));++t>=n.length&&a(null)}n.forEach(u=>{if(!u.type.syncfs)return i(null);u.type.syncfs(u,r,i)})},mount:(r,e,n)=>{var t,a=n==="/",i=!n;if(a&&o.root)throw new o.ErrnoError(10);if(!a&&!i){var u=o.lookupPath(n,{follow_mount:!1});if(n=u.path,t=u.node,o.isMountpoint(t))throw new o.ErrnoError(10);if(!o.isDir(t.mode))throw new o.ErrnoError(54)}var c={type:r,opts:e,mountpoint:n,mounts:[]},f=r.mount(c);return f.mount=c,c.root=f,a?o.root=f:t&&(t.mounted=c,t.mount&&t.mount.mounts.push(c)),f},unmount:r=>{var e=o.lookupPath(r,{follow_mount:!1});if(!o.isMountpoint(e.node))throw new o.ErrnoError(28);var n=e.node,t=n.mounted,a=o.getMounts(t);Object.keys(o.nameTable).forEach(u=>{for(var c=o.nameTable[u];c;){var f=c.name_next;a.includes(c.mount)&&o.destroyNode(c),c=f}}),n.mounted=null;var i=n.mount.mounts.indexOf(t);n.mount.mounts.splice(i,1)},lookup:(r,e)=>r.node_ops.lookup(r,e),mknod:(r,e,n)=>{var t=o.lookupPath(r,{parent:!0}).node,a=x.basename(r);if(!a||a==="."||a==="..")throw new o.ErrnoError(28);var i=o.mayCreate(t,a);if(i)throw new o.ErrnoError(i);if(!t.node_ops.mknod)throw new o.ErrnoError(63);return t.node_ops.mknod(t,a,e,n)},create:(r,e)=>(e=e!==void 0?e:438,e&=4095,e|=32768,o.mknod(r,e,0)),mkdir:(r,e)=>(e=e!==void 0?e:511,e&=1023,e|=16384,o.mknod(r,e,0)),mkdirTree:(r,e)=>{for(var n=r.split("/"),t="",a=0;a(n===void 0&&(n=e,e=438),e|=8192,o.mknod(r,e,n)),symlink:(r,e)=>{if(!V.resolve(r))throw new o.ErrnoError(44);var n=o.lookupPath(e,{parent:!0}).node;if(!n)throw new o.ErrnoError(44);var t=x.basename(e),a=o.mayCreate(n,t);if(a)throw new o.ErrnoError(a);if(!n.node_ops.symlink)throw new o.ErrnoError(63);return n.node_ops.symlink(n,t,r)},rename:(r,e)=>{var n,t,a=x.dirname(r),i=x.dirname(e),u=x.basename(r),c=x.basename(e);if(n=o.lookupPath(r,{parent:!0}).node,t=o.lookupPath(e,{parent:!0}).node,!n||!t)throw new o.ErrnoError(44);if(n.mount!==t.mount)throw new o.ErrnoError(75);var f,l=o.lookupNode(n,u),h=V.relative(r,i);if(h.charAt(0)!==".")throw new o.ErrnoError(28);if((h=V.relative(e,a)).charAt(0)!==".")throw new o.ErrnoError(55);try{f=o.lookupNode(t,c)}catch{}if(l!==f){var _=o.isDir(l.mode),g=o.mayDelete(n,u,_);if(g)throw new o.ErrnoError(g);if(g=f?o.mayDelete(t,c,_):o.mayCreate(t,c))throw new o.ErrnoError(g);if(!n.node_ops.rename)throw new o.ErrnoError(63);if(o.isMountpoint(l)||f&&o.isMountpoint(f))throw new o.ErrnoError(10);if(t!==n&&(g=o.nodePermissions(n,"w")))throw new o.ErrnoError(g);o.hashRemoveNode(l);try{n.node_ops.rename(l,t,c)}catch(b){throw b}finally{o.hashAddNode(l)}}},rmdir:r=>{var e=o.lookupPath(r,{parent:!0}).node,n=x.basename(r),t=o.lookupNode(e,n),a=o.mayDelete(e,n,!0);if(a)throw new o.ErrnoError(a);if(!e.node_ops.rmdir)throw new o.ErrnoError(63);if(o.isMountpoint(t))throw new o.ErrnoError(10);e.node_ops.rmdir(e,n),o.destroyNode(t)},readdir:r=>{var e=o.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new o.ErrnoError(54);return e.node_ops.readdir(e)},unlink:r=>{var e=o.lookupPath(r,{parent:!0}).node;if(!e)throw new o.ErrnoError(44);var n=x.basename(r),t=o.lookupNode(e,n),a=o.mayDelete(e,n,!1);if(a)throw new o.ErrnoError(a);if(!e.node_ops.unlink)throw new o.ErrnoError(63);if(o.isMountpoint(t))throw new o.ErrnoError(10);e.node_ops.unlink(e,n),o.destroyNode(t)},readlink:r=>{var e=o.lookupPath(r).node;if(!e)throw new o.ErrnoError(44);if(!e.node_ops.readlink)throw new o.ErrnoError(28);return V.resolve(o.getPath(e.parent),e.node_ops.readlink(e))},stat:(r,e)=>{var n=o.lookupPath(r,{follow:!e}).node;if(!n)throw new o.ErrnoError(44);if(!n.node_ops.getattr)throw new o.ErrnoError(63);return n.node_ops.getattr(n)},lstat:r=>o.stat(r,!0),chmod:(r,e,n)=>{var t;if(!(t=typeof r=="string"?o.lookupPath(r,{follow:!n}).node:r).node_ops.setattr)throw new o.ErrnoError(63);t.node_ops.setattr(t,{mode:4095&e|-4096&t.mode,timestamp:Date.now()})},lchmod:(r,e)=>{o.chmod(r,e,!0)},fchmod:(r,e)=>{var n=o.getStream(r);if(!n)throw new o.ErrnoError(8);o.chmod(n.node,e)},chown:(r,e,n,t)=>{var a;if(!(a=typeof r=="string"?o.lookupPath(r,{follow:!t}).node:r).node_ops.setattr)throw new o.ErrnoError(63);a.node_ops.setattr(a,{timestamp:Date.now()})},lchown:(r,e,n)=>{o.chown(r,e,n,!0)},fchown:(r,e,n)=>{var t=o.getStream(r);if(!t)throw new o.ErrnoError(8);o.chown(t.node,e,n)},truncate:(r,e)=>{if(e<0)throw new o.ErrnoError(28);var n;if(!(n=typeof r=="string"?o.lookupPath(r,{follow:!0}).node:r).node_ops.setattr)throw new o.ErrnoError(63);if(o.isDir(n.mode))throw new o.ErrnoError(31);if(!o.isFile(n.mode))throw new o.ErrnoError(28);var t=o.nodePermissions(n,"w");if(t)throw new o.ErrnoError(t);n.node_ops.setattr(n,{size:e,timestamp:Date.now()})},ftruncate:(r,e)=>{var n=o.getStream(r);if(!n)throw new o.ErrnoError(8);if(!(2097155&n.flags))throw new o.ErrnoError(28);o.truncate(n.node,e)},utime:(r,e,n)=>{var t=o.lookupPath(r,{follow:!0}).node;t.node_ops.setattr(t,{timestamp:Math.max(e,n)})},open:(r,e,n)=>{if(r==="")throw new o.ErrnoError(44);var t;if(n=n===void 0?438:n,n=64&(e=typeof e=="string"?o.modeStringToFlags(e):e)?4095&n|32768:0,typeof r=="object")t=r;else{r=x.normalize(r);try{t=o.lookupPath(r,{follow:!(131072&e)}).node}catch{}}var a=!1;if(64&e)if(t){if(128&e)throw new o.ErrnoError(20)}else t=o.mknod(r,n,0),a=!0;if(!t)throw new o.ErrnoError(44);if(o.isChrdev(t.mode)&&(e&=-513),65536&e&&!o.isDir(t.mode))throw new o.ErrnoError(54);if(!a){var i=o.mayOpen(t,e);if(i)throw new o.ErrnoError(i)}512&e&&!a&&o.truncate(t,0),e&=-131713;var u=o.createStream({node:t,path:o.getPath(t),flags:e,seekable:!0,position:0,stream_ops:t.stream_ops,ungotten:[],error:!1});return u.stream_ops.open&&u.stream_ops.open(u),!s.logReadFiles||1&e||(o.readFiles||(o.readFiles={}),r in o.readFiles||(o.readFiles[r]=1)),u},close:r=>{if(o.isClosed(r))throw new o.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(e){throw e}finally{o.closeStream(r.fd)}r.fd=null},isClosed:r=>r.fd===null,llseek:(r,e,n)=>{if(o.isClosed(r))throw new o.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new o.ErrnoError(70);if(n!=0&&n!=1&&n!=2)throw new o.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,n),r.ungotten=[],r.position},read:(r,e,n,t,a)=>{if(t<0||a<0)throw new o.ErrnoError(28);if(o.isClosed(r))throw new o.ErrnoError(8);if((2097155&r.flags)==1)throw new o.ErrnoError(8);if(o.isDir(r.node.mode))throw new o.ErrnoError(31);if(!r.stream_ops.read)throw new o.ErrnoError(28);var i=a!==void 0;if(i){if(!r.seekable)throw new o.ErrnoError(70)}else a=r.position;var u=r.stream_ops.read(r,e,n,t,a);return i||(r.position+=u),u},write:(r,e,n,t,a,i)=>{if(t<0||a<0)throw new o.ErrnoError(28);if(o.isClosed(r))throw new o.ErrnoError(8);if(!(2097155&r.flags))throw new o.ErrnoError(8);if(o.isDir(r.node.mode))throw new o.ErrnoError(31);if(!r.stream_ops.write)throw new o.ErrnoError(28);r.seekable&&1024&r.flags&&o.llseek(r,0,2);var u=a!==void 0;if(u){if(!r.seekable)throw new o.ErrnoError(70)}else a=r.position;var c=r.stream_ops.write(r,e,n,t,a,i);return u||(r.position+=c),c},allocate:(r,e,n)=>{if(o.isClosed(r))throw new o.ErrnoError(8);if(e<0||n<=0)throw new o.ErrnoError(28);if(!(2097155&r.flags))throw new o.ErrnoError(8);if(!o.isFile(r.node.mode)&&!o.isDir(r.node.mode))throw new o.ErrnoError(43);if(!r.stream_ops.allocate)throw new o.ErrnoError(138);r.stream_ops.allocate(r,e,n)},mmap:(r,e,n,t,a)=>{if(2&t&&!(2&a)&&(2097155&r.flags)!=2)throw new o.ErrnoError(2);if((2097155&r.flags)==1)throw new o.ErrnoError(2);if(!r.stream_ops.mmap)throw new o.ErrnoError(43);return r.stream_ops.mmap(r,e,n,t,a)},msync:(r,e,n,t,a)=>r&&r.stream_ops.msync?r.stream_ops.msync(r,e,n,t,a):0,munmap:r=>0,ioctl:(r,e,n)=>{if(!r.stream_ops.ioctl)throw new o.ErrnoError(59);return r.stream_ops.ioctl(r,e,n)},readFile:(r,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||"binary",e.encoding!=="utf8"&&e.encoding!=="binary")throw new Error('Invalid encoding type "'+e.encoding+'"');var n,t=o.open(r,e.flags),a=o.stat(r).size,i=new Uint8Array(a);return o.read(t,i,0,a,0),e.encoding==="utf8"?n=ir(i,0):e.encoding==="binary"&&(n=i),o.close(t),n},writeFile:(r,e,n={})=>{n.flags=n.flags||577;var t=o.open(r,n.flags,n.mode);if(typeof e=="string"){var a=new Uint8Array(gr(e)+1),i=Mr(e,a,0,a.length);o.write(t,a,0,i,void 0,n.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");o.write(t,e,0,e.byteLength,void 0,n.canOwn)}o.close(t)},cwd:()=>o.currentPath,chdir:r=>{var e=o.lookupPath(r,{follow:!0});if(e.node===null)throw new o.ErrnoError(44);if(!o.isDir(e.node.mode))throw new o.ErrnoError(54);var n=o.nodePermissions(e.node,"x");if(n)throw new o.ErrnoError(n);o.currentPath=e.path},createDefaultDirectories:()=>{o.mkdir("/tmp"),o.mkdir("/home"),o.mkdir("/home/web_user")},createDefaultDevices:()=>{o.mkdir("/dev"),o.registerDevice(o.makedev(1,3),{read:()=>0,write:(e,n,t,a,i)=>a}),o.mkdev("/dev/null",o.makedev(1,3)),$.register(o.makedev(5,0),$.default_tty_ops),$.register(o.makedev(6,0),$.default_tty1_ops),o.mkdev("/dev/tty",o.makedev(5,0)),o.mkdev("/dev/tty1",o.makedev(6,0));var r=Qe();o.createDevice("/dev","random",r),o.createDevice("/dev","urandom",r),o.mkdir("/dev/shm"),o.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{o.mkdir("/proc");var r=o.mkdir("/proc/self");o.mkdir("/proc/self/fd"),o.mount({mount:()=>{var e=o.createNode(r,"fd",16895,73);return e.node_ops={lookup:(n,t)=>{var a=+t,i=o.getStream(a);if(!i)throw new o.ErrnoError(8);var u={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path}};return u.parent=u,u}},e}},{},"/proc/self/fd")},createStandardStreams:()=>{s.stdin?o.createDevice("/dev","stdin",s.stdin):o.symlink("/dev/tty","/dev/stdin"),s.stdout?o.createDevice("/dev","stdout",null,s.stdout):o.symlink("/dev/tty","/dev/stdout"),s.stderr?o.createDevice("/dev","stderr",null,s.stderr):o.symlink("/dev/tty1","/dev/stderr"),o.open("/dev/stdin",0),o.open("/dev/stdout",1),o.open("/dev/stderr",1)},ensureErrnoError:()=>{o.ErrnoError||(o.ErrnoError=function(r,e){this.node=e,this.setErrno=function(n){this.errno=n},this.setErrno(r),this.message="FS error"},o.ErrnoError.prototype=new Error,o.ErrnoError.prototype.constructor=o.ErrnoError,[44].forEach(r=>{o.genericErrors[r]=new o.ErrnoError(r),o.genericErrors[r].stack=""}))},staticInit:()=>{o.ensureErrnoError(),o.nameTable=new Array(4096),o.mount(y,{},"/"),o.createDefaultDirectories(),o.createDefaultDevices(),o.createSpecialDirectories(),o.filesystems={MEMFS:y}},init:(r,e,n)=>{o.init.initialized=!0,o.ensureErrnoError(),s.stdin=r||s.stdin,s.stdout=e||s.stdout,s.stderr=n||s.stderr,o.createStandardStreams()},quit:()=>{o.init.initialized=!1;for(var r=0;r{var n=0;return r&&(n|=365),e&&(n|=146),n},findObject:(r,e)=>{var n=o.analyzePath(r,e);return n.exists?n.object:null},analyzePath:(r,e)=>{try{r=(t=o.lookupPath(r,{follow:!e})).path}catch{}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=o.lookupPath(r,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=x.basename(r),t=o.lookupPath(r,{follow:!e}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot=t.path==="/"}catch(a){n.error=a.errno}return n},createPath:(r,e,n,t)=>{r=typeof r=="string"?r:o.getPath(r);for(var a=e.split("/").reverse();a.length;){var i=a.pop();if(i){var u=x.join2(r,i);try{o.mkdir(u)}catch{}r=u}}return u},createFile:(r,e,n,t,a)=>{var i=x.join2(typeof r=="string"?r:o.getPath(r),e),u=o.getMode(t,a);return o.create(i,u)},createDataFile:(r,e,n,t,a,i)=>{var u=e;r&&(r=typeof r=="string"?r:o.getPath(r),u=e?x.join2(r,e):r);var c=o.getMode(t,a),f=o.create(u,c);if(n){if(typeof n=="string"){for(var l=new Array(n.length),h=0,_=n.length;h<_;++h)l[h]=n.charCodeAt(h);n=l}o.chmod(f,146|c);var g=o.open(f,577);o.write(g,n,0,n.length,0,i),o.close(g),o.chmod(f,c)}return f},createDevice:(r,e,n,t)=>{var a=x.join2(typeof r=="string"?r:o.getPath(r),e),i=o.getMode(!!n,!!t);o.createDevice.major||(o.createDevice.major=64);var u=o.makedev(o.createDevice.major++,0);return o.registerDevice(u,{open:c=>{c.seekable=!1},close:c=>{t&&t.buffer&&t.buffer.length&&t(10)},read:(c,f,l,h,_)=>{for(var g=0,b=0;b{for(var g=0;g{if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!Z)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=Nr(Z(r.url),!0),r.usedBytes=r.contents.length}catch{throw new o.ErrnoError(29)}},createLazyFile:(r,e,n,t,a)=>{if(typeof XMLHttpRequest<"u")throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i={isDevice:!1,url:n},u=o.createFile(r,e,i,t,a);i.contents?u.contents=i.contents:i.url&&(u.contents=null,u.url=i.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function f(l,h,_,g,b){var F=l.node.contents;if(b>=F.length)return 0;var A=Math.min(F.length-b,g);if(F.slice)for(var T=0;T{var h=u.stream_ops[l];c[l]=function(){return o.forceLoadFile(u),h.apply(null,arguments)}}),c.read=(l,h,_,g,b)=>(o.forceLoadFile(u),f(l,h,_,g,b)),c.mmap=(l,h,_,g,b)=>{o.forceLoadFile(u);var F=ee();if(!F)throw new o.ErrnoError(48);return f(l,D,F,h,_),{ptr:F,allocated:!0}},u.stream_ops=c,u},createPreloadedFile:(r,e,n,t,a,i,u,c,f,l)=>{var h=e?V.resolve(x.join2(r,e)):r;function _(g){function b(F){l&&l(),c||o.createDataFile(r,e,F,t,a,f),i&&i(),lr()}Browser.handledByPreloadPlugin(g,h,b,()=>{u&&u(),lr()})||b(g)}_r(),typeof n=="string"?Je(n,g=>_(g),u):_(n)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(r,e,n)=>{e=e||(()=>{}),n=n||(()=>{});var t=o.indexedDB();try{var a=t.open(o.DB_NAME(),o.DB_VERSION)}catch(i){return n(i)}a.onupgradeneeded=()=>{Br("creating db"),a.result.createObjectStore(o.DB_STORE_NAME)},a.onsuccess=()=>{var i=a.result.transaction([o.DB_STORE_NAME],"readwrite"),u=i.objectStore(o.DB_STORE_NAME),c=0,f=0,l=r.length;function h(){f==0?e():n()}r.forEach(_=>{var g=u.put(o.analyzePath(_).object.contents,_);g.onsuccess=()=>{++c+f==l&&h()},g.onerror=()=>{f++,c+f==l&&h()}}),i.onerror=n},a.onerror=n},loadFilesFromDB:(r,e,n)=>{e=e||(()=>{}),n=n||(()=>{});var t=o.indexedDB();try{var a=t.open(o.DB_NAME(),o.DB_VERSION)}catch(i){return n(i)}a.onupgradeneeded=n,a.onsuccess=()=>{var i=a.result;try{var u=i.transaction([o.DB_STORE_NAME],"readonly")}catch(g){return void n(g)}var c=u.objectStore(o.DB_STORE_NAME),f=0,l=0,h=r.length;function _(){l==0?e():n()}r.forEach(g=>{var b=c.get(g);b.onsuccess=()=>{o.analyzePath(g).exists&&o.unlink(g),o.createDataFile(x.dirname(g),x.basename(g),b.result,!0,!0,!0),++f+l==h&&_()},b.onerror=()=>{l++,f+l==h&&_()}}),u.onerror=n},a.onerror=n}},S={DEFAULT_POLLMASK:5,calculateAt:function(r,e,n){if(x.isAbs(e))return e;var t;if(r===-100)t=o.cwd();else{var a=o.getStream(r);if(!a)throw new o.ErrnoError(8);t=a.path}if(e.length==0){if(!n)throw new o.ErrnoError(44);return t}return x.join2(t,e)},doStat:function(r,e,n){try{var t=r(e)}catch(a){if(a&&a.node&&x.normalize(e)!==x.normalize(o.getPath(a.node)))return-54;throw a}return v[n>>2]=t.dev,v[n+4>>2]=0,v[n+8>>2]=t.ino,v[n+12>>2]=t.mode,v[n+16>>2]=t.nlink,v[n+20>>2]=t.uid,v[n+24>>2]=t.gid,v[n+28>>2]=t.rdev,v[n+32>>2]=0,H=[t.size>>>0,(C=t.size,+Math.abs(C)>=1?C>0?(0|Math.min(+Math.floor(C/4294967296),4294967295))>>>0:~~+Math.ceil((C-+(~~C>>>0))/4294967296)>>>0:0)],v[n+40>>2]=H[0],v[n+44>>2]=H[1],v[n+48>>2]=4096,v[n+52>>2]=t.blocks,v[n+56>>2]=t.atime.getTime()/1e3|0,v[n+64>>2]=0,v[n+72>>2]=t.mtime.getTime()/1e3|0,v[n+80>>2]=0,v[n+88>>2]=t.ctime.getTime()/1e3|0,v[n+96>>2]=0,H=[t.ino>>>0,(C=t.ino,+Math.abs(C)>=1?C>0?(0|Math.min(+Math.floor(C/4294967296),4294967295))>>>0:~~+Math.ceil((C-+(~~C>>>0))/4294967296)>>>0:0)],v[n+104>>2]=H[0],v[n+108>>2]=H[1],0},doMsync:function(r,e,n,t,a){var i=P.slice(r,r+n);o.msync(e,i,a,n,t)},varargs:void 0,get:function(){return S.varargs+=4,v[S.varargs-4>>2]},getStr:function(r){return M(r)},getStreamFromFD:function(r){var e=o.getStream(r);if(!e)throw new o.ErrnoError(8);return e}};function Ke(r,e,n){S.varargs=n;try{var t=S.getStreamFromFD(r);switch(e){case 0:return(a=S.get())<0?-28:o.createStream(t,a).fd;case 1:case 2:case 6:case 7:return 0;case 3:return t.flags;case 4:var a=S.get();return t.flags|=a,0;case 5:return a=S.get(),z[a+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return Xe(28),-1}}catch(i){if(o===void 0||!(i instanceof o.ErrnoError))throw i;return-i.errno}}function $e(r,e,n){S.varargs=n;try{var t=S.getStreamFromFD(r);switch(e){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return t.tty?0:-59;case 21519:if(!t.tty)return-59;var a=S.get();return v[a>>2]=0,0;case 21520:return t.tty?-28:-59;case 21531:return a=S.get(),o.ioctl(t,e,a);default:U("bad ioctl syscall "+e)}}catch(i){if(o===void 0||!(i instanceof o.ErrnoError))throw i;return-i.errno}}function rn(r,e,n,t){S.varargs=t;try{e=S.getStr(e),e=S.calculateAt(r,e);var a=t?S.get():0;return o.open(e,n,a).fd}catch(i){if(o===void 0||!(i instanceof o.ErrnoError))throw i;return-i.errno}}var yr={};function ne(r){for(;r.length;){var e=r.pop();r.pop()(e)}}function wr(r){return this.fromWireType(v[r>>2])}var ur={},rr={},Er={},en=48,nn=57;function tn(r){if(r===void 0)return"_unknown";var e=(r=r.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=en&&e<=nn?"_"+r:r}function te(r,e){return r=tn(r),function(){return e.apply(this,arguments)}}function Lr(r,e){var n=te(e,function(t){this.name=e,this.message=t;var a=new Error(t).stack;a!==void 0&&(this.stack=this.toString()+` +`+a.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(r.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},n}var oe=void 0;function ae(r){throw new oe(r)}function ie(r,e,n){function t(c){var f=n(c);f.length!==r.length&&ae("Mismatched type converter count");for(var l=0;l{rr.hasOwnProperty(c)?a[f]=rr[c]:(i.push(c),ur.hasOwnProperty(c)||(ur[c]=[]),ur[c].push(()=>{a[f]=rr[c],++u===i.length&&t(a)}))}),i.length===0&&t(a)}function on(r){var e=yr[r];delete yr[r];var n=e.rawConstructor,t=e.rawDestructor,a=e.fields;ie([r],a.map(i=>i.getterReturnType).concat(a.map(i=>i.setterArgumentType)),i=>{var u={};return a.forEach((c,f)=>{var l=c.fieldName,h=i[f],_=c.getter,g=c.getterContext,b=i[f+a.length],F=c.setter,A=c.setterContext;u[l]={read:T=>h.fromWireType(_(g,T)),write:(T,nr)=>{var d=[];F(A,T,b.toWireType(d,nr)),ne(d)}}}),[{name:e.name,fromWireType:function(c){var f={};for(var l in u)f[l]=u[l].read(c);return t(c),f},toWireType:function(c,f){for(var l in u)if(!(l in f))throw new TypeError('Missing field: "'+l+'"');var h=n();for(l in u)u[l].write(h,f[l]);return c!==null&&c.push(t,h),h},argPackAdvance:8,readValueFromPointer:wr,destructorFunction:t}]})}function an(r,e,n,t,a){}function br(r){switch(r){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+r)}}function un(){for(var r=new Array(256),e=0;e<256;++e)r[e]=String.fromCharCode(e);ue=r}var ue=void 0;function j(r){for(var e="",n=r;P[n];)e+=ue[P[n++]];return e}var se=void 0;function I(r){throw new se(r)}function W(r,e,n={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var t=e.name;if(r||I('type "'+t+'" must have a positive integer typeid pointer'),rr.hasOwnProperty(r)){if(n.ignoreDuplicateRegistrations)return;I("Cannot register type '"+t+"' twice")}if(rr[r]=e,delete Er[r],ur.hasOwnProperty(r)){var a=ur[r];delete ur[r],a.forEach(i=>i())}}function sn(r,e,n,t,a){var i=br(n);W(r,{name:e=j(e),fromWireType:function(u){return!!u},toWireType:function(u,c){return c?t:a},argPackAdvance:8,readValueFromPointer:function(u){var c;if(n===1)c=D;else if(n===2)c=z;else{if(n!==4)throw new TypeError("Unknown boolean type size: "+e);c=v}return this.fromWireType(c[u>>i])},destructorFunction:null})}var Rr=[],L=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function ce(r){r>4&&--L[r].refcount==0&&(L[r]=void 0,Rr.push(r))}function cn(){for(var r=0,e=5;e(r||I("Cannot use deleted val. handle = "+r),L[r].value),toHandle:r=>{switch(r){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=Rr.length?Rr.pop():L.length;return L[e]={refcount:1,value:r},e}}};function dn(r,e){W(r,{name:e=j(e),fromWireType:function(n){var t=X.toValue(n);return ce(n),t},toWireType:function(n,t){return X.toHandle(t)},argPackAdvance:8,readValueFromPointer:wr,destructorFunction:null})}function mn(r,e,n){if(r[e].overloadTable===void 0){var t=r[e];r[e]=function(){return r[e].overloadTable.hasOwnProperty(arguments.length)||I("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+r[e].overloadTable+")!"),r[e].overloadTable[arguments.length].apply(this,arguments)},r[e].overloadTable=[],r[e].overloadTable[t.argCount]=t}}function fe(r,e,n){s.hasOwnProperty(r)?((n===void 0||s[r].overloadTable!==void 0&&s[r].overloadTable[n]!==void 0)&&I("Cannot register public name '"+r+"' twice"),mn(s,r,r),s.hasOwnProperty(n)&&I("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),s[r].overloadTable[n]=e):(s[r]=e,n!==void 0&&(s[r].numArguments=n))}function pn(r,e,n){switch(e){case 0:return function(t){var a=n?D:P;return this.fromWireType(a[t])};case 1:return function(t){var a=n?z:or;return this.fromWireType(a[t>>1])};case 2:return function(t){var a=n?v:k;return this.fromWireType(a[t>>2])};default:throw new TypeError("Unknown integer type: "+r)}}function vn(r,e,n,t){var a=br(n);function i(){}e=j(e),i.values={},W(r,{name:e,constructor:i,fromWireType:function(u){return this.constructor.values[u]},toWireType:function(u,c){return c.value},argPackAdvance:8,readValueFromPointer:pn(e,a,t),destructorFunction:null}),fe(e,i)}function le(r){var e=xe(r),n=j(e);return q(e),n}function de(r,e){var n=rr[r];return n===void 0&&I(e+" has unknown type "+le(r)),n}function hn(r,e,n){var t=de(r,"enum");e=j(e);var a=t.constructor,i=Object.create(t.constructor.prototype,{value:{value:n},constructor:{value:te(t.name+"_"+e,function(){})}});a.values[n]=i,a[e]=i}function gn(r,e){switch(e){case 2:return function(n){return this.fromWireType(ar[n>>2])};case 3:return function(n){return this.fromWireType(qr[n>>3])};default:throw new TypeError("Unknown float type: "+r)}}function _n(r,e,n){var t=br(n);W(r,{name:e=j(e),fromWireType:function(a){return a},toWireType:function(a,i){return i},argPackAdvance:8,readValueFromPointer:gn(e,t),destructorFunction:null})}function yn(r,e,n,t,a){var i=e.length;i<2&&I("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var u=e[1]!==null&&n!==null,c=!1,f=1;f>2]);return n}function En(r,e,n){s.hasOwnProperty(r)||ae("Replacing nonexistant public symbol"),s[r].overloadTable!==void 0&&n!==void 0?s[r].overloadTable[n]=e:(s[r]=e,s[r].argCount=n)}function bn(r,e,n){var t=s["dynCall_"+r];return n&&n.length?t.apply(null,[e].concat(n)):t.call(null,e)}var dr=[];function Or(r){var e=dr[r];return e||(r>=dr.length&&(dr.length=r+1),dr[r]=e=J.get(r)),e}function kn(r,e,n){return r.includes("j")?bn(r,e,n):Or(e).apply(null,n)}function xn(r,e){var n=[];return function(){return n.length=0,Object.assign(n,arguments),kn(r,e,n)}}function mr(r,e){function n(){return r.includes("j")?xn(r,e):Or(e)}r=j(r);var t=n();return typeof t!="function"&&I("unknown function pointer with signature "+r+": "+e),t}var me=void 0;function Fn(r,e){var n=[],t={};function a(i){t[i]||rr[i]||(Er[i]?Er[i].forEach(a):(n.push(i),t[i]=!0))}throw e.forEach(a),new me(r+": "+n.map(le).join([", "]))}function Dn(r,e,n,t,a,i){var u=wn(e,n);r=j(r),a=mr(t,a),fe(r,function(){Fn("Cannot call "+r+" due to unbound types",u)},e-1),ie([],u,function(c){var f=[c[0],null].concat(c.slice(1));return En(r,yn(r,f,null,a,i),e-1),[]})}function Sn(r,e,n){switch(e){case 0:return n?function(t){return D[t]}:function(t){return P[t]};case 1:return n?function(t){return z[t>>1]}:function(t){return or[t>>1]};case 2:return n?function(t){return v[t>>2]}:function(t){return k[t>>2]};default:throw new TypeError("Unknown integer type: "+r)}}function An(r,e,n,t,a){e=j(e);var i=br(n),u=h=>h;if(t===0){var c=32-8*n;u=h=>h<>>c}var f=e.includes("unsigned"),l=(h,_)=>{};W(r,{name:e,fromWireType:u,toWireType:f?function(h,_){return l(_,this.name),_>>>0}:function(h,_){return l(_,this.name),_},argPackAdvance:8,readValueFromPointer:Sn(e,i,t!==0),destructorFunction:null})}function Pn(r,e,n){var t=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function a(i){var u=k,c=u[i>>=2],f=u[i+1];return new t(hr,f,c)}W(r,{name:n=j(n),fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})}function Cn(r,e){var n=(e=j(e))==="std::string";W(r,{name:e,fromWireType:function(t){var a,i=k[t>>2],u=t+4;if(n)for(var c=u,f=0;f<=i;++f){var l=u+f;if(f==i||P[l]==0){var h=M(c,l-c);a===void 0?a=h:(a+=String.fromCharCode(0),a+=h),c=l+1}}else{var _=new Array(i);for(f=0;f>2]=i,n&&u)Yr(a,f,i+1);else if(u)for(var l=0;l255&&(q(f),I("String has UTF-16 code units that do not fit in 8 bits")),P[f+l]=h}else for(l=0;l>1,a=t+e/2;!(t>=a)&&or[t];)++t;if((n=t<<1)-r>32&&pe)return pe.decode(P.subarray(r,n));for(var i="",u=0;!(u>=e/2);++u){var c=z[r+2*u>>1];if(c==0)break;i+=String.fromCharCode(c)}return i}function jn(r,e,n){if(n===void 0&&(n=2147483647),n<2)return 0;for(var t=e,a=(n-=2)<2*r.length?n/2:r.length,i=0;i>1]=u,e+=2}return z[e>>1]=0,e-t}function Bn(r){return 2*r.length}function Mn(r,e){for(var n=0,t="";!(n>=e/4);){var a=v[r+4*n>>2];if(a==0)break;if(++n,a>=65536){var i=a-65536;t+=String.fromCharCode(55296|i>>10,56320|1023&i)}else t+=String.fromCharCode(a)}return t}function In(r,e,n){if(n===void 0&&(n=2147483647),n<4)return 0;for(var t=e,a=t+n-4,i=0;i=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&r.charCodeAt(++i)),v[e>>2]=u,(e+=4)+4>a)break}return v[e>>2]=0,e-t}function Nn(r){for(var e=0,n=0;n=55296&&t<=57343&&++n,e+=4}return e}function Ln(r,e,n){var t,a,i,u,c;n=j(n),e===2?(t=Tn,a=jn,u=Bn,i=()=>or,c=1):e===4&&(t=Mn,a=In,u=Nn,i=()=>k,c=2),W(r,{name:n,fromWireType:function(f){for(var l,h=k[f>>2],_=i(),g=f+4,b=0;b<=h;++b){var F=f+4+b*e;if(b==h||_[F>>c]==0){var A=t(g,F-g);l===void 0?l=A:(l+=String.fromCharCode(0),l+=A),g=F+e}}return q(f),l},toWireType:function(f,l){typeof l!="string"&&I("Cannot pass non-string to C++ string type "+n);var h=u(l),_=Ar(4+h+e);return k[_>>2]=h>>c,a(l,_+4,h+e),f!==null&&f.push(q,_),_},argPackAdvance:8,readValueFromPointer:wr,destructorFunction:function(f){q(f)}})}function Rn(r,e,n,t,a,i){yr[r]={name:j(e),rawConstructor:mr(n,t),rawDestructor:mr(a,i),fields:[]}}function On(r,e,n,t,a,i,u,c,f,l){yr[r].fields.push({fieldName:j(e),getterReturnType:n,getter:mr(t,a),getterContext:i,setterArgumentType:u,setter:mr(c,f),setterContext:l})}function Wn(r,e){W(r,{isVoid:!0,name:e=j(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(n,t){}})}function Zn(r){do{var e=k[r>>2],n=k[(r+=4)>>2],t=k[(r+=4)>>2];r+=4;var a=M(e);o.createPath("/",x.dirname(a),!0,!0),o.createDataFile(a,null,D.subarray(t,t+n),!0,!0,!0)}while(k[r>>2])}function zn(r){r>4&&(L[r].refcount+=1)}var Un={};function Hn(r){var e=Un[r];return e===void 0?j(r):e}function Vn(r){return X.toHandle(Hn(r))}function qn(){return X.toHandle({})}function Gn(r,e,n){r=X.toValue(r),e=X.toValue(e),n=X.toValue(n),r[e]=n}function Yn(r,e){var n=(r=de(r,"_emval_take_value")).readValueFromPointer(e);return X.toHandle(n)}function Xn(){U("")}function Qn(r,e,n){P.copyWithin(r,e,e+n)}function Jn(){return 2147483648}function Kn(r){try{return jr.grow(r-hr.byteLength+65535>>>16),Xr(jr.buffer),1}catch{}}function $n(r){var e=P.length;r>>>=0;var n=Jn();if(r>n)return!1;let t=(u,c)=>u+(c-u%c)%c;for(var a=1;a<=4;a*=2){var i=e*(1+.2/a);if(i=Math.min(i,r+100663296),Kn(Math.min(n,t(Math.max(r,i),65536))))return!0}return!1}function rt(r){return!!(r.dibvbi=r.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"))}function et(r){return!!(r.mdibvbi=r.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"))}function nt(r){return!!(r.multiDrawWebgl=r.getExtension("WEBGL_multi_draw"))}var m={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(r){m.lastError||(m.lastError=r)},getNewId:function(r){for(var e=m.counter++,n=r.length;n>2]:-1;a+=M(v[n+4*i>>2],u<0?void 0:u)}return a},createContext:function(r,e){if(s.preinitializedWebGLContext){var n=s.preinitializedWebGLContext;e.majorVersion=typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext?2:1}else{if(!r.getContextSafariWebGL2Fixed){let t=function(a,i){var u=r.getContextSafariWebGL2Fixed(a,i);return a=="webgl"==u instanceof WebGLRenderingContext?u:null};r.getContextSafariWebGL2Fixed=r.getContext,r.getContext=t}n=r.getContext("webgl2",e)}return n?m.registerContext(n,e):0},registerContext:function(r,e){var n=m.getNewId(m.contexts),t={handle:n,attributes:e,version:e.majorVersion,GLctx:r};return r.canvas&&(r.canvas.GLctxObject=t),m.contexts[n]=t,(e.enableExtensionsByDefault===void 0||e.enableExtensionsByDefault)&&m.initExtensions(t),n},makeContextCurrent:function(r){return m.currentContext=m.contexts[r],s.ctx=p=m.currentContext&&m.currentContext.GLctx,!(r&&!p)},getContext:function(r){return m.contexts[r]},deleteContext:function(r){m.currentContext===m.contexts[r]&&(m.currentContext=null),typeof E=="object"&&E.removeAllHandlersOnTarget(m.contexts[r].GLctx.canvas),m.contexts[r]&&m.contexts[r].GLctx.canvas&&(m.contexts[r].GLctx.canvas.GLctxObject=void 0),m.contexts[r]=null},initExtensions:function(r){if(r||(r=m.currentContext),!r.initExtensionsDone){r.initExtensionsDone=!0;var e=r.GLctx;rt(e),et(e),r.version>=2&&(e.disjointTimerQueryExt=e.getExtension("EXT_disjoint_timer_query_webgl2")),(r.version<2||!e.disjointTimerQueryExt)&&(e.disjointTimerQueryExt=e.getExtension("EXT_disjoint_timer_query")),nt(e),(e.getSupportedExtensions()||[]).forEach(function(n){n.includes("lose_context")||n.includes("debug")||e.getExtension(n)})}}},E={inEventHandler:0,removeAllEventListeners:function(){for(var r=E.eventHandlers.length-1;r>=0;--r)E._removeHandler(r);E.eventHandlers=[],E.deferredCalls=[]},registerRemoveEventListeners:function(){E.removeEventListenersRegistered||(E.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(r,e,n){function t(u,c){if(u.length!=c.length)return!1;for(var f in u)if(u[f]!=c[f])return!1;return!0}for(var a in E.deferredCalls){var i=E.deferredCalls[a];if(i.targetFunction==r&&t(i.argsList,n))return}E.deferredCalls.push({targetFunction:r,precedence:e,argsList:n}),E.deferredCalls.sort(function(u,c){return u.precedence2?M(r):r}var at=[0,document,window];function it(r){return r=ot(r),at[r]||document.querySelector(r)}function ut(r){return it(r)}function st(r,e){var n=e>>2,t=v[n+6],a={alpha:!!v[n+0],depth:!!v[n+1],stencil:!!v[n+2],antialias:!!v[n+3],premultipliedAlpha:!!v[n+4],preserveDrawingBuffer:!!v[n+5],powerPreference:tt[t],failIfMajorPerformanceCaveat:!!v[n+7],majorVersion:v[n+8],minorVersion:v[n+9],enableExtensionsByDefault:v[n+10],explicitSwapControl:v[n+11],proxyContextToMainThread:v[n+12],renderViaOffscreenBackBuffer:v[n+13]},i=ut(r);return i?a.explicitSwapControl?0:m.createContext(i,a):0}var ct=st;function ft(r){for(var e=r>>2,n=0;n<14;++n)v[e+n]=0;v[e+0]=v[e+1]=v[e+3]=v[e+4]=v[e+8]=v[e+10]=1}function lt(r){return m.makeContextCurrent(r)?0:-5}var Wr={};function dt(){return Hr||"./this.program"}function pr(){if(!pr.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:dt()};for(var e in Wr)Wr[e]===void 0?delete r[e]:r[e]=Wr[e];var n=[];for(var e in r)n.push(e+"="+r[e]);pr.strings=n}return pr.strings}function mt(r,e,n){for(var t=0;t>0]=r.charCodeAt(t);n||(D[e>>0]=0)}function pt(r,e){var n=0;return pr().forEach(function(t,a){var i=e+n;k[r+4*a>>2]=i,mt(t,i),n+=t.length+1}),0}function vt(r,e){var n=pr();k[r>>2]=n.length;var t=0;return n.forEach(function(a){t+=a.length+1}),k[e>>2]=t,0}function ht(r){try{var e=S.getStreamFromFD(r);return o.close(e),0}catch(n){if(o===void 0||!(n instanceof o.ErrnoError))throw n;return n.errno}}function gt(r,e,n,t){for(var a=0,i=0;i>2],c=k[e+4>>2];e+=8;var f=o.read(r,D,u,c,t);if(f<0)return-1;if(a+=f,f>2]=a,0}catch(i){if(o===void 0||!(i instanceof o.ErrnoError))throw i;return i.errno}}function yt(r,e){return e+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*e:NaN}function wt(r,e,n,t,a){try{var i=yt(e,n);if(isNaN(i))return 61;var u=S.getStreamFromFD(r);return o.llseek(u,i,t),H=[u.position>>>0,(C=u.position,+Math.abs(C)>=1?C>0?(0|Math.min(+Math.floor(C/4294967296),4294967295))>>>0:~~+Math.ceil((C-+(~~C>>>0))/4294967296)>>>0:0)],v[a>>2]=H[0],v[a+4>>2]=H[1],u.getdents&&i===0&&t===0&&(u.getdents=null),0}catch(c){if(o===void 0||!(c instanceof o.ErrnoError))throw c;return c.errno}}function Et(r,e,n,t){for(var a=0,i=0;i>2],c=k[e+4>>2];e+=8;var f=o.write(r,D,u,c,t);if(f<0)return-1;a+=f}return a}function bt(r,e,n,t){try{var a=Et(S.getStreamFromFD(r),e,n);return k[t>>2]=a,0}catch(i){if(o===void 0||!(i instanceof o.ErrnoError))throw i;return i.errno}}function kt(r){p.activeTexture(r)}function xt(r,e){p.attachShader(m.programs[r],m.shaders[e])}function Ft(r,e,n){p.bindAttribLocation(m.programs[r],e,M(n))}function Dt(r,e){r==35051?p.currentPixelPackBufferBinding=e:r==35052&&(p.currentPixelUnpackBufferBinding=e),p.bindBuffer(r,m.buffers[e])}function St(r,e,n){p.bindBufferBase(r,e,m.buffers[n])}function At(r,e,n,t,a){p.bindBufferRange(r,e,m.buffers[n],t,a)}function Pt(r,e){p.bindFramebuffer(r,m.framebuffers[e])}function Ct(r,e){p.bindTexture(r,m.textures[e])}function Tt(r){p.bindVertexArray(m.vaos[r])}function jt(r,e,n,t){n&&e?p.bufferData(r,P,t,n,e):p.bufferData(r,e,t)}function Bt(r,e,n,t){n&&p.bufferSubData(r,e,P,t,n)}function Mt(r){p.clear(r)}function It(r,e,n,t){p.clearBufferfi(r,e,n,t)}function Nt(r,e,n){p.clearBufferfv(r,e,ar,n>>2)}function Lt(r,e,n){p.clearBufferiv(r,e,v,n>>2)}function Rt(r,e,n){p.clearBufferuiv(r,e,k,n>>2)}function Ot(r,e,n,t){p.clearColor(r,e,n,t)}function Wt(r){p.clearDepth(r)}function Zt(r){p.clearStencil(r)}function zt(r,e,n,t){p.colorMask(!!r,!!e,!!n,!!t)}function Ut(r){p.compileShader(m.shaders[r])}function Ht(){var r=m.getNewId(m.programs),e=p.createProgram();return e.name=r,e.maxUniformLength=e.maxAttributeLength=e.maxUniformBlockNameLength=0,e.uniformIdCounter=1,m.programs[r]=e,r}function Vt(r){var e=m.getNewId(m.shaders);return m.shaders[e]=p.createShader(r),e}function qt(r,e){for(var n=0;n>2],a=m.buffers[t];a&&(p.deleteBuffer(a),a.name=0,m.buffers[t]=null,t==p.currentPixelPackBufferBinding&&(p.currentPixelPackBufferBinding=0),t==p.currentPixelUnpackBufferBinding&&(p.currentPixelUnpackBufferBinding=0))}}function Gt(r,e){for(var n=0;n>2],a=m.framebuffers[t];a&&(p.deleteFramebuffer(a),a.name=0,m.framebuffers[t]=null)}}function Yt(r){if(r){var e=m.programs[r];e?(p.deleteProgram(e),e.name=0,m.programs[r]=null):m.recordError(1281)}}function Xt(r,e){for(var n=0;n>2],a=m.queries[t];a&&(p.deleteQuery(a),m.queries[t]=null)}}function Qt(r){if(r){var e=m.shaders[r];e?(p.deleteShader(e),m.shaders[r]=null):m.recordError(1281)}}function Jt(r,e){for(var n=0;n>2],a=m.textures[t];a&&(p.deleteTexture(a),a.name=0,m.textures[t]=null)}}function Kt(r,e){for(var n=0;n>2];p.deleteVertexArray(m.vaos[t]),m.vaos[t]=null}}function $t(r,e,n){p.drawArrays(r,e,n)}var ve=[];function ro(r,e){for(var n=ve[r],t=0;t>2];p.drawBuffers(n)}function eo(r,e,n,t){p.drawElements(r,e,n,t)}function no(r,e,n,t,a){p.drawElementsInstanced(r,e,n,t,a)}function to(r){p.enableVertexAttribArray(r)}function oo(r,e,n,t,a){p.framebufferTexture2D(r,e,n,m.textures[t],a)}function vr(r,e,n,t){for(var a=0;a>2]=u}}function ao(r,e){vr(r,e,"createBuffer",m.buffers)}function io(r,e){vr(r,e,"createFramebuffer",m.framebuffers)}function uo(r,e){vr(r,e,"createQuery",m.queries)}function so(r,e){vr(r,e,"createTexture",m.textures)}function co(r,e){vr(r,e,"createVertexArray",m.vaos)}function fo(r){p.generateMipmap(r)}function he(r,e){k[r>>2]=e,k[r+4>>2]=(e-k[r>>2])/4294967296}function lo(r,e,n){if(e){var t=void 0;switch(r){case 36346:t=1;break;case 36344:return void(n!=0&&n!=1&&m.recordError(1280));case 34814:case 36345:t=0;break;case 34466:var a=p.getParameter(34467);t=a?a.length:0;break;case 33309:if(m.currentContext.version<2)return void m.recordError(1282);t=2*(p.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(m.currentContext.version<2)return void m.recordError(1280);t=r==33307?3:0}if(t===void 0){var i=p.getParameter(r);switch(typeof i){case"number":t=i;break;case"boolean":t=i?1:0;break;case"string":return void m.recordError(1280);case"object":if(i===null)switch(r){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:t=0;break;default:return void m.recordError(1280)}else{if(i instanceof Float32Array||i instanceof Uint32Array||i instanceof Int32Array||i instanceof Array){for(var u=0;u>2]=i[u];break;case 2:ar[e+4*u>>2]=i[u];break;case 4:D[e+u>>0]=i[u]?1:0}return}try{t=0|i.name}catch(c){return m.recordError(1280),void R("GL_INVALID_ENUM in glGet"+n+"v: Unknown object returned from WebGL getParameter("+r+")! (error: "+c+")")}}break;default:return m.recordError(1280),void R("GL_INVALID_ENUM in glGet"+n+"v: Native code calling glGet"+n+"v("+r+") and it returns "+i+" of type "+typeof i+"!")}}switch(n){case 1:he(e,t);break;case 0:v[e>>2]=t;break;case 2:ar[e>>2]=t;break;case 4:D[e>>0]=t?1:0}}else m.recordError(1281)}function mo(r,e){lo(r,e,0)}function po(r,e,n){if(n){var t,a=m.queries[r];he(n,typeof(t=m.currentContext.version<2?p.disjointTimerQueryExt.getQueryObjectEXT(a,e):p.getQueryParameter(a,e))=="boolean"?t?1:0:t)}else m.recordError(1281)}function vo(r,e,n){if(n){var t,a=m.queries[r],i=p.disjointTimerQueryExt.getQueryObjectEXT(a,e);t=typeof i=="boolean"?i?1:0:i,v[n>>2]=t}else m.recordError(1281)}function ho(r,e){return p.getUniformBlockIndex(m.programs[r],M(e))}function go(r){return parseInt(r)}function ge(r){return r.slice(-1)=="]"&&r.lastIndexOf("[")}function _o(r){var e,n,t=r.uniformLocsById,a=r.uniformSizeAndIdsByName;if(!t)for(r.uniformLocsById=t={},r.uniformArrayNamesById={},e=0;e0?u.slice(0,f):u,h=r.uniformIdCounter;for(r.uniformIdCounter+=c,a[l]=[c,h],n=0;n0&&(t=go(e.slice(i+1))>>>0,a=e.slice(0,i));var u=r.uniformSizeAndIdsByName[a];if(u&&t>xr(c))}}function Fo(r,e,n,t){var a=m.getSource(r,e,n,t);p.shaderSource(m.shaders[r],a)}function Do(r,e,n,t,a,i,u,c,f,l){if(p.currentPixelUnpackBufferBinding)p.texImage3D(r,e,n,t,a,i,u,c,f,l);else if(l){var h=kr(f);p.texImage3D(r,e,n,t,a,i,u,c,f,h,l>>xr(h))}else p.texImage3D(r,e,n,t,a,i,u,c,f,null)}function So(r,e,n){p.texParameteri(r,e,n)}function Ao(r,e,n,t,a){p.texStorage2D(r,e,n,t,a)}function Po(r,e,n,t,a,i,u,c,f){if(p.currentPixelUnpackBufferBinding)p.texSubImage2D(r,e,n,t,a,i,u,c,f);else if(f){var l=kr(c);p.texSubImage2D(r,e,n,t,a,i,u,c,l,f>>xr(l))}else p.texSubImage2D(r,e,n,t,a,i,u,c,null)}function Co(r,e,n,t,a,i,u,c,f,l,h){if(p.currentPixelUnpackBufferBinding)p.texSubImage3D(r,e,n,t,a,i,u,c,f,l,h);else if(h){var _=kr(l);p.texSubImage3D(r,e,n,t,a,i,u,c,f,l,_,h>>xr(_))}else p.texSubImage3D(r,e,n,t,a,i,u,c,f,l,null)}function To(r){var e=p.currentProgram;if(e){var n=e.uniformLocsById[r];return typeof n=="number"&&(e.uniformLocsById[r]=n=p.getUniformLocation(e,e.uniformArrayNamesById[r]+(n>0?"["+n+"]":""))),n}m.recordError(1282)}function jo(r,e){p.uniform1i(To(r),e)}function Bo(r,e,n){r=m.programs[r],p.uniformBlockBinding(r,e,n)}function Mo(r){r=m.programs[r],p.useProgram(r),p.currentProgram=r}function Io(r,e,n,t,a){p.vertexAttribIPointer(r,e,n,t,a)}function No(r,e,n,t,a,i){p.vertexAttribPointer(r,e,n,!!t,a,i)}function Lo(r){}function Fr(r){return r%4==0&&(r%100!=0||r%400==0)}function Ro(r,e){for(var n=0,t=0;t<=e;n+=r[t++]);return n}var _e=[31,29,31,30,31,30,31,31,30,31,30,31],ye=[31,28,31,30,31,30,31,31,30,31,30,31];function Oo(r,e){for(var n=new Date(r.getTime());e>0;){var t=Fr(n.getFullYear()),a=n.getMonth(),i=(t?_e:ye)[a];if(!(e>i-n.getDate()))return n.setDate(n.getDate()+e),n;e-=i-n.getDate()+1,n.setDate(1),a<11?n.setMonth(a+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1))}return n}function Wo(r,e,n,t){var a=v[t+40>>2],i={tm_sec:v[t>>2],tm_min:v[t+4>>2],tm_hour:v[t+8>>2],tm_mday:v[t+12>>2],tm_mon:v[t+16>>2],tm_year:v[t+20>>2],tm_wday:v[t+24>>2],tm_yday:v[t+28>>2],tm_isdst:v[t+32>>2],tm_gmtoff:v[t+36>>2],tm_zone:a?M(a):""},u=M(n),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var f in c)u=u.replace(new RegExp(f,"g"),c[f]);var l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function _(d,w,N){for(var B=typeof d=="number"?d.toString():d||"";B.length0?1:0}var B;return(B=N(d.getFullYear()-w.getFullYear()))===0&&(B=N(d.getMonth()-w.getMonth()))===0&&(B=N(d.getDate()-w.getDate())),B}function F(d){switch(d.getDay()){case 0:return new Date(d.getFullYear()-1,11,29);case 1:return d;case 2:return new Date(d.getFullYear(),0,3);case 3:return new Date(d.getFullYear(),0,2);case 4:return new Date(d.getFullYear(),0,1);case 5:return new Date(d.getFullYear()-1,11,31);case 6:return new Date(d.getFullYear()-1,11,30)}}function A(d){var w=Oo(new Date(d.tm_year+1900,0,1),d.tm_yday),N=new Date(w.getFullYear(),0,4),B=new Date(w.getFullYear()+1,0,4),Cr=F(N),Yo=F(B);return b(Cr,w)<=0?b(Yo,w)<=0?w.getFullYear()+1:w.getFullYear():w.getFullYear()-1}var T={"%a":function(d){return l[d.tm_wday].substring(0,3)},"%A":function(d){return l[d.tm_wday]},"%b":function(d){return h[d.tm_mon].substring(0,3)},"%B":function(d){return h[d.tm_mon]},"%C":function(d){return g((d.tm_year+1900)/100|0,2)},"%d":function(d){return g(d.tm_mday,2)},"%e":function(d){return _(d.tm_mday,2," ")},"%g":function(d){return A(d).toString().substring(2)},"%G":function(d){return A(d)},"%H":function(d){return g(d.tm_hour,2)},"%I":function(d){var w=d.tm_hour;return w==0?w=12:w>12&&(w-=12),g(w,2)},"%j":function(d){return g(d.tm_mday+Ro(Fr(d.tm_year+1900)?_e:ye,d.tm_mon-1),3)},"%m":function(d){return g(d.tm_mon+1,2)},"%M":function(d){return g(d.tm_min,2)},"%n":function(){return` +`},"%p":function(d){return d.tm_hour>=0&&d.tm_hour<12?"AM":"PM"},"%S":function(d){return g(d.tm_sec,2)},"%t":function(){return" "},"%u":function(d){return d.tm_wday||7},"%U":function(d){var w=d.tm_yday+7-d.tm_wday;return g(Math.floor(w/7),2)},"%V":function(d){var w=Math.floor((d.tm_yday+7-(d.tm_wday+6)%7)/7);if((d.tm_wday+371-d.tm_yday-2)%7<=2&&w++,w){if(w==53){var N=(d.tm_wday+371-d.tm_yday)%7;N==4||N==3&&Fr(d.tm_year)||(w=1)}}else{w=52;var B=(d.tm_wday+7-d.tm_yday-1)%7;(B==4||B==5&&Fr(d.tm_year%400-1))&&w++}return g(w,2)},"%w":function(d){return d.tm_wday},"%W":function(d){var w=d.tm_yday+7-(d.tm_wday+6)%7;return g(Math.floor(w/7),2)},"%y":function(d){return(d.tm_year+1900).toString().substring(2)},"%Y":function(d){return d.tm_year+1900},"%z":function(d){var w=d.tm_gmtoff,N=w>=0;return w=(w=Math.abs(w)/60)/60*100+w%60,(N?"+":"-")+("0000"+w).slice(-4)},"%Z":function(d){return d.tm_zone},"%%":function(){return"%"}};for(var f in u=u.replace(/%%/g,"\0\0"),T)u.includes(f)&&(u=u.replace(new RegExp(f,"g"),T[f](i)));var nr=Nr(u=u.replace(/\0\0/g,"%"),!1);return nr.length>e?0:(He(nr,r),nr.length-1)}function Zo(r,e,n,t){return Wo(r,e,n,t)}function we(r,e){r<128?e.push(r):e.push(r%128|128,r>>7)}function zo(r){for(var e={i:"i32",j:"i64",f:"f32",d:"f64",p:"i32"},n={parameters:[],results:r[0]=="v"?[]:[e[r[0]]]},t=1;t0||(Ie(),K>0||(s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),e()},1)):e()))}if(s.dynCall_iij=function(){return(s.dynCall_iij=s.asm.Nb).apply(null,arguments)},s.dynCall_jiji=function(){return(s.dynCall_jiji=s.asm.Ob).apply(null,arguments)},s.dynCall_viijii=function(){return(s.dynCall_viijii=s.asm.Pb).apply(null,arguments)},s.dynCall_iiiiij=function(){return(s.dynCall_iiiiij=s.asm.Qb).apply(null,arguments)},s.dynCall_iiiiijj=function(){return(s.dynCall_iiiiijj=s.asm.Rb).apply(null,arguments)},s.dynCall_iiiiiijj=function(){return(s.dynCall_iiiiiijj=s.asm.Sb).apply(null,arguments)},s.___emscripten_embedded_file_data=139184,s.stringToUTF8=Yr,s.lengthBytesUTF8=gr,s.addRunDependency=_r,s.removeRunDependency=lr,s.FS_createPath=o.createPath,s.FS_createDataFile=o.createDataFile,s.FS_createPreloadedFile=o.createPreloadedFile,s.FS_createLazyFile=o.createLazyFile,s.FS_createDevice=o.createDevice,s.FS_unlink=o.unlink,s.addFunction=qo,fr=function r(){Pr||Se(),Pr||(fr=r)},s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return Se(),G.ready},Ae.exports=Pe;var Ce=Tr.exports;const $o=Qo({__proto__:null,default:Xo(Ce)},[Ce]);export{$o as v}; diff --git a/assets/wfsUtils-372b3e59.js b/assets/wfsUtils-372b3e59.js new file mode 100644 index 0000000..67ae58c --- /dev/null +++ b/assets/wfsUtils-372b3e59.js @@ -0,0 +1 @@ +import{at as h,ha as v,ar as c,hb as D,hc as C,hd as N,he as x,bc as $,ca as U,cM as M,eo as w,bd as I,be as O,fp as j,cq as m,fy as L}from"./index-080e108a.js";import{s as V}from"./geojson-077f67ec.js";import{o as T,n as b}from"./xmlUtils-444cb4c0.js";function W(n){return q(n)??X(n)}function X(n){const t=new Date(n).getTime();return Number.isNaN(t)?null:t}function q(n){const t=z.exec(n);if(!(t!=null&&t.groups))return null;const e=t.groups,a=+e.year,s=+e.month-1,r=+e.day,o=+(e.hours??"0"),i=+(e.minutes??"0"),p=+(e.seconds??"0");if(o>23||i>59||p>59)return null;const u=e.ms??"0",l=u?+u.padEnd(3,"0").substring(0,3):0;let y;if(e.isUTC)y=Date.UTC(a,s,r,o,i,p,l);else if(e.offsetSign){const f=+e.offsetHours,F=+e.offsetMinutes;y=6e4*(e.offsetSign==="+"?-1:1)*(60*f+F)+Date.UTC(a,s,r,o,i,p,l)}else y=new Date(a,s,r,o,i,p,l).getTime();return Number.isNaN(y)?null:y}const z=/^(?:(?-?\d{4,})-(?\d{2})-(?\d{2}))(?:T(?\d{2}):(?\d{2}):(?\d{2})(?:\.(?\d+))?)?(?:(?Z)|(?:(?\+|-)(?\d{2}):(?\d{2})))?$/,S="xlink:href",d="2.0.0",E="__esri_wfs_id__",Y="wfs-layer:getWFSLayerTypeInfo-error",_="wfs-layer:empty-service",P="wfs-layer:feature-type-not-found",H="wfs-layer:geojson-not-supported",J="wfs-layer:kvp-encoding-not-supported",Q="wfs-layer:malformed-json",A="wfs-layer:unknown-geometry-type",B="wfs-layer:unknown-field-type",K="wfs-layer:unsupported-spatial-reference",Z="wfs-layer:unsupported-wfs-version";async function Te(n,t){const e=ee((await h(n,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:d,...t==null?void 0:t.customParameters},signal:t==null?void 0:t.signal})).data);return ae(n,e),e}function ee(n){const t=k(n);ge(t),G(t);const e=t.firstElementChild,a=v(re(e));return{operations:ne(e),get featureTypes(){return Array.from(a())},readFeatureTypes:a}}const te=new Set(["json","application/json","geojson","application/json; subtype=geojson"]);function ne(n){let t=!1;const e={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}};if(T(n,{OperationsMetadata:{Operation:a=>{switch(a.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:s=>{e.GetCapabilities.url=s.getAttribute(S)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:s=>{e.DescribeFeatureType.url=s.getAttribute(S)}}}};case"GetFeature":return{DCP:{HTTP:{Get:s=>{e.GetFeature.url=s.getAttribute(S)}}},Parameter:s=>{if(s.getAttribute("name")==="outputFormat")return{AllowedValues:{Value:r=>{const o=r.textContent;o&&te.has(o.toLowerCase())&&(e.GetFeature.outputFormat=o)}}}}}}},Constraint:a=>{switch(a.getAttribute("name")){case"KVPEncoding":return{DefaultValue:s=>{t=s.textContent.toLowerCase()==="true"}};case"ImplementsResultPaging":return{DefaultValue:s=>{e.GetFeature.supportsPagination=s.textContent.toLowerCase()==="true"}}}}}}),!t)throw new c(J,"WFS service doesn't support key/value pair (KVP) encoding");if(e.GetFeature.outputFormat==null)throw new c(H,"WFS service doesn't support GeoJSON output format");return e}function ae(n,t){D(n)&&(C(n,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=N(t.operations.DescribeFeatureType.url)),C(n,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=N(t.operations.GetFeature.url)))}function re(n){return b(n,{FeatureTypeList:{FeatureType:t=>{const e={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",supportedSpatialReferences:[]},a=new Set([4326]),s=r=>{var i,p,u;const o=parseInt(((u=(p=(i=r.textContent)==null?void 0:i.match(/(?\d+$)/i))==null?void 0:p.groups)==null?void 0:u.wkid)??"",10);Number.isNaN(o)||a.add(o)};return T(t,{Name:r=>{const{name:o,prefix:i}=g(r.textContent);e.typeName=`${i}:${o}`,e.name=o,e.namespacePrefix=i,e.namespaceUri=r.lookupNamespaceURI(i)},Abstract:r=>{e.description=r.textContent},Title:r=>{e.title=r.textContent},WGS84BoundingBox:r=>{e.extent=se(r)},DefaultSRS:s,DefaultCRS:s,OtherSRS:s,OtherCRS:s}),e.title||(e.title=e.name),e.supportedSpatialReferences.push(...a),e}}})}function se(n){let t,e,a,s;for(const r of n.children)switch(r.localName){case"LowerCorner":[t,e]=r.textContent.split(" ").map(o=>Number.parseFloat(o));break;case"UpperCorner":[a,s]=r.textContent.split(" ").map(o=>Number.parseFloat(o))}return{xmin:t,ymin:e,xmax:a,ymax:s,spatialReference:w}}function oe(n,t,e){return x(n,a=>e?a.name===t&&a.namespaceUri===e:a.typeName===t||a.name===t)}async function Fe(n,t,e,a={}){const{featureType:s,extent:r}=await ie(n,t,e,a),{fields:o,geometryType:i,swapXY:p,objectIdField:u,geometryField:l}=await ue(n,s.typeName,a);return{url:n.operations.GetCapabilities.url,name:s.name,namespaceUri:s.namespaceUri,fields:o,geometryField:l,geometryType:i,objectIdField:u,spatialReference:a.spatialReference??$.WGS84,extent:r,swapXY:p,wfsCapabilities:n,customParameters:a.customParameters}}async function ie(n,t,e,a={}){const{spatialReference:s=$.WGS84}=a,r=n.readFeatureTypes(),o=t?oe(r,t,e):r.next().value;if(o==null)throw t?new c(P,`The type '${t}' could not be found in the service`):new c(_,"The service is empty");let i=new U({...o.extent,spatialReference:s});if(!M(s,w))try{await I(w,s,void 0,a),i=O(i,w)}catch{throw new c(K,"Projection not supported")}return{extent:i,spatialReference:s,featureType:o}}async function ue(n,t,e={}){var u,l,y;const[a,s]=await j([ce(n.operations.DescribeFeatureType.url,t,e),le(n,t,e)]);if(a.error||s.error)throw new c(Y,`An error occurred while getting info about the feature type '${t}'`,{error:a.error||s.error});const{fields:r,errors:o}=a.value??{},i=((u=a.value)==null?void 0:u.geometryType)||((l=s.value)==null?void 0:l.geometryType),p=((y=s.value)==null?void 0:y.swapXY)??!1;if(i==null)throw new c(A,`The geometry type could not be determined for type '${t}`,{typeName:t,geometryType:i,fields:r,errors:o});return{...pe(r??[]),geometryType:i,swapXY:p}}function pe(n){const t=n.find(a=>a.type==="geometry");let e=n.find(a=>a.type==="oid");return n=n.filter(a=>a.type!=="geometry"),e||(e=new m({name:E,type:"oid",alias:E}),n.unshift(e)),{geometryField:(t==null?void 0:t.name)??null,objectIdField:e.name,fields:n}}async function le(n,t,e={}){var p;let a,s=!1;const[r,o]=await Promise.all([de(n.operations.GetFeature.url,t,n.operations.GetFeature.outputFormat,{...e,count:1}),h(n.operations.GetFeature.url,{responseType:"text",query:R(t,void 0,{...e,count:1}),signal:e==null?void 0:e.signal})]),i=r.type==="FeatureCollection"&&((p=r.features[0])==null?void 0:p.geometry);if(i){let u;switch(a=L.fromJSON(V(i.type)),i.type){case"Point":u=i.coordinates;break;case"LineString":case"MultiPoint":u=i.coordinates[0];break;case"MultiLineString":case"Polygon":u=i.coordinates[0][0];break;case"MultiPolygon":u=i.coordinates[0][0][0]}const l=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(o.data);if(l){const y=u[0].toFixed(3),f=u[1].toFixed(3),F=parseFloat(l[1]).toFixed(3);y===parseFloat(l[2]).toFixed(3)&&f===F&&(s=!0)}}return{geometryType:a,swapXY:s}}async function ce(n,t,e){return ye(t,(await h(n,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:d,TYPENAME:t,...e==null?void 0:e.customParameters},signal:e==null?void 0:e.signal})).data)}function ye(n,t){const{name:e}=g(n),a=k(t);G(a);const s=x(b(a.firstElementChild,{element:r=>({name:r.getAttribute("name"),typeName:g(r.getAttribute("type")).name})}),({name:r})=>r===e);if(s!=null){const r=x(b(a.firstElementChild,{complexType:o=>o}),o=>o.getAttribute("name")===s.typeName);if(r!=null)return fe(r)}throw new c(P,`Type '${n}' not found in document`,{document:new XMLSerializer().serializeToString(a)})}const me=new Set(["objectid","fid"]);function fe(n){const t=[],e=[];let a;const s=b(n,{complexContent:{extension:{sequence:{element:r=>r}}}});for(const r of s){const o=r.getAttribute("name");if(!o)continue;let i,p;if(r.hasAttribute("type")?i=g(r.getAttribute("type")).name:T(r,{simpleType:{restriction:y=>(i=g(y.getAttribute("base")).name,{maxLength:f=>{p=+f.getAttribute("value")}})}}),!i)continue;const u=r.getAttribute("nillable")==="true";let l=!1;switch(i.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":e.push(new m({name:o,alias:o,type:"integer",nullable:u}));break;case"float":case"double":case"decimal":e.push(new m({name:o,alias:o,type:"double",nullable:u}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":e.push(new m({name:o,alias:o,type:"string",nullable:u,length:p??255}));break;case"datetime":case"date":e.push(new m({name:o,alias:o,type:"date",nullable:u,length:p??36}));break;case"pointpropertytype":a="point",l=!0;break;case"multipointpropertytype":a="multipoint",l=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":a="polyline",l=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":a="polygon",l=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":l=!0,t.push(new c(A,`geometry type '${i}' is not supported`,{type:new XMLSerializer().serializeToString(n)}));break;default:t.push(new c(B,`Unknown field type '${i}'`,{type:new XMLSerializer().serializeToString(n)}))}l&&e.push(new m({name:o,alias:o,type:"geometry",nullable:u}))}for(const r of e)if(r.type==="integer"&&!r.nullable&&me.has(r.name.toLowerCase())){r.type="oid";break}return{geometryType:a,fields:e,errors:t}}async function de(n,t,e,a){var r;let{data:s}=await h(n,{responseType:"text",query:R(t,e,a),signal:a==null?void 0:a.signal});s=s.replaceAll(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{if((r=a==null?void 0:a.dateFields)!=null&&r.length){const o=new Set(a.dateFields);return JSON.parse(s,(i,p)=>o.has(i)?W(p):p)}return JSON.parse(s)}catch(o){throw new c(Q,"Error while parsing the response",{response:s,error:o})}}function R(n,t,e){return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:d,TYPENAMES:n,OUTPUTFORMAT:t,SRSNAME:"EPSG:4326",STARTINDEX:e==null?void 0:e.startIndex,COUNT:e==null?void 0:e.count,...e==null?void 0:e.customParameters}}function k(n){return new DOMParser().parseFromString(n.trim(),"text/xml")}function g(n){const[t,e]=n.split(":");return{prefix:e?t:"",name:e??t}}function ge(n){var e;const t=(e=n.firstElementChild)==null?void 0:e.getAttribute("version");if(t&&t!==d)throw new c(Z,`Unsupported WFS version ${t}. Supported version: ${d}`)}function G(n){let t="",e="";if(T(n.firstElementChild,{Exception:a=>(t=a.getAttribute("exceptionCode"),{ExceptionText:s=>{e=s.textContent}})}),t)throw new c(`wfs-layer:${t}`,e)}export{de as H,oe as M,E as S,Fe as V,pe as Y,Te as v}; diff --git a/assets/widget-78e8b6fe.js b/assets/widget-78e8b6fe.js new file mode 100644 index 0000000..6fc9393 --- /dev/null +++ b/assets/widget-78e8b6fe.js @@ -0,0 +1 @@ +import"./index-080e108a.js";function o(t){return t&&typeof t.render=="function"}function r(t){return t&&typeof t.postMixInProperties=="function"&&typeof t.buildRendering=="function"&&typeof t.postCreate=="function"&&typeof t.startup=="function"}export{o as e,r as t}; diff --git a/assets/xmlUtils-444cb4c0.js b/assets/xmlUtils-444cb4c0.js new file mode 100644 index 0000000..282c8f5 --- /dev/null +++ b/assets/xmlUtils-444cb4c0.js @@ -0,0 +1 @@ +function e(i,f){if(i&&f){for(const o of i.children)if(o.localName in f){const n=f[o.localName];if(typeof n=="function"){const c=n(o);c&&e(o,c)}else e(o,n)}}}function*l(i,f){for(const o of i.children)if(o.localName in f){const n=f[o.localName];typeof n=="function"?yield n(o):yield*l(o,n)}}export{l as n,e as o}; diff --git a/assets/xyChart-881759ac.js b/assets/xyChart-881759ac.js new file mode 100644 index 0000000..2b446ba --- /dev/null +++ b/assets/xyChart-881759ac.js @@ -0,0 +1 @@ +import{w as Me,J as Y,z as A,R as V,F as oe,X as Qe,v as he,p as $e,g as ue,Z as Ae,c as w,l as f,D as Ce,K as X,x as Ie,y as et,B as j,C as tt,n as Te,E as it,A as st,H as at,Q as Re,m as ge,I as je,W as z,M as G,L as K,Y as ot,t as nt,f as S,G as Ye,P as Xe,$ as le,U as ee,a as te,k as Ve,O as Oe,S as Se,N as rt,V as lt}from"./Popup-db207f4c.js";import{s as Fe}from"./ColorSet-bb3b0c3c.js";import{U as Ge,D as Ee,_ as Ne,g as pe,B as ze,V as Ue,k as R,I as ht}from"./Tick-c7ca49b9.js";import{o as ct,n as Le}from"./Button-5999eab8.js";import{fj as ie}from"./index-080e108a.js";import"./unitFormatUtils-b70a7bff.js";import"./AttachmentInfo-cb670dd0.js";import"./AttachmentQuery-972bbd60.js";import"./widget-78e8b6fe.js";import"./jsonUtils-f73b3833.js";import"./UniqueValueRenderer-fef4204d.js";import"./diffUtils-590c9088.js";import"./DictionaryLoader-c0729336.js";import"./FieldsIndex-f79a8f26.js";import"./heatmapUtils-327ef4c5.js";import"./Query-1c961d4c.js";import"./executeQueryJSON-7c41ada5.js";import"./query-93c6e211.js";import"./normalizeUtils-cf8b8053.js";import"./normalizeUtilsCommon-500064b3.js";import"./pbfQueryUtils-26a87215.js";import"./pbf-d9aa3914.js";import"./queryZScale-8f9616ff.js";import"./FeatureSet-111cb247.js";import"./RelationshipQuery-39c07195.js";import"./TopFeaturesQuery-e44d05be.js";import"./FeatureLayer-5c6d2c3b.js";import"./MultiOriginJSONSupport-e4912ffd.js";import"./sql-734ecbc5.js";import"./FeatureLayerBase-7c7dfccb.js";import"./commonProperties-30089b06.js";import"./featureLayerUtils-6cf06f83.js";import"./serviceCapabilitiesUtils-959e798a.js";import"./editsZScale-1b5a53a6.js";import"./APIKeyMixin-878a7aa7.js";import"./ArcGISService-83287338.js";import"./CustomParametersMixin-231c4be8.js";import"./EditBusLayer-d71787e9.js";import"./FeatureEffectLayer-4160946c.js";import"./FeatureEffect-86735d98.js";import"./FeatureFilter-00f4be05.js";import"./FeatureReductionLayer-4262cf54.js";import"./LabelClass-2d53c485.js";import"./defaults-34554cbf.js";import"./defaultsJSON-59981e75.js";import"./OperationalLayer-0e8f8b28.js";import"./OrderedLayer-68067459.js";import"./PortalLayer-310c2800.js";import"./portalItemUtils-792a27e1.js";import"./TemporalLayer-f17c9161.js";import"./FeatureTemplate-2a7e96c1.js";import"./FeatureType-db96032c.js";import"./fieldProperties-62c55499.js";import"./labelingInfo-144f3d9f.js";import"./versionUtils-f17daa93.js";import"./styleUtils-25825fd6.js";import"./popupUtils-82ea8abb.js";function We(v){return typeof v=="object"&&"length"in v?v:Array.from(v)}function Be(v){this._context=v}function He(v){return new Be(v)}function Ze(v){return v[0]}function qe(v){return v[1]}function Ke(v,e){var t=R(!0),i=null,s=He,a=null,n=Ue(r);function r(o){var l,d,h,c=(o=We(o)).length,u=!1;for(i==null&&(a=s(h=n())),l=0;l<=c;++l)!(l=u;--g)r.point(b[g],y[g]);r.lineEnd(),r.areaEnd()}x&&(b[c]=+v(p,c,h),y[c]=+e(p,c,h),r.point(i?+i(p,c,h):b[c],t?+t(p,c,h):y[c]))}if(m)return r=null,m+""||null}function d(){return Ke().defined(s).curve(n).context(a)}return v=typeof v=="function"?v:v===void 0?Ze:R(+v),e=typeof e=="function"?e:R(e===void 0?0:+e),t=typeof t=="function"?t:t===void 0?qe:R(+t),l.x=function(h){return arguments.length?(v=typeof h=="function"?h:R(+h),i=null,l):v},l.x0=function(h){return arguments.length?(v=typeof h=="function"?h:R(+h),l):v},l.x1=function(h){return arguments.length?(i=h==null?null:typeof h=="function"?h:R(+h),l):i},l.y=function(h){return arguments.length?(e=typeof h=="function"?h:R(+h),t=null,l):e},l.y0=function(h){return arguments.length?(e=typeof h=="function"?h:R(+h),l):e},l.y1=function(h){return arguments.length?(t=h==null?null:typeof h=="function"?h:R(+h),l):t},l.lineX0=l.lineY0=function(){return d().x(v).y(e)},l.lineY1=function(){return d().x(v).y(t)},l.lineX1=function(){return d().x(i).y(e)},l.defined=function(h){return arguments.length?(s=typeof h=="function"?h:R(!!h),l):s},l.curve=function(h){return arguments.length?(n=h,a!=null&&(r=n(a)),l):n},l.context=function(h){return arguments.length?(h==null?a=r=null:r=n(a=h),l):a},l}Be.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(v,e){switch(v=+v,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(v,e):this._context.moveTo(v,e);break;case 1:this._point=2;default:this._context.lineTo(v,e)}}};class ut extends nt{setupDefaultRules(){super.setupDefaultRules();const e=this._root.interfaceColors,t=this._root.language,i=this.rule.bind(this);i("XYChart").setAll({colors:Fe.new(this._root,{}),paddingLeft:20,paddingRight:20,paddingTop:16,paddingBottom:16,panX:!1,panY:!1,wheelStep:.25,arrangeTooltips:!0,pinchZoomX:!1,pinchZoomY:!1}),i("XYSeries").setAll({legendLabelText:"{name}"}),i("XYChart",["scrollbar","chart"]).setAll({paddingBottom:0,paddingLeft:0,paddingTop:0,paddingRight:0,colors:Fe.new(this._root,{saturation:0})});{const o=i("Graphics",["scrollbar","overlay"]);o.setAll({fillOpacity:.5}),S(o,"fill",e,"background")}i("RoundedRectangle",["xy","scrollbar","thumb"]).setAll({cornerRadiusTR:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusBL:0,fillOpacity:0,focusable:!0}),i("RoundedRectangle",["xy","scrollbar","thumb"]).states.create("hover",{fillOpacity:.4}),i("RoundedRectangle",["xy","scrollbar","chart","background"]).setAll({cornerRadiusTL:0,cornerRadiusBL:0,cornerRadiusTR:0,cornerRadiusBR:0}),i("RoundedRectangle",["xy","scrollbar","chart","background","resize","button"]).setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),i("AxisRendererX",["xy","chart","scrollbar"]).setAll({strokeOpacity:0,inside:!0}),i("AxisRendererY",["xy","chart","scrollbar"]).setAll({strokeOpacity:0,inside:!0,minGridDistance:5}),i("AxisLabel",["xy","scrollbar","x"]).setAll({opacity:.5,centerY:A,minPosition:.01,maxPosition:.99,fontSize:"0.8em"}),i("AxisLabel",["category"]).setAll({text:"{category}",populateText:!0}),i("AxisLabel",["x"]).setAll({centerY:0}),i("AxisLabel",["x","inside"]).setAll({centerY:A}),i("AxisLabel",["x","inside","opposite"]).setAll({centerY:0}),i("AxisLabel",["x","opposite"]).setAll({centerY:A}),i("AxisLabel",["y"]).setAll({centerX:A}),i("AxisLabel",["y","inside"]).setAll({centerX:0}),i("AxisLabel",["y","inside","opposite"]).setAll({centerX:A}),i("AxisLabel",["y","opposite"]).setAll({centerX:0}),i("AxisLabel",["xy","scrollbar","y"]).setAll({visible:!1}),i("Grid",["xy","scrollbar","y"]).setAll({visible:!1}),i("Grid",["xy","scrollbar","x"]).setAll({opacity:.5}),i("XYCursor").setAll({behavior:"none",layer:30,exportable:!1,snapToSeriesBy:"xy",moveThreshold:1});{const o=i("Grid",["cursor","x"]);o.setAll({strokeOpacity:.8,strokeDasharray:[2,2],ariaLabel:t.translate("Use left and right arrows to move selection")}),S(o,"stroke",e,"alternativeBackground")}{const o=i("Grid",["cursor","y"]);o.setAll({strokeOpacity:.8,strokeDasharray:[2,2],ariaLabel:t.translate("Use up and down arrows to move selection")}),S(o,"stroke",e,"alternativeBackground")}{const o=i("Graphics",["cursor","selection"]);o.setAll({fillOpacity:.15}),S(o,"fill",e,"alternativeBackground")}i("Axis").setAll({start:0,end:1,minZoomCount:1,maxZoomCount:1/0,maxZoomFactor:1e3,maxDeviation:.1,snapTooltip:!0,tooltipLocation:.5,panX:!0,panY:!0,zoomX:!0,zoomY:!0,fixAxisSize:!0}),i("AxisLabel").setAll({location:.5,multiLocation:0,centerX:Ye,centerY:Ye,paddingTop:3,paddingBottom:3,paddingLeft:5,paddingRight:5}),i("Container",["axis","header"]).setAll({layer:30}),i("Rectangle",["axis","header","background"]).setAll({crisp:!0});{const o=i("AxisRenderer");o.setAll({crisp:!0,strokeOpacity:0}),S(o,"stroke",e,"grid")}i("AxisRendererX").setAll({minGridDistance:120,opposite:!1,inversed:!1,cellStartLocation:0,cellEndLocation:1,width:A}),i("AxisRendererY").setAll({minGridDistance:40,opposite:!1,inversed:!1,cellStartLocation:0,cellEndLocation:1,height:A});{const o=i("Rectangle",["axis","thumb"]);o.setAll({fillOpacity:0}),S(o,"fill",e,"alternativeBackground"),o.states.create("hover",{fillOpacity:.1})}i("Rectangle",["axis","thumb","x"]).setAll({cursorOverStyle:"ew-resize"}),i("Rectangle",["axis","thumb","y"]).setAll({cursorOverStyle:"ns-resize"});{const o=i("Grid");o.setAll({location:0,strokeOpacity:.15,crisp:!0}),S(o,"stroke",e,"grid")}i("Grid",["base"]).setAll({strokeOpacity:.3});{const o=i("Graphics",["axis","fill"]);o.setAll({visible:!1,isMeasured:!1,position:"absolute",fillOpacity:.05}),S(o,"fill",e,"alternativeBackground")}i("Graphics",["axis","fill","range"]).setAll({isMeasured:!0}),i("Graphics",["series","fill","range"]).setAll({visible:!1,isMeasured:!0}),i("Grid",["series","range"]).setAll({visible:!1}),i("AxisTick",["series","range"]).setAll({visible:!1}),i("AxisLabel",["series","range"]).setAll({visible:!1});{const o=i("AxisTick");o.setAll({location:.5,multiLocation:0,strokeOpacity:1,isMeasured:!1,position:"absolute",visible:!1}),S(o,"stroke",e,"grid")}i("CategoryAxis").setAll({startLocation:0,endLocation:1,fillRule:(o,l)=>{const d=o.get("axisFill");d&&(f(l)&&l%2!=0?d.setPrivate("visible",!1):d.setPrivate("visible",!0))}});const s=[{timeUnit:"millisecond",count:1},{timeUnit:"millisecond",count:5},{timeUnit:"millisecond",count:10},{timeUnit:"millisecond",count:50},{timeUnit:"millisecond",count:100},{timeUnit:"millisecond",count:500},{timeUnit:"second",count:1},{timeUnit:"second",count:5},{timeUnit:"second",count:10},{timeUnit:"second",count:30},{timeUnit:"minute",count:1},{timeUnit:"minute",count:5},{timeUnit:"minute",count:10},{timeUnit:"minute",count:15},{timeUnit:"minute",count:30},{timeUnit:"hour",count:1},{timeUnit:"hour",count:3},{timeUnit:"hour",count:6},{timeUnit:"hour",count:12},{timeUnit:"day",count:1},{timeUnit:"day",count:2},{timeUnit:"day",count:3},{timeUnit:"day",count:4},{timeUnit:"day",count:5},{timeUnit:"week",count:1},{timeUnit:"month",count:1},{timeUnit:"month",count:2},{timeUnit:"month",count:3},{timeUnit:"month",count:6},{timeUnit:"year",count:1},{timeUnit:"year",count:2},{timeUnit:"year",count:5},{timeUnit:"year",count:10},{timeUnit:"year",count:50},{timeUnit:"year",count:100},{timeUnit:"year",count:200},{timeUnit:"year",count:500},{timeUnit:"year",count:1e3},{timeUnit:"year",count:2e3},{timeUnit:"year",count:5e3},{timeUnit:"year",count:1e4},{timeUnit:"year",count:1e5}],a={millisecond:t.translate("_date_millisecond"),second:t.translate("_date_second"),minute:t.translate("_date_minute"),hour:t.translate("_date_hour"),day:t.translate("_date_day"),week:t.translate("_date_day"),month:t.translate("_date_month"),year:t.translate("_date_year")},n={millisecond:t.translate("_date_millisecond"),second:t.translate("_date_second"),minute:t.translate("_date_minute"),hour:t.translate("_date_day"),day:t.translate("_date_day"),week:t.translate("_date_day"),month:t.translate("_date_month")+" "+t.translate("_date_year"),year:t.translate("_date_year")},r={millisecond:t.translate("_date_millisecond_full"),second:t.translate("_date_second_full"),minute:t.translate("_date_minute_full"),hour:t.translate("_date_hour_full"),day:t.translate("_date_day_full"),week:t.translate("_date_week_full"),month:t.translate("_date_month_full"),year:t.translate("_date_year")};i("CategoryDateAxis").setAll({markUnitChange:!0,gridIntervals:Xe(s),dateFormats:le(a),periodChangeDateFormats:le(n)}),i("DateAxis").setAll({maxZoomFactor:null,strictMinMax:!0,startLocation:0,endLocation:1,markUnitChange:!0,groupData:!1,groupCount:500,gridIntervals:Xe(s),dateFormats:le(a),periodChangeDateFormats:le(n),tooltipDateFormats:r,groupIntervals:[{timeUnit:"millisecond",count:1},{timeUnit:"millisecond",count:10},{timeUnit:"millisecond",count:100},{timeUnit:"second",count:1},{timeUnit:"second",count:10},{timeUnit:"minute",count:1},{timeUnit:"minute",count:10},{timeUnit:"hour",count:1},{timeUnit:"day",count:1},{timeUnit:"week",count:1},{timeUnit:"month",count:1},{timeUnit:"year",count:1}],fillRule:o=>{const l=o.get("axisFill");if(l){const d=o.component,h=o.get("value"),c=o.get("endValue"),u=d.intervalDuration(),g=d.getPrivate("baseInterval"),p=d.getPrivate("gridInterval",g);let m=d.getPrivate("min",0);if(m=ht(new Date(m),p.timeUnit,p.count,this._root.locale.firstDayOfWeek,this._root.utc,void 0,this._root.timezone).getTime(),h!=null&&c!=null){const _=Math.round(Math.round((h-m)/u))/2;_==Math.round(_)?l.setPrivate("visible",!0):l.setPrivate("visible",!1)}}}}),i("GaplessDateAxis").setAll({fillRule:o=>{const l=o.get("axisFill");if(l){const d=o.get("index");let h=!1;f(d)&&d%2!=0||(h=!0),l.setPrivate("visible",h)}}}),i("ValueAxis").setAll({baseValue:0,logarithmic:!1,strictMinMax:!1,autoZoom:!0,fillRule:o=>{const l=o.get("axisFill");if(l){const d=o.component,h=o.get("value"),c=d.getPrivate("step");f(h)&&f(c)&&(j(h/c/2,5)==Math.round(h/c/2)?l.setPrivate("visible",!1):l.setPrivate("visible",!0))}}}),i("DurationAxis").setAll({baseUnit:"second"}),i("XYSeries").setAll({maskBullets:!0,stackToNegative:!0,locationX:.5,locationY:.5,snapTooltip:!1,openValueXGrouped:"open",openValueYGrouped:"open",valueXGrouped:"close",valueYGrouped:"close",seriesTooltipTarget:"series"}),i("BaseColumnSeries").setAll({adjustBulletPosition:!0}),i("ColumnSeries").setAll({clustered:!0}),i("RoundedRectangle",["series","column"]).setAll({position:"absolute",isMeasured:!1,width:ee(70),height:ee(70),strokeWidth:1,strokeOpacity:1,cornerRadiusBL:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusTR:0,fillOpacity:1,role:"figure"}),i("LineSeries").setAll({connect:!0,autoGapCount:1.1,stackToNegative:!1}),i("Graphics",["series","stroke"]).setAll({position:"absolute",strokeWidth:1,strokeOpacity:1,isMeasured:!1}),i("Graphics",["series","fill"]).setAll({visible:!1,fillOpacity:0,position:"absolute",strokeWidth:0,strokeOpacity:0,isMeasured:!1}),i("Graphics",["line","series","legend","marker","stroke"]).setAll({draw:(o,l)=>{const d=l.parent;if(d){const h=d.height(),c=d.width();o.moveTo(0,h/2),o.lineTo(c,h/2)}}});{const o=i("Graphics",["line","series","legend","marker","stroke"]).states.create("disabled",{});S(o,"stroke",e,"disabled")}i("Graphics",["line","series","legend","marker","fill"]).setAll({draw:(o,l)=>{const d=l.parent;if(d){const h=d.height(),c=d.width();o.moveTo(0,0),o.lineTo(c,0),o.lineTo(c,h),o.lineTo(0,h),o.lineTo(0,0)}}});{const o=i("Graphics",["line","series","legend","marker","fill"]).states.create("disabled",{});S(o,"stroke",e,"disabled")}i("SmoothedXYLineSeries").setAll({tension:.5}),i("SmoothedXLineSeries").setAll({tension:.5}),i("SmoothedYLineSeries").setAll({tension:.5}),i("Candlestick").setAll({position:"absolute",isMeasured:!1,width:ee(50),height:ee(50),strokeWidth:1,strokeOpacity:1,cornerRadiusBL:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusTR:0,fillOpacity:1,role:"figure"}),i("OHLC").setAll({width:ee(80),height:ee(80)}),i("CandlestickSeries").setAll({lowValueXGrouped:"low",lowValueYGrouped:"low",highValueXGrouped:"high",highValueYGrouped:"high",openValueXGrouped:"open",openValueYGrouped:"open",valueXGrouped:"close",valueYGrouped:"close"});{const o=i("Rectangle",["column","autocolor"]).states.create("riseFromOpen",{});S(o,"fill",e,"positive"),S(o,"stroke",e,"positive")}{const o=i("Rectangle",["column","autocolor"]).states.create("dropFromOpen",{});S(o,"fill",e,"negative"),S(o,"stroke",e,"negative")}i("Rectangle",["column","autocolor","pro"]).states.create("riseFromOpen",{fillOpacity:0}),i("Rectangle",["column","autocolor","pro"]).states.create("dropFromOpen",{fillOpacity:1});{const o=i("Rectangle",["column","autocolor","pro"]).states.create("riseFromPrevious",{});S(o,"fill",e,"positive"),S(o,"stroke",e,"positive")}{const o=i("Rectangle",["column","autocolor","pro"]).states.create("dropFromPrevious",{});S(o,"fill",e,"negative"),S(o,"stroke",e,"negative")}}}class xe extends Ge{constructor(){super(...arguments),Object.defineProperty(this,"xAxes",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"yAxes",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"topAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(Y.new(this._root,{width:A,layout:this._root.verticalLayout}))}),Object.defineProperty(this,"yAxesAndPlotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(Y.new(this._root,{width:A,height:A,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"bottomAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(Y.new(this._root,{width:A,layout:this._root.verticalLayout}))}),Object.defineProperty(this,"leftAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(Y.new(this._root,{height:A,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"plotsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(Y.new(this._root,{width:A,height:A,maskContent:!1}))}),Object.defineProperty(this,"plotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotsContainer.children.push(Y.new(this._root,{width:A,height:A}))}),Object.defineProperty(this,"topPlotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotsContainer.children.push(Y.new(this._root,{width:A,height:A}))}),Object.defineProperty(this,"gridContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotContainer.children.push(Y.new(this._root,{width:A,height:A,isMeasured:!1}))}),Object.defineProperty(this,"topGridContainer",{enumerable:!0,configurable:!0,writable:!0,value:Y.new(this._root,{width:A,height:A,isMeasured:!1})}),Object.defineProperty(this,"rightAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(Y.new(this._root,{height:A,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"axisHeadersContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotContainer.children.push(Y.new(this._root,{}))}),Object.defineProperty(this,"zoomOutButton",{enumerable:!0,configurable:!0,writable:!0,value:this.topPlotContainer.children.push(ct.new(this._root,{themeTags:["zoom"],icon:V.new(this._root,{themeTags:["button","icon"]})}))}),Object.defineProperty(this,"_movePoint",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,"_wheelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_otherCharts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_movePoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_downStartX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downEndX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downStartY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downEndY",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this._defaultThemes.push(ut.new(this._root)),super._afterNew(),this._disposers.push(this.xAxes),this._disposers.push(this.yAxes);const e=this._root;let t=this._root.verticalLayout;const i=this.zoomOutButton;i.events.on("click",()=>{this.zoomOut()}),i.set("opacity",0),i.states.lookup("default").set("opacity",1),this.chartContainer.set("layout",t);const s=this.plotContainer;s.children.push(this.seriesContainer),this._disposers.push(this._processAxis(this.xAxes,this.bottomAxesContainer)),this._disposers.push(this._processAxis(this.yAxes,this.leftAxesContainer)),s.children.push(this.topGridContainer),s.children.push(this.bulletsContainer),s.set("interactive",!0),s.set("interactiveChildren",!1),s.set("background",oe.new(e,{themeTags:["xy","background"],fill:Qe.fromHex(0),fillOpacity:0})),this._disposers.push(s.events.on("pointerdown",a=>{this._handlePlotDown(a.originalEvent)})),this._disposers.push(s.events.on("globalpointerup",a=>{this._handlePlotUp(a.originalEvent)})),this._disposers.push(s.events.on("globalpointermove",a=>{this._handlePlotMove(a.originalEvent)})),this._maskGrid(),this._setUpTouch()}_beforeChanged(){super._beforeChanged(),(this.isDirty("pinchZoomX")||this.isDirty("pinchZoomY")||this.get("panX")||this.get("panY"))&&this._setUpTouch()}_setUpTouch(){this.plotContainer._display.cancelTouch||(this.plotContainer._display.cancelTouch=!!(this.get("pinchZoomX")||this.get("pinchZoomY")||this.get("panX")||this.get("panY")))}_maskGrid(){this.gridContainer.set("maskContent",!0),this.topGridContainer.set("maskContent",!0)}_removeSeries(e){const t=e.get("xAxis");t&&(he(t.series,e),t.markDirtyExtremes());const i=e.get("yAxis");i&&(he(i.series,e),i.markDirtyExtremes());const s=this.get("cursor");if(s){const a=s.get("snapToSeries");a&&he(a,e)}super._removeSeries(e)}handleWheel(e){const t=this.get("wheelX"),i=this.get("wheelY"),s=this.plotContainer,a=e.originalEvent;if(!$e(a,this))return;a.preventDefault();const n=s.toLocal(this._root.documentPointToRoot({x:a.clientX,y:a.clientY})),r=this.get("wheelStep",.2),o=a.deltaY/100,l=a.deltaX/100,d=this.get("wheelZoomPositionX"),h=this.get("wheelZoomPositionY");t!=="zoomX"&&t!=="zoomXY"||l==0||this.xAxes.each(c=>{if(c.get("zoomX")){let u=c.get("start"),g=c.get("end"),p=c.fixPosition(n.x/s.width());d!=null&&(p=d);let m=u-r*(g-u)*l*p,_=g+r*(g-u)*l*(1-p);1/(_-m){if(c.get("zoomX")){let u=c.get("start"),g=c.get("end"),p=c.fixPosition(n.x/s.width());d!=null&&(p=d);let m=u-r*(g-u)*o*p,_=g+r*(g-u)*o*(1-p);1/(_-m){if(c.get("zoomY")){let u=c.get("start"),g=c.get("end"),p=c.fixPosition(n.y/s.height());h!=null&&(p=h);let m=u-r*(g-u)*l*p,_=g+r*(g-u)*l*(1-p);1/(_-m){if(c.get("zoomY")){let u=c.get("start"),g=c.get("end"),p=c.fixPosition(n.y/s.height());h!=null&&(p=h);let m=u-r*(g-u)*o*p,_=g+r*(g-u)*o*(1-p);1/(_-m){if(c.get("panX")){let u=c.get("start"),g=c.get("end"),p=this._getWheelSign(c)*r*(g-u)*l,m=u+p,_=g+p,x=this._fixWheel(m,_);m=x[0],_=x[1],this._handleWheelAnimation(c.zoom(m,_))}}),i!=="panX"&&i!=="panXY"||o==0||this.xAxes.each(c=>{if(c.get("panX")){let u=c.get("start"),g=c.get("end"),p=this._getWheelSign(c)*r*(g-u)*o,m=u+p,_=g+p,x=this._fixWheel(m,_);m=x[0],_=x[1],this._handleWheelAnimation(c.zoom(m,_))}}),t!=="panY"&&t!=="panXY"||l==0||this.yAxes.each(c=>{if(c.get("panY")){let u=c.get("start"),g=c.get("end"),p=this._getWheelSign(c)*r*(g-u)*l,m=u+p,_=g+p,x=this._fixWheel(m,_);m=x[0],_=x[1],this._handleWheelAnimation(c.zoom(m,_))}}),i!=="panY"&&i!=="panXY"||o==0||this.yAxes.each(c=>{if(c.get("panY")){let u=c.get("start"),g=c.get("end"),p=this._getWheelSign(c)*r*(g-u)*o,m=u-p,_=g-p,x=this._fixWheel(m,_);m=x[0],_=x[1],this._handleWheelAnimation(c.zoom(m,_))}})}_handleSetWheel(){const e=this.get("wheelX"),t=this.get("wheelY"),i=this.plotContainer;e!=="none"||t!=="none"?(this._wheelDp=i.events.on("wheel",s=>{this.handleWheel(s)}),this._disposers.push(this._wheelDp)):this._wheelDp&&this._wheelDp.dispose()}_getWheelSign(e){let t=1;return e.get("renderer").get("inversed")&&(t=-1),t}_fixWheel(e,t){const i=t-e;return e<0&&(t=(e=0)+i),t>1&&(e=(t=1)-i),[e,t]}_handlePlotDown(e){if(e.button==2)return;const t=this.plotContainer;let i=t.toLocal(this._root.documentPointToRoot({x:e.clientX,y:e.clientY}));if((this.get("pinchZoomX")||this.get("pinchZoomY"))&&e.pointerId&&ue(t._downPoints).length>0){const s=this.xAxes.getIndex(0),a=this.yAxes.getIndex(0);s&&(this._downStartX=s.get("start",0),this._downEndX=s.get("end",1)),a&&(this._downStartY=a.get("start",0),this._downEndY=a.get("end",1))}if((this.get("panX")||this.get("panY"))&&i.x>=0&&i.y>=0&&i.x<=t.width()&&i.y<=this.height()){this._downPoint={x:e.clientX,y:e.clientY};const s=this.get("panX"),a=this.get("panY");s&&this.xAxes.each(r=>{r._panStart=r.get("start"),r._panEnd=r.get("end")}),a&&this.yAxes.each(r=>{r._panStart=r.get("start"),r._panEnd=r.get("end")});const n="panstarted";this.events.isEnabled(n)&&this.events.dispatch(n,{type:n,target:this,originalEvent:e})}}_handleWheelAnimation(e){e?e.events.on("stopped",()=>{this._dispatchWheelAnimation()}):this._dispatchWheelAnimation()}_dispatchWheelAnimation(){const e="wheelended";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this})}_handlePlotUp(e){const t=this._downPoint;if(t&&(this.get("panX")||this.get("panY"))){let i=this.plotContainer.toLocal(this._root.documentPointToRoot({x:e.clientX,y:e.clientY}));if(i.x==t.x&&i.y==t.y){const a="pancancelled";this.events.isEnabled(a)&&this.events.dispatch(a,{type:a,target:this,originalEvent:e})}const s="panended";this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this,originalEvent:e})}this._downPoint=void 0,this.xAxes.each(i=>{i._isPanning=!1}),this.yAxes.each(i=>{i._isPanning=!1})}_handlePlotMove(e){const t=this.plotContainer;if(this.get("pinchZoomX")||this.get("pinchZoomY")){const s=e.pointerId;if(s&&(this._movePoints[s]=this._root.documentPointToRoot({x:e.clientX,y:e.clientY}),ue(t._downPoints).length>1))return void this._handlePinch()}let i=this._downPoint;if(i){i=t.toLocal(this._root.documentPointToRoot(i));let s=t.toLocal(this._root.documentPointToRoot({x:e.clientX,y:e.clientY}));const a=this.get("panX"),n=this.get("panY");if(a){let r=this.get("scrollbarX");r&&r.events.disableType("rangechanged"),this.xAxes.each(o=>{if(o.get("panX")){o._isPanning=!0;let l=o._panStart,d=o._panEnd,h=(d-l)*(i.x-s.x)/t.width();o.get("renderer").get("inversed")&&(h*=-1);let c=l+h,u=d+h;u-c<1+2*o.get("maxDeviation",1)&&(o.set("start",c),o.set("end",u))}}),r&&r.events.enableType("rangechanged")}if(n){let r=this.get("scrollbarY");r&&r.events.disableType("rangechanged"),this.yAxes.each(o=>{if(o.get("panY")){o._isPanning=!0;let l=o._panStart,d=o._panEnd,h=(d-l)*(i.y-s.y)/t.height();o.get("renderer").get("inversed")&&(h*=-1);let c=l-h,u=d-h;u-c<1+2*o.get("maxDeviation",1)&&(o.set("start",c),o.set("end",u))}}),r&&r.events.enableType("rangechanged")}}}_handlePinch(){const e=this.plotContainer;let t=0,i=[],s=[];if(Ae(e._downPoints,(a,n)=>{i[t]=n;let r=this._movePoints[a];r&&(s[t]=r),t++}),i.length>1&&s.length>1){const a=e.width(),n=e.height();let r=i[0],o=i[1],l=s[0],d=s[1];if(r&&o&&l&&d){if(l=e.toLocal(l),d=e.toLocal(d),r=e.toLocal(r),o=e.toLocal(o),this.get("pinchZoomX")){const h=this._downStartX,c=this._downEndX;if(h!=null&&c!=null){r.x>o.x&&([r,o]=[o,r],[l,d]=[d,l]);let u=h+r.x/a*(c-h),g=h+o.x/a*(c-h),p=h+l.x/a*(c-h),m=h+d.x/a*(c-h),_=Math.max(.001,g-u)/Math.max(.001,m-p),x=h*_+u-p*_,b=c*_+g-m*_;this.xAxes.each(y=>{let P=y.fixPosition(x),T=y.fixPosition(b);y.zoom(P,T,0)})}}if(this.get("pinchZoomY")){const h=this._downStartY,c=this._downEndY;if(h!=null&&c!=null){r.y{let P=y.fixPosition(x),T=y.fixPosition(b);y.zoom(P,T,0)})}}}}}_handleCursorPosition(){const e=this.get("cursor");if(e){const t=e.getPrivate("point");let i=e.get("snapToSeries");if(e._downPoint&&(i=void 0),i&&t){const s=e.get("snapToSeriesBy"),a=[];w(i,o=>{if(!o.isHidden()&&!o.isHiding())if(s!="x!"&&s!="y!"){const l=o.startIndex(),d=o.endIndex();for(let h=l;h{const l=o.get("point");if(l){let d=0;d=s=="x"||s=="x!"?Math.abs(t.x-l.x):s=="y"||s=="y!"?Math.abs(t.y-l.y):Math.hypot(t.x-l.x,t.y-l.y),d{const l=o.get("tooltip");l&&l._setDataItem(void 0)}),n){let o=n.component;o.showDataItemTooltip(n);const l=n.get("point");l&&e.handleMove(o.toGlobal({x:l.x-o.x(),y:l.y-o.y()}),!0)}}}}_updateCursor(){let e=this.get("cursor");e&&e.handleMove()}_addCursor(e){this.plotContainer.children.push(e)}_prepareChildren(){if(super._prepareChildren(),this.series.each(e=>{this._colorize(e)}),(this.isDirty("wheelX")||this.isDirty("wheelY"))&&this._handleSetWheel(),this.isDirty("cursor")){const e=this._prevSettings.cursor,t=this.get("cursor");t!==e&&(this._disposeProperty("cursor"),e&&e.dispose(),t&&(t._setChart(this),this._addCursor(t),this._pushPropertyDisposer("cursor",t.events.on("selectended",()=>{this._handleCursorSelectEnd()}))),this._prevSettings.cursor=t)}if(this.isDirty("scrollbarX")){const e=this._prevSettings.scrollbarX,t=this.get("scrollbarX");t!==e&&(this._disposeProperty("scrollbarX"),e&&e.dispose(),t&&(t.parent||this.topAxesContainer.children.push(t),this._pushPropertyDisposer("scrollbarX",t.events.on("rangechanged",i=>{this._handleScrollbar(this.xAxes,i.start,i.end,i.grip)})),t.setPrivate("positionTextFunction",i=>{const s=this.xAxes.getIndex(0);return s&&s.getTooltipText(i)||""})),this._prevSettings.scrollbarX=t)}if(this.isDirty("scrollbarY")){const e=this._prevSettings.scrollbarY,t=this.get("scrollbarY");t!==e&&(this._disposeProperty("scrollbarY"),e&&e.dispose(),t&&(t.parent||this.rightAxesContainer.children.push(t),this._pushPropertyDisposer("scrollbarY",t.events.on("rangechanged",i=>{this._handleScrollbar(this.yAxes,i.start,i.end,i.grip)})),t.setPrivate("positionTextFunction",i=>{const s=this.yAxes.getIndex(0);return s&&s.getTooltipText(i)||""})),this._prevSettings.scrollbarY=t)}this._handleZoomOut()}_processSeries(e){super._processSeries(e),this._colorize(e)}_colorize(e){const t=this.get("colors");if(t&&e.get("fill")==null){const i=t.next();e._setSoft("stroke",i),e._setSoft("fill",i)}}_handleCursorSelectEnd(){const e=this.get("cursor"),t=e.get("behavior"),i=e.getPrivate("downPositionX",0),s=e.getPrivate("downPositionY",0),a=e.getPrivate("positionX",.5),n=e.getPrivate("positionY",.5);this.xAxes.each(r=>{if(t==="zoomX"||t==="zoomXY"){let o=r.toAxisPosition(i),l=r.toAxisPosition(a);r.zoom(o,l)}r.setPrivate("updateScrollbar",!0)}),this.yAxes.each(r=>{if(t==="zoomY"||t==="zoomXY"){let o=r.toAxisPosition(s),l=r.toAxisPosition(n);r.zoom(o,l)}r.setPrivate("updateScrollbar",!0)})}_handleScrollbar(e,t,i,s){e.each(a=>{let n=a.fixPosition(t),r=a.fixPosition(i),o=a.zoom(n,r,void 0,s);const l="updateScrollbar";a.setPrivateRaw(l,!1),o?o.events.on("stopped",()=>{a.setPrivateRaw(l,!0)}):a.setPrivateRaw(l,!0)})}_processAxis(e,t){return e.events.onAll(i=>{if(i.type==="clear")w(i.oldValues,s=>{this._removeAxis(s)});else if(i.type==="push")t.children.push(i.newValue),i.newValue.processChart(this);else if(i.type==="setIndex")t.children.setIndex(i.index,i.newValue),i.newValue.processChart(this);else if(i.type==="insertIndex")t.children.insertIndex(i.index,i.newValue),i.newValue.processChart(this);else if(i.type==="removeIndex")this._removeAxis(i.oldValue);else{if(i.type!=="moveIndex")throw new Error("Unknown IListEvent type");t.children.moveValue(i.value,i.newIndex),i.value.processChart(this)}})}_removeAxis(e){if(!e.isDisposed()){const t=e.parent;t&&t.children.removeValue(e);const i=e.gridContainer,s=i.parent;s&&s.children.removeValue(i);const a=e.topGridContainer,n=a.parent;n&&n.children.removeValue(a)}}_updateChartLayout(){const e=this.leftAxesContainer.width(),t=this.rightAxesContainer.width(),i=this.bottomAxesContainer;i.set("paddingLeft",e),i.set("paddingRight",t);const s=this.topAxesContainer;s.set("paddingLeft",e),s.set("paddingRight",t)}processAxis(e){}_handleAxisSelection(e,t){let i=e.fixPosition(e.get("start",0)),s=e.fixPosition(e.get("end",1));if(i>s&&([i,s]=[s,i]),this.xAxes.indexOf(e)!=-1){if(t||e.getPrivate("updateScrollbar")){let a=this.get("scrollbarX");!a||a.getPrivate("isBusy")&&!t||(a.setRaw("start",i),a.setRaw("end",s),a.updateGrips())}}else if(this.yAxes.indexOf(e)!=-1&&(t||e.getPrivate("updateScrollbar"))){let a=this.get("scrollbarY");!a||a.getPrivate("isBusy")&&!t||(a.setRaw("start",i),a.setRaw("end",s),a.updateGrips())}this._handleZoomOut()}_handleZoomOut(){let e=this.zoomOutButton;if(e&&e.parent){let t=!1;this.xAxes.each(i=>{i.get("start")==0&&i.get("end")==1||(t=!0)}),this.yAxes.each(i=>{i.get("start")==0&&i.get("end")==1||(t=!0)}),t?e.isHidden()&&e.show():e.hide()}}inPlot(e){const t=this.plotContainer,i=this.getPrivate("otherCharts",this._otherCharts),s=t.toGlobal(e);if(e.x>=-.5&&e.y>=-.5&&e.x<=t.width()+.5&&e.y<=t.height()+.5)return!0;if(i)for(let a=i.length-1;a>=0;a--){const n=i[a];if(n!=this){const r=n.plotContainer,o=this._root.rootPointToDocument(s),l=n._root.documentPointToRoot(o),d=r.toLocal(l);if(d.x>=-.1&&d.y>=-.1&&d.x<=r.width()+.1&&d.y<=r.height()+.1)return!0}}return!1}arrangeTooltips(){const e=this.plotContainer,t=e.width(),i=e.height(),s=this.height();let a=e._display.toGlobal({x:0,y:0}),n=e._display.toGlobal({x:t,y:i});const r=[];let o,l,d=0,h=1/0,c=this._movePoint,u=this.get("maxTooltipDistance"),g=this.get("maxTooltipDistanceBy","xy");f(u)&&this.series.each(m=>{if(!m.isHidden()){const _=m.get("tooltip");if(_){let x=_.get("pointTo");if(x){let b=Math.hypot(c.x-x.x,c.y-x.y);g=="x"?b=Math.abs(c.x-x.x):g=="y"&&(b=Math.abs(c.y-x.y)),b{const _=m.get("tooltip");if(_){let x=!1,b=_.get("pointTo");if(b){if(u>=0){let y=_.get("pointTo");if(y&&m!=o){let P=Math.hypot(l.x-y.x,l.y-y.y);g=="x"?P=Math.abs(l.x-y.x):g=="y"&&(P=Math.abs(l.y-y.y)),P>u&&(x=!0)}}else u==-1&&m!=o&&(x=!0);this.inPlot(this._tooltipToLocal(b))&&_.dataItem?x||(d+=b.y):x=!0,x||m.isHidden()||m.isHiding()?_.hide(0):(_.show(),r.push(_),p.push(m))}}}),this.setPrivate("tooltipSeries",p),this.get("arrangeTooltips")){const m=this._root.tooltipContainer,_=r.length;if(d/_>i/2+a.y){r.sort((b,y)=>Ce(y.get("pointTo").y,b.get("pointTo").y));let x=n.y;if(w(r,b=>{let y=b.height(),P=b.get("centerY");P instanceof te&&(y*=P.value),y+=b.get("marginBottom",0),b.set("bounds",{left:a.x,top:a.y,right:n.x,bottom:x}),b.setPrivate("customData",{left:a.x,top:a.y,right:n.x,bottom:x}),x=Math.min(x-y,b._fy-y),b.parent==m&&m.children.moveValue(b,0)}),x<0){r.reverse();let b=x;w(r,y=>{let P=y.get("bounds");if(P){let T=P.top-x,F=P.bottom-x;TCe(b.get("pointTo").y,y.get("pointTo").y));let x=0;if(w(r,b=>{let y=b.height(),P=b.get("centerY");P instanceof te&&(y*=P.value),y+=b.get("marginBottom",0),b.set("bounds",{left:a.x,top:x,right:n.x,bottom:Math.max(a.y+s,x+y)}),b.parent==m&&m.children.moveValue(b,0),x=Math.max(x+y,b._fy+y)}),x>s){r.reverse();let b=s;w(r,y=>{let P=y.get("bounds");if(P){let T=P.top-(s-x),F=P.bottom-(s-x);F>b&&(F=b,T=F-y.height()),y.set("bounds",{left:P.left,top:T,right:P.right,bottom:F}),b=F-y.height()-y.get("marginBottom",0)}})}}}}_tooltipToLocal(e){return this.plotContainer.toLocal(e)}zoomOut(){this.xAxes.each(e=>{e.setPrivate("updateScrollbar",!0),e.zoom(0,1)}),this.yAxes.each(e=>{e.setPrivate("updateScrollbar",!0),e.zoom(0,1)})}}Object.defineProperty(xe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"XYChart"}),Object.defineProperty(xe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ge.classNames.concat([xe.className])});class se extends V{_beforeChanged(){super._beforeChanged(),(this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}}Object.defineProperty(se,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Grid"}),Object.defineProperty(se,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:V.classNames.concat([se.className])});class be extends Y{constructor(){super(...arguments),Object.defineProperty(this,"lineX",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(se.new(this._root,{themeTags:["x"]}))}),Object.defineProperty(this,"lineY",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(se.new(this._root,{themeTags:["y"]}))}),Object.defineProperty(this,"selection",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(V.new(this._root,{themeTags:["selection","cursor"],layer:30}))}),Object.defineProperty(this,"_movePoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_lastPoint",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,"_tooltipX",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_tooltipY",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_toX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_toY",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this._settings.themeTags=X(this._settings.themeTags,["xy","cursor"]),super._afterNew(),this.setAll({width:A,height:A,isMeasured:!0,position:"absolute"}),this.states.create("hidden",{visible:!0,opacity:0}),this._drawLines(),this.setPrivateRaw("visible",!1),this._disposers.push(this.setTimeout(()=>{this.setPrivate("visible",!0)},500)),this._disposers.push(this.lineX.events.on("positionchanged",()=>{this._handleXLine()})),this._disposers.push(this.lineY.events.on("positionchanged",()=>{this._handleYLine()})),this._disposers.push(this.lineX.events.on("focus",e=>this._handleLineFocus(e.target))),this._disposers.push(this.lineX.events.on("blur",e=>this._handleLineBlur(e.target))),this._disposers.push(this.lineY.events.on("focus",e=>this._handleLineFocus(e.target))),this._disposers.push(this.lineY.events.on("blur",e=>this._handleLineBlur(e.target))),Ie("keyboardevents")&&this._disposers.push(et(document,"keydown",e=>{this._handleLineMove(e.keyCode)}))}_setUpTouch(){const e=this.chart;e&&(e.plotContainer._display.cancelTouch=this.get("behavior")!="none")}_handleXLine(){let e=this.lineX.x(),t=!0;(e<0||e>this.width())&&(t=!1),this.lineX.setPrivate("visible",t)}_handleYLine(){let e=this.lineY.y(),t=!0;(e<0||e>this.height())&&(t=!1),this.lineY.setPrivate("visible",t)}_handleLineMove(e){let t="",i=0,s=.1;const a=this.chart;this._root.focused(this.lineX)?(a&&a.xAxes.length&&(s=a.xAxes.getIndex(0).getCellWidthPosition()),i=this.getPrivate("positionX",0),t="positionX",e==37?i-=s:e==39&&(i+=s)):this._root.focused(this.lineY)&&(a&&a.yAxes.length&&(s=a.yAxes.getIndex(0).getCellWidthPosition()),i=this.getPrivate("positionY",0),t="positionY",e==38?i-=s:e==40&&(i+=s)),i<0?i=0:i>1&&(i=1),t!=""&&this.set(t,i)}_handleLineFocus(e){this.setAll({positionX:this.getPrivate("positionX"),positionY:this.getPrivate("positionY"),alwaysShow:!0})}_handleLineBlur(e){this.setAll({positionX:void 0,positionY:void 0,alwaysShow:!1})}_prepareChildren(){if(super._prepareChildren(),this.isDirty("xAxis")){this._tooltipX=!1;const e=this.get("xAxis");if(e){const t=e.get("tooltip");t&&(this._tooltipX=!0,this._disposers.push(t.on("pointTo",()=>{this._updateXLine(t)})))}}if(this.isDirty("yAxis")){this._tooltipY=!1;const e=this.get("yAxis");if(e){const t=e.get("tooltip");t&&(this._tooltipY=!0,this._disposers.push(t.on("pointTo",()=>{this._updateYLine(t)})))}}}_handleSyncWith(){const e=this.chart;if(e){const t=this.get("syncWith"),i=[];t&&w(t,s=>{const a=s.chart;a&&i.push(a)}),e._otherCharts=i}}_updateChildren(){if(super._updateChildren(),this._handleSyncWith(),this.isDirty("positionX")||this.isDirty("positionY")){const e=this.get("positionX"),t=this.get("positionY");e==null&&t==null?this.hide(0):(this._movePoint=this.toGlobal(this._getPoint(this.get("positionX",0),this.get("positionY",0))),this.handleMove())}}_updateXLine(e){let t=j(this._display.toLocal(e.get("pointTo",{x:0,y:0})).x,2);this._toX!=t&&(this.lineX.animate({key:"x",to:t,duration:e.get("animationDuration",0),easing:e.get("animationEasing")}),this._toX=t)}_updateYLine(e){let t=j(this._display.toLocal(e.get("pointTo",{x:0,y:0})).y,2);this._toY!=t&&(this.lineY.animate({key:"y",to:t,duration:e.get("animationDuration",0),easing:e.get("animationEasing")}),this._toY=t)}_drawLines(){this.lineX.set("draw",e=>{e.moveTo(0,0),e.lineTo(0,this.height())}),this.lineY.set("draw",e=>{e.moveTo(0,0),e.lineTo(this.width(),0)})}_setChart(e){this.chart=e,this._handleSyncWith();const t=e.plotContainer;this.events.on("boundschanged",()=>{this._disposers.push(this.setTimeout(()=>{this.get("alwaysShow")&&(this._movePoint=this.toGlobal(this._getPoint(this.get("positionX",0),this.get("positionY",0))),this.handleMove())},50))}),Ie("touchevents")&&(this._disposers.push(t.events.on("click",s=>{tt(s.originalEvent)&&this._handleMove(s.originalEvent)})),this._setUpTouch()),this._disposers.push(t.events.on("pointerdown",s=>{this._handleCursorDown(s.originalEvent)})),this._disposers.push(t.events.on("globalpointerup",s=>{this._handleCursorUp(s.originalEvent),s.native||this.isHidden()||this._handleMove(s.originalEvent)})),this._disposers.push(t.events.on("globalpointermove",s=>{(this.get("syncWith")||ue(t._downPoints).length!=0||s.native||!this.isHidden())&&this._handleMove(s.originalEvent)}));const i=this.parent;i&&i.children.moveValue(this.selection)}_inPlot(e){const t=this.chart;return!!t&&t.inPlot(e)}_handleCursorDown(e){if(e.button==2)return;const t=this._root.documentPointToRoot({x:e.clientX,y:e.clientY});let i=this._display.toLocal(t);const s=this.chart;if(this.selection.set("draw",()=>{}),s&&this._inPlot(i)){if(this._downPoint=i,this.get("behavior")!="none"){this.selection.show();const r="selectstarted";this.events.isEnabled(r)&&this.events.dispatch(r,{type:r,target:this})}let a=this._getPosition(i).x,n=this._getPosition(i).y;this.setPrivate("downPositionX",a),this.setPrivate("downPositionY",n)}}_handleCursorUp(e){if(this._downPoint){const t=this.get("behavior","none");if(t!="none"){t.charAt(0)==="z"&&this.selection.hide();const i=this._root.documentPointToRoot({x:e.clientX,y:e.clientY});let s=this._display.toLocal(i);const a=this._downPoint,n=this.get("moveThreshold",1);if(s&&a){let r=!1;if(t!=="zoomX"&&t!=="zoomXY"&&t!=="selectX"&&t!=="selectXY"||Math.abs(s.x-a.x)>n&&(r=!0),t!=="zoomY"&&t!=="zoomXY"&&t!=="selectY"&&t!=="selectXY"||Math.abs(s.y-a.y)>n&&(r=!0),r){const o="selectended";this.events.isEnabled(o)&&this.events.dispatch(o,{type:o,target:this})}}}}this._downPoint=void 0}_handleMove(e){if(this.getPrivate("visible")){const t=this.chart;if(t&&ue(t.plotContainer._downPoints).length>1)return void this.set("forceHidden",!0);this.set("forceHidden",!1);const i=this._root.documentPointToRoot({x:e.clientX,y:e.clientY}),s=this._lastPoint;if(Math.round(s.x)===Math.round(i.x)&&Math.round(s.y)===Math.round(i.y))return;this._lastPoint=i,this.setPrivate("lastPoint",i),this.handleMove({x:i.x,y:i.y})}}_getPosition(e){return{x:e.x/this.width(),y:e.y/this.height()}}handleMove(e,t){e||(e=this._movePoint);const i=this.get("alwaysShow");if(!e)return void this.hide(0);this._movePoint=e;let s=this._display.toLocal(e),a=this.chart;if(a&&this._inPlot(s)){a._movePoint=e,this.isHidden()&&(this.show(),this.get("behavior","").charAt(0)=="z"&&this.selection.set("draw",()=>{}));let n=s.x,r=s.y,o=this._getPosition(s);this.setPrivate("point",s);let l=this.get("snapToSeries");this._downPoint&&(l=void 0);let d=this.get("positionX"),h=o.x;f(d)&&(h=d);let c=this.get("positionY"),u=o.y;f(c)&&(u=c),this.setPrivate("positionX",h),this.setPrivate("positionY",u);const g=this._getPoint(h,u);if(n=g.x,r=g.y,a.xAxes.each(p=>{p._handleCursorPosition(h,l),i&&p.handleCursorShow()}),a.yAxes.each(p=>{p._handleCursorPosition(u,l),i&&p.handleCursorShow()}),!t){a._handleCursorPosition();const p="cursormoved";this.events.isEnabled(p)&&this.events.dispatch(p,{type:p,target:this})}this._updateLines(n,r),a.arrangeTooltips()}else if(!this._downPoint&&!i){this.hide(0);const n="cursorhidden";this.events.isEnabled(n)&&this.events.dispatch(n,{type:n,target:this})}this._downPoint&&this.get("behavior")!="none"&&this._updateSelection(s)}_getPoint(e,t){return{x:this.width()*e,y:this.height()*t}}_updateLines(e,t){this._tooltipX||this.lineX.set("x",e),this._tooltipY||this.lineY.set("y",t),this._drawLines()}_updateSelection(e){const t=this.selection,i=this.get("behavior"),s=this.width(),a=this.height();e.x<0&&(e.x=0),e.x>s&&(e.x=s),e.y<0&&(e.y=0),e.y>a&&(e.y=a),t.set("draw",n=>{const r=this._downPoint;r&&(i==="zoomXY"||i==="selectXY"?(n.moveTo(r.x,r.y),n.lineTo(r.x,e.y),n.lineTo(e.x,e.y),n.lineTo(e.x,r.y),n.lineTo(r.x,r.y)):i==="zoomX"||i==="selectX"?(n.moveTo(r.x,0),n.lineTo(r.x,a),n.lineTo(e.x,a),n.lineTo(e.x,0),n.lineTo(r.x,0)):i!=="zoomY"&&i!=="selectY"||(n.moveTo(0,r.y),n.lineTo(s,r.y),n.lineTo(s,e.y),n.lineTo(0,e.y),n.lineTo(0,r.y)))})}_onHide(){if(this.isHidden()){let e=this.chart;e&&(e.xAxes.each(t=>{t.handleCursorHide()}),e.yAxes.each(t=>{t.handleCursorHide()}),e.series.each(t=>{t.handleCursorHide()}))}super._onHide()}_onShow(){if(!this.isHidden()){let e=this.chart;e&&(e.xAxes.each(t=>{t.handleCursorShow()}),e.yAxes.each(t=>{t.handleCursorShow()}))}super._onShow()}_dispose(){super._dispose(),this.selection.dispose()}}function gt(v,e){return v==null?e:e==null?v:ev?e:v}Object.defineProperty(be,"className",{enumerable:!0,configurable:!0,writable:!0,value:"XYCursor"}),Object.defineProperty(be,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Y.classNames.concat([be.className])});class B extends Ee{constructor(){super(...arguments),Object.defineProperty(this,"_xField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xOpenField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yOpenField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xLowField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xHighField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yLowField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yHighField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_axesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_stackDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataSets",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_mainContainerMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"mainContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(Y.new(this._root,{}))}),Object.defineProperty(this,"axisRanges",{enumerable:!0,configurable:!0,writable:!0,value:new Ve}),Object.defineProperty(this,"_skipped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_couldStackTo",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_reallyStackedTo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_stackedSeries",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_aLocationX0",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_aLocationX1",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_aLocationY0",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_aLocationY1",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_showBullets",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"valueXFields",{enumerable:!0,configurable:!0,writable:!0,value:["valueX","openValueX","lowValueX","highValueX"]}),Object.defineProperty(this,"valueYFields",{enumerable:!0,configurable:!0,writable:!0,value:["valueY","openValueY","lowValueY","highValueY"]}),Object.defineProperty(this,"_valueXFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueYFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueXShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueYShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"__valueXShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"__valueYShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_emptyDataItem",{enumerable:!0,configurable:!0,writable:!0,value:new pe(this,void 0,{})}),Object.defineProperty(this,"_dataSetId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipFieldX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipFieldY",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this.fields.push("categoryX","categoryY","openCategoryX","openCategoryY"),this.valueFields.push("valueX","valueY","openValueX","openValueY","lowValueX","lowValueY","highValueX","highValueY"),this._setRawDefault("vcx",1),this._setRawDefault("vcy",1),this._setRawDefault("valueXShow","valueXWorking"),this._setRawDefault("valueYShow","valueYWorking"),this._setRawDefault("openValueXShow","openValueXWorking"),this._setRawDefault("openValueYShow","openValueYWorking"),this._setRawDefault("lowValueXShow","lowValueXWorking"),this._setRawDefault("lowValueYShow","lowValueYWorking"),this._setRawDefault("highValueXShow","highValueXWorking"),this._setRawDefault("highValueYShow","highValueYWorking"),this._setRawDefault("lowValueXGrouped","low"),this._setRawDefault("lowValueYGrouped","low"),this._setRawDefault("highValueXGrouped","high"),this._setRawDefault("highValueYGrouped","high"),super._afterNew(),this._settings.xAxis.series.push(this),this._settings.yAxis.series.push(this),this.set("maskContent",!0),this._disposers.push(this.axisRanges.events.onAll(i=>{if(i.type==="clear")w(i.oldValues,s=>{this._removeAxisRange(s)});else if(i.type==="push")this._processAxisRange(i.newValue);else if(i.type==="setIndex")this._processAxisRange(i.newValue);else if(i.type==="insertIndex")this._processAxisRange(i.newValue);else if(i.type==="removeIndex")this._removeAxisRange(i.oldValue);else{if(i.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");this._processAxisRange(i.value)}}));const e=this.get("xAxis"),t=this.get("yAxis");this._disposers.push(e.events.on("positionchanged",()=>{this._fixPosition()})),this._disposers.push(t.events.on("positionchanged",()=>{this._fixPosition()})),this.get("baseAxis")||(t.isType("CategoryAxis")||t.isType("DateAxis")?this.set("baseAxis",t):this.set("baseAxis",e)),this.states.create("hidden",{opacity:1,visible:!1}),this._makeFieldNames()}_processAxisRange(e){const t=Y.new(this._root,{});e.container=t,this.children.push(t),e.series=this;const i=e.axisDataItem;i.setRaw("isRange",!0);const s=i.component;if(s){s._processAxisRange(i,["range","series"]);const a=i.get("bullet");if(a){const r=a.get("sprite");r&&r.setPrivate("visible",!1)}const n=i.get("axisFill");n&&t.set("mask",n),s._seriesAxisRanges.push(i)}}_removeAxisRange(e){const t=e.axisDataItem,i=t.component;i.disposeDataItem(t),he(i._seriesAxisRanges,t);const s=e.container;s&&s.dispose()}_updateFields(){super._updateFields(),this._valueXFields=[],this._valueYFields=[],this._valueXShowFields=[],this._valueYShowFields=[],this.__valueXShowFields=[],this.__valueYShowFields=[],this.valueXFields&&w(this.valueXFields,e=>{if(this.get(e+"Field")){this._valueXFields.push(e);let t=this.get(e+"Show");this.__valueXShowFields.push(t),t.indexOf("Working")!=-1?this._valueXShowFields.push(t.split("Working")[0]):this._valueXShowFields.push(t)}}),this.valueYFields&&w(this.valueYFields,e=>{if(this.get(e+"Field")){this._valueYFields.push(e);let t=this.get(e+"Show");this.__valueYShowFields.push(t),t.indexOf("Working")!=-1?this._valueYShowFields.push(t.split("Working")[0]):this._valueYShowFields.push(t)}})}_dispose(){super._dispose();const e=this.chart;e&&e.series.removeValue(this),Oe(this.get("xAxis").series,this),Oe(this.get("yAxis").series,this)}_min(e,t){let i=gt(this.getPrivate(e),t);this.setPrivate(e,i)}_max(e,t){let i=pt(this.getPrivate(e),t);this.setPrivate(e,i)}_shouldMakeBullet(e){const t=this.get("xAxis"),i=this.get("yAxis"),s=this.get("baseAxis");if(!t.inited||!i.inited)return!1;const a=this.get("minBulletDistance",0);if(a>0){let n=this.startIndex(),r=this.endIndex()-n;if(t==s){if(t.get("renderer").axisLength()/r{w(this._valueXShowFields,o=>{let l=r.get(o);l!=null&&(n&&(l+=this.getStackedXValue(r,o)),this._min("minX",l),this._max("maxX",l))}),w(this._valueYShowFields,o=>{let l=r.get(o);l!=null&&(n&&(l+=this.getStackedYValue(r,o)),this._min("minY",l),this._max("maxY",l))}),e.processSeriesDataItem(r,this._valueXFields),t.processSeriesDataItem(r,this._valueYFields)}),e._seriesValuesDirty=!0,t._seriesValuesDirty=!0,this.get("ignoreMinMax")||((this.isPrivateDirty("minX")||this.isPrivateDirty("maxX"))&&e.markDirtyExtremes(),(this.isPrivateDirty("minY")||this.isPrivateDirty("maxY"))&&t.markDirtyExtremes()),this._markStakedDirtyStack(),this.get("tooltipDataItem")||this.updateLegendValue(void 0)),(this.isDirty("vcx")||this.isDirty("vcy"))&&this._markStakedDirtyStack(),this._dataGrouped||(e._groupSeriesData(this),t._groupSeriesData(this),this._dataGrouped=!0),this._valuesDirty||this.isPrivateDirty("startIndex")||this.isPrivateDirty("endIndex")||this.isDirty("vcx")||this.isDirty("vcy")||this._stackDirty){let r=this.startIndex(),o=this.endIndex(),l=this.get("minBulletDistance",0);if(l>0&&i&&(i.get("renderer").axisLength()/(o-r)>l?this._showBullets=!0:this._showBullets=!1),(this._psi!=r||this._pei!=o||this.isDirty("vcx")||this.isDirty("vcy")||this._stackDirty||this._valuesDirty)&&!this._selectionProcessed){this._selectionProcessed=!0;const d=this.get("vcx",1),h=this.get("vcy",1),c=this.get("stacked",!1),u=this.getPrivate("outOfSelection");if(i===e)if(t._calculateTotals(),this.setPrivateRaw("selectionMinY",void 0),this.setPrivateRaw("selectionMaxY",void 0),u)t.markDirtySelectionExtremes();else for(let g=r;g0){let e=this._mainContainerMask;e==null&&(e=this.children.push(V.new(this._root,{})),this._mainContainerMask=e,e.set("draw",(t,i)=>{const s=this.parent;if(s){const a=this._root.container.width(),n=this._root.container.height();t.moveTo(-a,-n),t.lineTo(-a,2*n),t.lineTo(2*a,2*n),t.lineTo(2*a,-n),t.lineTo(-a,-n),this.axisRanges.each(r=>{const o=r.axisDataItem.get("axisFill");if(s&&o){let l=o.get("draw");l&&l(t,i)}})}this.mainContainer._display.mask=e._display})),e.markDirty(),e._markDirtyKey("fill")}else this.mainContainer._display.mask=null}_updateChildren(){super._updateChildren(),this._x=this.x(),this._y=this.y(),this._makeRangeMask()}_stack(){const e=this.chart;if(e){const t=e.series.indexOf(this);if(this._couldStackTo=[],t>0){let i;for(let s=t-1;s>=0&&(i=e.series.getIndex(s),i.get("xAxis")!==this.get("xAxis")||i.get("yAxis")!==this.get("yAxis")||i.className!==this.className||(this._couldStackTo.push(i),i.get("stacked")));s--);}this._stackDataItems()}}_unstack(){Ae(this._reallyStackedTo,(e,t)=>{delete t._stackedSeries[this.uid]}),this._reallyStackedTo={},w(this.dataItems,e=>{e.setRaw("stackToItemY",void 0),e.setRaw("stackToItemX",void 0)})}_stackDataItems(){const e=this.get("baseAxis"),t=this.get("xAxis"),i=this.get("yAxis");let s,a;e===t?(s="valueY",a="stackToItemY"):e===i&&(s="valueX",a="stackToItemX");let n=this._couldStackTo.length,r=0;const o=this.get("stackToNegative");this._reallyStackedTo={},w(this.dataItems,l=>{for(let d=0;d=0&&g>=0){l.setRaw(a,c),this._reallyStackedTo[h.uid]=h,h._stackedSeries[this.uid]=this;break}if(u<0&&g<0){l.setRaw(a,c),this._reallyStackedTo[h.uid]=h,h._stackedSeries[this.uid]=this;break}}}else if(f(u)&&f(g)){l.setRaw(a,c),this._reallyStackedTo[h.uid]=h,h._stackedSeries[this.uid]=this;break}}}r++})}processXSelectionDataItem(e,t,i){w(this.__valueXShowFields,s=>{let a=e.get(s);a!=null&&(i&&(a+=this.getStackedXValueWorking(e,s)),this._min("selectionMinX",a),this._max("selectionMaxX",a*t))})}processYSelectionDataItem(e,t,i){w(this.__valueYShowFields,s=>{let a=e.get(s);a!=null&&(i&&(a+=this.getStackedYValueWorking(e,s)),this._min("selectionMinY",a),this._max("selectionMaxY",a*t))})}getStackedYValueWorking(e,t){const i=e.get("stackToItemY");if(i){const s=i.component;return i.get(t,0)*s.get("vcy",1)+this.getStackedYValueWorking(i,t)}return 0}getStackedXValueWorking(e,t){const i=e.get("stackToItemX");if(i){const s=i.component;return i.get(t,0)*s.get("vcx",1)+this.getStackedXValueWorking(i,t)}return 0}getStackedYValue(e,t){const i=e.get("stackToItemY");return i?i.get(t,0)+this.getStackedYValue(i,t):0}getStackedXValue(e,t){const i=e.get("stackToItemX");return i?i.get(t,0)+this.getStackedXValue(i,t):0}createLegendMarker(e){this.updateLegendMarker()}_markDirtyAxes(){this._axesDirty=!0,this.markDirty()}_markDataSetDirty(){this._afterDataChange(),this._valuesDirty=!0,this._dataProcessed=!1,this._aggregatesCalculated=!1,this.markDirty()}_clearDirty(){super._clearDirty(),this._axesDirty=!1,this._selectionProcessed=!1,this._stackDirty=!1,this._dataProcessed=!1}_positionBullet(e){let t=e.get("sprite");if(t){let i=t.dataItem,s=e.get("locationX",i.get("locationX",.5)),a=e.get("locationY",i.get("locationY",.5)),n=this.get("xAxis"),r=this.get("yAxis");const o=n.getDataItemPositionX(i,this._xField,s,this.get("vcx",1)),l=r.getDataItemPositionY(i,this._yField,a,this.get("vcy",1));let d=this.getPoint(o,l),h=i.get("left",d.x),c=i.get("right",d.x),u=i.get("top",d.y),g=i.get("bottom",d.y);if(this._shouldShowBullet(o,l)){e.getPrivate("hidden")?t.setPrivate("visible",!1):t.setPrivate("visible",!0);let p=c-h,m=g-u;t.isType("Label")&&(t.setPrivate("maxWidth",Math.abs(p)),t.setPrivate("maxHeight",Math.abs(m)));let _=h+p*s,x=g-m*a;t.set("x",_),t.set("y",x)}else t.setPrivate("visible",!1)}}_shouldShowBullet(e,t){return this._showBullets}setDataSet(e){if(this._dataSets[e]){this._handleDataSetChange(),this._dataItems=this._dataSets[e],this._markDataSetDirty(),this._dataSetId=e;const t="datasetchanged";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,id:e})}}_handleDataSetChange(){this.bullets.length>0&&w(this._dataItems,e=>{let t=e.bullets;t&&w(t,i=>{if(i){let s=i.get("sprite");s&&s.setPrivate("visible",!1)}})}),this._selectionProcessed=!1}show(e){const t=Object.create(null,{show:{get:()=>super.show}});return ie(this,void 0,void 0,function*(){this._fixVC();let i=[];i.push(t.show.call(this,e).then(()=>{this._isShowing=!1;let s=this.get("xAxis"),a=this.get("yAxis"),n=this.get("baseAxis");a!==n&&a.markDirtySelectionExtremes(),s!==n&&s.markDirtySelectionExtremes()})),i.push(this.bulletsContainer.show(e)),i.push(this._sequencedShowHide(!0,e)),yield Promise.all(i)})}hide(e){const t=Object.create(null,{hide:{get:()=>super.hide}});return ie(this,void 0,void 0,function*(){this._fixVC();let i=[];i.push(t.hide.call(this,e).then(()=>{this._isHiding=!1})),i.push(this.bulletsContainer.hide(e)),i.push(this._sequencedShowHide(!1,e)),yield Promise.all(i)})}showDataItem(e,t){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return ie(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,e,t)];f(t)||(t=this.get("stateAnimationDuration",0));const a=this.get("stateAnimationEasing");w(this._valueFields,n=>{s.push(e.animate({key:n+"Working",to:e.get(n),duration:t,easing:a}).waitForStop())}),yield Promise.all(s)})}hideDataItem(e,t){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return ie(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,e,t)],a=this.states.create("hidden",{});f(t)||(t=a.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));const n=a.get("stateAnimationEasing",this.get("stateAnimationEasing")),r=this.get("xAxis"),o=this.get("yAxis"),l=this.get("baseAxis"),d=this.get("stacked");if(l!==r&&l||w(this._valueYFields,h=>{let c=o.getPrivate("min"),u=o.baseValue();f(c)&&c>u&&(u=c),d&&(u=0),e.get(h)!=null&&s.push(e.animate({key:h+"Working",to:u,duration:t,easing:n}).waitForStop())}),l===o||!l){let h=r.getPrivate("min"),c=r.baseValue();f(h)&&h>c&&(c=h),d&&(c=0),w(this._valueXFields,u=>{e.get(u)!=null&&s.push(e.animate({key:u+"Working",to:c,duration:t,easing:n}).waitForStop())})}yield Promise.all(s)})}_markDirtyStack(){this._stackDirty=!0,this.markDirty(),this._markStakedDirtyStack()}_markStakedDirtyStack(){const e=this._stackedSeries;e&&Ae(e,(t,i)=>{i._stackDirty||i._markDirtyStack()})}_afterChanged(){super._afterChanged(),this._skipped&&(this._markDirtyAxes(),this._skipped=!1)}showDataItemTooltip(e){this.updateLegendMarker(e),this.updateLegendValue(e);const t=this.get("tooltip");if(t){if(this.isHidden())this.hideTooltip();else if(t._setDataItem(e),e){let i=this.get("locationX",0),s=this.get("locationY",1),a=e.get("locationX",i),n=e.get("locationY",s);const r=this.get("xAxis"),o=this.get("yAxis"),l=this.get("vcx",1),d=this.get("vcy",1),h=r.getDataItemPositionX(e,this._tooltipFieldX,this._aLocationX0+(this._aLocationX1-this._aLocationX0)*a,l),c=o.getDataItemPositionY(e,this._tooltipFieldY,this._aLocationY0+(this._aLocationY1-this._aLocationY0)*n,d),u=this.getPoint(h,c);let g=!0;if(w(this._valueFields,p=>{e.get(p)==null&&(g=!1)}),g){const p=this.chart;p&&p.inPlot(u)?(t.label.text.markDirtyText(),t.set("tooltipTarget",this._getTooltipTarget(e)),t.set("pointTo",this._display.toGlobal({x:u.x,y:u.y}))):t._setDataItem(void 0)}else t._setDataItem(void 0)}}}hideTooltip(){const e=this.get("tooltip");return e&&e.set("tooltipTarget",this),super.hideTooltip()}_getTooltipTarget(e){if(this.get("seriesTooltipTarget")=="bullet"){const t=e.bullets;if(t&&t.length>0){const i=t[0].get("sprite");if(i)return i}}return this}updateLegendValue(e){const t=this.get("legendDataItem");if(t){const i=t.get("label");if(i){let a="";e?(i._setDataItem(e),a=this.get("legendLabelText",i.get("text",this.get("name","")))):(i._setDataItem(this._emptyDataItem),a=this.get("legendRangeLabelText",this.get("legendLabelText",i.get("text",this.get("name",""))))),i.set("text",a)}const s=t.get("valueLabel");if(s){let a="";e?(s._setDataItem(e),a=this.get("legendValueText",s.get("text",""))):(s._setDataItem(this._emptyDataItem),a=this.get("legendRangeValueText",s.get("text",""))),s.set("text",a)}}}_getItemReaderLabel(){let e="X: {"+this._xField;return this.get("xAxis").isType("DateAxis")&&(e+=".formatDate()"),e+="}; Y: {"+this._yField,this.get("yAxis").isType("DateAxis")&&(e+=".formatDate()"),e+="}",e}getPoint(e,t){let i=this.get("xAxis").get("renderer").positionToCoordinate(e),s=this.get("yAxis").get("renderer").positionToCoordinate(t),a=999999999;return s<-a&&(s=-a),s>a&&(s=a),i<-a&&(i=-a),i>a&&(i=a),{x:i,y:s}}_shouldInclude(e){return!0}handleCursorHide(){this.hideTooltip(),this.updateLegendValue(void 0),this.updateLegendMarker(void 0)}_afterDataChange(){super._afterDataChange(),this.get("xAxis")._markDirtyKey("start"),this.get("yAxis")._markDirtyKey("start"),this.resetExtremes()}resetExtremes(){this.setPrivate("selectionMinX",void 0),this.setPrivate("selectionMaxX",void 0),this.setPrivate("selectionMinY",void 0),this.setPrivate("selectionMaxY",void 0),this.setPrivate("minX",void 0),this.setPrivate("minY",void 0),this.setPrivate("maxX",void 0),this.setPrivate("maxY",void 0)}createAxisRange(e){return this.axisRanges.push({axisDataItem:e})}get mainDataItems(){return this._mainDataItems}}Object.defineProperty(B,"className",{enumerable:!0,configurable:!0,writable:!0,value:"XYSeries"}),Object.defineProperty(B,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ee.classNames.concat([B.className])});class H extends B{constructor(){super(...arguments),Object.defineProperty(this,"_ph",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_pw",{enumerable:!0,configurable:!0,writable:!0,value:0})}_makeGraphics(e,t){return this.makeColumn(t,e)}_makeFieldNames(){super._makeFieldNames();const e=this.get("xAxis"),t=this.get("yAxis"),i="CategoryAxis",s="ValueAxis";e.isType(i)&&(this.get("openCategoryXField")||(this._xOpenField=this._xField)),e.isType(s)&&(this.get("openValueXField")||(this._xOpenField=this._xField)),t.isType(i)&&(this.get("openCategoryYField")||(this._yOpenField=this._yField)),t.isType(s)&&(this.get("openValueYField")||(this._yOpenField=this._yField))}_prepareChildren(){super._prepareChildren();const e=this.get("xAxis"),t=this.get("yAxis"),i=this.dataItems.length,s=Math.max(0,this.startIndex()-2),a=Math.min(this.endIndex()+2,i-1);if(e.inited&&t.inited)for(let n=s;n<=a;n++){let r=this.dataItems[n];this._createGraphics(r)}}_updateChildren(){const e=this.chart;e&&(this._ph=e.plotContainer.height(),this._pw=e.plotContainer.width());const t=this.get("xAxis"),i=this.get("yAxis"),s=this.get("baseAxis"),a=this.columns.template;this.isDirty("fill")&&a.get("fill")==null&&a.set("fill",this.get("fill")),this.isDirty("stroke")&&a.get("stroke")==null&&a.set("stroke",this.get("stroke"));let n=0,r=0,o=0;w(s.series,_=>{if(_ instanceof H){const x=_.get("stacked");x&&o==0&&r++,!x&&_.get("clustered")&&r++}_===this&&(n=r-1),o++}),this.get("clustered")||(n=0,r=1),r===0&&(r=1,n=0);const l=t.get("renderer"),d=i.get("renderer"),h="cellStartLocation",c="cellEndLocation",u=l.get(h,0),g=l.get(c,1),p=d.get(h,0),m=d.get(c,1);if(this._aLocationX0=u+n/r*(g-u),this._aLocationX1=u+(n+1)/r*(g-u),this._aLocationY0=p+n/r*(m-p),this._aLocationY1=p+(n+1)/r*(m-p),t.inited&&i.inited){if(this._axesDirty||this._valuesDirty||this._stackDirty||this.isDirty("vcx")||this.isDirty("vcy")||this._sizeDirty){const _=this.dataItems.length;let x=Math.max(0,this.startIndex()-2),b=Math.min(this.endIndex()+2,_-1);for(let P=0;P0&&x>0)for(let F=P-1;F>=0;F--){let I=this.dataItems[F];if(I.get("valueX")!=null&&I.get("valueY")!=null){y=I;break}}break}this._toggleColumn(T,!1)}for(let P=x;P<=b;P++){let T=this.dataItems[P];this._updateGraphics(T,y),T.get("valueX")!=null&&T.get("valueY")!=null&&(y=T)}for(let P=b+1;P<_;P++)this._toggleColumn(this.dataItems[P],!1)}}else this._skipped=!0;this.updateLegendMarker(this.get("tooltipDataItem")),super._updateChildren()}_createGraphics(e){let t=e.get("graphics");if(!t){t=this._makeGraphics(this.columns,e),e.set("graphics",t),t._setDataItem(e);const i=e.get("legendDataItem");if(i){const s=i.get("markerRectangle");s&&s.setAll({fill:t.get("fill"),stroke:t.get("stroke")})}this.axisRanges.each(s=>{const a=s.container,n=e.get("rangeGraphics",[]);e.set("rangeGraphics",n);const r=this._makeGraphics(s.columns,e);n.push(r),r.setPrivate("list",s.columns),a.children.push(r)})}}_updateGraphics(e,t){let i=e.get("graphics");const s=this._xField,a=this._yField,n=e.get(s),r=e.get(a);if(n!=null&&r!=null){const o=this._xOpenField,l=this._yOpenField,d=this.get("locationX",e.get("locationX",.5)),h=this.get("locationY",e.get("locationY",.5)),c=this.get("openLocationX",e.get("openLocationX",d)),u=this.get("openLocationY",e.get("openLocationY",h)),g=i.get("width"),p=i.get("height"),m=this.get("stacked"),_=this.get("xAxis"),x=this.get("yAxis"),b=this.get("baseAxis"),y=_.get("start"),P=_.get("end"),T=x.get("start"),F=x.get("end");let I,E,D,M,U=this.get("vcy",1),W=this.get("vcx",1),J=!1,Q=!1;if(x.isType("CategoryAxis")&&_.isType("CategoryAxis")){let O=this._aLocationX0+c-.5,L=this._aLocationX1+d-.5;if(g instanceof te){let k=(L-O)*(1-g.value)/2;O+=k,L-=k}if(I=_.getDataItemPositionX(e,o,O,W),E=_.getDataItemPositionX(e,s,L,W),O=this._aLocationY0+u-.5,L=this._aLocationY1+h-.5,p instanceof te){let k=(L-O)*(1-p.value)/2;O+=k,L-=k}D=x.getDataItemPositionY(e,l,O,U),M=x.getDataItemPositionY(e,a,L,U),e.setRaw("point",{x:I+(E-I)/2,y:D+(M-D)/2})}else if(_===b){let O=this._aLocationX0+c-.5,L=this._aLocationX1+d-.5;if(g instanceof te){let k=(L-O)*(1-g.value)/2;O+=k,L-=k}if(I=_.getDataItemPositionX(e,o,O,W),E=_.getDataItemPositionX(e,s,L,W),D=x.getDataItemPositionY(e,a,h,U),this._yOpenField!==this._yField)M=x.getDataItemPositionY(e,l,u,U);else if(m){let k=e.get("stackToItemY");M=k?x.getDataItemPositionY(k,a,u,k.component.get("vcy")):x.basePosition()}else M=x.basePosition();e.setRaw("point",{x:I+(E-I)/2,y:D}),Q=!0}else if(x===b){let O=this._aLocationY0+u-.5,L=this._aLocationY1+h-.5;if(p instanceof te){let k=(L-O)*(1-p.value)/2;O+=k,L-=k}if(D=x.getDataItemPositionY(e,l,O,U),M=x.getDataItemPositionY(e,a,L,U),E=_.getDataItemPositionX(e,s,d,W),this._xOpenField!==this._xField)I=_.getDataItemPositionX(e,o,c,W);else if(m){let k=e.get("stackToItemX");I=k?_.getDataItemPositionX(k,s,c,k.component.get("vcx")):_.basePosition()}else I=_.basePosition();J=!0,e.setRaw("point",{x:E,y:D+(M-D)/2})}this._updateSeriesGraphics(e,i,I,E,D,M,J,Q),IP&&E>P||D=F&&M>F||K(I)||K(D)?this._toggleColumn(e,!1):this._toggleColumn(e,!0);let ne=e.get("rangeGraphics");ne&&w(ne,O=>{this._updateSeriesGraphics(e,O,I,E,D,M,J,Q)}),this._applyGraphicsStates(e,t)}}_updateSeriesGraphics(e,t,i,s,a,n,r,o){const l=t.get("width"),d=t.get("height"),h=t.get("maxWidth"),c=t.get("maxHeight"),u=this.getPoint(i,a),g=this.getPoint(s,n),p=e.get("point");if(p){const m=this.getPoint(p.x,p.y);p.x=m.x+this._x,p.y=m.y+this._y}if(i=u.x,s=g.x,a=u.y,n=g.y,f(l)){const m=(s-i-l)/2;i+=m,s-=m}if(f(h)&&h{this._toggleColumn(e,!1)})}_applyGraphicsStates(e,t){const i=e.get("graphics"),s=i.states.lookup("dropFromOpen"),a=i.states.lookup("riseFromOpen"),n=i.states.lookup("dropFromPrevious"),r=i.states.lookup("riseFromPrevious");if(s||n||a||r){const o=this.get("xAxis"),l=this.get("yAxis"),d=this.get("baseAxis");let h,c,u;d===o&&l.isType("ValueAxis")?(h=e.get(this._yOpenField),c=e.get(this._yField),u=t.get(this._yField)):d===l&&o.isType("ValueAxis")&&(h=e.get(this._xOpenField),c=e.get(this._xField),u=t.get(this._xField)),f(h)&&f(c)&&(c{const a=s.getPrivate("list");a&&a.removeValue(s),s.dispose()})}hideDataItem(e,t){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return ie(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,e,t)],a=e.get("graphics");a&&s.push(a.hide(t));const n=e.get("rangeGraphics");n&&w(n,r=>{s.push(r.hide(t))}),yield Promise.all(s)})}_toggleColumn(e,t){const i=e.get("graphics");i&&i.setPrivate("visible",t);const s=e.get("rangeGraphics");s&&w(s,n=>{n.setPrivate("visible",t)});const a=e.bullets;a&&w(a,n=>{n.setPrivate("hidden",!t)})}showDataItem(e,t){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return ie(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,e,t)],a=e.get("graphics");a&&s.push(a.show(t));const n=e.get("rangeGraphics");n&&w(n,r=>{s.push(r.show(t))}),yield Promise.all(s)})}updateLegendMarker(e){let t=this.get("legendDataItem");if(this.get("useLastColorForLegendMarker")&&!e){const i=this.dataItems[this.endIndex()-1];i&&(e=i)}if(t){let i=this.columns.template;if(e){let a=e.get("graphics");a&&(i=a)}const s=t.get("markerRectangle");s&&(t.get("itemContainer").get("disabled")||w(rt,a=>{s.set(a,i.get(a,this.get(a)))}))}}_getTooltipTarget(e){return this.get("seriesTooltipTarget")=="bullet"?super._getTooltipTarget(e):e.get("graphics")||this}}Object.defineProperty(H,"className",{enumerable:!0,configurable:!0,writable:!0,value:"BaseColumnSeries"}),Object.defineProperty(H,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([H.className])});class Z extends Ne{constructor(){super(...arguments),Object.defineProperty(this,"_series",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isPanning",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"labelsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(Y.new(this._root,{}))}),Object.defineProperty(this,"gridContainer",{enumerable:!0,configurable:!0,writable:!0,value:Y.new(this._root,{width:A,height:A})}),Object.defineProperty(this,"topGridContainer",{enumerable:!0,configurable:!0,writable:!0,value:Y.new(this._root,{width:A,height:A})}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(Y.new(this._root,{isMeasured:!1,width:A,height:A,position:"absolute"}))}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rangesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_panStart",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_panEnd",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_sAnimation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_eAnimation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_skipSync",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"axisRanges",{enumerable:!0,configurable:!0,writable:!0,value:new Ve}),Object.defineProperty(this,"_seriesAxisRanges",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"ghostLabel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cursorPosition",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"_snapToSeries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_seriesValuesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"axisHeader",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(Y.new(this._root,{themeTags:["axis","header"],position:"absolute",background:oe.new(this._root,{themeTags:["header","background"],fill:this._root.interfaceColors.get("background")})}))}),Object.defineProperty(this,"_bullets",{enumerable:!0,configurable:!0,writable:!0,value:{}})}_dispose(){this.gridContainer.dispose(),this.topGridContainer.dispose(),this.bulletsContainer.dispose(),this.labelsContainer.dispose(),this.axisHeader.dispose(),super._dispose()}_afterNew(){super._afterNew(),this.setPrivate("updateScrollbar",!0),this._disposers.push(this.axisRanges.events.onAll(t=>{if(t.type==="clear")w(t.oldValues,i=>{this.disposeDataItem(i)});else if(t.type==="push")this._processAxisRange(t.newValue,["range"]);else if(t.type==="setIndex")this._processAxisRange(t.newValue,["range"]);else if(t.type==="insertIndex")this._processAxisRange(t.newValue,["range"]);else if(t.type==="removeIndex")this.disposeDataItem(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");this._processAxisRange(t.value,["range"])}}));const e=this.get("renderer");e&&(e.axis=this,e.processAxis()),this.children.push(e),this.ghostLabel=e.makeLabel(new pe(this,void 0,{}),[]),this.ghostLabel.adapters.disable("text"),this.ghostLabel.setAll({opacity:0,tooltipText:void 0,tooltipHTML:void 0,interactive:!1}),this.ghostLabel.events.disable()}_updateFinals(e,t){}zoom(e,t,i,s){if(this._updateFinals(e,t),this.get("start")!==e||this.get("end")!=t){let a=this._sAnimation,n=this._eAnimation,r=this.get("maxDeviation",.5)*Math.min(1,t-e);e<-r&&(e=-r),t>1+r&&(t=1+r),e>t&&([e,t]=[t,e]),f(i)||(i=this.get("interpolationDuration",0)),s||(s="end");let o=this.getPrivate("maxZoomFactor",this.get("maxZoomFactor",100)),l=o;t===1&&e!==0&&(s=ethis.get("end")?"end":"start");let d=this.get("minZoomCount"),h=this.get("maxZoomCount");f(d)&&(o=l/d);let c=1;if(f(h)&&(c=l/h),s==="start"?(h>0&&1/(t-e)o&&(t=e+1/o),t>1&&t-e<1/o&&(e=t-1/o)):(h>0&&1/(t-e)o&&(e=t-1/o),e<0&&t-e<1/o&&(t=e+1/o)),1/(t-e)>o&&(t=e+1/o),1/(t-e)>o&&(e=t-1/o),h!=null&&d!=null&&e==this.get("start")&&t==this.get("end")){const u=this.chart;u&&u._handleAxisSelection(this,!0)}if((a&&a.playing&&a.to==e||this.get("start")==e)&&(n&&n.playing&&n.to==t||this.get("end")==t))return;if(i>0){let u,g,p=this.get("interpolationEasing");if(this.get("start")!=e&&(u=this.animate({key:"start",to:e,duration:i,easing:p})),this.get("end")!=t&&(g=this.animate({key:"end",to:t,duration:i,easing:p})),this._sAnimation=u,this._eAnimation=g,u)return u;if(g)return g}else this.set("start",e),this.set("end",t),this._root.events.once("frameended",()=>{this._markDirtyKey("start"),this._root._markDirty()})}else this._sAnimation&&this._sAnimation.stop(),this._eAnimation&&this._eAnimation.stop()}get series(){return this._series}_processAxisRange(e,t){e.setRaw("isRange",!0),this._createAssets(e,t),this._rangesDirty=!0,this._prepareDataItem(e);const i=e.get("above"),s=this.topGridContainer,a=e.get("grid");i&&a&&s.children.moveValue(a);const n=e.get("axisFill");i&&n&&s.children.moveValue(n)}_prepareDataItem(e,t){}markDirtyExtremes(){}markDirtySelectionExtremes(){}_calculateTotals(){}_updateAxisRanges(){this._bullets={},this.axisRanges.each(e=>{this._prepareDataItem(e)}),w(this._seriesAxisRanges,e=>{this._prepareDataItem(e)})}_prepareChildren(){if(super._prepareChildren(),this.get("fixAxisSize")?this.ghostLabel.set("visible",!0):this.ghostLabel.set("visible",!1),this.isDirty("start")||this.isDirty("end")){this.chart._updateCursor();let t=this.get("start",0),i=this.get("end",1),s=this.get("maxDeviation",.5)*Math.min(1,i-t);if(t<-s){let a=t+s;t=-s,this.setRaw("start",t),this.isDirty("end")&&this.setRaw("end",i-a)}if(i>1+s){let a=i-1-s;i=1+s,this.setRaw("end",i),this.isDirty("start")&&this.setRaw("start",t-a)}}const e=this.get("renderer");if(e._start=this.get("start"),e._end=this.get("end"),e._inversed=e.get("inversed",!1),e._axisLength=e.axisLength()/(e._end-e._start),e._updateLC(),this.isDirty("tooltip")){const t=this.get("tooltip");if(t){const i=e.get("themeTags");t.addTag("axis"),t.addTag(this.className.toLowerCase()),t._applyThemes(),i&&(t.set("themeTags",X(t.get("themeTags"),i)),t.label._applyThemes())}}}_updateTooltipBounds(){const e=this.get("tooltip");e&&this.get("renderer").updateTooltipBounds(e)}_updateBounds(){super._updateBounds(),this._updateTooltipBounds()}processChart(e){this.chart=e,this.get("renderer").chart=e,e.gridContainer.children.push(this.gridContainer),e.topGridContainer.children.push(this.topGridContainer),e.axisHeadersContainer.children.push(this.axisHeader),this.on("start",()=>{e._handleAxisSelection(this)}),this.on("end",()=>{e._handleAxisSelection(this)}),e.plotContainer.onPrivate("width",()=>{this.markDirtySize()}),e.plotContainer.onPrivate("height",()=>{this.markDirtySize()}),e.processAxis(this)}hideDataItem(e){return this._toggleDataItem(e,!1),super.hideDataItem(e)}showDataItem(e){return this._toggleDataItem(e,!0),super.showDataItem(e)}_toggleDataItem(e,t){const i=e.get("label");i&&i.setPrivate("visible",t);const s=e.get("grid");s&&s.setPrivate("visible",t);const a=e.get("tick");a&&a.setPrivate("visible",t);const n=e.get("axisFill");n&&n.setPrivate("visible",t);const r=e.get("bullet");if(r){const o=r.get("sprite");o&&o.setPrivate("visible",t)}}_createAssets(e,t){const i=this.get("renderer");e.get("label")||i.makeLabel(e,t),e.get("grid")||i.makeGrid(e,t),e.get("tick")||i.makeTick(e,t),e.get("axisFill")||i.makeAxisFill(e,t),this._processBullet(e)}_processBullet(e){let t=e.get("bullet"),i=this.get("bullet");if(t||!i||e.get("isRange")||(t=i(this._root,this,e)),t){t.axis=this;const s=t.get("sprite");s&&(s._setDataItem(e),e.setRaw("bullet",t),s.parent||this.bulletsContainer.children.push(s))}}_afterChanged(){super._afterChanged();const e=this.chart;e&&(e._updateChartLayout(),e.axisHeadersContainer.markDirtySize()),this.get("renderer")._updatePositions()}disposeDataItem(e){super.disposeDataItem(e);const t=this.get("renderer"),i=e.get("label");i&&(t.labels.removeValue(i),i.dispose());const s=e.get("tick");s&&(t.ticks.removeValue(s),s.dispose());const a=e.get("grid");a&&(t.grid.removeValue(a),a.dispose());const n=e.get("axisFill");n&&(t.axisFills.removeValue(n),n.dispose());const r=e.get("bullet");r&&r.dispose()}_updateGhost(){this.setPrivate("cellWidth",this.getCellWidthPosition()*this.get("renderer").axisLength());const e=this.ghostLabel;if(!e.isHidden()){const s=e.localBounds(),a=s.right-s.left;let n=e.get("text");w(this.dataItems,r=>{const o=r.get("label");if(o&&!o.isHidden()){const l=o.localBounds();l.right-l.left>a&&(n=o.text._getText())}}),e.set("text",n)}let t=this.get("start",0),i=this.get("end",1);this.get("renderer").updateLabel(e,t+.5*(i-t))}_handleCursorPosition(e,t){e=this.get("renderer").toAxisPosition(e),this._cursorPosition=e,this._snapToSeries=t,this.updateTooltip()}updateTooltip(){const e=this._snapToSeries;let t=this._cursorPosition;const i=this.get("tooltip"),s=this.get("renderer");f(t)&&(w(this.series,a=>{if(a.get("baseAxis")===this){const n=this.getSeriesItem(a,t,this.get("tooltipLocation"));a.setRaw("tooltipDataItem",n),e&&e.indexOf(a)!=-1?(a.updateLegendMarker(n),a.updateLegendValue(n)):a.showDataItemTooltip(n)}}),i&&(s.updateTooltipBounds(i),this.get("snapTooltip")&&(t=this.roundAxisPosition(t,this.get("tooltipLocation",.5))),K(t)?i.hide(0):(this.setPrivateRaw("tooltipPosition",t),this._updateTooltipText(i,t),s.positionTooltip(i,t),tthis.get("end")?i.hide(0):i.show(0))))}_updateTooltipText(e,t){e.label.set("text",this.getTooltipText(t))}roundAxisPosition(e,t){return e}handleCursorShow(){let e=this.get("tooltip");e&&e.show()}handleCursorHide(){let e=this.get("tooltip");e&&e.hide()}processSeriesDataItem(e,t){}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._rangesDirty=!1}coordinateToPosition(e){const t=this.get("renderer");return t.toAxisPosition(e/t.axisLength())}toAxisPosition(e){return this.get("renderer").toAxisPosition(e)}fixPosition(e){return this.get("renderer").fixPosition(e)}shouldGap(e,t,i,s){return!1}createAxisRange(e){return this.axisRanges.push(e)}_groupSeriesData(e){}getCellWidthPosition(){return .05}}Object.defineProperty(Z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Axis"}),Object.defineProperty(Z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ne.classNames.concat([Z.className])});class ae extends Z{constructor(){super(...arguments),Object.defineProperty(this,"_frequency",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_itemMap",{enumerable:!0,configurable:!0,writable:!0,value:{}})}_afterNew(){this._settings.themeTags=X(this._settings.themeTags,["axis"]),this.fields.push("category"),this.setPrivateRaw("name","category"),this.addTag("category"),super._afterNew()}_prepareChildren(){super._prepareChildren();const e=this.dataItems.length;let t=0;this._valuesDirty&&(this._itemMap={},w(this.dataItems,i=>{i.setRaw("index",t),this._itemMap[i.get("category")]=i,t++}),this.setPrivateRaw("maxZoomFactor",e)),this.setPrivateRaw("startIndex",Math.max(Math.round(this.get("start",0)*e),0)),this.setPrivateRaw("endIndex",Math.min(Math.round(this.get("end",1)*e),e)),(this._sizeDirty||this._valuesDirty||this.isDirty("start")||this.isDirty("end")||this.isPrivateDirty("endIndex")||this.isPrivateDirty("startIndex")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&this.dataItems.length>0&&(this._handleRangeChange(),this._prepareAxisItems(),this._updateAxisRanges())}_handleRangeChange(){w(this.series,e=>{let t=this.dataItems[this.startIndex()].get("category"),i=this.dataItems[this.endIndex()-1].get("category"),s=e.get("baseAxis"),a=e.get("xAxis"),n=e.get("yAxis");if(a instanceof ae&&n instanceof ae)e._markDirtyAxes();else if(s===this){let r,o,l=n;if(a===s?(e.get("categoryXField")&&(r="categoryX"),e.get("openCategoryXField")&&(o="openCategoryX")):n===s&&(e.get("categoryYField")&&(r="categoryY"),e.get("openCategoryYField")&&(o="openCategoryY"),l=a),l.className=="ValueAxis"&&(r||o)){let d,h;for(let p=0,m=e.dataItems.length;p=0;p--){let m=e.dataItems[p];if(r&&m.get(r)===i){h=m;break}if(o&&m.get(o)===i){h=m;break}}let c=0,u=e.dataItems.length;d&&(c=e.dataItems.indexOf(d)),h&&(u=e.dataItems.indexOf(h)+1),e.setPrivate("startIndex",c),e.setPrivate("endIndex",u);let g=!1;for(let p=c;p{m.get(_)!=null&&(g=!0)}),w(e.__valueYShowFields,_=>{m.get(_)!=null&&(g=!0)}),g)break}e.setPrivate("outOfSelection",!g)}e._markDirtyAxes()}})}_prepareAxisItems(){const e=this.get("renderer"),t=this.dataItems.length;let i=this.startIndex();i>0&&i--;let s=this.endIndex();s0){let i=this.getPrivate("name")+this.get("renderer").getPrivate("letter"),s=this.axisPositionToIndex(t),a=e.dataItems[s],n=this.dataItems[s],r=n.get("category");if(a&&n&&a.get(i)===r)return a;for(let o=0,l=e.dataItems.length;o{this._dirtySelectionExtremes=!0}),e.onPrivate("selectionMaxFinal",()=>{this._dirtySelectionExtremes=!0})]))}(this._sizeDirty||this._dirtyExtremes||this._valuesDirty||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("min")||this.isDirty("max")||this.isDirty("extraMin")||this.isDirty("extraMax")||this.isDirty("logarithmic")||this.isDirty("treatZeroAs")||this.isDirty("baseValue")||this.isDirty("strictMinMax")||this.isDirty("strictMinMaxSelection")||this.isDirty("maxPrecision")||this.isDirty("numberFormat"))&&(this._getMinMax(),this.ghostLabel.set("text",""),this._dirtyExtremes=!1),this._dirtySelectionExtremes&&!this._isPanning&&this.get("autoZoom",!0)&&(this._getSelectionMinMax(),this._dirtySelectionExtremes=!1),this._groupData(),(this._sizeDirty||this._valuesDirty||this.isDirty("start")||this.isDirty("end")||this.isPrivateDirty("min")||this.isPrivateDirty("selectionMax")||this.isPrivateDirty("selectionMin")||this.isPrivateDirty("max")||this.isPrivateDirty("step")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("logarithmic"))&&(this._handleRangeChange(),this._prepareAxisItems(),this._updateAxisRanges()),this._baseValue=this.baseValue()}_groupData(){}_formatText(e){const t=this.get("numberFormat"),i=this.getNumberFormatter();let s="";return s=t?i.format(e,t):i.format(e,void 0,this.getPrivate("stepDecimalPlaces")),s}_prepareAxisItems(){const e=this.getPrivate("min"),t=this.getPrivate("max");if(f(e)&&f(t)){const i=this.get("logarithmic"),s=this.getPrivate("step"),a=this.getPrivate("selectionMin"),n=this.getPrivate("selectionMax")+s;let r=a-s,o=0,l=1,d=e;if(i){if(r=this._minLogAdjusted,r2&&(r=Math.pow(10,Math.log(d)*Math.LOG10E-5))}let h=-1/0;for(;r2?r=Math.pow(10,Math.log(d)*Math.LOG10E+o-5):r+=s,h==r)break;let g=Math.pow(10,Math.floor(Math.log(Math.abs(s))*Math.LOG10E));if(g<1){let p=Math.round(Math.abs(Math.log(Math.abs(g))*Math.LOG10E))+2;r=j(r,p)}o++,h=r}for(let c=o;c{c.inited&&c._markDirtyAxes()}),this._updateGhost()}}_prepareDataItem(e,t){let i=this.get("renderer"),s=e.get("value"),a=e.get("endValue"),n=this.valueToPosition(s),r=n,o=this.valueToPosition(s+this.getPrivate("step"));f(a)&&(r=this.valueToPosition(a),o=r),e.get("isRange")&&a==null&&(o=n),i.updateLabel(e.get("label"),n,r,t);const l=e.get("grid");if(i.updateGrid(l,n,r),l&&(s==this.get("baseValue",0)?(l.addTag("base"),l._applyThemes()):l.hasTag("base")&&(l.removeTag("base"),l._applyThemes())),i.updateTick(e.get("tick"),n,r,t),i.updateFill(e.get("axisFill"),n,o),this._processBullet(e),i.updateBullet(e.get("bullet"),n,r),!e.get("isRange")){const d=this.get("fillRule");d&&d(e)}}_handleRangeChange(){let e=this.positionToValue(this.get("start",0)),t=this.positionToValue(this.get("end",1));const i=this.get("renderer").gridCount();let s=this._adjustMinMax(e,t,i,!0),a=at(s.step);this.setPrivateRaw("stepDecimalPlaces",a),e=j(e,a),t=j(t,a),s=this._adjustMinMax(e,t,i,!0);let n=s.step;e=s.min,t=s.max,this.getPrivate("selectionMin")===e&&this.getPrivate("selectionMax")===t&&this.getPrivate("step")===n||(this.setPrivateRaw("selectionMin",e),this.setPrivateRaw("selectionMax",t),this.setPrivateRaw("step",n))}positionToValue(e){const t=this.getPrivate("min"),i=this.getPrivate("max");return this.get("logarithmic")?Math.pow(Math.E,(e*(Math.log(i)*Math.LOG10E-Math.log(t)*Math.LOG10E)+Math.log(t)*Math.LOG10E)/Math.LOG10E):e*(i-t)+t}valueToPosition(e){const t=this.getPrivate("min"),i=this.getPrivate("max");if(this.get("logarithmic")){if(e<=0){let s=this.get("treatZeroAs");f(s)&&(e=s)}return(Math.log(e)*Math.LOG10E-Math.log(t)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(t)*Math.LOG10E)}return(e-t)/(i-t)}valueToFinalPosition(e){const t=this.getPrivate("minFinal"),i=this.getPrivate("maxFinal");if(this.get("logarithmic")){if(e<=0){let s=this.get("treatZeroAs");f(s)&&(e=s)}return(Math.log(e)*Math.LOG10E-Math.log(t)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(t)*Math.LOG10E)}return(e-t)/(i-t)}getX(e,t,i){e=i+(e-i)*t;const s=this.valueToPosition(e);return this._settings.renderer.positionToCoordinate(s)}getY(e,t,i){e=i+(e-i)*t;const s=this.valueToPosition(e);return this._settings.renderer.positionToCoordinate(s)}getDataItemCoordinateX(e,t,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(e,t,i,s))}getDataItemPositionX(e,t,i,s){let a=e.get(t);return e.get("stackToItemX")?a=a*s+e.component.getStackedXValueWorking(e,t):a=this._baseValue+(a-this._baseValue)*s,this.valueToPosition(a)}getDataItemCoordinateY(e,t,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(e,t,i,s))}getDataItemPositionY(e,t,i,s){let a=e.get(t);return e.get("stackToItemY")?a=a*s+e.component.getStackedYValueWorking(e,t):a=this._baseValue+(a-this._baseValue)*s,this.valueToPosition(a)}basePosition(){return this.valueToPosition(this.baseValue())}baseValue(){const e=Math.min(this.getPrivate("minFinal",-1/0),this.getPrivate("selectionMin",-1/0)),t=Math.max(this.getPrivate("maxFinal",1/0),this.getPrivate("selectionMax",1/0));let i=this.get("baseValue",0);return it&&(i=t),i}cellEndValue(e){return e}fixSmallStep(e){return 1+e===1?(e*=2,this.fixSmallStep(e)):e}_fixMin(e){return e}_fixMax(e){return e}_calculateTotals(){if(this.get("calculateTotals")){let e=this.series[0];if(e){let t=e.startIndex();if(e.dataItems.length>0){t>0&&t--;let i,s,a=e.endIndex();a{if(!d.get("excludeFromTotal")){let h=d.dataItems[r];if(h){let c=h.get(n)*d.get(s);K(c)||(o+=c,l+=Math.abs(c))}}}),w(this.series,d=>{if(!d.get("excludeFromTotal")){let h=d.dataItems[r];if(h){let c=h.get(n)*d.get(s);K(c)||(h.set(i+"Total",l),h.set(i+"Sum",o),h.set(i+"TotalPercent",c/l*100))}}})}}}}}_getSelectionMinMax(){const e=this.getPrivate("minFinal"),t=this.getPrivate("maxFinal"),i=this.get("min"),s=this.get("max");let a=this.get("extraMin",0),n=this.get("extraMax",0);this.get("logarithmic")&&(this.get("extraMin")==null&&(a=.1),this.get("extraMax")==null&&(n=.2));const r=this.get("renderer").gridCount(),o=this.get("strictMinMaxSelection"),l=this.get("strictMinMax");if(f(e)&&f(t)){let d=t,h=e;if(w(this.series,b=>{if(!b.get("ignoreMinMax")){let y,P;const T=b.getPrivate("outOfSelection");b.get("xAxis")===this?T||(y=b.getPrivate("selectionMinX",b.getPrivate("minX")),P=b.getPrivate("selectionMaxX",b.getPrivate("maxX"))):b.get("yAxis")===this&&(T||(y=b.getPrivate("selectionMinY",b.getPrivate("minY")),P=b.getPrivate("selectionMaxY",b.getPrivate("maxY")))),b.isHidden()||b.isShowing()||(f(y)&&(d=Math.min(d,y)),f(P)&&(h=Math.max(h,P)))}}),this.axisRanges.each(b=>{if(b.get("affectsMinMax")){let y=b.get("value");y!=null&&(d=Math.min(d,y),h=Math.max(h,y)),y=b.get("endValue"),y!=null&&(d=Math.min(d,y),h=Math.max(h,y))}}),d>h&&([d,h]=[h,d]),f(i)?d=l?i:e:l&&f(this._minReal)&&(d=this._minReal),f(s)?h=l?s:t:l&&f(this._maxReal)&&(h=this._maxReal),d===h){d-=this._deltaMinMax,h+=this._deltaMinMax;let b=this._adjustMinMax(d,h,r,l);d=b.min,h=b.max}let c=d,u=h;d-=(h-d)*a,h+=(h-d)*n;let g=this._adjustMinMax(d,h,r);d=g.min,h=g.max,d=Te(d,e,t),h=Te(h,e,t),g=this._adjustMinMax(d,h,r,!0),l||(d=g.min,h=g.max);const p=this.get("syncWithAxis");p&&(g=this._syncAxes(d,h,g.step,p.getPrivate("selectionMinFinal",p.getPrivate("minFinal",0)),p.getPrivate("selectionMaxFinal",p.getPrivate("maxFinal",1)),p.getPrivate("selectionStepFinal",p.getPrivate("step",1))),d=g.min,h=g.max),l&&(f(i)&&(d=Math.max(d,i)),f(s)&&(h=Math.min(h,s))),o&&(d=c-(h-d)*a,h=u+(h-d)*n),this.get("logarithmic")&&(d<=0&&(d=c*(1-Math.min(a,.99))),dt&&(h=t));let m=Math.min(20,Math.ceil(Math.log(this.getPrivate("maxZoomFactor",100)+1)/Math.LN10)+2),_=j(this.valueToFinalPosition(d),m),x=j(this.valueToFinalPosition(h),m);this.setPrivateRaw("selectionMinFinal",d),this.setPrivateRaw("selectionMaxFinal",h),this.setPrivateRaw("selectionStepFinal",g.step),this.zoom(_,x)}}_getMinMax(){let e=this.get("min"),t=this.get("max"),i=1/0,s=-1/0,a=this.get("extraMin",0),n=this.get("extraMax",0);this.get("logarithmic")&&(this.get("extraMin")==null&&(a=.1),this.get("extraMax")==null&&(n=.2));let r=1/0;if(w(this.series,b=>{if(!b.get("ignoreMinMax")){let y,P;if(b.get("xAxis")===this?(y=b.getPrivate("minX"),P=b.getPrivate("maxX")):b.get("yAxis")===this&&(y=b.getPrivate("minY"),P=b.getPrivate("maxY")),f(y)&&f(P)){i=Math.min(i,y),s=Math.max(s,P);let T=P-y;T<=0&&(T=Math.abs(P/100)),T{if(b.get("affectsMinMax")){let y=b.get("value");y!=null&&(i=Math.min(i,y),s=Math.max(s,y)),y=b.get("endValue"),y!=null&&(i=Math.min(i,y),s=Math.max(s,y))}}),this.get("logarithmic")){let b=this.get("treatZeroAs");f(b)&&i<=0&&(i=b)}if(i===0&&s===0&&(s=.9,i=-.9),f(e)&&(i=e),f(t)&&(s=t),i===1/0||s===-1/0)return this.setPrivate("minFinal",void 0),void this.setPrivate("maxFinal",void 0);const o=i,l=s;let d=this.adapters.fold("min",i),h=this.adapters.fold("max",s);f(d)&&(i=d),f(h)&&(s=h),i=this._fixMin(i),s=this._fixMax(s),s-i<=1/Math.pow(10,15)&&(s-i!=0?this._deltaMinMax=(s-i)/2:this._getDelta(s),i-=this._deltaMinMax,s+=this._deltaMinMax),i-=(s-i)*a,s+=(s-i)*n,this.get("logarithmic")&&(i<0&&o>=0&&(i=0),s>0&&l<=0&&(s=0)),this._minReal=i,this._maxReal=s;let c=this.get("strictMinMax"),u=this.get("strictMinMaxSelection",!1);u&&(c=u);let g=c;f(t)&&(g=!0);let p=this.get("renderer").gridCount(),m=this._adjustMinMax(i,s,p,g);i=m.min,s=m.max,m=this._adjustMinMax(i,s,p,!0),i=m.min,s=m.max,c&&(i=f(e)?e:this._minReal,s=f(t)?t:this._maxReal,s-i<=1e-8&&(i-=this._deltaMinMax,s+=this._deltaMinMax),i-=(s-i)*a,s+=(s-i)*n),d=this.adapters.fold("min",i),h=this.adapters.fold("max",s),f(d)&&(i=d),f(h)&&(s=h),r==1/0&&(r=s-i);let _=Math.round(Math.abs(Math.log(Math.abs(s-i))*Math.LOG10E))+5;i=j(i,_),s=j(s,_);const x=this.get("syncWithAxis");if(x&&(m=this._syncAxes(i,s,m.step,x.getPrivate("minFinal",x.getPrivate("min",0)),x.getPrivate("maxFinal",x.getPrivate("max",1)),x.getPrivate("step",1)),i=m.min,s=m.max),this.setPrivateRaw("maxZoomFactor",Math.max(1,Math.ceil((s-i)/r*this.get("maxZoomFactor",100)))),this._fixZoomFactor(),this.get("logarithmic")&&(this._minLogAdjusted=i,i=this._minReal,s=this._maxReal,i<=0&&(i=o*(1-Math.min(a,.99)))),f(i)&&f(s)&&(this.getPrivate("minFinal")!==i||this.getPrivate("maxFinal")!==s)){this.setPrivate("minFinal",i),this.setPrivate("maxFinal",s),this._saveMinMax(i,s);const b=this.get("interpolationDuration",0),y=this.get("interpolationEasing");this.animatePrivate({key:"min",to:i,duration:b,easing:y}),this.animatePrivate({key:"max",to:s,duration:b,easing:y})}}_fixZoomFactor(){}_getDelta(e){let t=Math.log(Math.abs(e))*Math.LOG10E,i=Math.pow(10,Math.floor(t));i/=10,this._deltaMinMax=i}_saveMinMax(e,t){}_adjustMinMax(e,t,i,s){i<=1&&(i=1),i=Math.round(i);let a=e,n=t,r=t-e;r===0&&(r=Math.abs(t));let o=Math.log(Math.abs(r))*Math.LOG10E,l=Math.pow(10,Math.floor(o));l/=10;let d=l;s&&(d=0),s?(e=Math.floor(e/l)*l,t=Math.ceil(t/l)*l):(e=Math.ceil(e/l)*l-d,t=Math.floor(t/l)*l+d),e<0&&a>=0&&(e=0),t>0&&n<=0&&(t=0),o=Math.log(Math.abs(r))*Math.LOG10E,l=Math.pow(10,Math.floor(o)),l/=100;let h=Math.ceil(r/i/l)*l,c=Math.pow(10,Math.floor(Math.log(Math.abs(h))*Math.LOG10E)),u=Math.ceil(h/c);u>5?u=10:u<=5&&u>2&&(u=5),h=Math.ceil(h/(c*u))*c*u;let g=this.get("maxPrecision");if(f(g)){let x=lt(h,g);ga&&(e-=h),h=this.fixSmallStep(h),{min:e,max:t,step:h}}getTooltipText(e){const t=this.get("tooltipNumberFormat",this.get("numberFormat")),i=this.getNumberFormatter(),s=this.get("extraTooltipPrecision",0),a=this.getPrivate("stepDecimalPlaces",0)+s,n=j(this.positionToValue(e),a);return t?i.format(n,t):i.format(n,void 0,a)}getSeriesItem(e,t){let i,s,a=this.getPrivate("name")+this.get("renderer").getPrivate("letter"),n=this.positionToValue(t);if(w(e.dataItems,(r,o)=>{const l=Math.abs(r.get(a)-n);(i===void 0||l500&&(d=!0),d)e=u,t=g,i=p;else{h/3==Math.round(h/3)?(u=e-c*h,e>=0&&u<0&&(u=0)):(g=t+c*h,g<=0&&g>0&&(g=0));let m=this._adjustMinMax(u,g,l,!0);u=m.min,g=m.max,p=m.step}}}return{min:e,max:t,step:i}}_checkSync(e,t,i,s){let a=(t-e)/i;for(let n=1;nde._new(this._root,{themeTags:X(this.ticks.template.get("themeTags",[]),this.get("themeTags",[]))},[this.ticks.template]))}),Object.defineProperty(this,"grid",{enumerable:!0,configurable:!0,writable:!0,value:new z(G.new({}),()=>se._new(this._root,{themeTags:X(this.grid.template.get("themeTags",[]),this.get("themeTags",[]))},[this.grid.template]))}),Object.defineProperty(this,"axisFills",{enumerable:!0,configurable:!0,writable:!0,value:new z(G.new({}),()=>V._new(this._root,{themeTags:X(this.axisFills.template.get("themeTags",["axis","fill"]),this.get("themeTags",[]))},[this.axisFills.template]))}),Object.defineProperty(this,"labels",{enumerable:!0,configurable:!0,writable:!0,value:new z(G.new({}),()=>ce._new(this._root,{themeTags:X(this.labels.template.get("themeTags",[]),this.get("themeTags",[]))},[this.labels.template]))}),Object.defineProperty(this,"axis",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}makeTick(e,t){const i=this.ticks.make();return i._setDataItem(e),e.setRaw("tick",i),i.set("themeTags",X(i.get("themeTags"),t)),this.axis.labelsContainer.children.push(i),this.ticks.push(i),i}makeGrid(e,t){const i=this.grid.make();return i._setDataItem(e),e.setRaw("grid",i),i.set("themeTags",X(i.get("themeTags"),t)),this.axis.gridContainer.children.push(i),this.grid.push(i),i}makeAxisFill(e,t){const i=this.axisFills.make();return i._setDataItem(e),i.set("themeTags",X(i.get("themeTags"),t)),this.axis.gridContainer.children.push(i),e.setRaw("axisFill",i),this.axisFills.push(i),i}makeLabel(e,t){const i=this.labels.make();return i.set("themeTags",X(i.get("themeTags"),t)),this.axis.labelsContainer.children.moveValue(i,0),i._setDataItem(e),e.setRaw("label",i),this.labels.push(i),i}axisLength(){return 0}gridCount(){return this.axisLength()/this.get("minGridDistance",50)}_updatePositions(){}_afterNew(){super._afterNew(),this.set("isMeasured",!1);const e=this.thumb;e&&(this._disposers.push(e.events.on("pointerdown",t=>{this._handleThumbDown(t.originalEvent)})),this._disposers.push(e.events.on("globalpointerup",t=>{this._handleThumbUp(t.originalEvent)})),this._disposers.push(e.events.on("globalpointermove",t=>{this._handleThumbMove(t.originalEvent)})))}_changed(){if(super._changed(),this.isDirty("pan")){const e=this.thumb;if(e){const t=this.axis.labelsContainer,i=this.get("pan");i=="zoom"?t.children.push(e):i=="none"&&t.children.removeValue(e)}}}_handleThumbDown(e){this._thumbDownPoint=this.toLocal(this._root.documentPointToRoot({x:e.clientX,y:e.clientY}));const t=this.axis;this._downStart=t.get("start"),this._downEnd=t.get("end")}_handleThumbUp(e){this._thumbDownPoint=void 0}_handleThumbMove(e){const t=this._thumbDownPoint;if(t){const i=this.toLocal(this._root.documentPointToRoot({x:e.clientX,y:e.clientY})),s=this._downStart,a=this._downEnd,n=this._getPan(i,t)*Math.min(1,a-s)/2;this.axis.setAll({start:s-n,end:a+n})}}_getPan(e,t){return 0}positionToCoordinate(e){return this._inversed?(this._end-e)*this._axisLength:(e-this._start)*this._axisLength}updateTooltipBounds(e){}_updateSize(){this.markDirty(),this._clear=!0}toAxisPosition(e){const t=this._start||0,i=this._end||1;return e*=i-t,e=this.get("inversed")?i-e:t+e}fixPosition(e){return this.get("inversed")?1-e:e}_updateLC(){}toggleVisibility(e,t,i,s){let a=this.axis;const n=a.get("start",0),r=a.get("end",1);tn+(r-n)*(s+1e-4)?e.setPrivate("visible",!1):e.setPrivate("visible",!0)}_positionTooltip(e,t){const i=this.chart;i&&(i.inPlot(t)?e.set("pointTo",this._display.toGlobal(t)):e.hide())}processAxis(){}}Object.defineProperty(q,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRenderer"}),Object.defineProperty(q,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:V.classNames.concat([q.className])});class ye extends q{constructor(){super(...arguments),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:oe.new(this._root,{width:A,isMeasured:!1,themeTags:["axis","x","thumb"]})})}_afterNew(){this._settings.themeTags=X(this._settings.themeTags,["renderer","x"]),super._afterNew(),this.setPrivateRaw("letter","X");const e=this.grid.template;e.set("height",A),e.set("width",0),e.set("draw",(t,i)=>{t.moveTo(0,0),t.lineTo(0,i.height())}),this.set("draw",(t,i)=>{t.moveTo(0,0),t.lineTo(i.width(),0)})}_changed(){super._changed();const e=this.axis;e.ghostLabel.setPrivate("visible",!this.get("inside")),e.ghostLabel.set("x",-1e3);const t="opposite",i="inside";if(this.isDirty(t)||this.isDirty(i)){const s=this.chart,a=e.children;if(this.get(i)?e.addTag(i):e.removeTag(i),s){if(this.get(t)){const n=s.topAxesContainer.children;n.indexOf(e)==-1&&n.insertIndex(0,e),e.addTag(t),a.moveValue(this)}else{const n=s.bottomAxesContainer.children;n.indexOf(e)==-1&&n.moveValue(e),e.removeTag(t),a.moveValue(this,0)}e.ghostLabel._applyThemes(),this.labels.each(n=>{n._applyThemes()}),this.root._markDirtyRedraw()}e.markDirtySize()}this.thumb.setPrivate("height",e.labelsContainer.height())}_getPan(e,t){return(t.x-e.x)/this.width()}toAxisPosition(e){const t=this._start||0,i=this._end||1;return e=(e-=this._ls)*(i-t)/this._lc,e=this.get("inversed")?i-e:t+e}_updateLC(){const e=this.axis,t=e.parent;if(t){const i=t.innerWidth();this._lc=this.axisLength()/i,this._ls=(e.x()-t.get("paddingLeft",0))/i}}_updatePositions(){const e=this.axis,t=e.x()-ge(e.get("centerX",0),e.width())-e.parent.get("paddingLeft",0);e.gridContainer.set("x",t),e.topGridContainer.set("x",t),e.bulletsContainer.set("y",this.y());const i=e.chart;if(i){const s=i.plotContainer,a=e.axisHeader;let n=e.get("marginLeft",0),r=e.x()-n;const o=e.parent;o&&(r-=o.get("paddingLeft",0)),a.children.length>0?(n=e.axisHeader.width(),e.set("marginLeft",n+1)):a.set("width",n),a.setAll({x:r,y:-1,height:s.height()+2})}}processAxis(){super.processAxis();const e=this.axis;e.set("width",A);const t=this._root.verticalLayout;e.set("layout",t),e.labelsContainer.set("width",A),e.axisHeader.setAll({layout:t})}axisLength(){return this.axis.width()}positionToPoint(e){return{x:this.positionToCoordinate(e),y:0}}updateTick(e,t,i,s){if(e){f(t)||(t=0);let a=.5;a=f(s)&&s>1?e.get("multiLocation",a):e.get("location",a),f(i)&&i!=t&&(t+=(i-t)*a),e.set("x",this.positionToCoordinate(t));let n=e.get("length",0);const r=e.get("inside",this.get("inside",!1));this.get("opposite")?(e.set("y",A),r||(n*=-1)):(e.set("y",0),r&&(n*=-1)),e.set("draw",o=>{o.moveTo(0,0),o.lineTo(0,n)}),this.toggleVisibility(e,t,e.get("minPosition",0),e.get("maxPosition",1))}}updateLabel(e,t,i,s){if(e){let a=.5;a=f(s)&&s>1?e.get("multiLocation",a):e.get("location",a),f(t)||(t=0);const n=e.get("inside",this.get("inside",!1));this.get("opposite")?n?(e.set("position","absolute"),e.set("y",0)):(e.set("position","relative"),e.set("y",A)):n?(e.set("y",0),e.set("position","absolute")):(e.set("y",void 0),e.set("position","relative")),f(i)&&i!=t&&(t+=(i-t)*a),e.set("x",this.positionToCoordinate(t)),this.toggleVisibility(e,t,e.get("minPosition",0),e.get("maxPosition",1))}}updateGrid(e,t,i){if(e){f(t)||(t=0);let s=e.get("location",.5);f(i)&&i!=t&&(t+=(i-t)*s),e.set("x",this.positionToCoordinate(t)),this.toggleVisibility(e,t,0,1)}}updateBullet(e,t,i){if(e){const s=e.get("sprite");if(s){f(t)||(t=0);let a=e.get("location",.5);f(i)&&i!=t&&(t+=(i-t)*a);let n=this.axis.roundAxisPosition(t,a),r=this.axis._bullets[n],o=-1;if(this.get("opposite")&&(o=1),e.get("stacked"))if(r){let l=r.get("sprite");l&&s.set("y",l.y()+l.height()*o)}else s.set("y",0);this.axis._bullets[n]=e,s.set("x",this.positionToCoordinate(t)),this.toggleVisibility(s,t,0,1)}}}updateFill(e,t,i){if(e){f(t)||(t=0),f(i)||(i=1);let s=this.positionToCoordinate(t),a=this.positionToCoordinate(i);this.fillDrawMethod(e,s,a)}}fillDrawMethod(e,t,i){e.set("draw",s=>{const a=this.axis.gridContainer.height(),n=this.width();in||i<0||(s.moveTo(t,0),s.lineTo(i,0),s.lineTo(i,a),s.lineTo(t,a),s.lineTo(t,0))})}positionTooltip(e,t){this._positionTooltip(e,{x:this.positionToCoordinate(t),y:0})}updateTooltipBounds(e){const t=this.get("inside"),i=1e5;let s=this._display.toGlobal({x:0,y:0}),a=s.x,n=0,r=this.axisLength(),o=i,l="up";this.get("opposite")?t?(l="up",n=s.y,o=i):(l="down",n=s.y-i,o=i):t?(l="down",n=s.y-i,o=i):(l="up",n=s.y,o=i);const d={left:a,right:a+r,top:n,bottom:n+o},h=e.get("bounds");je(d,h)||(e.set("bounds",d),e.set("pointerOrientation",l))}}Object.defineProperty(ye,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRendererX"}),Object.defineProperty(ye,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:q.classNames.concat([ye.className])});class ve extends q{constructor(){super(...arguments),Object.defineProperty(this,"_downY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:oe.new(this._root,{height:A,isMeasured:!1,themeTags:["axis","y","thumb"]})})}_afterNew(){this._settings.themeTags=X(this._settings.themeTags,["renderer","y"]),this._settings.opposite&&this._settings.themeTags.push("opposite"),super._afterNew(),this.setPrivateRaw("letter","Y");const e=this.grid.template;e.set("width",A),e.set("height",0),e.set("draw",(t,i)=>{t.moveTo(0,0),t.lineTo(i.width(),0)}),this.set("draw",(t,i)=>{t.moveTo(0,0),t.lineTo(0,i.height())})}_getPan(e,t){return(e.y-t.y)/this.height()}_changed(){super._changed();const e=this.axis;e.ghostLabel.setPrivate("visible",!this.get("inside")),e.ghostLabel.set("y",-1e3);const t=this.thumb,i="opposite",s="inside",a=this.chart;if(this.isDirty(i)||this.isDirty(s)){const r=e.children;if(this.get(s)?e.addTag(s):e.removeTag(s),a){if(this.get(i)){const o=a.rightAxesContainer.children;o.indexOf(e)==-1&&o.moveValue(e,0),e.addTag(i),r.moveValue(this,0)}else{const o=a.leftAxesContainer.children;o.indexOf(e)==-1&&o.moveValue(e),e.removeTag(i),r.moveValue(this)}e.ghostLabel._applyThemes(),this.labels.each(o=>{o._applyThemes()}),this.root._markDirtyRedraw()}e.markDirtySize()}const n=e.labelsContainer.width();a&&(this.get(i)?t.set("centerX",0):t.set("centerX",n)),t.setPrivate("width",n)}processAxis(){super.processAxis();const e=this.axis;e.get("height")==null&&e.set("height",A);const t=this._root.horizontalLayout;e.set("layout",t),e.labelsContainer.set("height",A),e.axisHeader.set("layout",t)}_updatePositions(){const e=this.axis,t=e.y()-ge(e.get("centerY",0),e.height());e.gridContainer.set("y",t),e.topGridContainer.set("y",t),e.bulletsContainer.set("x",this.x());const i=e.chart;if(i){const s=i.plotContainer,a=e.axisHeader;let n=e.get("marginTop",0);a.children.length>0?(n=e.axisHeader.height(),e.set("marginTop",n+1)):a.set("height",n),a.setAll({y:e.y()-n,x:-1,width:s.width()+2})}}axisLength(){return this.axis.innerHeight()}positionToPoint(e){return{x:0,y:this.positionToCoordinate(e)}}updateLabel(e,t,i,s){if(e){f(t)||(t=0);let a=.5;a=f(s)&&s>1?e.get("multiLocation",a):e.get("location",a);const n=this.get("opposite"),r=e.get("inside",this.get("inside",!1));n?(e.set("x",0),r?e.set("position","absolute"):e.set("position","relative")):r?(e.set("x",0),e.set("position","absolute")):(e.set("x",void 0),e.set("position","relative")),f(i)&&i!=t&&(t+=(i-t)*a),e.set("y",this.positionToCoordinate(t)),this.toggleVisibility(e,t,e.get("minPosition",0),e.get("maxPosition",1))}}updateGrid(e,t,i){if(e){f(t)||(t=0);let s=e.get("location",.5);f(i)&&i!=t&&(t+=(i-t)*s),e.set("y",this.positionToCoordinate(t)),this.toggleVisibility(e,t,0,1)}}updateTick(e,t,i,s){if(e){f(t)||(t=0);let a=.5;a=f(s)&&s>1?e.get("multiLocation",a):e.get("location",a),f(i)&&i!=t&&(t+=(i-t)*a),e.set("y",this.positionToCoordinate(t));let n=e.get("length",0);const r=e.get("inside",this.get("inside",!1));this.get("opposite")?(e.set("x",0),r&&(n*=-1)):r||(n*=-1),e.set("draw",o=>{o.moveTo(0,0),o.lineTo(n,0)}),this.toggleVisibility(e,t,e.get("minPosition",0),e.get("maxPosition",1))}}updateBullet(e,t,i){if(e){const s=e.get("sprite");if(s){f(t)||(t=0);let a=e.get("location",.5);f(i)&&i!=t&&(t+=(i-t)*a);let n=this.axis.roundAxisPosition(t,a),r=this.axis._bullets[n],o=1;if(this.get("opposite")&&(o=-1),e.get("stacked"))if(r){let l=r.get("sprite");l&&s.set("x",l.x()+l.width()*o)}else s.set("x",0);this.axis._bullets[n]=e,s.set("y",this.positionToCoordinate(t)),this.toggleVisibility(s,t,0,1)}}}updateFill(e,t,i){if(e){f(t)||(t=0),f(i)||(i=1);let s=this.positionToCoordinate(t),a=this.positionToCoordinate(i);this.fillDrawMethod(e,s,a)}}fillDrawMethod(e,t,i){e.set("draw",s=>{const a=this.axis.gridContainer.width(),n=this.height();in||i<0||(s.moveTo(0,t),s.lineTo(a,t),s.lineTo(a,i),s.lineTo(0,i),s.lineTo(0,t))})}positionToCoordinate(e){return this._inversed?(e-this._start)*this._axisLength:(this._end-e)*this._axisLength}positionTooltip(e,t){this._positionTooltip(e,{x:0,y:this.positionToCoordinate(t)})}updateTooltipBounds(e){const t=this.get("inside"),i=1e5;let s=this._display.toGlobal({x:0,y:0}),a=s.y,n=0,r=this.axisLength(),o=i,l="right";this.get("opposite")?t?(l="right",n=s.x-i,o=i):(l="left",n=s.x,o=i):t?(l="left",n=s.x,o=i):(l="right",n=s.x-i,o=i);const d={left:n,right:n+o,top:a,bottom:a+r},h=e.get("bounds");je(d,h)||(e.set("bounds",d),e.set("pointerOrientation",l))}_updateLC(){const e=this.axis,t=e.parent;if(t){const i=t.innerHeight();this._lc=this.axisLength()/i,this._ls=e.y()/i}}toAxisPosition(e){const t=this._start||0,i=this._end||1;return e=(e-=this._ls)*(i-t)/this._lc,e=this.get("inversed")?t+e:i-e}fixPosition(e){return this.get("inversed")?e:1-e}}Object.defineProperty(ve,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRendererY"}),Object.defineProperty(ve,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:q.classNames.concat([ve.className])});class Pe extends H{constructor(){super(...arguments),Object.defineProperty(this,"columns",{enumerable:!0,configurable:!0,writable:!0,value:new z(G.new({}),()=>Le._new(this._root,{position:"absolute",themeTags:X(this.columns.template.get("themeTags",[]),["series","column"])},[this.columns.template]))})}makeColumn(e,t){const i=this.mainContainer.children.push(t.make());return i._setDataItem(e),t.push(i),i}_processAxisRange(e){super._processAxisRange(e),e.columns=new z(G.new({}),()=>Le._new(this._root,{position:"absolute",themeTags:X(e.columns.template.get("themeTags",[]),["series","column"])},[this.columns.template,e.columns.template]))}}Object.defineProperty(Pe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColumnSeries"}),Object.defineProperty(Pe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:H.classNames.concat([Pe.className])});class we extends B{constructor(){super(...arguments),Object.defineProperty(this,"_endIndex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeGenerator",{enumerable:!0,configurable:!0,writable:!0,value:Ke()}),Object.defineProperty(this,"_fillGenerator",{enumerable:!0,configurable:!0,writable:!0,value:dt()}),Object.defineProperty(this,"_legendStroke",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_legendFill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"strokes",{enumerable:!0,configurable:!0,writable:!0,value:new z(G.new({}),()=>V._new(this._root,{themeTags:X(this.strokes.template.get("themeTags",[]),["line","series","stroke"])},[this.strokes.template]))}),Object.defineProperty(this,"fills",{enumerable:!0,configurable:!0,writable:!0,value:new z(G.new({}),()=>V._new(this._root,{themeTags:X(this.strokes.template.get("themeTags",[]),["line","series","fill"])},[this.fills.template]))}),Object.defineProperty(this,"_fillTemplate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeTemplate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_previousPoint",{enumerable:!0,configurable:!0,writable:!0,value:[0,0,0,0]}),Object.defineProperty(this,"_dindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_sindex",{enumerable:!0,configurable:!0,writable:!0,value:0})}_afterNew(){this._fillGenerator.y0(function(e){return e[3]}),this._fillGenerator.x0(function(e){return e[2]}),this._fillGenerator.y1(function(e){return e[1]}),this._fillGenerator.x1(function(e){return e[0]}),super._afterNew()}makeStroke(e){const t=this.mainContainer.children.push(e.make());return e.push(t),t}makeFill(e){const t=this.mainContainer.children.push(e.make());return e.push(t),t}_updateChildren(){this._strokeTemplate=void 0,this._fillTemplate=void 0;let e=this.get("xAxis"),t=this.get("yAxis");if(this.isDirty("stroke")){const i=this.get("stroke");this.strokes.template.set("stroke",i);const s=this._legendStroke;s&&s.states.lookup("default").set("stroke",i)}if(this.isDirty("fill")){const i=this.get("fill");this.fills.template.set("fill",i);const s=this._legendFill;s&&s.states.lookup("default").set("fill",i)}if(this.isDirty("curveFactory")){const i=this.get("curveFactory");i&&(this._strokeGenerator.curve(i),this._fillGenerator.curve(i))}if(e.inited&&t.inited){if(this._axesDirty||this._valuesDirty||this._stackDirty||this.isDirty("vcx")||this.isDirty("vcy")||this._sizeDirty||this.isDirty("connect")||this.isDirty("curveFactory")){this.fills.each(d=>{d.setPrivate("visible",!1)}),this.strokes.each(d=>{d.setPrivate("visible",!1)}),this.axisRanges.each(d=>{let h=d.fills;h&&h.each(u=>{u.setPrivate("visible",!1)});let c=d.strokes;c&&c.each(u=>{u.setPrivate("visible",!1)})});let i=this.startIndex(),s=this.strokes.template.get("templateField"),a=this.fills.template.get("templateField"),n=!0,r=!0;s&&(n=!1),a&&(r=!1);for(let d=i-1;d>=0;d--){let h=this.dataItems[d],c=!0,u=h.dataContext;if(s&&u[s]&&(n=!0),a&&u[a]&&(r=!0),w(this._valueFields,g=>{f(h.get(g))||(c=!1)}),c&&n&&r){i=d;break}}let o=this.dataItems.length,l=this.endIndex();if(l{f(h.get(u))||(c=!1)}),c){l=d+1;break}}}if(i>0&&i--,this._endIndex=l,this._clearGraphics(),this._sindex=0,this._dindex=i,this.dataItems.length==1)this._startSegment(0);else for(;this._dindex0&&(ke=!0);let De=!1;(T||y||P)&&(De=!0);const me={points:M,segments:D,stacked:T,getOpen:De,basePosX:F,basePosY:I,fillVisible:ke,xField:m,yField:_,xOpenField:x,yOpenField:b,vcx:g,vcy:p,baseAxis:u,xAxis:h,yAxis:c,locationX:J,locationY:Q,openLocationX:ne,openLocationY:O,minDistance:L};for(k=e;ke){i=k;break}l.template=C}}if(W){let C=N.dataContext[W];if(C){if(C instanceof G||(C=G.new(C)),this._fillTemplate=C,k>e){i=k;break}n.template=C}}if(!a){let C=this.dataItems[k+1];C&&u.shouldGap(N,C,s,E)&&(M=[],D.push(M),me.points=M)}}n.setRaw("userData",[e,k]),l.setRaw("userData",[e,k]),k===t&&this._endLine(M,D[0][0]),l&&this._drawStroke(l,D),n&&this._drawFill(n,D),this.axisRanges.each(N=>{const $=N.container,_e=N.fills,C=this.makeFill(_e);$&&$.children.push(C),C.setPrivate("visible",!0),this._drawFill(C,D);const Je=N.strokes,re=this.makeStroke(Je);$&&$.children.push(re),re.setPrivate("visible",!0),this._drawStroke(re,D),C.setRaw("userData",[e,k]),re.setRaw("userData",[e,k])})}_getPoints(e,t){let i=t.points,s=e.get("locationX",t.locationX),a=e.get("locationY",t.locationY),n=t.xAxis.getDataItemPositionX(e,t.xField,s,t.vcx),r=t.yAxis.getDataItemPositionY(e,t.yField,a,t.vcy);if(this._shouldInclude(n)){const o=this.getPoint(n,r),l=[o.x,o.y];if(o.x+=this._x,o.y+=this._y,e.set("point",o),t.fillVisible){let d=n,h=r;if(t.baseAxis===t.xAxis?h=t.basePosY:t.baseAxis===t.yAxis&&(d=t.basePosX),t.getOpen){let u=e.get(t.xOpenField),g=e.get(t.yOpenField);if(u!=null&&g!=null){let p=e.get("openLocationX",t.openLocationX),m=e.get("openLocationY",t.openLocationY);if(t.stacked){let _=e.get("stackToItemX"),x=e.get("stackToItemY");_?(d=t.xAxis.getDataItemPositionX(_,t.xField,p,_.component.get("vcx")),K(d)&&(d=t.basePosX)):d=t.yAxis===t.baseAxis?t.basePosX:t.xAxis.getDataItemPositionX(e,t.xOpenField,p,t.vcx),x?(h=t.yAxis.getDataItemPositionY(x,t.yField,m,x.component.get("vcy")),K(h)&&(h=t.basePosY)):h=t.xAxis===t.baseAxis?t.basePosY:t.yAxis.getDataItemPositionY(e,t.yOpenField,m,t.vcy)}else d=t.xAxis.getDataItemPositionX(e,t.xOpenField,p,t.vcx),h=t.yAxis.getDataItemPositionY(e,t.yOpenField,m,t.vcy)}}let c=this.getPoint(d,h);l[2]=c.x,l[3]=c.y}if(t.minDistance>0){const d=l[0],h=l[1],c=l[2],u=l[3],g=this._previousPoint,p=g[0],m=g[1],_=g[2],x=g[3];(Math.hypot(d-p,h-m)>t.minDistance||c&&u&&Math.hypot(c-_,u-x)>t.minDistance)&&(i.push(l),this._previousPoint=l)}else i.push(l)}}_endLine(e,t){}_drawStroke(e,t){e.get("visible")&&!e.get("forceHidden")&&e.set("draw",i=>{w(t,s=>{this._strokeGenerator.context(i),this._strokeGenerator(s)})})}_drawFill(e,t){e.get("visible")&&!e.get("forceHidden")&&e.set("draw",i=>{w(t,s=>{this._fillGenerator.context(i),this._fillGenerator(s)})})}_processAxisRange(e){super._processAxisRange(e),e.fills=new z(G.new({}),()=>V._new(this._root,{themeTags:X(e.fills.template.get("themeTags",[]),["line","series","fill"])},[this.fills.template,e.fills.template])),e.strokes=new z(G.new({}),()=>V._new(this._root,{themeTags:X(e.strokes.template.get("themeTags",[]),["line","series","stroke"])},[this.strokes.template,e.strokes.template]))}createLegendMarker(e){const t=this.get("legendDataItem");if(t){const i=t.get("marker"),s=t.get("markerRectangle");s&&s.setPrivate("visible",!1),i.set("background",oe.new(i._root,{fillOpacity:0,fill:ot(0)}));const a=i.children.push(V._new(i._root,{themeTags:["line","series","legend","marker","stroke"],interactive:!1},[this.strokes.template]));this._legendStroke=a;const n=i.children.push(V._new(i._root,{themeTags:["line","series","legend","marker","fill"]},[this.fills.template]));this._legendFill=n;const r=this._root.interfaceColors.get("disabled");if(a.states.create("disabled",{fill:r,stroke:r}),n.states.create("disabled",{fill:r,stroke:r}),this.bullets.length>0){const o=this.bullets.getIndex(0);if(o){const l=o(i._root,this,new pe(this,{},{}));if(l){const d=l.get("sprite");d instanceof V&&d.states.create("disabled",{fill:r,stroke:r}),d&&(d.set("tooltipText",void 0),d.set("tooltipHTML",void 0),i.children.push(d),d.setAll({x:i.width()/2,y:i.height()/2}))}}}}}}Object.defineProperty(we,"className",{enumerable:!0,configurable:!0,writable:!0,value:"LineSeries"}),Object.defineProperty(we,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([we.className])});export{ye as AxisRendererXAm5,ve as AxisRendererYAm5,ae as CategoryAxisAm5,Pe as ColumnSeriesAm5,we as LineSeriesAm5,fe as ValueAxisAm5,xe as XYChartAm5,be as XYCursorAm5}; diff --git a/assets/zh_Hans2-41156b15.js b/assets/zh_Hans2-41156b15.js new file mode 100644 index 0000000..29541cd --- /dev/null +++ b/assets/zh_Hans2-41156b15.js @@ -0,0 +1 @@ +const d={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"公元",_era_bc:"公元前",A:"上午",P:"下午",AM:"上午",PM:"下午","A.M.":"上午","P.M.":"下午",January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月",Jan:"1月",Feb:"2月",Mar:"3月",Apr:"4月","May(short)":"5月",Jun:"6月",Jul:"7月",Aug:"8月",Sep:"9月",Oct:"10月",Nov:"11月",Dec:"12月",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",Sun:"周日",Mon:"周一",Tue:"周二",Wed:"周三",Thu:"周四",Fri:"周五",Sat:"周六",_dateOrd:function(e){let _="th";if(e<11||e>13)switch(e%10){case 1:case 2:case 3:_="日"}return _},"Zoom Out":"缩放",Play:"播放",Stop:"停靠点",Legend:"图例","Press ENTER to toggle":"",Loading:"加载",Home:"主页",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"打印",Image:"影像",Data:"数据",Print:"打印","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"自 %1 至 %2","From %1":"自 %1","To %1":"至 %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/assets/zh_Hant2-8bca75bb.js b/assets/zh_Hant2-8bca75bb.js new file mode 100644 index 0000000..7a40b95 --- /dev/null +++ b/assets/zh_Hant2-8bca75bb.js @@ -0,0 +1 @@ +const d={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"西元",_era_bc:"西元前",A:"上午",P:"下午",AM:"上午",PM:"下午","A.M.":"上午","P.M.":"下午",January:"1月",February:"2月",March:"3月",April:"4月",May:"5月",June:"6月",July:"7月",August:"8月",September:"9月",October:"10月",November:"11月",December:"12月",Jan:"1月",Feb:"2月",Mar:"3月",Apr:"4月","May(short)":"5月",Jun:"6月",Jul:"7月",Aug:"8月",Sep:"9月",Oct:"10月",Nov:"11月",Dec:"12月",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",Sun:"週日",Mon:"週一",Tue:"週二",Wed:"週三",Thu:"週四",Fri:"週五",Sat:"週六",_dateOrd:function(e){let _="th";if(e<11||e>13)switch(e%10){case 1:case 2:case 3:_="日"}return _},"Zoom Out":"縮放",Play:"播放",Stop:"停止",Legend:"圖例","Press ENTER to toggle":"",Loading:"正在載入",Home:"首頁",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"列印",Image:"影像",Data:"資料",Print:"列印","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"從 %1 至 %2","From %1":"從 %1","To %1":"至 %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/index.html b/index.html new file mode 100644 index 0000000..024713e --- /dev/null +++ b/index.html @@ -0,0 +1,15 @@ + + + + + + Tetris React + ArcGIS + + + + + +
+ + +